summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/source/alatex/base/0areadme.txt89
-rw-r--r--Master/texmf-dist/source/alatex/base/COPYING339
-rw-r--r--Master/texmf-dist/source/alatex/base/Makefile132
-rw-r--r--Master/texmf-dist/source/alatex/base/README89
-rw-r--r--Master/texmf-dist/source/alatex/base/VERSION-1.00
-rw-r--r--Master/texmf-dist/source/alatex/base/abugs.txt16
-rw-r--r--Master/texmf-dist/source/alatex/base/ainstall.txt92
-rw-r--r--Master/texmf-dist/source/alatex/base/alatex.dtx531
-rw-r--r--Master/texmf-dist/source/alatex/base/alatex.ltx89
-rw-r--r--Master/texmf-dist/source/alatex/base/amanifst.txt50
-rw-r--r--Master/texmf-dist/source/alatex/base/aunpack.ins135
-rw-r--r--Master/texmf-dist/source/alatex/base/aunpcked.txt9
-rw-r--r--Master/texmf-dist/source/alatex/base/testdist.dtx164
-rw-r--r--Master/texmf-dist/source/cslatex/base/cslatex.dtx1076
-rw-r--r--Master/texmf-dist/source/cslatex/base/cslatex.ins52
-rw-r--r--Master/texmf-dist/source/cslatex/base/cslatex.txt209
-rw-r--r--Master/texmf-dist/source/eplain/base/add-date28
-rw-r--r--Master/texmf-dist/source/eplain/base/add-version24
-rw-r--r--Master/texmf-dist/source/eplain/base/etex.tex5
-rw-r--r--Master/texmf-dist/source/eplain/base/fix-checksum20
-rw-r--r--Master/texmf-dist/source/eplain/base/merge84
-rw-r--r--Master/texmf-dist/source/eplain/base/packages.zipbin0 -> 11374 bytes
-rw-r--r--Master/texmf-dist/source/eplain/base/test/allref.tex15
-rw-r--r--Master/texmf-dist/source/eplain/base/test/boxes.tex11
-rw-r--r--Master/texmf-dist/source/eplain/base/test/boxit.tex24
-rw-r--r--Master/texmf-dist/source/eplain/base/test/catcode.tex8
-rw-r--r--Master/texmf-dist/source/eplain/base/test/center.tex12
-rw-r--r--Master/texmf-dist/source/eplain/base/test/cite.bib25
-rw-r--r--Master/texmf-dist/source/eplain/base/test/cite.tex35
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citeall.tex12
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citealph.tex26
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citeapa.tex26
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citebegin.tex20
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citecust.tex38
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citenote.tex13
-rw-r--r--Master/texmf-dist/source/eplain/base/test/citex.tex8
-rw-r--r--Master/texmf-dist/source/eplain/base/test/colfootn.tex18
-rw-r--r--Master/texmf-dist/source/eplain/base/test/colrule.tex33
-rw-r--r--Master/texmf-dist/source/eplain/base/test/column.tex228
-rw-r--r--Master/texmf-dist/source/eplain/base/test/column2.tex51
-rw-r--r--Master/texmf-dist/source/eplain/base/test/column3.tex23
-rw-r--r--Master/texmf-dist/source/eplain/base/test/commdiags.tex111
-rw-r--r--Master/texmf-dist/source/eplain/base/test/contents.tex30
-rw-r--r--Master/texmf-dist/source/eplain/base/test/displine.tex36
-rw-r--r--Master/texmf-dist/source/eplain/base/test/double.tex24
-rw-r--r--Master/texmf-dist/source/eplain/base/test/double2.tex163
-rw-r--r--Master/texmf-dist/source/eplain/base/test/dvipdfm.tex111
-rw-r--r--Master/texmf-dist/source/eplain/base/test/ecommdiag.tex15
-rw-r--r--Master/texmf-dist/source/eplain/base/test/emergncy.tex19
-rw-r--r--Master/texmf-dist/source/eplain/base/test/env.tex42
-rw-r--r--Master/texmf-dist/source/eplain/base/test/eqdef.tex15
-rw-r--r--Master/texmf-dist/source/eplain/base/test/eqref.tex141
-rw-r--r--Master/texmf-dist/source/eplain/base/test/example.eps389
-rw-r--r--Master/texmf-dist/source/eplain/base/test/filexist.tex22
-rw-r--r--Master/texmf-dist/source/eplain/base/test/flynn.tex7
-rw-r--r--Master/texmf-dist/source/eplain/base/test/footnote.tex88
-rw-r--r--Master/texmf-dist/source/eplain/base/test/frac.tex24
-rw-r--r--Master/texmf-dist/source/eplain/base/test/gcol.tex218
-rw-r--r--Master/texmf-dist/source/eplain/base/test/hlcite.tex55
-rw-r--r--Master/texmf-dist/source/eplain/base/test/hlfoot.tex47
-rw-r--r--Master/texmf-dist/source/eplain/base/test/hlidx.mst2
-rw-r--r--Master/texmf-dist/source/eplain/base/test/hlidx.tex138
-rw-r--r--Master/texmf-dist/source/eplain/base/test/hlink.tex144
-rw-r--r--Master/texmf-dist/source/eplain/base/test/ian.tex28
-rw-r--r--Master/texmf-dist/source/eplain/base/test/index.tex36
-rw-r--r--Master/texmf-dist/source/eplain/base/test/jan.tex15
-rw-r--r--Master/texmf-dist/source/eplain/base/test/justify.tex106
-rw-r--r--Master/texmf-dist/source/eplain/base/test/knuth.bib17
-rw-r--r--Master/texmf-dist/source/eplain/base/test/label.tex8
-rw-r--r--Master/texmf-dist/source/eplain/base/test/latexcite.tex9
-rw-r--r--Master/texmf-dist/source/eplain/base/test/liang.tex300
-rw-r--r--Master/texmf-dist/source/eplain/base/test/list.tex90
-rw-r--r--Master/texmf-dist/source/eplain/base/test/listing.tex10
-rw-r--r--Master/texmf-dist/source/eplain/base/test/logo.tex20
-rw-r--r--Master/texmf-dist/source/eplain/base/test/loop.tex20
-rw-r--r--Master/texmf-dist/source/eplain/base/test/loopnext.tex21
-rw-r--r--Master/texmf-dist/source/eplain/base/test/mag.tex14
-rw-r--r--Master/texmf-dist/source/eplain/base/test/makecol.tex17
-rw-r--r--Master/texmf-dist/source/eplain/base/test/margin.tex68
-rw-r--r--Master/texmf-dist/source/eplain/base/test/matrix.tex18
-rw-r--r--Master/texmf-dist/source/eplain/base/test/mdisplay.tex215
-rw-r--r--Master/texmf-dist/source/eplain/base/test/names.tex21
-rw-r--r--Master/texmf-dist/source/eplain/base/test/noarrow.tex8
-rw-r--r--Master/texmf-dist/source/eplain/base/test/nobib.tex10
-rw-r--r--Master/texmf-dist/source/eplain/base/test/nonouter.tex11
-rw-r--r--Master/texmf-dist/source/eplain/base/test/optional.tex30
-rw-r--r--Master/texmf-dist/source/eplain/base/test/outer.tex26
-rw-r--r--Master/texmf-dist/source/eplain/base/test/page.tex8
-rw-r--r--Master/texmf-dist/source/eplain/base/test/path.tex25
-rw-r--r--Master/texmf-dist/source/eplain/base/test/pcol.tex183
-rw-r--r--Master/texmf-dist/source/eplain/base/test/pdftex.tex112
-rw-r--r--Master/texmf-dist/source/eplain/base/test/psfont.map78
-rw-r--r--Master/texmf-dist/source/eplain/base/test/rex.tex277
-rw-r--r--Master/texmf-dist/source/eplain/base/test/rule.tex23
-rw-r--r--Master/texmf-dist/source/eplain/base/test/sidx.tex5
-rw-r--r--Master/texmf-dist/source/eplain/base/test/subdef.tex24
-rw-r--r--Master/texmf-dist/source/eplain/base/test/tenenb.tex48
-rw-r--r--Master/texmf-dist/source/eplain/base/test/tenenb2.tex23
-rw-r--r--Master/texmf-dist/source/eplain/base/test/test.tex14
-rw-r--r--Master/texmf-dist/source/eplain/base/test/time.tex10
-rw-r--r--Master/texmf-dist/source/eplain/base/test/truemarg.tex36
-rw-r--r--Master/texmf-dist/source/eplain/base/test/uscore.bib5
-rw-r--r--Master/texmf-dist/source/eplain/base/test/uscore.tex14
-rw-r--r--Master/texmf-dist/source/eplain/base/test/usepackage.tex146
-rw-r--r--Master/texmf-dist/source/eplain/base/test/verb2.tex61
-rw-r--r--Master/texmf-dist/source/eplain/base/test/verbatim.tex65
-rw-r--r--Master/texmf-dist/source/eplain/base/test/vlach.tex258
-rw-r--r--Master/texmf-dist/source/eplain/base/test/whitespc.tex51
-rw-r--r--Master/texmf-dist/source/eplain/base/test/xampl.tex13
-rw-r--r--Master/texmf-dist/source/eplain/base/test/xref.tex39
-rw-r--r--Master/texmf-dist/source/eplain/base/util/idxuniq37
-rw-r--r--Master/texmf-dist/source/eplain/base/util/trimsee106
-rw-r--r--Master/texmf-dist/source/eplain/base/xeplain.tex4783
-rw-r--r--Master/texmf-dist/source/fontinst/base/CHANGES644
-rw-r--r--Master/texmf-dist/source/fontinst/base/fibasics.dtx2273
-rw-r--r--Master/texmf-dist/source/fontinst/base/ficommon.dtx2415
-rw-r--r--Master/texmf-dist/source/fontinst/base/ficonv.dtx2807
-rw-r--r--Master/texmf-dist/source/fontinst/base/filtfam.dtx1187
-rw-r--r--Master/texmf-dist/source/fontinst/base/fimain.dtx4848
-rw-r--r--Master/texmf-dist/source/fontinst/base/fimapgen.dtx1533
-rw-r--r--Master/texmf-dist/source/fontinst/base/fisource.sty685
-rw-r--r--Master/texmf-dist/source/fontinst/base/fisource.tex2985
-rw-r--r--Master/texmf-dist/source/fontinst/base/fontinst.ins131
-rw-r--r--Master/texmf-dist/source/fontinst/base/trig.dtx308
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/README67
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/docindex.dtx2100
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/docindex.ins48
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/docindex.pdfbin0 -> 284629 bytes
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.dtx5166
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.ins37
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.pdfbin0 -> 482233 bytes
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.pdfbin0 -> 181813 bytes
-rw-r--r--Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.tex2599
-rw-r--r--Master/texmf-dist/source/latex/SIunits/SIunits.drv26
-rw-r--r--Master/texmf-dist/source/latex/SIunits/SIunits.dtx3166
-rw-r--r--Master/texmf-dist/source/latex/SIunits/SIunits.ins70
-rw-r--r--Master/texmf-dist/source/latex/alnumsec/alnumsec.dtx549
-rw-r--r--Master/texmf-dist/source/latex/alnumsec/alnumsec.ins85
-rw-r--r--Master/texmf-dist/source/latex/apa/CHANGELOG232
-rw-r--r--Master/texmf-dist/source/latex/apa/LICENCE13
-rw-r--r--Master/texmf-dist/source/latex/apa/endfloat.cfg31
-rw-r--r--Master/texmf-dist/source/latex/appendix/appendix.dtx1055
-rw-r--r--Master/texmf-dist/source/latex/appendix/appendix.ins79
-rw-r--r--Master/texmf-dist/source/latex/babelbib/Makefile102
-rw-r--r--Master/texmf-dist/source/latex/babelbib/babelbib.dtx6966
-rw-r--r--Master/texmf-dist/source/latex/babelbib/babelbib.ins61
-rw-r--r--Master/texmf-dist/source/latex/bbding/bbding.dtx847
-rw-r--r--Master/texmf-dist/source/latex/bbding/bbding.ins11
-rw-r--r--Master/texmf-dist/source/latex/boites/Makefile10
-rw-r--r--Master/texmf-dist/source/latex/boites/ligne_qui_ondule_sur_la_gauche.eps32
-rw-r--r--Master/texmf-dist/source/latex/bpchem/bpchem.dtx486
-rw-r--r--Master/texmf-dist/source/latex/bpchem/bpchem.ins6
-rw-r--r--Master/texmf-dist/source/latex/burmese/birm.pl306
-rw-r--r--Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx711
-rw-r--r--Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins24
-rw-r--r--Master/texmf-dist/source/latex/chemsym/00readme.chs34
-rw-r--r--Master/texmf-dist/source/latex/chemsym/chemsym.dtx646
-rw-r--r--Master/texmf-dist/source/latex/chemsym/chemsym.ins58
-rw-r--r--Master/texmf-dist/source/latex/cmbright/cmbr.fdd311
-rw-r--r--Master/texmf-dist/source/latex/cmbright/cmbright.dtx513
-rw-r--r--Master/texmf-dist/source/latex/cmbright/cmbright.ins26
-rw-r--r--Master/texmf-dist/source/latex/cmbright/oinst.ins36
-rw-r--r--Master/texmf-dist/source/latex/comment/comment.cut3
-rw-r--r--Master/texmf-dist/source/latex/datetime/datetime.dtx4817
-rw-r--r--Master/texmf-dist/source/latex/datetime/datetime.ins106
-rw-r--r--Master/texmf-dist/source/latex/deleq/00readme.dlq29
-rw-r--r--Master/texmf-dist/source/latex/deleq/deleq.dtx937
-rw-r--r--Master/texmf-dist/source/latex/deleq/deleq.ins61
-rw-r--r--Master/texmf-dist/source/latex/diagnose/INSTALL49
-rw-r--r--Master/texmf-dist/source/latex/dinbrief/dinbrief.drv85
-rw-r--r--Master/texmf-dist/source/latex/dinbrief/dinbrief.dtx7653
-rw-r--r--Master/texmf-dist/source/latex/dinbrief/dinbrief.ins215
-rw-r--r--Master/texmf-dist/source/latex/ebezier/ebezier.dtx1875
-rw-r--r--Master/texmf-dist/source/latex/ebezier/ebezier.ins32
-rw-r--r--Master/texmf-dist/source/latex/ellipsis/ellipsis.dtx423
-rw-r--r--Master/texmf-dist/source/latex/ellipsis/ellipsis.ins56
-rw-r--r--Master/texmf-dist/source/latex/epigraph/epigraph.dtx813
-rw-r--r--Master/texmf-dist/source/latex/epigraph/epigraph.ins59
-rw-r--r--Master/texmf-dist/source/latex/eqlist/eqlist.dtx551
-rw-r--r--Master/texmf-dist/source/latex/eqlist/eqlist.ins20
-rw-r--r--Master/texmf-dist/source/latex/euler/euler.dtx774
-rw-r--r--Master/texmf-dist/source/latex/euler/euler.ins11
-rw-r--r--Master/texmf-dist/source/latex/euler/legal.txt13
-rw-r--r--Master/texmf-dist/source/latex/float/float.dtx873
-rw-r--r--Master/texmf-dist/source/latex/float/float.ins31
-rw-r--r--Master/texmf-dist/source/latex/fmp/fmp-doc.hs37
-rw-r--r--Master/texmf-dist/source/latex/fmp/fmp.dtx675
-rw-r--r--Master/texmf-dist/source/latex/fmp/fmp.ins72
-rw-r--r--Master/texmf-dist/source/latex/fundus/calligra.dtx169
-rw-r--r--Master/texmf-dist/source/latex/fundus/calligra.ins134
-rw-r--r--Master/texmf-dist/source/latex/fundus/la.dtx236
-rw-r--r--Master/texmf-dist/source/latex/fundus/la.ins135
-rw-r--r--Master/texmf-dist/source/latex/fundus/outline.dtx185
-rw-r--r--Master/texmf-dist/source/latex/fundus/outline.ins133
-rw-r--r--Master/texmf-dist/source/latex/fundus/pvscript.dtx175
-rw-r--r--Master/texmf-dist/source/latex/fundus/pvscript.ins135
-rw-r--r--Master/texmf-dist/source/latex/fundus/startrek.dtx201
-rw-r--r--Master/texmf-dist/source/latex/fundus/startrek.ins141
-rw-r--r--Master/texmf-dist/source/latex/fundus/startrek.map9
-rw-r--r--Master/texmf-dist/source/latex/fundus/stclass.zipbin0 -> 28105 bytes
-rw-r--r--Master/texmf-dist/source/latex/fundus/stmov.zipbin0 -> 45305 bytes
-rw-r--r--Master/texmf-dist/source/latex/fundus/suetterl.dtx173
-rw-r--r--Master/texmf-dist/source/latex/fundus/suetterl.ins135
-rw-r--r--Master/texmf-dist/source/latex/fundus/tngcril.zipbin0 -> 82116 bytes
-rw-r--r--Master/texmf-dist/source/latex/fundus/tngmon.zipbin0 -> 108519 bytes
-rw-r--r--Master/texmf-dist/source/latex/fundus/tngtit.zipbin0 -> 35871 bytes
-rw-r--r--Master/texmf-dist/source/latex/fundus/twcal.dtx193
-rw-r--r--Master/texmf-dist/source/latex/fundus/twcal.ins135
-rw-r--r--Master/texmf-dist/source/latex/fundus/va.dtx195
-rw-r--r--Master/texmf-dist/source/latex/fundus/va.ins135
-rw-r--r--Master/texmf-dist/source/latex/glossary/glossary.dtx4778
-rw-r--r--Master/texmf-dist/source/latex/glossary/glossary.ins36
-rw-r--r--Master/texmf-dist/source/latex/hyphenat/hyphenat.dtx893
-rw-r--r--Master/texmf-dist/source/latex/hyphenat/hyphenat.ins74
-rw-r--r--Master/texmf-dist/source/latex/lcd/lcd.dtx972
-rw-r--r--Master/texmf-dist/source/latex/lcd/lcd.ins67
-rw-r--r--Master/texmf-dist/source/latex/mailing/mailing.dtx307
-rw-r--r--Master/texmf-dist/source/latex/mailing/mailing.ins86
-rw-r--r--Master/texmf-dist/source/latex/method/method.dtx845
-rw-r--r--Master/texmf-dist/source/latex/method/method.ins60
-rw-r--r--Master/texmf-dist/source/latex/method/readme66
-rw-r--r--Master/texmf-dist/source/latex/moresize/moresize.dtx669
-rw-r--r--Master/texmf-dist/source/latex/moresize/moresize.ins45
-rw-r--r--Master/texmf-dist/source/latex/moresize/moresize.upl52
-rw-r--r--Master/texmf-dist/source/latex/oldstyle/oldstyle.dtx144
-rw-r--r--Master/texmf-dist/source/latex/oldstyle/oldstyle.ins25
-rw-r--r--Master/texmf-dist/source/latex/petri-nets/COPYING340
-rw-r--r--Master/texmf-dist/source/latex/petri-nets/pn2pdf102
-rw-r--r--Master/texmf-dist/source/latex/pict2e/p2e-drivers.dtx526
-rw-r--r--Master/texmf-dist/source/latex/pict2e/pict2e.dtx3239
-rw-r--r--Master/texmf-dist/source/latex/pict2e/pict2e.ins102
-rw-r--r--Master/texmf-dist/source/latex/piff/ams.dtx206
-rw-r--r--Master/texmf-dist/source/latex/piff/ams.ins49
-rw-r--r--Master/texmf-dist/source/latex/prettyref/prettyref.dtx134
-rw-r--r--Master/texmf-dist/source/latex/prettyref/prettyref.ins10
-rw-r--r--Master/texmf-dist/source/latex/pst-3d/pst-3d.dtx1608
-rw-r--r--Master/texmf-dist/source/latex/pst-3d/pst-3d.ins38
-rw-r--r--Master/texmf-dist/source/latex/pst-poly/pst-poly.dtx1679
-rw-r--r--Master/texmf-dist/source/latex/pst-poly/pst-poly.ins38
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxdocext.dtx1208
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxgrid.dtx4815
-rw-r--r--Master/texmf-dist/source/latex/revtex/ltxutil.dtx3534
-rw-r--r--Master/texmf-dist/source/latex/revtex/revtex4.dtx8728
-rw-r--r--Master/texmf-dist/source/latex/revtex/revtex4.ins36
-rw-r--r--Master/texmf-dist/source/latex/revtex/textcase.dtx404
-rw-r--r--Master/texmf-dist/source/latex/scalebar/scalebar.dtx518
-rw-r--r--Master/texmf-dist/source/latex/scalebar/scalebar.ins55
-rw-r--r--Master/texmf-dist/source/latex/soul/Makefile57
-rw-r--r--Master/texmf-dist/source/latex/soul/soul.dtx4520
-rw-r--r--Master/texmf-dist/source/latex/soul/soul.ins10
-rw-r--r--Master/texmf-dist/source/latex/splitindex/install.sh178
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitidx.dtx1393
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitidx.ins87
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex-Linux-i386bin0 -> 9924 bytes
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex-OpenBSD-i386bin0 -> 16384 bytes
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex.c576
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex.classbin0 -> 9303 bytes
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex.exebin0 -> 18944 bytes
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex.java415
-rw-r--r--Master/texmf-dist/source/latex/splitindex/splitindex.pl186
-rw-r--r--Master/texmf-dist/source/latex/svn/Makefile68
-rw-r--r--Master/texmf-dist/source/latex/svn/svn.dtx500
-rw-r--r--Master/texmf-dist/source/latex/svn/svn.ins58
-rw-r--r--Master/texmf-dist/source/latex/svninfo/Makefile108
-rw-r--r--Master/texmf-dist/source/latex/svninfo/svninfo.dtx1328
-rw-r--r--Master/texmf-dist/source/latex/svninfo/svninfo.ins97
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/dtxload.dtx1256
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/dtxload.ins54
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/dtxload.tcl361
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/examples/README.txt40
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.dtx1155
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.ins54
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/examples/pdf.dtx796
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/examples/pdf.ins55
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/pstokens.dtx979
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tcldoc.dtx3402
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tcldoc.ins45
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tclldoc.dtx4065
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tclldoc.ins51
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tools/README.txt46
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tools/eemenu.dtx4477
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tools/eemenu.ins66
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.dtx234
-rw-r--r--Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.ins31
-rw-r--r--Master/texmf-dist/source/latex/texshade/texshade.dtx15315
-rw-r--r--Master/texmf-dist/source/latex/texshade/texshade.ins72
-rw-r--r--Master/texmf-dist/source/latex/timesht/timesht.dtx410
-rw-r--r--Master/texmf-dist/source/latex/timesht/timesht.ins87
-rw-r--r--Master/texmf-dist/source/latex/tugboat/tugboat.dtx3774
-rw-r--r--Master/texmf-dist/source/latex/tugboat/tugboat.ins60
-rw-r--r--Master/texmf-dist/source/latex/typogrid/Makefile69
-rw-r--r--Master/texmf-dist/source/latex/typogrid/typogrid.dtx214
-rw-r--r--Master/texmf-dist/source/latex/typogrid/typogrid.ins25
-rw-r--r--Master/texmf-dist/source/metapost/mpattern/mpp55
-rw-r--r--Master/texmf-dist/source/psizzl/base/aaaread.me10
-rw-r--r--Master/texmf-dist/source/startex/base/INSTALL75
-rw-r--r--Master/texmf-dist/source/startex/base/README54
-rw-r--r--Master/texmf-dist/source/startex/base/startex.bib70
-rw-r--r--Master/texmf-dist/source/startex/base/startex.dtx2734
-rw-r--r--Master/texmf-dist/source/startex/base/startex.ins13
300 files changed, 168749 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/alatex/base/0areadme.txt b/Master/texmf-dist/source/alatex/base/0areadme.txt
new file mode 100644
index 00000000000..5a4ce039406
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/0areadme.txt
@@ -0,0 +1,89 @@
+
+
+ ALaTeX Distribution Guide
+
+ 21 January 1996
+ Matt Swift <swift@bu.edu>
+
+
+WELCOME TO ALaTeX!
+
+This file is a brief guide to the ALaTeX document preparation system,
+which is a small but useful modification of the LaTeX document
+preparation system. You may produce a discussion of the goals of
+ALaTeX by processing the file `metaclas.tex' with LaTeX. The paper is
+based on parts of the article "Modularity in LaTeX" by Matt Swift in
+TUGboat vol. 16 no. 3.
+
+ALaTeX is NOT part of the LaTeX distribution. It is maintained
+exclusively by Matt Swift <swift@bu.edu>, NOT by the LaTeX
+maintainers.
+
+The ALaTeX distribution will probably work with all LaTeX versions,
+but it has been tested starting with the December 1995 release. If a
+change in the LaTeX kernel requires a change in ALaTeX that makes it
+incompatible with earlier LaTeX kernels, I will increase the major
+version number. If I make an drop-in improvement to ALaTeX, I will
+update the minor version number.
+
+The ALaTeX version is displayed on the screen every time ALaTeX is
+invoked with a reminder that ALaTeX is not standard LaTeX.
+
+The file 00readme.txt in the LaTeX distribution contains information
+about the LaTeX distribution.
+
+Here is a brief description of some of the ALaTeX files:
+
+ - ainstall.txt describes how to install ALaTeX and its documentation.
+ - metaclas.cfg is the standard ALaTeX metaclass.
+ - alatex.tex documents ALaTeX and its standard metaclass.
+ - alatex.ltx is a patch to the LaTeX kernel.
+ - amanifst.txt lists all the files in the ALaTeX distribution with
+ one line of information about their contents.
+ - abugs.txt describes how to submit a bug report for ALaTeX.
+ - COPYING is a copy of the GNU General Public License.
+ - Makefile is a Unix makefile for building and installing ALaTeX on
+ Unix systems.
+
+
+COPYRIGHT
+=========
+
+The ALaTeX files in this distribution are copyright 1995 Matt Swift
+<swift@bu.edu>. All rights reserved.
+
+
+WARRANTY
+========
+
+There is no warranty for ALaTeX. See the file COPYING for details.
+
+
+DISTRIBUTION CONDITIONS
+=======================
+
+ALaTeX may be distributed under the conditions of the GNU General
+Public License, which is in the file COPYING.
+
+
+ACKNOWLEDGMENT
+==============
+
+The ALaTeX format that the files in this distribution will generate
+represents a VERY small modification of the LaTeX format, whose source
+files are copyright 1993-1995 the LaTeX3 project and the individual
+authors:
+
+ Leslie Lamport
+ Johannes Braams
+ David Carlisle
+ Alan Jeffrey
+ Frank Mittelbach
+ Chris Rowley
+ Rainer Schoepf
+
+The authors of the original LaTeX files deserve all of the credit for
+the functionality of ALaTeX. The author of ALaTeX added only the
+smallest of contributions, and thanks the original authors for writing
+the files and for distributing them under conditions which allowed him
+to legally make and distribute his addition.
diff --git a/Master/texmf-dist/source/alatex/base/COPYING b/Master/texmf-dist/source/alatex/base/COPYING
new file mode 100644
index 00000000000..e77696ae8dd
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/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
+
+ 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/alatex/base/Makefile b/Master/texmf-dist/source/alatex/base/Makefile
new file mode 100644
index 00000000000..05d40b85491
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/Makefile
@@ -0,0 +1,132 @@
+# ALaTeX makefile for Unix
+#
+# WARNING: some things in this makefile may be specific to the web2c TeX
+# distribution, specifically the setting of TEXINPUTS.
+#
+# If you use A4 paper, setting ARTICLEOPTS to
+# a4paper
+# may save about 30 pages. The variable is an argument list that is
+# passed to the article class.
+ARTICLEOPTS =
+
+# Where should metaclass.cfg go?
+CFGDIR = /usr/local/lib/texmf/tex/latex/config
+
+# Where should the ALaTeX format go?
+FMTDIR = /usr/local/lib/texmf/ini
+
+# Where should the DVI documentation for ALaTeX go?
+DOCDIR = /usr/local/lib/texmf/doc/alatex
+
+# Where should the ALaTeX executable (link) go?
+BINDIR = /usr/local/bin
+
+# Where are the LaTeX base distribution files?
+BASEDIR = /usr/local/src/texmf/macros/latex-95-12/base
+
+# What options should be passed to install for installing
+# everything except the executable?
+INSTALLOPTS = -c -m 644
+
+# END OF USER-CONFIGURABLE OPTIONS, except for experts of course.
+
+home = alatex
+version = 1.0
+versionfile = VERSION-$(version)
+archname = alatex-$(version)
+
+files = $(versionfile) COPYING \
+ Makefile aunpack.ins aunpcked.txt amanifst.txt \
+ 0areadme.txt README abugs.txt ainstall.txt \
+ alatex.dtx alatex.tex
+
+doc-files = alatex.dvi
+
+.PHONY: all install
+.PHONY: alatex doc install-alatex install-doc
+.PHONY: clean help default
+.PHONY: distribution
+
+default help:
+ @echo ; \
+ echo "Look over the variables at the top of the Makefile and adjust them if"; \
+ echo "you want. You probably want to try these targets in this order:"; \
+ echo ""; \
+ echo " all makes alatex.fmt and metaclas.cfg"; \
+ echo " install installs them and creates a link from alatex to virtex"; \
+ echo " check runs alatex ltxcheck.tex"; \
+ echo " clean removes auxiliary and rebuildable files"; \
+ echo ""; \
+ echo "Other targets you might want to use are:"; \
+ echo ""; \
+ echo " doc makes the ALaTeX documentation"; \
+ echo " install-doc installs it"; \
+ echo
+
+all: alatex
+
+alatex: alatex.fmt metaclas.cfg
+
+doc: alatex.dvi
+
+$(versionfile):
+ touch $@
+
+README:
+ ln -s 0areadme.txt $@
+
+alatex.ltx metaclas.cfg: alatex.dtx aunpack.ins \
+ README $(versionfile)
+ TEXINPUTS=.:$(BASEDIR):; export TEXINPUTS; \
+ tex aunpack.ins
+
+alatex.fmt: alatex.ltx
+ initex \&latex alatex.ltx
+
+alatex.dvi: %.dvi: %.tex %.dtx
+ echo "\PassOptionsToClass{$(ARTICLEOPTS)}{article}" > ltxdoc.cfg
+ latex $*.tex
+ INDEXSTYLE=.:$(BASEDIR); export INDEXSTYLE; \
+ makeindex -s gind.ist $*.idx
+ latex $*.tex
+ latex $*.tex
+
+install: install-alatex
+
+install-alatex: alatex
+ mkdir -p $(BINDIR) $(FMTDIR) $(CFGDIR)
+ rm -f $(BINDIR)/alatex
+ ln -f -s `type virtex | cut -d' ' -f 3` $(BINDIR)/alatex
+ install $(INSTALLOPTS) alatex.fmt $(FMTDIR)
+ install $(INSTALLOPTS) metaclas.cfg $(CFGDIR)
+
+install-doc: doc
+ mkdir -p $(DOCDIR)
+ install $(INSTALLOPTS) $(doc-files) $(DOCDIR)
+
+check: install
+ TEXINPUTS=.:$(BASEDIR):; export TEXINPUTS; \
+ $(BINDIR)/alatex ltxcheck.tex
+
+distribution: $(files)
+ rm -f $(archname).tar.gz
+ cd ..; \
+ ln -s $(home) $(archname); \
+ tar czf $(archname).tar.gz \
+ $(addprefix $(archname)/, $(files)); \
+ rm $(archname); \
+ mv $(archname).tar.gz $(home)
+
+clean:
+ rm -f aunpack.log \
+ metaclas.cfg \
+ alatex.{log,ltx,ind,idx,ilg,log,aux,toc} \
+ ltxcheck.{log,aux} \
+ ltxdoc.cfg
+
+realclean veryclean: clean
+ rm -f $(doc-files) \
+ alatex.fmt \
+ README $(versionfile) \
+ $(archname).tar.gz
+
diff --git a/Master/texmf-dist/source/alatex/base/README b/Master/texmf-dist/source/alatex/base/README
new file mode 100644
index 00000000000..5a4ce039406
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/README
@@ -0,0 +1,89 @@
+
+
+ ALaTeX Distribution Guide
+
+ 21 January 1996
+ Matt Swift <swift@bu.edu>
+
+
+WELCOME TO ALaTeX!
+
+This file is a brief guide to the ALaTeX document preparation system,
+which is a small but useful modification of the LaTeX document
+preparation system. You may produce a discussion of the goals of
+ALaTeX by processing the file `metaclas.tex' with LaTeX. The paper is
+based on parts of the article "Modularity in LaTeX" by Matt Swift in
+TUGboat vol. 16 no. 3.
+
+ALaTeX is NOT part of the LaTeX distribution. It is maintained
+exclusively by Matt Swift <swift@bu.edu>, NOT by the LaTeX
+maintainers.
+
+The ALaTeX distribution will probably work with all LaTeX versions,
+but it has been tested starting with the December 1995 release. If a
+change in the LaTeX kernel requires a change in ALaTeX that makes it
+incompatible with earlier LaTeX kernels, I will increase the major
+version number. If I make an drop-in improvement to ALaTeX, I will
+update the minor version number.
+
+The ALaTeX version is displayed on the screen every time ALaTeX is
+invoked with a reminder that ALaTeX is not standard LaTeX.
+
+The file 00readme.txt in the LaTeX distribution contains information
+about the LaTeX distribution.
+
+Here is a brief description of some of the ALaTeX files:
+
+ - ainstall.txt describes how to install ALaTeX and its documentation.
+ - metaclas.cfg is the standard ALaTeX metaclass.
+ - alatex.tex documents ALaTeX and its standard metaclass.
+ - alatex.ltx is a patch to the LaTeX kernel.
+ - amanifst.txt lists all the files in the ALaTeX distribution with
+ one line of information about their contents.
+ - abugs.txt describes how to submit a bug report for ALaTeX.
+ - COPYING is a copy of the GNU General Public License.
+ - Makefile is a Unix makefile for building and installing ALaTeX on
+ Unix systems.
+
+
+COPYRIGHT
+=========
+
+The ALaTeX files in this distribution are copyright 1995 Matt Swift
+<swift@bu.edu>. All rights reserved.
+
+
+WARRANTY
+========
+
+There is no warranty for ALaTeX. See the file COPYING for details.
+
+
+DISTRIBUTION CONDITIONS
+=======================
+
+ALaTeX may be distributed under the conditions of the GNU General
+Public License, which is in the file COPYING.
+
+
+ACKNOWLEDGMENT
+==============
+
+The ALaTeX format that the files in this distribution will generate
+represents a VERY small modification of the LaTeX format, whose source
+files are copyright 1993-1995 the LaTeX3 project and the individual
+authors:
+
+ Leslie Lamport
+ Johannes Braams
+ David Carlisle
+ Alan Jeffrey
+ Frank Mittelbach
+ Chris Rowley
+ Rainer Schoepf
+
+The authors of the original LaTeX files deserve all of the credit for
+the functionality of ALaTeX. The author of ALaTeX added only the
+smallest of contributions, and thanks the original authors for writing
+the files and for distributing them under conditions which allowed him
+to legally make and distribute his addition.
diff --git a/Master/texmf-dist/source/alatex/base/VERSION-1.0 b/Master/texmf-dist/source/alatex/base/VERSION-1.0
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/VERSION-1.0
diff --git a/Master/texmf-dist/source/alatex/base/abugs.txt b/Master/texmf-dist/source/alatex/base/abugs.txt
new file mode 100644
index 00000000000..139a0f918b0
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/abugs.txt
@@ -0,0 +1,16 @@
+
+
+ ALaTeX Error Reports
+
+ 21 January 1996
+ Matt Swift <swift@bu.edu>
+
+
+Before you report an error please check that The problem is with
+ALaTeX and not LaTeX. Try reproducing the problem with LaTeX. If you
+can, the problem is with LaTeX, so please see the file bugs.txt in the
+LaTeX distribution.
+
+If you think you have found a bug in ALaTeX, please send a full report
+including the relevant .tex and .log files by email to Matt Swift
+<swift@bu.edu>.
diff --git a/Master/texmf-dist/source/alatex/base/ainstall.txt b/Master/texmf-dist/source/alatex/base/ainstall.txt
new file mode 100644
index 00000000000..e699bd9bfab
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/ainstall.txt
@@ -0,0 +1,92 @@
+
+
+ ALaTeX Installation Guide
+
+
+ 21 January 1996
+ Matt Swift <swift@bu.edu>
+
+SUMMARY
+=======
+
+This file contains the installation instructions for the ALaTeX
+document preparation system.
+
+In order to install ALaTeX, you must have a working installation of
+LaTeX2e. More information on LaTeX may be found at
+http://www.cogs.susx.ac.uk/cgi-bin/texfaq2html.
+
+In summary, to install ALaTeX, you will:
+
+ * Generate the ALaTeX format and standard metaclass.
+
+ * Put the ALaTeX files where ALaTeX can read them.
+
+ * Check the installation.
+
+When one of these steps depends on your TeX distribution, you may find
+help on how to do it in a <system>.txt file in the LaTeX distribution.
+
+
+GENERATING THE ALATEX FORMAT
+============================
+
+To create the ALaTeX format,
+
+ * Run TeX on the file `aunpack.ins'. This will create two new files
+ called `alatex.ltx' and `metaclas.cfg'.
+
+ * Invoke iniTeX with a first line of `&latex alatex.ltx'. This will
+ create a format file called `alatex.fmt'. Alternatively, you can
+ do this by typing `&latex' to iniTeX's `**' prompt, then typing
+ `\input alatex.ltx', and renaming the file `texput.fmt' to
+ `alatex.fmt'.
+
+ * Copy or move the format file `alatex.fmt' to the TeX formats
+ directory, and copy or move the standard metaclass `metaclas.cfg'
+ into a standard TeX input path.
+
+ * If you use the Unix web2c distribution of TeX, you may wish to
+ create a link from `alatex' to `virtex', and define
+ TEXINPUTS.alatex to have the same or similar value as
+ TEXINPUTS.latex2e in the file texmf.cnf. On other platforms, you
+ must do something else to use the ALaTeX format.
+
+
+CHECKING THAT THE INSTALLATION WORKED
+=====================================
+
+To make sure that the installation has worked, you may run
+ALaTeX on the document `ltxcheck.tex' which came in the base directory
+of your LaTeX2e distribution.
+
+Notice that the dialog will refer to LaTeX2e, but the banner ought to
+announce that you have invoked ALaTeX.
+
+This will produce a number of messages, each of which should be `OK'.
+If any of them are `BAD', I suggest trying seeing whether the same
+error occurs when you run LaTeX on `ltxcheck.tex'. If so, see the
+PROBLEMS section of the install.txt file in the LaTeX distribution.
+If not, then please see the file abugs.txt in the ALaTeX distribution
+and submit a bug report.
+
+If all the messages are `OK' then you are finished!
+
+
+GENERATING THE DOCUMENTATION
+============================
+
+Process `alatex.tex' with LaTeX and (optionally) Makeindex to produce
+documentation of ALaTeX and its standard metaclass. If you generate
+the index, use the index style gind.ist that came in the base
+directory of your LaTeX2e distribution (though it might have been
+moved elsewhere during installation).
+
+
+UNIX
+====
+
+On a Unix system, it will be easiest to use the Makefile I have
+written. Look over the variables at the top of the Makefile and
+adjust them as necessary. Invoke "make" with no arguments to see a
+list of targets.
diff --git a/Master/texmf-dist/source/alatex/base/alatex.dtx b/Master/texmf-dist/source/alatex/base/alatex.dtx
new file mode 100644
index 00000000000..0f7539b5694
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/alatex.dtx
@@ -0,0 +1,531 @@
+%^^A* file information
+% \iffalse
+%
+% alatex.dtx -- discussion and documentation of ALaTeX and its standard metaclass
+%
+% Copyright 1995 Matt Swift <swift@bu.edu>. All rights reserved.
+%
+% This file is part of the ALaTeX system.
+% Please see the file 0areadme.txt for further information.
+%
+% All correspondence regarding ALaTeX should go to
+% Matt Swift <swift@bu.edu>, not the LaTeX maintainers.
+%
+% 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.
+%
+% \fi
+%
+%^^A* checks
+%
+%^^A NOTE: The character table, with two %'s, will get written to all files.
+%% \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 \~}
+%
+% \CheckSum{287}
+%
+%^^A* abstract
+% \begin{abstract}
+% \ALaTeX{} is a document preparation system that provides the user with all
+% the functionality of \LaTeX{} and a general, legal way to override standard
+% \LaTeX{} behavior without altering source files. An important consequence is
+% that \ALaTeX{} can interpret official \LaTeX{} markup in an abstract way.
+%
+% This discussion builds on the author's paper ``Modularity in \LaTeX''
+% in the forthcoming TUGboat \textbf{16} (3).
+% \end{abstract}
+% \tableofcontents
+% \clearpage
+%
+% \StopEventually{}
+%
+% \section{Introduction}
+%
+% The purpose of writing \ALaTeX{} was to facilitate typesetting official
+% \LaTeX{} markup as \emph{abstract} markup, that is, markup that is not fixed
+% to a ``standard'' appearance on a typeset page. Official \LaTeX{} markup has
+% a standard appearance. Together with the broad portability of the \TeX{}
+% program, this standard is a highly valuable feature of \LaTeX. In achieving
+% this important goal, however, the \LaTeX{} developers compromised the
+% valuable ability of \LaTeX{} to interpret markup abstractly. \ALaTeX{}
+% attempts to provide users with the ability to process official \LaTeX{}
+% markup with the power of full abstraction, without compromising their ability
+% to process official \LaTeX{} markup in the standard way.
+%
+% You are not allowed to modify the distributed \LaTeX{} files without changing
+% their names; yet filenames are how classes and packages are identified. In
+% many cases it is desirable to produce \emph{different} \ext{dvi} files from
+% the same source document. Suppose you make a small modification of the
+% standard \class{article} class. To use it to process a source which calls
+% for the \class{article} class, you must either break the law and call your
+% derivative class \file{article.cls}, or modify the source to call for a
+% different class. Both options are unacceptable, the first for obvious
+% reasons, the second because a document class---and indeed all the markup in a
+% source---ought to be abstractly descriptive without specifying the details of
+% presentation. Font specifications are absurd in a document to be read aloud;
+% volume specifications are absurd in a document to be printed; page
+% specifications are absurd in a document to be viewed on a screen.
+%
+% Even were it agreed to privilege a single medium for presentation, sometimes
+% the source simply cannot be modified, and making a copy would cause version
+% control or storage difficulties, or itself be a violation of law.
+%
+% It is unnecessary to dwell on the necessary failure of any markup scheme to
+% be suitably abstract for all interesting documents and presentation media.
+% Fortunately, we are aiming to advance computer-aided typesetting, not the
+% philosophy of essence and accident, syntax and semantics. What is true of
+% \ALaTeX{} and not of \LaTeX{} is that all directives with a \emph{necessary}
+% influence on typeset appearance appear outside the source document.
+%
+% It is very difficult to have a working \ALaTeX{} without also having a
+% working \LaTeX. For this reason, \ALaTeX{} is unlikely to compromise the
+% availability and ubiquity of systems that conveniently produce standard
+% \LaTeX{} \ext{dvi} files from sources containing official \LaTeX{} markup.
+% To help insure this harmlessness (and for lack of a reasonable alternative),
+% \ALaTeX{} as distributed produces \ext{dvi} files identical to ones that
+% \LaTeX{} produces from the same source. Differences are conceivable only in
+% the perverse cases listed in Appendix \ref{perverse}.
+%
+% Abstracting those cases, therefore, a user must actively alter \LaTeX{} or
+% \ALaTeX{} before she can produce a \ext{dvi} file that differs from the one
+% standard \LaTeX{} produces from the same source file. \ALaTeX, however, is
+% much easier to alter in useful ways than \LaTeX.
+%
+% \begin{em}
+% When you compose a document, please preview it with (standard) \LaTeX.
+% There is absolutely no reason at all to use \ALaTeX{} during document
+% composition. Using \LaTeX{} will ensure that your document can be
+% consistently compiled and viewed at every \LaTeX{} site in the world. Use
+% \ALaTeX{} \emph{only} on existing sources when you can't or don't want to
+% modify them, and yet want to present them in a nonstandard way.
+% \end{em}
+%
+% \section{How \ALaTeX{} works}
+%
+% Most of the \ALaTeX{} distribution is designed to make a single small change
+% to the \LaTeX{} kernel easy and legal to use. The change causes the
+% |\documentclass| command to store its arguments in variables and load the
+% file \file{metaclas.cfg} called the \term{metaclass} before continuing.
+% That's it!
+%
+% The significance of this change is in the variety and scope of what can be
+% accomplished by code in the metaclass. In the metaclass, the |@| character
+% is a letter, as in normal class files.
+%
+% \DescribeMacro\mc@class@options
+% \DescribeMacro\mc@class@name
+% \DescribeMacro\mc@class@version
+% When the metaclass is executed, the \ALaTeX{} kernel is loaded, and the
+% source file has been processed from the beginning through the first
+% |\documentclass| command and all its arguments. The arguments have been
+% stored in macros as follows:
+% \begin{description}
+% \item[\bslash mc@class@options] holds the first optional argument to
+% |\documentclass|.
+% \item[\bslash mc@class@name] holds the mandatory argument to
+% |\documentclass|.
+% \item[\bslash mc@class@version] holds the second optional
+% argument to |\documentclass|.
+% \end{description}
+%
+% A metaclass can do anything at all with this information. The distributed
+% metaclass below emulates \LaTeX's behavior. Code in comments below provides
+% two convenient mechanisms to do something else, causing \ALaTeX's typeset
+% documents to differ from \LaTeX's. \ALaTeX{} is as flexible as possible, and
+% the number of other possibilities is countless.
+%
+% \DescribeMacro\alt@cls@extension
+% \DescribeMacro\ds@foo
+% The nonstandard mechanisms are as follows. Let \meta{class} be the class
+% named by the |\documentclass| command, \meta{altX} be the value of
+% |\alt@cls@extension| defined in the metaclass, and \meta{normX} be the value
+% of |\@cls@extension| defined in the \ALaTeX{} (and \LaTeX) kernel.
+% \begin{enumerate}
+% \item When a file \file{\meta{class}.\meta{altX}} exists in the search path,
+% it will be loaded instead of the usual \file{\meta{class}.\meta{normX}}.
+% \item When a command |\ds@|\meta{class} is defined, it will be executed
+% instead of loading \file{\meta{class}.\meta{normX}}.
+% \end{enumerate}
+%
+% Notice that there is no reason to use \ALaTeX{} unless you create a
+% nonstandard metaclass. The standard metaclass emulates standard \LaTeX{}
+% because the user should have to take active steps to get nonstandard output.
+% If you modify this file, please change the |\fileinfo| declaration near the
+% end.
+%
+% \section{The game of the name}
+%
+% You may understand the \word{A} in \ALaTeX{} to stand for \word{alternate} or
+% \word{abstract}, or to be the definite article, which emphasizes that fact
+% that when you process with \ALaTeX{}, you are seeing just one of an infinite
+% number of possibile presentations of your document's content.
+%
+% You may pronounce \ALaTeX{} however you like, of course.
+%
+% \section{A sampler of applications}
+%
+% \ALaTeX{} is a powerful tool, but newly born. Sophisticated applications
+% have neither been conceived nor implemented. The author would appreciate
+% hearing from you.
+%
+% \ALaTeX{} is potentially useful in situations where without \ALaTeX{} one
+% would need to alter the source in a way that affects its presentation but not
+% its content. For example, without \ALaTeX{} you must modify the source to
+% change the paper size or font characteristics of the typeset document.
+% \ALaTeX{} allows you to make this kind of change by altering the typesetting
+% procedure instead of the source itself.
+%
+% You can use \ALaTeX{} to specify options to package and classes or even to
+% load packages. You can invoke debugging or profiling code.
+%
+% Since the metaclass can control the style of a document, a system of files
+% could be arranged in which there exist companion files for sources, which
+% would function like style sheets. Common hierarchical path searching
+% mechanisms would permit cascading styles with a flexible inheritance scheme
+% at the levels of site, user, directory, and individual source.
+%
+% \section{The future}
+%
+% I envision removing most of the decisions embodied in the preamble and in
+% package and class options from the source file to the invocation of the
+% processing run. The decisions might be specified on the command line or in
+% files separate from the source that are managed by a convenient interface.
+% Is not an analogous development occurring as style sheets are brought to
+% HTML?
+%
+% Since the choices a user would typically make via \ALaTeX{} are likely to be
+% few and from among a small number of known alternatives, it is easy to
+% imagine a convenient user interface for the common options. Such a front end
+% written \TeX{} would have the advantage of being \%100 portable. A graphical
+% interface could be integrated in an existing front end which manages a broad
+% array of \TeX-related tasks.
+%
+% If metaclasses become tricky, a |\tracingmetaclasses| command might be
+% warranted.
+%
+% \StopEventually{}
+%
+% \section{Version control}
+%
+% \begin{macro}{\fileinfo}
+% \begin{macro}{\fileversion}
+% \begin{macro}{\filedate}
+% \begin{macro}{\docdate}
+% \begin{macro}{\PPOptArg}
+% First we take care of the business of keeping track of the version of this
+% document.
+% \begin{macrocode}
+%<*metaclass>
+\def\fileinfo{standard ALaTeX metaclass}
+\def\fileversion{v1.0}
+\def\filedate{1996/01/24}
+\def\docdate{1996/01/24}
+\edef\PPOptArg{\filedate\space \fileversion\space \fileinfo}
+\ProvidesFile{metaclas.cfg}[\PPOptArg]
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \section{Emulate \LaTeX{} (the default)}
+%
+% \begin{macro}{\documentclass}
+% \begin{macro}{\mc@load@class}
+% The following |\documentclass| command behaves exactly like \LaTeX's. It
+% looks a little different here because we've already read the three arguments.
+% \begin{macrocode}
+\def\documentclass{%
+ \let\documentclass\@twoclasseserror
+ \if@compatibility\else\let\usepackage\RequirePackage\fi
+ \mc@load@class}
+\def\mc@load@class{%
+ \edef\reserved@a{%
+ \noexpand\@fileswithoptions
+ \noexpand\@clsextension
+ [\mc@class@options]{\mc@class@name}[\mc@class@version]}%
+ \reserved@a}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{Privelege alternate extensions}
+%
+% \begin{macro}{\alt@cls@extension}
+% \begin{macro}{\documentclass}
+% To enable divergences from standard \LaTeX{} of the first kind only,
+% uncomment the following four definitions in this section and ensure that the
+% definitions in following sections are commented out. Please also change the
+% definition of |\fileinfo| above.
+% \begin{macrocode}
+% \def\alt@cls@extension{acl}
+% \def\documentclass{%
+% \let\documentclass\@twoclasseserror
+% \if@compatibility\else\let\usepackage\RequirePackage\fi
+% \IfFileExists{\mc@class@name.\alt@cls@extension}
+% {\let\mc@extension\alt@cls@extension
+% \mc@load@class
+% \def\mc@extension{\@currext}}
+% {\mc@load@class}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\mc@extension}
+% \begin{macro}{\@onefilewithoptions}
+% A lot of code here for two tiny changes of |\@currext| to |\mc@extension|.
+% The file with the alternate extension masquerades as one with the normal
+% extension in every way except the actual filename.
+% \begin{macrocode}
+% \def\mc@extension{\@currext}
+% \def\@onefilewithoptions#1[#2][#3]#4{%
+% \@pushfilename
+% \xdef\@currname{#1}%
+% \global\let\@currext#4%
+% \expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty
+% \let\CurrentOption\@empty
+% \@reset@ptions
+% \makeatletter
+% \def\reserved@a{%
+% \@ifl@aded\@currext{#1}%
+% {\@if@ptions\@currext{#1}{#2}{}%
+% {\@latex@error
+% {Option clash for \@cls@pkg\space #1}%
+% {The package #1 has already been loaded
+% with options:\MessageBreak
+% \space\space[\@ptionlist{#1.\@currext}]\MessageBreak
+% There has now been an attempt to load it
+% with options\MessageBreak
+% \space\space[#2]\MessageBreak
+% Adding the line:\MessageBreak
+% \space\space\string\usepackage
+% [\@ptionlist{#1.\@currext},#2]{#1}\MessageBreak
+% to your document may fix this.\MessageBreak
+% Try typing \space <return> \space to proceed.}}}%
+% {\@pass@ptions\@currext{#2}{#1}%
+% \global\expandafter
+% \let\csname ver@\@currname.\@currext\endcsname\@empty
+% \InputIfFileExists
+% {\@currname.\mc@extension}%
+% {}%
+% {\@missingfileerror\@currname\mc@extension}%
+% \let\@unprocessedoptions\@@unprocessedoptions
+% \csname\@currname.\@currext-h@@k\endcsname
+% \expandafter\let\csname\@currname.\@currext-h@@k\endcsname
+% \@undefined
+% \@unprocessedoptions}
+% \@ifl@ter\@currext{#1}{#3}{}%
+% {\@latex@warning@no@line
+% {You have requested,\on@line,
+% version\MessageBreak
+% `#3' of \@cls@pkg\space #1,\MessageBreak
+% but only version\MessageBreak
+% `\csname ver@#1.\@currext\endcsname'\MessageBreak
+% is available}}%
+% \ifx\@currext\@clsextension\let\LoadClass\@twoloadclasserror\fi
+% \@popfilename
+% \@reset@ptions}%
+% \reserved@a}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{Pass control to a macro}
+%
+% \begin{macro}{\documentclass}
+% To enable divergences from standard \LaTeX{} of the second kind only,
+% uncomment the following definition and ensure that all definitions in the
+% next and previous sections are commented out. Please also change the
+% definition of |\fileinfo| above. You must define |\dc@|\meta{class} in your
+% \file{metaclass.cfg} or before the |\documentclass| command in your document,
+% if you want to define it at all.
+% \begin{macrocode}
+% \def\documentclass{%
+% \let\documentclass\@twoclasseserror
+% \if@compatibility\else\let\usepackage\RequirePackage\fi
+% \@ifundefined{dc@\mc@class@name}
+% {\mc@load@class}
+% {\@nameuse{dc@\mc@class@name}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{First extension then macro}
+%
+% \begin{macro}{\documentclass}
+% To enable divergences from standard \LaTeX{} of both the first and second
+% kinds, uncomment the following definition as well as the definitions of
+% |\alt@cls@extension|, |\mc@extension|, and |\@onefilewithoptions| above.
+% Please also change the definition of |\fileinfo| above.
+% \begin{macrocode}
+% \def\documentclass{%
+% \let\documentclass\@twoclasseserror
+% \if@compatibility\else\let\usepackage\RequirePackage\fi
+% \IfFileExists{\mc@class@name.\alt@cls@extension}
+% {\let\mc@extension\alt@cls@extension
+% \mc@load@class
+% \def\mc@extension{\@currext}}
+% {\@ifundefined{dc@\mc@class@name}
+% {\mc@load@class}
+% {\@nameuse{dc@\mc@class@name}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Actually do something}
+%
+% So far we've just defined a command called |\documentclass|. It's time to
+% use it. It's probably best if this remains at the end of the (extracted)
+% file.
+% \begin{macrocode}
+\documentclass
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</metaclass>
+% \end{macrocode}
+%
+% \appendix
+% \section{Perverse cases}
+% \label{perverse}
+%
+% \ALaTeX{} as distributed produces \ext{dvi} files identical to ones that
+% \LaTeX{} produces from the same source. Differences are conceivable
+% only in the following perverse cases.
+% \begin{enumerate}
+% \item The document contains \TeX{} code that depends upon the exact
+% definitions or undefined state of the macros
+% \begin{quote}\raggedright
+% |\ALaTeX|, |\documentclass|, |\mc@documentclass|,
+% |\mc@@documentclass|, |\mc@class@options|, |\mc@class@name|,
+% |\mc@class@version|, and |\mc@load@class|.
+% \end{quote}
+% \item Processing the document requires the (almost trivial) internal
+% resources consumed by defining the above macros and loading the metaclass
+% file.
+% \item There is unfriendly code in the source before the |\documentclass|
+% command. Normally only harmless comments and \env{filecontents}
+% environments will precede the |\documentclass| command, but other code is
+% possible, that would cause the \ALaTeX's output to differ from \LaTeX's.
+% \item The arguments to |\documentclass| are very unusual, for example, they
+% change catcodes or have complicated expansions. \ALaTeX{} scans the
+% arguments to |\documentclass| slightly differently than \LaTeX{} does.
+% \end{enumerate}
+% No one should have to worry about these cases, and if they come up the
+% problem should be obvious.
+%
+% \section{Kernel Patch}
+%
+% This is the code that patches the \LaTeX{} kernel.
+%
+% \begin{macrocode}
+%<*alatex>
+\def\fileinfo{ALaTeX patch to LaTeX kernel}
+\def\fileversion{v1.0}
+\def\filedate{1996/01/24}
+\def\docdate{1996/01/24}
+\edef\PPOptArg{\filedate\space \fileversion\space \fileinfo}
+\ProvidesFile{metaclas.cfg}[\PPOptArg]
+
+\makeatletter
+% \end{macrocode}
+%
+% This is \ALaTeX, so make sure to announce it, and that it's nonstandard. We
+% don't want to change the |\fmtversion|. We want \ALaTeX{} to masquerade as
+% \LaTeX{} to the programs but not the users.
+%
+% This startup banner may be further modified by the code in |ltfinal.dtx| if a
+% patch file is present.
+% \begin{macrocode}
+\everyjob{\typeout{ALaTeX\space<\fmtversion\space R1> (NOT STANDARD LATEX)}}
+\immediate\write16{ALaTeX\space<\fmtversion\space R1> (NOT STANDARD LATEX)}
+% \end{macrocode}
+%
+% \begin{macro}{\ALaTeX}
+% Provide a logo.
+% \begin{macrocode}
+\DeclareRobustCommand{\ALaTeX}
+ {A\LaTeX}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\documentclass}
+% \begin{macro}{\mc@documentclass}
+% \begin{macro}{\mc@@documentclass}
+% \begin{macro}{\mc@class@options}
+% \begin{macro}{\mc@class@name}
+% \begin{macro}{\mc@class@version}
+% If the file |metaclas.cfg| exists in the search path, then the
+% |\documentclass| command reads its three arguments (two are optional) into
+% variables, and passes control to that file. If there is no such file, then
+% we proceed just as in \LaTeX. Since |\documentstyle| loads some code then
+% calls |\documentclass|, 2.09 documents also fall under the control of the
+% metaclass mechanism.
+% \begin{macrocode}
+\def\documentclass{%
+ \IfFileExists{metaclas.cfg}
+ {\@ifnextchar[%]
+ {\mc@documentclass}
+ {\mc@documentclass[]}}
+ {\let\documentclass\@twoclasseserror
+ \if@compatibility\else\let\usepackage\RequirePackage\fi
+ \@fileswithoptions\@clsextension}}
+
+\def\mc@documentclass[#1]#2{%
+ \@ifnextchar[%]
+ {\mc@@documentclass{#1}{#2}}
+ {\mc@@documentclass{#1}{#2}[]}}
+
+\def\mc@@documentclass#1#2[#3]{%
+ \def\mc@class@options{#1}%
+ \def\mc@class@name{#2}%
+ \def\mc@class@version{#3}%
+ \makeatletter
+ \input{metaclas.cfg}%
+ \makeatother}
+
+\@onlypreamble\documentclass
+\@onlypreamble\mc@documentclass
+\@onlypreamble\mc@@documentclass
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Dump the format.
+% \begin{macrocode}
+\makeatother
+\dump
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</alatex>
+% \end{macrocode}
+%
+% \Finale
diff --git a/Master/texmf-dist/source/alatex/base/alatex.ltx b/Master/texmf-dist/source/alatex/base/alatex.ltx
new file mode 100644
index 00000000000..0294c34de70
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/alatex.ltx
@@ -0,0 +1,89 @@
+%%
+%% This is file `alatex.ltx',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% alatex.dtx (with options: `alatex')
+%%
+%% Copyright 1995-1996 Matt Swift <swift@bu.edu>. All rights reserved.
+%%
+%% This file is part of the ALaTeX system. If you modify it, please
+%% change the definition of \fileinfo.
+%%
+%% All correspondence regarding ALaTeX should go to Matt Swift
+%% <swift@bu.edu>, not the LaTeX maintainers.
+%%
+%% This file has been generated from the sources listed above.
+%%
+%% 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.
+%%
+%% \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 \~}
+\def\fileinfo{ALaTeX patch to LaTeX kernel}
+\def\fileversion{v1.0}
+\def\filedate{1996/01/24}
+\def\docdate{1996/01/24}
+\edef\PPOptArg{\filedate\space \fileversion\space \fileinfo}
+\ProvidesFile{metaclas.cfg}[\PPOptArg]
+
+\makeatletter
+\everyjob{\typeout{ALaTeX\space<\fmtversion\space R1> (NOT STANDARD LATEX)}}
+\immediate\write16{ALaTeX\space<\fmtversion\space R1> (NOT STANDARD LATEX)}
+\DeclareRobustCommand{\ALaTeX}
+ {A\LaTeX}
+\def\documentclass{%
+ \IfFileExists{metaclas.cfg}
+ {\@ifnextchar[%]
+ {\mc@documentclass}
+ {\mc@documentclass[]}}
+ {\let\documentclass\@twoclasseserror
+ \if@compatibility\else\let\usepackage\RequirePackage\fi
+ \@fileswithoptions\@clsextension}}
+
+\def\mc@documentclass[#1]#2{%
+ \@ifnextchar[%]
+ {\mc@@documentclass{#1}{#2}}
+ {\mc@@documentclass{#1}{#2}[]}}
+
+\def\mc@@documentclass#1#2[#3]{%
+ \def\mc@class@options{#1}%
+ \def\mc@class@name{#2}%
+ \def\mc@class@version{#3}%
+ \makeatletter
+ \input{metaclas.cfg}%
+ \makeatother}
+
+\@onlypreamble\documentclass
+\@onlypreamble\mc@documentclass
+\@onlypreamble\mc@@documentclass
+\makeatother
+\dump
+\endinput
+%%
+%% End of file `alatex.ltx'.
diff --git a/Master/texmf-dist/source/alatex/base/amanifst.txt b/Master/texmf-dist/source/alatex/base/amanifst.txt
new file mode 100644
index 00000000000..6279b818884
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/amanifst.txt
@@ -0,0 +1,50 @@
+%
+% The following files form the ALaTeX 1.0 distribution.
+%
+%
+% CONTENTS OF THE ALaTeX DISTRIBUTION
+% ====================================
+%
+% Documentation:
+% --------------
+%
+% 0areadme.txt -- The distribution guide.
+% abugs.txt -- Where to submit a bug report for ALaTeX.
+% ainstall.txt -- How to install ALaTeX.
+% alatex.tex -- ALaTeX documentation.
+% amanifst.txt -- This file.
+%
+%
+% Kernel and Metaclass files:
+% ---------------------------
+%
+% alatex.dtx -- Source for ALaTeX documentation, the standard metaclass,
+% and the patch to the LaTeX kernel.
+%
+%
+% Installation files:
+% -------------------
+%
+% Makefile -- Unix Makefile for building and installing ALaTeX
+% and its documentation.
+% aunpack.ins -- Unpacks the ALaTeX distribution.
+% aunpcked.txt -- Lists files unpacked by aunpack.ins.
+%
+% ======================================================================
+%
+% The following file list is read in during the installation procedure
+% to check that all the files are present. The file names should be
+% separated by white space, and this file should end with |\endinput|.
+%
+README
+COPYING
+Makefile
+VERSION-1.0
+0areadme.txt
+abugs.txt
+alatex.tex
+alatex.dtx
+amanifst.txt
+aunpack.ins
+aunpcked.txt
+\endinput
diff --git a/Master/texmf-dist/source/alatex/base/aunpack.ins b/Master/texmf-dist/source/alatex/base/aunpack.ins
new file mode 100644
index 00000000000..8861282780b
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/aunpack.ins
@@ -0,0 +1,135 @@
+% aunpack.ins -- installation driver for the ALaTeX system
+%
+% Copyright 1996 Matt Swift <swift@bu.edu>.
+% All rights reserved.
+%
+% This file is part of the ALaTeX system. Please see the file
+% 0areadme.txt for further information.
+%
+% All correspondence regarding ALaTeX should go to
+% Matt Swift <swift@bu.edu>, not the LaTeX maintainers.
+%
+% 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.
+%
+\def\batchfile{aunpack.ins}
+
+\let\documentclass\undefined
+\input ltdirchk.dtx
+\input testdist.dtx
+\input docstrip.dtx
+
+\let\OriginalAsk=\Ask
+\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, I will asssume `y' for all future questions^^J%
+ without prompting.}%
+ \ifx\y\noprompt\gdef\Ask##1##2{\def##1{y}}\else
+ \ifx\yes\noprompt\gdef\Ask##1##2{\def##1{y}}\fi\fi}
+
+\testdistribution{amanifst.txt}{Missing distribution files.}{%
+ The above files are missing from your ALaTeX distribution.
+^^JYou should be able to get the files from the same source as
+^^Jthe rest of the distribution. If you can't, then complain!
+^^JThe full list of ALaTeX distributed files is in amanifst.txt.
+^^JMore information about the installation is in ainstall.txt.
+^^JPress <RETURN> to continue, or X<RETURN> to exit.
+}
+
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* Welcome to the Installation routine of}
+\Msg{*}
+\Msg{* \space\space\space\space ALaTeX\space 1.0}
+\Msg{*}
+\Msg{**********************************************}
+\Msg{}
+\Msg{}
+
+\keepsilent
+
+\preamble
+
+Copyright 1995-1996 Matt Swift <swift@bu.edu>. All rights reserved.
+
+This file is part of the ALaTeX system. If you modify it, please
+change the definition of \string\fileinfo.
+
+All correspondence regarding ALaTeX should go to Matt Swift
+<swift@bu.edu>, not the LaTeX maintainers.
+
+This file has been generated from the sources listed above.
+
+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.
+
+\endpreamble
+
+\def\Lbatchinput#1{{\batchinput{#1}}} % to avoid changing preambles
+ % by included batchfiles we just enclose \batchinput
+ % in brackets since \preamble decls are local
+
+\generate{
+ \file{alatex.ltx}{\from{alatex.dtx}{alatex}}
+ \file{metaclas.cfg}{\from{alatex.dtx}{metaclass}}
+ }
+
+\testdistribution{aunpcked.txt}{Missing unpacked files.}{%
+ The above files should have been unpacked by this installation.
+^^JIf they are missing, then this means that something is wrong.
+^^JRead ainstall.txt to find out what to do now.
+^^JThe list of files which should have been unpacked is in aunpcked.txt.
+^^JPress <RETURN> to continue, or X<RETURN> to exit.
+}
+
+\Msg{}
+\Msg{********************************************************************}
+\Msg{*}
+\Msg{* The patch to the LaTeX kernel and the standard ALaTeX metaclass}
+\Msg{* have been created.}
+\Msg{*}
+\Msg{* To create the ALaTeX format, you must}
+\Msg{* now run iniTeX on alatex.ltx to generate alatex.fmt.}
+\Msg{*}
+\Msg{* To use the new format and the standard metaclass,}
+\Msg{* place them in a standard TeX path.}
+\Msg{*}
+\Msg{* If you use the Unix web2c distribution of TeX, you may wish to}
+\Msg{* create a link from `alatex' to `virtex', and define}
+\Msg{* TEXINPUTS.alatex to have the same value as TEXINPUTS.latex in the}
+\Msg{* file texmf.cnf (both of these should have the same value as}
+\Msg{* TEXINPUTS.latex2e). On other platforms, you must do something else}
+\Msg{* to use the ALaTeX format.}
+\Msg{*}
+\Msg{* Documentation may be produced by running}
+\Msg{* LaTeX on alatex.tex.}
+\Msg{*}
+\Msg{*******************************************************************}
+\Msg{}
+
+\endinput
diff --git a/Master/texmf-dist/source/alatex/base/aunpcked.txt b/Master/texmf-dist/source/alatex/base/aunpcked.txt
new file mode 100644
index 00000000000..e1413f8fba5
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/aunpcked.txt
@@ -0,0 +1,9 @@
+%
+% The following files will be unpacked by running TeX on
+% aunpack.ins.
+%
+
+alatex.ltx
+metaclas.cfg
+
+\endinput
diff --git a/Master/texmf-dist/source/alatex/base/testdist.dtx b/Master/texmf-dist/source/alatex/base/testdist.dtx
new file mode 100644
index 00000000000..9b6625a7292
--- /dev/null
+++ b/Master/texmf-dist/source/alatex/base/testdist.dtx
@@ -0,0 +1,164 @@
+% \iffalse meta-comment
+%
+% Copyright 1993 1994 1995 The LaTeX3 Project and any individual
+% authors listed elsewhere in this file.
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This file is part of the LaTeX2e system.
+% ----------------------------------------
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+%
+% \ProvidesFile{testdist.dtx}[1994/05/13 Testing distribution]
+%
+% \iffalse
+%%% File: testdist.dtx
+%
+%<*unstripped>
+\ifx\documentclass\undefined\let\next\relax\else\def\next{%
+%</unstripped>
+%<*driver>
+% \fi
+\ProvidesFile{testdist.dtx}[1994/05/13 Testing distribution]
+% \iffalse
+\documentclass{ltxdoc}
+\GetFileInfo{testdist.dtx}
+\title{dircheck.dtx}
+\author{Alan Jeffrey}
+\date{\filedate}
+\begin{document}
+ \maketitle
+ \DocInput{\filename}
+\end{document}
+%</driver>
+%<*unstripped>
+}\fi\next
+%</unstripped>
+% \fi
+%
+% \changes{v0.02}{1993/12/20}{This file now defines a command
+% \cs{testdistribution}, which reads an arbitrary file, rather than
+% only reading manifest.l2e.}
+% \changes{v0.03}{1993/12/21}{Added \cs{@tfor}.}
+% \changes{v0.04}{1994/01/18}{Removed directory searching.}
+% \changes{v0.05}{1994/01/20}{Corrected missing file number bug.}
+% \changes{v0.06}{1994/05/13}{Improved documentation.}
+%
+% This file defines a command
+% |\testdistribution{|\meta{filename}|}{|\meta{error}|}{|\meta{help}|}|,
+% which reads a file, and checks that all the filenames listed in it
+% can be read by \TeX. It should be run after |dircheck.dtx| has
+% defined |\input@path|.
+%
+% \changes{v0.03}{1993/12/21}{Chris pointed out that we need `@tfor
+% here}
+% \changes{v0.04}{1994/01/18}{Removed all the directory searching}
+%
+% \begin{macro}{\IfFileExists}
+% A version of the |\IfFileExists| macro which does no fancy
+% searching, and we assume the directory is on the |\openin| path.
+% \changes{v0.05}{1994/01/20}{Corrected missing file number bug.}
+% \begin{macrocode}
+%<*testdist>
+ \def\IfFileExists#1{%
+ \openin\@inputcheck#1 %
+ \ifeof\@inputcheck
+ \closein\@inputcheck
+ \expandafter\@secondoftwo
+ \else
+ \closein\@inputcheck
+ \expandafter\@firstoftwo
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\testdistribution}
+% \begin{macro}{\@filemustexist}
+% \begin{macro}{\@filemustexist@}
+% \begin{macro}{\@missingfiles}
+% |\testdistribution| inputs a file of filenames and checks that
+% all the files can be read by \TeX. The files should be separated
+% by whitespace, and terminated by |\endinput|.
+% \begin{macrocode}
+\def\@filemustexist#1{
+ \ifx#1\endinput
+ \expandafter\endinput
+ \else
+ \expandafter\@filemustexist@\expandafter#1%
+ \fi
+}
+\def\@filemustexist@#1 {
+ \IfFileExists{#1}{
+ \wlog{Passed `#1'.}
+ }{
+ \wlog{Failed `#1'.}
+ \xdef\@missingfiles{\@missingfiles\message{#1}}
+ }
+ \@filemustexist
+}
+\def\testdistribution#1#2#3{
+ \global\let\@missingfiles=\@empty
+ {
+ \catcode`\^^M=\the\catcode`\ \relax
+ \expandafter\@filemustexist\@@input #1
+ }
+ \ifx\@missingfiles\@empty
+ \else
+ \immediate\write16{}
+ \immediate\write16{The following files are missing:}
+ \immediate\write16{}
+ \@missingfiles
+ \immediate\write16{}
+ \errhelp{#3}
+ \errmessage{#2}
+ \immediate\write16{}
+ \immediate\write16{Carrying on with fingers crossed...}
+ \immediate\write16{}
+ \fi
+}
+%</testdist>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+\endinput
+
+
+
diff --git a/Master/texmf-dist/source/cslatex/base/cslatex.dtx b/Master/texmf-dist/source/cslatex/base/cslatex.dtx
new file mode 100644
index 00000000000..2906d68abc6
--- /dev/null
+++ b/Master/texmf-dist/source/cslatex/base/cslatex.dtx
@@ -0,0 +1,1076 @@
+% ^^A Hey Emacs, this is a -*-LaTeX-*- file!
+% \title{\CS\LaTeX}
+% \author{Jaroslav \v Snajdr \and Zden\v ek Wagner \and
+% Ji\v r\'\i\ Zlatu\v ska \and The \LaTeX 3 Project}
+% \maketitle
+% \iffalse
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\newcommand\CS{$\cal C\kern-.1667em
+ \lower.5ex\hbox{$\cal S$}\kern-.075em$}
+\begin{document}
+\overfullrule=10pt
+\DocInput{cslatex.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \fi
+%
+% \section{Hyphenation---file \texttt{hyphen.cfg}}
+%
+% \begin{macrocode}
+%<*hyphen>
+\ProvidesFile{hyphen.cfg}[1997/01/30 CSLaTeX]
+% \end{macrocode}
+%
+% \begin{macro}{\@@T1Codes}
+% This macro sets the correct uc/ls/sf codes for characters in the T1
+% encoding.
+% \begin{macrocode}
+\expandafter\def\csname @@T1Codes\endcsname{%
+ \def\@tempa##1##2{%
+ \@tempcnta=##1\relax\@tempcntb=##2\relax\@tempb}%
+ \def\@tempb{%
+ \ifnum\@tempcnta>\@tempcntb\else
+ \@tempc\@tempcnta
+ \advance\@tempcnta by 1
+ \expandafter\@tempb
+ \fi}%
+ \def\@tempc##1{%
+ \count@=##1\advance\count@ by -"20
+ \uccode##1=\count@
+ \lccode##1=##1 }%
+ \@tempa{"A0}{"BC}
+ \@tempa{"E0}{"FF}
+ \def\@tempc##1{%
+ \count@=##1\advance\count@ by "20
+ \uccode##1=##1
+ \lccode##1=\count@
+ \sfcode##1=999 }%
+ \@tempa{"80}{"9C}
+ \@tempa{"C0}{"DF}
+ \uccode25=`\I \lccode25=26 % dotless i
+ \uccode26=`\J \lccode26=26 % dotless j, ae in OT1
+ \lccode157=`\i \uccode157=157 % dotted I
+ \lccode158=158 \uccode158=208 % d-bar
+ \sfcode254=1000 \lccode254=254
+ \sfcode255=1000 \lccode255=255
+ \sfcode158=1000 \sfcode159=1000
+ \let\@tempa=\@undefined
+ \let\@tempb=\@undefined
+ \let\@tempc=\@undefined}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@IL2Codes}
+% The same for IL2 (ISO-8859-2).
+% \begin{macrocode}
+\expandafter\def\csname @@IL2Codes\endcsname{%
+ \def\@tempa##1##2{%
+ \lccode##1=##1 \uccode##2=##2
+ \lccode##2=##1 \uccode##1=##2 }%
+ \@tempa{181}{165}\@tempa{184}{152}\@tempa{185}{169}%
+ \@tempa{187}{171}\@tempa{190}{174}%
+ \sfcode254=0 \lccode254=0 % ,,
+ \sfcode255=0 \lccode255=0 % ``
+ \sfcode158=0 \lccode158=0 % <<
+ \sfcode159=0 \lccode159=0 }% >>
+% \end{macrocode}
+% \end{macro}
+% Now we define macros that change the hyphenation patterns when
+% encoding or language is switched.
+%
+% Token registers |\@@front@@| and |\@@end@@| contain commands which
+% will be later contents of the |\@hyphenation| macro (see its
+% definition).
+% \begin{macrocode}
+\newtoks\@@front@@ \newtoks\@@end@@ \bgroup \count0=0
+% \end{macrocode}
+% \begin{macro}{\DeclareLanguage}
+% Command |\DeclareLanuage| loads hyphenation patterns for respective
+% languages and encodings. First control sequences that redefine
+% |\lang| to |\lang encoding| are appended to |\@@front@@|
+% register. By command |\setup@hyphenation|, the patterns for
+% all encodings noted in optional parameter of |\DeclareLanguage| are
+% loaded.
+% \begin{macrocode}
+\newcommand{\DeclareLanguage}[4][\undefined]{%
+ \def\c@ding{#1}\def\und@fin@d{\undefined}%
+ \ifx\c@ding\und@fin@d
+ \setup@hyphenation{#3}{\expandafter\@gobble\string#2}{#4}%
+ \else
+ \global\@@front@@=\expandafter{\the\@@front@@
+ \global\expandafter\expandafter\expandafter\def\expandafter
+ \expandafter\expandafter#2\expandafter\expandafter\expandafter
+ {\csname\expandafter\@gobble\string#2 \f@encoding\endcsname}}%
+ \def\one@arg##1,##2\end{%
+ \def\c@ding{##1}
+ \ifx\c@ding\und@fin@d\else
+ \setup@hyphenation[##1]{#3}{\expandafter\@gobble\string#2}{#4}%
+ \one@arg##2\end
+ \fi
+ }
+ \one@arg#1,\undefined,\end
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setup@hyphenation}
+% This command updates the encoding (by calling |\enc@update|), which
+% causes control sequences like |\'a| to expand to the right
+% characters. After setting cat/uc/lc codes the hyphenation patterns are
+% loaded. Last we add some code to |\@@end@@| for switching the
+% |\language| register to right value when the encoding is changed.
+% \begin{macrocode}
+\newcommand{\setup@hyphenation}[4][\undefined]{%
+ \def\c@ding{#1}\def\und@fin@d{\undefined}%
+ \ifx\c@ding\und@fin@d
+ \def\c@ding{}
+ \else
+ \fontencoding{#1}\enc@update
+ \csname @@\c@ding Codes\endcsname
+ \fi
+ \enc@update
+ \InputIfFileExists{#2}%
+ {\message{^^JLoading #3 hyphenation patterns and exceptions}%
+ \global\expandafter\expandafter\expandafter
+ \def\expandafter\expandafter
+ \csname#3 \c@ding\endcsname\expandafter
+ {\expandafter\language\expandafter=\the\count0
+ #4\relax}%
+ \if\c@ding\relax\relax
+ \expandafter\global\expandafter
+ \let\csname#3\expandafter\endcsname\csname#3 \endcsname
+ \else\message{for #1}%
+ \global\expandafter\edef\csname#3 @\c@ding\endcsname
+ {\noexpand\language=\the\count0\noexpand\relax}%
+ \fi
+ \language=\count0}%
+ {\errhelp{The configuration for hyphenation is incorrectly
+ installed.^^J%
+ If you don't understand this error message you need
+ to seek^^Jexpert advice.}%
+ \errmessage{OOPS!! Hyphenation patterns file #2 for #3 not found!}}%
+\if\c@ding\relax\relax\else
+ \global\@@end@@=
+ \expandafter\expandafter\expandafter
+ {\expandafter
+ \the\expandafter\@@end@@\expandafter
+ \ifnum\expandafter\language\expandafter=\the\count0\relax
+ \csname#3 @\f@encoding\endcsname
+ \fi}
+\fi
+\advance\count0 by 1\relax
+}%
+\csname @@T1Codes\endcsname
+% \end{macrocode}
+% \end{macro}
+% Here we define languages and encodings that are loaded into the
+% format. By default we load english, czech and slovak patterns in the
+% IL2 encoding. These definitions are likery to be changed by the user.
+% \begin{macrocode}
+%<hyphen>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%<hyphen>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\DeclareLanguage{\english}{hyphen.tex}{\lefthyphenmin=2
+ \righthyphenmin=3
+ \@splitrequestedfalse}%
+\DeclareLanguage[IL2,T1]{\czech}{czhyphen.tex}{\lefthyphenmin=2
+ \righthyphenmin=3
+ \@requesthyphens}%
+\DeclareLanguage[IL2,T1]{\slovak}{skhyphen.tex}{\lefthyphenmin=2
+ \righthyphenmin=3
+ \@requesthyphens}%
+%<hyphen>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%<hyphen>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\egroup
+% \end{macrocode}
+% \begin{macro}{\@hyphenation}
+% The |\@hyphenation| macro is defined as contents of registers
+% |\@@front@@| and |\@@end@@|. This macro is executed at every
+% encoding change.
+% \begin{macrocode}
+\@@front@@=\expandafter\expandafter\expandafter
+ {\expandafter\the\expandafter\@@front@@\the\@@end@@}%
+\expandafter\def\expandafter
+ \@hyphenation\expandafter{\the\@@front@@}%
+\@@front@@={}\@@end@@={}
+\def\nolanguage{\lefthyphenmin=99\righthyphenmin=99\language=255
+ \@splitrequestedfalse\relax}
+\newif\if@splithyphens
+\newif\if@splitrequested
+% \end{macrocode}
+% \end{macro}
+% Macros for splitting hyphens.
+% \begin{macrocode}
+\def\minus{-}%
+\bgroup\catcode`-=\active\expandafter\egroup
+\expandafter\def\noexpand-{%
+\ifx\protect\relax
+ \ifhmode
+ \ifinner
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter-%
+ \else
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter\firstd@sh
+ \fi
+ \else%
+ \expandafter\expandafter\expandafter-%
+ \fi
+\else
+ \expandafter\string\expandafter\string-%
+\fi}%
+\def\@nehyph@n{-}
+\def\splithyph@n{\ifnum\expandafter\hyphenchar\the\font>-1
+ \discretionary{\char`-}{\char\hyphenchar\the\font}{\char`-}\else
+ \discretionary{\char`-}{\char`-}{\char`-}\fi}
+\def\b@xhyph@n{\hbox{-}}
+\def\tw@hyph@ns{--}
+\def\thr@@hyph@ns{---}
+\catcode`-=\active
+\def\firstd@sh{\ifnextch@r -\then\sec@ndd@sh\else
+ \ifnum\expandafter\hyphenchar\the\font=`-
+ \ifnum\righthyphenmin>2
+ \if l\nextchar\b@xhyph@n % make sure we
+ \else % don't chop off `-li'
+ \splithyph@n
+ \fi
+ \else
+ \splithyph@n
+ \fi
+ \else
+ \@nehyph@n
+ \fi
+ \fii}
+\def\sec@ndd@sh#1{\ifnextch@r-\then\thirdd@sh\else\tw@hyph@ns\fii}
+\def\thirdd@sh#1{\ifnextch@r-\then\m@nyd@sh\else\thr@@hyph@ns\fii}
+\def\m@nyd@sh#1{\thr@@hyph@ns\firstd@sh}
+\def\ifnextch@r#1\then#2\else#3\fii
+ {\def\c@mp@rech@rs{\ifx#1\nextchar
+ \def\next{#2}%
+ \else
+ \def\next{#3}%
+ \fi\next}%
+ \futurelet\nextchar\c@mp@rech@rs}
+\catcode`-=12
+\def\standardhyphens{\catcode`-=12 \@splithyphensfalse}%
+\def\splithyphens{\if@splitrequested\catcode`-\active\fi
+ \@splithyphenstrue}%
+\def\@requesthyphens{\if@splithyphens\catcode`-=\active\fi
+ \@splitrequestedtrue}
+\let\@looseness\looseness
+\def\looseness{%
+ \if@splithyphens
+ \standardhyphens\afterassignment\splithyphens
+ \fi
+ \@looseness}
+\expandafter\fontencoding\expandafter U\expandafter
+ \fontencoding\expandafter{\f@encoding}\enc@update
+\@hyphenation
+\english
+%</hyphen>
+% \end{macrocode}
+%
+% \section{Fonts---file \texttt{fonttext.cfg}}
+%
+% This is copy of original |fonttext.ltx| with definitions for IL2
+% added.
+% \begin{macrocode}
+%<*fonttext>
+\ProvidesFile{fonttext.cfg}[1997/08/20 CSLaTeX]
+\let\@hyphenation=\relax
+% \end{macrocode}
+% Macro |\DeclareFontEncoding@| is changed to execute |\@hyphenation|
+% and set proper uc/lc/catcodes at every encoding change. This can be
+% also achieved by changing file |xxxenc.def|, but standard encoding
+% definition file can't be changed because of \LaTeX\ copyright.
+% \begin{macrocode}
+\def\DeclareFontEncoding@#1#2#3{%
+ \expandafter
+ \ifx\csname T@#1\endcsname\relax
+ \def\cdp@elt{\noexpand\cdp@elt}%
+ \xdef\cdp@list{\cdp@list\cdp@elt{#1}%
+ {\default@family}{\default@series}%
+ {\default@shape}}%
+ \expandafter\let\csname#1-cmd\endcsname\@changed@cmd
+ \else
+ \@font@info{Redeclaring font encoding #1}%
+ \fi
+ \global\@namedef{T@#1}{#2\csname @@#1Codes\endcsname\@hyphenation}%
+ \global\@namedef{M@#1}{\default@M#3}%
+}
+\input {omlenc.def}
+\input {t1enc.def}
+\input {ot1enc.def} % <- should come after T1 for speed
+% \end{macrocode}
+% Definition of IL2 encoding.
+% \begin{macrocode}
+\input {il2enc.def}
+\input {omsenc.def}
+\fontencoding{OT1}
+\DeclareFontEncodingDefaults{}{}
+\DeclareFontSubstitution{T1}{cmr}{m}{n}
+\DeclareFontSubstitution{OT1}{cmr}{m}{n}
+\DeclareFontSubstitution{IL2}{cmr}{m}{n}
+\begingroup
+\nfss@catcodes
+\input {t1cmr.fd}
+\input {ot1cmr.fd}
+% \end{macrocode}
+% IL2 once again.
+% \begin{macrocode}
+\input {il2cmr.fd}
+\endgroup
+\begingroup
+\nfss@catcodes
+\input {ot1cmss.fd}
+\input {ot1cmtt.fd}
+\endgroup
+\DeclareErrorFont{OT1}{cmr}{m}{n}{10}
+\newcommand\rmdefault{cmr}
+\newcommand\sfdefault{cmss}
+\newcommand\ttdefault{cmtt}
+\newcommand\bfdefault{bx}
+\newcommand\mddefault{m}
+\newcommand\itdefault{it}
+\newcommand\sldefault{sl}
+\newcommand\scdefault{sc}
+\newcommand\updefault{n}
+\newcommand\encodingdefault{OT1}
+\newcommand\familydefault{\rmdefault}
+\newcommand\seriesdefault{\mddefault}
+\newcommand\shapedefault{\updefault}
+%</fonttext>
+% \end{macrocode}
+%
+% \section{Definition of the IL2 encoding---file \texttt{il2enc.def}}
+%
+% \begin{macrocode}
+%<*il2enc>
+\ProvidesFile{il2enc.def}[1997/08/20 CSLaTeX]
+\DeclareFontEncoding{IL2}{\uccode152=152 \lccode152=184
+ \uccode184=152 \lccode184=184
+ \uccode165=165 \lccode165=181
+ \uccode181=165 \lccode181=181
+ \uccode169=169 \lccode169=185
+ \uccode185=169 \lccode185=185
+ \uccode171=171 \lccode171=187
+ \uccode187=171 \lccode187=187
+ \uccode174=174 \lccode174=190
+ \uccode190=174 \lccode190=190
+ \sfcode254=0 \lccode254=0
+ \sfcode255=0 \lccode255=0
+ \sfcode158=0 \lccode158=0
+ \sfcode159=0 \lccode159=0 }{}
+\DeclareTextAccent{\"}{IL2}{127}
+\DeclareTextAccent{\'}{IL2}{19}
+\DeclareTextAccent{\.}{IL2}{95}
+\DeclareTextAccent{\=}{IL2}{22}
+\DeclareTextAccent{\^}{IL2}{94}
+\DeclareTextAccent{\`}{IL2}{18}
+\DeclareTextAccent{\~}{IL2}{126}
+\DeclareTextAccent{\H}{IL2}{125}
+\DeclareTextAccent{\u}{IL2}{21}
+\DeclareTextAccent{\v}{IL2}{20}
+\DeclareTextAccent{\r}{IL2}{23}
+\DeclareTextCommand{\b}{IL2}[1]
+ {\oalign{\null#1\crcr\hidewidth\sh@ft{29}%
+ \vbox to.2ex{\hbox{\char22}\vss}\hidewidth}}
+\DeclareTextCommand{\c}{IL2}[1]
+ {\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent24 #1%
+ \else{\ooalign{\unhbox\z@\crcr\hidewidth\char24\hidewidth}}\fi}
+\DeclareTextCommand{\d}{IL2}[1]
+ {\oalign{\null#1\crcr\hidewidth\sh@ft{08}.\hidewidth}}
+\DeclareTextSymbol{\AE}{IL2}{29}
+\DeclareTextSymbol{\OE}{IL2}{30}
+\DeclareTextSymbol{\O}{IL2}{31}
+\DeclareTextSymbol{\ae}{IL2}{26}
+\DeclareTextSymbol{\i}{IL2}{16}
+\DeclareTextSymbol{\j}{IL2}{17}
+\DeclareTextSymbol{\oe}{IL2}{27}
+\DeclareTextSymbol{\o}{IL2}{28}
+\DeclareTextSymbol{\ss}{IL2}{25}
+\DeclareTextSymbol{\textemdash}{IL2}{124}
+\DeclareTextSymbol{\textendash}{IL2}{123}
+\DeclareTextSymbol{\textexclamdown}{IL2}{60}
+\DeclareTextSymbol{\textquestiondown}{IL2}{62}
+\DeclareTextSymbol{\textquotedblleft}{IL2}{92}
+\DeclareTextSymbol{\textquotedblright}{IL2}{`\"}
+\DeclareTextSymbol{\textquoteleft}{IL2}{`\`}
+\DeclareTextSymbol{\textquoteright}{IL2}{`\'}
+\DeclareTextCommand{\L}{IL2}
+ {\leavevmode\setbox0\hbox{L}\hbox to\wd0{\hss\char32L}}
+\DeclareTextCommand{\l}{IL2}{{\char32l}}
+\DeclareTextCompositeCommand{\r}{IL2}{A}
+ {\leavevmode\setbox0\hbox{h}\dimen@\ht0\advance\dimen@-1ex%
+ \rlap{\raise.67\dimen@\hbox{\char'27}}A}
+\DeclareTextCommand{\SS}{IL2}{SS}
+\DeclareTextCommand{\textdollar}{IL2}{{%
+ \ifdim \fontdimen\@ne\font >\z@
+ \slshape
+ \else
+ \upshape
+ \fi
+ \char`\$}}
+\DeclareTextCommand{\textsterling}{IL2}{{%
+ \ifdim \fontdimen\@ne\font >\z@
+ \itshape
+ \else
+ \fontshape{ui}\selectfont
+ \fi
+ \char`\$}}
+\DeclareTextComposite{\'}{IL2}{l}{'345}%
+\DeclareTextComposite{\'}{IL2}{r}{'340}%
+\DeclareTextComposite{\'}{IL2}{a}{'341}%
+\DeclareTextComposite{\'}{IL2}{e}{'351}%
+\DeclareTextComposite{\'}{IL2}{\i}{'355}%
+\DeclareTextComposite{\'}{IL2}{i}{'355}%
+\DeclareTextComposite{\'}{IL2}{o}{'363}%
+\DeclareTextComposite{\'}{IL2}{u}{'372}%
+\DeclareTextComposite{\'}{IL2}{y}{'375}%
+\DeclareTextComposite{\'}{IL2}{L}{'305}%
+\DeclareTextComposite{\'}{IL2}{R}{'300}%
+\DeclareTextComposite{\'}{IL2}{A}{'301}%
+\DeclareTextComposite{\'}{IL2}{E}{'311}%
+\DeclareTextComposite{\'}{IL2}{I}{'315}%
+\DeclareTextComposite{\'}{IL2}{O}{'323}%
+\DeclareTextComposite{\'}{IL2}{U}{'332}%
+\DeclareTextComposite{\'}{IL2}{Y}{'335}%
+\DeclareTextComposite{\`}{IL2}{a}{'270}%
+\DeclareTextComposite{\`}{IL2}{A}{'230}%
+\DeclareTextComposite{\v}{IL2}{c}{'350}%
+\DeclareTextComposite{\v}{IL2}{d}{'357}%
+\DeclareTextComposite{\v}{IL2}{e}{'354}%
+\DeclareTextComposite{\v}{IL2}{n}{'362}%
+\DeclareTextComposite{\v}{IL2}{r}{'370}%
+\DeclareTextComposite{\v}{IL2}{s}{'271}%
+\DeclareTextComposite{\v}{IL2}{z}{'276}%
+\DeclareTextComposite{\v}{IL2}{t}{'273}%
+\DeclareTextComposite{\v}{IL2}{l}{'265}%
+\DeclareTextComposite{\v}{IL2}{u}{'371}%
+\DeclareTextComposite{\v}{IL2}{C}{'310}%
+\DeclareTextComposite{\v}{IL2}{D}{'317}%
+\DeclareTextComposite{\v}{IL2}{E}{'314}%
+\DeclareTextComposite{\v}{IL2}{N}{'322}%
+\DeclareTextComposite{\v}{IL2}{R}{'330}%
+\DeclareTextComposite{\v}{IL2}{S}{'251}%
+\DeclareTextComposite{\v}{IL2}{T}{'253}%
+\DeclareTextComposite{\v}{IL2}{Z}{'256}%
+\DeclareTextComposite{\v}{IL2}{L}{'245}%
+\DeclareTextComposite{\v}{IL2}{U}{'331}%
+\DeclareTextComposite{\^}{IL2}{o}{'364}%
+\DeclareTextComposite{\^}{IL2}{O}{'324}%
+\DeclareTextComposite{\"}{IL2}{a}{'344}%
+\DeclareTextComposite{\"}{IL2}{o}{'366}%
+\DeclareTextComposite{\"}{IL2}{u}{'374}%
+\DeclareTextComposite{\"}{IL2}{A}{'304}%
+\DeclareTextComposite{\"}{IL2}{O}{'326}%
+\DeclareTextComposite{\"}{IL2}{U}{'334}%
+\DeclareTextComposite{\r}{IL2}{u}{'371}%
+\DeclareTextComposite{\r}{IL2}{U}{'331}%
+\DeclareTextSymbol{\flqq}{IL2}{158}%
+\DeclareTextSymbol{\frqq}{IL2}{159}%
+\DeclareTextSymbol{\clqq}{IL2}{254}%
+\DeclareTextCommand{\crqq}{IL2}%
+ {{\edef\@SF{\spacefactor\the\spacefactor}\char255 \@SF\relax}}%
+%</il2enc>
+% \end{macrocode}
+%
+% \section{Font definition files for the \CS-fonts}
+%
+% These files are slightly modified font definitions files for CM
+% fonts from \LaTeX---\texttt{ot1*.fd}
+% \begin{macrocode}
+%<*il2cmr>
+\ProvidesFile{il2cmr.fd}[1997/02/06 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmr}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmr}{m}{n}
+ {<5><6><7><8><9><10><12> gen*csr
+ <10.95> csr10
+ <14.4> csr12
+ <17.28><20.74><24.88> csr17
+ }{}
+\DeclareFontShape{IL2}{cmr}{m}{sl}
+ {<5><6><7> cssl8
+ <8><9> gen*cssl
+ <10><10.95> cssl10
+ <12><14.4><17.28><20.74><24.88> cssl12
+ }{}
+\DeclareFontShape{IL2}{cmr}{m}{it}
+ {<5><6><7> csti7
+ <8> csti8
+ <9> csti9
+ <10><10.95> csti10
+ <12><14.4><17.28><20.74><24.88> csti12
+ }{}
+\DeclareFontShape{IL2}{cmr}{m}{sc}
+ {<5><6><7><8><9><10><10.95><12>
+ <14.4><17.28><20.74><24.88> cscsc10
+ }{}
+\DeclareFontShape{IL2}{cmr}{m}{ui}
+ {<5><6><7><8><9><10><10.95><12>
+ <14.4><17.28><20.74><24.88> csu10
+ }{}
+\DeclareFontShape{IL2}{cmr}{b}{n}
+ {<5><6><7><8><9><10><10.95><12>
+ <14.4><17.28><20.74><24.88> csb10
+ }{}
+\DeclareFontShape{IL2}{cmr}{bx}{n}
+ {<5><6><7><8><9> gen*csbx
+ <10><10.95> csbx10
+ <12><14.4><17.28><20.74><24.88> csbx12
+ }{}
+\DeclareFontShape{IL2}{cmr}{bx}{sl}
+ {<5><6><7><8><9>
+ <10><10.95><12><14.4><17.28><20.74><24.88> csbxsl10
+ }{}
+\DeclareFontShape{IL2}{cmr}{bx}{it}
+ {<5><6><7><8><9>
+ <10><10.95><12><14.4><17.28><20.74><24.88> csbxti10
+ }{}
+\DeclareFontShape{IL2}{cmr}{bx}{ui}
+ {<->ssub * cmr/m/ui}{}
+%</il2cmr>
+%<*il2cmdh>
+\ProvidesFile{il2cmdh.fd}[1997/08/20 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmdh}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmdh}{m}{n}
+ {<10> csdunh10}{}
+%</il2cmdh>
+%<*il2cmfib>
+\ProvidesFile{il2cmfib.fd}[1997/08/20 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmfib}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmfib}{m}{n}
+ {<8> csfib8}{}
+%</il2cmfib>
+%<*il2cmfr>
+\ProvidesFile{il2cmfr.fd}[1997/08/20 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmfr}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmfr}{m}{n}
+ {<10> csff10}{}
+\DeclareFontShape{IL2}{cmfr}{m}{it}
+ {<10> csfi10}{}
+%</il2cmfr>
+%<*il2cmss>
+\ProvidesFile{il2cmss.fd}[1997/02/13 CsLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmss}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmss}{m}{n}
+ {<5><6><7><8> csss8
+ <9> csss9
+ <10><10.95> csss10
+ <12><14.4> csss12
+ <17.28><20.74><24.88> csss17
+ }{}
+\DeclareFontShape{IL2}{cmss}{m}{it}
+ {<->sub*cmss/m/sl}{}
+\DeclareFontShape{IL2}{cmss}{m}{sl}
+ {<5><6><7><8> csssi8
+ <9> csssi9
+ <10><10.95> csssi10
+ <12><14.4> csssi12
+ <17.28><20.74><24.88> csssi17
+ }{}
+\DeclareFontShape{IL2}{cmss}{m}{sc}
+ {<->sub*cmr/m/sc}{}
+\DeclareFontShape{IL2}{cmss}{m}{ui}
+ {<->sub*cmr/m/ui}{}
+\DeclareFontShape{IL2}{cmss}{sbc}{n}
+ {<5><6><7><8><9> csssdc10
+ <10><10.95><12><14.4><17.28><20.74><24.88> csssdc10
+ }{}
+\DeclareFontShape{IL2}{cmss}{bx}{n}
+ {<5><6><7><8><9> csssbx10
+ <10><10.95><12><14.4><17.28><20.74><24.88> csssbx10
+ }{}
+\DeclareFontShape{IL2}{cmss}{bx}{ui}
+ {<->sub*cmr/bx/ui}{}
+%</il2cmss>
+%<*il2cmtt>
+\ProvidesFile{il2cmtt.fd}[1997/08/20 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmtt}{\hyphenchar \font\m@ne}
+\DeclareFontShape{IL2}{cmtt}{m}{n}
+ {<5><6><7><8> cstt8
+ <9> cstt9
+ <10><10.95> cstt10
+ <12><14.4><17.28><20.74><24.88> cstt12
+ }{}
+\DeclareFontShape{IL2}{cmtt}{m}{it}
+ {<5><6><7><8><9>
+ <10><10.95><12><14.4><17.28><20.74><24.88> csitt10
+ }{}
+\DeclareFontShape{IL2}{cmtt}{m}{sl}
+ {<5><6><7><8><9>
+ <10><10.95><12><14.4><17.28><20.74><24.88> cssltt10
+ }{}
+\DeclareFontShape{IL2}{cmtt}{m}{sc}
+ {<5><6><7><8><9>
+ <10><10.95><12><14.4><17.28><20.74><24.88> cstcsc10
+ }{}
+\DeclareFontShape{IL2}{cmtt}{m}{ui}
+ {<->ssub * cmtt/m/it}{}
+\DeclareFontShape{IL2}{cmtt}{bx}{n}
+ {<->ssub * cmtt/m/n}{}
+\DeclareFontShape{IL2}{cmtt}{bx}{it}
+ {<->ssub * cmtt/m/it}{}
+\DeclareFontShape{IL2}{cmtt}{bx}{ui}
+ {<->ssub * cmtt/m/it}{}
+%</il2cmtt>
+%<*il2cmvtt>
+\ProvidesFile{il2cmvtt.fd}[1997/08/20 CSLaTeX font definitions]
+\DeclareFontFamily{IL2}{cmvtt}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{cmvtt}{m}{n}
+ {<5><6><7><8><9><10><10.95>
+ <12><14.4><17.28><20.74><24.88> csvtt10
+ }{}
+\DeclareFontShape{IL2}{cmvtt}{m}{it}
+ {<5><6><7><8><9><10><10.95>
+ <12><14.4><17.28><20.74><24.88> csvtti10
+ }{}
+%</il2cmvtt>
+%<*il2lcmss>
+\ProvidesFile{il2lcmss.fd}[1997/08/20 CSLaTeX slide font definitions]
+\DeclareFontFamily{IL2}{lcmss}{\hyphenchar\font45 }
+\DeclareFontShape{IL2}{lcmss}{m}{n}
+ {<7><8><10><12><13.82><16.59>
+ <19.907><23.89><28.66><34.4><41.28> lcsss8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{m}{In}
+ {<7><8><10><12><13.82><16.59>
+ <19.907><23.89><28.66><34.4><41.28> ilcsss8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{m}{sl}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> lcsssi8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{m}{Isl}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> ilcsssi8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{m}{it}
+ {<-> sub * lcmss/m/sl }{}
+\DeclareFontShape{IL2}{lcmss}{m}{Iit}
+ {<-> sub * lcmss/m/Isl }{}
+\DeclareFontShape{IL2}{lcmss}{bx}{n}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> lcsssb8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{bx}{In}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> ilcsssb8
+ }{}
+\DeclareFontShape{IL2}{lcmss}{m}{ui}
+ {<-> sub * cmr/m/ui }{}
+\DeclareFontShape{IL2}{lcmss}{bx}{ui}
+ {<-> sub * cmr/m/ui }{}
+%</il2lcmss>
+%<*il2lcmtt>
+\ProvidesFile{il2lcmtt.fd}[1997/08/20 CSLaTeX slide font definitions]
+\DeclareFontFamily{IL2}{lcmtt}{\hyphenchar\font\m@ne}
+\DeclareFontShape{IL2}{lcmtt}{m}{n}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> cstt8
+ }{}
+\DeclareFontShape{IL2}{lcmtt}{m}{In}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> icstt8
+ }{}
+\DeclareFontShape{IL2}{lcmtt}{m}{it}
+ {<13.82><16.59><19.907>
+ <23.89><28.66><34.4><41.28> csitt10
+ }{}
+\DeclareFontShape{IL2}{lcmtt}{m}{ui}
+ {<-> sub * cmtt/m/it }{}
+\DeclareFontShape{IL2}{lcmtt}{bx}{ui}
+ {<-> sub * cmtt/m/it }{}
+%</il2lcmtt>
+% \end{macrocode}
+%
+% \section{Czech and slovak style files---\texttt{czech.sty} and
+% \texttt{slovak.sty}}
+%
+% These packages can be used either with plain \TeX\ or with both
+% \LaTeX es. First we check if the file is not loaded twice.
+% \begin{macrocode}
+%<czech>\ifx\dateczech\undefined\else\endinput\fi
+%<slovak>\ifx\dateslovak\undefined\else\endinput\fi
+% \end{macrocode}
+% Our packages are not yet fully compatible with Babel. Following code
+% loads Babel's |ldf| file when the package is loaded from
+% Babel-ized \LaTeX\ format.
+% \begin{macrocode}
+\ifx\addlanguage\undefined\else
+ \ifx\LdfInit\@undefined
+ \def\LdfInit{%
+ \chardef\atcatcode=\catcode`\@
+ \catcode`\@=11\relax
+ \input babel.def\relax
+ \catcode`\@=\atcatcode \let\atcatcode\relax
+ \LdfInit}
+ \fi
+%<czech>\input czech.ldf
+%<slovak>\input slovak.ldf
+\endinput\fi
+% \end{macrocode}
+% Some definitions have to be different in different \TeX\ formats.
+% |\iflte| is true when the style is loaded from \LaTeXe.
+% \begin{macrocode}
+%<*czech|slovak>
+\newif\iflte
+\ifx\documentclass\undefined\else\ltetrue\fi
+\iflte
+ \NeedsTeXFormat{LaTeX2e}
+%</czech|slovak>
+%<*czech>
+ \ProvidesPackage{czech}[2002/07/19 v2.4 CSTeX czech style]
+\else
+ \message{Document Style Option `czech' ver. 2.4 <July 2002>.}
+%</czech>
+%<*slovak>
+ \ProvidesPackage{slovak}[2002/07/19 v2.4 CSTeX slovak style]
+\else
+ \message{Document Style Option `slovak' ver. 2.4 <July 2002>.}
+%</slovak>
+%<*czech|slovak>
+ \edef\origcatcodeat{\the\catcode`\@}\catcode`\@=11
+ \let\providecommand=\def
+ \let\protect=\relax
+\fi
+\iflte
+% \end{macrocode}
+% Options for selecting font encoding. The default is |IL2|.
+% \begin{macrocode}
+ \def\defaultcsoption{IL2}
+ \DeclareOption{IL2}{\def\encodingdefault{IL2}}
+ \DeclareOption {T1}{\def\encodingdefault {T1}}
+ \DeclareOption{OT1}{\def\encodingdefault{OT1}}
+% \end{macrocode}
+% May we split the hyphens or not? (je-li $\rightarrow$ je-/-li)
+% \begin{macrocode}
+ \DeclareOption{nosplit}{\standardhyphens}
+ \DeclareOption{split}{\splithyphens}
+ \DeclareOption{nocaptions}{\let\cap@unchgd=\relax}
+ \DeclareOption{olduv}{\let\cs@olduv=\relax}
+ \DeclareOption{cstex}{\relax} % Removed, lasts for compatibility
+ \ExecuteOptions{IL2}
+ \ProcessOptions
+ \def\dms#1#2{\DeclareMathSymbol{#1}{\mathalpha}{letters}{#2}}
+% \end{macrocode}
+% For IL2, the encoding of mathematical fonts is changed to IL2
+% (this encoding is equivalent to OT1 in slots 0--127). This allows
+% using accented letter in some font families. Another
+% consequence is that document does not use CM fonts where there are
+% equivalents in \CS-fonts, so there is no need to have both bitmaps of
+% CM-font and \CS-font. |\@font@warning| and |\@font@info| are
+% redefined for a while to avoid annoying font warnings.
+% \begin{macrocode}
+ \ifx\encodingdefault\defaultcsoption
+ \let\cs@warn=\@font@warning \let\@font@warning=\@gobble
+ \let\cs@info=\@font@info \let\@font@info=\@gobble
+ \SetSymbolFont{operators}{normal}{IL2}{cmr}{m}{n}
+ \SetSymbolFont{operators}{bold}{IL2}{cmr}{bx}{n}
+ \SetMathAlphabet\mathbf{normal}{IL2}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{normal}{IL2}{cmr}{m}{it}
+ \SetMathAlphabet\mathrm{normal}{IL2}{cmr}{m}{n}
+ \SetMathAlphabet\mathsf{normal}{IL2}{cmss}{m}{n}
+ \SetMathAlphabet\mathtt{normal}{IL2}{cmtt}{m}{n}
+ \SetMathAlphabet\mathbf{bold}{IL2}{cmr}{bx}{n}
+ \SetMathAlphabet\mathit{bold}{IL2}{cmr}{bx}{it}
+ \SetMathAlphabet\mathrm{bold}{IL2}{cmr}{bx}{n}
+ \SetMathAlphabet\mathsf{bold}{IL2}{cmss}{bx}{n}
+ \SetMathAlphabet\mathtt{bold}{IL2}{cmtt}{m}{n}
+ \let\@font@warning=\cs@warn \let\cs@warn=\undefined
+ \let\@font@info=\cs@info \let\cs@info=\undefined
+% \end{macrocode}
+% Accented letters are declared as math symbols. The purpose of this
+% is only the backward compatibility.
+% \begin{macrocode}
+ \dms{^^e1}{"E1}\dms{^^c1}{"C1}\dms{^^e8}{"E8}\dms{^^c8}{"C8}
+ \dms{^^ef}{"EF}\dms{^^cf}{"CF}\dms{^^e9}{"E9}\dms{^^c9}{"C9}
+ \dms{^^ec}{"EC}\dms{^^cc}{"CC}\dms{^^ed}{"ED}\dms{^^cd}{"CD}
+ \dms{^^b5}{"B5}\dms{^^a5}{"A5}\dms{^^f2}{"F2}\dms{^^d2}{"D2}
+ \dms{^^f3}{"F3}\dms{^^d3}{"D3}\dms{^^f8}{"F8}\dms{^^d8}{"D8}
+ \dms{^^b9}{"B9}\dms{^^a9}{"A9}\dms{^^bb}{"BB}\dms{^^ab}{"AB}
+ \dms{^^fa}{"FA}\dms{^^da}{"DA}\dms{^^f9}{"F9}\dms{^^d9}{"D9}
+ \dms{^^fd}{"FD}\dms{^^dd}{"DD}\dms{^^be}{"BE}\dms{^^ae}{"AE}
+ \fi
+\else
+ \def\gobble#1{}
+ \def\DeclareRobustCommand#1#2{\expandafter\def
+ \csname @\expandafter\gobble\string#1\endcsname{#2}
+ \edef#1{\noexpand\protect\expandafter\noexpand
+ \csname @\expandafter\gobble\string#1\endcsname}}
+ \ifx\ou\undefined \def\ou{\accent23u} \fi
+ \def\temp#1#2#3:{#1#2}
+ \edef\tempa{\string c\string s}
+ \edef\tempb{\expandafter\temp\fontname\tenrm:}
+ \ifx\tempa\tempb
+ \chardef\clqq=254 \sfcode254=0 \lccode254=0
+ \chardef\crqq=255 \sfcode255=0 \lccode255=0
+ \chardef\flqq=158 \sfcode158=0 \lccode158=0
+ \chardef\frqq=159 \sfcode159=0 \lccode159=0
+ \def\ogonek #1{\setbox0\hbox{#1}\ifdim\ht0=1ex\accent157 #1%
+ \else{\ooalign{\unhbox0\crcr\hss\char157}}\fi}
+ \chardef\promile=141
+ \def\DeclareTextCommandDefault#1#2{}
+ \else
+ \let\DeclareTextCommandDefault=\DeclareRobustCommand
+ \fi
+\fi
+%</czech|slovak>
+% \end{macrocode}
+% Czech captions.
+% \begin{macrocode}
+%<*czech>
+\def\captionsczech{%
+ \def\abstractname{Abstrakt}%
+ \def\appendixname{P\v{r}\'{\i}loha}%
+ \def\bibname{Literatura}%
+ \def\ccname{Na v\v{e}dom\'{\i}}
+ \def\chaptername{Kapitola}%
+ \def\contentsname{Obsah}%
+ \def\enclname{P\v{r}\'{\i}loha}%
+ \def\figurename{Obr\'azek}%
+ \def\headpagename{Strana}%
+ \def\headtoname{Komu}%
+ \def\indexname{Rejst\v{r}\'{\i}k}%
+ \def\listfigurename{Seznam obr\'azk\r{u}}%
+ \def\listtablename{Seznam tabulek}%
+ \def\partname{\v{C}\'ast}%
+ \def\prefacename{P\v{r}edmluva}%
+ \def\proofname{D\r{u}kaz}%
+ \def\seename{viz}%
+ \def\alsoseename{viz tak\'e}%
+ \def\refname{Reference}%
+ \def\tablename{Tabulka}}
+%</czech>
+% \end{macrocode}
+% Slovak captions.
+% \begin{macrocode}
+%<*slovak>
+\def\captionsslovak{%
+\def\prefacename{Predhovor}%
+\def\refname{Literat\'ura}%
+\def\appendixname{Dodatok}%
+\def\listfigurename{Zoznam obr\'azkov}%
+\def\listtablename {Zoznam tabuliek}%
+\def\indexname{Register}%
+\def\tablename{Tabu\v{l}ka}%
+\def\partname{\v{C}as\v{t}}%
+\def\enclname{Pr\'{\i}loha}%
+\def\headtoname{Pre}%
+\def\alsoname{vi\v{d} tie\v{z}}%
+\def\abstractname{Abstrakt}%
+\let\bibname\refname
+\def\chaptername{Kapitola}%
+\def\contentsname{Obsah}%
+\def\figurename{Obr.}%
+\def\ccname{cc.}%
+\def\pagename{Str.}%
+\def\seename{vi\v{d}}}
+%</slovak>
+% \end{macrocode}
+% English captions
+% \begin{macrocode}
+%<*czech|slovak>
+\providecommand\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\headpagename{Page}%
+ \def\prefacename{Preface}%
+ \def\seename{see}%
+ \def\alsoname{see also}}
+%</czech|slovak>
+% \end{macrocode}
+% Czech date.
+% \begin{macrocode}
+%<*czech>
+\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}
+% Switching on the czech captions and date (if not requested else)
+% \begin{macrocode}
+\iflte\ifx\cap@unchgd\undefined\captionsczech\dateczech\fi\fi
+%</czech>
+% \end{macrocode}
+% Slovak date
+% \begin{macrocode}
+%<*slovak>
+\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}
+% Switching on the slovak captions and date (if not requested else)
+% \begin{macrocode}
+\iflte\ifx\cap@unchgd\undefined\captionsslovak\dateslovak\fi\fi
+%</slovak>
+% \end{macrocode}
+% English (19th April 1997) and US (April 19, 1997) date
+% \begin{macrocode}
+%<*czech|slovak>
+\providecommand\dateUSenglish{\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}}
+\providecommand\dateenglish{\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}
+% 7bin cs quotes (for OT1)
+% \begin{macrocode}
+\DeclareTextCommandDefault\clqq{\leavevmode
+ \set@low@box{''}%
+ \setbox1=\hbox{l\/}\dimen1=\wd1
+ \setbox1=\hbox{l}\advance\dimen1 by -\wd1
+ \ifdim\dimen1>0pt\kern-.1em\box0\kern.1em
+ \else\kern.1em\box0\kern-.1em\fi\nobreak\hskip0pt}
+\DeclareTextCommandDefault\crqq{\edef\@SF{\spacefactor\the\spacefactor}%
+ \nobreak\kern-.07em\hbox{``}\kern.07em\@SF\relax}
+% \end{macrocode}
+% Lowers the box to ... of ...
+% \begin{macrocode}
+\def\set@low@box#1{\setbox2=\hbox{,}\setbox0=\hbox{#1}%
+ \dimen0=\ht0 \advance\dimen0 by -\ht2
+ \setbox0=\hbox{\lower\dimen0 \box0}\ht0=\ht2\dp0=\dp2}
+% \end{macrocode}
+% Single CS quotes.
+% \begin{macrocode}
+\DeclareRobustCommand\clq{\leavevmode\set@low@box{\char'047 }%
+ \box0 \kern.04em\nobreak\hskip0pt\relax}
+\DeclareRobustCommand\crq{{\edef\@SF{\spacefactor\the\spacefactor}%
+ \nobreak\char'140 \kern.17em\@SF\relax}}
+% \end{macrocode}
+% CS quotes in T1 encoding.
+% \begin{macrocode}
+\iflte
+ \DeclareTextCommand{\clqq}{T1}{\leavevmode\kern.1em
+ \char18 \kern-.0158em\nobreak\hskip0pt}
+ \DeclareTextCommand{\crqq}{T1}
+ {{\edef\@SF{\spacefactor\the\spacefactor}%
+ \nobreak\kern.06em \char16 \kern.024em \@SF\relax}}
+\fi
+% \end{macrocode}
+% Command for making quotes. There are two versions of |\uv|: the old,
+% which uses |\aftergroup|, allows using |\verb| inside quotes
+% (because there is no command with parameter), but violates kerning
+% in \CS-fonts. The new version defines |\uv| as command with one
+% parameter and its properties are the exact opposite of the old
+% version -- |\verb| not, kerning yes. The new version is the default in
+% \LaTeXe\ (where it can be overrided by the |olduv| option).
+% In plain \TeX\ and in \LaTeX\,2.09 compatibility mode, the old
+% version is default, for backward compatibility (current csplain
+% format does not need |czech/slovak.sty| at all).
+% \begin{macrocode}
+\iflte\else\let\if@compatibility=\iffalse{\let\fi=\fi}\fi
+\ifx\cs@olduv\undefined
+ \iflte
+ \if@compatibility
+ \DeclareRobustCommand\uv{\bgroup\aftergroup\closequotes
+ \leavevmode\clqq\let\next=}
+ \else
+ \DeclareRobustCommand\uv[1]{{\leavevmode\clqq#1\crqq}}
+ \fi
+ \else
+ \ifx\uv\undefined
+ \def\uv{\bgroup\aftergroup\closequotes
+ \leavevmode\clqq\let\next=}
+ \fi
+ \fi
+\else
+ \DeclareRobustCommand\uv{\bgroup\aftergroup\closequotes
+ \leavevmode\clqq\let\next=}
+\fi
+\def\closequotes{\unskip\crqq\relax}
+% \end{macrocode}
+% Active quotes (``'' $\to$ ,,``)
+% \begin{macrocode}
+\def\prim@s{\prime\futurelet\next\pr@m@s}
+{\catcode`\'=\active
+\gdef\csprimeson{\catcode96=\active \catcode39=\active
+ \def\pr@m@s{\ifx'\next\let\nxt\pr@@@s \else\ifx^\next\let\nxt\pr@@@t
+ \else\let\nxt\egroup\fi\fi \nxt}}}
+\def\csprimesoff{\catcode96=12 \catcode39=12
+ \def\pr@m@s{\ifx'\next\let\nxt\pr@@@s \else\ifx^\next\let\nxt\pr@@@t
+ \else\let\nxt\egroup\fi\fi \nxt}}
+{\csprimeson
+ \gdef'{\ifmmode\let\n@xt=\mathprim@\else\let\n@xt=\textprim@\fi\n@xt}%
+% \end{macrocode}
+% Activeness of the character `|'|' requires redefinition of macros
+% for converting |f'''| to |f^{\prime\prime\prime}| in math mode.
+% \begin{macrocode}
+ \gdef\mathprim@{^\bgroup\prim@s}%
+ \gdef\textprim@{\futurelet\nxt\rightprim@}%
+ \gdef\rightprim@{\ifx'\nxt\let\next=\douvr@
+ \else\let\next\crq\fi\next}%
+ \gdef`{\futurelet\nxt\leftprim@}%
+ \gdef\leftprim@{\ifx`\nxt\let\next=\douvl@
+ \else\let\next=\clq\fi\next}}
+\def\douvr@{\crqq\let\next= }%
+\def\douvl@{\clqq\let\next= }%
+\csprimesoff
+% \end{macrocode}
+% Should tilde in math mode expand to space?
+% \begin{macrocode}
+\def\cstieon{\def~{\ifmmode\else\penalty\@M\ \fi}}
+\def\cstieoff{\def~{\penalty\@M \ }}
+% \end{macrocode}
+% Hyphenation and language switching
+% \begin{macrocode}
+\iflte
+%</czech|slovak>
+%<czech>\AtBeginDocument{\czech}
+%<slovak>\AtBeginDocument{\slovak}
+%<*czech|slovak>
+ \frenchspacing
+\else
+ \def\setthisl@nguage#1#2#3#4{%
+ \ifx#2\undefined \immediate\write\sixt@@n
+ {Warning: I do not speak #1, (the style is not inputted)}
+ \else
+ \ifx#4\undefined \immediate\write\sixt@@n
+ {Warning: I do not speak #1,
+ (the hyphenation patterns are not included)}
+ \else#2#3#4\fi\fi}
+\def\selectlanguage#1{\language #1\relax
+ \ifcase #1\relax \dateUSenglish\captionsenglish\ehyph\or
+ \setthisl@nguage{german} \dategerman \captionsgerman \ghyph\or
+ \setthisl@nguage{austrian}\dateaustrian \captionsgerman \ahyph\or
+ \setthisl@nguage{french} \datefrench \captionsfrench \fhyph\or
+ \setthisl@nguage{english} \dateenglish \captionsenglish\ehyph\or
+ \setthisl@nguage{czech} \dateczech \captionsczech \chyph\or
+ \setthisl@nguage{slovak} \dateslovak \captionsslovak \shyph\fi}
+\def\originalTeX{\selectlanguage{\USenglish}
+ \csname cmaccents\endcsname}
+\def\czechTeX{\selectlanguage{\czech}\csname csaccents\endcsname}
+\def\slovakTeX{\selectlanguage{\slovak}\csname csaccents\endcsname}
+\catcode`\@=\origcatcodeat
+%<czech>\czechTeX
+%<slovak>\slovakTeX
+\fi
+\endinput
+%</czech|slovak>
+% \end{macrocode}
diff --git a/Master/texmf-dist/source/cslatex/base/cslatex.ins b/Master/texmf-dist/source/cslatex/base/cslatex.ins
new file mode 100644
index 00000000000..8eaee533536
--- /dev/null
+++ b/Master/texmf-dist/source/cslatex/base/cslatex.ins
@@ -0,0 +1,52 @@
+% -*-LaTeX-*-
+\input docstrip
+\preamble
+
+Tento soubor je soucasti baliku CsLaTeX a je vygenerovan z
+distribucniho souboru cslatex.dtx.
+
+Copyright (c) 1994--98, 2002
+Jaroslav Snajdr, Zdenek Wagner, Jiri Zlatuska a The LaTeX3 Project
+
+Tento soubor NENI soucasti systemu LaTeX2e
+------------------------------------------
+
+Dalsi informace naleznete na www.cstug.cz/cslatex.
+
+\endpreamble
+\keepsilent
+\Msg{* Rozbaluji konfiguracni soubory pro CsLaTeX...}
+\generate{\file {hyphen.cfg}{\from{cslatex.dtx}{hyphen}}
+ \file{fonttext.cfg}{\from{cslatex.dtx}{fonttext}}
+ \file {il2enc.def}{\from{cslatex.dtx}{il2enc}}
+ \file {il2cmr.fd}{\from{cslatex.dtx}{il2cmr}}
+ \file {il2cmdh.fd}{\from{cslatex.dtx}{il2cmdh}}
+ \file {il2cmfib.fd}{\from{cslatex.dtx}{il2cmfib}}
+ \file {il2cmfr.fd}{\from{cslatex.dtx}{il2cmfr}}
+ \file {il2cmss.fd}{\from{cslatex.dtx}{il2cmss}}
+ \file {il2cmtt.fd}{\from{cslatex.dtx}{il2cmtt}}
+ \file {il2cmvtt.fd}{\from{cslatex.dtx}{il2cmvtt}}
+ \file {il2lcmss.fd}{\from{cslatex.dtx}{il2lcmss}}
+ \file {il2lcmtt.fd}{\from{cslatex.dtx}{il2cmtt}}
+ \file {czech.sty}{\from{cslatex.dtx}{czech}}
+ \file {slovak.sty}{\from{cslatex.dtx}{slovak}}}
+\Msg{*******************************************************}
+\Msg{* Presunte soubory}
+\Msg{* \space\space hyphen.cfg}
+\Msg{* \space\space fonttext.cfg}
+\Msg{* \space\space il2enc.def}
+\Msg{* \space\space il2cmr.fd}
+\Msg{* \space\space il2cmdh.fd}
+\Msg{* \space\space il2cmfib.fd}
+\Msg{* \space\space il2cmfr.fd}
+\Msg{* \space\space il2cmss.fd}
+\Msg{* \space\space il2cmtt.fd}
+\Msg{* \space\space il2cmvtt.fd}
+\Msg{* \space\space il2lcmss.fd}
+\Msg{* \space\space il2lcmtt.fd}
+\Msg{* \space\space czech.sty}
+\Msg{* \space\space slovak.sty}
+\Msg{* do adresare s rozbalenymi vstupnimi soubory LaTeXu}
+\Msg{* Format vygenerujte pomoci initex latex.ltx}
+\Msg{*******************************************************}
+\endbatchfile \ No newline at end of file
diff --git a/Master/texmf-dist/source/cslatex/base/cslatex.txt b/Master/texmf-dist/source/cslatex/base/cslatex.txt
new file mode 100644
index 00000000000..bb011889d58
--- /dev/null
+++ b/Master/texmf-dist/source/cslatex/base/cslatex.txt
@@ -0,0 +1,209 @@
+CSLaTeX --- úpravy LaTeXu 2e pro èeskou a slovenskou sazbu
+ Verze pro LaTeX z prosince '96
+==========================================================
+28.10.1997 Jaroslav ©najdr
+
+CSLaTeX je sada konfiguraèních souborù pro LaTeX2e, které umo¾òují v
+tomto systému pøipravovat èeské a slovenské dokumenty. Balík je
+distribuován (jak je u LaTeXu zvykem) v souboru cslatex.dtx, který
+obsahuje pøíslu¹ná makra i s dùkladnou dokumentací. Soubor cslatex.ins
+je dávka pro program docstrip, který z dtx zdroje vygeneruje vlastní
+soubory.
+
+Instalace
+---------
+
+Pro instalaci potøebujete (kromì TeXu):
+
+o CS-fonty.
+
+o èeské a slovenské vzory dìlení czhyphen.tex a skhyphen.tex. Jsou
+ souèástí csplainu.
+
+o LaTeXové "obrázkové" fonty lasy, lcircle a line.
+
+o Originální LaTeX2e. Distribuèní soubory jsou k nalezení na CTANu v
+ adresáøi /tex-archive/macros/latex/base/.
+
+Pokud toto v¹echno máte, mù¾ete zaèít instalovat:
+
+o Sma¾te (zazálohujte) starou verzi LaTeXu. POZOR! Toto se netýká
+ podpùrných balíèkù, napø. graphics, tools nebo psnfss. Jejich
+ upgrade (je-li k dispozici novìj¹í verze) je samostatnou zále¾itostí
+ a není bezpodmíneènì nutný. Pokud máte nainstalovanou star¹í verzi
+ CSLaTeXu, mìly by zmizet adresáøe texmf/tex/latex/cslatex, input a
+ src. Máte-li v adresáøi input nìkteré styly, které nejsou standardní
+ souèástí LaTeXu (napø. a4, a4wide, fancyhdr), vytvoøte adresáø
+ texmf/tex/latex/misc a pøesuòte je tam.
+
+o Pokud vá¹ TeX pou¾ívá ke hledání v adresáøovém stromu hashovací
+ soubor (napø. v teTeXu ls-R), nechte ho znovu vytvoøit, aby se
+ projevily provedené zmìny -- smazané soubory. V teTeXu k tomuto
+ slou¾í pøíkaz texhash.
+
+o Vytvoøte si nìkde v /tmp doèasný adresáø, do kterého zkopírujete
+ distribuèní soubory LaTeXu a CSLaTeXové soubory cslatex.dtx a
+ cslatex.ins.
+
+o V tomto adresáøi rozbalte distribuci LaTeXu pøíkazy "initex
+ unpack.ins" a "initex cslatex.ins".
+
+o V normální konfiguraci pou¾ívá LaTeX v kódování T1 dc-fonty. Máte-li
+ novìj¹í ec-fonty, vytvoøte pøíslu¹nì upravené definièní soubory
+ pøíkazem "initex ec.ins". Tento krok musí následovat a¾ PO
+ zpracování unpack.ins.
+
+o Vytvoøte formát LaTeX pøíkazem "initex latex.ltx".
+
+Nyní máme v na¹em adresáøi 266 souborù, z nich¾ ty potøebné pøesuneme
+na pøíslu¹ná místa do adresáøové struktury TeXu:
+
+o Soubor latex.fmt pøesuòte do adresáøe s formáty -- v teTeXu
+ texmf/web2c.
+
+o Konfiguraèní soubory pro èe¹tinu pøesuneme do adresáøe
+ texmf/tex/latex/cslatex. Jsou to tyto:
+
+ fonttext.cfg
+ hyphen.cfg
+ il2enc.def
+ il2*.fd
+ lczech.sty
+ lslovak.sty
+
+o Do adresáøe texmf/tex/latex/input dáme vstupní soubory LaTeXu:
+
+ docstrip.tex
+ *.cls
+ *.clo
+ *.sty
+ *.fd
+ *.ist
+ *.def
+ *.cfg
+
+o Zdrojové soubory LaTeXu
+
+ fontmath.ltx
+ fonttext.ltx
+ hyphen.ltx
+ latex.ltx
+ ltpatch.ltx
+ preload.ltx
+
+nejsou tøeba pro normální práci, ale budeme je potøebovat, pokud
+chceme vygenerovat znovu formát. Tento pøípad mù¾e nastat, kdy¾ budeme
+do LaTeXu pøidávat nové vzory dìlení, nebo kdy¾ si fmt soubor prostì
+omylem sma¾eme. Proto je pøesuneme do adresáøe /texmf/tex/latex/src.
+
+Ostatní soubory nebudeme potøebovat, proto je mù¾eme smazat.
+
+Vygenerujeme hashovací soubor pro TeX pøíkazem "texhash"
+(teTeX). LaTeX je nainstalován a mù¾eme ho otestovat na nìjakém
+krátkém dokumentíku.
+
+
+Konfigurace dìlení slov
+-----------------------
+
+Konfiguraèní pøíkazy se nacházejí v souboru cslatex/hyphen.cfg.
+Pøíslu¹ná èást souboru je viditelnì ohranièena komentáøovými
+øádkami. K zavedení vzorù dìlení slou¾í pøíkaz
+
+ \DeclareLanguage[seznam kódování]{jméno pøíkazu zapnutí vzorù}%
+ {jméno souboru se vzory a výjimkami}%
+ {\lefthyphenmin=èíslo \righthyphenmin=èíslo
+ \@requesthyphens <nebo> \@splitrequestedfalse}
+
+Vzory dìlení naètené s \@requesthyphens umí vyu¾ívat funkci pøená¹ení
+pomlèky pøi dìlení (viz ní¾e).
+
+Implicitnì je zavedena americká angliètina, èe¹tina a sloven¹tina v
+kódování IL2. Pro zavedení èe¹tiny v IL2 i T1 pou¾ijte:
+
+ \DeclareLanguage[IL2,T1]{\czech}{czhyphen.tex}%
+ {\lefthyphenmin=2 \righthyphenmin=3
+ \@requesthyphens}%
+
+V bì¾ném TeXu mù¾e být maximálnì 4 a¾ 5 vzorù najednou -- víc se do
+jeho pamìti nevejde.
+
+
+Styl czech.sty/slovak.sty
+-------------------------
+
+Bez zavedení tohoto stylu se CSLaTeX chová jako normální LaTeX a
+pou¾ívá cm-fonty bez èeských znakù.
+
+Pomocný styl zavedeme pomocí
+
+ \usepackage[parametry]{czech}
+popø.
+ \usepackage[paremetry]{slovak}
+
+Parametry mù¾ou být:
+
+T1
+ Cork kódování. Budou se pou¾ívat dc(ec) fonty. Aby se správnì
+ dìlila slova, musí být vzory dìlení nata¾eny také pro T1 (viz
+ vý¹e). Bez tohoto parametru je pou¾ito kódování IL2.
+
+split
+ Zapíná pøená¹ení pomlèky pøi dìlení slov typu propan-
+ -butan. Tato vlastnost funguje skoro bez problémù -- výjimkou
+ je pou¾ití `-' jako minus v èísle, které ète TeX v
+ horizontálním módu (tak bývá zadáváno napø. \looseness=-1); v
+ tìchto pøípadech je pøi zapnutém pøená¹ení dìlítka mo¾né
+ napsat \minus.
+
+nosplit
+ Vypíná pøená¹ení pomlèky. To je také implicitní chování.
+
+nocaptions
+ Nebudou pøedefinovány texty vkládané LaTeXem jako "Kapitola"
+ nebo "Obsah". Zùstanou tedy pùvodní "Chapter" nebo "Contents".
+
+olduv
+ Pøíkaz \uv je (novì) definován tak, ¾e zajistí správný kerning
+ kolem uvozovek, ale uvnitø jeho argumentu nelze pou¾ít pøíkaz
+ \verb. Pou¾itím volby olduv dostaneme starou definici, která
+ se chovala pøesnì obrácenì -- ¹patný kerning, lze pou¾ít \verb.
+ Oba tyto po¾adavky se navzájem vyluèují a nikdo dosud
+ nevymyslel øe¹ení, kde by fungovalo obojí najednou.
+
+Volba 'cstex', která umo¾òovala pou¾ívání pøíkazù \csprimeson/off,
+byla zru¹ena a tyto pøíkazy lze pou¾ívat rovnou. Kvùli zpìtné
+kompatibilitì je stále deklarována, ale vùbec nic nedìlá -- její
+pou¾ití pouze nezpùsobí chybu.
+
+Pøíkazy definované ve stylu czech/slovak.sty
+--------------------------------------------
+
+\dateczech
+ Pøíkaz \today expanduje na èeské datum, napø. 30. srpna 1977.
+
+\dateslovak
+ Slovenské datum, napø. 30. augusta 1977.
+
+\dateUSenglish
+ Americké \today, napø. August 30th, 1977.
+
+\dateenglish
+ Britské \today, napø. 30th August 1977.
+
+\captionsczech
+ Èeské captions -- Pøedmluva, Tabulka.
+
+\captionsslovak
+ Slovenské captions -- Predhovor, Tabuµka.
+
+\captionsenglish
+ Anglické captions -- Preface, Table.
+
+\csprimeson, \csprimesoff
+ ``Anglické'' uvozovky se (ne)budou sázet jako èeské 99 66.
+
+\cstieon, \cstieoff
+ Pøedefinuje vlnku ~, aby se v mat. módu (ne)sázela mezera.
+
+--
diff --git a/Master/texmf-dist/source/eplain/base/add-date b/Master/texmf-dist/source/eplain/base/add-date
new file mode 100644
index 00000000000..8465939b5b8
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/add-date
@@ -0,0 +1,28 @@
+#!/bin/sh
+# This file is public domain.
+
+# Change placeholders to variations on the current date. Assumes
+# various % constructs are recognized.
+
+if test $# -lt 1
+then
+ echo "Usage: $0 [<file> <file> ...]"
+ exit 1
+fi
+
+temp=${TMPDIR-/tmp}/adddate$$
+
+for f in "$@"; do
+ sed -e s/REPLACE-WITH-MONTH-YEAR/"`date +'%B %Y'`"/ \
+ -e s/REPLACE-WITH-DAY-MONTH-YEAR/"`date +'%e %B %Y'`"/ \
+ -e s/REPLACE-WITH-DATE/"`date`"/ \
+ <$f >$temp
+ if cmp -s $f $temp; then
+ echo "$f: No REPLACE-WITH-<date>."
+ exit 1
+ fi
+ rm -f $f
+ mv $temp $f
+done
+
+rm -f $temp
diff --git a/Master/texmf-dist/source/eplain/base/add-version b/Master/texmf-dist/source/eplain/base/add-version
new file mode 100644
index 00000000000..1934c8957f6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/add-version
@@ -0,0 +1,24 @@
+#!/bin/sh
+# This file is public domain.
+
+if test $# -lt 2; then
+ echo "Usage: $0 <version> [<file> <file> ...]"
+ exit 1
+fi
+
+temp=${TMPDIR-/tmp}/version$$
+
+version=$1
+shift
+
+for f in "$@"; do
+ sed "s/REPLACE-WITH-VERSION/$version/" <$f >$temp || exit 1
+ if cmp -s $f $temp; then
+ echo "$f: No REPLACE-WITH-VERSION."
+ exit 1
+ fi
+ rm -f $f
+ mv $temp $f
+done
+
+rm -f $temp
diff --git a/Master/texmf-dist/source/eplain/base/etex.tex b/Master/texmf-dist/source/eplain/base/etex.tex
new file mode 100644
index 00000000000..46fe32ee733
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/etex.tex
@@ -0,0 +1,5 @@
+% This file just makes a .fmt file, assuming plain is loaded.
+%
+\input eplain
+
+\dump
diff --git a/Master/texmf-dist/source/eplain/base/fix-checksum b/Master/texmf-dist/source/eplain/base/fix-checksum
new file mode 100644
index 00000000000..c2f830f10f3
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/fix-checksum
@@ -0,0 +1,20 @@
+#!/bin/sh
+# This file is public domain.
+
+# Fix a checksum line in the files given as arguments.
+
+tmpfile=/tmp/checksum$$
+
+for f in $*
+do
+ checksum=""
+ newchecksum=`wc < $f | sed "s/^ *//"`
+ while test "$checksum" != "$newchecksum"
+ do
+ sed -e "1,50s/checksum = .*,/checksum = \"$newchecksum\",/" $f > $tmpfile
+ checksum="$newchecksum"
+ newchecksum=`wc < $tmpfile | sed "s/^ *//"`
+ done
+ mv -f $tmpfile $f
+done
+
diff --git a/Master/texmf-dist/source/eplain/base/merge b/Master/texmf-dist/source/eplain/base/merge
new file mode 100644
index 00000000000..b300b936bca
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/merge
@@ -0,0 +1,84 @@
+#!/bin/sh
+# This file is public domain.
+
+# Merge the constituent files with xeplain.tex to produce eplain.tex.
+
+# Usually we are called from the Makefile, and the `version' variable is set.
+if test -z "$version"; then
+ echo "No version number, using xx!"
+ version=xx
+fi
+
+btxtmp=/tmp/mergebtx$$
+common1tmp=/tmp/mergec1$$
+common2tmp=/tmp/mergec2$$
+common3tmp=/tmp/mergec3$$
+eplaintmp=/tmp/mergepl$$
+arrow1tmp=/tmp/mergea1$$
+arrow2tmp=/tmp/mergea2$$
+pathtmp=/tmp/mergepa$$
+ifpdftmp=/tmp/mergeif$$
+
+rm -f eplain.tex
+
+# Use this regexp to strip comments with egrep.
+commentre='^ *%([^%]|$)'
+
+# Extract the relevant parts of btxmac.tex (without comments).
+egrep -v "$commentre" btxmac.tex \
+ | sed -n \
+ -e "1,/^%% \[\[\[start .*\]\]\]/w $common1tmp" \
+ -e "/^%% \[\[\[start .*\]\]\]/,/^%% \[\[\[end .*\]\]\]/w $btxtmp" \
+ -e "/^%% \[\[\[end .*\]\]\]/,\$w $common2tmp"
+
+# Get texnames.sty and path.sty. Remove the announcement, as well as
+# the comments.
+egrep -v "$commentre|immediate" texnames.sty > $common3tmp
+egrep -v "$commentre|immediate" path.sty > $pathtmp
+
+# Get arrow.tex.
+egrep -v "$commentre" arrow.tex \
+ | sed -n \
+ -e '1,/catcode.*\&.*4/w '"$arrow1tmp" \
+ -e '/catcode.*\&.*4/,$w '"$arrow2tmp"
+
+# Get ifpdf.sty
+egrep -v "$commentre"'|^ {0,6}\\immediate' ifpdf.sty > $ifpdftmp
+
+# Merge the above into xeplain, calling the result eplain. Also change the
+# `filename' in the comment.%%
+egrep -v "$commentre" xeplain.tex \
+ | sed -e 's/"xeplain.tex"/"eplain.tex"/' \
+ -e "/^%% \[\[\[here is the first.*\]\]\]/r $common1tmp" \
+ -e "/^ %% \[\[\[here are the BibTeX.*\]\]\]/r $btxtmp" \
+ -e "/^%% \[\[\[here is the second.*\]\]\]/r $common2tmp" \
+ -e "/^%% \[\[\[include texnames.*\]\]\]/r $common3tmp" \
+ -e "/^%% \[\[\[include path.*\]\]\]/r $pathtmp" \
+ -e "/^ %% \[\[\[include arrow1\]\]\]/r $arrow1tmp" \
+ -e "/^ %% \[\[\[include arrow2\]\]\]/r $arrow2tmp" \
+ -e "/^%% \[\[\[include ifpdf.*\]\]\]/r $ifpdftmp" \
+ > $eplaintmp
+
+# Remove our [[[...]]] markers and \endinput's.
+egrep -v '\[\[\[|^ *$|\\endinput' $eplaintmp > eplain.tex
+
+# Fix header fields.
+./add-date eplain.tex
+./add-version $version eplain.tex
+./fix-checksum eplain.tex
+
+# Old checksum computation:
+#checksum=`wc < $eplaintmp | sed -n "s/^ *//"`
+# Replace the checksum in the old file. We really should loop here,
+# since one iteration may not be enough. Only replace the first
+# checksum, since the second is for btxmac.
+#sed -e "1,50s/checksum = .*,/checksum = \"$checksum\",/" $eplaintmp \
+# > eplain.tex
+
+chmod a-w eplain.tex
+#ls -lt btxmac.tex path.sty texnames.sty xeplain.tex eplain.tex arrow.tex
+#wc eplain.tex
+#grep 'checksum.*=' eplain.tex
+
+rm -f $btxtmp $eplaintmp $common1tmp $common2tmp $common3tmp
+rm -f $arrow1tmp $arrow2tmp $pathtmp $ifpdftmp
diff --git a/Master/texmf-dist/source/eplain/base/packages.zip b/Master/texmf-dist/source/eplain/base/packages.zip
new file mode 100644
index 00000000000..6bbf89e4203
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/packages.zip
Binary files differ
diff --git a/Master/texmf-dist/source/eplain/base/test/allref.tex b/Master/texmf-dist/source/eplain/base/test/allref.tex
new file mode 100644
index 00000000000..8e4f51270b0
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/allref.tex
@@ -0,0 +1,15 @@
+% This file is public domain.
+%
+% Test all kinds of references.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+\let\primitiveend = \end
+\let\end = \relax
+
+\input cite
+\input xref
+\primitiveend
+
+\input eqref
+
diff --git a/Master/texmf-dist/source/eplain/base/test/boxes.tex b/Master/texmf-dist/source/eplain/base/test/boxes.tex
new file mode 100644
index 00000000000..b58e1ffef34
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/boxes.tex
@@ -0,0 +1,11 @@
+% This file is public domain.
+%
+\input eplain
+
+A box: \blackbox
+
+A large rectangle:
+\ht0=2pc \dp0=2pc \wd0=3pc
+\makeblankbox{.8pt}{.8pt}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/boxit.tex b/Master/texmf-dist/source/eplain/base/test/boxit.tex
new file mode 100644
index 00000000000..20da2e7c27d
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/boxit.tex
@@ -0,0 +1,24 @@
+% This file is public domain.
+%
+% Test \boxit.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+\boxit{\hbox{the basics, boxed}}
+
+\boxitspace = 24pt
+\boxit{\hbox{should be spacier}}
+
+\boxitspace = 5pt
+
+\boxit{\vbox{Something that is more than one line long, no matter how verbose
+I have to do make it so, so that we can see if the line breaks are
+plausible.}}
+
+
+\boxit{\vbox{\hsize = 4in Another one that is more than one line long, just
+to see if resetting hsize inside the box will work.}}
+
+\boxit{\boxit{\hbox{double box}}}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/catcode.tex b/Master/texmf-dist/source/eplain/base/test/catcode.tex
new file mode 100644
index 00000000000..af71f740ea9
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/catcode.tex
@@ -0,0 +1,8 @@
+% This file is public domain.
+%
+The catcode BEFORE loading eplain: \the\catcode`@ \showthe\catcode`@
+\input eplain
+
+The catcode AFTER loading eplain: \the\catcode`@ \showthe\catcode`@
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/center.tex b/Master/texmf-dist/source/eplain/base/test/center.tex
new file mode 100644
index 00000000000..628155050a6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/center.tex
@@ -0,0 +1,12 @@
+% This file is public domain.
+%
+\input eplain
+
+\def\title{\begingroup \def\endcentermacro{\endtitle}\bf\center}
+\def\endtitle{\endcenter\endgroup}
+
+\loggingall
+\title hi
+\endtitle
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/cite.bib b/Master/texmf-dist/source/eplain/base/test/cite.bib
new file mode 100644
index 00000000000..7c082677b4f
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/cite.bib
@@ -0,0 +1,25 @@
+% This file is public domain.
+
+@book{chicago,
+ title = "Chicago",
+}
+
+@book{texbook,
+ title = "texbook"
+}
+
+@book{prime-number-theorem,
+ title = "prime number theorem",
+}
+
+@book{1234567890)(@!`['";:]|<>./?-=+_$^&,
+ title = "weird label"
+}
+
+@book{others,
+ author = "Jill and Susan and others"
+}
+
+@book{accented,
+ author = "{\'E}ric {\'E}ttelbaum"
+}
diff --git a/Master/texmf-dist/source/eplain/base/test/cite.tex b/Master/texmf-dist/source/eplain/base/test/cite.tex
new file mode 100644
index 00000000000..12b818995bb
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/cite.tex
@@ -0,0 +1,35 @@
+% This file is public domain.
+%
+% Test file for citations (plain bibliography style).
+%
+\ifx\eplain\undefined \input eplain \fi
+\loggingall
+
+Let's cite chicago: \cite{chicago}.
+
+Now let's have multiple citations: \cite{chicago,texbook}.
+
+Now let's have a non-alphabetic label: \cite{prime-number-theorem}.
+
+Here is an undefined citation: \cite{undefined}.
+
+Here is a citation with an optional note: \cite[note]{texbook}.
+
+Here is a citation with a weird label:
+\cite{1234567890)(@!`['";:]|<>./?-=+_$^&}.
+
+Now let's cite an `and others': \cite{others}.
+
+And an accented one: \cite{accented}.
+
+Let's get up to ten refs:
+\cite{article-minimal,article-full,article-crossref,whole-journal,%
+inbook-minimal,inbook-full}
+
+\bigskip
+\leftline{\bf References.}
+
+\bibliography{cite,xampl}
+\bibliographystyle{plain}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/citeall.tex b/Master/texmf-dist/source/eplain/base/test/citeall.tex
new file mode 100644
index 00000000000..24929568abe
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citeall.tex
@@ -0,0 +1,12 @@
+% This file is public domain.
+%
+\input btxmac
+
+Cite all the entries in the bib database files {\tt knuth.bib} and {\tt
+ep.bib}:
+
+\nocite{*}
+\bibliography{knuth,ep}
+\bibliographystyle{plain}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/citealph.tex b/Master/texmf-dist/source/eplain/base/test/citealph.tex
new file mode 100644
index 00000000000..5b83d26d2b6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citealph.tex
@@ -0,0 +1,26 @@
+% This file is public domain.
+%
+% Test file for citations (alphabetic bibliography style).
+%
+\input eplain
+
+Let's cite chicago and van-leunen: \cite{chicago,van-leunen}.
+
+Now let's cite an `and others': \cite{others}.
+
+And an accented one: \cite{accented}.
+
+Here is a citation with an optional note: \cite[note]{texbook}.
+
+Here is a citation with a weird label:
+\cite{1234567890)(@!`['";:]|<>./?-=+}.
+
+Here is an undefined citation: \cite{undefined}.
+
+\bigskip
+\leftline{\bf References.}
+
+\bibliography{cite}
+\bibliographystyle{alpha}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/citeapa.tex b/Master/texmf-dist/source/eplain/base/test/citeapa.tex
new file mode 100644
index 00000000000..3d59f70fa09
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citeapa.tex
@@ -0,0 +1,26 @@
+% This file is public domain.
+%
+% Test file for citations (alphabetic bibliography style).
+%
+\input btxmac
+
+Let's cite chicago and van-leunen: \cite{chicago,van-leunen}.
+
+Now let's cite an `and others': \cite{others}.
+
+And an accented one: \cite{accented}.
+
+Here is a citation with an optional note: \cite[note]{texbook}.
+
+Here is a citation with a weird label:
+\cite{1234567890)(@!`['";:]|<>./?-=+}.
+
+Here is an undefined citation: \cite{undefined}.
+
+\bigskip
+\leftline{\bf References.}
+
+\bibliography{cite}
+\bibliographystyle{apalike}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/citebegin.tex b/Master/texmf-dist/source/eplain/base/test/citebegin.tex
new file mode 100644
index 00000000000..75b5c8d6de6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citebegin.tex
@@ -0,0 +1,20 @@
+% This file is public domain.
+%
+\input eplain
+
+\let\primitiveend = \end
+\def\bye{\vfill\eject\primitiveend}
+
+\def\begin#1#2{%
+ \message{widest label is #2}
+}
+\def\end#1{}
+
+Two citations to Knuthian works: \cite{surreal,concrete-math}.
+
+\beginsection{References.}\par % Title for the bibliography.
+
+\bibliography{knuth} % Use knuth.bib to resolve the labels.
+\bibliographystyle{plain} % Number the references.
+
+\bye % End of the document.
diff --git a/Master/texmf-dist/source/eplain/base/test/citecust.tex b/Master/texmf-dist/source/eplain/base/test/citecust.tex
new file mode 100644
index 00000000000..2b3266407ba
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citecust.tex
@@ -0,0 +1,38 @@
+% This file is public domain.
+%
+% File to test the various customizations btxmac.tex allows.
+%
+\input eplain
+
+% Have citations come out as superscripts, as in footnotes.
+%
+% Unfortunately, plain TeX doesn't define the \scriptfont for the \tt
+% family. Since we use \tt to print unresolved bib-references, we define
+% it ourselves, so we can use superscripts.
+\font\eighttt = cmtt8
+\scriptfont\ttfam = \eighttt
+\def\printcitestart{$^\bgroup}
+\def\printbetweencitations{,\space}
+\def\printcitefinish{\egroup$}
+\def\printcitenote#1{\hbox{\sevenrm\space (#1)}}
+
+% Do angle brackets instead of brackets. (We don't redefine \biblabelprint.)
+%
+\def\biblabelcontents#1{\bblrm $\langle$#1$\rangle$}
+
+% Use sans serif instead of roman, and slanted instead of italic.
+%
+\font\bblrm = cmss10
+\font\bblem = cmsl10
+
+% Put a rule before the bibliography.
+%
+\def\bblhook{\medskip\hrule\smallskip}
+
+Two citations to Knuthian works: \cite{surreal,concrete-math}.
+
+This one with a note: \cite[another one]{surreal}.
+
+\bibliography{knuth} % Use knuth.bib to resolve the labels.
+\bibliographystyle{plain} % Number the references.
+\end % End of the document.
diff --git a/Master/texmf-dist/source/eplain/base/test/citenote.tex b/Master/texmf-dist/source/eplain/base/test/citenote.tex
new file mode 100644
index 00000000000..429b5cd456f
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citenote.tex
@@ -0,0 +1,13 @@
+% This file is public domain.
+%
+% Test file for citations (plain bibliography style).
+%
+\ifx\eplain\undefined \input eplain \fi
+\loggingall
+
+Here is a citation with an optional note, first: \cite[note]{texbook}.
+
+\bibliography{cite}
+\bibliographystyle{plain}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/citex.tex b/Master/texmf-dist/source/eplain/base/test/citex.tex
new file mode 100644
index 00000000000..69e880490a7
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/citex.tex
@@ -0,0 +1,8 @@
+% This file is public domain.
+%
+\input eplain
+Two citations to Knuthian works: \cite{surreal,concrete-math}.
+\beginsection{References.}\par % Title for the bibliography.
+\bibliography{knuth} % Use knuth.bib to resolve the labels.
+\bibliographystyle{plain} % Number the references.
+\end % End of the document.
diff --git a/Master/texmf-dist/source/eplain/base/test/colfootn.tex b/Master/texmf-dist/source/eplain/base/test/colfootn.tex
new file mode 100644
index 00000000000..942f71f50b3
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/colfootn.tex
@@ -0,0 +1,18 @@
+% This file is public domain.
+%
+\input eplain
+
+\loggingall
+
+\vsize = 6\baselineskip
+\doublecolumns
+
+\leftline{1\footnote\dag{A footnote that is longer than the column
+width. Much much longer longer.}}
+\count255 = 2
+\loop
+ \leftline{\number\count255}
+ \advance\count255 by 1
+\ifnum\count255 < 14 \repeat
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/colrule.tex b/Master/texmf-dist/source/eplain/base/test/colrule.tex
new file mode 100644
index 00000000000..5213685e9a3
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/colrule.tex
@@ -0,0 +1,33 @@
+% This file is public domain.
+%
+\input eplain
+
+% ashley suggested the length of the footnote rule changes where the
+% second column starts.
+\vsize = 3in
+\footnoterulewidth = 6in
+\doublecolumns
+This is a footnote\footnote1{No, this is the footnote} in double column mode.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+And now we have lots of text to fill up the column.
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/column.tex b/Master/texmf-dist/source/eplain/base/test/column.tex
new file mode 100644
index 00000000000..be1d521fe08
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/column.tex
@@ -0,0 +1,228 @@
+% This file is public domain.
+%
+% Test double columns with headlines, single-column material, and a
+% \topinsert.
+\ifx\undefined\eplain \input eplain \fi
+%\catcode`@=11
+%\input gcol
+%\catcode`@=12
+
+\gutter = 1pc
+\hyphenation{pour-ed}
+
+\headline = {This is the headline \hfil}
+
+{\center
+ A test file for eplain
+ Karl\footnote\dag{Credit in a footnote. Longer than one column. %
+ Longer longer longer.}
+}
+
+\topinsert
+This should appear at the top of the page, since it's a topinsert. It's
+also longer than one column.
+\endinsert
+
+Here is a six-and-a-half-inch long rule.
+
+\hrule width 6.5in
+
+\doublecolumns
+
+Here the main document starts. It should be in double columns until
+further notice. It's all one paragraph. I am going to use Wuthering
+Heights, as usual. With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, re forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, re forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+\singlecolumn
+Now we should be typesetting in a single column, i.e., normally. The
+fingers relaxed; I snatched mine through the hole, hurriedly piled the
+books up in a pyramid against it, and stopped my ears to exclude the
+lamentable prayer. I seemed to keep them closed above a quarter of an
+hour; yet the instant I listened again, there was the doleful cry
+moaning on! ``Begone!'' I shouted; ``I'll never let you in---not if you
+beg for twenty years.'' ``It is twenty years,'' mourned the
+voice---``twenty years. I've been a waif for twenty years!'' Thereat
+began a feeble scratching outside, and the pile of books moved as if
+thrust forward. I tried to jump up, but could not stir a limb, and so
+yelled aloud in a frenzy of fright. To my confusion, I discovered the
+yell was not ideal. Hasty footsteps approached my chamber door; somebody
+pushed it open with a vigorous hand, and a light glimmered through the
+squares at the top of the bed. I sat shuddering yet, and wiping the
+perspiration from my forehead. The intruder appeared to hesitate, and
+muttered to himself. At last he said in a half-whisper, plainly not
+expecting an answer, ``Is any one here?'' I considered it best to
+confess my presence, for I knew Heathcliff's accents, and feared he
+might search further if I kept quiet. With this intention I turned and
+opened the panels. I shall not soon forget the effect my action
+produced. Heathcliff stood near the entrance, in his shirt and
+trousers, with a candle dripping over his fingers, and his face as white
+as the wall behind him. The first creak of the oak startled him like an
+electric shock. The light leaped from his hold to a distance of some
+feet, and his agitation was so extreme that he could hardly pick it up.
+``It is only your guest, sir,'' I called out, desirous to spare him the
+humiliation of exposing his cowardice further. ``I had the misfortune
+to scream in my sleep, owing to a frightful nightmare. I'm sorry I
+disturbed you.''
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/column2.tex b/Master/texmf-dist/source/eplain/base/test/column2.tex
new file mode 100644
index 00000000000..90a736e4333
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/column2.tex
@@ -0,0 +1,51 @@
+% This file is public domain.
+%
+\input eplain
+
+\headline = {headline\hfil}
+\topinsert
+topinsert
+\endinsert
+
+\parskip = 0pt
+
+\centerline{Xiaogen Yang and Max L. Deinzer}
+\smallskip
+\centerline{Department of Agricultural Chemistry}
+\centerline{Oregon State University, Corvallis, Oregon 97331}
+
+\doublecolumns
+Humulene monoepoxides exist in hop essential oil and were suggested
+as one of the important contributors of hop flavor to fermented
+malt beverages [1-3]. However, it is more possible that the ``noble
+hop'' aroma compounds are produced from certain hop components
+during the brewing process, because the ``noble hop'' aroma is
+distinct from ``dry hop'' aroma. The aging of hops, during which the
+amount of oxidation products of humulene increases [4], is also
+necessary to develop the ``noble hop'' aroma. One approach to find
+out the flavor compounds and their origin is to examine the brewing
+products of the oxygenated sesquiterpenes. The reactions of the
+brewing process can be simplified to hydrolyzation and fermentation
+as the first step. We have been investigated the hydrolysis of
+humulene monoepoxides.
+\singlecolumn
+To simulate the hydrolyzation effect in the ``late hop'' brewing
+process, humulene monoepoxides were boiled in water at
+pH\thinspace 4 for 10 minutes. After boiling, a large amount of
+the epoxides remain unreacted. When the solution was kept at
+ambient temperature for several weeks, humulene epoxides were
+then almost completely hydrolyzed. To accelerate the hydrolysis
+process, humulene epoxides were suspended in a aqueous solution
+buffered at pH\thinspace 4 and boiled for three hours under
+reflux. All three humulene monoepoxides produced a complex
+mixture after the reaction (Figure 1). The hydrolysis products
+can be easily separated into two groups by extraction with
+pentane and dichloro\-me\-thane subsequently. The pentane
+extracts are less polar, more volatile and smell stron\-ger than
+the dichloro\-methane extracts. Sensory evaluation of the
+hydrolysis products of humulene epoxide II and III by sniffing
+gas chromatography effluent indicates that some of the compounds
+have the flavor notes which are close to the ``noble hop'' aroma
+character described as ``spicy, citrus, floral'' (Table 1).
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/column3.tex b/Master/texmf-dist/source/eplain/base/test/column3.tex
new file mode 100644
index 00000000000..01788bd3064
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/column3.tex
@@ -0,0 +1,23 @@
+% This file is public domain.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+Here is a single-column line of text.
+%\vskip 6in
+%And another one.
+
+\doublecolumns
+\newcount \xxx
+\xxx=0
+\par
+\baselineskip = 2.5\baselineskip
+\loop
+ \hbox{Line \the\xxx.}
+ \ifnum \xxx < 3
+ \advance \xxx by 1
+\repeat
+
+\singlecolumn
+Another single-column line of text.
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/commdiags.tex b/Master/texmf-dist/source/eplain/base/test/commdiags.tex
new file mode 100644
index 00000000000..ae5ca6221d4
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/commdiags.tex
@@ -0,0 +1,111 @@
+% This file is public domain.
+%
+% Examples of commutative diagrams from Brockett, {\it Finite
+% Dimensional Linear Systems}.
+
+\input arrow
+
+\def\Real{\mathord{R}}
+\def\Rn{\Real^n}
+\def\A{{\bf A}}
+\def\B{{\bf B}}
+\def\C{{\bf C}}
+\def\F{{\bf F}}
+\def\G{{\bf G}}
+\def\H{{\bf H}}
+\def\I{{\bf I}}
+\def\K{{\bf K}}
+\def\L{{\bf L}}
+\def\M{{\bf M}}
+\def\N{{\bf N}}
+\def\P{{\bf P}}
+\def\Q{{\bf Q}}
+\def\R{{\bf R}}
+\def\S{{\bf S}}
+\def\W{{\bf W}}
+\def\bp{{\bf\Phi}}
+
+
+Page 29, Fig.~3
+$$\commdiag{\Rn&\mapright^{\bp(t_1,t_0)}&\Rn\cr
+&\arrow(3,-2)\lft{\bp(t,t_0)}&\mapdown\rt{\bp(t,t_1)}\cr &&\Rn\cr}$$
+
+Page 48, Fig.~1:
+$$\commdiag{\Rn&\mapright^{\bp(t,t_0)}&\Rn\cr
+\mapdown\lft{\P(t_0)}&&\mapup\rt{\P^{-1}(t)}\cr
+\Rn&\mapright^{e^{\R(t-t_0)}}&\Rn\cr}$$
+
+Page 69, Fig.~1:
+$$\commdiag{\Rn&\mapright^{\M_1}&\Real^m\cr
+\mapdown\lft\Q&&\mapup\rt\P\cr
+\Rn&\mapright^{\M_2}&\Real^m\cr}$$
+
+Page 69, Fig.~2:
+$$\commdiag{\Rn&\mapright^\A&\Rn\cr
+\mapdown\lft\P&&\mapup\rt{\P'}\cr
+\Rn&\mapright^\S&\Rn\cr}$$
+
+Page 71, Fig.~3:
+$$\commdiag{\Rn&\mapright^\A&\Rn\cr
+\mapdown\lft\P&&\mapup\rt{\P^{-1}}\cr
+\Rn&\mapright^\B&\Rn\cr}$$
+
+Page 92, Fig.~1:
+$$\harrowlength=40pt \varrowlength=24.7pt \sarrowlength=\harrowlength
+\commdiag{C^m&\mapright^{\B(\sigma)}&\Rn&\mapright^{\bp_\A(t_0,\sigma)}&
+\Rn&\mapright^{\int_{t_0}^t-d\sigma}&\Rn&\mapright^{\bp_\A(t,t_0)}&
+\Rn&\mapright^{\C(t)}&C^q\cr
+&\arrow(3,-2)\lft{\P(\sigma)\B(\sigma)}&\mapdown\rt{\P(\sigma)}&&
+\mapdown\rt{\P^{-1}(t_0)}&&\mapdown\rt{\P(t_0)}&&\mapdown\lft{\P^{-1}(t)}&
+\arrow(3,2)\rt{\C(t)\P^{-1}(t)}\cr
+&&\Rn&\mapright_{\bp_{\A_1}(t_0,\sigma)}&\Rn&\mapright_{\int_{t_0}^t-d\sigma}&
+\Rn&\mapright_{\bp_{\A_1}(t,t_0)}&\Rn}$$
+
+Page 96, Fig.~2:
+$$\harrowlength=32pt \varrowlength=\harrowlength \sarrowlength=\harrowlength
+\def\olap#1{\harrowlength=118pt\hbox to0pt{\hss$#1$\hss}}
+\commdiag{C^m&&&&&&&&&&C^q\cr \mapup\lft{\G(\sigma)}
+&\hmorphposn=2pt\arrow(1,-1)\rt{\int_{t_0}^{t_1}-\G(\sigma)\,d\sigma}
+&&&&&&&&\arrow(1,1)\lft{\H(\ )}&\mapdown\rt
+{\int_{t_0}^{t_1}-\H(\sigma)\,d\sigma}\cr
+\Rn&\mapleft_{\W(t_0,t_1)}&\Rn&&&\olap{\mapright^{\I}}&&&
+\Rn&\mapleft_{\M(t_0,t_1)}&\Rn\cr
+\mapdown\lft{\P'}&&\mapup\lft\P&\arrow(-1,1)\rt\P&&&&\arrow(-1,-1)\lft\Q&
+\mapdown\rt\Q&&\mapup\rt{\Q'}\cr
+\Rn&\mapright^{\S_1}&\Rn&\mapright^{\S_1}&\Rn&\harrowlength=20pt
+\mapright^{\Q\P}&\Rn&\mapright^{\S_2}&\Rn&\mapright^{\S_2}&\Rn\cr
+&&\mapdown\lft{\N_1}&&&&&&\mapup\rt{\N_2}\cr
+&&\Rn&&&\olap{\mapright^{\I}}&&&\Rn\cr}$$
+
+Page 114, Fig.~1:
+$$\sarrowlength=.42\harrowlength
+\commdiag{&\Real^m\cr &\arrow(-1,-1)\lft\B\quad \arrow(1,-1)\rt\G\cr
+\Rn&\mapright^\P&\Rn\cr \mapdown\lft{e^{\A t}}&&\mapdown\rt{e^{\F t}}\cr
+\Rn&\mapright^\P&\Rn\cr &\arrow(1,-1)\lft\C\quad \arrow(-1,-1)\rt\H\cr
+&\Real^q\cr}$$
+
+Page 127, Fig.~2:
+$$\commdiag{Y&\mapright^{L^*}&X\cr &\adjarrow(3,-2)\lft{LL^*}\rt{(LL^*)^{-1}}&
+\mapdown\rt{L}\cr &&Y\cr}$$
+
+Page 135, Fig.~2:
+$$\harrowlength=80pt \varrowlength=40pt \sarrowlength=50pt
+\def\olap#1{\harrowlength=214pt\hbox to0pt{\hss$#1$\hss}}
+\def\vlap#1{\varrowlength=93pt\setbox0=\hbox{$#1$}\ht0=0pt\dp0=0pt\box0}
+\commdiag{\Rn&&&\olap{\mapright^{\dot\K+\A'\K+\K\A+\L}}&&&\Rn\cr
+&\arrow(3,-1)\rt\K&&&&\arrow(-3,-1)\lft\K\cr \noalign{\vskip-3pt}
+&&\Rn&\mapright^{\B\B'}&\Rn\cr
+\vlap{\mapdown\lft\P}&&\mapup\lft{\P'}&&\mapdown\rt\P&&\vlap{\mapup\rt{\P'}}\cr
+&&\Rn&\mapleft^{\P\B\B'\P'}&\Rn\cr \noalign{\vskip-3pt}
+&\arrow(3,1)\lft{\K_1}&&&&\arrow(-3,1)\rt{\K_1}\cr
+\Rn&&&\olap{\mapright_{\dot\K_1+(\P\A\P^{-1}+\dot\P\P^{-1})\K_1
++\K_1(\P\A\P^{-1}+\dot\P\P^{-1})+\P'^{-1}\L\P^{-1}}}&&&\Rn\cr
+\noalign{\medskip}}$$
+
+Page 139, Fig.~2:
+$$\harrowlength=80pt \varrowlength=.618\harrowlength
+\sarrowlength=\harrowlength
+\commdiag{\Rn&\mapright^{\B'(\sigma)\bp'(t_0,\sigma)}&C^m\cr
+&\adjarrow(3,-2)\lft{\W(t_0,t_1)}\rt{\W^{-1}(t_0,t_1)}&
+\mapdown\rt{\int_{t_0}^{t_1}\bp(t_0,\sigma)\B(\sigma)\,d\sigma}\cr
+&&\Rn\cr}$$
diff --git a/Master/texmf-dist/source/eplain/base/test/contents.tex b/Master/texmf-dist/source/eplain/base/test/contents.tex
new file mode 100644
index 00000000000..6c3159da810
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/contents.tex
@@ -0,0 +1,30 @@
+% This file is public domain.
+%
+\input eplain
+
+\newcount\subsectionno
+
+\def\tocsubsectionentry#1#2#3{\leftline{Subsection #2.~#1\dotfill#3}}
+\let\tocentry = \tocsubsectionentry
+
+\readtocfile
+
+\subsectionno = 13
+
+\writetocentry{chapter}{beginning}
+\writetocentry{section}{subbeginning $\sin$}
+
+\advance\subsectionno by 1
+\writenumberedtocentry{subsection}{Subsection $\cos$ \#14}
+ {\the\subsectionno}
+
+\advance\subsectionno by 1
+\writenumberedtocentry{subsection}{Subsection \#15}{\the\subsectionno}
+
+% This doesn't expand \the\subsectionno -- only the first token gets
+% expanded. Its output line starts with \tocentry.
+\writenumberedtocentry{}{A toc entry}{1{\the\subsectionno}}
+
+%\loggingall
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/displine.tex b/Master/texmf-dist/source/eplain/base/test/displine.tex
new file mode 100644
index 00000000000..97730ede242
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/displine.tex
@@ -0,0 +1,36 @@
+% This file is public domain.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+\loggingall
+
+\leftdisplays
+\parindent=31pt
+
+A displaylines with an eqdef: text mre more more more more more more
+more more more more more more more more more more text.
+$$\displaylines{x=1 \eqdef{eqdef-displ}\cr}$$
+
+{\leftskip = 14pt
+\noindent
+And a indented normal equation:
+$$y=2\eqdef{foo}
+$$
+An indented displaylines with an eqdef:
+$$\displaylines{x=1 \eqdef{eqdef-displ}\cr}
+$$
+
+Now the same two with hangindent nonzero.
+\hangindent=17pt
+And a indented normal equation:
+$$y=2\eqdef{foo}
+$$
+An indented displaylines with an eqdef:
+$$\displaylines{x=1 \eqdef{eqdef-displ}\cr}
+$$
+\par}
+
+Well?
+
+\bye
+
diff --git a/Master/texmf-dist/source/eplain/base/test/double.tex b/Master/texmf-dist/source/eplain/base/test/double.tex
new file mode 100644
index 00000000000..aca6d6bb3e4
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/double.tex
@@ -0,0 +1,24 @@
+% This file is public domain.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+%\catcode`@ = 11
+%\input gcol
+%\catcode`@ = 12
+
+Here is a single-column line of text.
+%\vskip 6in
+%And another one.
+
+\doublecolumns
+\newcount \xxx
+\xxx=0
+\par
+\baselineskip = 2.5\baselineskip
+\loop
+ \hbox{Line \the\xxx.}
+ \ifnum \xxx < 3
+ \advance \xxx by 1
+\repeat
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/double2.tex b/Master/texmf-dist/source/eplain/base/test/double2.tex
new file mode 100644
index 00000000000..d1b794cad18
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/double2.tex
@@ -0,0 +1,163 @@
+% This file is public domain.
+%
+\input eplain
+
+\tolerance=2000
+
+\def\SP{\ }
+\def\throwaway#1{}
+\def\checkspace{\ifx \next\
+\let\result=\throwaway
+ \else \let\result=\ignorespaces \fi \result }
+\font\bigfont=cmr10 scaled \magstep5
+\def\bfl#1{\setbox0=\hbox {{\bigfont #1}\thinspace}
+ \noindent \hangindent \wd0 \hangafter -2
+ \llap {\vbox to \ht0{\kern\baselineskip \box0 \kern-\baselineskip}}%
+ \futurelet \next \checkspace}
+
+\parskip=10pt
+\hbadness = 1500
+\parindent=0pt
+
+\font\cmbig=cmr17
+\font\cmrbv=cmb10 scaled \magstep5
+\font\iti=cmbxti10 scaled \magstep2
+\font\erm=cmr8
+
+\doublecolumns
+
+%**************************************************************************
+% Generate a dummy first page for the twocol macro
+% The first page is to have the left column blank.
+
+\phantom{dummy first line} \vskip5truein
+ {\font\iti=cmti10 scaled \magstep1
+ \iti
+ \rightline{An abstract}
+ \rightline{goes}
+ \rightline{in here.}
+ }
+
+%karl \vfill
+%karl \eject
+
+%**************************************************************************
+
+\phantom{dummy first line} \vskip0.75truein
+
+\rightline{\cmrbv Title}
+\bigskip\bigskip
+\rightline{\iti Author}
+
+\bigskip\bigskip\bigskip
+%\rightline{\hrulefill}% width6.5truein}
+
+\nointerlineskip
+\moveleft 3.31truein
+\vbox{\hrule width6.5truein}
+\nointerlineskip
+
+\vskip0.75truein
+
+%**************************************************************************
+
+\bfl
+Xxxxxxx xxxxxx xxxxxx xxxxxxx xxxx xxx xxx\numberedfootnote{\erm Xxxxx xxxxx
+xxx xxxx Xxxxx xxxxx, Xxxxx xxxx Xxxxxx xxxxxx, xxxxxx xxxxx xx Xxxxxx Xxxxxx,
+Xxx., X.~X. Xxx~xxx, Xxxx Xxxxx, XX~xxxxx.} Xxxx Xxxxxxxxxx xxxxxxxx xxxx, Xxx
+xxxxx xxxxxx xx xxxxxxxx xx xxxxx xxxxxxx xxxxxxx xxxx xx xxxx xx xxxxxxx xx
+xxx xxxxx xx x xxx xxxxxxx xx xxxxx. Xx x/xxx xx x xxx xxxx xxxxxxx xxxxx
+xxxxxxx, Xxxxxx xxxxxxxxx xxxxx xxxxx x/xxx,xxx,xxx xx x xxxxxx. Xxxx xxxxx
+ xxxx xx xxxx xxxx Xxxxxx'x xxxxxxxx xx xxx xxxxxxx xxxxxxxx xxxxxx xx xxxxx
+ xx xxxx xxxxxxx xxx xxxxxx xxxx xx xxxxxxx xx xxxxxx x.xx xx x xxx, xxx x.xx
+xxx xxxxxx xxxxx xx~xxxxxxx. Xxxx xx x xxxxx xxxxxx xxx xxxxxxxxx xxxxxxxx xxx
+xxxxxxxx xxxx xxxxxxxx xxxxxxxxx xxx xxxxxx xxxxxx xxxx, xxx xxx xxxxxxxx
+xxxxxxxxx xx xxx xxxx xx xxxxxxxxxx xx x xxxx xxxxx xxxxxxxxxx.
+
+Xxxxx xxx xxxxxx xxx xxxxxx xx xxx xxxxx xx xxx xxx xxxxxxxxx (xxx XX-xxx
+xxxxx xxxxxx xxxxxxxx xx xxx Xxx Xxxxxxxxxx Xxxxxxxxxx), xx xxx xxxxxxx xxxx
+xx xxxxx xx xxxxxxxxxxx xx xxxxxxx x xxxxx xxxxxxx xxx xxxx xx xxxxx xxxx
+xxxxxx xx xxxx x xxxxxxxxxxx xxxxxx xxxx xxx xxxxxxx.
+
+Xxxxx x xxxxx xx xxx xxxx xx xxxxxxxxxx xxx xxxxxxxx xx xxx xxxxxxxxxx xxx
+xxxxxx xxxxxxxx xxx xxxx xxxxxx xxx xxxxx xxxx. Xxxx xxx xxxx xxxx xxxx xx
+xxxxx xxx xxxxxx'x xxxx xxxx xxxxxxxx, xxxx {xxx xxxxxxx} xx xxx xxxxxxx
+xxxxxxxxx, xxxxxxxx, xx x, xxx xxxxxxxx. Xxxxx xxxx xxxxxxxxx xxx xxxx (xxxx
+xxx Xxxx) xxx xxxxx xx Xxxxx~x.
+
+Xx xxxxxxxxxxx xx Xxxxx~x xxxxxxx xxxx xxx xxxxxxxx xx xxxxxxx xx xxxx xxxxxxx
+xxxxxxxx xxx xxx xx xxxxxxxxxx xx xxxxx xx xxxxxxxx. Xx xxxx, xx xxxxxxx xx
+xxxxxx xxx xxxxx xx xx xxxxx xxx xxx xxxxxxxxx xxx xxxxxxxx xxxxx xx Xxxxxx'x
+xxxxx xx Xxxxxx' xxxxxx xxxxxxx. Xxxx xxx xxxxxxxx xxxxx xxx xx xx xxxx, xxx
+xxxxxxxxx. Xxxxx~x xxxxxxxx xxx xxxxxxxxx xx xxxxxxx xx xxx xxxxxx xxxxxx xx
+xxxx xxxxxx xxxxxxxx xx xxxxxxxxx xx xxxxxxxxx.
+
+
+\singlecolumn
+\centerline{Table 1---Xxxxxxxxx Xxxx Xxxxxxxx xx Xxxxxxxx}
+\smallbreak
+\line \bgroup \hss
+ \vbox to 11\baselineskip{}
+\hss \egroup
+\doublecolumns
+
+
+Xxxx xxxxxx x xxxxxx xxxxxxx Xxxxxx'x xxxxxx xxxxxx xx xxx xxxxxx xxxxx xxxxxx
+xxx xxxx xxxxx xx Xxxxx~x, xxxx xxxx xxxxxx xx xxxxx xxxxxxx. Xx, xxx xxxxxxx,
+xx xxxxxxxxxx xxx xxxxxxxx xxxx xxxxxx xxxxxx, xx xxxxx xxxxx xx xxxxxxxxxxx,
+xxxxxxxxxx, xxx xxxxxxxxx, xxxxxxx xx xxx xxxxxxxx xx xxxx xxxxxx xxxx xxxxx
+xxxxxxx, xx xxxxx xxxxx xx xxx xxxxxxxx, xxxxx xxxxx, xxx xxxxxxxxx. Xxxx xxx
+xxxx xx xxxxxxxxx.
+
+\medskip\bigskip
+\centerline{Table 2---Xxxxxxx xx Xxxxxx'x Xxxxxx Xxxxxxx}
+\nobreak
+\centerline{(Xxxxxxx Xxxxxxxx)}
+\smallbreak
+\line \bgroup \hss
+ \vbox to 9\baselineskip{}
+\hss \egroup
+
+Xxxxxxxx xxx xxxx xxxx xxxxx xxxxx xx Xxxxx~x xxx xxx xxxx, xxxx xxx xxx xxxx
+xx xxx xxxxxxxx xxxxxxxx xxxxxxxxx xxxxx. Xx xxx x xxxxx xxxxxxx xx xxx xxxx
+xx xxxxxxx, xx xxx xxxxxxx xx xx x xxxxxx xxxxxx xx xxxxx xxxxxxx xx xxxxxx xx
+xxxx xxxxx xxxxxx x ``xxxxx xxxx'' xxxxxxxx. Xxxxx x xxxxx xx xxxx xxxxx xx
+xxx xxxx xx xxxxxxx xxx xxxxxxxx. Xxxx xxx xxxx xxxxxxxx xx xxxxx xxx xxxxxx'x
+xxxxxxxx xxxxxx xx xxxxx xxxxx, xxxxxxx xxx, xxx xxxxxx xxxx xxxx xxx xxxxx
+xxxxx xxxxxxxx xxx xxxxxxxx. Xxx xxxxxxx, xx xxx xxxxx xxxxx xxxxxx xxxx xxxx
+xxxxxx, xx xxx xxxx xxxxxx xxxxxxxx xxx xxx xxxxx. Xxx xxxxxxx xxx xxxxx xx
+Table~3.
+
+
+\font\eri=cmti8
+
+Xx xxxxxx xx xxxxxxxxxx xxxx xxxxx xxxxxx xxxx xxxxxxxx xxxx xxx xxx xxxxxxx
+xxxxx xx xxx xxxx xxxxx xxx xx xxx xx xxx xxx xxxxxxxxx xx xxxxxxx xxxx xx xxx
+xxx xxxxx xxxxx xxxxxx. Xxxxx~x xxxxxxx xxxx xxx xxxxx xxxxxxx, xx xx
+xxxxxxxxx xxxxxxxxx xx xxxxxxxx xx xxxx xxxx xxxxxxx xxxx xxx xxxx xxx xxxx
+xxxxxxxx xxxxxxxxxxx xxx xxx xxxxxx xx xx xxxxxxx. Xxxxxxxxx xxxxxxx xxxxx xxx
+xx xxxxxxxx xxxxxx xxxx xxx xxxx xxxxxxx xx x xxxxx xxxxxxxxx, xxx xxx
+xxxxxxxx xx xxx xxxxxxxxx? Xxx xxxx xxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xx
+XX-xxx, xxx xxxxxxxxx xx xxx {xxx Xxxxxx xxxxxx Xxxx
+xxx},\numberedfootnote{\erm Xxxx Xx xx xxx xxxx Xxxxxx Xxxxxxx xxxx xxxxx
+xxxx.} ``X xxxxxxx xxxxx xxxxxxxxx xxx Xxxxxx xxx xxx xxxx'x xxxxx xx xxxxxxxx
+xxxx xx xxxxxxxxx xxxxxx xxxxxx xxxx xxxxxx xxxx.'' Xxxx xxxxxx xxxxx xx x
+xxxxxxxx xxxx xxxxxxxx xxxxx xxxxxx xxx xxxxxxxx xxx xxx xxxxxxx xxx xx xxxx
+xxxxxxx xxx xxxxxx xxxxxx xxxxxxxx xxx xxxx xxxxxxxxxxx xxxx xxx xxx xxxxxxx
+xxx xxxxxx xxxxxx xx Xxxxxx xxxxx xx xxxx, xxx xxxxx xxx xxx xxxxxxxx xx x
+Xxxxxx xxxxxxx xxxx xxx xxxx? Xxx xxxxxx xxxxx xx xx xxxxxxxxx xxx xxxxxxx
+xxxx xxx xxxx xxxx xx Xxxxx~x xxx xxxxxx xxxx xxx xxxxxxx xxxx xxxxx xx
+xxxxxxx xx xxxxxx xxx xx xxxxx.
+
+\singlecolumn
+
+\medskip\bigbreak
+\midinsert
+\centerline{Table 3---Xxxxxxxxx Xxxx Xxxxxxxx xx Xxxxxxxx}
+\smallbreak
+\line \bgroup \hss
+ \vbox to11\baselineskip{}
+\hss \egroup
+\endinsert
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/dvipdfm.tex b/Master/texmf-dist/source/eplain/base/test/dvipdfm.tex
new file mode 100644
index 00000000000..0760afbe50b
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/dvipdfm.tex
@@ -0,0 +1,111 @@
+\input ../eplain
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[dvipdfm]
+\enablehyperlinks
+
+\beginpackages
+\usepackage[dvipsnames]{color}
+\endpackages
+
+% Execute #1 then print it verbatim and indented.
+\def\c{\cf\indent\relax}
+% Same as \c, but do not indent and at the end say \hlend.
+\def\f{\cf\noindent\hlend}
+%
+\def\cf#1#2#3{%
+ \def\temp{#3}%
+ \edef\cftemp{\sanitize\temp}%
+ #1#3\expandafter\verbatim\cftemp\endverbatim#2\par
+}
+%
+\newcount\destcount
+% Execute `#1{d\the\destcount}' then print it (`#1', `{d', and `}' are printed
+% verbatim; `\the\destcount' is expanded).
+\def\d{\dl\relax}
+% Same as \d, but at the end also say \hlend.
+\def\l{\dl\hlend}
+%
+\def\dl#1#2{%
+ \global\advance\destcount by1
+ \toks0={#2}%
+ \edef\temp{\the\toks0{d\the\destcount}}%
+ \edef\dltemp{\sanitize\temp}%
+ \noindent#2{d\the\destcount}\expandafter\verbatim\dltemp\endverbatim#1\par
+}
+
+
+
+\leftline{\bf Destinations}
+\medskip
+
+{\tt\global\parindent=4em}
+
+\d{\hldest{}{}}
+\c{\hldestopts{zoom=2345}}
+\d{\hldest{}{}}
+\medskip
+\c{\hldesttype{fitr}}
+\c{\hldestopts{left=36,bottom=420,right=360,top=720}}
+\d{\hldest{}{}}
+\c{\def\mydesttype{xyz}}
+\c{\def\myopts{left=72,top=648}}
+\d{\hldest{\mydesttype}{\myopts}}
+\medskip
+\c{\let\myopts\empty}
+\c{\hldestopts{raise=2\normalbaselineskip}}
+\d{\hldest{xyz}{\myopts,zoom=2500}}
+\c{\hldestopts{left=,bottom=,right=,top=}}
+\d{\hldest{xyz}{raise=\ht\strutbox,zoom=3000}}
+\medskip
+\makeatletter
+\c{\def\mydest{\special{pdf: dest (\@hllabel) [@thispage /FitBH @ypos]}}}
+\d{\hldest{raw}{cmd=mydest}}
+\resetatcatcode
+\medskip
+\d{\hldest{fit}{}}
+\d{\hldest{fith}{}}
+\d{\hldest{fitv}{}}
+\d{\hldest{fitb}{}}
+\d{\hldest{fitbh}{}}
+\d{\hldest{fitbv}{}}
+\vfil\eject
+
+
+
+\leftline{\bf Links}
+\medskip
+
+{\tt\global\parindent=4.5em}
+
+\destcount=0 % Reset destination count.
+\l{\hlstart{name}{}}
+\c{\hlopts{bstyle=U}}
+\l{\hlstart{name}{}}
+\l{\hlstart{}{bstyle=D,bdash=2 4,bcolor=1 0 0,hlight=I}}
+\l{\hlstart{}{bstyle=B,bwidth=3}}
+\c{\hlopts{bcolor=0 0 1}}
+\l{\hlstart{}{bstyle=I,bwidth=4}}
+\l{\hlstart{}{bstyle=U,bwidth=1}}
+\c{\hlopts{bstyle=S}}
+\l{\hlstart{}{hlight=I,bcolor=1 .2 .2,bwidth=2}}
+\l{\hlstart{}{hlight=N,bstyle=D,bwidth=3}}
+\l{\hlstart{}{hlight=O}}
+\l{\hlstart{}{hlight=P,bcolor=.3 .6 .7}}
+\l{\hlstart{}{bstyle=D,bdash=2 4 6}}
+\l{\hlstart{}{bwidth=0}}
+\l{\hlstart{}{bstyle=D,bdash=2 4 6 8}}
+\f{\hlstart{page}{pagefit=/FitH 600}{1}}
+\f{\hlstart{filename}{file=hlink.pdf,newwin=1}{eq1}}
+\f{\hlstart{filepage}{file=hlink.pdf,pagefit=/FitR 50 100 300 500}{1}}
+\f{\hlstart{filepage}{file=hlink.pdf,pagefit=/FitB}{2}}
+\f{\hlstart{url}{}{http://tug.org/eplain/}}
+\c{\def\c{\special{pdf:beginann<</Type/Annot/Subtype/Link/Dest[0/FitH @ypos]>>}}}
+\f{\hlstart{raw}{cmd=c}{}}
+
+
+
+\bye
+
+% Local variables:
+% compile-command: "(cd .. && make eplain.tex) && tex --interact=nonstopmode dvipdfm.tex && dvipdfm -p letter dvipdfm.dvi"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/ecommdiag.tex b/Master/texmf-dist/source/eplain/base/test/ecommdiag.tex
new file mode 100644
index 00000000000..562ad84ce00
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/ecommdiag.tex
@@ -0,0 +1,15 @@
+% This file is public domain.
+%
+\input ../eplain
+
+\fmtversion
+
+$$\commdiag{Y&\mapright^f&E\cr \mapdown&\arrow(3,2)\lft{f_t}&\mapdown\cr
+Y\times I&\mapright^{\bar f_t}&X}$$
+
+\end
+
+From DYMACEK@fs.sciences.WLU.EDU Fri Apr 15 09:21:12 1994
+To: kb@cs.umb.edu
+From: "Wayne M. Dymacek" <DYMACEK@fs.sciences.WLU.EDU>
+Date: Fri, 15 Apr 1994 9:19:15 EDT
diff --git a/Master/texmf-dist/source/eplain/base/test/emergncy.tex b/Master/texmf-dist/source/eplain/base/test/emergncy.tex
new file mode 100644
index 00000000000..de1eeaefe6f
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/emergncy.tex
@@ -0,0 +1,19 @@
+% This file is public domain.
+%
+%\ifx\undefined\eplain \input eplain \fi
+
+\hsize = 32pc
+\emergencystretch = 8pc
+%\tolerance = 10000
+
+\def\code#1{{\tt #1}}
+\def\\{{\tt \char92}}
+
+You can make a new numbered theorem-like environment with
+\code{\\definenumberedtheorem}. This macro takes one argument, the name
+of the environment. The first letter of the name will be capitalized
+when it is typeset. Analogously, you can use
+\code{\\defineunnumberedtheorem} to make a new unnumbered theorem-like
+environment. These commands can only be used before \code{\\body}.
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/env.tex b/Master/texmf-dist/source/eplain/base/test/env.tex
new file mode 100644
index 00000000000..3b4cf56be66
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/env.tex
@@ -0,0 +1,42 @@
+% This file is public domain.
+%
+\input eplain
+
+First, let's make sure they work.
+
+\loggingall
+
+\environment{outer}
+ \environment{inner}
+ This is in the first inner.
+ \endenvironment{inner}
+
+ This is between inners.
+
+ \environment{inner}
+ This is in the second inner.
+
+ \environment{even-more-inner}
+ This is even more inner.
+ \endenvironment{even-more-inner}
+ \endenvironment{inner}
+\endenvironment{outer}
+
+This is after the outer.
+
+Now let's make some mistakes.
+
+%\environment{start-1}
+%\endenvironment{end-2}
+
+\endenvironment{where-is-the-start?}
+
+\begingroup
+\endenvironment{begingroup-started}
+
+\environment{endgroup-ended}
+\endgroup
+
+\environment{noend}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/eqdef.tex b/Master/texmf-dist/source/eplain/base/test/eqdef.tex
new file mode 100644
index 00000000000..8a72b874333
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/eqdef.tex
@@ -0,0 +1,15 @@
+% This file is public domain.
+%
+% Test empty eqdef's.
+\ifx\undefined\eplain \input eplain \fi
+
+\loggingall
+
+$$a = 1
+\eqdef{}
+$$
+
+$$b = 2
+\eqdef{}
+$$
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/eqref.tex b/Master/texmf-dist/source/eplain/base/test/eqref.tex
new file mode 100644
index 00000000000..8f0d4f8bb59
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/eqref.tex
@@ -0,0 +1,141 @@
+% This file is public domain.
+%
+% Test symbolic equation references.
+%
+\ifx\eplain\undefined \input eplain \fi
+
+\loggingall
+\leftdisplays
+
+An equation with a number in its name:
+$$ a+b=1\eqdef{line1}$$
+\line{did we mess up plain's line in equation \eqref{line1}?\hfil}
+
+\bye
+
+The first equation:
+$$x + y = 1 \eqdef{first}$$
+
+In equation \eqref{first}, we said that $x+y=1$.
+Now, in equation \eqref{second}, we say that $a+b=2$.
+
+$$a + b = 2 \eqdef{second}$$
+
+The next equation is unlabeled in the output, but we can still refer to
+it.
+$$c + d = 3 \eqdefn{*}$$
+
+And here's an equation whose text references another equation, namely,
+\eqref{first}:
+$$c=3\eqdef[\eqrefn{first}*]{first-star}$$
+And a reference to it: \eqref{first-star}.
+
+Here is the first of a group of equations: \eqdefn{group}
+$$a = 1\eqsubdef{group-1}$$
+and the invisible second, then the third of the group \eqsubdefn{group-invis}:
+$$b = 2\eqsubdef{group-2}$$
+We refer to the group as \eqref{group}, to the first as
+\eqref{group-1}, the third as \eqref{group-2}, and the invisible second
+as \eqref{group-invis}.
+
+Here's an equation labeled strangely:
+$$a=1\eqdef[\rm strange*]{foo}$$
+And let's refer to \eqref{foo}.
+
+Let's do subequations off that:
+$$b=2\eqsubdef{foo-1}$$
+And refer to it: \eqref{foo-1}.
+
+% We can't use \count255, since #1 might involve contortions which
+% trample it.
+\newcount\subrefcount
+\def\eqsubreftext#1#2{%
+ \subrefcount = #2
+ \advance\subrefcount by 96
+ #1\char\subrefcount
+}
+
+Let's try another group, with a different labelling scheme. Here is the
+first of this group2: \eqdefn{group2}
+$$a = 1\eqsubdef{group2-1}$$
+and the second of the group2 \eqsubdefn{group2-invis}:
+$$b = 2\eqsubdef{group2-2}$$
+We refer to the group2 as \eqref{group2}, to the first as
+\eqref{group2-1}, the third as \eqref{group2-2}, and the invisible second
+as \eqref{group2-invis}.
+
+Here is one done with displaylines:
+% The \hfill's and \llap make the equation numbers come out in the right
+% place if we are not doing \leftdisplays. (See the TeXbook, p.194.)
+%$$\displaylines{
+% \hfill x=1\hfill\llap{\eqdef{displayline-1}}\cr
+% \hfill y=2\hfill\llap{\eqdef{displayline-2}}\cr
+%}$$
+$$\displaylines{
+ x=1\eqdef{displayline-1}\cr
+ y=2\eqdef{displayline-2}\cr
+}$$
+
+Let's refer to each of the equations in the displaylines:
+\eqref{displayline-1}, \eqref{displayline-2}.
+
+And one with eqalignno:
+$$
+\eqalignno{
+ a+b&=c&\eqdef{eqalign-1}\cr
+ d+e&=f&\eqdef{eqalign-2}\cr
+}
+$$
+
+And one with leqalignno, and indented more:
+{\leftdisplayindent = 1in
+$$\leqalignno{
+ a+b &=c&\eqdef{leqalign-1}\cr
+ dt+eg&=f&\eqdef{leqalign-2}\cr
+}$$
+}
+
+And now let's refer to those: \eqref{eqalign-1}, \eqref{eqalign-2},
+\eqref{leqalign-1}, \eqref{leqalign-2}.
+
+
+
+\def\eqprint#1{[\rm A.#1]}
+
+From now on, all equation labels should be in brackets and preceded
+by `A.'. In \eqref{*}, we said that $c+d=3$. And in equation
+\eqref{undefined}, we say that $1+1=2$.
+
+\eqdefn{*x}
+\eqdefn{*y}
+
+We defined equation \eqref{*y}, although we didn't give an equation for
+it.
+This is a forward reference to equation \eqref{forward}.
+
+$$e + f = 4 \eqdef{forward}$$
+
+That equation above defines \eqref{forward}.
+
+
+\newcount\sectionnum \sectionnum = 1
+\def\eqconstruct#1{\the\sectionnum.#1}
+
+And now equation numbers should have a section number (which we start at
+one) preceding them.
+
+$$a+b=1 \eqdef{s-ab}$$
+
+That equation is \eqref{s-ab}. The one we'll define in the next section
+is \eqref{s-cd}.
+
+
+\advance\sectionnum by 1
+The equation in the previous section was \eqref{s-ab}. Let's define one
+in this section:
+
+$$c+d=3 \eqdef{s-cd}$$
+
+And refer to it: \eqref{s-cd}.
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/example.eps b/Master/texmf-dist/source/eplain/base/test/example.eps
new file mode 100644
index 00000000000..4074a32b458
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/example.eps
@@ -0,0 +1,389 @@
+%!PS-Adobe-2.0 EPSF-1.2
+%%Creator: MATLAB, The Mathworks, Inc.
+%%Title: example.eps
+%%CreationDate: 11/05/96 21:16:44
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%Pages: 1
+%%BoundingBox: 97 197 502 604
+%%EndComments
+
+%%BeginProlog
+
+% MathWorks dictionary
+/MathWorks 150 dict begin
+
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+
+% operator abbreviations
+/c /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s /show ldef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+
+% orientation switch
+/portraitMode 0 def
+/landscapeMode 1 def
+
+% coordinate system mappings
+/dpi2point 0 def
+
+% font control
+/FontSize 0 def
+/FMS {
+ /FontSize xstore %save size off stack
+ findfont
+ [FontSize 0 0 FontSize neg 0 0]
+ makefont
+ setfont
+ }bdef
+
+/reencode {
+exch dup where
+{pop load} {pop StandardEncoding} ifelse
+exch
+dup 3 1 roll
+findfont dup length dict begin
+ { 1 index /FID ne {def}{pop pop} ifelse } forall
+ /Encoding exch def
+ currentdict
+end
+definefont pop
+} bdef
+
+/isroman {
+findfont /CharStrings get
+/Agrave known
+} bdef
+
+/FMSR {
+3 1 roll 1 index
+dup isroman
+{reencode} {pop pop} ifelse
+exch FMS
+} bdef
+
+/csm {
+ 1 dpi2point div -1 dpi2point div scale
+ neg translate
+ landscapeMode eq {90 rotate} if
+ } bdef
+
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+
+% macros for lines and objects
+/L {
+ lineto
+ stroke
+ } bdef
+/MP {
+ 3 1 roll moveto
+ 1 sub {rlineto} repeat
+ } bdef
+/AP {
+ {rlineto} repeat
+ } bdef
+/PP {
+ closepath fill
+ } bdef
+/DP {
+ closepath stroke
+ } bdef
+/MR {
+ 4 -2 roll moveto
+ dup 0 exch rlineto
+ exch 0 rlineto
+ neg 0 exch rlineto
+ closepath
+ } bdef
+/FR {
+ MR stroke
+ } bdef
+/PR {
+ MR fill
+ } bdef
+/L1i {
+ { currentfile picstr readhexstring pop } image
+ } bdef
+
+/tMatrix matrix def
+/MakeOval {
+ newpath
+ tMatrix currentmatrix pop
+ translate scale
+ 0 0 1 0 360 arc
+ tMatrix setmatrix
+ } bdef
+/FO {
+ MakeOval
+ stroke
+ } bdef
+/PO {
+ MakeOval
+ fill
+ } bdef
+
+/PD {
+ 2 copy moveto lineto stroke
+ } bdef
+
+
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox: 97 197 502 604
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: graph1 1
+bplot
+
+/dpi2point 12 def
+portraitMode 0216 7344 csm
+
+ 956 91 4862 4883 MR c np
+76 dict begin %Colortable dictionary
+/c0 { 0 0 0 sr} bdef
+/c1 { 1 1 1 sr} bdef
+/c2 { 1 0 0 sr} bdef
+/c3 { 0 1 0 sr} bdef
+/c4 { 0 0 1 sr} bdef
+/c5 { 1 1 0 sr} bdef
+/c6 { 1 0 1 sr} bdef
+/c7 { 0 1 1 sr} bdef
+%%IncludeResource: font Helvetica
+/Helvetica /ISOLatin1Encoding 144 FMSR
+
+1 j
+c1
+ 0 0 6912 5185 PR
+6 w
+DO
+4 w
+c0
+1463 4613 mt 1463 388 L
+1463 388 mt 1463 388 L
+2308 4613 mt 2308 388 L
+2308 388 mt 2308 388 L
+3153 4613 mt 3153 388 L
+3153 388 mt 3153 388 L
+3999 4613 mt 3999 388 L
+3999 388 mt 3999 388 L
+4844 4613 mt 4844 388 L
+4844 388 mt 4844 388 L
+5689 4613 mt 5689 388 L
+5689 388 mt 5689 388 L
+1463 4613 mt 5689 4613 L
+5689 4613 mt 5689 4613 L
+1463 4191 mt 5689 4191 L
+5689 4191 mt 5689 4191 L
+1463 3768 mt 5689 3768 L
+5689 3768 mt 5689 3768 L
+1463 3346 mt 5689 3346 L
+5689 3346 mt 5689 3346 L
+1463 2923 mt 5689 2923 L
+5689 2923 mt 5689 2923 L
+1463 2501 mt 5689 2501 L
+5689 2501 mt 5689 2501 L
+1463 2078 mt 5689 2078 L
+5689 2078 mt 5689 2078 L
+1463 1655 mt 5689 1655 L
+5689 1655 mt 5689 1655 L
+1463 1233 mt 5689 1233 L
+5689 1233 mt 5689 1233 L
+1463 811 mt 5689 811 L
+5689 811 mt 5689 811 L
+1463 388 mt 5689 388 L
+5689 388 mt 5689 388 L
+1463 4613 mt 1463 388 L
+1463 388 mt 5689 388 L
+1463 4613 mt 1463 388 L
+1463 388 mt 5689 388 L
+1463 4613 mt 1463 388 L
+1463 388 mt 5689 388 L
+SO
+6 w
+1463 4613 mt 5689 4613 L
+1463 388 mt 5689 388 L
+5689 4613 mt 5689 388 L
+1463 4613 mt 1463 388 L
+5689 4613 mt 5689 4613 L
+1463 4613 mt 1463 4613 L
+1463 4613 mt 5689 4613 L
+1463 4613 mt 1463 388 L
+1463 4613 mt 1463 4613 L
+1463 4613 mt 1463 4571 L
+1463 388 mt 1463 430 L
+1423 4782 mt
+(0) s
+2308 4613 mt 2308 4571 L
+2308 388 mt 2308 430 L
+2268 4782 mt
+(2) s
+3153 4613 mt 3153 4571 L
+3153 388 mt 3153 430 L
+3113 4782 mt
+(4) s
+3999 4613 mt 3999 4571 L
+3999 388 mt 3999 430 L
+3959 4782 mt
+(6) s
+4844 4613 mt 4844 4571 L
+4844 388 mt 4844 430 L
+4804 4782 mt
+(8) s
+5689 4613 mt 5689 4571 L
+5689 388 mt 5689 430 L
+5609 4782 mt
+(10) s
+1463 4613 mt 1505 4613 L
+5689 4613 mt 5647 4613 L
+1264 4666 mt
+(-1) s
+1463 4191 mt 1505 4191 L
+5689 4191 mt 5647 4191 L
+1144 4244 mt
+(-0.8) s
+1463 3768 mt 1505 3768 L
+5689 3768 mt 5647 3768 L
+1144 3821 mt
+(-0.6) s
+1463 3346 mt 1505 3346 L
+5689 3346 mt 5647 3346 L
+1144 3399 mt
+(-0.4) s
+1463 2923 mt 1505 2923 L
+5689 2923 mt 5647 2923 L
+1144 2976 mt
+(-0.2) s
+1463 2501 mt 1505 2501 L
+5689 2501 mt 5647 2501 L
+1348 2554 mt
+(0) s
+1463 2078 mt 1505 2078 L
+5689 2078 mt 5647 2078 L
+1228 2131 mt
+(0.2) s
+1463 1655 mt 1505 1655 L
+5689 1655 mt 5647 1655 L
+1228 1708 mt
+(0.4) s
+1463 1233 mt 1505 1233 L
+5689 1233 mt 5647 1233 L
+1228 1286 mt
+(0.6) s
+1463 811 mt 1505 811 L
+5689 811 mt 5647 811 L
+1228 864 mt
+(0.8) s
+1463 388 mt 1505 388 L
+5689 388 mt 5647 388 L
+1348 441 mt
+(1) s
+1463 388 mt 5689 388 L
+1463 4613 mt 5689 4613 L
+1463 4613 mt 1463 388 L
+5689 4613 mt 5689 388 L
+1463 388 mt 1463 388 L
+5689 388 mt 5689 388 L
+gs 1463 388 4227 4226 MR c np
+42 183 43 192 42 200 42 206 42 210 43 211 42 210 42 208
+42 204 43 196 42 188 42 177 42 165 43 151 42 135 42 119
+42 100 43 82 42 61 42 42 42 20 43 -1 42 -22 42 -43
+42 -63 43 -83 42 -102 42 -120 43 -137 42 -152 42 -166 42 -178
+43 -188 42 -197 42 -204 42 -208 43 -211 42 -211 42 -209 42 -206
+43 -199 42 -192 42 -182 42 -170 43 -157 42 -142 42 -126 42 -108
+43 -89 42 -70 42 -50 43 -29 42 -8 42 13 42 34 43 55
+42 75 42 94 42 113 43 130 42 146 42 160 42 173 43 185
+42 193 42 202 42 206 43 210 42 211 42 211 42 207 43 202
+42 195 42 186 42 176 43 162 42 149 42 132 43 116 42 97
+42 79 42 58 43 37 42 17 42 -4 42 -26 43 -46 42 -67
+42 -86 42 -105 43 -123 42 -139 42 -155 42 -168 43 -180 42 -190
+42 -198 42 -205 43 -209 1505 2290 100 MP stroke
+42 -211 1463 2501 2 MP stroke
+42 -106 43 -87 42 -67 42 -48 42 -26 43 -5 42 15 42 37
+42 57 43 78 42 96 42 115 42 132 43 148 42 162 42 175
+42 185 43 195 42 202 42 207 42 210 43 211 42 211 42 206
+42 202 43 194 42 185 42 174 43 161 42 146 42 131 42 113
+43 95 42 76 42 56 42 35 43 14 42 -7 42 -28 42 -49
+43 -69 42 -89 42 -107 42 -125 43 -141 42 -157 42 -169 42 -182
+43 -191 42 -199 42 -205 43 -210 42 -211 42 -210 42 -209 43 -204
+42 -197 42 -189 42 -179 43 -166 42 -153 42 -137 42 -121 43 -103
+42 -84 42 -64 42 -44 43 -22 42 -2 42 19 42 40 43 61
+42 81 42 99 42 118 43 135 42 150 42 164 43 177 42 187
+42 197 42 203 43 207 42 211 42 211 42 210 43 206 42 200
+42 193 42 183 43 172 42 158 42 144 42 128 43 110 42 92
+42 73 42 52 43 31 1505 399 100 MP stroke
+42 11 1463 388 2 MP stroke
+
+gr
+3194 4942 mt
+(\\tex[t][t]{$t$}) s
+1090 3419 mt -90 rotate
+(\\tex[B][B]{$\\sin\(t\)$, $\\cos\(t\)$}) s
+90 rotate
+2314 273 mt
+(\\tex[B][B]{Plot of $\\sin\(t\)$ and $\\cos\(t\)$}) s
+2689 2048 mt
+(p1) s
+3956 3343 mt
+(p2) s
+5224 1495 mt
+(p2) s
+3486 2178 mt -78 rotate
+(p3) s
+78 rotate
+
+end
+
+eplot
+%%EndObject graph 1
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
diff --git a/Master/texmf-dist/source/eplain/base/test/filexist.tex b/Master/texmf-dist/source/eplain/base/test/filexist.tex
new file mode 100644
index 00000000000..e80485577a5
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/filexist.tex
@@ -0,0 +1,22 @@
+% This file is public domain.
+%
+% Test \testfileexistence.
+%
+\ifx\undefined\eplain \input eplain\fi
+
+\testfileexistence{tex}
+\iffileexists \else
+ \message{\jobname.tex does not exist, but it should.}
+\fi
+
+\testfileexistence[README]{}
+\iffileexists \else
+ \message{README does not exist, but it should.}
+\fi
+
+\testfileexistence[foo]{bar}
+\iffileexists
+ \message{foo.bar exists, but it shouldn't.}
+\fi
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/flynn.tex b/Master/texmf-dist/source/eplain/base/test/flynn.tex
new file mode 100644
index 00000000000..d5efea792cd
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/flynn.tex
@@ -0,0 +1,7 @@
+% This file is public domain.
+%
+\input eplain
+\loggingall
+\xrdef{foo}
+\xrdef{bar}
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/footnote.tex b/Master/texmf-dist/source/eplain/base/test/footnote.tex
new file mode 100644
index 00000000000..de30cc89de4
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/footnote.tex
@@ -0,0 +1,88 @@
+% This file is public domain.
+%
+\input eplain
+
+This is some text\numberedfootnote{And this is the first footnote.} and
+now some more text\numberedfootnote{The second.} and
+finally\numberedfootnote{the third} some
+more.\numberedfootnote{The fourth.} And again.
+
+\footnotenumber = 0
+
+\leftskip = 1in
+Let's do another, this one should be numbered one
+again\numberedfootnote{OK, here it is, numbered one}. This paragraph
+ends up being indented by one inch. But this time the
+footnote\numberedfootnote{This one should be like the others.} shouldn't be
+indented.
+
+\footnotemarkseparation = .16666em
+
+\numberedlist
+\li This is the first item in a list, and it has a
+footnote\numberedfootnote{See? With a separation less than the others, too}.
+
+This is the second paragraph of the first item, and it has
+one\numberedfootnote{This is in the second paragraph.} too.
+\endnumberedlist
+
+\leftskip = 0pt
+Now let's redefine the footnote command.
+\let\footnote = \numberedfootnote
+
+\everyfootnote = {\it\leftskip=1in}%
+
+And do one\footnote{This is it, should be indented by one inch and in
+italics.} footnote with that, which should also end up indented.
+
+\font\small = cmr7
+\everyfootnote = {\small \baselineskip = 7pt }
+Another paragraph\footnote{With a footnote in a smaller font, but make
+it more than one line long so we can see if the baselineskip change
+worked or not. Because it's a small font, it has to go on for ages,
+simply ages.\par}.
+
+\vfill\eject
+
+% Test the \footnoterule parameters.
+%
+\footnoterulewidth = 6in
+\footnoteruleheight = 4pt
+\belowfootnoterulespace = 6pt
+
+New page\footnote{This footnote should have a 4pt rule above it which 6 inches
+wide and has 6 points of space below it.} to test the footnote rule
+parameters.
+
+\vfill\eject
+
+\everyfootnote = {\bf}
+\interfootnoteskip = 8pt
+\footnoteruleheight = 0pt
+\belowfootnoterulespace = 0pt
+\skip\footins = 12pt
+
+Some more\footnote{In bold, indented by the usual parindent, with no
+extra space between it and the rule; in fact, no rule.} footnotes so we can
+test\footnote{In bold, with 8pt extra space above it.}
+interfootnoteskip.
+
+The big blank space following this will force a long footnote to be
+broken across pages.
+
+\vglue 41pc plus 1filll
+
+This is the last line on the page\footnote{And this is the last
+footnote; it should be like the last one. We are making this
+footnote pretty long, so that it won't all fit on one page. I hope that
+\TeX\ will break it across pages, so we see if the new footnote
+formatting parameters still work in that case. Oh, boy, I can see we
+should make this footnote really long; much longer than I can make up
+garbage sentences like this for. Well, maybe not. I can be pretty
+verbose when I have to be. I suppose anyone can. Did you notice I'm
+inconsistent about leaving one space or two after sentence-ending
+periods? Punctuation, really.}, and it should have 12pt
+(which is the footins skip) between it and the rule\footnote{I lied;
+{\it this} is the last footnote}.
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/frac.tex b/Master/texmf-dist/source/eplain/base/test/frac.tex
new file mode 100644
index 00000000000..f4f4cd565ab
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/frac.tex
@@ -0,0 +1,24 @@
+% This file is public domain.
+%
+\input eplain
+
+\obeylines %
+This is \frac 1/2 cup.
+This is \frac 2/3 cup.
+This is \frac 3/4 cup.
+This is \frac 5/6 cup.
+This is \frac 6/7 cup.
+This is \frac 7/8 cup.
+This is \frac 8/9 cup.
+This is \frac 9/{10} cup.
+This is \frac 10/{11} cup.
+
+\end
+
+
+
+
+
+
+
+
diff --git a/Master/texmf-dist/source/eplain/base/test/gcol.tex b/Master/texmf-dist/source/eplain/base/test/gcol.tex
new file mode 100644
index 00000000000..e44455ce0e7
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/gcol.tex
@@ -0,0 +1,218 @@
+% This file is public domain.
+%
+%Date: Thu, 16 May 91 14:59 PDT
+%From: David Guichard <GUICHARD%WHITMAN.BITNET@CORNELLC.cit.cornell.edu>
+%Subject: Re: eplain
+%To: karl@cs
+%
+%Karl--
+%
+%Here are my multi-column macros and a rewrite of the double columns section
+%of eplain.texinfo. I included a \quadcolumns because this seems potentially
+%useful on landscape pages.
+%
+%I ran into a couple of problems/bugs/features of the original macros that I
+%think I've fixed.
+%
+%First, if I started double columns and then returned to single column before
+%the output routine was invoked, but there was too much text in the columns to
+%fit on the current page, then all of the text was put on the next page, leaving
+%lots of blank space on the first page. I think I've fixed this by changing how
+%\vsize is defined.
+%
+%Next, unless I'm doing something screwy, it looks to me like eplain goofs up on
+%footnotes and topinserts issued in multicolumn mode. I think I've got things
+%changed around so they work.
+%
+%I also discovered that the "\vskip\interfootnoteskip" in the vfootnote macro
+%will produce a parskip even if the interfootnoteskip is 0---was this
+%intentional? If not, perhaps you'd like to add \parskip=0pt to vfootnote.
+%(I have already added it to the modified vfootnote in the columns macro).
+
+\newskip\abovecolumnskip \abovecolumnskip = \bigskipamount
+\newskip\belowcolumnskip \belowcolumnskip = \bigskipamount
+\newdimen\gutter \gutter = 2pc
+\newdimen\c@lumnhsize
+\newtoks\previousoutput
+\newcount\number@fcolumns
+\newbox\@partialpage
+\newdimen\singlec@lumnhsize
+\newdimen\singlec@lumnvsize
+\newtoks\previousoutput
+\let\@ndcolumns=\relax
+%
+% We have a few synonymous ways to refer to multiple column modes.
+%
+\def\doublecolumns{\@columns2}
+\def\triplecolumns{\@columns3}
+\def\quadcolumns{\@columns4}
+\def\begincolumns#1{\ifcase#1\relax \or \singlecolumn \or \@columns2 \or%
+ \@columns3 \or \@columns4 \else \relax \fi}
+\def\singlecolumn{\@ndcolumns\vskip\belowcolumnskip\nointerlineskip}
+\let\endcolumns=\singlecolumn
+%
+\def\@columns#1{%
+ \@ndcolumns%
+ \begingroup
+%
+% We redefine the main footnote macro so footnotes will extend across
+% the whole page, not just the width of a column. Likewise for @ins,
+% the insertion macro.
+%
+ \def\vfootnote##1{\insert\footins\bgroup\hsize=\singlec@lumnhsize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \advance\splittopskip by \interfootnoteskip
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
+ \everypar = {}%
+ \parskip0pt
+ \the\everyfootnote
+ \vskip\interfootnoteskip
+ \indent\llap{##1\kern\footnotemarkseparation}\footstrut\futurelet\next\fo@t}
+ %
+ \def\@ins{\par\begingroup\setbox\z@\vbox\bgroup\hsize=\singlec@lumnhsize}
+ \global\let\@ndcolumns=\@@endcolumns
+ \global\number@fcolumns=#1
+ \global\c@lumnhsize = \hsize % If \hsize changed, get the new value.
+ \par % Shouldn't start in horizontal mode.
+ \global\previousoutput = \expandafter{\the\output}%
+ \global\advance\c@lumnhsize by -#1\gutter
+ \global\divide\c@lumnhsize by #1
+ \global\output = {%
+ \global\setbox\@partialpage =
+ \vbox{\unvbox255\vskip\abovecolumnskip}%
+ }%
+ \pagegoal = \pagetotal
+ \eject % Now expand the \output just above.
+ \global\output = {\c@lumnoutput}%
+ \global\singlec@lumnhsize = \hsize
+ \global\singlec@lumnvsize = \vsize
+ \hsize = \c@lumnhsize
+%
+% Compute the proper vsize based on what's already on the page
+% and the number of columns. Also change the mag factor for insertions.
+%
+ \global\advance\vsize by -\ht\@partialpage
+ \global\advance\vsize by -\ht\footins
+ \ifvoid\footins\else \global\advance\vsize by -\skip\footins \fi
+ \global\advance\vsize by -\ht\topins
+ \ifvoid\topins\else \global\advance\vsize by -\skip\topins \fi
+ \global\vsize = #1\vsize
+ \multiply\count\footins by #1 \multiply\count\topins by #1
+}%
+%
+% When this is invoked box 255 should contain just the right amount of
+% material, whether triggered by an output routine or a change in the
+% number of columns. Because columns have to contain a whole number of
+% lines of type, we take a bit of care with balancing the heights of the
+% columns to prevent either losing material or having a very short last
+% column.
+%
+% Note: when a page ends due to \bye or \eject, box 255 will contain lotsa
+% white space, so the columns will not look balanced. To fix this use
+% \singlecolumn before ending the page.
+%
+\def\@columnsplit{%
+ \splittopskip = \topskip
+ \splitmaxdepth = \baselineskip
+ \dimen0 = \ht255
+ \divide\dimen0 by \number@fcolumns
+ \begingroup % the balancing act
+ \vbadness = 10000 \loop \setbox8=\copy255
+ \global\setbox1 = \vsplit8 to \dimen0 \global\wd1 = \hsize
+ \global\setbox3 = \vsplit8 to \dimen0 \global\wd3 = \hsize
+ \ifnum\number@fcolumns>2%
+ \global\setbox5 = \vsplit8 to \dimen0
+ \global\wd5 = \hsize \fi
+ \ifnum\number@fcolumns>3%
+ \global\setbox7 = \vsplit8 to \dimen0
+ \global\wd7 = \hsize \fi
+ \ifdim\ht8>0pt \advance\dimen0 by 1pt \repeat
+ \endgroup
+ \global\setbox255 = \vbox{%
+ \unvbox\@partialpage
+ \ifcase\number@fcolumns \relax\or\relax\or%
+ \hbox to \singlec@lumnhsize{\box1\hfil\box3}\or%
+ \hbox to\singlec@lumnhsize{\box1\hfil\box3\hfil\box5}\or%
+ \hbox to\singlec@lumnhsize{\box1\hfil\box3\hfil\box5\hfil\box7}\or%
+ \else\relax\fi%
+ }%
+}%
+\def\c@lumnoutput{%
+ \@columnsplit
+ \hsize = \singlec@lumnhsize % Local to the \output group.
+ \vsize = \singlec@lumnvsize
+ \the\previousoutput
+%
+% Now the correct vsize is the original vsize times the
+% number of columns.
+%
+ \global\vsize=\number@fcolumns\singlec@lumnvsize
+}%
+\def\@@endcolumns{%
+ \global\let\@ndcolumns=\relax%
+ \par % Shouldn't start in horizontal mode.
+ \global\output = {\global\setbox1 = \box255}%
+ \pagegoal = \pagetotal
+ \eject
+ \global\setbox255 = \box1
+ \@columnsplit
+ \global\vsize = \singlec@lumnvsize
+ \global\output = \expandafter{\the\previousoutput}%
+ \endgroup
+ \ifvoid\topins\else\topinsert\unvbox\topins\endinsert\fi
+ \unvbox255
+}%
+
+\endinput
+
+@node Multiple columns, Footnotes, Margins, User definitions
+@section Multiple columns
+
+@cindex double column output
+@cindex triple column output
+@cindex quadruple column output
+@cindex multiple column output
+ Eplain provides for double, triple and quadruple
+column output: you just say
+@code{\doublecolumns},
+@findex doublecolumns
+@code{\triplecolumns}
+@findex triplecolumns
+or @code{\quadcolumns}
+@findex quadcolumns
+and from that point on, the manuscript will be
+set in columns. If you want to go back to one column, say
+@code{\singlecolumn}.
+@findex singlecolumn
+
+ The columns macros insert the value of the glue parameter
+@code{\abovecolumnskip}
+@findex abovecolumnskip
+before the multi-column text, and the value of the glue parameter
+@code{\belowcolumnskip}
+@findex belowcolumnskip
+after it. The default value for both of these parameters is
+@code{\bigskipamount}, i.e., one linespace.
+
+ The columns are separated by the value of the dimen parameter
+@code{\gutter}.
+@findex gutter
+The default value for @code{\gutter} is two picas.
+
+ The macros take into account only the insertion classes
+@cindex insertion classes
+defined by plain @TeX{}, namely, footnotes and @code{\topinsert}s. If
+you have defined additional insertion classes, you will need to change
+the macros which implement multi-column mode. Furthermore, the insertions
+do not respect the column widths; if you want them to, you have to
+change the way your output routine works. (Eplain uses whatever the
+current output routine is; it is not tied to @code{\plainoutput}.)
+@findex plainoutput
+
+@xx: \columnfill
+@xx: \singlecolumn to balance columns
+@xx: footnote/topinsert width of whole page
+@xx: \vfootnote resets \parskip
diff --git a/Master/texmf-dist/source/eplain/base/test/hlcite.tex b/Master/texmf-dist/source/eplain/base/test/hlcite.tex
new file mode 100644
index 00000000000..ec27c4e8fbe
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/hlcite.tex
@@ -0,0 +1,55 @@
+\input ../eplain
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[pdftex]
+%\enablehyperlinks[dvipdfm]
+\enablehyperlinks
+
+\ifpdf
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+\fi
+
+\beginpackages
+ \usepackage{color}
+\endpackages
+
+\hldestopts[bib]{raise=\ht\strutbox}
+\hlopts![cite]{bstyle=U}
+
+
+% Bibliography in front of the text.
+
+%\beginsection{References.}\par % Title for the bibliography.
+%\bibliography{knuth,xampl} % Use knuth.bib (from Eplain) and xampl.bib
+ % (from BibTeX) for the labels.
+%\bibliographystyle{plain}
+%\vfil\eject
+
+
+Two citations to Knuthian works:
+ \cite[note]{surreal,concrete-math}.
+
+
+\vfil\eject
+Three citations:
+ \cite[note]{surreal,article-crossref,whole-journal}.
+
+One citation:
+ \cite{article-crossref}.
+
+
+% Bibliography after the text.
+
+\vfil\eject
+\beginsection{References.}\par % Title for the bibliography.
+\bibliography{knuth,xampl} % Use knuth.bib (from Eplain) and xampl.bib
+ % (from BibTeX) for the labels.
+\bibliographystyle{plain}
+
+
+\bye
+
+% Local variables:
+% compile-command: "rm -f hlcite.aux hlcite.bbl && tex --interact=nonstopmode hlcite && bibtex hlcite && tex --interact=nonstopmode hlcite && tex --interact=nonstopmode hlcite && dvipdfm -p letter hlcite"
+% compile-command: "rm -f hlcite.aux hlcite.bbl && pdftex --interact=nonstopmode hlcite && bibtex hlcite && pdftex --interact=nonstopmode hlcite && pdftex --interact=nonstopmode hlcite"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/hlfoot.tex b/Master/texmf-dist/source/eplain/base/test/hlfoot.tex
new file mode 100644
index 00000000000..01fae52386b
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/hlfoot.tex
@@ -0,0 +1,47 @@
+\input ../eplain
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[pdftex]
+%\enablehyperlinks[dvipdfm]
+\enablehyperlinks
+
+\ifpdf
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+\fi
+
+\beginpackages
+ \usepackage{color}
+\endpackages
+
+% Set \normalbaselineskip for the sake of \hldestfootraise
+\everyfootnote = {\sevenrm \normalbaselineskip=9pt \normalbaselines}
+
+\hlopts![foot]{bstyle=U}
+\hldesttype[foot]{fitbh}
+\hlopts![footback]{bstyle=D,bdash=1 4}
+\hldesttype[footback]{fith}
+
+
+This\numberedfootnote{Footnote to `This'.} is a
+sentence\footnote*{Footnote to `sentence'.} with
+footnotes\footnote{**}{Footnote to `footnotes'.}.
+
+\medskip
+Now we say
+\verbatim\let\footnote=\numberedfootnote|endverbatim
+\let\footnote=\numberedfootnote\ and look what we get:
+
+This\footnote{Another footnote to `This'.} is another
+sentence\footnote{Another footnote to `sentence'.} with
+footnotes\footnote{Another footnote to `footnotes'.}.
+
+\vfil\eject
+Second page.
+
+
+\bye
+
+% Local variables:
+% compile-command: "tex --interact=nonstopmode hlfoot.tex && dvipdfm -p letter hlfoot.dvi"
+% compile-command: "pdftex --interact=nonstopmode hlfoot.tex"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/hlidx.mst b/Master/texmf-dist/source/eplain/base/test/hlidx.mst
new file mode 100644
index 00000000000..1f0813b806b
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/hlidx.mst
@@ -0,0 +1,2 @@
+delim_n "; "
+delim_r "\\thinspace--\\allowbreak\\thinspace "
diff --git a/Master/texmf-dist/source/eplain/base/test/hlidx.tex b/Master/texmf-dist/source/eplain/base/test/hlidx.tex
new file mode 100644
index 00000000000..2d177a9c6d2
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/hlidx.tex
@@ -0,0 +1,138 @@
+\input ../eplain
+
+% If you uncomment the optional arg, index hyperlinks will point to exact
+% locations of terms, but MakeIndex will regard _all_ index entries as distinct.
+% This can be partially cured by piping hlidx.idx through `util/idxuniq' script
+% before feeding it to MakeIndex (see the first compile-command at the end of
+% this file).
+\enablehyperlinks%[idxexact]
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[pdftex]
+%\enablehyperlinks[dvipdfm]
+
+\ifpdf
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+\fi
+
+\beginpackages
+ \usepackage{color}
+\endpackages
+
+\headline={\hrulefill}
+
+% Try to redefine the delimiters.
+\setidxpagelistdelimiter{; }
+\setidxpagerangedelimiter{\thinspace--\allowbreak\thinspace}
+
+% Underline and italisize a page number / page range, taking care not to
+% underline `--' in page range like `1--3'.
+%
+% Note that this definition is not enough if you don't use hyperlinks in index
+% (i.e., if you pass `idxnone' to \enablehyperlinks). Then page lists
+% like `1, 2' are not broken up by \hlidxpage, and the entire list may
+% be passed, which will be be italicized and underlined without being
+% split up. You can see the effect by commenting out
+% \enablehyperlinks above. In that case, you will have to do a more
+% sophisticated parsing using both \idxparserange and \idxparselist
+% (like in \@hlidxgetpages).
+\def\ituline#1{%
+ {\it
+ \idxparserange{#1}%
+ \ifx\idxpagei\empty
+ \underbar{#1}%
+ \else
+ \underbar{\idxpagei}\idxpagerangedelimiter\underbar{\idxpageii}%
+ \fi}%
+}
+
+
+\count0=-1
+
+% i
+\topglue12pt
+% \indent is needed to place hyperlink destination at the beginning of the first
+% line of the paragraph instead of vertical mode above the paragraph.
+\indent
+\sidx[pagemarkup=ituline]{truth}[definition of]
+Definition of truth, page~i.
+
+Another
+\sidx[pagemarkup=ituline]{truth}[definition of]
+definition of truth on page~i.
+\vfil\eject
+
+% ii
+\topglue24pt
+\indent
+\sidx[pagemarkup=ituline]{truth}[definition of]
+Definition of truth, page~ii.
+\vfil\eject
+
+% iii
+No index entries, page~iii.
+\vfil\eject
+
+\count0=1
+
+% 1
+\topglue36pt
+\indent
+\sidx[pagemarkup=ituline]{truth}[definition of]
+Definition of truth, page~1.
+\vfil\eject
+
+% 2
+\topglue24pt
+Beginning of
+\sidx[begin,pagemarkup=ituline]{truth}[definition of]
+definition of truth, page~2.
+\vfil\eject
+
+% 3
+\indent
+\sidx[pagemarkup=ituline]{truth}[definition of]
+Definition of truth that comes whithin an explicit range, page~3.
+\vfil\eject
+
+% 4
+End of
+\sidx[end]{truth}[definition of]
+definition of truth, page~4.
+\vfil\eject
+
+% 5
+\indent\idxname{Adrien-Marie}{Legendre} (September~18, 1752~-- January~10, 1833)
+was a French mathematician.
+
+Legendre integrals
+\sidx{Legendre\idxnameseparator Adrien-Marie!functions!F(k, phi), E(k,
+phi)@$F(k,\varphi)$, $E(k,\varphi)$}
+$F(k,\varphi)$ and $E(k,\varphi)$ are called {\it complete\/} when
+$\varphi=\pi/2$, in which case they are denoted by
+\sidx[pagemarkup=ituline]{Legendre\idxnameseparator Adrien-Marie!functions!K(k),
+E(k)@${\bf K}(k)$, ${\bf E}(k)$}
+${\bf K}(k)$ and ${\bf E}(k)$.
+
+\indent
+\sidx{semantic theory of truth@\leavevmode\hldest{}{}{idx:TSTT}semantic theory of truth}
+Semantic theory of truth was developed by Polish logician Alfred Tarski in the
+1930s.
+
+
+\sidx[seealso]{truth}[definition of]{\hlstart{}{}{idx:TSTT}semantic theory of
+truth\hlend}
+
+
+{\baselineskip=36pt
+\noindent\bf Index\par}
+
+\hookaction{beginindex}{\singlecolumn}
+\readindexfile{i}
+
+\bye
+
+% Local variables:
+% compile-command: "(cd .. && make eplain.tex) && rm -f hlidx.aux hlidx.ind hlidx.idx && tex --interact=nonstopmode hlidx && cat hlidx.idx | ../util/idxuniq | makeindex -s hlidx.mst > hlidx.ind && tex --interact=nonstopmode hlidx && dvipdfm -p letter hlidx.dvi"
+% compile-command: "(cd .. && make eplain.tex) && rm -f hlidx.aux hlidx.ind hlidx.idx && pdftex --interact=nonstopmode hlidx && makeindex -s hlidx.mst hlidx && pdftex --interact=nonstopmode hlidx"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/hlink.tex b/Master/texmf-dist/source/eplain/base/test/hlink.tex
new file mode 100644
index 00000000000..939a552ad3c
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/hlink.tex
@@ -0,0 +1,144 @@
+\input ../eplain
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[pdftex]
+%\enablehyperlinks[dvipdfm]
+\enablehyperlinks
+
+\beginpackages
+\usepackage[dvipsnames]{color}
+\endpackages
+
+\ifpdf
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+\fi
+
+\def\sectionword{Section}%
+\newcount\sectioncount
+\def\beginsection#1\par{%
+ \par
+ \advance\sectioncount by1
+ {\normalbaselineskip=3pc \normalbaselines
+ \noindent\definexref{sec\the\sectioncount}{\the\sectioncount}{section}%
+ {\bf Section~\the\sectioncount} #1\par}
+}%
+
+\def\deriv#1/#2{{{d#1}\over d#2}}%
+\def\vec#1#2{#1_1,#1_2,\ldots,#1_{#2}}%
+\def\cdotfill{\cleaders\hbox to 1em{\hss$\cdot$\hss}\hfill}%
+
+% Set defaults for hyperlink options.
+\hlopts{bstyle=U}% underlined border
+\hlopts{bwidth=2}%
+% Make \xrdef destinations make pages fit in the screen.
+\hldesttype[xrdef]{fit}% fit page
+% Set hyperlink options for various kinds of hyperlinks.
+\hlopts![ref]{bstyle=D,bdash=3,hlight=I}% dash border, invert box hlight
+\hlopts[ref]{bcolor=1 0 0,bwidth=1}% add options to the current list
+\hlopts![eq]{bcolor=0 1 0,hlight=O}% invert border hlight
+\hlopts![xref]{bstyle=I,bcolor=0 0 1,hlight=P,bwidth=4}% inset border, inset hlight
+
+
+Ordered list:
+\numberedlist
+\li[li1] Item 1
+\li[li2] \xrdef{li2:pg}Item 2
+ \numberedlist
+ \li[li2.a] subitem 2.a
+ \li[li2.b] subitem 2.b
+ \endnumberedlist
+\li Item 3
+\endnumberedlist
+
+Reference to \ref{li1}. Reference to {\let\reftie.\refn[item~\refn{li2}]{li2.b}}.
+
+\vskip\abovelistskipamount
+Unordered list:
+\unorderedlist
+\li[uli1] Item 1
+\li Item 2
+ \unorderedlist
+ \li[uli2.a] subitem 2.a
+ \li subitem 2.b
+ \endunorderedlist
+\endunorderedlist
+
+Refereneces to \ref[\sevenrm\lbrack dvipdfm will not make the \blackbox\ part of
+the link\rbrack]{uli1} and~\refn{uli2.a}.
+
+
+\beginsection \xrdef{sec1:pg}
+
+Reference to \ref{sec1} and forward reference to \ref{sec2}.
+
+
+
+\beginsection
+
+References to \refs{sec1} and~\refn{sec2}.
+
+\indent\ref{sec3} will start on \xref{sec3:pg}.
+$$\|A\| = \sup_{x\ne0} { \|Ax\| \over \|x\| }. \eqdef{eq1}$$
+Reference to \eqref{eq1}.
+$$\|A\| \ge {\|Ax\| \over \|x\|}. \eqsubdef{}$$
+Reference to \eqref[subequation]{}.
+$$\|Ax\| \le \|A\| \cdot \|x\|. \eqsubdef{subeq1.2}$$
+Reference to \eqref[subequation]{subeq1.2}. One more reference to
+\eqref[subequation]{}.
+
+\vfil\eject
+
+
+
+Forward reference to \eqref[equation]{subeq2.1}.
+$$\openup\jot
+\eqalignno{\eqdefn{eq2}% fake definition for \eqsubdef's to work
+ \deriv x/t &= 3x-2y,&\eqsubdef{subeq2.1}\cr
+ \deriv y/t &= 2x-y.&\eqsubdef{subeq2.2}\cr
+}$$
+References to equations \eqref{eq2}, \eqref{subeq2.1} and~\eqref{subeq2.2}.
+
+$$\hldestopts[eq]{raise=4.5\normalbaselineskip}
+\openup\jot
+\left.\,\eqalign{
+ \deriv x_1/t &= f_1(t,\vec xn),\cr
+ \deriv x_2/t &= f_2(t,\vec xn),\cr
+ \omit\span\omit\strut\cdotfill\cr
+ \deriv x_n/t &= f_n(t,\vec xn).\cr
+}\,\right\}\eqdef{eq3}$$
+Another notation for the \eqref[system]{eq3}:
+$$\deriv x_i/t=f_i(t,\vec xn)\quad
+(i=1,2,\ldots,n).\eqdef[\hbox{$\eqrefn{eq3}^*$}]{}$$
+Reference to \eqref[system]{}.
+
+Subequations in \verbatim\displaylines|endverbatim:
+$$\openup\jot
+\displaylines{
+ \eqsubdefn{eq3*.1}
+ \hfill\deriv x_2/t=f_2(t,\vec xn),\hfill\llap{\eqsubdef{eq3*.2}}\cr
+ \hfill\deriv x_3/t=f_3(t,\vec xn).\hfill\llap{\eqsubdef{eq3*.3}}\cr
+}$$
+References to \eqref{eq3*.1}, \eqref{eq3*.2} and~\eqref{eq3*.3}.
+
+\hloff[eq,]
+One more reference to \eqref[system]{}.
+\hlon
+And one more reference to \eqref[system]{}.
+
+\beginsection \xrdef{sec3:pg}
+
+\definecolor{mycolor}{rgb}{0,0,1}
+\hlopts{colormodel=,color=mycolor}
+
+Reference to \ref[item]{li2} on {\hloff\xref{li2:pg}}.
+
+\indent\ref{sec1} started on {\def\xrefpageword{page~}\xref[title]{sec1:pg}}.
+
+
+
+\bye
+
+% Local variables:
+% compile-command: "(cd .. && make eplain.tex) && rm -f hlink.aux && tex --interact=nonstopmode hlink.tex && tex --interact=nonstopmode hlink.tex && dvipdfm -p letter hlink.dvi"
+% compile-command: "(cd .. && make eplain.tex) && rm -f hlink.aux && pdftex --interact=nonstopmode hlink.tex && pdftex --interact=nonstopmode hlink.tex"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/ian.tex b/Master/texmf-dist/source/eplain/base/test/ian.tex
new file mode 100644
index 00000000000..95c254c6546
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/ian.tex
@@ -0,0 +1,28 @@
+% This file is public domain.
+%
+\input eplain
+
+\vsize 10cm \hsize 7cm
+
+Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
+
+\doublecolumns
+
+Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
+blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
+
+\singlecolumn
+
+Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah.
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/index.tex b/Master/texmf-dist/source/eplain/base/test/index.tex
new file mode 100644
index 00000000000..0a039dec9c2
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/index.tex
@@ -0,0 +1,36 @@
+% This file is public domain.
+%
+\input eplain
+
+\indexproofingtrue
+\hsize = 5in
+
+\def\defn#1{{\sl #1\/}}
+\def\title#1{{\it #1\/}}
+
+\idx{term}
+\idxname{K. Elizabeth}{Tachikawa}
+\idxmarked\title{Strange Angels}
+\idxsubmarked{Anderson, Laurie}\defn{Strange Angels}
+\idx[begin]{range} starts.
+\sidx[begin]{home}
+
+\vfill\eject
+
+\sidx[pagemarkup=defn]{truth}
+\sidxname{Megan Anne}{Haney}
+
+\sidx[end]{home}
+\idx[end]{range} ends.
+
+\sidx[see]{beauty}[truthful]{Anderson, Laurie}
+\sidxmarked[seealso]\defn{Strange Angels}{\defn{Home of the Brave}}
+
+
+\leftline{\bf Index}
+
+\def\idxpreface{These words precede the index.}
+
+\readindexfile{i}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/jan.tex b/Master/texmf-dist/source/eplain/base/test/jan.tex
new file mode 100644
index 00000000000..b94ab34556f
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/jan.tex
@@ -0,0 +1,15 @@
+% This file is public domain.
+%
+\input eplain
+
+This gives \eqdefn{aa}
+$$1+2,\eqsubdef{op}$$
+and
+$$1+3.\eqsubdef{pp}$$
+And \eqref{aa} and \eqref{op} and \eqref{pp}.
+\bye
+
+From: deleeuw@laplace.sscnet.ucla.edu (Jan Deleeuw)
+Subject: batch mode
+To: karl@cs.umb.edu
+Date: Mon, 7 Jun 1993 20:26:22 -0700 (PDT)
diff --git a/Master/texmf-dist/source/eplain/base/test/justify.tex b/Master/texmf-dist/source/eplain/base/test/justify.tex
new file mode 100644
index 00000000000..232a6915064
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/justify.tex
@@ -0,0 +1,106 @@
+% This file is public domain.
+%
+\input eplain
+
+{\center foo
+bar
+}
+
+% Changing \parfillskip is OK, since the macros reset it.
+%\parfillskip = .75\hsize plus .06\hsize minus .75\hsize
+\loggingall
+
+Pre-text. These should be flush left:
+{\flushleft
+Here are a few
+lines that we are
+\vadjust{\bigskip}going to take {\it literally}. (with vadjusted space now)
+And a couple more
+of them.}
+
+Now we're back to normal.
+Now we're back to normal.
+Now we're back to normal.
+Pre-text. These should be flush right:
+
+{\it \flushright
+Here are a few italic
+lines that we are
+\vadjust{\bigskip}going to take literally.
+And a couple more
+of {\bf them.}
+
+In fact, let's do two paragraphs,
+this is so much fun. No, let's make it three.
+
+ For Dan
+ ---{\bf k.b.}
+}
+
+Now we're back to normal.
+Now we're back to normal.
+Now we're back to normal.
+These should be centered.
+
+{\center
+Here are a few
+lines that we are
+\vadjust{\bigskip}going to take literally.
+And a couple more
+of them.}
+
+Some centered paragraphs:
+{\center
+ Here is the first paragraph.
+
+ Here is the second.
+
+ Here is the third.
+}
+
+Now we're back to normal.
+Now we're back to normal.
+Now we're back to normal.
+These should be flush left again (two groups):
+
+{\flushleft
+ Here is the first paragraph.
+
+ Here is the second.
+}
+
+\blanklineskipamount = -.8\baselineskip
+{\flushleft
+ Here is the first paragraph.
+
+ Here is the second.
+
+ Here is the third
+}
+
+We changed the amount of space between the paragraphs in the second
+group so it was less than a full blank line. Did you notice?
+
+\scrollmode
+
+{\message{Now comes a mysterious error.} \center on first line---what happens?
+centered
+}
+
+\def\title{\begingroup\center}
+\def\endtitle{\endgroup}
+
+\title
+this should be centered
+by virtue of a macro
+\endtitle
+
+Back to normal.
+
+{\center
+centered
+\message{Now there should be an error:}%
+\flushleft % error
+}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/knuth.bib b/Master/texmf-dist/source/eplain/base/test/knuth.bib
new file mode 100644
index 00000000000..abdf6ddecfa
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/knuth.bib
@@ -0,0 +1,17 @@
+% This file is public domain.
+
+@book{surreal,
+ author = "Donald E. Knuth",
+ title = "Surreal Numbers",
+ year = 1974,
+ publisher = "Addison-Wesley",
+ address = "Reading, Massachusetts"
+}
+
+@book{concrete-math,
+ author = "Ronald L. Graham and Donald E. Knuth and Oren Patashnik",
+ title = "Concrete Mathematics",
+ year = 1989,
+ publisher = "Addison-Wesley",
+ address = "Reading, Massachusetts"
+}
diff --git a/Master/texmf-dist/source/eplain/base/test/label.tex b/Master/texmf-dist/source/eplain/base/test/label.tex
new file mode 100644
index 00000000000..348a7541711
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/label.tex
@@ -0,0 +1,8 @@
+% This file is public domain.
+%
+\ifx\undefined \eplain \input eplain \fi
+
+\xrdef{a1@$^ ~&_}
+\xref{a1@$^ ~&_}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/latexcite.tex b/Master/texmf-dist/source/eplain/base/test/latexcite.tex
new file mode 100644
index 00000000000..5ad031aa1a6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/latexcite.tex
@@ -0,0 +1,9 @@
+% This file is public domain.
+%
+\documentstyle{article}
+\begin{document}
+\cite{chicago,texbook,prime-number-theorem,1234567890)(@!`['";:]|<>./?-=+_$^&}
+\cite{others,accented}
+\bibliographystyle{plain}
+\bibliography{cite}
+\end{document}
diff --git a/Master/texmf-dist/source/eplain/base/test/liang.tex b/Master/texmf-dist/source/eplain/base/test/liang.tex
new file mode 100644
index 00000000000..975fa83d020
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/liang.tex
@@ -0,0 +1,300 @@
+% This file is public domain.
+%
+% Test double columns with headlines, single-column material, and a
+% \topinsert.
+\ifx\undefined\eplain \input eplain \fi
+%\catcode`@=11
+%\input gcol
+%\catcode`@=12
+\magnification=\magstep1
+\parskip=10pt
+\gutter = 1pc
+\hyphenation{pour-ed}
+
+\headline = {This is the headline \hfil}
+
+{\center
+ A test file for eplain
+ Karl\footnote\dag{Credit in a footnote.}
+}
+
+\topinsert
+This should appear at the top of the page, since it's a topinsert.
+\endinsert
+
+Here the main document starts. It should be in double columns until
+further notice. It's all one paragraph. I am going to use Wuthering
+Heights, as usual.
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings.
+
+Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes!
+
+
+\doublecolumns
+Here the main document starts. It should be in double columns until
+further notice. It's all one paragraph. I am going to use Wuthering
+Heights, as usual.
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces.
+
+Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult?
+
+What had played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! Here the main document starts. It should be in double columns
+ until
+further notice. It's all one paragraph. I am going to use Wuthering
+Heights, as usual. With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult?
+What had played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes!
+
+\singlecolumn % an extra insert of singlecolumn
+I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+\doublecolumns % an extra insert of doublecolumns
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, pour\-ed forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, repoured forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+With that concluding word, the whole assembly,
+exalting their pilgrim's staves, rushed round me in a body; and I,
+having no weapon to raise in self-defence, commenced grappling with
+Joseph, my nearest and most ferocious assailant, for his. In the
+confluence of the multitude several clubs crossed; blows aimed at me
+fell on other sconces. Presently the whole chapel resounded with
+rappings and counter-rappings. Every man's hand was against his
+neighbour; and Branderham, unwilling to remain idle, repoured forth his
+zeal in a shower of loud taps on the boards of the pulpit, which
+responded so smartly that at last, to my unspeakable relief, they woke
+me. And what was it that had suggested the tremendous tumult? What had
+played Jabes's part in the row? Merely the branch of a fir-tree that
+touched my lattice, as the blast wailed by, and rattled its dry cones
+against the panes! I listened doubtingly an instant, detected the
+disturber, then turned and dozed, and dreamt again---if possible, still
+more disagreeably than before. This time I remembered I was lying in
+the oak closet, and I heard distinctly the gusty wind and the driving of
+the snow. I heard also the fir-bough repeat its teasing sound, and
+ascribed it to the right cause. But it annoyed me so much that I
+resolved to silence it, if possible; and I thought I rose and
+endeavoured to unhasp the casement. The hook was soldered into the
+staple---a circumstance observed by me when awake, but forgotten. ``I
+must stop it, nevertheless!'' I muttered, knocking my knuckles through
+the glass, and stretching an arm out to seize the importunate branch;
+instead of which, my fingers closed on the fingers of a little, icecold
+hand!
+
+The intense horror of nightmare came over me. I tried to draw
+back my arm, but the hand clung to it, and a most melancholy voice
+sobbed, ``Let me in---let me in!'' ``Who are you?'' I asked, struggling,
+meanwhile, to disengage myself. ``Catherine Linton,'' it replied
+shiveringly. (Why did I think of Linton? I had read Earnshaw twenty
+times for Linton.) ``I'm come home. I'd lost my way on the moor.'' As
+it spoke, I discerned, obscurely, a child's face looking through the
+window. Terror made me cruel; and finding it useless to attempt shaking
+the creature off, I pulled its wrist on to the broken pane, and rubbed
+it to and fro till the blood ran down and soaked the bedclothes. Still
+it wailed, ``Let me in!'' and maintained its tenacious gripe, almost
+maddening me with fear. ``How can I?'' I said at length. ``Let me go,
+if you want me to let you in!''
+
+\singlecolumn
+Now we should be typesetting in a single column, i.e., normally. The
+fingers relaxed; I snatched mine through the hole, hurriedly piled the
+books up in a pyramid against it, and stopped my ears to exclude the
+lamentable prayer. I seemed to keep them closed above a quarter of an
+hour; yet the instant I listened again, there was the doleful cry
+moaning on! ``Begone!'' I shouted; ``I'll never let you in---not if you
+beg for twenty years.'' ``It is twenty years,'' mourned the
+voice---``twenty years. I've been a waif for twenty years!'' Thereat
+began a feeble scratching outside, and the pile of books moved as if
+thrust forward. I tried to jump up, but could not stir a limb, and so
+yelled aloud in a frenzy of fright. To my confusion, I discovered the
+yell was not ideal. Hasty footsteps approached my chamber door; somebody
+pushed it open with a vigorous hand, and a light glimmered through the
+squares at the top of the bed. I sat shuddering yet, and wiping the
+perspiration from my forehead. The intruder appeared to hesitate, and
+muttered to himself. At last he said in a half-whisper, plainly not
+expecting an answer, ``Is any one here?'' I considered it best to
+confess my presence, for I knew Heathcliff's accents, and feared he
+might search further if I kept quiet. With this intention I turned and
+opened the panels. I shall not soon forget the effect my action
+produced. Heathcliff stood near the entrance, in his shirt and
+trousers, with a candle dripping over his fingers, and his face as white
+as the wall behind him. The first creak of the oak startled him like an
+electric shock. The light leaped from his hold to a distance of some
+feet, and his agitation was so extreme that he could hardly pick it up.
+``It is only your guest, sir,'' I called out, desirous to spare him the
+humiliation of exposing his cowardice further. ``I had the misfortune
+to scream in my sleep, owing to a frightful nightmare. I'm sorry I
+disturbed you.''
+\end
+From: Jun-Jih Liang <cip224@wpax01.physik.uni-wuerzburg.de>
+Subject: A vbox underfull while using eplain.tex
+To: karl@cs.umb.edu
+Date: Wed, 10 Nov 93 11:47:39 MEZ
+
+Dear Karl:
+
+ I'd like to appreciate your kindness to put the "eplain.tex" in the public
+domain so that I can switch \doublecolumns and \singlecolumn in an article.
+After a little change in the file "column.tex" which is located at the
+subdirectory "/eplain-2.3/test" I have got an unexpected output. There is a
+"verticle underfull (Underfull \vbox ...)" at the first page. What I've done at
+the file are:
+
+1) magnify the text font at 1 step (\magnification=\magstep1)
+2) add an extra "\singlecolumn" and "\doublecolumns" after the first
+ "doublecolumn".
+
+ Would you please tell me how can I get rid of the verticle underfull and
+get the normal single- and doublecolumns output at the same page? Thank you for
+your helpness in advance!
+
+ Sincerely,
+ Jun-Jih Liang
+
+P.S. In the following two mails I attach the file "column.tex" which has
+changed by me in the first and a Postcript formated "column.ps" which is
+transformed from "column.dvi" in the second.
+
+
+
diff --git a/Master/texmf-dist/source/eplain/base/test/list.tex b/Master/texmf-dist/source/eplain/base/test/list.tex
new file mode 100644
index 00000000000..68775b3d822
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/list.tex
@@ -0,0 +1,90 @@
+% This file is public domain.
+%
+% Test file for lists.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+{\parindent = 0pt
+ \parskip = .5\baselineskip
+\unorderedlist
+ \li hello there
+
+ This item has two paragraphs since we want to see if it
+ works anywhere, and of course we want the paragraphs to be long.
+
+ \li We did this list with zero parindent and nonzero parskip.
+\endunorderedlist
+}
+
+\unorderedlist
+ \li hello there
+
+ This item has two paragraphs since we want to see if it
+ works anywhere, and of course we want the paragraphs to be long.
+
+ \li second item
+ \numberedlist
+ \li nested
+ \li and again.
+
+ This item has two paragraphs, also, since we want to see if it
+ works anywhere, and of course we want the paragraphs to be long.
+
+ \li and again
+ \numberedlist
+ \li I am going three-level with you.
+ \endnumberedlist
+ \unorderedlist
+ \li I'm not.
+
+ This item has two paragraphs, also, since we want to see if
+ it works anywhere, and of course we want the paragraphs to
+ be long.
+
+ In fact, maybe we better make it three paragraphs. What
+ will happen then? This should tell us.
+
+ \endunorderedlist
+ \endnumberedlist
+\endunorderedlist
+
+This is a paragraph between the lists. It should be indented. But we'll
+make it go on for more than one line, so we'll be able to see where the
+left margin is.
+
+\numberedlist
+ \li hello there
+
+ This item has two paragraphs. Isn't that annoying?
+ In fact, the second paragraph has more than one line, at least
+ I'm going to make it long enough so that that is true---I hope.
+
+ \li second item
+ \numberedlist
+ \li nested
+ \li and again
+ \li and again
+ \numberedlist
+ \li I am going three-level with you.
+ \endnumberedlist
+ \unorderedlist
+ \li I'm not.
+ \endunorderedlist
+ \endnumberedlist
+\endnumberedlist
+
+\listleftindent = 4pc
+\unorderedlist
+\li A shorter list, but with a bigger indent.
+\numberedlist \li A nested list.
+\endnumberedlist
+\li The second item.
+\endunorderedlist
+
+A list with an xref label:
+\numberedlist
+\li[listitem] This is the first.
+\endnumberedlist
+
+And now we can refer to that item: \xrefn{listitem}.
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/listing.tex b/Master/texmf-dist/source/eplain/base/test/listing.tex
new file mode 100644
index 00000000000..60ae74c9ef3
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/listing.tex
@@ -0,0 +1,10 @@
+% This file is public domain.
+%
+\input eplain
+
+\listing{verbatim.tex}
+
+\let\setuplistinghook = \linenumberedlisting
+\listing{verbatim.tex}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/logo.tex b/Master/texmf-dist/source/eplain/base/test/logo.tex
new file mode 100644
index 00000000000..5b137a56c46
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/logo.tex
@@ -0,0 +1,20 @@
+% This file is public domain.
+%
+\input eplain
+
+\xspaceskip = 2em
+Sentence-ending \TeX. And sentence \TeX\ middle. Sentence.
+
+\LaTeX
+
+\AMSTeX
+
+\LAMSTeX
+
+\BibTeX
+
+\MF
+
+\SLITEX
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/loop.tex b/Master/texmf-dist/source/eplain/base/test/loop.tex
new file mode 100644
index 00000000000..7f6b7bd4e89
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/loop.tex
@@ -0,0 +1,20 @@
+% This file is public domain.
+%
+\input eplain
+
+\def\iterate{%
+ \let\next\relax
+ \body
+ \let\next\iterate
+ \fi
+ \next
+}
+
+\count255 = 5
+\loop
+ loop iteration \number\count255 %\par
+ \ifnum\count255<3 \else
+ \advance\count255 by -1
+\repeat
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/loopnext.tex b/Master/texmf-dist/source/eplain/base/test/loopnext.tex
new file mode 100644
index 00000000000..8d77b8622bf
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/loopnext.tex
@@ -0,0 +1,21 @@
+% This file is public domain.
+%
+% Date: Tue, 2 May 2000 17:27:38 -0400
+% From: "Peter Kabal" <kabal@ece.mcgill.ca>
+% To: <karl@cs.umb.edu>
+% Subject: eplain interaction with TeXdraw
+%
+% A TeXdraw user alerted me to the fact that the TeXdraw routines gave a
+% warning message when used together with eplain. It seems that eplain
+% defines \iterate
+% differently than plain tex. Using plain TeX, there is no problem, but using
+% eplain one there is.
+
+\input eplain
+
+\input texdraw
+\btexdraw
+ \lpatt(0.1 0.1)
+\etexdraw
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/mag.tex b/Master/texmf-dist/source/eplain/base/test/mag.tex
new file mode 100644
index 00000000000..8704c008996
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/mag.tex
@@ -0,0 +1,14 @@
+% This file is public domain.
+%
+% \magnification=1200
+\input eplain.tex
+\paperheight=11truein
+\paperwidth=8.5truein
+\leftmargin=2.5truecm
+\rightmargin=2.5truecm
+\topmargin=2.5truecm
+\bottommargin=2.5truecm
+
+This is a test
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/makecol.tex b/Master/texmf-dist/source/eplain/base/test/makecol.tex
new file mode 100644
index 00000000000..4c0379a703d
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/makecol.tex
@@ -0,0 +1,17 @@
+% This file is public domain.
+%
+\input eplain
+
+Should have two columns with 1--3 in the first, and 4--6 in the second.
+
+\loggingall
+
+\makecolumns 6/2:
+one
+two
+three
+four
+five
+six
+I should be after the table.
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/margin.tex b/Master/texmf-dist/source/eplain/base/test/margin.tex
new file mode 100644
index 00000000000..8275e543326
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/margin.tex
@@ -0,0 +1,68 @@
+% This file is public domain.
+%
+\input marg
+
+\headline = {headline with descender: p\hfil}
+\parindent = 0pt
+
+% Assigning to \topskip increases the space at the top of the page,
+% between the headline and the text.
+%
+%\topskip = .5in
+
+
+\topmargin = 3in \leftmargin = 3in
+\bottommargin = 3in \rightmargin = 3in
+
+This is the first line of text. The top of it should be 3in from the
+top of the paper.
+\vfill
+This is in the middle. The left margin should be three inches, and so
+should the right margin (on the whole page, not just here, of course).
+\vfill
+The last line's baseline should be 3in from the bottom.
+(This page tested assignments that increase the margins.)
+\eject
+
+
+\advancetopmargin by -1in \advanceleftmargin by -1in
+\advancebottommargin by -1in \advancerightmargin by -1in
+
+This is the first line of text. The top of it should be 2in from the
+top of the paper.
+\vfill
+This is in the middle. The left and right margins should be two inches
+each.
+\vfill
+The last line's baseline should be 2in from the bottom.
+(This page tested advances that decreased the margins.)
+\eject
+
+
+\topmargin = .5in \leftmargin = .5in
+\bottommargin = .5in \rightmargin = .5in
+
+This is the first line of text. The top of it should be .5in from the
+top of the paper.
+\vfill
+This is in the middle. The left and right margins should be .5in each,
+just as you might expect by now, if you've been reading.
+\vfill
+The last line's baseline should be .5in from the bottom.
+(This page tested assignments that decreased the margins.)
+\eject
+
+
+\advancetopmargin by 1in \advanceleftmargin by 1in
+\advancebottommargin by 1in \advancerightmargin by 1in
+
+This is the first line of text. The top of it should be 1.5in from the
+top of the paper.
+\vskip0pt plus1filll
+I bet you can guess what the left and right margins should be: yup,
+1.5in. Let's make this line a little longer, so it will actually hit
+the margin.
+\vskip0pt plus1filll
+The last line's baseline should be 1.5in from the bottom.
+(This page tested assignments that increased the margins.)
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/matrix.tex b/Master/texmf-dist/source/eplain/base/test/matrix.tex
new file mode 100644
index 00000000000..4c966c312b4
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/matrix.tex
@@ -0,0 +1,18 @@
+% This file is public domain.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+This tests matrix inside eqalignno with leftdisplays.
+
+% $$\eqalignno{
+% \matrix{a \cr b\cr c} & = 1 & 1 \cr
+% }$$
+
+\loggingall
+
+\leftdisplays
+$$\eqalignno{
+ \matrix{a \cr b\cr c} & = 1 & 1 \cr
+}$$
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/mdisplay.tex b/Master/texmf-dist/source/eplain/base/test/mdisplay.tex
new file mode 100644
index 00000000000..96ed8543b9c
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/mdisplay.tex
@@ -0,0 +1,215 @@
+% This file is public domain.
+%
+% Test math displays.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+%\loggingall
+
+A simple one, done with plain, for comparison (it should come out
+centered). Because of the way that \TeX's modes work, you should never
+leave a blank line (i.e., cause a par command) before a display. When
+\TeX\ sees a \$ in vertical mode, it switches to horizontal mode; but
+then when the display starts, it goes back to vertical mode, thus
+causing an extraneous blank line before the display. (Plain \TeX\ sets
+abovedisplayskip to about a baselineskip, so you are going to get one
+blank line from that (unless the line above the display is short, in
+which case aboveshortdisplayskip is used, which is 3pt or some such);
+but if a par intervenes between the end of the paragraph and the
+beginning of the display, you get a second one.)
+$$x = y + z$$
+
+After a centereddisplays:
+\centereddisplays
+$$d+e+f$$
+
+Now starting leftdisplays.
+\leftdisplays
+
+No equation number:
+$$A = B + C$$
+
+Do another leftdisplays.
+\leftdisplays
+$$a+n=m$$
+
+Equation number on right:
+$$D = E + F\eqno (r)$$
+
+Equation number on left:
+$$G = H + I\leqno (l)$$
+
+Using eqdef:
+$$J = K + L\eqdef{hello}$$
+
+Here is one done with displaylines:
+$$\displaylines{x=1\cr}$$
+
+Let's do those again, indented by one inch plus the paragraph indentation:
+{\leftdisplayindent = 1in
+ No equation number:
+ $$A = B + C$$
+
+ Equation number on right:
+ $$D = E + F\eqno (r)$$
+
+ Equation number on left:
+ $$G = H + I\leqno (l)$$
+
+ Using eqdef:
+ $$J = K + L\eqdef{hello}$$
+
+ Here is one done with displaylines:
+ $$\displaylines{x=1\cr}$$
+}
+
+\hrule
+\smallskip
+The rule above just makes it easier to see the margins.
+
+Another displaylines, this one should end up on the right.
+$$\displaylines{\hfill y=2\cr}$$
+
+A displaylines with an eqno:
+$$\displaylines{x=1 \eqno{d}\cr}$$
+
+A displaylines with an eqdef:
+$$\displaylines{x=1 \eqdef{eqdef-displ}\cr}$$
+
+{\leftskip = 14pt
+An indented displaylines with an eqdef:
+$$\displaylines{x=1 \eqdef{eqdef-displ}\cr}$$
+
+}
+
+Here is one with done with eqalign (the ='s should line up):
+$$\eqalign{
+ a+b&=c\cr
+ dq+er&=f\cr
+}$$
+
+An eqalign with a noalign inside:
+$$\eqalign{
+ a+b&=c\cr
+ g+h&=i\cr
+}$$
+
+And one with eqalignno:
+$$\eqalignno{
+ a+b&=c&(1)\cr
+ d+e&=f&(1*)\cr
+ g+h&=i&\eqdef{eqdef-2}\cr
+}$$
+
+An eqalignno with a noalign inside:
+$$\eqalignno{
+ a+b&=c&(1)\cr
+\noalign{and}
+ g+h&=i&\eqdef{eqdef-2}\cr
+}$$
+
+And one (indented more) with leqalignno:
+{\leftdisplayindent = 1in
+$$\leqalignno{
+ a+b&=c&(1)\cr
+ dt+eg&=f&(1*)\cr
+ g+h&=i&\eqdef{eqdef-3}\cr
+}$$
+}
+
+A cases, from p.175 of the TeXbook.
+$$
+ |x| = \cases{x, &if $x\ge0$;\cr
+ -x, &otherwise.\cr
+}$$
+
+A pmatrix, from p.176.
+$$\pmatrix{
+ x-\lambda&1&0\cr
+ 0&x-\lambda&1\cr
+ 0&0&x-\lambda\cr
+}$$
+
+
+The rule below just makes it easier to see the margins.
+\smallskip
+\hrule
+\bigskip
+
+Back to centered displays now.
+\centereddisplays
+
+No equation number:
+$$A = B + C$$
+
+Equation number on right:
+$$D = E + F\eqno (r)$$
+
+Equation number on left:
+$$G = H + I\leqno (l)$$
+
+Using eqdef:
+$$J = K + L\eqdef{hello}$$
+
+Here is one done with displaylines:
+$$\displaylines{x=1\cr}$$
+
+\hrule
+\smallskip
+The rule above just makes it easier to see the margins.
+
+Another displaylines, this one should end up on the right.
+$$\displaylines{\hfill y=2\cr}$$
+
+Here is one with done with eqalign (the ='s should line up):
+$$\eqalign{
+ a+b&=c\cr
+ dq+er&=f\cr
+}$$
+
+And one with eqalignno:
+$$\eqalignno{
+ a+b&=c&(1)\cr
+ d+e&=f&(1*)\cr
+ g+h&=i&\eqdef{eqdef-2}\cr
+}$$
+
+An eqalignno with a noalign inside:
+$$\eqalignno{
+ a+b&=c&(1)\cr
+\noalign{and}
+ g+h&=i&\eqdef{eqdef-2}\cr
+}$$
+
+And one (indented more) with leqalignno:
+{\leftdisplayindent = 1in
+$$\leqalignno{
+ a+b&=c&(1)\cr
+ dt+eg&=f&(1*)\cr
+ g+h&=i&\eqdef{eqdef-3}\cr
+}$$
+}
+
+The rule below just makes it easier to see the margins.
+\smallskip
+\hrule
+\bigskip
+
+
+A cases, from p.175 of the TeXbook.
+$$
+ |x| = \cases{x, &if $x\ge0$;\cr
+ -x, &otherwise.\cr
+}$$
+
+A pmatrix, from p.176.
+$$\pmatrix{
+ x-\lambda&1&0\cr
+ 0&x-\lambda&1\cr
+ 0&0&x-\lambda\cr
+}$$
+
+Now after a second centereddisplays:
+\centereddisplays
+$$a + b = c$$
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/names.tex b/Master/texmf-dist/source/eplain/base/test/names.tex
new file mode 100644
index 00000000000..b996738a63a
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/names.tex
@@ -0,0 +1,21 @@
+% This file is public domain.
+%
+\input texnames.sty
+
+\parskip = \baselineskip
+\nopagenumbers
+
+\def\test{%
+ \AMSTeX\par
+ \BibTeX\par
+ \LAMSTeX\par
+ \LaTeX\par
+ \MF\par
+ \SLiTeX\par
+}
+
+\rm \test
+\it \test
+\bf \test
+\sl \test
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/noarrow.tex b/Master/texmf-dist/source/eplain/base/test/noarrow.tex
new file mode 100644
index 00000000000..f0379f7f813
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/noarrow.tex
@@ -0,0 +1,8 @@
+% This file is public domain.
+%
+\let\noarrow = t
+\input eplain
+
+\show\commdiag
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/nobib.tex b/Master/texmf-dist/source/eplain/base/test/nobib.tex
new file mode 100644
index 00000000000..e2586ecd8c2
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/nobib.tex
@@ -0,0 +1,10 @@
+% This file is public domain.
+%
+\let\nobibtex = t
+\ifx\eplain\undefined\input eplain \fi
+
+\tokstostring{abc}
+\xrdef{label}
+\xref{label}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/nonouter.tex b/Master/texmf-dist/source/eplain/base/test/nonouter.tex
new file mode 100644
index 00000000000..32aa5c9fee1
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/nonouter.tex
@@ -0,0 +1,11 @@
+% This file is public domain.
+%
+\outer\def\nonouterdef#1#2{\begingroup
+ \def\startdef{\def #1\bgroup}%
+% \expandafter\defstart \csname #2\endcsname\egroup
+ \def\outername{\csname #2\endcsname}%
+ \expandafter\startdef \outername \egroup
+\endgroup}
+
+\tracingall
+\nonouterdef\innernewwrite{newwrite}
diff --git a/Master/texmf-dist/source/eplain/base/test/optional.tex b/Master/texmf-dist/source/eplain/base/test/optional.tex
new file mode 100644
index 00000000000..f7cc917000e
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/optional.tex
@@ -0,0 +1,30 @@
+% This file is public domain.
+%
+% Test optional arguments.
+
+\ifx\undefined\eplain \input eplain \fi
+
+\catcode`@ = \letter
+\def\foo{\@getoptionalarg\finfoo}
+\def\finfoo#1{%
+ \edef\firstarg{\@optionalarg}
+ \edef\mandatoryarg{#1}%
+ \@getoptionalarg\finfinfoo
+}
+\def\finfinfoo{%
+ The first optional argument is `\firstarg', the mandatory argument
+ is `\mandatoryarg', and the second optional argument is `\@optionalarg'.
+ \par
+}
+
+\loggingall
+\foo[a {\cite[p.10]{xyz}} b]{mand2}
+
+\foo{mand}
+\foo[opt1]{mand}
+\foo{mand}[opt2]
+\foo[opt1]{mand}[opt2]
+\foo[opt1]{mand}
+ [opt2 on a separate line]
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/outer.tex b/Master/texmf-dist/source/eplain/base/test/outer.tex
new file mode 100644
index 00000000000..e424bebed12
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/outer.tex
@@ -0,0 +1,26 @@
+% This file is public domain.
+%
+% Test file to make sure all the inner allocation routines really are
+% inner.
+%
+\input eplain
+
+\def\foo{%
+ \innernewcount\a
+ \innernewdimen\b
+ \innernewskip\c
+ \innernewmuskip\d
+ \innernewbox\e
+ \innernewhelp\f{Help.}%
+ \innernewtoks\g
+ \innernewread\h
+ \innernewwrite\i
+ \innernewfam\j
+ \innernewlanguage\k
+ \innernewinsert\l
+ \innernewif\ifm
+}
+
+\foo
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/page.tex b/Master/texmf-dist/source/eplain/base/test/page.tex
new file mode 100644
index 00000000000..5112d5d9ed4
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/page.tex
@@ -0,0 +1,8 @@
+% This file is public domain.
+%
+\hrule
+top of page
+\vskip 0pt plus1filll
+bottom of page
+\hrule
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/path.tex b/Master/texmf-dist/source/eplain/base/test/path.tex
new file mode 100644
index 00000000000..8a891bd3623
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/path.tex
@@ -0,0 +1,25 @@
+% This file is public domain.
+%
+% Test the \path macro.
+
+\input eplain
+%\input path.sty
+
+This is a normal path: \path|karl@cs.umb.edu|. This is a somewhat
+longer path: \path|letters@kropotkin.gnu.ai.mit.edu|. This is a still
+longer path:
+\path|megan@agroecology.university-of-california-at-santa-cruz.edu|. I'm
+making this all one paragraph so the path macro will have a chance to
+show its stuff. This path has dollar signs and other strange characters
+(but no vertical bars) in it: \path|#$%^_<>|. Now I'm going to change
+the discretionaries to only be at !'s. \discretionaries|!| Now this path
+should break only at !'s: \path|-hello!..from!@@bang!land|. Now I'm
+going to change things so backslash is the delimiter.
+\specialpathdelimiterstrue
+\path\##hello!there!@.@again!...we!**still!_have!-bangs!\. That last
+was delimited by backslashes, now let's do one that isn't delimited by
+backslashes: \path@hi, there!this is fun!@. I'll go on for a little
+while not doing anything in particular, so \TeX\ will have a chance to
+break the paragraph nicely. That's all, folks!
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/pcol.tex b/Master/texmf-dist/source/eplain/base/test/pcol.tex
new file mode 100644
index 00000000000..52bfc2cc77d
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/pcol.tex
@@ -0,0 +1,183 @@
+% This file is public domain.
+%
+% These are the double-column macros from Paul Abrahams, Dec 1991
+% They add the following features:
+% \ifbalance (by default true, causes last page to be balanced)
+% \everycolumn (a token list, useful for marks)
+% \pageeject
+% \eject does a column eject
+
+\newtoks\mainoutput
+\newbox\partialpage
+\newdimen\fullvsize \newdimen \fullhsize
+\newbox\leftcolumn \newbox \rightcolumn
+\newbox\savefootins \newskip\footskip
+\newbox\savetopins \newskip\topinsskip
+\newif\ifbalance \balancetrue
+\newtoks\everycolumn
+
+
+\def\pageeject{\penalty -10005 }%
+
+\def\doublecolumns{%
+ \mainoutput = \output % Save the previous \output.
+ %
+ % This grabs any single-column material.
+ \output = {\global\setbox\partialpage = \vbox{\unvbox255}}%
+ \vskip\abovedoublecolumnskip
+ \par % \par updates \pagetotal
+ \pagegoal = \pagetotal
+ \break % Now expand the \output we assigned just above.
+ \output = {\doublecolumnoutput}%
+ %
+ % Set up \hsize and \vsize for double columns.
+ \fullvsize = \vsize
+ \fullhsize = \hsize
+ \advance\hsize by -\gutter
+ \divide \hsize by 2
+ \advance\vsize by -\ht\partialpage
+ %
+ % Take account of existing insertions.
+ \ifvoid\footins\else
+ \advance\vsize by -\ht\footins
+ \advance\vsize by -\skip\footins
+ \fi
+ \setbox\savefootins = \box\footins
+ \footskip = \skip\footins
+ %
+ \ifvoid\topins\else
+ \advance\vsize by -\ht\topins
+ \advance\vsize by -\skip\topins
+ \fi
+ \setbox\savetopins = \box\topins
+ \topinsskip = \skip\topins
+ %
+ % Start at the left, clear the existing columns.
+ \let\lr = L%
+ \setbox0 = \box\leftcolumn \setbox0 = \box\rightcolumn
+}%
+%
+% This routine actually does the outputting.
+\def\doublecolumnoutput{%
+ \ifbalance\else \ifnum \outputpenalty < -10000
+ \setbox255 = \vbox{\unvbox255 \vfil}%
+ \fi\fi
+ %
+ \the\everycolumn
+ \if \lr L%
+ \buildcolumn\leftcolumn
+ \global\let\lr = R%
+ \else
+ \buildcolumn\rightcolumn
+ \global\let\lr = L%
+ \fi
+ %
+ \ifnum \outputpenalty < -10000
+ \ifbalance
+ \ifdim \ht\leftcolumn > 8\baselineskip
+ \balancecolumns
+ \global \let \lr = L%
+ \fi\fi\fi
+ %
+ \if \lr L%
+ \setbox255 = \vbox{%
+ \unvbox\partialpage
+ \dimen0 = \ht\leftcolumn \dimen1 = \dp\leftcolumn
+ \joincolumns
+ \ifnum \outputpenalty = -10005 \vfil \fi
+ }%
+ % The restoration of the insertion boxes happens only once, since
+ % they are empty thereafter.
+ \setbox\footins = \box\savefootins
+ \setbox\topins = \box\savetopins
+ \vsize = \fullvsize % Because we've taken care of \partialoutput
+ \ifnum \outputpenalty = -10006
+ \unvbox255
+ \else
+ \the\mainoutput
+ \global\vsize = \fullvsize
+ \fi
+ \fi
+}%
+%
+%
+% \joincolumns joins \leftcolumn and \rightcolumn into a vbox that aligns
+% the tops of the two columns and has the depth of the deeper column.
+% It adds the resulting box to the main vertical list.
+%
+\def\joincolumns{%
+ \dimen0 = \dp\leftcolumn \dimen1 = \dp \rightcolumn
+ \setbox0 = \hbox to \fullhsize{%
+ \vtop to \ht\leftcolumn{\unvbox\leftcolumn}%
+ \hfil
+ \vtop to \ht\rightcolumn{\unvbox\rightcolumn}%
+ }%
+ \dimen2 = \boxmaxdepth % For restoring it later
+ \ifdim \dimen0 < \dimen1
+ \boxmaxdepth = \dimen1
+ \else
+ \boxmaxdepth = \dimen0
+ \fi
+ \setbox0 = \vbox{\box0}%
+ \boxmaxdepth = \dimen2
+ \box0 % Produce for the calling context
+}%
+
+\def\buildcolumn #1{%
+ \ifnum \outputpenalty < -9999
+ \global \setbox #1 = \vbox{\pagecontents}%
+ \else
+ \global \setbox #1 = \vbox to \vsize{\pagecontents}%
+ \fi
+}%
+%
+%
+% Go back to single-column typesetting. Unfortunately, we cannot start
+% a group in \doublecolumns and end it here, because some documents
+% might want double-column mode to continue to the end. So we have to
+% restore the things we've changed manually.
+%
+\def\singlecolumn{%
+ \penalty -10006
+ \output = \mainoutput
+ \hsize = \fullhsize
+ \vsize = \fullvsize
+ %
+ % Add \belowdoublecolumnskip if there's enough room, otherwise a \vfil
+ % to fill out the page.
+ \dimen0 = \pagetotal \advance \dimen0 by \belowdoublecolumnskip
+ \ifdim \dimen0 < \pagegoal
+ \vskip\belowdoublecolumnskip
+ \else
+ \vfil
+ \fi
+ \allowbreak
+}%
+%
+\def \balancecolumns{%
+ \setbox\leftcolumn = \vbox{\unvbox\leftcolumn \unskip}%
+ \setbox\rightcolumn = \vbox{\unvbox\rightcolumn \unskip}%
+ \setbox0 = \vbox{%
+ \dimen0 = \dp\leftcolumn
+ \unvbox \leftcolumn
+ \if \lr L
+ \kern -\dimen0
+ \vskip -\topskip
+ \vskip \baselineskip
+ \unvbox \rightcolumn
+ \fi
+ }%
+ \dimen0 = \ht0
+ \advance \dimen0 by \topskip \advance \dimen0 by -\baselineskip
+ \divide \dimen0 by 2 \splittopskip = \topskip
+ \count@ = \vbadness \vbadness = 10000
+ \loop
+ \setbox2 = \copy0
+ \setbox1 = \vsplit2 to \dimen0
+ \ifdim \ht2 > \dimen0
+ \advance \dimen0 by 1pt
+ \repeat
+ \vbadness = \count@
+ \setbox \leftcolumn = \vbox to \dimen0{\unvbox1}%
+ \setbox \rightcolumn = \vbox to \dimen0{\unvbox2}%
+}%
diff --git a/Master/texmf-dist/source/eplain/base/test/pdftex.tex b/Master/texmf-dist/source/eplain/base/test/pdftex.tex
new file mode 100644
index 00000000000..7aa765d2c89
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/pdftex.tex
@@ -0,0 +1,112 @@
+\input ../eplain
+%\enablehyperlinks[nolinks]
+%\enablehyperlinks[pdftex]
+\enablehyperlinks
+
+\beginpackages
+\usepackage[dvipsnames]{color}
+\endpackages
+
+% Execute #1 then print it verbatim and indented.
+\def\c{\cf\indent\relax}
+% Same as \c, but do not indent and at the end say \hlend.
+\def\f{\cf\noindent\hlend}
+%
+\def\cf#1#2#3{%
+ \def\temp{#3}%
+ \edef\cftemp{\sanitize\temp}%
+ #1#3\expandafter\verbatim\cftemp\endverbatim#2\par
+}
+%
+\newcount\destcount
+% Execute `#1{d\the\destcount}' then print it (`#1', `{d', and `}' are printed
+% verbatim; `\the\destcount' is expanded).
+\def\d{\dl\relax}
+% Same as \d, but at the end also say \hlend.
+\def\l{\dl\hlend}
+%
+\def\dl#1#2{%
+ \global\advance\destcount by1
+ \toks0={#2}%
+ \edef\temp{\the\toks0{d\the\destcount}}%
+ \edef\dltemp{\sanitize\temp}%
+ \noindent#2{d\the\destcount}\expandafter\verbatim\dltemp\endverbatim#1\par
+}
+
+\pdfpagewidth=8.5in
+\pdfpageheight=11in
+
+
+
+\leftline{\bf Destinations}
+\medskip
+
+{\tt\global\parindent=4em}
+
+\d{\hldest{}{}}
+\c{\hldestopts{zoom=2345}}
+\d{\hldest{}{}}
+\medskip
+\c{\hldesttype{fitr}}
+\c{\hldestopts{width=\hsize}}
+\d{\hldest{}{}}
+\c{\def\myopts{width=.5\hsize,depth=.25\hsize}}
+\d{\hldest{}{\myopts,height=.25\hsize}}
+\medskip
+\c{\let\myopts\empty}
+\c{\hldestopts{raise=2\normalbaselineskip}}
+\d{\hldest{xyz}{\myopts,zoom=2500}}
+\d{\hldest{xyz}{raise=\ht\strutbox,zoom=3000}}
+\medskip
+\makeatletter
+\c{\def\mydest{\pdfdest name{\@hllabel} xyz}}
+\d{\hldest{raw}{cmd=mydest}}
+\resetatcatcode
+\medskip
+\d{\hldest{fit}{}}
+\d{\hldest{fith}{}}
+\d{\hldest{fitv}{}}
+\d{\hldest{fitb}{}}
+\d{\hldest{fitbh}{}}
+\d{\hldest{fitbv}{}}
+\vfil\eject
+
+
+
+\leftline{\bf Links}
+\medskip
+
+{\tt\global\parindent=4.5em}
+
+\destcount=0 % Reset destination count.
+\l{\hlstart{name}{}}
+\c{\hlopts{bstyle=U}}
+\l{\hlstart{name}{}}
+\l{\hlstart{}{bstyle=D,bdash=2 4,bcolor=1 0 0,hlight=I}}
+\l{\hlstart{}{bstyle=B,bwidth=3}}
+\c{\hlopts{bcolor=0 0 1}}
+\l{\hlstart{}{bstyle=I,bwidth=4}}
+\l{\hlstart{}{bstyle=U,bwidth=1}}
+\c{\hlopts{bstyle=S}}
+\l{\hlstart{}{hlight=I,bcolor=1 .2 .2,bwidth=2}}
+\l{\hlstart{}{hlight=N,bstyle=D,bwidth=3}}
+\l{\hlstart{}{hlight=O}}
+\l{\hlstart{}{hlight=P,bcolor=.3 .6 .7}}
+\l{\hlstart{}{bstyle=D,bdash=2 4 6}}
+\l{\hlstart{}{bwidth=0}}
+\l{\hlstart{}{bstyle=D,bdash=2 4 6 8}}
+\f{\hlstart{page}{pagefit=/FitH 600}{1}}
+\f{\hlstart{filename}{file=hlink.pdf,newwin=1}{eq1}}
+\f{\hlstart{filepage}{file=hlink.pdf,pagefit=/FitR 50 100 300 500}{1}}
+\f{\hlstart{filepage}{file=hlink.pdf,pagefit=/FitB}{2}}
+\f{\hlstart{url}{}{http://tug.org/eplain/}}
+\c{\def\mycmd{\pdfstartlink goto page 1 {/Fit}}}
+\f{\hlstart{raw}{cmd=mycmd}{}}
+
+
+
+\bye
+
+% Local variables:
+% compile-command: "(cd .. && make eplain.tex) && pdftex --interact=nonstopmode pdftex.tex"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/psfont.map b/Master/texmf-dist/source/eplain/base/test/psfont.map
new file mode 100644
index 00000000000..6b25d458abb
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/psfont.map
@@ -0,0 +1,78 @@
+% This file is public domain.
+%
+% +--------------------------------------------------------------------+
+% | |
+% | Font mapping for Turing |
+% | ----------------------- |
+% | |
+% | Letter Font Letter Qualifier |
+% | ------ ------------ ------ ------------ |
+% | A Avant-Garde B Bold |
+% | B Bookman D Demi |
+% | C Courier I Italic |
+% | H Helvetica L Light |
+% | N New-Century M Medium |
+% | Schoolbook O Oblique |
+% | P Palatino R Roman |
+% | S Symbol S Small Caps |
+% | T Times |
+% | ZC Zapf Chancery |
+% | ZD Zapf Dingbats |
+% | |
+% +--------------------------------------------------------------------+
+
+ \def\SYSTEM{Turing}
+
+ \def\AB@#1pt{pagk at #1pt}
+ \def\ABO@#1pt{pagko at #1pt}
+ \def\AD@#1pt{pagd at #1pt}
+ \def\ADO@#1pt{pagdo at #1pt}
+
+ \def\BD@#1pt{pbkd at #1pt}
+ \def\BDI@#1pt{pbkdi at #1pt}
+ \def\BL@#1pt{pbkl at #1pt}
+ \def\BLI@#1pt{pbkli at #1pt}
+ \def\BO@#1pt{pbkro at #1pt}
+
+ \def\CB@#1pt{pcrb at #1pt}
+ \def\CBO@#1pt{pcrbo at #1pt}
+ \def\CM@#1pt{pccr at #1pt}
+ \def\CO@#1pt{pccro at #1pt}
+
+ \def\HB@#1pt{phvb at #1pt}
+ \def\HBO@#1pt{phvbo at #1pt}
+ \def\HM@#1pt{phvr at #1pt}
+ \def\HO@#1pt{phvro at #1pt}
+
+ \def\NB@#1pt{pncb at #1pt}
+ \def\NBI@#1pt{pncbi at #1pt}
+ \def\NI@#1pt{pncri at #1pt}
+ \def\NR@#1pt{pncr at #1pt}
+ \def\NO@#1pt{pncro at #1pt}
+
+ \def\PB@#1pt{pplb at #1pt}
+ \def\PBI@#1pt{pplbi at #1pt}
+ \def\PBO@#1pt{pplbo at #1pt}
+ \def\PI@#1pt{pplri at #1pt}
+ \def\PO@#1pt{pplro at #1pt}
+ \def\PR@#1pt{pplr at #1pt}
+
+ \def\TB@#1pt{ptmb at #1pt}
+ \def\TBI@#1pt{ptmbi at #1pt}
+ \def\TBO@#1pt{ptmbo at #1pt}
+ \def\TI@#1pt{ptmri at #1pt}
+ \def\TIU@#1pt{ptmru at #1pt}
+ \def\TO@#1pt{ptmro at #1pt}
+ \def\TR@#1pt{ptmr at #1pt}
+
+ \def\ZCMI@#1pt{pzcmi at #1pt}
+ \def\ZD@#1pt{pzdr at #1pt}
+
+ \def\S@#1pt{psyr at #1pt}
+ \def\SO@#1pt{psyro at #1pt}
+ \def\SX@#1pt{psyrx at #1pt}
+
+ \def\TRS@#1pt{ptmrc at #1pt}
+ \def\PRS@#1pt{pplrc at #1pt}
+ \def\NRS@#1pt{pncrc at #1pt}
+ \def\BS@#1pt{pblrc at #1pt}
diff --git a/Master/texmf-dist/source/eplain/base/test/rex.tex b/Master/texmf-dist/source/eplain/base/test/rex.tex
new file mode 100644
index 00000000000..7fc90ba9367
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/rex.tex
@@ -0,0 +1,277 @@
+% This file is public domain.
+%
+%Date: Fri, 08 May 92 12:28:17 PDT
+%From: Rex Shudde <0024P%NAVPGS.BITNET@CORNELLC.cit.cornell.edu>
+%Subject: Eplain document
+%To: karl berry <karl@cs.umb.edu>
+%
+%Karl,
+%
+%Attached is an emulation of my document. Re-iterating, (1) the title should be
+%on the first page with the abstract, and a horizontal rule should span the
+%entire first page, and (2) the second footnote is referenced in the second
+%column on third page.
+%
+%Undoubtedly I've violated some of the rules of either TeX or eplain, but I
+%don't know what.
+%
+%Again, many thanks.
+%
+%Rex
+%
+%Bitnet: 0024p@navpgs
+%Internet: 0024p@cc.nps.navy.mil
+%.............................................................................
+%\magnification=\magstep0
+\input eplain
+\input tables %This is Ferguson's INRSTeX Tables (a very old version).
+
+\hbadness = 100000 \vbadness = 10000 \hfuzz = \maxdimen
+\tolerance=2000
+
+\def\SP{\ }
+\def\throwaway#1{}
+\def\checkspace{\ifx \next\
+\let\result=\throwaway
+ \else \let\result=\ignorespaces \fi \result }
+\font\bigfont=cmr10 scaled \magstep5
+\def\bfl#1{\setbox0=\hbox {{\bigfont #1}\thinspace}
+ \noindent \hangindent \wd0 \hangafter -2
+ \llap {\vbox to \ht0{\kern\baselineskip \box0 \kern-\baselineskip}}%
+ \futurelet \next \checkspace}
+
+\parskip=10pt
+\parindent=0pt
+
+\font\cmbig=cmr17
+\font\cmrbv=cmb10 scaled \magstep5
+\font\iti=cmbxti10 scaled \magstep2
+\font\erm=cmr8
+
+\doublecolumns
+
+%**************************************************************************
+% Generate a dummy first page for the twocol macro
+% The first page is to have the left column blank.
+
+\phantom{dummy first line} \vskip5truein
+ {\font\iti=cmti10 scaled \magstep1
+ \iti
+ \rightline{An abstract}
+ \rightline{goes}
+ \rightline{in here.}
+ }
+
+\columnfill
+
+%**************************************************************************
+
+\phantom{dummy first line} \vskip0.75truein
+
+\rightline{\cmrbv Title}
+\bigskip\bigskip
+\rightline{\iti Author}
+
+\bigskip\bigskip\bigskip
+%\rightline{\hrulefill}% width6.5truein}
+
+\nointerlineskip
+\moveleft 3.31truein
+\vbox{\hrule width6.5truein}
+\nointerlineskip
+
+\vskip0.75truein
+
+%**************************************************************************
+
+\bfl
+Xxxxxxx xxxxxx xxxxxx xxxxxxx xxxx xxx xxx\numberedfootnote{\erm Xxxxx xxxxx
+xxx xxxx Xxxxx xxxxx, Xxxxx xxxx Xxxxxx xxxxxx, xxxxxx xxxxx xx Xxxxxx Xxxxxx,
+Xxx., X.~X. Xxx~xxx, Xxxx Xxxxx, XX~xxxxx.} Xxxx Xxxxxxxxxx xxxxxxxx xxxx, Xxx
+xxxxx xxxxxx xx xxxxxxxx xx xxxxx xxxxxxx xxxxxxx xxxx xx xxxx xx xxxxxxx xx
+xxx xxxxx xx x xxx xxxxxxx xx xxxxx. Xx x/xxx xx x xxx xxxx xxxxxxx xxxxx
+xxxxxxx, Xxxxxx xxxxxxxxx xxxxx xxxxx x/xxx,xxx,xxx xx x xxxxxx. Xxxx xxxxx
+ xxxx xx xxxx xxxx Xxxxxx'x xxxxxxxx xx xxx xxxxxxx xxxxxxxx xxxxxx xx xxxxx
+ xx xxxx xxxxxxx xxx xxxxxx xxxx xx xxxxxxx xx xxxxxx x.xx xx x xxx, xxx x.xx
+xxx xxxxxx xxxxx xx~xxxxxxx. Xxxx xx x xxxxx xxxxxx xxx xxxxxxxxx xxxxxxxx xxx
+xxxxxxxx xxxx xxxxxxxx xxxxxxxxx xxx xxxxxx xxxxxx xxxx, xxx xxx xxxxxxxx
+xxxxxxxxx xx xxx xxxx xx xxxxxxxxxx xx x xxxx xxxxx xxxxxxxxxx.
+
+Xxxxx xxx xxxxxx xxx xxxxxx xx xxx xxxxx xx xxx xxx xxxxxxxxx (xxx XX-xxx
+xxxxx xxxxxx xxxxxxxx xx xxx Xxx Xxxxxxxxxx Xxxxxxxxxx), xx xxx xxxxxxx xxxx
+xx xxxxx xx xxxxxxxxxxx xx xxxxxxx x xxxxx xxxxxxx xxx xxxx xx xxxxx xxxx
+xxxxxx xx xxxx x xxxxxxxxxxx xxxxxx xxxx xxx xxxxxxx.
+
+Xxxxx x xxxxx xx xxx xxxx xx xxxxxxxxxx xxx xxxxxxxx xx xxx xxxxxxxxxx xxx
+xxxxxx xxxxxxxx xxx xxxx xxxxxx xxx xxxxx xxxx. Xxxx xxx xxxx xxxx xxxx xx
+xxxxx xxx xxxxxx'x xxxx xxxx xxxxxxxx, xxxx {xxx xxxxxxx} xx xxx xxxxxxx
+xxxxxxxxx, xxxxxxxx, xx x, xxx xxxxxxxx. Xxxxx xxxx xxxxxxxxx xxx xxxx (xxxx
+xxx Xxxx) xxx xxxxx xx Xxxxx~x.
+
+Xx xxxxxxxxxxx xx Xxxxx~x xxxxxxx xxxx xxx xxxxxxxx xx xxxxxxx xx xxxx xxxxxxx
+xxxxxxxx xxx xxx xx xxxxxxxxxx xx xxxxx xx xxxxxxxx. Xx xxxx, xx xxxxxxx xx
+xxxxxx xxx xxxxx xx xx xxxxx xxx xxx xxxxxxxxx xxx xxxxxxxx xxxxx xx Xxxxxx'x
+xxxxx xx Xxxxxx' xxxxxx xxxxxxx. Xxxx xxx xxxxxxxx xxxxx xxx xx xx xxxx, xxx
+xxxxxxxxx. Xxxxx~x xxxxxxxx xxx xxxxxxxxx xx xxxxxxx xx xxx xxxxxx xxxxxx xx
+xxxx xxxxxx xxxxxxxx xx xxxxxxxxx xx xxxxxxxxx.
+
+
+\singlecolumn
+\centerline{Table 1---Xxxxxxxxx Xxxx Xxxxxxxx xx Xxxxxxxx}
+\smallbreak
+\line \bgroup \hss
+ \begintable
+ \begintableformat
+ & \center
+ \endtableformat
+ \-
+ \br{\::} : : \use{3} Xxxxxxxxxx Xxxxxxx:
+ : \use{3} Xxxxxx Xxxxxxn \er{:}
+ \br{\:} \zb{Xxxxxx} : \zb{Xxxx} : \use{3} \-
+ : \zb{Xxxx} : \use{3} \- \er{:}
+ \br{\::} : : -xxxxx " -xxxxx " -x :
+ : +xxxxx " +xxxxx " +x \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \br{\::} xxxxxxx : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx
+ : ~x-xx-xx : xxxxx " ~xxxxx " ~xxxxx \er{:}
+ \-
+ \endtable
+\hss \egroup
+\doublecolumns
+
+
+Xxxx xxxxxx x xxxxxx xxxxxxx Xxxxxx'x xxxxxx xxxxxx xx xxx xxxxxx xxxxx xxxxxx
+xxx xxxx xxxxx xx Xxxxx~x, xxxx xxxx xxxxxx xx xxxxx xxxxxxx. Xx, xxx xxxxxxx,
+xx xxxxxxxxxx xxx xxxxxxxx xxxx xxxxxx xxxxxx, xx xxxxx xxxxx xx xxxxxxxxxxx,
+xxxxxxxxxx, xxx xxxxxxxxx, xxxxxxx xx xxx xxxxxxxx xx xxxx xxxxxx xxxx xxxxx
+xxxxxxx, xx xxxxx xxxxx xx xxx xxxxxxxx, xxxxx xxxxx, xxx xxxxxxxxx. Xxxx xxx
+xxxx xx xxxxxxxxx.
+
+\medskip\bigskip
+\centerline{Table 2---Xxxxxxx xx Xxxxxx'x Xxxxxx Xxxxxxx}
+\nobreak
+\centerline{(Xxxxxxx Xxxxxxxx)}
+\smallbreak
+\line \bgroup \hss
+ \begintable
+ \begintableformat
+ & \center
+ \endtableformat
+ \-
+ \br{\::} Xxxx : xxxxxxxx " xxxxxxx " xxxxxx " xxx \er{:}
+ \-
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \-
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \-
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \-
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \br{\::} xxxx : xxxxxxxx " xxxxxxx " xxxxxx " $x''$ \er{:}
+ \-
+ \endtable
+\hss \egroup
+
+Xxxxxxxx xxx xxxx xxxx xxxxx xxxxx xx Xxxxx~x xxx xxx xxxx, xxxx xxx xxx xxxx
+xx xxx xxxxxxxx xxxxxxxx xxxxxxxxx xxxxx. Xx xxx x xxxxx xxxxxxx xx xxx xxxx
+xx xxxxxxx, xx xxx xxxxxxx xx xx x xxxxxx xxxxxx xx xxxxx xxxxxxx xx xxxxxx xx
+xxxx xxxxx xxxxxx x ``xxxxx xxxx'' xxxxxxxx. Xxxxx x xxxxx xx xxxx xxxxx xx
+xxx xxxx xx xxxxxxx xxx xxxxxxxx. Xxxx xxx xxxx xxxxxxxx xx xxxxx xxx xxxxxx'x
+xxxxxxxx xxxxxx xx xxxxx xxxxx, xxxxxxx xxx, xxx xxxxxx xxxx xxxx xxx xxxxx
+xxxxx xxxxxxxx xxx xxxxxxxx. Xxx xxxxxxx, xx xxx xxxxx xxxxx xxxxxx xxxx xxxx
+xxxxxx, xx xxx xxxx xxxxxx xxxxxxxx xxx xxx xxxxx. Xxx xxxxxxx xxx xxxxx xx
+Table~3.
+
+
+\font\eri=cmti8
+
+Xx xxxxxx xx xxxxxxxxxx xxxx xxxxx xxxxxx xxxx xxxxxxxx xxxx xxx xxx xxxxxxx
+xxxxx xx xxx xxxx xxxxx xxx xx xxx xx xxx xxx xxxxxxxxx xx xxxxxxx xxxx xx xxx
+xxx xxxxx xxxxx xxxxxx. Xxxxx~x xxxxxxx xxxx xxx xxxxx xxxxxxx, xx xx
+xxxxxxxxx xxxxxxxxx xx xxxxxxxx xx xxxx xxxx xxxxxxx xxxx xxx xxxx xxx xxxx
+xxxxxxxx xxxxxxxxxxx xxx xxx xxxxxx xx xx xxxxxxx. Xxxxxxxxx xxxxxxx xxxxx xxx
+xx xxxxxxxx xxxxxx xxxx xxx xxxx xxxxxxx xx x xxxxx xxxxxxxxx, xxx xxx
+xxxxxxxx xx xxx xxxxxxxxx? Xxx xxxx xxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xx
+XX-xxx, xxx xxxxxxxxx xx xxx {xxx Xxxxxx xxxxxx Xxxx
+xxx},\numberedfootnote{\erm Xxxx Xx xx xxx xxxx Xxxxxx Xxxxxxx xxxx xxxxx
+xxxx.} ``X xxxxxxx xxxxx xxxxxxxxx xxx Xxxxxx xxx xxx xxxx'x xxxxx xx xxxxxxxx
+xxxx xx xxxxxxxxx xxxxxx xxxxxx xxxx xxxxxx xxxx.'' Xxxx xxxxxx xxxxx xx x
+xxxxxxxx xxxx xxxxxxxx xxxxx xxxxxx xxx xxxxxxxx xxx xxx xxxxxxx xxx xx xxxx
+xxxxxxx xxx xxxxxx xxxxxx xxxxxxxx xxx xxxx xxxxxxxxxxx xxxx xxx xxx xxxxxxx
+xxx xxxxxx xxxxxx xx Xxxxxx xxxxx xx xxxx, xxx xxxxx xxx xxx xxxxxxxx xx x
+Xxxxxx xxxxxxx xxxx xxx xxxx? Xxx xxxxxx xxxxx xx xx xxxxxxxxx xxx xxxxxxx
+xxxx xxx xxxx xxxx xx Xxxxx~x xxx xxxxxx xxxx xxx xxxxxxx xxxx xxxxx xx
+xxxxxxx xx xxxxxx xxx xx xxxxx.
+
+\singlecolumn
+
+\medskip\bigbreak
+\midinsert
+\centerline{Table 3---Xxxxxxxxx Xxxx Xxxxxxxx xx Xxxxxxxx}
+\smallbreak
+\line \bgroup \hss
+ \begintable
+ \begintableformat
+ & \center
+ \endtableformat
+ \-
+ \br{\::} : : \use{3} Xxxxxxxxxx Xxxxxxx:
+ : \use{3} Xxxxxx Xxxxxxx \er{:}
+ \br{\:} \zb{Xxxxxx} : \zb{Xxxx} : \use{3} \-
+ : \zb{Xxxx} : \use{3} \- \er{:}
+ \br{\::} : : -xxxxxxx " -xxxxxxx " -xxxxxxx :
+ : +xxxxxxx " +xxxxxxx " +xxxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \br{\::} {xxx x} : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx
+ : ~x-xx-xx : xxxxxx " ~xxxxxx " ~xxxxxx \er{:}
+ \-
+ \endtable
+\hss \egroup
+\endinsert
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/rule.tex b/Master/texmf-dist/source/eplain/base/test/rule.tex
new file mode 100644
index 00000000000..7001ca9a368
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/rule.tex
@@ -0,0 +1,23 @@
+% This file is public domain.
+%
+\input eplain
+
+\hruledefaultheight = 4pt
+\hruledefaultdepth = 8pt
+
+\vruledefaultwidth = 36pt
+
+\vglue 1in
+
+\line{\leaders\ehrule\hfil gA}%
+
+\smallskip
+\ehrule
+\medskip
+
+\noindent \evrule \quad Greetings
+\smallskip
+\vbox to 3in{\leaders\evrule\vfil gB}
+
+\hbox to 40pt{\downbracefill} % uses \vrule
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/sidx.tex b/Master/texmf-dist/source/eplain/base/test/sidx.tex
new file mode 100644
index 00000000000..88041620f09
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/sidx.tex
@@ -0,0 +1,5 @@
+% This file is public domain.
+%
+\input eplain
+\sidx{help}
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/subdef.tex b/Master/texmf-dist/source/eplain/base/test/subdef.tex
new file mode 100644
index 00000000000..55d624b729a
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/subdef.tex
@@ -0,0 +1,24 @@
+% This file is public domain.
+%
+%Karl: on page 15 of the eplain manual (referring to subequation
+%formatting) you say
+% "Eplain's default definition just puts a period between them:"
+%However, when I run eplain (version 2.3 dated "Mon Mar 1 06:30:39 EST
+%1993") I get a colon ":" between the two. Below is a sample file.
+% Adam H. Lewenberg adam@math.uiuc.edu
+%%%%%%%%%%
+\input eplain %Version 2.3 "Mon Mar 1 06:30:39 EST 1993"
+
+$$5+5=10\eqdefn{ggg}$$
+$$4+5=10\eqsubdef{b-eq}$$
+
+\eqref{ggg} is correct and \eqrefn{b-eq} is incorrect.
+
+
+\end
+
+Date: Tue, 8 Jun 1993 09:46:11 -0500
+From: "Adam H. Lewenberg" <adam@symcom.math.uiuc.edu>
+To: karl@cs.umb.edu
+Subject: subeq referencing in eplain.tex (v. 2.3)
+Cc: adam@symcom.math.uiuc.edu
diff --git a/Master/texmf-dist/source/eplain/base/test/tenenb.tex b/Master/texmf-dist/source/eplain/base/test/tenenb.tex
new file mode 100644
index 00000000000..89cd534e55d
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/tenenb.tex
@@ -0,0 +1,48 @@
+% This file is public domain.
+%
+%Date: Sun, 7 Jan 2001 20:31:13 +0100
+%To: tex-eplain@tug.org
+%From: Gerald Tenenbaum <tenenb@arcturus.ciril.fr>
+%Subject: doublecolumns again
+%Cc:
+%Bcc:
+%X-Attachments:
+%
+%Hi,
+%
+%Here is a small file:
+%
+%*****************************
+\magnification1200
+\input eplain.tex
+\vsize30mm\hsize100mm
+
+This is an example of an apparent bug in {\tt $\backslash$doublecolumns}.
+This is an example of an apparent bug in {\tt
+$\backslash$doublecolumns}. This is
+an example of an apparent bug in {\tt $\backslash$doublecolumns}. This is an
+example of an apparent bug in {\tt $\backslash$doublecolumns}. This
+is an example
+of an apparent bug in {\tt $\backslash$doublecolumns}. This is an example of an
+apparent bug in {\tt $\backslash$doublecolumns}.
+\par
+\obeylines\doublecolumns
+item 1
+item 2
+item 3
+item 4
+item 5
+item 6
+ \singlecolumn
+\bye
+*************************************
+
+Has anyone an explanation for this bad behaviour and an idea for a fix?
+
+Best wishes,
+
+ Gérald
+
+
+
+
diff --git a/Master/texmf-dist/source/eplain/base/test/tenenb2.tex b/Master/texmf-dist/source/eplain/base/test/tenenb2.tex
new file mode 100644
index 00000000000..734299c3726
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/tenenb2.tex
@@ -0,0 +1,23 @@
+% This file is public domain.
+%
+% Gerald Tenenbaum, tenenb@arcturus.ciril.fr
+% 7 Jan 2001
+
+%\magnification 1200
+\input ../eplain
+\vsize 30mm
+\hsize 100mm
+
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+This is an example of an apparent bug in double columns.
+
+\doublecolumns
+This is an example of an apparent bug in double columns.
+\singlecolumn
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/test.tex b/Master/texmf-dist/source/eplain/base/test/test.tex
new file mode 100644
index 00000000000..779d8adf662
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/test.tex
@@ -0,0 +1,14 @@
+% This file is public domain.
+%
+\input ../eplain
+\input asibook.gst
+
+\comment The title is actually irrelevant: we don't do the title page.
+\title{Wavelets and their applications}
+
+\comment The other front stuff happens in asibook.gst's \producepreliminary,
+\comment which is called by virtue of the \part here.
+
+\backthing{test.index}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/time.tex b/Master/texmf-dist/source/eplain/base/test/time.tex
new file mode 100644
index 00000000000..90751506091
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/time.tex
@@ -0,0 +1,10 @@
+% This file is public domain.
+%
+\input eplain
+
+\timestring
+
+\time = 68
+\timestring
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/truemarg.tex b/Master/texmf-dist/source/eplain/base/test/truemarg.tex
new file mode 100644
index 00000000000..b057a86b94f
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/truemarg.tex
@@ -0,0 +1,36 @@
+% This file is public domain.
+%
+% Some code to test margin-setting macros in concert with
+% \magnification.
+
+\input ../eplain % margin altered version
+
+%\magnification=\magstep0
+%\magnification=\magstep1
+%\magnification=\magstep2
+\magnification=\magstep3
+
+
+\nopagenumbers
+
+\paperheight=11truein
+\paperwidth=8.5truein
+
+\topmargin=1truein
+\leftmargin=1truein
+\rightmargin=6truein
+\bottommargin=3truein
+
+\parindent=0pt
+
+\vbox to \vsize{
+\hrule depth4truept
+\vfill
+\centerline{Magnification = \the\mag}
+\vfill
+\hrule height4truept
+}
+
+
+\bye
+
diff --git a/Master/texmf-dist/source/eplain/base/test/uscore.bib b/Master/texmf-dist/source/eplain/base/test/uscore.bib
new file mode 100644
index 00000000000..82b7bcb07b1
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/uscore.bib
@@ -0,0 +1,5 @@
+% This file is public domain.
+
+@misc{bib_uscore,
+ title = "Underscore label"
+}
diff --git a/Master/texmf-dist/source/eplain/base/test/uscore.tex b/Master/texmf-dist/source/eplain/base/test/uscore.tex
new file mode 100644
index 00000000000..097230596e0
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/uscore.tex
@@ -0,0 +1,14 @@
+% This file is public domain.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+Define a label with an underscore in it. \xrdef{u_score}
+Refer to it: \xref{u_score}.
+
+Make a citation, too: \cite{bib_uscore}.
+
+\bibliographystyle{plain}
+\bibliography{uscore}
+
+\bye
+
diff --git a/Master/texmf-dist/source/eplain/base/test/usepackage.tex b/Master/texmf-dist/source/eplain/base/test/usepackage.tex
new file mode 100644
index 00000000000..ab797823fe7
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/usepackage.tex
@@ -0,0 +1,146 @@
+% This file is public domain.
+%
+% Test \usepackage with packages: color, graphicx, autopict, psfrag, url.
+\input ../eplain
+
+\beginpackages
+ \usepackage[dvipsnames]{color}
+ %\usepackage[draft,hidescale]{graphicx,autopict}\let\ttfamily\relax
+ \usepackage{graphicx,autopict}
+ \usepackage{psfrag}
+ \usepackage[obeyspaces,spaces]{url}[2005/06/27]
+\endpackages
+
+%\enablehyperlinks
+
+\ifpdf
+ \pdfpagewidth=8.5in
+ \pdfpageheight=11in
+\fi
+
+% The following redefinition works around a bug in pdftex.def v0.03m
+% related to \pagecolor.
+\ifpdf
+\makeatletter
+\ifx\GPT@outputbox\undefined
+\def\set@page@color{%
+ \@ifundefined{GPT@outputbox}{%
+ % \newbox is outer in plain
+ \csname newbox\endcsname\GPT@outputbox
+ }{}%
+ \global\let\current@page@color\current@color
+ \@ifundefined{GPTorg@shipout}{%
+ \global\let\GPTorg@shipout\shipout
+ \gdef\shipout{%
+ \afterassignment\GPT@shipout
+ \global\setbox\GPT@outputbox=%
+ }%
+ \gdef\GPT@shipout{%
+ \ifvoid\GPT@outputbox\relax
+ \aftergroup\GPT@@shipout
+ \GPT@pageliteral
+ \else
+ \GPTorg@shipout\vbox{%
+ \GPT@pageliteral
+ \box\GPT@outputbox
+ }%
+ \fi
+ }%
+ \gdef\GPT@@shipout{%
+ \GPTorg@shipout\box\GPT@outputbox\relax
+ }%
+ \gdef\GPT@pageliteral{%
+ \pdfliteral direct{%
+ q % gsave
+ \current@page@color\space
+ n % newpath
+ 0 0 \strip@pt\pdfpagewidth\space
+ \strip@pt\pdfpageheight\space re % rectangle
+ % there is no need to convert to bp
+ f % fill
+ Q% grestore
+ }%
+ }%
+ }{}%
+}
+\fi
+\resetatcatcode
+\fi
+
+
+\pagecolor[rgb]{.3,.8,.95}
+
+\centerline{\bf URL, color, rotation and scaling tests:}
+\smallskip
+
+{\color[rgb]{1,0.2,0.3} RGB-colored text. }Non-colored text.\par
+{\color[cmyk]{.2,.7,.5,.1}CMYK-colored text. }Non-colored text.\par
+{\color[gray]{.4} GRAY-colored text. }Non-colored text.\par
+\definecolor{refcolor}{cmyk}{0.28,1,1,0.35}
+{\color{refcolor}Defined color. }Non-colored text.\par
+\colorbox{green}{Green-colored box.}\par
+\colorbox[rgb]{1,0,0}{Red-colored box.}\par
+%\fcolorbox doesn't work because plain TeX does not have LaTeX's \fbox
+What is this:
+\rotatebox[origin=c]{180}{\reflectbox{\color[rgb]{.5,.3,.3}%
+ \hloff[url]\url{http : // tug . org / eplain}}}\par
+Example of a line break inside a URL: \url{http://www.this.is.some/very.very.very.long.URL/which.goes.on/and.on/and.on.html}\par
+\textcolor{red}{Predefined color `{\tt red}'. }Non-colored text.\par
+\rotatebox{20}{\scalebox{2}[5]{\color[named]{DarkOrchid}Rotated,
+ scaled, and colored text.}}\par
+\resizebox{1in}{\height}{Some text $\sum$.}
+ \resizebox*{1in}{\height}{Some text $\sum$.}
+ \resizebox{1in}{!}{Some text $\sum$.}\par
+
+
+\bigskip
+\centerline{\bf \LaTeX's picture environment:}
+\smallskip
+
+\picture(50,50)
+ \color{red}
+ \thicklines
+ \put(0,0){\line(1,1){50}}
+ \color{blue}
+ \put(40,0){\circle{50}}
+ \put(0,0){\vector(1,0){50}}
+ \color{green}
+ \put(20,0){\circle*{12}}
+ \put(55,40){\oval(80,70)[t]}
+ \color{black}
+ \put(55,40){\oval(50,30)}
+ \bezier{0}(10,10)(40,90)(110,90)
+ %\qbezier does not work
+ %\qbezier[0](10,10)(40,90)(110,90)
+\endpicture
+
+\LaTeXbegin
+
+\begin{picture}(40,40)
+\put(0,0){\vector(1,1){40}}
+\multiput(0,5)(10,10){4}{a}
+\end{picture}
+
+\vfil\eject
+
+
+\pagecolor[named]{SkyBlue}
+
+\centerline{\bf PSfrag test (uses {\tt example.eps} from the PSfrag package):}
+\smallskip
+
+\centerline{\includegraphics[width=3.5in]{example.eps}
+\quad
+\psfragscanon
+\psfrag*{p1}[][l]{$\ast$}
+\psfrag{p2}[][l]{$\ast$}
+\psfrag{p3}{$\cos(t)$}
+\includegraphics[width=3.5in]{example.eps}}
+
+
+\bye
+
+% Local variables:
+% compile-command: "(cd .. && make eplain.tex) && pdftex --interact=nonstopmode usepackage.tex"
+% compile-command: "(cd .. && make eplain.tex) && tex --interact=nonstopmode usepackage.tex && dvips -t letter usepackage.dvi -o"
+% End:
diff --git a/Master/texmf-dist/source/eplain/base/test/verb2.tex b/Master/texmf-dist/source/eplain/base/test/verb2.tex
new file mode 100644
index 00000000000..b3c7c4ad54c
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/verb2.tex
@@ -0,0 +1,61 @@
+% This file is public domain.
+%
+% Date: Wed, 30 Mar 94 09:50:27 CST
+% From: dorai@cs.rice.edu (Dorai Sitaram)
+% To: karl@cs.umb.edu
+% Subject: eplain 2.4's \verbatim: problem & fix
+
+\input eplain
+
+Testing Eplain's \verbatim verbatim|endverbatim
+
+\def\junk{{\it Some obviously $a^2+b^2$ non-verbatim stuff}}
+
+\bigskip\bigskip
+
+First let's test if the default | works
+
+\verbatim
+verbatim starts
+Some special chars:
+ !@#$%^&*()_+
+Now test if doubling works:
+ This line ends with a single ||
+Now test if I can use || to get non-verbatim stuff:
+ \junk
+verbatim ends
+|endverbatim
+
+\bigskip\bigskip
+
+Now let's try the same with escape set to \#.
+\verbatimescapechar\#
+
+\verbatim
+verbatim starts
+Some special chars:
+ !@$%^&*()_+
+Now test if doubling works:
+ This line ends with a single ##
+Now test if I can use ## to get non-verbatim stuff:
+ #junk
+verbatim ends
+#endverbatim
+
+\bigskip\bigskip
+
+Now with @.
+\verbatimescapechar\@
+
+\verbatim
+verbatim starts
+Some special chars:
+ !#$%^&*()_+
+Now test if doubling works:
+ This line ends with a single @@
+Now test if I can use @@ to get non-verbatim stuff:
+ @junk
+verbatim ends
+@endverbatim
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/verbatim.tex b/Master/texmf-dist/source/eplain/base/test/verbatim.tex
new file mode 100644
index 00000000000..677d0f3b176
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/verbatim.tex
@@ -0,0 +1,65 @@
+% This file is public domain.
+%
+\input eplain
+
+Leading spaces:
+
+\verbatim
+---T--T----
+One
+
+ Two
+
+ Three
+
+ Four
+
+Five
+|endverbatim
+
+The same again with spaces on empty lines:
+
+\verbatim
+---T--T----
+One
+
+ Two
+
+ Three
+
+ Four
+
+Five
+|endverbatim
+
+Now for some tabs:
+
+\verbatim
+--------T-------T
+One
+
+ Two
+
+ Three
+
+ Four
+
+Five
+
+|endverbatim
+
+Here is how you can get vertical bars into verbatim:
+
+\verbatim
+||!@#$%^&*()_-+=\~`{}[]:'';'<>?,./
+|endverbatim
+
+And here's you can use it in a paragraph:
+\verbatim middle%%%%|endverbatim. And this is the example from the
+manual, quoted with a leading space: `\verbatim| ||\#%&!|endverbatim'.
+
+Now we change the escape character to @ and have a leading space:
+\verbatimescapechar @
+`\verbatim@ @@|my what big teeth you have!@endverbatim'.
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/vlach.tex b/Master/texmf-dist/source/eplain/base/test/vlach.tex
new file mode 100644
index 00000000000..1aa8262d1b6
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/vlach.tex
@@ -0,0 +1,258 @@
+% This file is public domain.
+%
+%Date: Sun, 29 Nov 92 18:21:53 EST
+%From: avlach@cleveland.next.nd.edu (alan vlach)
+%To: Karl Berry <karl@ra.cs.umb.edu>
+%Subject: Re: eplain
+%
+%My problem occurs when I try to call \singlecolumn too quickly after
+%I have called \doublecolumns, which is probably bad style anyway, but
+%here's a sample file (below) so you can see what's happening.
+%
+%Put \singlecolumn just one paragraph later and everything works OK.
+%
+%Thanks for looking at this.
+%
+%Sincerely,
+%Alan Vlach
+%alan.d.vlach.1@nd.edu
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input eplain
+
+This is a dummy file just to show Karl Berry the problem I'm having.
+
+Here is a first paragraph of nonsense. Here is a first paragraph of
+nonsense. Here is a first paragraph of nonsense. Here is a first
+paragraph of nonsense. Here is a first paragraph of nonsense. Here is
+a first paragraph of nonsense. Here is a first paragraph of nonsense.
+Here is a first paragraph of nonsense. Here is a first paragraph of
+nonsense. Here is a first paragraph of nonsense. Here is a first
+paragraph of nonsense. Here is a first paragraph of nonsense. Here is
+a first paragraph of nonsense. Here is a first paragraph of nonsense.
+Here is a first paragraph of nonsense. Here is a first paragraph of
+nonsense.
+
+Here is another paragraph of nonsense. Here is another paragraph of
+nonsense. Here is another paragraph of nonsense. Here is another
+paragraph of nonsense. Here is another paragraph of nonsense. Here is
+another paragraph of nonsense. Here is another paragraph of nonsense.
+Here is another paragraph of nonsense. Here is another paragraph of
+nonsense. Here is another paragraph of nonsense. Here is another
+paragraph of nonsense. Here is another paragraph of nonsense. Here is
+another paragraph of nonsense. Here is another paragraph of nonsense.
+Here is another paragraph of nonsense. Here is another paragraph of
+nonsense. Here is another paragraph of nonsense. Here is another
+paragraph of nonsense. Here is another paragraph of nonsense. Here is
+another paragraph of nonsense. Here is another paragraph of nonsense.
+Here is another paragraph of nonsense. Here is another paragraph of
+nonsense. Here is another paragraph of nonsense. Here is another
+paragraph of nonsense. Here is another paragraph of nonsense. Here is
+another paragraph of nonsense. Here is another paragraph of nonsense.
+Here is another paragraph of nonsense. Here is another paragraph of
+nonsense. Here is another paragraph of nonsense. Here is another
+paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+\doublecolumns
+
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+And here is where the double columns begin.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+\singlecolumn
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+The single column resumes. The single column resumes.
+
+
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+Here is the $n^{\rm th}$ paragraph of nonsense.
+
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+This is the final paragraph. This is the final paragraph.
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/whitespc.tex b/Master/texmf-dist/source/eplain/base/test/whitespc.tex
new file mode 100644
index 00000000000..eb3ca0d6b3b
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/whitespc.tex
@@ -0,0 +1,51 @@
+% This file is public domain.
+%
+\ifx\eplain\undefined \input eplain \fi
+
+\vbox{\obeywhitespace Does it work in vbox ?}
+
+This is some normal text, in a normal paragraph, that's been indented in
+the normal way. Isn't that nice? The lines after the first aren't
+indented, as usual.
+
+This line is the start of a paragraph; the obeyed material is next. And
+it continues on the same line.
+{\obeywhitespace This is the start of the obeyed stuff.
+ And this one by a couple spaces more than the indentation.
+Back to the normal indentation--- some extra space there, did you notice?
+That's it.
+}
+This is the end of the paragraph with the obeyed stuff, and it shouldn't
+be indented, but it should start at the beginning of the line, since it
+continues the paragraph.
+
+{\obeywhitespace This obeyed material starts a paragraph.
+That line should have the normal indentation (so should this one).
+And this line ends with the closing brace to the group.}
+And this line continues the paragraph.
+
+{\obeywhitespace
+Some more obeyed material (and a newline after the control sequence):
+
+That was a blank line above.
+}
+
+That time no normal stuff continued the paragraph. It shouldn't have
+made any difference.
+Some more normal text, with spaces treated normally again.
+
+Here is some {\obeywhitespace obeyed stuff} in the middle of a line.
+And this {\obeywhitespace more stuff} has multiple spaces before
+the `more', that should be ignored.
+
+{\blanklineskipamount = -.5\baselineskip
+\obeywhitespace The blank line after this line
+
+should be half as much as the blank lines above and below.
+}
+
+{\obeywhitespace And now we should be
+
+back to normal.}
+
+\bye
diff --git a/Master/texmf-dist/source/eplain/base/test/xampl.tex b/Master/texmf-dist/source/eplain/base/test/xampl.tex
new file mode 100644
index 00000000000..4b6eaab3f3e
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/xampl.tex
@@ -0,0 +1,13 @@
+% This file is public domain.
+%
+% Test xampl.bib.
+%
+%\ifx\undefined\eplain \input eplain \fi
+\input btxmac
+
+\bibliography{xampl}
+\bibliographystyle{apalike}
+
+\nocite{*}
+
+\end
diff --git a/Master/texmf-dist/source/eplain/base/test/xref.tex b/Master/texmf-dist/source/eplain/base/test/xref.tex
new file mode 100644
index 00000000000..70096bd29e9
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/test/xref.tex
@@ -0,0 +1,39 @@
+% This file is public domain.
+%
+% Test file for cross-references.
+%
+\ifx\undefined\eplain \input eplain \fi
+
+\catcode`\_ = 2
+
+defining ``foo bar'':
+\xrdef{foo bar}.
+
+and also a `sect' (make that word `Section') label `s' to be `3.1':
+\definexref{s}{3.1}{sect}.
+\def\sectword{Section}
+
+Let's also define two labels with a numbers, ``label1'' and ``label2'':
+\xrdef{label1}\xrdef{label2}
+
+\vfill\eject
+
+defining ``foo baz''.
+\xrdef{foo baz}
+\vfill\eject
+
+Define something with all the other characters, including unprintable
+ones: \xrdef{1234567890)(@!`['";:]|<>,./?À-=+}.
+
+
+using everything (these should be page 1 and page 2):
+\xref{foo bar} and \xref{foo baz}.
+
+And now the ones with numbers (page 1): \xref{label1} and \xref{label2}.
+
+And now the weird one (page 3): \xref{1234567890)(@!`['";:]|<>,./?À-=+}.
+
+ref, refn, and refs on s: \ref{s}, \refn{s}, \refs{s}.
+
+And an undefined one: \xref{undefined}.
+\end
diff --git a/Master/texmf-dist/source/eplain/base/util/idxuniq b/Master/texmf-dist/source/eplain/base/util/idxuniq
new file mode 100644
index 00000000000..6ee7d225f5c
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/util/idxuniq
@@ -0,0 +1,37 @@
+#!/usr/bin/awk -f
+
+# (This file is public domain.)
+
+# This script filters input lines (which are expected to be a list of
+# `\indexentry' lines for MakeIndex) eliminating matching lines. The comparison
+# is done without regard to hyperlink label names (in the form `IDX*', where `*'
+# stands for a non-negative integer).
+
+# This has to be done to avoid terms which differ only in hyperlink label names
+# embedded into them, because MakeIndex will treat these otherwise identical
+# terms as distinct, listing more than once a page number for equivalent terms
+# on the same page.
+
+# `stripped' array is indexed by `\indexentry' lines stripped off the hyperlink
+# label name. For each term, we use its stripped version as a key into the
+# `stripped' array to increment its element. This records the fact that we have
+# seen the term with such key. Also, we add the (full) `\indexentry' line to
+# the `terms' array, but only if we have not yet seen a term with such key.
+
+# The idea was borrowed from Edition 3 of `GAWK: Effective AWK Programming: A
+# User's Guide for GNU Awk', which contains the following credit:
+
+# histsort.awk --- compact a shell history file
+# Thanks to Byron Rakitzis for the general idea
+
+{
+ temp = $0
+ sub (/{IDX[[:digit:]]+}/, "", temp)
+ if (stripped[temp]++ == 0)
+ terms[++count] = $0
+}
+
+END {
+ for (i = 1; i <= count; i++)
+ print terms[i]
+}
diff --git a/Master/texmf-dist/source/eplain/base/util/trimsee b/Master/texmf-dist/source/eplain/base/util/trimsee
new file mode 100644
index 00000000000..8af5ebe6434
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/util/trimsee
@@ -0,0 +1,106 @@
+#!/bin/sh
+
+# (This file is public domain.)
+
+help ()
+{
+ cat <<EOF
+Usage: trimsee [-i IS] [-o OS] [-s SEE]
+ trimsee {-h|--help|-v|--version}
+Remove commas (or other page list separators) in front
+of see / see also commands in the output of MakeIndex.
+Input is read from stdin, output is directed to stdout.
+
+-i IS use IS as a regular expression matching separator
+ in front of see / see also commands in the input
+ (default: '$DEFAULT_IS')
+-o OS use OS as a separator to replace IS in front of
+ see / see also commands (default: '$DEFAULT_OS')
+-s SEE use SEE as a regular expression matching see /
+ see also commands (default: '$DEFAULT_SEE')
+-h, --help show this help message
+-v, --version show version
+EOF
+}
+
+check_missing_arg ()
+{
+ if (( $1 < 2 )); then
+ echo "Missing argument to option '$2'" 1>&2
+ exit 1
+ fi
+}
+
+VERSION='0.1'
+
+DEFAULT_SEE='\\indexsee'
+DEFAULT_IS=', \+'
+DEFAULT_OS=' '
+
+SEE=$DEFAULT_SEE
+IS=$DEFAULT_IS
+OS=$DEFAULT_OS
+
+while [ $# != 0 ]
+do
+ case "$1" in
+ -i)
+ check_missing_arg $# "$1"
+ IS=$2
+ shift
+ ;;
+ -o)
+ check_missing_arg $# "$1"
+ OS=$2
+ shift
+ ;;
+ -s)
+ check_missing_arg $# "$1"
+ SEE=$2
+ shift
+ ;;
+ -h | --help)
+ help
+ exit 0
+ ;;
+ -v | --version)
+ echo "trimsee version $VERSION"
+ exit 0
+ ;;
+ *)
+ echo "Unknown option '$1'" 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+
+# The idea is to implement line output delayed by one line. When we
+# read next line, we check if it starts with a see/see also entry, and
+# if it does, we remove the comma at the end of the previous line
+# before printing it. We keep previous lines in the hold buffer.
+
+sed -n '
+
+# Remove all commas in front of see/see also inside each line.
+s/'"$IS$SEE/$OS$SEE"'/g
+
+# If this line does not start with see/see also, we will print the
+# previous line intact. NOTE: There are two characters inside the
+# brackets: a space and a tab.
+/^[ ]*'"$SEE"'/! { x; b PRINT; }
+
+# This line starts with see/see also, so remove comma at the end of
+# the previous line before we print it.
+x
+s/'"$IS"'$/'"$OS"'/
+
+# Print the previous line.
+:PRINT
+1! p
+
+# At the end of the input, print the last line.
+$ { x; p; }
+
+'
diff --git a/Master/texmf-dist/source/eplain/base/xeplain.tex b/Master/texmf-dist/source/eplain/base/xeplain.tex
new file mode 100644
index 00000000000..5464d27a82e
--- /dev/null
+++ b/Master/texmf-dist/source/eplain/base/xeplain.tex
@@ -0,0 +1,4783 @@
+% xeplain.tex: macros for nonformatting. Written 1989--94 by (mostly)
+% Karl Berry. Some additions/changes 1997--98 by Adam Lewenberg.
+% These macros are in the public domain.
+%
+% This is the ``extended plain'' TeX format that's described in
+% `eplain.texinfo', which you should have received with this file. We
+% assume plain has been loaded.
+%
+% N.B.: A version number is defined at the beginning and end of this file;
+% please change those numbers whenever the file is modified!
+% And it's best to rename the file if you're going to distribute a
+% modified version.
+%
+% Some macros were written and/or suggested by Paul Abrahams.
+% Other sources (e.g., The TeXbook) are cited at the appropriate places.
+%
+%% @texfile{
+%% author = "Karl Berry, Steven Smith, Oleg Katsitadze, and others",
+%% version = "REPLACE-WITH-VERSION",
+%% date = "REPLACE-WITH-DATE",
+%% filename = "xeplain.tex",
+%% email = "bug-eplain@tug.org",
+%% checksum = "REPLACE-WITH-CHECKSUM",
+%% codetable = "ASCII",
+%% supported = "yes",
+%% docstring = "This file defines macros that extend and expand on
+%% plain TeX. eplain.tex is xeplain.tex and the other
+%% source files with comments stripped; see the original
+%% files for author credits, etc. And please base diffs
+%% or other contributions on xeplain.tex, not the
+%% stripped-down eplain.tex.",
+%% }
+%
+%
+% Load eplain.tex only once (to avoid using up \new's).
+% \eplain is defined at the end of this file, so we can test \eplain to
+% detect whether eplain.tex has been loaded already or not.
+%
+% We use \expandafter because the merge script strips any lines
+% with an \endinput.
+%
+\ifx\eplain\undefined
+ \let\next\relax
+\else
+ \expandafter\let\expandafter\next\csname endinput\endcsname
+\fi
+\next
+% The ifpdf.sty file included below was written by Heiko Oberdiek.
+% See the complete source file (e.g., in this distribution) for
+% comments.
+%% [[[include ifpdf.sty]]]
+%
+%
+% Category codes, etc.
+%
+\def\makeactive#1{\catcode`#1 = \active \ignorespaces}%
+\chardef\letter = 11
+\chardef\other = 12
+% The following two macros were adopted from miniltx.tex of graphics.
+\def\makeatletter{%
+ \edef\resetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax}%
+ \catcode`\@11\relax
+}%
+\def\makeatother{%
+ \edef\resetatcatcode{\catcode`\noexpand\@\the\catcode`\@\relax}%
+ \catcode`\@12\relax
+}%
+%
+%
+% So we can have user-inaccessible control sequences.
+%
+\edef\leftdisplays{\the\catcode`@}%
+\catcode`@ = \letter
+\let\@eplainoldatcode = \leftdisplays
+%
+% Save miniscule amounts of memory and time by writing \toks@ii instead
+% of \toks2.
+\toksdef\toks@ii = 2
+%
+%
+% This macro is defined in The TeXbook, but it never made it
+% into plain TeX. \dospecials is defined there, though.
+%
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1 = \other}%
+ \dospecials
+}%
+%
+%
+% Here is a way to do \let^^M = \cs, where the \let need not be global.
+{%
+ \makeactive\^^M %
+ \long\gdef\letreturn#1{\let^^M = #1}%
+}%
+%
+%
+% Swallow parameters, etc.
+%
+\let\@eattoken = \relax % Define this, so \eattoken can be used in \edef.
+\def\eattoken{\let\@eattoken = }%
+\def\gobble#1{}%
+\def\gobbletwo#1#2{}%
+\def\gobblethree#1#2#3{}%
+%
+% We can't just use \empty as the identity function, since then outer
+% braces which would supposedly delimit the argument would define a group.
+\def\identity#1{#1}%
+%
+% True if #1 is the empty string, i.e., called like `\ifempty{}'.
+% Use notes:
+% So far, \ifempty works in the following cases:
+% 1. \ifempty{}\message{empty}\else\message{not empty}\fi --> empty
+% 2. \ifempty\undefined\message{empty}\else\message{not empty}\fi --> not empty
+% But does NOT work in the case
+% 3. \def\empty{}
+% \ifempty\empty\message{empty}\else\message{not empty}\fi --> not empty
+% Question: When should \ifempty be true?
+\def\@emptymarkA{\@emptymarkB}
+% The above line suggested by Stanislav Brabec.
+\def\ifempty#1{\@@ifempty #1\@emptymarkA\@emptymarkB}%
+\def\@@ifempty#1#2\@emptymarkB{\ifx #1\@emptymarkA}%
+%
+% Turn a definition into the characters that compose it. See
+% ``Sanitizing control sequences under \write'', by Ron Whitney, TUGboat
+% 11(4), p.620.
+\def\@gobblemeaning#1:->{}%
+\def\sanitize{\expandafter\@gobblemeaning\meaning}%
+%
+%
+% From p.308 of the TeXbook. This cannot be used in places where TeX
+% might be skipping tokens, e.g., in conditionals.
+%
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}%
+%
+%
+% \csname constructions come up an awful lot, so we save typing with the
+% following. (But the extra macro expansion does take time, so we don't
+% use these in frequently-executed code.)
+%
+\def\csn#1{\csname#1\endcsname}%
+\def\ece#1#2{\expandafter#1\csname#2\endcsname}%
+%
+%
+% \expandonce{TOKEN} abbreviates \expandafter\noexpand TOKEN.
+%
+\def\expandonce{\expandafter\noexpand}%
+%
+%
+% Don't show our register allocations in the log.
+%
+\let\@plainwlog = \wlog
+\let\wlog = \gobble
+%
+%
+% Make it convenient to put newlines in error messages.
+%
+\newlinechar = `^^J
+%
+%
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{\tracingcommands\tw@\tracingstats\tw@
+ \tracingpages\@ne\tracingoutput\@ne\tracinglostchars\@ne
+ \tracingmacros\tw@\tracingparagraphs\@ne\tracingrestores\@ne
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+% Show the complete contents of boxes.
+%
+\def\tracingboxes{\showboxbreadth = \maxdimen \showboxdepth = \maxdimen}%
+%
+% Don't trace anything, except restore \showbox... to plain's values.
+%
+\def\gtracingoff{\begingroup \globaldefs = 1 \tracingoff \endgroup}%
+\def\tracingoff{\tracingonline\z@\tracingcommands\z@\tracingstats\z@
+ \tracingpages\z@\tracingoutput\z@\tracinglostchars\z@
+ \tracingmacros\z@\tracingparagraphs\z@\tracingrestores\z@
+ \showboxbreadth5 \showboxdepth3
+}%
+%
+%
+% Definitions to produce actual `{' (et al.) characters in an output
+% file via \write. We omit the line break after the first }, since we
+% have no comment character at that point.
+%
+\begingroup
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \gdef\lbracechar[{]%
+ \gdef\rbracechar[}]%
+ \catcode`\% = \other
+ \gdef\percentchar[%]\endgroup
+%
+%
+% Leave horizontal mode (if we're in it), then insert a penalty.
+% And conversely.
+%
+\def\vpenalty{\ifhmode\par\fi \penalty}%
+\def\hpenalty{\ifvmode\leavevmode\fi \penalty}%
+%
+%
+% Make \else usable in \loop. From Victor Eijkhout's TeX by Topic (page
+% 104). See also Alois Kabelschacht, TUGboat 8(2), page 184.
+%
+\def\iterate{%
+ \let\loop@next\relax
+ \body
+ \let\loop@next\iterate
+ \fi
+ \loop@next
+}%
+%
+%
+% Add #2 (which is expanded in an \edef) to the end of the definition of
+% #1 (which must be a previously-defined control sequence). This is a
+% way to construct simple lists.
+%
+\def\edefappend#1#2{%
+ \toks@ = \expandafter{#1}%
+ \edef#1{\the\toks@ #2}%
+}%
+%
+%
+% \allowhyphens, from TeXbook, p. 395. Allows following & preceding word
+% to be hyphenated.
+%
+\def\allowhyphens{\nobreak\hskip\z@skip}%
+%
+%
+%
+% Hooks.
+%
+% \hookaction{HOOK}{TOKENS} adds TOKENS to the list of actions for
+% HOOK. We avoid defining a \toks register for each hook, although
+% maybe that isn't so important.
+%
+% \hookappend and \hookprepend add TOKENS specificially to the end or
+% the beginning. When the argument is used, \toks@ will be the previous
+% value of the hook, and \toks@ii the new tokens.
+%
+\long\def\hookprepend{\@hookassign{\the\toks@ii \the\toks@}}%
+\long\def\hookappend{\@hookassign{\the\toks@ \the\toks@ii}}%
+\let\hookaction = \hookappend % either one should be ok
+%
+%
+% \@hookassign{LAST-DEF}{HOOK}{TOKENS} makes \toks@ the previous value
+% of HOOK, and \toks@ii TOKENS, and then assigns the new value using
+% LASTDEF. We store the hook in a control sequence \@HOOKhook.
+%
+\long\def\@hookassign#1#2#3{%
+ % Make \toks@ be the expansion (to one level) of \@HOOKhook, or empty.
+ \expandafter\ifx\csname @#2hook\endcsname \relax
+ % If \@HOOKhook was undefined, let it be empty.
+ \toks@ = {}%
+ \else
+ % Otherwise, expand it to one level. We can't just assign from
+ % \expandafter{\csname ...} since then the \toks register would
+ % contain the control sequence, not its definition.
+ \expandafter\let\expandafter\temp \csname @#2hook\endcsname
+ \toks@ = \expandafter{\temp}%
+ \fi
+ \toks2 = {#3}% Don't expand the argument all the way.
+ \ece\edef{@#2hook}{#1}%
+}%
+%
+%
+% \hookactiononce{HOOK}\CS adds `\global\let\CS=\relax' to the
+% definition of \CS, then adds to HOOK. Thus, \CS is expanded the next
+% time HOOK is called, but then it goes away. This only works if \CS is
+% expandable, though.
+%
+\long\def\hookactiononce#1#2{%
+ \edefappend#2{\global\let\noexpand#2\relax}
+ \hookaction{#1}#2%
+}%
+%
+%
+% \hookrun{HOOKNAME} runs whatever actions have been defined for HOOK.
+%
+\def\hookrun#1{%
+ \expandafter\ifx\csname @#1hook\endcsname \relax \else
+ % Isn't this fun? We want to get rid of the \fi before expanding
+ % the actions, so that they can read what's coming up next.
+ \def\temp{\csname @#1hook\endcsname}%
+ \expandafter\temp
+ \fi
+}%
+%
+%
+%
+% Properties a la Lisp.
+%
+% \setproperty{ATOM}{PROPNAME}{VALUE} defines the property PROPNAME on the
+% ``atom'' ATOM to have VALUE.
+%
+\def\setproperty#1#2#3{\ece\edef{#1@p#2}{#3}}%
+\def\setpropertyglobal#1#2#3{\ece\xdef{#1@p#2}{#3}}%
+%
+%
+% \getproperty{ATOM}{PROPNAME} expands to the value of the property
+% PROPNAME on ATOM, or to nothing (i.e., \empty), if the property isn't
+% present.
+%
+\def\getproperty#1#2{%
+ \expandafter\ifx\csname#1@p#2\endcsname\relax
+ % then \empty
+ \else \csname#1@p#2\endcsname
+ \fi
+}%
+%
+%
+%
+% Macros to support BibTeX are in a separate file, btxmac.tex.
+%
+% (They are maintained separately, too, by Oren Patashnik,
+% opbibtex@cs.stanford.edu.) btxmac.tex also defines other macros we
+% want to use and make available.
+%
+% But not all people want to read the BibTeX macros, because of either
+% space or time considerations. Therefore, we look for \nobibtex,
+% which, if defined, causes btxmac.tex not to be read. But we still
+% have to get \tokstostring et al. defined---so eplain.tex contains
+% those definitions, automatically edited in from btxmac.tex. All the
+% documentation has been removed, so you must read btxmac.tex if you
+% want the comments.
+%
+%
+% We want to give a slightly different message than btxmac if no .aux
+% file exists (unless the person using us has already define some
+% message, possibly empty.)
+%
+\ifx\@undefinedmessage\@undefined
+ \def\@undefinedmessage
+ {No .aux file; I won't warn you about undefined labels.}%
+\fi
+%
+%
+% We use a token register to define all the BibTeX definitions, to avoid
+% problems with the \if... constructions when they are conditionally
+% read.
+%
+%% [[[here is the first set of common definitions from btxmac]]]
+\toks0 = {%
+ %% [[[here are the BibTeX-specific definitions from btxmac]]]
+}%
+\ifx\nobibtex\@undefined \the\toks0 \fi
+%% [[[here is the second set of common definitions from btxmac]]]
+%
+% Here are the control sequences that btxmac.tex defines using an @,
+% because btxmac.tex wants to absolutely minimize the chance of
+% conflicts. But these control sequence implement documented features
+% of eplain, so we want to allow people to use them without the @.
+%
+\let\auxfile = \@auxfile
+\let\for = \@for
+\let\futurenonspacelet = \@futurenonspacelet
+\def\iffileexists{\if@fileexists}%
+\let\innerdef = \@innerdef
+\let\innernewcount = \@innernewcount
+\let\innernewdimen = \@innernewdimen
+\let\innernewif = \@innernewif
+\let\innernewwrite = \@innernewwrite
+\let\linenumber = \@linenumber
+\let\readauxfile = \@readauxfile
+\let\spacesub = \@spacesub
+\let\testfileexistence = \@testfileexistence
+\let\writeaux = \@writeaux
+%
+%
+% btxmac.tex defines \innerdef. Let's use it to make an abbreviation
+% for \innerdef\inner<name>{<name>}.
+%
+\def\innerinnerdef#1{\expandafter\innerdef\csname inner#1\endcsname{#1}}%
+%
+% Use that in turn to make non-outer versions of the rest of plain TeX's
+% allocation macros. (btxmac.tex already did a few of them.)
+%
+\innerinnerdef{newbox}%
+\innerinnerdef{newfam}%
+\innerinnerdef{newhelp}%
+\innerinnerdef{newinsert}%
+\innerinnerdef{newlanguage}%
+\innerinnerdef{newmuskip}%
+\innerinnerdef{newread}%
+\innerinnerdef{newskip}%
+\innerinnerdef{newtoks}%
+%
+%
+% Besides doing a \write to the aux file, we also need to do an
+% \immediate\write.
+%
+\def\immediatewriteaux#1{%
+ \ifx\noauxfile\@undefined
+ \immediate\write\@auxfile{#1}%
+ \fi
+}%
+%
+%
+% We want \biblabelprint to define hyperlink destination. For that,
+% we save the label for the current bibliography entry from within
+% \bblitemhook.
+\def\bblitemhook#1{\gdef\@hlbblitemlabel{#1}}%
+%
+\def\biblabelprint#1{%
+ \noindent
+ \hbox to \biblabelwidth{%
+ \hldest@impl{bib}{\@hlbblitemlabel}%
+ \biblabelprecontents
+ \biblabelcontents{#1}%
+ \biblabelpostcontents
+ }%
+ \kern\biblabelextraspace
+}%
+% We want each citation item to be hyperlink to bibliography entry.
+% To avoid unnecessary warnings about undefined destinations (e.g.,
+% from pdfTeX), produce the link only when .bbl file (which does the
+% \hldest's) is present.
+\def\eplainprintcitepreitem#1{\hlstart@impl{cite}{#1}}%
+\def\eplainprintcitepostitem{\hlend@impl{cite}}%
+%
+%
+\def\printcitepreitem#1{%
+ \testfileexistence[\bblfilebasename]{bbl}%
+ \iffileexists
+ \global\let\printcitepreitem\eplainprintcitepreitem
+ \global\let\printcitepostitem\eplainprintcitepostitem
+ \else
+ \global\let\printcitepreitem\gobble
+ \global\let\printcitepostitem\relax
+ \fi
+ \printcitepreitem{#1}%
+}%
+%
+%
+%
+% Macros that produce output.
+%
+% \obeywhitespace makes both end-of-lines and spaces in the input be
+% respected in the output. Even spaces at the beginning of lines turn
+% into blank space the size of the natural space of the current font.
+% The reason why plain TeX's \obeyspaces does not do this last is that
+% it produces actual space characters, i.e., glue, and glue is discarded
+% at a(n output) line break, and so if line breaks in the input are
+% line breaks in the output...
+%
+% Tabs are not affected; they will still produce glue (a single space).
+%
+\begingroup
+ \makeactive\^^M \makeactive\ % No spaces or ^^M's from here on.
+\gdef\obeywhitespace{%
+\makeactive\^^M\def^^M{\par\futurelet\next\@finishobeyedreturn}%
+\makeactive\ \let =\ %
+%
+% The group we use here is the one \obeywhitespace must be enclosed in.
+% If we don't do this, then if the obeyed stuff ends in a newline, the
+% indent produced by the definition of ^^M will make that line indented,
+% even if it isn't the end of the paragraph.
+\aftergroup\@removebox%
+\futurelet\next\@finishobeywhitespace%
+}%
+%
+% \@finishobeywhitespace eats any spaces and/or the end-of-line after
+% the \obeywhitespace command itself. The group here is the one that it
+% itself creates.
+%
+\gdef\@finishobeywhitespace{{%
+\ifx\next %
+\aftergroup\@obeywhitespaceloop%
+\else\ifx\next^^M%
+\aftergroup\gobble%
+\fi\fi}}%
+%
+% \@finishobeyedreturn is invoked at the end of every input line. We
+% check if the next thing is also a return, and, if so, insert extra
+% space. Then we start the next line.
+%
+\gdef\@finishobeyedreturn{%
+\ifx\next^^M\vskip\blanklineskipamount\fi%
+\indent%
+}%
+\endgroup
+%
+% The argument here is the space that we are supposed to eat after the
+% \obeywhitespace command.
+%
+\def\@obeywhitespaceloop#1{\futurelet\next\@finishobeywhitespace}%
+%
+%
+% This removes the last box, if it was a empty box of width \parindent.
+% We might have been called inside a \vbox, so we have to test if we are
+% in horizontal mode before using \lastbox.
+%
+\def\@removebox{%
+ \ifhmode
+ \setbox0 = \lastbox
+ \ifdim\wd0=\parindent
+ \setbox2 = \hbox{\unhbox0}%
+ \ifdim\wd2=0pt
+ % Don't put it back: it was an indentation box.
+ % This \ignorespaces ignores spaces after the group.
+ \ignorespaces
+ \else
+ \box2 % Put it back: it wasn't empty.
+ \fi
+ \else
+ \box0 % Put it back: it wasn't the right width.
+ \fi
+ \fi
+}%
+%
+% We allow for extra (possibly negative) space when we hit blank lines.
+%
+\newskip\blanklineskipamount
+\blanklineskipamount = 0pt
+%
+%
+% A good way to print fractions in text when you don't want
+% to use \over (which should be most of the time), and yet
+% just `1/2' doesn't look right. (From the TeXbook,
+% the answer to exercise 11.6, p.311.)
+%
+\def\frac#1/#2{\leavevmode
+ \kern.1em \raise .5ex \hbox{\the\scriptfont0 #1}%
+ \kern-.1em $/$%
+ \kern-.15em \lower .25ex \hbox{\the\scriptfont0 #2}%
+}%
+%
+%
+% The `e' just means `Eplain', as in `Eplain's hrule'. The advantage
+% to using these is that you can change the default thickness.
+%
+\newdimen\hruledefaultheight \hruledefaultheight = 0.4pt
+\newdimen\hruledefaultdepth \hruledefaultdepth = 0.0pt
+\newdimen\vruledefaultwidth \vruledefaultwidth = 0.4pt
+%
+\def\ehrule{\hrule height\hruledefaultheight depth\hruledefaultdepth}%
+\def\evrule{\vrule width\vruledefaultwidth}%
+%
+%
+% The texnames.sty and path.sty files included below were originally
+% written by Nelson Beebe and Philip Taylor, respectively. See the
+% complete source files (e.g., in this distribution) for comments.
+%% [[[include texnames.sty]]]
+%% [[[include path.sty]]]
+%
+%
+% A square box, suitable for being a marker in lists.
+%
+\def\blackbox{\vrule height .8ex width .6ex depth -.2ex \relax}% square bullet
+%
+%
+% From p.311 of the TeXbook.
+%
+% Make an unfilled rectangle with the dimensions of \box0. #1 is the
+% height of the rules, #2 the depth (i.e., the thicknesses).
+%
+\def\makeblankbox#1#2{%
+ \ifvoid0
+ \errhelp = \@makeblankboxhelp
+ \errmessage{Box 0 is void}%
+ \fi
+ \hbox{\lower\dp0
+ \vbox{\hidehrule{#1}{#2}%
+ \kern -#1% overlap rules
+ \hbox to \wd0{\hidevrule{#1}{#2}%
+ \raise\ht0\vbox to #1{}% vrule height
+ \lower\dp0\vtop to #1{}% vrule depth
+ \hfil\hidevrule{#2}{#1}%
+ }%
+ \kern-#1\hidehrule{#2}{#1}%
+ }%
+ }%
+}%
+%
+\newhelp\@makeblankboxhelp{Assigning to the dimensions of a void^^J%
+ box has no effect. Do `\string\setbox0=\string\null' before you^^J%
+ define its dimensions.}%
+%
+%
+% Produce an hrule with height #1 and depth #2, and insert kerning so it
+% doesn't change the current position.
+%
+\def\hidehrule#1#2{\kern-#1\hrule height#1 depth#2 \kern-#2}%
+%
+% Produce a vrule with width #1+#2, kerning so as not to change the
+% current position.
+%
+\def\hidevrule#1#2{%
+ \kern-#1%
+ \dimen@=#1\advance\dimen@ by #2%
+ \vrule width\dimen@
+ \kern-#2%
+}%
+%
+%
+% The \boxit macro from the TeXbook, trivially generalized to allow
+% something other than 3pt around the TeX box being boxed.
+%
+\newdimen\boxitspace \boxitspace = 3pt
+%
+\long\def\boxit#1{%
+ \vbox{%
+ \ehrule
+ \hbox{%
+ \evrule
+ \kern\boxitspace
+ \vbox{\kern\boxitspace \parindent = 0pt #1\kern\boxitspace}%
+ \kern\boxitspace
+ \evrule
+ }%
+ \ehrule
+ }%
+}%
+%
+%
+% Produce the written-out form of a number.
+%
+\def\numbername#1{\ifcase#1%
+ zero%
+ \or one%
+ \or two%
+ \or three%
+ \or four%
+ \or five%
+ \or six%
+ \or seven%
+ \or eight%
+ \or nine%
+ \or ten%
+ \or #1%
+ \fi
+}%
+%
+% The following arrow macros were written by Steven Smith. See arrow.tex.
+\let\@plainnewif = \newif
+\let\@plainnewdimen = \newdimen
+\let\newif = \innernewif
+\let\newdimen = \innernewdimen
+\edef\@eplainoldandcode{\the\catcode`& }%
+\catcode`& = 11
+\toks0 = {%
+ %% [[[include arrow1]]]
+}%
+\catcode`& = 4
+\toks2 = {%
+ %% [[[include arrow2]]]
+}%
+\let\newif = \@plainnewif
+\let\newdimen = \@plainnewdimen
+\ifx\noarrow\@undefined \the\toks0 \the\toks2 \fi
+\catcode`& = \@eplainoldandcode
+%
+%
+%
+% Environments.
+%
+% Define an ``environment'': arbitrary text, enclosed by \begingroup and
+% \endgroup. But you get to label the group, so that if you forget an
+% \environment or an \endenvironment, you will probably get an error
+% message about it.
+%
+% Since the environment names appear in \errmessage arguments, it's best
+% to keep them to `letter' and `other' characters. I suppose we could
+% call \tokstostring to allow more general labels.
+%
+% These macros improve slightly on the answer to exercise 5.7 in
+% The TeXbook, by making some checks on \begingroup and \endgroup, as
+% well as just making sure \environment and \endenvironment's match.
+%
+%
+\def\environment#1{%
+ \ifx\@groupname\@undefined\else
+ % This gets invoked if we have two \environments (and no matching
+ % \endenvironment to the first) with an \endgroup in between.
+ \errhelp = \@unnamedendgrouphelp
+ \errmessage{`\@groupname' was not closed by \string\endenvironment}%
+ \fi
+ % Use \edef in case we are passed a macro that contains the name,
+ % instead of the name.
+ \edef\@groupname{#1}%
+ \begingroup
+ \let\@groupname = \@undefined
+}%
+%
+\def\endenvironment#1{%
+ \endgroup
+ \edef\@thearg{#1}%
+ \ifx\@groupname\@thearg
+ \else
+ \ifx\@groupname\@undefined
+ % Unfortunately, one gets an `extra \endgroup' message before
+ % seeing this. But we have to restore \@groupname, so I see no
+ % alternative.
+ \errhelp = \@isolatedendenvironmenthelp
+ \errmessage{Isolated \string\endenvironment\space for `#1'}%
+ \else
+ \errhelp = \@mismatchedenvironmenthelp
+ \errmessage{Environment `#1' ended, but `\@groupname' started}%
+ \endgroup % Probably a typo in the names.
+ \fi
+ \fi
+ \let\@groupname = \@undefined
+}%
+%
+\newhelp\@unnamedendgrouphelp{Most likely, you just forgot an^^J%
+ \string\endenvironment. Maybe you should try inserting another^^J%
+ \string\endgroup to recover.}%
+%
+\newhelp\@isolatedendenvironmenthelp{You ended an environment X, but^^J%
+ no \string\environment{X} to start it is anywhere in sight.^^J%
+ You might also be at an \string\endenvironment\space that would match^^J%
+ a \string\begingroup, i.e., you forgot an \string\endgroup.}%
+%
+\newhelp\@mismatchedenvironmenthelp{You started an environment named X, but^^J%
+ you ended one named Y. Maybe you made a typo in one^^J%
+ or the other of the names?}%
+%
+%
+% The above sort of environment allows nesting. But environments
+% shouldn't always be allowed to nest (like the \flushright,
+% \flushleft, and \center ones defined below). Here are some macros to
+% help deal with that.
+%
+% \checkenv goes at the beginning of a macro that is
+% going to define the environment.
+%
+\newif\ifenvironment
+\def\checkenv{\ifenvironment \errhelp = \@interwovenenvhelp
+ \errmessage{Interwoven environments}%
+ \egroup \fi
+}%
+%
+\newhelp\@interwovenenvhelp{Perhaps you forgot to end the previous^^J%
+ environment? I'm finishing off the current group,^^J%
+ hoping that will fix it.}%
+%
+%
+%
+% Mathematics displays.
+%
+% By default, TeX centers displayed material. To get left-justified
+% displays, say \leftdisplays. To go back to centered displays, say
+% \centereddisplays.
+%
+% This is based on an approach developed by Donald Arseneau,
+% asnd@triumfrg.bitnet.
+%
+\newtoks\previouseverydisplay
+% Here we want to make ordinary math displays flush left,
+% indented by the dimen \leftdisplayindent, which defaults
+% to \parindent.
+%
+% How do you want the first column aligned?
+\let\@leftleftfill\relax % as it was
+%\let\@leftleftfill\hfill % makes more sense, but could be too ugly
+%
+% Surely it makes more sense to not sum \leftdisplayindent+\parindent
+\newdimen\leftdisplayindent \leftdisplayindent=\parindent
+\newif\if@leftdisplays
+%
+\def\leftdisplays{%
+ \if@leftdisplays\else
+ \previouseverydisplay = \everydisplay
+ \everydisplay = {\the\previouseverydisplay \leftdisplaysetup}%
+ \let\@save@maybedisableeqno = \@maybedisableeqno
+ \let\@saveeqno = \eqno
+ \let\@saveleqno = \leqno
+ \let\@saveeqalignno = \eqalignno
+ \let\@saveleqalignno = \leqalignno
+ \let\@maybedisableeqno = \relax
+ \def\eqno{\hfill\textstyle\enspace}%
+ \def\leqno{%
+ \hfill
+ \hbox to0pt\bgroup
+ \kern-\displaywidth
+ % was: \kern-\displayindent % really \displayindent?
+ \kern-\leftdisplayindent % I'll use just \leftdisplayindent
+ $\aftergroup\@leftleqnoend % inserted after ending $
+ }%
+ \@redefinealignmentdisplays
+ \@leftdisplaystrue
+ \fi
+}%
+\newbox\@lignbox
+\newdimen\disprevdepth
+
+% In order to use $$ for left-aligned equation we have to
+% put something like \leftline{$\displaystyle ...$} in the
+% display. Then \eqno works basically like \hfill.
+% In order to make $$<assignments>\eqalignno{...}$$ work as
+% expected, including page breaks, we have to get rid of the
+% horizontal box, and un-vbox the alignment. Sadly, \unvbox
+% does not perform baselineskip handing, so we need to get
+% the \prevdepth ourselves...in order to get the prevdepth,
+% the outermost display must be an alignment display.
+% Therefore, an ordinary $$ a=b $$ becomes:
+% $$\halign{#\cr\noalign{\disprevdepth = \prevdepth
+% \leftline{$\displaystyle a=b$}
+% }}$$
+%
+\def\centereddisplays{%
+ % If \leftdisplays hasn't been called, don't try to restore all the
+ % stuff it changes.
+ %
+ \if@leftdisplays
+ \everydisplay = \previouseverydisplay
+ \let\@maybedisableeqno = \@save@maybedisableeqno
+ \let\eqno = \@saveeqno
+ \let\leqno = \@saveleqno
+ \let\eqalignno = \@saveeqalignno
+ \let\leqalignno = \@saveleqalignno
+ \@leftdisplaysfalse
+ \fi
+}%
+%
+\def\leftdisplaysetup{%
+% surely not this *and* \leftdisplayindent? : \dimen@ = \parindent
+ \dimen@ = \leftdisplayindent
+ \advance\dimen@ by \leftskip
+ \advance\displayindent by \dimen@
+ \advance\displaywidth by -\dimen@
+% this outermost alignment doesn't align anything.
+ \halign\bgroup##\cr \noalign\bgroup
+ \disprevdepth = \prevdepth
+ \setbox\z@ = \hbox to\displaywidth\bgroup
+ % Why strut?? \strut
+ % Why this?? \advance\hsize by -\displayindent
+ $\displaystyle
+ \aftergroup\@lefteqend % inserted after ending $
+}
+%
+\def\@lefteqend{% gets inserted between the ending $$
+ \hfil\egroup% end box 0
+ \@putdisplay}
+% gets inserted between trailing $$.
+\def\@leftleqnoend{\hss \egroup $}% end the \hbox to 0pt for \leqno, restore $
+%
+\def\@putdisplay{%
+ \ifvoid\@lignbox % Ordinary display; use it.
+ \moveright\displayindent\box\z@
+ \else % alignment display; unwrap alignment
+ \prevdepth = \dp\@lignbox % affects the skip *below*
+ \unvbox\@lignbox
+ \fi
+ \egroup\egroup % end \noalign, end outer \halign
+ $% restore first $ of trailing $$
+}
+%
+\def\@redefinealignmentdisplays{%
+ \def\displaylines##1{
+ \global\setbox\@lignbox\vbox{%
+ \prevdepth = \disprevdepth
+ \displ@y
+ \tabskip\displayindent
+ \halign{\hbox to\displaywidth
+ {$\@lign\displaystyle####\hfil$\hfil}\crcr
+ ##1\crcr}}}%
+ \def\eqalignno##1{%
+ \def\eqno{&}%
+ \global\setbox\@lignbox\vbox{%
+ \prevdepth = \disprevdepth
+ \displ@y
+ \advance\displaywidth by \displayindent
+ \tabskip\displayindent
+ \halign to\displaywidth{%
+ \hfil $\@lign\displaystyle{####}$\@leftleftfill\tabskip\z@skip
+ &$\@lign\displaystyle{{}####}$\hfil\tabskip\centering
+ &\llap{$\@lign####$}\tabskip\z@skip\crcr
+ ##1\crcr}}}%
+ \def\leqalignno##1{%
+ \def\eqno{&}%
+ \global\setbox\@lignbox\vbox{%
+ \prevdepth = \disprevdepth
+ \displ@y
+ \advance\displaywidth by \displayindent
+ \tabskip\displayindent
+ \halign to\displaywidth{%
+ \hfil $\@lign\displaystyle{####}$\@leftleftfill\tabskip\z@skip
+ &$\@lign\displaystyle{{}####}$\hfil\tabskip\centering
+ &\kern-\displaywidth
+% \showthe\displayindent \showthe\leftdisplayindent
+ \rlap{\kern\displayindent \kern-\leftdisplayindent$\@lign####$}%
+ \tabskip\displaywidth\crcr
+ ##1\crcr}}}%
+}%
+%
+% \noalign is typically used to insert a few words (`and', for example)
+% between two aligned equations. So I don't think the \noaligned
+% material should be indented. Since \noalign takes <vertical mode
+% material>, we would end up with double indentation, anyway: one
+% because we're indenting the whole display, and one at the start of the
+% <v.m.m.>. (If you want to change any of this, you can put something in
+% \@everynoalign.) So, we use this definition for \noalign in a
+% left-justified \eqalignno:
+%
+\let\@primitivenoalign = \noalign
+\newtoks\@everynoalign
+\def\@lefteqalignonoalign#1{%
+ \@primitivenoalign{%
+ % Is it right to set \leftskip=0pt first, thus perhaps making this
+ % work in lists and so forth? We just compensate for the other ways
+ % the display is indented here.
+ \advance\leftskip by -\parindent
+ \advance\leftskip by -\leftdisplayindent
+ \parskip = 0pt
+ %
+ % We use \parindent=0pt instead of \noindent because the latter
+ % starts unrestricted horizontal mode, which means the alignment
+ % we're inside will wind up being as wide as the page. When the arg
+ % is just vertical material, this is wrong. For example, using
+ % \matrix inside \eqalignno fails if \noindent is used.
+ \parindent = 0pt
+ \the\@everynoalign
+ #1%
+ }%
+}%
+%
+%
+%
+% Time macros.
+%
+% TeX sets \time, \day, \month, and \year when it begins. (And does not
+% update them as it runs!)
+%
+%
+% \monthname produces the name of the month, abbreviated to three
+% letters. The primitive \month should never be zero.
+%
+\def\monthname{%
+ \ifcase\month
+ \or Jan\or Feb\or Mar\or Apr\or May\or Jun%
+ \or Jul\or Aug\or Sep\or Oct\or Nov\or Dec%
+ \fi
+}%
+%
+% \fullmonthname is like \monthname, except it doesn't abbreviate.
+%
+\def\fullmonthname{%
+ \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
+}%
+%
+% \timestring produces the current time, in a format like `1:14 p.m.'.
+%
+\def\timestring{\begingroup
+ \count0 = \time
+ \divide\count0 by 60
+ \count2 = \count0 % The hour, from zero to 23.
+ %
+ \count4 = \time
+ \multiply\count0 by 60
+ \advance\count4 by -\count0 % The minute, from zero to 59.
+ % But we need the minutes with a leading zero, if necessary.
+ \ifnum\count4<10
+ \toks1 = {0}%
+ \else
+ \toks1 = {}%
+ \fi
+ %
+ % Convert the hour into `a.m.' or `p.m.', and make it mod 12.
+ \ifnum\count2<12
+ \toks0 = {a.m.}%
+ \else
+ \toks0 = {p.m.}%
+ \advance\count2 by -12
+ \fi
+ %
+ % If it's midnight, call it `12', not `0'.
+ \ifnum\count2=0
+ \count2 = 12
+ \fi
+ %
+ % Produce the output.
+ \number\count2:\the\toks1 \number\count4 \thinspace \the\toks0
+\endgroup}%
+%
+%
+% \timestamp produces a text string for the whole thing like
+% `23 Apr 1964 1:14 p.m.'.
+%
+\def\timestamp{\number\day\space\monthname\space\number\year\quad\timestring}%
+%
+%
+% \today produces the current date, as in `23 April 1964'.
+%
+\def\today{\the\day\ \fullmonthname\ \the\year}%
+%
+%
+%
+% (Typographical) lists.
+%
+% These macros can produce numbered or unnumbered lists.
+%
+% You can change the spacing by assigning new values to these registers.
+% They are used by both kinds of lists. \listleftindent is relative to
+% the current paragraph indentation, while \listrightindent is an
+% absolute value. I do this for two reasons: (1) it is more useful, if not
+% more ``logical'', to make list indentation depend on the paragraph
+% indentation; (2) footnotes do not work if \parindent is zero, and
+% having a footnote in a list item is perfectly reasonable.
+%
+% If you change \baselineskip and want \abovelistskip and \belowlistskip
+% to retain their meanings here, you will have to reassign to them. The
+% \baselineskip here is the value at the time eplain.tex is read, i.e.,
+% 12pt (most likely).
+%
+% If the items in your lists are very long, you might want to
+% make \interitemskipamount nonzero.
+%
+\newskip\abovelistskipamount \abovelistskipamount = .5\baselineskip
+ \newcount\abovelistpenalty \abovelistpenalty = 10000
+ \def\abovelistskip{\vpenalty\abovelistpenalty \vskip\abovelistskipamount}%
+\newskip\interitemskipamount \interitemskipamount = 0pt
+ \newcount\belowlistpenalty \belowlistpenalty = -50
+ \def\belowlistskip{\vpenalty\belowlistpenalty \vskip\belowlistskipamount}%
+\newskip\belowlistskipamount \belowlistskipamount = .5\baselineskip
+ \newcount\interitempenalty \interitempenalty = 0
+ \def\interitemskip{\vpenalty\interitempenalty \vskip\interitemskipamount}%
+\newdimen\listleftindent \listleftindent = 0pt
+\newdimen\listrightindent \listrightindent = 0pt
+\let\listmarkerspace = \enspace
+%
+% To do arbitrary things at the start of each list:
+\newtoks\everylist
+%
+% If you want no space between items for a particular list
+% (perhaps because the items in it are short), you can say,
+% e.g., \numberedlist\listcompact.
+%
+\def\listcompact{\interitemskipamount = 0pt \relax}%
+%
+% This is called to set up the parameters by both sorts of lists.
+% Because we set \rightskip, we finish off the current paragraph.
+%
+\newdimen\@listindent
+%
+\def\beginlist{%
+ % Insert the space above this list, before we change \leftskip
+ % (because the \vskip in here might be what ends the paragraph).
+ \abovelistskip
+ %
+ \@listindent = \parindent
+ \advance\@listindent by \listleftindent
+ %
+ % \leftskip shifts nested lists to the right on the page.
+ \advance\leftskip by \@listindent
+ \advance\rightskip by \listrightindent
+ %
+ % We always need \itemnumber, so we can know whether an item is the
+ % first one or not.
+ \itemnumber = 1
+ %
+ \the\everylist
+}%
+%
+% A list item, for both kinds of lists.
+%
+\def\li{\@getoptionalarg\@finli}%
+\def\@finli{%
+ % Save \@optionalarg in case \interitemskip garble it.
+ \let\@lioptarg\@optionalarg
+ % Write xref definition but do not define hyperlink destination
+ % (\printitem will do it).
+ \ifx\@lioptarg\empty \else
+ \begingroup
+ \@@hldestoff
+ \expandafter\writeitemxref\expandafter{\@lioptarg}%
+ \endgroup
+ \fi
+ \ifnum\itemnumber=1 \else \interitemskip \fi
+ % Add hyperlink destination in front of \marker before doing \printitem.
+ \begingroup
+ \ifx\@lioptarg\empty \else
+ \toks@ = \expandafter{\@lioptarg}%
+ \let\li@nohldest@marker\marker
+ \edef\marker{\noexpand\hldest@impl{li}{\the\toks@}\noexpand\li@nohldest@marker}%
+ \fi
+ \printitem
+ \endgroup
+ \advance\itemnumber by 1
+ \advance\itemletter by 1
+ \advance\itemromannumeral by 1
+ %
+ % Just in case somebody creeps in with an argument or something.
+ \ignorespaces
+}%
+%
+% \writeitemxref{LABEL} writes out a definition for LABEL to be \marker
+% for the aux file.
+%
+\def\writeitemxref#1{\definexref{#1}\marker{item}}%
+%
+% \printitem is used to print items by both sorts of lists. A \par gets
+% produced before every item -- even the first one. We also want to
+% make paragraphs after the first appear to be indented -- i.e., they
+% will have double indentation. It is usually bad exposition to have
+% lists with multiparagraph items, but sometimes it is unavoidable.
+%
+\def\printitem{%
+ \par
+ \nobreak
+ \vskip-\parskip
+ \noindent
+ \printmarker\marker
+}%
+%
+% Output the list marker.
+%
+\def\printmarker#1{\llap{\marker \enspace}}%
+%
+% Common ending.
+%
+\def\endlist{\belowlistskip}%
+%
+%
+% \numberedlist produces items which are numbered sequentially, starting
+% from one. You start items with \li (`list item'). End the list with
+% \endnumberedlist.
+%
+% A nested \numberedlist produces items labelled `(a)', `(b)', etc. A
+% doubly (and deeper) nested \numberedlist labels items with `*'.
+%
+% These registers keep track of where we are.
+%
+\newcount\numberedlistdepth
+\newcount\itemnumber
+\newcount\itemletter
+\newcount\itemromannumeral
+%
+\def\numberedmarker{%
+ \ifcase\numberedlistdepth
+ (impossible)%
+ \or \printitemnumber
+ \or \printitemletter
+ \or \printitemromannumeral
+ \else *%
+ \fi
+}%
+%
+% These produce the text of the labels. We use \the\itemletter so that
+% the value will expand.
+%
+\def\printitemnumber{\number\itemnumber}%
+\def\printitemletter{\char\the\itemletter}%
+\def\printitemromannumeral{\romannumeral\itemromannumeral}%
+\def\numberedprintmarker#1{\llap{#1) \listmarkerspace}}%
+%
+\def\numberedlist{\environment{@numbered-list}%
+ % This is set back to zero by getting to the end of the group.
+ \advance\numberedlistdepth by 1
+ \itemletter = `a
+ \itemromannumeral = 1
+ \beginlist
+ \let\marker = \numberedmarker
+ \let\printmarker = \numberedprintmarker
+}%
+%
+\def\endnumberedlist{%
+ \par
+ \endenvironment{@numbered-list}%
+ \endlist
+}%
+%
+% Allow synonyms for \numberedlist.
+\let\orderedlist = \numberedlist
+\let\endorderedlist = \endnumberedlist
+%
+%
+%
+% \unorderedlist produces items which are labelled with bullets. You
+% start an item with \li, just as with numbered lists. You end the list
+% with \endunorderedlist.
+%
+% A nested \unorderedlist produces items labelled with em-dashes. A
+% doubly (and deeper) nested \unorderedlist uses `*'.
+%
+\newcount\unorderedlistdepth
+%
+\def\unorderedmarker{%
+ \ifcase\unorderedlistdepth
+ (impossible)%
+ \or \blackbox
+ \or ---%
+ \else *%
+ \fi
+}%
+\def\unorderedprintmarker#1{\llap{#1\listmarkerspace}}%
+%
+\def\unorderedlist{\environment{@unordered-list}%
+ \advance\unorderedlistdepth by 1
+ \beginlist
+ \let\marker = \unorderedmarker
+ \let\printmarker = \unorderedprintmarker
+}%
+%
+\def\endunorderedlist{%
+ \par
+ \endenvironment{@unordered-list}%
+ \endlist
+}%
+%
+%
+%
+% Verbatim listing.
+%
+% ... well, almost verbatim. We assume the font \tt has all the
+% characters that will appear. Control characters, except for tabs and
+% form feeds (and returns) won't produce anything useful. Tabs produce
+% a fixed amount of space, and form feeds produce a page break.
+%
+% This is based on Knuth's ideas in Appendix D of the TeXbook, p. 380.
+% The argument should be a filename.
+%
+% if you need to do something more for your particular fonts and/or
+% environment before the file is input, give a definition to
+% \setuplistinghook. If you want line numbers on the output, you can
+% say \let\setuplistinghook = \linenumberedlisting.
+%
+\def\listing#1{%
+ \par \begingroup
+ \@setuplisting
+ \setuplistinghook
+ \input #1
+ \endgroup
+}%
+%
+\let\setuplistinghook = \relax
+%
+\def\linenumberedlisting{%
+ \ifx\lineno\undefined \innernewcount\lineno \fi
+ \lineno = 0
+ \everypar = {\advance\lineno by 1 \printlistinglineno}%
+}%
+\def\printlistinglineno{\llap{[\the\lineno]\quad}}%
+%
+%
+% \uncatcodespecials must come before \obeywhitespace, lest a space
+% character in the input produce character 32 from the \tt font.
+% Ensure ^^L is active and non-outer.
+%
+{%
+ \makeactive\^^L
+ \let^^L = \relax
+ \gdef\@setuplisting{%
+ \uncatcodespecials
+ \obeywhitespace
+ \makeactive\`
+ \makeactive\^^I
+ \makeactive\^^L
+ \def^^L{\vfill\break}%
+ \parskip = 0pt
+ \listingfont
+ }%
+}%
+\def\listingfont{\tt}%
+%
+% Give definitions to the characters we want to be special.
+%
+% Do ` separately, so can use ` in the \catcode commands elsewhere.
+%
+{%
+ \makeactive\`
+ \gdef`{\relax\lq}% Defeat ligatures.
+}%
+{%
+ \makeactive\^^I
+ \gdef^^I{\hskip8\fontdimen2\font \relax}%
+}%
+%
+%
+% \verbatim ... |endverbatim typesets the ... in typewriter. To produce a |
+% in the ..., use ||. This macro was contributed by beebe@math.utah.edu.
+% Generalized to characters other than | by dorai@cs.rice.edu.
+%
+\def\verbatimescapechar#1{%
+ \gdef\@makeverbatimescapechar{%
+ \@makeverbatimdoubleescape #1%
+ \catcode`#1 = 0
+ }%
+}%
+\def\@makeverbatimdoubleescape#1{%
+ \catcode`#1 = \other
+ \begingroup
+ \lccode`\* = `#1%
+ \lowercase{\endgroup \ece\def*{*}}%
+}%
+\verbatimescapechar\| % initially escapechar is |
+%
+\def\verbatim{\begingroup
+ \uncatcodespecials
+ \makeactive\` % make space character a single space, not stretchable
+ \@makeverbatimescapechar
+ \tt\obeywhitespace}
+\let\endverbatim = \endgroup
+%
+%
+%
+% Table of contents, list of figures, etc.
+%
+% Entries for the table of contents are recorded in \jobname.toc, which
+% we open for writing at the first \writetocentry. Actually, we use
+% \tocfilebasename for the root of the filename to read; \jobname is
+% the default.
+%
+\def\definecontentsfile#1{%
+ \ece\innernewwrite{#1file}%
+ \ece\innernewif{if@#1fileopened}%
+ \ece\let{#1filebasename} = \jobname
+ \ece\def{open#1file}{\opencontentsfile{#1}}%
+ \ece\def{write#1entry}{\writecontentsentry{#1}}%
+ \ece\def{writenumbered#1entry}{\writenumberedcontentsentry{#1}}%
+ \ece\innernewif{ifrewrite#1file} \csname rewrite#1filetrue\endcsname
+ \ece\def{read#1file}{\readcontentsfile{#1}}%
+}%
+%
+% We provide \opentocfile, \readtocfile, etc., by default.
+\definecontentsfile{toc}%
+%
+% And `toc' is just the argument to this macro.
+\def\opencontentsfile#1{%
+ \csname if@#1fileopened\endcsname \else
+ \ece{\immediate\openout}{#1file} = \csname #1filebasename\endcsname.#1
+ \ece\global{@#1fileopenedtrue}%
+ \fi
+}%
+%
+% \writetocentry#1#2 produces a line in the .toc file that
+% looks like:
+% \toc#1entry{#2}{page number}
+% e.g.,
+% \tocchapterentry{Introduction}{2}
+% would be written by
+% \writetocentry{chapter}{Introduction}
+% if the chapter started on page two.
+%
+% Thus, #1 is intended to be something like `chapter' or `section', #2
+% to be the text of the title.
+%
+% Of course, if you want, you can \write\tocfile yourself with whatever
+% you like. In that case, you must also call \opentocfile.
+%
+% By the way, it would be wrong to put a \percentchar at the end of the
+% output line. Then, when the .toc file is read, if each line is turned
+% into a \leftline, say, there would be no legal breakpoint between the
+% boxes, and one extremely long line would result.
+%
+% `toc' is the first argument to this; \writetocentry is defined by
+% \definecontentsfile.
+\def\writecontentsentry#1#2#3{\writenumberedcontentsentry{#1}{#2}{#3}{}}%
+%
+% Sometimes you want the control sequence to take another number (e.g.,
+% a chapter number) as a parameter. (Although you can pass anything you
+% want as the third parameter, naturally.) The third parameter is
+% expanded at the point of the \writenumberedtocentry, not when the
+% \write actually happens. This makes the usual case---the third
+% parameter being \the\someregister---work.
+%
+% For example:
+% \writenumberedtocentry{chapter}{The second chapter}{2}
+% would produce:
+% \tocchapterentry{The second chapter}{2}{14}
+%
+% if the second chapter started on page 14.
+%
+% `toc' is the first argument, as above.
+\def\writenumberedcontentsentry#1#2#3#4{%
+ \csname ifrewrite#1file\endcsname
+ \csname open#1file\endcsname
+ \toks0 = {\expandafter\noexpand \csname #1#2entry\endcsname}%
+ \def\temp{#3}%
+ %
+ % Usually #4 is just `\the\register', which we want to expand. But
+ % if it's not a number at all -- e.g., if it's an author's name, we
+ % don't want to expand control sequences for accents and the like.
+ % So we play some games here.
+ \toks2 = \expandafter{#4}%
+ \edef\cs{\the\toks2}%
+ \edef\@wr{%
+ \write\csname #1file\endcsname{%
+ \the\toks0 % the \toc...entry control sequence
+ {\sanitize\temp}% the text
+ \ifx\empty\cs\else {\sanitize\cs}\fi % A secondary number, or nothing:
+ {\noexpand\folio}% the page number
+ }%
+ }%
+ \@wr
+ \fi
+ \ignorespaces
+}%
+%
+% The entries are read in when the user invokes \readtocfile (which
+% should be before the first \writetocentry). We do not open the .toc
+% file to allow reading it in twice to make a short contents or some
+% such. This should not cause any problems because each of
+% \writecontentsentry and \writenumberedcontentsentry open the .toc
+% file for writing (i.e., empty it) before trying to write to it.
+\def\readcontentsfile#1{%
+ \edef\temp{%
+ \noexpand\testfileexistence[\csname #1filebasename\endcsname]{#1}%
+ }\temp
+ \if@fileexists
+ \input \csname #1filebasename\endcsname.#1\relax
+ \fi
+}%
+%
+% Here are some sample definitions of the \toc...entry macros. Perhaps
+% you or your book designer can come up with a better way of handling
+% contents than leaders. These definitions are just examples, not
+% something you might want to actually use to print a document.
+\def\tocchapterentry#1#2{\line{\bf #1 \dotfill\ #2}}%
+\def\tocsectionentry#1#2{\line{\quad\sl #1 \dotfill\ \rm #2}}%
+\def\tocsubsectionentry#1#2{\line{\qquad\rm #1 \dotfill\ #2}}%
+%
+%
+%
+% Cross-references.
+%
+% Definitions of references are recorded in \jobname.aux, called
+% \auxfile in the macros, which btxmac.tex has opened.
+%
+% When a label isn't defined, we only want to complain if
+% \xrefwarningtrue; btxmac uses \if@citewarning for this, so we have to
+% reuse that name. We can't just say \let\ifxrefwarning =
+% \if@citewarning, since then changes to the latter won't be reflected
+% in the former. On the other hand, we have to have a true \if...
+% command, so \if's and \fi's match properly. What a mess.
+%
+\let\ifxrefwarning = \iftrue
+\def\xrefwarningtrue{\@citewarningtrue \let\ifxrefwarning = \iftrue}%
+\def\xrefwarningfalse{\@citewarningfalse \let\ifxrefwarning = \iffalse}%
+%
+%
+% \xref{foo} produces ``p.\thinspace <page#>''. \xrefn{foo} produces
+% ``<page#>''. \xrdef{foo} produces nothing, but defines the label
+% `foo' to be on the current page.
+%
+% As usual, it takes two passes to get the cross-references right. I
+% would like to check for labels being defined twice, but I don't know
+% how to do that. If the cross-reference file has been read in, many
+% cross-references will be defined that I don't want to complain about.
+% It is only if two \xrdef commands are given to the same string that I
+% want to complain. I could define a new control sequence for each
+% cross-reference, and check that, but that seems like too high of a
+% price to pay.
+%
+%
+% \xrlabel{LABEL} expands to a cross-reference internal name. We append
+% an _ character to NAME, to help avoid conflicts. And we append an `x'
+% so that we don't redefine \_ on an empty label.
+%
+\begingroup
+ % Mike Spivak's MathTime macros for Times Roman fonts changes the
+ % catcode of _ to be active. Undo that. (From adam@symcom.math.uiuc.edu.)
+ \catcode`\_ = 8
+ \gdef\xrlabel#1{#1_x}%
+\endgroup
+%
+%
+% \xrdef{LABEL} defines LABEL to be the current page number. But we
+% don't define the label here, because the page number might be off: if
+% this is not the first time through, the label would already be
+% defined, and we would redefine it with the wrong information.
+%
+\def\xrdef#1{%
+ \begingroup
+ % Define hyperlink destination.
+ \hldest@impl{xrdef}{#1}%
+ % Define cross-reference but not hyperlink destination.
+ \begingroup
+ \@@hldestoff
+ \definexref{#1}{\noexpand\folio}{page}%
+ \endgroup
+ \endgroup
+}%
+%
+% \definexref{LABEL}{DEFINITION}{CLASS} defines a cross-reference named
+% LABEL of label class CLASS to be DEFINITION. (Or LABEL can be a
+% control sequence; it's expanded to get the label text.) To get a
+% possible page number right, we have to write the definition out to the
+% auxiliary file, instead of only defining it directly.
+%
+\def\definexref#1#2#3{%
+ % Define a hyperlink destination LABEL.
+ \hldest@impl{definexref}{#1}%
+ % Remember what we're given; it might be `\@optionalarg', which
+ % \readauxfile trashes. (No loss of generality here, since \csname
+ % will fully expand the label anyway.)
+ \edef\temp{#1}%
+ %
+ % Be sure we've read the aux file before we zap it:
+ \readauxfile
+ %
+ % When we read in the aux file next time, define the label:
+ \edef\@wr{\noexpand\writeaux{\string\@definelabel{\temp}{#2}{#3}}}%
+ \@wr
+ \ignorespaces
+}%
+%
+% \@definelabel{LABEL}{DEFINITION}{CLASS} actually defines LABEL of
+% label class CLASS to be DEFINITION.
+%
+\def\@definelabel#1#2#3{%
+ % Define the control sequence.
+ \expandafter\gdef\csname\xrlabel{#1}\endcsname{#2}%
+ %
+ % Remember what kind of label this is, so \ref will know what to do.
+% \global\setproperty{\xrlabel{#1}}{class}{#3}%
+ \setpropertyglobal{\xrlabel{#1}}{class}{#3}%
+}%
+%
+% \reftie is used by several cross-referencing macros to separate
+% optional text from label reference. \refspace is used by \ref to
+% separate optional text from \CLASSword and by \xref to separate
+% optional text from `p. '.
+%
+\def\reftie{\penalty\@M \ }% Do not rely on `~' being defined as a tie.
+\let\refspace\
+%
+% Typeset a reference to the label #1. If optional argument is
+% present it will be tied with \reftie to the reference and become
+% part of the hyperlink.
+%
+\def\xrefn{\@getoptionalarg\@finxrefn}%
+\def\@finxrefn#1{%
+ % Hyperlink and optional TEXT.
+ \hlstart@impl{ref}{#1}%
+ \ifx\@optionalarg\empty \else
+ % Save \@optionalarg before it is trashed by \readauxfile.
+ \let\@xrefnoptarg\@optionalarg
+ % Read .aux file -- \@optionalarg may contain cross-references.
+ \readauxfile
+ % Typeset the \@optionalarg
+ {\@@hloff\@xrefnoptarg}\reftie
+ \fi
+ % Typeset the reference.
+ \plain@xrefn{#1}%
+ \hlend@impl{ref}%
+}%
+% This is equivalent to \xrefn but without the hyperlink stuff and the
+% optional parameter so that its expansion does not contain the many
+% \let's, \def's and such which the expansion of \xrefn contains. It
+% is needed by \eqdefn and \eqsubdefn to be able to `cleanly' write
+% texts of equation labels to .aux file. It is also used when
+% functionality of \xrefn is needed without the hyperlink and the
+% optional parameter.
+\def\plain@xrefn#1{%
+ \readauxfile
+ %
+ \expandafter \ifx\csname\xrlabel{#1}\endcsname\relax
+ \if@citewarning
+ \message{\linenumber Undefined label `#1'.}%
+ \fi
+ %
+ % Give it a dummy definition, though, to stop multiple error messages.
+ \expandafter\def\csname\xrlabel{#1}\endcsname{%
+ `{\tt
+ \escapechar = -1
+ \expandafter\string\csname#1\endcsname
+ }'%
+ }%
+ \fi
+ \csname\xrlabel{#1}\endcsname % Always produce something.
+}%
+%
+% \refn is just a synonym.
+%
+\let\refn = \xrefn
+%
+% One common case: print `p. ' before the page number.
+%
+\def\xrefpageword{p.\thinspace}%
+%
+\def\xref{\@getoptionalarg\@finxref}%
+\def\@finxref#1{%
+ % Hyperlink and optional TEXT.
+ \hlstart@impl{xref}{#1}%
+ \ifx\@optionalarg\empty \else
+ {\@@hloff\@optionalarg}\refspace
+ \fi
+ % Typeset page reference but omit hyperlink.
+ \xrefpageword\plain@xrefn{#1}%
+ \hlend@impl{xref}%
+}%
+%
+% \ref[TEXT]{LABEL} typesets TEXT, \CLASSword for LABEL's class (if it's defined)
+% and then does \refn on LABEL. But amstex also has a \ref, so tell the
+% user if they try to use \ref and have loaded amsppt.sty.
+%
+% \refs{LABEL} is similar, but puts the letter `s' after the \...word, thus
+% producing (for example) `Figures 1.2' (presumably to be followed by
+% `and~\refn{fig-1.3}').
+%
+% Note that \ref takes an optional TEXT, while \refs does not. This
+% text (together with \CLASSword) will become part of the hyperlink
+% generated by \ref. \refs does not include \CLASSword in the
+% hyperlink.
+%
+\def\@maybewarnref{%
+ \ifundefined{amsppt.sty}%
+ % No amsppt.sty, so just use ours.
+ \else
+ \message{Warning: amsppt.sty and Eplain both define \string\ref. See
+ the Eplain manual.}%
+ % Remember their definition.
+ \let\amsref = \ref
+ \fi
+ \let\ref = \eplainref
+ \ref
+}
+\let\ref = \@maybewarnref
+%
+\def\eplainref{\@getoptionalarg\@fineplainref}%
+\def\@fineplainref{\@generalref{1}{}}%
+\def\refs{\let\@optionalarg\empty \@generalref{0}s}%
+%
+% #1 is an integer flag which tells whether hyperlink should include
+% \@optionalarg and class word (non-0) or not (0). #2 is the text to
+% follow the \...word. Both #1 and #2 are supplied by the macros
+% above. #3 comes from the document, and is the LABEL.
+%
+% \reftie separates \@optionalarg or \..word from \refn; \refspace
+% separates \@optionalarg from \..word.
+%
+\def\@generalref#1#2#3{%
+ % Save \@optionalarg before it is trashed by \readauxfile.
+ \let\@generalrefoptarg\@optionalarg
+ \readauxfile
+ % Maybe start hyperlink here.
+ \ifcase#1 \else \hlstart@impl{ref}{#3}\fi
+ % Get the class of the label.
+ \edef\temp{\getproperty{\xrlabel{#3}}{class}}%
+ % If the word for this class is not defined, don't complain.
+ \expandafter\ifx\csname \temp word\endcsname\relax
+ % Produce \@optionalarg followed by a \reftie, if \@optionalarg is
+ % not empty.
+ \ifx\@generalrefoptarg\empty \else {\@@hloff\@generalrefoptarg\reftie}\fi
+ \else
+ \begingroup
+ \@@hloff
+ % Produce \@optionalarg, if not empty, followed by a \refspace.
+ \ifx\@generalrefoptarg\empty \else \@generalrefoptarg \refspace \fi
+ % Produce the word.
+ \csname \temp word\endcsname
+ % Add the suffix and then put in a \reftie before the \refn.
+ #2\reftie
+ \endgroup
+ \fi
+ % Maybe start hyperlink here.
+ \ifcase#1 \hlstart@impl{ref}{#3}\fi
+ % Typeset the reference omitting hyperlinks.
+ \plain@xrefn{#3}%
+ \hlend@impl{ref}%
+}%
+%
+%
+% References to equations are similar.
+%
+% \eqref{foo} produces ``(<text for equation label foo>)''.
+% \eqdefn{foo} advances \eqnumber, resets \eqsubnumber, and defines
+% `foo' to be the new number.
+% \eqsubdefn{foo} advances \eqsubnumber and defines `foo'. \eqref works
+% for both equations and subequations,
+% \eqdef{foo} does \eqdefn, then inserts an \eqno and \eqref.
+% \eqsubdef{foo} does \eqsubdefn, then what \eqdef does.
+%
+% The non-``sub'' macros also take an optional argument; if it's
+% present, we use it as the text for the equation label, instead of the
+% various counters.
+%
+% Because there are no page break issues with equations, we can
+% immediately define the control sequence. But we also need to write
+% the definition out, in case the user wants to forward reference an
+% equation (bad style as that may be).
+%
+% The current equation number is in \eqnumber; we just advance it by one
+% for each \eqdef. You can handle fancier equation numbers (e.g., ones
+% that include a chapter number) by redefining \eqprint, below, and
+% using your own counters. We do provide for one level of substructure,
+% since that's more painful to implement than superstructures.
+%
+\newcount\eqnumber
+\newcount\subeqnumber
+%
+%
+% \eqdefn[TEXT]{LABEL} defines LABEL to be TEXT (if it's present),
+% otherwise it advances \eqnumber and defines LABEL to be that. It
+% doesn't produce anything.
+%
+\def\eqdefn{\@getoptionalarg\@fineqdefn}%
+\def\@fineqdefn#1{%
+ \ifx\@optionalarg\empty
+ \global\advance\eqnumber by 1
+ % We call \eqconstruct here instead of in \@eqdefn because we don't
+ % want to expand it for \eqsubdefn -- \eqsubdefn already includes an
+ % \eqrefn which includes the text of the label which was \eqconstructed.
+ \def\temp{\eqconstruct{\number\eqnumber}}%
+ \else
+ % In the next \def there is (I believe) a spurious \noexpand.
+ % I leave in the old definition, albeit commented out, in case the
+ % \noexpand really _is_ necessary. But I don't thikn so. Adam Lewenberg
+% \def\temp{\noexpand\@optionalarg}%
+ \def\temp{\@optionalarg}%
+ \fi
+ %
+ % Always reset the current subequation number:
+ \global\subeqnumber = 0
+ %
+ % Remember this label, so that we can define subequations:
+ \gdef\@currenteqlabel{#1}%
+ \toks0 = \expandafter{\@currenteqlabel}%
+ %
+ % Actually do the definition, replacing \xrefn and \eqrefn with
+ % \plain@xrefn and taking precautions not to expand \plain@xrefn
+ % in what we output to the aux file. \plain@xrefn expands to many things,
+ % including \count@'s and \edef's and the expansion of \xrlabel, and
+ % it's just a real mess.
+ \begingroup
+ \def\eqrefn{\noexpand\plain@xrefn}%
+ \def\xrefn{\noexpand\plain@xrefn}%
+ \edef\temp{\noexpand\@eqdefn{\the\toks0}{\temp}}%
+ \temp
+ \endgroup
+}%
+%
+%
+% \eqsubdefn defines its argument as a ``subequation'' of the last \eqdef.
+%
+\def\eqsubdefn#1{%
+ \global\advance\subeqnumber by 1
+ \toks0 = {#1}%
+ %
+ % Get the text of the label;
+ \toks2 = \expandafter{\@currenteqlabel}%
+ %
+ % We must expand \@currenteqlabel. We have to not expand
+ % \eqsubreftext here, as well as \plain@xrefn (which we substitute
+ % for \eqrefn and \xrefn), since the first arg to \eqsubreftext
+ % could also include lots of complicated things.
+ \begingroup
+ \def\eqrefn{\noexpand\plain@xrefn}%
+ \def\xrefn{\noexpand\plain@xrefn}%
+ \def\eqsubreftext{\noexpand\eqsubreftext}%
+ \edef\temp{%
+ \noexpand\@eqdefn
+ {\the\toks0}%
+ {\eqsubreftext{\eqrefn{\the\toks2}}{\the\subeqnumber}}%
+ }%
+ \temp
+ \endgroup
+}%
+%
+% \@eqdefn{LABEL}{REF-TEXT} actually handles the equation number
+% definitions and writing to the aux file.
+%
+% In contrast to \xrdef, we define LABEL right away (as REF-TEXT). We
+% can do this since we know right now what the right equation number is.
+% This eliminates some unnecessary warning. It also lets the user put
+% \eqdef{} on all equations and have it work, since then \eqref
+% refers to the just-defined new value.
+%
+\def\@eqdefn#1#2{%
+ % Define hyperlink destination taking care of empty LABEL.
+ \hl@define@eqlabel{#1}%
+ \hldest@impl{eq}{\hl@eqlabel}%
+ % Define cross-reference but not hyperlink destination.
+ \begingroup
+ \@@hldestoff
+ \definexref{#1}{#2}{eq}%
+ \endgroup
+ % Define the LABEL.
+ \@definelabel{#1}{#2}{eq}%
+}%
+%
+% \eqdef{LABEL} defines LABEL, with \eqdefn, then prints it. We allow
+% an optional argument to explicitly specify the text which we define
+% the label as.
+%
+\def\eqdef{\@getoptionalarg\@fineqdef}%
+\def\@fineqdef{%
+ \toks0 = \expandafter{\@optionalarg}%
+ \edef\temp{\noexpand\@eqdef{\noexpand\eqdefn[\the\toks0]}}%
+ \temp
+}%
+%
+% \eqsubdef is to \eqdef as \eqsubdefn is to \eqdefn. No optional
+% argument allowed here.
+%
+\def\eqsubdef{\@eqdef\eqsubdefn}%
+%
+% \@eqdef{DEFN-CMD}{LABEL} defines LABEL, using DEFN-CMD. Then it
+% inserts an \eqno (unless it's called when an \eqno would be invalid).
+% Then it prints the newly-defined value using \eqprint.
+%
+\def\@eqdef#1#2{%
+ % Define the label but not hyperlink destination (we want to define
+ % the destination after \eqno). Note that \@eqdefn will call
+ % \hl@define@eqlabel{#2}, so we won't call it again (definintions in
+ % \hl@define@eqlabel must be global to survive past the group).
+ \begingroup
+ \@@hldestoff
+ #1{#2}%
+ \endgroup
+ % Define hyperlink destination and print the text.
+ \@maybedisableeqno
+ \eqno % \hl@define@eqlabel already called in \@eqdefn.
+ \hldest@impl{eq}{\hl@eqlabel}%
+ \let\@optionalarg\empty % \@fineqref will examine \@optionalarg.
+ {\@@hloff\@fineqref{#2}}% No hyperlink here.
+ \@mayberestoreeqno
+ \ignorespaces
+}%
+%
+%
+% If we are in an alignment or some other inner place, \eqno won't work.
+%
+\let\@mayberestoreeqno = \relax
+%
+\def\@maybedisableeqno{%
+ \ifinner
+ \global\let\eqno = \relax
+ \global\let\@mayberestoreeqno = \@restoreeqno
+ \fi
+}%
+%
+% This makes `\eqno' mean \eqno again.
+%
+\let\@primitiveeqno = \eqno
+\def\@restoreeqno{%
+ \global\let\eqno = \@primitiveeqno
+ \global\let\@mayberestoreeqno = \empty
+}%
+%
+%
+% \eqrefn[TEXT]{LABEL} produces the text for the equation label LABEL, or
+% something suitable if LABEL is undefined. (It possibly issues a
+% warning in the latter case as well.) TEXT followed by a \reftie is
+% prepended to the equation text as part of the hyperlink.
+%
+\def\eqrefn{\@getoptionalarg\@fineqrefn}%
+\def\@fineqrefn#1{%
+ \eqref@start{#1}%
+ % Typeset the equation reference but do not produce hyperlink.
+ \plain@xrefn{#1}%
+ \hlend
+}%
+%
+% \eqref[TEXT]{LABEL} is the usual way to refer to equation labels; it
+% calls \eqprint on the text of LABEL, prepending it with TEXT and a
+% \reftie as part of the hyperlink.
+%
+\def\eqref{\@getoptionalarg\@fineqref}%
+\def\@fineqref#1{%
+ \eqref@start{#1}%
+ % Typeset the equation reference but do not produce hyperlink.
+ \eqprint{\plain@xrefn{#1}}%
+ \hlend@impl{eq}%
+}%
+% Common code executed at the start of \@fineqrefn and \@fineqref.
+\def\eqref@start#1{%
+ % Save \@optionalarg in case \phantomeqlabel is redefined by the
+ % user to something that trashes it.
+ \let\@eqrefoptarg\@optionalarg
+ % Hyperlink (fetch last `phantom' equation label if LABEL is empty).
+ \ifempty{#1}%
+ \hlstart@impl{eq}{\phantomeqlabel}%
+ \else
+ \hlstart@impl{eq}{#1}%
+ \fi
+ % Optional TEXT followed by a \reftie.
+ \ifx\@eqrefoptarg\empty \else
+ {\@@hloff\@eqrefoptarg\reftie}%
+ \fi
+}%
+%
+%
+% \eqconstruct{EQ-TEXT} constructs an equation number, i.e., the text to
+% be defined as the value of a label.
+%
+\let\eqconstruct = \identity
+%
+% \eqprint{EQ-TEXT} produces the typeset equation number EQ-TEXT.
+%
+\def\eqprint#1{(#1)}%
+%
+% \eqsubreftext{EQ-TEXT}{SUBEQ-TEXT} produces the text of a subequation
+% reference. (\eqprint is later called on the result of this to produce
+% output for subequations; I didn't define any \subeqprint.)
+%
+\def\eqsubreftext#1#2{#1.#2}%
+%
+%
+%
+% Indexing.
+%
+% \defineindex{PREFIX} defines an index with ``prefix'' PREFIX. The
+% prefix is used to construct the output filename and the various
+% commands. We just define all the index commands for this index to
+% call the general commands with PREFIX.
+%
+\let\extraidxcmdsuffixes = \empty
+%
+\outer\def\defineindex#1{%
+ \def\@idxprefix{#1}%
+ %
+ % Define the indexing commands for this prefix.
+ \for\@idxcmd:=,marked,submarked,name%
+ \extraidxcmdsuffixes\do
+ {%
+ \@defineindexcmd\@idxcmd
+ }%
+ %
+ % Allocate a stream for the output.
+ \ece\innernewwrite{@#1indexfile}%
+ %
+ % And a conditional to test whether we've opened the file.
+ \ece\innernewif{if@#1indexfileopened}%
+}%
+%
+%
+% \@defineindexcmd{SUFFIX} defines both silent and non-silent index
+% command for prefix \@idxprefix with suffix SUFFIX. That is, we define
+% both `\@idxprefix dxSUFFIX' and `\s\@idxprefix dxSUFFIX' to call the
+% corresponding generic command with \@idxprefix. \silentindexentry is
+% used to decide whether we should ignore following spaces.
+%
+\newif\ifsilentindexentry
+%
+\def\@defineindexcmd#1{%
+ \@defineoneindexcmd{s}{#1}\silentindexentrytrue
+ \@defineoneindexcmd{}{#1}\silentindexentryfalse
+}%
+%
+%
+% \@defineoneindexcmd{PREFIX}{SUFFIX}{PRECALL} does just one silent or
+% non-silent commands. We define the command `\@@PREFIXidxSUFFIX' to do
+% PRECALL, then define \@idxprefix, then call \@idxgetrange with an
+% argument of `\@@{,s}idxSUFFIX'. (So far every indexing command
+% should allow a range. If not, you could redefine `\@@{,s}idxSUFFIX'
+% after this macro is called.)
+%
+\def\@defineoneindexcmd#1#2#3{%
+ \toks@ = {#3}%
+ \edef\temp{%
+ \def
+ % We have to restrict expansion because the generic (\@@...)
+ % commands will be defined after the first call to \defineindex.
+ % Not expanding the user (\idx...) commands is unnecessary unless
+ % the user has defined some new commands, but may as well be cautious.
+ \expandonce\csname#1\@idxprefix dx#2\endcsname % e.g., \idx or \sidxname.
+ {\def\noexpand\@idxprefix{\@idxprefix}% define \@idxprefix
+ % call, e.g., \@@idx or \@@sidxname:
+ \expandonce\csname @@#1idx#2\endcsname
+ }%
+ \def
+ \expandonce\csname @@#1idx#2\endcsname{% e.g., \@@idx
+ % First do PRECALL.
+ \the\toks@
+ % Then call \@idxgetrange with, e.g., \@idx or \@sidxname as its arg.
+ \noexpand\@idxgetrange\expandonce\csname @#1idx#2\endcsname
+ }%
+ }%
+ \temp
+}%
+%
+%
+% \@idxwrite{TERM}{PAGENO} writes a general index entry for TERM on page
+% PAGENO to the index file `\@idxprefix indexfile'. We open the stream
+% as `\indexfilebasename.\@idxprefix dx' if it isn't already open.
+%
+\let\indexfilebasename = \jobname
+%
+\def\@idxwrite#1#2{%
+ % Be sure the file is opened.
+ \csname if@\@idxprefix indexfileopened\endcsname \else
+ \expandafter\immediate\openout\csname @\@idxprefix indexfile\endcsname =
+ \indexfilebasename.\@idxprefix dx
+ \expandafter\global\csname @\@idxprefix indexfileopenedtrue\endcsname
+ \fi
+ %
+ % Save the index term.
+ \def\temp{#1}%
+ %
+ % Write the index term and page number.
+ \edef\@wr{%
+ \expandafter\write\csname @\@idxprefix indexfile\endcsname{%
+ \string\indexentry
+ {\sanitize\temp}%
+ {\noexpand#2}%
+ }%
+ }%
+ \@wr
+ %
+ % Marginalize the index term, if desired.
+ % (the \allowhyphens allows `infinitesimal' in \sidx{Infinitesimal}infinitesimal
+ % to be hyphenated.
+ \ifindexproofing \insert\@indexproof{\indexproofterm{#1}}\allowhyphens\fi
+ %
+ % We just appended at least one non-discardable item (namely, the
+ % whatsit from the \write) to the current list. So in case glue comes
+ % next (not unlikely), be sure we don't inadvertently make that glue a
+ % valid breakpoint, if it wouldn't have been without us.
+ \hookrun{afterindexterm}%
+ %
+ % This is the end of the index entry processing. If this was a silent
+ % entry, ignore following spaces.
+ \ifsilentindexentry \expandafter\ignorespaces\fi
+}%
+%
+%
+% If this conditional is true, we output the index terms on the page
+% where they occur.
+\newif\ifindexproofing
+%
+% We need a new insertion class to collect the proofed terms.
+\newinsert\@indexproof
+\dimen\@indexproof = \maxdimen % No limit on number of terms.
+\count\@indexproof = 0 \skip\@indexproof = 0pt % They take up no space.
+%
+% This actually typesets the proofed term. We don't go to any lengths
+% to provide nice-looking output; since the term might have all kinds of
+% weird characters in it, we just dump it in the smallest standard
+% Computer Modern typewriter font.
+%
+% We put the term in an \hbox, even though that might make the output
+% run off the page, since we don't really need to see all of it, and
+% I think it's better to opt for simplicity -- one term per line.
+\font\indexprooffont = cmtt8
+\def\indexproofterm#1{\hbox{\strut \indexprooffont #1}}%
+%
+%
+% If \output doesn't use \makeheadline, or redefines it, it's up to the
+% new \output to define index hyperlink destination and to call
+% \indexproofunbox.
+\let\@plainmakeheadline = \makeheadline
+\def\makeheadline{%
+ % Define index page destination only when this `cross-reference' is defined.
+ \expandafter\ifx\csname\xrlabel{\idxpagexref{\folio}}\endcsname\relax \else
+ % Say \@@hldeston in case a page break happened at an unfortunate
+ % time when user said \hldestoff.
+ {\@@hldeston \hldest@impl{idx}{\hlidxpagelabel{\folio}}}%
+ \fi
+ \indexproofunbox
+ \@plainmakeheadline
+}%
+%
+% We want to put the proof index terms in the margin, outside the
+% printed area. So if \outsidemargin (for odd pages) and \insidemargin
+% (for even pages) are undefined, we define them (both) to be the default
+% TeX margin -- one inch + \hoffset.
+\def\indexsetmargins{%
+ \ifx\undefined\outsidemargin
+ \dimen@ = 1truein
+ \advance\dimen@ by \hoffset
+ \edef\outsidemargin{\the\dimen@}%
+ \let\insidemargin = \outsidemargin
+ \fi
+}%
+%
+% We always put the terms in the right-hand margin, so long terms run
+% off the page, instead of into the text.
+\def\indexproofunbox{%
+ \ifvoid\@indexproof\else
+ \indexsetmargins
+ \rlap{%
+ \kern\hsize
+ \ifodd\pageno \kern\outsidemargin \else \kern\insidemargin \fi
+ \vbox to 0pt{\unvbox\@indexproof\vss}%
+ }\nointerlineskip
+ \fi
+}%
+%
+%
+% \@idxgetrange\CS parses an optional argument which, if present, should
+% be either `begin' or `end', marking the beginning or ending of a range
+% for the index entry. If we find this, we set the appropriate one of
+% \@idxrangestr. Then we call \CS.
+%
+% If the optional argument is `see' or `seealso' we read another
+% argument, namely, the entry to see.
+%
+\def\idxrangebeginword{begin}%
+\def\idxbeginrangemark{(}% the corresponding magic char to go in the idx file
+%
+\def\idxrangeendword{end}%
+\def\idxendrangemark{)}%
+%
+\def\idxseecmdword{see}%
+\def\idxseealsocmdword{seealso}%
+\newif\if@idxsee
+\newif\if@hlidxencap
+\let\@idxseenterm = \relax
+%
+\def\idxpagemarkupcmdword{pagemarkup}%
+\let\@idxpagemarkup = \relax
+%
+\def\@idxgetrange#1{%
+ \let\@idxrangestr = \empty
+ \let\@afteridxgetrange = #1%
+ \@getoptionalarg\@finidxgetopt
+}%
+\def\@finidxgetopt{%
+ \@hlidxencaptrue
+ %
+ \for\@idxarg:=\@optionalarg\do{%
+ % These are ordered by my guess at frequency of use.
+ \expandafter\@idxcheckpagemarkup\@idxarg=,%
+ %
+ \ifx\@idxarg\idxrangebeginword
+ \def\@idxrangestr{\idxencapoperator\idxbeginrangemark}%
+ \else
+ \ifx\@idxarg\idxrangeendword
+ \def\@idxrangestr{\idxencapoperator\idxendrangemark}%
+ \@hlidxencapfalse
+ \else
+ \ifx\@idxarg\idxseecmdword
+ \def\@idxpagemarkup{indexsee}%
+ \@idxseetrue
+ \@hlidxencapfalse
+ \else
+ \ifx\@idxarg\idxseealsocmdword
+ \def\@idxpagemarkup{indexseealso}%
+ \@idxseetrue
+ \@hlidxencapfalse
+ \else
+ \ifx\@idxpagemarkup\relax
+ \errmessage{Unrecognized index option `\@idxarg'}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ }%
+ % Stick hyperlink encapsulator into \@idxpagemarkup.
+ \ifnum\hldest@place@idx < 0 \else
+ \if@hlidxencap
+ \ifx\@idxpagemarkup\relax
+ % Even when user gives no pagemarkup command, we still do
+ % insert our hyperlink encapsulator.
+ \let\@idxpagemarkup\empty
+ \fi
+ \ifcase\hldest@place@idx \relax
+ % \hldest@place@idx = 0, dests point to a page with a term.
+ \edef\@idxpagemarkup{hlidxpage{\@idxpagemarkup}}%
+ % We want to define index \hldest's only on those
+ % pages which contain at least one index term, so this
+ % `cross-reference' will tell \makeheadline on which pages to
+ % generate an \hldest.
+ {\@@hldestoff \definexref{\idxpagexref{\folio}}{}{}}%
+ \else
+ % \hldest@place@idx = 1, dests point to exact location of a term.
+ \global\advance\hlidxlabelnumber by 1
+ \edef\@idxpagemarkup{hlidx{\hlidxlabel}{\@idxpagemarkup}}%
+ \hldest@impl{idx}{\hlidxlabel}%
+ \fi
+ \fi
+ \fi
+ %
+ \@afteridxgetrange
+}%
+%
+%
+% Check for a command of the form `pagemarkup=\cmd', and if found, set
+% \@idxpagemarkup to `cmd'.
+%
+\def\@idxcheckpagemarkup#1=#2,{%
+ \def\temp{#1}%
+ \ifx\temp\idxpagemarkupcmdword
+ \if ,#2, % If #2 is empty, complain.
+ \errmessage{Missing markup command to `pagemarkup'}%
+ \else
+ % Remove a trailing =.
+ \def\temp##1={##1}%
+ \edef\@idxpagemarkup{\temp\string#2}%
+ \fi
+ \fi
+}%
+%
+%
+% \hlidxpage and \hlidx are hyperlink encapsulators for the two types
+% of hyperlink destinations for index terms.
+%
+% \hldest@place@idx defines which type is selected. When defined to 0,
+% we generate destinations pointing to the page on which the indexed
+% term is located. When defined to 1, we generate destinations
+% pointing to exact location of the indexed term. When negative, we
+% generate no hyperlinks / destinations.
+\def\hldest@place@idx{-1}%
+% Name for a `cross-reference' which \makeheadline uses do decide on
+% which pages to generate \hldest.
+\def\idxpagexref#1{@@IDXPG@@#1}%
+% Hyperlink labels for both types of destinations.
+\newcount\hlidxlabelnumber
+\def\hlidxlabel{IDX\the\hlidxlabelnumber}%
+\def\hlidxpagelabel#1{IDXPG#1}%
+%
+% \hlidx{HYPERLINK-LABEL}{PAGEENCAP}{PAGESPEC}
+\def\hlidx#1#2#3{%
+ \hlstart@impl{idx}{#1}%
+ \csname #2\endcsname{#3}%
+ \hlend@impl{idx}%
+}%
+%
+% \hlidxpage{PAGEENCAP}{PAGESPEC}
+%
+% We expect PAGESPEC to be one of the following:
+% 14 (single page number)
+% 14, 15 (list of two consecutive page numbers)
+% 14--15 (page range)
+%
+% If you configure MakeIndex to use different page list separator
+% (delim_n parameter in .mst file) / different page range separator
+% (delim_r parameter), you should call \setidxpagelistdelimiter /
+% \setidxpagerangedelimiter to setup the new separators.
+%
+% In case of a single page number, we call \PAGEENCAP on the page
+% number and turn the result into a hyperlink.
+%
+% In case of a two-page list, we break the list, call \PAGEENCAP on
+% each of the page numbers separately, and turn each result into a
+% hyperlink, producing page list separator between the page numbers.
+%
+% In case of a page range, we do not break the range, call \PAGEENCAP
+% on the entire range and turn what results into a hyperlink for the
+% first of the page numbers.
+\def\hlidxpage#1#2{%
+ % Set \@idxpagei[i][ref] and \@idxpagesep
+ \@hlidxgetpages{#2}%
+ % Alias for \PAGEENCAP.
+ \expandafter\let\expandafter\@idxpageencap\csname #1\endcsname
+ % Now comes the first part, to be done in any of the three cases.
+ \hlstart@impl{idx}{\hlidxpagelabel{\@idxpageiref}}%
+ \expandafter\@idxpageencap\expandafter{\@idxpagei}%
+ \hlend@impl{idx}%
+ % The second part, to be done only if there is a second page number.
+ \ifx\@idxpageii\empty \else
+ \@idxpagesep
+ \hlstart@impl{idx}{\hlidxpagelabel{\@idxpageiiref}}%
+ \expandafter\@idxpageencap\expandafter{\@idxpageii}%
+ \hlend@impl{idx}%
+ \fi
+}%
+%
+% This macro parses PAGESPEC parameter to \hlidxpage. It sets
+% \@idxpagei to the first page number, \@idxpageii to the second (if
+% present; if not, \@idxpageii will be set to \empty). For the first
+% page number, use \@idxpageiref to construct hyperlink label; for
+% the second page number, use \@idxpageiiref. Use \@idxpagesep to
+% separate the two page numbers.
+%
+% NOTE: we use \@idxpagei[i], not \idxpagei[i], because the user may
+% use \idxparselist / \idxparserange in his \PAGEENCAP, in which case
+% our \idxpagei[i]'s will get garbled.
+\def\@hlidxgetpages#1{%
+ % Try to parse a two-page list.
+ \idxparselist{#1}%
+ \ifx\idxpagei\empty
+ % It is not a two-page list, try page range.
+ \idxparserange{#1}%
+ \ifx\idxpagei\empty
+ % It is neither a two-page list nor a page range, so we assume
+ % it is a single page number.
+ \def\@idxpageiref{#1}% Label for \hlstart.
+ \else
+ % It is a page range.
+ \let\@idxpageiref\idxpagei % Label for \hlstart.
+ \fi
+ \def\@idxpagei{#1}%
+ \let\@idxpageii\empty
+ \else
+ % It is a two-page list.
+ \let\@idxpagei\idxpagei
+ \let\@idxpageii\idxpageii
+ \let\@idxpageiref\idxpagei % Label for \hlstart.
+ \let\@idxpageiiref\idxpageii % Label for \hlstart.
+ \let\@idxpagesep\idxpagelistdelimiter
+ \fi
+}%
+%
+% Set up a macro \@idxparselist and user-accessible \idxparselist for
+% parsing two-page list. Takes list separator (which is saved in
+% \idxpagelistdelimiter). If the list is found, \@idxparselist will
+% set \idxpagei to the first page number, \idxpageii to the second;
+% if not found, it will set \idxpagei to \empty (this implies that
+% the list's first page number should never be empty).
+\def\setidxpagelistdelimiter#1{%
+ \gdef\idxpagelistdelimiter{#1}%
+ \gdef\@removepagelistdelimiter##1#1{##1}%
+ \gdef\@idxparselist##1#1##2\@@{%
+ \ifempty{##2}%
+ \let\idxpagei\empty
+ \else
+ \def\idxpagei{##1}%
+ \edef\idxpageii{\@removepagelistdelimiter##2}%
+ \fi
+ }%
+ \gdef\idxparselist##1{\@idxparselist##1#1\@@}%
+}%
+%
+% Same as previous, but \@idxparserange and \idxparserange will parse
+% page range, range separator is saved in \idxpagerangedelimiter.
+\def\setidxpagerangedelimiter#1{%
+ \gdef\idxpagerangedelimiter{#1}%
+ \gdef\@removepagerangedelimiter##1#1{##1}%
+ \gdef\@idxparserange##1#1##2\@@{%
+ \ifempty{##2}%
+ \let\idxpagei\empty
+ \else
+ \def\idxpagei{##1}%
+ \edef\idxpageii{\@removepagerangedelimiter##2}%
+ \fi
+ }%
+ \gdef\idxparserange##1{\@idxparserange##1#1\@@}%
+}%
+%
+% Set up the default delimiters.
+\setidxpagelistdelimiter{, }%
+\setidxpagerangedelimiter{--}%
+%
+%
+% \@idxtokscollect uses \@idxmaintoks as the token list for the main
+% part of an index entry and \@idxsubtoks for the subpart. Then it
+% calls \@idxwrite.
+%
+\def\idxsubentryseparator{!}%
+\def\idxencapoperator{|}%
+\def\idxmaxpagenum{99999}%
+%
+\newtoks\@idxmaintoks
+\newtoks\@idxsubtoks
+%
+\def\@idxtokscollect{%
+ % Remember the subentry.
+ \edef\temp{\the\@idxsubtoks}%
+ %
+ % We want to expand the conditions, but not the terms. The index
+ % entry starts simply with \@idxmaintoks and \@idxsubtoks.
+ \edef\@indexentry{%
+ \the\@idxmaintoks
+ \ifx\temp\empty\else \idxsubentryseparator\the\@idxsubtoks \fi
+ \@idxrangestr
+ }%
+ %
+ % If this is a `see' or `see also' entry, we need to read one more
+ % arg. We use a giant page number so the entry will be last (for the
+ % benefit of `see also's). MakeIndex rejects page numbers >=1000.
+ %
+ \if@idxsee
+ \@idxseefalse % Reset so the next term won't be a `see'.
+ \edef\temp{\noexpand\@finidxtokscollect{\idxmaxpagenum}}%
+ \else
+ \def\temp{\@finfinidxtokscollect\folio}%
+ \fi
+ \temp
+}%
+%
+%
+% \@finidxtokscollect{PAGENO}{REAL-TERM} reads the final term for
+% see/see also entries. We do not check if the person has put both a
+% range and a see in the same index term (which will confuse makeindex).
+%
+\def\@finidxtokscollect#1#2{%
+ \def\@idxseenterm{#2}%
+ \@finfinidxtokscollect{#1}%
+}%
+%
+% \@finfinidxtokscollect{PAGENO} writes \@indexentry for page PAGENO.
+% Besides \@indexentry, if \@idxpagemarkup is not \relax we output an
+% index entry \@indexentry|\@idxpagemarkup{PAGENO} (but omitting | if
+% this is a range term, because in that case | will have been added
+% together with \@idxrangestr in \@idxtokscollect). And if
+% \@idxseenterm is not \relax we output {\@idxseenterm} after the
+% \@idxpagemarkup. (This will become an argument to the ``markup''
+% command, which will be \indexsee or \indexseealso.)
+%
+\def\@finfinidxtokscollect#1{%
+ % If we've got a page markup command, append it.
+ \ifx\@idxpagemarkup\relax \else
+ \toks@ = \expandafter{\@indexentry}%
+ \edef\@indexentry{%
+ \the\toks@
+ % Add | only if this is not a range term, otherwise | has
+ % already been added with \@idxrangestr by \@idxtokscollect.
+ \ifx\@idxrangestr\empty \idxencapoperator \fi
+ \@idxpagemarkup
+ }%
+ \let\@idxpagemarkup = \relax
+ \fi
+ %
+ % If we've got an argument to the ``page markup'' command, append it.
+ \ifx\@idxseenterm\relax \else
+ \toks@ = \expandafter{\@indexentry}%
+ \edef\@indexentry{\the\toks@{\sanitize\@idxseenterm}}%
+ \let\@idxseenterm = \relax
+ \fi
+ %
+ % Finally, write what we've constructed.
+ \expandafter\@idxwrite\expandafter{\@indexentry}{#1}%
+}%
+%
+%
+% \@idxcollect{MAIN}{SUB} sets up the token registers
+% \@idx{main,sub}toks, then calls \@idxtokscollect. This is convenient
+% for some of the macros below.
+%
+\def\@idxcollect#1#2{%
+ \@idxmaintoks = {#1}%
+ \@idxsubtoks = {#2}%
+ \@idxtokscollect
+}%
+%
+%
+% Following are the TeX macros that correspond to the commands
+% that actually appear in the document.
+%
+% \@idx{TERM} produces TERM in the output and then makes the index entry
+% for TERM as usual. We don't allow a [SUBTERM] here since then we
+% would lose spaces after the command, which would be very inconvenient.
+%
+% As with all our index commands, we've already defined \@idxprefix (in
+% \idx or whatever), to save passing it around, and we've looked for a
+% range argument before TERM.
+%
+\def\@idx#1{%
+ #1% Produce TERM as output.
+ \@idxcollect{#1}{}%
+}%
+%
+% \@sidx{TERM}[SUBTERM] produces an index entry TERM and no output. If
+% SUBTERM is present, this is a subentry. (At the moment, I don't
+% provide for subsubentries, since I've never needed that.)
+%
+\def\@sidx#1{\@idxmaintoks = {#1}\@getoptionalarg\@finsidx}%
+\def\@finsidx{%
+ \@idxsubtoks = \expandafter{\@optionalarg}%
+ \@idxtokscollect
+}%
+%
+%
+% \@idxconstructmarked{TOKS-REG}\CS{TERM}
+%
+\def\idxsortkeysep{@}% This `@' is catcode 11, but it doesn't matter.
+%
+\def\@idxconstructmarked#1#2#3{%
+ \toks@ = {#2}% The control sequence.
+ \toks2 = {#3}% The term.
+ %
+ % Construct TERM@\CS{TERM} as the string to write.
+ \edef\temp{\the\toks2 \idxsortkeysep \the\toks@{\the\toks2}}%
+ %
+ % Save it in TOKS-REG.
+ #1 = \expandafter{\temp}%
+}%
+%
+%
+% \@idxmarked\CS{TERM} outputs \CS{TERM} and then calls the main part of
+% \@sidxmarked.
+%
+\def\@idxmarked#1#2{%
+ #1{#2}% Produce \CS{TERM} as output.
+ \@idxconstructmarked\@idxmaintoks{#1}{#2}%
+ \@idxsubtoks = {}%
+ \@idxtokscollect
+}%
+%
+% \@sidxmarked\CS{TERM}[SUBTERM] outputs an index entry sorted by TERM
+% but producing \CS{TERM}.
+%
+\def\@sidxmarked#1#2{%
+ \@idxconstructmarked\toks@{#1}{#2}%
+ \edef\temp{{\the\toks@}}%
+ \expandafter\@sidx\temp
+}%
+%
+%
+% \@idxsubmarked{TERM}\CS{SUBTERM} is like \@idxmarked, except that it's
+% SUBTERM that's marked instead of TERM.
+%
+\def\@idxsubmarked#1#2#3{%
+ #1 #2{#3}% produce `TERM \CS{SUBTERM} as output.
+ \@sidxsubmarked{#1}{#2}{#3}%
+}%
+%
+% \@sidxsubmarked{TERM}\CS{SUBTERM} is to \@sidxmarked as \@idxsubmarked
+% is to \@idxmarked.
+%
+\def\@sidxsubmarked#1#2#3{%
+ \@idxmaintoks = {#1}%
+ \@idxconstructmarked\@idxsubtoks{#2}{#3}%
+ \@idxtokscollect
+}%
+%
+%
+% \@idxcollectname{FIRST}{LAST} puts `LAST, FIRST' into \temp. (Well,
+% we use \idxnameseparator instead of hardwiring `, '.) If FIRST is
+% empty, don't include the separator.
+%
+\def\idxnameseparator{, }% as in `Tachikawa, Elizabeth'
+%
+\def\@idxcollectname#1#2{%
+ \def\temp{#1}%
+ \ifx\temp\empty
+ \toks@ = {}%
+ \else
+ \toks@ = {\idxnameseparator #1}%
+ \fi
+ \toks2 = {#2}%
+ %
+ \edef\temp{\the\toks2 \the\toks@}%
+}%
+%
+%
+% \@idxname{FIRST}{LAST} also produces `FIRST LAST' in the output and an
+% index entry for `LAST, FIRST'.
+%
+\def\@idxname#1#2{%
+ #1 #2% Separate the names by a space in the output.
+ \@idxcollectname{#1}{#2}%
+ \expandafter\@idxcollect\expandafter{\temp}{}%
+}%
+%
+% \@sidxname{FIRST}{LAST}[SUBTERM] is to \@sidx as \@idxname is to
+% \@idx.
+%
+\def\@sidxname#1#2{%
+ \@idxcollectname{#1}{#2}%
+ \expandafter\@sidx\expandafter{\temp}%
+}%
+%
+%
+% Now we come to actually producing the index, i.e., implementing the
+% formatting commands that MakeIndex outputs.
+%
+% \readindexfile is responsible for formatting and printing the index.
+% It reads \indexfilebasename.ind. We implement the same commands that
+% LaTeX does. I suppose we could allow for different indices having
+% different basenames, but I can't imagine when that would be useful.
+%
+\let\indexfonts = \relax
+%
+\def\readindexfile#1{%
+ \edef\@idxprefix{#1}%
+ %
+ % Does the output file exist?
+ \testfileexistence[\indexfilebasename]{\@idxprefix nd}%
+ \iffileexists \begingroup
+ % If no \begin or \end, define them. The argument will be `{theindex}'.
+ \ifx\begin\undefined
+ \def\begin##1{\@beginindex}%
+ \let\end = \@gobble
+ \fi
+ %
+ % Read the file:
+ \input \indexfilebasename.\@idxprefix nd
+ %
+ % \doublecolumns isn't affected by groups.
+ \singlecolumn
+ \endgroup
+ \else
+ \message{No index file \indexfilebasename.\@idxprefix nd.}%
+ \fi
+}%
+%
+% Here's the default for `\begin{theindex}', if \begin isn't defined.
+\def\@beginindex{%
+ % Define the commands MakeIndex outputs.
+ \let\item = \@indexitem
+ \let\subitem = \@indexsubitem
+ \let\subsubitem = \@indexsubsubitem
+ %
+ % Set up the default formatting:
+ \indexfonts
+ \doublecolumns
+ \parindent = 0pt
+ %
+ % Let the user override the defaults.
+ \hookrun{beginindex}%
+}%
+%
+% MakeIndex puts \indexspace between groups in the ind file.
+\let\indexspace = \bigbreak
+%
+% You can make \afterindexterm appear after the term and before the
+% first page with the following in the ist file:
+% delim_0 "\\afterindexterm "
+% delim_1 "\\afterindexterm "
+% delim_2 "\\afterindexterm "
+\let\afterindexterm = \quad
+%
+%
+% Top-level index entries start with \item.
+\newskip\aboveindexitemskipamount \aboveindexitemskipamount = 0pt plus2pt
+\def\aboveindexitemskip{\vskip\aboveindexitemskipamount}%
+%
+\def\@indexitem{\begingroup
+ \@indexitemsetup
+ \leftskip = 0pt
+ \aboveindexitemskip
+ \penalty-100 % Encourage page breaks before items.
+ %
+ % But forbid page breaks after items, in case a subitem follows.
+ \def\par{\endgraf\endgroup\nobreak}%
+}%
+%
+% Secondary index entries.
+\def\@indexsubitem{%
+ \@indexitemsetup
+ \leftskip = 1em
+}%
+%
+% And tertiary entries.
+\def\@indexsubsubitem{%
+ \@indexitemsetup
+ \leftskip = 2em
+}%
+%
+% Common setup for the formatting.
+\def\@indexitemsetup{%
+ \par
+ \hangindent = 1em
+ \raggedright
+ \hyphenpenalty = 10000
+ \hookrun{indexitem}%
+}%
+%
+%
+% \indexsee{TERM}{PAGENO} ignores PAGENO, and says `see TERM'.
+\def\seevariant{\it}%
+\def\indexseeword{see}%
+\def\indexsee#1#2{{\seevariant \indexseeword\/ }#1}%
+%
+% \indexseealso{TERM}{PAGENO} is similar.
+\def\indexseealsowords{see also}%
+\def\indexseealso#1#2{{\seevariant \indexseealsowords\/ }#1}%
+%
+%
+% We provide one index by default; commands are \idx, \sidx, etc.
+\defineindex{i}%
+%
+%
+%
+% Justification of multiple input lines.
+%
+% You use these by saying
+% {\flushright
+% <flush right text>
+% }
+%
+% and similarly for \flushleft and \center. The command must be
+% embedded in a group. The lines are set in paragraphs as usual, i.e.,
+% blank lines start a new paragraph (by virtue of the
+% \blanklineskipamount vertical glue being inserted).
+%
+% \environment ... \endenvironment isn't appropriate in this case, since
+% these ``environments'' can't be nested.
+%
+\begingroup
+ \catcode `\^^M = \active %
+ \gdef\flushleft{%
+ \def\@endjustifycmd{\@endflushleft}%
+ \def\@eoljustifyaction{\null\hfil\break}%
+ \let\@firstlinejustifyaction = \relax
+ \@startjustify %
+ }%
+ \gdef\flushright{%
+ \def\@endjustifycmd{\@endflushright}%
+ \def\@eoljustifyaction{\break\null\hfil}%
+ \def\@firstlinejustifyaction{\hfil\null}%
+ \@startjustify %
+ }%
+ \gdef\center{%
+ \def\@endjustifycmd{\@endcenter}%
+ \def\@eoljustifyaction{\hfil\break\null\hfil}%
+ \def\@firstlinejustifyaction{\hfil\null}%
+ \@startjustify %
+ }%
+ %
+ % We do this before starting any of the justification commands.
+ \gdef\@startjustify{%
+ \parskip = 0pt
+ \catcode`\^^M = \active %
+ \def^^M{\futurelet\next\@finjustifyreturn}%
+ %
+ % \@eateol is called at the beginning of each justified paragraph.
+ \def\@eateol##1^^M{%
+ \def\temp{##1}%
+ \@firstlinejustifyaction %
+ \ifx\temp\empty\else \temp^^M\fi %
+ }%
+ \expandafter\aftergroup\@endjustifycmd %
+ \checkenv \environmenttrue %
+ \par\noindent %
+ \@eateol %
+ }%
+ %
+ % If the next thing is a ^^M, insert \blanklineskipamount glue. Then
+ % do \@eoljustifyaction (which each justification command defines).
+ \gdef\@finjustifyreturn{%
+ \@eoljustifyaction %
+ \ifx\next^^M%
+ % Insert extra glue when the \@end... command does the \par.
+ \def\par{\endgraf\vskip\blanklineskipamount \global\let\par = \endgraf}%
+ \@endjustifycmd %
+ % Get back into horizontal mode for the next line.
+ \noindent %
+ \@firstlinejustifyaction %
+ \fi %
+ }%
+\endgroup
+%
+\def\@endflushleft{\unpenalty{\parfillskip = 0pt plus1fil\par}\ignorespaces}%
+\def\@endflushright{% Remove the \hfil\null\break we just put on.
+ \unskip \setbox0=\lastbox \unpenalty
+ % We have fil glue at the left of the line; \parfillskip shouldn't
+ % affect that.
+ {\parfillskip = 0pt \par}\ignorespaces
+}%
+\def\@endcenter{% Remove the \hfil\null\break we just put on.
+ \unskip \setbox0=\lastbox \unpenalty
+ % We have fil glue at the left of the line; \parfillskip must balance it.
+ {\parfillskip = 0pt plus1fil \par}\ignorespaces
+}%
+%
+%
+%
+% Automatically-columnated tables.
+%
+% \makecolumns N/K: organizes the entries on the following N lines into
+% K columns. If N is too small, some text beyond the end of the table
+% will be incorporated into the table, probably producing an error
+% message. If N is too large, some of the entries will appear after the
+% table, probably looking very out of place.
+%
+% You can adjust the position of the table on the page by changing
+% \parindent (space to the left of the block) and \hsize (distance from
+% the left margin to the right of the block). (No doubt inside a
+% group.) And you can allow a page break above the valign by changing
+% \abovecolumnspenalty.
+%
+\newcount\abovecolumnspenalty \abovecolumnspenalty = 10000
+\newcount\@linestogo % Lines remaining to process.
+\newcount\@linestogoincolumn % Lines remaining in column.
+\newcount\@columndepth % Number of lines in a column.
+\newdimen\@columnwidth % Width of each column.
+\newtoks\crtok \crtok = {\cr}%
+\newcount\currentcolumn
+%
+% The space matches an end-of-line that will probably be there.
+%
+\def\makecolumns#1/#2: {\par \begingroup
+ % Set \@columndepth to the number of items we will put in a column:
+ % ceiling(N/K), i.e. (N - 1) / K + 1.
+ \@columndepth = #1
+ \advance\@columndepth by -1
+ \divide \@columndepth by #2
+ \advance\@columndepth by 1
+ \@linestogoincolumn = \@columndepth
+ \@linestogo = #1
+ %
+ % We start in the first column.
+ \currentcolumn = 1
+ %
+ \def\@endcolumnactions{%
+ \ifnum \@linestogo<2
+ \the\crtok \egroup \endgroup \par % End \valign and \makecolumns.
+ \else
+ % We've done one more line out of the total.
+ \global\advance\@linestogo by -1
+ %
+ % How many left in the column?
+ %
+ \ifnum\@linestogoincolumn<2
+ % End this column, that was the last line.
+ \global\advance\currentcolumn by 1
+ \global\@linestogoincolumn = \@columndepth
+ \the\crtok
+ \else
+ % Still got more lines to go.
+ &\global\advance\@linestogoincolumn by -1
+ \fi
+ \fi
+ }%
+ %
+ % Set up to read the table.
+ %
+ \makeactive\^^M
+ \letreturn \@endcolumnactions
+ %
+ % Figure out how wide our columns are going to be; each column has
+ % exactly the same template, so we can use the feature described on
+ % p.241 of the TeXbook for repeating preambles.
+ %
+ \@columnwidth = \hsize
+ \advance\@columnwidth by -\parindent
+ \divide\@columnwidth by #2
+ \penalty\abovecolumnspenalty
+ \noindent % It's not a paragraph (usually).
+ \valign\bgroup
+ &\hbox to \@columnwidth{\strut \hsize = \@columnwidth ##\hfil}\cr
+ %
+ % The next end-of-line starts everything going.
+}%
+%
+%
+%
+% \numberedfootnote is like plain TeX's \footnote, but automatically
+% numbered. When you want to reset the footnote number, say
+% \footnotenumber = 0.
+%
+% We also provide for more general formatting than \footnote:
+% \footnotemarkseparation is the space between the reference mark and
+% the footnote text;
+% \interfootnoteskip is the space between footnotes;
+% \everyfootnote is expanded just before we typeset the footnote.
+%
+% The dimensions of the footnote rule are controlled by
+% \footnoterulewidth and \footnoteruleheight (the depth is always zero);
+% the space after the rule is \belowfootnoterulespace.
+%
+\newcount\footnotenumber
+\newcount\hlfootlabelnumber
+\newdimen\footnotemarkseparation \footnotemarkseparation = .5em
+\newskip\interfootnoteskip \interfootnoteskip = 0pt
+\newtoks\everyfootnote
+\newdimen\footnoterulewidth \footnoterulewidth = 2in
+\newdimen\footnoteruleheight \footnoteruleheight = 0.4pt
+\newdimen\belowfootnoterulespace \belowfootnoterulespace = 2.6pt
+%
+\let\@plainfootnote = \footnote
+\let\@plainvfootnote = \vfootnote
+% Hyperlink labels for forward and back references.
+\def\hlfootlabel{FOOT\the\hlfootlabelnumber}%
+\def\hlfootbacklabel{FOOTB\the\hlfootlabelnumber}%
+%
+\def\@eplainfootnote#1{\let\@sf\empty % parameter #2 (the text) is read later
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \global\advance\hlfootlabelnumber by 1
+ \hlstart@impl{foot}{\hlfootlabel}%
+ \hldest@impl{footback}{\hlfootbacklabel}%
+ #1%
+ \hlend@impl{foot}%
+ \@sf\vfootnote{#1}%
+}%
+%
+\let\footnote\@eplainfootnote
+%
+\def\vfootnote#1{\insert\footins\bgroup
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \advance\splittopskip by \interfootnoteskip
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
+ \everypar = {}%
+ \parskip = 0pt % because of the vskip
+ % Even if typesetting in multicolumns, do footnotes in normal page width.
+ % (We don't have any provision in the output routine for having
+ % footnotes per column, anyway.)
+ \ifnum\@numcolumns > 1 \hsize = \@normalhsize \fi
+ \the\everyfootnote
+ \vskip\interfootnoteskip
+ \indent\llap{%
+ \hlstart@impl{footback}{\hlfootbacklabel}%
+ \hldest@impl{foot}{\hlfootlabel}%
+ #1%
+ \hlend@impl{footback}%
+ \kern\footnotemarkseparation
+ }%
+ \footstrut\futurelet\next\fo@t
+}%
+%
+\def\footnoterule{\dimen@ = \footnoteruleheight
+ \advance\dimen@ by \belowfootnoterulespace
+ \kern-\dimen@
+ \hrule width\footnoterulewidth height\footnoteruleheight depth0pt
+ \kern\belowfootnoterulespace
+ \vskip-\interfootnoteskip
+}%
+%
+\def\numberedfootnote{%
+ \global\advance\footnotenumber by 1
+ \@eplainfootnote{$^{\number\footnotenumber}$}%
+}%
+%
+%
+%
+% Margins.
+%
+% TeX's primitives determine the type area. But some users prefer to
+% think in terms of margins. These definitions allow one to say, for
+% example, `\topmargin = 2in', instead of `\voffset=1in\advance\vsize by
+% -1in'. Constructions like `\advance\topmargin by 1in' give an error
+% message, though, since \topmargin is not a parameter. Instead, the
+% macro \advancetopmargin has to be used.
+%
+\newdimen\paperheight
+\ifnum\mag=1000
+ \paperheight = 11in % No magnification (yet).
+\else
+ \paperheight = 11truein % We already have a magnification.
+\fi
+%
+\def\topmargin{\afterassignment\@finishtopmargin \dimen@}%
+\def\@finishtopmargin{%
+ \dimen2 = \voffset % Remember the old \voffset.
+ \voffset = \dimen@ \advance\voffset by -1truein
+ \advance\dimen2 by -\voffset % Compute the change in \voffset.
+ \advance\vsize by \dimen2 % Change type area accordingly.
+}%
+\def\advancetopmargin{%
+ \dimen@ = 0pt \afterassignment\@finishadvancetopmargin \advance\dimen@
+}%
+\def\@finishadvancetopmargin{%
+ \advance\voffset by \dimen@
+ \advance\vsize by -\dimen@
+}%
+%
+%
+\def\bottommargin{\afterassignment\@finishbottommargin \dimen@}%
+\def\@finishbottommargin{%
+ \@computebottommargin % Result in \dimen2.
+ \advance\dimen2 by -\dimen@ % Compute the change in the bottom margin.
+ \advance\vsize by \dimen2 % Change the type area.
+}%
+\def\advancebottommargin{%
+ \dimen@ = 0pt \afterassignment\@finishadvancebottommargin \advance\dimen@
+}%
+\def\@finishadvancebottommargin{%
+ \advance\vsize by -\dimen@
+}%
+%
+% Find the current bottom margin, putting the result in \dimen2.
+%
+\def\@computebottommargin{%
+ \dimen2 = \paperheight % The total paper size.
+ \advance\dimen2 by -\vsize % Less the text size.
+ \advance\dimen2 by -\voffset % Less the offset at the top.
+ \advance\dimen2 by -1truein % Less the default offset.
+}%
+%
+%
+\newdimen\paperwidth
+\ifnum\mag=1000
+ \paperwidth = 8.5in % No magnification (yet).
+\else
+ \paperwidth = 8.5truein % We already have a magnification.
+\fi
+%
+\def\leftmargin{\afterassignment\@finishleftmargin \dimen@}%
+\def\@finishleftmargin{%
+ \dimen2 = \hoffset % Remember the old \hoffset.
+ \hoffset = \dimen@ \advance\hoffset by -1truein
+ \advance\dimen2 by -\hoffset % Compute the change in \hoffset.
+ \advance\hsize by \dimen2 % Change type area accordingly.
+}%
+\def\advanceleftmargin{%
+ \dimen@ = 0pt \afterassignment\@finishadvanceleftmargin \advance\dimen@
+}%
+\def\@finishadvanceleftmargin{%
+ \advance\hoffset by \dimen@
+ \advance\hsize by -\dimen@
+}%
+%
+%
+\def\rightmargin{\afterassignment\@finishrightmargin \dimen@}%
+\def\@finishrightmargin{%
+ \@computerightmargin % Result in \dimen2.
+ \advance\dimen2 by -\dimen@ % Compute the change in the right margin.
+ \advance\hsize by \dimen2 % Change the type area.
+}%
+\def\advancerightmargin{%
+ \dimen@ = 0pt \afterassignment\@finishadvancerightmargin \advance\dimen@
+}%
+\def\@finishadvancerightmargin{%
+ \advance\hsize by -\dimen@
+}%
+%
+% Find the current right margin, putting the result in \dimen2.
+%
+\def\@computerightmargin{%
+ \dimen2 = \paperwidth % The total paper size.
+ \advance\dimen2 by -\hsize % Less the text size.
+ \advance\dimen2 by -\hoffset % Less the offset at the left.
+ \advance\dimen2 by -1truein % Less the default offset.
+}%
+%
+% There is a potential problem when using the margin macros at a true
+% dimension and then calling \magnification. So we redefine
+% \magnification to address this.
+%
+\let\@plainm@g = \m@g
+\def\m@g{\@plainm@g \paperwidth = 8.5 true in \paperheight = 11 true in}%
+%
+%
+%
+% Double column output.
+%
+% \doublecolumns begins double column output. It can be called
+% in the midst of a page. \singlecolumn restores single column
+% output. (It would be wrong to require \enddoublecolumns, because
+% often one wants double column mode to continue to the end of
+% the document.)
+%
+% The basic approach is that of Appendix E of the TeXbook, p.417.
+% David Guichard made significant improvements to my original implementation.
+%
+% The glue here (the default is intended to be one linespace) is inserted
+% before double columns start, and after they end.
+%
+\newskip\abovecolumnskip \abovecolumnskip = \bigskipamount
+\newskip\belowcolumnskip \belowcolumnskip = \bigskipamount
+%
+% Space between the columns. It can be changed as desired.
+\newdimen\gutter \gutter = 2pc
+%
+% These registers are needed for dealing with switching back and forth.
+\newbox\@partialpage
+\newdimen\@normalhsize
+\newdimen\@normalvsize % The original (before multi-columns) \vsize.
+\newtoks\previousoutput
+%
+% Some synonymous ways to refer to multiple column modes.
+\def\quadcolumns{\@columns4}%
+\def\triplecolumns{\@columns3}%
+\def\doublecolumns{\@columns2}%
+\def\begincolumns#1{\ifcase#1\relax \or \singlecolumn \or \@columns2 \or
+ \@columns3 \or \@columns4 \else \relax \fi}%
+\def\endcolumns{\singlecolumn}%
+\let\@ndcolumns = \relax
+%
+% Set this by default so \vfootnote can unconditionally inspect it.
+\chardef\@numcolumns = 1
+%
+\mathchardef\@ejectpartialpenalty = 10141
+%
+%
+% \@columns: Start typesetting with #1 columns.
+%
+% Before we actually start, we have to make sure that there are at least
+\chardef\@col@minlines = 3
+% free lines.
+% (It could be 2, or even 1, but it might give ugly results; at least one
+% line is absolutely necessary, or the output routine might get confused.)
+% We have to be careful, so that eg.
+% \hbox{TITLE}
+% \nobreak
+% \doublecolumns
+% won't break between the title and the start of the columned output.
+%
+% To achieve this, we add vskip of fixed size equal to
+% @col@minlines * baselineskip
+% and then eject the page.
+% The output routine then catches the pages ejected:
+% 1) if it's a normal page, it is processed by previous output routine;
+% 2) if it's the last one, it is saved and the added skip is removed.
+%
+% When the box is processed according to 1), an underfull vbox can appear,
+% but it's not our problem, the manuscript (or it's macros) has to be fixed.
+%
+% Another note: all assignments are global; it is not possible to call
+% \doublecolumns in a group.
+%
+\def\@columns#1{%
+ \@ndcolumns
+ %
+ \global\let\@ndcolumns = \@endcolumns
+ \global\chardef\@numcolumns = #1
+ \global\previousoutput = \expandafter{\the\output}%
+ %
+ % Grab the page so far (i.e., the material BEFORE \@columns was called)
+ % and save it in \@partialpage.
+ \global\output = {%
+ \ifnum\outputpenalty = -\@ejectpartialpenalty
+ \dimen@ = \vsize
+ \advance\dimen@ by \@col@minlines\baselineskip
+ \global\setbox\@partialpage =
+ \vbox \ifdim \pagetotal > \vsize to \dimen@ \fi {%
+ \unvbox255 \unskip
+ }%
+ \else
+ \the\previousoutput
+ \fi
+ }%
+ %
+ \vskip \abovecolumnskip
+ \vskip \@col@minlines\baselineskip
+ % now execute the output routine:
+ \penalty -\@ejectpartialpenalty
+ %
+ % Reset \output to prepare for the first real page break.
+ \global\output = {\@columnoutput}%
+ %
+ \global\@normalhsize = \hsize
+ \global\@normalvsize = \vsize
+ %
+ % Figure out how wide the columns should be -- for n columns,
+ % decrement by n - 1 gutters.
+ \count@ = \@numcolumns
+ \advance\count@ by -1
+ \global\advance\hsize by -\count@\gutter
+ \global\divide\hsize by \@numcolumns
+ %
+ % Compute \vsize based on what's already on the page
+ % and the number of columns. Also change the mag factor for insertions.
+ %
+ \advance\vsize by -\ht\@partialpage
+ %
+ \advance\vsize by -\ht\footins
+ \ifvoid\footins\else \advance\vsize by -\skip\footins \fi
+ \multiply\count\footins by \@numcolumns
+ %
+ \advance\vsize by -\ht\topins
+ \ifvoid\topins\else \advance\vsize by -\skip\topins \fi
+ \multiply\count\topins by \@numcolumns
+ %
+ \global\vsize = \@numcolumns\vsize
+}%
+%
+% When this is invoked box 255 contains just the right amount of
+% material, whether triggered by an output routine or a change in the
+% number of columns. Because columns have to contain an integral number
+% of lines of type, we take a bit of care with balancing the heights of
+% the columns to prevent either losing material or having a very short
+% last column.
+%
+% When a page ends due to \bye or \eject, box 255 will contain lots of
+% white space, so the columns will not look balanced. To fix this use
+% \singlecolumn before ending the page.
+%
+% [gutterbox material added by AHL on 5 November 1997.]
+% \gutterbox is a hook to enable the placement of arbitrary vertical
+% material in the gutter between columns. For example, to put a
+% vertical line between the columns you could say
+%
+% \def\gutterbox{\vbox to \dimen0{\vfil\hbox{\vrule height\dimen0}\vfil}}%
+%
+% The dimension counter \dimen0 contains the height of the column.
+%
+% By default, we define \gutterbox to be "empty":
+\def\gutterbox{\vbox to \dimen0{\vfil\hbox{\hfil}\vfil}}%
+%
+% [This next paragraph added by AHL on 22 Sep 1996.]
+% There is a special case we have to worry about, namely when we
+% switch from multiple columns to single columns. In this case, we may
+% have a bit of text left over that doesn't fit evenly into the
+% multiple columns. In that case, we will have un-even columns. Not a
+% pretty solution, but I don't have a better one at the moment. The
+% conditional \if@forceextraline tests whether we are in this case.
+%
+\newif\if@forceextraline\@forceextralinefalse
+\def\@columnsplit{%
+ \splittopskip = \topskip
+ \splitmaxdepth = \baselineskip
+ %
+ % \dimen@ will be the height that the double-column material on this
+ % page should have, i.e., the height of the page (\singlecolumvsize)
+ % minus single-column material, which includes insertions. (If you
+ % want your insertions to respect the columns, you will have to
+ % change the output routine.) If you add more insertions, they
+ % should be taken into account both here and in \singlecolumn.
+ %
+ % Unfortunately, we lose on flexible glue because we must
+ % \vsplit to a <dimen>.
+ \dimen@ = \ht255
+ \divide\dimen@ by \@numcolumns
+ %
+ % If we are in an end-column mode and we need extra vertical space
+ % in the last column, advance \dimen@.
+ \if@forceextraline
+ \advance\dimen@ by \baselineskip
+ \fi
+ %
+ % Split the long scroll into columns.
+ \begingroup
+ % We do not want to see underfull \vbox messages unless the final
+ % page is underfull.
+ \vbadness = 10000
+ %
+ % The first (leftmost) column.
+ \global\setbox1 = \vsplit255 to \dimen@ \global\wd1 = \hsize
+ %
+ % The second column.
+ \global\setbox3 = \vsplit255 to \dimen@ \global\wd3 = \hsize
+ %
+ \ifnum\@numcolumns > 2
+ % The third column, if requested.
+ \global\setbox5 = \vsplit255 to \dimen@ \global\wd5 = \hsize
+ \fi
+ \ifnum\@numcolumns > 3
+ % The fourth column, likewise if requested.
+ \global\setbox7 = \vsplit255 to \dimen@ \global\wd7 = \hsize
+ \fi
+ \endgroup
+ \if@forceextraline % If this is the first time
+ \else % through, save the single
+ \setbox\@forcelinebox=\copy\@partialpage % column material.
+ \fi
+ %
+ % Set up \box255 with the real output page, as the previous output
+ % routine expects.
+ \setbox0 = \box255
+ \global\setbox255 = \vbox{%
+ \unvbox\@partialpage
+ \ifcase\@numcolumns \relax\or\relax
+ \or \hbox to \@normalhsize{\box1\hfil\gutterbox\hfil\box3}%
+ \or \hbox to \@normalhsize{\box1\hfil\gutterbox\hfil\box3%
+ \hfil\gutterbox\hfil\box5}%
+ \or \hbox to \@normalhsize{\box1\hfil\gutterbox\hfil\box3%
+ \hfil\gutterbox\hfil\box5%
+ \hfil\gutterbox\hfil\box7}%
+ \fi
+ }%
+ %
+ % Save what's left over in a private register before calling their
+ % output routine.
+ \setbox\@partialpage = \box0
+}%
+%
+% Our output routine splits the columns and then calls the previous one.
+%
+\def\@columnoutput{%
+ \@columnsplit
+ \@recoverclubpenalty
+ \hsize = \@normalhsize % Local to \output's group.
+ \vsize = \@normalvsize
+ \the\previousoutput
+ %
+ % Put back what didn't fit.
+ \unvbox\@partialpage
+ \penalty\outputpenalty
+ %
+ % The correct vsize is the original vsize times the
+ % number of columns.
+ \global\vsize = \@numcolumns\@normalvsize
+}%
+%
+% Go back to single-column typesetting. Assume \doublecolumns has
+% been called.
+%
+\def\singlecolumn{%
+ \@ndcolumns
+ \chardef\@numcolumns = 1
+ \vskip\belowcolumnskip
+ \nointerlineskip
+}%
+%
+\newbox\@forcelinebox
+\def\@endcolumns{%
+ \global\let\@ndcolumns = \relax
+ \par % Shouldn't start in horizontal mode.
+ %
+ \global\output = {\global\setbox1 = \box255}%
+ \pagegoal = \pagetotal
+ \break % Exercise the page builder, i.e., \output.
+ \setbox2 = \box1 % Save material in box2 in case of overflow.
+ \global\setbox255 = \copy2 % Retrieve what the fake \output set.
+ %
+ % \box255 now has the double-column material. On the page where we
+ % switch back to one column, the double-column material might not
+ % fill up the page. We want to split whatever is there.
+ \@columnsplit
+ %
+ % Check that \@columnsplit did not leave any lines in
+ % \@partialpage. If it did, do it again, but this time with longer
+ % columns.
+ \ifvoid\@partialpage
+ \else % There is some left-over.
+ \setbox0=\box\@partialpage % Merely to void \@partialpage
+ \global\setbox255 = \box2 % Retrieve what the fake \output set.
+ \@forceextralinetrue % Add \forcelinebox to \box255 to save single
+ \@columnsplit % column material.
+ \global\setbox255 = \vbox{\box\@forcelinebox\box255}%
+ \fi
+
+ \global\vsize = \@normalvsize
+ \global\hsize = \@normalhsize
+ \global\output = \expandafter{\the\previousoutput}%
+ %
+ \ifvoid\topins\else\topinsert\unvbox\topins\endinsert\fi
+ \unvbox255
+}%
+% [\columnfill]
+% We don't have any way to force a column eject, since the \output
+% routine is only prepared to split up a full page of material. Instead,
+% we provide the following as a guess at enough space to fill up the
+% current column.
+%
+% [April 30, 1998] This definition is from
+% Helmut Jarausch <jarausch@IGPM.Rwth-Aachen.DE> with some
+% modifications by A. Lewenberg <ahl@uakron.edu>.
+%
+% Here is the main difficulty: when \vsplitting the long page into the
+% component columns, \vsplit prepends to the top of each column glue
+% in the amount \topskip - (height of top box). But this happens
+% in the output routine _after_ the \columnfill does its
+% calculations. The result of this is that if we are not careful
+% \columnfill will insert too much space attempting to ``eject'' the
+% current column. There is no simple way around this, so what I have
+% done is have is make \columnfill insert less space than needed, and
+% then not allow any \club lines by setting \clubpenalty to its
+% maximum value. Not a pretty solution, but until something better
+% comes along, it will have to do.
+%
+\def\@saveclubpenalty{% save the current value of \clubpenalty
+ \edef\@recoverclubpenalty{%
+ \global\clubpenalty=\the\clubpenalty\relax%
+ \global\let\noexpand\@recoverclubpenalty\relax
+ }% the \noexpand handles infinite self-reference
+}%
+\let\@recoverclubpenalty\relax
+\newdimen\temp@dimen
+\def\columnfill{%
+ \par
+ \dimen@=\pagetotal % The height of the text set so far.
+ \temp@dimen = \vsize % = \@numcolumns * columnheight
+ \divide\temp@dimen by \@numcolumns % find out column height
+ \loop
+ \ifdim \dimen@ > \temp@dimen
+ \advance \dimen@ by -\temp@dimen
+ \advance \dimen@ by \topskip % fudge factor
+ \repeat
+ \advance \temp@dimen by -\dimen@
+ \advance \temp@dimen by -\prevdepth
+ \@saveclubpenalty
+ \clubpenalty=10000\relax
+ \hrule height\temp@dimen width0pt depth0pt\relax
+ \nointerlineskip
+ \par
+ \nointerlineskip
+ \penalty0\vfil % To allow a page break here.
+ \relax
+}%
+%
+%
+%
+% Hypertext links support.
+%
+% Hyperlink destinations (driver-independent code).
+%
+% \hldest{TYPE}{OPTIONS}{LABEL} defines a hyperlink destination
+% LABEL. OPTIONS is a comma-separated list of option assignments of
+% the form `opt=value'; permitted values for TYPE and OPTIONS depend
+% on selected hyperlink driver.
+%
+% \hldest will be \let to \@hldest by \enablehyperlinks. TYPE,
+% OPTIONS and LABEL will be read by \hl@getparam.
+\def\@hldest{%
+ \def\hl@prefix{hldest}%
+ \let\after@hl@getparam\hldest@aftergetparam
+ % Start the group which will isolate option settings. It will be
+ % ended in \hldest@aftergetparam
+ \begingroup
+ \hl@getparam
+}%
+% This actually produces hyperlink destination. It will be called at
+% the end of \hl@getparam, after the parameters are parsed.
+\def\hldest@aftergetparam{%
+ \ifvmode
+ % In vertical mode we don't raise the destination, so it can go
+ % directly into the vertical list.
+ \hldest@driver
+ \else
+ % In horizontal mode, the destination is raised \hldest@opt@raise
+ % above the baseline and placed inside a zero-width/height/depth
+ % box; the box is surrounded by \allowhyphens in case it is
+ % placed next to a word, to allow hyphenation of that word.
+ \allowhyphens
+ \smash{\ifx\hldest@opt@raise\empty \else \raise\hldest@opt@raise\fi
+ \hbox{\hldest@driver}}%
+ \allowhyphens
+ \fi
+ % End the group which was isolating option settings (it was started
+ % in \@hldest).
+ \endgroup
+}%
+%
+% Hyperlinks (driver-independent code).
+%
+% \hlstart{TYPE}{OPTIONS}{LABEL} starts a hyperlink to destination
+% LABEL. OPTIONS is a comma-separated list of option assignments of
+% the form `opt=value'; permitted values of TYPE and OPTIONS depend on
+% selected hyperlink driver. End the link with \hlend.
+%
+% \hlstart will be \let to \@hlstart by \enablehyperlinks. TYPE,
+% OPTIONS and LABEL will be read by \hl@getparam.
+\def\@hlstart{%
+ \leavevmode
+ \def\hl@prefix{hl}%
+ \let\after@hl@getparam\hlstart@aftergetparam
+ % Start the group which will isolate option settings and color
+ % changes. It will be ended in \@hlend
+ \begingroup
+ \hl@getparam
+}%
+%
+\def\hlstart@aftergetparam{%
+ % Set the color for the link.
+ \ifx\color\undefined \else
+ \ifx\hl@opt@color\empty \else
+ \ifx\hl@opt@colormodel\empty
+ \edef\temp{\noexpand\color{\hl@opt@color}}%
+ \else
+ \edef\temp{\noexpand\color[\hl@opt@colormodel]{\hl@opt@color}}%
+ \fi
+ \temp
+ \fi
+ \fi
+ % Call the driver.
+ \hl@driver
+}%
+% \hlend will be \let to \@hlend by \enablehyperlinks. \@hlend will
+% be defined by a driver.
+%
+% Macros which are used commonly by \hldest and \hlstart to parse and
+% save parameters. \hl@prefix must be set to `hldest' by \hldest and
+% to `hl' by \hlstart.
+%
+% \hl@getparam{TYPE}{OPTIONS}{LABEL} reads, parses and saves the
+% parameters for \hldest or \hlstart into \@hltype, \hl[dest]@opt@...
+% and \@hllabel. After doing that it calls \after@hl@getparam which
+% should be defined by \@hldest and \@hlstart to produce destination /
+% link using the saved parameters.
+\def\hl@getparam#1#2#3{%
+ % Save TYPE in \@hltype (use default if empty).
+ \edef\@hltype{#1}%
+ \ifx\@hltype\empty
+ \expandafter\let\expandafter\@hltype
+ \csname \hl@prefix @type\endcsname
+ \fi
+ % For each supported destination / link type TYPE, a driver should
+ % define \hl[dest]@typeh@TYPE handler.
+ \expandafter\ifx\csname \hl@prefix @typeh@\@hltype\endcsname \relax
+ \errmessage{Invalid type `\@hltype'}%
+ \fi
+ % \for will expand #2 once so user can pass a shortcut macro. We
+ % also ignore empty \hl@arg, so that the following
+ % \hldest{TYPE}{\myopt,height=200pt}{LABEL}
+ % would be legal even when \myopt happens to be empty.
+ \for\hl@arg:=#2\do{%
+ \ifx\hl@arg\empty \else
+ \expandafter\hl@set@opt\hl@arg=,%
+ \fi
+ }%
+ % Save LABEL in \@hllabel.
+ \edef\@hllabel{#3}%
+ % Execute the commands specific to destination / link
+ \after@hl@getparam
+ % Ignore spaces after \hlstart and \hldest.
+ \ignorespaces
+}%
+% Parse and set a (default, not a group) option.
+\def\hl@set@opt#1=#2,{%
+ % For each supported option OPTION, a driver should define
+ % \hl[dest]@opt@OPTION.
+ \expandafter\ifx\csname \hl@prefix @opt@#1\endcsname \relax
+ \errmessage{Invalid option `#1'}%
+ \fi
+ % Save the value of the option.
+ \if ,#2, % if #2 is empty, complain.
+ \errmessage{Missing value for option `#1'}%
+ \else
+ % Remove a trailing =.
+ \def\temp##1={##1}%
+ \expandafter\edef\csname \hl@prefix @opt@#1\endcsname{\temp#2}%
+ \fi
+}%
+% \hl{dest,start,end}@impl{GROUP}{LABEL} will generate `implicit' destination /
+% hyperlink, if the user has not turned off this kind of implicit
+% destinations / hyperlinks. This is used by Eplain's cross-reference
+% macros.
+\def\hldest@impl#1{%
+ \expandafter\ifcase\csname hldest@on@#1\endcsname
+ \relax\expandafter\gobble
+ \else
+ \toks@=\expandafter{\csname hldest@type@#1\endcsname}%
+ \toks@ii=\expandafter{\csname hldest@opts@#1\endcsname}%
+ \edef\temp{\noexpand\hldest{\the\toks@}{\the\toks@ii}}%
+ \expandafter\temp
+ \fi
+}%
+\def\hlstart@impl#1{%
+ \expandafter\ifcase\csname hl@on@#1\endcsname
+ % Still produce \leavevmode, to be consistent with \hloff.
+ \leavevmode\expandafter\gobble
+ \else
+ \toks@=\expandafter{\csname hl@type@#1\endcsname}%
+ \toks@ii=\expandafter{\csname hl@opts@#1\endcsname}%
+ \edef\temp{\noexpand\hlstart{\the\toks@}{\the\toks@ii}}%
+ \expandafter\temp
+ \fi
+}%
+\def\hlend@impl#1{%
+ \expandafter\ifcase\csname hl@on@#1\endcsname
+ \else
+ \hlend
+ \fi
+}%
+%
+% Setting options and types.
+%
+\def\hl@asterisk@word{*}%
+\def\hl@opts@word{opts}%
+\newif\if@params@override
+% We define hyperlink / destination groups. A group is a macro or a
+% group of macros which implicitly generate hyperlink / destination.
+% The user can set parameters for each group individually, as well as
+% the default parameters, with the macros defined below. Group
+% settings will override the default hyperlink / destination
+% parameters.
+\def\hldest@groups{definexref,xrdef,li,eq,bib,foot,footback,idx}%
+\def\hl@groups{ref,xref,eq,cite,foot,footback,idx,url}%
+% \hldesttype [GROUPS]{VALUE}
+% \hldestopts [GROUPS]{VALUE}
+% \hltype [GROUPS]{VALUE}
+% \hlopts [GROUPS]{VALUE}
+%
+% Set hyperlink or destination parameter (type / opts) to VALUE for
+% each group in GROUPS. An empty `group' will set default value for
+% the parameter. A star (*) `group' stands for all groups (exept the
+% empty `group'). If the macro is followed by an exclamation mark
+% (like \hlopts!...), the parameters will be overridden; otherwise,
+% they will be updated (this has effect only on group option list).
+\def\hldesttype{%
+ \def\hl@prefix{hldest}%
+ \def\hl@param{type}%
+ \let\hl@all@groups\hldest@groups
+ \futurelet\hl@excl\hl@param@read@excl
+}%
+\def\hldestopts{%
+ \def\hl@prefix{hldest}%
+ \def\hl@param{opts}%
+ \let\hl@all@groups\hldest@groups
+ \futurelet\hl@excl\hl@param@read@excl
+}%
+\def\hltype{%
+ \def\hl@prefix{hl}%
+ \def\hl@param{type}%
+ \let\hl@all@groups\hl@groups
+ \futurelet\hl@excl\hl@param@read@excl
+}%
+\def\hlopts{%
+ \def\hl@prefix{hl}%
+ \def\hl@param{opts}%
+ \let\hl@all@groups\hl@groups
+ \futurelet\hl@excl\hl@param@read@excl
+}%
+\def\hl@param@read@excl{%
+ \ifx!\hl@excl
+ \let\next\hl@param@read@opt@arg
+ \@params@overridetrue
+ \else
+ \def\next{\hl@param@read@opt@arg{!}}%
+ \@params@overridefalse
+ \fi
+ \next
+}%
+\def\hl@param@read@opt@arg#1{% #1 is the `!', ignore it.
+ \@getoptionalarg\hl@setparam
+}%
+% Set the parameter \hl@param to #1 for each group in \@optionalarg.
+\def\hl@setparam#1{%
+ \ifx\@optionalarg\empty
+ \hl@setparam@default{#1}% Set default.
+ \else
+ % If we find an asterisk in the list, we have no choice but to
+ % finish the list and then call \hl@setparam again, now with
+ % \hl@all@groups for the list of groups.
+ \let\hl@do@all@groups\gobble
+%
+ \for\hl@group:=\@optionalarg\do{%
+ \ifx\hl@group\hl@asterisk@word
+ \def\hl@do@all@groups{\let\@optionalarg\hl@all@groups \hl@setparam}%
+ \else
+ \hl@setparam@group{#1}%
+ \fi
+ }%
+%
+ \hl@do@all@groups{#1}%
+ \fi
+}%
+% Set a parameter (\hl@param) for one group (\hl@group) to the value
+% (#1). The group may be empty, in which case we call
+% \hl@setparam@default
+\def\hl@setparam@group#1{%
+ \ifx\hl@group\empty
+ \hl@setparam@default{#1}%
+ \else
+ \expandafter\ifx\csname\hl@prefix @\hl@param @\hl@group\endcsname\relax
+ \errmessage{Hyperlink group parameter `\hl@prefix:\hl@param:\hl@group' is not defined}%
+ \fi
+ \ifx\hl@param\hl@opts@word
+ % For the `opts' parameter, we want to expand the first token of
+ % #1 once, in case the user passed a macro containing the option
+ % list. We may need to either simply override the old option
+ % list, or to update it with the new option settings.
+ \if@params@override
+ \toks@=\expandafter{#1}%
+ \ece\edef{\hl@prefix @\hl@param @\hl@group}{\the\toks@}%
+ \else
+ \hl@update@opts@with@list{#1}% #1 will be used in the \for
+ % loop, so it will be expanded once.
+ \fi
+ \else
+ % Do not use \edef here to define the parameter, so the user can
+ % define it to, e.g., \normalbaselineskip, and make the parameter
+ % adjustable to a situation.
+ \ece\def{\hl@prefix @\hl@param @\hl@group}{#1}%
+ \fi
+ \fi
+}%
+% Set default parameter values. We have to treat `opts' (list of
+% options) specially, because for option defaults we don't store a
+% list of options (like we do for the group options) but set each
+% option individually.
+\def\hl@setparam@default#1{%
+ \ifx\hl@param\hl@opts@word
+ % `opts'.
+ \for\hl@opt:=#1\do{%
+ \ifx\hl@opt\empty \else
+ \expandafter\hl@set@opt\hl@opt=,%
+ \fi
+ }%
+ \else
+ % Everything except `opts'.
+ \expandafter\ifx\csname\hl@prefix @\hl@param\endcsname\relax
+ \message{Default parameter `\hl@prefix:\hl@param' is not defined}%
+ \fi
+ % Should not use \edef, so the user could define this to, e.g.,
+ % \normalbaselineskip, to make the parameter adjustable to a
+ % situation.
+ \ece\def{\hl@prefix @\hl@param}{#1}%
+ \fi
+}%
+% For each option in the list (#1), call \hl@update@with@opt to update
+% the group's option list (\csname\hl@prefix @opts@ \hl@group\endcsname)
+% with this new option.
+\def\hl@update@opts@with@list#1{%
+ % Start with the current list of the group.
+ \global\expandafter\let\expandafter\hl@update@new@list
+ \csname \hl@prefix @opts@\hl@group\endcsname
+ % We have to isolate the \for loop inside a (TeX) group, to avoid
+ % clashes with the loop in \hl@setparam
+ \begingroup
+ \for\hl@opt:=#1\do{%
+ \hl@update@opts@with@opt
+ }%
+ \endgroup
+ % Save the final list back in the option list for the group.
+ \ece\let{\hl@prefix @opts@\hl@group}\hl@update@new@list
+}%
+% Go through the option list (\hl@update@new@list) and construct the
+% new list (in \hl@update@new@list), replacing the old definition of
+% the option with the new one (\hl@opt).
+\def\hl@update@opts@with@opt{%
+ % Save the old list and the new option.
+ \global\let\hl@update@old@list\hl@update@new@list
+ \global\let\hl@update@new@list\empty
+ \global\let\hl@update@new@opt\hl@opt
+ % Get the key of the new option and save it.
+ \expandafter\hl@parse@opt@key\hl@opt=,%
+ \let\hl@update@new@key\hl@update@key
+ % We will set this to real comma after the first entry.
+ \global\let\hl@update@comma\empty
+ % We have to isolate the \for loop inside a (TeX) group, to avoid
+ % clashes with the loop in \hl@update@opts@with@list
+ \begingroup
+ \for\hl@opt:=\hl@update@old@list\do{%
+ \ifx\hl@opt\empty \else % Skip empty `options'.
+ % Get the key of this option.
+ \expandafter\hl@parse@opt@key\hl@opt=,%
+ % If the key matches, replace the option definition with the
+ % new definition, otherwise, repeat the old definition.
+ \toks@=\expandafter{\hl@update@new@list}%
+ \ifx\hl@update@key\hl@update@new@key
+ \ifx\hl@update@new@opt\empty \else % Skip multiple options.
+ \toks@ii=\expandafter{\hl@update@new@opt}%
+ \xdef\hl@update@new@list{\the\toks@\hl@update@comma\the\toks@ii}%
+ \global\let\hl@update@new@opt\empty
+ \global\def\hl@update@comma{,}%
+ \fi
+ \else
+ \toks@ii=\expandafter{\hl@opt}%
+ \xdef\hl@update@new@list{\the\toks@\hl@update@comma\the\toks@ii}%
+ \global\def\hl@update@comma{,}%
+ \fi
+ \fi
+ }%
+ \endgroup
+ % If nothing was replaced, add the new option to the end of the new list.
+ \ifx\hl@update@new@opt\empty \else
+ \toks@=\expandafter{\hl@update@new@list}%
+ \toks@ii=\expandafter{\hl@update@new@opt}%
+ \xdef\hl@update@new@list{\the\toks@\hl@update@comma\the\toks@ii}%
+ \fi
+}%
+% Parse the key of the option and save it in \hl@update@key
+\def\hl@parse@opt@key#1=#2,{\def\hl@update@key{#1}}%
+%
+% Default and group parameters (options and types).
+%
+% Option `raise' will determine how much to raise hyperlink
+% destinations above the baseline. It will be supported by all
+% drivers, since it is handled outside the drivers, in
+% \hldest@aftergetparam.
+\def\hldest@opt@raise{\normalbaselineskip}%
+% Options `colormodel' and `color' will also be handled outside the
+% drivers, in \hlstart@aftergetparam.
+\def\hl@opt@colormodel{cmyk}%
+\def\hl@opt@color{0.28,1,1,0.35}%
+%
+% Parameters for destinations and links produced implicitly by
+% cross-reference macros. Note that each driver will additionally
+% define \hldest@type and \hl@type parameters which will be used when
+% one of the below is empty, and default values for destination and
+% link options (which are driver-specific).
+%
+% Destination on/off flags (0=off, 1=on).
+\def\hldest@on@definexref{0}%
+\def\hldest@on@xrdef{0}%
+\def\hldest@on@li{0}%
+\def\hldest@on@eq{0}% \eqdef and friends
+\def\hldest@on@bib{0}% \biblabelprint (BibTeX)
+\def\hldest@on@foot{0}% \footnote / \numberedfootnote
+\def\hldest@on@footback{0}% back-ref for \footnote / \numberedfootnote
+\def\hldest@on@idx{0}% both `page' dests and `exact' dests
+% Types of destinations.
+\let\hldest@type@definexref\empty
+\let\hldest@type@xrdef\empty
+\let\hldest@type@li\empty
+\let\hldest@type@eq\empty % \eqdef and friends
+\let\hldest@type@bib\empty % \biblabelprint (BibTeX)
+\let\hldest@type@foot\empty % \footnote / \numberedfootnote
+\let\hldest@type@footback\empty % back-ref for \footnote / \numberedfootnote
+\let\hldest@type@idx\empty % both `page' dests and `exact' dests
+% Options for destinations.
+\let\hldest@opts@definexref\empty
+\let\hldest@opts@xrdef\empty
+\let\hldest@opts@li\empty
+\def\hldest@opts@eq{raise=1.7\normalbaselineskip}% \eqdef and friends
+\let\hldest@opts@bib\empty % \biblabelprint (BibTeX)
+\let\hldest@opts@foot\empty % \footnote / \numberedfootnote
+\let\hldest@opts@footback\empty % back-ref for \footnote / \numberedfootnote
+\let\hldest@opts@idx\empty % both `page' dests and `exact' dests
+%
+% Hyperlink on/off flags (0=off, 1=on).
+\def\hl@on@ref{0}% \refn and \xrefn, \ref, \refs
+\def\hl@on@xref{0}%
+\def\hl@on@eq{0}% \eqref and \eqrefn
+\def\hl@on@cite{0}% \cite (BibTeX)
+\def\hl@on@foot{0}% \footnote / \numberedfootnote
+\def\hl@on@footback{0}% back-reference for \footnote / \numberedfootnote
+\def\hl@on@idx{0}%
+\def\hl@on@url{0}% \url from url.sty
+% Types of links.
+\let\hl@type@ref\empty % \refn and \xrefn, \ref, \refs
+\let\hl@type@xref\empty
+\let\hl@type@eq\empty % \eqref and \eqrefn
+\let\hl@type@cite\empty % \cite (BibTeX)
+\let\hl@type@foot\empty % \footnote / \numberedfootnote
+\let\hl@type@footback\empty % back-reference for \footnote / \numberedfootnote
+\let\hl@type@idx\empty
+\let\hl@type@url\empty % \url from url.sty (this will be set to `url' by
+ % drivers which support the `url' type)
+% Options for links.
+\let\hl@opts@ref\empty % \refn and \xrefn, \ref, \refs
+\let\hl@opts@xref\empty
+\let\hl@opts@eq\empty % \eqref and \eqrefn
+\let\hl@opts@cite\empty % \cite (BibTeX)
+\let\hl@opts@foot\empty % \footnote / \numberedfootnote
+\let\hl@opts@footback\empty % back-reference for \footnote / \numberedfootnote
+\let\hl@opts@idx\empty
+\let\hl@opts@url\empty % \url from url.sty
+%
+% \@hlon[GROUPS]
+% \@hloff[GROUPS]
+% \@hldeston[GROUPS]
+% \@hldestoff[GROUPS]
+% \@@hlon
+% \@@hloff
+% \@@hldeston
+% \@@hldestoff
+%
+% Macros to switch hyperlinks / destinations on/off.
+%
+% The optional arg is the list of groups. It can contain a star (*)
+% which will make the macros affect all groups (but not the low-level
+% macros \hlstart, \hlend and \hldest).
+%
+% \@hlon, \@hldeston, \@hloff and \@hldestoff will turn low-level
+% macros on/off only when they are used either without the optional
+% arg or with an empty `group' in the optional arg, otherwise only the
+% specified groups are affected.
+%
+% The single-`@' variants (\@hl...) are for the user. In your macros,
+% if you want to (temporarily) turn low-level macros on/off, it's
+% better to use the double-`@' variants (\@@hl...), because they are
+% much faster and won't clobber \@optionalarg or anything else.
+%
+\def\@hlon{\@hlonoff@value@stub{hl}\@@hlon1 }%
+\def\@hloff{\@hlonoff@value@stub{hl}\@@hloff0 }%
+\def\@hldeston{\@hlonoff@value@stub{hldest}\@@hldeston1 }%
+\def\@hldestoff{\@hlonoff@value@stub{hldest}\@@hldestoff0 }%
+%
+\def\@hlonoff@value@stub#1#2#3{%
+ \def\hl@prefix{#1}%
+ \let\hl@on@empty#2%
+ \def\hl@value{#3}%
+ \expandafter\let\expandafter\hl@all@groups
+ \csname \hl@prefix @groups\endcsname
+ \@getoptionalarg\@finhlswitch
+}%
+%
+\def\@finhlswitch{%
+ \ifx\@optionalarg\empty
+ \hl@on@empty
+ \fi
+ % If we find an asterisk in the list, we have no choice but to
+ % finish the list and then call \@finhlswitch again, now with
+ % \hl@all@groups for the list of groups.
+ \let\hl@do@all@groups\relax
+%
+ \for\hl@group:=\@optionalarg\do{%
+ \ifx\hl@group\hl@asterisk@word
+ \let\@optionalarg\hl@all@groups
+ \let\hl@do@all@groups\@finhlswitch
+ \else
+ \ifx\hl@group\empty
+ \hl@on@empty
+ \else
+ \expandafter\ifx\csname\hl@prefix @on@\hl@group\endcsname \relax
+ \errmessage{Hyperlink group `\hl@prefix:on:\hl@group'
+ is not defined}%
+ \fi
+ \ece\edef{\hl@prefix @on@\hl@group}{\hl@value}%
+ \fi
+ \fi
+ }%
+%
+ \hl@do@all@groups
+}%
+% Turn low-level macros on/off.
+\def\@@hlon{%
+ \let\hlstart\@hlstart
+ \let\hlend\@hlend
+}%
+\def\@@hloff{%
+ \def\hlstart##1##2##3{\leavevmode\ignorespaces}%
+ \let\hlend\relax
+}%
+\def\@@hldeston{%
+ \let\hldest\@hldest
+}%
+\def\@@hldestoff{%
+ \def\hldest##1##2##3{\ignorespaces}%
+}%
+%
+% Hyperlink drivers.
+%
+% \enablehyperlinks[OPTIONS] will enable hyperlinks. OPTIONS is a
+% list of comma-separated options. An option is one of the following:
+%
+% idxexact Point index links to exact locations of the term
+% idxpage Point index links to pages with the term (default)
+% idxnone No links for index entries
+% <driver-name> Force the hyperlink driver
+%
+% If <driver-name> is omitted, appropriate driver will be detected, if
+% possible; if not, we fall back on `dvipdfm' (currently this means
+% `pdftex' when \ifpdf, and `dvipdfm' otherwise).
+\def\hl@idxexact@word{idxexact}%
+\def\hl@idxpage@word{idxpage}%
+\def\hl@idxnone@word{idxnone}%
+%
+\def\enablehyperlinks{\@getoptionalarg\@finenablehyperlinks}%
+\def\@finenablehyperlinks{%
+ \let\hl@selecteddriver\empty
+ % By default we generate `idxpage' index hyperlinks.
+ \def\hldest@place@idx{0}%
+ % Go through the option list.
+ \for\hl@arg:=\@optionalarg\do{%
+ \ifx\hl@arg\hl@idxexact@word
+ \def\hldest@place@idx{1}%
+ \else
+ \ifx\hl@arg\hl@idxnone@word
+ \def\hldest@place@idx{-1}%
+ \else
+ \ifx\hl@arg\hl@idxpage@word
+ \def\hldest@place@idx{0}%
+ \else
+ \let\hl@selecteddriver\hl@arg
+ \fi
+ \fi
+ \fi
+ }%
+ % Check the driver name.
+ \ifx\hl@selecteddriver\empty
+ % The user did not specify a driver, detect.
+ \ifpdf
+ \def\hl@selecteddriver{pdftex}%
+ \message{^^JUsing `pdftex' hyperlink driver.}%
+ \else
+ \def\hl@selecteddriver{dvipdfm}%
+ \message{^^JUsing `dvipdfm' hyperlink driver.}%
+ \fi
+ \else
+ % Check that the requested driver's initialization routine is
+ % available.
+ \expandafter\ifx\csname hldriver@\hl@selecteddriver\endcsname \relax
+ \errmessage{No hyperlink driver `\hl@selecteddriver' available}%
+ \fi
+ \fi
+ % Call the driver's initialization routine.
+ \csname hldriver@\hl@selecteddriver\endcsname
+ % Driver should not be changed later.
+ \def\@finenablehyperlinks{\errmessage{Hyperlink driver `\hl@selecteddriver'
+ already selected}}%
+ % Free memory taken up by the drivers.
+ \let\hldriver@nolinks\undefined
+ \let\hldriver@pdftex \undefined
+ \let\hldriver@dvipdfm\undefined
+ % The user can use these to turn the links / destinations on/off
+ % (see comments to the driver `nolinks').
+ \let\hloff\@hloff
+ \let\hlon\@hlon
+ \let\hldestoff\@hldestoff
+ \let\hldeston\@hldeston
+ % Turn everything on by default.
+ \hlon[*,]%
+ \hldeston[*,]%
+}%
+%
+% Driver `nolinks'.
+%
+% Select this driver to suppress any hyperlinks / destinations in your
+% document.
+%
+% NOTE: selecting this driver is quite different from not selecting
+% any driver at all, or from selecting some driver and then turning
+% off links and destinations for the entire document with \hloff and
+% \hldestoff.
+%
+% The purpose of \hldestoff and \hloff is to mark (parts) of document
+% where links should never appear. (Imagine you want to prevent a
+% cross-referencing macro from generating a link at a certain spot in
+% your document.)
+%
+% If instead you have prepared a document with links and just want to
+% compile a version without the links, it is better to select the
+% driver `nolinks'. This will ensure that spacing and pagebreaking
+% will be the same as what you were getting with hyperlinks enabled.
+%
+% The reason for this is that hyperlinks are produced by \special
+% commands. Each \special is placed inside a whatsit which may
+% introduce a legitimate breakpoint at places where none would exist
+% without the whatsit. The macros \hldestoff and \hloff disable
+% hyperlink macros so drastically that no whatsits are produced.
+%
+% On the other hand, `nolinks' driver does not completely disable
+% hyperlink macros. Instead, it defines them to write to the log
+% file (what gets written is not really important). This will produce
+% the whatsits imitating the whatsits from the \special's. (This
+% trick was borrowed from graphics bundle.)
+%
+% Another reason for using `nolinks' is that in horizontal mode
+% \hldest places destinations inside zero-width/height/depth boxes.
+% When you say \hldestoff, \hldest will omit both destination specs
+% and these boxes. The missing boxes can cause typesetting to be
+% inconsistent with what you were getting with destinations enabled.
+% Again, `nolinks' driver helps here by defining \hldest to still
+% produce the empty boxes.
+%
+\def\hldriver@nolinks{%
+ \def\@hldest##1##2##3{%
+ \ifvmode
+ \write-1{\string\hldest: ##3}%
+ \else
+ \allowhyphens
+ \smash{\write-1{\string\hldest: ##3}}%
+ \allowhyphens
+ \fi
+ \ignorespaces
+ }%
+ \def\@hlstart##1##2##3{%
+ \leavevmode
+ \begingroup % Start the color group.
+ \write-1{\string\hlstart: ##3}%
+ \ignorespaces
+ }%
+ \def\@hlend{\write-1{\string\hlend}\endgroup}% End the group from \@hlstart.
+}%
+%
+% Driver `pdftex'.
+%
+\def\hldriver@pdftex{%
+\ifpdf % PDF output is enabled.
+ \def\hl@raw@word{raw}%
+ %
+ % Hyperlink destinations.
+ %
+ % Default type.
+ \def\hldest@type{xyz}%
+ % Set defaults for the options and tell \hl@set@opt what options we
+ % support. (We do not define \hldest@opt@raise, \hl@opt@colormodel
+ % and \hl@opt@color, they are defined and used outside the drivers.)
+ \let\hldest@opt@width \empty
+ \let\hldest@opt@height \empty
+ \let\hldest@opt@depth \empty
+ \let\hldest@opt@zoom \empty
+ \let\hldest@opt@cmd \empty
+ % Multiplexer for all supported destination types.
+ \def\hldest@driver{%
+ % Special case for `raw' destinations.
+ \ifx\@hltype\hl@raw@word
+ \csname \hldest@opt@cmd \endcsname
+ \else
+ \pdfdest name{\@hllabel}\@hltype
+ \csname hldest@typeh@\@hltype\endcsname
+ \fi
+ }%
+ % Define handlers for each supported destination type.
+ \let\hldest@typeh@raw \empty
+ \let\hldest@typeh@fit \empty
+ \let\hldest@typeh@fith \empty
+ \let\hldest@typeh@fitv \empty
+ \let\hldest@typeh@fitb \empty
+ \let\hldest@typeh@fitbh \empty
+ \let\hldest@typeh@fitbv \empty
+ \def\hldest@typeh@fitr{%
+ \ifx\hldest@opt@width \empty \else width \hldest@opt@width \fi
+ \ifx\hldest@opt@height \empty \else height \hldest@opt@height \fi
+ \ifx\hldest@opt@depth \empty \else depth \hldest@opt@depth \fi
+ }%
+ \def\hldest@typeh@xyz{%
+ \ifx\hldest@opt@zoom\empty \else zoom \hldest@opt@zoom \fi
+ }%
+ %
+ % Hyperlinks.
+ %
+ % Default type.
+ \def\hl@type{name}%
+ % We support `url' hyperlinks, so set the `url' group type.
+ \ifx\hl@type@url\empty
+ \def\hl@type@url{url}%
+ \fi
+ % Set defaults for the options and tell \hl@set@opt what options we
+ % support.
+ \let\hl@opt@width \empty
+ \let\hl@opt@height \empty
+ \let\hl@opt@depth \empty
+ \def\hl@opt@bstyle {S}%
+ \def\hl@opt@bwidth {1}%
+ \let\hl@opt@bcolor \empty
+ \let\hl@opt@hlight \empty
+ \let\hl@opt@bdash \empty
+ \let\hl@opt@pagefit \empty
+ \let\hl@opt@cmd \empty
+ \let\hl@opt@file \empty
+ \let\hl@opt@newwin \empty
+ % Multiplexer for all supported link types.
+ \def\hl@driver{%
+ % Special case for `raw' links.
+ \ifx\@hltype\hl@raw@word
+ \csname \hl@opt@cmd \endcsname
+ \else
+ % See if we will construct a /BS spec. We want to bother only
+ % if any of \hl@opt@bstyle, \hl@opt@bwidth and \hl@opt@bdash is
+ % not empty.
+ \let\hl@BSspec\relax % construct
+ \ifx\hl@opt@bstyle \empty
+ \ifx\hl@opt@bwidth \empty
+ \ifx\hl@opt@bdash \empty
+ \let\hl@BSspec\empty % don't construct
+ \fi
+ \fi
+ \fi
+ % Construct common preamble of a link.
+ \def\hlstart@preamble{%
+ \pdfstartlink
+ \ifx\hl@opt@width \empty \else width \hl@opt@width \fi
+ \ifx\hl@opt@height \empty \else height \hl@opt@height \fi
+ \ifx\hl@opt@depth \empty \else depth \hl@opt@depth \fi
+ attr{%
+ \ifx\hl@opt@bcolor\empty\else /C[\hl@opt@bcolor]\fi
+ \ifx\hl@opt@hlight\empty\else /H/\hl@opt@hlight\fi
+ \ifx\hl@BSspec\relax
+ /BS<<%
+ /Type/Border%
+ \ifx\hl@opt@bstyle\empty\else /S/\hl@opt@bstyle\fi
+ \ifx\hl@opt@bwidth\empty\else /W \hl@opt@bwidth\fi
+ \ifx\hl@opt@bdash\empty \else /D[\hl@opt@bdash]\fi
+ >>%
+ \fi
+ }%
+ }%
+ % Call the handler.
+ \csname hl@typeh@\@hltype\endcsname
+ \fi
+ }%
+ % Link type handlers
+ \let\hl@typeh@raw\empty
+ \def\hl@typeh@name{\hlstart@preamble goto name{\@hllabel}}%
+ \def\hl@typeh@num{\hlstart@preamble goto num \@hllabel}%
+ \def\hl@typeh@page{%
+ % PDF requires pages to start from 0, so adjust page number.
+ \count@=\@hllabel
+ \advance\count@ by-1
+ %
+ \hlstart@preamble
+ user{%
+ /Subtype/Link%
+ /Dest%
+ [\the\count@
+ \ifx\hl@opt@pagefit\empty/Fit\else\hl@opt@pagefit\fi]%
+ }%
+ }%
+ \def\hl@typeh@filename{\hl@file{(\@hllabel)}}%
+ \def\hl@typeh@filepage{%
+ % PDF requires pages to start from 0, so adjust page number.
+ \count@=\@hllabel
+ \advance\count@ by-1
+ %
+ \hl@file{%
+ [\the\count@ \ifx\hl@opt@pagefit\empty/Fit\else\hl@opt@pagefit\fi]%
+ }%
+ }%
+ \def\hl@file##1{%
+ \hlstart@preamble
+ user{%
+ /Subtype/Link%
+ /A<<%
+ /Type/Action%
+ /S/GoToR%
+ /D##1%
+ /F(\hl@opt@file)%
+ \ifx\hl@opt@newwin\empty \else
+ /NewWindow \ifcase\hl@opt@newwin false\else true\fi
+ \fi
+ >>%
+ }%
+ }%
+ \def\hl@typeh@url{%
+ \hlstart@preamble
+ user{%
+ /Subtype/Link%
+ /A<<%
+ /Type/Action
+ /S/URI%
+ /URI(\@hllabel)%
+ >>%
+ }%
+ }%
+ %
+ \def\@hlend{\pdfendlink\endgroup}% End the group from the \@hlstart.
+%
+\else % PDF output is not enabled.
+ \message{Warning: `pdftex' hyperlink driver: PDF output is
+ not enabled, falling back on `nolinks' driver.}%
+ \hldriver@nolinks
+\fi
+}%
+%
+% Driver `dvipdfm'.
+%
+\def\hldriver@dvipdfm{%
+ \def\hl@raw@word{raw}%
+ %
+ % Hyperlink destinations.
+ %
+ % Default type.
+ \def\hldest@type{xyz}%
+ % Set defaults for the options and tell \hl@set@opt what options we
+ % support. (We do not define \hldest@opt@raise, \hl@opt@colormodel
+ % and \hl@opt@color, they are defined and used outside the drivers.)
+ \let\hldest@opt@left \empty
+ \let\hldest@opt@top \empty
+ \let\hldest@opt@right \empty
+ \let\hldest@opt@bottom \empty
+ \let\hldest@opt@zoom \empty
+ \let\hldest@opt@cmd \empty
+ % Multiplexer for all supported destination types.
+ \def\hldest@driver{%
+ % Special case for `raw' destinations.
+ \ifx\@hltype\hl@raw@word
+ \csname \hldest@opt@cmd \endcsname
+ \else
+ % Construct common preamble of a destination.
+ \def\hldest@preamble{%
+ pdf: dest (\@hllabel) [@thispage
+ }%
+ % Call the handler.
+ \csname hldest@typeh@\@hltype\endcsname
+ \fi
+ }%
+ % Define handlers for each supported destination type.
+ \let\hldest@typeh@raw\empty
+ \def\hldest@typeh@fit{%
+ \special{\hldest@preamble /Fit]}%
+ }%
+ \def\hldest@typeh@fith{%
+ \special{\hldest@preamble /FitH
+ \ifx\hldest@opt@top\empty @ypos \else \hldest@opt@top \fi]}%
+ }%
+ \def\hldest@typeh@fitv{%
+ \special{\hldest@preamble /FitV
+ \ifx\hldest@opt@left\empty @xpos \else \hldest@opt@left \fi]}%
+ }%
+ \def\hldest@typeh@fitb{%
+ \special{\hldest@preamble /FitB]}%
+ }%
+ \def\hldest@typeh@fitbh{%
+ \special{\hldest@preamble /FitBH
+ \ifx\hldest@opt@top\empty @ypos \else \hldest@opt@top \fi]}%
+ }%
+ \def\hldest@typeh@fitbv{%
+ \special{\hldest@preamble /FitBV
+ \ifx\hldest@opt@left\empty @xpos \else \hldest@opt@left \fi]}%
+ }%
+ \def\hldest@typeh@fitr{%
+ \special{\hldest@preamble /FitR
+ \ifx\hldest@opt@left\empty @xpos\else\hldest@opt@left\fi\space
+ \ifx\hldest@opt@bottom\empty @ypos\else\hldest@opt@bottom\fi\space
+ \ifx\hldest@opt@right\empty @xpos\else\hldest@opt@right\fi\space
+ \ifx\hldest@opt@top\empty @ypos\else\hldest@opt@top \fi]}%
+ }%
+ \def\hldest@typeh@xyz{%
+ \begingroup
+ % Convert zoom factor: 12345 -> 12.345
+ \ifx\hldest@opt@zoom\empty
+ \count1=\z@ \count2=\z@
+ \else
+ \count2=\hldest@opt@zoom
+ \count1=\count2 \divide\count1 by 1000
+ \count3=\count1 \multiply\count3 by 1000
+ \advance\count2 by -\count3
+ \fi
+ \special{\hldest@preamble /XYZ
+ \ifx\hldest@opt@left\empty @xpos\else\hldest@opt@left\fi\space
+ \ifx\hldest@opt@top\empty @ypos\else\hldest@opt@top\fi\space
+ \the\count1.\the\count2]}%
+ \endgroup
+ }%
+ %
+ % Hyperlinks.
+ %
+ % Default type.
+ \def\hl@type{name}%
+ % We support `url' hyperlinks, so set `url' group type.
+ \ifx\hl@type@url\empty
+ \def\hl@type@url{url}%
+ \fi
+ % Set defaults for the options and tell \hl@set@opt what options we
+ % support.
+ \def\hl@opt@bstyle {S}%
+ \def\hl@opt@bwidth {1}%
+ \let\hl@opt@bcolor \empty
+ \let\hl@opt@hlight \empty
+ \let\hl@opt@bdash \empty
+ \let\hl@opt@pagefit \empty
+ \let\hl@opt@cmd \empty
+ \let\hl@opt@file \empty
+ \let\hl@opt@newwin \empty
+ % Multiplexer for all supported link types.
+ \def\hl@driver{%
+ % Special case for `raw' links.
+ \ifx\@hltype\hl@raw@word
+ \csname \hl@opt@cmd \endcsname
+ \else
+ % See if we will construct a /BS spec. We want to bother only
+ % if any of \hl@opt@bstyle, \hl@opt@bwidth and \hl@opt@bdash is
+ % not empty.
+ \let\hl@BSspec\relax % construct
+ \ifx\hl@opt@bstyle \empty
+ \ifx\hl@opt@bwidth \empty
+ \ifx\hl@opt@bdash \empty
+ \let\hl@BSspec\empty % don't construct
+ \fi
+ \fi
+ \fi
+ % Construct common preamble of a link.
+ \def\hlstart@preamble{%
+ pdf: beginann
+ <<%
+ /Type/Annot%
+ /Subtype/Link%
+ \ifx\hl@opt@bcolor\empty\else /C[\hl@opt@bcolor]\fi
+ \ifx\hl@opt@hlight\empty\else /H/\hl@opt@hlight\fi
+ \ifx\hl@BSspec\relax
+ /BS<<%
+ /Type/Border%
+ \ifx\hl@opt@bstyle\empty\else /S/\hl@opt@bstyle\fi
+ \ifx\hl@opt@bwidth\empty\else /W \hl@opt@bwidth\fi
+ \ifx\hl@opt@bdash\empty \else /D[\hl@opt@bdash]\fi
+ >>%
+ \fi
+ }%
+ % Call the handler.
+ \csname hl@typeh@\@hltype\endcsname
+ \fi
+ }%
+ % Link type handlers.
+ \let\hl@typeh@raw\empty
+ \def\hl@typeh@name{\special{\hlstart@preamble /Dest(\@hllabel)>>}}%
+ \def\hl@typeh@page{%
+ % PDF requires pages to start from 0, so adjust page number.
+ \count@=\@hllabel
+ \advance\count@ by-1
+ %
+ \special{%
+ \hlstart@preamble
+ /Dest[\the\count@
+ \ifx\hl@opt@pagefit\empty/Fit\else\hl@opt@pagefit\fi]%
+ >>%
+ }%
+ }%
+ \def\hl@typeh@filename{\hl@file{(\@hllabel)}}%
+ \def\hl@typeh@filepage{%
+ % PDF requires pages to start from 0, so adjust page number.
+ \count@=\@hllabel
+ \advance\count@ by-1
+ %
+ \hl@file{%
+ [\the\count@ \ifx\hl@opt@pagefit\empty/Fit\else\hl@opt@pagefit\fi]%
+ }%
+ }%
+ \def\hl@file##1{%
+ \special{%
+ \hlstart@preamble
+ /A<<%
+ /Type/Action%
+ /S/GoToR%
+ /D##1%
+ /F(\hl@opt@file)%
+ \ifx\hl@opt@newwin\empty \else
+ /NewWindow \ifcase\hl@opt@newwin false\else true\fi
+ \fi
+ >>%
+ >>%
+ }%
+ }%
+ \def\hl@typeh@url{%
+ \special{%
+ \hlstart@preamble
+ /A<<%
+ /Type/Action
+ /S/URI%
+ /URI(\@hllabel)%
+ >>%
+ >>%
+ }%
+ }%
+ %
+ \def\@hlend{\special{pdf: endann}\endgroup}% End the group from \@hlstart.
+}%
+%
+% Internal hyperlink macros.
+%
+% \hl@define@eqlabel{LABEL} will define \hl@eqlabel to a non-empty
+% hyperlink label for an equation. The idea is to generate
+% (hopefully) unique label in cases when LABEL is empty (e.g., when
+% user says `\eqdef{}'). To customize the autogenerated labels
+% redefine \phantomeqlabel.
+%
+\newcount\phantomeqnumber
+\def\phantomeqlabel{PHEQ\the\phantomeqnumber}%
+%
+\def\hl@define@eqlabel#1{%
+ % Make all definitions global so they are not shadowed by groups
+ % (\@eqdef depends on this).
+ \ifempty{#1}%
+ \global\advance\phantomeqnumber by1
+ \xdef\hl@eqlabel{\phantomeqlabel}%
+ \else
+ \gdef\hl@eqlabel{#1}%
+ \fi
+}%
+%
+% Cross-reference macros call hyperlink macros, so define them to
+% produce nothing by default. However, we still want \hldest and
+% \hlstart to produce \leavevmode and/or \ignorespaces, to make
+% cross-reference macros consistent. Note that this, strictly
+% speaking, makes cross-reference macros incompatible with
+% pre-hyperlink releases of eplain, in cases where paragraph is
+% started by a cross-reference macro. It is quite unlikely though
+% that any problem will arise.
+\let\hldeston\relax \let\hldestoff\relax
+\let\hlon\relax \let\hloff\relax
+\@@hloff
+\@@hldestoff
+%
+%
+%
+% Support for LaTeX packages under plain TeX.
+%
+% We use miniltx.tex from the LaTeX graphics collection and build on
+% it to provide package options support, package version check,
+% recursive package loading with \RequirePackage, proper handling of
+% \AtBeginDocument and \AtEndOfPackage.
+%
+% Much of the following was borrowed from LaTeX.
+%
+% The internal variables are quite a mess, so here is a hint:
+%
+% - \usepkg@pkg, \usepkg@options, \usepkg@date are used by
+% \usepackage to save its parameters.
+%
+% - When \RequirePackage is called within a package, the above
+% variables are saved in \usepkg@save@VAR@RECURSIONLEVEL, where
+% VAR={pkg,options,date}, and RECURSIONLEVEL is incremented for
+% each nested package inclusion. This way the variables can be
+% restored after the (nested) package will have been loaded.
+%
+% - Options for package PACKAGE (no .sty extension) are accumulated
+% in \usepkg@options@PACKAGE.
+%
+% - For each declared option OPTION in package PACKAGE, we save the
+% code which enables OPTION in \usepkg@option@PACKAGE@OPTION.
+% There may be a star (`*') option declaration, the code from which
+% will be used to process options not declared by the package
+% (without it, an undeclared option will cause an error).
+%
+% - For each loaded PACKAGE / FILE.EXT we declare \ver@PACKAGE.sty /
+% \ver@FILE.EXT. We use \ver@PACKAGE.sty to detect reloading
+% of packages. Some packages also use these macros.
+%
+% - Calls to \AtBeginDocument accumulate the code in
+% \usepkg@at@begin@document. We will expand it at the end of the
+% \beginpackages...\endpackages `environment'.
+%
+% - Calls to \AtEndOfPackage accumulate the code in
+% \usepkg@at@end@of@package. We will expand it after the package
+% is loaded. To allow recursive package loading, \RequirePackage
+% saves \usepkg@at@end@of@package analogous to \usepkg@pkg.
+%
+\newif\ifusepkg@miniltx@loaded
+\newcount\usepkg@recursion@level
+\def\usepkg@rcrs{\the\usepkg@recursion@level}%
+\let\usepkg@at@begin@document\empty
+\let\usepkg@at@end@of@package\empty
+\def\usepkg@word@autopict{autopict}%
+\def\usepkg@word@psfrag{psfrag}%
+% \beginpackages...\endpackages
+%
+% All packages must be loaded within this `environment' (a kind of
+% LaTeX's preamble). This is so to give us a chance to expand the
+% accumulated \AtBeginDocument commands. Usually, you will want to
+% restrict all \usepackage's to a single \beginpackages...\endpackages,
+% just like in LaTeX, where you load all packages within a (single)
+% preamble.
+\long\def\beginpackages#1\endpackages{%
+ \let\usepackage\real@usepackage
+ #1%
+ \usepkg@at@begin@document
+ \global\let\usepkg@at@begin@document\empty
+ \global\let\usepackage\fake@usepackage
+}%
+% \fake@usepackage
+%
+% This is what \usepackage is defined to outside of
+% \beginpackages...\endpackages `environment'.
+\def\fake@usepackage{\errmessage{You should not use \string\usepackage\space outside of^^J
+ \@spaces\string\beginpackages...\string\endpackages\space environment}%
+}%
+% \RequirePackage[OPTIONS]{PACKAGES}[YYYY/MM/DD]
+%
+% Save parameters for the package being loaded and call \usepackage to
+% load PACKAGES. We depend on \usepackage to restore the saved
+% parameters. We allow for nested calls to \RequirePackage.
+\def\eplain@RequirePackage{%
+ \global\ece\let{usepkg@save@pkg\usepkg@rcrs}\usepkg@pkg
+ \global\ece\let{usepkg@save@options\usepkg@rcrs}\usepkg@options
+ \global\ece\let{usepkg@save@date\usepkg@rcrs}\usepkg@date
+ \global\ece\let{usepkg@at@end@of@package\usepkg@rcrs}\usepkg@at@end@of@package
+ \global\advance\usepkg@recursion@level by\@ne
+ \real@usepackage
+}%
+% \usepackage[OPTIONS]{PACKAGES}[YYYY/MM/DD]
+%
+% Load each of the PACKAGES with OPTIONS, checking that the package
+% date is at least YYYY/MM/DD; if it is not, issue a warning.
+\let\usepackage\fake@usepackage
+\def\real@usepackage{\@getoptionalarg\@finusepackage}%
+\def\@finusepackage#1{%
+ \let\usepkg@options\@optionalarg
+ \ifempty{#1}%
+ \errmessage{No packages specified}%
+ \fi
+ % Load miniltx.tex, if it is not loaded.
+ \ifusepkg@miniltx@loaded \else
+ \testfileexistence[miniltx]{tex}%
+ \if@fileexists
+ \input miniltx.tex
+ \global\usepkg@miniltx@loadedtrue
+ % Redefine some macros from miniltx.tex
+ \global\let\RequirePackage\eplain@RequirePackage
+ \global\let\DeclareOption\eplain@DeclareOption
+ \global\let\PassOptionsToPackage\eplain@PassOptionsToPackage
+ \global\let\ExecuteOptions\eplain@ExecuteOptions
+ \global\let\ProcessOptions\eplain@ProcessOptions
+ \global\let\AtBeginDocument\eplain@AtBeginDocument
+ \global\let\AtEndOfPackage\eplain@AtEndOfPackage
+ \global\let\ProvidesFile\eplain@ProvidesFile
+ \global\let\ProvidesPackage\eplain@ProvidesPackage
+ \else
+ \errmessage{miniltx.tex not found, cannot load LaTeX packages}%
+ \fi
+ \fi
+ % Read the trailing optional arg (YYYY/MM/DD).
+ \@ifnextchar[%]
+ {\@finfinusepackage{#1}}%
+ {\@finfinusepackage{#1}[]}%
+}%
+%
+\def\@finfinusepackage#1[#2]{%
+ \edef\usepkg@date{#2}%
+ % Load each package from the list. Do it outside the \for loop to
+ % avoid clashes with any \for loops executed by the package.
+ \let\usepkg@load@list\empty
+ \for\usepkg@pkg:=#1\do{%
+ \toks@=\expandafter{\usepkg@load@list}%
+ \edef\usepkg@load@list{%
+ \the\toks@
+ \noexpand\usepkg@load@pkg{\usepkg@pkg}%
+ }%
+ }%
+ \usepkg@load@list
+ % Restore parameters in case we were called from \RequirePackage.
+ \ifnum\usepkg@recursion@level>0
+ \global\advance\usepkg@recursion@level by\m@ne
+ \expandafter\let\expandafter\usepkg@pkg\csname usepkg@save@pkg\usepkg@rcrs\endcsname
+ \expandafter\let\expandafter\usepkg@options\csname usepkg@save@options\usepkg@rcrs\endcsname
+ \expandafter\let\expandafter\usepkg@date\csname usepkg@save@date\usepkg@rcrs\endcsname
+ \expandafter\let\expandafter\usepkg@at@end@of@package\csname usepkg@at@end@of@package\usepkg@rcrs\endcsname
+ % Free the memory.
+ \global\ece\let{usepkg@save@pkg\usepkg@rcrs}\undefined
+ \global\ece\let{usepkg@save@options\usepkg@rcrs}\undefined
+ \global\ece\let{usepkg@save@date\usepkg@rcrs}\undefined
+ \global\ece\let{usepkg@at@end@of@package\usepkg@rcrs}\undefined
+ \fi
+}%
+% Load one package. We assume packages have `sty' extension.
+\def\usepkg@load@pkg#1{%
+ % Special cases for `autopict' and `psfrag' packages:
+ % - `psfrag' is loaded by psfrag.tex.
+ % - `autopict' is loaded by picture.tex, but the package file is
+ % autopict.sty.
+ \def\usepkg@pkg{#1}%
+ \ifx\usepkg@pkg\usepkg@word@autopict
+ \testfileexistence[picture]{tex}%
+ \if@fileexists \else
+ \errmessage{Loader `picture.tex' for package `\usepkg@pkg' not found}%
+ \fi
+ \else
+ \ifx\usepkg@pkg\usepkg@word@psfrag
+ \testfileexistence[psfrag]{tex}%
+ \if@fileexists \else
+ \errmessage{Loader `psfrag.tex' for package `\usepkg@pkg' not found}%
+ \fi
+ \fi
+ \fi
+ % See if the package was loaded. If it was, we just bail out.
+ % (Maybe we should skip reloading it/warn? We don't want to go into
+ % checking that the package was first loaded with a subset of
+ % options which are requested now.) \ProvidePackage and
+ % \ProvideFile define the macro \ver@PACKAGE.sty (see
+ % \eplain@pr@videpackage below).
+ \ifundefined{ver@\usepkg@pkg.sty}\else
+ \errmessage{Package `\usepkg@pkg' already loaded}%
+ \fi
+ \testfileexistence[\usepkg@pkg]{sty}%
+ \if@fileexists \else
+ \errmessage{Package `\usepkg@pkg' not found}%
+ \fi
+ % Construct option list for the package. Include any options
+ % passed to us by \PassOptionsToPackage and \RequirePackage.
+ \expandafter\let\expandafter\temp\csname usepkg@options@\usepkg@pkg\endcsname
+ \ifx\temp\relax
+ \let\temp\empty
+ \fi
+ \ifx\temp\empty
+ \let\temp\usepkg@options
+ \else
+ \ifx\usepkg@options\empty \else
+ \edef\temp{\temp,\usepkg@options}%
+ \fi
+ \fi
+ \global\ece\let{usepkg@options@\usepkg@pkg}\temp
+ % For the duration of the package, we want any calls to \usepackage
+ % to be mapped to \RequirePackage, to allow nested package loads
+ % without clobbering up anything. (Maybe packages never use
+ % \usepackage instead of \RequirePackage, but this won't hurt.)
+ \let\usepackage\eplain@RequirePackage
+ % Clear \AtEndOfPackage commands (can be non-empty during recursive
+ % package loading).
+ \global\let\usepkg@at@end@of@package\empty
+ % Load the package. If the package asks to load other package,
+ % \RequirePackage will save our \usepkg@{pkg,options,date} and
+ % \AtEndOfPackage commands, and \usepackage will restore them after
+ % recursively loading that package, so we don't worry about our
+ % setup being clobbered.
+ \ifx\usepkg@pkg\usepkg@word@autopict
+ \input picture.tex
+ \else
+ \ifx\usepkg@pkg\usepkg@word@psfrag
+ \input \usepkg@pkg.tex
+ \else
+ \input \usepkg@pkg.sty
+ \fi
+ \fi
+ % Execute the accumulated \AtEndOfPackage commands, and reset them
+ % to free the memory.
+ \usepkg@at@end@of@package
+ \global\let\usepkg@at@end@of@package\empty
+ % Restore the `real' \usepackage definition.
+ \let\usepackage\real@usepackage
+ % Clear the option list for the loaded package (we won't load a
+ % second copy anyway).
+ \global\ece\let{usepkg@options@\usepkg@pkg}\undefined
+ % Set \Url@HyperHook for url.sty
+ \def\Url@HyperHook##1{\hlstart@impl{url}{\Url@String}##1\hlend@impl{url}}%
+ % We check package version in \ProvidePackage, before reading the
+ % rest of the package, so that in case of errors (which can be
+ % numerous) the warning hopefully comes before the errors.
+% \@ifl@ter{sty}\usepkg@pkg\usepkg@date{}%
+% {\message{Warning: you have requested package `\usepkg@pkg', version \usepkg@date,^^J
+% \@spaces but only version `\csname ver@\usepkg@pkg.sty\endcsname' is available.}}%
+}%
+% \DeclareOption{OPTION}{CODE}
+%
+% Save CODE in `usepkg@option@PACKAGE@OPTION'. Starred version is not
+% treated any different here, but when defined it will be used by
+% \ProcessOptions and \ExecuteOptions to process undeclared options.
+\def\eplain@DeclareOption#1#2{%
+ \toks@{#2}%
+ \expandafter\xdef\csname usepkg@option@\usepkg@pkg @#1\endcsname{\the\toks@}%
+}%
+% \PassOptionsToPackage{OPTIONS}{PACKAGES}
+%
+% Add OPTIONS to the option list for each of the PACKAGES.
+\def\eplain@PassOptionsToPackage#1#2{%
+ \ifempty{#1}\else
+ \for\usepkg@temp:=#2\do{%
+ \expandafter\let\expandafter\temp\csname usepkg@options@\usepkg@temp\endcsname
+ \ifx\temp\relax
+ \let\temp\empty
+ \fi
+ \ifx\temp\empty
+ \edef\temp{#1}%
+ \else
+ \edef\temp{\temp,#1}%
+ \fi
+ \global\ece\let{usepkg@options@\usepkg@temp}\temp
+ }%
+ \fi
+}%
+% \ExecuteOptions{OPTIONS}
+% \ProcessOptions
+%
+% \ExecuteOptions executes each option from OPTIONS, \ProcessOptions
+% executes each option from the option list for the current package.
+% If the star (`*') option is declared, it will be used to process
+% undeclared options; otherwise, undeclared option will cause an
+% error.
+\def\usepkg@exec@options#1{%
+ % The iterator \CurrentOption below was used purposely. Some
+ % packages use it in the argument to \DeclareOption.
+ \for\CurrentOption:=#1\do{%
+ \expandafter\let\expandafter\usepkg@temp
+ \csname usepkg@option@\usepkg@pkg @\CurrentOption\endcsname
+%
+ \ifx\usepkg@temp\relax
+ % Option is not declared. If a `default' option handler is
+ % declared, use it.
+ \expandafter\let\expandafter\temp\csname usepkg@option@\usepkg@pkg @*\endcsname
+ \ifx\temp\relax
+ \errmessage{Unknown option `\CurrentOption' to package `\usepkg@pkg'}%
+ \else
+ \temp
+ \fi
+ \else
+ % Option is declared.
+ \usepkg@temp
+ \fi
+ }%
+}%
+%
+\let\eplain@ExecuteOptions\usepkg@exec@options
+\def\eplain@ProcessOptions{%
+ \expandafter\usepkg@exec@options\csname usepkg@options@\usepkg@pkg\endcsname
+}%
+% \AtBeginDocument{CODE}
+% \AtEndOfPackage{CODE}
+%
+% miniltx.tex defines \AtBeginDocument to execute its parameter right
+% away, but some packages depend on \AtBeginDocument to be executed
+% after packages are processed. So we redefine \AtBeginDocument to
+% accumulate its argument, to be executed by us at the end of
+% \beginpackages...\endpackages. \AtEndOfPackage is not defined by
+% miniltx.tex at all; we define it similar to \AtBeginDocument.
+\def\usepkg@accumulate@cmds#1#2{%
+ \toks@=\expandafter{#1}%
+ \toks@ii={#2}%
+ \xdef#1{\the\toks@\the\toks@ii}%
+}%
+\def\eplain@AtBeginDocument{\usepkg@accumulate@cmds\usepkg@at@begin@document}%
+\def\eplain@AtEndOfPackage{\usepkg@accumulate@cmds\usepkg@at@end@of@package}%
+% \ProvidesFile{FILENAME.EXT}[VERSION]
+% \ProvidesPackage{PACKAGENAME}[VERSION]
+%
+% miniltx.tex defines \ProvidesFile and \ProvidesPackage to only log a
+% message. We want to define \ver@PACKAGE.sty / \ver@FILENAME.EXT, as
+% we depend on these to know when a package/file has been loaded, and
+% some packages depend on them, too.
+\def\eplain@ProvidesPackage#1{%
+ \@ifnextchar[%]
+ {\eplain@pr@videpackage{#1.sty}}{\eplain@pr@videpackage#1[]}%
+}%
+\def\eplain@pr@videpackage#1[#2]{%
+ \wlog{#1: #2}%
+ % This will flag the package as loaded.
+ \expandafter\xdef\csname ver@#1\endcsname{#2}%
+% \expandafter\edef\expandafter\temp{\csname usepkg@options@\usepkg@pkg\endcsname}%
+% \message{^^JPackage:\usepkg@pkg^^JOptions:\usepkg@options^^J+ passed options:\temp^^J}%
+ % Check package version.
+ \@ifl@t@r{#2}\usepkg@date{}%
+ {\message{Warning: you have requested package `\usepkg@pkg', version \usepkg@date,^^J
+ \@spaces but only version `\csname ver@#1\endcsname' is available.}}%
+}%
+%
+\def\eplain@ProvidesFile#1{%
+ \@ifnextchar[%]
+ {\eplain@pr@videfile{#1}}{\eplain@pr@videfile#1[]}%
+}%
+\def\eplain@pr@videfile#1[#2]{%
+ \wlog{#1: #2}%
+ % This will flag the file as loaded.
+ \expandafter\xdef\csname ver@#1\endcsname{#2}%
+ % We don't check file version. graphics calls \ProvideFile to
+ % \includegraphics, and it does not give any date at the beginning
+ % of #2, so checking the date will cause an error.
+}%
+% Check package version. From LaTeX.
+\def\@ifl@ter#1#2{%
+ \expandafter\@ifl@t@r
+ \csname ver@#2.#1\endcsname
+}%
+\def\@ifl@t@r#1#2{%
+ \ifnum\expandafter\@parse@version#1//00\@nil<%
+ \expandafter\@parse@version#2//00\@nil
+ \expandafter\@secondoftwo
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}%
+\def\@parse@version#1/#2/#3#4#5\@nil{#1#2#3#4 }%
+% Needed by some packages.
+\def\@spaces{\space\space\space\space}%
+\def\@inmatherr#1{%
+ \relax
+ \ifmmode
+ \errmessage{The command is invalid in math mode}%
+ \fi
+}%
+%
+%
+%
+\let\wlog = \@plainwlog
+\catcode`@ = \@eplainoldatcode
+%
+\def\fmtname{eplain}%
+\def\eplain{t}%
+{\edef\plainversion{\fmtversion}%
+ \xdef\fmtversion{REPLACE-WITH-VERSION: REPLACE-WITH-DAY-MONTH-YEAR (and plain \plainversion)}%
+}%
+%
+%
+%
+%
+% Local variables:
+% page-delimiter: "^% \f"
+% End:
diff --git a/Master/texmf-dist/source/fontinst/base/CHANGES b/Master/texmf-dist/source/fontinst/base/CHANGES
new file mode 100644
index 00000000000..481d5f3a34d
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/CHANGES
@@ -0,0 +1,644 @@
+--- CHANGES ---
+
+This is the changes log for the fontinst font installation package.
+
+Feb 4 1993, v0.01: Created the file, wrote an afm and enc parser,
+ started on a vpl writer.
+
+Feb 10 1993, v0.02: Rewrote the enc parser, generally hacked around,
+ imported trig.tex to convert Adobe's italic slope (expressed in
+ angles!) into a font dimension (expressed as a ratio!) grrrrrr...
+
+Feb 12 1993, v0.03: Tidied up the comments a bit, moved the
+ \fontlist out of \readafm, added \writepl (as well as \writevpl).
+ Replaced \fake{CHARACTER} by having the .fd file give default
+ definitions for \char-CHARACTER. Added the \map and
+ \ligtable entries to \char-CHARACTER. Redefined \ligtable,
+ \map and \codingscheme as token lists. Moved the \kernpair's
+ into \ligtable.
+
+Feb 16 1993, v0.04: Added FontName, FullName, UnderlineThickness and
+ Notice. Added the source font encodings, and MAPFONT.
+ Discovered a seriousish bug---if a character exists in the afm
+ file but is not in the source encoding, then the fake character
+ is still overwritten, since we don't know what the source
+ encoding is going to be until later. Fixed this by reading in
+ the source encoding first, and looking to see if there is a
+ character in the source encoding for the one in the afm file.
+ Added \topaccent.
+
+17 Feb 1993, v0.05: Added the visual centre parameter to \topaccent,
+ and added \botaccent and \doublechar. Fixed a bug where the
+ default \missingchar had a horizontal rather than a vertical
+ rule. Added \settoken.
+
+19 Feb 1993, v0.06: Fixed a bug whereby a character which was in the
+ source encoding but not in the afm file overwrote it's faked
+ version. Changed the default \missingchar to be independent of
+ the values parsed from the afm file (so it doesn't matter when
+ you set a \missingchar). Added \parameter and \ligatures. Added
+ \kernalikes and \copykern, which meant I had to split \ligtable
+ back into \ligtable and \kerntable, since when you say \copykern
+ you only want the \kerntable copied, not the \ligtable.
+ Redefined \map so that it's more portable---the contents of \map
+ are allowed to assume they start in font \startfont, should move
+ and should finish having moved right by \charwd and in font
+ \stopfont. This makes it possible to have composite characters
+ within composite characters---for example to make <ffi> out of
+ <f><fi> and <fi> is in turn made out of <f><i>.
+
+23 Feb 1993, v0.07: Introduced the \character token list (previously
+ all of the variables had been set by \char-FOO). \botaccent,
+ \topaccent, etc are now commands to be used inside \defchar, so
+ you can say something like \defchar{FOO}{\ifblah ... \botaccent
+ ... \else ... \topaccent ... \fi}. Added \cramchar. Added
+ the shift-left argument to \doublechar.
+
+24 Feb 1993, v0.08: Replaced \charic by \leftbearing and
+ \rightbearing. Made the assingments in a \char-FOO command
+ global, so we can protect local variables. Fixed a bug with
+ \getchar{FOO} which used to end up calling \the\character.
+ However, \the\character may contain other \getchar{BAZ} calls,
+ which will override the values of \kernalike, \source, \target,
+ etc. So \getchar can't call \the\character. Added \shrinkfont.
+ Made all the AFM variables counts rather than dimens. Added
+ \afmunits, and did all the conversion between AFM units and TeX
+ units as late as possible (which means we can alter \afmunits
+ locally and perform scaling). Added \getfont so fonts are now
+ loaded dynamically, and can be scaled. Added \shrinkchar for
+ producing c&sc fonts.
+
+3 Mar 1993, v0.09: Added \fractionchar, \inferiorchar and
+ \superiorchar. No character is produced for characters called
+ .notdef in the target encoding. Produced a first bash at a
+ complement encoding to Cork, containing the Adobe standard and
+ Expert characters missing from Cork.
+
+9 Mar 1993, v0.10: A major spring clean. Introduced ATX and ETX
+ files, so the parser for AFM files now reads an AFM file and writes
+ out the same information in a TeX-friendly fashion as an ATX file.
+ Similarly, an ETX file contains the same information as an ENC file.
+ Introduced \inputatx, \inputetx and \inputenc to input an ATX, ETX
+ or ENC file if it already exists and to make it otherwise.
+
+14 Mar 1993, v0.11: A continuation of the spring clean. Redefined
+ \getchars to define everything locally. Redefined \writechars to
+ read the encoding from a .etx file. Discovered I'd used the command
+ \afmchar twice(!) so I redefined one of them to be \rawchar.
+ Rewrote the LIGTABLE section.
+
+15 Mar 1993, v0.12: Finished the spring clean of the file generation.
+ Redid \writevpl and \writepl. Read the FUD file in after the ATX
+ files, so the FUD file can use the parameters read in by the ATX
+ file. Fixed a bug with \afmchar that wrote incorrect values
+ to \charactersize in the ATX file. Rewrote \fontdimens to write the
+ PARAMETERs out immediately (since we are now writing the VPL file
+ when reading the FUD file). Finished the LIGTABLE section, redid
+ \copykern.
+
+22 Mar 1993, v0.13: Rewrote the generation of ATX files, so kern table
+ information is gathered together as in a LIGTABLE. Renamed
+ \defchars to \readafm. Renamed \writevpl to \makevpl ... \endvpl,
+ and rewrote it to cope with the new syntax of ATX files.
+
+24 Mar 1993, v0.14: Added \lkern and \rkern entries to ATX files,
+ replacing \copykern. Added kern copying to LIGTABLEs.
+
+29 Mar 1993, v0.15: Added \boundarychar, \nextlarger and \varchar.
+ Fixed a bug with \lrkern.
+
+30 Mar 1993, v0.16: Fixed a bug whereby FONTDIMENS was being output
+ rather than FONTDIMEN. Also \writepl was generating a VPL file.
+ And I discovered a bug with dvips that means that fonts generated
+ with designsize and designunits R 9.9945 cause a rounding error
+ and dvips complains about a design size mismatch. Grr... Fixed
+ a bug with outputting ligatures for characters without
+ kernings---previously I output a LABEL without checking that
+ there were actually going to be any LIG instructions (which there
+ might not be if, for example, it was a monoweight font).
+
+4 Apr 1993, v0.17: Added the interactive prompt. Generated the .fd
+ file. \makevpl and \makepl don't overwrite files any
+ longer---they give a message saying `FILENAME.(v)pl already
+ exists.'
+
+17 Apr 1993, v0.18: Added \makefamily, \maketexfont and \makerawfont.
+
+27 Apr 1993, v0.19: Fixed a bug with \finishligs, which caused
+ multiple LABEL instructions to be put down (I had a \labelfalse
+ where I should have had a \labeltrue).
+
+4 Aug 1993, v1.00: Ripped it up and started again... v1.00 is going
+ to be a fairly complete rewrite from the ground up. I can keep:
+
+ * the AFM parser
+ * the ENC parser
+ * much of the VPL and PL writer
+
+ but the fud engine is going to be replaced by the notion of a
+ glyphbase. The idea will be that all of the information kept in
+ the ATX and FUD files will be put into one file called a
+ `glyphbase'. Then we'll have two utilities:
+
+ * \makerawfont{ENCODING}{AFMFILE}{FONTNAME}
+ will convert an AFM file into a glyphbase and a property list.
+
+ * \maketexfont{ENCODING}{GLYPHBASES}{FONTNAME}
+ will convert a collection of glyphbases into a virtual font.
+
+ For example:
+
+ \makerawfont{adobe}{Times-Roman}{ptmr0}
+ \maketexfont{T1ulc}{ptmr0,cork}{ptmrq}
+
+ makes the raw font ptmr0.pl, the glyphbase ptmr0.gly, and then
+ converts the glyphbases ptmr0 and cork into the font ptmrq. This
+ notion of glyphbase will also allow users to modify fonts easily,
+ for example you could write a little ptmhax glyphbase, which
+ would override the default cork glyphbase by saying:
+
+ \maketexfont{T1ulc}{ptmr0,ptmhax,cork}{ptmrq}
+
+ This will make it much easier to tweak fonts. I'll also specify
+ the glyphbase syntax, and do my best to make everything upwardly
+ compatible.
+
+ On the 4th of August I started on the above. I wrote
+ \makeglyphbase, which converts an AFM file into a glyphbase, and
+ I wrote the glyphbase commands to store the glyphbase information
+ in TeX. The main thing that's missing is the PL and VPL writers,
+ and the ligature, nextlarger and varchar entries.
+
+10 Aug 1993, v1.01: Edited trig.tex to remove uses of \then. Separated
+ \maketexfont into \inputglyphbase and \makevirtualfont. Added the
+ ability to write CHARACTER instructions, (OK, but not the MAPFONTs
+ yet).
+
+11 Aug 1993, v1.02: Only output CHARDP, CHARHT and CHARIC when they
+ are positive. Added the MAPFONT and \mapfont instructions.
+
+12 Aug 1993, v1.03: Corrected a bug where I was calling \inputetx
+ *after* an \openout\outfile, which caused the \outfile to be closed,
+ if the etx file had to be generated.
+
+22 Aug 1993, v1.04: Added the concept of variable and number expression.
+ Included trig.tex as part of this file. Changed design size to an
+ integer. Renamed `glyphbase' to `metric file', and changed the
+ syntax of ETX files. Only write out SELECTFONT instructions when
+ necessary.
+
+23 Aug 1993, v1.05: Added the font dimensions.
+
+24 Aug 1993, v1.06: Made the slot of each glyph an int variable like
+ any other. Added dim variables. Made designsize a dim variable,
+ which should cure a bug that was causing design sizes not to match
+ up. Added the LIGTABLE. Fixed a bug with \inputetx and \inputmtx
+ which caused the redefinition of \relax to survive past the
+ \inputFOO command. Fixed a bug with \vplrule, since I'd got the
+ arguments to SETRULE the wrong way round (again!).
+
+25 Aug 1993, v1.07: Added the VARCHAR and NEXTLARGER entries. Added
+ the encoding documentation commands. Renamed the file to
+ fontinst.sty.
+
+26 Aug 1993, v1.08: Added the documentation of MTX files.
+
+27 Aug 1993, v1.09: Corrected a bug with \comment. Added \tfmtomtx.
+ Removed the SCALE argument to \setrawglyph. Added \convertafm to
+ convert integer AFM units to a dimen, trying to minimize rounding
+ errors whilst avoiding rounding errors. Renamed \leftkerning and
+ \rightkerning to \setleftkerning and \setrightkerning.
+
+30 Aug 1993, v1.10: Added \resetwidth, \resetheight, \resetdepth and
+ \resetitalic. Added the ability to use \width{GLYPH} etc. inside
+ \setglyph{GLYPH}. Added everyglyph and everyendglyph.
+
+10 Sep 1993, v1.11: Discovered a bug with the VPL glyphs which was
+ causing it never to write out a SELECTFONT instruction.
+
+13 Sep 1993, v1.12: Added the \familyinst...\endfamilyinst commands.
+ Added commands to zero the fonts between calls of \makefont, so
+ one document can make a large number of fonts.
+
+14 Sep 1993, v1.13: FIRST ALPHA-RELEASE OF V1.
+ Changed the syntax of \useafm and \useetx to use
+ the same parameters as LaTeX NFSS. Removed the prefix f0 from
+ the beginning of the font names, in a pathetic attempt to fit
+ MS-DOS 8+3 filenames. Added the \tempfile command.
+
+4 Oct 1993, v1.14: Removed a spurious \let in \docnextslot. Thanks
+ to Damian Cugley for spotting that one. Added \usetfm to \familyinst.
+
+5 Oct 1993, v1.15: Fixed a bug with \dotfm, which was causing it to
+ generate a PL file, even though the font was already in TFM
+ format! Thanks again to Damian. Also changed
+ \let\Input=\@@input to a catcode hack, just in case fontinst.sty
+ is read in by LaTeX when @ isn't a letter. That one was spotted
+ by Paul Thompson.
+
+6 Oct 1993, v1.16: Replaced Phil Taylor's trig macros with David
+ Carlisle's. Added the PL parser. Fixed a bug with the bug fix
+ for \dotfm, where I'd removed an \inputmtx command that was
+ needed... And I fixed a bug which was causing the VPL files to
+ be generated once for each font that contributed to the VPL file.
+ Damian got those ones as well.
+
+11 Oct 1993, v1.17: Added the SIZE argument to \useafm and \usepl,
+ and redid the FD generation to use the size info. This should
+ allow fonts like Malvern to be generated at different design
+ sizes and still have a sensible FD file. NOTE: This means old
+ fontinst files will no longer work! I also made \pltomtx create
+ a \setdim{designsize} command.
+
+13 Oct 1993, v1.18: Fixed a bug with \calculateitslant which caused
+ it to bomb if the italic angle didn't have a decimal... this was
+ caused by allowing extraneous spaces at the end of the angle.
+ These have now been stripped away. Thanks to Paul Thompson for
+ spotting that one!
+
+15 Oct 1993, v1.19: Discovered a bug with \familyinst, which caused
+ only one ETX file to be loaded. This one was introduced when I
+ added the SIZE arguments, since I reorganized the main
+ \endfamilyinst loop. Serves me right! This is now fixed, but
+ I'm left with the problem that the sensible order to generate VPL
+ files is not the sensible order to generate FD lines in. FD
+ files need the SIZE parameter inside the SERIES and SHAPE,
+ whereas if a font is contributing to a number of SERIES and
+ SHAPEs but only one SIZE, then it's sensible to have it outside
+ the SERIES and SHAPE parameters. Oh dear...
+
+19 Oct 1993, v1.20: Added the glyph `missingglyph' which is produced
+ whenever a glyph is missing.
+
+3 Nov 1993, v1.21: Corrected a bug with \kerning, which was causing
+ \kerning{A}{V} to give the kerning between V and A! And I added
+ the PL names for the math font parameters NUM1--AXISHEIGHT.
+ Damian spotted those ones. Rewrote the main loop as I said I
+ would have to in the note on v1.19, so there's no useless
+ regeneration of fonts now.
+
+17 Nov 1993, v1.22: Restored the final parameter to
+ \DeclareFontShape which had disappeared somehow! Rob Hutchings
+ spotted this one. And I stopped trying to be clever about
+ checking to see if a glyph has been defined before using it.
+ This means you get a horrible error message if you try to use an
+ undeclared glyph, but hey ho. Trying to trap this has caused so
+ many problems with other things breaking that I think I'll give
+ up :-) Added the \glyphwarning command, and removed the
+ `missingglyph' glyph. Docstripped David's trig.doc into
+ trig.sty, so I don't have to worry about trig.doc generating the
+ trig.sty file. Saved the catcodes of ` ', `@', `~' `_' and NL so I
+ so I can use @ and _ for internal macro names, space and NL
+ for ignored white space, and ~ for `real' white space. Renamed
+ all the internal commands (apart from the documentation ones) to
+ have _ in their names.
+
+29 Nov 1993, v1.23: Added a check that a glyph exists before writing
+ it to a (V)PL file... this was causing fontinst to crash if there
+ was a glyph missing from an AFM file. Yannis Haralambous and Paul
+ Thompson spotted this one.
+
+23 Dec 1993, v1.24: Removed the \familyinst...\endfamilyinst interface,
+ and replaced it by \installfonts ... \endinstallfonts, which makes
+ it easier to generate FD files that look like standard LaTeX2e FD
+ files. Removed (I'm not sure if this is a great idea) the ability
+ to specify an encoding for an AFM file, since I'm not sure every
+ dvi-to-ps converter can re-encode raw fonts. I added the
+ \declarefamily command to specify which encoding string corresponds
+ to which ETX file.
+
+24 Dec 1993, v1.25: Redid the \declare... commands, and replaced
+ everyglyh and everyendglyph by sidebearings.
+
+25 Dec 1993, v1.26: Drank a lot.
+
+26 Dec 1993, v1.27: Added \setcommand, \resetcommand and \ifiscommand.
+
+27 Dec 1993, v1.28: Bug-fixes in \setcommand and \resetcommand. Redid
+ \pltomtx so that it can read the encoding from the CODINGSCHEME line
+ in the file. Moved the documentation and tables into fontdoc and
+ fonttab.tex.
+
+28 Dec 1993, v1.29: Removed the fd-commands argument from \makefont,
+ since the FD syntax is to allow FD-commands dependent on
+ encoding/family/series/shape but not on size. This means we can't
+ generate font-specific FD-commands, but I've never seen those used,
+ so I'm not too worried... Fixed a bug with the CC commands, which
+ was producing a glyph with a different width than its horizontal
+ escapement, and I'm not sure what every DVI driver would do with
+ that. Replaced \etxtopl with \mtxtopl. Replaced the GLYPH COMMAND
+ \rawglyph with the MTX COMMAND \setrawglyph.
+
+29 Dec 1993, v1.30: Fixed a bug with \setrawglyph, which wasn't
+ checking to see if the glyph was already defined. Added
+ \unsetglyph. Corrected the spelling of `\immedaite' (sic) in
+ \vpl_nextlarger.
+
+3 Jan 1994, v1.301: The glyph warning message is now only produced when
+ the glyph is used, rather than when it is defined. And I've moved
+ over to three-digit version numbers, since I was going through the
+ two-digit ones quite rapidly. Added \bye, so fontinst documents can
+ run under LaTeX as well as plain TeX. Added \unsetint, \unsetstr,
+ \unsetdim and \unsetcommand. Renamed \makefont and \makefamily to
+ \installfont and \installfamily.
+
+4 Jan 1994, v1.302: Fixed a bug with the definition of \bye.
+
+6 Jan 1994, v1.303: Added the FONTNAME argument to \installfont.
+ Actually got rid of everyglyph.
+
+8 Jan 1994, v1.304: Added minimumkern and \resetglyph. Fixed a bug
+ with \vpl_kerning, which was swapping the left- and right-kerns.
+ Surprising I never spotted this before...
+
+9 Jan 1994, v1.305: Worked on the MTX and ETX files.
+
+10 Jan 1994, v1.306: Worked on the MTX and ETX files.
+
+12 Jan 1994, v1.307: Edited the documentation.
+
+20 Jan 1994, v1.308: Added the rawscale integer variable, and the
+ \setnotglyph command. Redid the way that CC instructions are
+ processed, to use the dimensions stored in the glyph-not variables.
+ Set all of the saved VPL commands to \relax so that they can be
+ \edef'ed on without having to protect them. Replaced some \def\foo{}
+ by \let\foo\empty_command's. Replaced a large definition that was
+ being made by \CHARACTER (when parsing PL files) by a \let. Redid
+ the datatype used to store kerning so it uses control sequences as a
+ compact representation of glyph names. All in all, fontinst now runs
+ in 79% of the time and 77% of the space that it did last week.
+
+21 Jan 1994, v1.309: Saved some more time and space on the kern table.
+
+22 Jan 1994, v1.310: Added the `FONT scaled AMOUNT', made \setkern take
+ account of \int{rawscale}. Moved the change log into a separate
+ CHANGES file. Redid \samesize and \resetwidth so that the width is
+ adjusted by a MOVERIGHT, so the glyph will have the correct horizontal
+ escapement. Corrected a typo which had renamed \resetint to \setint
+ (oops!). Corrected a typo of `itslant' rather than `italicslant'.
+ Added the \transformfont command and \mtxtomtx. Changed the
+ definition of \unfakable{foo} in latin.mtx to look to see if there's a
+ glyph <foo-not> to get the dimensions for. Added a fake <space> and a
+ fake <dotlessj> which is a missing glyph rule with the dimensions
+ combined from <j> and <dotlessi>. Changed the default interword
+ stretch to be 1/3 of interword space, rather than zero. Removed the
+ checks for the existence of <space> and <x> in OT1.etx and T1.etx,
+ since these are now faked in latin.mtx. Renamed the PS/CM math fonts,
+ after a discussion with Karl Berry, added the OMS and OMX math fonts.
+ Added the Greek letters, digits and other humanists to unsetalf.mtx.
+ Added the DEFAULTRULETHICKNESS and BIGOPSPACING commands to the PL
+ parser. Fixed a bug I'd introduced by giving \vartop, \varmid,
+ \varrep and \varbot no parameters. Oops. Created timesmat.sty and
+ testmath.tex. All in all, a reasonable day's work...
+
+23 Jan 1994, v1.311: Added some more tests to testmath.tex. Added the
+ new math sizes to timesmat.sty. Fixed a bug with fontstnd.tex which
+ was causing it to generate the wrong FD entry for italic fonts. Fixed
+ a bug with CHARACTER parsing in \pltomtx which wasn't resetting the
+ values of WIDTH, HEIGHT, DEPTH and CHARIC between glyphs.
+
+24 Jan 1994, v1.312: Added the SEVENBITSSAFE command to the PL parser.
+
+25 Jan 1994, v1.313: Restored the catcode of ~, which I'd left as 10.
+ Made /, < and > in zptmcmrm come from cmmi rather than ptmri. Added
+ zptmcmr to fontptcm.tex, which is Adobe Times with +, =, (, ), [ and ]
+ taken from CMR. This means that [...] and (...) in text is different
+ from in math, but means that the delimiters are the right size for
+ math setting with CM symbols, and match the growing delimiters in cmex.
+ Moved the files ptmcmhax.mtx and psycmhax.mtx to zrmhax.mtx and
+ zrvhax.mtx.
+
+27 Jan 1994, v1.314: Took the textstyle and displaystyle big operators
+ in zpsycmrv from cmex8 rather than cmex10, since they are more
+ suitably sized for the <summation> and <product> from Adobe Symbol.
+ Made all the accents in latin.mtx zero depth (which TeX's math accent
+ placement requires). Discovered that cmex8 doesn't have a
+ CODINGSCHEME, so I added one by hand to the PL file.
+
+30 Jan 1994, v1.315: Replaced cmex8 in zpsycmrv by cmex9. Added
+ <epsilon1>, <pi1> and <rho1> to unsethum.mtx. Added the \skewchar
+ declaration for zptmcmrm. Fixed a bug which was causing negative
+ mathchardefs. Finished off the skewchar kerns for zptcmrm.
+ Renamed timesmat.sty to mathptm.sty, since there's already a
+ timesmat.sty.
+
+7 Feb 1994, v1.316: Fixed the \ProvidesPackage line in mathptm.sty.
+
+8 Feb 1994, v1.317: Fixed a bug with fontptcm.tex where I'd put the
+ \skewchar command in the wrong argument! Made the `size' argument
+ to \installfont an FD size specification. Added fakes for <lslash>
+ and <Lslash> built from <lslashslash> to latin.mtx. Added a check
+ that a ligature glyph exists before writing out the LIGTABLE entry.
+ Edited the documentation a bit---thanks to Karl Berry for comments.
+ Added the fontcmro example, inspired by Norman Walsh. Fixed a bug
+ with .fd file generation which caused multiple \DeclareFontShape
+ entries to be produced. Added \unfakable{endash} and
+ \unfakable{emdash} to latin.mtx. Sebastian spotted that one.
+
+10 Feb 1994, v1.318: Added \unfakable{dotlessi} to latin.mtx. Karl
+ Berry pointed that one out.
+
+1 Mar 1994, v1.319: Added the HEADER. Karl Berry pointed that one out
+ too.
+
+6 Apr 1994, v1.320: Write out a LABEL BOUNDARYCHAR ligable entry where
+ necessary. Alan Hoenig pointed that one out. Rewrote mathptm.sty
+ to remove some of the nastier hacks.
+
+7 Apr 1994, v1.321: Added the ability to generate font substitutions
+ in the FD files.
+
+8 Apr 1994, v1.322: Fixed a bug with font substitution which was
+ causing the font substitutions to be written out before the real
+ fonts. Moved the mathptm package to standing on its own.
+
+17 Apr 1994, v1.323: Added the top-level \latinfamily commands, and
+ updated the example files and documentation to use them. Added
+ OT1ci.etx. Made the list of files in an \installfont command
+ expanded before running along the list, so you can have a macro
+ which expands out to a list of files now. Added substitutions for
+ semibold and demibold, for upright italic, and for sc to nc. Added
+ OT19.etx, OT1c9.etx, OT1ci9.etx, OT1i9.etx, T19.etx and T1c9.etx.
+ Removed OT1o.etx.
+
+19 Apr 1994, v1.324: Removed italic and oblique small caps. Fixed a
+ bug which was causing the latin.mtx file to be read in inside a
+ group if a latin family without an expert font was created.
+
+25 Apr 1994, v1.325: Removed a bug which caused sc fonts to have the
+ same names as u&lc fonts. Fixed a bug which was causing oblique
+ fonts not to be generated properly. Fixed a bug with FD
+ generation which was producing too few arguments for
+ DeclareFontShape for substitutions.
+
+27 May 1994, v1.326: Made fontinst.tex a 2e document. Fixed a bug
+ with generating slant which was generating slant in design size per
+ point rather than points per point. Sigh. Ciar\'an \'O Duibh\'in
+ spotted that one. Declared this to be the first full release.
+
+1 Jun 1994, v1.327: Fixed bug with filename parsing which was losing
+ variants. Rewrote the encoding files to use the OT1 tt encoding
+ whenever monoweight is set. Removed the f-liagatures from the T1
+ encoding for monowidth fonts. Sebastian spotted that one.
+
+2 Jun 1994, v1.328: Fixed a bug with FD generation: I'd added the
+ extra argument for series substitutions but not shape
+ substitutions. Ta Sebastian again.
+
+3 Jun 1994, v1.329: Made Upsilon1 unfakable.
+
+15 Jun 1994, v1.330: Fixed a bug with font substitution which was
+ ignoring chains of substitutions such as bx -> b -> db. Added the
+ m->l substitution. Renamed the `mn' and `bn' series to `mc' and
+ 'bc'. Added the `k' and `m' series.
+
+16 Jun 1994, v1.331: Sebastian spotted another problem with
+ substitutions. If a font had both a series and a shape
+ substitution, the series was sometimes getting lost.
+ Steve Grathwohl pointed out that I'd forgotten to switch off
+ kerning before loading the math italic fonts in fontcmro.
+
+27 Jun 1994, v1.332: Added braces to \needsfontinstversion, which was
+ clobbering \a_dimen and \b_dimen. Fixed a bug with compwordmark
+ which was causing it to get letterspacing added to it. Added the
+ GLYPH-spacing variable to cope with this. These were
+ spotted by Constantin Kahn.
+
+29 Jun 1994, v1.333: Added \ProvidesFile line to the .fd files.
+
+16 Aug 1994, v1.334: Added \frompl, fixed bugs with \resetdim and
+ <ccedilla>---all reported by Constantin Kahn.
+
+9 Sep 1994, v1.335: Fixed a bug with NEXTLARGER and VARCHAR generation
+ which was causing the entries to be printed out for nonexistent
+ glyphs---spotted by Alan Hoenig. Updated the example installation
+ files for Times, Helvetica and Courier. Updated to a more recent
+ trig.sty, and added the hacks to allow trig.sty to be used outside
+ LaTeX2e. Made fontinst.sty initex processable, so you can save
+ memory by building your own fontinst format without plain. Fixed
+ the names of `narrow' fonts, which used to clobber the non-narrow
+ fonts---spotted by Peter Busk Laursen.
+
+12 Sep 1994, v1.336: Fixed a bug with fontcmro, which was listing the
+ 9pt font as being 10pt in the fd file---spotted by Steve Grathwohl.
+
+22 Sep 1994, v1.337: Corrected spelling mistake in \declareencoding in
+ error message of \CODINGSCHEME---spotted by Alan Hoenig.
+
+8 Oct 1994, v1.338: Corrected definition of \space in
+ fontinst.ini---spotted by Rob Hutchings.
+
+18 Nov 1994, v1.339: Added 8r.etx and 8r.enc from Sebastian.
+ Distributed a patched fontinst.rc file containing a reimplementation
+ of \latinfamily that uses the 8r encoding.
+
+21 Nov 1994, v1.400: Added missing \fi to 8r.etx---spotted by Steve
+ Grahthwohl. Added \mtxtopl for expert fonts in
+ \latinfamily---spotted by Rob Hutchings.
+
+29 Nov 1994, v1.401: Added hyphen+hyphenchar = hyphenchar lig to
+ T1.etx (so that foo-bar words can be hyphenated as foo<hyphenchar>
+ bar)---spotted by Frank Mittelbach. Made default stretch and
+ shrink 50% and 16.7% of <space> respectively. Added \everyjob to
+ fontinst.ini to load the fontinst.rc file---spotted by Rob
+ Hutchings.
+
+7 Dec 1994, v1.402: Corrected typos with 8r.etx---spotted by
+ Constantin Kahn.
+
+12 May 1995, v1.403: Mentioned the pl files in fontinst.tex, and added
+ the encoding TEX TEXT WITHOUT F-LIGATURES. Both spotted by John
+ Wells.
+
+16 Sep 1995, v1.500: Incorporated changes by SPQR and CK in their
+ fontinst.rc file. In detail... Added the \NOFILES debugging
+ option. Used SPQR and CK's complete reimplementation of
+ \latinfamily. Added the TEXBASE1ENCODING. Added \etxtopl and
+ \installrawfont. Added the setting of \errorcontextlines. Grabbed
+ T1i.etx from CTAN. Added the setting of \newlinechar (pointed out
+ by Constantin). Fixed bug with \resetcommand which stopped braces
+ around the csname from working (Contantin again). Removed the
+ contrib/zd directory at Constantin's request. Rewrote the
+ documentation. Added fontinst.cls.
+
+[16 Sep 1995, v1.500 on CTAN with fonts/psfonts/tools]
+
+21 Sep 1995, v1.501: Corrected some typos in the documentation.
+ Added kerns for ng, Ng and hyphenchar. Fixed spacing in faked
+ <FFsmall> and friends. Fixed kerning of <dotlessJ>. Raised the
+ <macron> in <dbar> to half-way between the xheight and the height of
+ <d>. Added fake <ng> -> <eng>. Made \cscbotaccent and
+ \csctopaccent look to see if both of the glyphs exist rather than just
+ the first. Thanks to Hilmar Schlegel for all these points.
+
+29 Sep 1995, v1.502: Renamed all the distributed afm files from
+ *0*.afm to *8a*.afm. Updated the file header on 8r.etx.
+ Renamed Karl's fontinst.rc to karl-fontinst.rc, to avoid it being
+ picked up by every punter.
+ All pointed out by Sebastian.
+
+24 Nov 1995, v1.503: Included Alan Hoenig's vfinst in contrib/vfinst.
+
+23 Jan 1996, v1.504: Included some of Sebastian's changes to OT1.etx:
+ upped stretch and shrink to .6 and .24 of space; reduced extra
+ space after . to .24 of space; removed <endash> + <hyphen> =
+ <emdash> ligature from OT1 monowidth; made \setslot{grave}
+ etc. into \setslot{\lc{Grave}{grave}} etc; fixed a bug with T1c
+ `monoweight' -> `monowidth' (!); implemented Rob's changes to
+ small caps and small accented caps; included fake kerning for
+ Udieresis; added hackery from spqr.rc for faking small caps and
+ faking widths.
+
+[28 Jan 1996, v1.504 on CTAN with:fonts/psfonts/tools]
+
+24 Jan 1996, v1.505: Updated fontptcm.tex to use ptmr8a rather than ptmr0.
+
+25 Jan 1996, v1.506: Added extra braces to \latinfamily to stop
+ setting of \digits in one run from affecting it in subsequent
+ runs. Spotted by Richard Walker.
+
+23 Feb 1996, v1.507: Replaced vpltovf by vptovf. Spotted by Sebastian.
+
+17 Jun 1996, v1.508: Added an \ifdim check to stop lots of MOVERIGHT R 0.0
+ instructions being generated. Spotted by Sebastian.
+
+18 Jun 1996, v1.509: Allow real numbers in .afm files. Spotted by
+ Gintautas Grigelionis. Made spaces before ; optional, in order to
+ parse v2.0 afm files (spaces before ; were made compulsory in v3.0).
+
+20 Jun 1996, v1.510: Added 9d and 9o encodings for fonts with
+ old-style digits.
+
+21 Jun 1996, v1.511: Removed \endinput from the end of .fd files, so
+ that additions can be made more easily.
+
+24 Jul 1996, v1.512: Updated version of trig.sty.
+
+7 Aug 1996, v1.513: Moved unfakable glyphs eariler in latin.mtx so
+ that all-caps fonts will work.
+
+6 Feb 1997, v1.514: Added a zero-width rule to cwm in latin.mtx (to
+ stop the MAP entry from being empty). Made cwm 1ex high.
+
+--- Copyright 1993, 1994, 1995, 1996 Alan Jeffrey ---
+
+11 Feb 1997, unofficial v1.6 SPQR on CTAN:fonts/psfonts/tools
+ Derived from v1.504 with minor hacks and fixes (not documented).
+
+29 May 1998, unofficial v1.7 SPQR on CTAN:fonts/psfonts/tools
+ Derived from v1.6 with fixes by UV. Corrected mapping of weights.
+ Added code for 8r-encoded AFM files (intended to cope with ttf2afm
+ limitations, but taken out again after ttf2afm was updated).
+
+22 Jun 1998, unofficial v1.8 UV
+ Derived from v1.7 and v1.511. Many .etx/.mtx files touched up.
+ fontinst.sty and fontdoc.sty now generated from fontinst.dtx.
+ \textcompfamily integrated into \latinfamily. Reintroduced
+ oldstyle encodings (from v1.511). 8y.etx/8y.mtx added as an
+ alternative to 8r.etx/8r.mtx. ts1.etx and textcomp.mtx revised.
+
+30 Jun 1998, unofficial v1.800 UV on CTAN:fonts/utilities/fontinst
+ Several changes to examples/mathptm and examples/mathptmx.
+
+07 Jun 1998, v1.801: Fixed a bug when oldstyle small-caps fonts
+ are generated from <font>8r + <font>8x instead of <font>c8r.
diff --git a/Master/texmf-dist/source/fontinst/base/fibasics.dtx b/Master/texmf-dist/source/fontinst/base/fibasics.dtx
new file mode 100644
index 00000000000..9c459a075b6
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fibasics.dtx
@@ -0,0 +1,2273 @@
+% \CheckSum{1456}
+% \iffalse meta-comment
+%
+% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+% hacked and maintained 1997, 1998 Sebastian Rahtz,
+% copyright 1998, 1999, 2000, 2001 the fontinst maintenance team and any
+% individual authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+%%% From file: fibasics.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey\and Sebastian Rahtz\and Ulrik Vieth\and
+ Lars Hellstr\"om}
+\usepackage{fisource}
+\begin{document}
+\maketitle
+\DocInput{fibasics.dtx}
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \StopEventually{}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{quote}
+% ``Can't say I've ever been too fond of beginnings, myself.
+% \emph{Messy} little things. Give me a good ending any time.
+% You know where you \emph{are} with an ending.''\relax
+% \nobreak\hskip 0pt plus 1fill\penalty0\hskip 2em\relax
+% \vadjust{}\nobreak\hskip 1em plus 1fill\textemdash
+% \ from \emph{The kindly ones} by \textsc{Neil Gaiman} et al.^^A
+% \nobreak\hskip-\parfillskip\vadjust{}
+% \end{quote}
+%
+%
+% \section{The first and the last}
+%
+% \subsection{Version numbers}
+%
+% We start by making some default catcode assignments, in case we are
+% using ini\TeX{}.
+% \begin{macrocode}
+%<*pkg>
+\catcode`\{=1
+\catcode`\}=2
+\catcode`\#=6
+\catcode`\^=7
+%</pkg>
+% \end{macrocode}
+%
+% \begin{macro}{\fontinstversion}
+% If we are running under ini\TeX{} we cannot put the identification
+% stuff any earlier than this. Note that |\fontinstversion| is not
+% just used for indentification but also in |\needsfontinstversion|.
+% \begin{macrocode}
+%<pkg|doc>\def\fontinstversion{1.927}
+% \end{macrocode}
+% \end{macro}
+%
+% If we are running under ini\TeX{} or \texttt{plain}, we have to get
+% around the \LaTeX{}-specific |\ProvidesPackage| stuff.
+%
+% \begin{macrocode}
+%<*pkg>
+\ifx\ProvidesPackage\undefined
+ \def\NeedsTeXFormat#1{}
+ \def\ProvidesPackage#1[#2]{}
+\fi
+%</pkg>
+% \end{macrocode}
+%
+% Now we can identify ourselves as usual.
+%
+% \begin{macrocode}
+%<doc>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<doc>\ProvidesPackage{fontdoc}
+%<pkg>\ProvidesPackage{fontinst}
+%<pkg|doc>[2004/08/07 v\fontinstversion\space
+%<doc> fontinst documentation package]
+%<pkg> fontinst installation package]
+% \end{macrocode}
+%
+% While we're at version numbers anyway, we might as well define the
+% command for testing them. Note however that the module name is not
+% \Module{pkg} as above, but \Module{pkg2}. Code in the latter module
+% ends up at the very end of \texttt{fontinst.sty}!
+%
+% \begin{macro}{\needsfontinstversion}
+% The macro:
+% \begin{quote}
+% |\needsfontinstversion|\marg{number}
+% \end{quote}
+% checks the version number.
+%
+% \begin{macrocode}
+%<*pkg2>
+\def\needsfontinstversion#1{{
+ \a_dimen=#1pt
+ \b_dimen=\fontinstversion~pt\x_relax
+ \ifnum\a_dimen>\b_dimen
+ \immediate\write16{}
+ \immediate\write16{Warning:~This~file~needs~fontinst~version~#1.}
+ \immediate\write16{Warning:~You~are~using~version~
+ \fontinstversion.}
+ \immediate\write16{Warning:~This~may~cause~errors.}
+ \immediate\write16{}
+ \fi
+}}
+%</pkg2>
+% \end{macrocode}
+%
+% In \package{fontdoc}, |\needsfontinstversion| is printed out as a
+% comment.
+% \changes{1.918}{2001/06/19}{Different formatting in encoding
+% specification files. (LH)}
+% \begin{macrocode}
+%<*doc>
+\newcommand*\needsfontinstversion[1]{%
+ \ifFD@spec@
+ \comment{Automatic processing of this document as a data file
+ requires \textsf{fontinst} v\,#1 or higher.}%
+ \else
+ \Bheading{Needs fontinst v\thinspace#1}%
+ \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Special catcodes and configuration file}
+%
+% \package{fontinst} uses some unusual, but convenient, settings of
+% |\catcode|. |@| and |_| are made letters, |~| is made a space, and
+% space and newline are ignored. Before setting those however, we save
+% the current values of the catcodes, so that they can be restored at
+% the end of \texttt{fontinst.sty}.
+%
+% \begin{macro}{\normalcc}
+% \begin{macro}{\fontinstcc}
+% \multchanges{\cs{fontinstcc}\cs{normalcc}}{1.915}{2000/08/09}^^A
+% {Introduced commands for changing between \package{fontinst}
+% internal catcodes and normal catcodes, as suggested by
+% Karsten Tinnefeld. (LH)}
+% The |\fontinstcc| command changes the catcodes of certain characters
+% to what is used in the \package{fontinst} source and the |\normalcc|
+% command changes them back; their use is analogous to that of the
+% |\make|\-|at|\-|letter| and |\make|\-|at|\-|other| commands in
+% \LaTeX.
+%
+% If, for some reason, you use other ``normal'' catcodes than
+% \package{fontinst} does by default, you may have to redefine
+% |\fontinstcc| and |\normalcc|. The easiest way to do this is
+% probably to use the |\add_to| macro.
+%
+% \multchanges{\cs{spacecatcode}\cs{nlcatcode}\cs{atcatcode}^^A
+% \cs{underscorecatcode}\cs{tildecatcode}}{1.915}{2000/08/09}^^A
+% {Removed since the contents can just as well be stored in
+% \cs{normalcc}. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\a_macro#1{\catcode\number`#1=\the\catcode`#1 }
+\edef\normalcc{%
+ \a_macro{\ }\a_macro{\^^M}\a_macro{\@}\a_macro{\_}\a_macro{\~}
+}
+% \end{macrocode}
+% The above definition makes the |\normalcc| macro end with a space.
+% This is deliberate; the space is used to terminate the last number
+% in the macro.
+%
+% \begin{macrocode}
+\def\fontinstcc{%
+ \catcode`\ =9%
+ \catcode`\^^M=9%
+ \catcode`\@=11%
+ \catcode`\_=11%
+ \catcode`\~=10
+}
+\fontinstcc
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% We input the \texttt{fontinst.rc} file, if it exists.\relax
+% \changes{1.6}{1997/02/07}{\texttt{fontinst.rc} search order changed
+% (Thierry Bouche).}\relax
+% \SortIndex{fontinst.rc file}{\texttt{fontinst.rc} file}
+%
+% UV, 06/1998: What is this \texttt{fontinst.rc} file good for?
+% It turns out that you can use it to do |\def\raw_encoding{8y}|
+% if you prefer to install your fonts the other way.
+%
+% \begin{macrocode}
+%<*pkg2>
+%<*!misc>
+\if_file_exists{fontinst.rc}\then
+ \primitiveinput fontinst.rc
+\else
+ \immediate\write16{No~file~fontinst.rc.}
+\fi
+%</!misc>
+% \end{macrocode}
+% Use a different configuration file for \texttt{finstmsc.sty}.^^A
+% \changes{1.905}{1999/06/21}{Different config file for
+% \texttt{finstmsc.sty}. (LH)}
+% \begin{macrocode}
+%<*misc>
+\if_file_exists{finstmsc.rc}\then
+ \primitiveinput finstmsc.rc
+\else
+ \immediate\write16{No~file~finstmsc.rc.}
+\fi
+%</misc>
+% \end{macrocode}
+%
+% At the end of \texttt{fontinst.sty}, we restore the catcodes we
+% changed.
+% \changes{1.910}{1999/11/01}{Catcodes restored \emph{after} reading
+% \texttt{.rc} file. (LH\&UV)}
+%
+% \begin{macrocode}
+\normalcc
+%</pkg2>
+% \end{macrocode}
+%
+%
+% \subsection
+% {Plain \TeX{} macros from \texttt{fontinst.ini}}
+% ^^A \subsection{PlainTeX macros from fontinst.ini}
+%
+% If we're running in ini\TeX{} we input some definitions taken
+% from \texttt{plain}.
+%
+% \begin{macrocode}
+%<*pkg>
+\ifx\@ne\undefined_command
+ \input fontinst.ini\relax
+\fi
+%</pkg>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ini>
+\chardef\active=13
+
+\chardef\@ne=1
+\chardef\tw@=2
+\chardef\thr@@=3
+\chardef\sixt@@n=16
+\chardef\@cclv=255
+\mathchardef\@cclvi=256
+\mathchardef\@m=1000
+\mathchardef\@M=10000
+\mathchardef\@MM=20000
+
+\count10=22 % allocates \count registers 23, 24, ...
+\count11=9 % allocates \dimen registers 10, 11, ...
+\count15=9 % allocates \toks registers 10, 11, ...
+\count16=-1 % allocates input streams 0, 1, ...
+\count17=-1 % allocates output streams 0, 1, ...
+\count20=255 % allocates insertions 254, 253, ...
+\countdef\insc@unt=20 % the insertion counter
+\countdef\allocationnumber=21 % the most recent allocation
+\countdef\m@ne=22 \m@ne=-1 % a handy constant
+\def\wlog{\immediate\write\m@ne} % write on log file (only)
+
+\countdef\count@=255
+\dimendef\dimen@=0
+
+\outer\def\newcount{\alloc@0\count\countdef\insc@unt}
+\outer\def\newdimen{\alloc@1\dimen\dimendef\insc@unt}
+\outer\def\newtoks{\alloc@5\toks\toksdef\@cclvi}
+\outer\def\newread{\alloc@6\read\chardef\sixt@@n}
+\outer\def\newwrite{\alloc@7\write\chardef\sixt@@n}
+
+\def\alloc@#1#2#3#4#5{\global\advance\count1#1by\@ne
+ \ch@ck#1#4#2% make sure there's still room
+ \allocationnumber=\count1#1%
+ \global#3#5=\allocationnumber
+ \wlog{\string#5=\string#2\the\allocationnumber}}
+\outer\def\newinsert#1{\global\advance\insc@unt by\m@ne
+ \ch@ck0\insc@unt\count
+ \ch@ck1\insc@unt\dimen
+ \ch@ck2\insc@unt\skip
+ \ch@ck4\insc@unt\box
+ \allocationnumber=\insc@unt
+ \global\chardef#1=\allocationnumber
+ \wlog{\string#1=\string\insert\the\allocationnumber}}
+\def\ch@ck#1#2#3{\ifnum\count1#1<#2%
+ \else\errmessage{No~room~for~a~new~#3}\fi}
+
+\outer\def\newif#1{\count@\escapechar \escapechar\m@ne
+ \expandafter\expandafter\expandafter
+ \edef\@if#1{true}{\let\noexpand#1=\noexpand\iftrue}%
+ \expandafter\expandafter\expandafter
+ \edef\@if#1{false}{\let\noexpand#1=\noexpand\iffalse}%
+ \@if#1{false}\escapechar\count@} % the condition starts out false
+\def\@if#1#2{\csname\expandafter\if@\string#1#2\endcsname}
+{\uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}} % `if' is required
+
+\newdimen\p@ \p@=1pt % this saves macro space and time
+\newdimen\z@ \z@=0pt % can be used both for 0pt and 0
+
+\def\space{~}
+\let\bgroup={
+\let\egroup=}
+
+\def\loop#1\repeat{\def\body{#1}\iterate}
+\def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next}
+\let\repeat=\fi % this makes \loop...\if...\repeat skippable
+
+\def\supereject{\par\penalty-\@MM}
+\outer\def\bye{\par\vfill\supereject\end}
+%</ini>
+% \end{macrocode}
+% The two last commands above also need to be defined if we're
+% running under \LaTeX. In that case we need to be careful with |\bye|
+% however, as no |\if|\textellipsis\ can skip over code that explicitly
+% contains that control sequence, if it has been defined as above.
+% \begin{macrocode}
+%<*pkg>
+\ifx\bye\undefined_command
+ \def\supereject{\par\penalty-\@MM}
+ \outer\expandafter\def \csname bye\endcsname
+ {\par\vfill\supereject\@@end}
+\fi
+%</pkg>
+% \end{macrocode}
+%
+% \changes{1.910}{1999/11/01}{Make \cs{everyjob} code optional, and
+% simplify it a little. (LH\&UV)}
+% \begin{macrocode}
+%<*ini&everyjob>
+\everyjob{%
+ \if_file_exists{fontinst.rc}\then
+ \primitiveinput~fontinst.rc
+ \else
+ \immediate\write16{No~file~fontinst.rc.}
+ \fi
+}
+%</ini&everyjob>
+% \end{macrocode}
+%
+%
+% \section{Basic definitions}
+%
+% \subsection{Declaring variables and constants}
+%
+% Some temporary variables:
+%
+% \begin{macro}{\a_count}
+% \begin{macro}{\b_count}
+% \begin{macro}{\c_count}
+% \begin{macro}{\d_count}
+% \begin{macro}{\e_count}
+% \begin{macro}{\f_count}
+% \begin{macro}{\g_count}
+% \begin{macrocode}
+%<*pkg>
+\newcount\a_count
+\newcount\b_count
+\newcount\c_count
+\newcount\d_count
+\newcount\e_count
+\newcount\f_count
+\newcount\g_count
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}
+% \begin{macro}{\a_dimen}
+% \begin{macro}{\b_dimen}
+% \begin{macro}{\c_dimen}
+% \begin{macro}{\d_dimen}
+% \begin{macrocode}
+\newdimen\a_dimen
+\newdimen\b_dimen
+\newdimen\c_dimen
+\newdimen\d_dimen
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+% \begin{macro}{\a_toks}
+% \begin{macro}{\b_toks}
+% \begin{macro}{\c_toks}
+% \begin{macrocode}
+\newtoks\a_toks
+\newtoks\b_toks
+\newtoks\c_toks
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{switch}{_a_}
+% \changes{1.901}{1999/03/07}{Temporary switch added. (LH)}
+% \begin{macrocode}
+\newif\if_a_
+% \end{macrocode}
+% \end{switch}
+%
+% \describecsfamily{\meta{letter}_macro}
+% Besides these temporary variables that have to be declared, the family
+% of control sequences with names of the form |\|\meta{letter}|_macro|,
+% such as |\a_macro|, |\b_macro|, etc., should be used as ``macro valued''
+% temporary variables.
+% \changes{1.903}{1999/05/13}{Introduced the
+% \cs{\meta{letter}_macro} temporary variables,
+% replaced \cs{temp_command}. (LH)}
+%
+% \begin{macro}{\out_file}
+% Some global variables:
+% \begin{macrocode}
+\newwrite\out_file
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\one_thousand}
+% \begin{macro}{\five_hundred}
+% \begin{macro}{\one_hundred}
+% \begin{macro}{\max_mathchardef}
+% \begin{macro}{\two_thousand}
+% \changes{1.913}{2000/03/11}{Constant added. (LH)}
+% \begin{macro}{\half_point}
+% \changes{1.913}{2000/03/04}{Constant added. (LH)}
+% Some constants:
+% \begin{macrocode}
+\mathchardef\one_thousand=1000
+\mathchardef\five_hundred=500
+\mathchardef\one_hundred=100
+\mathchardef\max_mathchardef="7FFF
+\mathchardef\two_thousand=2000
+\newdimen\half_point \half_point=0.5pt
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+% \subsection{Trigonometry macros}
+%
+% Include David Carlisle's trigonometry macros. First, do some hacks
+% to get round all that |\NeedsTeXFormat{LaTeX2e}| stuff that David
+% put in :-) In v\,1.8 these hacks been moved to an earlier place since
+% we put in |\ProvidesPackage| ourselves.
+% \SortIndex{trig package}{\package{trig} package}
+%
+% \begin{macrocode}
+\let\@tempdima\a_dimen
+\let\@tempdimb\b_dimen
+\input trig.sty
+%</pkg>
+% \end{macrocode}
+%
+%
+% \subsection
+% {\package{fontdoc}-specific declarations}
+% ^^A \subsection{fontdoc-specific declarations}
+%
+% As of v\,1.917, \package{fontdoc} has options, so we better start
+% with declaration and processing of these.
+% \changes{1.917}{2001/03/31}{Option processing added. (LH)}
+%
+% \begin{option}{specification}
+% \begin{switch}{FD@spec@}
+% The \texttt{specification} option tells \package{fontdoc} that the
+% document is an encoding specification rather than a production
+% file---this changes some minor details in the typesetting. The
+% state of this option is recorded in the |FD@spec@| switch.
+% \begin{macrocode}
+%<*doc>
+\newif\ifFD@spec@
+\FD@spec@false
+\DeclareOption{specification}{\FD@spec@true}
+% \end{macrocode}
+% \end{switch}\end{option}
+%
+% \begin{option}{hypertex}
+% \changes{1.918}{2001/06/17}{Option added. (LH)}
+% \begin{option}{pdftex}
+% \changes{1.920}{2001/09/24}{Option added. (LH)}
+% \begin{macro}{\FD@codepoint}
+% The \texttt{hypertex} and \texttt{pdftex} options tell
+% \package{fontdoc} to include Hyper\TeX\ |\special|s and pdf\TeX\
+% annotations, in every code point number set using |\Unicode| or
+% |\textunicode|, for links to glyph images on the Unicode
+% consortium web site. The URLs to use are as follows:
+% \begin{quote}
+% \small
+% To access the reference glyph for any Unicode character,
+% you can use the new URL syntax like this:
+% \begin{quote}
+% \texttt{http://www.unicode.org/cgi-bin/refglyph?}^^A
+% \meta{XX}\texttt{-}\meta{nnnn}
+% \end{quote}
+% where \meta{XX} is the point size and \meta{nnnn} is the
+% hexadecimal codepoint. Please note however that only \texttt{24}
+% is supported as a size parameter at this time. (We are
+% reserving the possibility of providing other sizes in the
+% future.) Here is an example of usage for \texttt{U+4E78}:
+% \begin{quote}
+% \texttt{http://www.unicode.org/cgi-bin/refglyph?24-4E78}
+% \end{quote}
+% (This supports up to 6 hex digits, so it can also be used
+% with the supplementary characters.)
+% \end{quote}
+%
+% \iffalse
+% Documentation for a similar older service:
+% \begin{quotation}
+% \small
+% You may embed references to the glyph images on the Unicode site
+% in your own web pages. For example, to display a Euro sign
+% (\texttt{U+20AC}) you can use the following HTML:
+% \begin{quote}
+% |<IMG SRC="http://charts.unicode.org/Glyphs/20/U20AC.gif">|
+% \end{quote}
+% The subdirectory to use within the \texttt{Glyphs/} directory
+% is the first two hexadecimal digits of the Unicode code point.
+% The set of glyphs available covers all of Unicode 3.0 with the
+% exception of Han ideographs and Hangul syllables.
+%
+% However, you should only make occasional use of these glyphs.
+% If there is too much web traffic the Unicode
+% Consortium may be forced to discontinue this service.
+% \end{quotation}
+% \fi
+% Coding this for Hyper\TeX\ is pretty straightforward.
+% \begin{macrocode}
+\DeclareOption{hypertex}{
+ \providecommand*\FD@codepoint[1]{%
+ \uppercase{\edef\@tempa{#1}}%
+ \special{html:<a href="%
+ http://www.unicode.org/cgi-bin/refglyph?24-\@tempa
+ ">%
+ }%
+ \texttt{U+\@tempa}%
+ \special{html:</a>}%
+ }%
+}
+% \end{macrocode}
+% The pdf\TeX\ implementation is easy too, but there is one
+% complication: The key primitive is called |\pdfannotlink| in
+% v\,0.13, but |\pdfstartlink| in v\,0.14. My thanks goes to H\`an
+% Th\'{\^e} Th\`anh, who helped me sort that out.
+% \begin{macrocode}
+\DeclareOption{pdftex}{
+ \providecommand*\FD@codepoint[1]{%
+ \mbox{%
+ \uppercase{\edef\@tempa{#1}}%
+ \ifx \pdfstartlink\@undefined
+ \pdfannotlink
+ \else
+ \pdfstartlink
+ \fi attr {/Border [0 0 0]} user {%
+ /Subtype /Link /A <<%
+ /S /URI /URI (%
+ http://www.unicode.org/cgi-bin/refglyph?24-\@tempa
+ )%
+ >>}%
+ \textcolor{blue}{\texttt{U+\@tempa}}%
+ \pdfendlink
+ }%
+ }%
+ \AtEndOfPackage{\RequirePackage[pdftex]{color}}%
+}
+% \end{macrocode}
+% It would be quite possible to make these links according to some
+% other standard (e.g.~\LaTeX\-to\-HTML) instead by including a suitable
+% definition of |\FD@codepoint| in your \texttt{fontdoc.cfg} file.
+% I could include code for those standards as well if someone sends
+% it to me.
+%
+% I decided against using commands in the \package{hyperref} or
+% \package{hyper} packages for this as these packages do so much more
+% that I don't want. If some day a package providing a basic interface
+% for making hyperlinks is included in required \LaTeX\ then this
+% decision should certainly be reconsidered.
+% \end{macro}\end{option}\end{option}
+%
+% Input a local configuration file, if it exists.
+% \begin{macrocode}
+\InputIfFileExists{fontdoc.cfg}{%
+ \typeout{*************************************^^J%
+ * Local config file fontdoc.cfg used^^J%
+ *************************************}%
+}{}
+% \end{macrocode}
+%
+% Finally process the options.
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+%
+% The \package{amstext} package is required, since the |\text| command
+% is used in formatting some integer expressions.
+% \changes{1.916}{2001/01/02}{Requiring the \package{amstext} package
+% in \package{fontdoc}. (LH)}
+% \begin{macrocode}
+\RequirePackage{amstext}
+% \end{macrocode}
+%
+% \begin{macro}{\a@count}
+% \begin{macro}{\b@count}
+% \changes{1.916}{2001/01/02}{Variable added. (LH)}
+% \begin{macro}{\a@dimen}
+% Three private variables:
+% \begin{macrocode}
+\newcount\a@count
+\newcount\b@count
+\newdimen\a@dimen
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% Some useful macros and constrol structures:
+%
+% \begin{macrocode}
+\def\x@cs#1#2{\expandafter#1\csname#2\endcsname}
+\def\FD@swap@two#1#2{#2#1}
+% \end{macrocode}
+%
+% \begin{macro}{\Aheading}
+% \changes{1.909}{1999/10/18}{Use \cs{addvspace} to make space
+% above. (LH)}
+% \changes{1.909}{1999/10/20}{Insert a \cs{penalty} for pagebreaking
+% after an \cs{Aheading}. (LH)}
+% \changes{1.920}{2001/10/19}{Encouraged page breaks before an
+% \cs{Aheading}. (LH)}
+% \begin{macro}{\Bheading}
+% |\Aheading| and |\Bheading| are used to typeset various headings.
+% \begin{macrocode}
+\newcommand\Aheading[1]{%
+ \par\pagebreak[1]\addvspace\medskipamount
+ \noindent\textbf{#1}\vadjust{\penalty200}\par
+}
+\newcommand\Bheading[1]{\par\noindent\textbf{#1}}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% Some formating commands and a macro that comes in handy. It used to
+% say |\raggedright| at this point as well, but that functionality has
+% been moved into |\encoding| and |\metrics|.
+%
+% \definechange{raggedright}{1.920}{2001/09/16}{The body (between
+% \cs{metrics} and \cs{endmetrics}, and \cs{encoding} and
+% \cs{endencoding} respectively) of a \package{fontdoc} document is
+% now typeset in a \texttt{flushleft} environment. It used to be that
+% the entire document was typeset this way. (LH)}
+% \usechange{raggedright}
+% \changes{1.923}{2002/10/26}{Making sure \cs{lineskiplimit} is
+% positive. (LH)}
+%
+% \begin{macrocode}
+\raggedbottom
+\ifdim 1sp>\lineskiplimit \lineskiplimit=0.5pt \fi
+\newcommand\plain{\texttt{plain}}
+% \end{macrocode}
+%
+% \begin{macro}{\plainint}
+% \begin{macro}{\plaindiv}
+% \begin{macro}{\plainmax}
+% \begin{macro}{\plainmin}
+% \package{fontdoc} saves away \LaTeX's |\int|, |\div|, |\max|, and
+% |\min| as |\plainint|, |\plaindiv|, |\plainmax|, and |\plainmin|,
+% since these control sequences are going to be used for other
+% purposes.
+% \begin{macrocode}
+\let\plainint=\int
+\let\plaindiv=\div
+\let\plainmax=\max
+\let\plainmin=\min
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\TypesetList}
+% \changes{1.914}{2000/05/13}{Macro added. (LH)}
+% \begin{macro}{\list@item@counter}
+% The |\TypesetList| command typesets the \meta{arg}s in a sequence of
+% |\do|\marg{arg} macros with separators depending on position in and
+% length of the sequence. It is loosely based on a description of a
+% similar command in the \package{amsref} package, but it has fewer
+% features, and I don't know if there is any similarity between the
+% implementations.
+%
+% The syntax is
+% \begin{isyntax}
+% |\TypesetList|\marg{left}\marg{onlysep}\marg{nonlastsep}\penalty0
+% \marg{lastsep}\penalty0\marg{right}\penalty0
+% \marg{empty}\penalty0\marg{wrap}\penalty0\marg{list}
+% \end{isyntax}
+% \meta{list} is the actual list of |\do|\marg{arg}s. If that is
+% empty then \meta{empty} is typeset. Otherwise the typeset text
+% begins with \meta{left}, ends with \meta{right}, and contains the
+% formatted forms of every \meta{arg} in the list of |\do|\marg{arg}s.
+% The formatting here consists of passing the \meta{arg} as the
+% argument to \meta{wrap}, which is typically a one-argument macro.
+% Between two ``formatted \meta{arg}s'' will \meta{onlysep},
+% \meta{nonlastsep}, or \meta{lastsep} be put, depending on the number
+% of \meta{arg}s in the list and the position in the list. If the list
+% has length two then \meta{onlysep} will be used for the only separator
+% needed. If the list has length greater than two then \meta{nonlastsep}
+% will be used for all separators but the last, and \meta{lastsep} will
+% be used for the last.
+%
+% All of the arguments of |\TypesetList| must survive being passed
+% through a |\def|.
+% \begin{macrocode}
+\newcount\list@item@counter
+\newcommand\TypesetList[8]{%
+ \begingroup
+ \list@item@counter=\z@
+ \def\do##1{\advance\list@item@counter\@ne}%
+ #8%
+ \ifcase \list@item@counter \or
+ \def\do##1{#1#7{##1}}%
+ \or
+ \def\do##1{%
+ \advance\list@item@counter\@ne
+ \ifnum \list@item@counter=\@ne #1\else #2\fi
+ #7{##1}%
+ }%
+ \else
+ \advance\list@item@counter\m@ne
+ \expandafter\def \expandafter\do \expandafter##\expandafter1%
+ \expandafter{\expandafter\ifnum \the\list@item@counter
+ =\list@item@counter
+ #4%
+ \else\ifnum \z@=\list@item@counter
+ #1%
+ \else
+ #3%
+ \fi\fi
+ \advance\list@item@counter\@ne
+ #7{##1}%
+ }%
+ \fi
+ \ifnum \z@=\list@item@counter
+ #6%
+ \else
+ \list@item@counter=\z@
+ #8%
+ #5%
+ \fi
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%
+% \section
+% {\TeX{} hackery}
+% ^^A \section{TeX hackery}
+% \changes{1.902}{1999/05/01}{Moved Section \thesection\space to
+% \texttt{fibasics.dtx}. (LH)}
+%
+% \subsection{Utiltiy macros}
+%
+% \begin{macro}{\x_cs}
+% \begin{macro}{\x_relax}
+% \begin{macro}{\g_let}
+% \begin{macrocode}
+%<*pkg>
+\def\x_cs#1#2{\expandafter#1\csname#2\endcsname}
+\let\x_relax=\relax
+\def\g_let{\global\let}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+% \changes{1.900}{1999/02/07}{Replaced \cs{relax} by \cs{x_relax}. (LH)}
+%
+% \begin{macro}{\x@relax}
+% \begin{macrocode}
+%<doc>\let\x@relax=\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\empty_command}
+% \begin{macro}{\gobble_one}
+% \begin{macro}{\gobble_two}
+% \begin{macro}{\gobble_three}
+% \begin{macro}{\identity_one}
+% \begin{macro}{\first_of_two}
+% \begin{macro}{\second_of_two}
+% \begin{macro}{\swap_two}
+% \changes{1.912}{2000/02/16}{Macro added. (LH)}
+% \begin{macro}{\first_of_three}
+% \changes{1.914}{2000/05/30}{Macro added. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\empty_command{}
+\def\gobble_one#1{}
+\def\gobble_two#1#2{}
+\def\gobble_three#1#2#3{}
+\def\identity_one#1{#1}
+\def\first_of_two#1#2{#1}
+\def\second_of_two#1#2{#2}
+\def\swap_two#1#2{#2#1}
+\def\first_of_three#1#2#3{#1}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\hash_char}
+% \begin{macro}{\percent_char}
+% \begin{macro}{\left_brace_char}
+% \begin{macro}{\right_brace_char}
+% \begin{macrocode}
+\bgroup
+ \catcode`\[=1
+ \catcode`\]=2
+ \catcode`\#=12
+ \catcode`\%=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \gdef\hash_char[#]
+ \gdef\percent_char[%]
+ \gdef\left_brace_char[{]
+ \gdef\right_brace_char[}]
+\egroup
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\first_char}
+% Return the first character of a string.
+%
+% \begin{macrocode}
+\def\first_char#1#2={#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\add_to}
+% Append one or more tokens to the replacement text of a
+% parameterless macro.
+% \begin{macrocode}
+\def\add_to#1#2{
+ \ifx#1\x_relax
+ \def#1{#2}
+ \else
+ \expandafter\def\expandafter#1\expandafter{#1#2}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\prep_to}
+% Prepend one or more tokens to the replacement text of a
+% parameterless macro. Note that if more than one token is added then
+% the second parameter must contain an |\expandafter| between every
+% pair of tokens you actually mean to contribute. Thus if you want
+% to prepend |abc| to |\next|, you must write
+% \begin{quote}
+% |\prep_to\next{a\expandafter b\expandafter c}|
+% \end{quote}
+% Also note that the second argument must not be empty.
+% \begin{macrocode}
+\def\prep_to#1#2{
+ \ifx#1\x_relax
+ \expandafter\def\expandafter#1\expandafter{\expandafter#2}
+ \else
+ \expandafter\def\expandafter#1\expandafter{\expandafter#2#1}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\never_do}
+% The command |\do|, protected from expansion.
+%
+% \begin{macrocode}
+\def\never_do{\noexpand\do}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Testing for \TeX\ extensions}
+% \changes{1.914}{2000/05/13}{Added commands for testing for
+% \protect\TeX\ extensions. (LH)}
+% Some tasks can be done better (and usually with simpler code) if
+% one can assume that certain features in some \TeX\ extensions, such as
+% \eTeX, is available. Unfortunately one cannot generally make this
+% assumption, but it is sometimes possible to provide two implementations
+% of a macro and at runtime choose the one which best utilizes the
+% available features. This subsection defines macros for making these
+% tests.
+%
+% There is also a command |\needsTeXextension| which is used like
+% |\needs|\-|fontinst|\-|version|, but which tests the \TeX\ rather than
+% the version of \package{fontinst}. This ought to be of use for ETX files
+% that describe 16 bit encodings,\footnote{At the time of writing, no
+% such ETX files exist that I know of, but \package{fontinst} should
+% not have any problem using them. /LH} as the current implementation
+% of the (V)PL writer in this case requires the underlying \TeX\ to
+% support 16 bit character codes.
+%
+% The normal operation of the extension-testing macros is to set the |_a_|
+% switch to true if the requested extension is present, and to leave the
+% switch as it was if it isn't present. This is so that one can easily
+% test for a feature that has been added to several different extensions
+% of \TeX\ simply by doing the tests in sequence. That, however, is what
+% the testing macros do if the switch |_extensions_warning_| is set to
+% false. When it is set to true they instead expand to a short piece of
+% text suitable for inclusion in a warning message about the absence of
+% a needed feature.
+%
+% \begin{switch}{_extensions_warning_}
+% This switch controls whether extension-testing macros should
+% actually do the test (false) or produce a warning (true).
+% \begin{macrocode}
+%<*pkg>
+\newif\if_extensions_warning_
+\_extensions_warning_false
+% \end{macrocode}
+% \end{switch}
+%
+%
+% \begin{macro}{\eTeX}
+% The |\eTeX| command has the syntax
+% \begin{quote}
+% |\eTeX|\marg{version number}
+% \end{quote}
+% where the \meta{version number} is the complete version number
+% (version number plus revision) of the \eTeX\ one wishes to test for.
+%
+% The code below is geared towards not letting unnecessary control
+% sequences get tokenized, as they will then always occupy a position
+% in \TeX's hash table, but it seems one cannot get around testing
+% whether |\eTeXversion| is defined, so we start with that and then
+% do a |\catcode| trick to prevent \TeX\ from seeing |\eTeXrevision|.
+% \begin{macrocode}
+\ifx \eTeXversion\undefined_command
+ \catcode`\~=14 % 14=comment
+\fi
+\def\eTeX#1{
+ \if_extensions_warning_
+ \space/\space e-TeX\space version\space #1
+~ \else
+~ \ifdim \number\eTeXversion\eTeXrevision\p@ < #1\p@ \else
+~ \_a_true
+~ \fi
+ \fi
+}
+\catcode`\~=10
+%</pkg>
+% \end{macrocode}
+% \begin{macro}{\eTeXlogo}
+% The |\eTeXlogo| command prints the \eTeX\ logo.
+% \changes{1.923}{2002/10/20}{Added kern, to match
+% \package{ltugboat} definition. (LH)}
+% \begin{macrocode}
+%<*doc>
+\def\eTeX#1{\do{\eTeXlogo\nolinebreak[3] v\,#1}}
+\def\eTeXlogo{\ensuremath{\varepsilon}-\kern-.125em\TeX}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\pdfTeX}
+% The |\pdfTeX| command has the syntax
+% \begin{quote}
+% |\pdfTeX|\marg{version number}\marg{revision}
+% \end{quote}
+% where the \meta{version number} is the version number as returned
+% by |\pdftexversion|, i.e., 100 times what it would normally be
+% printed as, and the \meta{revision} is the revision code as returned
+% by |\pdftexrevision|. To test for pdf\TeX\ 0.13c or newer, one would
+% say |\pdfTeX{13}{c}|.
+%
+% The code below uses the same |\catcode| trick as that in |\eTeX|.
+% \begin{macrocode}
+%<*pkg>
+\ifx \pdftexversion\undefined_command
+ \catcode`\~=14 % 14=comment
+\fi
+%</pkg>
+%<*pkg|doc>
+\def\pdfTeX#1#2{%
+%<pkg> \if_extensions_warning_
+%<pkg> \space/\space pdfTeX\space version\space
+%<doc> \do{pdf\TeX\nolinebreak[3] v\,%
+ \ifnum #1<100\space
+ 0.\ifnum #1<10\space 0\fi
+ \else
+%<pkg> \expandafter\swap_two \expandafter.
+%<doc> \expandafter\FD@swap@two \expandafter.%
+ \fi
+ #1#2%
+%<doc> }
+%<doc>}
+%</pkg|doc>
+%<*pkg>
+% \end{macrocode}
+% The above is not ideal, but it will do for now.
+% \begin{macrocode}
+~ \else
+~ \ifdim #1>\pdftexversion \else
+~ \ifnum \expandafter\expandafter \expandafter`
+~ \expandafter\first_char \pdftexrevision= <
+~ \expandafter` \first_char#2=
+~ \else \_a_true \fi
+~ \fi
+ \fi
+}
+\catcode`\~=10
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\needsTeXextension}
+% The |\needsTeXextension| command has the syntax
+% \begin{quote}
+% |\needsTeXextension|\marg{extension tests}\marg{who}
+% \end{quote}
+% If none of the extension tests set the |_a_| switch to true, then
+% it prints a warning detailing the extensions tests which failed.
+% \meta{who} is what should be listed as the originator of this
+% message; it is typically the name of the file which contains the
+% |\needsTeXextension| command.
+%
+% An example (assuming that there will be an |\Omega| test as well
+% some time in the future; I haven't really looked into what that
+% should look like, so maybe the arguments should be different): The
+% command
+% \begin{quote}
+% |\needsTeXextension{\eTeX{1.2}\Omega{1.0}}{foobar.etx}|
+% \end{quote}
+% tests if the current \TeX\ is \eTeX\ verision 1.2 (or newer)
+% \emph{or} Omega version 1.0 (or newer). The implied conjunction
+% between the tests is always `or'.
+% \begin{macrocode}
+\def\needsTeXextension#1#2{
+ \_a_false
+ #1
+ \if_a_ \else
+ \_extensions_warning_true
+ \edef\a_macro{#1}
+ \_extensions_warning_false
+ \fontinstwarningnoline{#2}{
+ This~file~needs:\messagebreak
+ \expandafter\second_of_two\a_macro
+ \iffalse
+ <no~sufficient~extensions~were~listed!!>\if_false
+ \fi
+ \messagebreak
+ You~are~not~using~any~of~them.~This~is~likely~to~cause~errors
+ }
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\needsTeXextension#1#2{%
+ \Bheading{Needs
+ \TypesetList{}{ or }{, }{, or }{}{(unspecified)}{\@firstofone}{#1}}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Writing to output files}
+%
+% \changes{1.901}{1999/03/04}{Pooled output file allocation added. (LH)}
+% As of v\,1.901, there are two different output file
+% models in \package{fontinst}. One has been along ``forever'' and is
+% for writing output to files which are only open for a short period of
+% time---every \package{fontinst} file command that opens a file in this
+% model must also close it---and it can only be used for one file at at
+% time. The other model offers pooled allocation of output files---as
+% long as there is an unused \TeX\ output stream to open, you may open a
+% new file, and it does not matter if files are not closed in the revese
+% order of that in which they were opened.
+%
+% \begin{macro}{\open_out}
+% \changes{1.901}{1999/03/04}
+% {\cs{xdef} instead of \cs{def} on \cs{out_filename}. (LH)}
+% \begin{macro}{\close_out}
+% \begin{macro}{\out_line}
+% \begin{macro}{\out_lline}
+% \changes{1.908}{1999/08/25}{\cs{edef}, to save macro expansions
+% later. (LH)}
+% \begin{macro}{\out_llline}
+% \changes{1.908}{1999/08/25}{\cs{edef} and don't use \cs{out_lline},
+% to save macro expansions later. (LH)}
+% These macros implement the classical output file commands.
+% \begin{macrocode}
+%<*pkg>
+\def\open_out#1{
+ \immediate\openout\out_file=#1 \xdef\out_filename{#1}}
+\def\close_out#1{
+ \immediate\write16{#1~written~on~\out_filename.}
+ \immediate\closeout\out_file}
+\def\out_line#1{\immediate\write\out_file{#1}}
+\edef\out_lline#1{\noexpand\out_line{\space\space\space#1}}
+\edef\out_llline#1{
+ \noexpand\out_line{\space\space\space\space\space\space#1}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% In the new model, the basic writing command
+% \DescribeMacro{\pout_line}|\pout_line| takes two arguments: a file
+% identifier control sequence and the token sequence to write. Thus its
+% call looks like
+% \begin{quote}
+% |\pout_line|\meta{identifier}\marg{text}
+% \end{quote}
+% The \meta{identifier} is usually a chardef token whose number tells
+% which input stream is used, but if \TeX\ runs out of output streams
+% then it might be defined as a parameterless macro which expands to
+% |\m@ne|. This has the effect of making all output to that ``file'' go
+% to the log file, from which the data might be salvaged.
+%
+% The new model operates using the control sequence family
+% \describecsfamily{out_filename-\meta{stream}}^^A
+% |\out_filename-|\meta{stream}
+% both for storing the name of the output file and for handling
+% allocation of output streams.
+%
+% \begin{macro}{\TeX_terminal}
+% \begin{macro}{\closed_stream}
+% \begin{macro}{\out_filename-99}
+% \begin{macro}{\out_filename--1}
+% Output streams 16 and above always write to \TeX's terminal, and any
+% output file that gets closed gets its identifier set to 99 so that
+% any attempts to write to a closed file can be easily spotted. (99
+% is the character code for |c|.) Output stream --1 is the log file, and
+% if another output stream cannot be allocated then attempts to write to
+% the output file will be redirected to the log file.
+% \begin{macrocode}
+\def\TeX_terminal{\string\TeX\space terminal}
+\chardef\closed_stream=99
+\x_cs\let{out_filename-99}=\TeX_terminal
+\x_cs\def{out_filename--1}{\jobname.log}
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro}
+%
+% \begin{macro}{\allocate_stream}
+% \begin{macro}{\ch@ck}
+% \begin{macrocode}
+\def\allocate_stream{
+ \a_count=\m@ne
+ \b_count=\m@ne
+ \loop \ifnum \count17>\a_count
+% \end{macrocode}
+% While |\a_count|${}<$ the number of the last allocated output
+% stream \textellipsis
+% \begin{macrocode}
+ \advance \a_count \@ne
+ \x_cs\ifx{out_filename-\the\a_count}\TeX_terminal
+% \end{macrocode}
+% If |\out_filename-|\meta{stream}, where \meta{stream} is the value
+% of |\a_count|, is equal to |\TeX_terminal|, then output stream
+% |\a_count| is allocated to the pool but is not used for any
+% currently open file. Thus we've found a stream that can be used.
+% \begin{macrocode}
+ \b_count=\a_count
+ \a_count=\count17
+ \fi
+ \repeat
+ \ifnum \b_count=\m@ne
+% \end{macrocode}
+% In this case all streams allocated to the pool are currently in use,
+% so try to allocate a new one.
+% \begin{macrocode}
+ \global\advance\count17by\@ne
+ \ifnum \count17<\sixt@@n
+% \end{macrocode}
+% Then case: There was another output stream.
+% \begin{macrocode}
+ \b_count=\count17
+ \global\x_cs\let{out_filename-\the\b_count}\TeX_terminal
+ \wlog{\string\write\the\b_count\space allocated~to~the~pool.}
+ \else
+% \end{macrocode}
+% Else case: See to that the output stream allocation register holds
+% at 16.
+% \begin{macrocode}
+ \global\count17=\sixt@@n
+ \fi
+ \fi
+}
+% \end{macrocode}
+% By now, if a new stream could be allocated then the number of that
+% stream is in |\b_count|, and if it couldn't then |\b_count| is --1.
+%
+% All output streams up to and including that whose number is in
+% |\count17| is checked to see if it is available. Many unsuccessful
+% |\newwrite|s could therefore mean we have to do quite a lot of
+% checking. What's more, output stream 99 would incorrectly be
+% interpreted as being in the pool but not used. To guard against these
+% (improbable) errors, |\ch@ck| is redefined to stop allocation
+% |\count| registers at their limit value.
+% \begin{macrocode}
+\def\ch@ck#1#2#3{
+ \ifnum \count1#1<#2 \else
+ \errmessage{No~room~for~a~new~#3}
+ \global\count1#1=#2
+ \fi
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\open_pout}
+% \begin{macro}{\close_pout}
+% The syntax for |\open_pout| is
+% \begin{quote}
+% |\open_pout|\meta{identifier}\marg{name}
+% \end{quote}
+% \meta{name} is the name of the output file one wishes to open.
+% \meta{identifier} is a control sequence which will be redefined
+% (globally) to act as an identifier of the file.
+% \begin{macrocode}
+\def\open_pout#1#2{
+ \allocate_stream
+ \ifnum \b_count=\m@ne
+ \immediate\write\sixt@@n{fontinst~is~out~of~output~streams.^^J
+ Output~file~#2~cannot~be~opened.^^J
+ Writes~will~be~redirected~to~the~log~file.
+ }
+ \gdef#1{\m@ne}
+ \else
+ \immediate\openout\b_count=#2\x_relax
+ \x_cs\xdef{out_filename-\the\b_count}{#2}
+ \global\chardef#1=\b_count
+ \fi
+}
+% \end{macrocode}
+%
+% The syntax for |\close_pout| is
+% \begin{quote}
+% |\close_pout|\meta{identifier}\marg{what}
+% \end{quote}
+% \meta{identifier} is the output stream identifier which should have
+% been defined in an earlier call of |\open_pout|. \meta{what} is a
+% string which describes what has been written to the output file,
+% e.g.\ |Metrics| or |Raw~font|. It will be used to write a message on
+% the terminal.
+% \begin{macrocode}
+\def\close_pout#1#2{
+ \ifnum #1=\closed_stream
+ \errmessage{Output~file~\string#1~(#2)~not~closed,^^J
+ since~it~was~not~open}
+ \else
+ \immediate\write\sixt@@n{#2~written~on~
+ \csname out_filename-\the#1\endcsname.}
+ \ifnum #1=\m@ne \else
+ \immediate\closeout#1
+ \global\x_cs\let{out_filename-\the#1}=\TeX_terminal
+ \fi
+ \global\chardef#1=\closed_stream
+ \fi
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\pout_line}
+% The syntax for |\pout_line| is
+% \begin{quote}
+% |\pout_line|\meta{identifier}\marg{text}
+% \end{quote}
+% \meta{identifier} is the output stream identifier which should have
+% been defined in an earlier call to |\open_pout|. \meta{text} is
+% what will be written to the file.
+% \begin{macrocode}
+\def\pout_line#1#2{\immediate\write#1{#2}}
+% \end{macrocode}
+%
+% \begin{macro}{\pout_lline}
+% \changes{1.904}{1999/06/15}{Command added. (LH)}
+% \changes{1.908}{1999/08/25}{\cs{edef}, to save macro expansions
+% later. (LH)}
+% \begin{macro}{\pout_llline}
+% \changes{1.904}{1999/06/15}{Command added. (LH)}
+% \changes{1.908}{1999/08/25}{\cs{edef} and don't use \cs{pout_lline},
+% to save macro expansions later. (LH)}
+% There relate to |\pout_line| as |\out_lline| and |\out_llline| to
+% |\out_line|.
+% \begin{macrocode}
+\edef\pout_lline#1#2{\noexpand\pout_line#1{\space\space\space#2}}
+\edef\pout_llline#1#2{
+ \noexpand\pout_line#1{\space\space\space\space\space\space#2}
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\tempfileprefix}
+% \begin{macro}{\temp_prefix}
+% Selecting the directory for temporary files.
+%
+% \begin{macrocode}
+\def\tempfileprefix#1{\def\temp_prefix{#1}}
+\tempfileprefix{}
+%</pkg>
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \subsection{Conditionals}
+%
+% \subsubsection
+% {Conditionals in \package{fontinst}}
+% ^^A \subsubsection{Conditionals in fontinst}
+%
+% \begin{macro}{\then}
+% \begin{macro}{\if_true}
+% \begin{macro}{\if_false}
+% In order to write macros that expand out to nested |\if|-statements,
+% I say:
+% \begin{quote}
+% |\ifblah| \textellipsis\ |\then| \textellipsis\ |\else|
+% \textellipsis\ |\fi|
+% \end{quote}
+% In order to match the |\fi|, |\then| has to be an |\if|.
+%
+% \begin{macrocode}
+%<pkg|doc>\let\then=\iffalse
+%<*pkg>
+\def\if_false{\iffalse}
+\def\if_true{\iftrue}
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+% \begin{macro}{\if_defined}
+% \begin{macro}{\if_undefined}
+% \multchanges{\cs{if_defined}\cs{if_undefined}}{1.912}
+% {2000/02/10}{Macro added. (LH)}
+% These two macros are used as
+% \begin{quote}
+% |\if_defined|\marg{control sequence name}|\then|\\
+% |\if_undefined|\marg{control sequence name}|\then|
+% \end{quote}
+% The latter is functionally equivalent to
+% \begin{quote}
+% |\x_cs\ifx|\marg{control sequence name}|\x_relax|
+% \end{quote}
+% but it is shorter (1--3 tokens, depending on whether the
+% unnecessary braces around \meta{control sequence name} are included
+% or not). The former tests the same thing, but has true and false
+% cases reversed.
+%
+% Apart from that it is shorter, another important reason for
+% introducing these macros is that the \eTeX\ primitives
+% |\ifcsname| and |\unless| provide a much better implementation than
+% what is possible in normal \TeX. Therefore it is desirable to use
+% these commands as much as possible, and by introducing these macros
+% one can achieve this without having double definitions for more
+% than these two macros.
+%
+% To avoid trouble with mismatched ifs and tokenizing control
+% sequences special for \eTeX, |~| is temporarily made a comment
+% character. I'm not sure |\ifcsname| and |\unless| weren't available
+% in \eTeX\ versions before 2.0, but that's the oldest version I have
+% a manual for.
+% \multchanges{\cs{if_defined}\cs{if_undefined}}{1.914}{2000/05/13}
+% {Automatically selecting between \protect\TeX\ and \eTeX\
+% definitions. (LH)}
+% \multchanges{\cs{if_defined}\cs{if_undefined}}{1.927}{2003/12/11}
+% {Modified \eTeX\ definitions to make them work with the
+% crufty old ``unset is \cs{let} to \cs{relax}'' tradition
+% of \package{fontinst} implementation. (LH) This was found
+% to be a show-stopper for using v\,1.926 with \eTeX;
+% Heiko Oberdiek found the cause of it.}
+% \changes{1.927}{2004/08/07}{Fixed problem with \cs{unless}. (LH)}
+% \begin{macrocode}
+\_a_false\eTeX{2.0}
+\if_a_\else \catcode`\~=14\x_relax \fi
+% \end{macrocode}
+% The following use of |\if| is a trick I learnt from the
+% implementation of \package{docstrip}. |\if| will expand any amount of
+% material until it has two unexpandable tokens to compare, hence one
+% can use it to evaluate arbitrary boolean expressions in a single
+% \TeX\ conditional, by expressing the expression as something which
+% expands in \TeX's mouth to the value of the expression (either |0|
+% or |1|). In this case the expression is ``the control sequence is
+% defined and that definition is not \cs{relax}''.
+% \begin{macrocode}
+~ \def\if_defined#1\then{
+~ \if
+~ \ifcsname#1\endcsname
+~ \expandafter\ifx \csname#1\endcsname \x_relax
+~ 0
+~ \else
+~ 1
+~ \fi
+~ \else
+~ 0
+~ \fi
+~ 1
+~ }
+~ \def\if_undefined{\expandafter\unless\if_defined}
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\~=\if_a_ 14 \else 10 \fi \x_relax
+% \end{macrocode}
+% \begin{macrocode}
+~ \def\if_defined#1\then{
+~ \expandafter\ifx \csname#1\endcsname\x_relax
+~ \expandafter\if_false
+~ \else
+~ \expandafter\if_true
+~ \fi
+~ }
+~ \def\if_undefined#1\then{
+~ \expandafter\ifx \csname#1\endcsname\x_relax
+~ }
+% \end{macrocode}
+% \begin{macrocode}
+\catcode`\~=10\x_relax
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\gobble_if}
+% It is sometimes best to skip both the then-part and
+% the else-part of a conditional. |\gobble_if| does this by using the
+% fact that expanding |\else| skips everything until the next matching
+% |\fi| without looking for other |\else|s.
+% \changes{1.900}{1998/12/11}{Macro added. (LH)}
+% \changes{1.913}{2000/03/03}{Macro redefined; it now works entirely
+% in the mouth. (LH)}
+% \begin{macrocode}
+\def\gobble_if{\iftrue\else}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if_or}
+% \begin{macro}{\or_else}
+% |\if_or| \textellipsis\ |\or_else| \textellipsis\ |\then| gives the
+% disjunction of two booleans.
+% \begin{macrocode}
+\def\if_or#1\or_else#2\then{
+ #1\then
+ \expandafter\if_true
+ \else
+ #2\then
+ \expandafter\expandafter\expandafter\if_true
+ \else
+ \expandafter\expandafter\expandafter\if_false
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\if_equal}
+% The |\if_equal| macro is a \textellipsis|\then|-style wrapper around the
+% |\ifx| primitive. Its calling syntax is
+% \begin{quote}
+% |\if_equal|\meta{token1}\meta{token2}|\then|
+% \end{quote}
+% \changes{1.912}{2000/02/23}{Macro added. (LH)}
+% \begin{macrocode}
+\def\if_equal#1\then{\ifx#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if_file_exists}
+% |\if_file_exists| checks to see if a file exits, using |\openin|.
+%
+% \begin{macrocode}
+\def\if_file_exists#1\then{
+ \immediate\openin1=#1\x_relax
+ \ifeof1\x_relax
+ \immediate\closein1
+ \expandafter\if_false
+ \else
+ \immediate\closein1
+ \expandafter\if_true
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection
+% {Conditionals in \package{fontdoc}}
+% ^^A \subsubsection{Conditionals in fontdoc}
+%
+% \changes{1.909}{1999/10/16}{System for documenting both branches of
+% \texttt{if} statements in ETX and MTX files added. (LH)}
+% In order to get a reasonable documentation of branches in an ETX or
+% MTX file, the code in both branches must be typeset and the positions
+% of the if, the else, and the fi must be clearly marked. There seems to
+% be no reasonable way to achieve this if the standard names for the
+% else and fi are used. Therefore the alternative names |\Else| and
+% |\Fi| for |\else| and |\fi| have been introduced, to be used as in
+% for example
+% \begin{quote}
+% |\ifisint{monowidth}\then|\\
+% \vadjust{}\quad\meta{then-part}\\
+% |\Else|\\
+% \vadjust{}\quad\meta{else-part}\\
+% |\Fi|
+% \end{quote}
+%
+% \begin{macro}{\Else}
+% \begin{macro}{\Fi}
+% By default, these are identical to their lowercase counterparts.
+% \begin{macrocode}
+%<*pkg|doc>
+\let\Else=\else
+\let\Fi=\fi
+%</pkg|doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% The interesting part begins if the ETX or MTX file gives the command
+% |\showbranches|, since this means (i) that it wants the branches to be
+% shown and (ii) that it complies to a simple rule about where to use
+% |\Else| and |\Fi|. The rule is as follows: If an \texttt{if} statement
+% is of \package{fontinst} form (it uses |\then|), then it must be
+% terminated by |\Fi|, and a possible else in the statement must be an
+% |\Else|. If an \texttt{if} statement is \emph{not} of \package{fontinst}
+% form (it has no |\then|), then it must be terminated by |\fi|, and a
+% possible else in the statement must be an |\else|. Only the
+% \package{fontinst} form \texttt{if} statements are affected by
+% |\showbranches|.
+%
+% \begin{macro}{\showbranches}
+% \begin{macro}{\generic@if}
+% The |\showbranches| command changes the definitions of
+% |\generic@if|, |\then|, |\Else|, and |\Fi| so that the branches of
+% \texttt{if} statements will be made visible. |\generic@if| is used
+% to implement all the \package{fontinst} form \texttt{if} statements
+% in \package{fontdoc}. It is called as
+% \begin{quote}
+% |\generic@if|\marg{description}
+% \end{quote}
+% and this will by default expand to |\iftrue|, but after executing
+% |\showbranches| it will instead typeset
+% \begin{quote}
+% If \meta{description} then
+% \end{quote}
+% and do a bit of additional housekeeping.
+%
+% \begin{macrocode}
+%<*doc>
+\def\generic@if#1{\iftrue}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\showbranches{%
+ \let\generic@if=\branches@if
+ \let\then=\x@relax
+ \let\Else=\branches@else
+ \let\Fi=\branches@fi
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\saved@slot@number}
+% The |\saved@slot@number| is used for storing the value of
+% |\slot@number| at the \texttt{if} until the |\Else|. Unlike
+% |\slot@number|, it is always set locally.
+% \begin{macrocode}
+\newcount\saved@slot@number
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\branches@if}
+% \begin{macro}{\branches@else}
+% \begin{macro}{\branches@fi}
+% \changes{1.916}{2001/01/25}{Commented out test which concatenates
+% consecutive \cs{Fi}s, since that doesn't work together with the
+% \texttt{IfBranch} environment. (LH)}
+% \begin{macro}{\branches@type}
+% \begin{macro}{\branches@par}
+% The macros |\branches@if|, |\branches@else|, and |\branches@fi|
+% contain the definitions of |\generic@if|, |\Else|, and |\Fi|
+% respectively that are used when branches are to be shown. Their
+% basic task is to typeset the texts |If #1 then|, |Else|, and |Fi| in
+% an appropriate style and with appropriate spacing around. A
+% complicating matter is however that |\slot@number| must have the
+% same value at the beginning of the \textit{else} part as at the
+% beginning of the \textit{then} part. To achieve this, the value of
+% |\slot@number| is saved in |\saved@slot@number| at the \textit{if}
+% and copied back at the \textit{else}. To make this work even with
+% nested \textit{if}s, both the \textit{then} branch and the
+% \textit{else} branch are enclosed in groups and
+% |\saved@slot@number| is assigned locally.
+%
+% There are still some formatting issues to solve, however. In some
+% cases it works best to put the text of adjacent \textit{if},
+% \textit{else}, or \textit{fi} in the same paragraph, and it must be
+% possible to recognize those cases. This is done by looking at the
+% macro |\branches@type|, which should expand to
+% \begin{enumerate}
+% \item[\texttt{0}] if the preceeding item was an \textit{if},
+% \item[\texttt{1}] if the preceeding item was an \textit{else}
+% preceeded by an \textit{if},
+% \item[\texttt{2}] if the preceeding item was an \textit{else}
+% not preceeded by an \textit{if},
+% \item[\texttt{3}] if the preceeding item was a \textit{fi},
+% \item[\texttt{4}] if it was anything else.
+% \end{enumerate}
+% |\branches@par| is used for resetting |\branches@type| to \texttt{4}.
+% It is an auto-resetting definition of |\par|.
+%
+% \begin{macrocode}
+\def\branches@if#1{%
+ \ifnum \branches@type=\tw@
+ \begin{IfBranchDummy}%
+ \textit{ if #1 then}%
+ \else
+ \par
+ \ifFD@tight@\else \addvspace\medskipamount \fi
+ \noindent\textit{If #1 then}%
+ \fi
+ \saved@slot@number=\slot@number
+ \gdef\branches@type{0}%
+ \let\par=\branches@par
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\branches@else{%
+ \ifnum \branches@type=\z@
+ \textit{ relax else}%
+ \gdef\branches@type{1}%
+ \else
+ \par
+ \end{IfBranch}%
+ \noindent\textit{Else}%
+ \gdef\branches@type{2}%
+ \fi
+ \global\slot@number=\saved@slot@number
+ \let\par=\branches@par
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\branches@fi{%
+ \ifnum \branches@type=\thr@@
+ \expandafter\end \expandafter{\@currenvir}%
+ \expandafter\gdef \expandafter\FD@saved@fis
+ \expandafter{\FD@saved@fis \space fi}%
+ \else
+ \end{IfBranch}%
+ \gdef\FD@saved@fis{Fi}%
+ \fi
+ \gdef\branches@type{3}%
+ \let\par=\branches@par
+}
+% \end{macrocode}
+% \begin{macrocode}
+\gdef\branches@type{4}
+% \end{macrocode}
+% \begin{macrocode}
+\def\branches@par{%
+ \@restorepar
+ \ifnum \branches@type=\thr@@
+ \noindent\textit{\FD@saved@fis}\par
+ \else
+ \begin{IfBranch}%
+ \fi
+ \gdef\branches@type{4}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{environment}{IfBranch}
+% \changes{1.916}{2001/01/09}{Environment added. (LH)}
+% \changes{1.920}{2001/09/16}{Removed assignment to \cs{listparindent}.
+% I don't know why it was there in the first place. (LH)}
+% \begin{switch}{FD@tight@}
+% \changes{1.916}{2001/01/09}{Switch added. (LH)}
+% The branches of a conditional that is being shown are put in an
+% \texttt{IfBranch} environment, to emphasize the branches as logical
+% units in the file. Depending on the value of the \texttt{FD@tight@}
+% switch, there are two different ways that the branches can be
+% distinguished. In the non-tight setting (\texttt{FD@tight@} false),
+% there is one |\medskip|\-|amount| of vertical space before and after
+% the branch, but no indentation. In the tight setting (which is used
+% for \meta{glyph commands} and \meta{slot commands}), there is no
+% extra vertical space around the branch, instead it is indented by
+% $1\,\mathrm{em}$.
+% \begin{macrocode}
+\newif\ifFD@tight@
+\newenvironment{IfBranch}{%
+ \list{}{%
+ \ifFD@tight@
+ \setlength\topsep{\z@skip}%
+ \@beginparpenalty=\z@
+ \@endparpenalty=\z@
+ \setlength\leftmargin{1em}%
+ \else
+ \setlength\topsep{\medskipamount}%
+ \@beginparpenalty=-10%
+ \@endparpenalty=\@beginparpenalty
+ \setlength\leftmargin{\z@}%
+ \fi
+ \setlength\partopsep{\z@skip}%
+ \setlength\itemsep{\z@skip}%
+ \setlength\parsep{\z@ plus\p@}%
+ \setlength\rightmargin{\z@}%
+ \setlength\itemindent{\z@}%
+ }%
+ \item[]%
+}{\endlist}
+% \end{macrocode}
+% \end{switch}\end{environment}
+%
+% \begin{environment}{IfBranchDummy}
+% \changes{1.916}{2001/01/25}{Environment added. (LH)}
+% In order to get the nesting right, each |\branches@else| command has
+% to |\begin| a new environment, but if it is immediately followed by
+% a |\branches@if| then that environment should not cause an
+% indentation. In these cases the \texttt{IfBranchDummy} environment
+% is used instead of \texttt{IfBranch}.
+% \begin{macrocode}
+\newenvironment{IfBranchDummy}{}{}
+%</doc>
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \subsubsection{Miscellanea}
+%
+% \begin{macro}{\primitiveinput}
+%
+% If |\@@input| is defined, I'll assume it's the \LaTeX{} version
+% of the \TeX{} |\input| primitive. I need this so that I can say
+% |\expandafter\foo\primitiveinput|, which doesn't work with the
+% \LaTeX{} version of |\input|.
+%
+% \begin{macrocode}
+%<*pkg>
+\x_cs\ifx{@@input}\x_relax
+ \let\primitiveinput=\input
+\else
+ \let\primitiveinput=\@@input
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \DescribeMacro{\process_csep_list}
+% The macro
+% \begin{quote}
+% |\process_csep_list|\marg{pretext}\meta{comma-sep~list}^^A
+% |,\process_csep_list,|
+% \end{quote}
+% executes \meta{pretext}\marg{item} for every item in the
+% \meta{comma-sep~list}.
+%
+% \begin{macro}{\process_csep_list}
+% \begin{macrocode}
+\def\process_csep_list#1#2,{
+ \ifx\process_csep_list#2
+ \expandafter\gobble_one
+ \else
+ \expandafter\identity_one
+ \fi{
+ #1{#2}
+ \process_csep_list{#1}
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\print@csep@list}
+% \textit{Use of this macro is now deprecated; use \cs{TypesetList}
+% instead wherever possible.} The macro call
+% \begin{quote}
+% |\print@csep@list|\marg{format}\marg{list}
+% \end{quote}
+% prints the comma-separated list \meta{list} in math mode.
+% \meta{format} can be used to set the style in which the list is
+% printed, since it is executed in the beginning of the same group as
+% in which the list is printed.
+%
+% The formating is based on changing the |\mathcode| of comma to
+% |"8000| so that the comma can be used as if it was an active character
+% without actually having to be one.
+% \begin{macrocode}
+%<*doc>
+\begingroup
+ \catcode`\,=13
+ \gdef\print@csep@list#1#2{%
+ $%
+ \ifnum "8000=\mathcode`\,\else
+ \mathchardef\private@comma=\mathcode`\,%
+ \mathcode`\,="8000\x@relax
+ \fi
+ #1%
+ \let,=\active@comma
+ #2%
+ $%
+ }
+\endgroup
+\def\active@comma{\private@comma \penalty\binoppenalty}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Real numbers}
+%
+% \TeX's \meta{number}s are merely integers, but \package{fontinst}
+% needs to store and calculate with numerical entities (most of which
+% are lengths) that are intrinsically real numbers. Most of the time,
+% \package{fontinst} does this by using a representation of real numbers
+% by integers in which a real number $x$ is represented by the integer
+% that $1000x$ gets rounded to. This representation has proved
+% sufficiently precise for most purposes.
+%
+% There are however a few cases in which real numbers must be delt with
+% in a more general fashion. Generic routines for this appear in this
+% subsection.
+%
+% \begin{macro}{\make_factor}
+% \changes{1.903}{1999/05/13}{Macro added. (LH)}
+% The |\make_factor| macro is meant to be used in the context
+% \begin{quote}
+% |\make_factor|\marg{number}
+% \end{quote}
+% where \meta{number} can be any legal \TeX\ number. It expands to
+% the same number divided by 1000, with decimals, so that what it
+% expands to matches the regular expression
+% \begin{quote}
+% |-?[0-9]+\.[0-9][0-9][0-9]|
+% \end{quote}
+%
+% More specifically, |\make_factor| has two tasks to perform: it takes
+% care of the sign, so that its subsidary macros need only work with
+% unsigned numbers, and it converts the \meta{number} (which could
+% well be a countdef or mathchardef token) to a sequence of digits.
+% \begin{macrocode}
+%<*pkg>
+\def\make_factor#1{
+ \ifnum #1<\z@
+ -\expandafter\make_factor_i\expandafter{\number-#1}
+ \else
+ \expandafter\make_factor_i\expandafter{\number#1}
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\make_factor_i}
+% |\make_factor_i| distinguishes between the two main cases of
+% numbers that in absolute value are less than 1000 and numbers that
+% in absolute value are greater than or equal to 1000. In the former
+% case, zeros need to be inserted. In the latter case, some number
+% of digits need to be stepped over before the decimal point can be
+% inserted.
+% \begin{macrocode}
+\def\make_factor_i#1{
+ \ifnum #1<\one_thousand
+ \make_factor_ii{#1}
+ \else
+ \make_factor_iii #1
+ \fi
+ #1
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make_factor_ii}
+% |\make_factor_ii| inserts extra zeros, in the extent it is
+% needed.
+% \begin{macrocode}
+\def\make_factor_ii#1{
+ 0.
+ \ifnum #1<\one_hundred
+ 0
+ \ifnum #1<10~ 0\fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\make_factor_iii}
+% |\make_factor_iii| steps over one digit and checks if this is the
+% correct position for the decimal point. Note that |#2#3| is
+% exactly the digits in the number that has not been stepped over.
+% Also note that comparision with |#2#3| would not work, since |#2|
+% can be |0|.
+% \begin{macrocode}
+\def\make_factor_iii#1#2#3\fi#4{
+ \fi
+ #4
+ \ifnum 1#3<\one_thousand
+ .
+ \else
+ \make_factor_iii#2#3
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% It also happens that real numbers are represented by dimens, in the
+% common way that the number 1 is represented by the dimen 1\,pt. For
+% those cases the following macro is indispensable.
+%
+% \begin{macro}{\lose_measure}
+% Get rid of a trailing |pt| when converting dimension.
+% \begin{macrocode}
+{
+ \catcode`\p=12
+ \catcode`\t=12
+ \gdef\lose_measure#1pt{#1}
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Error, warning, and info messages}
+%
+% The code in this subsection is an adaptation of code from the
+% \LaTeX\ kernel---more precisely from the source file
+% \texttt{lterror.dtx}---and the same is true for some of the comments.
+% As authors of that code are listed Johannes Braams, David Carlisle,
+% Alan Jeffrey, Leslie Lamport, Frank Mittelbach, Chris Rowley, and
+% Rainer Sch\"opf. The original source can be found in the file
+% \texttt{lterror.dtx} in the \texttt{macros}\slash\texttt{latex}\slash
+% \texttt{base} directory in any of the Comprehensive \TeX\ Archive
+% Network FTP sites.\footnote{As if anyone who has managed to get this
+% far didn't already know that!}
+%
+% That should have fulfilled the conditions in the LPPL.^^A
+% \changes{1.906}{1999/07/23}{Adaptation of \LaTeX's message system
+% completed. (LH)}
+% \par\bigskip
+%
+%
+% \subsubsection{General commands}
+%
+% \begin{macro}{\messagebreak}
+% This command prints a new-line inside a message, followed by a
+% continuation whose exact appearence may depend on the context.
+% Normally this command is defined to be |\relax|, but inside messages
+% it gets redefined to a linebreak (|^^J|) followed by the appropriate
+% continuation.
+% \changes{1.909}{1999/10/16}{New name for \cs{message_break}. (LH)}
+% \begin{macrocode}
+%<pkg>\let\messagebreak\x_relax
+%<doc>\let\messagebreak\space
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\generic_info}
+% This takes two arguments: a continuation and a message, and sends
+% the result to the log file.
+% \begin{macrocode}
+%<*pkg>
+\def\generic_info#1#2{
+ \begingroup
+ \def\messagebreak{^^J#1}
+ \immediate\write\m@ne{#2\on_line.}
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\generic_warning}
+% This takes two arguments: a continuation and a message, and sends
+% the result to the screen.
+% \begin{macrocode}
+\def\generic_warning#1#2{
+ \begingroup
+ \def\messagebreak{^^J#1}
+ \immediate\write\closed_stream{^^J#2\on_line.^^J}
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\generic_error}
+% ``This macro takes four arguments: a continuation,
+% an error message, where to go for further information, and the help
+% information. It displays the error message, and sets the error help
+% (the result of typing |h| to the prompt), and does a horrible hack
+% to turn the last context line (which by default is the only context
+% line) into just three dots. This could be made more efficient.''
+%
+% Thus far the \LaTeX\ comments, but the horrible hack it mensions
+% has been removed since it just makes things look strange when
+% |\errorcontextlines| is larger than one.
+% ^^A What the hack actually does is that it turns
+% ^^A as much as possible of the topmost context line to spaces. It has
+% ^^A two ways of achieving this. The first is to make the context line
+% ^^A too long to display in full, by ending the argument of |\errmessage|
+% ^^A with the control sequence
+% ^^A \begin{quote}
+% ^^A \tiny\verb*+\@err@ +^^A
+% ^^A \verb*+ +
+% ^^A \end{quote}
+% ^^A As its name ends with a long sequence of spaces, it won't be visible;
+% ^^A the |@err@| appears in the |...| part of the line. The other method
+% ^^A it uses is to turn every token in the context line that is not part
+% ^^A of a control sequence name to spaces (as characters, not in
+% ^^A category) through a |\lowercase| trick. The only characters that
+% ^^A cannot be turned into spaces this way are the three continuation
+% ^^A dots.
+% The ``where to go for further information'' message is currently not
+% used (it is commented out in |\fontinsterror| below), since there
+% is no good place to refer to anyway. If the documentation is ever
+% improved in this respect, it would of course be best to reinsert
+% this message. Note however that unlike the case in \LaTeX, this
+% message should end with a |^^J|.
+%
+% A complication is that \TeX\ versions older than 3.141 have a bug
+% which causes |^^J| to not force a linebreak in |\message| and
+% |\errmessage| commands. So for these old \TeX's we use a |\write| to
+% produce the message, and then have an empty |\errmessage| command.
+% This causes an extra line of the form
+%\begin{verbatim}
+%! .
+%\end{verbatim}
+% to appear on the terminal, but if you do not like it, you can always
+% upgrade your \TeX!
+%
+% Since I don't think many \package{fontinst} users use such old
+% \TeX s, I removed \LaTeX's test for \TeX\ version at this point. The
+% code for old \TeX s is still there, but it lies in a \package{docstrip}
+% module of its own.
+%
+% First the `standard case'.
+% \begin{macrocode}
+%<*!oldTeX>
+\def\generic_error#1#2#3#4{
+ \begingroup
+ \immediate\write\closed_stream{}
+ \def\messagebreak{^^J}
+ \edef\a_macro{{#4}}
+ \errhelp\a_macro
+ \def\messagebreak{^^J#1}
+ \errmessage{#2.^^J^^J#3
+ Type~\space H~<return>~\space for~immediate~help
+ }
+ \endgroup
+}
+%</!oldTeX>
+% \end{macrocode}
+%
+% Secondly the version for old \TeX's.
+% \begin{macrocode}
+%<*oldTeX>
+\def\generic_error#1#2#3#4{%
+ \begingroup
+ \immediate\write\closed_stream{}
+ \def\messagebreak{^^J}
+ \edef\a_macro{{#4}}
+ \errhelp\a_macro
+ \def\messagebreak{^^J#1}
+ \immediate\write\closed_stream{!~#2.^^J^^J#3^^J
+ Type~\space H~<return>~\space for~immediate~help.
+ }
+ \errmessage{}
+ \endgroup
+}
+%</oldTeX>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\fontinsterror}
+% \changes{1.909}{1999/10/16}{New name for \cs{fontinst_error}. (LH)}
+% \begin{macro}{\fontinstwarning}
+% \changes{1.909}{1999/10/16}{New name for \cs{fontinst_warning}. (LH)}
+% \begin{macro}{\fontinstwarningnoline}
+% \changes{1.909}{1999/10/16}{New name for
+% \cs{fontinst_warning_no_line}. (LH)}
+% \begin{macro}{\fontinstinfo}
+% \changes{1.909}{1999/10/16}{New name for \cs{fontinst_info}. (LH)}
+% These commands are intended for giving a uniformed, and for the
+% programmers hopefully simplified, form of error, warning, and info
+% messages. The syntax is:
+% \begin{quote}
+% |\fontinsterror|\marg{subsystem}\marg{error}\marg{help}\\
+% |\fontinstwarning|\marg{subsystem}\marg{warning}\\
+% |\fontinstwarningnoline|\marg{subsystem}\marg{warning}\\
+% |\fontinstinfo|\marg{subsystem}\marg{info}
+% \end{quote}
+% A \meta{subsystem} in this context is intended to be some piece of
+% text which identifies some functionally clearly defined part of
+% \package{fontinst}. Examples of \meta{subsystem}s could be
+% \texttt{PL to MTX converter}, \texttt{Ligful (V)PL writer}, and
+% \texttt{Latin family}.
+%
+% The |\fontinsterror| command prints the \meta{error} message, and
+% presents the interactive prompt; if the user types |h|, then the
+% \meta{help} information is displayed. The |\fontinstwarning|
+% command produces a warning but does not present the interactive
+% prompt. The |\fontinstwarningnoline| command does the same, but
+% doesn't print the input line number. The |\fontinstinfo| command
+% writes the message to the |log| file. Within the messages, the
+% command |\messagebreak| can be used to break a line and |\space| is
+% a space, for example:
+% \begin{verbatim}
+% \def\foo{FOO}
+% \fontinstwarning{Hungarian}{
+% Your~hovercraft~is~full~of~eels,\messagebreak
+% and~\string\foo\space is~\foo}
+% \end{verbatim}
+% produces:
+% \begin{verbatim}
+% Hungarian warning:
+% Your hovercraft is full of eels,
+% and \foo is FOO on input line 54.
+% \end{verbatim}
+%
+% \begin{macrocode}
+\def\fontinsterror#1#2#3{
+ \generic_error{
+ \four_spaces\four_spaces
+ }{
+ #1~error:\messagebreak #2
+ }{
+% See~the~#1~package~documentation~for~explanation.^^J
+ }{#3}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\fontinstwarning#1#2{
+ \generic_warning{
+ \four_spaces\four_spaces
+ }{
+ #1~warning:\messagebreak #2
+ }
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\fontinstwarningnoline#1#2{
+ \fontinstwarning{#1}{#2\gobble_one}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\fontinstinfo#1#2{
+ \generic_info{
+ \four_spaces\four_spaces
+ }{
+ #1~info:\messagebreak #2
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\fontinsterror#1#2#3{%
+ \Bheading{Error} observed by #1:%
+ \begin{quote}#2.\end{quote}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\fontinstwarning#1#2{
+ \Bheading{Warning} from #1:%
+ \begin{quote}#2.\end{quote}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\let\fontinstwarningnoline=\fontinstwarning
+% \end{macrocode}
+% \begin{macrocode}
+\def\fontinstinfo#1#2{
+ \Bheading{Info} from #1:%
+ \begin{quote}#2.\end{quote}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\on_line}
+% The message ` on input line~$n$'. \LaTeX\ has special code for
+% \TeX~2, but since \package{fontinst} has assumed the existence of
+% the |\errorcontextlines| parameter since v\,1.500, the removal of
+% that code shouldn't cause problems for anyone who wasn't already
+% having related problems.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\on_line{~on~input~line~\the\inputlineno}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\four_spaces}
+% Four spaces. Using |\edef| (rather than |\def| as in \LaTeX) to
+% save some macro expansions.
+% \begin{macrocode}
+\edef\four_spaces{\space\space\space\space}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Specific errors}
+%
+% \begin{macro}{\error_help_a}
+% \begin{macro}{\error_help_c}
+% \begin{macro}{\error_help_d}
+% \begin{macro}{\error_help_e}
+% \changes{1.912}{2000/02/12}{Macro added. (LH)}
+% The more common error help messages. The first three are called
+% |\@eha|, |\@ehc|, and |\@ehd| in \LaTeX. |\@ehb| is of no use for
+% \package{fontinst}, so it has been omitted. |\error_help_e| is a
+% new one for \package{fontinst}.
+% \begin{macrocode}
+\gdef\error_help_a{
+ Your~command~was~ignored.\messagebreak
+ Type~\space I~<command>~<return>~\space to~replace~it~
+ with~another~command,\messagebreak
+ or~\space <return>~\space to~continue~without~it.}
+\gdef\error_help_c{
+ Try~typing~\space <return>~
+ \space to~proceed.\messagebreak
+ If~that~doesn't~work,~type~\space X~<return>~\space to~quit.}
+\gdef\error_help_d{
+ You're~in~trouble~here.~\space\error_help_c}
+\def\error_help_e#1{You~can~continue,~but~the~#1~wrong.}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+% \subsubsection{\TeX\ parameters}
+%
+% \multchanges{\cs{newlinechar}\cs{errorcontextlines}}{1.914}
+% {2000/05/20}{Moved to error message subsection. (LH)}
+% \begin{macro}{\newlinechar}
+% Set |\newlinechar| for |\errhelp| messages.
+% \begin{macrocode}
+\newlinechar=`\^^J
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\errorcontextlines}
+% By default, show as much error info as you can.
+% (We assume \package{fontinst} users are \TeX{}perts.)
+% \begin{macrocode}
+\errorcontextlines=999
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tracinglostchars}
+% \changes{1.915}{2000/07/31}{Added setting this parameter. (LH)}
+% Make |\tracinglostchars| positive---this will simplify catching
+% bugs, as many \package{fontinst} bugs show up in that output is
+% being generated, but that used to disappear silently when
+% \package{fontinst} was run under Ini\TeX.
+% \begin{macrocode}
+\tracinglostchars=1
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/fontinst/base/ficommon.dtx b/Master/texmf-dist/source/fontinst/base/ficommon.dtx
new file mode 100644
index 00000000000..3127c25cbe5
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/ficommon.dtx
@@ -0,0 +1,2415 @@
+% \CheckSum{2283}
+% \iffalse meta-comment
+%
+% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+% hacked and maintained 1997, 1998 Sebastian Rahtz,
+% copyright 1998, 1999, 2000, 2001 the fontinst maintenance team and
+% any individual authors listed elsewhere in this file.
+% All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.2 or, at your option, any later version.
+%
+%%% From file: ficommon.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fisource}
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth, Lars Hellstr\"om}
+\begin{document}
+\maketitle
+\tableofcontents
+\DocInput{ficommon.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \StopEventually{}
+%
+%
+% \section{General commands}
+% \changes{1.916}{2000/12/27}{Moved Section \thesection\ to
+% \texttt{ficommon.dtx}. (LH)}
+%
+% \changes{1.916}{2001/01/02}{\emph{Major} overhaul of \package{fontdoc}
+% mechanisms for integer and string expressions completed. (LH)}
+% There are roughly five types of arguments that \package{fontinst}
+% commands can take. These are
+% \begin{itemize}
+% \item integer expressions,
+% \item string expressions,
+% \item dimensions,
+% \item commands (i.e., \TeX\ control sequences), and
+% \item other (pretty much ``none of the above'').
+% \end{itemize}
+% The most common form of an integer expression is simply a \TeX\
+% \meta{number} and the most common form of a string expression is
+% simply a sequence of character tokens, but there are more complicated
+% forms. Dimensions are simply \TeX\ \meta{dimen}s; their use is rather
+% limited. Common to integer expressions, string expressions, and
+% dimensions is that these argument types get expanded during
+% evaluation (in the case of string expressions, this expansion
+% \emph{is} the evaluation), which means one can use macros in
+% arguments of these types.
+%
+% Command arguments do not get expanded---they are mainly used with
+% commands that modify the definitions of other commands. As for the
+% ``other'' arguments one cannot give any rules: they might get
+% expanded, but it could also happen that they won't.
+%
+%
+% \subsection{String expressions}
+%
+% The first problem with string expressions is to typeset the values.
+% The character strings that appear in ETX and MTX files usually consist
+% only of immediately printable characters, but there are a few
+% characters (such as underscore) which may be used even though they
+% aren't directly printable. This subsection defines commands which deal
+% with this problem by replacing non-printable characters by commands.
+% The implementation is based on the implementation of the
+% |\MakeHarmless| command in the \package{xdoc} package.
+%
+% \subsubsection{Typesetting problematic characters}
+%
+% \begin{macro}{\PrintChar}
+% \begin{macro}{\InvisibleCharPrefix}
+% \begin{macro}{\InvisibleCharSuffix}
+% The |\PrintChar| command has the syntax
+% \begin{quote}
+% |\PrintChar|\marg{8-bit number}
+% \end{quote}
+% where \meta{8-bit number} is a \TeX\ number in the range 0--255.
+% For arguments in the range 0--31, |\PrintChar| prints
+% `\textit{\ttfamily\string^\string^@}'--`\textit{\ttfamily
+% \string^\string^_}'. For an argument in the range 32--126,
+% |\PrintChar| calls |\Print|\-|Visible|\-|Char| which typesets the
+% corresponding ASCII character (similar to |\char|, but it takes the
+% path via the \LaTeX\ internal representation so that it works with
+% non-typewriter \texttt{OT1} fonts); in particular, |\PrintChar{32}|
+% prints a ``visible space'' character. |\PrintChar{127}| prints
+% `\textit{\ttfamily\string^\string^?}'. For arguments in the range
+% 128--255, |\PrintChar| prints
+% `\textit{\ttfamily\string^\string^80}'--`\textit{\ttfamily
+% \string^\string^ff}'.
+% The |\PrintChar| command is robust.
+%
+% The macros |\InvisibleCharPrefix| and |\InvisibleCharSuffix| begin
+% and end a |^^|-sequence. |\InvisibleCharPrefix| should print the
+% actual |^^|, but it may also for example select a new font for
+% the |^^|-sequence (such font changes are restored at the end of
+% |\PrintChar|).
+% \begin{macrocode}
+%<*doc>
+\DeclareRobustCommand\PrintChar[1]{%
+ \leavevmode
+ \begingroup
+ \count@=#1\relax
+ \ifnum \@xxxii>\count@
+ \advance \count@ 64%
+ \InvisibleCharPrefix
+ \PrintVisibleChar\count@
+ \InvisibleCharSuffix
+ \else\ifnum 127>\count@
+ \PrintVisibleChar\count@
+ \else
+ \InvisibleCharPrefix
+ \ifnum 127=\count@ \PrintVisibleChar{63}\else
+ \@tempcnta=\count@
+ \divide \count@ \sixt@@n
+ \@tempcntb=\count@
+ \multiply \count@ \sixt@@n
+ \advance \@tempcnta -\count@
+ \advance \@tempcntb \ifnum 9<\@tempcntb 87\else 48\fi
+ \advance \@tempcnta \ifnum 9<\@tempcnta 87\else 48\fi
+ \char\@tempcntb \char\@tempcnta
+ \fi
+ \InvisibleCharSuffix
+ \fi\fi
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\InvisibleCharPrefix{%
+ \/\em
+ \PrintVisibleChar{`\^}\PrintVisibleChar{`\^}%
+}
+\newcommand\InvisibleCharSuffix{\/}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\PrintVisibleChar}
+% The |\PrintVisibleChar| command should print the visible ASCII
+% character whose character code is given in the argument. The
+% definition given here translates every character code to the
+% corresponding \LaTeX\ internal representation, which is necessary
+% if the current font is e.g.\ an \texttt{OT1}-encoded non-typewriter
+% font. If the current font is known to be \texttt{T1}-encoded then
+% one can do just as well with |\char#1 | as the replacement text.
+% \begin{macrocode}
+\newcommand\PrintVisibleChar[1]{%
+ \ifcase #1%
+ \or\or\or\or\or\or\or\or \or\or\or\or\or\or\or\or
+ \or\or\or\or\or\or\or\or \or\or\or\or\or\or\or\or
+ % "20
+ \textvisiblespace \or!\or\textquotedbl \or\#\or\textdollar
+ \or\%\or\&\or\textquoteright\or(\or)\or*\or+\or,\or-\or.\or/%
+ \or % "30
+ 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or:\or;\or
+ \textless\or=\or\textgreater\or?%
+ \or % "40
+ @\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 % "50
+ P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\or [\or
+ \textbackslash \or]\or\textasciicircum \or\textunderscore
+ \or % "60
+ \textquoteleft \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 % "70
+ p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\or
+ \textbraceleft \or\textbar \or\textbraceright \or\textasciitilde
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textvisiblespace}
+% The |\textvisiblespace| command, which is heavily used in names of
+% coding schemes, unfortunately has a default definition which lacks
+% leading on the right side. This redefinition attempts to improve
+% things.
+% \changes{1.921}{2002/03/27}{Redefinition added. (LH)}
+% \begin{macrocode}
+\DeclareTextCommandDefault{\textvisiblespace}{%
+ \makebox[\fontdimen\tw@\font]{%
+ \hfil
+ \vrule \@height.3ex%
+ \vbox{\hrule \@width .66\fontdimen\tw@\font}%
+ \vrule \@height.3ex%
+ \hfil
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@quoted@PrintChar}
+% One sometimes wants to use a printable character string as part of a
+% control sequence name. If the normal definition of |\PrintChar| is
+% in force at such times then each |\PrintChar| in the string would
+% produce lots of errors, which is why |\FD@quoted@PrintChar| has
+% been defined. This macro is an alternative definition of
+% |\PrintChar| which expands to |"|\meta{number}|"|, which can be part
+% of a macro name.
+% \begin{macrocode}
+\def\FD@quoted@PrintChar#1{"\number#1"}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Converting character strings}
+%
+% Replacing all problematic characters with |\PrintChar| calls certainly
+% makes the strings easier to manage, but actually making those
+% replacements is a rather complicated task. This subsubsection
+% contains the macros necessary for doing these replacements.
+%
+% The first problem is how to efficiently recognise the problematic
+% characters. One might think that it is sufficient to look at their
+% |\catcode|, but that will fail for characters like |<| whose normal
+% catcode is 12 but do not appear in the \texttt{OT1} encoding. Because
+% of this, I have chosen a brute strength solution: build a table
+% (indexed by character code) that gives the printable form of
+% every character. This table is stored in the
+% \describecsfamily{FD@printable@\meta{code}}^^A
+% |\FD@printable@|\meta{code} family of control sequences, where the
+% \meta{code} is in the range |32|--|126|. The printable form of
+% characters outside this range is always the |\PrintChar| form.
+% \begin{macrocode}
+\count@=32
+\begingroup
+ \catcode\z@=12\relax
+ \@firstofone{%
+\endgroup
+ \loop
+ \if \ifnum 11=\catcode\count@ 1\else \ifnum 12=\catcode\count@
+ 1\else 0\fi\fi 1%
+ \uccode\z@=\count@
+ \uppercase{\def\@tempa{^^@}}%
+ \else
+ \edef\@tempa{\noexpand\PrintChar{\the\count@}}%
+ \fi
+ \x@cs\let{FD@printable@\the\count@}=\@tempa
+ \advance \count@ \@ne
+ \ifnum 127>\count@ \repeat
+}
+% \end{macrocode}
+% This loop hasn't caught all non-printable characters, so a few
+% entries have to be set explicitly.
+% \begin{macrocode}
+\@namedef{FD@printable@34}{\PrintChar{34}} % "
+\@namedef{FD@printable@60}{\PrintChar{60}} % <
+\@namedef{FD@printable@62}{\PrintChar{62}} % >
+% \end{macrocode}
+%
+%
+% \begin{macro}{\MakePrintable}
+% To render a character string harmless, you do
+% \begin{quote}
+% |\MakePrintable|\marg{macro}\marg{flag}\marg{string}
+% \end{quote}
+% This locally assigns to \meta{macro} the printable character string
+% which corresponds to \meta{string}. Furthermore the control sequence
+% |\if|\meta{flag} is locally let to |\iftrue| or |\iffalse|
+% depending on whether the printable string is simple (only consists
+% of character tokens and |\PrintChar| commands) or not.
+%
+% During the conversion the converted part of the string is stored in
+% |\toks@| and the |@tempswa| switch keeps track of whether the string
+% so far is simple (yes when |false|), but those are both local to
+% |\MakePrintable|.
+% \begin{macrocode}
+\def\MakePrintable#1#2#3{%
+ \begingroup
+ \toks@={}%
+ \escapechar=`\\%
+ \@tempswafalse
+ \FD@printable@#3\protect\FD@printable@
+ \toks@=\expandafter{%
+ \expandafter\let \csname if#2\expandafter\endcsname
+ \csname if\if@tempswa false\else true\fi \expandafter\endcsname
+ \expandafter\def \expandafter#1\expandafter{\the\toks@}%
+ }%
+ \expandafter\endgroup \the\toks@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@printable@iii}
+% \begin{macro}{\FD@printable@iv}
+% \begin{macro}{\FD@printable@v}
+% \begin{macro}{\FD@printable@vi}
+% What one has to be most careful about when making strings printable
+% are the space tokens, since many of \TeX's primitives gladly
+% snatches an extra space (or more) where you don't want them to in
+% this case. Macro parameters can be particularly dangerous, as \TeX\
+% will skip any number of spaces while looking for the replacement
+% text for an undelimited macro argument. Therefore the algorithm for
+% rendering a character token harmless consists begins
+% (|\FD@printable@iii|) with |\string|ing the next token in the
+% string---this preserves the character code and sets the category to
+% 12 for all characters except the ASCII space, which gets category 10
+% (space)---and then |\futurelet| is used to peek at the next token. If
+% it is a space token (|\FD@printable@iv|) then the character code
+% is 32 and the actual space can be gobbled (|\FD@printable@v|), and
+% if it isn't then the next token can be grabbed in a undelimited macro
+% argument (|\FD@printable@vi|). In either case, the harmless form
+% is given by the |\FD@printable@|\meta{code} table entry
+% (in |\FD@printable@v| or |\FD@printable@vi|).
+% \begin{macrocode}
+\def\FD@printable@iii{%
+ \expandafter\futurelet \expandafter\@let@token
+ \expandafter\FD@printable@iv \string
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\FD@printable@iv{%
+ \ifx \@let@token\@sptoken
+ \expandafter\FD@printable@v
+ \else
+ \expandafter\FD@printable@vi
+ \fi
+}
+% \end{macrocode}
+% ^^A Hack:
+% \begingroup
+% \expandafter\def \expandafter\MakePrivateLetters \expandafter{^^A
+% \MakePrivateLetters
+% \catcode`3=11
+% \catcode`2=11
+% }
+% \begin{macrocode}
+\begingroup
+ \catcode`3=\catcode`a
+ \catcode`2=\catcode`a
+ \@firstofone{\gdef\FD@printable@v} {%
+ \toks@=\expandafter{\the \expandafter\toks@ \FD@printable@32}%
+ \FD@printable@
+ }
+\endgroup
+% \end{macrocode}
+% \endgroup
+% \begin{macrocode}
+\def\FD@printable@vi#1{%
+ \if \ifnum `#1<\@xxxii 1\else \ifnum `#1>126 1\else 0\fi\fi 1%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\PrintChar \expandafter{\number`#1}%
+ }%
+ \else
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname FD@printable@\number`#1\endcsname}%
+ \fi
+ \FD@printable@
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\FD@printable@}
+% \begin{macro}{\FD@printable@i}
+% \begin{macro}{\FD@printable@ii}
+% \begin{macro}{\FD@printable@vii}
+% But that is not all |\MakePrintable| can do. One must also deal
+% with things in the string that are not simply characters, but more
+% complex items (for example |\str| and |\strint| constructions). When
+% control sequences that start such complex items are fed to
+% |\MakePrintable| they must be preceeded by a |\protect| (they will
+% be if the original command is defined using \LaTeX's
+% |\Declare|\-|Robust|\-|Command| command and the string has been fed
+% through a |\protected@edef|, which happens to be the case); this
+% |\protect| is taken as a signal that the next token should get
+% special processing. Control sequences that are not preceeded by a
+% |\protect| are simply |\string|ed.
+%
+% To accommodate for this, |\FD@printable@| (which is the first step
+% in converting a token) always begins by checking (in |\FD@|\-^^A
+% |printable@i|) whether the next token is a control sequence. If it
+% is and that control sequence is |\protect| then it is checked (in
+% |\FD@printable@ii|) whether the control sequence
+% \describecsfamily{FD@printable\PrintChar{`\\}\meta{cs-name}}^^A
+% |\FD@printable\|\meta{cs-name}, where \meta{cs-name} is the name
+% without |\| (and with any spaces removed) of the control sequence
+% encountered, is defined. If it is defined then control is handed
+% over to |\FD@printable\|\meta{cs-name} which should process the
+% arguments (if any) of |\|\meta{cs-name} and add a suitable
+% representation to |\toks@|, but if |\FD@printable\|\meta{cs-name}
+% isn't defined then this is considered to be an error.
+%
+% If the next token isn't a control sequence then control is handed
+% over to |\FD@printable@ii|. If the next token is a control sequence
+% but not |\protect| then that token is |\string|ed (in
+% |\FD@printable@vii|) and control is handed over to
+% |\FD@printable@vi|.
+% \begin{macrocode}
+\def\FD@printable@{\futurelet\@let@token \FD@printable@i}
+% \end{macrocode}
+% \begin{macrocode}
+\def\FD@printable@i{%
+ \csname FD@printable@%
+ \ifcat \noexpand\@let@token \noexpand\FD@printable@
+ \ifx \@let@token\protect ii\else vii\fi
+ \else iii\fi
+ \endcsname
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\FD@printable@ii\protect#1{%
+ \@ifundefined{FD@printable\expandafter\zap@space\string#1 \@empty}{%
+ \PackageError{fontdoc}{Command \protect#1 not allowed in string}%
+ \@eha
+ }{\csname FD@printable\expandafter\zap@space\string#1 \@empty
+ \endcsname}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\FD@printable@vii{\expandafter\FD@printable@vi \string}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\FD@printable\FD@printable@}
+% A control sequence |\FD@printable\|\meta{cs-name} is responsible for
+% interpreting the string item that begins with the control sequence
+% |\|\meta{cs-name} and appending a printable representation of it to
+% |\toks@|. Normal |\FD@printable\|\meta{cs-name} control sequences
+% must also end by inserting |\FD@printable@| in front of what remains
+% of the string after the complex string item has been removed. This
+% sees to that the rest of the string is also made printable. The only
+% such control sequence which does not insert |\FD@printable@| is
+% |\FD@printable\FD@printable@|, but that is as it should be since
+% |\MakePrintable| itself appends a |\FD@printable@| to every character
+% string it should convert to mark the end of it.
+% \begin{macrocode}
+\expandafter\let
+ \csname FD@printable\string\FD@printable@\endcsname \@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@printable\PrintChar}
+% It is occasionally convenient to use a |\PrintChar| command as part
+% of a string that is to be made harmless instead of using the raw
+% character. The definition is very similar to that of
+% |\FD@printable@vi|.
+% \begin{macrocode}
+\@namedef{FD@printable\string\PrintChar}#1{%
+ \if \ifnum #1<\@xxxii 1\else \ifnum #1>126 1\else 0\fi\fi 1%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\PrintChar \expandafter{\number#1}%
+ }%
+ \else
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname FD@printable@\number#1\endcsname}%
+ \fi
+ \FD@printable@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\ExpandAndMakePrintable}
+% The |\ExpandAndMakePrintable| command is an abbreviation for a
+% common use of |\MakePrintable|, namely to first feed the string
+% through a |\protected@edef| to get rid of all the simple macros.
+% \begin{macrocode}
+\newcommand*\ExpandAndMakePrintable[3]{%
+ \protected@edef\@tempa{{#2}{#3}}%
+ \expandafter\MakePrintable \expandafter#1\@tempa
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Evaluating string expressions}
+%
+% In string expressions, the only available operation is juxtaposition
+% (fancy name for putting things next to each other) and thus the
+% syntax for a string expression is
+% \begin{quote}
+% \meta{string expression} \(\longrightarrow\) $\emptyset \mid$
+% \meta{string atom}\meta{string expression}
+% \end{quote}
+% where $\emptyset$ denotes the empty string. A \meta{string atom} is
+% one of
+% \begin{quote}
+% \meta{character token}\\
+% |\str|\marg{string expression}\\
+% |\strint|\marg{string expression}
+% \end{quote}
+% The meaning of a \meta{character token} is explained
+% in~\cite{TeXbook}. The |\str| and |\strint| forms of
+% \marg{string atom} refer to the respective values of the string and
+% integer variables (see Subsection~\ref{Ssec:Variables}) whose names
+% are given in the argument of |\str| or |\strint| respectively. Since
+% the names of variables are themselves string expressions, |\str| and
+% |\strint| may themselves be used in names of variables.
+%
+% It should be noted that most of \package{fontinst}'s string
+% expressions sooner or later end up between a |\csname| and the
+% corresponding |\endcsname|. This places significant restrictions on
+% what may occur in string expressions.
+%
+% \begin{macro}{\str}
+% \begin{macro}{\strint}
+% \changes{1.909}{1999/10/19}{Change to stop it from gobbling a
+% following space if the integer is stored in a macro. (LH)}
+% In \package{fontinst} the only macros needed for dealing with string
+% expressions are |\str| and |\strint|.
+% \begin{macrocode}
+%<*pkg>
+\def\str#1{\csname~s-#1\endcsname}
+\def\strint#1{\expandafter\identity_one\expandafter{\number\int{#1}}}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \package{fontdoc} mainly uses \TeX's text mode for typesetting string
+% expressions because not all characters are available in math mode;
+% it's easier to switch to text mode than to augment the math setup. One
+% kind of material is however typeset in math mode, namely
+% ``string-valued functions'': the name and functional parenthesis of
+% such material is typeset in math mode to get a mathematical look.
+%
+% \begin{macro}{\FD@string@func}
+% The |\FD@string@func| macro has the syntax
+% \begin{quote}
+% |\FD@string@func|\marg{name}\marg{argument}
+% \end{quote}
+% It is used for typesetting the \meta{name}$($\meta{argument}$)$ of a
+% string-valued function (e.g.\ the value-of-string-variable function
+% $\mathrm{s}$). It should only be used in horizontal mode.
+%
+% |\FD@string@func| includes a bit of extra spacing around the typeset
+% text, but not at the beginning or end of a string and neither
+% between two string-valued functions. As a flag for this is used
+% that the value of |\spacefactor| is 1; when it is one should proceed
+% as if this extra spacing is already present.
+% \begin{macrocode}
+%<*doc>
+\def\FD@string@func#1#2{%
+ \relax
+ \ifnum \spacefactor=\@ne $\mkern1mu\else$\fi
+ \mathrm{#1}($%
+ #2%
+ \ifnum \spacefactor=\@ne $\mkern-1mu\else $\fi)\mkern1mu$%
+ \spacefactor=\@ne
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TypesetStringExpression}
+% \begin{macro}{\FD@typeset@string}
+% \begin{macro}{\ifFD@swa}
+% In \package{fontdoc} the string expressions must be typeset, and
+% that is not trivial due to that (i) not all character tokens have
+% catcode 11 or 12 and (ii) not all characters are available in all
+% fonts. Furthermore the non-character string atoms should be given
+% special treatment in character strings!
+%
+% Because of this, string expressions that are to be typeset are
+% handed to a special command |\TypesetStringExpression|, which takes
+% the string to typeset as its only argument. This string may contain
+% user-defined macros.
+% \begin{macrocode}
+\newcommand\TypesetStringExpression[1]{%
+ \protected@edef\@tempa{%
+ \noexpand\MakePrintable \noexpand\@tempa {FD@swa}{#1}%
+ }%
+ \@tempa
+ \FD@typeset@string{\@tempa}%
+}
+% \end{macrocode}
+% Actually typesetting the string is handled in |\FD@typeset@string|,
+% but strings handed to this macro must be preprocessed by a full
+% protected expansion and a |\MakeHarmless|.
+% \begin{macrocode}
+\def\FD@typeset@string#1{%
+ \mbox{%
+ \normalfont\ttfamily
+ \spacefactor=\@ne
+ #1%
+ \ifnum \spacefactor=\@ne $\mkern-1mu\m@th$\fi
+ }%
+}
+% \end{macrocode}
+% The |\ifFD@swa| control sequence is often |\let| to |\iftrue| or
+% |\iffalse| by |\Make|\-|Printable|, and then it is used as a
+% conditional. Since that assignment sometimes takes place in
+% conditional text however, one must make sure that |\ifFD@swa|
+% always is some conditional.
+% \begin{macrocode}
+\let\ifFD@swa\iffalse
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\str}
+% \begin{macro}{\FD@printable\str}
+% The processing of the |\str| macro in \package{fontdoc} is far from
+% straightforward. |\str| has to be robust, but apart from that its
+% defintion has no effect on how its argument is processed. That is
+% instead controlled by |\FD@printable\str|, which happens to use
+% |\str| as an auxiliary formatting macro.
+%
+% Most of the complexity below is however due to the processing
+% needed to determine whether the string variable accessed has been
+% assigned a value. See |\Set|\-|String|\-|Variable| for more
+% information.
+% \begin{macrocode}
+\DeclareRobustCommand\str[1]{\FD@string@func{s}{#1}}
+\@namedef{FD@printable\string\str}#1{%
+ \MakePrintable\@tempa{FD@swa}{#1}%
+ \begingroup
+ \let\PrintChar=\FD@quoted@PrintChar
+ \if \ifFD@swa \@ifundefined{FD@s-\@tempa}{0}{1}\else 0\fi 1%
+ \expandafter
+ \endgroup
+ \csname FD@s-\@tempa\endcsname
+ \else
+ \endgroup
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\str \expandafter{\@tempa}}%
+ \@tempswatrue
+ \fi
+ \FD@printable@
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\strint}
+% \begin{macro}{\FD@printable\strint}
+% |\strint| is handled similarly to |\str|.
+% \begin{macrocode}
+\DeclareRobustCommand\strint[1]{\FD@string@func{int}{#1}}
+\@namedef{FD@printable\string\strint}#1{%
+ \MakePrintable\@tempa{FD@swa}{#1}%
+ \protected@edef\@tempa{%
+ \ifFD@swa \protect\FD@simple@int \else \strint \fi{\@tempa}%
+ }
+ \toks@=\expandafter{\the\expandafter\toks@ \@tempa}%
+ \@tempswatrue
+ \FD@printable@
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\macroparameter}
+% \changes{1.916}{2001/01/06}{Command added. (LH)}
+% \begin{macro}{\FD@printable\macroparameter}
+% The |\macroparameter| command can be used in string and integer
+% expressions as a sort of ``macro parameter placeholder''. It is not
+% defined in \package{fontinst}, but in \package{fontdoc} one
+% occationally writes comments which say things like ``XXX is short
+% for ASDFSKADN'', and in those cases one can use |\macroparameter|
+% as a placeholder for an argument. The syntax is
+% \begin{quote}
+% |\macroparameter|\marg{digit}
+% \end{quote}
+% where \meta{digit} should be a decimal digit between |1| and |9|
+% inclusive.
+%
+% The definition in |\macroparameter| handles uses of the command in
+% integer expressions, whereas |\FD@printable\macroparameter| takes
+% care of uses in string expressions.
+% \begin{macrocode}
+\DeclareRobustCommand\macroparameter[1]{%
+ \gdef\FD@expression{\text{\normalfont\itshape\##1}}%
+ \global\chardef\FD@priority=5%
+ \global\FD@bracket@level=\z@
+ \FD@evaluate@false
+}
+\@namedef{FD@printable\string\macroparameter}#1{%
+ \toks@=\expandafter{\the\toks@\textrm{\emph{\##1}}}%
+ \@tempswatrue
+ \FD@printable@
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+%
+% \subsection{Integer expressions}
+%
+% An \meta{integer expression} is one of the following:
+% \begin{quote}
+% \meta{number}\\
+% |\int|\marg{string expression}\\
+% |\neg|\marg{integer expression}\\
+% |\add|\marg{integer expression}\marg{integer expression}\\
+% |\sub|\marg{integer expression}\marg{integer expression}\\
+% |\max|\marg{integer expression}\marg{integer expression}\\
+% |\min|\marg{integer expression}\marg{integer expression}\\
+% |\mul|\marg{integer expression}\marg{integer expression}\\
+% |\div|\marg{integer expression}\marg{integer expression}\\
+% |\half|\marg{integer expression}\\
+% |\otherhalf|\marg{integer expression}\\
+% |\scale|\marg{integer expression}\marg{integer expression}\\
+% |\width|\marg{string expression}\\
+% |\height|\marg{string expression}\\
+% |\depth|\marg{string expression}\\
+% |\italic|\marg{string expression}\\
+% |\kerning|\marg{string expression}\marg{string expression}
+% \end{quote}
+% \meta{number} is any \TeX\ number, as defined in~\cite{TeXbook}. The
+% \meta{string expression} in the argument of |\int| must be the name of
+% an integer variable which is currently set, i.e., the condition
+% \begin{quote}
+% |\ifisint|\marg{string expression}|\then|
+% \end{quote}
+% must evaluate to true. Likewise the \meta{string expression} in the
+% argument of |\width|, |\height|, |\depth|, and |\italic| must be the
+% name of a glyph which is currently set, i.e., the condition
+% \begin{quote}
+% |\ifisglyph|\marg{string expression}|\then|
+% \end{quote}
+% must evaluate to true.
+%
+% \begin{macro}{\eval_expr}
+% \begin{macro}{\eval_expr_to}
+% \begin{macro}{\g_eval_expr_to}
+% \begin{macro}{\result}
+% The only thing \package{fontinst} does with integer expressions is
+% evaluating them. The macro
+% \begin{quote}
+% |\eval_expr|\marg{integer expression}
+% \end{quote}
+% globally assigns |\result| to the value of
+% \meta{integer expression}, and changes the value of no other
+% counters.
+%
+% The macro
+% \begin{quote}
+% |\eval_expr_to|\marg{\TeX\ integer variable}^^A
+% \marg{integer expression}
+% \end{quote}
+% locally assigns the value of \meta{integer expression} to
+% \meta{\TeX\ integer variable} (which is an integer variable as
+% defined in~\cite{TeXbook}).
+% |\g_eval_expr_to| does the same globally.
+%
+% \begin{macrocode}
+%<*pkg>
+\newcount\result
+\def\eval_expr#1{\global\result=#1\x_relax}
+\def\eval_expr_to#1#2{\eval_expr{#2}#1=\result}
+\def\g_eval_expr_to#1#2{\eval_expr{#2}\global#1=\result}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TypesetIntegerExpression}
+% In \package{fontdoc} the main task is instead to typeset the
+% expression as a mathematical formula, but in some cases one wants to
+% know its value as well (if possible). Therefore things get a bit
+% more complex in that context. The top-level command there is
+% \begin{quote}
+% |\TypesetIntegerExpression|\marg{integer expression}
+% \end{quote}
+% which typesets the \meta{integer expression} by first forming (in the
+% |\FD@expression| macro) code for typesetting the integer expression.
+% |\Typeset|\-|Integer|\-|Expression| should be only be used in math
+% mode.
+%
+% Most of the work in |\TypesetIntegerExpression| is carried out by
+% the |\FD@eval@expr| macro and hence |\TypesetIntegerExpression| sets
+% a couple of other variables as explained below. Apart from the fact
+% that |\FD@eval@expr| doesn't actually typeset anything, the main
+% difference between it and |\Typeset|\-|Integer|\-|Expression| is that
+% the latter also accepts code that after expansion will become integer
+% expressions, whereas the former requires that all such macros have
+% first been expanded.
+% \begin{macrocode}
+%<*doc>
+\newcommand\TypesetIntegerExpression[1]{%
+ \protected@edef\@tempa{#1}%
+ \expandafter\FD@eval@expr \expandafter{\@tempa}%
+ \FD@expression
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@expression}
+% \begin{macro}{\FD@result}
+% \begin{macro}{\FD@priority}
+% \begin{macro}{\FD@bracket@level}
+% \begin{switch}{FD@evaluate@}
+% The |\FD@expression| macro, |\FD@result| and |\FD@bracket@level|
+% count registers, the |\FD@priority| chardef token, and the
+% |FD@evaluate@| switch are used by \package{fontdoc} when formatting
+% and evaluating an integer expression. They are all assigned globally.
+%
+% The |\FD@expression| macro contains code for typesetting an
+% expression. |\FD@priority| is a chardef token whose numerical value
+% specifies the priority of the outermost operation in
+% |\FD@expression| according to the following table:
+% \begin{enumerate}
+% \item[0]
+% Outermost operation is $+$ or $-$.
+% \item[1]
+% Outermost operation is explicit multiplication ($\cdot$) or
+% division $/$. If it is one of the factors in a product then
+% that multiplication must be explicit.
+% \item[2]
+% Outermost operation is explicit multiplication. If it is to be
+% the right factor in a product, then the multiplication must be
+% made explicit too.
+% \item[3]
+% Outermost operation is explicit multiplication. It
+% does not need to be explicitly multiplied.
+% \item[4]
+% Outermost operation is implicit multiplication (juxtaposition),
+% unary prefix (unary $-$) or something which is bracketed anyway.
+% If it is to be the right factor in a product, then that
+% multiplication should be made explicit too. A typical example
+% of this kind of thing is an explicit negative number.
+% \item[5]
+% Outermost operation is implicit multiplication (juxtaposition)
+% or something which is bracketed anyway. It does not need to be
+% explicitly multiplied.
+% \item[6]
+% The expression is an explicit non-negative number. If it is to
+% be the right factor in a product, then the multiplication
+% should be made explicit.
+% \end{enumerate}
+% |\FD@bracket@level| keeps track of what parenthesis size one must
+% use to cover the expression in |\FD@expression|: 0 is the normal
+% size, 1 is |\big| size, 2 is |\Big| size, etc. The |FD@evaluate@|
+% switch specifies whether |\FD@eval@expr| should try to (upon entry)
+% or managed to (after it is completed) evaluate the integer
+% expression (true is evaluate, false is don't bother). When the value
+% has been evaluated, it is returned in |\FD@result|.
+% \begin{macrocode}
+\newcount\FD@result
+\newcount\FD@bracket@level
+\def\FD@evaluate@true{\global\let\ifFD@evaluate@\iftrue}
+\def\FD@evaluate@false{\global\let\ifFD@evaluate@\iffalse}
+\FD@evaluate@false
+% \end{macrocode}
+% \end{switch}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\FD@eval@expr}
+% The |\FD@eval@expr| macro has the syntax
+% \begin{quote}
+% |\FD@eval@expr|\marg{integer expression}
+% \end{quote}
+% It puts code for typesetting the \meta{integer expression} in the
+% |\FD@expression| macro, sets |\FD@bracket@level| to the
+% corresponding value, and if |FD@evaluate@| is true it also tries to
+% evaluate the expression and put the result in |\FD@result|.
+%
+% More precisely, |\FD@eval@expr| only handles the \meta{\TeX~number}
+% cases of integer expression. In the other cases the first token in
+% the integer expression is a robust command which should take care of
+% building the expression as needed.
+% \begin{macrocode}
+\def\FD@eval@expr#1{%
+ \expandafter\expandafter \expandafter\ifx
+ \expandafter\@car#1\x@relax\@nil \protect
+ #1%
+ \else\ifcat \expandafter\noexpand \@car#1\x@relax\@nil 0%
+ \global\FD@result=#1\x@relax
+ \xdef\FD@expression{\the\FD@result}%
+ \global\chardef\FD@priority=\ifnum \FD@result<\z@ 4\else 6\fi
+ \global\FD@bracket@level=\z@
+ \else
+ \begingroup
+ \MakePrintable\@tempa{FD@swa}{#1}%
+ \global\FD@bracket@level=\ifFD@swa\z@\else\@ne\fi
+ \protected@xdef\FD@expression{\protect\mbox{\texttt{\@tempa}}}%
+ \endgroup
+ \global\chardef\FD@priority=5%
+ \FD@evaluate@false
+ \fi\fi
+}
+%</doc>
+% \end{macrocode}
+% Note: It is important that all groups that are started or ended
+% during the evaluation of an integer expression are of |\begingroup|
+% type, since |\bgroup| groups affect spacing in math mode.
+% \end{macro}
+%
+% \begin{macro}{\add}
+% The |\add| command has the syntax
+% \begin{quote}
+% |\add|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the sum of the two \meta{integer expression}s.
+% \begin{macrocode}
+%<*pkg>
+\def\add#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \global\advance \result \a_count
+ \egroup
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\add[2]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \let\@tempa=\FD@expression
+ \ifFD@evaluate@ \a@count=\FD@result \fi
+ \b@count=\FD@bracket@level
+ \FD@eval@expr{#2}%
+ \protected@xdef\FD@expression{\@tempa+\FD@expression}%
+ \ifFD@evaluate@ \global\advance \FD@result \a@count \fi
+ \ifnum \FD@bracket@level<\b@count
+ \global\FD@bracket@level=\b@count
+ \fi
+ \global\chardef\FD@priority=\z@
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sub}
+% The |\sub| command has the syntax
+% \begin{quote}
+% |\sub|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the difference between the two \meta{integer
+% expression}s.
+% \begin{macrocode}
+%<*pkg>
+\def\sub#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \advance \a_count -\result
+ \global\result=\a_count
+ \egroup
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\sub[2]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \let\@tempa=\FD@expression
+ \ifFD@evaluate@ \a@count=\FD@result \fi
+ \b@count=\FD@bracket@level
+ \FD@eval@expr{#2}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \protected@xdef\FD@expression{\@tempa-\FD@expression}%
+ \ifFD@evaluate@
+ \advance \a@count -\FD@result
+ \global\FD@result=\a@count
+ \fi
+ \ifnum \FD@bracket@level<\b@count
+ \global\FD@bracket@level=\b@count
+ \fi
+ \global\chardef\FD@priority=\z@
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@subexpression}
+% \begin{macro}{\FD@commapenalty}
+% The |\FD@subexpression| macro has the syntax
+% \begin{quote}
+% |\FD@subexpression|\marg{math mode material}
+% \end{quote}
+% It should only be used in math mode and produces results very
+% similar to \meta{math mode material}, but it locally increases all
+% the math-related penalties by |\FD@commapenalty| for when the math
+% mode material is converted to a horizontal list. This allows
+% linebreaking to take notice of logical nesting in expressions.
+%
+% |\FD@commapenalty| is used as a companion of |\relpenalty| and
+% |\binoppenalty|, but which is used after commas (where \TeX\ doesn't
+% insert penalties automatically).
+% \begin{macrocode}
+\def\FD@subexpression#1{${%
+ \advance \binoppenalty \FD@commapenalty
+ \advance \relpenalty \FD@commapenalty
+ \advance \FD@commapenalty \FD@commapenalty
+ $#1$}$%
+}
+\newcount\FD@commapenalty
+\FD@commapenalty=\binoppenalty
+\advance \FD@commapenalty \relpenalty
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\FD@bracket@expression}
+% The |\FD@bracket@expression| brackets the expression currently in
+% |\FD@expression| by the suitable size of parentheses and updates
+% |\FD@bracket@level| and |\FD@priority| accordingly.
+% \begin{macrocode}
+\def\FD@bracket@expression{%
+ \protected@xdef\FD@expression{%
+ \ifcase\FD@bracket@level \or \protect\bigl \or \protect\Bigl \or
+ \protect\biggl \else \protect\Biggl \fi (%
+ \protect\FD@subexpression{\FD@expression}%
+ \ifcase\FD@bracket@level \or \protect\bigr \or \protect\Bigr \or
+ \protect\biggr \else \protect\Biggr \fi )%
+ }%
+ \global\chardef\FD@priority=5%
+ \global\advance \FD@bracket@level \@ne
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\int}
+% \changes{1.909}{1999/10/19}{\package{fontdoc} implementation
+% changed to using \cs{typeset@integer}. (LH)}
+% \begin{macro}{\FD@simple@int}
+% The |\int| command has the syntax
+% \begin{quote}
+% |\int|\marg{string expression}
+% \end{quote}
+% It is used to represent the value of the \package{fontinst} integer
+% whose name is the value of the \meta{string expression} in integer
+% expressions.
+%
+% The |\FD@simple@int| macro take the printable string form of the
+% name of an integer variable as its argument and typesets the
+% printed representation of this integer, but it should only be used
+% when the argument is a simple string expression. When the argument
+% is not a simple string expression, |\FD@integer@func| should be
+% used instead. |\FD@simple@int| should only be called in horizontal
+% mode.
+% \begin{macrocode}
+%<pkg>\def\int#1{\csname i-#1 \endcsname}
+%<*doc>
+\DeclareRobustCommand\int[1]{%
+ \begingroup
+ \MakePrintable\@tempa{FD@swa}{#1}%
+ \protected@xdef\FD@expression{%
+ \ifFD@swa
+ \text{\protect\FD@simple@int{\@tempa}}%
+ \else
+ \protect\FD@integer@func{int}{\@tempa}%
+ \fi
+ }%
+ \global\chardef\FD@priority=5%
+ \global\FD@bracket@level=\ifFD@swa\z@\else\@ne\fi
+ \FD@evaluate@false
+ \endgroup
+}
+\def\FD@simple@int#1{{\normalfont\itshape #1\/}}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\FD@integer@func}
+% The |\FD@integer@func| macro has the syntax
+% \begin{quote}
+% |\FD@integer@func|\marg{name}\marg{argument}
+% \end{quote}
+% It is used for typesetting the \meta{name}$($\meta{argument}$)$
+% of an integer-valued function which takes a string expression as
+% argument (e.g.\ the width-of-glyph function $\mathrm{w}$). It
+% should only be used in math mode.
+%
+% The empty group in the argument of |\mathop| is there to ensure
+% that the nucleus of the mathop atom isn't simply a symbol, since
+% \TeX\ in that case centers it vertically.
+% \begin{macrocode}
+\def\FD@integer@func#1#2{%
+ \mathop{\mathrm{#1}{}}(\text{\FD@typeset@string{#2}})%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\neg}
+% The |\neg| command has the syntax
+% \begin{quote}
+% |\neg|\marg{integer expression}
+% \end{quote}
+% It represents the negative of the \meta{integer expression}.
+% \begin{macrocode}
+%<pkg>\def\neg#1{#1 \global\result=-\result}
+%<*doc>
+\DeclareRobustCommand\neg[1]{%
+ \FD@eval@expr{#1}%
+ \ifnum 5>\FD@priority \FD@bracket@expression \fi
+ \protected@xdef\FD@expression{-\FD@expression}%
+ \global\chardef\FD@priority=4%
+ \ifFD@evaluate@ \global\FD@result=-\FD@result \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mul}
+% The |\mul| command has the syntax
+% \begin{quote}
+% |\mul|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the product of the two \meta{integer expression}s.
+% \begin{macrocode}
+%<*pkg>
+\def\mul#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \global\multiply \result \a_count
+ \egroup
+}
+%</pkg>
+% \end{macrocode}
+%
+% The main problem in the \package{fontdoc} definition of |\mul| is
+% to determine whether the multiplication should be made explicit or
+% not, and what priority code the resulting expression should be
+% given. It turns out that if the right factor has priority 1 (it is
+% a quotient or a product that ends with a quotient) then the
+% combined expression will be too, whereas if it isn't but the left
+% factor has priority 1 then the combined expression will get
+% priority 2. The remaining cases will be explicit or implicit
+% depending on the parity of the priority of the right expression, and
+% priority will be odd or even depending on the parity of the priority
+% of the left expression.
+% \begin{macrocode}
+%<*doc>
+\DeclareRobustCommand\mul[2]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \let\@tempa=\FD@expression
+ \ifFD@evaluate@ \a@count=\FD@result \fi
+ \b@count=\FD@bracket@level
+ \let\FD@left@priority=\FD@priority
+ \FD@eval@expr{#2}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \protected@xdef\FD@expression{%
+ \@tempa
+ \if \ifnum \FD@left@priority=\@ne e%
+ \else\ifnum \FD@priority<\thr@@ e%
+ \else\ifodd \FD@priority i\else e\fi\fi\fi e%
+ \cdot
+ \fi
+ \FD@expression
+ }%
+ \ifFD@evaluate@ \global\multiply \FD@result \a@count \fi
+ \ifnum \FD@bracket@level<\b@count
+ \global\FD@bracket@level=\b@count
+ \fi
+ \a@count=%
+ \ifnum \FD@priority=\@ne 1%
+ \else\ifnum \FD@left@priority=\@ne 2%
+ \else\ifodd\FD@left@priority
+ \ifodd\FD@priority 5\else 3\fi
+ \else
+ \ifodd\FD@priority 4\else 2\fi
+ \fi\fi\fi
+ \global\chardef\FD@priority=\a@count
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\div}
+% The |\div| command has the syntax
+% \begin{quote}
+% |\div|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the quotient of the two \meta{integer expression}s, as
+% computed by \TeX's |\divide| command: non-integer quotients are
+% rounded towards zero.
+% \begin{macrocode}
+%<*pkg>
+\def\div#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \divide \a_count \result
+ \global\result=\a_count
+ \egroup
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\div[2]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \let\@tempa=\FD@expression
+ \ifFD@evaluate@ \a@count=\FD@result \fi
+ \b@count=\FD@bracket@level
+ \FD@eval@expr{#2}%
+ \ifnum 4>\FD@priority \FD@bracket@expression \fi
+ \ifnum \FD@bracket@level<\b@count
+ \global\FD@bracket@level=\b@count
+ \fi
+ \protected@xdef\FD@expression{%
+ \@tempa
+ \ifcase\FD@bracket@level \or \protect\big \or \protect\Big \or
+ \protect\bigg \else \protect\Bigg \fi /%
+ \FD@expression
+ }%
+ \ifFD@evaluate@
+ \divide \a@count \FD@result
+ \global\FD@result=\a@count
+ \fi
+ \global\chardef\FD@priority=\@ne
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@eval@spec@expr}
+% The |\FD@eval@spec@expr| macro has the syntax
+% \begin{isyntax}
+% |\FD@eval@spec@expr|\marg{integer expression}^^A
+% \discretionary{}{}{}\marg{spec-command}^^A
+% \discretionary{}{}{}\marg{rep-command}
+% \end{isyntax}
+% It does pretty much the same thing as |\FD@eval@expr|, but if the
+% first token in the \meta{integer expression} is the
+% \meta{spec-command} then it will do
+% \begin{quote}
+% \meta{rep-command}\meta{integer expression}
+% \end{quote}
+% instead of the normal activities. This is useful for operations that
+% are normally denoted as $n$-ary operations rather that binary ones,
+% i.e., for |\max| and |\min|.
+% \begin{macrocode}
+\def\FD@eval@spec@expr#1#2#3{%
+ \expandafter\ifx \@car#1\x@relax\@nil #2%
+ #3#1%
+ \else
+ \FD@eval@expr{#1}%
+ \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\max}
+% The |\max| command has the syntax
+% \begin{quote}
+% |\max|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the maximum of the two \meta{integer expression}s.
+% \begin{macrocode}
+%<*pkg>
+\def\max#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \ifnum \a_count>\result \global\result=\a_count \fi
+ \egroup
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\max[2]{%
+ \begingroup
+ \toks@={}%
+ \a@count=-\maxdimen
+ \b@count=\z@
+ \FD@eval@spec@expr{\max{#1}{#2}}{\max}{\FD@maxmin@comma}%
+ \ifnum \a@count>\FD@bracket@level
+ \global\FD@bracket@level=\a@count
+ \fi
+ \protected@xdef\FD@expression{%
+ \protect\plainmax
+ \ifcase\FD@bracket@level \protect\@firstofone \or \protect\bigl
+ \or \protect\Bigl \or \protect\biggl \else \protect\Biggl
+ \fi{\{}%
+ \the\toks@
+ \protect\FD@subexpression{\FD@expression}%
+ \ifcase\FD@bracket@level \protect\@firstofone \or \protect\bigl
+ \or \protect\Bigl \or \protect\biggl \else \protect\Biggl
+ \fi{\}}%
+ }%
+ \ifFD@evaluate@
+ \ifnum \a@count>\FD@result \global\FD@result=\a@count \fi
+ \fi
+ \global\chardef\FD@priority=5%
+ \global\advance \FD@bracket@level \@ne
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\min}
+% The |\min| command has the syntax
+% \begin{quote}
+% |\min|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the minimum of the two \meta{integer expression}s.
+% \begin{macrocode}
+%<*pkg>
+\def\min#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \ifnum \a_count<\result \global\result=\a_count \fi
+ \egroup
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\min[2]{%
+ \begingroup
+ \toks@={}%
+ \a@count=\maxdimen
+ \b@count=\z@
+ \FD@eval@spec@expr{\min{#1}{#2}}{\min}{\FD@maxmin@comma}%
+ \ifnum \a@count>\FD@bracket@level
+ \global\FD@bracket@level=\a@count
+ \fi
+ \protected@xdef\FD@expression{%
+ \protect\plainmin
+ \ifcase\FD@bracket@level \protect\@firstofone \or \protect\bigl
+ \or \protect\Bigl \or \protect\biggl \else \protect\Biggl
+ \fi{\{}%
+ \the\toks@
+ \protect\FD@subexpression{\FD@expression}%
+ \ifcase\FD@bracket@level \protect\@firstofone \or \protect\bigl
+ \or \protect\Bigl \or \protect\biggl \else \protect\Biggl
+ \fi{\}}%
+ }%
+ \ifFD@evaluate@
+ \ifnum \a@count<\FD@result \global\FD@result=\a@count \fi
+ \fi
+ \global\chardef\FD@priority=5%
+ \global\advance \FD@bracket@level \@ne
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@maxmin@comma}
+% The |\FD@maxmin@comma| macro does most of the work for |\max| and
+% |\min| in \package{fontdoc}. In some sense it inserts the commas
+% between the operands, but it also takes care of evaluating the
+% maximum\slash minimum and determining the proper bracketing level.
+%
+% The sequence of arguments (separated by commas) is compiled in
+% |\toks@|. The greatest\slash least value of an argument found so
+% far is kept in |\a@count|, and the greatest bracketing level found
+% is kept in |\b@count|.
+% \begin{macrocode}
+\def\FD@maxmin@comma#1#2#3{%
+ \FD@eval@spec@expr{#2}{#1}{\FD@maxmin@comma}%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\protect \expandafter\FD@subexpression
+ \expandafter{\FD@expression}%
+ ,\penalty\FD@commapenalty\,%
+ }
+ \ifFD@evaluate@
+ \ifnum \a@count \ifx\max#1<\else>\fi \FD@result
+ \a@count=\FD@result
+ \fi
+ \fi
+ \ifnum \b@count<\FD@bracket@level \b@count=\FD@bracket@level \fi
+ \FD@eval@spec@expr{#3}{#1}{\FD@maxmin@comma}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\half}
+% \begin{macro}{\otherhalf}
+% \multchanges{\cs{half}\cs{otherhalf}}{1.916}{2000/12/31}{Macros
+% added. (LH)}
+% The |\half| and |\otherhalf| macros have the syntaxes
+% \begin{quote}
+% |\half|\marg{integer expression}\\
+% |\otherhalf|\marg{integer expression}
+% \end{quote}
+% They both represent one half of the \meta{integer expression}, but
+% they don't round it the same way. |\half| does rounding as
+% specified in~\cite[p.~237]{TAOCP2} (towards even integers) whereas
+% |\otherhalf| does it the other way (towards odd integers). This
+% means that
+% \begin{quote}
+% |\add{\half{|\meta{IE}|}}{\otherhalf{|\meta{IE}|}}|
+% \end{quote}
+% will always sum up to precisely the same as the \meta{IE} integer
+% expression.
+% \begin{macrocode}
+%<*pkg>
+\def\half#1{
+ #1\x_relax
+ \ifodd\result
+ \global\advance \result \@ne
+ \global\divide \result \tw@
+ \ifodd\result \global\advance \result \m@ne \fi
+ \else
+ \global\divide \result \tw@
+ \fi
+}
+\def\otherhalf#1{
+ #1\x_relax
+ \ifodd\result
+ \global\advance \result \@ne
+ \global\divide \result \tw@
+ \ifodd\result \else \global\advance \result \m@ne \fi
+ \else
+ \global\divide \result \tw@
+ \fi
+}
+%</pkg>
+%<*doc>
+\DeclareRobustCommand\half[1]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \a@count=%
+ \ifnum \FD@priority=\@ne 1%
+ \else\ifodd\FD@priority 5%
+ \else 3\fi\fi
+ \global\chardef\FD@priority=\a@count
+ \protected@xdef\FD@expression{%
+ \protect\frac{1}{2}%
+ \ifnum \FD@priority>\thr@@ \else \cdot \fi
+ \FD@expression
+ }%
+ \ifFD@evaluate@
+ \ifodd \FD@result
+ \global\advance \FD@result \@ne
+ \global\divide \FD@result \tw@
+ \ifodd\FD@result \global\advance \FD@result \m@ne \fi
+ \else
+ \global\divide \FD@result \tw@
+ \fi
+ \fi
+ \endgroup
+}
+\DeclareRobustCommand\otherhalf[1]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \a@count=%
+ \ifnum \FD@priority=\@ne 1%
+ \else\ifodd\FD@priority 5%
+ \else 3\fi\fi
+ \global\chardef\FD@priority=\a@count
+ \protected@xdef\FD@expression{%
+ \protect\frac{1}{2}%
+ \ifnum \FD@priority>\thr@@ \else \cdot \fi
+ \FD@expression
+ }%
+ \ifFD@evaluate@
+ \ifodd \FD@result
+ \global\advance \FD@result \@ne
+ \global\divide \FD@result \tw@
+ \ifodd\FD@result\else \global\advance \FD@result \m@ne \fi
+ \else
+ \global\divide \FD@result \tw@
+ \fi
+ \fi
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\scale}
+% The |\scale| command has the syntax
+% \begin{quote}
+% |\scale|\marg{integer expression}\marg{integer expression}
+% \end{quote}
+% It represents the result of multiplying the first \meta{integer
+% expression} by as many thousands as is specified by the second
+% \meta{integer expression}. In practice, |\scale|\marg{ie1}\marg{ie2}
+% is very similar to
+% \begin{quote}
+% |\div{\mul|\marg{ie1}\marg{ie2}|}{1000}|
+% \end{quote}
+% but |\scale| also tries to do proper rounding (note however that
+% |\scale|ing by 500 is not rounded properly; use |\half| instead).
+% \begin{macrocode}
+%<*pkg>
+\def\scale#1#2{
+ #1
+ \bgroup
+ \a_count=\result
+ \eval_expr{#2}
+ \global\multiply \result \a_count
+ \rounded_thousandths
+ \egroup
+}
+%</pkg>
+% \end{macrocode}
+%
+% The second (scaling factor) argument of |\scale| is usually very
+% simple, and in that case the |\scale| will be formatted as a
+% fraction (containing the second argument) multiplied by the first
+% argument.
+% \begin{macrocode}
+%<*doc>
+\DeclareRobustCommand\scale[2]{%
+ \begingroup
+ \FD@eval@expr{#1}%
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \let\@tempa=\FD@expression
+ \ifFD@evaluate@ \a@count=\FD@result \fi
+ \b@count=\FD@bracket@level
+ \let\FD@left@priority=\FD@priority
+ \FD@eval@expr{#2}%
+ \if \ifnum \FD@bracket@level<\@ne \ifnum \FD@priority>\thr@@
+ 1\else 0\fi\else 0\fi 1%
+ \protected@xdef\FD@expression{%
+ \protect\frac{\FD@expression}{1000}%
+ \if \ifnum \FD@left@priority<\thr@@ e\else
+ \ifodd \FD@left@priority i\else e\fi\fi e%
+ \cdot
+ \fi
+ \@tempa
+ }
+ \global\chardef\FD@priority=%
+ \ifnum \FD@left@priority=\@ne 1\else
+ \ifodd\FD@left@priority 5\else 3\fi\fi
+ \global\FD@bracket@level=\b@count
+ \else
+ \ifnum \FD@priority<\@ne \FD@bracket@expression \fi
+ \protected@xdef\FD@expression{%
+ \@tempa
+ \if \ifnum \FD@left@priority=\@ne e%
+ \else\ifnum \FD@priority<\thr@@ e%
+ \else\ifodd \FD@priority i\else e\fi\fi\fi e%
+ \cdot
+ \fi
+ \FD@expression
+ \ifcase\FD@bracket@level \or \protect\big \or \protect\Big
+ \or \protect\bigg \else \protect\Bigg \fi /1000%
+ }%
+ \ifnum \FD@bracket@level<\b@count
+ \global\FD@bracket@level=\b@count
+ \fi
+ \global\chardef\FD@priority=\@ne
+ \fi
+ \ifFD@evaluate@
+ \global\multiply \FD@result \a@count
+ \global\divide \FD@result 500
+ \ifodd \FD@result
+ \global\advance \FD@result \ifnum 0>\FD@result - \fi \@ne
+ \fi
+ \global\divide \FD@result \tw@
+ \fi
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rounded_thousandths}
+% \changes{1.901}{1999/03/06}{Macro added. \cs{scale} changed to
+% use it. (LH)}
+% \begin{macro}{\l_rounded_thousandths}
+% The |\rounded_thousandths| macro divides |\result|
+% by 1000 and rounds the result to the nearest integer. This is
+% different from
+% \begin{quote}
+% |\global\divide \result \one_thousand|
+% \end{quote}
+% since the latter always rounds positive numbers downwards and
+% negative numbers upwards.
+%
+% |\l_rounded_thousandths| does the same thing, but to the register
+% passed as parameter \#1 and is assigned locally.
+% \changes{1.913}{2000/03/04}{Macro added. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\rounded_thousandths{
+ \global\divide \result \five_hundred
+ \ifodd \result
+ \global\advance \result by \ifnum 0>\result - \fi 1
+ \fi
+ \global\divide \result \tw@
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\l_rounded_thousandths#1{
+ \divide #1 \five_hundred
+ \ifodd #1
+ \advance #1 by \ifnum 0>#1 - \fi\@ne
+ \fi
+ \divide #1 \tw@
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\l_inv_scale}
+% \changes{1.913}{2000/03/11}{Macro added. (LH)}
+% The |\l_inv_scale| takes two arguments: as \#1 a count register,
+% and as \#2 a \TeX\ number. |\l_inv_scale| scales \#1 by the inverse
+% of \#2, if the value in \#1 is $n$ and the value in \#2 is $m$ then
+% |\l_inv_scale| computes
+% $$
+% \left[ \frac{1000n}{m} \right] \mbox{,}
+% $$
+% where the brackets denote rounding to the nearest integer, and
+% assigns this number to \#1 locally.
+% \begin{macrocode}
+\def\l_inv_scale#1#2{
+ \multiply #1 \two_thousand
+ \divide #1 #2\x_relax
+ \ifodd#1 \advance #1 \ifnum 0>#1 - \fi\@ne \fi
+ \divide #1 \tw@
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \multchanges{\cs{priority}}{1.909}{1999/10/20}{Changed condition for
+% \cs{ifnum}, so that expressions with equal priority will not get
+% bracketed when nested. (LH)}
+% \multchanges{\cs{expression}\cs{priority}\cs{identity}^^A
+% \cs{bracket}}{1.916}{2001/01/01}{Macros removed. (LH)}
+%
+% \begin{macro}{\ifnumber}
+% \changes{1.900}{1999/02/15}{Command added. (LH)}
+% The call
+% \begin{quote}
+% |\ifnumber|\marg{integer expression}\meta{rel}^^A
+% \marg{integer expression}|\then|
+% \end{quote}
+% can be used to compare the two integer expressions. \meta{rel} may
+% be |<|, |=|, or |>|.
+% \begin{macrocode}
+\def\ifnumber#1#2#3\then{
+ \eval_expr_to\a_count{#1}
+ \eval_expr{#3}
+ \ifnum \a_count#2\result
+ \expandafter\if_true
+ \else
+ \expandafter\if_false
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+%
+% Like the other conditionals, |\ifnumber| is treated as being true by
+% \package{fontdoc}.
+% \begin{macrocode}
+%<*doc>
+\def\ifnumber#1#2#3\then{%
+ \FD@evaluate@false
+ \generic@if{%
+ $\TypesetIntegerExpression{#1}#2\TypesetIntegerExpression{#3}$%
+ }%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+
+
+% \subsection{Setting variables}
+% \label{Ssec:Variables}
+%
+% \meta{int}, \meta{str}, and \meta{dim} below are string expressions.
+% \meta{command} can be any control sequence.
+%
+% \DescribeMacro{\setint}
+% \DescribeMacro{\setstr}
+% \DescribeMacro{\setdim}
+% \DescribeMacro{\setcommand}
+% The macros:
+% \begin{quote}
+% |\setint|\marg{int}\marg{integer expression}\\
+% |\setstr|\marg{str}\marg{string}\\
+% |\setdim|\marg{dim}\marg{dimension}\\
+% |\setcommand|\meta{command}\meta{definition}
+% \end{quote}
+% define new macros
+% \describecsfamily{i-\meta{int}}|\i-|\meta{int},
+% \describecsfamily{s-\meta{str}}|\s-|\meta{str},
+% \describecsfamily{d-\meta{dim}}|\d-|\meta{dim}, or
+% \meta{command}.
+%
+% \DescribeMacro{\resetint}
+% \DescribeMacro{\resetstr}
+% \DescribeMacro{\resetdim}
+% \DescribeMacro{\resetcommand}
+% The macros:
+% \begin{quote}
+% |\resetint|\marg{int}\marg{integer expression}\\
+% |\resetstr|\marg{str}\marg{string}\\
+% |\resetdim|\marg{dim}\marg{dimension}\\
+% |\resetcommand|\meta{command}\meta{definition}
+% \end{quote}
+% redefine the macros |\i-|\meta{int}, |\s-|\meta{str}, |\d-|\meta{dim} or
+% \meta{command}.
+%
+% \DescribeMacro{\int}
+% \DescribeMacro{\str}
+% \DescribeMacro{\dim}
+% The macros:
+% \begin{quote}
+% |\int|\marg{int}\\
+% |\str|\marg{str}\\
+% |\dim|\marg{dim}\\
+% \meta{command}
+% \end{quote}
+% return the values of |\i-|\meta{int}, |\s-|\meta{str}, |\d-|\meta{dim},
+% or \meta{command}.
+%
+% \DescribeMacro{\strint}
+% The macro
+% \begin{quote}
+% |\strint|\marg{int}
+% \end{quote}
+% returns the value of |\i-|\meta{int} as a string.
+%
+% \DescribeMacro{\ifisint}
+% \DescribeMacro{\ifisstr}
+% \DescribeMacro{\ifisdim}
+% \DescribeMacro{\ifiscommand}
+% The macros:
+% \begin{quote}
+% |\ifisint|\marg{int}|\then|\\
+% |\ifisstr|\marg{str}|\then|\\
+% |\ifisdim|\marg{dim}|\then|\\
+% |\ifiscommand|\meta{command}|\then|
+% \end{quote}
+% return |\if_true| if |\i-|\meta{int}, |\s-|\meta{str},
+% |\d-|\meta{dim}, or \meta{command} respectively have been defined,
+% and |\if_false| otherwise.
+%
+% \DescribeMacro{\unsetint}
+% \DescribeMacro{\unsetstr}
+% \DescribeMacro{\unsetdim}
+% \DescribeMacro{\unsetcommand}
+% The macros:
+% \begin{quote}
+% |\unsetint|\marg{int}\\
+% |\unsetstr|\marg{str}\\
+% |\unsetdim|\marg{dim}\\
+% |\unsetcommand|\meta{command}
+% \end{quote}
+% undefine |\i-|\meta{int}, |\s-|\meta{str}, |\d-|\meta{dim}, or
+% \meta{command}.
+%
+% \DescribeMacro{\x_setint}
+% \DescribeMacro{\x_resetint}
+% \DescribeMacro{\x_setstr}
+% The macros |\x_setint|, |\x_resetint|, and |\x_setstr| are ``private''
+% versions of |\setint|, |\resetint|, and |\setstr| respectively. They
+% have been included to reduce the problems in case a user turns off one
+% of these commands and forgets to turn it on again.
+%
+% \changes{1.900}{1999/02/07}{Replaced internal \cs{setint},
+% \cs{resetint}, and \cs{setstr} by \cs{x_setint}, \cs{x_resetint},
+% and \cs{x_setstr} respectively, to make the public versions
+% possible to turn off. (LH)}
+%
+% Integers are kept as |\mathchardef|s if possible; a comparision of
+% doing this versus not doing this appears in
+% Subsection~\ref{Ssec: ASAJ tests}.
+%
+% \begin{macro}{\setsomething_global}
+% The |\setsomething_global| control sequence should be either
+% |\relax| or |\global|. It appears before the central assignments in
+% all the |\set|\textellipsis, |\reset|\textellipsis, and
+% |\unset|\textellipsis\ commands. The normal value is |\relax|, so
+% that these assignments are local.
+%
+% When there is counter-intuitive grouping, and it could seem that
+% \TeX\ should not be inside a group at all---i.e., between
+% |\installfonts| and |\endinstallfonts|---one can make the basic
+% assignment commands act more logical by setting
+% |\setsomething_global| to |\global|.
+%
+% \changes{1.912}{2000/01/15}{Control sequence introduced and added
+% to all \cs{set}\dots, \cs{reset}\dots, and \cs{unset}\dots\
+% commands, as well as \cs{offcommand} and \cs{oncommand}. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\let\setsomething_global=\x_relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\x_setint}
+% \begin{macro}{\setint}
+% \begin{macro}{\x_setstr}
+% \begin{macro}{\setstr}
+% \begin{macro}{\setdim}
+% \begin{macro}{\setcommand}
+% \changes{1.909}{1999/10/17}{Since \package{fontdoc} adds some
+% grouping, \cs{setcommand} must set its argument globally there.
+% (LH)}
+% \changes{1.912}{2000/01/15}{Settings of a command already defined
+% is diverted to \cs{a_macro}; it used to be \cs{a_command}. Saves
+% one hash table position. (LH)}
+%
+% \begin{macrocode}
+\def\x_setint#1#2{
+ \x_cs\ifx{i-#1}\x_relax
+ \x_resetint{#1}{#2}
+ \fi
+}
+\let\setint=\x_setint
+\def\x_setstr#1#2{
+ \x_cs\ifx{s-#1}\x_relax
+ \setsomething_global\x_cs\edef{s-#1}{#2}
+ \fi
+}
+\let\setstr=\x_setstr
+\def\setdim#1#2{
+ \x_cs\ifx{d-#1}\x_relax
+ \a_dimen=#2\x_relax
+ \setsomething_global\x_cs\edef{d-#1}{\the\a_dimen}
+ \fi
+}
+\def\setcommand#1{
+ \ifx#1\undefined_command
+ \setsomething_global \expandafter\def \expandafter#1
+ \else
+ \expandafter\def \expandafter\a_macro
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+%
+% In \package{fontdoc}, |\setint|, |\setstr|, and |\setdim| print
+% headings. There is no need for the private forms |\x_setint| and
+% |\x_setstr|. |\setcommand|, finally, does the same thing as in
+% \package{fontinst}; the assignment is global because of grouping
+% not present in \package{fontinst}.
+% \begin{macrocode}
+%<*doc>
+\newcommand\setint[2]{%
+ \Bheading{Default} \(\TypesetIntegerExpression{\int{#1}}\) =
+ \(\TypesetIntegerExpression{#2}\)%
+}
+\newcommand\setstr[2]{%
+ \Bheading{Default} \TypesetStringExpression{\str{#1}} =
+ \TypesetStringExpression{#2}%
+}
+\newcommand\setdim[2]{%
+ \a@dimen=#2\relax
+ \Bheading{Default} \TypesetStringExpression{#1} dimen = \the\a@dimen
+}
+\def\setcommand#1{\ifx#1\undefined@command
+ \expandafter\gdef\expandafter#1\else
+ \expandafter\gdef\expandafter\a@command\fi}
+%</doc>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\x_resetint}
+% \begin{macro}{\resetint}
+% \begin{macro}{\resetstr}
+% \begin{macro}{\resetdim}
+% \begin{macro}{\resetcommand}
+% \changes{1.909}{1999/10/17}{Since \package{fontdoc} adds some
+% grouping, \cs{resetcommand} must set its argument globally there.
+% (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\x_resetint#1#2{
+ \eval_expr{#2}
+ \setsomething_global
+ \ifnum\result<\max_mathchardef
+ \ifnum 0>\result
+ \x_cs\edef{i-#1}{\the\result}
+ \else
+ \x_cs\mathchardef{i-#1}=\result
+ \fi
+ \else
+ \x_cs\edef{i-#1}{\the\result}
+ \fi
+}
+\let\resetint=\x_resetint
+\def\resetstr#1#2{\setsomething_global\x_cs\edef{s-#1}{#2}}
+\def\resetdim#1#2{
+ \a_dimen=#2
+ \setsomething_global\x_cs\edef{d-#1}{\the\a_dimen}
+}
+\def\resetcommand#1{\setsomething_global\def#1}
+%</pkg>
+% \end{macrocode}
+%
+% In \package{fontdoc}, |\resetint|, |\resetstr|, and |\resetdim|
+% print headings. There is no need for the private form |\x_resetint|.
+% |\resetcommand|, finally, does the same thing as in
+% \package{fontinst}.
+%
+% \begin{macrocode}
+%<*doc>
+\newcommand\resetint[2]{%
+ \Bheading{Value} \(\TypesetIntegerExpression{\int{#1}}\) =
+ \(\TypesetIntegerExpression{#2}\)%
+}
+\newcommand\resetstr[2]{%
+ \Bheading{Value} \TypesetStringExpression{\str{#1}} =
+ \TypesetStringExpression{#2}%
+}
+\newcommand\resetdim[2]{%
+ \a@dimen=#2\relax
+ \Bheading{Value} \TypesetStringExpression{#1} dimen = \the\a@dimen
+}
+\def\resetcommand#1{\gdef#1}
+%</doc>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\dim}
+% \begin{macrocode}
+%<pkg>\def\dim#1{\csname~d-#1\endcsname}
+% \end{macrocode}
+% \missing{doc}{\dim}
+% \end{macro}
+%
+% \multchanges{\cs{typeset@integer}\cs{typeset@string}^^A
+% \cs{typeset@dimen}}{1.916}{2000/01/02}{Macros removed. (LH)}
+%
+% \begin{macro}{\ifisint}
+% \begin{macro}{\ifisstr}
+% \begin{macro}{\ifisdim}
+% \multchanges{\cs{ifisint}\cs{ifisstr}\cs{ifisdim}}{1.912}
+% {2000/02/10}{Reimplemented using \cs{if_defined}. (LH)}
+% \begin{macro}{\ifiscommand}
+% \begin{macrocode}
+%<*pkg>
+\def\ifisint#1\then{\if_defined i-#1\then}
+\def\ifisstr#1\then{\if_defined s-#1\then}
+\def\ifisdim#1\then{\if_defined d-#1\then}
+\def\ifiscommand#1\then{
+ \ifx#1\undefined_command
+ \expandafter\if_false
+ \else
+ \expandafter\if_true
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+%
+% In \package{fontdoc}, all conditionals are handled through
+% |\generic@if|, which by default expands to |\iftrue|.
+% \changes{1.909}{1999/10/17}{Changed one fontdoc definition of
+% \cs{ifisglyph} to a definition of \cs{ifiscommand}, which was
+% missing from fontdoc.}
+% \begin{macrocode}
+%<*doc>
+\def\ifisint#1\then{%
+ \generic@if{integer $\TypesetIntegerExpression{\int{#1}}$ set}%
+}
+\def\ifisstr#1\then{%
+ \generic@if{string \TypesetStringExpression{#1} set}%
+}
+\def\ifisdim#1\then{%
+ \generic@if{dimension \TypesetStringExpression{#1} set}%
+}
+\def\ifiscommand#1\then{%
+ \generic@if{command \normalfont{\ttfamily\string#1} set}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\unsetint}
+% \begin{macro}{\unsetstr}
+% \begin{macro}{\unsetdim}
+% \begin{macro}{\unsetcommand}
+% \begin{macrocode}
+%<*pkg>
+\def\unsetint#1{\setsomething_global\x_cs\let{i-#1}\x_relax}
+\def\unsetstr#1{\setsomething_global\x_cs\let{s-#1}\x_relax}
+\def\unsetdim#1{\setsomething_global\x_cs\let{d-#1}\x_relax}
+\def\unsetcommand#1{\setsomething_global\let#1=\undefined_command}
+%</pkg>
+% \end{macrocode}
+% \missing{doc}{\unsetint}
+% \missing{doc}{\unsetstr}
+% \missing{doc}{\unsetdim}
+% \missing{doc}{\unsetcommand}
+% \begin{macrocode}
+%<*doc>
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\offcommand}
+% \begin{macro}{\oncommand}
+% \multchanges{\cs{offcommand}\cs{oncommand}}{1.900}{1999/02/07}
+% {Commands added. (LH)}
+% The calls
+% \begin{quote}
+% |\offcommand|\meta{command}\\
+% |\oncommand|\meta{command}
+% \end{quote}
+% can be used to turn a command off (make it simply absorb its
+% arguments but expand to nothing) or on (return it to normal)
+% respectively. Their primary use is for ignoring some of the
+% commands in \texttt{.mtx} files that \package{fontinst} generates
+% from \texttt{.afm}, \texttt{.pl}, or other \texttt{.mtx} files.
+%
+% \describecsfamily{saved-\meta{\textbackslash command}}
+% The normal definition of a command that has been turned off
+% is saved as the control sequence |\saved-|\meta{command}. If the
+% syntax of a command is tricky---not all arguments are read by the
+% base command or its parameter text contains tokens that are not
+% parameters---or if simply making it do nothing is not the expected
+% `off' behaviour, then the automatic off-turning may not work. In such
+% cases a handtooled off definition of the command \meta{command}
+% may be provided as the control sequence |\off-|\meta{command}.^^A
+% \describecsfamily{off-\meta{\textbackslash command}}
+%
+% Nothing happens if |\offcommand| is called for a command that is
+% not on. Nothing happens if |\oncommand| is called for a command
+% that is not off.
+% \begin{macrocode}
+%<*pkg>
+\def\offcommand#1{
+ \x_cs\ifx{saved-\string#1}\x_relax
+ \setsomething_global\x_cs\let{saved-\string#1}#1
+ \x_cs\ifx{off-\string#1}\x_relax
+ \generate_off_command{#1}
+ \else
+ \setsomething_global \expandafter\let \expandafter#1
+ \csname off-\string#1\endcsname
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\oncommand#1{
+ \x_cs\ifx{saved-\string#1}\x_relax \else
+ \setsomething_global \expandafter\let \expandafter#1
+ \csname saved-\string#1\endcsname
+ \setsomething_global\x_cs\let{saved-\string#1}\x_relax
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \multchanges{\cs{offcommand}\cs{oncommand}}{1.914}{2000/05/28}
+% {\package{fontdoc} definitions added. (LH)}
+% \begin{macrocode}
+%<*doc>
+\def\offcommand#1{\Bheading{Turn off} \texttt{\string#1}}
+\def\oncommand#1{\Bheading{Turn on} \texttt{\string#1}}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\generate_off_command}
+% \begin{macro}{\count_hashes}
+% \begin{macro}{\gobble_to_xrelax}
+% |\generate_off_command|\meta{command} converts \meta{command} to
+% an ``off'' version of itself by counting the number of arguments
+% and defining it to gobble that many arguments. It cannot cope with
+% commands whose parameter texts are not simply of the type
+% \begin{quote}
+% |#1#2|\textellipsis|#|$n$
+% \end{quote}
+% \begin{macrocode}
+%<*pkg>
+\def\generate_off_command#1{
+ \a_count=0
+ \let\next=\count_hashes
+ \expandafter\next\meaning#1~->\x_relax
+ \b_count=0
+ \a_toks={}
+ \loop \ifnum \b_count<\a_count
+ \advance \b_count 1
+ \a_toks=\expandafter{\the\expandafter\a_toks \expandafter####
+ \the\b_count}
+ \repeat
+ \setsomething_global \expandafter\def \expandafter#1 \the\a_toks {}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\count_hashes#1#2{
+ \if \hash_char#1
+ \advance \a_count 1
+ \else
+ \if -#1
+ \if >#2
+ \let\next=\gobble_to_xrelax
+ \fi\fi
+ \fi
+ \next#2
+}
+\def\gobble_to_xrelax#1\x_relax{}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% Control sequences of the form
+% \begin{quote}
+% \describecsfamily{FD@s-\meta{name}}|\FD@s-|\meta{name}
+% \end{quote}
+% are used by \package{fontdoc} to store the values of string variables
+% which have been assigned values; \meta{name} is the name of the string
+% variable. Unlike the case in \package{fontinst}, the
+% \package{fontdoc} |\setstr| command does not assign values to string
+% variables, but |\SetStringVariable| does.
+%
+% The contents of the |\FD@s-|\meta{name} macros aren't really the
+% string values, but code that will append the printable form of the
+% corresponding string expression to |\toks@| and update other variables
+% used by |\MakePrintable| accordingly. Typically it might look
+% something like
+% \begin{quote}
+% |\toks@=\expandafter{\the\toks@ ab}|
+% \end{quote}
+% when the value of the string is |ab|.
+%
+% \begin{macro}{\SetStringVariable}
+% \changes{1.916}{2001/01/24}{Command added. (LH)}
+% The |\SetStringVariable| command has the syntax
+% \begin{quote}
+% |\SetStringVariable|\marg{variable name}\marg{new value}
+% \end{quote}
+% where \meta{variable name} and \meta{new value} are both string
+% expressions. The \meta{variable name} must furthermore be a simple
+% string expression. The command globally defines the corresponding
+% |\FD@s-|\meta{name} control sequence to add the printable form of
+% the \marg{new value} string to the |\toks@| token list register and,
+% in case the \meta{new value} string is non-simple, sets the |@tempswa|
+% switch to true.
+%
+% The control sequence |\@tempa| can be used as part of \meta{new
+% value}, but not in the \meta{variable name}.
+% \begin{macrocode}
+%<*doc>
+\newcommand\SetStringVariable[2]{%
+ \protected@edef\@tempa{\noexpand\MakePrintable \noexpand\@tempa
+ {FD@swa}{#2}}%
+ \@tempa
+ \protected@edef\@tempa{%
+ \toks@=\noexpand\expandafter{\noexpand\the \toks@ \@tempa}%
+ \ifFD@swa \noexpand\@tempswatrue \fi
+ }%
+ \protected@edef\@tempb{\noexpand\MakePrintable \noexpand\@tempb
+ {FD@swa}{#1}}%
+ \@tempb
+ \ifFD@swa
+ \begingroup
+ \let\PrintChar=\FD@quoted@PrintChar
+ \global\expandafter\let \csname FD@s-\@tempb\endcsname \@tempa
+ \endgroup
+ \else
+ \PackageError{fontdoc}{Names of string variables must be
+ simple\MessageBreak if they are to be assigned values}\@eha
+ \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsection{For loops}
+%
+%
+% \begin{macro}{\for}
+% \begin{macro}{\endfor}
+% \multchanges{\cs{for}\cs{endfor}}{1.900}{1999/02/16}{Commands
+% added. (LH)}
+% The command sequence
+% \begin{quote}
+% |\for|\parg{name}\marg{start}\marg{stop}\marg{step}\\
+% \vadjust{}\quad\meta{body code}\\
+% |\endfor|\parg{name}
+% \end{quote}
+% will cause the \meta{body code} to be repeated some number of times.
+% How many depends on the values of \meta{start}, \meta{stop}, and
+% \meta{step}, which are integer expressions.
+%
+% As a precaution, the \meta{body code} is not allowed to contain any
+% empty lines (|\par| tokens). If you want to have the visual
+% separation (for sakes of legibility or otherwise), put a |%|
+% somewhere on the line---that makes it nonempty.
+%
+% \meta{name} is used as the name of an integer variable. This
+% variable gets reset to the value of \meta{start} before the first
+% repetition of \meta{body code}. After each repetition but the last,
+% it is incremented by \meta{step}. \meta{body code} gets repeated if
+% the value of \meta{name} has not gotten past that of \meta{stop}. To
+% get past means to be bigger if \meta{step} is positive and to be
+% smaller if \meta{step} is negative. In the case that \meta{step} is
+% zero, the entire construction above will be equivalent to
+% \begin{quote}
+% |\resetint|\marg{name}\marg{start}\\
+% \meta{body code}
+% \end{quote}
+%
+% |\for| \textellipsis\ |\endfor| constructions can be nested.
+% \meta{name} is used by |\for| to identify its matching |\endfor|, so
+% they need to be identical in |\for| and |\endfor|.
+%
+% \multchanges{\cs{for}\cs{for_i}\cs{foreach}}{1.914}{2000/05/21}
+% {\cs{setsomething_global} added to assignments of the
+% \cs{for-\meta{name}} and \cs{body-\meta{name}} control
+% sequences. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\for(#1)#2#3#4{
+ \eval_expr_to\a_count{#2}
+ \x_resetint{#1}{\a_count}
+ \eval_expr{#4}
+ \ifnum 0=\result \else
+ \c_count=\result
+ \eval_expr_to\b_count{#3}
+ \setsomething_global\x_cs\edef{for-#1}{
+ \the\c_count \x_relax
+ \noexpand\ifnum \gobble_one\fi
+ \the\b_count \ifnum 0>\c_count > \else < \fi
+ }
+ \def\next##1##2##3\endfor(#1){##2\for_i{##1}{##3}}
+ \next{#1}
+ \fi
+}
+% \end{macrocode}
+%
+% The macro \describecsfamily{for-\meta{name}}|\for-|\meta{name}
+% will contain
+% \begin{quote}
+% \meta{step}|\x_relax\ifnum|\meta{stop}\meta{rel}
+% \end{quote}
+% \meta{step} is the value of the \meta{step} parameter of |\for|,
+% computed when the loop was entered and now expressed in digits.
+% \meta{stop} is likewise for the \meta{stop} parameter. \meta{rel}
+% is |>| or |<|, depending on whether \meta{step} is positive or
+% negative respectively. The reason for this curious definition will
+% be appearent in the light of the definition of |\for_ii|.
+%
+% |\for_i| is expanded in the context
+% \begin{quote}
+% |\for_i|\marg{name}\marg{body code}
+% \end{quote}
+% Also remember, when reading the definition below, that |\ifnum|
+% keeps on expanding tokens until it has found a
+% \begin{quote}
+% \meta{number}\meta{relation}\meta{number}
+% \end{quote}
+% structure. It is therefore possible to nest |\ifnum|s like this!
+%
+% \begin{macrocode}
+\def\for_i#1#2{
+ \setsomething_global\x_cs\def{body-#1}{#2}
+ \ifnum \b_count \ifnum0>\c_count >\else<\fi \a_count
+ \expandafter\gobble_two
+ \else
+ \csname body-#1 \expandafter\endcsname
+ \fi
+ \for_ii{#1}
+}
+% \end{macrocode}
+%
+% The macro \describecsfamily{body-\meta{name}}|\body-|\meta{name}
+% expands to the \meta{body code}.
+%
+% |\for_ii| executes the following code:
+% \begin{quote}
+% |\a_count=\int|\marg{name}\\
+% |\advance \a_count |\meta{step}|\x_relax|\\
+% |\ifnum |\meta{stop}\meta{rel}|\a_count|\\
+% | \expandafter\gobble_two|\\
+% |\else|\\
+% | \resetint|\marg{name}|\a_count|\\
+% | \csname body-|\meta{name}| \expandafter\endcsname|\\
+% |\fi|\\
+% |\for_ii|\marg{name}
+% \end{quote}
+% \meta{step}, \meta{stop}, and \meta{rel} are in |\for-|\meta{name},
+% and since there only are two other tokens between \meta{step} and
+% \meta{rel} in the above, one might as well include them in
+% |\for-|\meta{name} as well. Doing that requires that a matching
+% hole---that will be filled in by |\for-|\meta{name}---is made in the
+% definition of |\for_ii| and that is the reason for its somewhat
+% curious definition.
+%
+% \begin{macrocode}
+\def\for_ii#1{
+ \a_count=\int{#1}
+ \advance \a_count \csname for-#1\endcsname \a_count
+ \expandafter\gobble_two
+ \else
+ \x_resetint{#1}\a_count
+ \csname body-#1 \expandafter\endcsname
+ \fi
+ \for_ii{#1}
+}
+% \end{macrocode}
+%
+% |\endfor| just gobbles its argument, so that the \meta{step}${}=0$
+% case will work right.
+%
+% \begin{macrocode}
+\def\endfor(#1){}
+%</pkg>
+% \end{macrocode}
+% \missing{doc}{\for}
+% \missing{doc}{\endfor}
+% \begin{macrocode}
+%<*doc>
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\foreach}
+% \changes{1.901}{1999/03/07}{Command added. (LH)}
+% \changes{1.916}{2001/01/24}{\package{fontdoc} definition added. (LH)}
+% \begin{macro}{\foreach_i}
+% The command sequence
+% \begin{quote}
+% |\foreach|\parg{name}\marg{csep-list}\\
+% \vadjust{}\quad\meta{body code}\\
+% |\endfor|\parg{name}
+% \end{quote}
+% will cause the \meta{body code} to be repeated one time for each item
+% in the \meta{csep-list}. \meta{csep-list} is a comma-separated list
+% of strings.
+%
+% As a precaution, the \meta{body code} is not allowed to contain any
+% empty lines (|\par| tokens). If you want to have the visual
+% separation (for sakes of legibility or otherwise), put a |%|
+% somewhere on the line---that makes it nonempty.
+%
+% \meta{name} is used as the name of a string variable. Before each
+% repetition of the \meta{body code}, this variable will get reset to
+% the next item in the \meta{csep-list}.
+%
+% |\for|\textellipsis\ |\endfor| constructions can be nested.
+% \meta{name} is used by |\foreach| to identify its matching |\endfor|,
+% so they need to be identical in |\foreach| and |\endfor|.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\foreach(#1)#2{
+ \def\next##1\endfor(#1){
+ \setsomething_global\x_cs\def{body-#1}{##1}
+ \process_csep_list{\foreach_i{#1}}#2,\process_csep_list,
+ }
+ \next
+}
+\def\foreach_i#1#2{
+ \resetstr{#1}{#2}
+ \csname body-#1\endcsname
+}
+%</pkg>
+%<*doc>
+\def\foreach(#1)#2{%
+ \def\next##1\endfor(#1){%
+ \@for\@tempa:=#2\do{%
+ \SetStringVariable{#1}{\@tempa}%
+ ##1%
+ }%
+ }%
+ \next
+}
+%</doc>
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+%
+% \subsection{Comments}
+%
+% \changes{1.911}{1999/11/30}{Comment commands included in
+% \texttt{finstmsc.sty}. (LH)}
+%
+% \begin{macro}{\comment}
+% In \package{fontinst}, |\comment| simply gobbles its argument.
+% \begin{macrocode}
+%<pkg>\let\comment=\gobble_one
+% \end{macrocode}
+%
+% In \package{fontdoc}, |\comment| starts a new text paragraph and
+% leaves the argument to be typeset.
+% \begin{macrocode}
+%<*doc>
+\def\comment{\par\noindent}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\begincomment}
+% \changes{1.900}{1999/02/07}{Command added. (LH)}
+% \begin{macro}{\endcomment}
+% \changes{1.900}{1999/02/07}{Command added. (LH)}
+% Since |\comment| cannot be used for a comment longer than one
+% paragraph, we also provide the means of introducing longer comments,
+% by writing
+% \begin{quote}
+% |\begincomment| \meta{any amount of text} |\endcomment|
+% \end{quote}
+% The names are admittedly not nice from a \LaTeX\ point of view, but
+% it is hardly worth the cost to implement some kind of environment
+% processing in \package{fontinst}, just for the sake of this command.
+% \begin{macrocode}
+%<pkg>\let\begincomment=\iffalse
+%<doc>\let\begincomment=\iftrue
+%<pkg|doc>\let\endcomment=\fi
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/fontinst/base/ficonv.dtx b/Master/texmf-dist/source/fontinst/base/ficonv.dtx
new file mode 100644
index 00000000000..e1fee953b8c
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/ficonv.dtx
@@ -0,0 +1,2807 @@
+% \CheckSum{2221}
+% \iffalse meta-comment
+%
+% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+% hacked and maintained 1997, 1998 Sebastian Rahtz,
+% copyright 1998, 1999, 2000 the fontinst maintenance team and any
+% individual authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+%%% From file: ficonv.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fisource}
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth, Lars Hellstr\"om}
+\begin{document}
+\maketitle
+\tableofcontents
+\DocInput{ficonv.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \StopEventually{}
+%
+% \section{Basic file format conversions}
+% \label{Sec:Conv. input}
+% \changes{1.902}{1999/05/01}{Collected the material in Section
+% \thesection\space and moved it to \texttt{ficonv.dtx}. (LH)}
+% \changes{1.926}{2003/07/12}{Added some missing \textasciitilde's
+% at ends of lines. (LH)}
+%
+% \subsection{Converting an ENC file to an ETX file}
+%
+% \DescribeMacro{\enctoetx}
+% The macro
+% \begin{quote}
+% |\enctoetx|\marg{encfile}\marg{etxfile}
+% \end{quote}
+% reads \meta{encfile}|.enc| and writes the same information to
+% \meta{etxfile}|.etx|, in a format \TeX{} can read more easily.
+%
+% Each |/|\meta{glyph} command is recorded in a macro |\o-|\meta{glyph},
+% which expands to a corresponding |\setslot|\marg{glyph}
+% \textellipsis\ |\endslot|
+% statement.
+%
+% \begin{macrocode}
+%<*misc>
+\newif\ifmissingslots
+\x_cs\def{o-.notdef}#1{\global\missingslotstrue}
+% \end{macrocode}
+%
+% \begin{macro}{\enctoetx}
+% \begin{macrocode}
+{
+ \catcode`\/=\active
+ \catcode`\]=\active
+ \gdef\enctoetx#1#2{{
+ \catcode`\/=\active
+ \catcode`\]=\active
+ \def/##1[{
+ \a_count=0
+ \global\missingslotsfalse
+ \def/####1~{
+ \csname~o-####1\endcsname{
+ \ifmissingslots
+ \out_line{\string\nextslot{\the\a_count}}
+ \fi
+ \global\missingslotsfalse
+ \out_line{\string\setslot{####1}}
+ \out_line{\string\endsetslot}
+ \out_line{}
+ }
+ \advance\a_count by 1
+ }
+ }
+ \def]~def{}
+ \make_etx{#1}{#2}
+ }}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% |\make_etx| finishes the job of |\enctoetx|.
+%
+% \begin{macrocode}
+\def\make_etx#1#2{
+ \open_out{\temp_prefix#2.etx}
+ \out_line{\percent_char~Filename:~#2.etx}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using:~\string\enctoetx{#1}{#2}}
+ \out_line{}
+ \out_line{\percent_char~This~file~contains~the~
+ information~of~#1.enc~in~a~form}
+ \out_line{\percent_char~more~easily~read~by~TeX.~
+ It~is~used~by~the~fontinst~package.}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~CAN~BE~DELETED.}
+ \out_line{}
+ \out_line{\string\relax}
+ \out_line{}
+ \out_line{\string\documentclass[twocolumn]{article}}
+ \out_line{\string\usepackage{fontdoc}}
+ \out_line{}
+ \out_line{\string\begin{document}}
+ \out_line{}
+ \out_line{This~document~describes~the~#1~encoding.}
+ \out_line{It~was~automatically~generated~by~the}
+ \out_line{{\string\tt\space~fontinst}~package.}
+ \out_line{}
+ \out_line{\string\encoding}
+ \out_line{}
+ \out_line{\string\needsfontinstversion{\fontinstversion}}
+ \out_line{}
+ \primitiveinput #1.enc\x_relax
+ \out_line{}
+ \out_line{\string\end encoding}
+ \out_line{}
+ \out_line{\string\end{document}}
+ \close_out{Encoding~vector}
+}
+% \end{macrocode}
+%
+%
+% \subsection{Converting an ETX file to an ENC file}
+% \changes{1.911}{1999/11/21}{ETX to ENC converter added. (LH)}
+%
+% \DescribeMacro{\etxtoenc}
+% The command
+% \begin{quote}
+% |\etxtoenc|\marg{etxfile}\marg{encfile}
+% \end{quote}
+% reads \meta{etxfile}|.etx| and generates a postscript encoding file
+% \meta{encfile}|.enc| that specifies the same encoding vector.
+%
+%
+% \begin{macro}{\notdef_name}
+% This macro holds the name of the \texttt{.notdef} glyph, which must
+% be put in all encoding positions where there is no other glyph.
+% \begin{macrocode}
+\def\notdef_name{.notdef}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\etxtoenc}
+% The conversion has three steps. First the \texttt{.notdef} glyph is
+% assigned to every slot in the encoding, then the ETX file is read
+% and the assignments are changed for the slots which are not
+% unassigned in the encoding, and finally the ENC file is written.
+% The first two steps are carried out by |\etxtoenc|, but the final
+% step is handled by |\make_enc|.
+% \changes{1.927}{2004/07/12}{Made the \meta{etxfile} argument a
+% comma-separated list of ETX files. Changed \cs{do_slot} definition
+% to get set rather than reset semantics. (LH) Feature requested
+% by Werner Lemberg.}
+% \begin{macrocode}
+\def\etxtoenc#1#2{\begingroup
+ \a_count=\z@
+ \loop
+ \x_cs\let{name-\the\a_count}=\notdef_name
+ \ifnum \@cclv>\a_count
+ \advance \a_count \@ne
+ \repeat
+ \def\do_slot{
+ \x_cs\ifx{name-\the\slot_number}\notdef_name
+ \x_cs\edef{name-\the\slot_number}{\slot_name}
+ \fi
+ }
+ \process_csep_list\inputetx #1,\process_csep_list,
+ \make_enc{#1}{#2}
+\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\make_enc}
+% The command
+% \begin{quote}
+% |\make_enc|\marg{etxfiles}\marg{encfile}
+% \end{quote}
+% creates the file \meta{encfile}|.enc| and writes to that file the
+% definition of the postscript encoding vector which corresponds to
+% the encoding currently stored in the |\name-|\meta{slot} family of
+% macros. That encoding is assumed to be defined by the files listed
+% in the \meta{etxfiles}.
+%
+% \changes{1.911}{1999/12/02}{Storing encoding name in string
+% \texttt{encodingname}, thus allowing the ETX file to override
+% the default. (LH)}
+% \changes{1.912}{2000/02/12}{Also calling \cs{declarepsencoding}
+% once the encoding file has been written. (LH)}
+% \changes{1.914}{2000/05/14}{Not writing an \texttt{address} entry
+% if that string isn't set. (LH)}
+% \changes{1.919}{2001/08/02}{Added DSC comments. (LH)}
+% \changes{1.927}{2004/07/12}{Modified to handle a comma-separated
+% list of ETX files. (LH)}
+% \begin{macrocode}
+\def\make_enc#1#2{
+ \setstr{encodingname}{fontinst-autoenc-#1}
+ \def\a_macro##1{
+ \add_to\b_macro{##1.etx}
+ \def\a_macro####1{
+ \add_to\b_macro{,~####1.etx}
+ }
+ }
+ \let\b_macro\empty_command
+ \process_csep_list\a_macro #1,\process_csep_list,
+ \open_out{#2.enc}
+ \out_line{\percent_char !PS-Adobe-3.0~Resource-Encoding}
+ \out_line{\percent_char\space @psencodingfile\left_brace_char}
+ \ref_to_sourcefile{author}\b_macro
+ \ref_to_sourcefile{version}\b_macro
+ \out_line{\percent_char\four_spaces date~=~"generated~
+ \the\year/
+ \ifnum10>\month0\fi\the\month/
+ \ifnum10>\day0\fi\the\day",}
+ \out_line{\percent_char\four_spaces filename~=~"\out_filename",}
+ \ref_to_sourcefile{email}\b_macro
+ \ifisstr{address}\then
+ \out_line{\percent_char\four_spaces address~=~\str{address}}
+ \fi
+ \out_line{\percent_char\four_spaces codetable~=~"ISO/ASCII",}
+ \out_line{\percent_char\four_spaces checksum~=~"",}
+ \out_line{\percent_char\four_spaces abstract~=~"
+ This~is~a~postscript~encoding~file,~automatically~
+ generated~by~fontinst~from~\b_macro."}
+ \out_line{\percent_char\space\right_brace_char}
+ \out_line{}
+ \out_line{\percent_char\space Created~by:~tex~\jobname}
+ \out_line{\percent_char\space Created~using:~
+ \string\etxtoenc{#1}{#2}}
+ \out_line{}
+ \out_line{\percent_char\space This~file~should~be~installed~
+ somewhere~that~your~DVI}
+ \out_line{\percent_char\space to~postscript~driver~looks~for~files.~
+ It~is~needed~for}
+ \out_line{\percent_char\space reencoding~some~font~you~have~
+ transformed.}
+ \out_line{}
+ \out_line{\percent_char\space After~installing~this~file,~you~
+ should~add~the~following}
+ \out_line{\percent_char\space line~(minus~\percent_char)~
+ to~your~finstmsc.rc~file:}
+ \out_line{\percent_char\space\string\declarepsencoding
+ {#1}{\str{encodingname}}{\string\download{\out_filename}}}
+ \edef\a_macro{
+ \noexpand\declarepsencoding{#1}{\str{encodingname}}
+ {\noexpand\download{\out_filename}}
+ }
+ \a_macro
+ \out_line{}
+ \out_line{\percent_char\percent_char BeginResource:~
+ encoding~\str{encodingname}}
+ \out_line{/\str{encodingname}\space[}
+ \b_count=8
+ \a_count=\z@
+ \loop
+ \ifnum 8=\b_count
+ \b_count=\z@
+ \out_line{\percent_char\space\the\a_count}
+ \fi
+ \out_line{/\csname name-\the\a_count \endcsname}
+ \ifnum \@cclv>\a_count
+ \advance \a_count \@ne
+ \advance \b_count \@ne
+ \repeat
+ \out_line{]~def}
+ \out_line{\percent_char\percent_char EndResource}
+ \out_line{}
+ \out_line{\percent_char\space End~of~file~\out_filename.}
+ \close_out{Encoding~vector}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ref_to_sourcefile}
+% The command
+% \begin{quote}
+% |\ref_to_sourcefile|\marg{field}\marg{sourcefile}
+% \end{quote}
+% writes a \meta{field} field of a \BibTeX-style header to the
+% current main output file. If the string named \meta{field} is set
+% then the value for this field will be that string, and if it isn't
+% set then the value will be the string \texttt{"See file }^^A
+% \meta{sourcefile}\texttt{"}. Note that the string \#1 is not
+% quoted, so it must contain the quotes if it isn't simply an integer.
+% \begin{macrocode}
+\def\ref_to_sourcefile#1#2{
+ \ifisstr{#1}\then
+ \out_line{\percent_char\four_spaces #1~=~\str{#1},}
+ \else
+ \out_line{\percent_char\four_spaces #1~=~"See~file~#2",}
+ \fi
+}
+%</misc>
+% \end{macrocode}
+% \end{macro}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsection{Converting an AFM file to an MTX file}
+%
+% \DescribeMacro{\afmtomtx}
+% The macro
+% \begin{quote}
+% |\afmtomtx|\marg{afmfile}\marg{mtxfile}
+% \end{quote}
+% reads \meta{afmfile}|.afm|, and writes the same information out to
+% \meta{mtxfile}|.mtx|.
+%
+% \begin{macro}{\afmtomtx}
+% \changes{1.911}{1999/11/18}{Changed setting of \cs{raw_font_name}
+% to \cs{edef} and added setting of \cs{source_font_name}. (LH)}
+% \changes{1.917}{2001/03/13}{Added resetting of
+% \cs{setsomething_global}---assignments made here must be
+% local. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\afmtomtx#1#2{{
+ \let\setsomething_global=\x_relax
+ \open_out{\temp_prefix#2.mtx}
+ \edef\raw_font_name{#2}
+ \edef\source_font_name{#1}
+ \x_resetint{italicslant}{0}
+ \let\italcorr_expression=\uprightitalcorr
+ \x_setint{minimumkern}{0}
+ \minimum_kern=\int{minimumkern}
+ \out_line{\percent_char~Filename:~#2.mtx}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using:~\string\afmtomtx{#1}{#2}}
+ \out_line{}
+ \out_line{\percent_char~This~file~contains~the~
+ information~of~#1.afm~in~a~form}
+ \out_line{\percent_char~more~easily~read~by~TeX.~
+ It~is~used~by~the~fontinst~package.}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~CAN~BE~DELETED.}
+ \out_line{}
+ \out_line{\string\relax}
+ \out_line{\string\metrics}
+ \out_line{}
+ \out_line{\string\needsfontinstversion{\fontinstversion}}
+ \out_line{}
+ \catcode`\^^M=12
+ \catcode`\ =10
+ \expandafter\afm_line\primitiveinput #1.afm\x_relax
+ \out_line{}
+ \out_line{\endmetrics_text}
+ \close_out{Metrics}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% Kerns below this value are ignored.
+%
+% \begin{macrocode}
+\newcount\minimum_kern
+% \end{macrocode}
+%
+%
+% \begin{macro}{\afm_length}
+% \changes{1.900}{1998/12/28}{Macro added, other macros modified to
+% use it. (LH)}
+% \begin{macro}{\afm_unit_dimen}
+% The call |\afm_length|\meta{count}\marg{real}
+% interprets the \meta{real} as a real number, rounds it to the
+% nearest integer, and sets the \meta{count} (a |\count| register)
+% to that integer. In this process, |\a_dimen| is used as a temporary
+% storage.
+% \begin{macrocode}
+\def\afm_length#1#2{
+ \a_dimen=#2\afm_unit_dimen
+ #1=\a_dimen
+ \divide #1 by \afm_unit_dimen
+ \advance \a_dimen by -#1\afm_unit_dimen
+ \ifdim \a_dimen>0.5\afm_unit_dimen
+ \advance #1 by 1
+ \else \ifdim \a_dimen<-0.5\afm_unit_dimen
+ \advance #1 by -1
+ \fi\fi
+ \x_relax
+}
+% \end{macrocode}
+% The dimen |\afm_unit_dimen| is used to keep track of how long an AFM
+% unit is interpreted as being in this routine. Lowering its value
+% makes |\afm_length| capable of handling greater lengths but looses
+% some very slight precision in the rounding, increasing the value
+% has the opposite effects. The current value of 1000\thinspace sp
+% means it reads lengths with three decimals accuracy (not very much
+% use for them though as the number is rounded to zero decimals
+% accuracy anyway, but it does make a difference when deciding how
+% a \meta{real} like |0.502| should be rounded) and can handle lengths
+% of an absolute value of a good million AFM units. This should be
+% adequate in most cases. It is, by the way, probably wisest to keep
+% it a power of ten scaled points in all cases, as this should reduce
+% the rounding errors caused by various base conversions.
+% \begin{macrocode}
+\newdimen\afm_unit_dimen
+\afm_unit_dimen=1000sp
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% The command |\afm_line| reads to the end of the line, calls
+% |\afm_command| on that line, then calls |\afm_line| again.
+%
+% \begin{macrocode}
+{\catcode`\^^M=12 \gdef\afm_line#1
+{\afm_command#1~\end_of_line\afm_line}}
+% \end{macrocode}
+%
+% The command |\afm_command| reads the first word |FOO|, and calls
+% |afm-FOO|. If this does not exist, then |\gobble_one_line| will
+% eat up the rest of the line.
+%
+% \begin{macrocode}
+\def\afm_command#1~{\csname~afm-#1\endcsname\gobble_one_line}
+\def\gobble_one_line#1\end_of_line{}
+% \end{macrocode}
+%
+% This all stops when we reach the command |EndFontMetrics|.
+%
+% \begin{macrocode}
+\x_cs\def{afm-EndFontMetrics}#1\afm_line{\endinput}
+% \end{macrocode}
+%
+% \begin{macro}{\afm_def}
+% To define an AFM command, you say |\afm_def|\marg{command}^^A
+% \parg{pattern}\marg{result}
+% \begin{macrocode}
+\def\afm_def#1(#2)#3{\x_cs\def{afm-#1}
+ \gobble_one_line#2\end_of_line{#3}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\afm_let}
+% Saying |\afm_let|\marg{dest-command}\marg{source-command} copies
+% the definition of one AFM command to another.
+% \begin{macrocode}
+\def\afm_let#1#2{
+ \expandafter\let \csname afm-#1\expandafter\endcsname
+ \csname afm-#2\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+%
+% For example, we can define the following AFM commands:
+% \changes{1.6}{1997/02/07}{AFM commands fixed, to get fontdimens
+% comparable to EC fonts. (Thierry Bouche)}
+% ^^A (Fixed by Thierry Bouche
+% ^^A 1997/02/07, to get fontdimens comparable to EC fonts.)
+% \changes{1.912}{2000/02/20}{AFM command \texttt{StdVW} now
+% interpreted: generates \cs{setint} for integer
+% \texttt{verticalstem}. (LH)}
+%
+% \begin{macrocode}
+\afm_def{CharWidth}(#1){\afm_length\char_x_width{#1}}
+\afm_def{ItalicAngle}(#1~){\calculate_it_slant{#1}}
+\afm_def{XHeight}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{xheight}{\the\a_count}}}
+\afm_def{CapHeight}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{capheight}{\the\a_count}}}
+\afm_def{Ascender}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{ascender}{\the\a_count}}}
+\afm_def{Descender}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{descender_neg}{\the\a_count}}}
+\afm_def{UnderlineThickness}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{underlinethickness}{\the\a_count}}}
+\afm_def{FontBBox}(#1~#2~#3~#4){
+ \afm_length\a_count{#4}
+ \out_line{\string\setint{maxheight}{\the\a_count}}
+ \afm_length\a_count{#2}
+ \out_line{\string\setint{maxdepth_neg}{\the\a_count}}}
+\afm_def{StdVW}(#1){
+ \afm_length\a_count{#1}
+ \out_line{\string\setint{verticalstem}{\the\a_count}}}
+\afm_def{IsFixedPitch}(#1){
+ \if\first_char#1=f
+ \else\out_line{\string\setint{monowidth}{1}}
+ \fi
+}
+% \end{macrocode}
+%
+% \multchanges{\cs{afm_font_name}}{1.901}{1999/03/06}{Macro added. (LH)}
+% \multchanges{\cs{afm_font_name}}{1.911}{1999/11/18}{Macro removed,
+% since no longer needed. (LH)}
+%
+% \begin{macro}{\afm-FontName}
+% The |FontName| of a font is needed for the |\storemapdata| command,
+% so it is when that is encountered that this is written. This
+% information is of no use when making TFMs and VFs, but it is likely
+% to be of use for generation of map files, so it will be included in
+% a file of recorded transforms, if such a file is being generated.
+% \begin{macrocode}
+\afm_def{FontName}(#1~){
+ \record_transform{\raw_font_name}
+ {\string\fromafm{\source_font_name}{#1}}{}\iftrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Processing kern pairs. If one of the glyph name starts with
+% a dot as in |.notdef| or |.null| the kern pair is ignored.
+%
+% \begin{macrocode}
+\afm_def{KP}(#1~#2~#3~#4){
+ \if\first_char#1=.\else
+ \if\first_char#2=.\else
+ \afm_length\a_count{#3}
+ \ifnum \a_count>\minimum_kern
+ \out_line{\string\setkern{#1}{#2}{\the\a_count}}
+ \else\ifnum \a_count<-\minimum_kern
+ \out_line{\string\setkern{#1}{#2}{\the\a_count}}
+ \fi\fi
+ \fi\fi
+}
+\afm_let{KPX}{KP}
+% \end{macrocode}
+%
+% Processing char metrics.
+%
+% \begin{macrocode}
+\afm_def{C}(#1~;#2){\init_afm{#1}\do_list[#2]\afm_char}
+\afm_let{CH}{C}
+% \end{macrocode}
+%
+% Processing composite chars.
+%
+% \begin{macrocode}
+\afm_def{CC}(#1~#2~;#3){\init_cc{#1}\do_list[#3]\cc_char}
+% \end{macrocode}
+%
+% When parsing a character, we set the values of the following
+% variables:
+%
+% \begin{macrocode}
+\newcount\char_slot
+\newcount\char_x_width
+\newcount\x_width
+\newcount\bbox_llx
+\newcount\bbox_lly
+\newcount\bbox_urx
+\newcount\bbox_ury
+\let\char_name=\empty_command
+% \end{macrocode}
+%
+% |\init_afm| initializes the variables the AFM character list writes to.
+%
+% \begin{macrocode}
+\def\init_afm#1{
+ \char_slot=#1\x_relax
+ \x_width=\char_x_width
+ \bbox_llx=0
+ \bbox_lly=0
+ \bbox_urx=0
+ \bbox_ury=0
+ \let\char_name=\empty_command
+}
+% \end{macrocode}
+%
+% ^^A Commented out, since it describes the way of things before
+% ^^A v1.308 (this comment has been wrong for over five years!):
+% ^^A
+% ^^A |\afm_char| writes the values of these variables to the |.mtx|
+% ^^A file, and saves them in a macro |\g-GLYPHNAME|, in the form:
+% ^^A \begin{quote}
+% ^^A |{WIDTH}{HEIGHT}{DEPTH}{ITALIC}|
+% ^^A \end{quote}
+% ^^A
+% ^^A These are needed, because the (grumble grumble) syntax of |CC|
+% ^^A commands doesn't include the glyph measurements, so we have to
+% ^^A remember them.
+%
+% \begin{macrocode}
+\def\afm_char{
+ \a_count=-\bbox_lly
+ \eval_expr{
+ \italcorr_expression\x_width\bbox_llx\bbox_urx\bbox_lly\bbox_ury
+ }
+ \out_line{
+ \ifnum -1<\char_slot
+ \string\setrawglyph
+ \else
+ \string\setnotglyph
+ \fi
+ {\char_name}
+ {\raw_font_name}
+ {10pt}
+ {\the\char_slot}
+ {\the\x_width}
+ {\the\bbox_ury}
+ {\the\a_count}
+ {\the\result}
+ }
+}
+% \end{macrocode}
+%
+% |\init_cc| and |\cc_char| write out a composite character glyph.
+%
+% \begin{macrocode}
+\def\init_cc#1{%
+ \out_line{\string\setglyph{#1}}
+ \def\char_name{#1}
+}
+\def\cc_char{%
+ \out_lline{\string\samesize{\char_name-not}}
+ \out_line{\string\endsetglyph}
+}
+% \end{macrocode}
+%
+%
+% \changes{1.900}{1998/12/28}{Method of computing italic corrections
+% changed to using an integer expression. (LH)}
+% \DescribeMacro{\italcorr_expression}
+% The way the italic correction is computed has been changed
+% quite a bit, although the computed values are still the same.
+% The point is that it is much simpler to modify the formula according
+% to which the value is computed using this method than using the
+% previous method.
+%
+% The call
+% \begin{quote}
+% |\italcorr_expression|\marg{width}\marg{left}^^A
+% \marg{right}\marg{bottom}\marg{top},
+% \end{quote}
+% where the arguments are \TeX\ \meta{number}s, should expand to an
+% integer expression. The value of that expression will be taken as the
+% italic correction of the current character.
+%
+% \meta{width} is the width of the character. \meta{left},
+% \meta{right}, \meta{bottom}, and \meta{top} are the respective
+% coordinates of the sides of the bounding box of the character. A
+% quantity which is not given as an argument, but which nontheless
+% might be of interest for a calculation of italic correction, is the
+% italic slant of the font. This quantity can be found in the fontinst
+% integer \texttt{italicslant}. (The MTX file written will also set
+% the integer \texttt{italicslant} to this value.)
+%
+% \begin{macro}{\uprightitalcorr}
+% \begin{macro}{\slanteditalcorr}
+% These two commands are what |\italcorr_expression| will get set
+% to---the slanted version is used if the italic slant is positive and
+% the upright version is used otherwise. The default definitions
+% compute the same values as in fontinst v\,1.8, but the definitions
+% can easily be modified using |\resetcommand|.
+% \begin{macrocode}
+\def\uprightitalcorr#1#2#3#4#5{0}
+\def\slanteditalcorr#1#2#3#4#5{\max{\sub{#3}{#1}}{0}}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\calculate_it_slant}
+% To set the italic angle, we need to calculate the tangent of the
+% angle that the |.afm| file contains. This is done with David
+% Carlisle's \package{trig} macros. Note that the \package{trig}
+% macros don't like a space at the end of their argument.
+%
+% \changes{1.911}{1999/11/18}{Stripping off the space in
+% \cs{afm-ItalicAngle}. (LH)}
+% ^^A\question{\cs{afm_line} always inserts a space at the end of the line.}
+% ^^ACould we therefore save us a bit of trouble by simply changing the
+% ^^Apattern for |\ItalicAngle| to |(#1~)|? /LH
+%
+% \begin{macrocode}
+\def\calculate_it_slant#1{
+ \edef\theangle{#1}
+ \CalculateTan{\theangle}
+ \a_dimen=-\one_thousand sp
+ \a_dimen=\UseTan{\theangle}\a_dimen
+ \a_count=\a_dimen
+ \out_line{\string\setint{italicslant}{\the\a_count}}
+ \x_resetint{italicslant}{\a_count}
+ \ifnum 0<\a_count
+ \let\italcorr_expression=\slanteditalcorr
+ \else
+ \let\italcorr_expression=\uprightitalcorr
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+% \def\strip_spaces#1~#2\end_strip_spaces{#1}
+% \end{macrocode}
+% \end{macro}
+%
+% To process a list of commands separated by semi-colons, we call
+% |\do_list[LIST]|. This works in a similar way to |\afm_line|.
+%
+% \begin{macrocode}
+\def\do_list[~#1~#2;~#3]{
+ \csname~list-#1\endcsname\gobble_one_semi#2;
+ \ifx\x_relax#3\x_relax\expandafter\gobble_one
+ \else\expandafter\identity_one\fi
+ {\do_list[~#3]}
+}
+\def\gobble_one_semi#1;{}
+% \end{macrocode}
+%
+% There is an analagous |\list_def| for defining commands to be used
+% inside lists.
+%
+% \begin{macrocode}
+\def\list_def#1(#2)#3{\x_cs\def{list-#1}\gobble_one_semi#2~;{#3}}
+% \end{macrocode}
+%
+% For example, these are the commands that are used in giving
+% character metrics:
+%
+% \begin{macrocode}
+\list_def{W}(#1~#2){\afm_length\x_width{#1}}
+\list_def{WX}(#1){\afm_length\x_width{#1}}
+\list_def{WY}(#1){}
+\list_def{N}(#1){\def\char_name{#1}}
+\list_def{B}(#1~#2~#3~#4){
+ \afm_length\bbox_llx{#1}
+ \afm_length\bbox_lly{#2}
+ \afm_length\bbox_urx{#3}
+ \afm_length\bbox_ury{#4}
+}
+\list_def{PCC}(#1~#2~#3){
+ \afm_length\a_count{#2}
+ \afm_length\b_count{#3}
+ \out_lline{\string\glyphpcc{#1}{\the\a_count}{\the\b_count}}
+}
+% \end{macrocode}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \subsection{Converting a PL file to an MTX file}
+%
+% \DescribeMacro{\generalpltomtx}The macro
+% \begin{quote}
+% |\generalpltomtx|\marg{plfile}\marg{mtxfile}\marg{plsuffix}\relax
+% \marg{opt-enc}
+% \end{quote}
+% reads \meta{plfile}|.|\meta{plsuffix}, interprets it as having the
+% encoding specified by the file \meta{opt-enc}|.etx|, and writes the
+% same metric information out to \meta{mtxfile}|.mtx|. In case
+% \meta{opt-enc} is empty, the encoding will be determined using the
+% |CODINGSCHEME| property of the file being read.
+% \DescribeMacro{\pltomtx}The macro
+% \begin{quote}
+% |\pltomtx|\marg{plfile}\marg{mtxfile}
+% \end{quote}
+% reads \meta{plfile}|.pl|, uses the |CODINGSCHEME| property in that
+% file to determine its encoding, and writes the same metric information
+% out to \meta{mtxfile}|.mtx|.
+%
+% None of these commands can cope with |SKIP| properties in the (V)PL
+% file.
+%
+% \begin{macro}{\generalpltomtx}
+% \changes{1.902}{1999/05/01}{Command added, removed
+% \cs{pltomtxgivenetx}. (LH)}
+% \changes{1.910}{1999/11/01}{Made this command the standard one,
+% which \cs{pltomtx} calls. (UV\&LH)}
+% \changes{1.917}{2001/03/13}{Added resetting of
+% \cs{setsomething_global}---assignments made here must be
+% local. (LH)}
+% \changes{1.923}{2002/12/03}{Changed test of fourth argument to
+% instead of \cs{ifx} use \cs{if}. This is more versatile. (LH)}
+% \begin{macrocode}
+\def\generalpltomtx#1#2#3#4{{
+ \let\setsomething_global=\x_relax
+ \let\setfontdimen=\pl_setfontdimen
+ \if _#4_ \else
+ \def\do_slot{\x_cs\let{name-\the\slot_number}\slot_name}
+ \def\do_boundary{\x_cs\let{name-BOUNDARYCHAR}\slot_name}
+ \inputetx{#4}
+ \let\CODINGSCHEME=\ignore_parens
+ \fi
+ \pl_to_mtx{#1}{#2}{#3}{\string\generalpltomtx{#1}{#2}{#3}{#4}}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pltomtx}
+% \begin{macrocode}
+\def\pltomtx#1#2{\generalpltomtx{#1}{#2}{pl}{}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\pl_to_mtx}
+% \changes{1.911}{1999/11/19}{\cs{edef}ing \cs{raw_font_name}. (LH)}
+% The |\pl_to_mtx| macro contains all code that was common to
+% |\pltomtx| and |\general|\-|pltomtx| before the former was redefined
+% to a call of the latter. The structure of a call of |\pl_to_mtx| is
+% \begin{quote}
+% |\pl_to_mtx|\marg{plfile}\marg{mtxfile}\marg{plsuffix}\marg{call}
+% \end{quote}
+% \meta{call} is what should be written in the ``Created using:''
+% comment at the top of the MTX file written.
+% \changes{1.921}{2002/07/27}{\cs{fromvpl} in \cs{storemapdata} does
+% not have an argument. Fixed a bug that produced such an argument
+% anyway. (LH)}
+% \begin{macrocode}
+\def\pl_to_mtx#1#2#3#4{
+ \edef\raw_font_name{#1}
+ \open_out{\temp_prefix#2.mtx}
+ \out_line{\percent_char~Filename:~#2.mtx}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using:~#4}
+ \out_line{}
+ \out_line{\percent_char~This~file~contains~the~
+ information~of~#1.#3~in~a~form}
+ \out_line{\percent_char~more~easily~read~by~TeX.~
+ It~is~used~by~the~fontinst~package.}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~CAN~BE~DELETED.}
+ \out_line{}
+ \out_line{\string\relax}
+ \out_line{\string\metrics}
+ \out_line{}
+ \out_line{\string\needsfontinstversion{\fontinstversion}}
+ \out_line{}
+ \lowercase{
+ \record_transform{#2}{
+ \string\from#3 \x_cs\ifx{from#3}\frompl {#1} \fi
+ }{}\iftrue
+ }
+ \out_line{}
+ \catcode`\(=0 \catcode`\)=9
+ \let\/=\ignore_parens
+ \let\do_pl_glyph=\x_relax
+ \primitiveinput #1.#3\x_relax
+ \do_pl_glyph
+ \out_line{}
+ \ifisint{\percent_char boundarychar}\then
+ \f_count=\int{\percent_char boundarychar}
+ \x_cs\ifx{name-\the\f_count}\x_relax \else
+ \out_line{\string\setstr{rightboundary}
+ {\csname name-\the\f_count\endcsname}
+ }
+ \out_line{}
+ \fi
+ \fi
+ \out_line{\endmetrics_text}
+ \close_out{Metrics}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% To parse a |.pl| file, we first make |(| the escape character, make |)|
+% ignored, then define the various PL commands as \TeX\ control sequences.
+% We can ignore a parenthesis matched string by making |(| and |)| the
+% group delimiters, then gobbling them up.
+%
+% \begin{macrocode}
+\def\ignore_parens{\bgroup\catcode`(=1 \catcode`)=2 \x_relax
+ \expandafter\expandafter\expandafter\gobble_parens
+ \iftrue\expandafter{\else}\fi}
+\def\gobble_parens#1{\egroup}
+% \end{macrocode}
+%
+% \begin{macro}{\pl_real}
+% \begin{macro}{\pl_realer}
+% Convert a PL real to an AFM unit, assuming it contains a decimal point.
+% \begin{macrocode}
+\def\pl_real#1{\pl_realer(#1000)}
+\def\pl_realer(#1.#2#3#4#5){#1#2#3#4}
+% \end{macrocode}
+% \cs{pl_real} only works if the \texttt{DESIGNUNITS}
+% setting is at the default value 1. Luckily, this is what
+% \package{TFtoPL} and \package{VFtoVP} use in all (V)PL files they
+% create, so you can always get a (V)PL file that will work by
+% converting first to TFM (+\,VF) and then back again. As of v\,1.913,
+% that is also the value \package{fontinst} uses for all VPL files it
+% generates, so the problem isn't particularly important.
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\pl_rounded_real}
+% \changes{1.921}{2002/07/26}{Macro added and is used instead of
+% \cs{pl_real}. (LH)}
+% The |\pl_rounded_real| macro is like |\pl_realer| in that it converts
+% a PL unit containing a decimal point to an AFM unit. The difference
+% is (i) that it rounds the number rather than truncating it and (ii)
+% that it stores the result in |\result| rather than expanding to it.
+% Note that the actual real (character string) to convert must be
+% followed by at least four zeros for the conversion to work
+% correctly in all cases.
+% \begin{macrocode}
+\def\pl_rounded_real(#1.#2#3#4#5){
+ \global\result=#1#2#3#4\relax
+ \ifnum \first_char#5= >4
+ \global\advance \result
+ \if - \first_char#1= \m@ne \else \@ne \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\pl_int}
+% Convert a PL int to a \TeX{} int, assuming it's prefixed
+% by |C|, |D|, |O|, or |H|.
+% \begin{macrocode}
+\def\pl_int#1#2{
+ \ifx#1C `#2
+ \else\ifx#1D #2
+ \else\ifx#1O '#2
+ \else\ifx#1H "#2
+ \else -1\errmessage{Unknown~PL~number~prefix~`#1'}
+ \fi\fi\fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Many of the PL commands are ignored, and I'm assuming the |R|s are in
+% the places \texttt{tftopl} puts them, which is a bit naughty of me.
+%
+% \begin{PLproperty}{FAMILY}
+% \begin{PLproperty}{FACE}
+% \begin{PLproperty}{CHECKSUM}
+% \begin{PLproperty}{HEADER}
+% \begin{PLproperty}{SEVENBITSAFEFLAG}
+% \begin{macrocode}
+\let\FAMILY=\ignore_parens
+\let\FACE=\ignore_parens
+\let\CHECKSUM=\ignore_parens
+\def\HEADER~#1~#2~#3~#4~{}
+\def\SEVENBITSAFEFLAG~#1~{}
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}\end{PLproperty}
+% \end{PLproperty}
+%
+% \begin{PLproperty}{COMMENT}
+% \begin{PLproperty}{LIG}
+% \begin{PLproperty}{NEXTLARGER}
+% \begin{PLproperty}{VARCHAR}
+% \begin{macrocode}
+\let\COMMENT=\ignore_parens
+\let\LIG=\ignore_parens
+\let\NEXTLARGER=\ignore_parens
+\let\VARCHAR=\ignore_parens
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}\end{PLproperty}
+%
+%
+% \begin{PLproperty}{VTITLE}
+% \begin{PLproperty}{MAPFONT}
+% \begin{PLproperty}{MAP}
+% \begin{flushleft}
+% ^^A Flushed left since the paragraph is so hard to break
+% ^^A correctly.
+% \changes{1.900}{1998/12/04}{VPL-specific properties added to
+% those which are ignored by \cs{pltomtx}. (LH)}
+% The properties which are unique for VPL files---|VTITLE|,
+% |MAPFONT|, |MAP|, |FONTNAME|, |FONTAREA|, |FONTCHECKSUM|,
+% |FONTAT|, |FONTDSIZE|, |SELECTFONT|, |SETCHAR|, |SETRULE|,
+% |MOVERIGHT|, |MOVELEFT|, |MOVEUP|, |MOVEDOWN|, |PUSH|, |POP|,
+% |SPECIAL|, and |SPECIALHEX|---should also be ignored, but it is
+% actually sufficient to ignore the first three since the others
+% are only allowed inside |MAP| or |MAPFONT| property lists.
+% \end{flushleft}
+%
+% \begin{macrocode}
+\let\VTITLE=\ignore_parens
+\let\MAPFONT=\ignore_parens
+\let\MAP=\ignore_parens
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}
+%
+%
+% \begin{PLproperty}{CODINGSCHEME}
+% \begin{macro}{\CODINGSCHEME_cont}
+% When we reach a |CODINGSCHEME| instruction, we read the coding string,
+% and read in the corresponding \meta{encoding}|.etx| file.
+%
+% The corresponding \meta{encoding} is specified by |\declareencoding|
+% statements (see below). Each |\declare_encoding| defines a macro
+% |\enc-|\meta{codingscheme} which expands to \meta{encoding}.
+%
+% If the PL file is converted using the |\generalpltomtx| command with
+% a nonempty \meta{opt-enc} argument then the |CODINGSCHEME| instruction
+% is ignored since an encoding file has already been read in.
+%
+% \begin{macrocode}
+\def\CODINGSCHEME{\bgroup\catcode`\)=12\x_relax\CODINGSCHEME_cont}
+\def\CODINGSCHEME_cont#1){
+ \egroup
+ \if_undefined{enc-#1}\then
+ \errhelp{The~encoding~for~`#1'~has~not~been~declared.^^J
+ You~should~declare~it~with~
+ \string\declareencoding{#1}{ETXFILE}.^^J
+ Press~<RETURN>~to~carry~on~with~fingers~crossed,^^J
+ or~X~<RETURN>~to~exit.}
+ \errmessage{Undeclared~encoding~`#1'}
+ \else
+ \def\do_slot{\x_cs\let{name-\the\slot_number}\slot_name}
+ \def\do_boundary{\x_cs\let{name-BOUNDARYCHAR}\slot_name}
+ \catcode`\(=12 \catcode`\)=12
+ \x_cs\inputetx{enc-#1}\x_relax
+ \catcode`\(=0 \catcode`\)=9
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{PLproperty}
+%
+% \begin{PLproperty}{DESIGNSIZE}
+% The |DESIGNSIZE| is needed because the |FONTDSIZE| specified in a
+% |MAPFONT| property list has to be the same as the |DESIGNSIZE| of
+% the corresponding base font.
+% \begin{macrocode}
+\def\DESIGNSIZE~#1~#2~{
+ \a_dimen=#2pt
+ \out_line{\string\setdim{designsize}{\the\a_dimen}}
+}
+% \end{macrocode}
+% \end{PLproperty}
+%
+% \begin{PLproperty}{DESIGNUNITS}
+% \changes{1.905}{1999/06/30}{Error message added. (LH)}
+% \changes{1.912}{2000/02/20}{Store designunits value in
+% \cs{b_dimen} rather than \cs{a_dimen}. \cs{a_dimen} holds the
+% design size throughout PL-to-MTX. (LH)}
+% The PL to MTX converter assumes that the (V)PL files to convert
+% look like the ones created by \texttt{TFtoPL}\slash\texttt{VFtoVP},
+% and the interpretation of the \texttt{DESIGNUNITS} property is one
+% thing specifically affected by this. The TFM file format does not
+% store the \texttt{DESIGNUNITS} value used, so the two above
+% programs always generate (V)PL files with the default setting of
+% design unit equal to the design size. Hence any occurence of the
+% \texttt{DESIGNUNITS} property with a nondefault value is an
+% indication of an error.
+%
+% The incorrect metrics can be corrected by scaling by a suitable
+% amount (1000 divided by the \texttt{designunits} dimen), but it is
+% much simpler to convert the PL to a TFM and then convert it back,
+% that will also fix the units.
+%
+% \begin{macrocode}
+\def\DESIGNUNITS~#1~#2~{
+ \b_dimen=#2pt\x_relax
+ \ifdim 1pt=\b_dimen \else
+ \fontinsterror{PL-to-MTX}{Nondefault~unit~used~in~PL~file}
+ {You~may~continue,~but~the~metrics~for~this~font~will~be~wrong.}
+ \fi
+ \out_line{\string\setdim{designunits}{\the\b_dimen}}
+}
+% \end{macrocode}
+% \end{PLproperty}
+%
+% \begin{PLproperty}{BOUNDARYCHAR}
+% \begin{macrocode}
+\def\BOUNDARYCHAR~#1~#2~{
+ \x_setint{\percent_char boundarychar}{\pl_int{#1}{#2}}
+}
+% \end{macrocode}
+% \end{PLproperty}
+%
+% \changes{1.917}{2001/03/16}{Rewrote the fontdimen part of the
+% (V)PL-to-MTX converter so that the ETX can specify the
+% fontdimens. (LH)}
+%
+% Declared fontdimens are converted to |\setint| commands in the MTX
+% file. A fontdimen declaration for fontdimen $n$ is stored in the
+% control sequence \describecsfamily{fdimen-\meta{n}}|\fdimen-|$n$; if
+% this control sequence is undefined then the fontdimen is not declared
+% and if it is set then it is a macro which expands to the name of the
+% corresponding integer variable.
+%
+% \begin{macro}{\pl_setfontdimen}
+% Fontdimens are declared by the |\pl_setfontdimen| macro, which is a
+% definition of |\setfontdimen| that is used during (V)PL-to-MTX
+% conversion.
+% \begin{macrocode}
+\def\pl_setfontdimen#1#2{\x_cs\def{fdimen-#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{PLproperty}{PARAMETER}
+% The |PARAMETER| property is the generic specifier of fontdimens in
+% (V)PL files. It takes two arguments: the fontdimen number (integer)
+% and value (real).
+% \begin{macrocode}
+\def\PARAMETER~#1~#2~R~#3~{
+ \f_count=\pl_int{#1}{#2}\x_relax
+ \if_defined{fdimen-\the\f_count}\then
+ \pl_rounded_real(#3 0000)
+ \out_line{\string\setint{\csname fdimen-\the\f_count\endcsname}
+ {\the\result}}
+ \fi
+}
+% \end{macrocode}
+% \end{PLproperty}
+%
+% \begin{PLproperty}{FONTDIMEN}
+% No special processing is required for the |FONTDIMEN| property.
+% \begin{macrocode}
+\let\FONTDIMEN=\x_relax
+% \end{macrocode}
+% \end{PLproperty}
+%
+% \begin{PLproperty}{SLANT}
+% \begin{PLproperty}{SPACE}
+% \begin{PLproperty}{STRETCH}
+% \begin{PLproperty}{SHRINK}
+% \begin{PLproperty}{XHEIGHT}
+% \begin{PLproperty}{QUAD}
+% \begin{PLproperty}{EXTRASPACE}
+% The properties for the seven mandatory fontdimens are converted
+% to the corresponding |PARAMETER| properties but their meanings are
+% predeclared. The effect of these predeclarations is that even ETX
+% files that don't use |\setfontdimen| to set the fontdimens have
+% these fontdimens converted to |\setint|s.
+%
+% A scan shows that the current (2001/03/17) MTX and ETX files aren't
+% using the integers \texttt{stretchword}, \texttt{shrinkword},
+% \texttt{quad}, and \texttt{extraspace}. They probably should.
+% \begin{macrocode}
+\def\SLANT{\PARAMETER D~1~}
+\pl_setfontdimen{1}{italicslant}
+\def\SPACE{\PARAMETER D~2~}
+\pl_setfontdimen{2}{interword}
+\def\STRETCH{\PARAMETER D~3~}
+\pl_setfontdimen{3}{stretchword}
+\def\SHRINK{\PARAMETER D~4~}
+\pl_setfontdimen{4}{shrinkword}
+\def\XHEIGHT{\PARAMETER D~5~}
+\pl_setfontdimen{5}{xheight}
+\def\QUAD{\PARAMETER D~6~}
+\pl_setfontdimen{6}{quad}
+\def\EXTRASPACE{\PARAMETER D~7~}
+\pl_setfontdimen{7}{extraspace}
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}\end{PLproperty}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}
+%
+% \begin{numPLproperty}{NUM}{1,2,3}
+% \begin{numPLproperty}{DENOM}{1,2}
+% The |NUM|$*$ and |DENOM|$*$ properties are for fontdimens 8--10
+% and 11--12. They have to do with positioning numerator and
+% denominator in fractions.
+% \begin{macrocode}
+\def\NUM#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~8~#2~#3~
+ \or
+ \PARAMETER D~9~#2~#3~
+ \or
+ \PARAMETER D~10~#2~#3~
+ \fi
+}
+\def\DENOM#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~11~#2~#3~
+ \or
+ \PARAMETER D~12~#2~#3~
+ \fi
+}
+% \end{macrocode}
+% \end{numPLproperty}\end{numPLproperty}
+%
+% \begin{numPLproperty}{SUP}{1,2,3}
+% \begin{numPLproperty}{SUB}{1,2}
+% The |SUP|$*$ and |SUB|$*$ properties are for fontdimens 13--15
+% and 16--17. They have to do with positioning superscripts and
+% subscripts.
+% \begin{macrocode}
+\def\SUP#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~13~#2~#3~
+ \or
+ \PARAMETER D~14~#2~#3~
+ \or
+ \PARAMETER D~15~#2~#3~
+ \fi
+}
+\def\SUB#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~16~#2~#3~
+ \or
+ \PARAMETER D~17~#2~#3~
+ \fi
+}
+% \end{macrocode}
+% \end{numPLproperty}\end{numPLproperty}
+%
+% \begin{PLproperty}{SUPDROP}
+% \begin{PLproperty}{SUBDROP}
+% \begin{PLproperty}{AXISHEIGHT}
+% These are fontdimens 18, 19, and 22.
+% \begin{macrocode}
+\def\SUPDROP{\PARAMETER D~18~}
+\def\SUBDROP{\PARAMETER D~19~}
+\def\AXISHEIGHT{\PARAMETER D~22~}
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}
+%
+% \begin{numPLproperty}{DELIM}{1,2}
+% The |DELIM|$*$ fondimens have number 20 and 21. They have to do with
+% the size of delimiters put around a generalised fraction.
+% \begin{macrocode}
+\def\DELIM#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~20~#2~#3~
+ \or
+ \PARAMETER D~21~#2~#3~
+ \fi
+}
+% \end{macrocode}
+% \end{numPLproperty}
+%
+% \begin{PLproperty}{DEFAULTRULETHICKNESS}
+% \begin{numPLproperty}{BIGOPSPACING}{1,2,3,4,5}
+% The fontdimen properties that are special for math extension fonts
+% are |DEFAULT|\-|RULE|\-|THICKNESS| and the various
+% |BIG|\-|OP|\-|SPACING|$*$.
+% \begin{macrocode}
+\def\DEFAULTRULETHICKNESS{\PARAMETER D~8~}
+\def\BIGOPSPACING#1~#2~#3~{
+ \ifcase #1\or
+ \PARAMETER D~9~#2~#3~
+ \or
+ \PARAMETER D~10~#2~#3~
+ \or
+ \PARAMETER D~11~#2~#3~
+ \or
+ \PARAMETER D~12~#2~#3~
+ \or
+ \PARAMETER D~13~#2~#3~
+ \fi
+}
+% \end{macrocode}
+% This is the old definition of |\DEFAULTRULETHICKNESS| for historical
+% references (since its behaviour has changed).
+% \begin{macrocode}
+% \def\DEFAULTRULETHICKNESS~R~#1~{
+% \out_line{\string\setint{underlinethickness}{\pl_real{#1}}}
+% }
+% \end{macrocode}
+% \end{numPLproperty}\end{PLproperty}
+%
+%
+% \begin{PLproperty}{LABEL}
+% \begin{macro}{\LABEL_slot}
+% \begin{macro}{\LABEL_boundarychar}
+% \begin{macro}{\do_if_defined}
+% The most complicated part of the processing of the |LIGTABLE|
+% property list is that it has to keep track of which glyphs the
+% current ligature\slash kerning program applies to. This stored as
+% a |\do|\marg{glyph} list in |\a_macro| and building this list
+% is the job of the |LABEL| property.
+%
+% It is assumed that |\do| is |\never_do| whenever some element is
+% added to |\a_macro|.
+% \begin{macrocode}
+\def\LABEL~#1{\ifx #1B
+ \expandafter\LABEL_boundarychar
+ \else
+ \expandafter\LABEL_slot \expandafter#1
+ \fi
+}
+\def\LABEL_slot #1~#2~{
+ \f_count=\pl_int{#1}{#2}
+ \edef\a_macro{\a_macro
+ \x_cs\do_if_defined{name-\the\f_count}
+ }
+}
+\def\LABEL_boundarychar OUNDARYCHAR{
+ \edef\a_macro{\a_macro
+ \x_cs\do_if_defined{name-BOUNDARYCHAR}
+ }
+}
+\def\do_if_defined#1{\ifx #1\x_relax \else \do{#1} \fi}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{PLproperty}
+%
+%
+% \begin{PLproperty}{LIGTABLE}
+% \begin{PLproperty}{STOP}
+% \begin{PLproperty}{SKIP}
+% The |LIGTABLE|, |STOP|, and |SKIP| properties are the remaining
+% properties involved in managing the |\a_macro| list. |SKIP|
+% properties are \emph{not} processed.
+% \begin{macrocode}
+\def\LIGTABLE{\let\do=\never_do\let\a_macro\empty_command}
+\def\STOP{\let\a_macro\empty_command}
+\def\SKIP~#1~#2~{\immediate\write16{Warning:~SKIP~instruction~ignored.}}
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}
+%
+% \begin{PLproperty}{KRN}
+% \begin{macro}{\write_pl_krn}
+% |KRN| properties are converted to |\setkern| instructions.
+% \begin{macrocode}
+\def\KRN~#1~#2~R~#3~{
+ \pl_rounded_real(#3 0000)
+ \edef\do{\noexpand\write_pl_krn{\pl_int{#1}{#2}}{\the\result}}
+ \a_macro
+ \let\do=\never_do
+}
+\def\write_pl_krn#1#2#3{
+ \f_count=#1\x_relax
+ \x_cs\ifx{name-\the\f_count}\x_relax \else
+ \out_line{\string\setkern{#3}
+ {\csname name-\the\f_count\endcsname}{#2}
+ }
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{PLproperty}
+%
+% \begin{PLproperty}{CHARACTER}
+% \begin{PLproperty}{CHARWD}
+% \begin{PLproperty}{CHARHT}
+% \begin{PLproperty}{CHARDP}
+% \begin{PLproperty}{CHARIC}
+% The character metrics that are processed are |CHARWD|, |CHARHT|,
+% |CHARDP|, and |CHARIC|. The |CHARACTER| property takes care of
+% writing the information to the MTX file, but note that each new
+% |CHARACTER| property writes the information from the preceeding
+% |CHARACTER| property.
+% \begin{macrocode}
+\def\CHARWD~R~#1~{\pl_rounded_real(#1 0000) \b_count=\result}
+\def\CHARHT~R~#1~{\pl_rounded_real(#1 0000) \c_count=\result}
+\def\CHARDP~R~#1~{\pl_rounded_real(#1 0000) \d_count=\result}
+\def\CHARIC~R~#1~{\pl_rounded_real(#1 0000) \e_count=\result}
+\def\CHARACTER~#1~#2~{
+ \do_pl_glyph
+ \a_count=\pl_int{#1}{#2}
+ \b_count=0
+ \c_count=0
+ \d_count=0
+ \e_count=0
+ \let\do_pl_glyph=\write_pl_glyph
+}
+% \end{macrocode}
+% \end{PLproperty}\end{PLproperty}\end{PLproperty}\end{PLproperty}
+% \end{PLproperty}
+%
+% \begin{macro}{\write_pl_glyph}
+% The |\write_pl_glyph| actually writes the information contained in
+% a |CHARACTER| property list to the MTX file as a |\setrawglyph|
+% command.
+% \begin{macrocode}
+\def\write_pl_glyph{
+ \x_cs\ifx{name-\the\a_count}\x_relax\else
+ \out_line{\string\setrawglyph
+ {\csname~name-\the\a_count\endcsname}
+ {\raw_font_name}
+ {\the\a_dimen}
+ {\the\a_count}
+ {\the\b_count}
+ {\the\c_count}
+ {\the\d_count}
+ {\the\e_count}}
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Converting an MTX file to a PL file}
+%
+% \DescribeMacro{\mtxtopl}
+% The macro
+% \begin{quote}
+% |\mtxtopl|\marg{mtxfile}\marg{plfile}
+% \end{quote}
+% writes a font from the |\setrawglyph| instructions in \meta{mtxfile}
+% to \meta{plfile}. It ignores any font dimensions and kerning, so the
+% resulting font is only useful for generating virtual fonts from.
+% (This macro is called by |\transformfont|.)
+%
+% \begin{macro}{\mtxtopl}
+% \changes{1.911}{1999/11/19}{Added `ligless' to one of the comment
+% lines. (LH) Clarification requested by Walter Schmidt.}
+% \changes{1.917}{2001/03/13}{Added resetting of
+% \cs{setsomething_global}---assignments made here must be
+% local. (LH)}
+% \begin{macrocode}
+\def\mtxtopl#1#2{{
+ \let\setsomething_global=\x_relax
+ \open_out{#2.pl}
+ \top_of_pl_hook
+ \out_line{(COMMENT~raw~font~#2~created~by~fontinst~
+ v\fontinstversion)}
+ \out_line{}
+ \out_line{(COMMENT~Filename:~#2.pl)}
+ \out_line{(COMMENT~Created~by:~tex~\jobname)}
+ \out_line{(COMMENT~Created~using:~\string\mtxtopl{#1}{#2})}
+ \out_line{}
+ \out_line{(COMMENT~This~file~can~be~turned~into~
+ a~ligless~TeX~font~with)}
+ \out_line{(COMMENT~pltotfm~#2.pl~#2.tfm)}
+ \out_line{}
+ \out_line{(COMMENT~THIS~FILE~CAN~THEN~BE~DELETED.)}
+ \out_line{}
+ \out_line{(DESIGNSIZE~R~10.0)}
+ \out_line{}
+ \let\setglyph=\iffalse
+ \let\endsetglyph=\fi
+ \let\setkern=\gobble_three
+ \let\setscaledrawglyph=\first_pl_raw_glyph
+ \def\setscalednotglyph##1##2##3##4##5##6##7##8##9{}
+ \inputmtx{#1}
+ \out_line{}
+ \out_line{(COMMENT~END~OF~FILE~#2.pl)}
+ \close_out{Raw~font}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\first_pl_raw_glyph}
+% The |\first_pl_raw_glyph| writes the \texttt{DESIGNUNITS} property
+% for the font when the first |\setscaledrawglyph| is encountered.
+% This is to undo the scaling that has already been applied to the
+% metrics, so that the metrics will match the actual font.
+% \begin{macrocode}
+\def\first_pl_raw_glyph#1#2#3#4{
+ \out_line{(DESIGNUNITS~R~\make_factor{#4})}
+ \let\setscaledrawglyph=\pl_raw_glyph
+ \pl_raw_glyph{#1}{#2}{#3}{#4}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pl_raw_glyph}
+% \begin{macrocode}
+\def\pl_raw_glyph#1#2#3#4#5#6#7#8#9{
+ \out_line{(CHARACTER~D~\number#5~\space(COMMENT~#1)}
+ \out_lline{(CHARWD~R~\make_factor{#6})}
+ \out_lline{(CHARHT~R~\make_factor{#7})}
+ \out_lline{(CHARDP~R~\make_factor{#8})}
+ \out_lline{(CHARIC~R~\make_factor{#9})}
+ \out_lline{)}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Font transformations}
+% \label{Sec:Font.trans}
+% \changes{1.902}{1999/05/01}{Moved Section \thesection\space to
+% \texttt{ficonv.dtx}. (LH)}
+%
+% \subsection{Transformable metric files}
+% \label{Ssec:TransMTX}
+%
+% \changes{1.901}{1999/02/28}{Definition of transformable metric file
+% added. (LH)}
+% \changes{1.913}{2000/03/10}{Definition of transformable metric file
+% changed to include the \cs{setscaledrawglyph} and
+% \cs{setscalednotglyph} commands. (LH)}
+% \changes{1.915}{2000/09/09}{Added description of \cs{aliased} macro
+% to the definition of transformable metric files. (LH)}
+% A \emph{transformable metric file} is a metric file
+% which complies with certain restrictions in its syntax. The only
+% metric commands allowed are
+% \begin{isyntax}
+% |\setscaledrawglyph|\marg{glyph}\marg{font}\marg{size}^^A
+% \marg{scale}\marg{slot}\marg{width}\penalty0
+% \marg{height}\penalty0\marg{depth}\penalty0\marg{italic}\\
+% |\setrawglyph|\marg{glyph}\marg{font}\marg{size}\marg{slot}^^A
+% \marg{width}\marg{height}\penalty0\marg{depth}\penalty0
+% \marg{italic}\\
+% |\setscalednotglyph|\marg{glyph}\marg{font}\marg{size}^^A
+% \marg{scale}\marg{slot}\marg{width}\penalty0
+% \marg{height}\penalty0\marg{depth}\penalty0\marg{italic}\\
+% |\setnotglyph|\marg{glyph}\marg{font}\marg{size}\marg{slot}^^A
+% \marg{width}\marg{height}\penalty0\marg{depth}\penalty0
+% \marg{italic}\\
+% |\setkern|\marg{glyph1}\marg{glyph2}\marg{amount}\\
+% |\setglyph|\marg{glyph} \meta{glyph commands} |\endsetglyph|
+% \end{isyntax}
+% where \meta{glyph}, \meta{glyph1}, \meta{glyph2}, and \meta{font} are
+% strings without any variable references (no |\str| or |\strint| are
+% allowed), \meta{scale}, \meta{slot}, \meta{width}, \meta{height},
+% \meta{depth}, \meta{italic}, and \meta{amount} are \TeX\ numbers, and
+% \meta{size} is a \TeX\ dimen. (More accurately, all dimens in a
+% transformable metric file should be on the form \meta{optional
+% signs}\penalty0 \meta{decimal constant}\penalty0 \meta{physical unit},
+% but that's at the ``dangerous bend'' level.) The \meta{glyph}s may be
+% of the form
+% \begin{quote}
+% |\aliased|\marg{font's name}\marg{alias name}
+% \end{quote}
+% Such \meta{glyph}s are interpreted as \meta{alias name} for all
+% purposes except reencoding, when they are interpreted as \meta{font's
+% name}. \meta{glyph}s of this form are furthermore copied as they are
+% to MTX files created by |\transform|\-|font| (|\mtxtomtx|).
+%
+% The only \meta{glyph commands} allowed are
+% \begin{quote}
+% |\samesize|\marg{glyph}\\
+% |\glyphpcc|\marg{glyph}\marg{xoffset}\marg{yoffset}
+% \end{quote}
+% where \meta{glyph} is as above, and \meta{xoffset} and \meta{yoffset}
+% are \TeX\ numbers.
+%
+% The only general commands allowed are
+% \begin{quote}
+% |\needsfontinstversion|\marg{version}\\
+% |\setint|\marg{name}\marg{number}\\
+% |\setdim|\marg{name}\marg{dimen}\\
+% |\setstr|\marg{name}\marg{string}\\
+% |\storemapdata|\marg{font}\marg{source}\marg{transformations}
+% \end{quote}
+% where \meta{name} and \meta{string} are strings without variable
+% references, \meta{number} is a \TeX\ number, and \meta{dimen} is a
+% \TeX\ dimen. The arguments of |\needs|\-|fontinst|\-|version| and
+% |\store|\-|map|\-|data| are as usual, but these commands do not get
+% copied in a font transformation.
+%
+% The metric files produced by |\afmtomtx| and |\generalpltomtx| are
+% meant to be transformable. If they are not then there is a bug
+% somewhere.
+%
+% The name of the integer in |\setint| commands is interpreted. This
+% name is used to determine how the number should be transformed, see
+% the implementation of |\mtxtomtx_setint| below.
+%
+%
+% \subsection{Making font transformations}
+%
+% \changes{1.911}{1999/11/19}{Recording of transformations moved to the
+% macros that actually write the MTX files. (LH)}
+% \changes{1.911}{1999/11/19}{Flag for that source font wasn't found
+% changed to \texttt{afm-name}. \texttt{transform-source} string
+% completely removed. (LH)}
+% \changes{1.913}{2000/03/11}{New implementation of \cs{scalefont} and
+% \cs{yscalefont}, using the new \cs{setscaledrawglyph} and
+% \cs{setscalednotglyph} commands. (LH)}
+% \changes{1.913}{2000/03/12}{Using \cs{slots-}\meta{glyph} control
+% sequences for storing encoding positions of glyphs in reencoded
+% fonts. (LH)}
+%
+% \DescribeMacro{\transformfont}
+% The macro:
+% \begin{quote}
+% |\transformfont|\marg{font-name}\marg{transformed font}
+% \end{quote}
+% transforms the metrics of a raw font. As far as \TeX\ is concerned,
+% \meta{font-name} will be a new font. Actually doing the
+% transformation and providing the transformed font (as opposed to the
+% metrics of the transformed font) is for most transforms up to some
+% other piece of software, in most cases the DVI driver, but
+% \package{fontinst} will handle isotropic scaling itself.
+%
+% The easiest way to find out which transformations need to be carried
+% out is to generate a map file for the \texttt{debug} ``driver'' (see
+% Section~\ref{Sec:Mapfiles}). Of course, if \package{fontinst} can
+% generate a mapfile for the target driver then you probably don't need
+% to find out which transformations were necessary\,\textellipsis
+% \spacefactor=\sfcode`\.\space\space
+% In any case, the arguments of |\storemapdata| in the MTX file
+% generated will tell which transformations of this |\transformfont|
+% command that must be performed by some other software.
+%
+% \DescribeMacro{\fromafm}
+% \DescribeMacro{\frommtx}
+% \DescribeMacro{\frompl}
+% \DescribeMacro{\scalefont}
+% \DescribeMacro{\xscalefont}
+% \DescribeMacro{\yscalefont}
+% \DescribeMacro{\slantfont}
+% \DescribeMacro{\reencodefont}
+% The \meta{transformed font} commands are:
+% \begin{quote}
+% |\fromafm|\marg{AFM file}\\
+% |\frompl|\marg{PL file}\\
+% |\fromplgivenetx|\marg{PL file}\marg{etx}\\
+% |\frommtx|\marg{MTX file}\\
+% |\fromany|\marg{file}\\
+% |\scalefont|\marg{integer expression}\marg{transformed font}\\
+% |\xscalefont|\marg{integer expression}\marg{transformed font}\\
+% |\yscalefont|\marg{integer expression}\marg{transformed font}\\
+% |\slantfont|\marg{integer expression}\marg{transformed font}\\
+% |\reencodefont|\marg{etx}\marg{transformed font}
+% \end{quote}
+%
+% Each |\transformfont| command generates an |.mtx| file for
+% \meta{font-name} and a corresponding raw |.pl| file, which is written
+% out by |\mtxtopl|.
+%
+% Each |\fromafm|, |\frompl|, or |\fromplgivenetx| command also generates
+% an |.mtx| file for the source font, which is written out by |\afmtomtx|
+% or |\generalpltomtx|. In addition, |\fromafm| also uses |\mtxtopl|
+% to generate a corresponding raw |.pl| file.
+%
+% |\fromany| reads an MTX, PL, AFM, or VPL file depending on what it can
+% find. It tries them in the order first MTX, then PL, then AFM, and
+% last VPL.
+%
+% \begin{macro}{\transformfont}
+% \changes{1.912}{2000/01/15}{Added local resetting of
+% \cs{setsomething_global} to \cs{relax}, since \cs{transformfont}
+% assumes such assignments are local. (LH)}
+% \begin{macrocode}
+\def\transformfont#1#2{{
+ \let\setsomething_global=\x_relax
+ \unsetstr{afm-name}
+ \unsetstr{etx-name}
+ \x_resetint{x-scale}{\one_thousand}
+ \x_resetint{y-scale}{\one_thousand}
+ \x_resetint{slant-scale}{0}
+ #2
+% \end{macrocode}
+% \changes{1.903}{1999/06/01}{Added behaviour for the case source file
+% not found. (LH)}
+% \changes{1.921}{2002/07/31}{Corrected an error message that tried
+% to use a variable that wasn't set! (LH)}
+% \begin{macrocode}
+ \ifisstr{afm-name}\then
+ \mtxtomtx{\str{afm-name}}{#1}
+ \mtxtopl{#1}{#1}
+ \else
+ \fontinsterror{Transformfont}{
+ Failed~to~make~transformed~font~#1;\messagebreak
+ source~font~metrics~file~not~found
+ }\error_help_a
+ \fi
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fromafm}
+% \changes{1.904}{1999/06/17}{Added call of \cs{record_transform}. (LH)}
+% \changes{1.911}{1999/11/19}{Added test for file existence. (LH)}
+% \begin{macrocode}
+\def\fromafm#1{
+ \if_file_exists{#1.afm}\then
+ \x_setstr{afm-name}{#1}
+ \afmtomtx{#1}{#1}
+ \mtxtopl{#1}{#1}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\frommtx}
+% \changes{1.911}{1999/11/19}{Added test for file existence. (LH)}
+% \begin{macrocode}
+\def\frommtx#1{
+ \if_file_exists{#1.mtx}\then \x_setstr{afm-name}{#1} \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frompl}
+% \changes{1.904}{1999/06/17}{Added call of \cs{record_transform}. (LH)}
+% \changes{1.911}{1999/11/19}{Added test for file existence. (LH)}
+% \begin{macro}{\fromplgivenetx}
+% \changes{1.902}{1999/05/02}{Command added. (LH)}
+% \changes{1.904}{1999/06/17}{Added call of \cs{record_transform}. (LH)}
+% \changes{1.911}{1999/11/19}{Added test for file existence. (LH)}
+% \begin{macrocode}
+\def\frompl#1{
+ \if_file_exists{#1.pl}\then
+ \x_setstr{afm-name}{#1}
+ \generalpltomtx{#1}{#1}{pl}{}
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\fromplgivenetx#1#2{
+ \if_file_exists{#1.pl}\then
+ \x_setstr{afm-name}{#1}
+ \generalpltomtx{#1}{#1}{pl}{#2}
+ \fi
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \multchanges{\cs{fromvpl}\cs{fromvplgivenetx}}{1.902}{1999/05/02}
+% {Commands added. (LH)}
+% \multchanges{\cs{fromvpl}\cs{fromvplgivenetx}}{1.904}{1999/06/16}
+% {Commands removed. (LH)}
+% Regarding \cs{fromvpl} and \cs{fromvplgivenetx}: I realized that
+% there isn't any point in reading metrics for a font that is to be
+% transformed from a VPL file, since no driver I know of can transform
+% virtual fonts. If someone has a problem with this then I suppose he
+% or she should send word about it. /LH
+%
+%
+% \begin{macro}{\fromany}
+% \changes{1.903}{1999/05/20}{Command added. (LH) Based on a
+% suggestion by Vladimir Volovich.}
+% \changes{1.903}{1999/06/01}{Added behaviour for AFM not found case.
+% (LH)}
+% \changes{1.904}{1999/06/16}{Added search for VPL file and calls to
+% \cs{record_transform}. (LH)}
+% \changes{1.923}{2002/12/03}{Added \cs{pl_encoding}. (LH)}
+% \changes{1.926}{2003/07/10}{Removed \cs{pl_encoding}; it is better
+% to provide that functionality in a separate macro. (LH)}
+% \changes{1.926}{2003/07/10}{Has to reset the \texttt{afm-name}
+% string, since \cs{input_mtx_file} now uses the value. (LH)}
+% The |\fromany| transformed font command searches for font metrics
+% for \#1 by looking for, in turn, the files \#1|.mtx|, \#1|.pl|,
+% \#1|.afm|, and \#1|.vpl|. If an MTX file doesn't exist, it is
+% generated, and if the MTX is generated from an AFM then a
+% corresponding (non-ligful) PL file is generated as well. |\fromany|
+% also sets the fontinst string \texttt{afm-name} according
+% to what kind of font it found. If none of the fonts existed then
+% |afm-name| is unset.
+% \begin{macrocode}
+\def\fromany#1{
+ \x_cs\edef{s-afm-name}{#1}
+ \if_file_exists{#1.mtx}\then\else
+% \end{macrocode}
+%
+% \changes{1.6}{1997/01/15}{Search order changed to PL before AFM.
+% (SPQR) The code wasn't in \cs{fromany} back then, though.}
+% 1997/01/15 SPQR changed the below search order to |.pl| before |.afm|
+% because of the |cmr*.afm| files found in the |TEXMF|\slash
+% |fonts|\slash|afm| hierarchy.
+% \begin{macrocode}
+ \if_file_exists{#1.pl}\then
+ \generalpltomtx{#1}{#1}{pl}{}
+ \else
+ \if_file_exists{#1.afm}\then
+ \afmtomtx{#1}{#1}
+ \mtxtopl{#1}{#1}
+ \else
+ \if_file_exists{#1.vpl}\then
+ \generalpltomtx{#1}{#1}{vpl}{}
+ \else
+ \unsetstr{afm-name}
+ \fi\fi\fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection*{The mathematical basis for the metric font transformations}
+%
+% Mathematically, all the metric font transformations (|\scale|\-|font|,
+% |\xscale|\-|font|, |\yscale|\-|font|, and |\slant|\-|font|) are linear
+% mappings of the real plane onto itself. All quantities in a
+% transformable metric file are interpreted as being determined by some
+% point in this plane and hence their transformation depends on how that
+% point would be moved by the metric font transformations performed.
+% This is usually simpler than it sounds, since all quantities except
+% |italicslant| are interpreted as either the $x$- or the $y$-coordinate
+% of some point. |italicslant| is interpreted as the quotient
+% $\frac{x}{y}$ for a point.
+%
+% The best way to describe a linear mapping of the real plane to itself
+% is by a \(2 \times 2\) matrix whose components are real numbers. Since
+% true real numbers are not available in \TeX, integers are used instead,
+% with the convention that they are in units of thousandths. In a
+% concrete form this means that $0$ represents $0$, $500$ represents
+% $\frac{1}{2}$, $1000$ represents $1$, etc. This works just as for the
+% scaling factors used in |\scale|. It also means that the matrix
+% $$
+% \left(\begin{array}{cc} 1000 & 0 \\ 0 & 1000 \end{array}\right)
+% $$
+% represents the identity mapping (the mapping taking everything to
+% itself).
+%
+% Thinking of points as column vectors (\(2 \times 1\) matrices) with
+% the $x$-coordinate in the first component and the $y$-coordinate in
+% the second, the respective elementary metric font transformations
+% correspond to the following matrices:
+% \begin{eqnarray*}
+% \mbox{\cs{scalefont}\marg{n}} & \mbox{is} &
+% \left( \begin{array}{cc}
+% \mbox{\meta{n}}& 0 \\
+% 0 & \mbox{\meta{n}}
+% \end{array} \right) \\
+% \mbox{\cs{xscalefont}\marg{n}} & \mbox{is} &
+% \left( \begin{array}{cc}
+% \mbox{\meta{n}}& 0 \\
+% 0 & 1000
+% \end{array} \right) \\
+% \mbox{\cs{yscalefont}\marg{n}} & \mbox{is} &
+% \left( \begin{array}{cc}
+% 1000 & 0 \\
+% 0 & \mbox{\meta{n}}
+% \end{array} \right) \\
+% \mbox{\cs{slantfont}\marg{n}} & \mbox{is} &
+% \left( \begin{array}{cc}
+% 1000 & \mbox{\meta{n}} \\
+% 0 & 1000
+% \end{array} \right)
+% \end{eqnarray*}
+% Since all these matrices are upper triangular, all products of such
+% matrices (corresponding to compositions of the linear mappings) will be
+% upper triangular as well. It is therefore unnecessary to store the
+% subdiagonal component anywhere (it is always zero), and hence
+% \package{fontinst} represents an arbitrary metric transform by the
+% matrix
+% $$
+% \left( \begin{array}{cc}
+% \mbox{\texttt{x-scale}} & \mbox{\texttt{slant-scale}} \\
+% 0 & \mbox{\texttt{y-scale}}
+% \end{array} \right)
+% $$
+% where \texttt{x-scale}, \texttt{y-scale}, and \texttt{slant-scale}
+% are fontinst integers.
+%
+% The reason there is a representation of arbitrary metric transforms
+% is that all the elementary metric transforms listed in the second
+% argument of |\transformfont| are concatenated before the actual font
+% file conversion is made. This reduces the amount of calculations
+% performed in case there are many transformations of the font.
+%
+% Why do we only consider transformations that correspond to upper
+% triangular matrices? Well, a transformation corresponds to an upper
+% triangular matrix if and only if it leaves horizontal lines horizontal.
+% Since in particular the baseline must always be horizontal in \TeX,
+% there is no point in considering other linear transformations.
+%
+% \begin{macro}{\scalefont}
+% \begin{macro}{\xscalefont}
+% \begin{macro}{\yscalefont}
+% \begin{macro}{\slantfont}
+% \begin{macro}{\reencodefont}
+% \begin{macrocode}
+\def\scalefont#1#2{
+ \eval_expr_to\d_count{#1}
+ \x_resetint{x-scale}{\scale{\d_count}{\int{x-scale}}}
+ \x_resetint{y-scale}{\scale{\d_count}{\int{y-scale}}}
+ \x_resetint{slant-scale}{\scale{\d_count}{\int{slant-scale}}}
+ #2
+}
+\def\xscalefont#1#2{
+ \x_resetint{x-scale}{\scale{#1}{\int{x-scale}}}
+ #2
+}
+\def\yscalefont#1#2{
+ \eval_expr_to\d_count{#1}
+ \x_resetint{y-scale}{\scale{\d_count}{\int{y-scale}}}
+ \x_resetint{slant-scale}{\scale{\d_count}{\int{slant-scale}}}
+ #2
+}
+\def\slantfont#1#2{
+ \x_resetint{slant-scale}{
+ \add{\scale{#1}{\int{x-scale}}}{\int{slant-scale}}
+ }
+ #2
+}
+\def\reencodefont#1#2{
+ #2
+ \resetstr{etx-name}{#1}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% That's only half the story, however. It is true that the transformation
+% matrix, as computed by |\scalefont|, |\slantfont|, |\xscalefont|, and
+% |\yscalefont| above, is used for transforming the font metrics, but it
+% is not directly used for transforming the font itself. Instead it is
+% factorized as
+% $$
+% \left( \begin{array}{cc}
+% x & s \\ 0 & y
+% \end{array} \right) =
+% y \left( \begin{array}{cc}
+% x/y & s/y \\ 0 & 1
+% \end{array} \right)
+% $$
+% Here the scalar factor $y$ will be used to scale the \meta{scale}
+% argument of |\set|\-|scaled|\-|raw|\-|glyph| and
+% |\set|\-|scaled|\-|not|\-|glyph| commands, whereas the matrix
+% factor will be put in the third argument of |\store|\-|map|\-|data|
+% in the MTX file written. Thus \package{fontinst} will handle the
+% scalar factor of the transformation itself, but leave the matrix
+% factor for some other software to take care of.
+%
+% \bigskip
+%
+%
+% \DescribeMacro{\mtxtomtx}
+% The macro:
+% \begin{quote}
+% |\mtxtomtx|\marg{source MTX}\marg{destination MTX}
+% \end{quote}
+% converts the first |.mtx| file to the second, using the current values
+% of |\int{x-scale}|, |\int{y-scale}|, |\int{slant-scale}|, and
+% |\str{etx-name}|.
+%
+% NOTE: this doesn't convert arbitrary |.mtx| files, just the
+% transformable ones.
+%
+% \begin{macro}{\mtxtomtx}
+% \changes{1.911}{1999/11/19}{\cs{edef}ing \cs{raw_font_name}. (LH)}
+% \changes{1.915}{2000/09/09}{Locally redefining \cs{aliased}. (LH)}
+% \changes{1.924}{2003/02/08}{Added \cs{directfalse}. (LH)}
+% \begin{macrocode}
+\def\mtxtomtx#1#2{{
+ \ifisstr{etx-name}\then
+ \def\do_slot{\x_cs\edef{slots-\slot_name}{\the\slot_number}}
+ \directfalse
+ \inputetx{\str{etx-name}}
+ \edef\a_macro{\string\reencodefont{\str{etx-name}}}
+ \else
+ \let\a_macro=\empty_command
+ \fi
+ \_a_true
+ \ifnum \int{x-scale}=\int{y-scale}
+ \ifnum \int{slant-scale}=\z@
+ \_a_false
+ \fi \fi
+ \if_a_
+ \a_count=\int{x-scale}
+ \l_inv_scale\a_count{\int{y-scale}}
+ \b_count=\int{slant-scale}
+ \l_inv_scale\b_count{\int{y-scale}}
+ \edef\a_macro{\a_macro
+ \string\transformfont{\the\a_count}{\the\b_count}
+ }
+ \fi
+ \open_out{\temp_prefix#2.mtx}
+ \edef\raw_font_name{#2}
+ \out_line{\percent_char~Filename:~#2.mtx}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using:~\string\mtxtomtx{#1}{#2}}
+ \out_line{}
+ \out_line{\percent_char~This~file~is~used~by~the~fontinst~package.}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~CAN~BE~DELETED.}
+ \out_line{}
+ \out_line{\string\relax}
+ \out_line{\string\metrics}
+ \out_line{}
+ \out_line{\string\needsfontinstversion{\fontinstversion}}
+ \out_line{}
+ \record_transform{#2}{\string\frommtx{#1}}{\a_macro}\iftrue
+ \out_line{}
+ \mtxtomtx_redefinitions
+ \inputmtx{#1}
+ \out_line{}
+ \out_line{\endmetrics_text}
+ \close_out{Transformed~metrics}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mtxtomtx_redefinitions}
+% This macro serves as a hook. One can make additional commands
+% transformable by appending suitable redefenitions of them to this
+% macro.
+% \changes{1.927}{2003/12/08}{Macro added. The code used to be in
+% \cs{mtxtomtx}. (LH)}
+% \begin{macrocode}
+\def\mtxtomtx_redefinitions{
+ \let\setint=\mtxtomtx_setint
+ \let\setdim=\mtxtomtx_setdim
+ \let\setstr=\mtxtomtx_setstr
+ \let\setscaledrawglyph=\mtxtomtx_setscaledrawglyph
+ \let\setscalednotglyph=\mtxtomtx_setscaledrawglyph
+ \let\setkern=\mtxtomtx_setkern
+ \let\setglyph=\mtxtomtx_setglyph
+ \let\glyphpcc=\mtxtomtx_glyphpcc
+ \let\samesize=\mtxtomtx_samesize
+ \let\endsetglyph=\mtxtomtx_endsetglyph
+ \def\aliased{\string\aliased}
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\aliased}
+% \changes{1.915}{2000/09/09}{Macro added. (LH)}
+% The |\aliased| macro has the syntax
+% \begin{quote}
+% |\aliased|\marg{font's name}\marg{alias name}
+% \end{quote}
+% This normally expands to \meta{alias name}, but in |\mtxtomtx| it
+% normally expands to
+% \begin{quote}
+% |\string\aliased|\marg{font's name}\marg{alias name}
+% \end{quote}
+% and when |\mtxtomtx_setscaledrawglyph| is reencoding it uses
+% \meta{font's name} to determine the new slot position.
+% \begin{macrocode}
+%<pkg|misc>\let\aliased=\second_of_two
+%<doc>\let\aliased=\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mtxtomtx_setint}
+% \changes{1.917}{2001/03/24}{Redefined to allow an extensible list
+% \cs{width_ints_list} of integers that should be transformed as
+% widths. (LH)}
+% \begin{macro}{\italicslant_name}
+% \begin{macro}{\width_ints_list}
+% \changes{1.917}{2001/03/24}{Macro added. \cs{verticalstem_name}
+% removed. (LH)}
+% Most integers are transformed as if they are the $y$-coordinates of
+% some points, but |italicslant| and the integers in the
+% |\width_ints_list| are treated differently. |italicslant| is
+% interpreted as the quotient $\frac{x}{y}$ for a point $(x,y)$, but
+% represented as a real number (i.e., the \TeX\ number is really a
+% thousand times the actual quotient). The integers in the
+% |\width_ints_list| are transformed as if they are the
+% $x$-coordinates of some points on the baseline.
+%
+% The |\width_ints_list| macro is an ordinary |\do|-type list where
+% each |\do| has precisely one argument. These arguments are the names
+% of the integers which should be transformed as widths. Elements can
+% be added to the list using the |\add_to| macro.
+%
+% The test for whether a specific integer is in the |\width_ints_list|
+% exploits that |\if_true| and |\if_false| only matter in |\if|--|\fi|
+% matching after they have been expanded, whereas
+% |\gobble_one|\,|\iftrue| only matters before it is expanded.
+% \begin{macrocode}
+%<*pkg>
+\def\mtxtomtx_setint#1#2{
+ \def\a_macro{#1}
+ \ifx \a_macro\italicslant_name
+ \eval_expr{#2}
+ \global\multiply \result \int{x-scale}
+ \a_count=\int{slant-scale}
+ \multiply \a_count \one_thousand
+ \advance \a_count \result
+ \divide \a_count \int{y-scale}\x_relax
+ \else
+ \def\do##1{
+ \def\b_macro{##1}
+ \ifx \a_macro\b_macro \expandafter\if_false \fi
+ }
+ \gobble_one\iftrue \width_ints_list \if_true
+ \eval_expr_to\a_count{\scale{#2}{\int{y-scale}}}
+ \else
+ \eval_expr_to\a_count{\scale{#2}{\int{x-scale}}}
+ \fi
+ \fi
+ \out_line{\string\setint{#1}{\the\a_count}}
+}
+\def\italicslant_name{italicslant}
+\def\width_ints_list{
+ \do{interword}\do{stretchword}\do{shrinkword}\do{quad}
+ \do{extraspace}\do{digitwidth}\do{verticalstem}
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\mtxtomtx_setdim}
+% \begin{macro}{\mtxtomtx_setstr}
+% Strings and dimens are not affected by the |\mtxtomtx| transforms.
+% \begin{macrocode}
+\def\mtxtomtx_setdim#1#2{
+ \out_line{\string\setdim{#1}{#2}}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\mtxtomtx_setstr#1#2{
+ \out_line{\string\setstr{#1}{#2}}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\mtxtomtx_setscaledrawglyph}
+% \changes{1.915}{2000/09/09}{Added local redefinition of
+% \cs{aliased}. (LH)}
+% |#6| (the width) is transformed as the $x$-coordinate of a point on
+% the baseline. |#7| and |#8| (the height and depth respectively) are
+% transformed as $y$-coordinates. The depth should probably really have
+% been transformed as the negative of a $y$-coordinate, but it comes
+% out the same in the end anyway. |#9| (the italic correction) is
+% transformed as the $x$-coordinate of a point whose $y$-coordinate
+% equals the height of the character. |#4| (the scaling) is
+% transformed as a $y$-coordinate.
+%
+% If the italic slant of the font is negative then the italic
+% correction should possibly be transformed as the $x$-coordinate of
+% a point whose $y$-coordinate equals the negative of the depth
+% instead (as that is the part of the box that is sticking out to the
+% right), but it is hard to say for sure how that case should be
+% treated.
+%
+% \begin{macrocode}
+\def\mtxtomtx_setscaledrawglyph#1#2#3#4#5#6#7#8#9{
+ \eval_expr_to\a_count{\scale{#6}{\int{x-scale}}}
+ \eval_expr_to\b_count{\scale{#7}{\int{y-scale}}}
+ \eval_expr_to\c_count{\scale{#8}{\int{y-scale}}}
+ \eval_expr_to\d_count{#9} \eval_expr{#7}
+ \multiply \d_count \int{x-scale}
+ \global\multiply \result \int{slant-scale}
+ \global\advance \result \d_count
+ \rounded_thousandths
+ \d_count=\result
+ \eval_expr{\scale{#4}{\int{y-scale}}}
+ \ifisstr{etx-name}\then
+ \bgroup
+ \let\aliased=\first_of_two
+ \if_undefined{slots-#1}\then
+ \egroup \e_count=\m@ne
+ \else
+ \expandafter\egroup \expandafter\e_count
+ \csname slots-#1\endcsname
+ \fi
+ \else
+ \e_count=#5
+ \fi
+ \out_line{
+ \ifnum \e_count>\m@ne
+ \string\setscaledrawglyph
+ \else
+ \string\setscalednotglyph
+ \fi
+ {#1}{\raw_font_name}{#3}{\the\result}{\the\e_count}
+ {\the\a_count}{\the\b_count}{\the\c_count}{\the\d_count}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mtxtomtx_setkern}
+% Kerns are transformed as the $x$-coordinate of a point on the
+% baseline.
+%
+% \begin{macrocode}
+\def\mtxtomtx_setkern#1#2#3{
+ \eval_expr{\scale{\int{x-scale}}{#3}}
+ \out_line{\string\setkern{#1}{#2}{\the\result}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mtxtomtx_setglyph}
+% \begin{macro}{\mtxtomtx_samesize}
+% \begin{macro}{\mtxtomtx_endsetglyph}
+% \begin{macrocode}
+\def\mtxtomtx_setglyph#1{\out_line{\string\setglyph{#1}}}
+\def\mtxtomtx_samesize#1{\out_lline{\string\samesize{#1}}}
+\def\mtxtomtx_endsetglyph{\out_line{\string\endsetglyph}}
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+% \begin{macro}{\mtxtomtx_glyphpcc}
+% |#2| is transformed as the $x$-coordinate and |#3| is transformed
+% as the $y$-coordinate of a point---the same point for both
+% parameters.
+%
+% \begin{macrocode}
+\def\mtxtomtx_glyphpcc#1#2#3{
+ \eval_expr_to\b_count{\scale{\int{y-scale}}{#3}}
+ \eval_expr_to\a_count{#2} \eval_expr{#3}
+ \multiply \a_count \int{x-scale}
+ \global\multiply \result \int{slant-scale}
+ \global\advance \result \a_count
+ \rounded_thousandths
+ \out_lline{\string\glyphpcc{#1}{\the\result}{\the\b_count}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Changing glyph names}
+% \label{Ssec:Reglyph}
+%
+% \package{fontinst} uses names to identify glyphs, and if for example
+% the font in question is a postscript font, then names will also be used
+% to identify glyphs in the printer. Between those two points however,
+% and in particular inside \TeX\ itself, glyphs are represented with
+% numbers (slots). Therefore there is no real need for the glyph names
+% used within \package{fontinst} and the glyph names used in the printer
+% (the names gotten from the AFM file) to be equal, but they usually are.
+% There are some cases though where the glyph names of a font are
+% unsuitable for use with \package{fontinst}---mainly because
+% \package{fontinst} can mix glyphs from different printer fonts---and
+% therefore \package{fontinst} also offers the ability to automatically
+% change the names of glyphs in transformable metric files.
+%
+% \begin{macro}{\reglyphfonts}
+% \changes{1.912}{2000/01/15}{Added local resetting of
+% \cs{setsomething_global} to \cs{relax}. It shouldn't be needed,
+% since \cs{reglyphfonts} should not occur between \cs{installfonts}
+% and \cs{endinstallfonts}, but I bet someone will try. (LH)}
+% \begin{macro}{\endreglyphfonts}
+% \begin{quote}
+% |\reglyphfonts| \meta{reglyphing commands} |\endreglyphfonts|
+% \end{quote}
+% \begin{macrocode}
+\def\reglyphfonts{
+ \begingroup
+ \let\setsomething_global=\x_relax
+ \x_setint{renameweight}{1}
+ \x_setint{killweight}{-10}
+ \setcommand\iftokeep##1\then{\ifnum -1<##1}
+}
+\def\endreglyphfonts{\endgroup}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% The \meta{reglyphing commands} are
+% \begin{quote}
+% |\renameglyph|\marg{to}\marg{from}\\
+% |\renameglyphweighted|\marg{to}\marg{from}\marg{weight}\\
+% |\killglyph|\marg{glyph}\\
+% |\killglyphweighted|\marg{glyph}\marg{weight}\\
+% |\offmtxcommand|\marg{command}\\
+% |\onmtxcommand|\marg{command}\\
+% |\reglyphfont|\marg{destination font}\marg{source font}
+% \end{quote}
+% The only reglyphing command that actually convert the names of any
+% glyphs is \DescribeMacro{\reglyphfont}|\reglyph|\-|font|; it reads a font
+% \meta{source font} (which may be of type MTX, PL, AFM, or VPL) and
+% writes another font \meta{destination font} in which the names of
+% glyphs have been converted. All the other commands control \emph{how}
+% this conversion should be made, and these settings get cleared at the
+% closing |\endreglyphfonts|.
+%
+% The conversion works in two ways. First of all, the names of the
+% glyphs can be changed. This works as a general mapping and is
+% controlled by the \DescribeMacro{\renameglyph}|\renameglyph| and
+% \DescribeMacro{\renameglyphweighted}|\renameglyphweighted|
+% commands. Any mensioning of the glyph \meta{from} in a command will be
+% converted to a mensioning of the glyph \meta{to}, if that command
+% survives the conversion. The other way the conversion works is that it
+% can selectively kill---refrain from including in \meta{destination
+% font}---commands in the metric file. This part weighs in several
+% factors.
+%
+% For one thing, one can specify that all metric commands of a certain
+% type should be killed, and this is done with the
+% \DescribeMacro{\offmtxcommand}|\offmtxcommand| command. For example,
+% one can see to that all kerning commands are killed by
+% \begin{quote}
+% |\offmtxcommand{\setkern}|
+% \end{quote}
+% The effect is the same as that of saying
+% \begin{quote}
+% |offkern,|\meta{destination font}|,onkern|
+% \end{quote}
+% rather than just \meta{destination font} in the second argument to
+% |\installfont|, but it is somewhat faster since less text is written
+% to and subsequently read from the \meta{destination font}|.mtx| file.
+% The effect of a previous |\offmtxcommand| can be canceled by a call to
+% \DescribeMacro{\onmtxcommand}|\onmtxcommand|, just like with
+% |\offcommand| and |\oncommand|.
+%
+% The survivance of a command is also affected by the glyphs it refers to.
+% Each glyph has a \emph{weight} associated with it and the sum of the
+% weights for all glyphs mensioned by a command is also used to decide
+% whether that command should survive. The test here is performed by the
+% macro \DescribeMacro{\iftokeep}|\iftokeep|, whose parameter text
+% must be |#1\then|, where |#1| will be a |\count| register. This
+% macro must eventually expand to an if of some sort and that if
+% evaluating to true is interpreted as that the command should be kept.
+% The default replacement text is |\ifnum -1<#1|, which causes a command
+% to be killed (not kept) iff the sum of weights for it is negative.
+%
+% The weight of a glyph is set by |\rename|\-|glyph|,
+% |\rename|\-|glyph|\-|weighted|,
+% \DescribeMacro{\killglyph}|\kill|\-|glyph|, and
+% \DescribeMacro{\killglyphweighted}|\kill|\-|glyph|\-|weighted|. The
+% |\rename|\textellipsis\ commands also set a new name for the glyph if
+% it survives, whereas the |\kill|\textellipsis\ commands will keep the
+% old name. Since the standard settings are that a
+% |\rename|\textellipsis\ weight is small and positive and a
+% |\kill|\textellipsis\ weight is large and negative, glyphs for which
+% a |\kill|\textellipsis\ has been done will usually not survive.
+%
+% Any one of |\rename|\-|glyph|, |\rename|\-|glyph|\-|weighted|,
+% |\kill|\-|glyph|, and |\kill|\-|glyph|\-|weighted| for a glyph will
+% override all previous settings
+% by any of these four commands for that glyph. The equivalent of the
+% neutral state for a glyph (no settings by any of these commands have
+% been made for that glyph) is achieved by the command
+% \begin{quote}
+% |\killglyphweighted|\marg{glyph}|{0}|
+% \end{quote}
+%
+%
+% \begin{macro}{\offmtxcommand}
+% \begin{macro}{\onmtxcommand}
+% These two are just special forms of |\offcommand| and |\oncommand|.
+% \begin{macrocode}
+\def\offmtxcommand#1{
+ \x_cs\offcommand{reglyph_\expandafter\gobble_one\string#1}
+}
+\def\onmtxcommand#1{
+ \x_cs\oncommand{reglyph_\expandafter\gobble_one\string#1}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \describecsfamily{slots-\meta{glyph}}Inside a |\reglyphfonts|
+% \textellipsis\ |\endreglyphfonts| block, the family
+% |\slots-|\meta{glyph} of control sequences is used to store the
+% information about how glyph \meta{glyph} should be converted. These
+% control sequences are either undefined or parameterless macros
+% whose replacement texts are of one of the forms
+% \begin{quote}
+% |\rename_glyph|\marg{to}\marg{weight}\\
+% |\rename_glyph|\marg{to}|\i-renameweight|\\
+% |\kill_glyph|\marg{weight}\\
+% |\kill_glyph\i-killweight|
+% \end{quote}
+% \meta{to} is what the glyph will be renamed to and \meta{weight} is
+% the associated weight. These four different forms are generated by
+% the four different commands |\renameglyphweighted|, |\renameglyph|,
+% |\killglyphweighted|, and |\killglyph| respectively.
+%
+% \begin{macro}{\renameglyph}
+% \begin{macro}{\renameglyphweighted}
+% The difference between the commands |\renameglyphweighted| and
+% |\renameglyph| is that the former lets one specify the weight exactly
+% while the latter will use the value of the integer |renameweight|
+% \emph{at the time of conversion}. By changing the value of
+% |renameweight| between two conversions, one changes the weights
+% used for all glyph renamings declared using |\renameglyph|.
+% \begin{macrocode}
+\begingroup
+ \catcode`\-=11
+ \gdef\renameglyph#1#2{
+ \x_cs\edef{slots-#2}{
+ \noexpand\rename_glyph{#1}\noexpand\i-renameweight
+ }
+ }
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\def\renameglyphweighted#1#2#3{
+ \eval_expr{#3}
+ \x_cs\edef{slots-#2}{\noexpand\rename_glyph{#1}{\the\result}}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\killglyph}
+% \begin{macro}{\killglyphweighted}
+% The difference between the commands |\killglyphweighted| and
+% |\killglyph| is that the former lets one specify the weight exactly
+% while the latter will use the value of the integer |killweight|
+% \emph{at the time of conversion}. By changing the value of
+% |killweight| between two conversions, one changes the weights
+% used for all glyph killings declared using |\killglyph|.
+% \begin{macrocode}
+\begingroup
+ \catcode`\-=11
+ \gdef\killglyph#1{
+ \x_cs\def{slots-#1}{\kill_glyph\i-killweight}
+ }
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\def\killglyphweighted#1#2{
+ \eval_expr{#2}
+ \x_cs\edef{slots-#1}{\noexpand\kill_glyph{\the\result}}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\reglyphfont}
+% The command
+% \begin{quote}
+% |\reglyphfont|\marg{destination font}\marg{source font}
+% \end{quote}
+% reads the font metric file \meta{source font}|.mtx| (which must be
+% transformable), \meta{source font}|.pl|, or \meta{source font}|.afm|
+% (the possibilities are tried in that order) and writes out a font
+% metric file \meta{destination font}|.mtx| that is the converted (as
+% described above) form of the source font.
+%
+% \meta{destination font} and \meta{source font} may not be equal.
+% \changes{1.903}{1999/06/01}{Using \cs{fromany} for locating font.
+% (LH)}
+% \changes{1.904}{1999/06/16}{Added \cs{record_transform}. (LH)}
+% \begin{macrocode}
+\def\reglyphfont#1#2{
+ \fromany{#2}
+ \ifisstr{afm-name}\then
+ \reglyph_font{#1}{#2}
+ \else
+ \fontinsterror{Reglyph}{Could~not~find~font~metrics~for~#2.}
+ \error_help_a
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\reglyph_font}
+% This macro does the actual conversion.
+% \begin{macrocode}
+\def\reglyph_font#1#2{{
+ \open_out{\temp_prefix#1.mtx}
+ \out_line{\percent_char~Filename:~#1.mtx}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using:~\string\reglyphfont{#1}{#2}}
+ \out_line{}
+ \out_line{\percent_char~This~file~is~used~by~the~fontinst~package.}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~CAN~BE~DELETED.}
+ \out_line{}
+ \out_line{\string\relax}
+ \out_line{\string\metrics}
+ \out_line{}
+ \out_line{\string\needsfontinstversion{\fontinstversion}}
+ \out_line{}
+ \record_transform{#1}{\string\frommtx{#2}}{\string\reglyphfont}
+ \iftrue
+ \out_line{}
+ \reglyph_redefinitions
+ \inputmtx{#2}
+ \out_line{}
+ \out_line{\endmetrics_text}
+ \close_out{Reglyphed~metrics}
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\reglyph_redefinitions}
+% This macro serves as a hook. One can make additional commands
+% transformable by appending suitable redefenitions of them to this
+% macro.
+% \changes{1.927}{2003/12/08}{Macro added. The code used to be in
+% \cs{reglyph_font}. (LH)}
+% \begin{macrocode}
+\def\reglyph_redefinitions{
+ \let\setint=\reglyph_setint
+ \let\setdim=\reglyph_setdim
+ \let\setstr=\reglyph_setstr
+ \let\setscaledrawglyph=\reglyph_setscaledrawglyph
+ \let\setscalednotglyph=\reglyph_setscaledrawglyph
+ \let\setkern=\reglyph_setkern
+ \let\setglyph=\reglyph_setglyph
+ \let\glyphpcc=\reglyph_glyphpcc
+ \let\samesize=\reglyph_samesize
+ \let\endsetglyph=\reglyph_endsetglyph
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\reglyph_setint}
+% \begin{macro}{\reglyph_setdim}
+% \begin{macro}{\reglyph_setstr}
+% These are just copied to the file generated.
+% \begin{macrocode}
+\def\reglyph_setint#1#2{\out_line{\string\setint{#1}{#2}}}
+\def\reglyph_setdim#1#2{\out_line{\string\setdim{#1}{#2}}}
+\def\reglyph_setstr#1#2{\out_line{\string\setstr{#1}{#2}}}
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+% \begin{macro}{\command_survivance}
+% This |\count| register stores the sum of the weights associated
+% with the glyphs considered so far. It is updated by |\rename_glyph|
+% and |\kill_glyph|.
+% \begin{macrocode}
+\newcount\command_survivance
+% \end{macrocode}
+% \end{macro}
+%
+% The macro \DescribeMacro{\glyphname}|\glyphname| holds the name of
+% the glyph currently under consideration. It is altered by
+% |\rename_glyph|.
+%
+% \begin{macro}{\rename_glyph}
+% \begin{macro}{\kill_glyph}
+% \begin{macrocode}
+\def\rename_glyph#1{\def\glyphname{#1}\kill_glyph}
+\def\kill_glyph#1{\advance \command_survivance #1\x_relax}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\reglyph_setscaledrawglyph}
+% \changes{1.915}{2000/06/25}{Corrected bug in the \cs{ifnum}: it
+% should test argument \#5, not \#4. (LH) Encountered by Thierry
+% Bouche.}
+% The |\reglyph_|\-|setscaled|\-|rawglyph| macro is straightforward.
+% Whether it writes a |\setscaled|\-|rawglyph| or a |\setscaled|\-^^A
+% |notglyph| command depends on the fifth parameter, just like with
+% |\mtxtomtx_|\-|setscaled|\-|rawglyph|.
+% \begin{macrocode}
+\def\reglyph_setscaledrawglyph#1#2#3#4#5#6#7#8#9{
+ \command_survivance=0
+ \def\glyphname{#1}
+ \csname slots-#1\endcsname
+ \iftokeep\command_survivance\then
+ \out_line{
+ \ifnum #5<\z@
+ \string\setscalednotglyph
+ \else
+ \string\setscaledrawglyph
+ \fi
+ {\glyphname}{#2}{#3}{\number#4}{#5}{#6}{#7}{#8}{#9}
+ }
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\reglyph_setkern}
+% \begin{macrocode}
+\def\reglyph_setkern#1#2#3{
+ \command_survivance=0
+ \def\glyphname{#1}
+ \csname slots-#1\endcsname
+ \let\a_macro=\glyphname
+ \def\glyphname{#2}
+ \csname slots-#2\endcsname
+ \iftokeep\command_survivance\then
+ \out_line{\string\setkern{\a_macro}{\glyphname}{#3}}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\reglyph_setglyph}
+% \multchanges{\cs{reglyph_glyphpcc}\cs{reglyph_samesize}^^A
+% \cs{reglyph_setglyph}}{1.911}{1999/12/10}{\cs{string}
+% which should be \cs{noexpand} corrected. (LH) Reported by
+% Rolf Lindgren.}
+% \begin{macro}{\off-\reglyph_setglyph}
+% \begin{macro}{\reglyph_glyphpcc}
+% \changes{1.911}{1999/12/10}{Typo corrected. (LH) Spotted by Rolf
+% Lindgren.}
+% \begin{macro}{\reglyph_samesize}
+% \begin{macro}{\reglyph_endsetglyph}
+% In |\setglyph| \textellipsis\ |\endsetglyph| constructions (which
+% are written for composite characters in AFM files), the decision of
+% whether to write a command or not due to glyph weights is done
+% only once for the entire construction. This means that the commands
+% must be saved until the |\endsetglyph| where the result is finally
+% known. The token list register |\a_toks| is used for this purpose.
+% \begin{macrocode}
+\def\reglyph_setglyph#1{
+ \command_survivance=0
+ \def\glyphname{#1}
+ \csname slots-#1\endcsname
+ \edef\a_macro{\noexpand\out_line{\string\setglyph{\glyphname}}}
+ \a_toks=\expandafter{\a_macro}
+}
+\x_cs\def{off-\string\reglyph_setglyph}#1{\gobble_glyph}
+% \end{macrocode}
+% \begin{macrocode}
+\def\reglyph_glyphpcc#1#2#3{
+ \def\glyphname{#1}
+ \csname slots-#1\endcsname
+ \edef\a_macro{\noexpand\out_lline{
+ \string\glyphpcc{\glyphname}{#2}{#3}
+ }}
+ \a_toks=\expandafter{\the\expandafter\a_toks \a_macro}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\reglyph_samesize#1{
+ \def\glyphname{#1}
+ \csname slots-#1\endcsname
+ \edef\a_macro{\noexpand\out_lline{
+ \string\samesize{\glyphname}
+ }}
+ \a_toks=\expandafter{\the\expandafter\a_toks \a_macro}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\reglyph_endsetglyph{
+ \iftokeep\command_survivance\then
+ \the\a_toks
+ \out_line{\string\endsetglyph}
+ \fi
+ \a_toks={}
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+%
+%
+% \subsubsection*{Three common reglyphing schemes}
+%
+% As is mensioned elsewhere, the most common reglyphing operation is to
+% take a caps and small caps font produced by some major foundry and
+% change the glyph names so that they agree with the glyph names used in
+% expert fonts. The following code contains the modifying reglyphing
+% commands to set up this reglyphing, in two different variants.
+%
+% The commands are currently based on a comparision of Adobe Garamond
+% Small Caps \& Oldstyle Figures (\texttt{padrc8a} in the Berry
+% scheme) with Adobe Garamond Regular Expert (\texttt{padr8x} in the
+% Berry scheme), so they should be correct for a fair amount of Adobe
+% font families, but it is also highly probable that there are lots of
+% fonts out there for which it doesn't work quite right. In case you do
+% find such a font, please write to tell the \package{fontinst} mailing
+% list about it---it would be rather easy to add various alternative
+% set-up schemes, controlled by switches, to these files. Just make sure
+% first (by checking the newest version of \package{fontinst}) that the
+% alternative setting you have found hasn't already been included.
+%
+% As mentioned, there are two different reglyphing schemes that are set
+% up by the code below---one has \package{docstrip} guard \Module{glyphs},
+% the other has guard \Module{!glyphs}---but they both change SC names
+% to Expert names. The difference lies instead in what information is
+% copied from source font to destination font: the \Module{glyphs}
+% variant copies everything, whereas the \Module{!glyphs} variant
+% doesn't copy |\setrawglyph| commands, |\setnotglyph| commands,
+% |\setscaledrawglyph| commands, |\setscalednotglyph| commands or
+% |\setglyph| constructions. The \Module{!glyphs} variant also
+% suppresses kerns between two glyphs that doesn't change name.
+%
+% The motive for having such a curious set-up naturally lies in how the
+% files are meant to be used. If you have SC fonts, but no Expert
+% fonts, then you should definitely use the \Module{glyphs} variant. If
+% on the other hand you have both SC and Expert fonts for a family,
+% then it is worth considering using the \Module{!glyphs} variant instead.
+% The observation this is based on is that within a triad of the
+% corresponding regular, expert, and SC fonts, almost all glyphs present
+% in the SC font can also be found in either the regular or the expert
+% font; furthermore the only missing glyphs were \texttt{FIsmall},
+% \texttt{FLsmall}, and \texttt{SSsmall}, which (i) were included in the
+% SC font only to complete the \texttt{8a} encoding vector and (ii) are
+% identical to \package{fontinst}'s fakes for them.
+%
+% Thus by constructing the \texttt{sc} shape fonts from the regular and
+% expert variants, instead of the SC variant, one can get away with
+% using one raw font less, thus reducing the time needed for downloading
+% the fonts to the printer and the size of the corresponding postscript
+% file. One thing not found in either of the regular or expert font in
+% the triad is however the kerns between capitals and small capitals, but
+% these can be extracted from the metrics of the SC font, and doing this
+% is the primary objective for the \Module{!glyphs} variant.
+%
+% \bigskip
+% \changes{1.906}{1999/08/01}{Reglyphing settings files added. (LH)}
+%
+% First there is the English alphabet:
+% \begin{macrocode}
+%<*reglyphletters>
+\renameglyph{Asmall}{a}
+\renameglyph{Bsmall}{b}
+\renameglyph{Csmall}{c}
+\renameglyph{Dsmall}{d}
+\renameglyph{Esmall}{e}
+\renameglyph{Fsmall}{f}
+\renameglyph{Gsmall}{g}
+\renameglyph{Hsmall}{h}
+\renameglyph{Ismall}{i}
+\renameglyph{Jsmall}{j}
+\renameglyph{Ksmall}{k}
+\renameglyph{Lsmall}{l}
+\renameglyph{Msmall}{m}
+\renameglyph{Nsmall}{n}
+\renameglyph{Osmall}{o}
+\renameglyph{Psmall}{p}
+\renameglyph{Qsmall}{q}
+\renameglyph{Rsmall}{r}
+\renameglyph{Ssmall}{s}
+\renameglyph{Tsmall}{t}
+\renameglyph{Usmall}{u}
+\renameglyph{Vsmall}{v}
+\renameglyph{Wsmall}{w}
+\renameglyph{Xsmall}{x}
+\renameglyph{Ysmall}{y}
+\renameglyph{Zsmall}{z}
+%</reglyphletters>
+% \end{macrocode}
+%
+% Then there are the figures:
+% \multchanges{\notcs{Reglyphing}}{1.911}{1999/12/10}
+% {\texttt{eightoldstyle} typo corrected. (LH) Spotted by
+% Rolf Lindgren.}
+% \multchanges{\notcs{Reglyphing}}{1.927}{2004/07/12}
+% {Placed commands for letters and figures in separate modules,
+% so that they can be separated in generation. (LH)}
+% \begin{macrocode}
+%<*reglyphfigures>
+\renameglyph{zerooldstyle}{zero}
+\renameglyph{oneoldstyle}{one}
+\renameglyph{twooldstyle}{two}
+\renameglyph{threeoldstyle}{three}
+\renameglyph{fouroldstyle}{four}
+\renameglyph{fiveoldstyle}{five}
+\renameglyph{sixoldstyle}{six}
+\renameglyph{sevenoldstyle}{seven}
+\renameglyph{eightoldstyle}{eight}
+\renameglyph{nineoldstyle}{nine}
+%</reglyphfigures>
+% \end{macrocode}
+%
+% Then there are the accents and a couple of miscellaneous symbols. You
+% might want to check these carefully, as there might not always be a
+% distinction.
+% \changes{1.925}{2003/05/13}{Added \cs{renameglyph} for
+% \texttt{Hungarumlautsmall}. Walter Schmidt noticed it was missing.
+% (LH)}
+% \begin{macrocode}
+%<*reglyphletters>
+\renameglyph{Acutesmall}{acute}
+\renameglyph{Brevesmall}{breve}
+\renameglyph{Caronsmall}{caron}
+\renameglyph{Cedillasmall}{cedilla}
+\renameglyph{Circumflexsmall}{circumflex}
+\renameglyph{Dieresissmall}{dieresis}
+\renameglyph{Dotaccentsmall}{dotaccent}
+\renameglyph{Gravesmall}{grave}
+\renameglyph{Hungarumlautsmall}{hungarumlaut}
+\renameglyph{Macronsmall}{macron}
+\renameglyph{Ogoneksmall}{ogonek}
+\renameglyph{Ringsmall}{ring}
+\renameglyph{Tildesmall}{tilde}
+\renameglyph{ampersandsmall}{ampersand}
+\renameglyph{centoldstyle}{cent}
+\renameglyph{dollaroldstyle}{dollar}
+% \end{macrocode}
+%
+% There are also all the non-English letters:
+% \begin{macrocode}
+\renameglyph{AEsmall}{ae}
+\renameglyph{Ethsmall}{eth}
+\renameglyph{Lslashsmall}{lslash}
+\renameglyph{Oslashsmall}{oslash}
+\renameglyph{OEsmall}{oe}
+\renameglyph{Thornsmall}{thorn}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Agravesmall}{agrave}
+\renameglyph{Egravesmall}{egrave}
+\renameglyph{Igravesmall}{igrave}
+\renameglyph{Ogravesmall}{ograve}
+\renameglyph{Ugravesmall}{ugrave}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Aacutesmall}{aacute}
+\renameglyph{Eacutesmall}{eacute}
+\renameglyph{Iacutesmall}{iacute}
+\renameglyph{Oacutesmall}{oacute}
+\renameglyph{Uacutesmall}{uacute}
+\renameglyph{Yacutesmall}{yacute}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Acircumflexsmall}{acircumflex}
+\renameglyph{Ecircumflexsmall}{ecircumflex}
+\renameglyph{Icircumflexsmall}{icircumflex}
+\renameglyph{Ocircumflexsmall}{ocircumflex}
+\renameglyph{Ucircumflexsmall}{ucircumflex}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Atildesmall}{atilde}
+\renameglyph{Ntildesmall}{ntilde}
+\renameglyph{Otildesmall}{otilde}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Adieresissmall}{adieresis}
+\renameglyph{Edieresissmall}{edieresis}
+\renameglyph{Idieresissmall}{idieresis}
+\renameglyph{Odieresissmall}{odieresis}
+\renameglyph{Ydieresissmall}{ydieresis}
+\renameglyph{Udieresissmall}{udieresis}
+% \end{macrocode}
+% \begin{macrocode}
+\renameglyph{Aringsmall}{aring}
+\renameglyph{Ccedillasmall}{ccedilla}
+\renameglyph{Scaronsmall}{scaron}
+\renameglyph{Zcaronsmall}{zcaron}
+% \end{macrocode}
+%
+% The following four glyphs aren't really necessary, since they are
+% usually identical to another glyph or to their fakes.
+% \begin{macrocode}
+\killglyph{dotlessi}
+%<*glyphs>
+\renameglyph{FIsmall}{fi}
+\renameglyph{FLsmall}{fl}
+\renameglyph{SSsmall}{germandbls}
+%</glyphs>
+%<*!glyphs>
+\killglyph{fi}
+\killglyph{fl}
+\killglyph{germandbls}
+%</!glyphs>
+%</reglyphletters>
+% \end{macrocode}
+%
+% The \Module{!glyphs} settings have no need for |\setrawglyph|,
+% |\setscaledrawglyph|, or |\setglyph| commands, and no need for the
+% kerns between capitals either, since these are already known from the
+% regular variant. Note that it is pointless to say |\offmtxcommand|^^A
+% \penalty0|\setrawglyph| as of v\,1.913 since |\setrawglyph| is now
+% simply syntactic sugar for the equivalent |\set|\-|scaled|\-|raw|\-^^A
+% |glyph|.
+% \begin{macrocode}
+%<*(reglyphletters|reglyphfigures)&!glyphs>
+\offmtxcommand\setscaledrawglyph
+\offmtxcommand\setglyph
+\resetcommand\iftokeep#1\then{\ifnum 0<#1}
+%</(reglyphletters|reglyphfigures)&!glyphs>
+% \end{macrocode}
+%
+%
+% \changes{1.904}{1999/06/13}{Font transformation recordings moved to
+% \texttt{fimapgen.dtx}, so that the interface will be specified
+% in a single place. (LH)}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/fontinst/base/filtfam.dtx b/Master/texmf-dist/source/fontinst/base/filtfam.dtx
new file mode 100644
index 00000000000..1cfcf6c1f00
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/filtfam.dtx
@@ -0,0 +1,1187 @@
+% \CheckSum{1041}
+% \iffalse meta-comment
+%
+% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+% hacked and maintained 1997, 1998 Sebastian Rahtz,
+% copyright 1998, 1999 the fontinst maintenance team and any individual
+% authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.0 or, at your option, any later version.
+%
+%%% From file: filtfam.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fisource}
+\GetFileInfo{filtfam.dtx}
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth}
+\begin{document}
+\maketitle
+\DocInput{filtfam.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \section{Installing Latin families}
+%
+% \changes{1.800}{1998/06/22}{\cs{textcompfamily} integrated into
+% \cs{latinfamily}. (UV)}
+%
+% \begin{macro}{\latinfamily}
+% The macro:
+% \begin{quote}
+% |\latinfamily|\marg{family}\marg{commands}
+% \end{quote}
+% installs a Latin font family.
+%
+% \StopEventually{}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\latinfamily#1#2{{
+ \edef\a_macro{#1}
+ \expandafter\parse_family\a_macro
+ \empty_command\empty_command\end_parse_family
+ \installfonts
+ \if_file_exists{\raw_encoding.mtx}\then
+ \installfamily{\raw_encoding}{\latex_family}{#2}
+ \fi
+ \installfamily{OT1}{\latex_family}{#2}
+ \installfamily{T1}{\latex_family}{#2}
+%<*textcomp>
+ \installfamily{TS1}{\latex_family}{#2}
+%</textcomp>
+ \latin_weights
+ \endinstallfonts
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parse_family}
+% \begin{macro}{\font_family}
+% \begin{macro}{\font_variant}
+% \begin{macro}{\raw_variant}
+% \begin{macro}{\latex_variant}
+% |\parse_family FAMILY\end_parse_family|
+%
+% Intializes |\latex_family| to |FAMILY|, |\font_family| to first
+% three characters of |FAMILY|, |\font_variant| and |\raw_variant|
+% to fourth and fifth character (if present).
+%
+% SPQR 02/95: If the fourth parameter is |x| or |9|, then its an expert
+% indication, not a variant. So initialy set |\raw_variant| to |#4|,
+% but unset it if the expert test succeeds. When |#4| is used for a
+% real variant, it passes through.
+%
+% SPQR 05/95: If it \emph{is} an expert font, then the variantness
+% is expressed by the encoding, not a variant letter, so unset
+% |\font_variant|.
+%
+% UV 06/98: Added |\if_oldstyle_| code from Alan's v~1.511 beta.
+% If the fourth parameter is |9|, treat it as if |j| was given.
+%
+% Note that instead of using |\setcommand\digit|, we now use separate
+% encoding files for |T1j.etx|, etc.
+%
+% \begin{macrocode}
+\def\parse_family #1#2#3#4#5\end_parse_family{
+ \gdef\font_family{#1#2#3}
+ \gdef\font_variant{#4#5}
+ \gdef\raw_variant{#4#5}
+ \gdef\latex_family{#1#2#3#4#5}
+ \_expert_false
+ \_oldstyle_false
+ \ifx#4x
+ \_expert_true
+ \gdef\raw_variant{#5}
+ \gdef\font_variant{#5}
+ %\setcommand\digit##1{##1}
+ \else\ifx#4j
+ \_expert_true
+ \_oldstyle_true
+ \gdef\raw_variant{#5}
+ \gdef\font_variant{#5}
+ %\setcommand\digit##1{##1oldstyle}
+ \else\ifx#49
+ \gdef\latex_family{#1#2#3j#5}
+ \_expert_true
+ \_oldstyle_true
+ \gdef\raw_variant{#5}
+ \gdef\font_variant{#5}
+ %\setcommand\digit##1{##1oldstyle}
+ \else
+ \_expert_false
+ \_oldstyle_false
+ %\setcommand\digit##1{##1}
+ \fi\fi\fi
+%<*debug>
+ \if_oldstyle_
+ \immediate\write16{INFO>~parse~family~<#1#2#3><#5>~(oldstyle)}
+ \else\if_expert_
+ \immediate\write16{INFO>~parse~family~<#1#2#3><#5>~(expert)}
+ \else
+ \immediate\write16{INFO>~parse~family~<#1#2#3><#4#5>}
+ \fi\fi
+%</debug>
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if_expert_}
+% \begin{macro}{\if_oldstyle_}
+% \begin{macrocode}
+\newif\if_expert_
+\newif\if_oldstyle_
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Processing a list of weights, widths and shapes}
+%
+% \begin{macro}{\latin_weight}
+% \begin{macro}{\font_weight}
+% \begin{macro}{\latex_weight}
+% |\latin_weight{FONTWEIGHT}{LATEXWEIGHT}|
+%
+% \begin{macrocode}
+\def\latin_weight#1#2{
+ \gdef\font_weight{#1}%
+ \gdef\latex_weight{#2}%
+ \latin_widths
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\latin_width}
+% \begin{macro}{\font_width}
+% \begin{macro}{\latex_width}
+% |\latin_width{FONTWIDTH}{LATEXWIDTH}|
+%
+% \begin{macrocode}
+\def\latin_width#1#2{
+ \gdef\font_width{#1}
+ \gdef\latex_width{#2}
+ \latin_shapes
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\latin_shape}
+% \begin{macro}{\font_shape}
+% \begin{macro}{\raw_shape}
+% \begin{macro}{\encoding_shape}
+% \begin{macro}{\latex_shape}
+% \begin{macro}{\encoding_switches}
+% |\latin_shape{FONTSHAPE}{RAWSHAPE}{ENCODINGSHAPE}{LATEXSHAPE}{SWITCHES}|
+%
+% Calls |\fake_width_WIDTH| and |\fake_shape_SHAPE| to generate an
+% |8r|-reencoded |.mtx| file. If successful, calls |\latin_encodings|.
+%
+% UV 06/98: Added a fifth argument |SWITCHES|, which may be used
+% to set |\if_textcomp_| before it is evaluated in |\latin_encodings|.
+%
+% \begin{macrocode}
+\def\latin_shape#1#2#3#4#5{
+ \gdef\font_shape{#1}
+ \gdef\raw_shape{#2}
+ \gdef\encoding_shape{#3}
+ \if_oldstyle_
+ \gdef\encoding_shape{#3\oldstyle_shape}
+ \fi
+ \gdef\latex_shape{#4}
+ \gdef\encoding_switches{#5}
+%<*debug>
+ \immediate\write16{
+ INFO>~to~make~LaTeX~font~shape~<\latex_family,
+ \latex_weight,\latex_shape,\latex_width>~seek~
+ \font_family\font_weight\raw_shape
+ \raw_variant\raw_encoding\font_width.mtx}
+%</debug>
+ \csname fake_width_\font_width\endcsname
+ \csname fake_shape_\raw_shape\endcsname
+ \if_file_exists{
+ \font_family\font_weight\raw_shape
+ \raw_variant\raw_encoding\font_width.mtx
+ }\then
+ \latin_encodings
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Faking font shapes}
+%
+% (CK) changed font faking code; based on SPQR's code (still in this
+% file). I am not sure that know what I am doing here; let's hope
+% I won't be caught. Also changed: Order of |\font_width| and
+% |\font_encoding| in MANY places. Also added tests which prevent
+% multiple calls to the same font faking routine. (Seems to be
+% necessary in some cases and can't hurt.) --- (ASAJ) I think CK
+% knows more about what he's doing than he's letting on.
+%
+% \begin{macro}{\fake_shape_}
+% Check if an |8a|-encoded |.afm| file exists for current combination
+% of font attributes, and, if so, call |\fake_shape_raw_encoding|.
+% For expert fonts, also check if an |8x|-encoded |.afm| file exists,
+% and call |\fake_shape_expert_encoding|, if approporiate.
+%
+% UV, 06/98: Cut down lengthy |\fake_shape_| routine into several
+% subroutines |\fake_shape_raw_encoding| and optionally
+% |\fake_shape_expert_encoding| and |\fake_shape_oldstyle_encoding|.
+%
+% UV, 06/98: Added experimental code to install OsF or SC\&OsF fonts.
+%
+% \begin{macrocode}
+\def\fake_shape_{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width.afm
+ }\then
+ \fake_shape_raw_encoding
+ \fi
+ \if_expert_
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \expert_encoding\font_width.afm
+ }\then
+ \fake_shape_expert_encoding
+ \fi
+ \fi
+%<*oldstyle>
+ \if_oldstyle_
+ \gdef\oldstyle_variant{\oldstyle_shape}
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \adobe_encoding\font_width.afm
+ }\then
+ \fake_shape_oldstyle_encoding
+ \else
+ \gdef\oldstyle_variant{\caps_shape}
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \adobe_encoding\font_width.afm
+ }\then
+ \fake_shape_oldstyle_encoding
+ \fi
+ \fi
+ \fi
+%</oldstyle>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_raw_encoding}
+% Called from |\fake_shape_| if an |8a|-encoded |.afm| file was found.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>8r}|\\
+% | {\reencodefont{8r}{\fromafm{<FONT>8a}}}|
+% \end{quote}
+% to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file),
+% followed by
+% \begin{quote}
+% |\installrawfont{<FONT>8r}{<FONT>8r,8r}{8r}...|
+% \end{quote}
+% to install a ligfull |.pl| file.
+%
+% \begin{macrocode}
+\def\fake_shape_raw_encoding{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width>~from~
+ <\font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width>
+ }
+%</debug>
+ \transformfont{
+ \font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width
+ }{
+ \reencodefont{\raw_encoding}{
+ \fromafm{
+ \font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width
+ }
+ }
+ }
+ \if_file_exists{ \raw_encoding.mtx }\then
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\installrawfont\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width>
+ <\font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding>
+ <\raw_encoding>
+ <\raw_encoding>
+ <\latex_family>
+ <\latex_weight\latex_width>
+ <\latex_shape>}
+%</debug>
+ \installrawfont{
+ \font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width
+ }{ \font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding
+ }{ \raw_encoding
+ }{ \raw_encoding
+ }{ \latex_family
+ }{ \latex_weight\latex_width
+ }{ \latex_shape
+ }{}
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_expert_encoding}
+% Called from |\fake_shape_| if an |8x|-encoded |.afm| file was found.
+% Invokes
+% \begin{quote}
+% |\fromafm{<FONT>8x}|
+% \end{quote}
+% to generate an |8x|-encoded |.mtx| file (and a raw |.pl| file).
+%
+% \begin{macrocode}
+\def\fake_shape_expert_encoding{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \expert_encoding\font_width.mtx
+ }\then % no action required
+ \else
+ \fromafm{
+ \font_family\font_weight\raw_shape\raw_variant
+ \expert_encoding\font_width
+ }
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_oldstyle_encoding}
+% Called from |\fake_shape_| if an OsF or SC\&OsF variant of an
+% |8a|-encoded |.afm| file was found. Invokes
+% \begin{quote}
+% |\transformfont{<FONT>j8r}|\\
+% | {\reencodefont{8r}{\fromafm{<FONT>j8a}}}|
+% \end{quote}
+% to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file).
+%
+% \begin{macrocode}
+%<*oldstyle>
+\def\fake_shape_oldstyle_encoding{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \adobe_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\raw_shape\oldstyle_variant
+ \raw_encoding\font_width>~from~
+ <\font_family\font_weight\raw_shape\oldstyle_variant
+ \adobe_encoding\font_width>
+ }
+%</debug>
+ \transformfont{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \raw_encoding\font_width
+ }{
+ \reencodefont{\raw_encoding}{
+ \fromafm{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \adobe_encoding\font_width
+ }
+ }
+ }
+ \fi
+}
+%</oldstyle>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\fake_shape_c}
+% Check if an |8a|-encoded |.afm| file exists for the small caps shape.
+% If so, call |\fake_shape_| to generate an |8r|-reencoded MTX
+% file and to install a ligfull |.pl| file. If not, reset |\raw_shape|
+% to the default shape and |\encoding_shape| to small caps before
+% calling |\fake_shape_| to install a faked small caps font.
+%
+% \begin{macrocode}
+\def\fake_shape_c{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width.afm
+ }\then
+ \fake_shape_
+ \else
+ % If real smallcaps font doesn't exist, fake it from the roman.
+ \gdef\raw_shape{}
+ \if_oldstyle_
+ \gdef\encoding_shape{cj}
+ \else
+ \gdef\encoding_shape{c}
+ \fi
+ \fake_shape_
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\fake_shape_o}
+% Check if an |8a|-encoded |.afm| file exists for the oblique shape.
+% If so, call |\fake_shape_| to generate an |8r|-reencoded MTX
+% file and to install a ligfull |.pl| file. If not, call macros
+% to fake a oblique fonts.
+%
+% \begin{macrocode}
+\def\fake_shape_o{
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width.afm
+ }\then
+ \fake_shape_
+ \else
+ \fake_shape_o_raw_encoding
+ \if_expert_
+ \fake_shape_o_expert_encoding
+ \fi
+%<*oldstyle>
+ \if_oldstyle_
+ \fake_shape_o_oldstyle_encoding
+ \fi
+%</oldstyle>
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_o_raw_encoding}
+% Called from |\fake_shape_o| if the oblique shape needs to be faked.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>o8r}|\\
+% | {\slantfont{SLANT}{\frommtx{<FONT>8r}}}|
+% \end{quote}
+% to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file),
+% followed by
+% \begin{quote}
+% |\installrawfont{<FONT>o8r}{<FONT>o8r,8r}{8r}...|
+% \end{quote}
+% to install a ligfull |.pl| file.
+%
+% \begin{macrocode}
+\def\fake_shape_o_raw_encoding{
+ \if_file_exists{
+ \font_family\font_weight\raw_variant
+ \raw_encoding\font_width.mtx
+ }\then
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width>~from~
+ <\font_family\font_weight\raw_variant
+ \raw_encoding\font_width>~(faking~oblique)
+ }
+%</debug>
+ %%% WARNING: famtool.pl relies on this message format!!!
+ \immediate\write16{
+ Faking~oblique~font~
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ \space from~
+ \font_family\font_weight\raw_variant
+ \raw_encoding\font_width
+ }
+ \transformfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ }{
+ \slantfont{\SlantAmount}{
+ \frommtx{
+ \font_family\font_weight\raw_variant
+ \raw_encoding\font_width
+ }
+ }
+ }
+ \if_file_exists{ \raw_encoding.mtx }\then
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\installrawfont\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width>
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding>
+ <\raw_encoding>
+ <\raw_encoding>
+ <\latex_family>
+ <\latex_weight\latex_width>
+ <\latex_shape>}
+%</debug>
+ \installrawfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ }{ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding
+ }{ \raw_encoding
+ }{ \raw_encoding
+ }{ \latex_family
+ }{ \latex_weight\latex_width
+ }{ \latex_shape
+ }{}
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_o_expert_encoding}
+% Called from |\fake_shape_o| if the oblique shape needs to be faked.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>o8x}|\\
+% | {\slantfont{SLANT}{\frommtx{<FONT>8x}}}|
+% \end{quote}
+% to generate an |8x|-reencoded |.mtx| file (and a raw |.pl| file).
+%
+% \begin{macrocode}
+\def\fake_shape_o_expert_encoding{
+ \if_file_exists{
+ \font_family\font_weight\raw_variant
+ \expert_encoding\font_width.mtx
+ }\then
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width>~from~
+ <\font_family\font_weight\raw_variant
+ \expert_encoding\font_width>~(faking~oblique)
+ }
+%</debug>
+ %%% WARNING: famtool.pl relies on this message format!!!
+ \immediate\write16{
+ Faking~oblique~font~
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width
+ \space from~
+ \font_family\font_weight\raw_variant
+ \expert_encoding\font_width
+ }
+ \transformfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width
+ }{
+ \slantfont{\SlantAmount}{
+ \frommtx{
+ \font_family\font_weight\raw_variant
+ \expert_encoding\font_width
+ }
+ }
+ }
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_shape_o_oldstyle_encoding}
+% Called from |\fake_shape_o| if the oblique shape needs to be faked.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>oj8r}|\\
+% | {\slantfont{SLANT}{\frommtx{<FONT>j8r}}}|
+% \end{quote}
+% to generate an |8r|-reencoded |.mtx| file (and a raw |.pl| file).
+%
+% \begin{macrocode}
+%<*oldstyle>
+\def\fake_shape_o_oldstyle_encoding{
+ \if_file_exists{
+ \font_family\font_weight\oldstyle_variant
+ \raw_encoding\font_width.mtx
+ }\then
+ \if_file_exists{
+ \font_family\font_weight\font_shape\oldstyle_variant
+ \raw_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\font_shape\oldstyle_variant
+ \raw_encoding\font_width>~from~
+ <\font_family\font_weight\oldstyle_variant
+ \raw_encoding\font_width>~(faking~oblique)
+ }
+%</debug>
+ %%% WARNING: famtool.pl relies on this message format!!!
+ \immediate\write16{
+ Faking~oblique~font~
+ \font_family\font_weight\font_shape\oldstyle_variant
+ \raw_encoding\font_width
+ \space from~
+ \font_family\font_weight\oldstyle_variant
+ \raw_encoding\font_width
+ }
+ \transformfont{
+ \font_family\font_weight\font_shape\oldstyle_variant
+ \raw_encoding\font_width
+ }{
+ \slantfont{\SlantAmount}{
+ \frommtx{
+ \font_family\font_weight\oldstyle_variant
+ \raw_encoding\font_width
+ }
+ }
+ }
+ \fi
+ \fi
+}
+%</oldstyle>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\fake_shape_i}
+% Call |\fake_shape_| to generate an |8r|-reencoded |.mtx| file and a
+% ligfull |.pl| file, if a corresponding |8a|-encoded |.afm| file exists.
+% Otherwise, do nothing, since an italic shape can't be faked.
+%
+% \begin{macrocode}
+\let\fake_shape_i\fake_shape_ % We must do this again!
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Faking font widths}
+%
+% \begin{macro}{\if_fake_narrow_}
+% \begin{macrocode}
+\newif\if_fake_narrow_
+\_fake_narrow_false
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fakenarrow}
+% |\fakenarrow{WIDTH}|
+%
+% Sets the expansion factor used to generate faked narrow fonts.
+% If it isn't set, do not attempt to install faked narrow fonts.
+% \begin{macrocode}
+\def\fakenarrow#1{
+ \_fake_narrow_true
+ \gdef\fake_narrow_width{#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_width_}
+% Do nothing for the default width or the condensed width.
+% \begin{macrocode}
+\def\fake_width_{}
+\def\fake_width_c{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_width_n}
+% If we are faking narrow fonts, check if an |8a|-encoded |.afm| file
+% exists for the current shape in narrow width, and if not call
+% |\fake_shape_n_raw_encoding| and |\fake_shape_n_expert_encoding|.
+%
+% \begin{macrocode}
+\def\fake_width_n{
+ \if_fake_narrow_
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \adobe_encoding\font_width.afm
+ }\then % no action required
+ \else
+ \fake_width_n_raw_encoding
+ \if_expert_
+ \fake_width_n_expert_encoding
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_width_n_raw_encoding}
+% Called from |\fake_width_n| if the narrow width needs to be faked.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>8rn}|\\
+% | {\xscalefont{WIDTH}{\frommtx{<FONT>8r}}}|
+% \end{quote}
+% to generate an |8r|-encoded |.mtx| file for a faked narrow font,
+% followed by
+% \begin{quote}
+% |\installrawfont{<FONT>8rn}{<FONT>8rn,8r}{8r}...|
+% \end{quote}
+% to install a ligfull |.pl| file.
+%
+% \begin{macrocode}
+\def\fake_width_n_raw_encoding{
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding.mtx
+ }\then
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width>~from~
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding>~(faking~narrow)
+ }
+%</debug>
+ %%% WARNING: famtool.pl relies on this message format!!!
+ \immediate\write16{
+ Faking~narrow~font~
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ \space from~
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding
+ }
+ \transformfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ }{
+ \xscalefont{\fake_narrow_width}{
+ \frommtx{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding
+ }
+ }
+ }
+ \if_file_exists{ \raw_encoding.mtx }\then
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\installrawfont\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width>
+ <\font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding>
+ <\raw_encoding>
+ <\raw_encoding>
+ <\latex_family>
+ <\latex_weight\latex_width>
+ <\latex_shape>}
+%</debug>
+ \installrawfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width
+ }{ \font_family\font_weight\font_shape\raw_variant
+ \raw_encoding\font_width,
+ \raw_encoding
+ }{ \raw_encoding
+ }{ \raw_encoding
+ }{ \latex_family
+ }{ \latex_weight\latex_width
+ }{ \latex_shape
+ }{}
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fake_width_n_expert_encoding}
+% Called from |\fake_width_n| if the narrow width needs to be faked.
+% Invokes
+% \begin{quote}
+% |\transformfont{<FONT>8xn}|\\
+% | {\xscalefont{WIDTH}{\frommtx{<FONT>8x}}}|
+% \end{quote}
+% to generate an |8x|-encoded |.mtx| file for a faked narrow font.
+%
+% \begin{macrocode}
+\def\fake_width_n_expert_encoding{
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding.mtx
+ }\then
+ \if_file_exists{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width.mtx
+ }\then % no action required
+ \else
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\transformfont\space\space
+ <\font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width>~from~
+ <\font_family\font_weight\font_shape\raw_variant
+ \expert_encoding>~(faking~narrow)
+ }
+%</debug>
+ %%% WARNING: famtool.pl relies on this message format!!!
+ \immediate\write16{
+ Faking~narrow~font~
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width
+ \space from~
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding
+ }
+ \transformfont{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding\font_width
+ }{
+ \xscalefont{\fake_narrow_width}{
+ \frommtx{
+ \font_family\font_weight\font_shape\raw_variant
+ \expert_encoding
+ }
+ }
+ }
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Installing reencoded fonts}
+%
+% \begin{macro}{\latin_encoding}
+% \begin{macro}{\font_encoding}
+% \begin{macro}{\latex_encoding}
+% \begin{macro}{\latex_mtx}
+%
+% |\latin_encoding{FONTENC}{EXPERTISED-ENC}{OLDSTYLE-ENC}|
+% |{LATEXENC}{LATEXMTX}|
+%
+% If this is an expertised family |EXPERTISED-ENC| is used instead
+% of |FONTENC|. If this is an expertised family with oldstyle
+% digits |OLDSTYLE-ENC| is used instead of |EXPERTISED-ENC|.
+%
+% UV 06/98: Added code for oldstyle encodings from Alan's v~1.511.
+% The |\font_encoding| is changed when |\if_oldstyle_| is true.
+%
+% UV 06/98: Added anonther parameter for the default metrics file
+% (which is usually either |latin.mtx| or |textcomp.mtx|).
+%
+% UV 06/98: Added experimental code for OsF or SC\&OsF fonts.
+%
+% \begin{macrocode}
+\def\latin_encoding#1#2#3#4#5{
+ \gdef\latex_encoding{#4}
+ \gdef\latex_mtx{#5}
+ \if_oldstyle_
+ \gdef\font_encoding{#3}
+ \else\if_expert_
+ \gdef\font_encoding{#2}
+ \else
+ \gdef\font_encoding{#1}
+ \fi\fi
+ \gdef\expert_font{}
+ \gdef\oldstyle_font{}
+ \if_expert_
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\raw_variant
+ \expert_encoding\font_width.mtx
+ }\then
+ \gdef\expert_font{
+ \font_family\font_weight\raw_shape\raw_variant
+ \expert_encoding\font_width,
+ }
+ \fi
+ \fi
+%<*oldstyle>
+ \if_oldstyle_
+ \if_file_exists{
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \raw_variant\raw_encoding\font_width.mtx
+ }\then
+ \gdef\oldstyle_font{
+ unsetnum,
+ \font_family\font_weight\raw_shape\oldstyle_variant
+ \raw_variant\raw_encoding\font_width,
+ resetosf,
+ }
+ \fi
+ \fi
+%</oldstyle>
+%<*debug>
+ \immediate\write16{
+ INFO>~run~\string\installfont\space
+ <\font_family\font_weight\font_shape\font_variant
+ \font_encoding\font_width>
+ <\font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width,
+ \if_oldstyle_
+ \ifx\raw_shape\caps_shape
+ resetosf,
+ \fi
+ \fi
+ \expert_font
+ \oldstyle_font
+ \latex_mtx>
+ <\latex_encoding\encoding_shape>
+ <\latex_encoding>
+ <\latex_family>
+ <\latex_weight\latex_width>
+ <\latex_shape>}
+%</debug>
+ \installfont{
+ \font_family\font_weight\font_shape\font_variant
+ \font_encoding\font_width
+ }{
+ \font_family\font_weight\raw_shape\raw_variant
+ \raw_encoding\font_width,
+ \if_oldstyle_
+ \ifx\raw_shape\caps_shape
+ resetosf,
+ \fi
+ \fi
+ \expert_font
+ \oldstyle_font
+ \latex_mtx
+ }{
+ \latex_encoding\encoding_shape
+ }{
+ \latex_encoding
+ }{
+ \latex_family
+ }{
+ \latex_weight\latex_width
+ }{
+ \latex_shape
+ }{}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Default weights, widths and shapes}
+%
+% \begin{center}
+% \begin{tabular}{llll}
+% \hline
+% \multicolumn{2}{l}{Fontname: \texttt{weight.map}} &
+% \multicolumn{2}{l}{NFSS: \emph{\LaTeX\ Companion}, p.~190} \\
+% \hline
+% |a| & Thin Hairline & |ul| & Ultra Light \\
+% |j| & ExtraLight & |el| & Extra Light \\
+% |l| & Light & |l| & Light \\
+% |r| & Regular Roman & |m| & Medium \\
+% |k| & Book & |m| & Medium \\
+% |m| & Medium & |mb| & (was: |m|) \\
+% |d| & Demi & |db| & (was: |sb|) \\
+% |s| & Semibold & |sb| & Semibold \\
+% |b| & Bold & |b| & Bold \\
+% |h| & Heavy Heavyface & |eb| & (was missing) \\
+% |c| & Black & |eb| & (was missing) \\
+% |x| & ExtraBold ExtraBlack & |eb| & Extra Bold \\
+% |u| & Ultra UltraBlack & |ub| & Ultra Bold \\
+% |p| & Poster & & (still missing) \\
+% \hline
+% \end{tabular}
+% \end{center}
+%
+% \begin{macro}{\latin_weights}
+% Each call to |\latin_weight| maps a Fontname weight code
+% (|\font_weight|) to a \LaTeX{} weight code (|\latex_weight|).
+% Non-existing weights are ignored (or substituted when the
+% |.fd| files are written out by |\endinstallfont|).
+%
+% The standard values are given in the table. They may be changed,
+% but you'd better know what you're doing.
+%
+% UV, 04/98: Changed the processing order: Do the most common
+% shapes first. Added new mappings for |c| and |h|, changed
+% mapping for |m| to newly invented \LaTeX{} weight |mb|.
+%
+% \begin{macrocode}
+\def\latin_weights{
+ \latin_weight{r}{m}
+ \latin_weight{k}{m}
+ \latin_weight{b}{b}
+ \latin_weight{s}{sb}
+ \latin_weight{d}{db} % was {d}{sb}, SPQR changed
+ \latin_weight{m}{mb} % was {m}{m}, UV changed
+ \latin_weight{c}{eb} % UV added
+ \latin_weight{h}{eb} % UV added
+ \latin_weight{x}{eb}
+ \latin_weight{u}{ub}
+ \latin_weight{l}{l}
+ %\latin_weight{j}{el}
+ %\latin_weight{a}{ul} % UV added
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{center}
+% \begin{tabular}{llll}
+% \hline
+% \multicolumn{2}{l}{Fontname: \texttt{width.map}} &
+% \multicolumn{2}{l}{NFSS: \emph{\LaTeX\ Companion}, p.~190} \\
+% \hline
+% |t| & Thin & -- & -- \\
+% |o| & Ultra Condensed & |uc| & Ultra Condensed \\
+% |u| & Ultra Compressed & |uc| & . . \\
+% |q| & Extra Compressed & |ec| & Extra Condensed \\
+% |c| & Condensed & |c| & Condensed \\
+% |p| & Compressed & |c| & . . \\
+% |n| & Narrow & |c| & . . \\
+% -- & -- & |sc| & Semi Condensed \\
+% |r| & Normal, Medium, Regular & |m| & Medium \\
+% -- & -- & |sx| & Semi Expanded \\
+% |e| & Expanded & |x| & Expanded \\
+% |x| & Extended & |x| & . . \\
+% |v| & Extra Expanded & |ex| & Extra Expanded \\
+% -- & -- & |ux| & Ultra Expanded \\
+% |w| & Wide & -- & -- \\
+% \hline
+% \end{tabular}
+% \end{center}
+%
+% \begin{macro}{\latin_widths}
+% Each call to |\latin_width| maps a Fontname width code
+% (|\font_width|) to a \LaTeX{} width code (|\latex_width|).
+% Non-existing narrow fonts are faked only if |\fakenarrow|
+% is specifically called for.
+%
+% \begin{macrocode}
+\def\latin_widths{
+ \latin_width{}{}
+ \latin_width{n}{c}
+ %latin_width{c}{c}
+ %latin_width{x}{x}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\latin_shapes}
+% The fifth argument of |\latin_shape| is stored in the variable
+% |\encoding_switches|.
+% \begin{macrocode}
+\def\latin_shapes{
+ \latin_shape{} {} {} {n} {\_textcomp_true }
+ \latin_shape{c}{c}{} {sc}{\_textcomp_false}
+ \latin_shape{o}{o}{} {sl}{\_textcomp_true }
+ \latin_shape{i}{i}{i}{it}{\_textcomp_true }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\latin_encodings}
+% |\encoding_switches| is evaluated immediatley before the
+% |\if_textcomp_| test to set it as appropriate for the curent shape.
+% \changes{1.925}{2003/03/31}{Changed from using \texttt{latin.mtx} to
+% \texttt{newlatin.mtx}. (LH)}
+% \begin{macrocode}
+\def\latin_encodings{
+ \latin_encoding{7t}{9t}{9o}{OT1}{newlatin}
+ \latin_encoding{8t}{9e}{9d}{T1} {newlatin}
+%<*textcomp>
+ \encoding_switches
+ \if_textcomp_
+ \latin_encoding{8c}{9c}{9c}{TS1}{textcomp}
+ \fi
+%</textcomp>
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if_textcomp_}
+% Switch to control whether or not to install a text companion
+% encoding. It is set or unset for each shape by |\latin_shapes|
+% and evaluated in |\latin_encodings|.
+%
+% \begin{macrocode}
+\newif\if_textcomp_
+% \end{macrocode}
+% \end{macro}
+
+%
+% \begin{macro}{\raw_encoding}
+% \begin{macro}{\adobe_encoding}
+% \begin{macro}{\expert_encoding}
+% \begin{macrocode}
+\def\raw_encoding{8r}
+\def\adobe_encoding{8a}
+\def\expert_encoding{8x}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+
+% \begin{macro}{\caps_shape}
+% \begin{macro}{\oldstyle_shape}
+% \begin{macrocode}
+\def\caps_shape{c}
+\def\oldstyle_shape{j}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SlantAmount}
+% \begin{macrocode}
+\def\SlantAmount{167}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/fontinst/base/fimain.dtx b/Master/texmf-dist/source/fontinst/base/fimain.dtx
new file mode 100644
index 00000000000..62ae7dad6fa
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fimain.dtx
@@ -0,0 +1,4848 @@
+% \CheckSum{4010}
+% \iffalse meta-comment
+%
+% Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+% hacked and maintained 1997, 1998 Sebastian Rahtz,
+% copyright 1998, 1999, 2000 the fontinst maintenance team and any
+% individual authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+%%% From file: fimain.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fisource}
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth, Lars Hellstr\"om}
+\begin{document}
+\maketitle
+\tableofcontents
+\DocInput{fimain.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \StopEventually{}
+%
+%
+% \section{Encoding files}
+%
+% \changes{1.911}{1999/11/21}{Definitions of encoding file commands
+% added to \protect\protect\protect\Module{misc}. (LH)}
+%
+% \DescribeMacro{\inputetx}
+% The macro
+% \begin{quote}
+% |\inputetx|\marg{filename}
+% \end{quote}
+% inputs \meta{filename}|.etx|, ignoring anything between |\relax|
+% and |\encoding|, and anything after |\endencoding|.
+%
+% The file name is transformed to lowercase before opening.
+%
+% \begin{macro}{\inputetx}
+% \begin{macro}{\encoding}
+% \changes{1.900}{1999/02/07}
+% {Changed group in fontdoc to \cs{begingroup} type. (LH)}
+% \usechange{raggedright}
+% \begin{macro}{\endencoding}
+% \changes{1.900}{1999/02/07}{Made it outer. (LH)}
+% \usechange{raggedright}
+% \begin{macrocode}
+%<*pkg|misc>
+\def\inputetx#1{
+ \edef\lowercase_file{\lowercase{
+ \edef\noexpand\lowercase_file{#1}}}
+ \lowercase_file
+ \slot_number=0
+ \def\relax{\let\relax=\x_relax\iffalse}
+ \let\encoding=\fi
+ \primitiveinput \lowercase_file.etx\x_relax
+ \let\relax=\x_relax
+}
+\let\encoding=\relax
+\outer\def\endencoding{\endinput}
+%</pkg|misc>
+% \end{macrocode}
+%
+% Things are a bit more complicated in \package{fontdoc}, since the
+% |\relax| \textellipsis\ |\encoding| \textellipsis\ |\endencoding|
+% markup must be able to work in two different ways. In the main file
+% only |\encoding| actually does anything---it sets |\slot@number| to
+% zero. In a file that is being |\inputetx|ed, they must work as with
+% \package{fontinst}: Everything between |\relax| and |\encoding|,
+% and everything after |\endencoding| must be ignored.
+% \multchanges{\cs{inputetx}\cs{inputmtx}}{1.914}{2000/05/27}
+% {New \package{fontdoc} definition, using \cs{IfFileExists}. (LH)}
+% \multchanges{\cs{encoding}\cs{endencoding}}{1.918}{2001/06/19}
+% {Added \cs{par} and \cs{addvspace} to \package{fontdoc}
+% definitions. (LH)}
+% \multchanges{\cs{endencoding}}{1.919}{2001/09/01}
+% {Added setting of \cs{parindent} to 1\,em to \package{fontdoc}
+% definition. (LH)}
+% \begin{macrocode}
+%<*doc>
+\def\inputetx#1{%
+ \begingroup
+ \edef\lowercase@file{\lowercase{%
+ \edef\noexpand\lowercase@file{#1}%
+ }}%
+ \lowercase@file
+ \global\slot@number=0%
+ \FD@slot@known@true
+ \IfFileExists{\lowercase@file.etx}{%
+ \def\relax{\let\relax=\x@relax\iffalse}%
+ \let\encoding=\fi
+ \outer\x@cs\def{endencoding}{\endinput}%
+ \@@input \@filef@und
+ \let\relax=\x@relax
+ }{%
+ \PackageError{fontdoc}{File #1.etx not found}%
+ {\@eha\MessageBreak You can \protect\inputetx\space
+ some other file now, if you want.}%
+ }
+ \endgroup
+}
+\def\encoding{%
+ \par
+ \ifFD@spec@ \addvspace{\bigskipamount}\fi
+ \begin{flushleft}
+ \global\slot@number=\z@
+}
+\outer\def\endencoding{%
+ \end{flushleft}
+ \ifFD@spec@ \addvspace{\bigskipamount}\fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\setslot}
+% \changes{1.917}{2001/03/23}{Made slots referencable using
+% \cs{label}. (LH)}
+% \begin{macro}{\endsetslot}
+% \begin{macro}{\slot_name}
+% |\setslot|\marg{name} \meta{slot commands} |\endsetslot|
+%
+% In \package{fontinst}, this sets |\slot_name| to \meta{name} and
+% calls |\do_slot| at the beginning of the slot and it calls
+% |\end_do_slot| and increments |\slot_number| by one at the end.
+% By default, |\do_slot| and |\end_do_slot| do nothing, but this is
+% over-ridden later.
+%
+% \begin{macrocode}
+%<*pkg|misc>
+\def\setslot#1{\edef\slot_name{#1}\do_slot}
+\def\endsetslot{\end_do_slot\advance\slot_number by 1\x_relax}
+%</pkg|misc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\slot@name}
+% \changes{1.917}{2001/03/23}{Now storing the printable form of the
+% name, rather than the raw code. (LH)}
+% In \package{fontdoc}, the same code converts \meta{name} to a
+% printable string and stores the result in |\slot@name|, prints an
+% |\Aheading| heading for the slot which show the name and number
+% of the slot, and prints the current automatic slot comment (if
+% one has been set) at the beginning of the slot. At the end of
+% the slot, it simply increments |\slot@number| by one.
+%
+% \begin{macrocode}
+%<*doc>
+\newcommand\setslot[1]{%
+ \protected@edef\slot@name{%
+ \noexpand\MakePrintable \noexpand\slot@name {FD@swa}{#1}%
+ }%
+ \slot@name
+ \FD@tight@true
+ \Aheading{Slot
+ \ifFD@slot@known@
+ \the\slot@number\space
+ \else
+ \(\FD@slot@expression + \the\slot@number\)
+ \fi
+ `\FD@typeset@string{\slot@name}'%
+ }%
+ \protected@edef\@currentlabel{%
+ \ifFD@slot@known@
+ \the\slot@number
+ \else
+ \protect\(%
+ \FD@slot@expression+\the\slot@number
+ \protect\)%
+ \fi
+ \space(\protect\FD@typeset@string{\slot@name})%
+ }%
+ \ifFD@slot@known@ \ifslot@comment@ \comment{\slot@comment}\fi\fi
+}
+\def\endsetslot{%
+ \global\advance \slot@number \@ne
+ \FD@tight@false
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\do_slot}
+% \begin{macro}{\end_do_slot}
+% \begin{macrocode}
+%<*pkg|misc>
+\let\do_slot\empty_command
+\let\end_do_slot\empty_command
+% \end{macrocode}
+% \end{macro} \end{macro}
+% \multchanges{\cs{do_new_slot}}{1.910}{1999/11/01}{Macro removed. (LH)}
+%
+% \begin{macro}{\nextslot}
+% \begin{macro}{\skipslots}
+% \begin{macro}{\slot_number}
+% \begin{macro}{\slot@number}
+% \begin{switch}{FD@slot@known@}
+% \begin{macro}{\FD@slot@expression}
+% |\nextslot|\marg{integer expression}\\
+% |\skipslots|\marg{integer expression}
+%
+% In \package{fontinst}, |\nextslot| sets the |\slot_number| and
+% |\skipslots| addvances the |\slot_number|.
+%
+% \begin{macrocode}
+\newcount\slot_number
+\def\nextslot#1{\eval_expr_to\slot_number{#1}}
+\def\skipslots#1{\eval_expr{#1} \advance\slot_number by \result}
+%</pkg|misc>
+% \end{macrocode}
+%
+% The commands do the same in \package{fontdoc} as in
+% \package{fontinst}, although they do it to |\slot@number| instead of
+% |\slot_number|.
+%
+% \begin{macrocode}
+%<*doc>
+\newcount\slot@number
+\def\FD@slot@known@true{\global\let\ifFD@slot@known@\iftrue}
+\def\FD@slot@known@false{\global\let\ifFD@slot@known@\iffalse}
+\FD@slot@known@true
+\newcommand\nextslot[1]{%
+ \FD@evaluate@true
+ \FD@eval@expr{#1}%
+ \ifFD@evaluate@
+ \global\slot@number=\FD@result
+ \FD@slot@known@true
+ \else
+ \global\let\FD@slot@expression=\FD@expression
+ \global\slot@number=\z@
+ \FD@slot@known@false
+ \fi
+}
+\newcommand\skipslots[1]{%
+ \FD@evaluate@true
+ \FD@eval@expr{#1}%
+ \ifFD@evaluate@
+ \global\advance \slot@number \FD@result
+ \else
+ \ifFD@slot@known@
+ \global\let\FD@slot@expression=\FD@expression
+ \else
+ \protected@xdef\FD@slot@expression{%
+ \FD@slot@expression+\FD@expression
+ }%
+ \fi
+ \FD@slot@known@false
+ \fi
+}
+%</doc>
+% \end{macrocode}
+%
+% There has been some ambiguity concerning what is allowed as
+% arguments of \cs{nextslot} and \cs{skipslots}. At least since
+% v\,1.335 the comments in the source has said it was an integer
+% expression, but the implementation was for a \TeX\ number.
+% Alan's v\,1.5 manual and Rowland's v\,1.8 manual both say the
+% arguments must be numbers. Allowing arbitrary integer
+% expressions with \package{fontinst} is trivial, the above
+% implementation copes with that, but \package{fontdoc} gets in
+% trouble, so what should we do about it? /LH
+%
+% AFAIK, all instances of |\nextslot| or |\skipslots| appearing in
+% present |*.etx| files are explicit numbers, no fancy constructs. /UV
+%
+% No, but if a |\setslot| command appears in a |\for| loop then the
+% slot number in that command will depend on the values of various
+% integer expressions anyway, so we might as well deal with it. /LH
+%
+% The matter was finally resolved when \package{fontdoc} was
+% augmented to handle (and typeset) arbtrary integer expressions.
+%
+% \multchanges{\cs{nextslot}\cs{skipslots}}{1.900}{1999/02/07}^^A
+% {Made changes of \cs{slot@number} global. (LH)}
+% \end{macro}\end{switch}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\setleftboundary}
+% \multchanges{\cs{setleftboundary}\cs{endsetleftboundary}}^^A
+% {1.909}{1999/10/19}{\package{fontdoc} definition added. (LH)}
+% \changes{1.917}{2001/03/23}{Made the left boundary referencable
+% using \cs{label}. (LH)}
+% \begin{macro}{\endsetleftboundary}
+% \begin{macro}{\do_boundary}
+% |\setleftboundary|\marg{glyph} \meta{slot commands}
+% |\endsetleftboundary|
+%
+% These macros are like |\setslot| and |\endsetslot|, but they merely
+% set the left boundary ligkern program, they do not cause any
+% |CHARACTER| property list to be written. Thus the only metric
+% information connected to the \meta{glyph} argument that is ever used
+% is the kerns with this glyph on the left.
+%
+% |\do_boundary| and |\endsetleftboundary| are initally |\relax|, but
+% are later redefined.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\setleftboundary#1{\edef\slot_name{#1}\do_boundary}
+\let\endsetleftboundary\x_relax
+\let\do_boundary\x_relax
+%</pkg>
+%<*doc>
+\newcommand\setleftboundary[1]{%
+ \protected@edef\slot@name{%
+ \noexpand\MakePrintable \noexpand\slot@name {FD@swa}{#1}%
+ }%
+ \slot@name
+ \FD@tight@true
+ \Aheading{Left boundary `\FD@typeset@string{\slot@name}'}%
+ \protected@edef\@currentlabel{%
+ left boundary (\protect\FD@typeset@string{\slot@name})%
+ }%
+}
+\let\endsetleftboundary=\FD@tight@false
+%</doc>
+%<*misc>
+\let\setleftboundary=\gobble_one
+\let\endsetleftboundary=\x_relax
+%</misc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\setrightboundary}
+% |\setrightboundary|\marg{glyph}
+%
+% The |\setrightboundary| macro should be used to set which slot in
+% the font is used as right boundary marker if that slot is empty. It
+% advances |\slot_number| just like a |\setslot| \textellipsis\
+% |\endsetslot| pair, but since the slot will be left empty, there is
+% no need for any \meta{slot commands}, and hence there is no need for
+% a closing |\endset|\textellipsis\ command either.
+%
+% If the right boundary marker slot is not to be left empty (often
+% unavoidable), then one should use the slot command
+% |\makerightboundary| instead.
+%
+% \changes{1.909}{1999/10/19}{doc definition added. (LH)}
+% \begin{macrocode}
+%<*pkg|misc>
+\def\setrightboundary#1{
+ \makerightboundary{#1}
+ \advance \slot_number 1\x_relax
+}
+%</pkg|misc>
+%<*doc>
+\newcommand\setrightboundary[1]{%
+ \Aheading{Right boundary slot
+ \ifFD@slot@known@
+ \the\slot@number\space
+ \else
+ \(\FD@slot@expression + \the\slot@number\)
+ \fi
+ `\TypesetStringExpression{#1}'%
+ }%
+ \global\advance \slot@number \@ne
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \DescribeMacro{\ligature}
+% \DescribeMacro{\Ligature}
+% \DescribeMacro{\oddligature}
+% \DescribeMacro{\nextlarger}
+% \DescribeMacro{\varchar}
+% \DescribeMacro{\endvarchar}
+% \DescribeMacro{\usedas}
+% \DescribeMacro{\makerightboundary}
+% \DescribeMacro{\Unicode}
+% The \meta{slot commands} are:
+% \begin{quote}
+% |\ligature|\marg{lig}\marg{glyph}\marg{glyph}\\
+% |\Ligature|\marg{lig}\marg{glyph}\marg{glyph}\\
+% |\oddligature|\marg{note}\marg{lig}\marg{glyph}\marg{glyph}\\
+% |\nextlarger|\marg{glyph}\\
+% |\varchar| \meta{varchar commands} |\endvarchar|\\
+% |\usedas|\marg{command}\marg{type}\\
+% |\makerightboundary|\marg{glyph}\\
+% |\Unicode|\marg{code point}\marg{name}
+% \end{quote}
+% By default, these do nothing in \package{fontinst}, but most of
+% those defaults are overridden locally in those situations where one
+% wants them to do something. Exceptions are \cs{usedas},
+% which is never used at all AFAIK,\footnote{It was intended to be
+% used for math font encodings, but that never got off the
+% \texttt{TODO} list. /LH} and |\oddligature| and |\Unicode|,
+% which are purely documentation commands. In \package{fontdoc},
+% they generate descriptive headings.
+%
+% \begin{macro}{\ligature}
+% \begin{macro}{\Ligature}
+% \changes{1.917}{2001/03/31}{Command added. (LH)}
+% \begin{macro}{\oddligature}
+% \changes{1.918}{2001/05/31}{Command added. (LH)}
+% The |\ligature| and |\Ligature| commands have the same syntax and
+% meaning to \package{fontinst}, but \package{fontdoc} can give them
+% slightly different treatment. In a specification ETX file, the
+% |\Ligature| command gets the heading ``Mandatory ligature'', whereas
+% the |\ligature| command gets the heading ``Ordinary ligature''.
+%
+% The |\oddligature| command takes a fourth argument which contains a
+% short note on when the ligature might be appropriate. The entire
+% command is always ignored by \package{fontinst}.
+% \begin{macrocode}
+%<pkg|misc>\let\ligature=\gobble_three
+%<pkg|misc>\def\Ligature{\ligature}
+%<pkg|misc>\def\oddligature#1#2#3#4{}
+%<*doc>
+\newcommand\ligature[3]{%
+ \Bheading{\ifFD@spec@ Ordinary ligature\else Ligature\fi}
+ \@nameuse{FD@lig-#1}{#2}{#3}%
+}
+\newcommand\Ligature[3]{%
+ \Bheading{\ifFD@spec@ Mandatory ligature\else Ligature\fi}
+ \@nameuse{FD@lig-#1}{#2}{#3}%
+}
+\newcommand\oddligature[4]{%
+ \Bheading{Odd\footnote{#1} ligature}
+ \@nameuse{FD@lig-#2}{#3}{#4}%
+}
+% \end{macrocode}
+%
+% Symbolic typesetting of |\ligature| programs requires
+% special processing.\describecsfamily{FD@lig-\meta{lig}}
+% \multchanges{\cs{FD@lig-/LIG\PrintChar{`>}}\cs
+% {FD@lig-LIG/\PrintChar{`>}}\cs{FD@lig-/LIG/\PrintChar{`>}}\cs
+% {FD@lig-/LIG/\PrintChar{`>}\PrintChar{`>}}}{1.917}
+% {2001/03/31}{Changed how \package{fontdoc} marks the current
+% position after a ligature instruction, from $+$ to
+% $*\lfloor$. (LH)}
+% \multchanges{\cs{FD@lig-/LIG}}{1.927}
+% {2004/06/21}{Fixed a typo. (LH) Reported by Werner Lemberg.}
+% \multchanges{\cs{FD@lig-/LIG/\PrintChar{`>}\PrintChar{`>}}}{1.927}
+% {2004/06/24}{Fixed a typo. (LH) Reported by Werner Lemberg.}
+%
+% \begin{macrocode}
+\x@cs\def{FD@lig-LIG}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$\typeset@glyph{#2}%
+}
+\x@cs\def{FD@lig-/LIG}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#2}%
+}
+\x@cs\def{FD@lig-LIG/}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \typeset@glyph{#2}${}*{}$\typeset@glyph{#1}%
+}
+\x@cs\def{FD@lig-/LIG/}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \FD@typeset@string{\slot@name}${}*{}$%
+ \typeset@glyph{#2}${}*{}$\typeset@glyph{#1}%
+}
+\x@cs\def{FD@lig-/LIG>}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \FD@typeset@string{\slot@name}${}*\lfloor$\typeset@glyph{#2}%
+}
+\x@cs\def{FD@lig-LIG/>}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \typeset@glyph{#2}${}*\lfloor$\typeset@glyph{#1}%
+}
+\x@cs\def{FD@lig-/LIG/>}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \FD@typeset@string{\slot@name}${}*\lfloor$%
+ \typeset@glyph{#2}${}*{}$\typeset@glyph{#1}%
+}
+\x@cs\def{FD@lig-/LIG/>>}#1#2{%
+ \FD@typeset@string{\slot@name}${}*{}$\typeset@glyph{#1}%
+ ${}\rightarrow{}$%
+ \FD@typeset@string{\slot@name}${}*{}$%
+ \typeset@glyph{#2}${}*\lfloor$\typeset@glyph{#1}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\nextlarger}
+% \begin{macro}{\usedas}
+% \begin{macro}{\makerightboundary}
+% \begin{macrocode}
+%<*pkg|misc>
+\let\nextlarger=\gobble_one
+\let\usedas=\gobble_two
+\let\makerightboundary=\gobble_one
+%</pkg|misc>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\nextlarger#1{\Bheading{Next larger} \typeset@glyph{#1}}
+\def\makerightboundary#1{%
+ \Bheading{Right boundary marker slot} designation \typeset@glyph{#1}%
+}
+%</doc>
+% \end{macrocode}
+% \missing{doc}{\usedas}
+% \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\Unicode}
+% \changes{1.917}{2001/03/13}{Command added. (LH)}
+% \changes{1.917}{2001/03/31}{Added setting of \cs{linepenalty} and
+% \cs{spaceskip}. (LH)}
+% \begin{macro}{\textunicode}
+% \changes{1.918}{2001/06/17}{Command added. (LH)}
+% \begin{macro}{\FD@codepoint}
+% \changes{1.918}{2001/06/17}{Macro added. (LH)}
+% \begin{macro}{\FD@charname}
+% \changes{1.918}{2001/06/17}{Macro added. (LH)}
+% Since ISO\,10646\slash Unicode has become the primary reference for
+% identifying characters, we provide a special comment command for
+% specifying which Unicode character corresponds to a particular slot
+% in an encoding. \label{Unicode} The syntax is
+% \begin{quote}
+% |\Unicode|\marg{code point}\marg{name}
+% \end{quote}
+% where the \meta{code point} is the four hexadecimal digits that
+% identify the code point of the character and \meta{name} is the
+% name of the character. An example is
+% \begin{quote}
+% |\Unicode{0041}{LATIN CAPITAL LETTER A}|
+% \end{quote}
+% which is typeset as
+% \begin{quote}
+% Unicode character \texttt{U+0041}, \textsc{latin capital letter a}.
+% \end{quote}
+% The \meta{name} field may be left empty.
+%
+% The |\Unicode| command makes a whole |\comment|, but it is also
+% useful to have a similar command for writing such data as part of a
+% longer paragraph. The |\textunicode| command, which has the same
+% argument structure as |\Unicode|, is provided for this. If you write
+% \begin{quote}
+% |see also \textunicode{0041}{LATIN CAPITAL LETTER A} for|
+% \end{quote}
+% then this is typeset as
+% \begin{quote}
+% see also \texttt{U+0041} (\textsc{latin capital letter a}) for
+% \end{quote}
+%
+% As case is not significant in the character names and they
+% furthermore usually seem to be written in capitals, I have chosen
+% to typeset them using small capitals only. This is done by
+% |\FD@charname|. The |\FD@codepoint| macro similarly handles
+% typesetting of code points. See also the \texttt{hypertex} option
+% to the \package{fontdoc} package.
+%
+% The \package{fontinst} and \package{finstmsc} definitions of
+% |\Unicode| are to gobble the arguments.
+% \begin{macrocode}
+%<pkg|misc>\let\Unicode=\gobble_two
+%<*doc>
+\newcommand*\Unicode[2]{%
+ \comment{%
+ \spaceskip=\fontdimen2\font minus 1.1\fontdimen4\font
+ Unicode character \FD@codepoint{#1}%
+ \ifx \par#2\par \else , \FD@charname{#2}\fi.%
+ \linepenalty=300\par
+ }%
+}
+\newcommand*\textunicode[2]{%
+ \FD@codepoint{#1} \ifx\par#2\par\else(\FD@charname{#2})\fi
+}
+\providecommand*\FD@codepoint[1]{\texttt{U+\uppercase{#1}}}
+\providecommand*\FD@charname[1]{\textsc{\lowercase{#1}}}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \DescribeMacro{\vartop}
+% \DescribeMacro{\varmid}
+% \DescribeMacro{\varbot}
+% \DescribeMacro{\varrep}
+% The \meta{varchar commands} are:
+% \begin{quote}
+% |\vartop|\marg{glyph}\\
+% |\varmid|\marg{glyph}\\
+% |\varbot|\marg{glyph}\\
+% |\varrep|\marg{glyph}
+% \end{quote}
+% These too do by default, which is overridden later, nothing in
+% \package{fontinst} but typeset descriptive headings in \package{fontdoc}.
+%
+% \begin{macro}{\varchar}
+% \begin{macro}{\vartop}
+% \begin{macro}{\varmid}
+% \begin{macro}{\varbot}
+% \begin{macro}{\varrep}
+% \begin{macro}{\endvarchar}
+% \begin{macrocode}
+%<*pkg|misc>
+\let\varchar=\empty_command
+\let\vartop=\gobble_one
+\let\varmid=\gobble_one
+\let\varbot=\gobble_one
+\let\varrep=\gobble_one
+\let\endvarchar=\empty_command
+%</pkg|misc>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\varchar{\Bheading{Extensible glyph:}}
+\def\vartop#1{\Bheading{Top} \typeset@glyph{#1}}
+\def\varmid#1{\Bheading{Middle} \typeset@glyph{#1}}
+\def\varbot#1{\Bheading{Bottom} \typeset@glyph{#1}}
+\def\varrep#1{\Bheading{Repeated} \typeset@glyph{#1}}
+\let\endvarchar\relax
+%</doc>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\useexamplefont}
+% \begin{macro}{\slotexample}
+% \begin{macro}{\setslotcomment}
+% \begin{macro}{\resetslotcomment}
+% \begin{macro}{\unsetslotcomment}
+% \begin{macro}{\slot@comment}
+% \begin{macro}{\slot@font}
+% As of v\,1.8 of \package{fontinst}, we have added an interface
+% for automatic documentation of encoding files, which has been
+% developed by Matthias Clasen as part of his work on math fonts.
+% The implementation was slightly modified and integrated into
+% this version by Ulrik Vieth.
+%
+% |\setslotcomment| defines a default slot comment, stored in the
+% variable |\slot@comment|, which is subsequently used to annotate
+% all |\setslot| commands. The slot comment can be changed by
+% |\resetslotcomment| or turned off by |\unsetslotcomment|.
+%
+% |\useexamplefont| defines a default font, |\slot@font|, which
+% may be referenced by calling |\slotexample| in slot comments to
+% display the character or symbol allocated to the current slot.
+%
+% Taking advantage of this mechanism, it is possible to write:
+% \begin{quote}
+% |\useexamplefont{FONT}|\\[0.5\baselineskip]
+% |\setslotcomment{The symbol `\slotexample'.}|\\
+% |\setslot{FOO}\endsetslot|\\
+% |\setslot{BAR}\endsetslot|\\
+% |\resetslotcomment{The character `\slotexample'.}|\\
+% |\setslot{BAZ}\endsetslot|
+% \end{quote}
+% instead of having to write:
+% \begin{quote}
+% |\usepackage{PACKAGE-to-use-symbols-from-FONT}|\\[0.5\baselineskip]
+% |\setslot{FOO}\comment{The symbol `\foo'.}\endsetslot|\\
+% |\setslot{BAR}\comment{The symbol `\bar'.}\endsetslot|\\
+% |\setslot{BAZ}\comment{The character `\baz'.}\endsetslot|
+% \end{quote}
+%
+% These macros never do anything in \package{fontinst}, they just
+% gobble their arguments.
+% \begin{macrocode}
+%<*pkg|misc>
+\let\useexamplefont=\gobble_one
+\let\slotexample=\empty_command
+\let\setslotcomment=\gobble_one
+\let\resetslotcomment=\gobble_one
+\let\unsetslotcomment=\empty_command
+%</pkg|misc>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newif\ifslot@comment@
+\slot@comment@false
+\def\slot@comment{}
+\newcommand\setslotcomment[1]{%
+ \slot@comment@true
+ \gdef\slot@comment{#1}%
+}
+\newcommand\resetslotcomment[1]{\gdef\slot@comment{#1}}
+\newcommand\unsetslotcomment{%
+ \slot@comment@false
+ \global\let\slot@comment\@empty
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\slot@font=\nullfont
+\newcommand\useexamplefont[1]{\font\slot@font=#1 }
+\newcommand\slotexample{%
+ \ifFD@slot@known@{\slot@font\char\slot@number}\fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setfontdimen}
+% \changes{1.917}{2001/03/16}{Command added. (LH)}
+% The |\setfontdimen| command is used in an ETX file to set a font
+% dimen. The syntax is
+% \begin{quote}
+% |\setfontdimen|\marg{fontdimen no.}\marg{integer}
+% \end{quote}
+% where \meta{fontdimen no.} and \meta{integer} are \emph{string}
+% expressions. \meta{fontdimen no.} specifies the fontdimen to set.
+% \meta{integer} is the name of the integer variable to whose value
+% the fontdimen will be set.
+%
+% When used in font installation, the above |\setfontdimen| command
+% is equivalent to
+% \changes{1.923}{2002/10/25}{Leave the fontdimen unset when the
+% integer variable has not been set. (LH)}
+% \begin{quote}
+% |\ifisint|\marg{integer}|\then|\\
+% | \setint{fontdimen(|\meta{fontdimen no.}|)}{\int{|^^A
+% \meta{integer}|}}|\\
+% |\fi|
+% \end{quote}
+% but |\setfontdimen| is also understood by the (V)PL-to-MTX
+% converter as declaring an integer that the generated MTX file
+% should set to the value of the fontdimen in the (V)PL.
+% \begin{macrocode}
+%<*pkg>
+\def\setfontdimen#1#2{
+ \ifisint{#2}\then \setint{fontdimen(#1)}{\int{#2}} \fi
+}
+%</pkg>
+%<misc>\let\setfontdimen\gobble_two
+%<*doc>
+\newcommand\setfontdimen[2]{%
+ \Bheading{Fontdimen} \TypesetStringExpression{#1} is
+ \(\TypesetIntegerExpression{\int{#2}}\)%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\label}
+% \changes{1.917}{2001/03/23}{Macro added. (LH)}
+% \package{fontinst} and \package{finstmsc} defines the \LaTeX\
+% |\label| command to gobble its argument, so that one can use it to
+% reference slots.
+% \begin{macrocode}
+%<pkg|misc>\let\label=\gobble_one
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{switch}{direct}
+% The encoding aspect of a font can to a large extent be understood
+% as a mapping from the set of slots to the set of glyphs---such
+% mappings are for example realised by PostScript encoding vectors
+% (mapping slots to glyph names) and virtual fonts (mapping slots to
+% DVI commands for drawing a glyph). In some cases however, encodings
+% are rather used to specify an inverse mapping going the opposite
+% way. Since encodings are in general many-to-one, this means there
+% need not be a proper inverse to a given encoding; instead the
+% inverse image of a glyph is in practice chosen randomly\footnote{In
+% the sense: according to a very deterministic (but not particularly
+% useful) rule which depends completely on details in the
+% implementation, and therefore should not be relied upon anyway.}
+% among the slots that are mapped to it. This is not always desirable.
+%
+% The \texttt{direct} switch can be used to check whether an encoding
+% is interpreted in the direct (slots to glyphs) or inverse (glyphs to
+% slots) manner. If those |\setslot| commands which are undesirable
+% under the inverse interpretation are put inside an |\ifdirect|
+% \dots\ |\Fi| construction, then these will be ignored in that
+% circumstance, thus allowing the programmer to exactly specify both
+% the direct and the inverse mappings.
+% \changes{1.924}{2003/02/08}{Command added. (LH)}
+%
+% In \package{fontinst}, this command is a switch, which is usually
+% true.
+% \begin{macrocode}
+%<pkg|misc>\newif\ifdirect \directtrue
+% \end{macrocode}
+% In \package{fontdoc}, this is a conditional that will be typeset
+% if |\showbranches| is being used.
+% \begin{macrocode}
+%<doc>\newcommand\ifdirect{\generic@if{direct}}
+% \end{macrocode}
+% \end{switch}
+%
+% \begin{macro}{\input_mtx_as_etx}
+% The |\input_mtx_as_etx| command is syntactically similar to the
+% |\inputetx| command, but it inputs an MTX file instead of an ETX
+% file and redefines |\setscaledrawglyph| so that it expands to a
+% |\nextslot| followed by a |\setslot| \dots\ |\endsetslot|. This is
+% useful when making proofs of fonts with nonstandard encodings, as
+% the MTX of a font can be used to specify ``the default encoding''
+% of that font.
+%
+% \textbf{Warning:} Since this macro redefines a lot of the metric
+% commands, you'll probably only want to call it inside a group.
+% \changes{1.923}{2002/10/24}{Macro added. (LH)}
+% \begin{macrocode}
+%<*pkg|misc>
+\def\input_mtx_as_etx#1{
+ \def\setscaledrawglyph##1##2##3##4##5##6##7##8##9{
+ \nextslot{##5}
+ \setslot{##1}\endsetslot
+ }
+ \offcommand\setscalednotglyph
+ \let\setglyph=\gobble_glyph
+ \offcommand\setkern
+ \inputmtx{#1}
+}
+%</pkg|misc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Metric files}
+% \label{Sec:Metric files}
+%
+% \changes{1.911}{1999/11/17}{Definitions of metric file commands
+% added to \protect\protect\protect\Module{misc}. (LH)}
+%
+% \DescribeMacro{\inputmtx}
+% The macro
+% \begin{quote}
+% |\inputmtx|\marg{filename}
+% \end{quote}
+% inputs \meta{filename}|.mtx|, ignoring anything between |\relax| and
+% |\metrics|, and anything after |\endmetrics|.
+%
+% \begin{macro}{\inputmtx}
+% \begin{macro}{\metrics}
+% \changes{1.914}{2000/05/26}{Fixed typo: \cs{x@relax} instead of
+% \cs{x_relax}. (LH)}
+% \usechange{raggedright}
+% \begin{macro}{\endmetrics}
+% \changes{1.900}{1999/02/08}{Made it outer. (LH)}
+% \usechange{raggedright}
+% \begin{macro}{\endmetrics_text}
+% \begin{macro}{\endmetrics@hook}
+% The |\endmetrics_text| macro expands to |\endmetrics| (eleven
+% `other' tokens, not one control sequence token). It is used instead
+% of |\string\endmetrics|, which does not work since |\endmetrics| is
+% outer.
+% \begin{macrocode}
+%<*pkg|misc>
+\def\inputmtx#1{
+ \def\relax{\let\relax=\x_relax\iffalse}
+ \let\metrics=\fi
+ \primitiveinput #1.mtx\x_relax
+ \let\relax=\x_relax
+}
+\let\metrics=\x_relax
+\edef\endmetrics_text{\string\endmetrics}
+\outer\def\endmetrics{\endinput}
+%</pkg|misc>
+% \end{macrocode}
+% |\inputmtx| used to set |\a_count|, but we haven't been able to
+% find a reason for this, so it was removed.
+%
+% In \package{fontdoc}, the |\metrics| and |\endmetrics| macros
+% initially just define a group, but |\inputmtx| redefines them to
+% work as they do in \package{fontinst}. |\endmetrics@hook| is a
+% macro that gets executed just before the |\endgroup| in
+% |\endmetrics|; it is normally |\@empty|, and it is set to this value
+% at each |\metrics|, but the metric package system redefines it.
+% \multchanges{\cs{endmetrics_hook}}{1.914}{2000/05/27}{Macro added.
+% (LH)}
+% \multchanges{\cs{inputetx}\cs{inputmtx}}{1.914}{2000/05/27}
+% {New \package{fontdoc} definition, using \cs{IfFileExists}. (LH)}
+% \begin{macrocode}
+%<*doc>
+\def\inputmtx#1{%
+ \begingroup
+ \edef\lowercase@file{\lowercase{%
+ \edef\noexpand\lowercase@file{#1}%
+ }}%
+ \lowercase@file
+ \let\endmetrics@hook=\@empty
+ \IfFileExists{\lowercase@file.mtx}{%
+ \skip@mtx@preamble
+ \@@input \@filef@und
+ \let\relax=\x@relax
+ }{%
+ \PackageError{fontdoc}{File #1.mtx not found}%
+ {\@eha\MessageBreak You can \protect\inputmtx\space
+ some other file now, if you want.}%
+ }
+ \endmetrics@hook
+ \endgroup
+}
+\def\skip@mtx@preamble{%
+ \def\relax{\let\relax=\x@relax\iffalse}%
+ \let\metrics=\fi
+ \outer\x@cs\def{endmetrics}{\endinput}%
+}
+\def\metrics{%
+ \begin{flushleft}%
+ \let\endmetrics@hook=\@empty
+}
+\outer\def\endmetrics{%
+ \endmetrics@hook
+ \end{flushleft}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\ProvidesMtxPackage}
+% \changes{1.923}{2003/01/05}{Redesigned the headings for metric
+% packages, since they interact poorly with \cs{section} headings.
+% (LH)}
+% \begin{switch}{@mtxpackage@headed@}
+% \begin{macro}{\announce@package}
+% \begin{macro}{\finish@package}
+% \multchanges{\cs{ProvidesMtxPackage}\cs{usemtxpackage}}{1.914}
+% {2000/05/27}{New \package{fontdoc} implementation---the packages
+% are actually loaded (they have to, since they can define
+% commands). Multiple loading is prevented as in
+% \package{fontinst}. (LH)}
+% The call
+% \begin{quote}
+% |\ProvidesMtxPackage|\marg{package~name}
+% \end{quote}
+% signals to the package managing system that there is no need to load
+% this package again.
+% \begin{macrocode}
+%<pkg>\def\ProvidesMtxPackage#1{\x_cs\let{pack-#1}P}
+%<*doc>
+\def\ProvidesMtxPackage#1{%
+ \endmetrics@hook
+% \@mtxpackage@headed@false
+% \everypar={
+ \announce@package{#1}%
+% }%
+ \def\endmetrics@hook{\finish@package{#1}}
+ \global\x@cs\let{FD@pack-#1}\@empty
+}
+% \end{macrocode}
+% \begin{macrocode}
+% \newif\if@mtxpackage@headed@
+% \end{macrocode}
+% \begin{macrocode}
+\def\announce@package#1{%
+% \everypar={}%
+% \@mtxpackage@headed@true
+ \Aheading{[Start of metric package \textsf{#1}.}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\finish@package#1{%
+% \if@mtxpackage@headed@
+ \Aheading{End of metric package \textsf{#1}.]}%
+% \else
+% \everypar={}%
+% \Aheading{(Metric package \textsf{#1}.)}%
+% \fi
+ \par\addvspace\medskipamount
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{switch}\end{macro}
+%
+%
+% \begin{macro}{\usemtxpackage}
+% The call
+% \begin{quote}
+% |\usemtxpackage|\marg{package~list}
+% \end{quote}
+% inputs those of the packages in the list that have not been loaded
+% yet (i.e., those for which no |\ProvidesMtxPackage| has been made).
+% Each package is assumed to reside in the metric file that
+% |\inputmtx| loads when given the name of the package as argument.
+%
+% The call
+% \begin{quote}
+% |\usemtxpackage|\oarg{filename}\marg{package~list}
+% \end{quote}
+% inputs the packages in the list if at least one of them has not been
+% loaded yet. In this case, all the packages are assumed to reside in
+% the single metric file that |\inputmtx| loads when given
+% \meta{filename} as argument.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\usemtxpackage{\futurelet\next_token\test_UseMtxPkg_arguments}
+\def\test_UseMtxPkg_arguments{\ifx\next_token[
+ \expandafter\mtx_package_given_file
+ \else
+ \expandafter\mtx_package_separate_files
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\mtx_package_given_file[#1]#2{
+ \_a_false
+ \process_csep_list\load_true_unless_loaded #2,\process_csep_list,
+ \if_a_ \inputmtx{#1} \fi
+}
+\def\load_true_unless_loaded#1{
+ \x_cs\ifx{pack-#1}P\else\_a_true\fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\mtx_package_separate_files#1{
+ \process_csep_list\load_file_unless_loaded #1,\process_csep_list,
+}
+\def\load_file_unless_loaded#1{
+ \x_cs\ifx{pack-#1}P\else \inputmtx{#1} \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\usemtxpackage[2][\x@relax]{%
+ \ifx \x@relax#1%
+ \@for\@tempa:=#2\do{%
+ \x@cs\ifx{FD@pack-\@tempa}\@empty \else
+ \inputmtx{\@tempa}%
+ \fi
+ }%
+ \else
+ \@tempswafalse
+ \@for\@tempa:=#1\do{%
+ \x@cs\ifx{FD@pack-\@tempa}\@empty \else \@tempswatrue \fi
+ }%
+ \if@tempswa
+ \inputmtx{#2}%
+ \fi
+ \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glyph_name_modifier}
+% The |\glyph_name_modifier| macro is applied to all glyph names
+% supplied to commands that are allowed in transformable MTX files
+% (see Subsection~\ref{Ssec:TransMTX}). The syntax is
+% \begin{quote}
+% |\glyph_name_modifier|\marg{glyph name}
+% \end{quote}
+% and the above must expand fully to a valid glyph name in \TeX's
+% mouth.
+%
+% \changes{1.923}{2002/10/20}{Macro added. (LH)}
+% The normal definition is to simply expand to the \meta{glyph name},
+% i.e.,
+% \begin{macrocode}
+%<pkg>\let\glyph_name_modifier=\identity_one
+% \end{macrocode}
+% but the command may expand to any sequence of character tokens. It
+% was introduced to support (simple) automatic renaming of glyphs
+% in cases where the |\reglyphfont| command would not be appropriate,
+% such as when the wanted renaming is simply to add a short suffix to
+% the glyph names.
+%
+% The reason it only affects the commands allowed in transformable
+% MTX files is that the macro isn't meant as a generic override for
+% metric commands.
+% \end{macro}
+%
+%
+% \subsection{Kerning information}
+%
+% The kerning information is kept in the macros
+% \describecsfamily{l-\meta{name}}|\l-|\meta{name} and
+% \describecsfamily{r-\meta{name}}|\r-|\meta{name}, containing
+% information about how \meta{name} kerns on the left and on the right,
+% respectively. The |\l-|\meta{name} macro should expand out to a
+% series of
+% \begin{quote}
+% \DescribeMacro{\k}|\k|\,|\r-|\meta{name}\,|\|\meta{amount}
+% \end{quote}
+% control sequences, and vice versa. Examples of
+% \describecsfamily{\meta{amount}} |\|\meta{amount}
+% control sequences are: |\0|, |\1|, |\1000|, |\-50|, |\33|; these
+% corresponds to the kern amounts $0$, $1$, $1000$ (which would be
+% a very large kern), $-50$, and $33$ respectively.
+%
+%
+% \begin{macro}{\setkern}
+% |\setkern|\marg{glyph1}\marg{glyph2}\marg{integer expression}
+%
+% Sets a kern pair between \meta{glyph1} and \meta{glyph2} to the
+% specified value, which is typically a value returned by
+% |\kerning|\marg{glyph3}\marg{glyph4}. If there already is a kern
+% set between \meta{glyph1} and \meta{glyph2} then this will not affect
+% the output, but it will use up another 3 units of token memory.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\setkern#1#2#3{
+ \x_cs\ifx{i-rawscale}\x_relax
+ \expandafter\set_kern
+ \csname~r-\glyph_name_modifier{#1}\expandafter\endcsname
+ \csname~l-\glyph_name_modifier{#2}\endcsname
+ {#3}
+ \else
+ \expandafter\set_kern
+ \csname~r-\glyph_name_modifier{#1}\expandafter\endcsname
+ \csname~l-\glyph_name_modifier{#2}\endcsname
+ {\scale{#3}{\int{rawscale}}}
+ \fi
+}
+\def\set_kern#1#2#3{
+ \eval_expr{#3}
+ \expandafter\set_kern_cs\csname\the\result\endcsname#1#2
+}
+\def\set_kern_cs#1#2#3{
+ \add_to#2{\k#3#1}
+ \add_to#3{\k#2#1}
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\setkern[3]{%
+ \Bheading{Kern} \typeset@glyph{#1}${{}+{}}$\typeset@glyph{#2}%
+ ${}\rightarrow \TypesetIntegerExpression{#3}$%
+}
+%</doc>
+%<misc>\let\setkern=\gobble_three
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\resetkern}
+% |\resetkern|\marg{glyph1}\marg{glyph2}\marg{integer expression}
+%
+% Resets the kern pair between \meta{glyph1} and \meta{glyph2} to
+% the specified value. Note however that this does not relieve \TeX\
+% of the burden to remember the previous kerning pair between these
+% two glyphs (if there was one).
+%
+% \begin{macrocode}
+%<*pkg>
+\def\resetkern#1#2#3{
+ \x_cs\ifx{i-rawscale}\x_relax
+ \expandafter\reset_kern
+ \csname~r-#1\expandafter\endcsname
+ \csname~l-#2\endcsname{#3}
+ \else
+ \expandafter\reset_kern
+ \csname~r-#1\expandafter\endcsname
+ \csname~l-#2\endcsname{\scale{#3}{\int{rawscale}}}
+ \fi
+}
+\def\reset_kern#1#2#3{
+ \eval_expr{#3}
+ \expandafter\reset_kern_cs\csname\the\result\endcsname#1#2
+}
+\def\reset_kern_cs#1#2#3{
+ \prep_to#2{\k\expandafter#3\expandafter#1}
+ \prep_to#3{\k\expandafter#2\expandafter#1}
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\resetkern[3]{%
+ \Bheading{Override kern} \typeset@glyph{#1}${{}+{}}$\typeset@glyph{#2}%
+ ${}\rightarrow \TypesetIntegerExpression{#3}$%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setleftkerning}
+% \begin{macro}{\setrightkerning}
+% \begin{macro}{\setleftrightkerning}
+% |\setleftkerning|\marg{glyph1}\marg{glyph2}\marg{scaled}\\
+% |\setrightkerning|\marg{glyph1}\marg{glyph2}\marg{scaled}\\
+% |\setleftrightkerning|\marg{glyph1}\marg{glyph2}\marg{scaled}
+%
+% Sets left or right kerning of \meta{glyph1} to that of \meta{glyph2}
+% scaled by \meta{scaled} (which is an integer expression).
+% |\setleftrightkerning| does both.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\setleftkerning#1#2#3{
+ \eval_expr_to\b_count{#3}
+ \expandafter\set_kerning
+ \csname~l-#1\expandafter\endcsname
+ \csname~l-#2\endcsname
+}
+\def\setrightkerning#1#2#3{
+ \eval_expr_to\b_count{#3}
+ \expandafter\set_kerning
+ \csname~r-#1\expandafter\endcsname
+ \csname~r-#2\endcsname
+}
+\def\setleftrightkerning#1#2#3{
+ \eval_expr_to\b_count{#3}
+ \expandafter\set_kerning
+ \csname~l-#1\expandafter\endcsname
+ \csname~l-#2\endcsname
+ \expandafter\set_kerning
+ \csname~r-#1\expandafter\endcsname
+ \csname~r-#2\endcsname
+}
+\def\set_kerning#1#2{
+ \if\b_count=\one_thousand
+ \def\k##1##2{
+ \set_kern_cs##2##1#1
+ }
+ \else
+ \def\k##1##2{
+ \set_kern##1#1{
+ \scale\b_count{\expandafter\gobble_one\string##2}
+ }
+ }
+ \fi
+ #2
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\setleftkerning[3]{%
+ \Bheading{Kern} \typeset@glyph{#1} on the left like
+ \typeset@glyph{#2} \ConditionallyScaled{#3}}
+\newcommand\setrightkerning[3]{%
+ \Bheading{Kern} \typeset@glyph{#1} on the right like
+ \typeset@glyph{#2} \ConditionallyScaled{#3}}
+\newcommand\setleftrightkerning[3]{%
+ \Bheading{Kern} \typeset@glyph{#1} on the left and right like
+ \typeset@glyph{#2} \ConditionallyScaled{#3}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ConditionallyScaled}
+% \changes{1.916}{2001/01/06}{Command added. (LH)}
+% Several metric commands have take a scaling factor argument which is
+% rendered by \package{fontdoc} as ``scaled \meta{argument}''. The by
+% far most common value for this argument is however the constant
+% number 1000 (no scaling), and in those cases the ``scaled
+% \textellipsis'' feels a bit long-winded. The cure for this is the
+% |\Conditionally|\-|Scaled| command, which takes an integer expression
+% as its argument and typesets the ``scaled \meta{integer expression}''
+% \emph{unless} that expression evaluates to 1000, in which case
+% |\Conditionally|\-|Scaled| simply gobbles any spaces following it.
+% \begin{macrocode}
+\newcommand\ConditionallyScaled[1]{%
+ \FD@evaluate@true
+ \FD@eval@expr{#1}%
+ \@tempswatrue
+ \ifFD@evaluate@ \ifnum \FD@result=\@m \@tempswafalse \fi\fi
+ \FD@evaluate@false
+ \if@tempswa scaled \(\FD@expression\)\else \ignorespaces \fi
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\kerning}
+% |\kerning|\marg{glyph1}\marg{glyph2}
+%
+% Returns the value of kern pair between \meta{glyph1} and
+% \meta{glyph2} as an integer. Returns a value of zero if such a kern
+% pair doesn't exist.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\kerning#1#2{0\x_relax
+ \def\k##1{\csname~set-\string##1\endcsname\gobble_one}
+ \bgroup
+ \x_cs\def{set-\string\l-#2}##1##2{
+ \global\result=\expandafter\gobble_one\string##2\egroup
+ }
+ \csname~r-#1\endcsname
+ \csname~set-\string\l-#2\endcsname\gobble_one{00}
+}
+%</pkg>
+% \end{macrocode}
+% \changes{1.909}{1999/10/19}{A use of \#1 where it should have
+% been \#2 was corrected. (LH)}
+% \begin{macrocode}
+%<*doc>
+\DeclareRobustCommand\kerning[2]{%
+ \begingroup
+ \MakePrintable\@tempa{FD@swa}{#1}%
+ \MakePrintable\@tempb{FD@swa}{#2}%
+ \protected@xdef\FD@expression{%
+ \mathop{\protect\mathrm{k{}}}(%
+ \text{\protect\FD@typeset@string{\@tempa}}%
+ ,\penalty\FD@commapenalty
+ \text{\protect\FD@typeset@string{\@tempb}}%
+ )%
+ }%
+ \global\chardef\FD@priority=5%
+ \global\FD@bracket@level=\@ne
+ \FD@evaluate@false
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifiskern}
+% |\ifiskern|\marg{glyph1}\marg{glyph2}|\then|
+%
+% This command tests if there is a kern pair between \meta{glyph1} and
+% \meta{glyph2}. It's hard to say if there is a use for it, but it is
+% included for symmetry.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\ifiskern#1#2\then{
+ \def\k##1##2{\ifx T##1 \let\k\gobble_two \fi}
+ \bgroup
+ \x_cs\let{l-#2}T
+ \csname r-#1\endcsname
+ \expandafter\egroup \ifx\k\gobble_two
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\ifiskern#1#2\then{%
+ \generic@if{kern \typeset@glyph{#1}${}+{}$\typeset@glyph{#2} set}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\unsetkerns}
+% |\unsetkerns|\marg{left~glyph~list}\marg{right~glyph~list}
+%
+% This command unsets all kerns with a glyph in the \meta{left~glyph~list}
+% on the left and a glyph in the \meta{right~glyph~list} on the right.
+% The lists themselves are ordinary comma-separated lists. Unlike
+% |\setkern| and |\resetkern|, |\unsetkerns| actually removes the
+% kerning pairs from \TeX's memory.
+%
+% The implementation itself simply goes through |\r-|\meta{left~glyph}
+% for each element \meta{left~glyph} in \meta{left~glyph~list} and
+% |\l-|\meta{right~glyph} for each element \meta{right~glyph} in
+% \meta{right~glyph~list}, removing each |\k|\meta{token}\meta{token}
+% tripple that refers to a glyph from the opposite list as it goes
+% along. To make this test reasonably fast, the routine first ``marks''
+% the glyphs in the other list by setting the control sequences
+% |\slots-|\meta{glyph} to |U| (the letter token U). This mark is
+% later removed when the |\r-|\meta{glyph} or |\l-|\meta{glyph}
+% respectively control sequences have been gone through; the
+% |\slots-|\meta{glyph} control sequences are then set to |\relax|.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\unsetkerns#1#2{
+ \let\k\k_unless_to_U
+ \process_csep_list\make_slots_U#1,\process_csep_list,
+ \def\do##1{\x_cs\main_remove_Us{l-##1}}
+ \process_csep_list\do#2,\process_csep_list,
+ \process_csep_list\make_slots_relax#1,\process_csep_list,
+ \process_csep_list\make_slots_U#2,\process_csep_list,
+ \def\do##1{\x_cs\main_remove_Us{r-##1}}
+ \process_csep_list\do#1,\process_csep_list,
+ \process_csep_list\make_slots_relax#2,\process_csep_list,
+}
+\def\make_slots_U#1{\x_cs\let{slots-#1}U}
+\def\make_slots_relax#1{\x_cs\let{slots-#1}\x_relax}
+\def\k_unless_to_U#1#2{
+ \x_cs\ifx{slots-\expandafter\gobble_three\string#1}U \else
+ \noexpand\k\noexpand#1\noexpand#2
+ \fi
+}
+\def\main_remove_Us#1{
+ \ifx#1\x_relax \else
+ \edef#1{#1}
+ \ifx#1\empty_command \let#1\x_relax \fi
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\unsetkerns[2]{%
+ \Bheading{Remove} all kerning pairs in
+ \FD@typeset@string@set{#1}${}\times{}$\FD@typeset@string@set{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FD@typeset@string@set}
+% \begin{macro}{\FD@typeset@string@set@}
+% \multchanges{\cs{FD@typeset@string@set}^^A
+% \cs{FD@typeset@string@set@}}{1.916}{2001/01/02}{Macros added.
+% \cs{FD@typeset@string@set} should be used instead of
+% \cs{print@csep@list} in most occations. (LH)}
+% The |\FD@typeset@string@set| macro takes a comma-separated list of
+% string expressions as argument and typesets that list as elements of
+% a set, e.g.
+% \begin{quote}
+% |\FD@typeset@string@set{a,b,\str{c}}|
+% \end{quote}
+% is typeset as
+% \begin{quote}
+% $\{$\texttt{a}$,{}$\texttt{b}$,\mathrm{s}($\texttt{c}$)\}$
+% \end{quote}
+% \begin{macrocode}
+\def\FD@typeset@string@set#1{%
+ \toks@={}%
+ \@for\@tempa:=#1\do{%
+ \protected@edef\@tempa{%
+ \noexpand\MakePrintable \noexpand\@tempa {FD@swa}{\@tempa}%
+ }%
+ \@tempa
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\do \expandafter{\@tempa}}%
+ }%
+ \expandafter\FD@typeset@string@set@ \expandafter{\the\toks@}%
+}
+\def\FD@typeset@string@set@#1{%
+ \TypesetList{$\{$}{$,\penalty\FD@commapenalty{}$}%
+ {$,\penalty\FD@commapenalty{}$}{$,\penalty\FD@commapenalty{}$}%
+ {$\}$}{$\emptyset$}{\FD@typeset@string}{#1}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\noleftkerning}
+% \changes{1.906}{1999/07/30}{Macro added. (LH)}
+% \begin{macro}{\norightkerning}
+% \changes{1.906}{1999/07/30}{Macro added. (LH)}
+% \begin{macro}{\noleftrightkerning}
+% \changes{1.906}{1999/07/30}{Macro added. (LH)}
+% The argument of these commands is the name of a glyph. The commands
+% removes all kerns on the left, on the right, and on both sides
+% respectively, of this glyph.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\noleftkerning#1{\no_kerning{l}{#1}}
+\def\norightkerning#1{\no_kerning{r}{#1}}
+\def\noleftrightkerning#1{\no_kerning{l}{#1}\no_kerning{r}{#1}}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\noleftkerning[1]{%
+ \Bheading{Remove kerns} on the left of glyphs in
+ \FD@typeset@string@set{#1}.}
+\newcommand\norightkerning[1]{%
+ \Bheading{Remove kerns} on the right of glyphs in
+ \FD@typeset@string@set{#1}.}
+\newcommand\noleftrightkerning[1]{%
+ \Bheading{Remove kerns} on any side of glyphs in
+ \FD@typeset@string@set{#1}.}
+%</doc>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\no_kerning}
+% \changes{1.906}{1999/07/30}{Macro added. (LH)}^^A
+% \changes{1.906}{1999/08/01}{Macro thoroughly rewritten. (LH)}^^A
+% This macro is called as
+% \begin{quote}
+% |\no_kerning|\marg{side}\marg{glyph list}
+% \end{quote}
+% where \meta{side} is |l| or |r|, and \meta{glyph list} is a
+% comma-separated list of glyph names. The macro unsets all kerns on
+% the \meta{side} side of the glyphs in the \meta{glyph list}.
+%
+% \begin{macrocode}
+%<*pkg>
+\def\no_kerning#1#2{
+ \let\k\no_kerning_i
+ \def\do##1{\csname #1-##1\endcsname}
+ \bgroup
+ \aftergroup\def \aftergroup\a_macro \aftergroup{
+ \process_csep_list\do #2,\process_csep_list,
+ \aftergroup}
+ \egroup
+ \def\do##1{\expandafter\let \csname #1-##1\endcsname \x_relax}
+ \process_csep_list\do #2,\process_csep_list,
+ \let\k\no_kerning_ii
+ \def\do##1{\edef##1{##1}}
+ \a_macro
+}
+% \end{macrocode}
+% \begin{macro}{\no_kerning_i}
+% The |\no_kerning_i| macro is used by |\no_kerning| in constructing
+% a list of all glyphs that a glyph in the \meta{glyph list} has a
+% \meta{side} kern to, while avoiding repetitions.
+% \begin{macrocode}
+\def\no_kerning_i#1#2{
+ \ifx #1\x_relax \else
+ \aftergroup\do \aftergroup#1
+ \let #1\x_relax
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\no_kerning_ii}
+% The |\no_kerning_ii| macro is similar to the |\k_unless_to_U|
+% macro.
+% \begin{macrocode}
+\def\no_kerning_ii#1#2{
+ \ifx #1\x_relax \else \noexpand\k \noexpand#1 \noexpand#2 \fi
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{Glyph information}
+% \label{Ssec:Glyph-info}
+%
+% The glyph information is kept in the macros
+% \describecsfamily{g-\meta{name}}|\g-|\meta{name}, which expands
+% out to:
+% \begin{quote}
+% \marg{width}\marg{height}\marg{depth}\marg{italic}^^A
+% \marg{mapcommands}\marg{mapfonts}
+% \end{quote}
+% where the \meta{mapcommands} will write out VPL |MAP| fragments to a
+% |.vpl| file, and the \meta{mapfonts} will produce any |MAPFONT|
+% instructions that are needed.
+%
+%
+% \begin{macro}{\typeset@glyph}
+% \changes{1.909}{1999/10/20}{Macro added, and most commands that
+% print a glyph name changed to use this macro. (LH)}
+% \changes{1.916}{2001/01/02}{Macro redefined (made synonymous to
+% \cs{Typeset\-String\-Expression}). (LH)}
+% The |\typeset@glyph| macro takes a string expression and typesets
+% that as the name of a glyph. Currently names of glyphs are formatted
+% precisely the same as any other string expression.
+% \begin{macrocode}
+%<doc>\let\typeset@glyph=\TypesetStringExpression
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\width}
+% \begin{macro}{\height}
+% \begin{macro}{\depth}
+% \begin{macro}{\italic}
+% |\width|\marg{glyph}\\
+% |\height|\marg{glyph}\\
+% |\depth|\marg{glyph}\\
+% |\italic|\marg{glyph}
+%
+% In \package{fontinst}, these macros return the width, height,
+% depth, and italic correction of \meta{glyph} as an integer.
+% \begin{macrocode}
+%<*pkg>
+\def\width{\glyph_parameter\first_of_six}
+\def\height{\glyph_parameter\second_of_six}
+\def\depth{\glyph_parameter\third_of_six}
+\def\italic{\glyph_parameter\fourth_of_six}
+%</pkg>
+% \end{macrocode}
+%
+% In \package{fontdoc}, they print symbolic representations for the
+% corresponding integer expressions.
+% \begin{macrocode}
+%<*doc>
+\DeclareRobustCommand\width[1]{\FD@glyph@metric{w}{#1}}
+\DeclareRobustCommand\height[1]{\FD@glyph@metric{h}{#1}}
+\DeclareRobustCommand\depth[1]{\FD@glyph@metric{d}{#1}}
+\DeclareRobustCommand\italic[1]{\FD@glyph@metric{i}{#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\FD@glyph@metric}
+% The |\FD@glyph@metric| macro is a convenient shorthand to use when
+% defining integer-valued functions which represents some glyph
+% metric (e.g.\ \cs{height}). Its syntax is
+% \begin{quote}
+% |\FD@glyph@metric|\marg{func-name}\marg{string expression}
+% \end{quote}
+% The \meta{string expression} must be expanded.
+% \begin{macrocode}
+\def\FD@glyph@metric#1#2{%
+ \begingroup
+ \MakePrintable\@tempa{FD@swa}{#2}%
+ \protected@xdef\FD@expression{%
+ \protect\FD@integer@func{#1}{\@tempa}%
+ }%
+ \global\chardef\FD@priority=5%
+ \global\FD@bracket@level=\@ne
+ \FD@evaluate@false
+ \endgroup
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\mapcommands}
+% \begin{macro}{\mapfonts}
+% These are similar to |\width| and its companions, but they are not
+% user level commands.
+% \begin{macrocode}
+%<*pkg>
+\def\mapcommands{\glyph_parameter\fifth_of_six}
+\def\mapfonts{\glyph_parameter\sixth_of_six}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyph_parameter}
+% \begin{macro}{\first_of_six}
+% \begin{macro}{\second_of_six}
+% \begin{macro}{\third_of_six}
+% \begin{macro}{\fourth_of_six}
+% \begin{macro}{\fifth_of_six}
+% \begin{macro}{\sixth_of_six}
+% \begin{macro}{\glyph_metrics}
+% These macros are used to define |\width| and its friends.
+% |\glyph_parameter| takes one of the other seven for its first
+% argument and a glyph name for its second argument. The
+% |\glyph_metrics| macro can be used if one wants to get all the
+% metric variables at once.
+% \begin{macrocode}
+%<*pkg>
+\def\glyph_parameter#1#2{
+ \expandafter\expandafter\expandafter
+ #1\csname g-#2\endcsname
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\first_of_six#1#2#3#4#5#6{#1}
+\def\second_of_six#1#2#3#4#5#6{#2}
+\def\third_of_six#1#2#3#4#5#6{#3}
+\def\fourth_of_six#1#2#3#4#5#6{#4}
+\def\fifth_of_six#1#2#3#4#5#6{#5}
+\def\sixth_of_six#1#2#3#4#5#6{#6}
+% \end{macrocode}
+% \begin{macrocode}
+\def\glyph_metrics#1#2#3#4#5#6{
+ \a_count=#1
+ \b_count=#2
+ \c_count=#3
+ \d_count=#4~
+}
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+% \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\saved_scale}
+% \begin{macro}{\saved_mapfont}
+% \begin{macro}{\saved_raw}
+% \begin{macro}{\saved_rule}
+% \begin{macro}{\saved_special}
+% \begin{macro}{\saved_warning}
+% \begin{macro}{\saved_movert}
+% \begin{macro}{\saved_moveup}
+% \begin{macro}{\saved_push}
+% \begin{macro}{\saved_pop}
+% These are the commands allowed inside a glyph. They are initally
+% set to |\relax|, so we can |\edef| with them safely.
+% \begin{macrocode}
+\let\saved_scale\x_relax
+\let\saved_mapfont\x_relax
+\let\saved_raw\x_relax
+\let\saved_rule\x_relax
+\let\saved_special\x_relax
+\let\saved_warning\x_relax
+\let\saved_movert\x_relax
+\let\saved_moveup\x_relax
+\let\saved_push\x_relax
+\let\saved_pop\x_relax
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+%
+% When the glyph is being constructed by
+% \begin{quote}
+% |\setglyph|\marg{glyph} \meta{glyph commands} |\endsetglyph|
+% \end{quote}
+% the values of each of these parameters are kept in the following
+% variables. Except for |\glyph_width|, these are kept globally,
+% so they survive through |\push| \textellipsis\ |\pop| pairs. In
+% addition, the current vertical offset is kept locally in
+% |\glyph_voffset|. The |\glyph_maxhpos| variable globally keeps track
+% of the largest horizontal offset position reached so far (with the
+% possible exception of the current position, i.e.\ width, which may
+% well be larger).
+%
+%
+% \begin{macro}{\glyph_width}
+% \begin{macro}{\glyph_height}
+% \begin{macro}{\glyph_depth}
+% \begin{macro}{\glyph_italic}
+% \begin{macro}{\glyph_map_commands}
+% \begin{macro}{\glyph_map_fonts}
+% \begin{macro}{\glyph_voffset}
+% \begin{macro}{\glyph_maxhpos}
+% \changes{1.903}{1999/05/20}{Variable added. (LH)}
+% \begin{macrocode}
+\newcount\glyph_width
+\newcount\glyph_height
+\newcount\glyph_depth
+\newcount\glyph_italic
+\newtoks\glyph_map_commands
+\newtoks\glyph_map_fonts
+\newcount\glyph_voffset
+\newcount\glyph_maxhpos
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+% \end{macro} \end{macro} \end{macro}
+%
+% \begin{macro}{\setglyph}
+% \changes{1.916}{2001/01/06}{Added `set' to \package{fontdoc} text.
+% (LH)}
+% \begin{macro}{\gobble_glyph}
+% The |\setglyph|\marg{name} command defines |\g-|\meta{name},
+% unless |\g-|\meta{name} has already been defined.
+%
+% The reason |\g-|\meta{name} is defined before calling |\resetglyph|
+% is to make it possible to refer to ``the glyph constructed so far''
+% using |\width|\marg{name}, |\height|\marg{name}, etc.
+% \begin{macrocode}
+\def\setglyph#1{
+ \ifisglyph{\glyph_name_modifier{#1}}\then
+ \expandafter\gobble_glyph
+ \else
+ \x_cs\def{g-\glyph_name_modifier{#1}}{
+ {\the\glyph_width}{\the\glyph_height}
+ {\the\glyph_depth}{\the\glyph_italic}
+ {\the\glyph_map_commands}{\the\glyph_map_fonts}
+ }
+ \resetglyph{\glyph_name_modifier{#1}}
+ \fi
+}
+\long\def\gobble_glyph#1\endsetglyph{}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\setglyph[1]{%
+ \FD@tight@true
+ \Aheading{Set glyph `\typeset@glyph{#1}'}%
+}
+%</doc>
+%<misc>\long\def\setglyph#1\endsetglyph{}
+% \end{macrocode}
+%
+% LH 2003/01/05: A very useful trick, which unfortunately used to be
+% undocumented, is to put kerning or variable assignment commands
+% between |\setglyph| and the corresponding |\endsetglyph|. These
+% commands will then only be executed if the glyph is being set by
+% that |\setglyph|. Typical application: If \texttt{Aacutesmall}
+% is being made by skrinking \texttt{Aacute}, then it is reasonable
+% to make \texttt{Aacutesmall} kern like \texttt{Aacute} (modulo
+% some scaling factor). If on the other hand \texttt{Aacutesmall}
+% has already been set then there is less reason to believe
+% \texttt{Aacutesmall} should kern like \texttt{Aacute} (a more
+% probable guess is that it should kern like \texttt{Asmall}).
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\resetglyph}
+% The |\resetglyph|\marg{name} command redefines |\g-|\meta{name},
+% regardless of whether |\g-|\meta{name} has already been defined.
+% \changes{1.923}{2002/10/20}{\cs{edef}ing \cs{glyphname}, for
+% consistency with \cs{setslot}. In principle, this could break
+% MTX files, but I doubt that it will. (LH)}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\resetglyph#1{
+ \edef\glyphname{#1}
+ \glyph_width=0
+ \global\glyph_height=0
+ \global\glyph_depth=0
+ \global\glyph_italic=0
+ \glyph_voffset=0
+ \global\glyph_maxhpos=0
+ \global\glyph_map_commands={}
+ \global\glyph_map_fonts={}
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\resetglyph[1]{%
+ \FD@tight@true
+ \Aheading{Reset glyph `\typeset@glyph{#1}'}}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endsetglyph}
+% \begin{macro}{\endresetglyph}
+% \begin{macrocode}
+%<*pkg>
+\def\endsetglyph{
+ \x_cs\edef{g-\glyphname}
+ {{\the\glyph_width}{\the\glyph_height}
+ {\the\glyph_depth}{\the\glyph_italic}
+ {\the\glyph_map_commands}{\the\glyph_map_fonts}}
+}
+\let\endresetglyph=\endsetglyph
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\let\endsetglyph=\FD@tight@false
+\let\endresetglyph=\FD@tight@false
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setscaledrawglyph}
+% \changes{1.922}{2002/09/07}{Corrected typo: should test whether the
+% \texttt{rawscale} integer exists, not whether the
+% \texttt{i-rawscale} integer exists. (LH)}
+% \begin{macro}{\setrawglyph}
+% The |\setscaledrawglyph| has the syntax
+% \begin{isyntax}
+% |\setscaledrawglyph|\marg{glyph}\marg{font}\marg{design size}^^A
+% \marg{scale}\penalty0\marg{slot}\penalty0\marg{width}\penalty0
+% \marg{height}\penalty0\marg{depth}\penalty0\marg{italic}
+% \end{isyntax}
+% It is a generalized form of the old |\setrawglyph| command, which
+% has the syntax
+% \begin{isyntax}
+% |\setrawglyph|\marg{glyph}\marg{font}\marg{design size}^^A
+% \marg{slot}\penalty0\marg{width}\penalty0
+% \marg{height}\penalty0\marg{depth}\penalty0\marg{italic}
+% \end{isyntax}
+% |\setrawglyph| is now syntactic sugar for the equivalent call of
+% |\set|\-|scaled|\-|raw|\-|glyph|.
+% \begin{macrocode}
+%<*pkg>
+\def\setrawglyph#1#2#3{
+ \setscaledrawglyph{#1}{#2}{#3}\one_thousand
+}
+% \end{macrocode}
+%
+% These commands are generated automatically, when an |.mtx| file is
+% written out by |\afmtomtx|, |\pltomtx|, or |\mtxtomtx|.
+%
+% To illustrate the difference between |\setrawglyph| and the new
+% |\set|\-|scaled|\-|raw|\-|glyph|, note that
+% \begin{quote}
+% |\setscaledrawglyph{fscaled}{xfont}{10pt}{800}{102}%|\\
+% | {300}{600}{300}{40}|
+% \end{quote}
+% produces the same \texttt{fscaled} glyph as
+% \begin{quote}
+% |\setrawglyph{f}{xfont}{10pt}{102}{375}{750}{375}{50}|\\
+% |\setglyph{fscaled} \glyph{f}{800} \endsetglyph|
+% \end{quote}
+%
+% \begin{macrocode}
+\def\setscaledrawglyph#1#2#3#4#5#6#7#8#9{
+ \if_undefined{g-\glyph_name_modifier{#1}}\then
+ \eval_expr{#4}
+ \ifnum \result=\one_thousand
+ \let\a_macro\identity_one
+ \else
+ \edef\a_macro##1{\saved_scale{\the\result}{##1}}
+ \fi
+ \eval_expr_to\a_count{#6}
+ \eval_expr_to\b_count{#7}
+ \eval_expr_to\c_count{#8}
+ \eval_expr_to\d_count{#9}
+ \ifisint{rawscale}\then
+ \e_count=\int{rawscale}
+ \multiply \a_count \e_count \l_rounded_thousandths\a_count
+ \multiply \b_count \e_count \l_rounded_thousandths\b_count
+ \multiply \c_count \e_count \l_rounded_thousandths\c_count
+ \multiply \d_count \e_count \l_rounded_thousandths\d_count
+ \edef\a_macro##1{\saved_scale{\the\e_count}{\a_macro{##1}}}
+ \fi
+ \x_cs\edef{g-\glyph_name_modifier{#1}}{
+ {\the\a_count}
+ {\the\b_count}
+ {\the\c_count}
+ {\the\d_count}
+ {\a_macro{\saved_raw{#2}{#5}{#1}}}
+ {\a_macro{\saved_mapfont{#2}{#3}}}
+ }
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\setrawglyph[8]{%
+ \Aheading{Glyph `\typeset@glyph{#1}'}
+ \Bheading{Taken from} slot $\TypesetIntegerExpression{#4}$ in
+ font \TypesetStringExpression{#2}%
+}
+\newcommand\setscaledrawglyph[9]{%
+ \Aheading{Glyph `\typeset@glyph{#1}'}
+ \Bheading{Taken from} slot $\TypesetIntegerExpression{#5}$ in
+ font \TypesetStringExpression{#2} \ConditionallyScaled{#4}%
+}
+%</doc>
+%<misc>\def\setrawglyph#1#2#3#4#5#6#7#8{}
+%<misc>\def\setscaledrawglyph#1#2#3#4#5#6#7#8#9{}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\setscalednotglyph}
+% \changes{1.917}{2001/03/13}{This macro should set
+% \cs{g-\meta{glyph}-not}, not \cs{g-\meta{glyph}}. (LH)}
+% \changes{1.922}{2002/09/07}{Corrected typo: should test whether
+% the \texttt{rawscale} integer exists, not whether the
+% \texttt{i-rawscale} integer exists. (LH)}
+% \begin{macro}{\setnotglyph}
+% The |\setscalednotglyph| command has the same syntax as the
+% |\set|\-|scaled|\-|raw|\-|glyph| command, i.e.,
+% \begin{isyntax}
+% |\setscalednotglyph|\marg{glyph}\marg{font}\marg{design size}^^A
+% \marg{scale}\penalty0\marg{slot}\penalty0\marg{width}\penalty0
+% \marg{height}\penalty0\marg{depth}\penalty0\marg{italic}
+% \end{isyntax}
+% It is a generalized form of the old |\setnotglyph| command, which
+% has the syntax
+% \begin{isyntax}
+% |\setnotglyph|\marg{glyph}\marg{font}\marg{design size}^^A
+% \marg{slot}\penalty0\marg{width}\penalty0\marg{height}\penalty0
+% \marg{depth}\penalty0\marg{italic}
+% \end{isyntax}
+% |\setnotglyph| is now syntactic sugar for the equivalent call of
+% |\set|\-|scaled|\-|not|\-|glyph|.
+% \begin{macrocode}
+%<*pkg>
+\def\setnotglyph#1#2#3{
+ \setscalednotglyph{#1}{#2}{#3}\one_thousand
+}
+% \end{macrocode}
+%
+% Note that only the \meta{glyph}, \meta{width}, \meta{height},
+% \meta{depth}, and \meta{italic} parameters are used. The reason for
+% having the other parameters is that |\set|\-|scaled|\-|not|\-^^A
+% |glyph| commands can be converted to |\set|\-|scaled|\-|raw|\-^^A
+% |glyph| commands when a font is reencoded. Therefore all the
+% information must be present, even if it is not used by the main
+% definition.
+%
+% To think about (LH 2000/03/02): Perhaps the \meta{mapcommands} field
+% of a \texttt{-not}-glyph should contain a |\glyphwarning|, just in
+% case anyone tries to use one?
+% \begin{macrocode}
+\def\setscalednotglyph#1#2#3#4#5#6#7#8#9{
+ \if_undefined{g-\glyph_name_modifier{#1}-not}\then
+ \eval_expr_to\a_count{#6}
+ \eval_expr_to\b_count{#7}
+ \eval_expr_to\c_count{#8}
+ \eval_expr_to\d_count{#9}
+ \ifisint{rawscale}\then
+ \e_count=\int{rawscale}
+ \multiply \a_count \e_count \l_rounded_thousandths\a_count
+ \multiply \b_count \e_count \l_rounded_thousandths\b_count
+ \multiply \c_count \e_count \l_rounded_thousandths\c_count
+ \multiply \d_count \e_count \l_rounded_thousandths\d_count
+ \fi
+ \x_cs\edef{g-\glyph_name_modifier{#1}-not}{
+ {\the\a_count}
+ {\the\b_count}
+ {\the\c_count}
+ {\the\d_count}
+ {}{}
+ }
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\setnotglyph[8]{%
+ \Aheading{Pseudoglyph `\typeset@glyph{#1-not}'}%
+}
+\newcommand\setscalednotglyph[9]{%
+ \setnotglyph{#1}{#2}{#3}{#5}{#6}{#7}{#8}{#9}%
+}
+%</doc>
+%<misc>\let\setnotglyph=\setrawglyph
+%<misc>\let\setscalednotglyph=\setscaledrawglyph
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\unsetglyph}
+% The |\unsetglyph|\marg{name} command makes |\g-|\meta{name}
+% undefined.
+%
+% \begin{macrocode}
+%<pkg>\def\unsetglyph#1{\x_cs\let{g-#1}\x_relax}
+%<doc>\newcommand\unsetglyph[1]{%
+%<doc> \Aheading{Unset glyph `\typeset@glyph{#1}'}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Glyph commands}
+%
+% The \meta{glyph commands} are:
+% \changes{1.908}{1999/08/22}{Glyph commands avoid \cs{edef}ing old
+% contents of \cs{glyph_map_commands} and \cs{glyph_map_fonts}. (LH)}
+% \begin{macro}{\glyph}
+% |\glyph|\marg{glyph}\marg{scale}
+% \changes{1.900}{1999/02/08}{Avoids scaling by 1000. (LH)}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\glyph#1#2{
+ \glyph_parameter\glyph_metrics{#1}
+ \eval_expr_to\e_count{#2}
+ \ifnum \e_count=\one_thousand
+ \edef\a_macro{\mapcommands{#1}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+ \edef\a_macro{\mapfonts{#1}}
+ \else
+ \multiply \a_count \e_count \l_rounded_thousandths\a_count
+ \multiply \b_count \e_count \l_rounded_thousandths\b_count
+ \multiply \c_count \e_count \l_rounded_thousandths\c_count
+ \multiply \d_count \e_count \l_rounded_thousandths\d_count
+ \edef\a_macro{\saved_scale{\the\e_count}{\mapcommands{#1}}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+ \edef\a_macro{\saved_scale{\the\e_count}{\mapfonts{#1}}}
+ \fi
+ \advance \glyph_width \a_count
+ \advance \b_count \glyph_voffset
+ \ifnum \glyph_height<\b_count \global\glyph_height=\b_count \fi
+ \advance \c_count -\glyph_voffset
+ \ifnum \glyph_depth<\c_count \global\glyph_depth=\c_count \fi
+ \global\glyph_italic=\d_count
+ \global\glyph_map_fonts\expandafter{
+ \the\expandafter\glyph_map_fonts \a_macro
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\glyph[2]{%
+ \Bheading{Glyph} `\typeset@glyph{#1}' \ConditionallyScaled{#2}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glyphrule}
+% |\glyphrule|\marg{width}\marg{height}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\glyphrule#1#2{
+ \eval_expr_to\b_count{#1} \eval_expr_to\c_count{#2}
+ \advance\glyph_width by \b_count
+ \g_eval_expr_to\glyph_depth{\max\glyph_depth{-\glyph_voffset}}
+ \g_eval_expr_to\glyph_height{
+ \max\glyph_height{\add\glyph_voffset\c_count}
+ }
+ \global\glyph_italic=0
+ \edef\a_macro{\saved_rule{\the\b_count}{\the\c_count}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\glyphrule[2]{%
+ \Bheading{Rule} $\TypesetIntegerExpression{#1}$ by
+ $\TypesetIntegerExpression{#2}$%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glyphspecial}
+% \begin{macro}{\glyphwarning}
+% |\glyphspecial|\marg{string}\\
+% |\glyphwarning|\marg{string}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\glyphspecial#1{
+ \edef\a_macro{\saved_special{#1}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+}
+\def\glyphwarning#1{
+ \edef\a_macro{\saved_warning{#1}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\glyphspecial[1]{%
+ \Bheading{Special} `\TypesetStringExpression{#1}'}
+\newcommand\glyphwarning[1]{%
+ \Bheading{Warning} `\TypesetStringExpression{#1}'}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\movert}
+% \changes{1.903}{1999/05/20}{Added update of \cs{glyph_maxhpos}. (LH)}
+% \begin{macro}{\moveup}
+% |\movert|\marg{xoffset}\\
+% |\moveup|\marg{yoffset}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\movert#1{
+ \eval_expr{#1}
+ \ifnum \glyph_maxhpos<\glyph_width
+ \global\glyph_maxhpos\glyph_width
+ \fi
+ \ifnum 0=\result \else
+ \advance\glyph_width by \result
+ \edef\a_macro{\saved_movert{\the\result}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\moveup#1{
+ \eval_expr{#1}
+ \ifnum\result=0\else
+ \advance\glyph_voffset by \result
+ \edef\a_macro{\saved_moveup{\the\result}}
+ \global\glyph_map_commands\expandafter{
+ \the\expandafter\glyph_map_commands \a_macro
+ }
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\movert[1]{\Bheading{Rt}~$\TypesetIntegerExpression{#1}$}
+\newcommand\moveup[1]{\Bheading{Up}~$\TypesetIntegerExpression{#1}$}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\push}
+% \changes{1.907}{1999/08/02}{Removed the \cs{edef}. (LH)}
+% \begin{macro}{\pop}
+% \changes{1.903}{1999/05/20}{Added update of \cs{glyph_maxhpos}. (LH)}
+% \changes{1.907}{1999/08/02}{Removed the \cs{edef}. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\def\push{
+ \bgroup
+ \global\glyph_map_commands\expandafter{
+ \the\glyph_map_commands \saved_push
+ }
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\pop{
+ \ifnum \glyph_maxhpos<\glyph_width
+ \global\glyph_maxhpos\glyph_width
+ \fi
+ \egroup
+ \global\glyph_map_commands\expandafter{
+ \the\glyph_map_commands \saved_pop
+ }
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\push{\Bheading{Push}}
+\newcommand\pop{\Bheading{Pop}}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\resetwidth}
+% \begin{macro}{\resetheight}
+% \begin{macro}{\resetdepth}
+% \begin{macro}{\resetitalic}
+% |\resetwidth|\marg{width}\\
+% |\resetheight|\marg{height}\\
+% |\resetdepth|\marg{depth}\\
+% |\resetitalic|\marg{italic}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\resetwidth#1{\movert{\sub{#1}\glyph_width}}
+\def\resetheight{\g_eval_expr_to\glyph_height}
+\def\resetdepth{\g_eval_expr_to\glyph_depth}
+\def\resetitalic{\g_eval_expr_to\glyph_italic}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\resetwidth[1]{%
+ \Bheading{Reset width to $\TypesetIntegerExpression{#1}$}%
+}
+\newcommand\resetheight[1]{%
+ \Bheading{Reset height to $\TypesetIntegerExpression{#1}$}%
+}
+\newcommand\resetdepth[1]{%
+ \Bheading{Reset depth to $\TypesetIntegerExpression{#1}$}%
+}
+\newcommand\resetitalic[1]{%
+ \Bheading{Reset italic to $\TypesetIntegerExpression{#1}$}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\glyphpcc}
+% Some syntactic sugar: |\glyphpcc| could do with optimization.
+% \begin{quote}
+% |\glyphpcc|\marg{glyph}\marg{xoffset}\marg{yoffset}
+% \end{quote}
+% \changes{1.925}{2003/05/28}{Added check that the glyph used is
+% defined; we get an ugly error if it isn't. (LH)}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\glyphpcc#1#2#3{
+ \ifisglyph{\glyph_name_modifier{#1}}\then
+ \push
+ \movert{#2}
+ \moveup{#3}
+ \glyph{\glyph_name_modifier{#1}}{\one_thousand}
+ \pop
+ \else
+ \fontinsterror{\string\glyphpcc}{
+ Base~glyph~not~set.\messagebreak
+ This~could~be~a~sign~that~the~AFM~file~is~buggy
+ }\error_help_a
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\glyphpcc#1#2#3{
+ \push
+ \movert{#2}
+ \moveup{#3}
+ \glyph{#1}{1000}
+ \pop
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\glyphbboxright}
+% \changes{1.903}{1999/05/20}{Macro added. (LH)}
+% The |\glyphbboxright| command is a valid integer expression, but
+% its value is only meaningful inside a |\setglyph| \textellipsis\
+% |\endsetglyph| or |\resetglyph| \textellipsis\ |\endresetglyph|
+% structure. There its value is almost the horizontal position of
+% the right edge of the bounding box for the glyph constructed so
+% far---in reality it is the greatest horizontal offset reached so
+% far.
+%
+% \begin{macrocode}
+%<pkg>\def\glyphbboxright{\max\glyph_width\glyph_maxhpos}
+%<*doc>
+\DeclareRobustCommand\glyphbboxright{%
+ \gdef\FD@expression{\protect\mathrm{glyphbboxright}}
+ \global\chardef\FD@priority=\tw@
+ \global\FD@bracket@level=\z@
+ \FD@evaluate@false
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\samesize}
+% \changes{1.903}{1999/05/20}{Added behaviour for nonexistent glyph
+% (based on a suggestion from Hilmar Schlegel) and fixed typo in
+% \package{fontdoc}. (LH)}
+% |\samesize|\marg{glyph}
+%
+% \begin{macrocode}
+%<*pkg>
+\def\samesize#1{
+ \if_undefined{g-\glyph_name_modifier{#1}}\then
+ \resetwidth{\glyphbboxright}
+ \else
+ \expandafter\expandafter\expandafter
+ \same_size\csname g-\glyph_name_modifier{#1}\endcsname
+ \fi
+}
+\def\same_size#1#2#3#4#5#6{
+ \movert{\sub{#1}\glyph_width}
+ \global\glyph_height=#2
+ \global\glyph_depth=#3
+ \global\glyph_italic=#4
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\newcommand\samesize[1]{%
+ \Bheading{Reset dimensions to those of `\typeset@glyph{#1}'.}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifisglyph}
+% The control flow command:
+% \changes{1.923}{2002/10/20}{Using \cs{if_defined}. (LH)}
+% \begin{macrocode}
+%<pkg>\def\ifisglyph#1\then{\if_defined{g-#1}\then}
+% \end{macrocode}
+% \changes{1.911}{1999/11/30}{\protect\protect\protect\Module{misc}
+% definition added. (LH)}
+% |\ifisglyph| evaluates to false in \Module{misc}, since this avoids
+% uses of various metric integer expressions (such as |\width|,
+% |\height|, etc.) that are not defined there.
+% \begin{macrocode}
+%<doc>\def\ifisglyph#1\then{\generic@if{glyph \typeset@glyph{#1} set}}
+%<misc>\def\ifisglyph#1\then{\iffalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifareglyphs}
+% \changes{1.917}{2001/03/17}{Macro added. (LH)}
+% The |\ifareglyphs| command test if all glyphs in a comma-separeted
+% list of glyphs are set. The syntax is
+% \begin{quote}
+% |\ifareglyphs|\marg{glyph list}|\then|
+% \end{quote}
+% The implementation relies on that |\if_true| and |\if_false| do not
+% count when \TeX\ is skipping text that is balanced with respect to
+% |\if|s and |\fi|s.
+% \begin{macrocode}
+%<*pkg>
+\def\ifareglyphs#1\then{
+ \process_csep_list{\if_is_glyph}#1,\process_csep_list,
+ \if_true
+}
+\def\if_is_glyph#1{
+ \if_undefined{g-#1}\then \expandafter\if_false \fi
+}
+%</pkg>
+%<misc>\let\ifareglyphs=\ifisglyph
+%<*doc>
+\def\ifareglyphs#1\then{%
+ \generic@if{all glyphs in \FD@typeset@string@set{#1} are set}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Converting an ETX file to a (V)PL file}
+%
+% \subsection{Lowest-level user interface}
+%
+% \DescribeMacro{\etxtovpl}
+% The macro:
+% \begin{quote}
+% |\etxtovpl|\marg{encoding list}\marg{vplfile}
+% \end{quote}
+% writes a virtual font (as a virtual property list) with the
+% encoding specified by the items in the \meta{encoding list},
+% which typically are names of ETX files.
+% (This macro is called by |\installfont|.)
+%
+% \DescribeMacro{\etxtopl}
+% The macro:
+% \begin{quote}
+% |\etxtopl|\marg{encoding list}\marg{plfile}
+% \end{quote}
+% writes a font (as a property list) with the encoding
+% specified by the items in the \meta{encoding list},
+% which typically are names of ETX files.
+% (This macro is called by |\installrawfont|.)
+%
+% \multchanges{\cs{etxtovpl}\cs{etxtopl}}{1.923}{2002/10/24}{The
+% first argument of these macros is now a comma-separated list
+% of ETX files, and the items may be subjected to modifier
+% clauses. (LH)}
+%
+% \begin{macro}{\etxtovpl}
+% \changes{1.923}{2002/10/25}{The program is called \texttt{vptovf},
+% not \texttt{vpltovf}. (LH)}
+% \begin{macro}{\etxtopl}
+% \begin{macrocode}
+%<*pkg>
+\def\etxtovpl#1#2{{
+ \def\vpl_extension{vpl}
+ \def\vpl_title{COMMENT}
+ \def\vpl_font{virtual~font}
+ \def\vpl_Font{Virtual~font}
+ \def\vpl_call{\string\etxtovpl{#1}{#2}}
+ \def\vpl_to_vf##1{vptovf~##1.vpl~##1.vf~##1.tfm}
+ \a_toks={}
+ \process_csep_list\make_inputetx #1,\process_csep_list,
+ \expandafter\etx_to_font \expandafter{\the\a_toks}{#2}
+}}
+\def\etxtopl#1#2{{
+ \def\vpl_extension{pl}
+ \def\vpl_title{COMMENT}
+ \def\vpl_font{font}
+ \def\vpl_Font{Font}
+ \def\vpl_call{\string\etxtopl{#1}{#2}}
+ \def\vpl_to_vf##1{pltotf~##1.pl~##1.tfm}
+ \_including_map_false
+ \global\rawfont_scaling=-\p@
+ \a_toks={}
+ \process_csep_list\make_inputetx #1,\process_csep_list,
+ \expandafter\etx_to_font \expandafter{\the\a_toks}{#2}
+}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{switch}{_including_map_}
+% \changes{1.900}{1998/10/02}{New switch that can inhibit writing of
+% VPL-specific properties. (LH)}
+% The v\,1.5 method of controlling whether \texttt{MAP} and
+% \texttt{MAPFONT} properties should be written requires that some
+% code is put in an awkward place (in |\make_mapfonts| rather than
+% |\make_characters|). As the code was being reorganised anyway, it
+% seemed best to let a switch control this instead. If
+% |\if_including_map_| is true, \texttt{MAP} and \texttt{MAPFONT}
+% properties are written to the file (which should be a VPL), if it is
+% false then they are not written to the file (which is then a normal
+% PL).
+% \begin{macrocode}
+\newif\if_including_map_
+\_including_map_true
+% \end{macrocode}
+% \end{switch}
+%
+% \begin{macro}{\make_inputetx}
+% The |\make_inputetx| macro takes a single argument that should have
+% the form
+% \begin{quote}
+% \meta{file name root}\meta{optional modifiers}
+% \end{quote}
+% as explained in the comments to |\input_mtx_file|. The effect of
+% this macro is to append some commands (usually
+% |\inputetx|\marg{file name root}) to |\a_toks|. This may however
+% change if some clause in the \meta{optional modifiers} redefines
+% |\a_macro|.
+% \changes{1.923}{2002/10/24}{Macro added. (LH)}
+% \begin{macrocode}
+\def\make_inputetx#1{
+ \def\a_macro{\noexpand\inputetx{\file_name}}
+ \get_file_name #1~{}~\par
+ \edef\a_macro{\a_macro}
+ \a_toks=\expandafter{ \the\expandafter\a_toks \a_macro}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IFKW-mtxasetx}
+% The \texttt{mtxasetx} modifier clause causes the \meta{encoding
+% list} item in question to be input using |\input_mtx_as_etx| rather
+% than |\inputetx|. This makes it possible to use the |\setrawglyph|
+% and |\setscaledrawglyph| commands in an MTX file as a poor
+% substitute for a proper ETX file. This is sometimes useful for
+% making proofs.
+% \changes{1.923}{2002/10/24}{Macro added. (LH)}
+% \begin{macrocode}
+\x_cs\def{IFKW-mtxasetx}{
+ \def\a_macro{\noexpand\input_mtx_as_etx{\file_name}}
+ \get_keyword
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\etx_to_font}
+% |\etx_to_font|\marg{encoding commands}\marg{fontfile} makes
+% a (V)PL file whose encoding is specified by the \meta{encoding
+% commands}. These are usually just one or a few |\inputetx|
+% commands, as the specification of an encoding usually requires much
+% more code than is convenient to provide as an argument.
+% \changes{1.923}{2002/10/24}{Made the first argument a list of
+% commands. Renamed \cs{vpl_caller} to \cs{vpl_call}; it is now
+% assumed to contain the arguments as well. (LH)}
+% \begin{macrocode}
+\def\etx_to_font#1#2{
+ \make_assignments{#1}
+ \open_out{#2.\vpl_extension}
+ \top_of_pl_hook
+ \out_line{(\vpl_title\space\vpl_font\space
+ #2~created~by~fontinst~v\fontinstversion)}
+ \out_line{}
+ \out_line{(COMMENT~Filename:~#2.\vpl_extension)}
+ \out_line{(COMMENT~Created~by:~tex~\jobname)}
+ \out_line{(COMMENT~Created~using:~\vpl_call)}
+ \out_line{}
+ \out_line{(COMMENT~This~file~can~be~turned~into~a~\vpl_font\space
+ with)}
+ \out_line{(COMMENT~\vpl_to_vf{#2})}
+ \out_line{}
+ \out_line{(COMMENT~THIS~FILE~CAN~THEN~BE~DELETED.)}
+ \out_line{}
+ \make_header{#1}
+ \if_including_map_ \make_mapfonts{#1} \fi
+ \make_fontdimens{#1}
+ \make_ligtable{#1}
+ \make_characters{#1}
+ \make_tidy{#1}
+ \out_line{}
+ \out_line{(COMMENT~END~OF~FILE~#2.\vpl_extension)}
+ \close_out{\vpl_Font}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\pre_first_etx_pass_hook}
+% \begin{macro}{\pre_second_etx_pass_hook}
+% \begin{macro}{\pre_third_etx_pass_hook}
+% \begin{macro}{\pre_fourth_etx_pass_hook}
+% \begin{macro}{\post_first_etx_pass_hook}
+% \begin{macro}{\post_second_etx_pass_hook}
+% \begin{macro}{\post_third_etx_pass_hook}
+% \begin{macro}{\post_fourth_etx_pass_hook}
+% \begin{macro}{\tidying_up_hook}
+% \multchanges{\cs{pre_first_etx_pass_hook}^^A
+% \cs{pre_second_etx_pass_hook}\cs{pre_third_etx_pass_hook}^^A
+% \cs{pre_fourth_etx_pass_hook}\cs{post_first_etx_pass_hook}^^A
+% \cs{post_second_etx_pass_hook}\cs{post_third_etx_pass_hook}^^A
+% \cs{post_fourth_etx_pass_hook}\cs{tidying_up_hook}}{1.900}^^A
+% {1998/09/30}{ETX-to-VPL hooks added. (LH)}
+% \begin{macro}{\top_of_pl_hook}
+% \changes{1.912}{2000/01/29}{Property list hook added. (LH)}
+% As the |\etxtovpl| and |\etxtopl| macros are the
+% lowest-level interfaces to what they do that are available in
+% \package{fontinst} and as the amount of code they execute is really
+% quite large, I suspect that users may occationally have need of
+% some robust mechanism for inserting extra code at well specified
+% positions. Such a mechanism is provided by the following hooks:
+% \begin{macrocode}
+\let\pre_first_etx_pass_hook\x_relax
+\let\pre_second_etx_pass_hook\x_relax
+\let\pre_third_etx_pass_hook\x_relax
+\let\pre_fourth_etx_pass_hook\x_relax
+\let\post_first_etx_pass_hook\x_relax
+\let\post_second_etx_pass_hook\x_relax
+\let\post_third_etx_pass_hook\x_relax
+\let\post_fourth_etx_pass_hook\x_relax
+\let\tidying_up_hook\x_relax
+\let\top_of_pl_hook\x_relax
+% \end{macrocode}
+% The first nine are executed at the positions of the ETX-to-VPL
+% file generation that their name indicate. |\top_of_pl_hook| is
+% slightly different---it is executed right after a PL or VPL file
+% is opened for writing. Thus it is also used by the MTX-to-PL system.
+%
+% To include code in one of them, one should write things like
+% \begin{quote}
+% |\add_to\pre_first_etx_pass_hook|\marg{extra code}
+% \end{quote}
+% I (LH) have the following in my \texttt{fontinst.rc} file\relax
+% \SortIndex{fontinst.rc file}{\texttt{fontinst.rc} file}
+% \begin{quote}
+% |\add_to\top_of_pl_hook{\out_line{(COMMENT~-*-Text-*-)}}|
+% \end{quote}
+% Without it, my text editor annoys me by assuming that \texttt{.pl}
+% stands for Perl.
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+% \end{macro} \end{macro} \end{macro} \end{macro} \end{macro}
+%
+%
+% \subsection{Glyph to slot assignments}
+%
+% \changes{1.900}{1998/12/06}{New method of storing slot assignments.
+% (LH)}
+% The way \package{fontinst} has traditionally kept track
+% of which glyph goes to which slot---information which is needed when
+% writing the |LIGTABLE| in a (V)PL, for |\nextlarger|, and for the
+% varchar commands---is by storing the slot number in the integer
+% whose name is the name of the glyph. There are two main problems with
+% this implementation: (i)~If a user sets an integer which happens to
+% have the same name as a glyph that is not assigned to any slot, then
+% kerns for that unused glyph might be written to the file, accidentally
+% creating a kerning pair where there should be none. (ii)~It is only
+% possible to store one slot number per glyph, so if one uses the same
+% glyph for several slots then \package{fontinst} can only write kerns
+% (and ligatures) for one of the occurences, despite the fact that all
+% occurences have the same typographical need for them. These problems
+% do only occur for glyphs on the right side of a ligature/kerning
+% pair, but they are still serious enough. This part of
+% \package{fontinst} has therefore been reimplemented.
+%
+% \changes{1.910}{1999/11/04}{Changed the way slot numbers are stored
+% in \cs{slots-}\meta{glyph} control sequences. (LH)}
+% The new implementation does not use integers, instead it uses a new
+% family of macros with names on the form |\slots-|\meta{glyph}^^A
+% \describecsfamily{slots-\meta{glyph}}. These macros expand to
+% sequences of |\do|\thinspace\meta{character}, where \meta{character}
+% is a category 12 (other) token whose character code equals the slot
+% number.
+%
+% In the entire space of such names, each slot sould be mensioned
+% at most once, with one exception, namely the slot which serves as
+% right boundary marker, which may occur twice (once for the glyph
+% which actually is assigned to the slot and once for the right boundary
+% marker glyph). To detect whether there is a collision between these two
+% uses of the slot, the right boundary marker glyph uses |\rboundary_do|
+% instead of |\do| and the glyph whose slot serves as boundarychar uses
+% |\rbserver_do| instead of |\do|. By redefining these two control
+% sequences to generate a warning message when appropriate, the occurence
+% of such a collision can be brought to the user's attention.
+%
+% \changes{1.900}{1998/12/11}{Added compability code for the old
+% interface for boundary ligatures and kerns. (LH)}
+% As it turned out to not be such a big deal, some extra code (protected
+% by a \package{docstrip} switch called \Module{boundaryCompability})
+% that makes \package{fontinst} compatible with the previous syntax for
+% boundary handling has been included. I don't recommend using
+% it though, since it makes \package{fontinst} store almost all slot
+% numbers in two places.
+%
+%
+% \begin{macro}{\make_assignments}
+% \begin{macrocode}
+\def\make_assignments#1{
+ \let\do_slot=\assign_slot
+ \let\end_do_slot=\end_assign_slot
+ \def\do_boundary{\bgroup
+ \let\makerightboundary=\bad_makerightboundary
+ }
+ \let\endsetleftboundary=\egroup
+ \let\makerightboundary=\assign_rboundary
+ \pre_first_etx_pass_hook
+ #1
+ \post_first_etx_pass_hook
+ \let\end_do_slot=\empty_command
+ \let\do_boundary=\x_relax
+ \let\endsetleftboundary=\x_relax
+ \let\makerightboundary=\gobble_one
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\assign_slot}
+% \begin{macro}{\end_assign_slot}
+% \changes{1.907}{1999/08/20}{Slots are not assigned to glyphs that
+% do not exist. (LH)}
+% |\assign_slot| begins the assignment of a slot to a glyph.
+% |\end_assign_slot| completes it. In the time between these two,
+% some information is stored in |\a_toks|, so that it can be
+% modified by an intervening |\makerightboundary| (which is then
+% |\assign_rboundary|).
+%
+% Note that the code below will not reset |\lccode0|. The value of
+% this register should be considered uncertain while a ligful PL
+% or VPL file is written, i.e., in ETX files.
+% \SortIndex{lccode0}{\cs{lccode\,0} register\encapchar usage}
+% \begin{macrocode}
+\def\assign_slot{\a_toks={\do}}
+\begingroup
+ \catcode0=12
+ \gdef\end_assign_slot{
+ \ifisglyph\slot_name\then
+ \lccode0=\slot_number
+ \lowercase{
+ \expandafter\add_to
+ \csname slots-\slot_name\expandafter\endcsname
+ \expandafter{\the\a_toks^^@}
+ }
+%<boundaryCompability> \x_resetint\slot_name\slot_number
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\assign_rboundary}
+% \begin{macro}{\bad_makerightboundary}
+% |\assign_rboundary| is what |\makerightboundary| is when it is
+% assigning a slot to act as right boundary marker.
+%
+% |\bad_makerightboundary| is what |\makerightboundary| temporarily
+% gets set to between |\setleftboundary| and |\endsetleftboundary|.
+% \begin{macrocode}
+ \gdef\assign_rboundary#1{
+ \lccode0=\slot_number
+ \lowercase{\x_cs\add_to{slots-#1}{\rboundary_do^^@}}
+ \x_setint{\percent_char boundarychar}\slot_number
+ \a_toks={\rbserver_do}
+ }
+\endgroup
+\def\bad_makerightboundary#1{
+ \errhelp={The~left~boundary~is~not~a~slot,~so~it~cannot~serve~
+ as~right~boundary.}
+ \errmessage{Incorrect~use~of~\string\makerightboundary}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\get_slot_num}
+% \changes{1.910}{1999/11/04}{Removed redefinition of \cs{do} to
+% \cs{gobble_one} from temporary definition of \cs{do}, since a
+% \cs{slots-} list usually contains only one or two elements
+% anyway. (LH)}
+% It is sometimes necessary to get the number of an arbitrary slot
+% given only the name of the glyph which has been assigned to the
+% slot. In such situations, the call
+% \begin{quote}
+% |\get_slot_num{|\meta{glyph}|}|
+% \end{quote}
+% will set |\result| to the number of one such slot if the glyph has
+% been assigned to some slot, or set |\result| to minus one if the glyph
+% has not been assigned to a slot.
+% \begin{macrocode}
+\def\get_slot_num#1{
+%<*!boundaryCompability>
+ \global\result=-1
+ \bgroup
+ \def\do{\global\result=`}
+ \let\rbserver_do=\do
+ \let\rboundary_do=\gobble_one
+ \csname slots-#1\endcsname
+ \egroup
+%</!boundaryCompability>
+%<*boundaryCompability>
+ \ifisint{#1}\then
+ \global\result=\int{#1}
+ \else
+ \global\result=-1
+ \fi
+ \x_relax
+%</boundaryCompability>
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\ifisinslot}
+% The call |\ifisinslot|\marg{glyph}\marg{slot}|\then| can be used to
+% test whether glyph \meta{glyph} has been assigned to slot \meta{slot}.
+% Both then-part and else-part of the conditional will however be
+% ignored when the ETX file is read the first time, since the
+% assignment of glyph to slots need not have been completed yet.
+% \begin{macrocode}
+\def\ifisinslot#1#2\then{
+ \ifx \makerightboundary\gobble_one
+% \end{macrocode}
+% This is used to test if the ETX file is being read in for the first
+% time. It is a bit hacky, but it is efficient.
+% \begin{macrocode}
+ \eval_expr{#2}
+ \begingroup
+ \def\do##1{\ifnum `##1=\result \let\do=\gobble_one \fi}
+ \def\rbserver_do{\do}
+ \let\rboundary_do=\gobble_one
+ \csname slots-#1\endcsname
+ \expandafter\endgroup
+ \ifx \do\gobble_one
+ \expandafter\expandafter \expandafter\if_true
+ \else
+ \expandafter\expandafter \expandafter\if_false
+ \fi
+ \else
+ \expandafter\gobble_if
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \begin{macrocode}
+%<*doc>
+\def\ifisinslot#1#2\then{%
+ \generic@if{glyph \typeset@glyph{#1} assigned to slot
+ $\TypesetIntegerExpression{#2}$}%
+}
+%</doc>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The header, mapfonts, and fontdimens}
+%
+% \changes{1.913}{2000/02/26}{Using \cs{make_factor} for making PL
+% reals, rather than \cs{afm_convert}+\cs{vpl_real}.
+% \cs{scaled_design_size} replaced by new dimen \cs{mapfont_scaling} for
+% determining mapfont atsize. (LH)}
+%
+% \begin{macro}{\mapfont_scaling}
+% The |\mapfont_scaling| dimen is used for calculating how much a mapfont
+% has been scaled, for use in \texttt{FONTAT} properties, and for
+% selecting the correct mapfont. It is initialized to $1$.
+% \begin{macrocode}
+%<*pkg>
+\newdimen\mapfont_scaling
+\mapfont_scaling=1pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rawfont_scaling}
+% The |\rawfont_scaling| dimen is used for communicating the scaling
+% that has been applied to a raw font---a font being installed using
+% |\install|\-|rawfont|\penalty0---out to that macro. |\rawfont_|\-^^A
+% |scaling| should always be globally assigned.
+% \changes{1.913}{2000/03/21}{Dimen added. (LH)}
+% \begin{macrocode}
+\newdimen\rawfont_scaling
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\scaled_design_size}
+% \begin{macro}{\afm_convert}
+% The call
+% \begin{quote}
+% |\afm_convert|\meta{dimen}|=|\meta{integer expression}|;|
+% \end{quote}
+% converts a count into a dimen, assuming the count is a number
+% of AFM units. I'll assume that the largest dimension I'll have
+% to deal with is 131\,pt, to try to minimize rounding errors.
+%
+% \begin{macrocode}
+% \newdimen\scaled_design_size
+% \end{macrocode}
+% \begin{macrocode}
+% \def\afm_convert#1=#2;{
+% \eval_expr{#2}
+% #1=\scaled_design_size
+% \divide#1 by 8
+% \multiply #1 by \result
+% \divide #1 by \one_thousand
+% \multiply#1 by 8
+% }
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\vpl_real}
+% \begin{macro}{\vpl_int}
+% The commands |\vpl_real|\meta{dimen} and |\vpl_int|\meta{count} print
+% a dimension and integer respectively in (V)PL syntax.
+%
+% \begin{macrocode}
+\def\vpl_real#1{R~\expandafter\lose_measure\the#1}
+\def\vpl_int#1{D~\the#1}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% The count register |\boundary_char| has been removed, since
+% the reimplementation of the left and right boundaries have drastically
+% decreased the need to check which slot serves as the right boundary.
+% Instead the integer |%boundarychar| (whose name cannot normally be typed)
+% is used to store the number of this slot, but the user need never (and
+% should not) access this integer directly. If the integer is not set
+% then no slot serves as boundarychar.
+% \changes{1.900}{1998/12/04}{\cs{boundary_char} count register
+% removed. Right boundary slot number is now stored in the
+% \texttt{\%boundarychar} integer instead. (LH)}
+%
+% \begin{macro}{\side_bearings}
+% \begin{macro}{\curr_bearings}
+% These two dimens are used by the letterspacing mechanism.
+% \begin{macrocode}
+\newdimen\side_bearings
+\newdimen\curr_bearings
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\make_header}
+% \begin{macrocode}
+\def\make_header#1{
+ \global\font_count=0
+ \setdim{designsize}{10pt}
+ \a_dimen=\dim{designsize}
+ \out_line{(DESIGNSIZE~\vpl_real\a_dimen)}
+ \x_setstr{codingscheme}{UNKNOWN}
+ \out_line{(CODINGSCHEME~\str{codingscheme})}
+%<*boundaryCompability>
+ \ifisint{boundarychar}\then
+ \x_setint{\percent_char boundarychar}{\int{boundarychar}}
+ \immediate\write16{Please~use~\string\setleftboundary\space
+ and/or~\string\makerightboundary^^J
+ instead~of~setting~the~boundarychar~integer.}
+ \fi
+%</boundaryCompability>
+ \ifisint{\percent_char boundarychar}\then
+ \a_count=\int{\percent_char boundarychar}
+ \out_line{(BOUNDARYCHAR~\vpl_int\a_count)}
+ \fi
+ \x_setint{letterspacing}{0}
+ \side_bearings=\make_factor{\int{letterspacing}}\half_point
+ \x_setint{minimumkern}{0}
+ \minimum_kern=\int{minimumkern}
+ \out_line{}
+}
+% \end{macrocode}
+% \changes{1.900}{1999/01/20}{Removed test for no letterspacing. (LH)}
+% \changes{1.900}{1999/01/20}{Made integer expression \cs{div} a
+% dimen \cs{divide}. (LH)}
+% \end{macro}
+%
+%
+% \begin{macro}{\make_mapfonts}
+% \begin{macrocode}
+\def\make_mapfonts#1{
+ \let\saved_scale\vpl_scale
+ \let\saved_mapfont\vpl_mapfont
+ \let\do_slot=\do_mapfont
+ \pre_second_etx_pass_hook
+ #1
+ \post_second_etx_pass_hook
+ \out_line{}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do_mapfont}
+% |\do_mapfont| produces a |MAPFONT| entry for each font used by
+% glyph |\slot_name|.
+% \begin{macrocode}
+\def\do_mapfont{
+ \ifisglyph\slot_name\then
+ \mapfonts\slot_name
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following commands can be used in the \meta{mapfonts} glyph
+% parameter.
+%
+% \begin{macro}{\vpl_scale}
+% \begin{macrocode}
+\def\vpl_scale#1#2{{
+ \mapfont_scaling=\make_factor{#1}\mapfont_scaling
+ #2
+}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_mapfont}
+% \changes{1.904}{1999/06/16}{Added \cs{record_usage}. (LH)}
+% \changes{1.913}{2000/02/26}{Mapfont number control sequences are
+% named \cs{\meta{scaling factor}pt-\meta{font}} instead of
+% \cs{\meta{font}-\meta{scaling factor}pt}. They are also made
+% \cs{mathchardef}s. (LH)}
+% \begin{macrocode}
+\def\vpl_mapfont#1#2{
+ \a_dimen=#2
+ \if_undefined{\the\mapfont_scaling-#1}\then
+ \global\x_cs\mathchardef{\the\mapfont_scaling-#1}=\font_count
+ \x_cs\xdef{f-\the\font_count}{\the\mapfont_scaling-#1}
+ \out_line{(MAPFONT~\vpl_int\font_count\space
+ (FONTNAME~#1)~
+ (FONTDSIZE~\vpl_real\a_dimen)~
+ (FONTAT~\vpl_real\mapfont_scaling))}
+ \record_usage{#1}
+ \global\advance\font_count by 1
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pl_mapfont}
+% As PL files have no \texttt{MAPFONT} properties, the |\pl_mapfont|
+% macro only needs to do one thing: copy the current value of
+% |\mapfont_|\-|scaling| to |\rawfont_|\-|scaling|. This is necessary
+% since if the raw font for which a ligful PL is being written has
+% been scaled, then that scaling factor must be put in the appropriate
+% place in the FD file entry, and the simplest way to determine this
+% scaling factor is to execute the |\mapfonts| of some glyph in the
+% font.
+%
+% Due to the fact that the second ETX file pass (that during which the
+% \texttt{MAPFONT} properties are written) is skipped when a PL file
+% is being written, the |\mapfonts| get executed during the fourth ETX
+% file pass instead of the second. This works fine since the
+% |\mapcommands| that are executed at that time when a VPL file is
+% being written aren't needed for PL files.
+% \changes{1.913}{2000/03/21}{Macro added. (LH)}
+% \begin{macrocode}
+\def\pl_mapfont#1#2{\global\rawfont_scaling=\mapfont_scaling}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\font_count}
+% \begin{macro}{\next_mapfont}
+% \begin{macro}{\prev_mapfont}
+% \begin{macrocode}
+\newcount\font_count
+\newcount\next_mapfont
+\newcount\prev_mapfont
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\make_fontdimens}
+% This macro writes the \texttt{FONTDIMEN} property list. Note that
+% there is a difference between fontdimen 1 and the others, in that
+% fontdimen 1 is always in \texttt{pt}, not in the atsize-relative
+% \texttt{FONTUNITS} unit that the others are. Nonetheless, they can
+% both be treated the same here. This relies on (i) that 1000 denotes
+% the factor 1, and (ii) that 1000 AFM units equals 1 fontunit.
+% \begin{macrocode}
+\def\make_fontdimens#1{
+ \out_line{(FONTDIMEN}
+ \a_count=1
+ \loop\ifnum 256>\a_count
+ \ifisint{fontdimen(\the\a_count)}\then
+ \out_lline{(PARAMETER~\vpl_int\a_count\space
+ R~\make_factor{\int{fontdimen(\the\a_count)}})}
+ \fi
+ \advance \a_count \@ne
+ \repeat
+ \out_lline{)}
+ \out_line{}
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The ligtable}
+%
+% \begin{macro}{\make_ligtable}
+% \changes{1.927}{2003/12/08}{Changed the surrounding group to
+% \cs{begingroup} type. This helps contain errors that arise when
+% the \cs{setslot}s and \cs{endsetslot}s aren't properly balanced.
+% (LH)}
+% \begin{macrocode}
+\def\make_ligtable#1{
+ \begingroup
+ \out_line{(LIGTABLE}
+%<!boundaryCompability> \let\do_slot=\bgroup
+%<*boundaryCompability>
+ \def\do_slot{\bgroup
+ \ifisint{boundarychar}\then
+ \ifnum \int{boundarychar}=\slot_number
+ \def\vpl_liglabel{\out_liglabel\boundary_liglabel}
+ \fi
+ \fi
+ }
+%</boundaryCompability>
+ \let\end_do_slot=\vpl_kerning
+ \def\do_boundary{\bgroup \let\vpl_liglabel=\boundary_liglabel}
+ \let\endsetleftboundary=\vpl_kerning
+ \let\ligature=\vpl_ligature
+ \let\k=\vpl_kern
+ \let\rbserver_do=\vpl_rbserver_do
+ \let\rboundary_do=\vpl_rboundary_do
+ \pre_third_etx_pass_hook
+ #1
+ \post_third_etx_pass_hook
+ \out_lline{)}
+ \endgroup
+ \out_line{}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_rbserver_do}
+% \begin{macro}{\vpl_rboundary_do}
+% \begin{macro}{\wrn_rboundary_do}
+% |\vpl_rbserver_do| and |\vpl_rboundary_do| are what |\rbserver_do|
+% and |\rboundary_do| respectively are when a ligkern program is being
+% written and no entry has yet been written for the boundarychar
+% slot. |\wrn_rboundary_do| is what one of them will get set to
+% afterwards, so that warnings are written when collisions between
+% using the slot as a right boundary marker and using the slot for
+% the actual glyph occur.
+% \begin{macrocode}
+\def\vpl_rbserver_do#1{
+ \do{#1}
+ \let\rboundary_do=\wrn_rboundary_do
+}
+\def\vpl_rboundary_do#1{
+ \do{#1}
+ \let\rbserver_do=\wrn_rboundary_do
+}
+\def\wrn_rboundary_do#1{
+ \do{#1}
+ \immediate\write16{Boundarychar~slot~usage~collision~in~
+ `\slot_name'~ligkern~program.}
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\vpl_ligature}
+% |\vpl_ligature{|\meta{type}|}{|\meta{glyph}|}{|\meta{glyph}|}|
+% produces a ligtable entry for glyph |\slot_name|.
+%
+% The double spaces in the |\out_lline| statement below might look
+% strange, but |\number| will always gobble the first one.
+% \begin{macrocode}
+\def\vpl_ligature#1#2#3{
+ \get_slot_num{#3}
+ \ifnum -1=\result
+ \immediate\write16{Warning:~\string\ligature\space
+ for~unknown~slot~`#3'.}
+ \else
+ \x_cs\ifx{slots-#2}\x_relax
+ \immediate\write16{Warning:~\string\ligature\space
+ for~unknown~slot~`#2'.}
+ \else
+ \def\do##1{
+ \vpl_liglabel
+ \out_lline{(#1~D~\number`##1~\space\vpl_int\result)~
+ (COMMENT~#2~#3)}
+ }
+ \csname slots-#2\endcsname
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\vpl_kerning}
+% |\vpl_kerning| writes out kerning instructions.
+% \begin{macrocode}
+\def\vpl_kerning{
+ \let\do=\vpl_kern_do
+ \csname~r-\slot_name\endcsname
+ \vpl_ligstop
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_kern}
+% |\vpl_kern|\,|\l-|\meta{name}\,|\|\meta{amount} writes out a |KRN|
+% instruction.
+%
+% \changes{1.900}{1998/10/02}{Macro modified to avoid duplicate kerns.
+% (LH)}
+% |\vpl_kern| has been modified so that at most one
+% \texttt{KRN} instruction is written for each (ordered) pair of
+% characters. The idea is basically to make \package{fontinst} forget,
+% until the end of |\vpl_kerning|, that the glyph for which |\vpl_kern|
+% is being called has been assigned a slot, as this stops any more
+% \texttt{KRN} instructions for that particular glyph from being
+% written. |\vpl_kern| has also been modified so that it will not write
+% out any \texttt{KRN} instructions for kerns whose absolute value is
+% less than or equal to |\minimum_kern|. |\minimum_kern| gets set to
+% the value of the integer \texttt{minimumkern} in |\make_header|. If
+% the user has not set \texttt{minimumkern}, a default value of 0 will
+% be supplied by \package{fontinst}.
+%
+% \changes{1.900}{1998/12/07}{Much of the code from \cs{vpl_kern} has
+% been moved to \cs{vpl_kern_do}. (LH)}
+% \changes{1.913}{2000/02/26}{Using a nested \cs{ifnum} construct to
+% test the condition $\left\protect\vert
+% \protect\mbox{\cs{a_count}}\right\protect\vert \quotechar >
+% \protect\mbox{\cs{minimum_kern}}$. (LH)}
+% \begin{macrocode}
+\def\vpl_kern#1#2{
+ \edef\a_macro{\expandafter\gobble_three\string#1}
+ \a_count=\expandafter\gobble_one\string#2\x_relax
+ \ifnum \ifnum -\a_count>\a_count - \fi\a_count>\minimum_kern
+ \edef\b_macro{~R~\make_factor\a_count}
+ \csname slots-\a_macro\endcsname
+ \fi
+ \x_cs\let{slots-\a_macro}=\x_relax
+}
+% \end{macrocode}
+% Observation (LH 1999/03/16): The above construction has the
+% side-effect that a direct contradiction between a right boundary
+% glyph and a glyph in the |%boundarychar| slot won't be detected if
+% one of the items in contradiction is a kern less than or equal to
+% |\minimum_kern|. Perhaps this should be changed (letting |\do| equal
+% to |\gobble_one| would let the dectection mechanism work, but |\do|
+% would have to be restored afterwards and it is doubtful if it is
+% worth it).
+% \end{macro}
+%
+%
+% \begin{macro}{\vpl_kern_do}
+% |\vpl_kern_do| is what |\do| is defined to be when kerns are written.
+% \begin{macrocode}
+\def\vpl_kern_do#1{
+ \vpl_liglabel
+ \out_lline{
+ (KRN~D~\number`#1~\b_macro)~
+ (COMMENT~\a_macro)
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\out_liglabel}
+% \begin{macro}{\boundary_liglabel}
+% \begin{macro}{\vpl_liglabel}
+% |\out_liglabel| writes out a |LIGLABEL| instruction for a slot.
+% |\boundary_liglabel| writes out a |LIGLABEL| instruction for the
+% |BOUNDARYCHAR| ligkern program. |\vpl_liglabel| writes out the
+% correct |LIGLABEL| instruction for the current ligkern program, if it
+% is approriate.
+%
+% \begin{macrocode}
+\def\out_liglabel{
+ \out_lline{(LABEL~\vpl_int\slot_number)~(COMMENT~\slot_name)}
+ \let\vpl_liglabel=\x_relax
+ \let\vpl_ligstop=\out_ligstop
+}
+\def\boundary_liglabel{
+ \out_lline{(LABEL~BOUNDARYCHAR)~(COMMENT~\slot_name)}
+ \let\vpl_liglabel=\x_relax
+ \let\vpl_ligstop=\out_ligstop
+}
+\let\vpl_liglabel=\out_liglabel
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\out_ligstop}
+% \begin{macro}{\vpl_ligstop}
+% |\vpl_ligstop| writes out a |LIGSTOP| instruction if appropriate.
+% \begin{macrocode}
+\def\out_ligstop{\out_lline{(STOP)}
+ \let\vpl_liglabel=\out_liglabel
+ \let\vpl_ligstop=\x_relax}
+\let\vpl_ligstop=\x_relax
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \subsection{The characters}
+%
+% \begin{macro}{\make_characters}
+% \begin{macrocode}
+\def\make_characters#1{
+ \bgroup
+ \let\do_slot=\do_character
+ \let\end_do_slot=\end_do_character
+ \let\nextlarger=\vpl_nextlarger
+ \let\varchar=\vpl_varchar
+ \let\endvarchar=\end_vpl_varchar
+ \let\vartop=\vpl_vartop
+ \let\varmid=\vpl_varmid
+ \let\varbot=\vpl_varbot
+ \let\varrep=\vpl_varrep
+ \if_including_map_
+ \let\saved_raw\vpl_raw
+ \let\saved_rule\vpl_rule
+ \let\saved_special\vpl_special
+ \let\saved_warning\vpl_warning
+ \let\saved_movert\vpl_movert
+ \let\saved_moveup\vpl_moveup
+ \let\saved_push\vpl_push
+ \let\saved_pop\vpl_pop
+ \else
+ \def\do_character_map{
+ \ifdim \rawfont_scaling=-\p@
+ \mapfonts\slot_name
+ \else
+ \let\do_character_map=\x_relax
+ \fi
+ }
+ \let\saved_mapfont\pl_mapfont
+ \let\saved_scale\vpl_scale
+ \fi
+ \pre_fourth_etx_pass_hook
+ #1
+ \post_fourth_etx_pass_hook
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do_character}
+% \changes{1.913}{2000/03/10}{Negative italic corrections \emph{are}
+% written to the (V)PL being generated. (LH)}
+% \changes{1.927}{2004/07/13}{Added flag for emitting warning message
+% when a glyph is missing. (LH) Requested by Werner Lemberg.}
+% |\do_character| produces a character entry for glyph |\slot_name| in
+% slot |\slot_number|.
+%
+% \begin{macrocode}
+\def\do_character{
+ \if_undefined{g-\slot_name}\then
+ \ifisint{requireglyphs}\then
+ \fontinstwarning{ETX~to~(V)PL}{
+ Undefined~glyph~`\slot_name'~requested\message_break
+ for~slot~\the\slot_number\message_number}
+ \fi
+ \expandafter\gobble_setslot
+ \else
+ \ifx\slot_name\notdef_name\else
+ \out_line{(CHARACTER~\vpl_int\slot_number\space
+ (COMMENT~\slot_name)}
+ \glyph_parameter\glyph_metrics\slot_name
+ \a_dimen=\make_factor\a_count \p@
+ \do_character_sidebearings
+ \out_lline{(CHARWD~\vpl_real\a_dimen)}
+ \ifnum \z@=\b_count \else
+ \out_lline{(CHARHT~R~\make_factor\b_count)}
+ \fi
+ \ifnum \z@=\c_count \else
+ \out_lline{(CHARDP~R~\make_factor\c_count)}
+ \fi
+ \ifnum \z@=\d_count \else
+ \out_lline{(CHARIC~R~\make_factor\d_count)}
+ \fi
+ \do_character_map
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do_character_sidebearings}
+% \begin{macrocode}
+\def\do_character_sidebearings{
+ \ifisint{\slot_name-spacing}\then
+ \curr_bearings=\make_factor{\int{\slot_name-spacing}}\half_point
+ \else
+ \curr_bearings=\side_bearings
+ \fi
+ \advance\a_dimen by 2\curr_bearings
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do_character_map}
+% \begin{macrocode}
+\def\do_character_map{
+ \global\prev_mapfont=0
+ \out_lline{(MAP}
+ \ifdim 0pt=\curr_bearings
+ \mapcommands\slot_name
+ \else
+ \out_llline{(MOVERIGHT~\vpl_real\curr_bearings)}
+ \mapcommands\slot_name
+ \out_llline{(MOVERIGHT~\vpl_real\curr_bearings)}
+ \fi
+ \out_llline{)}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do_character_no_letterspacing}
+% LH 1999/03/27: This is an alternative version of |\do_character|
+% which I think is now antiquated. It used to have an advantage over
+% |\do_character| in that it did not do any letterspacing (in v\,1.5,
+% that was good since |\do_character| used to write code for
+% letterspacing to the VPL regardless of whether is was needed or
+% not), but that advantage is gone since |\do_character_map| is now
+% a bit less stupid than it used to be.
+%
+% For the record, I don't think there ever was a user interface for
+% using this macro instead of |\do_character|, but I suspect there
+% are plenty of people around who have hacked it into being used.
+%
+% With v\,1.913 I commented it out completely, since I didn't feel
+% like updating the calls to |\afm_convert|.
+% \begin{macrocode}
+%<*obsolete>
+% \def\do_character_no_letterspacing{
+% \x_cs\ifx{g-\slot_name}\x_relax
+% \expandafter\gobble_setslot
+% \else
+% \ifx\slot_name\notdef_name\else
+% \out_line{(CHARACTER~\vpl_int\slot_number\space
+% (COMMENT~\slot_name)}
+% \afm_convert\a_dimen=\width\slot_name;
+% \out_lline{(CHARWD~\vpl_real\a_dimen)}
+% \afm_convert\a_dimen=\height\slot_name;
+% \out_lline{(CHARHT~\vpl_real\a_dimen)}
+% \afm_convert\a_dimen=\depth\slot_name;
+% \out_lline{(CHARDP~\vpl_real\a_dimen)}
+% \afm_convert\a_dimen=\italic\slot_name;
+% \ifnum\a_dimen>0 \out_lline{(CHARIC~\vpl_real\a_dimen)} \fi
+% \global\prev_mapfont=0 \out_lline{(MAP}
+% \mapcommands\slot_name
+% \out_llline{)}
+% \fi
+% \fi
+% }
+%</obsolete>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gobble_setslot}
+% \begin{macrocode}
+\long\def\gobble_setslot#1\endsetslot{\endsetslot}
+% \end{macrocode}
+% \changes{1.901}{1999/03/27}{Made \cs{gobble_setslot} a \cs{long}
+% macro. (LH)}
+% \end{macro}
+%
+% \begin{macro}{\end_do_character}
+% \begin{macrocode}
+\def\end_do_character{
+ \ifisglyph\slot_name\then
+ \out_lline{)}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notdef_name}
+% \begin{macrocode}
+\def\notdef_name{.notdef}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Slot commands that put things in a character property list}
+%
+% Here follows the active definitions for those slot commands that
+% causes things to be put in |CHARACTER| property lists.
+%
+% \begin{macro}{\vpl_nextlarger}
+% |\vpl_nextlarger|\marg{name} produces a |NEXTLARGER| entry.
+% \begin{macrocode}
+\def\vpl_nextlarger#1{
+ \get_slot_num{#1}
+ \ifnum -1<\result
+ \out_lline{(NEXTLARGER~D~\the\result)~(COMMENT~#1)}
+ \else
+ \immediate\write16{Warning:~\string\nextlarger\space
+ for~unknown~slot~`#1'}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_varchar}
+% \begin{macro}{\end_vpl_varchar}
+% |\vpl_varchar| \meta{varchar commands} |\end_vpl_varchar| produces
+% a |VARCHAR| entry.
+%
+% \begin{macrocode}
+\def\vpl_varchar{\out_lline{(VARCHAR}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\end_vpl_varchar{\out_llline{)}}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\vpl_vartop}
+% \begin{macrocode}
+\def\vpl_vartop#1{
+ \get_slot_num{#1}
+ \ifnum -1<\result
+ \out_llline{(TOP~D~\the\result)~(COMMENT~#1)}
+ \else
+ \immediate\write16{Warning:~\string\vartop\space
+ for~unknown~slot~`#1'}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_varmid}
+% \begin{macrocode}
+\def\vpl_varmid#1{
+ \get_slot_num{#1}
+ \ifnum -1<\result
+ \out_llline{(MID~D~\the\result)~(COMMENT~#1)}
+ \else
+ \immediate\write16{Warning:~\string\varmid\space
+ for~unknown~slot~`#1'}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_varbot}
+% \begin{macrocode}
+\def\vpl_varbot#1{
+ \get_slot_num{#1}
+ \ifnum -1<\result
+ \out_llline{(BOT~D~\the\result)~(COMMENT~#1)}
+ \else
+ \immediate\write16{Warning:~\string\varbot\space
+ for~unknown~slot~`#1'}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_varrep}
+% \begin{macrocode}
+\def\vpl_varrep#1{
+ \get_slot_num{#1}
+ \ifnum -1<\result
+ \out_llline{(REP~D~\the\result)~(COMMENT~#1)}
+ \else
+ \immediate\write16{Warning:~\string\varrep\space
+ for~unknown~slot~`#1'}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Saved map commands}
+%
+% The following commands (and |\vpl_scale|, which is defined above) can
+% be used in the \meta{mapcommands} glyph parameter.
+%
+% \begin{macro}{\vpl_raw}
+% This macro writes the entries in a \texttt{MAP} that are needed for
+% the given raw character. Note that the `at' comment below gives the
+% scaling relative to the atsize of the virtual font, not the physical
+% atsize.
+% \IndexEntry{\LevelSame{PL properties:}^^A
+% \LevelSorted{SELECTFONT}{\texttt{SELECTFONT}}^^A
+% }{usage}{\thepage}
+% \begin{macrocode}
+\def\vpl_raw#1#2#3{
+ \global\next_mapfont=\csname\the\mapfont_scaling-#1\endcsname
+ \ifnum \next_mapfont=\prev_mapfont \else
+ \out_llline{(SELECTFONT~\vpl_int\next_mapfont)~
+ (COMMENT~#1~at~
+ \expandafter\lose_measure \the\mapfont_scaling)}
+ \fi
+ \out_llline{(SETCHAR~D~#2)~(COMMENT~#3)}
+ \global\prev_mapfont=\next_mapfont
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_rule}
+% \begin{macrocode}
+\def\vpl_rule#1#2{
+ \a_dimen=\make_factor{#2}\mapfont_scaling
+ \b_dimen=\make_factor{#1}\mapfont_scaling
+ \out_llline{(SETRULE~\vpl_real\a_dimen\space\vpl_real\b_dimen)}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vpl_special}
+% \begin{macro}{\vpl_warning}
+% \begin{switch}{warningspecials}
+% \changes{1.913}{2000/02/26}{Switch controlling whether
+% \cs{glyphwarning}s should put \texttt{SPECIALS} in the VPL was
+% added. (LH)}
+% \begin{macrocode}
+\def\vpl_special#1{
+ \out_llline{(SPECIAL~#1)}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\vpl_warning#1{
+ \ifwarningspecials
+ \out_llline{(SPECIAL~Warning:~#1)}
+ \fi
+ \immediate\write16{Warning:~#1.}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newif\ifwarningspecials
+\warningspecialstrue
+% \end{macrocode}
+% \end{switch}\end{macro}\end{macro}
+%
+% \begin{macro}{\vpl_movert}
+% \begin{macro}{\vpl_moveup}
+% \begin{macrocode}
+\def\vpl_movert#1{
+ \a_dimen=\make_factor{#1}\mapfont_scaling
+ \out_llline{(MOVERIGHT~\vpl_real\a_dimen)}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\vpl_moveup#1{
+ \a_dimen=\make_factor{#1}\mapfont_scaling
+ \out_llline{(MOVEUP~\vpl_real\a_dimen)}
+}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+% \begin{macro}{\vpl_push}
+% \begin{macro}{\vpl_pop}
+% \begin{macrocode}
+\def\vpl_push{\out_llline{(PUSH)}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\vpl_pop{\out_llline{(POP)}}
+% \end{macrocode}
+% \end{macro} \end{macro}
+%
+%
+% \subsection{Tidying up}
+%
+% \begin{macro}{\make_tidy}
+% If a VPL file was written, the tidying up consists of clearing the
+% list of mapfont numbers, since that is stored globally. If a PL
+% file was written, the tidying up consists of writing a
+% \texttt{DESIGNUNITS} property for those fonts which need one.
+% \begin{macrocode}
+\def\make_tidy#1{
+ \tidying_up_hook
+ \if_including_map_
+ \a_count=0
+ \loop\ifnum \a_count<\font_count
+ \edef\a_macro{\csname~f-\the\a_count\endcsname}
+ \global\x_cs\let\a_macro\x_relax
+ \advance\a_count by 1
+ \repeat
+ \global\font_count=0
+ \else
+ \ifdim \rawfont_scaling<\z@
+ \fontinstwarning{ETX~to~(V)PL}{The~font~
+ \out_filename\space doesn't~contain~any~characters}
+ \global\rawfont_scaling=\p@
+ \fi
+ \ifdim \rawfont_scaling=\p@ \else
+ \out_line{(DESIGNUNITS~\vpl_real\rawfont_scaling)}
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Font installation commands and \texttt{.fd} files}
+%
+% \DescribeMacro{\installfonts}
+% \DescribeMacro{\endinstallfonts}
+% The call
+% \begin{quote}
+% |\installfonts| \meta{install commands} |\endinstallfonts|
+% \end{quote}
+% is the top-level interface for installing a number of fonts
+% and creating |.fd| files for them.
+%
+% \DescribeMacro{\installfamily}
+% \DescribeMacro{\installfont}
+% \DescribeMacro{\installrawfont}
+% The \meta{install commands} are:
+% \begin{isyntax}
+% |\installfamily|\marg{encoding}\marg{family}\marg{FD-commmands}\\
+% |\installfont|\marg{font-name}\marg{file-list}\marg{etx}\penalty0
+% \marg{encoding}\marg{family}\marg{series}\marg{shape}\marg{size}\\
+% |\installrawfont|\marg{font-name}\marg{file-list}\marg{etx}^^A
+% \penalty0
+% \marg{encoding}\marg{family}\marg{series}\marg{shape}\marg{size}\\
+% |\installfontas|\marg{font-name}\penalty0\marg{encoding}^^A
+% \marg{family}\marg{series}\marg{shape}\marg{size}
+% \end{isyntax}
+%
+% Each |\installfamily| command causes the generation of an |.fd| file
+% for \meta{encoding} and \meta{family}, which is writen out by the time
+% |\endinstallfonts| is processed.
+%
+% Each |\installfont| generates a |.vpl| font by calling |\etxtovpl|
+% and adds an |.fd| entry.
+% Each |\installrawfont| generates a ligfull |.pl| font by calling
+% |\etxtopl| and adds an |.fd| entry. (Raw |.pl| fonts, containing only
+% the glyph metrics without any ligaturing or kerning information,
+% are also generated by |\mtxtopl| called from |\transformfont|
+% statements.)
+%
+% \changes{1.912}{2000/01/15}{\cs{install}\dots\ commands updated to
+% set \cs{setsomething_global} to \cs{global} around themselves. This
+% reduces problems with assignments ``not working'' due to the
+% unintuitive grouping. (LH) Problem pointed out by Hilmar
+% Schlegel, , and others.}
+%
+% \begin{macro}{\installfonts}
+% Initializes the |\family_toks| token register, which is used to store
+% the information which is written out to |.fd| files at the end of the
+% job.
+%
+% \begin{macrocode}
+\newtoks\family_toks
+\def\installfonts{
+ \bgroup
+ \global\family_toks={}
+ \gdef\prev_file_list{}
+ \global\let\setsomething_global=\global
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\installfamily}
+% |\installfamily|\marg{encoding}\marg{family}\marg{FD-commmands}
+%
+% Adds the command
+% \begin{quote}
+% |\fd_family|\marg{encoding}\marg{family}\marg{FD-commmands}
+% \end{quote}
+% to the token list |\family_toks| and defines a macro
+% |\|\meta{encoding}|-|\meta{family}.^^A
+% \describecsfamily{\meta{encoding}-\meta{family}}
+%
+% \begin{macrocode}
+\def\installfamily#1#2#3{
+ \global\family_toks=
+ \expandafter{\the\family_toks\fd_family{#1}{#2}{#3}}
+ \global\x_cs\let{#1-#2}\empty_command
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\installfont}
+% \begin{macro}{\installrawfont}
+% \changes{1.904}{1999/06/16}{Added \cs{record_usage}. (LH)}
+% \multchanges{\cs{installfont}\cs{installrawfont}}{1.913}{2000/03/21}
+% {Moved some code from \cs{install_font} to these commands. (LH)}
+% |\installfont|\marg{font-name}\marg{file-list}\marg{etx}\\
+% \vadjust{}\qquad \marg{encoding}\marg{family}\marg{series}^^A
+% \marg{shape}\marg{size}\\
+% |\installrawfont|\marg{font-name}\marg{file-list}\marg{etx}\\
+% \vadjust{}\qquad \marg{encoding}\marg{family}\marg{series}^^A
+% \marg{shape}\marg{size}
+%
+% \begin{macrocode}
+\def\installfont#1#2#3#4#5#6#7#8{
+ \global\let\setsomething_global=\x_relax
+ \input_metrics{}{#2}
+ \etxtovpl{#3}{#1}
+ \installfontas{#1}{#4}{#5}{#6}{#7}{#8}
+ \global\let\setsomething_global=\global
+}
+\def\installrawfont#1#2#3#4#5#6#7#8{
+ \global\let\setsomething_global=\x_relax
+ \xdef\out_filename{#1}
+ \input_metrics{\let\storemapdata=\installraw_storemap}{#2}
+ \let\storemapdata=\gobble_three
+ \etxtopl{#3}{#1}
+ \record_usage{#1}
+ \installfontas{
+ \ifdim \rawfont_scaling=\p@ \else
+ [\expandafter\lose_measure\the\rawfont_scaling]~
+ \fi #1
+ }{#4}{#5}{#6}{#7}{#8}
+ \global\let\setsomething_global=\global
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\installraw_storemap}
+% The |\installraw_storemap| macro is a definition of |\storemapdata|
+% that is used when the metrics for a ligful PL file is being inputed.
+% Its job is to write a |\storemapdata| command for this PL to the
+% transforms record file if the PL being written does not have the
+% same name as the MTX that the metrics are taken from (the
+% information is already stored if both files have the same name).
+% |\out_filename| is prematurely set by |\installrawfont| (i.e., long
+% before the PL file is actually opened) so that it can be used in
+% comparing the file names.
+% \changes{1.913}{1999/03/23}{Macro added. (LH)}
+% \begin{macrocode}
+\def\installraw_storemap#1#2#3{
+ \def\a_macro{#1}
+ \ifx \a_macro\out_filename \else
+ \record_transform{\out_filename}{\string\frommtx{#1}}{}\if_false
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\input_metrics}
+% The |\input_metrics| macro takes a comma-separated list of metric
+% files as its second argument and sees to that exactly these metrics
+% are loaded. If the list is identical to that used in the last call
+% to |\input_metrics|, then this is already the case and
+% |\input_metrics| simply refrains from flushing those previous
+% metrics from \TeX's memory. Otherwise it closes a group (flushing
+% the metrics from a previous call), opens a group (so that these
+% metrics can be flushed at the next |\installfont| or
+% |\installrawfont| command, if necessary), and starts inputting the
+% metrics files in question.
+%
+% The first argument consists of code that will be executed after the
+% group has been closed and opened, but before any metrics is inputed.
+% \changes{1.900}{1999/02/13}
+% {Use \cs{process_csep_list} for file-list. (LH)}
+% \changes{1.914}{2000/05/26}{Redefined to suite \cs{file_list_metrics}.
+% In particular, there will now be a comma at the end of
+% \cs{curr_file_list} and \cs{prev_file_list}. (LH)}
+% \begin{macrocode}
+\def\input_metrics#1#2{
+ \let\metrics=\file_list_metrics
+ \xdef\curr_file_list{#2,}
+ \let\metrics=\x_relax
+ \ifx\prev_file_list\curr_file_list\else
+ \egroup\bgroup
+ #1
+ \expandafter\process_csep_list \expandafter\input_mtx_file
+ \curr_file_list\process_csep_list,
+ \global\let\prev_file_list=\curr_file_list
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\file_list_metrics}
+% The |\file_list_metrics| macro is a definition of |\metrics| that
+% is used in the \meta{file-list} argument of |\install|\-|font| and
+% |\install|\-|raw|\-|font| when that is |\xdef|ed by |\input_metrics|.
+% This special definition prevents the succeeding \meta{metric
+% commands} from getting expanded.
+% \changes{1.914}{2000/05/26}{Macro added. (LH)}
+% \begin{macrocode}
+\def\file_list_metrics#1,{
+ \iffalse{\fi}
+ \a_toks=\expandafter{\curr_file_list\x_relax#1,}
+ \xdef\curr_file_list{\the\a_toks \iffalse}\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\installfontas}
+% The |\installfontas| command has the syntax
+% \begin{isyntax}
+% |\installfontas|\marg{font-info}\marg{encoding}\marg{family}^^A
+% \penalty0\marg{series}\penalty0\marg{shape}\penalty0\marg{size}
+% \end{isyntax}
+% The precise definition of a \meta{font-info} can be found in
+% \cite[Sec.~4]{fntguide}, here it suffices to say that a font name
+% (name of (V)PL file) is a valid \meta{font-info}. The |\installfontas|
+% command adds an entry for the \meta{font-info} font to a font
+% definition file, giving it the NFSS attributes \meta{encoding}^^A
+% \texttt{/}\nolinebreak[1]\meta{family}\texttt{/}\nolinebreak[1]^^A
+% \meta{series}\texttt{/}\nolinebreak[1]\meta{shape}\texttt{/}^^A
+% \nolinebreak[1]\meta{size}. The substitution mechanism will act on
+% \meta{series} and \meta{shape}, and it is therefore possible that
+% \meta{font-info} will appear in more than one |\Declare|\-|Font|\-^^A
+% |Shape| command. \meta{size} can be either some \meta{size-infos},
+% as defined in \cite[Sec.~4]{fntguide}, or a \package{fontinst}
+% shorthand for a such, declared using |\declaresize|.
+% \changes{1.912}{2000/01/16}{Command added. (LH)}
+% \changes{1.913}{2000/03/02}{Specification changed to allow
+% arbitrary \meta{font-info}s as first argument. (LH)}
+% \changes{1.921}{2002/03/27}{Automatically doing an
+% \cs{installfamily} if that has not been done. (LH) Suggested
+% by Rowland McDonnell.}
+% \begin{macrocode}
+\def\installfontas#1#2#3#4#5#6{
+ \if_undefined{#2-#3-#4-#5}\then
+ \let\do_shape=\x_relax
+ \if_undefined{#2-#3}\then
+ \x_cs\let{#2-#3}\empty_command
+ \autoinstallfamily{#2}{#3}
+ \fi
+ \x_cs\xdef{#2-#3}{
+ \csname#2-#3\endcsname
+ \do_shape{#2}{#3}{#4}{#5}
+ }
+ \fi
+ \let\do_size=\x_relax
+ \x_cs\xdef{#2-#3-#4-#5}{
+ \if_defined{#2-#3-#4-#5}\then
+ \csname#2-#3-#4-#5\endcsname
+ \fi
+ \do_size{#6}{#1}
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\autoinstallfamily}
+% This command is called by |\installfontas| when it is asked to
+% install a font for which no |\installfamily| has been given. The
+% syntax is
+% \begin{quote}
+% |\autoinstallfamily|\marg{encoding}\marg{family}
+% \end{quote}
+% It defaults to calling |\installfamily| in the obvious way, but
+% it can be redefined if the user wants something different.
+% \changes{1.924}{2003/02/08}{Macro added. (LH)}
+% \begin{macrocode}
+\def\autoinstallfamily#1#2{\installfamily{#1}{#2}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endinstallfonts}
+% Finish the installation by processing the |\family_toks|
+% token register, which contains the accumulated information
+% to be written out to |.fd| files.
+%
+% \begin{macrocode}
+\def\endinstallfonts{
+ \global\let\setsomething_global=\x_relax
+ \let\do_shape=\fd_shape
+ \let\do_size=\fd_size
+ \the\family_toks
+ \global\family_toks{}
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% The |\installfont| command has traditionally allowed that names of
+% base fonts (MTX files) are suffixed by a
+% \verb*" scaled "\meta{factor} that would cause the \texttt{rawscale}
+% integer to be set and thereby scale everything that was in that base
+% font by the said \meta{factor}. There is now a more general approach
+% to this. If the control sequence
+% \describecsfamily{IFKW-\meta{keyword}}|IFKW-|\meta{keyword} is
+% defined then \meta{keyword} may be used as \texttt{scaled} is above;
+% this control sequence should grab all the ``arguments'' of the
+% keyword, process them as necessary, and end with the |\get_keyword|
+% macro so that another keyword may be processed. As a rule, the
+% arguments and keywords are delimited from each other by single spaces.
+% A macro grabbing an argument grabs also the space after it. The
+% \texttt{IFKW} is for \texttt{I}nstall\texttt{F}ont
+% \texttt{K}ey\texttt{W}ord.
+%
+% \changes{1.923}{2002/10/09}{Added support for keywords other than
+% \texttt{scaled} in the second argument of \cs{installfont} and
+% such. (LH)}
+%
+% \begin{macro}{\input_mtx_file}
+% The |\input_mtx_macro| takes one undelimited argument. It
+% interprets this argument as if it was one item in the \meta{file-list}
+% argument of |\install|\-|font| or |\install|\-|rawfont|, and does
+% the corresponding processing. The argument should be one of the
+% following three things:
+% \begin{quote}
+% \meta{font}\meta{optional modifiers}\\
+% |\metrics| \meta{metric commands}\\
+% \meta{nothing}
+% \end{quote}
+% If, in the first case, an MTX file for \meta{font} does not
+% exist then it is generated on the fly from a corresponding |.pl|,
+% |.afm|, or |.vpl| file in the call to |\fromany|. In the second
+% case, the \meta{metric commands} simply get executed. In the third
+% case, nothing happens.
+%
+% The \meta{optional modifiers} is either empty or has the form
+% \meta{modifier clause}\meta{optional modifiers}. A \meta{modifier
+% clause} generally has the form
+% \begin{quote}
+% \verb*" "\meta{keyword}\verb*" "\meta{argument(s)}
+% \end{quote}
+% e.g.,
+% \begin{quote}
+% \verb*| scaled |\meta{rawscale factor}
+% \end{quote}
+%
+% \changes{1.904}{1999/06/16}{Now using \cs{fromany} to make an MTX
+% file when necessary. Furthermore testing for empty argument using
+% \cs{ifx} rather than \cs{if}. (LH)}
+% \changes{1.912}{2000/01/15}{Added error message. (LH) Suggested by
+% Alexei Kostin.}
+% \changes{1.914}{2000/05/26}{Can now accept arbitrary metric
+% commands in argument. (LH)}
+% \begin{macrocode}
+\def\input_mtx_file#1{
+ \reset_modifiers_hook
+ \ifx\x_relax#1\x_relax
+% \end{macrocode}
+% This tests for an empty argument, but it also lets explicit metric
+% commands be executed.
+% \begin{macrocode}
+ \else
+ \identity_one{\get_file_name #1~}~\par
+% \end{macrocode}
+% The two spaces have the effect of putting an empty keyword modifier
+% last in the \meta{optional modifiers}. If everything is all right
+% then this will gobble the |\par|. However, if the user forgot some
+% argument of the last keyword then there will be an error message
+% when |\get_keyword| will try to grab the next keyword.
+%
+% If an encoding has been specified then the source file must be a PL
+% or VPL file (since these are the only ones for which it makes sense
+% to specify an encoding), otherwise we rely on |\fromany| to find a
+% font metrics file.
+% \changes{1.926}{2003/07/10}{Only looking for PL and VPL files when
+% an encoding is specified. (LH)}
+% \begin{macrocode}
+ \ifx \pl_encoding\empty_command
+ \fromany\file_name
+ \else
+ \metrics_given_encoding{\file_name}{\pl_encoding}
+ \fi
+ \ifisstr{afm-name}\then
+ \inputmtx{\str{afm-name}}
+ \else
+ \fontinsterror{\string\install...}{
+ Font/MTX~file~\file_name\space not found
+ }{
+ You~can~insert~an~\string\inputmtx\space command~here
+ \messagebreak to~input~some~other~MTX~file~instead.
+ \ifisint{rawscale}\then \messagebreak
+ The~requested~raw~scaling~will~then~be~applied~on~that.
+ \fi
+ }
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\metrics_given_encoding}
+% This macro is a cousin of |\fromany|, for the case that metrics are
+% taken from a (V)PL file that furthermore is assigned nonstandard
+% metrics. The syntax is
+% \begin{quote}
+% |\metrics_given_encoding|\marg{font}\marg{etx}
+% \end{quote}
+% and the generated MTX file is named
+% \meta{font}\texttt{-}\meta{etx}\texttt{.mtx} to avoid that it is
+% picked up by |\fromany| by mistake.
+% \begin{macrocode}
+\def\metrics_given_encoding#1#2{
+ \x_setstr{afm-name}{#1-#2}
+ \if_file_exists{#1.pl}\then
+ \generalpltomtx{#1}{#1-#2}{pl}{#2}
+ \else
+ \if_file_exists{#1.vpl}\then
+ \generalpltomtx{#1}{#1-#2}{vpl}{#2}
+ \else
+ \unsetstr{afm-name}
+ \fi\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \definechange{option-keyword}{1.924}{2002/02/16}{Added mechanism
+% for passing options to MTX and ETX files. (LH)}
+%
+% \begin{macro}{\reset_modifiers_hook}
+% The |\reset_modifiers_hook| macro contains code that initialises
+% all parameters that are modified by some \meta{modifier clause} to
+% their default values. If you need to add some initialisations due
+% to that you define additional keywords then you should append
+% these initialisations to this macro.
+% \usechange{option-keyword}
+% \begin{macrocode}
+\def\reset_modifiers_hook{
+ \unsetint{rawscale}
+ \let\glyph_name_modifier\identity_one
+ \let\pl_encoding\empty_command
+ \let\list_of_options\empty_command
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\get_file_name}
+% The macro |\get_file_name| grabs the base font (or other MTX file)
+% name and starts the processing of the \meta{optional modifiers}.
+% \begin{macrocode}
+\def\get_file_name #1~{
+ \edef\file_name{#1}
+ \get_keyword
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\get_keyword}
+% \begin{macro}{\gobble_keywords}
+% The |\get_keyword| macro expects to be expanded in the context
+% \begin{quote}
+% |\get_keyword|\,\meta{keyword}\verb*" "
+% \end{quote}
+% where the \meta{keyword} is a possible keyword. If
+% |\IFKW-|\meta{keyword} is defined then the above expands to it,
+% otherwise the above expands to an error message followed by a
+% |\gobble_keywords|, which will gobble the rest of the list of
+% keywords and arguments.
+% \begin{macrocode}
+\def\get_keyword #1~{
+ \if_defined{IFKW-#1}\then
+ \csname IFKW-#1 \expandafter\endcsname
+ \else
+ \fontinsterror{\string\install...}{
+ `#1'~is~not~a~defined~keyword
+ }{
+ \error_help_a\messagebreak
+ Extra~tokens~will~be~flushed.
+ }
+ \expandafter\gobble_keywords
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\gobble_keywords#1\par{}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\IFKW-}
+% The empty keyword is used to flag the end of the \meta{optional
+% modifiers}.
+% \begin{macrocode}
+\x_cs\let{IFKW-}=\gobble_keywords
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IFKW-scaled}
+% This macro handles grabbing the argument of the traditional
+% \texttt{scaled} keyword.
+% \changes{1.900}{1999/02/05}{Changed \cs{setint} to \cs{resetint}.
+% (LH)}
+% \begin{macrocode}
+\x_cs\def{IFKW-scaled}#1~{
+ \ifnum #1=\one_thousand
+ \unsetint{rawscale}
+ \else
+ \x_resetint{rawscale}{#1}
+ \fi
+ \get_keyword
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IFKW-suffix}
+% This macro handles grabbing the argument of the \texttt{suffix}
+% keyword. The effect of `\texttt{suffix} \meta{suffix}' is that
+% \meta{suffix} will be appended to the name of every glyph defined
+% by the next MTX file to be read in.
+% \begin{macrocode}
+\x_cs\def{IFKW-suffix}#1~{
+ \def\glyph_name_modifier##1{##1#1}
+ \get_keyword
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IFKW-encoding}
+% \begin{macro}{\pl_encoding}
+% This macro handles grabbing the argument of the \texttt{encoding}
+% keyword. The effect of `\texttt{encoding} \meta{etx}' is that
+% \meta{etx} will be used as encoding when converting a PL or VPL
+% file to MTX. |\pl_encoding| is used for storing the argument
+% value. Its expansion is normally empty, which means |\fromafm|
+% handles locating the metrics file and the encoding used for a PL
+% or VPL is determined by its codingscheme.
+% \begin{macrocode}
+\x_cs\def{IFKW-encoding}#1~{
+ \def\pl_encoding{#1}
+ \get_keyword
+}
+\let\pl_encoding=\empty_command
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\IFKW-option}
+% This macro handles grabbing the argument of the \texttt{option}
+% keyword. One can test using |\ifoption| whether a particular option
+% was specified.
+% \usechange{option-keyword}
+% \begin{macrocode}
+\x_cs\def{IFKW-option}#1~{
+ \add_to\list_of_options{\do{#1}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifoption}
+% \usechange{option-keyword}
+% \begin{macro}{\list_of_options}
+% \usechange{option-keyword}
+% The |\ifoption| command is used to test whether a particular option
+% is present on the list of options. The syntax is
+% \begin{quote}
+% |\ifoption|\marg{string}|\then|
+% \end{quote}
+% and it is tested whether the \meta{string} was one of the options
+% given. Like strings in general, the \meta{string} is expanded
+% before it is compared to the options listed in |\list_of_options|.
+%
+% The |\list_of_options| is a sequence of items on the form
+% \begin{quote}
+% |\do|\marg{option}
+% \end{quote}
+% where each \meta{option} is an already expanded string of
+% characters.
+% \begin{macrocode}
+\def\ifoption#1\then{
+ \_a_false
+ \edef\a_macro{#1}
+ \def\do##1{
+ \if_a_ \else
+ \def\b_macro{##1}
+ \ifx \a_macro\b_macro \_a_true \fi
+ \fi
+ }
+ \list_of_options
+ \if_a_
+}
+%</pkg>
+%<*doc>
+\def\ifoption#1\then{%
+ \generic@if{option \TypesetStringExpression{#1}}%
+}
+%</doc>
+%<*pkg>
+\let\list_of_options\empty_command
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \subsection{Writing font definition files}
+%
+% \begin{macro}{\fd_family}
+% |\fd_family{ENCODING}{FAMILY}{FD-COMMANDS}|
+%
+% Writes out an |.fd| file for the specified |ENCODING| and |FAMILY|
+% processing the accumulated information and default substitutions.
+%
+% \begin{macrocode}
+\def\fd_family#1#2#3{
+ \a_toks{#3}
+ \edef\lowercase_file{\lowercase{
+ \edef\noexpand\lowercase_file{#1#2.fd}}}
+ \lowercase_file
+ \open_out{\lowercase_file}
+ \out_line{\percent_char~Filename:~\lowercase_file}
+ \out_line{\percent_char~Created~by:~tex~\jobname}
+ \out_line{\percent_char~Created~using~fontinst~v\fontinstversion}
+ \out_line{}
+ \out_line{\percent_char~THIS~FILE~SHOULD~BE~PUT~IN~A~TEX~INPUTS~
+ DIRECTORY}
+ \out_line{}
+ \out_line{\string\ProvidesFile{\lowercase_file}}
+ \out_lline{[
+ \the\year/
+ \ifnum10>\month0\fi\the\month/
+ \ifnum10>\day0\fi\the\day\space
+ Fontinst~v\fontinstversion\space
+ font~definitions~for~#1/#2.
+ ]}
+ \out_line{}
+ \out_line{\string\DeclareFontFamily{#1}{#2}{\the\a_toks}}
+ {
+ \csname #1-#2\endcsname
+ \out_line{}
+ \let\do_shape=\substitute_shape
+ \csname #1-#2\endcsname
+ \let\do_shape=\remove_shape
+ \csname #1-#2\endcsname
+ }
+ \x_cs\g_let{#1-#2}\x_relax
+ \out_line{}
+ \out_line{\string\endinput}
+ \close_out{Font~definitions}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fd_shape}
+% |\fd_shape{ENCODING}{FAMILY}{SERIES}{SHAPE}|
+%
+% \begin{macrocode}
+\def\fd_shape#1#2#3#4{
+ \out_line{}
+ \out_line{\string\DeclareFontShape{#1}{#2}{#3}{#4}\left_brace_char}
+ \csname #1-#2-#3-#4\endcsname
+ \x_cs\g_let{#1-#2-#3-#4}\empty_command
+ \out_line{\right_brace_char{}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fd_size}
+% |\fd_size{SIZE}{FONT-NAME}|
+%
+% \begin{macrocode}
+\def\fd_size#1#2{
+ \x_cs\ifx{siz-#1}\x_relax
+ \out_lline{#1~#2}
+ \else
+ \out_lline{\csname siz-#1\endcsname\space #2}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\remove_shape}
+% |\remove_shape{ENCODING}{FAMILY}{SERIES}{SHAPE}|
+%
+% \begin{macrocode}
+\def\remove_shape#1#2#3#4{
+ \x_cs\g_let{#1-#2-#3-#4}\x_relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\substitute_shape}
+% |\substitute_shape{ENCODING}{FAMILY}{SERIES}{SHAPE}|
+%
+% \begin{macrocode}
+\def\substitute_shape#1#2#3#4{
+ \edef\orig_shape{#4}
+ \substitute_series{#1}{#2}{#3}{\orig_shape}
+ \x_cs\ifx{sub-\orig_shape}\x_relax\else
+ \edef\subst_shape{\csname sub-\orig_shape\endcsname}
+ \x_cs\ifx{#1-#2-#3-\subst_shape}\x_relax
+ \out_line{
+ \string\DeclareFontShape{#1}{#2}{#3}{\subst_shape}{
+ <->\csname typ-\orig_shape\endcsname\space
+ *~#2/#3/\orig_shape
+ }{}
+ }
+ \x_cs\let{#1-#2-#3-\subst_shape}\empty_command
+ \substitute_shape{#1}{#2}{#3}{\subst_shape}
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\substitute_series}
+% |\substitute_series{ENCODING}{FAMILY}{SERIES}{SHAPE}|
+%
+% \begin{macrocode}
+\def\substitute_series#1#2#3#4{
+ \edef\orig_series{#3}
+ \x_cs\ifx{sub-\orig_series}\x_relax\else
+ \edef\subst_series{\csname sub-\orig_series\endcsname}
+ \x_cs\ifx{#1-#2-\subst_series-#4}\x_relax
+ \out_line{
+ \string\DeclareFontShape{#1}{#2}{\subst_series}{#4}{
+ <->\csname typ-\orig_series\endcsname\space
+ *~#2/\orig_series/#4
+ }{}
+ }
+ \x_cs\let{#1-#2-\subst_series-#4}\empty_command
+ \substitute_series{#1}{#2}{\subst_series}{#4}
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\substitutesilent}
+% \begin{macro}{\substitutenoisy}
+% |\substitutesilent{TO}{FROM}|\\
+% |\substitutenoisy{TO}{FROM}|
+%
+% Specifies a default substitution for family or shape |TO|,
+% which is substituted by family or shape |FROM|.
+%
+% \begin{macrocode}
+\def\substitutesilent#1#2{
+ \x_cs\def{sub-#2}{#1}
+ \x_cs\def{typ-#2}{ssub}
+}
+\def\substitutenoisy#1#2{
+ \x_cs\def{sub-#2}{#1}
+ \x_cs\def{typ-#2}{sub}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\substitutesilent{bx}{b}
+\substitutesilent{b}{bx}
+\substitutesilent{b}{sb}
+\substitutesilent{b}{db}
+\substitutesilent{m}{mb}
+\substitutesilent{m}{l}
+% \end{macrocode}
+% \begin{macrocode}
+\substitutenoisy{ui}{it}
+% \end{macrocode}
+%
+% I don't think we want these since in OT1 encoding it will
+% cause the old |<sterling>| vs |<dollar>| problem. (ASAJ)
+% --- Oh yes we do. (SPQR)
+%
+% \begin{macrocode}
+\substitutesilent{sl}{it}
+\substitutesilent{it}{sl}
+% \end{macrocode}
+%
+%
+% \subsection{The font substitution mechanism}
+%
+% \textbf{Note:} This subsection contains (part of) a new implementation
+% of the font substitution mechanism, but it is uncertain whether it
+% will ever be completed.
+% \begin{macrocode}
+%<*underconstruction>
+% \end{macrocode}
+%
+%
+% \subsubsection{The substitution graph}
+%
+% Which substitutions are performed are determined by the substitution
+% graph. The vertices of this graph are all combinations of a series and
+% a shape. The arcs (directed edges) of this graph are the substitutions
+% that can be made. Each arc has a wheight---a real number in the range
+% $[0,1]$---that describes how much of the quality of the font that is
+% preserved with this substitution.
+%
+% As an example, consider the case that there is an arc from \texttt{m/it}
+% to \texttt{m/sl} and that the wheight of this arc is $0.5$. This means
+% that it is OK to substitute the medium italic (\texttt{m/it}) font as a
+% medium slanted (\texttt{m/sl}) font if there is no medium slanted font,
+% but that the medium italic font is only considered as being half
+% ($0.5$) as good a medium slanted font as it is a medium italic font.
+%
+% The main problem the substitution mechanism has to solve in this
+% context is to find the best possible way of substituting a font, given
+% the real fonts which has actually been installed (using |\installfont|
+% or |\installrawfont|). The solution to this problem is computed by a
+% brute force approach---all possible substitution paths are followed
+% and during this process the best solution so far, for each vertex
+% separately, is stored.
+% \medskip
+%
+% In practice, the substitution graph $G$ is constructed as the cartesian
+% product of one graph $G\sb{1}$ of series substitutions and one graph
+% $G\sb{2}$ of shape substitutions, with the option of adding some
+% additional arcs to this product. The reason for this is that one
+% usually wants to make the same shape substitutions in all series and
+% vice versa, so by only storing the $G\sb{1}$ and $G\sb{2}$ graphs, plus
+% perhaps a handfull of extra edges, one gets away with using fewer
+% tokens.
+% The wheights of the arcs are stored as integers in the range 0--1000,
+% where 0 means the real number $0$ and 1000 means the real number $1$.
+% \medskip
+%
+% \DescribeMacro\do_arc
+% The |\do_arc| macro is probably the most common in the data
+% structures that constitute the substitution graph. Its syntax is
+% always
+% \begin{quote}
+% |\do_arc|\marg{series}\marg{shape}\marg{wheight}
+% \end{quote}
+% but it is meant to be redefined whenever one needs to do something
+% ``for all arcs'' (usually all arcs at a given vertex or so). There are
+% three families of macros which consist of |\do_arc| lists, namely
+% \begin{quote}
+% |\sub1-|\meta{series}\\
+% |\sub2-|\meta{shape}\\
+% |\sub-|\meta{series}|-|\meta{shape}
+% \end{quote}
+% These macros store arcs going out from a vertex. The
+% |\sub1-|\meta{series} macross store the arcs incident with the vertex
+% \meta{series} in the series substitution graph $G\sb{1}$. The
+% |\sub2-|\meta{shape} macros store the arcs incident with the vertex
+% \meta{shape} in the shape substitution graph $G\sb{2}$. The
+% |\sub-|\meta{series}|-|\meta{shape} macros store the arcs of $G$ that
+% are incident with the vertex \meta{series}|/|\meta{shape} but do
+% \emph{not} appear in the cartesian product $G\sb{1} \times G\sb{2}$.
+%
+% The \meta{series} and \meta{shape} arguments of |\do_arc| tells which
+% vertex the arc goes to, hence for example |\do_arc{b}{it}{600}| in the
+% macro |\sub-db-sl| corresponds to an arc going from the |db/sl| vertex
+% to the |b/it| vertex and having a wheight of $0.6$.
+%
+% \DescribeMacro\curr_series
+% \DescribeMacro\curr_shape
+% The above omits one important detail, namely that the \meta{shape}
+% argument for a |\do_arc| in a |\sub1-|\textellipsis\ must be able to
+% be \emph{all} shapes since the shape is not determined for arcs in
+% $G\sb{1}$ and the series is likewise for arcs in $G\sb{2}$. To make things
+% work anyway, there are two macros |\curr_series| and |\curr_shape|
+% which contain this missing information. Furthermore, a |\do_arc| item
+% for an arc in $G\sb{1}$ will always have the structure
+% \begin{quote}
+% |\do_arc|\marg{series}|\curr_shape|\marg{wheight}
+% \end{quote}
+% and a |\do_arc| item for an arc in $G\sb{2}$ will have the structure
+% \begin{quote}
+% |\do_arc\curr_series|\marg{shape}\marg{wheight}
+% \end{quote}
+%
+%
+% \begin{macro}{\substituteshape}
+% \begin{macro}{\substituteseries}
+% \begin{macro}{\substituteseriesshape}
+% |\substituteshape|\marg{to}\marg{from}\marg{wheight}\\
+% |\substituteseries|\marg{to}\marg{from}\marg{wheight}\\
+% |\substituteseriesshape|\marg{toseries}\marg{toshape}^^A
+% \marg{fromseries}\marg{fromshape}\marg{wheight}
+%
+% \begin{macrocode}
+\def\substituteshape#1#2#3{
+ \round_wheight{#3}
+ \edef\temp_command{#1}
+ \edef\sub_suffix{#2}
+ \ifx \temp_command\sub_suffix \else
+ \def\sub_suffix##1##2{2-##2}
+ \def\do_arc##1##2##3{
+ \x_cs\ifx{sub2-##2}R \else
+ \noexpand\do_arc\noexpand\curr_series{##2}{##3}
+ \fi
+ }
+ \update_do_arc_list{}{#2}{}{#1}{\noexpand\curr_series{#1}}
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\substituteseries#1#2#3{
+ \round_wheight{#3}
+ \edef\temp_command{#1}
+ \edef\sub_suffix{#2}
+ \ifx \temp_command\sub_suffix \else
+ \def\sub_suffix##1##2{1-##1}
+ \def\do_arc##1##2##3{
+ \x_cs\ifx{sub1-##1}R \else
+ \noexpand\do_arc{##1}\noexpand\curr_shape{##3}
+ \fi
+ }
+ \update_do_arc_list{#2}{}{#1}{}{{#1}\noexpand\curr_shape}
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\substituteseriesshape#1#2#3#4#5{
+ \round_wheight{#5}
+ \edef\temp_command{#1-#2}
+ \edef\sub_suffix{#3-#4}
+ \ifx \temp_command\sub_suffix \else
+ \def\sub_suffix##1##2{-##1-##2}
+ \def\do_arc##1##2##3{
+ \x_cs\ifx{sub-##1-##2}R \else
+ \noexpand\do_arc{##1}{##2}{##3}
+ \fi
+ }
+ \update_do_arc_list{#3}{#4}{#1}{#2}{{#1}{#2}}
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\round_wheight#1{
+ \eval_expr{#1}
+ \ifnum \one_thousand<\result
+ \result=\one_thousand
+ \else \ifnum 0>\result
+ \result=\z@
+ \fi\fi
+}
+% \end{macrocode}
+%
+% |\update_do_arc_list|\marg{update-series}\marg{update-shape}^^A
+% \allowbreak\marg{tag-series}\allowbreak\marg{tag-shape}^^A
+% \allowbreak\marg{inserted series+shape}
+%
+% \begin{macrocode}
+\def\update_do_arc_list#1#2#3#4#5{
+ \bgroup
+ \edef\temp_command{sub\sub_suffix{#1}{#2}}
+ \x_cs\let{sub\sub_suffix{#3}{#4}}=R
+ \x_cs\xdef\temp_command{
+ \x_cs\ifx\temp_command\relax \else
+ \csname\temp_command\endcsname
+ \fi
+ \ifnum 0<\result
+ \noexpand\do_arc #5{\the\result}
+ \fi
+ }
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \begin{macro}{\substitutesilent}
+% \begin{macro}{\substitutenoisy}
+% |\substitutesilent{TO}{FROM}|\\
+% |\substitutenoisy{TO}{FROM}|
+%
+% Specifies a default substitution for family or shape |TO|,
+% which is substituted by family or shape |FROM|.
+%
+% \begin{macrocode}
+\def\substitutesilent#1#2{
+ \substituteseries{#1}{#2}{900}
+ \substituteshape{#1}{#2}{900}
+}
+\def\substitutenoisy#1#2{
+ \substituteseries{#1}{#2}{500}
+ \substituteshape{#1}{#2}{500}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\a_count=900 % Silent substitution wheight
+\b_count=500 % Noisy substitution wheight
+\substituteseries{bx}{b}{\a_count}
+\substituteseries{b}{bx}{\a_count}
+\substituteseries{b}{sb}{\a_count}
+\substituteseries{b}{db}{\a_count}
+\substituteseries{m}{mb}{\a_count}
+\substituteseries{m}{l}{\a_count}
+% \end{macrocode}
+% \begin{macrocode}
+\substituteshape{ui}{it}{\b_count}
+% \end{macrocode}
+%
+% I don't think we want these since in OT1 encoding it will
+% cause the old |<sterling>| vs |<dollar>| problem. (ASAJ)
+% --- Oh yes we do. (SPQR)
+%
+% \begin{macrocode}
+\substituteshape{sl}{it}{\a_count}
+\substituteshape{it}{sl}{\a_count}
+% \end{macrocode}
+%
+%
+% \subsubsection{Listing reachable vertices}
+%
+% While determining the optimal substitutions, there is a need to store
+% some---more or less temporary---information for each vertex. Such
+% information will be called a \emph{property} of the vertex and it is
+% stored in the |\v-|\meta{series}|-|\meta{shape} family of macros.
+%
+% The following are the basic properties:
+% \begin{list}{}{^^A
+% ^^A How does one make the label go on a line of its own??
+% }
+% \item[\cs{real_font}\marg{quality}]
+% This expresses that this vertex corresponds to a font that has
+% actually been installed with a nominal quality of \meta{quality}.
+% \item[\cs{subs_font}\marg{series}\marg{shape}\marg{quality}]
+% This expresses that this vertex corresponds to a font for which
+% the font \meta{series}|/|\meta{shape} has been substituted.
+% \meta{quality} is the quality this substitution is considered to
+% have.
+% \item
+% \end{list}
+%
+%
+% There will also be some lists of vertices. These will consist of simple
+% |\do|\marg{series}\marg{shape} triples.
+%
+% \begin{macrocode}
+\def\list_subs_vertices{
+ \def\subs_vertex_list{}
+ \let\do_arc=\subs_do_arc
+ \let\do=\never_do
+ \def\real_font##1{\c_count=\@MM}
+ \def\subs_font##1##2##3{\c_count=##3\relax}
+ \real_vertex_list
+}
+\def\subs_do_arc#1#2#3{
+ \b_count=#3
+ \multiply \b_count \a_count
+ \divide \b_count \one_thousand
+ \c_count=-\max_mathchardef
+ \csname v-#1-#2\endcsname
+ \ifnum \c_count<\b_count
+ \ifnum \c_count=-\max_mathchardef
+ \edef\subs_vertex_list{\subs_vertex_list\do{#1}{#2}}
+ \fi
+ \x_cs\edef{v-#1-#2}{\noexpand\subs_font{\subs_series}
+ {\subs_shape}{\the\b_count}}
+ \toks_a=\expandafter{\the\a_toks \do_subs{#1}{#2}}
+ \fi
+}
+\def\do_subs#1#2{
+ \edef\curr_series{#1}
+ \edef\curr_shape{#2}
+ \csname v-#1-#2\endcsname
+ \a_count=\c_count
+ \a_toks={}
+ \csname sub-#1-#2\endcsname
+ \csname sub1-#1\endcsname
+ \csname sub2-#2\endcsname
+ \the\a_toks
+}
+\def\start_subs_at#1#2{
+ \edef\subs_series{#1} \let\curr_series=\subs_series
+ \edef\subs_shape{#2} \let\curr_shape=\subs_shape
+ \a_count=\x_cs\second_of_two{v-#1-#2}
+ \a_toks={}
+ \csname sub-#1-#2\endcsname
+ \csname sub1-#1\endcsname
+ \csname sub2-#2\endcsname
+ \the\a_toks
+}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%</underconstruction>
+% \end{macrocode}
+%
+%
+% \subsection{Default encodings and font sizes}
+%
+% \begin{macro}{\declareencoding}
+% |\declareencoding{CODINGSCHEME}{ENCODING}|
+%
+% Declare a macro |\enc-CODINGSCHEME| which expands to |ENCODING|.
+% This is used to determine the encoding in |\pltomtx|.
+% \changes{1.927}{2004/07/31}{Lowercased encoding file names. (LH)}
+%
+% \begin{macrocode}
+\def\declareencoding#1#2{\x_cs\edef{enc-#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% Old \TeX{} text font encodings.
+% \begin{macrocode}
+\declareencoding{TEX~TEXT}{ot1}
+\declareencoding{TEX~TEXT~WITHOUT~F-LIGATURES}{ot1}
+\declareencoding{TEX~TYPEWRITER~TEXT}{ot1tt}
+% \end{macrocode}
+%
+% Old \TeX{} math font encodings.
+% \begin{macrocode}
+\declareencoding{TEX~MATH~ITALIC}{oml}
+\declareencoding{TEX~MATH~SYMBOLS}{oms}
+\declareencoding{TEX~MATH~EXTENSION}{omx}
+\declareencoding{LATEX~SYMBOLS}{lasy}
+% \end{macrocode}
+%
+% Euler math font encodings.
+% \begin{macrocode}
+\declareencoding{TEX~TEXT~SUBSET}{eufrak}
+\declareencoding{TEX~MATH~ITALIC~SUBSET}{eurm}
+\declareencoding{TEX~MATH~SYMBOLS~SUBSET}{euscr}
+\declareencoding{EULER~SUBSTITUTIONS~ONLY}{euex}
+% \end{macrocode}
+%
+% New \TeX{} text font encodings.
+% \begin{macrocode}
+\declareencoding{EXTENDED~TEX~FONT~ENCODING~-~LATIN}{t1}
+\declareencoding{TEX~TEXT~COMPANION~SYMBOLS~1---TS1}{ts1}
+% \end{macrocode}
+%
+% Rencoded PostScript font encdings.
+% \begin{macrocode}
+\declareencoding{TEXBASE1ENCODING}{8r}
+\declareencoding{TEX~TYPEWRITER~AND~WINDOWS~ANSI}{8y}
+% \end{macrocode}
+%
+% \begin{macro}{\declaresize}
+% |\declaresize{FONTSIZE}{LATEXSIZE}|
+%
+% \begin{macrocode}
+\def\declaresize#1#2{\x_cs\edef{siz-#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% Default sizes. An empty size argument is equivalent to |<->|,
+% for use with scalable fonts.
+%
+% \begin{macrocode}
+\declaresize{}{<->}
+\declaresize{5}{<5>}
+\declaresize{6}{<6>}
+\declaresize{7}{<7>}
+\declaresize{8}{<8>}
+\declaresize{9}{<9>}
+\declaresize{10}{<10>}
+\declaresize{11}{<10.95>}
+\declaresize{12}{<12>}
+\declaresize{14}{<14.4>}
+\declaresize{17}{<17.28>}
+\declaresize{20}{<20.74>}
+\declaresize{25}{<24.88>}
+% \end{macrocode}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{Debugging}
+%
+% \begin{macro}{\NOFILES}
+% |\NOFILES| switches off file generation, and causes
+% \package{fontinst} to only generate empty files. It only affects the
+% user level commands, so it is primarily of use when debugging
+% commands that build on these, such as for example the
+% |\latin|\-|family| command.
+% \changes{1.914}{2000/05/20}{Added \cs{reglyphfont}. (LH)}
+% \begin{macrocode}
+\def\NOFILES{
+ \def\transformfont##1##2{
+ \touch_file{##1.mtx}
+ \touch_file{##1.pl}
+ }
+ \def\reglyphfont##1##2{\touch_file{##1.mtx}}
+ \def\installfonts{}
+ \def\endinstallfonts{}
+ \def\installfont##1##2##3##4##5##6##7##8{
+ \touch_file{##1.vpl}
+ }
+ \def\installrawfont##1##2##3##4##5##6##7##8{
+ \touch_file{##1.pl}
+ }
+ \def\installfamily##1##2##3{\touch_file{##1##2.fd}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\touch_file}
+% \begin{macrocode}
+\def\touch_file#1{
+ \edef\lowercase_file{\lowercase{
+ \edef\noexpand\lowercase_file{#1}}}
+ \lowercase_file
+ \open_out{\lowercase_file}
+ \out_line{\percent_char~TEST~FILE.}
+ \out_line{\percent_char~Created~whilst~debugging~fontinst.}
+ \close_out{Test~file}
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/fontinst/base/fimapgen.dtx b/Master/texmf-dist/source/fontinst/base/fimapgen.dtx
new file mode 100644
index 00000000000..bce3a5a99fd
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fimapgen.dtx
@@ -0,0 +1,1533 @@
+% \CheckSum{873}
+% \iffalse meta-comment
+%
+% Copyright 1999 the fontinst maintenance team and any individual
+% authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.0 or, at your option, any later version.
+%
+%%% From file: fimapgen.dtx
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fisource}
+
+\title{\texttt{fimapgen.dtx}}
+\author{Lars Hellstr\"om}
+\begin{document}
+\maketitle
+
+\DocInput{fimapgen.dtx}
+
+\end{document}
+%</driver>
+% \fi
+%
+%
+% \section{Generating map file fragments}
+% \label{Sec:Mapfiles}
+% \changes{1.904}{1999/06/15}{Completed rudimentary map file fragment
+% generator, made it part of \texttt{finstmsc.sty}. (LH)}
+% \newcommand\OzTeX{O\kern-.03em z\kern-.15em\TeX}
+%
+% A \emph{map file} is a file which is used by some DVI driver to link
+% various kinds of font information to each other, as is needed for the
+% driver's operation. Examples of such files are the file
+% \texttt{psfonts.map} used by \texttt{dvips} and the config files of
+% \OzTeX. There are however many other such files around in the \TeX\
+% world.
+%
+% Not all of a map file need to be related to linking specific kinds of
+% font information to each other. \OzTeX\ config files can for example
+% be used to set the values of \TeX\ implementation parameters\footnote
+% {The kind of things that were Pascal constants in the original \Web\
+% sources for \TeX.} and there need not be any font-related information
+% at all in them. The important thing is however that there can be map
+% information in them---that information could be automatically written
+% by the routines described here.
+%
+% Since there may be other kinds of information in these files (and often
+% enough need to be for everthing to work right), the routines described
+% here will only generate map file \emph{fragments}. These fragments
+% will then have to be inserted in the final map files somehow, usually
+% through manual editing. The purpose of the routines described here is
+% only to save the user a good deal of (often quite boring) typing, not
+% to actually install everything where it needs to be.
+%
+% \StopEventually{}
+%
+% \begin{macro}{\mapfrags_subsystem}
+% This macro holds the name of the automatic map file fragments
+% writer subsystem of \package{fontinst}, as it appears in error
+% messages.
+% \begin{macrocode}
+\def\mapfrags_subsystem{Map~fragments~writer}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Interface to main \package{fontinst}}
+% \label{Ssec:interface}
+%
+% The automatic generation of map file fragments is based on the two
+% commands |\storemapdata| and |\makemapentry|. Their respective
+% syntaxes are
+% \begin{quote}
+% |\storemapdata|\marg{\TeX\ font name}\marg{source}^^A
+% \marg{transforms}\\
+% |\makemapentry|\marg{\TeX\ font name}
+% \end{quote}
+%
+% \DescribeMacro{\storemapdata}|\storemapdata| commands are written when
+% a metric file \meta{\TeX\ font name}|.mtx| is generated. The purpose
+% of these commands is to record where the data for that file came from,
+% and what was done to these data. The source of the data is specified
+% in the \meta{source} argument, which can contain one of
+% \begin{quote}
+% |\fromafm|\marg{AFM name}\marg{PS name}\\
+% |\frompl|\marg{PL name}\\
+% |\frommtx|\marg{MTX name}\\
+% |\fromvpl|
+% \end{quote}
+% The only real difference between |\fromafm| and |\frompl| at this
+% stage is that the former specifies the PS name of the font, but the
+% latter do not. If you write a |\store|\-|map|\-|data| command yourself
+% and want to supply the PS name then you should use |\fromafm| even if
+% you took the font metrics from a PL.
+% There is a important difference between |\fromvpl| and the first three
+% in that virtual fonts need no map file entry (and hence there should
+% not be any either). Besides some error checking, |\fromvpl| causes a
+% |\makemapentry| to do essentially nothing.
+%
+% What was done to the data is specified by the \meta{transforms}
+% argument, which is a possibly empty sequence of commands, in which
+% each item is one of
+% \begin{isyntax}
+% |\transformfont|\marg{x-scale}\marg{slant-scale}\\
+% |\reencodefont|\marg{etx}\\
+% |\reglyphfont|
+% \end{isyntax}
+% The order is interpreted so that the thing done first appear first in
+% the sequence. In normal cases there is at most one of each, and then
+% the order is not important. \meta{x-scale}, \meta{slant-scale}, and
+% \meta{y-scale} are the values of these variables used for the
+% transformation, as \TeX\ numbers. \meta{etx} is the name of the ETX
+% file used for the font reencoding.
+% |\reglyphfont| is an error marker. It will not be encountered (but
+% it may well get stored in some table) unless a metric font transform
+% is applied to a font that has been reglyphed, which is illegal.
+%
+% \changes{1.911}{1999/11/17}{\cs{storemapdata} commands are also
+% written to metric files when they are generated. (LH)}
+% In addition to being written to a transforms record file (if one is
+% open), |\storemapdata| commands are also written to the actual metric
+% file. This makes it possible to find out where the data for a file
+% comes from even if the file was made on a previous \package{fontinst}
+% run, but since it requires reading an additional file just to find one
+% command, it will be slower than if the |\storemapdata| appeared in a
+% transforms records file.
+%
+% \DescribeMacro{\makemapentry}|\makemapentry| commands are written when
+% a VPL that uses or a ligfull PL for a font is generated. These
+% commands are the ones which actually cause the map file fragment
+% generator to write an entry, but entries are only written if they
+% haven't been written before. |\makemapentry| uses information that
+% was stored by a previous call to |\storemapdata|.
+%
+% |\storemapdata| stores its arguments in one of the control sequences
+% \describecsfamily{Tf-\meta{font}}|\Tf-|\meta{font}, where \meta{font}
+% is the same thing as \meta{\TeX\ font name} above. |Tf| stands for
+% ``\TeX\ font''. The control sequences in this family are paramterless
+% macros whose replacement texts have the following form:
+% \changes{1.914}{2000/05/30}{Contents of \cs{Tf-\meta{font}} control
+% sequences changed to allow processing the same file of recorded
+% transformations several times on the same run. (LH)}
+% \begin{quote}
+% \marg{made}\marg{source}\marg{transforms}
+% \end{quote}
+% Here \meta{source} and \meta{transforms} are exactly as above.
+% \meta{made} is a number which describes the current status of this font.
+% If \meta{made} is even then the font has been defined but no entry for
+% it has subsequently been written to the map file, whereas if it is odd
+% then an entry for it has been written to the map file. If the value of
+% \meta{made} is less than |\process_generation| then the data in the
+% other two arguments is from a previous run and should be ignored.
+% The |\Tf-|\meta{font} control sequences should always be set globally.
+%
+% \begin{macro}{\process_generation}
+% \begin{macro}{\process_generation_succ}
+% |\process_generation| is a counter which stores the number of the
+% current ``entry generation''. It starts at 0 and is increased by
+% two at each |\donedrivers|. |\process_generation_succ| is a macro
+% which expands to a number one larger than that in |\process_generation|.
+% \multchanges{\cs{process_generation}\cs{process_generation_succ}}
+% {1.914}{2000/05/30}{Control sequences added. (LH)}
+% \begin{macrocode}
+%<*map>
+\newcount\process_generation
+\process_generation=0
+\def\process_generation_succ{1}
+%</map>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\recordtransforms}
+% \begin{macro}{\endrecordtransforms}
+% \begin{macro}{\transform_record_file}
+% In main \package{fontinst}, the command
+% \begin{quote}
+% |\recordtransforms|\marg{filename}
+% \end{quote}
+% starts a block of code within which font transforms will be recorded
+% in the file \meta{filename}. |\endrecordtransforms| ends such a block.
+% \begin{macrocode}
+%<*pkg>
+\def\recordtransforms#1{\open_pout\transform_record_file{#1}}
+\def\endrecordtransforms{
+ \close_pout\transform_record_file{Font~transformation~records}
+}
+\chardef\transform_record_file=\closed_stream
+%</pkg>
+% \end{macrocode}
+% \end{macro} \end{macro} \end{macro}
+%
+%
+% \begin{macro}{\extract_font_generation}
+% The |\extract_font_generation| macro takes the name of a font and
+% returns the \meta{made} component from the |\Tf-|\meta{font} macro
+% for that font, or minus one if that macro hasn't been defined.
+% \changes{1.914}{2000/05/30}{Macro added. (LH)}
+% \begin{macrocode}
+%<*map>
+\def\extract_font_generation#1{
+ \if_defined{Tf-#1}\then
+ \expandafter\expandafter \expandafter\first_of_three
+ \csname Tf-#1\endcsname
+ \else
+ \m@ne
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\storemapdata}
+% There should not be two |\storemapdata| for the same font, hence
+% the check below. (Note that a `font' in this case is an MTX file.
+% It is quite possible (and legal) to generate the PL file for that
+% MTX file more than once.)
+% \changes{1.927}{2004/07/12}{Improved wording of warning message
+% and downgraded it to an info in the case when the two
+% definitions are the same. (LH)}
+% \begin{macrocode}
+\def\storemapdata#1#2#3{
+ \expandafter\def \expandafter\a_macro
+ \expandafter{ \expandafter{ \the\process_generation}{#2}{#3}}
+ \ifnum \extract_font_generation{#1}<\process_generation \else
+ \x_cs\ifx{Tf-#1}\a_macro
+ \fontinstinfo\mapfrags_subsystem
+ {Repeated~definition~of~font~#1}
+ \else
+ \fontinstwarning\mapfrags_subsystem
+ {Inconsistent~redefinition~of~font~#1}
+ \fi
+ \fi
+ \x_cs\let{Tf-#1}=\a_macro
+}
+%</map>
+% \end{macrocode}
+% In main \package{fontinst}, |\storemapdata| should be a noop so
+% that it can appear in metric files.
+% \begin{macrocode}
+%<pkg>\let\storemapdata=\gobble_three
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\record_transform}
+% \changes{1.911}{1999/11/18}{\cs{storemapdata} lines are optionally
+% written to the main output file as well. (LH)}
+% In main \package{fontinst}, the call
+% \begin{quote}
+% |\record_transform|\marg{TFM name}\marg{source}^^A
+% \marg{transforms}\marg{if}
+% \end{quote}
+% writes
+% \begin{quote}
+% |\storemapdata|\marg{TFM name}\marg{source}\marg{transforms}
+% \end{quote}
+% to the transformation recordings file (if font transforms are being
+% recorded) and to the main output file (if the \meta{if} evaluates
+% to true). Note that the caller of |\record_transform| must see to
+% that macros in \meta{source} and \meta{transforms} are written
+% correctly to the file (this is usually accomplished by adding
+% |\string| in suitable places of these arguments during their
+% construction).
+%
+% \begin{macrocode}
+%<*pkg>
+\def\record_transform#1#2#3#4{
+ \ifnum \transform_record_file=\closed_stream \else
+ \pout_line\transform_record_file{\string\storemapdata{#1}{#2}{#3}}
+ \fi
+ #4 \out_line{\string\storemapdata{#1}{#2}{#3}} \fi
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\transformfont}
+% \changes{1.913}{2000/03/11}{Third argument removed, since it isn't
+% used anymore. This change is harmless, since the worst thing
+% that can happen to this argument is that it is typeset. (LH)}
+% \begin{macro}{\reencodefont}
+% \begin{macro}{\reglyphfont}
+% These are initially |\relax|, so they can be |\edef|ed with safely.
+% \begin{macrocode}
+%<*map>
+\let\transformfont\x_relax
+\let\reencodefont\x_relax
+\let\reglyphfont\x_relax
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \changes{1.914}{2000/05/30}{The total transform applied for a font is
+% determined before the entry makers are called. (LH)}
+% \begin{macro}{\makemapentry}
+% |\makemapentry| sets |\TeX_font_name|, checks if any map data have
+% been stored for the font in question, and passes them on to
+% |\make_map_entry| if they have; otherwise it raises an error. There
+% is also a group which is begun and ended by |\makemapentry|, to stop
+% values deduced for one entry to interfere with the deduction of values
+% in the following.
+% \changes{1.911}{1999/11/20}{When map data are not known, try to
+% get them from the MTX file before declaring the source unknown.
+% (LH)}
+% \begin{macrocode}
+\def\makemapentry#1{\begingroup
+ \def\TeX_font_name{#1}
+ \ifnum \extract_font_generation{#1}<\process_generation
+ \if_file_exists{#1.mtx}\then
+ \inputmtx{#1}
+ \fi\fi
+ \ifnum \extract_font_generation{#1}<\process_generation
+ \from_unknown{#1}
+ \x_cs\xdef{Tf-#1}{
+ {\process_generation_succ}{\noexpand\from_unknown{#1}}{}
+ }
+ \else
+ \expandafter\expandafter \expandafter\make_map_entry
+ \csname Tf-#1\endcsname
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+%
+% \begin{macro}{\make_map_entry}
+% |\make_map_entry| oversees the interpretation of the
+% \meta{source} part of the map data, something which sets
+% |\source_font_TeX_name| and possibly |\PS_font_name|. It also
+% collects the transforms applied in |\font_transforms|,
+% concatenates them, and calls a list macro |\entry_makers_list| which
+% causes the actual entries to be written, and records in
+% |\Tf-|\meta{\TeX\ font name} that the entries have been written.
+% \begin{macrocode}
+\def\make_map_entry#1#2#3{
+ \ifnum #1=\process_generation
+ \def\font_transforms{#3}
+ #2
+ \_a_false
+ \let\transformfont\concat_transformfont
+ \let\reencodefont\concat_reencodefont
+ \let\reglyphfont\_a_true
+ \font_transforms
+ \if_a_
+ \fontinsterror\mapfrags_subsystem{
+ \string\makemapentry\space for~reglyphed~font
+ }{ No~entry~for~font~\TeX_font_name\space
+ can~be~written,\messagebreak
+ since~it~had~been~reglyphed!~\error_help_a
+ }
+ \else
+ \entry_makers_list
+ \fi
+ \expandafter\gdef \csname Tf-\TeX_font_name \expandafter\endcsname
+ \expandafter{\expandafter{\process_generation_succ}{#2}{#3}}
+ \fi
+}
+%</map>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\record_usage}
+% In main \package{fontinst}, the call
+% \begin{quote}
+% |\record_usage|\marg{TFM name}
+% \end{quote}
+% writes
+% \begin{quote}
+% |\makemapentry|\marg{TFM name}
+% \end{quote}
+% to the transformation recordings file, if font transforms are being
+% recorded. The |\record_usage| command is, roughly speaking, only used
+% by |\installfont| and |\installrawfont|.
+% \begin{macrocode}
+%<*pkg>
+\def\record_usage#1{
+ \ifnum \transform_record_file=\closed_stream \else
+ \pout_line\transform_record_file{\string\makemapentry{#1}}
+ \fi
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\fromafm}
+% |\fromafm| saves its two arguments in the suitable string macros.
+% \begin{macrocode}
+%<*map>
+\def\fromafm#1#2{
+ \def\source_font_TeX_name{#1}
+ \def\PS_font_name{#2}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frompl}
+% |\frompl| saves its argument in the suitable string macro.
+% \begin{macrocode}
+\def\frompl#1{
+ \def\source_font_TeX_name{#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frommtx}
+% This one is tricky, since it will have to work recursively,
+% fetching data that were stored for some other font. If it cannot
+% find those data in memory, then it tries to get them from the
+% metric file itself.
+% \changes{1.911}{1999/11/17}{When map data are not known, try to
+% get them from the MTX file before declaring the source unknown.
+% (LH)}
+% \begin{macrocode}
+\def\frommtx#1{%
+ \ifnum \extract_font_generation{#1}<\process_generation
+ \if_file_exists{#1.mtx}\then
+ \inputmtx{#1}
+ \fi\fi
+ \ifnum \extract_font_generation{#1}<\process_generation
+ \from_unknown{#1}
+ \x_cs\xdef{Tf-#1}{
+ {\the\process_generation}{\noexpand\from_unknown{#1}}{}
+ }
+ \else
+ \expandafter\expandafter \expandafter\from_mtx
+ \csname Tf-#1\endcsname
+ \fi
+}
+% \end{macrocode}
+% \begin{macro}{\from_mtx}
+% \begin{macrocode}
+\def\from_mtx#1#2#3{
+ \edef\font_transforms{#3\font_transforms}
+ #2
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\fromvpl}
+% The |\fromvpl| command checks if |\font_transforms| is empty. If it
+% is then everything is fine, but no entry should be written for this
+% font. If it isn't then someone has tried to make a transformation of
+% a virtual font, which doesn't work.
+% \begin{macrocode}
+\def\fromvpl{
+ \ifx \empty_command\font_transforms \else
+ \fontinsterror\mapfrags_subsystem{
+ Font~is~virtual,~it~cannot~be~transformed}{
+ No~entry~for~font~\TeX_font_name\space can~be~written.
+ \messagebreak\error_help_a
+ }
+ \fi
+ \let\maker_do\gobble_one
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AssumeMetafont}
+% The |\AssumeMetafont| general settings command makes |\frompl|
+% behave like |\fromvpl|.
+% \begin{macrocode}
+\def\AssumeMetafont{
+ \def\frompl{
+ \ifx \empty_command\font_transforms \else
+ \fontinsterror\mapfrags_subsystem{
+ A~Metafont~cannot~be~transformed}{
+ No~entry~for~font~\TeX_font_name\space can~be~written.
+ \messagebreak\error_help_a
+ }
+ \fi
+ \let\maker_do\gobble_one
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\from_unknown}
+% This special value for \meta{source} is used for fonts that are
+% referenced by some |\frommtx| but which have no |\storemapdata|
+% themselves.
+% \begin{macrocode}
+\def\from_unknown#1{
+ \fontinstwarningnoline\mapfrags_subsystem{
+ No~map~data~stored~for~font~#1.\messagebreak
+ No~entry~for~\TeX_font_name\space will~be~written,\messagebreak
+ due~to~insufficient~information}
+ \includewarning\warn_unknown_source
+ \let\maker_do\gobble_one
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\font_transforms}
+% This macro is used to collect all transformations that have been
+% applied to a font in, before they are concatenated.
+% \begin{macrocode}
+\let\font_transforms\empty_command
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\xscale_factor}
+% \begin{macro}{\slant_factor}
+% \begin{macro}{\reencode_etx}
+% |\xscale_factor| and |\slant_factor| are dimens which the entry
+% makers can inspect to check the amount of horizontal scaling and
+% slanting should be applied to the current font. 1\,pt equals the
+% factor~1.
+% \begin{quote}
+% |\expandafter\lose_measure\the\xscale_factor|
+% \end{quote}
+% will produce the corresponding factor.
+%
+% |\reencode_etx| is a macro which contains the name of the (last)
+% ETX file used to reencode the font; it is empty if the font hasn't
+% been reencoded.
+% \multchanges{\cs{xscale_factor}\cs{slant_factor}\cs{reencode_etx}}
+% {1.914}{2000/05/30}{Control sequences added. (LH)}
+% \begin{macrocode}
+\newdimen\xscale_factor \newdimen\slant_factor
+\xscale_factor=\p@ \slant_factor=\z@
+\let\reencode_etx\empty_command
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \multchanges{\cs{concat_transformfont}\cs{concat_reencodefont}}
+% {1.914}{2000/05/30}{Macros added. (LH)}
+% \begin{macro}{\concat_transformfont}
+% The |\concat_transformfont| macro is a definition of |\transformfont|
+% which concatenates the transformation expressed by the arguments
+% with the one in |\xscale_factor| and |\slant_factor|.
+% Mathematically, it performs the multiplication
+% $$
+% \left( \begin{array}{cc} f(\#1)& f(\#2)\\ 0& 1 \end{array} \right)
+% \left( \begin{array}{cc}
+% \mbox{\cs{xscale_factor}}& \mbox{\cs{slant_factor}} \\
+% 0& 1
+% \end{array} \right)
+% $$
+% where $f$ stands for |\make_factor|.
+% \begin{macrocode}
+\def\concat_transformfont#1#2{
+ \edef\a_macro{\make_factor{#1}}
+ \xscale_factor=\a_macro\xscale_factor
+ \slant_factor=\a_macro\slant_factor
+ \advance \slant_factor \make_factor{#2}\p@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\concat_reencodefont}
+% The |\concat_reencodefont| macro is a definition of |\reencodefont|
+% which concatenates the reencoding expressed by the argument with
+% the one in |\reencode_etx|. Since reencoding ignores the previous
+% encoding, concatenating is the same thing as remembering the last
+% reencoding.
+% \begin{macrocode}
+\def\concat_reencodefont#1{\def\reencode_etx{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{User interface}
+%
+% The basic usage of the automatic map file fragment generator consists
+% of specifying for which driver(s) entries should be generated,
+% |\input|ing a file of recorded transformations generated by main
+% \package{fontinst}, and signaling that there isn't anything more to
+% write. This can be done with the commands
+% \begin{quote}
+% |\adddriver|\marg{driver name}\marg{fragment file name}\\
+% \meta{possible additional \cs{adddriver} commands}\\
+% |\input |\meta{recorded transforms file}\\
+% |\donedrivers|\\
+% |\bye|
+% \end{quote}
+% It should however be noted that this is the \emph{basic} usage. The
+% map fragments that work for one \TeX\ system need not work for
+% another (even if the driver is the same), and therefore it is
+% necessary to make the whole process of writing map file fragments
+% configurable. A few examples of things you may have to inform the map
+% fragment writer about are (and these are for \package{dvips} alone;
+% that's the driver I know best):
+% \begin{itemize}
+% \item
+% Is the font resident on the printer or must it be downloaded?
+% \item
+% If the font must be downloaded, what is the name of the file it
+% is in? Here one must take into account not only the possibility
+% that the font file might have to be shared with some other
+% software (such as a GUI) and thus cannot be named according to
+% the Berry scheme---even if it is named according to the Berry
+% scheme one still has the question of its extension: \texttt{.pfa},
+% \texttt{.pfb}, or something else? For instances of Multiple Master
+% fonts, you (at least sometimes) have to download more than one file.
+% \item
+% Again if the font must be downloaded, can/should it be partially
+% downloaded?
+% \item
+% In case the font has been reencoded, what is the name of the file
+% which defines this encoding, and by what name does that file make
+% the encoding known to the postscript interpreter?
+% \end{itemize}
+% The mechanisms available for such configuration are described in
+% Subsection~\ref{Sssec:Config-interface}.
+% Note that map files for DVI viewers are on average more likely to need
+% various platform-specific information about the fonts than map files
+% for DVI printer drivers are, and hence once can expect that
+% generation of these will need more extensive configuration than that
+% for the printer drivers.
+%
+%
+% \subsubsection{Interface for basic usage}
+%
+% An \emph{entry maker} is a group of macros which write the entry for
+% the font currently under consideration to a map fragments file each
+% time they are called. The macro to call must have a name of the form
+% \describecsfamily{make_\meta{driver}}|\make_|\meta{driver} for
+% |\adddriver| to recognise it. Each entry maker has a separate output
+% file (opened using |\open_pout|) and the identifier connected to that
+% file is called \describecsfamily{output_\meta{driver}}\relax
+% |\output_|\meta{driver}.
+%
+% A list of all entry makers currently active is maintined in the macro
+% |\entry_makers_list|. Each item in this list has the form
+% \begin{quote}
+% |\maker_do|\,|\make_|\meta{driver}
+% \end{quote}
+% |\maker_do| is usually |\relax|, but it does occationally get set to
+% other values.
+% \par\bigskip
+%
+%
+% \begin{macro}{\adddriver}
+% The |\adddriver| command adds the named driver to the list of
+% drivers to write entries for and opens an output file where the
+% entries for that particular driver will go. Repeated calls to
+% |\adddriver| for the same driver have no effect.
+% \begin{macrocode}
+\def\adddriver#1#2{
+ \x_cs\ifx{make_#1}\x_relax
+ \fontinsterror\mapfrags_subsystem
+ {There~is~no~entry~maker~for~#1}\error_help_a
+ \else
+ \x_cs\ifx{output_#1}\x_relax \_a_true \else
+ \x_cs\ifx{output_#1}\closed_stream \_a_true \else
+ \_a_false
+ \fi\fi
+ \if_a_
+ \x_cs\open_pout{output_#1}{#2}
+ \expandafter\add_to \expandafter\entry_makers_list
+ \expandafter{ \expandafter\maker_do
+ \csname make_#1\endcsname}
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\entry_makers_list}
+% \begin{macro}{\maker_do}
+% \begin{macrocode}
+\let\entry_makers_list\empty_command
+\let\maker_do\x_relax
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\donedrivers}
+% The main function performed by the |\donedrivers| command is to
+% close all the open output files. It might also print some warning
+% messages.
+% \begin{macrocode}
+\def\donedrivers{
+ \def\maker_do##1{
+ \x_cs\close_pout{output\expandafter\gobble_five\string##1}
+ {Map~file~fragments}
+ }
+ \entry_makers_list
+ \let\maker_do\x_relax
+ \let\entry_makers_list\empty_command
+ \errorstopmode
+ \reportwarnings
+ \advance \process_generation \thr@@
+ \edef\process_generation_succ{\the\process_generation}
+ \advance \process_generation \m@ne
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gobble_five}
+% \begin{macrocode}
+\def\gobble_five#1#2#3#4#5{}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% It is appropriate that the map file writer writes a summary of the
+% kinds of risky things which happened when it is done writing data to
+% files. To simplify implementing such things, there is a command
+% \DescribeMacro{\includewarning}|\includewarning| that takes care of
+% the bookkeeping involved. After the call
+% \begin{quote}
+% |\includewarning|\meta{command}
+% \end{quote}
+% the \meta{command} will be executed exactly once the next time
+% |\reportwarnings| is executed. The \meta{command} usually expands to
+% something like
+% \begin{quote}
+% \small|\fontinstwarningnoline\mapfrags_subsystem{|\\
+% | Check~the~output~file(s)--some~data~was~considered~uncertain}|
+% \end{quote}
+%
+% \begin{macro}{\warnings_list}
+% The |\warnings_list| macro contains a list of all warnings that
+% should be made. It expands to a sequence of
+% \begin{quote}
+% |\warning_do|\meta{command}
+% \end{quote}
+% |\warnings_list| is always assigned globally.
+% \begin{macrocode}
+\g_let\warnings_list=\empty_command
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\includewarning}
+% \begin{macro}{\warning_do}
+% The |\includewarning| command adds an entry for its argument to the
+% |\warnings_list| list, provided there wasn't already such an entry.
+% |\includewarning| is based on the macro |\warning_do|, which does
+% most of the bookkeeping for making sure the list contains at most
+% one entry of each kind. |\warning_do| normally expects to be
+% expanded in the context
+% \begin{quote}
+% |\warning_do|\meta{new command}\meta{old command}\meta{next}
+% \end{quote}
+% The \meta{new command} is the command that is being added to the
+% list, and the \meta{old command} is a command that is already in the
+% list. \meta{next} is the first token in the next item in the
+% list---in most cases another |\warning_do|. If \meta{new command}
+% and \meta{old command} are not equal, this should expand to
+% \begin{quote}
+% |\noexpand\warning_do|\,|\noexpand|\meta{old command}\,^^A
+% \meta{next}\,\meta{new command}
+% \end{quote}
+% If on the other hand they are equal, this should expand to
+% \begin{quote}
+% |\noexpand\warning_do|\,|\noexpand|\meta{old command}\,^^A
+% \meta{next}\,|\x_relax|
+% \end{quote}
+% The reason for this is that the last \meta{next} will not be a
+% |\warning_do|, but an |\ifx| which tests whether a new item should
+% be added to the list.
+% \begin{macrocode}
+\def\warning_do#1#2#3{
+ \noexpand\warning_do \noexpand#2
+ \ifx #1#2
+ \expandafter#3 \expandafter\x_relax
+ \else
+ \expandafter#3 \expandafter#1
+ \fi
+}
+\def\includewarning#1{
+ \xdef\warnings_list{
+ \expandafter\swap_two \expandafter#1 \warnings_list
+ \if_equal\x_relax\then \else
+ \noexpand\warning_do \noexpand#1
+ \fi
+ }
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\reportwarnings}
+% The |\reportwarnings| command reports all the warnings and empties
+% the |\warnings_list|.
+% \begin{macrocode}
+\def\reportwarnings{
+ \begingroup
+ \let\warning_do=\x_relax
+ \warnings_list
+ \endgroup
+ \g_let\warnings_list=\empty_command
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\warn_unknown_source}
+% \begin{macro}{\warn_undecided_data}
+% \begin{macro}{\warn_uncertain_data}
+% These macros are used to output warnings at the |\reportwarnings| at
+% the end of |\donedrivers|.
+% \begin{macrocode}
+\def\warn_unknown_source{
+ \fontinstwarningnoline\mapfrags_subsystem{
+ Some~font~is~missing~from~the~output~file(s),\messagebreak
+ since~its~source~is~unknown}
+}
+\def\warn_undecided_data{
+ \fontinstwarningnoline\mapfrags_subsystem{
+ Check~the~output~file(s)--some~data~could~not~be~determined}
+}
+\def\warn_uncertain_data{
+ \fontinstwarningnoline\mapfrags_subsystem{
+ Check~the~output~file(s)--some~data~was~considered~uncertain}
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \subsubsection{Configuration interface}
+% \label{Sssec:Config-interface}
+%
+% To correctly format reencodings, the map file writer must know what
+% the ETX encodings correspond to. In the case of drivers which
+% generate postscript output, this information is stored in the
+% \describecsfamily{pse-\meta{etx}}|\pse-|\meta{etx} family of macros.
+% \meta{etx} is the name (suffix excluded) of the ETX file that the
+% information pertains to. The expansion of these macros are of the form
+% \begin{quote}
+% \marg{postscript name}\marg{action}
+% \end{quote}
+% \meta{postscript name} is the name by which the encoding is known to
+% the postscript interpreter, and \meta{action} lists any additional
+% action that must be taken before the encoding can be used. So far the
+% only action known is \DescribeMacro{\download}|\download|\marg{file},
+% which will cause code for downloading the file by the name \meta{file}
+% (suffix included) to be inserted in the output.
+%
+% \begin{macro}{\declarepsencoding}
+% Data is entered in a |\pse-|\meta{etx} macro using the
+% |\declare|\-|ps|\-|encoding| command. Its syntax is
+% \begin{quote}
+% |\declarepsencoding|\marg{etx}\marg{postscript name}\marg{action}
+% \end{quote}
+% \begin{macrocode}
+\def\declarepsencoding#1#2#3{\x_cs\gdef{pse-#1}{{#2}{#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\download}
+% By default |\download| gobbles its argument. It should be redefined
+% when that is not the desired effect.
+% \begin{macrocode}
+\let\download=\gobble_one
+% \end{macrocode}
+% \end{macro}
+%
+% Some encodings seem to always be present, so they can be declared here.
+% \begin{macrocode}
+\declarepsencoding{8r}{TeXBase1Encoding}{\download{8r.enc}}
+\declarepsencoding{8a}{StandardEncoding}{}
+% \end{macrocode}
+% \package{fontinst} must be told about other postscript encodings (if you
+% have them installed). The \texttt{finstmsc.rc} file is the right place
+% for these declarations.\relax
+% \SortIndex{finstmsc.rc file}{\texttt{finstmsc.rc} file}
+%
+% Next we have the cofiguration for fonts, which works in a similar
+% fashion. The main problem here seems to be to determine which files (if
+% any) should be downloaded to the printer, and this can be specified
+% using |\download| commands as for the encodings. The family
+% \describecsfamily{psf-\meta{PS font name}}|\psf-|\meta{PS font name}
+% of macros expand to a sequence of \meta{actions} as for the encodings.
+% If there is such a macro for a font then the instructions found there
+% should be followed.
+%
+% It is recommended that the contents of a |\psf-|\meta{PS font name}
+% macro is executed before the map file entry is written, and that
+% commands like |\download| are temporarily redefined to build the text
+% for the entry, rather than having the |\write| in |\pout_line| expand
+% the contents of |\psf-|\meta{PS font name}.
+%
+% \begin{macro}{\specifypsfont}
+% The |\specifypsfont| command is used as
+% \begin{quote}
+% |\specifypsfont|\marg{PS font name}\marg{actions}
+% \end{quote}
+% It can be used to specify the actions that should be done to make a
+% Postscript font known to the printer, when the automatic guessing
+% would not be right.
+% \begin{macrocode}
+\def\specifypsfont#1#2{\x_cs\def{psf-#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% Examples of cases where |\specifypsfont| would be needed are:
+% \begin{itemize}
+% \item Fonts which are resident on the printer. In this case the
+% \meta{actions} argument should be empty, e.g.
+% \begin{quote}
+% |\specifypsfont{Times-Roman}{}|
+% \end{quote}
+% \item Instances of multiple master fonts. In this case one must
+% download both the multiple master font and the stub file that
+% defines the instance.
+%
+% Subsection~10.6.1 in The \LaTeX\ graphics companion~\cite
+% {LaTeX-graph-comp} contains an example with an instance of the
+% \texttt{MinionMM} multiple master font. Both the \TeX\ and
+% (what is of interest here) the PS name for this instance is
+% \texttt{zmnl8ac6}, the base multiple master font is stored in the
+% file \texttt{MinionMM.pfb}, and the stub file is called
+% \texttt{zmnl8ac6.pro}. The |\specifypsfont| command for this is
+% \begin{quote}
+% |\specifypsfont{zmnl8ac6}{%|\\
+% | \download{MinionMM.pfb}\download{zmnl8ac6.pro}%|\\
+% |}|
+% \end{quote}
+% \item Fonts which do not fit any of the general naming schemes.
+% \end{itemize}
+%
+%
+% \begin{macro}{\AssumeLWFN}
+% This command makes \mbox{MacOS} \texttt{LWFN} style abbreviated
+% Postscript font names the default for fonts that have no
+% |\psf-| entry.
+% \begin{macrocode}
+\def\AssumeLWFN{\let\get_PS_font_file\LWFN_get_PS_font_file}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Deducing values for the map file entries}
+%
+%
+% \subsubsection{Basic principles}
+%
+% The automatic generation of map file fragments mainly consists of
+% determining various text strings and writing these to a file as the
+% format of the map file being written requires. The complicated part is
+% usually to determine what these text strings should be, since the only
+% restriction imposed by the output format often is that the strings
+% should be written in the right order and with separating whitespace.
+%
+% It is furthermore the case that some of these text strings seem to be
+% hard to deduce from the information primarily given in the command to
+% write the entry, but somewhat easier to deduce from some other deduced
+% text string.
+%
+% Therefore the following model seems appropriate. For each text string
+% that may need to be deduced, there is one macro which is used to store
+% the string (if it has been deduced) and one macro which can be called
+% to set the former macro to an appropriate value. Thus there is one
+% macro |\PS_font_name| which stores the postscript name for the font
+% currently in question and one macro
+% \describecsfamily{get_\meta{string name}}|\get_PS_font_name| which
+% determines the proper value for |\PS_font_name|. There is also a macro
+% \DescribeMacro{\unknown_str}|\unknown_str| to which all the
+% string storing macros should initially be |\let|, so that it can be
+% easily tested whether a string storing macro has been given its proper
+% value or not.
+%
+% Typically, if |\PS_font_name| is used somewhere, one would first have
+% a piece of code that says
+% \begin{quote}
+% \small
+% |\ifx\PS_font_name\unknown_str|\\
+% | \get_PS_font_name|\\
+% |\fi|
+% \end{quote}
+% to ensure that it is known when it is used.
+%
+% \begin{macro}{\unknown_str}
+% A suitable value for this macro seems to be |?????|.
+% \begin{macrocode}
+\def\unknown_str{?????}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clueless_str}
+% To further support this model, there is also a macro |\clueless_str|
+% which a string storing macro should be |\let| equal to if its proper
+% value could not be determined. This distinction is useful for the
+% |\get_|\textellipsis\ macros, since if |\get_|$A$ can determine the
+% correct value of $A$ from $B$, but also from $C$, then it helps if
+% |\get_|$A$ can easily check whether it has previously turned out to
+% be impossible to determine the value of $B$, because then it can
+% simply deduce $A$ from $C$ instead.
+%
+% \begin{macrocode}
+\edef\clueless_str{\unknown_str ?}
+% \end{macrocode}
+% \end{macro}
+%
+% An example of how |\clueless_str| should be used is the following
+% skeleton of a |\get_|$A$ macro:
+% \begin{quote}\small
+% |\def\get_|$A$|{|\\
+% | \ifx\unknown_str\|$B$| \get_|$B$| \fi|\\
+% | \ifx\clueless_str\|$B$\\
+% | \ifx\unknown_str\|$C$| \get_|$C$| \fi|\\
+% | \ifx\clueless_str\|$C$\\
+% | \let\|$A$|\clueless_str|\\
+% | \else|\\
+% | |\meta{Deduce $A$ from $C$}\\
+% | \fi|\\
+% | \else|\\
+% | |\meta{Deduce $A$ from $B$}\\
+% | \fi|\\
+% |}|
+% \end{quote}
+%
+%
+% \subsubsection{Implementation}
+%
+% \begin{macro}{\TeX_font_name}
+% This is the name (as appearing in a DVI or VF file) of the font for
+% which an entry should be made. It is set by |\makemapentry|, so no
+% |\get_|\textellipsis\ macro is needed.
+% \begin{macrocode}
+\let\TeX_font_name\unknown_str
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\source_font_TeX_name}
+% This is the name (as AFM or PL) of the font whose metrics were
+% used by \package{fontinst}. It is set by |\fromafm| or |\frompl|,
+% so no |\get_|\textellipsis\ macro is needed.
+% \begin{macrocode}
+\let\source_font_TeX_name\unknown_str
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PS_font_name}
+% This is the name (as FontName entry in an AFM or correspondingly) of
+% the font in question.
+% \begin{macrocode}
+\let\PS_font_name\unknown_str
+% \end{macrocode}
+% \begin{macro}{\get_PS_font_name}
+% I expect this to become one of the central macros in the map file
+% generation (at least when entries are generated for postscript
+% fonts), but for the moment it does the closest thing to nothing a
+% |\get_|\textellipsis\ macro is allowed to do; it admits it hasn't
+% got a clue about what the proper value is.
+% \begin{macrocode}
+\def\get_PS_font_name{\let\PS_font_name\clueless_str}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\AssumeAMSBSYY}
+% \begin{macro}{\AssumeBaKoMa}
+% These commands redefine |\get_PS_font_name| so that it returns the
+% PS name this font would have if it was part of the AMS\slash
+% Blue~Sky\slash Y\&Y and BaKoMa respectively distribution of the
+% Computer Modern fonts---the \TeX\ font name in all upper case and
+% all lower case respectively.
+% \begin{macrocode}
+\def\AssumeAMSBSYY{\def\get_PS_font_name{
+ \uppercase \expandafter{ \expandafter\def
+ \expandafter\PS_font_name \expandafter{ \source_font_TeX_name}
+ }
+}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\AssumeBaKoMa{\def\get_PS_font_name{
+ \lowercase \expandafter{ \expandafter\def
+ \expandafter\PS_font_name \expandafter{ \source_font_TeX_name}
+ }
+}}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\PS_font_file}
+% This is the name of the file (suffix included) in which the PS font
+% is expected to be found.
+% \begin{macrocode}
+\let\PS_font_file\unknown_str
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\get_PS_font_file}
+% \begin{macro}{\normal_get_PS_font_file}
+% \begin{fistring}{PSfontsuffix}
+% The macro |\normal_get_PS_font_file| is (hardly surprisingly) the
+% normal |\get_PS_font_file|. It simply uses |\source_font_TeX_name|
+% plus the suffix specified by the |PSfontsuffix| string.
+% \begin{macrocode}
+\resetstr{PSfontsuffix}{.pfa}
+\def\normal_get_PS_font_file{
+ \edef\PS_font_file{\source_font_TeX_name\str{PSfontsuffix}}
+}
+\let\get_PS_font_file=\normal_get_PS_font_file
+% \end{macrocode}
+% \end{fistring}\end{macro}\end{macro}
+%
+% \begin{macro}{\LWFN_get_PS_font_file}
+% \begin{macro}{\abbreviate_PS_font_name}
+% In MacOS, Postscript fonts file names are usually abbreviated forms of
+% the Postscript font names, formed using the so called
+% \(5+3+3+\cdots\) rule---keep the first five letters of the first
+% subword, keep the first three letters of all following subwords. The
+% |\LWFN_get_PS_font_file| macro uses this scheme if the Postscript
+% name for the font is known, otherwise it calls the
+% |\normal_get_PS_font_file|. The LWFN in the macro name is the type
+% code for such files.
+%
+% The algorithm is based on using |\aftergroup| to construct the
+% wanted |\def| statement, only |\aftergroup|ing the letters that are
+% not to be removed in the abbreviation. |\a_count| is used as a
+% counter of how many more letters in the current subword should be
+% kept.
+% \begin{macrocode}
+\def\LWFN_get_PS_font_file{
+ \ifx \PS_font_name\unknown_str \get_PS_font_name \fi
+ \ifx \PS_font_name\clueless_str
+ \normal_get_PS_font_file
+ \includewarning\warn_uncertain_data
+ \else
+ \begingroup
+ \aftergroup\def \aftergroup\PS_font_file
+ \aftergroup{
+ \a_count=4~
+ \expandafter\expandafter \expandafter\aftergroup
+ \expandafter\swap_two \expandafter\abbreviate_PS_font_name
+ \PS_font_name \x_relax
+ \aftergroup}
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\abbreviate_PS_font_name#1{
+ \ifx \x_relax#1 \else
+ \ifnum \uccode`#1=`#1
+ \a_count=2
+ \aftergroup#1
+ \else\ifx -#1
+ \a_count=\z@
+ \else\ifnum \a_count>\z@
+ \advance \a_count \m@ne
+ \aftergroup#1
+ \fi\fi\fi
+ \expandafter\abbreviate_PS_font_name
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+%
+% \subsection{Driver makers}
+%
+% This subsection contains the definitions of macros that makes up the
+% driver makers.
+%
+%
+% \subsubsection{The \texttt{debug} driver}
+%
+% The \texttt{debug} driver maker doesn't really generate entries for
+% any DVI driver map file, it just prints the data that was available.
+% It is mainly intended for debugging purposes, but it might also serve
+% as a basic model for other driver makers.
+%
+% \begin{macro}{\make_debug}
+% \begin{macrocode}
+\def\make_debug{
+ \pout_line\output_debug{Driver~data~for~font~\TeX_font_name:}
+ \pout_lline\output_debug{Source~font~TeX~name:~\source_font_TeX_name}
+ \ifx \reencode_etx\empty_command \else
+ \pout_lline\output_debug{Font~reencoded~using~\reencode_etx.etx.}
+ \fi
+ \ifdim \xscale_factor=\p@ \else
+ \pout_lline\output_debug{Font~x-scaled~by~
+ \expandafter\lose_measure\the\xscale_factor.
+ }
+ \fi
+ \ifdim \slant_factor=\z@ \else
+ \pout_lline\output_debug{Font~slanted~by~
+ \expandafter\lose_measure\the\slant_factor.
+ }
+ \fi
+ \debug_values_hook
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\debug_value}
+% The |\debug_value| macro can be used to print the name and contents
+% of an arbitrary value macro in the |debug| driver. It is called with
+% the value macro as argument, e.g.
+% \begin{quote}
+% |\debug_value\PS_font_name|
+% \end{quote}
+%
+% \begin{macrocode}
+\def\debug_value#1{
+ \ifx #1\unknown_str
+ \csname get_ \expandafter\gobble_one \string#1 \endcsname
+ \fi
+ \pout_lline\output_debug{\string#1:~#1}
+ \ifx #1\clueless_str \includewarning\warn_undecided_data \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\debugvalue}
+% \begin{macro}{\debug_values_hook}
+% The |\debugvalue| command is a user level interface for adding
+% value macros to the list of those that are displayed by the
+% \texttt{debug} driver. The argument is the name of the value in
+% question, e.g.
+% \begin{quote}
+% |\debugvalue{PS_font_name}|
+% \end{quote}
+% Note that the name given to |\debugvalue| is not the control
+% sequence in which the name is stored.
+% \begin{macrocode}
+\def\debugvalue#1{
+ \expandafter\add_to \expandafter\debug_values_hook
+ \expandafter{ \expandafter\debug_value \csname#1\endcsname}
+}
+% \end{macrocode}
+% \begin{macrocode}
+\let\debug_values_hook\empty_command
+\debugvalue{PS_font_name}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \subsubsection{The \texttt{dvips} driver}
+%
+% \changes{1.912}{2000/02/19}{\texttt{dvips} mapfile fragments writer
+% added. (LH)}
+% Before constructing an entry for a \package{dvips} mapfile, it should
+% be sorted out how such an entry should look. The \package{dvips}
+% manual says
+% \begin{quotation}
+% The parsing of the \texttt{psfonts.map} file should be explained to
+% eliminate all confusion. If a line is empty or begins with a space,
+% asterisk, semicolon, or hash mark, it is ignored. Each remaining
+% line is separated into words, where words are separated by spaces or
+% tabs. If a word begins with a double quote, it extends until the
+% next double quote or the end of the line. If a word starts with a
+% less than character, it is treated as a font header file (or a
+% downloaded PostScript font). There can be more than one such header
+% for a given font. If a word starts with a double quote, it is a
+% special instruction for generating that font. Otherwise it is a
+% name. The first such name is always the name \TeX\ uses for the
+% font and is also the name of the raw \texttt{tfm} file. If there is
+% another name word, that name is used as the PostScript name; if
+% there is only one name word, it is used for both the \TeX\ name and
+% the PostScript name.
+% \end{quotation}
+%
+% A \package{fontinst}-generated map file entry for the \texttt{dvips}
+% driver has the following structure:
+% \begin{isyntax}
+% \meta{\TeX{} font name} \meta{PS font name} \meta{downloads}
+% \meta{font transformations}
+% \end{isyntax}
+% \meta{\TeX{} font name} is simply the value of |\TeX_font_name| and
+% \meta{PS font name} is simply the value of |\PS_font_name|.
+% \meta{downloads} is a possibly empty sequence in which each item
+% has the form
+% \begin{quote}
+% \meta{prefix}\meta{filename}
+% \end{quote}
+% The \meta{prefix} values I've came across are empty,\footnote{I think
+% this is only used for files that \package{dvips} should ignore, but
+% which certain other programs that read the same \texttt{psfonts.map}
+% need.} |<|, |<<|, and |<[|. Currently |<| is always used.
+% \meta{filename} is a filename with suffix. \meta{font transformations}
+% is either empty or has the form
+% \begin{quote}
+% |"| \meta{Postscript code} |"|
+% \end{quote}
+%
+% Should support for the |<<| or |<[| prefixes be needed, then this
+% should be done by adding some new variant of the |\download|
+% command---|\fullldownload|, maybe---rather than adding the extra
+% character to the \meta{filename}. To simplify matters for other drivers,
+% such new variants should by default expand to |\download|, rather than
+% |\gobble_one|.
+%
+%
+% \begin{macro}{\downloads_list}
+% \begin{macro}{\append_download}
+% The |\downloads_list| is a token list register which is especially
+% used for accumulating |\download| commands. Each driver maker which
+% uses it should begin by emptying it.
+% \begin{quote}
+% |\append_download|\marg{arg}
+% \end{quote}
+% appends
+% \begin{quote}
+% |\download|\marg{arg}
+% \end{quote}
+% to |\downloads_list|.
+% \begin{macrocode}
+\newtoks\downloads_list
+\def\append_download#1{
+ \downloads_list=\expandafter{ \the\downloads_list \download{#1} }
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\make_dvips}
+% This macro gathers the information for a \texttt{dvips} driver entry
+% and writes it to the corresponding output file. As a \texttt{dvips}
+% mapfile entry is on one line, the entire entry is written at once.
+% The \meta{font transformations} is collected as explicit text in the
+% macro |\postscript_code|. The \meta{downloads} is collected as a
+% sequence of |\download| commands in the |\downloads_list| token
+% register.
+% \begin{macrocode}
+\def\make_dvips{
+ \downloads_list={}
+ \let\postscript_code\empty_command
+ \let\download\append_download
+ \ifx \reencode_etx\empty_command \else
+ \if_undefined{pse-\reencode_etx}\then
+ \etxtoenc{\reencode_etx}{\reencode_etx}
+ \fi
+ \expandafter\expandafter \expandafter\second_of_two
+ \csname pse-\reencode_etx\endcsname
+ \edef\postscript_code{\postscript_code\space
+ \expandafter\expandafter \expandafter\first_of_two
+ \csname pse-\reencode_etx\endcsname
+ \space ReEncodeFont
+ }
+ \fi
+ \ifdim \xscale_factor=\p@ \else
+ \edef\postscript_code{\postscript_code
+ \space\expandafter\lose_measure\the\xscale_factor
+ \space ExtendFont
+ }
+ \fi
+ \ifdim \slant_factor=\z@ \else
+ \edef\postscript_code{\postscript_code
+ \space\expandafter\lose_measure\the\slant_factor
+ \space SlantFont
+ }
+ \fi
+% \end{macrocode}
+% After constructing the \meta{Postscript code} and having appended
+% the necessary download (if any) for that code, the next problem is
+% to determine the actual \meta{PS font name} and append the downloads
+% needed to actually define the font to the Postscript interpreter. If
+% there is no special entry for this font in the |\psf-|\meta{PS font
+% name} table, or if its \meta{PS font name} is unknown, then it is
+% assumed that exactly one file should be downloaded. As the name of
+% that file is taken the value of |\PS_font_file|.
+% \begin{macrocode}
+ \ifx \PS_font_name\unknown_str \get_PS_font_name \fi
+ \ifx \PS_font_name\clueless_str
+ \includewarning\warn_undecided_data
+ \_a_true
+ \else
+ \if_undefined{psf-\PS_font_name}\then
+ \_a_true
+ \else
+ \csname psf-\PS_font_name \endcsname
+ \_a_false
+ \fi\fi
+ \if_a_
+ \ifx \PS_font_file\unknown_str \get_PS_font_file \fi
+ \append_download{\PS_font_file}
+ \ifx \PS_font_file\clueless_str
+ \includewarning\warn_undecided_data
+ \fi
+ \fi
+% \end{macrocode}
+% Finally, the entire entry is written to the file. The point with
+% expanding past an empty command is that \TeX\ in a |\write| normally
+% jumps past the expansion of a |\the|\meta{token list register}
+% without expanding it further, but this effect can be prevented by
+% expanding the |\the| with an |\expandafter|.
+% \begin{macrocode}
+ \def\download##1{~<##1}
+ \pout_line\output_dvips{
+ \TeX_font_name\space\PS_font_name
+ \expandafter\empty_command \the\downloads_list
+ \ifx \postscript_code\empty_command \else
+ \space"\postscript_code\space"
+ \fi
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsubsection{The \texttt{dvipdfm} driver}
+%
+% \changes{1.912}{2000/02/22}{\texttt{dvipdfm} mapfile fragments writer
+% added. (LH)}
+%
+% A mapfile entry for the \texttt{dvipdfm} driver has the following
+% structure:
+% \begin{isyntax}
+% \meta{\TeX{} font name} \meta{encoding} \meta{PS font}
+% \meta{options}
+% \end{isyntax}
+% \meta{\TeX{} font name} is simply the value of |\TeX_font_name|.
+% \meta{encoding} is the name of the encoding file which should be used
+% to reencode the font, or \texttt{default} if there is none. \meta{PS
+% font} is the value of |\PS_font_name| for the standard 35 fonts
+% (i.e., fonts which will not be included in the PDF generated), but for
+% other fonts it is the name of the file which contains the
+% font.\footnote{The documentation seems to say that \texttt{dvipdfm}
+% can only understand fonts in PFB format; I have chosen to ignore this
+% potential problem.} \meta{options}, finally, is a possibly empty
+% sequence of space-separated options. Each option is one of the
+% following
+% \begin{quote}
+% |-e |\meta{number}\\
+% |-s |\meta{number}\\
+% |-r|
+% \end{quote}
+% The |-e| and |-s| options extend and slant by the given amounts. The
+% |-r| option is a workaround for some Acrobat bugs; it is currently not
+% generated by \package{fontinst}.
+%
+% \begin{macro}{\make_dvipdfm}
+% This macro gathers the information for a \texttt{dvipdfm} driver entry
+% and writes it to the corresponding output file. As a \texttt{dvipdfm}
+% mapfile entry is on one line, the entire entry is written at once.
+% The \meta{options} text is collected as explicit text in the
+% macro |\options_text|. The \meta{downloads} is collected as a
+% sequence of |\download| commands in the |\downloads_list| token
+% register.
+% \begin{macrocode}
+\def\make_dvipdfm{
+ \def\font_encoding{default}
+ \ifx \reencode_etx\empty_command \else
+ \if_undefined{pse-\reencode_etx}\then
+ \etxtoenc{\reencode_etx}{\reencode_etx}
+ \fi
+ \def\download##1{\def\font_encoding{##1}}
+ \expandafter\expandafter \expandafter\second_of_two
+ \csname pse-\reencode_etx\endcsname
+ \fi
+ \let\options_text\empty_command
+ \ifdim \xscale_factor=\p@ \else
+ \edef\options_text{\options_text\space
+ -e~\expandafter\lose_measure\the\xscale_factor
+ }
+ \fi
+ \ifdim \slant_factor=\z@ \else
+ \edef\options_text{\options_text\space
+ -s~\expandafter\lose_measure\the\slant_factor
+ }
+ \fi
+% \end{macrocode}
+% After constructing the \meta{options} and having determined
+% \meta{encoding}, the next problem is to determine the actual
+% \meta{PS font}, which will be put in |\a_macro|. If there is no
+% special entry for this font in the |\psf-|\meta{PS font name} table,
+% or if its \meta{PS font name} is unknown, then it is assumed that
+% exactly one file should be downloaded. As the name of that file is
+% taken the value of |\PS_font_file|.
+% \begin{macrocode}
+ \ifx \PS_font_name\unknown_str \get_PS_font_name \fi
+ \if_or \if_equal\PS_font_name\clueless_str \or_else
+ \if_undefined{psf-\PS_font_name}
+ \then
+ \ifx \PS_font_file\unknown_str \get_PS_font_file \fi
+ \ifx \PS_font_file\clueless_str
+ \includewarning\warn_undecided_data
+ \fi
+ \let\a_macro=\PS_font_file
+ \else
+ \let\a_macro=\PS_font_name
+ \def\download##1{\def\a_macro{##1}}
+ \csname psf-\PS_font_name \endcsname
+ \fi
+% \end{macrocode}
+% Finally, the entire entry is written to the file.
+% \begin{macrocode}
+ \pout_line\output_dvipdfm{
+ \TeX_font_name\space\font_encoding\space\a_macro
+ \options_text
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{The \texttt{pltotf} ``driver''}
+% \changes{1.915}{2000/06/27}{\texttt{pltotf} ``driver'' support
+% added. (LH)}
+%
+% It can sometimes be hard to determine which of all the PL files that
+% \package{fontinst} creates need to be converted to TFM files. In most
+% cases no \texttt{8a}-encoded PLs need to be converted as they aren't
+% used as base fonts or installed in an FD file, but to automatically
+% exclude them isn't a trivial task (even though it probably could be
+% done by a regular expression filter for fonts named according to the
+% \texttt{fontname} scheme). There furthermore seems to be some systems
+% on which it for various reasons isn't easy to convert all PLs in a
+% directory. The \texttt{pltotf} ``driver'' support is meant to help with
+% both these problems, as the ``map file'' it creates really is a shell
+% script (batch file) for converting precisely those PL files that need
+% a map file entry to TFM format. I believe the shell script will work
+% both for UNIX and DOS systems.
+%
+% \begin{macro}{\make_pltotf}
+% \begin{fistring}{TFMfileprefix}
+% |\make_pltotf| writes a \package{PLtoTF} command for converting the
+% current font's PL file to a TFM file. If set, the string
+% \texttt{TFMfileprefix} will be prepended to the TFM file name---this
+% could be used for putting the TFMs in some directory other than the
+% current.
+% \begin{macrocode}
+\def\make_pltotf{
+ \pout_line\output_pltotf{pltotf~\TeX_font_name.pl~
+ \ifisstr{TFMfileprefix}\then \str{TFMfileprefix}\fi
+ \TeX_font_name.tfm
+ }
+}
+% \end{macrocode}
+% \end{fistring}\end{macro}
+%
+%
+% \begin{macrocode}
+%</map>
+% \end{macrocode}
+% \Finale
+\endinput
+
diff --git a/Master/texmf-dist/source/fontinst/base/fisource.sty b/Master/texmf-dist/source/fontinst/base/fisource.sty
new file mode 100644
index 00000000000..c530b6bf26b
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fisource.sty
@@ -0,0 +1,685 @@
+% \iffalse
+%
+% Copyright 1999, 2000 the fontinst maintenance team and any individual
+% authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+% \fi
+%
+% \title{The \package{fisource} package}
+% \author{Lars Hellstr\"om}
+% \maketitle
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{fisource}%
+ [2003/03/29 v2.16 Fontinst source documentation commands]
+% \end{macrocode}
+%
+% \section{Option processing}
+%
+% \begin{option}{warnfinale}
+% \changes{2.01}{2000/07/06}{Option added. (LH)}
+% Under development I find it quite a nuisance that |\Finale| raises
+% an error if the checksum isn't correct; a warning feels more
+% appropriate. Therefore the \texttt{warnfinale} option redefines
+% |\check@checksum| to emit a warning instead.
+% \begin{macrocode}
+\DeclareOption{warnfinale}{%
+ \@ifpackageloaded{doc}\@firstofone\AtEndOfPackage {%
+ \def\check@checksum{\relax
+ \ifnum\check@sum=\z@
+ \typeout{**********************************}%
+ \typeout{* This macro file has no checksum!}%
+ \typeout{* The checksum should be \the\bslash@cnt!}%
+ \typeout{**********************************}%
+ \else\ifnum \check@sum=\bslash@cnt
+ \typeout{*******************}%
+ \typeout{* Checksum passed *}%
+ \typeout{*******************}%
+ \else
+ \PackageWarning{doc}{Checksum not passed
+ (\the\check@sum<>\the\bslash@cnt)}%
+ \fi\fi
+ \global\check@sum\z@
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{option}
+%
+% All other options are passed on to \package{xdoc}.
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{xdoc2}}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \changes{2.00}{2000/07/06}{Use \package{xdoc1}. (LH)}
+% \changes{2.02}{2000/07/15}{Use \package{xdoc2}. (LH)}
+% \changes{2.10}{2001/02/27}{Use \package{docidx2e}. (LH)}
+% \begin{macrocode}
+\RequirePackage{xdoc2,docidx2e}
+% \end{macrocode}
+%
+% \section{Miscellanea}
+%
+% \begin{macrocode}
+\CodelineIndex
+\setcounter{IndexColumns}{2}
+\setcounter{tocdepth}{2}
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+\DeclareRobustCommand\eTeX{\(\varepsilon\)-\kern-.125em\TeX}
+% \end{macrocode}
+%
+% \begin{macro}{\AllTeX}
+% \changes{2.13}{2001/08/26}{Command added. (LH)}
+% \begin{macro}{\La}
+% The |\AllTeX| command is for writing `(La)TeX' (but nicer). The
+% definition is taken from \texttt{tugboat.dtx}.
+% \begin{macrocode}
+\newcommand{\La}{%
+ L\kern-.36em
+ {%
+ \setbox0\hbox{T}%
+ \vbox to\ht0{\hbox{%
+ $\m@th$\csname S@\f@size\endcsname
+ \fontsize\sf@size\z@\math@fontsfalse\selectfont
+ A%
+ }\vss}%
+ }%
+}
+\DeclareRobustCommand\AllTeX{(\La\kern-.075em)\kern-.075em\TeX}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\missing}
+% \changes{2.10}{2001/02/27}{Redefined using
+% \cs{NewDescribeCommand}. (LH)}
+% \begin{macrocode}
+\NewDescribeCommand\missing{%
+ \XD@grab@marg\XD@grab@harmless@cs
+}{2}{%
+ \GenericDescribePrint{\small Not in \texttt{#1}:
+ \texttt{\Bslash#2}}%
+ \MakeSortKey\@tempa{#2}{}%
+ \IndexEntry{%
+ \LevelSorted{Not in #1:}{Not in \texttt{#1}:}%
+ \LevelSorted{\@tempa}{\texttt{\Bslash#2}}%
+ }{usage}{\thepage}%
+}
+% \newcommand\missing[2]{%
+% \marginpar{%
+% \raggedleft\leavevmode\strut
+% Not in \texttt{#1}: \texttt{\string#2}\strut
+% \index{Not in #1\actualchar Not in \string\texttt{#1}\levelchar
+% \string#2\actualchar\string\verb\verbatimchar
+% \string#2\verbatimchar\encapchar usage}%
+% }%
+% }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\newcommand\ambiguity[1]{\leavevmode
+ \textbf{#1\index{Ambiguity\encapchar usage}}%
+ \marginpar{\raggedleft\textbf{\huge A}}%
+}
+\newcommand\question[1]{\leavevmode
+ \textbf{#1\index{Question\encapchar usage}}%
+ \marginpar{\raggedleft\textbf{\huge ?}}%
+}
+\AtBeginDocument{\catcode`\_=11}
+\def\MakePrivateLetters{\catcode`\_=11\makeatletter}
+
+% \end{macrocode}
+%
+% \multchanges{\cs{meta}}{1.30}{2000/01/02}{\cs{Meta} command (robust
+% wrapper around \package{doc}'s \cs{meta}) added. (LH)}
+% \multchanges{\cs{meta}}{1.31}{2000/02/10}{Command redefined so that
+% it is robust itself. \cs{Meta} removed. (LH)}
+% \multchanges{\cs{meta@font@select}}{1.33}{2000/02/26}{Macro added.
+% (LH)}
+% \multchanges{\cs{meta}}{1.35}{2000/03/25}{Don't make \cs{setlanguage}
+% whatsits in restricted horizontal mode. (LH)}
+% \multchanges{\cs{meta}}{2.00}{2000/07/06}{Command definition removed,
+% since the command is already defined by \package{doc} or
+% \package{xdoc}. (LH)}
+%
+% \begin{macro}{\cs}
+% This is \package{ltxdoc}'s normal |\cs|, but with a twist to make
+% |\meta| produce better results when used in the argument.
+% \changes{1.33}{2000/02/26}{Redefinition added. (LH)}
+% \changes{2.00}{2000/07/06}{Use \cs{MetaNormalfont} and
+% \cs{PrintVisibleChar}. (LH)}
+% \begin{macrocode}
+\DeclareRobustCommand\cs[1]{%
+ \texttt{\MetaNormalfont\PrintVisibleChar{`\\}#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{isyntax}
+% |isyntax| is for ``informal'' syntax specifications, such as
+% \begin{quote}
+% A \meta{varchar command} can be one of\\
+% \begin{quote}
+% |\vartop|\marg{glyph}\\
+% |\varmid|\marg{glyph}\\
+% |\varbot|\marg{glyph}\\
+% |\varrep|\marg{glyph}
+% \end{quote}
+% \end{quote}
+% The implementation is based on that of the \texttt{verse}
+% environment.It usually works just as fine with \texttt{quote}, but
+% \texttt{isyntax} handles breaking long lines better (and more
+% elegantly).
+% \changes{1.37}{2000/05/14}{Increased \cs{rightskip} stretchability
+% and added setting of \cs{linepenalty}. (LH)}
+% \begin{macrocode}
+\newenvironment{isyntax}{%
+ \let\\\@centercr
+ \list{}{%
+ \itemsep \z@
+ \itemindent -1.5em%
+ \listparindent \itemindent
+ \advance \leftmargin 1.5em%
+ }%
+ \advance \rightskip \z@\@plus0.7\linewidth \relax
+ \linepenalty=100\relax
+ \item\relax
+}{\endlist}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{obsoletemacro}
+% \changes{2.00}{2000/07/06}{Environment removed since obsolete. (LH)}
+% The \texttt{obsoletemacro} environment is for getting the right
+% heading on |\changes| comments that refer to macros which have been
+% removed. It only updates the |\saved@macroname|.
+% \begin{macrocode}
+% \newenvironment{obsoletemacro}{\begingroup
+% \catcode`\\12
+% \MakePrivateLetters
+% \obsolete@macro
+% }{}
+% \def\obsolete@macro#1{\endgroup
+% \edef\saved@macroname{\string#1}%
+% }
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \section{\texttt{macro}-like environments}
+%
+% This subsection contains the definitions of a couple of environments
+% that, like \package{doc}'s \texttt{environment}, are for marking up the
+% document (what is defined and where). The definitions of these
+% environments are identical to that of \texttt{environment}, except
+% that the index entry texts are a little different.
+%
+% This section got a lot shorter in v\,2.00 thanks to \package{xdoc}.
+%
+% \begin{environment}{fiinteger}
+% \begin{environment}{fistring}
+% \multchanges{\notcs{\texttt{fiinteger} environment}^^A
+% \notcs{\texttt{fistring} environment}}{2.03}{2000/07/24}^^A
+% {Swapped last two arguments of \cs{NewMacroEnvironment} call
+% since \package{xdoc} changed.}
+% \begin{macrocode}
+\NewMacroEnvironment{fiinteger}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1 \normalfont integer}%
+ {\XDMainIndex{\levelsorted{#1 I}{\texttt{#1} (integer)}}%
+ \XDMainIndex{\levelsame{integers:}\levelsorted{#1}{\texttt{#1}}}}%
+ {{#1}{\texttt{#1} integer}}{}
+% \end{macrocode}
+% \begin{macrocode}
+\NewMacroEnvironment{fistring}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1 \normalfont string}%
+ {\XDMainIndex{\levelsorted{#1 S}{\texttt{#1} (string)}}%
+ \XDMainIndex{\levelsame{strings:}\levelsorted{#1}{\texttt{#1}}}}%
+ {{#1}{\texttt{#1} string}}{}
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+% \begin{environment}{PLproperty}
+% \changes{2.04}{2000/11/03}{Environment added. (LH)}
+% \changes{2.11}{2001/03/16}{Added \cs{DoNotIndexHarmless}. (LH)}
+% The \texttt{PLproperty} environment is for marking up definitions
+% of macros for interpreting properties in (V)PL files.
+% \begin{macrocode}
+\NewMacroEnvironment{PLproperty}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1 \normalfont property}%
+ {\XDMainIndex{\levelsorted{#1}{\texttt{\Bslash#1}}}%
+ \XDMainIndex{%
+ \levelsame{PL properties:}\levelsorted{#1}{\texttt{#1}}%
+ }}%
+ {{#1}{\texttt{\Bslash#1}}}%
+ {\DoNotIndexHarmless{#1}}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{numPLproperty}
+% \changes{2.11}{2001/03/17}{Environment added. (LH)}
+% The \texttt{numPLproperty} environment is for marking up definitions
+% of macros that interpret a numbered family of (V)PL file properties,
+% such as \texttt{NUM} for \texttt{NUM1}, \texttt{NUM2}, and
+% \texttt{NUM3}. The syntax is
+% \begin{quote}
+% |\begin{numPLproperty}|\marg{base}\marg{num-list}
+% \end{quote}
+% In the above case the \meta{base} would be \texttt{NUM}. The
+% \meta{num-list} is a comma-separated list of digits (no existing
+% family of numbered properties have more than 5 members) that
+% specify what members of the family are handled by the macro being
+% defined.
+% \begin{macrocode}
+\NewMacroEnvironment{numPLproperty}{%
+ \XD@grab@harmless\relax\XD@grab@marg
+}{2}%
+ {\MacroFont#1$*$ \normalfont properties}%
+ {\XDMainIndex{\levelsorted{#1}{\texttt{\Bslash#1}}}%
+ \@for\@tempa:=#2\do{%
+ \XDMainIndex{%
+ \levelsame{PL properties:}%
+ \levelsorted{#1\@tempa}{\texttt{#1\@tempa}}%
+ }%
+ }}%
+ {{#1}{\texttt{\Bslash#1}}}%
+ {\DoNotIndexHarmless{#1}}
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \multchanges{\notcs{\texttt{switch} environment}}{2.00}{2000/07/06}
+% {Removed since defined in \package{xdoc}. (LH)}
+%
+%
+% \section{Changes of change history formating}
+%
+% \multchanges{\cs{@changes}}{2.00}{2000/07/06}{Redefinition removed
+% since already done in \package{xdoc}. (LH)}
+%
+% \begin{macro}{\multchanges}
+% \changes{1.32}{2000/02/22}{\cs{flushleftspace} between \cs{cs}
+% items when typeset, instead of space. (LH)}
+% \changes{1.34}{2000/03/11}{\cs{notcs} marker allowed in
+% \meta{commands}. (LH)}
+% \changes{2.16}{2003/03/29}{Modified macro so that it is based on
+% \cs{changes@}. This means it is now compatible with \cs{uintver}.
+% (LH)}
+% The |\multchanges| commands is used to record a change to several
+% macros. Its syntax is
+% \begin{quote}
+% |\multchanges|\marg{commands}\marg{version}\marg{date}^^A
+% \marg{description}
+% \end{quote}
+% The three last arguments are as the arguments of |\changes|. The
+% \meta{commands} should be a nonempty sequence of commands, each
+% command either a |\cs| or a |\notcs|, and each command with one
+% argument. The change history entry generated by a
+% |\multchanges| will be for all the macros (or whatever) listed in
+% the first argument. |\cs| items will be typeset in typewriter font
+% with a leading backslash, whereas |\notcs| items will receive no
+% such special formatting.
+%
+% This method may have problems with active characters (since I've
+% ignored some things the standard |\changes| do to accomodate these),
+% but luckily \package{fontinst} hardly uses active characters
+% anyway. Furthermore I don't think the \package{doc} way of dealing
+% with them would be the right way here. Perhaps an active character
+% should rather be entered in the \meta{commands} argument as
+% |\active|\marg{code} or something?
+% \begin{macrocode}
+\newcommand*\multchanges[4]{%
+ \@bsphack
+ \begingroup
+ \begingroup
+ \def\cs##1{,\space##1}%
+ \let\notcs=\cs
+ \protected@xdef\@gtempa{%
+ \expandafter\@gobbletwo#1\@empty\@empty\@empty
+ }%
+ \edef\cs{,\noexpand\flushleftspace
+ \noexpand\protect
+ \expandafter\noexpand\csname cs \endcsname
+ }%
+ \def\notcs##1{,\noexpand\flushleftspace ##1}%
+ \protected@xdef\@gtempa{%
+ {\@gtempa}%
+ {\expandafter\@gobbletwo#1\@empty\@empty\@empty}%
+ }%
+ \endgroup
+ \let\saved@macroname=\@gtempa
+ \changes@{#2}{#3}{#4}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flushleftspace}
+% The |\flushleftspace| command should typeset something which looks
+% like a space when not broken at, and as an \texttt{3em plus 1fil}
+% space when broken at. It also have to survive its use in
+% |\multchanges|.
+% \changes{1.32}{2000/02/22}{Command added. (LH)}
+% \changes{1.38}{2000/06/05}{Modified finite penalty. (LH)}
+% \begin{macrocode}
+\DeclareRobustCommand\flushleftspace{%
+ \nobreak \hskip 3em\@plus 1fil%
+ \penalty\@m \hskip -3em\@plus -1fil\ %
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\labelednumber}
+% This \package{xdoc} macro is redefined to put a ``filbreak''
+% space before every page number labelled with a macro name.
+% \changes{2.16}{2003/03/29}{Redefinition added. (LH)}
+% \begin{macrocode}
+\renewcommand*\labelednumber[2]{%
+ \hskip -1em\@plus -8em%
+ \vadjust{}\hskip 1em\@plus 8em%
+ #2\nolinebreak[2] (#1)%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{theglossary}
+% \begin{macrocode}
+% \ifhave@multicol
+% \renewenvironment{theglossary}{%
+% \begin{multicols}\c@GlossaryColumns
+% [\glossary@prologue][\GlossaryMin]%
+% \GlossaryParms \def\item{\@idxitem v\,}\ignorespaces}%
+% {\end{multicols}}
+% \else
+% \renewenvironment{theglossary}{%
+% \@restonecoltrue\if@twocolumn\@restonecolfalse\fi
+% \columnseprule \z@ \columnsep 35\p@
+% \twocolumn[\glossary@prologue]%
+% \GlossaryParms \def\item{\@idxitem v\,}\ignorespaces}
+% {\if@restonecol\onecolumn\else\clearpage\fi}
+% \fi
+% \end{macrocode}
+%
+% If we want to use the glossary for some other information as well
+% (here I am thinking primarily on collecting |\missing| notices) then
+% perhaps we should insert the |v\,| in |\changes| instead. I would
+% guess the 64 character limit isn't at all as usual as it was when
+% the doc package documentation was written.
+%
+% \begin{macrocode}
+% \renewenvironment{theglossary}{%
+% % \penalty\z@\vskip\GlossaryMin\@plus\z@\@minus\GlossaryMin
+% % \penalty\z@\vskip-\GlossaryMin\@plus\z@\@minus-\GlossaryMin
+% \glossary@prologue
+% \GlossaryParms \let\item\@idxitem \ignorespaces
+% }{\par\bigskip}
+% \end{macrocode}
+% On second thoughts, the changes should be printed in one column.
+% They're usually very hard to linebreak in narrow columns.
+% \end{environment}
+%
+% \begin{macro}{\firstsubsubitem}
+% The idea with |\firstsubsubitem| is that it should be like |\efill|
+% |\subsubitem| if the paragraph is ended by a |\subsubitem| and like
+% \verb*"\ " if it isn't. This is achieved by grabbing the paragraph
+% into a macro and then prepend some suitable material to it when
+% typesetting.
+% \changes{1.36}{2000/04/10}{Grabbing paragraph as list of tokens,
+% rather than typeset text. (LH)}
+% \begin{macrocode}
+% \newcommand\firstsubsubitem{%
+% \begingroup
+% \let\par\@fssi@par
+% \let\subsubitem\@fssi@subsubitem
+% \protected@edef\@tempa{\iffalse}\fi
+% }
+% \end{macrocode}
+% \begin{macrocode}
+% \def\@fssi@subsubitem{%
+% \iffalse{\fi}%
+% \nobreak\hfill\vadjust{\nobreak}%
+% \penalty-\@M\vadjust{\penalty\@m}\nobreak\hskip -5pt\relax
+% \@tempa
+% \endgroup
+% \subsubitem
+% }
+% \end{macrocode}
+% \multchanges{\cs{@fssi@par}}{2000/06/05}{1.38}{Replaced simple space
+% by a more complicated sequence of penalties, vadjusts, and glue,
+% to make it more like \cs{flushleftspace}. (LH)}
+% \begin{macrocode}
+% \def\@fssi@par{%
+% \iffalse{\fi}%
+% \nobreak \hskip \z@ \@plus 0.4\linewidth
+% \vadjust{\nobreak}%
+% \penalty500\hskip \z@ \@plus -0.4\linewidth\hskip 5pt\relax
+% \penalty\z@\ \vadjust{\penalty\@m}%
+% \nobreak\hskip -5pt\relax
+% \@tempa
+% \endgroup
+% \par
+% }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GlossaryParms}
+% \begin{macrocode}
+% \def\GlossaryParms{%
+% \parindent \z@
+% \columnsep 15pt
+% \parskip 0pt plus 1pt
+% \rightskip 15pt plus 15pt
+% \mathsurround \z@
+% \parfillskip=-\rightskip
+% \pretolerance=\tolerance
+% \small
+% \def\@idxitem{\par\hangindent 30pt v\,}%
+% \def\subitem{\par\hangindent 30pt\hspace*{15pt}}%
+% \def\subsubitem{\par\hangindent 30pt\hspace*{25pt}}%
+% \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
+% }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{instance}{docindex}{changes}
+% \changes{2.10}{2001/02/27}{Redefining it. (LH)}
+% \changes{2.12}{2001/03/25}{Modified in the same way as the
+% \package{docindex} default was with v\,1.00. (LH)}
+% \changes{2.15}{2003/02/19}{Rewrote this redefinition. Something
+% was wrong with the old one, but it seems to have worked to
+% start again from the definition in \package{docindex}. (LH)}
+% \changes{2.16}{2003/03/29}{Added an insertion of `\texttt{v}\cs{,}'
+% to the version number headings. The way it is done is however a
+% hack; I should define a separate instance explicitly instead.
+% (LH)}
+% \begin{macrocode}
+\setcounter{GlossaryColumns}{1}
+\@namedef{TP@I{}{docindex}{changes}}#1#2{%
+ \begingroup
+ \def\DI@indexitem@i##1##2##3##4{%
+ \UseInstance{indexitem}{fixed1}{##1}{##2}{v\,##3}{##4}%
+ }%
+ \@letinstance\DI@indexitem@ii{indexitem}{fixed-r2a-nocomma}%
+ \@letinstance\DI@indexitem@iii{indexitem}{aloneaccept3}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{\z@skip}%
+ \let\DI@letter@format\@gobble
+ \def\+{-}%
+ \IfFileExists{\jobname.gls}{%
+ \ifnum \c@GlossaryColumns>\@ne
+ \begin{multicols}{\c@GlossaryColumns}[#1][\GlossaryMin]%
+ \else
+ \enough@room{\GlossaryMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \small
+ \makeatletter
+ \hbadness=\@M
+ \hfuzz=\maxdimen
+ \pretolerance=\m@ne
+ \tolerance=9999%
+ \emergencystretch=5em
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.gls}%
+ \DI@item@nojoin
+ \ifnum \c@GlossaryColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.gls.}}
+ \endgroup
+}
+% \@namedef{TP@I{}{docindex}{changes}}#1#2{%
+% \begingroup
+% \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
+% \@letinstance\DI@indexitem@ii{indexitem}{fixed-r2a-nocomma}%
+% \@letinstance\DI@indexitem@iii{indexitem}{aloneaccept3}%
+% \columnsep=10pt%
+% \parskip=0pt plus 1pt%
+% \def\DI@letter@skip{\z@skip}%
+% \let\DI@letter@format\@gobble
+% % \ifnum \c@GlossaryColumns>\@ne
+% % \begin{multicols}{\c@GlossaryColumns}[#1][\GlossaryMin]%
+% % \else
+% \enough@room{\GlossaryMin}%
+% #1\par
+% \addvspace\multicolsep
+% % \fi
+% \small
+% \emergencystretch=5em
+% \@nobreakfalse
+% \DI@ind@setup
+% \@input@{\jobname.gls}%
+% \DI@item@nojoin
+% % \ifnum \c@GlossaryColumns>\@ne
+% % \end{multicols}%
+% % \else
+% \enough@room\postmulticols
+% \addvspace\multicolsep
+% % \fi
+% \normalsize #2\par
+% \endgroup
+% }
+% \end{macrocode}
+% \end{instance}
+%
+%
+%
+% \section{Hack for removing ``Marginpar moved'' warning messages}
+%
+% Check if the definition matches the known. To be on the safe
+% side, only the known definition will be changed.
+%
+% \begin{macrocode}
+\def\@tempa{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
+ \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
+ \if@twocolumn
+ \if@firstcolumn \@tempcnta\m@ne \fi
+ \else
+ \if@mparswitch
+ \ifodd\c@page \else\@tempcnta\m@ne \fi
+ \fi
+ \if@reversemargin \@tempcnta -\@tempcnta \fi
+ \fi
+ \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi
+ \@tempdima\@mparbottom
+ \advance\@tempdima -\@pageht
+ \advance\@tempdima\ht\@marbox
+ \ifdim\@tempdima >\z@
+ \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
+ \else
+ \@tempdima\z@
+ \fi
+ \global\@mparbottom\@pageht
+ \global\advance\@mparbottom\@tempdima
+ \global\advance\@mparbottom\dp\@marbox
+ \global\advance\@mparbottom\marginparpush
+ \advance\@tempdima -\ht\@marbox
+ \global\setbox \@marbox
+ \vbox {\vskip \@tempdima
+ \box \@marbox}%
+ \global \ht\@marbox \z@
+ \global \dp\@marbox \z@
+ \kern -\@pagedp
+ \nointerlineskip
+ \hb@xt@\columnwidth
+ {\ifnum \@tempcnta >\z@
+ \hskip\columnwidth \hskip\marginparsep
+ \else
+ \hskip -\marginparsep \hskip -\marginparwidth
+ \fi
+ \box\@marbox \hss}%
+ \nointerlineskip
+ \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
+\ifx \@addmarginpar\@tempa
+% \end{macrocode}
+% It matched.
+% \begin{macrocode}
+ \def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox
+ \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne
+ \if@twocolumn
+ \if@firstcolumn \@tempcnta\m@ne \fi
+ \else
+ \if@mparswitch
+ \ifodd\c@page \else\@tempcnta\m@ne \fi
+ \fi
+ \if@reversemargin \@tempcnta -\@tempcnta \fi
+ \fi
+ \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi
+ \@tempdima\@mparbottom
+ \advance\@tempdima -\@pageht
+ \advance\@tempdima\ht\@marbox
+ \ifdim \@tempdima<\z@ \@tempdima\z@ \fi % Modification
+ \global\@mparbottom\@pageht
+ \global\advance\@mparbottom\@tempdima
+ \global\advance\@mparbottom\dp\@marbox
+ \global\advance\@mparbottom\marginparpush
+ \advance\@tempdima -\ht\@marbox
+ \global\setbox \@marbox
+ \vbox {\vskip \@tempdima
+ \box \@marbox}%
+ \global \ht\@marbox \z@
+ \global \dp\@marbox \z@
+ \kern -\@pagedp
+ \nointerlineskip
+ \hb@xt@\columnwidth
+ {\ifnum \@tempcnta >\z@
+ \hskip\columnwidth \hskip\marginparsep
+ \else
+ \hskip -\marginparsep \hskip -\marginparwidth
+ \fi
+ \box\@marbox \hss}%
+ \nointerlineskip
+ \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}}
+\else
+% \end{macrocode}
+% It didn't match. Inform the user of what is to come.
+% \begin{macrocode}
+ \typeout{Expect a lot of ``Marginpar moved'' warnings.}
+\fi
+\let\@tempa=\relax
+% \end{macrocode}
+%
+%
+% \section{Things not to index}
+%
+% \begin{macrocode}
+\DoNotIndex{\def,\let,\else,\fi,\then,\x_cs,\x_relax}
+\DoNotIndex{\csname,\endcsname,\string,\the,\expandafter,\noexpand}
+\DoNotIndexBy{@@}\DoNotIndexBy{@}\DoNotIndexBy{_}\DoNotIndexBy{FD@}
+% \end{macrocode}
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/fontinst/base/fisource.tex b/Master/texmf-dist/source/fontinst/base/fisource.tex
new file mode 100644
index 00000000000..b5a5cab7e76
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fisource.tex
@@ -0,0 +1,2985 @@
+%
+% Copyright 1998, 1999, 2000 the fontinst maintenance team and any
+% individual authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.0 or, at your option, any later version.
+%
+\documentclass{ltxdoc}
+\usepackage[dolayout,fileispart]{fisource}
+
+\usepackage{longtable}
+
+\RecordChanges
+\EnableCrossrefs
+
+\IndexPrologue{%
+ \section*{Index}%
+ \addcontentsline{toc}{section}{Index}%
+ \markboth{Index}{Index}%
+ Compound numbers (numbers with a hyphen) refer to a code line, and
+ the letter that is the first part of such a number specifies the
+ source file the code line is in, as explained by the file key below.
+ Simple numbers refer to pages. Numbers written in italics refer to
+ places where the corresponding entry is described, the ones
+ underlined to where it is defined, and the rest to where it is used.
+}
+\GlossaryPrologue{%
+ \section*{Change History}%
+ \addcontentsline{toc}{section}{Change History}%
+ \markboth{Change History}{Change History}%
+}
+
+
+\makeatletter
+\newcommand{\offindex}{\let\index\@gobble}
+
+\newcommand{\consumption}{%
+ \begingroup
+ \endlinechar=`\&\relax
+ \expandafter\endgroup\consumption@i
+}
+\def\consumption@i#1#2{%
+ \ifhmode{\parskip=\z@\@plus\p@\relax\par}\fi
+ Time elapsed: #1\,s\par
+ \tabskip=\leftmargin \advance \tabskip 1em\relax
+ \halign{&\hfil##\ \tabskip=\z@skip&##\hfil\tabskip=1em\cr
+ \omit\span \textbf{Stacks}&\omit\span \textbf{Others}\cr
+ \consumption@ii#2\@nil
+ }%
+}
+% #1 = number of strings used
+% #3 = string characters used
+% #5 = words of memory used
+% #7 = number of multiletter control sequences used
+% Other parameters are garbage.
+\def\consumption@ii#1 #2&#3 #4&#5 #6&#7 #8&#9&{%
+ \consumption@iii{{#1}{#3}}{{#5}{#7}}%
+}
+\def\consumption@iii#1#2#3&#4i,#5n,#6p,#7b,#8s#9\@nil{%
+ #4& input sources& \@secondoftwo#2& multiletter control
+ sequences\cr
+ #6& parameters& \@firstoftwo#1& strings\cr
+ #7& buffer characters& \@secondoftwo#1& string characters\cr
+ #8& saved values& \@firstoftwo#2& main memory words\cr
+}
+\makeatother
+
+\newenvironment{smalldes}{%
+ \list{}{%
+ \setlength\labelwidth{0pt}%
+ \setlength\itemindent{-\leftmargin}%
+ \setlength\listparindent{1em}%
+ \setlength\parsep{0pt}%
+ \setlength\itemsep{0pt plus 1pt}%
+ \setlength\topsep{\itemsep}%
+ \let\makelabel\descriptionlabel
+ }%
+}{\endlist}
+
+% \includeonly{}
+\iffalse
+\MakeShortVerb{\|}
+\fi
+
+\title{The \package{fontinst} utility}
+\author{Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth, Lars Hellstr\"om}
+
+\begin{document}
+\maketitle
+\tableofcontents
+\clearpage
+
+\part*{About the \package{fontinst} package}
+\addcontentsline{toc}{part}{The \package{fontinst} documentation}
+
+This document implements and describes version~1.9 of
+\package{fontinst}.
+
+
+
+\section{Files}
+
+\subsection{Source files}
+
+The source for \package{fontinst} is currently split on the six
+source files \texttt{fibasics.dtx}, \texttt{ficommon.dtx},
+\texttt{fimain.dtx}, \texttt{ficonv.dtx}, \texttt{filtfam.dtx}, and
+\texttt{fimapgen.dtx}.
+
+
+\subsection{Generated files}
+
+By running the \package{docstrip} installation script
+\texttt{fontinst.ins}, the following files are generated:
+\begin{description}
+ \item[\texttt{fontinst.sty}] This is the executable file that
+ contains all the commands that set up the \package{fontinst}
+ utility for use.
+ \item[\texttt{xfntinst.sty}] This is a variant of
+ \texttt{fontinst.sty} in which the |\latin|\-|family| command
+ behaves differently with respect to from which fonts the digits
+ are picked (see below).
+ \item[\texttt{cfntinst.sty}] This is a variant of
+ \texttt{fontinst.sty} which supports the old way of selecting
+ boundarychar for fonts (i.e., by setting the integer
+ |boundarychar|). It requires a bit more memory than
+ \texttt{fontinst.sty} does.
+ \item[\texttt{fontinst.ini}] This file contains some very basic
+ initialization code. It is used in case \package{fontinst} is used
+ under ini\TeX\ without a preloaded format.
+ \item[\texttt{finstmsc.sty}] This file contains the routines for
+ automatic map file generation, which can now generate map files
+ for the \package{dvips} and \package{dvipdfm} drivers. The system
+ is extendable, so users interested in generating map files for
+ other drivers can extend the mapfile writer's capabilities by
+ adding code to their \texttt{finstmsc.rc} files. \emph{Contributions
+ of such code is welcome}. This file also contains some seldom-used
+ code (the ENC to ETX conversion) that has been broken off from
+ the main \package{fontinst} utility, as it almost always just sat
+ there and used up space for no good reason.
+ \item[\texttt{fontdoc.sty}] This file contains the \package{fontdoc}
+ package, which can be used to typeset encoding and metric files.
+ \item[\texttt{csc2x.tex}] This file contains the reglyphing commands
+ that set up the common caps-and-small-caps to expert names
+ conversion. See Subsections~\ref{Ssec:Des:Reglyph}
+ and~\ref{Ssec:Reglyph} for details.
+ \item[\texttt{csckrn2x.tex}] This file is a variant of
+ \texttt{csc2x.tex}, which doesn't copy the commands that actually
+ set glyphs.
+ \item[\texttt{osf2x.tex}] This file is a variant of
+ \texttt{csc2x.tex}, which only changes the names of digits.
+\end{description}
+
+\texttt{fontinst.ins} also generates the file \texttt{trig.sty}, which
+contains \index{Carlisle, David} David Carlisle's
+\SortIndex{trig package}{\package{trig} package} \package{trig}
+package, and puts it in the same place as \texttt{fontinst.sty}.
+\changes{1.914}{2000/05/14}{Generating \texttt{trig.sty} from
+ source. (LH)}
+
+
+\subsection{Modules}
+
+The source is split up on the following \package{docstrip} modules:
+\begin{description}
+ \item[\Module{boundaryCompability}, \texttt{fimain}]
+ Guards code that is needed for \package{fontinst} to be compatible
+ with the old interface for boundary ligatures and kerns.
+ \item[\Module{!boundaryCompability}, \texttt{fimain}]
+ Guards code that is used when \package{fontinst} is not to be
+ compatible with the old interface for boundary ligatures and kerns.
+ \item[\Module{debug}, \texttt{filtfam}]
+ Guards code in the |\latinfamily| section that writes \texttt{INFO>}
+ messages.
+ \item[\Module{doc}, \texttt{fibasics}, \texttt{ficommon}, and
+ \texttt{fimain}]
+ Guards code that is to go into \texttt{fontdoc.sty}.
+ \item[\Module{driver}, all files]
+ Guards the driver code---the short piece of \LaTeX\ code in the
+ beginning of each file that makes it possible to typeset as a
+ \LaTeX\ document. \texttt{docstrip.ins} doesn't extract this
+ code, but it is possible to write a script that makes
+ \package{docstrip} extract this code if one wants to write a
+ modified driver. It's not usual, though.
+ \item[\Module{everyjob}, \texttt{fibasics}]
+ Guards the code setting |\everyjob| for fontinst formats (by
+ default not used).
+ \item[\Module{!glyphs}, \texttt{ficonv}]
+ Guards reglyphing setup code that is relevant when commands that
+ set glyphs are not to be copied.
+ \item[\Module{glyphs}, \texttt{ficonv}]
+ Guards reglyphing setup code that is relevant when commands that
+ set glyphs are to be copied.
+ \item[\Module{ini}, \texttt{fibasics}]
+ Guards the code for \texttt{fontinst.ini}.
+ \item[\Module{map}, \texttt{fimapgen}]
+ Guards the code for the automatic map file generation.
+ \item[\Module{misc}, \texttt{fibasics}, \texttt{fimain}, and
+ \texttt{ficonv}]
+ Guards code that is only to go into \texttt{finstmsc.sty}.
+ \item[\Module{!misc}, \texttt{fibasics}]
+ Guards code that is not to go into \texttt{finstmsc.sty}.
+ \item[\Module{obsolete}, \texttt{ficommon} and \texttt{fimain}]
+ Guards miscellaneous pieces of code that are considered obsolete.
+ \item[\Module{oldstyle}, \texttt{filtfam}]
+ Guards code in the |\latinfamily| section. The purpose of that
+ code is described in more detail in Section~\ref{Sec:NotesOnUsing}.
+ \item[\Module{oldTeX}, \texttt{fibasics}]
+ Guards code that copes with a bug in \TeX\ versions before 3.141.
+ \item[\Module{!oldTeX}, \texttt{fibasics}]
+ Guards normal code that wouldn't work satisfactory for
+ \TeX\ versions before 3.141 due to a bug in those \TeX s.
+ \item[\Module{pkg}, all files]
+ Guards code that is to go into \texttt{fontinst.sty} (and its
+ variants).
+ \item[\Module{pkg2}, \texttt{fibasics}]
+ A special variant of \Module{pkg} that is used for code that is
+ to end up at the very end of \texttt{fontinst.sty}.
+ \item[\Module{reglyphletters}, \texttt{ficonv}]
+ Guards code that sets up for changing lower case letter names to
+ corresponding smallcaps names. Used for \texttt{csc2x.tex} and
+ \texttt{csckrn2x.tex}.
+ \item[\Module{reglyphfigures}, \texttt{ficonv}]
+ Guards code that sets up for changing ordinary figure names to
+ corresponding \texttt{oldstyle} names. Used for
+ \texttt{osf2x.tex}, \texttt{csc2x.tex}, and
+ \texttt{csckrn2x.tex}.
+ \item[\Module{reglyph}, \texttt{ficonv}]
+ Guards code that is to go to the reglyphing setup files
+ \texttt{csc2x.tex} and \texttt{csckrn2x.tex}.
+ \item[\Module{textcomp}, \texttt{filtfam}]
+ Guards code in the |\latinfamily| section that generates text symbol
+ (\texttt{TS1}\slash ``text companion'') fonts.
+ \item[\Module{underconstruction}, \texttt{main}]
+ Guards some code that is ``under construction''.
+\end{description}
+
+
+
+\section{About previous \package{fontinst} releases}
+
+\subsection{Pre-\package{doc} fontinst releases}
+
+The following is a choice of some \package{fontinst} versions and some
+comments about them. The complete list of versions in the range
+v\,0.01--1.7 can be found in the file \texttt{CHANGES}.
+\begin{description}
+\item[v\,0.01]
+ was begun by Alan Jeffrey in February 1993. This was the
+ very first version recorded in the \texttt{CHANGES} file.
+%
+\item[v\,0.19]
+ was completed in April 1993 and presented at the TUG~'93
+ conference in July 1993. It is described in the proceedings
+ in \emph{TUGboat}~14\#3 and represents one of the earliest
+ release versions, in which the user interface was still
+ subject to change.
+%
+\item[v\,1.0]
+ was begun in August 1993 right after the conference and
+ represents the beginning of a complete re-write from scratch.
+%
+\item[v\,1.333]
+ was presented one year later at the TUG~'94 conference and
+ is described in the proceedings in \emph{TUGboat}~15\#3.
+ It uses a different user interface, which is largely the same
+ as in the present version, although the internals of the
+ implementation have subsequently changed quite a bit.
+%
+\item[v\,1.335]
+ was released in September 1994 and was the last ``official''
+ release version by Alan Jeffrey. Until the summer of 1998 this was
+ still the version to be found in the \texttt{fonts}\slash
+ \texttt{utilities}\slash\texttt{fontinst} directory on CTAN.
+ It is considered obsolete and should not be used any longer.
+%
+\item[v\,1.400]
+ was prepared in November 1994 and was the first version which
+ used |8r|-encoded raw fonts as a basis for virtual fonts.
+%
+\item[v\,1.500]
+ appeared on CTAN in \texttt{fonts}\slash\texttt{psfonts}\slash
+ \texttt{tools} in September~1995 together with Sebastian Rahtz's
+ Unix shell scripts to automate the installation. This version
+ included a completely revised implementation of |\latinfamily| and
+ added the |\installrawfont| command to install ligful raw fonts.
+%
+\item[v\,1.504]
+ appeared on CTAN in \texttt{fonts}\slash\texttt{psfonts}\slash
+ \texttt{tools} in January~1996. It added code to install (real or
+ faked) small caps fonts and to fake narrow fonts, if they don't
+ exist.
+%
+\item[v\,1.511]
+ was one of the last beta versions by Alan Jeffrey which dates back
+ to June~1996, but for some reason was never released. It uses
+ the encodings |9o| and~|9d| instead of |9t| and~|9e| to install
+ expertized oldstyle fonts, but this change never found its way
+ into subsequent ``unofficial'' releases until v\,1.8.
+%
+\item[v\,1.6]
+ appeared on CTAN in \texttt{fonts}\slash\texttt{psfonts}\slash
+ \texttt{tools} in February~1997 and was the first ``unofficial''
+ version of \package{fontinst} maintained by Sebastian Rahtz. It
+ contains only minor changes compared to v\,1.504, such as switching
+ to lowercase file names, searching for |.pl| files before |.afm|
+ files, and adding the \texttt{textcomp} installation to the
+ distribution.
+%
+\item[v\,1.6]
+ was re-issued on CTAN in September~1997, when the Unix shell
+ scripts were replaced by Perl scripts. The \package{fontinst}
+ package itself didn't change apart from minor changes of the
+ debugging messages.
+%
+\item[v\,1.7]
+ is the latest ``unofficial version'', which was released on CTAN
+ in May~1998. It includes some changes to the mapping between
+ \texttt{fontname} and \LaTeX{} weight codes proposed by Ulrik
+ Vieth, as well as some code to support the use of |8r|-encoded
+ |.afm| files generated by |ttf2afm|.
+%
+\end{description}
+%
+
+\subsection{About fontinst v\,1.8}
+
+Version~1.8 of the \package{fontinst} utility was the first to have
+been converted to \package{docstrip} format (this was made by Ulrik
+Vieth) and it was first released in June~1998. It is based on
+Sebastian Rahtz's ``unofficial'' \package{fontinst} releases v\,1.6
+and~1.7 as of February~1997 and May~1998, which, in turn, are based
+on Alan Jeffrey's versions v\,1.500 and~1.504 of September~1995
+and January~1996. In addition, version v\,1.8 also incorporated
+some code from Alan Jeffrey's last beta version, v\,1.511,
+which dates back to June~1996, but was never released to the
+general public for some reason.
+
+% It should be noted that all these versions differ significantly
+% from the previous ``official'' version v\,1.335 as of September~1994,
+% which was the only one to be found in the \texttt{fontinst} directory
+% on CTAN until the summer of 1998. Version v\,1.335 is now obsolete.
+
+Version~1.8 was agreed upon by the \package{fontinst} hacker community,
+as represented on the \package{fontinst} mailing list, as the new
+officially endorsed version, on which all further additions and
+enhancements can be based.
+
+
+\section{About this \package{fontinst} release}
+
+Several improvements, some of which fixes old bugs and some of which
+introduces new features, have been made to in particular the generation
+of fonts. The most important are:
+\begin{itemize}
+ \item The old multiple |\setkern| bug, which resulted in pointless
+ |KRN| instructions being written to (V)PL files have been fixed.
+ In addition, it is now possible to reset kerns (using
+ |\resetkern|) and unset kerns (using |\unsetkerns|,
+ |\noleftkerning|, |\norightkerning|, or |\noleftrightkerning|).
+ \item A bug which resulted in too few kerns being written to a font
+ if the same glyph is used in more than one slot (this occurs if
+ you make an all-caps font from an encoding definition file which
+ sets |\lc|, |\lctop|, and |\lclig| to the same to their
+ |\uc|\textellipsis\ counterparts) has been fixed. A consequence of
+ this fix is that you cannot access the number of the slot that
+ glyph \meta{glyph} has been assigned to as |\int|\marg{glyph}
+ (unless you are using \texttt{cfntinst.sty}), but there really is
+ no need for you to do so either.
+ \item There is now a proper interface for using left and right
+ boundaries which, in contrast to the old setting of the integer
+ \texttt{boundarychar}, can make use of the full generality of the
+ PL format. (The old interface is still available if you use
+ \texttt{cfntinst.sty}.)
+ \item \package{fontinst} can now interpret AFM files which contain
+ non-integer dimensions. There is also a user-level interface for
+ changing the formula according to which the italic corrections of
+ glyphs are computed.
+ \item The PL to MTX converter can now cope with the VPL-unique
+ property lists |VTITLE|, |MAP|, and |MAPFONT|, which means that it
+ can now convert VPL files as well. In addition to this, there are
+ a couple of minor bugfixes and improvements in the PL to MTX
+ conversion.
+ \item There is now a way of overriding the PL to MTX converter's
+ automatic choice of encoding definition file made based on the
+ |CODINGSCHEME| property of a PL file. The command |\generalpltomtx|
+ lets you select which encoding definition file you want to use, as
+ does the new |\fromplgivenetx| transformed font command.
+ \item Several \package{fontinst} commands that were previously
+ missing have been added to the \package{fontdoc} package. The
+ most significant are probably |\inputmtx| and |\inputetx|.
+ \item There is now a simple way of changing the names of glyphs in
+ metric files generated from AFM files.
+ % See Subsection~\ref{Ssec:Reglyph} for further details.
+ \item The implementation of font metrics transformations, as done by
+ |\transformfont|, has been rewritten and \package{fontinst} now
+ handles uniform scaling internally; the driver only needs to do
+ $x$-scaling and slanting. This can result in different font metrics,
+ but we think only in that it comes out more like one would expect.
+ The user interface is the same.
+ \item There is now a new transformed font command |\fromany| which
+ searches for a font metric file in any of the four formats MTX,
+ PL, AFM, and VPL; converting it to MTX format and possibly
+ generating a PL as well if necessary. This command is also used by
+ |\installfont|, |\installrawfont|, and |\reglyphfont| to search
+ for font metric files, so these can now take VPL files as a
+ source for font metric data.
+ \item There is now a mechanism for generating the necessary map files
+ automatically. So far it knows how to generate map files for the
+ \package{dvips} and \package{dvipdfm} drivers, but the system can
+ easily be extended by adding code in the \texttt{finstmsc.rc} file.
+ \item There are two new commands |\setscaled|\-|rawglyph| and
+ |\setscaled|\-|notglyph| which generalize the |\setraw|\-|glyph|
+ and |\setnot|\-|glyph| commands. These commands are described in
+ Subsection~\ref{Ssec:Glyph-info}.
+ \item The routines for converting metrics to (V)PL format has
+ changed. As a result of this the metrics of fonts are likely to
+ change (slightly), but the conversion is now more accurate than it
+ used to be. A side-effect is that VPL files generated by
+ \package{fontinst} can now be used directly as a base for other
+ fonts (it used to be necessary to convert them to binary format and
+ back to get the metrics right).
+ \item \texttt{finstmsc.sty} now contains a new command which
+ generates a Postscript encoding (\texttt{.enc}) file from an ETX
+ file. The syntax of this command is
+ \begin{quote}
+ |\etxtoenc|\marg{etxfile}\marg{encfile}
+ \end{quote}
+ Usually you don't need to use this command, since the routines
+ which generate map files will call it when the encoding used in a
+ |\reencodefont| isn't known.
+ \item The new command
+ \begin{isyntax}
+ |\installfontas|\marg{font}\marg{encoding}\marg{family}%
+ \penalty0\marg{series}\penalty0\marg{shape}\penalty0\marg{size}
+ \end{isyntax}
+ adds an entry for \meta{font} with the given NFSS parameters to
+ the corresponding FD file.
+ \item The |\set|\textellipsis, |\reset|\textellipsis, and
+ |\unset|\textellipsis\ commands now behaves as one would expect
+ even when they occur between |\install|\-|fonts| and |\end|\-%
+ |install|\-|fonts|---the assignments they make are no longer
+ subject to the grouping around the metrics of individual fonts.
+ Assignments made by these commands when they occur in MTX and ETX
+ files \emph{are} however still subject to this grouping, so that
+ behaves as usual.
+ \item There are two control flow commands |\for| and |\foreach|
+ which repeatedly execute a given sequence of commands---just like
+ a normal programming language \texttt{for} loop. With |\for| the
+ loop variable is an integer that is incremented or decremented by
+ an amount that is specified in the beginning of the loop. With
+ |\foreach| the loop variable is a string which assumes all the
+ values given in a comma-separated list.
+ \item The command |\offcommand| turns a command `off', i.e., makes
+ it gobble its arguments and do nothing. The command |\oncommand|
+ turns a command back on, i.e., restores the original definition of
+ a command that had been turned off. Turning a command off or on
+ when it is already off or on respectively has no effect.
+ \item If you begin an item in the file-list argument (\#2) of
+ |\install|\-|font| or |\install|\-|raw|\-|font| with the command
+ |\metrics|, then that item (everything up till the next comma
+ that is not inside a group) will be interpreted as explicit metric
+ commands that are executed after the previous font was loaded and
+ before the next is. Thus you can do e.g.
+ \begin{quote}
+ |\installfont{|\textellipsis|}{a,\metrics\unsetint{xheight},b,|%
+ \textellipsis
+ \end{quote}
+ if you want font \texttt{a} to be loaded before font \texttt{b},
+ but want to use the \texttt{xheight} value of font \texttt{b},
+ and you don't want to bother writing an MTX file that simply
+ contains the command |\unsetint{xheight}|.
+ \item There is now a command |\fontinstcc| which switches to the
+ catcodes that are in force for most of the time that
+ \texttt{fontinst.sty} is read (|@| and |_| are letters, |~| is a
+ space, and spaces and newlines are ignored). This makes it simpler
+ to redefine internal control sequences. To switch back to the
+ normal catcodes, there is the |\normalcc| command. Neither
+ command has any arguments.
+ \item The |\Unicode| command may be used to specify what
+ ISO\,10646\slash Unicode character a slot corresponds to. See
+ page~\pageref{Unicode} for details.
+ \item The third arguments of the |\installfont| and
+ |\install|\-|raw|\-|font| commands can now be a comma-separated
+ list of ETX files.
+ \item File names in the second and third arguments of
+ |\install|\-|font| and |\install|\-|raw|\-|font| may now be
+ suffixed by zero or more \emph{modifier clauses} that can change
+ the interpretation of a file by e.g.~assigning special values to
+ some variables while the file is read in. This is described in
+ Subsection~\ref{Ssec:FontInstCmds} below.
+ \item The |\setfontdimen| command allows an ETX file to declare
+ which integer variables correspond to font dimensions in a (V)PL
+ file. This correspondence is used both when generating a ligful
+ (V)PL file and when a (V)PL file is converted to an MTX file.
+\end{itemize}
+
+
+\subsection{Metric packages}
+
+\package{fontinst} has traditionally come with a collection of MTX
+files that complement the MTX files generated from base font metrics,
+in that they build glyphs that may be missing from the base fonts or
+in some other way needs to be improved. The most well-known of these
+is the \texttt{latin.mtx} file; other examples include
+\texttt{textcomp.mtx}, \texttt{mathit.mtx}, and \texttt{latinsc.mtx}.
+A problem with these is however that they cannot produce optimal
+results for all fonts simply because there are irregular differences
+in how fonts are set up by the foundries. Most glyphs come out alright,
+but there are usually a few for which the parameters used are more or
+less wrong. Therefore most high quality font installations are made
+with modified versions of these files, where the parameters have been
+tuned to the specific font design.
+
+Modifying in particular \texttt{latin.mtx} is however not an entirely
+easy task, because this is a rather large file (with plenty of
+archaic pieces of code in curious places). Doing it once is no big
+problem, but if one has to do it several times (maybe because some
+errors are discovered in the original \texttt{latin.mtx}) then it is
+probably no fun anymore. Furthermore, if one has two or three
+modified copies of this file because one has made high quality
+installations of that many different fonts then even a trivial bugfix
+might start to feel like entirely too much work.
+
+If one has to make modifications then it is usually easier to deal
+with several small files (many of which can be used unchanged) than
+one big file. Thus it would be better if these big files were split up
+into several smaller ones.
+The main problem with splitting up something like \texttt{latin.mtx}
+is that there are some commands which are defined at the top and
+which are then used in almost all sections of the file. One must make
+certain that these commands are always loaded, which makes the metric
+files somewhat harder to use (especially if the one who tries to use
+them is not the one who wrote them).
+
+One strategy is to include all definitions needed for a metric file in
+it. This has the slight disadvantage that the commands will have to be
+defined several times. What is worse however, is that the command
+definitions will appear in several files, so if one finds a bug in one
+of them, one cannot simply correct this bug in one place. As the number
+of files can soon become quite large, correcting such bugs can become
+a boring procedure indeed.
+
+Another strategy is to put all the command definitions in one file
+and then explicitly include it in the \meta{file-list} argument of
+|\installfont|. This eliminates the repeated bug fixing problem, but
+requires the user to do something that the computer can actually do
+just as well.
+
+A third strategy is to put the command definitions in one or several
+files and then in each metric file the user explicitly mentions load
+the command definitions needed for that particular file. Metric
+packages uses an improved version of this strategy, since they also
+make it possible for fontinst to remember which packages (i.e., sets
+of command definitions) that have already been loaded, so that they
+are not unnecessarily loaded again. The \texttt{newlatin.mtx} file is
+an alternative to \texttt{latin.mtx} that implements this strategy.
+Most of the actual code is located in the following metric packages:
+\begin{longtable}{l p{0.7\linewidth}}
+ \texttt{ltcmds.mtx}& Defines some common commands used by the other
+ files.\\
+ \texttt{llbuild.mtx}& Builds the latin lower case alphabet
+ (unaccented letters are `unfakable', the rest are constructed if
+ not present in the base fonts).\\
+ \texttt{lubuild.mtx}& Builds the latin upper case alphabet.\\
+ \texttt{lsbuild.mtx}& Builds accented letters in the latin
+ smallcaps alphabet, but only if there are unaccented letters to
+ build them from in the base fonts.\\
+ \texttt{lsfake.mtx}& Fakes a latin smallcaps alphabet by shrinking
+ the upper case alphabet, but only if the glyph had not already
+ been manufactured.\\
+ \texttt{lsmisc.mtx}& Make some miscellaneous smallcaps glyphs
+ (mostly ``smallcaps f-ligatures'').\\
+ \texttt{ltpunct.mtx}& Makes digits, punctuation marks, and other
+ symbols (mostly by marking as ``unfakable'').
+\end{longtable}
+\noindent All of these are easy to use as components of equivalents
+of a modified \texttt{latin.mtx} files, and all dependencies of one
+package upon another are handled via explicit |\usemtxpackage|
+commands.
+
+For information on the syntax etcetera of commands related to metric
+packages, see Section~\ref{Sec:Metric files}.
+
+
+\subsection{Word boundary ligatures and kerns}
+
+One of the new features added in \TeX~3 was that of ligatures and
+kerns with word boundaries. \package{fontinst} has had an interface
+for making such ligatures and kerns, but it has been completely
+redesigned in v\,1.9 and the old interface (setting the integer
+|boundarychar|) is no longer recognized by \package{fontinst}. Files
+which use the old interface can still be processed with
+\texttt{cfntinst.sty}, though.
+
+Before considering the new commands, it is suitable to make a
+distinction between proper glyphs and pseudoglyphs. A proper glyph has
+been set using one of the commands |\setrawglyph|, |\setglyph|, and
+|\resetglyph|. A pseudoglyph is any name used in the context of a
+glyph name which does not denote a proper glyph. If a pseudoglyph
+|g-not| was set using the |\setnotglyph| command, then
+|\ifisglyph{g-not}\then| will evaluate to true, but something can be
+a pseudoglyph even if an |\ifisglyph| test evaluates to false. The
+interesting point about pseudoglyphs when considering word boundaries
+however, is that a pseudoglyph can have ligatures and kerns.
+
+Kerns and ligatures at the left word boundary (beginning of word) are
+specified using the commands |\setleftboundary| and
+|\endsetleftboundary|, which are syntactically identical to
+|\setslot| and |\endsetslot| respectively. One important difference is
+however that the argument to |\setslot| must be a proper glyph, while
+the argument to |\setleftboundary| may be any glyph, hence any
+pseudoglyph will do just fine.
+
+|\ligature| commands between |\setleftboundary| and
+|\endsetleftboundary| will generate beginning of word ligatures. Kerns
+on the right of the glyph specified in |\setleftboundary| will become
+beginning of word kerns.
+
+Kerns and ligatures at the right word boundary (end of word) are
+trickier, due to the asymmetrical nature of the ligkern table in a PL
+file. What a font can do is to specify that the right word boundary,
+for purposes of kerning and ligatures, should be interpreted as
+character $n$. By including a kern or ligature with character $n$ on
+the right, that kern or ligature will be used at the end of a word,
+but it will also be used each time the next character is character
+$n$. Because of this, one usually wants the slot $n$, which the right
+word boundary is interpreted as being, to be empty whenever the
+encoding allows this.
+
+The command
+\begin{quote}
+ |\setrightboundary|\marg{glyph}
+\end{quote}
+will mark the current slot as used to denote the right word boundary,
+and leave the slot empty, increasing the current slot number by one
+just like a |\setslot| \textellipsis\ |\endsetslot| block does. Kerns on
+the left of \meta{glyph} will be end of word kerns and |\ligature|
+commands with \meta{glyph} as the second argument will be for the end
+of a word.
+
+The command
+\begin{quote}
+ |\makerightboundary|\marg{glyph}
+\end{quote}
+is similar to |\setrightboundary|, but it is a slot command which may
+only be used between a |\setslot| and the matching |\endsetslot|. Like
+|\setrightboundary|, it marks the current slot as used to denote the
+right word boundary, but the glyph specified in the enclosing |\setslot|
+will be written to that slot. Ligatures for the glyph specified by the
+|\setslot| and ligatures for the glyph specified by the
+|\makerightboundary| will both be for this single slot. Kerns on the
+right of the |\setslot| glyph and the |\makerightboundary| glyph will
+similarly both be for this single slot. The idea is that the |\setslot|
+glyph should be used when making a kern or ligature for that glyph,
+while the |\makerightboundary| glyph should be used when making a kern
+or ligature for the end of a word. \package{fontinst} will warn you if
+these two uses of the slot directly contradict each other.
+
+
+\subsection{Changing the names of glyphs}
+\label{Ssec:Des:Reglyph}
+
+Sometimes, primarily when making a virtual font from more than one raw
+font and two of the raw fonts contain different glyphs with the same
+name, it becomes necessary to change the names of some glyphs to make
+some sense out of it. The main source of this kind of trouble is the
+``caps and small caps'' (SC) and ``oldstyle figures'' (OsF) fonts
+within many commercial font families. The typical problem is that what
+is typographically different glyphs---such as the lowercase `a'
+(\texttt{a}, for \package{fontinst}) and the smallcaps `\textsc{a}'
+(\texttt{Asmall}, for \package{fontinst})---are given the same name by
+the foundry.
+
+One way to get round this is to say for example
+\begin{quote}
+ |\setglyph{Asmall} \glyph{a}{1000} \endsetglyph|\\
+ |\setleftrightkerning{Asmall}{a}{1000}|\\
+ |\unsetglyph{a}|\\
+ |\noleftrightkerning{a}|
+\end{quote}
+and continuing like that for all the duplicate glyph names. This is
+however a rather prolix method and if the number of glyphs is large
+then it is usually simpler to use the |\reglyphfont| command.
+
+To reglyph one or several fonts, one writes
+\begin{quote}
+ |\reglyphfonts|\\
+ \vadjust{}\quad \meta{reglyphing commands}\\
+ |\endreglyphfonts|
+\end{quote}
+There are two types of reglyphing commands: the |\reglyphfont|
+command, and the commands that modify what |\reglyphfont| will do to
+the fonts it operates on. The syntax of |\reglyphfont| is
+\begin{quote}
+ |\reglyphfont|\marg{destination font}\marg{source font}
+\end{quote}
+The \meta{source font} font here is the name (suffix not included, of
+course) of the font metric file one wants to change the glyph names in.
+This font metric file can be in any of the formats MTX, PL, AFM, and
+VPL, and it will be converted to MTX format if it isn't already in
+that format (this happens just as for files listed in the second
+argument of |\installfont|). \meta{destination font} (which must be
+different from \meta{source font}) will be taken as the name for a
+new \texttt{.mtx} file that will be generated. The destination font
+can differ from the source font only in two ways: the names of some
+glyphs in the source font might be changed, and some of the commands
+from the source font might not have been copied to the destination
+font. To what extent the fonts are different is determined by what
+modifying commands have been executed; when no modifying commands
+have been executed, the source and destination font are equal.
+
+The modifying reglyphing commands are
+\begin{quote}
+ |\renameglyph|\marg{to}\marg{from}\\
+ |\renameglyphweighted|\marg{to}\marg{from}\marg{weight}\\
+ |\killglyph|\marg{glyph}\\
+ |\killglyphweighted|\marg{glyph}\marg{weight}\\
+ |\offmtxcommand|\marg{command}\\
+ |\onmtxcommand|\marg{command}
+\end{quote}
+|\renameglyph| simply declares that occurrences of the glyph name
+\meta{from} should be replaced by the glyph name \meta{to}. To each
+glyph name is also assigned a \emph{weight}, which is used by a
+mechanism which conditions copying of commands from the source font to
+the destination font by the set of glyphs that command mentions. The
+details of this mechanism are however somewhat tricky, so those
+interested in the full generality should go to Subsection~\ref
+{Ssec:Reglyph}. Here it needs only be noted that if one applies
+|\killglyph| to a glyph name, then (under most circumstances) commands
+that refer to that glyph name will not be copied to the destination
+font.
+
+|\offmtxcommand| and |\onmtxcommand| also control whether commands are
+copied to the destination font, but they look at the actual command
+rather than the glyphs it refers to. For example, after the command
+\begin{quote}
+ |\offmtxcommand{\setkern}|
+\end{quote}
+no |\setkern| commands will be copied. By using |\offmtxcommand|, it
+is possible to achieve effects similar to those of the files
+\texttt{kernoff.mtx} and \texttt{glyphoff.mtx}---the difference is
+that with |\offmtxcommand|, it happens at an earlier stage of the font
+generation. As expected, |\onmtxcommand| undoes the effect of
+|\offmtxcommand|.
+
+A special rule pertains to the |\set|\-|raw|\-|glyph|,
+|\set|\-|not|\-|glyph|, |\set|\-|scaled|\-|raw|\-|glyph|, and
+|\set|\-|scaled|\-|not|\-|glyph| commands, since |\transformfont|
+doesn't care what something was in the source font when it generates
+the transformed font. To turn these commands off while reglyphing,
+you use |\offmtx|\-|command| on |\set|\-|scaled|\-|raw|\-|glyph|.
+
+The effects of modifying reglyphing commands are delimited by
+|\reglyphfonts| and |\endreglyphfonts|, which starts and ends a group
+respectively.
+
+As we expect the most common reglyphing operation will be to go from SC
+glyph names to expert glyph names, there is a file \texttt{csc2x.tex}
+in the \package{fontinst} distribution which contains the modifying
+reglyphing commands needed for setting up that conversion. Thus you
+can write for example
+\begin{quote}
+ |\reglyphfonts|\\
+ | \input csc2x|\\
+ | \reglyphfont{padrcx8r}{padrc8r}|\\
+ | \reglyphfont{padscx8r}{padsc8r}|\\
+ |\endreglyphfonts|
+\end{quote}
+to alter the glyph names in the SC fonts in the Adobe Garamond
+(\texttt{pad}) family.
+Note that the names of the destination fonts here really are rather
+arbitrary, since they will only exist as \texttt{.mtx} files, and
+thus only need to work within your local file system. In particular,
+all the |\setrawglyph| commands in the destination font files still
+refer to the source font, so it is that font which the drivers need
+to know about.
+
+
+\subsection{Making map file fragments}
+
+A \emph{map file fragment} is the lines\footnote{Not in general an
+entire map file, hence the word \emph{fragment}.} of a map file that
+the corresponding driver would need for handling some set of fonts.
+When told to, \package{fontinst} can (in a fairly automatic way) create
+the map file fragment which is needed for the set of raw fonts
+\package{fontinst} has (i) installed directly (using |\installrawfont|)
+or (ii) used as a base font for some installed virtual font (generated
+by |\installfont|). \package{fontinst} does not support the map file
+syntaxes of every existing driver, but the system is designed to be
+extendable and contributions that extend its capabilities are welcome.
+Nor can \package{fontinst} examine your \TeX\ system and
+determine every piece of information needed to make the correct map
+file fragments, but you can tell it roughly how your installation
+looks, it can make guesses which work most of the time, and you can
+specify most things explicitly if the guesses turn out to be wrong.
+Should the available options for configuring the process turn out to
+be inadequate for your needs, then please write to the
+\package{fontinst} mailing list about this---there is probably a way
+to improve the system so that your needs can be met.
+
+Now what does one have to do to use this map file fragment writer,
+then? First you need to tell \package{fontinst} to record the
+information the map file fragment writer needs. You do this by giving
+the command
+\begin{quote}
+ |\recordtransforms{whatever.tex}|
+\end{quote}
+at the beginning of the run. Here \texttt{whatever.tex} is the name of
+a file that will be created, so you can use some other name if you
+like. After that you do all the calls to |\transform|\-|font|,
+|\install|\-|font|, |\install|\-|raw|\-|font|, |\latin|\-|family|,
+etc.\ you need to make the fonts you want. When you're done, you give
+the command
+\begin{quote}
+ |\endrecordtransforms|
+\end{quote}
+and end the run (say |\bye|). The file \texttt{whatever.tex} will now
+contain the information about which fonts were used and what needs to
+be done with them.
+
+The second step is to actually run the map file fragment writer.
+Observe that it is located in the file \texttt{finstmsc.sty}, not
+\texttt{fontinst.sty}! The commands you need to give it can be so few
+that you can type them in at \TeX's \texttt{*} prompt, but if you are
+writing a command file then it should typically have the following
+structure (comments not necessary, of course):
+\begin{quote}
+ \begin{tabular}{ll}
+ |\input finstmsc.sty|& |%| Input command definitions\\
+ \meta{general settings} & |%| See below\\
+ |\adddriver|\marg{driver name}\marg{output file}&
+ |%| Open output file\\
+ |\input whatever.tex|& |%| Write to output file\\
+ |\donedrivers|& |%| Close output file(s), tidy up\\
+ |\bye|& |%| Quit
+ \end{tabular}
+\end{quote}
+The |\adddriver| command gives the order ``write map file entries for
+the \meta{driver name} DVI driver to the file \meta{output file}.'' The
+plan is that it should be possible to use the name of just about any
+major driver (\texttt{dvips}, \texttt{xdvi},\footnote{Or
+does that use the same map file as \texttt{dvips}? I heard somewhere
+that it did. /LH} \texttt{pdftex},\footnote{pdf\TeX\ can read
+the map files generated for \texttt{dvips}, but a separate driver is
+desirable because the formats are not completely identical.}
+\texttt{OzTeX}, etc.) here and get suitable map file entries for that
+driver as output, but for the moment only the \texttt{dvips} and
+\texttt{dvipdfm}\footnote{Whose support I made very much to illustrate
+that you \emph{don't} have to be a big and ancient driver like
+\texttt{dvips} to have supporting code put into \package{fontinst}.
+(The fact that I just happened to have printed out the documentation and
+that is was easy to read also helped, of course.) Note, however, that
+there won't be any support for a driver unless someone sits down and
+writes the code for it! Don't assume I will. /LH} drivers are supported.
+You may also use \texttt{debug} for \meta{driver name}; the entries in
+the file for that ``DVI driver'' simply contain all the available
+information about each font (hence it should come handy for debugging
+code writing entries for real drivers) in a format that should be easy
+to interpret for a human. It could be the right choice if you're going
+to write the map file manually.
+
+The file \texttt{whatever.tex} in the above example contains the
+commands (|\makemapentry| commands) that actually cause entries to be
+written to the output file. It also contains a number of |\storemapdata|
+commands---these describe how some given font was made. If some
+metric file you have used contains |\setrawglyph| commands that were
+not automatically generated by \package{fontinst}, then there might
+not be a |\storemapdata| for the font they refer to in
+\texttt{whatever.tex}, so you will have to include such a command
+yourself somewhere. This can for example be done in the \meta{general
+settings} part of the above example file. The syntax of the
+|\storemapdata| command is described in Subsection~\ref{Ssec:interface}.
+
+Another class of things that will typically appear in the
+\meta{general settings} part above is commands that will inform the
+routines actually writing output about your \TeX\ system, about the set
+of fonts you are using on this run, or about something else that might
+be useful. Some such commands are of a general nature and affect what
+assumptions \package{fontinst} will make in certain conditions when no
+specific information is available. For the moment there commands are:
+\begin{description}
+ \item[\cs{AssumeMetafont}] Assume all fonts with PL metrics are
+ bitmaps generated by Metafont, and therefore make no entries for
+ them.
+ \item[\cs{AssumeAMSBSYY}] Assume all fonts with PL metrics have their
+ \TeX\ names in all upper case as postscript names---just like the
+ Computer Modern fonts in the AMS\slash Blue~Sky\slash Y\&Y
+ distribution.
+ \item[\cs{AssumeBaKoMa}] Assume all fonts with PL metrics have their
+ \TeX\ names in all lower case as postscript names---just like the
+ Computer Modern fonts in the BaKoMa distribution.
+\end{description}
+Otherwise the default action of the routine for finding out the
+postscript name of a font simply is to observe that it hasn't got a clue
+about what the right value is when the metrics were taken from a PL
+file, and therefore it writes `\texttt{??????}' for the postscript name.
+\begin{description}
+ \item[\cs{AssumeLWFN}] Assume postscript fonts for which nothing
+ else has been specified are stored in files which are named
+ according to the \mbox{MacOS} scheme for
+ \texttt{LWFN}s.%\footnote{LaserWriter FoNt}
+\end{description}
+Otherwise the default action is to use the name of the AFM or PL from
+which the metrics was originally taken, and add the file suffix stored
+in the string \texttt{PSfontsuffix}. The default value of this string
+is \texttt{.pfa}, but it can be changed using |\resetstr|.
+
+If neither the default nor the LWFN scheme produce correct results
+then you may use the more specific \DescribeMacro\specifypsfont
+|\specifypsfont| command, which describes exactly which file (or files,
+if any) a given font is stored in. For syntax and examples of usage,
+see Subsubsection~\ref{Sssec:Config-interface}. (I consider the
+semantics of this command to still be under development, but in order
+to know how to develop it further I need to know in which cases it is
+insufficient.)
+
+Finally, there is the |\declarepsencoding| command which is used to
+link ETX files to postscript encodings. If no postscript encoding has
+been linked to a given ETX file then \package{fontinst} will
+automatically create a postscript encoding (\texttt{.enc}) file for
+that encoding, and use this file for all reencoding commands. Again,
+see Subsubsection~\ref{Sssec:Config-interface} for syntax and examples
+of usage. The \texttt{8r} encoding is predeclared, and it doesn't
+matter if an encoding is undeclared if you never use it to reencode
+fonts, but there is potentially a problem with not having declared
+encodings you have installed and use for reencoding, as you may then
+find yourself having two files with identical names that define
+encodings that do not have the same name (as far as postscript is
+concerned).
+
+
+\subsection{On verbatim, typewriter, and monowidth fonts}
+
+The verbatim, typewriter, and monowidth concepts are common sources
+of confusion for those who use \package{fontinst} to install fonts
+with \AllTeX;\footnote{Myself \emph{not} excepted. /LH} in particular
+there are many misconceptions about the relation between them. The
+official view (of which not much has actually been brought forward)
+is that these concepts are really about three quite different things.
+
+A font is a \emph{monowidth} (monospaced, fixed-pitch) font if all
+glyphs in it have exactly the same width. Some font formats make
+special provisions for such fonts; the most notable example is the
+AFM format, where a single \texttt{CharWidth} keyword specifies the
+width for all glyphs in the font. \package{fontinst} responds to this
+by including the command
+\begin{quote}
+ |\setint{monowidth}{1}|
+\end{quote}
+in the MTX file generated from an AFM, but that is everything that is
+hard-wired into the program. That a font is monowidth is however
+something that one should take note of when installing it for \TeX,
+as it means many of the glyphs in it have such a strange appearance
+that they are (pretty much) useless. The \texttt{endash} is for
+example usually only half as long as the \texttt{hyphen} and the
+letters in ligature glyphs are only half as wide as normal letters.
+Many of the ETX and MTX files that come with \package{fontinst}
+contain special commands to avoid making use of such degenerate
+glyphs.
+
+That a font is a \emph{typewriter} font really only means that it has
+a typewriterish look about it. The two most familiar typewriter fonts
+are probably Computer Modern Typewriter (\texttt{cmtt}) and Courier.
+Both of these fonts are monowidth, but there is no absolute rule about
+this. One of the standard \TeX\ fonts is for example Computer Modern
+Variable-width Typewriter (\texttt{cmvtt}), which is not a monowidth
+font, as Figure~\ref{Fig:TTvsVTT} shows.
+\begin{figure}
+ \begin{tabular}{ll}
+ \texttt{cmtt}:& \fontfamily{cmtt}\selectfont
+ The quick brown fox jumps over the lazy dog.\\
+ \texttt{cmvtt}:& \fontfamily{cmvtt}\selectfont
+ The quick brown fox jumps over the lazy dog.
+ \end{tabular}
+ \caption{Two typewriter fonts}
+ \label{Fig:TTvsVTT}
+\end{figure}
+
+The verbatim concept has very little to do with fonts at all; in
+\LaTeX\ it is considered to be a property of the environment
+(\texttt{verbatim}, \texttt{macrocode}, etc.) rather than a property
+of the font. The connection there is with fonts is that the encoding
+of the font must contain visible ASCII (as defined in Appendix~C
+of \emph{The \TeX book}~\cite{TeXbook}) as a subset for the text to
+be rendered correctly. The \texttt{cmtt} family is the only one amongst
+the original Computer Modern fonts which meets this criterium and
+that is the primary grounds for the idea that these three concepts
+should be connected. Today that reason is at best a very weak one, as
+all \texttt{T1}-encoded fonts also meet the criterium of containing
+visible ASCII as a subset.
+
+A circumstance which has probably added to the confusion is that
+\texttt{OT1} is usually claimed to be an encoding. In reality the
+Computer Modern fonts that are declared in \LaTeX\ as being
+\texttt{OT1} display as many as five different encodings, as shown in
+Table~\ref{Tab:OT1-fonts}.
+\begin{table}
+ \begin{tabular}{lccc}
+ & \texttt{TEX TEXT}&
+ \begin{tabular}[b]{c}\texttt{TEX TEXT WITHOUT}\\
+ \texttt{F-LIGATURES}\end{tabular}&
+ \texttt{TEX TYPEWRITER TEXT}\\
+ \noalign{\medskip}
+ non-italic&
+ \begin{tabular}{l}
+ \texttt{cmb10}\\
+ \texttt{cmbx5}--\texttt{12}\\
+ \texttt{cmbxsl10}\\
+ \texttt{cmdunh10}\\
+ \texttt{cmff10}\\
+ \texttt{cmfib8}\\
+ \texttt{cmr6}--\texttt{17}\\
+ \texttt{cmsl8}--\texttt{12}\\
+ \texttt{cmss8}--\texttt{17}\\
+ \texttt{cmssbx10}\\
+ \texttt{cmssdc10}\\
+ \texttt{cmssi8}--\texttt{17}\\
+ \texttt{cmssq8}\\
+ \texttt{cmssqi8}\\
+ \texttt{cmvtt10}
+ \end{tabular}&
+ \begin{tabular}{l}
+ \texttt{cmcsc8}--\texttt{10}\\
+ \texttt{cmr5}
+ \end{tabular}&
+ \begin{tabular}{l}
+ \texttt{cmsltt10}\\
+ \texttt{cmtcsc10}\\
+ \texttt{cmtt8}--\texttt{12}
+ \end{tabular}\\
+ \noalign{\medskip}
+ italic&
+ \begin{tabular}{l}
+ \texttt{cmbxti10}\\
+ \texttt{cmfi10}\\
+ \texttt{cmti7}--\texttt{12}\\
+ \texttt{cmu10}
+ \end{tabular}&&
+ \begin{tabular}{l}
+ \texttt{cmitt10}
+ \end{tabular}
+ \end{tabular}
+ \caption{``\texttt{OT1}-encoded'' Computer Modern fonts, collected
+ according to the actual font encoding}
+ \label{Tab:OT1-fonts}
+\end{table}
+Since most monowidth fonts are only used for setting verbatim text,
+there is some code in \texttt{ot1.etx} which automatically chooses a
+\texttt{TEX TYPEWRITER TEXT} encoding for the font when the
+\texttt{monowidth} integer is set. The only reason for this is the
+guess that this is what the user wanted.
+
+
+\subsection{Tuning accent positions---an application of loops}
+
+The accent placements made by \texttt{latin.mtx} certainly aren't
+perfect for all fonts, and the only way to find out where they should
+be put is through trying in text the accented letters you get for a
+couple of values for the position parameter and deciding which one
+works best. Since to try one parameter value you need to (i) edit it
+into an MTX file, (ii) run \package{fontinst}, (iii) run
+\package{VPtoVF}, (iv) run \TeX\ on some test text, and (v) print that
+text, trying one parameter value can take annoyingly much time.
+Repeating the same procedure ten times to test ten values is not
+something one does without being bored (unless one scripts it, of
+course), but it is possible to try ten parameter values in a single
+virtual font, and without doing very much typing.
+
+Say you're not too happy with how \texttt{latin.mtx} positions the
+accent in the \texttt{ohungarumlaut} glyph:
+\begin{quote}
+ |\setglyph{ohungarumlaut}|\\
+ | \topaccent{o}{hungarumlaut}{500}|\\
+ |\endsetglyph|
+\end{quote}
+The |500| is the horizontal position (in thousandths of the width of
+the \texttt{o}) that the center of \texttt{hungarumlaut} in the glyph
+constructed will have, so that is the position parameter value that
+you want to change. Create an MTX file containing the code
+\begin{quote}
+ |\for(pos){250}{750}{50}|\\
+ | \setglyph{ohungarumlaut\strint{pos}}|\\
+ | \topaccent{o}{hungarumlaut}{\int{pos}}|\\
+ | \endsetglyph|\\
+ | \setleftrightkerning{ohungarumlaut\strint{pos}}|\\
+ | {ohungarumlaut}{1000}|\\
+ |\endfor(pos)|
+\end{quote}
+This will set eleven glyphs \texttt{ohungarumlaut250},
+\texttt{ohungarumlaut300}, \texttt{ohungarumlaut350}, \textellipsis\,,
+\texttt{ohungarumlaut750}, each being an Hungarianly umlauted `o'
+(i.e., an `\H{o}') but all having that umlaut in slightly different
+positions. In order to put them in a font, you also need to make an
+encoding that contains them. Therefore create an ETX file which
+contains the code
+\begin{quote}
+ |\relax\encoding|\\
+ |\nextslot{"C0}|\\
+ |\for(pos){250}{750}{50}|\\
+ | \setslot{ohungarumlaut\strint{pos}}|\\
+ | \endsetslot|\\
+ |\endfor(pos)|\\
+ |\endencoding|
+\end{quote}
+The command for installing this experiment font would be something like
+\begin{isyntax}
+ |\installfont|\marg{some name}|{|\meta{the normal list of metrics}%
+ |,|\penalty0\meta{the new MTX}|}|\penalty0
+ |{ot1,|\meta{the new ETX}|}|\penalty0|{OT1}|\textellipsis
+\end{isyntax}
+The reason for including \texttt{ot1} in the third argument above is
+that you'll need letters other than `\H{o}' against which you can
+compare the experimental glyphs. It would not have been possible to
+use \texttt{t1} instead of \texttt{ot1} (even though that has more
+Hungarian letters) since that would set all slots in the font and
+leave none for these experimental \texttt{ohungarumlaut}s.
+
+It is even possible to use a loop for making the test text. The
+\LaTeX\ macros
+\begin{verbatim}
+\newcount\slotcount
+\newcommand\testtext[3]{%
+ \slotcount=#1\relax
+ \begin{description}%
+ \loop\item[\the\slotcount]#3%
+ \ifnum #2>\slotcount \advance \slotcount 1 \repeat
+ \end{description}%
+}
+\DeclareTextCompositeCommand{\H}{OT1}{o}{\char\slotcount}
+\end{verbatim}
+will let you write
+\begin{quote}
+ |\testtext|\marg{first}\marg{last}\marg{text}
+\end{quote}
+to get the text \meta{text} typeset once for each slot from
+\meta{first} to \meta{last} inclusive, with |\H{o}| ranging through the
+glyphs in this interval. Thus in this case
+|\testtext|\penalty\hyphenpenalty|{"C0}|\penalty\hyphenpenalty|{"CA}|%
+\penalty\hyphenpenalty|{Erd\H{o}s}| would be a trivial test.
+
+
+\subsection{Font installation commands}
+\label{Ssec:FontInstCmds}
+
+The |\installfont|, |\installrawfont|, and |\installfontas| commands
+have the respective syntaxes
+\begin{isyntax}
+ |\installfont|\marg{font-name}\marg{metrics}\marg{etx-list}\penalty0
+ \marg{encoding}\marg{family}\marg{series}\marg{shape}\marg{size}\\
+ |\installrawfont|\marg{font-name}\marg{metrics}\marg{etx-list}^^A
+ \penalty0
+ \marg{encoding}\marg{family}\marg{series}\marg{shape}\marg{size}\\
+ |\installfontas|\marg{font-name}\penalty0\marg{encoding}^^A
+ \marg{family}\marg{series}\marg{shape}\marg{size}
+\end{isyntax}
+The \meta{font-name} argument and the last five arguments are common
+to all these commands. The first argument is the name of a \TeX\ font
+to install. The last five arguments are the NFSS attributes under which
+that font will be declared to \LaTeX---encoding, family, series, shape,
+and size. It is worth observing that encoding names are usually in
+upper case, whereas the family, series, and shape are usually in lower
+case. The size argument is either a shorthand (declared using
+\DescribeMacro{\declaresize}|\declaresize|) for a particular font
+size (or range of font sizes), or an explicit list of font sizes or
+ranges of sizes, which is copied directly to the font declaration.
+The most common case is to let the size argument be empty, as that is
+declared as a shorthand for ``any size''.
+
+The |\installfontas| command does not itself create the font, it just
+makes a note that the specified font declaration should be written to
+the proper FD file at |\end|\-|install|\-|fonts|. The
+|\install|\-|font| and |\install|\-|raw|\-|font| commands do however
+produce the font, in the sense that they write a VPL and PL
+respectively file for the font. It depends solely on the \meta{metrics}
+and \meta{etx-list} arguments what this font will contain. Many
+features of these arguments are new with \package{fontinst} v\,1.9;
+therefore the complete syntaxes are described below.
+
+Both arguments are comma-separated lists of basically file names (not
+including an extension). The files listed in the \meta{metrics} are
+font metric files which together build up a \emph{glyph base}
+(definitions of glyphs and metrics related to one or several glyphs),
+whereas the files listed in the \meta{etx-list} are encoding definition
+files that select a subset of the glyph base for turning into a
+\TeX\ font. The font metrics can be in either of the four formats
+MTX, PL, AFM, and VPL, which are considered in that order. If the
+metrics are not originally in MTX format then they will be converted
+to this format (a new file will be created) before they are used.
+The encoding definitions must be in ETX format. The files actually
+read will have a suffix \texttt{.mtx}, \texttt{.pl}, \texttt{.afm},
+\texttt{.vpl}, or \texttt{.etx} appended to the name given, depending
+on which format is expected.
+
+Within each element of the comma-separated list, the actual file name
+is followed by zero or more \emph{modifier clause}s. A \meta{modifier
+clause} consists of a \emph{keyword} followed by some number (usually
+one) of \emph{arguments}, separated by spaces. The whole thing looks
+a lot like the \meta{rule specifications} of e.g.\ the |\vrule|
+command, but here the spaces are mandatory. The currently defined
+\meta{modifier clause}s are
+\begin{description}
+ \item[\mdseries\textvisiblespace\texttt{option}\textvisiblespace
+ \meta{string}]
+ Available for metric and encoding files. This adds \meta{string}
+ to the list of options for this file, which may affect what code
+ the file executes. The file can then test, using the |\ifoption|
+ command, whether a specific string is one of the options it was
+ given.
+ \item[\mdseries\textvisiblespace\texttt{scaled}\textvisiblespace
+ \meta{factor}]
+ Available for metric files. Causes the \texttt{rawscale} integer
+ variable to be set to the \meta{factor} (an integer expression)
+ while the file is being read. This scales glyphs and kerns that
+ are added to the glyph base by the \meta{factor}.
+ \item[\mdseries\textvisiblespace\texttt{suffix}\textvisiblespace
+ \meta{suffix}]
+ Available for metric files. Causes \meta{suffix} to be appended
+ to every glyph name appearing in a glyph or kern that file adds
+ to the glyph base. Thus ``\texttt{suffix /2}'' effectively
+ changes a
+ \begin{quote}
+ |\setrawglyph{a}|\dots
+ \end{quote}
+ to a
+ \begin{quote}
+ |\setrawglyph{a/2}|\dots
+ \end{quote}
+ \item[\mdseries\textvisiblespace\texttt{encoding}\textvisiblespace
+ \meta{etx-name}]
+ Available for metric files, and forces \package{fontinst} to
+ only consider the PL and VPL formats for this font.
+ As these file formats do not contain glyph names, an ETX file
+ is used to assign glyph names to the slots in the font.
+ This ETX file is usually selected according to the
+ \texttt{CODINGSCHEME} property of the PL or VPL (using the
+ correspondances set up via the |\declare|\-|encoding| command),
+ but that information is not always as one would want it (there
+ are even fonts for which it is quite wrong). An \texttt{encoding}
+ clause bypasses this automatic mechanism, so that the file
+ \meta{etx-name}\texttt{.etx} is used instead.
+
+% % The following is no longer true as of v1.926:
+% \textbf{Note:} The first time that a file in PL or VPL format is
+% used in a \meta{metrics} argument, a corresponding MTX file is
+% generated. This means that if the same file reference is used
+% another time then the reference will be to the MTX file, not to
+% the original PL or VPL, and thus \texttt{encoding} clauses on
+% subsequent uses will have no effect. Each font only has one
+% encoding, so it usually makes no sense to switch the ETX file
+% used to interpret a font, but since MTX files are not
+% automatically deleted between runs there is a risk that this
+% takes away the intended effect of an \texttt{encoding} clause.
+
+ \item[\mdseries\textvisiblespace\texttt{mtxasetx}]
+ This is available for files in the \meta{etx-list}. The actual
+ function of a
+ \begin{quote}
+ \meta{file-name} \texttt{mtxasetx}
+ \end{quote}
+ item in the \meta{etx-list} is that the file
+ \meta{file-name}\texttt{.mtx} is inputted (\emph{not}
+ \meta{file-name}\texttt{.etx}) and that the correspondance
+ between glyph names and slot numbers set up in
+ |\set|\-|raw|\-|glyph| or |\set|\-|scaled|\-|raw|\-|glyph|
+ commands in this file is treated as if it had been set up by
+ |\setslot| commands in an ETX file. Provided the MTX file is
+ transformable, the glyph base will be unaffected.
+
+ The purpose of this feature is to simplify quick and dirty
+ installations of odd fonts for which no suitable ETX file is
+ available. This can be useful in early stages of the design of
+ a new font, but is inferior to installation using proper ETX
+ files since one for example cannot specify any ligatures in
+ MTX files.
+\end{description}
+Furthermore there is a special exception for the \meta{metrics}: if
+the first token in one of the list items is the control sequence
+|\metrics|, then the rest of that item is interpreted as explicit
+metric commands to execute.
+
+If the \meta{metrics} of two subsequent |\install|\-|font|
+or |\install|\-|raw|\-|font| commands are identical then the glyph
+bases will be identical as well. This creates an opportunity for
+optimization, which \package{fontinst} makes use of by caching glyph
+bases from one installation command to the next so that the glyph
+base does not have to be rebuilt in these cases. A side-effect of
+this caching is that local assignments made between two font
+installation commands are cleared out with the glyph base, but
+|\setint| and similar \package{fontinst} commands make global
+assignments when used in such positions.
+
+Some examples might be in order. The first is an adaptation of an
+installation command from \texttt{mfnt-0.59}~\cite{mfnt} by
+Matthias Clasen and Ulrik Vieth: the installation command for the
+8-bit math font \texttt{xma1000} (which can be thought of as being
+to \texttt{cmmi10} sort of as \texttt{ecrm1000} is to \texttt{cmr10}).
+The first three \texttt{encoding} clauses are more fine-tuning---without
+them, a few glyphs would get incorrect names---but the last two are
+quite essential, as the \texttt{msam10} and \texttt{msbm10} fonts
+incorrectly claim to have the coding scheme \texttt{TEX MATH
+SYMBOLS}.
+\begin{verbatim}
+ \installfont{xma1000}{%
+ yma1000 encoding mcin,%
+ cmr10 encoding ot1upright,%
+ cmmi10,%
+ cmsy10 encoding omscal,%
+ msam10 encoding msam,%
+ msbm10 encoding msbm,%
+ mccmhax,mccmkern,mcmissing,%
+ cmsy10-base,cmsy10-extra%
+ }{mc}{MC}{cm}{m}{n}{<10->}
+\end{verbatim}
+Also note the explicit \LaTeX\ size specification for the range
+``10\,pt and up''.
+
+The second example makes use of a \texttt{suffix} clause to combine
+the letters from one font with the digits from another.
+\begin{verbatim}
+ \installfont{msbrj8t}{msbr8r,msbrc8r suffix /2,latin}{digit2,t1}
+ {T1}{msbj}{m}{n}{}
+\end{verbatim}
+In this case, the glyph base contains the glyphs of Monotype Sabon
+(SabonMT)---under names such as \texttt{A} for `A', \texttt{a} for
+`a', and \texttt{one} for a lining digit one---as well as the
+glyphs of Monotype Sabon Small Caps and Oldstyle Figures
+(SabonMT-SCOSF)---under names such as \texttt{A/2} for `A',
+\texttt{a/2} for `\textsc{a}', and \texttt{one/2} for a hanging
+digit one. The \texttt{digit2.etx} file simply makes the definition
+\begin{verbatim}
+ \setcommand\digit#1{#1/2}
+\end{verbatim}
+which causes \texttt{t1.etx} to put \texttt{zero/2} in slot 48 (digit
+zero), \texttt{one/2} in slot 49 etc., instead of as it normally
+would \texttt{zero} in slot 48, \texttt{one} in slot 49 and so on.
+The net effect is that the digits in the generated \texttt{msbrj8t}
+is from \texttt{msbrc8r} (SabonMT-SCOSF) but everything else is from
+\texttt{msbr8r} (SabonMT).
+
+The third example makes use of an \texttt{mtxasetx} clause to install
+(with its default encoding) a font for which creating an appropriate
+ETX file seems not worth the trouble.
+\begin{verbatim}
+ \installrawfont{psyr}{psyr,\metrics
+ \setint{xheight}{\height{alpha}}
+ }{txtfdmns,psyr mtxasetx}{U}{psy}{m}{n}{}
+\end{verbatim}
+The effect of the second \texttt{psyr} is that \texttt{psyr.mtx} is
+read (in case there was no \texttt{psyr.mtx} then it is created from
+(hopefully) \texttt{psyr.afm}) and the information in it will form
+the glyph base. Because of the |\metrics| control sequence, the rest
+of that item will be interpreted as explicit metric commands
+modifying the glyph base, and thus the |\setint| command can provide
+a value for the \texttt{xheight} variable (there doesn't seem to be
+such a value in the AFM). Once the glyph base is completed, the
+|\install|\-|raw|\-|font| starts writing the file \texttt{psyr.pl}
+(that's for the first \texttt{psyr}). The encoding of that font will,
+because of the \texttt{psyr mtxasetx}, be the same as that used in
+\texttt{psyr.mtx}. Finally, the \texttt{txtfdmns} is for
+\texttt{txtfdmns.etx}, an ETX file which sets fontdimens 1--16 as for
+a \texttt{T1} encoded font but does not set any slots. Since
+\texttt{psyr.mtx} reinterpreted as an ETX file sets slots but no
+fontdimens, these complement each other nicely.
+
+
+
+\begingroup
+\renewcommand\thesubsection{\thesection.\ensuremath{\infty}}
+
+\subsection{Coming attractions}
+
+We\footnote{Well, perhaps it's just me. /LH} have some new features
+which we have pretty much sorted out how they should work and how they
+should be implemented, but didn't want to introduce in this version as
+the large modifications in core systems would require another
+pre-release version before the proper release. Instead these features
+will probably appear in the first pre-release of \package{fontinst}
+v\,2.0.
+
+
+\subsubsection{Bounding boxes}
+
+Han The Thanh has created an implementation of bounding box support
+for \package{fontinst}, and it is a modified form of that support
+that will make it into \package{fontinst} v\,2.0. One important
+characteristic of this implementation is that the dimensions of the
+bounding box are not bundled into the same data structure (the
+|\g-|\meta{glyph} macros) as the glyph's width, height, depth, and
+italic correction are, but stored in a separate data structure (the
+|\gb-|\meta{glyph} macros). A glyph doesn't need to have its bounding
+box set, it is simply a piece of information that \package{fontinst}
+will store if you tell it to and which you can later retrieve.
+
+The bounding box will be stored as coordinates of the sides in the
+normal AFM coordinate system. The commands for retrieving these
+coordinates will probably be
+\begin{center}
+ \begin{tabular}{ll}
+ \textbf{Command}& \textbf{Side}\\
+ |\bbtop|\marg{glyph}& top ($y$-coordinate)\\
+ |\bbbottom|\marg{glyph}& bottom ($y$-coordinate)\\
+ |\bbleft|\marg{glyph}& left ($x$-coordinate)\\
+ |\bbright|\marg{glyph}& right ($x$-coordinate)
+ \end{tabular}
+\end{center}
+In Thanh's implementation the command names are |\ury|, |\lly|,
+|\llx|, and |\urx| respectively instead, but I think the former are
+easier to remember. If no bounding box has been set for a glyph then
+the above commands will instead report the corresponding coordinate of
+the glyph's \TeX\ box (i.e.\ |\height|\marg{glyph},
+|\neg{\depth|\marg{glyph}|}|, |0|, and |\width|\marg{glyph}
+respectively).
+
+The command for setting the bounding box of a glyph will be
+\begin{quote}
+ |\setglyphbb|\marg{glyph}\marg{left}\marg{bottom}\marg{right}^^A
+ \marg{top}
+\end{quote}
+
+
+
+\endgroup
+
+
+\section{Notes on using \package{fontinst}}
+\label{Sec:NotesOnUsing}
+
+The primary purpose of \package{fontinst} is to simplify the
+installation of PostScript or TrueType text fonts.
+
+
+\subsection{General notes}
+
+Leaving aside unusual variants which require special attention such
+as alternate or swash fonts, almost all standard font families can
+be installed automatically using the |\latinfamily| command,
+optionally making use of the corresponding expert fonts as well.
+
+Depending on what kind of fonts you have and want to install,
+|\latinfamily| supports three different modes of operation:
+
+|\latinfamily|\marg{fam}|{}| installs a normal font family using
+|8a|-encoded standard fonts (reencoded to |8r|) and nothing else.
+It installs |.fd| files for the \LaTeX{} families \texttt{8r}\meta{fam},
+\texttt{OT1}/\meta{fam}, \texttt{T1}/\meta{fam} and
+\texttt{TS1}/\meta{fam}, and generates virtual fonts for the |7t|,
+|8t|, and |8c| encodings. This is the only option available for most
+typefaces which do not have an expert set.
+
+|\latinfamily{|\meta{fam}|x}{}| installs an expertized font family using
+|8a|-encoded standard fonts (reencoded to |8r|) and |8x|-encoded
+expert fonts. It installs |.fd| files for the \LaTeX{} families,
+\texttt{OT1}/\meta{fam}\texttt{x}, \texttt{T1}/\meta{fam}\texttt{x} and
+\texttt{TS1}/\meta{fam}\texttt{x}, and generates virtual fonts for the
+|9t|, |9e| and |9c| encodings.
+
+|\latinfamily{|\meta{fam}|j}{}| installs an expertized font family with
+oldstyle digits using |8a|-encoded standard fonts (reencoded to
+|8r|) and |8x|-encoded expert fonts. It installs |.fd| files for
+the \LaTeX{} families, |OT1|/\meta{fam}|j|, |T1|/\meta{fam}|j| and
+|TS1|/\meta{fam}|j|, and generates virtual fonts for the |9o|, |9d| and
+|9c| encodings. Since \texttt{TS1} has oldstyle digits by default, the
+|9c|-encoded fonts should be the same as in the previous case. Finally,
+|\latinfamily{|\meta{fam}|9}{}| is also supported as an alternative to
+|\latinfamily{|\meta{fam}|j}{}| for backwards compatibility.
+
+The whole installation process relies on certain assumptions about
+the symbol complement of Adobe's expert fonts. In particular, it is
+assumed that the expert fonts include the oldstyle digits and a
+complete set of small caps glyphs, which is an assumption that's not
+always satisfied for expert fonts by other suppliers. If these
+glyphs are not included in the expert fonts, the only way to get
+them is from real small caps fonts, but this requires some
+reshuffling of glyph names.
+
+To support such unusual cases, this source file contains some
+optional code embedded between \Module{*oldstyle} \dots\
+\Module{/oldstyle},
+which extends the behaviour of |\latinfamily| for expertized
+encodings with oldstyle digits. Instead of relying only on the
+glyphs of the |8r|-reencoded raw font and the |8x|-encoded expert
+font, this version also looks for corresponding OsF or SC\&OsF fonts
+and uses the default digits from those fonts as oldstyle digits.
+
+
+\subsection{Notes on small caps and oldstyle fonts}
+
+The |\latinfamily| command is supposed to do a reasonably good job
+of installing a complete font family based on all the |.afm| files
+it can find. If it doesn't find a suitable font shape, it is
+sometimes possible to fake it by default substitutions. However, in
+the case of small caps fonts, there are several options which may
+require some clarification.
+
+For the majority of typefaces, a font family typically consists only
+of of roman and italic fonts in several weights. Since real small
+caps fonts are not included, they have to be faked from the roman
+fonts, which is implemented by setting |\encoding_shape| to `|c|',
+so that different encoding files |OT1c.etx| or |T1c.etx| are used.
+Since these files call for glyph names such as `|Asmall|' which are
+not found in the roman font, the default substitutions in
+|latin.mtx| are eventually used to approximate fake small caps
+glyphs by scaling and letterspacing. The outcome is just an
+approximation for a small caps font, but it is better than nothing.
+
+For a small number of typefaces, the standard fonts are complemented
+by an expert collection, which usually includes two sets of fonts.
+First, for each standard font there is a corresponding expert font
+containing additional glyphs such as extra ligatures and symbols,
+oldstyle digits and small capital letters. For Adobe expert fonts
+this set is sufficient to build a complete small caps font from the
+standard and expert glyphs. Furthermore, the expert collection
+usually also contains a number of real small caps font corresponding
+to the roman fonts and some OsF fonts corresponding to the italic
+fonts. If these fonts are available, there are several options how
+to install small caps fonts.
+
+By default, |\latinfamily| first tries to find a real small caps
+font. If it is found, it is installed using the default encoding
+files and metric files, just like any roman or slanted font.
+However, once |\latinfamily| has taken this choice, it will fail to
+find a corresponding expert font, since it is actually looking for
+an expert font in small caps shape which doesn't exist. (In fact,
+it would be an error to substitute an expert font in normal shape.)
+The outcome will be a virtual font based only on glyphs from the
+real small caps raw font, which implies ending up with oldstyle
+digits as the default set of digits, but allows to inherit the
+kerning information of the real small caps font.
+
+Another option for an expertized installation would be to make the
+real small caps fonts unavailable, so that |\latinfamily| will
+attempt to fake a small caps font using glyphs from the standard and
+expert fonts in normal shape. This means that |\encoding_shape| is
+again set to `|c|', so that |OT1c.etx| and |T1c.etx| are used, but
+this time a glyph named `|Asmall|' does exist in the expert font and
+will be used instead of faked one generated by scaling. The outcome
+will be a font based on normal and small caps glyphs from the
+standard and expert fonts. The oldstyle digits will only be used if
+they are called for, otherwise the default digits from the roman
+font are used. The only drawback of this approach is that the
+kerning around small capital letters will be based on the scaled
+kern amounts of the capital letters rather than on the kern pairs
+from the real small caps font.
+
+Finally, the most promising approach of all these options would be
+to combine the glyphs from standard and expert fonts with kern pairs
+from the real small caps fonts. The current version of |\latinfamily|
+does not implement this, but it would be a worthwhile approach, and
+advanced \package{fontinst} users are encouraged to attempt it. The
+file \texttt{csckrn2x.tex} (a variant of \texttt{csc2x.tex}, which is
+mentioned in Subsection~\ref{Ssec:Des:Reglyph}) should come in handy
+for this.
+
+
+\subsection{\package{fontinst} variables}
+
+The following is a list of the \package{fontinst} variables that are
+accessible for the user through the |\set|\textellipsis,
+|\reset|\textellipsis, |\unset|\textellipsis, etc.\ commands. You may
+of course set or use other variables in the MTX and ETX files you
+write yourself, as does for example the standard MTX file
+\texttt{latin.mtx}, but all variables that \package{fontinst} commands
+implicitly use or set are listed below.
+
+\begin{list}{}{%
+ \setlength\labelwidth{0pt}%
+ \setlength\itemindent{-\leftmargin}%
+ \setlength\parsep{0pt}
+ \def\makelabel#1{\hspace\labelsep \normalfont\ttfamily #1}%
+}
+ \item[acccapheight] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The height of accented full capitals.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[address] (string)
+ \begin{smalldes}
+ \item[Description] Snailmail address put in \BibTeX-style file
+ header of automatically generated ENC files. No
+ \texttt{address} field is written unless the \texttt{address}
+ string is set. Quotes are not automatically inserted around
+ the \texttt{address} string.
+ \item[Set by] ETX files.
+ \item[Used by] The ETX-to-ENC converter.
+ \end{smalldes}
+ \item[afm-name] (string)
+ \begin{smalldes}
+ \item[Description] Name of source font. Internal variable.
+ \item[Set by] |\from|\dots\ commands.
+ \item[Used by] The |\transform|\-|font|, |\install|\-|font|,
+ |\install|\-|raw|\-|font|, and |\reglyph|\-|font| commands.
+ \end{smalldes}
+ \item[ascender] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The ascender height of the font.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this integer.
+ \item[Used by] Some MTX and ETX files.
+ \end{smalldes}
+ \item[author] (string)
+ \begin{smalldes}
+ \item[Description] Author name(s) put in \BibTeX-style file
+ header of automatically generated ENC files. See the macro
+ |\ref_to_sourcefile| for more details.
+ \item[Set by] ETX files.
+ \item[Used by] The ETX-to-ENC converter. When not set, the
+ value \texttt{"See file }\meta{etx name}\texttt{"} is used
+ instead.
+ \end{smalldes}
+ \item[\cs{autoinstallfamily}] (command)
+ \begin{smalldes}
+ \item[Description] Command called by the font installation
+ commands, as
+ \begin{quote}
+ |\autoinstallfamily|\marg{encoding}\marg{family}
+ \end{quote}
+ when they are asked to install a font with a combination of
+ \meta{encoding} and \meta{family} that has not been seen
+ before (there was no explicit |\installfamily|).
+ \item[Set by] Explicit commands. Defaults to calling
+ |\installfamily|.
+ \item[Used by] Font installation commands.
+ \end{smalldes}
+ \item[axisheight] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{22}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[baselineskip] (integer denoting length)
+ \begin{smalldes}
+ \item[Description]
+ The font designer's recommendation for natural length of the
+ \TeX\ parameter |\baselineskip|.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[bigopspacing1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{9}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[bigopspacing2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{10}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[bigopspacing3] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{11}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[bigopspacing4] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{12}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[bigopspacing5] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{13}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[capheight] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The height of the font's full capitals.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this variable.
+ \item[Used by] Some MTX and ETX files.
+ \end{smalldes}
+ \item[codingscheme] (string)
+ \begin{smalldes}
+ \item[Description] The codingscheme name.
+ \item[Set by] ETX files.
+ \item[Used by] The (V)PL writer. When not set, the
+ value \texttt{UNKNOWN} is used instead.
+ \end{smalldes}
+ \item[defaultrulethickness] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\xi\sb{8}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[delim1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{20}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[delim2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{21}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[denom1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{11}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[denom2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{12}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[descender] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The depth of lower case letters with descenders.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[descender_neg] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The vertical position of the descender line
+ of the font, i.e., the negative of the font's descender depth.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this variable.
+ \item[Used by] Some MTX and ETX files.
+ \end{smalldes}
+ \item[designsize] (dimension)
+ \begin{smalldes}
+ \item[Description] The design size of the font.
+ \item[Set by] MTX files. The (V)PL-to-MTX converter usually writes
+ |\setdim| commands for this variable.
+ \item[Used by] The (V)PL writer. The design size defaults to
+ $10\,\mathrm{pt}$ if this variable is not set.
+ \item[Note] The value of this variable has no effect on how
+ the font is declared to \LaTeX.
+ \end{smalldes}
+ \item[designunits] (dimension denoting a real number)
+ \begin{smalldes}
+ \item[Description] The design size of a font expressed in the
+ design unit used in a (V)PL file.
+ \item[Set by] MTX files. The (V)PL-to-MTX converter usually writes
+ |\setdim| commands for this variable.
+ \item[Used by] Nothing. If this variable is set, but to any
+ value other than $1\,\mathrm{pt}$, then some metrics are most
+ likely wrong.
+ \end{smalldes}
+ \item[digitwidth] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The median width of the digits in the font.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[email] (string)
+ \begin{smalldes}
+ \item[Description] Email address put in \BibTeX-style file
+ header of automatically generated ENC files. See the macro
+ |\ref_to_sourcefile| for more details.
+ \item[Set by] ETX files.
+ \item[Used by] The ETX-to-ENC converter. When not set, the
+ value \texttt{"See file }\meta{etx name}\texttt{"} is used
+ instead.
+ \end{smalldes}
+ \item[encodingname] (string)
+ \begin{smalldes}
+ \item[Description] The name by which the encoding in question is
+ made known to a Postscript interpreter.
+ \item[Set by] ETX files.
+ \item[Used by] The ETX-to-ENC converter. When not set, the
+ value |fontinst-|\nolinebreak[1]|autoenc-|\nolinebreak[1]%
+ \meta{etx name} is used instead.
+ \end{smalldes}
+ \item[etx-name] (string)
+ \begin{smalldes}
+ \item[Description] Name of ETX file. Internal variable in
+ |\transform|\-|font|.
+ \item[Set by] The |\reencodefont| command.
+ \item[Used by] The |\mtxtomtx| command.
+ \end{smalldes}
+ \item[extraspace] (integer denoting length)
+ \begin{smalldes}
+ \item[Description]
+ The natural width of extra interword glue at the end of a
+ sentence.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[fontdimen($n$)] (integer)
+ \begin{smalldes}
+ \item[Description] Family of semi-internal variables that store
+ the values to use for font dimension $n$. It is preferred
+ that the newer |\set|\-|font|\-|dimen| interface is used for
+ setting these values.
+ \item[Set by] ETX files.
+ \item[Used by] The (V)PL writer.
+ \end{smalldes}
+ \item[\cs{iftokeep}] (macro)
+ \begin{smalldes}
+ \item[Description] |\iftokeep|\,\#1\,|\then|, where \#1 will
+ be a \meta{number}, behaves like a switch and decides whether
+ a glyph is kept or not while reglyphing.
+ \item[Set by] Explicit commands. Defaults to
+ $$
+ \mbox{\cs{iftokeep}\,\#1\,\cs{then}} \mapsto
+ \mbox{\cs{ifnum}\,\texttt{-1<}\#1}
+ $$
+ \item[Used by] The |\reglyphfont| command.
+ \end{smalldes}
+ \item[interword] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The natural width of interword glue (spaces).
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[italicslant] (integer denoting factor)
+ \begin{smalldes}
+ \item[Description] The italic slant of a font.
+ \item[Set by] MTX files generated from AFM or (V)PL files. MTX
+ files generated by |\transformfont|. Locally in the AFM-to-MTX
+ converter for possible use in |\uprightitalcorr| or
+ |\slanteditalcorr|.
+ \item[Used by] MTX files (\texttt{latin.mtx} and the like). ETX
+ files (for determining \texttt{fontdimen(1)}).
+ \end{smalldes}
+ \item[killweight] (integer)
+ \begin{smalldes}
+ \item[Description] Weight for glyphs that are killed.
+ \item[Set by] Explicit commands. Defaults to $-10$ if not set.
+ \item[Used by] The |\kill|\-|glyph| command; indirectly
+ the |\reglyphfont| command.
+ \end{smalldes}
+ \item[letterspacing] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Extra width added to all glyphs of a font.
+ \item[Set by] ETX or MTX files.
+ \item[Used by] The (V)PL writer. Defaults to $0$ if not set.
+ \end{smalldes}
+ \item[maxdepth] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The maximal depth over all slots in the font.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[maxdepth_neg] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The negative of the maximal depth of a glyph in
+ the font.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this variable.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[maxheight] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The maximal height of a glyph in the font.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this variable.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[minimumkern] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Kerns whose size in absolute value is less
+ than or equal to this variable are ignored.
+ \item[Set by] \package{fontinst} command files or MTX files.
+ \item[Used by] The AFM-to-MTX converter and the (V)PL file
+ generator. When not set, the value $0$ is used instead.
+ \end{smalldes}
+ \item[monowidth] (flag integer)
+ \begin{smalldes}
+ \item[Description] Set if this font is monowidth, unset otherwise.
+ \item[Set by] MTX files. The AFM-to-MTX converter writes a
+ |\setint| command for this variable if the AFM specifies
+ \texttt{IsFixedPitch true}.
+ \item[Used by] Some MTX files (\texttt{latin.mtx} and the like),
+ ETX files.
+ \end{smalldes}
+ \item[num1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{8}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[num2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{9}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[num3] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{10}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[quad] (integer denoting length)
+ \begin{smalldes}
+ \item[Description]
+ The quad width of the font, normally approximately equal to
+ the font size and\slash or the width of an `M'.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[PSfontsuffix] (string)
+ \begin{smalldes}
+ \item[Description] Suffix added to font names to form name of
+ file to download to include font.
+ \item[Set by] Explicit commands in \textsf{finstmsc} command
+ files. Defaults to `\texttt{.pfa}'.
+ \item[Used by] The map file fragments writer.
+ \end{smalldes}
+ \item[rawscale] (integer denoting factor)
+ \begin{smalldes}
+ \item[Description] Scaling factor applied to raw glyphs.
+ \item[Set by] The |\installfont| command (\texttt{scaled}
+ clauses in argument \#2). Unset for metric files listed
+ without a \texttt{scaled} clause.
+ \item[Used by] The |\set|\-|raw|\-|glyph|,
+ |\set|\-|not|\-|glyph|, |\set|\-|scaled|\-|raw|\-|glyph|,
+ |\set|\-|scaled|\-|not|\-|glyph|, |\set|\-|kern|, and
+ |\reset|\-|kern| commands.
+ \end{smalldes}
+ \item[renameweight] (integer)
+ \begin{smalldes}
+ \item[Description] Weight for glyphs that are renamed.
+ \item[Set by] Explicit commands. Defaults to $1$ if not set.
+ \item[Used by] The |\rename|\-|glyph| command; indirectly
+ the |\reglyphfont| command.
+ \end{smalldes}
+ \item[requireglyphs] (flag integer)
+ \begin{smalldes}
+ \item[Description] Set if warnings are to be generated for
+ glyphs listed in ETX files but not present in the glyph
+ base.
+ \item[Set by] Explicit commands. By defaults not set.
+ \item[Used by] The (V)PL file generator.
+ \end{smalldes}
+ \item[rightboundary] (string)
+ \begin{smalldes}
+ \item[Description] The name of a glyph with the property that
+ kerns on the left may be intended as right word boundary kerns.
+ \item[Set by] MTX files. The (V)PL-to-MTX converter can write
+ |\setstr| commands for this variable.
+ \item[Used by] Some MTX files.
+ \end{smalldes}
+ \item[shrinkword] (integer denoting length)
+ \begin{smalldes}
+ \item[Description]
+ The (finite) shrink component of interword glue.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[slant-scale] (integer denoting factor)
+ \begin{smalldes}
+ \item[Description] Factor to slant by.
+ Internal variable in |\transform|\-|font|.
+ \item[Set by] The |\slant|\-|font|, |\xscale|\-|font|, and
+ |\scale|\-|font| commands.
+ \item[Used by] The |\mtxtomtx| command.
+ \end{smalldes}
+ \item[\cs{SlantAmount}] (macro expanding to an integer expression)
+ \begin{smalldes}
+ \item[Description] Slant factor used for faking oblique shape.
+ \item[Set by] Explicit commands. Defaults to \texttt{167}.
+ \item[Used by] The |\latinfamily| command.
+ \end{smalldes}
+ \item[\cs{slanteditalcorr}]
+ (macro expanding to an integer expression)
+ \begin{smalldes}
+ \item[Description] The integer expression used to calculate a
+ guess for the italic correction of glyphs in a font with
+ positive slant. It has the syntax
+ \begin{quote}
+ \cs{slanteditalcorr}\marg{width}\marg{left}\marg{right}^^A
+ \marg{bottom}\marg{top}
+ \end{quote}
+ where \meta{width} is the glyph's advance width, and the
+ remaining arguments are coordinates of sides of the glyph's
+ bounding box. The \texttt{italicslant} integer provides the
+ italic slant of the font.
+ \item[Set by] Explicit commands in \textsf{fontinst} command
+ files. Defaults to $\max\{0, \mathit{right}-\mathit{width}\}$.
+ \item[Used by] The AFM-to-MTX converter.
+ \end{smalldes}
+ \item[stretchword] (integer denoting length)
+ \begin{smalldes}
+ \item[Description]
+ The (finite) stretch component of interword glue.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[sub1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{16}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[sub2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{17}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[subdrop] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{19}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[sup1] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{13}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[sup2] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{14}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[sup3] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{15}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[supdrop] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Math formula parameter $\sigma\sb{18}$.
+ \item[Set by] MTX files.
+ \item[Used by] Some ETX and MTX files.
+ \end{smalldes}
+ \item[TFMfileprefix] (string)
+ \begin{smalldes}
+ \item[Description] Prefix (typically a path) added to names of
+ TFM files.
+ \item[Set by] Explicit commands in \textsf{finstmsc} command
+ files. By default not set, which is equivalent to being empty.
+ \item[Used by] The \textsf{PLtoTF} ``map file fragments writer''.
+ \end{smalldes}
+ \item[underlinethickness] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The recommended thickness of an underlining
+ rule.
+ \item[Set by] MTX files. The AFM-to-MTX converter usually writes
+ |\setint| commands for this variable.
+ \item[Used by] Some MTX files (\texttt{latin.mtx} and the like).
+ \end{smalldes}
+ \item[\cs{uprightitalcorr}]
+ (macro expanding to an integer expression)
+ \begin{smalldes}
+ \item[Description] The integer expression used to calculate a
+ guess for the italic correction of glyphs in a font with
+ non-positive slant. It has the syntax
+ \begin{quote}
+ \cs{uprightitalcorr}\marg{width}\marg{left}\marg{right}^^A
+ \marg{bottom}\marg{top}
+ \end{quote}
+ where \meta{width} is the glyph's advance width, and the
+ remaining arguments are coordinates of sides of the glyph's
+ bounding box. The \texttt{italicslant} integer provides the
+ italic slant of the font.
+ \item[Set by] Explicit commands in \textsf{fontinst} command
+ files. Defaults to $0$.
+ \item[Used by] The AFM-to-MTX converter.
+ \end{smalldes}
+ \item[version] (string)
+ \begin{smalldes}
+ \item[Description] Version number put in \BibTeX-style file
+ header of automatically generated ENC files. See the macro
+ |\ref_to_sourcefile| for more details.
+ \item[Set by] ETX files.
+ \item[Used by] The ETX-to-ENC converter. When not set, the
+ value \texttt{"See file }\meta{etx name}\texttt{"} is used
+ instead.
+ \end{smalldes}
+ \item[verticalstem] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The dominant width of vertical stems
+ (usually the width of stems of lower case letters).
+ \item[Set by] MTX files. The AFM-to-MTX converter writes
+ |\setint| commands for this variable if the AFM file specifies
+ \texttt{StdVW}.
+ \item[Used by] Currently nothing.
+ \end{smalldes}
+ \item[\texttt{warningspecials}] (switch)
+ \begin{smalldes}
+ \item[Description] Controls whether |\glyphwarning| commands
+ will generate VPL \texttt{SPECIAL}s. Defaults to `true'.
+ \item[Set by] Explicit commands (|\warningspecialstrue| and
+ |\warningspecialsfalse|).
+ \item[Used by] The (V)PL file generator.
+ \end{smalldes}
+ \item[x-scale] (integer denoting factor)
+ \begin{smalldes}
+ \item[Description] Horizontal scaling factor.
+ Internal variable in |\transform|\-|font|.
+ \item[Set by] The |\xscale|\-|font| and |\scale|\-|font| commands.
+ \item[Used by] The |\mtxtomtx| command.
+ \end{smalldes}
+ \item[xheight] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] The x-height of the font.
+ \item[Set by] MTX files. The AFM-to-MTX and (V)PL-to-MTX
+ converters usually write |\setint| commands for this variable.
+ \item[Used by] MTX files, and ETX files (for determining
+ \texttt{fontdimen(5)}).
+ \end{smalldes}
+ \item[y-scale] (integer denoting factor)
+ \begin{smalldes}
+ \item[Description] Vertical scaling factor.
+ Internal variable in |\transform|\-|font|.
+ \item[Set by] The |\yscale|\-|font| and |\scale|\-|font| commands.
+ \item[Used by] The |\mtxtomtx| command.
+ \end{smalldes}
+ \item[\meta{\rmfamily glyph}-spacing] (integer denoting length)
+ \begin{smalldes}
+ \item[Description] Glyph-specific override for
+ \texttt{letterspacing}; extra width added to the glyph
+ \meta{glyph} as part of the process of writing a VPL
+ file.
+ \item[Set by] ETX or MTX files.
+ \item[Used by] The (V)PL writer. Defaults to $0$ if not set.
+ \end{smalldes}
+\end{list}
+Besides these, the |\latinfamily| command provides a whole range of
+parameters that are often used somewhat like variables. That subject
+does however deserve to be treated separately.
+
+
+\section{\package{fontdoc} package overview}
+
+The purpose of the \package{fontdoc} package is to support
+typesetting of \texttt{.etx} and \texttt{.mtx} files intended
+for use with \package{fontinst}.
+The typical format of these files looks something like this:
+\begin{quote}
+ |\relax|\\
+ |\documentclass[twocolumn]{article}|\\
+ |\usepackage{fontdoc}|\\[0.5\baselineskip]
+ |\begin{document}|\\
+ {}~~\textit{\LaTeX\ commands}\\
+ |\encoding| or |\metrics| \\
+ {}~~\textit{\package{fontinst} commands}\\
+ |\endencoding| or |\endmetrics|\\
+ {}~~\textit{\LaTeX\ commands}\\
+ |\end{document}|
+\end{quote}
+To make it work, \package{fontdoc} has to define all the user-level
+\package{fontinst} commands in terms of typesetting instructions. This
+goal is currently only partially achieved, but the percentage of
+\package{fontinst} commands covered by \package{fontdoc} is still
+fairly large, so it is our impression that problems with commands not
+covered occur only very rarely.
+
+
+\subsection{Some \package{fontdoc} commands that \package{fontinst}
+ doesn't know}
+
+Some of the commands defined by \package{fontdoc} are not defined by
+\package{fontinst} because they have no meaning in that context.
+Most of these commands are lower-level commands that are used in the
+implementations of commands common to \package{fontinst} and
+\package{fontdoc}, but a few are simply only meant to be used in the
+parts of ETX and MTX files that \package{fontinst} never executes.
+
+With v\,1.916 the mechanism for formatting integer expressions changed
+dramatically. The new base command to use is
+\DescribeMacro{\TypesetIntegerExpression}|\Typeset|\-|Integer|\-%
+|Expression|, which takes as its only argument the integer expression
+to format and typesets it. |\Typeset|\-|Integer|\-|Expression| expects
+to be used in math mode only. A similar command is
+\DescribeMacro{\TypesetStringExpression}|\Typeset|\-|String|\-%
+|Expression|, which takes a string expression as argument, formats,
+and typesets it. |\Typeset|\-|String|\-|Expression| can be used in any
+mode.
+
+The \DescribeMacro{\macroparameter}|\macroparameter| command is (in
+integer and string expressions) understood as a ``placeholder for a
+macro parameter''. This is primarily useful in comments that describe
+a user-defined macro; see \texttt{ltcmds.mtx} for examples.
+
+
+
+% \part*{Implementation}
+% \addcontentsline{toc}{part}{Implementation}
+
+\changes{1.800}{1998/06/22}{\texttt{fontinst.sty} and
+ \texttt{fontdoc.sty} now generated from \texttt{fontinst.dtx}. (UV)}
+\changes{1.900}{1999/02/05}{\texttt{fontinst.dtx} split into several
+ source files. (LH)}
+\changes{1.902}{1999/04/18}{Fixed some silly markup. (LH)}
+
+\DocInclude{fibasics}
+\DocInclude{ficommon}
+\DocInclude{fimain}
+\DocInclude{ficonv}
+\DocInclude{filtfam}
+\DocInclude{fimapgen}
+
+\PrintIndex
+\pagestyle{plain}\tracingmacros=2\tracingcommands=2
+\PrintChanges
+\tracingcommands=0\tracingmacros=0
+
+\clearpage
+\appendix
+\part*{Internal notes}
+\addcontentsline{toc}{part}{Internal notes}
+
+
+\section{Typographic treatment}
+
+\begin{itemize}
+ \item
+ I have been following \emph{The \LaTeX\ Companion} in that I have
+ set all names of packages and the like---\package{fontinst},
+ \package{fontdoc}, \package{trig}, \package{doc}, and
+ \package{docstrip} (I might have forgotten some)---in sans serif
+ type. Actually, I have defined a command |\package| in
+ \texttt{fisource.sty} (or is that \package{fisource}?) which does
+ this, so if we decide on some other formatting, we can just change
+ that. /LH
+ \item
+ It seems to me that there should indeed be some space between the
+ `v' and the digits in a version number when it is typeset, but I
+ also think a full space is too much, so I have been using thin
+ spaces. These are unbreakable and under \LaTeX\ you can simply use
+ |\,| to get one (while you are not in math mode, that is). /LH
+ \item
+ While I went through (some of) the code, I came across a few
+ inconsistencies. \ambiguity{I have marked them out like this%
+ \offindex}---some boldfaced text in a paragraph and a large A
+ in the margin. I defined a command |\ambiguity| for doing this. /LH
+ \item
+ There is also a similar command |\question| which is intended for
+ situations where there isn't really an error, but something seems
+ like it should be taken care of in some other way. \question{The
+ \cs{question} command puts a question mark in the margin.%
+ \offindex}
+ \item
+ I also noticed that there are several \package{fontinst} commands,
+ not all of which are new, which are not defined in \package{fontdoc}.
+ {\offindex\missing{doc}{\foo}}To mark out such things, I have
+ written things like the one shown in the margin by this paragraph.
+ I defined a command |\missing| for doing this. /LH
+\end{itemize}
+
+
+\section{Planning topics}
+
+This section lists items in the larger design of \package{fontinst}
+which need to be resolved in one way or another. Debates about these
+items on the fontinst mailing list are welcome.
+
+
+\subsection{Reorganisation of the source}
+
+At the moment, all the ideas suggested have been realized.
+% \begin{itemize}
+% \item
+% How about moving the first section of \texttt{fimain.dtx} to
+% \texttt{fibasics.dtx}? /LH
+% \item
+% How about extracting the code which has to do with file
+% conversions (Sections~\ref{Sec:Conv. input},
+% \ref{Sec:Font.trans}, and Subsection~\ref{Ssec:MTX->PL}) from
+% \texttt{fimain.dtx} and put it in a file of its own
+% (\texttt{ficonv.dtx}, say)? /LH
+% \end{itemize}
+
+
+\subsection{Files}
+
+Which files should be considered temporary and placed in the location
+specified with |\tempfileprefix|? Should files be explicitly be looked
+for at this location or should it be assumed that fontinst users
+include that location in their \TeX\ input file search path? In the
+former case, \emph{which} files should be looked for in that
+location? Should files be looked for in the temporary location before
+they are looked for without a specified location, or should it be the
+other way round?
+
+
+
+
+
+\section{Contributors}
+
+[The \package{fontinst} source has been pretty inconsistent in how
+people are credited for what they have done---some appear only as
+acronyms while others appear as rather striking e-mail addresses---so
+I thought it best that this is shaped up a bit. My suggestion is that
+we use names or acronyms in the source and move everything else here.
+I also thought it could be interesting with a short description of
+what each person has done and is doing, so I have started ever so
+slightly on something along those lines. Feel free to add things! /LH]
+
+\medskip
+
+The following people have contributed substantial amounts of code or
+documentation to \package{fontinst}. They are listed in strict
+alphabetical order.
+
+\begin{description}
+ \item[Thierry Bouche]
+ Thierry saw to that the \texttt{T1} encoded fonts got font
+ dimensions comparable to the \texttt{ec} fonts. Thierry is also
+ the author of several papers (published in the \textit{Cahiers
+ GUTenberg} and \textit{TUGboat}) which deal with non-trivial
+ applications of \package{fontinst}, such as creating metrics for
+ Adobe Minion Multiple Master fonts and developing a corresponding
+ math font setup.
+
+ E-mail: \texttt{Thierry.Bouche@ujf-grenoble.fr}
+
+ \item[Lars Hellstr\"om (LH)]
+ Lars is responsible for most of the things in v\,1.9 that were
+ not there in v\,1.8.
+
+ Lars is currently a member of the \package{fontinst}
+ maintenance team. He is also a Ph.D.\ in mathematics looking for
+ employment.
+
+ \item[Alan Jeffrey (ASAJ)]
+ Alan is the original author of \package{fontinst}. He is not
+ currently on the development team, but he is still managing the
+ \package{fontinst} mailing list.
+
+ E-mail (\package{fontinst} mailing list subscriptions):%
+ \nobreak\hfill\penalty0\hskip -2em plus -1fill\ \relax
+ \vadjust{}\nobreak\hskip 2em\relax
+ \texttt{fontinst-request@cogs.susx.ac.uk}.
+
+ \item[Constantin Kahn (CK)]
+ Constantin is one (Sebastian is the other) of the original coauthors
+ of the current |\latinfamily| command.
+ % \footnote{Am I right about this? It's a bit before my time,
+ % I've just read \texttt{CHANGES}. /LH}
+
+ \item[Rowland McDonnell]
+ Rowland rewrote Alan's old v\,1.5 documentation for
+ \package{fontinst} and updated it for v\,1.8.
+
+ \item[Sebastian Rahtz (SPQR)]
+ Sebastian is one (Constantin is the other) of the original coauthors
+ of the current |\latinfamily| command. He has also contributed
+ numerous ETX files and made the ``unofficial'' v\,1.6 and v\,1.7,
+ which included the first \package{fontinst} support for making
+ \texttt{TS1} encoded files.
+
+ \item[Ulrik Vieth (UV)]
+ Ulrik converted \texttt{fontinst.sty} to \package{doc}\slash
+ \package{docstrip} format, reunited Alan's v\,1.511 and
+ Sebastian's v\,1.7, and made the first official release of
+ \package{fontinst} (v\,1.8) for more than two years.
+
+ Ulrik is currently a member of the \package{fontinst}
+ maintenance team. He is also involved in the Joint TUG\slash
+ \LaTeX~3 Project Working Group on extended math font encodings.
+
+ \item[\textellipsis]
+\end{description}
+Anyone else?
+
+
+\section{To do}
+
+This section is based on the \texttt{TODO} file from \package{fontinst}
+v\,1.504, but a couple of new entries have been added and some have
+been equipped with comments.
+
+\subsection{Things to do in the ``near'' future}
+
+\begin{itemize}
+ \item
+ Update documentation. (Lars, knowing he isn't saying anything new)
+
+ \item
+ Rewrite the entire substitution mechanism from scratch! The main
+ problem with the current mechanism is that it only allows one
+ substitution per shape and one per series. One cannot substitute
+ the |it| shape for both the |sl| and the |ui| shapes since each
+ new |\substitute|(|noisy|\textbar|silent|) with |it| in the
+ \meta{from} argument will overwrite the setting made by the
+ previous;
+ \begin{quote}
+ |\substitutenoisy{ui}{it}|\\
+ |\substitutesilent{sl}{it}|
+ \end{quote}
+ is effectively the same as
+ \begin{quote}
+ |\substitutesilent{sl}{it}|
+ \end{quote}
+ Another big problem is that it isn't well defined what the
+ substitution mechanism should do. (Lars)
+
+ I've got a sketch for a new substitution mechanism, but I'm not
+ at all sure it will make it into any v\,1.9xx. /LH
+ (The code that was written is now in \texttt{fimain.dtx}, but
+ it's not included in any of the generated files.)
+
+ An alternative to substitutions is to use explicit
+ |\installfontas| commands. This provides complete control. /LH
+
+ \item
+ Consider removing the following unreliable fakes from
+ \texttt{textcomp.mtx}:
+ \begin{quote}
+ \texttt{asciiacutedbl}, \texttt{asciigravedbl},
+ \texttt{bardbl}, \texttt{openbracketleft}, and
+ \texttt{openbracketright}
+ \end{quote}
+ and consider adding fakes for the following unavailable glyphs:
+ \begin{quote}
+ \texttt{dollaroldstyle} (use \texttt{dollar}),
+ \texttt{centoldstyle} (use \texttt{cent}), \texttt{lira} (use
+ \texttt{sterling}), and \texttt{pilcrow} (use
+ \texttt{paragraph})
+ \end{quote}
+ These suggestions are of course open for debate. (Ulrik)
+
+ \item
+ One thing I miss in [the typeset form of an encoding
+ specification] is a simple hex/octal/decimal chart showing all
+ the character names in their positions (and ideally even an
+ example of the printed character, although I know that would be
+ harder). (Karl Berry)
+
+\end{itemize}
+
+
+\subsection{Things that probably won't be done in the near future}
+
+\begin{itemize}
+ \item
+ Find a way to automatically generate math fonts. (Alan)
+
+ I doubt that this will ever be possible to do automatically.
+ \package{mathptm} and \package{mathptmx} are already hackish enough,
+ not to mention the prototype implementations for new math font
+ encodings. /UV
+
+ \item
+ Investigate using Alternate sets. (Alan)
+
+ AFAIK, Thierry Bouche has done some work with alternate sets
+ for AGaramond, ACaslon and Minion, but this implies a lot of
+ manual work to compose the proper calls to \package{fontinst}. /UV
+
+ \item
+ Create \LaTeX\ packages? In fact, rethink the whole package
+ interface \textellipsis\ (Alan)
+
+ Sebastian's Perl front-end to \package{fontinst} does create trivial
+ \LaTeX\ packages automatically for the CTAN fonts. /UV
+
+ \item
+ Worry about excessive kern tables in \texttt{T1} fonts. (Alan)
+
+ I think the best way to get at this would be to write a program
+ that can optimize (for size) kern tables by making use of the |SKIP|
+ instruction. There's often room for quite a lot of compression.
+ Such a program would however have to be written in some compiling
+ language, otherwise it wouldn't be fast enough. /LH
+
+ \item
+ Consider making |\set|(|left|\textbar|right|)|kerning| parameterized
+ by the size of the other glyph, eg so that faking |<Asmall><T>| can
+ be different from |<Aacutesmall><T>|. Suggested by Hilmar Schlegel.
+
+\end{itemize}
+
+
+\subsection{Things that have been done}
+
+\begin{itemize}
+ \item
+ Update documentation (comments from Karl and Damian).
+
+ Rowland has meritoriously done the update requested here. On the
+ other hand, it needs to be updated again, since many new features
+ have been added. /LH
+
+ \item
+ Investigate using raw SC fonts. (Alan)
+
+ This problem comes up on the mailing list from time to time.
+ The problem is that \package{fontinst}'s |\latinfamily| command
+ is geared towards fonts that come with standard and expert font
+ sets (as with Adobe and Monotype fonts) rather than fonts that
+ come with standard and small caps (as with Linotype fonts).
+ I'm afraid it would be to complicated to handle both cases
+ in the same |\latinfamily| procedure. /UV
+
+ \item
+ Investigate problems with duplicate kerns appearing in VPL files
+ (Hilmar Schlegel).
+
+ The problem has been investigated and is solved with v\,1.9. /LH
+
+ \item
+ Find out why, if you have a font with both medium and light variants
+ but no italic, you get |m|/|it| $\mapsto$ |l|/|it| $\mapsto$
+ |l|/|sl| rather than |m|/|it| $\mapsto$ |m|/|sl|.
+ (Sebastian).
+
+ Because for every shape that \package{fontinst} is allowed to use
+ a given font for, it will perform all possible series substitutions.
+ If the |\installfont| for |l|/|sl| came before the |\installfont| for
+ |m|/|sl|, then substitutions will be as described above. See also
+ item about the substitution mechanism. /LH
+
+ \item
+ AFM files can contain real units, not just integers. (Gintautas
+ Grigelionis).
+
+ This is fixed with v\,1.9. /LH
+
+ \item
+ Make \texttt{fontdoc.sty} and co.\ use PS fonts. (Alan)
+
+ I think |\useexamplefont| and friends (introduced with v\,1.8)
+ pretty much do what was intended here. /LH
+
+ \item
+ \texttt{latin.mtx} uses \package{fontinst} rather than
+ \package{fontdoc}! (Rob Hutchings).
+
+ \item
+ Allow |.vpl| files to be read as |.pl| files. (Constantin)
+
+ \item
+ Richard Walker reports that if you say
+ \begin{quote}
+ |\latinfamily{mbvx}{}|\\
+ |\latinfamily{mbv9}{}|
+ \end{quote}
+ then the 2nd run doesn't use old-style digits, because the 1st run
+ has already defined |\digit|. If so, this is because |\latinfamily|
+ is missing a bracing level. I should investigate.
+
+ I think it is best to do oldstyle and non-oldstyle variants in two
+ separate fontinst runs, i.e. don't use |\latinfamily| more than once
+ in a single run. (IIRC, grouping doesn't work properly since
+ every single font closes and reopens a |\begingroup|-|\endgroup|
+ pair to encapsulate the kerning info\footnote{And glyph metrics
+ info, and glyph mapcommands info \textellipsis /LH} or something
+ like that.) /UV
+
+ \item
+ Consider writing an |\installfontas| command which doesn't
+ generate a (V)PL but makes an entry in the FD file.
+ Typical usage: Install an \texttt{sc} shape of a \texttt{TS1}
+ font family by using the font made for the \texttt{n} shape.
+ (Lars)
+
+ Done. The described installation for the \texttt{m} series of the
+ \texttt{ptm} font family can be done through
+ \begin{quote}
+ |\installfontas{ptmr8c}{TS1}{ptm}{m}{sc}{}|
+ \end{quote}
+ Note however that you need to do it in each series explicitly. /LH
+
+ \item
+ Use the \texttt{StdVW} property from AFM 4.0 files instead of the
+ width of \textit{I} for standard stem fontdimen. Pointed out by
+ Hilmar Schlegel.
+
+ Partially done. |\afmtomtx| writes a
+ |\setint{verticalstem}|\marg{value} when it encounters a
+ \texttt{StdVW} property. The ETX files have not yet (2000/05/30)
+ been changed to use this value. /LH
+
+ \item
+ \package{fontdoc} has a problem with glyph, integer, string,
+ etc.\ names that contains underscores, since these will cause
+ \TeX\ to jump to math mode when one tries to typeset these things.
+ Unfortunately \package{fontinst} itself writes two such integers:
+ \texttt{descender_neg} and \texttt{maxdepth_neg}. There are at
+ least three solutions to this. The first is to make underscore an
+ `other' character throughout, but this might break some comments in
+ MTX and ETX files. The second is to temporarily change the catcode
+ in the arguments of the commands, but that will complicate the
+ definitions of almost all \package{fontdoc} commands dramatically.
+ The third is to declare this as unsupported by \package{fontdoc} and
+ change \package{fontinst} so that the troublesome integers are
+ renamed, e.g.\ \texttt{descender-neg} and \texttt{maxdepth-neg}, but
+ this can break people's code. (Lars)
+
+ After thinking about it for a couple of months, I realized that
+ none of the above is the right solution. That is instead to use
+ something similar to the harmless character strings of the
+ \package{xdoc} package when typesetting names of variables etc.\
+ in \package{fontdoc}. This got implemented in v\,1.916. /LH
+
+ \item
+ Modify the (V)PL-to-MTX converter so that |\setint|\discretionary
+ {}{}{}|{fontdimen(|\meta{n}|)}|\discretionary{}{}{}|{\int|%
+ \marg{name}|}| commands in the ETX file declare that
+ \texttt{PARAMETER} (or equivalent) properties for fontdimen
+ \meta{n} should be converted to |\setint| commands for the integer
+ \meta{name}. This ought to be particularly useful for math fonts.
+ (Lars)
+
+ Done with v\,1.917, but only for the new \cs{setfontdimen}
+ command. /LH
+
+ \item
+ Update \texttt{fontdoc.sty} and co.\ for \LaTeXe. (Alan)
+
+ \texttt{fontdoc.sty} underwent a major overhaul from v\,1.916 on,
+ so I suspect this can be said to have been done now. The basic
+ vertical spacing put in by \cs{Aheading} and \cs{Bheading} may
+ however need more work; sometimes it doesn't come out as one
+ would want it to. /LH
+
+ \item
+ \texttt{latin.mtx} fakes composite SC glyphs [kerning?] from the
+ composite glyph, eg.
+ \begin{quote}
+ |\setleftrightkerning{Aacutesmall}{Aacute}{900}|,
+ \end{quote}
+ rather than from the SC non-composite, eg.
+ \begin{quote}
+ |\setleftrightkerning{Aacutesmall}{Asmall}{1000}|
+ \end{quote}
+ This may cause problems with SC fonts with explicit SC--C kerns,
+ eg.
+ \begin{quote}
+ |\setkern{V}{Asmall}{100}|
+ \end{quote}
+ This needs to be thought about. Pointed out by Hilmar Schlegel.
+
+ \texttt{newlatin.mtx} does this right; shrunk glyphs get shrunk
+ kerning, whereas constructed glyphs get kerning from the base
+ letter. /LH
+
+\end{itemize}
+
+
+\subsection{Other notes}
+
+Alan's \texttt{TODO} file also contains some items regarding
+\package{mathptm}, but that seems to have migrated out of
+\package{fontinst} (if it ever really was a part). The problem is that
+\package{mathptm} cannot be changed any more for the sake of checksum
+consistency and backwards compatibility. A new variant called
+\package{mathptmx} tries to do a little better, but there may still be
+room for improvements.
+
+
+
+\section{Efficiency}
+
+This section records the results of some (rather simple) test runs
+that have been made to test the efficiency of \package{fontinst},
+primarily to see how changes in the implementation affect efficiency
+by comparing the time and space used by different \package{fontinst}
+versions to complete the same task.
+
+
+\subsection{Alan Jeffrey's tests}
+\label{Ssec: ASAJ tests}
+
+I compared the version where you try to keep ints as |\mathchardef|s
+with the version where you don't bother, and for a sample font without
+|\mathchardef|s I got:
+\begin{quote}
+ 114673 words of memory out of 150001\\
+ Time elapsed: 135.0 seconds
+\end{quote}
+and with, I got:
+\begin{quote}
+ 114050 words of memory out of 150001\\
+ Time elapsed: 134.5 seconds
+\end{quote}
+so I've saved a little memory and time. Not brilliant, but I may as
+well keep it in.
+
+Where possible, we avoid re-scaling kerns, which saves a bit of time
+and memory. With a sample font, the version where we didn't avoid
+re-scaling used:
+\begin{quote}
+ 114050 words of memory out of 150001\\
+ Time elapsed: 134.5 seconds
+\end{quote}
+whereas the version where we do avoid it used:
+\begin{quote}
+ 113786 words of memory out of 150001\\
+ Time elapsed: 124.9 seconds
+\end{quote}
+
+We keep the names of the glyphs to kern with as |\l-|\meta{name} and
+|\r-|\meta{name} to save on token space, and this got the resources
+used down to:
+\begin{quote}
+ 88574 words of memory out of 150001\\
+ Time elapsed: 106.1 seconds
+\end{quote}
+Keeping track of the kern amounts as |\|\meta{amount} got the resources
+used down to:
+\begin{quote}
+ 75424 words of memory out of 150001\\
+ Time elapsed: 97.2 seconds
+\end{quote}
+Mind you, I then added all the |\transformfont| stuff, and it went
+back to:
+\begin{quote}
+ 77079 words of memory out of 150001\\
+ Time elapsed: 97.7 seconds
+\end{quote}
+
+
+
+\subsection{Current tests}
+
+The setup for this test is that \TeX\ is run on a \texttt{.tex} file
+consisting of the following commands.
+\begin{quote}
+ |\batchmode|\\
+ |\input fontinst.sty|\\
+ |\latinfamily{pad}{}|\\
+ |\tracingstats=1\bye|
+\end{quote}
+All the font metrics are generated from the AFM files; temporary MTX,
+PL, and VPL files are deleted between test runs. The format used was
+generated by typing |\dump| at ini\TeX's |**| prompt; thus there is no
+overhead from a typesetting format in the space requirements.
+
+[It appears the exact data from these tests will have to wait, since
+I haven't been able to get access to any computer with reliable
+process timing. For the next release perhaps \textellipsis\ /LH]
+
+% The \TeX\ version used is \TeX~3.14159. The \TeX\ implementation used
+% is te\TeX~0.9 (Web2C~7.2), running on a
+%
+% The \emph{input sources} figure lists how many items are used on
+% \TeX's stack for simultaneous input sources. As an input source in
+% this context is considered not only input files, but also (and mainly)
+% various token lists. Most of these token lists are replacement texts
+% and parameters of macros, but token list items on this stack also come
+% from expansions of |\the| (not only when applied to a |\toks| register)
+% and the like. The input source stack sizes of normal \TeX\
+% implementations are usually several times larger than what
+% \package{fontinst} uses, so this particular resource shouldn't cause
+% any trouble.
+%
+% The \emph{parameter} figure is the maximal number of macro parameters that
+% \TeX\ has to remember at any one time. The reason this number is
+% greater than 9 is that it counts parameters in \emph{all} macros that
+% are on the input sources stack, not just those in the top one. The
+% same remark about the likelyhood of \TeX\ running out of this resource
+% during a \package{fontinst} run as for input sources applies for
+% parameters.
+%
+% The \emph{buffer characters} stack holds lines read from input files that
+% are partially tokenized (if several files are on the input sources
+% stack then \TeX\ must remember the last line read from each of them) and
+% characters for |\csname| \textellipsis |\endcsname| constructions that
+% are being expanded. This shouldn't cause any trouble either.
+%
+% The \emph{save values} figure is the maximum number of items on \TeX's
+% save stack at any time. \package{fontinst} uses massive amounts of
+% space here (compared to normal \TeX\ documents), but there isn't much
+% that can be done about this since \package{fontinst} uses \TeX's
+% grouping mechanism to clear data for one font from memory before
+% processing begins with the next.
+%
+% The \emph{multiletter control sequences} figure is exactly
+% that---the number of control sequences whose names consist of more than
+% one character. When these become too many, \TeX\ complains that its
+% hash table is full. Some of these control sequences are macros that
+% \package{fontinst} uses in a procedure-like manner, but many of them are
+% rather used as data tables. As a comparision of the figure I might
+% mension that my \LaTeX\ used 3748 multiletter control sequences for
+% typesetting this document, so \package{fontinst} rather average in
+% this respect (perhaps a bit above, but not much).
+%
+% The \emph{strings} figure tells how many items \TeX\ put in its string
+% pool and the \emph{string characters} figure tells how many characters
+% these contain altogether. There are two main categories of things that
+% occur here: names of multiletter control sequences and \TeX's builtin
+% error messages. One thing which certainly doesn't occur here is the
+% texts you save using \package{fontinst}'s |\setstr| command; these will
+% instead become token lists and occupy main memory space (the \emph{names}
+% of string variables will however become part of a control sequence name,
+% so that will be stored as a string). Unlike some other \TeX\
+% implementations however, the Web2C \TeX\ seems to only report new
+% entries in the string pool, so the \emph{strings} and \emph{string
+% characters} figures below do not include the builtin error messages.
+% On the other hand, they don't include the names of the 322 primitive
+% multiletter control sequences either, which is why the figures below
+% report more control sequences than strings.
+%
+% The \emph{main memory}, finally, is where \TeX\ stores almost
+% everything else (I've skipped some of the memory categories \TeX\
+% reports since they are ``only'' used for typesetting), most notably
+% tokens. Each token occupies one word of memory. I don't think
+% \package{fontinst}'s consumption of main memory is that high (in
+% comparision with normal \LaTeX\ jobs) since \package{fontinst} doesn't
+% have to store any boxes here and thus frees space for more tokens.
+%
+% \begin{description}
+% \item[v\,1.801]
+% \consumption{126.68}{%954.9
+% % 5261 strings out of 8681
+% % 54607 string characters out of 136047
+% % 112422 words of memory out of 200001
+% % 3814 multiletter control sequences out of 10000
+% % 8 words of font info for 0 fonts, out of 180000 for 256
+% % 0 hyphenation exceptions out of 2551
+% % 30i,0n,42p,220b,1696s stack positions out of 600i,150n,200p,3000b,4094s
+% 3903 strings out of 13688
+% 42612 string characters out of 101822
+% 112422 words of memory out of 263001
+% 3961 multiletter control sequences out of 10000+0
+% 7 words of font info for 0 fonts, out of 200000 for 1000
+% 0 hyphenation exceptions out of 1000
+% 30i,0n,42p,220b,1770s stack positions out of 300i,100n,500p,30000b,4000s
+% }% Compulsory comment; TeX inserts a & at the end of this line
+% % as a side-effect of the implementation of \consumption.
+% \item[v\,1.902]
+% \consumption{139.59}{%997.4
+% % 6196 strings out of 8681
+% % 69530 string characters out of 136047
+% % 112617 words of memory out of 200001
+% % 4749 multiletter control sequences out of 10000
+% % 8 words of font info for 0 fonts, out of 180000 for 256
+% % 0 hyphenation exceptions out of 2551
+% % 28i,0n,42p,220b,2004s stack positions out of 600i,150n,200p,3000b,4094s
+% 4690 strings out of 13688
+% 52734 string characters out of 101822
+% 112613 words of memory out of 263001
+% 4748 multiletter control sequences out of 10000+0
+% 7 words of font info for 0 fonts, out of 200000 for 1000
+% 0 hyphenation exceptions out of 1000
+% 28i,0n,42p,220b,2000s stack positions out of 300i,100n,500p,30000b,4000s
+% }%
+% Comparing the figures for v\,1.902 with those of v\,1.801, there
+% are mainly three things which are of interest. The first is that
+% the number of items on the save stack have increased quite a lot.
+% Most of this is due to the mechanism by which \package{fontinst}
+% avoids writing multiple kerns to (V)PL files. The second thing to
+% notice is that the number of control sequences has increased quite
+% dramatically (over 20\%). This is to be expected, as a number of
+% new features have been added and the implementation of these
+% features requires many new macros.
+%
+% Some 200 of these new control sequences are however not there
+% because of new features, but because of a silly implementation of
+% how slot numbers for glyphs are stored. In an attempt to save
+% tokens, I (LH) stored these numbers as control sequence names
+% rather than token sequences, just like kern amounts have been
+% stored for some time now. One notable feature of kern
+% amounts is however that although these may assume just about any
+% value you can think of, within any given font family they tend to
+% assume only a handful of values. This means that the number of
+% hash positions occupied by such control sequences is never very
+% large and the storage is efficient. On the other hand, the set of
+% slot numbers that occur usually consists of all integers in the
+% range 0--255, with each slot number occuring in at most one
+% position. This means that the storage method, although efficient
+% in the number of tokens, really squanders space in the hash table.
+% A much better method (which should be implemented, once I get round
+% to it) is to store slot numbers in the character codes of `ordinary'
+% tokens.
+%
+% The third noticable thing is that although the number of macros
+% has grown quite a lot, the amount of main memory used has hardly
+% increased at all! Some of this is probably due to that the ENC to
+% ETX converter was moved to \texttt{finstmsc.sty}, since this
+% consists of only two macros but lots of tokens. Another factor
+% that has probably helped is that |\glyph| now avoids rescaling a
+% glyph by one thousand; this saves 9 tokens for each time
+% |\glyph|\marg{name}|{1000}| gets executed.
+% \item[v\,1.907]
+% \consumption{138.88}{%1019.9
+% % 6226 strings out of 8681
+% % 69918 string characters out of 136047
+% % 113820 words of memory out of 200001
+% % 4779 multiletter control sequences out of 10000
+% % 8 words of font info for 0 fonts, out of 180000 for 256
+% % 0 hyphenation exceptions out of 2551
+% % 28i,0n,42p,220b,2006s stack positions out of 600i,150n,200p,3000b,4094s
+% % 6225 strings out of 8681
+% 4719 strings out of 13688
+% 53105 string characters out of 101822
+% 113814 words of memory out of 263001
+% 4777 multiletter control sequences out of 10000+0
+% 7 words of font info for 0 fonts, out of 200000 for 1000
+% 0 hyphenation exceptions out of 1000
+% 28i,0n,42p,220b,2002s stack positions out of 300i,100n,500p,30000b,4000s
+% }%
+% This is pretty much what could be expected. A couple of new
+% features have been added, so naturally some of the numbers have
+% grown a little.
+% \item[v\,1.908]
+% This version is devoted to optimizing \package{fontinst}.
+%
+% The first idea was to avoid moving the contents of
+% |\glyph_map_commands| and |\glyph_map_fonts| to a macro and back
+% again each time these are updated. This changed the numbers to
+% \consumption{135.64}{%
+% 4719 strings out of 13688
+% 53105 string characters out of 101822
+% 113810 words of memory out of 263001
+% 4777 multiletter control sequences out of 10000+0
+% 7 words of font info for 0 fonts, out of 200000 for 1000
+% 0 hyphenation exceptions out of 1000
+% 28i,0n,42p,220b,2002s stack positions out of 300i,100n,500p,30000b,4000s
+% }%
+% Hence I've earned a few seconds.
+%
+% The next idea is to expand the |\space|s in |\out_lline| and
+% friends when these are defined, instead of expanding them anew
+% each time an output line is written.
+% \item[v\,1.909]
+% \consumption{}{%1159.8 % Ow! It's getting worse.
+% % 6155 strings out of 8681
+% % 68824 string characters out of 136047
+% % 113918 words of memory out of 200001
+% % 4708 multiletter control sequences out of 10000
+% % 8 words of font info for 0 fonts, out of 180000 for 256
+% % 0 hyphenation exceptions out of 2551
+% % 28i,0n,42p,220b,1982s stack positions out of 600i,150n,200p,3000b,4094s
+% }
+% \item[v\,1.910]
+% \consumption{}{%1031.6 % Perhaps not ...
+% % 5949 strings out of 8681
+% % 68261 string characters out of 136047
+% % 113840 words of memory out of 200001
+% % 4502 multiletter control sequences out of 10000
+% % 8 words of font info for 0 fonts, out of 180000 for 256
+% % 0 hyphenation exceptions out of 2551
+% % 28i,0n,42p,220b,1756s stack positions out of 600i,150n,200p,3000b,4094s
+% }
+% \end{description}
+%
+
+
+\begin{thebibliography}{99}
+\bibitem{Fontname}
+ Karl Berry: \textit{Fontname}, CTAN:\discretionary{}{}{}%
+ \texttt{info}\slash \texttt{fontname}\slash \texttt{fontname.texi}
+ (and most of the other files in that directory as well).
+\bibitem{mfnt}
+ Matthias Clasen and Ulrik Vieth:
+ \texttt{mfnt} (their ``work with math fonts''), 1997--8,
+ see \textsc{http}:/\slash \texttt{www.tug.org}\slash
+ \texttt{twg}\slash \texttt{mfg}\slash\texttt{archives}/.
+\bibitem{LaTeX-companion}
+ Michel Goossens, Frank Mittelbach, Alexander Samarin:
+ \textit{The \LaTeX\ Companion},
+ Ad\-di\-son-Wes\-ley, Reading, MA, USA, 1994.
+ % Addison and Wesley are names of two persons, but they
+ % should be joined by a hyphen since Addison-Wesley is
+ % a company name. Tricky that.
+\bibitem{LaTeX-graph-comp}
+ Michel Goossens, Sebastian Rahtz, Frank Mittelbach:
+ \textit{The \LaTeX\ Graphics Companion: Illustrating Documents with
+ \TeX\ and PostScript},
+ Ad\-di\-son-Wes\-ley, Reading, MA, USA, 1997;
+ ISBN~0-201-85469-4.
+\bibitem{TAOCP2}
+ Donald E.\ Knuth: \textit{The art of computer programming},
+ vol.~2 (\textit{Seminumerical algorithms}), 3rd ed.,
+ Ad\-di\-son-Wes\-ley, 1997.
+\bibitem{TeXbook}
+ Donald E.\ Knuth, Duane Bibby (illustrations):
+ \textit{The \TeX book},
+ Ad\-di\-son-Wes\-ley, 1991, ISBN~0-201-13448-9;
+ also volume A of \textit{Computers and typesetting},
+ ISBN~0-201-13447-0.
+\bibitem{fntguide}
+ \LaTeX3 Project Team: \textit{\LaTeXe{} font selection},
+ CTAN: \texttt{macros}\slash
+ \texttt{latex}\slash\texttt{base}\slash\texttt{fntguide.tex}.
+\end{thebibliography}
+
+
+\end{document}
diff --git a/Master/texmf-dist/source/fontinst/base/fontinst.ins b/Master/texmf-dist/source/fontinst/base/fontinst.ins
new file mode 100644
index 00000000000..7916a253328
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/fontinst.ins
@@ -0,0 +1,131 @@
+%
+% Copyright 1998, 1999, 2000, 2001 the fontinst maintenance team and any
+% individual authors listed elsewhere in this file. All rights reserved.
+%
+% This file is part of the fontinst system version 1.9.
+% -----------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+% This file may only be modified if (i) it is given another name and
+% (ii) all files the modified file generates using a nonempty subset
+% of the files listed in the arguments of \from commands below are
+% given the same preamble as that listed between \preamble and
+% \endpreamble below.
+%
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+This is a generated file.
+
+Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+hacked and maintained 1997, 1998 Sebastian Rahtz,
+copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 the fontinst
+maintenance team and any individual authors listed elsewhere in
+this file. All rights reserved.
+
+This file is part of the fontinst system version 1.9.
+-----------------------------------------------------
+
+It may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.1 or, at your option, any later version.
+
+\endpreamble
+
+\declarepreamble\docpreamble
+
+This is a generated file.
+
+Copyright 1993, 1994, 1995, 1996 Alan Jeffrey,
+hacked and maintained 1997, 1998 Sebastian Rahtz,
+copyright 1998, 1999, 2000, 2001 the fontinst maintenance team and any
+individual authors listed elsewhere in this file. All rights reserved.
+
+This file is part of the fontinst system version 1.9.
+-----------------------------------------------------
+
+It may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.1 or, at your option, any later version.
+This file may also be distributed by itself provided it is unchanged
+and accompanied by some prominent file which states the location of
+the sources for the fontinst system, from which this file was
+generated.
+
+\endpreamble
+
+
+
+
+
+\generate{%
+ \usedir{tex/fontinst/base}
+ \file{fontinst.sty}{%
+ \from{fibasics.dtx}{pkg}%
+ \from{ficommon.dtx}{pkg}%
+ \from{fimain.dtx}{pkg}%
+ \from{ficonv.dtx}{pkg}%
+ \from{filtfam.dtx}{pkg,textcomp,debug}%
+ \from{fimapgen.dtx}{pkg}%
+ \from{fibasics.dtx}{pkg2}%
+ }%
+ \file{cfntinst.sty}{%
+ \from{fibasics.dtx}{pkg}%
+ \from{ficommon.dtx}{pkg}%
+ \from{fimain.dtx}{pkg,boundaryCompability}%
+ \from{ficonv.dtx}{pkg}%
+ \from{filtfam.dtx}{pkg,textcomp,debug}%
+ \from{fimapgen.dtx}{pkg}%
+ \from{fibasics.dtx}{pkg2}%
+ }%
+ \file{xfntinst.sty}{%
+ \from{fibasics.dtx}{pkg}%
+ \from{ficommon.dtx}{pkg}%
+ \from{fimain.dtx}{pkg}%
+ \from{ficonv.dtx}{pkg}%
+ \from{filtfam.dtx}{pkg,textcomp,debug,oldstyle}%
+ \from{fimapgen.dtx}{pkg}%
+ \from{fibasics.dtx}{pkg2}%
+ }%
+ \file{finstmsc.sty}{%
+ \from{fibasics.dtx}{pkg}%
+ \from{ficommon.dtx}{pkg}%
+ \from{fimain.dtx}{misc}%
+ \from{ficonv.dtx}{misc}%
+ \from{fimapgen.dtx}{map}%
+ \from{fibasics.dtx}{pkg2,misc}%
+ }%
+ \file{fontinst.ini}{\from{fibasics.dtx}{ini}}%
+ \usedir{tex/fontinst/misc}%
+ \file{csc2x.tex}{\from{ficonv.dtx}{reglyphfigures,reglyphletters,glyphs}}%
+ \file{csckrn2x.tex}{\from{ficonv.dtx}{reglyphfigures,reglyphletters}}%
+ \file{osf2x.tex}{\from{ficonv.dtx}{reglyphfigures,glyphs}}%
+ \usedir{tex/latex/misc}%
+ \usepreamble\docpreamble
+ \file{fontdoc.sty}{%
+ \from{fibasics.dtx}{doc}%
+ \from{ficommon.dtx}{doc}%
+ \from{fimain.dtx}{doc}%
+ }%
+}
+
+\OriginalAsk\answer{Do you wish to install trig.sty with fontinst? [y/n] }
+\ifx \answer\y \let\answer\yes \fi
+\ifx \answer\yes
+
+\usedir{tex/fontinst/base}
+% From graphics.ins:
+\preamble
+\endpreamble
+
+\generate{\file{trig.sty}{\from{trig.dtx}{package}}}
+
+\fi
+
+\endbatchfile
+\endinput
diff --git a/Master/texmf-dist/source/fontinst/base/trig.dtx b/Master/texmf-dist/source/fontinst/base/trig.dtx
new file mode 100644
index 00000000000..8540ec3dee7
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/trig.dtx
@@ -0,0 +1,308 @@
+% \iffalse
+%% File: trig.dtx Copyright (C) 1993 1994 1995 1996 1997 1999 David Carlisle
+%%
+%% This file is part of the Standard LaTeX `Graphics Bundle'.
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.0 or, at your option, any later version.
+%%
+%
+%<*dtx>
+ \ProvidesFile{trig.dtx}
+%</dtx>
+%<*!plain>
+%<package&!plain>\NeedsTeXFormat{LaTeX2e}
+%<package&!plain>\ProvidesPackage{trig}
+%<driver> \ProvidesFile{trig.drv}
+% \fi
+% \ProvidesFile{trig.dtx}
+ [1999/03/16 v1.09 sin cos tan (DPC)]
+%
+% \iffalse
+%</!plain>
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{trig}
+\begin{document}
+ \DocInput{trig.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{trig.dtx}
+% \title{The \textsf{trig} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{David Carlisle}
+% \date{\filedate}
+% \maketitle
+%
+% \CheckSum{246}
+%
+% \changes{v1.00}{1993/00/00}{Undocumented versions}
+% \changes{v1.05}{1993/10/07}{Documented, added tan}
+% \changes{v1.06}{1994/02/01}{Update for LaTeX2e}
+% \changes{v1.07}{1994/03/15}{Use ltxdoc}
+% \changes{v1.08}{1994/10/16}{Change \cs{@xc} to \cs{nin@ty}}
+%
+% \section{Introduction}
+%
+% These macros implement the trigonometric functions, sin, cos and tan.
+% In each case two commands are defined. For instance the command
+% |\CalculateSin{33}| may be isued at some point, and then anywhere
+% later in the document, the command |\UseSin{33}| will return the
+% decimal expansion of $\sin(33^\circ)$.
+%
+% The arguments to these macros do not have to be whole numbers,
+% although in the case of whole numbers, \LaTeX\ or plain \TeX\ counters
+% may be used. In \TeX{}Book syntax, arguments must be of type:
+% \meta{optional signs}\meta{factor}
+%
+% Some other examples are:\\
+% |\CalculateSin{22.5}|, |\UseTan{\value{mycounter}}|,
+% |\UseCos{\count@}|.
+%
+% Note that unlike the psfig macros, these save all previously
+% computed values. This could easily be changed, but I thought that in
+% many applications one would want many instances of the
+% same value. (eg rotating all the headings of a table by the
+% \emph{same} amount).
+%
+% I don't really like this need to pre-calculate the values, I
+% originally implemented |\UseSin| so that it automatically calculated
+% the value if it was not pre-stored. This worked fine in testing, until
+% I remembered why one needs these values. You want to be able to say
+% |\dimen2=\UseSin{30}\dimen0|. Which means that |\UseSin| must
+% \emph{expand} to a \meta{factor}.
+%
+% \StopEventually{}
+%
+% \section{The Macros}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macro}{\nin@ty}\begin{macro}{\@clxx}
+% \begin{macro}{\@lxxi}\begin{macro}{\@mmmmlxviii}
+% Some useful constants for converting between degrees and radians.
+% $$\frac{\pi}{180}\simeq\frac{355}{113\times180}=\frac{71}{4068}$$
+% \begin{macrocode}
+\chardef\nin@ty=90
+\chardef\@clxx=180
+\chardef\@lxxi=71
+\mathchardef\@mmmmlxviii=4068
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% The approximation to $\sin$. I experimented with various
+% approximations based on Tchebicheff polynomials, and also some
+% approximations from a SIAM handbook `Computer Approximations' However
+% the standard Taylor series seems sufficiently accurate, and used by
+% far the fewest \TeX\ tokens, as the coefficients are all rational.
+% \begin{eqnarray*}
+% \sin(x)& \simeq& x - (1/3!)x^3 + (1/5!)x^5 - (1/7!)x^7 + (1/9!)x^9\\
+% &\simeq&\frac{((((7!/9!x^2-7!/7!)x^2+7!/5!)x^2 +7!/3!)x^2+7!/1!)x}
+% {7!}\\
+% &=&\frac{((((1/72x^2-1)x^2+42)x^2 +840)x^2+5040)x}
+% {5040}
+% \end{eqnarray*}
+% The nested form used above reduces the number of operations required.
+% In order to further reduce the number of operations, and more
+% importantly reduce the number of tokens used, we can precompute the
+% coefficients. Note that we can not use $9!$ as the denominator as
+% this would cause overflow of \TeX's arithmetic.
+% \begin{macro}{\@coeffz}\begin{macro}{\@coeffa}\begin{macro}{\@coeffb}
+% \begin{macro}{\@coeffc}\begin{macro}{\@coeffd}
+% Save the coefficients as |\|(|math|)|char|s.
+% \begin{macrocode}
+\chardef\@coeffz=72
+%\chardef\@coefa=1
+\chardef\@coefb=42
+\mathchardef\@coefc=840
+\mathchardef\@coefd=5040
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\TG@rem@pt}
+% The standard trick of getting a real number out of a \meta{dimen}.
+% This gives a maximum accuracy of approx.\ 5 decimal places, which
+% should be sufficient. It puts a space after the number, perhaps it
+% shouldn't.
+% \begin{macrocode}
+{\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}}
+\def\TG@rem@pt#1{\expandafter\noPT\the#1\space}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@term}
+% Compute one term of the above nested series. Multiply the previous sum
+% by $x^2$ (stored in |\@tempb|, then add the next coefficient, |#1|.
+% \begin{macrocode}
+\def\TG@term#1{%
+ \dimen@\@tempb\dimen@
+ \advance\dimen@ #1\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@series}
+% Compute the above series. the value in degrees will be in |\dimen@|
+% before this is called.
+% \begin{macrocode}
+\def\TG@series{%
+ \dimen@\@lxxi\dimen@
+ \divide \dimen@ \@mmmmlxviii
+% \end{macrocode}
+% |\dimen@| now contains the angle in radians, as a \meta{dimen}. We
+% need to remove the units, so store the same value as a \meta{factor}
+% in |\@tempa|.
+% \begin{macrocode}
+ \edef\@tempa{\TG@rem@pt\dimen@}%
+% \end{macrocode}
+% Now put $x^2$ in |\dimen@| and |\@tempb|.
+% \begin{macrocode}
+ \dimen@\@tempa\dimen@
+ \edef\@tempb{\TG@rem@pt\dimen@}%
+% \end{macrocode}
+% The first coefficient is $1/72$.
+% \begin{macrocode}
+ \divide\dimen@\@coeffz
+ \advance\dimen@\m@ne\p@
+ \TG@term\@coefb
+ \TG@term{-\@coefc}%
+ \TG@term\@coefd
+% \end{macrocode}
+% Now the cubic in $x^2$ is completed, so we need to multiply by $x$ and
+% divide by $7!$.
+% \begin{macrocode}
+ \dimen@\@tempa\dimen@
+ \divide\dimen@ \@coefd}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CalculateSin}
+% If this angle has already been computed, do nothing, else store the
+% angle, and call |\TG@@sin|.
+% \begin{macrocode}
+\def\CalculateSin#1{{%
+ \expandafter\ifx\csname sin(\number#1)\endcsname\relax
+ \dimen@=#1\p@\TG@@sin
+ \expandafter\xdef\csname sin(\number#1)\endcsname
+ {\TG@rem@pt\dimen@}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CalculateCos}
+% As above, but use the relation $\cos(x) = \sin(90-x)$.
+% \begin{macrocode}
+\def\CalculateCos#1{{%
+ \expandafter\ifx\csname cos(\number#1)\endcsname\relax
+ \dimen@=\nin@ty\p@
+ \advance\dimen@-#1\p@
+ \TG@@sin
+ \expandafter\xdef\csname cos(\number#1)\endcsname
+ {\TG@rem@pt\dimen@}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@reduce}
+% Repeatedly use one of the the relatations
+% $\sin(x)=\sin(180-x)=\sin(-180-x)$ to get $x$ in the range $-90 \leq
+% x\leq 90$. Then call |\TG@series|.
+% \begin{macrocode}
+\def\TG@reduce#1#2{%
+\dimen@#1#2\nin@ty\p@
+ \advance\dimen@#2-\@clxx\p@
+ \dimen@-\dimen@
+ \TG@@sin}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TG@@sin}
+% Slightly cryptic, but it seems to work\ldots
+% \begin{macrocode}
+\def\TG@@sin{%
+ \ifdim\TG@reduce>+%
+ \else\ifdim\TG@reduce<-%
+ \else\TG@series\fi\fi}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\UseSin}
+% \begin{macro}{\UseCos}
+% Use a pre-computed value.
+% \begin{macrocode}
+\def\UseSin#1{\csname sin(\number#1)\endcsname}
+\def\UseCos#1{\csname cos(\number#1)\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% A few shortcuts to save space.
+% \begin{macrocode}
+\chardef\z@num\z@
+\expandafter\let\csname sin(0)\endcsname\z@num
+\expandafter\let\csname cos(0)\endcsname\@ne
+\expandafter\let\csname sin(90)\endcsname\@ne
+\expandafter\let\csname cos(90)\endcsname\z@num
+\expandafter\let\csname sin(-90)\endcsname\m@ne
+\expandafter\let\csname cos(-90)\endcsname\z@num
+\expandafter\let\csname sin(180)\endcsname\z@num
+\expandafter\let\csname cos(180)\endcsname\m@ne
+% \end{macrocode}
+%
+% \begin{macro}{\CalculateTan}
+% Originally I coded the Taylor series for tan, but it seems to be
+% more accurate to just take the ratio of the sine and cosine.
+% This is accurate to 4 decimal places for angles up to
+% $50^\circ$, after that the accuracy tails off, giving
+% 57.47894 instead of 57.2900 for $89^\circ$.
+% \begin{macrocode}
+\def\CalculateTan#1{{%
+ \expandafter\ifx\csname tan(\number#1)\endcsname\relax
+ \CalculateSin{#1}%
+ \CalculateCos{#1}%
+ \@tempdima\UseCos{#1}\p@
+ \divide\@tempdima\@iv
+ \@tempdimb\UseSin{#1}\p@
+ \@tempdimb\two@fourteen\@tempdimb
+ \divide\@tempdimb\@tempdima
+ \expandafter\xdef\csname tan(\number#1)\endcsname
+ {\TG@rem@pt\@tempdimb}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\UseTan}
+% Just like |\UseSin|.
+% \begin{macrocode}
+\def\UseTan#1{\csname tan(\number#1)\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\two@fourteen}
+% \begin{macro}{\@iv}
+% two constants needed to keep the division within \TeX's range.
+% \begin{macrocode}
+\mathchardef\two@fourteen=16384
+\chardef\@iv=4
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Predefine $\tan(\pm90)$ to be an error.
+% \begin{macrocode}
+\expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}}
+\expandafter\let\csname tan(-90)\expandafter\endcsname
+ \csname tan(90)\endcsname
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/README b/Master/texmf-dist/source/fontinst/base/xdoc/README
new file mode 100644
index 00000000000..58744d4985d
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/README
@@ -0,0 +1,67 @@
+README for the xdoc and docindex packages.
+
+The standard LaTeX doc package is well-known to all LaTeX hackers.
+Without its support for the .dtx-file style of literate programming,
+the TeX world would probably be much more plagued by the horrors of
+poorly commented and mysterious code than it is today. The past good
+decade that doc has been with us has been -- good. But even the sun
+has spots; doc is an old package and, as old code often tends to do,
+it breaks if you try to bend it into doing something new. The xdoc
+package is (or rather is meant to be) a rewrite from scratch
+which both can take a lot more bending and is ready for LaTeX2e*.
+
+What exists so far is only xdoc2: the "second prototype" for the xdoc
+package. xdoc2 is not a complete rewrite of doc, but rather an add-on
+to doc which reimplements many of its mechanisms (more precisely those
+mechanisms which I think should be possible to "bend" into doing new
+things, but have found to be fixed to their present behaviour) and
+provides a few new features of its own. Even though xdoc2 is a
+prototype and some of the code in it is experimental, I consider it to
+be safe enough to build productive applications on, as I intend to
+keep xdoc2 available even after the final xdoc package is released.
+
+Among the features of xdoc2 are:
+ - new commands for describing things (cf. \DescribeMacro) and a
+ package/class writer's interface for defining new such commands.
+ - new environments for defining things in (cf. the macro
+ environment) and a package/class writer's interface for defining
+ new such environments.
+ - support for two-sided document designs.
+ - support for external cross-referencing.
+ - improved sorting of macros, with support for defining prefixes
+ that should be ignored when sorting.
+ - support for CVS-style version numbering.
+The other new features are of little interest to the mere user, but
+they may be ever so useful to those who are in the habit of hacking
+doc. Here we have for example:
+ - basic commands implementing a robust "string" datatype.
+ - an abstract command interface for making index entries;
+ this would simplify supporting a different index sorting
+ program.
+
+Besides xdoc2, there are also the docindex/docidx2e packages. These
+provide mechanisms for a more flexible formatting of the index and list of
+changes than is possible with the mechanisms for this in the doc package.
+In particular docindex/docidx2e provides for automatic collapsing of
+trivial index levels, something which often happens in automatically
+generated multilevel indices such as the list of changes. The reason there
+are two packages is that docindex is a LaTeX2e* package, whereas docidx2e
+is a "downgraded" variant which runs on a normal LaTeX2e installation.
+Both do however follow the same internal logic.
+
+
+The files in this directory are:
+
+README.txt - this file
+docindex.dtx - the source for the docindex and docidx2e packages
+docindex.ins - the docstrip installation script for the docindex and
+ docidx2e packages
+xdoc2.dtx - the source for the xdoc2 package
+xdoc2.ins - the docstrip installation script for the xdoc2 package
+xdocdemo.tex - a document which demonstrates some of the features in
+ the xdoc2 package
+
+2003/07/06,
+Lars Hellstr\"om
+
+
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/docindex.dtx b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.dtx
new file mode 100644
index 00000000000..47139d32b12
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.dtx
@@ -0,0 +1,2100 @@
+% \CheckSum{893}
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{xdoc2}
+
+\makeatletter
+\NewMacroEnvironment{templatetype}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1\ \normalfont type}%
+ {\XDMainIndex{\LevelSorted{#1}{\texttt{#1} template type}}}%
+ {{#1}{\texttt{#1} template type}}%
+ {}%
+\NewMacroEnvironment*{template}{%
+ \XD@grab@harmless\relax\XD@grab@harmless\relax
+}{2}%
+ {\XDParToMargin{\MacroFont #1\textnormal{\slash}#2 \normalfont
+ template}}%
+ {\XDMainIndex{
+ \LevelSorted{#1}{\texttt{#1} template type}%
+ \LevelSorted{#2}{\texttt{#2} template}%
+ }}%
+ {{#1/#2}{\texttt{#1}\slash\texttt{#2} template}}%
+ {\def\XD@template@sort{%
+ \LevelSorted{#1}{\texttt{#1} template type}%
+ \LevelSorted{#2}{\texttt{#2} template}%
+ }}%
+\NewMacroEnvironment*{instance}{%
+ \XD@grab@harmless\relax\XD@grab@harmless\relax
+}{2}%
+ {\XDParToMargin{\MacroFont #1\textnormal{\slash}#2 \normalfont
+ instance}}%
+ {\XDMainIndex{
+ \LevelSorted{#1}{\texttt{#1} template type}%
+ \LevelSorted{#2}{\texttt{#2} instance}%
+ }}%
+ {{#1/#2}{\texttt{#1}\slash\texttt{#2} instance}}%
+ {}%
+\NewMacroEnvironment*{collectioninstance}{%
+ \XD@grab@harmless\relax\XD@grab@harmless\relax\XD@grab@harmless\relax
+}{3}%
+ {\XDParToMargin{\MacroFont #2\textnormal{\slash}#3 \normalfont
+ instance (\texttt{#1} collection)}}%
+ {\XDMainIndex{
+ \LevelSorted{#2}{\texttt{#2} template type}%
+ \LevelSorted{#3}{\texttt{#3} instance}%
+ \LevelSorted{#1}{\texttt{#1} collection}%
+ }}%
+ {{#2/#3/#1}%
+ {\texttt{#2}\slash\texttt{#3} instance (\texttt{#1} collection)}}%
+ {}%
+\@namedef{XD@harmless\string\break}{%
+ \toks@=\expandafter{\the\toks@ \protect\nolinebreak[3]}%
+ \XD@harmless@
+}
+\newcommand\keyvalitem[2]{%
+ \item[#1 (#2)%
+ \IndexEntry{\XD@template@sort
+ \LevelSorted{#1}{\textit{#1} keyval (#2)}%
+ }{usage}{\thepage}%
+ ]%
+}
+\newcommand{\xrefoff}{\scan@allowedfalse}
+\newcommand{\xrefon}{\scan@allowedtrue}
+\makeatother
+
+\newenvironment{syntax}{%
+ \let\\=\break
+ \list{}{%
+ \setlength\topsep{\medskipamount}%
+ \setlength\partopsep{0pt}%
+ \setlength\itemsep{0pt plus 1pt}%
+ \setlength\parsep{\itemsep}%
+ \setlength\leftmargin{3em}%
+ \setlength\listparindent{1em}%
+ \setlength\itemindent{-2em}%
+ \setlength\labelwidth{0pt}%
+ \setlength\labelsep{0pt}%
+ \csname @endparpenalty\endcsname=500
+ \def\makelabel##1{\mbox{\meta{##1}${}\longrightarrow{}$}}%
+ }%
+ \addtolength\rightskip{0pt plus 1fil}%
+ \linepenalty=300%
+}{\endlist}
+\newcommand\branch{\({}\mid{}\)\ignorespaces}
+
+\DeclareRobustCommand{\package}[1]{\textsf{#1}}
+\DeclareRobustCommand{\program}[1]{\textsf{#1}}
+\DeclareRobustCommand\LaTeXplus{\LaTeXe$*$}
+
+\DoNotIndex{\addvspace,\@backslashchar,\begin,\begingroup,\bgroup}
+\DoNotIndex{\csname,\DeclareInstance,\DeclareOption}
+\DoNotIndex{\DeclareTemplate,\DeclareTemplateType,\def}
+\DoNotIndex{\DoParameterAssignments,\edef,\egroup,\@eha}
+\DoNotIndex{\@empty,\end,\endcsname,\endgroup,\endinput,\expandafter}
+\DoNotIndex{\@firstofone,\@firstoftwo,\global,\@gobble,\hb@xt@,\hfil}
+\DoNotIndex{\hsize,\hspace,\IfNoValueTF,\@ifpackageloaded}
+\DoNotIndex{\@ifpackagewith,\@ifundefined,\ignorespaces,\@input@}
+\DoNotIndex{\jobname,\leftskip,\let,\MessageBreak,\@namedef,\@ne}
+\DoNotIndex{\NeedsTeXFormat,\newcommand,\nobreak,\@nobreakfalse}
+\DoNotIndex{\nopagebreak,\normalsize,\NoValue,\number,\outer}
+\DoNotIndex{\p@,\PackageError,\PackageInfo,\PackageWarningNoLine}
+\DoNotIndex{\pagestyle,\par,\parfillskip,\parindent,\parskip}
+\DoNotIndex{\@plus,\ProcessOptions,\protect,\protected@edef}
+\DoNotIndex{\providecommand,\ProvidesPackage,\relax,\renewcommand}
+\DoNotIndex{\RequirePackage,\rightskip,\romannumeral,\@secondoftwo}
+\DoNotIndex{\small,\space,\textbf,\thispagestyle,\thr@@,\tw@}
+\DoNotIndex{\vadjust,\vspace,\z@,\z@skip}
+\DoNotIndex{\iffalse,\ifnum,\ifx,\else,\fi} % \fi \fi
+\DoNotIndexBy{@}
+\DoNotIndexBy{DI@}
+
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+\setcounter{IndexColumns}{2}
+\setcounter{StandardModuleDepth}{2}
+
+
+\begin{document}
+\DocInput{docindex.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \title{The \package{docindex} package}
+% \author{Lars Hellstr\"om}
+% \date{8 July 2003}
+% \maketitle
+%
+% \begin{abstract}
+% The \package{docindex} package implements template-based formatting
+% of indices and lists of changes\slash glossaries. In addition to this,
+% the control structures employed also provide for a couple of new
+% features, such as automatic collapsing of trivial index levels.
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Introduction}
+%
+% In automatically generated indices with multi-level entries, such as the
+% list of changes of a \package{doc} document, it often happens that some
+% entries are uniquely identified by their primary level sort keys,
+% although there are sort keys and text for additional levels. If then
+% the formatting is designed for entries that are uniquely identified
+% only when their secondary or tertiary sort keys are considered, one
+% ends up with a couple of entries that look rather peculiar (building
+% a tree which never branches) and usually take up much more space than
+% they need to. The remedy for this is of course to make the formatting
+% smart enough to recognise this situation when it occurs and flexible
+% enough to format the text is a more suitable manner.
+%
+% An example of this is that if a document contains the index
+% entries\footnote{I'm using the default \program{makeindex}
+% metacharacters in these examples, but the style file provided for
+% this package actually uses the same metacharacters as those style files
+% provided by the \package{doc} package---hence the `\package{doc}'
+% in `\package{docindex}'. }
+% \begin{quote}
+% |\index{Bernoulli!Jacob}\index{Bernoulli!Johann}|
+% \end{quote}
+% then it is probably reasonable to format this as
+% \begin{quote}
+% Bernoulli,\\
+% \vadjust{}\quad Jacob\\
+% \vadjust{}\quad Johann
+% \end{quote}
+% but if the index entries instead were
+% \begin{quote}
+% |\index{Jacobi!Carl}\index{Bernoulli!Jacob}|
+% \end{quote}
+% then it is probably better to format this as
+% \begin{quote}
+% Bernoulli, Jacob\\
+% Jacobi, Carl
+% \end{quote}
+% than as
+% \begin{quote}
+% Bernoulli,\\
+% \vadjust{}\quad Jacob\\
+% Jacobi,\\
+% \vadjust{}\quad Carl
+% \end{quote}
+%
+% The \program{makeindex} program has some features in this direction,
+% but they only allow dependence on the previous item in the index, not
+% the next item, which is what you need to know when deciding whether
+% `Jacob' should go on the same line as `Bernoulli'. Therefore
+% \package{docindex} pretty much ignores these features in
+% \program{makeindex} and instead sees to that each command that is to
+% typeset an index item knows what kind of items were before and after it.
+%
+% Another reason for writing this package was to try out the template
+% mechanisms as provided by the \LaTeXplus\ \package{template}
+% package.\footnote{\LaTeXplus\ is the name of the \LaTeX\ version after
+% \LaTeXe. Rather than being a completely different kernel\slash format,
+% \LaTeXplus\ is (will be) implemented as a collection of \LaTeXe\
+% packages which replace parts of the kernel. More information and
+% package code can be found on the \LaTeX-project website~^^A
+% \cite{LaTeX-project}.} My impression is that this experiment turned
+% out strikingly well. I have always found the more layout-oriented
+% aspects of \TeX\ programming a bit cumbersome, but the separation of
+% layout details from control structures that becomes natural when
+% employing template mechanisms seems to have made it much easier. I'm
+% not sure why this is so, but it could be as simple as that the layout
+% settings are no longer diluted in the control structures. In any
+% case, I would recommend people creating new \LaTeXe\ packages to
+% employ template mechanisms in at least the initial development
+% versions of the package, for the following reasons: (i) it reduces the
+% work of updating the package for \LaTeXplus, (ii) it furthers the
+% development of \LaTeXplus, and (iii) it might actually become a
+% better package.
+%
+% A third reason for writing the \package{docindex} package was to get
+% the \LaTeX\ document ``back in control'' of how the index is formatted.
+% Certainly it is the document which has the final say about what
+% the command in the \texttt{.ind} file actually do, but the traditional
+% \program{makeindex} style files that are used place severe restrictions
+% on the formatting of the index simply because they control where the
+% commands are put. \package{docindex} tries to reduce these
+% restrictions by making all texts in the index arguments of commands.
+% Certainly there is a lot more that could be done in this direction---in
+% particular, the (page) numbers in the index could be coded as a
+% |\do|-type list rather than as an explicitly comma-separated list as is
+% done now---but what is in \package{docindex} at the moment seems to
+% satisfy all my current needs.
+%
+%
+% \section{Usage}
+%
+% \subsection{Straightforward usage}
+%
+% To make use of the \package{docindex} package in formatting the index
+% and list of changes of a \package{doc}-type \LaTeX\ document, you must
+% do the following:
+% \begin{enumerate}
+% \item Load the \package{docindex} package (or probably
+% rather the \package{docidx2e} package---see below).
+% \item Make sure that the index entries does not use any commands,
+% such as |\verb|, that rely on changing catcodes or otherwise
+% need to be executed before the entire entry text has been
+% tokenized.
+% \item Generate the \texttt{.ind} and \texttt{.gls} files using
+% \texttt{docindex.ist} as style file for \program{make\-index}.
+% \end{enumerate}
+% (Item~2 may seem like a monumental task if one considers what the
+% indices of \package{doc} documents traditionally looks like---there's
+% a |\verb| for every macro name in the index---but it is really not
+% that bad. \package{docindex} loads the \package{xdoc} package~^^A
+% \cite{xdoc} which redefines \texttt{macro}, the cross-referencing
+% mechanism, etc.\ so that the index entries generated by these no
+% longer uses |\verb|. What is left for you to deal with are merely
+% the possible uses of |\verb| in explicit |\index| or |\SortIndex|
+% commands.)
+%
+% What advantages are there then for the normal user in having
+% \package{docindex} formatting the index and list of changes, as
+% opposed to using the default mechanisms in the \package{doc} package?
+% I can only think of two: the index or list of changes may be typeset in
+% a single column and the same \program{makeindex} style file can be
+% used for both index and list of changes. Neither advantage is
+% significant. Instead the advantage of \package{docindex} lies in that
+% it becomes much simpler to change the formatting, which is rather an
+% advantage for advanced users which have special needs, and
+% in particular one can do this without having to supply e.g.\ extra
+% \program{makeindex} style files.
+%
+% Another important point is that what you will want to use is probably
+% not the \LaTeXplus\ \package{docindex} package, but the ``downgraded''
+% \LaTeXe\ version \package{docidx2e}, as the former uses the
+% \package{galley2} package which currently wrecks pretty much all
+% justification in all existing document classes. \package{docidx2e}
+% provides the same features as \package{docindex}, but configuring it
+% is somewhat more cumbersome since \package{template} won't do most of
+% the coding for you. It is however rather straightforward to convert
+% a definition using the \package{docindex} package to something which
+% achieves the same results with the \package{docidx2e} package.
+%
+%
+% \subsection{Multiple indices}
+%
+% The \package{docindex} package makes it comparatively simple to
+% include several indices in the same document: all one has to do is
+% use an instance or template of type \texttt{docindex} for each index
+% one wishes to typeset. The syntax for using such an instance is
+% \begin{quote}
+% |\UseInstance{docindex}|\marg{instance}\marg{prologue}^^A
+% \marg{epilogue}
+% \end{quote}
+% The \meta{prologue} and \meta{epilogue} are texts which will be
+% printed just before and after the index, respectively, and either may
+% be empty. The text for the index itself is read from another file,
+% the name and extentsion of which are specified by the instance. The
+% \texttt{std} template prints the \meta{prologue} and \meta{epilogue}
+% in one-column mode, whereas the index itself can be printed in one- or
+% multicolumn mode (the default is three columns).
+%
+% The \package{doc} commands |\PrintIndex| and |\PrintGlossary| are
+% redefined to be
+% \begin{quote}
+% |\UseInstance{docindex}{index}{\index@prologue}{}|
+% \end{quote}
+% and
+% \begin{quote}
+% |\UseInstance{docindex}{changes}{\glossary@prologue}{}|
+% \end{quote}
+% respectively. The \texttt{index} and \texttt{changes} instances of
+% type \texttt{docindex} give the same formatting as the \package{doc}
+% defaults. (The \package{docidx2e} definitions even use the
+% \package{doc} package parameters where applicable, but in
+% \package{docindex} it is much simpler to redefine the instance from
+% scratch.)
+%
+% The format of the sorted index files (\texttt{.ind}, \texttt{.gls},
+% etc.) that a \texttt{docindex} instance inputs is rather complicated
+% and I would suggest that the generation of these files is left to the
+% \program{makeindex} program, but the complete syntax is described in
+% Subsection~\ref{Ssec:ist}. The syntax of the unsorted index files
+% (\texttt{.idx}, \texttt{.glo}, etc.) is simpler; there are only a few
+% things that are different from the index files of the \package{doc}
+% package.
+%
+% The foremost difference is that the index entries should begin not
+% with |\indexentry| or |\glossaryentry|, but with |\docindexentry|. The
+% \package{xdoc} package provides hooks with which one can change these
+% texts in entries generated using the |\index| and |\glossary| commands
+% (as well as higher-level commands built on these, such as the
+% |\SortIndex| and |\changes| commands) and \package{docindex} will use
+% these hooks unless it gets passed the \describeoption{oldkeywords}
+% \texttt{oldkeywords} option. If you are creating a third unsorted
+% index file then you will have to make sure that the command for writing
+% to that file uses |\docindexentry| in the right place.
+%
+% The other difference concerns the composite page numbers. The string
+% which separates the parts of a composite page number is not a
+% hyphen `|-|', but the string `|\+|'. (The |\+| command is locally
+% defined for the typesetting of each index by the \texttt{docindex}
+% template being used, and the default is to typeset a hyphen.) Again
+% the \package{xdoc} package provides a hook for this, and this hook is
+% used by \package{docindex} unless it gets passed the
+% \texttt{oldkeywords} option.
+%
+% It also deserves to be listed which the metacharacters are that are
+% the same as in \package{doc} indices. The level separator is `|>|',
+% the sort~key\slash item~text separator is `|=|', and the quote
+% character is `|!|'. All other \program{makeindex} metacharacter
+% parameters have their default values.
+%
+%
+%
+% \subsection{Configuration}
+%
+% Configuration of the layout provided by the \package{docindex}
+% package is primarily done by redefining the \texttt{index} and
+% \texttt{changes} instances of type \texttt{docindex}, since these are
+% the instances that are used by the |\PrintIndex| and |\PrintChanges|
+% commands.
+%
+% The index in the \texttt{source2e.tex} file (the main driver for the
+% \LaTeXe\ source) differs from the default in three respects: it is set
+% in two columns rather than three, there is no seperator character
+% between the parts of a composite page number, and the pagestyle is set
+% to \texttt{docindex} during the index. This is set up by the
+% redefinition
+%\begin{verbatim}
+%\DeclareInstance{docindex}{index}{std}{
+% columns=2, page-compositor={}, pagestyle=docindex
+%}
+%\end{verbatim}
+% (There are however also some changes of parameters related to
+% linebreaking; more on that in connection to configuration of the
+% \texttt{changes} instance below.)
+%
+% Another kind of modification can be found in the \package{tclldoc}
+% package~\cite{tclldoc}. Here the primary level in the index is used for
+% names of procedures and variables, whereas the secondary level for the
+% namespace of the same (the same name may have different definitions
+% in different namespaces). If there is only one namespace for a given
+% name then it is probably overkill to format them as two different
+% index items, but better to join them. This can be achieved through
+% the redefinition
+%\begin{verbatim}
+%\DeclareInstance{docindex}{index}{std}{%
+% item1=fixed-r1a, item2=aloneaccept2
+%}%
+%\end{verbatim}
+% An item handled by the \texttt{fixed-r1a} instance (of type
+% \texttt{indexitem}) always tries to join with the following item but
+% rejects to join with the preceeding one. An item handled by the
+% \texttt{aloneaccept2} instance accepts to join with the preceeding
+% item if neither that nor the following item is a secondary level item.
+% Thus an item for a name will join with the following item for a
+% namespace if there is only one such item. As the reader no doubt
+% realises, this also solves the problem with the Bernoullis that was
+% described in the introduction.
+%
+% \pagebreak[1]
+%
+% As for configuring the list of changes formatting, it is instructive
+% to start by considering its default definition:
+%\begin{verbatim}
+%\DeclareInstance{docindex}{changes}{std}{
+% file-extension = gls,
+% item2 = fixed-r2a-nocomma,
+% item3 = fixed-a3r,
+% columns = 2,
+% letter-format = ,
+% letter-skip = 0pt
+%}
+%\end{verbatim}
+% In the list of changes a secondary level item (which contains the name
+% of the macro or whatever which was changed) is joined with the
+% following tertiary level item (which details the change that was made).
+% There are two columns and letter groups are not given any special
+% formatting.
+%
+% The definition of \texttt{changes} that would be used for
+% \texttt{source2e.tex} differs from the above in only one keyval,
+% namely \textit{body-setup}, but that contains quite a lot of material.
+% To begin with there is the default |\small| which selects the font.
+% Then there is a |\makeatletter| which is needed because some |\changes|
+% entries in the \LaTeX\ sources include commands (e.g.~|\TeX|) that
+% (when written to file) expand to other commands whose names include the
+% |@| character. If these are to be tokenized correctly, |@| must be a
+% letter when the \texttt{.gls} file is being inputted. Last, but not
+% least, there is a modification of the linebreaking parameters:
+%\begin{verbatim}
+%\UseTemplate{linebreak}{TeX}{
+%\end{verbatim}
+% The file \texttt{source2e.tex} explicitly sets \textit{hbadness} and
+% \textit{hfuzz} to make \TeX\ shut up about over- and underfull hboxes.
+%\begin{verbatim}
+% hbadness=10000, hfuzz=\maxdimen,
+%\end{verbatim}
+% In addition to this, there are a couple of parameters that are set by
+% the \texttt{multicols} environment to values quite different from the
+% defaults of the \texttt{TeX} template and thus must be set too. Here
+% they are shown with their default values. The value of
+% \textit{emergency\-stretch} could probably be increased.
+%\begin{verbatim}
+% pretolerance=-1, tolerance=9999, emergencystretch=8pt
+%}
+%\end{verbatim}
+% Summing that up, we arrive at the following definition of the
+% \texttt{changes} instance for \texttt{source2e.tex}.
+%\begin{verbatim}
+%\DeclareInstance{docindex}{changes}{std}{
+% file-extension = gls,
+% item2 = fixed-r2a-nocomma,
+% item3 = fixed-a3r,
+% columns = 2,
+% letter-format = ,
+% letter-skip = 0pt,
+% body-setup = \small\makeatletter
+% \UseTemplate{linebreak}{TeX}{
+% hbadness=10000, hfuzz=\maxdimen,
+% pretolerance=-1, tolerance=9999, emergencystretch=8pt
+% }
+%}
+%\end{verbatim}
+%
+% Another example can be found in the \package{fisource}
+% package\footnote{It should probably rather be made a document class,
+% but I haven't found it that necessary to change that aspect of it.}^^A
+% ~(v\,2.10 or later), which sets up formatting for the \program{fontinst}
+% source. There the list of changes should be set in one column, with
+% items from the tertiary level being joined with their parent
+% secondary level items iff the tertiary item is the only one having
+% that particular parent item. This is achieved through the definition
+%\begin{verbatim}
+%\DeclareInstance{docindex}{changes}{std}{%
+% file-extension = gls,
+% item2 = fixed-r2a-nocomma,
+% item3 = aloneaccept3,
+% columns = 1,
+% letter-format = {},
+% letter-skip = 0pt
+% }
+%\end{verbatim}
+% where the difference to the default definition is in the values for
+% the \textit{item3} and \textit{columns} keys.
+%
+% For details on what they various keys mean, see the declaration of
+% the \texttt{std} template of type \texttt{docindex} on
+% page~\pageref{docindex:std}.
+%
+% With the \package{docidx2e} package, configuration follows the same
+% logic, even though it is much more technical as one has to define
+% the instances without the help of a template. The default instance
+% definitions for the \package{docidx2e} package are the
+% \begin{quote}
+% |\@namedef{TP@I{}{docindex}{index}}#1#2{|\dots|}|\\
+% |\@namedef{TP@I{}{docindex}{changes}}#1#2{|\dots|}|
+% \end{quote}
+% that begin on pages~\pageref{p:index-instance}
+% and~\pageref{p:changes-instance} respectively.
+%
+%
+%
+%
+%
+% \StopEventually{
+% % \begin{thebibliography}{9}
+% \bibitem{xindex}
+% Achim Blumensath: \textit{The \package{xindex} package};
+% \textsc{http:}/\slash
+% \texttt{www-mgi.\nolinebreak[3]informatik.\nolinebreak[3]^^A
+% rwth-aachen.de}\slash \texttt{\textasciitilde blume}/.
+% \bibitem{makeindex-paper}
+% Pehong Chen, Michael A. Harrison:
+% \textit{Index Preparation and Processing},
+% Software: practice \& experience, vol. \textbf{19}, no. 9 (1988),
+% 897--915;
+% Computer Science Tech. Report 87/347, University of California,
+% Berkeley, March 1987;
+% \textsc{ctan:}\discretionary{}{}{\thinspace}\texttt{indexing}^^A
+% \slash\texttt{makeindex}\slash\texttt{paper}\slash
+% \texttt{ind.tex}.
+% \bibitem{tclldoc}
+% Lars Hellstr\"om:
+% \textit{The \package{tclldoc} package and class},
+% v\,2.20 or newer;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash
+% \texttt{tclldoc}\slash \texttt{tclldoc.dtx}.
+% Note: At the time of writing, this has not yet been uploaded
+% to CTAN.
+% \bibitem{xdoc}
+% Lars Hellstr\"om:
+% \textit{The \package{xdoc} package --- experimental
+% reimplementations of features from \package{doc},
+% second~prototype}, 2000--2003;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash \texttt{xdoc}\slash
+% \texttt{xdoc2.dtx}.
+% \bibitem{xindy}
+% Roger Kehr:
+% \textit{\program{xindy} --- A Flexible Indexing System};
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{indexing}^^A
+% \slash\texttt{xindy}/.
+% \bibitem{LaTeX-project}
+% The \LaTeX3 Project: \textit{The \LaTeX\ Project Home Page};
+% \textsc{http:}/\slash\texttt{www.latex-project.org}/.
+% \bibitem{multicol}
+% Frank Mittelbach: \textit{An environment for multicolumn output};
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{required}\slash \texttt{tools}\slash
+% \texttt{multicol.dtx}.
+% \bibitem{doc}
+% Frank Mittelbach, B.~Hamilton Kelly, Andrew Mills, Dave Love, and
+% Joachim \mbox{Schrod}: \textit{The \package{doc} and
+% \package{shortvrb} Packages}, The \LaTeX3 Project; ^^A , 1993~ff.
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{doc.dtx}.
+% \end{thebibliography}
+% }
+%
+%
+%
+%
+% \section{Implementation}
+%
+% \subsection{\package{docstrip} modules}
+%
+% This file contains a number of \package{docstrip} module directives,
+% and many of these guard code that is not going to be used. In part
+% this mirrors the development of the code (and may get cleared up
+% eventually), but most of this duplication has to do with making the
+% code work in many different set-ups (some of which involve other
+% packages whose interface is rapidly changing).
+%
+% The modules which control \LaTeX\ code are:
+% \begin{description}
+% \item[\textsf{pkg}]
+% Main guard for code that is to end up in some \LaTeX\ package.
+% \item[\textsf{template}]
+% Guard for code which uses features of the \package{template}
+% package. This code will end up in the \package{docindex} package,
+% whereas the equivalent code which avoids using templates ends up
+% in the \package{docidx2e} package.
+% \item[\textsf{default}]
+% This code protects the default values for template keys. The
+% syntax for this is changing, so the default values are currently
+% being assigned in the template bodies instead.
+% \end{description}
+%
+% The modules which control \program{makeindex} style files are:
+% \begin{description}
+% \item[\textsf{ist}]
+% Code for the main style file \texttt{docindex.ist}.
+% \item[\textsf{idx}]
+% Code for a style file which is like the main one, but the input
+% parameters are set to the same values as in the standard \LaTeX\
+% \texttt{gind.ist}.
+% \item[\textsf{glo}]
+% Code for a style file which is like the main one, but the input
+% parameters are set to the same values as in the standard \LaTeX\
+% \texttt{gglo.ist}.
+% \end{description}
+%
+%
+% \subsection{Initial stuff}
+%
+% \begin{macrocode}
+%<*pkg>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage
+%<template> {docindex}
+%<!template> {docidx2e}
+ [2001/04/11 v1.00 doc index formatting package]
+% \end{macrocode}
+%
+% Since the \texttt{multicols} environment is used by the \texttt{std}
+% template of type \texttt{docindex}, the \package{multicol} package
+% must have been loaded.
+% \begin{macrocode}
+\RequirePackage{multicol}
+% \end{macrocode}
+% This will probably change in \package{docindex} once I get around to
+% check how this kind of thing is implemented in the \LaTeXplus\ output
+% routine.
+%
+% Since the \texttt{docindex} pagestyle may be used the \package{xdoc}
+% package must have been loaded. This also loads the \package{doc}
+% package which contains the definition of |\pfill|.
+% \begin{macrocode}
+\RequirePackage{xdoc2}[2001/03/26]
+% \end{macrocode}
+%
+%
+% \begin{option}{oldkeywords}
+% The \texttt{oldkeywords} option tells the \package{docindex}
+% package to not change the index entry keywords from the \package{doc}
+% defaults. The code for this option appears further down.
+% \begin{macrocode}
+\DeclareOption{oldkeywords}{}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{option}{usedocindexps}
+% The \texttt{usedocindexps} option tells the \package{docindex}
+% package to set the pagestyle to \texttt{docindex} (defined by
+% \package{xdoc}) when typesetting the index. The code for this option
+% appears further down.
+% \begin{macrocode}
+\DeclareOption{usedocindexps}{}
+% \end{macrocode}
+% \end{option}
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+%</pkg>
+% \end{macrocode}
+%
+%
+%
+% \subsection{Index style files}
+% \label{Ssec:ist}
+%
+% The \program{makeindex} style files uses four commands. The most
+% important command is \DescribeMacro{\indexitem}|\indexitem|, which
+% has the two syntaxes
+% \begin{quote}
+% |\indexitem|\marg{level}\marg{text}\marg{next level}\\
+% |\indexitem|\marg{level}\marg{text}|{9}|\marg{numbers}^^A
+% \marg{next level}
+% \end{quote}
+% The \meta{level} is an integer in the range 1--3, the \meta{next level}
+% is an integer in the range 0--3, the \meta{text} is the item text,
+% and the \meta{numbers} is a list of (page or the like) numbers. The
+% reason for this dual syntax is limitations of \program{makeindex}:
+% there is no way of making the text inserted after an item depend on
+% whether there are any page numbers for this item, so one cannot make
+% \meta{numbers} a straightforward optional argument.
+%
+% The level numbers specify at what level the item is. Level~1
+% corresponds to |\item|, level~2 corresponds to |\subitem|, and
+% level~3 corresponds to |\subsubitem|. The \meta{next level} number
+% may also be 0, and that denotes non-|\indexitem| material such as a
+% space between letter groups or the end of the index. The purpose of
+% the \meta{next level} argument is to let the formatting of an item
+% depend on what level the next item has, a feature that
+% \program{makeindex} alone doesn't provide. Since \program{makeindex}
+% only supports putting text in front of things, each new item must
+% begin by inserting the closing brace on the second last argument and
+% the very last argument of the \emph{previous} item before it can do
+% anything for itself. This leads to the following contents of the
+% \program{makeindex} |item_|\textellipsis\ parameters.
+%
+% \xrefoff
+% \begin{macrocode}
+%<*ist|idx|glo>
+item_0 "}{1}\n\\indexitem{1}{"
+item_1 "}{2}\n \\indexitem{2}{"
+item_01 "}{2}\n \\indexitem{2}{"
+item_x1 "}{2}\n \\indexitem{2}{"
+item_2 "}{3}\n \\indexitem{3}{"
+item_12 "}{3}\n \\indexitem{3}{"
+item_x2 "}{3}\n \\indexitem{3}{"
+% \end{macrocode}
+% \SpecialIndex{\indexitem} ^^A I can't believe I'm using this!
+% \begin{macrocode}
+delim_0 "}{9}{"
+delim_1 "}{9}{"
+delim_2 "}{9}{"
+delim_n ", "
+delim_r "--"
+%</ist|idx|glo>
+% \end{macrocode}
+% \xrefon
+%
+%
+% \begin{macro}{\indexitem}
+% \begin{macro}{\DI@indexitem}
+% \begin{macro}{\DI@indexitem@}
+% \begin{macro}{\DI@last@level}
+% The |\indexitem| command (and its subsidiary macros |\DI@indexitem|
+% and |\DI@indexitem@| only handle argument grabbing and some
+% elementary processing of level numbers. The formatting of the item
+% is instead handled by the |\DI@indexitem@|\meta{level}, where
+% \meta{level} is the roman numeral |i|, |ii|, or |iii|, family of
+% control sequences. |\indexitem| itself doesn't grab any arguments,
+% instead it inserts the contents of |\DI@last@level| as an
+% additional argument in front of |\DI@indexitem|. The actual
+% argument structures of the other macros are
+% \begin{quote}
+% |\DI@indexitem|\marg{last}\marg{this}\marg{text}^^A
+% \marg{next/\texttt{9}}\\
+% |\DI@indexitem@|\marg{cmd}\marg{last}|{9}|\marg{text}^^A
+% |\NoValue|\marg{figures}\marg{next}
+% \end{quote}
+% where \meta{this} is the level of this item, \meta{next} is the
+% level of the next item, \meta{text} is the item text, and
+% \meta{figures} are the (page) numbers for this item. Several of the
+% arguments of |\DI@indexitem@| are immediately gobbled; they are
+% only used when the original |\indexitem| did not have a
+% \meta{numbers} argument.
+%
+% The |\DI@last@level| macro stores the level of the last item before
+% the current. It is set and used by |\DI@indexitem@|.
+% \begin{macrocode}
+%<*pkg>
+\newcommand\indexitem{%
+ \relax
+ \expandafter\DI@indexitem \expandafter{\DI@last@level}%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\DI@indexitem#1#2#3#4{%
+ \edef\DI@last@level{\number#2\expandafter}%
+ \ifnum #4=9
+ \expandafter\expandafter \expandafter\DI@indexitem@
+ \fi
+ \csname DI@indexitem@\romannumeral#2\expandafter\endcsname
+ {#1}{#4}{#3}\NoValue
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\DI@indexitem@#1#2#3#4#5#6#7{#1{#2}{#7}{#4}{#6}}
+% \end{macrocode}
+% \begin{macrocode}
+\def\DI@last@level{0}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% The \describecsfamily{DI@indexitem@\meta{level}}|\DI@indexitem@|^^A
+% \meta{level}, where \meta{level} is the lower case roman numeral form
+% of the level number, family of control sequences have the syntax
+% \begin{quote}
+% |\DI@indexitem@|\meta{level}\,\marg{previous}\marg{next}^^A
+% \marg{text}\marg{figures}
+% \end{quote}
+% where \meta{previous} and \meta{next} are the levels of the previous
+% and following index items, \meta{text} is the entry text of this
+% item, and \meta{figures} are the (page) numbers for this item, if it
+% has any, or the token |\NoValue|, if it hasn't.
+%
+%
+% \xrefoff
+% \begin{macrocode}
+%<*ist|idx|glo>
+group_skip "}{0}\n%^^A\n\\indexnewletter{0}{"
+heading_prefix ""
+heading_suffix ""
+headings_flag 1
+%</ist|idx|glo>
+% \end{macrocode}
+% \SpecialIndex{\indexnewletter}
+% \xrefon
+%
+%
+% \begin{macro}{\indexnewletter}
+% \changes{v\,1.00}{2001/04/05}{Made it \cs{outer}. (LH)}
+% The |\indexnewletter| command is placed in front of a new letter
+% group. It has the syntax
+% \begin{quote}
+% |\indexnewletter|\marg{first}\marg{letter}\marg{next}
+% \end{quote}
+% where \meta{first} is a flag (|1| if this |\indexnewletter|
+% is at the very beginning of the index, |0| otherwise), \meta{letter}
+% is the letter name (according to the \program{makeindex} program; it
+% can be e.g.\ the string `Symbols') and \meta{next} is the level of
+% the next item (I think this will always be |1| with
+% \program{makeindex}). The command takes care of declining an offer
+% to join with the previous index item, inserts some vertical space
+% if the \meta{first} is |0|, print the \meta{letter} using
+% |\DI@letter@format|, and doesn't offer to join with the following
+% item.
+% \begin{macrocode}
+%<*pkg>
+\@ifundefined{indexnewletter}{}{%
+ \PackageInfo
+%<template> {docindex}
+%<!template> {docidx2e}
+ {Command \protect\indexnewletter\space redefined}
+}
+\outer\def\indexnewletter#1#2#3{%
+ \DI@item@nojoin
+ \ifnum #1=\z@ \vspace{\DI@letter@skip}\fi
+ \DI@letter@format{#2}%
+ \def\DI@last@level{0}%
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% The index style files also need to set some parameters which aren't
+% directly connected to the commands provided by the \package{docindex}
+% package. First there's the input style parameters:\xrefoff
+% \begin{macrocode}
+%<*ist|idx|glo>
+actual '='
+quote '!'
+level '>'
+% \end{macrocode}
+% Then the page precedence should be changed. This is mainly for the
+% convenience of use with documents that |\DocInclude| files, since
+% these by default number the files using letters.
+% \begin{macrocode}
+page_precedence "naArR"
+% \end{macrocode}
+% In \texttt{docindex.ist}, both the \texttt{keyword} and the
+% |page_compositor| strings are different from their standard values. It
+% turns out to be hard to use a normal command as page compositor,
+% because \program{makeindex} always rejects spaces and braces in the
+% page number even if they is in the |page_compositor| parameter!
+% \begin{macrocode}
+%<ist>keyword "\\xdocindexentry"
+%<ist>page_compositor "\\+"
+% \end{macrocode}
+% \SpecialIndex{\+}
+% Finally, in the style file for the list of changes, the keyword must
+% be changed to |\glossaryentry|.
+% \begin{macrocode}
+%<glo>keyword "\\glossaryentry"
+%</ist|idx|glo>
+% \end{macrocode}
+% \xrefon
+%
+%
+% \begin{option}{oldkeywords}
+% \begin{macro}{\XD@index@keyword}
+% \begin{macro}{\XD@glossary@keyword}
+% \begin{macro}{\XD@page@compositor}
+% \changes{v\,1.00}{2001/04/05}{Changed it from \cs{PageCompositor-} to
+% \cs{+}. (LH)}
+% To make the contents of the \texttt{.idx} and \texttt{.glo} files
+% compatible with the input parameter settings of
+% \texttt{docindex.ist}, some macros used by the \package{xdoc}
+% package must be redefined. This can however be stopped if the
+% \texttt{oldkeywords} option is passed to the \package{docindex}
+% package.
+% \begin{macrocode}
+%<*pkg>
+\@ifpackagewith
+%<template> {docindex}
+%<!template> {docidx2e}
+ {oldkeywords}{}{
+ \edef\XD@index@keyword{\@backslashchar xdocindexentry}
+ \let\XD@glossary@keyword\XD@index@keyword
+ \def\XD@page@compositor{\@backslashchar +}
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{option}
+%
+% \changes{v\,1.00}{2001/03/25}{The index file is no longer a
+% \texttt{thedocindex} environment---the layout must instead be set
+% by the command which \cs{input}s the index. Introduced the
+% \cs{docindexguard} command to handle situations with incompatible
+% index styles. (LH)}
+%
+% \begin{macro}{\docindexguard}
+% \begin{macro}{\DI@ind@setup}
+% The first line of every \texttt{docindex} style sorted index file is
+% \begin{quote}
+% |\docindexguard{\endinput}|
+% \end{quote}
+% If the index file is inputted as a classical sorted index file then
+% this will produce an undefined command error and no more lines in
+% the index will be read. If the index file is inputted using the
+% conventions of the \package{docindex} package then the
+% |\docindexguard| will instead gobble the |\endinput| so that the
+% file will be read.
+%
+% One can also have the opposite problem: a classical style index file
+% is being input using \package{docindex} conventions. It is to
+% overcome this problem that the |\DI@ind@setup| command has been
+% introduced. Classical style index files begin by a |\begin|
+% command, so that command is temporarily redefined to print a warning
+% message and |\endinput| the file. Should the first command instead
+% be |\docindexguard| then everything will be reset to normal. To
+% accomplish this, |\DI@ind@setup| opens a group which should be
+% closed by the initial |\docindexguard| or |\begin|.
+% \begin{macrocode}
+\def\DI@ind@setup{\bgroup
+ \def\docindexguard##1{\egroup}%
+ \def\begin##1{%
+ \egroup
+ \PackageWarningNoLine
+%<template> {docindex}%
+%<!template> {docidx2e}%
+ {Ignoring old style index file}
+ \endinput
+ }%
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \xrefoff
+% \begin{macrocode}
+%<*idx|glo|ist>
+preamble "\\docindexguard{\\endinput}\n%^^A\n\\indexnewletter{1}{"
+postamble "}{0}\n\\endinput"
+%</idx|glo|ist>
+% \end{macrocode}
+% \SpecialIndex{\docindexguard}
+% \SpecialIndex{\indexnewletter}
+% \xrefon
+%
+% In summary, this is the BNF syntax for a sorted index file that is to
+% be typeset using \package{docindex}:
+% \begin{syntax}
+% \item[sorted index file]
+% \meta{guard}\meta{lettergroups}|\endinput|
+% \item[guard] |\docindexguard{\endinput}|
+% \item[lettergroups] \meta{lettergroup}\branch
+% \meta{lettergroup}\meta{lettergroups}
+% \item[lettergroup] \meta{heading}\meta{items}
+% \item[heading]
+% |\indexnewletter|\marg{first}\marg{letter}\marg{next}
+% \item[items] \meta{empty}\branch \meta{item}\meta{items}
+% \item[item] |\indexitem|\marg{level}\marg{text}\marg{next}\branch
+% |\indexitem|\marg{level}\marg{text}|{9}|\marg{numbers}\marg{next}
+% \end{syntax}
+% A \meta{level} is |1|, |2|, or |3|. A \meta{next} is |0|, |1|, |2|, or
+% |3|. Within a \meta{lettergroup}, the \meta{next} of one \meta{item}
+% or the \meta{heading} must equal the \meta{level} of the next
+% \meta{item} and the \meta{next} of the last item must be |0|. The
+% \meta{first} should be |1| in the first \meta{lettergroup} and |0| in
+% all the others.
+%
+%
+% \subsection{Template mechanisms}
+%
+% The \package{docindex} package loads the \package{xhj} and
+% \package{galley2} packages to gain access to the \texttt{justification}
+% type templates. This indirectly loads the \package{xparse} and
+% \package{template} packages.
+% \begin{macrocode}
+%<*pkg>
+%<template>\RequirePackage{xhj,galley2}
+% \end{macrocode}
+%
+% Since the \package{docidx2e} package doesn't use the template mechanisms
+% provided by the \package{template} package, but still is to follow the
+% logic of the \package{docindex} package which does use these
+% mechanisms, it becomes convenient to define fakes for a couple of
+% \package{template} commands. First \package{docidx2e} checks if the
+% real \package{template} package has been loaded and emits a warning if
+% it has.
+% \begin{macrocode}
+%<*!template>
+\@ifpackageloaded{template}{
+ \PackageWarningNoLine{docidx2e}{The docidx2e package is only meant%
+ \MessageBreak for use when LaTeX2e* packages like
+ template\MessageBreak are not available.}
+}{}
+% \end{macrocode}
+%
+% Before continuing with the definitions, some of the data structures
+% used by the \package{template} mechanisms must be explained. A
+% template \emph{instance} is really only a macro; what makes instances
+% different from macros in general is that they usually aren't
+% explicitly programmed. Instead they are formed by combining two
+% different pieces of code: one which is the code part of some template,
+% and one which is a piece of code which sets the \emph{container}
+% macros\slash registers\slash parameters for the key values of this
+% template. In general, the first piece of code contains the
+% programming-like aspects of what the instance does, whereas the latter
+% contains those that have to do with lauout and design. The advantage
+% of this model is that it lets you implement many layouts without
+% requiring you to know everything about \LaTeX\ programming that it
+% would take to implement everything using macros.
+%
+% Instances are stored in control sequences of the form
+% \begin{quote}
+% \describecsfamily{TP@I{\meta{collection}}\break
+% {\meta{type}}\break{\meta{name}}}
+% |\TP@I|\marg{collection}\marg{type}\marg{name}
+% \end{quote}
+% The \meta{type} is the primary distinction between instances; for each
+% type there exists a specification of what all instances of that type
+% must do, and all instances of a type must be interchangeable. In
+% particular, all instances of a given template type must have the same
+% argument structure. The \meta{name} is simply the name used to
+% identify the instance (amongst all other instances of that type).
+% Finally, the \meta{collection} is something which can be used in
+% circumstances where one needs to quickly switch between different
+% definitions of an instance. If they have different \meta{collection}s
+% then they can exist simutaneously; which of them is used is determined
+% by which collection is currently active.
+%
+% Collections are active on a ``per type'' basis; which collection is
+% active for instances of type \meta{type} is determined by the
+% contents of the \describecsfamily{TP@T{\meta{type}}}
+% |\TP@T|\marg{type} control sequences, which are macros with the
+% structure
+% \begin{quote}
+% \marg{collection}\marg{arguments}
+% \end{quote}
+% If there is no instance with the requested name in the currently
+% active collection then the instance with the same name from the
+% normal collection (whose name is the empty string) will be used. The
+% \meta{arguments} part of the macro is simply the number of arguments
+% of instances of this type; it is only used when declaring templates.
+%
+% \begin{macro}{\UseCollection}
+% The |\UseCollection| command sets the active collection for a given
+% type. It has the syntax
+% \begin{quote}
+% |\UseCollection|\marg{type}\marg{collection}
+% \end{quote}
+% This macro was used up to v\,1.00 of \package{docindex} but a change
+% in the package logic made it unnecessary.
+% \begin{macrocode}
+% \providecommand*\UseCollection[2]{%
+% \expandafter\edef \csname TP@T{#1}\endcsname{%
+% {#2}%
+% {\expandafter\expandafter \expandafter\@secondoftwo
+% \csname TP@T{#1}\endcsname}%
+% }%
+% }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@letinstance}
+% The |\@letinstance| macro |\let|s the (currently used) instance
+% with given name and type to the \meta{target} control sequence. It
+% has the syntax
+% \begin{quote}
+% |\@letinstance|\marg{target}\marg{type}\marg{name}
+% \end{quote}
+% \begin{macrocode}
+\def\@letinstance#1#2#3{%
+ \expandafter\let \expandafter#1%
+ \csname TP@I%
+ {\expandafter\expandafter \expandafter\@firstoftwo
+ \csname TP@T{#2}\endcsname}%
+ {#2}{#3}%
+ \endcsname
+ \ifx \relax#1%
+ \expandafter\let \expandafter#1\csname TP@I{}{#2}{#3}\endcsname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\UseInstance}
+% The |\UseInstance| calls the (currently used) instance with given
+% name and type. Its syntax is
+% \begin{quote}
+% |\UseInstance|\marg{type}\marg{name}\,\meta{arguments of instance}
+% \end{quote}
+% \begin{macrocode}
+\providecommand*\UseInstance[2]{%
+ \@letinstance\@tempa{#1}{#2}%
+ \ifx \relax\@tempa
+ \PackageError{docidx2e}{Instance #2 of type #1 undefined}\@eha
+ \else
+ \expandafter\@tempa
+ \fi
+}
+%</!template>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Templates for index item formatting}
+%
+% \begin{templatetype}{justification}
+% In \package{docidx2e}, we have to provide a dummy definition of
+% |\TP@T{justification}|.
+% \begin{macrocode}
+%<!template>\@namedef{TP@T{justification}}{{}{0}}
+% \end{macrocode}
+% \end{templatetype}
+%
+% \changes{v\,1.00}{2001/04/08}{Using \texttt{single} template rather
+% than the \texttt{std} template for the \texttt{indexitem}$n$
+% instances of type \texttt{justification}. (LH)}
+% \begin{instance}{justification}{indexitem1}
+% \begin{instance}{justification}{indexitem2}
+% \begin{instance}{justification}{indexitem3}
+% The \texttt{indexitem}\meta{level} instances of the
+% \texttt{justification} template set up paragraph indentation etc.\
+% for a paragraph containing an index item at that level. The layout
+% is the same as that used by the \package{doc} package, but it is
+% not specified in quite the same way.
+% \begin{macrocode}
+%<*template>
+\DeclareInstance{justification}{indexitem1}{single}{
+ leftskip=30pt, rightskip=15pt, startskip=-30pt, parfillskip=-15pt,
+ linefillskip=0pt plus 1fil, parindent=0pt
+}
+\DeclareInstance{justification}{indexitem2}{single}{
+ leftskip=30pt, rightskip=15pt, startskip=-15pt, parfillskip=-15pt,
+ linefillskip=0pt plus 1fil, parindent=0pt
+}
+\DeclareInstance{justification}{indexitem3}{single}{
+ leftskip=30pt, rightskip=15pt, startskip=-5pt, parfillskip=-15pt,
+ linefillskip=0pt plus 1fil, parindent=0pt
+}
+%</template>
+%<*!template>
+\@namedef{TP@I{}{justification}{indexitem1}}{%
+ \leftskip=30\p@
+ \rightskip=15\p@
+ \parindent=-30\p@
+ \parfillskip=-\rightskip
+}
+\@namedef{TP@I{}{justification}{indexitem2}}{%
+ \leftskip=30\p@
+ \rightskip=15\p@
+ \parindent=-15\p@
+ \parfillskip=-\rightskip
+}
+\@namedef{TP@I{}{justification}{indexitem3}}{%
+ \leftskip=30\p@
+ \rightskip=15\p@
+ \parindent=-5\p@
+ \parfillskip=-\rightskip
+}
+%</!template>
+% \end{macrocode}
+% \end{instance}\end{instance}\end{instance}
+%
+%
+%
+% \subsubsection{The \texttt{indexitem} template type}
+%
+% \begin{templatetype}{indexitem}
+% \begin{macro}{\DI@item@nojoin}
+% \begin{macro}{\DI@item@join}
+% The argument structure of a template of type \texttt{indexitem} is
+% \begin{quote}
+% \marg{previous}\marg{next}\marg{text}\marg{figures}
+% \end{quote}
+% \meta{previous} and \meta{next} are the level codes of the index
+% item before and after the current item, \meta{text} is the item text
+% of the current index item, and \meta{figures} are the (page) numbers
+% for this item, if it has any, or the token |\NoValue|, if it hasn't.
+%
+% Templates of this type format and typeset one item in an index. In
+% doing so they may do pretty much anything as long as the other items
+% aren't affected: they may start and end paragraphs, change the
+% paragraph justification, \textellipsis
+%
+% There is however one area in which the rules are rather strict, and
+% that has to do with when two items can be joined. In a case where
+% item A is followed by item B, item A can propose to item B that they
+% should be joined and item B can then accept or decline this offer.
+% Technically the offer consists of defining the two macros
+% |\DI@item@join| and |\DI@item@nojoin|. If item B accepts the offer
+% it will execute |\DI@item@join| and if it declines the offer it
+% will execute |\DI@item@nojoin|. A typical definition of
+% |\DI@item@join| might be to insert a punctuation mark and a typical
+% definition of |\DI@item@nojoin| might be to end the current paragraph.
+%
+% There is however also a third case, namely that no offer was given.
+% In this case |\DI@item@nojoin| should be |\let| to |\@empty| and
+% |\DI@item@join| should be |\let| to |\@firstofone|. The reason for
+% this last rule is that |\DI@item@join| has the syntax
+% \begin{quote}
+% |\DI@item@join|\marg{no-join recovery code}
+% \end{quote}
+% where the \meta{no-join recovery code} is code that item B needs to
+% have executed if there is no join although item B would have
+% accepted it. |\DI@item@nojoin|, on the other hand, takes no
+% argument.
+% \begin{macrocode}
+%<template>\DeclareTemplateType{indexitem}{4}
+%<!template>\@namedef{TP@T{indexitem}}{{}{4}}
+\let\DI@item@join=\@firstofone
+\let\DI@item@nojoin=\@empty
+% \end{macrocode}
+% \end{macro}\end{macro}\end{templatetype}
+%
+% \begin{template}{indexitem}{fixed}
+% The \texttt{fixed} template of type \texttt{indexitem} formats an
+% item as the items in \package{doc}'s \texttt{theindex} environment.
+% It is fixed in that it ignores the levels of the surrounding items.
+%
+% The keys for this template are:
+% \begin{description}
+% \keyvalitem{justification-setup}{i}
+% This is a template instance of type \texttt{justification}. It
+% sets the justification for the paragraph containing the item,
+% unless the item is being joined with the preceeding item.
+% \keyvalitem{pre-join}{b}
+% A switch for whether the item should accept to be joined with
+% the item before. True means ``accept'', false means ``decline''
+% (which is the default).
+% \keyvalitem{nofig-action}{f1}
+% If the \meta{figures} argument is |\NoValue| then the \meta{text}
+% argument is passed on to this macro for the actual formatting.
+% The default expansion is precisely the \meta{text}.
+% \keyvalitem{fig-action}{f2}
+% If the \meta{figures} argument is not |\NoValue| then the
+% \meta{text} and \meta{figures} arguments are passed on (in that
+% order) to this macro for the actual formatting. The default
+% expansion is
+% \begin{quote}
+% \meta{text}|\pfill|\meta{figures}
+% \end{quote}
+% \keyvalitem{post-join}{b}
+% A switch for whether the item should offer to join with the
+% following item. True means ``make offer'', false (which is the
+% default) means ``don't make offer''. Making the offer is
+% furthermore conditioned by that the \meta{figures} argument is
+% |\NoValue|.
+% \keyvalitem{nojoin-extra}{f0}
+% Extra code which is inserted after the normal code for an item
+% if the item neither has any figures nor offers to join with the
+% following item. The default value is a space of length
+% \textit{linefillskip} followed by a |\nopagebreak|.^^A
+% \changes{v\,0.03}{2001/02/24}{Added the \textit{nojoin-extra}
+% key. (LH)}^^A
+% \changes{v\,0.03}{2001/02/25}{Added \cs{nopagebreak} from
+% \cs{efill} to default for \textit{nojoin-extra} key. (LH)}
+% \keyvalitem{join-extra}{f0}
+% Extra text which is inserted after the normal text of the item
+% if there is a join, by default a comma and a space.
+% \keyvalitem{offjoin-extra}{f0}
+% Extra code which is inserted after the normal text of the item
+% if a join is offered but declined. The default value is a space
+% of length \textit{linefillskip} followed by a |\nopagebreak|
+% (larger than the one from \textit{nojoin-extra}; if not for
+% this, the default could have been taken to be
+% |\DI@nojoin@extra|).
+% \end{description}
+%
+% Note that the contents of the \textit{nojoin-extra},
+% \textit{join-extra}, and \textit{offjoin-extra} keys must be robust
+% as they may be subjected to a |\protected@edef|.
+% \changes{v\,0.03}{2001/02/24}{\cs{protected@edef}ing the macros
+% \cs{DI@item@join} and \cs{DI@item@nojoin}. (LH)}
+%
+% \begin{macrocode}
+%<*template>
+\DeclareTemplate{indexitem}{fixed}{4}{
+ justification-setup =i{justification} \DI@item@justification,
+ pre-join =b
+%<default> {false}
+ DI@prejoin@,
+ nofig-action =f1
+%<default> {#1}
+ \DI@nofig,
+ fig-action =f2
+%<default> {#1\pfill#2}
+ \DI@hasfig,
+ post-join =b
+%<default> {false}
+ DI@postjoin@,
+ nojoin-extra =f0
+%<default> {\hspace*{\justification@g}
+%<default> \protect\nopagebreak[2]}
+ \DI@nojoin@extra,
+ join-extra =f0
+%<default> {,\space}
+ \DI@join@extra,
+ offjoin-extra =f0
+%<default> {\hspace*{\justification@g}
+%<default> \protect\nopagebreak[4]}
+ \DI@offjoin@extra
+}{%
+%<*!default>
+ \let\ifDI@prejoin@\iffalse
+ \let\DI@nofig\@firstofone
+ \def\DI@hasfig##1##2{##1\pfill##2}%
+ \let\ifDI@postjoin@\iffalse
+ \def\DI@nojoin@extra{%
+ \hspace*{\justification@g}\protect\nopagebreak[2]%
+ }%
+ \def\DI@join@extra{,\space}%
+ \def\DI@offjoin@extra{%
+ \hspace*{\justification@g}\protect\nopagebreak[4]%
+ }%
+%</!default>
+ \DoParameterAssignments
+ \ifDI@prejoin@
+ \DI@item@join{\DI@item@justification}%
+ \else
+ \DI@item@nojoin\DI@item@justification
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \IfNoValueTF{#4}{%
+ \DI@nofig{#3}%
+ \ifDI@postjoin@
+ \protected@edef\DI@item@join##1{\DI@join@extra}%
+ \protected@edef\DI@item@nojoin{\DI@offjoin@extra\protect\par}%
+ \else
+ \DI@nojoin@extra\par
+ \fi
+ }{%
+ \DI@hasfig{#3}{#4}%
+ \par
+ }%
+ \ignorespaces
+}
+% \end{macrocode}
+% \end{template}
+%
+% \begin{instance}{indexitem}{fixed1}
+% \begin{instance}{indexitem}{fixed2}
+% \begin{instance}{indexitem}{fixed3}
+% The \texttt{fixed1}, \texttt{fixed2}, and \texttt{fixed3} instances
+% of type \texttt{indexitem} are simply the \texttt{fixed} template
+% with different values assigned to the \textit{justification-setup}
+% key.
+% \begin{macrocode}
+\DeclareInstance{indexitem}{fixed1}{fixed}
+ {justification-setup = indexitem1}
+\DeclareInstance{indexitem}{fixed2}{fixed}
+ {justification-setup = indexitem2}
+\DeclareInstance{indexitem}{fixed3}{fixed}
+ {justification-setup = indexitem3}
+%</template>
+%<*!template>
+\@namedef{TP@I{}{indexitem}{fixed1}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem1}%
+ \DI@item@nojoin
+ \DI@item@justification
+ \ifx \NoValue#4%
+ #3\nobreak\hfil\nopagebreak[2]%
+ \else
+ #3\pfill#4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+\@namedef{TP@I{}{indexitem}{fixed2}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem2}%
+ \DI@item@nojoin
+ \DI@item@justification
+ \ifx \NoValue#4%
+ #3\nobreak\hfil\nopagebreak[2]%
+ \else
+ #3\pfill#4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+\@namedef{TP@I{}{indexitem}{fixed3}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem3}%
+ \DI@item@nojoin
+ \DI@item@justification
+ \ifx \NoValue#4%
+ #3\nobreak\hfil\nopagebreak[2]%
+ \else
+ #3\pfill#4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+%</!template>
+% \end{macrocode}
+% \end{instance}\end{instance}\end{instance}
+%
+% \begin{instance}{indexitem}{fixed-r1a}
+% \begin{instance}{indexitem}{fixed-r2a-nocomma}
+% \begin{instance}{indexitem}{fixed-a3r}
+% The \texttt{fixed-r1a}, \texttt{fixed-r2a-nocomma}, and
+% \texttt{fixed-a3r} instances of type \texttt{indexitem} are again
+% based on the \texttt{fixed} template, but here they always accept
+% (or offer) to join with one neighbouring item, whereas they always
+% reject to join with the other. As before, they differ in their
+% values of the \textit{justification-setup} key, and the
+% \texttt{-nocomma} is because that instance only inserts a space,
+% not a comma and a space, when items are joined.
+% \begin{macrocode}
+%<*template>
+\DeclareInstance{indexitem}{fixed-r1a}{fixed}
+ {justification-setup = indexitem1, post-join = true}
+\DeclareInstance{indexitem}{fixed-r2a-nocomma}{fixed}
+ {justification-setup = indexitem2,
+ post-join = true, join-extra = {\space}}
+\DeclareInstance{indexitem}{fixed-a3r}{fixed}
+ {justification-setup = indexitem3, pre-join = true}
+%</template>
+%<*!template>
+\@namedef{TP@I{}{indexitem}{fixed-r1a}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem1}%
+ \DI@item@nojoin
+ \DI@item@justification
+ \ifx \NoValue#4%
+ #3%
+ \def\DI@item@join##1{, }%
+ \def\DI@item@nojoin{\nobreak\hfil\nopagebreak[4]\par}%
+ \else
+ #3\pfill#4\par
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \fi
+ \ignorespaces
+}
+\@namedef{TP@I{}{indexitem}{fixed-r2a-nocomma}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem2}%
+ \DI@item@nojoin
+ \DI@item@justification
+ \ifx \NoValue#4%
+ #3%
+ \def\DI@item@join##1{ }%
+ \def\DI@item@nojoin{\nobreak\hfil\nopagebreak[4]\par}%
+ \else
+ #3\pfill#4\par
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \fi
+ \ignorespaces
+}
+\@namedef{TP@I{}{indexitem}{fixed-a3r}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem3}%
+ \DI@item@join{\DI@item@justification}%
+ \ifx \NoValue#4%
+ #3\hfil\nopagebreak[2]%
+ \else
+ #3\pfill#4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+%</!template>
+% \end{macrocode}
+% \end{instance}\end{instance}\end{instance}
+%
+%
+% \begin{template}{indexitem}{aloneaccept}
+% The \texttt{aloneaccept} template of type \texttt{indexitem} formats
+% an item as the items in \package{doc}'s \texttt{theindex} environment.
+% It accepts to be joined with the preceeding item if and only if
+% both that and the following item are at a lower level than the item
+% itself is.
+%
+% The keys for this template are:
+% \begin{description}
+% \keyvalitem{justification-setup}{i}
+% This is a template instance of type \texttt{justification}. It
+% sets the justification for the paragraph containing the item,
+% unless the item is being joined with the preceeding item.
+% \keyvalitem{ownlevel}{C}
+% This is the (nominal) level of this item; it will accept a join
+% with the preceeding item if and only if the levels of both that
+% and the following item are different from this number.
+% \changes{v\,1.00}{2001/03/25}{Changed condition for accepting a
+% join from ``neighbouring item levels are lower'' to
+% ``neighbouring item levels are not equal to''. (LH)}
+% The default is 2.
+% \keyvalitem{nofig-action}{f1}
+% If the \meta{figures} argument is |\NoValue| then the \meta{text}
+% argument is passed on to this macro for the actual formatting.
+% The default expansion is the \meta{text} followed by a space of
+% linefillskip.
+% \keyvalitem{fig-action}{f2}
+% If the \meta{figures} argument is not |\NoValue| then the
+% \meta{text} and \meta{figures} arguments are passed on (in that
+% order) to this macro for the actual formatting. The default
+% expansion is
+% \begin{quote}
+% \meta{text}|\pfill|\meta{figures}
+% \end{quote}
+% \keyvalitem{post-join}{b}
+% A switch for whether the item should offer to join with the
+% following item. True means ``make offer'', false (which is the
+% default) means ``don't make offer''. Making the offer is
+% furthermore conditioned by that the \meta{figures} argument is
+% |\NoValue|.
+% \keyvalitem{nojoin-extra}{f0}
+% Extra code which is inserted after the normal code for an item
+% if the item neither has any figures nor offers to join with the
+% following item. The default value is a space of length
+% \textit{linefillskip}.
+% \changes{v\,0.03}{2001/02/24}{Added the \textit{nojoin-extra}
+% key. (LH)}
+% \keyvalitem{join-extra}{f0}
+% Extra text which is inserted after the normal text of the item
+% if there is a join, by default a comma and a space.
+% \keyvalitem{offjoin-extra}{f0}
+% Extra code which is inserted after the normal text of the item
+% if a join is offered but declined, by default the
+% \textit{nojoin-extra} code followed by a |\nopagebreak|.
+% \end{description}
+%
+% Note that the contents of the \textit{nojoin-extra},
+% \textit{join-extra}, and \textit{offjoin-extra} keys must be robust
+% as they may be subjected to a |\protected@edef|.
+% \changes{v\,0.03}{2001/02/24}{\cs{protected@edef}ing the macros
+% \cs{DI@item@join} and \cs{DI@item@nojoin}. (LH)}
+%
+% \begin{macrocode}
+%<*template>
+\DeclareTemplate{indexitem}{aloneaccept}{4}{
+ justification-setup =i{justification} \DI@item@justification,
+ ownlevel =C
+%<default> {2}
+ \DI@this@level,
+ nofig-action =f1
+%<default> {#1}
+ \DI@nofig,
+ fig-action =f2
+%<default> {#1\pfill#2}
+ \DI@hasfig,
+ post-join =b
+%<default> {false}
+ DI@postjoin@,
+ nojoin-extra =f0
+%<default> {\hspace*{\justification@g}}
+ \DI@nojoin@extra,
+ join-extra =f0
+%<default> {,\space}
+ \DI@join@extra,
+ offjoin-extra =f0
+%<default> {\DI@nojoin@extra\protect\nopagebreak[4]}
+ \DI@offjoin@extra
+}{%
+%<*!default>
+ \def\DI@this@level{2}%
+ \let\DI@nofig\@firstofone
+ \def\DI@hasfig##1##2{##1\pfill##2}%
+ \let\ifDI@postjoin@\iffalse
+ \def\DI@nojoin@extra{\hspace*{\justification@g}}%
+ \def\DI@join@extra{,\space}%
+ \def\DI@offjoin@extra{\DI@nojoin@extra\protect\nopagebreak[4]}%
+%</!default>
+ \DoParameterAssignments
+ \ifnum \DI@this@level=#1
+ \DI@item@nojoin \DI@item@justification
+ \else\ifnum \DI@this@level=#2
+ \DI@item@nojoin \DI@item@justification
+ \else
+ \DI@item@join{\DI@item@justification}%
+ \fi\fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \IfNoValueTF{#4}{%
+ \DI@nofig{#3}%
+ \ifDI@postjoin@
+ \protected@edef\DI@item@join##1{\DI@join@extra}%
+ \protected@edef\DI@item@nojoin{\DI@offjoin@extra\protect\par}%
+ \else
+ \DI@nojoin@extra \par
+ \fi
+ }{%
+ \DI@hasfig{#3}{#4}%
+ \par
+ }%
+ \ignorespaces
+}
+%</template>
+% \end{macrocode}
+% \end{template}
+%
+% \begin{instance}{indexitem}{aloneaccept2}
+% \begin{instance}{indexitem}{aloneaceept3}
+% The \texttt{aloneaccept2} and \texttt{aloneaccept3} instances of type
+% \texttt{indexitem} are simply the \texttt{aloneaccept} template
+% with the levels fixed to two and three, respectively.
+% \begin{macrocode}
+%<*template>
+\DeclareInstance{indexitem}{aloneaccept2}{aloneaccept}
+ {justification-setup = indexitem2, ownlevel = 2}
+\DeclareInstance{indexitem}{aloneaccept3}{aloneaccept}
+ {justification-setup = indexitem3, ownlevel = 3}
+%</template>
+%<*!template>
+\@namedef{TP@I{}{indexitem}{aloneaccept2}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem2}%
+ \ifnum #1=\tw@
+ \DI@item@nojoin \DI@item@justification
+ \else\ifnum #2=\tw@
+ \DI@item@nojoin \DI@item@justification
+ \else
+ \DI@item@join{\DI@item@justification}%
+ \fi\fi
+ \ifx \NoValue#4%
+ #3\nobreak\hfil\vadjust{}%
+ \else
+ #3\pfill #4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+\@namedef{TP@I{}{indexitem}{aloneaccept3}}#1#2#3#4{%
+ \@letinstance\DI@item@justification{justification}{indexitem3}%
+ \ifnum #1=\thr@@
+ \DI@item@nojoin \DI@item@justification
+ \else\ifnum #2=\thr@@
+ \DI@item@nojoin \DI@item@justification
+ \else
+ \DI@item@join{\DI@item@justification}%
+ \fi\fi
+ \ifx \NoValue#4%
+ #3\nobreak\hfil\vadjust{}%
+ \else
+ #3\pfill #4%
+ \fi
+ \let\DI@item@join\@firstofone
+ \let\DI@item@nojoin\@empty
+ \par
+}
+%</!template>
+% \end{macrocode}
+% \end{instance}\end{instance}
+%
+%
+% \subsubsection{The \texttt{docindex} template type}
+%
+% \begin{templatetype}{docindex}
+% A template of type \texttt{docindex} takes care of typesetting an
+% index found in a file (which is |\input|ted as part of this
+% process), hence using an instance of type \texttt{docindex} is
+% the same kind of action that the |\printindex| and |\printglossary|
+% commands make.
+%
+% The template decides from which file the index should be read. It
+% takes two arguments: the index prologue and the index epilogue.
+% These are two pieces of text (which may just as well include a
+% sectioning command) that are printed just before and after the
+% index. Either argument may be empty. Immediately after the file
+% containing the body of the index has been inputted, the template
+% must execute |\DI@item@nojoin| to make sure that the last item is
+% properly typeset.
+%
+% Templates of type \texttt{docindex} must begin by opening a group
+% and end by closing it. They must furthermore locally define the
+% following macros before any part of the index is typeset.
+% \begin{description}
+% \item[\cs{DI@indexitem@i}, \cs{DI@indexitem@ii}, and
+% \cs{DI@indexitem@iii}]
+% Handlers for index items at level 1, 2, and 3 respectively.
+% These handlers must conform to the specification for
+% \texttt{indexitem} instances.
+% \item[\cs{DI@letter@skip}, \cs{DI@letter@format}]
+% These are described in the comments to the |\indexnewletter|
+% command.
+% \item[\cs{+}]
+% The command for typesetting the separator between two parts of
+% a composite (page) number. This is a parameterless macro.
+% \end{description}
+%
+% \begin{macrocode}
+%<template>\DeclareTemplateType{docindex}{2}
+%<!template>\@namedef{TP@T{docindex}}{{}{2}}
+% \end{macrocode}
+% \end{templatetype}
+%
+% \begin{template}{docindex}{std}
+% The \texttt{std} template of type \texttt{docindex} typesets an
+% index while providing all the formatting parameters of the
+% \package{doc} index and list of changes (and a few more).
+% \changes{v\,1.00}{2001/04/08}{The \mbox{\textit{-font}} keyvals
+% renamed to \mbox{\textit{-setup}}, but the type stayed the
+% same (f0). (LH)}
+%
+% \label{docindex:std}
+% The keys of the template are:
+% \begin{description}
+% \keyvalitem{file-name}{n}
+% The base name of the file in which the index is stored, by
+% default the |\jobname|.\changes{v\,1.00}{2001/03/25}{Added
+% \textit{file-name} and \textit{file-extension} keys, removed
+% the \textit{default-prologue} and \textit{default-epilogue}
+% keys. (LH)}
+% \keyvalitem{file-extension}{n}
+% The extension of the file in which the index is stored, by
+% default \texttt{ind}.
+% \keyvalitem{item1}{i}
+% \texttt{indexitem} instance for level 1 items, by default
+% \texttt{fixed1}.
+% \keyvalitem{item2}{i}
+% \texttt{indexitem} instance for level 2 items, by default
+% \texttt{fixed2}.
+% \keyvalitem{item3}{i}
+% \texttt{indexitem} instance for level 3 items, by default
+% \texttt{fixed3}.
+% \keyvalitem{columns}{C}
+% The number of columns in the index, by default 3.
+% \keyvalitem{reserved-height}{L}
+% The minimal amount of vertical space that must be left on the
+% current page if the index is to start on it, by default
+% 80\,pt.^^A
+% \changes{v\,1.00}{2001/03/25}{Made \textit{reserved-height} work
+% even when \textit{columns} is 1 by using the
+% \package{multicol} macro \cs{enough@room}. (LH)}
+% \keyvalitem{column-sep}{l}
+% The horizontal separation between columns in the index, by
+% default 10\,pt. (This may seem strange in comparison with
+% \package{doc}, since |\IndexParms| contains the command
+% |\columnsep=15pt|, but \package{doc} doesn't execute
+% |\IndexParms| until \LaTeX\ is already in multi-column mode, and
+% then it is too late for the changed value to have any effect.)
+% \keyvalitem{prologue-setup}{f0}
+% Various commands setting layout parameters (e.g.\ the font) for
+% the prologue; by default empty.
+% \keyvalitem{body-setup}{f0}
+% Various commands setting layout parameters (e.g.\ the font) for
+% the body of the index; by default |\small|.
+% \keyvalitem{epilogue-setup}{f0}
+% Various commands setting layout parameters (e.g.\ the font) for
+% the epilogue; by default |\normalsize| (to counter the |\small|
+% in the \textit{body-setup}).
+% \keyvalitem{letter-skip}{L}
+% The skip inserted before a new letter group, by default 10\,pt
+% plus 2\,pt minus 3\,pt.
+% \keyvalitem{letter-format}{f1}
+% The macro which formats new letter groups; the argument is the
+% heading for the group, as generated by \program{makeindex}. By
+% defaults it typesets the argument in boldface, centered on a
+% line.
+% \keyvalitem{pagestyle}{n}
+% If this is nonempty then the pagestyle by that name will be
+% selected for the index. By default it is empty.
+% \keyvalitem{parskip}{l}
+% The value of |\parskip| to use inside the index, by default
+% 0\,pt plus 1\,pt. This key value is likely to change as the
+% \LaTeXplus\ interfaces for galleys evolve.
+% \changes{v\,0.03}{2001/02/27}{Added \textit{parskip} keyval. (LH)}
+% \keyvalitem{page-compositor}{f0}
+% The text that is typeset to separate two parts of a composite
+% (page) number, by default a hyphen.
+% \changes{v\,1.00}{2001/04/05}{Added \textit{page-compositor}
+% keyval. (LH)}
+% \end{description}
+%
+% \begin{macrocode}
+%<*template>
+\DeclareTemplate{docindex}{std}{2}{
+ file-name =n
+%<default> {\jobname}
+ \DI@file@name,
+ file-extension =n
+%<default> {ind}
+ \DI@file@ext,
+ item1 =i{indexitem}
+%<default> {fixed1}
+ \DI@indexitem@i,
+ item2 =i{indexitem}
+%<default> {fixed2}
+ \DI@indexitem@ii,
+ item3 =i{indexitem}
+%<default> {fixed3}
+ \DI@indexitem@iii,
+ reserved-height =L
+%<default> {80pt}
+ \DI@reserved@height,
+ columns =C
+%<default> {3}
+ \DI@columns,
+ column-sep =l
+%<default> {10pt}
+ \columnsep,
+ prologue-setup =f0
+%<default> {}
+ \DI@prologue@setup,
+ body-setup =f0
+%<default> {\small}
+ \DI@body@setup,
+ epilogue-setup =f0
+%<default> {\normalsize}
+ \DI@epilogue@setup,
+ letter-skip =L
+%<default> {10pt plus 2pt minus 3pt}
+ \DI@letter@skip,
+ letter-format =f1
+%<default> {\UseInstance{justification}{center}%
+%<default> \textbf{#1}\nopagebreak\csname par\endcsname}
+ \DI@letter@format,
+ pagestyle =n
+%<default> {}
+ \DI@pagestyle,
+ parskip =l
+%<default> {0pt plus 1pt}
+ \parskip,
+ page-compositor =f0
+%<default> {-}
+ \+
+}{%
+ \begingroup
+%<*!default>
+ \def\DI@file@name{\jobname}%
+ \def\DI@file@ext{ind}%
+ \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
+ \@letinstance\DI@indexitem@ii{indexitem}{fixed2}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
+ \def\DI@reserved@height{80pt}%
+ \def\DI@columns{3}%
+ \columnsep=10pt%
+ \let\DI@prologue@setup\@empty
+ \def\DI@body@setup{\small}%
+ \def\DI@epilogue@setup{\normalsize}%
+ \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
+ \def\DI@letter@format##1{%
+ \UseInstance{justification}{center}%
+ \textbf{##1}\nopagebreak\par
+ }%
+ \parskip=\z@\@plus\p@
+ \let\DI@pagestyle\@empty
+ \def\+{-}%
+%</!default>
+ \DoParameterAssignments
+ \IfFileExists{\DI@file@name.\DI@file@ext}{%
+ \ifnum \DI@columns>\@ne
+ \begin{multicols}{\DI@columns}%
+ [\DI@prologue@setup #1][\DI@reserved@height]%
+ \else
+ \enough@room{\DI@reserved@height}%
+ \DI@prologue@setup #1\par
+ \addvspace\multicolsep
+ \fi
+ \ifx \DI@pagestyle\@empty \else \pagestyle{\DI@pagestyle}\fi
+ \DI@body@setup
+ \DI@ind@setup
+ \input{\DI@file@name.\DI@file@ext}%
+ \DI@item@nojoin
+ \ifx \DI@pagestyle\@empty \else
+ \expandafter\thispagestyle \expandafter{\DI@pagestyle}%
+ \fi
+ \ifnum \DI@columns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \DI@epilogue@setup #2\par
+ }{\typeout{No file \DI@file@name.\DI@file@ext.}}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{template}
+%
+%
+% \begin{instance}{docindex}{index}
+% \begin{option}{usedocindexps}
+% The \texttt{index} instance of the \texttt{docindex} template type
+% prints the normal index (as opposed to the list of changes). There
+% are two different definitions of the instance: one which sets the
+% pagestyle in the index, and one which does not; which one is used
+% depends on whether the \texttt{usedocindexps} option has been
+% passed to the package or not.
+% \begin{macrocode}
+\@ifpackagewith{docindex}{usedocindexps}{%
+ \DeclareInstance{docindex}{index}{std}{pagestyle=docindex}%
+}{%
+ \DeclareInstance{docindex}{index}{std}{}%
+}
+%</template>
+% \end{macrocode}
+%
+% The implementations of the \texttt{index} instance in
+% \package{docidx2e} are slightly off in that they use \package{doc}
+% parameters for various settings in the extent such parameters exist.
+% \changes{v\,0.03}{2001/02/24}{Added \cs{@nobreakfalse} in
+% \package{docidx2e} implementation; the first item in the index
+% does not directly follow a \cs{section}-type heading. (LH)}
+% \label{p:index-instance}
+% \begin{macrocode}
+%<*!template>
+\@ifpackagewith{docidx2e}{usedocindexps}{%
+ \@namedef{TP@I{}{docindex}{index}}#1#2{%
+ \begingroup
+ \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
+ \@letinstance\DI@indexitem@ii{indexitem}{fixed2}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
+ \def\DI@letter@format##1{%
+ \par
+ \hb@xt@\hsize{\hfil\textbf{##1}\hfil}%
+ \nopagebreak
+ }%
+ \def\+{-}%
+ \IfFileExists{\jobname.ind}{%
+ \ifnum \c@IndexColumns>\@ne
+ \begin{multicols}{\c@IndexColumns}[#1][\IndexMin]%
+ \else
+ \enough@room{\IndexMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \pagestyle{docindex}%
+ \small
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.ind}%
+ \DI@item@nojoin
+ \thispagestyle{docindex}
+ \ifnum \c@IndexColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.ind.}}%
+ \endgroup
+ }
+}{%
+ \@namedef{TP@I{}{docindex}{index}}#1#2{%
+ \begingroup
+ \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
+ \@letinstance\DI@indexitem@ii{indexitem}{fixed2}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
+ \def\DI@letter@format##1{%
+ \par
+ \hb@xt@\hsize{\hfil\textbf{##1}\hfil}%
+ \nopagebreak
+ }%
+ \def\+{-}%
+ \IfFileExists{\jobname.ind}{%
+ \ifnum \c@IndexColumns>\@ne
+ \begin{multicols}{\c@IndexColumns}[#1][\IndexMin]%
+ \else
+ \enough@room{\IndexMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \small
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.ind}%
+ \DI@item@nojoin
+ \ifnum \c@IndexColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.ind.}}%
+ \endgroup
+ }
+}
+%</!template>
+% \end{macrocode}
+% \end{option}\end{instance}
+%
+%
+% \begin{instance}{docindex}{changes}
+% The \texttt{changes} instance of the \texttt{docindex} template
+% type typesets a \package{doc} list of changes.
+% \changes{v\,0.03}{2001/02/24}{Added \cs{@nobreakfalse} in
+% \package{docidx2e} implementation; the first item in the index
+% does not directly follow a \cs{section}-type heading. (LH)}
+% \changes{v\,1.00}{2001/04/07}{Added \cs{makeatletter} in
+% \package{docidx2e} implementation; it doesn't hurt and it is
+% sometimes necessary (when commands that expand to private
+% control sequences are used in the argument of \cs{changes}).
+% (LH)}
+% \begin{macrocode}
+%<*template>
+\DeclareInstance{docindex}{changes}{std}{
+ file-extension = gls,
+ item2 = fixed-r2a-nocomma,
+ item3 = fixed-a3r,
+ columns = 2,
+ letter-format = {},
+ letter-skip = \z@skip
+}
+%</template>
+% \end{macrocode}
+% \label{p:changes-instance}
+% \begin{macrocode}
+%<*!template>
+\@namedef{TP@I{}{docindex}{changes}}#1#2{%
+ \begingroup
+ \@letinstance\DI@indexitem@i{indexitem}{fixed1}%
+ \@letinstance\DI@indexitem@ii{indexitem}{fixed-r2a-nocomma}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed-a3r}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{\z@skip}%
+ \let\DI@letter@format\@gobble
+ \def\+{-}%
+ \IfFileExists{\jobname.gls}{%
+ \ifnum \c@GlossaryColumns>\@ne
+ \begin{multicols}{\c@GlossaryColumns}[#1][\GlossaryMin]%
+ \else
+ \enough@room{\GlossaryMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \small
+ \makeatletter
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.gls}%
+ \DI@item@nojoin
+ \ifnum \c@GlossaryColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.gls.}}
+ \endgroup
+}
+%</!template>
+% \end{macrocode}
+% \end{instance}
+%
+% \begin{macro}{\PrintIndex}
+% \begin{macro}{\PrintChanges}
+% The |\PrintIndex| and |\PrintChanges| commands are redefined to use
+% the respective instances of template type \texttt{docindex}.
+% \begin{macrocode}
+\renewcommand\PrintIndex{%
+ \UseInstance{docindex}{index}{\index@prologue}{}%
+ \global\let\PrintIndex\@empty
+}
+\renewcommand\PrintChanges{%
+ \UseInstance{docindex}{changes}{\glossary@prologue}{}%
+ \global\let\PrintChanges\@empty
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \section{Notes and acknowledgements}
+%
+% The exact descriptions of the parameters of the \program{makeindex}
+% program is the paper \cite{makeindex-paper} by Chen and Harrison, but
+% I have seen claims that there are parameters not listed there
+% (presumably becuase they were added after this paper was written).
+% \texttt{docindex.ist} does not change any such undocumented
+% parameter, however.
+%
+% There are other index sorting programs than \package{makeindex}
+% around, such as for example \program{x\r{\i}ndy}~\cite{xindy}.
+% Should someone create index style files for such systems that are
+% equivalent (or superior, for that matter) to \texttt{docindex.ist}
+% then I would be happy to add them to the \package{docindex}
+% distribution.
+%
+% Most of the actual layout parameter settings used by the
+% \package{docindex} package are not of my design, but copied from
+% various other \LaTeX\ packages such as~\cite{multicol,doc} (mainly by
+% Frank Mittelbach). I have however tried to sort out which parameters
+% are actually in force under the various conditions---something which
+% turned out to be less obvious than I originally suspected.
+%
+% The idea to have the \texttt{docindex} type templates input the sorted
+% index file (rather than simply setting up the formatting of it as was
+% the case in v\,0.03) was taken from the \package{xindex}
+% package~\cite{xindex} by Achim Blumensath.
+%
+% \hbadness=10000
+%
+% \Finale
+%
+%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/docindex.ins b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.ins
new file mode 100644
index 00000000000..d5d85cc6c32
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.ins
@@ -0,0 +1,48 @@
+% This file is the docstrip installation script for the docindex package.
+%
+% It may be distributed 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.
+%
+% Copyright 2001 Lars Hellstr\"om
+
+\input docstrip
+
+\keepsilent
+
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+\endpreamble
+
+\declarepostamble\noendinput
+\endpostamble
+
+\generate{%
+ \usedir{tex/latex/misc}
+ \file{docindex.sty}{\from{docindex.dtx}{pkg,template}}%
+ \file{docidx2e.sty}{\from{docindex.dtx}{pkg}}%
+ \usepostamble\noendinput
+ \usedir{makeindex/latex}
+ \file{docindex.ist}{\from{docindex.dtx}{ist}}%
+% \file{ngind.ist}{\from{docindex.dtx}{idx}}%
+% \file{ngglo.ist}{\from{docindex.dtx}{glo}}%
+}
+
+\endbatchfile
+\end
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/docindex.pdf b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.pdf
new file mode 100644
index 00000000000..0c3c9379563
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/docindex.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.dtx b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.dtx
new file mode 100644
index 00000000000..c0d4a22d3d1
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.dtx
@@ -0,0 +1,5166 @@
+% \CheckSum{2952}
+%
+% \iffalse meta-comment
+%
+% This file 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.
+%
+% Copyright 2000 2001 2002 Lars Hellstr\"om
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{array,longtable}
+
+\makeatletter
+\IfFileExists{xdoc2.sty}{%
+ \usepackage[dolayout]{xdoc2}
+ \NewMacroEnvironment{xrefcmd}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont##1 \normalfont XXR-command}%
+ {\XDMainIndex{%
+ \levelsorted{##1 (XXR-command)}{\texttt{##1} (XXR-command)}%
+ }%
+ \XDMainIndex{%
+ \levelsame{XXR-commands:}\levelsorted{##1}{\texttt{##1}}%
+ }}%
+ {{##1}{XXR-command \texttt{##1}}}%
+ {}%
+ \@namedef{XD@harmless\string\Bslash}{%
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname XD@harmless@92\endcsname}%
+ \XD@harmless@
+ }%
+ \IfFileExists{docidx2e.sty}{%
+ \usepackage{docidx2e}%
+ \AtEndDocument{%
+ \typeout{*********************************}%
+ \typeout{* Use docindex.ist when sorting *}%
+ \typeout{* xdoc2.idx and xdoc2.glo. \@spaces\space*}%
+ \typeout{*********************************}%
+ }%
+ }%
+}{%
+ \newenvironment{option}[1]{\trivlist\item[]}{\endtrivlist}%
+ \newenvironment{xrefcmd}[1]{\trivlist\item[]}{\endtrivlist}%
+ \@ifpackagelater{doc}{2000/05/20}{}{%
+ \let\XD@fragile@meta=\meta
+ \def\meta{%
+ \ifx \protect\@typeset@protect
+ \expandafter\futurelet \expandafter\@let@token
+ \expandafter\XD@fragile@meta
+ \else
+ \noexpand\meta
+ \fi
+ }%
+ }%
+}
+\makeatother
+
+\providecommand\describecsfamily[1]{%
+ \leavevmode
+ \GenericDescribePrint{\MacroFont\Bslash#1}%
+ \ignorespaces
+}
+\providecommand\describeoption[1]{%
+ \leavevmode
+ \GenericDescribePrint{\MacroFont#1 \normalfont option}%
+ \ignorespaces
+}
+\providecommand\GenericDescribePrint[1]{%
+ \marginpar{\raggedleft\strut #1}%
+}
+\providecommand\Bslash{\bslash}
+\providecommand\DoNotIndexBy[1]{}
+\DoNotIndexBy{@}
+\DoNotIndexBy{@@}
+\DoNotIndexBy{XD@}
+
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+\DeclareRobustCommand\LaTeXplus{\LaTeXe$*$}
+\newcommand\B{\penalty\exhyphenpenalty}
+\ProvideTextCommandDefault\textminus{\textendash}
+
+\hfuzz=15pt
+
+\AlsoImplementation
+\setcounter{IndexColumns}{2}
+
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+
+\begin{document}
+
+\DocInput{xdoc2.dtx}
+
+\PrintChanges
+\PrintIndex
+
+\end{document}
+%</driver>
+% \fi
+%
+% \title{The \package{xdoc} package --- experimental reimplementations
+% of features from \package{doc}, second~prototype}
+% \author{Lars Hellstr\"om^^A
+% \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}}
+% \date{2003/07/07}
+% \maketitle
+%
+% \DoNotIndex{\,,\-,\/,\ ,\#,\%,\&,\\,\^,\|}
+% \DoNotIndex{\@addtoreset,\@auxout,\@bsphack,\@cclv,\@ctrerr}
+% \DoNotIndex{\@eha,\@empty,\@esphack,\@evenfoot}
+% \DoNotIndex{\@firstofone,\@firstoftwo,\@for}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo}
+% \DoNotIndex{\@ifclassloaded,\@ifdefinable,\@ifpackagewith,\@ifundefined}
+% \DoNotIndex{\@input,\@latexerr,\@mainaux,\@mparswitchtrue}
+% \DoNotIndex{\@namedef,\@nameuse,\@ne,\@next,\@nil,\@oddfoot,\@partaux}
+% \DoNotIndex{\@partlist,\@secondoftwo,\@sptoken}
+% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@totalleftmargin}
+% \DoNotIndex{\@typeset@protect,\@unexpandable@protect}
+% \DoNotIndex{\@vobeyspaces,\@writeckpt,\@xxxii}
+% \DoNotIndex{\active,\addto@hook,\addtolength,\advance,\AtBeginDocument}
+% \DoNotIndex{\baselineskip,\begingroup,\bgroup,\box,\boxmaxdepth}
+% \DoNotIndex{\catcode,\char,\clearpage,\closeout,\color@begingroup}
+% \DoNotIndex{\color@endgroup,\copy,\csname}
+% \DoNotIndex{\deadcycles,\DeclareOption,\DeclareRobustCommand,\def}
+% \DoNotIndex{\discretionary,\divide,\do@space,\dp}
+% \DoNotIndex{\edef,\egroup,\else,\em,\endcsname,\endgroup,\ensuremath}
+% \DoNotIndex{\escapechar,\everypar,\expandafter}
+% \DoNotIndex{\fi,\font,\footnotesize,\frenchspacing,\futurelet}
+% \DoNotIndex{\g@addto@macro,\gdef,\global}
+% \DoNotIndex{\hb@xt@,\hbox,\hfill,\hss,\ht,\hyphenchar}
+% \DoNotIndex{\if,\if@filesw,\if@inlabel,\if@mparswitch,\if@partsw}
+% \DoNotIndex{\if@reversemargin,\if@tempswa,\ifcase,\ifcat,\iffalse}
+% \DoNotIndex{\ifmmode,\ifnum,\ifodd,\iftrue,\ifx,\ignorespaces}
+% \DoNotIndex{\immediate,\include,\indexentry,\input,\inputlineno,\item}
+% \DoNotIndex{\itshape,\kern}
+% \DoNotIndex{\labelsep,\langle,\language,\leavevmode,\let,\long,\loop}
+% \DoNotIndex{\m@ne,\m@ta,\makelabel,\marginpar,\marginparsep,\maxdimen}
+% \DoNotIndex{\MessageBreak,\multiply}
+% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newdimen,\newlanguage}
+% \DoNotIndex{\nfss@text,\noexpand,\normalfont,\normalmarginpar,\number}
+% \DoNotIndex{\obeyspaces,\openout,\or}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning}
+% \DoNotIndex{\PackageWarningNoLine,\pagestyle,\paperwidth,\parbox,\part}
+% \DoNotIndex{\ProcessOptions,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\protected@xdef,\ProvidesPackage}
+% \DoNotIndex{\raggedleft,\raggedright,\rangle,\relax,\renewcommand}
+% \DoNotIndex{\repeat,\RequirePackage}
+% \DoNotIndex{\setbox,\setlength,\sixt@@n,\space,\string,\strut,\strutbox}
+% \DoNotIndex{\textasciicircum,\textasciitilde,\textbackslash,\textbar}
+% \DoNotIndex{\textbf,\textbraceleft,\textbraceright,\textdollar}
+% \DoNotIndex{\textgreater,\textless,\textquotedbl,\textquoteleft}
+% \DoNotIndex{\textquoteright,\texttt,\textunderscore,\textvisiblespace}
+% \DoNotIndex{\textwidth,\the,\topsep,\trivlist,\tw@}
+% \DoNotIndex{\uccode,\unhbox,\unrestored@protected@xdef,\unvbox}
+% \DoNotIndex{\uppercase}
+% \DoNotIndex{\vbox,\vss,\vtop,\write,\xdef,\z@}
+%
+% \changes{prot1}{2000/06/15}{Started writing first prototype. (LH)}
+% \changes{prot2}{2000/07/13}{Began work on the second prototype. (LH)}
+%
+% \begin{abstract}
+% The \package{xdoc} package contains reimplementations of some of
+% the features found in the standard \LaTeX\ \package{doc}
+% package~\cite{doc} by Mittelbach \emph{et~al. }The ultimate goals
+% for these reimplementations are that the commands should be better,
+% easily configurable, and be easy to extend, but this is only a
+% second prototype implementation and nothing in it is guaranteed to
+% be the same in the third prototype.\footnote{But there are no
+% guarantees there will ever be a third prototype either.}
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Usage}
+%
+% When I began working on this package I thought that there would be no
+% need for a usage section (at least on the prototype stage)---either you
+% are interested in using the new features and then you might just as
+% well read the descriptions of the commands in the implementation part
+% of this document (they are written as specifications of what the
+% commands do), or else you can simply insert a |\usepackage|\B|{xdoc2}|
+% in the preamble and see how things work a little better than when you
+% simply use \package{doc}---but with some features it became natural
+% to introduce incompatible changes and some new features ought to be
+% mentioned. Hence I wrote a short section on usage after all.
+%
+% It is my intention that this document will eventually evolve into the
+% source for a package \package{xdoc}\footnote{The name \package{doc2}
+% has also been discussed; we'll see when we get there.} which will
+% either build on the \package{doc} package and provide better
+% implementations of many of its features, or replace it completely,
+% but this document is still only the source for a prototype for that
+% package. As I believe that the need for some improvement in this area
+% is rather large however, I have decided to release this prototype so
+% that other people can use it in their documents or create packages that
+% are based on it. In doing so, one must of course bear in mind that this
+% prototype needs not be compatible with the final \package{xdoc}
+% package, and to overcome most incompatibility problems I therefore
+% release it under the variant name \package{xdoc2}. This way, documents
+% based on this prototype can still be typeset using the package they
+% were written for long after the next \package{xdoc} prototype (or final
+% version) is released.
+%
+% Thus although this document frequently speaks of \package{xdoc}, you
+% might just as well read it as \package{xdoc2}.
+%
+%
+% \subsection{Changes to old features}
+%
+% Whereas \package{doc} more or less assumes that all pages have the
+% same layout, \package{xdoc} takes measures to ensure that the
+% \package{doc} features support two-sided document designs. If the
+% left margin has been widened to better accommodate long macro names
+% however (like for example the \package{ltxdoc} document class does),
+% then you may find that the outer margin on right (odd) pages is too
+% narrow for printing macro names in. The remedy for this is the
+% \GenericDescribePrint{\MacroFont dolayout \normalfont option}^^A
+% \SortIndex{dolayout}{\texttt{dolayout} option\encapchar
+% usage}\texttt{dolayout} option; in two-sided mode it causes
+% \package{xdoc} to recompute the |\oddsidemargin| so that the outer
+% margin has the same size on right pages as it previously did on left
+% pages. In documents which are not processed in two-sided mode the
+% \texttt{dolayout} option has no effect.
+%
+% |\DocInput| has been changed to not make percent a comment character
+% upon return unless it was before the |\DocInput|. This makes |\DocInput|
+% nestable and I recommend that \texttt{.dtx} files which input other
+% \texttt{.dtx} files use |\DocInput| for this.
+%
+% The |\DocInclude| command, which is defined by the \package{ltxdoc}
+% document class rather than \package{doc}, is also by default
+% redefined in an incompatible manner by \package{xdoc}, but you can
+% stop \package{xdoc} from making incompatible changes if you pass it the
+% option \GenericDescribePrint{\MacroFont olddocinclude \normalfont
+% option}\SortIndex{olddocinclude}{\texttt{olddocinclude} option^^A
+% \encapchar usage}\texttt{olddocinclude}. The main incompatibility
+% lies in that the default redefinition of |\DocInclude| behaves purely
+% as an |\include| command which |\DocInput|s a \texttt{.dtx} file rather
+% than merely |\input|ting a \texttt{.tex} file---you must pass the
+% \GenericDescribePrint{\MacroFont fileispart \normalfont option}^^A
+% \SortIndex{fileispart}{\texttt{fileispart} option\encapchar
+% usage}\texttt{fileispart} option to \package{xdoc} to get the |\part|
+% headings etc.\ for each new file---but there are also minor changes
+% in the appearance of these headings, in how page styles are set, and
+% in how the information presented in the page footer is obtained.
+%
+% Other changes are as far as I can tell minor and within the bounds of
+% expected behaviour, but code that relies on the implementation of some
+% feature in \package{doc} may of course behave differently or break
+% completely. Note in particular that the formats of the internal
+% \package{doc} variables |\saved@macroname|, |\macro@namepart|, and
+% |\index@excludelist| have changed completely (see
+% Section~\ref{Sec:Changes}, Subsection~\ref{Ssec:Scanning macrocode},
+% and Subsection~\ref{Ssec:Index-exclude} respectively)---hence any hack
+% involving one of these must be revised before it is used with
+% \package{xdoc}. These are however exceptions; in my experience the most
+% noticeable changes not listed above are that the index exclude
+% mechanism actually works for control sequences whose names consist of
+% a single non-letter and that symbols get sorted in a different order.
+%
+%
+% \subsection{Some notable new features}
+%
+% The main new feature is the \DescribeMacro\NewMacroEnvironment
+% |\NewMacroEnvironment| command, which defines a new \texttt{macro}-like
+% environment. The command offers complete control of the argument
+% structure, the formatting of the marginal heading, the code for making
+% index entries, and the change entry sorting and formatting, but the
+% syntax is too complex to explain here. Those who are interested in
+% using it should read Section~\ref{Sec:Macro-environments}. In
+% particular, Subsections~\ref{Ssec:Macro&environment}--^^A
+% \ref{Ssec:More macros} contain several examples of how it can be
+% used. In addition to using |\New|\-|Macro|\-|Environment| for
+% redefining the \DescribeEnv{macro}\texttt{macro} and
+% \DescribeEnv{environment}\texttt{environment} environments,
+% \package{xdoc} also defines an \DescribeEnv{option}\texttt{option}
+% environment (which is intended for document class and package
+% options) and a \DescribeEnv{switch}\texttt{switch} environment (which
+% is intended for switches defined using |\newif|; the argument should
+% not include the |\if|).
+%
+% There is also a companion command \DescribeMacro\NewDescribeCommand
+% |\NewDescribeCommand| which defines new commands similar to
+% |\Describe|\-|Macro| and |\Describe|\-|Env|. The syntax of
+% |\New|\-|Describe|\-|Command| is also too complex to explain here, so
+% I have to refer readers who want to use it to Section~^^A
+% \ref{Sec:Describing}. Two more commands which are defined in that
+% section are \DescribeMacro\describeoption|\describe|\-|option|, which
+% is the \texttt{describe}\dots\ companion of the \texttt{option}
+% environment, and \DescribeMacro\describecsfamily
+% |\describe|\-|cs|\-|family| which is meant for describing control
+% sequence families (see the table on page~\pageref{Tab:CS-families} for
+% examples of what I mean). The argument of this latter command is simply
+% the material you would put between |\csname| and |\endcsname|. Variant
+% parts are written as |\meta|\B\marg{text} and print as one would expect
+% them to (but notice that the \meta{text} is a moving argument) whereas
+% most other characters can be written verbatim without any special
+% quoting (but |\|, |{|, |}|, and |%| need quoting; see the comments to
+% the definition of |\describe|\-|cs|\-|family| for information on how
+% to do that).
+%
+% The \DescribeMacro\DoNotIndexBy|\DoNotIndexBy| command tells the
+% commands that make index entries for macros to ignore a certain
+% character sequence when the index entries are sorted. The
+% |\DoNotIndexBy| command takes one argument: the character sequence to
+% ignore. If |\DoNotIndexBy| is used more than once then the indexing
+% commands will look for, and if it finds it ignore, each of the
+% character sequences given to it, starting with the one specified last.
+%
+% It has already been mentioned that the |\DocInclude| command has been
+% changed. What has not been mentioned is its companion
+% \DescribeMacro\setfileinfo|\setfileinfo|,
+% which the partfiles should use for setting the date and version
+% information presented in the page footer, but that is explained in
+% detail in Subsection~\ref{Ssec:New DocInclude}.
+%
+% Finally there is a new variant of the |\changes| command which is
+% intended for changes that, although not limited to a single macro and
+% thus being ``general'' changes in the \package{doc} terminology, affect
+% only a few (probably widely dispersed) macros (or whatever). The basic
+% idea is that you can define a change with a specific version, date,
+% and text using the \DescribeMacro{\definechange}|\definechange| command
+% and then recall those parameters later using the
+% \DescribeMacro{\usechange}|\usechange| command. Primarily this ensures
+% that the entry texts are identical so that \package{makeindex} will
+% combine them into one entry, but it is also specified which macro
+% was changed at which page. See Section~\ref{Sec:Changes} for more
+% details. Another new feature concerning |\changes| is that there is
+% now support for sorting version numbers according to mathematical
+% order rather than ASCII order. Traditionally the version numbers
+% \texttt{2}, \texttt{11}, and \texttt{100} would have been sorted so
+% that \texttt{100}${}<{}$\texttt{11}${}<{}$\texttt{2}, but if they are
+% entered as \DescribeMacro{\uintver}|\uintver{2}|, |\uintver{11}|, and
+% |\uintver{100}| then they will be sorted as
+% \texttt{2}${}<{}$\texttt{11}${}<{}$\texttt{100}. The argument of
+% |\uintver| must be a \TeX\ \meta{number}.
+%
+% \medskip
+%
+% \package{xdoc} also contains several features which are of little use
+% as direct user commands, but which can simplify the definitions of other
+% commands. The foremost of these are the `harmless character strings',
+% which can be seen as a datatype for (short pieces of) verbatim text.
+% \TeX\ typesets a harmless character string in pretty much the same way
+% as the corresponding string of `other' tokens, but the harmless
+% character string can also be written to file and read back arbitrarily
+% many times without getting garbled, it doesn't make \package{makeindex}
+% choke, and it survives being fed to a |\protected@edef|. The most
+% important commands related to harmless character strings are
+% \DescribeMacro\PrintChar|\PrintChar|, which is used for representing
+% problematic characters, and \DescribeMacro\MakeHarmless|\MakeHarmless|,
+% which converts arbitrary \TeX\ code to the corresponding harmless
+% character string.
+%
+% The superfluity of indexing commands in \package{doc} has been
+% replaced by the single command \DescribeMacro\IndexEntry|\IndexEntry|,
+% which has been designed with the intention that it should provide a
+% clear interface between the user level macros and the index sorting
+% program. It takes three arguments: the index entry specification, the
+% name of the encapsulation scheme that should be used, and the number to
+% put in the index. The index entry specification is a sequence of
+% |\LevelSame| and\slash or |\LevelSorted| commands, which have the
+% respective syntaxes
+% \begin{quote}
+% \DescribeMacro\LevelSame|\LevelSame|\marg{text}\\
+% \DescribeMacro\LevelSorted|\LevelSorted|\marg{sort key}\marg{text}
+% \end{quote}
+% Each such command specifies one level of the index entry. In the case of
+% |\LevelSorted|, the \meta{text} is what will be written in the sorted
+% index at that level and \meta{sort key} is what the index-sorting
+% program should look at when sorting the entry (at that level). In the
+% case of |\LevelSame|, the \meta{text} is used both as sort key and
+% contents of entry in the sorted index. The first command is for the
+% topmost level and each subsequent command is for the next sublevel.
+% The complete description appears in Subsection~\ref{Ssec:IndexEntry}.
+%
+% \package{xdoc} also contains support for external cross-referencing
+% programs (see Subsection~\ref{Ssec:XXR} for details) and a system for
+% determining whether a piece of text falls on an even or an odd page
+% (see Section~\ref{Sec:Twoside} for details). I expect that the latter
+% system will eventually migrate out of \package{xdoc}, either to a
+% package of its own, or into oblivion because the \LaTeXplus\ output
+% routine makes it obsolete.
+%
+%
+% \subsection{The \package{docindex} package}
+%
+% As of prototype version 2.2, the \package{xdoc} package has a companion
+% package \package{docindex}~\cite{docindex} which provides improved
+% formatting of the index and list of changes. \package{xdoc} works fine
+% without \package{docindex}, however.
+%
+%
+% \subsection{A note on command names}
+%
+% The \package{doc} package defines several commands with mixed-case
+% names which (IMHO) should really have all-lower-case names (according
+% to the rule of thumb spelled out in \cite[Ssec.~2.4]{clsguide}) since
+% people use them in the capacity of being the author of a \texttt{.dtx}
+% file rather than in the capacity of being the writer of a class or
+% package. The names in question are
+% \begin{longtable}{ll}
+% \textbf{Name in \package{doc}}& \textbf{Better (?) name}\endhead
+% \cs{AlsoImplementation}& \cs{alsoimplementation}\\
+% \cs{CharacterTable}& \cs{charactertable}\\
+% \cs{CharTableChanges}& \cs{chartablechanges}\\
+% \cs{CheckModules}& \cs{checkmodules}\\
+% \cs{CheckSum}& \cs{checksum}\\
+% \cs{CodelineIndex}& \cs{codelineindex}\\
+% \texttt{CodelineNo} (counter)& \texttt{codelineno}\\
+% \cs{CodelineNumbered}& \cs{codelinenumbered}\\
+% \cs{DeleteShortVerb}& \cs{deleteshortverb}\\
+% \cs{DescribeEnv}& \cs{describeenv}\\
+% \cs{DescribeMacro}& \cs{describemacro}\\
+% \cs{DisableCrossrefs}& \cs{disablecrossrefs}\\
+% \cs{DocInput}& \cs{docinput}\\
+% \cs{DoNotIndex}& \cs{donotindex}\\
+% \cs{DontCheckModules}& \cs{dontcheckmodules}\\
+% \cs{EnableCrossrefs}& \cs{enablecrossrefs}\\
+% \cs{Finale}& \cs{finale}\\
+% \texttt{GlossaryColumns} (counter)& \texttt{glossarycolumns}\\
+% \cs{GlossaryPrologue}& \cs{glossaryprologue}\\
+% \texttt{IndexColumns} (counter)& \texttt{indexcolumns}\\
+% \cs{IndexInput}& \cs{indexinput}\\
+% \cs{IndexPrologue}& \cs{indexprologue}\\
+% \cs{MakePrivateLetters}& \cs{makeprivateletters}\\
+% \cs{MakeShortVerb}& \cs{makeshortverb}\\
+% \cs{OnlyDescription}& \cs{onlydescription}\\
+% \cs{PageIndex}& \cs{pageindex}\\
+% \cs{PrintChanges}& \cs{printchanges}\\
+% \cs{PrintIndex}& \cs{printindex}\\
+% \cs{RecordChanges}& \cs{recordchanges}\\
+% \cs{SortIndex}& \cs{sortindex}\\
+% \cs{SpecialEscapechar}& \cs{specialescapechar}\\
+% \texttt{StandardModuleDepth} (counter)& \texttt{standardmoduledepth}\\
+% \cs{StopEventually}& \cs{stopeventually}
+% \end{longtable}
+% \noindent With the exception for \texttt{CodelineNo},\footnote{Where I
+% recommend using \texttt{codelineno} instead of \texttt{CodelineNo},
+% \cs{PrintCodelineNo} instead of \cs{theCodelineNo}, and
+% \cs{thecodelineno} instead of \cs{number}\cs{c@CodelineNo}; see
+% Subsection~\ref{Ssec:CodelineNo}.} I haven't changed any of the
+% \package{doc} names in this \package{xdoc} prototype, nor introduced any
+% of the ``better names'' as alternatives, but I think the matter should
+% be given a bit of thought during the future development of
+% \package{doc}\slash \package{xdoc}.
+%
+% For completeness, I should also remark that there are several macros
+% that \package{doc} gives mixed-case names which I haven't listed above.
+% The logo command names have special capitalizing rules by tradition.
+% Some macros and named registers---for example |\Docstyle|\-|Parms|,
+% |\Index|\-|Parms|, |\Macro|\-|Font|, |\Macro|\-|Topsep|,
+% |\Make|\-|Percent|\-|Ignore|, and |\Print|\-|Macro|\-|Name|---are part
+% of the package or document class writer's interface to \package{doc},
+% although I cannot claim it to be obvious that for example
+% |\Index|\-|Parms| and the \texttt{IndexColumns} counter should belong
+% to different classes here (but several of these control sequences will
+% probably disappear from the interface in \LaTeXplus\ anyway, so the
+% problem isn't that important). The |\Special|\dots\B|Index| commands
+% (and their even more special variants, such as
+% |\Left|\-|Brace|\-|Index|) are internal commands rather than user level
+% commands. Finally there is the |\Get|\-|File|\-|Info| command, which I
+% doubt there is any point in having.
+%
+%
+% \StopEventually{}
+%
+%
+% \subsection{\package{docstrip} modules}
+%
+% The \package{docstrip} modules in \texttt{xdoc2.dtx} are:
+% \begin{description}
+% \item[\textsf{pkg}]
+% This module directive surrounds the code for the \package{xdoc}
+% package.
+% \item[\textsf{driver}]
+% The driver.
+% \item[\textsf{internals}]
+% This module contains an alternative replacement text for the
+% |\Print|\-|Visible|\-|Char| command that uses ``\LaTeX\ internal
+% character representation'' (i.e., as much as possible
+% encoding-specific commands---|\text|\textellipsis\ commands and
+% the like) rather than the primitive |\char| command for
+% typesetting visible characters.
+% It is provided as a separate module mainly for compability with
+% prototype version~2.0, as this alternative definition can (as of
+% prot.\,2.1) be chosen by passing the option
+% \describeoption{notrawchar}\texttt{notrawchar} to \package{xdoc}.
+% \item[\textsf{economical}]
+% There is little point in storing the harmless representations of
+% the 161 non-visible-ASCII characters as these representations are
+% always the same and can be formed on the fly whenever they are
+% needed. The \textsf{economical} modules contain some alternative
+% code which makes use of this fact to reduce the number of control
+% sequences used for storing the table of harmless representations.
+% The \Module{economical} module appears inside the \Module{pkg}
+% module.
+% \item[\textsf{xdoc2}]
+% This module contains code for compability with previous releases
+% of \package{xdoc2}. It will not be included in \package{xdoc3}
+% or \package{xdoc} (whichever is the next major version).
+% \item[\textsf{enccmds}]
+% This module contains the code for defining two \texttt{macro}-like
+% environments for encoding-specific commands. These are not included
+% in the \package{xdoc} package since so few \texttt{.dtx} files
+% define encoding-specific commands.
+% \item[\textsf{rsrccmd}]
+% Similar to the \textsf{enccmds} module, but demonstrates the
+% |\New|\-|Describe|\-|Command| command instead.
+% \item[\textsf{example}]
+% This surrounds some code which to \package{docstrip} looks like it
+% should be copied, but isn't meant to.
+% \end{description}
+%
+%
+%
+% \section{Initial stuff}
+%
+% First there's the usual |\NeedsTeXFormat| and |\ProvidesPackage|.
+% \begin{macrocode}
+%<*pkg>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{xdoc2}[2003/07/06 prot2.5 doc reimplementation package]
+% \end{macrocode}
+%
+% \subsection*{Options}
+%
+% The first option has to do with the page layout.
+% Although \package{doc} itself doesn't modify any of the main layout
+% parameters, it is well known that using it does tend to restrict
+% one's choices in terms of document layout. In particular the
+% \texttt{macro} and \texttt{environment} environments require a rather
+% large left margin since they will otherwise print long macro names
+% partially outside the paper. It is furthermore hard to decrease the
+% |\textwidth| as it should be wide enough to contain about 70 columns of
+% |\MacroFont| text. Thus the only solution is to do as the
+% \package{ltxdoc}~\cite{ltxdoc} document class and enlarge the left
+% margin at the expense of the right.
+%
+% The resulting layout has a left--right asymmetry with the main galley
+% (the text rectangle) on the right and a very wide left margin (in
+% which marginal headings and marginal notes appears). Although this
+% layout is not uncommon in technical manuals, it is inappropriate for
+% two-sided designs since the vertical line at which the two pages of a
+% spread meet becomes the natural vertical symmetry axis for the entire
+% spread and it breaks this symmetry to let the left margin be the
+% widest on all pages. It would look better to always let the outer
+% margin be the largest.
+%
+% \begin{option}{dolayout}
+% \begin{macro}{\oddsidemargin}
+% The \texttt{dolayout} option modifies |\oddsidemargin| so that
+% spreads are symmetric around the center in two-sided mode. As size
+% of the outer margin is taken the size of the left margin on left
+% (even) pages, i.e., |\evensidemargin|${}+1\,\mathrm{in}$.
+%
+% In one-sided mode, the \texttt{dolayout} option does nothing.
+% \begin{macrocode}
+\DeclareOption{dolayout}{%
+ \if@twoside
+ \setlength\oddsidemargin{\paperwidth}
+ \addtolength\oddsidemargin{-\textwidth}
+ \addtolength\oddsidemargin{-\evensidemargin}
+ \addtolength\oddsidemargin{-2in}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{option}
+%
+% \begin{option}{olddocinclude}
+% \begin{option}{fileispart}
+% The \texttt{olddocinclude} and \texttt{fileispart} options are
+% related to the |\DocInclude| command defined by the \package{ltxdoc}
+% document class. Some of the code related to that command relies on
+% modifying the \package{doc} internal macro |\codeline@wrindex|, but
+% that has no effect with \package{xdoc} so in order to get the
+% expected results one has to reimplement the |\DocInclude| command as
+% well. The \texttt{olddocinclude} and \texttt{fileispart} options
+% control how this should be done.
+%
+% If the \texttt{olddocinclude} option is passed to \package{xdoc}
+% then only the parts of the implementation of |\DocInclude| which
+% must be altered to make the command work with the \package{xdoc}
+% implementation of indexing and cross-referencing are changed. These
+% redefinitions will furthermore only be made if the \package{ltxdoc}
+% document class has been loaded; nothing is done if the
+% \texttt{olddocinclude} option is passed and \package{ltxdoc} hasn't
+% been loaded. Passing the \texttt{olddocinclude} option can be
+% considered as requesting a ``compatibility mode'' for |\DocInclude|.
+%
+% If the \texttt{olddocinclude} option is not passed then the
+% |\DocInclude| command is reimplemented from scratch, regardless of
+% whether some definition of it has already been given or not. The
+% basis of this reimplementation is the observation that the
+% |\DocInclude| command of \package{ltxdoc} really does two quite
+% distinct things at once---it is an |\include| command which
+% |\DocInput|s files rather than |\input|ting them, but it also starts
+% a new |\part|, sets the pagestyle, and changes how the values of
+% some counters are typeset. This latter function is by default
+% disabled in the \package{xdoc} implementation of |\DocInclude|, but
+% passing the \texttt{fileispart} option enables it.
+%
+% There is no code for these two options here, as it is rather long;
+% instead that code appears in Section~\ref{Sec:DocInclude}. The
+% |\Pass|\-|Options|\-|To|\-|Package| commands make sure that these
+% options are registered as local options for \package{xdoc}, so that
+% one can test for them using |\@if|\-|package|\-|with| below.
+% \begin{macrocode}
+\DeclareOption{olddocinclude}{%
+ \PassOptionsToPackage{\CurrentOption}{xdoc2}%
+}
+\DeclareOption{fileispart}{%
+ \PassOptionsToPackage{\CurrentOption}{xdoc2}%
+}
+% \end{macrocode}
+% \end{option}\end{option}
+%
+% \changes{prot2.5}{2003/07/06}{Reregeristing options in case
+% they were global. (LH)}
+%
+% \begin{option}{notrawchar}
+% The \texttt{notrawchar} option controls how the |\PrintVisibleChar|
+% command is defined, and thereby what method is used for typesetting
+% visible characters in e.g.\ macro names. The default is to use the
+% |\char| primitive (which is better for \texttt{T1}-encoded fonts and
+% non-italic \texttt{OT1}-encoded typewriter fonts), but the
+% \texttt{notrawchar} option causes things to go via the ``\LaTeX\
+% internal character representation'' instead (which is necessary
+% for e.g.\ \texttt{OT1}-encoded non-typewriter fonts).
+%
+% There is no code for this option here; instead that code is found
+% in the definition of |\Print|\-|Visible|\-|Char|.
+% \begin{macrocode}
+\DeclareOption{notrawchar}{%
+ \PassOptionsToPackage{\CurrentOption}{xdoc2}%
+}
+% \end{macrocode}
+% \end{option}
+%
+%
+% Then options are processed.
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+% And finally the \package{doc} package is loaded.
+% \begin{macrocode}
+\RequirePackage{doc}
+% \end{macrocode}
+%
+%
+% \section{Character strings}
+%
+% A source of much of the complexity in \package{doc} is that it has to
+% be able to deal with rather arbitrary strings of characters (mainly
+% the names of control sequences). Once the initial problems with
+% characters having troublesome catcodes have been overcome however, it
+% is usually no problem to manage such things in \TeX. \package{doc}
+% does however complicate things considerably by also putting these
+% things in the index and list of changes. Not only must they then be
+% formatted so that the \package{makeindex} program doesn't choke on
+% them, but they must also be wrapped up in code that allows \TeX\ to
+% make sense of them when they are read back. \package{doc} manages the
+% \package{makeindex} problems mainly by allowing the user to change what
+% characters are used as \package{makeindex} metacharacters and the
+% reading back problem by making abundant use of |\verb|.
+%
+% All this relies on that the author of a document is making sure that
+% the metacharacters aren't used for anything else. If for example the
+% |\verbatimchar| (by default |+|) is one of the ``private letters''
+% then names of control sequences containing that character will be
+% typeset incorrectly because the |\verb| used to typeset it is
+% terminated prematurely---control sequence names such as `|\lost+found|'
+% will be typeset as `|\lost|found+'. On top of that, one also has to
+% make sure that the font used for typesetting these |\verb| sections
+% contains all the characters needed.
+%
+% For \package{xdoc}, I have chosen a completely different approach.
+% Instead of allowing the strings (after they have converted to the
+% internal format) to contain \TeX\ character tokens with arbitrary
+% character codes, they may only contain \TeX\ character tokens which
+% are unproblematic---the normal catcode should be 11 (letter) or 12
+% (other), they should not be outside visible ASCII, and they may not
+% be one of the \package{makeindex} metacharacters. All other characters
+% are represented using a robust command which takes the character code
+% (in decimal) as the argument. This takes care of all ``moving
+% argument'' type problems that may occur.
+%
+% An important observation about these character strings is that
+% they are strings of \emph{input} characters. This means that rather
+% than using the characters in some special font for typesetting
+% control sequences like |\^^M| (recall that the |^^| substitutions
+% take place before tokenization), one should typeset them using only
+% visible ASCII characters. (After all, that's the only way they are
+% written in \TeX\ code.) The default definition is to typeset
+% invisible characters as precisely the |^^|-sequences that \TeX\
+% normally uses for these characters when they are written to a file.
+%
+%
+% \subsection{Typesetting problematic characters}
+%
+% \begin{macro}{\PrintChar}
+% \begin{macro}{\XD@threedignum}
+% The |\PrintChar| command has the syntax
+% \begin{quote}
+% |\PrintChar|\marg{8-bit number}
+% \end{quote}
+% where \meta{8-bit number} is a \TeX\ number in the range 0--255.
+% For arguments in the range 0--31, |\PrintChar| prints
+% `\textit{\ttfamily\string^\string^@}'--`\textit{\ttfamily
+% \string^\string^\string_}'. For an argument in the range 32--126,
+% |\PrintChar| calls |\Print|\-|Visible|\-|Char| which by default
+% simply does |\char| on that argument (but which can be redefined
+% if the font set-up requires it); in particular, |\PrintChar{32}|
+% should print a ``visible space'' character. |\PrintChar{127}| prints
+% `\textit{\ttfamily\string^\string^?}'. For arguments in the range
+% 128--255, |\PrintChar| prints
+% `\textit{\ttfamily\string^\string^80}'--`\textit{\ttfamily
+% \string^\string^ff}'.
+%
+% |\PrintChar| is robust. |\PrintChar| also has a special behaviour
+% when it is written to a file (when |\protect| is |\noexpand|): it
+% makes sure that the argument consists of three decimal digits, to
+% ensure external sorting gets it right.
+% \begin{macrocode}
+\@ifundefined{PrintChar}{}{%
+ \PackageInfo{xdoc2}{Redefining \protect\PrintChar}%
+}
+\def\PrintChar{%
+ \ifx \protect\@typeset@protect
+ \expandafter\XD@PrintChar
+ \else\ifx \protect\noexpand
+ \string\PrintChar
+ \expandafter\expandafter \expandafter\XD@threedignum
+ \else
+ \noexpand\PrintChar
+ \fi\fi
+}
+% \end{macrocode}
+%
+% |\XD@threedignum| does a |\number| on its argument, possibly prepends
+% a |0| or two, and wraps it all up in a ``group'' (the braces have
+% category other, not beginning and end of group).
+% \changes{prot2.1}{2000/11/15}{Braces inserted by
+% \cs{XD@threedignum} are given catcode other. (LH)}
+% \begin{macrocode}
+\edef\XD@threedignum#1{%
+ \string{%
+ \noexpand\ifnum #1<100 %
+ \noexpand\ifnum #1<10 0\noexpand\fi
+ 0%
+ \noexpand\fi
+ \noexpand\number#1%
+ \string}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\XD@PrintChar}
+% \begin{macro}{\InvisibleCharPrefix}
+% \begin{macro}{\InvisibleCharSuffix}
+% |\XD@PrintChar| manages the typesetting for |\PrintChar|. It
+% distinguishes between visible characters (code 32--126) and
+% invisible characters. The visible characters are typeset directly
+% using |\PrintVisibleChar|, whereas the invisible characters are
+% typeset as |^^|-sequences.
+%
+% The macros |\InvisibleCharPrefix| and |\InvisibleCharSuffix| begin
+% and end a |^^|-sequence. |\InvisibleCharPrefix| should print the
+% actual |^^|, but it may also for example select a new font for
+% the |^^|-sequence (such font changes are restored at the end of
+% |\XD@PrintChar|).
+% \begin{macrocode}
+\def\XD@PrintChar#1{%
+ \leavevmode
+ \begingroup
+ \count@=#1\relax
+ \ifnum \@xxxii>\count@
+ \advance \count@ 64%
+ \InvisibleCharPrefix
+ \PrintVisibleChar\count@
+ \InvisibleCharSuffix
+ \else\ifnum 127>\count@
+ \PrintVisibleChar\count@
+ \else
+ \InvisibleCharPrefix
+ \ifnum 127=\count@ \PrintVisibleChar{63}\else
+ \@tempcnta=\count@
+ \divide \count@ \sixt@@n
+ \@tempcntb=\count@
+ \multiply \count@ \sixt@@n
+ \advance \@tempcnta -\count@
+ \advance \@tempcntb \ifnum 9<\@tempcntb 87\else 48\fi
+ \advance \@tempcnta \ifnum 9<\@tempcnta 87\else 48\fi
+ \char\@tempcntb \char\@tempcnta
+ \fi
+ \InvisibleCharSuffix
+ \fi\fi
+ \endgroup
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand\InvisibleCharPrefix{%
+ \/\em
+ \PrintVisibleChar{`\^}\PrintVisibleChar{`\^}%
+}
+\newcommand\InvisibleCharSuffix{\/}
+% \end{macrocode}
+% There are some alternative methods for making hexadecimal numbers
+% which should perhaps be mentioned. The \LaTeX\ kernel contains a
+% macro |\hexnumber@| which uses |\ifcase| to produce one hexadecimal
+% digit, but that uses upper case letters, and things like `8E' look
+% extremely silly if the upper case letters doesn't line with the
+% digits. Applying |\meaning| to a \meta{chardef token} or
+% \meta{mathchardef token} expands to |\char"|\meta{hex} and
+% |\mathchar"|\meta{hex} respectively, where \meta{hex} is the
+% corresponding number in hexadecimal, but that too has upper case A--F
+% and leading zeros are removed.
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\PrintVisibleChar}
+% \changes{prot2.1}{2000/12/18}{Made it possible to select the
+% alternative defintion of \cs{PrintVisibleChar} through an
+% \package{xdoc} package option. (LH)}
+% The |\PrintVisibleChar| command should print the visible ASCII
+% character whose character code is given in the argument. There are
+% currently two definitions of this command: one which uses the \TeX\
+% primitive |\char| and one which goes via the ``\LaTeX\ internal
+% character representation'' for the character. By default
+% \package{xdoc} uses the former definition, but if \package{xdoc}
+% is passed the
+% \SortIndex{notrawchar}{\texttt{notrawchar} option\encapchar usage}
+% \texttt{notrawchar} option then it will use the latter.
+%
+% The reason there are two definitions is a deficiency in how the NFSS
+% encoding attribute has been assigned to fonts; even though the
+% encodings of Computer Modern Roman and Computer Modern Typewriter
+% are quite different, \LaTeXe\ uses the \texttt{OT1} encoding for
+% both. As a result of this, the \LaTeX\ internal representation will
+% in some important cases use characters from non-typewriter fonts
+% despite the fact that typewriter forms are immediately available.
+% Since the cases in which the |\char| primitive produces results as
+% least as good as those made through the \LaTeX\ internal
+% character representation includes those that the current font is
+% \texttt{T1}-encoded or an \texttt{OT1}-encoded nonitalic typewriter
+% font, the shorter |\char| primitive defintion has been made the
+% default.
+%
+% For compability with prototype version~2.0 of \package{xdoc}, the
+% replacement text for |\Print|\-|Visible|\-|Char| that uses \LaTeX\
+% internal character representation can alternatively be extracted by
+% \package{docstrip}ping \texttt{xdoc2.dtx} with the option
+% \Module{internals}.
+% \begin{macrocode}
+\@ifpackagewith{xdoc2}{notrawchar}{%
+ \newcommand\PrintVisibleChar[1]{%
+%</pkg>
+%<*pkg|internals>
+ \ifcase #1%
+ \or\or\or\or\or\or\or\or \or\or\or\or\or\or\or\or
+ \or\or\or\or\or\or\or\or \or\or\or\or\or\or\or\or
+ % "20
+ \textvisiblespace \or!\or\textquotedbl \or\#\or\textdollar
+ \or\%\or\&\or\textquoteright\or(\or)\or*\or+\or,\or-\or.\or/%
+ \or % "30
+ 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or:\or;\or
+ \textless\or=\or\textgreater\or?%
+ \or % "40
+ @\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 % "50
+ P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z\or [\or
+ \textbackslash \or]\or\textasciicircum \or\textunderscore
+ \or % "60
+ \textquoteleft \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 % "70
+ p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z\or
+ \textbraceleft \or\textbar \or\textbraceright \or
+ \textasciitilde
+ \fi
+ }%
+%</pkg|internals>
+%<*pkg>
+}{%
+ \newcommand\PrintVisibleChar[1]{\char #1\relax}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\Bslash}
+% It turns out that it is very common to say |\PrintChar{92}|
+% (backslash), so a macro which expands to that reduces typing.
+% \begin{macrocode}
+\newcommand\Bslash{\PrintChar{92}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Rendering character strings harmless}
+%
+% Replacing all problematic characters with |\PrintChar| calls certainly
+% makes the strings easier to manage, but actually making those
+% replacements is a rather complicated task. Therefore this subsection
+% contains the macros necessary for doing these replacements.
+%
+% The first problem is how to efficiently recognise the problematic
+% characters. A first solution which gets rather far is to mainly look
+% in the |\catcode| register for that character and keep the character
+% as it is if the category found there is 11 or 12, but replace it with
+% a |\PrintChar| command if the category is anything else. Two extra
+% tests can be performed to take care of invisible ASCII, and the
+% \package{makeindex} metacharacters can be cared for by locally
+% changing their catcodes for when the string is processed.
+% Unfortunately this doesn't work inside \texttt{macrocode}
+% environments (where one would like to use it for the macro
+% cross-referencing) since that environment changes the catcodes of
+% several characters from being problematic to being unproblematic and
+% vice versa.\footnote{As the entire \texttt{macrocode} environment is
+% tokenized by the expansion of \cs{xmacro@code} one could alternatively
+% solve this problem by reimplementing the \texttt{macrocode}
+% environment so that normal catcodes are in force when the contents are
+% being typeset.} As furthermore harmless character strings should be
+% possible to move to completely different parts of the document, the
+% test used for determining whether a character is problematic should
+% yield the same result throughout the document.
+%
+% Because of this, I have chosen a brute strength solution: build a
+% table (indexed by character code) that gives the harmless form of
+% every character. This table is stored in the
+% \describecsfamily{XD@harmless@\meta{code}}^^A
+% |\XD@harmless@|\meta{code} family of control sequences, where the
+% \meta{code} is in the range |0|--|255|. Assignments to this table are
+% global. In principle, the table should not change after the preamble,
+% but there is a command |\SetHarmState| which can be used at any time
+% for setting a single table entry. This could be useful for documents
+% which, like for example~\cite{fontinst}, have nonstandard settings of
+% |\catcode|s.
+%
+% \begin{macro}{\SetHarmState}
+% The |\SetHarmState| command takes three arguments:
+% \begin{quote}
+% |\SetHarmState|\marg{type}\marg{char}\marg{harm}
+% \end{quote}
+% \meta{char} is the character whose entry should be set. \meta{type}
+% is a flag which specifies what format \meta{char} is given in. If
+% \meta{type} is |\BooleanTrue| then \meta{char} is the \TeX\
+% \meta{number} of the table entry to set, and if \meta{type} is
+% |\BooleanFalse| then \meta{char} is something which expands to a
+% single character token whose entry should be set. The expansion is
+% carried out by an |\edef|, so it needs not be only one level.
+% \meta{harm} is |\BooleanTrue| if the character is problematic and
+% |\BooleanFalse| if it is not.
+%
+% The \meta{type} and \meta{harm} arguments are currently not subject
+% to any expansion. In the future they probably should be, but I
+% don't want to make assumptions about the actual definitions of
+% |\BooleanTrue| and |\BooleanFalse| at this point.
+% \begin{macrocode}
+\begingroup
+ \catcode\z@=12
+ \@ifdefinable\SetHarmState{
+ \gdef\SetHarmState#1#2#3{%
+ \begingroup
+ \ifx #1\BooleanTrue
+ \count@=#2\relax
+ \else
+ \protected@edef\@tempa{#2}%
+ \count@=\expandafter`\@tempa\relax
+ \fi
+ \ifx #3\BooleanTrue
+ \edef\@tempa{\noexpand\PrintChar{\the\count@}}%
+ \else
+ \uccode\z@=\count@
+ \uppercase{\def\@tempa{^^@}}%
+ \fi
+ \global\expandafter\let
+ \csname XD@harmless@\the\count@ \endcsname \@tempa
+ \endgroup
+ }%
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{trivlist}\item[]\leavevmode ^^A Just for the look of it
+% \GenericDescribePrint{\small\cs{XD@harmless@}\meta{code}}^^A
+% ^^A There should have been a "main" index entry here as well,
+% ^^A but generating that with \package{doc} commands is more than I
+% ^^A bother to do right now.
+% Initializing the |\XD@harmless@|\meta{code} table is a
+% straightforward exercise of |\loop| \dots\ |\repeat|.
+% \begin{macrocode}
+%<*!economical>
+\count@=\z@
+\loop
+ \expandafter\xdef \csname XD@harmless@\the\count@ \endcsname
+ {\noexpand\PrintChar{\the\count@}}%
+ \advance \count@ \@ne
+\ifnum 33>\count@ \repeat
+%</!economical>
+%<economical>\count@=\@xxxii
+\begingroup
+ \catcode\z@=12\relax
+ \@firstofone{%
+\endgroup
+ \loop
+ \if \ifnum 11=\catcode\count@ 1\else \ifnum 12=\catcode\count@
+ 1\else 0\fi\fi 1%
+ \uccode\z@=\count@
+ \uppercase{\def\@tempa{^^@}}%
+ \else
+ \edef\@tempa{\noexpand\PrintChar{\the\count@}}%
+ \fi
+ \global\expandafter\let
+ \csname XD@harmless@\the\count@ \endcsname \@tempa
+ \advance \count@ \@ne
+ \ifnum 127>\count@ \repeat
+}
+%<*!economical>
+\loop
+ \expandafter\xdef \csname XD@harmless@\the\count@ \endcsname
+ {\noexpand\PrintChar{\the\count@}}%
+\ifnum \@cclv>\count@
+ \advance \count@ \@ne
+\repeat
+%</!economical>
+% \end{macrocode}
+% Marking the \package{makeindex} metacharacters as harmful is
+% deferred until |\begin|\nolinebreak[2]|{document}|, since it is not
+% unreasonable that these are changed in the preamble.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \SetHarmState\BooleanFalse\actualchar\BooleanTrue
+ \SetHarmState\BooleanFalse\encapchar\BooleanTrue
+ \SetHarmState\BooleanFalse\levelchar\BooleanTrue
+ \SetHarmState\BooleanFalse\quotechar\BooleanTrue
+}
+% \end{macrocode}
+% \package{doc}'s |\verbatimchar| is not harmful, since it isn't used
+% at all in \package{xdoc}.
+% \end{trivlist}
+%
+%
+% \begin{macro}{\MakeHarmless}
+% To render a character string harmless, you do
+% \begin{quote}
+% |\MakeHarmless|\marg{macro}\marg{string}
+% \end{quote}
+% This locally assigns to \meta{macro} the harmless character string
+% which corresponds to \meta{string}. During the conversion the converted
+% part of the string is stored in |\toks@|, but that is local to
+% |\MakeHarmless|.
+% \begin{macrocode}
+\def\MakeHarmless#1#2{%
+ \begingroup
+ \toks@={}%
+ \escapechar=`\\%
+ \XD@harmless@#2\XD@harmless@
+ \expandafter\endgroup \expandafter\def \expandafter#1%
+ \expandafter{\the\toks@}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\XD@harmless@iii}
+% \begin{macro}{\XD@harmless@iv}
+% \begin{macro}{\XD@harmless@v}
+% \changes{prot2}{2000/07/27}{Moved code for adding to \cs{toks@} here
+% and changed it to append the contents of \cs{XD@harmless@32}, not
+% necessarily a \cs{PrintChar}. (LH)}
+% \begin{macro}{\XD@harmless@vi}
+% What one has to be most careful about when rendering strings
+% harmless are the space tokens, since many of \TeX's primitives gladly
+% snatches an extra space (or more) where you don't want them to in
+% this case. Macro parameters can be particularly dangerous, as \TeX\
+% will skip any number of spaces while looking for the replacement
+% text for an undelimited macro argument. Therefore the algorithm for
+% rendering a character token harmless begins
+% (|\XD@|\B|harmless@iii|) with |\string|ing the next token in the
+% string---this preserves the character code and sets the category to
+% 12 for all characters except the ASCII space, which gets category 10
+% (space)---and then |\futurelet| is used to peek at the next token. If
+% it is a space token (|\XD@|\B|harmless@iv|) then the character code
+% is 32 and the actual space can be gobbled (|\XD@|\B|harmless@v|), and
+% if it isn't then the next token can be grabbed in an undelimited macro
+% argument (|\XD@|\B|harmless@vi|). In either case, the harmless form
+% is given by the |\XD@|\B|harmless@|\meta{code} table entry
+% (in |\XD@|\B|harmless@v| or |\XD@|\B|harmless@vi|).
+% \begin{macrocode}
+\def\XD@harmless@iii{%
+ \expandafter\futurelet \expandafter\@let@token
+ \expandafter\XD@harmless@iv \string
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@harmless@iv{%
+ \ifx \@let@token\@sptoken
+ \expandafter\XD@harmless@v
+ \else
+ \expandafter\XD@harmless@vi
+ \fi
+}
+% \end{macrocode}
+% ^^A Hack:
+% \begingroup
+% \expandafter\def \expandafter\MakePrivateLetters \expandafter{^^A
+% \MakePrivateLetters
+% \catcode`3=11
+% \catcode`2=11
+% }
+% \begin{macrocode}
+\begingroup
+ \catcode`3=\catcode`a
+ \catcode`2=\catcode`a
+ \@firstofone{\gdef\XD@harmless@v} {%
+ \toks@=\expandafter{\the \expandafter\toks@ \XD@harmless@32}%
+ \XD@harmless@
+ }
+\endgroup
+% \end{macrocode}
+% \endgroup
+% In the \Module{economical} (with hash table space) variant
+% implementation the |\XD@harmless@|\meta{code} table has entries only
+% for the characters in visible ASCII. Thus the harmless forms of
+% characters outside visible ASCII must be constructed on the fly.
+% \begin{macrocode}
+\def\XD@harmless@vi#1{%
+%<*economical>
+ \if \ifnum `#1<\@xxxii 1\else \ifnum `#1>126 1\else 0\fi\fi 1%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\PrintChar \expandafter{\number`#1}%
+ }%
+ \else
+%</economical>
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname XD@harmless@\number`#1\endcsname}%
+%<economical> \fi
+ \XD@harmless@
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@harmless@}
+% \begin{macro}{\XD@harmless@i}
+% \begin{macro}{\XD@harmless@ii}
+% But that is not all |\MakeHarmless| can do. In some cases (as for
+% example when one is describing a family of control sequences) one
+% might want to include things in the string that are not simply
+% characters, but more complex items---such as for example |\meta|
+% constructions like \meta{code}. To accommodate for this,
+% |\XD@harmless@| (which is the first step in converting a token)
+% always begins by checking whether the next token to render harmless
+% is a control sequence. If it is then it is checked (in
+% |\XD@harmless@ii|) whether the control sequence
+% \describecsfamily{XD@harmless\Bslash\meta{cs-name}}^^A
+% |\XD@harmless\|\meta{cs-name}, where \meta{cs-name} is the name
+% without |\| of the control sequence encountered, is defined. If it
+% isn't then the encountered control sequence is |\string|ed and
+% conversion continues as above, but if it is defined then the
+% encountered control sequence begins such a more complex item.
+% \begin{macrocode}
+\def\XD@harmless@{\futurelet\@let@token \XD@harmless@i}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@harmless@i{%
+ \ifcat \noexpand\@let@token \noexpand\XD@harmless@
+ \expandafter\XD@harmless@ii
+ \else
+ \expandafter\XD@harmless@iii
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@harmless@ii#1{%
+ \@ifundefined{XD@harmless\string#1}{%
+ \expandafter\XD@harmless@vi \string#1%
+ }{\csname XD@harmless\string#1\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@harmless\XD@harmless@}
+% A control sequence |\XD@harmless\|\meta{cs-name} is responsible for
+% interpreting the string item that begins with the control sequence
+% |\|\meta{cs-name} and appending a harmless representation of it to
+% |\toks@|. Harmless representations should only contain robust
+% control sequences and they must not rely on changing any catcodes.
+% Normal |\XD@harmless\|\meta{cs-name} control sequences must also
+% end by inserting |\XD@harmless@| in front of what remains of the
+% string after the complex string item has been removed. This sees to
+% that the rest of the string is also rendered harmless. The only such
+% control sequence which does not insert |\XD@harmless@| is
+% |\XD@harmless\XD@harmless@|, but that is as it should be since
+% |\MakeHarmless| itself appends a |\XD@harmless@| to every character
+% string it should convert to mark the end of it.
+% \begin{macrocode}
+\expandafter\let
+ \csname XD@harmless\string\XD@harmless@\endcsname \@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\XD@harmless\PrintChar}
+% It is occasionally convenient to use a |\PrintChar| command as part
+% of a string that is to be rendered harmless instead of using the raw
+% character. The definition is very similar to that of
+% |\XD@harmless@vi|.
+% \begin{macrocode}
+\@namedef{XD@harmless\string\PrintChar}#1{%
+%<*economical>
+ \if \ifnum #1<\@xxxii 1\else \ifnum #1>126 1\else 0\fi\fi 1%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\PrintChar \expandafter{\number#1}%
+ }%
+ \else
+%</economical>
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname XD@harmless@\number#1\endcsname}%
+%<economical> \fi
+ \XD@harmless@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Interaction with mechanisms that make characters
+% problematic}
+%
+% If additional visible characters are made problematic after the
+% initial |\XD@harmless@|\meta{code} table is formed then problems may
+% indeed arise, because some character which is expected to be
+% unproblematic when read from (for example) an \texttt{.ind} file will
+% actually not be. In fortunate cases this will only lead to that
+% characters will print strangely or not at all, but it can quite
+% conceivably lead to errors that prevent further typesetting and it
+% should therefore be prevented if possible.
+%
+% Right now, I can think of two mechanisms that make characters
+% problematic, and both do that by making them active. One is the
+% shorthand mechanism of \package{babel}, but I think I'll delay
+% implementing any interaction with that until some later prototype; I
+% don't know it well enough and anyway I don't think it is that likely
+% to cause any problems. The other mechanism is the short verb mechanism
+% of \package{doc} itself, and this should be taken care of right away.
+%
+% The main difficulty is that the |\XD@harmless@|\meta{code} table should
+% be the same throughout the document body (otherwise you may get more
+% than one index entry for the same thing, with index references
+% arbitrarily distributed between the two) whereas short verb characters
+% can be made and deleted at any time. It would actually be wrong to
+% always have the |\XD@harmless@|\meta{code} table entry mirroring the
+% current state of the character! Instead a character will be considered
+% as problematic even if it is only made problematic temporarily (with
+% the exception for characters that are made problematic in
+% \texttt{verbatim} environments and the like---the index file isn't
+% being read in while those catcodes are active). Since it is impossible
+% to know in the beginning of a document whether a character will be made
+% a short verb character at some later point, the modifications to the
+% |\XD@harmless@|\meta{code} table that will be made because of short verb
+% characters will (at least partially) be based on which characters were
+% made short verbs on the previous run.
+%
+% \begin{macro}{\SetCharProblematic}
+% \changes{prot2}{2000/07/26}{Command added. (LH)}
+% The |\SetCharProblematic| command should be called by commands which
+% make a character problematic (e.g.\ makes it active) in the general
+% context (commands which make some character problematic only in some
+% very special context, such as the \texttt{verbatim} environment,
+% need not call |\Set|\-|Char|\-|Problematic|). The syntax is
+% \begin{quote}
+% |\SetCharProblematic|\marg{code}
+% \end{quote}
+% and it sets the ``harm state'' of the character whose code is
+% \meta{code} to problematic.
+%
+% When |\SetCharProblematic| is called in the preamble, it sets the
+% harm state on the current run. When it is called in the document
+% body however, it sets the harm state on the next run by writing a
+% |\SetHarmState| command to the \texttt{.aux} file. This is done to
+% ensure that the contents of the |\XD@harmless@|\meta{code} table
+% doesn't change during the body of a document.
+% \begin{macrocode}
+\newcommand\SetCharProblematic[1]{%
+ \SetHarmState\BooleanTrue{#1}\BooleanTrue
+}
+\AtBeginDocument{%
+ \gdef\SetCharProblematic#1{%
+ \if@filesw
+ \immediate\write\@auxout{\string\SetHarmState
+ \string\BooleanTrue {\number#1}\string\BooleanTrue}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\add@specials}
+% \changes{prot2}{2000/07/26}{Redefinition added. (LH)}
+% |\MakeShortVerb|'s call to |\SetCharProblematic| is put in the
+% |\add@|\B|specials| macro, which anyway already adds the character
+% to the |\dospecials| and |\@sanitize| lists. Only familiar
+% definitions of |\add@special| are changed.
+% \begin{macrocode}
+\def\@tempa#1{%
+ \rem@special{#1}%
+ \expandafter\gdef\expandafter\dospecials\expandafter
+ {\dospecials \do #1}%
+ \expandafter\gdef\expandafter\@sanitize\expandafter
+ {\@sanitize \@makeother #1}}
+\ifx \@tempa\add@special
+ \def\add@special#1{%
+ \rem@special{#1}%
+ \expandafter\gdef\expandafter\dospecials\expandafter
+ {\dospecials \do #1}%
+ \expandafter\gdef\expandafter\@sanitize\expandafter
+ {\@sanitize \@makeother #1}%
+ \SetCharProblematic{`#1}%
+ }
+\else
+ \PackageWarningNoLine{xdoc2}{Unfamiliar definition of
+ \protect\add@special;\MessageBreak the macro was not patched}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{Indexing}
+% \label{Sec:Indexing}
+%
+% Each type of index entry \package{doc} produces is implemented through
+% a different indexing command.\footnote{Sometimes there are
+% even more than one command per entry type---the \cs{SpecialIndex},
+% \cs{LeftBraceIndex}, \cs{RightBraceIndex}, and \cs{PercentIndex}
+% commands all generate entries of the same type.} This might be
+% manageable when there are only \texttt{macro}s and
+% \texttt{environment}s to distinguish between, but it soon gets
+% unmanageable if more environments of this type are added. Therefore
+% all \package{xdoc} index entries are made with a single
+% command---|\IndexEntry|.
+%
+%
+% \subsection{New basic indexing commands}
+% \label{Ssec:IndexEntry}
+%
+% \begin{macro}{\IndexEntry}
+% \begin{macro}{\LevelSame}
+% \changes{prot2.1}{2000/11/18}{New name for \cs{levelsame}. (LH)}
+% \begin{macro}{\LevelSorted}
+% \changes{prot2.1}{2000/11/18}{New name for \cs{levelsorted}. (LH)}
+% \begin{macro}{\XD@if@index}
+% The |\IndexEntry| command writes one index entry to the \texttt{.idx}
+% file. It takes three arguments:
+% \begin{quote}
+% |\IndexEntry|\marg{entry text}\marg{encap}\marg{thenumber}
+% \end{quote}
+% The \meta{entry text} contains the text for the entry. It is a
+% nonempty sequence of commands in which each item is one of
+% \begin{quote}
+% |\LevelSame|\marg{text}\\
+% |\LevelSorted|\marg{sort key}\marg{text}
+% \end{quote}
+% Each such item specifies one level of the entry that is to be
+% written. In the case of |\LevelSorted|, the \meta{text} is what will
+% be written in the sorted index at that level and \meta{sort key} is
+% a key which the index-sorting program should use for sorting that
+% entry at that level. In the case of |\LevelSame|, the \meta{text} is
+% used both as sort key and contents of entry in the sorted index.
+% The first item is for the topmost level and each subsequent item is
+% for the next sublevel. The \meta{entry text} will be fully expanded
+% by the |\IndexEntry| command.
+%
+% \meta{thenumber} is the number (if any) that the index entry refers
+% to. It can consist of explicit characters, but it can also be a
+% |\the|\meta{counter} control sequence or a macro containing such
+% control sequences. \meta{thenumber} is fully expanded by the
+% |\IndexEntry| command, with the exception for occurrences of
+% |\thepage|---expansion of |\thepage| will instead be delayed until
+% the page is shipped out, so that the page numbers will be right.
+% \textbf{Note:} \meta{thenumber} must not contain any formatting that
+% will upset the index-sorting program. \package{doc}'s default
+% definition of |\theCodelineNo| contains such formatting, so one
+% must instead use |\thecodelineno| as \meta{thenumber} in that case.
+%
+% \meta{encap} is the name of the encapsulation scheme that should be
+% applied to \meta{thenumber}. All encapsulation schemes that have been
+% implemented instruct the index sorting program to wrap up
+% \meta{thenumber} in some code that gives it special formatting when
+% the sorted index is written, but one could also use the \meta{encap}
+% to specify `beginning of range' and `end of range' index entries.
+% Use \GenericDescribePrint{\small\texttt{none}}^^A
+% \SortIndex{none}{\texttt{none}\encapchar usage}\texttt{none} as
+% \meta{encap} if you don't want any special formatting.
+%
+% \textbf{Note:} |\IndexEntry| uses |\@tempa| internally, so you
+% cannot use that in argument \#2 or \#3. Using it in argument \#1
+% presents no problems, though.
+% \begin{macrocode}
+\newcommand\IndexEntry[3]{%
+ \@bsphack
+ \begingroup
+ \def\LevelSame##1{\levelchar##1}%
+ \def\LevelSorted##1##2{\levelchar##1\actualchar##2}%
+ \protected@edef\@tempa{#1}%
+ \protected@edef\@tempa{\expandafter\@gobble\@tempa\@empty}%
+ \@ifundefined{XD@idxencap@#2}{%
+ \PackageError{xdoc2}{Index entry encap `#2' unknown}\@eha
+ }{%
+ \XD@if@index{%
+ \csname XD@idxencap@#2\endcsname\@tempa{#3}%
+ }{}%
+ }%
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% |\IndexEntry| does (like |\index|) not contribute any material to the
+% current list if indices aren't being made.
+%
+% |\XD@if@index| is |\@firstoftwo| if index entries are being written
+% and |\@second|\-|of|\-|two| if they are not.
+% \begin{macrocode}
+\let\XD@if@index=\@secondoftwo
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% In \LaTeXplus, the \cs{IndexEntry} command should probably be
+% implemented using templates, e.g. the \meta{encap}s could be names of
+% instances.
+%
+% \begin{macro}{\levelsame}
+% \begin{macro}{\levelsorted}
+% These names were used for |\LevelSame| and |\LevelSorted|
+% respectively in prototype version~2.0, but the macros should belong
+% to the same capitalization class as |\IndexEntry| so their names
+% were changed in prototype version~2.1. The old names |\levelsame|
+% and |\levelsorted| will continue to work in \package{xdoc2}, though.
+% \begin{macrocode}
+%<*xdoc2>
+\newcommand*\levelsame{\LevelSame}
+\newcommand*\levelsorted{\LevelSorted}
+%</xdoc2>
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \describecsfamily{XD@idxencap@\meta{encap}}^^A
+% Macros in the family |\XD@idxencap@|\meta{encap} takes two
+% arguments as follows
+% \begin{quote}
+% |\XD@idxencap@|\meta{encap}\,\marg{entry}\,\marg{thenumber}
+% \end{quote}
+% They should write an entry with the \meta{encap} encapsulation of the
+% \meta{thenumber} to the index file. They need not check whether index
+% generation is on or not, but they must be subject to the \LaTeX\ kernel
+% \texttt{@filesw} switch. They must expand both arguments fully at the
+% time of the command, with the exception for the control sequence
+% |\thepage|, which should not be expanded until the page on which the
+% write appears is output. Both these conditions are met if the macro
+% is implemented using |\protected@write|.
+%
+% \begin{macro}{\XD@idxencap@none}
+% \begin{macro}{\XD@idxencap@main}
+% \begin{macro}{\XD@idxencap@usage}
+% These macros implement the encapsulation schemes that are used in
+% \package{doc}.
+% \begin{macrocode}
+\def\XD@idxencap@none#1#2{%
+ \protected@write\@indexfile{}{\XD@index@keyword{#1}{#2}}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@idxencap@main#1#2{%
+ \protected@write\@indexfile{}%
+ {\XD@index@keyword{#1\encapchar main}{#2}}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@idxencap@usage#1#2{%
+ \protected@write\@indexfile{}%
+ {\XD@index@keyword{#1\encapchar usage}{#2}}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@index@keyword}
+% \changes{prot2.2}{2001/02/13}{Macro added and \meta{encap} macros
+% changed to use it. (LH)}
+% The |\XD@index@keyword| is a hook for changing the index entry
+% keyword (the text that is put in front of every index entry in the
+% \texttt{.idx} file). It is changed by e.g.\ the \package{docindex}
+% package~\cite{docindex}.
+% \begin{macrocode}
+\@ifundefined{XD@index@keyword}{%
+ \edef\XD@index@keyword{\@backslashchar indexentry}%
+}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CodelineIndex}
+% \changes{prot2.1}{2000/10/08}{Using \cs{thecodelineno}. (LH)}
+% \begin{macro}{\PageIndex}
+% \begin{macro}{\TheXDIndexNumber}
+% The |\CodelineIndex| and |\PageIndex| commands do the same things as
+% in \package{doc}, but work with the \package{xdoc} internals instead
+% of the \package{doc} ones. |\TheXDIndexNumber| is used as
+% \meta{thenumber} argument to |\IndexEntry| by all indexing commands
+% that would have used |\special@index| in \package{doc}.
+% \begin{macrocode}
+\renewcommand\CodelineIndex{%
+ \makeindex
+ \let\XD@if@index=\@firstoftwo
+ \codeline@indextrue
+ \def\TheXDIndexNumber{\thecodelineno}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand\PageIndex{%
+ \makeindex
+ \let\XD@if@index=\@firstoftwo
+ \codeline@indexfalse
+ \def\TheXDIndexNumber{\thepage}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\TheXDIndexNumber{??}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \subsection{Making good sort keys}
+%
+% \changes{prot2.1}{2000/11/15}{Sort key making commands added. (LH)}
+% A common nuisance in \package{doc} indices is that many macros are
+% sorted by parts of the name that do not carry any interesting
+% information. In the \LaTeX\ kernel many macro names begin with a
+% silent |@|, whereas the names of private macros in many packages
+% (including this one) begin with some fixed abbreviation of the
+% package name. Since such prefixes usually are harder to remember than
+% the rest of the macro name, it is not uncommon that the index position
+% one thinks of first isn't the one where the macro actually is put.
+% Hence a mechanism for removing such annoying prefixes from the macro
+% names might be useful, and that is presicely what is defined below.
+%
+% The actual mechanism is based on having a set of macros called
+% \emph{operators} which operate on the harmless character string that
+% is to become the sort key. Each operator has a specific prefix string
+% which it tries to match against the beginning of the to-be sort key,
+% and if they match then the prefix is moved to the end of the sort key.
+% Automatically constructed operators (see below) have names of the form
+% \describecsfamily{XD@operatorA@\meta{prefix}}|\XD@operatorA@|^^A
+% \meta{prefix}, but operators can be given arbitrary names.
+%
+% \begin{macro}{\XD@operators@list}
+% The |\XD@operators@list| macro contains the list of all currently
+% active operators.
+% \begin{macrocode}
+\let\XD@operators@list\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% The operators do all their work at expand-time. When an operator
+% macro is expanded, it is in the context
+% \begin{quote}
+% \meta{operator} \meta{subsequent operators} |\@firstofone|
+% \meta{sort key text} |\@empty|
+% \end{quote}
+% There may not be any |\@empty|s or |\@firstofone|s amongst the
+% \meta{subsequent operators} or in the \meta{sort key text}. This should
+% expand to
+% \begin{quote}
+% \meta{subsequent operators} |\@firstofone| \meta{operated-on sort
+% key text} |\@empty|
+% \end{quote}
+% The purpose of the |\@firstofone| after the \meta{subsequent
+% operators} is to remove any spaces that some operator might have put
+% in front of the sort key. This happens if the entire sort key text has
+% been ignored by some operator.
+%
+% \begin{macro}{\MakeSortKey}
+% The |\MakeSortKey| command is called to make the acutal sort key.
+% The syntax of this command is
+% \begin{quote}
+% |\MakeSortKey|\marg{macro}\marg{text}\marg{extras}
+% \end{quote}
+% This locally defines \meta{macro} to be the sort key that the
+% currently active operators manufacture from \meta{text}. The
+% \meta{extras} argument can contain additional assignments needed for
+% handling macros with special harmless forms, such as |\meta|.
+% \begin{macrocode}
+\newcommand\MakeSortKey[3]{%
+ \begingroup
+ \def\PrintChar{\string\PrintChar\XD@threedignum}%
+ #3%
+ \unrestored@protected@xdef\@gtempa{#2}%
+ \endgroup
+ \protected@edef#1{%
+ \expandafter\XD@operators@list \expandafter\@firstofone
+ \@gtempa\@empty
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XD@make@operator}
+% The |\XD@make@operator| macro takes a harmless character sequence as
+% argument, constructs the corresponding operator, and returns the
+% operator control sequence in the |\toks@| token list register.
+%
+% More precisely, given a harmless character string \meta{string},
+% |\XD@make@operator| will construct a sequence of other tokens
+% \meta{text} from \meta{string} by replacing all |\PrintChar|
+% commands in the same way as |\MakeSortKey| does. Then it defines the
+% macro |\XD@operatorA@|\meta{text} to be
+% \begin{quote}
+% \raggedright \spaceskip=0.16666em
+% \#1\,|\@firstofone|\,\#2\,|\@empty| \ $\rightarrow$ \ %
+% |\XD@operatorB@|\meta{text} |\@firstofone| \#2
+% |\@firstofone| \meta{text} |\@firstofone| |\relax| \#1 |\@empty|
+% \end{quote}
+% and the macro |\XD@operatorB@|\meta{text} to do
+% \begin{quote}
+% \raggedright
+% \#1\,|\@firstofone|\,\meta{text}\,\#2\,|\@firstofone|\,\#3\,^^A
+% |\relax|\,\#4\,|\@empty| $\rightarrow$
+% \#4\,\( \left\{ \begin{array}{ll}
+% \mbox{\cs{@firstofone}\,\#2\,\textvisiblespace\,\meta{text}\,^^A
+% \cs{@empty}}& \mbox{if \#1 is empty}\\
+% \mbox{\#1\,\cs{@empty}}& \mbox{otherwise}
+% \end{array} \right.\)
+% \end{quote}
+%
+% \begin{macrocode}
+\def\XD@make@operator#1{%
+ \begingroup
+ \def\PrintChar{\string\PrintChar\XD@threedignum}%
+ \let\protect\@gobble
+ \xdef\@gtempa{#1}%
+ \endgroup
+ \expandafter\edef \csname XD@operatorA@\@gtempa\endcsname
+ ##1\@firstofone##2\@empty{%
+ \expandafter\noexpand \csname XD@operatorB@\@gtempa\endcsname
+ \noexpand\@firstofone ##2\noexpand\@firstofone \@gtempa
+ \noexpand\@firstofone \relax##1\noexpand\@empty
+ }%
+ \expandafter\edef \csname XD@operatorB@\@gtempa \expandafter\endcsname
+ \expandafter##\expandafter1\expandafter\@firstofone \@gtempa
+ ##2\@firstofone##3\relax##4\@empty{%
+ \noexpand\ifx $##1$%
+ \noexpand\expandafter \noexpand\@firstoftwo
+ \noexpand\else
+ \noexpand\expandafter \noexpand\@secondoftwo
+ \noexpand\fi{%
+ ##4\noexpand\@firstofone ##2 \@gtempa
+ }{##4##1}%
+ \noexpand\@empty
+ }%
+ \toks@=\expandafter{\csname XD@operatorA@\@gtempa\endcsname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DoNotIndexBy}
+% The |\DoNotIndexBy| command has the syntax
+% \begin{quote}
+% |\DoNotIndexBy|\marg{morpheme}
+% \end{quote}
+% It causes the \meta{morpheme} to be put \emph{last} in the index
+% sort key for each macro name which begins by \meta{morpheme}. This
+% can be used to ignore e.g.\ ``silent'' |@|s at the beginning of a
+% macro name.
+% \begin{macrocode}
+\newcommand\DoNotIndexBy[1]{%
+ \MakeHarmless\@tempa{#1}%
+ \XD@make@operator\@tempa
+ \expandafter\def \expandafter\XD@operators@list \expandafter{%
+ \the\expandafter\toks@ \XD@operators@list
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+% \subsection{Reimplementations of \package{doc} indexing commands}
+%
+% The \package{doc} indexing commands aren't that interesting in
+% \package{xdoc}, since they take `raw' control sequences as
+% arguments rather than the harmless strings that the \package{xdoc}
+% commands will want to put in the index. But it can be instructive to
+% see how they would be implemented in this context.
+%
+% \begin{macro}{\SortIndex}
+% \changes{prot2.2}{2001/02/13}{Redefinition added. (LH)}
+% The |\SortIndex| takes a sort key and an entry text as argument, and
+% writes a one-level index entry for that.
+% \begin{macrocode}
+\renewcommand*\SortIndex[2]{%
+ \IndexEntry{\LevelSorted{#1}{#2}}{none}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SpecialIndex}
+% \begin{macro}{\SpecialMainIndex}
+% \begin{macro}{\SpecialUsageIndex}
+% The |\SpecialIndex|, |\SpecialMainIndex|, and |\SpecialUsageIndex|
+% commands take a control sequence (or more often something which looks
+% like a |\string|ed control sequence) as their only argument. The
+% entry text is that item verbatim, and the initial backslash is
+% ignored in sorting (|\Special|\-|Index| always ignores the first
+% character regardless of whether it is a backslash or not, the other
+% two checks first). |\Special|\-|Index| has \texttt{none} formatting,
+% |\Special|\-|Main|\-|Index| has \texttt{main} formatting, and
+% |\Special|\-|Usage|\-|Index| has \texttt{usage} formatting of the
+% index number.
+%
+% Although these definitions will (or at least are supposed to) yield
+% the same typeset results as the \package{doc} definitions in the
+% mainstream cases, I doubt that they will do so in all cases. At any
+% rate, they shouldn't perform worse.
+% \begin{macrocode}
+\renewcommand\SpecialIndex[1]{%
+ \expandafter\MakeHarmless \expandafter\@tempa
+ \expandafter{\string#1}%
+ \IndexEntry{%
+ \LevelSorted{%
+ \expandafter\XD@unbackslash \@tempa\@empty
+ }{\texttt{\@tempa}}%
+ }{none}{\TheXDIndexNumber}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand\SpecialMainIndex[1]{%
+ \expandafter\MakeHarmless \expandafter\@tempa
+ \expandafter{\string#1}%
+ \IndexEntry{%
+ \LevelSorted{%
+ \expandafter\XD@unbackslash \@tempa\@empty
+ }{\texttt{\@tempa}}%
+ }{main}{\TheXDIndexNumber}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand\SpecialUsageIndex[1]{%
+ \expandafter\MakeHarmless \expandafter\@tempa
+ \expandafter{\string#1}%
+ \IndexEntry{%
+ \LevelSorted{%
+ \expandafter\XD@unbackslash \@tempa\@empty
+ }{\texttt{\@tempa}}%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@unbackslash}
+% \begin{macro}{\XD@unbackslash@}
+% |\XD@unbackslash| is a utility macro which removes the first
+% character from a harmless character string if that character is a
+% backslash (i.e., if it is |\PrintChar{92}|). The \package{doc}
+% commands have traditionally used |\@gobble| for doing this, but the
+% \cs{@SpecialIndexHelper@} macro that was comparatively recently added
+% tries to do better.
+% \begin{macrocode}
+\def\XD@unbackslash#1{%
+ \ifx \PrintChar#1%
+ \expandafter\XD@unbackslash@
+ \else
+ \expandafter#1%
+ \fi
+}
+\def\XD@unbackslash@#1{\ifnum #1=92 \else \PrintChar{#1}\fi}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\SpecialMainEnvIndex}
+% \begin{macro}{\SpecialEnvIndex}
+% These are similar to the above, but \package{doc} thinks that the
+% arguments don't need any special care, and it produces two index
+% entries per command. |\Special|\-|Env|\-|Index| should really have
+% been called |\Special|\-|Usage|\-|Env|\-|Index|.
+% \begin{macrocode}
+\renewcommand\SpecialMainEnvIndex[1]{%
+ \IndexEntry{\LevelSorted{#1}{\texttt{#1} (environment)}}{main}%
+ {\TheXDIndexNumber}%
+ \IndexEntry{\LevelSame{environments:}\LevelSorted{#1}{\texttt{#1}}}%
+ {main}{\TheXDIndexNumber}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\renewcommand\SpecialEnvIndex[1]{%
+ \IndexEntry{\LevelSorted{#1}{\texttt{#1} (environment)}}{usage}%
+ {\thepage}%
+ \IndexEntry{\LevelSame{environments:}\LevelSorted{#1}{\texttt{#1}}}%
+ {usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\it@is@a}
+% \begin{macro}{\XD@special@index}
+% The |\it@is@a| macro is a specialized version of |\SpecialIndex|,
+% but the format of its argument is quite different. After full
+% expansion the argument will become a single category 12 token
+% (\meta{t}, say), and the control sequence for which an entry should
+% be made is |\|\meta{t}. \package{doc} uses |\it@is@a| for control
+% sequences with one-character names. Note: The following
+% definition should really have special code for the \Module{economical}
+% \package{docstrip} module, but I don't think that is necessary
+% since the \package{doc} macros which used |\it@is@a| will be
+% redefined so that they don't.
+%
+% |\XD@special@index| does the same thing as |\SpecialIndex|, but it
+% does it with \package{xdoc} datatypes---the argument must be a
+% harmless character string that does not include the initial escape
+% (backslash).
+% \changes{prot2.1}{2000/11/15}{Using \cs{MakeSortKey} to make the
+% sort key. (LH)}
+% \begin{macrocode}
+\def\it@is@a#1{%
+ \edef\@tempa{#1}%
+ \XD@special@index{\csname XD@harmless@\number
+ \expandafter`\@tempa\endcsname}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@special@index#1{%
+ \MakeSortKey\@tempa{#1}{}%
+ \IndexEntry{\LevelSorted{\@tempa}{\texttt{\Bslash#1}}}{none}%
+ {\TheXDIndexNumber}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\LeftBraceIndex}
+% \begin{macro}{\RightBraceIndex}
+% \begin{macro}{\PercentIndex}
+% \begin{macro}{\OldMakeIndex}
+% More specialised forms of |\SpecialIndex|. The |\OldMakeIndex|
+% command can safely be made a no-op.
+% \begin{macrocode}
+\renewcommand\LeftBraceIndex{\XD@special@index{\PrintChar{123}}}
+\renewcommand\RightBraceIndex{\XD@special@index{\PrintChar{125}}}
+\renewcommand\PercentIndex{\XD@special@index{\PrintChar{37}}}
+\let\OldMakeIndex\relax
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\@wrindex}
+% \changes{prot2.2}{2001/02/13}{Redefinition added. (LH)}
+% Finally, while we're at redefining indexing commands, let's redefine
+% |\@wrindex| as well to ensure that the index entry keyword is the
+% same for all indexing commands.
+% \begin{macrocode}
+\def\@wrindex#1{%
+ \protected@write\@indexfile{}{\XD@index@keyword{#1}{\thepage}}%
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Cross-referencing}
+%
+% \subsection{Scanning \texttt{macrocode} for \TeX\ control sequences}
+% \label{Ssec:Scanning macrocode}
+%
+% The cross-referencing mechanism in \package{doc} isn't problematic in
+% the same way as the indexing mechanism is, so one could pretty much
+% leave it as it is, but there are things that are better done
+% differently when the basic indexing commands are based on harmless
+% character strings. Rather than storing control sequence names (without
+% escape character) as sequences of category 11 tokens, they will be
+% stored as the equivalent harmless character strings.
+%
+% \begin{macro}{\macro@switch}
+% As in \package{doc}, |\macro@switch| determines whether the control
+% sequence name that follows consists of letters (call |\macro@name|)
+% or a single non-letter (call |\short@macro|). Unlike \package{doc},
+% \package{xdoc} accumulates the characters from a multiple-letter
+% control sequence name in a token register (|\@toks|), which is why
+% that is cleared here.
+% \begin{macrocode}
+\def\macro@switch{%
+ \ifcat\noexpand\next a%
+ \toks@={}%
+ \expandafter\macro@name
+ \else
+ \expandafter\short@macro
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\scan@macro}
+% Since |\macro@namepart| isn't used as in \package{doc}, I might as
+% well remove the command that cleared it from |\scan@macro|.
+% \begin{macrocode}
+\def\scan@macro{%
+ \special@escape@char
+ \step@checksum
+ \ifscan@allowed
+ \def\next{\futurelet\next\macro@switch}%
+ \else \let\next\@empty \fi
+ \next}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \begin{macro}{\short@macro}
+% This macro will be invoked (with a single character as parameter)
+% when a single-character macro name has been spotted whilst
+% scanning within the \texttt{macrocode} environment. It will produce
+% an index entry for that macro, unless that macro has been excluded
+% from indexing, and it will also typeset the character that
+% constitutes the name of the macro.
+% \begin{macrocode}
+\def\short@macro#1{%
+ \protected@edef\macro@namepart{%
+%<*economical>
+ \ifnum `#1<\@xxxii
+ \noexpand\PrintChar{\number`#1}%
+ \else\ifnum `#1>126
+ \noexpand\PrintChar{\number`#1}%
+ \else
+%</economical>
+ \csname XD@harmless@\number`#1\endcsname
+%<economical> \fi\fi
+ }%
+ \ifnot@excluded \XD@special@index{\macro@namepart}\fi
+% \end{macrocode}
+% The cross-referencing mechanism is disabled for when the actual
+% character is printed, as it could be the escape character. The index
+% entry must be generated before the character is printed to ensure
+% that no page break intervenes (recall that a |^^M| will start a new
+% line).
+% \begin{macrocode}
+ \scan@allowedfalse #1\scan@allowedtrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% There is one mechanism in |\TeX|'s control sequence tokenization that
+% |\short@|\B|macro| doesn't cover, and that is the |^^| sequence
+% substitution---|\^^M| is (with default catcodes) seen as the three
+% tokens |\^|, |^|, and |M|, not as the single control
+% sequence token that \TeX\ will make out of it. But this is the way it
+% is done in \package{doc}.
+%
+%
+% \begin{macro}{\macro@name}
+% \begin{macro}{\more@macroname}
+% \begin{macro}{\macro@finish}
+% Then there's the macros for assembling a control sequence name which
+% consists of one or more letters (category 11 tokens). (This includes
+% both the characters which are normally letters in the document and
+% those that are made letters by |\MakePrivateLetters|.) They're
+% pretty straightforward.
+% \begin{macrocode}
+\def\macro@name#1{%
+%<*economical>
+ \if \ifnum `#1<\@xxxii 1\else \ifnum `#1>126 1\else 0\fi\fi 1%
+ \toks@=\expandafter{\the\expandafter\toks@
+ \expandafter\PrintChar \expandafter{\number`#1}%
+ }%
+ \else
+%</economical>
+ \toks@=\expandafter{\the\expandafter\expandafter\expandafter\toks@
+ \csname XD@harmless@\number`#1\endcsname}%
+%<economical> \fi
+ \futurelet\next\more@macroname}
+% \end{macrocode}
+% \begin{macrocode}
+\def\more@macroname{%
+ \ifcat\noexpand\next a%
+ \expandafter\macro@name
+ \else
+ \macro@finish
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\macro@finish{%
+ \edef\macro@namepart{\the\toks@}%
+ \ifnot@excluded \XD@special@index{\macro@namepart}\fi
+ \macro@namepart
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \subsection{The index exclude list}
+% \label{Ssec:Index-exclude}
+%
+% The index exclude list mechanisms are not quite as simple to convert
+% for use with harmless character strings as the construction of macro
+% names are. This is because the trick used for searching the exclude
+% list for a certain string doesn't work if the string one is looking
+% for contains tokens with category 1 or 2 (beginning and end of group),
+% as the \meta{parameter text} of a |\def| cannot contain such tokens.
+% On the other hand the only groups that can appear in the harmless
+% character strings one will be looking for are the ones around the
+% argument of some |\PrintChar|, and these can easily be converted to
+% something else. Therefore an item in the index exclude list of
+% \package{xdoc} will have the format
+% \begin{quote}
+% |\do|\,\meta{string}
+% \end{quote}
+% where the \meta{string} is different from a harmless character string
+% only in that all |\PrintChar|\marg{num} have been replaced by
+% |\PrintChar|\parg{num}. The \meta{string} does not include an escape
+% character. The |\do| serves only to separate the item from the one
+% before, but it could in principle be used for other purposes as well
+% (such as in typesetting the entire exclude list).
+%
+% \begin{macro}{\XD@paren@PrintChar}
+% |\XD@paren@PrintChar| is a definition of |\PrintChar| which, when it
+% is used in an |\edef|, merely replaces the group around the argument
+% by a parenthesis and normalizes the number in the argument.
+% \changes{prot2.1}{2000/09/16}{\cs{number} added. (LH)}
+% \begin{macrocode}
+\def\XD@paren@PrintChar#1{\noexpand\PrintChar(\number#1)}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DoNotIndex}
+% \changes{prot2.1}{2000/09/16}{Also changing catcode of \%. (LH)}
+% \begin{macro}{\do@not@index}
+% \begin{macro}{\XD@do@not@index}
+% These are the macros which add elements to the index exclude list.
+% |\DoNotIndex| is pretty much as in \package{doc}, but I have added
+% resetting of the catcodes of `|,|' (since |\XD@do@not@index| relies
+% on it) and `|#|' (since it can otherwise mess things up for the
+% |\def\@tempa| in |\do@not@index|).
+% \begin{macrocode}
+\renewcommand\DoNotIndex{%
+ \begingroup
+ \MakePrivateLetters
+ \catcode`\#=12\catcode`\\=12\catcode`,=12\catcode`\%=12
+ \expandafter\endgroup \do@not@index
+}
+% \end{macrocode}
+%
+% |\do@not@index|, on the other hand, is quite different, as it more
+% or less has to convert the argument from the format used in
+% \package{doc} to that of \package{xdoc}. The bulk of the work is
+% done by |\XD@do@not@index|, which grabs one of the elements in the
+% argument of |\do@not@index| and converts it (minus the initial
+% backslash) to a harmless character string. That harmless character
+% string is then converted by |\XD@paren@PrintChar|, so that the
+% string can be searched for using |\expanded@notin|.
+%
+% The reason for using a special loop structure here, as opposed to
+% using for example |\@for|, is that one cannot use either of |\|
+% or |,| alone as item separators, as they may both be part of control
+% sequence names (consider for example |\DoNotIndex{\a,\\,\b,\,,\c}|),
+% but they should be sufficient when combined.
+%
+% The reason for storing new elements in |\toks@| until the end of
+% the loop and only then inserting them into the index exclude list
+% is speed; the index exclude list can get rather large, so you don't
+% want to expand it more often than you have to. I don't know if the
+% difference is noticeable, though.
+% \begin{macrocode}
+\begingroup
+ \catcode`\|=0
+ \catcode`\,=12
+ \catcode`\\=12
+% \end{macrocode}
+% \SpecialEscapechar{\|}
+% \begin{macrocode}
+ |gdef|do@not@index#1{%
+ |def|@tempa{#1}%
+ |ifx |@empty|@tempa |else
+ |toks@={}%
+ |expandafter|XD@do@not@index |@gobble #1,\|XD@do@not@index,\%
+ |fi
+ }
+ |gdef|XD@do@not@index#1,\{%
+ |ifx |XD@do@not@index#1%
+ |index@excludelist=|expandafter{%
+ |the|expandafter|index@excludelist |the|toks@
+ }%
+ |expandafter|@gobble
+ |else
+ |MakeHarmless|@tempa{#1}%
+ |begingroup
+ |let|PrintChar|XD@paren@PrintChar
+ |unrestored@protected@xdef|@gtempa{|noexpand|do|@tempa}%
+ |endgroup
+ |toks@=|expandafter{|the|expandafter|toks@ |@gtempa}%
+ |fi
+ |XD@do@not@index
+ }
+|endgroup
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\DoNotIndexHarmless}
+% The |\DoNotIndexHarmless| command takes a harmless character string
+% as argument and locally adds the control sequence whose name is that
+% character string to the index exclude list.
+% \begin{macrocode}
+\newcommand\DoNotIndexHarmless[1]{%
+ \begingroup
+ \let\PrintChar\XD@paren@PrintChar
+ \unrestored@protected@xdef\@gtempa{\noexpand\do#1}%
+ \endgroup
+ \index@excludelist=\expandafter{%
+ \the\expandafter\index@excludelist \@gtempa
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\index@excludelist}
+% In case the index exclude list is not empty, its contents are
+% converted to \package{xdoc} format.
+% \begin{macrocode}
+\edef\@tempa{\the\index@excludelist}
+\index@excludelist{}
+\ifx \@tempa\@empty \else
+ \def\@tempb#1,\@nil{\do@not@index{#1}}
+ \expandafter\@tempb \@tempa \@nil
+ \let\@tempa\@empty
+ \let\@tempb\@empty
+\fi
+% \end{macrocode}
+% The fact that the |\XD@|\B|harmless@|\B\meta{code} table has not
+% yet reached its final form means that some of these control sequences
+% listed in the exclude list might get a different form here than they
+% actually should, but there isn't much that can be done about that. It
+% is furthermore unusual that control sequence are given such names
+% that they would be affected by this.
+% \end{macro}
+%
+% \begin{macro}{\ifnot@excluded}
+% The |\ifnot@excluded| macro ultimately boils down to an
+% \texttt{if}, which evaluates to true if and only if the string in
+% |\macro@namepart| is not one of the items in the index exclude
+% list. Before |\expanded@notin| gets to carry out the actual test,
+% the |\PrintChar| calls in |\macro@namepart| are converted by
+% |\XD@paren@PrintChar| (it's OK to use an unprotected |\edef| for
+% this, since |\PrintChar| is the only control sequence that can
+% appear in |\macro@namepart|) so that |\expanded@notin| can be used
+% to test for its presence.
+% \begin{macrocode}
+\def\ifnot@excluded{%
+ \begingroup
+ \let\PrintChar\XD@paren@PrintChar
+ \edef\@tempa{\macro@namepart}%
+ \expandafter\endgroup \expandafter\expanded@notin
+ \expandafter{\expandafter\do \@tempa\do}%
+ {\the\index@excludelist}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{External cross-referencing}
+% \label{Ssec:XXR}
+%
+% (This subsection is a bit speculatory, but I think the structures it
+% describes may come in handy.)
+%
+% \changes{prot2}{2000/07/31}{I finally decided that it would be better
+% to make the XXR-commands look like comments to \TeX. (LH)}
+%
+% It's rather easy to write macros for scanning \TeX\ code for the names
+% of control sequences---just look for the escape (category 0)
+% character, and whatever follows is the name of a control sequence.
+% Doing the same thing for other languages may lay anywhere between
+% ``a~tricky exercise in advanced \TeX\ programming'' and ``possible in
+% theory'',\footnote{I.e., you know it can be implemented as a computer
+% program (in some language), you know that any computer program can be
+% translated to a Turing machine (or if you prefer that, expressed in
+% lambda calculus), and you know that a Turing machine can be emulated
+% by \TeX, but that's the closest thing to a solution you've managed to
+% come up with.} but in most cases the available solutions turn out to be
+% too complicated and\slash or slow to be of practical use. When that
+% happens, one might instead want to use some external piece of software
+% for doing the cross-referencing.
+%
+% The commands in this subsection implement basic support for such an
+% external cross-referencing program (or XXR,\footnote{Maybe not the
+% most logical name, but it looks much cooler than ECR.} for short). The
+% idea is that an XXR should communicate with \LaTeX\ like \BibTeX\
+% does---scan the \texttt{.aux} file (or files, if we're |\include|ing
+% things) for certain ``commands'' and use them to locate the files to
+% cross-reference, get parameter settings (like for example entries for
+% the index exclude list), and so on. It should then cross-reference the
+% file(s) and write the index entries in a suitable format to some file
+% (appending them to the \texttt{.idx} file is probably the easiest
+% solution). This way, it is (almost) as simple to use as the built-in
+% cross-referencing and the extra work for supporting it is (in
+% comparison to not supporting it) negligible.
+%
+% \begin{xrefcmd}{ExternalXRefMsg}
+% \begin{macro}{\SendExternalXRefMsg}
+% \changes{prot2}{2000/07/28}{Added \cs{if@filesw} test. (LH)}
+% It's hardly possible to predict all kinds of information that one
+% might want to give to an XXR, and neither can one assume that
+% there is only one XXR program that will read the \texttt{.aux}
+% file. A complicated project might involve code in several languages,
+% and each language might have its own XXR.
+% Therefore the general XXR-command (text in an \texttt{.aux} file which
+% is used for communicating information to an XXR) simply has the syntax
+% \begin{quote}
+% \verb*|%%ExternalXRefMsg |\marg{who}\verb*| |\marg{what}
+% \end{quote}
+% \meta{who} identifies the XXR this message is meant for. It must be
+% balanced text to \TeX\ and may not contain any whitespace, but can
+% otherwise be rather arbitrary. \meta{what} is the actual message. It
+% too must be balanced text to \TeX\ and it may not contain any
+% newlines, but it is otherwise arbitrary.
+% \index{whitespace restrictions}^^A
+% The reason for these restrictions on the contents of \meta{who} and
+% \meta{what} is that many (maybe even most) scripting languages
+% (which is what at least the \texttt{.aux}-scanning part of an
+% XXR will probably be written in) are much better at recognising
+% words on a line than they are at recognising a brace-delimited group.
+% By accepting these restrictions, one can make sure that all XXRs can
+% correctly determine whether a message is for them, even if they see
+% the \texttt{.aux} file as a sequence of lines composed of
+% whitespace-delimited words.
+%
+% |\SendExternalXRefMsg| is the basic command for writing
+% |ExternalXRefMsg|s to the \texttt{.aux} file, but it might be
+% recommendable that XXR writers provide users with a set of commands
+% that have more specific purposes. The syntax of the
+% |\Send|\-|External|\-|XRef|\-|Msg| command is (hardly surprising)
+% \begin{quote}
+% |\SendExternalXRefMsg|\marg{who}\marg{what}
+% \end{quote}
+% |\SendExternalXRefMsg| does a protected full expansion (like
+% |\protected@edef|) of its arguments at the time it is called.
+% \begin{macrocode}
+\newcommand\SendExternalXRefMsg[2]{%
+ \begingroup
+ \if@filesw
+ \let\protect\@unexpandable@protect
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefMsg {#1} {#2}}%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}\end{xrefcmd}
+%
+% The remaining commands in this subsection address complications that
+% exist because of how \texttt{.dtx} files are generally written, and
+% thus constitutes difficulties that all XXRs will have to face.
+%
+% \begin{xrefcmd}{ExternalXRefFile}
+% The usual way to write \texttt{.dtx} files is to include a
+% driver---a~short piece of uncommented \LaTeX\ code which contains
+% the necessary preamble material and a document body which mainly
+% contains a |\DocInput| for the \texttt{.dtx} file itself---but it
+% is also usually understood that this driver may be copied to another
+% file if necessary and larger projects usually have a completely
+% separate driver file. Therefore an XXR cannot be expected to be
+% able to find the file(s) to cross-reference simply by changing
+% suffix on the name of the \texttt{.aux} file it reads its commands
+% from. A more intricate method must be used.
+%
+% To tell the XXR that ``here I input the file \dots'', one includes
+% an |External|\-|XRef|\-|File| XXR-command in the \texttt{.aux} file.
+% Its syntax is
+% \begin{quote}
+% \verb*|%%ExternalXRefFile |\marg{cmd}\verb*| |\marg{file}^^A
+% \verb*| |\marg{what}
+% \end{quote}
+% \meta{file} is the name (as given to |\input| or the like) of the
+% file to input. \meta{cmd} is either \texttt{begin} (begin of
+% \meta{file}) or \texttt{end} (end of \meta{file}). \meta{what} is a
+% declaration of what is in the file; XXRs should use it to determine
+% whether they should process this file or not. \meta{what} is empty
+% if all XXRs should process the file, but for example |\IndexInput|
+% will put \texttt{TeX} here to declare that the contents of this file
+% are \TeX\ code and only XXRs that cross-reference \TeX\ code need to
+% process this file.
+%
+% In connection to this, it should be mentioned that XXRs must also look
+% for (and act on) |\@input|\penalty\hyphenpenalty\marg{auxfile} commands
+% that |\include| or |\DocInclude| has written to the \texttt{.aux} file,
+% since these \meta{auxfile}s can also contain commands for the XXR
+% that should result in output to the same \texttt{.idx} file. In
+% particular, the |ExternalXRefFile| XXR-commands that are written
+% because of a |\DocInclude| will be written to such an \meta{auxfile}.
+% \end{xrefcmd}
+%
+% \begin{xrefcmd}{ExternalXRefSync}
+% Most XXRs will probably find it an unreasonable task to keep exact
+% track of all codelines in all documents, i.e., they will sometimes
+% think that a piece of code contains more or fewer numbered
+% codelines than it actually does. If for example a document contains
+% code such as\iffalse
+%<*example>
+% \fi
+%\begin{verbatim}
+%% \iffalse
+%% \begin{macrocode}
+%Etaoin Shrldu
+%% \end{macrocode}
+%% \fi
+%\end{verbatim}\iffalse
+%</example>
+%\fi
+% then all reasonable XXRs will probably be fooled into thinking that
+% the \texttt{Etaoin Shrldu} line is a numbered codeline. This would
+% of course be very bad if an XXR thought it should cross-reference
+% the contents of this line, but that shouldn't usually be a problem
+% since the specifications\footnote{I imagine these specifications
+% will consist of a list of \package{docstrip} options (modules),
+% possibly used in combination with restrictions on the names of
+% surrounding environments.} of what code should be cross-referenced
+% will probably make it clear that the above line should not be
+% cross-referenced. Code such as the above will still be problematic
+% however, as it will cause the XXR to believe that the
+% \texttt{codelineno} counter has another value on any following
+% line that is indexed than it actually has in the typeset
+% document. This will cause index entries to refer to another line
+% than it actually should.
+%
+% To overcome this, the |ExternalXRefSync| XXR-command can be used to
+% tell the XXR what the corresponding values of |\inputlineno| and
+% \texttt{codelineno} are. Its syntax is
+% \begin{quote}
+% \verb*|%%ExternalXRefSync |\marg{inputlineno}\verb*| |^^A
+% \marg{codelineno}
+% \end{quote}
+% where \meta{inputlineno} is the expansion of |\the\inputlineno| and
+% \meta{codelineno} is the expansion of |\thecodelineno|, both
+% expanded at the same point in the program. Note here that the first
+% line of a file is line number 1, that line number 0 is used to
+% denote ``just before the first line'', and that \texttt{codelineno}
+% gets increased immediately before the number is typeset (i.e.,
+% \texttt{codelineno} contains the number of the last numbered
+% codeline).
+% \end{xrefcmd}
+%
+% This doesn't support external cross-referencing by pages, since doing
+% that requires that the document outputs a lot more information to the
+% \texttt{.aux} file. In principle, one could put a |\mark|\penalty0
+% |{\thecodelineno}| in |\PrintCodelineNo| and a |\write| in the page
+% header which outputs to the \texttt{.aux} file which range of
+% codelines correspond to a given page, but the \LaTeXe\ sectioning
+% commands' use of marks tends to interfere with this. The \LaTeXplus\
+% package \package{xmarks} will probably solve that problem, though.
+%
+% \begin{macro}{\syncexternalxref}
+% \changes{prot2}{2000/07/28}{New name for \cs{SendExternalXRefSync}.
+% Also added \cs{if@filesw} test. (LH)}
+% ^^A Johann Sebastian Bach: 1685/03/21--1750/07/28
+% The |\syncexternalxref| command writes an |ExternalXRefSync|
+% XXR-command for the current line number and value of the
+% \texttt{codelineno} counter to \texttt{.aux} file. It is used for
+% synchronizing the numbered codeline counter that an XXR maintains with
+% the \texttt{codelineno} counter that is used for numbering codelines
+% in the typeset document after a piece of code in the document that
+% some XXR is likely to misinterpret. |\sync|\-|external|\-|xref|
+% shouldn't be used inside \texttt{macrocode} environments (or the
+% like) as they tend to read ahead in the file---instead it is best
+% placed shortly after such an environment. |\sync|\-|external|\-|xref|
+% has no arguments.
+% \begin{macrocode}
+\newcommand\syncexternalxref{%
+ \if@filesw
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefSync {\the\inputlineno} {\thecodelineno}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{xrefcmd}{ExternalXRefWrap}
+% The |\DocInclude| command complicates matters for XXRs by redefining
+% things so that the \texttt{codelineno} counter only makes up a part
+% of the line numbers appearing in the index. The purpose of the
+% |External|\-|XRef|\-|Wrap| XXR-command is to inform XXRs about such
+% changes. The command
+% \begin{quote}
+% \verb*|%%ExternalXRefWrap {|\meta{prefix}\verb*|} {|^^A
+% \meta{suffix}|}|
+% \end{quote}
+% means that codeline numbers written to the index should have the form
+% \begin{quote}
+% \meta{prefix}\meta{codelineno}\meta{suffix}
+% \end{quote}
+% This setting takes effect from the next |External|\-|XRef|\-|Sync|
+% and stays in effect until the end of the document or until another
+% |External|\-|XRef|\-|Wrap| overrides it. The state at the beginning
+% of the document is to have both \meta{prefix} and \meta{suffix}
+% empty.
+% \end{xrefcmd}
+%
+%
+% \begin{macro}{\XD@input}
+% The |\XD@input| command is a version of |\input| which takes care
+% to inform XXRs that another file is being |\input|ted. Its syntax is
+% \begin{quote}
+% |\XD@input|\marg{file}\marg{what}
+% \end{quote}
+% where \meta{file} is the name of the file to |\input| and \meta{what}
+% is the contents of the file, as specified in
+% |External|\-|XRef|\-|File| commands.
+% \begin{macrocode}
+\def\XD@input#1#2{%
+ \if@filesw
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefFile {begin} {#1} {#2}%
+ }%
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefSync {0} {\thecodelineno}%
+ }%
+ \fi
+ \input{#1}%
+ \if@filesw
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefFile {end} {#1} {#2}%
+ }%
+ \immediate\write\@auxout{\@percentchar\@percentchar
+ ExternalXRefSync {\the\inputlineno} {\thecodelineno}%
+ }%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DocInput}
+% The |\DocInput| command is redefined so that it writes
+% |External|\-|XRef|\-|File| and |External|\-|XRef|\-|Sync| XXR-commands
+% to the \texttt{.aux} file. Furthermore, with \package{xdoc} one
+% should always use the |\DocInput| command (or some command based on
+% it, like |\DocInclude|) for inputting a file where percent is an
+% `ignore' character---even when one such file inputs another. (Doing
+% that didn't work with the \package{doc} definition, as it always
+% called |\MakePercentComment| upon return, but the \package{xdoc}
+% definition contains code for dealing with that.)
+% \begin{macrocode}
+\renewcommand\DocInput[1]{%
+ \relax
+ \ifnum \catcode`\%=14
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi{%
+ \MakePercentIgnore\XD@input{#1}{}\MakePercentComment
+ }{\XD@input{#1}{}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IndexInput}
+% The |\IndexInput| command also needs to be redefined to write
+% XXR-commands to the \texttt{.aux} file. It would
+% probably be enough here to write an |External|\-|XRef|\-|Sync|
+% after the file has been |\input| since no external
+% cross-referencing of |\IndexInput|ted files is needed, but I do the
+% more verbose variant here just to exemplify how these things would
+% look for other languages.
+% \begin{macrocode}
+\renewcommand\IndexInput[1]{%
+ \begingroup
+ \macro@code
+ \frenchspacing
+ \@vobeyspaces
+ \XD@input{#1}{TeX}%
+ \endmacrocode
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{Two-sided printing}
+% \label{Sec:Twoside}
+%
+% The main problem one faces when reimplementing \package{doc} so that
+% the marginal material always appears in the outer margin in two-sided
+% documents is that the justification of \package{doc}'s marginal
+% material is asymmetric; it always extends outwards. This means that
+% the justification to use when typesetting the marginal material must
+% depend on whether it is to be put on a left or a right
+% page---something which cannot be determined for sure when the
+% material is typeset! This is a minor difficulty if the marginal material
+% is put in place using \LaTeX's |\marginpar| command, as that allows the
+% user to supply different versions of the marginal paragraph for left and
+% right margin placements. It is however a major difficulty if the
+% marginal material is displaced out into the margin from within the main
+% galley (like the \texttt{macro} environment of \package{doc} does),
+% since the output routine is never involved.
+%
+% Even though this difficulty provides arguments for using a |\marginpar|
+% mechanism for all text that is put in the margin, that will not be
+% done in \package{xdoc} (but maybe it will in some successor).
+% Instead \package{xdoc} contains a general mechanism which uses data
+% written to the \texttt{.aux} file for determining whether a piece of
+% text was put on an odd or even numbered page the \emph{last} time the
+% document was typeset. By the usual convergence of page breaks in a
+% \LaTeX\ document, this will eventually produce a typeset document
+% with the marginal material consistently in the outer margin.
+%
+% The mechanism works as follows. The places in the document (the
+% document source) at which it is necessary to determine whether
+% something is going to appear on an even (left) or an odd (right) page
+% are called ``page situations''\footnote{I know it's not a particularly
+% good name. Suggestions for better names are gracefully accepted.} or
+% just ``situations''. In each situation, a relatively simple test (is
+% the \texttt{page} counter currently even or odd?) which is right more
+% often than not is used as a first guess, and both the guess, the
+% placement actually used, and the correct answer (determined from the
+% value of \texttt{page} when the piece of text is shipped out) are
+% recorded in the \texttt{.aux} file. If the guess (for the current
+% situation) coincided with the correct answer the last time the
+% document was typeset then the guess determined now is used, otherwise
+% the opposite of the guess determined now is used. Finally, when at
+% |\end{document}| the \texttt{.aux} file is inputted to check for
+% changed labels, the placements used are also checked and the user is
+% given a suitable warning if there was an incorrect one.
+%
+% \begin{macro}{\IfOddPageSituation}
+% The |\IfOddPageSituation| macro is the user level test for whether
+% the current page situation appears on an odd or an even page. It
+% has the syntax
+% \begin{quote}
+% |\IfOddPageSituation|\marg{odd}\marg{even}
+% \end{quote}
+% and this will expand to \meta{odd} if the current situation is
+% expected to end up on an odd page (based on how correct it was to
+% look at the value of \texttt{page} last time) and to \meta{even}
+% otherwise. In single-sided mode, it always expands to \meta{even}.
+% In two-sided mode, |\IfOddPageSituation| is redefined for the new
+% situation each time |\StepPageSituation| is called.
+% \begin{macrocode}
+\let\IfOddPageSituation=\@secondoftwo
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\StepPageSituation}
+% \changes{prot2.1}{2000/12/19}{Now also setting
+% \cs{IfOddPageSituation}, instead of having that macro performing
+% the test each time it is used. This fixes a rarely occuring bug
+% which occurs when a page is shipped out between
+% \cs{StepPageSituation} and a corresponding
+% \cs{IfOddPageSituation}. (LH)}
+% \begin{macro}{\macro@cnt}
+% \begin{macro}{\XD@next@wrong}
+% \begin{macro}{\XD@wrongs@list}
+% The |\StepPageSituation| command is called to inform the page
+% situation mechanism that a new situation has begun. The rule for
+% when you need to use |\Step|\-|Page|\-|Situation| is simple: if you
+% use |\IfOdd|\-|Page|\-|Situation| in two places which may end up on
+% different pages, then there must be a |\Step|\-|Page|\-|Situation|
+% between them. There is no code which automatically calls
+% |\Step|\-|Page|\-|Situation|---not even |\clearpage| or other
+% macros which force page breaks do this---hence macros which use
+% the page situation mechanism must always call |\Step|\-|Page|\-^^A
+% |Situation| explicitly when a new situation begins.
+%
+% Since the |\macro@cnt| count register isn't used for stacking
+% marginal headings (``macro'' names) anymore (see below), it is
+% employed for enumerating page situation. |\XD@next@wrong| is a macro
+% which contains the number of the next situation in which the guess
+% was wrong last time. Unless |\XD@next@wrong|${}={}$|\macro@cnt|, the
+% guess was right last time. All assignments to |\macro@cnt| and
+% |\XD@next@wrong| are global.
+%
+% |\XD@wrongs@list| is a list of all the wrong guesses. It has the
+% syntax
+% \begin{quote}
+% |\@elt|\marg{guess no.}|\@elt|\marg{guess no.}\dots
+% |\@elt|\marg{guess no.}
+% \end{quote}
+% where the \meta{guess no.}s are the numbers of the wrong guesses, in
+% increasing order. The contents of |\XD@wrongs@list| are collected
+% when the \texttt{.aux} file is inputted at |\begin|\B|{document}|,
+% and they are removed again as \TeX\ passes the situation in the
+% document that they apply to. All assignments to |\XD@wrong@list| are
+% global.
+%
+% Calling |\StepPageSituation| increases |\macro@cnt| by one,
+% updates |\XD@|\B|next@|\B|wrong| and |\XD@|\B|wrong@|\B|list|
+% appropriately, and sets |\IfOdd|\B|Page|\B|Situation| to
+% |\@firstoftwo| or |\@secondoftwo| (whichever is correct for this
+% situation). |\@next| is a list management macro from the \LaTeX\
+% kernel.
+% \begin{macrocode}
+\if@twoside
+ \def\StepPageSituation{%
+ \global\advance \macro@cnt \@ne
+ \ifnum \XD@next@wrong<\macro@cnt
+ \global\@next\XD@next@wrong\XD@wrongs@list{}{%
+ \let\XD@next@wrong\maxdimen
+ }%
+ \fi
+ \ifnum \ifodd\c@page -\fi \@ne=%
+ \ifnum \XD@next@wrong=\macro@cnt -\fi \@ne
+ \global\let\IfOddPageSituation\@secondoftwo
+ \else
+ \global\let\IfOddPageSituation\@firstoftwo
+ \fi
+ }
+ \def\XD@next@wrong{-\maxdimen}
+ \let\XD@wrongs@list\@empty
+\else
+ \let\StepPageSituation=\relax
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\RecordPageSituation}
+% The |\RecordPageSituation| command generates a |\write| whatsit node
+% which records the outcome of the current page situation. It is the
+% location of this whatsit node that determines on which page a
+% certain situation is considered to occur. If you don't execute this
+% macro for a certain page situation, the first guess will always be
+% used for that situation and no warnings will be given if that guess
+% is incorrect. In single-sided mode, this is a no-op (thus you should
+% better place it somewhere where it doesn't affect spacing).
+% Furthermore you must make sure that \TeX\ does not change the value
+% of the \texttt{page} counter between a |\StepPageSituation| and its
+% corresponding |\RecordPageSituation|, since the |\ifodd| test must
+% yield the same result in both cases.
+%
+% \begin{macrocode}
+\if@twoside
+ \def\RecordPageSituation{%
+ \if@filesw
+ \edef\@tempa{%
+ \string\XD@situation{\the\macro@cnt}{%
+ \ifodd\c@page 1\else 0\fi
+ }{\IfOddPageSituation{1}{0}}%
+ }%
+ \write\@auxout\expandafter{\@tempa{\ifodd\c@page 1\else 0\fi}}%
+ \fi
+ }%
+\else
+ \let\RecordPageSituation=\relax
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\XD@situation}
+% \changes{prot2}{2000/07/13}{Changed to allow multiple
+% \cs{XD@situation} commands for the same situation. This is
+% necessary for coping with documents which \cs{include} files. (LH)}
+% \changes{prot2}{2000/07/26}{Made redefinition at begin document
+% global. (LH)}
+% \begin{macro}{\XD@check@situation}
+% |\XD@situation| is the command that will be written to the
+% \texttt{.aux} file with the data about how the situation turned out.
+% Its syntax is
+% \begin{quote}
+% |\XD@situation|\marg{number}\marg{guess}\marg{did}\marg{correct}
+% \end{quote}
+% where \meta{number} is the number of the situation, and
+% \meta{guess}, \meta{did}, and \meta{correct} describe what the
+% guess, the actual action done, and what the correct action to do
+% respectively was. \meta{guess}, \meta{did}, and \meta{correct} are
+% either |0| (denoting even page) or |1| (denoting odd page).
+%
+% The definition for |\XD@situation| set here is the one which will
+% be in force when the \texttt{.aux} file is inputted at |\begin|\B
+% |{document}|; its purpose is to build the |\XD@wrongs@list|.
+% |\XD@check@situation| is the definition for |\XD@situation| which
+% will be in force when the \texttt{.aux} file is inputted at
+% |\end|\B|{document}|; its purpose is to check if anything was
+% incorrectly placed.
+%
+% The main problem |\XD@situation| has to face is that text in the
+% \texttt{.dvi} file needs not appear in exactly the same order as it
+% was typeset, and it is therefore possible that |\XD@situation|s in
+% the \texttt{.aux} file do not appear in increasing \meta{number}
+% order. Because of this, |\XD@situation| must sort the
+% |\XD@wrongs@list| while constructing it. The only reasonable
+% algorithm for this seems to be insertion sort, but as the items to
+% insert are almost surely almost sorted, a special check is done in
+% the beginning to see if that is the case. |\XD@next@wrong| is used
+% in this to store the number of the last item so far inserted into
+% the |\XD@wrongs@list|. By only assigning |\XD@next@wrong| locally
+% here, one is relieved of having to reset it in |\AtBeginDocument|
+% code.
+%
+% When sorting is actually applied, a new item |\@elt|\marg{insert}
+% is inserted through expanding the list. When doing that, the |\@elt|
+% macro has the syntax
+% \begin{quote}
+% |\@elt|\,\meta{flag}\,\marg{number}\,\meta{next}
+% \end{quote}
+% where \meta{flag} is |\BooleanTrue| or |\BooleanFalse|, \meta{number}
+% is the item that the |\@elt| belong to, and \meta{next} is either the
+% next |\@elt| or |\@gobble| (if this is the last). The \meta{flag}
+% specifies whether the item has been inserted; |\Boolean|\B|True| means
+% that it has. The above |\@elt|-sequence will expand to
+% \begin{quote}
+% |\noexpand|\,|\@elt|\,\marg{number}\,\meta{next}\,|\BooleanTrue|
+% \end{quote}
+% if \meta{flag} is |\BooleanTrue|, or \meta{flag} is |\BooleanFalse|
+% and \meta{number} is equal to \meta{insert}. It will expand to
+% \begin{quote}
+% |\noexpand|\,|\@elt|\,\marg{number}\,\meta{next}\,|\BooleanFalse|
+% \end{quote}
+% if \meta{flag} is |\BooleanFalse| and \meta{number} is less than
+% \meta{insert}. It expands to
+% \begin{quote}
+% |\noexpand|\,|\@elt|\,\marg{insert}\,|\noexpand|\,|\@elt|^^A
+% \,\marg{number}\\
+% \meta{next}\,|\BooleanTrue|
+% \end{quote}
+% if \meta{flag} is |\BooleanFalse| and \meta{number} is greater than
+% \meta{insert}.
+%
+% \begin{macrocode}
+\if@twoside
+ \def\XD@situation#1#2#3#4{%
+ \if #2#4\else
+ \ifnum #1<\XD@next@wrong
+ \begingroup
+ \def\@elt##1##2##3{%
+ \noexpand\@elt
+ \ifcase
+ \ifx ##1\BooleanTrue 0%
+ \else\ifnum ##2<#1 1%
+ \else\ifnum ##2>#1 2%
+ \else 0%
+ \fi\fi\fi
+ \space
+ {##2}\expandafter\@secondoftwo
+ \or
+ {##2}\expandafter\@firstoftwo
+ \else
+ {#1}\noexpand\@elt{##2}\expandafter\@secondoftwo
+ \fi{##3\BooleanFalse}{##3\BooleanTrue}%
+ }%
+ \xdef\XD@wrongs@list{%
+ \expandafter\expandafter \expandafter\@elt
+ \expandafter\@firstoftwo \expandafter\BooleanFalse
+ \XD@wrongs@list \@gobble
+ }%
+ \endgroup
+ \else\ifnum #1>\XD@next@wrong
+ \def\XD@next@wrong{#1}%
+ \expandafter\gdef \expandafter\XD@wrongs@list
+ \expandafter{\XD@wrongs@list \@elt{#1}}%
+ \fi\fi
+ \fi
+ }
+ \def\XD@check@situation#1#2#3#4{%
+ \if #3#4\else
+ \PackageWarningNoLine{xdoc2}{Page breaks may have changed.%
+ \MessageBreak Rerun to get marginal material right}%
+ \let\XD@situation\@gobblefour
+ \fi
+ }
+ \AtBeginDocument{\global\let\XD@situation\XD@check@situation}
+\else
+ \let\XD@situation\@gobblefour
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\XD@set@situation}
+% \begin{macro}{\XD@write@situation@ckpt}
+% \begin{macro}{\cl@@ckpt}
+% The page situation counter |\macro@cnt| is closely related to the
+% \texttt{page} counter and it needs to be among the counters whose
+% values are recorded in |\include| checkpoints, since the enumeration
+% of situations will otherwise change when files are added to or
+% removed from the |\@partlist|. It is not sufficient to simply set
+% the value of |\macro@cnt| however; one must also advance to the
+% correct position in the |\XD@wrongs@list| list and set
+% |\XD@next@wrong| accordingly. The |\XD@set@situation| command has
+% the syntax
+% \begin{quote}
+% |\XD@set@situation|\marg{number}
+% \end{quote}
+% It sets |\macro@cnt| to \meta{number} and updates |\XD@wrongs@list|
+% and |\XD@|\B|next@|\B|wrong| accordingly.
+% \begin{macrocode}
+\if@twoside
+ \def\XD@set@situation#1{%
+ \global\macro@cnt=#1\relax
+ \loop \ifnum \XD@next@wrong<\macro@cnt
+ \global\@next\XD@next@wrong\XD@wrongs@list{}{%
+ \let\XD@next@wrong\maxdimen
+ }%
+ \repeat
+ }
+\else \let\XD@set@situation=\@gobble \fi
+% \end{macrocode}
+%
+% The |\XD@write@situation@ckpt| macro writes an |\XD@set@situation|
+% command to the \texttt{.aux} file in the way that |\@wckptelt|
+% writes |\setcounter| commands for normal counters. A problem for
+% |\XD@write@situation@ckpt| is that it will have to appear in a
+% macro which is regularly subjected to the |\xdef| in |\@cons|. For
+% that reason, it will simply expand to itself whenever |\@elt| isn't
+% |\@wckptelt|.
+% \begin{macrocode}
+\if@twoside
+ \def\XD@write@situation@ckpt{%
+ \ifx \@elt\@wckptelt
+ \immediate\write\@partaux{%
+ \string\XD@set@situation{\the\macro@cnt}%
+ }%
+ \else
+ \noexpand\XD@write@situation@ckpt
+ \fi
+ }
+ \expandafter\def \expandafter\cl@@ckpt
+ \expandafter{\cl@@ckpt \XD@write@situation@ckpt}
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \section{The list of changes}
+% \label{Sec:Changes}
+%
+% Reimplementations elsewhere have required a few modifications related
+% to the |\changes| command. There are a lot of other things that could
+% and perhaps should be done with these mechanisms, though.
+%
+% \begin{macro}{\saved@macroname}
+% The contents of the |\saved@macroname| macro now have the syntax
+% \begin{quote}
+% \marg{sort key}\marg{text}
+% \end{quote}
+% i.e., exactly like the argument sequence of |\LevelSorted|. It's not
+% fed to that macro right now, but it is not unlikely that it will in
+% the future. The default definition corresponds to the default
+% definition in \package{doc}.
+% \begin{macrocode}
+\def\saved@macroname{{ }{\generalname}}
+% \end{macrocode}
+% Unlike the case in \package{doc}, the formatting of the text in
+% |\saved@macroname| must be included.
+% \end{macro}
+%
+% \begin{macro}{\if@version@key@}
+% The |@version@key@| switch is used for supporting intelligent
+% sorting of version numbers. It is normally false, but at times
+% where the version number argument of |\changes| is being expanded
+% because it will be used as a sort key then it is true. This is used
+% by the |\uintver| macro. Assignments to this switch are as a rule
+% global, since it is never true for any longer time.
+% \changes{prot2.4}{2002/11/01}{Switch added. (LH)}
+% \begin{macrocode}
+\newif\if@version@key@
+\@version@key@false
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\uintver}
+% The |\uintver| command can be used in the \meta{version} argument
+% of |\changes| to ensure that (unsigned) integers are sorted in
+% mathematical rather than ASCII order by \package{makeindex}. Thus
+% if for example version |1.10| is later than version |1.9| then one
+% should write this as
+% \begin{quote}
+% |\changes{1.\uintver{10}}{|\dots
+% \end{quote}
+% The general syntax is
+% \begin{quote}
+% |\uintver|\marg{number}
+% \end{quote}
+% and this expands completely in \TeX's mouth.
+% \changes{prot2.4}{2002/11/01}{Command added. (LH)}
+%
+% The idea is that 0--9 are compared as 0--9, whereas 10--99 are
+% compared as A10--A99, 100--999 are compared as B100-B999, and so on.
+% The comparisons are correct up to 99999, but it could easily be
+% extended further.
+% \begin{macrocode}
+\newcommand*\uintver[1]{%
+ \if@version@key@
+ \ifnum #1>9
+ \ifnum #1<100
+ A%
+ \else\ifnum #1<\@m
+ B%
+ \else\ifnum #1<\@M
+ C%
+ \else
+ D%
+ \fi\fi\fi
+ \fi
+ \fi
+ \expandafter\@firstofone \expandafter{\number#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\changes@}
+% This |\changes@| is a simple redefinition of the \package{doc}
+% macro with the same name. The main difference is that all
+% formatting of the second entry level has been taken out---it is
+% supposed to be provided in |\saved@macroname|---but in addition to
+% that the date is being used as a third level sort key and |\uintver|
+% may be used in the version number to correct the data.
+% \changes{prot2.4}{2002/11/01}{Added support for \cs{uintver}. (LH)}
+%
+% The former makes more sense for projects where the date is
+% increased faster than the version number and it doesn't change
+% anything relevant in the remaining cases. The latter is necessary
+% if version numbers are assigned for example by CVS.
+% \begin{macrocode}
+\def\changes@#1#2#3{%
+ \global\@version@key@true
+ \protected@edef\@tempa{#1}%
+ \global\@version@key@false
+ \protected@edef\@tempa{%
+ \noexpand\glossary{%
+ \@tempa\actualchar#1\levelchar
+ \expandafter\@firstoftwo\saved@macroname\actualchar
+ \expandafter\@secondoftwo\saved@macroname:\levelchar
+ #2\actualchar#3%
+ }%
+ }%
+ \@tempa
+ \endgroup
+ \@esphack
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@wrglossary}
+% \changes{prot2.2}{2001/02/13}{Redefinition added. (LH)}
+% \begin{macro}{\XD@glossary@keyword}
+% \changes{prot2.2}{2001/02/13}{Macro added. (LH)}
+% The |\@wrglossary| macro is the one which actually writes entries
+% to the \texttt{.glo} file. It is redefined by \package{xdoc} to put
+% the contents of |\XD@glossary@keyword|, rather than a hardwired
+% |\glossaryentry|, in front of the glossary entry.
+% |\XD@glossary@keyword| is redefined by the \package{docindex}
+% package~\cite{docindex}.
+% \begin{macrocode}
+\def\@wrglossary#1{%
+ \protected@write\@glossaryfile{}%
+ {\XD@glossary@keyword{#1}{\thepage}}%
+ \endgroup
+ \@esphack
+}
+\@ifundefined{XD@glossary@keyword}{%
+ \edef\XD@glossary@keyword{\@backslashchar glossaryentry}%
+}{}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\definechange}
+% \begin{macro}{\XD@definechange}
+% The |\definechange| command has the syntax
+% \begin{quote}
+% |\definechange|\marg{name}\marg{version}\marg{date}\marg{text}
+% \end{quote}
+% The three last arguments are precisely like the arguments of
+% |\changes|, but |\definechange| doesn't write the change to the
+% \texttt{.glo} file; instead it stores them away as the ``named
+% change'' \meta{name}, for later use in the |\usechange| command.
+% \begin{macrocode}
+\newcommand\definechange{%
+ \begingroup\@sanitize
+ \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore
+ \expandafter\endgroup \XD@definechange
+}
+\def\XD@definechange#1#2#3#4{\@namedef{XD@ch-#1}{{#2}{#3}{#4}}}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% The named changes are stored in the
+% \describecsfamily{XD@ch-\meta{name}}|\XD@ch-|\meta{name} family of
+% control sequences. These are parameterless macros with replacement
+% texts of the form
+% \begin{quote}
+% \marg{version}\marg{date}\marg{text}
+% \end{quote}
+%
+% \begin{macro}{\usechange}
+% \begin{macro}{\XD@usechange}
+% \changes{prot2.4}{2002/11/01}{Added support for \cs{uintver}. (LH)}
+% To use a named change defined earlier, one of course uses the
+% command |\usechange|, which has the syntax
+% \begin{quote}
+% |\usechange|\marg{name}
+% \end{quote}
+% The effect of this is similar to that of a general |\changes|
+% (i.e., it appears outside all \texttt{macro}-like environments) with
+% the arguments specified in the |\definechange|, but this also
+% includes the macro (or whatever) name with the page number, using
+% the encapsulation mechanism in \package{makeindex}.
+% \begin{macrocode}
+\newcommand*\usechange[1]{%
+ \@ifundefined{XD@ch-#1}{%
+ \PackageError{xdoc2}{Named change `#1' undefined}\@eha
+ }{%
+ \expandafter\expandafter \expandafter\XD@usechange
+ \csname XD@ch-#1\endcsname
+ }%
+}
+\def\XD@usechange#1#2#3{%
+ \def\@tempa{{ }{\generalname}}%
+ \ifx \@tempa\saved@macroname
+ \let\@tempa\@empty
+ \else
+ \protected@edef\@tempa{%
+ \encapchar labelednumber%
+ {\expandafter\@secondoftwo\saved@macroname}%
+ }
+ \fi
+ \global\@version@key@true
+ \protected@edef\@tempb{#1}%
+ \global\@version@key@false
+ \glossary{%
+ \@tempb\actualchar #1\levelchar
+ \space\actualchar\generalname:\levelchar
+ #2\actualchar#3\@tempa
+ }%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\labelednumber}
+% The |\labelednumber| macro belongs to the same category as the
+% |\main| and |\usage| macros, but it takes an extra argument. The
+% syntax is
+% \begin{quote}
+% |\labelednumber|\marg{extra}\marg{number}
+% \end{quote}
+% which typesets as
+% \begin{quote}
+% \meta{number} (\meta{extra})
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\labelednumber[2]{#2\nolinebreak[2] (#1)}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{\texttt{macro}-like environments}
+% \label{Sec:Macro-environments}
+%
+% There are several reasons one might want to improve the \texttt{macro}
+% and \texttt{environment} environments.
+% \begin{itemize}
+% \item
+% The code in them cannot be reused if you want to define other
+% things than \TeX\ macros or \LaTeX\ environments. (During the
+% last year or so, I have defined \texttt{macro}-like environments
+% for over a dozen different things.)
+% \item
+% They always put the macro\slash environment name to the left of
+% the current column. This is inappropriate for two-sided printing,
+% as there should be a symmetry over an entire spread in that case.
+% \item
+% The vertical extent of a macro\slash environment name must not
+% exceed that of the |\strut|, since they will otherwise overprint
+% each other when stacked. In particular this makes it impossible to
+% make line breaks in macro names---something which would otherwise
+% be of interest in projects (such as for example \cite{fontinst})
+% where some names are very long and obvious breakpoints are
+% available.
+% \end{itemize}
+% (I'm quite sure there are more things that have annoyed me, but I can't
+% remember which they are right now.) The redefinitions below take care
+% of the all these problems.
+%
+%
+% \subsection{Grabbing arguments}
+%
+% A special feature of the \texttt{macro}-like environments is that (at
+% least some) of their arguments must be given rather special treatment.
+% This special treatment usually consists of making temporary |\catcode|
+% changes for the time these arguments are tokenized---since the standard
+% |\catcode|s for some important characters tend to be unsatisfactory in
+% these cases---but there are other possibilities as well. For that
+% reason, the \package{xdoc} package employs a mechanism that is very
+% similar to that used in the Mittelbach--Rowley--Carlisle
+% \package{xparse} package~\cite{xparse}, although it does not share
+% any code with that. I call this mechanism the argument grabber.
+%
+% The heart of the argument grabber is the macro |\XD@grab@arguments|,
+% which has the following syntax:
+% \begin{quote}
+% |\XD@grab@arguments|\marg{call}\marg{grabber sequence}^^A
+% \meta{arguments to grab}
+% \end{quote}
+% \meta{call} is something which will eventually be placed in front of
+% all the arguments grabbed. It can simply be a single macro, but it
+% can also contain some arguments for that macro. \meta{grabber sequence}
+% is a sequence of grabbers. A \emph{grabber} is typically a macro which
+% grabs the next argument and stores it in a token list together with the
+% arguments that were grabbed before. A grabber could however be some
+% more complex piece of code that performs a similar action.
+%
+% \begin{table}
+% \begin{minipage}{\columnwidth}
+% \begin{center}\small
+% \begin{tabular}{lll>{\raggedright}p{0.3\linewidth}}
+% \textbf{Grabber}& \textbf{Arg.\ type}&
+% \textbf{Catcodes\footnote[1]{Catcode settings key:
+% --- = no change, PL = changes made by \cs{MakePrivateLetters},
+% OB = set the catcode of backslash to ordinary.}}&
+% \textbf{Post-processing}\tabularnewline
+% |\XD@grab@marg|& Mandatory& ---& None\tabularnewline
+% |\XD@grab@oarg|& Optional& ---& None\tabularnewline
+% |\XD@grab@sarg|\marg{char}& 1-char optional&
+% ---& Returns |\BooleanTrue| if the character was present
+% and |\BooleanFalse| otherwise.\tabularnewline
+% |\XD@grab@withprivate|& Mandatory& PL& None\tabularnewline
+% |\XD@grab@asmacro|\footnote[2]{This grabber is probably obsolete;
+% it is included because it grabs the argument in precisely the
+% way that the \texttt{macro} environment of \package{doc} does.}&
+% Mandatory& OB+PL& None\tabularnewline
+% |\XD@grab@harmless|\meta{proc}& Mandatory& ---&
+% |\MakeHarmless| followed by \meta{proc}\tabularnewline
+% |\XD@grab@harmless@oarg|& Optional& ---&
+% |\MakeHarmless|\tabularnewline
+% \multicolumn{3}{l}{\cs{XD@grab@harmless@asmacro}}\tabularnewline
+% & Mandatory& OB+PL&
+% |\MakeHarmless| followed by |\XD@unbackslash|\tabularnewline
+% |\XD@grab@harmless@cs|& Mandatory\footnote[3]{The argument is
+% normally precisely one control sequence.}& PL&
+% |\string| whilst |\escapechar| is set to \textminus1,
+% followed by |\MakeHarmless|\tabularnewline
+% \multicolumn{3}{l}{^^A
+% \cs{XD@grab@harmless@withprivate}\marg{proc}}\\
+% & Mandatory& PL& |\MakeHarmless| followed by \meta{proc}
+% \end{tabular}
+% \end{center}
+% \end{minipage}
+%
+% \caption{Grabbers currently defined by \package{xdoc}}
+% \label{Tab:Grabbers}
+% \end{table}
+%
+% When arguments are being grabbed, the \meta{call} is stored in |\toks@|
+% and the arguments are appended to |\toks@| as they are grabbed. For
+% that reason, a grabber may not itself call |\XD@grab@arguments|, nor
+% may it use a command defined through \package{xparse}'s
+% |\Declare|\-|Document|\-|Command| or anything else which uses this
+% token register in a bad way.
+%
+% When a grabber is expanded, it is in the context
+% \begin{quote}
+% \meta{grabber}\,\meta{following grabbers}\,|\XD@endgrab|\penalty0
+% \thinspace\meta{ungrabbed arguments}
+% \end{quote}
+% After it has grabbed its argument, everything of the above should be
+% put back except for the \meta{grabber} and the argument it grabbed.
+% The argument itself should be wrapped in a group and appended to
+% |\toks@|.
+%
+% \textbf{Note:} In prototype~2 the format in which the argument grabber
+% returns the grabbed arguments was changed so that it can now be
+% unified with argument grabbing mechanisms of \package{xparse}. I
+% think this should be done some time in the future, but for the moment
+% it seems best not to rely on \LaTeXplus\ packages like \package{xparse}.
+%
+% \begin{macro}{\XD@grab@arguments}
+% \begin{macro}{\XD@endgrab}
+% \changes{prot2}{2000/07/13}{The grabbed arguments are no longer
+% returned wrapped up in a group. There is no longer a need for
+% storing the base call separately in \cs{toks}\,\texttt{2}. (LH)}
+% The |\XD@grab@arguments| and |\XD@endgrab| macros set up and finish
+% off argument grabbing.
+% \begin{macrocode}
+\def\XD@grab@arguments#1#2{%
+ \toks@={#1}%
+ #2\XD@endgrab
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\XD@endgrab{\the\toks@}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\XD@grab@marg}
+% A grabber for ordinary arguments, like the \texttt{m} arguments of
+% \package{xparse}.
+% \begin{macrocode}
+\long\def\XD@grab@marg#1\XD@endgrab#2{%
+ \addto@hook\toks@{{#2}}%
+ #1\XD@endgrab
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XD@grab@oarg}
+% \begin{macro}{\XD@grab@oarg@}
+% A grabber for optional arguments (\texttt{o} arguments in
+% \package{xparse}). It looks ahead for an optional argument and
+% grabs that argument if there was one. If it doesn't find anything
+% which looks like an optional argument (i.e., if the next character
+% isn't a |[|), then the grabber will not grab anything (although it
+% may have tokenized the next argument), but it will still append
+% |\NoValue| to |\toks@|.
+%
+% \begin{macrocode}
+\def\XD@grab@oarg#1\XD@endgrab{%
+ \@ifnextchar[{\XD@grab@oarg@{#1}}{%
+ \addto@hook\toks@\NoValue
+ #1\XD@endgrab
+ }%
+}
+% \end{macrocode}
+% |\XD@grab@oarg@| is a helper to remove the brackets around the
+% optional argument.
+% \begin{macrocode}
+\long\def\XD@grab@oarg@#1[#2]{%
+ \addto@hook\toks@{{#2}}%
+ #1\XD@endgrab
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\XD@grab@sarg}
+% A grabber for `star'-type arguments (\texttt{s} arguments in
+% \package{xparse}). The syntax is
+% \begin{quote}
+% |\XD@grab@sarg|\marg{char}
+% \end{quote}
+% It looks ahead to see if the next character is the \meta{char}. In
+% that case it gobbles it and adds a |\BooleanTrue| to the grabbed
+% arguments, otherwise it adds a |\BooleanFalse| to the grabbed
+% arguments.
+% \changes{prot2.3}{2001/11/03}{Macro added. (LH)}
+% \begin{macrocode}
+\def\XD@grab@sarg#1#2\XD@endgrab{%
+ \@ifnextchar#1{%
+ \addto@hook\toks@\BooleanTrue
+ \@firstoftwo{#2\XD@endgrab}%
+ }{%
+ \addto@hook\toks@\BooleanFalse
+ #2\XD@endgrab
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XD@grab@withprivate}
+% |\XD@grab@withprivate| is like |\XD@grab@marg| but grabs the
+% argument when the catcodes are as set by |\MakePrivateLetters|.
+% \begin{macrocode}
+\def\XD@grab@withprivate{%
+ \begingroup\MakePrivateLetters\relax\expandafter\endgroup
+ \XD@grab@marg
+}
+% \end{macrocode}
+% To think about: Perhaps things like |\XD@grab@withprivate| should
+% rather be considered a modifier for a grabber? Instead of having
+% |\XD@grab@withprivate| be the entire grabber, one could let the
+% grabber be something like
+% \begin{quote}
+% |\XD@grab@withprivate\XD@grab@marg|
+% \end{quote}
+% where the |\XD@grab@withprivate| should only expand to
+% \begin{quote}
+% |\begingroup\MakePrivateLetters\relax\expandafter\endgroup|
+% \end{quote}
+% \end{macro}
+%
+% \begin{macro}{\XD@grab@asmacro}
+% |\XD@grab@asmacro| is very similar to |\XD@grab@withprivate|, but it
+% sees to that the catcode settings are exactly those used by
+% \package{doc}'s \texttt{macro} environment.
+% \begin{macrocode}
+\def\XD@grab@asmacro{%
+ \begingroup
+ \catcode`\\=12 \MakePrivateLetters\relax
+ \expandafter\endgroup
+ \XD@grab@marg
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XD@grab@harmless}
+% \begin{macro}{\XD@grab@harmless@oarg}
+% \changes{prot2.1}{2000/09/30}{Macro added. (LH)}
+% \begin{macro}{\XD@grab@harmless@oarg@}
+% \changes{prot2.1}{2000/09/30}{Macro added. (LH)}
+% The |\XD@grab@harmless| grabber grabs one mandatory argument and
+% converts it to a harmless character string, which it contributes to
+% the list of arguments. The syntax is
+% \begin{quote}
+% |\XD@grab@harmless|\marg{post-processing}
+% \end{quote}
+% where \meta{post-processing} are commands that will be performed
+% after the grabbed argument has been made harmless, but before it is
+% contributed to the list of arguments. Thus the
+% \meta{post-processing} can modify the argument some more, but
+% \meta{post-processing} can just as well be empty.
+% \begin{macrocode}
+\def\XD@grab@harmless#1#2\XD@endgrab#3{%
+ \MakeHarmless\@tempa{#3}%
+ #1%
+ \toks@=\expandafter{\the\expandafter\toks@ \expandafter{\@tempa}}%
+ #2\XD@endgrab
+}
+% \end{macrocode}
+%
+% The |\XD@grab@harmless@oarg| grabber grabs one optional argument and
+% converts it to a harmless character string. This string is
+% contributed to the list of arguments if the optional argument, or
+% else the token |\NoValue| is contributed instead.
+% \begin{macrocode}
+\def\XD@grab@harmless@oarg#1\XD@endgrab{%
+ \@ifnextchar[{\XD@grab@harmless@oarg@{#1}}{%
+ \addto@hook\toks@\NoValue
+ #1\XD@endgrab
+ }%
+}
+% \end{macrocode}
+% |\XD@grab@harmless@oarg@| is a helper to remove the brackets around
+% the optional argument.
+% \begin{macrocode}
+\long\def\XD@grab@harmless@oarg@#1[#2]{%
+ \MakeHarmless\@tempa{#2}%
+ \toks@=\expandafter{\the\expandafter\toks@ \expandafter{\@tempa}}%
+ #1\XD@endgrab
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@grab@harmless@asmacro}
+% \begin{macro}{\XD@grab@harmless@cs}
+% \begin{macro}{\XD@grab@harmless@cs@}
+% The |\XD@grab@harmless@asmacro| grabber combines the features of
+% |\XD@grab@|\B|asmacro| and |\XD@grab@harmless|, since when the
+% argument to grab is tokenized the catcode of |\| is set to 12 and
+% the catcode assignments in |\MakePrivateLetters| are made. Then the
+% grabbed argument is converted to a harmless character sequence, and
+% finally the first character is removed if it is a backslash.
+% \begin{macrocode}
+\def\XD@grab@harmless@asmacro{%
+ \begingroup
+ \catcode`\\=12 \MakePrivateLetters\relax
+ \expandafter\endgroup
+ \XD@grab@harmless{%
+ \protected@edef\@tempa{%
+ \expandafter\XD@unbackslash\@tempa\@empty
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% The |\XD@grab@harmless@cs| grabber is for use with commands like
+% \package{doc}'s |\Describe|\-|Macro|, which take an actual control
+% sequence as the argument. It grabs one argument while having
+% catcodes changed as indicated by |\Make|\-|Private|\-|Letters|,
+% |\string|s the argument while |\escapechar| is |-1| (so that there
+% is no escape character inserted), and continues as
+% |\XD@grab@harmless|.
+% \begin{macrocode}
+\def\XD@grab@harmless@cs{%
+ \begingroup
+ \MakePrivateLetters\relax
+ \expandafter\endgroup \XD@grab@harmless@cs@
+}
+% \end{macrocode}
+% \begin{macrocode}
+\long\def\XD@grab@harmless@cs@#1\XD@endgrab#2{%
+ \begingroup
+ \escapechar=\m@ne
+ \expandafter\endgroup
+ \expandafter\MakeHarmless \expandafter\@tempa
+ \expandafter{\string#2}%
+ \toks@=\expandafter{\the\expandafter\toks@ \expandafter{\@tempa}}%
+ #1\XD@endgrab
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\XD@grab@harmless@withprivate}
+% |\XD@grab@harmless@withprivate| is like |\XD@grab@harmless| but
+% grabs the argument when the catcodes are as set by
+% |\Make|\-|Private|\-|Letters|.
+% Like |\XD@|\B|grab@|\B|harmless|, |\XD@grab@|\B|harmless@|\B
+% |withprivate| takes an argument which can contain code that
+% modifies the harmless character string after it has been formed.
+% \begin{macrocode}
+\def\XD@grab@harmless@withprivate{%
+ \begingroup\MakePrivateLetters\relax\expandafter\endgroup
+ \XD@grab@harmless
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The \cs{XD@m@cro} and \cs{NewMacroEnvironment} commands}
+%
+% In \package{doc} the macro that contains most of the code for the
+% \texttt{macro} and \texttt{environment} environments is called
+% |\m@cro@|. In \package{xdoc} the corresponding macro is |\XD@m@cro|.
+%
+% At this point, it is helpful to recall what |\m@cro@| actually does.
+% It can be summarized in the following four points:
+% \begin{itemize}
+% \item It starts a |\trivlist|.\footnote{Seriously, can someone
+% explain to me why it seems just about every non-math \LaTeX\
+% environment that doesn't start a \cs{list} starts a \cs{trivlist}?
+% What good does all these \cs{trivlist}s do? Is it (a)~that people
+% just like the basic design, (b)~that there's some deep technical
+% reason, or (c)~that people in general doesn't have a clue but all
+% other environments do that so it's best to include it just in
+% case?}
+% \item It prints the name of the macro\slash environment that is
+% about to be defined in the margin.
+% \item It writes an index entry (and inhibits cross-referencing of
+% the macro inside the environment).
+% \item It sets |\saved@macroname| to the name of the macro\slash
+% environment (for use by |\changes|).
+% \end{itemize}
+%
+% The first and fourth points are simple, and commands for the third
+% were defined in Section~\ref{Sec:Indexing}, but the second point
+% needs a few helper macros.
+%
+%
+% \begin{macro}{\XDStackItemLabels}
+% \changes{prot2}{2000/07/28}{Made it work like a \cs{vtop} (but hide
+% the height) if \cs{XD@macro@dimen} is \texttt{-}\cs{maxdimen}.
+% (LH)}
+% \begin{macro}{\XD@macro@dimen}
+% The |\XDStackItemLabels| macro is a definition of |\makelabel| which
+% is used in the \texttt{macro}-like environments for stacking the
+% names printed by subsequent environments under each other. It makes
+% a box which has zero height and depth (it should have zero width as
+% well, but that is left as a restriction on the argument) and the
+% printed names will be stacked if the reference points of the
+% subsequent boxes generated by |\XD|\-|Stack|\-|Item|\-|Labels|
+% coincide.
+%
+% |\XD@macro@dimen| (always assigned globally) stores the vertical
+% distance from the reference point of the box that
+% |\XD|\-|Stack|\-|Item|\-|Labels| makes to the (bottommost) baseline
+% of the previous printed name. |\XD@macro@dimen| is updated by each
+% new |\XD|\-|Stack|\-|Item|\-|Labels|. The baseline of the next printed
+% name will be put one |\baselineskip| lower than that of the previous
+% printed name, except for when |\XD@macro@dimen| is |-\maxdimen| (see
+% below). To avoid that printed names clash into each other, this
+% additional |\baselineskip| is generated as normal interline glue
+% where the upper box has the same depth as a strut and the new value
+% of |\XD@macro@dimen| is measured in such a way that the printed
+% name's depth below the nominal baseline will not exceed the depth of
+% a strut (that's what the |\boxmaxdepth| assignment is for).
+% When |\XD@macro@dimen| is |-\maxdimen| the (topmost) baseline of the
+% printed name will instead go through the reference point of the box.
+% This case is intended for the first item label in a stack.
+%
+% The reason |\everypar| is cleared is that that is where the list
+% environments put the commands which actually insert the item label
+% into the paragraph. If that code gets executed inside |\makelabel|,
+% the list environments get seriously confused with not at all nice
+% consequences.
+% \begin{macrocode}
+\def\XDStackItemLabels#1{%
+ \setbox\z@=\vbox{%
+ \ifdim \XD@macro@dimen=-\maxdimen
+ \setbox\z@=\vtop{%
+ \color@begingroup
+ \everypar={}%
+ #1%
+ \color@endgroup
+ }%
+ \kern-\ht\z@
+ \unvbox\z@
+ \else
+ \color@begingroup
+ \everypar={}%
+ \kern\XD@macro@dimen
+ \setbox\z@=\copy\strutbox \ht\z@=\z@ \box\z@
+ #1%
+ \color@endgroup
+ \fi
+ \boxmaxdepth=\dp\strutbox
+ }%
+ \global\XD@macro@dimen=\ht\z@
+ \vtop to\z@{\unvbox\z@ \vss}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newdimen\XD@macro@dimen
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\XDToMargin}
+% \changes{prot2.1}{2000/11/26}{New name for \cs{XD@to@margin}. (LH)}
+% The |\XDToMargin| macro takes one argument, which is assumed to be
+% some horizontal material, and puts that material in a |\hbox| of
+% width zero, horizontally shifted out into the the outer margin, in
+% such a way that longer arguments extend further out. |\marginparsep|
+% is used as the distance between the argument and the main galley. All
+% these placements assume that the |\hbox| will be put |\labelsep| to
+% the left of the beginning of a nonindented paragraph, since that is
+% where it will be put by the |\item| of a |\trivlist|.
+%
+% A question is where the margin should be considered to start if the
+% |\@total|\-|left|\-|margin| isn't zero. The corresponding
+% \package{doc} action would be to consider the margin as everything
+% outside the |\linewidth| width, but I don't think that would be
+% appropriate here (especially not since \package{doc} always puts the
+% codeline numbers at the edge of the |\textwidth| width).
+% \begin{macrocode}
+\newcommand\XDToMargin[1]{%
+ \hb@xt@\z@{%
+ \IfOddPageSituation{%
+ \dimen@=-\@totalleftmargin
+ \advance \dimen@ \labelsep
+ \advance \dimen@ \textwidth
+ \advance \dimen@ \marginparsep
+ \kern\dimen@
+ }\hss
+ #1%
+ \IfOddPageSituation\hss{%
+ \dimen@=\@totalleftmargin
+ \advance \dimen@ -\labelsep
+ \advance \dimen@ \marginparsep
+ \kern\dimen@
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XDParToMargin}
+% The |\XDParToMargin| command is in syntax and use similar to the
+% |\XDToMargin| command, but it will try to linebreak an argument
+% that is too long rather than letting it extend outside the paper.
+%
+% The implementation first tries to break the argument without
+% considering justification or positioning, but with a rather high
+% |\linepenalty|. If the result of that try is a single line paragraph
+% then |\XDToMargin| will be called to actually typeset the argument.
+% Otherwise the argument is typeset as a paragraph which gets
+% displaced out into the outer margin by giving |\leftskip| and
+% |\rightskip| nonzero natural widths. The practical line width in
+% the paragraph is the |\marginparwidth|, but the hboxes containing
+% the individual lines will have width zero. The first line of the
+% paragraph will be set flush outwards, the last line of the paragraph
+% will be set flush inwards, and the remaining lines will be centered.
+%
+% \changes{prot2.1}{2000/11/26}{Command added. (LH)}
+% \begin{macrocode}
+\newcommand\XDParToMargin[1]{%
+ \parindent=\z@
+ \setbox\z@=\vbox{%
+ \leftskip=\z@skip
+ \rightskip=\z@\@plus 1fil%
+ \parfillskip=\z@skip
+ \hsize=\marginparwidth
+ \linepenalty=1000%
+ \color@begingroup
+ \noindent\ignorespaces #1\@@par
+ \color@endgroup
+ \expandafter}%
+ \expandafter\ifnum \the\prevgraf<\tw@
+ \XDToMargin{#1}%
+ \else
+ \hsize=\z@
+ \leftskip=\z@ \@plus \marginparwidth
+ \rightskip=\leftskip
+ \IfOddPageSituation{%
+ \dimen@=-\@totalleftmargin
+ \advance \dimen@ \labelsep
+ \advance \dimen@ \textwidth
+ \advance \dimen@ \marginparsep
+ \advance \leftskip \dimen@
+ \advance \rightskip -\dimen@ \@minus \p@
+ \advance \rightskip -\marginparwidth
+ \parfillskip=\z@ \@plus 1fil%
+ }{%
+ \dimen@=\@totalleftmargin
+ \advance \dimen@ -\labelsep
+ \advance \dimen@ \marginparsep
+ \advance \leftskip -\dimen@ \@minus \p@
+ \advance \leftskip -\marginparwidth
+ \advance \rightskip \dimen@
+ \parfillskip=\z@ \@plus -\marginparwidth%
+ }
+ \noindent\nobreak\hskip\parfillskip
+ \ignorespaces #1\@@par
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% In the following I exploit the implementation of the |\item| command
+% in a slightly hackish way. Instead of starting a new paragraph with
+% the item label (which is what one at first would believe |\item|
+% does), |\item| actually puts the label in the box |\@labels| register,
+% and stores code in |\everypar| that inserts that box into the new
+% paragraph. Therefore I can make sure that various |\write| whatsits
+% that need to be as the same page as an |\item| label will be there by
+% adding them to the contents of the |\@labels| box. This seems more
+% reliable to me than putting them on the vertical list followed by a
+% |\nobreak| as \package{doc} does, but that would probably work as
+% well.
+%
+% [A funny thing in that which confused me a while was the question of
+% whether the |\box| command that inserts the box into the paragraph and
+% simultaneously clears the register acted globally or locally. It turns
+% out that the question was ill-posed, as the distinction between local
+% and global assignments is determined by what restore items they put
+% on \TeX's save stack. The |\box| command doesn't put anything there,
+% so the assignment it makes will essentially appear at the same
+% grouping level as the |\setbox| command that set the contents of the
+% box register. As all |\setbox|es for the |\@labels| box register are
+% global, the box register will be globally void after |\box\@labels|.]
+%
+%
+% \begin{macro}{\XD@m@cro}
+% \changes{prot2}{2000/07/24}{Put the \meta{changes} argument before
+% the \meta{assign} argument. Executing the \meta{assign} code
+% after the \meta{changes} \cs{edef}. Changed the descriptions of
+% these arguments a little. (LH)}
+% \changes{prot2.1}{2000/11/26}{Removed \cs{XDToMargin} from the
+% argument of \cs{item}. It should now be included in \#1
+% instead. (LH)}
+% This is the workhorse of all the \texttt{macro}-like environments.
+% It calls |\trivlist| and sets related parameters, prints the
+% ``macro'' name in the proper place, updates the representation of
+% the ``macro'' name that |\changes| will use, and writes appropriate
+% index entries (possibly making temporary changes in
+% cross-referencing). Exactly what these tasks consist of can vary
+% quite a lot between different \texttt{macro}-like environments, and
+% therefore the |\XD@m@cro| macro has the following syntax:
+% \begin{quote}
+% |\XD@m@cro|\marg{print}\marg{index}\marg{changes}\marg{assign}
+% \end{quote}
+% \meta{print}, \meta{index}, and \meta{assign} are simply the
+% commands for printing the ``macro'' name as it should appear in the
+% margin, generating the index entries for this \texttt{macro}-like
+% environment, and making whatever additional local assignments that
+% are needed for this environment (usually a couple of
+% |\Do|\-|Not|\-|Index|\-|Harmless| commands, if anything at all)
+% respectively. At the time \meta{index} is executed,
+% \texttt{codelineno} holds the number of the \emph{next} codeline.
+% \meta{changes}, finally, is code that will be put in the context
+% \begin{quote}
+% |\protected@edef\saved@macroname{|\meta{changes}|}|
+% \end{quote}
+% to set the |\saved@macroname| macro (for |\changes|).
+% \begin{macrocode}
+\def\XD@m@cro#1#2#3#4{%
+ \topsep\MacroTopsep
+ \trivlist
+ \global\setbox\@labels=\hbox{%
+ \unhbox\@labels
+ \if@inlabel \else
+ \global\XD@macro@dimen=-\maxdimen
+ \StepPageSituation
+ \RecordPageSituation
+ \fi
+ \advance \c@codelineno \@ne
+ #2%
+ }%
+ \let\makelabel\XDStackItemLabels
+ \item[#1]%
+ \protected@edef\saved@macroname{#3}%
+ #4%
+ \ignorespaces
+}
+% \end{macrocode}
+% \end{macro}
+%
+% In the first \package{xdoc} prototype, the \texttt{macro}-like
+% environments were implemented so that each new environment only used
+% two control sequences (|\|\meta{env} and |\end|\meta{env}), which is
+% the absolute minimum. This implementation worked fine for
+% single argument environments, but the number of helper macros that
+% would have to be introduced to deal with multiple argument
+% environments exceeded what could be considered reasonable. Therefore
+% the second prototype claims a third control sequence for the
+% implementation of a \texttt{macro}-like environment \meta{env}, namely
+% |\\|\meta{env}, which is also used by normal \LaTeXe\ environments
+% which take an optional argument.
+%
+% It should also be mentioned that the implementation in the first
+% prototype required that most of the code in |\|\meta{env} had to be
+% written in a very special way. Instead of using the |#|\meta{digit}
+% notation for the arguments and write straightforward \LaTeX\ code, one
+% had to express everything using macros which operate on arguments ``up
+% ahead'' (immediately after the code you can specify). This curious
+% coding model made it out of the question to create a class designer
+% interface for defining new \texttt{macro}-like environments, but in
+% the second \package{xdoc} prototype it is quite simple to do something
+% of that sort: the command name is |\New|\-|Macro|\-|Environment|.
+%
+% \begin{macro}{\NewMacroEnvironment}
+% \changes{prot2}{2000/07/13}{Command added. (LH)}
+% \changes{prot2}{2000/07/24}{Changed syntax in conformity with the
+% syntax change in \cs{XD@m@cro}. (LH)}
+% \changes{prot2.1}{2000/11/26}{Introduced star form with different
+% semanics for the \meta{print} argument. This uses the helper
+% macros \cs{XD@NewMacroEnvironment} and
+% \cs{XD@NewMacroEnvironment@}. (LH)}
+% \begin{macro}{\XD@NewMacroEnvironment}
+% \begin{macro}{\XD@NewMacroEnvironment@}
+% The |\NewMacroEnvironment| command is used for defining new
+% \texttt{macro}-like environments. It has the syntaxes
+% \begin{quote}
+% |\NewMacroEnvironment|\marg{name}\marg{grabbers}\marg{numargs}\\
+% \vadjust{}\hfill\marg{unjust-print}\marg{index}\marg{changes}^^A
+% \marg{assign}\\
+% |\NewMacroEnvironment*|\marg{name}\marg{grabbers}\marg{numargs}\\
+% \vadjust{}\hfill\marg{print}\marg{index}\marg{changes}\marg{assign}
+% \end{quote}
+% where \meta{name} is the name of the environment to define,
+% \meta{grabbers} is a sequence of argument grabbers, \meta{numargs}
+% is the number of arguments that the grabbers will grab, and
+% \meta{print}, \meta{index}, \meta{changes}, and \meta{assign} are
+% code that will be put in the respective arguments of |\XD@m@cro|.
+% In the four last arguments, argument specifiers |#1| to
+% |#|\meta{numargs} inclusive can be used do mean the arguments that
+% were grabbed by the sequence of grabbers.
+%
+% The argument grabbers that are currently made available by the
+% \package{xdoc} package are listed in Table~\ref{Tab:Grabbers} on
+% page~\pageref{Tab:Grabbers}.
+%
+% The \meta{print} code will be executed while \TeX\ is in internal
+% vertical mode and it should put one or several hboxes of width zero
+% onto the vertical list. The contents of these boxes should be some
+% amount of text which will appear displaced out into the outer margin
+% on the page when the reference point of the box appears |\labelsep|
+% to the left of the left edge of the line. The easiest way of
+% achieveing this is to use a \meta{print} of the form
+% \begin{quote}
+% |\XDToMargin|\marg{unjust-print}
+% \end{quote}
+% and this is exactly what the non-star form of |\NewMacroEnvironment|
+% does by default.
+%
+% \begin{macrocode}
+\newcommand\NewMacroEnvironment{%
+ \@ifstar\XD@NewMacroEnvironment\XD@NewMacroEnvironment@
+}
+\def\XD@NewMacroEnvironment@#1#2#3#4{%
+ \XD@NewMacroEnvironment{#1}{#2}{#3}{\XDToMargin{#4}}%
+}
+\def\XD@NewMacroEnvironment#1#2#3#4#5#6#7{%
+ \expandafter\@ifdefinable\csname#1\endcsname{%
+ \expandafter\def \csname#1\expandafter\endcsname
+ \expandafter{\expandafter\XD@grab@arguments
+ \csname\@backslashchar#1\endcsname{#2}}%
+ \let\l@ngrel@x\relax
+ \expandafter\@yargdef \csname\@backslashchar#1\endcsname \@ne
+ {#3}{\XD@m@cro{#4}{#5}{#6}{#7}}%
+ \expandafter\let \csname end#1\endcsname \endtrivlist
+ }%
+}
+% \end{macrocode}
+% The \meta{grabbers} argument---in which one specifies a list of
+% internal macros---is not how the interface should really look, but I
+% think it will have to do for now. The final interface will probably
+% use something like the argument specifications of
+% |\Declare|\-|Document|\-|Command|, but there is little point in
+% implementing that before \package{xparse} has gotten its final form.
+% \end{macro}\end{macro}\end{macro}
+%
+% The macro |\@yargdef| used above should perhaps be checked so that its
+% syntax hasn't changed, but since |\@yargdef| quite recently
+% (\texttt{ltdefn.dtx} v\,1.3c, 1999/01/18) was completely reimplemented
+% without any change in the syntax (despite the fact that the syntax is
+% afterwards rather peculiar), I think it can be assumed that the syntax
+% will not change in \LaTeXe.
+%
+%
+%
+% \subsection{Reimplementing \texttt{macro} and \texttt{environment}}
+% \label{Ssec:Macro&environment}
+%
+% Well, then how does one reimplement the \texttt{macro} and
+% \texttt{environment} environments using |\XD@m@cro|? We shall soon
+% see, but first it is convenient to define a utility macro.
+%
+% \changes{prot2}{2000/07/14}{Lots of utility macros were removed:
+% \cs{XDWrapText}, \cs{XDAltWrapText}, \cs{XDSortAndText},
+% \cs{MultipleApply}, \cs{ApplicableUsageIndex}, and
+% \cs{XD@index@family}. (LH)}
+%
+% \begin{macro}{\XDMainIndex}
+% \changes{prot2}{2000/07/14}{New name and syntax for
+% \cs{ApplicableMainIndex}. (LH)}
+% The |\XDMainIndex| macro is an abbreviation to save a couple of
+% tokens in a very frequent call to |\IndexEntry|. It has the syntax
+% \begin{quote}
+% |\XDMainIndex|\marg{argument}
+% \end{quote}
+% and that expands to
+% \begin{quote}
+% |\IndexEntry|\marg{argument}|{main}{\TheXDIndexNumber}|
+% \end{quote}
+% \begin{macrocode}
+\newcommand\XDMainIndex[1]{\IndexEntry{#1}{main}{\TheXDIndexNumber}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{macro}
+% \changes{prot2.1}{2000/11/15}{Using \cs{MakeSortKey} to make index
+% entry. (LH)}
+% \begin{environment}{environment}
+% It is very easy to implement \texttt{macro} and \texttt{environment}
+% environments which behave pretty much as in \package{doc} using the
+% |\New|\-|Macro|\-|Environment| command. The important difference
+% is that in \package{doc} everything that distinguished the two
+% environments was to be found in various helper macros, but here all
+% that code is in the |\\macro| and |\\environment| macros. Thus to
+% define one new \texttt{macro}-like environment, one doesn't have to
+% define six or so new macros---everything can be handled in one
+% definition.
+%
+% The reason for the |\let| commands below is of course that
+% \texttt{macro} and \texttt{environment} are already defined, and
+% there is no |\Renew|\-|Macro|\-|Environment| command. It could
+% perhaps have been better if |\New|\-|Macro|\-|Environment| had
+% behaved like |\Declare|\-|Robust|\-|Command|, but I don't think that
+% is an important problem for the moment.
+% \begin{macrocode}
+\let\macro=\relax
+\let\endmacro=\relax
+\NewMacroEnvironment{macro}{\XD@grab@harmless@asmacro}{1}
+ {\MacroFont\Bslash#1}
+ {\MakeSortKey\@tempa{#1}{}%
+ \XDMainIndex{\LevelSorted{\@tempa}{\texttt{\Bslash#1}}}}
+ {{#1}{\texttt{\Bslash#1}}}
+ {\DoNotIndexHarmless{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\let\environment=\relax
+\let\endenvironment=\relax
+\NewMacroEnvironment{environment}{\XD@grab@harmless@asmacro}{1}
+ {\MacroFont#1}
+ {\XDMainIndex{\LevelSorted{#1}{\texttt{#1} (environment)}}%
+ \XDMainIndex{%
+ \LevelSame{environments:}\LevelSorted{#1}{\texttt{#1}}%
+ }}%
+ {{#1}{\texttt{#1}}}
+ {}%
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+%
+% \subsection{Further examples of \texttt{macro}-like environments}
+% \label{Ssec:More macros}
+%
+% \begin{environment}{option}
+% The \texttt{option} environment is for class\slash package options.
+% IMHO, something like this environment should have been added to
+% \package{doc} years ago!
+%
+% \begin{macrocode}
+\NewMacroEnvironment{option}{\XD@grab@harmless\relax}{1}
+ {\MacroFont#1 \normalfont option}
+ {\XDMainIndex{\LevelSorted{#1}{\texttt{#1} option}}%
+ \XDMainIndex{%
+ \LevelSame{options:}\LevelSorted{#1}{\texttt{#1}}%
+ }}%
+ {{#1 option}{\texttt{#1} option}}
+ {}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{switch}
+% \changes{prot2.1}{2000/11/18}{Using \cs{MakeSortKey}. (LH)}
+% The \texttt{switch} environment is for switches created by
+% |\newif| (\PlainTeX\ style).
+% \begin{macrocode}
+\NewMacroEnvironment{switch}{\XD@grab@harmless\relax}{1}
+ {\MacroFont#1 \normalfont switch}%
+% \end{macrocode}
+% What makes switches different from the other \texttt{macro}-like
+% environments defined here is the large number of index entries it
+% makes. For a switch \meta{sw} it first makes one under the `switches:'
+% heading:
+% \begin{macrocode}
+ {%
+ \MakeSortKey\XD@last@key{#1}{}%
+ \XDMainIndex{%
+ \LevelSame{switches:}\LevelSorted{\XD@last@key}{\texttt{#1}}%
+ }%
+% \end{macrocode}
+% Second it makes a `\meta{sw} switch' entry:
+% \begin{macrocode}
+ \XDMainIndex{\LevelSorted{\XD@last@key}{\texttt{#1} switch}}%
+% \end{macrocode}
+% Third it makes an entry for the macro |\if|\meta{sw}. The sort key
+% for this entry is \emph{not} subjected to |\MakeSortKey| because
+% no reasonable operator will act on the |if| prefix (an operator
+% which acts on |if| could do rather strange things to e.g. |\ifnum|).
+% \begin{macrocode}
+ \XDMainIndex{\LevelSorted{if#1}{\texttt{\Bslash if#1}}}%
+% \end{macrocode}
+% Fourth it makes an entry for the macro |\|\meta{sw}|false|:
+% \begin{macrocode}
+ \MakeSortKey\@tempa{#1false}{}%
+ \XDMainIndex{\LevelSorted{\@tempa}{\texttt{\Bslash#1false}}}%
+% \end{macrocode}
+% Finally it makes an entry for the macro |\|\meta{sw}|true|:
+% \begin{macrocode}
+ \MakeSortKey\@tempa{#1true}{}%
+ \XDMainIndex{\LevelSorted{\@tempa}{\texttt{\Bslash#1true}}}%
+ }%
+% \end{macrocode}
+% The |\changes| heading, on the other hand, is trivial.
+% \begin{macrocode}
+ {{#1}{\texttt{#1} switch}}
+% \end{macrocode}
+% Finally, \texttt{switch} should turn off indexing of the three macros
+% it makes \texttt{main} entries for, since \package{makeindex} will
+% otherwise complain.
+% \begin{macrocode}
+ {\DoNotIndexHarmless{if#1}%
+ \DoNotIndexHarmless{#1false}%
+ \DoNotIndexHarmless{#1true}}%
+%</pkg>
+% \end{macrocode}
+% \end{environment}
+%
+%
+% To end this section, there now follows two examples which are not
+% part of the package as they are very specific, but which have been
+% included here because they illustrate that \texttt{macro}-like
+% environments may have several arguments.
+%
+% \begin{environment}{enccommand}
+% \begin{environment}{enccomposite}
+% The \texttt{enccommand} and \texttt{enccomposite} environments can
+% be used for marking up sources for encoding definition files and the
+% like. \texttt{enccommand} is for encoding-specific commands and has
+% the syntax
+% \begin{quote}
+% |\begin{enccommand}|\marg{command}\oarg{encoding}
+% \end{quote}
+% where \meta{command} is the encoding-specific command and
+% \meta{encoding} is the encoding that this definition is for. If the
+% \meta{encoding} is omitted then the \texttt{enccommand} is assumed
+% to be for the default definition of the command.
+%
+% \texttt{enccomposite} is for composites of encoding-specific
+% commands (defined for example using |\Declare|\-|Text|\-|Composite|).
+% It has the syntax
+% \begin{quote}
+% |\begin{enccomposite}|\marg{command}\marg{encoding}\marg{argument}
+% \end{quote}
+% where \meta{command} and \meta{encoding} are as for
+% \texttt{enccommand} and \meta{argument} is the argument with which
+% the command is being composed.
+%
+% The marginal headings these commands print are the actual control
+% sequences in which the definitions are stored.
+% \begin{macrocode}
+%<*enccmds>
+\NewMacroEnvironment{enccommand}{%
+ \XD@grab@harmless@asmacro \XD@grab@oarg
+}{2}{\MacroFont\Bslash \ifx\NoValue#2?\else#2\fi \Bslash #1}{%
+ \XDMainIndex{%
+ \LevelSorted{#1}{\texttt{\Bslash#1}}%
+ \ifx \NoValue#2%
+ \LevelSame{default}%
+ \else
+ \LevelSorted{#2}{\texttt{#2} encoding}%
+ \fi
+ }%
+}{{#1}{\texttt{\Bslash#1}}}{\DoNotIndexHarmless{#1}}
+% \end{macrocode}
+% \begin{macrocode}
+\NewMacroEnvironment{enccomposite}{%
+ \XD@grab@harmless@asmacro \XD@grab@marg \XD@grab@harmless\relax
+}{3}{\MacroFont\Bslash#2\Bslash#1-#3}{%
+ \XDMainIndex{%
+ \LevelSorted{#1}{\texttt{\Bslash#1}}%
+ \LevelSorted{#2}{\texttt{#2} encoding}%
+ \LevelSorted{\XD@unbackslash#3\@empty}{\texttt{#3} composite}%
+ }%
+}{{#1}{\texttt{\Bslash#1}}}{\DoNotIndexHarmless{#1}}
+%</enccmds>
+% \end{macrocode}
+% In the file \texttt{cyoutenc.dtx} the definitions of many
+% encoding-specific commands are written so that the same line of
+% code can work is all four files \texttt{t2aenc.def},
+% \texttt{t2benc.def}, \texttt{t2cenc.def}, and \texttt{x2enc.def}.
+% Therefore the \meta{encoding} argument of the \texttt{enccommand}
+% and \texttt{enccomposite} environments should perhaps rather be a
+% comma-separated list of encodings than a single encoding, but that
+% would make this example unnecessarily complicated.
+% \end{environment}\end{environment}
+%
+%
+%
+% \section{Describing macros and the like}
+% \label{Sec:Describing}
+%
+% \begin{macro}{\if@mparswitch}
+% \begin{macro}{\if@reversemargin}
+% In two-sided mode, marginal notes should appear in the outer
+% margin. The following code takes care of that.
+% \begin{macrocode}
+%<*pkg>
+\if@twoside
+ \@mparswitchtrue
+ \normalmarginpar
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\GenericDescribePrint}
+% \changes{prot2}{2000/07/14}{\cs{leavevmode} and \cs{ignorespaces}
+% moved to \cs{NewDescribeCommand}. (LH)}
+% \changes{prot2}{2000/07/20}{Added \cs{strut}. Removed it from
+% arguments passed to \cs{GenericDescribePrint}. (LH)}
+% \changes{prot2.3}{2001/06/24}{Changed formatting to match that of
+% \cs{XDParToMargin}. (LH)}
+% The |\GenericDescribePrint| macro is a utility macro for use in
+% commands like |\Describe|\-|Macro|. Its syntax is
+% \begin{quote}
+% |\GenericDescribePrint|\marg{text}
+% \end{quote}
+% and it puts \meta{text} in a marginal paragraph, giving it the
+% appropriate justification for appearing in that margin.
+%
+% The first part simply tests whether the argument fits on a single
+% line.
+% \begin{macrocode}
+\newcommand\GenericDescribePrint[1]{%
+ \setbox\z@=\vbox{%
+ \parindent=\z@
+ \leftskip=\z@skip
+ \rightskip=\z@\@plus 1fil%
+ \parfillskip=\z@skip
+ \hsize=\marginparwidth
+ \linepenalty=\@m
+ \color@begingroup
+ \noindent\ignorespaces #1\@@par
+ \color@endgroup
+ \expandafter}%
+ \expandafter\ifnum \the\prevgraf<\tw@
+% \end{macrocode}
+% Then comes the actual typesetting. First the single-line format.
+% The braces in the optional argument are there to prevent trouble
+% in case |#1| contains a right brace; they will be stripped off when
+% the argument is grabbed.
+% \begin{macrocode}
+ \if@twoside
+ \marginpar[{\raggedleft\strut #1}]{\raggedright\strut #1}%
+ \else
+ \marginpar{\raggedleft\strut#1}%
+ \fi
+ \else
+ \if@twoside
+ \marginpar[{%
+ \leftskip=\z@ \@plus \marginparwidth
+ \rightskip=\leftskip
+ \parfillskip=\z@ \@plus -\marginparwidth
+ \noindent\nobreak\hskip\parfillskip
+ \ignorespaces #1%
+ }]{%
+ \leftskip=\z@ \@plus \marginparwidth
+ \rightskip=\leftskip
+ \parfillskip=\z@ \@plus 1fil%
+ \noindent\nobreak\hskip\parfillskip
+ \ignorespaces #1%
+ }%
+ \else
+ \marginpar{%
+ \leftskip=\z@ \@plus \marginparwidth
+ \rightskip=\leftskip
+ \parfillskip=\z@ \@plus -\marginparwidth
+ \noindent\nobreak\hskip\parfillskip
+ \ignorespaces #1%
+ }%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The \texttt{describe}-commands are supposed to be invisible---only
+% leave a single space even when there are spaces both before and after
+% them---but there are problems with the mechanisms for this. I get the
+% impression that they have never worked perfectly, but that seems to
+% be mainly due to that certain macros in the \LaTeX\ kernel never did
+% either, and I suspect that the general problem has been thrashed over
+% many times before.
+%
+% \package{doc}'s |\DescribeMacro| and |\DescribeEnv| are wrapped up in
+% a |\@bsphack| \dots\ |\@esphack| ``group'' to become invisible, but
+% the |\marginpar| and various index commands they are built on are
+% themselves already invisible, so one would suspect that there is no
+% need for additional invisibility. There are however two factors which
+% create this need. One is that it doesn't do the right thing at
+% beginning of lines; here it seems like what the
+% \texttt{describe}-commands would need is the |\@vbsphack| macro
+% (whose definition appears in \texttt{ltspace.dtx}, but which has been
+% commented out) since they should start a new paragraph and leave no
+% following space if they are used in vertical mode. The other factor is
+% that the standard |\@bsphack|--|\@esphack| can only suppress every
+% second intermediate space if several invisible commands appear in
+% sequence, as is quite common for the
+% \texttt{describe}-commands.\footnote{It would seem that a simple fix
+% for this is to have \cs{@esphack} insert \cs{nobreak}
+% \cs{hskip}\texttt{-}\cs{@savsk} \cs{hskip}\cs{@savsk} before it
+% executes \cs{ignorespaces}, but since that fix hasn't been
+% incorporated into the kernel or the \package{fixltx2e} package there
+% probably is some problem with it.}
+%
+% Instead the \package{doc} implementations of |\DescribeMacro| and
+% |\DescribeEnv| begin with |\leavevmode| and end with |\ignorespaces|,
+% which means that they are only ``invisible'' if they appear on on the
+% left of visible material, but that's how it has been for over a decade
+% now.
+%
+% \begin{macro}{\NewDescribeCommand}
+% \changes{prot2}{2000/07/14}{Command added. (LH)}
+% The |\NewDescribeCommand| command is a relative to the
+% |\New|\-|Macro|\-|Environment| command which defines commands
+% analogous to |\Describe|\-|Macro| rather than \texttt{macro}-like
+% environments. Its syntax is
+% \begin{quote}
+% |\NewDescribeCommand|\marg{command}\marg{grabbers}\B
+% \marg{numargs}\B\marg{definition}
+% \end{quote}
+% \meta{command} is the control sequence to define. \meta{grabbers}
+% and \meta{numargs} are as for the |\NewMacroEnvironment| command.
+% \meta{definition} is the command definition.
+% In addition to the definition given in the \meta{definition}
+% argument and the code for grabbing the arguments, the command
+% actually defined by |\New|\-|Describe|\-|Command| will contain a
+% |\leavevmode| at the start and an |\ignorespaces| at the end.
+%
+% The |\NewDescribeCommand| command should really just be a call to
+% \package{xparse}'s |\Declare|\-|Document|\-|Command|, but that will
+% have to wait until \package{xdoc} becomes based on the
+% \package{xparse} package.
+% \begin{macrocode}
+\newcommand\NewDescribeCommand[4]{%
+ \@ifdefinable#1{%
+ \expandafter\def \expandafter#1\expandafter{%
+ \expandafter\XD@grab@arguments \csname\string#1\endcsname{#2}%
+ }%
+ \let\l@ngrel@x\relax
+ \expandafter\@yargdef \csname\string#1\endcsname \@ne {#3}%
+ {\leavevmode#4\ignorespaces}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DescribeMacro}
+% \changes{prot2.1}{2000/11/18}{Using \cs{MakeSortKey}. (LH)}
+% \begin{macro}{\DescribeEnv}
+% The |\DescribeMacro| and |\DescribeEnv| commands are as in
+% \package{doc}. The argument of |\DescribeMacro| is supposed to be
+% the actual control sequence to describe (not as with the
+% \texttt{macro} environment something which looks like the control
+% sequence after being |\string|ed).
+% \begin{macrocode}
+\let\DescribeMacro=\relax
+\NewDescribeCommand\DescribeMacro{\XD@grab@harmless@cs}{1}{%
+ \GenericDescribePrint{\MacroFont\Bslash#1}%
+ \MakeSortKey\@tempa{#1}{}%
+ \IndexEntry{%
+ \LevelSorted{\@tempa}{\texttt{\Bslash#1}}%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% The argument of |\DescribeEnv|, on the other hand, is treated like
+% that of the \texttt{environment} environment, but backslash isn't
+% given catcode 12---only the catcode assignments in
+% |\Make|\-|Private|\-|Letters| are made.
+% \begin{macrocode}
+\let\DescribeEnv=\relax
+\NewDescribeCommand\DescribeEnv{%
+ \XD@grab@harmless@withprivate\relax
+}{1}{%
+ \GenericDescribePrint{\MacroFont#1}%
+ \IndexEntry{%
+ \LevelSame{environments:}\LevelSorted{#1}{\texttt{#1}}%
+ }{usage}{\thepage}%
+ \IndexEntry{%
+ \LevelSorted{#1}{\texttt{#1} (environment)}%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\describeoption}
+% \changes{prot2}{2000/07/31}{Command added---I realised that the need
+% to describe options is probably as large as that to mark out
+% their definition. (LH)}
+% The |\describeoption| command is the \texttt{describe}-companion to
+% the \texttt{option} environment.
+% \begin{macrocode}
+\NewDescribeCommand\describeoption{\XD@grab@harmless\relax}{1}{%
+ \GenericDescribePrint{\MacroFont#1 \normalfont option}%
+ \IndexEntry{%
+ \LevelSame{options:}\LevelSorted{#1}{\texttt{#1}}%
+ }{usage}{\thepage}%
+ \IndexEntry{%
+ \LevelSorted{#1}{\texttt{#1} option}%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\describecsfamily}
+% \changes{prot2}{2000/07/14}{Renamed \cs{DescribeCSFamily} and
+% incorporated the code from \cs{XD@index@family}. (LH)}
+% \changes{prot2.1}{2000/11/18}{Using \cs{MakeSortKey}. (LH)}
+% The |\describecsfamily| command is for marking out sections in text
+% where a particular family of control sequences is described---just
+% like |\DescribeMacro| does for individual commands. To clarify what
+% I mean by a control sequence family, here are a couple of examples:
+% \begin{longtable}{l >{\raggedright}p{0.55\linewidth}}
+% |\c@|\meta{counter}\label{Tab:CS-families}&
+% countdef token for the |\count| register storing the
+% \LaTeX\ counter \meta{counter}\tabularnewline
+% |\ps@|\meta{pagestyle}&
+% macro storing settings for the pagestyle \meta{pagestyle}^^A
+% \tabularnewline
+% |\|\meta{enc}|/|\meta{fam}|/|\meta{ser}|/|\meta{sh}|/|\meta{sz}&
+% the fontdef token for the font which has encoding \meta{enc},
+% family \meta{fam}, series \meta{ser}, shape \meta{sh}, and
+% size \meta{sz} under NFSS\tabularnewline
+% |\|\meta{enc}|\|\meta{cmd}&
+% the macro containing the definition for encoding \meta{enc} of
+% the encoding-specific \LaTeX\ command |\|\meta{cmd}^^A
+% \tabularnewline
+% |\fps@|\meta{type}&
+% the default placement specifier for \LaTeX\ floats of type
+% \meta{type}\tabularnewline
+% |\l@|\meta{name}&
+% a macro which formats table of contents entries for items of
+% type \meta{name} (\texttt{chapter}, \texttt{section}, etc.)^^A
+% \tabularnewline
+% |\l@|\meta{language}&
+% the |\language| number \package{babel} has allocated for the
+% language \meta{language} (\texttt{english}, \texttt{french},
+% etc.)\tabularnewline
+% |\i-|\meta{int}&
+% the control sequence (either a mathchardef token or a macro)
+% which stores the value of the \package{fontinst} integer
+% \meta{int}
+% \end{longtable}
+%
+% The syntax for |\describecsfamily| is
+% \begin{quote}
+% |\describecsfamily|\marg{cs-fam specification}
+% \end{quote}
+% The \meta{cs-fam specification} includes only what would be put
+% between |\csname| and |\endcsname|; the |\describecsfamily| command
+% will add a backslash when printing the name. No special catcodes
+% will be in force in the argument, but the |#|, |$|, |&|, |_|, |^|,
+% and |~| characters present no problems even if they have their
+% ordinary catcodes. All spaces are seen as ASCII space and \TeX\ is
+% skipping spaces as usual. Characters with catcode 0, 1, 2, 5, 9, 14,
+% or 15 may however be problematic.
+% If you need to specify such a problematic character then you can do
+% so by writing |\PrintChar|\marg{code}, where \meta{code} is the
+% ASCII code for the character, as a valid \TeX\ number in the range
+% 0--255. In case you do not remember the ASCII code for some
+% character \meta{c}, there is no harm in specifying it as
+% |`\|\meta{c}, e.g. |\PrintChar{`\}}| for a right brace. It is even
+% possible to write |\PrintChar| commands for characters outside
+% visible ASCII (but those are typeset as |^^|-sequences).
+%
+% The variant parts in the control sequence names are specified as
+% \begin{quote}
+% |\meta|\marg{text}
+% \end{quote}
+% and these will be typeset exactly as in normal text. The arguments
+% of |\meta|s appearing in a \meta{cs-fam specification} are moving.
+% All control sequences other than |\PrintChar| and |\meta| in a
+% \meta{cs-fam specification} (and which do not appear in the argument
+% of a |\PrintChar| or |\meta|) are essentially treated as if they
+% had been |\string|ed.
+%
+% Apart from the above differences in treatment of the argument, the
+% |\describe|\-|cs|\-|family| command is similar to
+% |\DescribeMacro|---it prints the control sequence name in the margin
+% and makes a \texttt{usage} index entry.
+% \begin{macrocode}
+\NewDescribeCommand\describecsfamily{\XD@grab@harmless{}}{1}{%
+ \GenericDescribePrint{%
+ \MetaNormalfont\MacroFont\Bslash#1%
+ }%
+ \MakeSortKey\@tempa{#1}{\def\meta##1{(##1)}}%
+ \IndexEntry{%
+ \LevelSorted{\@tempa}{\texttt{\protect\MetaNormalfont\Bslash#1}}%
+ }{usage}{\thepage}%
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% As for |\NewMacroEnvironment|, I also give an example of an
+% application of |\NewDescribeCommand| which is much too special for
+% including in \package{xdoc} in general and therefore the code is
+% placed in a special module. I had originally written the code as part
+% of another package, but I removed it because I thought it was a bit
+% too special even for that context. The commentry below is kept
+% unchanged.\changes{prot2.1}{2000/09/16}{Additional
+% \cs{NewDescribeCommand} code example added. (LH)}
+%
+% \begin{quotation}
+%
+% I believe this feature is primarily of interest for MacOS programs,
+% but there might be sufficiently similar structures in other operating
+% systems to make it useful even in other contexts. Be as it may, what
+% the feature described here does is that it allows the user to put an
+% entry in the index for each resource in the code. This gives an easy
+% way of checking that no two resources are assigned the same id, even
+% though there is no mechanism for especially warning for such
+% collisions.
+%
+% \begin{macro}{\DescribeResource}
+% The main command available is
+% \begin{quote}
+% |\DescribeResource|\marg{type}\marg{id}\marg{text}
+% \end{quote}
+% \meta{type} is a four-character string. Most special characters are
+% treated as ordinary ones (very useful for |#|s), but the visible
+% ASCII characters |%|, |{|, |\|, and |}| retain their usual meaning.
+% To use such a troublesome character \meta{c} in a resource type,
+% write it as |\PrintChar{`\|\meta{c}|}|. \meta{id} is a \TeX\ number;
+% it will be used as the number of the resource. \meta{text} is normal
+% text that will be put in the index entry to describe the resource; it
+% seems a good idea to use the name of the resource for this. \meta{id}
+% and \meta{text} are read with normal \LaTeX\ catcodes. Note that
+% \meta{text} is a moving argument.
+%
+% |\DescribeResource| does two things---it prints the \meta{type} and
+% \meta{id} of the resource in the margin, and it writes an entry
+% \begin{quote}
+% \meta{type} resources:\\
+% \vadjust{}\qquad\meta{id}\\
+% \vadjust{}\qquad\qquad\meta{text}
+% \end{quote}
+% (plus a lot of formatting not shown here) to the \texttt{.idx} file.
+% The reference is for the page.
+%
+% The idea with advancing |\count@| like that when constructing the
+% index entry is to get a sort key for which lexicographic order equals
+% the wanted order. This would not be the case if the number was simply
+% written down. The current code maps numbers to six-digit positive
+% integers, but five-digits integers would be sufficient (a resource
+% \meta{id} is a signed 16-bits integer). The construction chosen
+% here furthermore puts the negative numbers after the positive ones.
+% \begin{macrocode}
+%<*rsrccmd>
+\NewDescribeCommand\DescribeResource{%
+ \XD@grab@harmless\relax \XD@grab@marg \XD@grab@marg
+}{3}{%
+ \GenericDescribePrint{#1%
+ \textnormal{:\ifnum#2<\z@ \textminus\number-\else\number\fi#2}%
+ }%
+ \count@=#2\relax
+ \advance \count@ 100000\ifnum \count@<\z@ 0\fi \relax
+ \protected@edef\@tempa{%
+ \noexpand\LevelSorted{\the\count@}{%
+ \ifnum #2<\z@ \string\textminus \number-\else\number\fi#2%
+ }%
+ }%
+ \IndexEntry{%
+ \LevelSorted{#1 resources:}{\texttt{#1} resources:}%
+ \@tempa
+ \LevelSame{#3}%
+ }{usage}{\thepage}%
+}
+%</rsrccmd>
+% \end{macrocode}
+% \end{macro}
+%
+% \end{quotation}
+%
+%
+% \section{The \cs{DocInclude} command}
+% \label{Sec:DocInclude}
+%
+% The code in this section is based on code from the \package{ltxdoc}
+% document class~\cite{ltxdoc} and it implements a command called
+% |\DocInclude|. Two implementations of this command are given: one
+% which is essentially that of \package{ltxdoc} (preserving all its
+% peculiarities), and one which is a reimplementation from scratch. The
+% default is to use the latter, but passing the \texttt{olddocinclude}
+% option to \package{xdoc} selects the former.
+%
+%
+% \subsection{Old implementation}
+%
+% It should be observed that this is not a complete implementation of the
+% |\Doc|\-|Include| command---it only redefines the \package{ltxdoc}
+% macros that need to be changed if the |\Doc|\-|Include| command is to
+% work with \package{xdoc} (it doesn't for example change the definition
+% of |\Doc|\-|Include| itself). Furthermore it doesn't define anything if
+% the \package{ltxdoc} document class hasn't been loaded, since then the
+% details of the definition of |\Doc|\-|Include| (even if it would be
+% defined) are unknown.
+%
+% \begin{macro}{\CodelineIndex}
+% \changes{prot2.1}{2000/10/08}{Using \cs{thecodelineno}. (LH)}
+% \begin{macro}{\filesep}
+% \changes{prot2.2}{2001/02/13}{Redefined to use
+% \cs{XD@page@compositor}. (LH)}
+% \begin{macro}{\@docinclude}
+% \package{ltxdoc} redefines |\codeline@wrindex| so that |\filesep| is
+% prepended to each codeline number that is written to the index file.
+% That redefinition has no effect unless the |\Codeline|\-|Index|
+% command is executed afterwards however, so there is no harm in having
+% |\Codeline|\-|Index| itself apply the corresponding change.
+% \begin{macrocode}
+%<*pkg>
+\@ifpackagewith{xdoc2}{olddocinclude}{%
+ \@ifclassloaded{ltxdoc}{%
+ \renewcommand\CodelineIndex{%
+ \makeindex
+ \let\XD@if@index=\@firstoftwo
+ \codeline@indextrue
+ \def\TheXDIndexNumber{\filesep\thecodelineno}%
+ }%
+% \end{macrocode}
+% The |\filesep| macro is redefined so that the \package{docindex}
+% package~\cite{docindex} can use a |page_compositor| string different
+% from the default |-| simply by redefining |\XD@page@compositor|.
+% This redefinition has to be put in |\docincludeaux| since that macro
+% redefines |\filesep| too.
+% \begin{macrocode}
+ \expandafter\def \expandafter\docincludeaux \expandafter{%
+ \docincludeaux
+ \gdef\filesep{\thepart\XD@page@compositor}%
+ }
+% \end{macrocode}
+% The change to |\@docinclude| merely consists of inserting code for
+% writing an |External|\-|XRef|\-|Wrap| to the \texttt{.aux} file to
+% record the new value of the \texttt{part} counter.
+% \begin{macrocode}
+ \def\@docinclude#1 {%
+ \clearpage
+ \if@filesw
+ \immediate\write\@mainaux{\string\@input{#1.aux}}%
+ \fi
+ \@tempswatrue
+ \if@partsw
+ \@tempswafalse
+ \edef\@tempb{#1}%
+ \@for\@tempa:=\@partlist\do{%
+ \ifx\@tempa\@tempb\@tempswatrue\fi
+ }%
+ \fi
+ \if@tempswa
+ \let\@auxout\@partaux
+ \if@filesw
+ \immediate\openout\@partaux #1.aux
+ \immediate\write\@partaux{\relax}%
+ \fi
+ \part{#1.dtx}%
+ \if@filesw
+ \immediate\write\@partaux{\@percentchar\@percentchar
+ ExternalXRefWrap {\filesep} {}%
+ }%
+ \fi
+ {%
+ \let\ttfamily\relax
+ \xdef\filekey{%
+ \filekey, \thepart={\ttfamily\currentfile}%
+ }%
+ }%
+ \DocInput{#1.dtx}%
+ \clearpage
+ \@writeckpt{#1}%
+ \if@filesw \immediate\closeout\@partaux \fi
+ \else
+ \@nameuse{cp@#1}%
+ \fi
+ \let\@auxout\@mainaux
+ }
+ }{}
+}{}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \subsection{New implementation}
+% \label{Ssec:New DocInclude}
+%
+% The default action of the second implementation is to be precisely an
+% |\include| variant of |\DocInput|, but in addition to that it also
+% has a (one-argument) hook called |\docincludeaux| which is executed
+% before a file is actually |\DocInput|ted, but after it has been
+% determined that it should be included, and this hook is only executed
+% for the files which should be |\include|d. This hook is normally
+% |\@gobble|, but passing the \texttt{fileispart} option to
+% \package{xdoc} redefines it to start a new part and set the pagestyle.
+%
+% \begin{macro}{\DocInclude}
+% \begin{macro}{\@docinclude}
+% Most of the code for the |\DocInclude| command is put in the
+% |\@docinclude| macro; |\DocInclude| simply checks that it hasn't
+% been nested. The main difference to |\include| is that a nested
+% |\DocInclude| becomes an error plus the corresponding |\DocInput|,
+% whereas a nested |\include| simply becomes an error. The rationale
+% for this is that it is probably closer to what was intended.
+%
+% The argument of |\@docinclude| is, oddly enough, space-delimited.
+% This is inherited from the |\@include| macro in the \LaTeX\ kernel,
+% where it is a hack to make sure that the part \texttt{.aux} file
+% that is opened for writing really gets the suffix \texttt{.aux} (in
+% the worst case, \TeX\ could start overwriting a \texttt{.tex} file
+% instead).
+% \begin{macrocode}
+\@ifpackagewith{xdoc2}{olddocinclude}{}{%
+ \def\DocInclude#1{%
+ \ifnum\@auxout=\@partaux
+ \@latexerr{\string\include\space cannot be nested}{%
+ Your \protect\DocInclude\space will be reduced to a
+ \protect\DocInput.%
+ }%
+ \DocInput{#1.dtx}%
+ \else \@docinclude#1 \fi
+ }%
+% \end{macrocode}
+% The only things in this |\@docinclude| that are not precisely as in
+% |\@include| are the |\docincludeaux| and |\DocInput| commands.
+% \begin{macrocode}
+ \def\@docinclude#1 {%
+ \clearpage
+ \if@filesw
+ \immediate\write\@mainaux{\string\@input{#1.aux}}%
+ \fi
+ \@tempswatrue
+ \if@partsw
+ \@tempswafalse
+ \edef\@tempb{#1}%
+ \@for\@tempa:=\@partlist\do{%
+ \ifx\@tempa\@tempb \@tempswatrue \fi
+ }%
+ \fi
+ \if@tempswa
+ \let\@auxout\@partaux
+ \if@filesw
+ \immediate\openout\@partaux #1.aux
+ \immediate\write\@partaux{\relax}%
+ \fi
+ \docincludeaux{#1.dtx}%
+ \DocInput{#1.dtx}%
+ \clearpage
+ \@writeckpt{#1}%
+ \if@filesw \immediate\closeout\@partaux \fi
+ \else
+ \deadcycles\z@
+ \@nameuse{cp@#1}%
+ \fi
+ \let\@auxout\@mainaux
+ }%
+}{}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{option}{fileispart}
+% \begin{macro}{\docincludeaux}
+% The \texttt{fileispart} option works by (re)defining a couple of
+% macros, of which the |\doc|\-|include|\-|aux| macro is the most
+% important. Its syntax is
+% \begin{quote}
+% |\docincludeaux|\marg{filename}
+% \end{quote}
+% where \meta{filename} is the name of a file that will be inputted.
+% The \texttt{fileispart} definition of this is to set |\currentfile|
+% to the harmless character string of \meta{filename}, produce a
+% |\part| heading whose text is that \meta{filename}, add the
+% \meta{filename} to the |\filekey| macro, set the page style to
+% \texttt{docpart}, clear the |\filedate|, |\fileversion|, and
+% |\fileinfo| macros, and write an |External|\-|XRef|\-|Wrap|
+% XXR-command to the \texttt{.aux} file to record the new codeline
+% number prefix.
+% \begin{macrocode}
+\@ifpackagewith{xdoc2}{olddocinclude}{\iffalse}{
+ \@ifpackagewith{xdoc2}{fileispart}{\iftrue}{
+ \let\docincludeaux=\@gobble
+ \iffalse
+ }
+} % If fileispart and not olddocinclude then
+ \def\docincludeaux#1{%
+ \MakeHarmless\currentfile{#1}%
+ \part{\texttt{\currentfile}}%
+ \pagestyle{docpart}%
+ \let\filedate\@empty
+ \let\fileversion\@empty
+ \let\fileinfo\@empty
+ \protected@xdef\filekey{%
+ \filekey, \thepart=\texttt{\currentfile}%
+ }%
+ \if@filesw
+ \immediate\write\@partaux{\@percentchar\@percentchar
+ ExternalXRefWrap {\thepart\XD@page@compositor} {}%
+ }%
+ \fi
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CodelineIndex}
+% \changes{prot2.1}{2000/10/08}{Using \cs{thecodelineno}. (LH)}
+% The \texttt{fileispart} option also adds the \texttt{codelineno}
+% counter to the reset list for \texttt{part} and changes the format
+% of codeline numbers written to the index.
+% \begin{macrocode}
+ \@ifclassloaded{ltxdoc}{}{\@addtoreset{codelineno}{part}}%
+ \renewcommand\CodelineIndex{%
+ \makeindex
+ \let\XD@if@index=\@firstoftwo
+ \codeline@indextrue
+ \def\TheXDIndexNumber{\thepart\XD@page@compositor\thecodelineno}%
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\partname}
+% \begin{macro}{\thepart}
+% \begin{macro}{\IndexParms}
+% Finally there are a couple of macros which are redefined for
+% aesthetic rather than technical reasons. Passing the
+% \texttt{fileispart} option sets |\partname| to \texttt{File}, sets
+% |\thepart| to |\aalph{part}|, and adds a setting of pagestyle to
+% |\IndexParms|. (The pagestyle setting is added to
+% |\index@|\B|prologue| by \package{ltxdoc}, but I think
+% |\Index|\-|Parms| is more appropriate.)
+% \begin{macrocode}
+ \def\partname{File}
+ \def\thepart{\aalph{part}}
+ \expandafter\def \expandafter\IndexParms
+ \expandafter{\IndexParms \pagestyle{docindex}}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% In case the index formatting is handled by the \package{docindex}
+% package~\cite{docindex} (or its \LaTeXe\ incarnation
+% \package{docidx2e}), the above addition to |\Index|\-|Parms| won't
+% have any effect. Therefore \package{xdoc} also passes the
+% \texttt{use}\-\texttt{doc}\-\texttt{index}\-\texttt{ps} option on
+% to these packages.
+% \begin{macrocode}
+ \PassOptionsToPackage{usedocindexps}{docindex}
+ \PassOptionsToPackage{usedocindexps}{docidx2e}
+\fi
+% \end{macrocode}
+% \end{option}
+%
+% \begin{macro}{\ps@docpart}
+% \begin{macro}{\setfileinfo}
+% \begin{macro}{\XD@set@file@info}
+% The \texttt{docpart} pagestyle is for pages made from the
+% |\DocInclude|d files. The page footers contain the page number, the
+% part (file) number, and the current file name. It also contains the
+% file date and version if that information is available.
+%
+% \package{ltxdoc} uses |\GetFileInfo| to get the date and version
+% information, but that's a very peculiar practice. The data one wants
+% to present are about the file being typeset---typically the version
+% of the package that is documented in this file---whereas the
+% |\GetFileInfo| command really extracts information about
+% \emph{unpacked} classes, packages, and similar files---files that
+% contribute to the typesetting by defining commands, not by containing
+% text. Such information may be of interest for documents which contain
+% alternative code for incompatible versions of for example a package,
+% but it is of no use for printing version information as above since
+% the version of a package used for typesetting a \texttt{.dtx} file
+% need not be the version actually contained in that \texttt{.dtx}
+% file. Thus the only way to make this work is by doing as the \LaTeX\
+% kernel source and include |\ProvidesFile| commands for the
+% \texttt{.dtx} file in each such file, which is a rather peculiar use
+% of the |\ProvidesFile| command.
+%
+% The |\setfileinfo| command provides an equivalent feature in a less
+% roundabout way. It has the syntax
+% \begin{quote}
+% |\setfileinfo[|\meta{date}\verb*+ +\meta{version}\verb*+ +^^A
+% \meta{info}|]|
+% \end{quote}
+% and it sets |\filedate| to \meta{date}, |\fileversion| to
+% \meta{version}, and |\fileinfo| to \meta{info} if the optional
+% argument is present; if the optional argument is missing or contains
+% fewer than three words then the missing fields are set to |?|.
+%
+% \begin{macrocode}
+\@ifpackagewith{xdoc2}{olddocinclude}{}{%
+ \def\ps@docpart{%
+ \def\@oddfoot{%
+ File: \texttt{\currentfile}%
+ \ifx \filedate\@empty \else \ Date: \filedate\fi
+ \ifx \fileversion\@empty \else \ Version: \fileversion\fi
+ \hfill\thepage
+ }%
+ \if@twoside
+ \def\@evenfoot{%
+ \thepage\hfill
+ File: \texttt{\currentfile}%
+ \ifx \filedate\@empty \else \ Date: \filedate\fi
+ \ifx \fileversion\@empty \else \ Version: \fileversion\fi
+ }%
+ \else \let\@evenfoot\@oddfoot \fi
+ }
+% \end{macrocode}
+% The corresponding definition in \package{ltxdoc} (there it appears in
+% |\docincludeaux|) is peculiar in that the odd page footer is set
+% globally but the even page footer only locally.
+%
+% The definition of |\setfileinfo| follows that of |\GetFileInfo|
+% except for the fact that the |\relax|es have been replaced by
+% |\@empty|s.
+% \begin{macrocode}
+ \newcommand\setfileinfo[1][]{%
+ \edef\@tempa{#1}%
+ \expandafter\XD@set@file@info \@tempa\@empty? ? \@empty\@empty
+ }
+ \def\XD@set@file@info#1 #2 #3\@empty#4\@empty{%
+ \def\filedate{#1}%
+ \def\fileversion{#2}%
+ \def\fileinfo{#3}%
+ }
+}{}
+% \end{macrocode}
+% The reason for making the argument of |\setfileinfo| optional is
+% that with the |\Provides|\-|File| practice one can (potentially) put
+% all date and version information in one place through tricks like
+% \iffalse
+%<*example>
+% \fi
+%\begin{verbatim}
+%% \begin{macrocode}
+%\ProvidesPackage{foobar}
+%% \end{macrocode}
+%% \ProvidesFile{foobar.dtx}
+% [2000/02/02 v1.0 Silly example package]
+%%
+%\end{verbatim}\iffalse
+%</example>
+% \fi
+% By making the argument of |\setfileinfo| optional, I make sure that
+% people who have used such tricks only have to replace the
+% |\ProvidesFile{foobar.dtx}| by |\setfileinfo|.
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\ps@docindex}
+% \begin{macro}{\filekey}
+% The \texttt{docindex} pagestyle is for the index in
+% \texttt{fileispart} documents. It prints a file key, which is a
+% list of all the included files and their corresponding part letters,
+% at the bottom of every page. The file key is stored in the macro
+% |\filekey|, which should have been constructed file by file as they
+% are included. To add a file to the file key, it is recommended that
+% you do
+% \begin{quote}
+% |\protected@xdef\filekey{\filekey, |\meta{entry for new file}|}|
+% \end{quote}
+% The \texttt{fileispart} version of |\docincludeaux| already does
+% this. The initial value of |\filekey| is |\@gobble| so that the
+% comma before the first entry is removed. The |\@empty| below is
+% there in case no entry has been inserted.
+% \begin{macrocode}
+% \@ifpackagewith{xdoc2}{olddocinclude}{}{%
+ \def\ps@docindex{%
+ \def\@oddfoot{%
+ \parbox{\textwidth}{%
+ \strut\footnotesize\raggedright
+ \textbf{File Key:} \filekey\@empty
+ }%
+ }%
+ \let\@evenfoot\@oddfoot
+ }%
+ \let\filekey\@gobble
+% }
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% It should be observed that since |\ps@docindex| only sets the page
+% style locally, the page style will revert to its previous setting at
+% the end of the \texttt{theindex} environment. As that previous
+% setting is probably that of the \texttt{docpart} page style, you
+% might have to set the page style manually.
+%
+% \begin{macro}{\aalph}
+% \begin{macro}{\@aalph}
+% |\aalph| is a variant of |\alph| which continues with the upper case
+% letters for 27--52. It is defined by \package{ltxdoc}, so it is
+% merely provided here.
+% \begin{macrocode}
+\providecommand*\aalph[1]{\@aalph{\csname c@#1\endcsname}}
+\providecommand*\@aalph[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\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}
+% In \texttt{source2e.tex} one can see that \package{doc}'s standard
+% \texttt{gind.ist} index style file won't sort the 35th file (part
+% \texttt{I}) correctly since it causes \package{makeindex} to read an
+% \texttt{I} as ``upper case Roman numeral one'', but I doubt very
+% many people encounter that problem in their projects.
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\XD@page@compositor}
+% \changes{prot2.2}{2001/02/13}{Macro added, other macros changed to
+% use it. (LH)}
+% The |\XD@page@compositor| macro contains the string which is put
+% between the parts of a composite number in the index; it
+% corresponds to the |page_compositor| parameter of
+% \package{makeindex}.
+% \begin{macrocode}
+\providecommand*\XD@page@compositor{-}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{Miscellanea}
+%
+% \subsection{Some \LaTeXplus\ stuff}
+%
+% \begin{macro}{\BooleanFalse}
+% \begin{macro}{\BooleanTrue}
+% \begin{macro}{\NoValue}
+% These three macros are borrowed from the \package{xparse}
+% package~\cite{xparse}, where they work as the three values
+% \emph{boolean false}, \emph{boolean true}, and \emph{absence of
+% value} respectively. The definitions are taken from
+% \package{xparse} v\,0.17 (1999/09/10).
+% \begin{macrocode}
+\@ifundefined{BooleanFalse}{\def\BooleanFalse{TF}}{}
+\@ifundefined{BooleanTrue}{\def\BooleanTrue{TT}}{}
+\@ifundefined{NoValue}{\def\NoValue{-NoValue-}}{}
+% \end{macrocode}
+% By using these macros (rather than some homegrown set of macros
+% or tokens) for denoting these values here I hopefully simplify a
+% transition to \LaTeXplus, but I don't want to rely on \LaTeXplus\
+% since it hasn't been released yet.
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \subsection{The \cs{meta} command}
+%
+% A reimplementation which has already (as of v\,2.0k) found its way into
+% the \package{doc} package is the one that the |\meta| command is made
+% robust, but since some people might still have older
+% versions of \package{doc} and since that feature is needed for
+% |\describe|\-|cs|\-|family|, I apply it here too. First I check
+% whether the definition of |\meta| is the old non-robust definition,
+% and only apply the fix if it is.
+% \begin{macrocode}
+\begingroup
+\obeyspaces%
+\catcode`\^^M\active%
+\gdef\@gtempa{\begingroup\obeyspaces\catcode`\^^M\active%
+\let^^M\do@space\let \do@space%
+\def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\itshape}%
+\m@ta}%
+\endgroup
+\ifx \meta\@gtempa
+% \end{macrocode}
+%
+% \begin{macro}{\l@nohyphenation}
+% The new implementation needs a |\language| without any hyphenation
+% patterns. By switching to that language, one can inhibit
+% hyphenation in a piece of text regardless of what line-breaking
+% parameter settings are in force when the paragraph is actually
+% broken. This new language will be called \texttt{nohyphenation} and
+% it is only allocated if it isn't already known (since some
+% \package{babel} settings files already defines this |\language|).
+% \begin{macrocode}
+ \@ifundefined{l@nohyphenation}{\newlanguage\l@nohyphenation}{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\meta}
+% \begin{macro}{\meta@font@select}
+% This is the definition of |\meta| from \package{doc} v\,2.0m. For
+% an explanation of the implementation, se a \texttt{doc.dtx} at least
+% that new or entry \texttt{latex/3170} in the \LaTeX\ bugs database.
+% \begin{macrocode}
+ \DeclareRobustCommand\meta[1]{%
+ \ensuremath\langle
+ \ifmmode \expandafter \nfss@text \fi
+ {%
+ \meta@font@select
+ \edef\meta@hyphen@restore
+ {\hyphenchar\the\font\the\hyphenchar\font}%
+ \hyphenchar\font\m@ne
+ \language\l@nohyphenation
+ #1\/%
+ \meta@hyphen@restore
+ }\ensuremath\rangle
+ }
+% \end{macrocode}
+% \begin{macrocode}
+ \let\meta@font@select=\itshape
+\fi
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\MetaNormalfont}
+% \changes{prot2}{2000/07/24}{Removed robustness; protected it
+% explicitly wherever needed instead. (LH)}
+% The |\MetaNormalfont| command redefines |\meta@font@select| to do a
+% |\normal|\-|font| before the |\itshape|. It is useful if |\meta| is
+% going to be used to make |\rmfamily| interjections in |\ttfamily|
+% text.
+% \begin{macrocode}
+\newcommand\MetaNormalfont{\def\meta@font@select{\normalfont\itshape}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\XD@harmless\meta}
+% This macro is needed for making |\meta| behave as described in the
+% argument of |\describe|\-|cs|\-|family|, i.e., in text which is
+% going to be converted into a harmless character string.
+% \begin{macrocode}
+\@namedef{XD@harmless\string\meta}#1{%
+ \toks@=\expandafter{\the\toks@ \meta{#1}}%
+ \XD@harmless@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The checksum feature}
+%
+% The checksum mechanism in \package{doc} is a remnant from the times
+% when file truncation was a common problem and a mechanism for
+% detecting this was a great help.\footnote{Even though I suspect that
+% the recommended use of it---to put the checking \cs{Finale} at the
+% end of the \texttt{.dtx} file---may have reduced its usefulness
+% dramatically, as that \cs{Finale} would have been the one thing that
+% surely disappears if the file is truncated.} Today its main usefulness
+% seems to lie in that it distinguishes versions of a file that are
+% ``being worked on'' (where the checksum probably doesn't match) from
+% versions of a file that are ``polished and ready for upload''
+% (someone has bothered to fix the checksum), and as it exists it might
+% as well stay. There is a problem however with files which do not
+% contain \TeX\ code, as simply counting backslashes quite probably
+% isn't a good (or even reasonable) way of forming a checksum for these
+% files (if the checksum turns out to be zero, \package{doc} will
+% complain no matter what you do).
+%
+% \begin{macro}{\check@checksum}
+% \changes{prot2.1}{2000/10/02}{Redefinition added. (LH)}
+% For that reason, the |\check@checksum| macro is redefined to only
+% write the ``no checksum'' warning to the log file if the checksum
+% hasn't been set.
+% \begin{macrocode}
+\renewcommand\check@checksum{%
+ \relax
+ \ifnum \check@sum=\z@
+ \PackageInfo{doc}{This macro file has no checksum!\MessageBreak
+ The checksum should be \the\bslash@cnt}%
+ \else\ifnum \check@sum=\bslash@cnt
+ \typeout{*******************}%
+ \typeout{* Checksum passed *}%
+ \typeout{*******************}%
+ \else
+ \PackageError{doc}{Checksum not passed (\the\check@sum
+ <>\the\bslash@cnt)}{The file currently documented seems
+ to be wrong.\MessageBreak Try to get a correct version.}%
+ \fi\fi
+ \global\check@sum\z@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{The \cs{theCodelineNo} situation}
+% \label{Ssec:CodelineNo}
+%
+% \changes{prot2.1}{2000/10/08}{\cs{theCodelineNo} situation cleared
+% up. (LH)}
+% \package{doc} incorporates formatting of the value of the
+% \texttt{CodelineNo} counter in the |\theCodelineNo| macro, which is a
+% bit awkward since it prevents using this macro in making e.g.\ index
+% entries. To get around this, \package{xdoc} introduces the alternative
+% name \texttt{codelineno} for this counter so that |\thecodelineno| can
+% produce the value representation without formatting.
+%
+% \begin{macro}{\c@codelineno}
+% \begin{macro}{\cl@codelineno}
+% \begin{macro}{\p@codelineno}
+% \begin{macro}{\thecodelineno}
+% The control sequences connected to the \texttt{codelineno} counter
+% are |\let| so that they refer to the same |\count| register as the
+% \texttt{CodelineNo} counter. Note that \texttt{CodelineNo} isn't a
+% proper \LaTeX\ counter, so the macros |\cl@CodelineNo| and
+% |\p@CodelineNo| are undefined. |\thecodelineno| is set to the default
+% value for a new counter.
+% \begin{macrocode}
+\@ifundefined{c@codelineno}{}{%
+ \PackageInfo{xdoc2}{Overwriting codelineno counter}%
+}
+\let\c@codelineno=\c@CodelineNo
+\let\cl@codelineno=\@empty
+\let\p@codelineno=\@empty
+\def\thecodelineno{\@arabic\c@codelineno}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\PrintCodelineNo}
+% The |\PrintCodelineNo| command is the new recommended command for
+% printing the formatted form of the codeline number counter. People
+% who write their own \texttt{macrocode}-like environments should use
+% |\PrintCodelineNo| instead of \package{doc}'s |\theCodelineNo|.
+% \begin{macrocode}
+\newcommand\PrintCodelineNo{\reset@font\scriptsize\thecodelineno}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\theCodelineNo}
+% Finally |\theCodelineNo| is redefined to reference
+% |\PrintCodelineNo|. This is done for the sake of backwards
+% compability; I didn't feel like redefining |\macro@code| just for
+% the sake of changing the |\theCodelineNo| into a |\PrintCodelineNo|).
+% \begin{macrocode}
+\def\theCodelineNo{\PrintCodelineNo}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</pkg>
+% \end{macrocode}
+%
+%
+% \section{Problems and things to do}
+%
+% This section lists some problems that exist with the current
+% implementations of commands in \package{xdoc}. The list is rather
+% unstable---items are added as I realize there is a problem and removed
+% when I find a solution---an in parts it is rather esoteric since most
+% of the problems have only been found theoretically.
+%
+% \medskip
+%
+% One of the less well-known features of the |\verb| command is that
+% it automatically inhibits the known syntactic ligatures. There is
+% no such mechanism implemented for the harmless character strings,
+% so some (in \TeX\ \texttt{macrocode} uncommon) character sequences
+% (such as |!`|) may produce unwanted results. The quick hack to
+% circumvent this is to use the |\SetHarmState| command to mark one
+% of the characters involved as problematic, as the |\PrintChar|
+% command is implemented so that the character it prints will not be
+% involved in ligaturing or kerning. On the other hand, \package{doc}
+% does nothing to suppress syntactic ligatures in macro or environment
+% names when they are printed in the margin, so for that material the
+% \package{xdoc} implementation might actually improve things, although
+% it could perform worse for verbatim material in the index and list of
+% changes.
+%
+% \medskip
+%
+% Things to do and\slash or think about:
+% \begin{itemize}
+% \item
+% Examine how complicated it would be to convert the
+% |\PrintChar| commands for visible characters in a harmless
+% character string back to explicit characters, for possible use in
+% sort keys. (This could be used to ensure that visible characters
+% are sorted in strict ASCII order.)
+% \item
+% Should those ``letters'' which are commonly used as word
+% separators---in \LaTeX\ code mainly |@|---be ignored when sort
+% keys are being formed (just like the backslash is)? (This would
+% require a change in the implementation of the \texttt{macro}
+% environment.)
+%
+% A mechanism for doing this is included as of prototype version~2.1.
+% \item
+% Examine how much more efficient it would be to put temporary
+% additions to the index exclude list in a separate list instead of
+% the main list. This could be advantageous for deeply nested
+% \texttt{macro} environments, as \TeX\ will otherwise store as many
+% (almost identical and often rather long) copies of the exclude list
+% as there are nested environments.
+%
+% When asked about it, Frank Mittelbach didn't think there was
+% any gains worth mentioning in this. On the other hand it might be
+% worth investigating reimplementations that avoid calling |\trivlist|
+% at the beginning of each \texttt{macro}-like environment when they
+% are nested, since |\trivlist| does quite a lot of assignments.
+%
+% \item
+% In an automatically generated index one often faces the problem
+% that the entries at the innermost level are best formatted in one
+% way when there is only one, but in a completely different way when
+% there are several of them. To get optimal formatting in both cases,
+% one would like to let the |\item|, |\subitem|, |\subsubitem| or
+% corresponding macros detect the situation in this respect and
+% choose the optimal formatting at each case.
+%
+% A mechanism for this is implemented by the \package{docindex}
+% package.
+% \end{itemize}
+%
+%
+% \begin{thebibliography}{9}
+% \bibitem{ltxdoc}
+% David Carlisle:
+% \textit{The file \texttt{ltxdoc.dtx} for use with \LaTeXe},
+% The \LaTeX3 Project; ^^A , 1993~ff.
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{ltxdoc.dtx}.
+% \bibitem{docindex}
+% Lars Hellstr\"om:
+% \textit{The \package{docindex} package}, 2001,
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{exptl}\slash \texttt{xdoc}\slash
+% \texttt{docindex.dtx}.
+% \bibitem{fontinst}
+% Alan Jeffrey, Sebastian Rahtz, Ulrik Vieth (and as of v\,1.9 Lars
+% Hellstr\"om): \textit{The \package{fontinst} utility}, v\,1.8~ff.,
+% documented source code,
+% \textsc{ctan}:\discretionary{}{}{\thinspace}^^A
+% \texttt{fonts}\slash \texttt{utilities}\slash
+% \texttt{fontinst}\slash \texttt{source}/
+% \bibitem{clsguide}
+% The \LaTeX3 Project:
+% \textit{\LaTeXe~for class and package writers},
+% The \LaTeX3 Project; ^^A , 1995~ff.
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{clsguide.tex}.
+% \bibitem{doc}
+% Frank Mittelbach, B.~Hamilton Kelly, Andrew Mills, Dave Love, and
+% Joachim \mbox{Schrod}: \textit{The \package{doc} and
+% \package{shortvrb} Packages}, The \LaTeX3 Project; ^^A , 1993~ff.
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{doc.dtx}.
+% \bibitem{xparse}
+% Frank Mittelbach, Chris Rowley, and David Carlisle: \textit{The
+% \package{xparse} package}, The \LaTeX3 Project, 1999. Currently
+% not available by anonymous FTP, but available by HTTP from
+% \texttt{www.latex-project.org} (look for ``experimental code'').
+% \end{thebibliography}
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.ins b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.ins
new file mode 100644
index 00000000000..ff4eb64bc5a
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.ins
@@ -0,0 +1,37 @@
+% This file is the docstrip installation script for the xdoc2 package.
+%
+% It may be distributed 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.
+%
+% Copyright 2000 2001 Lars Hellstr\"om
+
+\input docstrip
+
+\keepsilent
+
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+\endpreamble
+
+\usedir{tex/latex/misc}
+\generate{\file{xdoc2.sty}{\from{xdoc2.dtx}{pkg,xdoc2}}}
+
+\endbatchfile
+\end
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.pdf b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.pdf
new file mode 100644
index 00000000000..c71ef7aac30
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/xdoc2.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.pdf b/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.pdf
new file mode 100644
index 00000000000..a368decfbc3
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.tex b/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.tex
new file mode 100644
index 00000000000..026afcb9fb8
--- /dev/null
+++ b/Master/texmf-dist/source/fontinst/base/xdoc/xdocdemo.tex
@@ -0,0 +1,2599 @@
+%%
+%% This file 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.
+%%
+%% Copyright 2000 2003 Lars Hellstr\"om
+%%
+\documentclass[twoside]{ltxdoc}
+\usepackage[dolayout]{xdoc2}
+
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+
+% I redefine theindex environment so that I can use floats normally
+% inside it. Inside the multicolumn environment the float mechanism
+% performs worse. This is the non-multicol definition from doc:
+\makeatletter
+\renewenvironment{theindex}{%
+ \@restonecoltrue
+ \if@twocolumn\@restonecolfalse\fi
+ \columnseprule \z@
+ \columnsep 35\p@
+ \twocolumn[\index@prologue]%
+ \IndexParms
+ \let\item\@idxitem
+ \ignorespaces
+}{\if@restonecol\onecolumn\else\clearpage\fi}
+\makeatother
+
+\begin{document}
+
+\begin{abstract}
+ This document contains some demonstrations of features in the
+ \package{xdoc} package. It's not particularly organised, though.
+\end{abstract}
+
+\section{Describing control sequence families}
+
+The following piece of code is from the source for \package{fontinst}:
+\begin{verbatim}
+ The kerning information is kept in the macros
+ \describecsfamily{l-\meta{name}}|\l-|\meta{name} and
+ \describecsfamily{r-\meta{name}}|\r-|\meta{name}, containing
+ information about how \meta{name} kerns on the left and on the right,
+ respectively. The |\l-|\meta{name} macro should expand out to a
+ series of
+ \begin{quote}
+ \DescribeMacro{\k}|\k|\,|\r-|\meta{name}\,|\|\meta{amount}
+ \end{quote}
+ control sequences, and vice versa. Examples of
+ \describecsfamily{\meta{amount}} |\|\meta{amount}
+ control sequences are: |\0|, |\1|, |\1000|, |\-50|, |\33|; these
+ corresponds to the kern amounts $0$, $1$, $1000$ (which would be
+ a very large kern), $-50$, and $33$ respectively.
+\end{verbatim}
+Now I'm going to write that it typesets as what follows below, but it
+looks better if this paragraph is a couple of lines long, since that
+enables one to see where the right margin actually begins. But that
+seems to be long enough. Thus:
+It typesets as
+\begin{quote}
+ The kerning information is kept in the macros
+ \describecsfamily{l-\meta{name}}|\l-|\meta{name} and
+ \describecsfamily{r-\meta{name}}|\r-|\meta{name}, containing
+ information about how \meta{name} kerns on the left and on the right,
+ respectively. The |\l-|\meta{name} macro should expand out to a
+ series of
+ \begin{quote}
+ \DescribeMacro{\k}|\k|\,|\r-|\meta{name}\,|\|\meta{amount}
+ \end{quote}
+ control sequences, and vice versa. Examples of
+ \describecsfamily{\meta{amount}} |\|\meta{amount}
+ control sequences are: |\0|, |\1|, |\1000|, |\-50|, |\33|; these
+ corresponds to the kern amounts $0$, $1$, $1000$ (which would be
+ a very large kern), $-50$, and $33$ respectively.
+\end{quote}
+
+
+\section{Defining new \texttt{macro}-like environments}
+
+Another example from \package{fontinst}---the \package{fisource}
+package (v\,2.02) contains the command
+\begin{verbatim}
+\NewMacroEnvironment{fistring}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1 \normalfont string}%
+ {\XDMainIndex{\levelsorted{#1 I}{\texttt{#1} (string)}}%
+ \XDMainIndex{\levelsame{strings:}\levelsorted{#1}{\texttt{#1}}}}%
+ {{#1}{\texttt{#1} string}}%
+ {}
+\end{verbatim}
+which defines a new \texttt{macro}-like environment called
+\texttt{fistring} (for \package{fontinst} string variable). The fourth
+argument above specifies how the marginal heading should be formatted,
+the fifth argument specifies which index entries should be made on
+account of this environment, and the sixth argument gives the list of
+changes heading (and its sorting) that should be used inside this
+\texttt{macro}-like environment.
+
+\makeatletter
+\NewMacroEnvironment{fistring}{\XD@grab@harmless\relax}{1}%
+ {\MacroFont#1 \normalfont string}%
+ {\XDMainIndex{\levelsorted{#1 I}{\texttt{#1} (string)}}%
+ \XDMainIndex{\levelsame{strings:}\levelsorted{#1}{\texttt{#1}}}}%
+ {{#1}{\texttt{#1} string}}%
+ {}
+\makeatother
+
+\MakePercentIgnore
+% With the command defined, the code
+%\begin{verbatim}
+%% \begin{macro}{\make_pltotf}
+%% \begin{fistring}{TFMfileprefix}
+%% |\make_pltotf| writes a \package{PLtoTF} command for converting the
+%% current font's PL file to a TFM file. If set, the string
+%% \texttt{TFMfileprefix} will be prepended to the TFM file name---this
+%% could be used for putting the TFMs in some directory other than the
+%% current.
+%% \begin{macrocode}
+%\def\make_pltotf{
+% \pout_line\output_pltotf{pltotf~\TeX_font_name.pl~
+% \ifisstr{TFMfileprefix}\then \str{TFMfileprefix}\fi
+% \TeX_font_name.tfm
+% }
+%}
+%% \end{macrocode}
+%% \end{fistring}\end{macro}
+%\end{verbatim}
+% will print as
+%
+% \begin{macro}{\make_pltotf}
+% \begin{fistring}{TFMfileprefix}
+% |\make_pltotf| writes a \package{PLtoTF} command for converting the
+% current font's PL file to a TFM file. If set, the string
+% \texttt{TFMfileprefix} will be prepended to the TFM file name---this
+% could be used for putting the TFMs in some directory other than the
+% current.
+% \begin{macrocode}
+\def\make_pltotf{
+ \pout_line\output_pltotf{pltotf~\TeX_font_name.pl~
+ \ifisstr{TFMfileprefix}\then \str{TFMfileprefix}\fi
+ \TeX_font_name.tfm
+ }
+}
+% \end{macrocode}
+% \end{fistring}\end{macro}
+%
+\MakePercentComment
+
+\clearpage
+
+\section{Two-sided printing}
+
+As you may have noticed, marginal material has so far consistently
+been put in the \emph{outer} margin, but the examples so far given of
+such material that appears in the right margin have been restricted
+to marginal material made via the |\marginpar| command (in various
+disguises), and that isn't so hard to achieve. It's much harder to
+achieve it for marginal material produced as list item labels, so here
+are a few examples to illustrate that it works for these as well. (The
+filling up text is taken from the \package{fontsmpl} package in the
+Tools bundle.)
+
+\vspace*{0.5\textheight}
+
+(A bit of space to put the text near the page break.)
+
+% Hacks to ensure that some marginal text is positioned before the
+% previous page is output.
+\begingroup
+\interlinepenalty=500
+\setlength\MacroTopsep{1\MacroTopsep plus 3\MacroTopsep}
+
+\begin{environment}{Stanford}
+ On November 14, 1885, Senator \& Mrs.~Leland Stanford called
+ together at their San Francisco mansion the 24~prominent men who
+ had been chosen as the first trustees of The Leland Stanford
+ Junior University.
+\end{environment}
+
+\begin{environment}{charter}
+ They handed to the board the Founding Grant
+ of the University, which they had executed three days before.
+ This document---with various amendments, legislative acts, and
+ court decrees---remains as the University's charter.
+\end{environment}
+
+\begin{environment}{objectives}
+ In bold, sweeping language it stipulates that the objectives of the
+ University are ``to qualify students for personal success and
+ direct usefulness in life;
+\end{environment}
+
+\begin{environment}{continuation}
+ and to promote the publick welfare by
+ exercising an influence in behalf of humanity and civilization,
+ teaching the blessings of liberty regulated by law, and
+ inculcating love and reverence for the great principles of
+ government as derived from the inalienable rights of man to life,
+ liberty, and the pursuit of happiness.''
+\end{environment}
+
+\begin{environment}{CAPITALS}
+ (!`THE DAZED BROWN FOX QUICKLY GAVE 12345--67890 JUMPS!)'
+\end{environment}
+
+\begin{environment}{accents-and-such}
+ ?`But aren't Kafka's Schlo\ss\
+ and \AE sop's \OE uvres often na\"\i ve vis-\`a-vis the
+ d\ae monic ph\oe nix's official r\^ole in fluffy s\t ouffl\'es?
+\end{environment}
+
+\endgroup
+
+As you might have noticed, the first marginal heading on this page was
+put on the wrong side the first time the document was typeset. This is
+however corrected the next time the document is typeset, and the
+\package{xdoc} package gave a warning about it at the end of the run.
+
+
+\section{An enriched index}
+
+The following index was automatically generated for copies of the
+files \texttt{ltoutenc.dtx} and \texttt{cyoutenc.dtx} to which had
+been added some extra markup. Most of that extra markup consisted of
+\texttt{enccommand} and \texttt{enccomposite} environments (the
+definitions of which can be found in Subsection~8.4 of
+\texttt{xdoc2.dtx}), but I also added a couple of |\Describe|\-|Macro|
+and |\describe|\-|cs|\-|family| commands where it seemed suitable.
+
+
+\let\listenvironmentitem=\item
+
+
+ \begin{theindex}
+ \makeatletter\scan@allowedfalse
+{\bfseries\hfil Symbols\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}"}\pfill a-371, a-475, a-666
+ \subitem default\pfill \main{a-176}
+ \subitem \texttt {OT1} encoding\pfill \main{a-335}
+ \subitem \texttt {OT4} encoding\pfill \main{a-623}
+ \subitem \texttt {T1} encoding\pfill \main{a-407}
+ \subsubitem \texttt {A} composite\pfill \main{a-541}
+ \subsubitem \texttt {a} composite\pfill \main{a-567}
+ \subsubitem \texttt {E} composite\pfill \main{a-547}
+ \subsubitem \texttt {e} composite\pfill \main{a-573}
+ \subsubitem \texttt {I} composite\pfill \main{a-551}
+ \subsubitem \texttt {i} composite\pfill \main{a-580}
+ \subsubitem \texttt {\PrintChar{092}i} composite\pfill
+ \main{a-581}
+ \subsubitem \texttt {O} composite\pfill \main{a-557}
+ \subsubitem \texttt {o} composite\pfill \main{a-587}
+ \subsubitem \texttt {U} composite\pfill \main{a-561}
+ \subsubitem \texttt {u} composite\pfill \main{a-591}
+ \subsubitem \texttt {Y} composite\pfill \main{a-506}
+ \subsubitem \texttt {y} composite\pfill \main{a-533}
+ \subitem \texttt {T2A} encoding\pfill \main{b-17}
+ \subsubitem \texttt {\PrintChar{092}CYRE} composite\pfill
+ \main{b-441}
+ \subsubitem \texttt {\PrintChar{092}cyre} composite\pfill
+ \main{b-442}
+ \subsubitem \texttt {\PrintChar{092}CYRII} composite\pfill
+ \main{b-445}
+ \subsubitem \texttt {\PrintChar{092}cyrii} composite\pfill
+ \main{b-447}
+ \subitem \texttt {T2B} encoding\pfill \main{b-17}
+ \subsubitem \texttt {\PrintChar{092}CYRE} composite\pfill
+ \main{b-441}
+ \subsubitem \texttt {\PrintChar{092}cyre} composite\pfill
+ \main{b-442}
+ \subitem \texttt {T2C} encoding\pfill \main{b-17}
+ \subsubitem \texttt {\PrintChar{092}CYRE} composite\pfill
+ \main{b-441}
+ \subsubitem \texttt {\PrintChar{092}cyre} composite\pfill
+ \main{b-442}
+ \subitem \texttt {X2} encoding\pfill \main{b-17}
+ \subsubitem \texttt {\PrintChar{092}CYRE} composite\pfill
+ \main{b-441}
+ \subsubitem \texttt {\PrintChar{092}cyre} composite\pfill
+ \main{b-442}
+ \subsubitem \texttt {\PrintChar{092}CYRII} composite\pfill
+ \main{b-445}
+ \subsubitem \texttt {\PrintChar{092}cyrii} composite\pfill
+ \main{b-447}
+ \item \texttt {\PrintChar{092}'}\pfill a-373, a-477, a-668
+ \subitem default\pfill \main{a-177}
+ \subitem \texttt {OT1} encoding\pfill \main{a-336}
+ \subitem \texttt {OT4} encoding\pfill \main{a-624}
+ \subsubitem \texttt {C} composite\pfill \main{a-687}
+ \subsubitem \texttt {c} composite\pfill \main{a-694}
+ \subsubitem \texttt {N} composite\pfill \main{a-689}
+ \subsubitem \texttt {n} composite\pfill \main{a-696}
+ \subsubitem \texttt {O} composite\pfill \main{a-700}
+ \subsubitem \texttt {o} composite\pfill \main{a-701}
+ \subsubitem \texttt {S} composite\pfill \main{a-690}
+ \subsubitem \texttt {s} composite\pfill \main{a-697}
+ \subsubitem \texttt {Z} composite\pfill \main{a-691}
+ \subsubitem \texttt {z} composite\pfill \main{a-698}
+ \subitem \texttt {T1} encoding\pfill \main{a-404}
+ \subsubitem \texttt {A} composite\pfill \main{a-538}
+ \subsubitem \texttt {a} composite\pfill \main{a-564}
+ \subsubitem \texttt {C} composite\pfill \main{a-486}
+ \subsubitem \texttt {c} composite\pfill \main{a-513}
+ \subsubitem \texttt {E} composite\pfill \main{a-545}
+ \subsubitem \texttt {e} composite\pfill \main{a-571}
+ \subsubitem \texttt {I} composite\pfill \main{a-549}
+ \subsubitem \texttt {i} composite\pfill \main{a-576}
+ \subsubitem \texttt {\PrintChar{092}i} composite\pfill
+ \main{a-577}
+ \subsubitem \texttt {L} composite\pfill \main{a-492}
+ \subsubitem \texttt {l} composite\pfill \main{a-519}
+ \subsubitem \texttt {N} composite\pfill \main{a-494}
+ \subsubitem \texttt {n} composite\pfill \main{a-521}
+ \subsubitem \texttt {O} composite\pfill \main{a-554}
+ \subsubitem \texttt {o} composite\pfill \main{a-584}
+ \subsubitem \texttt {R} composite\pfill \main{a-497}
+ \subsubitem \texttt {r} composite\pfill \main{a-524}
+ \subsubitem \texttt {S} composite\pfill \main{a-499}
+ \subsubitem \texttt {s} composite\pfill \main{a-526}
+ \subsubitem \texttt {U} composite\pfill \main{a-559}
+ \subsubitem \texttt {u} composite\pfill \main{a-589}
+ \subsubitem \texttt {Y} composite\pfill \main{a-562}
+ \subsubitem \texttt {y} composite\pfill \main{a-592}
+ \subsubitem \texttt {Z} composite\pfill \main{a-507}
+ \subsubitem \texttt {z} composite\pfill \main{a-534}
+ \subitem \texttt {T2A} encoding\pfill \main{b-14}
+ \subitem \texttt {T2B} encoding\pfill \main{b-14}
+ \subitem \texttt {T2C} encoding\pfill \main{b-14}
+ \subitem \texttt {X2} encoding\pfill \main{b-14}
+ \item \texttt {\MetaNormalfont \PrintChar{092}\meta {encoding}-cmd}\pfill
+ \usage{6}
+ \item \texttt {\MetaNormalfont \PrintChar{092}\meta {encoding}\PrintChar{092}\meta {command}}\pfill
+ \usage{6}
+ \item \texttt {\PrintChar{092}-}\pfill a-367, a-368, a-470,
+ a-662, a-663
+ \item \texttt {\PrintChar{092}.}\efill
+ \subitem default\pfill \main{a-178}
+ \subitem \texttt {OT1} encoding\pfill \main{a-337}
+ \subitem \texttt {OT4} encoding\pfill \main{a-625}
+ \subsubitem \texttt {Z} composite\pfill \main{a-692}
+ \subsubitem \texttt {z} composite\pfill \main{a-699}
+ \subitem \texttt {T1} encoding\pfill \main{a-413}
+ \subsubitem \texttt {I} composite\pfill \main{a-510}
+ \subsubitem \texttt {i} composite\pfill \main{a-483}
+ \subsubitem \texttt {Z} composite\pfill \main{a-509}
+ \subsubitem \texttt {z} composite\pfill \main{a-536}
+ \subitem \texttt {T2A} encoding\pfill \main{b-23}
+ \subsubitem \texttt {i} composite\pfill \main{b-75}
+ \subitem \texttt {T2B} encoding\pfill \main{b-23}
+ \subsubitem \texttt {i} composite\pfill \main{b-75}
+ \subitem \texttt {T2C} encoding\pfill \main{b-23}
+ \subsubitem \texttt {i} composite\pfill \main{b-75}
+ \subitem \texttt {X2} encoding\pfill \main{b-23}
+ \subsubitem \texttt {i} composite\pfill \main{b-75}
+ \item \texttt {\PrintChar{092}<}\pfill a-471, a-616
+ \item \texttt {\MetaNormalfont \PrintChar{092}?\PrintChar{092}\meta {command}}\pfill
+ \usage{6}
+ \item \texttt {\PrintChar{092}\PrintChar{036}}\pfill a-251, a-392,
+ a-399, a-464, a-678, a-685
+ \item \texttt {\PrintChar{092}\PrintChar{037}}\pfill a-427, a-429,
+ b-39, b-41
+ \item \texttt {\PrintChar{092}\PrintChar{061}}\efill
+ \subitem default\pfill \main{a-179}
+ \subitem \texttt {OT1} encoding\pfill \main{a-338}
+ \subitem \texttt {OT4} encoding\pfill \main{a-626}
+ \subitem \texttt {T1} encoding\pfill \main{a-412}
+ \subitem \texttt {T2A} encoding\pfill \main{b-22}
+ \subitem \texttt {T2B} encoding\pfill \main{b-22}
+ \subitem \texttt {T2C} encoding\pfill \main{b-22}
+ \subitem \texttt {X2} encoding\pfill \main{b-22}
+ \item \texttt {\PrintChar{092}\PrintChar{062}}\pfill a-468, a-617
+ \item \texttt {\PrintChar{092}\PrintChar{092}}\pfill a-459
+ \item \texttt {\MetaNormalfont \PrintChar{092}\PrintChar{092}\meta {enc}\PrintChar{092}\meta {cmd}-\meta {arg}}\pfill
+ \usage{8}
+ \item \texttt {\PrintChar{092}\PrintChar{094}}\pfill a-233, a-457
+ \subitem default\pfill \main{a-181}
+ \subitem \texttt {OT1} encoding\pfill \main{a-339}
+ \subitem \texttt {OT4} encoding\pfill \main{a-627}
+ \subitem \texttt {T1} encoding\pfill \main{a-405}
+ \subsubitem \texttt {A} composite\pfill \main{a-539}
+ \subsubitem \texttt {a} composite\pfill \main{a-565}
+ \subsubitem \texttt {E} composite\pfill \main{a-546}
+ \subsubitem \texttt {e} composite\pfill \main{a-572}
+ \subsubitem \texttt {I} composite\pfill \main{a-550}
+ \subsubitem \texttt {i} composite\pfill \main{a-578}
+ \subsubitem \texttt {\PrintChar{092}i} composite\pfill
+ \main{a-579}
+ \subsubitem \texttt {O} composite\pfill \main{a-555}
+ \subsubitem \texttt {o} composite\pfill \main{a-585}
+ \subsubitem \texttt {U} composite\pfill \main{a-560}
+ \subsubitem \texttt {u} composite\pfill \main{a-590}
+ \subitem \texttt {T2A} encoding\pfill \main{b-15}
+ \subitem \texttt {T2B} encoding\pfill \main{b-15}
+ \subitem \texttt {T2C} encoding\pfill \main{b-15}
+ \subitem \texttt {X2} encoding\pfill \main{b-15}
+ \begin{figure*}
+ A verbatim extract from the index (without \textsf{docidx2e}):
+
+ \let\item=\listenvironmentitem
+ \expandafter\def \expandafter\MacroFont \expandafter{%
+ \MacroFont\footnotesize}
+ \begin{list}{}{\setlength{\leftmargin}{-0.5\marginparwidth}}
+ \item[]
+\begin{verbatim}
+ \item \texttt {\PrintChar{092}\PrintChar{061}}\efill
+ \subitem default\pfill \main{a-179}
+ \subitem \texttt {OT1} encoding\pfill \main{a-338}
+ \subitem \texttt {OT4} encoding\pfill \main{a-626}
+ \subitem \texttt {T1} encoding\pfill \main{a-412}
+ \subitem \texttt {T2A} encoding\pfill \main{b-22}
+ \subitem \texttt {T2B} encoding\pfill \main{b-22}
+ \subitem \texttt {T2C} encoding\pfill \main{b-22}
+ \subitem \texttt {X2} encoding\pfill \main{b-22}
+ \item \texttt {\PrintChar{092}\PrintChar{062}}\pfill a-468, a-617
+ \item \texttt {\PrintChar{092}\PrintChar{092}}\pfill a-459
+ \item \texttt {\MetaNormalfont \PrintChar{092}\PrintChar{092}\meta {enc}\PrintChar{092}\meta {cmd}-\meta {arg}}\pfill
+ \usage{8}
+ \item \texttt {\PrintChar{092}\PrintChar{094}}\pfill a-233, a-457
+ \subitem default\pfill \main{a-181}
+ \subitem \texttt {OT1} encoding\pfill \main{a-339}
+ \subitem \texttt {OT4} encoding\pfill \main{a-627}
+ \subitem \texttt {T1} encoding\pfill \main{a-405}
+ \subsubitem \texttt {A} composite\pfill \main{a-539}
+ \subsubitem \texttt {a} composite\pfill \main{a-565}
+ \subsubitem \texttt {E} composite\pfill \main{a-546}
+ \subsubitem \texttt {e} composite\pfill \main{a-572}
+ \subsubitem \texttt {I} composite\pfill \main{a-550}
+ \subsubitem \texttt {i} composite\pfill \main{a-578}
+ \subsubitem \texttt {\PrintChar{092}i} composite\pfill
+ \main{a-579}
+ \subsubitem \texttt {O} composite\pfill \main{a-555}
+ \subsubitem \texttt {o} composite\pfill \main{a-585}
+ \subsubitem \texttt {U} composite\pfill \main{a-560}
+ \subsubitem \texttt {u} composite\pfill \main{a-590}
+ \subitem \texttt {T2A} encoding\pfill \main{b-15}
+ \subitem \texttt {T2B} encoding\pfill \main{b-15}
+ \subitem \texttt {T2C} encoding\pfill \main{b-15}
+ \subitem \texttt {X2} encoding\pfill \main{b-15}
+ \item \texttt {\PrintChar{092}\PrintChar{095}}\pfill a-258
+ \item \texttt {\PrintChar{092}\PrintChar{123}}\pfill a-252, a-461
+ \item \texttt {\PrintChar{092}\PrintChar{124}}\pfill a-460
+ \item \texttt {\PrintChar{092}\PrintChar{125}}\pfill a-253, a-462
+ \item \texttt {\PrintChar{092}\PrintChar{126}}\pfill a-234, a-458
+ \subitem default\pfill \main{a-189}
+ \subitem \texttt {OT1} encoding\pfill \main{a-341}
+ \subitem \texttt {OT4} encoding\pfill \main{a-629}
+ \subitem \texttt {T1} encoding\pfill \main{a-406}
+ \subsubitem \texttt {A} composite\pfill \main{a-540}
+ \subsubitem \texttt {a} composite\pfill \main{a-566}
+ \subsubitem \texttt {N} composite\pfill \main{a-552}
+ \subsubitem \texttt {n} composite\pfill \main{a-582}
+ \subsubitem \texttt {O} composite\pfill \main{a-556}
+ \subsubitem \texttt {o} composite\pfill \main{a-586}
+ \subitem \texttt {T2A} encoding\pfill \main{b-16}
+ \subitem \texttt {T2B} encoding\pfill \main{b-16}
+ \subitem \texttt {T2C} encoding\pfill \main{b-16}
+ \subitem \texttt {X2} encoding\pfill \main{b-16}
+\end{verbatim}
+ \end{list}
+ \end{figure*}
+ \begin{figure*}
+ A verbatim extract from the index (with \textsf{docidx2e}):
+
+ \let\item=\listenvironmentitem
+ \expandafter\def \csname macro@font\expandafter\endcsname
+ \expandafter{\MacroFont\footnotesize}
+ \csname codeline@indexfalse\endcsname
+ \begin{list}{}{%
+ \setlength{\leftmargin}{-0.5\marginparwidth}%
+ \setlength{\topsep}{0pt}%
+ }
+ \item[]
+\begin{macrocode}
+\indexitem{1}{\texttt {\PrintChar{092}\PrintChar{095}}}{9}{a\+258}{1}
+\indexitem{1}{\texttt {\PrintChar{092}\PrintChar{123}}}{9}{a\+252,
+ a\+461}{1}
+\indexitem{1}{\texttt {\PrintChar{092}\PrintChar{124}}}{9}{a\+460}{1}
+\indexitem{1}{\texttt {\PrintChar{092}\PrintChar{125}}}{9}{a\+253,
+ a\+462}{1}
+\indexitem{1}{\texttt {\PrintChar{092}\PrintChar{126}}}{9}{a\+234,
+ a\+458}{2}
+ \indexitem{2}{default}{9}{\main{a\+189}}{2}
+ \indexitem{2}{\texttt {OT1} encoding}{9}{\main{a\+341}}{2}
+ \indexitem{2}{\texttt {OT4} encoding}{9}{\main{a\+629}}{2}
+ \indexitem{2}{\texttt {T1} encoding}{9}{\main{a\+406}}{3}
+ \indexitem{3}{\texttt {A} composite}{9}{\main{a\+540}}{3}
+ \indexitem{3}{\texttt {a} composite}{9}{\main{a\+566}}{3}
+ \indexitem{3}{\texttt {N} composite}{9}{\main{a\+552}}{3}
+ \indexitem{3}{\texttt {n} composite}{9}{\main{a\+582}}{3}
+ \indexitem{3}{\texttt {O} composite}{9}{\main{a\+556}}{3}
+ \indexitem{3}{\texttt {o} composite}{9}{\main{a\+586}}{2}
+ \indexitem{2}{\texttt {T2A} encoding}{9}{\main{b\+16}}{2}
+ \indexitem{2}{\texttt {T2B} encoding}{9}{\main{b\+16}}{2}
+ \indexitem{2}{\texttt {T2C} encoding}{9}{\main{b\+16}}{2}
+ \indexitem{2}{\texttt {X2} encoding}{9}{\main{b\+16}}{1}
+\indexitem{1}{\texttt {\PrintChar{092}`}}{9}{a\+372, a\+476,
+ a\+667}{2}
+ \indexitem{2}{default}{9}{\main{a\+182}}{2}
+ \indexitem{2}{\texttt {OT1} encoding}{9}{\main{a\+340}}{2}
+ \indexitem{2}{\texttt {OT4} encoding}{9}{\main{a\+628}}{2}
+ \indexitem{2}{\texttt {T1} encoding}{9}{\main{a\+403}}{3}
+ \indexitem{3}{\texttt {A} composite}{9}{\main{a\+537}}{3}
+ \indexitem{3}{\texttt {a} composite}{9}{\main{a\+563}}{3}
+ \indexitem{3}{\texttt {E} composite}{9}{\main{a\+544}}{3}
+ \indexitem{3}{\texttt {e} composite}{9}{\main{a\+570}}{3}
+ \indexitem{3}{\texttt {I} composite}{9}{\main{a\+548}}{3}
+ \indexitem{3}{\texttt {i} composite}{9}{\main{a\+574}}{3}
+ \indexitem{3}{\texttt {\PrintChar{092}i} composite}{9}{
+ \main{a\+575}}{3}
+ \indexitem{3}{\texttt {O} composite}{9}{\main{a\+553}}{3}
+ \indexitem{3}{\texttt {o} composite}{9}{\main{a\+583}}{3}
+ \indexitem{3}{\texttt {U} composite}{9}{\main{a\+558}}{3}
+ \indexitem{3}{\texttt {u} composite}{9}{\main{a\+588}}{2}
+ \indexitem{2}{\texttt {T2A} encoding}{9}{\main{b\+13}}{2}
+ \indexitem{2}{\texttt {T2B} encoding}{9}{\main{b\+13}}{2}
+ \indexitem{2}{\texttt {T2C} encoding}{9}{\main{b\+13}}{2}
+ \indexitem{2}{\texttt {X2} encoding}{9}{\main{b\+13}}{0}
+%^^A
+\indexnewletter{0}{A}{1}
+\indexitem{1}{\texttt {\PrintChar{092}a}}{9}{\main{a\+173}}{1}
+\indexitem{1}{\texttt {\PrintChar{092}AA}}{9}{a\+190, a\+380,
+ a\+430}{1}
+\indexitem{1}{\texttt {\PrintChar{092}aa}}{9}{a\+195, a\+374,
+ a\+440}{1}
+\indexitem{1}{\texttt {\PrintChar{092}accent}}{9}{a\+71, a\+350,
+ a\+375, a\+418, a\+640, b\+31}{1}
+% \end{macrocode}
+ \end{list}
+ \end{figure*}
+ \item \texttt {\PrintChar{092}\PrintChar{095}}\pfill a-258
+ \item \texttt {\PrintChar{092}\PrintChar{123}}\pfill a-252, a-461
+ \item \texttt {\PrintChar{092}\PrintChar{124}}\pfill a-460
+ \item \texttt {\PrintChar{092}\PrintChar{125}}\pfill a-253, a-462
+ \item \texttt {\PrintChar{092}\PrintChar{126}}\pfill a-234, a-458
+ \subitem default\pfill \main{a-189}
+ \subitem \texttt {OT1} encoding\pfill \main{a-341}
+ \subitem \texttt {OT4} encoding\pfill \main{a-629}
+ \subitem \texttt {T1} encoding\pfill \main{a-406}
+ \subsubitem \texttt {A} composite\pfill \main{a-540}
+ \subsubitem \texttt {a} composite\pfill \main{a-566}
+ \subsubitem \texttt {N} composite\pfill \main{a-552}
+ \subsubitem \texttt {n} composite\pfill \main{a-582}
+ \subsubitem \texttt {O} composite\pfill \main{a-556}
+ \subsubitem \texttt {o} composite\pfill \main{a-586}
+ \subitem \texttt {T2A} encoding\pfill \main{b-16}
+ \subitem \texttt {T2B} encoding\pfill \main{b-16}
+ \subitem \texttt {T2C} encoding\pfill \main{b-16}
+ \subitem \texttt {X2} encoding\pfill \main{b-16}
+ \item \texttt {\PrintChar{092}`}\pfill a-372, a-476, a-667
+ \subitem default\pfill \main{a-182}
+ \subitem \texttt {OT1} encoding\pfill \main{a-340}
+ \subitem \texttt {OT4} encoding\pfill \main{a-628}
+ \subitem \texttt {T1} encoding\pfill \main{a-403}
+ \subsubitem \texttt {A} composite\pfill \main{a-537}
+ \subsubitem \texttt {a} composite\pfill \main{a-563}
+ \subsubitem \texttt {E} composite\pfill \main{a-544}
+ \subsubitem \texttt {e} composite\pfill \main{a-570}
+ \subsubitem \texttt {I} composite\pfill \main{a-548}
+ \subsubitem \texttt {i} composite\pfill \main{a-574}
+ \subsubitem \texttt {\PrintChar{092}i} composite\pfill
+ \main{a-575}
+ \subsubitem \texttt {O} composite\pfill \main{a-553}
+ \subsubitem \texttt {o} composite\pfill \main{a-583}
+ \subsubitem \texttt {U} composite\pfill \main{a-558}
+ \subsubitem \texttt {u} composite\pfill \main{a-588}
+ \subitem \texttt {T2A} encoding\pfill \main{b-13}
+ \subitem \texttt {T2B} encoding\pfill \main{b-13}
+ \subitem \texttt {T2C} encoding\pfill \main{b-13}
+ \subitem \texttt {X2} encoding\pfill \main{b-13}
+
+ \indexspace
+{\bfseries\hfil A\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}a}\pfill \main{a-173}
+ \item \texttt {\PrintChar{092}AA}\pfill a-190, a-380, a-430
+ \item \texttt {\PrintChar{092}aa}\pfill a-195, a-374, a-440
+ \item \texttt {\PrintChar{092}accent}\pfill a-71, a-350, a-375,
+ a-418, a-640, b-31
+ \item \texttt {\PrintChar{092}accent@spacefactor}\pfill a-70--a-72
+ \item \texttt {\PrintChar{092}add@accent}\pfill a-65, \main{a-67}
+ \item \texttt {\PrintChar{092}AE}\efill
+ \subitem default\pfill \main{a-191}
+ \subitem \texttt {OT1} encoding\pfill \main{a-355}
+ \subitem \texttt {OT4} encoding\pfill \main{a-645}
+ \subitem \texttt {T1} encoding\pfill \main{a-431}
+ \item \texttt {\PrintChar{092}ae}\efill
+ \subitem default\pfill \main{a-196}
+ \subitem \texttt {OT1} encoding\pfill \main{a-358}
+ \subitem \texttt {OT4} encoding\pfill \main{a-649}
+ \subitem \texttt {T1} encoding\pfill \main{a-441}
+ \item \texttt {\PrintChar{092}afterassignment}\pfill a-162, a-170
+ \item \texttt {\PrintChar{092}@autoerr}\pfill a-51
+
+ \indexspace
+{\bfseries\hfil B\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}b}\efill
+ \subitem default\pfill \main{a-183}
+ \subitem \texttt {OT1} encoding\pfill \main{a-346}
+ \subitem \texttt {OT4} encoding\pfill \main{a-636}
+ \subitem \texttt {T1} encoding\pfill \main{a-414}
+ \subitem \texttt {T2A} encoding\pfill \main{b-27}
+ \subitem \texttt {T2B} encoding\pfill \main{b-27}
+ \subitem \texttt {T2C} encoding\pfill \main{b-27}
+ \subitem \texttt {X2} encoding\pfill \main{b-27}
+
+ \indexspace
+{\bfseries\hfil C\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}C}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-25}
+ \subitem \texttt {T2B} encoding\pfill \main{b-25}
+ \subitem \texttt {T2C} encoding\pfill \main{b-25}
+ \subitem \texttt {X2} encoding\pfill \main{b-25}
+ \item \texttt {\PrintChar{092}c}\efill
+ \subitem default\pfill \main{a-184}
+ \subitem \texttt {OT1} encoding\pfill \main{a-349}
+ \subitem \texttt {OT4} encoding\pfill \main{a-639}
+ \subitem \texttt {T1} encoding\pfill \main{a-417}
+ \subsubitem \texttt {C} composite\pfill \main{a-543}
+ \subsubitem \texttt {c} composite\pfill \main{a-569}
+ \subsubitem \texttt {S} composite\pfill \main{a-501}
+ \subsubitem \texttt {s} composite\pfill \main{a-528}
+ \subsubitem \texttt {T} composite\pfill \main{a-503}
+ \subsubitem \texttt {t} composite\pfill \main{a-530}
+ \subitem \texttt {T2A} encoding\pfill \main{b-30}
+ \subsubitem \texttt {\PrintChar{092}CYRZ} composite\pfill
+ \main{b-448}
+ \subsubitem \texttt {\PrintChar{092}cyrz} composite\pfill
+ \main{b-449}
+ \subitem \texttt {T2B} encoding\pfill \main{b-30}
+ \subitem \texttt {T2C} encoding\pfill \main{b-30}
+ \subitem \texttt {X2} encoding\pfill \main{b-30}
+ \subsubitem \texttt {\PrintChar{092}CYRZ} composite\pfill
+ \main{b-448}
+ \subsubitem \texttt {\PrintChar{092}cyrz} composite\pfill
+ \main{b-449}
+ \item \texttt {\PrintChar{092}capitalacute}\efill
+ \subitem default\pfill \main{a-848}
+ \subitem \texttt {TS1} encoding\pfill \main{a-713}
+ \item \texttt {\PrintChar{092}capitalbreve}\efill
+ \subitem default\pfill \main{a-855}
+ \subitem \texttt {TS1} encoding\pfill \main{a-720}
+ \item \texttt {\PrintChar{092}capitalcaron}\efill
+ \subitem default\pfill \main{a-854}
+ \subitem \texttt {TS1} encoding\pfill \main{a-719}
+ \item \texttt {\PrintChar{092}capitalcedilla}\efill
+ \subitem default\pfill \main{a-845}
+ \subitem \texttt {TS1} encoding\pfill \main{a-706}
+ \item \texttt {\PrintChar{092}capitalcircumflex}\efill
+ \subitem default\pfill \main{a-849}
+ \subitem \texttt {TS1} encoding\pfill \main{a-714}
+ \item \texttt {\PrintChar{092}capitaldieresis}\efill
+ \subitem default\pfill \main{a-851}
+ \subitem \texttt {TS1} encoding\pfill \main{a-716}
+ \item \texttt {\PrintChar{092}capitaldotaccent}\efill
+ \subitem default\pfill \main{a-857}
+ \subitem \texttt {TS1} encoding\pfill \main{a-722}
+ \item \texttt {\PrintChar{092}capitalgrave}\efill
+ \subitem default\pfill \main{a-847}
+ \subitem \texttt {TS1} encoding\pfill \main{a-712}
+ \item \texttt {\PrintChar{092}capitalhungarumlaut}\efill
+ \subitem default\pfill \main{a-852}
+ \subitem \texttt {TS1} encoding\pfill \main{a-717}
+ \item \texttt {\PrintChar{092}capitalmacron}\efill
+ \subitem default\pfill \main{a-856}
+ \subitem \texttt {TS1} encoding\pfill \main{a-721}
+ \item \texttt {\PrintChar{092}capitalnewtie}\efill
+ \subitem default\pfill \main{a-861}
+ \subitem \texttt {TS1} encoding\pfill \main{a-726}
+ \item \texttt {\PrintChar{092}capitalogonek}\efill
+ \subitem default\pfill \main{a-846}
+ \subitem \texttt {TS1} encoding\pfill \main{a-709}
+ \item \texttt {\PrintChar{092}capitalring}\efill
+ \subitem default\pfill \main{a-853}
+ \subitem \texttt {TS1} encoding\pfill \main{a-718}
+ \item \texttt {\PrintChar{092}capitaltie}\efill
+ \subitem default\pfill \main{a-859}
+ \subitem \texttt {TS1} encoding\pfill \main{a-724}
+ \item \texttt {\PrintChar{092}capitaltilde}\efill
+ \subitem default\pfill \main{a-850}
+ \subitem \texttt {TS1} encoding\pfill \main{a-715}
+ \item \texttt {\PrintChar{092}@car}\pfill a-77
+ \item \texttt {\PrintChar{092}cf@encoding}\pfill a-29, a-36, a-39,
+ a-48, a-114
+ \item \texttt {\PrintChar{092}@changed@cmd}\pfill \main{a-3}, a-63,
+ a-173
+ \item \texttt {\PrintChar{092}@changed@x}\pfill \main{a-3}, a-161,
+ a-169
+ \item \texttt {\PrintChar{092}@changed@x@mouth}\pfill a-161, a-169
+ \item \texttt {\PrintChar{092}char}\pfill a-348, a-351, a-382, a-385,
+ a-392, a-399, a-416, a-419, a-425, a-427, a-429, a-610,
+ a-638, a-641, a-671, a-678, a-685, a-708, a-711, a-759,
+ b-29, b-32, b-37, b-39, b-41
+ \item \texttt {\PrintChar{092}chardef}\pfill a-8
+ \item \texttt {\PrintChar{092}copyright}\pfill a-232, a-260
+ \item \texttt {\PrintChar{092}crcr}\pfill a-347, a-351, a-354, a-415,
+ a-420, a-423, a-425, a-609, a-637, a-641, a-644, a-708,
+ a-711, a-758, b-28, b-33, b-35, b-37
+ \item \texttt {\PrintChar{092}@curr@enc}\pfill a-114, a-116
+ \item \texttt {\PrintChar{092}curr@fontshape}\pfill a-130
+ \item \texttt {\PrintChar{092}@current@cmd}\pfill a-20
+ \item \texttt {\PrintChar{092}CurrentOption}\pfill a-300, a-302,
+ a-314
+ \item \texttt {\PrintChar{092}CYRA}\pfill a-272
+ \subitem \texttt {T2A} encoding\pfill \main{b-76}
+ \subitem \texttt {T2B} encoding\pfill \main{b-76}
+ \subitem \texttt {T2C} encoding\pfill \main{b-76}
+ \subitem \texttt {X2} encoding\pfill \main{b-76}
+ \item \texttt {\PrintChar{092}cyra}\pfill a-272, a-317
+ \subitem \texttt {T2A} encoding\pfill \main{b-77}
+ \subitem \texttt {T2B} encoding\pfill \main{b-77}
+ \subitem \texttt {T2C} encoding\pfill \main{b-77}
+ \subitem \texttt {X2} encoding\pfill \main{b-77}
+ \item \texttt {\PrintChar{092}CYRABHCH}\pfill a-272, b-458, b-462
+ \subitem \texttt {T2C} encoding\pfill \main{b-349}
+ \subitem \texttt {X2} encoding\pfill \main{b-381}
+ \item \texttt {\PrintChar{092}cyrabhch}\pfill a-272, b-459, b-463
+ \subitem \texttt {T2C} encoding\pfill \main{b-350}
+ \subitem \texttt {X2} encoding\pfill \main{b-382}
+ \item \texttt {\PrintChar{092}CYRABHCHDSC}\pfill a-272
+ \subitem \texttt {T2C} encoding\pfill \main{b-351}
+ \subitem \texttt {X2} encoding\pfill \main{b-383}
+ \item \texttt {\PrintChar{092}cyrabhchdsc}\pfill a-272
+ \subitem \texttt {T2C} encoding\pfill \main{b-352}
+ \subitem \texttt {X2} encoding\pfill \main{b-384}
+ \item \texttt {\PrintChar{092}CYRABHDZE}\pfill a-273
+ \subitem \texttt {T2B} encoding\pfill \main{b-271}
+ \subitem \texttt {T2C} encoding\pfill \main{b-329}
+ \subitem \texttt {X2} encoding\pfill \main{b-155}
+ \item \texttt {\PrintChar{092}cyrabhdze}\pfill a-272
+ \subitem \texttt {T2B} encoding\pfill \main{b-272}
+ \subitem \texttt {T2C} encoding\pfill \main{b-330}
+ \subitem \texttt {X2} encoding\pfill \main{b-156}
+ \item \texttt {\PrintChar{092}CYRABHHA}\pfill a-273
+ \subitem \texttt {T2C} encoding\pfill \main{b-361}
+ \subitem \texttt {X2} encoding\pfill \main{b-403}
+ \item \texttt {\PrintChar{092}cyrabhha}\pfill a-273
+ \subitem \texttt {T2C} encoding\pfill \main{b-362}
+ \subitem \texttt {X2} encoding\pfill \main{b-404}
+ \item \texttt {\PrintChar{092}CYRAE}\pfill a-273
+ \subitem \texttt {T2A} encoding\pfill \main{b-223}
+ \subitem \texttt {X2} encoding\pfill \main{b-374}
+ \item \texttt {\PrintChar{092}cyrae}\pfill a-273
+ \subitem \texttt {T2A} encoding\pfill \main{b-224}
+ \subitem \texttt {X2} encoding\pfill \main{b-376}
+ \item \texttt {\PrintChar{092}CYRB}\pfill a-273
+ \subitem \texttt {T2A} encoding\pfill \main{b-78}
+ \subitem \texttt {T2B} encoding\pfill \main{b-78}
+ \subitem \texttt {T2C} encoding\pfill \main{b-78}
+ \subitem \texttt {X2} encoding\pfill \main{b-78}
+ \item \texttt {\PrintChar{092}cyrb}\pfill a-273
+ \subitem \texttt {T2A} encoding\pfill \main{b-79}
+ \subitem \texttt {T2B} encoding\pfill \main{b-79}
+ \subitem \texttt {T2C} encoding\pfill \main{b-79}
+ \subitem \texttt {X2} encoding\pfill \main{b-79}
+ \item \texttt {\PrintChar{092}CYRBYUS}\pfill a-274
+ \subitem \texttt {X2} encoding\pfill \main{b-431}
+ \item \texttt {\PrintChar{092}cyrbyus}\pfill a-273
+ \subitem \texttt {X2} encoding\pfill \main{b-432}
+ \item \texttt {\PrintChar{092}CYRC}\pfill a-274
+ \subitem \texttt {T2A} encoding\pfill \main{b-120}
+ \subitem \texttt {T2B} encoding\pfill \main{b-120}
+ \subitem \texttt {T2C} encoding\pfill \main{b-120}
+ \subitem \texttt {X2} encoding\pfill \main{b-120}
+ \item \texttt {\PrintChar{092}cyrc}\pfill a-274
+ \subitem \texttt {T2A} encoding\pfill \main{b-121}
+ \subitem \texttt {T2B} encoding\pfill \main{b-121}
+ \subitem \texttt {T2C} encoding\pfill \main{b-121}
+ \subitem \texttt {X2} encoding\pfill \main{b-121}
+ \item \texttt {\PrintChar{092}CYRCH}\pfill a-274
+ \subitem \texttt {T2A} encoding\pfill \main{b-122}
+ \subitem \texttt {T2B} encoding\pfill \main{b-122}
+ \subitem \texttt {T2C} encoding\pfill \main{b-122}
+ \subitem \texttt {X2} encoding\pfill \main{b-122}
+ \item \texttt {\PrintChar{092}cyrch}\pfill a-274
+ \subitem \texttt {T2A} encoding\pfill \main{b-123}
+ \subitem \texttt {T2B} encoding\pfill \main{b-123}
+ \subitem \texttt {T2C} encoding\pfill \main{b-123}
+ \subitem \texttt {X2} encoding\pfill \main{b-123}
+ \item \texttt {\PrintChar{092}CYRCHLDSC}\pfill a-274
+ \subitem \texttt {T2B} encoding\pfill \main{b-303}
+ \subitem \texttt {X2} encoding\pfill \main{b-187}
+ \item \texttt {\PrintChar{092}cyrchldsc}\pfill a-274
+ \subitem \texttt {T2B} encoding\pfill \main{b-304}
+ \subitem \texttt {X2} encoding\pfill \main{b-188}
+ \item \texttt {\PrintChar{092}CYRCHRDSC}\pfill a-275
+ \subitem \texttt {T2A} encoding\pfill \main{b-247}
+ \subitem \texttt {T2B} encoding\pfill \main{b-305}
+ \subitem \texttt {T2C} encoding\pfill \main{b-363}
+ \subitem \texttt {X2} encoding\pfill \main{b-189}
+ \item \texttt {\PrintChar{092}cyrchrdsc}\pfill a-274
+ \subitem \texttt {T2A} encoding\pfill \main{b-248}
+ \subitem \texttt {T2B} encoding\pfill \main{b-306}
+ \subitem \texttt {T2C} encoding\pfill \main{b-364}
+ \subitem \texttt {X2} encoding\pfill \main{b-190}
+ \item \texttt {\PrintChar{092}CYRCHVCRS}\pfill a-275
+ \subitem \texttt {T2A} encoding\pfill \main{b-245}
+ \subitem \texttt {X2} encoding\pfill \main{b-423}
+ \item \texttt {\PrintChar{092}cyrchvcrs}\pfill a-275
+ \subitem \texttt {T2A} encoding\pfill \main{b-246}
+ \subitem \texttt {X2} encoding\pfill \main{b-424}
+ \item \texttt {\PrintChar{092}CYRD}\pfill a-275
+ \subitem \texttt {T2A} encoding\pfill \main{b-84}
+ \subitem \texttt {T2B} encoding\pfill \main{b-84}
+ \subitem \texttt {T2C} encoding\pfill \main{b-84}
+ \subitem \texttt {X2} encoding\pfill \main{b-84}
+ \item \texttt {\PrintChar{092}cyrd}\pfill a-275
+ \subitem \texttt {T2A} encoding\pfill \main{b-85}
+ \subitem \texttt {T2B} encoding\pfill \main{b-85}
+ \subitem \texttt {T2C} encoding\pfill \main{b-85}
+ \subitem \texttt {X2} encoding\pfill \main{b-85}
+ \item \texttt {\PrintChar{092}cyrdash}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-43}
+ \subitem \texttt {T2B} encoding\pfill \main{b-43}
+ \subitem \texttt {T2C} encoding\pfill \main{b-43}
+ \subitem \texttt {X2} encoding\pfill \main{b-43}
+ \item \texttt {\PrintChar{092}CYRDELTA}\pfill a-275
+ \subitem \texttt {T2B} encoding\pfill \main{b-269}
+ \subitem \texttt {X2} encoding\pfill \main{b-435}
+ \item \texttt {\PrintChar{092}cyrdelta}\pfill a-275
+ \subitem \texttt {T2B} encoding\pfill \main{b-270}
+ \subitem \texttt {X2} encoding\pfill \main{b-436}
+ \item \texttt {\PrintChar{092}CYRDJE}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-203}
+ \subitem \texttt {X2} encoding\pfill \main{b-377}
+ \item \texttt {\PrintChar{092}cyrdje}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-204}
+ \subitem \texttt {X2} encoding\pfill \main{b-378}
+ \item \texttt {\PrintChar{092}CYRDZE}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-229}
+ \subitem \texttt {T2B} encoding\pfill \main{b-416}
+ \subitem \texttt {T2C} encoding\pfill \main{b-416}
+ \subitem \texttt {X2} encoding\pfill \main{b-416}
+ \item \texttt {\PrintChar{092}cyrdze}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-230}
+ \subitem \texttt {T2B} encoding\pfill \main{b-417}
+ \subitem \texttt {T2C} encoding\pfill \main{b-417}
+ \subitem \texttt {X2} encoding\pfill \main{b-417}
+ \item \texttt {\PrintChar{092}CYRDZHE}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-243}
+ \subitem \texttt {T2C} encoding\pfill \main{b-359}
+ \subitem \texttt {X2} encoding\pfill \main{b-421}
+ \item \texttt {\PrintChar{092}cyrdzhe}\pfill a-276
+ \subitem \texttt {T2A} encoding\pfill \main{b-244}
+ \subitem \texttt {T2C} encoding\pfill \main{b-360}
+ \subitem \texttt {X2} encoding\pfill \main{b-422}
+ \item \texttt {\PrintChar{092}CYRE}\pfill a-276, b-441
+ \subitem \texttt {T2A} encoding\pfill \main{b-86}
+ \subitem \texttt {T2B} encoding\pfill \main{b-86}
+ \subitem \texttt {T2C} encoding\pfill \main{b-86}
+ \subitem \texttt {X2} encoding\pfill \main{b-86}
+ \item \texttt {\PrintChar{092}cyre}\pfill a-276, b-442
+ \subitem \texttt {T2A} encoding\pfill \main{b-87}
+ \subitem \texttt {T2B} encoding\pfill \main{b-87}
+ \subitem \texttt {T2C} encoding\pfill \main{b-87}
+ \subitem \texttt {X2} encoding\pfill \main{b-87}
+ \item \texttt {\PrintChar{092}CYREPS}\pfill a-277
+ \subitem \texttt {T2B} encoding\pfill \main{b-311}
+ \subitem \texttt {X2} encoding\pfill \main{b-195}
+ \item \texttt {\PrintChar{092}cyreps}\pfill a-276
+ \subitem \texttt {T2B} encoding\pfill \main{b-312}
+ \subitem \texttt {X2} encoding\pfill \main{b-196}
+ \item \texttt {\PrintChar{092}CYREREV}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-134}
+ \subitem \texttt {T2B} encoding\pfill \main{b-134}
+ \subitem \texttt {T2C} encoding\pfill \main{b-134}
+ \subitem \texttt {X2} encoding\pfill \main{b-134}
+ \item \texttt {\PrintChar{092}cyrerev}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-135}
+ \subitem \texttt {T2B} encoding\pfill \main{b-135}
+ \subitem \texttt {T2C} encoding\pfill \main{b-135}
+ \subitem \texttt {X2} encoding\pfill \main{b-135}
+ \item \texttt {\PrintChar{092}CYRERY}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-130}
+ \subitem \texttt {T2B} encoding\pfill \main{b-130}
+ \subitem \texttt {T2C} encoding\pfill \main{b-130}
+ \subitem \texttt {X2} encoding\pfill \main{b-130}
+ \item \texttt {\PrintChar{092}cyrery}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-131}
+ \subitem \texttt {T2B} encoding\pfill \main{b-131}
+ \subitem \texttt {T2C} encoding\pfill \main{b-131}
+ \subitem \texttt {X2} encoding\pfill \main{b-131}
+ \item \texttt {\PrintChar{092}CYRF}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-116}
+ \subitem \texttt {T2B} encoding\pfill \main{b-116}
+ \subitem \texttt {T2C} encoding\pfill \main{b-116}
+ \subitem \texttt {X2} encoding\pfill \main{b-116}
+ \item \texttt {\PrintChar{092}cyrf}\pfill a-277
+ \subitem \texttt {T2A} encoding\pfill \main{b-117}
+ \subitem \texttt {T2B} encoding\pfill \main{b-117}
+ \subitem \texttt {T2C} encoding\pfill \main{b-117}
+ \subitem \texttt {X2} encoding\pfill \main{b-117}
+ \item \texttt {\PrintChar{092}CYRFITA}\pfill a-278
+ \item \texttt {\PrintChar{092}cyrfita}\pfill a-277
+ \item \texttt {\PrintChar{092}CYRG}\pfill a-278
+ \subitem \texttt {T2A} encoding\pfill \main{b-82}
+ \subitem \texttt {T2B} encoding\pfill \main{b-82}
+ \subitem \texttt {T2C} encoding\pfill \main{b-82}
+ \subitem \texttt {X2} encoding\pfill \main{b-82}
+ \item \texttt {\PrintChar{092}cyrg}\pfill a-278
+ \subitem \texttt {T2A} encoding\pfill \main{b-83}
+ \subitem \texttt {T2B} encoding\pfill \main{b-83}
+ \subitem \texttt {T2C} encoding\pfill \main{b-83}
+ \subitem \texttt {X2} encoding\pfill \main{b-83}
+ \item \texttt {\PrintChar{092}CYRGDSC}\pfill a-278
+ \subitem \texttt {T2B} encoding\pfill \main{b-261}
+ \subitem \texttt {X2} encoding\pfill \main{b-145}
+ \item \texttt {\PrintChar{092}cyrgdsc}\pfill a-278
+ \subitem \texttt {T2B} encoding\pfill \main{b-262}
+ \subitem \texttt {X2} encoding\pfill \main{b-146}
+ \item \texttt {\PrintChar{092}CYRGDSCHCRS}\pfill a-278
+ \subitem \texttt {T2B} encoding\pfill \main{b-256}
+ \item \texttt {\PrintChar{092}cyrgdschcrs}\pfill a-278
+ \subitem \texttt {T2B} encoding\pfill \main{b-258}
+ \item \texttt {\PrintChar{092}CYRGHCRS}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-201}
+ \subitem \texttt {T2B} encoding\pfill \main{b-259}
+ \subitem \texttt {X2} encoding\pfill \main{b-143}
+ \item \texttt {\PrintChar{092}cyrghcrs}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-202}
+ \subitem \texttt {T2B} encoding\pfill \main{b-260}
+ \subitem \texttt {X2} encoding\pfill \main{b-144}
+ \item \texttt {\PrintChar{092}CYRGHK}\pfill a-279
+ \subitem \texttt {T2B} encoding\pfill \main{b-263}
+ \subitem \texttt {T2C} encoding\pfill \main{b-321}
+ \subitem \texttt {X2} encoding\pfill \main{b-147}
+ \item \texttt {\PrintChar{092}cyrghk}\pfill a-279
+ \subitem \texttt {T2B} encoding\pfill \main{b-264}
+ \subitem \texttt {T2C} encoding\pfill \main{b-322}
+ \subitem \texttt {X2} encoding\pfill \main{b-148}
+ \item \texttt {\PrintChar{092}CYRGUP}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-198}
+ \subitem \texttt {X2} encoding\pfill \main{b-140}
+ \item \texttt {\PrintChar{092}cyrgup}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-200}
+ \subitem \texttt {X2} encoding\pfill \main{b-142}
+ \item \texttt {\PrintChar{092}CYRH}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-118}
+ \subitem \texttt {T2B} encoding\pfill \main{b-118}
+ \subitem \texttt {T2C} encoding\pfill \main{b-118}
+ \subitem \texttt {X2} encoding\pfill \main{b-118}
+ \item \texttt {\PrintChar{092}cyrh}\pfill a-279
+ \subitem \texttt {T2A} encoding\pfill \main{b-119}
+ \subitem \texttt {T2B} encoding\pfill \main{b-119}
+ \subitem \texttt {T2C} encoding\pfill \main{b-119}
+ \subitem \texttt {X2} encoding\pfill \main{b-119}
+ \item \texttt {\PrintChar{092}CYRHDSC}\pfill a-280
+ \subitem \texttt {T2A} encoding\pfill \main{b-241}
+ \subitem \texttt {T2B} encoding\pfill \main{b-299}
+ \subitem \texttt {T2C} encoding\pfill \main{b-357}
+ \subitem \texttt {X2} encoding\pfill \main{b-183}
+ \item \texttt {\PrintChar{092}cyrhdsc}\pfill a-280
+ \subitem \texttt {T2A} encoding\pfill \main{b-242}
+ \subitem \texttt {T2B} encoding\pfill \main{b-300}
+ \subitem \texttt {T2C} encoding\pfill \main{b-358}
+ \subitem \texttt {X2} encoding\pfill \main{b-184}
+ \item \texttt {\PrintChar{092}CYRHHCRS}\pfill a-280
+ \subitem \texttt {T2B} encoding\pfill \main{b-297}
+ \item \texttt {\PrintChar{092}cyrhhcrs}\pfill a-280
+ \subitem \texttt {T2B} encoding\pfill \main{b-298}
+ \item \texttt {\PrintChar{092}CYRHHK}\pfill a-280
+ \subitem \texttt {T2B} encoding\pfill \main{b-301}
+ \subitem \texttt {X2} encoding\pfill \main{b-185}
+ \item \texttt {\PrintChar{092}cyrhhk}\pfill a-280
+ \subitem \texttt {T2B} encoding\pfill \main{b-302}
+ \subitem \texttt {X2} encoding\pfill \main{b-186}
+ \item \texttt {\PrintChar{092}CYRHRDSN}\pfill a-281
+ \subitem \texttt {T2A} encoding\pfill \main{b-128}
+ \subitem \texttt {T2B} encoding\pfill \main{b-128}
+ \subitem \texttt {T2C} encoding\pfill \main{b-128}
+ \subitem \texttt {X2} encoding\pfill \main{b-128}
+ \item \texttt {\PrintChar{092}cyrhrdsn}\pfill a-280
+ \subitem \texttt {T2A} encoding\pfill \main{b-129}
+ \subitem \texttt {T2B} encoding\pfill \main{b-129}
+ \subitem \texttt {T2C} encoding\pfill \main{b-129}
+ \subitem \texttt {X2} encoding\pfill \main{b-129}
+ \item \texttt {\PrintChar{092}CYRI}\pfill a-281, b-443
+ \subitem \texttt {T2A} encoding\pfill \main{b-92}
+ \subitem \texttt {T2B} encoding\pfill \main{b-92}
+ \subitem \texttt {T2C} encoding\pfill \main{b-92}
+ \subitem \texttt {X2} encoding\pfill \main{b-92}
+ \item \texttt {\PrintChar{092}cyri}\pfill a-281, b-444
+ \subitem \texttt {T2A} encoding\pfill \main{b-93}
+ \subitem \texttt {T2B} encoding\pfill \main{b-93}
+ \subitem \texttt {T2C} encoding\pfill \main{b-93}
+ \subitem \texttt {X2} encoding\pfill \main{b-93}
+ \item \texttt {\PrintChar{092}CYRIE}\pfill a-281
+ \subitem \texttt {T2A} encoding\pfill \main{b-249}
+ \subitem \texttt {X2} encoding\pfill \main{b-191}
+ \item \texttt {\PrintChar{092}cyrie}\pfill a-281
+ \subitem \texttt {T2A} encoding\pfill \main{b-250}
+ \subitem \texttt {X2} encoding\pfill \main{b-192}
+ \item \texttt {\PrintChar{092}CYRII}\pfill a-281, b-446
+ \subitem \texttt {T2A} encoding\pfill \main{b-392}
+ \subitem \texttt {T2B} encoding\pfill \main{b-392}
+ \subitem \texttt {T2C} encoding\pfill \main{b-392}
+ \subitem \texttt {X2} encoding\pfill \main{b-392}
+ \item \texttt {\PrintChar{092}cyrii}\pfill a-281, b-447
+ \subitem \texttt {T2A} encoding\pfill \main{b-393}
+ \subitem \texttt {T2B} encoding\pfill \main{b-393}
+ \subitem \texttt {T2C} encoding\pfill \main{b-393}
+ \subitem \texttt {X2} encoding\pfill \main{b-393}
+ \item \texttt {\PrintChar{092}CYRISHRT}\pfill a-281
+ \subitem \texttt {T2A} encoding\pfill \main{b-94}
+ \subitem \texttt {T2B} encoding\pfill \main{b-94}
+ \subitem \texttt {T2C} encoding\pfill \main{b-94}
+ \subitem \texttt {X2} encoding\pfill \main{b-94}
+ \item \texttt {\PrintChar{092}cyrishrt}\pfill a-281
+ \subitem \texttt {T2A} encoding\pfill \main{b-95}
+ \subitem \texttt {T2B} encoding\pfill \main{b-95}
+ \subitem \texttt {T2C} encoding\pfill \main{b-95}
+ \subitem \texttt {X2} encoding\pfill \main{b-95}
+ \item \texttt {\PrintChar{092}CYRISHRTDSC}\pfill a-282
+ \subitem \texttt {T2C} encoding\pfill \main{b-355}
+ \item \texttt {\PrintChar{092}cyrishrtdsc}\pfill a-282
+ \subitem \texttt {T2C} encoding\pfill \main{b-356}
+ \item \texttt {\PrintChar{092}CYRIZH}\pfill a-282
+ \subitem \texttt {X2} encoding\pfill \main{b-433}
+ \item \texttt {\PrintChar{092}cyrizh}\pfill a-282
+ \subitem \texttt {X2} encoding\pfill \main{b-434}
+ \item \texttt {\PrintChar{092}CYRJE}\pfill a-282
+ \subitem \texttt {T2A} encoding\pfill \main{b-394}
+ \subitem \texttt {T2B} encoding\pfill \main{b-394}
+ \subitem \texttt {T2C} encoding\pfill \main{b-394}
+ \subitem \texttt {X2} encoding\pfill \main{b-394}
+ \item \texttt {\PrintChar{092}cyrje}\pfill a-282
+ \subitem \texttt {T2A} encoding\pfill \main{b-395}
+ \subitem \texttt {T2B} encoding\pfill \main{b-395}
+ \subitem \texttt {T2C} encoding\pfill \main{b-395}
+ \subitem \texttt {X2} encoding\pfill \main{b-395}
+ \item \texttt {\PrintChar{092}CYRK}\pfill a-282
+ \subitem \texttt {T2A} encoding\pfill \main{b-96}
+ \subitem \texttt {T2B} encoding\pfill \main{b-96}
+ \subitem \texttt {T2C} encoding\pfill \main{b-96}
+ \subitem \texttt {X2} encoding\pfill \main{b-96}
+ \item \texttt {\PrintChar{092}cyrk}\pfill a-282
+ \subitem \texttt {T2A} encoding\pfill \main{b-97}
+ \subitem \texttt {T2B} encoding\pfill \main{b-97}
+ \subitem \texttt {T2C} encoding\pfill \main{b-97}
+ \subitem \texttt {X2} encoding\pfill \main{b-97}
+ \item \texttt {\PrintChar{092}CYRKBEAK}\pfill a-283
+ \subitem \texttt {T2A} encoding\pfill \main{b-219}
+ \subitem \texttt {X2} encoding\pfill \main{b-161}
+ \item \texttt {\PrintChar{092}cyrkbeak}\pfill a-283
+ \subitem \texttt {T2A} encoding\pfill \main{b-220}
+ \subitem \texttt {X2} encoding\pfill \main{b-162}
+ \item \texttt {\PrintChar{092}CYRKDSC}\pfill a-283
+ \subitem \texttt {T2A} encoding\pfill \main{b-217}
+ \subitem \texttt {T2B} encoding\pfill \main{b-275}
+ \subitem \texttt {T2C} encoding\pfill \main{b-333}
+ \subitem \texttt {X2} encoding\pfill \main{b-159}
+ \item \texttt {\PrintChar{092}cyrkdsc}\pfill a-283
+ \subitem \texttt {T2A} encoding\pfill \main{b-218}
+ \subitem \texttt {T2B} encoding\pfill \main{b-276}
+ \subitem \texttt {T2C} encoding\pfill \main{b-334}
+ \subitem \texttt {X2} encoding\pfill \main{b-160}
+ \item \texttt {\PrintChar{092}CYRKHCRS}\pfill a-283
+ \subitem \texttt {T2C} encoding\pfill \main{b-337}
+ \subitem \texttt {X2} encoding\pfill \main{b-387}
+ \item \texttt {\PrintChar{092}cyrkhcrs}\pfill a-283
+ \subitem \texttt {T2C} encoding\pfill \main{b-338}
+ \subitem \texttt {X2} encoding\pfill \main{b-388}
+ \item \texttt {\PrintChar{092}CYRKHK}\pfill a-284
+ \subitem \texttt {T2B} encoding\pfill \main{b-279}
+ \subitem \texttt {X2} encoding\pfill \main{b-163}
+ \item \texttt {\PrintChar{092}cyrkhk}\pfill a-283
+ \subitem \texttt {T2B} encoding\pfill \main{b-280}
+ \subitem \texttt {X2} encoding\pfill \main{b-164}
+ \item \texttt {\PrintChar{092}CYRKVCRS}\pfill a-284
+ \subitem \texttt {T2A} encoding\pfill \main{b-221}
+ \subitem \texttt {X2} encoding\pfill \main{b-385}
+ \item \texttt {\PrintChar{092}cyrkvcrs}\pfill a-284
+ \subitem \texttt {T2A} encoding\pfill \main{b-222}
+ \subitem \texttt {X2} encoding\pfill \main{b-386}
+ \item \texttt {\PrintChar{092}CYRL}\pfill a-284
+ \subitem \texttt {T2A} encoding\pfill \main{b-98}
+ \subitem \texttt {T2B} encoding\pfill \main{b-98}
+ \subitem \texttt {T2C} encoding\pfill \main{b-98}
+ \subitem \texttt {X2} encoding\pfill \main{b-98}
+ \item \texttt {\PrintChar{092}cyrl}\pfill a-284
+ \subitem \texttt {T2A} encoding\pfill \main{b-99}
+ \subitem \texttt {T2B} encoding\pfill \main{b-99}
+ \subitem \texttt {T2C} encoding\pfill \main{b-99}
+ \subitem \texttt {X2} encoding\pfill \main{b-99}
+ \item \texttt {\PrintChar{092}cyrlangle}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-69}
+ \subitem \texttt {T2B} encoding\pfill \main{b-69}
+ \subitem \texttt {T2C} encoding\pfill \main{b-69}
+ \subitem \texttt {X2} encoding\pfill \main{b-69}
+ \item \texttt {\PrintChar{092}CYRLDSC}\pfill a-284
+ \subitem \texttt {T2B} encoding\pfill \main{b-277}
+ \subitem \texttt {T2C} encoding\pfill \main{b-335}
+ \subitem \texttt {X2} encoding\pfill \main{b-389}
+ \item \texttt {\PrintChar{092}cyrldsc}\pfill a-284
+ \subitem \texttt {T2B} encoding\pfill \main{b-278}
+ \subitem \texttt {T2C} encoding\pfill \main{b-336}
+ \subitem \texttt {X2} encoding\pfill \main{b-390}
+ \item \texttt {\PrintChar{092}CYRLHK}\pfill a-285
+ \subitem \texttt {T2B} encoding\pfill \main{b-281}
+ \subitem \texttt {T2C} encoding\pfill \main{b-339}
+ \subitem \texttt {X2} encoding\pfill \main{b-165}
+ \item \texttt {\PrintChar{092}cyrlhk}\pfill a-284
+ \subitem \texttt {T2B} encoding\pfill \main{b-282}
+ \subitem \texttt {T2C} encoding\pfill \main{b-340}
+ \subitem \texttt {X2} encoding\pfill \main{b-166}
+ \item \texttt {\PrintChar{092}CYRLJE}\pfill a-285
+ \subitem \texttt {T2A} encoding\pfill \main{b-213}
+ \subitem \texttt {T2B} encoding\pfill \main{b-273}
+ \subitem \texttt {X2} encoding\pfill \main{b-396}
+ \item \texttt {\PrintChar{092}cyrlje}\pfill a-285
+ \subitem \texttt {T2A} encoding\pfill \main{b-214}
+ \subitem \texttt {T2B} encoding\pfill \main{b-274}
+ \subitem \texttt {X2} encoding\pfill \main{b-398}
+ \item \texttt {\PrintChar{092}CYRM}\pfill a-285
+ \subitem \texttt {T2A} encoding\pfill \main{b-100}
+ \subitem \texttt {T2B} encoding\pfill \main{b-100}
+ \subitem \texttt {T2C} encoding\pfill \main{b-100}
+ \subitem \texttt {X2} encoding\pfill \main{b-100}
+ \item \texttt {\PrintChar{092}cyrm}\pfill a-285
+ \subitem \texttt {T2A} encoding\pfill \main{b-101}
+ \subitem \texttt {T2B} encoding\pfill \main{b-101}
+ \subitem \texttt {T2C} encoding\pfill \main{b-101}
+ \subitem \texttt {X2} encoding\pfill \main{b-101}
+ \item \texttt {\PrintChar{092}CYRMDSC}\pfill a-285
+ \subitem \texttt {T2C} encoding\pfill \main{b-331}
+ \subitem \texttt {X2} encoding\pfill \main{b-399}
+ \item \texttt {\PrintChar{092}cyrmdsc}\pfill a-285
+ \subitem \texttt {T2C} encoding\pfill \main{b-332}
+ \subitem \texttt {X2} encoding\pfill \main{b-400}
+ \item \texttt {\PrintChar{092}CYRMHK}\pfill a-285
+ \subitem \texttt {T2C} encoding\pfill \main{b-343}
+ \item \texttt {\PrintChar{092}cyrmhk}\pfill a-285
+ \subitem \texttt {T2C} encoding\pfill \main{b-344}
+ \item \texttt {\PrintChar{092}CYRN}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-102}
+ \subitem \texttt {T2B} encoding\pfill \main{b-102}
+ \subitem \texttt {T2C} encoding\pfill \main{b-102}
+ \subitem \texttt {X2} encoding\pfill \main{b-102}
+ \item \texttt {\PrintChar{092}cyrn}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-103}
+ \subitem \texttt {T2B} encoding\pfill \main{b-103}
+ \subitem \texttt {T2C} encoding\pfill \main{b-103}
+ \subitem \texttt {X2} encoding\pfill \main{b-103}
+ \item \texttt {\PrintChar{092}CYRNDSC}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-225}
+ \subitem \texttt {T2B} encoding\pfill \main{b-283}
+ \subitem \texttt {T2C} encoding\pfill \main{b-341}
+ \subitem \texttt {X2} encoding\pfill \main{b-167}
+ \item \texttt {\PrintChar{092}cyrndsc}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-226}
+ \subitem \texttt {T2B} encoding\pfill \main{b-284}
+ \subitem \texttt {T2C} encoding\pfill \main{b-342}
+ \subitem \texttt {X2} encoding\pfill \main{b-168}
+ \item \texttt {\PrintChar{092}CYRNG}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-227}
+ \subitem \texttt {T2B} encoding\pfill \main{b-285}
+ \subitem \texttt {X2} encoding\pfill \main{b-169}
+ \item \texttt {\PrintChar{092}cyrng}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-228}
+ \subitem \texttt {T2B} encoding\pfill \main{b-286}
+ \subitem \texttt {X2} encoding\pfill \main{b-170}
+ \item \texttt {\PrintChar{092}CYRNHK}\pfill a-286
+ \subitem \texttt {T2B} encoding\pfill \main{b-287}
+ \subitem \texttt {T2C} encoding\pfill \main{b-345}
+ \subitem \texttt {X2} encoding\pfill \main{b-171}
+ \item \texttt {\PrintChar{092}cyrnhk}\pfill a-286
+ \subitem \texttt {T2B} encoding\pfill \main{b-288}
+ \subitem \texttt {T2C} encoding\pfill \main{b-346}
+ \subitem \texttt {X2} encoding\pfill \main{b-172}
+ \item \texttt {\PrintChar{092}CYRNJE}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-253}
+ \subitem \texttt {T2B} encoding\pfill \main{b-307}
+ \subitem \texttt {X2} encoding\pfill \main{b-401}
+ \item \texttt {\PrintChar{092}cyrnje}\pfill a-286
+ \subitem \texttt {T2A} encoding\pfill \main{b-254}
+ \subitem \texttt {T2B} encoding\pfill \main{b-308}
+ \subitem \texttt {X2} encoding\pfill \main{b-402}
+ \item \texttt {\PrintChar{092}CYRNLHK}\pfill a-287
+ \subitem \texttt {T2C} encoding\pfill \main{b-365}
+ \subitem \texttt {X2} encoding\pfill \main{b-437}
+ \item \texttt {\PrintChar{092}cyrnlhk}\pfill a-287
+ \subitem \texttt {T2C} encoding\pfill \main{b-366}
+ \subitem \texttt {X2} encoding\pfill \main{b-438}
+ \item \texttt {\PrintChar{092}CYRO}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-104}
+ \subitem \texttt {T2B} encoding\pfill \main{b-104}
+ \subitem \texttt {T2C} encoding\pfill \main{b-104}
+ \subitem \texttt {X2} encoding\pfill \main{b-104}
+ \item \texttt {\PrintChar{092}cyro}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-105}
+ \subitem \texttt {T2B} encoding\pfill \main{b-105}
+ \subitem \texttt {T2C} encoding\pfill \main{b-105}
+ \subitem \texttt {X2} encoding\pfill \main{b-105}
+ \item \texttt {\PrintChar{092}CYROTLD}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-231}
+ \subitem \texttt {T2B} encoding\pfill \main{b-289}
+ \subitem \texttt {T2C} encoding\pfill \main{b-347}
+ \subitem \texttt {X2} encoding\pfill \main{b-173}
+ \item \texttt {\PrintChar{092}cyrotld}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-232}
+ \subitem \texttt {T2B} encoding\pfill \main{b-290}
+ \subitem \texttt {T2C} encoding\pfill \main{b-348}
+ \subitem \texttt {X2} encoding\pfill \main{b-174}
+ \item \texttt {\PrintChar{092}CYRP}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-106}
+ \subitem \texttt {T2B} encoding\pfill \main{b-106}
+ \subitem \texttt {T2C} encoding\pfill \main{b-106}
+ \subitem \texttt {X2} encoding\pfill \main{b-106}
+ \item \texttt {\PrintChar{092}cyrp}\pfill a-287
+ \subitem \texttt {T2A} encoding\pfill \main{b-107}
+ \subitem \texttt {T2B} encoding\pfill \main{b-107}
+ \subitem \texttt {T2C} encoding\pfill \main{b-107}
+ \subitem \texttt {X2} encoding\pfill \main{b-107}
+ \item \texttt {\PrintChar{092}CYRpalochka}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-68}
+ \subitem \texttt {T2B} encoding\pfill \main{b-68}
+ \subitem \texttt {T2C} encoding\pfill \main{b-68}
+ \subitem \texttt {X2} encoding\pfill \main{b-68}
+ \item \texttt {\PrintChar{092}CYRPHK}\pfill a-288
+ \subitem \texttt {T2C} encoding\pfill \main{b-314}
+ \subitem \texttt {X2} encoding\pfill \main{b-405}
+ \item \texttt {\PrintChar{092}cyrphk}\pfill a-288
+ \subitem \texttt {T2C} encoding\pfill \main{b-316}
+ \subitem \texttt {X2} encoding\pfill \main{b-406}
+ \item \texttt {\PrintChar{092}CYRQ}\pfill a-288
+ \subitem \texttt {T2A} encoding\pfill \main{b-410}
+ \subitem \texttt {T2B} encoding\pfill \main{b-410}
+ \subitem \texttt {T2C} encoding\pfill \main{b-410}
+ \subitem \texttt {X2} encoding\pfill \main{b-410}
+ \item \texttt {\PrintChar{092}cyrq}\pfill a-288
+ \subitem \texttt {T2A} encoding\pfill \main{b-411}
+ \subitem \texttt {T2B} encoding\pfill \main{b-411}
+ \subitem \texttt {T2C} encoding\pfill \main{b-411}
+ \subitem \texttt {X2} encoding\pfill \main{b-411}
+ \item \texttt {\PrintChar{092}CYRR}\pfill a-288
+ \subitem \texttt {T2A} encoding\pfill \main{b-108}
+ \subitem \texttt {T2B} encoding\pfill \main{b-108}
+ \subitem \texttt {T2C} encoding\pfill \main{b-108}
+ \subitem \texttt {X2} encoding\pfill \main{b-108}
+ \item \texttt {\PrintChar{092}cyrr}\pfill a-288
+ \subitem \texttt {T2A} encoding\pfill \main{b-109}
+ \subitem \texttt {T2B} encoding\pfill \main{b-109}
+ \subitem \texttt {T2C} encoding\pfill \main{b-109}
+ \subitem \texttt {X2} encoding\pfill \main{b-109}
+ \item \texttt {\PrintChar{092}cyrrangle}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-70}
+ \subitem \texttt {T2B} encoding\pfill \main{b-70}
+ \subitem \texttt {T2C} encoding\pfill \main{b-70}
+ \subitem \texttt {X2} encoding\pfill \main{b-70}
+ \item \texttt {\PrintChar{092}CYRRDSC}\pfill a-288
+ \subitem \texttt {T2C} encoding\pfill \main{b-325}
+ \subitem \texttt {X2} encoding\pfill \main{b-407}
+ \item \texttt {\PrintChar{092}cyrrdsc}\pfill a-288
+ \subitem \texttt {T2C} encoding\pfill \main{b-326}
+ \subitem \texttt {X2} encoding\pfill \main{b-408}
+ \item \texttt {\PrintChar{092}CYRRHK}\pfill a-289
+ \subitem \texttt {T2C} encoding\pfill \main{b-369}
+ \item \texttt {\PrintChar{092}cyrrhk}\pfill a-288
+ \subitem \texttt {T2C} encoding\pfill \main{b-370}
+ \item \texttt {\PrintChar{092}CYRRTICK}\pfill a-289
+ \subitem \texttt {T2C} encoding\pfill \main{b-327}
+ \item \texttt {\PrintChar{092}cyrrtick}\pfill a-289
+ \subitem \texttt {T2C} encoding\pfill \main{b-328}
+ \item \texttt {\PrintChar{092}CYRS}\pfill a-289, b-450
+ \subitem \texttt {T2A} encoding\pfill \main{b-110}
+ \subitem \texttt {T2B} encoding\pfill \main{b-110}
+ \subitem \texttt {T2C} encoding\pfill \main{b-110}
+ \subitem \texttt {X2} encoding\pfill \main{b-110}
+ \item \texttt {\PrintChar{092}cyrs}\pfill a-289, b-451
+ \subitem \texttt {T2A} encoding\pfill \main{b-111}
+ \subitem \texttt {T2B} encoding\pfill \main{b-111}
+ \subitem \texttt {T2C} encoding\pfill \main{b-111}
+ \subitem \texttt {X2} encoding\pfill \main{b-111}
+ \item \texttt {\PrintChar{092}CYRSACRS}\pfill a-289
+ \subitem \texttt {T2B} encoding\pfill \main{b-291}
+ \item \texttt {\PrintChar{092}cyrsacrs}\pfill a-289
+ \subitem \texttt {T2B} encoding\pfill \main{b-292}
+ \item \texttt {\PrintChar{092}CYRSCHWA}\pfill a-290
+ \subitem \texttt {T2A} encoding\pfill \main{b-251}
+ \subitem \texttt {T2B} encoding\pfill \main{b-309}
+ \subitem \texttt {T2C} encoding\pfill \main{b-367}
+ \subitem \texttt {X2} encoding\pfill \main{b-193}
+ \item \texttt {\PrintChar{092}cyrschwa}\pfill a-290
+ \subitem \texttt {T2A} encoding\pfill \main{b-252}
+ \subitem \texttt {T2B} encoding\pfill \main{b-310}
+ \subitem \texttt {T2C} encoding\pfill \main{b-368}
+ \subitem \texttt {X2} encoding\pfill \main{b-194}
+ \item \texttt {\PrintChar{092}CYRSDSC}\pfill a-290
+ \subitem \texttt {T2A} encoding\pfill \main{b-233}
+ \subitem \texttt {X2} encoding\pfill \main{b-175}
+ \item \texttt {\PrintChar{092}cyrsdsc}\pfill a-290
+ \subitem \texttt {T2A} encoding\pfill \main{b-234}
+ \subitem \texttt {X2} encoding\pfill \main{b-176}
+ \item \texttt {\PrintChar{092}CYRSEMISFTSN}\pfill a-290
+ \subitem \texttt {T2C} encoding\pfill \main{b-353}
+ \item \texttt {\PrintChar{092}cyrsemisftsn}\pfill a-290
+ \subitem \texttt {T2C} encoding\pfill \main{b-354}
+ \item \texttt {\PrintChar{092}CYRSFTSN}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-132}
+ \subitem \texttt {T2B} encoding\pfill \main{b-132}
+ \subitem \texttt {T2C} encoding\pfill \main{b-132}
+ \subitem \texttt {X2} encoding\pfill \main{b-132}
+ \item \texttt {\PrintChar{092}cyrsftsn}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-133}
+ \subitem \texttt {T2B} encoding\pfill \main{b-133}
+ \subitem \texttt {T2C} encoding\pfill \main{b-133}
+ \subitem \texttt {X2} encoding\pfill \main{b-133}
+ \item \texttt {\PrintChar{092}CYRSH}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-124}
+ \subitem \texttt {T2B} encoding\pfill \main{b-124}
+ \subitem \texttt {T2C} encoding\pfill \main{b-124}
+ \subitem \texttt {X2} encoding\pfill \main{b-124}
+ \item \texttt {\PrintChar{092}cyrsh}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-125}
+ \subitem \texttt {T2B} encoding\pfill \main{b-125}
+ \subitem \texttt {T2C} encoding\pfill \main{b-125}
+ \subitem \texttt {X2} encoding\pfill \main{b-125}
+ \item \texttt {\PrintChar{092}CYRSHCH}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-126}
+ \subitem \texttt {T2B} encoding\pfill \main{b-126}
+ \subitem \texttt {T2C} encoding\pfill \main{b-126}
+ \subitem \texttt {X2} encoding\pfill \main{b-126}
+ \item \texttt {\PrintChar{092}cyrshch}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-127}
+ \subitem \texttt {T2B} encoding\pfill \main{b-127}
+ \subitem \texttt {T2C} encoding\pfill \main{b-127}
+ \subitem \texttt {X2} encoding\pfill \main{b-127}
+ \item \texttt {\PrintChar{092}CYRSHHA}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-207}
+ \subitem \texttt {T2B} encoding\pfill \main{b-265}
+ \subitem \texttt {T2C} encoding\pfill \main{b-323}
+ \subitem \texttt {X2} encoding\pfill \main{b-149}
+ \item \texttt {\PrintChar{092}cyrshha}\pfill a-291
+ \subitem \texttt {T2A} encoding\pfill \main{b-208}
+ \subitem \texttt {T2B} encoding\pfill \main{b-266}
+ \subitem \texttt {T2C} encoding\pfill \main{b-324}
+ \subitem \texttt {X2} encoding\pfill \main{b-150}
+ \item \texttt {\PrintChar{092}CYRT}\pfill a-292
+ \subitem \texttt {T2A} encoding\pfill \main{b-112}
+ \subitem \texttt {T2B} encoding\pfill \main{b-112}
+ \subitem \texttt {T2C} encoding\pfill \main{b-112}
+ \subitem \texttt {X2} encoding\pfill \main{b-112}
+ \item \texttt {\PrintChar{092}cyrt}\pfill a-292
+ \subitem \texttt {T2A} encoding\pfill \main{b-113}
+ \subitem \texttt {T2B} encoding\pfill \main{b-113}
+ \subitem \texttt {T2C} encoding\pfill \main{b-113}
+ \subitem \texttt {X2} encoding\pfill \main{b-113}
+ \item \texttt {\PrintChar{092}CYRTDSC}\pfill a-292
+ \subitem \texttt {T2C} encoding\pfill \main{b-319}
+ \subitem \texttt {X2} encoding\pfill \main{b-412}
+ \item \texttt {\PrintChar{092}cyrtdsc}\pfill a-292
+ \subitem \texttt {T2C} encoding\pfill \main{b-320}
+ \subitem \texttt {X2} encoding\pfill \main{b-414}
+ \item \texttt {\PrintChar{092}CYRTETSE}\pfill a-292
+ \subitem \texttt {T2C} encoding\pfill \main{b-317}
+ \subitem \texttt {X2} encoding\pfill \main{b-418}
+ \item \texttt {\PrintChar{092}cyrtetse}\pfill a-292
+ \subitem \texttt {T2C} encoding\pfill \main{b-318}
+ \subitem \texttt {X2} encoding\pfill \main{b-420}
+ \item \texttt {\PrintChar{092}CYRTSHE}\pfill a-292
+ \subitem \texttt {T2A} encoding\pfill \main{b-205}
+ \subitem \texttt {X2} encoding\pfill \main{b-379}
+ \item \texttt {\PrintChar{092}cyrtshe}\pfill a-292
+ \subitem \texttt {T2A} encoding\pfill \main{b-206}
+ \subitem \texttt {X2} encoding\pfill \main{b-380}
+ \item \texttt {\PrintChar{092}CYRU}\pfill a-293, b-454
+ \subitem \texttt {T2A} encoding\pfill \main{b-114}
+ \subitem \texttt {T2B} encoding\pfill \main{b-114}
+ \subitem \texttt {T2C} encoding\pfill \main{b-114}
+ \subitem \texttt {X2} encoding\pfill \main{b-114}
+ \item \texttt {\PrintChar{092}cyru}\pfill a-293, b-455
+ \subitem \texttt {T2A} encoding\pfill \main{b-115}
+ \subitem \texttt {T2B} encoding\pfill \main{b-115}
+ \subitem \texttt {T2C} encoding\pfill \main{b-115}
+ \subitem \texttt {X2} encoding\pfill \main{b-115}
+ \item \texttt {\PrintChar{092}CYRUSHRT}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-235}
+ \subitem \texttt {T2B} encoding\pfill \main{b-293}
+ \subitem \texttt {X2} encoding\pfill \main{b-177}
+ \item \texttt {\PrintChar{092}cyrushrt}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-236}
+ \subitem \texttt {T2B} encoding\pfill \main{b-294}
+ \subitem \texttt {X2} encoding\pfill \main{b-178}
+ \item \texttt {\PrintChar{092}CYRV}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-80}
+ \subitem \texttt {T2B} encoding\pfill \main{b-80}
+ \subitem \texttt {T2C} encoding\pfill \main{b-80}
+ \subitem \texttt {X2} encoding\pfill \main{b-80}
+ \item \texttt {\PrintChar{092}cyrv}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-81}
+ \subitem \texttt {T2B} encoding\pfill \main{b-81}
+ \subitem \texttt {T2C} encoding\pfill \main{b-81}
+ \subitem \texttt {X2} encoding\pfill \main{b-81}
+ \item \texttt {\PrintChar{092}CYRW}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-426}
+ \subitem \texttt {T2B} encoding\pfill \main{b-426}
+ \subitem \texttt {T2C} encoding\pfill \main{b-426}
+ \subitem \texttt {X2} encoding\pfill \main{b-426}
+ \item \texttt {\PrintChar{092}cyrw}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-427}
+ \subitem \texttt {T2B} encoding\pfill \main{b-427}
+ \subitem \texttt {T2C} encoding\pfill \main{b-427}
+ \subitem \texttt {X2} encoding\pfill \main{b-427}
+ \item \texttt {\PrintChar{092}CYRY}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-237}
+ \subitem \texttt {T2B} encoding\pfill \main{b-295}
+ \subitem \texttt {X2} encoding\pfill \main{b-179}
+ \item \texttt {\PrintChar{092}cyry}\pfill a-293
+ \subitem \texttt {T2A} encoding\pfill \main{b-238}
+ \subitem \texttt {T2B} encoding\pfill \main{b-296}
+ \subitem \texttt {X2} encoding\pfill \main{b-180}
+ \item \texttt {\PrintChar{092}CYRYA}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-138}
+ \subitem \texttt {T2B} encoding\pfill \main{b-138}
+ \subitem \texttt {T2C} encoding\pfill \main{b-138}
+ \subitem \texttt {X2} encoding\pfill \main{b-138}
+ \item \texttt {\PrintChar{092}cyrya}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-139}
+ \subitem \texttt {T2B} encoding\pfill \main{b-139}
+ \subitem \texttt {T2C} encoding\pfill \main{b-139}
+ \subitem \texttt {X2} encoding\pfill \main{b-139}
+ \item \texttt {\PrintChar{092}CYRYAT}\pfill a-294
+ \subitem \texttt {X2} encoding\pfill \main{b-428}
+ \item \texttt {\PrintChar{092}cyryat}\pfill a-294
+ \subitem \texttt {X2} encoding\pfill \main{b-430}
+ \item \texttt {\PrintChar{092}CYRYHCRS}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-239}
+ \subitem \texttt {X2} encoding\pfill \main{b-181}
+ \item \texttt {\PrintChar{092}cyryhcrs}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-240}
+ \subitem \texttt {X2} encoding\pfill \main{b-182}
+ \item \texttt {\PrintChar{092}CYRYI}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-215}
+ \subitem \texttt {X2} encoding\pfill \main{b-157}
+ \item \texttt {\PrintChar{092}cyryi}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-216}
+ \subitem \texttt {X2} encoding\pfill \main{b-158}
+ \item \texttt {\PrintChar{092}CYRYO}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-372}
+ \subitem \texttt {T2B} encoding\pfill \main{b-372}
+ \subitem \texttt {T2C} encoding\pfill \main{b-372}
+ \subitem \texttt {X2} encoding\pfill \main{b-372}
+ \item \texttt {\PrintChar{092}cyryo}\pfill a-294
+ \subitem \texttt {T2A} encoding\pfill \main{b-373}
+ \subitem \texttt {T2B} encoding\pfill \main{b-373}
+ \subitem \texttt {T2C} encoding\pfill \main{b-373}
+ \subitem \texttt {X2} encoding\pfill \main{b-373}
+ \item \texttt {\PrintChar{092}CYRYU}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-136}
+ \subitem \texttt {T2B} encoding\pfill \main{b-136}
+ \subitem \texttt {T2C} encoding\pfill \main{b-136}
+ \subitem \texttt {X2} encoding\pfill \main{b-136}
+ \item \texttt {\PrintChar{092}cyryu}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-137}
+ \subitem \texttt {T2B} encoding\pfill \main{b-137}
+ \subitem \texttt {T2C} encoding\pfill \main{b-137}
+ \subitem \texttt {X2} encoding\pfill \main{b-137}
+ \item \texttt {\PrintChar{092}CYRZ}\pfill a-295, b-448
+ \subitem \texttt {T2A} encoding\pfill \main{b-90}
+ \subitem \texttt {T2B} encoding\pfill \main{b-90}
+ \subitem \texttt {T2C} encoding\pfill \main{b-90}
+ \subitem \texttt {X2} encoding\pfill \main{b-90}
+ \item \texttt {\PrintChar{092}cyrz}\pfill a-295, b-449
+ \subitem \texttt {T2A} encoding\pfill \main{b-91}
+ \subitem \texttt {T2B} encoding\pfill \main{b-91}
+ \subitem \texttt {T2C} encoding\pfill \main{b-91}
+ \subitem \texttt {X2} encoding\pfill \main{b-91}
+ \item \texttt {\PrintChar{092}CYRZDSC}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-211}
+ \subitem \texttt {X2} encoding\pfill \main{b-153}
+ \item \texttt {\PrintChar{092}cyrzdsc}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-212}
+ \subitem \texttt {X2} encoding\pfill \main{b-154}
+ \item \texttt {\PrintChar{092}CYRZH}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-88}
+ \subitem \texttt {T2B} encoding\pfill \main{b-88}
+ \subitem \texttt {T2C} encoding\pfill \main{b-88}
+ \subitem \texttt {X2} encoding\pfill \main{b-88}
+ \item \texttt {\PrintChar{092}cyrzh}\pfill a-295
+ \subitem \texttt {T2A} encoding\pfill \main{b-89}
+ \subitem \texttt {T2B} encoding\pfill \main{b-89}
+ \subitem \texttt {T2C} encoding\pfill \main{b-89}
+ \subitem \texttt {X2} encoding\pfill \main{b-89}
+ \item \texttt {\PrintChar{092}CYRZHDSC}\pfill a-296
+ \subitem \texttt {T2A} encoding\pfill \main{b-209}
+ \subitem \texttt {T2B} encoding\pfill \main{b-267}
+ \subitem \texttt {X2} encoding\pfill \main{b-151}
+ \item \texttt {\PrintChar{092}cyrzhdsc}\pfill a-296
+ \subitem \texttt {T2A} encoding\pfill \main{b-210}
+ \subitem \texttt {T2B} encoding\pfill \main{b-268}
+ \subitem \texttt {X2} encoding\pfill \main{b-152}
+
+ \indexspace
+{\bfseries\hfil D\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}d}\efill
+ \subitem default\pfill \main{a-185}
+ \subitem \texttt {OT1} encoding\pfill \main{a-352}
+ \subitem \texttt {OT4} encoding\pfill \main{a-642}
+ \subitem \texttt {T1} encoding\pfill \main{a-421}
+ \subitem \texttt {T2A} encoding\pfill \main{b-34}
+ \subitem \texttt {T2B} encoding\pfill \main{b-34}
+ \subitem \texttt {T2C} encoding\pfill \main{b-34}
+ \subitem \texttt {X2} encoding\pfill \main{b-34}
+ \item \texttt {\PrintChar{092}dag}\pfill a-256
+ \item \texttt {\PrintChar{092}dagger}\pfill a-256
+ \item \texttt {\PrintChar{092}ddag}\pfill a-257
+ \item \texttt {\PrintChar{092}ddagger}\pfill a-257
+ \item \texttt {\PrintChar{092}@dec@text@cmd}\pfill \main{a-3}
+ \item \texttt {\PrintChar{092}DeclareFontEncoding}\pfill a-334,
+ a-402, a-595, a-615, a-621, a-704, b-8--b-11
+ \item \texttt {\PrintChar{092}DeclareFontSubstitution}\pfill a-622,
+ a-705, b-12
+ \item \texttt {\PrintChar{092}DeclareOption}\pfill a-299
+ \item \texttt {\PrintChar{092}DeclareRobustCommand}\pfill
+ a-251--a-258, a-260, a-262, a-264
+ \item \texttt {\PrintChar{092}DeclareTextAccent}\pfill \usage{2},
+ \main{a-64}, a-335--a-345, a-403--a-413, a-618,
+ a-623--a-633, a-712--a-726, b-13--b-26
+ \item \texttt {\PrintChar{092}DeclareTextAccentDefault}\pfill
+ \usage{3}, \main{a-135}, a-176--a-189, a-226, a-229,
+ a-844--a-861
+ \item \texttt {\PrintChar{092}DeclareTextCommand}\pfill \usage{1},
+ \main{a-3}, a-58, a-65, a-346, a-349, a-352, a-374,
+ a-376, a-378, a-380, a-386, a-393, a-414, a-417, a-421,
+ a-424, a-426, a-428, a-607, a-634, a-636, a-639, a-642,
+ a-672, a-679, a-706, a-709, a-756, b-27, b-30, b-34,
+ b-36, b-38, b-40
+ \item \texttt {\PrintChar{092}DeclareTextCommandDefault}\pfill
+ \usage{3}, \main{a-57}, a-136, a-138, a-230,
+ a-233--a-236, a-238, a-242, a-246--a-250
+ \item \texttt {\PrintChar{092}DeclareTextComposite}\pfill \usage{2},
+ \main{a-74}, a-483--a-592, a-686--a-701, b-75,
+ b-441--b-444, b-446--b-451, b-454, b-455, b-458, b-459,
+ b-462, b-463
+ \item \texttt {\PrintChar{092}DeclareTextCompositeCommand}\pfill
+ \usage{2}, \main{a-74}, a-383, a-669
+ \item \texttt {\PrintChar{092}DeclareTextSymbol}\pfill \usage{1},
+ \main{a-3}, a-355--a-373, a-430--a-482, a-596--a-606,
+ a-616, a-617, a-645--a-668, a-727--a-755, a-762--a-841,
+ b-42--b-74, b-76--b-139, b-141--b-196, b-199--b-254,
+ b-257--b-312, b-315--b-370, b-372, b-373, b-375--b-390,
+ b-392--b-395, b-397--b-408, b-410, b-411, b-413, b-414,
+ b-416, b-417, b-419--b-424, b-426, b-427, b-429--b-438
+ \item \texttt {\PrintChar{092}DeclareTextSymbolDefault}\pfill
+ \usage{3}, \main{a-135}, a-190--a-225, a-227, a-228,
+ a-862--a-970
+ \item \texttt {\PrintChar{092}DH}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-432}
+ \item \texttt {\PrintChar{092}dh}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-442}
+ \item \texttt {\PrintChar{092}dimen@}\pfill a-381, a-382,
+ a-384, a-385, a-670, a-671
+ \item \texttt {\PrintChar{092}DJ}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-433}
+ \item \texttt {\PrintChar{092}dj}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-443}
+ \item \texttt {\PrintChar{092}dots}\pfill a-264, a-266
+
+ \indexspace
+{\bfseries\hfil E\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}@eha}\pfill a-49
+ \item \texttt {\PrintChar{092}@@enc@update}\pfill a-133
+ \item \texttt {\PrintChar{092}encodingdefault}\pfill a-300, a-326
+
+ \indexspace
+{\bfseries\hfil F\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}f}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-24}
+ \subitem \texttt {T2B} encoding\pfill \main{b-24}
+ \subitem \texttt {T2C} encoding\pfill \main{b-24}
+ \subitem \texttt {X2} encoding\pfill \main{b-24}
+ \item \texttt {\PrintChar{092}f@encoding}\pfill a-128
+ \item \texttt {\PrintChar{092}f@size}\pfill a-130
+ \item \texttt {\PrintChar{092}@firstofone}\pfill a-68, a-113
+ \item \texttt {\PrintChar{092}@firstoftwo}\pfill a-97
+ \item \texttt {\PrintChar{092}font}\pfill a-243--a-245, a-387, a-394,
+ a-673, a-680
+ \item \texttt {\PrintChar{092}font@name}\pfill a-129, a-132
+ \item \texttt {\PrintChar{092}fontdimen}\pfill a-243--a-245, a-387,
+ a-394, a-673, a-680
+ \item \texttt {\PrintChar{092}fontencoding}\pfill a-326
+ \item \texttt {\PrintChar{092}fontshape}\pfill a-397, a-683
+
+ \indexspace
+{\bfseries\hfil G\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}@gobble}\pfill a-24
+ \item \texttt {\PrintChar{092}guillemotleft}\efill
+ \subitem \texttt {OT4} encoding\pfill \main{a-650}
+ \subitem \texttt {T1} encoding\pfill \main{a-444}
+ \subitem \texttt {T2A} encoding\pfill \main{b-71}
+ \subitem \texttt {T2B} encoding\pfill \main{b-71}
+ \subitem \texttt {T2C} encoding\pfill \main{b-71}
+ \subitem \texttt {X2} encoding\pfill \main{b-71}
+ \item \texttt {\PrintChar{092}guillemotright}\efill
+ \subitem \texttt {OT4} encoding\pfill \main{a-651}
+ \subitem \texttt {T1} encoding\pfill \main{a-445}
+ \subitem \texttt {T2A} encoding\pfill \main{b-72}
+ \subitem \texttt {T2B} encoding\pfill \main{b-72}
+ \subitem \texttt {T2C} encoding\pfill \main{b-72}
+ \subitem \texttt {X2} encoding\pfill \main{b-72}
+ \item \texttt {\PrintChar{092}guilsinglleft}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-446}
+ \item \texttt {\PrintChar{092}guilsinglright}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-447}
+
+ \indexspace
+{\bfseries\hfil H\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}H}\efill
+ \subitem default\pfill \main{a-180}
+ \subitem \texttt {OT1} encoding\pfill \main{a-342}
+ \subitem \texttt {OT4} encoding\pfill \main{a-630}
+ \subitem \texttt {T1} encoding\pfill \main{a-408}
+ \subsubitem \texttt {O} composite\pfill \main{a-496}
+ \subsubitem \texttt {o} composite\pfill \main{a-523}
+ \subsubitem \texttt {U} composite\pfill \main{a-504}
+ \subsubitem \texttt {u} composite\pfill \main{a-531}
+ \subitem \texttt {T2A} encoding\pfill \main{b-18}
+ \subitem \texttt {T2B} encoding\pfill \main{b-18}
+ \subitem \texttt {T2C} encoding\pfill \main{b-18}
+ \subitem \texttt {X2} encoding\pfill \main{b-18}
+ \item \texttt {\PrintChar{092}hb@xt@}\pfill a-377
+ \item \texttt {\PrintChar{092}@height}\pfill a-239, a-241
+ \item \texttt {\PrintChar{092}hidewidth}\pfill a-347, a-348, a-351,
+ a-354, a-415, a-416, a-419, a-423, a-425, a-637, a-638,
+ a-641, a-644, a-708, a-711, b-28, b-29, b-32, b-35,
+ b-37
+ \item \texttt {\PrintChar{092}hmode@bgroup}\pfill a-67, \main{a-73},
+ a-347, a-353, a-379, a-386, a-393, a-415, a-422, a-607,
+ a-637, a-643, a-672, a-679, a-707, a-710, a-756
+ \item \texttt {\PrintChar{092}hmode@start@before@group}\pfill a-68,
+ a-111, a-113, a-119, \main{a-134}
+ \item \texttt {\PrintChar{092}hrule}\pfill a-237, a-240
+ \item \texttt {\PrintChar{092}hyphenation}\pfill \main{a-155}
+ \item \texttt {\PrintChar{092}@@hyphenation}\pfill \main{a-155}
+
+ \indexspace
+{\bfseries\hfil I\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}i}\pfill a-483, a-575, a-577, a-579,
+ a-581, b-75
+ \subitem default\pfill \main{a-197}
+ \subitem \texttt {OT1} encoding\pfill \main{a-359}
+ \subitem \texttt {OT4} encoding\pfill \main{a-652}
+ \subitem \texttt {T1} encoding\pfill \main{a-448}
+ \subitem \texttt {T2A} encoding\pfill \main{b-73}
+ \subitem \texttt {T2B} encoding\pfill \main{b-73}
+ \subitem \texttt {T2C} encoding\pfill \main{b-73}
+ \item \texttt {\PrintChar{092}@ifdefinable}\pfill a-16
+ \item \texttt {\PrintChar{092}ifin@}\pfill a-316, a-319
+ \item \texttt {\PrintChar{092}@ifl@ter}\pfill a-330, a-331
+ \item \texttt {\PrintChar{092}@ifl@ter@@}\pfill a-330, a-331
+ \item \texttt {\PrintChar{092}in@}\pfill a-314, a-317
+ \item \texttt {\PrintChar{092}@inmathwarn}\pfill \main{a-3}
+ \item \texttt {\PrintChar{092}input}\pfill a-971
+ \item \texttt {\PrintChar{092}InputIfFileExists}\pfill a-304
+ \item \texttt {\PrintChar{092}itshape}\pfill a-395, a-681
+
+ \indexspace
+{\bfseries\hfil J\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}j}\efill
+ \subitem default\pfill \main{a-198}
+ \subitem \texttt {OT1} encoding\pfill \main{a-360}
+ \subitem \texttt {OT4} encoding\pfill \main{a-653}
+ \subitem \texttt {T1} encoding\pfill \main{a-449}
+ \subitem \texttt {T2A} encoding\pfill \main{b-74}
+ \subitem \texttt {T2B} encoding\pfill \main{b-74}
+ \subitem \texttt {T2C} encoding\pfill \main{b-74}
+
+ \indexspace
+{\bfseries\hfil K\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}k}\efill
+ \subitem \texttt {OT4} encoding\pfill \main{a-634}
+ \subsubitem \texttt {A} composite\pfill \main{a-686}
+ \subsubitem \texttt {a} composite\pfill \main{a-693}
+ \subsubitem \texttt {E} composite\pfill \main{a-688}
+ \subsubitem \texttt {e} composite\pfill \main{a-695}
+ \subitem \texttt {T1} encoding\pfill \main{a-424}
+ \subsubitem \texttt {A} composite\pfill \main{a-485}
+ \subsubitem \texttt {a} composite\pfill \main{a-512}
+ \subsubitem \texttt {E} composite\pfill \main{a-490}
+ \subsubitem \texttt {e} composite\pfill \main{a-517}
+ \subitem \texttt {T2A} encoding\pfill \main{b-36}
+ \subsubitem \texttt {\PrintChar{092}CYRS} composite\pfill
+ \main{b-450}
+ \subsubitem \texttt {\PrintChar{092}cyrs} composite\pfill
+ \main{b-451}
+ \subitem \texttt {T2B} encoding\pfill \main{b-36}
+ \subitem \texttt {T2C} encoding\pfill \main{b-36}
+ \subsubitem \texttt {\PrintChar{092}CYRABHCH} composite\pfill
+ \main{b-461}
+ \subsubitem \texttt {\PrintChar{092}cyrabhch} composite\pfill
+ \main{b-463}
+ \subitem \texttt {X2} encoding\pfill \main{b-36}
+ \subsubitem \texttt {\PrintChar{092}CYRABHCH} composite\pfill
+ \main{b-457}
+ \subsubitem \texttt {\PrintChar{092}cyrabhch} composite\pfill
+ \main{b-459}
+ \subsubitem \texttt {\PrintChar{092}CYRS} composite\pfill
+ \main{b-450}
+ \subsubitem \texttt {\PrintChar{092}cyrs} composite\pfill
+ \main{b-451}
+
+ \indexspace
+{\bfseries\hfil L\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}L}\efill
+ \subitem default\pfill \main{a-192}
+ \subitem \texttt {OT1} encoding\pfill \main{a-376}
+ \subitem \texttt {OT4} encoding\pfill \main{a-648}
+ \subitem \texttt {T1} encoding\pfill \main{a-434}
+ \item \texttt {\PrintChar{092}l}\efill
+ \subitem default\pfill \main{a-199}
+ \subitem \texttt {OT1} encoding\pfill \main{a-378}
+ \subitem \texttt {OT4} encoding\pfill \main{a-654}
+ \subitem \texttt {T1} encoding\pfill \main{a-450}
+ \item \texttt {\PrintChar{092}LastDeclaredEncoding}\pfill b-12--b-27,
+ b-30, b-34, b-36, b-38, b-40, b-42--b-139,
+ b-372, b-373, b-392--b-395, b-410, b-411, b-416, b-417,
+ b-426, b-427, b-441--b-444, b-446--b-451, b-454, b-455
+ \item \texttt {\PrintChar{092}@latex@error}\pfill a-47
+ \item \texttt {\PrintChar{092}@latex@warning}\pfill a-55
+ \item \texttt {\PrintChar{092}lbrace}\pfill a-252
+ \item \texttt {\PrintChar{092}lccode}\pfill a-104
+ \item \texttt {\PrintChar{092}ldots}\pfill a-266
+ \item \texttt {\PrintChar{092}leavevmode}\pfill a-73, a-134, a-235,
+ a-237, a-350, a-377, a-381, a-384, a-418, a-640, a-670,
+ b-31
+ \item \texttt {\PrintChar{092}lowercase}\pfill a-105, a-302
+
+ \indexspace
+{\bfseries\hfil M\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}mathchardef}\pfill a-70
+ \item \texttt {\PrintChar{092}mathdollar}\pfill a-251
+ \item \texttt {\PrintChar{092}mathellipsis}\pfill a-265
+ \item \texttt {\PrintChar{092}mathparagraph}\pfill a-254
+ \item \texttt {\PrintChar{092}mathsection}\pfill a-255
+ \item \texttt {\PrintChar{092}mathsterling}\pfill a-263
+ \item \texttt {\PrintChar{092}mbox}\pfill a-239
+ \item \texttt {\PrintChar{092}MessageBreak}\pfill a-121, a-307,
+ a-310
+
+ \indexspace
+{\bfseries\hfil N\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}NeedsTeXFormat}\pfill b-2
+ \item \texttt {\PrintChar{092}newcommand}\pfill a-4
+ \item \texttt {\PrintChar{092}newtie}\efill
+ \subitem default\pfill \main{a-860}
+ \subitem \texttt {TS1} encoding\pfill \main{a-725}
+ \item \texttt {\PrintChar{092}nfss@text}\pfill a-259, a-261
+ \item \texttt {\PrintChar{092}NG}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-435}
+ \item \texttt {\PrintChar{092}ng}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-451}
+ \item \texttt {\PrintChar{092}@nil}\pfill a-77
+ \item \texttt {\PrintChar{092}null}\pfill a-425, a-708, a-711, b-37
+
+ \indexspace
+{\bfseries\hfil O\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}O}\efill
+ \subitem default\pfill \main{a-194}
+ \subitem \texttt {OT1} encoding\pfill \main{a-357}
+ \subitem \texttt {OT4} encoding\pfill \main{a-647}
+ \subitem \texttt {T1} encoding\pfill \main{a-437}
+ \item \texttt {\PrintChar{092}o}\efill
+ \subitem default\pfill \main{a-201}
+ \subitem \texttt {OT1} encoding\pfill \main{a-362}
+ \subitem \texttt {OT4} encoding\pfill \main{a-655}
+ \subitem \texttt {T1} encoding\pfill \main{a-453}
+ \item \texttt {\PrintChar{092}o@lign}\pfill a-347, a-354, a-415,
+ a-423, a-637, a-644, b-28, b-35
+ \item \texttt {\PrintChar{092}oalign}\pfill a-425, b-37
+ \item \texttt {\PrintChar{092}OE}\efill
+ \subitem default\pfill \main{a-193}
+ \subitem \texttt {OT1} encoding\pfill \main{a-356}
+ \subitem \texttt {OT4} encoding\pfill \main{a-646}
+ \subitem \texttt {T1} encoding\pfill \main{a-436}
+ \item \texttt {\PrintChar{092}oe}\efill
+ \subitem default\pfill \main{a-200}
+ \subitem \texttt {OT1} encoding\pfill \main{a-361}
+ \subitem \texttt {OT4} encoding\pfill \main{a-656}
+ \subitem \texttt {T1} encoding\pfill \main{a-452}
+ \item \texttt {\PrintChar{092}@onlypreamble}\pfill a-18, a-19,
+ a-61, a-62, a-66, a-89, a-109, a-139, a-140, a-154
+ \item \texttt {\PrintChar{092}ooalign}\pfill a-351, a-419, a-608,
+ a-641, a-708, a-711, a-757, b-32
+
+ \indexspace
+{\bfseries\hfil P\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}P}\pfill a-254
+ \item \texttt {\PrintChar{092}PackageError}\pfill a-305
+ \item \texttt {\PrintChar{092}patterns}\pfill \main{a-155}
+ \item \texttt {\PrintChar{092}@@patterns}\pfill \main{a-155}
+ \item \texttt {\PrintChar{092}pickup@font}\pfill a-131
+ \item \texttt {\PrintChar{092}pounds}\pfill a-262
+ \item \texttt {\PrintChar{092}ProcessOptions}\pfill a-325
+ \item \texttt {\PrintChar{092}protect}\pfill a-21, a-27, a-48, a-55,
+ a-159, a-167
+ \item \texttt {\PrintChar{092}providecommand}\pfill a-6
+ \item \texttt {\PrintChar{092}ProvidesFile}\pfill b-3--b-6
+ \item \texttt {\PrintChar{092}ProvideTextCommand}\pfill \usage{1},
+ \main{a-3}, a-60
+ \item \texttt {\PrintChar{092}ProvideTextCommandDefault}\pfill
+ \usage{3}, \main{a-57}
+
+ \indexspace
+{\bfseries\hfil Q\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}quotedblbase}\efill
+ \subitem \texttt {OT4} encoding\pfill \main{a-657}
+ \subitem \texttt {T1} encoding\pfill \main{a-454}
+ \subitem \texttt {T2A} encoding\pfill \main{b-67}
+ \subitem \texttt {T2B} encoding\pfill \main{b-67}
+ \subitem \texttt {T2C} encoding\pfill \main{b-67}
+ \subitem \texttt {X2} encoding\pfill \main{b-67}
+ \item \texttt {\PrintChar{092}quotesinglbase}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-455}
+
+ \indexspace
+{\bfseries\hfil R\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}r}\efill
+ \subitem default\pfill \main{a-186}
+ \subitem \texttt {OT1} encoding\pfill \main{a-345}
+ \subsubitem \texttt {A} composite\pfill \main{a-383}
+ \subitem \texttt {OT4} encoding\pfill \main{a-633}
+ \subsubitem \texttt {A} composite\pfill \main{a-669}
+ \subitem \texttt {T1} encoding\pfill \main{a-409}
+ \subsubitem \texttt {A} composite\pfill \main{a-542}
+ \subsubitem \texttt {a} composite\pfill \main{a-568}
+ \subsubitem \texttt {U} composite\pfill \main{a-505}
+ \subsubitem \texttt {u} composite\pfill \main{a-532}
+ \subitem \texttt {T2A} encoding\pfill \main{b-19}
+ \subitem \texttt {T2B} encoding\pfill \main{b-19}
+ \subitem \texttt {T2C} encoding\pfill \main{b-19}
+ \subitem \texttt {X2} encoding\pfill \main{b-19}
+ \item \texttt {\PrintChar{092}raise}\pfill a-382, a-385, a-609,
+ a-671, a-758
+ \item \texttt {\PrintChar{092}rbrace}\pfill a-253
+ \item \texttt {\PrintChar{092}@rc@ifdefinable}\pfill a-16
+ \item \texttt {\PrintChar{092}reserved@a}\pfill a-75, a-77, a-85,
+ a-102, a-107
+ \item \texttt {\PrintChar{092}reserved@b}\pfill a-78, a-85
+ \item \texttt {\PrintChar{092}reserved@f}\pfill a-301--a-304, a-306,
+ a-313
+ \item \texttt {\PrintChar{092}rlap}\pfill a-382, a-385, a-671
+
+ \indexspace
+{\bfseries\hfil S\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}S}\pfill a-255
+ \item \texttt {\PrintChar{092}scshape}\pfill a-246
+ \item \texttt {\PrintChar{092}@secondoftwo}\pfill a-95
+ \item \texttt {\PrintChar{092}selectfont}\pfill a-326, a-397, a-683
+ \item \texttt {\PrintChar{092}sh@ft}\pfill a-347, a-354, a-415,
+ a-423, a-637, a-644, b-28, b-35
+ \item \texttt {\PrintChar{092}slshape}\pfill a-388, a-674
+ \item \texttt {\PrintChar{092}spacefactor}\pfill a-70, a-71
+ \item \texttt {\PrintChar{092}SS}\efill
+ \subitem default\pfill \main{a-248}
+ \subitem \texttt {T1} encoding\pfill \main{a-438}
+ \item \texttt {\PrintChar{092}ss}\efill
+ \subitem default\pfill \main{a-202}
+ \subitem \texttt {OT1} encoding\pfill \main{a-363}
+ \subitem \texttt {OT4} encoding\pfill \main{a-658}
+ \subitem \texttt {T1} encoding\pfill \main{a-456}
+ \item \texttt {\PrintChar{092}@strip@args}\pfill \main{a-74}
+ \item \texttt {\PrintChar{092}symbol}\pfill a-122
+
+ \indexspace
+{\bfseries\hfil T\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}t}\efill
+ \subitem default\pfill \main{a-229}, \main{a-858}
+ \subitem \texttt {OML} encoding\pfill \main{a-618}
+ \subitem \texttt {TS1} encoding\pfill \main{a-723}
+ \item \texttt {\PrintChar{092}@tabacckludge}\pfill a-173, a-175
+ \item \texttt {\PrintChar{092}@tempboxa}\pfill a-69
+ \item \texttt {\PrintChar{092}@text@composite}\pfill \main{a-74}
+ \item \texttt {\PrintChar{092}@text@composite@x}\pfill \main{a-74}
+ \item \texttt {\PrintChar{092}textacutedbl}\efill
+ \subitem default\pfill \main{a-908}
+ \subitem \texttt {TS1} encoding\pfill \main{a-778}
+ \item \texttt {\PrintChar{092}textascendercompwordmark}\efill
+ \subitem default\pfill \main{a-863}
+ \subitem \texttt {TS1} encoding\pfill \main{a-728}
+ \item \texttt {\PrintChar{092}textasciiacute}\efill
+ \subitem default\pfill \main{a-957}
+ \subitem \texttt {TS1} encoding\pfill \main{a-828}
+ \item \texttt {\PrintChar{092}textasciibreve}\efill
+ \subitem default\pfill \main{a-905}
+ \subitem \texttt {TS1} encoding\pfill \main{a-776}
+ \item \texttt {\PrintChar{092}textasciicaron}\efill
+ \subitem default\pfill \main{a-906}
+ \subitem \texttt {TS1} encoding\pfill \main{a-777}
+ \item \texttt {\PrintChar{092}textasciicircum}\efill
+ \subitem default\pfill \main{a-233}
+ \subitem \texttt {T1} encoding\pfill \main{a-457}
+ \subitem \texttt {T2A} encoding\pfill \main{b-53}
+ \subitem \texttt {T2B} encoding\pfill \main{b-53}
+ \subitem \texttt {T2C} encoding\pfill \main{b-53}
+ \subitem \texttt {X2} encoding\pfill \main{b-53}
+ \item \texttt {\PrintChar{092}textasciidieresis}\efill
+ \subitem default\pfill \main{a-945}
+ \subitem \texttt {TS1} encoding\pfill \main{a-816}
+ \item \texttt {\PrintChar{092}textasciigrave}\efill
+ \subitem default\pfill \main{a-896}
+ \subitem \texttt {TS1} encoding\pfill \main{a-767}
+ \item \texttt {\PrintChar{092}textasciimacron}\efill
+ \subitem default\pfill \main{a-952}
+ \subitem \texttt {TS1} encoding\pfill \main{a-823}
+ \item \texttt {\PrintChar{092}textasciitilde}\efill
+ \subitem default\pfill \main{a-234}
+ \subitem \texttt {T1} encoding\pfill \main{a-458}
+ \subitem \texttt {T2A} encoding\pfill \main{b-58}
+ \subitem \texttt {T2B} encoding\pfill \main{b-58}
+ \subitem \texttt {T2C} encoding\pfill \main{b-58}
+ \subitem \texttt {X2} encoding\pfill \main{b-58}
+ \item \texttt {\PrintChar{092}textasteriskcentered}\efill
+ \subitem default\pfill \main{a-215}, \main{a-873}
+ \subitem \texttt {OMS} encoding\pfill \main{a-596}
+ \subitem \texttt {TS1} encoding\pfill \main{a-738}
+ \item \texttt {\PrintChar{092}textbackslash}\efill
+ \subitem default\pfill \main{a-216}
+ \subitem \texttt {OMS} encoding\pfill \main{a-597}
+ \subitem \texttt {T1} encoding\pfill \main{a-459}
+ \subitem \texttt {T2A} encoding\pfill \main{b-52}
+ \subitem \texttt {T2B} encoding\pfill \main{b-52}
+ \subitem \texttt {T2C} encoding\pfill \main{b-52}
+ \subitem \texttt {X2} encoding\pfill \main{b-52}
+ \item \texttt {\PrintChar{092}textbaht}\efill
+ \subitem default\pfill \main{a-931}
+ \subitem \texttt {TS1} encoding\pfill \main{a-802}
+ \item \texttt {\PrintChar{092}textbar}\efill
+ \subitem default\pfill \main{a-217}
+ \subitem \texttt {OMS} encoding\pfill \main{a-598}
+ \subitem \texttt {T1} encoding\pfill \main{a-460}
+ \subitem \texttt {T2A} encoding\pfill \main{b-56}
+ \subitem \texttt {T2B} encoding\pfill \main{b-56}
+ \subitem \texttt {T2C} encoding\pfill \main{b-56}
+ \subitem \texttt {X2} encoding\pfill \main{b-56}
+ \item \texttt {\PrintChar{092}textbardbl}\efill
+ \subitem default\pfill \main{a-911}
+ \subitem \texttt {TS1} encoding\pfill \main{a-782}
+ \item \texttt {\PrintChar{092}textbigcircle}\efill
+ \subitem default\pfill \main{a-890}
+ \subitem \texttt {TS1} encoding\pfill \main{a-755}
+ \item \texttt {\PrintChar{092}textblank}\efill
+ \subitem default\pfill \main{a-870}
+ \subitem \texttt {TS1} encoding\pfill \main{a-735}
+ \item \texttt {\PrintChar{092}textborn}\efill
+ \subitem default\pfill \main{a-897}
+ \subitem \texttt {TS1} encoding\pfill \main{a-768}
+ \item \texttt {\PrintChar{092}textbraceleft}\pfill a-252
+ \subitem default\pfill \main{a-218}
+ \subitem \texttt {OMS} encoding\pfill \main{a-599}
+ \subitem \texttt {T1} encoding\pfill \main{a-461}
+ \subitem \texttt {T2A} encoding\pfill \main{b-55}
+ \subitem \texttt {T2B} encoding\pfill \main{b-55}
+ \subitem \texttt {T2C} encoding\pfill \main{b-55}
+ \subitem \texttt {X2} encoding\pfill \main{b-55}
+ \item \texttt {\PrintChar{092}textbraceright}\pfill a-253
+ \subitem default\pfill \main{a-219}
+ \subitem \texttt {OMS} encoding\pfill \main{a-600}
+ \subitem \texttt {T1} encoding\pfill \main{a-462}
+ \subitem \texttt {T2A} encoding\pfill \main{b-57}
+ \subitem \texttt {T2B} encoding\pfill \main{b-57}
+ \subitem \texttt {T2C} encoding\pfill \main{b-57}
+ \subitem \texttt {X2} encoding\pfill \main{b-57}
+ \item \texttt {\PrintChar{092}textbrokenbar}\efill
+ \subitem default\pfill \main{a-943}
+ \subitem \texttt {TS1} encoding\pfill \main{a-814}
+ \item \texttt {\PrintChar{092}textbullet}\efill
+ \subitem default\pfill \main{a-220}, \main{a-913}
+ \subitem \texttt {OMS} encoding\pfill \main{a-601}
+ \subitem \texttt {TS1} encoding\pfill \main{a-784}
+ \item \texttt {\PrintChar{092}textcapitalcompwordmark}\efill
+ \subitem default\pfill \main{a-862}
+ \subitem \texttt {TS1} encoding\pfill \main{a-727}
+ \item \texttt {\PrintChar{092}textcelsius}\efill
+ \subitem default\pfill \main{a-914}
+ \subitem \texttt {TS1} encoding\pfill \main{a-785}
+ \item \texttt {\PrintChar{092}textcent}\efill
+ \subitem default\pfill \main{a-939}
+ \subitem \texttt {TS1} encoding\pfill \main{a-810}
+ \item \texttt {\PrintChar{092}textcentoldstyle}\efill
+ \subitem default\pfill \main{a-916}
+ \subitem \texttt {TS1} encoding\pfill \main{a-787}
+ \item \texttt {\PrintChar{092}textcircled}\pfill a-230, a-246
+ \subitem default\pfill \main{a-226}, \main{a-843}
+ \subitem \texttt {OMS} encoding\pfill \main{a-607}
+ \subitem \texttt {TS1} encoding\pfill \main{a-756}
+ \item \texttt {\PrintChar{092}textcircledP}\efill
+ \subitem default\pfill \main{a-950}
+ \subitem \texttt {TS1} encoding\pfill \main{a-821}
+ \item \texttt {\PrintChar{092}textcolonmonetary}\efill
+ \subitem default\pfill \main{a-918}
+ \subitem \texttt {TS1} encoding\pfill \main{a-789}
+ \item \texttt {\PrintChar{092}textcompwordmark}\efill
+ \subitem default\pfill \main{a-235}
+ \subitem \texttt {T1} encoding\pfill \main{a-463}
+ \subitem \texttt {T2A} encoding\pfill \main{b-45}
+ \subitem \texttt {T2B} encoding\pfill \main{b-45}
+ \subitem \texttt {T2C} encoding\pfill \main{b-45}
+ \subitem \texttt {X2} encoding\pfill \main{b-45}
+ \item \texttt {\PrintChar{092}textcopyleft}\efill
+ \subitem default\pfill \main{a-948}
+ \subitem \texttt {TS1} encoding\pfill \main{a-819}
+ \item \texttt {\PrintChar{092}textcopyright}\pfill a-261
+ \subitem default\pfill \main{a-230}, \main{a-946}
+ \subitem \texttt {TS1} encoding\pfill \main{a-817}
+ \item \texttt {\PrintChar{092}textcurrency}\efill
+ \subitem default\pfill \main{a-941}
+ \subitem \texttt {T2A} encoding\pfill \main{b-60}
+ \subitem \texttt {T2B} encoding\pfill \main{b-60}
+ \subitem \texttt {T2C} encoding\pfill \main{b-60}
+ \subitem \texttt {TS1} encoding\pfill \main{a-812}
+ \subitem \texttt {X2} encoding\pfill \main{b-60}
+ \item \texttt {\PrintChar{092}textdagger}\pfill a-256
+ \subitem default\pfill \main{a-222}, \main{a-909}
+ \subitem \texttt {OMS} encoding\pfill \main{a-603}
+ \subitem \texttt {TS1} encoding\pfill \main{a-780}
+ \item \texttt {\PrintChar{092}textdaggerdbl}\pfill a-257
+ \subitem default\pfill \main{a-221}, \main{a-910}
+ \subitem \texttt {OMS} encoding\pfill \main{a-602}
+ \subitem \texttt {TS1} encoding\pfill \main{a-781}
+ \item \texttt {\PrintChar{092}textdblhyphen}\efill
+ \subitem default\pfill \main{a-874}
+ \subitem \texttt {TS1} encoding\pfill \main{a-739}
+ \item \texttt {\PrintChar{092}textdblhyphenchar}\efill
+ \subitem default\pfill \main{a-904}
+ \subitem \texttt {TS1} encoding\pfill \main{a-775}
+ \item \texttt {\PrintChar{092}textdegree}\efill
+ \subitem default\pfill \main{a-953}
+ \subitem \texttt {TS1} encoding\pfill \main{a-824}
+ \item \texttt {\PrintChar{092}textdied}\efill
+ \subitem default\pfill \main{a-899}
+ \subitem \texttt {TS1} encoding\pfill \main{a-770}
+ \item \texttt {\PrintChar{092}textdiscount}\efill
+ \subitem default\pfill \main{a-933}
+ \subitem \texttt {TS1} encoding\pfill \main{a-804}
+ \item \texttt {\PrintChar{092}textdiv}\efill
+ \subitem default\pfill \main{a-970}
+ \subitem \texttt {TS1} encoding\pfill \main{a-841}
+ \item \texttt {\PrintChar{092}textdivorced}\efill
+ \subitem default\pfill \main{a-898}
+ \subitem \texttt {TS1} encoding\pfill \main{a-769}
+ \item \texttt {\PrintChar{092}textdollar}\pfill a-251, a-973, a-975
+ \subitem default\pfill \main{a-203}, \main{a-871}
+ \subitem \texttt {OT1} encoding\pfill \main{a-386}
+ \subitem \texttt {OT4} encoding\pfill \main{a-672}
+ \subitem \texttt {T1} encoding\pfill \main{a-464}
+ \subitem \texttt {T2A} encoding\pfill \main{b-47}
+ \subitem \texttt {T2B} encoding\pfill \main{b-47}
+ \subitem \texttt {T2C} encoding\pfill \main{b-47}
+ \subitem \texttt {TS1} encoding\pfill \main{a-736}
+ \subitem \texttt {X2} encoding\pfill \main{b-47}
+ \item \texttt {\PrintChar{092}textdollaroldstyle}\efill
+ \subitem default\pfill \main{a-915}
+ \subitem \texttt {TS1} encoding\pfill \main{a-786}
+ \item \texttt {\PrintChar{092}textdong}\efill
+ \subitem default\pfill \main{a-927}
+ \subitem \texttt {TS1} encoding\pfill \main{a-798}
+ \item \texttt {\PrintChar{092}textdownarrow}\efill
+ \subitem default\pfill \main{a-895}
+ \subitem \texttt {TS1} encoding\pfill \main{a-766}
+ \item \texttt {\PrintChar{092}texteightoldstyle}\efill
+ \subitem default\pfill \main{a-884}
+ \subitem \texttt {TS1} encoding\pfill \main{a-749}
+ \item \texttt {\PrintChar{092}textellipsis}\pfill a-265
+ \subitem default\pfill \main{a-242}
+ \item \texttt {\PrintChar{092}textemdash}\efill
+ \subitem default\pfill \main{a-204}
+ \subitem \texttt {OT1} encoding\pfill \main{a-364}
+ \subitem \texttt {OT4} encoding\pfill \main{a-659}
+ \subitem \texttt {T1} encoding\pfill \main{a-465}
+ \subitem \texttt {T2A} encoding\pfill \main{b-44}
+ \subitem \texttt {T2B} encoding\pfill \main{b-44}
+ \subitem \texttt {T2C} encoding\pfill \main{b-44}
+ \subitem \texttt {X2} encoding\pfill \main{b-44}
+ \item \texttt {\PrintChar{092}textendash}\efill
+ \subitem default\pfill \main{a-205}
+ \subitem \texttt {OT1} encoding\pfill \main{a-365}
+ \subitem \texttt {OT4} encoding\pfill \main{a-660}
+ \subitem \texttt {T1} encoding\pfill \main{a-466}
+ \subitem \texttt {T2A} encoding\pfill \main{b-42}
+ \subitem \texttt {T2B} encoding\pfill \main{b-42}
+ \subitem \texttt {T2C} encoding\pfill \main{b-42}
+ \subitem \texttt {X2} encoding\pfill \main{b-42}
+ \item \texttt {\PrintChar{092}textestimated}\efill
+ \subitem default\pfill \main{a-934}
+ \subitem \texttt {TS1} encoding\pfill \main{a-805}
+ \item \texttt {\PrintChar{092}texteuro}\efill
+ \subitem default\pfill \main{a-968}
+ \subitem \texttt {TS1} encoding\pfill \main{a-839}
+ \item \texttt {\PrintChar{092}textexclamdown}\efill
+ \subitem default\pfill \main{a-206}
+ \subitem \texttt {OT1} encoding\pfill \main{a-366}
+ \subitem \texttt {OT4} encoding\pfill \main{a-661}
+ \subitem \texttt {T1} encoding\pfill \main{a-467}
+ \item \texttt {\PrintChar{092}textfiveoldstyle}\efill
+ \subitem default\pfill \main{a-881}
+ \subitem \texttt {TS1} encoding\pfill \main{a-746}
+ \item \texttt {\PrintChar{092}textflorin}\efill
+ \subitem default\pfill \main{a-917}
+ \subitem \texttt {TS1} encoding\pfill \main{a-788}
+ \item \texttt {\PrintChar{092}textfouroldstyle}\efill
+ \subitem default\pfill \main{a-880}
+ \subitem \texttt {TS1} encoding\pfill \main{a-745}
+ \item \texttt {\PrintChar{092}textfractionsolidus}\efill
+ \subitem default\pfill \main{a-875}
+ \subitem \texttt {TS1} encoding\pfill \main{a-740}
+ \item \texttt {\PrintChar{092}textgravedbl}\efill
+ \subitem default\pfill \main{a-907}
+ \subitem \texttt {TS1} encoding\pfill \main{a-779}
+ \item \texttt {\PrintChar{092}textgreater}\efill
+ \subitem default\pfill \main{a-228}
+ \subitem \texttt {OML} encoding\pfill \main{a-617}
+ \subitem \texttt {T1} encoding\pfill \main{a-468}
+ \subitem \texttt {T2A} encoding\pfill \main{b-49}
+ \subitem \texttt {T2B} encoding\pfill \main{b-49}
+ \subitem \texttt {T2C} encoding\pfill \main{b-49}
+ \subitem \texttt {X2} encoding\pfill \main{b-49}
+ \item \texttt {\PrintChar{092}textguarani}\efill
+ \subitem default\pfill \main{a-921}
+ \subitem \texttt {TS1} encoding\pfill \main{a-792}
+ \item \texttt {\PrintChar{092}texthyphen}\pfill a-208, a-368, a-470,
+ a-663, b-51
+ \item \texttt {\PrintChar{092}texthyphenchar}\pfill a-207, a-367,
+ a-469, a-662, b-50
+ \item \texttt {\PrintChar{092}textinterrobang}\efill
+ \subitem default\pfill \main{a-925}
+ \subitem \texttt {TS1} encoding\pfill \main{a-796}
+ \item \texttt {\PrintChar{092}textinterrobangdown}\efill
+ \subitem default\pfill \main{a-926}
+ \subitem \texttt {TS1} encoding\pfill \main{a-797}
+ \item \texttt {\PrintChar{092}textlangle}\efill
+ \subitem default\pfill \main{a-886}
+ \subitem \texttt {TS1} encoding\pfill \main{a-751}
+ \item \texttt {\PrintChar{092}textlbrackdbl}\efill
+ \subitem default\pfill \main{a-892}
+ \subitem \texttt {TS1} encoding\pfill \main{a-763}
+ \item \texttt {\PrintChar{092}textleaf}\efill
+ \subitem default\pfill \main{a-900}
+ \subitem \texttt {TS1} encoding\pfill \main{a-771}
+ \item \texttt {\PrintChar{092}textleftarrow}\efill
+ \subitem default\pfill \main{a-868}
+ \subitem \texttt {TS1} encoding\pfill \main{a-733}
+ \item \texttt {\PrintChar{092}textless}\efill
+ \subitem default\pfill \main{a-227}
+ \subitem \texttt {OML} encoding\pfill \main{a-616}
+ \subitem \texttt {T1} encoding\pfill \main{a-471}
+ \subitem \texttt {T2A} encoding\pfill \main{b-48}
+ \subitem \texttt {T2B} encoding\pfill \main{b-48}
+ \subitem \texttt {T2C} encoding\pfill \main{b-48}
+ \subitem \texttt {X2} encoding\pfill \main{b-48}
+ \item \texttt {\PrintChar{092}textlira}\efill
+ \subitem default\pfill \main{a-923}
+ \subitem \texttt {TS1} encoding\pfill \main{a-794}
+ \item \texttt {\PrintChar{092}textlnot}\efill
+ \subitem default\pfill \main{a-949}
+ \subitem \texttt {TS1} encoding\pfill \main{a-820}
+ \item \texttt {\PrintChar{092}textlquill}\efill
+ \subitem default\pfill \main{a-937}
+ \subitem \texttt {TS1} encoding\pfill \main{a-808}
+ \item \texttt {\PrintChar{092}textmarried}\efill
+ \subitem default\pfill \main{a-901}
+ \subitem \texttt {TS1} encoding\pfill \main{a-772}
+ \item \texttt {\PrintChar{092}textmho}\efill
+ \subitem default\pfill \main{a-889}
+ \subitem \texttt {TS1} encoding\pfill \main{a-754}
+ \item \texttt {\PrintChar{092}textminus}\efill
+ \subitem default\pfill \main{a-887}
+ \subitem \texttt {TS1} encoding\pfill \main{a-752}
+ \item \texttt {\PrintChar{092}textmu}\efill
+ \subitem default\pfill \main{a-958}
+ \subitem \texttt {TS1} encoding\pfill \main{a-829}
+ \item \texttt {\PrintChar{092}textmusicalnote}\efill
+ \subitem default\pfill \main{a-902}
+ \subitem \texttt {TS1} encoding\pfill \main{a-773}
+ \item \texttt {\PrintChar{092}textnaira}\efill
+ \subitem default\pfill \main{a-920}
+ \subitem \texttt {TS1} encoding\pfill \main{a-791}
+ \item \texttt {\PrintChar{092}textnineoldstyle}\efill
+ \subitem default\pfill \main{a-885}
+ \subitem \texttt {TS1} encoding\pfill \main{a-750}
+ \item \texttt {\PrintChar{092}textnumero}\efill
+ \subitem default\pfill \main{a-932}
+ \subitem \texttt {T2A} encoding\pfill \main{b-59}
+ \subitem \texttt {T2B} encoding\pfill \main{b-59}
+ \subitem \texttt {T2C} encoding\pfill \main{b-59}
+ \subitem \texttt {TS1} encoding\pfill \main{a-803}
+ \subitem \texttt {X2} encoding\pfill \main{b-59}
+ \item \texttt {\PrintChar{092}textohm}\efill
+ \subitem default\pfill \main{a-891}
+ \subitem \texttt {TS1} encoding\pfill \main{a-762}
+ \item \texttt {\PrintChar{092}textonehalf}\efill
+ \subitem default\pfill \main{a-966}
+ \subitem \texttt {TS1} encoding\pfill \main{a-837}
+ \item \texttt {\PrintChar{092}textoneoldstyle}\efill
+ \subitem default\pfill \main{a-877}
+ \subitem \texttt {TS1} encoding\pfill \main{a-742}
+ \item \texttt {\PrintChar{092}textonequarter}\efill
+ \subitem default\pfill \main{a-965}
+ \subitem \texttt {TS1} encoding\pfill \main{a-836}
+ \item \texttt {\PrintChar{092}textonesuperior}\efill
+ \subitem default\pfill \main{a-962}
+ \subitem \texttt {TS1} encoding\pfill \main{a-833}
+ \item \texttt {\PrintChar{092}textopenbullet}\efill
+ \subitem default\pfill \main{a-935}
+ \subitem \texttt {TS1} encoding\pfill \main{a-806}
+ \item \texttt {\PrintChar{092}textordfeminine}\efill
+ \subitem default\pfill \main{a-249}, \main{a-947}
+ \subitem \texttt {TS1} encoding\pfill \main{a-818}
+ \item \texttt {\PrintChar{092}textordmasculine}\efill
+ \subitem default\pfill \main{a-250}, \main{a-963}
+ \subitem \texttt {TS1} encoding\pfill \main{a-834}
+ \item \texttt {\PrintChar{092}textparagraph}\pfill a-254
+ \subitem default\pfill \main{a-223}, \main{a-959}
+ \subitem \texttt {OMS} encoding\pfill \main{a-604}
+ \subitem \texttt {TS1} encoding\pfill \main{a-830}
+ \item \texttt {\PrintChar{092}textperiodcentered}\efill
+ \subitem default\pfill \main{a-224}, \main{a-960}
+ \subitem \texttt {OMS} encoding\pfill \main{a-605}
+ \subitem \texttt {TS1} encoding\pfill \main{a-831}
+ \item \texttt {\PrintChar{092}textpertenthousand}\pfill a-977
+ \subitem default\pfill \main{a-929}
+ \subitem \texttt {T1} encoding\pfill \main{a-428}
+ \subitem \texttt {T2A} encoding\pfill \main{b-40}
+ \subitem \texttt {T2B} encoding\pfill \main{b-40}
+ \subitem \texttt {T2C} encoding\pfill \main{b-40}
+ \subitem \texttt {TS1} encoding\pfill \main{a-800}
+ \subitem \texttt {X2} encoding\pfill \main{b-40}
+ \item \texttt {\PrintChar{092}textperthousand}\pfill a-976
+ \subitem default\pfill \main{a-912}
+ \subitem \texttt {T1} encoding\pfill \main{a-426}
+ \subitem \texttt {T2A} encoding\pfill \main{b-38}
+ \subitem \texttt {T2B} encoding\pfill \main{b-38}
+ \subitem \texttt {T2C} encoding\pfill \main{b-38}
+ \subitem \texttt {TS1} encoding\pfill \main{a-783}
+ \subitem \texttt {X2} encoding\pfill \main{b-38}
+ \item \texttt {\PrintChar{092}textpeso}\efill
+ \subitem default\pfill \main{a-922}
+ \subitem \texttt {TS1} encoding\pfill \main{a-793}
+ \item \texttt {\PrintChar{092}textpilcrow}\efill
+ \subitem default\pfill \main{a-930}
+ \subitem \texttt {TS1} encoding\pfill \main{a-801}
+ \item \texttt {\PrintChar{092}textpm}\efill
+ \subitem default\pfill \main{a-954}
+ \subitem \texttt {TS1} encoding\pfill \main{a-825}
+ \item \texttt {\PrintChar{092}textquestiondown}\efill
+ \subitem default\pfill \main{a-209}
+ \subitem \texttt {OT1} encoding\pfill \main{a-369}
+ \subitem \texttt {OT4} encoding\pfill \main{a-664}
+ \subitem \texttt {T1} encoding\pfill \main{a-472}
+ \item \texttt {\PrintChar{092}textquotedbl}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-475}
+ \subitem \texttt {T2A} encoding\pfill \main{b-62}
+ \subitem \texttt {T2B} encoding\pfill \main{b-62}
+ \subitem \texttt {T2C} encoding\pfill \main{b-62}
+ \subitem \texttt {X2} encoding\pfill \main{b-62}
+ \item \texttt {\PrintChar{092}textquotedblleft}\efill
+ \subitem default\pfill \main{a-210}
+ \subitem \texttt {OT1} encoding\pfill \main{a-370}
+ \subitem \texttt {OT4} encoding\pfill \main{a-665}
+ \subitem \texttt {T1} encoding\pfill \main{a-473}
+ \subitem \texttt {T2A} encoding\pfill \main{b-65}
+ \subitem \texttt {T2B} encoding\pfill \main{b-65}
+ \subitem \texttt {T2C} encoding\pfill \main{b-65}
+ \subitem \texttt {X2} encoding\pfill \main{b-65}
+ \item \texttt {\PrintChar{092}textquotedblright}\efill
+ \subitem default\pfill \main{a-211}
+ \subitem \texttt {OT1} encoding\pfill \main{a-371}
+ \subitem \texttt {OT4} encoding\pfill \main{a-666}
+ \subitem \texttt {T1} encoding\pfill \main{a-474}
+ \subitem \texttt {T2A} encoding\pfill \main{b-66}
+ \subitem \texttt {T2B} encoding\pfill \main{b-66}
+ \subitem \texttt {T2C} encoding\pfill \main{b-66}
+ \subitem \texttt {X2} encoding\pfill \main{b-66}
+ \item \texttt {\PrintChar{092}textquoteleft}\efill
+ \subitem default\pfill \main{a-212}
+ \subitem \texttt {OT1} encoding\pfill \main{a-372}
+ \subitem \texttt {OT4} encoding\pfill \main{a-667}
+ \subitem \texttt {T1} encoding\pfill \main{a-476}
+ \subitem \texttt {T2A} encoding\pfill \main{b-63}
+ \subitem \texttt {T2B} encoding\pfill \main{b-63}
+ \subitem \texttt {T2C} encoding\pfill \main{b-63}
+ \subitem \texttt {X2} encoding\pfill \main{b-63}
+ \item \texttt {\PrintChar{092}textquoteright}\efill
+ \subitem default\pfill \main{a-213}
+ \subitem \texttt {OT1} encoding\pfill \main{a-373}
+ \subitem \texttt {OT4} encoding\pfill \main{a-668}
+ \subitem \texttt {T1} encoding\pfill \main{a-477}
+ \subitem \texttt {T2A} encoding\pfill \main{b-64}
+ \subitem \texttt {T2B} encoding\pfill \main{b-64}
+ \subitem \texttt {T2C} encoding\pfill \main{b-64}
+ \subitem \texttt {X2} encoding\pfill \main{b-64}
+ \item \texttt {\PrintChar{092}textquotesingle}\efill
+ \subitem default\pfill \main{a-872}
+ \subitem \texttt {TS1} encoding\pfill \main{a-737}
+ \item \texttt {\PrintChar{092}textquotestraightbase}\efill
+ \subitem default\pfill \main{a-864}
+ \subitem \texttt {TS1} encoding\pfill \main{a-729}
+ \item \texttt {\PrintChar{092}textquotestraightdblbase}\efill
+ \subitem default\pfill \main{a-865}
+ \subitem \texttt {TS1} encoding\pfill \main{a-730}
+ \item \texttt {\PrintChar{092}textrangle}\efill
+ \subitem default\pfill \main{a-888}
+ \subitem \texttt {TS1} encoding\pfill \main{a-753}
+ \item \texttt {\PrintChar{092}textrbrackdbl}\efill
+ \subitem default\pfill \main{a-893}
+ \subitem \texttt {TS1} encoding\pfill \main{a-764}
+ \item \texttt {\PrintChar{092}textrecipe}\efill
+ \subitem default\pfill \main{a-924}
+ \subitem \texttt {TS1} encoding\pfill \main{a-795}
+ \item \texttt {\PrintChar{092}textreferencemark}\efill
+ \subitem default\pfill \main{a-961}
+ \subitem \texttt {TS1} encoding\pfill \main{a-832}
+ \item \texttt {\PrintChar{092}textregistered}\efill
+ \subitem default\pfill \main{a-246}, \main{a-951}
+ \subitem \texttt {TS1} encoding\pfill \main{a-822}
+ \item \texttt {\PrintChar{092}textrightarrow}\efill
+ \subitem default\pfill \main{a-869}
+ \subitem \texttt {TS1} encoding\pfill \main{a-734}
+ \item \texttt {\PrintChar{092}textrquill}\efill
+ \subitem default\pfill \main{a-938}
+ \subitem \texttt {TS1} encoding\pfill \main{a-809}
+ \item \texttt {\PrintChar{092}textsection}\pfill a-255
+ \subitem default\pfill \main{a-225}, \main{a-944}
+ \subitem \texttt {OMS} encoding\pfill \main{a-606}
+ \subitem \texttt {T1} encoding\pfill \main{a-478}
+ \subitem \texttt {T2A} encoding\pfill \main{b-61}
+ \subitem \texttt {T2B} encoding\pfill \main{b-61}
+ \subitem \texttt {T2C} encoding\pfill \main{b-61}
+ \subitem \texttt {TS1} encoding\pfill \main{a-815}
+ \subitem \texttt {X2} encoding\pfill \main{b-61}
+ \item \texttt {\PrintChar{092}textservicemark}\efill
+ \subitem default\pfill \main{a-936}
+ \subitem \texttt {TS1} encoding\pfill \main{a-807}
+ \item \texttt {\PrintChar{092}textsevenoldstyle}\efill
+ \subitem default\pfill \main{a-883}
+ \subitem \texttt {TS1} encoding\pfill \main{a-748}
+ \item \texttt {\PrintChar{092}textsixoldstyle}\efill
+ \subitem default\pfill \main{a-882}
+ \subitem \texttt {TS1} encoding\pfill \main{a-747}
+ \item \texttt {\PrintChar{092}textsterling}\pfill a-263, a-972,
+ a-974
+ \subitem default\pfill \main{a-214}, \main{a-940}
+ \subitem \texttt {OT1} encoding\pfill \main{a-393}
+ \subitem \texttt {OT4} encoding\pfill \main{a-679}
+ \subitem \texttt {T1} encoding\pfill \main{a-479}
+ \subitem \texttt {TS1} encoding\pfill \main{a-811}
+ \item \texttt {\PrintChar{092}textsuperscript}\pfill a-247,
+ a-249, a-250
+ \item \texttt {\PrintChar{092}textsurd}\efill
+ \subitem default\pfill \main{a-964}
+ \subitem \texttt {TS1} encoding\pfill \main{a-835}
+ \item \texttt {\PrintChar{092}TextSymbolUnavailable}\pfill
+ \main{a-3}, a-635
+ \item \texttt {\PrintChar{092}textthreeoldstyle}\efill
+ \subitem default\pfill \main{a-879}
+ \subitem \texttt {TS1} encoding\pfill \main{a-744}
+ \item \texttt {\PrintChar{092}textthreequarters}\efill
+ \subitem default\pfill \main{a-967}
+ \subitem \texttt {TS1} encoding\pfill \main{a-838}
+ \item \texttt {\PrintChar{092}textthreequartersemdash}\efill
+ \subitem default\pfill \main{a-867}
+ \subitem \texttt {TS1} encoding\pfill \main{a-732}
+ \item \texttt {\PrintChar{092}textthreesuperior}\efill
+ \subitem default\pfill \main{a-956}
+ \subitem \texttt {TS1} encoding\pfill \main{a-827}
+ \begin{figure*}[tp]
+ A verbatim extract from the index (without \textsf{docidx2e}):
+
+ \let\item=\listenvironmentitem
+ \expandafter\def \expandafter\MacroFont \expandafter{%
+ \MacroFont\footnotesize}
+\begin{verbatim}
+ \item \texttt {\PrintChar{092}U}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill \main{b-455}
+ \subitem \texttt {T2B} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill \main{b-455}
+ \subitem \texttt {T2C} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill \main{b-444}
+ \subitem \texttt {X2} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill \main{b-455}
+ \item \texttt {\PrintChar{092}u}\efill
+ \subitem default\pfill \main{a-187}
+ \subitem \texttt {OT1} encoding\pfill \main{a-343}
+ \subitem \texttt {OT4} encoding\pfill \main{a-631}
+ \subitem \texttt {T1} encoding\pfill \main{a-411}
+ \subsubitem \texttt {A} composite\pfill \main{a-484}
+ \subsubitem \texttt {a} composite\pfill \main{a-511}
+ \subsubitem \texttt {G} composite\pfill \main{a-491}
+ \subsubitem \texttt {g} composite\pfill \main{a-518}
+ \subitem \texttt {T2A} encoding\pfill \main{b-21}
+ \subitem \texttt {T2B} encoding\pfill \main{b-21}
+ \subitem \texttt {T2C} encoding\pfill \main{b-21}
+ \subitem \texttt {X2} encoding\pfill \main{b-21}
+ \item \texttt {\PrintChar{092}@uclclist}\pfill a-270, a-271, a-318
+ \item \texttt {\PrintChar{092}UndeclareTextCommand}\pfill \usage{4},
+ \main{a-141}, a-972--a-977
+ \item \texttt {\PrintChar{092}@undefined}\pfill a-145, a-147
+ \item \texttt {\PrintChar{092}update@uclc@with@cyrillic}\pfill a-269,
+ a-297, a-321, a-327
+ \item \texttt {\PrintChar{092}upshape}\pfill a-390, a-609, a-676, a-758
+ \item \texttt {\PrintChar{092}@use@text@encoding}\pfill \main{a-110}
+ \item \texttt {\PrintChar{092}UseTextAccent}\pfill \usage{3},
+ \main{a-110}, a-138
+ \item \texttt {\PrintChar{092}UseTextSymbol}\pfill \usage{2},
+ \main{a-110}, a-136
+\end{verbatim}
+ \end{figure*}
+ \item \texttt {\PrintChar{092}texttildelow}\efill
+ \subitem default\pfill \main{a-903}
+ \subitem \texttt {TS1} encoding\pfill \main{a-774}
+ \item \texttt {\PrintChar{092}texttimes}\efill
+ \subitem default\pfill \main{a-969}
+ \subitem \texttt {TS1} encoding\pfill \main{a-840}
+ \item \texttt {\PrintChar{092}texttrademark}\efill
+ \subitem default\pfill \main{a-247}, \main{a-928}
+ \subitem \texttt {TS1} encoding\pfill \main{a-799}
+ \item \texttt {\PrintChar{092}texttwelveudash}\efill
+ \subitem default\pfill \main{a-866}
+ \subitem \texttt {TS1} encoding\pfill \main{a-731}
+ \item \texttt {\PrintChar{092}texttwooldstyle}\efill
+ \subitem default\pfill \main{a-878}
+ \subitem \texttt {TS1} encoding\pfill \main{a-743}
+ \item \texttt {\PrintChar{092}texttwosuperior}\efill
+ \subitem default\pfill \main{a-955}
+ \subitem \texttt {TS1} encoding\pfill \main{a-826}
+ \item \texttt {\PrintChar{092}textunderscore}\pfill a-259
+ \subitem default\pfill \main{a-236}
+ \subitem \texttt {T1} encoding\pfill \main{a-480}
+ \subitem \texttt {T2A} encoding\pfill \main{b-54}
+ \subitem \texttt {T2B} encoding\pfill \main{b-54}
+ \subitem \texttt {T2C} encoding\pfill \main{b-54}
+ \subitem \texttt {X2} encoding\pfill \main{b-54}
+ \item \texttt {\PrintChar{092}textuparrow}\efill
+ \subitem default\pfill \main{a-894}
+ \subitem \texttt {TS1} encoding\pfill \main{a-765}
+ \item \texttt {\PrintChar{092}textvisiblespace}\efill
+ \subitem default\pfill \main{a-238}
+ \subitem \texttt {T1} encoding\pfill \main{a-481}
+ \subitem \texttt {T2A} encoding\pfill \main{b-46}
+ \subitem \texttt {T2B} encoding\pfill \main{b-46}
+ \subitem \texttt {T2C} encoding\pfill \main{b-46}
+ \subitem \texttt {X2} encoding\pfill \main{b-46}
+ \item \texttt {\PrintChar{092}textwon}\efill
+ \subitem default\pfill \main{a-919}
+ \subitem \texttt {TS1} encoding\pfill \main{a-790}
+ \item \texttt {\PrintChar{092}textyen}\efill
+ \subitem default\pfill \main{a-942}
+ \subitem \texttt {TS1} encoding\pfill \main{a-813}
+ \item \texttt {\PrintChar{092}textzerooldstyle}\efill
+ \subitem default\pfill \main{a-876}
+ \subitem \texttt {TS1} encoding\pfill \main{a-741}
+ \item \texttt {\PrintChar{092}TH}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-439}
+ \item \texttt {\PrintChar{092}th}\efill
+ \subitem \texttt {T1} encoding\pfill \main{a-482}
+ \item \texttt {\PrintChar{092}@thirdofthree}\pfill a-147
+ \item \texttt {\PrintChar{092}@typeset@protect}\pfill a-21, a-27,
+ a-160, a-168
+
+ \indexspace
+{\bfseries\hfil U\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}U}\efill
+ \subitem \texttt {T2A} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill
+ \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill
+ \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill
+ \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill
+ \main{b-455}
+ \subitem \texttt {T2B} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill
+ \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill
+ \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill
+ \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill
+ \main{b-455}
+ \subitem \texttt {T2C} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill
+ \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill
+ \main{b-444}
+ \subitem \texttt {X2} encoding\pfill \main{b-26}
+ \subsubitem \texttt {\PrintChar{092}CYRI} composite\pfill
+ \main{b-443}
+ \subsubitem \texttt {\PrintChar{092}cyri} composite\pfill
+ \main{b-444}
+ \subsubitem \texttt {\PrintChar{092}CYRU} composite\pfill
+ \main{b-453}
+ \subsubitem \texttt {\PrintChar{092}cyru} composite\pfill
+ \main{b-455}
+ \item \texttt {\PrintChar{092}u}\efill
+ \subitem default\pfill \main{a-187}
+ \subitem \texttt {OT1} encoding\pfill \main{a-343}
+ \subitem \texttt {OT4} encoding\pfill \main{a-631}
+ \subitem \texttt {T1} encoding\pfill \main{a-411}
+ \subsubitem \texttt {A} composite\pfill \main{a-484}
+ \subsubitem \texttt {a} composite\pfill \main{a-511}
+ \subsubitem \texttt {G} composite\pfill \main{a-491}
+ \subsubitem \texttt {g} composite\pfill \main{a-518}
+ \subitem \texttt {T2A} encoding\pfill \main{b-21}
+ \subitem \texttt {T2B} encoding\pfill \main{b-21}
+ \subitem \texttt {T2C} encoding\pfill \main{b-21}
+ \subitem \texttt {X2} encoding\pfill \main{b-21}
+ \item \texttt {\PrintChar{092}@uclclist}\pfill a-270, a-271, a-318
+ \item \texttt {\PrintChar{092}UndeclareTextCommand}\pfill \usage{4},
+ \main{a-141}, a-972--a-977
+ \item \texttt {\PrintChar{092}@undefined}\pfill a-145, a-147
+ \item \texttt {\PrintChar{092}update@uclc@with@cyrillic}\pfill a-269,
+ a-297, a-321, a-327
+ \item \texttt {\PrintChar{092}upshape}\pfill a-390, a-609, a-676,
+ a-758
+ \item \texttt {\PrintChar{092}@use@text@encoding}\pfill \main{a-110}
+ \item \texttt {\PrintChar{092}UseTextAccent}\pfill \usage{3},
+ \main{a-110}, a-138
+ \item \texttt {\PrintChar{092}UseTextSymbol}\pfill \usage{2},
+ \main{a-110}, a-136
+
+ \indexspace
+{\bfseries\hfil V\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}v}\efill
+ \subitem default\pfill \main{a-188}
+ \subitem \texttt {OT1} encoding\pfill \main{a-344}
+ \subitem \texttt {OT4} encoding\pfill \main{a-632}
+ \subitem \texttt {T1} encoding\pfill \main{a-410}
+ \subsubitem \texttt {C} composite\pfill \main{a-487}
+ \subsubitem \texttt {c} composite\pfill \main{a-514}
+ \subsubitem \texttt {D} composite\pfill \main{a-488}
+ \subsubitem \texttt {d} composite\pfill \main{a-515}
+ \subsubitem \texttt {E} composite\pfill \main{a-489}
+ \subsubitem \texttt {e} composite\pfill \main{a-516}
+ \subsubitem \texttt {L} composite\pfill \main{a-493}
+ \subsubitem \texttt {l} composite\pfill \main{a-520}
+ \subsubitem \texttt {N} composite\pfill \main{a-495}
+ \subsubitem \texttt {n} composite\pfill \main{a-522}
+ \subsubitem \texttt {R} composite\pfill \main{a-498}
+ \subsubitem \texttt {r} composite\pfill \main{a-525}
+ \subsubitem \texttt {S} composite\pfill \main{a-500}
+ \subsubitem \texttt {s} composite\pfill \main{a-527}
+ \subsubitem \texttt {T} composite\pfill \main{a-502}
+ \subsubitem \texttt {t} composite\pfill \main{a-529}
+ \subsubitem \texttt {Z} composite\pfill \main{a-508}
+ \subsubitem \texttt {z} composite\pfill \main{a-535}
+ \subitem \texttt {T2A} encoding\pfill \main{b-20}
+ \subitem \texttt {T2B} encoding\pfill \main{b-20}
+ \subitem \texttt {T2C} encoding\pfill \main{b-20}
+ \subitem \texttt {X2} encoding\pfill \main{b-20}
+ \item \texttt {\PrintChar{092}vrule}\pfill a-239, a-241
+
+ \indexspace
+{\bfseries\hfil W\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}@width}\pfill a-237, a-240
+ \item \texttt {\PrintChar{092}@wrong@font@char}\pfill a-121
+
+ \indexspace
+{\bfseries\hfil X\hfil}\nopagebreak
+
+ \item \texttt {\PrintChar{092}@xxxii}\pfill a-377, a-379
+
+ \end{theindex}
+
+\end{document}
diff --git a/Master/texmf-dist/source/latex/SIunits/SIunits.drv b/Master/texmf-dist/source/latex/SIunits/SIunits.drv
new file mode 100644
index 00000000000..60c630a5c4e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/SIunits/SIunits.drv
@@ -0,0 +1,26 @@
+\documentclass[a4paper]{ltxdoc}
+\IfFileExists{hyperref.sty} {\usepackage{hyperref}}{\relax}
+ \IfFileExists{SIunits.sty}
+ {\usepackage[derivedinbase,derived,binary]{SIunits}}
+ {\GenericWarning{SIunits.DTX}
+ {Package file SIunits.STY not found!^^J
+ Generate SIunits.STY by (La)TeXing SIunits.INS,
+ process SIunits.DTX again.^^J}\stop}
+%%
+\GetFileInfo{SIunits.dtx}
+\CodelineIndex%
+\PageIndex% Comment out to get code line numbers in index.
+\CodelineNumbered%
+\EnableCrossrefs%
+%%\DisableCrossrefs% UnComment if the index is ready
+\OnlyDescription% Comment out to print Section "The Magic Code" as well.
+%%
+\begin{document}
+\DocInput{SIunits.dtx}
+ {\newpage\PrintIndex}
+ {\newpage\PrintChanges}
+\end{document}
+%%
+%% Source: $Id: SIunits.dtx,v 1.33 2002/08/01 11:20:00 root Exp root $
+%%
+%% End of file `SIunits.drv'.
diff --git a/Master/texmf-dist/source/latex/SIunits/SIunits.dtx b/Master/texmf-dist/source/latex/SIunits/SIunits.dtx
new file mode 100644
index 00000000000..1668cb8f102
--- /dev/null
+++ b/Master/texmf-dist/source/latex/SIunits/SIunits.dtx
@@ -0,0 +1,3166 @@
+% \iffalse meta-comment
+%<*ID>
+%%% ====================================================================
+%%% @LaTeX-package-file{
+%%% author = "Heldoorn M.",
+%%% version = "$Revision: 1.33 $",
+%%% date = "$Date: 2002/08/01 11:20:00 $",
+%%% filename = "SIunits.dtx",
+%%% address = "Marcel Heldoorn
+%%% Kennedylaan 24
+%%% NL-3844 BC HARDERWIJK
+%%% The Netherlands",
+%%% telephone = "+31 341 427983",
+%%% FAX = "+31 71 5276782",
+%%% email = "SIunits@webschool.nl",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "SI, units, International System of Units,
+%%% physical unit",
+%%% supported = "yes",
+%%% abstract = "This package defines commands for using
+%%% standard SI units in all your texts. The
+%%% package provides different options for the
+%%% uniform typesetting and spacing of the units.",
+%%% copyright = "Copyright (C) 2001 Marcel Heldoorn.
+%%%
+%%% This program 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.
+%%% }
+%%% ====================================================================
+%</ID>
+% \fi
+% \CheckSum{1807}
+% \iffalse
+%<+package|binary>\def\SIunits@RCS$#1: #2 #3${#2}
+%<+package|binary>\def\filename{SIunits.dtx}%Source File Name
+%<+package|binary>\xdef\fileversion{\SIunits@RCS$Revision: 1.33 $}%Revision generated by CS-RCS
+%<+package|binary>\xdef\filedate{\SIunits@RCS$Date: 2002/08/01 11:20:00 $}%Date generated by CS-RCS
+%<+package|binary>\let\docversion=\fileversion
+%<+package|binary>\let\docdate=\filedate
+%<+package|binary>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
+%<+package>\ProvidesPackage{SIunits}
+%<+binary>\ProvidesPackage{binary}
+%<+package|binary> [\filedate\space v\fileversion\space
+%<+package> Support for the International System of units (MH)]
+%<+binary> Support for binary prefixes and units (MH)]
+%<+binary>\RequirePackageWithOptions{SIunits}
+%<+package|binary> \def\packagemessage{}
+% \fi
+% \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 \~}
+% \iffalse
+%<*config>
+%% SIunits configuration file: SIunits.cfg
+%%
+%% You can uncomment one or more of the lines below to set default options.
+%%
+%%\ExecuteOptions{binary} % Load binary.sty (binary units and prefixes)
+%%
+%% Spacing options (multiplying units):
+%%
+%%\ExecuteOptions{cdot} % \cdot
+%%\ExecuteOptions{thickspace} % thick space \;
+%%\ExecuteOptions{mediumspace} % medium space \:
+%%\ExecuteOptions{thinspace} % thin space \,
+%%
+%% Spacing options (between quantity and unit):
+%%
+%%\ExecuteOptions{thickqspace} % thick space \;
+%%\ExecuteOptions{mediumqspace} % medium space \:
+%%\ExecuteOptions{thinqspace} % thin space \,
+%%
+%% Compatibility options:
+%%
+%%\ExecuteOptions{noams} % When you don't have the AMS font, eurm10, use this option.
+%%
+%%\ExecuteOptions{amssymb} % prevent amssymb package from defining \square
+%%\ExecuteOptions{squaren} % define \squaren for use with amssymb package
+%%
+%%\ExecuteOptions{pstricks}% prevent pstricks package from defining \gray
+%%\ExecuteOptions{Gray} % define \Gray for use with pstricks package
+%%
+%%\ExecuteOptions{italian} % define \unita to prevent interference with babel package.
+%%
+%% Misc options:
+%%
+%%\ExecuteOptions{textstyle}% Typeset units in font of context.
+%</config>
+%<*batchfile>
+%
+%
+% (1) run SIunits.ins through TeX to get the package
+% (you get: SIunits.sty, binary.sty, SIunits.cfg and SIunits.cfg)
+%
+% (2) run SIunits.drv through TeX (LaTeX) to get the documentation
+% (you get: SIunits.dvi)
+%
+% [or use DOCSTRIP and extract SIunits.sty from SIunits.dtx
+% using option `package']
+%
+%
+\begin{filecontents}{SIunits.ins}
+%%
+%% SIunits.ins will generate the fast loadable files SIunits.sty and
+%% binary.sty, the documentation driver SIunits.drv and the configura-
+%% tion file SIunits.cfg from the package file SIunits.dtx when run
+%% through LaTeX or TeX.
+%%
+%% Copyright (C) 2001 Marcel Heldoorn
+%%
+%% This program 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.
+%%
+%% NOTE:
+%% The LPPL about .ins files:
+%% - Files with extension `.ins' (installation files): these files may
+%% not be modified at all because they contain the legal notices
+%% that are placed in the generated files.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{SIunits.ins}
+\input docstrip.tex
+\keepsilent
+\preamble
+
+Copyright (c) 1998-2002 Marcel Heldoorn <m.heldoorn@webschool.nl>.
+
+This program 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.
+
+For error reports in case of UNCHANGED versions see the readme.txt file.
+
+Please do not request updates from me directly. Distribution is done through the
+Comprehensive TeX Archive Network (CTAN).
+
+\endpreamble
+\postamble
+
+ Source: $Id: SIunits.dtx,v 1.33 2002/08/01 11:20:00 root Exp root $
+\endpostamble
+\generate{\file{SIunits.sty}{\from{SIunits.dtx}{package}}}
+\generate{\file{binary.sty}{\from{SIunits.dtx}{binary}}}
+\nopreamble
+\generate{\file{SIunits.cfg}{\from{SIunits.dtx}{config}}}
+\generate{\file{SIunits.drv}{\from{SIunits.dtx}{driver}}}
+ \Msg{************************************************************}
+ \Msg{}
+ \Msg{ To finish the installation you have to move the file}
+ \Msg{ `SIunits.sty' (and optionally the file `SIunits.cfg')}
+ \Msg{ into a directory searched by LaTeX.}
+ \Msg{}
+ \Msg{ To type-set the documentation, run the file `SIunits.drv'}
+ \Msg{ through LaTeX.}
+ \Msg{ Process SIunits.idx file by:}
+ \Msg{ \space\space\space\space makeindex -s gind.ist SIunits}
+ \Msg{ Process SIunits.glo file by:}
+ \Msg{ \space\space\space\space makeindex -s gglo.ist -o SIunits.gls SIunits.glo}
+ \Msg{}
+ \Msg{************************************************************}
+\endbatchfile
+\end{filecontents}
+%</batchfile>
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\IfFileExists{hyperref.sty} {\usepackage{hyperref}}{\relax}
+ \IfFileExists{SIunits.sty}
+ {\usepackage[derivedinbase,derived,binary]{SIunits}}
+ {\GenericWarning{SIunits.DTX}
+ {Package file SIunits.STY not found!^^J
+ Generate SIunits.STY by (La)TeXing SIunits.INS,
+ process SIunits.DTX again.^^J}\stop}
+%%
+\GetFileInfo{SIunits.dtx}
+\CodelineIndex%
+\PageIndex% Comment out to get code line numbers in index.
+\CodelineNumbered%
+\EnableCrossrefs%
+%%\DisableCrossrefs% UnComment if the index is ready
+\OnlyDescription% Comment out to print Section "The Magic Code" as well.
+%%
+\begin{document}
+\DocInput{SIunits.dtx}
+ {\newpage\PrintIndex}
+ {\newpage\PrintChanges}
+\end{document}
+%</driver>
+% \fi
+% \setlength\hfuzz{1000pt}
+% \setlength\overfullrule{1000pt}
+%
+% \newcommand{\pkgname}[1]{\texttt{#1}}
+% \newcommand{\opt}[1]{\textsf{#1}}
+%
+% \newenvironment{labeling}[1]
+% {\list{}{\settowidth{\labelwidth}{\textbf{#1}}
+% \leftmargin\labelwidth\advance\leftmargin\labelsep
+% \def\makelabel##1{\textbf{##1}\hfil}}}{\endlist}
+%
+% \newcommand{\Fe}{\textit{For example:\ }}
+% \newcommand{\fe}{\textit{for example:\ }}
+% \newcommand{\dimn}[1]{\ensuremath{\mathsf{#1}}}
+%
+% \def\digitsep{\,}
+% \def\onedigit#1{#1}
+% \def\twodigit#1#2{#1#2}
+% \def\threedigit#1#2#3{#1#2#3}
+% \def\fourdigit#1#2#3#4{#1\digitsep#2#3#4}
+% \def\fivedigit#1#2#3#4#5{#1#2\digitsep#3#4#5}
+% \def\sixdigit#1#2#3#4#5#6{#1#2#3\digitsep#4#5#6}
+% \def\sevendigit#1#2#3#4#5#6#7{#1\digitsep#2#3#4\digitsep#5#6#7}
+% \def\eightdigit#1#2#3#4#5#6#7#8{#1#2\digitsep#3#4#5\digitsep#6#7#8}
+% \def\ninedigit#1#2#3#4#5#6#7#8#9{#1#2#3\digitsep#4#5#6\digitsep#7#8#9}
+% \def\ifourdigit#1#2#3#4{#1#2#3\digitsep#4}
+% \def\ifivedigit#1#2#3#4#5{#1#2#3\digitsep#4#5}
+% \def\isixdigit#1#2#3#4#5#6{#1#2#3\digitsep#4#5#6}
+% \def\isevendigit#1#2#3#4#5#6#7{#1#2#3\digitsep#4#5#6\digitsep#7}
+% \def\ieightdigit#1#2#3#4#5#6#7#8{#1#2#3\digitsep#4#5#6\digitsep#7#8}
+% \def\ininedigit#1#2#3#4#5#6#7#8#9{#1#2#3\digitsep#4#5#6\digitsep#7#8#9}
+%
+% \def\getlength#1{\ifx#1\end \let\next=\relax
+% \else\advance\count0 by 1 \let\next=\getlength\fi \next}
+%
+% \def\length#1{\count0=0 \getlength#1\end}
+%
+% \def\digitspart#1{\length{#1}\ifcase\count0\or
+% \let\next=\onedigit \or
+% \let\next=\twodigit \or
+% \let\next=\threedigit \or
+% \let\next=\ifourdigit \or
+% \let\next=\ifivedigit \or
+% \let\next=\isixdigit \or
+% \let\next=\isevendigit \or
+% \let\next=\ieightdigit \or
+% \let\next=\ininedigit \or
+% \else \let\next=\relax \fi \next#1}
+%
+% \def\integerpart#1{{\length{#1}\ifcase\count0\or
+% \let\next=\onedigit \or
+% \let\next=\twodigit \or
+% \let\next=\threedigit \or
+% \let\next=\fourdigit \or
+% \let\next=\fivedigit \or
+% \let\next=\sixdigit \or
+% \let\next=\sevendigit \or
+% \let\next=\eightdigit \or
+% \let\next=\ninedigit \or
+% \else \let\next=\relax \fi \next#1}}
+%
+% \def\split#1.#2\end{\ensuremath{\integerpart{#1}.\digitspart{#2}}}
+%
+% \newcommand{\nmfmt}[1]{{\split #1\end}}
+% \newcommand{\intfmt}[1]{\ensuremath{\integerpart{#1}}}
+%
+% \def\scientificnotation#1e#2\end{\ensuremath{{#1}\times 10^{#2}}}
+% \newcommand{\sci}[1]{{\scientificnotation #1\end}}
+% \newcommand{\joenit}[1]{\begingroup\mathcode`\.="8000 \ensuremath{#1}\endgroup}
+%
+% \changes{v0.05 Final Release}{1999/03/30}{Release v0.05 under LaTeX Project Public License}
+% \changes{v0.05 Beta 2}{1999/03/30}{First package release under LaTeX Project Public License}
+% \changes{v0.06 Beta 2}{1998/04/07}{Problem with amssymb package solved thanks to Timothy C. Burt}
+% \changes{v0.03 Final Release}{1999/01/15}{Release v0.03}
+% \changes{v0.03 Beta 6}{1998/12/15}{Stable version, before releasing v0.03}
+% \changes{v0.03 Beta 4}{1998/12/10}{Stable version, before adding configuration file parameters}
+% \changes{v0.02 Beta 5}{1998/09/23}{Generated for Timothy C. Burt (\texttt{tcburt@comp.uark.edu})}
+% \changes{v0.02 Beta 4}{1998/09/15}{Typos corrected (thanks to Rafael Rodriguez Pappalardo)}
+% \changes{v0.02 Beta 3}{1998/09/11}{Code documentation checked and corrected}
+% \changes{v0.01}{1998/09/07}{Small documentation errors (thanks to Juergen von Haegen)}
+% \changes{v0.00 Beta 4}{1998/08/14}{Inconsistencies removed/changed}
+% \changes{v0.00 Beta 3}{1998/08/11}{Options implemented; better documentation}
+% \changes{v0.00 Beta 2}{1998/07/30}{Various small improvements}
+% \changes{v0.00 Beta 1}{1998/07/24}{Initial working version}
+% \changes{v1.00}{2000/03/21}{released as SIunits v1.00}
+% \changes{v1.13}{2000/08/29}{implementation of \textit{SI-brochure Supplement 2000}}
+% \changes{v1.15}{2001/02/01}{E-mail address change: \texttt{marcel.heldoorn@webschool.nl}}
+% \changes{v1.30}{2002/08/01}{E-mail address change: \texttt{SIunits@webschool.nl}}
+% \changes{v1.32}{2002/08/01}{\texttt{hyperref} package used in documentation driver}
+%
+% \DoNotIndex{\,,\:,\;}
+% \DoNotIndex{\@defGrayfalse,\@defGraytrue,\@defsquarenfalse,\@defsquarentrue}
+% \DoNotIndex{\@elt,\@for}
+% \DoNotIndex{\@ifundefined,\@nameuse,\@ne,\@optionNoAMSfalse,\@optionNoAMStrue }
+% \DoNotIndex{\@optionNoAMSfalse\@optionNoAMStrue\@optionbinaryfalse\@optionbinarytrue}
+% \DoNotIndex{\@qsk,\@qskwidth,\@redefGrayfalse,\@redefGraytrue}
+% \DoNotIndex{\@redefsquarefalse,\@redefsquaretrue,\@scientificfalse,\@scientifictrue}
+% \DoNotIndex{\@stpelt,\@text,\@text@,\@textstylefalse,\@textstyletrue}
+% \DoNotIndex{\AA,\addtocounter,\def,\edef,\gdef}
+% \DoNotIndex{\amperemetresecond,\amperepermetre,\amperepermetrenp,\amperepersquaremetre,\amperepersquaremetrenp}
+% \DoNotIndex{\arad}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage}
+% \DoNotIndex{\begingroup}
+% \DoNotIndex{\candelapersquaremetre,\candelapersquaremetrenp,\cdot}
+% \DoNotIndex{\check@mathfonts,\circ}
+% \DoNotIndex{\coulombpercubicmetre,\coulombpercubicmetrenp,\coulombperkilogram,\coulombperkilogramnp}
+% \DoNotIndex{\coulombpermol,\coulombpermolnp,\coulombpersquaremetre,\coulombpersquaremetrenp,\csname}
+% \DoNotIndex{\cubicmetreperkilogram,\cubicmetrepersecond,\CurrentOption}
+% \DoNotIndex{\decimals,\DeclareFontEncoding,\DeclareFontFamily}
+% \DoNotIndex{\DeclareFontShape,\DeclareFontSubstitution,\DeclareMathSymbol}
+% \DoNotIndex{\DeclareOption,\DeclareRobustCommand,\DeclareSymbolFont,\DeclareTextSymbol}
+% \DoNotIndex{\DeclareTextSymbolDefault}
+% \DoNotIndex{\def,\displaystyle,\do}
+% \DoNotIndex{\else,\csname,\endcsname,\begingroup,\endgroup,\endinput,\ensuremath,\advancemath,\bgroup}
+% \DoNotIndex{\egroup,\everymath}
+% \DoNotIndex{\ExecuteOptions,\expandafter,\f@size}
+% \DoNotIndex{\faradpermetre,\faradpermetrenp,\fi,\filedate,\fileversion,\firstchoice@false,\firstchoice@true,\font}
+% \DoNotIndex{\graypersecond,\graypersecondnp,\hbox,\henrypermetre,\henrypermetrenp,\hspace}
+% \DoNotIndex{\if@defGray,\if@defsquaren,\if@optionbinary,\if@optionNoAMS,\if@redefGray,\if@redefsquare}
+% \DoNotIndex{\if@scientific,\if@textstyle,\iffirstchoice@,\ifmmode,\ifundefined,\InputIfFileExists}
+% \DoNotIndex{\joulepercubicmetre,\joulepercubicmetrenp,\jouleperkelvin,\jouleperkelvinnp}
+% \DoNotIndex{\jouleperkilogram,\jouleperkilogramkelvin,\jouleperkilogramkelvinnp,\jouleperkilogramnp}
+% \DoNotIndex{\joulepermole,\joulepermolekelvin,\joulepermolekelvinnp,\joulepermolenp,\joulepersquaremetre}
+% \DoNotIndex{\joulepersquaremetrenp,\joulepertesla,\jouleperteslanp}
+% \DoNotIndex{\kilogrammetrepersecond,\kilogrammetrepersecondnp,\kilogrammetrepersquaresecond}
+% \DoNotIndex{\kilogrammetrepersquaresecondnp,\kilogrampercubicmetre,\kilogrampercubicmetrecoulomb}
+% \DoNotIndex{\kilogrampercubicmetrecoulombnp,\kilogrampercubicmetrenp,\kilogramperkilomole}
+% \DoNotIndex{\kilogramperkilomolenp,\kilogrampermetre,\kilogrampermetrenp,\kilogrampersecond}
+% \DoNotIndex{\kilogrampersecondcubicmetre,\kilogrampersecondcubicmetrenp,\kilogrampersecondnp}
+% \DoNotIndex{\kilogrampersquaremetre,\kilogrampersquaremetrenp,\kilogrampersquaremetresecond}
+% \DoNotIndex{\kilogrampersquaremetresecondnp,\kilogramsquaremetre,\kilogramsquaremetrenp}
+% \DoNotIndex{\kilogramsquaremetrepersecond,\kilogramsquaremetrepersecondnp,\let}
+% \DoNotIndex{\mathcode,\mathchoice,\mathord,\mathrm,\mbox}
+% \DoNotIndex{\MessageBreak,\metrepersecond,\metrepersecondnp,\metrepersquaresecond,\metrepersquaresecondnp}
+% \DoNotIndex{\molepercubicmetre,\molepercubicmetrenp,\NeedsTeXFormat,\newcommand}
+% \DoNotIndex{\newif,\newlength}
+% \DoNotIndex{\newtonmetrenp,\newtonpercubicmetre,\newtonpercubicmetrenp}
+% \DoNotIndex{\newtonperkilogram,\newtonperkilogramnp,\newtonpermetre}
+% \DoNotIndex{\newtonpermetrenp,\newtonpersquaremetre,\newtonpersquaremetrenp}
+% \DoNotIndex{\nfss@text,\no@qsk,\ohmmetre,\Omega}
+% \DoNotIndex{\PackageError,\packagemessage,\packagename}
+% \DoNotIndex{\PackageWarning,\PackageWarningNoLine,\persquaremetresecond,\period@active}
+% \DoNotIndex{\persquaremetresecondnp,\Prefixes,\ProcessOptions,\protect,\providecommand}
+% \DoNotIndex{\ProvidesPackage,\quantityskip,\radianpersecond,\radianpersecondnp}
+% \DoNotIndex{\radianpersquaresecond,\radianpersquaresecondnp}
+% \DoNotIndex{\relax,\renewcommand,\RequirePackage,\RequirePackageWithOptions}
+% \DoNotIndex{\rpcubicmetreperkilogram,\rpcubicmetrepersecond,\rperminute,\rpfourth}
+% \DoNotIndex{\rpsquare,\rpsquared,\rpsquaremetreperkilogram}
+% \DoNotIndex{\selectfont,\settowidth,\sf@size,\SI@fstyle}
+% \DoNotIndex{\SIunits@@,\SIunits@execopt,\SIunits@opt@cdot,\SIunits@opt@derived}
+% \DoNotIndex{\SIunits@opt@derivedinbase,\SIunits@opt@mediumqspace,\SIunits@opt@mediumspace}
+% \DoNotIndex{\SIunits@opt@thickqspace,\SIunits@opt@thickspace,\SIunits@opt@thinqspace}
+% \DoNotIndex{\SIunits@opt@thinspace,\skewchar,\space}
+% \DoNotIndex{\squaremetrepercubicmetre,\squaremetrepercubicmetrenp,\squaremetrepercubicsecond}
+% \DoNotIndex{\squaremetrepercubicsecondnp,\squaremetreperkilogram,\squaremetrepernewtonsecond}
+% \DoNotIndex{\squaremetrepernewtonsecondnp,\squaremetrepersecond,\squaremetrepersecondnp}
+% \DoNotIndex{\squaremetrepersquaresecond,\squaremetrepersquaresecondnp,,\ssf@size}
+% \DoNotIndex{\stepcounter,\symbols,\textdef@,\textstyle,\tf@size,\typeout}
+% \DoNotIndex{\voltpermetre,\voltpermetrenp,\wattpercubicmetre,\wattpercubicmetrenp}
+% \DoNotIndex{\wattperkilogram,\wattperkilogramnp,\wattpermetrekelvin,\wattpermetrekelvinnp}
+% \DoNotIndex{\wattpersquaremetre,\wattpersquaremetrenp,\wattpersquaremetresteradian}
+% \DoNotIndex{\wattpersquaremetresteradiannp}
+%
+%\GetFileInfo{SIunits.sty}
+% \changes{\fileversion}{\filedate}{Current version submitted to CTAN}
+%\title{The \pkgname{SIunits}\ package\thanks{This file has version number \fileversion{}, last revised
+%\filedate{} \packagemessage}\\{\large support for the \textsf{International System of Units}}}
+%\author{Marcel Heldoorn\thanks{Mail: Kennedylaan 24, NL-3844~BC Harderwijk, The~Netherlands}\\
+%\texttt{SIunits@webschool.nl}}
+%\date{File date \filedate{} --- Printed \today}
+%\maketitle
+%
+%\begin{abstract}
+%\noindent This article describes the \pkgname{SIunits}\ package that provides support for
+%the \textsf{Syst\`{e}me International d'Unit\'{e}s} (SI).
+%
+%The Syst\`{e}me International d'Unit\'{e}s (SI), the modern form of the metric system, is the
+%most widely used system of units and measures around the world. But despite this there is
+%widespread misuse of the system with incorrect names and symbols used as a matter a
+%course - even by well educated and trained people who should know better. For example how
+%often do we see: \milli\hertz, \mega hz or \milli hz written when referring to computer
+%clock rates? The correct form is actually \mega\hertz. Note that the capitalisation does
+%matter.
+%
+%Hence, a clear system for the use of units is needed, satisfying the next principles:
+%\begin{enumerate}
+%\item the system should consist of measuring units based on unvariable quantities in nature;
+%\item all units other than the base units should be derived from these base units; and
+%\item multiples and submultiples of the units should be decimal.
+%\end{enumerate}
+%The name Syst\`{e}me International d'Unit\'{e}s (International System of Units) with the
+%international abbreviation SI was adopted by the Conf\'{e}rence G\'{e}n\'{e}rale des Poids et Mesures
+%(CGPM) in 1960. It is a coherent system based on seven base units (CGPM 1960 and 1971).
+%
+%
+%The \pkgname{SIunits}\ package can be used to standardise the use of units in your
+%writings. Most macros are easily adaptable to personal preferences. However, you are
+%welcome (and strongly invited\footnote{There is an enormous \LaTeX\ Knowledge Base out
+%there.}) to suggest any improvements. \\*[3mm] {\itshape Enjoy the \pkgname{SIunits}\
+%package!\raisebox{-\baselineskip}[0pt][0pt]{marcel h.}}
+%\end{abstract}
+%\newpage
+%\section*{What's new?}
+%\subsubsection*{New in version~\fileversion{}}
+%\begin{enumerate}
+%\item Adaptive spacing of |\degree|, |\paminute|, |\arcminute|, |\pasecond| and |\arcsecond|: no space between quantity and unit.
+%\item Solved bug: extra space in ready to use ready-to-use units when using \opt{textstyle} option. Thanks to Svend Tollak Munkejord.
+%\item Option \opt{italian} added to solve interference problem with the babel package and language italian: Babel defines |\unit|. When using the option \opt{italian}, use |\unita| instead. Thanks to Lorenzo Cappelletti and Luca Rossato.
+%\end{enumerate}
+%\subsubsection*{New in version~1.\textit{x}}
+%\begin{enumerate}
+%\item \pkgname{binary.sty} style with binary prefixes and units added (see table~\ref{table:bipre});
+%\item \pkgname{binary.sty} can be loaded by using the \opt{binary} package option (see page~\pageref{sec:options});
+%\item unit \cmd{\one} added: the derived unit for a derived quantity of dimension one is also the number one;
+%\item In the |pstricks| package the command |\gray| is defined. This will cause error messages
+%when the |pstricks| package is used in combination with the \pkgname{SIunits}\ package. To prevent
+%errors one can choose two different options:
+%\begin{labeling}{\hspace{15mm}}
+%\item[\opt{pstricks}]This option redefines the \texttt{pstricks} command |\gray| to get the desired
+%\pkgname{SIunits}\ definition of the command.\\ \textbf{Note: }When using this option, the \texttt{pstricks} command
+%|\gray| is \textbf{redefined}.
+%\item[\opt{Gray}]This option defines a new command |\Gray| that can be used instead of the
+%\pkgname{SIunits}\ command |\gray|.\\ \textbf{Note: }When using this option,
+%|\gray| is defined in the \texttt{pstricks} package.
+%\end{labeling}
+%\item When using the option \opt{textstyle} units are printed in the typeface of the
+%enclosing text, automatically.
+%\item the . (period) was made active in the second argument of the \cmd{\unit} macro: it will act like a unit skip
+%(\cmd{\usk}), \fe use |\unit{1}{\newton.\metre}| instead of |\unit{1}{\newton\usk\metre}|.
+%\item \cmd{\katal} added: ``\textit{The 21st Conf\'{e}rence G\'{e}n\'{e}rale des Poids et Mesures decides to adopt the special name katal,
+% symbol \katal, for the SI unit mole per second to express catalytic activity, especially
+% in the fields of medicine and biochemistry, ...}" (21th CGPM (1999), Resolution 12).
+%\item The ready-to-use units used \cmd{\square} instead of \cmd{\squaren} when using the option \opt{squaren}. \textsf{Fixed!}
+%\item Fixed index and change history generation error.
+%\item Documentation update: implementation of \textit{SI-brochure Supplement 2000}.
+%\item Documentation updated/corrected: table heads.
+%\item E-mail changed: \texttt{SIunits@webschool.nl}
+%\item Solved bug: Defining units using |\addunit| in combination with the \opt{cdot} and \opt{textstyle} options. Thanks to Michael M\"{u}ller.
+%\end{enumerate}
+%\newpage\tableofcontents\newpage
+%\section{Introduction}
+%
+%\subsection{Historical notes}
+%In 1948 the 9th General Conference on Weights and Measures (CGPM\footnote{See section
+%\ref{acronyms} for acronyms}), by its Resolution 6, instructed the International
+%Committee for Weights and Measures (CIPM\footnotemark[\value{footnote}]):
+%\begin{verse}
+%`to study the establishment of a complete set of rules for units of measurement';
+%
+%`to find out for this purpose, by official inquiry, the opinion prevailing in scientific,
+%technical, and educational circles in all countries'; and
+%
+%`to make recommendations on the establishment of a \textit{practical system of units of
+%measurement} suitable for adoption by all signatories to the Meter Convention.'
+%\end{verse}
+%
+%The same General Conference also laid down, by its Resolution 7, general principles for
+%unit symbols and also gave a list of units with special names.
+%
+%
+%The 10th CGPM (1954), by its Resolution 6, and the 14th CGPM (1971), by its Resolution 3,
+%adopted as base units of this `practical system of units,' the units of the following
+%seven quantities: length, mass, time, electric current, thermodynamic temperature, amount
+%of substance, and luminous intensity.
+%
+%
+%The 11th CGPM (1960), by its Resolution 12, adopted the name \textit{Syst\`{e}me
+%International d'Unit\'{e}s (International System of Units)}, with the international
+%abbreviation \textit{SI}, for this practical system of units of measurement, and laid
+%down rules for the prefixes, the derived and supplementary units, and other matters, thus
+%establishing a comprehensive specification for units of measurement.
+%
+%\subsection{The classes of SI units}
+%The General Conference decided to base the International
+%System on a choice of seven well-defined units which by convention are regarded as
+%dimensionally independent: the metre, the kilogram, the second, the ampere, the kelvin,
+%the mole, and the candela. These units are called \textit{base units}.
+%
+%
+%The second class of SI units contain \textit{derived units}, i.\,e., units that can be
+%formed by combining base units according to the algebraic relations linking the
+%corresponding quantities. The names and symbols of some units thus formed in terms of
+%base units can be replaced by special names and symbols which can themselves be used to
+%form expressions and symbols of other derived units (see section \ref{derived}, p.
+%\pageref{derived}).
+%
+%
+%The 11th CGPM (1960) admitted a third class of SI units, called \textit{supplementary
+%units} and containing the SI units of plane and solid angle.
+%
+%
+%The 20th CGPM (1995) decided to eliminate the class of supplementary units as a separate
+%class in the SI. Thus the SI now consists of only two classes of units: base units and
+%derived units, with the radian and the steradian, which are the two supplementary units,
+%subsumed into the class of derived SI units.
+%
+%
+%\subsection{The SI prefixes}
+%The General Conference has adopted a series of prefixes to be used in forming the decimal
+%multiples and submultiples of SI units. Following CIPM Recommendation~1 (1969), the set
+%of prefixes is designated by the name \textit{SI prefixes}.
+%
+%The multiples and submultiples of SI units, which are formed by using the SI prefixes,
+%should be designated by their complete name, \textit{multiples and submultiples of SI
+%units}, in order to make a distinction between them and the coherent set of SI units
+%proper.
+%
+%\subsection{Acronyms}
+%\label{acronyms} The SI was established in 1960 by the CGPM. The CGPM is an
+%intergovernmental treaty organisation created by a diplomatic treaty called the Meter
+%Convention (\textit{Convention du M\`{e}tre}, often called the Treaty of the Meter in the
+%United States). The Meter Convention was signed in Paris in 1875 by representatives of
+%seventeen nations, including the United States. There are now forty-eight Member States,
+%including all the major industrialised countries. The Convention, modified slightly in
+%1921, remains the basis of all international agreement on units of measurement.
+%
+%The Meter Convention also created the International Bureau of Weights and Measures (BIPM,
+%Bureau International des Poids et Mesures) and the International Committee for Weights
+%and Measures (CIPM, Comit\'{e} International des Poids et Mesures). The BIPM, which is
+%located in S\`{e}vres, a suburb of Paris, France, and which has the task of ensuring
+%worldwide unification of physical measurements, operates under the exclusive supervision
+%of the CIPM, which itself comes under the authority of the CGPM.
+%
+%
+%
+%\begin{description}
+%\item[CGPM] General Conference on Weights and Measures (\textit{Conf\'{e}rence G\'{e}n\'{e}rale des Poids
+%et Mesures}). The CGPM is the primary intergovernmental treaty organisation responsible
+%for the SI, representing nearly 50 countries. It has the responsibility of ensuring that
+%the SI is widely disseminated and modifying it as necessary so that it reflects the
+%latest advances in science and technology.
+%
+%\item[CIPM] International Committee for Weights and Measures (\textit{Comit\'{e} International des
+%Poids et Mesures}). The CIPM comes under the authority of the CGPM. It suggests
+%modifications to the SI to the CGPM for formal adoption. The CIPM may also on its own
+%authority pass clarifying resolutions and recommendations regarding the SI.
+%
+%\item[BIPM] International Bureau of Weights and Measures (\textit{Bureau International des
+%Poids et Mesures}). The BIPM, located outside Paris, has the task of ensuring worldwide
+%unification of physical measurements. It is the ``international" metrology institute, and
+%operates under the exclusive supervision of the CIPM.
+%\end{description}
+%
+%\subsection{Some useful definitions}
+%\begin{description}
+%\item [quantity in the general sense] A quantity in the general sense is a property ascribed to phenomena, bodies, or
+%substances that can be quantified for, or assigned to, a particular phenomenon, body, or
+%substance. Examples are mass and electric charge.
+%\item [quantity in the particular sense] A quantity in the particular sense is a quantifiable or assignable property ascribed
+%to a particular phenomenon, body, or substance. Examples are the mass of the moon and the
+%electric charge of the proton.
+%\item [physical quantity] A physical quantity is a quantity that can be used in the mathematical equations of
+%science and technology.
+%\item [unit] A unit is a particular physical quantity, defined and adopted by convention, with
+%which other particular quantities of the same kind are compared to express their value.
+%\end{description}
+%
+%
+%\noindent The \textbf{value of a physical quantity} is the quantitative expression of a
+%particular physical quantity as the product of a number and a unit, the number being its
+%numerical value. Thus, the numerical value of a particular physical quantity depends on
+%the unit in which it is expressed.
+%
+%\label{celsiusexample}
+%More formally, the value of quantity \(A\) can be written as \(A=\lbrace A\rbrace [A]\),
+%where \(\{A\}\) is the numerical value of \(A\) when \(A\) is expressed in the unit
+%\([A]\). The numerical value can therefore be written as \(\lbrace A\rbrace=A/[A]\),
+%which is a convenient form for use in figures and tables. Thus to eliminate the
+%possibility of misunderstanding, an axis of a graph or the heading of a column of a table
+%can be labelled `\(t\)\per\celsius' instead of `\(t\)(\celsius)' or `Temperature
+%(\celsius)'. Similarly, another example: `\(E/\)(\voltpermetre)' instead of
+%`\(E\)(\voltpermetre)' or `Electric field strength (\voltpermetre)'.
+%
+%\addunit{\foot}{ft}
+%\Fe the value of the height \(h_{W}\) of the Washington Monument is \(h_{W} = \unit{169}{\metre}=
+%\unit{555}{\foot}\)\footnote{foot (\foot) is not part of the SI units}. Here \(h_{W}\) is the physical quantity, its value expressed in the
+%unit metre, unit symbol \metre, is \unit{169}{\metre}, and its numerical value when
+%expressed in metres is \(169\).
+%
+%\section{SI units}
+%\subsection{SI base units}
+%\subsubsection{Definitions}
+%The SI is founded on seven SI base units for seven base quantities assumed to be mutually
+%independent. The primary definitions of the SI base units are in French. Their current
+%definitions, along with an English translation, are given below:
+%\paragraph*{metre; \textit{m\`{e}tre}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{Le m\`{e}tre est la longueur du trajet parcouru dans le vide par la lumi\`{e}re pendant
+%une dur\'{e}e de \(1/\intfmt{299792458}\) de seconde.}\\ {(17th CGPM (1983), Resolution 1).}\nonfrenchspacing
+%\item[]
+%{The metre is the length of the path travelled by light in vacuum during a time interval
+%of \(1/\intfmt{299792458}\) of a second.}
+%\end{description}
+%\paragraph*{kilogram; \textit{kilogramme}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{Le kilogramme est l'unit\'{e} de masse; il est \'{e}gal \`{a} la masse du prototype
+%international du kilogramme.}\\ (1st CGPM (1889) and 3rd CGPM (1901)).\nonfrenchspacing
+%\item[]
+%{The kilogram is the unit of mass; it is equal to the mass of the international prototype
+%of the kilogram.} \\{\textit{Note}: This international prototype is made of
+%platinum-iridium and is kept at the International Bureau of Weights and Measures, S\`{e}vres,
+%France.}
+%\end{description}
+%\paragraph*{second; \textit{seconde}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{La seconde est la dur\'{e}e de \(9\digitsep192\digitsep631\digitsep770\) p\'{e}riodes de
+%la radiation correspondant \`{a} la transition entre les deux niveaux hyperfins de l'\'{e}tat
+%fondamental de l'atome de cesium 133.} \\(13th CGPM (1967), Resolution 1).\nonfrenchspacing
+%\item[]
+%{The second is the duration of \(9\digitsep192\digitsep631\digitsep770\) periods of the
+%radiation corresponding to the transition between the two hyperfine levels of the ground
+%state of the cesium-\(133\) atom.}
+%\end{description}
+%\textit{Note}: This definition refers to a caesium atom at rest at a temperature of \unit{0}{\kelvin}.
+%\paragraph*{ampere; \textit{amp\`{e}re}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{L'amp\`{e}re est l'intensit\'{e} d'un courant constant qui, maintenu dans deux
+%conducteurs parall\`{e}les, rectilignes, de longueur infinie, de section circulaire
+%n\'{e}gligeable, et plac\'{e}s \`{a} une distance de 1 m\`{e}tre l'un de l'autre dans le vide, produirait
+%entre ces conducteurs une force \'{e}gale \`{a} \(\sci{2e-7}\) newton par m\`{e}tre de longueur.}\\
+%(9th CGPM (1948), Resolutions 2 and 7).\nonfrenchspacing
+%\item[]
+%{The ampere is that constant current which, if maintained in two straight parallel
+%conductors of infinite length, of negligible circular cross-section, and placed 1 metre
+%apart in vacuum, would produce between these conductors a force equal to \(\sci{2e-7}\)
+%newton per metre of length.}
+%\end{description}
+%\paragraph*{kelvin; \textit{kelvin}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{Le kelvin, unit\'{e} de temp\'{e}rature thermodynamique, est la fraction \(1/273.16\) de
+%la temp\'{e}rature thermodynamique du point triple de l'eau.}\\(13th CGPM (1967), Resolution
+%4).\nonfrenchspacing
+%\item[]
+%{The kelvin, unit of thermodynamic temperature, is the fraction \(1/273.16\) of the
+%thermodynamic temperature of the triple point of water.}
+%\end{description}
+%\textit{Note}: The 13th CGPM (1967, Resolution 3) also decided that the unit kelvin
+%and its symbol \kelvin\ should be used to express
+%both thermodynamic temperature and an interval or a difference of temperature, instead of
+%`degree Kelvin' with symbol \degree\kelvin.
+%
+%
+%In addition to the thermodynamic temperature (symbol \(T\)) there is also the Celsius
+%(symbol \(t\)) defined by the equation \(t= T-T_{0}\) where \(T_{0}=\)
+%\unit{273.15}{\kelvin}. Celsius temperature is expressed in degree Celsius; \textit{degr\'{e}
+%Celsius} (symbol \celsius). The unit `degree Celsius' is equal to the unit
+%`kelvin'; in this case, `degree Celsius' is a special name used in place of `kelvin'. A
+%temperature interval or difference of Celsius temperature can, however, be expressed in
+%kelvins as well as in degrees Celsius.
+%
+%\paragraph*{mole; \textit{mole}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{1°. La mole est la quantit\'{e} de mati\`{e}re d'un syst\`{e}me contenant autant d'entit\'{e}s
+%\'{e}l\'{e}mentaires qu'il y a d'atomes dans \(0,012\) kilogramme de carbone \(12\).}
+%\item[]
+%\textit{2°. Lorsqu'on emploie la mole, les entit\'{e}s \'{e}l\'{e}mentaires doivent \^{e}tre sp\'{e}cifi\'{e}es
+%et peuvent \^{e}tre des atomes, des mol\'{e}cules, des ions, des \'{e}lectrons, d'autres particules
+%ou des groupements sp\'{e}cifi\'{e}s de telles particules.}\\ (14th CGPM (1971), Resolution 3).\nonfrenchspacing
+%\item[]
+%{1. The mole is the amount of substance of a system which contains as many elementary
+%entities as there are atoms in \(0.012\) kilogram of carbon \(12\).}
+%\item[]
+%{2. When the mole is used, the elementary entities must be specified and may be atoms,
+%molecules, ions, electrons, other particles or specified groups of such
+%particle.}
+%\end{description}
+%\textit{Note}: In this definition, it is understood that the carbon 12 atoms
+%are unbound, at rest and in their ground state.
+%\paragraph*{candela; \textit{candela}}
+%\begin{description}
+%\item[]
+%\frenchspacing\textit{La candela est l'intensit\'{e} lumineuse, dans une direction donn\'{e}e, d'une source qui
+%\'{e}met une radiation monochromatique de fr\'{e}quence \(\sci{540e12}\) hertz et dont
+%l'intensit\'{e} \'{e}nerg\'{e}tique dans cette direction est \(1/683\) watt par st\'{e}radian.}\\ (16th
+%CGPM (1979), Resolution 3).\nonfrenchspacing
+%\item[]
+%{The candela is the luminous intensity, in a given direction, of a source that emits
+%monochromatic radiation of a frequency \(\sci{540e12}\) hertz and has a radiant intensity
+%in that direction of \(1/683\) watt per steradian.}
+%\end{description}
+%\newpage
+%\subsubsection{Symbols}
+%The base units of the International System are collected in table~\ref{table:base} with
+%their names and their symbols (10th CGPM (1954), Resolution 6; 11th CGPM (1960),
+%Resolution 12; 13th CGPM (1967), Resolution 3; 14th CGPM (1971), Resolution 3).\\
+% \begin{table}[btp]
+% \caption{--- SI base units ---}\label{table:base}
+% \centering
+% \begin{tabular}{llc}\hline
+% \textbf{Quantity} & \textbf{Name} & \textbf{Symbol} \\ \hline
+% length & metre & \metre \\
+% mass & kilogram & \kilogram \\
+% time & second & \second \\
+% electric current & ampere & \ampere \\
+% thermodynamic temperature & kelvin & \kelvin \\
+% amount of substance & mole & \mole \\
+% luminous intensity & candela & \candela \\ \hline
+% \end{tabular}
+% \end{table}
+%
+%\subsection{SI derived units}\label{derived}
+%Derived units are units which may be expressed in terms of base units by means of the
+%mathematical symbols of multiplication and division. Certain derived units have been
+%given special names and symbols, and these special names and symbols may themselves be
+%used in combination with those for base and other derived units to express the units of
+%other quantities.
+%\subsubsection{Units expressed in terms of base units}
+%Table~\ref{table:derived1} lists some examples of derived units expressed directly in
+%terms of base units. The derived units are obtained by multiplication and division of
+%base units.
+% \begin{table}[btp]
+% \caption{--- Examples of SI derived units ---}\label{table:derived1}
+% \begin{minipage}[]{\textwidth}
+% \centering
+% \begin{tabular}{llc}\hline
+% \textbf{Derived quantity} & \textbf{Name} & \textbf{Symbol}\\ \hline
+% area & square metre & \squaremetre \\
+% volume & cubic metre & \cubicmetre \\
+% speed, velocity & metre per second & \metrepersecond\\
+% acceleration & metre per second squared & \metrepersquaresecond \\
+% wave number & reciprocal metre & \reciprocal\metre \\
+% mass density & kilogram per cubic metre & \kilogrampercubicmetre \\
+% specific volume & cubic metre per kilogram & \cubicmetreperkilogram \\
+% current density & ampere per square metre & \amperepersquaremetre \\
+% magnetic field strength & ampere per metre & \amperepermetre \\
+% amount-of-substance concentration & mole per cubic metre & \mole\per\cubicmetre \\
+% luminance & candela per square metre & \candelapersquaremetre \\
+% mass fraction & kilogram per kilogram & \kilogram\per\kilogram\footnote{the symbol 1
+% for quantities of dimension 1 such as mass fraction is generally omitted.} \\
+% \end{tabular}
+% \end{minipage}
+% \end{table}
+%
+%\subsubsection{SI derived units with special names and symbols}For ease of understanding and
+%convenience, 21 SI derived units have been given special names and symbols, as shown in
+%table~\ref{table:derived2}. They may themselves be used to express other derived units.
+% \begin{table}[btp]
+% \caption{--- SI derived units with special names and symbols ---}\label{table:derived2}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{llll}\hline
+% \textbf{Name} & \textbf{Expression in} & \textbf{Symbol} & \textbf{Expression in} \\
+% & \textbf{SI base units} & & \textbf{SI derived units}\\ \hline
+% radian\footnotemark[1] & \radianbase\(\,=1\)\footnotemark[2] & \radian & \derradian \\
+% steradian\footnotemark[1] & \steradianbase \(\,=1\)\footnotemark[2] & \steradian\footnotemark[3] & \dersteradian \\
+% hertz & \hertzbase & \hertz & \derhertz \\
+% newton & \newtonbase & \newton & \dernewton \\
+% pascal & \pascalbase & \pascal & \derpascal \\
+% joule & \joulebase & \joule & \derjoule \\
+% watt & \wattbase & \watt & \derwatt \\
+% coulomb & \coulombbase & \coulomb & \dercoulomb \\
+% volt & \voltbase & \volt & \dervolt \\
+% farad & \faradbase & \farad & \derfarad \\
+% ohm & \ohmbase & \ohm & \derohm \\
+% siemens & \siemensbase & \siemens & \dersiemens \\
+% weber & \weberbase & \weber & \derweber \\
+% tesla & \teslabase & \tesla & \dertesla \\
+% henry & \henrybase & \henry & \derhenry \\
+% celsius & \celsiusbase & \celsius & \dercelsius \\
+% lumen & \lumenbase\footnotemark[3] & \lumen & \derlumen \\
+% lux & \luxbase & \lux & \derlux \\
+% becquerel & \becquerelbase & \becquerel & \derbecquerel \\
+% gray & \graybase & \gray & \dergray \\
+% sievert\footnotemark[4] & \sievertbase & \sievert & \dersievert \\
+% katal\footnotemark[5] & \katalbase & \katal & \derkatal\\
+% \end{tabular}
+% \footnotetext[1]
+% {The radian and steradian may be used advantageously in expressions for derived units to
+% distinguish between quantities of a different nature but of the same dimension; some
+% examples are given in table~\ref{table:derived3}.}
+% \footnotetext[2]
+% {In practice, the symbols \radian\ and \steradian\ are used where appropriate, but the
+% derived unit `\(1\)' is generally omitted.}
+% \footnotetext[3]
+% {In photometry, the unit name steradian and the unit symbol \steradian\ are usually
+% retained in expressions for derived units.}
+% \footnotetext[4]
+% {Other quantities expressed in sieverts are ambient dose equivalent, directional dose
+% equivalent, personal dose equivalent, and organ equivalent dose.}
+% \footnotetext[5]
+% {The 21st Conf\'{e}rence G\'{e}n\'{e}rale des Poids et Mesures decides to adopt the special name katal,
+% symbol \katal, for the SI unit mole per second to express catalytic activity, especially
+% in the fields of medicine and biochemistry, ... (21th CGPM (1999), Resolution 12).}
+% \end{minipage}
+% \end{table}
+%\subsubsection{Use of SI derived units with special names and symbols}
+%Examples of SI derived units that can be expressed with the aid of SI derived units
+%having special names and symbols (including the radian and steradian) are given in
+%table~\ref{table:derived2}. The advantages of using the special names and symbols of SI
+%derived units are apparent in table~\ref{table:derived3}. Consider, for example, the
+%quantity molar entropy: the unit \joenit{\joule\per\mole.\kelvin}\ is obviously more easily
+%understood than its SI base-unit equivalent,
+%\joenit{\squaremetre.\kilogram.\second\rpsquared.\reciprocal\kelvin\reciprocal\mole}.
+%Nevertheless, it should always be recognised that the special names and symbols exist for
+%convenience. Tables~\ref{table:derived2}~\&~\ref{table:derived3} also show that the
+%values of several different quantities are expressed in the same SI unit. For example,
+%the joule per kelvin (\joule\per\kelvin) is the SI unit for heat capacity as well as for
+%entropy. Thus the name of the unit is not sufficient to define the quantity measured. A
+%derived unit can often be expressed in several different ways through the use of base
+%units and derived units with special names. In practice, with certain quantities,
+%preference is given to using certain units with special names, or combinations of units,
+%to facilitate the distinction between quantities whose values have identical expressions
+%in terms of SI base units. For example, the SI unit of frequency is specified as the
+%hertz (Hz) rather than the reciprocal second (\reciprocal\second), and the SI unit of
+%moment of force is specified as the newton metre (\newtonmetre) rather than the joule
+%(\joule).
+%
+% \begin{table}[btp]
+% \caption{--- Examples of SI derived units expressed with the aid of SI
+% derived units having special names and symbols ---}\label{table:derived3}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lll}\hline
+% \textbf{Derived quantity} & \textbf{Name} & \textbf{Symbol}\\ \hline
+% angular velocity & radian per second & \radianpersecond \\
+% angular acceleration & radian per second squared & \radianpersquaresecond \\
+% dynamic viscosity & pascal second & \pascalsecond \\
+% moment of force & newton metre & \newtonmetre \\
+% surface tension & newton per metre & \newtonpermetre \\
+% heat flux density,\\ irradiance & watt per square metre & \wattpersquaremetre \\
+% radiant intensity & watt per steradian & \watt\per\steradian \\
+% radiance & watt per square metre steradian & \wattpersquaremetresteradian \\
+% heat capacity,\\ entropy & joule per kelvin & \jouleperkelvin \\
+% specific heat capacity,\\ specific entropy & joule per kilogram kelvin & \jouleperkilogramkelvin \\
+% specific energy & joule per kilogram & \jouleperkilogram \\
+% thermal conductivity & watt per metre kelvin & \wattpermetrekelvin \\
+% energy density & joule per cubic metre & \joulepercubicmetre \\
+% electric field strength & volt per metre & \voltpermetre \\
+% electric charge density & coulomb per cubic metre & \coulombpercubicmetre \\
+% electric flux density & coulomb per square metre & \coulombpersquaremetre \\
+% permittivity & farad per metre & \faradpermetre \\
+% permeability & henry per metre & \henrypermetre \\
+% molar energy & joule per mole & \joulepermole \\
+% molar entropy, molar\\ heat capacity & joule per mole kelvin & \joulepermolekelvin \\
+% exposure (x and \(\gamma\) rays)& coulomb per kilogram & \coulombperkilogram \\
+% absorbed dose rate & gray per second & \graypersecond \\
+% catalytic (activity)\\ concentration & katal per cubic metre & \katalpercubicmetre \\
+% \end{tabular}
+% \end{minipage}
+% \end{table}
+% \subsection{Dimension of a quantity}
+% Any SI derived quantity \(Q\) can be expressed in terms of the SI base quantities length
+% (\(l\)), mass (\(m\)), time (\(t\)), electric current (\(I\)), thermodynamic temperature
+% (\(T\)), amount of substance (\(n\)), and luminous intensity (\(I_{\mathrm{v}}\)) by an
+% equation of the form
+% \[
+% Q = l^{\alpha}m^{\beta}t^{\gamma}I^{\delta}T^{\varepsilon}n^{\zeta}I_{\mathrm{v}}^{\eta}
+% \sum\limits_{k = 1}^K {a_k} ,
+% \]
+% where the exponents \(\alpha\), \(\beta\), \(\gamma\), \(\ldots\) are numbers and the
+% factors \(a_{k}\) are also numbers. The dimension of \(Q\) is defined to be
+% \[
+% \dim Q = \dimn{L}^{\alpha} \dimn{M}^{\beta} \dimn{T}^{\gamma} \dimn{I}^{\delta}
+% \dimn{\Theta}^{\varepsilon} \dimn{N}^{\zeta} \dimn{J}^{\eta} ,
+% \]
+% where \dimn{L}, \dimn{M}, \dimn{T}, \dimn{I}, \dimn{\Theta}, \dimn{N} and \dimn{J}\ are
+% the dimensions of the SI base quantities length, mass, time, electric current,
+% thermodynamic temperature, amount of substance, and luminous intensity, respectively. The
+% exponents \(\alpha\), \(\beta\), \(\gamma\), \(\ldots\) are called ``dimensional
+% exponents''. The SI derived unit of \(Q \) is \(\joenit{\metre^{\alpha}.\kilogram^{\beta}
+%.\second^{\gamma}.\ampere^{\delta}.\kelvin^{\varepsilon}.\mole^{\zeta}
+%.\candela^{\eta}}\), which is obtained by replacing the dimensions of the SI base
+% quantities in the dimension of \(Q\) with the symbols for the corresponding base units.
+% \begin{quote}
+% \Fe\ Consider a nonrelativistic particle of mass \(m\) in uniform motion which travels a
+% distance \(l\) in a time \(t\). Its velocity is \(\upsilon=l / t\) and its kinetic energy
+% is \(E_{\mathrm{k}} =m\upsilon^{2} /2 = l^{2}mt^{-2} / 2\). The dimension of
+% \(E_{\mathrm{k}}\) is \(\dim E_{\mathrm{k}} = \dimn{L}^{2}\dimn{M}\dimn{T}^{-2}\) and the
+% dimensional exponents are \(2\), \(1\), and~\(-2\). The SI derived unit of \(E_{\mathrm{k}}\) is then
+% \(\joenit{\metre\squared.\kilogram.\second\rpsquared}\), which is given the special name
+% ``joule'' and special symbol \joule.
+% \end{quote}
+%
+% \subsubsection{Units for dimensionless quantities, quantities of dimension one}
+% A derived quantity of dimension one, which is sometimes called a ``dimensionless
+% quantity'', is one for which all of the dimensional exponents are zero: \(\dim Q = 1\). It
+% therefore follows that the derived unit for such a quantity is also the number one,
+% symbol 1, which is sometimes called a ``dimensionless derived unit''.
+% Thus the SI unit of all quantities having the dimensional product one is the
+% number one. Examples of such quantities are refractive index, relative permeability, and
+% friction factor. All of these quantities are described as being dimensionless, or of
+% dimension one, and have the coherent SI unit 1. Their values are simply expressed as
+% numbers and, in general, the unit 1 is not explicitly shown.
+% \begin{quote}
+% \Fe\ The mass fraction \(w_{\mathrm{B}}\) of a substance B in a mixture is given by
+% \(w_{\mathrm{B}} = m_{\mathrm{B}}/m\), where \(w_{\mathrm{B}}\) is the mass of B and
+% \(m\) is the mass of the mixture. The dimension of \(w_{\mathrm{B}}\) is \(\dim
+% w_{\mathrm{B}} = \dimn{M}^{1} \dimn{M}^{-1} = 1\); all of the dimensional exponents of
+% \(w_{\mathrm{B}}\) are zero, and its derived unit is \(\joenit{\kilogram^{1}.\kilogram^{-1}}=
+% 1\) also.
+% \end{quote}
+% In a few cases, however, a special name is given to this unit, mainly to avoid
+% confusion between some compound derived units. This is the case for the radian,
+% steradian and neper.
+%
+%\subsection{Rules and style conventions for writing and using SI unit symbols}
+%The general principles concerning writing the unit symbols were adopted by the 9th CPGM
+%(1948), by its Resolution 7:
+%\begin{enumerate}
+%\item Roman (upright) type, in general lower case\footnote{The recommended symbol for the
+%litre (`liter') in the United States is \liter.}, is used for the unit symbols. If,
+%however, the name of the unit is derived from a proper name, the first letter of the symbol
+%is in upper case.
+% \item Unit symbols are unaltered in the plural.
+% \item Unit symbols are not followed by a period\footnote{Unless at the end of a sentence.}.
+%\end{enumerate}
+%To ensure uniformity in the use of the SI unit symbols, ISO International Standards give
+%certain recommendations. Following these recommendations:
+%\begin{list}{a)}{}
+%\item The product of two or more units are indicated by means of either a half-high (that
+%is, centred) dot or a space\footnote{ISO suggests that if a space is used to indicate units
+%formed by multiplication, the space may be omitted if it does not cause confusion. This
+%possibility is reflected in the common practice of using the symbol \kilo\watt\hour\ rather
+%than \kilo\watt\(\cdot\)\hour\ or \joenit{\kilo\watt.\hour}\ for the kilowatt hour.}. The
+%half-high dot is preferred, because it is less likely to lead to confusion,
+% \begin{list}{}{}
+% \item \fe
+% \item \newton\(\cdot\)\metre\ or \(\newton\;\metre\).
+% \end{list}
+%\end{list}
+%\begin{list}{b)}{}
+% \item A solidus (oblique stroke,/), a horizontal line, or negative exponents may be used to
+%express a derived unit formed from two others by division,
+% \begin{list}{}{}
+% \item \fe
+% \item \metre\per\second,\ \(\frac{\metre}{\second}\),\ or \joenit{\metre.\reciprocal\second}
+% \end{list}
+%\end{list}
+%\begin{list}{c)}{}
+% \item The solidus must not be repeated on the same line unless ambiguity is avoided by
+% parentheses. In complicated cases negative exponents or parentheses should be used,
+% \begin{list}{}{}
+% \item \fe
+% \item \metre\per\second\squared\ or\ \joenit{\metre.\second\rpsquared}\ \textit{but not:\ }\metre\per\second\per\second\
+% \item \joenit{\metre.\kilogram\per(\cubic\second.\ampere)}\ or
+% \joenit{\metre.\kilogram.\rpcubic\second.\reciprocal\ampere}\ \textit{but not:}\ \joenit{\metre.\kilogram\per\cubic\second\per\ampere}
+% \end{list}
+%\end{list}
+%\subsubsection{Space between numerical value and unit symbol}
+%In the expression for the value of a quantity, the unit symbol is placed after the numerical value
+%and a space is left between the numerical value and the unit symbol.
+%The only exceptions to this rule are for the unit symbols for degree, minute, and second for plane
+%angle: \degree, \paminute, and \pasecond, respectively (see Table~\ref{table:accepted1}), in which case
+%no space is left between the numerical value and the unit symbol.
+% \begin{list}{}{}
+% \item \fe
+% \item \(\alpha = \unit{30}{\degree}\unit{22}{\paminute}\unit{8}{\pasecond}\) Note: \(\alpha\) is a quantity symbol for plane angle.
+% \end{list}
+% This rule means that the symbol \celsius\ for the degree Celsius is preceded by a space when one expresses the values of
+% Celsius temperatures.
+% \begin{list}{}{}
+% \item \fe
+% \item \(t = \unit{30.2}{\celsius}\) \textit{but not} \(t = 30.2\celsius\)
+% \end{list}
+%\section{SI Prefixes}
+%\subsection{Decimal multiples and submultiples of SI units}
+%The 11th CGPM (1960), by its Resolution 12, adopted a first series of prefixes and symbols
+%of prefixes to form the names and symbols of the decimal multiples and submultiples of SI
+%units. Prefixes for \power {10}{-15} and \power {10}{-18} were added by the 12th CGPM
+%(1964), by its Resolution 8, those for \power {10}{15} and \power {10}{18} by the CGPM
+%(1975), by its Resolution 10, and those for \power {10}{21}, \power {10}{24}, \power {10}
+%{-21}, and \power {10}{-24} were proposed by the CIPM for approval by the 19th CGPM (1991),
+%and adopted. The prefixes are as shown in tabel~\ref{table:prefixes}.
+% \begin{table}[btp]
+% \caption{--- SI prefixes ---}\label{table:prefixes}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{llllll}\hline
+% \textbf{Name}& \textbf{Symbol}& \textbf{Factor} & \textbf{Name}& \textbf{Symbol}& \textbf{Factor}\\ \hline
+% yocto & \yocto & \yoctod = \power{(\kilod)}{-8}& yotta & \yotta & \yottad = \power{(\kilod)}{8}\\
+% zepto & \zepto & \zeptod = \power{(\kilod)}{-7}& zetta & \zetta & \zettad = \power{(\kilod)}{7}\\
+% atto & \atto & \attod = \power{(\kilod)}{-6} & exa & \exa & \exad = \power{(\kilod)}{6}\\
+% femto & \femto & \femtod = \power{(\kilod)}{-5}& peta & \peta & \petad = \power{(\kilod)}{5}\\
+% pico & \pico & \picod = \power{(\kilod)}{-4} & tera & \tera & \terad = \power{(\kilod)}{4}\\
+% nano & \nano & \nanod = \power{(\kilod)}{-3} & giga & \giga & \gigad = \power{(\kilod)}{3}\\
+% micro & \micro & \microd = \power{(\kilod)}{-2}& mega & \mega & \megad = \power{(\kilod)}{2}\\
+% milli & \milli & \millid = \power{(\kilod)}{-1}& kilo & \kilo & \kilod = \power{(\kilod)}{1}\\
+% centi & \centi & \centid & hecto & \hecto & \hectod \\
+% deci & \deci & \decid & deca\footnotemark[1] & \deca & \decad \\
+%
+% \end{tabular}
+% \footnotetext[1]
+% {In the USA, the spelling `deka' is extensively used.}
+% \end{minipage}
+% \end{table}
+% \subsection{Rules for using SI prefixes}
+% In accord with the general principles adopted by the ISO\footnote{ISO 31, in `Units of
+% measurement,' ISO Standards Handbook 2, 2nd Edition, ISO, Geneva, 1982, pp. 17--238}, the
+% CIPM recommends that the following rules for using the SI prefixes be observed:
+% \begin{enumerate}
+% \item Prefix symbols are printed in roman (upright) type without spacing between the prefix
+% symbol and the unit symbol. \item The grouping formed by the prefix symbol attached to the
+% unit symbol constitutes a new inseparable symbol (of a multiple of the unit concerned) which
+% can be raised to a positive or negative power and which can be combined with other unit
+% symbols to form compound unit symbols,
+% \begin{list}{}{}
+% \item \fe
+% \item \(\unit{1}{\centi\cubic\metre} = \cubic{(\unit{\power{10}{-2}}{\metre})} = \unit{\power{10}{-6}}{\cubic\metre}\)
+% \item \(\unit{1}{\reciprocal{\centi\metre}} = \reciprocal{(\unit{\centid}{\metre})} = \unit{\hectod}{\reciprocal\metre}\)
+% \item \(\unit{1}{\volt\per\centi\metre} = (\unit{1}{\volt})\per(\unit{\centid}{\metre}) = \unit{\hectod}{\volt\per\metre}\)
+% \end{list}
+% \item Compound prefixes, i.\,e., prefixes formed by juxtaposition of two or more SI prefixes
+% are not to be used,
+% \begin{list}{}{}
+% \item \fe \item \unit{1}{\pico\gram}\ (one picogram), \textit{but not} \unit{1}
+% {\milli\nano\gram}\ (one millinanogram)
+% \end{list}
+% \item A prefixes should never be used alone,
+% \begin{list}{}{}
+% \item \fe \item \megad\per\cubic\metre, \textit{but not}
+% \mega\per\cubic\metre
+% \end{list}
+% \end{enumerate}
+% \subsubsection{The kilogram}
+% It is important to note that the kilogram is the only SI unit with a prefix as part of its
+% name and symbol. Because multiple prefixes may not be used, in the case of the kilogram the
+% prefix names are used with the unit name `gram' and the prefix symbols are used with the
+% unit symbol \gram, \fe\\ \unit{\microd}{\kilogram}\ = \unit{1}{\milli\gram}\ (one
+% milligram), \textit{but not} \unit{\microd}{\kilogram}\ = \unit{1}{\micro\kilogram} ~(one
+% microkilogram).
+% \subsubsection{The `degree Celsius'} Except for the kilogram, any SI prefix may be used with any SI unit,
+% including the `degree Celsius' and its symbol \celsius, \fe \\
+% \unit{\millid}{\celsius}\ = \unit{1}{\milli\celsius}\ (one millidegree Celsius), \textit{or}
+% \unit{\megad}{\celsius}\ = \unit{1}{\mega\celsius}.
+% \section{Prefixes for binary multiples} In December 1998 the International
+% Electrotechnical Commission (IEC), the leading international organization for worldwide
+% standardization in electrotechnology, approved as an IEC International Standard names and
+% symbols for prefixes for binary multiples for use in the fields of data processing and
+% data transmission. The prefixes are as shown in table~\ref{table:bipre}.
+% \begin{table}[btp]
+% \caption{--- Prefixes for binary multiples ---}\label{table:bipre}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lllllll}\hline
+% \textbf{Factor} & \textbf{Name} & \textbf{Symbol} & \textbf{Origin}& & \multicolumn{2}{l}{\textbf{Derivation}}\\
+% \hline
+% \kibid & kibi & \kibi & kilobinary: & \power{(\power{2}{10})}{1} & kilo:& \power{(\kilod)}{1}\\
+% \mebid & mebi & \mebi & megabinary: & \power{(\power{2}{10})}{2} & mega:& \power{(\kilod)}{2}\\
+% \gibid & gibi & \gibi & gigabinary: & \power{(\power{2}{10})}{3} & giga:& \power{(\kilod)}{3}\\
+% \tebid & tebi & \tebi & terabinary: & \power{(\power{2}{10})}{4} & tera:& \power{(\kilod)}{4}\\
+% \pebid & pebi & \pebi & petabinary: & \power{(\power{2}{10})}{5} & peta:& \power{(\kilod)}{5}\\
+% \exbid & exbi & \exbi & exabinary: & \power{(\power{2}{10})}{6} & exa: & \power{(\kilod)}{6}\\
+% \end{tabular}
+% \end{minipage}
+% \end{table}
+% \begin{table}[btp]
+% \caption{--- Examples and comparisons with SI prefixes ---}\label{table:bipre2}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lllllll}\hline
+% one kibibit & \unit{1}{\kibi\bit } & = & \unit{\kibid}{\bit } & = & \unit{1\,024 }{\bit }\\
+% one kilobit & \unit{1}{\kilo\bit } & = & \unit{\kilod}{\bit } & = & \unit{1\,000 }{\bit }\\
+% one mebibyte & \unit{1}{\mebi\byte} & = & \unit{\mebid}{\byte} & = & \unit{1\,048\,576}{\byte}\\
+% one megabyte & \unit{1}{\mega\byte} & = & \unit{\megad}{\byte} & = & \unit{1\,000\,000}{\byte}\\
+% one gibibyte & \unit{1}{\gibi\byte} & = & \unit{\gibid}{\byte} & = & \unit{1\,073\,741\,824}{\byte}\\
+% one gigabyte & \unit{1}{\giga\byte} & = & \unit{\gigad}{\byte} & = & \unit{1\,000\,000\,000}{\byte}\\
+% \end{tabular}
+% \end{minipage}
+% \end{table}%
+% It is suggested that in English, the first syllable of the name of the binary-multiple
+% prefix should be pronounced in the same way as the first syllable of the name of the
+% corresponding SI prefix, and that the second syllable should be pronounced as ``bee".
+%
+%\subsubsection*{Note}
+%It is important to recognize that the new prefixes for binary multiples are \textit{not}
+%part of the International System of Units (SI), the modern metric system. However, for
+%ease of understanding and recall, they were derived from the SI prefixes for positive
+%powers of ten. As can be seen from the above table, the name of each new prefix is
+%derived from the name of the corresponding SI prefix by retaining the first two letters
+%of the name of the SI prefix and adding the letters ``\textrm{bi}", which recalls the word
+%``binary". Similarly, the symbol of each new prefix is derived from the symbol of the
+%corresponding SI prefix by adding the letter ``\textrm{i}", which again recalls the word
+%``binary". (For consistency with the other prefixes for binary multiples, the symbol
+%\kibi\ is used for \kibid\ rather than \textrm{ki}.)
+%\subsection{Official publication}
+%These prefixes for binary multiples, which were developed by IEC Technical Committee (TC)
+%25, Quantities and units, and their letter symbols, with the strong support of the
+%International Committee for Weights and Measures (CIPM) and the Institute of Electrical
+%and Electronics Engineers (IEEE), were adopted by the IEC as \textit{Amendment 2 to IEC
+%International Standard IEC 60027-2: Letter symbols to be used in electrical technology -
+%Part 2: Telecommunications and electronics}. The full content of \textit{Amendment 2},
+%which has a publication date of 1999-01, is reflected in the tables above and the
+%suggestion regarding pronunciation.
+%\changes{v0.99}{1999/07/28}{New binary prefixes support/documentation section added}
+%\subsection{The \texttt{binary.sty} style for binary prefixes and (non-SI) units}
+% The \texttt{binary.sty} style for binary prefixes and (non-SI) units can be loaded by using the option \opt{binary}, as in |\usepackage[binary]{SIunits}|. This unit should always
+% be used in conjunction with the \pkgname{SIunits}\ package.
+% \section{Units outside the SI}
+% Units that are outside the SI may be divided into three categories:
+% \begin{enumerate}
+% \item those units that are accepted for use with the SI;
+% \item those units that are temporarily accepted for use with the SI; and
+% \item those units that are not accepted for use with the SI and thus must strictly be avoided.
+% \end{enumerate}
+% \subsection{Units accepted for use with the SI}
+% The CIPM (1969) recognised that users of SI will also wish to employ with it certain units not part of it, but
+% which are important and are widely used. These units are given in table~\ref{table:accepted1}. The combination of
+% units of this table with SI units to form compound units should be restricted to special cases in order not
+% to lose the advantage of the coherence of SI units.\\
+% \begin{table}[btp]
+% \caption{--- Units accepted for use with the SI ---}\label{table:accepted1}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lll}\hline
+% \textbf{Name} & \textbf{Symbol} & \textbf{Value in SI units}\\ \hline
+% minute (time) & \minute & \unit{1}{\minute} = \unit{60}{\second} \\
+% hour & \hour & \unit{1}{\hour} = \unit{60}{\minute} = \unit{\intfmt{3600}}{\second} \\
+% day & \dday & \unit{1}{\dday} = \unit{24}{\hour} = \unit{\intfmt{86400}}{\second} \\
+% degree\footnotemark[1] & \degree & \unit{1}{\degree} = \unit{(\pi/180)}{\radian} \\
+% minute (plane angle) & \paminute & \unit{1}{\paminute} = \unit{(1/60)}{\degree} = \unit{(\pi/\intfmt{10800})}{\radian} \\
+% second (plane angle) & \pasecond & \unit{1}{\pasecond} = \unit{(1/60)}{\paminute} = \unit{(\pi/\intfmt{648000})}{\radian} \\
+% litre & \litre, \liter\footnotemark[2] & \unit{1}{\litre} = \unit{1}{\liter} = \unit{1}{\cubic{\deci\metre}} = \unit{\millid}{\cubic\metre} \\
+% tonne\footnotemark[3] & \tonne & \unit{1}{\ton} = \unit{\kilod}{\kilogram} \-\\
+% neper\footnotemark[4]\footnotemark[5] & \neper & \unit{1}{\neper} = \unit{1}{\one} \\
+% bel\footnotemark[6]\footnotemark[5] & \bel & \unit{1}{\bel} = \unit{(1/2)\ln 10}{(\neper)}\footnotemark[7]\\
+% \end{tabular}
+% \footnotetext[1]
+% {ISO 31 recommends that the degree be subdivided decimally rather than using the minute
+% and second.}
+% \footnotetext[2]
+% {The alternative symbol for the litre, \liter, was adopted by the CGPM in order to avoid
+% the risk of confusion between the letter l and the number \(1\). Thus, although both
+% \litre\ and \liter\ are internationally accepted symbols for the litre, to avoid this
+% risk the symbol to be used in the United States is \liter.}
+% \footnotetext[3]
+% {In some English-speaking countries this unit is called `metric ton'.}
+% \footnotetext[4]
+% {The neper is used to express values of such logarithmic quantities as field level, power
+% level, sound pressure level, and logarithmic decrement. Natural logarithms are used to
+% obtain the numerical values of quantities expressed in nepers. The neper is coherent with
+% the SI, but not yet adopted by the CGPM as an SI unit. For further information see
+% International Standard ISO 31.}
+% \footnotetext[5]
+% {The bel is used to express values of such logarithmic quantities as field level, power
+% level, sound pressure level, and attenuation. Logarithms to base ten are used to obtain
+% the numerical values of quantities expressed in bels. The submultiple decibel, \deci\bel,
+% is commonly used. For further information see International Standard ISO 31.}
+% \footnotetext[6]
+% {In using these units it is particularly important that the quantity be specified. The
+% unit must not be used to imply the quantity.}
+% \footnotetext[7]
+% {\neper\ is enclosed in parentheses because, although the neper is coherent with the SI,
+% it has not yet been adopted by the CGPM.}
+%
+%
+% \end{minipage}
+% \end{table}
+% It is likewise necessary to recognise, outside the International System, some other units that are useful in
+% specialised fields, because their values expressed in SI units must be obtained by experiment, and are therefore
+% not known exactly (table~\ref{table:accepted2}).
+% \begin{table}[btp]
+% \caption{--- Units accepted for use with the SI whose values in SI units are obtained experimentally ---}\label{table:accepted2}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{llc}\hline
+% \textbf{Name} & \textbf{Symbol} & \textbf{Definition}\\ \hline
+% electronvolt & \electronvolt & \footnotemark[1] \\
+% unified atomic mass unit & \atomicmass & \footnotemark[2] \\
+% \end{tabular}
+% \footnotetext[1]
+% {The electronvolt is the kinetic energy acquired by an electron in passing through a
+% potential difference of \(1\) \volt\ in vacuum; \unit{1}{\electronvolt} =
+% \(\unit{\sci{\nmfmt{1.60217733}e-19}}{\joule}\) with a combined standard
+% uncertainty of \(\unit{\sci{\nmfmt{0.00000049}e-19}}{\joule}\).}
+% \footnotetext[2]
+% {The unified atomic mass unit is equal to \(1/12\) of the mass of an atom of the nuclide
+% \(^{12}\mathrm{C}\); \unit{1}{\atomicmass} =
+% \unit{\sci{\nmfmt{1.6605402}e-27}}{\kilogram} with a combined standard
+% uncertainty of \unit{\sci{\nmfmt{0.0000010}e-27}}{\kilogram}.}
+% \end{minipage}
+% \end{table}
+% \subsection{Units temporarily accepted for use with the SI}
+% Because of existing practice in certain fields or countries, in 1978 the CIPM considered that it was permissible
+% for the units given in table~\ref{table:temporarily} to continue to be used with the SI until the CIPM considers that
+% their use is no longer necessary. However, these units must not be introduced where they are not presently used.
+% \begin{table}[btp]
+% \caption{--- Units in use temporarily with the SI ---}\label{table:temporarily}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lll}\hline
+% \textbf{Name} & \textbf{Symbol} & \textbf{Value in SI units}\\ \hline
+% nautical mile\footnotemark[1] & \ & \unit{1}{nautical\ mile} = \unit{\intfmt{1852}}{\metre} \\
+% knot & \ & \unit{1}{nautical\ mile\ per\ hour} = \unit{(\intfmt{1852}/\intfmt{3600})}{\metre\per\second} \\
+% \aa ngstr\"{o}m & \angstrom & \unit{1}{\angstrom} = \unit{0.1}{\nano\metre} = \unit{\power{10}{-10}}{\metre} \\
+% are\footnotemark[2] & \are & \unit{1}{\are} = \unit{1}{\square{\deca\metre}} = \unit{\power{10}{2}}{\square\metre} \\
+% hectare\footnotemark[2] & \hectare & \unit{1}{\hectare} = \unit{1}{\square{\hecto\metre}} = \unit{\power{10}{4}}{\square\metre} \\
+% barn\footnotemark[3] & \barn & \unit{1}{\barn} = \unit{100}{\square{\femto\metre}} = \unit{\power{10}{-28}}{\square\metre} \\
+% bar\footnotemark[4] & \bbar & \unit{1}{\bbar} = \unit{0.1}{\mega\pascal} = \unit{\power{10}{5}}{\pascal} \\
+% gal\footnotemark[5] & \gal & \unit{1}{\gal} = \unit{1}{\centi\metre\per\second\squared} = \unit{\power{10}{-2}}{\metre\per\second\squared} \\
+% curie\footnotemark[6] & \curie & \unit{1}{\curie} = \(\unit{\sci{3.7e10}}{\becquerel}\) \\
+% roentgen\footnotemark[7] & \roentgen & \unit{1}{\roentgen} = \(\unit{\sci{2.58e-4}}{\coulomb\per\second}\) \\
+% rad\footnotemark[8] & \rad & \unit{1}{\rad} = \unit{1}{\centi\gray} = \unit{\power{10}{-2}}{\gray} \\
+% rem\footnotemark[9] & \rem & \unit{1}{\rem} = \unit{1}{\centi\sievert} = \unit{\power{10}{-2}}{\sievert} \\
+% \end{tabular}
+% \footnotetext[1]
+% {The nautical mile is a special unit employed for marine and aerial navigation to express
+% distances. The conventional value given above was adopted by the First International
+% Extraordinary Hydrographic Conference, Monaco, 1929, under the name ``International
+% nautical mile''.}
+% \footnotetext[2]
+% {This unit and its symbol were adopted by the CIPM in 1879 (BIPM Proc. Verb. Com. Int.
+% Poids et Mesures, 1879, p. 41) and are used to express agrarian areas.}
+% \footnotetext[3]
+% {The barn is a special unit employed in nuclear physics to express effective cross
+% sections.}
+% \footnotetext[4]
+% {This unit and its symbol are included in Resolution 7 of the 9th CGPM (1948).}
+% \footnotetext[5]
+% {The gal is a special unit employed in geodesy and geophysics to express the acceleration
+% due to gravity.}
+% \footnotetext[6]
+% {The curie is a special unit employed in nuclear physics to express activity of
+% radionuclides (12th CGPM (1964), Resolution 7).}
+% \footnotetext[7]
+% {The roentgen is a special unit employed to express exposure of x or \(\gamma\)
+% radiations.}
+% \footnotetext[8]
+% {The rad is a special unit employed to express absorbed dose of ionising radiations. When
+% there is risk of confusion with the symbol for radian, rd may be used as the symbol for
+% rad.}
+% \footnotetext[9]
+% {The rem is a special unit used in radioprotection to express dose equivalent.}
+%
+% \end{minipage}
+% \end{table}
+%
+% \section{Last notes about correct usage of the SI}
+% The following points underline some of the important aspects about using SI units and their
+% symbols, and also mention some of the common errors that are made. The SI differs from some
+% of the older systems in that it has \textit{definite} rules governing the way the units and
+% symbols are used.
+% \begin{itemize}
+% \item The unit of measure is the \textit{`metre'}, not \textit{`meter'}. The latter is a device used
+% for measuring things. (Unless you live in the USA - in which case you will just have to live
+% with the ambiguity.) \item Using a comma to separate groups of three digits is not
+% recommended - a (thin) space is preferable, since many countries use the comma as the decimal point
+% marker. Both the USA and UK use the `dot on the line' (full stop). So the following would be
+% correct: \nmfmt{1234555.678990}. \item The term \textbf{billion} should be avoided since in
+% most countries outside the USA (including the UK) it means a million-million (prefix tera),
+% whereas in the USA it means a thousand million (prefix giga). Likewise the term \textbf{trillion}
+% means million-million-million (prefix exa) in most countries outside the USA.
+% \item The `litre' (`liter' in the US) is one of those units which is approved by the CGPM for
+% use with the metric system. The official unit of volume in the SI is the cubic metre.
+% However, since this is not convenient for much day-to-day use the CGPM has approved the use
+% of the `other unit', the litre. The litre represents a cubic decimetre and you may use
+% either the symbol `\litre' or `\liter'\footnote{Recommended symbol for the `liter' in the USA} (small
+% or capital `ell') to represent it. They do not approve using any prefixes other than milli
+% or micro with it. It was originally defined as the volume occupied by \unit{1}{\kilogram}\ of water.
+% Subsequently it was found that this was not precisely 1 cubic decimetre, so the term litre
+% was withdrawn. Later it was re-introduced officially as 1 cubic decimetre exactly. So,
+% \unit{1}{\litre} = \unit{1}{\cubic{\deci\metre}} = \unit{1}{\liter}.
+% \end{itemize}
+%
+% \section{How to use the package}
+%
+% \subsection{Loading}
+% Most features are controlled by package options that can be selected
+% when the package is loaded (e.\,g |\usepackage|\oarg{options}|{SIunits}|) or at
+% `runtime' as an optional argument(list) to the |\SIunits| command
+% (e.\,g. \cmd{\SIunits}\oarg{options}).
+%
+% \begin{verbatim}
+% \documentclass[]{article}
+%
+% \usepackage[options]{SIunits}
+%
+% \begin{document}
+% \ldots
+% \SIunits[options]
+% \ldots
+% \end{document}
+% \end{verbatim}
+%
+%
+% \subsection{The package options}\label{sec:options}
+% \changes{v0.02 Beta 2}{1998/09/10}{Code documentation corrections}
+% The options can be grouped in the following categories:
+% \begin{enumerate}
+% \item unit spacing;
+% \item quantity-unit spacing;
+% \item conflicts;
+% \item textstyle;
+% \item miscellaneous.
+% \end{enumerate}
+% \subsubsection{Unit spacing options}
+% \begin{labeling}{\hspace{12mm}}
+% \item[\opt{cdot}]
+% This mode provides the use of \cmd{\cdot} as spacing in units.
+% \item[\opt{thickspace}]
+% This mode provides the use of \cmd{\;} (thick math space) as spacing in units.
+% \item[\opt{mediumspace}]
+% This mode provides the use of \cmd{\:} (medium math space) as spacing in units.
+% \item[\opt{thinspace}]
+% This mode provides the use of \cmd{\,} (thin math space) as spacing in units.
+% \end{labeling}
+% \subsubsection{Quantity-unit spacing options}
+% \begin{labeling}{\hspace{12mm}}
+% \item[\opt{thickqspace}]
+% This mode provides the use of \cmd{\;} (thick math space) as spacing between numerical quantities and units.
+% \item[\opt{mediumqspace}]
+% This mode provides the use of \cmd{\:} (medium math space) as spacing between numerical quantities and units.
+% \item[\opt{thinqspace}]
+% This mode provides the use of \cmd{\,} (thin math space) as spacing between numerical quantities and units.
+% \end{labeling}
+% \subsubsection{Options to prevent conflicts}
+% \subsubsection*{Conflicts with the \texttt{amssymb} package}
+% In the |amssymb| package the command |\square| is defined. This will cause error messages
+% when the |amssymb| package is used in combination with the \pkgname{SIunits}\ package. To prevent
+% errors one can choose two different options:
+% \begin{labeling}{\hspace{15mm}}
+% \item[\opt{amssymb}]This option redefines the \texttt{amssymb} command |\square| to get the desired
+% \pkgname{SIunits}\ definition of the command.\\ \textbf{Note: }When using this option, the \texttt{amssymb} command
+% |\square| can \textbf{not} be used.
+% \item[\opt{squaren}]This option defines a new command |\squaren| that can be used instead of the
+% \pkgname{SIunits}\ command |\square|.\\ \textbf{Note: }When using this option, the \texttt{amssymb} definition for
+% |\square| is used.
+% \end{labeling}
+% \changes{v0.06 Beta 2}{1998/04/07}{amssymb conflicts section added to documentation}
+% \subsubsection*{Conflicts with the \texttt{pstricks} package}
+% In the |pstricks| package the command |\gray| is defined. This will cause error messages
+% when the |pstricks| package is used in combination with the \pkgname{SIunits}\ package. To prevent
+% errors one can choose two different options:
+% \changes{v0.99}{1999/10/29}{pstricks conflicts section added to documentation}
+% \begin{labeling}{\hspace{15mm}}
+% \item[\opt{pstricks}]This option redefines the \texttt{pstricks} command |\gray| to get the desired
+% \pkgname{SIunits}\ definition of the command.\\ \textbf{Note: }When using this option, the \texttt{pstricks} command
+% |\gray| can \textbf{not} be used.
+% \item[\opt{Gray}]This option defines a new command |\Gray| that can be used instead of the
+% \pkgname{SIunits}\ command |\gray|.\\ \textbf{Note: }When using this option, the \texttt{pstricks} definition for
+% |\gray| is used.
+% \end{labeling}
+% \subsubsection*{Conflicts with the \texttt{babel} package in combination with the \opt{italian} language}
+% In the |babel| package, when using the italian language, the command |\unit| is defined. This will prevent \pkgname{SIunits}\ from functioning.
+% To prevent this, choose the option:
+% \begin{labeling}{\hspace{15mm}}
+% \item[\opt{italian}]This option defines a new command |\unita| (italian for unit) that can be used instead of the
+% \pkgname{SIunits}\ command |\unit|.\\ \textbf{Note: }When using this option, the \texttt{babel} definition for
+% |\unit| is used.
+% \end{labeling}
+% \subsubsection{textstyle}
+% \begin{labeling}{\hspace{12mm}}
+% \item[\opt{textstyle}]
+% When using the option \opt{textstyle} units are printed in the typeface of the
+% enclosing text, automatically.
+% \end{labeling}
+% \subsubsection{miscellaneous}
+% \begin{labeling}{\hspace{12mm}}
+% \item[\opt{binary}]
+% This option loads the file \texttt{binary.sty}, which defines prefixes for binary multiples.
+% \item[\opt{noams}]
+% This option redefines the \cmd{\micro} command; use it when you don't have the AMS font, eurm10.
+% \item[\opt{derivedinbase}]
+% This mode provides the ready-to-use expressions of SI derived units in SI base units,
+% e.\,g. \verb=\pascalbase= to get `\pascalbase'.
+% \item[\opt{derived}]
+% This mode provides the ready-to-use expressions of SI derived units in SI derived units,
+% e.\,g. \verb=\derpascal= to get `\derpascal'.
+% \end{labeling}
+% \changes{v0.02 Beta 2}{1998/09/10}{Spacing examples table added}
+% \changes{v0.03 Beta 2}{1998/10/30}{Spacing examples table update}
+% See table~\ref{table:spacing} for examples of the spacing options.
+% \begin{table}[btp]
+% \caption{--- Spacing options ---}\label{table:spacing}
+% \begin{minipage}[]{\textwidth}\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
+% \centering
+% \begin{tabular}{lll}\hline
+% \textbf{Option} & \textbf{Example}\\ \hline
+% \opt{cdot} &\(\newton\cdot\metre\)\\
+% \opt{thickspace}& \(\newton\;\metre\)\\
+% \opt{mediumspace}&\(\newton\:\metre\)\\
+% \opt{thinspace}&\(\newton\,\metre\)\\
+% \opt{thickqspace}& \(10\;\newton\;\metre\)\\
+% \opt{mediumqspace}&\(10\:\newton\;\metre\)\\
+% \opt{thinqspace}&\(10\,\newton\;\metre\)\\
+% \end{tabular}
+% \end{minipage}
+% \end{table}
+% \changes{v0.02 Beta 6}{1998/09/24}{Inconsistencies removed in documentation}
+% \normalsize
+% \section*{Command Reference}
+% \subsection{How to compose units in your text.}
+% The purpose of the \pkgname{SIunits}\ package is: to give an author an intuitive system for writing
+% units.
+% Just type (in \LaTeX-kind commands) what you would say: |\kilogram| or |\kelvin| to get
+% `\kilogram' or `\kelvin'.
+%
+%
+% To use the prefixes with SI units simply place them before the unit, e.\,g. |\milli\ampere|,
+% |\deca\metre| (or |\deka\meter|) or |\mega\ohm| to get: `\milli\ampere', `\deca\metre' or `\mega\ohm'.
+% Decimal values of the prefixes can be made by adding |d| behind the prefix command. See command reference on page~\pageref{commandreference}.
+% \begin{table}[p]
+% \label{commandreference}
+% \centering
+% \begin{tabular}{lr@{\ \vline\ }lr@{\ \vline\ }lr}
+% \multicolumn{6}{c}{\textbf{SI base units}}\\ \hline
+% |\metre| & \metre & |\second| & \second & |\mole| & \mole \\
+% |\meter| & \meter & |\ampere| & \ampere & |\candela| & \candela \\
+% |\kilogram| & \kilogram & |\kelvin| & \kelvin \\ \hline \\
+% \multicolumn{6}{c}{\textbf{SI derived units}}\\ \hline
+% |\hertz| & \hertz & |\farad| & \farad & |\degreecelsius| & \degreecelsius \\
+% |\newton| & \newton & |\ohm| & \ohm & |\lumen| & \lumen \\
+% |\pascal| & \pascal & |\siemens| & \siemens & |\lux| & \lux \\
+% |\joule| & \joule & |\weber| & \weber & |\becquerel| & \becquerel \\
+% |\watt| & \watt & |\tesla| & \tesla & |\gray| & \gray \\
+% |\coulomb| & \coulomb & |\henry| & \henry & |\sievert| & \sievert \\
+% |\volt| & \volt & |\celsius| & \celsius \\ \hline \\
+% \multicolumn{6}{c}{\textbf{Units outside of SI}}\\ \hline
+% |\angstrom| & \angstrom & |\dday| & \dday & |\minute| & \minute \\
+% |\arcminute| & \arcminute & |\degree| & \degree & |\neper| & \neper \\
+% |\arcsecond| & \arcsecond & |\electronvolt| & \electronvolt & |\rad| & \rad \\
+% |\are| & \are & |\gal| & \gal & |\rem| & \rem \\
+% |\atomicmass| & \atomicmass & |\gram| & \gram & |\roentgen| & \roentgen \\
+% |\barn| & \barn & |\hectare| & \hectare & |\rperminute| & \rperminute \\
+% |\bbar| & \bbar & |\hour| & \hour & |\tonne| & \tonne \\
+% |\bel| & \bel & |\liter| & \liter & |\ton| & \ton \\
+% |\curie| & \curie & |\litre| & \litre \\ \hline \\
+% \multicolumn{6}{c}{\textbf{SI Prefixes}}\\ \hline
+% |\yocto| & \yocto & |\milli| & \milli & |\mega| & \mega \\
+% |\zepto| & \zepto & |\centi| & \centi & |\giga| & \giga \\
+% |\atto| & \atto & |\deci| & \deci & |\tera| & \tera \\
+% |\femto| & \femto & |\deca| & \deca & |\peta| & \peta \\
+% |\pico| & \pico & |\deka| & \deca & |\exa| & \exa \\
+% |\nano| & \nano & |\hecto| & \hecto & |\zetta| & \zetta \\
+% |\micro| & \micro & |\kilo| & \kilo & |\yotta| & \yotta \\ \hline \\
+% \multicolumn{6}{c}{\textbf{Decimal values of SI Prefixes}}\\ \hline
+% |\yoctod| & \yoctod & |\millid| & \millid & |\megad| & \megad \\
+% |\zeptod| & \zeptod & |\centid| & \centid & |\gigad| & \gigad \\
+% |\attod| & \attod & |\decid| & \decid & |\terad| & \terad \\
+% |\femtod| & \femtod & |\decad| & \decad & |\petad| & \petad \\
+% |\picod| & \picod & |\dekad| & \dekad & |\exad| & \exad \\
+% |\nanod| & \nanod & |\hectod| & \hectod & |\zettad| & \zettad \\
+% |\microd| & \microd & |\kilod| & \kilod & |\yottad| & \yottad \\
+% \end{tabular}
+% \end{table}
+% \subsubsection{Division or multiplication of SI units}
+% The next step is the formation of units based on division and/or multiplication of SI units.
+% \paragraph{Division}
+% How to get the unit of speed?
+% \begin{enumerate}
+% \item Write down the unit in words: |metre per second|
+% \item Replace the spaces with backlashes to get the command: |\metre\per\second|
+% \item The result is: `\metre\per\second'.
+% \end{enumerate}
+% Simple! Ready!
+% \paragraph{Multiplication}
+% Now an example of multiplication of units, the unit of torque (newton metre):
+% \begin{enumerate}
+% \item Write down the unit in words: |newton metre|
+% \item To get an separation character between the two units use the command \cmd{\usk} (unitskip): |\newton\usk\metre|
+% \item The result is: `\joenit{\newton.\metre}'. The spacing between the units depends on the spacing
+% options (see: page \pageref{sec:options}).
+% \end{enumerate}
+% \paragraph{Mixed case}
+% The mixed case should be simple now; the unit of thermal conductivity (watt per metre kelvin):
+% \begin{enumerate}
+% \item Use your just-learned-knowledge:|\watt\per\metre\usk\kelvin|
+% \item The result is: `\wattpermetrekelvin'.
+% \end{enumerate}
+% Now, you can do it all in one step! Intuitive \& simple.
+%
+% \subsubsection{Raising SI units to a power}
+% The \pkgname{SIunits}\ package provides a set of functions to get units raised to a particular power.
+% \paragraph{Squaring and cubing}
+% How to get the units of area (square metre) and volume (cubic metre)?
+% \begin{enumerate}
+% \item Write down the unit in words: |square metre| and |cubic metre|
+% \item Replace the spaces with backlashes to get the commands: |\square\metre| and |\cubic\metre|
+% \item The result is: ` \square\metre' and `\cubic\metre'.
+% \end{enumerate}
+% I can hear you say: ``We only use the word `square' before the unit metre, normally we place
+% the word `squared' behind the unit name.''. OK, lets try: |\second\squared| and
+% |\second\cubed| gives: `\second\squared' and `\second\cubed'.
+% Thus, no problem.
+% \paragraph{The reciprocal, reciprocal squaring and - cubing}
+% How to get negative powers?
+% \begin{enumerate}
+% \item Use |\rpsquare| or |\rpsquared|, and |\rpcubic| and |\rpcubed|
+% \item \Fe |\rpsquare\metre| and |\second\rpcubed|
+% \item The result is: ` \rpsquare\metre' and `\second\rpcubed'.
+% \end{enumerate}
+% Normally, we leave out the exponent \(1\), but sometimes we want to use the exponent \(-1\).
+% How to form the unit of frequency (reciprocal second = \hertz)
+% \begin{enumerate}
+% \item Write down the unit in words: |reciprocal second|,
+% \item Replace the spaces with backlashes to get the commands: |\reciprocal\second|,
+% \item The result is: `\reciprocal\second'.
+% \end{enumerate}
+% \paragraph{The power function}
+% The \cmd{\power} macro has been added to be able to form the wildest types of power raising:
+% |\power{10}{35}| gives: \power{10}{35}.
+%
+% \subsection{Quantities and units}
+% Use the command \cmd{\unit} to get consistent spacing between numerical quantities and units. Usage:\\
+% |\unit{120}{\kilo\meter\per\hour}| gives: \unit{120}{\kilo\meter\per\hour}.
+% \changes{v0.03 Beta 2}{1998/10/30}{documentation update}
+%
+% \subsubsection{Ready-to-use units}
+% {\begin{tabbing} \label{commands:prefab}
+% \changes{v0.05 Beta 1}{1999/02/01}{Inconsistencies in Ready-to-use units corrected}
+% \hspace{0.5cm}\= \textbf{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}\hspace{1cm} \= \textbf{xxxxx}\kill \+
+% \\ |\amperemetresecond| \> \amperemetresecond
+% \\ |\amperepermetre | \> \amperepermetre
+% \\ |\amperepermetrenp | \> \amperepermetrenp
+% \\ |\amperepersquaremetre| \> \amperepersquaremetre
+% \\ |\amperepersquaremetrenp| \> \amperepersquaremetrenp
+% \\ |\candelapersquaremetre | \> \candelapersquaremetre
+% \\ |\candelapersquaremetrenp | \> \candelapersquaremetrenp
+% \\ |\coulombpercubicmetre| \> \coulombpercubicmetre
+% \\ |\coulombpercubicmetrenp| \> \coulombpercubicmetrenp
+% \\ |\coulombperkilogram | \> \coulombperkilogram
+% \\ |\coulombperkilogramnp | \> \coulombperkilogramnp
+% \\ |\coulombpermol | \> \coulombpermol
+% \\ |\coulombpermolnp| \> \coulombpermolnp
+% \\ |\coulombpersquaremetre| \> \coulombpersquaremetre
+% \\ |\coulombpersquaremetrenp| \> \coulombpersquaremetrenp
+% \\ |\cubicmetre| \> \cubicmetre
+% \\ |\faradpermetre | \> \faradpermetre
+% \\ |\faradpermetrenp | \> \faradpermetrenp
+% \\ |\graypersecond| \> \graypersecond
+% \\ |\graypersecondnp| \> \graypersecondnp
+% \\ |\henrypermetre | \> \henrypermetre
+% \\ |\henrypermetrenp | \> \henrypermetrenp
+% \\ |\jouleperkelvin | \> \jouleperkelvin
+% \\ |\jouleperkelvinnp | \> \jouleperkelvinnp
+% \\ |\jouleperkilogram | \> \jouleperkilogram
+% \\ |\jouleperkilogramnp | \> \jouleperkilogramnp
+% \\ |\joulepermole|\> \joulepermole
+% \\ |\joulepermolenp|\> \joulepermolenp
+% \\ |\joulepermolekelvin | \> \joulepermolekelvin
+% \\ |\joulepermolekelvinnp | \> \joulepermolekelvinnp
+% \\ |\joulepersquaremetre | \> \joulepersquaremetre
+% \\ |\joulepersquaremetrenp | \> \joulepersquaremetrenp
+% \\ |\joulepertesla | \> \joulepertesla
+% \\ |\jouleperteslanp | \> \jouleperteslanp
+% \\ |\kilogrammetrepersecond | \> \kilogrammetrepersecond
+% \\ |\kilogrammetrepersecondnp | \> \kilogrammetrepersecondnp
+% \\ |\kilogrammetrepersquaresecond | \> \kilogrammetrepersquaresecond
+% \\ |\kilogrammetrepersquaresecondnp| \> \kilogrammetrepersquaresecondnp
+% \\ |\kilogrampercubicmetre| \> \kilogrampercubicmetre
+% \\ |\kilogrampercubicmetrenp| \> \kilogrampercubicmetrenp
+% \\ |\kilogramperkilomole | \> \kilogramperkilomole
+% \\ |\kilogramperkilomolenp| \> \kilogramperkilomolenp
+% \\ |\kilogrampermetre | \> \kilogrampermetre
+% \\ |\kilogrampermetrenp | \> \kilogrampermetrenp
+% \\ |\kilogrampersecond | \> \kilogrampersecond
+% \\ |\kilogrampersecondnp| \> \kilogrampersecondnp
+% \\ |\kilogrampersquaremetre | \> \kilogrampersquaremetre
+% \\ |\kilogrampersquaremetrenp| \> \kilogrampersquaremetrenp
+% \\ |\kilogrampersquaremetresecond | \> \kilogrampersquaremetresecond
+% \\ |\kilogrampersquaremetresecondnp| \> \kilogrampersquaremetresecondnp
+% \\ |\kilogramsquaremetre | \> \kilogramsquaremetre
+% \\ |\kilogramsquaremetrenp| \> \kilogramsquaremetrenp
+% \\ |\kilogramsquaremetrepersecond| \> \kilogramsquaremetrepersecond
+% \\ |\kilogramsquaremetrepersecondnp| \> \kilogramsquaremetrepersecondnp
+% \\ |\kilowatthour| \> \kilowatthour
+% \\ |\metrepersquaresecond| \>\metrepersquaresecond
+% \\ |\metrepersquaresecondnp| \>\metrepersquaresecondnp
+% \\ |\molepercubicmetre| \> \molepercubicmetre
+% \\ |\molepercubicmetrenp| \> \molepercubicmetrenp
+% \\ |\newtonpercubicmetre | \> \newtonpercubicmetre
+% \\ |\newtonpercubicmetrenp | \> \newtonpercubicmetrenp
+% \\ |\newtonperkilogram | \> \newtonperkilogram
+% \\ |\newtonperkilogramnp | \> \newtonperkilogramnp
+% \\ |\newtonpersquaremetre | \> \newtonpersquaremetre
+% \\ |\newtonpersquaremetrenp| \> \newtonpersquaremetrenp
+% \\ |\ohmmetre | \> \ohmmetre
+% \\ |\pascalsecond| \> \pascalsecond
+% \\ |\persquaremetresecond | \> \persquaremetresecond
+% \\ |\persquaremetresecondnp| \> \persquaremetresecondnp
+% \\ |\radianpersecond| \> \radianpersecond
+% \\ |\radianpersecondnp| \> \radianpersecondnp
+% \\ |\radianpersquaresecond| \> \radianpersquaresecond
+% \\ |\radianpersquaresecondnp| \> \radianpersquaresecondnp
+% \\ |\squaremetre| \> \squaremetre
+% \\ |\squaremetrepercubicmetre| \> \squaremetrepercubicmetre
+% \\ |\squaremetrepercubicmetrenp| \> \squaremetrepercubicmetrenp
+% \\ |\squaremetrepernewtonsecond| \> \squaremetrepernewtonsecond
+% \\ |\squaremetrepernewtonsecondnp| \> \squaremetrepernewtonsecondnp
+% \\ |\squaremetrepersecond | \> \squaremetrepersecond
+% \\ |\squaremetrepersecondnp | \> \squaremetrepersecondnp
+% \\ |\squaremetrepersquaresecond | \> \squaremetrepersquaresecond
+% \\ |\squaremetrepersquaresecondnp | \> \squaremetrepersquaresecondnp
+% \\ |\voltpermetre| \> \voltpermetre
+% \\ |\voltpermetrenp| \> \voltpermetrenp
+% \\ |\wattpercubicmetre | \> \wattpercubicmetre
+% \\ |\wattpercubicmetrenp| \> \wattpercubicmetrenp
+% \\ |\wattperkilogram| \> \wattperkilogram
+% \\ |\wattperkilogramnp| \> \wattperkilogramnp
+% \\ |\wattpersquaremetre | \> \wattpersquaremetre
+% \\ |\wattpersquaremetrenp | \> \wattpersquaremetrenp
+% \\ |\wattpersquaremetresteradian | \> \wattpersquaremetresteradian
+% \\ |\wattpersquaremetresteradiannp | \> \wattpersquaremetresteradiannp
+% \end{tabbing}}
+%
+% \section{How the package works}
+% \subsection{Compatibility}
+% The package has been tested using:
+% \begin{enumerate}
+% \item MiK\TeX\ 1.10\textit{b}, including \LaTeXe\ standard classes (\LaTeXe{} [1997/12/01] patch level 1)
+% and \TeX\ 3.14159, both under Microsoft Windows 95 and MS Windows NT 4.0.
+% \item MiK\TeX\ 1.11, including \LaTeXe\ standard classes (\LaTeXe{} [1998/06/01])
+% and \TeX\ 3.14159, both under Microsoft Windows 95 and MS Windows NT 4.0.
+% \item MiK\TeX\ 2 UP 1, including \LaTeXe\ standard classes (\LaTeXe{} [2000/11/28])
+% and \TeX\ 3.14159, under Microsoft Windows 2000 professional.
+% \end{enumerate}
+% \subsection{Known problems and limitations}
+% \begin{enumerate}
+% \item When you don't have the AMS font |eurm10| use the option \opt{noams}.
+% \item The amssymb package defines the |\square| command. Two possible solutions to avoid
+% conflicts:
+% \begin{itemize}
+% \item Use option \opt{amssymb}: |\usepackage[amssymb]{SIunits}|.
+% When using this option the amssymb command |\square| is redefined to the SIunits command.
+% \item Use option \opt{squaren}: |\usepackage[squaren]{SIunits}|.
+% When using this option the amssymb command |\square| is not redefined. Use the newly defined SIunits command
+% |\squaren| instead of |\square| to get the desired behaviour.
+% \end{itemize}
+% \textbf{Note: }Load \pkgname{SIunits}\ package after \texttt{amssymb} package.
+% \item The pstricks package defines the |\gray| command. Two possible solutions to avoid
+% conflicts:
+% \begin{itemize}
+% \item Use option \opt{pstricks}: |\usepackage[pstricks]{SIunits}|.
+% When using this option the pstricks command |\gray| is redefined to the SIunits command.
+% \item Use option \opt{Gray}: |\usepackage[Gray]{SIunits}|.
+% When using this option the pstricks command |\gray| is not redefined. Use the newly defined SIunits command
+% |\Gray| instead of |\gray| to get the desired behaviour.
+% \end{itemize}
+% \textbf{Note: }Load \pkgname{SIunits}\ package after \texttt{pstricks} package.
+% \end{enumerate}
+% No further known problems or limitations. That doesn't mean this package is bug free, but it
+% indicates the lack of testing that's been done on the package.
+%
+% \subsection{Sending a bug report}
+% Reports of new bugs in the package are most welcome.
+% However, I do \textbf{not} consider this to be a `supported'
+% package. This means that there is no guarantee I (or
+% anyone else) will put any effort into fixing the bug (of course I will try to find some time).
+% But, on the other hand, someone may try debugging, so filing a
+% bug report is always a good thing to do! (If nothing else,
+% your discoveries may end up in future releases of this
+% document.) Before filing a bug report, please take the
+% following actions:
+% \begin{enumerate}
+% \item Ensure your problem is not due to your input file;
+% \item Ensure your problem is not due to your own
+% package(s) or class(es);
+% \item Ensure your problem is not covered in the section ``Known
+% problems and limitations'' above;
+% \item Try to locate the problem by writing a minimal
+% \LaTeXe\ input file which reproduces the problem. Include the command\\
+% |\setcounter{errorcontextlines}{999}|\\ in your input;
+% \item Run your file through \LaTeXe;
+% \item Send a description of your problem, the input file and the
+% log file via e-mail to: \texttt{SIunits@webschool.nl}.
+% \end{enumerate}
+%
+% \section{In conclusion}
+% \subsection{Acknowledgements}
+% I want to thank \textsf{Werenfried Spit} (|w.spit@WITBO.NL|)
+% answering my question to |TEX-NL@NIC.SURFNET.NL| about the ``power functie'',
+% as well as \textsf{Hans Hagen} (|pragma@WXS.NL|) for
+% the kind reaction to that question.
+% \changes{v0.02 Final Release}{1998/10/09}{Acknowledgements updated}
+% \begin{labeling}{\hspace{12mm}}
+% \item[\opt{v0.01}: Typos]
+% J\"{u}rgen von Haegen (\texttt{vonHagen@engr.psu.edu})
+% \item[\opt{v0.02 Beta 1}: \cmd{\addunit} macro added]
+% Hint: Hans Bessem\\ (\texttt{j.m.bessem@wbmt.tudelft.nl})
+% \item[\opt{v0.02 Beta 4}: Typos]
+% Rafael Rodriguez Pappalardo (\texttt{rafapa@cica.es})
+% \item[\opt{v0.02 Beta 5}: Tips/non-SI units]
+% Timothy C. Burt\\ (\texttt{tcburt@comp.uark.edu})
+% \item[\opt{v0.02 Beta 7}: \cmd{\angstrom} definition changed]
+% Hint: Lutz Schwalowsky\\ (\texttt{schalow@mineralogie.uni-hamburg.de});
+% Solution: Piet van Oostrum (\texttt{piet@cs.uu.nl})
+% \item[\opt{v0.04}: \cmd{\ohm} definition corrected]
+% J\"{u}rgen von Haegen (\texttt{vonHagen@engr.psu.edu})
+% \item[\opt{v0.06}: Conflict with \texttt{amssymb} solved] thanks to
+% Timothy C. Burt\\ (\texttt{tcburt@comp.uark.edu})
+% \end{labeling}
+%
+% \subsection{References}
+% \begin{enumerate}
+% \item \textsf{National Institute of Standards and Technology Special Publication 330},\ \textit{The International System of Units (SI), 1991 Edition}, by Barry~N.~Taylor, 62 p.:
+% |http://physics.nist.gov/Document/sp330.pdf|
+% \item \textsf{National Institute of Standards and Technology Special Publication 811},\ \textit{Guide for the Use of the International System of Units (SI), 1995 Edition}, by Barry~N.~Taylor, 84 p.:
+% |http://physics.nist.gov/Document/sp811.pdf|
+% \item \textsf{National Institute of Standards and Technology},\ \textit{Diagram of SI unit relationships:}
+% |http://physics.nist.gov/cuu/Units/SIdiagram2.html|
+% \item \textsf{International Bureau of Weights and Measures (\textit{Bureau International des
+% Poids et Mesures})},\ \textit{SI brochure:}
+% |http://www.bipm.fr/pdf/si-brochure.pdf| and \textit{Supplement 2000:}
+% |http://www.bipm.fr/pdf/si-supplement2000.pdf|
+% \item \textsf{National Physical Laboratory},
+% \textit{The International System of Units:} \\ |http://www.npl.co.uk/npl/reference/si_units.html|
+% \item \textsf{National Institute of Standards and Technology}, \\
+% \textit{The NIST reference on Constants, Units and Uncertainty:} \\
+% |http://physics.nist.gov/cuu/Units/introduction.html|
+% \item \textsf{David Barlett},
+% \textit{The Metric System: a concise reference guide:} \\ |http://subnet.virtual-pc.com/ba424872/|
+% \end{enumerate}
+% \subsection{Bye}
+% I hope that some users will find the package
+% useful and not too bugful. :--) \\Comments and suggestions
+% for improvements are always most welcome!\\*[3mm]
+% {\itshape \LaTeX, enjoy it! \raisebox{-\baselineskip}[0pt][0pt]{marcel h.}}
+% \StopEventually{\vfill\hfill\scriptsize Copyright \copyright 2001 Marcel Heldoorn.
+% \vspace{1cm}
+%
+%
+% This program 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.}
+% \newpage
+% \section{The Magic Code}
+% \subsection{Hello world}
+% \iffalse
+%<*package>
+% \fi
+% First, we show the package message.
+% \begin{macrocode}
+\typeout{\packagemessage}
+% \end{macrocode}
+% \subsubsection{Declare globals}
+% Declare global |\newif|(s) and |\newlength|(s):\\
+% boolean for redefinition of |\square|
+% \begin{macrocode}
+\newif\if@redefsquare\@redefsquarefalse
+% \end{macrocode}
+% boolean for definition of |\squaren|
+% \begin{macrocode}
+\newif\if@defsquaren\@defsquarenfalse
+% \end{macrocode}
+% boolean for redefinition of |\gray|
+% \begin{macrocode}
+\newif\if@redefGray\@redefGrayfalse
+% \end{macrocode}
+% boolean for definition of |\Gray|
+% \begin{macrocode}
+\newif\if@defGray\@defGrayfalse
+% \end{macrocode}
+% boolean for detection of textstyle option
+% \begin{macrocode}
+\newif\if@textstyle\@textstylefalse
+% \end{macrocode}
+% boolean for detection of binary option
+% \begin{macrocode}
+\newif\if@optionbinary\@optionbinaryfalse
+% \end{macrocode}
+% boolean for detection of NoAMS option
+% \begin{macrocode}
+\newif\if@optionNoAMS\@optionNoAMSfalse
+% \end{macrocode}
+% boolean for detection of |\unit| command
+% \begin{macrocode}
+\newif\if@inunitcommand\@inunitcommandfalse
+\newlength{\@qskwidth}
+% \end{macrocode}
+% boolean for detection of italian option
+% \begin{macrocode}
+\newif\if@defitalian\@defitalianfalse
+% \end{macrocode}
+% \subsubsection{Font handling}
+% \changes{v0.99}{1999/07/23}{Font handling enhanced.}
+% When using the option \opt{textstyle} units are printed in the typeface of the
+% enclosing text, automatically.
+% \begin{macrocode}
+\DeclareRobustCommand\SI@fstyle[1]{\mathrm{#1}}
+% \end{macrocode}
+% \subsubsection{The text sensitive \protect\SImu}
+% Ripped form the |textcomp| package: the text sensitive --- but ugly --- \SImu\textbf{ \SImu}\textsf{\SImu}\textit{\SImu}.
+% \begin{macrocode}
+\DeclareTextSymbolDefault{\SImu}{TS1}
+\DeclareTextSymbol{\SImu}{TS1}{181} % micro sign
+\DeclareFontEncoding{TS1}{}{}
+\DeclareFontSubstitution{TS1}{cmr}{m}{n}
+% \end{macrocode}
+%
+% \subsubsection{The upright (roman) \ensuremath{\upmu}}
+% The next lines of code are necessary to get an beautifull upright (roman) \(\upmu\) (Greek `em').
+% \begin{macrocode}
+\DeclareFontFamily{OML}{eur}{\skewchar\font127} \DeclareFontShape{OML}{eur}{m}{n}{<5> <6>
+ <7> <8> <9> gen * eurm <10><10.95><12><14.4><17.28><20.74><24.88>eurm10}{}
+\DeclareSymbolFont{greek}{OML}{eur}{m}{n}
+% \end{macrocode}
+% \begin{macro}{\upmu}
+% \begin{macrocode}
+\DeclareMathSymbol{\upmu}{\mathord}{greek}{"16}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SIunits}
+% The |\SIunits| macro allows runtime option requests. Every argument of
+% the optional argument list is passed to the macro |\SIunits@execopt|.
+% The options \opt{thickspace \& thickqspace} is selected by default.
+%
+% \begin{macrocode}
+\newcommand*\SIunits[1][thickspace,thickqspace]{\@for\SIunits@@:=#1%
+ \do{\SIunits@execopt\SIunits@@}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SIunits@execopt}
+% Every execution of this macro with an argument \(n\) leads to the
+% execution of a macro |\SIunits@opt@|\(n\) or a warning if no such exists.
+%
+% \begin{macrocode}
+\newcommand*\SIunits@execopt[1]{\@ifundefined{SIunits@opt@#1}%
+ {\PackageWarning{SIunits}{Requested option `#1' not provided}}%
+ {\@nameuse{SIunits@opt@#1}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Runtime options to use with the \cs{SIunits} command}
+% \subsubsection{\opt{thickspace}}
+% \begin{macro}{\SIunits@opt@thickspace}
+% This macro provides a thick math space (|\;|) between units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@thickspace{%
+ \@thickspace{runtime option `thickspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{mediumspace}}
+% \begin{macro}{\SIunits@opt@mediumspace}
+% This macro provides a medium math space (|\:|) between units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@mediumspace{%
+ \@mediumspace{runtime option `mediumspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{thinspace}}
+% \begin{macro}{\SIunits@opt@thinspace}
+% This macro provides a thin math space (|\,|) between units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@thinspace{%
+ \@thinspace{runtime option `thinspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{cdot}}
+% \begin{macro}{\SIunits@opt@cdot}
+% This macro provides a |\cdot| (\(\cdot\)) between units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@cdot{%
+ \@cdot{runtime option `cdot' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{thickqspace}}
+% \begin{macro}{\SIunits@opt@thickqspace}
+% This macro provides a thick math space (|\;|) between quantities and units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@thickqspace{%
+ \@thickqspace{runtime option `thickqspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{mediumqspace}}
+% \begin{macro}{\SIunits@opt@mediumqspace}
+% This macro provides a medium math space (|\:|) between quantities and units.
+% \changes{v0.07 Beta 1}{1999/04/09}{mediumqspace option corrected}
+% \begin{macrocode}
+\newcommand*\SIunits@opt@mediumqspace{%
+ \@mediumqspace{runtime option `mediumqspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{\opt{thinqspace}}
+% \begin{macro}{\SIunits@opt@thinqspace}
+% This macro provides a thin math space (|\;|) between quantities and units.
+% \begin{macrocode}
+\newcommand*\SIunits@opt@thinqspace{%
+ \@thinqspace{runtime option `thinqspace' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsection{text}
+% \begin{macrocode}
+\DeclareRobustCommand{\@text}{%
+ \ifmmode\expandafter\@text@\else\expandafter\mbox\fi}
+\let\nfss@text\@text%
+\def\@text@#1{\mathchoice%
+ {\textdef@\displaystyle\f@size{#1}}%
+ {\textdef@\textstyle\tf@size{\firstchoice@false #1}}%
+ {\textdef@\textstyle\sf@size{\firstchoice@false #1}}%
+ {\textdef@\textstyle\ssf@size{\firstchoice@false #1}}%
+ \check@mathfonts}%
+\def\textdef@#1#2#3{\hbox{{%
+ \everymath{#1}%
+ \let\f@size#2\selectfont%
+ #3}}}%
+\newif\iffirstchoice@%
+\firstchoice@true%
+\def\stepcounter#1{%
+ \iffirstchoice@%
+ \addtocounter{#1}\@ne%
+ \begingroup \let\@elt\@stpelt \csname cl@#1\endcsname \endgroup
+ \fi%
+}%
+% \end{macrocode}
+%
+% \subsection{International needs}
+% To prevent international problems, one can use both |\meter| and |\metre| for the SI length
+% unit, and |\deka| and |\dekad| for the SI prefix commands |\deca| and |\decad|.
+% \begin{macro}{\meter}
+% \begin{macrocode}
+\DeclareRobustCommand*{\meter}{\metre}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\deka}
+% \begin{macrocode}
+\DeclareRobustCommand*{\deka}{\deca}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dekad}
+% \begin{macrocode}
+\DeclareRobustCommand*{\dekad}{\decad}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Personal needs}
+% \begin{macro}{\NoAMS}
+% The |\NoAMS| macro has to be added in the preamble, when you don't have the AMS font |eurm10|
+% \begin{macrocode}
+\DeclareRobustCommand*{\NoAMS}{\addprefix{\micro}{\mbox{\SImu}}}
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.03 Beta 2}{1998/10/30}{\cs{NoAMS} command added}
+% \begin{macro}{\addunit}
+% The |\addunit| and |\addprefix| macros give one the possibility to add units and prefixes. This possibility was added after a lot of
+% questions for support of non SI units, that can not be added to this package (it's called \textit{SI}units!). \\Usage:
+% |\addunit{\foot}{ft}|; then the unit can be used: |\unit{1}{\foot}| gives \unit{1}{ft}.
+% \changes{v0.02 Beta 1}{1998/09/09}{\cs{addunit} command added}
+% \begin{macrocode}
+\DeclareRobustCommand{\addunit}[2]{\newcommand{#1}{\ensuremath{\SI@fstyle{#2}}}}
+\DeclareRobustCommand{\addprefix}[2]{\newcommand{#1}{\ensuremath{\SI@fstyle{#2}}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\unitskip}
+% The |\unitskip| macro gives one the possibility to choose spacing characters that
+% are not already defined, by the spacing options (page \pageref{sec:options}). It also
+% gives the possibility to use various spacing character in your documents.
+% \begin{macrocode}
+\DeclareRobustCommand*{\unitskip}[1]{\renewcommand{\usk}{\ensuremath{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\quantityskip}
+% The |\quantityskip| macro gives one the possibility to choose spacing characters that
+% are not already defined, by the spacing options (page \pageref{sec:options}). It also
+% gives the possibility to use various spacing character in your documents.
+% \begin{macrocode}
+\DeclareRobustCommand*{\quantityskip}[1]{\renewcommand{\@qsk}{\ensuremath{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.03 Beta 2}{1998/10/30}{\cs{quantityskip} command added}
+% \subsection{Spacing units}
+% \changes{v0.03 Beta 2}{1998/10/30}{\cs{qsk} command added}
+% In version \fileversion\ of the \pkgname{SIunits}\ package, one has to do the spacing of units by hand. I have plans to get
+% some things automated in a future version. The |\per| macro gives |/| to be used in a quotient of two units; |\usk|
+% (\textbf{u}nit\textbf{sk}ip) makes a thick math space by default, but can be changed by the spacing options
+% (page \pageref{sec:options}) or the |\unitskip| command. Usage:\\ |\metre\per\second| (unit of speed) gives:
+% \(\mathrm{m/s}\) \\ |\newton\usk\metre| (unit of torque) gives: \(\joenit{\mathrm{N}.\mathrm{m}}\).\\
+% |\@qsk| (\textbf{q}uantity \textbf{sk}ip) makes a thick math space
+% by default, but can be changed by the options for spacing between quantity and unit
+% (page \pageref{sec:options}) or the |\quantityskip| command. |\@qsk| is used in the |\unit| macro.
+% \begin{macro}{\per}
+% \begin{macrocode}
+\DeclareRobustCommand*{\per}{\ensuremath{\SI@fstyle{/}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\usk}
+% \begin{macrocode}
+\DeclareRobustCommand*{\usk}{\ensuremath{\;}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@qsk}
+% \begin{macrocode}
+\DeclareRobustCommand*{\@qsk}{\ensuremath{\;}}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{(Re)define the spacing commands.}
+% \changes{v1.20}{2001/06/15}{Solved bug: Defining units using \cs{addunit} in combination with the \opt{cdot} and \opt{textstyle} options, by redefining the \cs{cdot} command. Thanks to Michael M\"{u}ller.}
+% \begin{macrocode}
+\renewcommand{\cdot}{\,\mbox{\textperiodcentered}\,}
+\newcommand{\@cdot}[1]{\DeclareRobustCommand*{\usk}{\ensuremath{\cdot}}\typeout{#1}}
+\newcommand{\@thickspace}[1]{\DeclareRobustCommand*{\usk}{\ensuremath{\;}}\typeout{#1}}
+\newcommand{\@mediumspace}[1]{\DeclareRobustCommand*{\usk}{\ensuremath{\:}}\typeout{#1}}
+\newcommand{\@thinspace}[1]{\DeclareRobustCommand*{\usk}{\ensuremath{\,}}\typeout{#1}}
+\newcommand{\@thickqspace}[1]{\DeclareRobustCommand*{\@qsk}{\ensuremath{\;}}\typeout{#1}}
+\newcommand{\@mediumqspace}[1]{\DeclareRobustCommand*{\@qsk}{\ensuremath{\:}}\typeout{#1}}
+\newcommand{\@thinqspace}[1]{\DeclareRobustCommand*{\@qsk}{\ensuremath{\,}}\typeout{#1}}
+% \end{macrocode}
+%
+% \subsection{Spacing between numerical quantities and unit}
+% \begin{macro}{\unit}
+% \changes{v0.99}{2000/02/21}{period in second argument of \cs{unit} automatically spaces the unit using \cs{usk}}
+% The \cmd{\unit} macro is used to typeset conjunction of a numerical quantity and a unit. Usage:
+% |\unit{120}{\kilo\meter\per\hour} = \unit{33.3}{\meter\per\second}| to get:
+% \unit{120}{\kilo\meter\per\hour} = \unit{33.3}{\meter\per\second}.
+% \changes{v0.05 Beta 1}{1999/02/02}{\cs{unit} command changed, thanks to Nancy Winfree}
+% \changes{v0.06 Beta 1}{1999/04/01}{\cs{unit} command changed back to v0.04 version, thanks to J\"{u}rgen von Hagen}
+% \changes{v1.23}{2001/07/21}{\cs{unit} command: parameter \#1 made math by \cs{ensuremath}}
+% \begin{macrocode}
+{\catcode`\.=13\gdef.{\usk}}
+\newcommand{\period@active}[1]{\begingroup\mathcode`\.="8000\ensuremath{#1}\endgroup}
+\DeclareRobustCommand{\unit}[2]{\@inunitcommandtrue%
+ \ensuremath{\SI@fstyle{#1\@qsk\period@active{#2}}}%
+ \@inunitcommandfalse}
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.03 Beta 3}{1998/11/04}{\cs{unit} command changed}
+% \changes{v0.03 Beta 2}{1998/10/30}{\cs{unit} command added}
+% The |\one| macro is defined to be used for quantities of dimension 1 such as mass fraction. Usage:
+% |\unit{10}{\kilo\gram\per\kilo\gram} = \unit{10}{\one}| to get:
+% \unit{10}{\kilo\gram\per\kilo\gram} = \unit{10}{\one}.
+% \begin{macro}{\one}
+% \begin{macrocode}
+\DeclareRobustCommand{\one}{\settowidth{\@qskwidth}{\@qsk}\hspace*{-\@qskwidth}}
+% \end{macrocode}
+% \end{macro}
+% |\no@qsk| is a negative |\hspace| of length |\@qskwidth| if |\if@inunitcommand| is true, else it does nothing.
+% \begin{macro}{\no@qsk}
+% \changes{v1.26}{2001/07/24}{\cs{no@qsk} command changed to get right behaviour with degree, minute, second}
+% \begin{macrocode}
+\DeclareRobustCommand{\no@qsk}{%
+ \if@inunitcommand%
+ \one%
+ \else%
+ \relax%
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.99}{1999/11/08}{\cs{one} command added}
+% \changes{v1.01}{2000/03/16}{exponent of \cs{power} command made textstyle sensitive}
+% \subsection{Power(full) macros}
+% \begin{macro}{\power}
+% The |\power|\footnotemark[1]\footnotetext{Thanks to Werenfried Spit --- (|w.spit@WITBO.NL|)} macro is used to typeset a superscript. Usage:
+% |\power{\metre}{2}| to get: m\(^{2}\)
+% \begin{macrocode}
+\DeclareRobustCommand{\power}[2]{\ensuremath{\SI@fstyle{#1}^{\SI@fstyle{#2}}}}
+% \end{macrocode}
+% \end{macro}
+% \changes{v0.06 Beta 2}{1999/04/06}{amssymb compatibility}
+% |\square| and |\squaren| are defined |\AtBeginDocument| to detect and prevent conflicts with
+% packages defining |\square|.
+% \begin{macro}{\square}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \if@redefsquare
+ \providecommand{\square}[1]{\power{#1}{2}}
+ \renewcommand{\square}[1]{\power{#1}{2}}
+ \typeout{Option `amssymb' provided! ^^J
+ Command \protect\square\space redefined by SIunits package!}
+ \typeout{}
+ \else
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\squaren}
+% \begin{macrocode}
+ \if@defsquaren
+ \providecommand{\squaren}[1]{\power{#1}{2}}
+ \renewcommand{\squaren}[1]{\power{#1}{2}}
+ \typeout{Option `squaren' provided! ^^J
+ Command \protect\squaren\space defined by SIunits package!}
+ \typeout{}
+ \else
+ \@ifundefined{square}{%
+ \newcommand*{\square}[1]{\power{#1}{2}}
+ }{%
+ \PackageError{SIunits}{%
+ The command \protect\square\space was already defined.\MessageBreak
+ Possibly due to the amssymb package}%
+ {Hint: use option `amssymb' or `squaren' with SIunits package.\MessageBreak
+ See SIunits.dvi or readme.txt section: Known problems and limitations.}
+ } %\ifundefined{square}
+ \fi %\if@defsquaren
+ \fi %\if@redefsquare
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\unita}
+% \begin{macrocode}
+ \if@defitalian
+ \PackageWarning{SIunits}{Option `italian' provided.\MessageBreak
+ Command \protect\unit\space defined by babel.\MessageBreak
+ Mind to use \protect\unita\space instead.}%
+ \DeclareRobustCommand{\unita}[2]{%
+ \@inunitcommandtrue%
+ \ensuremath{\SI@fstyle{#1\@qsk\period@active{#2}}}%
+ \@inunitcommandfalse%
+ }%
+ \fi%\if@defitalian
+} %\AtBeginDocument
+% \end{macrocode}
+% \changes{v1.30}{2002/08/01}{\cs{unita} added to resolve conflict with \texttt{babel} with \opt{italian} language option}
+% \end{macro}
+% \changes{v1.08}{2000/05/17}{amssymb compatibility improved}
+% \begin{macro}{\SI@square}
+% \changes{v1.29}{2002/07/12}{unwanted space removed (thanks to Svend Tollak Munkejord)}
+% This internal macro is used in the definitions of the ready-to-use units.
+% \begin{macrocode}
+\DeclareRobustCommand{\SI@square}[1]
+ {\if@defsquaren%
+ \squaren{#1}%
+ \else
+ \square{#1}%
+ \fi %\if@defsquaren
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\squared}
+% The above example can be realised in a more intuitive way: |\square\metre|: m\(^{2}\).
+% The same goes for |\cubic| \& |\fourth|: m\(^{3}\) \& m\(^{4}\).
+% \begin{macrocode}
+\DeclareRobustCommand*{\squared}{\ensuremath{^{\mathrm{2}}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\cubic}
+% \begin{macrocode}
+\DeclareRobustCommand*{\cubic}[1]{\power{#1}{3}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\cubed}
+% \begin{macrocode}
+\DeclareRobustCommand*{\cubed}{\ensuremath{^{\mathrm{3}}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fourth}
+% \begin{macrocode}
+\DeclareRobustCommand*{\fourth}[1]{\power{#1}{4}}
+% \end{macrocode}
+% \end{macro}
+% The macros |\reciprocal|, |\rpsquare|, |\rpsquared|, |\rpcubic|, |\rpcubed| and |\rpfourth| provide the reciprocal (negative power): e.\,g.
+% m\(^{-1}\), m\(^{-2}\), m\(^{-3}\) and m\(^{-4}\). |\rp| is a short form for |\reciprocal|.
+% \begin{macro}{\reciprocal}
+% \begin{macrocode}
+\DeclareRobustCommand*{\reciprocal}[1]{\power{#1}{-1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rp}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rp}{\reciprocal}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpsquare}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rpsquare}[1]{\power{#1}{-2}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpsquared}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rpsquared}{\ensuremath{^{\mathrm{-2}}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpcubic}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rpcubic}[1]{\power{#1}{-3}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpcubed}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rpcubed}{\ensuremath{^{\mathrm{-3}}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpfourth}
+% \begin{macrocode}
+\DeclareRobustCommand*{\rpfourth}[1]{\power{#1}{-4}}
+% \end{macrocode}
+% \end{macro}
+% \subsection{SI decimal \textit{prefixes}}
+% These prefixes may be used to construct decimal fractions or multiples of units. Two
+% different forms are provided, e.\,g. |\milli| and |\millid|.
+% \subsubsection{Symbols}
+% The first form gives the symbol of the prefix: |\milli\second|: ms;
+% \begin{macrocode}
+\addprefix{\yocto}{y}
+\addprefix{\zepto}{z}
+\addprefix{\atto}{a}
+\addprefix{\femto}{f}
+\addprefix{\pico}{p}
+\addprefix{\nano}{n}
+\AtBeginDocument{%
+\if@optionNoAMS%
+ \addprefix{\micro}{\mbox{\SImu}}%
+\else%
+ \addprefix{\micro}{\upmu}%
+ \fi%
+\if@textstyle%
+ \DeclareRobustCommand{\micro}{{\ensuremath{\@text{\SImu}}}}%
+\fi}
+\addprefix{\milli}{m}
+\addprefix{\centi}{c}
+\addprefix{\deci}{d}
+\addprefix{\deca}{da}
+\addprefix{\hecto}{h}
+\addprefix{\kilo}{k}
+\addprefix{\mega}{M}
+\addprefix{\giga}{G}
+\addprefix{\tera}{T}
+\addprefix{\peta}{P}
+\addprefix{\exa}{E}
+\addprefix{\zetta}{Z}
+\addprefix{\yotta}{Y}
+% \end{macrocode}
+% \subsubsection{Decimal form}
+% \begin{macro}{decimals}
+% The other form gives the \textbf{d}ecimal factor: |\kilod\usk\hertz|:
+% \(\joenit{\kilod.\hertz}\)
+% \begin{macrocode}
+\DeclareRobustCommand*{\yoctod}{\power{10}{-24}}
+\DeclareRobustCommand*{\zeptod}{\power{10}{-21}}
+\DeclareRobustCommand*{\attod}{\power{10}{-18}}
+\DeclareRobustCommand*{\femtod}{\power{10}{-15}}
+\DeclareRobustCommand*{\picod}{\power{10}{-12}}
+\DeclareRobustCommand*{\nanod}{\power{10}{-9}}
+\DeclareRobustCommand*{\microd}{\power{10}{-6}}
+\DeclareRobustCommand*{\millid}{\power{10}{-3}}
+\DeclareRobustCommand*{\centid}{\power{10}{-2}}
+\DeclareRobustCommand*{\decid}{\power{10}{-1}}
+\DeclareRobustCommand*{\decad}{\power{10}{1}}
+\DeclareRobustCommand*{\hectod}{\power{10}{2}}
+\DeclareRobustCommand*{\kilod}{\power{10}{3}}
+\DeclareRobustCommand*{\megad}{\power{10}{6}}
+\DeclareRobustCommand*{\gigad}{\power{10}{9}}
+\DeclareRobustCommand*{\terad}{\power{10}{12}}
+\DeclareRobustCommand*{\petad}{\power{10}{15}}
+\DeclareRobustCommand*{\exad}{\power{10}{18}}
+\DeclareRobustCommand*{\zettad}{\power{10}{21}}
+\DeclareRobustCommand*{\yottad}{\power{10}{24}}
+% \end{macrocode}
+% \subsubsection*{The SI exception}
+% In the SI, \textit{Base} units and \textit{Derived} units do not have
+% prefixes, except for the \textit{base} unit of mass: \textit{kilo}gram, not: gram. However,
+% the macro |\gram| provides the symbol of gram: \gram.
+% \begin{macro}{\gram}
+% \begin{macrocode}
+\addunit{\gram}{g}
+% \end{macrocode}
+% \end{macro}
+% \subsection{SI \textit{base} units}
+% \paragraph{length} metre --- \metre \\
+% Both |\metre| and |\meter| can be used.
+% \begin{macro}{\metre}
+% \begin{macrocode}
+\addunit{\metre}{m}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{mass} kilogram --- \kilogram
+% \begin{macro}{\kilogram}
+% \begin{macrocode}
+\addunit{\kilogram}{\kilo\gram}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{time} second --- \second
+% \begin{macro}{\second}
+% \begin{macrocode}
+\addunit{\second}{s}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{electric current} ampere --- \ampere
+% \begin{macro}{\ampere}
+% \begin{macrocode}
+\addunit{\ampere}{A}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{thermodynamic temperature} kelvin --- \kelvin
+% \begin{macro}{\kelvin}
+% \begin{macrocode}
+\addunit{\kelvin}{K}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{amount of substance} mole --- \mole
+% \begin{macro}{\mole}
+% \begin{macrocode}
+\addunit{\mole}{mol}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{luminous intensity} candela --- \candela
+% \begin{macro}{\candela}
+% \begin{macrocode}
+\addunit{\candela}{cd}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{SI \textit{derived} units}
+% \paragraph{plane angle} radian --- \radian
+% \begin{macro}{\radian}
+% \begin{macrocode}
+\addunit{\radian}{rad}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{solid angle} steradian --- \steradian
+% \begin{macro}{\steradian}
+% \begin{macrocode}
+\addunit{\steradian}{sr}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{frequency} hertz --- \hertz
+% \begin{macro}{\hertz}
+% \begin{macrocode}
+\addunit{\hertz}{Hz}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{force} newton --- \newton
+% \begin{macro}{\newton}
+% \begin{macrocode}
+\addunit{\newton}{N}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{pressure} pascal --- \pascal
+% \begin{macro}{\pascal}
+% \begin{macrocode}
+\addunit{\pascal}{Pa}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{energy, work, quantity of heat} joule --- \joule
+% \begin{macro}{\joule}
+% \begin{macrocode}
+\addunit{\joule}{J}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{power, radiant flux} watt --- \watt
+% \begin{macro}{\watt}
+% \begin{macrocode}
+\addunit{\watt}{W}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{electric charge, quantity of electricity} coulomb -- \coulomb
+% \begin{macro}{\coulomb}
+% \begin{macrocode}
+\addunit{\coulomb}{C}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{electrical potential, potential difference, electromotive force} volt --- \volt
+% \begin{macro}{\volt}
+% \begin{macrocode}
+\addunit{\volt}{V}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{capacitance} farad --- \farad
+% \begin{macro}{\farad}
+% \begin{macrocode}
+\addunit{\farad}{F}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{electrical resistance} ohm --- \ohm
+% \begin{macro}{\ohm}
+% \changes{v0.04}{1999/01/22}{\cs{ohm} definition changed (thanks to Juergen von Haegen)}
+% \begin{macrocode}
+\addunit{\ohm}{\ensuremath{\Omega}}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{electrical conductance} siemens --- \siemens
+% \begin{macro}{\siemens}
+% \begin{macrocode}
+\addunit{\siemens}{S}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{magnetic flux, magnetic field strength} weber --- \weber
+% \begin{macro}{\weber}
+% \begin{macrocode}
+\addunit{\weber}{Wb}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{magnetic flux density} tesla --- \tesla
+% \begin{macro}{\tesla}
+% \begin{macrocode}
+\addunit{\tesla}{T}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{inductance} henry --- \henry
+% \begin{macro}{\henry}
+% \begin{macrocode}
+\addunit{\henry}{H}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Celsius temperature} degree Celsius --- \degreecelsius \\ both
+% |\degreecelsius| and |\celsius| can be used.
+% \begin{macro}{\degreecelsius}
+% \begin{macrocode}
+\newcommand{\degreecelsius}{\protect\@inunitcommandfalse\ensuremath{\SI@fstyle{\degree\Celsius}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\celsius}
+% \begin{macrocode}
+\addunit{\celsius}{\degreecelsius}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{luminous flux} lumen --- \lumen
+% \begin{macro}{\lumen}
+% \begin{macrocode}
+\addunit{\lumen}{lm}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{illuminance} lux --- \lux
+% \begin{macro}{\lux}
+% \changes{v0.03 Beta 1}{1998/10/23}{\cs{lux} unit corrected: lx }
+% \begin{macrocode}
+\addunit{\lux}{lx}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{activity of a radionuclide} becquerel --- \becquerel
+% \begin{macro}{\becquerel}
+% \begin{macrocode}
+\addunit{\becquerel}{Bq}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{absorbed dose, specific energy imparted, kerma} gray --- \gray \\
+% |\gray| is defined |\AtBeginDocument|.
+% \begin{macro}{\gray}
+% \begin{macrocode}
+\AtBeginDocument{%
+\if@redefGray
+ \providecommand{\gray}{\ensuremath{\SI@fstyle{Gy}}}
+ \renewcommand{\gray}{\ensuremath{\SI@fstyle{Gy}}}
+ \typeout{Option `pstricks' provided! ^^J
+ Command \protect\gray\space redefined by SIunits package!}
+ \typeout{}
+ \else
+ \if@defGray
+ \providecommand{\Gray}{\ensuremath{\SI@fstyle{Gy}}}
+ \renewcommand{\Gray}{\ensuremath{\SI@fstyle{Gy}}}
+ \typeout{Option `Gray' provided! ^^J
+ Command \protect\Gray\space defined by SIunits package!}
+ \typeout{}
+ \else
+ \@ifundefined{gray}{%
+ \newcommand*{\gray}{\ensuremath{\SI@fstyle{Gy}}}
+ }{%
+ \PackageWarningNoLine{SIunits}{%
+ The command \protect\gray\space was already defined.\MessageBreak
+ Possibly due to the pstricks package}
+ \typeout{Hint: use option `pstricks' or `Gray' with SIunits package.}
+ \typeout{See SIunits.dvi or readme.txt section: Known problems and limitations.}
+ \typeout{}
+ } %\ifundefined{gray}
+ \fi %\if@defGray
+ \fi %\if@redefGray
+} %\AtBeginDocument
+% \changes{v0.99}{1999/09/06}{Conflict between pstricks and \cs{gray} solved}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{dose equivalent} sievert --- \sievert
+% \begin{macro}{\sievert}
+% \begin{macrocode}
+\addunit{\sievert}{Sv}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{catalytic activity} katal --- \katal
+% \begin{macro}{\katal}
+% \changes{v1.13}{2000/08/29}{unit katal with symbol \katal\ implemented}
+% \begin{macrocode}
+\addunit{\katal}{kat}
+% \end{macrocode}
+% \end{macro}
+
+% \subsubsection{The \opt{derivedinbase} mode}
+% \subsection*{Expression of derived SI units in SI base units}
+% \begin{macro}{\SIunits@opt@derivedinbase}
+% This macro provides the expression of derived SI units in SI base units.
+% These macros can be accessed by putting `base' behind the SI derived unit command,
+% e.\,g. (|\pascalbase|) to get `\pascalbase'.
+%
+% \begin{macrocode}
+\newcommand*\SIunits@opt@derivedinbase{%
+\typeout{Option 'derivedinbase' provided!^^J}
+\addunit{\radianbase}%
+ {\metre\usk\reciprocal\metre}
+\addunit{\steradianbase}%
+ {\squaremetre\usk\rpsquare\metre}
+\addunit{\hertzbase}%
+ {\reciprocal\second}
+\addunit{\newtonbase}%
+ {\metre\usk\kilogram\usk\second\rpsquared}
+\addunit{\pascalbase}%
+ {\reciprocal\metre\usk\kilogram\usk\second\rpsquared}
+\addunit{\joulebase}%
+ {\squaremetre\usk\kilogram\usk\second\rpsquared}
+\addunit{\wattbase}%
+ {\squaremetre\usk\kilogram\usk\rpcubic\second}
+\addunit{\coulombbase}%
+ {\ampere\usk\second}
+\addunit{\voltbase}%
+ {\squaremetre\usk\kilogram\usk\rpcubic\second\usk\reciprocal\ampere}
+\addunit{\faradbase}%
+ {\rpsquare\metre\usk\reciprocal\kilogram\usk\fourth\second\usk\ampere\squared}
+\addunit{\ohmbase}%
+ {\squaremetre\usk\kilogram\usk\rpcubic\second\usk\rpsquare\ampere}
+\addunit{\siemensbase}%
+ {\rpsquare\metre\usk\reciprocal\kilogram\usk\cubic\second\usk\ampere\squared}
+\addunit{\weberbase}%
+ {\squaremetre\usk\kilogram\usk\second\rpsquared\usk\reciprocal\ampere}
+\addunit{\teslabase}%
+ {\kilogram\usk\second\rpsquared\usk\reciprocal\ampere}
+\addunit{\henrybase}%
+ {\squaremetre\usk\kilogram\usk\second\rpsquared\usk\rpsquare\ampere}
+\addunit{\celsiusbase}%
+ {\kelvin}
+\addunit{\lumenbase}%
+ {\candela\usk\squaremetre\usk\rpsquare\metre}
+\addunit{\luxbase}%
+ {\candela\usk\squaremetre\usk\rpfourth\metre}
+\addunit{\becquerelbase}%
+ {\hertzbase}
+\addunit{\graybase}%
+ {\squaremetre\usk\second\rpsquared}
+\addunit{\sievertbase}%
+ {\graybase}
+\addunit{\katalbase}%
+ {\rp\second\usk\mole }
+}
+% \end{macrocode}
+% \end{macro}
+% \subsubsection{The \opt{derived} mode}
+% \subsection*{Expression of derived SI units in other derived SI units}
+% \begin{macro}{\SIunits@opt@derived}
+% This macro provides the expression of derived SI units in other SI derived units (if possible).
+% These macros can be accessed by putting `der' in front of the SI derived unit command,
+% e.\,g. (|\derpascal|) to get `\derpascal'.
+%
+% \begin{macrocode}
+\newcommand*\SIunits@opt@derived{%
+\addunit{\derradian}%
+ {\metre\usk\reciprocal\metre}
+\addunit{\dersteradian}%
+ {\squaremetre\usk\rpsquare\metre}
+\addunit{\derhertz}%
+ {\reciprocal\second}
+\addunit{\dernewton}%
+ {\metre\usk\kilogram\usk\second\rpsquared}
+\addunit{\derpascal}%
+ {\newton\usk\rpsquare\metre}
+\addunit{\derjoule}%
+ {\newton\usk\metre}
+\addunit{\derwatt}%
+ {\joule\usk\reciprocal\second}
+\addunit{\dercoulomb}%
+ {\ampere\usk\second}
+\addunit{\dervolt}%
+ {\watt\usk\reciprocal\ampere}
+\addunit{\derfarad}%
+ {\coulomb\usk\reciprocal\volt}
+\addunit{\derohm}%
+ {\volt\usk\reciprocal\ampere}
+\addunit{\dersiemens}%
+ {\ampere\usk\reciprocal\volt}
+\addunit{\derweber}%
+ {\squaremetre\usk\kilogram\usk\second\rpsquared\usk\reciprocal\ampere}
+\addunit{\dertesla}%
+ {\weber\usk\rpsquare\metre}
+\addunit{\derhenry}%
+ {\weber\usk\reciprocal\ampere}
+\addunit{\dercelsius}%
+ {\kelvin}
+\addunit{\derlumen}%
+ {\candela\usk\steradian}
+\addunit{\derlux}%
+ {\lumen\usk\rpsquare\metre}
+\addunit{\derbecquerel}%
+ {\derhertz}
+\addunit{\dergray}%
+ {\joule\usk\reciprocal\kilogram}
+\addunit{\dersievert}%
+ {\dergray}
+\addunit{\derkatal}%
+ {\katalbase}
+ \typeout{Option `derived' provided!}}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Units that are used with the SI}
+% \paragraph{Time} minute --- \minute; hour --- \hour; day --- \dday \\ |\day| was already defined, so use |\dday|.
+% \begin{macro}{\minute}
+% \begin{macrocode}
+\addunit{\minute}{min}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hour}
+% \begin{macrocode}
+\addunit{\hour}{h}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dday}
+% \begin{macrocode}
+\addunit{\dday}{d}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Plane angle} degree --- \degree; minute --- \paminute; second --- \arcsecond \\ |\minute| and |\second| were already defined.
+% \begin{macro}{\degree}
+% \changes{v0.99}{1999/11/05}{\cs{arcsecond} and \cs{arcminute} added.}
+% \begin{macrocode}
+\addunit{\degree}{\no@qsk\ensuremath{^{\circ}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\paminute}
+% \begin{macrocode}
+\addunit{\paminute}{\no@qsk\ensuremath{'}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\arcminute}
+% \begin{macrocode}
+\addunit{\arcminute}{\no@qsk\ensuremath{'}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\pasecond}
+% \begin{macrocode}
+\addunit{\pasecond}{\no@qsk\ensuremath{''}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\arcsecond}
+% \begin{macrocode}
+\addunit{\arcsecond}{\no@qsk\ensuremath{''}}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Mass} metric ton or tonne --- \ton
+% \begin{macro}{\ton}
+% \begin{macrocode}
+\addunit{\ton}{t}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tonne}
+% \begin{macrocode}
+\addunit{\tonne}{t}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Volume} litre --- \litre; liter --- \liter
+% \begin{macro}{\liter}
+% \begin{macrocode}
+\addunit{\liter}{L}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\litre}
+% \begin{macrocode}
+\addunit{\litre}{l}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\neper}
+% \begin{macrocode}
+\addunit{\neper}{Np}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bel}
+% \begin{macrocode}
+\addunit{\bel}{B}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Radioactivity} curie --- \curie
+% \begin{macro}{\curie}
+% \begin{macrocode}
+\addunit{\curie}{Ci}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Absorbed dose} rad --- \rad \\ When there is risk of confusion with the symbol for radian (\radian), \arad\ may be used as the symbol for rad.
+% \begin{macro}{\rad}
+% \begin{macrocode}
+\addunit{\rad}{rad}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\arad}
+% \begin{macrocode}
+\addunit{\arad}{rd}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Dose equivalent} rem --- \rem
+% \begin{macro}{\rem}
+% \begin{macrocode}
+\addunit{\rem}{rem}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Exposure roentgen} roentgen--- \roentgen
+% \begin{macro}{\roentgen}
+% \begin{macrocode}
+\addunit{\roentgen}{R}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Energy} electronvolt --- \electronvolt
+% \begin{macro}{\electronvolt}
+% \begin{macrocode}
+\addunit{\electronvolt}{e\volt}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Unified atomic mass unit} atomic mass --- \atomicmass
+% \begin{macro}{\atomicmass}
+% \begin{macrocode}
+\addunit{\atomicmass}{u}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Area} are --- \are; hectare --- \hectare; barn --- \barn
+% \begin{macro}{\are}
+% \begin{macrocode}
+\addunit{\are}{a}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\hectare}
+% \begin{macrocode}
+\addunit{\hectare}{\hecto\are}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\barn}
+% \begin{macrocode}
+\addunit{\barn}{b}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Pressure} bar --- \bbar
+% \begin{macro}{\bbar}
+% \begin{macrocode}
+\addunit{\bbar}{bar}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Acceleration} gal --- \gal
+% \begin{macro}{\gal}
+% \begin{macrocode}
+\addunit{\gal}{Gal}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Length} \aa ngstr\"{o}m --- \angstrom
+% \changes{v0.02 Beta 7}{1998/10/01}{\cs{angstrom} changed; thanks to Lutz Schwalowsky}
+% \begin{macro}{\angstrom}
+% \begin{macrocode}
+\addunit{\angstrom}{\mbox{{\AA}}}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Rotational frequency} revolutions per minute --- \rperminute; revolutions per second --- \rpersecond
+% \begin{macro}{\rperminute}
+% \begin{macrocode}
+\addunit{\rperminute}{r\per\minute}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rpersecond}
+% \begin{macrocode}
+\addunit{\rpersecond}{r\per\second}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{SI units with compound names}
+% \paragraph{Area} square metre --- \squaremetre
+% \begin{macro}{\squaremetre}
+% \begin{macrocode}
+\addunit{\squaremetre}{\SI@square\metre}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{Volume} cubic metre --- \cubicmetre
+% \begin{macro}{\cubicmetre}
+% \begin{macrocode}
+\addunit{\cubicmetre}{\cubic\metre}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Various ready-to-use units}
+% These units are provided for the ease of the users of the \pkgname{SIunits}\ package. Normally, two
+% forms of the units are provided, e.\,g. |\graypersecond| and |\graypersecondnp|. The
+% |command|\textsf{np} form uses negative powers instead of /: `\graypersecond' and
+% `\graypersecondnp'.\\
+% \changes{v0.02 Beta 3}{1998/09/11}{\cs{pH} command removed (not in SI)}
+% \paragraph{absorbed dose rate}
+% \begin{macrocode}
+\addunit{\graypersecond}{\gray\per\second}
+\addunit{\graypersecondnp}{\gray\usk\reciprocal\second}
+% \end{macrocode}
+% \end{macro}
+% \paragraph{acceleration}
+% \begin{macrocode}
+\addunit{\metrepersquaresecond}{\metre\per\second\squared}
+\addunit{\metrepersquaresecondnp}{\metre\usk\second\rpsquared}
+% \end{macrocode}
+% \paragraph{activation energy, molar energy}
+% \begin{macrocode}
+\addunit{\joulepermole}{\joule\per\mole}
+\addunit{\joulepermolenp}{\joule\usk\reciprocal\mole}
+% \end{macrocode}
+% \paragraph{amount-of-substance concentration}
+% \begin{macrocode}
+\addunit{\molepercubicmetre}{\mole\per\cubic\metre}
+\addunit{\molepercubicmetrenp}{\mole\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{angular acceleration}
+% \begin{macrocode}
+\addunit{\radianpersquaresecond}{\radian\per\second\squared}
+\addunit{\radianpersquaresecondnp}{\radian\usk\second\rpsquared}
+% \end{macrocode}
+% \paragraph{angular momentum}
+% \begin{macrocode}
+\addunit{\kilogramsquaremetrepersecond}{\kilogram\usk\squaremetre\per\second}
+\addunit{\kilogramsquaremetrepersecondnp}{\kilogram\usk\squaremetre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{angular velocity}
+% \begin{macrocode}
+\addunit{\radianpersecond}{\radian\per\second}
+\addunit{\radianpersecondnp}{\radian\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{area per unit volume}
+% \begin{macrocode}
+\addunit{\squaremetrepercubicmetre}{\squaremetre\per\cubic\metre}
+\addunit{\squaremetrepercubicmetrenp}{\squaremetre\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{catalytic (activity) concentration}
+% \changes{v1.13}{2000/08/29}{catalytic concentration added}
+% \begin{macrocode}
+\addunit{\katalpercubicmetre}{\katal\per\cubic\metre}
+\addunit{\katalpercubicmetrenp}{\katal\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{charge per mole}
+% \begin{macrocode}
+\addunit{\coulombpermol}{\coulomb\per\mole}
+\addunit{\coulombpermolnp}{\coulomb\usk\reciprocal\mole}
+% \end{macrocode}
+% \paragraph{current density}
+% \begin{macrocode}
+\addunit{\amperepersquaremetre}{\ampere\per\squaremetre}
+\addunit{\amperepersquaremetrenp}{\ampere\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{density}
+% \begin{macrocode}
+\addunit{\kilogrampercubicmetre}{\kilogram\per\cubic\metre}
+\addunit{\kilogrampercubicmetrenp}{\kilogram\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{dynamic fluidity (1/viscosity)}
+% \begin{macrocode}
+\addunit{\squaremetrepernewtonsecond}{\squaremetre\per\newton\usk\second}
+\addunit{\squaremetrepernewtonsecondnp}{\squaremetre\usk\reciprocal\newton\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{dynamic viscosity}
+% \begin{macrocode}
+\addunit{\pascalsecond}{\pascal\usk\second}
+% \end{macrocode}
+% \paragraph{electric charge density}
+% \begin{macrocode}
+\addunit{\coulombpercubicmetre}{\coulomb\per\cubic\metre}
+\addunit{\coulombpercubicmetrenp}{\coulomb\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{electric dipole moment}
+% \begin{macrocode}
+\addunit{\amperemetresecond}{\ampere\usk\metre\usk\second}
+% \end{macrocode}
+% \paragraph{electric field strength}
+% \begin{macrocode}
+\addunit{\voltpermetre}{\volt\per\metre}
+\addunit{\voltpermetrenp}{\volt\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{electric flux density}
+% \begin{macrocode}
+\addunit{\coulombpersquaremetre}{\coulomb\per\squaremetre}
+\addunit{\coulombpersquaremetrenp}{\coulomb\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{electrical permittivity}
+% \begin{macrocode}
+\addunit{\faradpermetre}{\farad\per\metre}
+\addunit{\faradpermetrenp}{\farad\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{electrical resistivity}
+% \begin{macrocode}
+\addunit{\ohmmetre}{\ohm\usk\metre}
+% \end{macrocode}
+% \paragraph{energy}
+% \begin{macrocode}
+\addunit{\kilowatthour}{\kilo\watt\hour}
+% \end{macrocode}
+% \paragraph{energy flux}
+% \begin{macrocode}
+\addunit{\wattpersquaremetre}{\watt\per\squaremetre}
+\addunit{\wattpersquaremetrenp}{\watt\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{energy per unit area}
+% \begin{macrocode}
+\addunit{\joulepersquaremetre}{\joule\per\squaremetre}
+\addunit{\joulepersquaremetrenp}{\joule\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{force (body)}
+% \begin{macrocode}
+\addunit{\newtonpercubicmetre}{\newton\per\cubic\metre}
+\addunit{\newtonpercubicmetrenp}{\newton\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{force per unit mass}
+% \begin{macrocode}
+\addunit{\newtonperkilogram}{\newton\per\kilogram}
+\addunit{\newtonperkilogramnp}{\newton\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{heat capacity, entropy}
+% \begin{macrocode}
+\addunit{\jouleperkelvin}{\joule\per\kelvin}
+\addunit{\jouleperkelvinnp}{\joule\usk\reciprocal\kelvin}
+% \end{macrocode}
+% \paragraph{heat of combustion, fusion or vaporisation}
+% \begin{macrocode}
+\addunit{\jouleperkilogram}{\joule\per\kilogram}
+\addunit{\jouleperkilogramnp}{\joule\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{intensity of ionising radiation}
+% \begin{macrocode}
+\addunit{\coulombperkilogram}{\coulomb\per\kilogram}
+\addunit{\coulombperkilogramnp}{\coulomb\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{kinematic viscosity}
+% \begin{macrocode}
+\addunit{\squaremetrepersecond}{\squaremetre\per\second}
+\addunit{\squaremetrepersecondnp}{\squaremetre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{kinematic energy of turbulence}
+% \begin{macrocode}
+\addunit{\squaremetrepersquaresecond}{\squaremetre\per\second\squared}
+\addunit{\squaremetrepersquaresecondnp}{\squaremetre\usk\second\rpsquared}
+% \end{macrocode}
+% \paragraph{linear momentum}
+% \begin{macrocode}
+\addunit{\kilogrammetrepersecond}{\kilogram\usk\metre\per\second}
+\addunit{\kilogrammetrepersecondnp}{\kilogram\usk\metre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{luminance}
+% \begin{macrocode}
+\addunit{\candelapersquaremetre}{\candela\per\squaremetre}
+\addunit{\candelapersquaremetrenp}{\candela\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{magnetic field strength}
+% \begin{macrocode}
+\addunit{\amperepermetre}{\ampere\per\metre}
+\addunit{\amperepermetrenp}{\ampere\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{magnetic moment}
+% \begin{macrocode}
+\addunit{\joulepertesla}{\joule\per\tesla}
+\addunit{\jouleperteslanp}{\joule\usk\reciprocal\tesla}
+% \end{macrocode}
+% \paragraph{magnetic permeability}
+% \begin{macrocode}
+\addunit{\henrypermetre}{\henry\per\metre}
+\addunit{\henrypermetrenp}{\henry\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{mass flow rate}
+% \begin{macrocode}
+\addunit{\kilogrampersecond}{\kilogram\per\second}
+\addunit{\kilogrampersecondnp}{\kilogram\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{mass flux}
+% \begin{macrocode}
+\addunit{\kilogrampersquaremetresecond}{\kilogram\per\squaremetre\usk\second}
+\addunit{\kilogrampersquaremetresecondnp}{\kilogram\usk\rpsquare\metre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{mass per unit area}
+% \begin{macrocode}
+\addunit{\kilogrampersquaremetre}{\kilogram\per\squaremetre}
+\addunit{\kilogrampersquaremetrenp}{\kilogram\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{mass per unit length}
+% \begin{macrocode}
+\addunit{\kilogrampermetre}{\kilogram\per\metre}
+\addunit{\kilogrampermetrenp}{\kilogram\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{molar heat capacity, molar entropy}
+% \begin{macrocode}
+\addunit{\joulepermolekelvin}{\joule\per\mole\usk\kelvin}
+\addunit{\joulepermolekelvinnp}{\joule\usk\reciprocal\mole\usk\reciprocal\kelvin}
+% \end{macrocode}
+% \paragraph{molecular weight}
+% \begin{macrocode}
+\addunit{\kilogramperkilomole}{\kilogram\per\kilo\mole}
+\addunit{\kilogramperkilomolenp}{\kilogram\usk\kilo\reciprocal\mole}
+% \end{macrocode}
+% \paragraph{moment of inertia}
+% \begin{macrocode}
+\addunit{\kilogramsquaremetre}{\kilogram\usk\squaremetre}
+\addunit{\kilogramsquaremetrenp}{\kilogramsquaremetre}
+% \end{macrocode}
+% \paragraph{momentum flow rate}
+% \begin{macrocode}
+\addunit{\kilogrammetrepersquaresecond}{\kilogram\usk\metre\per\second\squared}
+\addunit{\kilogrammetrepersquaresecondnp}{\kilogram\usk\metre\usk\second\rpsquared}
+% \end{macrocode}
+% \paragraph{momentum flux}
+% \begin{macrocode}
+\addunit{\newtonpersquaremetre}{\newton\per\squaremetre}
+\addunit{\newtonpersquaremetrenp}{\newton\usk\rpsquare\metre}
+% \end{macrocode}
+% \paragraph{photon emission rate}
+% \begin{macrocode}
+\addunit{\persquaremetresecond}{1\per\squaremetre\usk\second}
+\addunit{\persquaremetresecondnp}{\rpsquare\metre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{power per unit mass}
+% \begin{macrocode}
+\addunit{\wattperkilogram}{\watt\per\kilogram}
+\addunit{\wattperkilogramnp}{\watt\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{power per unit volume}
+% \begin{macrocode}
+\addunit{\wattpercubicmetre}{\watt\per\cubic\metre}
+\addunit{\wattpercubicmetrenp}{\watt\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{radiance}
+% \begin{macrocode}
+\addunit{\wattpersquaremetresteradian}{\watt\per\squaremetre\usk\steradian}
+\addunit{\wattpersquaremetresteradiannp}{\watt\usk\rpsquare\metre\usk\rp\steradian}
+% \end{macrocode}
+% \paragraph{specific heat capacity}
+% \begin{macrocode}
+\addunit{\jouleperkilogramkelvin}{\joule\per\kilogram\usk\kelvin}
+\addunit{\jouleperkilogramkelvinnp}{\joule\usk\reciprocal\kilogram\usk\reciprocal\kelvin}
+% \end{macrocode}
+% \paragraph{specific surface}
+% \begin{macrocode}
+\addunit{\squaremetreperkilogram}{\squaremetre\per\kilogram}
+\addunit{\rpsquaremetreperkilogram}{\squaremetre\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{specific volume}
+% \begin{macrocode}
+\addunit{\cubicmetreperkilogram}{\cubic\metre\per\kilogram}
+\addunit{\rpcubicmetreperkilogram}{\cubic\metre\usk\reciprocal\kilogram}
+% \end{macrocode}
+% \paragraph{surface tension}
+% \begin{macrocode}
+\addunit{\newtonpermetre}{\newton\per\metre}
+\addunit{\newtonpermetrenp}{\newton\usk\reciprocal\metre}
+% \end{macrocode}
+% \paragraph{derived SI unit: \degreecelsius}
+% \begin{macrocode}
+\addunit{\Celsius}{\ensuremath{\SI@fstyle{C}}}
+% \end{macrocode}
+% \paragraph{thermal conductivity}
+% \begin{macrocode}
+\addunit{\wattpermetrekelvin}{\watt\per\metre\usk\kelvin}
+\addunit{\wattpermetrekelvinnp}{\watt\usk\reciprocal\metre\usk\reciprocal\kelvin}
+% \end{macrocode}
+% \paragraph{torque}
+% \begin{macrocode}
+\addunit{\newtonmetre}{\newton\usk\metre} \addunit{\newtonmetrenp}{\newtonmetre}
+% \end{macrocode}
+% \paragraph{turbulence energy dissipation rate}
+% \begin{macrocode}
+\addunit{\squaremetrepercubicsecond}{\squaremetre\per\cubic\second}
+\addunit{\squaremetrepercubicsecondnp}{\squaremetre\usk\rpcubic\second}
+% \end{macrocode}
+% \paragraph{velocity}
+% \begin{macrocode}
+\addunit{\metrepersecond}{\metre\per\second}
+\addunit{\metrepersecondnp}{\metre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{volumetric calorific value}
+% \begin{macrocode}
+\addunit{\joulepercubicmetre}{\joule\per\cubicmetre}
+\addunit{\joulepercubicmetrenp}{\joule\usk\rpcubic\metre}
+% \end{macrocode}
+% \paragraph{volumetric coefficient of expansion}
+% \begin{macrocode}
+\addunit{\kilogrampercubicmetrecoulomb}{\kilogram\per\cubic\metre\usk\coulomb}
+\addunit{\kilogrampercubicmetrecoulombnp}{\kilogram\usk\rpcubic\metre\usk\reciprocal\coulomb}
+% \end{macrocode}
+% \paragraph{volumetric flow rate}
+% \begin{macrocode}
+\addunit{\cubicmetrepersecond}{\cubicmetre\per\second}
+\addunit{\rpcubicmetrepersecond}{\cubicmetre\usk\reciprocal\second}
+% \end{macrocode}
+% \paragraph{volumetric mass flow rate}
+% \begin{macrocode}
+\addunit{\kilogrampersecondcubicmetre}{\kilogram\per\second\usk\cubicmetre}
+\addunit{\kilogrampersecondcubicmetrenp}{\kilogram\usk\reciprocal\second\usk\rpcubic\metre}
+% \end{macrocode}
+% \subsection{Option handling}
+% \changes{v0.99}{1999/07/23}{LaTeX2e option handling implemented.}
+% \DescribeMacro{Options}
+% \subsubsection{\opt{cdot} option}
+% \begin{macrocode}
+\DeclareOption{cdot}{\@cdot{Option `cdot' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{thickspace} option}
+% \begin{macrocode}
+\DeclareOption{thickspace}{\@thickspace{Option `thickspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{mediumspace} option}
+% \begin{macrocode}
+\DeclareOption{mediumspace}{\@mediumspace{Option `mediumspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{thinspace} option}
+% \begin{macrocode}
+\DeclareOption{thinspace}{\@thinspace{Option `thinspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{thickqspace} option}
+% \begin{macrocode}
+\DeclareOption{thickqspace}{\@thickqspace{Option `thickqspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{mediumqspace} option}
+% \begin{macrocode}
+\DeclareOption{mediumqspace}{\@mediumqspace{Option `mediumqspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{thinqspace} option}
+% \begin{macrocode}
+\DeclareOption{thinqspace}{\@thinqspace{Option `thinqspace' provided!}}
+% \end{macrocode}
+% \subsubsection{\opt{textstyle} option}
+% Typeset units in text style.
+% \begin{macrocode}
+\DeclareOption{textstyle}{\renewcommand\SI@fstyle[1]{\@text{\protect#1}}%
+\@textstyletrue%
+\typeout{Option `textstyle' provided!}}
+% \end{macrocode}
+% \subsection{compatibility options}
+% \begin{macrocode}
+\DeclareOption{amssymb}{\@redefsquaretrue%
+\typeout{Option `amssymb' provided!}}
+\DeclareOption{squaren}{\@defsquarentrue%
+\typeout{Option `squaren' provided!}}
+\DeclareOption{pstricks}{\@redefGraytrue%
+\typeout{Option `pstricks' provided!}}
+\DeclareOption{Gray}{\@defGraytrue%
+\typeout{Option `Gray' provided!}}
+\DeclareOption{italian}{\@defitaliantrue%
+\typeout{Option `italian' provided!}}
+% \end{macrocode}
+% \changes{v1.30}{2002/08/01}{option \opt{italian} added}
+% \subsection{Miscellaneous options}
+% \begin{macrocode}
+\DeclareOption{binary}{\@optionbinarytrue }
+\AtEndOfPackage{\if@optionbinary\RequirePackage{binary}\fi}
+\DeclareOption{derivedinbase}{\SIunits@opt@derivedinbase}
+\DeclareOption{derived}{\SIunits@opt@derived}
+\DeclareOption{noams}{\@optionNoAMStrue%
+\typeout{Option `noams' provided!}}
+% \end{macrocode}
+% \subsection{Unknown options}
+% \begin{macrocode}
+\DeclareOption*{\PackageWarningNoLine{SIunits}{What is `\CurrentOption'?}}
+% \end{macrocode}
+% \subsection{The \pkgname{SIunits}\texttt{.cfg} file}
+% Load the |SIunits.cfg| file.
+% \changes{v0.03 Beta 5}{1998/12/11}{Load optional configuration file `SIunits.cfg'}
+% \begin{macrocode}
+\InputIfFileExists{SIunits.cfg}{}%
+{\PackageWarningNoLine{SIunits}{You have no `SIunits.cfg' file installed.
+\MessageBreak I will assume you are using `thickspace' and `thickqspace'}
+\ExecuteOptions{thickspace,thickqspace}}
+\ProcessOptions\relax
+%</package>
+% \end{macrocode}
+% \section{The \texttt{binary.sty} style for binary prefixes and (non-SI) units}
+% \begin{macrocode}
+%<*binary>
+\AtBeginDocument{%
+\addprefix{\kibi}{Ki} \newcommand{\kibid}{\power{2}{10}}
+\addprefix{\mebi}{Mi} \newcommand{\mebid}{\power{2}{20}}
+\addprefix{\gibi}{Gi} \newcommand{\gibid}{\power{2}{30}}
+\addprefix{\tebi}{Ti} \newcommand{\tebid}{\power{2}{40}}
+\addprefix{\pebi}{Pi} \newcommand{\pebid}{\power{2}{50}}
+\addprefix{\exbi}{Ei} \newcommand{\exbid}{\power{2}{60}}
+
+\addunit{\bit}{bit}
+\addunit{\byte}{B}%
+} %\AtBeginDocument
+%</binary>
+% \end{macrocode}
+% \changes{v1.13}{2000/08/29}{Index and change history generation error fixed}
+% \changes{v1.29}{2002/08/01}{Index and change history generation errors fixed}
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/SIunits/SIunits.ins b/Master/texmf-dist/source/latex/SIunits/SIunits.ins
new file mode 100644
index 00000000000..f76ae845c76
--- /dev/null
+++ b/Master/texmf-dist/source/latex/SIunits/SIunits.ins
@@ -0,0 +1,70 @@
+%% LaTeX2e file `SIunits.ins'
+%% generated by the `filecontents' environment
+%% from source `SIunits' on 2002/08/01.
+%%
+%%
+%% SIunits.ins will generate the fast loadable files SIunits.sty and
+%% binary.sty, the documentation driver SIunits.drv and the configura-
+%% tion file SIunits.cfg from the package file SIunits.dtx when run
+%% through LaTeX or TeX.
+%%
+%% Copyright (C) 2001 Marcel Heldoorn
+%%
+%% This program 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.
+%%
+%% NOTE:
+%% The LPPL about .ins files:
+%% - Files with extension `.ins' (installation files): these files may
+%% not be modified at all because they contain the legal notices
+%% that are placed in the generated files.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{SIunits.ins}
+\input docstrip.tex
+\keepsilent
+\preamble
+
+Copyright (c) 1998-2002 Marcel Heldoorn <m.heldoorn@webschool.nl>.
+
+This program 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.
+
+For error reports in case of UNCHANGED versions see the readme.txt file.
+
+Please do not request updates from me directly. Distribution is done through the
+Comprehensive TeX Archive Network (CTAN).
+
+\endpreamble
+\postamble
+
+ Source: $Id: SIunits.dtx,v 1.33 2002/08/01 11:20:00 root Exp root $
+\endpostamble
+\generate{\file{SIunits.sty}{\from{SIunits.dtx}{package}}}
+\generate{\file{binary.sty}{\from{SIunits.dtx}{binary}}}
+\nopreamble
+\generate{\file{SIunits.cfg}{\from{SIunits.dtx}{config}}}
+\generate{\file{SIunits.drv}{\from{SIunits.dtx}{driver}}}
+ \Msg{************************************************************}
+ \Msg{}
+ \Msg{ To finish the installation you have to move the file}
+ \Msg{ `SIunits.sty' (and optionally the file `SIunits.cfg')}
+ \Msg{ into a directory searched by LaTeX.}
+ \Msg{}
+ \Msg{ To type-set the documentation, run the file `SIunits.drv'}
+ \Msg{ through LaTeX.}
+ \Msg{ Process SIunits.idx file by:}
+ \Msg{ \space\space\space\space makeindex -s gind.ist SIunits}
+ \Msg{ Process SIunits.glo file by:}
+ \Msg{ \space\space\space\space makeindex -s gglo.ist -o SIunits.gls SIunits.glo}
+ \Msg{}
+ \Msg{************************************************************}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/alnumsec/alnumsec.dtx b/Master/texmf-dist/source/latex/alnumsec/alnumsec.dtx
new file mode 100644
index 00000000000..84d2d7f6f97
--- /dev/null
+++ b/Master/texmf-dist/source/latex/alnumsec/alnumsec.dtx
@@ -0,0 +1,549 @@
+% \CheckSum{490}
+% \iffalse meta-comment
+% ======================================================================
+% alnumsec.dtx
+% Copyright (C) 2003 Frank Küster
+%
+% This file can be redistributed and/or modified under the terms
+% of the LaTeX Project Public Licence Version 1.0. See:
+% http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
+% ----------------------------------------------------------------------
+% alnumsec.dtx
+% Copyright (C) 2003, 2005
+%
+% Diese Datei kann nach den Regeln der LaTeX Project Public
+% Licence Version 1.0 weiterverbreitet und/oder modifiziert
+% werden.
+%
+% ======================================================================
+%
+% \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 \~}
+% \fi
+% \iffalse
+%<*dtx>
+ \ProvidesFile{alnumsec.dtx}
+%</dtx>
+%\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+%<driver>\ProvidesFile{alnumsec.drv}
+%<alnumsec>\ProvidesPackage{alnumsec}
+ [2005/02/16 v0.02 alphanumeric section numbers with
+ ordinary sectioning commands]
+%<*driver>
+\documentclass{article}
+\usepackage{doc}
+\EnableCrossrefs
+\DoNotIndex{\@addtoreset,\@arabic,\@gobble,\@Alph,\@alph}
+\DoNotIndex{\@ctrerr,\@ifnextchar,\@ifstar,\@ifundefined}
+\DoNotIndex{\@minus,\@namedef,\@nameuse,\@nil}
+\DoNotIndex{\@onelevel@sanitize,\@plus,\@sptoken}
+\DoNotIndex{\@startsection}
+\DoNotIndex{\\,\ ,\|,\@tmpA,\@tmpB,\@tmpC}
+\DoNotIndex{\addtocounter,\alpha}
+\DoNotIndex{\AfterPackage,\arabic,\AtEndDocument,\AtBeginDocument,\author,\addchap}
+\DoNotIndex{\beta,\begin,\caption,\ClassError,\ClassWarning,\csname,\CurrentOption}
+\DoNotIndex{\c@experiment,\cfigure,\c@fk@argnumber,\c@paragraph,\c@subexperiment,\c@subparagraph,\c@subsection}
+\DoNotIndex{\centering,\chapter,\chi}
+\DoNotIndex{\DeclareOption,\def,\documentclass,\dots,\date,\delta}
+\DoNotIndex{\edef,\emph,\endinput,\epsilon,\eta}
+\DoNotIndex{\if,\else,\fi,\empty,\end,\endcsname,\expandafter}
+\DoNotIndex{\fbox,\FK@@sp@b,\FK@@sp@c,\FK@@sp@d,\FK@tempa,\FK@toks@,\FK@@sp@def,\frontmatter,\futurelet}
+\DoNotIndex{\fk@old@addcontentsline,\fk@old@appendix,\fk@old@backmatter}
+\DoNotIndex{\if@mainmatter,\fi,\ifnum,\fi}
+\DoNotIndex{\ifx,\fi,\input,\ifcase,\or,\fi,\iota}
+\DoNotIndex{\gamma,\kappa,\lambda}
+\DoNotIndex{\l@chapter,\l@section,\l@subsection,\l@experiment,\l@labday,\l@subexperiment,\label,\let,\LoadClass}
+\DoNotIndex{\maketitle,\MessageBreak,\mu}
+\DoNotIndex{\newcommand,\newcounter,\newif,\newtoks,\nobreak,\normalfont,\nu}
+\DoNotIndex{\othertext,\omega}
+\DoNotIndex{\par,\PassOptionsToClass,\printindex,\ProcessOptions,\PackageError,\pi,\psi}
+\DoNotIndex{\protect,\protected@edef,\protected@xdef,\providecommand}
+\DoNotIndex{\raggedsection,\refstepcounter,\relax,\renewcommand,\RequirePackage,\rule,\rho}
+\DoNotIndex{\@roman,\@Roman}
+\DoNotIndex{\sectfont,\setcounter,\size@section,\space,\stepcounter,\sigma}
+\DoNotIndex{\tableofcontents,\tau}
+\DoNotIndex{\title,\upsilon,\value,\varepsilon,\varphi,\vartheta}
+\DoNotIndex{\usepackage,\Xothertext,\Xsometext,\z@,\xi,\zeta}
+\CodelineIndex
+%
+\begin{document}
+ \DocInput{alnumsec.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{alnumsec.dtx}
+% \RecordChanges
+%
+% \MacroIndent=2em
+% \setcounter{IndexColumns}{2}
+%
+% \MakeShortVerb{\|}
+% \MakeShortVerb{\§}
+%
+% \title{alnumsec.sty: Using alphanumeric section numbering with
+% standard sectioning commands}
+% \author{Frank K\"uster}
+% \date{\filedate}
+% \maketitle{}
+%
+% \begin{abstract}
+% \noindent This package allows you to use alphanumeric section
+% numbering, e.g. A. Introduction; III. International Law. It's
+% output is similar to alphanum.sty, but you can use the standard
+% \LaTeX\ sectioning commands. Thus it is possible to switch numbering
+% schemes easily. Greek letters, double letters (bb) and different
+% delimiters around them are supported.
+% \end{abstract}
+%
+% \tableofcontents{}
+%
+% \part{User documentation}
+% \label{part:user-documentation}
+%
+% \section{Options}
+% \label{sec:options}
+%
+% There is only one option: If you specify |usehighlevels|, then the
+% numbers for every heading will start with the numbers of the superior
+% levels, as without the package (e.g. A.II.3.(a) Important Section).
+% Without the option, only the number of the current section level is
+% used, e.g. (a) Important Section. This seems to be common with
+% alphanumeric numbering.
+%
+% \section{Specifying the numbering scheme}
+% \label{sec:spec-numb-scheme}
+%
+% You specify the numbering scheme for the headings with the macro
+% \begin{verbatim}
+% \alnumsecstyle{<list of one-letter-specifiers>}
+% \end{verbatim}
+% with the following specifiers:
+% \begin{center}
+% \begin{minipage}{0.8\textwidth}\renewcommand*{\thempfootnote}{\arabic{mpfootnote}}
+% \begin{description}
+% \item[a or n] stands for \textbf{arabic} number: 6
+% \item[R] stands for an uppercase \textbf{Roman} number: VI
+% \item[r] stands for a lowercase \textbf{roman} number: vi
+% \item[L] stands for an uppercase \textbf{Letter}: A
+% \item[l] stands for a lowercase \textbf{letter}: a
+% \item[g] is for \textbf{greek} letter: $\alpha$
+% \item[d] is for two lowercase letters (\textbf{doubleletter}): aa, bb
+% \item[b] for two greek letters (\textbf{doublegreek})\footnotemark: $\alpha\alpha$
+% \end{description}
+% \end{minipage}
+% \end{center}
+% \footnotetext{The b is from \emph{bis}, latin for "twice", since the
+% greek word would also yield a \textbf{d}.}
+%
+% The numbers and letters are all followed by a period per default, if
+% you want to change this, use the macro
+% \begin{verbatim}
+% \surround<name>{<before>}{<after>}
+% \end{verbatim}
+% Instead of |<name>|, put the word given in boldface in the list above
+% (case matters!), |<before>| and |<after>| will be typeset around the
+% number of type name.
+%
+% If you use some number types twice, e.g. arabic numbers for the second
+% and fifth level: |\alnumsecstyle{LaRla}|, you might want to
+% distinguish between the two numbers by their separators. To achieve
+% this, you give the separators for lower levels in the optional
+% argument(s) to |\surround<name>|. In the example, you might use
+% |\surroundarabic[(]{}{)}| to achieve A. 2) III. d. (4) or
+% |\surroundarabic[(][)]{}{.}| for A. 2. III. d. (4). Note, however,
+% that alnumsec does \emph{not} recognize that a number type has yet
+% been used and that it now should use the alternative separators.
+% Instead, you have to specify the first level for which alternative
+% separators should be used with the command
+% |\otherseparators{<level>}|. In \LaTeX, chapter, if defined, has
+% level 0, section has 1 and so on down to subparagraph with level
+% 5. Therefore, in the above example, |\otherseparators{5}| would
+% work, but |\otherseparators{3]| as well.
+%
+%
+% \section{Sectioning levels to use}
+% \label{sec:sect-levels-use}
+%
+% Many people that use alphanumeric sectioning numbers also seem to use
+% many, many levels of sectioning commands - alnumsec.sty can handle
+% this. If you only use the levels that are defined in the standard
+% classes (i.e. from |\chapter| or |\section| to |\subparagraph|), you
+% don't have to do anything. |\part| is not treated at all by
+% alnumsec.sty.
+%
+%\newcommand*{\labday}{\textbackslash\texttt{labday}}\newcommand*{\experiment}{\textbackslash\texttt{experiment}}
+%\newcommand*{\typesection}{\textbackslash\texttt{section}}\newcommand*{\typechapter}{\textbackslash\texttt{chapter}}
+% If you have more (or simply other\footnote{With other, I mean other
+% names for the same concept -- e.g. my labbook.cls uses \labday\
+% instead of \typechapter\ and \experiment\ instead of \typesection.
+% Different concepts, as e.g. in alphanum.sty, won't work. But anyway,
+% you'll only want to use one of both.}) sectioning macros, you have
+% to tell alnumsec about their names and whether the first is on
+% \LaTeX{}s level 0 (like chapter) or 1 (like section). This is done
+% with the macro |\alnumsectionlevels| - here is what the package uses
+% for the article class:
+% \begin{verbatim}
+% \alnumsectionlevels{1}{section,subsection,subsubsection,paragraph,subparagraph}
+% \end{verbatim}
+%
+% If you use this macro, you have to do it \emph{before}
+% |\alnumsecstyle|!\smallskip
+%
+% alnumsec.sty assumes that the number is typeset using |\the<name>| for
+% section level |<name>|. This will always be the case if the macro has
+% been defined using the \LaTeX\ macro designed for this,
+% |\@startsection|.
+%
+%
+% \section{Bugs and Limitations}
+% \label{sec:bugs-limitations}
+%
+% Currently I am not aware of any real bugs, but one could imagine a lot
+% of more features. However, since I wrote this package for somebody
+% else's needs and don't use it myself, I need input from users to be
+% able to improve it.
+%
+% \StopEventually{\PrintIndex\PrintChanges}
+%
+% \part{Implementation}
+%
+%
+%
+% \begin{macrocode}
+%<*alnumsec>
+\newif\ifusepreviouslevels\usepreviouslevelsfalse%
+\DeclareOption{usehighlevels}{\usepreviouslevelstrue}%
+\ProcessOptions%
+\RequirePackage{ifthen}%
+% \end{macrocode}
+%
+% Macros for greek "numbers" and double letters:
+%
+% \begin{macrocode}
+\newcommand*{\@greek}[1]{\ifcase#1\relax\or$\alpha$\or$\beta$\or
+ $\gamma$\or$\delta$\or$\varepsilon$\or$\zeta$\or$\eta$\or$\vartheta$\or
+ $\iota$\or$\kappa$\or$\lambda$\or$\mu$\or$\nu$\or$\xi$\or$o$\or$\pi$\or
+ $\rho$\or$\sigma$\or$\tau$\or$\upsilon$\or$\varphi$\or$\chi$\or$\psi$\or
+$\omega$\else\@ctrerr\fi}%
+\newcommand*{\@doublegreek}[1]{\@greek{#1}{\@greek{#1}}}
+\newcommand*{\@doublealph}[1]{\@alph{#1}{\@alph{#1}}}
+\newcounter{alnumsec@level}%
+\newcounter{fk@secdepth}%
+\newcounter{fk@secstart}%
+\newcounter{fk@changelevel}\setcounter{fk@changelevel}{20}%
+% \end{macrocode}
+%
+% |alnumsec@level| is the dynamic counter used while browsing through
+% the levels. |fk@secdepth| is the number of sectioning levels for
+% which names are known and thus numbers can be assigned. |fk@secstart|
+% will be the starting value for every use of |alnumsec@level|, i.e. it
+% will be 0 if |\chapter|\footnote{or some other macro on the level 0}
+% is defined and 1 otherwise. |fk@changelevel| is the level from which
+% the alternative separators for lower levels will be used. It is
+% initially set very high so that lower level separators won't be used
+% unless this counter is changed, using the following command:
+%
+% \begin{macrocode}
+\def\otherseparators#1{%
+ \setcounter{fk@changelevel}{#1}
+}
+% \end{macrocode}
+%
+% |\alnumsectionlevels| is the command for users that have more or
+% different than the usual section names. The main work is done by
+% |\fk@countlevels|, after that |fk@secdepth| is set to the number of
+% known levels.
+%
+% \begin{macrocode}
+\def\alnumsectionlevels#1#2{%
+ \setcounter{fk@secstart}{#1}
+ \setcounter{alnumsec@level}{#1}%
+ \fk@countlevels#2,\relax,%
+ \setcounter{fk@secdepth}{\value{alnumsec@level}}%
+ \addtocounter{fk@secdepth}{-1}
+}
+% \end{macrocode}
+%
+% |\fk@countlevels| goes through the comma separated list of level names
+% until it encounters the relax that has been put at the end by
+% |\alnumsectionlevels|. For each level, it puts this name into a
+% "numbered" name, e.g. |\fk@levelname1|, and increases the counter.
+%
+% \begin{macrocode}
+\def\fk@countlevels#1,{%
+ \ifx\relax#1%
+ \empty%
+ \else%
+ \expandafter\def\csname fk@levelname\thealnumsec@level\endcsname{#1}%
+ \stepcounter{alnumsec@level}%
+ \expandafter\fk@countlevels%
+ \fi%
+}
+% \end{macrocode}
+%
+% |\alnumsecstyle| is the macro with which the user specifies the
+% numbering scheme and, implicitly, the level of the last numbered
+% section. It feeds its argument to |\fk@scanstyle| and later sets
+% |secnumdepth|. This counter has to be lowered by one because
+% |\fk@scanstyle| increments |alnumsec@level| \emph{after} it has parsed
+% each letter, so after the last letter it is incremented once more.
+% Then |\fk@assignstyle| is called which actually defines |\thesection|
+% and friends.
+%
+% \begin{macrocode}
+\def\alnumsecstyle#1{%
+ \setcounter{alnumsec@level}{\value{fk@secstart}}%
+ \fk@scanstyle#1\relax%
+ \setcounter{secnumdepth}{\value{alnumsec@level}}%
+ \addtocounter{secnumdepth}{-1}%
+ \setcounter{alnumsec@level}{\value{fk@secstart}}%
+ \fk@assignstyle%
+}%
+\def\fk@scanstyle#1{%
+ \ifx\relax#1%
+ \relax%
+ \else%
+ \ifnum\c@alnumsec@level>\c@fk@secdepth%
+ \PackageError{alnumsec}{%
+ more numbering levels than sectioning levels}{%
+ You have specified \thealnumsec@level\space different
+ numbering styles.\MessageBreak However, only
+ \thefk@secdepth\space sectioning commands have been defined,
+ down to \csname fk@levelname\thefk@secdepth\endcsname.
+ }%
+ \else%
+ \fk@whichstyle{#1}%
+ \stepcounter{alnumsec@level}%
+ \fi%
+ \expandafter\fk@scanstyle%
+ \fi%
+}
+\newif\iffk@letterknown\fk@letterknownfalse
+\def\fk@whichstyle#1{%
+ \if R#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@Roman}{Roman}%
+ \fk@letterknowntrue
+ \fi%
+ \if r#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@roman}{roman}%
+ \fk@letterknowntrue
+ \fi%
+ \if n#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@arabic}{arabic}%
+ \fk@letterknowntrue
+ \fi%
+ \if a#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@arabic}{arabic}%
+ \fk@letterknowntrue
+ \fi%
+ \if L#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@Alph}{Letter}%
+ \fk@letterknowntrue
+ \fi%
+ \if l#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@alph}{letter}%
+ \fk@letterknowntrue
+ \fi%
+ \if g#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@greek}{greek}%
+ \fk@letterknowntrue
+ \fi%
+ \if d#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@doublealph}{doubleletter}%
+ \fk@letterknowntrue
+ \fi%
+ \if b#1%
+ \fk@defsecstyle{\thealnumsec@level}{\@doublegreek}{doublegreek}%
+ \fk@letterknowntrue
+ \fi%
+ \iffk@letterknown\else%
+ \PackageError{alnumsec}{unknown specifier: #1}{%
+ You have given #1 as specifier for the numbering
+ scheme.\MessageBreak
+ Only the following are known:\MessageBreak
+ nrRLldgb
+ }
+ \fi
+}
+\def\fk@defsecstyle#1#2#3{%
+ \edef\fk@seclevel{\csname fk@levelname#1\endcsname}%
+ \expandafter\def\csname fk@\thealnumsec@level num\endcsname{#2}%
+ \ifnum\c@alnumsec@level<\c@fk@changelevel%
+ \expandafter\def%
+ \csname fk@pre@\thealnumsec@level\expandafter\endcsname\expandafter{%
+ \csname fk@pre@#3\endcsname}%
+ \expandafter\def%
+ \csname fk@post@\thealnumsec@level\expandafter\endcsname\expandafter{%
+ \csname fk@post@#3\endcsname}%
+ \else%
+ \expandafter\def%
+ \csname fk@lower@pre@\thealnumsec@level\expandafter\endcsname\expandafter{%
+ \csname fk@lower@pre@#3\endcsname}%
+ \expandafter\def%
+ \csname fk@lower@post@\thealnumsec@level\expandafter\endcsname\expandafter{%
+ \csname fk@lower@post@#3\endcsname}%
+ \fi%
+}%
+% \end{macrocode}
+%
+% In |\fk@assignstyle|, the first level has to be treated differently to
+% allow the use of the previous levels for the lower levels.
+%
+% \begin{macrocode}
+\def\fk@assignstyle{%
+ \edef\fk@secname{\csname fk@levelname\thefk@secstart\endcsname}%
+ \expandafter\@namedef{the\fk@secname\expandafter}\expandafter{%
+ \csname fk@pre@\thealnumsec@level\expandafter\endcsname%
+ \csname fk@\thefk@secstart num\expandafter\endcsname%
+ \csname c@\fk@secname\expandafter\endcsname%
+ \csname fk@post@\thealnumsec@level\expandafter\endcsname%
+ }%
+ \whiledo{%
+ \c@alnumsec@level<\c@secnumdepth%
+ }{%
+ \stepcounter{alnumsec@level}%
+ \let\fk@previoussecname\fk@secname%
+ \edef\fk@secname{%
+ \csname fk@levelname\thealnumsec@level\endcsname}%
+ \ifusepreviouslevels%
+ \ifnum\c@alnumsec@level<\c@fk@changelevel%
+ \expandafter\@namedef{the\fk@secname\expandafter}\expandafter{%
+ \csname the\fk@previoussecname\expandafter\endcsname
+ \csname fk@pre@\thealnumsec@level\expandafter\endcsname%
+ \csname fk@\thealnumsec@level num\expandafter\endcsname%
+ \csname c@\fk@secname\expandafter\endcsname%
+ \csname fk@post@\thealnumsec@level\endcsname}%
+ \else%
+ \expandafter\@namedef{the\fk@secname\expandafter}\expandafter{%
+ \csname the\fk@previoussecname\expandafter\endcsname
+ \csname fk@lower@pre@\thealnumsec@level\expandafter\endcsname%
+ \csname fk@\thealnumsec@level num\expandafter\endcsname%
+ \csname c@\fk@secname\expandafter\endcsname%
+ \csname fk@lower@post@\thealnumsec@level\endcsname}%
+ \fi%
+ \else%
+% \end{macrocode}
+%
+% The following three lines are added to have references with parents,
+% thanks to Markus Kohm. \changes{v0.02}{2005/02/16}{Added code to
+% make references complete, thanks to Markus Kohm.}
+%
+% \begin{macrocode}
+ \expandafter\@namedef{p@\fk@secname\expandafter}\expandafter{%
+ \csname p@\fk@previoussecname\expandafter\endcsname
+ \csname the\fk@previoussecname\endcsname}%
+ \ifnum\c@alnumsec@level<\c@fk@changelevel%
+ \expandafter\@namedef{the\fk@secname\expandafter}\expandafter{%
+ \csname fk@pre@\thealnumsec@level\expandafter\endcsname%
+ \csname fk@\thealnumsec@level num\expandafter\endcsname%
+ \csname c@\fk@secname\expandafter\endcsname%
+ \csname fk@post@\thealnumsec@level\endcsname}%
+ \else%
+ \expandafter\@namedef{the\fk@secname\expandafter}\expandafter{%
+ \csname fk@lower@pre@\thealnumsec@level\expandafter\endcsname%
+ \csname fk@\thealnumsec@level num\expandafter\endcsname%
+ \csname c@\fk@secname\expandafter\endcsname%
+ \csname fk@lower@post@\thealnumsec@level\endcsname}%
+ \fi%
+ \fi%
+ }%
+}
+\def\define@surroundstyle#1{%
+ \@namedef{surround#1}{%
+ \@ifnextchar [{%]
+ \csname opt@surround#1\endcsname}{%
+ \csname nopt@surround#1\endcsname}%
+ }%
+ \@namedef{opt@surround#1}[##1]{%
+ \@ifnextchar [{%]
+ \csname dopt@surround#1\endcsname[##1]}{%
+ \csname @opt@surround#1\endcsname[##1]}
+ }
+ \@namedef{dopt@surround#1}[##1][##2]##3##4{%
+ \@namedef{fk@lower@pre@#1}{##1}%
+ \@namedef{fk@lower@post@#1}{##2}%
+ \@namedef{fk@pre@#1}{##3}%
+ \@namedef{fk@post@#1}{##4}%
+ }
+ \@namedef{@opt@surround#1}[##1]##2##3{%
+ \relax
+ \@namedef{fk@lower@pre@#1}{##1}%
+ \@namedef{fk@pre@#1}{##2}%
+ \@namedef{fk@post@#1}{##3}%
+ \expandafter\let%
+ \csname fk@lower@post@#1\expandafter\endcsname%
+ \csname fk@post@#1\endcsname%
+ }
+ \@namedef{nopt@surround#1}##1##2{%
+ \@namedef{fk@pre@#1}{##1}%
+ \@namedef{fk@post@#1}{##2}%
+ \expandafter\let%
+ \csname fk@lower@pre@#1\expandafter\endcsname%
+ \csname fk@pre@#1\endcsname%
+ \expandafter\let%
+ \csname fk@lower@post@#1\expandafter\endcsname%
+ \csname fk@post@#1\endcsname%
+ }
+}
+\define@surroundstyle{Roman}
+\define@surroundstyle{roman}
+\define@surroundstyle{Letter}
+\define@surroundstyle{letter}
+\define@surroundstyle{arabic}
+\define@surroundstyle{doubleletter}
+\define@surroundstyle{greek}
+\define@surroundstyle{doublegreek}
+\newif\iffk@chapterdefined%
+\@ifundefined{chapter}{%
+ \fk@chapterdefinedfalse%
+ \setcounter{fk@secstart}{1}%
+ \setcounter{fk@secdepth}{5}%
+ \alnumsectionlevels{1}{section,subsection,subsubsection,paragraph,subparagraph}%
+}{%
+ \fk@chapterdefinedtrue%
+ \setcounter{fk@secstart}{0}%
+ \setcounter{fk@secdepth}{5}%
+ \alnumsectionlevels{0}{chapter,section,subsection,subsubsection,paragraph,subparagraph}%
+}
+\iffk@chapterdefined%
+ \def\fk@pre@chapter{}%
+ \def\fk@post@chapter{.}%
+\fi
+\surroundRoman{}{.}
+\surroundroman{}{.}
+\surroundarabic{}{.}
+\surroundLetter{}{.}
+\surroundletter[(]{}{)}
+\surroundgreek[(]{}{)}
+\surrounddoubleletter[(]{}{)}
+\surrounddoublegreek[(]{}{)}
+%%
+%% End of file `alnumsec.sty'.
+
+%</alnumsec>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*alnumsec>
+\endinput
+%</alnumsec>
+% \end{macrocode}
+%
+% \clearpage
+% \Finale
+%
+%
diff --git a/Master/texmf-dist/source/latex/alnumsec/alnumsec.ins b/Master/texmf-dist/source/latex/alnumsec/alnumsec.ins
new file mode 100644
index 00000000000..ded1d79d31c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/alnumsec/alnumsec.ins
@@ -0,0 +1,85 @@
+\let\ifbeta\iffalse
+%%
+%% This file will generate fast loadable files from the dtx files in this
+%% bundle when run through LaTeX or TeX.
+%%
+%% ---------------------------------------------------
+%%
+%% This system 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.
+%%
+%% IMPORTANT NOTICE:
+%%
+%% Copyright 2003 Frank Küster
+%% All rights reserved. This package is licensed under the
+%% LaTeX Project Public License. For further information, see
+%% http://www.ctan.org/tex-archive/macros/latex/base/lppl.txt
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{alnumsec.ins}
+\input docstrip.tex
+
+\keepsilent
+\askforoverwritetrue
+%\askforoverwritefalse
+
+\preamble
+\endpreamble
+
+\ifToplevel{\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
+
+Copyright (C) 2003 Frank Küster.
+
+All rights reserved.
+\endpreamble
+\declarepostamble\nullpostamble
+\endpostamble
+
+%% File generation:
+
+\generate{%
+ \usepreamble\mainpreamble
+ \file{alnumsec.sty}{\from{alnumsec.dtx}{alnumsec}}
+}
+
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\ifbeta
+\Msg{* THIS IS A BETA VERSION. YOU SHOULD NOT INSTALL OR USE IT!}
+\Msg{* THERE MAY BE A LOT OF BUGS AT THIS VERSION!}
+\Msg{* PLEASE INSTALL THE RELEASE YOU CAN FIND AT CTAN!}
+\Msg{*}
+\else
+\Msg{* To finish the installation you have to move}
+\Msg{* alnumsec.sty into a directory searched by TeX.}
+\Msg{*}
+\Msg{* For the documentation see the README file.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\fi
+\Msg{***********************************************************}
+}
+
+\endinput
+%%
+%% end of file `labbook.ins'
diff --git a/Master/texmf-dist/source/latex/apa/CHANGELOG b/Master/texmf-dist/source/latex/apa/CHANGELOG
new file mode 100644
index 00000000000..bb0576c9a40
--- /dev/null
+++ b/Master/texmf-dist/source/latex/apa/CHANGELOG
@@ -0,0 +1,232 @@
+
+Alteration log for apa.cls (v1.3.0, August 2002)
+
+1.00 --> 1.01
+July 5, 1996: \r@headl now defaults to \r@headr in [doc] (used to complain)
+
+1.01 --> 1.02
+October 28, 1996:Changed \rhead to \markright in [doc]
+
+1.02 --> 1.1
+July 15, 1997: Removed citation section, loading apacite.sty instead
+ Added three and four authors/affiliations
+ Added bibliographystyle{apacite}
+
+August 20, 1997: Removed call to twocolumn.sty (not needed in 2e)
+ Added notimes and nosf options for jou and man, respectively
+ Changed \typeout to \ClassWarning where appropriate
+ Set \textfraction to 0 for the man mode
+
+August 21, 1997: Fixed date stamp on previous alteration :-) and in the
+ \ProvidesClass command.
+ Changed author size in jou from \Large to \large
+ Added \journal, \volume, \ccoppy, \copnum for first page header
+
+August 22, 1997: Changed \footnoterule to be \columnwidth wide
+ Moved author, title, etc. checking (& warnings) to a single block
+ Added appropriate behavior for undefined abstracts in doc & man
+ Removed line numbers from warnings about missing title, author, etc.
+ Added check for matching number of authors/affiliations
+
+October 30, 1997: Fix version to 1.1 and upload to CTAN
+
+1.1 --> 1.2
+December 16, 1997: Changed \evensidemargin from -0.15in to -0.1in to match \oddsidemargin
+
+May 15, 1998: In man mode, do not print a footnote page if no footnotes exist
+ Changed footnoterule length back to 0.5in as seen in latest JEP:HPP
+ Used ftnright in jou (if available) so that all footnotes appear
+ under the right column (canceling other appeareance changes in ftnright)
+ Used fancyhdr to display journal etc. at the header of the first page
+ Added conditional compilation macros: \ifapamodeman{}{}, \ifapamodejou{}{},
+ and \ifapamodedoc{}{} (first parameter when true, second when false); also
+ \ifapamode{}{}{} with separate options for man, jou, and doc mode.
+
+May 18, 1998: Added \fitfigure for loading eps files and automatically determine dimensions
+ by trying width=\columnwidth and switching to height=\textheight if the result
+ is too high. In man mode it rotates the figure if width is greater than height.
+
+May 19, 1998: Adjusted skips above and below captions separately for tables and figures
+ Added \fitbitmap that doesn't scale eps in man mode (as \fitfigure does).
+ Will load pslatex instead of times and mathptm if available
+
+May 20, 1998: Changed \columnwidth to \linewidth within \fitfigure nad \fitbitmap to handle
+ double-column figures (thanks to Donald Arseneau and Heiko Oberdiek)
+
+May 27, 1998: Defined \put@one@authaffil and \put@two@authaffil to unclutter \maketitle
+ in jou mode.
+ Copied the footnotemark definitions from article.cls and adjusted dimensions
+ Adjusted sizes, distances, and dimensions of all sorts in jou mode
+
+June 3, 1998: When two author-affiliation boxes are displayed side by side and one is wider
+ than \columnwidth but not by more than 25 then no lines are broken and
+ \hfill is used to separate the two boxes from each other and from the margins
+ provided that at least .4in of ``breathing space'' is left between the two
+ (thanks to Donald Arsenau for suggesting the use of tabular)
+
+ Thanks to Mike Tarr for testing and for suggesting features
+
+June 10, 1998: Checked and adjusted dimensions in jou format
+ Implemented the fignum option that prints the short title and the figure
+ number in the header of figure pages in man mode
+ Defined \thickline for horizontal separator between caption and table
+ Made footnote separators (and ack box rule separator) thinner in all modes
+
+June 12, 1998: Set tabular to occupy the full \linewidth in jou mode
+ Option notab can be specified to override this and revert to standard tabular
+
+June 13, 1998: Freeze features and call it a beta.
+
+July 28, 1998: Fix version to 1.2, rename .doc files to .txt, and upload to CTAN
+ (version datestamp is 8/1/98)
+
+1.2 --> 1.21
+August 1, 1998: Added nobf option to have section headers displayed in regular (not bold)
+ weight (effective in man mode only)
+
+August 3, 1998: Set endnotes ragged-right in man (thanks to Bob Damber for noticing)
+ Left-flushed figure captions and underlined period after ``Figure'' in man
+
+1.21 --> 1.22
+September 2, 1998: Set running head (lowercase `h') on title page of man mode to flush left
+
+1.22 --> 1.23
+January 5, 1999: Fixed bug in \headinglevels (thanks to John Vokey for pointing it out)
+
+January 13,1999: Included all options in the class warning message on unknown option
+
+January 27,1999: Changed \rlap to \hbox in \@makefnmark (thanks to Michael Erickson)
+
+February 9,1999: Added vertical fill around included figures in man mode (fitfigure,fitbitmap)
+ Added \long to the conditional compilation (mode checking) definitions
+
+April 18,1999: Pass unknown options on to article.cls (thanks to Robin Fairbairns)
+
+June 1, 1999: Fix version to 1.23 and upload to CTAN (version datestamp is 5/1/99)
+
+1.23 --> 1.24
+March 10, 2000: Save regular \footnote definition to \oldfootnote before changing to
+ \endnote and restore after printing endnotes so that footnotes in the
+ tables will appear correctly in man mode (thanks to Franck Ramus for
+ pointing out the problem).
+
+ Defined \tabfnm and \tabfnt to create footnote marks in tables without
+ messing up vertical alignment (centering). Used with a single argument,
+ the footnote mark (e.g., \tabfnm{a} in the tabular environment and
+ \tabfnt{a}{blabla} right before or after \end{tabular} for the note text.
+
+July 17, 2000: Added second set of braces around \em in cap@style to get citations in
+ table captions in man mode (thanks to John Vokey for noticing)
+
+ Added @dummy@box with an accented character so that the first accent does
+ not occur inside a citation, because in that case LaTeX complains
+ (recent distributions only, something about apacite+OT1 -- babel bug?)
+
+July 18,2000 Added Michael Erickson's patch to handle appendix section & float numbering
+ Revised and set default to one unnumbered appendix for backwards compatibility
+
+July 27,2000 Added floatmark option for those who still want figure and table in-text
+ markers ("Insert table/figure X here"). These are not required in the 4th
+ edition of the manual and will now by default not appear.
+ (Thanks to Michael Erickson for pointing it out and helping correct this)
+
+ Defined \appendix* and \appendixes (no difference between the two)
+ for more than one appendices, to be numbered A, B, C, ...
+ Individual appendices are treated as sections, in the standard LaTeX manner
+
+1.24 --> 1.25
+October 20,2000 Added flushend.sty in jou mode (optional)
+
+ Language portability: abstractname, refname/bibname, acksname, notesname
+ figurecaptionsname, appendixname, figurename, tablename
+
+ Added \apavector based on p. 114 of the APA manual
+
+ Fixed appendix headings, used old@tabular to center in jou mode
+ \appendix* and \appendices no longer necessary since the number is detected
+ and adjustments are made automatically -- removed, only \appendix remains
+
+July 5, 2001 Do not print "Figure captions" page when there are no figures
+ (added @figure@written definition as flag in endfloat code)
+
+ Fixed check for Greek language so that \GreekDefs is expanded correctly
+
+ Changed \uppercase to \MakeUppercase to work in every language
+
+1.25 --> 1.26
+February 27,2002:Quick fix for APA manual 5th edition (man mode only):
+ (a) do not load ulem.sty since italics are OK and no underlining is needed
+ (b) hanging indent in bibliography as in other modes (and apacite default)
+
+ Removed some calls to \rm that prevented use of the default font family
+ Declared font options: helv for helvetica and tt for typewriter
+ The \helvetica command now only produces a warning to use the helv option
+
+ Got longtable to work with apa.cls. Must be used as option to apa.cls
+ and not loaded as regular package (due to precedence requirements for
+ proper endfloat function and cross-definitions). ONLY for man mode
+ (longtable does not work unless in single-column). Unfortunately the
+ ifapamode commands won't work to keep a single table body and mode-specific
+ table or longtable environment because if cross-nests with environment
+ begin/end. In fact the table environment won't even work inside in
+ ifapamode argument, which makes it impossible to have a single file
+ that can be processed for both man and jou. Defeats the purpose of apa.cls...
+
+ Sent out as v1.26 to a bunch of users for testing and feedback
+
+1.26 --> 1.27
+March 15, 2002: Commented out forgotten \old@endtabular etc @ ~ l. 720 because the \relax
+ caused an extra line after the end of tabular (thanks to Jacob Feldman
+ for noticing)
+
+1.27 --> 1.28
+March 31, 2002: Fixed appendix headers which were in a tabular parbox centered in a
+ column shifted right by 4em (the \leftskip of the section header, \leveltwo).
+ Thanks to Jeff Miller for pointing out the bug.
+
+April 1, 2002: \@figure@written should be defined globally to be visible at end document
+ Thanks to Olivier Crouzet for noticing that figure captions weren't printing
+
+ Fixed (I hope) vertical placement of appendix section header by removing
+ extra vertical space (presumably added in the making of the tabular box)
+
+1.28 --> 1.2.9
+July 20, 2002: Changed \columnwidth to \linewidth in the journal format table caption
+ to handle wide captions (thanks to Ragnar Steingrimsson for noticing)
+
+ Changed \underline to \em in man mode figure caption page for "Figure #."
+ (thanks to Ragnar Steingrimsson for noticing)
+
+ Changed version numbering to the correct 1.2.x (instead of 1.2x)
+
+ Now using \refstepcounter to increase appendix number so that appendices
+ can be referenced via label/ref (add \label{app:X} after appendix \section
+ command and reference anywhere in text using Appendix~\ref{app:X})
+
+ Fixed appendix section title centering by removing tabular intra-box space
+
+August 21, 2002: Set parsep to 0em for biblist in man mode because some editor complained
+ that the references were separated by more than regular line skip.
+ (I can't quite thank Steve Finney for bringing it up...). Then commented
+ out the change because the ref list was much easier to read before.
+
+August 30, 2002: Fix version to 1.3.0 and upload to CTAN
+
+%%%%%%%%%%%%%%%%
+
+TO DO FOR v2.0: Bring apacite up to date, preferably using natbib
+ Is continuation note at page end required with long tables? (5.21/p. 301)
+ Stop messing with captions and use a standard package (caption2, ccaption)
+ Stop messing with endfloat and use loflot or something for the captions page
+ Use fancyhdr for all headings in all modes (instead of markboth/markright)
+ Appendices should be set in smaller typeface, including headings
+ Tabular footnotes should be automated -- not practical because it varies
+ dont' know how to keep expanding list of footnotes to display at \endtabular
+ Follow manual guidelines for table "Note" vs. probabilities (3.70/p. 170)
+ Wide tables should be turned sideways automatically -- how?
+ Fix Greek definitions according to babel conventions -- check babel docs
+ Clean up the font act -- remove rm/hrm/hsl etc.
+ Use geometry package to set margins taking into account paper size (A4)
+ Add contact information command and field for first page (man mode only)
+
+PROBLEMS: flushend.sty seems to mess up the last column if there is a float in it.
diff --git a/Master/texmf-dist/source/latex/apa/LICENCE b/Master/texmf-dist/source/latex/apa/LICENCE
new file mode 100644
index 00000000000..4e93b2cd714
--- /dev/null
+++ b/Master/texmf-dist/source/latex/apa/LICENCE
@@ -0,0 +1,13 @@
+
+%% LICENCING TERMS
+%%
+%% apa.cls
+%% version 1.3.0
+%% August 2002
+%% by Athanassios Protopapas
+%% protopap@ilsp.gr
+%%
+%% This package may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution. Either
+%% version 1.0 or, at your option, any later version.
+
diff --git a/Master/texmf-dist/source/latex/apa/endfloat.cfg b/Master/texmf-dist/source/latex/apa/endfloat.cfg
new file mode 100644
index 00000000000..39c67896e30
--- /dev/null
+++ b/Master/texmf-dist/source/latex/apa/endfloat.cfg
@@ -0,0 +1,31 @@
+%
+% endfloat configuration file for long tables, to be used with apa.cls
+%
+
+\let\efsaved@longtable\longtable
+\AtBeginTables{\let\longtable=\efsaved@longtable\relax}
+
+\def\longtable{\efloat@condopen{ttt}
+ \efloat@iwrite{ttt}{\string\begin{longtable}}%
+ \if@domarkers
+ \addtocounter{posttbl}{1}
+ \tableplace
+ \fi
+ \def\@currenvir{efloat@float}%
+ \begingroup
+ \let\do\ef@makeinnocent \dospecials
+ \ef@makeinnocent\^^L% and whatever other special cases
+ \endlinechar`\^^M \catcode`\^^M=12 \ef@xlongtable}
+{\catcode`\^^M=12 \endlinechar=-1 %
+ \gdef\ef@xlongtable#1^^M{\def\test{#1}
+ \ifx\test\ef@endlongtabletest
+ \efloat@foundend{ttt}{longtable}
+ \else
+ \efloat@iwrite{ttt}{#1}%
+ \let\next\ef@xlongtable
+ \fi \next}
+}
+
+{\escapechar=-1%
+ \xdef\ef@endlongtabletest{\string\\end\string\{longtable\string\}}}%
+\endinput
diff --git a/Master/texmf-dist/source/latex/appendix/appendix.dtx b/Master/texmf-dist/source/latex/appendix/appendix.dtx
new file mode 100644
index 00000000000..3770ae11657
--- /dev/null
+++ b/Master/texmf-dist/source/latex/appendix/appendix.dtx
@@ -0,0 +1,1055 @@
+% \iffalse meta-comment
+% apendix.dtx
+% Author: Peter Wilson (CUA) now at peter.r.wilson@boeing.com until June 2004
+% (or at: pandgwilson at earthlink dot net)
+% Copyright 1998 --- 2004 Peter R. Wilson
+%
+% This work 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 the 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/06/01 or later.
+%
+% This work has the LPPL maintenance status "author-maintained".
+%
+% This work consists of the files listed in the README file.
+%
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\setcounter{StandardModuleDepth}{1}
+\begin{document}
+ \DocInput{appendix.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \CheckSum{481}
+%
+% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
+% \DoNotIndex{\@centercr,\@cite}
+% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+% \DoNotIndex{\@input,\@ixpt,\@m}
+% \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
+% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+% \DoNotIndex{\advance,\Alph,\alph}
+% \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+% \DoNotIndex{\bullet}
+% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+% \DoNotIndex{\fbox}
+% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+% \DoNotIndex{\input}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+% \DoNotIndex{\NeedsTeXFormat,\newdimen}
+% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
+% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
+% \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
+% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+% \DoNotIndex{\wd,\xiipt,\year,\z@}
+%
+% \changes{v1.0}{1998/11/29}{First public release}
+% \changes{v1.0a}{1999/07/28}{Added text about includes}
+% \changes{v1.1}{2000/02/29}{Extended appendices}
+% \changes{v1.1}{2000/02/29}{Added subappendices}
+% \changes{v1.1a}{2001/03/15}{Fixed problem with \cs{addappheadtotoc}}
+% \changes{v1.2}{2002/08/06}{Compatibility with hyperref bookmarks}
+% \changes{v1.2}{2002/08/06}{Don't need the ifthen package any more}
+% \changes{v1.2a}{2004/04/16}{Changed license and contact details}
+%
+% \def\dtxfile{appendix.dtx}
+% \def\fileversion{v1.1}
+% \def\filedate{2000/02/29}
+% \def\fileversion{v1.1a}
+% \def\filedate{2001/03/15}
+% \def\fileversion{v1.2}
+% \def\filedate{2002/08/06}
+% \def\fileversion{v1.2a}
+% \def\filedate{2004/04/16}
+% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
+% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
+% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
+% \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
+% \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
+% \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
+%
+% \title{The \Lpack{appendix} package\thanks{This
+% file (\texttt{\dtxfile}) has version number \fileversion, last revised
+% \filedate.}}
+%
+% \author{%
+% Peter Wilson\thanks{After May 2004 at \texttt{pandgwilson at earthlink dot net}} \\
+% Catholic University of America \\
+% Now at \texttt{peter.r.wilson@boeing.com}
+% }
+% \date{\filedate}
+% \maketitle
+% \begin{abstract}
+% The \Lpack{appendix} package provides some facilities for modifying the
+% typesetting of appendix titles. Further, |(sub)appendices| environments
+% are available that can be used, for example, for per chapter/section
+% appendices.
+%
+% The package
+% is designed to work only with classes that have a |\chapter| and/or
+% |\section| command. It has not been tested with other packages
+% that change the definitions of the sectioning commands.
+% \end{abstract}
+% \tableofcontents
+%
+% \StopEventually{}
+%
+%
+%
+% \section{Introduction}
+%
+% In the standard classes the |\appendix| command does the following:
+% \begin{itemize}
+% \item For classes with Chapters:
+% \begin{itemize}
+% \item Resets the chapter and section counters to zero
+% \item Sets |\@chapapp| to |\appendixname|.
+% \item Redefines |\thechapter| to produce alphabetic appendix numbers.
+% \end{itemize}
+% \item For the other classes
+% \begin{itemize}
+% \item Resets the section and subsection counters to zero.
+% \item Redefines |\thesection| to produce alphabetic appendix numbers.
+% \end{itemize}
+% \end{itemize}
+%
+% The \Lpack{appendix} package provides additional appendixing capabilities.
+% It cooperates with the \Lpack{hyperref}
+% package\footnote{With thanks to Hylke W. van Dijk
+% (\texttt{hylke@ubicom.tudelft.nl}) who pointed out that version~1.1 did
+% not and set me on the track for supporting the \Lpack{hyperref} package.}
+% but may be problematic when used with packages that change the definition
+% of the sectioning commands.
+%
+% Portions of the package were developed as part of a class
+% and package bundle for typesetting ISO standards~\cite{PRW96i}.
+% This manual is typeset according to the conventions of the
+% \LaTeX{} \textsc{docstrip} utility which enables the automatic
+% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
+%
+% Section~\ref{sec:usc} describes the usage of the package.
+% Commented source code for the package is in Section~\ref{sec:code}.
+%
+% \section{The \Lpack{appendix} package} \label{sec:usc}
+%
+% The \Lpack{appendix} package provides some commands that can be
+% used in addition to the |\appendix| command. It also provides
+% a new environment that can be used instead of the |\appendix| command.
+% The environment provides some addtional actions with respect to
+% the simple |\appendix|. First the new commands will be described and
+% then the new environment will be discussed.
+%
+% \DescribeMacro{\appendixpage}
+% The |\appendixpage| command will typeset a heading in the style of
+% a |\part| heading for the class. The wording of the heading is
+% given by the value of |\appendixpagename|.
+%
+% \DescribeMacro{\addappheadtotoc}
+% This command will insert general heading into the Table of Contents (ToC).
+% The text is given by the value of |\appendixtocname|. If used, the command
+% must come before the first appendix, as it is meant to be used to introduce
+% the appendix titles in the ToC.
+%
+% \changes{v1.1a}{2001/03/15}{Added NOTE about \cs{addappheadtotoc} page number}
+% The above commands can be used in conjunction with the traditional
+% |\appendix| command, which they should immediately follow. For example:
+% \begin{verbatim}
+% \appendix
+% \appendixpage
+% \addappheadtotoc
+% \end{verbatim}
+%
+% \DescribeMacro{\noappendicestocpagenum}
+% \DescribeMacro{\appendicestocpagenum}
+% By default the |\addappheadtotoc| command puts a page number
+% in the ToC. This can be prevented by using |\noappendicestocpagenum|.
+% For symmetry, the |\appendicestocpagenum| command ensures that
+% a page number is put in the ToC.
+%
+% \textbf{NOTE:} Unless |\noappendicestocpagenum| is used
+% the |\addappheadtotoc| command uses the
+% current page number
+% when it makes the entry in the ToC. The |\appendixpage| command puts
+% a heading in the document like a |\part| heading; in un-chaptered documents
+% the |\part| heading appears in the ordinary run of the text like a
+% |\section| heading, but in chaptered documents it is on a page by itself.
+% That is, in chaptered documents |\appendixpage| does a |\clear[double]page|
+% typesets the heading, and then does another |\clear[double]page|. Therefore,
+% in a chaptered document the above sequence of
+% commands will use the page number
+% \emph{after} the |\appendixpage| as the ToC
+% entry\footnote{With thanks to Eduardo Jacob (\texttt{edu@kender.es})
+% for pointing this out.} and if the ordering
+% is reversed (i.e., |\addappheadtotoc| |\appendixname|) then the page number
+% \emph{before} |\appendixname| will be used as the ToC entry. For chaptered
+% documents it is probably best to do: \\
+% | \clearpage % or \cleardoublepage| \\
+% | \addappheadtotoc| \\
+% | \appendixpage| \\
+% which will use the page number of |\appendixpage| as the ToC entry.
+%
+%
+% \DescribeMacro{\appendixname}
+% \DescribeMacro{\appendixtocname}
+% \DescribeMacro{\appendixpagename}
+% The |\appendixname| command is defined in those classes that provide
+% for chapters. It is provided in this package whether or not it has
+% been defined in the class. It's default value is `Appendix'.
+% The default value of both |\appendixtocname| and |\appendixpagename| is
+% `Appendices'. These names can all be changed via |\renewcommand|.
+% For example,
+% \begin{verbatim}
+% \renewcommand{\appendixtocname}{List of appendices}
+% \end{verbatim}
+%
+% \DescribeEnv{appendices}
+% The |appendices| environment can be used instead of the |\appendix|
+% command. It provides more functionality than is possible from the
+% combination of the |\appendix|, |\addappheadtotoc| and |\appendixpage|
+% commands.
+% The functions of the |appendices| environment are usually accessed through
+% the package options, but there are declarations that mey be used insted.
+% The options are:
+% \begin{itemize}
+% \item \Lopt{toc} Put a header (e.g., `Appendices') into the Table
+% of Contents (the ToC) before listing the appendices. (This
+% is done by calling the |\addappheadtotoc| command.)
+% \item \Lopt{page} Puts a title (e.g., `Appendices') into the document
+% at the point where the |appendices| environment is begun.
+% (This is done by calling the |\appendixpage| command.)
+% \item \Lopt{title} Adds a name (e.g., `Appendix') before each appendix
+% title in the body of the document.
+% The name is given by the value of |\appendixname|.
+% Note that this is the default behaviour for classes that have
+% chapters.
+% \item \Lopt{titletoc} Adds a name (e.g., `Appendix') before each
+% appendix listed in the ToC.
+% The name is given by the value of |\appendixname|.
+% \item \Lopt{header} Adds a name (e.g., `Appendix') before each appendix
+% in page headers.
+% The name is given by the value of |\appendixname|.
+% Note that this is the default behaviour for classes that have
+% chapters.
+% \end{itemize}
+%
+% Depending on the particular package options that are set and the
+% document class, the
+% |appendices| environment may change the definition of elements of
+% the sectioning commands (e.g., |\chapter| or |\section|).
+% This may be a problem if the environment
+% is used in conjunction with any other package that makes changes to
+% these commands. If this is the case, then you will have to examine the
+% code for the |appendices| environment and make any necessary changes
+% to one or the other of the packages (via your own package file).
+% The changes to the sectional heading commands are discarded at the
+% end of the |appendices| environment.
+%
+% \DescribeMacro{\appendixtocon}
+% \DescribeMacro{\appendixtocoff}
+% |\appendixtocon| is a declaration equivalent to the \Lopt{toc} option.
+% The |\appendixtocoff| declaration is equivalent to not using that option.
+%
+% \DescribeMacro{\appendixpageon}
+% \DescribeMacro{\appendixpageoff}
+% |\appendixpagecon| is a declaration equivalent to the \Lopt{page} option.
+% The |\appendixpageoff| declaration is equivalent to not using
+% that option.
+%
+% \DescribeMacro{\appendixtitleon}
+% \DescribeMacro{\appendixtitleoff}
+% |\appendixtitleon| is a declaration equivalent to the \Lopt{title} option.
+% The |\appendixtitleoff| declaration is equivalent to not using
+% that option.
+%
+% \DescribeMacro{\appendixtitletocon}
+% \DescribeMacro{\appendixtitletocoff}
+% |\appendixtitletocon| is a declaration equivalent to the \Lopt{titletoc} option.
+% The |\appendixtitletocoff| declaration is equivalent to not using
+% that option.
+%
+% \DescribeMacro{\appendixheaderon}
+% \DescribeMacro{\appendixheaderoff}
+% |\appendixheaderon| is a declaration equivalent to the \Lopt{header} option.
+% The |\appendixheaderoff| declaration is equivalent to not using
+% that option.
+%
+% \DescribeMacro{\restoreapp}
+% The |appendices| environment restores the prior value of the
+% chapter/section counter at the end of the environment, so the
+% environment may be used between the main document divisions. By default,
+% the appendix counter value is saved and restored by the environment. That
+% means that appendices in a series of |appendices| environments will
+% be lettered sequentially. To make the lettering start from A each time,
+% put the following into the preamble: \\
+% |\renewcommand{\restoreapp}{}|
+%
+% \DescribeEnv{subappendices}
+% Within the |subappendices| environment, an appendix is introduced by a
+% |\section| command in chaptered documents, otherwise it is introduced
+% by a |\subsection| command. Effectively, this provides for appendices
+% at the end of a main document division, as an integral
+% part of the division. The |subappendices| environment supports only
+% the \Lopt{title} and \Lopt{titletoc} options.
+%
+% \DescribeMacro{\setthesection}
+% \DescribeMacro{\setthesubsection}
+% By default, the `subappendices' are numbered like normal (sub)sections,
+% except that the (sub)section number itself is typeset as an uppercase
+% letter. This behaviour can be changed by redefining these |\setthe...|
+% commands. For example, to just have a letter not prepended by the main
+% division number, do: \\
+% |\renewcommand{\setthesection}{\Alph{section}}| or \\
+% |\renewcommand{\setthesubsection}{\Alph{subsection}}| as appropriate.
+%
+% \subsection{Known problems}
+%
+% There is an unfortunate interaction between the \LaTeX{} kernel commands
+% |\include| and |\addcontentsline|. If these are used like this:
+% \begin{verbatim}
+% \addcontentsline{toc}{...}{addtotoc}
+% \include{import}
+% \end{verbatim}
+% then the text of the |\addcontentsline| command (`addtotoc' in the example)
+% is not written to the
+% appropriate (toc) file until \textit{after} the included file has written all
+% its entries out to the (toc) file. As far as I can tell, there is no way
+% around this behaviour without rewriting parts of the \LaTeX{} kernel code.
+%
+% It is thus up to the author to avoid putting an |\addcontentsline| command
+% (or a command that internally uses |\addcontentsline|, as does the
+% |\addappheadtotoc| command) before
+% an |\include|d file that writes out to the same file. Things work as
+% expected if the |\addcontentsline| command is placed within the |\include|d
+% file, or if the imported file is |\input|ed instead of |\include|d.
+%
+% \section{The package code} \label{sec:code}
+%
+% Announce the name and version of the package, which requires
+% \LaTeXe.
+% \begin{macrocode}
+%<*usc>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{appendix}[2002/08/06 v1.2 extra appendix facilities]
+
+% \end{macrocode}
+%
+% In order to try and avoid name clashes with other packages, each internal
+% name will include the character string |@pp|.
+%
+%
+% \begin{macro}{\if@knownclass@pp}
+% \begin{macro}{\if@chapter@pp}
+% These are used when we need to decide what appendix style is being used
+% for the document. Assume the \Lpack{article} class or other without
+% chapters.
+% \changes{v1.1a}{2001/03/15}{Checking on sectional commands, not classes}
+% \begin{macrocode}
+\newif\if@chapter@pp\@chapter@ppfalse
+\newif\if@knownclass@pp\@knownclass@ppfalse
+% \end{macrocode}
+% Check the sectioning commands.
+% \begin{macrocode}
+\@ifundefined{chapter}{%
+ \@ifundefined{section}{}{\@knownclass@pptrue}}{%
+ \@chapter@pptrue\@knownclass@pptrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\phantomsection}
+% \begin{macro}{\the@pps}
+% \begin{macro}{\if@pphyper}
+% We need to provide |\phantomsection| if \Lpack{hyperref} is not
+% used and, whether or not \Lpack{hyperref} is used, we need to define
+% a counter here to support potential hyperrefs (used to disambiguate
+% (sub)appendices).
+% |\if@pphyper| is TRUE if the \Lpack{hyperref} package is used.
+% \changes{v1.2}{2002/08/06}{Added the \texttt{@pps} counter}
+% \changes{v1.2}{2002/08/06}{Added \cs{if@pphyper}}
+% \begin{macrocode}
+\providecommand{\phantomsection}{}
+\newcounter{@pps}
+ \renewcommand{\the@pps}{\alph{@pps}}
+\newif\if@pphyper
+ \@pphyperfalse
+\AtBeginDocument{%
+ \@ifpackageloaded{hyperref}{\@pphypertrue}{}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if@dotoc@pp}
+% \begin{macro}{\if@dotitle@pp}
+% \begin{macro}{\if@dotitletoc@pp}
+% \begin{macro}{\if@dohead@pp}
+% \begin{macro}{\if@dopage@pp}
+% A set of booleans for the options. Default is the |appendices|
+% environment does nothing more than the |\appendix| command does
+% unless one or more options are set.
+% \begin{macrocode}
+\newif\if@dotoc@pp\@dotoc@ppfalse
+\newif\if@dotitle@pp\@dotitle@ppfalse
+\newif\if@dotitletoc@pp\@dotitletoc@ppfalse
+\newif\if@dohead@pp\@dohead@ppfalse
+\newif\if@dopage@pp\@dopage@ppfalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Now we can do the five options.
+% \begin{macrocode}
+\DeclareOption{toc}{\@dotoc@pptrue}
+\DeclareOption{title}{\@dotitle@pptrue}
+\DeclareOption{titletoc}{\@dotitletoc@pptrue}
+\DeclareOption{header}{\@dohead@pptrue}
+\DeclareOption{page}{\@dopage@pptrue}
+% \end{macrocode}
+% Process the options now.
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% Issue a warning if |\chapter| and |\section| are undefined, then
+% quit.
+% \begin{macrocode}
+\newcommand{\@ppendinput}{}
+\if@knownclass@pp\else
+ \PackageWarningNoLine{appendix}%
+ {There is no \protect\chapter\space or \protect\section\space command.\MessageBreak
+ The appendix package will not be used}
+ \renewcommand{\@ppendinput}{\endinput}
+\fi
+\@ppendinput
+
+% \end{macrocode}
+%
+% \begin{macro}{\appendixtocon}
+% \begin{macro}{\appendixtocoff}
+% Declarative forms of the \Lopt{toc} option.
+% \changes{v1.2}{2002/08/06}{Added declarations for the options}
+% \begin{macrocode}
+\newcommand{\appendixtocon}{\@dotoc@pptrue}
+\newcommand{\appendixtocoff}{\@dotoc@ppfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixpageon}
+% \begin{macro}{\appendixpageoff}
+% Declarative forms of the \Lopt{page} option.
+% \begin{macrocode}
+\newcommand{\appendixpageon}{\@dopage@pptrue}
+\newcommand{\appendixpageoff}{\@dopage@ppfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixtitleon}
+% \begin{macro}{\appendixtitleoff}
+% Declarative forms of the \Lopt{title} option.
+% \begin{macrocode}
+\newcommand{\appendixtitleon}{\@dotitle@pptrue}
+\newcommand{\appendixtitleoff}{\@dotitle@ppfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixtitletocon}
+% \begin{macro}{\appendixtitletocoff}
+% Declarative forms of the \Lopt{titletoc} option.
+% \begin{macrocode}
+\newcommand{\appendixtitletocon}{\@dotitletoc@pptrue}
+\newcommand{\appendixtitletocoff}{\@dotitletoc@ppfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixheaderon}
+% \begin{macro}{\appendixheaderoff}
+% Declarative forms of the \Lopt{header} option.
+% \begin{macrocode}
+\newcommand{\appendixheaderon}{\@dohead@pptrue}
+\newcommand{\appendixheaderoff}{\@dohead@ppfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ppsavesec}
+% \begin{macro}{\@pprestoresec}
+% \begin{macro}{\@ppsaveapp}
+% \begin{macro}{\restoreapp}
+% For the |appendices| environment we need to save and restore the
+% main document division number and the appendix number. The |\restoreapp|
+% command is the one for the user.
+% \changes{v1.1}{2000/02/29}{Added commands to save and restore sectional numbering}
+% \begin{macrocode}
+\newcounter{@ppsavesec}
+\newcounter{@ppsaveapp}
+\setcounter{@ppsaveapp}{0}
+\newcommand{\@ppsavesec}{%
+ \if@chapter@pp \setcounter{@ppsavesec}{\value{chapter}} \else
+ \setcounter{@ppsavesec}{\value{section}} \fi}
+\newcommand{\@pprestoresec}{%
+ \if@chapter@pp \setcounter{chapter}{\value{@ppsavesec}} \else
+ \setcounter{section}{\value{@ppsavesec}} \fi}
+\newcommand{\@ppsaveapp}{%
+ \if@chapter@pp \setcounter{@ppsaveapp}{\value{chapter}} \else
+ \setcounter{@ppsaveapp}{\value{section}} \fi}
+\newcommand{\restoreapp}{%
+ \if@chapter@pp \setcounter{chapter}{\value{@ppsaveapp}} \else
+ \setcounter{section}{\value{@ppsaveapp}} \fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixname}
+% \begin{macro}{\appendixtocname}
+% \begin{macro}{\appendixpagename}
+% These commands hold the names that might be used. |\appendixname|
+% may have been defined in the class. The others are new.
+% \begin{macrocode}
+\providecommand{\appendixname}{Appendix}
+\newcommand{\appendixtocname}{Appendices}
+\newcommand{\appendixpagename}{Appendices}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\appendixpage}
+% The command to typeset a page announcing the start of the appendices.
+% It is based on the |\part| definition (either from the \Lpack{book}
+% class or the \Lpack{article} class).
+% \begin{macrocode}
+\newcommand{\appendixpage}{%
+ \if@chapter@pp \@chap@pppage \else \@sec@pppage \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clear@ppage}
+% The non-chaptered classes do not define |\if@openright|, but we need to
+% use this for chaptered documents to clear the appropriate pages.
+% |\clear@ppage| does the right thing, but must only be called in
+% chapter related code, otherwise there will be error message like
+% |extra \else| or |extra \fi|.
+% \begin{macrocode}
+\newcommand{\clear@ppage}{%
+ \if@openright\cleardoublepage\else\clearpage\fi}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@chap@pppage}
+% Do an appendix page in chapter style.
+% Copy code from the \Lpack{book} class |\part| command, but use
+% |\appendixpagename| as the title.
+% \begin{macrocode}
+\newcommand{\@chap@pppage}{%
+ \clear@ppage
+ \thispagestyle{plain}%
+ \if@twocolumn\onecolumn\@tempswatrue\else\@tempswafalse\fi
+ \null\vfil
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \Huge \bfseries \appendixpagename\par}%
+% \end{macrocode}
+% Add to ToC if requested
+% \begin{macrocode}
+ \if@dotoc@pp
+ \addappheadtotoc
+ \fi
+% \end{macrocode}
+% In the \Lpack{book} class the |\part| command is finished off by calling
+% |\@endpart|. There are two problems with this in this package. (1)
+% |\@endpart| is not defined in \Lpack{article} style classes and (2)
+% it always throws a blank page which does not look good if the \Lopt{openany}
+% option is used. So, code it all up here.
+% \begin{macrocode}
+ \vfil\newpage
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{empty}%
+ \newpage
+ \fi
+ \fi
+ \if@tempswa
+ \twocolumn
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sec@pppage}
+% Copy code from the \Lpack{article} class |\part| command, but use
+% |\appendixpagename| as
+% the title.
+% \begin{macrocode}
+\newcommand{\@sec@pppage}{%
+ \par
+ \addvspace{4ex}%
+ \@afterindentfalse
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \huge \bfseries \appendixpagename%
+ \markboth{}{}\par}%
+% \end{macrocode}
+% Add to ToC if requested
+% \begin{macrocode}
+ \if@dotoc@pp
+ \addappheadtotoc
+ \fi
+ \nobreak
+ \vskip 3ex
+ \@afterheading
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@pptocpage}
+% \begin{macro}{\noappendicestocpagenum}
+% \begin{macro}{\appendicestocpagenum}
+% \begin{macro}{\addappheadtotoc}
+% The |\addappheadtotoc| command adds an `appendices' line to the ToC.
+% The style is the same
+% as used in \Lpack{tocbibind} for the `List of figures' line. That is,
+% as a Chapter heading or a Section heading. |\if@pptocpage| controls
+% whether ot not a page number is put into the ToC.
+% \changes{v1.2}{2002/08/06}{Added \cs{noappendicestocpagenum} and changed
+% \cs{addappheadtotoc}}
+% \begin{macrocode}
+\newif\if@pptocpage
+ \@pptocpagetrue
+\newcommand{\noappendicestocpagenum}{\@pptocpagefalse}
+\newcommand{\appendicestocpagenum}{\@pptocpagetrue}
+\newcommand{\addappheadtotoc}{%
+ \phantomsection
+ \if@chapter@pp
+% \end{macrocode}
+% Chaptered document
+% \begin{macrocode}
+ \if@pptocpage
+ \addcontentsline{toc}{chapter}{\appendixtocname}%
+ \else
+ \if@pphyper
+ \addtocontents{toc}%
+ {\protect\contentsline{chapter}{\appendixtocname}{}{\@currentHref}}%
+ \else
+ \addtocontents{toc}%
+ {\protect\contentsline{chapter}{\appendixtocname}{}}%
+ \fi
+ \fi
+ \else
+% \end{macrocode}
+% Not a chaptered document
+% \begin{macrocode}
+ \if@pptocpage
+ \addcontentsline{toc}{section}{\appendixtocname}%
+ \else
+ \if@pphyper
+ \addtocontents{toc}%
+ {\protect\contentsline{section}{\appendixtocname}{}{\@currentHref}}%
+ \else
+ \addtocontents{toc}%
+ {\protect\contentsline{section}{\appendixtocname}{}}%
+ \fi
+ \fi
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% For my reference,
+% here is the standard version of the |\appendix| macro, but modified for
+% both chaptered and unchaptered documents.
+% \begin{verbatim}
+% \newcommand{\appendix}{\par
+% \if@chapter@pp
+% \setcounter{chapter}{0}%
+% \setcounter{section}{0}%
+% \gdef\@chapapp{\appendixname}%
+% \gdef\thechapter{\@Alph\c@chapter}
+% \else
+% \setcounter{section}{0}%
+% \setcounter{subsection}{0}%
+% \gdef\thesection{\@Alph\c@section}
+% \fi
+% }
+% \end{verbatim}
+%
+% And this equivalently is what the \Lpack{hyperref} package does.
+% \begin{verbatim}
+% \def\Hy@chapterstring{chapter}
+% \def\Hy@appendixstring{appendix}
+% \def\Hy@chapapp{\Hy@chapterstring}
+% \let\Hy@org@appendix\appendix
+% \def\appendix{%
+% \Hy@org@appendix
+% \if@chapter@pp
+% \gdef\theHchapter{\Alph{chapter}}%
+% \else
+% \gdef\theHsection{\Alph{section}}%
+% \fi
+% \xdef\Hy@chapapp{\Hy@appendixstring}%
+% }
+% \end{verbatim}
+%
+% \begin{macro}{\theH@pps}
+% We are going to use |\theH@pps| to disambiguate contents of appendices
+% that might have the same hyperref marks. It is |\provide|d as if
+% the \Lpack{appendix} and \Lpack{hyperref} are in the `wrong' order
+% then somehow \Lpack{hyperref} defines it before \Lpack{appendix}
+% can get to it.
+% \changes{v1.2}{2002/08/06}{Added \cs{theH@pps}}
+% \begin{macrocode}
+\providecommand{\theH@pps}{\alph{@pps}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@resets@pp}
+% Resets the appropriate sectioning counters and names. This does almost
+% exactly
+% what the default |\appendix| command does, except that it saves and
+% restores sectional numbering. It saves the sectional number at the start
+% and restores the appendix number at the end.
+% \changes{v1.1}{2000/02/29}{Added number save/restore to \cs{@reset@pp}}
+% \changes{v1.2}{2002/08/06}{Added hyperref code to \cs{@reset@pp}}
+% \begin{macrocode}
+\newcommand{\@resets@pp}{\par
+ \@ppsavesec
+ \stepcounter{@pps}
+ \setcounter{section}{0}%
+ \if@chapter@pp
+ \setcounter{chapter}{0}%
+ \renewcommand\@chapapp{\appendixname}%
+ \renewcommand\thechapter{\@Alph\c@chapter}%
+ \else
+ \setcounter{subsection}{0}%
+ \renewcommand\thesection{\@Alph\c@section}%
+ \fi
+ \if@pphyper
+% \end{macrocode}
+% Now handle the \Lpack{hyperref} tweaks.
+% \begin{macrocode}
+ \if@chapter@pp
+ \renewcommand{\theHchapter}{\theH@pps.\Alph{chapter}}%
+ \else
+ \renewcommand{\theHsection}{\theH@pps.\Alph{section}}%
+ \fi
+ \def\Hy@chapapp{\appendixname}%
+ \fi
+ \restoreapp
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{appendices}
+% This is the heart of the package. Start it off by doing the resetting
+% done by the |\appendix| command. Then do the simple options before
+% getting into the complications of redefinitions. Remember to take care
+% of an interaction between |\addappheadtotoc| and |\appendixpage|.
+% \changes{v1.1a}{2001/03/15}{Changed implementation of easy options in \texttt{appendices} environment}
+% \begin{macrocode}
+\newenvironment{appendices}{%
+ \@resets@pp
+ \if@dotoc@pp
+ \if@dopage@pp % both page and toc
+ \if@chapter@pp % chapters
+ \clear@ppage
+ \fi
+ \appendixpage
+ \else % toc only
+ \if@chapter@pp % chapters
+ \clear@ppage
+ \fi
+ \addappheadtotoc
+ \fi
+ \else
+ \if@dopage@pp % page only
+ \appendixpage
+ \fi
+ \fi
+% \end{macrocode}
+% There is only one other option applicable to the chapter style, so do
+% it now and clear the way for doing the section style. To implement
+% the \Lopt{titletoc} option, we redefine the |\addcontentsline| command.
+% \begin{macrocode}
+ \if@chapter@pp
+ \if@dotitletoc@pp \@redotocentry@pp{chapter} \fi
+ \else
+% \end{macrocode}
+% The rest of the code is specific to the section style. While we're in the
+% mood we might as well finish off doing the \Lopt{titletoc} option.
+% \begin{macrocode}
+ \if@dotitletoc@pp \@redotocentry@pp{section} \fi
+% \end{macrocode}
+% The next piece of code implements the \Lopt{header} option by providing
+% a special version of |\sectionmark|.
+% \begin{macrocode}
+ \if@dohead@pp
+ \def\sectionmark##1{%
+ \if@twoside
+ \markboth{\@formatsecmark@pp{##1}}{}
+ \else
+ \markright{\@formatsecmark@pp{##1}}{}
+ \fi}
+ \fi
+% \end{macrocode}
+% The next piece of code implements the \Lopt{title} option by doing cunning
+% things with the |\@seccntformat|.\footnote{From a posting to
+% \texttt{comp.tex.tex} by Donald Arseneau on 13 August 1998.}
+% \begin{macrocode}
+ \if@dotitle@pp
+ \def\sectionname{\appendixname}
+ \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }%
+ \csname the##1\endcsname\quad}
+ \fi
+ \fi}{%
+% \end{macrocode}
+% At the end of the environment, save the appendix number and restore the
+% sectional number.
+% \changes{v1.1}{2000/02/29}{Changed end of appendix environment}
+% \begin{macrocode}
+ \@ppsaveapp\@pprestoresec}
+
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\setthesection}
+% \begin{macro}{\setthesubsection}
+% The user commands for specifying the numbering style for subappendices.
+% \changes{v1.1}{2000/02/29}{Added \cs{setthesection} and \cs{setthesubsection} commands}
+% \begin{macrocode}
+\newcommand{\setthesection}{\thechapter.\Alph{section}}
+\newcommand{\setthesubsection}{\thesection.\Alph{subsection}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@resets@ppsub}
+% Similar to |\@resets@pp| except that it is for use within the
+% |subappendices| envirionment; as such, it is a bit simpler.
+% \changes{v1.1}{2000/02/29}{Added \cs{@resets@ppsub} command}
+% \changes{v1.2}{2002/08/07}{Added hyperref code to \cs{@resets@ppsub}}
+% \begin{macrocode}
+\newcommand{\@resets@ppsub}{\par
+ \stepcounter{@pps}
+ \if@chapter@pp
+ \setcounter{section}{0}
+ \renewcommand{\thesection}{\setthesection}
+ \else
+ \setcounter{subsection}{0}
+ \renewcommand{\thesubsection}{\setthesubsection}
+ \fi
+ \if@pphyper
+% \end{macrocode}
+% Now handle the \Lpack{hyperref} tweaks.
+% \begin{macrocode}
+ \if@chapter@pp
+ \renewcommand{\theHsection}{\theH@pps.\setthesection}%
+ \else
+ \renewcommand{\theHsubsection}{\theH@pps.\setthesubsection}%
+ \fi
+ \def\Hy@chapapp{\appendixname}%
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{subappendices}
+% The environment for subappendices. Start it off by doing the resetting
+% of the |\(sub)section| command.
+% \changes{v1.1}{2000/02/29}{Added subappendices environment}
+% \begin{macrocode}
+\newenvironment{subappendices}{%
+ \@resets@ppsub
+% \end{macrocode}
+% There are two options applicable to the chapter style. To implement
+% the \Lopt{titletoc} option, we redefine the |\addcontentsline| command.
+% \begin{macrocode}
+ \if@chapter@pp
+ \if@dotitletoc@pp \@redotocentry@pp{section} \fi
+% \end{macrocode}
+% To implement the \Lopt{title} option we do cunning things with the
+% |\@seccntformat| command.
+% \begin{macrocode}
+ \if@dotitle@pp
+ \def\sectionname{\appendixname}
+ \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }%
+ \csname the##1\endcsname\quad}
+ \fi
+ \else
+% \end{macrocode}
+% The rest of the code is for the section style.
+% \begin{macrocode}
+ \if@dotitletoc@pp \@redotocentry@pp{subsection} \fi
+ \if@dotitle@pp
+ \def\subsectionname{\appendixname}
+ \def\@seccntformat##1{\@ifundefined{##1name}{}{\csname ##1name\endcsname\ }%
+ \csname the##1\endcsname\quad}
+ \fi
+ \fi}{}
+
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@formatsecmark@pp}
+% Formats the page header for a redefined |\sectionmark|.
+% \begin{macrocode}
+\newcommand{\@formatsecmark@pp}[1]{%
+ \MakeUppercase{\appendixname\space
+ \ifnum \c@secnumdepth >\z@
+ \thesection\quad
+ \fi
+ #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@redotocentry@pp}
+% In order to implement the \Lopt{titletoc} option we redefine the
+% |\addcontentsline| command which is used to put entries into the ToC.
+% |\@redotocentry@pp{|\meta{sect}|}| does the redefinition, where \meta{sect}
+% is the name of the sectional heading (i.e., either chapter or section).
+% \changes{v1.2}{2002/08/06}{Replaced ifthen package code in
+% \cs{@redotocentry@pp} by \cs{ifx} code.}
+% \changes{v1.2}{2002/08/06}{HW mods to \cs{@redotocentry@pp}}
+% \begin{macrocode}
+\newcommand{\@redotocentry@pp}[1]{%
+% \end{macrocode}
+% Save the original definition of |\addcontentsline|. Then start the
+% redefinition.
+% \begin{macrocode}
+ \let\oldacl@pp=\addcontentsline
+ \def\addcontentsline##1##2##3{%
+% \end{macrocode}
+% Check if writing to ToC and appropriate section.
+% \begin{macrocode}
+ \def\@pptempa{##1}\def\@pptempb{toc}%
+ \ifx\@pptempa\@pptempb
+% \end{macrocode}
+% Adding to the ToC file, so check on the sectioning command.
+% \begin{macrocode}
+ \def\@pptempa{##2}\def\@pptempb{#1}%
+ \ifx\@pptempa\@pptempb
+% \end{macrocode}
+% The sectioning command is the same as that specified by the argument to
+% |\@redotocentry@pp|, so get on with the redefinition.
+% \begin{macrocode}
+ \oldacl@pp{##1}{##2}{\appendixname\space ##3}%
+ \else
+% \end{macrocode}
+% The heading was different from the argument. No redefinition is required, so
+% call the original |\addcontentsline|.
+% \begin{macrocode}
+ \oldacl@pp{##1}{##2}{##3}%
+ \fi
+ \else
+% \end{macrocode}
+% Adding to a file that is not the ToC. No redefinition is required, so
+% call the original |\addcontentsline|.
+% \begin{macrocode}
+ \oldacl@pp{##1}{##2}{##3}%
+ \fi}
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% The end of this package.
+% \begin{macrocode}
+%</usc>
+% \end{macrocode}
+%
+%
+% \bibliographystyle{alpha}
+%
+% \begin{thebibliography}{GMS94}
+%
+% \bibitem[GMS94]{GOOSSENS94}
+% Michel Goossens, Frank Mittelbach, and Alexander Samarin.
+% \newblock {\em The LaTeX Companion}.
+% \newblock Addison-Wesley Publishing Company, 1994.
+%
+% \bibitem[Wil96]{PRW96i}
+% Peter~R. Wilson.
+% \newblock {\em {LaTeX for standards: The LaTeX package files user manual}}.
+% \newblock NIST Report NISTIR, June 1996.
+%
+% \end{thebibliography}
+%
+%
+% \Finale
+% \PrintIndex
+%
+\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/latex/appendix/appendix.ins b/Master/texmf-dist/source/latex/appendix/appendix.ins
new file mode 100644
index 00000000000..c73434a416d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/appendix/appendix.ins
@@ -0,0 +1,79 @@
+%% appendix.ins
+%% Author: Peter Wilson (CUA) now at peter.r.wilson@boeing.com until June 2004
+%% (or at: pandgwilson at earthlink dot net)
+%% Copyright 1998 --- 2004 Peter R. Wilson
+%%
+%% This work 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 the 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/06/01 or later.
+%%
+%% This work has the LPPL maintenance status "author-maintained".
+%%
+%% This work consists of the files listed in the README file.
+%%
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this work when run through
+%% LaTeX.
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{appendix.ins}
+\input docstrip.tex
+\preamble
+
+-----------------------------------------------------------------
+ Author: Peter Wilson (CUA) now at peter.r.wilson@boeing.com until June 2004
+ (or at: pandgwilson at earthlink dot net)
+ Copyright 1998 --- 2004 Peter R. Wilson
+
+ This work 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 the 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/06/01 or later.
+
+ This work has the LPPL maintenance status "author-maintained".
+
+ This work consists of the files listed in the README file.
+-----------------------------------------------------------------
+
+\endpreamble
+
+\keepsilent
+
+%%% \Msg{*** Generating the driver file ***}
+%%% \generateFile{appendix.drv}{t}{\from{appendix.dtx}{driver}}
+
+\Msg{*** Generating the LaTeX2e package files ***}
+
+\generateFile{appendix.sty}{t}{\from{appendix.dtx}{usc}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file(s) into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space appendix.sty}
+\Msg{*}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{* Process any name.idx file by:}
+\Msg{* \space\space\space\space makeindex -s gind.ist name}
+\Msg{* Process any name.glo file by:}
+\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/babelbib/Makefile b/Master/texmf-dist/source/latex/babelbib/Makefile
new file mode 100644
index 00000000000..a845be3ddf7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/babelbib/Makefile
@@ -0,0 +1,102 @@
+
+SRCDIR=babelbib
+INSTALLDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/tex/latex/babelbib
+DOCDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/doc/latex/babelbib
+BSTDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/bibtex/bst/babelbib
+VERSION=`latex getversion | grep '^VERSION' | sed 's/^VERSION \\(.*\\)\\.\\(.*\\)/\\1_\\2/'`
+
+
+.SUFFIXES: .sty .ins .dtx .ps .pdf
+
+.ins.sty:
+ latex $<
+
+.dtx.pdf:
+ pdflatex $<
+ pdflatex $<
+ makeindex -s gind.ist $(*D)/$(*F)
+ makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
+ pdflatex $<
+
+all: babelbib babelbib.pdf babelbibtest.pdf tugboat-babelbib.pdf
+
+babelbibtest.pdf: babelbibtest.tex babelbibtest.bib babelbib.sty
+ pdflatex babelbibtest
+ bibtex babelbibtest
+ pdflatex babelbibtest
+ pdflatex babelbibtest
+
+babelbib: babelbib.sty
+
+tugboat-babelbib.pdf:
+ if `test -f "tugboat-babelbib.tex"`; then \
+ pdflatex tugboat-babelbib; \
+ bibtex tugboat-babelbib; \
+ pdflatex tugboat-babelbib; \
+ pdflatex tugboat-babelbib; \
+ fi
+
+
+clean:
+ @-rm -f *.glo *.gls *.idx *.ilg *.ind *.toc *.log *.aux *.blg *.bbl
+ @-rm -f *~
+
+distclean: clean
+ @-rm -f babelbib.sty babelbib.pdf babelbib.ps
+ @-rm -f babelbibtest.pdf babelbibtest.ps
+ @-rm -f *.bdf bab*.bst
+ @-rm -f tugboat-babelbib.pdf tugboat-babelbib.bib
+ @-rm -rf texmf/
+
+tar: all clean
+ @echo Lege babelbib-$(VERSION).tar.gz an
+ -rm -f babelbib-$(VERSION).tar.gz
+ tar czCf .. babelbib-$(VERSION).tar.gz \
+ $(SRCDIR)/README \
+ $(SRCDIR)/ChangeLog \
+ $(SRCDIR)/Makefile \
+ $(SRCDIR)/babelbib.dtx \
+ $(SRCDIR)/babelbib.ins \
+ $(SRCDIR)/babelbib.pdf \
+ $(SRCDIR)/babelbibtest.tex \
+ $(SRCDIR)/babelbibtest.bib \
+ $(SRCDIR)/babelbib.xml \
+ $(SRCDIR)/getversion.tex \
+ $(SRCDIR)/tugboat-babelbib.pdf
+ rm -f getversion.log
+
+
+zip: texlive
+ -@rm -f babelbib-$(VERSION).zip
+ zip -r babelbib-$(VERSION).zip texmf
+ rm -rf texmf
+ rm -f getversion.log
+
+
+texlive: all tugboat-babelbib.pdf clean
+ rm -rf texmf
+ mkdir -p texmf/tex/latex/babelbib/
+ mkdir -p texmf/doc/latex/babelbib/
+ mkdir -p texmf/source/latex/babelbib/
+ mkdir -p texmf/bibtex/bst/babelbib/
+ cp *.sty texmf/tex/latex/babelbib/
+ cp babelbib.pdf README ChangeLog babelbibtest.tex texmf/doc/latex/babelbib/
+ cp babelbibtest.bib tugboat-babelbib.pdf texmf/doc/latex/babelbib/
+ cp babelbib.dtx babelbib.ins texmf/source/latex/babelbib/
+ cp Makefile babelbib.xml getversion.tex texmf/source/latex/babelbib/
+ cp *.bst texmf/bibtex/bst/babelbib/
+
+
+install: all
+ if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
+ if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
+ if [ ! -d $(BSTDIR) ]; then mkdirhier $(BSTDIR); fi
+ install -m644 babelbib.sty $(INSTALLDIR)
+ install -m644 *.bdf $(INSTALLDIR)
+ install -m644 *.bst $(BSTDIR)
+ install -m644 babelbib.pdf $(DOCDIR)
+ texhash
+
+
+babelbib.sty: babelbib.ins babelbib.dtx
+
diff --git a/Master/texmf-dist/source/latex/babelbib/babelbib.dtx b/Master/texmf-dist/source/latex/babelbib/babelbib.dtx
new file mode 100644
index 00000000000..ab7715223c9
--- /dev/null
+++ b/Master/texmf-dist/source/latex/babelbib/babelbib.dtx
@@ -0,0 +1,6966 @@
+% \iffalse meta comment
+% File: babelbib.dtx Copyright (C) 2003--2005 Harald Harders
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage[ngerman,english]{babel}
+%\usepackage{url}
+\usepackage{array}
+\usepackage{hyperref}
+\IfFileExists{booktabs.sty}%
+ {\usepackage{booktabs}}%
+ {\let\toprule\hline
+ \let\midrule\hline
+ \let\bottomrule\hline}
+\IfFileExists{babelbib.sty}{\usepackage{babelbib}
+ \let\babelbibSTYfound\active}{\GenericWarning{babelbib.dtx}{Package
+ file babelbib.sty not found (Documentation will be messed up!^^J^^A
+ Generate babelbib.sty by LaTeXing babelbib.ins, process
+ babelbib.dtx again)^^J}\stop}
+\GetFileInfo{babelbib.sty}
+\title{Multilingual bibliographies: The \texttt{babelbib} package}
+\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
+\date{Version \fileversion, \filedate, printed \today}
+\newlength{\tempdima}%
+\makeatletter
+\renewenvironment{table}[1][]{%
+ \@float{table}[#1]%
+ \centering%
+ \setlength{\tempdima}{\abovecaptionskip}%
+ \setlength{\abovecaptionskip}{\belowcaptionskip}%
+ \setlength{\belowcaptionskip}{\tempdima}%
+ }{%
+\end@float
+}
+\makeatother
+\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
+ {$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
+\EnableCrossrefs
+\CodelineIndex
+\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter}
+\DoNotIndex{\setcounter,\space,\",\@empty,\begin,\end,\iffalse,\fi,\extras}
+\DoNotIndex{\bibs,\ifx,\else,\fi,\ ,\ae,\emph,\input}
+\CodelineNumbered
+\RecordChanges
+\CheckSum{7995}
+\hyphenation{bib-lio-gra-phy}
+\begin{document}
+ \DocInput{babelbib.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{0.1}{2003/04/11}{Total new version}%
+% \changes{0.2}{2003/04/20}{Rewritten in main parts}%
+% \changes{0.42}{2003/11/09}{Use unique version strings for all files
+% of the bundle}%
+% \changes{0.42}{2003/11/09}{Reorganise docstrip code}%
+% \changes{0.43}{2004/01/06}{Document the problem using
+% \texttt{frenchle.sty} when using \texttt{french} language with
+% some babel versions}%
+% \changes{0.44}{2004/01/06}{Improved spacings in documentation}%
+% \changes{0.44a}{2004/02/12}{Adapted Makefile for \TeX Live}%
+% \changes{0.46}{2004/06/28}{Enable to switch off printout of language
+% name with \texttt{babamspl} style}%
+% \changes{1.00}{2005/02/16}{Rewritten warning about \texttt{frenchle.sty}
+% package}%
+% \changes{1.00}{2005/02/16}{Shorten version string}%
+% \changes{1.00}{2005/02/16}{Added \texttt{urldate} to all \BibTeX\
+% styles}%
+% \changes{1.01}{2005/04/11}{Added space after the \cs{btx}\ldots\
+% commands in the \texttt{bst} files to avoid line-breaking problem}%
+% \changes{1.02}{2005/04/15}{Language Portuguese completed}%
+% \changes{1.10}{2005/05/24}{Allow different ordering of forenames and
+% lastnames}%
+% \changes{1.10}{2005/05/24}{Protect the \cs{foreignlanguage} calls
+% (avoids problems with natbib)}%
+% \changes{1.11}{2005/06/12}{Avoid some additional line breaks in
+% author and editor names}%
+% \changes{1.11}{2005/06/12}{Switch ISBN and ISSN in bibliographies on
+% and off (does not work for \AmS\ style)}%
+% \changes{1.11}{2005/06/12}{Remove space after \cs{btxurlfont}
+% because a linebreak between \cs{url} and the argument breaks
+% \texttt{hyperref.sty} (which is a pity because this can lead to
+% line-break problems with long arguments)}%
+% \changes{1.12}{2005/06/19}{Correct \cs{btxlanguagenameenglish},
+% \cs{btxmastthesis}, and \cs{btxmonaugshort} in
+% \texttt{french.bdf}}%
+% \changes{1.13}{2005/06/27}{Apply corrections to and complete Italian
+% language}%
+% \changes{1.14}{2005/07/11}{Complete and correct catalan}%
+%
+% \maketitle
+% \begin{abstract}
+% \noindent
+% This package enables to generate multilingual bibliographies in
+% cooperation with |babel|.
+% Two approaches are possible:
+% Each citation may be written in another language, or the whole
+% bibliography can be typeset in a language chosen by the user.
+%
+% In addition, the package supports commands to change the typography
+% of the bibliographies.
+%
+% The current version supports Afrikaans, Catalan, Danish, Dutch,
+% English, Esperanto, Finnish, French,\footnote{Babelbib does not work
+% with \texttt{frenchle} prior V5,987. Please update the frenchle
+% package or use the native babel support for French, instead.}
+% German, Italian, Norwegian, Portuguese, Spanish, and Swedish.
+% Please help me to add more languages.
+%
+% Many of the standard and extended bibliography styles are available.
+% Please read section~\ref{sec:styles}.
+%
+% \textbf{If you have used version 0.1 of this package:
+% The mechanism to change fonts have changed, please read
+% section~\ref{sec:typography}.}
+%
+% Have a look to \texttt{tugboat-babelbib.pdf} which includes detailed
+% descriptions how to use and extend the babelbib bundle.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section*{Copyright}
+% Copyright 2003--2005 Harald Harders.
+%
+% 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.
+%
+% \section{Introduction}
+%
+% This package is a replacement for |bibgerm.sty| \cite{germbib} with the
+% aim to be extendable to other languages more easily.
+% In addition, |babelbib| provides a more flexible typography of
+% bibliographies without the need to change |bst| files.
+% But there are two shortcomings: This package needs
+% |babel.sty|~\cite{babel} (thus, it does not work with |german.sty|
+% or |ngerman.sty|), and it is written for \LaTeXe\ and does not work
+% with plain \TeX.
+%
+% The current version supports Afrikaans, Danish, Dutch, English,
+% Esperanto, Finnish, French,\footnote{Babelbib does not work with
+% \texttt{frenchle} prior V5,987. Please update the frenchle package
+% or use the native babel support for French, instead.}
+% German, Italian, Norwegian, Portuguese, Spanish, and Swedish.
+%
+% If you have used version 0.1 of this package:
+% The mechanism to change fonts have changed, please read
+% section~\ref{sec:typography}.
+%
+% \section{Usage}%
+% \label{sec:usage}%
+%
+% To use this package place
+% \begin{verbatim}
+%\usepackage{babelbib}\end{verbatim}
+% into the preamble of your document.
+% The package loads all necessary language definitions for all files
+% it knows that are loaded by |babel|.
+%
+% By default, the language of the bibliographic keywords (``editor'',
+% ``page'', etc.) switches for each item to the language of the cited
+% document.
+% If all citations shall be written in the same language, add the
+% option\index{fixlanguage=\texttt{fixlanguage}|usage} |fixlanguage|
+% to the package call.
+% Then, all bibliographies are typeset in the document's main
+% language.
+% To change the bibliography's language, use
+% \DescribeMacro{\selectbiblanguage}
+% |\selectbiblanguage{|$\langle$language$\rangle$|}|.
+% This command only has an effect, if |fixlanguage| is set.
+%
+% |babelbib| supports the \BibTeX\ styles |babplain|, |babplai3|,
+% |babalpha|, |babunsrt|, |bababbrv|, and |bababbr3| that correspond
+% to the standard |bst| files, but include international support as
+% well as flexible typography.\footnote{The versions with the
+% \texttt{3} in the filenames replace the second and later authors by
+% \emph{et al.}, if more than three authors are given.}
+% As usual, you select the style using
+% \DescribeMacro{\bibliographystyle}
+% |\bibliographystyle{|$\langle$filename$\rangle$|}|.
+% In addition, the package supports the \BibTeX\ style |babamspl|
+% which corresponds to |amsplain| by the \AmS.
+% \changes{0.2}{2003/04/20}{Added option \texttt{languagenames} to
+% define commands for language names}%
+% \index{languagenames=\texttt{languagenames}|usage}%
+% If you want to use this style, you have to add the option
+% |languagenames| to the call of the package.
+%
+% \DescribeMacro{\declarebtxcommands}%
+% If you don't like some of the keywords provided by |babelbib|, or if
+% you want to use new ones, you are able to get these using the
+% command \cs{declarebtxcommands}.
+% It takes two arguments, where the first is the language for which
+% you want to add or change keywords, and the second is the list of
+% command definitions.
+% It seems to be best to show that for an example.
+% You may want to change the definitions for Ph.D.\ theses for English
+% and German with new orthography (the defaults are ``PhD thesis'' resp.\
+% \foreignlanguage{ngerman}{"`Dissertation"'}).
+% You can reach a change by the following code:
+% \begin{verbatim}
+%\declarebtxcommands{english}{%
+% \def\btxphdthesis#1{\protect\foreignlanguage{english}{Ph.D.\ thesis}}%
+%}
+%\declarebtxcommands{ngerman}{%
+% \def\btxphdthesis#1{\protect\foreignlanguage{ngerman}{Doktorarbeit}}%
+%}\end{verbatim}
+% You may change more than one command in one |\setbtxcommand|
+% command.
+% You just have to add more of the |\def|\ldots\ lines.
+% But please don't forget the percent sign at the end of the lines in
+% order to avoid unwanted spaces in the output.
+% The \AmS\ \BibTeX\ style |amsplain| uses ``Ph.D.\ thesis'' instead
+% of the default ``PhD thesis'' for |babamspl|.
+% If you want the same keyword as in the \AmS\ original, you can use
+% the |\declarebtxcommands| line shown above.
+%
+% \section{Preparing the \texttt{bib} files}
+%
+% In order to use the feature of multilingual bibliographies, add the
+% field |language| to every entry in your |bib| files.
+% This field gives the language of the cited document, e.\,g.
+% \begin{verbatim}
+%@InBook{dieter1997a,
+% editor = {Dieter, George~E. and others},
+% title = {Materials Selection and Design},
+% chapter = {Effects of Composition, Processing, and Structure on
+% Properties of Engineering Plastics},
+% publisher = {ASM International},
+% year = 1997,
+% volume = 20,
+% series = {ASM Handbook},
+% pages = {434--456},
+% language = {english},
+% isbn = {0-87170-386-6}
+%}\end{verbatim}
+% Then, the output of the document data (title, authors, series, etc.)
+% is typeset with correct hyphenation patterns.
+% Wheather also the keywords (``edition'', ``pages'', etc.) are
+% switched to the citation language, depends on wheather |fixlanguage|
+% has been used.
+% All languages that appear in the bibliography have to be loaded by
+% |babel|.
+%
+% \DescribeMacro{\setbtxfallbacklanguage}
+% If the field |language| is missing, the citation is typeset using a
+% fall-back language.
+% By default, the document's main language (that one that is active at
+% \cs{begin\{document\}}) is used.
+% You can change the fall-back language by using
+% \cs{setbtxfallbacklanguage\marg{language}}, e.\,g.,
+% \begin{verbatim}
+%\setbtxfallbacklanguage{ngerman}\end{verbatim}
+%
+% |babelbib| supports four additional fields:
+% |ISBN|, |ISSN|, |URL|, and |URLDATE|.
+% |ISBN| and |ISSN| take the ISBN or ISSN respectively.
+% |URL| is the address of a WWW page while |URLDATE| is the date when
+% the WWW page has been visited.
+% The field |URL| is typeset using the command |\url| if available,
+% e.\,g., if the user has loaded |url.sty|.
+% Otherwise, |babelbib| defines a |\url| command which just calls
+% |\texttt|.
+%
+% \DescribeMacro{\biblanguage}%
+% If you want to use language-dependent commands as \cs{alsoname} in a
+% bibliography that was produced with |fixlanguage| you will be
+% surprised that the commands change the output depending on the
+% language of the citation.
+% If you want to write a field with the keyword language, you can use
+% the command \cs{biblanguage}, e.g.,
+% \begin{verbatim}
+%@Article{abinger1988a,
+% author = {Abinger, R. and Hammer, F. and Leopold, J. and others},
+% title = {Gro"sschaden an einem 300"=MW"=Dampfturbosatz},
+% journal = {Der Maschinenschaden},
+% year = 1988,
+% volume = 61,
+% number = 2,
+% pages = {58--60},
+% language = {ngerman},
+% note = {\biblanguage{\alsoname~\cite{abinger1990a}}}
+%}\end{verbatim}
+% This will give the note ``\alsoname~[\ldots]'' instead of
+% ``{\selectlanguage{ngerman}\alsoname~[\ldots]}'' when the
+% bibliography uses English keywords.
+%
+%
+% \section{Available bibliography styles}%
+% \label{sec:styles}%
+%
+% The |babelbib| bundle contains adapted versions of the standard
+% bibliography styles |plain|, |unsrt|, |abbrv|, and |alpha|.
+% They are called |babplain|, |babunsrt|, |bababbrv|, and |babalpha|,
+% respectively.
+% All variants write names in a special manner when more than one
+% author is given.
+% The first author ist written ``Lastname, Forename'' while all other
+% authors are written ``Forename Lastname''.
+% This is done to emphesize the ordering by the lastname.
+%
+% If you don't want this behaviour you can use additional variants
+% that use the same notation for all names.
+% By appending |-fl| to the style name, e.\,g., |babalpha-fl|, all names
+% are written ``Forename Lastname''.
+% By appending |-lf|, e.\,g., |babalpha-lf|, all names are written
+% ``Lastname, Forename''.
+%
+% The style |babamspl| is the |babelbib| equivalent to |amsplain|.
+%
+%
+% \section{Customisation of the bibliography's typography}
+% \label{sec:typography}%
+%
+% In constrast to the standard and |germbib| |bst| files, the
+% appearance of the different data types is not fixed for |bab*.bst|.
+% There are commands for some data fields that determine the used
+% font.
+%
+% \DescribeMacro{\setbibliographyfont}%
+% You can change some font specifications in the bibliography using
+% the command
+% \cs{setbibliographyfont\{\textrm{\meta{element}}\}\{\textrm{\meta{font command}}\}},
+% where \meta{element} is a typographic element, listed in
+% table~\ref{tab:elements}.
+% \begin{table}[tp]
+% \centering
+% \caption{Default values for the fonts in bibliographies.
+% If no value is given, the standard font (normally upright roman)
+% is used.}
+% \label{tab:elements}
+% \begin{tabular}{llll}
+% \toprule
+% Element& Data types& \multicolumn{2}{c}{Default value for
+% \BibTeX\ style} \\
+% && |bababbrv|, |babalpha|& |babamspl| \\
+% && |babplain|, |babunsrt|& \\
+% \midrule
+% name& Authors, editors& & \\
+% lastname& Lastnames of Authors, editors& & \\
+% title& All kinds of titles& \cs{emph}& \cs{emph}\\
+% etal& ``\emph{et al.}''& \cs{emph}& \\
+% journal& Journal title& & \\
+% volume& Volume (journal)& & \cs{textbf} \\
+% ISBN& ISBN& \cs{MakeUppercase}& \cs{MakeUppercase} \\
+% ISSN& ISSN& \cs{MakeUppercase}& \cs{MakeUppercase} \\
+% url& URL& \cs{url}& \cs{url} \\
+% urldate& visiting date of URL& & \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+% \meta{font command} is a command that takes one argument, e.\,g.\
+% |\textbf|, |\emph|, or |\textsc|.
+% If no suitable command is available, you have to define one, first.
+% For example, you can get a bold italic font as follows:
+% \begin{verbatim}
+%\newcommand\textitbf[1]{{\bfseries\itshape #1\/}}%
+%\setbibliographyfont{title}{\textitbf}%\end{verbatim}
+% As it can be seen in this example, the argument of the used font
+% command mustn't be specified in |\setbibliographyfont|.
+%
+% The \meta{element} |name| changes the whole name of the author,
+% including forename and lastname.
+% If |lastname| is also specified, it changes the lastname within the
+% font for the name.
+% For example,
+% \begin{verbatim}
+%\setbibliographyfont{name}{\emph}
+%\setbibliographyfont{lastname}{\MakeUppercase}\end{verbatim}
+% leads to |\emph{Harald \MakeUppercase{Harders}}| resp.\
+% ``\emph{Harald \MakeUppercase{Harders}}''.
+%
+% The font definition for |urldate| can also be used not to change the
+% font but to provide a command that writes the date in the correct
+% language, e.\,g., using the |isodate| package:
+% \begin{verbatim}
+%\usepackage[short]{isodate}
+%\setbibliographyfont{urldate}{\printdate}\end{verbatim}
+%
+% \DescribeMacro{\btxISBN}%
+% \DescribeMacro{\btxISSN}%
+% There are two additional commands, \cs{btxISBN} and \cs{btxISSN}.
+% They generate the strings ``ISBN'' and ``ISSN'' in bibliographies.
+% By default, they do it without a change of the font.
+% For example, if using oldstyle digits, it could be worth to change
+% them e.\,g.\ to
+% \begin{verbatim}
+%\renewcommand\btxISBN{\textsc{isbn}}
+%\renewcommand\btxISSN{\textsc{issn}}\end{verbatim}
+%
+% \DescribeMacro{\btxprintISBN}%
+% \DescribeMacro{\btxprintISSN}%
+% By default, the ISBN resp.\ ISSN is printed if present in the data
+% base.
+% You can switch this behaviour off by using \cs{btxprintISBN\{false\}}
+% resp.\ \cs{btxprintISSN\{false\}}.
+% Similarly, printing is switched on by \cs{btxprintISBN\{true\}}
+% resp.\ \cs{btxprintISSN\{true\}}.
+% This, however, only works for the "`standard"' styles, i.\,e., not for
+% the \AmS\ style |babamspl|.
+%
+% If you are using |babamspl|, the language names of the citations are
+% printed by default, as the original \AmS\ style does it.
+% You can avoid this by adding following line to your preamble:
+% \begin{verbatim}
+%\newcommand\btxprintamslanguage[1]{}\end{verbatim}
+%
+%
+% \section{How to add new languages}
+%
+% The language definitions are placed in special files with the
+% extension |.bdf|.
+% If you want to add a new language to the |babelbib| system, you
+% should copy one of the existing |bdf| files and change the new
+% file.
+%
+% Since |babelbib.sty| contains a list of known languages, it will not
+% find the new language definition file, automatically.
+% Then, you can give the name of the new file without extension as an
+% option when loading |babelbib|.
+% For example, to load |mylang.bdf|, you have to load the package as
+% follows:
+% \begin{verbatim}
+%\usepackage[mylang]{babelbib}\end{verbatim}
+%
+% If you have developed a new |bdf| file, please send it to
+% |h.harders@tu-bs.de|.
+% Then, I will add it to the |babelbib| system.
+%
+% \section{Problems and Incompatibilities}
+%
+% \begin{itemize}
+% \item Babelbib does not work together with old versions of the
+% |frenchle| package prior V5,987.
+% Please update the frenchle package or use the native babel support
+% for the French language, instead.
+% \end{itemize}
+%
+% \section{To Do}
+%
+% \begin{itemize}
+% \item Add more languages.
+% \item Complete Dutch.
+% \item Add the possibility to switch off ISBN and ISSN to |babasmpl|.
+% \end{itemize}
+%
+%
+% \section*{Acknowledgements}
+%
+% Danie Els, \url{dnjels@sun.ac.za} (Afrikaans);
+% Taneli Huuskonen, \url{huuskone@cc.helsinki.fi} (Esperanto, Finnish);
+% V\'\i ctor Lua\~na, \url{victor@fluor.quimica.uniovi.es} (Spanish);
+% Hans Fredrik Nordhaug, \url{hansfn@mi.uib.no} (Norwegian, Swedish);
+% Robert Fuster, \url{rfuster@imm.upv.es} (Catalan);
+% Markus Kohm, \url{komascript@gmx.info} (Different schemes for writing names);
+% Matthias D. Eisner, \url{matthias.eisner@ethz.ch} (protect
+% \cs{foreignlanguage} calls);
+% Daniel Winkelmann, \url{daniel.winkelmann@club-internet.fr}
+% (idea for different formatting of forenames and lastnames);
+% Jan Steffan, \url{me@jansteffan.de} (\cs{setbtxfallbacklanguage});
+% Philip Ratcliffe, \url{philip.ratcliffe@email.it} (corrections for
+% Italian); Angel Tsankov, \url{bigman@abv.bg} (bugfix with
+% \cs{bbbb\meta{\cs{CurrentOption}}loaded}).
+%
+%
+%\begin{thebibliography}{1}
+% \providebibliographyfont{name}{}%
+% \providebibliographyfont{title}{\emph}%
+% \providebibliographyfont{etal}{\emph}%
+% \providebibliographyfont{volume}{}%
+% \providebibliographyfont{ISBN}{\MakeUppercase}%
+% \providebibliographyfont{ISSN}{\MakeUppercase}%
+% \providebibliographyfont{url}{\url}%
+%
+%\selectlanguage{\english}
+%\bibitem{babel}
+%\btxnamefont{Braams, Johannes}: \btxtitlefont{Babel, a multilingual package
+% for use with \LaTeX's standard document classes}, 2002.
+%\newblock \btxurlfont{CTAN:macros/latex/required/babel/}.
+%
+%\selectlanguage{\english}
+%\bibitem{germbib}
+%\btxnamefont{Wallmeier, M.}, A.~Scherer\btxandcomma{} \btxandlong{}\
+% \btxnamefont{H.~Harders}: \btxtitlefont{Macros for german {\BibTeX}ing},
+% 2000.
+%\newblock \btxurlfont{CTAN:biblio/bibtex/contrib/germbib/}.
+%
+%\end{thebibliography}
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+%
+% \section{The implementation}
+%
+% Source lines that look like \texttt{$\langle$*...$\rangle$} or
+% \texttt{$\langle$/...$\rangle$} where \texttt{...} is arbitrary text
+% are not written into the output files.
+% If a source line starts with \texttt{$\langle$...$\rangle$}, this
+% part of the line is omitted.
+%
+% \subsection{Headings of the files}
+%
+% Heading of the package and the other files:
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[1998/06/01]
+\ProvidesPackage{babelbib}
+%</package>
+% \end{macrocode}
+% File heads of the |bdf| files:
+% \begin{macrocode}
+%<afrikaans>%% Language definitions for Afrikaans by
+%<afrikaans>%% Danie Els, dnjels@sun.ac.za
+%<afrikaans>\ProvidesFile{afrikaans.bdf}
+%<catalan>%% Language definitions for Catalan by
+%<catalan>%% Robert Fuster, rfuster@imm.upv.es
+%<catalan>\ProvidesFile{catalan.bdf}
+%<danish>\ProvidesFile{danish.bdf}
+%<dutch>\ProvidesFile{dutch.bdf}
+%<english>\ProvidesFile{english.bdf}
+%<esperanto>%% Language definitions for Esperanto by
+%<esperanto>%% Taneli Huuskonen, huuskone@cc.helsinki.fi
+%<esperanto>\ProvidesFile{esperanto.bdf}
+%<portuguese>%% Language definitions for Portuguese by
+%<portuguese>%% Jos\'e Carlos Santos, jcsantos@fc.up.pt
+%<portuguese>\ProvidesFile{portuguese.bdf}
+%<finnish>%% Language definitions for Finnish by
+%<finnish>%% Taneli Huuskonen, huuskone@cc.helsinki.fi
+%<finnish>\ProvidesFile{finnish.bdf}
+%<french>\ProvidesFile{french.bdf}
+%<german>\ProvidesFile{german.bdf}
+%<italian>\ProvidesFile{italian.bdf}
+%<norsk>%% Language definitions for Norwegian by
+%<norsk>%% Hans Fredrik Nordhaug <hansfn@mi.uib.no>
+%<norsk>\ProvidesFile{norsk.bdf}
+%<spanish>%% Language definitions for spanish by
+%<spanish>%% V{\'\i}ctor Lua{\~n}a, victor@fluor.quimica.uniovi.es
+%<spanish>\ProvidesFile{spanish.bdf}
+%<swedish>%% Language definitions for Swedish by
+%<swedish>%% Hans Fredrik Nordhaug <hansfn@mi.uib.no>
+%<swedish>\ProvidesFile{swedish.bdf}
+% \end{macrocode}
+% Version information unique for all generated files:
+% \begin{macrocode}
+%<latex> [2005/09/01 v1.15 babelbib: multilingual bibliographies (HH)]
+%<bst>%% 2005/09/01 v1.15 babelbib: multilingual bibliographies (HH)
+% \end{macrocode}
+%
+% \subsection{The package itself}
+%
+% \index{fixlanguage=\texttt{fixlanguage}|main}%
+% Define an option which fixes the language in the bibliography to the
+% main language of the document.
+% \begin{macrocode}
+%<*package>
+\newif\ifbbbbfixlanguage
+\DeclareOption{fixlanguage}{\bbbbfixlanguagetrue}
+% \end{macrocode}
+% \changes{0.2}{2003/04/20}{Added option \texttt{languagenames} to
+% define commands for language names}%
+% \index{languagenames=\texttt{languagenames}|main}%
+% If this option is used, generate the commands
+% \cs{btxlanguagename}\meta{language} that save how languages are
+% called in other languages, e.\,g. in German, French is called
+% \foreignlanguage{ngerman}{"`französisch"'}.
+% \begin{macrocode}
+\newif\ifbbbblanguagenames
+\DeclareOption{languagenames}{\bbbblanguagenamestrue}
+% \end{macrocode}
+% If additional options are given, try to load these as
+% languages. This is implemented in order to be able to use a new
+% language that is not yet supported by the official |babelbib|.
+% \changes{1.15}{2005/09/01}{Small bug fix in loading language files}%
+% \begin{macrocode}
+\DeclareOption*{%
+ \InputIfFileExists{\CurrentOption.bdf}{%
+ \expandafter\def\csname bbbb\CurrentOption loaded\endcsname{\@empty}%
+ }{%
+ \PackageError{babelbib}{%
+ Language definition file \CurrentOption.bdf not found}{%
+ Maybe you misspelled the language option?}%
+ }%
+}
+% \end{macrocode}
+% Process the given options.
+% \begin{macrocode}
+\ProcessOptions*
+% \end{macrocode}
+% \begin{macro}{\bbbbifundefined}
+% Define a replacement for \cs{@ifundefined} that does not define the
+% command it is tested for as side effect.
+% This command has been taken from a news posting by Markus Kohm
+% (|markus.kohm@gmx.de|).
+% \begin{macrocode}
+\newcommand*{\bbbbifundefined}[1]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\@firstoftwo
+ \else
+ \expandafter\@secondoftwo
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bbbbaddto}
+% Adds the command named |\bibs#2| to the command |\extras#1|, if this
+% command is defined before, where |#1| and |#2| are the arguments of
+% |\bbbbaddto|. For internal use only.
+% \changes{0.32}{2003/05/06}{Changed \cs{bbbbaddto} in order to allow
+% different commands to be added to \cs{extras}\meta{language}}%
+% \begin{macrocode}
+\newcommand\bbbbaddto[2]{%
+% \end{macrocode}
+% Test wheather |\extras#1| is defined.
+% \begin{macrocode}
+ \expandafter\bbbbifundefined{extras#1}{}{%
+% \end{macrocode}
+% Call |babel|'s command to append |\bibs#1| to |\extras#1|.
+% \begin{macrocode}
+ \expandafter\addto\expandafter{\csname extras#1\endcsname}{%
+ \csname #2\endcsname}%
+ \typeout{babelbib extension \@backslashchar #2 added to
+ \string\extras #1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\inputbdf}
+% Input the file |#2.bdf| if babel has loaded the language |#1|.
+% For internal use only.
+% \begin{macrocode}
+\newcommand\inputbdf[2]{%
+% \end{macrocode}
+% \changes{0.43}{2004/01/05}{Test on \cs{date}\meta{language} instead on
+% \cs{l@}\meta{language} (caused problems with \TeX Live)}%
+% Test wheather |\date#1| is defined which is the case if the language
+% |#1| has been loaded.
+% \begin{macrocode}
+ \bbbbifundefined{date#1}{}{%
+% \end{macrocode}
+% Input |#2.bdf|.
+% \begin{macrocode}
+ \@ifundefined{bbbb#2loaded}{%
+ \expandafter\def\csname bbbb#2loaded\endcsname{\@empty}%
+ \input{#2.bdf}%
+ }{}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\selectbiblanguage}
+% \changes{0.3}{2003/04/21}{Handling of usage before or after
+% \texttt{begin\{document\}} added}%
+% Define |\selectbiblanguage| which explicitly selects the language
+% for the bibliography. This is only useful when the option
+% |fixlanguage| is used.
+% Otherwise the command produces a warning and does nothing else.
+%
+% Since all the language dependent macros are not know before
+% |\begin{document}|, the command |\selectbiblanguage| has to wait
+% until there, before doing any action.
+% Because after |\begin{document}|, it can do the action immediately,
+% |\selectbiblanguge| has to be redefined there.
+% \begin{macrocode}
+\ifbbbbfixlanguage
+% \end{macrocode}
+% Define the |\selectlanguage| command for usage before
+% |\begin{document}|.
+% \begin{macrocode}
+ \newcommand\selectbiblanguage[1]{%
+ \AtBeginDocument{\@selectbiblanguage{#1}}%
+ }
+% \end{macrocode}
+% Redefine it at |\begin{document}|.
+% \begin{macrocode}
+ \AtBeginDocument{%
+ \renewcommand\selectbiblanguage[1]{\@selectbiblanguage{#1}}%
+ }
+% \end{macrocode}
+% Define the ``real'' command that does the action.
+% It tests wheather |\bibs#1| and |\extras#1| are known and produces
+% error messages if not.
+% If everything is okay, change the bibliography language.
+% \begin{macrocode}
+ \newcommand\@selectbiblanguage[1]{%
+ \bbbbifundefined{bibs#1}{%
+ \bbbbifundefined{date#1}{%
+ \PackageError{babelbib}{Language #1 in bibliography not loaded
+ by babel}{%
+ The language #1 hasn't been loaded by babel.
+ Add it to the\MessageBreak
+ options of the \string\usepackage{babel} command or to the
+ global options.}%
+ }{%
+ \PackageError{babelbib}{Language #1 in bibliography unknown by
+ babelbib}{%
+ There are no definitions for #1 available in the
+ current\MessageBreak
+ version of babelbib. Please contact h.harders@tu-bs.de.}%
+ }%
+ }{%
+ \typeout{babelbib: Set language for keywords in the bibliography fixed to #1}%
+ \csname bibs#1\endcsname
+ }%
+ }
+\else
+ \newcommand\selectbiblanguage[1]{%
+ \PackageWarning{babelbib}{Command \string\selectbiblanguage\space
+ used without package\MessageBreak
+ option fixlanguage. Ignored}%
+ }
+ \AtBeginDocument{%
+ \typeout{babelbib: Use citation-dependent languages in bibliography}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxselectlanguage}
+% \changes{0.2}{2003/04/20}{Added}%
+% Define |\selectbiblanguage| which selects a language and complains
+% if babelbib does not know about this language.
+% For internal use, only.
+% \begin{macrocode}
+\newcommand\btxselectlanguage[1]{%
+ \bbbbifundefined{bibs#1}{%
+ \bbbbifundefined{date#1}{%
+ \PackageError{babelbib}{Language #1 in bibliography not loaded
+ by babel}{%
+ The language #1 hasn't been loaded by babel.
+ Add it to the\MessageBreak
+ options of the \string\usepackage{babel} command or to the
+ global options.}%
+ }{%
+ \ifbbbbfixlanguage
+ \PackageWarning{babelbib}{Language #1 in bibliography
+ unknown\MessageBreak
+ by babelbib. Hyphenation will be\MessageBreak
+ incorrect}%
+ \else
+ \PackageError{babelbib}{Language #1 in bibliography unknown by
+ babelbib}{%
+ There are no definitions for #1 available in the
+ current\MessageBreak
+ version of babelbib. Please contact h.harders@tu-bs.de.}%
+ \fi
+ }%
+ }{%
+ \selectlanguage{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\biblanguage}
+% \changes{1.15}{2005/09/01}{Add \cs{biblanguage} that switches to the
+% keyword language within a field}%
+% Define \cs{biblanguage} which switches to the keyword language
+% within a field.
+% \begin{macrocode}
+\newcommand\biblanguage[1]{{%
+ \expandafter\selectlanguage\expandafter{\biblanguagename}#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxlanguagename}
+% \changes{0.2}{2003/04/20}{Added}%
+% Define |\btxlanguagename| which typesets the name of the language
+% given in the argument, spoken in the current active language.
+% \begin{macrocode}
+\newcommand\btxlanguagename[1]{%
+ \bbbbifundefined{btxlanguagename#1}{%
+ \PackageError{babelbib}{Languagename for #1 not
+ defined\MessageBreak
+ in \languagename\space language}{%
+ Either you have forgotten to specify the option `languagenames'
+ when loading\MessageBreak
+ babelbib, or the command \string\bibs\languagename\space does
+ not contain a definition\MessageBreak
+ for the command \string\btxlanguagename#1.
+ In the latter case, please\MessageBreak
+ contact h.harders@tu-bs.de.}%
+ #1%
+ }{%
+ \@nameuse{btxlanguagename#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\setbtxfallbacklanguage}
+% \changes{1.12}{2005/06/19}{Add the command \cs{setbtxfallbacklanguage}
+% to force a fall-back language}%
+% \begin{macrocode}
+\newcommand*\setbtxfallbacklanguage[1]{%
+ \edef\btxfallbacklanguage{#1}%
+ \typeout{babelbib: Set bibliography fall-back language to
+ \btxfallbacklanguage}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxfallbacklanguage}
+% \changes{0.40}{2003/09/26}{Add the command \cs{btxfallbacklanguage}
+% for items without given language}%
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{btxfallbacklanguage}{%
+ \edef\btxfallbacklanguage{\languagename}%
+ \typeout{babelbib: Set bibliography fall-back language to
+ \btxfallbacklanguage}%
+ }{%
+ \typeout{babelbib: Bibliography fall-back language unchanged
+ (\btxfallbacklanguage)}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\declarebtxcommands}
+% \changes{0.3}{2003/04/21}{Added}%
+% Declare |\declarebtxcommands| which adds or replaces one or more of the
+% |\Btx| or |\btx| commands defined in a \cs{bibs}\meta{language}
+% command.
+% The first argument gives the language for which the commands shall
+% be added or changed.
+% The second argument includes the definitions of the commands.
+% For an example, see section~\ref{sec:usage}.
+% \begin{macrocode}
+\newcommand*\declarebtxcommands[2]{%
+ \AtBeginDocument{%
+ \typeout{babelbib: Add a command to \string\bibs#1}%
+ \expandafter\g@addto@macro\csname bibs#1\endcsname{#2}%
+ \ifbbbbfixlanguage
+ \selectbiblanguage{\biblanguagename}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% This command may only be used in the preamble.
+% \begin{macrocode}
+\@onlypreamble\declarebtxcommands
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxifchangecaseon}
+% \begin{macro}{\btxifchangecaseoff}
+% \changes{0.32}{2003/05/06}{Move change of case from bst to sty}%
+% The bst files write titles twice, first with changed case and second
+% with preserved case.
+% The macros \cs{btxifchangecaseon} and \cs{btxifchangecaseoff}
+% typeset one of these versions.
+% The languages append one of these commands to the
+% \cs{extras}\meta{language} commands.
+% \begin{macrocode}
+\newcommand*\btxifchangecaseon{%
+ \def\btxifchangecase{\@firstoftwo}%
+}%
+\newcommand*\btxifchangecaseoff{%
+ \def\btxifchangecase{\@secondoftwo}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\setbibliographyfont}
+% \changes{0.2}{2003/04/20}{Don't change the font commands directly
+% but use this command}%
+% Define |\setbibliographyfont| and |\setbibliographyfont*| that set
+% the font declared by the first argument |#1| to the second argument
+% |#2|.
+% The second argument has to be a macro with one argument, like
+% |\textbf|, |\emph|, |\textsc|, etc.
+% The normal version generates an error, if the internal command
+% |\btx#1font| is not defined.
+% The star version doesn't.
+% error.
+% \begin{macrocode}
+\newcommand\setbibliographyfont{%
+ \@ifnextchar*{\@@setbibliographyfont}{\@setbibliographyfont}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@setbibliographyfont}
+% \begin{macrocode}
+\newcommand\@setbibliographyfont[2]{%
+ \bbbbifundefined{btx#1font}{%
+ \PackageError{babelbib}{Bibliography font `#1' can't be set}{%
+ You have tried to define a font for the bibliographic element
+ \MessageBreak
+ `#1', which is unknown to babelbib}%
+ }{%
+ \expandafter\renewcommand\csname btx#1font\endcsname{#2}%
+ \typeout{babelbib: Bibliography font for `#1' changed.}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@setbibliographyfont}
+% The first argument is the |*| and ignored.
+% \begin{macrocode}
+\newcommand\@@setbibliographyfont[3]{%
+ \bbbbifundefined{btx#2font}{%
+ \expandafter\newcommand\csname btx#2font\endcsname{#3}%
+ \typeout{babelbib: Bibliography font for `#2' newly defined.}%
+ }{%
+ \expandafter\renewcommand\csname btx#2font\endcsname{#3}%
+ \typeout{babelbib: Bibliography font for `#2' changed.}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\providebibliographyfont}
+% \changes{0.2}{2003/04/20}{Added}%
+% Define |\providebibliographyfont| and |\providebibliographyfont*|
+% that do the same as |\setbibliographyfont| and
+% |\setbibliographyfont*|, but only, if |\setbibliographyfont| has not
+% been used for |#1|, before.
+% It is similar to |\providecommmand| which only defines that command
+% if it is undefined, before.
+% This command is intended to be used by the \BibTeX\ style, but can
+% also be used by the user.
+% \begin{macrocode}
+\newcommand\providebibliographyfont{%
+ \@ifnextchar*{\@@providebibliographyfont}{\@providebibliographyfont}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@providebibliographyfont}
+% \begin{macrocode}
+\newcommand\@providebibliographyfont[2]{%
+ \bbbbifundefined{btx#1font}{%
+ \PackageError{babelbib}{Bibliography font `#1' can't be set}{%
+ You have tried to define a font for the bibliographic element
+ \MessageBreak
+ `#1', which is unknown to babelbib}%
+ }{%
+ \expandafter\ifx\csname btx#1font\endcsname\@empty
+ \expandafter\renewcommand\csname btx#1font\endcsname{#2}%
+ \typeout{babelbib: Using the BibTeX style's default font for `#1'.}%
+ \else
+ \typeout{babelbib: Using user changed font for `#1'.}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@setbibliographyfont}
+% The first argument is the |*| and ignored.
+% \begin{macrocode}
+\newcommand\@@providebibliographyfont[3]{%
+ \bbbbifundefined{btx#2font}{%
+ \expandafter\newcommand\csname btx#2font\endcsname{#3}%
+ \typeout{babelbib: Using the BibTeX style's default font for `#2'.}%
+ }{%
+ \expandafter\ifx\csname btx#2font\endcsname\@empty
+ \expandafter\renewcommand\csname btx#2font\endcsname{#3}%
+ \typeout{babelbib: Using the BibTeX style's default font for `#2'.}%
+ \else
+ \typeout{babelbib: Using user changed font for `#2'.}%
+ \fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxnamefont}
+% \changes{0.32}{2003/05/06}{Add new font for journal names}%
+% \changes{1.12}{2005/06/19}{Add new font \cs{btxlastname} for last
+% names}%
+% Define the dummy commands for available fonts
+% \begin{macrocode}
+\newcommand*\btxnamefont{}
+\let\btxnamefont=\@empty
+\newcommand*\btxlastnamefont{}
+\let\btxlastnamefont=\@empty
+\newcommand\btxtitlefont{}
+\let\btxtitlefont=\@empty
+\newcommand\btxetalfont{}
+\let\btxetalfont=\@empty
+\newcommand\btxjournalfont{}
+\let\btxjournalfont=\@empty
+\newcommand\btxvolumefont{}
+\let\btxvolumefont=\@empty
+\newcommand\btxISBNfont{}
+\let\btxISBNfont=\@empty
+\newcommand\btxISSNfont{}
+\let\btxISSNfont=\@empty
+\newcommand\btxurlfont{}
+\let\btxurlfont=\@empty
+\newcommand\btxurldatefont{}
+\let\btxurldatefont=\@empty
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxauthorcolon}
+% \changes{0.2}{2003/04/20}{Added}%
+% Define |\btxauthorcolon| which defines the characters typeset after
+% the authors, if they are written before the title.
+% By default, it is a ``:''.
+% \begin{macrocode}
+\newcommand\btxauthorcolon{:}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxISBN}
+% Define |\btxISBN| which outputs "`ISBN"' in a bibliography.
+% For example, it could be defined to |\textsc{isbn}| when old style
+% digits are used.
+% \begin{macrocode}
+\newcommand\btxISBN{ISBN}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\btxISSN}
+% Define |\btxISSN| which outputs "`ISSN"' in a bibliography.
+% For example, it could be defined to |\textsc{issn}| when old style
+% digits are used.
+% \begin{macrocode}
+\newcommand\btxISSN{ISSN}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ifbtxprintISBN}
+% \begin{macro}{\ifbtxprintISSN}
+% These commands are used by the bibliography styles to typeset the
+% ISBN or ISSN only if wanted.
+% \begin{macrocode}
+\DeclareRobustCommand\ifbtxprintISBN[1]{\ifbtx@printISBN #1\fi}
+\DeclareRobustCommand\ifbtxprintISSN[1]{\ifbtx@printISSN #1\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\btxprintISBN}
+% \begin{macro}{\btxprintISSN}
+% These macros are used to switch on or off printing of ISBN resp.\
+% ISSN.
+% Valid arguments are |true| and |false|.
+% \begin{macrocode}
+\newcommand*\btxprintISBN[1]{\csname btx@printISBN#1\endcsname}
+\newcommand*\btxprintISSN[1]{\csname btx@printISSN#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\ifbtx@printISBN}
+% \begin{macro}{\ifbtx@printISSN}
+% The booleans that store the necessary information.
+% \begin{macrocode}
+\newif\ifbtx@printISBN
+\newif\ifbtx@printISSN
+\btxprintISBN{true}
+\btxprintISSN{true}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\url}
+% \changes{0.40}{2003/09/26}{If no \cs{url} command is defined,
+% produce an error}%
+% \changes{0.2}{2003/04/20}{Added, if not available by another
+% package}%
+% Define |\url| which, by default, is used for URLs. Only necessary if
+% not provided by another package, e.\,g.\ |url.sty|.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \providecommand\url[1]{%
+ \PackageError{babelbib}{No \string\url\space command defined but
+ field URL used\MessageBreak
+ in bibliography}{%
+ Please define a \string\url\space command for printing URLs
+ before \string\begin{document}, e.\,g.\MessageBreak
+ by loading the package `url.sty'.}%
+ \texttt{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+% Perform the following commands at |\begin{document}| in order to be
+% sure to do that after loading |babel|.
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% Load |babel| if that has not been done, yet.
+% \begin{macrocode}
+ \RequirePackage{babel}
+% \end{macrocode}
+% Input all know languages that babel has also loaded, before.
+% \changes{0.2}{2003/04/20}{Removed Italian from the list of
+% automatically found languages, since it is not complete, yet}%
+% \changes{0.31}{2003/05/01}{Added Italian to the list of automatically
+% found languages, again}%
+% \changes{0.34}{2003/07/28}{Added Afrikaans}%
+% \changes{0.41}{2003/11/03}{Added Norwegian (by Hans Fredrik Nordhaug)}%
+% \changes{1.00}{2005/02/16}{Renamed franceis to francais}%
+% \begin{macrocode}
+ \inputbdf{afrikaans}{afrikaans}
+ \inputbdf{american}{english}
+ \inputbdf{austrian}{german}
+ \inputbdf{brazil}{portuguese}
+ \inputbdf{brazilian}{portuguese}
+ \inputbdf{british}{english}
+ \inputbdf{canadian}{english}
+ \inputbdf{canadien}{french}
+ \inputbdf{catalan}{catalan}
+ \inputbdf{danish}{danish}
+ \inputbdf{dutch}{dutch}
+ \inputbdf{english}{english}
+ \inputbdf{esperanto}{esperanto}
+ \inputbdf{finnish}{finnish}
+ \inputbdf{francais}{french}
+ \inputbdf{french}{french}
+ \inputbdf{frenchb}{french}
+ \inputbdf{german}{german}
+ \inputbdf{germanb}{german}
+ \inputbdf{italian}{italian}
+ \inputbdf{norsk}{norsk}
+ \inputbdf{mexican}{spanish}
+ \inputbdf{naustrian}{german}
+ \inputbdf{ngerman}{german}
+ \inputbdf{portuges}{portuguese}
+ \inputbdf{portuguese}{portuguese}
+ \inputbdf{spanish}{spanish}
+ \inputbdf{swedish}{swedish}
+ \inputbdf{UKenglish}{english}
+ \inputbdf{USenglish}{english}
+% \end{macrocode}
+% Call |\bibs#1|, where |#1| stands for the main language of the
+% document, to activate the additional bibliographic commands.
+% \begin{macrocode}
+ \ifbbbbfixlanguage
+ \typeout{babelbib: Load BibTeX extensions
+ \string\bibs\bbl@main@language\space for \bbl@main@language}%
+ \selectbiblanguage{\bbl@main@language}%
+ \else
+ \expandafter\selectlanguage\expandafter{\bbl@main@language}%
+ \fi
+}
+%</package>
+% \end{macrocode}
+%
+% \subsection{The language definitions}
+%
+% \subsubsection{German}
+% \begin{macrocode}
+%<*german>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsgerman}
+% Define |\bibsgerman| which itself defines all necessary expressions
+% used in bibliographies that differ in different languages.
+% This command is used for all German dialects.
+%
+% Since the language of the keywords may differ from the language of
+% the bibliography item, the keyword language is set for each keyword.
+% Because this command is also used for dialects, it has an optional
+% argument which is set to the dialect.
+% \begin{macrocode}
+\newcommand\bibsgerman[1][german]{%
+% \end{macrocode}
+% Define the command |\biblanguagename| that always returns the name
+% of the current language for bibliographies.
+% \begin{macrocode}
+ \def\biblanguagename{#1}%
+% \end{macrocode}
+% First, define all commands for usage within a sentence (which
+% normally start with a lowercase letter, if they aren't a noun).
+% These commands start with a lowercase letter.
+%
+% Many commands have an argument. This may be used by the bib\TeX\
+% styles to append a dot after abbreviations, e.\,g.\
+% |\btxetalshort{.}|.
+% \begin{macrocode}
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{und}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{und}}%
+% \end{macrocode}
+% The command |\btxandcomma| contains a ``,'' if a comma is added
+% before the ``and'' in a list of more than two items.
+% For German, this is not the case.
+% \begin{macrocode}
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in:}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in:}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{d.\ Reihe}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{der Reihe}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{Hrsg##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{Herausgeber}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{Hrsg##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{Herausgeber}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{Bd##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{Band}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{Nr##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{Nummer}}%
+% \end{macrocode}
+% Avoid the ligature in
+% \foreignlanguage{ngerman}{"`Auf"|lage"'} in the same way, |babel|
+% does it.
+% This is a change in the behaviour to the |germbib| package.
+% In \foreignlanguage{ngerman}{"`Aufl"'} the ligature is still
+% used since this is done in abbreviations.
+% \begin{macrocode}
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{Aufl##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{%
+ Auf\penalty10000\discretionary{-}{}{\kern.03em}%
+ \allowhyphens lage}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{Kap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{Kapitel}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{Seite}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{Seiten}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Diplomarbeit}}%
+% \end{macrocode}
+% Use \foreignlanguage{ngerman}{"`Dissertation"'} instead of
+% \foreignlanguage{ngerman}{"`Doktorarbeit"'} for PhD theses.
+% This is a change in the behaviour to the |germbib| package.
+% \begin{macrocode}
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{Dissertation}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Techn.\ Ber##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Technischer Bericht}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januar}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februar}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{M\"arz}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Mai}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{August}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{Dezember}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{M\"arz}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Mai}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dez##1{}}}%
+% \end{macrocode}
+% Then, define all commands for usage at the begin of a sentence
+% (which start with an uppercase letter).
+% These commands start with an uppercase letter.
+% Since, in German, many nouns are the same in the middle and at the
+% start of a sentence, the |\Btx| variants just call the |\btx|
+% variant.
+% \begin{macrocode}
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{In:}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{In:}}%
+ \def\Btxeditorshort{\btxeditorshort}%
+ \def\Btxeditorlong{\btxeditorlong}%
+ \def\Btxeditorsshort{\btxeditorsshort}%
+ \def\Btxeditorslong{\btxeditorslong}%
+ \def\Btxvolumeshort{\btxvolumeshort}%
+ \def\Btxvolumelong{\btxvolumelong}%
+ \def\Btxnumbershort{\btxnumbershort}%
+ \def\Btxnumberlong{\btxnumberlong}%
+ \def\Btxeditionshort{\btxeditionshort}%
+ \def\Btxeditionlong{\btxeditionlong}%
+ \def\Btxchaptershort{\btxchaptershort}%
+ \def\Btxchapterlong{\btxchapterlong}%
+ \def\Btxpageshort{\btxpageshort}%
+ \def\Btxpagelong{\btxpagelong}%
+ \def\Btxpagesshort{\btxpagesshort}%
+ \def\Btxpageslong{\btxpageslong}%
+ \def\Btxtechrepshort{\btxtechrepshort}%
+ \def\Btxtechreplong{\btxtechreplong}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{besucht:}}%
+% \end{macrocode}
+% A command that just puts some user defined text in the language of
+% the keywords.
+% \begin{macrocode}
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+% \end{macrocode}
+% \changes{0.2}{2003/04/20}{Added language names}%
+% Names of all known languages in the current language.
+% For example, used by |babamspl.bst|.
+% \begin{macrocode}
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{englisch}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{deutsch}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugiesisch}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugiesisch}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{englisch}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgarisch}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{englisch}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franz\"osisch}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalanisch}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroatisch}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tschechisch}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{d\"anisch}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{niederl\"andisch}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{englisch}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finnisch}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{franz\"osisch}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franz\"osisch}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franz\"osisch}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{deutsch}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{deutsch}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{griechisch}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebr\"aisch}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{ungarisch}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{isl\"andisch}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irisch}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italienisch}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{lateinisch}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{deutsch}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{deutsch}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norwegisch}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{neunorwegisch}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polnisch}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugiesisch}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugiesisch}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russisch}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{schottisch}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbisch}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spanisch}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{schwedisch}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{t\"urkisch}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{englisch}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{englisch}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bibsgermanb}
+% Do the same for the language ``germanb''. Since there is no
+% difference, just call |\bibsgerman|.
+% \begin{macrocode}
+\newcommand\bibsgermanb{\bibsgerman}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bibsngerman}
+% Do the same for German with new ortography. Call |\bibsgerman| with
+% new hyphenation patterns.
+% \begin{macrocode}
+\newcommand\bibsngerman[1][ngerman]{\bibsgerman[#1]}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bibsaustrian}
+% Once again. Austrians use \foreignlanguage{ngerman}{"`J\"anner"'}
+% instead of \foreignlanguage{ngerman}{"`Januar"'}. Thus, redefine the
+% corresponding command.
+% \begin{macrocode}
+\newcommand\bibsaustrian[1][austrian]{%
+ \bibsgerman[#1]%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{J\"anner}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{J\"an##1{}}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bibsnaustrian}
+% New Austrian is the same as Austrian.
+% \begin{macrocode}
+\newcommand\bibsnaustrian[1][naustrian]{%
+ \bibsngerman[#1]%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{J\"anner}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{J\"an##1{}}}%
+}
+% \end{macrocode}
+% \end{macro}
+% The rest has to be executed after loading |babel.sty|, because the
+% |\extra...| commands have to be defined for all used languages.
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% If the language is fixed, do nothing.
+% \begin{macrocode}
+ \ifbbbbfixlanguage
+ \else
+% \end{macrocode}
+% Append the corresponding |\#2| command to each used language,
+% namely |\extras#1|.
+% \begin{macrocode}
+ \bbbbaddto{austrian}{bibsaustrian}
+ \bbbbaddto{german}{bibsgerman}
+ \bbbbaddto{germanb}{bibsgermanb}
+ \bbbbaddto{naustrian}{bibsnaustrian}
+ \bbbbaddto{ngerman}{bibsngerman}
+ \fi
+% \end{macrocode}
+% \changes{0.32}{2003/05/06}{Move change of case from bst to sty}%
+% Switch off the change of case in titles for all German dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{austrian}{btxifchangecaseoff}
+ \bbbbaddto{german}{btxifchangecaseoff}
+ \bbbbaddto{germanb}{btxifchangecaseoff}
+ \bbbbaddto{naustrian}{btxifchangecaseoff}
+ \bbbbaddto{ngerman}{btxifchangecaseoff}
+}
+%</german>
+% \end{macrocode}
+%
+% \subsubsection{English}
+% \begin{macrocode}
+%<*english>
+% \end{macrocode}
+%
+% The language definition for English is mostly the same as the German
+% one. Therefore, it is not described in detail, again.
+%
+% \begin{macro}{\bibsenglish}
+% \changes{1.00}{2005/02/16}{Handle package \texttt{frenchpro}}%
+% |french.sty| already defines \cs{bibsenglish}.
+% In this case it has to be redefined, otherwise newly defined.
+% \begin{macrocode}
+\makeatletter
+\@ifpackageloaded{french}{}{\newcommand\bibsenglish{}}
+\makeatother
+% \end{macrocode}
+% \changes{0.2}{2003/04/20}{Changed some abbreviations}%
+% Bibliographic commands for English.
+% \begin{macrocode}
+\renewcommand\bibsenglish[1][english]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{and}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{and}}%
+ \def\btxandcomma##1{,}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{of}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{of}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{editor}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{eds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{editors}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volume}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{no##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{number}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{edition}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{ch##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{chapter}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{page}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pp##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{pages}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Master's thesis}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{PhD thesis}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Techn.\ rep##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Technical report}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{January}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{February}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{March}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{May}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{June}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{July}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{August}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{October}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{December}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{May}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{June}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{July}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sept##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Oct##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Editor}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Eds##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Editors}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{No##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Number}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Edition}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Ch##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Chapter}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Page}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pp##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pages}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tech.\ Rep##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Technical Report}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{visited on}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+% \end{macrocode}
+% \changes{0.2}{2003/04/20}{Added language names}%
+% Names of all known languages in the current language.
+% \begin{macrocode}
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{english}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portuguese}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portuguese}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{english}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgarian}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{english}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{french}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catalan}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croatian}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{czech}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{danish}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{dutch}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{english}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finnish}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{french}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{french}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{french}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{greek}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebrew}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{hungarian}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{icelandic}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irish}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italian}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latin}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norwegian}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{new-norwegian}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polish}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portuguese}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portuguese}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russian}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{scottish}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbian}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spanish}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{swedish}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turkish}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{english}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{english}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Copy the commands to the other languages.
+% \begin{macrocode}
+\newcommand\bibsamerican{\bibsenglish[american]}
+\newcommand\bibsbritish{\bibsenglish[british]}
+\newcommand\bibscanadian{\bibsenglish[canadian]}
+\newcommand\bibsUKenglish{\bibsenglish[UKenglish]}
+\newcommand\bibsUSenglish{\bibsenglish[USenglish]}
+% \end{macrocode}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{american}{bibsamerican}
+ \bbbbaddto{british}{bibsbritish}
+ \bbbbaddto{canadian}{bibscanadian}
+ \bbbbaddto{english}{bibsenglish}
+ \bbbbaddto{UKenglish}{bibsUKenglish}
+ \bbbbaddto{USenglish}{bibsUSenglish}
+ \fi
+% \end{macrocode}
+% \changes{0.32}{2003/05/06}{Move change of case from bst to sty}%
+% Switch on the change of case in titles for all English dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{american}{btxifchangecaseon}
+ \bbbbaddto{british}{btxifchangecaseon}
+ \bbbbaddto{canadian}{btxifchangecaseon}
+ \bbbbaddto{english}{btxifchangecaseon}
+ \bbbbaddto{UKenglish}{btxifchangecaseon}
+ \bbbbaddto{USenglish}{btxifchangecaseon}
+}
+%</english>
+% \end{macrocode}
+%
+% \subsubsection{Italian}
+% \begin{macrocode}
+%<*italian>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsitalian}
+% Bibliographic commands for Italian.
+% \changes{0.33}{2003/05/22}{Changed some Italian keywords according
+% to the custom-bib file italian.mbs}%
+% \begin{macrocode}
+\newcommand\bibsitalian[1][italian]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{e}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{e}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{della serie}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{nella serie}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{della serie}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{nella serie}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{cur##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{curatore}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{cur##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{curatori}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volume}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{no##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{numero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{edizione}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{cap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{capitolo}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{pagina}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pp##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{pagine}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{tesi di laurea}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{tesi di dottorato}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Rapp.\ Tecnico}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Rapporto Tecnico}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{gennaio}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{febbraio}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{marzo}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{aprile}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{maggio}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{giugno}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{luglio}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{agosto}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{settembre}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{ottobre}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{novembre}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{dicembre}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{gen##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{mag##1{}}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{giu##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{lug##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{ago##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{set##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{ott##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{dic##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{Nel}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{Nel}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Editore}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Editori}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{No##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Numero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Edizione}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Cap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Capitolo}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Pagina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pp##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pagine}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Rap.\ Tecnico}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Rapporto Tecnico}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{accesso a}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+% \end{macrocode}
+% \changes{0.2}{2003/04/20}{Added placeholders for language names}%
+% \changes{0.31}{2003/05/01}{Added some language names for Italian}%
+% Names of all known languages in the current language.
+% \begin{macrocode}
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{inglese}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{tedesco}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portoghese}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portoghese}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{inglese}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgaro}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{inglese}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{francese}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catalano}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croato}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{ceco}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{danese}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{olandese}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{inglese}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finlandese}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{francese}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{francese}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{francese}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{tedesco}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{tedesco}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{greco}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{ebreo}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{ungherese}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islandese}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irlandese}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italiano}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latino}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{tedesco}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{tedesco}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norvegese}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nuovo norvegese}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polacco}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portoghese}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portoghese}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russo}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{scozzese}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbo}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spagnolo}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{svedese}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turco}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{inglese}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{inglese}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{italian}{bibsitalian}
+ \fi
+% \end{macrocode}
+% \changes{0.32}{2003/05/06}{Move change of case from bst to sty}%
+% Switch off the change of case in titles for Italian by
+% appending \cs{btxifchangecaseoff} to \cs{extrasitalian}.
+% \begin{macrocode}
+ \bbbbaddto{italian}{btxifchangecaseoff}
+}
+%</italian>
+% \end{macrocode}
+%
+% \subsubsection{Norwegian}
+% \begin{macrocode}
+%<*norsk>
+% \end{macrocode}
+%
+% The language definition for Norwegian was provided by Hans Fredrik
+% Nordhaug.
+%
+% \begin{macro}{\bibsnorsk}
+% Bibliographic commands for Norsk.
+% \begin{macrocode}
+\newcommand\bibsnorsk[1][norsk]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{og}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{og}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{av}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{av}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redakt\o r}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redakt\o rer}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{bd##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{bind}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{nr##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nummer}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{utg##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{utgave}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{kap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{kapittel}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{side}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{sider}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Masteroppgave}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{PhD-avhandling}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{tekn.\ rap##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{teknisk rapport}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januar}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februar}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Mars}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Mai}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{August}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{Desember}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Mai}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Des##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redakt\o r}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redakt\o rer}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Bd##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Bind}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{Nr##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nummer}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Utg##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Utgave}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Kap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Kapittel}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Side}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Sider}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ rap##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Teknisk rapport}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{sjekket:}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+% \end{macrocode}
+% Names of all known languages in the current language.
+% \begin{macrocode}
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgarsk}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalansk}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroatisk}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tsjekkisk}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dansk}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{nederlandsk}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finsk}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{gr\ae sk}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebraisk}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{ungarsk}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islandsk}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irsk}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italiensk}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latinsk}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norsk}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nynorsk}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polsk}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russisk}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{skotsk}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbisk}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spansk}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{svensk}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{tyrkisk}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \fi
+}
+\newcommand\bibsnorwegian{\bibsnorsk}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{norsk}{bibsnorsk}
+ \fi
+% \end{macrocode}
+% Switch off the change of case in titles for Norsk by
+% appending \cs{btxifchangecaseoff} to \cs{extrasnorsk}.
+% \begin{macrocode}
+ \bbbbaddto{norsk}{btxifchangecaseoff}
+}
+%</norsk>
+% \end{macrocode}
+%
+% \subsubsection{French}
+% \changes{0.32}{2003/05/06}{Added French language}%
+% \begin{macrocode}
+%<*french>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsfrench}
+% \changes{1.00}{2005/02/16}{Handle package \texttt{frenchpro}}%
+% |french.sty| already defines \cs{bibsfrench}.
+% In this case it has to be redefined, otherwise newly defined.
+% \begin{macrocode}
+\makeatletter
+\@ifpackageloaded{french}{}{\newcommand\bibsfrench{}}
+\makeatother
+% \end{macrocode}
+% Bibliographic commands for French.
+% \begin{macrocode}
+\renewcommand\bibsfrench[1][french]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{et}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{et}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{dans}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{dans}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{dans}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{dans}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{r\'ed##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{r\'edacteur}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{r\'eds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{r\'edacteurs}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{t##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{tome}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ n\textsuperscript{o}\kern.2em\relax{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{num\'ero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{\'ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{\'edition}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{chap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{chapitre}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{page}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{pages}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{M\'emoire de ma\^itrise}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{Th\`ese de doctorat}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{rap.\ tech##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{rapport technique}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{janvier}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{f\'evrier}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{mars}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{avril}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{mai}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{juin}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{juillet}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{ao\^ut}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{septembre}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{octobre}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{novembre}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{d\'ecembre}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{f\'ev##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{avr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{mai}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{juin}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{juil##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{ao\^ut}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{sept##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{oct##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{d\'ec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{Dans}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{Dans}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{R\'ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{R\'edacteur}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{R\'eds##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{R\'edacteurs}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{T##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Tome}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ N\textsuperscript{o}\kern.2em\relax}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Num\'ero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{\'Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{\'Edition}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Chap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Chapitre}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Page}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pages}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Rap. tech##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Rapport technique}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{visit\'e le}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+% \end{macrocode}
+% Names of all known languages in the current language.
+% \begin{macrocode}
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{anglais}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{allemand}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugais}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugais}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{anglais}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgare}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{anglais}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{fran\c{c}ais}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catalan}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croate}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tch\`eque}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{danois}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{n\'eerlandais}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{anglais}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finnois}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{fran\c{c}ais}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{fran\c{c}ais}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{fran\c{c}ais}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{allemand}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{allemand}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{grec}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{h\'ebreu}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{hongrois}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islandais}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irlandais}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italien}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latin}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{allemand}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{allemand}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norv\'egien}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nouveau
+ norv\'egien}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polonais}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugais}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugais}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russe}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{\'ecossais}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbe}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{espagnol}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{su\'edois}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turc}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{anglais}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{anglais}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Copy the commands to the other languages.
+% \begin{macrocode}
+\newcommand\bibsfrancais{\bibsfrench[francais]}
+\newcommand\bibsfrenchb{\bibsfrench[frenchb]}
+\newcommand\bibscanadien{\bibsfrench[canadien]}
+% \end{macrocode}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{francais}{bibsfrancais}
+ \bbbbaddto{french}{bibsfrench}
+ \bbbbaddto{frenchb}{bibsfrenchb}
+ \bbbbaddto{canadien}{bibscanadien}
+ \fi
+% \end{macrocode}
+% Switch on the change of case in titles for all French dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{francais}{btxifchangecaseoff}
+ \bbbbaddto{french}{btxifchangecaseoff}
+ \bbbbaddto{frenchb}{btxifchangecaseoff}
+ \bbbbaddto{canadien}{btxifchangecaseoff}
+}
+% \end{macrocode}
+% \changes{0.43}{2004/01/06}{Warn if using \texttt{french} language}%
+% \changes{0.44}{2004/01/06}{Only warn if babel version is too old}%
+% \changes{1.00}{2005/02/16}{Remove warning for old babel package with
+% \texttt{french} language}%
+% \begin{macrocode}
+%</french>
+% \end{macrocode}
+%
+% \subsubsection{Spanish}
+% \changes{0.33}{2003/05/22}{Added Spanish language}%
+% \begin{macrocode}
+%<*spanish>
+% \end{macrocode}
+%
+% The language definition for Spanish was provided by V{\'\i}ctor
+% Lua{\~n}a and slightly changed by me according to |spanish.mbs|
+% (custom-bib package).
+%
+% \begin{macro}{\bibsspanish}
+% Bibliographic commands for Spanish.
+% \begin{macrocode}
+\newcommand\bibsspanish[1][spanish]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{y~cols##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{y~colaboradores}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{y}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{y}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{editor}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{eds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{editores}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volumen}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ n\textsuperscript{\underline{o}}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{n\'umero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{edici{\'o}n}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{cap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{cap{\'\i}tulo}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p\'ag##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{p\'agina}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{p\'ags##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{p\'aginas}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Tesis de Licenciatura}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{Tesis de Doctorado}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Informe t\'ecnico##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Informe t\'ecnico}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Enero}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Febrero}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Marzo}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{Abril}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Mayo}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Junio}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Julio}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{Agosto}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{Septiembre}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Octubre}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{Noviembre}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{Deciembre}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Ene##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Abr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{May}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Ago##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Oct##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dic##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{En}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{En}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Editor}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Editores}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volumen}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ N\textsuperscript{\underline{o}}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{N\'umero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Edici\'on}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Cap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Cap\'\itulo}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P\'ag##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{P\'agina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{P\'ags##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{P\'aginas}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Informe t\'ecnico}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Informe t\'ecnico}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{visitado el}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{alem\'an}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugu\'es}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugu\'es}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{b\'ulgaro}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franc\'es}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catalan}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croata}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{checo}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dan\'es}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{holand\'es}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finland\'es}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{franc\'es}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franc\'es}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franc\'es}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{alem\'an}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{alem\'an}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{griego}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebreo}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{h\'ungaro}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{island\'es}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irland\'es}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italiano}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{lat\'\i n}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{alem\'an}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{alem\'an}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{noruego}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{noruego}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polaco}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugu\'es}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugu\'es}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{ruso}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{escoc\'es}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbio}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{espa\~nol}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{sueco}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turco}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{ingl\'es}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Copy the commands to the other languages.
+% \begin{macrocode}
+\newcommand\bibsmexican[1][mexican]{%
+ \bibsspanish[mexican]%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Tesis de Maestr{\'\i}a}}%
+}
+% \end{macrocode}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{spanish}{bibsspanish}
+ \bbbbaddto{mexican}{bibsmexican}
+ \fi
+ \bbbbaddto{spanish}{btxifchangecaseoff}
+ \bbbbaddto{mexican}{btxifchangecaseoff}
+}
+%</spanish>
+% \end{macrocode}
+%
+% \subsubsection{Danish}
+% \changes{0.33}{2003/05/22}{Added Danish language}%
+% \begin{macrocode}
+%<*danish>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsdanish}
+% Bibliographic commands for Danish.
+% \begin{macrocode}
+\newcommand\bibsdanish[1][danish]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{og}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{og}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{af}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{af}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redakt\o r}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redakt\o rer}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{bd##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{bind}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{nr##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nummer}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{udg##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{udgave}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{kap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{kapitel}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{side}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pp##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{sider}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Speciale}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{ph.d.-afhandling}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ rap##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Teknisk rapport}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januar}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februar}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Marts}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Maj}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{August}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{December}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Maj}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redakt\o r}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redakt\o rer}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Bd##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Bind}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{Nr##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nummer}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Udg##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Udgave}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Kap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Kapitel}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Side}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pp##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Sider}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ rap##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Teknisk rapport}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{bes\o gt den}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgarsk}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalansk}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroatisk}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tjekkisk}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dansk}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{nederlandsk}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finsk}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{fransk}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{gr\ae sk}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebraisk}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{ungarsk}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islandsk}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irsk}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italiensk}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latinsk}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{tysk}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norsk}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nynorsk}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polsk}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugisisk}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russisk}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{skotsk}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbisk}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spansk}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{svensk}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{tyrkisk}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{engelsk}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{danish}{bibsdanish}
+ \fi
+ \bbbbaddto{danish}{btxifchangecaseoff}
+}
+%</danish>
+% \end{macrocode}
+%
+% \subsubsection{Finnish}
+% \changes{0.45}{2004/04/21}{Added Finnish language}%
+% \begin{macrocode}
+%<*finnish>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsfinnish}
+% Bibliographic commands for Finnish.
+% \begin{macrocode}
+\newcommand\bibsfinnish[1][finnish]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{ja}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{ja}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{teoksessa}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{teoksessa}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{sarjassa}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{sarjassa}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{sarjassa}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{sarjassa}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{toim##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{toimittaja}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{toim##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{toimittajat}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{nide}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{nide}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{nro##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{numero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{painos}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{l##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{luku}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{sivu}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{ss##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{sivut}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Pro Gradu -ty\"o}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{v\"ait\"oskirja}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{tekn.\ rap##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{tekninen raportti}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{tammikuu}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{helmikuu}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{maaliskuu}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{huhtikuu}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{toukokuu}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{kes\"akuu}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{hein\"akuu}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{elokuu}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{syyskuu}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{lokakuu}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{marraskuu}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{joulukuu}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{tam##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{hel##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{maa##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{huh##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{tou##1{}}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{kes##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{hei##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{elo##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{syy##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{lok##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{mar##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{jou##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{Teoksessa}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{Teoksessa}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Toim##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Toimittaja}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Toim##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Toimittajat}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Nide##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Nide}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{Nro##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Numero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Painos}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{L##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Luku}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{S##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Sivu}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Ss##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Sivut}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ rap##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Tekninen raportti}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{vierailtu}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{englanti}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{saksa}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugali}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugali}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{englanti}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgaria}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{englanti}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{ranska}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalaani}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroaati}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tsekki}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{tanska}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{hollanti}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{englanti}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{suomi}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{ranska}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{ranska}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{ranska}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{saksa}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{saksa}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{kreikka}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{heprea}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{unkari}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islanti}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{iiri}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italia}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latina}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{saksa}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{saksa}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norja}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{uusnorja}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{puola}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugali}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugali}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{ven\"j\"a}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{skotti}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbi}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{espanja}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{ruotsi}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turkki}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{englanti}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{englanti}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{finnish}{bibsfinnish}
+ \fi
+% \end{macrocode}
+% Switch off the change of case in titles by appending
+% \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{finnish}{btxifchangecaseoff}
+}
+%</finnish>
+% \end{macrocode}
+%
+% \subsubsection{Esperanto}
+% \changes{0.45}{2004/04/21}{Added Esperanto language}%
+% \begin{macrocode}
+%<*esperanto>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsesperanto}
+% Bibliographic commands for Esperanto.
+% \begin{macrocode}
+\newcommand\bibsesperanto[1][esperanto]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{k~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{kaj~aliaj}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{k}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{kaj}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redaktoro}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{red-oj##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redaktoroj}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volumo}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{no##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nombro}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{redakcio}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{\^c##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{\^capitro}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{pa\^go}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pp##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{pa\^goj}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{magistra disertacio}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{doktora disertacio}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ rap##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Teknika raporto}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januaro}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februaro}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Marco}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{Aprilo}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Majo}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Junio}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Julio}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{A\u{u}gusto}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{Septembro}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktobro}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{Novembro}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{Decembro}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Maj##1{}}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sept##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{En}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{En}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redaktoro}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redaktoroj}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volumo}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{No##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nombro}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Redakcio}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{\^C##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{\^Capitro}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Pa\^go}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pp##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pa\^goj}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tekn.\ Rap##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Teknika Raporto}}%
+% \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{??}}%
+ \def\btxurldatecomment##1{\PackageError{babelbib}{Comment for
+ urldate in Esperanto undefined. Please send the translation for
+ 'visited on' to harald.harders@tu-bs.de}{}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{angla}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{germana}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugala}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugala}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{angla}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgara}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{angla}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franca}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalana}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroata}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{\^ce\^ha}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dana}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{nederlanda}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{angla}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finna}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{franca}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franca}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franca}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{germana}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{germana}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{greka}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebrea}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{hungara}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{islanda}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irlanda}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{itala}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latino}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{germana}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{germana}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norvega}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nov-norvega}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{pola}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugala}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugala}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{rusa}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{skota}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serba}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{hispana}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{sveda}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turka}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{angla}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{angla}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{esperanto}{bibsesperanto}
+ \fi
+% \end{macrocode}
+% Switch off the change of case in titles by appending
+% \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{esperanto}{btxifchangecaseoff}
+}
+%</esperanto>
+% \end{macrocode}
+%
+% \subsubsection{Portuguese}
+% \changes{0.33}{2003/05/22}{Added Portuguese language}%
+% \changes{1.02}{2005/04/15}{Language Portuguese completed}%
+% \changes{1.10}{2005/04/24}{Bug in Portuguese removed}%
+% \begin{macrocode}
+%<*portuguese>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsportuguese}
+% Bibliographic commands for Portuguese.
+% \begin{macrocode}
+\newcommand\bibsportuguese[1][portuguese]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{e}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{e}}%
+ \def\btxandcomma##1{,}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{editor}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{eds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{editores}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volume}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ n\textsuperscript{\underline{o}}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{n\'umero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{edi\c c\~ao}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{cap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{cap\'\i tulo}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p\'ag##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{p\'agina}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{p\'ags##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{p\'aginas}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Tese de Mestrado}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{Tese de Doutoramento}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Rel.\ T\'ec##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Relat\'orio T\'ecnico}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{janeiro}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{fevereiro}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{mar\c co}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{abril}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{maio}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{junho}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{julho}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{agosto}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{setembro}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{outubro}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{novembro}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{dezembro}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{fev##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{mar##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{maio}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{ago##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{set##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{out##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{dez##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Editor}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Eds##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Editores}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{%
+ N\textsuperscript{\underline{o}}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{N\'umero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Edi\c c\~ao}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Cap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Cap\'{\i}tulo}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P\'ag##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{P\'agina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{P\'ags##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{P\'aginas}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Rel.\ T\'ec##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Relat\'orio T\'ecnico}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{acedido em}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{alem\~ao}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugu\^es}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugu\^es}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{b\'ulgaro}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franc\^es}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catal\~ao}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croata}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{checo}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dinamarqu\^es}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{holand\^es}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finland\^es}}%
+ \def\btxlanguagenamefranceis{\protect\foreignlanguage{#1}{franc\^es}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franc\^es}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franc\^es}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{\alem\~ao}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{\alem\~ao}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{grego}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebreu}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{h\'ungaro}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{island\^es}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irland\^es}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italiano}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latim}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{\alem\~ao}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{\alem\~ao}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{noruegu\^es}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{neo-noruegu\^es}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polaco}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugu\^es}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugu\^es}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russio}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{escoc\^es}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{s\'ervio}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{espanhol}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{sueco}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turco}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{ingl\^es}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Copy the commands to the other languages.
+% \begin{macrocode}
+\newcommand\bibsbrazil{\bibsportuguese[brazil]}
+\newcommand\bibsbrazilian{\bibsportuguese[brazilian]}
+\newcommand\bibsportuges{\bibsportuguese[portuges]}
+% \end{macrocode}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{brazil}{bibsbrazil}
+ \bbbbaddto{brazilian}{bibsbrazilian}
+ \bbbbaddto{portuges}{bibsportuges}
+ \bbbbaddto{portuguese}{bibsportuguese}
+ \fi
+% \end{macrocode}
+% Switch off the change of case in titles for all Portuguese dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{brazil}{btxifchangecaseoff}
+ \bbbbaddto{brazilian}{btxifchangecaseoff}
+ \bbbbaddto{portuges}{btxifchangecaseoff}
+ \bbbbaddto{portuguese}{btxifchangecaseoff}
+}
+%</portuguese>
+% \end{macrocode}
+%
+% \subsubsection{Dutch}
+% \changes{0.33}{2003/05/22}{Added Dutch language}%
+% \begin{macrocode}
+%<*dutch>
+% \end{macrocode}
+%
+% \begin{macro}{\bibsdutch}
+% Bibliographic commands for Dutch.
+% \begin{macrocode}
+\newcommand\bibsdutch[1][dutch]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{en anderen}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxandcomma##1{,}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{van}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{van}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redactie}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redactie}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volume}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{nr##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nummer}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{druk}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{uitgave}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{hfdst##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{hoofdstuk}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{pag##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{pagina}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pag##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{pagina's}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{scriptie}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{proefschrift}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Tech.\ Rapp##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Technisch Rapport}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januari}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februari}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Maart}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Mei}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{Augustus}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{December}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mrt}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Mei}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redactie}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redactie}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{Nr##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nummer}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Druk}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Uitgave}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Hfdst##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Hoofdstuk}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{Pag##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Pagina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pags##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pagina's}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tech.\ Rapp##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Technisch Rapport}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{bezocht op}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{engels}}%
+ % \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{german}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{engels}}%
+ % \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgarian}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{engels}}%
+ % \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{french}}%
+ % \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catalan}}%
+ % \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croatian}}%
+ % \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{czech}}%
+ % \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{d\"anisch}}%
+ % \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{dutch}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{engels}}%
+ % \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ % \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finnish}}%
+ % \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{french}}%
+ % \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{french}}%
+ % \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{french}}%
+ % \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{german}}%
+ % \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{german}}%
+ % \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{greek}}%
+ % \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebrew}}%
+ % \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{hungarian}}%
+ % \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{icelandic}}%
+ % \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irish}}%
+ % \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italian}}%
+ % \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latin}}%
+ % \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{german}}%
+ % \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{german}}%
+ % \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norwegian}}%
+ % \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{new-norwegian}}%
+ % \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polish}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugees}}%
+ % \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{russian}}%
+ % \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{scottish}}%
+ % \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbian}}%
+ % \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spanish}}%
+ % \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{swedish}}%
+ % \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turkish}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{engels}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{dutch}{bibsdutch}
+ \fi
+% \end{macrocode}
+% Switch on the change of case in titles for all Dutch dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{dutch}{btxifchangecaseoff}
+}
+%</dutch>
+% \end{macrocode}
+%
+% \subsubsection{Swedish}
+% \changes{0.33}{2003/05/22}{Added Swedish language}%
+% \changes{0.41}{2003/11/03}{Corrected swedish (by Hans Fredrik Nordhaug)}%
+% \begin{macrocode}
+%<*swedish>
+% \end{macrocode}
+%
+% The language definition for Swedish was provided by Hans Fredrik
+% Nordhaug.
+%
+% \begin{macro}{\bibsswedish}
+% Bibliographic commands for Swedish.
+% \begin{macrocode}
+\newcommand\bibsswedish[1][swedish]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{och}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{och}}%
+ \def\btxandcomma##1{,}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{av}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{av}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redakt\"or}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redakt\"orer}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volym}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{nr##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nummer}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{utg}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{utg\aa va}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{kap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{kapitel}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{sida}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{s##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{sidor}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{scriptie}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{proefschrift}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Tech.\ Rapp##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Technisch Rapport}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januari}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februari}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Mars}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Maj}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Juni}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Juli}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{Augusti}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{December}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mar}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Maj}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1{}}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1{}}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{I}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redactie}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redactie}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{Nr##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nummer}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Druk}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Utgave}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Hfdst##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Hoofdstuk}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{Pag##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Pagina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pags##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Pagina's}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tech.\ Rapp##1{}}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Technisch Rapport}}%
+% \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{??}}%
+ \def\btxurldatecomment##1{\PackageError{babelbib}{Comment for
+ urldate in Swedish undefined. Please send the translation for
+ 'visited on' to harald.harders@tu-bs.de}{}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{engelska}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{tyska}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugisiska}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugisiska}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{engelska}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgariska}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{engelska}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franska}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalanska}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroatiska}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tjeckiska}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{danska}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{nederl\"andska}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{engelska}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finska}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{franska}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franska}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franska}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{tyska}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{tyska}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{grekiska}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebreiska}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{ungerska}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{isl\"andska}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{iriska}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{italienska}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{latin}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{tyska}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{tyska}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{norska}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{nynorska}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polska}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugisiska}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugisiska}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{ryska}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{skotsks}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbiska}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{spanska}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{svenska}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turkiska}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{engelska}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{engelska}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{swedish}{bibsswedish}
+ \fi
+% \end{macrocode}
+% Switch on the change of case in titles for all Swedish dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{swedish}{btxifchangecaseoff}
+}
+%</swedish>
+% \end{macrocode}
+%
+% \subsubsection{Afrikaans}
+% \changes{0.34}{2003/07/28}{Added Afrikaans language}%
+% \begin{macrocode}
+%<*afrikaans>
+% \end{macrocode}
+%
+% The language definition for Afrikaans was provided by Danie Els.
+%
+% \begin{macro}{\bibsafrikaans}
+% Bibliographic commands for Afrikaans.
+% \begin{macrocode}
+\newcommand\bibsafrikaans[1][afrikaans]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{et~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{et~alii}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{en}}%
+ \def\btxandcomma##1{\protect\foreignlanguage{#1}{}}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofseriesshort##1{\protect\foreignlanguage{#1}{van}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{van}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{in}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{red##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{redakteur}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{reds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{redakteurs}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volume}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{no##1{}}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{nommer}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{uitg##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{uitgawe}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{hfst##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{hoofstuk}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{bladsy}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{pp##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{bladsye}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Meesters tesis}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{PhD verhandeling}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Tegn.\ versl##1{}}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Tegniese verslag}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{Januarie}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{Februarie}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{Maart}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{April}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{Mei}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{Junie}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{Julie}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{Augustus}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{September}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{Oktober}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{November}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{Desember}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{Jan##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{Feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{Mrt##1{}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{Apr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{Mei##1}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{Jun##1}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{Jul##1}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{Aug##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{Sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{Okt##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{Nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{Des##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{In}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Red##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Redakteur}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Reds##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Redakteurs}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volume}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{No##1{}}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{Nommer}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Uitg##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Uitgawe}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Hfst##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Hoofstuk}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{Bladsy}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{Pp##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{Bladsye}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Tegn.\ Verslag}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Tegniese Verslag}}%
+% \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{??}}%
+ \def\btxurldatecomment##1{\PackageError{babelbib}{Comment for
+ urldate in Afrikaans undefined. Please send the translation for
+ 'visited on' to harald.harders@tu-bs.de}{}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameafrikaans{\protect\foreignlanguage{#1}{afrikaans}}%
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{duits}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{bulgaars}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{frans}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{katalaans}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{kroaties}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{tsjeggies}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{deens}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{nederlands}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{fins}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{frans}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{frans}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{frans}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{duits}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{duits}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{grieks}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebreeus}}%
+ \def\btxlanguagenamenhungarian{\protect\foreignlanguage{#1}{hongaars}}%
+ \def\btxlanguagenamenicelandic{\protect\foreignlanguage{#1}{yslands}}%
+ \def\btxlanguagenamenirish{\protect\foreignlanguage{#1}{iers}}%
+ \def\btxlanguagenamenitalian{\protect\foreignlanguage{#1}{italiaans}}%
+ \def\btxlanguagenamenlatin{\protect\foreignlanguage{#1}{latyn}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{duits}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{duits}}%
+ \def\btxlanguagenamennorsk{\protect\foreignlanguage{#1}{noors}}%
+ \def\btxlanguagenamennynorsk{\protect\foreignlanguage{#1}{neo-noors}}%
+ \def\btxlanguagenamenpolish{\protect\foreignlanguage{#1}{pools}}%
+ \def\btxlanguagenamenportuges{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamenportuguese{\protect\foreignlanguage{#1}{portugees}}%
+ \def\btxlanguagenamenrussian{\protect\foreignlanguage{#1}{russies}}%
+ \def\btxlanguagenamenscottish{\protect\foreignlanguage{#1}{skots}}%
+ \def\btxlanguagenamenserbian{\protect\foreignlanguage{#1}{serwies}}%
+ \def\btxlanguagenamenspanish{\protect\foreignlanguage{#1}{spaans}}%
+ \def\btxlanguagenamenswedish{\protect\foreignlanguage{#1}{sweeds}}%
+ \def\btxlanguagenamenturkish{\protect\foreignlanguage{#1}{turks}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{engels}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{engels}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{afrikaans}{bibsafrikaans}
+ \fi
+% \end{macrocode}
+% Switch on the change of case in titles for all Afrikaans dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{afrikaans}{btxifchangecaseoff}
+}
+%</afrikaans>
+% \end{macrocode}
+%
+% \subsubsection{Catalan}
+% \changes{1.00}{2005/02/16}{Added Catalan language}%
+% \begin{macrocode}
+%<*catalan>
+% \end{macrocode}
+%
+% The language definition for Catalan was provided by
+% Robert Fuster, rfuster@imm.upv.es.
+%
+% \begin{macro}{\bibsafrikaans}
+% \begin{macrocode}
+\newcommand\bibscatalan[1][catalan]{%
+ \def\biblanguagename{#1}%
+ \def\btxetalshort##1{\protect\foreignlanguage{#1}{i~al##1{}}}%
+ \def\btxetallong##1{\protect\foreignlanguage{#1}{i~altres}}%
+ \def\btxandshort##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxandlong##1{\protect\foreignlanguage{#1}{i}}%
+ \def\btxandcomma##1{}%
+ \def\btxinlong##1{\protect\foreignlanguage{#1}{dins}}%
+ \def\btxinshort##1{\protect\foreignlanguage{#1}{dins}}%
+ \def\btxinseriesshort##1{\protect\foreignlanguage{#1}{dins}}%
+ \def\btxofserieslong##1{\protect\foreignlanguage{#1}{de}}%
+ \def\btxinserieslong##1{\protect\foreignlanguage{#1}{dins}}%
+ \def\btxeditorshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditorlong##1{\protect\foreignlanguage{#1}{editor}}%
+ \def\btxeditorsshort##1{\protect\foreignlanguage{#1}{eds##1{}}}%
+ \def\btxeditorslong##1{\protect\foreignlanguage{#1}{editors}}%
+ \def\btxvolumeshort##1{\protect\foreignlanguage{#1}{vol##1{}}}%
+ \def\btxvolumelong##1{\protect\foreignlanguage{#1}{volum}}%
+ \def\btxnumbershort##1{\protect\foreignlanguage{#1}{n}}%
+ \def\btxnumberlong##1{\protect\foreignlanguage{#1}{n\'umero}}%
+ \def\btxeditionshort##1{\protect\foreignlanguage{#1}{ed##1{}}}%
+ \def\btxeditionlong##1{\protect\foreignlanguage{#1}{edici{\'o}}}%
+ \def\btxchaptershort##1{\protect\foreignlanguage{#1}{cap##1{}}}%
+ \def\btxchapterlong##1{\protect\foreignlanguage{#1}{cap{\'\i}tol}}%
+ \def\btxpageshort##1{\protect\foreignlanguage{#1}{p##1{}}}%
+ \def\btxpagelong##1{\protect\foreignlanguage{#1}{p\`agina}}%
+ \def\btxpagesshort##1{\protect\foreignlanguage{#1}{ps##1{}}}%
+ \def\btxpageslong##1{\protect\foreignlanguage{#1}{p\`agines}}%
+ \def\btxmastthesis##1{\protect\foreignlanguage{#1}{Tesina de Llicenciatura}}%
+ \def\btxphdthesis##1{\protect\foreignlanguage{#1}{Tesi de Doctorat}}%
+ \def\btxtechrepshort##1{\protect\foreignlanguage{#1}{Rep. t\`ecnic}}%
+ \def\btxtechreplong##1{\protect\foreignlanguage{#1}{Report t\`ecnic}}%
+ \def\btxmonjanlong##1{\protect\foreignlanguage{#1}{gener}}%
+ \def\btxmonfeblong##1{\protect\foreignlanguage{#1}{febrer}}%
+ \def\btxmonmarlong##1{\protect\foreignlanguage{#1}{mar\c{c}}}%
+ \def\btxmonaprlong##1{\protect\foreignlanguage{#1}{abril}}%
+ \def\btxmonmaylong##1{\protect\foreignlanguage{#1}{maig}}%
+ \def\btxmonjunlong##1{\protect\foreignlanguage{#1}{juny}}%
+ \def\btxmonjullong##1{\protect\foreignlanguage{#1}{juliol}}%
+ \def\btxmonauglong##1{\protect\foreignlanguage{#1}{agost}}%
+ \def\btxmonseplong##1{\protect\foreignlanguage{#1}{setembre}}%
+ \def\btxmonoctlong##1{\protect\foreignlanguage{#1}{octubre}}%
+ \def\btxmonnovlong##1{\protect\foreignlanguage{#1}{novembre}}%
+ \def\btxmondeclong##1{\protect\foreignlanguage{#1}{desembre}}%
+ \def\btxmonjanshort##1{\protect\foreignlanguage{#1}{gen##1{}}}%
+ \def\btxmonfebshort##1{\protect\foreignlanguage{#1}{feb##1{}}}%
+ \def\btxmonmarshort##1{\protect\foreignlanguage{#1}{mar\c{c}}}%
+ \def\btxmonaprshort##1{\protect\foreignlanguage{#1}{abr##1{}}}%
+ \def\btxmonmayshort##1{\protect\foreignlanguage{#1}{maig}}%
+ \def\btxmonjunshort##1{\protect\foreignlanguage{#1}{juny}}%
+ \def\btxmonjulshort##1{\protect\foreignlanguage{#1}{jul}}%
+ \def\btxmonaugshort##1{\protect\foreignlanguage{#1}{ago##1{}}}%
+ \def\btxmonsepshort##1{\protect\foreignlanguage{#1}{sep##1{}}}%
+ \def\btxmonoctshort##1{\protect\foreignlanguage{#1}{oct##1{}}}%
+ \def\btxmonnovshort##1{\protect\foreignlanguage{#1}{nov##1{}}}%
+ \def\btxmondecshort##1{\protect\foreignlanguage{#1}{dec##1{}}}%
+ \def\Btxinlong##1{\protect\foreignlanguage{#1}{Dins}}%
+ \def\Btxinshort##1{\protect\foreignlanguage{#1}{Dins}}%
+ \def\Btxeditorshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorlong##1{\protect\foreignlanguage{#1}{Editor}}%
+ \def\Btxeditorsshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditorslong##1{\protect\foreignlanguage{#1}{Editors}}%
+ \def\Btxvolumeshort##1{\protect\foreignlanguage{#1}{Vol##1{}}}%
+ \def\Btxvolumelong##1{\protect\foreignlanguage{#1}{Volum}}%
+ \def\Btxnumbershort##1{\protect\foreignlanguage{#1}{N\'um}}%
+ \def\Btxnumberlong##1{\protect\foreignlanguage{#1}{N\'umero}}%
+ \def\Btxeditionshort##1{\protect\foreignlanguage{#1}{Ed##1{}}}%
+ \def\Btxeditionlong##1{\protect\foreignlanguage{#1}{Edici\'o}}%
+ \def\Btxchaptershort##1{\protect\foreignlanguage{#1}{Cap##1{}}}%
+ \def\Btxchapterlong##1{\protect\foreignlanguage{#1}{Cap\'\itol}}%
+ \def\Btxpageshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpagelong##1{\protect\foreignlanguage{#1}{P\`agina}}%
+ \def\Btxpagesshort##1{\protect\foreignlanguage{#1}{P##1{}}}%
+ \def\Btxpageslong##1{\protect\foreignlanguage{#1}{P\`agines}}%
+ \def\Btxtechrepshort##1{\protect\foreignlanguage{#1}{Rep. t\`ecnic}}%
+ \def\Btxtechreplong##1{\protect\foreignlanguage{#1}{Report t\`ecnic}}%
+ \def\btxurldatecomment##1{\protect\foreignlanguage{#1}{visitada el}}%
+ \def\btxurldatecomment##1{\PackageError{babelbib}{Comment for
+ urldate in Catalan undefined. Please send the translation for
+ 'visited on' to harald.harders@tu-bs.de}{}}%
+ \def\btxkeywordlanguage##1{\protect\foreignlanguage{#1}{##1}}%
+ \ifbbbblanguagenames
+ \def\btxlanguagenameamerican{\protect\foreignlanguage{#1}{angl\`es}}%
+ \def\btxlanguagenameaustrian{\protect\foreignlanguage{#1}{alem\`any}}%
+ \def\btxlanguagenamebrazil{\protect\foreignlanguage{#1}{portugu\`es}}%
+ \def\btxlanguagenamebrazilian{\protect\foreignlanguage{#1}{portugu\`es}}%
+ \def\btxlanguagenamebritish{\protect\foreignlanguage{#1}{angl\'es}}%
+ \def\btxlanguagenamebulgarian{\protect\foreignlanguage{#1}{b\'ulgar}}%
+ \def\btxlanguagenamecanadian{\protect\foreignlanguage{#1}{angl\`es}}%
+ \def\btxlanguagenamecanadien{\protect\foreignlanguage{#1}{franc\`es}}%
+ \def\btxlanguagenamecatalan{\protect\foreignlanguage{#1}{catal\`a}}%
+ \def\btxlanguagenamecroatian{\protect\foreignlanguage{#1}{croat}}%
+ \def\btxlanguagenameczech{\protect\foreignlanguage{#1}{txec}}%
+ \def\btxlanguagenamedanish{\protect\foreignlanguage{#1}{dan\`es}}%
+ \def\btxlanguagenamedutch{\protect\foreignlanguage{#1}{neerland\`es}}%
+ \def\btxlanguagenameenglish{\protect\foreignlanguage{#1}{angl\`es}}%
+ \def\btxlanguagenameesperanto{\protect\foreignlanguage{#1}{esperanto}}%
+ \def\btxlanguagenamefinnish{\protect\foreignlanguage{#1}{finland\`es}}%
+ \def\btxlanguagenamefrancais{\protect\foreignlanguage{#1}{franc\`es}}%
+ \def\btxlanguagenamefrench{\protect\foreignlanguage{#1}{franc\`es}}%
+ \def\btxlanguagenamefrenchb{\protect\foreignlanguage{#1}{franc\`es}}%
+ \def\btxlanguagenamegerman{\protect\foreignlanguage{#1}{alem\`any}}%
+ \def\btxlanguagenamegermanb{\protect\foreignlanguage{#1}{alem\`any}}%
+ \def\btxlanguagenamegreek{\protect\foreignlanguage{#1}{grec}}%
+ \def\btxlanguagenamehebrew{\protect\foreignlanguage{#1}{hebreu}}%
+ \def\btxlanguagenamehungarian{\protect\foreignlanguage{#1}{hongar\`es}}%
+ \def\btxlanguagenameicelandic{\protect\foreignlanguage{#1}{island\`es}}%
+ \def\btxlanguagenameirish{\protect\foreignlanguage{#1}{irland\`es}}%
+ \def\btxlanguagenameitalian{\protect\foreignlanguage{#1}{itali\`a}}%
+ \def\btxlanguagenamelatin{\protect\foreignlanguage{#1}{llat\'\i}}%
+ \def\btxlanguagenamenaustrian{\protect\foreignlanguage{#1}{alem\`any}}%
+ \def\btxlanguagenamengerman{\protect\foreignlanguage{#1}{alem\`any}}%
+ \def\btxlanguagenamenorsk{\protect\foreignlanguage{#1}{noruec}}%
+ \def\btxlanguagenamenynorsk{\protect\foreignlanguage{#1}{noruec}}%
+ \def\btxlanguagenamepolish{\protect\foreignlanguage{#1}{polon\`es}}%
+ \def\btxlanguagenameportuges{\protect\foreignlanguage{#1}{portugu\`es}}%
+ \def\btxlanguagenameportuguese{\protect\foreignlanguage{#1}{portugu\`es}}%
+ \def\btxlanguagenamerussian{\protect\foreignlanguage{#1}{rus}}%
+ \def\btxlanguagenamescottish{\protect\foreignlanguage{#1}{escoc\`es}}%
+ \def\btxlanguagenameserbian{\protect\foreignlanguage{#1}{serbi}}%
+ \def\btxlanguagenamespanish{\protect\foreignlanguage{#1}{espa\~nol}}%
+ \def\btxlanguagenameswedish{\protect\foreignlanguage{#1}{suec}}%
+ \def\btxlanguagenameturkish{\protect\foreignlanguage{#1}{turc}}%
+ \def\btxlanguagenameUKenglish{\protect\foreignlanguage{#1}{angl\`es}}%
+ \def\btxlanguagenameUSenglish{\protect\foreignlanguage{#1}{angl\`es}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% Append the definitions to the language-calling commands.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifbbbbfixlanguage
+ \else
+ \bbbbaddto{catalan}{bibscatalan}
+ \fi
+% \end{macrocode}
+% Switch on the change of case in titles for all Afrikaans dialects by
+% appending \cs{btxifchangecaseoff} to \cs{extras}\meta{language}.
+% \begin{macrocode}
+ \bbbbaddto{catalan}{btxifchangecaseoff}
+}
+%</catalan>
+% \end{macrocode}
+%
+% \section{\BibTeX\ style files}
+% \changes{0.40}{2003/09/26}{Moved the \texttt{bst} files into the
+% global \texttt{dtx} file}%
+%
+% \subsection{``Normal'' \BibTeX\ style files}
+%
+% \subsubsection{Generic code}
+%
+% Because most parts of the \BibTeX\ style files are equal for all
+% styles, they are generated from the same source code.
+% \begin{macrocode}
+%<*bststd>
+% \end{macrocode}
+% Declare the data fields that are handled by the \BibTeX\ styles.
+% \begin{macrocode}
+ENTRY
+ { address
+ author
+ booktitle
+ chapter
+ edition
+ editor
+ howpublished
+ institution
+ isbn
+ issn
+ journal
+ key
+ language
+ month
+ note
+ number
+ organization
+ pages
+ publisher
+ school
+ series
+ title
+ type
+ url
+ urldate
+ volume
+ year
+ }
+ {}
+%</bststd>
+%<bststd&!bstalpha> { label }
+%<bststd&bstalpha> { label extra.label sort.label }
+%<*bststd>
+
+% \end{macrocode}
+% Declare integer variables.
+% \begin{macrocode}
+INTEGERS
+ { output.state
+ before.all
+ mid.sentence
+ after.sentence
+ after.block
+ before.title
+ }
+
+% \end{macrocode}
+% Declare string variables.
+% \begin{macrocode}
+STRINGS
+ { s
+ t
+ language.state
+ change.temp
+ isbn.command
+ }
+
+% \end{macrocode}
+% Declare the constants that define at which position within a
+% citation we are when processing it.
+% \begin{macrocode}
+FUNCTION {init.state.consts}
+{ #0 'before.all :=
+ #1 'mid.sentence :=
+ #2 'after.sentence :=
+ #3 'after.block :=
+ #4 'before.title :=
+ "nostate" 'language.state :=
+}
+
+% \end{macrocode}
+% Logical function |not|.
+%
+% Syntax: \meta{int1} |not| $\longrightarrow$ \meta{int2}.
+%
+% Returns |1| if \meta{arg1} != |0|, |0| otherwise.
+% \begin{macrocode}
+FUNCTION {not}
+{ { #0 }
+ { #1 }
+ if$
+}
+
+% \end{macrocode}
+% Logical function |and|.
+% Syntax: \meta{arg1} \meta{arg1} |and|.
+% Returns |1| if \meta{arg1} == |true| and \meta{arg2} == |true|, |0|
+% otherwise.
+% \begin{macrocode}
+FUNCTION {and}
+{ 'skip$
+ { pop$ #0 }
+ if$
+}
+
+% \end{macrocode}
+% Logical function |or|.
+% Syntax: \meta{arg1} \meta{arg1} |or|.
+% Returns |1| if \meta{arg1} == |true| or \meta{arg2} == |true|, |0|
+% otherwise.
+% \begin{macrocode}
+FUNCTION {or}
+{ { pop$ #1 }
+ 'skip$
+ if$
+}
+
+% \end{macrocode}
+% Function |language.change.case|.
+% Syntax: \meta{string1} \meta{string2} |language.change.case|
+% $\longrightarrow$ \meta{string3}
+% This function has the same syntax as |change.case$| but writes
+% \meta{string1} twice into \meta{string3}, first with changed case,
+% second with original case.
+% \begin{macrocode}
+FUNCTION {language.change.case}
+{
+ 'change.temp :=
+ 't :=
+ "\btxifchangecase {"
+ t change.temp change.case$ *
+ "}{" *
+ t *
+ "}" *
+}
+
+% \end{macrocode}
+% Generates output for the string \meta{string1}.
+% Syntax: \meta{string1} |output.nonnull| $\longrightarrow$ \meta{string2}
+% \begin{macrocode}
+FUNCTION {output.nonnull}
+{ 's :=
+ output.state mid.sentence =
+ { ", " * write$ }
+ { output.state after.block =
+ { add.period$ write$
+ newline$
+ "\newblock " write$
+ }
+ { output.state before.all =
+ 'write$
+ {
+ output.state before.title =
+ { "\btxauthorcolon\ " * write$ }
+ { add.period$ " " * write$ }
+ if$
+ }
+ if$
+ }
+ if$
+ mid.sentence 'output.state :=
+ }
+ if$
+ s
+}
+
+% \end{macrocode}
+% Generates output if the given string \meta{string1} is not empty.
+% Syntax: \meta{string1} |output.nonnull| $\longrightarrow$ \meta{string2}
+% \begin{macrocode}
+FUNCTION {output}
+{ duplicate$ empty$
+ 'pop$
+ 'output.nonnull
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {output.check}
+{ 't :=
+ duplicate$ empty$
+ { pop$ "empty " t * " in " * cite$ * warning$ }
+ 'output.nonnull
+ if$
+}
+
+% \end{macrocode}
+% Outputs a bibliography item.
+% \begin{macrocode}
+FUNCTION {output.bibitem}
+{ newline$
+% \end{macrocode}
+% \changes{0.40}{2003/09/26}{Switch to a fall-back language when
+% \texttt{language} field is missing}%
+% If no language is given, fall back to the language that has been
+% active at \cs{begin\{document\}} or to the given fall-back
+% language.
+% For \BibTeX, this language gets the name \texttt{nolanguage}.
+% \begin{macrocode}
+ language empty$
+ { "empty language in " cite$ * warning$
+ language.state "nolanguage" =
+ 'skip$
+ {
+ "\expandafter\btxselectlanguage\expandafter {"
+ "\btxfallbacklanguage}" * write$
+ newline$
+ }
+ if$
+ "nolanguage" 'language.state :=
+ }
+ { language.state language =
+ 'skip$
+ { "\btxselectlanguage {" language * "}" * write$
+ newline$
+ }
+ if$
+ language 'language.state :=
+ }
+ if$
+%</bststd>
+%<bststd&!bstalpha> "\bibitem{" write$
+%<bststd&bstalpha> "\bibitem[" label * "]{" * write$
+%<*bststd>
+ cite$ write$
+ "}" write$
+ newline$
+ ""
+ before.all 'output.state :=
+}
+
+% \end{macrocode}
+% Output an ISBN or ISSN.
+%
+% Syntax: \meta{string1} \meta{string2} |output.isbn|
+%
+% Prints the ISBN or ISSN given by \meta{string1} and uses the \TeX\
+% macro given by \meta{string2} to determine if the text is printed or
+% not.
+% \meta{string2} normally is \cs{ifbtxprintISSN} or
+% \cs{ifbtxprintISSN}.
+% \begin{macrocode}
+FUNCTION {output.isbn}
+{
+ 'isbn.command :=
+ duplicate$
+ empty$
+ 'pop$
+ {
+ 's :=
+ output.state mid.sentence =
+ {
+ isbn.command * " {, " * write$
+ s "}" *
+ }
+ { output.state after.block =
+ {
+ add.period$
+ write$
+ newline$
+ "\newblock " write$
+ isbn.command " {" * s * ".}" *
+ }
+ { output.state before.all =
+ {
+ write$
+ isbn.command " {" * write$
+ s "}" *
+ }
+ {
+ output.state before.title =
+ {
+ "\btxauthorcolon\ " * write$
+ isbn.command " {" * write$
+ s "}" *
+ }
+ {
+ add.period$ " " * write$
+ isbn.command " {" * write$
+ s ".}" *
+ }
+ if$
+ }
+ if$
+ }
+ if$
+ mid.sentence 'output.state :=
+ }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+% Completes an entry.
+% \begin{macrocode}
+FUNCTION {fin.entry}
+{ add.period$
+ write$
+ newline$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.block}
+{ output.state before.all =
+ 'skip$
+ { after.block 'output.state := }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.sentence}
+{ output.state after.block =
+ 'skip$
+ { output.state before.all =
+ 'skip$
+ { after.sentence 'output.state := }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {after.authors}
+{ output.state before.all =
+ 'skip$
+ { before.title 'output.state := }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.block.checka}
+{ empty$
+ 'skip$
+ 'new.block
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.block.checkb}
+{ empty$
+ swap$ empty$
+ and
+ 'skip$
+ 'new.block
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.block.checkc}
+{ empty$
+ swap$ empty$
+ and
+ 'skip$
+ 'after.authors
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.sentence.checka}
+{ empty$
+ 'skip$
+ 'new.sentence
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {new.sentence.checkb}
+{ empty$
+ swap$ empty$
+ and
+ 'skip$
+ 'new.sentence
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+ { pop$ "" }
+ 'skip$
+ if$
+}
+
+% \end{macrocode}
+% \changes{1.00}{2005/02/16}{Remove \texttt{emphasize} and
+% \texttt{smallcaps} from \BibTeX\ styles}%
+% \begin{macrocode}
+FUNCTION {namefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxnamefont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+% \changes{1.12}{2005/06/19}{Add extra formatting of lastnames to
+% \BibTeX\ styles}%
+% \begin{macrocode}
+FUNCTION {lastnamefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxlastnamefont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {titlefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxtitlefont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {journalfont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxjournalfont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {volumefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxvolumefont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {etalfont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxetalfont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { nameptr namesleft numnames }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.names}
+{ 's :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { nameptr #1 >
+%</bststd>
+%<*bststd&!bstshort&!namevarb>
+ {
+ s nameptr "{ff~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * 't :=
+%</bststd&!bstshort&!namevarb>
+%<*bststd&bstshort&!namevarb>
+ {
+ s nameptr "{f.~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * 't :=
+%</bststd&bstshort&!namevarb>
+%<*bststd&!bstshort&namevarb>
+ {
+ s nameptr "{ll}" format.name$ lastnamefont
+ s nameptr "{, jj}{, ff}{~vv}" format.name$ * 't :=
+%</bststd&!bstshort&namevarb>
+%<*bststd&bstshort&namevarb>
+ {
+ s nameptr "{ll}" format.name$ lastnamefont
+ s nameptr "{,~jj}{,~f.}{~vv}" format.name$ * 't :=
+%</bststd&bstshort&namevarb>
+%<*bststd&bstthree>
+ namesleft #2 >
+ { " " "\btxetalshort {.}" etalfont * *
+ #1 'namesleft := }
+ {
+%</bststd&bstthree>
+%<*bststd>
+ namesleft #1 >
+ { ", " * t namefont * }
+ { numnames #2 >
+ { "\btxandcomma {}" * }
+ 'skip$
+ if$
+ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" =
+ { " " "\btxetalshort {.}" etalfont * * }
+%</bststd>
+%<bststd&!bstshort> { " \btxandlong {}\ " * t namefont * }
+%<bststd&bstshort> { " \btxandshort {.}\ " * t namefont * }
+%<*bststd&bstthree>
+ if$
+ }
+%</bststd&bstthree>
+%<*bststd>
+ if$
+ }
+ if$
+ }
+%</bststd>
+%<*bststd&!bstshort&!namevara>
+ {
+ s nameptr "{ll}" format.name$ lastnamefont
+ s nameptr "{,~jj}{, ff}{~vv}" format.name$ * namefont
+ }
+%</bststd&!bstshort&!namevara>
+%<*bststd&bstshort&!namevara>
+ {
+ s nameptr "{ll}" format.name$ lastnamefont
+ s nameptr "{,~jj}{,~f.}{~vv}" format.name$ * namefont
+ }
+%</bststd&bstshort&!namevara>
+%<*bststd&!bstshort&namevara>
+ {
+ s nameptr "{ff~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * namefont
+ }
+%</bststd&!bstshort&namevara>
+%<*bststd&bstshort&namevara>
+ {
+ s nameptr "{f.~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * namefont
+ }
+%</bststd&bstshort&namevara>
+%<*bststd>
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.authors}
+{ author empty$
+ { "" }
+ { author format.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.editors}
+{ editor empty$
+ { "" }
+ { editor format.names
+ editor num.names$ #1 >
+%</bststd>
+%<*bststd&!bstshort>
+ { "\ (\btxeditorslong {})" * }
+ { "\ (\btxeditorlong {})" * }
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { "\ (\btxeditorsshort {.})" * }
+ { "\ (\btxeditorshort {.})" * }
+%</bststd&bstshort>
+%<*bststd>
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.title}
+{ title empty$
+ { "" }
+ { title "t" language.change.case titlefont }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {n.dashify}
+{ 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.date}
+{ year empty$
+ { month empty$
+ { "" }
+ { "there's a month but no year in " cite$ * warning$
+ month
+ }
+ if$
+ }
+ { month empty$
+ 'year
+ { month "\ " * year * }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.btitle}
+{ title titlefont
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { "\ " }
+ if$
+ swap$ * *
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {volume.tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { "\ " }
+ if$
+ swap$ volumefont * *
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {either.or.check}
+{ empty$
+ 'pop$
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.bvolume}
+{ volume empty$
+ { "" }
+ { output.state after.block =
+%</bststd>
+%<bststd&!bstshort> { "\Btxvolumelong {}" }
+%<bststd&!bstshort> { "\btxvolumelong {}" }
+%<bststd&bstshort> { "\Btxvolumeshort {.}" }
+%<bststd&bstshort> { "\btxvolumeshort {.}" }
+%<*bststd>
+ if$
+ volume volume.tie.or.space.connect
+ series empty$
+ 'skip$
+%</bststd>
+%<bststd&!bstshort> { " \btxofserieslong {}\ " * series titlefont * }
+%<bststd&bstshort> { " \btxofseriesshort {.}\ " * series titlefont * }
+%<*bststd>
+ if$
+ "volume and number" number either.or.check
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.number.series}
+{ volume empty$
+ { number empty$
+ { series field.or.null }
+ { output.state mid.sentence =
+%</bststd>
+%<bststd&!bstshort> { "\btxnumberlong {}" }
+%<bststd&!bstshort> { "\Btxnumberlong {}" }
+%<bststd&bstshort> { "\btxnumbershort {.}" }
+%<bststd&bstshort> { "\Btxnumbershort {.}" }
+%<*bststd>
+ if$
+ number tie.or.space.connect
+ series empty$
+ { "there's a number but no series in " cite$ * warning$ }
+%</bststd>
+%<bststd&!bstshort> { " \btxinserieslong {}\ " * series titlefont * }
+%<bststd&bstshort> { " \btxinseriesshort {.}\ " * series titlefont * }
+%<*bststd>
+ if$
+ }
+ if$
+ }
+ { "" }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.edition}
+{ edition empty$
+ { "" }
+ {
+ output.state mid.sentence =
+%</bststd>
+%<*bststd&!bstshort>
+ { edition "l" language.change.case "~\btxeditionlong {}" * }
+ { edition "t" language.change.case "~\btxeditionlong {}" * }
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { edition "l" language.change.case "~\btxeditionshort {.}" * }
+ { edition "t" language.change.case "~\btxeditionshort {.}" * }
+%</bststd&bstshort>
+%<*bststd>
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.isbn}
+{ isbn empty$
+ { "" }
+ { "\btxISBN~\btxISBNfont {" isbn * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.issn}
+{ issn empty$
+ { "" }
+ { "\btxISSN~\btxISSNfont {" issn * "}" * }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.url}
+{ url empty$
+ { "" }
+ {
+ urldate empty$
+ { "\btxurlfont{" url * "}" * }
+ {
+ "\btxurlfont{" url *
+ "}, \btxurldatecomment{} \btxkeywordlanguage {\btxurldatefont{" *
+ urldate * "}}" *
+ }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { multiresult }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {multi.page.check}
+{ 't :=
+ #0 'multiresult :=
+ { multiresult not
+ t empty$ not
+ and
+ }
+ { t #1 #1 substring$
+ duplicate$ "-" =
+ swap$ duplicate$ "," =
+ swap$ "+" =
+ or or
+ { #1 'multiresult := }
+ { t #2 global.max$ substring$ 't := }
+ if$
+ }
+ while$
+ multiresult
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.pages}
+{ pages empty$
+ { "" }
+ { pages multi.page.check
+%</bststd>
+%<*bststd&!bstshort>
+ { "\btxpageslong {}" pages n.dashify tie.or.space.connect }
+ { "\btxpagelong {}" pages tie.or.space.connect }
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { "\btxpagesshort {.}" pages n.dashify tie.or.space.connect }
+ { "\btxpageshort {.}" pages tie.or.space.connect }
+%</bststd&bstshort>
+%<*bststd>
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.vol.num.pages}
+{ volume field.or.null
+ number empty$
+ 'skip$
+ { "(" number * ")" * *
+ volume empty$
+ { "there's a number but no volume in " cite$ * warning$ }
+ 'skip$
+ if$
+ }
+ if$
+ pages empty$
+ 'skip$
+ { duplicate$ empty$
+ { pop$ format.pages }
+ { ":" * pages n.dashify * }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+ 'format.pages
+ { type empty$
+%</bststd>
+%<bststd&!bstshort> { "\btxchapterlong {}" }
+%<bststd&bstshort> { "\btxchaptershort {.}" }
+%<*bststd>
+ { type "l" language.change.case }
+ if$
+ chapter tie.or.space.connect
+ pages empty$
+ 'skip$
+ { ", " * format.pages * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.in.ed.booktitle}
+{ booktitle empty$
+ { "" }
+ { editor empty$
+%</bststd>
+%<*bststd&!bstshort>
+ { "\Btxinlong {}\ " booktitle titlefont * }
+ { "\Btxinlong {}\ " format.editors * ": " * booktitle titlefont * }
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { "\Btxinshort {.}\ " booktitle titlefont * }
+ { "\Btxinshort {.}\ " format.editors * ": " * booktitle titlefont * }
+%</bststd&bstshort>
+%<*bststd>
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+ month empty$ year empty$ note empty$
+ and and and and and
+ key empty$ not and
+ { "all relevant fields are empty in " cite$ * warning$ }
+ 'skip$
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.thesis.type}
+{ type empty$
+ 'skip$
+ { pop$
+ type "t" language.change.case
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.tr.number}
+{
+ number empty$
+ {
+ type empty$
+%</bststd>
+% \end{macrocode}
+% \changes{0.40}{2003/09/26}{For \texttt{babalpha.bst}, use
+% \cs{btxtechreplong}}%
+% \begin{macrocode}
+%<bststd&!bstshort> { "\btxtechreplong {}" }
+%<bststd&bstshort> { "\btxtechrepshort {.}" }
+%<*bststd>
+ { type "t" language.change.case }
+ if$
+ }
+ {
+ type empty$
+%</bststd>
+% \end{macrocode}
+% \changes{0.40}{2003/09/26}{For \texttt{babalpha.bst}, use
+% \cs{Btxtechreplong}}%
+% \begin{macrocode}
+%<bststd&!bstshort> { "\Btxtechreplong {}" }
+%<bststd&bstshort> { "\Btxtechrepshort {.}" }
+%<*bststd>
+ { type "t" language.change.case }
+ if$
+ number tie.or.space.connect
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.article.crossref}
+{ key empty$
+%</bststd>
+%<*bststd&!bstshort>
+ { journal empty$
+ { "need key or journal for " cite$ * " to crossref " * crossref *
+ warning$
+ ""
+ }
+ { "\Btxinlong {}\ " journal titlefont * }
+ if$
+ }
+ { "\Btxinlong {}\ " key titlefont * }
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { journal empty$
+ { "need key or journal for " cite$ * " to crossref " * crossref *
+ warning$
+ ""
+ }
+ { "\Btxinshort {.}\ " journal titlefont * }
+ if$
+ }
+ { "\Btxinshort {.}\ " key titlefont * }
+%</bststd&bstshort>
+%<*bststd>
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.crossref.editor}
+{
+%</bststd>
+%<*bststd&!bstshort>
+ editor #1 "{ll}{,~jj}{, ff}{~vv}" format.name$ namefont
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ editor #1 "{ll}{,~jj}{,~f.}{~vv}" format.name$ namefont
+%</bststd&bstshort>
+%<*bststd>
+ editor num.names$ duplicate$
+ #2 >
+ { pop$ " " "\btxetalshort {.}" etalfont * * }
+ { #2 <
+ 'skip$
+ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { " " "\btxetalshort {.}" etalfont * * }
+%</bststd>
+%<*bststd&!bstshort>
+ { " \btxandlong {}\ " * editor #2 "{ff}{~vv}{~ll}{, jj}"
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { " \btxandshort {.}\ " * editor #2 "{vv~}{ll}"
+%</bststd&bstshort>
+%<*bststd>
+ format.name$ namefont * }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.book.crossref}
+{ volume empty$
+ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+%</bststd>
+%<bststd&!bstshort> "\Btxinlong {}\ "
+%<bststd&bstshort> "\Btxinshort {.}\ "
+%<*bststd>
+ }
+%</bststd>
+%<*bststd&!bstshort>
+ { "\Btxvolumelong {}" volume volume.tie.or.space.connect
+ " \btxofserieslong {}\ " *
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+ { "\Btxvolumeshort {.}" volume volume.tie.or.space.connect
+ " \btxofseriesshort {.}\ " *
+%</bststd&bstshort>
+%<*bststd>
+ }
+ if$
+ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { series empty$
+ { "need editor, key, or series for " cite$ * " to crossref " *
+ crossref * warning$
+ "" *
+ }
+ { series titlefont * }
+ if$
+ }
+ { key titlefont * }
+ if$
+ }
+%</bststd>
+%<bststd&!bstshort> { "\Btxinlong {}\ " format.crossref.editor * }
+%<bststd&bstshort> { "\Btxinshort {.}\ " format.crossref.editor * }
+%<*bststd>
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.incoll.inproc.crossref}
+{ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { booktitle empty$
+ { "need editor, key, or booktitle for " cite$ * " to crossref " *
+ crossref * warning$
+ ""
+ }
+%</bststd>
+%<bststd&!bstshort> { "\Btxinlong {}\ " booktitle titlefont * }
+%<bststd&bstshort> { "\Btxinshort {.}\ " booktitle titlefont * }
+%<*bststd>
+ if$
+ }
+%</bststd>
+%<bststd&!bstshort> { "\Btxinlong {}\ " key titlefont * }
+%<bststd&bstshort> { "\Btxinshort {.}\ " key titlefont * }
+%<*bststd>
+ if$
+ }
+%</bststd>
+%<bststd&!bstshort> { "\Btxinlong {}\ " format.crossref.editor * }
+%<bststd&bstshort> { "\Btxinshort {.}\ " format.crossref.editor * }
+%<*bststd>
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {article}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ crossref missing$
+ { journal
+ title missing$
+ { titlefont }
+ { journalfont }
+ if$
+ "journal" output.check
+ format.vol.num.pages output
+ format.date "year" output.check
+ }
+ { format.article.crossref output.nonnull
+ format.pages output
+ }
+ if$
+ format.issn "\ifbtxprintISSN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {book}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check }
+ { format.authors output.nonnull
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+ after.authors
+ format.btitle "title" output.check
+ crossref missing$
+ { format.bvolume output
+ new.block
+ format.number.series output
+ new.sentence
+ publisher "publisher" output.check
+ address output
+ }
+ { new.block
+ format.book.crossref output.nonnull
+ }
+ if$
+ format.edition output
+ format.date "year" output.check
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {booklet}
+{ output.bibitem
+ format.authors output
+ after.authors
+ format.title "title" output.check
+ howpublished address new.block.checkb
+ howpublished output
+ address output
+ format.date output
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {inbook}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check }
+ { format.authors output.nonnull
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+ after.authors
+ format.btitle "title" output.check
+ crossref missing$
+ { format.bvolume output
+ format.chapter.pages "chapter and pages" output.check
+ new.block
+ format.number.series output
+ new.sentence
+ publisher "publisher" output.check
+ address output
+ }
+ { format.chapter.pages "chapter and pages" output.check
+ new.block
+ format.book.crossref output.nonnull
+ }
+ if$
+ format.edition output
+ format.date "year" output.check
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {incollection}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ crossref missing$
+ { format.in.ed.booktitle "booktitle" output.check
+ format.bvolume output
+ format.number.series output
+ format.chapter.pages output
+ new.sentence
+ publisher "publisher" output.check
+ address output
+ format.edition output
+ format.date "year" output.check
+ }
+ { format.incoll.inproc.crossref output.nonnull
+ format.chapter.pages output
+ }
+ if$
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {inproceedings}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ crossref missing$
+ { format.in.ed.booktitle "booktitle" output.check
+ format.bvolume output
+ format.number.series output
+ format.pages output
+ address empty$
+ { organization publisher new.sentence.checkb
+ organization output
+ publisher output
+ format.date "year" output.check
+ }
+ { address output.nonnull
+ format.date "year" output.check
+ new.sentence
+ organization output
+ publisher output
+ }
+ if$
+ }
+ { format.incoll.inproc.crossref output.nonnull
+ format.pages output
+ }
+ if$
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {conference} { inproceedings }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {manual}
+{ output.bibitem
+ author empty$
+ { organization empty$
+ 'skip$
+ { organization output.nonnull
+ address output
+ }
+ if$
+ }
+ { format.authors output.nonnull }
+ if$
+ after.authors
+ format.btitle "title" output.check
+ author empty$
+ { organization empty$
+ { address new.block.checka
+ address output
+ }
+ 'skip$
+ if$
+ }
+ { organization address new.block.checkb
+ organization output
+ address output
+ }
+ if$
+ format.edition output
+ format.date output
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {mastersthesis}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ "\btxmastthesis {}" format.thesis.type output.nonnull
+ school "school" output.check
+ address output
+ format.date "year" output.check
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {misc}
+{ output.bibitem
+ format.authors output
+ title howpublished new.block.checkc
+ format.title output
+ howpublished new.block.checka
+ howpublished output
+ format.date output
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.issn "\ifbtxprintISSN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+ empty.misc.check
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {phdthesis}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.btitle "title" output.check
+ new.block
+ "\btxphdthesis {}" format.thesis.type output.nonnull
+ school "school" output.check
+ address output
+ format.date "year" output.check
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {proceedings}
+{ output.bibitem
+ editor empty$
+ { organization output }
+ { format.editors output.nonnull }
+ if$
+ after.authors
+ format.btitle "title" output.check
+ format.bvolume output
+ format.number.series output
+ address empty$
+ { editor empty$
+ { publisher new.sentence.checka }
+ { organization publisher new.sentence.checkb
+ organization output
+ }
+ if$
+ publisher output
+ format.date "year" output.check
+ }
+ { address output.nonnull
+ format.date "year" output.check
+ new.sentence
+ editor empty$
+ 'skip$
+ { organization output }
+ if$
+ publisher output
+ }
+ if$
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {techreport}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ format.tr.number output.nonnull
+ institution "institution" output.check
+ address output
+ format.date "year" output.check
+ format.isbn "\ifbtxprintISBN" output.isbn
+ new.block
+ format.url output
+ note output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {unpublished}
+{ output.bibitem
+ format.authors "author" output.check
+ after.authors
+ format.title "title" output.check
+ new.block
+ format.url output
+ note "note" output.check
+ format.date output
+ fin.entry
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {default.type} { misc }
+
+%</bststd>
+% \end{macrocode}
+% Months and journals:
+% \begin{macrocode}
+%<*bststd&!bstshort>
+MACRO {jan} {"\btxmonjanlong {}"}
+MACRO {feb} {"\btxmonfeblong {}"}
+MACRO {mar} {"\btxmonmarlong {}"}
+MACRO {apr} {"\btxmonaprlong {}"}
+MACRO {may} {"\btxmonmaylong {}"}
+MACRO {jun} {"\btxmonjunlong {}"}
+MACRO {jul} {"\btxmonjullong {}"}
+MACRO {aug} {"\btxmonauglong {}"}
+MACRO {sep} {"\btxmonseplong {}"}
+MACRO {oct} {"\btxmonoctlong {}"}
+MACRO {nov} {"\btxmonnovlong {}"}
+MACRO {dec} {"\btxmondeclong {}"}
+MACRO {acmcs} {"ACM Computing Surveys"}
+MACRO {acta} {"Acta Informatica"}
+MACRO {cacm} {"Communications of the ACM"}
+MACRO {ibmjrd} {"IBM Journal of Research and Development"}
+MACRO {ibmsj} {"IBM Systems Journal"}
+MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
+MACRO {ieeetc} {"IEEE Transactions on Computers"}
+MACRO {ieeetcad}
+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+MACRO {ipl} {"Information Processing Letters"}
+MACRO {jacm} {"Journal of the ACM"}
+MACRO {jcss} {"Journal of Computer and System Sciences"}
+MACRO {scp} {"Science of Computer Programming"}
+MACRO {sicomp} {"SIAM Journal on Computing"}
+MACRO {tocs} {"ACM Transactions on Computer Systems"}
+MACRO {tods} {"ACM Transactions on Database Systems"}
+MACRO {tog} {"ACM Transactions on Graphics"}
+MACRO {toms} {"ACM Transactions on Mathematical Software"}
+MACRO {toois} {"ACM Transactions on Office Information Systems"}
+MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
+MACRO {tcs} {"Theoretical Computer Science"}
+%</bststd&!bstshort>
+%<*bststd&bstshort>
+MACRO {jan} {"\btxmonjanshort {.}"}
+MACRO {feb} {"\btxmonfebshort {.}"}
+MACRO {mar} {"\btxmonmarshort {.}"}
+MACRO {apr} {"\btxmonaprshort {.}"}
+MACRO {may} {"\btxmonmayshort {.}"}
+MACRO {jun} {"\btxmonjunshort {.}"}
+MACRO {jul} {"\btxmonjulshort {.}"}
+MACRO {aug} {"\btxmonaugshort {.}"}
+MACRO {sep} {"\btxmonsepshort {.}"}
+MACRO {oct} {"\btxmonoctshort {.}"}
+MACRO {nov} {"\btxmonnovshort {.}"}
+MACRO {dec} {"\btxmondecshort {.}"}
+MACRO {acmcs} {"ACM Comput.\ Surv.{}"}
+MACRO {acta} {"Acta Inf.{}"}
+MACRO {cacm} {"Commun. ACM"}
+MACRO {ibmjrd} {"IBM J.~Res.\ Dev.{}"}
+MACRO {ibmsj} {"IBM Syst.~J.{}"}
+MACRO {ieeese} {"IEEE Trans.\ Softw.\ Eng.{}"}
+MACRO {ieeetc} {"IEEE Trans.\ Comput.{}"}
+MACRO {ieeetcad}
+ {"IEEE Trans.\ Comput.-Aided Design Integrated Circuits"}
+MACRO {ipl} {"Inf.\ Process.\ Lett.{}"}
+MACRO {jacm} {"J.~ACM"}
+MACRO {jcss} {"J.~Comput.\ Syst.\ Sci.{}"}
+MACRO {scp} {"Sci.\ Comput.\ Programming"}
+MACRO {sicomp} {"SIAM J.~Comput.{}"}
+MACRO {tocs} {"ACM Trans.\ Comput.\ Syst.{}"}
+MACRO {tods} {"ACM Trans.\ Database Syst.{}"}
+MACRO {tog} {"ACM Trans.\ Gr.{}"}
+MACRO {toms} {"ACM Trans.\ Math.\ Softw.{}"}
+MACRO {toois} {"ACM Trans.\ Office Inf.\ Syst.{}"}
+MACRO {toplas} {"ACM Trans.\ Prog.\ Lang.\ Syst.{}"}
+MACRO {tcs} {"Theoretical Comput.\ Sci.{}"}
+%</bststd&bstshort>
+% \end{macrocode}
+% Action.
+% \begin{macrocode}
+%<*bststd>
+
+READ
+
+%</bststd>
+% \end{macrocode}
+%
+% \subsubsection{Sorted bibliographies}
+%
+% This code is only used for sorted bibliographies.
+% \changes{1.00}{2005/02/16}{Fix sorting of \BibTeX\ entries without
+% an author}%
+% \begin{macrocode}
+%<*bststd&!bstunsorted>
+FUNCTION {sortify}
+{ purify$
+ "l" change.case$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { len }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {chop.word}
+{ 's :=
+ 'len :=
+ s #1 len substring$ =
+ { s len #1 + global.max$ substring$ }
+ 's
+ if$
+}
+
+%</bststd&!bstunsorted>
+%<*bststd&bstalpha>
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { et.al.char.used }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {initialize.et.al.char.used}
+{ #0 'et.al.char.used :=
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {initialize.et.al.char.used}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {format.lab.names}
+{ 's :=
+ s num.names$ 'numnames :=
+ numnames #1 >
+ { numnames #4 >
+ { #3 'namesleft := }
+ { numnames 'namesleft := }
+ if$
+ #1 'nameptr :=
+ ""
+ { namesleft #0 > }
+ { nameptr numnames =
+ { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { "{\etalchar{+}}" *
+ #1 'et.al.char.used :=
+ }
+ { s nameptr "{v{}}{l{}}" format.name$ * }
+ if$
+ }
+ { s nameptr "{v{}}{l{}}" format.name$ * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+ numnames #4 >
+ { "{\etalchar{+}}" *
+ #1 'et.al.char.used :=
+ }
+ 'skip$
+ if$
+ }
+ { s #1 "{v{}}{l{}}" format.name$
+ duplicate$ text.length$ #2 <
+ { pop$ s #1 "{ll}" format.name$ #3 text.prefix$ }
+ 'skip$
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.key.label}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.editor.key.label}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.key.organization.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key #3 text.prefix$ }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {calc.label}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.key.label
+ { type$ "proceedings" =
+ 'editor.key.organization.label
+ { type$ "manual" =
+ 'author.key.organization.label
+ 'author.key.label
+ if$
+ }
+ if$
+ }
+ if$
+ duplicate$
+ year field.or.null purify$ #-1 #2 substring$
+ *
+ 'label :=
+ year field.or.null purify$ #-1 #4 substring$
+ *
+ sortify 'sort.label :=
+}
+
+%</bststd&bstalpha>
+%<*bststd&!bstunsorted>
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {sort.format.names}
+{ 's :=
+ #1 'nameptr :=
+ ""
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { nameptr #1 >
+ { " " * }
+ 'skip$
+ if$
+%</bststd&!bstunsorted>
+% \end{macrocode}
+% \changes{0.41}{2003/11/03}{Corrected \texttt{babunsrt.bst}}%
+% \begin{macrocode}
+%<*bststd&!bstshort&!bstunsorted>
+ s nameptr "{ll{ }}{ ff{ }}{vv{ } }{ jj{ }}" format.name$ 't :=
+%</bststd&!bstshort&!bstunsorted>
+%<*bststd&bstshort&!bstunsorted>
+ s nameptr "{ll{ }}{ f{ }}{vv{ } }{ jj{ }}" format.name$ 't :=
+%</bststd&bstshort&!bstunsorted>
+%<*bststd&!bstunsorted>
+ nameptr numnames = t "others" = and
+ { "et al" * }
+ { t sortify * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {sort.format.title}
+{ 't :=
+ "A " #2
+ "An " #3
+ "The " #4 t chop.word
+ chop.word
+ chop.word
+ sortify
+ #1 global.max$ substring$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.sort}
+{ author empty$
+ { key empty$
+ { "to sort, need author or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.editor.sort}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { "to sort, need author, editor, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {author.organization.sort}
+{ author empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need author, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {editor.organization.sort}
+{ editor empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need editor, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {presort}
+{
+%</bststd&!bstunsorted>
+%<*bststd&bstalpha>
+ calc.label
+ sort.label
+ " "
+ *
+%</bststd&bstalpha>
+%<*bststd&!bstunsorted>
+ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.sort
+ { type$ "proceedings" =
+ 'editor.organization.sort
+ { type$ "manual" =
+ 'author.organization.sort
+ 'author.sort
+ if$
+ }
+ if$
+ }
+ if$
+%</bststd&!bstunsorted>
+%<bststd&bstalpha> *
+%<*bststd&!bstunsorted>
+ " "
+ *
+ year field.or.null sortify
+ *
+ " "
+ *
+ title field.or.null
+ sort.format.title
+ *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {presort}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+SORT
+
+%</bststd&!bstunsorted>
+%<*bststd&!bstalpha>
+% \end{macrocode}
+%
+% \begin{macrocode}
+STRINGS { longest.label }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { number.label longest.label.width }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #1 'number.label :=
+ #0 'longest.label.width :=
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {longest.label.pass}
+{ number.label int.to.str$ 'label :=
+ number.label #1 + 'number.label :=
+ label width$ longest.label.width >
+ { label 'longest.label :=
+ label width$ 'longest.label.width :=
+ }
+ 'skip$
+ if$
+}
+%</bststd&!bstalpha>
+%<*bststd&bstalpha>
+% \end{macrocode}
+%
+% \begin{macrocode}
+STRINGS { longest.label last.sort.label next.extra }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+INTEGERS { longest.label.width last.extra.num }
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #0 int.to.chr$ 'last.sort.label :=
+ "" 'next.extra :=
+ #0 'longest.label.width :=
+ #0 'last.extra.num :=
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {forward.pass}
+{ last.sort.label sort.label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num int.to.chr$ 'extra.label :=
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ sort.label 'last.sort.label :=
+ }
+ if$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {reverse.pass}
+{ next.extra "b" =
+ { "a" 'extra.label := }
+ 'skip$
+ if$
+ label extra.label * 'label :=
+ label width$ longest.label.width >
+ { label 'longest.label :=
+ label width$ 'longest.label.width :=
+ }
+ 'skip$
+ if$
+ extra.label 'next.extra :=
+}
+%</bststd&bstalpha>
+% \end{macrocode}
+%
+% \subsubsection{Generic code}
+%
+% \begin{macrocode}
+%<*bststd>
+
+EXECUTE {initialize.longest.label}
+
+%</bststd>
+%<bststd&!bstalpha>ITERATE {longest.label.pass}
+%<bststd&bstalpha>ITERATE {forward.pass}
+%<bststd&bstalpha>REVERSE {reverse.pass}
+%<*bststd>
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {begin.bib}
+{
+%</bststd>
+%<*bststd&bstalpha>
+ et.al.char.used
+ { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
+ 'skip$
+ if$
+%</bststd&bstalpha>
+%<*bststd>
+ preamble$ empty$
+ 'skip$
+ { preamble$ write$ newline$ }
+ if$
+ "\begin{thebibliography}{" longest.label * "}" * write$ newline$
+ " \providebibliographyfont{name}{}%" write$ newline$
+ " \providebibliographyfont{lastname}{}%" write$ newline$
+ " \providebibliographyfont{title}{\emph}%" write$ newline$
+ " \providebibliographyfont{etal}{\emph}%" write$ newline$
+ " \providebibliographyfont{journal}{}%" write$ newline$
+ " \providebibliographyfont{volume}{}%" write$ newline$
+ " \providebibliographyfont{ISBN}{\MakeUppercase}%" write$ newline$
+ " \providebibliographyfont{ISSN}{\MakeUppercase}%" write$ newline$
+ " \providebibliographyfont{url}{\url}%" write$ newline$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {begin.bib}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {init.state.consts}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+ITERATE {call.type$}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+FUNCTION {end.bib}
+{ newline$
+ "\end{thebibliography}" write$ newline$
+}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+EXECUTE {end.bib}
+%</bststd>
+% \end{macrocode}
+%
+%
+% \subsection{AMS styles}
+%
+% The following \BibTeX\ styles are derived from the AMS \BibTeX-style-files
+% by the American Mathematical Society.
+% For example, see `amsplain.bst' for more documentation about the
+% original.
+% \begin{macrocode}
+%<*bstams>
+ENTRY
+ { address
+ author
+ booktitle
+ chapter
+ edition
+ editor
+ howpublished
+ institution
+ isbn
+ issn
+ journal
+ key
+ language
+ month
+ mrnumber
+ note
+ number
+ organization
+ pages
+ publisher
+ school
+ series
+ title
+ type
+ url
+ urldate
+ volume
+ year
+ }
+ {}
+ { label bysame }
+
+
+INTEGERS { output.state before.all mid.sentence }
+
+FUNCTION {init.state.consts}
+{ #0 'before.all :=
+ #1 'mid.sentence :=
+}
+
+STRINGS { s t language.state change.temp}
+
+FUNCTION {shows}
+{ duplicate$ ":::: `" swap$ * "'" * top$
+}
+
+FUNCTION {showstack}
+{"STACK================================================================"
+top$
+stack$
+"ENDSTACK============================================================="
+top$
+}
+
+FUNCTION {not}
+{ { #0 }
+ { #1 }
+ if$
+}
+
+FUNCTION {and}
+{ 'skip$
+ { pop$ #0 }
+ if$
+}
+
+FUNCTION {or}
+{ { pop$ #1 }
+ 'skip$
+ if$
+}
+
+FUNCTION {language.change.case}
+{
+ 'change.temp :=
+ 't :=
+ "\btxifchangecase {"
+ t change.temp change.case$ *
+ "}{" *
+ t *
+ "}" *
+}
+
+FUNCTION {field.or.null}
+{ duplicate$ empty$
+ { pop$ "" }
+ 'skip$
+ if$
+}
+
+% \end{macrocode}
+% \changes{1.00}{2005/02/16}{Remove \texttt{emphasize} and
+% \texttt{smallcaps} from \BibTeX\ styles}%
+% \begin{macrocode}
+FUNCTION {namefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxnamefont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+% \changes{1.12}{2005/06/19}{Add extra formatting of lastnames to
+% \BibTeX\ styles}%
+% \begin{macrocode}
+FUNCTION {lastnamefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxlastnamefont {" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {titlefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxtitlefont {" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {journalfont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxjournalfont {" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {volumefont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxvolumefont {" swap$ * "}" * }
+ if$
+}
+
+FUNCTION {etalfont}
+{ duplicate$ empty$
+ { pop$ "" }
+ { "\btxetalfont {" swap$ * "}" * }
+ if$
+}
+
+% \end{macrocode}
+% \texttt{n.dashify} is used to make sure page ranges get the \TeX\ code
+% (two hyphens) for en-dashes.
+% \begin{macrocode}
+FUNCTION {n.dashify}
+{ 't :=
+ ""
+ { t empty$ not }
+ { t #1 #1 substring$ "-" =
+ { t #1 #2 substring$ "--" = not
+ { "--" *
+ t #2 global.max$ substring$ 't :=
+ }
+ { { t #1 #1 substring$ "-" = }
+ { "-" *
+ t #2 global.max$ substring$ 't :=
+ }
+ while$
+ }
+ if$
+ }
+ { t #1 #1 substring$ *
+ t #2 global.max$ substring$ 't :=
+ }
+ if$
+ }
+ while$
+}
+
+% \end{macrocode}
+% |tie.or.space.connect| connects two items with a |~| if the
+% second item is less than 3 letters long, otherwise it just puts an
+% ordinary space.
+% \begin{macrocode}
+FUNCTION {tie.or.space.connect}
+{ duplicate$ text.length$ #3 <
+ { "~" }
+ { "\ " }
+ if$
+ swap$ * *
+}
+
+FUNCTION {add.space.if.necessary}
+{ duplicate$ "" =
+ 'skip$
+ { "\ " * }
+ if$
+}
+
+% \end{macrocode}
+% |either.or.check| gives a warning if two mutually exclusive fields
+% were used in the database.
+% \begin{macrocode}
+FUNCTION {either.or.check}
+{ empty$
+ 'pop$
+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
+ if$
+}
+
+% \end{macrocode}
+% |output.nonnull| is called by output.
+% \begin{macrocode}
+FUNCTION {output.nonnull}
+% \end{macrocode}
+% remove the top item from the stack because it's in the way.
+% \begin{macrocode}
+{ 's :=
+ output.state mid.sentence =
+% \end{macrocode}
+% If we're in mid-sentence, add a comma to the new top item and write it
+% \begin{macrocode}
+ { ", " * write$ }
+% \end{macrocode}
+% Otherwise, if we're at the beginning of a bibitem,
+% \begin{macrocode}
+ { output.state before.all =
+% \end{macrocode}
+% just write out the top item from the stack;
+% \begin{macrocode}
+ 'write$
+% \end{macrocode}
+% and the last alternative is that we're at the end of the current
+% bibitem, so we add a period to the top stack item and write it out.
+% \begin{macrocode}
+ { add.period$ " " * write$ }
+ if$
+ mid.sentence 'output.state :=
+ }
+ if$
+% \end{macrocode}
+% Put the top item back on the stack that we removed earlier.
+% \begin{macrocode}
+ s
+}
+
+% \end{macrocode}
+% Output checks to see if the stack top is empty; if not, it
+% calls output.nonnull to write it out.
+% \begin{macrocode}
+FUNCTION {output}
+{ duplicate$ empty$
+ 'pop$
+ 'output.nonnull
+ if$
+}
+
+% \end{macrocode}
+% Standard warning message for a missing or empty field. For the user
+% we call any such field `missing' without respect to the distinction
+% made by Bib\TeX\ between missing and empty.
+% \begin{macrocode}
+FUNCTION {missing.warning}
+{ "missing " swap$ * " in " * cite$ * warning$ }
+
+% \end{macrocode}
+% |output.check| is like output except that it gives a warning on-screen
+% if the given field in the database entry is empty. t is the field
+% name.
+% \begin{macrocode}
+FUNCTION {output.check}
+{ 't :=
+ duplicate$ empty$
+ { pop$ t missing.warning }
+ 'output.nonnull
+ if$
+}
+
+FUNCTION {output.bibitem}
+{ newline$
+% \end{macrocode}
+% \changes{0.40}{2003/09/26}{Switch to a fall-back language when
+% \texttt{language} field is missing}%
+% If no language is given, fall back to the language that has been
+% active at \cs{begin\{document\}}.
+% For \BibTeX, this language gets the name \texttt{nolanguage}.
+% \begin{macrocode}
+ language empty$
+ { "empty language in " cite$ * warning$
+ language.state "nolanguage" =
+ 'skip$
+ {
+ "\expandafter\btxselectlanguage\expandafter {"
+ "\btxfallbacklanguage}" * write$
+ newline$
+ }
+ if$
+ "nolanguage" 'language.state :=
+ }
+ { language.state language =
+ 'skip$
+ { "\btxselectlanguage {" language * "}" * write$
+ newline$
+ }
+ if$
+ language 'language.state :=
+ }
+ if$
+ "\bibitem{" write$
+ cite$ write$
+ "}" write$
+ newline$
+% \end{macrocode}
+% This empty string is the first thing that will be written
+% the next time \verb|write$| is called. Done this way because each
+% item is saved on the stack until we find out what punctuation
+% should be added after it. Therefore we need an empty first item.
+% \begin{macrocode}
+ ""
+ before.all 'output.state :=
+}
+
+FUNCTION {output.nonempty.mrnumber}
+{ duplicate$ missing$
+ { pop$ "" }
+ 'skip$
+ if$
+ duplicate$ empty$
+ 'pop$
+ { " \MR{" swap$ * "}" * write$ }
+ if$
+}
+
+FUNCTION {fin.entry}
+{ add.period$
+ write$
+ mrnumber output.nonempty.mrnumber
+ newline$
+}
+
+% \end{macrocode}
+% Removed |new.block|, |new.block.checka|, |new.block.checkb|,
+% |new.sentence|, |new.sentence.checka|, and |new.sentence.checkb|
+% functions here, since they don't seem to be needed in the AMS style.
+% Also moved some real basic functions like `and' and 'or' earlier in
+% the file.
+% \begin{macrocode}
+INTEGERS { nameptr namesleft numnames }
+
+% \end{macrocode}
+% The extra section to write out a language field was added
+% for babamspl.bst. Not present in babplain.bst.
+% \begin{macrocode}
+FUNCTION {format.language}
+{ language empty$
+ { "" }
+ { "\btxprintamslanguage{\btxlanguagename {" language * "}}" * }
+ if$
+}
+
+% \end{macrocode}
+% This version of format.names puts names in the format
+% ``First von Last, Jr.''
+% (i.\,e., first name first, no abbreviating to initials).
+% \begin{macrocode}
+FUNCTION {format.names}
+{ 's :=
+ #1 'nameptr :=
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ {
+ s nameptr "{ff~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * 't :=
+ nameptr #1 >
+ { namesleft #1 >
+ { ", " * t namefont * }
+ { numnames #2 >
+ { "\btxandcomma {}" * }
+ 'skip$
+ if$
+ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ "others" =
+ { " " * "\btxetalshort {.}" etalfont * }
+ { " \btxandlong {} " * t namefont * }
+ if$
+ }
+ if$
+ }
+ {
+ s nameptr "{ff~}{vv~}" format.name$
+ s nameptr "{ll}" format.name$ lastnamefont *
+ s nameptr "{, jj}" format.name$ * namefont
+ }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {format.authors}
+{ author empty$
+ { "" }
+ { bysame "\bysame" =
+ {"\bysame"}
+ { author format.names }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.editors}
+{ editor empty$
+ { "" }
+ { editor format.names
+ editor num.names$ #1 >
+ { "\ (\btxeditorsshort {.})" * }
+ { "\ (\btxeditorshort {.})" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.nonauthor.editors}
+{ editor empty$
+ { "" }
+ { editor format.names
+ editor num.names$ #1 >
+ { ", \btxeditorsshort {.}" * }
+ { ", \btxeditorshort {.}" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.title}
+{ title empty$
+ { "" }
+ { title "t" language.change.case titlefont }
+ if$
+}
+
+FUNCTION {format.journal.vol.year}
+{ journal empty$
+ { "journal name" missing.warning ""}
+ { journal journalfont }
+ if$
+ volume empty$
+ 'skip$
+ { " " * volume volumefont * }
+ if$
+ year empty$
+ { "year" missing.warning }
+ { " (" * year * ")" * }
+ if$
+}
+
+% \end{macrocode}
+% For formatting the issue number for a journal article.
+% \begin{macrocode}
+FUNCTION {format.number}
+{ number empty$
+ { "" }
+ { "\btxnumbershort {.}~" number * }
+ if$
+}
+
+% \end{macrocode}
+% For formatting miscellaneous dates
+% \begin{macrocode}
+FUNCTION {format.date}
+{ year empty$
+ { month empty$
+ { "" }
+ { "there's a month but no year in " cite$ * warning$
+ month
+ }
+ if$
+ }
+ { month empty$
+ 'year
+ { month "\ " * year * }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+% The volume, series and number information is sort of tricky.
+% This code handles it as follows:
+% If the series is present, and the volume, but not the number,
+% then we do "\emph{Book title}, Series Name, vol. 000"
+% If the series is present, and the number, but not the volume,
+% then we do "\emph{Book title}, Series Name, no. 000"
+% If the series is present, and both number and volume,
+% then we do "\emph{Book title}, vol. XX, Series Name, no. 000"
+% Finally, if the series is absent,
+% then we do "\emph{Book title}, vol. XX"
+% or "\emph{Book title}, no. 000"
+% and if both volume and number are present, give a warning message.
+% \begin{macrocode}
+FUNCTION {format.bookvolume.series.number}
+{ volume empty$
+ { "" % Push the empty string as a placeholder in case everything else
+ % is empty too.
+ series empty$
+ 'skip$
+ { pop$ series } % if series is not empty put in stack
+ if$
+ number empty$
+ 'skip$
+ { duplicate$ empty$ % if no preceding material,
+ 'skip$ % do nothing, otherwise
+ { ", " * } % add a comma and space to separate.
+ if$
+ "\btxnumbershort {.}" number tie.or.space.connect * % add the number information
+ }
+ if$
+ }
+% \end{macrocode}
+% If the volume is NOT EMPTY:
+% \begin{macrocode}
+ { "\btxvolumeshort {.}" volume tie.or.space.connect % vol. XX
+ number empty$
+ { series empty$
+ 'skip$
+ { series ", " * swap$ *} % Series Name, vol. XX
+ if$
+ }
+ { series empty$
+ { "can't use both volume and number if series info is missing"
+ warning$
+ "in BibTeX entry type `" type$ * "'" * top$
+ }
+ { ", " * series * ", \btxnumbershort {.}" * number tie.or.space.connect }
+ if$
+ }
+ if$
+ }
+ if$
+
+} % end of format.bookvolume.series.number
+
+% \end{macrocode}
+% |format.inproc.title.where.editors| is used by inproceedings entry types
+% No case changing or emphasizing for the title. We want initial
+% caps, roman.
+% We add parentheses around the address (place where conference
+% was held).
+% Likewise we add parentheses around the editors' names.
+% \begin{macrocode}
+FUNCTION {format.inproc.title.address.editors}
+{ booktitle empty$
+ { "" }
+ { booktitle
+ address empty$
+ 'skip$
+ { add.space.if.necessary "(" * address * ")" * }
+ if$
+ editor empty$
+ 'skip$
+ { add.space.if.necessary "(" * format.nonauthor.editors * ")" * }
+ if$
+ }
+ if$
+}
+
+% \end{macrocode}
+% |format.incoll.title.editors| is similar to |format.inproc...| but
+% omits the address. For collections that are not proceedings volumes.
+% \begin{macrocode}
+FUNCTION {format.incoll.title.editors}
+{ booktitle empty$
+ { "" }
+ { editor empty$
+ { booktitle }
+ { booktitle
+ add.space.if.necessary "(" * format.nonauthor.editors * ")" *
+ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.edition}
+{ edition empty$
+ { "" }
+ { output.state mid.sentence =
+ { edition "l" language.change.case " \btxeditionshort {.}" * }
+ { edition "t" language.change.case " \btxeditionshort {.}" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.isbn}
+{ isbn empty$
+ { "" }
+ { "\btxISBN~\btxISBNfont {" isbn * "}" * }
+ if$
+}
+
+FUNCTION {format.issn}
+{ issn empty$
+ { "" }
+ { "\btxISSN~\btxISSNfont {" issn * "}" * }
+ if$
+}
+
+FUNCTION {format.url}
+{ url empty$
+ { "" }
+ {
+ urldate empty$
+ { "\btxurlfont{" url * "}" * }
+ {
+ "\btxurlfont{" url *
+ "}, \btxurldatecomment{} \btxkeywordlanguage {\btxurldatefont {" *
+ urldate * "}}" *
+ }
+ if$
+ }
+ if$
+}
+
+INTEGERS { multiresult }
+
+FUNCTION {multi.page.check}
+{ 't :=
+ #0 'multiresult :=
+ { multiresult not
+ t empty$ not
+ and
+ }
+ { t #1 #1 substring$
+ duplicate$ "-" =
+ swap$ duplicate$ "," =
+ swap$ "+" =
+ or or
+ { #1 'multiresult := }
+ { t #2 global.max$ substring$ 't := }
+ if$
+ }
+ while$
+ multiresult
+}
+
+FUNCTION {format.pages}
+{ pages empty$
+ { "" }
+ { pages n.dashify }
+ if$
+}
+
+FUNCTION {format.book.pages}
+{ pages empty$
+ { "" }
+ { pages multi.page.check
+ { "\btxpagesshort {.}~" pages n.dashify * }
+ { "\btxpageshort {.}~" pages * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.chapter.pages}
+{ chapter empty$
+ 'format.book.pages
+ { type empty$
+ { "\btxchaptershort {.}~" }
+ { type "l" language.change.case " " * }
+ if$
+ chapter *
+ pages empty$
+ 'skip$
+ { ", " * format.book.pages * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {empty.misc.check}
+{ author empty$ title empty$ howpublished empty$
+ month empty$ year empty$ note empty$
+ and and and and and
+ key empty$ not and
+ { "all relevant fields are empty in " cite$ * warning$ }
+ 'skip$
+ if$
+}
+
+FUNCTION {format.thesis.type}
+{ type empty$
+ 'skip$
+ { pop$
+ type "t" language.change.case
+ }
+ if$
+}
+
+FUNCTION {format.tr.number}
+{ type empty$
+ { "\Btxtechrepshort {.}" }
+ 'type
+ if$
+ number empty$
+ { "t" language.change.case }
+ { number tie.or.space.connect }
+ if$
+}
+
+% \end{macrocode}
+% The |format.crossref| functions haven't been paid much attention
+% at the present time (June 1990) and could probably use some
+% work. MJD
+% \begin{macrocode}
+FUNCTION {format.article.crossref}
+{ key empty$
+ { journal empty$
+ { "need key or journal for " cite$ * " to crossref " * crossref *
+ warning$
+ ""
+ }
+ { "\btxinshort {} " journal journalfont * }
+ if$
+ }
+ { "\btxinshort {} " key * }
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+FUNCTION {format.crossref.editor}
+{ editor #1 "{vv~}{ll}" format.name$
+ editor num.names$ duplicate$
+ #2 >
+ { pop$ " \btxetalshort {.}" * }
+ { #2 <
+ 'skip$
+ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
+ { " \btxetalshort {.}" * }
+ { " \btxandlong {} " * editor #2 "{vv~}{ll}" format.name$ * }
+ if$
+ }
+ if$
+ }
+ if$
+}
+
+FUNCTION {format.book.crossref}
+{ volume empty$
+ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
+ "\btxinserieslong {} "
+ }
+ { "\btxvolumeshort {.}" volume tie.or.space.connect
+ " \btxofserieslong {} " *
+ }
+ if$
+ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { series empty$
+ { "need editor, key, or series for " cite$ * " to crossref " *
+ crossref * warning$
+ "" *
+ }
+ { series * }
+ if$
+ }
+ { key * }
+ if$
+ }
+ { format.crossref.editor * }
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+FUNCTION {format.incoll.inproc.crossref}
+{ editor empty$
+ editor field.or.null author field.or.null =
+ or
+ { key empty$
+ { booktitle empty$
+ { "need editor, key, or booktitle for " cite$ * " to crossref " *
+ crossref * warning$
+ ""
+ }
+ { "\btxinlong {} " * booktitle titlefont * }
+ if$
+ }
+ { "\btxinlong {} " key * }
+ if$
+ }
+ { "\btxinlong {} " format.crossref.editor * }
+ if$
+ " \cite{" * crossref * "}" *
+}
+
+% \end{macrocode}
+% The main functions for each entry type.
+%
+% journal, vol and year are formatted together because they are
+% not separated by commas.
+% \begin{macrocode}
+FUNCTION {article}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ crossref missing$
+ { format.journal.vol.year output
+ format.number output
+ format.pages "pages" output.check
+ }
+ { format.article.crossref output.nonnull
+ format.pages "pages" output.check
+ }
+ if$
+ format.issn output
+ format.url output
+ format.language *
+ note output
+ fin.entry
+}
+
+FUNCTION {book}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check }
+ { format.authors output.nonnull
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+ format.title "title" output.check
+ format.edition output
+ crossref missing$
+ { format.bookvolume.series.number output
+ publisher "publisher" output.check
+ address output
+ }
+ { format.book.crossref output.nonnull
+ }
+ if$
+ format.date "year" output.check
+ format.isbn output
+ format.url output
+ format.language *
+ note output
+ fin.entry
+}
+
+FUNCTION {booklet}
+{ output.bibitem
+ format.authors output
+ format.title "title" output.check
+ howpublished output
+ address output
+ format.date output
+ format.url output
+ note output
+ fin.entry
+}
+
+FUNCTION {inbook}
+{ output.bibitem
+ author empty$
+ { format.editors "author and editor" output.check }
+ { format.authors output.nonnull
+ crossref missing$
+ { "author and editor" editor either.or.check }
+ 'skip$
+ if$
+ }
+ if$
+ format.title "title" output.check
+ format.edition output
+ crossref missing$
+ { format.bookvolume.series.number output
+ format.chapter.pages "chapter and pages" output.check
+ publisher "publisher" output.check
+ address output
+ }
+ { format.chapter.pages "chapter and pages" output.check
+ format.book.crossref output.nonnull
+ }
+ if$
+ format.date "year" output.check
+ format.isbn output
+ format.url output
+ format.language *
+ note output
+ fin.entry
+}
+
+FUNCTION {incollection}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ crossref missing$
+ { format.incoll.title.editors "booktitle" output.check
+ format.bookvolume.series.number output
+ publisher "publisher" output.check
+ address output
+ format.edition output
+ format.date "year" output.check
+ }
+ { format.incoll.inproc.crossref output.nonnull
+ }
+ if$
+ note output
+ format.book.pages output
+ format.isbn output
+ format.url output
+ format.language *
+ fin.entry
+}
+
+FUNCTION {inproceedings}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ crossref missing$
+ { format.inproc.title.address.editors "booktitle" output.check
+ format.bookvolume.series.number output
+ organization output
+ publisher output
+ format.date "year" output.check
+ }
+ { format.incoll.inproc.crossref output.nonnull
+ }
+ if$
+ note output
+ format.book.pages output
+ format.isbn output
+ format.url output
+ format.language *
+ fin.entry
+}
+
+FUNCTION {conference} { inproceedings }
+
+FUNCTION {manual}
+{ output.bibitem
+ author empty$
+ { organization empty$
+ 'skip$
+ { organization output.nonnull
+ address output
+ }
+ if$
+ }
+ { format.authors output.nonnull }
+ if$
+ format.title "title" output.check
+ author empty$
+ { organization empty$
+ { address output }
+ 'skip$
+ if$
+ }
+ { organization output
+ address output
+ }
+ if$
+ format.edition output
+ format.date output
+ format.isbn output
+ format.url output
+ note output
+ fin.entry
+}
+
+FUNCTION {mastersthesis}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ "\btxmastthesis {}" format.thesis.type output.nonnull
+ school "school" output.check
+ address output
+ format.date "year" output.check
+ format.url output
+ note output
+ format.book.pages output
+ fin.entry
+}
+
+FUNCTION {misc}
+{ output.bibitem
+ format.authors output
+ format.title output
+ howpublished output
+ format.date output
+ format.isbn output
+ format.issn output
+ format.url output
+ note output
+ format.book.pages output
+ fin.entry
+ empty.misc.check
+}
+
+FUNCTION {phdthesis}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ "\btxphdthesis {}" format.thesis.type output.nonnull
+ school "school" output.check
+ address output
+ format.date "year" output.check
+ format.isbn output
+ format.url output
+ note output
+ format.book.pages output
+ fin.entry
+}
+
+FUNCTION {proceedings}
+{ output.bibitem
+ editor empty$
+ { organization output }
+ { format.editors output.nonnull }
+ if$
+ format.title "title" output.check
+ format.bookvolume.series.number output
+ address empty$
+ { editor empty$
+ 'skip$
+ { organization output }
+ if$
+ publisher output
+ format.date "year" output.check
+ }
+ { address output.nonnull
+ editor empty$
+ 'skip$
+ { organization output }
+ if$
+ publisher output
+ format.date "year" output.check
+ }
+ if$
+ format.isbn output
+ format.url output
+ note output
+ fin.entry
+}
+
+FUNCTION {techreport}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ format.tr.number output.nonnull
+ institution "institution" output.check
+ address output
+ format.date "year" output.check
+ format.isbn output
+ format.url output
+ note output
+ fin.entry
+}
+
+FUNCTION {unpublished}
+{ output.bibitem
+ format.authors "author" output.check
+ format.title "title" output.check
+ format.url output
+ note "note" output.check
+ format.date output
+ fin.entry
+}
+
+FUNCTION {default.type} { misc }
+
+MACRO {jan} {"\btxmonjanlong {}"}
+MACRO {feb} {"\btxmonfeblong {}"}
+MACRO {mar} {"\btxmonmarlong {}"}
+MACRO {apr} {"\btxmonaprlong {}"}
+MACRO {may} {"\btxmonmaylong {}"}
+MACRO {jun} {"\btxmonjunlong {}"}
+MACRO {jul} {"\btxmonjullong {}"}
+MACRO {aug} {"\btxmonauglong {}"}
+MACRO {sep} {"\btxmonseplong {}"}
+MACRO {oct} {"\btxmonoctlong {}"}
+MACRO {nov} {"\btxmonnovlong {}"}
+MACRO {dec} {"\btxmondeclong {}"}
+
+READ
+
+FUNCTION {sortify}
+{ purify$
+ "l" language.change.case
+}
+
+INTEGERS { len }
+
+FUNCTION {chop.word}
+{ 's :=
+ 'len :=
+ s #1 len substring$ =
+ { s len #1 + global.max$ substring$ }
+ 's
+ if$
+}
+
+FUNCTION {sort.format.names}
+{ 's :=
+ #1 'nameptr :=
+ ""
+ s num.names$ 'numnames :=
+ numnames 'namesleft :=
+ { namesleft #0 > }
+ { nameptr #1 >
+ { " " * }
+ 'skip$
+ if$
+ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
+ nameptr numnames = t "others" = and
+ { "et al" * }
+ { t sortify * }
+ if$
+ nameptr #1 + 'nameptr :=
+ namesleft #1 - 'namesleft :=
+ }
+ while$
+}
+
+FUNCTION {sort.format.title}
+{ 't :=
+ "A " #2
+ "An " #3
+ "The " #4 t chop.word
+ chop.word
+ chop.word
+ sortify
+ #1 global.max$ substring$
+}
+
+FUNCTION {author.sort}
+{ author empty$
+ { key empty$
+ { "to sort, need author or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {author.editor.sort}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { "to sort, need author, editor, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {author.organization.sort}
+{ author empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need author, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { author sort.format.names }
+ if$
+}
+
+FUNCTION {editor.organization.sort}
+{ editor empty$
+ { organization empty$
+ { key empty$
+ { "to sort, need editor, organization, or key in " cite$ * warning$
+ ""
+ }
+ { key sortify }
+ if$
+ }
+ { "The " #4 organization chop.word sortify }
+ if$
+ }
+ { editor sort.format.names }
+ if$
+}
+
+FUNCTION {presort}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.sort
+ { type$ "proceedings" =
+ 'editor.organization.sort
+ { type$ "manual" =
+ 'author.organization.sort
+ 'author.sort
+ if$
+ }
+ if$
+ }
+ if$
+ " "
+ *
+ year field.or.null sortify
+ *
+ " "
+ *
+ title field.or.null
+ sort.format.title
+ *
+ #1 entry.max$ substring$
+ 'sort.key$ :=
+}
+
+ITERATE {presort}
+
+SORT
+
+STRINGS { longest.label prev.author this.author }
+
+INTEGERS { number.label longest.label.width }
+
+FUNCTION {initialize.longest.label}
+{ "" 'longest.label :=
+ #1 'number.label :=
+ #0 'longest.label.width :=
+ "abcxyz" 'prev.author :=
+ "" 'this.author :=
+}
+
+FUNCTION {longest.label.pass}
+{ number.label int.to.str$ 'label :=
+ number.label #1 + 'number.label :=
+ label width$ longest.label.width >
+ { label 'longest.label :=
+ label width$ 'longest.label.width :=
+ }
+ 'skip$
+ if$
+ author empty$
+ { editor empty$
+ { "" }
+ 'editor
+ if$
+ }
+ 'author
+ if$
+ 'this.author :=
+ this.author prev.author =
+ { "\bysame" 'bysame := }
+ { "" 'bysame :=
+ this.author "" =
+ { "abcxyz" }
+ 'this.author
+ if$
+ 'prev.author :=
+ }
+ if$
+}
+
+EXECUTE {initialize.longest.label}
+
+ITERATE {longest.label.pass}
+
+FUNCTION {write.lines}
+{ { duplicate$ "." = NOT }
+ { write$ newline$ }
+ while$
+ pop$
+}
+
+FUNCTION {begin.bib}
+{ preamble$ empty$
+ 'skip$
+ { preamble$ write$ newline$ }
+ if$
+ "\begin{thebibliography}{" longest.label * "}" * write$ newline$
+ " \providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}"
+ write$ newline$
+ " \providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR }"
+ write$ newline$
+ " % \MRhref is called by the amsart/book/proc definition of \MR."
+ write$ newline$
+ " \providecommand{\MRhref}[2]{%" write$ newline$
+ " \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2}"
+ write$ newline$
+ " }" write$ newline$
+ " \providecommand{\href}[2]{#2}" write$ newline$
+ " \providebibliographyfont{name}{}%" write$ newline$
+ " \providebibliographyfont{lastname}{}%" write$ newline$
+ " \providebibliographyfont{title}{\emph}%" write$ newline$
+ " \providebibliographyfont{etal}{}%" write$ newline$
+ " \providebibliographyfont{journal}{}%" write$ newline$
+ " \providebibliographyfont{volume}{\textbf}%" write$ newline$
+ " \providebibliographyfont{ISBN}{\MakeUppercase}%" write$ newline$
+ " \providebibliographyfont{ISSN}{\MakeUppercase}%" write$ newline$
+ " \providebibliographyfont{url}{\url}%" write$ newline$
+ " \providecommand\btxprintamslanguage[1]{\ (#1)}"
+ write$ newline$
+}
+
+EXECUTE {begin.bib}
+
+EXECUTE {init.state.consts}
+
+ITERATE {call.type$}
+
+FUNCTION {end.bib}
+{ newline$
+ "\end{thebibliography}" write$ newline$
+}
+
+EXECUTE {end.bib}
+%</bstams>
+% \end{macrocode}
+%
+% \Finale
+
diff --git a/Master/texmf-dist/source/latex/babelbib/babelbib.ins b/Master/texmf-dist/source/latex/babelbib/babelbib.ins
new file mode 100644
index 00000000000..3af7fa758f2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/babelbib/babelbib.ins
@@ -0,0 +1,61 @@
+\def\batchfile{babelbib.ins}
+\input docstrip.tex
+\preamble
+
+ babelbib package
+
+ Copyright 2003--2005 Harald Harders
+
+ 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.
+
+ h.harders@tu-bs.de
+
+\endpreamble
+
+\askforoverwritefalse
+
+% Files
+%%%%%%%%%%%%%%%%%%%%%%
+\generate{%
+ \file{babelbib.sty}{\from{babelbib.dtx}{latex,package}}%
+ \file{afrikaans.bdf}{\from{babelbib.dtx}{latex,afrikaans}}%
+ \file{catalan.bdf}{\from{babelbib.dtx}{latex,catalan}}%
+ \file{danish.bdf}{\from{babelbib.dtx}{latex,danish}}%
+ \file{dutch.bdf}{\from{babelbib.dtx}{latex,dutch}}%
+ \file{english.bdf}{\from{babelbib.dtx}{latex,english}}%
+ \file{esperanto.bdf}{\from{babelbib.dtx}{latex,esperanto}}%
+ \file{finnish.bdf}{\from{babelbib.dtx}{latex,finnish}}%
+ \file{french.bdf}{\from{babelbib.dtx}{latex,french}}%
+ \file{german.bdf}{\from{babelbib.dtx}{latex,german}}%
+ \file{italian.bdf}{\from{babelbib.dtx}{latex,italian}}%
+ \file{norsk.bdf}{\from{babelbib.dtx}{latex,norsk}}%
+ \file{portuguese.bdf}{\from{babelbib.dtx}{latex,portuguese}}%
+ \file{spanish.bdf}{\from{babelbib.dtx}{latex,spanish}}%
+ \file{swedish.bdf}{\from{babelbib.dtx}{latex,swedish}}%
+ \usepostamble\empty
+ \file{babplain.bst}{\from{babelbib.dtx}{bst,bststd}}%
+ \file{babplain-fl.bst}{\from{babelbib.dtx}{bst,bststd,namevara}}%
+ \file{babplain-lf.bst}{\from{babelbib.dtx}{bst,bststd,namevarb}}%
+ \file{babplai3.bst}{\from{babelbib.dtx}{bst,bststd,bstthree}}%
+ \file{babplai3-fl.bst}{\from{babelbib.dtx}{bst,bststd,bstthree,namevara}}%
+ \file{babplai3-lf.bst}{\from{babelbib.dtx}{bst,bststd,bstthree,namevarb}}%
+ \file{bababbrv.bst}{\from{babelbib.dtx}{bst,bststd,bstshort}}%
+ \file{bababbrv-fl.bst}{\from{babelbib.dtx}{bst,bststd,bstshort,namevara}}%
+ \file{bababbrv-lf.bst}{\from{babelbib.dtx}{bst,bststd,bstshort,namevarb}}%
+ \file{bababbr3.bst}{\from{babelbib.dtx}{bst,bststd,bstshort,bstthree}}%
+ \file{bababbr3-fl.bst}{\from{babelbib.dtx}{bst,bststd,bstshort,bstthree,namevara}}%
+ \file{bababbr3-lf.bst}{\from{babelbib.dtx}{bst,bststd,bstshort,bstthree,namevarb}}%
+ \file{babunsrt.bst}{\from{babelbib.dtx}{bst,bststd,bstunsorted}}%
+ \file{babunsrt-fl.bst}{\from{babelbib.dtx}{bst,bststd,bstunsorted,namevara}}%
+ \file{babunsrt-lf.bst}{\from{babelbib.dtx}{bst,bststd,bstunsorted,namevarb}}%
+ \file{babalpha.bst}{\from{babelbib.dtx}{bst,bststd,bstsorted,bstalpha}}%
+ \file{babalpha-fl.bst}{\from{babelbib.dtx}{bst,bststd,bstsorted,bstalpha,namevara}}%
+ \file{babalpha-lf.bst}{\from{babelbib.dtx}{bst,bststd,bstsorted,bstalpha,namevarb}}%
+ \file{babamspl.bst}{\from{babelbib.dtx}{bst,bstams}}%
+}
+
+\Msg{* Ready}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/bbding/bbding.dtx b/Master/texmf-dist/source/latex/bbding/bbding.dtx
new file mode 100644
index 00000000000..81a05b74568
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bbding/bbding.dtx
@@ -0,0 +1,847 @@
+%\manfnttrue % remove this line if the manualfont is not on your system
+%\UsersGuidetrue % remove this line to print the full documentation.
+%
+%\iffalse metacomment
+% (c)1995--96 Peter Møller Neergaard
+% This files must be distributed, installed and used freely. You especially
+% welcome to get inspiration (if possible) from the source code.
+%
+% For information about the copyright of the metafont sources for bbding,
+% please refer to the file .....
+%
+% Install by running tex with "bbding.ins".
+%
+% To get the documentation run latex twice on this file and then print the
+% file bbding.dvi. Note that the documentation can be processed without
+% the fontmetrices available, the symbols will however be missing.
+%
+% This file 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.
+%\fi
+% \CheckSum{644}
+% \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 \~}
+%
+%
+% % I would not like to have the standard LaTeX commands in the index
+% % This is taken from `doc.dtx'
+% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
+% \DoNotIndex{\@flushglue,\@gobble,\@input}
+% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
+% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
+% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
+% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
+% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
+% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
+% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
+% \DoNotIndex{\mathcal,\csname,\def,\documentstyle,\dospecials,\edef}
+% \DoNotIndex{\egroup}
+% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
+% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
+% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
+% \DoNotIndex{\ifcase}
+% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
+% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
+% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
+% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
+% \DoNotIndex{\strutbox}
+% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
+% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
+% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
+% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
+% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
+% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
+% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
+% \DoNotIndex{\nopagebreak}
+% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
+% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
+% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
+% \DoNotIndex{\[,\{,\},\]}
+% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
+% \DoNotIndex{\baselineskip,\begin,\tw@}
+% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
+% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
+% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
+% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
+% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
+% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
+% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
+% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
+% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
+% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
+% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
+% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
+% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
+% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
+% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
+% \DoNotIndex{\bfdefault}
+%
+% % Exclude commands used for generating the index
+% \DoNotIndex{\CodelineIndex,\DeleteShortVerb,\DisableCrossrefs}
+% \DoNotIndex{\EnableCrossrefs,\OnlyDescription,\RecordChanges}
+%
+% \ifUsersGuide
+% \OnlyDescription
+% \DisableCrossrefs
+% \else
+% \RecordChanges
+% \fi
+%
+% \GetFileInfo{bbding.sty}
+%
+% \title{The \bbding-package\thanks
+% {This file has \fileversion\ and is dated \filedate}}
+% \author{Karel Horak\thanks{Made the \METAFONT-source for the font.} \\
+% Peter Møller Neergaard\thanks{Implemented the \LaTeXe-package.} \\
+% \texttt{turtle}@\texttt{diku.dk} \quad \texttt{http://www.diku.dk/students/turtle}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package provides an easy-to-use interface to the \texttt{bbding} symbol
+% set developed by \emph{Karel Horak}. The naming conventions is made
+% close to \emph{Zapf-Dingbat} as it can be found in \package{Wordperfect
+% 6.0}, however, sometimes shortening the names.
+% \end{abstract}
+%
+% % Two column table of contents --- borrowed from ``doc.dtx''
+% \ifmulticols
+% \addtocontents{toc}{\protect\begin{multicols}{2}}
+% \fi
+%
+% {\parskip 0pt % We have to reset \parskip
+% % (bug in \LaTeX)
+% \tableofcontents
+% }
+%
+% A special thought should be given to \emph{Mauro Orlandini} and \emph{Max
+% Hailperin} who developed a macro for setting paragraphs in parallel. This
+% saved me for a lot of work, when developing this manual.
+%
+% \section{Usage and Symbols}
+%
+% \noindent
+% \bbding\ provides an easy to use interface to the |bbding|-symbolfont
+% set. It is loaded by issusing the command
+% |\usepackage{bbding}| in your document preamble.
+%
+% You have the symbols shown in the following tables at your disposal. All
+% the symbols are used issuing the command written to the right of the symbol.
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{2}
+% \ScissorRight
+% \ScissorRightBrokenBottom
+% \ScissorRightBrokenTop
+% \ScissorHollowRight
+% \ScissorLeft
+% \ScissorLeftBrokenBottom
+% \ScissorLeftBrokenTop
+% \ScissorHollowLeft
+% \end{commandsInColumns}
+% \caption{Scissors}
+% \end{figure}
+
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{3}
+% \HandRight
+% \HandRightUp
+% \HandCuffRight
+% \HandCuffRightUp
+% \HandLeft
+% \HandLeftUp
+% \HandCuffLeft
+% \HandCuffLeftUp
+% \HandPencilLeft
+% \end{commandsInColumns}
+% \caption{Hands}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{3}
+% \PencilRight
+% \PencilRightUp
+% \PencilRightDown
+% \PencilLeft
+% \PencilLeftUp
+% \PencilLeftDown
+% \NibRight
+% \NibSolidRight
+% \NibLeft
+% \NibSolidLeft
+% \end{commandsInColumns}
+% \caption{Writing tools}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{3}
+% \XSolid
+% \XSolidBold
+% \XSolidBrush
+% \Plus
+% \PlusOutline
+% \PlusCenterOpen
+% \PlusThinCenterOpen
+% \Cross
+% \CrossOpenShadow
+% \CrossOutline
+% \CrossBoldOutline
+% \CrossClowerTips
+% \CrossMaltese
+% \end{commandsInColumns}
+% \caption{Crosses, plusses and the like}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{3}
+% \DavidStar
+% \DavidStarSolid
+% \JackStar
+% \JackStarBold
+% \FourStar
+% \FourStarOpen
+% \FiveStar
+% \FiveStarLines
+% \FiveStarOpen
+% \FiveStarOpenCircled
+% \FiveStarCenterOpen
+% \FiveStarOpenDotted
+% \FiveStarOutline
+% \FiveStarOutlineHeavy
+% \FiveStarConvex
+% \FiveStarShadow
+% \SixStar
+% \EightStar
+% \EightStarBold
+% \EightStarTaper
+% \EightStarConvex
+% \TwelweStar
+% \SixteenStarLight
+% \Asterisk
+% \AsteriskBold
+% \AsteriskCenterOpen
+% \AsteriskThin
+% \AsteriskThinCenterOpen
+% \AsteriskRoundedEnds
+% \FourAsterisk
+% \EightAsterisk
+% \end{commandsInColumns}
+% \caption{All kind of stars}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{2}
+% \FiveFlowerOpen
+% \FiveFlowerPetal
+% \SixFlowerOpenCenter
+% \SixFlowerRemovedOpenPetal
+% \SixFlowerAlternate
+% \SixFlowerAltPetal
+% \SixFlowerPetalDotted
+% \SixFlowerPetalRemoved
+% \EightFlowerPetalRemoved
+% \EightFlowerPetal
+% \FourClowerOpen
+% \FourClowerSolid
+% \Sparkle
+% \SparkleBold
+% \SnowflakeChevron
+% \SnowflakeChevronBold
+% \Snowflake
+% \end{commandsInColumns}
+% \caption{Flowers, snowflakes and the like}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{2}
+% \CircleSolid
+% \CircleShadow
+% \HalfCircleRight
+% \HalfCircleLeft
+% \Ellipse
+% \EllipseSolid
+% \EllipseShadow
+% \Square
+% \SquareSolid
+% \SquareShadowBottomRight
+% \SquareShadowTopRight
+% \SquareShadowTopLeft
+% \SquareCastShadowBottomRight
+% \SquareCastShadowTopRight
+% \SquareCastShadowTopLeft
+% \TriangleUp
+% \TriangleDown
+% \DiamondSolid
+% \OrnamentDiamondSolid
+% \RectangleThin
+% \Rectangle
+% \RectangleBold
+% \end{commandsInColumns}
+% \caption{Geometrical Shapes}
+% \end{figure}
+%
+% \begin{figure} \small
+% \begin{commandsInColumns}{3}
+% \Phone
+% \PhoneHandset
+% \Tape
+% \Plane
+% \Envelope
+% \Peace
+% \Checkmark
+% \CheckmarkBold
+% \SunshineOpenCircled
+% \ArrowBoldRightStrobe
+% \ArrowBoldUpRight
+% \ArrowBoldDownRight
+% \ArrowBoldRightShort
+% \ArrowBoldRightCircled
+% \end{commandsInColumns}
+% \caption{Miscellaneous}
+% \end{figure}
+% \clearpage
+% \section{How to Install \texttt{bbding}}
+%
+% I suppose that you have already got the file |bbding10.mf| containing the \METAFONT-source for the
+% \bbding-symbol set from your nearest CTAN-site. It should be placed in a
+% directory, where it can be found by \METAFONT. In order to have the file
+% working correctly with the sizechanging commands of \LaTeXe, you
+% should add the following line to the beginning of the file:%
+% \footnote{Unfortunately I am not a \METAFONT\ Wizard, so I do not know
+% if this hack is the best way to get the file work correctly (see the
+% code documentation for more information)---but it works!!!}
+% \begin{code}
+% |font_size = 10pt#;|
+% \end{code}
+%
+% Then generate the font-metrices |bbding10.tfm| using \METAFONT\ (ask your
+% system administrator for details). This is done from a command line issusing, say:
+% \begin{code}
+% |metafont \mode=|\meta{localmode}|; input bbding10|
+% \end{code}
+% where \meta{localmode} is one of the modes defined in your local setup
+% file, |local.mf|, for \METAFONT. Move the resulting |bbding10.tfm|
+% to a directory in the path, where \LaTeX\ looks for |.tfm|-files. If it
+% had also generated the bitmap-file, move it to a location, where you
+% favourite DVI-viewer can find it.
+%
+% As the last thing install the package file, by running \TeX\
+% with the file |bbding.ins|. This generates two files: |bbding.sty| and
+% |Uding.fd|. |bbding.sty| is the packages file, which is loaded by
+% \LaTeX\ and |Uding.fd| contains the loading information about the font.
+%
+% If the manualfont |manfnt.tfm|---which is only used to generate the logo
+% for \METAFONT---is not installed at your system, you should
+% remove the first line of this file
+% \begin{code}
+% |%\manfnttrue % remove this line if|\lttdots\hss
+% \end{code}
+%
+% This file is documented using \package{doc}. This means that documentation
+% and commented packagecode is contained in the single file
+% |bbding.dtx|. If you want to see the full documentation, you should remove
+% the second line of the file |bbding.dtx|
+% \begin{code}
+% |%\UsersGuidetrue % remove this line|\lttdots
+% \end{code}
+% and then run \LaTeX\ on the changed file. After this you should generate
+% the change history using |makeindex|:
+% \begin{code}
+% |makeindex -s gglo.ist -o bbding.gls bbding.glo|\hss
+% \end{code}
+% After this process the file once more.
+%
+% \medskip
+% \parmark[\copyright]%
+% At last the borrowing formal stuff: You a encouraged to copy, use, delete
+% etc.\ the package (|bbding.dtx|, |dingbat.fd| and |semantic.ins|) as much as
+% your heart desires as long as you pass it on in complete.
+% You are welcome to sneak in the code and get inspiration. You should just
+% remember: {\small \copyright 1993 Karel Horak for the \METAFONT-source and
+% \copyright 1995--1996 Peter Møller Neergaard for the style file}
+%
+% \StopEventually{
+% \ifmulticols
+% \addtocontents{toc}{\protect\end{multicols}}
+% \fi
+% }
+%
+% \section{The Code of \texttt{bbding.dtx}}
+%
+% \ifmulticols
+% \begin{multicols}{2}[\subsection{To e Done (In Priority)}]
+% \else
+% \subsection{To Be Done (Priority)}
+% \fi
+%
+% \begin{columnItemize}
+% \item Make sure, that the hack to make |bbding10.mf| work is right
+% \item Add check for the existence of |manfnt.tfm| instead of using the
+% flag |\ifmanfnt|. |\checkfont| in |ltxcheck.tex| should be the right
+% place to get the inspiration (thanks to \emph{David Carlisle}).
+
+% \end{columnItemize}
+%
+% \ifmulticols
+% \end{multicols}
+% \fi
+%
+% \subsection{Overview of the Code}
+% \changes{1.0}{1996/02/02}{Finished the naming and documentation}
+%
+% The code consits of five parts:
+%
+% \begin{itemize}
+% \item A hack making it possible to process the rest of the file without
+% the package yet installed.
+% \item The package header for |bbding.sty|.
+% \item The font definitions, which will be put in |Uding.fd| by
+% \package{docstrip} and which alse should be used, when printing the
+% documentation.
+% \item The name definitions, which primarily is intended for
+% |bbding.sty|. It is also used in the documentation, thereby making the
+% processing of the documentaion possible without the documentation
+% installed.
+% \item The driver program for preparing the documentation.
+% \end{itemize}
+%
+% \subsection{Stub for Users Guide and Documentation}
+%
+% First comes a little hack, that makes \LaTeX\ thinks it is loading the
+% package \texttt{bbding.sty}. In this way the commands in the
+% package can be used---without warnings---when printing the documentation.
+% \begin{macrocode}
+%<*documentation>
+ \makeatletter \def\@currname{bbding}
+\def\@currext{sty}
+%</documentation>
+% \end{macrocode}
+% |\@currname| and |\@currext| is internal \LaTeX-macros containg the name
+% respectively extension of the package currently being loaded. The code is
+% encapsulated in |<*documentation>|\lttdots|</documentation>| so that it is
+% not included in the style-file, when installing the package.
+%
+% \subsection{Header of \texttt{bbding.sty}}
+%
+% First in |bbding.sty| comes the code that identifies the file as a
+% \LaTeXe-package
+% \begin{macrocode}
+%<*sty>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{bbding}%
+ [1996/06/21 v1.0 Dingbats symbols%
+ ]
+%</sty>
+% \end{macrocode}
+%
+% \subsection{Defining the Fonts for Use}
+%
+% Before using the fonts the declaration of the font family should be done.
+% This is (by convention) kept in |Uding.fd|, which starts by introducing
+% itself to \LaTeX. Then the family |ding| is declared and defined in
+% one shape (medium (|n|) weight and width) and it is told that all sizes
+% comes from scaling the 10pt font.
+%
+% \begin{macrocode}
+%<*fd>
+\ProvidesFile{Uding.fd}
+ [1996/02/01 v1.0 BBding font definitions%
+ ]
+\DeclareFontFamily{U}{ding}{}
+\DeclareFontShape{U}{ding}{m}{n}{%
+ <-> bbding10 }{}
+%</fd>
+% \end{macrocode}
+%
+% |Uding.fd| is not loaded until the font is actually used, which is
+% the first time that the command |\dingfamily| is used. This command is
+% defined in the packagefile:
+%
+% \begin{macrocode}
+%<*sty>
+\newcommand{\dingfamily}{\fontencoding{U}\fontfamily{ding}\selectfont}
+% \end{macrocode}
+%
+% \subsection{Definition of Each Symbol}
+%
+% \begin{macro}{\@chooseSymbol}
+% It would unnormal to use more than one symbol at a time, so I
+% define a macro for chosing one symbol in the font. This macro is
+% called by each of symbolsmacros. This keeps the definitions of the
+% names simple and probably saves memory. I see no reason to define a
+% ``|\textding|'' command as symbols would be used only one (or perhaps
+% two) at a time.
+% \begin{macrocode}
+\newcommand{\@chooseSymbol}[1]{{\dingfamily\symbol{#1}}}
+% \end{macrocode}
+% This macro does the fontchange locally by encapsulating it in a group and
+% then sets the symbol with the desired number.
+% \end{macro}
+%
+% Then comes the definition of for each symbol:
+% As mentioned in the abstract the naming convention is inspired by the
+% names used in \package{Wordperfect 6.0} font set 5. I have however
+% shortened the
+% names. I have made a sligtly difference from the \LaTeX\ convention
+% by capitalizing the first letter of each word, which seems more
+% readable to me.
+% \begin{macrocode}
+\newcommand{\ScissorRightBrokenBottom}{\@chooseSymbol{'000}}
+\newcommand{\ScissorRight}{\@chooseSymbol{'001}}
+\newcommand{\ScissorRightBrokenTop}{\@chooseSymbol{'002}}
+\newcommand{\ScissorLeftBrokenBottom}{\@chooseSymbol{'003}}
+\newcommand{\ScissorLeft}{\@chooseSymbol{'004}}
+\newcommand{\ScissorLeftBrokenTop}{\@chooseSymbol{'005}}
+\newcommand{\ScissorHollowRight}{\@chooseSymbol{'006}}
+\newcommand{\ScissorHollowLeft}{\@chooseSymbol{'007}}
+\newcommand{\Phone}{\@chooseSymbol{'010}}
+\newcommand{\PhoneHandset}{\@chooseSymbol{'011}}
+\newcommand{\Tape}{\@chooseSymbol{'012}}
+\newcommand{\Plane}{\@chooseSymbol{'013}}
+\newcommand{\Envelope}{\@chooseSymbol{'014}}
+\newcommand{\HandCuffRight}{\@chooseSymbol{'015}}
+\newcommand{\HandCuffLeft}{\@chooseSymbol{'016}}
+\newcommand{\HandCuffRightUp}{\@chooseSymbol{'017}}
+\newcommand{\HandCuffLeftUp}{\@chooseSymbol{'020}}
+\newcommand{\HandRight}{\@chooseSymbol{'021}}
+\newcommand{\HandLeft}{\@chooseSymbol{'022}}
+\newcommand{\HandRightUp}{\@chooseSymbol{'023}}
+\newcommand{\HandLeftUp}{\@chooseSymbol{'024}}
+\newcommand{\Peace}{\@chooseSymbol{'025}}
+\newcommand{\HandPencilLeft}{\@chooseSymbol{'026}}
+\newcommand{\PencilRight}{\@chooseSymbol{'027}}
+\newcommand{\PencilLeft}{\@chooseSymbol{'030}}
+\newcommand{\PencilRightUp}{\@chooseSymbol{'031}}
+\newcommand{\PencilLeftUp}{\@chooseSymbol{'032}}
+\newcommand{\PencilRightDown}{\@chooseSymbol{'033}}
+\newcommand{\PencilLeftDown}{\@chooseSymbol{'034}}
+\newcommand{\NibRight}{\@chooseSymbol{'035}}
+\newcommand{\NibLeft}{\@chooseSymbol{'036}}
+\newcommand{\NibSolidRight}{\@chooseSymbol{'037}}
+\newcommand{\NibSolidLeft}{\@chooseSymbol{'040}}
+\newcommand{\Checkmark}{\@chooseSymbol{'041}}
+\newcommand{\CheckmarkBold}{\@chooseSymbol{'042}}
+\newcommand{\XSolid}{\@chooseSymbol{'043}}
+\newcommand{\XSolidBold}{\@chooseSymbol{'044}}
+\newcommand{\XSolidBrush}{\@chooseSymbol{'045}}
+\newcommand{\PlusOutline}{\@chooseSymbol{'046}}
+\newcommand{\Plus}{\@chooseSymbol{'047}}
+\newcommand{\PlusCenterOpen}{\@chooseSymbol{'050}}
+\newcommand{\PlusThinCenterOpen}{\@chooseSymbol{'051}}
+\newcommand{\Cross}{\@chooseSymbol{'052}}
+\newcommand{\CrossOpenShadow}{\@chooseSymbol{'053}}
+\newcommand{\CrossOutline}{\@chooseSymbol{'054}}
+\newcommand{\CrossBoldOutline}{\@chooseSymbol{'055}}
+\newcommand{\CrossMaltese}{\@chooseSymbol{'056}}
+\newcommand{\DavidStarSolid}{\@chooseSymbol{'057}}
+\newcommand{\DavidStar}{\@chooseSymbol{'060}}
+\newcommand{\FourAsterisk}{\@chooseSymbol{'061}}
+\newcommand{\JackStar}{\@chooseSymbol{'062}}
+\newcommand{\JackStarBold}{\@chooseSymbol{'063}}
+\newcommand{\CrossClowerTips}{\@chooseSymbol{'064}}
+\newcommand{\FourStar}{\@chooseSymbol{'065}}
+\newcommand{\FourStarOpen}{\@chooseSymbol{'066}}
+\newcommand{\FiveStarLines}{\@chooseSymbol{'067}}
+\newcommand{\FiveStar}{\@chooseSymbol{'070}}
+\newcommand{\FiveStarOpen}{\@chooseSymbol{'071}}
+\newcommand{\FiveStarOpenCircled}{\@chooseSymbol{'072}}
+\newcommand{\FiveStarCenterOpen}{\@chooseSymbol{'073}}
+\newcommand{\FiveStarOpenDotted}{\@chooseSymbol{'074}}
+\newcommand{\FiveStarOutline}{\@chooseSymbol{'075}}
+\newcommand{\FiveStarOutlineHeavy}{\@chooseSymbol{'076}}
+\newcommand{\FiveStarConvex}{\@chooseSymbol{'077}}
+\newcommand{\FiveStarShadow}{\@chooseSymbol{'100}}
+\newcommand{\AsteriskBold}{\@chooseSymbol{'101}}
+\newcommand{\AsteriskCenterOpen}{\@chooseSymbol{'102}}
+\newcommand{\AsteriskThin}{\@chooseSymbol{'103}}
+\newcommand{\AsteriskThinCenterOpen}{\@chooseSymbol{'104}}
+\newcommand{\EightStarTaper}{\@chooseSymbol{'105}}
+\newcommand{\EightStarConvex}{\@chooseSymbol{'106}}
+\newcommand{\SixStar}{\@chooseSymbol{'107}}
+\newcommand{\EightStar}{\@chooseSymbol{'110}}
+\newcommand{\EightStarBold}{\@chooseSymbol{'111}}
+\newcommand{\TwelweStar}{\@chooseSymbol{'112}}
+\newcommand{\SixteenStarLight}{\@chooseSymbol{'113}}
+\newcommand{\SixFlowerPetalRemoved}{\@chooseSymbol{'114}}
+\newcommand{\SixFlowerOpenCenter}{\@chooseSymbol{'115}}
+\newcommand{\Asterisk}{\@chooseSymbol{'116}}
+\newcommand{\SixFlowerAlternate}{\@chooseSymbol{'117}}
+\newcommand{\FiveFlowerPetal}{\@chooseSymbol{'120}}
+\newcommand{\SixFlowerPetalDotted}{\@chooseSymbol{'121}}
+\newcommand{\FiveFlowerOpen}{\@chooseSymbol{'122}}
+\newcommand{\EightFlowerPetal}{\@chooseSymbol{'123}}
+\newcommand{\SunshineOpenCircled}{\@chooseSymbol{'124}}
+\newcommand{\SixFlowerAltPetal}{\@chooseSymbol{'125}}
+\newcommand{\FourClowerOpen}{\@chooseSymbol{'126}}
+\newcommand{\FourClowerSolid}{\@chooseSymbol{'127}}
+\newcommand{\AsteriskRoundedEnds}{\@chooseSymbol{'130}}
+\newcommand{\EightFlowerPetalRemoved}{\@chooseSymbol{'131}}
+\newcommand{\EightAsterisk}{\@chooseSymbol{'132}}
+\newcommand{\SixFlowerRemovedOpenPetal}{\@chooseSymbol{'133}}
+\newcommand{\SparkleBold}{\@chooseSymbol{'134}}
+\newcommand{\Sparkle}{\@chooseSymbol{'135}}
+\newcommand{\SnowflakeChevron}{\@chooseSymbol{'136}}
+\newcommand{\SnowflakeChevronBold}{\@chooseSymbol{'137}}
+\newcommand{\Snowflake}{\@chooseSymbol{'140}}
+\newcommand{\CircleSolid}{\@chooseSymbol{'141}}
+\newcommand{\Ellipse}{\@chooseSymbol{'142}}
+\newcommand{\EllipseSolid}{\@chooseSymbol{'143}}
+\newcommand{\CircleShadow}{\@chooseSymbol{'144}}
+\newcommand{\EllipseShadow}{\@chooseSymbol{'145}}
+\newcommand{\Square}{\@chooseSymbol{'146}}
+\newcommand{\SquareSolid}{\@chooseSymbol{'147}}
+\newcommand{\SquareShadowBottomRight}{\@chooseSymbol{'150}}
+\newcommand{\SquareShadowTopRight}{\@chooseSymbol{'151}}
+\newcommand{\SquareShadowTopLeft}{\@chooseSymbol{'152}}
+\newcommand{\SquareCastShadowBottomRight}{\@chooseSymbol{'153}}
+\newcommand{\SquareCastShadowTopRight}{\@chooseSymbol{'154}}
+\newcommand{\SquareCastShadowTopLeft}{\@chooseSymbol{'155}}
+\newcommand{\TriangleUp}{\@chooseSymbol{'156}}
+\newcommand{\TriangleDown}{\@chooseSymbol{'157}}
+\newcommand{\DiamondSolid}{\@chooseSymbol{'160}}
+\newcommand{\OrnamentDiamondSolid}{\@chooseSymbol{'161}}
+\newcommand{\HalfCircleRight}{\@chooseSymbol{'162}}
+\newcommand{\HalfCircleLeft}{\@chooseSymbol{'163}}
+\newcommand{\RectangleThin}{\@chooseSymbol{'164}}
+\newcommand{\Rectangle}{\@chooseSymbol{'165}}
+\newcommand{\RectangleBold}{\@chooseSymbol{'166}}
+\newcommand{\ArrowBoldRightStrobe}{\@chooseSymbol{'167}}
+\newcommand{\ArrowBoldUpRight}{\@chooseSymbol{'170}}
+\newcommand{\ArrowBoldDownRight}{\@chooseSymbol{'171}}
+\newcommand{\ArrowBoldRightShort}{\@chooseSymbol{'172}}
+\newcommand{\ArrowBoldRightCircled}{\@chooseSymbol{'173}}
+%</sty>
+% \end{macrocode}
+% When naming I have tried to keep a maxium of four words per name. I have
+% however made a few exception to have a consistent naming.
+%
+% \subsection{Driver for the Documentation}
+%
+% The package-file (|bbding.dtx|) is ended by the \LaTeX-preamble to produce
+% the documentation. By placing it at the end, all the commands in the
+% package can be used when processing the documentation, though the
+% package is not yet installed on the system. The fontmetrices and -bitmaps
+% should however be generated before.
+% \begin{macrocode}
+%<*documentation>
+\documentclass{ltxdoc}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+
+\newif\ifmulticols
+ \IfFileExists{multicol.sty}{\multicolstrue}{}
+
+\newif\ifmanfnt
+\newif\ifUsersGuide
+
+\newcommand{\lttdots}{\ensuremath{\mathtt{\ldots}}}
+\newcommand{\CSname}[1]{\texttt{\protect\bslash#1}}
+\newcommand{\package}[1]{\textsf{#1}}
+\newcommand{\bbding}{\texttt{bbding}}
+
+\DeclareFontFamily{U}{manual}{}
+\DeclareFontShape{U}{manual}{m}{n}{<-> manfnt }{}
+\newcommand{\METAFONT}{%
+ \ifmanfnt
+ {\fontencoding{U}\fontfamily{manual}\selectfont
+ \symbol{47}\symbol{48}\symbol{49}\symbol{50}\-%
+ \symbol{51}\symbol{52}\symbol{53}\symbol{49}}%
+ \else METAFONT\fi}
+
+
+\def\GetInfo#1{%
+ \def\filename{#1}%
+ {\def\ver##1(##2)##3\relax{%
+ \def\tc{##1}%
+ \def\td{##2}%
+ \ifx \td\empty %
+ \else %
+ \edef\td{$\csname ##2\endcsname$}%
+ \fi}%
+ \def\tb##1 v##2 ##3\end{%
+ \gdef\filedate{##1}%
+ \ver ##2()\relax%
+ \xdef\fileversion{\tc\expandafter\noexpand\td}%
+ \gdef\fileinfo{##3}}%
+ \edef\ta{\csname ver@#1\endcsname}%
+ \expandafter\tb\ta\end\relax}}
+
+\def\setn@me#1#2{$\backslash$#2}
+{\catcode`\^^M=12%
+ \gdef\st@rtenv{\@ifnextchar^^M{\dropnext\setCommand}{\setCommand}}%
+ \gdef\setCommand#1#2^^M{%
+ \hbox to 1cm{#1}\hbox{\expandafter\setn@me\string#1} %
+ \@ifnextchar\end{}{\setCommand}%
+}}
+
+
+\newtoks\p@rm@rk
+\newcommand{\setparagraphmark}[1]{\p@rm@rk={#1}}
+\newcommand{\parmark}[1][\the\p@rm@rk]{%
+ \setbox0=\hbox{\huge #1}%
+ \clubpenalty=10000%
+ \noindent\hangindent=\wd0 \hangafter=-2%
+ \llap{\raise.35em\hbox{\vbox to0pt{\box0 \vss}\hfill}}}
+
+\newenvironment{code}{\begin{verse}\small}{\end{verse}}
+\newenvironment{columnItemize}%
+ {\begin{list}%
+ {$\bullet$}%
+ {\settowidth{\labelwidth}{$\bullet$}%
+ \setlength{\leftmargin}{5mm}%
+ \setlength{\labelsep}{\leftmargin}%
+ \addtolength{\labelsep}{-\labelwidth}}}%
+ {\end{list}}
+
+\newcount\c@lumnsleft
+\newcount\t@talcolumns
+\newdimen\c@lumnwidth
+\newenvironment{commandsInColumns}[1]{%
+ \t@talcolumns=#1\advance\t@talcolumns-1\c@lumnsleft=\t@talcolumns%
+ \c@lumnwidth=-2em\multiply\c@lumnwidth by \t@talcolumns%
+ \advance\c@lumnwidth by\hsize \divide\c@lumnwidth by #1%
+ \vskip\z@ % Ensures vertical mode
+ \catcode`\^^M=12%
+ \hbox\bgroup%
+ \st@rtenv%
+}
+{\ifnum\c@lumnsleft=\t@talcolumns \egroup
+ \else \egroup \fi}
+
+{\catcode`\^^M=12%
+ \gdef\st@rtenv{\@ifnextchar^^M{\dr@pnext\doNextComm@nd}{\doNextComm@nd}}%
+ \gdef\setComm@nd#1#2^^M{%
+ \hbox to \c@lumnwidth%
+ {\hbox to .5cm{#1\hss}\hbox{\expandafter\setn@me\string#1.}\hss}%
+ \advance\c@lumnsleft-1%
+ \ifnum\c@lumnsleft>0%
+ \hskip2em%
+ \else%
+ \egroup%
+ \hbox\bgroup%
+ \c@lumnsleft\t@talcolumns%
+ \fi%
+ \doNextComm@nd%
+ }}
+\def\dr@pnext#1#2{#1}
+\def\doNextComm@nd{\@ifnextchar\end{}{\setComm@nd}}%
+\def\setn@me#1#2.{\CSname{#2}}
+ % Removes the first character (^^M) of the name generated by string
+
+{\catcode`\%=11
+\typeout{}
+\typeout{NOTE: If LaTeX complains}
+\typeout{\@spaces\@spaces Font U/manual/m/n/9 manfnt at 9.0 not loadable: ...}
+\typeout{\@spaces\space\space then remove the very first line of this file}
+\typeout{\@spaces\@spaces %\protect\manfnttrue\space ...}
+\typeout{}
+}
+
+\makeatother
+
+\begin{document}
+ \DocInput{bbding.dtx}
+\end{document}
+%</documentation>
+% \end{macrocode}
+% The documentpreamble loads \package{ltxdoc}, which is the standard
+% \LaTeXe-class for documentation and issues commands about
+% charactertables. Then it defines a bunch of commands (described below),
+% that had eased my typing of the documentation.
+% It issues some ``relaxing'' typeouts to the user, and at last it is ready
+% to really process the documenation, which is done by
+% loading itself once more using \package{docstrip}.
+%
+% The commands defined are
+% \begin{description}
+% \item[\CSname{ifmulticols}] conditional ensuring that \TeX\ branches over
+% parts setting up multiple columns, when this is not provided.
+% \item[\CSname{ifmanfnt}] conditional telling whether the manualfont used
+% for the \emph{The \TeX-book} is available. The font is used to generate
+% the \METAFONT-logo and it is declared to NFSS anyway, as it will only be
+% loaded up on request. The user will have to manually set this conditional to
+% false to avoid using the |manfnt|, which is done by removing the first
+% line. I thought it safer to ask the user to remove something written,
+% than adding something ``unwritten''.%
+% \item[\CSname{ifUsersGuide}] conditional telling wether only the users
+% guide is wanted. As with |\ifmanfnt| the user will have to remove the
+% first line of the file to get the full documentation.
+% \item[\CSname{lttdots}] gives ellipsis in a typewriter-font
+% \item[\CSname{CSname}] typeset a commandname when it is not possible using
+% the standard notation, \verb+|+\lttdots\verb+|+, from \package{ltxdoc} (eg.\ in
+% headers). Intentionally given a name close to \TeX's |\csname|.
+% \item[\CSname{package}] sets the name of \LaTeX-package.
+% \item[\CSname{bbding}] gives the package-symbol (name in a typewriter-font)
+% \item[\CSname{GetInfo}] defines the commands |\fileversion|, |\filedate|
+% and |\fileinfo| with information about \bbding\
+% as provided in
+% |\providespackage|. It is mainly borrowed from a command with the same
+% name in \package{ltxdoc} but has been changed to type the additional
+% greek letter in the package version provided in parenthesis.
+% \item[\CSname{parmark} and \CSname{setparagraphmark}] is used to set a
+% given symbol in front of a paragraph. |\setparagraphmark| defines the
+% symbol to be used by |\parmark|, if no argument is given explicit.
+% \item[\texttt{code}] Environment for displaying examples in the Users Guide.
+% \item[\texttt{columnitemize}] Makes an itemizing where the bullet is not
+% idented, which would make the text too narrow when using columns.
+% \item[\texttt{commandsInColumns}] Is as specialized environment---nearly
+% deserving its own package. I owe a special thanks to \emph{Mauro
+% Orlandini} and \emph{Max Hailperin} for developing a much-like
+% environment, which gave me much inspiration.
+%
+% The environment is used to show the commands of \bbding\ in
+% columns. Inside the environment each line contains a entry, which is set
+% across the page in the number of columns given by the parameter. On each
+% line the first token not being a space is taken as the command. It is
+% first set and then its name is set in a \texttt{typewriter} font.
+%
+% \textbf{Some notes on the code}: First thing in the environment is to
+% calculate the width of the columns,
+% \[
+% \CSname{c@lumnwidth} = \frac{\textrm{textwidth} - (\textrm{no.\ of columns}-1)*\textrm{column skip}}{\textrm{no.\ of columns}}
+% \]
+% Then the counters are initialised and \TeX\ is forced into vertical
+% mode. Each line is being build in a |\hbox|, which is first started in
+% the \emph{beginning definition} of the environment. When the given
+% number of columns have been set, the box is ended (and thereby
+% added to the vertical list) and a new one is started.
+%
+% |\setComm@nd| finds one line and sets in a |\hbox| with the calculated
+% width. It is therefore declared in a group, where \emph{carriage return}
+% (\verb+^^M+) is turned into a \emph{other} character. The actual setting is
+% done by |\setn@me|, which matches out the relevant part produced by the
+% primitive |\string|. After the command is set, it is tested if this line is
+% done, ie.\ the correct number of columns have been set. In that case
+% it is ended as described above, otherwise \LaTeX\ skips to the
+% next column. At last |\doNextComm@nd| testes if there is a new command
+% or it has reaced the |\end| of the environment.
+% \end{description}
+%
+% \Finale \sloppy \PrintChanges
+\endinput
+
+
+
+
+
+
+
+
+
+
diff --git a/Master/texmf-dist/source/latex/bbding/bbding.ins b/Master/texmf-dist/source/latex/bbding/bbding.ins
new file mode 100644
index 00000000000..490ed3a7ce5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bbding/bbding.ins
@@ -0,0 +1,11 @@
+% Driverprogram for bbding.dtx
+\def\batchfile{bbding.ins}
+\input docstrip
+
+\keepsilent
+
+\generateFile{bbding.sty}{f}{\from{bbding.dtx}{sty}}
+% First the header and then all the definitions
+
+\generateFile{Uding.fd}{f}{\from{bbding.dtx}{fd}}
+% And at last the font definitions file.
diff --git a/Master/texmf-dist/source/latex/boites/Makefile b/Master/texmf-dist/source/latex/boites/Makefile
new file mode 100644
index 00000000000..dace93059c1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/boites/Makefile
@@ -0,0 +1,10 @@
+LATEX = latex --interaction=nonstopmode
+EXAMPLES = boites_examples
+DVIPS = dvips
+
+all:
+ $(LATEX) $(EXAMPLES).tex
+ $(DVIPS) -o $(EXAMPLES).ps $(EXAMPLES).dvi
+
+clean:
+ rm -f *.dvi *.ps *.aux *.log *\~ \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/boites/ligne_qui_ondule_sur_la_gauche.eps b/Master/texmf-dist/source/latex/boites/ligne_qui_ondule_sur_la_gauche.eps
new file mode 100644
index 00000000000..f4aef6bbb10
--- /dev/null
+++ b/Master/texmf-dist/source/latex/boites/ligne_qui_ondule_sur_la_gauche.eps
@@ -0,0 +1,32 @@
+%!PS-ADOBE-3.0
+%%BoundingBox: 0 0 10 2400
+%%Title: vague.eps
+%%Creator: Vincent Zoonekynd
+%%CreationDate: June 1998
+%%EndComments
+
+/vz@Dict 20 dict def vz@Dict begin
+/une_vague {
+ /y exch def /x exch def
+ gsave
+ x y moveto
+ x 4 sub y 2 add lineto
+ x y 4 add lineto
+ stroke
+ grestore
+} bind def
+/deux_vagues {
+ gsave
+ 1 setlinecap
+ 1 setlinejoin
+ 2 copy
+ une_vague
+ exch 4 add exch une_vague
+ grestore
+} bind def
+/do_it {
+ 0 4 2400 { 5 exch deux_vagues } for
+} bind def
+end
+
+vz@Dict begin do_it end \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/bpchem/bpchem.dtx b/Master/texmf-dist/source/latex/bpchem/bpchem.dtx
new file mode 100644
index 00000000000..2590bfc07d5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bpchem/bpchem.dtx
@@ -0,0 +1,486 @@
+% \iffalse
+%% File: bpchem.dtx Copyright (C) 2001
+%% Bjoern Pedersen <Bjoern.Pedersen@ch.tum.de>
+%% This file may be distributed and used freely under
+%% the Latex Project Public License
+%%
+%%
+%
+%<*dtx>
+ \ProvidesFile{bpchem.dtx}[2004/11/06 v1.05 Chemical input helper]
+%</dtx>
+%<bpchem>\NeedsTeXFormat{LaTeX2e}
+%<bpchem>\ProvidesPackage{bpchem}[2004/11/06 v1.05 Chemical input helper]
+%<bpchem>\RequirePackage{xspace}
+%<driver>\ProvidesFile{bpchem.drv}
+% \fi
+%\iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{bpchem}
+\RecordChanges
+\begin{document}
+\DocInput{bpchem.dtx}
+\end{document}
+%</driver>
+%\fi
+% \changes{v1.05}{2004/11/06}{
+% changed email
+% }
+% \changes{v1.03}{2002/11/01}{
+% re-added lost email-address
+% }
+% \GetFileInfo{bpchem.dtx}
+% \title{The \textsf{bpchem} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{Bj{\o}rn Pedersen\\ \texttt{Bjoern.Pedersen@frm2.tum.de}}
+% \date{\filedate}
+% \maketitle
+% \section{Introduction}
+%This package has been written to alleviate the task of writing
+%publications containing lots of chemistry. It provides methods for
+%typesetting chemical names, sum formulae and isotopes. It provides the
+%possibility to break very long names even over several lines.
+%
+%This package also provides a way to automatically enumerate your
+%chemical compounds, allowing for one-level subgrouping.
+%
+%What this package does not provide: Methods to draw chemical
+%compounds. Although there exist some packages,which where designed for
+%this purpose (e.g. xymtex, PPChTex) they are quite limited once you
+%get to complex organic, or metal organic compounds. I recommend using
+%an external drawing program, possibly in conjunction with psfrag, in
+%these cases.
+%
+%\section{Package options}
+% Currently this package supports only one option:
+%
+% \verb|cbgreek|
+%
+% this option causes the definitions of some macros to be changed to
+% use the cbgreek fonts. As they are not available on all systems,
+% and only in mf format, the default is to use the math fonts for
+% greek symbols.
+%
+%\section{User commands in this package}
+%\subsection{Setting chemical sum formulae: BPChem{<chemical formula>}}
+%\DescribeMacro{\BPChem}
+%Within this macro you can use \verb|\_| and \verb|\^| for correct
+%chemical sub- and superscripts.
+%Example:
+%\begin{verbatim}
+%\BPChem{C\_2H\_5OH} or \BPChem{SO\_4\^{2-}}
+%\end{verbatim}
+%\begin{minipage}{10cm}
+%\BPChem{C\_2H\_5OH} or \BPChem{SO\_4\^{2-}}
+%\end{minipage}
+%\subsection{Setting long chemical names: IUPAC{<formula or name>}}
+%\DescribeMacro{\IUPAC}
+%in addition to sub/superscripts as above, \verb|\-| is a hyphen which
+%allows further breakpoints,\verb!\|! is an (invisible) Multibreakpoint.
+%
+%This environment is especially useful for your long IUPAC-compound names.
+%
+%Example:
+%\begin{verbatim}
+ %\IUPAC{Tetra\|cyclo[2.2.2.1\^{1,4}]\-
+%un\|decane-2\-dodecyl\-5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)}
+%\end{verbatim}
+%\begin{minipage}{15em}
+%\IUPAC{Tetra\|cyclo[2.2.2.1\^{1,4}]\-^^A
+%un\|decane-2\-dodecyl\-5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)}
+%\end{minipage}
+%
+%\subsection{Enumerating and referencing chemical compounds: CNlabel\{<label>\}, CNlabelnoref\{<label>\}, CNref\{<label>\}}
+%\DescribeMacro{\CNlabel}\DescribeMacro{\CNlabelnoref}\DescribeMacro{\CNref}
+%\verb|CNlabel| defines and use \verb|#1| (via \verb|ref|) as label for
+%numbering of chemical compounds. If the label has not yet been
+%defined, it is created, otherwise it is just referenced. if you just
+%want to define the label, use \verb|\CNlabelnoref| instead.
+%
+%If you want to get just the reference, use \verb|\CNref|. This comes
+%handy for figure captions or section titles, as you would get
+%dissorder in the numbering due to the moving argument otherwise.
+%
+%The default style is: \verb|\textbf{\arabic{\counter}}|
+%
+%To change, use something like \begin{verbatim}
+%\renewcommand{\theBPCno}{\textbf{\arabic{BPCno}}}
+%\end{verbatim}
+
+%Example:
+%\begin{verbatim}
+%Alkohol \CNlabel{al} is converted to aldehyd \CNlabel{ad}. \CNref{al}
+%can also be used otherwise, while \CNref{ad} cannot.
+%\end{verbatim}
+%\begin{minipage}{20em}
+%Alkohol \CNlabel{al} is converted to aldehyd \CNlabel{ad}. \CNref{al}
+%can also be used otherwise, while \CNref{ad} cannot.
+%\end{minipage}
+
+
+
+
+%
+%
+%\subsection{Using sub-labels for classes of compounds: CNlabelsub\{<label>\}\{<sublabel>\},
+%\\CNlabelsubnoref\{<label>\}\{<sublabel>\},\\CNrefsub\{<label>\}\{<sublabel>\}}
+%\DescribeMacro{\CNlabelsub}\DescribeMacro{\CNlabelsubnoref}\DescribeMacro{\CNrefsub}
+%These commands are the same as above, with additional sub identifier
+%\verb|#2| added. If the primary identifier is not yet used, it will be
+%created and can also be referenced via the normal commands.
+%
+%The default style is:\verb|\textbf{\arabic{BPCno}\alph{BPCnoa}}}|
+%
+%To change, use something like \begin{verbatim}
+%\renewcommand{\theBPCnoa}{\textbf{\arabic{BPCno}\alph{BPCnoa}}}
+%\end{verbatim}
+
+%\begin{verbatim}
+%To demonstrate the use of sublabels, methanol \CNlabelsub{alk}{a} and
+%ethanol \CNlabelsub{alk}{b} are both natural products. The acohols \CNref{alk}
+%can synthezied bio-chemically. \CNrebsub{alk}{a} is toxic, while
+%\CNrefsub{alk}{b} is only mildly toxic.
+%\end{verbatim}
+%\begin{minipage}{20em}
+%To demonstrate the use of sublabels, methanol \CNlabelsub{alk}{a} and
+%ethanol \CNlabelsub{alk}{b} are both natural products. The alcohols \CNref{alk}
+%can synthezied bio-chemically. \CNrefsub{alk}{a} is toxic, while
+%\CNrefsub{alk}{b} is only mildly toxic.
+%\end{minipage}
+
+%\subsection{Shortcuts for common idioms in chemical literature}
+%
+%
+%\begin{description}
+%\item[\HNMR] \verb|\HNMR|
+%\item[\CNMR] \verb|\CNMR|
+%\item[\cis] \verb|\cis|
+%\item[\trans] \verb|\trans|
+
+%\item[\bpalpha] \verb|\bpalpha|
+%\item[\bpbeta] \verb|\bpbeta|
+%\item[\bpDelta] \verb|\bpdelta|
+%\item[\IUPAC{\hapto{<nummer>}}] \verb|\hapto{<number>}|
+%\end{description}
+%\textbf{Note:} Some of these macros are influenced by the
+%\verb|cbgreek| option! Use is only recommended with the
+%\verb|\BPChem| and \verb|\IUPAC| commands. Some will not even work
+%outside those commands.
+%
+%\section{Example}
+%\begin{verbatim}
+%\begin{minipage}[b]{15em}
+%some normal text and math: $A*2=B$
+%
+%Test \BPChem{ C\_{2}H\_{4}\^{+}}
+%or using math in superscript \BPChem{ C\_{2}H\_{4}\^{$+$}}
+%
+%\BPChem{Example\_{longer subscript}\^{superscript}}
+%
+%Isotope: \BPChem{\_{A}\^{B}X\^{C}\_{D}}
+%
+%\IUPAC{Tetra\|cyclo[2.2.2.1\^{1,4}]\-^^A
+%un\|decane-2\-dodecyl-5-(heptadecyl\|iso\|dodecyl\|thio\|ester)}
+%\end{minipage}
+%\end{verbatim}
+% and the resulting output:
+%
+%\begin{minipage}[b]{15em}
+%some normal text and math: $A*2=B$, just to show it.
+%
+%Test \BPChem{ C\_{2}H\_{4}\^{+}}
+%or using math in superscript \BPChem{ C\_{2}H\_{4}\^{$+$}}
+%
+%\BPChem{Example\_{longer subscript}\^{superscript}} And normal Text again
+%
+%Isotope: \BPChem{\_{A}\^{B}X\^{C}\_{D}}
+%
+%
+%\IUPAC{Tetra\|cyclo[2.2.2.1\^{1,4}]\-^^A
+%un\|decane-2\-dodecyl\-5\-(hepta\|decyl\|iso\|dodecyl\|thio\|ester)}
+%\end{minipage}
+%
+%\StopEventually
+%
+%\section{The code}
+%<*bpchem>^^J
+% first comes some option setup
+% \begin{macrocode}
+\newif\ifusecbgreek%
+\usecbgreekfalse%
+\DeclareOption{cbgreek}{\PackageInfo{bpchem}{cbgreek selected}\usecbgreektrue}
+\ProcessOptions\relax
+% \end{macrocode}
+%\begin{macro}{\textsubscript}
+%% Define a textsubscript corresponing to textsuperscript.
+%% This is now also available as the package textsubscript by
+%% D.Arsenau or as part of KOMA-Script2 by M. Kohm.
+%%
+%%
+% \begin{macrocode}
+\providecommand*\textsubscript[1]{%
+ \@textsubscript{\selectfont#1}}
+\def\@textsubscript#1{%
+ {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
+% \end{macrocode}
+%\end{macro}
+%% a register to save the length to backspace
+%% two registers needed to get back to correct
+%% working position if one is longer than the other.
+% \begin{macrocode}
+ \newlength{\BPClensub}
+ \newlength{\BPClensuper}
+ \newlength{\BPCdelta}
+%
+% \end{macrocode}
+
+%% we are in subscript and maybe the superscript was longer
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCadjustsub}{%
+ \setlength\BPCdelta{\BPClensuper}\addtolength\BPCdelta{-\BPClensub}%
+ \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+ \setlength{\BPClensub}{0pt}% reset
+ \setlength{\BPClensuper}{0pt}% reset
+ }%
+%
+% \end{macrocode}
+%% we are in superscript and maybe the subscript was longer
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCadjustsuper}{%
+ \setlength\BPCdelta{\BPClensub}\addtolength\BPCdelta{-\BPClensuper}%
+ \ifdim\BPCdelta>0pt{\kern\BPCdelta}\else\relax\fi%
+ \setlength{\BPClensub}{0pt}% reset
+ \setlength{\BPClensuper}{0pt}% reset
+ }%
+%
+% \end{macrocode}
+%
+%% make a subscript and remember length in BPClen
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCsub}[1]{%
+ \ifmmode_{#1}\settowidth\BPClensub{_{#1}}%
+ \else\textsubscript{#1}\settowidth\BPClensub{\textsubscript{#1}}\fi%
+ \futurelet\next\lookforsuper%
+ }%
+% \end{macrocode}
+%
+%% make a superscript and remember length in BPClen
+%% raise by 0.15 em, else e.g. + collides with subscript
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCsuper}[1]{%
+ \ifmmode^{#1}\settowidth\BPClensuper{^{#1}}%
+ \else\raisebox{0.15em}{\textsuperscript{#1}}%
+ \settowidth\BPClensuper{\textsuperscript{#1}}\fi%
+ \futurelet\next\lookforsub%
+ }%
+% \end{macrocode}
+%
+%
+%% see if next token is BPCsuper,
+% \begin{macrocode}
+ \DeclareRobustCommand\lookforsuper{%
+ \ifx\next\BPCsuper\let\next=\BPCsuperbs%
+ \else\let\next=\BPCadjustsub\fi\next%
+ }%
+% \end{macrocode}
+%
+%% see if next token is BPCsub
+% \begin{macrocode}
+ \DeclareRobustCommand\lookforsub{%
+ \ifx\next\BPCsub\let\next=\BPCsubbs%
+ \else\let\next=\BPCadjustsuper\fi\next%
+ }%
+%
+% \end{macrocode}
+%% backspace BPClen and make superscript
+%% eats the old \verb|\^|
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCsuperbs}[1]{\kern-\BPClensub\BPCsuper}%
+%
+% \end{macrocode}
+%% backspace and make subscript
+%% eats the old \_
+% \begin{macrocode}
+ \DeclareRobustCommand{\BPCsubbs}[1]{\kern-\BPClensuper\BPCsub}%
+%
+% \end{macrocode}
+%
+%% needed to get catcodes right
+% \begin{macrocode}
+ \DeclareRobustCommand{\DoBPChem}{}%
+ \def\DoBPChem#1{%
+ #1\endgroup%
+ }%
+\DeclareRobustCommand{\BPCSetupCat}{}
+\def\BPCSetupCat{%
+ %\catcode`^=\active%
+ %\catcode`\_=\active%
+ \BPCSetup%
+}%
+%
+\DeclareRobustCommand{\BPCSetup}{}
+\def\BPCSetup{%
+%
+ \let\_=\BPCsub%
+ \let\^=\BPCsuper%
+}%end BPCSetup
+% \end{macrocode}
+%
+%% setup for chemical formula
+% \begin{macrocode}
+\DeclareRobustCommand\BPChem{%
+ \begingroup% endgroup in DoBPChem
+ \BPCSetupCat%
+ \DoBPChem%
+ }
+% \end{macrocode}
+%
+%
+
+%% these are taken from german.sty and allow more than one break
+%% or breaks and hyphens in a word. Very useful for chemical names,
+%% as they tend to grow rather long. Two short versions are also defined
+% \changes{v1.05}{2004/11/06}{
+% fixed whitespace bug in DoIUPAC
+% }
+% \begin{macrocode}
+\DeclareRobustCommand{\allowhyphens}{\penalty\@M \hskip\z@skip}
+\DeclareRobustCommand{\BreakHyph}{\penalty\@M -\allowhyphens}
+\DeclareRobustCommand{\MultiBreak}%
+ {\penalty\@M\discretionary{-}{}{\kern.03em}%
+ \allowhyphens}
+\let\MB=\MultiBreak \let\BH=\BreakHyph
+\DeclareRobustCommand{\DoIUPAC}[1]{%
+#1\endgroup}
+\def\Prep{%
+\let\-=\BreakHyph%
+\let\|=\MultiBreak%
+\DoIUPAC%
+}
+\DeclareRobustCommand*{\IUPAC}{%
+ \begingroup\BPCSetup\ignorespaces%
+ \Prep}%
+% \end{macrocode}
+
+% \changes{v1.03}{2002/11/01}{
+% fixed bug in \textbackslash IUPAC, \textbackslash | is not getting translated
+% to \textbackslash delimitier during \textbackslash write anymore
+% }
+% \changes{v1.04}{2002/12/14}{also \textbackslash - was affected, fixed}
+%% Trick by David Kastrup <David.Kastrup@t-online.de> to make
+%% non-fragile. Otherwise \verb+\|+ would become \verb+\delimiter"026B30D+ in
+%% e.g. the toc
+% \begin{macrocode}
+\expandafter\DeclareRobustCommand\expandafter\|\expandafter{\|}
+\expandafter\DeclareRobustCommand\expandafter\-\expandafter{\-}
+% \end{macrocode}
+%%%%%%%%%%%%%%%%
+%% counters for numbering of chemical substances
+% \begin{macrocode}
+\newcounter{BPCno}
+\renewcommand{\theBPCno}{\textbf{\arabic{BPCno}}}
+
+\newcounter{BPCnoa}[BPCno]
+\renewcommand{\theBPCnoa}{\textbf{\arabic{BPCno}\alph{BPCnoa}}}
+% \end{macrocode}
+
+%% helper functions to mark first definition
+% \begin{macrocode}
+\newcommand{\newchems@b}[2]{
+\expandafter\gdef\csname cna@#1#2\endcsname{#2}%
+}
+% \end{macrocode}
+
+%% reference a CNlabel (useful for section titles, captions etc.)
+% \begin{macrocode}
+\DeclareRobustCommand*{\CNref}[1]{%
+\ref{cn:#1}%
+}
+% \end{macrocode}
+
+%% reference a CNlabel/sublabel
+% \begin{macrocode}
+\DeclareRobustCommand*{\CNrefsub}[2]{%
+\ref{cn:#1#2}
+%%\textbf{\csname cna@#1#2\endcsname}%
+}
+% \end{macrocode}
+
+
+%% label a substance and insert the number
+% \begin{macrocode}
+\DeclareRobustCommand*{\CNlabel}[1]{%
+\CNlabelnoref{#1}
+\CNref{#1}%
+}
+% \end{macrocode}
+
+%%
+% \begin{macrocode}
+\DeclareRobustCommand*{\CNlabelnoref}[1]{%
+\expandafter\ifx\csname cnd@#1\endcsname\relax%
+{\refstepcounter{BPCno}\label{cn:#1}}%
+\expandafter\gdef\csname cnd@#1\endcsname{x}%
+\fi%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareRobustCommand*{\CNlabelsub}[2]{%
+\CNlabelsubnoref{#1}{#2}%
+\CNrefsub{#1}{#2}%
+}
+\DeclareRobustCommand*{\CNlabelsubnoref}[2]{%
+\CNlabelnoref{#1}%
+\expandafter\ifx\csname cna@#1#2\endcsname\relax%
+{\refstepcounter{BPCnoa}\label{cn:#1#2}}%
+\expandafter\gdef\csname cna@#1#2\endcsname{x}%
+%% \newchems@b{#1}{#2}%
+%% \write\@auxout{\string\newchems@b{#1}{#2}}%
+ \fi%
+}
+% \end{macrocode}
+%% more helper mcors
+% special symbols and macros for math-symbols without math-mode
+% \changes{v1.03}{2002/11/01}{added cbgreek option for using upright
+% greek and fixed namespace, old names will still work}
+% \begin{macrocode}
+\DeclareRobustCommand{\HNMR}{\IUPAC{\^{1}H-NMR}: $\delta$\xspace}
+\DeclareRobustCommand{\CNMR}{\IUPAC{\^{13}C-NMR}: $\delta$\xspace}
+\DeclareRobustCommand{\cis}{\textit{cis}\xspace}
+\DeclareRobustCommand{\trans}{\textit{trans}\xspace}
+%\DeclareRobustCommand{\R}{\textit{R}}
+%\DeclareRobustCommand{\S}{\textit{S}}
+%%%%%%%%%%%%%%%%%%%%%
+%
+\ifusecbgreek% code with roman greek
+\PackageInfo{bpchem}{using upright greek fonts from cbgreek}
+\input{lgrenc.def}
+\DeclareRobustCommand{\rm@greekletter}[1]{{\fontencoding{LGR}\selectfont%
+ \def\encodingdefault{LGR}#1}}%
+% some examples
+\DeclareRobustCommand{\bpalpha}{\rm@greekletter{a}}
+\DeclareRobustCommand{\bpbeta}{\rm@greekletter{b}}
+\DeclareRobustCommand{\bpDelta}{\rm@greekletter{D}}
+\DeclareRobustCommand{\hapto}[1]{\rm@greekletter{h}\^{#1}}
+\else
+% code with standard math greek
+\PackageInfo{bpchem}{using default math greek fonts}
+\DeclareRobustCommand{\bpalpha}{\ensuremath{\alpha}\xspace}
+\DeclareRobustCommand{\bpbeta}{\ensuremath{\beta}\xspace}
+\DeclareRobustCommand{\bpDelta}{\ensuremath{\Delta}\xspace}
+\DeclareRobustCommand{\hapto}[1]{\ensuremath{\eta^{#1}}}
+\fi
+\let\talpha\bpalpha
+\let\tbeta\bpbeta
+%%%%%%
+\DeclareRobustCommand*{\dreh}[1]%
+{$\lbrack \alpha \rbrack _{\mathrm D}^{#1}$}
+% \end{macrocode}
+%</bpchem>
+% \PrintChanges
+% \CheckSum{365}
+% \Finale
diff --git a/Master/texmf-dist/source/latex/bpchem/bpchem.ins b/Master/texmf-dist/source/latex/bpchem/bpchem.ins
new file mode 100644
index 00000000000..b1819fc8620
--- /dev/null
+++ b/Master/texmf-dist/source/latex/bpchem/bpchem.ins
@@ -0,0 +1,6 @@
+%% DocStrip driver for bpbrief
+\input docstrip
+\askonceonly
+\generate{\file{bpchem.sty}{\from{bpchem.dtx}{bpchem}}
+}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/burmese/birm.pl b/Master/texmf-dist/source/latex/burmese/birm.pl
new file mode 100644
index 00000000000..7c0f5cb9085
--- /dev/null
+++ b/Master/texmf-dist/source/latex/burmese/birm.pl
@@ -0,0 +1,306 @@
+#!/usr/bin/perl -w
+#
+# preprocessor for Burmese transliterated text preparing it to be typeset as Burmese by
+# LaTeX
+# author: Johannes Reese
+# date: 6 July 2002
+# version: 0.003 (5 August 2002)
+# bug reports and comments to: reese@linguist.de
+#
+# Usage: perl birm.pl <FILE> (without ending; takes <FILE>.bir, produces <FILE>.tex)
+#
+# description: changes transcribed Burmese syllables into the right character
+# numbers for processing them with LaTeX, only those inside an environment
+# started with {\birm. TeX commands inside such an environment will be left
+# unchanged, only the arguments of \textbf, \emph, \textsc, and \textsf
+# will be changed, too; however, at present, these commands have no effect,
+# as only one script style is provided so far.
+# warnings: syllables must end with a space (or punctuation sign plus space)
+#
+#
+# Copyright (c) Joh. Reese 2002
+#
+# This file 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.
+#
+# IMPORTANT COPYRIGHT NOTICE:
+#
+# Permission is granted to copy this file to another file with a clearly
+# different name and to customize the declarations in that copy to serve
+# the needs of your installation, provided that you do not remove this
+# notice or original copyright notice.
+
+# However, NO PERMISSION is granted to produce or to distribute a
+# modified version of this file or the ones bound with the package
+# under its original name.
+
+# You are NOT ALLOWED to change this file.
+#
+#
+if("$ARGV[0].tex") # protects possibly existing files
+{
+ print "The file to be produced already exists! Shall it be destroyed, press y\n";
+ $Eingabe = <STDIN>;
+ if($Eingabe eq "y\n")
+ {
+ unlink("$ARGV[0].tex");
+ print "done!\n";
+ }
+ else
+ {
+ print "Okay, don't worry! Nothing happened\n";
+ die;
+ }
+}
+open(IN, "$ARGV[0].bir"); # the file with the transliterated text
+open(OUT, ">>$ARGV[0].tex"); # the tex-file with the input for Burmese; non-Burmese
+# text is left unchanged
+$Schalter = 0; # as long as this is 0, nothing will be changed
+while(<IN>)
+{
+ $Line = $_;
+ $CharPos = 0;
+ $Letzt = 0;
+ @Zeile = ();
+ $LineLen = length($Line);
+ until($CharPos == $LineLen)
+ {
+ if(substr($Line,$CharPos,1) eq " " || substr($Line,$CharPos,1) eq "\n")
+ {
+ # hopefully, you put a space between each syllable
+ $Laenge = $CharPos - $Letzt;
+ $zeile = substr($Line,$Letzt,$Laenge); # this is one syllable
+ $Letzt = $CharPos;
+ push(@Zeile,$zeile); # get a list in order
+#to handle every syllable independently
+ }
+ $CharPos++;
+ }
+ for($i=0;$i<=$#Zeile;$i++)
+ {
+ if($Zeile[$i] =~ /\{\\birm/)
+ {
+ $Zeile[$i] =~ s/\\birm/\\birm\\relsize\{+1\}/g; # the original Burmese font
+ # is a bit small
+ $Schalter = 1; # puts the substitution routine on
+ }
+ elsif($Schalter > 0)
+ {
+ $ZeilPos = 0;
+ $ZeilLen = length($Zeile[$i]);
+ until($ZeilPos == $ZeilLen) # allows environments inside a Burmese one
+ {
+ if(substr($Zeile[$i],$ZeilPos,1) eq "\{")
+ {
+ $Schalter++;
+ }
+ elsif(substr($Zeile[$i],$ZeilPos,1) eq "\}")
+ {
+ $Schalter--;
+ }
+ $ZeilPos++;
+ }
+ $Zeile[$i] =~ s/\\large/\\relsize\{\+1\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\Large/\\relsize\{\+2\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\LARGE/\\relsize\{\+3\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\huge/\\relsize\{\+4\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\Huge/\\relsize\{\+5\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\small/\\relsize\{\-1\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\footnotesize/\\relsize\{\-2\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\scriptsize/\\relsize\{\-3\}/g;#original Burmese font is small
+ $Zeile[$i] =~ s/\\tiny/\\relsize\{\-4\}/g;#original Burmese font is small
+ unless($Zeile[$i] =~ /\\/) # don't touch TeX commands;
+ ## unfortunately, arguments to TeX commands
+ ## will be left unchanged, too
+ {
+ &tausch; # run the substitution subroutine
+ }
+################## begin of list of commands the arguments of which must be changed
+ elsif($Zeile[$i] =~ /\\textbf/) # change the arguments of TeX commands,
+ # but not the commands themselves
+ {
+ $spalter = index($Zeile[$i],"\{"); # where the argument starts
+ $antispalter = length($Zeile[$i]) - $spalter; #the length of the argument
+ $Rest = substr($Zeile[$i],0,$spalter); # the TeX command
+ $Zeile[$i] = substr($Zeile[$i],$spalter,$antispalter); # the argument
+ &tausch; # substitute the argument by the right Burmese characters
+ $Zeile[$i] = $Rest . $Zeile[$i]; # put both together again
+ }
+ elsif($Zeile[$i] =~ /\\emph/) # change the arguments of TeX commands,
+ # but not the commands themselves
+ {
+ $spalter = index($Zeile[$i],"\{"); # where the argument starts
+ $antispalter = length($Zeile[$i]) - $spalter; #the length of the argument
+ $Rest = substr($Zeile[$i],0,$spalter); # the TeX command
+ $Zeile[$i] = substr($Zeile[$i],$spalter,$antispalter); # the argument
+ &tausch; # substitute the argument by the right Burmese characters
+ $Zeile[$i] = $Rest . $Zeile[$i]; # put both together again
+ }
+ elsif($Zeile[$i] =~ /\\textsc/) # change the arguments of TeX commands,
+ # but not the commands themselves
+ {
+ $spalter = index($Zeile[$i],"\{"); # where the argument starts
+ $antispalter = length($Zeile[$i]) - $spalter; #the length of the argument
+ $Rest = substr($Zeile[$i],0,$spalter); # the TeX command
+ $Zeile[$i] = substr($Zeile[$i],$spalter,$antispalter); # the argument
+ &tausch; # substitute the argument by the right Burmese characters
+ $Zeile[$i] = $Rest . $Zeile[$i]; # put both together again
+ }
+ elsif($Zeile[$i] =~ /\\textsf/) # change the arguments of TeX commands,
+ # but not the commands themselves
+ {
+ $spalter = index($Zeile[$i],"\{"); # where the argument starts
+ $antispalter = length($Zeile[$i]) - $spalter; #the length of the argument
+ $Rest = substr($Zeile[$i],0,$spalter); # the TeX command
+ $Zeile[$i] = substr($Zeile[$i],$spalter,$antispalter); # the argument
+ &tausch; # substitute the argument by the right Burmese characters
+ $Zeile[$i] = $Rest . $Zeile[$i]; # put both together again
+ }
+######################### end of repeatable list of commands the arguments of which must be changed
+ }
+ }
+print OUT @Zeile;
+print OUT "\n"; # well, everything should appear in the output unchanged now,
+ # but the words inside the Burmese environment
+}
+close(IN);
+close(OUT);
+1;
+
+
+## The substitution subroutine
+
+sub tausch{
+# exchange the syllable rhyme with the correct Burmese character or character combination
+# together with Character 116, the "dummy consonant"
+# an 'h' signals the third tone, a '-sign the fourth tone,
+# a double vowel indicates the second tone, the first tone is unmarked
+# "N" stands for nasalized vowels
+# cf. burmguide.ps
+
+$Zeile[$i] =~ s/HNAI\'/XXX89/;
+$Zeile[$i] =~ s/YWEI/XXX737/;
+
+$Zeile[$i] =~ s/^ w/ W/;
+$Zeile[$i] =~ s/^ y/ Y/;
+$Zeile[$i] =~ s/aaN/XXX116XXX114XXX102\{\}/;
+$Zeile[$i] =~ s/ahN/XXX116XXX114XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/aN/XXX116XXX114XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/aaiN/XXX116XXX100XXX107XXX105XXX102\{\}/;
+$Zeile[$i] =~ s/aihN/XXX116XXX100XXX107XXX105XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/aiN/XXX116XXX100XXX107XXX105XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/eeiN/XXX116XXX100XXX114XXX102\{\}/;
+$Zeile[$i] =~ s/eihN/XXX116XXX100XXX114XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/eiN/XXX116XXX100XXX114XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/iiN/XXX116XXX105XXX102\{\}/;
+$Zeile[$i] =~ s/ihN/XXX116\{\}XXX105\{\}XXX102\{\}XXX59\{\}\{\}/;
+$Zeile[$i] =~ s/iN/XXX116XXX105XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/oouN/XXX116XXX107XXX114XXX102\{\}/;
+$Zeile[$i] =~ s/ouhN/XXX116XXX107XXX114XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/ouN/XXX116XXX107XXX114XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/aauN/XXX97XXX116XXX109XXX105XXX102\{\}/;
+$Zeile[$i] =~ s/auhN/XXX97XXX116XXX109XXX105XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/auN/XXX97XXX116XXX109XXX105XXX102XXX104\{\}/;
+$Zeile[$i] =~ s/uuN/XXX116XXX71XXX114XXX102\{\}/;
+$Zeile[$i] =~ s/uhN/XXX116XXX71XXX114XXX102XXX59\{\}/;
+$Zeile[$i] =~ s/uN/XXX116XXX71XXX114\{\}/;
+$Zeile[$i] =~ s/ai\'/XXX116XXX100XXX107XXX117XXX102\{\}/;
+$Zeile[$i] =~ s/ei\'/XXX116XXX100XXX121XXX102\{\}/;
+$Zeile[$i] =~ s/ou\'/XXX116XXX107XXX121XXX102\{\}/;
+$Zeile[$i] =~ s/au\'/XXX97XXX116XXX109XXX117XXX102\{\}/;
+$Zeile[$i] =~ s/eei/XXX97XXX116\{\}/;
+$Zeile[$i] =~ s/eih/XXX97XXX116XXX59\{\}/;
+$Zeile[$i] =~ s/ei/XXX97XXX116XXX104\{\}/;
+$Zeile[$i] =~ s/ee/XXX116XXX44XXX102\{\}/;
+$Zeile[$i] =~ s/eh/XXX116XXX74\{\}/;
+$Zeile[$i] =~ s/e\'/XXX116XXX117XXX102\{\}/;
+$Zeile[$i] =~ s/ii/XXX116XXX68\{\}/;
+$Zeile[$i] =~ s/ih/XXX116XXX68XXX59\{\}/;
+$Zeile[$i] =~ s/i\'/XXX116XXX112XXX102\{\}/;
+$Zeile[$i] =~ s/i/XXX116XXX100\{\}/;
+$Zeile[$i] =~ s/e/XXX116XXX74XXX104\{\}/;
+$Zeile[$i] =~ s/aa/XXX116XXX109\{\}/;
+$Zeile[$i] =~ s/ah/XXX116XXX109XXX59\{\}/;
+$Zeile[$i] =~ s/a\'/XXX116XXX121XXX102\{\}/;
+$Zeile[$i] =~ s/a/XXX116\{\}/;
+$Zeile[$i] =~ s/oh/XXX97XXX116\{\}/;
+$Zeile[$i] =~ s/ouh/XXX116XXX100XXX107XXX59\{\}/;
+$Zeile[$i] =~ s/ou/XXX116XXX100XXX107XXX104\{\}/;
+$Zeile[$i] =~ s/oou/XXX116XXX100XXX107\{\}/;
+$Zeile[$i] =~ s/oo/XXX97XXX116XXX102\{\}/;
+$Zeile[$i] =~ s/o/XXX97XXX116XXX109\{\}/;
+$Zeile[$i] =~ s/uu/XXX116XXX108\{\}/;
+$Zeile[$i] =~ s/uh/XXX116XXX108XXX59\{\}/;
+$Zeile[$i] =~ s/u\'/XXX116XXX71XXX121XXX102\{\}/;
+$Zeile[$i] =~ s/u/XXX116XXX107\{\}/;
+$Zeile[$i] =~ s/w/üXXX71/;
+$Zeile[$i] =~ s/y/äXXX115/;
+
+$Zeile[$i] =~ s/üXXX71XXX116/XXX116XXX71/g;
+$Zeile[$i] =~ s/äXXX115XXX116/XXX116XXX115/g;
+$Zeile[$i] =~ s/üXXX71XXX97XXX116/XXX97XXX116XXX71/g;
+$Zeile[$i] =~ s/äXXX115XXX97XXX116/XXX97XXX116XXX115/g;
+
+
+$Zeile[$i] =~ s/II/XXX84\{\}/;
+$Zeile[$i] =~ s/I/XXX117XXX85XXX107\{\}/;
+$Zeile[$i] =~ s/\./XXX47XXX47\{\}/;
+$Zeile[$i] =~ s/,/XXX47\{\}/;
+$Zeile[$i] =~ s/I2/XXX116\.\{\}/;
+$Zeile[$i] =~ s/EI\'/XXX116XXX123\{\}/;
+$Zeile[$i] =~ s/OO/XXX116XXX97XXX45XXX111XXX109XXX102/;
+$Zeile[$i] =~ s/Oh/XXX116XXX45XXX111/;
+$Zeile[$i] =~ s/O/XXX116XXX97XXX45XXX111XXX109XXX104/;
+$Zeile[$i] =~ s/UU/XXX116XXX79XXX68/;
+$Zeile[$i] =~ s/Uh/XXX116XXX79XXX68XXX59/;
+$Zeile[$i] =~ s/U/XXX116XXX79/;
+
+
+# look if there is a consonant to substitute Character 116, the "dummy consonant"
+if($Zeile[$i] =~ /^ Y/){$Zeile[$i] =~ s/XXX116/XXX44/g;$Zeile[$i] =~ s/^ Y/ /g;} # oder XXX38
+elsif($Zeile[$i] =~ /^ W/){$Zeile[$i] =~ s/XXX116/XXX48/g;$Zeile[$i] =~ s/^ W/ /g;}
+#elsif($Zeile[$i] =~ /y/){$Zeile[$i] =~ s/y/XXX115/g;} # oder XXX106
+#elsif($Zeile[$i] =~ /w/){$Zeile[$i] =~ s/w/XXX71/g;}
+
+elsif($Zeile[$i] =~ /hw/){$Zeile[$i] =~ s/XXX116/XXX44XXX83/g;$Zeile[$i] =~ s/hw//g;}
+elsif($Zeile[$i] =~ /hl/){$Zeile[$i] =~ s/XXX116/XXX118XXX83/g;$Zeile[$i] =~ s/hl//g;}
+elsif($Zeile[$i] =~ /hng/){$Zeile[$i] =~ s/XXX116/XXX105XXX83/g;$Zeile[$i] =~ s/hng//g;}
+elsif($Zeile[$i] =~ /hny/){$Zeile[$i] =~ s/XXX116/XXX110XXX83/g;$Zeile[$i] =~ s/hny//g;}
+elsif($Zeile[$i] =~ /hn/){$Zeile[$i] =~ s/XXX116/XXX101XXX83/g;$Zeile[$i] =~ s/hn//g;}
+elsif($Zeile[$i] =~ /hm/){$Zeile[$i] =~ s/XXX116/XXX114XXX83/g;$Zeile[$i] =~ s/hm//g;}
+elsif($Zeile[$i] =~ /^h/){$Zeile[$i] =~ s/XXX116/XXX91/g;$Zeile[$i] =~ s/^h//g;}
+elsif($Zeile[$i] =~ /ph/){$Zeile[$i] =~ s/XXX116/XXX122/g;$Zeile[$i] =~ s/ph//g;}
+elsif($Zeile[$i] =~ /p/){$Zeile[$i] =~ s/XXX116/XXX121/g;$Zeile[$i] =~ s/p//g;}
+elsif($Zeile[$i] =~ /b/){$Zeile[$i] =~ s/XXX116/XXX65/g;$Zeile[$i] =~ s/b//g;} # oder XXX98
+#elsif($Zeile[$i] =~ /t2/){$Zeile[$i] =~ s/XXX116/XXX64/g;$Zeile[$i] =~ s/t2//g;}
+#elsif($Zeile[$i] =~ /d2/){$Zeile[$i] =~ s/XXX116/XXX89/g;$Zeile[$i] =~ s/d2//g;}
+elsif($Zeile[$i] =~ /g2/){$Zeile[$i] =~ s/XXX116/XXX67/g;$Zeile[$i] =~ s/g2//g;}
+elsif($Zeile[$i] =~ /n2/){$Zeile[$i] =~ s/XXX116/XXX37/g;$Zeile[$i] =~ s/n2//g;}
+elsif($Zeile[$i] =~ /ny2/){$Zeile[$i] =~ s/XXX116/XXX79/g;$Zeile[$i] =~ s/ny2//g;}
+elsif($Zeile[$i] =~ /th/){$Zeile[$i] =~ s/XXX116/XXX120/g;$Zeile[$i] =~ s/th//g;} # oder XXX88
+elsif($Zeile[$i] =~ /t/){$Zeile[$i] =~ s/XXX116/XXX119/g;$Zeile[$i] =~ s/t//g;}
+elsif($Zeile[$i] =~ /d/){$Zeile[$i] =~ s/XXX116/XXX34/g;$Zeile[$i] =~ s/d//g;} # oder gibts nicht
+elsif($Zeile[$i] =~ /kh/){$Zeile[$i] =~ s/XXX116/XXX99/g;$Zeile[$i] =~ s/kh//g;}
+elsif($Zeile[$i] =~ /k/){$Zeile[$i] =~ s/XXX116/XXX117/g;$Zeile[$i] =~ s/k//g;}
+elsif($Zeile[$i] =~ /g/){$Zeile[$i] =~ s/XXX116/XXX42/g;$Zeile[$i] =~ s/g//g;}
+elsif($Zeile[$i] =~ /T/){$Zeile[$i] =~ s/XXX116/XXX111/g;$Zeile[$i] =~ s/T//g;}
+elsif($Zeile[$i] =~ /sh/){$Zeile[$i] =~ s/XXX116/XXX113/g;$Zeile[$i] =~ s/sh//g;}
+elsif($Zeile[$i] =~ /s/){$Zeile[$i] =~ s/XXX116/XXX112/g;$Zeile[$i] =~ s/s//g;}
+elsif($Zeile[$i] =~ /z/){$Zeile[$i] =~ s/XXX116/XXX90/g;$Zeile[$i] =~ s/z//g;} # oder XXX112XXX115
+elsif($Zeile[$i] =~ /Sw/){$Zeile[$i] =~ s/XXX116/XXX38XXX36/g;$Zeile[$i] =~ s/Sw//g;}
+elsif($Zeile[$i] =~ /S/){$Zeile[$i] =~ s/XXX116/XXX38XXX83/g;$Zeile[$i] =~ s/S//g;}
+elsif($Zeile[$i] =~ /ch/){$Zeile[$i] =~ s/XXX116/XXX99XXX115/g;$Zeile[$i] =~ s/ch//g;} #oder XXX99XXX106
+elsif($Zeile[$i] =~ /c/){$Zeile[$i] =~ s/XXX116/XXX117XXX115/g;$Zeile[$i] =~ s/c//g;} #oder XXX117XXX125
+elsif($Zeile[$i] =~ /j/){$Zeile[$i] =~ s/XXX116/XXX42XXX115/g;$Zeile[$i] =~ s/j//g;} #oder XXX42XXX106
+elsif($Zeile[$i] =~ /m/){$Zeile[$i] =~ s/XXX116/XXX114/g;$Zeile[$i] =~ s/m//g;}
+elsif($Zeile[$i] =~ /ny/){$Zeile[$i] =~ s/XXX116/XXX110/g;$Zeile[$i] =~ s/ny//g;}
+elsif($Zeile[$i] =~ /ng/){$Zeile[$i] =~ s/XXX116/XXX105/g;$Zeile[$i] =~ s/ng//g;}
+elsif($Zeile[$i] =~ /n/){$Zeile[$i] =~ s/XXX116/XXX101/g;$Zeile[$i] =~ s/n//g;}
+elsif($Zeile[$i] =~ /l/){$Zeile[$i] =~ s/XXX116/XXX118/g;$Zeile[$i] =~ s/l//g;}
+elsif($Zeile[$i] =~ /I/ || $Zeile[$i] =~ /O/ || $Zeile[$i] =~ /U/)
+ {$Zeile[$i] =~ s/XXX116//g;}
+
+$Zeile[$i] =~ s/XXX/\\char/g;
+}
+#EOF
diff --git a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx
new file mode 100644
index 00000000000..5d6a71f3368
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.dtx
@@ -0,0 +1,711 @@
+% \iffalse
+%%
+%% File: chemcompounds.dtx Copyright (C) 2005 Stephan Schenk
+%% $Id: chemcompounds.dtx,v 1.6 2005/10/24 10:16:21 schenk Exp $
+%%
+%% Stephan Schenk (mail@schenk-stephan.de)
+%%
+% This program 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
+%
+% This package consists of the files chemcompounds.dtx and chemcompounds.ins
+%
+%%
+%% To produce the documentation, do the following:
+%%
+%% latex chemcompounds.dtx
+%% latex chemcompounds.dtx
+%% makeindex -s gglo.ist -o chemcompounds.gls chemcompounds.glo
+%% latex chemcompounds.dtx
+%%
+
+%<*driver>
+\ProvidesFile{chemcompounds.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{chemcompounds}
+%<*package>
+ [2005/10/19 v1.1.2 Dictionary for compound numbering]
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{chemcompounds.dtx}
+\RecordChanges
+\begin{document}
+ \DocInput{\filename}
+ \PrintChanges
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{188}
+%
+% \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 \~}
+%
+%
+%
+% \changes{1.1.2}{2005/10/24}{Posted on CTAN on 2005/10/24.}
+% \changes{1.0.0}{2005/07/21}{First version posted on CTAN.}
+%
+% \title{The \textsf{chemcompounds} package\thanks{This file describes
+% version \fileversion\ and has been last revised \filedate.}}
+% \author{Stephan Schenk\\mail@schenk-stephan.de}
+% \maketitle
+%
+% \setcounter{tocdepth}{1}
+%
+% \begin{abstract}
+% The \texttt{\filename} package allows for a simple consecutive numbering of
+% chemical compounds. Optionally, it is possible to supply a custom name for
+% each compound. By default the compounds are numbered following the order of
+% their appearance in the text.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Introduction}
+%
+% In chemical publications it is often necessary to consecutively number every
+% compound mentioned in the text. Although this can be simply accomplished by
+% manually inserting the corresponding numbers into the text, it is generally
+% much more tedious work since the numbering scheme tends to change several
+% times during the evolvement of the manuscript. For this reason it would be
+% nice to have an automaticism which will take care of every change.
+%
+% Being myself a chemist I've been using the \texttt{chemcono} package by Stefan
+% Schulz for this purpose quite successfully over several years. This package
+% creates a library very similar to |thebibliography|. Users can now refer to
+% entries in the library by a command very similar to |\cite|. Thus, once you
+% change the library entry every reference to it will be updated automatically
+% upon running \LaTeX\ on the file. There is only one issue associated with
+% this package: You get a list of all declared compounds inside your document
+% wich at least looks odd. I therefore decided to write a new package
+% \texttt{chemcompounds} described in this document to address this problem.
+%
+% When taking a closer look at the \texttt{chemcono} package I realised that the
+% only thing one has to do is to get rid of everything which produces text.
+% Thus, as a basis I used the mechanism of |\bibitem| and |\cite| in pretty much
+% the same way as \texttt{chemcono} does by extracting the corresponding code
+% from |article.cls| and |latex.ltx| but deleting any unnecessary commands
+% producing output. I also introduced several lines of code to make the printing
+% of the compound names more customisable.
+%
+% At present the packages knows two different modes of operation. In
+% the default |implicit| mode a compound name is created automatically as a
+% consecutive number when the compound is referenced for the first time by
+% |\compound|. Thus, all compounds will be numbered
+% consecutively in the order they appear in the text. If the automatically
+% generated name is not appropriate, a custom name can be given to a compound
+% by means of the |\declarecompound| command described below.
+%
+% In |noimplicit| mode names are not generated fully automatically. Instead for
+% every compound a |\declarecompound| must be issued. This will again create a
+% subsequent number and a custom name can be given as an optional argument. The
+% main difference to |implicit| mode is that thus compounds will be
+% numbered in the order of the corresponding |\declarecompound| commands rather
+% than in the order of their appearance in the text.
+%
+%
+% \section{The user interface}
+%
+% Because of the way the implementation works, two \LaTeX\ runs are required
+% to get everything right. This should not be a problem since you have to run
+% \LaTeX\ twice anyway to get the table of contents and references right. The
+% package will issue a ``labels have changed'' warning if you have to rerun
+% \LaTeX. For every unknown compound name the package will issue a warning, too.
+%
+% \subsection{Package options}
+%
+% \begin{list}{}{\leftmargin=0pt \labelsep=0pt}
+%
+% \item
+% \DescribeMacro{implicit}
+% This option causes the package to operate in |implicit| mode. This is the
+% default.
+%
+% \item
+% \DescribeMacro{noimplicit}
+% This option is the opposite of |implicit| and causes the package to operate in
+% |noimplicit| mode.
+%
+% \end{list}
+%
+% \subsection{Assigning and accessing compound names}
+%
+% \begin{list}{}{\leftmargin=0pt \labelsep=0pt}
+%
+% \item
+% \DescribeMacro{\declarecompound}
+% |\declarecompound[|\meta{optional name}|]{|\meta{label}|}|\\
+% assigns a name to a compound.
+% If the optional argument is omitted, a consecutive number is automatically
+% taken as compound name. This command can only occur in the preamble.
+% A personal recommendation is to keep all |\declarecompound|s together in a
+% separate file and |\input| this file in the preamble.
+%
+% In |implicit| mode, if no optional argument is given, the command does nothing
+% since the automatic compound name will be generated by |\compound|.
+%
+% \item
+% \DescribeMacro{\compound}
+% |\compound{|\meta{label1}|,|\meta{label2}|,|\dots|}|\\
+% prints the name of a compound. If a list of labels is given as argument, a
+% list of names separated by |\compoundseparator| is created. In |implicit| mode
+% this command also creates a new compound name if the label is used for the
+% first time and a custom name has not already been assigned to this compound.
+%
+% \item
+% \DescribeMacro{\compound*}
+% The starred version works in almost exactly the same way as |\compound|. The
+% only difference is that it does not create any output at all. However, it
+% still creates the label in |implicit| mode. It can thus be used to create
+% ``hidden'' compounds in |implicit| mode. This, i.e., can be useful if some
+% compounds are depicted in an illustration or scheme which are only later or
+% even never mentioned in the text but the numbering scheme should take care of
+% them.
+%
+% \end{list}
+%
+%
+%
+% \subsection{Customisation}
+%
+% The commands in this section can be used to fine-tune the appearance of the
+% compound names. In order to change the default behaviour you have to
+% |\renewcommand| the corresponding commands. The defaults for every command
+% are given in parentheses.
+%
+% \begin{list}{}{\leftmargin=0pt \labelsep=0pt}
+%
+% \item
+% \DescribeMacro{\compoundseparator}
+% |\compoundseparator| (\verb*<,\penalty\@m\ <)\\
+% defines the separator in a list of compound names.
+%
+% \item
+% \DescribeMacro{\compoundglobalprefix}
+% |\compoundglobalprefix| ()\\
+% defines the prefix for a list of compound names. This will be printed also in
+% case the list has length one.
+%
+% \item
+% \DescribeMacro{\compoundglobalsuffix}
+% |\compoundglobalsuffix| ()\\
+% defines the suffix for a list of compound names. This will be printed also in
+% case the list has length one.
+%
+% \item
+% \DescribeMacro{\compoundprefix}
+% |\compoundprefix| ()\\
+% defines the prefix for every compound.
+%
+% \item
+% \DescribeMacro{\compoundsuffix}
+% |\compoundsuffix| ()\\
+% defines the suffix for every compound.
+%
+% \item
+% \DescribeMacro{\compoundstyle}
+% |\compoundstyle| (|\textbf|)\\
+% defines the style of each name.
+%
+% \item
+% \DescribeMacro{\printcompound}
+% |\printcompound|
+% (|{\compoundprefix}{\compoundstyle{#1}}{\compoundsuffix}|)\\
+% is used to actually format the name of each compound. If the previous
+% possibilities are not sufficient to meet your formatting demands the thing
+% you should redefine is this one.
+%
+% \end{list}
+%
+%
+%
+% \subsection{Examples}
+%
+% The following examples using
+% \begin{verbatim}
+% \declarecompound{label1}
+% \declarecompound{label2}
+% \declarecompound[5b]{label3}
+% \compound{label1} and \compound{label1,label2,label3}
+% \end{verbatim}
+% should clarify the meaning of the above commands. The first two
+% |\declarecommand|s could be omitted in |implicit| mode.
+%
+% \begin{itemize}
+%
+% \item
+% Using the defaults results in \textbf{1} and \textbf{1}, \textbf{2},
+% \textbf{5b}.
+%
+% \item
+% \begin{verbatim}
+% \renewcommand{\compoundstyle}{\underbar}
+% \end{verbatim}
+% gives \underbar 1 and \underbar 1, \underbar 2, \underbar{5b}.
+%
+% \item
+% \begin{verbatim}
+% \renewcommand{\compoundseparator}{;}
+% \end{verbatim}
+% gives \textbf{1} and \textbf{1}; \textbf{2}; \textbf{5b}.
+%
+% \item
+% \begin{verbatim}
+% \renewcommand{\compoundglobalprefix}{(}
+% \renewcommand{\compoundglobalsuffix}{)}
+% \end{verbatim}
+% gives (\textbf{1}) and (\textbf{1}, \textbf{2}, \textbf{5b}).
+%
+% \item
+% \begin{verbatim}
+% \renewcommand{\compoundprefix}{(}
+% \renewcommand{\compoundsuffix}{)}
+% \end{verbatim}
+% gives (\textbf{1}) and (\textbf{1}), (\textbf{2}), (\textbf{5b}).
+%
+% \item
+% \begin{verbatim}
+% \renewcommand{\compoundglobalprefix}{\textbf{[}}
+% \renewcommand{\compoundglobalsuffix}{\textbf{]}}
+% \renewcommand{\compoundprefix}{\ensuremath{\langle}}
+% \renewcommand{\compoundsuffix}{\ensuremath{\rangle}}
+% \renewcommand{\compoundstyle}{\emph}
+% \end{verbatim}
+% gives \textbf{[}$\langle$\emph{1}$\rangle$\textbf{]} and
+% \textbf{[}$\langle$\emph{1}$\rangle$,
+% $\langle$\emph{2}$\rangle$, $\langle$\emph{5b}$\rangle$\textbf{]}.
+%
+% \end{itemize}
+%
+% \noindent
+% As shown above customization is not limited solely to parentheses etc.\
+% but can include formating commands, too.
+%
+%
+%
+% \StopEventually{}
+%
+% \section{The implementation}
+%
+%\iffalse
+%<*package>
+%\fi
+%
+% \subsection{Identification}
+% The package identifies itself at the top using something like
+% \iffalse
+% Identification is already done on top of the file. Thus the following
+% code should be printed in the documentation but should not be included
+% in the package.
+%</package>
+%<*!package>
+% \fi
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chemcompounds}
+ [\filedate\space \fileversion\space Dictionary for compound numbering]
+% \end{macrocode}
+% \iffalse
+%</!package>
+%<*package>
+% \fi
+%
+% \subsection{Package options}
+%
+% \begin{macro}{\ifchemcompounds@implicit}
+% \changes{1.1.0}{2005/10/06}{New.}
+% Define a new boolean variable defining whether |implicit| mode is enabled.
+% \begin{macrocode}
+\newif\ifchemcompounds@implicit
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{implicit}
+% \changes{1.1.0}{2005/10/07}{New option.}
+% \begin{macro}{noimplicit}
+% \changes{1.1.0}{2005/10/06}{New option.}
+% The following package options set |ifchemcompounds@implicit| either to true or
+% false. The default is |implicit| mode.
+% \begin{macrocode}
+\DeclareOption{implicit}{\chemcompounds@implicittrue}
+\DeclareOption{noimplicit}{\chemcompounds@implicitfalse}
+\ExecuteOptions{implicit}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Process options.
+% \changes{1.1.0}{2005/10/06}{Added code to process options.}
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+%
+%
+% \subsection{User interface}
+%
+% The work flow for creating and accessing compound names was borrowed from the
+% definition of |\bibitem| and |\cite|.
+%
+% \begin{macro}{\compoundseparator}
+% \changes{1.1.0}{2005/10/06}{Changed default value to include trailing
+% space.}
+% \begin{macro}{\compoundglobalprefix}
+% \begin{macro}{\compoundglobalsuffix}
+% \begin{macro}{\compoundprefix}
+% \begin{macro}{\compoundsuffix}
+% \begin{macro}{\compoundstyle}
+% \begin{macro}{\printcompound}
+% \changes{1.1.2}{2005/10/18}{New. Previous \cs{@compound}
+% command.}
+% The following definitions define the default layout of the names in the text
+% (no surrounding parentheses, multiple compound names separated by comma,
+% names in bold face). |\printcompound| defines the way each name is
+% printed.
+% \begin{macrocode}
+\def\compoundseparator{,\penalty\@m\ }
+\let\compoundglobalprefix\@empty
+\let\compoundglobalsuffix\@empty
+\let\compoundprefix\@empty
+\let\compoundsuffix\@empty
+\def\compoundstyle{\textbf}
+\def\printcompound#1{{\compoundprefix}{\compoundstyle{#1}}{\compoundsuffix}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\declarecompound}
+% \changes{1.1.0}{2005/10/07}{Only in preamble.}
+% This command is used to assign a name to a compound.
+% It just looks ahead whether an optional argument was given
+% and calls the appropriate internal command. To avoid problems with the
+% creation of the labels this command is only allowed in the preamble.
+% \begin{macrocode}
+\def\declarecompound{\@ifnextchar[\@ldeclarecompound\@declarecompound}
+\@onlypreamble\declarecompound
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifchemcompounds@print}
+% \changes{1.1.2}{2005/10/18}{New.}
+% Define a new boolean variable indicating whether the starred version of
+% |\compound| was used.
+% \begin{macrocode}
+\newif\ifchemcompounds@print
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\compound}
+% \changes{1.1.2}{2005/10/18}{Only check for starred version and call internal
+% command. Functionality moved to \cs{@compound}.}
+% \changes{1.1.1}{2005/10/11}{Changed label prefix to 'comp'.}
+% \changes{1.1.0}{2005/10/07}{Changed definition of
+% \cs{compoundseparator}. Inserted \cs{@createcompoundhook}.}
+% \changes{1.0.1}{2005/10/05}{Replaced \cs{hbox} by \cs{mbox}
+% to work around some spacing issues when printing the compound name.}
+% \begin{macro}{\compound*}
+% \changes{1.1.2}{2005/10/18}{New.}
+% This command will finally print the name associated with a compound label.
+% The starred version just creates the label (in |implicit| mode) without
+% printing the value.
+% The command itself just checks whether the starred version is used, sets
+% an internal flag appropriately and calls the internal command |\@compound|.
+% \begin{macrocode}
+\DeclareRobustCommand{\compound}{%
+ \@ifstar{\chemcompounds@printfalse\@compound}
+ {\chemcompounds@printtrue\@compound}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{Internal commands}
+%
+% \begin{macro}{\@compound}
+% \changes{1.1.2}{2005/10/18}{New. Previous functionality moved to
+% \cs{printcompound}.}
+% This command retrieves the name associated with a compound and prints it
+% in the text using the previously defined format. The code is a modified
+% version of the definition of |\cite| in |latex.ltx|.
+% If this command is invoked by |\compound*|, |\ifchemcompounds@print| will be
+% false and all output will be suppressed.
+% \begin{macrocode}
+\def\@compound#1{%
+% \end{macrocode}
+% Print optional prefix to a list of compounds.
+% \begin{macrocode}
+ \ifchemcompounds@print
+ \compoundglobalprefix
+ \fi
+% \end{macrocode}
+% Now loop over every label in the argument list.
+% \begin{macrocode}
+ \let\@compounda\@empty
+ \@for\@compoundb:=#1\do{%
+ \edef\@compoundb{\expandafter\@firstofone\@compoundb}%
+% \end{macrocode}
+% Print separator. Note that it is empty for the first entry and
+% |\compoundseparator| otherwise.
+% \begin{macrocode}
+ \ifchemcompounds@print
+ \@compounda
+ \def\@compounda{{\compoundseparator}}%
+ \fi
+% \end{macrocode}
+% If compound is undefined print '\textbf{?}' and raise a warning.
+% \begin{macrocode}
+ \@ifcompoundundefined{\@compoundb}{%
+ \ifchemcompounds@print
+ \mbox{\reset@font\bfseries ?}%
+ \fi
+ \G@refundefinedtrue
+ \@latex@warning
+ {compound `\@compoundb' on page \thepage\space undefined}%
+ }{%
+% \end{macrocode}
+% If compound is known print formatted name.
+% \begin{macrocode}
+ \ifchemcompounds@print
+ \mbox{\printcompound{\@nameuse{comp@\@compoundb}}}%
+ \fi
+ }%
+% \end{macrocode}
+% In |implicit| mode |\@createcompoundhook| will generate a new name if this has
+% not been done before. In |noimplicit| mode this does nothing.
+% \begin{macrocode}
+ \@createcompoundhook{\@compoundb}%
+ }%
+% \end{macrocode}
+% Print optional suffix to a list of compounds.
+% \begin{macrocode}
+ \ifchemcompounds@print
+ \compoundglobalsuffix
+% \end{macrocode}
+% Although nothing is printed, under certain conditions an additional
+% space is created. Remove it.
+% \begin{macrocode}
+ \else
+ \unskip
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\chemcompounds@counter}
+% Define a new counter which will be used for generating the compound names.
+% \begin{macrocode}
+\newcounter{chemcompounds@counter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\chemcompounds@label}
+% \changes{1.1.1}{2005/10/11}{Changed label prefix to 'comp' since 'c' is
+% already in use.}
+% \changes{1.1.0}{2005/10/06}{Labels are now prefixed with 'c' making them
+% hopefully unique.}
+% The next command will be used in the |.aux| file and defines a new label for
+% every compound.
+% \begin{macrocode}
+\def\chemcompounds@label{\@newl@bel {comp}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\chemcompounds@writelabel}
+% \changes{1.1.2}{2005/10/18}{Added \cs{ignorespaces}.}
+% \changes{1.1.1}{2005/10/10}{\cs{noexpand} the label value. Required
+% for improved robustness.}
+% \changes{1.1.0}{2005/10/06}{New.}
+% Write the label and its value to the |aux| file.
+% \begin{macrocode}
+\def\chemcompounds@writelabel#1#2{%
+ \if@filesw
+ \begingroup
+ \def\protect{\noexpand}%
+ \immediate\write\@auxout{
+ \string\chemcompounds@label{#1}{#2}
+ }%
+ \endgroup
+ \fi
+ \ignorespaces
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ldeclarecompound}
+% \changes{1.1.0}{2005/10/06}{Completly rewritten.}
+% The next command gets called if an additional argument was supplied to
+% |\declarecompound|. It creates the compound with the given name as soon as
+% the |aux| file is writeable. This command can only be used in the preamble.
+% \begin{macrocode}
+\def\@ldeclarecompound[#1]#2{%
+ \AtBeginDocument{\@createcompound[#1]{#2}}
+}
+\@onlypreamble\@ldeclarecompound
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@declarecompound}
+% \changes{1.1.0}{2005/10/06}{Completely rewritten.}
+% In |implicit| mode this command does nothing since default names are created
+% automatically by |\compound|.
+% \begin{macrocode}
+\ifchemcompounds@implicit
+ \let\@declarecompound\@gobble
+% \end{macrocode}
+% In |noimplicit| mode this simply creates the compound as soon as
+% the |aux| file is writeable.
+% \begin{macrocode}
+\else
+ \def\@declarecompound#1{%
+ \AtBeginDocument{\@createcompound{#1}}
+ }
+\fi
+\@onlypreamble\@declarecompound
+% \end{macrocode}
+% This command can only be used in the preamble.
+% \end{macro}
+%
+% \begin{macro}{\@ifcompoundundefined}
+% \changes{1.1.1}{2005/10/11}{Changed label prefix to 'comp'.}
+% \changes{1.1.0}{2005/10/06}{New.}
+% Test whether a compound has already been defined by testing the associated
+% label.
+% \begin{macrocode}
+\def\@ifcompoundundefined#1{%
+ \@ifundefined{comp@#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@createcompound}
+% \changes{1.1.0}{2005/10/06}{New.}
+% This command is used to create a new compound name. It just looks ahead
+% whether an optional argument was given and calls the appropriate command.
+% \begin{macrocode}
+\def\@createcompound{%
+ \@ifnextchar[\@@lcreatecompound\@@createcompound
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@createcompound}
+% \changes{1.1.0}{2005/10/06}{New.}
+% If a compound name has not yet been created this command increments
+% |chemcompounds@counter| and takes the new value as the compound name.
+% The new compound name is written to the |aux| file and a flag is set to
+% indicate that a name for this compound has already been created.
+% \begin{macrocode}
+\def\@@createcompound#1{%
+ \@ifnotcompoundcreated{#1}{%
+ \stepcounter{chemcompounds@counter}%
+ \chemcompounds@writelabel{#1}{\the\value{chemcompounds@counter}}
+ \@compoundcreated{#1}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@lcreatecompound}
+% \changes{1.1.0}{2005/10/06}{New.}
+% This command creates a compound name from the first parameter and writes it
+% to the |aux| file. A flag is set to indicate that a name for this compound has
+% already been created.
+% \begin{macrocode}
+\def\@@lcreatecompound[#1]#2{%
+ \chemcompounds@writelabel{#2}{#1}
+ \@compoundcreated{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@compoundcreated}
+% \changes{1.1.1}{2005/10/11}{Changed label prefix to 'compc'.}
+% \changes{1.1.0}{2005/10/06}{New.}
+% Set a flag indicating that the compound name has been created. This is done by
+% defining an appropriate label in |implicit| mode.
+% \begin{macrocode}
+\ifchemcompounds@implicit
+ \def\@compoundcreated#1{%
+ \global\@namedef{compc@#1}{}%
+ }
+% \end{macrocode}
+% In |noimplicit| mode this is unnecessary thus just gobble the argument.
+% \begin{macrocode}
+\else
+ \let\@compoundcreated\@gobble
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ifnotcompoundcreated}
+% \changes{1.1.1}{2005/10/11}{Changed label prefix to 'compc'.}
+% \changes{1.1.0}{2005/10/07}{New.}
+% Check whether a new compound name has already been created.
+% In |implicit| mode existence of the corresponding label (flag) is checked.
+% If it does not exist the code given as the second argument is executed.
+% \begin{macrocode}
+\ifchemcompounds@implicit
+ \def\@ifnotcompoundcreated#1#2{%
+ \@ifundefined{compc@#1}{#2}{}%
+ }
+% \end{macrocode}
+% In |noimplicit| mode the label (flag) is unused and a new name will always be.
+% created. Therefore just execute the code given as second argument.
+% \begin{macrocode}
+\else
+ \let\@ifnotcompoundcreated\@secondoftwo
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@createcompoundhook}
+% \changes{1.1.0}{2005/10/07}{New.}
+% This command gets called everytime a compound name is printed.
+% In |implicit| mode this command is equal to creating a new compound name.
+% \begin{macrocode}
+\ifchemcompounds@implicit
+ \let\@createcompoundhook\@createcompound
+% \end{macrocode}
+% In |noimplicit| mode this is unnecessary. Therefore just gobble the argument.
+% \begin{macrocode}
+\else
+ \let\@createcompoundhook\@gobble
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\endinput
+% \end{macrocode}
+%
+%\iffalse
+%</package>
+%\fi
+%
+% \Finale \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins
new file mode 100644
index 00000000000..a7f6db5b17f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemcompounds/chemcompounds.ins
@@ -0,0 +1,24 @@
+%%
+%% File: chemcompounds.ins Copyright (C) 2005 Stephan Schenk
+%% $Id: chemcompounds.ins,v 1.2 2005/10/05 18:03:39 schenk Exp $
+%%
+%% Stephan Schenk,
+%% e-mail: mail@schenk-stephan.de
+%%
+%% This program 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
+%%
+%% This program consists of the files chemcompounds.dtx and chemcompounds.ins
+%%
+%% To produce the LaTeX package `chemcompounds.sty' process this file with
+%% latex.
+
+\input docstrip
+\keepsilent
+\generate{
+ \file{chemcompounds.sty}{\from{chemcompounds.dtx}{package}}
+}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/chemsym/00readme.chs b/Master/texmf-dist/source/latex/chemsym/00readme.chs
new file mode 100644
index 00000000000..3f78aa48af6
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemsym/00readme.chs
@@ -0,0 +1,34 @@
+
+
+This is the file `00readme.chs', which accompanies the
+`chemsym' package distribution. The package defines
+commands for the chemical symbols of the elements, which
+always are type-set in upright font, as they should. If not
+followed by a stoichiometric number, a small space is
+inserted. To use the package, run LaTeX on `chemsym.ins'.
+This produces the files `chemsym.sty', which contains the
+macro definitions, and `pertab.tex' which contains the LaTeX code
+for the Periodic Table of the Elements. To obtain the userguide
+and documentation, run LaTeX on `chemsym.dtx' after running LaTeX
+on `chemsym.ins'.
+
+
+The 'chemsym' package consists of two files:
+ chemsym.ins - the installation driver
+ chemsym.dtx - the macro code, instructions on how to use
+ the package, an example, and the code for the
+ Periodic Table in `docstrip'-able format.
+Anyone is free to re-distribute these files provided the restrictions
+mentioned in 'chemsym.ins' are obeyed. These are mainly that the
+two files always must be distributed together and that noone is
+allowed to distribute the files for profit.
+
+Inquiries can be sent to: <matsd@homenet.se>.
+
+
+
+
+____________________________________________________________________
+Copyright (c) 1997 by Mats Dahlgren.
+
+
diff --git a/Master/texmf-dist/source/latex/chemsym/chemsym.dtx b/Master/texmf-dist/source/latex/chemsym/chemsym.dtx
new file mode 100644
index 00000000000..df8ccee50ca
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemsym/chemsym.dtx
@@ -0,0 +1,646 @@
+%
+% \iffalse
+%
+% The first part is a comment to the reader(s) of `chemsym.dtx'.
+%
+% chemsym.dtx Version 1.1, July 07, 1997
+% (c) 1995-97 by Mats Dahlgren (matsd@homenet.se)
+%
+% Please see the information in file `chemsym.ins' on how you
+% may use and (re-)distribute this file. Run LaTeX on the file
+% `chemsym.ins' to get a .sty-file and instructions.
+%
+% This file may NOT be distributed if not accompanied by 'chemsym.ins'.
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{chemsym}
+\textwidth=150mm
+\textheight=210mm
+\topmargin=0mm
+\oddsidemargin=5mm
+\evensidemargin=5mm
+ \DocInput{chemsym.dtx}
+% \PrintChanges
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{559}
+%
+% \def\filename{chemsym.dtx}
+% \def\fileversion{1.1}
+% \def\filedate{1997/07/07}\def\docdate{\filedate}
+% \MakeShortVerb{\|}
+% \date{\docdate}
+% \title{\textsf{chemsym} -- a \LaTeX{} Macro for Chemical
+% Symbols\thanks{This document describes \textsf{chemsym} version
+% \fileversion , and was last updated \docdate .}}
+% \author{Mats Dahlgren\\ (\texttt{matsd@homenet.se})}
+% \begin{document}
+% \maketitle
+% \begin{abstract}
+% This document describes the \textsf{chemsym} package, which makes
+% it easier to type chemical symbols correctly, without having
+% to worry about math mode or text mode. Furthermore,
+% \textsf{chemsym} makes both the super- and the subscript commands
+% (|^| and |_|) and `\cdot' (|\cdot|) available in text mode.
+% \\ This file and the package:\
+% Copyright \copyright\ 1997 by Mats Dahlgren. All rights
+% reserved.
+% \end{abstract}
+%
+% \section{Introduction}
+% \textsf{chemsym} is a \LaTeX{} package which makes it easier to
+% type chemical symbols correctly. It defines a command for
+% each element of the periodic table (the 109 first),
+% Deuterium, the Methyl, Ethyl and Butyl groups\footnote{%
+% Suggested by Ulf Henriksson (\texttt{ulf@physchem.kth.se}).}
+% (for the Propyle group, use |\Pr|, Praseodymium), and the
+% $-$OH, $-$COOH, and $-$CH groups.
+% The use of the commands results in a up-right
+% chemical symbol, regardless of whether it is used in
+% math mode or text mode. If not followed by a sub- or
+% superscript, a |(|, a |)|, a |[|, or a |]| a small space
+% is added (slightly less than what `|\,|' gives).
+%
+% For elements 104-109 there is a (yet not settled)
+% discussion on which names and symbols to use. I have chosen
+% to use the names recommended by IUPAC. These
+% recommendations were published in ``Names and symbols of
+% transfermium elements (IUPAC recommendations 1994)'',
+% \textit{Pure and Applied Chemistry} \textbf{1994},
+% \textsl{66}(12), 2419-2421. The recommended names are
+% Dubnium, \Db, Joliotium, \Jl, Rutherfordium, \Rf, Bohrium,
+% \Bh, Hahnium, \Hn, and Meitnerium, \Mt, respectively.
+%
+% \section{Userguide}
+% \subsection{Requirements}
+% The file |chemsym.sty| must be available in the user's
+% |TEXINPUTS| directories.
+% It requires \LaTeXe{} of 1996/12/01 (or newer).
+%
+% \subsection{Usage}
+% The package is included by stating\\
+% | \usepackage[|\textit{option}|]{chemsym}| \\
+% In the document preamble.
+% The only option which has any effect on \textsf{chemsym} is
+% |collision|, see below.
+%
+% \subsection{Commands}
+%
+% \DescribeMacro{chemical} \DescribeMacro{symbols}
+% The \textsf{chemsym} package defines 116 user commands; one for
+% each of the 109 first elements, Deuterium, the Methyl,
+% Ethyl and Butyl groups
+% (for the Propyle group, use |\Pr|, Praseodymium), and the
+% $-$OH, $-$COOH, and $-$CH groups. The command
+% names are all made up of the chemical symbol preceeded by
+% `|\|'; thus for Nitrogen, \N, you type |\N|, and for Mercury,
+% \Hg, |\Hg|, etc. These commands appear to be robust.
+% To obtain `\CH_2', you simply type `|\CH_2|' in your input
+% file; `\CH_3' is obtained by typing `|\CH_3|' (of course).
+%
+% \DescribeMacro{\H} \DescribeMacro{\O} \DescribeMacro{\P}
+% \DescribeMacro{\S} \DescribeMacro{\Re} \DescribeMacro{\Pr}
+% Since there are six commands in \TeX /\LaTeX{}
+% already of this kind (|\H|, |\O|, |\P|, |\S|, |\Re|, and
+% |\Pr|), and one environment in $\mathcal{AMS}$-\LaTeX{}
+% \DescribeMacro{Sb}
+% (the |Sb| environment),\footnote{Thanks to Thorsten L\"{o}hl
+% (\texttt{lohl@uni-muenster.de}) for pointing out this.}
+% these old commands have to be renamed.
+% The names of choice are shown in the table below.
+% \MakeShortVerb{\+}
+% \DeleteShortVerb{\|}
+% \begin{center}
+% \begin{tabular}{|l|l|l|} \hline
+% \TeX{} & With \textsf{chemsym} & Use/Example \\
+% command & you write & \\ \hline
+% +\H+ & +\h+ & The accent in `\h{o}' \\ \hline
+% +\O+ & +\OO+ & \OO \\ \hline
+% +\P+ & +\PP+ & \PP \\ \hline
+% +\S+ & +\Ss+ & \Ss \\ \hline
+% +\Re+ & +\re+ & $\re$ (in math mode) \\ \hline
+% +\Pr+ & +\pr+ & $\pr$ (in math mode) \\ \hline
+% +\begin{Sb}+ & +\begin{SB}+ & (with $\mathcal{AMS}$-\LaTeX) \\ \hline
+% +\end{Sb}+ & +\end{SB}+ & (with $\mathcal{AMS}$-\LaTeX) \\ \hline
+% \end{tabular}
+% \end{center}
+% \DeleteShortVerb{\+}
+% \MakeShortVerb{\|}
+% \DescribeMacro{\kemtkn}
+% Also, |\kemtkn|, a command
+% for defining other chemical symbols and similar functions is
+% available. |\kemtkn| takes one mandatory argument (the
+% string to treat as a chemical symbol). Two other
+% \DescribeMacro{\nsrrm} \DescribeMacro{\nsrrms}
+% internal commands, |\nsrrm| and |\nsrrms| are also
+% available. |\nsrrm| simply puts its (mandatory) argument in
+% |mathrm|. |\nsrrms| does the same, but also adds a small
+% space after it. This space is a second, optional, argument
+% to |\nsrrms| which should be given in |em| units (without
+% `|em|'). The default is |0.1em|.
+% \DescribeMacro{^} \DescribeMacro{_}
+% For convenience when typing chemical formulas and units with
+% exponents, the super- and subscript commands |^| and |_| are
+% made available also outside of math mode, provided the option
+% |collision| is \emph{not} specified. Thus, with
+% \textsf{chemsym} you can type |m^2| instead of |m$^2$| for m^2 also
+% in text mode. Analogously, you can type |\H_2\O| for \H_2\O{}
+% in both math and text mode and get the same result.
+% Notice that text which you may put in the arguments of |^|
+% and |_| automatically is set in math mode. So if you want
+% `M_{\mathrm{q}}' you must type |M_{\mathrm{q}}| and not only
+% |M_q|, the latter comes out as `M_q'. (This feature is not
+% seriously disturbing since this feature with |^| and |_| is
+% intended to be used mainly with numbers in the arguments.)
+%
+% \DescribeMacro{\cdot} Futhermore, the |\cdot| command
+% (producing a `\cdot') is also available outside math mode. This
+% feature is included to facilitate typing formulas like
+% ``\CH_3\cdot\CH_3'' (|\CH_3\cdot\CH_3|) also in text
+% mode.\footnote{Also suggested by Ulf Henriksson
+% (\texttt{ulf@physchem.kth.se}).}
+%
+% \subsection{The \texttt{collision} option}
+%
+% \DescribeMacro{collision}
+% To avoid probelms with other packages due to |^| (and |_|) being
+% active, this may be swithced off by stating the option
+% |collision| when loading the \textsf{chemsym} package. If you get
+% the following error message (or a similar), you are likely to have
+% such a collision with \textsf{chemsym} involved (in this case with
+% \textsf{longtable}):
+% \begin{verbatim}
+% ! Argument of ^ has an extra }.
+% <inserted text>
+% \par
+% l.120 \end{longtable}
+%
+% ?
+% \end{verbatim}
+% To solve the problem, state the |collision| option \emph{and}
+% delete the |.aux| file before running \LaTeX{} again. Some
+% packages contain |^^J|-constructs which may not always be apparent
+% to the user. One example, which collides with
+% \textsf{chemsym}, is
+% the \textsf{multicol} package's warning if you specify only one
+% column. In that case, the error message is:
+% \begin{verbatim}
+% ! Argument of ^ has an extra }.
+% <inserted text>
+% \par
+% l.18 \begin{multicols}{1}
+%
+% ?
+% \end{verbatim}
+% In this case, you \emph{may} come around the problem by specifying
+% a number of columns $\geq 2$; if not, specify the |collision|
+% option for the \textsf{chemsym} package.
+%
+% \section{Examples}
+%
+% This section gives some simple examples of the use of
+% \textsf{chemsym}. To write the formula for water in both math
+% and text mode,
+% you type |\H_2\O{}|, which gives \H_2\O{} as result. Notice
+% that this differs from typing |\H$_2$\O|, which gives
+% \H$_2$\O{} as result. In the first example, there is not
+% any extra space added after the \H . This addition of space
+% makes formulas like \H\C\N{} (|\H\C\N|) easier to read than
+% just typing |HCN|: HCN.
+%
+% \newcommand{\hH}{\kemtkn{{}^2H}}
+% The use of the commands of \textsf{chemsym} is specially useful
+% when chemical symbols are used as indices in equations.
+% The following example illustrates this:
+% \begin{equation}
+% \mathcal{M}_{\Fe(\H_2\O)_6} = 6\mathcal{M}_{\H_2\O} + \mathcal{M}_{\Fe}
+% \end{equation}
+% which was obtained by typing
+% \begin{verbatim}
+% \begin{equation}
+% \mathcal{M}_{\Fe(\H_2\O)_6} = 6\mathcal{M}_{\H_2\O} + \mathcal{M}_{\Fe}
+% \end{equation}
+% \end{verbatim}
+% It is also easy
+% to define other chemical symbols commands, such as commands
+% for specific isotopes. Suppose you rather want to use the
+% notation \hH{} than \D{} for Deuterium. This may be
+% defined as:\\ \hspace*{2mm} |\newcommand{\hH}{\kemtkn{{}^2H}}|\\
+% (which was
+% used above: \ldots |notation \hH{} than \D{} for|\ldots).
+% Internally, \textsf{chemsym} uses a syntax like this to def ine
+% the various commands for the chemical symbols.\footnote{To make
+% the command robust,
+% say \texttt{\textbackslash newcommand$\{$\textbackslash hH$\}\{$
+% \textbackslash protect\textbackslash kemtkn$\{\{\}\}
+% \hat{\ }$2H$\}\}$}
+% or use the command \texttt{\textbackslash DeclareRobustCommand}
+% instead of \texttt{\textbackslash newcommand}.}
+%
+% After running |chemsym.ins| through \LaTeXe, you can typeset
+% the Periodic Table of the Elements by running \LaTeXe{} on
+% the file |pertab.tex|. (It fits fine on an A4 paper, and there
+% should be no problem with a U.S.\ lettersize paper as well.)
+% The Periodic Table requires the \textsf{rotating} package, which
+% in turn requires the packages \textsf{graphicx} and
+% \textsf{ifthen}.
+%
+% \section{Known Problems}
+%
+% \begin{itemize}
+% \item
+% Since \textsf{chemsym} makes |^| and |_| active, it will collide
+% with other packages which make use of constructs like |^^J|
+% (\textit{e.~g.} the \textsf{longtable} package). To avoid this
+% problem, specify the option |collision| when loading
+% \textsf{chemsym} (or globally).
+% \item
+% If the \textsf{chemsym} package is used together with the
+% \textsf{rotating} or \textsf{amstex} package, \textsf{chemsym}
+% should be loaded last.
+% \item
+% If the \textsf{chemsym} package is used together with the
+% \textsf{fancyheadings} package, \textsf{fancyheadings}
+% should be loaded after \textsf{chemsym}.\footnote{Thanks
+% to Lars Reinton (\texttt{larsr@stud.unit.no}) for
+% pointing out this.}
+% \item Since \textsf{chemsym} makes |_| and |^| active, these
+% characters cannot be used in labels when using the
+% \textsf{chemsym} package, nor in file names loaded in \LaTeX{} runs
+% loading the \textsf{chemsym} package (unless you specify the
+% |collision| option).\footnote{Thanks to Axel
+% (\texttt{i0080108@ws.rz.tu-bs.de}) for pointing out this problem.}
+% \item Also since |^| is made active, when following after a prime
+% in math mode (|'|), a ``double superscript'' error is produced
+% unless a double bracing (|{}|) is included before the |^|
+% character.\footnote{Thanks to Jeroen Paasschens
+% (\texttt{paassche@natlab.research.philips.com}) for bringing my
+% attention to this problem.} Thus, you should type |x'{}^2|
+% instead of |x'^2| when using \textsf{chemsym} to obtain $x'{}^2$.
+% \end{itemize}
+%
+% \section{Sending a Bug Report}
+% \textsf{chemsym} is likely to contain bugs, and reports about
+% them are most welcome. Before filing a bug report,
+% please take the following actions:
+% \begin{enumerate}
+% \item Ensure your problem is not due to your own input file,
+% package(s), or class(es);
+% \item Ensure your problem is not covered in the section
+% ''Known Problems'' above;
+% \item Try to locate the problem by writing a minimal
+% \LaTeX{} input file which reproduces the problem.
+% Include the command\\
+% | \setcounter{errorcontextlines}{999}|\\
+% in your input;
+% \item Run your file through \LaTeX ;
+% \item Send a description of your problem, the input file
+% and the log file via e-mail to:\\
+% \hspace*{5mm} \texttt{matsd@homenet.se}.
+% \end{enumerate}
+% {\itshape Enjoy your \LaTeX!\raisebox{-\baselineskip}{mats d.}}
+% \StopEventually{\vfill\hfill\scriptsize Copyright \copyright
+% 1997 by Mats Dahlgren}
+% \newpage
+%
+% \section{The Code}
+% For the interested reader(s), here is a short description
+% of the code.
+% \iffalse
+%<*paketkod>
+% \fi
+% First, the package is to identify itself:
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\ProvidesPackage{chemsym}[1997/07/07 v.1.1 Chemical symbols]
+% \end{macrocode}
+% First in the real code, we have to rename the old functions
+% |\H|, |\O|, |\P|, |\S|, |\Re|, and |\Pr|:
+% \begin{macrocode}
+\let\h=\H
+\let\OO=\O
+\let\PP=\P
+\let\Ss=\S
+\let\re=\Re
+\let\pr=\Pr
+% \end{macrocode}
+% Here we check if the $\mathcal{AMS}$-\LaTeX{} package is
+% loaded, and if so, change the |Sb| environment to be called |SB|.
+% \begin{macrocode}
+\@ifundefined{Sb}{\def\Sb{\protect\kemtkn{Sb}}}%
+ {\let\SB=\Sb \let\endSB=\endSb}
+% \end{macrocode}
+% Now, we make |^|, |_|, and |\cdot| work without |$...$|
+% also in text mode -- if not switched off.
+% To do this, we need a boolean and some
+% option processing\ldots
+% \begin{macrocode}
+\newif \ifc@llsn \c@llsnfalse
+\DeclareOption{collision}{\global\c@llsntrue}
+\DeclareOption*{\OptionNotUsed}
+\ProcessOptions*
+\ifc@llsn\AtEndDocument{%
+ \PackageWarningNoLine{chemsym}{Due to possible collisions with other
+ \MessageBreak packages, super- and subscrips are not avaliable
+ \MessageBreak outside math mode despite your loading of `chemsym'}}
+\else
+ \def\sprscrpt#1{\ensuremath{^{#1}}}
+ \def\sbscrpt#1{\ensuremath{_{#1}}}
+ \catcode`\^ \active
+ \catcode`\_ \active
+ \let^=\sprscrpt
+ \let_=\sbscrpt
+\fi
+\@ifundefined{cd@t}{%
+\let\cd@t=\cdot
+\def\cdot{\ensuremath{\cd@t}}}{}
+% \end{macrocode}
+% (The |\@ifundefined| is required for local compatibility reasons
+% at my former site.)
+% Then, some general macros are defined:
+% \begin{macrocode}
+\newcommand{\nsrrm}[1]{\ensuremath{\mathrm{#1}}}
+\newcommand{\nsrrms}[2][0.1]{\ensuremath{\mathrm{#2}\kern #1em}}
+\newcommand{\kemtkn}[1]{\@ifnextchar_{\nsrrm{#1}}{\@ifnextchar^{\nsrrm{#1}}%
+ {\@ifnextchar){\nsrrm{#1}}{\@ifnextchar({\nsrrm{#1}}%
+ {\@ifnextchar]{\nsrrm{#1}}{\@ifnextchar[{\nsrrm{#1}}{\nsrrms{#1}}}}}}}}
+% \end{macrocode}
+% As you can see, you can change the spacing in the chemical
+% formulas by making changes to |\nsrrms|. This you can do
+% with |\renewcommand|
+% in your document preamble or in another package file.
+% Then we define the
+% 110 commands for chemical symbols:
+% \begin{macrocode}
+\renewcommand{\H}{\protect\kemtkn{H}} % modified
+\newcommand{\D}{\protect\kemtkn{D}}
+\newcommand{\He}{\protect\kemtkn{He}}
+\newcommand{\Li}{\protect\kemtkn{Li}}
+\newcommand{\Be}{\protect\kemtkn{Be}}
+\newcommand{\B}{\protect\kemtkn{B}}
+\newcommand{\C}{\protect\kemtkn{C}}
+\newcommand{\N}{\protect\kemtkn{N}}
+\renewcommand{\O}{\protect\kemtkn{O}} % modified
+\newcommand{\F}{\protect\kemtkn{F}}
+\newcommand{\Ne}{\protect\kemtkn{Ne}}
+\newcommand{\Na}{\protect\kemtkn{Na}}
+\newcommand{\Mg}{\protect\kemtkn{Mg}}
+\newcommand{\Al}{\protect\kemtkn{Al}}
+\newcommand{\Si}{\protect\kemtkn{Si}}
+\renewcommand{\P}{\protect\kemtkn{P}} % modified
+\renewcommand{\S}{\protect\kemtkn{S}} % modified
+\newcommand{\Cl}{\protect\kemtkn{Cl}}
+\newcommand{\Ar}{\protect\kemtkn{Ar}}
+\newcommand{\K}{\protect\kemtkn{K}}
+\newcommand{\Ca}{\protect\kemtkn{Ca}}
+\newcommand{\Sc}{\protect\kemtkn{Sc}}
+\newcommand{\Ti}{\protect\kemtkn{Ti}}
+\newcommand{\V}{\protect\kemtkn{V}}
+\newcommand{\Cr}{\protect\kemtkn{Cr}}
+\newcommand{\Mn}{\protect\kemtkn{Mn}}
+\newcommand{\Fe}{\protect\kemtkn{Fe}}
+\newcommand{\Co}{\protect\kemtkn{Co}}
+\newcommand{\Ni}{\protect\kemtkn{Ni}}
+\newcommand{\Cu}{\protect\kemtkn{Cu}}
+\newcommand{\Zn}{\protect\kemtkn{Zn}}
+\newcommand{\Ga}{\protect\kemtkn{Ga}}
+\newcommand{\Ge}{\protect\kemtkn{Ge}}
+\newcommand{\As}{\protect\kemtkn{As}}
+\newcommand{\Se}{\protect\kemtkn{Se}}
+\newcommand{\Br}{\protect\kemtkn{Br}}
+\newcommand{\Kr}{\protect\kemtkn{Kr}}
+\newcommand{\Rb}{\protect\kemtkn{Rb}}
+\newcommand{\Sr}{\protect\kemtkn{Sr}}
+\newcommand{\Y}{\protect\kemtkn{Y}}
+\newcommand{\Zr}{\protect\kemtkn{Zr}}
+\newcommand{\Nb}{\protect\kemtkn{Nb}}
+\newcommand{\Mo}{\protect\kemtkn{Mo}}
+\newcommand{\Tc}{\protect\kemtkn{Tc}}
+\newcommand{\Ru}{\protect\kemtkn{Ru}}
+\newcommand{\Rh}{\protect\kemtkn{Rh}}
+\newcommand{\Pd}{\protect\kemtkn{Pd}}
+\newcommand{\Ag}{\protect\kemtkn{Ag}}
+\newcommand{\Cd}{\protect\kemtkn{Cd}}
+\newcommand{\In}{\protect\kemtkn{In}}
+\newcommand{\Sn}{\protect\kemtkn{Sn}}
+\renewcommand{\Sb}{\protect\kemtkn{Sb}} % modified with AMS-LaTeX
+\newcommand{\Te}{\protect\kemtkn{Te}}
+\newcommand{\I}{\protect\kemtkn{I}}
+\newcommand{\Xe}{\protect\kemtkn{Xe}}
+\newcommand{\Cs}{\protect\kemtkn{Cs}}
+\newcommand{\Ba}{\protect\kemtkn{Ba}}
+\newcommand{\La}{\protect\kemtkn{La}}
+\newcommand{\Ce}{\protect\kemtkn{Ce}}
+\renewcommand{\Pr}{\protect\kemtkn{Pr}} % modified
+\newcommand{\Nd}{\protect\kemtkn{Nd}}
+\newcommand{\Pm}{\protect\kemtkn{Pm}}
+\newcommand{\Sm}{\protect\kemtkn{Sm}}
+\newcommand{\Eu}{\protect\kemtkn{Eu}}
+\newcommand{\Gd}{\protect\kemtkn{Gd}}
+\newcommand{\Tb}{\protect\kemtkn{Tb}}
+\newcommand{\Dy}{\protect\kemtkn{Dy}}
+\newcommand{\Ho}{\protect\kemtkn{Ho}}
+\newcommand{\Er}{\protect\kemtkn{Er}}
+\newcommand{\Tm}{\protect\kemtkn{Tm}}
+\newcommand{\Yb}{\protect\kemtkn{Yb}}
+\newcommand{\Lu}{\protect\kemtkn{Lu}}
+\newcommand{\Hf}{\protect\kemtkn{Hf}}
+\newcommand{\Ta}{\protect\kemtkn{Ta}}
+\newcommand{\W}{\protect\kemtkn{W}}
+\renewcommand{\Re}{\protect\kemtkn{Re}} % modified
+\newcommand{\Os}{\protect\kemtkn{Os}}
+\newcommand{\Ir}{\protect\kemtkn{Ir}}
+\newcommand{\Pt}{\protect\kemtkn{Pt}}
+\newcommand{\Au}{\protect\kemtkn{Au}}
+\newcommand{\Hg}{\protect\kemtkn{Hg}}
+\newcommand{\Tl}{\protect\kemtkn{Tl}}
+\newcommand{\Pb}{\protect\kemtkn{Pb}}
+\newcommand{\Bi}{\protect\kemtkn{Bi}}
+\newcommand{\Po}{\protect\kemtkn{Po}}
+\newcommand{\At}{\protect\kemtkn{At}}
+\newcommand{\Rn}{\protect\kemtkn{Rn}}
+\newcommand{\Fr}{\protect\kemtkn{Fr}}
+\newcommand{\Ra}{\protect\kemtkn{Ra}}
+\newcommand{\Ac}{\protect\kemtkn{Ac}}
+\newcommand{\Th}{\protect\kemtkn{Th}}
+\newcommand{\Pa}{\protect\kemtkn{Pa}}
+\newcommand{\U}{\protect\kemtkn{U}}
+\newcommand{\Np}{\protect\kemtkn{Np}}
+\newcommand{\Pu}{\protect\kemtkn{Pu}}
+\newcommand{\Am}{\protect\kemtkn{Am}}
+\newcommand{\Cm}{\protect\kemtkn{Cm}}
+\newcommand{\Bk}{\protect\kemtkn{Bk}}
+\newcommand{\Cf}{\protect\kemtkn{Cf}}
+\newcommand{\Es}{\protect\kemtkn{Es}}
+\newcommand{\Fm}{\protect\kemtkn{Fm}}
+\newcommand{\Md}{\protect\kemtkn{Md}}
+\newcommand{\No}{\protect\kemtkn{No}}
+\newcommand{\Lr}{\protect\kemtkn{Lr}}
+\newcommand{\Db}{\protect\kemtkn{Db}}
+\newcommand{\Jl}{\protect\kemtkn{Jl}}
+\newcommand{\Rf}{\protect\kemtkn{Rf}}
+\newcommand{\Bh}{\protect\kemtkn{Bh}}
+\newcommand{\Hn}{\protect\kemtkn{Hn}}
+\newcommand{\Mt}{\protect\kemtkn{Mt}}
+% \end{macrocode}
+% At last, we define the three alkyle groups and some other
+% useful groups as chemical symbols:
+% \begin{macrocode}
+\newcommand{\Me}{\protect\kemtkn{Me}}
+\newcommand{\Et}{\protect\kemtkn{Et}}
+\newcommand{\Bu}{\protect\kemtkn{Bu}}
+\newcommand{\OH}{\protect\kemtkn{OH}}
+\newcommand{\COOH}{\protect\kemtkn{COOH}}
+\newcommand{\CH}{\protect\kemtkn{CH}}
+% \end{macrocode}
+% This brings us to the end of \textsf{chemsym}. Hope you'll
+% enjoy it!
+% \iffalse
+%</paketkod>
+%<*periodsyst>
+\documentclass[]{article}
+\usepackage[dvips]{rotating}
+\usepackage{chemsym}
+\textwidth=170mm
+\oddsidemargin=-6mm
+\evensidemargin=-6mm
+\textheight=270mm
+\topmargin=-25mm
+\parindent=0em
+\parskip=3ex
+\pagestyle{empty}
+\renewcommand{\nsrrms}[2][0]{\ensuremath{\mathrm{#2}\kern #1em}}
+\begin{document}
+\setlength{\tabcolsep}{3pt}
+\begin{sidewaystable}
+\vspace*{-24mm}
+\begin{tabular}{|*{18}{c|}}
+\multicolumn{18}{c}{ } \\[3mm]
+\multicolumn{18}{c}{\LARGE Periodic Table of the Elements} \\
+\multicolumn{18}{c}{with relative atomic masses 1993 according to IUPAC} \\
+\multicolumn{18}{c}{ } \\[-2mm] \hline
+\textbf{1} & \textbf{2} & \textbf{3} & \textbf{4} & \textbf{5} &
+\textbf{6} & \textbf{7} & \textbf{8} & \textbf{9} & \textbf{10} &
+\textbf{11} & \textbf{12} & \textbf{13} & \textbf{14} & \textbf{15} &
+\textbf{16} & \textbf{17} & \textbf{18} \\
+\textbf{(I)} & \textbf{(II)} & & & & & & & & & & & \textbf{(III)} &
+\textbf{(IV)} & \textbf{(V)} & \textbf{(VI)} & \textbf{(VII)} &
+\textbf{(VIII)} \\ \hline
+\multicolumn{18}{c}{ } \\[-2mm] \cline{1-1} \cline{18-18}
+_1 & \multicolumn{16}{c|}{ } & _2\\
+\H & \multicolumn{16}{c|}{ } & \He\\
+^{1.00794} & \multicolumn{16}{c|}{ } & ^{4.002602} \\ \cline{1-2}
+\cline{7-8} \cline{13-18}
+_3 & _4 & \multicolumn{4}{c|}{ } &
+\multicolumn{2}{c|}{_{\mathrm{Atomic\ number}}} &
+\multicolumn{4}{c|}{ }
+& _5 & _6 & _7 &
+_8 & _9 & _{10}\\
+\Li & \Be & \multicolumn{4}{c|}{ } &
+\multicolumn{2}{c|}{Symbol} & \multicolumn{4}{c|}{ }
+& \B & \C & \N & \O & \F & \Ne\\
+^{6.941} & ^{9.012182} & \multicolumn{4}{c|}{ } &
+\multicolumn{2}{c|}{^{\mathrm{Relative\ atomic\ mass}^\ast}} &
+\multicolumn{4}{c|}{ } & ^{10.811} &
+^{12.011} & ^{14.00674} & ^{15.9994} & ^{18.9984032} & ^{20.1797} \\
+\cline{1-2} \cline{7-8} \cline{13-18}
+_{11} & _{12} & \multicolumn{10}{c|}{ } & _{13} &
+_{14} & _{15} & _{16} & _{17} & _{18} \\
+\Na & \Mg & \multicolumn{10}{c|}{ } & \Al &
+\Si & \P & \S & \Cl & \Ar\\
+^{22.989768} & ^{24.3050} & \multicolumn{10}{c|}{ } &
+^{26.981539} & ^{28.0855} & ^{30.973762} & ^{32.066} &
+^{35.4527} & ^{39.948} \\ \hline
+_{19} & _{20} & _{21} & _{22} & _{23} & _{24} &
+_{25} & _{26} & _{27} & _{28} & _{29} & _{30} &
+_{31} & _{32} & _{33} & _{34} & _{35} & _{36}\\
+\K & \Ca & \Sc & \Ti & \V & \Cr & \Mn & \Fe & \Co & \Ni & \Cu & \Zn &
+\Ga & \Ge & \As & \Se & \Br & \Kr\\
+^{39.0983} & ^{40.078} & ^{44.955910} & ^{47.867} &
+^{50.9415} & ^{51.9961} & ^{54.93805} & ^{55.845} &
+^{58.93320} & ^{58.6934} & ^{63.546} & ^{65.39} & ^{69.723} &
+^{72.61} & ^{74.92159} & ^{78.96} & ^{79.904} & ^{83.80} \\ \hline
+_{37} & _{38} & _{39} & _{40} & _{41} & _{42} &
+_{43} & _{44} & _{45} & _{46} & _{47} & _{48} &
+_{49} & _{50} & _{51} & _{52} & _{53} & _{54} \\
+\Rb & \Sr & \Y & \Zr & \Nb & \Mo &
+\Tc & \Ru & \Rh & \Pd & \Ag & \Cd &
+\In & \Sn & \Sb & \Te & \I & \Xe\\
+^{85.4678} & ^{87.62} & ^{88.90585} & ^{91.224} & ^{92.90638} &
+^{95.94} & ^{(98)} & ^{101.07} & ^{102.90550} & ^{106.42} &
+^{107.8682} & ^{112.411} & ^{114.818} & ^{118.710} &
+^{121.760} & ^{127.60} & ^{126.90447} & ^{131.29} \\ \hline
+_{55} & _{56} & & _{72} & _{73} & _{74} &
+_{75} & _{76} & _{77} & _{78} & _{79} & _{80} &
+_{81} & _{82} & _{83} & _{84} & _{85} & _{86} \\
+\Cs & \Ba & \raisebox{1.5mm}[0pt][0pt]{\La --} & \Hf & \Ta &
+\W & \Re & \Os & \Ir & \Pt & \Au & \Hg &
+\Tl & \Pb & \Bi & \Po & \At & \Rn\\
+^{132.90543} & ^{137.327} & \raisebox{1.5mm}[0pt][0pt]{\Lu} &
+^{178.49} & ^{180.9479} &
+^{183.84} & ^{186.207} & ^{190.23} & ^{192.217} & ^{195.08} &
+^{196.96654} & ^{200.59} & ^{204.3833} & ^{207.2} &
+^{208.98037} & ^{(209)} & ^{(210)} & ^{(222)} \\
+\hline
+_{87} & _{88} & & _{104} & _{105} & _{106} &
+_{107} & _{108} & _{109} & \multicolumn{1}{c}{$_{\ast\ast}$} \\
+\Fr & \Ra & \raisebox{1.5mm}[0pt][0pt]{\Ac --} & \Db & \Jl &
+\Rf & \Bh & \Hn & \Mt\\
+ ^{(223)} & ^{(226)} & \raisebox{1.5mm}[0pt][0pt]{\Lr} & ^{(261)} &
+^{(262)} & ^{(263)} & ^{(262)} & ^{(265)} & ^{(266)} \\
+\cline{1-9}
+\multicolumn{18}{c}{ } \\ \cline{3-17}
+\multicolumn{2}{c|}{ } & _{57} & _{58} & _{59} & _{60} & _{61}
+& _{62} & _{63} & _{64} & _{65} & _{66} & _{67} & _{68} & _{69}
+& _{70} & _{71} \\
+\multicolumn{2}{c|}{ } & \La &
+\Ce & \Pr & \Nd & \Pm & \Sm & \Eu & \Gd & \Tb & \Dy & \Ho & \Er & \Tm &
+\Yb & \Lu \\
+\multicolumn{2}{c|}{ } & ^{138.9055} & ^{140.115} &
+^{140.90765} & ^{144.24} & ^{(145)} & ^{150.36} & ^{151.965} &
+^{157.25} & ^{158.92534} & ^{162.50} & ^{164.93032} &
+^{167.26} & ^{168.93421} & ^{173.04} & ^{174.967} \\ \cline{3-17}
+\multicolumn{2}{c|}{ } & _{89} &
+_{90} & _{91} & _{92} & _{93} & _{94} & _{95} &
+_{96} & _{97} & _{98} & _{99} & _{100} &
+_{101} & _{102} & _{103} \\
+\multicolumn{2}{c|}{ } & \Ac &
+\Th & \Pa & \U & \Np & \Pu & \Am & \Cm & \Bk & \Cf & \Es & \Fm &
+\Md & \No & \Lr \\
+\multicolumn{2}{c|}{ } & ^{(227)} & ^{(232.0381)}& ^{(231.03588)} &
+^{(238.0289)}& ^{(237)} & ^{(239)} & ^{(243)} & ^{(247)} &
+^{(247)} & ^{(251)} & ^{(252)} & ^{(257)} & ^{(258)} &
+^{(259)} & ^{(262)} \\ \cline{3-17}
+\multicolumn{18}{c}{ } \\[5mm]
+\multicolumn{1}{r}{$^\ast$} &
+\multicolumn{17}{l}{Relative atomic mass based on
+$A_{\mathrm{r}}(^{12}\C )\equiv 12$ (after IUPAC ``Atomic Weights
+of the Elements 1993'', \textit{Pure and Applied Chemistry,}
+\textbf{1994,} \textsl{66}(12), 2423-} \\
+\multicolumn{1}{c}{{ }} &
+\multicolumn{17}{l}{2444). For elements which lack stable isotope(s) is
+the mass number for the most stable isotope given in parentheses,
+or for \Th, \Pa{} and \U{} the relative }\\
+\multicolumn{1}{c}{{ }} &
+\multicolumn{17}{l}{atomic mass given by IUPAC for the isotopic mixture
+present on Earth. } \\
+\multicolumn{1}{r}{$^{\ast\ast}$} &
+\multicolumn{17}{l}{Chemical symbols for elements 104 -- 109
+according to IUPAC ``Names and Symbols of Transfermium Elements
+(IUPAC Recommendations 1994)'', \textit{Pure} } \\
+\multicolumn{1}{c}{{ }} &
+\multicolumn{17}{l}{\textit{and Applied Chemistry,}
+\textbf{1994,} \textsl{66}(12), 2419-2421.} \\
+\multicolumn{18}{r}{\scriptsize Copyright \copyright{} 1995 - 1997
+ by Mats Dahlgren.} \\
+\end{tabular}
+\end{sidewaystable}
+\end{document}
+%</periodsyst>
+% \fi
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/chemsym/chemsym.ins b/Master/texmf-dist/source/latex/chemsym/chemsym.ins
new file mode 100644
index 00000000000..3532b9db20f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/chemsym/chemsym.ins
@@ -0,0 +1,58 @@
+%
+% This is file `chemsym.ins', the installation file for the
+% `chemsym' package. Last revised 1997/07/07.
+%
+% Copyright (c) 1995-97 by Mats Dahlgren <matsd@homenet.se>.
+% All rights reserved.
+
+% You may use the `chemsym' package freely, but at your own
+% risk. The author of chemsym.dtx and chemsym.ins (the
+% complete `chemsym' package distribution) can not be held
+% responsible for any consequence of your using any of these
+% files, or files created from these, including hardware,
+% software, and data damage. You may not make any changes to
+% the files chemsym.dtx or chemsym.ins. You may incorporate
+% the code from these files in other files under different
+% names, provided the original author is given full credit for
+% his work and that you yourself take the complaints from the
+% user(s) of your file(s). You may freely distribute the
+% files chemsym.dtx and chemsym.ins, provided: 1. You do not
+% charge money for the distribution or use of these files except
+% for a nominal charge for diskettes and postage; and 2. You
+% always distribute `chemsym.dtx' and `chemsym.ins' together
+% at the same time.
+%
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\def\batchfile{chemsym.ins}
+\input docstrip.tex
+
+
+\keepsilent
+\preamble
+
+
+Copyright (c) 1995-97 by Mats Dahlgren <matsd@homenet.se>.
+All rights reserved. See the file `chemsym.ins' for information
+on how you may (re-)distribute the `chemsym' package files.
+
+
+\endpreamble
+
+
+\generate{\file{chemsym.sty}{\from{chemsym.dtx}{paketkod}}%
+ \file{pertab.tex}{\from{chemsym.dtx}{periodsyst}}}
+
+
+\Msg{************************************************************}
+\Msg{ }
+\Msg{ To finish the installation you have to move the file}
+\Msg{ `chemsym.sty' into a directory searched by TeX.}
+\Msg{ }
+\Msg{ To type-set the documentation, run the file `chemsym.dtx'}
+\Msg{ through LaTeX. A Periodic table of the elements can be}
+\Msg{ obtained by running `pertab.tex' through LaTeX.}
+\Msg{ }
+\Msg{***********************************************************}
+%%
+%% end of file chemsym.ins
+%%
diff --git a/Master/texmf-dist/source/latex/cmbright/cmbr.fdd b/Master/texmf-dist/source/latex/cmbright/cmbr.fdd
new file mode 100644
index 00000000000..3148dbea08b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cmbright/cmbr.fdd
@@ -0,0 +1,311 @@
+%\CheckSum{70}
+%
+% \iffalse
+%
+% Copyright (c) 1994--1999 Walter Schmidt, Erlangen
+%
+% This program 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.
+%
+% This program consists of the files cmbright.dtx, cmbr.fdd and
+% cmbright.ins.
+%
+% \fi
+%
+% \iffalse
+%
+%<cm>\ProvidesFile{ot1cmbr.fd}
+%<ec>\ProvidesFile{t1cmbr.fd}
+%<ts1cmbr>\ProvidesFile{ts1cmbr.fd}
+%<ot1cmtl>\ProvidesFile{ot1cmtl.fd}
+%<t1cmtl>\ProvidesFile{t1cmtl.fd}
+%<ts1cmtl>\ProvidesFile{ts1cmtl.fd}
+%<omlcmbrm>\ProvidesFile{omlcmbrm.fd}
+%<omscmbrs>\ProvidesFile{omscmbrs.fd}
+%<omlcmbr>\ProvidesFile{omlcmbr.fd}
+%<omscmbr>\ProvidesFile{omscmbr.fd}
+%<*driver>
+ \ProvidesFile{cmbr.drv}
+%</driver>
+ [1999/05/12 v7.3 (WaS)]
+%
+%<*driver>
+\documentclass[11pt]{ltxdoc}
+\setcounter{StandardModuleDepth}{1}
+\CodelineNumbered
+\GetFileInfo{cmbr.drv}
+\begin{document}
+ \DocInput{cmbr.fdd}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \DeleteShortVerb{\|}
+%
+% \title{The file \texttt{cmbr.fdd}}
+% \date{(\fileversion{} -- \filedate)}
+% \author{Walter Schmidt\thanks{{\ttfamily walter.schmidt@arcormail.de}}}
+% \maketitle
+%
+% \noindent
+% \texttt{cmbr.fdd} is the documented source file of the Computer Modern Bright
+% font definitions for use with \LaTeX.
+%
+% \section{The \textsc{docstrip} modules}
+% {\small
+% \begin{tabular}{ll}
+% driver & documentation driver file\\
+% cm & font definition file \texttt{ot1cmbr.fd}\\
+% ec & font definition file \texttt{t1cmbr.fd}\\
+% ts1cmbr & font definition file \texttt{ts1cmbr.fd}\\
+% omlcmbrm & font definition file {\tt omlcmbrm.fd}\\
+% omscmbrs & font definition file {\tt omscmbrs.fd}\\
+% omlcmbr & font definition file \texttt{omlcmbr.fd}\\
+% omscmbr & font definition file \texttt{omscmbr.fd}\\
+% ot1cmtl & font definition file \texttt{ot1cmtl.fd}\\
+% t1cmtl & font definition file \texttt{t1cmtl.fd}\\
+% ts1cmtl & font definition file \texttt{ts1cmtl.fd}\\
+% \end{tabular}
+% \par}
+%
+% \StopEventually{}
+%
+% \section{CM Bright, OT1 encoding}
+%
+% \begin{macrocode}
+%<*cm>
+\DeclareFontFamily{OT1}{cmbr}{\hyphenchar\font45}
+\DeclareFontShape{OT1}{cmbr}{m}{n}{%
+<5><6><7><8>cmbr8%
+<9>cmbr9%
+<10><10.95><12><14.4>cmbr10%
+<17.28><20.74><24.88><29.86><35.83>cmbr17%
+}{}
+\DeclareFontShape{OT1}{cmbr}{m}{sl}{%
+<5><6><7><8>cmbrsl8%
+<9>cmbrsl9%
+<10><10.95><12><14.4>cmbrsl10%
+<17.28><20.74><24.88><29.86><35.83>cmbrsl17%
+}{}
+\DeclareFontShape{OT1}{cmbr}{m}{it}{%
+<->ssub*cmbr/m/sl%
+}{}
+\DeclareFontShape{OT1}{cmbr}{b}{n}{%
+<->ssub*cmbr/bx/n%
+}{}
+\DeclareFontShape{OT1}{cmbr}{bx}{n}{%
+<-9>sub*cmbr/m/n%
+<9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmbrbx10%
+}{}
+%</cm>
+% \end{macrocode}
+%
+% \section{CM Bright, T1 encoding}
+%
+% \begin{macrocode}
+%<*ec>
+\DeclareFontFamily{T1}{cmbr}{}
+\DeclareFontShape{T1}{cmbr}{m}{n}{%
+<5><6><7><8>ebmr8%
+<9>ebmr9%
+<10><10.95><12><14.4>ebmr10%
+<17.28><20.74><24.88><29.86><35.83>ebmr17%
+}{}
+\DeclareFontShape{T1}{cmbr}{m}{sl}{%
+<5><6><7><8>ebmo8%
+<9>ebmo9%
+<10><10.95><12><14.4>ebmo10%
+<17.28><20.74><24.88><29.86><35.83>ebmo17%
+}{}
+\DeclareFontShape{T1}{cmbr}{m}{it}{%
+<->ssub*cmbr/m/sl%
+}{}
+\DeclareFontShape{T1}{cmbr}{sb}{n}{%
+<5><6><7><8>ebsr8%
+<9>ebsr9%
+<10><10.95><12><14.4>ebsr10%
+<17.28><20.74><24.88><29.86><35.83>ebsr17%
+}{}
+\DeclareFontShape{T1}{cmbr}{sb}{sl}{%
+<5><6><7><8>ebso8%
+<9>ebso9%
+<10><10.95><12><14.4>ebso10%
+<17.28><20.74><24.88><29.86><35.83>ebso17%
+}{}
+\DeclareFontShape{T1}{cmbr}{sb}{it}{%
+<->ssub*cmbr/sb/sl%
+}{}
+\DeclareFontShape{T1}{cmbr}{b}{n}{%
+<->ssub*cmbr/bx/n%
+}{}
+\DeclareFontShape{T1}{cmbr}{bx}{n}{%
+<-9>sub*cmbr/sb/n%
+<9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>ebbx10%
+}{}
+%</ec>
+% \end{macrocode}
+%
+% \section{CM Typewriter Light, OT1 encoding}
+%
+% \begin{macrocode}
+%<*ot1cmtl>
+\DeclareFontFamily{OT1}{cmtl}{\hyphenchar\font\m@ne}
+\DeclareFontShape{OT1}{cmtl}{m}{n}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmtl10%
+}{}
+\DeclareFontShape{OT1}{cmtl}{m}{sl}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmsltl10%
+}{}
+\DeclareFontShape{OT1}{cmtl}{m}{it}{<->ssub*cmtl/m/sl}{}
+%</ot1cmtl>
+% \end{macrocode}
+%
+% \section{CM Typewriter Light, T1 encoding}
+%
+% \begin{macrocode}
+%<*t1cmtl>
+\DeclareFontFamily{T1}{cmtl}{\hyphenchar\font\m@ne}
+\DeclareFontShape{T1}{cmtl}{m}{n}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>ebtl10%
+}{}
+\DeclareFontShape{T1}{cmtl}{m}{sl}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>ebto10%
+}{}
+\DeclareFontShape{T1}{cmtl}{m}{it}{<->ssub*cmtl/m/sl}{}
+%</t1cmtl>
+% \end{macrocode}
+%
+% \section{CM Bright Math Inclined, OML encoding}
+%
+% \begin{macrocode}
+%<*omlcmbrm>
+\DeclareFontFamily{OML}{cmbrm}{\skewchar\font 127}
+\DeclareFontShape{OML}{cmbrm}{m}{it}{%
+<5><6><7><8>cmbrmi8%
+<9>cmbrmi9%
+<10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmbrmi10%
+}{}
+\DeclareFontShape{OML}{cmbrm}{b}{it}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmbrmb10%
+}{}
+%</omlcmbrm>
+% \end{macrocode}
+%
+% \section{CM Bright Symbols, OMS encoding}
+%
+% \begin{macrocode}
+%<*omscmbrs>
+\DeclareFontFamily{OMS}{cmbrs}{\skewchar\font 48}
+\DeclareFontShape{OMS}{cmbrs}{m}{n}{%
+<5><6><7><8>cmbrsy8%
+<9>cmbrsy9%
+<10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>cmbrsy10%
+}{}
+%</omscmbrs>
+% \end{macrocode}
+%
+% \section{CM Bright, OML encoding}
+% We need this for some special tex symbols which may be taken from
+% the `math italic' font.
+% \begin{macrocode}
+%<*omlcmbr>
+\DeclareFontFamily{OML}{cmbr}{\skewchar\font 127}
+\DeclareFontShape{OML}{cmbr}{m}{it}{<->ssub*cmbrm/m/it}{}
+\DeclareFontShape{OML}{cmbr}{sb}{it}{<->ssub*cmbrm/b/it}{}
+\DeclareFontShape{OML}{cmbr}{bx}{it}{<->ssub*cmbrm/b/it}{}
+%</omlcmbr>
+% \end{macrocode}
+%
+% \section{CM Bright, OMS encoding}
+% We need this for some special text symbols which may be taken from
+% the mathematical symbol font.
+% \begin{macrocode}
+%<*omscmbr>
+\DeclareFontFamily{OMS}{cmbr}{\skewchar\font 48}
+\DeclareFontShape{OMS}{cmbr}{m}{n}{<->ssub*cmbrs/m/n}{}
+%</omscmbr>
+% \end{macrocode}
+%
+% \section{CM Bright, TS1 encoding}
+%
+% \begin{macrocode}
+%<*ts1cmbr>
+\DeclareFontFamily{TS1}{cmbr}{\hyphenchar\font\m@ne}
+\DeclareFontShape{TS1}{cmbr}{m}{n}{%
+<5><6><7><8>tbmr8%
+<9>tbmr9%
+<10><10.95><12><14.4>tbmr10%
+<17.28><20.74><24.88><29.86><35.83>tbmr17%
+}{}
+\DeclareFontShape{TS1}{cmbr}{m}{sl}{%
+<5><6><7><8>tbmo8%
+<9>tbmo9%
+<10><10.95><12><14.4>tbmo10%
+<17.28><20.74><24.88><29.86><35.83>tbmo17%
+}{}
+\DeclareFontShape{TS1}{cmbr}{m}{it}{%
+<->ssub*cmbr/m/sl}{}
+\DeclareFontShape{TS1}{cmbr}{sb}{n}{%
+<5><6><7><8>tbsr8%
+<9>tbsr9%
+<10><10.95><12><14.4>tbsr10%
+<17.28><20.74><24.88><29.86><35.83>tbsr17%
+}{}
+\DeclareFontShape{TS1}{cmbr}{sb}{sl}{%
+<5><6><7><8>tbso8%
+<9>tbso9%
+<10><10.95><12><14.4>tbso10%
+<17.28><20.74><24.88><29.86><35.83>tbso17%
+}{}
+\DeclareFontShape{TS1}{cmbr}{sb}{it}{<->ssub*cmbr/sb/sl}{}
+\DeclareFontShape{TS1}{cmbr}{b}{n}{<->ssub*cmbr/bx/n}{}
+\DeclareFontShape{TS1}{cmbr}{bx}{n}{%
+<-9>sub*cmbr/sb/n%
+<9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>tbbx10%
+}{}
+%</ts1cmbr>
+% \end{macrocode}
+%
+% \section{CM Typewriter Light, TS1 encoding}
+%
+% \begin{macrocode}
+%<*ts1cmtl>
+\DeclareFontFamily{TS1}{cmtl}{\hyphenchar\font\m@ne}
+\DeclareFontShape{TS1}{cmtl}{m}{n}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>tbtl10%
+}{}
+\DeclareFontShape{TS1}{cmtl}{m}{sl}{%
+<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83>tbto10%
+}{}
+\DeclareFontShape{TS1}{cmtl}{m}{it}{<->ssub*cmtl/m/sl}{}
+%</ts1cmtl>
+% \end{macrocode}
+%
+% The next line goes into all files and in addition prevents {\sc docstrip}
+% from adding the character table to all modules.
+% \begin{macrocode}
+\endinput
+% \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 \~}
diff --git a/Master/texmf-dist/source/latex/cmbright/cmbright.dtx b/Master/texmf-dist/source/latex/cmbright/cmbright.dtx
new file mode 100644
index 00000000000..c5b0e1fad88
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cmbright/cmbright.dtx
@@ -0,0 +1,513 @@
+%\CheckSum{329}
+%
+% \iffalse
+%
+% File `cmbright.dtx'.
+% Copyright (c) 1994--2002 Walter Schmidt
+%
+% This program 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.
+%
+% This program consists of the files cmbright.dtx, cmbr.fdd and
+% cmbright.ins.
+%
+% \fi
+%
+% \iffalse
+%
+\NeedsTeXFormat{LaTeX2e}
+%<cm&!patch> [1995/06/01]
+%<*driver>
+\ProvidesFile{cmbright.drv}
+%</driver>
+%<+cm>\ProvidesPackage{cmbright}
+ [2002/05/25 v7.1 (WaS)]
+%
+%<*driver>
+\documentclass[11pt]{ltxdoc}
+\usepackage{mflogo,url}
+\CodelineNumbered
+\parindent1em
+\leftmargini=2em
+\leftmarginii=2em
+\leftmarginiii=2em
+\leftmarginiv=2em
+\leftmargin\leftmargini
+\labelwidth\leftmargin \advance\labelwidth by -\labelsep
+\begin{document}
+ \DocInput{cmbright.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{cmbright.drv}
+% \DeleteShortVerb{\|}
+% \MakeShortVerb{\+}
+% \newcommand{\oitem}[1]{\item[\texttt{#1}]}
+%
+% \title{The Computer Modern Bright fonts \\
+% and \\
+% the \LaTeX{} package \textsf{cmbright}}
+% \author{Walter Schmidt\thanks{{\ttfamily was@VR-Web.de}}}
+% \date{(\fileversion{} -- \filedate)}
+% \maketitle
+% \tableofcontents
+%
+% \section{The CM Bright fonts}
+% `Computer Modern Bright' is a family of sans serif fonts,
+% based on Donald Knuth's CM fonts.
+% It includes OT1, T1 and TS1 encoded text fonts of various
+% shapes as well as all the fonts necessary for mathematical
+% typesetting, incl.\ the AMS symbols.
+%
+% CM Bright has been designed as a well legible standalone
+% font. It is `lighter' and less obtrusive than CM Sans Serif, which,
+% in contrast, is more appropriate for markup purposes within
+% a CM Roman environment.
+%
+% Together with CM Bright there comes a family of typewriter
+% fonts, named `CM Typwewriter Light', which look better in
+% combination with CM Bright than the ordinary \texttt{cmtt} fonts would do.
+%
+% The CM Bright fonts in \MF{} format are distributed
+% free from the CTAN archives, directory \texttt{fonts/cmbright}.
+%
+% The fonts are also available in Type1 format from
+% MicroPress~Inc, see
+% \path{<http://www.micropress-inc.com/fonts/brmath/brmain.htm>}.
+%
+% \section{The \LaTeX{} macro package \textsf{cmbright}}
+%
+% \subsection{Description}
+% The \LaTeX{} macro package \textsf{cmbright}
+% supports typesetting with the font family CM Bright.
+% Loading the package
+% \begin{verse}
+% +\usepackage{cmbright}+
+% \end{verse}
+% effects the following:
+% \begin{itemize}
+% \item The default sans serif font family for typesetting text and math
+% is changed to \texttt{cmbr}, i.e.\ CM Bright.
+% \item
+% The sans serif font family is made the default one.
+% \item A new mathematical alphabet +\mathbold+ provides bold slanted
+% letters, inluding uppercase and lowercase Greek.
+% \item The packages \textsf{amsfonts} or \textsf{amssymb},
+% when loaded additionally,
+% will use the `CM Bright' versions of the AMS symbol fonts.
+%
+% Notice that you may still have to specify the option +psamsfonts+
+% for these packages, so as to prevent them from using design sizes
+% of the CM Math Extension and Euler Fraktur fonts, which may be
+% unavailable within your TeX system; this works flawlessly with
+% version 7.1 of the \textsf{cmbright} package now.
+% \item The default typewriter font family is changed to \texttt{cmtl},
+% i.e.\ CM Typewriter Light.
+% \item The line spacing (+\baselineskip+) for the font sizes 8--12\,pt
+% is increased to approx. $1.25 \times \mathrm{size}$.
+% \end{itemize}
+%
+% \subsection{Package options}
+% \begin{description}
+% \oitem{standard-baselineskips}
+% This option prevents the package from enlarging the default line spacing.
+% See the below section~\ref{sec:bugs}.
+% \oitem{slantedGreek}
+% When the macro package is loaded using this option,
+% uppercase Greek letters will, by default, be slanted.
+% Regardless of the option the new commands
+% +\upDelta+ and +\upOmega+ will \emph{always} provide an
+% upright \( \Delta \) and \( \Omega \).
+% \end{description}
+%
+% \subsection{Font encoding}
+% The package does \emph{not} change the default output font
+% encoding from OT1. It is, however, recommended to make use of
+% CM Bright through the extended T1 and TS1 encodings,
+% since doing so does not imply any drawback.
+%
+% \subsection{Scaling of the `large' math symbols}
+% In order to achieve proper scaling of the `large' math symbols,
+% you may load the packages \textsf{exscale},
+% \textsf{amsfonts} or \textsf{amssymb}
+% additionally; they work in conjunction with \textsf{cmbright},
+% too.
+%
+% \subsection{Known bugs and deficiencies}
+% \label{sec:bugs}
+% \begin{itemize}
+% \item
+% The automatic adaption of the line spacing was provided for the sake
+% of convenience. Meanwhile it turned out that it causes many obscure
+% problem, particularly in conjunction with other macro packages or
+% with `moving arguments'. Furthermore, the need to enlarge the default
+% line spacing depends on the line width.
+% We recommend to disable the feature by loading the package with the
+% option \textsf{standard-baselineskips}.
+% and take care of the appropriate line spacing by use of the
+% +\linespread+ command, if necessary.
+% \item
+% There is no `bold' +\mathversion+ to bolden complete formulae.
+% (See, however, the mathematical alphabet +\mathbold+.)
+% \item
+% The \textsf{textcomp} package, if required, must be input \emph{after}
+% \texttt{cmbright}, otherwise
+% the symbol \textregistered{} (+\textregistered+) is not taken from the
+% text companion font.
+% The same problem might occur,
+% if (e.g.\ with future versions of \LaTeX) the TS1 encoding is included
+% in the \LaTeX{} format. In both cases the symbol is typeset
+% in roman style, instead of sans serif.
+% \item
+% Within the mathematical mode the symbol \textit{\pounds}
+% is treated as a text symbol, so its size and the surrounding space
+% might be wrong under some circumstances.
+% \item
+% The package \textsf{oldlfont}
+% cannot be used in conjunction with \texttt{cmbright}. (There should be
+% no real need for doing so!)
+% \item
+% The package \textsf{newlfont}, if used in conjunction with the
+% CM Bright fonts, must be input before \texttt{cmbright}.
+% \end{itemize}
+%
+%
+% \begin{table}[hbt]
+% \caption{NFSS classification of the Computer Modern Bright fonts}
+% \label{tab:nfss}
+% \begin{center}
+% \begin{tabular}{|l|l|l|l|}
+% \hline
+% \textbf{encoding} & \textbf{family} & \textbf{series} & \textbf{shape(s)}\\
+% \hline\hline
+% \multicolumn{4}{|c|}{\textit{CM Bright}}\\ \hline
+% OT1, T1, TS1 & cmbr & m & n, sl \\ \hline
+% T1, TS1 & cmbr & sb & n, sl\\ \hline
+% OT1, T1, TS1 & cmbr & bx & n\\ \hline \hline
+% \multicolumn{4}{|c|}{\textit{CM Typewriter Light}}\\ \hline
+% OT1, T1, TS1 & cmtl & m & n, sl\\ \hline \hline
+% \multicolumn{4}{|c|}{\textit{CM Bright Math}}\\ \hline
+% OML & cmbrm & m, b & it \\ \hline
+% OMS & cmbrs & m & n \\ \hline \hline
+% \multicolumn{4}{|c|}{\textit{CM Bright AMS A, B}}\\ \hline
+% U & msa, msb & m &n\\ \hline
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \section{NFSS classification of the fonts}
+% Table~\ref{tab:nfss} lists the font series and shapes available in
+% the CM Bright and CM Typewriter Light families. Notice, that
+% \begin{itemize}
+% \item the bx series of the text fonts is supported at sizes
+% of 9\,pt and above only;
+% \item the usual font substitutions are set up so as to map OML and OMS
+% encoded text fonts to the math fonts;
+% \item there is no special CM Bright font for the `extensible math symbols';
+% OMX/cmex should be used instead;
+% \item
+% the font definitions for the AMS fonts are part of the package \texttt{cmbright};
+% there are no separate\texttt{.fd} files.
+% \end{itemize}
+%
+% \StopEventually{}
+%
+% \section{The package code}
+%
+% \subsection{Text font families}
+% The sans serif font family is made the default one:
+% \begin{macrocode}
+%<*cm>
+\renewcommand{\familydefault}{\sfdefault}
+% \end{macrocode}
+% CM Bright is to be used as the default sans serif font family:
+% \begin{macrocode}
+\renewcommand{\sfdefault}{cmbr}
+% \end{macrocode}
+%
+% CM Typewriter Light is to be used as the default typewriter font family,
+% because the +cmtt+ fonts look too dark in combination with CM Bright:
+% \begin{macrocode}
+\renewcommand{\ttdefault}{cmtl}
+% \end{macrocode}
+%
+% \subsection{Mathematical fonts}
+% Default definitions which remain unchanged are commented out:
+% \begin{macrocode}
+\DeclareSymbolFont {operators} {OT1}{cmbr}{m}{n}
+\DeclareSymbolFont {letters} {OML}{cmbrm}{m}{it}
+\DeclareSymbolFont {symbols} {OMS}{cmbrs}{m}{n}
+% \DeclareSymbolFont {largesymbols} {OMX}{cmex}{m}{n}
+%
+% \DeclareSymbolFontAlphabet {\mathrm} {operators}
+% \DeclareSymbolFontAlphabet{\mathnormal} {letters}
+% \DeclareSymbolFontAlphabet {\mathcal} {symbols}
+%
+\DeclareMathAlphabet{\mathit} {OT1}{cmbr}{m}{sl}
+\DeclareMathAlphabet{\mathbf} {OT1}{cmbr}{bx}{n}
+\DeclareMathAlphabet{\mathtt} {OT1}{cmtl}{m}{n}
+% \end{macrocode}
+% Despite its name, +\mathrm+ is not a font with serifs,
+% but it is, what the user expects it to be:
+% the upright font used e.g.\ for operator names.
+%
+% We do not set up a bold +\mathversion+, but we make a bold
+% slanted mathematical alphabet available:
+% \begin{macrocode}
+\DeclareMathAlphabet{\mathbold}{OML}{cmbrm}{b}{it}
+% \end{macrocode}
+%
+% The command +\mathbold+ should act on lowercase greek letters, too:
+% \begin{macrocode}
+\DeclareMathSymbol{\alpha}{\mathalpha}{letters}{11}
+\DeclareMathSymbol{\beta}{\mathalpha}{letters}{12}
+\DeclareMathSymbol{\gamma}{\mathalpha}{letters}{13}
+\DeclareMathSymbol{\delta}{\mathalpha}{letters}{14}
+\DeclareMathSymbol{\epsilon}{\mathalpha}{letters}{15}
+\DeclareMathSymbol{\zeta}{\mathalpha}{letters}{16}
+\DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
+\DeclareMathSymbol{\eta}{\mathalpha}{letters}{17}
+\DeclareMathSymbol{\theta}{\mathalpha}{letters}{18}
+\DeclareMathSymbol{\iota}{\mathalpha}{letters}{19}
+\DeclareMathSymbol{\kappa}{\mathalpha}{letters}{20}
+\DeclareMathSymbol{\lambda}{\mathalpha}{letters}{21}
+\DeclareMathSymbol{\mu}{\mathalpha}{letters}{22}
+\DeclareMathSymbol{\nu}{\mathalpha}{letters}{23}
+\DeclareMathSymbol{\xi}{\mathalpha}{letters}{24}
+\DeclareMathSymbol{\pi}{\mathalpha}{letters}{25}
+\DeclareMathSymbol{\rho}{\mathalpha}{letters}{26}
+\DeclareMathSymbol{\sigma}{\mathalpha}{letters}{27}
+\DeclareMathSymbol{\tau}{\mathalpha}{letters}{28}
+\DeclareMathSymbol{\upsilon}{\mathalpha}{letters}{29}
+\DeclareMathSymbol{\phi}{\mathalpha}{letters}{30}
+\DeclareMathSymbol{\chi}{\mathalpha}{letters}{31}
+\DeclareMathSymbol{\psi}{\mathalpha}{letters}{32}
+\DeclareMathSymbol{\omega}{\mathalpha}{letters}{33}
+\DeclareMathSymbol{\varepsilon}{\mathalpha}{letters}{34}
+\DeclareMathSymbol{\vartheta}{\mathalpha}{letters}{35}
+\DeclareMathSymbol{\varpi}{\mathalpha}{letters}{36}
+\DeclareMathSymbol{\varrho}{\mathalpha}{letters}{37}
+\DeclareMathSymbol{\varsigma}{\mathalpha}{letters}{38}
+\DeclareMathSymbol{\varphi}{\mathalpha}{letters}{39}
+% \end{macrocode}
+%
+% The \texttt{slantedGreek} option:
+% \begin{macrocode}
+\DeclareOption{slantedGreek}{%
+ \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{0}
+ \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{1}
+ \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{2}
+ \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{3}
+ \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{4}
+ \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{5}
+ \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{6}
+ \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{7}
+ \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{8}
+ \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{9}
+ \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{10}
+}
+\let\upOmega\Omega
+\let\upDelta\Delta
+% \end{macrocode}
+%
+% \subsection{Leading}
+% The +\baselineskip+ should be larger than with CM Roman. For text sizes,
+% i.e.\ 8--12\,pt, a value of $1.25 \times \mathrm{size}$ is recommended.
+% In order to overwrite the +\baselineskip+ defined in the commands
+% like +\normalsize+, +\small+, etc., we use a trick from Frank Jensen's
+% package \textsf{beton} (v1.3).
+% First we set up a table containing our +\baselineskip+ values:
+% \begin{macrocode}
+\def\bright@baselineskip@table
+ {<\@viiipt>10<\@ixpt>11.25<\@xpt>12.5<\@xipt>13.7<\@xiipt>15}
+% \end{macrocode}
+% All the standard \LaTeX\ size-changing commands (+\small+, +\large+,
+% etc.)\ are defined in terms of the +\@setfontsize+ macro. This
+% macro is called with the following three arguments: +#1+~is the
+% size-changing command; +#2+~is the font size; +#3+~is the
+% +\baselineskip+ value. We modify this macro to check
+% the above +\bright@baselineskip@table+ for an alternative +\baselineskip+
+% value:
+% \begin{macrocode}
+\def\bright@setfontsize#1#2#3%
+ {\edef\@tempa{\def\noexpand\@tempb####1<#2}%
+ \@tempa>##2<##3\@nil{\def\bright@baselineskip@value{##2}}%
+ \edef\@tempa{\noexpand\@tempb\bright@baselineskip@table<#2}%
+ \@tempa><\@nil
+ \ifx\bright@baselineskip@value\@empty
+ \def\bright@baselineskip@value{#3}%
+ \fi
+ \old@setfontsize{#1}{#2}\bright@baselineskip@value}
+% \end{macrocode}
+% Now we redefine +\@setfontsize+:
+% \begin{macrocode}
+\let\old@setfontsize=\@setfontsize
+\let\@setfontsize=\bright@setfontsize
+% \end{macrocode}
+% The +\baselineskip+ values specified in the above table should be
+% appropriate for most purposes, i.e., for one-column material in the
+% normal article/report/book formats. However, it is sometimes
+% desirable to use a smaller value for +\baselineskip+, e.g.\ in two-column
+% material. We therefore provide an option
+% to turn off the above automatic mechanism for +\baselineskip+ settings:
+% \begin{macrocode}
+\DeclareOption{standard-baselineskips}{%
+ \let\@setfontsize=\old@setfontsize}
+% \end{macrocode}
+% Note that the +\let+-assignment has to be executed after
+% +\old@setfontsize+ has been defined; this is ensured by
+% the fact that options are processed at the end of the package.
+%
+% \subsection{Old-style numerals}
+% Old-style numerals are to be taken from CM Bright, too:
+% \begin{macrocode}
+\def\oldstylenums#1{%
+ \begingroup
+ \spaceskip\fontdimen\tw@\font
+ \usefont{OML}{cmbrm}{\f@series}{it}%
+ \mathgroup\symletters #1%
+ \endgroup
+}
+% \end{macrocode}
+% In the future this may change; old-style numerals could be
+% taken from the text companion font, thus even providing `oldstyle
+% bold extended'~etc.
+%
+% \subsection{Missing symbols}
+% The OT1 encoded CM Bright fonts do not contain the symbol \pounds.
+% We must therefore redefine the
+% commands +\textsterling+ and +\mathsterling+.
+% They will now use the roman text font family:
+% \begin{macrocode}
+\DeclareTextCommand{\textsterling}{OT1}{{%
+ \rmfamily
+ \ifdim \fontdimen\@ne\font >\z@
+ \itshape
+ \else
+ \fontshape{ui}\selectfont
+ \fi
+ \char`\$}}
+\def\mathsterling{\textsl{\textsterling}}
+% \end{macrocode}
+% Since there is no `caps and small caps' font shape, the definition of
+% \textregistered\ must be changed:
+% \begin{macrocode}
+\DeclareTextCommandDefault{\textregistered}{%
+ \textcircled{{\rmfamily\scshape r}}}
+% \end{macrocode}
+%
+% \subsection{Defining the AMS symbol fonts}
+% In case the package \textsf{amsfonts} is loaded additionally,
+% the CM Bright versions of the AMS symbol fonts are to be used.
+% The \textsf{amsfonts} package, when loaded with the \texttt[psamsfonts] option,
+% will issue its own font definition commands, so we have to defer ours
+% after loading of the packages, so as not to let them be overwritten.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \DeclareFontFamily{U}{msa}{}
+ \DeclareFontShape{U}{msa}{m}{n}{%
+ <5><6><7><8>cmbras8%
+ <9>cmbras9%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmbras10%
+ }{}
+ \DeclareFontFamily{U}{msb}{}
+ \DeclareFontShape{U}{msb}{m}{n}{%
+ <5><6><7><8>cmbrbs8%
+ <9>cmbrbs9%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmbrbs10%
+ }{}
+}
+% \end{macrocode}
+%
+
+% \subsection{Patches for obsolete \LaTeX{} releases}
+% With a \LaTeX{} release previous to 1995/06/01
+% some macros from the \LaTeX{} kernel and the standard classes
+% must be redefined, because they explicitely select a font with serifs:
+% \begin{macrocode}
+%<*patch>
+\typeout{* This package `cmbright' contains patches}
+\typeout{* to be used with obsolete versions of LaTeX.}
+\typeout{* However, if your LaTeX is from 1995/06/01 or newer,}
+\typeout{* you MUST redo the installation of the package,}
+\typeout{* in order to generate it again, without the patches!}
+\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
+ \vskip \z@ \@plus.2\p@
+ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
+ \parindent #2\relax\@afterindenttrue
+ \interlinepenalty\@M
+ \leavevmode
+ \@tempdima #3\relax
+ \advance\leftskip \@tempdima \hbox{}\hskip -\leftskip
+ {#4}\nobreak\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep
+ mu$}\hfill \nobreak
+ \hbox to\@pnumwidth{\hfil\reset@font #5}\par}\fi}
+\def\@eqnnum{{\reset@font(\theequation)}}
+\DeclareOption{leqno}{
+\renewcommand\@eqnnum{\hbox to .01\p@{}%
+ \rlap{\reset@font%
+ \hskip -\displaywidth(\theequation)}}}
+\def\ps@plain{\let\@mkboth\@gobbletwo
+ \let\@oddhead\@empty\def\@oddfoot{\reset@font\hfil\thepage
+ \hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot}
+\pagestyle{plain}
+%</patch>
+% \end{macrocode}
+%
+% \subsection{Processing the options}
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Initialization}
+% We ensure that any package loaded after \texttt{cmbright}
+% will find the new value of +\baselineskip+
+% and the new +\normalfont+, which has a larger `em' than CM Roman.
+% \begin{macrocode}
+\normalfont\normalsize
+%</cm>
+% \end{macrocode}
+%
+% \section*{This file \ldots}
+% \ldots{} +cmbright.dtx+ contains the following
+% DocStrip modules:
+% \begin{quote}
+% \begin{tabular}{ll}
+% module: & contents:\\[0.5ex]
+% +cm+ & package +cmbright+\\
+% +driver+ & driver for documentaion \\
+% +patch+ & patches for \LaTeX{} release $<$ June 1995
+% \end{tabular}
+% \end{quote}
+% The module +patch+ should only be selected together with +cm+.
+% \vspace{1ex}
+%
+% The next line of code prevents DocStrip from adding the
+% character table to all modules:
+% \begin{macrocode}
+\endinput
+% \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 \~}
+%%
+
diff --git a/Master/texmf-dist/source/latex/cmbright/cmbright.ins b/Master/texmf-dist/source/latex/cmbright/cmbright.ins
new file mode 100644
index 00000000000..340a32c1c67
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cmbright/cmbright.ins
@@ -0,0 +1,26 @@
+% file cmbright.ins 1998-01-19
+%\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\input docstrip
+\usedir{tex/latex/cmbright}
+\keepsilent
+
+\Msg{Generating cmbright.sty ...}
+
+\generate{\file{cmbright.sty}{\from{cmbright.dtx}{cm}}}
+
+\Msg{Generating font definition files ...}
+
+\generate{\file{ot1cmbr.fd} {\from{cmbr.fdd}{cm}}
+ \file{t1cmbr.fd} {\from{cmbr.fdd}{ec}}
+ \file{ts1cmbr.fd} {\from{cmbr.fdd}{ts1cmbr}}
+ \file{omlcmbrm.fd}{\from{cmbr.fdd}{omlcmbrm}}
+ \file{omscmbrs.fd}{\from{cmbr.fdd}{omscmbrs}}
+ \file{omlcmbr.fd} {\from{cmbr.fdd}{omlcmbr}}
+ \file{omscmbr.fd} {\from{cmbr.fdd}{omscmbr}}
+ \file{ot1cmtl.fd} {\from{cmbr.fdd}{ot1cmtl}}
+ \file{t1cmtl.fd} {\from{cmbr.fdd}{t1cmtl}}
+ \file{ts1cmtl.fd} {\from{cmbr.fdd}{ts1cmtl}}
+}
+
+\endbatchfile
+
diff --git a/Master/texmf-dist/source/latex/cmbright/oinst.ins b/Master/texmf-dist/source/latex/cmbright/oinst.ins
new file mode 100644
index 00000000000..7af087adaee
--- /dev/null
+++ b/Master/texmf-dist/source/latex/cmbright/oinst.ins
@@ -0,0 +1,36 @@
+% file oinst.ins 1998-01-19
+\def\batchfile{oinst.ins}
+\input docstrip
+\keepsilent
+
+\generateFile{cmbright.sty}{}{
+ \from{cmbright.dtx}{cm}}
+
+
+\Msg{Generating fd files with mixed-case names ...}
+
+\generateFile{OT1cmbr.fd}{}{\from{cmbr.fdd}{cm}}
+\generateFile{T1cmbr.fd}{}{\from{cmbr.fdd}{ec}}
+\generateFile{OMLcmbrm.fd}{}{\from{cmbr.fdd}{omlcmbrm}}
+\generateFile{OMScmbrs.fd}{}{\from{cmbr.fdd}{omscmbrs}}
+\generateFile{OMLcmbr.fd}{}{\from{cmbr.fdd}{omlcmbr}}
+\generateFile{OMScmbr.fd}{}{\from{cmbr.fdd}{omscmbr}}
+\generateFile{OT1cmtl.fd}{}{\from{cmbr.fdd}{ot1cmtl}}
+\generateFile{T1cmtl.fd}{}{\from{cmbr.fdd}{t1cmtl}}
+\generateFile{TS1cmtl.fd}{}{\from{cmbr.fdd}{ts1cmtl}}
+\generateFile{TS1cmbr.fd}{}{\from{cmbr.fdd}{ts1cmbr}}
+
+
+\ifToplevel{
+\Msg{*}
+\Msg{* To finish the installation you have to move all }
+\Msg{* `.fd' and `.sty' files that have been generated }
+\Msg{* into a directory searched by LaTeX.}
+\Msg{*}
+\Msg{* In a TDS file system this should be: }
+\Msg{* \space\space texmf/tex/latex/cmbright }
+\Msg{*}
+}
+
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/comment/comment.cut b/Master/texmf-dist/source/latex/comment/comment.cut
new file mode 100644
index 00000000000..ac8a24a949f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/comment/comment.cut
@@ -0,0 +1,3 @@
+This is one is present.
+
+As is this one.
diff --git a/Master/texmf-dist/source/latex/datetime/datetime.dtx b/Master/texmf-dist/source/latex/datetime/datetime.dtx
new file mode 100644
index 00000000000..84aacd4bfbd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/datetime/datetime.dtx
@@ -0,0 +1,4817 @@
+%\iffalse
+% datetime.dtx generated using makedtx version 0.9b (c) Nicola Talbot
+% Command line args:
+% -macrocode ".*\.perl"
+% -setambles ".*\.perl=>\nopreamble\nopostamble"
+% -src "(.+)\.(def)=>\1.\2"
+% -src "(.+)\.(sty)=>\1.\2"
+% -src "(.+)\.(perl)=>\1.\2"
+% -src "(dt-sampl\.tex)=>\1"
+% -doc "manual.tex"
+% -author "Nicola Talbot"
+% -dir "source"
+% datetime
+% Created on 2005/10/1 15:23
+%\fi
+%\iffalse
+%<*package>
+%% \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 \~}
+%</package>
+%\fi
+% \iffalse
+% Doc-Source file to use with LaTeX2e
+% Copyright (C) 2005 Nicola Talbot, all rights reserved.
+% \fi
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+
+\usepackage[colorlinks,
+ bookmarks,
+ bookmarksopen,
+ pdfauthor={N.L.C. Talbot},
+ pdftitle={datetime.sty: A Date and Time Package},
+ pdfkeywords={date,time,LaTeX}]{hyperref}
+
+
+
+\newcommand{\stynamefmt}[1]{\textsf{#1}}
+\begin{document}
+\DocInput{datetime.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+%\RecordChanges
+%\OnlyDescription
+%\def\docdate{25 May 2005}
+%
+%\changes{v2.46}{30 Sep 2005}{'today defined using 'DeclareRobustCommand}
+%\changes{v2.41}{22 Oct 2004}{'today defined using 'providecommand instead of 'renewcommand}
+%
+% \title{datetime.sty v2.46: Formatting Current Date and
+%Time}
+% \author{N.L.C. Talbot}
+% \date{\docdate}
+% \maketitle
+% \tableofcontents
+% \section{Introduction}
+%\changes{v1.0}{8 Aug 2000}{First release}
+%\changes{v1.01}{18 Sept 2000}{Documentation added}
+%The \stynamefmt{datetime} package is a \LaTeXe\ package that
+%provides various different formats for \verb"\today",
+%and provides commands for displaying the current time.
+%If you only want the
+%time commands but not the date changing commands, you can pass
+%the option \texttt{nodate} to the package.
+%\changes{v2.3}{1 May 2004}{nodate option added}
+%
+%\changes{v2.41}{22 Oct 2004}{split package into two files:
+%datetime.sty and fmtcount.sty}
+%Since version 2.4, the \stynamefmt{datetime} package has been
+%separated into two packages: \stynamefmt{datetime} and
+%\stynamefmt{fmtcount}. When I originally created this package,
+%I defined the commands, \verb"\ordinal" etc which could be used
+%in the definition of \verb"\today". Since then, I have extended
+%the number of commands available that can be used to display the
+%value of a \LaTeX\ counter, however it seems more appropriate to
+%define all these counter-related commands in a separate package.
+%The \stynamefmt{fmtcount} package is now distributed separately
+%from the \stynamefmt{datetime} package, and will also need to
+%be installed.
+%
+%\changes{v2.42}{1 Nov 2004}{make package compatible with babel}
+%As from version 2.42, the \stynamefmt{datetime} package is now
+%compatible with \stynamefmt{babel}, however you must load the
+%\stynamefmt{datetime} package \emph{after} the \stynamefmt{babel} package. For example:
+%\begin{verbatim}
+%\usepackage[francais]{babel}
+%\usepackage{datetime}
+%\end{verbatim}
+%
+% \section{Date Declarations}
+% There are various declarations that change the effect of
+%\verb"\today". The change can be localised by placing the
+%declaration within a group.
+%
+% \vspace{10pt}\noindent \meta{Day} \meta{Month} \meta{Year} formats:\\
+% \noindent\DescribeMacro{\longdate}
+% The declaration \verb"\longdate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%Wednesday 8\textsuperscript{th} March, 2000
+% if the package option \texttt{dayofweek} is used, or
+%8\textsuperscript{th} March, 2000 if the package option
+% \texttt{nodayofweek} is used.\\
+% \DescribeMacro{\shortdate}
+% The declaration \verb"\shortdate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%Wed 8\textsuperscript{th} Mar, 2000 if the package option
+%\texttt{dayofweek} is used, or 8\textsuperscript{th} Mar, 2000
+%if the package option \texttt{nodayofweek} is used.\\
+% \DescribeMacro{\ddmmyyyydate}
+% The declaration \verb"\ddmmyyyydate" will redefine
+%\verb"\today" to produce
+% the current date displayed in the form 08/03/2000\\
+% \DescribeMacro{\dmyyyydate}
+% The declaration \verb"\dmyyyydate" will redefine
+%\verb"\today" to produce
+% the current date displayed in the form 8/3/2000\\
+% \DescribeMacro{\ddmmyydate}
+% The declaration \verb"\ddmmyydate" will redefine
+%\verb"\today" to produce
+% the current date displayed in the form 08/03/00\\
+% \DescribeMacro{\dmyydate}
+% The declaration \verb"\dmyydate" will redefine
+%\verb"\today" to produce
+% the current date displayed in the form 8/3/00\\
+% \DescribeMacro{\textdate}
+% The declaration \verb"\textdate" will redefine
+%\verb"\today" to produce the current date displayed in the form:
+%Wednesday the Eighth of March, Two Thousand if the package option
+%\texttt{dayofweek} is used, or Eighth of March, Two Thousand if
+%the package option \texttt{nodayofweek} is used.
+%
+% \vspace{10pt}\noindent \meta{Month} \meta{Day} \meta{Year} formats:\\
+% \DescribeMacro{\usdate}
+% The declaration \verb"\usdate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%March 8, 2000. (As \TeX\ and \LaTeX\ do by default.)\\
+% \DescribeMacro{\mmddyyyydate}
+% The declaration \verb"\mmddyyyydate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%03/08/2000\\
+% \DescribeMacro{\mdyyyydate}
+% The declaration \verb"\mdyyyydate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%3/8/2000\\
+% \DescribeMacro{\mmddyydate}
+% The declaration \verb"\mmddyydate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%03/08/00\\
+% \DescribeMacro{\mdyydate}
+% The declaration \verb"\mdyydate" will redefine
+%\verb"\today" to produce the current date displayed in the form
+%3/8/00
+%
+%\vspace{10pt}\noindent In addition, the declarations \verb"\date"\meta{lang} are
+%available for all languages defined either by
+%calling \stynamefmt{babel} prior to \stynamefmt{datetime} or by
+%passing the language name as an option to \stynamefmt{datetime}.
+%See~\autoref{sec:newdate} if you want to define your own customised date format.
+%
+%\changes{v2.43}{25 Feb 2005}{added 'dateseparator}%
+%As from version 2.43, the numerical date formats (such as
+%\verb"\ddmmyyyydate") use the command
+%\verb"\dateseparator" to separate the numbers. So, for example,
+%if you want to hyphens instead of slashes, you can do:
+%\begin{verbatim}
+%\renewcommand{\dateseparator}{-}
+%\end{verbatim}
+%
+% \section{Time Commands}
+%\changes{v2.3}{1 May 2004}{Fixed minor bug in 'ampmtime.
+%(or more specifically, changed the way 'ampmtime, 'xxivtime
+% and 'oclock are defined.)}
+%\DescribeMacro{\currenttime}
+% The current time is displayed using the command
+%\verb"\currenttime".
+%\DescribeMacro{\settimeformat}
+% The format can be changed using the declaration
+%\verb"\settimeformat{"\meta{style}\verb+}+,
+% where \meta{style} is the name of the format\footnote{%
+% Note that the commands \texttt{\textbackslash xxivtime},
+%\texttt{\textbackslash ampmtime} and
+% \texttt{\textbackslash oclock} are still available,
+%\texttt{\textbackslash settimeformat}
+% redefines \texttt{\textbackslash currenttime} to the command
+%given by placing a backslash in front of \meta{style}. So
+% \texttt{\textbackslash settimeformat\{xxivtime\}} sets
+%\texttt{\textbackslash currenttime}
+% to \texttt{\textbackslash xxivtime} and so on.}. Available
+%formats are:
+%\begin{description}
+%\item[xxivtime] Twenty-four hour time in the form 22:28 (Default)
+%\item[ampmtime] Twelve hour time in the form 10:28pm
+%\item[oclock] Displays the current time as a string, e.g.\
+%Twenty-Eight minutes past Ten in the afternoon.\footnote{Version
+%2.43 fixed bug which caused an infinite loop on the hour.}
+%\changes{v2.43}{23 Feb 2005}{Fixed bug in oclock time format}
+%\end{description}
+%
+% \DescribeMacro{\newtimeformat}
+%\changes{v2.3}{1 May 2004}{'newtimeformat and 'settimeformat
+%added}
+% New time formats can be defined using the command:\\[5pt]
+%\verb"\newtimeformat{"\meta{name}\verb+}{+\meta{format}\verb!}!\\[5pt]
+% where \meta{name} is the name of the new format (used in
+%\verb"\settimeformat"), and \meta{format} is how to format the
+%time. Within \meta{format} you can use the counters
+%\texttt{HOUR} (number of hours after midnight), \texttt{MINUTE}
+%(number of minutes past the hour), \texttt{HOURXII} (number of
+%hours after midnight/midday), \texttt{TOHOUR} (the next hour)
+% and \texttt{TOMINUTE} (number of minutes to the next hour), and
+%the corresponding commands:
+% \verb"\THEHOUR",
+%\verb"\THEMINUTE",
+%\verb"\THEHOURXII",
+%\verb"\THETOHOUR" and
+%\verb"\THETOMINUTE".
+%
+% For example, to define a new time format that uses a dot instead of a colon:
+%\begin{verbatim}
+%\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
+%\end{verbatim}
+%You then need to switch to this new format before you can use it:
+%\begin{verbatim}
+%\settimeformat{dottime}
+%\currenttime
+%\end{verbatim}
+%
+%\changes{v2.43}{25 Feb 2005}{added 'timeseparator}%
+%As from version 2.43, if you only want to change the separator,
+%you can simply redefine \verb"\timeseparator"
+%instead of defining a new time format. For example:
+%\begin{verbatim}
+%\renewcommand{\timeseparator}{.}
+%\end{verbatim}
+%The \texttt{xxivtime} format will now work like the \texttt{dottime} format defined above.
+%
+% \section{Formating Dates}
+% \DescribeMacro{\pdfdate}
+%\changes{v2.32}{4 May 2004}{Fixed bug in 'pdfdate}
+%\changes{v2.31}{1 May 2004}{'pdfdate added}
+% The command \verb"\pdfdate"\footnote{thanks to Ulrich Dirr for
+%asking about this} prints the date in the format required for
+% PDF files, e.g.\ if the date is 1 May 2004 and time is
+% 22:02, \verb"\pdfdate" will print 20040501220200. The reason
+%this date format is separate from all the others is because the
+%other form doesn't get properly expanded by PDF\TeX. (This
+%command is defined regardless of whether the package option
+%\texttt{nodate} is called.)
+%Example:
+%\begin{verbatim}
+%\pdfinfo{
+% /Author (Me)
+% /Title (A Sample Document)
+% /CreationDate (D:20040501215500)
+% /ModificationDate (D:\pdfdate)
+%}
+%\end{verbatim}
+%
+% There are two commands that print the name of the current
+% month:
+% \DescribeMacro{\monthname}
+% \verb"\monthname" prints the current month name in full,
+%e.g.\ August, and
+% \DescribeMacro{\shortmonthname}
+% \verb"\shortmonthname" prints the abbreviated month name,
+%e.g.\ Aug. Both \verb"\monthname" and
+%\verb"\shortmonthname" take an optional argument (a number from
+%1 to 12) if the name of a specific month is required. For
+%example, \verb"\monthname[6]" will produced the output: June.
+%\changes{v2.1}{17 Dec 2003}{Fixed bug in 'shortmonthname which
+%produced an error message in December}
+%\changes{v2.1}{17 Dec 2003}{Changed 'fmtord to use
+%'textsuperscript instead of \texttt{\^{}}}
+%
+% The day of the week is computed using the algorithm documented at
+% \url{http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm}.
+% This algorithm works for any date between 1\textsuperscript{st}
+%Jan, 1901 and 31\textsuperscript{st} Dec, 2099.
+% The following macros display the day of week for a given date:
+%
+% \noindent\DescribeMacro{\dayofweekname}
+% \verb"\dayofweekname{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}: prints the
+% day of week for the specified date. For example,
+%\verb"\dayofweekname{31}{10}{2002}"
+% will produce the output: Thursday.\\
+% \DescribeMacro{\shortdayofweekname}
+% \verb"\shortdayofweekname{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}: prints the abbreviated name for the
+% day of week for the specified date. For example\\
+% \verb"\shortdayofweekname{31}{10}{2002}"\\
+% will produce the output: Thu.
+%
+% \noindent\DescribeMacro{\ifshowdow}
+% The \TeX\ conditional \verb"\ifshowdow" can be used to determine
+% whether or not the option \texttt{dayofweek} has been passed to
+%the package.
+% For example:
+%\begin{verbatim}
+%\ifshowdow\dayofweekname{31}{10}{2002} \fi
+%\end{verbatim}
+% will only display the day of week if the \texttt{dayofweek}
+%option was passed to \stynamefmt{datetime}.
+% Alternatively, you can use David~Carlisle's \stynamefmt{ifthen}
+%package:
+%\begin{verbatim}
+%\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{}
+%\end{verbatim}
+%
+%\noindent\DescribeMacro{\ordinaldate}
+%\changes{v2.45}{23 May 2005}{'ordinaldate added}
+%The command \verb!\ordinaldate{!\meta{number}\verb+}+
+%displays \meta{number} as a date-type ordinal. If the
+%current language is English, this will simply pass
+%the argument to \verb!\ordinalnum! (defined in the
+%\stynamefmt{fmtcount} package),
+%if the current language is Breton, Welsh or French, a superscript
+%will only be added if \meta{number} is 1, otherwise only
+%\meta{number} will be displayed.
+%
+% \DescribeMacro{\formatdate}
+% The macro \verb"\formatdate{"\meta{day}\verb!}{!\meta{month}\verb+}{+\meta{year}\verb:}:\footnote{Note the
+% name change since version 1.1. The command name was changed
+%from \texttt{\textbackslash thedate}
+% to \texttt{\textbackslash formatdate}
+% to avoid a name clash when using the \stynamefmt{seminar} class
+%file.} formats
+% the specified date according to the current format of
+%\verb"\today"\footnote{To be more precise, \textbackslash
+%\texttt{today} is defined to be \textbackslash
+%\texttt{formatdate\{\textbackslash day\}\{\textbackslash month\}\{\textbackslash year\}}
+% where \textbackslash \texttt{longdate} etc change the definition
+%of \textbackslash \texttt{formatdate}}. (Arguments
+% must all be integers.) For example, in combination with
+%\verb"\longdate", the command\\
+%\verb"\formatdate{27}{9}{2004}"\\
+% will produce the output: Monday 27\textsuperscript{th}
+%September, 2004.
+%\changes{v1.1}{20 Apr 2002}{'thedate added (later changed to
+%'formatdate)}
+%\changes{v2.0}{30 Oct 2002}{Changed 'thedate to 'formatdate
+% to avoid name conflict with \stynamefmt{seminar} class file.}
+%\changes{v2.0}{30 Oct 2002}{Changed 'ordinal,
+% 'ordinalstring, 'Ordinalstring,
+% 'numberstring, 'Numberstring to take a
+% \LaTeX\ counter as argument instead of a \TeX\ count register,
+%to make them more consistent with 'arabic etc}
+%
+% \DescribeMacro{\twodigit}
+% You can ensure that a number is displayed with at least two
+%digits by using the command
+%\verb"\twodigit{"\meta{num}\verb!}!\footnote{New to version 2.2}.
+% This is of use if you want to define your own date or time
+%formats.
+%
+% \section{Defining New Date Formats}\label{sec:newdate}
+%
+% \DescribeMacro{\newdateformat}
+% New date formats can be defined using the command:\\[5pt]
+% \verb"\newdateformat{"\meta{name}\verb!}{!\meta{format}\verb+}+\\[5pt]
+% where \meta{name} is the name of the new format, and
+% \meta{format} is how to format the date. Within the
+% argument \meta{format} you can use the commands \verb"\THEDAY",
+%\verb!\THEMONTH!
+% and \verb"\THEYEAR" to represent the relevant day, month and
+%year, or you can use the counters
+% \texttt{DAY}, \texttt{MONTH} and \texttt{YEAR} if you want to
+%use \verb"\ordinal" etc. Once you have defined the
+% new date format, you can then switch to it using the declaration \verb'\'\meta{name}
+% (i.e.\ the name you specified preceded by a backslash), and
+% subsequent calls to \verb"\today" and \verb!\formatdate! will
+%use your new format.
+%\changes{v2.2}{27 Apr 2004}{'newdateformat added}
+%
+% For example, suppose you want to define a new date format called,
+% say, \texttt{mydate}, that will typeset the date in the form:
+%8-3-2002,
+% then you can do:
+%\begin{verbatim}
+%\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
+%\end{verbatim}
+% \verb"\newdateformat" will then define the declaration
+%\verb!\mydate! which can be used to
+% switch to your new format. In the following example,
+% two new date formats are defined, and they are then
+% selected to produce two different formats for the current date:
+%\begin{verbatim}
+%\newdateformat{dashdate}{%
+%\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
+%
+%\newdateformat{usvardate}{%
+%\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}
+%
+%Dash: \dashdate\today.
+%US: \usvardate\today.
+%\end{verbatim}
+%If the current date is, say, 8th March, 2002, the above code will
+% produce the following:
+%Dash: 08-03-2002.
+%US: March 8\textsuperscript{th}, 2002.
+%
+%Note that \verb"\THEDAY" etc and \texttt{DAY} etc have no real
+%meaning outside \verb"\newdateformat" (this is why they
+%are in uppercase). Incidentally, the \texttt{dashdate} format
+%is not really necessary, as you can achieve this format
+%using:
+%\begin{verbatim}
+%\renewcommand{\dateseparator}{-}
+%\ddmmyyyydate
+%\end{verbatim}
+%
+%Another note: in the above code, \verb'\ordinal' was
+%used to illustrate the use of the \texttt{DAY} counter. It
+%is better to use \verb'\ordinaldate' instead:
+%\begin{verbatim}
+%\newdateformat{usvardate}{%
+%\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR}
+%\end{verbatim}
+%
+%\section{Saving Dates}
+%
+%\changes{v2.45}{1 May 2005}{added facility for saving dates}
+%It is possible to save a date for later use using the command:
+%\footnote{Thanks to Denis Bitouz\'e for asking about this}\par
+%\DescribeMacro{\newdate}
+%\verb"\newdate{"\meta{name}\verb!}{!\meta{day}\verb+}{+%
+%\meta{month}\verb'}{'\meta{year}\verb"}"
+%
+%This date can later be displayed using the same format as that
+%used by \verb"\formatdate" using the command:\par
+%\DescribeMacro{\displaydate}
+%\verb"\displaydate{"\meta{name}\verb'}'
+%
+%Individual elements of the date can be extracted using the
+%commands:\par
+%\DescribeMacro{\getdateday}
+%\verb"\getdateday{"\meta{name}\verb'}'\par
+%\DescribeMacro{\getdatemonth}
+%\verb"\getdatemonth{"\meta{name}\verb'}'\par
+%\DescribeMacro{\getdateyear}
+%\verb"\getdateyear{"\meta{name}\verb'}'
+%
+%\section{Predefined Names}
+%
+%The following commands are defined by the \stynamefmt{datetime}
+%package:
+%
+%\begin{tabular}{ll}
+%\bfseries Command Name & \bfseries Default Value\\
+%\verb"\dateseparator"\changes{v2.43}{25 Feb 2005}{added
+%'dateseparator} & \verb'/'\\
+%\verb"\timeseparator"\changes{v2.43}{25 Feb 2005}{added
+%'timeseparator} & \verb':'\\
+%\verb"\amname" & \texttt{am}\\
+%\verb"\pmname" & \texttt{pm}\\
+%\verb"\amorpmname" & \verb'\amname' if morning, otherwise
+%\verb!\pmname!\\
+%\verb"\amstring" & \texttt{in the morning}\\
+%\verb"\pmstring" & \texttt{in the afternoon}\\
+%\verb"\amorpmstring" & \verb!\amstring! if morning, otherwise
+%\verb'\pmstring'\\
+%\verb"\halfpast" & \texttt{Half past}\\
+%\verb"\quarterpast" & \texttt{Quarter past}\\
+%\verb"\quarterto" & \texttt{Quarter to}\\
+%\verb"\noon" & \texttt{Noon}\\
+%\verb"\midnight" & \texttt{Midnight}\\
+%\verb"\oclockstring" & \texttt{O'Clock}
+%\end{tabular}
+%
+% \section{Package Options}
+%
+% The following options may be passed to this package:\\[10pt]
+% \begin{tabular}{@{\ttfamily}ll}
+% long & make \verb"\today" produce long date\\
+% short & make \verb"\today" produce short date\\
+% ddmmyyyy & make \verb"\today" produce DD/MM/YYYY date\\
+% dmyyyy & make \verb"\today" produce D/M/YYYY date\\
+% ddmmyy & make \verb"\today" produce DD/MM/YY date\\
+% dmyy & make \verb"\today" produce D/M/YY date\\
+% text & make \verb"\today" produce text date\\
+% us & make \verb"\today" produce US style date\\
+% mmddyyyy & make \verb"\today" produce MM/DD/YYYY date\\
+% mdyyyy & make \verb"\today" produce M/D/YYYY date\\
+% mmddyy & make \verb"\today" produce MM/DD/YY date\\
+% mdyy & make \verb"\today" produce M/D/YY date\\
+% raise & make ordinal st,nd,rd,th appear as superscript\\
+% level & make ordinal st,nd,rd,th appear level with rest of
+%text\\
+% dayofweek & make the day of week appear for \verb"\longdate",
+%\verb!\shortdate! \\
+% & or \verb"\textdate"\\
+% nodayofweek & don't display the day of week.\\
+% 24hr & make \verb"\currenttime" produce \texttt{xxivtime}
+%format\\
+% 12hr & make \verb"\currenttime" produce \texttt{ampmtime}
+%format\\
+% oclock & make \verb"\currenttime" produce \texttt{oclock}
+%format\\
+% nodate & Don't redefine \verb"\today" or define the month or
+%day of week commands\\
+% & (useful if you only want the time commands or
+%\verb"\pdfdate")
+% \end{tabular}
+%
+%The default options are: \texttt{long}, \texttt{raise},
+%\texttt{dayofweek} and \texttt{24hr}.
+%
+%\section{Multilingual Support}
+%
+%If the \stynamefmt{babel} package is called prior to
+%\stynamefmt{datetime}, \verb"\date"\meta{lang}
+%will be the default date format,
+%where \meta{lang} is the current language.
+%
+%The commands \verb'\monthname' and \verb"\shortmonthname",
+%will produce the month name in the current language.
+%If you want the month name in a specific language, you
+%can use the command \verb'\monthname'\meta{lang}.
+%For example, \verb"\monthnamefrench[6]" will produce the output:
+%juin.
+%
+%There is currently only limited multilingual support for
+%\verb"\dayofweekname" and \verb!\shortdayofweekname! (just
+%English, French, Portuguese and Spanish). You can add support for
+%other languages by defining the commands
+%\verb'\dayofweeknameid'\meta{lang} and
+%\verb'\shortdayofweeknameid'\meta{lang}. Note that these
+%commands only take \emph{one} argument which should be
+%a number from 1 to 7 indicating the day of the week.
+%
+%You can use the following as templates. Replace
+%\texttt{english} with the name of your language (as given
+%by \verb'\languagename') and replace \texttt{Sunday}
+%etc as appropriate:
+%\begin{verbatim}
+%\providecommand{\dayofweeknameidenglish}[1]{%
+%\ifcase#1\relax
+%\or Sunday%
+%\or Monday%
+%\or Tuesday%
+%\or Wednesday%
+%\or Thursday%
+%\or Friday%
+%\or Saturday%
+%\fi}
+%
+%\providecommand{\shortdayofweekidnameenglish}[1]{%
+%\ifcase#1\relax
+%\or Sun%
+%\or Mon%
+%\or Tue%
+%\or Wed%
+%\or Thu%
+%\or Fri%
+%\or Sat%
+%\fi}
+%\end{verbatim}
+%If you want them added to future versions of
+%\stynamefmt{datetime}, please e-mail me the code.
+%
+%\section{Configuration File}
+%
+%\changes{v2.4}{25 Sept 2004}{provision for configuration file
+%datetime.cfg}
+%As from Version 2.4, the \stynamefmt{datetime} package will read in
+%settings from the configuration
+% file \texttt{datetime.cfg}, if it exists, which will override
+%the default package options.
+% For example, suppose you prefer a short date without the day of
+%week by default, you will need to create
+% a file called \texttt{datetime.cfg} that contains the line:
+%\begin{verbatim}
+%\shortdate\showdowfalse
+%\end{verbatim}
+%The file \texttt{datetime.cfg} should then go somewhere on the
+%\TeX\ path. Now all you need to do is:
+%\begin{verbatim}
+%\usepackage{datetime}
+%\end{verbatim}
+%without having to specify the \texttt{short} and
+%\texttt{nodayofweek} options.
+%
+%You can also use this file to define and set your own date
+%styles. For example, you could create
+%a configuration file that has the following lines:
+%\begin{verbatim}
+%\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
+%\dashdate
+%\end{verbatim}
+%Whenever you use the \stynamefmt{datetime} package, it will now
+%use this format by default.
+%
+%\section{LaTeX2HTML styles}
+%
+%\changes{v2.43}{25 Feb 2005}{Added LaTeX2HTML support}%
+%\changes{v2.44}{3 Mar 2005}{Fixed minor bugs in Perl scripts}
+%Version 2.43 and above of the \stynamefmt{datetime} bundle
+%supplies the LaTeX2HTML style file \texttt{datetime.perl}.
+%This file should be placed in a
+%directory searched by LaTeX2HTML. The following limitations
+%apply to the LaTeX2HTML styles:
+%
+%\begin{itemize}
+%\item The configuration file \texttt{datetime.cfg}
+%is currently ignored. (This is because
+%I can't work out the correct code to do this. If you
+%know how to do this, please let me know.) You can however
+%do:
+%\begin{verbatim}
+%\usepackage{datetime}
+%\html{\input{datetime.cfg}}
+%\end{verbatim}
+%This, I agree, is an unpleasant cludge.
+%
+%\item The commands \verb"\monthname"\meta{language} are not
+%implemented.
+%
+%\item Some of the languages are not implemented.
+%
+%\item The package option \texttt{nodate} is not implemented.
+%
+%\end{itemize}
+%
+% \section{Contact Details}
+% Dr Nicola Talbot\\
+% School of Computing Sciences\\
+% University of East Anglia\\
+% Norwich. NR4 7TJ.\\
+% United Kingdom.\\
+% \url{http://theoval.cmp.uea.ac.uk/~nlct/}
+%
+%
+%\StopEventually{}
+%\section{The Code}
+% \begin{macrocode}
+%<*dt-austrian.def>
+% \end{macrocode}
+%\section{Compatibility with Babel}
+%Austrian
+% \begin{macrocode}
+\ProvidesFile{dt-austrian.def}[2004/10/31]
+
+\providecommand{\monthnameaustrian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or J\"anner%
+\or Februar%
+\or M\"arz%
+\or April%
+\or Mai%
+\or Juni%
+\or Juli%
+\or August%
+\or September%
+\or Oktober%
+\or November%
+\or Dezember%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (janvier) to 12 (decembre)}%
+\fi}
+
+\DeclareRobustCommand*\dateaustrian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameaustrian[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-austrian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-bahasa.def>
+% \end{macrocode}
+%Bahasa
+% \begin{macrocode}
+\ProvidesFile{dt-bahasa.def}[2004/10/31]
+
+\providecommand{\monthnamebahasa}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Januari) to 12 (Desember)}%
+\or Januari%
+\or Pebruari%
+\or Maret%
+\or April%
+\or Mei%
+\or Juni%
+\or Juli%
+\or Agustus%
+\or September%
+\or Oktober%
+\or Nopember%
+\or Desember%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Januari) to 12 (Desember)}%
+\fi}
+
+\providecommand{\shortmonthnamebahasa}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Januari) to 12 (Desember)}%
+\or Januari%
+\or Pebruari%
+\or Maret%
+\or April%
+\or Mei%
+\or Juni%
+\or Juli%
+\or Agustus%
+\or September%
+\or Oktober%
+\or Nopember%
+\or Desember%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Januari) to 12 (Desember)}%
+\fi}
+
+\DeclareRobustCommand*\datebahasa{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day}~\monthnamebahasa[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-bahasa.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-basque.def>
+% \end{macrocode}
+%Basque
+% \begin{macrocode}
+\ProvidesFile{dt-basque.def}[2004/10/31]
+
+\providecommand{\monthnamebasque}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}%
+\or urtarrilaren%
+\or otsailaren%
+\or martxoaren%
+\or apirilaren%
+\or maiatzaren%
+\or ekainaren%
+\or uztailaren%
+\or abuztuaren%
+\or irailaren%
+\or urriaren%
+\or azaroaren%
+\or abenduaren%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}%
+\fi}
+
+\providecommand{\shortmonthnamebasque}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}%
+\or urtarrilaren%
+\or otsailaren%
+\or martxoaren%
+\or apirilaren%
+\or maiatzaren%
+\or ekainaren%
+\or uztailaren%
+\or abuztuaren%
+\or irailaren%
+\or urriaren%
+\or azaroaren%
+\or abenduaren%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}%
+\fi}
+
+\DeclareRobustCommand*\datebasque{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@year.eko\space\monthnamebasque[\@month]~\number\@day}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-basque.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-breton.def>
+% \end{macrocode}
+%Breton
+% \begin{macrocode}
+\ProvidesFile{dt-breton.def}[2004/10/31]
+
+\providecommand{\monthnamebreton}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Genver) to 12 (Kerzu)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Genver) to 12 (Kerzu)}%
+\fi}
+
+\providecommand{\shortmonthnamebreton}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Genver) to 12 (Kerzu)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (Genver) to 12 (Kerzu)}%
+\fi}
+
+\DeclareRobustCommand*\datebreton{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\ifnum\@day=1\relax 1\/\textsuperscript{a\~n}\else\number\@day\fi\space
+a\space viz\space\monthnamebreton[\@month]\space\number\@year
+}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-breton.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-bulgarian.def>
+% \end{macrocode}
+%Bulgarian
+% \begin{macrocode}
+\ProvidesFile{dt-bulgarian.def}[2004/10/31]
+
+\providecommand{\monthnamebulgarian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+ \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
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\providecommand{\shortmonthnamebulgarian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+ \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
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datebulgarian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnamebulgarian[\@month]\ \number\@year~\cyrg.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-bulgarian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-catalan.def>
+% \end{macrocode}
+%Catalan
+% \begin{macrocode}
+\ProvidesFile{dt-catalan.def}[2004/10/31]
+
+\providecommand{\monthnamecatalan}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (de gener) to 12 (de desembre)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (de gener) to 12 (de desembre)}%
+\fi}
+
+\providecommand{\shortmonthnamecatalan}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (de gener) to 12 (de desembre)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (de gener) to 12 (de desembre)}%
+\fi}
+
+\DeclareRobustCommand*\datecatalan{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnamecatalan[\@month]\ de~\number\@year
+}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-catalan.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-croatian.def>
+% \end{macrocode}
+%Croatian
+% \begin{macrocode}
+\ProvidesFile{dt-croatian.def}[2004/10/31]
+
+\providecommand{\monthnamecroatian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (sijecnja) to 12 (prosinca)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (sijecnja) to 12 (prosinca)}%
+\fi}
+
+\providecommand{\shortmonthnamecroatian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (sijecnja) to 12 (prosinca)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (sijecnja) to 12 (prosinca)}%
+\fi}
+
+\DeclareRobustCommand*\datecroatian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamecroatian[\@month]\space \number\@year.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-croatian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-czech.def>
+% \end{macrocode}
+%Czech
+% \begin{macrocode}
+\ProvidesFile{dt-czech.def}[2004/10/31]
+
+\providecommand{\monthnameczech}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\providecommand{\shortmonthnameczech}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateczech{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameczech[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-czech.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-danish.def>
+% \end{macrocode}
+%Danish
+% \begin{macrocode}
+\ProvidesFile{dt-danish.def}[2004/10/31]
+
+\providecommand{\monthnamedanish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januar%
+\or februar%
+\or marts%
+\or april%
+\or maj%
+\or juni%
+\or juli%
+\or august%
+\or september%
+\or oktober%
+\or november%
+\or december%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datedanish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamedanish[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-danish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-dutch.def>
+% \end{macrocode}
+%Dutch
+% \begin{macrocode}
+\ProvidesFile{dt-dutch.def}[2004/10/31]
+
+\providecommand{\monthnamedutch}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januari%
+\or februari%
+\or maart%
+\or april%
+\or mei%
+\or juni%
+\or juli%
+\or augustus%
+\or september%
+\or oktober%
+\or november%
+\or december%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datedutch{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnamedutch[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-dutch.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-esperanto.def>
+% \end{macrocode}
+%Esperanto
+% \begin{macrocode}
+\ProvidesFile{dt-esperanto.def}[2004/10/31]
+
+\providecommand{\monthnameesperanto}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateesperanto{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day{--a}~de~\monthnameesperanto[\@month],\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-esperanto.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-estonian.def>
+% \end{macrocode}
+%Estonian
+% \begin{macrocode}
+\ProvidesFile{dt-estonian.def}[2004/10/31]
+
+\providecommand{\monthnameestonian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateestonian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.\space\monthnameestonian[\@month]\space \number\@year.\space a.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-estonian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-finnish.def>
+% \end{macrocode}
+%Finnish
+% \begin{macrocode}
+\ProvidesFile{dt-finnish.def}[2004/10/31]
+
+\providecommand{\monthnamefinnish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datefinnish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamefinnish[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-finnish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-french.def>
+% \end{macrocode}
+%French
+% \begin{macrocode}
+\ProvidesFile{dt-french.def}[2004/10/31]
+
+\providecommand{\dayofweeknameidfrench}[1]{%
+\ifcase#1\relax
+\or dimanche%
+\or lundi%
+\or mardi%
+\or mercredi%
+\or jeudi%
+\or vendredi%
+\or samedi%
+\fi}
+
+ % is this correct?
+\providecommand{\shortdayofweeknameidfrench}[1]{%
+\ifcase#1\relax
+\or dim%
+\or lun%
+\or mar%
+\or mer%
+\or jeu%
+\or ven%
+\or sam%
+\fi}
+
+\providecommand{\monthnamefrench}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (janvier) to 12 (decembre)}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (janvier) to 12 (decembre)}%
+\fi}
+
+\DeclareRobustCommand*\datefrench{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\ifnum\@day=1{\ier}\fi\space\monthnamefrench[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-french.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-galician.def>
+% \end{macrocode}
+%Galician
+% \begin{macrocode}
+\ProvidesFile{dt-galician.def}[2004/10/31]
+
+\providecommand{\monthnamegalician}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dategalician{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~de\space\monthnamegalician[\@month]\space de~\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-galician.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-german.def>
+% \end{macrocode}
+%German
+% \begin{macrocode}
+\ProvidesFile{dt-german.def}[2004/10/31]
+
+\providecommand{\monthnamegerman}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (janvier) to 12 (decembre)}%
+\fi}
+
+\DeclareRobustCommand*\dategerman{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamegerman[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-german.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-greek.def>
+% \end{macrocode}
+%Greek
+% \begin{macrocode}
+\ProvidesFile{dt-greek.def}[2004/10/31]
+
+\providecommand{\monthnamegreek}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dategreek{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\space\monthnamegreek[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-greek.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-hebrew.def>
+% \end{macrocode}
+%Hebrew
+% \begin{macrocode}
+\ProvidesFile{dt-hebrew.def}[2004/10/31]
+
+\DeclareRobustCommand*\datehebrew{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\hebdate\@day\@month\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-hebrew.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-icelandic.def>
+% \end{macrocode}
+%Icelandic
+% \begin{macrocode}
+\ProvidesFile{dt-icelandic.def}[2004/10/31]
+
+\providecommand{\monthnameicelandic}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or janúar%
+\or febrúar%
+\or mars%
+\or apríl%
+\or maí%
+\or júní%
+\or júlí%
+\or ágúst%
+\or september%
+\or október%
+\or nóvember%
+\or desembe%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateicelandic{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameicelandic[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-icelandic.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-irish.def>
+% \end{macrocode}
+%Irish
+% \begin{macrocode}
+\ProvidesFile{dt-irish.def}[2004/10/31]
+
+\providecommand{\monthnameirish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateirish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\space\monthnameirish[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-irish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-italian.def>
+% \end{macrocode}
+%Italian
+% \begin{macrocode}
+\ProvidesFile{dt-italian.def}[2004/10/31]
+
+\providecommand{\monthnameitalian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or gennaio%
+\or febbraio%
+\or marzo%
+\or aprile%
+\or maggio%
+\or giugno%
+\or luglio%
+\or agosto%
+\or settembre%
+\or ottobre%
+\or novembre%
+\or dicembre%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateitalian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\space\monthnameitalian[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-italian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-latin.def>
+% \end{macrocode}
+%Latin
+% \begin{macrocode}
+\ProvidesFile{dt-latin.def}[2004/10/31]
+
+\providecommand{\monthnamelatin}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or Ianuarii%
+\or Februarii%
+\or Martii%
+\or Aprilis%
+\or Maii%
+\or Iunii%
+\or Iulii%
+\or Augusti%
+\or Septembris%
+\or Octobris%
+\or Novembris%
+\or Decembris%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datelatin{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont
+ \uppercase\expandafter{\romannumeral\@day}~\monthnamelatin[\@month]\space{\uppercase\expandafter{\romannumeral\@year}}}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-latin.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-lsorbian.def>
+% \end{macrocode}
+%LSorbian
+% \begin{macrocode}
+\ProvidesFile{dt-lsorbian.def}[2004/10/31]
+
+\providecommand{\monthnamenewlsorbian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\providecommand{\monthnameoldlsorbian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\let\monthnamelsorbian=\monthnamenewlsorbian
+
+\DeclareRobustCommand*\newdatelsorbian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamenewlsorbian[\@month]\space\number\@year}}
+
+\DeclareRobustCommand*\olddatelsorbian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameoldlsorbian[\@month]\space\number\@year}}
+
+\let\datelsorbian\newdatelsorbian
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-lsorbian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-magyar.def>
+% \end{macrocode}
+%Magyar
+% \begin{macrocode}
+\ProvidesFile{dt-magyar.def}[2004/10/31]
+
+\providecommand{\monthnamemagyar}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datemagyar{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@year.~\monthnamemagyar[\@month]\space\number\@day.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-magyar.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-naustrian.def>
+% \end{macrocode}
+%NAustrian
+% \begin{macrocode}
+\ProvidesFile{dt-naustrian.def}[2004/10/31]
+
+\providecommand{\monthnamenaustrian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or J\"anner%
+\or Februar%
+\or M\"arz%
+\or April%
+\or Mai%
+\or Juni%
+\or Juli%
+\or August%
+\or September%
+\or Oktober%
+\or November%
+\or Dezember%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datenaustrian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamenaustrian[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-naustrian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-ngerman.def>
+% \end{macrocode}
+%NGerman
+% \begin{macrocode}
+\ProvidesFile{dt-ngerman.def}[2004/10/31]
+
+\providecommand{\monthnamengerman}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datengerman{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamengerman[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-ngerman.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-norsk.def>
+% \end{macrocode}
+%Norsk
+% \begin{macrocode}
+\ProvidesFile{dt-norsk.def}[2004/10/31]
+
+\providecommand{\monthnamenorsk}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januar%
+\or februar%
+\or mars%
+\or april%
+\or mai%
+\or juni%
+\or juli%
+\or august%
+\or september%
+\or oktober%
+\or november%
+\or desember%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datenorsk{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamenorsk[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-norsk.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-polish.def>
+% \end{macrocode}
+%Polish
+% \begin{macrocode}
+\ProvidesFile{dt-polish.def}[2004/10/31]
+
+\providecommand{\monthnamepolish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datepolish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnamepolish[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-polish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-portuges.def>
+% \end{macrocode}
+%Portuges
+% \begin{macrocode}
+\ProvidesFile{dt-portuges.def}[2004/10/31]
+
+\providecommand{\dayofweeknameidportuges}[1]{%
+\ifcase#1\relax
+\or domingo%
+\or segunda-feira%
+\or ter\c{c}a-feira%
+\or quarta-feira%
+\or quinta-feira%
+\or sexta-feira%
+\or sabado%
+\fi}
+
+\providecommand{\monthnameportuges}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateportuges{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\space de\space\monthnameportuges[\@month]\space de\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-portuges.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-romanian.def>
+% \end{macrocode}
+%Romanian
+% \begin{macrocode}
+\ProvidesFile{dt-romanian.def}[2004/10/31]
+
+\providecommand{\monthnameromanian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or ianuarie%
+\or februarie%
+\or martie%
+\or aprilie%
+\or mai%
+\or iunie%
+\or iulie%
+\or august%
+\or septembrie%
+\or octombrie%
+\or noiembrie%
+\or decembrie%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateromanian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnameromanian[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-romanian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-russian.def>
+% \end{macrocode}
+%Russian
+% \begin{macrocode}
+\ProvidesFile{dt-russian.def}[2004/10/31]
+
+\providecommand{\monthnamerussian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\daterussian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnamerussian[\@month]\ \number\@year~\cyrg.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-russian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-samin.def>
+% \end{macrocode}
+%Samin
+% \begin{macrocode}
+\ProvidesFile{dt-samin.def}[2004/10/31]
+
+\providecommand{\monthnamesamin}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datesamin{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\monthnamesamin[\@month]\space\number\@day.~b.\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-samin.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-scottish.def>
+% \end{macrocode}
+%Scottish
+% \begin{macrocode}
+\ProvidesFile{dt-scottish.def}[2004/10/31]
+
+\providecommand{\monthnamescottish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datescottish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day\space\monthnamescottish[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-scottish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-serbian.def>
+% \end{macrocode}
+%Serbian
+% \begin{macrocode}
+\ProvidesFile{dt-serbian.def}[2004/10/31]
+
+\providecommand{\monthnameserbian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januar%
+\or februar%
+\or mart%
+\or april%
+\or maj%
+\or juni%
+\or juli%
+\or avgust%
+\or septembar%
+\or oktobar%
+\or novembar%
+\or decembar%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateserbian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameserbian[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-serbian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-slovak.def>
+% \end{macrocode}
+%Slovak
+% \begin{macrocode}
+\ProvidesFile{dt-slovak.def}[2004/10/31]
+
+\providecommand{\monthnameslovak}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateslovak{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameslovak[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-slovak.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-slovene.def>
+% \end{macrocode}
+%Slovene
+% \begin{macrocode}
+\ProvidesFile{dt-slovene.def}[2004/10/31]
+
+\providecommand{\monthnameslovene}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januar%
+\or februar%
+\or marec%
+\or april%
+\or maj%
+\or junij%
+\or julij%
+\or avgust%
+\or september%
+\or oktober%
+\or november%
+\or december%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateslovene{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameslovene[\@month]\space \number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-slovene.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-spanish.def>
+% \end{macrocode}
+%Spanish
+% \begin{macrocode}
+\ProvidesFile{dt-spanish.def}[2004/10/31]
+
+\providecommand{\dayofweeknameidspanish}[1]{%
+\ifcase#1\relax
+\or domingo%
+\or lunes%
+\or martes%
+\or mi\'ercoles%
+\or jueves%
+\or viernes%
+\or s\'abado%
+\fi}
+
+ % is this correct?
+\providecommand{\shortdayofweeknameidspanish}[1]{%
+\ifcase#1\relax
+\or dom%
+\or lun%
+\or mar%
+\or mi\'e%
+\or jue%
+\or vie%
+\or s\'ab%
+\fi}
+
+\providecommand{\monthnamespanish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or enero%
+\or febrero%
+\or marzo%
+\or abril%
+\or mayo%
+\or junio%
+\or julio%
+\or agosto%
+\or septiembre%
+\or octubre%
+\or noviembre%
+\or diciembre%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datespanish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~de \monthnamespanish[\@month]\ de~\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-spanish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-swedish.def>
+% \end{macrocode}
+%Swedish
+% \begin{macrocode}
+\ProvidesFile{dt-swedish.def}[2004/10/31]
+
+\providecommand{\monthnameswedish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or januari%
+\or februari%
+\or mars%
+\or april%
+\or maj%
+\or juni%
+\or juli%
+\or augusti%
+\or september%
+\or oktober%
+\or november%
+\or december%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateswedish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnameswedish[\@month]\space\number\@year}}
+
+\DeclareRobustCommand*\datesymd{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@year-\two@digits\@month-\two@digits\@day}
+}
+
+\DeclareRobustCommand*\datesdmy{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day/\number\@month\space\number\@year}
+}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-swedish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-turkish.def>
+% \end{macrocode}
+%Turkish
+% \begin{macrocode}
+\ProvidesFile{dt-turkish.def}[2004/10/31]
+
+\providecommand{\monthnameturkish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateturkish{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnameturkish[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-turkish.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-ukraineb.def>
+% \end{macrocode}
+%Ukraine
+% \begin{macrocode}
+\ProvidesFile{dt-ukraineb.def}[2004/10/31]
+
+\providecommand{\monthnameukraineb}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\dateukraineb{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day~\monthnameukraineb[\@month]\space\number\@year~\cyrr.}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-ukraineb.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-usorbian.def>
+% \end{macrocode}
+%USorbian
+% \begin{macrocode}
+\ProvidesFile{dt-usorbian.def}[2004/10/31]
+
+\providecommand{\monthnamenewusorbian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\providecommand{\monthnameoldusorbian}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\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%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\let\monthnameusorbian=\monthnamenewusorbian
+
+\DeclareRobustCommand*\newdateusorbian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnamenewusorbian[\@month]\space\number\@year}}
+
+\DeclareRobustCommand*\olddateusorbian{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\number\@day.~\monthnameoldusorbian[\@month]\space\number\@year}}
+
+\let\dateusorbian\newdateusorbian
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-usorbian.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-welsh.def>
+% \end{macrocode}
+%Welsh
+% \begin{macrocode}
+\ProvidesFile{dt-welsh.def}[2004/10/31]
+
+\providecommand{\monthnamewelsh}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\or Ionawr%
+\or Chwefror%
+\or Mawrth%
+\or Ebrill%
+\or Mai%
+\or Mehefin%
+\or Gorffennaf%
+\or Awst%
+\or Medi%
+\or Hydref%
+\or Tachwedd%
+\or Rhagfyr%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}%
+\fi}
+
+\DeclareRobustCommand*\datewelsh{%
+\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\ifnum\@day=1\relax 1\/$^{\mathrm{a\tilde{n}}}$\else
+\number\@day\fi \space a\space viz\space\monthnamewelsh[\@month]\space\number\@year}}
+% \end{macrocode}
+% \begin{macrocode}
+%</dt-welsh.def>
+% \end{macrocode}
+% \begin{macrocode}
+%<*datetime.sty>
+% \end{macrocode}
+%\subsection{datetime.sty}
+% This section deals with the code for \texttt{datetime.sty}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{datetime}[2005/09/30 v2.46 Date Time Package]
+% \end{macrocode}
+%\texttt{fmtcount.sty} needs to be loaded here as it defines the command |\fmtord| which may be redefined later:
+% \begin{macrocode}
+\RequirePackage{fmtcount}
+% \end{macrocode}
+% Define a new conditional |\if@dt@nodate|. If it is true,
+% |\today| will not be redefined, nor will
+% |\monthname|, |\shortmonthname|, |\dayofweek| and |\shortdayofweek| be defined.
+% Set it to false.
+% \begin{macrocode}
+\newif\if@dt@nodate
+\@dt@nodatefalse
+% \end{macrocode}
+% Define the character used to separate the numbers in the formats defined by
+% |\ddmmyyyy| etc
+% \begin{macrocode}
+\newcommand{\dateseparator}{/}
+% \end{macrocode}
+% Define |\ordinaldate|. This is needed because some
+% languages only use an ordinal for the first day of
+% the month (such as french). This isn't really needed
+% here, but the LaTeX2HTML style file needs this command.
+% \begin{macrocode}
+\newcommand{\ordinaldateenglish}[1]{\ordinalnum{#1}}
+\let\ordinaldatenohyphenation=\ordinaldateenglish
+
+\newcommand{\ordinaldatewelsh}[1]{%
+#1\ifnum#1=1\/\textsuperscript{a\~n}\fi}
+
+\newcommand{\ordinaldatebreton}[1]{%
+#1\ifnum#1=1\/\textsuperscript{a\~n}\fi}
+
+\newcommand{\ordinaldatefrench}[1]{%
+#1\ifnum#1=1\ier\fi}
+
+\newcommand{\ordinaldate}[1]{%
+\@ifundefined{languagename}{\ordinalnum{#1}}{%
+\@ifundefined{ordinaldate\languagename}{#1}{%
+\csname ordinaldate\languagename\endcsname{#1}}}}
+% \end{macrocode}
+% Now define the declarations that redefine |\formatdate| as they
+% are used by the package options.
+% \begin{macrocode}
+\newif\ifshowdow % show the day of week if true
+
+\providecommand{\formatdate}[3]{}
+
+\newcount\@day
+\newcount\@month
+\newcount\@year
+
+\DeclareRobustCommand*{\longdate}{%
+\renewcommand{\formatdate}[3]{\ifshowdow\dayofweekname{##1}{##2}{##3} \fi
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\ordinaldate{\the\@day}\ \monthname[\@month], \the\@year}}
+
+\DeclareRobustCommand*{\shortdate}{%
+\renewcommand{\formatdate}[3]{\ifshowdow\shortdayofweekname{##1}{##2}{##3} \fi
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\ordinaldate{\the\@day}\ \shortmonthname[\@month], \the\@year}}
+
+\providecommand*{\twodigit}[1]{{\@dtctr=#1\relax\ifnum\@dtctr<10 0\fi\the\@dtctr}}
+
+\DeclareRobustCommand*{\ddmmyyyydate}{%
+\renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\twodigit\@day\dateseparator \twodigit\@month\dateseparator \the\@year}}
+
+\DeclareRobustCommand*{\dmyyyydate}{%
+\renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\the\@day\dateseparator \the\@month\dateseparator \the\@year}}
+
+\DeclareRobustCommand*{\ddmmyydate}{\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\@dtctr=\@year%
+\@modulo{\@dtctr}{100}%
+\twodigit\@day\dateseparator \twodigit\@month\dateseparator \twodigit\@dtctr}}
+
+\DeclareRobustCommand*{\dmyydate}{\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\@dtctr=\@year%
+\@modulo{\@dtctr}{100}%
+\the\@day\dateseparator \the\@month\dateseparator \twodigit\@dtctr}}
+
+\DeclareRobustCommand*{\textdate}{%
+\renewcommand{\formatdate}[3]{\ifshowdow\dayofweekname{##1}{##2}{##3} the \fi
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\@Ordinalstring\@day\ of \monthname[\@month], \@Numberstring\@year}}
+
+\DeclareRobustCommand*{\usdate}{%
+\renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\monthname[\@month]\ \the\@day, \the\@year}}
+
+\DeclareRobustCommand*{\mmddyyyydate}{%
+\renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\twodigit\@month\dateseparator \twodigit\@day\dateseparator \the\@year}}
+
+\DeclareRobustCommand*{\mdyyyydate}{%
+\renewcommand{\formatdate}[3]{\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\the\@month\dateseparator \the\@day\dateseparator \the\@year}}
+
+\DeclareRobustCommand*{\mmddyydate}{\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\@dtctr=\@year%
+\@modulo{\@dtctr}{100}%
+\twodigit\@month\dateseparator \twodigit\@day\dateseparator \twodigit\@dtctr}}
+
+\DeclareRobustCommand*{\mdyydate}{\renewcommand{\formatdate}[3]{%
+\@day=##1\relax\@month=##2\relax\@year=##3\relax
+\@dtctr=\@year%
+\@modulo{\@dtctr}{100}%
+\the\@month\dateseparator \the\@day\dateseparator \twodigit\@dtctr}}
+% \end{macrocode}
+% (New to v.2.45) Define commands to save dates
+% and later format them.
+% \begin{macrocode}
+\newcommand{\newdate}[4]{%
+\@ifundefined{date@#1@y}{%
+\@namedef{date@#1@d}{#2}%
+\@namedef{date@#1@m}{#3}%
+\@namedef{date@#1@y}{#4}}{%
+\PackageError{datetime}{Date `#1' already defined}{}}}
+
+\newcommand{\getdateyear}[1]{%
+\@ifundefined{date@#1@y}{%
+\PackageError{datetime}{Date `#1' not defined}{}}{%
+\csname date@#1@y\endcsname}}
+
+\newcommand{\getdatemonth}[1]{%
+\@ifundefined{date@#1@m}{%
+\PackageError{datetime}{Date `#1' not defined}{}}{%
+\csname date@#1@m\endcsname}}
+
+\newcommand{\getdateday}[1]{%
+\@ifundefined{date@#1@d}{%
+\PackageError{datetime}{Date `#1' not defined}{}}{%
+\csname date@#1@d\endcsname}}
+
+\newcommand{\displaydate}[1]{%
+\@ifundefined{date@#1@y}{%
+\PackageError{datetime}{Date `#1' not defined}{}}{%
+\formatdate{\csname date@#1@d\endcsname}{%
+\csname date@#1@m\endcsname}{%
+\csname date@#1@y\endcsname}}}
+% \end{macrocode}
+% (New to v2.3) Define |\currenttime| which will print the
+% time according to the current format. Set it to 24hr time by default
+% \begin{macrocode}
+\DeclareRobustCommand*{\currenttime}{\xxivtime}
+
+\newcommand{\timeseparator}{:}
+
+\providecommand{\settimeformat}[1]{\DeclareRobustCommand*\currenttime{\csname#1\endcsname}}
+% \end{macrocode}
+% Set defaults:
+% \begin{macrocode}
+\longdate
+\showdowtrue
+% \end{macrocode}
+% Load in specifications from configuration file:
+% \begin{macrocode}
+\InputIfFileExists{datetime.cfg}{\typeout{Loading local datetime configurations}}{\typeout{No datetime.cfg file found}}
+% \end{macrocode}
+% Specify the package options, specify default options and process
+% \begin{macrocode}
+\RequirePackage{fmtcount}
+\DeclareOption{long}{\longdate}
+\DeclareOption{short}{\shortdate}
+\DeclareOption{ddmmyyyy}{\ddmmyyyydate}
+\DeclareOption{dmyyyy}{\dmyyyydate}
+\DeclareOption{ddmmyy}{\ddmmyydate}
+\DeclareOption{dmyy}{\dmyydate}
+\DeclareOption{text}{\textdate}
+\DeclareOption{us}{\usdate}
+\DeclareOption{mmddyyyy}{\mmddyyyydate}
+\DeclareOption{mdyyyy}{\mdyyyydate}
+\DeclareOption{mmddyy}{\mmddyydate}
+\DeclareOption{mdyy}{\mdyydate}
+\DeclareOption{level}{\fmtcountsetoptions{fmtord=level}}
+\DeclareOption{raise}{\fmtcountsetoptions{fmtord=raise}}
+\DeclareOption{dayofweek}{\showdowtrue}
+\DeclareOption{nodayofweek}{\showdowfalse}
+\DeclareOption{nodate}{\@dt@nodatetrue}
+\DeclareOption{24hr}{\settimeformat{xxivtime}}
+\DeclareOption{12hr}{\settimeformat{ampmtime}}
+\DeclareOption{oclock}{\settimeformat{oclock}}
+
+% babel stuff
+
+\DeclareOption{austrian}{\input{dt-austrian.def}}
+\DeclareOption{bahasa}{\input{dt-bahasa.def}}
+\DeclareOption{basque}{\input{dt-basque.def}}
+\DeclareOption{breton}{\input{dt-breton.def}}
+\DeclareOption{bulgarian}{\input{dt-bulgarian.def}}
+\DeclareOption{catalan}{\input{dt-catalan.def}}
+\DeclareOption{croatian}{\input{dt-croatian.def}}
+\DeclareOption{czech}{\input{dt-czech.def}}
+\DeclareOption{danish}{\input{dt-danish.def}}
+\DeclareOption{dutch}{\input{dt-dutch.def}}
+\DeclareOption{esperanto}{\input{dt-esperanto.def}}
+\DeclareOption{estonian}{\input{dt-estonian.def}}
+\DeclareOption{finnish}{\input{dt-finnish.def}}
+\DeclareOption{french}{\input{dt-french.def}}
+\DeclareOption{galician}{\input{dt-galician.def}}
+\DeclareOption{german}{\input{dt-german.def}}
+\DeclareOption{greek}{\input{dt-greek.def}}
+\DeclareOption{hebrew}{\input{dt-hebrew.def}}
+\DeclareOption{icelandic}{\input{dt-icelandic.def}}
+\DeclareOption{irish}{\input{dt-irish.def}}
+\DeclareOption{italian}{\input{dt-italian.def}}
+\DeclareOption{latin}{\input{dt-latin.def}}
+\DeclareOption{lsorbian}{\input{dt-lsorbian.def}}
+\DeclareOption{magyar}{\input{dt-magyar.def}}
+\DeclareOption{naustrian}{\input{dt-naustrian.def}}
+\DeclareOption{ngerman}{\input{dt-ngerman.def}}
+\DeclareOption{norsk}{\input{dt-norsk.def}}
+\DeclareOption{polish}{\input{dt-polish.def}}
+\DeclareOption{portuges}{\input{dt-portuges.def}}
+\DeclareOption{romanian}{\input{dt-romanian.def}}
+\DeclareOption{russian}{\input{dt-russian.def}}
+\DeclareOption{samin}{\input{dt-samin.def}}
+\DeclareOption{scottish}{\input{dt-scottish.def}}
+\DeclareOption{serbian}{\input{dt-serbian.def}}
+\DeclareOption{slovak}{\input{dt-slovak.def}}
+\DeclareOption{slovene}{\input{dt-slovene.def}}
+\DeclareOption{spanish}{\input{dt-spanish.def}}
+\DeclareOption{swedish}{\input{dt-swedish.def}}
+\DeclareOption{turkish}{\input{dt-turkish.def}}
+\DeclareOption{ukraineb}{\input{dt-ukraineb.def}}
+\DeclareOption{usorbian}{\input{dt-usorbian.def}}
+\DeclareOption{welsh}{\input{dt-welsh.def}}
+
+\ProcessOptions
+\RequirePackage{ifthen}
+% \end{macrocode}
+% \subsubsection{Date Macros}
+% Define the macro that prints the month name.
+% (Only define this command if @dt@nodate is false)
+% \begin{macrocode}
+\if@dt@nodate
+\typeout{datetime package message : option "nodate" used, so not defining \protect\monthname}
+\else
+\providecommand{\monthnameenglish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (January) to 12 (December)}%
+\or January%
+\or February%
+\or March%
+\or April%
+\or May%
+\or June%
+\or July%
+\or August%
+\or September%
+\or October%
+\or November%
+\or December%
+\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (January) to 12 (December)}%
+\fi}
+
+
+ %\let\monthname=\monthnameenglish
+\newcommand{\monthname}{\@ifundefined{languagename}{%
+\monthnameenglish}{\@ifundefined{monthname\languagename}{%
+\monthnameenglish}{\csname monthname\languagename\endcsname}}}
+\fi
+% \end{macrocode}
+% Define the macro that prints the abbreviated month name
+% (Again, only do this if @dt@nodate is false)
+% \begin{macrocode}
+\if@dt@nodate
+\typeout{datetime package message : option "nodate" used, so not defining \protect\shortmonthname}
+\else
+\providecommand{\shortmonthnameenglish}[1][\month]{%
+\@orgargctr=#1\relax
+\ifcase\@orgargctr
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (jan) to 12 (dec)}%
+\or Jan%
+\or Feb%
+\or Mar%
+\or Apr%
+\or May%
+\or Jun%
+\or Jul%
+\or Aug%
+\or Sept%
+\or Oct%
+\or Nov%
+\or Dec%
+\else%
+\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (jan) to 12 (dec)}%
+\fi}
+
+ %\let\shortmonthname=\shortmonthnameenglish
+
+\newcommand{\shortmonthname}{\@ifundefined{languagename}{%
+\shortmonthnameenglish}{\@ifundefined{shortmonthname\languagename}{%
+\shortmonthnameenglish}{\csname shortmonthname\languagename\endcsname}}}
+\fi
+% \end{macrocode}
+% Define macros needed to compute the weekday
+% (Again, only do this if @dt@nodate is false)
+% Need to define |\ifleapyear| regardless of @dt@nodate otherwise \LaTeX\ won't
+% match |\ifleapyear| with |\fi|
+% \begin{macrocode}
+\newif\ifleapyear
+
+\newcount\@dtctr
+
+\if@dt@nodate
+\typeout{datetime package message : option "nodate" used, so not defining \protect\dayofweek \space or \protect\shortdayofweek}
+\else
+% Using the algorithm documented at
+% http://userpages.wittenberg.edu/bshelburne/Comp150/DayofWeek.htm
+
+% \testifleapyear{<year>}
+\providecommand{\testifleapyear}[1]{%
+\leapyearfalse
+\@year=#1\relax
+\@dtctr=\@year
+\@modulo{\@dtctr}{400}%
+\ifnum\@dtctr=0\relax
+\leapyeartrue % year mod 400 = 0 => leap year
+\else
+\@dtctr=\@year
+\@modulo{\@dtctr}{100}%
+\ifnum\@dtctr=0\relax
+\leapyearfalse % year mod 100 = 0 && year mod 400 != 0 => not a leap year
+\else
+\@dtctr=\@year
+\@modulo{\@dtctr}{4}%
+\ifnum\@dtctr=0\relax
+\leapyeartrue % year mod 4 = 0 && year mod 100 != 0 => leap year
+\fi
+\fi
+\fi
+}
+
+\newcount\dayofyear
+
+% \computedayofyear{<day>}{<month>}{<year>}
+
+\providecommand{\computedayofyear}[3]{%
+\testifleapyear{#3}%
+\dayofyear=0\relax
+\@day=#1\relax \@month=#2\relax \@year=#3\relax
+\ifcase\@month
+\or
+\or \advance\dayofyear by 31\relax
+\or \advance\dayofyear by 59\relax
+\or \advance\dayofyear by 90\relax
+\or \advance\dayofyear by 120\relax
+\or \advance\dayofyear by 151\relax
+\or \advance\dayofyear by 181\relax
+\or \advance\dayofyear by 212\relax
+\or \advance\dayofyear by 243\relax
+\or \advance\dayofyear by 273\relax
+\or \advance\dayofyear by 304\relax
+\or \advance\dayofyear by 334\relax
+\else
+\PackageError{datetime}{Invalid month number}{The second argument to \protect\computedayofyear
+should lie in the range 1-12}
+\fi
+\ifnum\@month>2\relax
+\ifleapyear\advance\dayofyear by 1\relax\fi
+\fi
+\advance\dayofyear by \@day\relax
+}
+
+\newcount\dayofweek
+
+% \computedayofweek{<day>}{<month>}{<year>}
+
+\providecommand{\computedayofweek}[3]{%
+\computedayofyear{#1}{#2}{#3}%
+\@dtctr=#3\relax
+\advance\@dtctr by -1901\relax
+\@modulo{\@dtctr}{28}%
+\dayofweek=\@dtctr
+\divide\dayofweek by 4\relax
+\advance\dayofweek by \@dtctr
+\advance\dayofweek by 2\relax
+\@modulo{\dayofweek}{7}%
+\advance\dayofweek by \dayofyear
+\advance\dayofweek by -1\relax
+\@modulo{\dayofweek}{7}%
+\advance\dayofweek by 1\relax}
+
+\providecommand{\dayofweeknameidenglish}[1]{%
+\ifcase#1\relax
+\or Sunday%
+\or Monday%
+\or Tuesday%
+\or Wednesday%
+\or Thursday%
+\or Friday%
+\or Saturday%
+\fi}
+
+\providecommand{\dayofweeknameid}[1]{%
+\@ifundefined{languagename}{%
+\dayofweeknameidenglish{#1}}{%
+\@ifundefined{dayofweeknameid\languagename}{%
+\dayofweeknameidenglish{#1}}{%
+\csname dayofweeknameid\languagename\endcsname{#1}}}%
+}
+
+\providecommand{\dayofweekname}[3]{%
+\computedayofweek{#1}{#2}{#3}%
+\dayofweeknameid{\dayofweek}%
+}
+
+\providecommand{\thisdayofweekname}{%
+\dayofweekname{\day}{\month}{\year}}
+
+\providecommand{\shortdayofweeknameidenglish}[1]{%
+\ifcase#1\relax
+\or Sun%
+\or Mon%
+\or Tue%
+\or Wed%
+\or Thu%
+\or Fri%
+\or Sat%
+\fi}
+
+\providecommand{\shortdayofweekname}[3]{%
+\computedayofweek{#1}{#2}{#3}%
+\@ifundefined{languagename}{%
+\shortdayofweeknameidenglish{\dayofweek}}{%
+\@ifundefined{shortdayofweeknameid\languagename}{%
+\shortdayofweeknameidenglish{\dayofweek}}{%
+\csname shortdayofweeknameid\languagename\endcsname\dayofweek}}%
+}
+
+\fi
+
+\providecommand{\thisshortdayofweekname}{\dayofweekname{\day}{\month}{\year}}
+% \end{macrocode}
+% Redefine |\today| so that it uses |\formatdate|.
+% (Only do this if @dt@nodate is false)
+% \begin{macrocode}
+\if@dt@nodate
+\else
+\DeclareRobustCommand*{\today}{\formatdate{\day}{\month}{\year}}
+\fi
+% \end{macrocode}
+%Check to see if babel package has redefined |\today|.
+% \begin{macrocode}
+\if@dt@nodate
+\else
+\@ifundefined{dateenglish}{}{\let\dateenglish\longdate}
+\@ifundefined{dateaustrian}{}{\input{dt-austrian.def}}
+\@ifundefined{datebahasa}{}{\input{dt-bahasa.def}}
+\@ifundefined{datebasque}{}{\input{dt-basque.def}}
+\@ifundefined{datebreton}{}{\input{dt-breton.def}}
+\@ifundefined{datebulgarian}{}{\input{dt-bulgarian.def}}
+\@ifundefined{datecatalan}{}{\input{dt-catalan.def}}
+\@ifundefined{datecroatian}{}{\input{dt-croatian.def}}
+\@ifundefined{dateczech}{}{\input{dt-czech.def}}
+\@ifundefined{datedanish}{}{\input{dt-danish.def}}
+\@ifundefined{datedutch}{}{\input{dt-dutch.def}}
+\@ifundefined{dateesperanto}{}{\input{dt-esperanto.def}}
+\@ifundefined{dateestonian}{}{\input{dt-estonian.def}}
+\@ifundefined{datefinnish}{}{\input{dt-finnish.def}}
+\@ifundefined{datefrench}{}{\input{dt-french.def}}
+\@ifundefined{dategalician}{}{\input{dt-galician.def}}
+\@ifundefined{dategerman}{}{\input{dt-german.def}}
+\@ifundefined{dategreek}{}{\input{dt-greek.def}}
+\@ifundefined{datehebrew}{}{\input{dt-hebrew.def}}
+\@ifundefined{dateicelandic}{}{\input{dt-icelandic.def}}
+\@ifundefined{dateirish}{}{\input{dt-irish.def}}
+\@ifundefined{dateitalian}{}{\input{dt-italian.def}}
+\@ifundefined{datelatin}{}{\input{dt-latin.def}}
+\@ifundefined{datelsorbian}{}{\input{dt-lsorbian.def}}
+\@ifundefined{datemagyar}{}{\input{dt-magyar.def}}
+\@ifundefined{datenaustrian}{}{\input{dt-naustrian.def}}
+\@ifundefined{datengerman}{}{\input{dt-ngerman.def}}
+\@ifundefined{datenorsk}{}{\input{dt-norsk.def}}
+\@ifundefined{datepolish}{}{\input{dt-polish.def}}
+\@ifundefined{dateportuges}{}{\input{dt-portuges.def}}
+\@ifundefined{dateromanian}{}{\input{dt-romanian.def}}
+\@ifundefined{daterussian}{}{\input{dt-russian.def}}
+\@ifundefined{datesamin}{}{\input{dt-samin.def}}
+\@ifundefined{datescottish}{}{\input{dt-scottish.def}}
+\@ifundefined{dateserbian}{}{\input{dt-serbian.def}}
+\@ifundefined{dateslovak}{}{\input{dt-slovak.def}}
+\@ifundefined{dateslovene}{}{\input{dt-slovene.def}}
+\@ifundefined{datespanish}{}{\input{dt-spanish.def}}
+\@ifundefined{dateswedish}{}{\input{dt-swedish.def}}
+\@ifundefined{dateturkish}{}{\input{dt-turkish.def}}
+\@ifundefined{dateukraineb}{}{\input{dt-ukraineb.def}}
+\@ifundefined{dateusorbian}{}{\input{dt-usorbian.def}}
+\@ifundefined{datewelsh}{}{\input{dt-welsh.def}}
+\fi
+% \end{macrocode}
+% Define |\newdateformat| which defines a declaration that redefines |\formatdate| so that
+% it uses |\dateformat|. |\dateformat| takes four arguments, the first defines the format
+% the last three arguments are the three arguments that effectively get passed to |\formatdate|.
+% |\dateformat| sets |\@day|, |\@month| and |\@year|. |\c@DAY|, |\c@MONTH| and |\c@YEAR|
+% are set as synonims for |\@day|, |\@month| and |\@year|, to that the uses can use the counters
+% |DAY|, |MONTH| and |YEAR| as part of the format.
+% \begin{macrocode}
+\if@dt@nodate
+\typeout{datetime package message : option "nodate" used, so not defining \protect\newdateformat}
+\else
+
+\providecommand\THEDAY{\the\@day}
+\providecommand\THEMONTH{\the\@month}
+\providecommand\THEYEAR{\the\@year}
+\let\c@DAY=\@day
+\let\c@MONTH=\@month
+\let\c@YEAR=\@year
+
+\providecommand{\dateformat}[4]{\@day=#2\relax\@month=#3\relax\@year=#4\relax#1}
+
+\providecommand{\newdateformat}[2]{%
+\@ifundefined{#1}{\expandafter\DeclareRobustCommand\csname#1\endcsname{\renewcommand{\formatdate}{\dateformat{#2}}}}{%
+\PackageError{datetime}{Can't create new date format, command \textbackslash#1 already defined}{You will need to
+give you new date format a different name}}}
+\fi
+
+% \end{macrocode}
+% \subsubsection{Time Macros}
+% Define a command to create a new time format, similar to the new date format.
+% \begin{macrocode}
+\newcount\c@HOUR
+\newcount\c@HOURXII
+\newcount\c@MINUTE
+\newcount\c@TOHOUR
+\newcount\c@TOMINUTE
+\def\THEHOUR{\the\c@HOUR}
+\def\THEHOURXII{\the\c@HOURXII}
+\def\THEMINUTE{\the\c@MINUTE}
+\def\THETOHOUR{\the\c@TOHOUR}
+\def\THETOMINUTE{\the\c@TOMINUTE}
+
+\providecommand{\newtimeformat}[2]{%
+\@ifundefined{#1}{%
+\expandafter\def\csname#1\endcsname{%
+\c@HOUR=\time%
+\divide\c@HOUR by 60\relax
+\c@HOURXII=\c@HOUR
+\ifnum\c@HOURXII>12
+\advance\c@HOURXII by -12\relax
+\fi
+\c@MINUTE=\time%
+\@modulo{\c@MINUTE}{60}%
+\c@TOHOUR=\c@HOURXII
+\advance\c@TOHOUR by 1\relax
+\@modulo{\c@TOHOUR}{12}%
+\c@TOMINUTE=\c@MINUTE
+\advance\c@TOMINUTE by -60\relax
+\multiply\c@TOMINUTE by -1\relax
+#2\relax
+}}{%
+\PackageError{datetime}{Command \textbackslash#1 already defined}{%
+You can't create a new time format called "#1" as the command \textbackslash#1 already exists}}}
+% \end{macrocode}
+% Define commands to print the current time.
+% \begin{macrocode}
+\newtimeformat{xxivtime}{\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE}
+
+\newtimeformat{ampmtime}{\THEHOURXII\timeseparator\twodigit\THEMINUTE\ifthenelse{\value{HOUR}<12}{\amname}{\ifthenelse{\time=720}{ \noon}{\pmname}}}
+
+\newtimeformat{oclock}{\ifthenelse{\time=0 \or \time=720}{%
+% Midnight or Midday
+\ifthenelse{\time=0}{\midnight}{\noon}}{%
+% Neither Midnight nor Midday
+% Do minutes first
+\ifthenelse{\value{MINUTE}=0}{%
+% Don't print any minutes, just do the hour and \oclockstring
+\Numberstring{HOUR} \oclockstring}{%
+\ifthenelse{\value{MINUTE}=15}{%
+\quarterpast\ \Numberstring{HOUR}}{%
+\ifthenelse{\value{MINUTE}=30}{%
+\halfpast\ \Numberstring{HOUR}}{%
+\ifthenelse{\value{MINUTE}=45}{%
+\quarterto\ \Numberstring{TOHOUR}}{%
+\ifthenelse{\value{MINUTE}<30}{%
+\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} past \Numberstring{HOURXII}}{%
+\Numberstring{TOMINUTE}\ \ifthenelse{\value{TOMINUTE}=1}{minute}{minutes} to \Numberstring{TOHOUR}}}}}}\
+% Now say whether it is morning or afternoon
+\ifthenelse{\value{HOUR}<12}{%
+% Morning
+\amstring}{%
+% Afternoon
+\pmstring}}}
+
+\providecommand{\amname}{am}
+\providecommand{\pmname}{pm}
+\providecommand{\amorpmname}{\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}}
+\providecommand{\amstring}{in the morning}
+\providecommand{\pmstring}{in the afternoon}
+\providecommand{\amorpmstring}{\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}}
+\providecommand{\halfpast}{Half past}
+\providecommand{\quarterpast}{Quarter past}
+\providecommand{\quarterto}{Quarter to}
+\providecommand{\noon}{Noon}
+\providecommand{\midnight}{Midnight}
+\providecommand{\oclockstring}{O'Clock}
+
+% \end{macrocode}
+% Finally create command that will typeset the date in PDF format
+% e.g. 20040501215500
+% \begin{macrocode}
+\newcount\pdftimectr
+\newcount\pdfdatectr
+
+\pdftimectr=0\relax
+\@dtctr=\time%
+\divide\@dtctr by 60\relax
+\multiply\@dtctr by 10000\relax
+\pdftimectr=\@dtctr
+%
+\@dtctr=\time%
+\@modulo{\@dtctr}{60}%
+\multiply\@dtctr by 100\relax
+\advance\pdftimectr by \@dtctr
+%
+\pdfdatectr=\day
+\@dtctr=\month
+\multiply\@dtctr by 100\relax
+\advance\pdfdatectr by \@dtctr
+\@dtctr=\year
+\multiply\@dtctr by 10000\relax
+\advance\pdfdatectr by \@dtctr
+%
+\ifnum\pdftimectr<100000
+\edef\pdfdate{\the\pdfdatectr0\the\pdftimectr}
+\else
+\edef\pdfdate{\the\pdfdatectr\the\pdftimectr}
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+%</datetime.sty>
+% \end{macrocode}
+% \begin{macrocode}
+%<*datetime.perl>
+% \end{macrocode}
+% \begin{macrocode}
+# File : datetime.perl
+# Author : Nicola Talbot
+# Date : 3 Mar 2005
+# Version : 1.01
+# Description : LaTeX2HTML implementation of datetime package.
+
+# set up default values for internal counters.
+
+($global{SECONDS},$global{MINUTE},$global{HOUR},$global{DAY},$global{MONTH},$global{YEAR})=localtime(time);
+$global{YEAR} += 1900;
+$global{MONTH}++;
+
+$global{HOURXII} = ($global{HOUR} == 12 ? 12 : ($global{HOUR})%12);
+$global{TOHOUR} = ($global{HOUR} == 11 ? 12 :($global{HOUR}+1)%12);
+$global{TOMINUTE} = ($global{MINUTE} == 0? 0 : 60 - $global{MINUTE});
+
+package main;
+
+&do_require_package('fmtcount');
+
+sub do_cmd_ordinaldate{
+ &do_cmd_ordinalnum(@_);
+}
+
+# define package options
+
+sub do_datetime_long{
+ &do_cmd_longdate(@_);
+}
+
+sub do_datetime_short{
+ &do_cmd_shortdate(@_);
+}
+
+sub do_datetime_text{
+ &do_cmd_textdate(@_);
+}
+
+sub do_datetime_ddmmyyyy{
+ &do_cmd_ddmmyyyydate(@_);
+}
+
+sub do_datetime_dmyyyy{
+ &do_cmd_dmyyyydate(@_);
+}
+
+sub do_datetime_ddmmyy{
+ &do_cmd_ddmmyydate(@_);
+}
+
+sub do_datetime_dmyy{
+ &do_cmd_dmyyyydate(@_);
+}
+
+sub do_datetime_us{
+ &do_cmd_usdate(@_);
+}
+
+sub do_datetime_mmddyyyy{
+ &do_cmd_mmddyyyydate(@_);
+}
+
+sub do_datetime_mdyyyy{
+ &do_cmd_mdyyyydate(@_);
+}
+
+sub do_datetime_mmddyy{
+ &do_cmd_mmddyydate(@_);
+}
+
+sub do_datetime_mdyy{
+ &do_cmd_mdyyyydate(@_);
+}
+
+sub do_datetime_raise{
+ local($tmp)="";
+
+ $tmp .= 'sub do_cmd_fmtord{';
+ $tmp .= 'local($_) = @_;';
+ $tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));';
+ $tmp .= 'join("", "<SUP>",$num,"</SUP>",$_);';
+ $tmp .='}';
+
+ eval($tmp);
+}
+
+sub do_datetime_level{
+ local($tmp)="";
+
+ $tmp .= 'sub do_cmd_fmtord{';
+ $tmp .= 'local($_) = @_;';
+ $tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));';
+ $tmp .= 'join("", $num,$_);';
+ $tmp .='}';
+
+ eval($tmp);
+}
+
+sub do_datetime_dayofweek{
+ &do_cmd_showdowtrue(@_);
+}
+
+sub do_datetime_nodayofweek{
+ &do_cmd_showdowfalse(@_);
+}
+
+sub do_datetime_24hr{
+ $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\xxivtime", $_[0]); }';
+
+ eval($tmp);
+
+ join('', $_[0]);
+}
+
+sub do_datetime_12hr{
+ $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\ampmtime", $_[0]); }';
+
+ eval($tmp);
+
+ join('', $_[0]);
+}
+
+sub do_datetime_oclock{
+ $tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\oclock", $_[0]); }';
+
+ eval($tmp);
+
+ join('', $_[0]);
+}
+
+# babel stuff (Month will already be redefined by babel, so only need to change $dateformat)
+
+sub do_datetime_austrian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateaustrian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateaustrian(@_);
+}
+
+if (defined &austrian_today)
+{
+ &do_datetime_austrian(@_);
+}
+
+sub do_datetime_bahasa{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datebahasa{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datebahasa(@_);
+}
+
+if (defined &bahasa_today)
+{
+ &do_datetime_bahasa(@_);
+}
+
+sub do_datetime_basque{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datebasque{';
+ $tmp .= ' $dateformat = "THEYEAR.eko MONTHNAME[THEMONTH] THEDAY";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datebasque(@_);
+}
+
+if (defined &basque_today)
+{
+ &do_datetime_basque(@_);
+}
+
+sub do_datetime_breton{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datebreton{';
+ $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_ordinaldate{';
+ $tmp .= 'local($_) = @_;';
+ $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));';
+ $tmp .= 'local($before) = $num;';
+
+ $tmp .= 'if ($num == 1)';
+ $tmp .= '{ $before .= \'a\~n\'; }';
+
+ $tmp .= '$before . $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datebreton(@_);
+}
+
+if (defined &breton_today)
+{
+ &do_datetime_breton(@_);
+}
+
+sub do_datetime_bulgarian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datebulgarian{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\cyrg.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datebulgarian(@_);
+}
+
+if (defined &bulgarian_today)
+{
+ &do_datetime_bulgarian(@_);
+}
+
+sub do_datetime_catalan{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datecatalan{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] de THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datecatalan(@_);
+}
+
+if (defined &catalan_today)
+{
+ &do_datetime_catalan(@_);
+}
+
+sub do_datetime_croatian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datecroatian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datecroatian(@_);
+}
+
+if (defined &croatian_today)
+{
+ &do_datetime_croatian(@_);
+}
+
+sub do_datetime_czech{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateczech{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateczech(@_);
+}
+
+if (defined &czech_today)
+{
+ &do_datetime_czech(@_);
+}
+
+sub do_datetime_danish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datedanish{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datedanish(@_);
+}
+
+if (defined &danish_today)
+{
+ &do_datetime_danish(@_);
+}
+
+sub do_datetime_dutch{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datedutch{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datedutch(@_);
+}
+
+if (defined &dutch_today)
+{
+ &do_datetime_dutch(@_);
+}
+
+sub do_datetime_esperanto{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateesperanto{';
+ $tmp .= ' $dateformat = "THEDAY--a de MONTHNAME[THEMONTH], THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateesperanto(@_);
+}
+
+if (defined &esperanto_today)
+{
+ &do_datetime_esperanto(@_);
+}
+
+sub do_datetime_estonian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateestonian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR. a.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateestonian(@_);
+}
+
+if (defined &estonian_today)
+{
+ &do_datetime_estonian(@_);
+}
+
+sub do_datetime_finnish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datefinnish{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datefinnish(@_);
+}
+
+if (defined &finnish_today)
+{
+ &do_datetime_finnish(@_);
+}
+
+sub do_datetime_french{
+ local($tmp) = "";
+
+ eval($tmp);
+ $tmp .= 'sub do_cmd_datefrench{';
+ $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_ordinaldate{';
+ $tmp .= 'local($_) = @_;';
+ $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));';
+ $tmp .= 'local($before) = $num;';
+
+ $tmp .= 'if ($num == 1)';
+ $tmp .= '{ $before .= \'\ier\'; }';
+
+ $tmp .= '$before . $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datefrench(@_);
+}
+
+if (defined &french_today)
+{
+ &do_datetime_french(@_);
+}
+
+sub do_datetime_galician{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dategalician{';
+ $tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dategalician(@_);
+}
+
+if (defined &galician_today)
+{
+ &do_datetime_galician(@_);
+}
+
+sub do_datetime_german{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dategerman{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dategerman(@_);
+}
+
+if (defined &german_today)
+{
+ &do_datetime_german(@_);
+}
+
+sub do_datetime_greek{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dategreek{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dategreek(@_);
+}
+
+if (defined &greek_today)
+{
+ &do_datetime_greek(@_);
+}
+
+sub do_datetime_icelandic{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateicelandic{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateicelandic(@_);
+}
+
+if (defined &icelandic_today)
+{
+ &do_datetime_icelandic(@_);
+}
+
+sub do_datetime_irish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateirish{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateirish(@_);
+}
+
+if (defined &irish_today)
+{
+ &do_datetime_irish(@_);
+}
+
+sub do_datetime_italian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateitalian{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateitalian(@_);
+}
+
+if (defined &italian_today)
+{
+ &do_datetime_italian(@_);
+}
+
+sub do_datetime_latin{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datelatin{';
+ $tmp .= ' $dateformat = "ROMANNUMERALU{THEDAY} MONTHNAME[THEMONTH] ROMANNUMERALU{THEYEAR}";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datelatin(@_);
+}
+
+if (defined &latin_today)
+{
+ &do_datetime_latin(@_);
+}
+
+sub do_datetime_lsorbian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datelsorbian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datelsorbian(@_);
+}
+
+if (defined &lsorbian_today)
+{
+ &do_datetime_lsorbian(@_);
+}
+
+sub do_datetime_magyar{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datemagyar{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datemagyar(@_);
+}
+
+if (defined &magyar_today)
+{
+ &do_datetime_magyar(@_);
+}
+
+sub do_datetime_naustrian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datenaustrian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datenaustrian(@_);
+}
+
+if (defined &naustrian_today)
+{
+ &do_datetime_naustrian(@_);
+}
+
+sub do_datetime_ngerman{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datengerman{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datengerman(@_);
+}
+
+if (defined &ngerman_today)
+{
+ &do_datetime_ngerman(@_);
+}
+
+sub do_datetime_norsk{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datenorsk{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datenorsk(@_);
+}
+
+if (defined &norsk_today)
+{
+ &do_datetime_norsk(@_);
+}
+
+sub do_datetime_polish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datenorsk{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datenorsk(@_);
+}
+
+if (defined &polish_today)
+{
+ &do_datetime_polish(@_);
+}
+
+sub do_datetime_portuges{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateportuges{';
+ $tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateportuges(@_);
+}
+
+if (defined &portuges_today)
+{
+ &do_datetime_portuges(@_);
+}
+
+sub do_datetime_romanian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateromanian{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateromanian(@_);
+}
+
+if (defined &romanian_today)
+{
+ &do_datetime_romanian(@_);
+}
+
+sub do_datetime_russian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_daterussian{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\\\cyrg.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_daterussian(@_);
+}
+
+if (defined &russian_today)
+{
+ &do_datetime_russian(@_);
+}
+
+sub do_datetime_samin{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datesamin{';
+ $tmp .= ' $dateformat = "MONTHNAME[THEMONTH] THEDAY.~b. THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datesamin(@_);
+}
+
+if (defined &samin_today)
+{
+ &do_datetime_samin(@_);
+}
+
+sub do_datetime_scottish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datescottish{';
+ $tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datescottish(@_);
+}
+
+if (defined &scottish_today)
+{
+ &do_datetime_scottish(@_);
+}
+
+sub do_datetime_serbian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateserbian{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateserbian(@_);
+}
+
+if (defined &serbian_today)
+{
+ &do_datetime_serbian(@_);
+}
+
+sub do_datetime_slovak{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateslovak{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateslovak(@_);
+}
+
+if (defined &slovak_today)
+{
+ &do_datetime_slovak(@_);
+}
+
+sub do_datetime_slovene{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateslovene{';
+ $tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateslovene(@_);
+}
+
+if (defined &slovene_today)
+{
+ &do_datetime_slovene(@_);
+}
+
+sub do_datetime_spanish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datespanish{';
+ $tmp .= ' $dateformat = "THEDAY~de MONTHNAME[THEMONTH] de~THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datespanish(@_);
+}
+
+if (defined &spanish_today)
+{
+ &do_datetime_spanish(@_);
+}
+
+sub do_datetime_swedish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateswedish{';
+ $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = "";
+ $tmp .= 'sub do_cmd_datesymd{';
+ $tmp .= ' $dateformat = "THEYEAR-TWODIGIT{THEMONTH}-TWODIGIT{THEDAY}";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = "";
+ $tmp .= 'sub do_cmd_datesdmy{';
+ $tmp .= ' $dateformat = "THEDAY/THEMONTH THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateswedish(@_);
+}
+
+if (defined &swedish_today)
+{
+ &do_datetime_swedish(@_);
+}
+
+sub do_datetime_turkish{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateturkish{';
+ $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateturkish(@_);
+}
+
+if (defined &turkish_today)
+{
+ &do_datetime_turkish(@_);
+}
+
+sub do_datetime_ukraineb{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateukraineb{';
+ $tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR~\\\\cyrr.";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateukraineb(@_);
+}
+
+if (defined &ukraineb_today)
+{
+ &do_datetime_ukraineb(@_);
+}
+
+sub do_datetime_usorbian{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_dateusorbian{';
+ $tmp .= ' $dateformat = "THEDAY.~MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_dateusorbian(@_);
+}
+
+if (defined &usorbian_today)
+{
+ &do_datetime_usorbian(@_);
+}
+
+sub do_datetime_welsh{
+ local($tmp) = "";
+
+ $tmp .= 'sub do_cmd_datewelsh{';
+ $tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";';
+ $tmp .= ' $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_ordinaldate{';
+ $tmp .= 'local($_) = @_;';
+ $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));';
+ $tmp .= 'local($before) = $num;';
+
+ $tmp .= 'if ($num == 1)';
+ $tmp .= '{ $before .= \'a\~n\'; }';
+
+ $tmp .= '$before . $_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ &do_cmd_datewelsh(@_);
+}
+
+if (defined &welsh_today)
+{
+ &do_datetime_welsh(@_);
+}
+
+# As far as I know, LaTeX2HTML doesn't implement TeX conditionals.
+# $showdow corresponds to LaTeX boolean variable showdow
+$showdow = 1;
+
+sub get_monthname{
+ local($month) = @_;
+
+ if ($month eq 'THEMONTH' or $month eq '\THEMONTH')
+ {
+ # this is a cludge to help newdateformat work
+
+ 'MONTHNAME[THEMONTH]';
+ }
+ else
+ {
+ if ($month eq '')
+ {
+ local($today) = &get_date();
+ $today =~ m|(\d+)/0?(\d+)/|;
+ $month = $1;
+ }
+
+ $Month[$month];
+ }
+}
+
+sub do_cmd_monthname{
+ local($_) = @_;
+ local($month,$pat) = &get_next_optional_argument;
+
+ local($monthname) = &get_monthname($month);
+ join('',$monthname,$_);
+}
+
+sub get_shortmonthname{
+ local($month) = @_;
+
+ if ($month eq 'THEMONTH' or $month eq '\THEMONTH')
+ {
+ 'SHORTMONTHNAME[THEMONTH]';
+ }
+ else
+ {
+ substr(&get_monthname($month), 0, 3);
+ }
+}
+
+sub do_cmd_shortmonthname{
+ local($_) = @_;
+ local($month,$pat) = &get_next_optional_argument;
+
+ local($monthname) = &get_shortmonthname($month);
+
+ join('',$monthname,$_);
+}
+
+sub is_leap_year{
+ local($year) = @_;
+ local($isleapyear) = 0;
+
+ if (($year%400) == 0)
+ {
+ # year mod 400 = 0 => leap year
+
+ $isleapyear = 1;
+ }
+ elsif (($year%100) == 0)
+ {
+ # year mod 100 = 0 and year mod 400 != 0 => not a leap year
+
+ $isleapyear = 0;
+ }
+ elsif (($year%4) == 0)
+ {
+ # year mod 4 = 0 and year mod 100 != 0 => leap year
+
+ $isleapyear = 1;
+ }
+
+ $isleapyear;
+}
+
+sub get_day_of_year{
+ local($day,$month,$year) = @_;
+ local($dayofyear) = 0;
+
+ SWITCH: {
+ if ($month == 2) {$dayofyear += 31; last SWITCH; }
+ if ($month == 3) {$dayofyear += 59; last SWITCH; }
+ if ($month == 4) {$dayofyear += 90; last SWITCH; }
+ if ($month == 5) {$dayofyear += 120; last SWITCH; }
+ if ($month == 6) {$dayofyear += 151; last SWITCH; }
+ if ($month == 7) {$dayofyear += 181; last SWITCH; }
+ if ($month == 8) {$dayofyear += 212; last SWITCH; }
+ if ($month == 9) {$dayofyear += 243; last SWITCH; }
+ if ($month == 10) {$dayofyear += 273; last SWITCH; }
+ if ($month == 11) {$dayofyear += 304; last SWITCH; }
+ if ($month == 12) {$dayofyear += 334; last SWITCH; }
+ }
+
+ if ($month > 2 && &is_leap_year($year))
+ {
+ $dayofyear += 1;
+ }
+
+ $dayofyear += $day;
+ local($_)=$dayofyear;
+}
+
+sub get_day_of_week{
+ local($day,$month,$year) = @_;
+ local($dayofyear) = &get_day_of_year($day,$month,$year);
+ local($_) = (((($year-1901)%28)*1.25 + 2)%7 + $dayofyear - 1)%7 + 1;
+}
+
+sub get_day_of_weekname_english{
+ local($dow) = @_;
+
+ local(@DayOfWeek) = ('Sunday',
+ 'Monday',
+ 'Tuesday',
+ 'Wednesday',
+ 'Thursday',
+ 'Friday',
+ 'Saturday');
+
+ if ($dow <= 0 || $dow > 7)
+ {
+ &write_warnings("Invalid day of week number: $dow");
+ }
+ else
+ {
+ $DayOfWeek[$dow-1];
+ }
+}
+
+sub get_day_of_weekname_french{
+ local($dow) = @_;
+
+ local(@DayOfWeek) = ('dimanche',
+ 'lundi',
+ 'mardi',
+ 'mercredi',
+ 'jeudi',
+ 'vendredi',
+ 'samedi');
+
+ if ($dow <= 0 || $dow > 7)
+ {
+ &write_warnings("Invalid day of week number: $dow");
+ }
+ else
+ {
+ $DayOfWeek[$dow-1];
+ }
+}
+
+sub get_day_of_weekname_spanish{
+ local($dow) = @_;
+
+ local(@DayOfWeek) = ('domingo',
+ 'lunes',
+ 'martes',
+ 'mi\\\'ercoles',
+ 'jueves',
+ 'viernes',
+ 's\\\'abado');
+
+ if ($dow <= 0 || $dow > 7)
+ {
+ &write_warnings("Invalid day of week number: $dow");
+ }
+ else
+ {
+ $DayOfWeek[$dow-1];
+ }
+}
+
+sub get_day_of_weekname_portuges{
+ local($dow) = @_;
+
+ local(@DayOfWeek) = ('domingo',
+ 'segunda-feira',
+ 'ter\c{c}a-feira',
+ 'quarta-feira',
+ 'quinta-feira',
+ 'sexta-feira',
+ 'sabado');
+
+ if ($dow <= 0 || $dow > 7)
+ {
+ &write_warnings("Invalid day of week number: $dow");
+ }
+ else
+ {
+ $DayOfWeek[$dow-1];
+ }
+}
+
+sub get_day_of_weekname{
+ local($dow)=@_;
+ local($dowsub);
+
+ $dowsub = "get_day_of_weekname_$default_language";
+
+ if (defined ($dowsub))
+ {
+ &$dowsub($dow);
+ }
+ else
+ {
+ &get_day_of_weekname_english($dow);
+ }
+}
+
+sub get_short_day_of_weekname{
+ local($dow)=@_;
+
+ substr(&get_day_of_weekname($dow),0,3);
+}
+
+sub do_cmd_dayofweeknameid{
+ local($_) = @_;
+ local($dow);
+
+ $dow = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($dow=$2));
+
+ join('',&get_day_of_weekname($dow), $_);
+}
+
+sub do_cmd_dayofweekname{
+ local($_) = @_;
+ local($day,$month,$year);
+ # read 1st argument
+ $day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2));
+ # read 2nd argument
+ $month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2));
+ # read 3rd argument
+ $year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2));
+
+ if ($day eq 'THEDAY' or $day eq '\THEDAY')
+ {
+ # this is a cludge to help newdateformat work
+
+ join('', '{DOW}', $_);
+ }
+ else
+ {
+ local($dow) = &get_day_of_week($day,$month,$year);
+
+ join('',&get_day_of_weekname($dow), $_);
+ }
+}
+
+sub do_cmd_shortdayofweekname{
+ local($_) = @_;
+ local($day,$month,$year);
+ # read 1st argument
+ $day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2));
+ # read 2nd argument
+ $month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2));
+ # read 3rd argument
+ $year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2));
+
+ local($dow) = &get_day_of_week($day,$month,$year);
+
+ join('',&get_short_day_of_weekname($dow), $_);
+}
+
+sub do_cmd_thisdayofweekname{
+ local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR});
+
+ join('',$DayOfWeek[$dow], $_);
+}
+
+sub do_cmd_thisshortdayofweekname{
+ local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR});
+
+ join('',&get_short_day_of_weekname($dow), $_);
+}
+
+$dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR";
+
+sub format_date{
+ local($day,$month,$year) = @_;
+
+ local($str) = $dateformat;
+
+ $str =~ s/THEDAY/$day/g;
+ $str =~ s/THEMONTH/$month/g;
+ $str =~ s/THEYEAR/$year/g;
+
+ $str =~ s/TWODIGIT{([\d]+)}/&get_twodigit($1)/eg;
+ $str =~ s/ROMANNUMERAL{([\d]+)}/&froman($1)/eg;
+ $str =~ s/ROMANNUMERALU{([\d]+)}/uc(&froman($1))/eg;
+ $str =~ s/TRUNCATE{([\d]+)}/&get_twodigit($1%100)/eg;
+ $str =~ s/SHORTMONTHNAME\[([\d]+)\]/&get_shortmonthname($1)/eg;
+ $str =~ s/MONTHNAME\[([\d]+)\]/&get_monthname($1)/eg;
+
+ local($X) = ++$global{'max_id'};
+ local($Y) = ++$global{'max_id'};
+ local($Z) = ++$global{'max_id'};
+ $str =~ s/{DOW}/\\dayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g;
+ $str =~ s/{SDOW}/\\shortdayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g;
+
+ local($br_id) = ++$global{'max_id'};
+ $suffix = &get_ordinal_suffix($day);
+ $str =~ s/{ORDINAL{DAY}}/$day\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g;
+
+ $br_id = ++$global{'max_id'};
+ $suffix = &get_ordinal_suffix($month);
+ $str =~ s/{ORDINAL{MONTH}}/$month\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g;
+
+ $br_id = ++$global{'max_id'};
+ $suffix = &get_ordinal_suffix($year);
+ $str =~ s/{ORDINAL{YEAR}}/$year\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g;
+
+ local($br_id) = ++$global{'max_id'};
+ $str =~ s/{ORDINALDATE{DAY}}/\\ordinaldate${OP}$br_id${CP}$day${OP}$br_id${CP}/g;
+
+ $str =~ s/{NUMBERSTRING{DAY}}/&get_numberstring($day)/eg;
+ $str =~ s/{NUMBERSTRING{MONTH}}/&get_numberstring($month)/eg;
+ $str =~ s/{NUMBERSTRING{YEAR}}/&get_numberstring($year)/eg;
+
+ $str =~ s/{ORDINALSTRING{DAY}}/&get_ordinalstring($day)/eg;
+ $str =~ s/{ORDINALSTRING{MONTH}}/&get_ordinalstring($month)/eg;
+ $str =~ s/{ORDINALSTRING{YEAR}}/&get_ordinalstring($year)/eg;
+
+ $str =~ s/{NNUMBERSTRING{DAY}}/&get_Numberstring($day)/eg;
+ $str =~ s/{NNUMBERSTRING{MONTH}}/&get_Numberstring($month)/eg;
+ $str =~ s/{NNUMBERSTRING{YEAR}}/&get_Numberstring($year)/eg;
+
+ $str =~ s/{OORDINALSTRING{DAY}}/&get_Ordinalstring($day)/eg;
+ $str =~ s/{OORDINALSTRING{MONTH}}/&get_Ordinalstring($month)/eg;
+ $str =~ s/{OORDINALSTRING{YEAR}}/&get_Ordinalstring($year)/eg;
+
+ $str;
+}
+
+sub do_cmd_formatdate{
+ local($day,$month,$year);
+ # read 1st argument
+ $day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2));
+ # read 2nd argument
+ $month = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($month=$2));
+ # read 3rd argument
+ $year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year=$2));
+
+ join('', &format_date($day,$month,$year), $_[0]);
+}
+
+sub do_cmd_today{
+ join('', &format_date($global{DAY},$global{MONTH},$global{YEAR}), $_[0]);
+}
+
+sub do_cmd_day{
+ join('', $global{DAY}, $_[0]);
+}
+
+sub do_cmd_month{
+ join('', $global{MONTH}, $_[0]);
+}
+
+sub do_cmd_year{
+ join('', $global{YEAR}, $_[0]);
+}
+
+sub do_cmd_showdowtrue{
+ local($_) = @_;
+ $showdow = 1;
+ $_[0];
+}
+
+sub do_cmd_showdowfalse{
+ local($_) = @_;
+ $showdow = 0;
+ $_[0];
+}
+
+# This is a bit primative, it doesn't allow for
+# nested conditionals
+
+sub do_cmd_ifshowdow{
+ local($_) = @_;
+ local($ifbit,$elsebit);
+
+ $_[0] =~s/(.*)\\fi//;
+
+ $ifbit = $1;
+
+ $ifbit =~s/(.*)\\else(.*)/\1/g;
+
+ $elsebit = $2;
+
+ if ($showdow)
+ {
+ join('', $ifbit, $_[0]);
+ }
+ else
+ {
+ join('', $elsebit, $_[0]);
+ }
+}
+
+sub do_cmd_dateseparator{
+ join('', '/', $_[0]);
+}
+
+sub do_cmd_longdate{
+ $dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_shortdate{
+ $dateformat = "\\ifshowdow{SDOW}\\fi {ORDINALDATE{DAY}}\\ SHORTMONTHNAME[THEMONTH], THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_ddmmyyyydate{
+ $dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_dmyyyydate{
+ $dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_dmyydate{
+ $dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator TRUNCATE{THEYEAR}";
+
+ $_[0];
+}
+
+sub do_cmd_ddmmyydate{
+ $dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator TRUNCATE{THEYEAR}";
+
+ $_[0];
+}
+
+sub do_cmd_textdate{
+ $dateformat = "\\ifshowdow{DOW} the\\fi {OORDINALSTRING{DAY}} of MONTHNAME[THEMONTH], {NNUMBERSTRING{YEAR}}";
+
+ $_[0];
+}
+
+sub do_cmd_usdate{
+ $dateformat = "MONTHNAME[THEMONTH] THEDAY, THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_mmddyyyydate{
+ $dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_mdyyyydate{
+ $dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator THEYEAR";
+
+ $_[0];
+}
+
+sub do_cmd_mmddyydate{
+ $dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator TRUNCATE{THEYEAR}";
+
+ $_[0];
+}
+
+sub do_cmd_mdyydate{
+ $dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator TRUNCATE{THEYEAR}";
+
+ $_[0];
+}
+
+sub do_cmd_THEYEAR{
+ join('', 'THEYEAR', $_[0]);
+}
+
+sub do_cmd_THEMONTH{
+ join('', 'THEMONTH', $_[0]);
+}
+
+sub do_cmd_THEDAY{
+ join('', 'THEDAY', $_[0]);
+}
+
+sub do_cmd_newdateformat{
+ local($_) = @_;
+ local($cmd,$cmdbody);
+ local($ntmp);
+
+ $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2));
+ $cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2));
+
+ $ntmp = 'sub do_cmd_' . $cmd . '{';
+ $ntmp .= '$dateformat = "' . $cmdbody . '";';
+
+ $ntmp .= '$_[0];';
+ $ntmp .= '}';
+
+ eval($ntmp);
+
+ join('', $_[0]);
+}
+
+sub do_cmd_pdfdate{
+ local($_) = @_;
+
+ local($timestring) = sprintf "%d%02d%02d%02d%02d%02d",
+ $global{YEAR}, $global{MONTH}, $global{DAY}, $global{HOUR}, $global{MINUTE}, $global{SECONDS};
+
+ join('', $timestring, $_[0]);
+}
+
+ %userdates = ();
+
+sub do_cmd_newdate{
+ local($_)=@_;
+ local($datename,$mon,$day,$year);
+
+ $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2));
+
+ $day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2));
+
+ $mon = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($mon =$2));
+
+ $year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year =$2));
+
+
+ $userdates{$datename}{day} = $day;
+ $userdates{$datename}{month} = $mon;
+ $userdates{$datename}{year} = $year;
+
+ join('', $_[0]);
+}
+
+sub do_cmd_displaydate{
+ local($_)=@_;
+ local($datename);
+ local($cmd,$br_id);
+
+ $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2));
+
+ $br_id = ++$global{'max_id'};
+ $cmd = "$OP$br_id$CP" . $userdates{$datename}{day} ."$OP$br_id$CP";
+ $br_id = ++$global{'max_id'};
+ $cmd .= "$OP$br_id$CP" . $userdates{$datename}{month} ."$OP$br_id$CP";
+ $br_id = ++$global{'max_id'};
+ $cmd .= "$OP$br_id$CP" . $userdates{$datename}{year} ."$OP$br_id$CP";
+
+ join('', '\formatdate', $cmd, $_[0]);
+}
+
+sub do_cmd_getdateyear{
+ local($_)=@_;
+ local($datename);
+
+ $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2));
+
+ join('', $userdates{$datename}{year}, $_[0]);
+}
+
+sub do_cmd_getdatemonth{
+ local($_)=@_;
+ local($datename);
+
+ $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2));
+
+ join('', $userdates{$datename}{month}, $_[0]);
+}
+
+sub do_cmd_getdateday{
+ local($_)=@_;
+ local($datename);
+
+ $datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2));
+
+ join('', $userdates{$datename}{day}, $_[0]);
+}
+
+# time commands
+
+sub do_cmd_timeseparator{
+ join('', ':', $_[0]);
+}
+
+sub do_cmd_xxivtime{
+ local($_) = @_;
+
+ local($timestring) = sprintf "%02d\\timeseparator %02d", $global{HOUR}, $global{MINUTE};
+
+ join('', $timestring, $_[0]);
+}
+
+sub do_cmd_noon{
+ local($_) = @_;
+
+ join('', "Noon", $_[0]);
+}
+
+sub do_cmd_midnight{
+ local($_) = @_;
+
+ join('', "Midnight", $_[0]);
+}
+
+sub do_cmd_amname{
+ local($_) = @_;
+
+ join('', "am", $_[0]);
+}
+
+sub do_cmd_pmname{
+ local($_) = @_;
+
+ join('', "pm", $_[0]);
+}
+
+sub do_cmd_amstring{
+ local($_) = @_;
+
+ join('', "in the morning", $_[0]);
+}
+
+sub do_cmd_pmstring{
+ local($_) = @_;
+
+ join('', "in the afternoon", $_[0]);
+}
+
+sub do_cmd_halfpast{
+ local($_) = @_;
+
+ join('', "Half past", $_[0]);
+}
+
+sub do_cmd_quarterpast{
+ local($_) = @_;
+
+ join('', "Quarter past", $_[0]);
+}
+
+sub do_cmd_quarterto{
+ local($_) = @_;
+
+ join('', "Quarter to", $_[0]);
+}
+
+sub do_cmd_oclockstring{
+ local($_) = @_;
+
+ join('', "O'Clock", $_[0]);
+}
+
+sub do_cmd_amorpmname{
+ if ($global{HOUR}>12)
+ {
+ &do_cmd_pmname;
+ }
+ else
+ {
+ &do_cmd_amname;
+ }
+}
+
+sub do_cmd_amorpmstring{
+ if ($global{HOUR}>12)
+ {
+ &do_cmd_pmstring;
+ }
+ else
+ {
+ &do_cmd_amstring;
+ }
+}
+
+sub do_cmd_ampmtime{
+ local($_) = @_;
+ local($timestring);
+
+ $timestring = sprintf "%d\\timeseparator %02d\\amorpmname", $global{HOUR}, $global{MINUTE};
+
+ join('', $timestring, $_[0]);
+}
+
+sub do_cmd_oclock{
+ local($_) = @_;
+ local($timestring);
+
+ if ($global{HOUR} == 0 && $global{MINUTE} == 0)
+ {
+ $timestring = "\\midnight";
+ }
+ elsif ($global{HOUR} == 12 && $global{MINUTE} == 0)
+ {
+ $timestring = "\\noon";
+ }
+ else
+ {
+ if ($global{MINUTE} == 0)
+ {
+ $timestring = &get_Numberstring($global{HOURXII}) . " \\oclockstring";
+ }
+ elsif ($global{MINUTE} == 15)
+ {
+ $timestring = "\\quarterpast\\ " . &get_Numberstring($global{HOURXII});
+ }
+ elsif ($global{MINUTE} == 30)
+ {
+ $timestring = "\\halfpast\\ " . &get_Numberstring($global{HOURXII});
+ }
+ elsif ($global{MINUTE} == 45)
+ {
+ $timestring = "\\quarterto\\ " . &get_Numberstring($global{TOHOUR});
+ }
+ elsif ($global{MINUTE} < 30)
+ {
+ $timestring = get_Numberstring($global{MINUTE});
+
+ $timestring .= ($global{MINUTE} == 1 ? " minute" : " minutes") . " past ";
+
+ $timestring .= get_Numberstring($global{HOURXII});
+ }
+ else
+ {
+ $timestring = get_Numberstring($global{TOMINUTE});
+
+ $timestring .= ($global{MINUTE} == 1 ? " minute" : " minutes") . " to ";
+
+ $timestring .= get_Numberstring($global{TOHOUR});
+ }
+
+ $timestring .= ($global{HOUR} < 12 ? " \\amstring" : " \\pmstring");
+ }
+
+ join('', $timestring, $_[0]);
+}
+
+sub do_cmd_currenttime{
+ local($_) = @_;
+
+ join('', "\\xxivtime", $_[0]);
+}
+
+sub do_cmd_settimeformat{
+ local($_) = @_;
+ local($cmd);
+
+ $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2));
+
+ #$tmp = 'sub do_cmd_currenttime{local($_) = @_; join(\'\', "\\\\' . $cmd . '", $_[0]); }';
+
+ $tmp = 'sub do_cmd_currenttime{&do_cmd_' . $cmd . '(@_);}';
+
+ eval($tmp);
+
+ join('', $_[0]);
+}
+
+sub do_cmd_newtimeformat{
+ local($_) = @_;
+ local($cmd,$cmdbody);
+
+ $cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2));
+ $cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2));
+
+ $tmp = 'sub do_cmd_' . $cmd . '{' . "\n";
+
+ $tmp .= 'local($_) = @_;'. "\n";
+
+ $tmp .= 'join(\'\',"' . $cmdbody. '", $_[0]); }';
+
+ eval($tmp);
+
+ join('', $_[0]);
+}
+
+sub do_cmd_THEHOUR{
+ local($_) = @_;
+
+ join('', $global{HOUR}, $_[0]);
+}
+
+sub do_cmd_THEMINUTE{
+ local($_) = @_;
+
+ join('', $global{MINUTE}, $_[0]);
+}
+
+sub do_cmd_THETOHOUR{
+ local($_) = @_;
+
+ join('', $global{TOHOUR}, $_[0]);
+}
+
+sub do_cmd_THETOMINUTE{
+ local($_) = @_;
+
+ join('', $global{TOMINUTE}, $_[0]);
+}
+
+sub do_cmd_THEHOURXII{
+ local($_) = @_;
+
+ join('', $global{HOURXII}, $_[0]);
+}
+
+1;
+% \end{macrocode}
+% \begin{macrocode}
+%</datetime.perl>
+% \end{macrocode}
+% \begin{macrocode}
+%<*dt-sampl.tex>
+% \end{macrocode}
+\documentclass[a4paper]{article}
+
+\usepackage{ifpdf}
+\usepackage{datetime}
+
+\ifpdf
+\pdfinfo{
+ /CreationDate (D:20040501215500)
+ /ModDate (D:\pdfdate)
+}
+\fi
+
+\padzeroes[8]
+
+\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
+\newdateformat{usvardate}{\monthname[\THEMONTH]~\ordinaldate{\THEDAY}, \THEYEAR}
+\newdateformat{mydate}{\ifshowdow \dayofweekname{\THEDAY}{\THEMONTH}{\THEYEAR} \fi
+\THEDAY\ \monthname[\THEMONTH], \THEYEAR}
+\newdateformat{yyyymmdd}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}}
+
+\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
+\newtimeformat{dashtime12}{\THEHOURXII-\twodigit{\THEMINUTE}}
+\newtimeformat{hhmm}{\twodigit{\THEHOUR}\twodigit{\THEMINUTE}}
+
+\begin{document}
+
+\section{Date Formats}
+Default: \today.
+
+\begin{tabular}{ll}
+\bfseries Declaration & \bfseries\verb|\today|\\
+\verb|\longdate| & \longdate\today\\
+\verb|\shortdate| & \shortdate\today\\
+\verb|\ddmmyyyydate| & \ddmmyyyydate\today\\
+\verb|\dmyyyydate| & \dmyyyydate\today\\
+\verb|\ddmmyydate| & \ddmmyydate\today\\
+\verb|\dmyydate| & \dmyydate\today\\
+\verb|\textdate| & \textdate\today\\
+\verb|\usdate| & \usdate\today\\
+\verb|\mmddyyyydate| & \mmddyyyydate\today\\
+\verb|\mdyyyydate| & \mdyyyydate\today\\
+\verb|\mmddyydate| & \mmddyydate\today\\
+\verb|\mdyydate| & \mdyydate\today
+\end{tabular}
+
+\section{Time Formats}
+Default: \currenttime.
+
+\begin{tabular}{@{\ttfamily}ll}
+\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\
+xxivtime & \settimeformat{xxivtime}\currenttime\\
+ampmtime & \settimeformat{ampmtime}\currenttime\\
+oclock & \settimeformat{oclock}\currenttime
+\end{tabular}
+
+\section{Specific Date:}
+
+\begin{tabular}{ll}
+\verb|\longdate| & \longdate\formatdate{1}{3}{2000}\\
+\verb|\shortdate| & \shortdate\formatdate{8}{3}{2000}\\
+\verb|\ddmmyyyydate| & \ddmmyyyydate\formatdate{8}{3}{2000}\\
+\verb|\dmyyyydate| & \dmyyyydate\formatdate{8}{3}{2000}\\
+\verb|\ddmmyydate| & \ddmmyydate\formatdate{8}{3}{2000}\\
+\verb|\dmyydate| & \dmyydate\formatdate{8}{3}{2000}\\
+\verb|\textdate| & \textdate\formatdate{8}{3}{2000}\\
+\verb|\usdate| & \usdate\formatdate{8}{3}{2000}\\
+\verb|\mmddyyyydate| & \mmddyyyydate\formatdate{8}{3}{2000}\\
+\verb|\mdyyyydate| & \mdyyyydate\formatdate{8}{3}{2000}\\
+\verb|\mmddyydate| & \mmddyydate\formatdate{8}{3}{2000}\\
+\verb|\mdyydate| & \mdyydate\formatdate{8}{3}{2000}
+\end{tabular}
+
+\section{Defining New Dates}
+
+\begin{tabular}{ll}
+\verb|\dashdate| & \dashdate\today\\
+\verb|\usvardate| & \usvardate\today\\
+\verb|\mydate| & \mydate\today\\
+\verb|\yyyymmdd| & \yyyymmdd\today\\
+\verb|\dashdate| & \dashdate\formatdate{8}{3}{2000}\\
+\verb|\usvardate| & \usvardate\formatdate{8}{3}{2000}\\
+\verb|\mydate| & \mydate\formatdate{8}{3}{2000}\\
+\verb|\yyyymmdd| & \yyyymmdd\formatdate{8}{3}{2000}
+\end{tabular}
+
+\section{Defining New Times}
+
+\begin{tabular}{@{\ttfamily}ll}
+\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\
+dottime & \settimeformat{dottime}\currenttime\\
+dashtime12 & \settimeformat{dashtime12}\currenttime\\
+hhmm & \settimeformat{hhmm}\currenttime
+\end{tabular}
+
+\end{document}
+% \begin{macrocode}
+%</dt-sampl.tex>
+% \end{macrocode}
+%\Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/datetime/datetime.ins b/Master/texmf-dist/source/latex/datetime/datetime.ins
new file mode 100644
index 00000000000..66c9ae19297
--- /dev/null
+++ b/Master/texmf-dist/source/latex/datetime/datetime.ins
@@ -0,0 +1,106 @@
+% datetime.ins generated using makedtx version 0.9b 2005/10/1 15:23
+\input docstrip
+
+\preamble
+Copyright (C) 2005 Nicola Talbot, all rights reserved.
+If you modify this file, you must change its name first.
+You are NOT ALLOWED to distribute this file alone. You are NOT
+ALLOWED to take money for the distribution or use of either this
+file or a changed version, except for a nominal charge for copying
+etc.
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{\file{dt-breton.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-breton.def,package}}
+\file{dt-danish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-danish.def,package}}
+\file{dt-sampl.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-sampl.tex,package}}
+\file{dt-welsh.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-welsh.def,package}}
+\file{dt-scottish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-scottish.def,package}}
+\file{dt-latin.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-latin.def,package}}
+\file{dt-portuges.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-portuges.def,package}}
+\file{dt-estonian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-estonian.def,package}}
+\file{dt-usorbian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-usorbian.def,package}}
+\file{dt-spanish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-spanish.def,package}}
+\file{dt-slovene.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovene.def,package}}
+\file{dt-dutch.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-dutch.def,package}}
+\file{dt-bulgarian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-bulgarian.def,package}}
+\file{dt-ngerman.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ngerman.def,package}}
+\file{dt-italian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-italian.def,package}}
+\file{dt-french.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-french.def,package}}
+\file{dt-hebrew.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-hebrew.def,package}}
+\file{dt-czech.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-czech.def,package}}
+\file{dt-romanian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-romanian.def,package}}
+\file{dt-esperanto.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-esperanto.def,package}}
+\file{dt-polish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-polish.def,package}}
+\file{dt-finnish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-finnish.def,package}}
+\file{dt-galician.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-galician.def,package}}
+\file{dt-magyar.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-magyar.def,package}}
+\file{dt-slovak.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-slovak.def,package}}
+\file{dt-lsorbian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-lsorbian.def,package}}
+\file{dt-greek.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-greek.def,package}}
+\file{dt-croatian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-croatian.def,package}}
+\file{dt-basque.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-basque.def,package}}
+\file{dt-serbian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-serbian.def,package}}
+\file{dt-ukraineb.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-ukraineb.def,package}}
+\file{datetime.sty}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{datetime.sty,package}}
+\file{dt-bahasa.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-bahasa.def,package}}
+\file{dt-russian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-russian.def,package}}
+\file{dt-icelandic.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-icelandic.def,package}}
+\file{dt-swedish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-swedish.def,package}}
+\file{dt-austrian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-austrian.def,package}}
+\file{dt-catalan.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-catalan.def,package}}
+\file{dt-irish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-irish.def,package}}
+\file{dt-norsk.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-norsk.def,package}}
+\file{dt-german.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-german.def,package}}
+\file{datetime.perl}{\nopreamble\nopostamble\from{datetime.dtx}{datetime.perl}}
+\file{dt-turkish.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-turkish.def,package}}
+\file{dt-naustrian.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-naustrian.def,package}}
+\file{dt-samin.def}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{datetime.dtx}{dt-samin.def,package}}
+}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/deleq/00readme.dlq b/Master/texmf-dist/source/latex/deleq/00readme.dlq
new file mode 100644
index 00000000000..c83b345e151
--- /dev/null
+++ b/Master/texmf-dist/source/latex/deleq/00readme.dlq
@@ -0,0 +1,29 @@
+
+
+This is the file `00readme.dlq', which accompanies the `deleq'
+package distribution. The package defines environments and commands
+to enable partial equation numbers (3a, 3b, ...) and repeated use of
+equation numbers. To use the package, run LaTeX on
+`deleq.ins', this produces the files `deleq.sty', which contains
+the macro definitions, and the file `delex.tex', which is an example
+of the use of the package. To obtain the userguide and documentation,
+run LaTeX on `deleq.dtx'. To obtain the example, run LaTeX on `delex.tex'.
+
+The 'deleq' package consists of two files:
+ deleq.ins - the installation driver
+ deleq.dtx - the macro code, instructions on how to use
+ the package, and an example in `docstrip'-able format.
+Anyone is free to re-distribute these files provided the restrictions
+mentioned in 'deleq.ins' are obeyed. These are mainly that the
+two files always must be distributed together and that noone is
+allowed to distribute the files for profit.
+
+Inquiries can be sent to: <matsd@homenet.se>.
+
+
+
+
+____________________________________________________________________
+Copyright (c) 1994-97 by Mats Dahlgren.
+
+
diff --git a/Master/texmf-dist/source/latex/deleq/deleq.dtx b/Master/texmf-dist/source/latex/deleq/deleq.dtx
new file mode 100644
index 00000000000..0fd241cd874
--- /dev/null
+++ b/Master/texmf-dist/source/latex/deleq/deleq.dtx
@@ -0,0 +1,937 @@
+%
+% \iffalse
+%
+% The first part is a comment to the reader(s) of `deleq.dtx'.
+%
+% deleq.dtx Version 4.41, July 7, 1997
+% (c) 1994-97 by Mats Dahlgren (matsd@homenet.se)
+%
+% Please see the information in file `deleq.ins' on how you
+% may use and (re-)distribute this file. Run LaTeX on the file
+% `deleq.ins' to get a .sty-file, instructions, and an example.
+%
+% This file may NOT be distributed if not accompanied by 'deleq.ins'.
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\textwidth=150mm
+\textheight=210mm
+\topmargin=0mm
+\oddsidemargin=5mm
+\evensidemargin=5mm
+%\begin{document}
+ \DocInput{deleq.dtx}
+% \PrintChanges
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{645}
+%
+% \def\filename{deleq.dtx}
+% \def\fileversion{4.41}
+% \def\filedate{1997/07/07}\def\docdate{\filedate}
+% \MakeShortVerb{\|}
+% \date{\docdate}
+% \title{\textsf{deleq} -- a \LaTeX{} Macro for Partial
+% Numbering of Equations\thanks{This document describes
+% \textsf{deleq} version \fileversion , last revised \docdate}}
+% \author{Mats Dahlgren\\ (\texttt{matsd@homenet.se})}
+% \begin{document}
+% \maketitle
+% \begin{abstract}
+% To enable a more flexible equation numbering, especially
+% ``partial'' equation numbers (`3a', `3b' \textit{etc.}),
+% the \textsf{deleq} package has been developed. It can produce
+% partial equation numbers intermixed with ordinary
+% equation numbers also in an |eqnarray|-like environment,
+% the intermixing can occur within one environment.
+% References to a partially numbered equation can be both the
+% complete equation number (`3b') or only the main equation
+% number (`3').
+% Furthermore, equation numbers can be recycled without
+% disturbing the ordinary equation numbers. The
+% package also provides commands for putting commentatory
+% text in an |eqnarray| environment.
+% Both standard \LaTeX{} class options
+% |leqno| and |fleqn|\footnote{Not all commands of
+% \textsf{deleq} work with the \texttt{fleqn} option.}
+% work with \textsf{deleq}.\\
+% \small This file and the package:\
+% Copyright \copyright\ 1994-1997 by Mats Dahlgren.
+% All rights reserved.
+% \end{abstract}
+%
+% \section{Introduction}
+% \textsf{deleq} is a \LaTeX{} package which makes partial
+% numbering of equations possible. It is meant to be used
+% when numbering such as 3a, 3b, \textit{etc.} is desired.
+% The default is to give an equation number like `3a'
+% without period and with the `a' typeset in roman font.
+% It can be used in |article| as well as |book| and
+% |report| document classes. The examples given below are
+% valid for the |article| class. \textsf{deleq} is fully
+% compatible with the |leqno| documentclass option and
+% almost fully with the |fleqn| class option.
+% Equations can be numbered either 3, 3a, 3b, $\ldots$, or
+% 2, 3a, 3b, $\ldots$. Also, equation numbers within
+% |eqnarray|-like environments can be numbered 3, 3a, 3b,
+% $\ldots$ or starting at 3a, which can follow both after
+% equation 2b or 3. An |eqnarray|-like environment can have
+% its first equation numbered 3b if the nearest previous
+% equation is 3a. Within one |eqnarray|-like environment,
+% equations can be numbered 3a, 3b, 4, 4a, 4b, 5a, 5b,
+% \textit{etc.}, and also not numbered lines are possible
+% (`|\nonumber|' works with some limitations).
+% Furthermore, equation numbers can
+% be ``recycled''. If equation 3 is repeated after
+% equation 8, it can still have the numbering set to 3,
+% and be followed by (a new) equation 9. ``Recycled''
+% equation numbers can receive partial numbers (3a, 3b,
+% $\ldots$); partially numbered equations can also be
+% ``recycled'' (but at this stage, the latter can not
+% receive new partial numbers neatly, it will come out
+% like `3ba' if eqution 3b is the ``recycled'' equation).
+% Two commands are supplied which enable the user to write
+% commentary texts in |eqnarray|-like environments without
+% interfering with the alignment.
+%
+% \subsection{History}
+% |deleq.sty| was originally written for \LaTeX{} 2.09,
+% and contained several commands which became obsolete
+% with the introduction of \LaTeXe. These commands have
+% been removed. The first release for \LaTeXe{} was v.4.0,
+% of Oct.~14, 1994. The December 1994 release
+% (v.4.1, Dec.~27, 1994) was the first which was compatible with the
+% |docstrip| utility of Johannes Braams, Denys Duchier and
+% Frank Mittelbach. In release v.4.2 new
+% abilities to reference entire |deqarr| and |ddeqar|
+% environments and enhanced abilities for recycled
+% equation numbers were introduced.
+% Also in \textsf{deleq} v.4.2 this
+% documentation was revised and some internal commands
+% compacted.
+% A previous release, v.4.3, was made nessecary
+% because the changed handeling of arguments in connection
+% with the options in \LaTeXe{} of 1995/06/01.
+% In release v.4.4, compatibility with the \LaTeX{}
+% class option |fleqn| was
+% introduced.\footnote{\texttt{fleqn} incompatibility was
+% pointed out by Peter Kruijt (\texttt{peterk@wfw.wtb.tue.nl})}
+% In v.4.41 only some changes to the documentation have been introduced.
+%
+% \textsf{deleq} version 4.41 has been tested with \LaTeXe{}
+% of 1997/06/01 running \TeX{} 3.14159 in MiK\TeX{} 1.07
+% under Windows~95. Please send bug reports (see below),
+% corrections, additions, suggestions, \textit{etc.}\ to
+% me at \texttt{matsd@homenet.se}.
+% Version 3.02 is the last
+% (non-supported) version for \LaTeX{} 2.09. (Command names
+% are a mixture of \LaTeX , Swedish and a bit of the
+% author's fantasy$\ldots$)
+%
+% \subsection{Known Problems}
+% \begin{itemize}
+% \item \DescribeMacro{\eqreqno} \DescribeMacro{\deqreqno}
+% \DescribeMacro{\ddeqreqno} \DescribeEnv{deqarr}
+% \DescribeEnv{ddeqar} \DescribeMacro{\jotbaseline}
+% When using |\eqreqno|, |\deqreqno|, and |\ddeqreqno|
+% on the last line in a |deqarr|, |ddeqar|, |eqnarray|, or
+% |eqnarray*|, there will be an extra blank line with an
+% equation number (not in the |*| form) at the end of the
+% environment. To avoid this problem, use\\
+% | \eqreqno[-\jotbaseline]{FOO} \nonumber|\\
+% instead of
+% |\eqreqno{FOO}| (the analogues for |\deqreqno| and
+% |\ddeqreqno| are obvious).
+% \end{itemize}
+%
+% \section{Userguide}
+% \subsection{Requirements}
+% The file |deleq.sty| must be available in the user's
+% |TEXINPUTS| directories.
+% It requires \LaTeXe{} of 1996/12/01 (or newer).
+%
+% \subsection{Usage}
+% The package is included by stating\\
+% | \usepackage{deleq}| \\
+% In the document preamble.
+% The documentclass option |leqno| is fully supported,
+% and the option |fleqn| is recognized by the environments
+% defined in \textsf{deleq}.
+% Other class or package options do not have any effect on
+% \textsf{deleq}.
+%
+% \subsection{Environments}
+% The package defines the following five environments:
+% \begin{description}
+% \item{\texttt{deqn}} \DescribeEnv{deqn}
+% is an equation environment for automatic
+% numbering of the first equation of type `3a';
+% \item{\texttt{ddeqn}} \DescribeEnv{ddeqn}
+% is an equation used for automatic numbering
+% of the equations following the one in |deqn|, see also details
+% below;
+% \item{\texttt{deqarr}} \DescribeEnv{deqarr}
+% is an environment for automatic partial equation
+% numbering in |eqnarray|-like environment with
+% |deqn| functionality for the first equation;
+% \item{\texttt{ddeqar}} \DescribeEnv{ddeqar}
+% similar to |deqarr| environment, but
+% with |ddeqn| behaviour for the first equation, see details below;
+% \item{\texttt{deqrarr}} \DescribeEnv{deqrarr}
+% this is an `|eqnarray|'-like environment
+% specially designed for recycled equation numbers.
+% \end{description}
+%
+% \subsection{Commands}
+% The package defines the following fourteen user commands:\\
+% \hspace*{5mm}|\nydeqno|\\
+% \hspace*{5mm}|\heqno|\\
+% \hspace*{5mm}|\reqno{FOO}|\\
+% \hspace*{5mm}|\rndeqno{FOO}|\\
+% \hspace*{5mm}|\rdeqno{FOO}|\\
+% \hspace*{5mm}|\eqreqno[|\textit{len}|]{FOO}|\\
+% \hspace*{5mm}|\deqreqno[|\textit{len}|]{FOO}|\\
+% \hspace*{5mm}|\ddeqreqno[|\textit{len}|]{FOO}|\\
+% \hspace*{5mm}|\arrlabel{FOO}|\\
+% \hspace*{5mm}|\where|\\
+% \hspace*{5mm}|\rem{|\textit{text}|}|\\
+% \hspace*{5mm}|\nydeleqno|\\
+% \hspace*{5mm}|\deleqno|\\
+% \hspace*{5mm}|\jotbaseline|\\
+%
+% \subsection{Notice}
+% \begin{enumerate}
+% \item
+% \DescribeMacro{\nydeqno} \DescribeMacro{\heqno}
+% \DescribeMacro{\arrlabel} \DescribeEnv{deqarr}
+% \DescribeEnv{ddeqarr}
+% The use of |\arrlabel| may give unexpected results if
+% any of the commands |\nydeqno| or |\heqno| is used in the
+% same |deqarr| or |ddeqar| environment.
+% \item If you use |\nydeqno|,
+% |\heqno|, |\reqno|, |\rndeqno|, |\rdeqno|,
+% |\deqreqno|, |\ddeqreqno|, |\nydeleqno|, or |\deleqno| in
+% combination with |\label{FOO}|, |\label{FOO}| should
+% appear after the \textsf{deleq}-command;
+% \item If you change the appearance of equation numbers
+% (\textit{e.g.}\ use
+% `[2]' instead of `(2)'), \textsf{deleq}'s commands may not typeset
+% equations with partial numbers like your ordinary
+% equations.
+% \item The class option |fleqn| is not recognized by the
+% commands |\reqno|, |\rndeqno|, |\rdeqno|, |\nydeleqno|, and
+% |\deleqno|.
+% \end{enumerate}
+%
+% \section{Syntax}
+% Here follows a more detailed description of the
+% different environments and commands.
+% \begin{description}
+% \item{|\begin{deqn} ... \end{deqn}|} \DescribeEnv{deqn} \\
+% Typesets an equation just like
+% |\begin{equation} ... \end{equation}| does, but gives it
+% a number such as `3a' instead of `3' (always `a'). It
+% steps the main equation counter.
+%
+% \item{|\begin{ddeqn} ... \end{ddeqn}|} \DescribeEnv{ddeqn} \\
+% Typesets an equation just like
+% |\begin{equation} ... \end{equation}| does, but gives it
+% a number such as `3b', `3c', $\ldots$ instead of `3',
+% `4', $\ldots$ when following after another partially
+% numbered equation. When following after an ordinarily
+% numbered equation (`3') it gives a partial equation
+% number with the last used ordinary equation number,
+% \textit{e.g.}\ `3a'. Can be made to produce the result
+% of |deqn| environment by the use of |\nydeqno| (see
+% below). |ddeqn| does not step the main equation counter.
+%
+% \item{|\begin{deqarr} ... \end{deqarr}|} \DescribeEnv{deqarr} \\
+% Typesets an equation array just like
+% |\begin{eqnarray} ... \end{eqnarray}| does, but gives
+% the first numbered equation a number like `3a' instead
+% of `3' (always `a'), and the following `3b', `3c'
+% \textit{etc.} It steps the main equation counter.
+% The |\nonumber| command works just like
+% in the |eqnarray| environment on the partial equation
+% counter. Thus, if you use |\nonumber| on all lines in an
+% |deqarr| environment (or on all lines before or between
+% |\heqno| or |\nydeleqno|) the equation numbering in your
+% document will be incorrect. There is no warning issued by
+% \LaTeX{} if this happends. If you want blank lines and
+% then a |\heqno|'ed equation followed by partially numbered
+% equations, use the |ddeqar| environment instead. The same
+% is true for |\nydeqno|'ed equations.
+%
+% \item{|\begin{ddeqar} ... \end{ddeqar}|} \DescribeEnv{ddeqar} \\
+% Typesets an equation array just like
+% |\begin{eqnarray} ... \end{eqnarray}| does, but gives
+% the equation numbers such as `3a' if following after an
+% equation numbered `3' (ordinary equation number) and
+% numbers such as `3c' if following after a partially
+% numbered equation `3b'. Can be made to produce the
+% result of |deqarr| environment by the use of |\nydeqno|.
+% |ddeqar| does not step the main equation counter.
+% The |\nonumber| command works like in the
+% |deqarr| environment.
+%
+% \item{|\begin{deqrarr} ... \end{deqrarr}|} \DescribeEnv{deqrarr} \\
+% This environment is meant to host recycled equations and has
+% |eqnarray| structure. By default, it issues no equation
+% number at all on a line which ends with |\\|. The use of
+% |\label{FOO}| within |deqrarr| returns the present partial
+% equation number of recycled equations (just like with
+% |\rndeqno| and |\rdeqno|). Note that neither |\heqno|
+% nor |\nydeleqno| gives any equation numbers at all in the
+% |deqrarr| environment.
+%
+% \item{|\nydeqno|} \DescribeMacro{\nydeqno} \\
+% Used within |deqarr| and |ddeqar| environments to
+% step the main equation number by one and reset the
+% partial equation number to `a'; thus, |\nydeqno| gives
+% equation number `4a' when following after equation `3c'.
+%
+% \item{|\heqno|} \DescribeMacro{\heqno} \\
+% Used within |deqarr| and |ddeqar|
+% environments to step the main equation number by one and
+% to produce an ordinary equation number; thus, gives
+% equation number `4' when following equation `3c'.
+% Equations following the |\heqno|-ed will be partially
+% numbered with the |\heqno|-ed equation's number as the
+% main number, \textit{e.g.}\ `4a' (unless it has a |\nydeqno|
+% command, which in this case would produce the equation
+% number `5a').
+%
+% \item{|\reqno{FOO}|} \DescribeMacro{\reqno} \\
+% Is used when repeating an equation with its original
+% number, ``recycling'' the eqaution number.
+% |\reqno| takes the argument |FOO|, which has to be defined
+% by a |\label{FOO}| in the original equation. It can
+% only be used within |$$ ... $$|. It does not affect the
+% equation number counter, nor the ordinary partial equation number
+% counter. However, it resets the partial equation number
+% counter for the |\rndeqno|, |\rdeqno|, |\deqreqno|, and
+% |\ddeqreqno| commands. If used with a |\label{FOOO}|
+% command, the |.aux|-file will only contain the page number
+% of label |FOOO|. This command is not compatible with the
+% class option |fleqn|. Instead of |$$ ... \reqno{FOO} $$|,
+% use a one-line |deqrarr| environment with the commands
+% |\eqreqno[-\jotbaseline]{FOO} \nonumber| at the end.
+%
+% \item{|\rndeqno{FOO}|} \DescribeMacro{\rndeqno} \\
+% Adds a partial equation number to an old equation number,
+% specified by the |FOO| label. If |FOO| refers to equation
+% `4', |\rdeqno{FOO}| will result in equation number `4a'
+% (always `a'). It can only be used within
+% |$$ ... $$|. It does not affect the equation number counter,
+% nor the ordinary partial equation number counter. However, it
+% resets the partial equation number counter for the
+% |\rndeqno|, |\rdeqno|, |\deqreqno|, and |\ddeqreqno| commands.
+% The argument of |\rndeqno| follows the same rules as that of
+% |\reqno|. When used with the |\label{FOOO}| command, a
+% reference to |FOOO| will only return the partial equation
+% number (and the page number). To make a complete reference
+% to an equation which has a |\rndeqno| command, say
+% |\ref{FOO}\ref{FOOO}|. This command is not compatible with the
+% class option |fleqn|. Instead of |$$ ... \rndeqno{FOO} $$|,
+% use a one-line |deqrarr| environment with the commands
+% |\deqreqno[-\jotbaseline]{FOO} \nonumber| at the end.
+%
+% \item{|\rdeqno{FOO}|} \DescribeMacro{\rdeqno} \\
+% Same as |\rndeqno{FOO}| but without resetting any
+% equation number counter and giving consecutive partial
+% equation numbers (`4b', `4c', \textit{etc.}).
+% \textbf{Note: } There is nothing preventing the
+% repeated use of |\rndeqno{FOO}| and |\rdeqno{FOO}| for
+% the same label |FOO|. This will result in numbering such
+% as `3a' (if |FOO| refers to equation `3') occuring several
+% times. This command is not compatible with the
+% class option |fleqn|. Instead of |$$ ... \rdeqno{FOO} $$|,
+% use a one-line |deqrarr| environment with the commands
+% |\ddeqreqno[-\jotbaseline]{FOO} \nonumber| at the end.
+%
+% \item{|\eqreqno[|\textit{len}|]{FOO}|}
+% \DescribeMacro{\eqreqno} \\
+% This command is the array-like version of |\reqno{FOO}| and
+% is used in much the same way. The optional argument \textit{len}
+% is a length which is added between consecutive rows in the array-like
+% structure. When using |\eqreqno| no `|\\|' should be issued
+% at the end of the line, it is embedded in the command. This
+% is giving a strange appearance if |\eqreqno| is used on the
+% last line of the array-like sturcture, namely an extra blank
+% line (with equation number). To avoid this problem, specify
+% a negative length for \textit{len}, preferably `|-\jotbaseline|'
+% (se below), and issue a `|\nonumber|' afterwards.
+%
+% \item{|\deqreqno[|\textit{len}|]{FOO}|}
+% \DescribeMacro{\deqreqno} \\
+% This is the `|\rndeqno|' version of `|\eqreqno|' and is used
+% as the former with the latter's abilities at the end of a
+% line.
+%
+% \item{|\ddeqreqno[|\textit{len}|]{FOO}|}
+% \DescribeMacro{\ddeqreqno} \\
+% This is the `|\rdeqno|' version of `|\eqreqno|' and is used
+% as the former with the latter's abilities at the end of a
+% line.
+%
+% \item{|\arrlabel{FOO}|} \DescribeMacro{\arrlabel} \\
+% This command is a version of \LaTeX 's ordinary
+% |\label{FOO}| command meant to be used in |deqarr| and
+% |ddeqar| environments. In these environments, a
+% |\label{FOO}| command gives a reference to the specific
+% equation, \textit{e.g.}\ 3b, whereas |\arrlabel{FOO}| in the
+% same position gives a reference containing only the main
+% equation number, 3 in this example. For restrictions, see
+% the section ``Notice'' above. The four commands |\eqreqno|,
+% |\deqreqno|, |\ddeqreqno|, and |\arrlabel| were created after
+% inspiration from Larry Jones (\texttt{schnuff@mit.edu}).
+%
+% \item{|\where|} \DescribeMacro{\where} \\
+% The command |\where| typsets the text ``where'' (in
+% the default LR-font) flush left on a seperate row in
+% |eqnarray|, |deqarr|, |ddeqar|, and |deqrarr| environments,
+% and preserves the environment's alignment for rows to come.
+%
+% \item{|\rem{|\textit{text}|}|} \DescribeMacro{\rem{text}} \\
+% The command |\rem{|\textit{text}|}| typsets the text
+% ``\textit{text}'' (in the default LR-font) flush left on
+% a seperate row in |eqnarray|, |deqarr|, |ddeqar|, and |deqrarr|
+% environments, and preserves the environment's alignment
+% for rows to come. |\where| is equivalent to
+% |\rem{where}|.
+%
+% \item{|\nydeleqno|} \DescribeMacro{\nydeleqno} \\
+% Gives a new partial equation number when used within |$$ ... $$|.
+% Thus, writing |$$ ...| |\nydeleqno $$| is equivalent to
+% writing |\begin{deqn} ... \end{deqn}|.
+% This command is not compatible with the
+% class option |fleqn|, use |\begin{deqn} ... \end{deqn}|
+% instead.
+%
+% \item{|\deleqno|} \DescribeMacro{\deleqno} \\
+% Gives a partial equation number when used within |$$ ... $$|.
+% Thus, writing |$$ ...| |\deleqno| |$$| is equivalent to
+% writing |\begin{ddeqn} ... \end{ddeqn}|.
+% This command is not compatible with the
+% class option |fleqn|, use |\begin{ddeqn} ... \end{ddeqn}|
+% instead.
+%
+% \item{|\jotbaseline|} \DescribeMacro{\jotbaseline} \\
+% This is a rubber length which is set to be the sum of
+% |\baselinsekip| and |\jot| each time a |deqarr|, |ddeqar|,
+% or a |deqrarr| environment is enterd. It is meant to be
+% used with the |\eqreqno| command and its relatives to
+% eliminate the problems when these commands are used on the
+% last line of the environment. (The length |\baselineskip| +
+% |\jot| is the length \LaTeX{} skips between two
+% empty lines in an `|eqnarray|' environment and its
+% derivates defined in \textsf{deleq}.)
+%
+% \end{description}
+%
+% \section{Example}
+% After running \LaTeX{} on |deleq.ins|, there is an
+% example avaliable in the file |delex.tex|,
+% which makes use of all the environments and commands
+% defined in the \textsf{deleq} package. Typset it and see with
+% your own eyes what the results are!
+%
+%
+% \section{Sending a Bug Report}
+% \textsf{deleq} is most likely to contain bugs.
+% Reports of bugs in the package are most welcome.
+% Before filing a bug report,
+% please take the following actions:
+% \begin{enumerate}
+% \item Ensure your problem is not due to your inputfile;
+% \item Ensure your problem is not due to
+% your own package(s) or class(es);
+% \item Ensure your problem is not covered in the section
+% ''Known Problems'' above;
+% \item Try to locate the problem by writing a minimal
+% \LaTeX{} input file which reproduces the problem.
+% Include the command\\
+% | \setcounter{errorcontextlines}{999}|\\
+% in your input;
+% \item Run your file through \LaTeX{};
+% \item Send a description of your problem, the input file
+% and the log file via e-mail to:\\
+% | matsd@homenet.se|
+% \end{enumerate}
+% {\itshape Enjoy your \LaTeX!\raisebox{-\baselineskip}{mats d.}}
+% \StopEventually{\par\vfill\hfill{\scriptsize Copyright
+% \copyright{} 1994-97 by Mats Dahlgren.}}
+% \newpage
+%
+% \section{The Code}
+% For the interested reader(s), here is a short description
+% of the code. \par
+% \iffalse
+%<*paketkod>
+% Part 1: Identification etc.
+% \fi
+% First, the package is to identify itself.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\ProvidesPackage{deleq}[1997/07/07 v.4.41 Partial equation numbering]
+\def\deleqver{\textsf{deleq} version 4.41 (July~7, 1997)}
+% \end{macrocode}
+% \iffalse
+% Part 2: Counters and internal commands, etc.
+% \fi
+% \par Then, we need to define the counters used for the partial
+% part of the equation number. The counter |Deleq| is used for
+% ``recycled'' equation numbers, hence no dependence on any other
+% counter.
+% \begin{macrocode}
+\newcounter{deleq}[equation]
+\newcounter{Deleq}
+\newlength{\jotbaseline}
+\renewcommand{\thedeleq}{\ensuremath{\theequation\mathrm{\alph{deleq}}}}
+\renewcommand{\theDeleq}{\ensuremath{\mathrm{\alph{Deleq}}}}
+\def\@deleqnnum{(\thedeleq)}
+\def\@deleqrnum#1{(\ref{#1}\theDeleq)}
+\def\@eqrnum#1{(\ref{#1})}
+% \end{macrocode}
+% The parts making up the |\\| command in the multiline environments
+% are similar to those used by the standard environments
+% (at least how they looked some time ago):
+% \begin{macrocode}
+\def\@deqncr{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
+ \@ydeqncr}{\global\@eqpen\interdisplaylinepenalty \@ydeqncr}}
+\def\@ydeqncr{\@ifnextchar [{\@xdeqncr}{\@xdeqncr[\z@]}}
+\def\@xdeqncr[#1]{\ifnum0=`{\fi}\@@deqncr
+ \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
+\def\@@deqncr{\let\@tempa\relax
+ \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}%
+ \else \def\@tempa{&}\fi
+ \@tempa \if@eqnsw\@deleqnnum\stepcounter{deleq}\fi
+ \global\@eqnswtrue\global\@eqcnt\z@\cr}
+\newcommand{\@xeqrcr}[2]{\ifnum0=`{\fi}\@@eqrcr{#2}
+ \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
+\def\@@eqrcr#1{\let\@tempa\relax
+ \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}%
+ \else \def\@tempa{&}\fi
+ \@tempa \if@eqnsw\@eqrnum{#1}\fi
+ \global\@eqnswtrue\global\@eqcnt\z@\cr}
+\newcommand{\@xdeqrcr}[2]{\ifnum0=`{\fi}\@@deqrcr{#2}
+ \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
+\def\@@deqrcr#1{\let\@tempa\relax
+ \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}%
+ \else \def\@tempa{&}\fi
+ \@tempa \if@eqnsw\@deleqrnum{#1}\fi
+ \global\@eqnswtrue\global\@eqcnt\z@\cr}
+\def\@deqrarcr{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
+ \@ydeqrarcr}{\global\@eqpen\interdisplaylinepenalty \@ydeqrarcr}}
+\def\@ydeqrarcr{\@ifnextchar [{\@xdeqrarcr}{\@xdeqrarcr[\z@]}}
+\def\@xdeqrarcr[#1]{\ifnum0=`{\fi}\@@deqrarcr
+ \noalign{\penalty\@eqpen\vskip\jot\vskip #1\relax}}
+\def\@@deqrarcr{\let\@tempa\relax
+ \ifcase\@eqcnt \def\@tempa{& & &}\or \def\@tempa{& &}%
+ \else \def\@tempa{&}\fi
+ \@tempa \global\@eqnswtrue\global\@eqcnt\z@\cr}
+% \end{macrocode}
+% \iffalse
+% Part 3: Commands: \nydeleqno, \deleqno, \reqno, \rndeqno, \rdeqno,
+% \eqreqno, \deqreqno, \ddeqreqno, \arrlabel,
+% \nydeqno, and \heqno
+% \fi
+% \par Here the definitions of the user commands are.
+% \begin{macrocode}
+\newcommand{\nydeleqno}{\stepcounter{equation}\stepcounter{deleq}
+ \let\@currentlabel\thedeleq \eqno (\thedeleq)}
+\newcommand{\deleqno}{\refstepcounter{deleq} \let\@currentlabel\thedeleq
+ \eqno (\thedeleq)}
+\newcommand{\reqno}[1]{\setcounter{Deleq}{-1}\refstepcounter{Deleq}
+ \eqno (\ref{#1})}
+\newcommand{\rdeqno}[1]{\refstepcounter{Deleq}
+ \eqno (\ref{#1}\theDeleq)}
+\newcommand{\rndeqno}[1]{\setcounter{Deleq}{0}\refstepcounter{Deleq}
+ \eqno (\ref{#1}\theDeleq)}
+\newcommand{\eqreqno}[2][0pt]{{\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
+ \@xeqrcr{#1}{#2}}{\global\@eqpen\interdisplaylinepenalty
+ \@xeqrcr{#1}{#2}}}
+\newcommand{\deqreqno}[2][0pt]{\setcounter{Deleq}{0}\refstepcounter{Deleq}
+ {\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
+ \@xdeqrcr{#1}{#2}}{\global\@eqpen\interdisplaylinepenalty
+ \@xdeqrcr{#1}{#2}}}
+\newcommand{\ddeqreqno}[2][0pt]{\refstepcounter{Deleq}
+ {\ifnum0=`}\fi\@ifstar{\global\@eqpen\@M
+ \@xdeqrcr{#1}{#2}}{\global\@eqpen\interdisplaylinepenalty
+ \@xdeqrcr{#1}{#2}}}
+\newcommand{\arrlabel}[1]{\let\@currentlabel\theequation \label{#1}}
+\newcommand{\nydeqno}{\stepcounter{equation}\stepcounter{deleq}}
+\newcommand{\heqno}{\stepcounter{equation}}
+\def\where{\let\@tempa\relax \def\@tempa{& & &}
+ \@tempa {\hbox to .01\p@{}\rlap{\hskip -\displaywidth where}}\cr}
+\def\rem#1{\let\@tempa\relax \def\@tempa{& & &}
+ \@tempa {\hbox to .01\p@{}\rlap{\hskip -\displaywidth #1}}\cr}
+% \end{macrocode}
+% \iffalse
+% Part 4: Environments: 'deqarr', 'ddeqar', 'deqn', 'ddeqn', and 'deqrarr'
+% \fi
+% \par The five environments are slight modifications of the
+% corresponding \LaTeX{} standard environments. The main difference
+% lies in which counter(s) is stepped and which internals are used to
+% finish off the lines. Three of them have large parts in
+% common, parts which are put in one macro `|\@dlqnv|':
+% \begin{macrocode}
+\def\@dlqnv{\setlength{\jotbaseline}{\baselineskip}%
+ \addtolength{\jotbaseline}{\jot} \global\@eqnswtrue\m@th
+ \global\@eqcnt\z@\tabskip\@centering
+ $$\halign to\displaywidth\bgroup\@eqnsel\hskip\@centering
+ $\displaystyle\tabskip\z@{##}$&\global\@eqcnt\@ne
+ \hskip 2\arraycolsep \hfil${##}$\hfil
+ &\global\@eqcnt\tw@ \hskip 2\arraycolsep $\displaystyle\tabskip\z@{##}$\hfil
+ \tabskip\@centering&\llap{##}\tabskip\z@\cr}
+\newenvironment{deqarr}{\stepcounter{equation}\stepcounter{deleq}
+ \let\@currentlabel\thedeleq \let\\\@deqncr \@dlqnv}
+{\@@deqncr\egroup
+ \global\advance\c@deleq\m@ne$$\global\@ignoretrue}
+\newenvironment{ddeqar}{\stepcounter{deleq}
+ \let\@currentlabel\thedeleq \let\\\@deqncr \@dlqnv}
+{\enddeqarr}
+\newenvironment{deqn}{$$\refstepcounter{equation}\stepcounter{deleq}
+ \let\@currentlabel\thedeleq}
+ {\eqno \hbox{\@deleqnnum} $$\global\@ignoretrue}
+\newenvironment{ddeqn}{$$\refstepcounter{deleq} \let\@currentlabel\thedeleq}
+ {\enddeqn}
+\newenvironment{deqrarr}{\let\@currentlabel\theDeleq
+ \let\\\@deqrarcr \@dlqnv}
+{\@deqrarcr \egroup $$\global\@ignoretrue}
+% \end{macrocode}
+% \iffalse
+% Part 5: 'leqno' compatibility
+% \fi
+% \par If the user wants the equation numbers to the left, we have to
+% modify some of the commands and internals defined above. This is
+% done in a |\DeclareOption|-call, but first we set a
+% switch to test for the |leqno| option. Initially, it is set
+% to |F| and then changed to |T| if the |leqno| option is in effect.
+% \begin{macrocode}
+\newif\ifl@qn \l@qnfalse
+\DeclareOption{leqno}{%
+\global\l@qntrue%
+\renewcommand{\@deleqnnum}{\hbox to .01\p@{}\rlap{\reset@font\rmfamily
+ \hskip -\displaywidth(\thedeleq)}}
+\renewcommand{\nydeleqno}{\stepcounter{equation}\stepcounter{deleq}
+ \let\@currentlabel\thedeleq \leqno (\thedeleq)}
+\renewcommand{\deleqno}{\refstepcounter{deleq} \let\@currentlabel\thedeleq
+ \leqno (\thedeleq)}
+\renewcommand{\reqno}[1]{\setcounter{Deleq}{-1}\refstepcounter{Deleq}
+ \leqno (\ref{#1})}
+\renewcommand{\rdeqno}[1]{\refstepcounter{Deleq}
+ \leqno (\ref{#1}\theDeleq)}
+\renewcommand{\rndeqno}[1]{\setcounter{Deleq}{0}\refstepcounter{Deleq}
+ \leqno (\ref{#1}\theDeleq)}
+\renewcommand{\@eqrnum}[1]{\hbox to .01\p@{}\rlap{\reset@font\rmfamily
+ \hskip -\displaywidth(\ref{#1})}}
+\renewcommand{\@deleqrnum}[1]{\hbox to .01\p@{}\rlap{\reset@font\rmfamily
+ \hskip -\displaywidth(\ref{#1}\theDeleq)}}
+ }
+% \end{macrocode}
+% \iffalse
+% Part 6: `fleqn' compatibility
+% \fi
+% \par The |fleqn| option is mainly a `\textsf{deleq}-ification' of
+% the \LaTeXe{} file |fleqn.clo| (1995/06/26 v1.3g). If both
+% |leqno| and |fleqn| options are in use, the length
+% |\mathindent| should be increased to allow space for the
+% letters of the partial equation numbers. For the
+% multiline environments, it is enough to make changes to the
+% internal |\@dlqnv|.
+% \begin{macrocode}
+\DeclareOption{fleqn}{%
+\ifl@qn \AtBeginDocument{\addtolength{\mathindent}{1em}} \fi
+\renewenvironment{deqn}%
+ {\@beginparpenalty\predisplaypenalty
+ \@endparpenalty\postdisplaypenalty
+ \refstepcounter{equation}\stepcounter{deleq}
+ \let\@currentlabel\thedeleq%
+ \trivlist \item[]\leavevmode
+ \hb@xt@\linewidth\bgroup $\m@th% $
+ \displaystyle
+ \hskip\mathindent}%
+ {$\hfil % $
+ \displaywidth\linewidth\hbox{\@deleqnnum}%
+ \egroup
+ \endtrivlist}
+\renewenvironment{ddeqn}%
+ {\@beginparpenalty\predisplaypenalty
+ \@endparpenalty\postdisplaypenalty
+ \refstepcounter{deleq}
+ \let\@currentlabel\thedeleq%
+ \trivlist \item[]\leavevmode
+ \hb@xt@\linewidth\bgroup $\m@th% $
+ \displaystyle
+ \hskip\mathindent}%
+ {\enddeqn}
+\renewcommand{\@dlqnv}{%
+ \setlength{\jotbaseline}{\baselineskip}
+ \addtolength{\jotbaseline}{\jot}
+ \global\@eqcnt\z@
+ \tabskip\mathindent
+ \setlength\abovedisplayskip{\topsep}%
+ \ifvmode
+ \addtolength\abovedisplayskip{\partopsep}%
+ \fi
+ \addtolength\abovedisplayskip{\parskip}%
+ \setlength\belowdisplayskip{\abovedisplayskip}%
+ \setlength\belowdisplayshortskip{\abovedisplayskip}%
+ \setlength\abovedisplayshortskip{\abovedisplayskip}%
+ $$\everycr{}\halign to\linewidth% $$
+ \bgroup
+ \hskip\@centering
+ $\displaystyle\tabskip\z@skip{##}$\@eqnsel&%
+ \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&%
+ \global\@eqcnt\tw@ \hskip \tw@\arraycolsep
+ $\displaystyle{##}$\hfil \tabskip\@centering&%
+ \global\@eqcnt\thr@@
+ \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}
+}
+% \end{macrocode}
+% If other options were asked for, the package should make
+% these options `unused'. Then, last, the option(s)
+% is (are) processed.
+% \begin{macrocode}
+\DeclareOption*{\OptionNotUsed}
+\ProcessOptions
+% \end{macrocode}
+% That is all. Happy \TeX-ing!
+% \iffalse
+% END of it all!
+%</paketkod>
+%<*exempelkod>
+\documentclass[11pt]{article} %%% add `leqno' if you want left-aligned
+\usepackage{deleq} %%% equation numbers and `fleqn' to
+\oddsidemargin=0.5cm %%% flush the equations left.
+\evensidemargin=0.5cm
+\topmargin=-5mm
+\textheight=23.5cm
+\textwidth=15.5cm
+\begin{document}
+ \begin{center}
+ \Large Welcome to the \textsf{deleq} package!
+ \end{center}
+
+ This is a short document to demonstrate the use of the
+ \textsf{deleq} package and its commands. It uses \deleqver .
+ \textsf{deleq} was written by Mats Dahlgren
+ (\texttt{matsd@physchem.kth.se}). Suggestions for
+ improvements and bug reports are most welcome, see the
+ documentation. \textsf{deleq} is fully compatible with the
+ \texttt{leqno} option and most of the \texttt{fleqn} option.
+
+ We start this demonstration by a simple and well-known
+ equation to get the equation number counter going:
+ \begin{equation}
+ \sin^2\alpha + \cos^2\alpha = 1
+ \end{equation}
+ The first example will be to make use of the
+ \texttt{deqn} environment to get a partially numbered
+ equation:
+ \begin{deqn}
+ \sin (-\alpha) = - \sin \alpha
+ \end{deqn}
+ This equation has its cosine companion, here written in
+ the \texttt{ddeqn} environment:
+ \begin{ddeqn}
+ \cos (-\alpha) = \cos \alpha
+ \end{ddeqn}
+ Not so exciting, so far. :--)
+
+ In the next example we introduce the \texttt{deqarr}
+ environment for writing equations:
+ \begin{deqarr}
+ \sin ( \alpha + \beta ) & =
+ & \sin \alpha \cos \beta + \sin \beta \cos \alpha \\
+ \sin ( \alpha - \beta ) & =
+ & \sin \alpha \cos \beta - \sin \beta \cos \alpha
+ \label{Demo1}
+ \end{deqarr}
+ where we also have put in the label \texttt{Demo1} in
+ the second equation. Next, notice how the environment
+ \texttt{ddeqar} uses the same main equation number as
+ the previous equations:
+ \begin{ddeqar}
+ \cos ( \alpha + \beta ) & =
+ & \cos \alpha \cos \beta - \sin \alpha \sin \beta
+ \arrlabel{Demo2} \\
+ \cos ( \alpha - \beta ) & =
+ & \cos \alpha \cos \beta + \sin \alpha \sin \beta
+ \end{ddeqar}
+ In the first of these equations, an \verb+\arrlabel+ command
+ with the label \texttt{Demo2} is included.
+ Now, we will make another \texttt{eqnarray}-like
+ structure, again in the \texttt{ddeqar} environment:
+ \begin{ddeqar}
+ \sin 2\alpha & =
+ & 2 \sin \alpha \cos \alpha \heqno \label{Demo3} \\
+ \cos 2\alpha & =
+ & \cos ^2 \alpha - \sin ^2 \alpha \nydeqno \\
+ \rem{or}
+ & = & 2\cos ^2 \alpha - 1
+ \end{ddeqar}
+ This example shows the use of \verb$\heqno$ in the first
+ equation, which produces an ordinary equation number.
+ The first equation is also labelled, with the label
+ \texttt{Demo3}. The next equation's number was produced
+ by the command \verb$\nydeqno$. Also, notice the use of
+ \verb+\rem{or}+, which results in the text ``or'' without
+ changing the alignment. To illustrate the use of
+ \verb+\arrlabel{Demo2}+ above, we here make a reference to it:
+ \ldots{} in equations \ref{Demo2} \ldots which was
+ created by typing
+ `\verb+\ldots{} in equations \ref{Demo2} \ldots+'.
+
+ To step the equation number counter, we want the
+ following equations typeset in ordinary
+ \texttt{eqnarray} environment:
+ \begin{eqnarray}
+ \tan ^2 \alpha & =
+ & \frac{\sin ^2 \alpha}{\cos ^2 \alpha} \label{Demo4} \\
+ \tan \alpha & =
+ & \frac{\sin \alpha}{\cos \alpha}
+ \end{eqnarray}
+ The upper equation was given the label \texttt{Demo4}.
+
+ Now one of the ``recycling'' commands is to be
+ demonstrated. First of all, let's make an ordinary
+ reference to equation~\ref{Demo3}, and then ``recycle'' it:
+ $$ \sin 2\alpha = 2 \sin \alpha \cos \alpha \reqno{Demo3} $$
+ This was obtained with \verb#$$ ... $$# with the command
+ \verb#\reqno{Demo3}# at the end. Also partially
+ numbered equations can be recycled with the
+ \verb#\reqno{FOO}# command, as with
+ equation~\ref{Demo1}:
+ $$ \sin ( \alpha - \beta ) = \sin \alpha \cos \beta -
+ \sin \beta \cos \alpha \reqno{Demo1} $$
+ (However, the use of \verb#\rndeqno{FOO}# and
+ \verb#\rdeqno{FOO}# will produce strange results with
+ two (different) partial equation numbers if \texttt{FOO}
+ refers to a partially numbered equation.)
+
+ The next equation was written with \verb#$$ ... $$# and
+ a \verb#\deleqno# command at the end:
+ $$ \tan 2\alpha = \frac{2\tan \alpha}{1 - \tan ^2 \alpha} \deleqno $$
+ Notice how the main equation number counter is still the
+ same, despite that we now are outside of the
+ \texttt{ddeqar} environment. Also, notice how the use of
+ \verb#\reqno# above did not affect the equation number
+ counter. The following equation is also set within
+ \verb#$$ ... $$#, but it uses the command
+ \verb#\nydeleqno# to produce an equation number with a
+ new main number:
+ $$ \sin ^2 \alpha = 1 - \cos ^2 \alpha \nydeleqno $$
+
+ Now we will elaborate a little on \verb#\rndeqno{FOO}#
+ and \verb#\rdeqno{FOO}#. Let us use
+ equation~\ref{Demo4}, and see what happens if we use the
+ \verb#\rndeqno{FOO}# command:
+ $$ \tan ^2 \alpha = \frac{\sin ^2 \alpha}
+ {\cos ^2 \alpha} \rndeqno{Demo4} $$
+ which we rewrite:
+ $$ \tan ^2 \alpha = \frac{\sin ^2 \alpha}
+ {1 - \sin ^2 \alpha} \rdeqno{Demo4} \label{Demo5} $$
+ with \verb#\rdeqno{Demo4}# at the end. This is great
+ fun, so why not one more:
+ \begin{deqrarr}
+ \tan ^2 \alpha = \frac{1 - \cos ^2 \alpha}
+ {\cos ^2 \alpha} \ddeqreqno[-\jotbaseline]{Demo4}
+ \nonumber
+ \end{deqrarr}
+ Also, the middle form of equation~\ref{Demo4} got a
+ label, \texttt{Demo5}. In the last example, the construct\\
+ \verb+ \ddeqreqno[-\jotbaseline]{Demo4} \nonumber+\\ in a
+ \texttt{deqrarr} environment is used, to obtain
+ \texttt{fleqn} compatibility.
+
+ There is still one equation to write. This time we
+ again use the \texttt{deqarr} environment:
+ \begin{deqarr}
+ \cot \alpha & = & \frac{\cos \alpha}{\sin \alpha} \\
+ \where
+ & = & \frac{1}{\tan \alpha}
+ \end{deqarr}
+ This example also shows the use of the \verb+\where+
+ command, which is a special case of the \verb+\rem+ command.
+ Now, the interesting thing of referring to the recycled
+ equations is ahead. If one writes \verb#\ref{Demo5}#,
+ this is what \LaTeX\ will return:~\ref{Demo5}. That is
+ not too instructive, since the partial equation numbers
+ are quite common in this document. To make the complete
+ reference, use \verb#\ref{Demo4}\ref{Demo5}#. The
+ reference~\ref{Demo4}\ref{Demo5} is much more
+ comprehensible, right? (If you get bad line-breaks at
+ such references, put them in an \verb#\mbox{...}#.)
+
+
+ Now we will show the use of the commands to recycle equation
+ numbers in \verb+eqnarray+-like structures. These commands
+ are \verb+\eqreqno{FOO}+, \verb+\deqreqno{FOO}+, and
+ \verb+\ddeqreqno{FOO}+. We start by repeating equation
+ \ref{Demo1} in an \verb+deqrarr+ environment:
+ \begin{deqrarr}
+ \sin ( \alpha - \beta ) & =
+ & \sin \alpha \cos \beta - \sin \beta \cos \alpha
+ \eqreqno{Demo1}
+ \sin 2\alpha & = & 2 \sin\alpha \cos\alpha
+ \end{deqrarr}
+ The second equation here shows how the alignment of the
+ equations is preserved. Next, we can use the equation
+ \ref{Demo3} for some variations:
+ \begin{deqrarr}
+ \sin 2\alpha & = & 2 \sin\alpha \cos\alpha
+ \deqreqno{Demo3}
+ \sin 4\alpha & = & 2 \sin 2\alpha \cos 2\alpha \\
+ & = & 2\left( 2\sin\alpha \cos\alpha
+ \left( \cos^2 \alpha - \sin^2 \alpha\right)\right)
+ \ddeqreqno{Demo3}
+ & = & 4\left(\sin\alpha \cos\alpha
+ \left( \cos^2 \alpha - \sin^2 \alpha\right)\right)
+ \ddeqreqno[-\jotbaseline]{Demo3}
+ \end{deqrarr}
+ The features used here are \verb+\deqreqno{Demo3}+
+ on the first line, \verb+\ddeqreqno{Demo3}+ on the
+ second line, and \verb+\deqreqno[-\jotbaseline]{Demo3}+
+ on the third. Note how the inclusion of
+ \verb+[-\jotbaseline]+ on the third line prevents
+ \LaTeX{} from inserting an extra blank line. The
+ second line ends with `\verb+\\+', and has thus no
+ equation number at all.
+
+ The last part shows how you may use \verb+\eqreqno+ and its
+ relatives in \verb+deqarr+ environment:
+ \begin{deqarr}
+ \sin\alpha & = & \sin\alpha \cos 0 + \sin 0 \cos\alpha \\
+ \sin 2\alpha & = & 2 \sin\alpha \cos\alpha \eqreqno{Demo3}
+ \sin 3\alpha & = & \sin 2\alpha \cos\alpha +
+ \sin\alpha \cos 2\alpha \\
+ \sin 4\alpha & = & 2 \sin 2\alpha \cos 2\alpha \\
+ \sin 5\alpha & = & \sin 3\alpha \cos 2\alpha +
+ \sin 2\alpha \cos 3\alpha \ddeqreqno{Demo3}
+ \sin 6\alpha & = & 2 \sin 3\alpha \cos 3\alpha
+ \end{deqarr}
+ The interesting part here is an `\verb+\eqreqno{Demo3}+' at
+ the end of the second line and a `\verb+\ddeqreqno{Demo3}+' at
+ the end of the fifth line. Notice how the partial
+ equation number counter in unaffected by the enetering of
+ the \verb+deqarr+ environment.
+
+
+ Finally, the $\mathcal{END}$! If you want your
+ equation numbers left-aligned, just specify the \texttt{leqno}
+ option for the \texttt{documentclass} you are using. It
+ should work! If you have any suggestions, corrections
+ or contributions, please contact me. Enjoy \LaTeX !
+
+ {\itshape mats d.}
+\end{document}
+%</exempelkod>
+% \fi
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/deleq/deleq.ins b/Master/texmf-dist/source/latex/deleq/deleq.ins
new file mode 100644
index 00000000000..6c040bbcb36
--- /dev/null
+++ b/Master/texmf-dist/source/latex/deleq/deleq.ins
@@ -0,0 +1,61 @@
+%
+% This is file `deleq.ins', the installation file for the
+% `deleq' package. Last revised 1996/01/22.
+%
+% Copyright (c) 1994-97 by Mats Dahlgren <matsd@homenet.se>.
+% All rights reserved.
+%
+% You may use the `deleq' package freely, but at your own
+% risk. The author of deleq.dtx and deleq.ins (the
+% complete `deleq' package distribution) can not be held
+% responsible for any consequence of your using any of these
+% files, or files created from these, including hardware,
+% software, and data damage. You may not make any changes to
+% the files deleq.dtx or deleq.ins. You are allowed to make
+% changes to the `\documentclass' and/or `\usepackage' commands
+% of the file `delex.tex'. You may incorporate
+% the code from these files in other files under different
+% names, provided the original author is given full credit for
+% his work and that you yourself take the complaints from the
+% user(s) of your file(s). You may freely distribute the
+% files deleq.dtx and deleq.ins, provided: 1. You do not
+% take money for the distribution or use of these files except
+% for a nominal charge for diskettes and postage; and 2. You
+% always distribute `deleq.dtx' and `deleq.ins' together
+% at the same time.
+%
+\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+\def\batchfile{deleq.ins}
+\input docstrip.tex
+
+\keepsilent
+\preamble
+
+
+Copyright (c) 1994-97 by Mats Dahlgren <matsd@homenet.se>.
+All rights reserved. See the file `deleq.ins' for information
+on how you may (re-)distribute the `deleq' package files.
+
+\endpreamble
+
+
+\generate{\file{deleq.sty}{\from{deleq.dtx}{paketkod}}%
+ \file{delex.tex}{\from{deleq.dtx}{exempelkod}}%
+}
+
+
+\Msg{************************************************************}
+\Msg{ }
+\Msg{ To finish the installation you have to move the file}
+\Msg{ `deleq.sty' into a directory searched by TeX.}
+\Msg{ }
+\Msg{ To type-set the documentation, run the file `deleq.dtx'}
+\Msg{ through LaTeX.}
+\Msg{ }
+\Msg{ To get an example file, run the file `delex.tex'}
+\Msg{ twice through LaTeX.}
+\Msg{ }
+\Msg{***********************************************************}
+%%
+%% end of file deleq.ins
+%%
diff --git a/Master/texmf-dist/source/latex/diagnose/INSTALL b/Master/texmf-dist/source/latex/diagnose/INSTALL
new file mode 100644
index 00000000000..f1834d85942
--- /dev/null
+++ b/Master/texmf-dist/source/latex/diagnose/INSTALL
@@ -0,0 +1,49 @@
+ Title: diagnose.sty
+ Version: 0.2
+ Author: Oliver Corff
+ Copyright: Ulaanbaatar, Berlin, Beijing, Shanghai 2001
+ Date: April 10th, 2001
+ (Timestamp: April 10, 2001)
+ Archive Name: diagnose.zip
+ Description: Installation Diagnostics
+ Legal Notes: See end of this document
+
+0. Introduction
+
+diagnose.sty, if included as a package, helps identify available
+and necessary but missing files, packages and tokens.
+
+diagnose.sty can be used by texts and other packages. For every
+file or token checked it provides a counter and a set of messages,
+one message if the file or token is found, the other for an absent
+token or file.
+
+
+1. Installation and Use
+
+Unpack the archive diagnose.zip in some temporary directory.
+Copy the file diagnose.sty to a place where your TeX installation
+can find it. Rehash the directory database, if possible (not all
+distributions provide this possibility).
+
+The counter provided by diagnose.sty can be used to trigger appropriate
+activity, either in the form of program branches or in the form of
+variable texts. Messages can appear in log files and documents.
+
+See diagnose.tex for a complete documentation and mls-diag.tex for
+a live example of what this is all about.
+
+
+2. Legal Notes
+
+This software is published under the GPL.
+Usual disclaimers apply.
+
+Thank you for using diagnose.sty!
+
+ Ulaanbaatar, Beijing,
+ Berlin, Shanghai
+ April 2001
+
+ Oliver Corff
+ corff@zedat.fu-berlin.de
diff --git a/Master/texmf-dist/source/latex/dinbrief/dinbrief.drv b/Master/texmf-dist/source/latex/dinbrief/dinbrief.drv
new file mode 100644
index 00000000000..c132722a2ec
--- /dev/null
+++ b/Master/texmf-dist/source/latex/dinbrief/dinbrief.drv
@@ -0,0 +1,85 @@
+%%
+%% This is file `dinbrief.drv',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% dinbrief.dtx (with options: `driver')
+%%
+%% =======================================================================
+%%
+%% Copyright (C) 1993, 96, 97 by University of Karlsruhe (Computing Center).
+%% Copyright (C) 1998, 2000 by University of Karlsruhe (Computing Center)
+%% and Richard Gussmann.
+%% All rights reserved.
+%% For additional copyright information see further down in this file.
+%%
+%% This file is part of the DINBRIEF package
+%% -----------------------------------------------------------------------
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License (LPPL), as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.1 or, at your option, any later version.
+%%
+%% The latest version of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% LPPL Version 1.1 or later is part of all distributions of LaTeX
+%% version 1999/06/01 or later.
+%%
+%%
+%% For error reports in case of UNCHANGED versions see readme files.
+%%
+%% Please do not request updates from us directly. Distribution is
+%% done through Mail-Servers, TeX organizations and others.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% \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 \~}
+%%
+\documentclass{ltxdoc}
+\usepackage{german}
+\originalTeX
+\DoNotIndex{\@empty,\\,\space,\@warning}
+\DoNotIndex{\begin,\bfseries,\bgroup,\box,\def,\edef,\egroup}
+\DoNotIndex{\else,\end,\endcsname,\expandafter,\fi,\gdef}
+\DoNotIndex{\hbox}
+\DoNotIndex{\hfil,\hfill,\hss,\ifx,\item,\let,\long,\message}
+\DoNotIndex{\nointerlineskip}
+\DoNotIndex{\originalTeX,\p@,\par,\parbox,\parsep,\relax}
+\DoNotIndex{\setlength}
+\DoNotIndex{\space,\string,\strut,\tmpa,\typeout,\verb}
+\DoNotIndex{\vbox,\vskip,\vspace,\vss}
+\DoNotIndex{\xdef,\z@,\z@skip}
+\DoNotIndex{\LaTeX,\LaTeXe}
+\DoNotIndex{\OnlyDescription,\PrintChanges,\PrintIndex,\RecordChanges}
+\EnableCrossrefs
+\CodelineIndex
+ %\DisableCrossrefs
+\RecordChanges
+ %\OnlyDescription
+\typeout{Expect some under- and overfull boxes}
+\begin{document}
+\DocInput{dinbrief.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+\endinput
+%%
+%% End of file `dinbrief.drv'.
diff --git a/Master/texmf-dist/source/latex/dinbrief/dinbrief.dtx b/Master/texmf-dist/source/latex/dinbrief/dinbrief.dtx
new file mode 100644
index 00000000000..12f214df71e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/dinbrief/dinbrief.dtx
@@ -0,0 +1,7653 @@
+%
+% \iffalse meta-comment
+%
+% $Id: dinbrief.dtx,v 1.73 2000/03/02 12:49:21 rz32 Exp $
+%
+%<*styleinfo>
+=======================================================================
+@stylefile{Ltall
+shortpackagename = {dinbrief},
+longpackagename = {dinbrief},
+baseformats = {\LaTeX\ 2.09 and \LaTeXe},
+version = {$Revision: 1.73 $},
+date = {$Date: 2000/03/02 12:49:21 $},
+author = {K.D. Braune, R. Gussmann,
+ Klaus.Braune@rz.uni-karlsruhe.de
+ richard@gussmann.de
+ Universit\"at Karlsruhe
+ Rechenzentrum
+ Postfach 6980
+ 76128 Karlsruhe
+ +49 721 608-40 31},
+abstract = {This document serves as User's Guide
+ and as documentation of the new \LaTeX-Style
+ or a \LaTeXe-Class. This class/style implements
+ a new document layout for writing letters,
+ according to the rules of DIN (Deutsches
+ Institut f\"ur Normung, German standardization
+ institute). The User's Guide is written in
+ German, since we assume the class/style is of
+ minor interest outside Germany. Of course,
+ most of the macros are explained in English.},
+support = {yes},
+comments = {},
+requirements = {},
+incompatibilities = {not full compatible to R. Sengerlings dinbrief}}
+=======================================================================
+%</styleinfo>
+%
+% $Log: dinbrief.dtx,v $
+% Revision 1.73 2000/03/02 12:49:21 rz32
+% <CR><LF> replaced by UNIX's newline.
+% Adjustment of \textheight due to a high position of the bottomtext corrected.
+% Made position of bottomtext work correct with pagestyles empty, headings and
+% myheadings.
+%
+% Revision 1.72 2000/01/19 14:51:04 rz32
+% Made version ready for distribution
+%
+% Revision 1.71 2000/01/19 14:41:57 rz32
+% Many changes, the more important ones being:
+% - replacing absolut length by variables and expressions
+% - support for a configurtion file
+% - made bottomtext working before \begin{document}
+% - minor modifications to make the documentation (except dinbrief.drv)
+% working under LaTeX 209
+%
+% Revision 1.72 2000/01/19 11:51:09 rz32
+% Minor modifications to make the documentation (except dinbrief.drv)
+% working under LaTeX209
+%
+% Revision 1.71 2000/01/19 00:18:53 rz32
+% Many changes, the more important ones being:
+% - replacing absolut length by variables and expressions
+% - support for a configurtion file
+% - support for both letter versions
+% - made bottomtext working before \begin{document}
+%
+% Revision 1.70 2000/01/12 21:54:33 Gussmann
+% - Documentation for extended \closing[]{} added.
+%
+% Revision 1.69 2000/01/03 21:10:25 Gussmann
+% - The checksum must also corrected (a long time ago you changed a
+% dtx-file, Richard).
+% - Added entry to the change history.
+%
+% Revision 1.68 2000/01/03 20:42:40 Gussmann
+% - Fixed Y2K-bug in \@znumber.
+% - Changed the license conditions to the LaTeX Project Public
+% License (LPPL).
+%
+% Revision 1.67 1998/09/03 00:22:05 Gussmann
+% - Added some changes lost in elder versions.
+%
+% Revision 1.66 1996/10/29 20:50:05 Gussmann
+% - lots of minor changes.
+%
+% Revision 1.65 1996/08/06 01:17:29 Gussmann
+% - \cmd\closing extended.
+% - minor bugs fixed.
+%
+% Revision 1.64 1996/05/30 22:36:59 Gussmann
+% - Fixed a typo.
+%
+% Revision 1.63 1996/05/21 19:13:50 Gussmann
+% - twoside option added.
+%
+% Revision 1.62 1996/01/09 19:59:40 Gussmann
+% - \@multiplelabelsfalse is no longer defined in LaTeX2e.
+% Removed this line from the code.
+%
+% Revision 1.61 1995/12/12 20:31:16 Gussmann
+% - Fixed wrong headline.
+% - Removed \cs\G@refundefined\ from \cs\document\ to work with
+% the December 1995 release of LaTeX2e.
+%
+% Revision 1.60 1995/10/27 00:13:16 Gussmann
+% File: brfkopf.tex changed. \vspace* moved before the picture.
+%
+% Revision 1.59 1995/10/05 22:53:59 Gussmann
+% Forgot to change the \cmd\checksum.
+%
+% Revision 1.58 1995/10/05 22:37:22 Gussmann
+% Fixed bug in \cmd\document. Problems with ats in the aux-file
+% should not longer arise.
+%
+% Revision 1.57 1995/08/15 23:31:20 Gussmann
+% - Documentation changed.
+% - Checksum set.
+%
+% Revision 1.56 1995/08/15 23:04:24 Gussmann
+% - \cmd\subject changed. It's now a link to \cmd\concern.
+%
+% Revision 1.55 1995/08/15 22:55:53 Gussmann
+% - Empty white page on the very end of the document will not longer shipped
+% out.
+% - Fixed bug in the generation of labels with style label@plain.
+% - Command \string\subject added. Same behavior as \string\concern.
+%
+% Revision 1.54 1995/07/06 02:35:55 Gussmann
+% - Code for the readme-file removed. It can now be found in dbaddon.dtx.
+% - Code for tracing removed. It can now be found in dbaddon.dtx.
+%
+% Revision 1.53 1995/07/06 01:37:11 Gussmann
+% - Readme-file added.
+% - structure of dinbrief.dtx changed.
+% - pagestyle contheadins didn't work correct in all cases.
+%
+% Revision 1.52 1995/06/30 15:15:28 Gussmann
+% - pagestyle contheadings did not work.
+% - fixed bug in placing the enclosures right.
+% - \cmd\nofiles and \cmd\makelabels did now work as expected.
+% (Warning \cmd\nofiles switches also the generation of the
+% labels off).
+%
+% Revision 1.51 1995/06/29 12:48:35 Gussmann
+% *** empty log message ***
+%
+% Revision 1.50 1995/06/29 12:45:15 Gussmann
+% - Versionnumber is overtaken from rcs.
+%
+% Revision 1.49 1995/06/29 12:41:20 Gussmann
+% - \cmd\letter\ changed. \cmd\vspace\ is set to \cmd\relax\ while
+% splitting the receivers address.
+% - \cmd\ntoday\ added. The behavior is quite the same as in \cmd\today.
+% - \cmd\@ntoday changed.
+%
+% Revision 1.48 1995/06/28 02:34:32 Gussmann
+% - Fixed bug in redefinition of \cmd\cal\ und \cmd\mit.
+% - Behavior of \cmd\Anlagen\ and \cmd\Verteiler\ changed
+% to be compatible with old dinbrief.
+% - Commands \cmd\encl\ and \cmd\cc\ changed. Now an
+% optional argument can replace the predefined strings
+% or avoid them if an empty optional argument is given.
+% This will be a feature and not documented.
+% - LaTeX warnings changed to Class dinbrief warnings.
+% In LaTeX209 mode a new command \cmd\ClassWarning\
+% defined.
+%
+% Revision 1.47 1995/06/12 23:43:58 Gussmann
+% - Only the position of the windowtics changed (all of them
+% moved 1.1mm down).
+%
+% Revision 1.46 1995/06/12 23:03:54 Gussmann
+% - Documentation updated.
+% - Some test messages removed.
+% - Some macros changed.
+%
+% Revision 1.45 1995/06/01 00:42:51 Gussmann
+% Documentation has been updated und completed (not complete yet).
+%
+% Revision 1.44 1995/05/31 18:17:45 Gussmann
+% - \cmd\labelnumber\ changed to \cmd\setlabelnumber
+% - \cmd\labelheight\ changed to \cmd\setlabelheight
+% - \cmd\labeltopmargin\ changed to \cmd\setlabeltopmargin
+% - Reason: One of the commands above is also used inside the list
+% environment.
+%
+% Revision 1.43 1995/05/11 02:45:55 Gussmann
+% - Thousends of overfull hboxes removed.
+% - Character table added.
+% - Checksum added.
+% - LaTeX2e version check added.
+% (but still the wrong date.)
+%
+% Revision 1.42 1995/05/11 01:32:40 Gussmann
+% Section for the commands of the old dinbrief from Rainer Sengerling
+% added.
+%
+% Revision 1.41 1995/05/09 00:48:54 Gussmann
+% - Yeah! Labels can now be printed on Herma copy-print 4452 (105mm x 42mm)
+% - \cmd\hoffset will not be changed, therefore \cmd\evensidemargin and
+% \cmd\oddsidemargin hold now other values.
+% - \cmd\voffset will not be changed, therefore \cmd\topmargin
+% hold now other values.
+% - \cmd\setlabelwidth holds now the width of one label.
+% - still inconsistent label commands: \setlabelwidth, \labelheight,
+% \labeltopmargin.
+% - new trace flag \cs{if@kadb@tracinglabels}.
+%
+% Revision 1.40 1995/04/28 01:36:09 Gussmann
+% - Fixed bug in switch commands for the generation of labels, \cmd\nolabels,.
+% - Fixed bug in typesetting the labels.
+%
+% Revision 1.39 1995/04/28 01:26:27 Gussmann
+% - New commands: \cmd\offlabels, \cmd\onlabels and \cmd\nolabels.
+% - fixed bug in typesetting the labels.
+%
+% Revision 1.38 1995/04/27 23:46:43 Gussmann
+% - Generation of labels with different sizes work now.
+% - \cmd\spare works also now.
+% - Fine tuning of the labels and their adjustement on the
+% page is beeing still missing.
+%
+% Revision 1.37 1995/04/26 00:49:03 Gussmann
+% - Label management not yet complete (Try \Etizahl{4} to get
+% funny results).
+% - Former authors are still not mentioned. (Some people
+% will grumble about this!)
+%
+% Revision 1.36 1995/04/25 23:54:35 Gussmann
+% Assignments for \labelnumber, \labelheight and \labelwidth are now
+% global.
+%
+% Revision 1.35 1995/04/25 23:51:49 Gussmann
+% Only comments added behind some closing braces.
+%
+% Revision 1.34 1995/04/25 23:36:01 Gussmann
+% Changes:
+% - \newdimen\ka@db@tmpdima\ introduced.
+% - \cmd\closing\ changed.
+%
+% Revision 1.33 1995/04/25 23:20:03 Gussmann
+% \cmd\closing\ changed. Forgott to insert a minus sign in the calculation
+% of the witdh of the parboxes.
+%
+% Revision 1.32 1995/04/25 23:13:18 Gussmann
+% *** empty log message ***
+%
+% Revision 1.31 1995/03/02 00:54:57 Gussmann
+% * Test messages has being commented out.
+% * Some bugs fixed in \cmd\label@plain.
+% * \cmd\label@plain still contains errors.
+%
+% Revision 1.30 1995/03/01 23:44:04 Gussmann
+% * \cmd\spare implemented (still not complete).
+% * \cmd\Etihoehe, \cmd\Etirand and \cmd\Etizahl implemented.
+% * \cmd\labelheight, \cmd\labeltopmargin and \cmd\labelnumber
+% implemented.
+% * comments in the label section added.
+%
+% Revision 1.29 1995/02/22 20:07:31 Gussmann
+% *** empty log message ***
+%
+% Revision 1.28 1995/01/22 21:45:47 Gussmann
+% * macro \cmd\ka@db@tstoaddress\space changed.
+% * \cmd\postremark\space works.
+%
+% Revision 1.27 1995/01/22 21:28:52 Gussmann
+% \cmd\ka@db@ifemptydynvar\space inserts phantom spaces. (Fixed!)
+%
+% Revision 1.26 1995/01/22 21:25:59 Gussmann
+% * many changes (lot of intern commands changed)
+% * \cmd\postremark\space added
+%
+% Revision 1.25 1995/01/22 00:27:24 Gussmann
+% * layout bug in envelope window detected and fixed.
+%
+% Revision 1.24 1995/01/19 02:43:30 Gussmann
+% \cmd\letter sequence \let\\=\relax added to avaid error message
+% in LaTeX209.
+%
+% Revision 1.23 1995/01/19 02:28:36 Gussmann
+% * lots of changes, not all mentioned here!
+% * layout incomplete (some positions differ up to 6mm from norm position)!
+% * commands changed (list incomplete)
+% - NEW counter \c@lt@state
+% - \cmd\letter (counter cmds added, old cmds not deletet yet)
+% - \cmd\opening (counter cmds added)
+% - \cmd\closing (counter cmds added)
+% - \cmd\endletter (counter cmds added)
+% - \cmd\cc changed
+% - \cmd\encl changed
+% - \cmd\Anlagen changed
+% - \cmd\Verteiler changed
+% - \cmd\signature changed
+%
+% Revision 1.22 1995/01/15 23:48:40 Gussmann
+% Many changes:
+% * old dinbrief API added (not yet complete).
+% * dinbrief programming API introduced (not used at the moment).
+% * \cmd\opening rewritten:
+% - \cmd\opening is now not longer a large monolitc macro. It
+% is small and calls several other macros.
+% - all other macros called by the \cmd\opening introduced.
+% - new macros causes other base positions of the
+% normed positions of some letter objects. Final
+% position of these objects (i.e. the frames and tics)
+% not checked (+- 2.5mm).
+% * macros \cmd\ifka@db@windowrules and \cmd\ifka@db@windowtics
+% replace old macros.
+% * new example called: dbold.tex added.
+% * driver changed (generate now also dbold.tex, hopefully and index
+% and the changelog.
+%
+% Revision 1.21 1995/01/13 16:27:49 Gussmann
+% * \cmd\splitoncr introduced, to split the address of the receiver
+% in a more user friendly way.
+% * old DINBRIEF API functions added.
+%
+% Revision 1.20 1995/01/12 01:12:12 Gussmann
+% Fixed bug to work correctly with NFSS.
+% PSNFSS gets now the right fonts.
+% Only command \document changed.
+%
+% Revision 1.19 1994/12/21 23:54:46 Gussmann
+% * Work around removed, which fixes a bug from the beta release
+% of LaTeX2e.
+% * Date updated.
+%
+% Revision 1.18 1994/12/20 09:45:03 Gussmann
+% *** empty log message ***
+%
+% Revision 1.17 1994/12/14 19:25:07 Gussmann
+% \cs\envname can't being used in headlines.
+%
+% Revision 1.16 1994/12/14 18:25:36 Gussmann
+% * Errors removed: - Definition of \concern contains \newbox command!
+% \newbox moved outside.
+% - Equation numbers not reset at the end of a letter.
+% (Fixed)
+% * Still more documentation added and some (a lot of) errors corrected.
+% * Test for equation added.
+%
+% Revision 1.15 1994/12/14 14:18:44 Braune
+% *** empty log message ***
+%
+% Revision 1.14 1994/12/09 14:56:53 Gussmann
+% 10pt option removed from files dinbrief.tex and test10.tex
+% in the \cmd\documentstyle-command.
+%
+% Revision 1.13 1994/12/09 14:26:08 Gussmann
+% Documentation changed (only some little layout questions).
+% Layout of documenation file dinbrief.tex is still unsatisfied.
+%
+% Revision 1.12 1994/12/09 13:24:53 Gussmann
+% I've forgotten to include description of \cmd\closing{}.
+% I deleted some doubbled explanations.
+%
+% Revision 1.11 1994/12/08 12:42:15 Gussmann
+% Documentation finished.
+% First public release.
+%
+% Revision 1.10 1994/12/02 02:59:21 Gussmann
+% Documentation completed.
+%
+% Revision 1.9 1994/11/17 03:11:56 Gussmann
+% Error corrected within the documentation.
+%
+% Revision 1.8 1994/11/17 02:44:47 Gussmann
+% - More documentation added.
+% - Errors corrected:
+% * \verb|\bottomtext| works only with the first letter in a
+% file. Fixed. \verb|\unhbox| changed to \verb|\unhcopy|.
+% * Fixed some errors in the documentation.
+% - Test suite extended.
+%
+% Revision 1.7 1994/11/16 22:03:58 Gussmann
+% Documentation has been updated and corrected.
+%
+% Revision 1.6 1994/11/16 19:26:52 Gussmann
+% The document starts now with the user guide.
+%
+% Revision 1.5 1994/11/16 19:25:04 Gussmann
+% *** empty log message ***
+%
+% Revision 1.4 1994/11/16 19:21:20 Gussmann
+% *** empty log message ***
+%
+% Revision 1.3 1994/11/16 19:17:38 Gussmann
+% *** empty log message ***
+%
+% Revision 1.2 1994/11/16 19:08:08 Gussmann
+% *** empty log message ***
+%
+% Revision 1.1 1994/11/16 23:37:01 Gussmann
+% Initial revision (rcs introduced)
+%
+% =======================================================================
+%
+% Copyright (C) 1993, 96, 97 by University of Karlsruhe (Computing Center).
+% Copyright (C) 1998, 2000 by University of Karlsruhe (Computing Center)
+% and Richard Gussmann.
+% All rights reserved.
+% For additional copyright information see further down in this file.
+%
+% This file is part of the DINBRIEF package
+% -----------------------------------------------------------------------
+%
+% It may be distributed under the terms of the LaTeX Project Public
+% License (LPPL), as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.1 or, at your option, any later version.
+%
+% The latest version of this license is in
+%
+% http://www.latex-project.org/lppl.txt
+%
+% LPPL Version 1.1 or later is part of all distributions of LaTeX
+% version 1999/06/01 or later.
+%
+%
+% For error reports in case of UNCHANGED versions see readme files.
+%
+% Please do not request updates from us directly. Distribution is
+% done through Mail-Servers, TeX organizations and others.
+%
+% If you receive only some of these files from someone, complain!
+%
+% \fi
+%
+% \CheckSum{5317}
+%%
+%% \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 \~}
+%%
+% \changes{1.70.1}{2000/01/10}{(KB) Inserted commands for \LaTeXe\ packages
+% and document options}
+% \setcounter{StandardModuleDepth}{1}
+% \newcommand\Dopt[1]{\texttt {#1}}
+% \newcommand\Lopt[1]{\textsf {#1}}
+% \newcommand\Lpkg[1]{\textsf {#1}}
+% \newcommand\file[1]{\texttt {#1}}
+% \newcommand\Lcount[1]{\textsl {\small#1}}
+% \newcommand\pstyle[1]{\textsl {#1}}
+%
+%
+% \title{Standard Document Class `dinbrief'\\ for \LaTeX{} version 2e\\
+% Standard Document Style `dinbrief'\\ for \LaTeX{} version 2.09}
+%
+% \author{%
+% Copyright \copyright\ 1993,\ 94,\ 95,\ 96,\ 98,\ 2000\\
+% by Klaus Dieter Braune, Richard Gussmann
+% }
+%
+% \maketitle
+%
+% \begin{abstract}
+% This document serves as User's Guide and as documentation of the new
+% \LaTeX-Style or a \LaTeXe-Class. This class/style implements
+% a new document layout for writing letters, according to the rules
+% of DIN (Deutsches Institut f\"ur Normung, German standardization
+% institute). The User's Guide is written in German, since we assume
+% the style is of minor interest outside Germany. Of course, most of
+% the macros are explained in English.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \iffalse
+%<*documentation|dintab>
+% \fi
+%
+% \iffalse
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[german]{article}
+ \typeout{Using the command \string\documentstyle.}
+ \newcommand\LaTeXe{\LaTeX\kern.15em2$_\varepsilon$}
+ \else
+ \documentclass[10pt]{article}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+
+\newcommand\Dopt[1]{{\tt #1\/}}
+\newcommand\file[1]{{\tt #1\/}}
+
+\title{Standard Document Class `dinbrief'\\ for \LaTeX{} version 2e\\
+ Standard Document Style `dinbrief'\\ for \LaTeX{} version 2.09}
+
+\author{%
+Copyright \copyright\ 1993,\ 96,\ 98\\ by Klaus Dieter Braune, Richard Gussmann
+}
+% \fi
+%
+\newenvironment{decl}%
+ {\par\small\addvspace{4.5ex plus 1ex}%
+ \vskip -\parskip
+ \noindent\hspace{-\leftmargini}%
+ \begin{tabular}{|l|}\hline\ignorespaces}%
+ {\\\hline\end{tabular}\par\nopagebreak\addvspace{2.3ex}%
+ \vskip -\parskip}
+%
+\newcommand{\declline}[1]{\\\multicolumn1{|r|}{\small#1}}
+%
+\newcommand{\m}[1]{\mbox{$\langle$\emph{#1}$\rangle$}}
+%
+\renewcommand{\arg}[1]{{\tt\string{}\m{#1}{\tt\string}}}
+%
+\expandafter\ifx\csname oarg\endcsname\relax
+ \newcommand{\oarg}[1]{{\tt[}\m{#1}{\tt]}}
+\fi
+%
+\makeatletter
+\expandafter\ifx\csname cmd\endcsname\relax
+ \def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
+\fi
+%
+\expandafter\ifx\csname cmd@to@cs\endcsname\relax
+\def\cmd@to@cs#1#2{\char\number`#2\relax}
+\fi
+\makeatother
+%
+\expandafter\ifx\csname cs\endcsname\relax
+\def\cs#1{{\tt\char`\\#1}}
+\fi
+%
+\newcommand{\env}[2]{\cmd{#1}{\protect\tt\char`\{#2\char`\}}}
+\newcommand{\envname}[1]{{\protect\tt#1}}
+%
+\germanTeX
+%
+\expandafter\ifx\csname emph\endcsname\relax
+ \newcommand\emph[1]{{\em#1\/}}% This is \emph{not} the LaTeX2e
+ % definition!
+\fi
+
+% \iffalse
+\begin{document}
+\maketitle
+% \fi
+%
+% \iffalse
+%</documentation|dintab>
+% \fi
+% \iffalse
+%<*documentation>
+% \fi
+%
+\renewcommand{\textfraction}{0.10}
+\renewcommand{\topfraction}{0.65}
+\renewcommand{\bottomfraction}{0.85}
+%
+\expandafter\ifx\csname sect\endcsname\relax
+ \let\sect=\section
+\fi
+\expandafter\ifx\csname ssect\endcsname\relax
+ \let\ssect=\subsection
+\fi
+\expandafter\ifx\csname sssect\endcsname\relax
+ \let\sssect=\subsubsection
+\fi
+%
+\sect{Benutzerhandbuch (User's Guide)}
+%
+
+Mit \LaTeX\ k"onnen (nat"urlich) auch Briefe geschrieben werden.
+F"ur englische Briefe gibt es die Dokumentklasse \envname{letter}.
+Deutsche Briefe k"onnen mit der Klasse \envname{dinbrief}
+geschrieben werden.
+
+Die vorliegende Klasse \envname{dinbrief} basiert auf dem
+\envname{dinbrief}-Stil der Universit"at Karlsruhe. Dieser
+Stil wurde aus \envname{dletter.sty} entwickelt, welcher
+von D.~Heinrich abgefa"st wurde. Seinerseits geht dieser
+zur"uck auf den Stil \envname{a4letter} von H.~Partl, welcher
+seinen Ursprung im urspr"unglichen \envname{letter}-Stil
+von L.~Lamport hatte. Zus"atzlich wurden aus den \envname{dinbrief.sty}
+von R.~Sengerling der Befehlsvorrat und die Option \Dopt{norm}
+"ubernommen. Ferner enth"alt diese Klasse Tips und Anregungen von
+B.~Raichle.
+
+In den Briefen k"onnen u.a.\ Formeln,
+Tabellen und beliebige Listen verwendet werden.
+In einem Dokument k"onnen mehrere Briefe geschrieben werden.
+Die Gliederung in Abs"atze erfolgt durch Einf"ugen einer
+Leerzeile (wie in \LaTeX\ "ublich).
+
+\sect{Zus"atzliche Optionen der {\protect\tt dinbrief}-Klasse}%
+\index{Briefe>Optionen}\index{Optionen der dinbrief-Klasse=Optionen der \envname{dinbrief}-Klasse}
+
+In der DIN Norm~676 werden zwei Formen von Briefen festgelegt.
+In "alteren Versionen dieses Paketes wurde nur diejenige Form unterst"utzt,
+in der oben ein Rand von 45mm f"ur den Briefkopf freigelassen wird.
+In der zweiten Version ist dieser Rand auf 27mm verk"urzt; damit steht f"ur
+den Brieftext mehr Platz (18mm) zur Verf"ugung.
+
+Die Wahl der gew"unschten Form kann durch Angabe der Optionen \Dopt{addresshigh}
+f"ur einen oberen Rand von 27mm oder \Dopt{addressstd} f"ur einen oberen Rand
+von 45mm getroffen werden.
+Die Angabe der Option \Dopt{addressstd} kann unterbleiben, da sie ohnehin
+voreingestellt ist.
+
+\sect{Befehle in der {\protect\tt dinbrief}-Klasse}%
+\index{Briefe>DIN 676}\index{DIN-Brief}\index{Briefe>dinbrief=\envname{dinbrief}}
+
+Bereits vor \env\begin{document} kann man Angaben machen, die f"ur
+alle Briefe g"ultig sind, z.B.\ {\bf Absender\/} (\cs{address}
+bzw.\ \cs{backaddress}), {\bf Absendeort\/} (\cs{place}),
+{\bf Telefon\/} (\cs{phone}) und {\bf Unterschrift\/} (\cs{signature}).
+
+\ssect{Aus der {\protect\tt letter}-Klasse "ubernommene Befehle}
+
+Jeder Brief steht in einer eigenen \envname{letter}-Umgebung.
+Der Empf"anger wird als Argument des
+\env\begin{letter}-Befehls angegeben
+(\env\begin{letter}\arg{Anschrift}).
+
+Eine entscheidende Bedeutung beim Schreiben von Briefen
+hat der \cs{opening}-Befehl. Nur dieser Befehl setzt
+den Briefkopf, die Absenderangaben und die Adresse des
+Empf"angers. Die {\bf Anrede des Empf"angers\/} wird als
+Argument angegeben (\cmd\opening\arg{Anrede}).
+
+Danach folgt der eigentliche Brieftext. Die abschlie"sende
+{\bf Gru"sformel\/} wird mit dem Befehl \cmd\closing\arg{Gru"sformel}
+gesetzt. Dieser Befehl f"ugt auch die maschinenschriftliche
+Wiederholung der Unterschrift an, wie sie mit dem
+\cs{signature}-Befehl festgelegt wurde.
+Die erweiterte Form \cmd\closing\oarg{Unterschrift}\arg{Gru"sformel}
+erm"oglicht es, die Unterschrift unter den Brief als Text oder Graphik
+einzubinden.
+
+Im Anschlu"s an die Gru"sformel werden {\bf Anlagen-\/}
+(\cmd\encl\arg{Anlage}), {\bf Verteilvermerke\/}
+(\cmd\cc\arg{Verteiler}) und das {\bf Postscriptum\/}
+(\cmd\ps\arg{Postscriptum}) an den Brief angef"ugt.
+
+Mit dem Befehl \cs{makelabels} (vor \env\begin{document})
+werden zus"atzlich {\bf Adre"s-Etiketten\/} erzeugt.
+
+Dar"uberhinaus wurden die oben erw"ahnten Befehle
+\cs{address}, \cs{place} und \cs{signature} aus
+der \envname{letter}-Klasse "ubernommen.
+
+\begin{figure}[p]
+\begin{center}
+{\small
+\begin{verbatim}
+\documentclass[12pt]{dinbrief}
+\usepackage{german}
+
+\address{R"udiger Kurz\\
+ Am See 1\\
+ 76133 Karlsruhe}
+\backaddress{R. Kurz, Am See 1, 76133 Karslruhe}
+
+\signature{R"udiger Kurz}
+\place{Karlsruhe}
+
+\begin{document}
+\phone{0721}{222222}
+\begin{letter}{Deutsche Bundespost\\
+ Fernmeldeamt Karlsruhe\\
+ Postfach 7300\\[\medskipamount]
+ {\bf 76131 Karlsruhe}}
+
+\yourmail{01.04.93}
+\sign{123456}
+\subject{Betrieb eines Mikrowellensenders}
+
+\opening{Sehr geehrte Damen und Herren,}
+
+anbei sende ich Ihnen eine Kopie der bisherigen Genehmigung f"ur
+unseren Mikrowellenherd...
+
+... Ihre Bem"uhungen im voraus vielen Dank.
+
+\closing{Mit freundlichen Gr"u"sen,}
+
+\ps{Wir bitten um schnelle Erledigung.}
+\cc{Deutsche Bundespost\\
+ Karlsruher Privatfunk \\
+ S"uddeutscher Rundfunk}
+
+\encl{Abschrift der Urkunde}
+
+\end{letter}
+\end{document}
+\end{verbatim}}
+\caption{Brief mit \LaTeX.}\label{brief}
+\end{center}
+\end{figure}
+
+\ssect{Zus"atzliche Befehle im DIN-Brief}
+
+Der Befehl \cmd\phone\arg{Vorwahl}\arg{Rufnummer/Durchwahl}
+legt die {\bf Telefonnummer\/} des Absenders fest.
+Sie wird in der Bezugszeichenzeile ausgegeben.
+
+Der {\bf Bezug\/} auf einen empfangenen Brief ist m"oglich
+mit Hilfe des Befehls
+\cmd\yourmail\arg{Ihre Zeichen, Ihre Nachricht vom}.
+
+Mit dem Befehl \cmd\sign\arg{Unsere Zeichen, unsere Nachricht vom}
+kann eine {\bf eigene Kennzeichnung\/} des Briefes angegeben werden.
+
+Mit dem Befehl \cmd\writer\arg{Sachbearbeiter} kann
+der {\bf Name des Sachbearbeiters\/} festgelegt werden.
+
+Die Bezugszeichenzeile wird nur gesetzt, falls einer der
+Befehle \cs{yourmail}, \cs{sign} oder \cs{writer} verwendet
+wird. Der Befehl \cs{writer} schaltet zus"atzlich auf das
+in der DIN Norm~676 (Entwurf Mai~1991) festgelegte Layout um.
+
+Der {\bf Betreff (die stichwortartige Inhaltsangabe)\/} des
+Briefes wird durch den Befehl \cs{subject}\arg{Betreff}
+angegeben. Mit \cs{backaddress} wird die Adresse festgelegt,
+die als {\bf Absenderadresse im Brief\kern0pt fenster}
+eingeblendet wird.
+
+Abbildung~\ref{brief} enth"alt ein Beispiel f"ur einen Brief.
+Die Anwendung der Befehle und ihre Reihenfolge in der Quelldatei
+kann dem Beispiel entnommen werden.
+
+F"ur alle, denen das "`Fenster"' um die Adresse nicht gef"allt,
+besteht die M"oglichkeit, durch Angabe von
+\cmd\nowindowrules\index{nowindowrules=\verb+\nowindowrules+}
+vor dem Befehl \cmd\opening\ dieses abzuschalten.
+Durch \cmd\windowrules\index{windowrules=\verb+\windowrules+} l"a"st es
+sich wieder aktivieren.
+
+Der Trennstrich zwischen der R"ucksendeadresse und der Anschrift im
+Anschriftenfeld kann mit dem Befehl
+\cmd\nobackaddressrule\index{nobackaddressrule=\verb+\nobackaddressrule+}
+unterdr"uckt und bei folgenden Briefen mit
+\cmd\backaddressrule\index{backaddressrule=\verb+\backaddressrule+} wieder
+aktiviert werden.
+
+Die Faltmarkierung am linken Blattrand wird durch den Befehl
+\cmd\nowindowtics\index{nowindowtics=\verb+\nowindowtics+} ab- und mit
+\cmd\windowtics\index{windowtics=\verb+\windowtics+} wieder angeschaltet.
+\medskip
+
+Die Ver"anderung des Layouts der Briefe ist mit Hilfe von insgesamt 13 Befehlen
+m"oglich.
+Um f"ur einen Brief wirksam zu werden, m"ussen diese Befehle {\em vor\/}
+dem Befehl \cmd\opening\ angegeben werden.
+Die ersten 9 dieser Befehle legen Gr"o"se und Position des Fensters f"ur die
+Anschrift und der Adresse des Absenders im Anschriften-Fenster fest.
+Die "ubrigen Befehle legen den Abstand der Oberkante der Bezugszeichenzeile,
+den Abstand der Oberkante des Bereiches f"ur Angaben zu Kapitalgesellschaften
+und die Abst"ande der Faltmarkierungen vom oberen Papierrand fest.
+Ein Befehl zur Festlegung der Lochmarkierung ist "ubrigens nicht vorgesehen,
+da die Lochmarkierung in die Mitte der Seite -- abh"angig vom Wert der L"ange
+\cmd\paperheight\ -- gesetzt wird.
+
+Der Befehl \cmd\setaddressllcorner\arg{L"angenangabe}\arg{L"angenangabe}\index{setaddressllcorner=\verb+\setaddressllcorner+}
+legt mit seinen beiden Argumenten die Position der linken {\em unteren\/} Ecke
+des Fensters bezogen auf die linke {\em obere\/} Ecke des Blattes fest: das
+erste den Abstand vom linken und das zweite den Anstand vom oberen Blattrand.
+Der Abstand des Fensters vom linken Rand -- ohne "Anderung des Abstandes vom
+oberen Rand -- kann mit dem Befehl
+\cmd\setaddressllhpos\arg{L"angenangabe}\index{setaddressllhpos=\verb+\setaddressllhpos+}
+festgelegt werden.
+Entsprechend legt der Befehl
+\cmd\setaddressllvpos\arg{L"angenangabe}\index{setaddressllvpos=\verb+\setaddressllvpos+}
+den Abstand des unteren Randes des Fensters vom oberen Blattrand fest.
+
+Zur Auswahl der zu verwendenden Variante der Briefform -- hochgestellte oder
+tiefer gestelltes Feld f"ur die Anschrift -- stehen die beiden Befehle
+\cmd\addresshigh\ (hochgestellte Anschrift) und \cmd\addressstd\
+(voreingestellte tiefer gestellte Anschrift) zur Verf"ugung.
+Beide Befehle sind nur wirksam, wenn sie {\em vor\/} dem \cmd\opening-Befehl
+angegeben werden.
+Gegebenenfalls k"onnen sie auch -- wie viele anderen Befehle -- in der
+Konfigurationsdatei verwendet werden.
+
+Auch zur Festlegung der H"ohe und Breite des Fensters f"ur die Anschrift sind
+Befehle vorgesehen.
+Der Befehl \cmd\setaddresswidth\arg{L"angenangabe}\index{setaddresswidth=\verb+\setaddresswidth+}
+setzt die Breite des Fensters auf die angegebene L"ange.
+Entsprechend legt der Befehl
+\cmd\setaddressheight\arg{L"angenangabe}\index{setaddressheight=\verb+\setaddressheight+}
+die H"ohe des Fensters fest (ohne das direkt dar"uber angeordnete Feld f"ur
+den Absender).
+
+In der Regel m"ochte man den Text der Anschrift nicht direkt am linken Rand
+beginnen lassen -- wie auch in diesem Paket voreingstellt.
+Mit dem Befehl \cmd\setaddressoffset\arg{L"angenangabe}\index{setaddressoffset=\verb+\setaddressoffset+}
+kann man diese Einr"uckung selbst festlegen.
+Der Text der Anschrift wird "ubrigens nicht abgeschnitten und kann daher
+gegebenenfalls "uber den rechten Rand des Fensters hinausragen -- bitte
+brechen Sie in diesem Fall zu lange Zeilen an einer geigneten Stelle selbst
+um.
+
+Die H"ohe des Feldes f"ur den Absender direkt oben anschlie"send an das
+Feld f"ur die Anschrift kann mit dem Befehl
+\cmd\setbackaddressheight\arg{L"angenangabe}\index{setbackaddressheight=\verb+\setbackaddressheight+}
+festgelegt werden.
+
+Werden der DIN Norm entsprechende Fensterumschl"age verwendet, sollten die
+Voreinstellungen f"ur Gr"o"se und Position des Fensters f"ur die Anschrift
+und den Absender nicht ver"andert werden, damit sie im Fenster sichtbar sind.
+
+Der Befehl \cmd\setreflinetop\arg{L"angenangabe}\index{setreflinetop=\verb+\setreflinetop+}
+legt den Abstand der Oberkante der Bezugszeichenzeile vom oberen Papierrand
+fest; bei den beiden Formen der DIN Norm liegt diese Oberkante 8.5mm unterhalb
+des Fensters f"ur die Anschrift.
+
+Am Ende der ersten Seite von Briefen ist ein Feld f"ur Angaben zu
+Kapitalgesellschaften vorgesehen, das man bei eigenen Briefen gegebenenfalls
+zur Angabe des eigenen Kontos verwenden kann.
+Die Formbl"atter der Norm sehen f"ur dieses Feld nur die letzten 16mm des
+Papiers vor.
+Ben"otigt man mehr Platz f"ur Angaben in diesem Feld, kann man mit dem Befehl
+\cmd\setbottomtexttop\arg{L"angenangabe}\index{setbottomtexttop=\verb+\setbottomtexttop+}
+die Oberkante des Feldes geeignet festlegen.
+Der f"ur den Brieftext zur Verf"ugung stehende Platz wird automatisch
+angepa"st.
+
+Im Zusammenhang mit einer Verschiebung des Fensters f"ur die Anschrift
+m"ussen gegebenenfalls die Faltmarkierungen angepa"st werden.
+Den Abstand der oberen Faltmarkierung vom oberen Blattrand legt man mit dem
+Befehl \cmd\setupperfoldmarkvpos\arg{L"angenangabe}\index{setupperfoldmarkvpos=\verb+\setupperfoldmarkvpos+}
+fest, den der unteren Faltmarkierung entsprechend mit dem Befehl
+\cmd\setlowerfoldmarkvpos\arg{L"angenangabe}\index{setlowerfoldmarkvpos=\verb+\setlowerfoldmarkvpos+}.
+Die H"ohe der Markierung zum Lochen (in der Blattmitte) ergibt sich automatisch
+aus der Blatth"ohe und kann nicht ver"andert werden.
+\medskip
+
+% \iffalse
+% Die Gr"o"se und Form von Adre"s-Etiketten kann mit den Befehlen
+% \cmd\setlabelwidth\arg{Breite}\ und \cmd\setlabelheight\arg{H"ohe}\
+% festgelegt werden. Die Anzahl der Labels in einer Spalte wird durch
+% \cmd\setlabelnumber{Anzahl} angegeben. Der obere Rand kann mit dem
+% Befehl \cmd\setlabeltopmargin{H"ohe} eingestellt werden. Mit
+% \cmd\spare{Anzahl} k"onnen am Anfang {\sl Anzahl\/} Labels frei
+% gelassen werden.
+% \fi
+Ausf"uhrungen und Erl"auterungen zum Erstellen von Adre"s-Etiketten
+finden Sie in einem eigenen Abschnitt weiter hinten in diesem Dokument.
+Die Befehlsreferenz enth"alt ebenfalls kurze Beschreibungen der
+Befehle zu den Adre"s-Etiketten.
+
+Eine einfache Absenderanschrift in der auf Schreibmaschinen "ublichen
+Form (DIN~5008) wird durch den Befehl \cmd\stdaddress\arg{Absenderanschrift}
+anstelle von \cmd\address{} erreicht. Die einzelnen Zeilen sind durch
+\verb.\\. zu trennen. Das Datum wird ebenfalls oben ausgegeben.
+Die Bezugszeichenzeile entf"allt.
+
+Mit dem Befehl \cmd\postremark\ kann ein Postvermerk gesetzt werden.
+Dieser Vermerk erscheint im Anschriftenfeld oben, von den "ubrigen
+im Argument des Befehls \env\begin{letter}\arg{Anschrift} durch eine
+Leerzeile getrennt. Der Behandlungsvermerk wird durch den
+Befehl \cmd\handling\arg{Text}\ vereinbart.
+
+Die Anlagen- und Verteilvermerke k"onnen mit dem Befehl \cmd\enclright\
+rechts auf Grad~50 anstelle nach der Gru"sformel ausgegeben werden.
+Die Befehle \cmd\encl\ und \cmd\cc\ sind dazu vor dem \cmd\closing-Befehl
+anzugeben.
+
+\ssect{Befehlsreferenz}
+
+\begin{description}
+ \item[\env\begin{letter}\arg{{Anschrift}} \dots\ \env\end{letter}] \hfil\break
+ Diese Befehle rahmen jeden einzelnen Brief ein. Die
+ Anschrift des Em\-pf"an\-gers wird als Argument des Befehls
+ \env\begin{letter}\arg{Anschrift} angegeben.
+ Die einzelnen Zeilen in der Anschrift werden durch
+ \cmd\\ getrennt.
+ Es d"urfen weitere Briefe folgen.
+
+ \item[\cmd\signature\arg{Unterschrift des Absenders}] \hfil\break
+ Dieser Befehl legt die maschinenschriftliche
+ Wiederholung der Unterschrift fest.
+ Der Befehl gilt solange, bis ein weiterer
+ \cmd\signature-Befehl eine neue "`Unterschrift"'
+ festlegt.
+
+ \item[\cmd\address\arg{{Name und Adresse des Absenders}}] \hfil\break
+ Die Adresse des Absenders wird vereinbart.
+ Dieser Befehl gilt f"ur den laufenden und alle
+ weiteren Briefe; er gilt solange, bis ein
+ weiterer \cmd\address-Befehl angegeben wird.
+
+ \item[\cmd\backaddress\arg{{Absenderadresse im Brief\kern 0pt fenster}}] \hfil\break
+ Der Befehl legt die Anschrift des Absenders oben im
+ Anschriftenfeld des Briefs fest.
+
+ \item[\cmd\place\arg{{Ortsangabe im Brief}}] \hfil\break
+ Mit diesem Befehl wird der Absendeort angegeben, der
+ zusammen mit dem Datum im Briefkopf ausgegeben wird.
+
+ \item[\cmd\date\arg{{Briefdatum}}] \hfil\break
+ Soll als Absendedatum {\sl nicht\/} das aktuelle
+ Tagesdatum (des Rechners) eingesetzt werden,
+ kann mit diesem Befehl das Datum
+ explizit angegeben werden.
+
+ Ohne diesen Befehl wird das aktuelle Tagesdatum
+ im Brief verwendet.
+
+ \item[\cmd\yourmail\arg{{Ihre Zeichen, Ihre Nachricht vom}}] \hfil\break
+ Der Befehl legt den Inhalt des Feldes {\bf Ihre
+ Zeichen, Ihre Nachricht vom\/} in der
+ Bezugszeichenzeile fest.
+
+ \item[\cmd\sign\arg{{Unsere Zeichen (, unsere Nachricht vom)}}] \hfil\break
+ Dieser Befehl legt den Inhalt des Feldes
+ {\bf Unsere Zeichen \dots\/} fest.
+
+ \item[\cmd\phone\arg{{Vorwahl}}\arg{{Rufnummer/Durchwahl}}] \hfil\break
+ Die Telefonnummer aufgeteilt nach Vorwahl und Rufnummer oder
+ Durchwahl wird mit dem Befehl \cmd\phone{} vereinbart. Diese
+ Angaben werden in der Bezugszeichenzeile ausgegeben.
+
+ \item[\cmd\writer\arg{{Sachbearbeiter}}] \hfil\break
+ Die Neufassung der Norm DIN~676 vom Mai 1991 sieht in
+ der Bezugszeichenzeile ein weiteres Feld f"ur den
+ Sachbearbeiter vor. Mit dem Befehl \cmd\writer{}
+ kann ein solcher Sachbearbeiter angegeben werden.
+
+ {\sl Die Verwendung dieses Befehls gestaltet den Brief
+ entsprechend der Norm DIN~676 vom Mai 1991.\/}
+
+ \item[\cmd\subject\arg{{Betreff}}] \hfil\break
+ Mit diesem Befehl wird der Betreff gesetzt, der den
+ Empf"anger "uber den Gegenstand des Briefes
+ informiert.
+
+ \cmd\concern{} steht aus historischen Gr"unden
+ als Synonym bis auf weiteres zur Verf"ugung.
+
+ \item[\cmd\centeraddress] \hfil\break
+ Die Empf"angeranschrift wird im Brief\kern 0pt fenster
+ vertikal zentriert.
+
+ \item[\cmd\normaladdress] \hfil\break
+ Die Empf"angeranschrift wird im Anschriftenfeld unten gesetzt.
+
+ \item[\cmd\opening\arg{{Anrede}}] \hfil\break
+ Dieser Befehl vereinbart die Anrede des Empf"angers und setzt
+ den Briefkopf, die Empf"angerangaben, eine eventuell vorhandene
+ Bezugszeichenzeile, den Betreff und die Anrede des Empf"angers.
+
+ {\bf Dieser Befehl darf nicht fehlen!\/}
+
+ \item[\cmd\closing\oarg{Unterschrift}\arg{{Gru"sformel}}] \hfil\break
+ Der Befehl \cmd\closing{} setzt die Gru"sformel und nach
+ drei Leerzeilen die maschinenschrifliche Wiederholung
+ der Unterschrift.
+
+ Die erweiterte Form \cmd\closing\oarg{Unterschrift}\arg{Gru"sformel}
+ setzt zus"atzlich das optionale Argument -- beispielsweise eine mit
+ \cmd\includegraphics\ eingebundene PostScript-Datei -- als
+ Unterschrift in die freigelassenen Zeilen.
+ "Uberschreitet die H"ohe des optionalen Argumentes zwei Zeilen,
+ rutscht die maschinenschrifliche Wiederholung der Unterschrift
+ entsprechend nach unten.
+ Bitte beachten Sie, da"s ein optionales Argument eckige Klammern nur
+ enthalten darf, wenn das optionale Argument selbst in geschweifte
+ Klammern eingeschlossen ist.
+
+ \item[\cmd\encl\arg{{Anlagen}}] \hfil\break
+ Der Vermerk "uber dem Brief beigef"ugte Anlagen
+ wird mit dem Befehl \cmd\encl{} an den Brief
+ angeh"angt. Die einzelnen Eintragungen k"onnen
+ durch \cmd\\{} getrennt werden.
+
+ Die Reihenfolge der Verwendung der Befehle
+ \cmd\encl, \cmd\cc{} und \cmd\ps{} ist beliebig,
+ falls die Befehle nach dem \cmd\closing-Befehl
+ angegeben werden. Die Norm empfiehlt allerdings
+ den Anlagenvermerk vor dem Verteilvermerk
+ anzubringen.
+
+ \item[\cmd\cc\arg{{Verteiler}}] \hfil\break
+ Der Vermerk "uber weitere Empf"anger dieses Briefes wird
+ mit dem Befehl \cmd\cc{} gesetzt. Die einzelnen Eintragungen
+ k"onnen durch \cmd\\ getrennt werden.
+
+ Die Befehle \cmd\encl{} und \cmd\cc{} k"onnen sowohl
+ vor wie auch nach dem \cmd\closing-Befehl stehen. Wird
+ der Befehl \cmd\enclright{} verwendet, m"ussen die beiden
+ Befehle vor dem \cmd\closing-Befehl stehen.
+
+ \item[\cmd\ps\arg{{Postscriptum}}] \hfil\break
+ Gesch"aftsbriefe enthalten kein Postskriptum.
+ Es wurde trotzdem die M"og\-lich\-keit geschaffen,
+ ein solches zu verwenden. Mit dem Befehl
+ \cmd\ps{} wird ein Postskriptum gesetzt.
+
+ \item[\cmd\makelabels] \hfil\break
+ Dieser Befehl mu"s in der Pr"aambel stehen; also
+ zwischen \cmd\documentstyle{} oder \cmd\documentclass{}
+ und dem \env\begin{document}-Befehl.
+ Er aktiviert das Ausdrucken von Adress-Etiketten.
+
+ \item[\cmd\labelstyle\arg{{Stil der Label}}] \hfil\break
+ Dieser Befehl vereinbart das Layout der
+ Adress-Etiketten. Es gibt Drucker, die in der
+ Lage sind, Briefumschl"age zu bedrucken. Mit diesem
+ Befehl legt man die Form der Briefumschl"age fest.
+
+ {\sl Zur Zeit steht nur das Layout \env\labelstyle{plain}
+ zur Verf"ugung.\/}
+
+ \item[\cmd\bottomtext\arg{{Feld f\"ur Kapitalgesellschaften}}] \hfil\break
+ Am Fu"s der ersten Briefseite werden Gesch"aftsangaben und
+ zus"atzlich bei Kapitalgesellschaften gesellschaftsrechtliche
+ Angaben angegeben. Der Befehl \cmd\bottomtext{} vereinbart
+ diese Angaben.
+
+% {\sl Dieser Befehl mu"s nach \env\begin{document}{} stehen.\/}
+
+ \item[\cmd\windowrules] \hfil\break
+ Das Anschriftenfeld im Brief wird durch Linien ober-
+ und unterhalb vom "ubrigen Brief abgegrenzt.
+ Die Hervorhebung wird aktiviert.
+
+ \item[\cmd\nowindowrules] \hfil\break
+ Der Befehl schaltet den Rahmen ab.
+
+ \item[\cmd\backaddressrule] \hfil\break
+ Der Absender und die Anschrift im Anschriftenfeld des Briefes werden
+ durch eine Linie getrennt (Voreinstellung).
+
+ \item[\cmd\nobackaddressrule] \hfil\break
+ Die Trennungslinie zwischen dem Absender und der Anschrift im
+ Anschriftenfeld des Briefes wird unterdr"uckt.
+
+ \item[\cmd\windowtics] \hfil\break
+ Es werden Faltmarkierungen am linken Briefrand
+ geruckt.
+
+ \item[\cmd\nowindowtics] \hfil\break
+ Es werden keine Faltmarkierungen am linken Briefrand
+ ausgedruckt.
+
+ \item[\cmd\disabledraftstandard] \hfil\break
+ Der Brief wird entsprechend den
+ Vorschriften der Norm DIN~676 vom Dezember 1976 auf
+ dem Briefbogen ausgegeben.
+
+ \item[\cmd\enabledraftstandard] \hfil\break
+ Der Brief wird entsprechend den
+ Vorschriften des Entwurfs der Norm DIN~676 vom
+ Mai~1991 auf dem Briefbogen ausgegeben.
+
+ \item[\cmd\setaddressllcorner\arg{Abstand vom linken Rand}%
+ \arg{Abstand vom oberen Rand}] \hfil\break
+ Mit diesem Befehl legt man die Position der linken unteren Ecke
+ des Fensters f"ur die Anschrift des Empf"angers fest.
+ Beide Argumente sind L"angen, wobei die erste den (horizontalen)
+ Abstand zum linken Blattrand und die zweite den (vertikalen)
+ Abstand zum oberen Blattrand angibt.
+
+ \item[\cmd\setaddressllhpos\arg{Abstand vom linken Rand}] \hfil\break
+ Der Befehle legt den (horizontalen) Abstand des Fensters f"ur die
+ Anschrift vom linken Blattrand fest.
+ Soll gleichzeitig die H"ohe des Fensters ge"andert werden, kann der
+ Befehle \cmd\setaddressllcorner\ verwendet werden.
+
+ In der DIN Norm ist der Abstand vom linken Rand fest als 20mm
+ vorgegeben (dieser Wert ist voreingestellt).
+
+ \item[\cmd\setaddressllvpos\arg{Abstand vom oberen Rand}] \hfil\break
+ Der Befehl legt den (vertikalen) Abstand des Fensters f"ur die
+ Anschrift vom oberen Blattrand fest.
+ Soll das Fenster gleichzeitig horizontal verschoben werden, kann der
+ Befehle \cmd\setaddressllcorner\ verwendet werden.
+
+ Die DIN Norm sieht zwei Varianten mit einer hochgestellten und einer
+ tiefer gestellten Anschrift vor.
+ Voreingestellt ist die tiefer gestellte Variante mit einem Wert von
+ 90mm.
+ F"ur die hochgestellte Variante ist der Wert 72mm vorgeschrieben.
+
+ Zur einfachen Auswahl der Varianten stehen die beiden Optionen
+ \Dopt{addresshigh} (hochgestellte Anschrift) und \Dopt{addressstd}
+ (voreingestellte tiefer gestellte Anschrift) vorgesehen.
+
+ \item[\cmd\addresshigh] \hfil\break
+ Dieser Befehl setzt die L"angen \verb|\addrvpos|, \verb|\reflinevpos|,
+ \verb|\ufldmarkvpos| und \verb|\lfldmarkvpos| entsprechend der Variante
+ mit hochgestelltem Feld f"ur die Anschrift entsprechend der Form~A der
+ DIN Norm.
+ Der Befehl ist nur wirksam, wenn er {\em vor\/} dem
+ \cmd\opening-Befehl steht (auch in der Konfigurationsdatei).
+
+ \item[\cmd\addressstd] \hfil\break
+ Der Befehl setzt die L"angen \verb|\addrvpos|, \verb|\reflinevpos|,
+ \verb|\ufldmarkvpos| und \verb|\lfldmarkvpos| entsprechend der Variante mit
+ tiefer gestelltem Feld f"ur die Anschrift entsprechend der Form~B der
+ DIN Norm und entspricht der Voreinstellung.
+ Der Befehl ist ebenfalls nur {\em vor\/} dem \cmd\opening-Befehl
+ wirksam (auch in der Konfigurationsdatei).
+
+ \item[\cmd\setaddresswidth\arg{Breite des Fensters f"ur die Anschrift}]
+ \hfil\break
+ Mit diesem Befehl wird die Breite des Fensters f"ur die Anschrift
+ festgelegt (voreingestellt: 85mm).
+
+ \item[\cmd\setaddressheight\arg{H"ohe des Fensters f"ur die Anschrift}]
+ \hfil\break
+ Die H"ohe des Fensters f"ur die Anschrift kann man mit diesem Befehl
+ festlegen. Voreingestellt sind 40mm.
+
+ \item[\cmd\setaddressoffset\arg{Abstand vom linken Fensterrand}] \hfil\break
+ In der Regel m"ochte man, da"s die Anschrift nicht direkt am linken
+ Rand des Fensters f"ur die Anschrift beginnt, sondern einige
+ Millimeter einger"uckt ist.
+ Mit diesem Befehl kann man die Einr"uckung festlegen.
+ Voreingestellt sind 4mm.
+ Die Anschrift beginnt bei dieser Einstellung b"undig mit dem
+ Text des Briefes.
+
+ \item[\cmd\setbackaddressheight\arg{H"ohe des Feldes f"ur den Absender}]
+ \hfil\break
+ Das Feld f"ur den Absender schlie"st oben an das Fensters f"ur die
+ Anschrift an. Die H"ohe dieses Feldes wird mit dem Befehl
+ \cmd\setbackaddressheight\ festgelegt. Voreingestellt sind 5mm.
+
+ \item[\cmd\setreflinetop\arg{Abstand vom oberen Rand}] \hfil\break
+ Mit diesem Befehl wird der Abstand der Oberkante der
+ Bezugszeichenzeile vom oberen Blattrand festgelegt.
+ Voreingestellt sind 98.5mm; bei Angabe der Option f"ur eine
+ hochgestellte Anschrift wird der Wert auf 80.5mm gesetzt.
+
+ \item[\cmd\setbottomtexttop\arg{Abstand vom oberen Rand}] \hfil\break
+ Mit diesem Befehl legt man den den Abstand der Oberkante des Feldes
+ f"ur Gesch"aftsangaben und (nur bei Kapitalgesellschaften)
+ gesellschaftsrechtliche Angaben auf der ersten Seite und dem oberen
+ Blattrand fest.
+ Voreingestellt sind 281mm; bei mehrzeiligen Angaben in diesem Fekd
+ mu"s man den Wert entsprechend verringern.
+ Der Abgleich mit der H"ohe der letzten verf"ugbaren Zeile auf der
+ Seite erfolgt automatisch.
+
+ \item[\cmd\setupperfoldmarkvpos\arg{Abstand vom oberen Rand}] \hfil\break
+ Mit diesem Befehl legt man den Abstand der \emph{oberen}
+ Faltmarkierung vom oberen Blattrand fest.
+ Voreingestellt sind 105mm und bei Angabe der Option f"ur eine
+ hochgestellte Anschrift 87mm.
+
+ \item[\cmd\setlowerfoldmarkvpos\arg{Abstand vom oberen Rand}] \hfil\break
+ Den Abstand der \emph{unteren} Faltmarkierung vom oberen Blattrand
+ legt man mit diesem Befehl fest.
+ Voreingestellt sind 210mm und bei Angabe der Option f"ur eine
+ hochgestellte Anschrift 192mm.
+
+ \item[\cmd\setlabelwidth\arg{Breite eines Labels}] \hfil\break
+ Dieser Befehl legt die Breite eines Labels fest.
+ Als Argument erwartet dieser Befehl eine L"angenangabe.
+
+ {\sl Die Labelbreite ist in der vorliegenden Version
+ auf 105~$mm$ festgelegt worden und sollte nicht
+ ge"andert werden. Dieser Befehl ist f"ur sp"atere
+ Erweiterungen reserviert.\/}
+
+ \item[\cmd\setlabelheight\arg{H"ohe eines Labels}] \hfil\break
+ Der Befehl \cmd\setlabelheight{} vereinbart die im
+ Argument angegebene L"ange als Labelh"ohe.
+
+ \item[\cmd\setlabeltopmargin\arg{oberer Rand}] \hfil\break
+ Bevor die beiden obersten Label (bei beiden Spalten)
+ ausgegeben werden, wird oben ein Rand gelassen, dessen
+ H"ohe mit \cmd\setlabeltopmargin{} angegeben wird.
+ Es wird eine L"angenangabe erwartet.
+
+ \item[\cmd\setlabelnumber\arg{Labelanzahl pro Spalte}] \hfil\break
+ Dieser Befehl bestimmt die Zahl der Labels in einer Spalte.
+
+ \item[\cmd\spare\arg{Anzahl leerer Labels}] \hfil\break
+ Es werden die im Argument des Befehls angegebene
+ Anzahl von Label freigelassen, bevor das erste
+ Adre"s--Etikett ausgegeben wird. Die Label werden
+ spaltenweise durchgez"ahlt.
+
+% \iffalse
+ \item[\cmd\offlabels] \hfil\break
+ \item[\cmd\onlabels] \hfil\break
+ \item[\cmd\nolabels] \hfil\break
+% \fi
+ \item[\cmd\stdaddress\arg{Adresse des Absenders}] \hfil\break
+ Dieser Befehl setzt die Absenderanschrift in der
+ auf Schreibmaschinen "ublichen Form (DIN 5008).
+ Mit diesem Befehl kann der Briefkopf nicht frei gestaltet
+ werden.
+
+ \item[\env\begin{dinquote} \dots\ \env\end{dinquote}] \hfil\break
+ Diese Umgebung r"uckt den Text auf der linken Seite um
+ ein Inch ein. Rechts folgt keine Einr"uckung.
+
+ \item[\cmd\enclright] \hfil\break
+ Die Anlagen- und Verteilvermerke beginnen, falls sie vor
+ den \cmd\closing-Befehl angegeben wurden, rechts
+ neben der Gru"sformel.
+
+ \item[\cmd\postremark\arg{Postvermerk}] \hfil\break
+ Der Postvermerk wird mit dem Befehl \cmd\postremark{}
+ vereinbart. Der Postvermerk geht der Empf"angeranschrift
+ mit einer Leerzeile voraus. Dieser Befehl mu"s zwischen
+ \env\begin{letter} und dem Befehl \cmd\opening\ stehen.
+
+ \item[\cmd\handling\arg{Behandlungsvermerk}] \hfil\break
+ Der Behandlungsvermerk wird rechts neben der
+ Empf"angeranschrift auf Grad 50 (bei einer 10er Teilung)
+ in H"ohe der letzten Zeile der Empf"angeranschrift
+ ausgegeben. Dieser Befehl mu"s zwischen
+ \env\begin{letter} und dem Befehl \cmd\opening\ stehen.
+\end{description}
+
+% \iffalse
+%</documentation>
+% \fi
+% \iffalse
+%<*documentation|dintab>
+% \fi
+
+\begin{table}[htp]
+\caption{Zusammenfassung der Dinbrief-Befehle (Teil 1):}\index{dinbrief>Befehle}
+
+\begin{center}
+\begin{tabular}{l}
+ \hline
+ \verb|\begin{document}| \\
+ \verb|\end{document}| \\
+ \hline
+ \verb|\begin{letter}|\arg{{Anschrift}} \\
+ \verb|\end{letter}| \\
+ \hline
+ \verb|\signature|\arg{Unterschrift des Absenders} \\
+ \verb|\address|\arg{{Name und Adresse des Absenders}} \\
+ \verb|\backaddress|\arg{{Absenderadresse im Brieffenster}} \\
+ \hline
+ \verb|\place|\arg{{Ortsangabe im Brief}} \\
+ \verb|\date|\arg{{Briefdatum}} \\
+ \verb|\yourmail|\arg{{Ihre Zeichen, Ihre Nachricht vom}} \\
+ \verb|\sign|\arg{{Unsere Zeichen (, unsere Nachricht vom)}} \\
+ \verb|\phone|\arg{{Vorwahl}}\arg{{Rufnummer/Durchwahl}} \\
+ \verb|\writer|\arg{{Sachbearbeiter}} \\
+ \hline
+ \verb|\subject|\arg{{Betreff}} \\
+ \verb|\concern|\arg{{Betreff}} \\
+ \verb|\opening|\arg{{Anrede}} \\
+ \verb|\closing|\oarg{Unterschrift}\arg{{Gru"sformel}} \\
+ \hline
+ \verb|\centeraddress| \\
+ \verb|\normaladdress| \\
+ \hline
+ \verb|\encl|\arg{{Anlagen}} \\
+ \verb|\ps|\arg{{Postscriptum}} \\
+ \verb|\cc|\arg{{Verteiler}} \\
+ \hline
+ \verb|\makelabels| \\
+ \verb|\labelstyle|\arg{{Stil der Label}} \\
+ \hline
+ \verb|\bottomtext|\arg{{Feld f\"ur Kapitalgesellschaften}}\\
+ \hline
+ \verb|\nowindowrules| \\
+ \verb|\windowrules| \\
+ \verb|\nobackaddressrule| \\
+ \verb|\backaddressrule| \\
+ \verb|\nowindowtics| \\
+ \verb|\windowtics| \\
+ \hline
+ \verb|\disabledraftstandard| \\
+ \verb|\enabledraftstandard| \\
+ \hline
+ \verb|\setaddressllcorner|\arg{Abstand vom linken Rand} \\
+ \verb|\setaddressllhpos|\arg{Abstand vom linken Rand} \\
+ \verb|\setaddressllvpos|\arg{Abstand vom oberen Rand} \\
+ \verb|\addresshigh| \\
+ \verb|\addressstd| \\
+ \verb|\setaddresswidth|\arg{Breite des Anschriften-Fensters}\\
+ \verb|\setaddressheight|\arg{H"ohe des Anschriften-Fensters}\\
+ \verb|\setaddressoffset|\arg{Abstand vom linken Fensterrand}\\
+ \verb|\setbackaddressheight|\arg{H"ohe des Anschriften-Fensters}\\
+ \hline
+ \verb|\setreflinetop|\arg{Abstand vom oberen Rand} \\
+ \verb|\setbottomtexttop|\arg{Abstand vom oberen Rand} \\
+ \verb|\setupperfoldmarkvpos|\arg{Abstand vom oberen Rand} \\
+ \verb|\setlowerfoldmarkvpos|\arg{Abstand vom oberen Rand} \\
+ \hline
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{table}[htp]
+\caption{Zusammenfassung der Dinbrief-Befehle (Teil 2):}\index{dinbrief>Befehle}
+
+\begin{center}
+\begin{tabular}{l}
+ \hline
+ \verb|\setlabelwidth|\arg{Breite eines Labels} \\
+ \verb|\setlabelheight|\arg{H"ohe eines Labels} \\
+ \verb|\setlabeltopmargin|\arg{oberer Rand} \\
+ \verb|\setlabelnumber|\arg{Labelanzahl pro Spalte} \\
+ \verb|\spare|\arg{Anzahl leerer Labels} \\
+ \hline
+ \verb|\stdaddress|\arg{Adresse des Absenders} \\
+ \verb|\begin{dinquote}| \\
+ \verb|\end{dinquote}| \\
+ \verb|\enclright| \\
+ \verb|\postremark|\arg{Postvermerk} \\
+ \verb|\handling|\arg{Behandlungsvermerk} \\
+ \hline
+\end{tabular}
+\end{center}
+\end{table}
+
+% \iffalse
+%</documentation|dintab>
+% \fi
+% \iffalse
+%<*documentation>
+% \fi
+
+\begin{table}[ht]
+\caption{"Uberschriftvariablen und deren Inhalt}%
+\index{dinbrief>"Uberschriftvariablen}
+
+\begin{center}
+(Voreinstellung entspricht DIN)
+
+\begin{tabular}{l}
+ \hline
+ \verb|\ccname|\{{\tt Verteiler}\} \\
+ \verb|\enclname|\{{\tt Anlage(n)}\} \\
+ \verb|\psname|\{{\tt PS}\} \\
+ \hline
+ \verb|\phonemsg|\{{\tt Telefon}\} \\
+ \verb|\signmsgold|\{{\tt Unsere Zeichen}\} \\
+ \verb|\signmsgnew|\{{\tt Unsere Zeichen, unsere Nachricht vom}\} \\
+ \verb|\yourmailmsg|\{{\tt Ihre Zeichen, Ihre Nachricht vom}\} \\
+ \hline
+\end{tabular}
+\end{center}
+
+\end{table}
+
+%
+\ssect{Bezugszeichenzeile}\index{Bezugszeichenzeile}
+Die vorliegende Version des \envname{dinbrief}s enth"alt
+zwei verschiedene Formen von Bezugszeichenzeilen.
+Die beiden Formen sind in der Norm 676 vom Dezember 1976 und
+im Entwurf zur Norm 676 vom Mai 1991 definiert. Mit den
+Befehlen \cmd\enabledraftstandard\ und \cmd\disabledraftstandard\
+schaltet man auf die Form des Entwurfs oder der geltenden Norm
+um. Die beiden Formen sind zur besseren Unterscheidung in
+Abbildung~\ref{fig:referlines} wiedergegeben.
+
+\begin{figure}[htb]
+\begin{center}
+\unitlength0.65mm
+\begin{picture}(190, 60)
+ \linethickness{0.4pt}
+ \thinlines
+ %
+ \put( 10.0, 49){\parbox[t]{50.8\unitlength}{{\sf\tiny Ihre Zeichen, Ihre Nachricht vom}\\{\cmd\yourmail}}}
+ \put( 60.8, 49){\parbox[t]{50.8\unitlength}{{\sf\tiny Unsere Zeichen}\\{\cmd\sign}}}
+ \put(111.6, 49){\parbox[t]{25.4\unitlength}{{\sf\tiny Telefon}\\{\cmd\phone}}}
+ \put(137.0, 49){\parbox[t]{25.4\unitlength}{{\sf\tiny Ortsname\\[-2ex] (Datum)}\\{\cmd\place}\\{\cmd\date}}}
+ \put( 0.0, 56){\makebox(190, 0){Bezugszeichenzeile nach DIN 676 vom Dezember 1976}}
+ \put( 0.0, 30){\framebox(190, 30){}}
+ %
+ \put( 10.0, 16){\parbox[t]{50.8\unitlength}{{\sf\tiny Ihr Zeichen, Ihre Nachricht vom}\\{\cmd\yourmail}}}
+ \put( 60.8, 16){\parbox[t]{50.8\unitlength}{{\sf\tiny Unser Zeichen, unsere Nachricht vom}\\{\cmd\sign}}}
+ \put(111.6, 16){\parbox[t]{50.8\unitlength}{{\sf\tiny Telefon, Bearbeiter}\\{\cmd\phone}\\{\cmd\writer}}}
+ \put(162.4, 16){\parbox[t]{15.0\unitlength}{{\sf\tiny Datum}\\{\cmd\place}\\{\cmd\date}}}
+ \put( 0.0, 23){\makebox(190, 0){Bezugszeichenzeile nach DIN 676 vom Mai 1991 (Entwurf)}}
+ \put( 0.0, 1){\framebox(190, 27){}}
+\end{picture}%
+\caption{Formen von Bezugszeichenzeilen}\label{fig:referlines}
+\end{center}
+\end{figure}
+%
+
+%
+\ssect{Standardkonfiguration mit einer Konfigurationsdatei}\index{Konfigurationsdatei}
+%
+Am Ende der Bearbeitung der Dokumentklasse \envname{dinbrief} wird die
+Konfigurationsdatei \file{dinbrief.cfg} eingelesen, falls eine Datei dieses
+Namens im Suchpfad f"ur \TeX-Eingabedateien gefunden wird.
+Die Suche wird in der gleichen Weise durchgef"uhrt wie bei anderen
+\TeX-Eingabedateien.
+
+In der Konfigurationsdatei k"onnen alle Befehle verwendet werden, die man vor
+\cmd\begin\arg{document} angeben darf.
+Beispielsweise kann die Datei mit den daf"ur vorgesehenen Befehlen das Layout
+des Briefes abweichend von der DIN Norm festlegen, einen Briefkopf definieren
+oder das Feld f"ur Angaben bei Kapitalgesellschaften vergr"o"ern und auch
+die Angaben selbst mit dem Befehl \cmd\bottomtext\ festlegen.
+
+Die Angabe der Optionen \Dopt{addresshigh} oder \Dopt{addressstd}
+"uberschreibt Angaben vertikalen Positionierung des Feldes f"ur die Anschrift,
+der Bezugszeichenzeile und der Faltmarkierungen.
+Explizite Festlegungen vor dem Befehl \cmd\opening\ "uberschreiben sowohl
+Einstellungen durch Angabe von Optionen in der \cmd\documentclass-Anweisung
+als auch in der Konfigurationsdatei.
+
+Beim Auspacken der \envname{dinbrief}-Verteilung wird auch eine
+Konfigurationsdatei erstellt, die nur Kommentare enth"alt.
+Einzelne Befehle k"onnen durch Entfernen des Kommentarzeichens aktiviert
+werden.
+Die verwendeten Befehle sind in dieser Dokumentation beschrieben.
+%
+
+%
+\ssect{Briefkopf}\index{Briefkopf}
+%
+Bei h"aufigem Briefeschreiben kommt sicher bald der
+Wunsch nach einem eigenen Briefkopf auf; auch dies ist
+mit \LaTeX\ zu verwirklichen.
+% Am besten er"offnet man sich in seiner Briefdatei (die man
+% sicher fr"uher oder sp"ater anlegen wird) ein File mit dem
+% Namen {\tt brfkopf.tex}. In dieses kann man z.B.\ den Briefkopf
+% in Abb.~\ref{briefkopf} aufnehmen.
+Am besten erstellt man eine Datei mit den Einstellungen
+f"ur eigene Briefe, wie im Beispiel die Datei {\tt brfkopf.tex}.
+Diese Datei kann z.B.\ den Briefkopf aus
+Abb.~\ref{briefkopf} enthalten.
+
+\renewcommand{\textfraction}{0.35}
+
+\begin{figure}[p]
+\begin{center}
+\begin{verbatim}
+\newlength{\UKAwd}
+\newlength{\ADDRwd}
+%
+\font\fa=cmcsc10 scaled 1440
+\font\fb=cmss12 scaled 1095
+\font\fc=cmss10 scaled 1000
+%
+\def\briefkopf{
+ \settowidth{\UKAwd}{\fa Institut f"ur Verpackungen}
+ \settowidth{\ADDRwd}{\fc EARN/BITNET: yx99 at dkauni2}
+%
+ \vspace*{7truemm}
+ \raisebox{-11.3mm}{%
+ \setlength{\unitlength}{1truemm}
+ \begin{picture}(15,15)(0,0)
+ \thicklines
+ \put(7.5,7.5){\circle{15}}
+ \put(7.5,7.5){\circle{10}}
+ \put(7.5,7.5){\circle{ 5}}
+ \end{picture}%
+ }
+ {\fc\hspace{.7em}}
+ \parbox[t]{\UKAwd}{
+ \centering{\fa Universit\"at Gralsruhe} \\
+ \centering{\fa Institut f"ur Verpackungen} \\[.5ex]
+ \centering{\fb Prof.\ Dr.\ Fritz Schreiber}
+ }
+ \hfill
+ \parbox[t]{\ADDRwd}{
+ \fc Engesserstr.\ 9 $\cdot$ Postfach 6980 \\
+ \fc 76128 Karlsruhe\\
+ \fc Telefon: (0721) 608-9790 \\
+ } }
+%
+\signature{Prof.\ Dr.\ Fritz Schreiber}
+\place{Karlsruhe}
+\address{\briefkopf}
+\phone{(0721)}{608-9790}
+\def\FS{Prof.\,F.\,Schreiber, Univ.\,Karlsruhe,
+ Postf.\,6980, 76128\,Karlsruhe\rule[-1ex]{0pt}{0pt}}
+\end{verbatim}
+\caption{Definition eines Briefkopfs}\label{briefkopf}
+\end{center}
+\end{figure}
+
+Am Anfang des Briefes sollte nun der Befehl \verb+\input{brfkopf}+
+aufgenommen werden gefolgt von \verb+\address{\myaddress}+%
+\index{myaddress=\verb+\myaddress+}. Dies sorgt
+f"ur die gew"unschte Ausgabe des Briefkopfes am Beginn des Briefes.
+Nat"urlich lassen sich auch andere als die hier verwendeten Schriftarten
+verwenden.
+
+\ssect{Kopfzeilen}\index{Kopfzeilen}
+
+Es stehen verschiedene Kopfzeilen zur Verf"ugung die "uber die
+Option \linebreak[4]\verb+\pagestyle{...}+\index{pagestyle=\verb+\pagestyle+}
+ausgew"ahlt werden k"onnen.
+Bei \verb+plain+\index{plain=\verb+plain+} wird eine Seitennumerierung
+bei mehrseitigen Briefen in der Fu"szeile eingeblendet, die Kopfzeile
+bleibt leer. Durch \verb+headings+\index{headings=\verb+headings+} wird
+die Kopfzeile mit einer Anrede und der Seitenzahl bei mehrseitigen
+Briefen gesetzt.
+
+\ssect{Einblenden von Unterschriften}
+\cmd\closing\oarg{Unterschrift}\arg{Gru"sformel} erlaubt es,
+die Unterschrift als Graphik einzubinden. F"ur unser Beispiel
+nehmen wir an, da"s die Graphik als encapuslated Postscript-Datei
+im Verzeichnis und mit Namen \file{graph/sig.eps} vorliegt.
+Die Befehle zum Einbinden von Graphiken stellt das Paket
+{\sc graphics} zur Verfgung. In der Pr"aambel des Briefes wird
+ein Befehl zum Setzen der Unterschrift definiert:\\[\medskipamount]
+\hspace*{2em}\verb|\newcommand{\setsignature}{\includegraphics{graph/sig.eps}}|\\[\medskipamount]
+Die Gru"sformel wird dann in der erweiterten Form gesetzt:\\[\medskipamount]
+\hspace*{2em}\verb|\closing[\protect\setsignature]{Mit freundlichen Gr"u"sen}|\\[\medskipamount]
+Gegebenenfalls ist es notwendig, die Unterschrift mit dem
+Befehl \verb+\raisebox+ in die notwendige Position zu schieben.
+Dazu ist die Definition des Macros zum Einbinden der Unterschrift
+wie folgt anzupassen:\\[\medskipamount]
+\hspace*{2em}\verb|\newcommand{\setsignature}{\raisebox{-3mm}{\includegraphics{graph/sig.eps}}}|\\[\medskipamount]
+Die L"angenangabe (hier -3mm) ist entsprechend anzupassen.
+
+\ssect{Briefe in englischer oder franz"osischer Sprache}
+
+Wer Briefe in anderen Sprachen schreiben m"ochte, kann f"ur Englisch und
+Franz"osisch die Trennung (abh"angig von der Installation) und Befehle f"ur
+Buchstaben mit Akzenten mit dem Befehl
+\cmd\selectlanguage\arg{Sprache}
+\index{selectlanguage=\verb+\selectlanguage+} umschalten.
+Das Umsetzen von Bezeichnungen z.B.\ f"ur Anlage \dots{} mu"s explizit durch
+Befehle erfolgen, die in der Dokumentation zum {\tt dinbrief} beschrieben sind.
+
+
+\ssect{Serienbriefe}\index{Serienbriefe}
+
+Mit \LaTeX\ lassen sich auch Serienbriefe schreiben. Man ben"otigt dazu
+nur ein kleines Makro wie z.B. das folgende:
+
+\begin{center}
+\begin{minipage}{0.75\textwidth}
+\begin{verbatim}
+\def\mailto#1{
+ \begin{letter}{#1}
+ \input{brftext}
+ \end{letter}}
+\end{verbatim}
+\end{minipage}
+\end{center}
+
+Mit dem Befehl \verb+\input{brftext}+ wird die Datei geladen, die den Text f"ur
+den Serienbrief enth"alt. In einer weiteren Datei stehen unsere Adressaten im
+folgenden Format:
+
+\begin{center}
+\begin{minipage}{0.75\textwidth}
+\begin{verbatim}
+\mailto{Karle Huber\\
+ Lichtensteinstr. 45\\[\medskipamount]
+ 77777 Hintertupfingen}
+\mailto{Anna H"aberle\\
+ Wallstra"se 7\\[\medskipamount]
+ 88888 L"andle}
+\end{verbatim}
+\end{minipage}
+\end{center}
+
+Die Briefe k"onnen nun mit einer Umgebung wie der in Abbildung~\ref{serie}
+ausgedruckt werden. In der Zeile \verb|\input{#address}| ist der
+Platzhalter \verb|#address| durch den Dateinamen zu ersetzen.
+
+\begin{figure}[p]
+\begin{center}
+\begin{verbatim}
+\documentclass[12pt]{dinbrief}
+\usepackage{german}
+
+\input{brfkopf}
+\address{\myaddress}
+\backaddress{R. Kurz, Am See 1, 76139 Karlsruhe}
+
+\signature{R. Kurz}
+\place{76139 Karlsruhe}
+
+\def\mailto#1{ % zum ausdrucken von
+ % Serienbriefen
+ \begin{letter}{#1}
+ \input{brftext} % Datei, die den Text enthaelt
+ \end{letter}}
+
+\begin{document}
+
+\input{#address} % Adress-Datei
+
+\end{document}
+\end{verbatim}
+\caption{Erstellen von Serienbriefen}
+\label{serie}
+\end{center}
+\end{figure}
+
+Beachten sollte man, da"s dann der Text in der Datei {\tt brftext.tex}
+direkt mit
+\verb+\opening{...}+ beginnt (also kein \verb+\begin{letter}+ und
+\verb+\end{letter}+ enth"alt) und mit \verb+\closing{...}+ bzw.
+\verb+\ps{...}+ abschlie"st.
+
+Ein Beispiel f"ur die Datei {\tt brftext.tex} finden Sie in
+Abbildung~\ref{brftext}.
+
+\begin{figure}[p]
+\begin{center}
+\begin{verbatim}
+\opening{Betrieb eines Mikrowellensenders}
+
+Sehr geehrte Damen und Herren,
+
+anbei sende ich Ihnen eine Kopie der bisherigen Genehmigung f"ur
+unseren Mikrowellenherd...
+
+... Ihre Bem"uhungen im voraus vielen Dank.
+
+\closing{Mit freundlichen Gr"u"sen,}
+
+\ps{Wir bitten um schnelle Erledigung.}
+\cc{Deutsche Bundespost\\
+ Karlsruher Privatfunk\\
+ S"uddeutscher Rundfunk}
+
+\encl{Abschrift der Urkunde}
+\end{verbatim}
+\caption{Rumpf eines Serienbriefes}
+\label{brftext}
+\end{center}
+\end{figure}
+
+\ssect{Einige Regeln f"ur das Briefeschreiben}
+
+Dieser Abschnitt enth"alt Passagen aus den
+Normen DIN~5008 (Regeln f"ur das Maschinenschreiben) und
+DIN~676 (Gesch"aftsbrief), erg"anzt um einige
+zus"atzliche Hinweise und Tips.
+Der Abschnitt erhebt keinen Anspruch auf
+Vollst"andigkeit. Er soll Anf"angern wie auch
+Ge"ubten einen "Uberblick "uber die wichtigsten
+Regeln geben. Ferner werden die Grenzen der
+vorliegenden Version aufgezeigt und es wird
+auf bekannte Fehler hingewiesen.
+
+\begin{enumerate}
+ \item {\bf Zeilenabstand}
+
+ Es wird mit einfachem Grundzeilenabstand geschrieben.
+
+ \item {\bf Anschriftenfeld}
+
+ Die Angaben im Anschriftenfeld werden auf
+ folgende Weise gegliedert:
+ \begin{enumerate}
+ \item Sendungsart, Versendungsform, Vorausverf"ugung
+ \item Leerzeile
+ \item Empf"angerbezeichnung
+ \item Postfach oder Stra"se und Hausnummer
+ \item Leerzeile
+ \item Postleitzahl und Bestimmungsort
+ \item Leerzeile
+ \item Bestimmungsland
+ \end{enumerate}
+
+ Bei Auslandsanschriften ist die Leerzeile zwischen
+ der Zeile mit Postfach oder Stra"se und Hausnummer
+ und der Zeile mit dem Bestimmungsort entbehrlich,
+ wenn das Bestimmungsland unter der entsprechenden
+ Zeile angegeben werden mu"s.
+
+ Im Verkehr mit bestimmten L"andern kann auf die
+ Angabe des Bestimmungslandes verzichtet werden,
+ wenn das Unterscheidungskennzeichen f"ur den
+ grenz"uberschreitenden Kraftfahrzeugverkehr
+ der Postleitzahl --- durch einen Bindestrich
+ getrennt --- vorangestellt wird.
+
+% \iffalse
+ Nach dem ersten Eintrag im Anschriftenfeld
+ darf nur ein \verb|\\| stehen. Direkte
+ L"angenangaben (z.B.\ \verb|\\[\medskipamount]|)
+ sind nicht zul"assig und verursachen einen Fehler.
+ Der Fehler kann umgangen werden, indem eine
+ Konstruktion
+ \m{Versendungsform}\verb|\\~\\|%
+ \m{Empf"angerbezeichnung} usw.\
+ verwendet wird.
+% \fi
+
+ \item {\bf Bezugszeichen und Tagangabe}
+
+ Die Eintragungen in dieser Zeile werden automatisch
+ an der richtigen Stelle plaziert.
+
+ \item {\bf Betreff und Teilbetreff}
+
+ Betreff und Teilbetreff sind stichwortartige
+ Inhaltsangaben. Der Betreff bezieht sich auf den
+ ganzen Brief, Teilbetreffe beziehen sich auf
+ Briefteile.
+
+ Der {\em Wortlauf des Betreffs\/} wird ohne
+ Schlu"spunkt geschrieben.
+% \iffalse
+ Der {\em Teilbetreff\/} beginnt an der Fluchtlinie
+ (linker Rand), schlie"st mit einem Punkt und wird
+ unterstrichen. Wir empfehlen diesen Text besser
+ durch eine andere Schriftart (z.B.\ fett)
+ hervorzuheben. Der Text wird unmittelbar angef"ugt.
+% \fi
+ \item {\bf Behandlungsvermerke}
+
+ Behandlungsvermerke (z.B.\ eilt) werden
+ neben das Anschriftenfeld, beginnend auf
+ Grad 50 (bei einer 10er Teilung), oder im
+ Anschlu"s an die Betreffangabe geschrieben;
+ sie k"onnen hervorgehoben werden.
+
+ \item {\bf Anlagen- und Verteilvermerke}
+
+ Anlagen- und Verteilvermerke beginnen an der
+ Fluchtlinie oder auf Grad 50 (60 oder 75).
+ Die vorliegende Version des `dinbriefs'
+ unterst"utzt nur Anlagen- und Verteilvermerke
+ auf der Fluchtlinie.
+
+ Der Anlagenvermerk geht dem Verteilvermerk
+ voraus.
+
+ \item {\bf Postscriptum}
+
+ Die DIN Norm 5008 sieht kein Postscriptum vor.
+ Die vorliegende Version des `dinbriefs'
+ unterst"utzt trotzdem ein Postscriptum.
+ Wir empfehlen das Postscriptum unmittelbar
+ nach der Gru"sformel \verb|\closing| oder
+ nach Anlagen- und Verteilvermerken zu setzen.
+
+ \item {\bf Seitennumerierung}
+
+ Die Seiten eines Schriftst"ucks sind von der
+ 2.~Seite an oben fortlaufend zu benummern.
+ Die Pagestyles \verb|headings| und
+ \verb|contheadings| unterst"utzen diese
+ Forderung. Das Verfahren ist jedoch noch nicht
+ befriedigend.
+
+ \item {\bf Hinweis auf Folgeseiten}
+
+ Wenn der Text eines Schriftst"ucks eine n"achste
+ Seite beansprucht, wird empfohlen
+ \begin{itemize}
+ \item am Fu"s der bereits beschrifteten Seite,
+ \item nach der letzten Textzeile,
+ \item mit mindestens einer Leerzeile Abstand,
+ \item auf Grad 60 (72 oder 90) beginnend,
+ \end{itemize}
+ als Hinweis auf die folgende Seite drei Punkte
+ zu schreiben.
+
+ Dieses Vorgehen wird zur Zeit nicht unterst"utzt.
+ Der Pagestyle \verb|contheadings| schreibt jedoch
+ an das Ende der laufenden Seite die Seitenzahl
+ der Folgeseite und auf Folgeseiten die
+ aktuelle Seite in der Kopf der Seite.
+
+ Die Kombination des Befehls \verb|\bottomtext|,
+ zum Einblenden einer weiteren Kommunikationszeile
+ am unteren Blattende der ersten Seite sowie
+ von gesellschaftsrechtlichen Angaben,
+ mit Seitenstilen, die die Fu"szeile unten mit
+ der Seitennummer oder Folgeseitennummer
+ beschriften, hat unter Umst"anden zur Folge,
+ da"s die Seiten- oder Folgeseitennummer
+ von diesen Feldern "uberschrieben wird.
+
+ \item {\bf Kommunikationszeile am Blattende und
+ gesellschaftsrechtliche Angaben}
+
+ Eine Kommunikationszeile am Blattende kann die folgenden
+ Angaben enthalten: Gesch"aftsr"aume, Telefon, Telefax,
+ Teletex, Telex, Btx und Kontoverbindungen.
+
+ Bei Kapitalgesellschaften sind die Angaben "uber
+ \begin{itemize}
+ \item die Rechtsform und den Sitz der Gesellschaft,
+ \item das Registergericht des Sitzes der Gesellschaft
+ und die Nummer, unter der die Gesellschaft in
+ das Handelsregister eingetragen ist,
+ \item den Namen des Vorsitzenden des Aufsichtsrates
+ (sofern die Gesellschaft nach gesetzlicher
+ Vorschrift einen Aufsichtsrat zu bilden hat),
+ \item die Namen des Vorsitzenden und aller Mitglieder
+ des Vorstandes (bei Gesellschaften mit
+ beschr"ankter Haftung die Namen der
+ Gesch"afts\-f"uhrer),
+ \end{itemize}
+ am Fu"s des Vordrucks aufzuf"uhren.\hfil\break
+ Die Rechtsform kann auch im Briefkopf als Bestandteil
+ der Firma angegeben werden.
+\end{enumerate}
+
+\ssect{Adre"s--Etiketten}
+Das Ausdrucken von Adre"s-Etiketten ist w"unschenswert, wenn
+keine Fensterbriefh"ullen verwendet werden. Damit das Bedrucken
+von verschiedenen Etiketts"atzen m"oglich wird, kann die Breite
+und H"ohe der einzelnen Etiketten mit den Befehlen
+\verb|\setlabelwidth|\arg{Breite} und
+\verb|\setlabelheight|\arg{H"ohe} eingestellt
+werden. Der obere Rand kann mit dem Befehl
+\verb|\setlabeltopmargin|\arg{oberer Rand} festgelegt werden.
+Die Anzahl der Labels in einer Spalte wird durch den Befehl
+\verb|\setlabelnumber|\arg{Anzahl} angegeben. Die mehrfache
+Verwendung eines Etikettenblatts wird durch den Befehl
+\verb|\spare|\arg{Anzahl} m"oglich. Dieser Befehl r"uckt
+den Druckbeginn um {\em Anzahl\/} Positionen vor.
+Die Ausgabe der Adre"s--Etiketten erfolgt spaltenweise.
+
+In vielen Druckern bleiben die Etikettenbl"atter h"angen,
+wenn die Tr"agerfolie in beiden Spalten freiliegt. Drucker,
+die alternativ einen ebenen Papiertransport besitzen, sollten
+zur Ausgabe von Etiketten auf diesen umgeschaltet werden.
+
+\ssect{Kompatibilit"at zu Rainer Sengerlings `dinbrief'}
+Im Jahr 1992 wurde an der Universit"at Karlsruhe ein Briefstil
+entwickelt, dem der Namen `dinbrief' gegeben wurde. Im gleichen
+Jahr ver"offentlichte Rainer Sengerling einen Briefstil unter
+dem gleichen Namen.
+
+Rainer Sengerling hat darauf verzichtet seinen Briefstil
+an \LaTeXe\ anzupassen. Daraufhin haben wir den Briefstil
+`dinbrief' im Dezember 1994 als \LaTeXe-Klasse ver"offentlicht.
+Die beiden Briefstile haben unterschiedliche Befehlss"atze,
+was bei vielen Benutzern zu Verwirrung und Irritationen
+gef"uhrt hat. Wegen der unterschiedlichen Befehle der beiden
+Stile haben uns viele Anfragen erreicht. Die jetzt vorliegende
+Fassung stellt beide Befehlss"atze zur Verf"ugung und f"uhrt die
+bisher unabh"anigen Briefstile zusammen.
+
+Gegenw"artig wird die Klassenoption \verb|german| nicht ausgewertet
+und f"uhrt zu einer Warnung. Alternativ mu"s mit dem Befehl
+\begin{quote}
+ \verb|\usepackage{german}|\\
+\end{quote}
+der Stil "`{\tt german}"' geladen werden.
+
+\begin{description}
+
+ \item[\cmd\Retouradresse\arg{{Absenderadresse im Brief\kern 0pt fenster}}]
+ Der Befehl legt die Anschrift des Absenders oben im
+ Anschriftenfeld des Briefs fest.
+
+ \item[\cmd\Retourlabel] \hfil\break
+ Dieser Befehl erzeugt Absenderadre"s-Etiketten, falls
+ die Erzeugung der Etiketten aktiviert wurde.
+
+ Ferner wird die Ausgabe der \cmd\Retouradresse\ unterdr"uckt.
+
+ {\bf Dieser Befehl wird gegenw"artig nicht unterst"utzt und
+ erzeugt eine Warnung.\/}
+
+ \item[\cmd\Fenster] \hfil\break
+ Bei der Verwendung von Fensterbriefh"ullen wird die mit
+ \cmd\Retouradresse\ vereinbarte einzeilige R"ucksendeadresse
+ (Absenderadresse) oben im Anschriftenfeld eingeblendet,
+ falls der Befehl \cmd\Fenster\ angegeben wurde. Ferner
+ werden die Faltmarken am linken Rand ausgegeben.
+
+ Daf"ur wird die Ausgabe der Etiketten unterdr"uckt.
+
+ {\bf Dieser Befehl wird gegenw"artig nicht unterst"utzt und
+ erzeugt eine Warnung.\/}
+
+ \item[\cmd\Postvermerk\arg{Postvermerk}] \hfil\break
+ Dieser Befehl vereinbart Vermerke f"ur den
+ Postversand wie z.B.\ Einschreiben.
+
+ \item[\cmd\Behandlungsvermerk\arg{Behandlungsvermerk}] \hfil\break
+ Der Befehl \cmd\Behandlungsvermerk\ dient zur
+ Angabe von (man wirds kaum glauben) Behandlungsvermerken
+ wie z.B.\ Eilt, pers"onlich oder "`F"ur die unterste
+ Schublade"'.
+
+ \item[\cmd\Absender\arg{Name und Adresse des Absenders}] \hfil\break
+ Die Adresse des Absenders wird vereinbart.
+ Dieser Befehl gilt f"ur den laufenden und alle
+ weiteren Briefe; er gilt solange, bis ein
+ weiterer \cmd\Absender- oder \cmd\address-Befehl
+ angegeben wird.
+
+ \item[\cmd\Absender\arg{Teil 1::Teil 2}] \hfil\break
+ Dies ist eine Sonderform des \cmd\Absender-Befehls.
+ Der durch \verb|::| abgetrennte {\em Teil2\/}
+ erscheint im Briefkopf, aber nicht im
+ Absenderetikett, falls ein solches mit dem
+ Befehl \cmd\Retourlabel\ angefordert
+ wurde.
+
+ Dieser Befehl wird korrekt unterst"utzt. Da aber
+ der Befehl \cmd\Retourlabel\ nicht implementiert
+ wurde, hat die Aufteilung im Moment praktisch keine
+ Bedeutung; sie kann aber in sp"ateren Versionen
+ wieder notwendig sein.
+
+ \item[\cmd\Datum\arg{Briefdatum}] \hfil\break
+ Soll als Absendedatum {\sl nicht\/} das aktuelle
+ Tagesdatum (des Rechners) eingesetzt werden, kann
+ mit diesem Befehl das Datum explizit angegeben werden.
+
+ Der Befehl \cmd\heute\ wird nicht unterst"utzt.
+
+ \item[\cmd\Betreff\arg{{Betreff}}] \hfil\break
+ Mit diesem Befehl wird der Betreff gesetzt, der den
+ Empf"anger "uber den Gegenstand des Briefes
+ informiert. Der Betreff kann ein oder mehrzeilig sein.
+
+ \item[\cmd\Einrueckung\arg{Text}] \hfil\break
+ Der Text wird um $1 in$ einger"uckt und geht bis zum
+ rechten Rand. Der Text darf Abs"atze enthalten.
+
+ \item[\cmd\anlagenrechts] \hfil\break
+ Die Anlagen- und Verteilvermerke beginnen {\sl rechts\/}
+ neben der Gru"sformel auf Grad 50. Mit diesem Befehl
+ kann Platz gespart werden, falls die Seite fast voll
+ ist, und kein neues Blatt begonnen werden soll.
+ Dieser Befehl mu"s vor \cmd\closing\ stehen.
+ Die Anlagen- und Verteilvermerke m"ussen in diesem
+ Fall ebenfalls vor dem \cmd\closing-Befehl stehen.
+
+ \item[\cmd\Anlagen\arg{Anlagenvermerk}] \hfil\break
+ Mit diesem Befehl werden eventuelle Anlagenvermerke
+ vereinbart oder gesetzt. Dieser Befehl darf sowohl
+ vor dem \cmd\closing-Befehl als auch hinter diesem
+ stehen. Der Anlagenvermerk wird nur vereinbart falls
+ der Befehl vor dem \cmd\closing-Befehl angegeben wird.
+ Der Anlagenvermerk wird sofort ausgegeben und gesetzt,
+ falls der Befehl nach dem \cmd\closing-Befehl angegeben
+ wird.
+
+ \item[\cmd\Verteiler\arg{Verteilvermerk}] \hfil\break
+ Dieser Befehl vereinbart oder setzt Verteilvermerke.
+ Die Ausf"uhrungen zum \cmd\Anlagen-Befehl gelten
+ auch f"ur diesen Befehl.
+
+ \item[\cmd\Etihoehe\arg{H"ohe eines Adressetiketts}] \hfil\break
+ Verschiedene Herstelle vertreiben Adressetiketten,
+ die alle ein bischen anders sind. Um den Briefstil
+ an unterschiedlich hohe Adre"setiketten anzupassen,
+ kann mit dem Befehl \cmd\Etihoehe\ die H"ohe eines
+ Etiketts angegeben werden.
+
+ \item[\cmd\Etirand\arg{oberer Rand}] \hfil\break
+ Die B"ogen mit den Adre"setiketten haben oft einen
+ Versatz oder oberen Rand. Mit dem Befehl \cmd\Etirand\
+ kann dieser Versatz eingestellt werden.
+
+ \item[\cmd\Etizahl\arg{Zahl der Etiketten}] \hfil\break
+ Auf ein Blatt mit Adre"setiketten passen leider
+ nicht beliebig viele sondern nur eine begrenzte
+ Anzahl von Etiketten, die sich dann auch nicht kunterbunt
+ auf dem Blatt tummeln, sondern Spaltenweise angeordnet
+ sind. Die Zahl der Etiketten, die in eine Spalte
+ passen werden durch den Befehl \cmd\Etizahl\
+ angegeben.
+
+ \item[\cmd\spare\arg{{n}}] \hfil\break
+ Das Bedrucken der Adre"setiketten beginnt nach {\em n\/}
+ leeren Adre"slabeln. Die Label werden spaltenweise
+ durchgez"ahlt.
+
+\end{description}
+
+\clearpage
+% \iffalse
+%</documentation>
+% \fi
+% \iffalse
+%<*documentation|dintab>
+% \fi
+% \iffalse
+\end{document}
+% \fi
+% \iffalse
+%</documentation|dintab>
+% \fi
+%
+% \StopEventually{}
+%
+% \clearpage
+%
+% \originalTeX
+%
+% \section{Documentation}
+%
+% \begin{macrocode}
+%<*class|style>
+% \end{macrocode}
+%
+% We store the date, version and name of this file in four control
+% sequences, for future use.
+% \begin{macrocode}
+\def\RCSdate{$Date: 2000/03/02 12:49:21 $}
+\def\RCSrevision{$Revision: 1.73 $}
+%
+{%
+ \def\stripone $#1${\def\partone{#1}}
+ \def\striptwo Date: #1\stop{\gdef\filedate{#1}\gdef\docdate{#1}}
+ \expandafter\stripone\RCSdate
+ \expandafter\striptwo\partone\stop
+}%
+%
+{%
+ \def\stripone $#1${\def\partone{#1}}
+ \def\striptwo Revision: #1\stop{\gdef\fileversion{#1}}
+ \expandafter\stripone\RCSrevision
+ \expandafter\striptwo\partone\stop
+}%
+%
+\def\filename{dinbrief.dtx}
+% \end{macrocode}
+%
+%
+% \subsection{The class/style file `dinbrief'}
+%
+% This is |DINBRIEF.STY| in text format, as of 1994/12/21,
+% by K.~Braune and R.~Gussmann
+% (Rechenzentrum der Universit\"at Karlsruhe).
+%
+% It is based on |DLETTER.STY| in text format, as of December 16, 1987,
+% by D.~Heinrich (TH Karlsruhe).
+%
+% It is based on |A4LETTER.STY| in text format, as of June 16, 1987,
+% and |letter.sty| 17-Jan-86 with modifications
+% for DIN-A4 paper + window envelopes, by H.~Partl (Wien)
+%
+% \changes{0.0.0}{1991/09/09}{(KB) Inserted blank space behind "P.S.:"}
+% \changes{0.0.0}{1991/10/02}{(KB) Changed "P.S.:" to "PS\cmd\newline"
+% Diminished space before \cmd\ps, \cmd\cc
+% and \cmd\encl.
+% Inserted code to generate labels using
+% a 12pt font and changed references
+% to \cmd\scriptsize to \cmd{\size{9}{11pt}}}
+% \changes{0.0.0}{1991/10/31}{(KB) Changes to allow \cmd\place not set}
+% \changes{0.0.0}{1991/11/15}{(RG) Moved \cmd\newlength from inside
+% \cmd\@answerto outside to allow
+% multiple letters within a single document.
+% Changed command sequences}
+% \changes{0.0.0}{1991/11/19}{(KB) Replaced \cmd\rm by code for the
+% new fontselection scheme}
+% \changes{0.0.0}{1991/11/19}{(KB) Changed first page to use pagestyle
+% firstpage}
+% \changes{0.0.0}{1992/02/05}{(KB) Changes of R.~Gussmann inserted}
+% \changes{0.0.0}{1992/02/27}{(KB) Page offsets corrected}
+% \changes{0.0.0}{1994/02/08}{(RG) Changes of K.~D.~Braune inserted}
+% \changes{0.92.20}{1994/02/23}{(RG) some more Comments added}
+% \changes{0.93.0}{1994/06/07}{(RG) some more Comments added\hfil\break
+% styles for labels added}
+% \changes{1.70.1}{2000/01/09}{(KB) Replaced absolute lengths related to
+% the letter layout (not for printing
+% labels) by variables and expressions
+% computed from their values\hfil\break
+% Inserted equal sign when assigning a value
+% to a length\hfil\break
+% Added support for a configuration
+% file\hfil\break
+% Some inactive lines (comments)
+% removed}
+% \changes{1.70.1}{2000/01/17}{(KB) \cmd\hfill\ changed to \cmd\hfil\
+% according to a proposal by Markus
+% Pilzecker\hfil\break
+% Introduced class options to switch between
+% both forms of the DIN 676 letter
+% layout\hfil\break
+% Mechanism and handling of bottomtext
+% changed}
+% \changes{1.72.0}{2000/02/29}{(KB) {\tt$\langle$CR$\rangle\langle$LF$\rangle$}
+% replaced by UNIX's newline\hfil\break
+% Adjustment of \cmd\textheight\ due to a
+% high position of the bottomtext
+% corrected\hfil\break
+% \cmd\oldopening\ restored by
+% (re)introducing \cmd\@@bottomtext\ into
+% the definition of \cmd\oldopening}
+%
+% \subsection{Get system information}
+% First we use three conditions to identify whether or not this file
+% is running under LaTeX 2.09 or \LaTeXe\ and which font selection
+% scheme is in use.
+%
+% |\ifka@db@ltxtwoe| is true if and only if this style is running in
+% an \LaTeXe-environment. |\ifka@db@nfss| is true if we are using an
+% NFSS 1 and \linebreak[4]
+% |\ifka@db@nfsstwo| is true if we are using the NFSS 2.
+%
+% \begin{macrocode}
+\newif\ifka@db@ltxtwoe
+\ka@db@ltxtwoefalse
+\newif\ifka@db@nfss
+\ka@db@nfssfalse
+\newif\ifka@db@nfsstwo
+\ka@db@nfsstwofalse
+% \end{macrocode}
+%
+% Then we check what is present on the system.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname documentclass\endcsname\relax\else
+ \ka@db@ltxtwoetrue
+ \fi
+\expandafter\ifx\csname size\endcsname\relax\else
+ \ka@db@nfsstrue
+ \fi
+\expandafter\ifx\csname fontsize\endcsname\relax\else
+ \ka@db@nfsstwotrue
+ \fi
+% \end{macrocode}
+%
+% \subsection{Print informations about this style}
+%
+% \subsubsection{Print the banner}
+%
+% \begin{macrocode}
+\typeout{}
+\typeout{Document Class/Style 'dinbrief' - %
+ Version \fileversion}
+\typeout{University of Karlsruhe - \filedate}
+\typeout{}
+% \end{macrocode}
+%
+% \subsubsection{Print system information}
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \typeout{*** dinbrief: Running in LaTeX 2e mode!}
+ \else
+ \typeout{*** dinbrief: Running in LaTeX 2.09 mode!}
+ \fi
+\ifka@db@nfss
+ \typeout{*** dinbrief: NFSS!}
+ \else
+ \ifka@db@nfsstwo
+ \typeout{*** dinbrief: NFSS 2!}
+ \else
+ \typeout{*** dinbrief: original LaTeX 2.09 font %
+ selection mechanism found!!!}
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \subsection{\LaTeXe\ version control}
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \NeedsTeXFormat{LaTeX2e}[1996/12/01]
+ \ProvidesClass{dinbrief}[2000/03/02 LaTeX2e class]
+\else
+ \long\def\@firstofone#1{#1}
+\fi
+% \end{macrocode}
+%
+% \subsection{Initial code}
+%
+% In this part we define a few comands that are used later on.
+%
+% \subsubsection{temporary variables}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Added second temporary length}
+% \begin{macro}{\ka@db@tmpdima}
+% \begin{macro}{\ka@db@tmpdimb}
+% Unfortunately we have to define our own temporary dimen
+% variables, because inside a parbox \cmd\@tempdima\ and
+% \cmd\@tempdimb\ are used. \cmd\@tempdimc\ ist used maybe
+% in fontswitch commands.
+% \begin{macrocode}
+\newdimen\ka@db@tmpdima
+\newdimen\ka@db@tmpdimb
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{{\tt dinbrief\/} programming environment}
+%
+% \changes{1.22.0}{1995/01/15}{(RG) \cmd\section\space programming
+% environment added.}
+%
+% We define a few commands that are used later on.
+%
+% {\tt dinbrief\/} has many variables to store information about
+% a letter in it. These informations can be local to one letter
+% or global to all letters in the file. Here is a table of all
+% variables, and a mark if they are local, global or both.
+%
+% \DeleteShortVerb{\|}
+% \begin{tabular}{ll|c|c|l}
+% \hline
+% \multicolumn{1}{c}{\bf\small old name} &
+% \multicolumn{1}{c}{\bf\small new name}&
+% \multicolumn{1}{c}{\bf\small local} &
+% \multicolumn{1}{c}{\bf\small global} &
+% \multicolumn{1}{c}{\bf\small holds}\\
+% \hline
+% \cmd\@backaddress & backaddress & $\bullet$ & $\bullet$ & backaddress\\
+% not used & cc & $\bullet$ & & carbon copy\\
+% not used & encl & $\bullet$ & & enclosures \\
+% not used & ps & $\bullet$ & & postscriptum\\
+% \cmd\@fromsig & signature & $\bullet$ & $\bullet$ & sign of author\\
+% \cmd\@fromaddress & fromaddress & $\bullet$ & $\bullet$ & address of author\\
+% \cmd\@place & place & & $\bullet$ & place \\
+% \cmd\@prephone & prephone & & $\bullet$ & dialing code\\
+% \cmd\@phone & phone & & $\bullet$ & telephone number\\
+% \cmd\@mymail & sign & $\bullet$ & $\bullet$ & my sign\\
+% \cmd\@yourmail & yourmail & $\bullet$ & & your mail\\
+% \cmd\@writer & writer & $\bullet$ & $\bullet$ & writer, processor\\
+% \end{tabular}
+% \MakeShortVerb{\|}
+%
+% Currently the new nameing scheme is only used for |cc|, |encl| and
+% |ps|. No features of are currently used.
+%
+% \begin{macro}{\ka@db@assignvarglobal}
+% Assigns the argument to the global entity of that variable.
+% \begin{macrocode}
+\long\def\ka@db@assignvarglobal#1#2{%
+ \protect\pka@db@assignvarglobal{#1}{#2}}%
+\long\def\pka@db@assignvarglobal#1#2{%
+ % \bgroup
+ % \let\\=\relax
+ % \message{assignvarglobal: #1 = #2}%
+ % \egroup
+ \global\@namedef{ka@db@g@#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@assignvarlocal}
+% Assigns the argument to the local entity of that vairable.
+% \begin{macrocode}
+\long\def\ka@db@assignvarlocal#1#2{%
+ \protect\pka@db@assignvarlocal{#1}{#2}}%
+\long\def\pka@db@assignvarlocal#1#2{%
+ % \bgroup
+ % \let\\=\relax
+ % \message{assignvarlocal: #1 = #2}%
+ % \egroup
+ \global\@namedef{ka@db@l@#1}{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@declvar}
+% The macro \cmd\ka@db@declvar\arg{NAME} defines two control sequences
+% with the following names |\ka@db@l@|NAME and |\ka@db@g|NAME.
+% The control sequences are initialized with |\@empty|.
+% \begin{macrocode}
+\def\ka@db@declvar#1{%
+ \ka@db@assignvarglobal{#1}{}%
+ \ka@db@assignvarlocal{#1}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@assignvar}
+% Assigns the given argument either to the local or global entity
+% depending on the value of the boolean variable |ifka@db@inletter|.
+% We do the same as in \LaTeX. We define a normal and a protected
+% version.
+% \begin{macrocode}
+\long\def\ka@db@assignvar#1#2{\protect\pka@db@assignvar{#1}{#2}}%
+\long\def\pka@db@assignvar#1#2{%
+ % \message{assignvar: #1 = #2}%
+ \ifnum\c@lt@state>0\relax
+ \pka@db@assignvarlocal{#1}{#2}%
+ \else
+ \pka@db@assignvarglobal{#1}{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@usevarglobal}
+% Use the global entity.
+% \begin{macrocode}
+\def\ka@db@usevarglobal#1{\protect\pka@db@usevarglobal{#1}}%
+\def\pka@db@usevarglobal#1{%
+ \@nameuse{ka@db@g@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@usevarlocal}
+% Use the local entity.
+% \begin{macrocode}
+\def\ka@db@usevarlocal#1{\protect\pka@db@usevarlocal{#1}}%
+\def\pka@db@usevarlocal#1{%
+ \@nameuse{ka@db@l@#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@usevar}
+% Use the global or local entity. If the local entity is empty
+% take the value from the global entity. There is no check if
+% the local entity holds valid data. |\ka@db@inletter|-Flag is
+% not used.
+% \begin{macrocode}
+\def\ka@db@usevar#1{%
+ \bgroup
+ \def\protect{\noexpand\protect\noexpand}%
+ \let\\=\relax
+ \edef\tmpa{\pka@db@usevarlocal{#1}}%
+ % \typeout{usevar: varlocal #1 = \meaning\tmpa}%
+ \expandafter\egroup
+ \ifx\tmpa\@empty
+ % \message{Using global var, because local var is empty!}%
+ \pka@db@usevarglobal{#1}%
+ \else
+ % \message{Using local var!}%
+ \pka@db@usevarlocal{#1}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@ifemptydynvar}
+% Argument one has to be a control sequence. Argument two is
+% the argument of the control sequence given in the first argument.
+% If the macro combined with the first two arguments is empty, then
+% the third argument is executed. Otherwise the fourth argument is
+% executed. We do an expansion into a temporary controlsequence.
+% Therefore all control sequences in the expanded macro which
+% should not be expanded should be protected. \cmd\protect\ and
+% \cmd\\\ are set so that no expansion is given for protected
+% control sequences and also for \cmd\\.
+% \begin{macrocode}
+\long\def\ka@db@ifemptydynvar#1#2#3#4{%
+ \bgroup
+ \def\protect{\noexpand\protect\noexpand}%
+ \let\\=a% because characters are not expanded
+ \edef\tmpa{#1{#2}}%
+ % \typeout{ifempty: \string#1\space var #2 = \meaning#1{#2}}%
+ % \typeout{ifempty: \string#1\space var #2 = \meaning\tmpa}%
+ \expandafter\egroup
+ \ifx\tmpa\@empty
+ % \message{var is empty!}%
+ #3% <- otherwise a space is inserted
+ \else
+ % \message{var is not empty!}%
+ #4% <- otherwise a space is inserted
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@ifemptyvarlocal}
+% Checks if the local entity of a variable is empty or not.
+% \begin{macrocode}
+\long\def\ka@db@ifemptyvarlocal#1#2#3{%
+ \ka@db@ifemptydynvar{\pka@db@usevarlocal}{#1}{#2}{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@ifemptyvarglobal}
+% Checks if the global entity of a variable is empty or not.
+% \begin{macrocode}
+\long\def\ka@db@ifemptyvarglobal#1#2#3{%
+ \ka@db@ifemptydynvar{\pka@db@usevarglobal}{#1}{#2}{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@ifemptyvar}
+% If both entities of the variable (local and global) are
+% empty then the second argument is executed. Otherwise the
+% third argument is executed.
+% \begin{macrocode}
+\long\def\ka@db@ifemptyvar#1#2#3{%
+ \ka@db@ifemptyvarlocal{#1}{% then
+ \ka@db@ifemptyvarglobal{#1}{#2}{#3}%
+ }{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@execatletter}
+% \begin{macro}{\ka@db@atletter}
+% The macro |\ka@db@execatletter| appends at the end of the
+% macro \hfil\break |\ka@db@atletter| the stuff added in the
+% argument of |\ka@db@execatletter|. The macro |\@ka@db@atletter|
+% will be executed everytime the |\begin{letter}|-command is
+% processed.
+% \begin{macrocode}
+\def\ka@db@execatletter#1{%
+ \bgroup
+ \let\\=\relax
+ \def\protect{\noexpand\protect\noexpand}%
+ \xdef\ka@db@atletter{\ka@db@atletter #1}
+ \egroup
+}
+\def\ka@db@atletter{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@execatendletter}
+% \begin{macro}{\ka@db@endletter}
+% The same as above except that the list is executed
+% if the |\end{letter}|-command is processed.
+% \begin{macrocode}
+\def\ka@db@execatendletter#1{%
+ \bgroup
+ \let\\=\relax
+ \def\protect{\noexpand\protect\noexpand}%
+ \xdef\ka@db@atendletter{\ka@db@atendletter #1}
+ \egroup
+}
+\def\ka@db@atendletter{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Choosing the type size}
+%
+% \begin{macro}{\@ptsize}
+% \begin{macro}{\ds@12pt}
+% \begin{macro}{\ds@11pt}
+% \begin{macro}{\ds@10pt}
+% \begin{macro}{\ds@norm}
+% The control sequence |\@ptsize| is used to store the second digit
+% of the pointsize we are typesetting in. So, normally, it's value
+% is one of 0, 1 or 2.
+%
+% To be compatible with the old `dinbrief', pointsize 3 is used to
+% \iffalse
+% switch to special size having $\frac{1}{6}$ in as |\baselineskip|.
+% \fi
+% switch to a special size setting exactly 6 lines per inch.
+% (\dots\ it's used to feature some other size following the rules
+% of old stupid typewriters).
+%
+% The type size options are handled by defining |\@ptsize| to contain
+% the last digit of the size in question and branching on |\ifcase|
+% statements. This is done for historical reasons to stay compatible
+% with other packages that use the |\@ptsize| variable to select
+% special actions.
+%
+% To follow the programming conventions of \LaTeXe, we split the
+% definition of the macros into two parts. One for the old \LaTeX\
+% and one for \LaTeXe.
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \newcommand\@ptsize{}
+ \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
+ \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
+ \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
+ \DeclareOption{norm}{\renewcommand\@ptsize{3}}
+\else
+ \def\@ptsize{0}
+ \@namedef{ds@10pt}{\def\@ptsize{0}}
+ \@namedef{ds@11pt}{\def\@ptsize{1}}
+ \@namedef{ds@12pt}{\def\@ptsize{2}}
+ \@namedef{ds@norm}{\def\@ptsize{3}}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Defining the jobname}
+%
+% \begin{macro}{\jobname@aux}
+% \begin{macro}{\jobname@lbl}
+% This control sequence is used to store the name of the aux-file.
+% Therefore character |_| temporally is given catcode 12.
+%
+% \begin{macrocode}
+{%
+ \catcode`\_=12
+ \gdef\jobname@aux{\jobname.aux}% .aux or _aux or ...
+ \gdef\jobname@lbl{\jobname.lbl}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@mainlbl}
+% \begin{macrocode}
+\newwrite\@mainlbl
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Stuff from original classes}
+%
+% \begin{macro}{\if@restonecol}
+% If the document has to be printed in two columns, we sometimes
+% have to temporarily switch to one column. This switch is used to
+% remember to switch back.
+% \begin{macrocode}
+\newif\if@restonecol
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Setting paper sizes}
+%
+% The variables |\paperwidth| and |\paperheight| should reflect the
+% physical paper size after trimming. For desk printer output this
+% is usually the real paper size since there is no post-processing.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \DeclareOption{a4paper}
+ {\paperheight=297mm%
+ \paperwidth =210mm}
+ \DeclareOption{a5paper}
+ {\paperheight=210mm%
+ \paperwidth =148mm}
+ \DeclareOption{b5paper}
+ {\paperheight=250mm%
+ \paperwidth =176mm}
+ \DeclareOption{letterpaper}
+ {\paperheight=11in%
+ \paperwidth =8.5in}
+ \DeclareOption{legalpaper}
+ {\paperheight=14in%
+ \paperwidth =8.5in}
+ \DeclareOption{executivepaper}
+ {\paperheight=10.5in%
+ \paperwidth =7.25in}
+\fi
+% \end{macrocode}
+%
+% \subsection{Two-side or one-side printing}
+%
+% Sometimes it's necessary to have two-sided printing. For example
+% if you have a two-sided printer, and you write two letters the
+% first one having an odd number of pages. The second then starts
+% on the backside of the last page of the first letter. To avoid
+% this problem you can specify the twoside option. Each letters
+% then starts on a new sheet on a two-sided printer.
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \DeclareOption{twoside}{\@twosidetrue}
+\fi
+\@twosidefalse
+% \end{macrocode}
+%
+% \subsection{Support for both variants of DIN 676 letter layout}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Support for both variants of
+% DIN 676 letter layout}
+%
+% Changing the letter layout parameters from absolute lengths to length
+% variables allows easy support of both versions of the DIN 676 letter
+% layout: `Form A' with address filed put high on the page
+% (\Lopt{addresshigh}), and `Form B' with address field 18mm lower
+% (\Lopt{addrl ow}). Since up to now only `Form B' has been supported,
+% it has been choosen to be the default. The option code is executed
+% after the other class commands since the lengths used are introduced
+% later on. These options are available only in case of using \LaTeXe.
+% Specification of the length |\addrvpos|, |\ufldmarkvpos| and
+% |\lfldmarkvpos| in the configuration file overwrite these options.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \DeclareOption{addresshigh}{\AtEndOfClass{\addresshigh}}
+ \DeclareOption{addressstd}{\AtEndOfClass{\addressstd}}
+\fi
+% \end{macrocode}
+%
+% \subsection{Draft option}
+%
+% If the user requests \Lopt{draft} we show any overfull boxes.
+% We could probably add some more interesting stuff to this option.
+% \begin{macrocode}
+\def\ds@draft{\overfullrule 5pt}
+\def\ds@final{\overfullrule 0pt}
+% \end{macrocode}
+%
+% \subsection{Twocolumn printing}
+%
+% Two-column and one-column printing is again realized via a switch.
+%
+% This makes no sense in letters following the rules of DIN. But
+% maybe it is sometimes usefull.
+%
+% Some labels use twocolumn output.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \DeclareOption{onecolumn}{\@twocolumnfalse}
+ \DeclareOption{twocolumn}{\@twocolumntrue}
+\fi
+% \end{macrocode}
+%
+% \subsection{Defining internal font selection commands}
+%
+% To be compatible to all font selection schemes we define our own
+% font selection commands |\ka@db@fontshape| (1), |\ka@db@fontseries| (1),
+% |ka@db@fontsize| (2), |\ka@db@selectfont| (0).
+%
+% Note: In the definition of the original \LaTeX\ 2.09 font selection system
+% the command |\rm| is used. This causes no error because |\rm| is
+% well defined in this version of \LaTeX.
+%
+% \iffalse
+% Note: The code for the font selection with the original mechanism
+% had been written by K.~Braune.
+% \fi
+%
+% \begin{macrocode}
+\ifka@db@nfss
+ \let\ka@db@selectfont\selectfont
+ \let\ka@db@fontseries\series
+ \let\ka@db@fontshape\shape
+ \let\ka@db@fontsize\size
+ \else
+ \ifka@db@nfsstwo
+ \let\ka@db@selectfont\selectfont
+ \let\ka@db@fontseries\fontseries
+ \let\ka@db@fontshape\fontshape
+ \let\ka@db@fontsize\fontsize
+ \else
+ \def\ka@db@selectfont{\relax}
+ \def\ka@db@fontseries#1{\relax}
+ \def\ka@db@fontshape#1{\ifx#1n\rm\else\relax\fi}
+ \def\ka@db@fontsize#1#2{\expandafter
+ \ifnum#1=12
+ \@setsize\normalsize{15pt}\xiipt\@xiipt
+ \abovedisplayskip 12pt plus3pt minus7pt
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3pt
+ \belowdisplayshortskip 6.5pt plus3.5pt minus3pt
+ \else
+ \ifnum#1=8
+ \@setsize\scriptsize{8pt}\viipt\@viipt
+ \else
+ \@setsize\scriptsize{9.5pt}\viiipt\@viiipt
+ \fi
+ \fi}
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \subsection{Executing options}
+%
+% Here we execute the default options to initialize certain
+% variables.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \ExecuteOptions{a4paper,10pt,onecolumn,final}
+\fi
+% \end{macrocode}
+%
+% The |\ProcessOptions| command causes the execution of the code
+% for every option \Lopt{FOO}
+% which is declared and for which the user typed
+% the \Lopt{FOO} option in his
+% |\documentclass| command. For every option \Lopt{BAR} he typed,
+% which is not declared, the option is assumed to be a global option.
+% All options will be passed as document options to any
+% |\usepackage| command in the document preamble.
+%
+% In the old \LaTeX\ the user starts his file with the command
+% \linebreak[4]|\documentstyle [OPTION1, ... ,OPTIONk]{STYLE}|
+% which saves the |OPTION|'s and |\input|'s the file |STYLE.STY|.
+% When the |STYLE.STY| file issues the command |\@options|, the
+% following happens for each i:
+%
+% If the control sequence |\ds@OPTIONi| is defined then
+% execute this option |\ds@OPTIONi|. In the other case
+% save OPTIONi on a list of unprocessed options.
+%
+% After |STYLE.STY| has been executed, the file |OPTIONi.STY| is read for
+% each |OPTIONi| on the list of unprocessed options.
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \ProcessOptions
+ \else
+ \@options
+ \fi
+% \end{macrocode}
+%
+% \subsection{Loading Packages}
+%
+% The `dinbrief' class/style file does not load additional packages.
+% The user should load `german.sty'.
+%
+% \subsection{Error messages in this class/style}
+%
+% \subsubsection{General error message}
+%
+% \begin{macro}{\ka@db@error}
+% \begin{macrocode}
+\def\ka@db@error#1{%
+ \@latexerr{%
+ Document style/class `dinbrief' error^^J%
+ #1%
+ }{%
+ No help is available for this error message.^^J%
+ Please check your input file!
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Warning within \LaTeXe\ for forbidden commands}
+%
+% Therefore we define a warning message in case forbidden
+% commands are used.
+% \begin{macro}{\ka@db@warning}
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \def\ka@db@warning#1{%
+ \@@warning{The control sequence \string#1\space should %
+ not be used in LaTeX 2e}%
+ }
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Modelling {\tt \char92 ClassWarning} in \LaTeX\ 2.09}
+% \begin{macrocode}
+\ifka@db@ltxtwoe\else
+ \def\ClassWarning#1#2{%
+ \typeout{Style #1 Warning: #2\on@line.}%
+ }
+\fi
+% \end{macrocode}
+%
+% \subsection{Font changing}
+%
+% \subsubsection{Defining old font changing commands for \LaTeXe}
+%
+% \changes{0.92.20}{1994/02/20}{The font changing has to
+% be redefined in \LaTeXe.
+% Code copied from letter class.}
+% \changes{0.94.0}{1994/08/15}{\cmd\@rewnewfontswitch renamed to
+% \cmd\DeclareOldFontCommand}
+% \changes{0.95.0}{1994/11/10}{Deleted wrong explanation.}
+%
+% Defining the font change commands for \LaTeXe.
+%
+% The following commands are only available in \LaTeXe. In older
+% versions of \LaTeX\ the commands are defined in |lfonts.???|
+% (I think so).
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+% \end{macrocode}
+% Here we supply the declarative font changing commands that were common
+% in \LaTeX\ version 2.09 and earlier. These commands work in text mode
+% \textit{and} in math mode. They are provided for compatibility, but one
+% should start using the |\text...| and |\math...| commands instead.
+% These commands are redefined using |\@renewfontswitch|, a command
+% with three arguments: the user command to be defined, \LaTeX's command
+% to be executed in text mode, and \LaTeX's command to be executed in math
+% mode.
+%
+% \begin{macro}{\rm}
+% \begin{macro}{\sf}
+% \begin{macro}{\tt}
+% The commands to change the family:
+% \begin{macrocode}
+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bf}
+% The command to change to the bold series. One should use |\mdseries| to
+% explicitly switch back to medium series.
+% \begin{macrocode}
+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\it}
+% \begin{macro}{\sl}
+% \begin{macro}{\sc}
+% And the commands to change the shape of the font. The slanted and
+% small caps shapes are not available by default as math alphabets, so
+% these changes do nothing in math mode. One should use |\upshape|
+% to explicitly change back to the upright shape.
+%
+% \begin{macrocode}
+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\cal}
+% \begin{macro}{\mit}
+% The commands |\cal| and |\mit| should only be used in math mode, outside
+% math mode they have no effect. Currently, the New Font Selection Scheme
+% defines these commands to generate warning messages. Therefore, we have
+% to define them manually.
+% \changes{1.48}{1995/06/28}{Now define \cs{cal} and \cs{mit} using
+% \cs{DeclareRobustCommand*}}
+% \begin{macrocode}
+\DeclareRobustCommand*{\cal}{\@fontswitch{\relax}{\mathcal}}
+\DeclareRobustCommand*{\mit}{\@fontswitch{\relax}{\mathnormal}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% The end of the conditional code for the font changing commands for
+% \LaTeXe.
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \subsection{A special distance}
+% \begin{macro}{\GZA}
+% Baselinedistance 1/6 in = 4,23 mm (Grundzeilenabstand DIN 2107, 2142)
+% \begin{macrocode}
+\newdimen\GZA
+\GZA=1in \divide\GZA by 6
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Fontsizes und other parameters}
+%
+% \begin{macrocode}
+\ifcase \@ptsize\relax
+% \end{macrocode}
+% \begin{macro}{\@normalsize}
+% \begin{macrocode}
+ \def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6\p@ plus3\p@ minus3\p@
+ \let\@listi\@listI
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\small}
+% \begin{macrocode}
+ \def\small{\@setsize\small{11pt}\ixpt\@ixpt
+ \abovedisplayskip 8.5\p@ plus 3\p@ minus 4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus2\p@
+ \belowdisplayshortskip 4\p@ plus2\p@ minus 2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\footnotesize}
+% \begin{macrocode}
+ \def\footnotesize{\@setsize\footnotesize{9.5pt}\viiipt\@viiipt
+ \abovedisplayskip 6\p@ plus 2\p@ minus 4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus 1\p@
+ \belowdisplayshortskip 3\p@ plus 1\p@ minus 2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 3\p@ \@plus\p@ \@minus\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\scriptsize}
+% \begin{macro}{\tiny}
+% \begin{macro}{\large}
+% \begin{macro}{\Large}
+% \begin{macro}{\LARGE}
+% \begin{macro}{\huge}
+% \begin{macro}{\Huge}
+% \begin{macrocode}
+ \def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
+ \def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
+ \def\large{\@setsize\large{14pt}\xiipt\@xiipt}
+ \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
+ \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
+ \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
+ \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
+% \end{macrocode}
+% \end{macro}^^A \Huge
+% \end{macro}^^A \huge
+% \end{macro}^^A \LARGE
+% \end{macro}^^A \Large
+% \end{macro}^^A \large
+% \end{macro}^^A \tiny
+% \end{macro}^^A \scriptsize
+% \begin{macrocode}
+\or % 11 pt option
+% \end{macrocode}
+% \begin{macro}{\@normalsize}
+% \begin{macrocode}
+ \def\@normalsize{\@setsize\normalsize{13.6pt}\xipt\@xipt
+ \abovedisplayskip 11\p@ plus3\p@ minus6\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@
+ \let\@listi\@listI
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\small}
+% \begin{macrocode}
+ \def\small{\@setsize\small{12pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6\p@ plus3\p@ minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 6\p@ \@plus2\p@ \@minus2\p@
+ \parsep 3\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\footnotesize}
+% \begin{macrocode}
+ \def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt
+ \abovedisplayskip 8\p@ plus 2\p@ minus 4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus 1\p@
+ \belowdisplayshortskip 4\p@ plus 2\p@ minus 2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\scriptsize}
+% \begin{macro}{\tiny}
+% \begin{macro}{\large}
+% \begin{macro}{\Large}
+% \begin{macro}{\LARGE}
+% \begin{macro}{\huge}
+% \begin{macro}{\Huge}
+% \begin{macrocode}
+ \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
+ \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
+ \def\large{\@setsize\large{14pt}\xiipt\@xiipt}
+ \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
+ \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
+ \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
+ \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
+% \end{macrocode}
+% \end{macro}^^A \Huge
+% \end{macro}^^A \huge
+% \end{macro}^^A \LARGE
+% \end{macro}^^A \Large
+% \end{macro}^^A \large
+% \end{macro}^^A \tiny
+% \end{macro}^^A \scriptsize
+% \begin{macrocode}
+\or % 12pt option
+% \end{macrocode}
+% \begin{macro}{\@normalsize}
+% \begin{macrocode}
+ \def\@normalsize{\@setsize\normalsize{15pt}\xiipt\@xiipt
+ \abovedisplayskip 12\p@ plus3\p@ minus7\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@
+ \let\listi\listI
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\small}
+% \begin{macrocode}
+ \def\small{\@setsize\small{13.6pt}\xipt\@xipt
+ \abovedisplayskip 11\p@ plus3\p@ minus6\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 9\p@ \@plus3\p@ \@minus5\p@
+ \parsep 4.5\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\footnotesize}
+% \begin{macrocode}
+ \def\footnotesize{\@setsize\footnotesize{12pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6\p@ plus3\p@ minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 6\p@ \@plus2\p@ \@minus2\p@
+ \parsep 3\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\scriptsize}
+% \begin{macro}{\tiny}
+% \begin{macro}{\large}
+% \begin{macro}{\Large}
+% \begin{macro}{\LARGE}
+% \begin{macro}{\huge}
+% \begin{macro}{\Huge}
+% \begin{macrocode}
+ \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
+ \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
+ \def\large{\@setsize\large{18pt}\xivpt\@xivpt}
+ \def\Large{\@setsize\Large{22pt}\xviipt\@xviipt}
+ \def\LARGE{\@setsize\LARGE{25pt}\xxpt\@xxpt}
+ \def\huge{\@setsize\huge{30pt}\xxvpt\@xxvpt}
+ \let\Huge=\huge
+% \end{macrocode}
+% \end{macro}^^A \Huge
+% \end{macro}^^A \huge
+% \end{macro}^^A \LARGE
+% \end{macro}^^A \Large
+% \end{macro}^^A \large
+% \end{macro}^^A \tiny
+% \end{macro}^^A \scriptsize
+% \begin{macrocode}
+\or % Norm-Option (DIN 2107, 2142)
+% \end{macrocode}
+% \begin{macro}{\@normalsize}
+% \begin{macrocode}
+ \def\@normalsize{\@setsize\normalsize{\GZA}\xipt\@xipt
+ \abovedisplayskip 11\p@ plus3\p@ minus6\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@
+ \let\@listi\@listI
+ }% Setting of \@listi added 22 Dec 87
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\small}
+% \begin{macrocode}
+ \def\small{\@setsize\small{11pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6\p@ plus3\p@ minus3\p@
+ \def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
+ \topsep 6\p@ plus2\p@ minus2\p@
+ \parsep 3\p@ plus2\p@ minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\footnotesize}
+% \begin{macrocode}
+ \def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt
+ \abovedisplayskip 8\p@ plus2\p@ minus4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus\p@
+ \belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
+ \def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
+ \topsep 4\p@ plus2\p@ minus2\p@
+ \parsep 2\p@ plus\p@ minus\p@
+ \itemsep \parsep}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\scriptsize}
+% \begin{macro}{\tiny}
+% \begin{macro}{\large}
+% \begin{macro}{\Large}
+% \begin{macro}{\LARGE}
+% \begin{macro}{\huge}
+% \begin{macro}{\Huge}
+% \begin{macrocode}
+ \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
+ \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
+ \def\large{\@setsize\large{14pt}\xiipt\@xiipt}
+ \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
+ \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
+ \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
+ \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
+% \end{macrocode}
+% \end{macro}^^A \Huge
+% \end{macro}^^A \huge
+% \end{macro}^^A \LARGE
+% \end{macro}^^A \Large
+% \end{macro}^^A \large
+% \end{macro}^^A \tiny
+% \end{macro}^^A \scriptsize
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\normalsize}
+% We are doing here something different from the class files of
+% \LaTeXe. This may be necessary for backward compatibility.
+%
+% If we are in \LaTeXe, then we have to define the
+% controlsequence |\normalsize|.
+%
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+\let\normalsize\@normalsize
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% We initially choose the normalsize font.
+% This code has to be executed following the definition of |\baselinestretch|,
+% if we are not running NFSS2. (This may also be true also for NFSS1.)
+% \changes{0.92.13}{1994/01/04}{Commented out and moved to the end of the file}
+% \changes{0.92.14}{1994/01/04}{Included as conditional code}
+% \begin{macrocode}
+\ifka@db@nfss
+ \normalsize
+ \else
+ \ifka@db@nfsstwo
+ \normalsize
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \subsection{Document layout}
+% \label{sec:maincode}
+%
+% In this section we are finally dealing with the nasty typographical
+% details.
+%
+% \begin{macrocode}
+% \addtolength\voffset{0.8truemm}
+% \addtolength\hoffset{-1.4truemm}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\oddsidemargin=0in
+\evensidemargin=0in
+\marginparwidth=.08in
+\marginparsep=.01in
+\marginparpush=5pt
+\topmargin=-5mm
+% \end{macrocode}
+%
+% \begin{macro}{\ltf@headheight}
+% \begin{macro}{\lts@headheight}
+% \begin{macro}{\ltf@headsep}
+% \begin{macro}{\lts@headsep}
+% \begin{macro}{\ltf@textheight}
+% \begin{macro}{\lts@textheight}
+% These dimens are used to store different values for the first page
+% and the following pages. All dimens starting with |ltf@XXX| hold
+% values for the first page and all dimens starting with |lts@XXX|
+% hold values for the second and follwing pages. We have to do
+% here such a funny coding because \LaTeX's |\thispagestyle|-mechanism
+% is not flexible enough. (This code may not complete yet!)
+%
+% We use this to move the start of the first page of a letter
+% 12~mm up.
+%
+% \begin{macrocode}
+\newdimen\ltf@headheight
+\newdimen\lts@headheight
+\newdimen\ltf@headsep
+\newdimen\lts@headsep
+\newdimen\ltf@textheight
+\newdimen\lts@textheight
+\ltf@headheight=4.2truemm %
+\lts@headheight=0truemm %
+\ltf@headsep=8.8truemm %
+\lts@headsep=0truemm %
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\footheight}
+% \LaTeXe\ has no dimen register |\footheight|, because there is no such
+% register in other \LaTeX-versions.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight=4.2truemm
+ \fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\footskip=8.8truemm
+% \end{macrocode}
+%
+% \iffalse
+% RG 29.11.93 printer can't output the last line
+% \fi
+% \changes{0.0.0}{1993/11/29}{(RG) printer can't output the last line}
+%
+% \begin{macrocode}
+\textheight=254truemm
+\textwidth=165truemm
+\columnsep=10pt
+\columnseprule=0pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\raggedbottom
+% \end{macrocode}
+%
+% \begin{macro}{\footnotesep}
+% |\footnotesep| is the height of the strut placed at the beginning
+% of every footnote. It equals the height of a normal
+% |\footnotesize| strut in this
+% class; thus no extra space occurs between footnotes.
+%
+% The class/style `dinbrief' uses only one value for
+% |\footnotesep| in all pt-sizes.
+%
+% \begin{macrocode}
+\footnotesep=4.2truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\footins}
+% |\skip\footins| is the space between the last line of the main
+% text and the top of the first footnote.
+%
+% The class/style `dinbrief' uses only one value for
+% |\footins| in all pt-sizes.
+%
+% \begin{macrocode}
+\skip\footins 10pt plus 2pt minus 4pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\floatsep=12pt plus 2pt minus 2pt
+\textfloatsep=20pt plus 2pt minus 4pt
+\intextsep=12pt plus 2pt minus 2pt
+\dblfloatsep=12pt plus 2pt minus 2pt
+\dbltextfloatsep=20pt plus 2pt minus 4pt
+\ifka@db@ltxtwoe
+ \relax
+ \else
+ \@maxsep=20pt
+ \@dblmaxsep=20pt
+ \fi
+\@fptop=0pt plus 1fil
+\@fpsep=8pt plus 2fil
+\@fpbot=0pt plus 1fil
+\@dblfptop=0pt plus 1fil
+\@dblfpsep=8pt plus 2fil
+\@dblfpbot=0pt plus 1fil
+% \end{macrocode}
+%
+% \subsubsection{User definable layout positions}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Inserted lengths to make letter layout
+% customizable by the user}
+%
+% This section defines some layout relevant lengths, all preset according
+% to DIN 676. Some of them can be redefined by the user, others are
+% bound to the class definition.
+%
+% \begin{macro}{\ka@db@txtlmarg}
+% The length |\ka@db@txtlmarg| describes the left margin of the letter
+% text and is used for correct horizontal positioning.
+% \begin{macrocode}
+\newdimen\ka@db@txtlmarg
+\ka@db@txtlmarg=24truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\addrhpos}
+% \begin{macro}{\addrvpos}
+% \begin{macro}{\addrwd}
+% \begin{macro}{\addrht}
+% \begin{macro}{\addroffset}
+% \begin{macro}{\ka@db@addrhoffs}
+% These length describe the position and size of the address field.
+% |\addrhpos| and |\addrvpos| specify the lower left corner of this
+% field, |\addrwd| and |\addrht| describe the width and the height of
+% the field.
+% The length |\addroffset| is an offset of the address text to the left
+% margin of the address field, since in most cases it is preferred to start
+% it a small amount off that margin. The default value is 4mm.
+% |\ka@db@addrhoffs| specifies the offset of the address field against the
+% beginning of the text lines (defined as 24mm off the left paper bound).
+% \begin{macrocode}
+\newdimen\addrhpos
+\newdimen\addrvpos
+\newdimen\addrwd
+\newdimen\addrht
+\newdimen\addroffset
+\newdimen\ka@db@addrhoffs
+\addrhpos=20truemm
+\addrvpos=90truemm
+\addrwd=85truemm
+\addrht=40truemm
+\addroffset=4truemm
+\ka@db@addrhoffs=-4truemm
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setaddressllcorner}
+% \begin{macro}{\setaddressllhpos}
+% \begin{macro}{\setaddressllvpos}
+% \begin{macro}{\setaddresswidth}
+% \begin{macro}{\setaddressheight}
+% \begin{macro}{\setaddressoffset}
+% \begin{macro}{\addresshigh}
+% \begin{macro}{\addressstd}
+% Four macros assign values to the lengths just defined:
+% \cmd\setaddressllcorner\ sets both |\addrhpos| and |\addrvpos|,
+% \cmd\setaddresswidth\ and \cmd\setaddressheight\ set the height |\addrht|
+% and the width |\addrwd| of the address window (without the backaddress
+% field, \cmd\setaddressoffset\ defines an offset for the address text
+% against the left margin of the address window.
+% The two remaining macros \cmd\addresshigh\ and \cmd\addressstd\ preset
+% then length |\addrvpos|, |\reflinevpos|, |\ufldmarkvpos| and
+% |\lfldmarkvpos| as required by the two variants of the DIN norm, the high
+% and the lower address fields, respectively.
+% \begin{macrocode}
+\def\setaddressllcorner#1#2{\global\addrhpos=#1\global\addrvpos=#2\relax}
+\def\setaddressllhpos#1{\global\addrhpos=#1\relax}
+\def\setaddressllvpos#1{\global\addrvpos=#1\relax}
+\def\setaddresswidth#1{\global\addrwd=#1\relax}
+\def\setaddressheight#1{\global\addrht=#1\relax}
+\def\setaddressoffset#1{\global\addroffset=#1\relax}
+\def\addresshigh{\addrvpos =72truemm%
+ \reflinevpos =80.5truemm%
+ \ufldmarkvpos=87truemm%
+ \lfldmarkvpos=192truemm}
+\def\addressstd{\addrvpos =90truemm%
+ \reflinevpos =98.5truemm%
+ \ufldmarkvpos=105truemm%
+ \lfldmarkvpos=210truemm}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\backaddrht}
+% \begin{macro}{\reflinevpos}
+% |\backaddrht| gives the height of the field for the backaddress placed
+% directly above the address fields described above.
+% |\reflinevpos| specifies the distance distance from top of the paper to
+% the upper bound of the reference line (Bezugszeichenzeile).
+% \begin{macrocode}
+\newdimen\backaddrht
+\newdimen\reflinevpos
+\backaddrht=5truemm
+\reflinevpos=98.5truemm
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setbackaddressheight}
+% \begin{macro}{\setreflinetop}
+% These two macros are used to redefine the length |\backaddrht| and
+% |\reflinevpos|.
+% \begin{macrocode}
+\def\setbackaddressheight#1{\global\backaddrht=#1\relax}
+\def\setreflinetop#1{\global\reflinevpos=#1\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ufldmarkvpos}
+% \begin{macro}{\lfldmarkvpos}
+% \begin{macro}{\perfmarkvpos}
+% \begin{macro}{\ka@db@foldmarkhoffs}
+% \begin{macro}{\ka@db@perfmarkhoffs}
+% \begin{macro}{\ka@db@foldmarklen}
+% \begin{macro}{\ka@db@perfmarklen}
+% The first three length describe the height of the tic marks:
+% |\ufldmarkvpos| and |\lfldmarkvpos| the upper and lower fold marks, and
+% |\perfmarkvpos| the mark for perforation.
+% |\ka@db@foldmarkhoffs| specifies the offset of the fold marks against the
+% beginning of the text lines (defined as 24mm off the left paper bound),
+% |\ka@db@perfmarkhoffs| definies the corresponding offset for the perforation
+% mark.
+% \begin{macrocode}
+\newdimen\ufldmarkvpos
+\newdimen\lfldmarkvpos
+\newdimen\perfmarkvpos
+\newdimen\ka@db@foldmarkhoffs
+\newdimen\ka@db@perfmarkhoffs
+\newdimen\ka@db@foldmarklen
+\newdimen\ka@db@perfmarklen
+\ufldmarkvpos=105truemm
+\lfldmarkvpos=210truemm
+\ifka@db@ltxtwoe
+ \perfmarkvpos=.5\paperheight
+\else
+ \perfmarkvpos=148.5truemm
+\fi
+\ka@db@foldmarkhoffs=-24truemm
+\ka@db@perfmarkhoffs=-18truemm
+\ka@db@foldmarklen=7truemm
+\ka@db@perfmarklen=6truemm
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setupperfoldmarkvpos}
+% \begin{macro}{\setlowerfoldmarkvpos}
+% Two macros are provided to set the distance of the upper and lower fold
+% marks from the top of the paper sheet.
+% \begin{macrocode}
+\def\setupperfoldmarkvpos#1{\global\ufldmarkvpos=#1\relax}
+\def\setlowerfoldmarkvpos#1{\global\lfldmarkvpos=#1\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bottomtextvpos}
+% The height of the lower bound of the bottom text is given by the length
+% |\bottomtextvpos|.
+% \begin{macrocode}
+\newdimen\bottomtextvpos
+\bottomtextvpos=281truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setbottomtexttop}
+% \begin{macrocode}
+\def\setbottomtexttop#1{\global\bottomtextvpos=#1\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@headup}
+% This length specifies the shift of the letter head, normally showing
+% information about the sender of the letter. It is preset with a negative
+% value shifting the letter head up as much as possible leaving a small
+% distance to the upper paper bound. The definition of the letter head
+% can shift the head downwards (upwards is not recommended).
+% \begin{macrocode}
+\newdimen\ka@db@headup
+\ka@db@headup=-19.4truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@vfuzz}
+% This length is introduced to correct absolute position values as specified
+% by the length describing the letter layout onto the internal TeX positions
+% used within this class. The value is choosen as difference of positions
+% as specified by the DIN Norm and the values used in earlier versions of
+% this class.
+% \begin{macrocode}
+\newdimen\ka@db@vfuzz
+\ka@db@vfuzz=23.9truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@stdskip}
+% This length specifies a standard skip value used for example between the
+% address and backadress field and the window rules. It is used at some
+% other places, too.
+% \begin{macrocode}
+\newdimen\ka@db@stdskip
+\ka@db@stdskip=2.5truemm
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@fieldwd}
+% \begin{macro}{\ka@db@fldskip}
+% \begin{macro}{\ka@db@shfldwd}
+% |\ka@db@fieldwd| defines the (used) width of the fields. The length
+% |\ka@db@fldskip| gives the skip (space) between consecutive fileds.
+% In case of the old reference line the phone number field has a different
+% width, specified by the length |\ka@db@shfldwd|.
+% \begin{macrocode}
+\newdimen\ka@db@fieldwd
+\newdimen\ka@db@fldskip
+\newdimen\ka@db@shfldwd
+\ka@db@fieldwd=50.8truemm
+\ka@db@fldskip=0truemm
+\ka@db@shfldwd=25.4truemm
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Rules above and below the receiver's window}
+%
+% \begin{macro}{\ifka@db@windowrules}
+% \begin{macro}{\windowrules}
+% \begin{macro}{\nowindowrules}
+% The window rules above and below the receivers address can
+% be switched on or off. The boolean variable |\ifka@db@windowrules|
+% is true if the rules have to be typeset. The user commands
+% \cmd\windowrules\ and \cmd\nowindowrules\ toggle the boolean
+% variable.
+% \begin{macrocode}
+\newif\ifka@db@windowrules
+\def\windowrules{\global\ka@db@windowrulestrue}
+\def\nowindowrules{\global\ka@db@windowrulesfalse}
+\windowrules
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Lines for splitting letters}
+%
+% \begin{macro}{\ifka@db@windowtics}
+% \begin{macro}{\windowtics}
+% \begin{macro}{\nowindowtics}
+% Save as above except the tics on the left side are typeset
+% or not.
+% \begin{macrocode}
+\newif\ifka@db@windowtics
+\def\windowtics{\global\ka@db@windowticstrue}
+\def\nowindowtics{\global\ka@db@windowticsfalse}
+\windowtics
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{\cmd\backaddress\space API function}
+%
+% \begin{macro}{\backaddress}
+% \begin{macro}{\@backaddress}
+% \begin{macrocode}
+\def\backaddress#1{\gdef\@backaddress{#1}}
+\backaddress{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Added code to enable and disable
+% underlining of the backaddress}
+%
+% \begin{macro}{\ifka@db@baddrrule}
+% \begin{macro}{\backaddressrule}
+% \begin{macro}{\nobackaddressrule}
+% The rules below the backaddress can be switched on or off by setting the
+% boolean variable |\ifka@db@baddrrule| which is true if the rule is to be
+% typeset. The user commands \cmd\backaddressrule\ (default) and
+% \cmd\nobackaddressrule\ toggle the boolean variable.
+% \begin{macrocode}
+\newif\ifka@db@baddrrule
+\def\backaddressrule{\global\ka@db@baddrruletrue}
+\def\nobackaddressrule{\global\ka@db@baddrrulefalse}
+\backaddressrule
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Macros for splitting the receiver's address}
+%
+% \changes{1.21.0}{1995/01/13}{Macros for splitting the receivers
+% address replaced with a more flexible
+% and more user friendly method}
+%
+% \begin{macro}{\@splitoncr}
+% \begin{macro}{\@splitoncrlist}
+% The macro |\@splitoncr| splits the first argument on each |\\|.
+% The second argument is a macro with exactly one argument. For each
+% part the macro (in the second) argument is called.
+% |\@splitoncrlist| is called inside |\@splitoncr| and
+% does the real work.
+% \begin{macrocode}
+\long\def\@splitoncr#1#2{%
+ \begingroup
+ % \tracingmacros=1
+ \let\\=a% because characters are not expanded
+ \long\def\@rgjob##1{#2{##1}}%
+ % \expandafter\@splitoncrlist#1\\\stop \\
+ \@splitoncrlist#1\\\stop \\
+ \endgroup}
+% \end{macrocode}
+% \changes{1.63.0}{1996/05/21}{call to \cmd\@splitoncrlist changed
+% as sugested by B.~Raichle}
+%
+% \changes{1.63.0}{1996/05/21}{order of \cmd\ifx-comparision changed}
+% There is a bug in the macro |\@splitoncrlist|. If the argument
+% starts with to two equal letters, the comparision evaluates to
+% true and the macro |\stop| is executed. This stops all
+% activities and ends \LaTeX. So we change the order of the arguments
+% of the \cs{ifx} oder |\ifx| command. We check |\stop| against the arguments
+% of the macro. This will work.
+%
+% \begin{macrocode}
+\long\def\@splitoncrlist#1\\{%
+ \ifx\stop#1\relax
+ \let\next=\relax
+% \message{Stop encountered}%
+ \else
+ \@rgjob{#1}%
+% % \typeout{The sequence: #1}%
+ \let\next=\@splitoncrlist
+ \fi
+ \next
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ignorebrackets}
+% The first argument in brackets is ignored. The third argument
+% is the name of a control sequece. This cs will be defined globally
+% with the contents of the second argument.
+%
+% \changes{1.63.0}{1996/05/21}{We made this macro long}
+%
+% \begin{macrocode}
+\long\def\@ignorebrackets[#1]#2\stop#3{%
+ \gdef#3{#2}\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.65.0}{1995/10/29}{\cmd\leavevmode\ inserted}
+% \begin{macro}{\@withmarkcr}
+% \begin{macrocode}
+\long\def\@withmarkcr!#1\stop{%
+ \xdef\@addresslist{%
+ \@addresslist\ifx\@addresslist\empty\else\leavevmode\\\fi{#1}}%
+ \@ifnextchar[%]
+ {\@ignorebrackets}{\@ignorebrackets[]}#1\stop{\@addressname}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.65.0}{1995/10/29}{\cmd\leavevmode\ inserted}
+% \begin{macro}{\@withoutmarkcr}
+% \begin{macrocode}
+\long\def\@withoutmarkcr#1\stop{%
+ \xdef\@addresslist{%
+ \@addresslist\ifx\@addresslist\empty\else\leavevmode\\\fi{#1}}
+ \ifx\@addressname\relax
+ \@ifnextchar[%]
+ {\@ignorebrackets}{\@ignorebrackets[]}#1\stop{\@addressname}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@withmark}
+% \begin{macrocode}
+\long\def\@withmark!#1\stop{%
+ \xdef\@addresslist{\@addresslist {#1}}
+ \@ifnextchar[%]
+ {\@ignorebrackets}{\@ignorebrackets[]}#1\stop{\@addressname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@withoutmark}
+% This macro is not allowed to insert a |\\| into the |\@addresslist|.
+% \begin{macrocode}
+\long\def\@withoutmark#1\stop{%
+ \xdef\@addresslist{\@addresslist {#1}}
+ \ifx\@addressname\relax
+ \@ifnextchar[%]
+ {\@ignorebrackets}{\@ignorebrackets[]}#1\stop{\@addressname}
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@withlbracket}
+% Adds to the |\@addresslist| in brackets the contents of the
+% brackts following the |\\|. Looks for a |!|.
+% \changes{1.65.0}{1995/10/29}{\cmd\leavevmode\ inserted}
+% \begin{macrocode}
+\long\def\@withlbracket[#1]#2\stop{%
+ \xdef\@addresslist{\@addresslist\ifx\@addresslist\empty\else\leavevmode\\\fi[#1]}
+ \@ifnextchar!{\@withmark}{\@withoutmark}#2\stop
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@withoutlbracket}
+% Checks if |!| is immediately following the |\\|.
+% If so |\@withmarkcr| is called otherwise |\@withoutmarkcr|
+% is called.
+% \begin{macrocode}
+\long\def\@withoutlbracket#1\stop{%
+ \@ifnextchar!{\@withmarkcr}{\@withoutmarkcr}#1\stop
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@checkformark}
+% Checks of the existence of a left bracket. Depending on the
+% presence of such a left bracket the control sequence
+% |\@withlbracket| or |\@withoutlbracket| is executed.
+% \begin{macrocode}
+\long\def\@checkformark#1{%
+ \@ifnextchar[{\@withlbracket}{\@withoutlbracket}#1\stop
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@splitaddress}
+% This macro splits the receivers address and extracts the
+% contents of a line marked with a starting |!|. Lines
+% in this context are all stuff between two |\\| or the
+% stuff between the beginning or the ending of the argument
+% and one |\\|. If no |!| is given, the first line in the
+% argument is taken (as in the former versions). If more than
+% one |!| is given (in different lines) the last line containing
+% a |!| is taken. Valid forms are |\\!|, |\\ !|, |\\![\medskipamount]|
+% and |\\[\medskipamount]!|. All four forms produce the expected
+% output!
+%
+% \changes{1.63.0}{1995/05/21}{Two \cmd\expandafter s inserted as
+% suggested by B.~Raichle}
+%
+% \begin{macrocode}
+\long\def\@splitaddress#1{%
+ \def\@addressbase{#1}
+ \let\@addressname=\relax
+ \def\@addresslist{}
+ \expandafter\@splitoncr\expandafter{\@addressbase}{\@checkformark}%
+ \gdef\toname{\@addressname}
+ % \typeout{Addresslist: \@addresslist}%
+ % \typeout{Addressname: \@addressname}%
+ % \typeout{\string\toname: \toname}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The \cmd\opening-Procedure}
+% The following macros typeset most static text areas of the letter.
+%
+% \begin{macro}{\ka@db@indadr}
+% \begin{macrocode}
+\newdimen\ka@db@indadr
+\ka@db@indadr=0pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tsfromaddress}
+% \begin{macrocode}
+\def\ka@db@tsfromaddress{%
+ \ifx\@empty\@fromaddress
+ \vbox to 0pt{\vss}\nointerlineskip
+ \else
+ \vbox to 0pt{\vskip \ka@db@headup\raggedright\@fromaddress\vss}%
+ \nointerlineskip
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tswindowtics}
+% \begin{macrocode}
+\def\ka@db@tswindowtics{%
+ \ifka@db@windowtics
+ \ka@db@tmpdimb=\ufldmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{%
+ \rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\hspace*{\ka@db@foldmarkhoffs}%
+ \vbox{\hrule width \ka@db@foldmarklen}\hss}%
+ \vss}\nointerlineskip
+ \ka@db@tmpdimb=\perfmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{%
+ \rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\hspace*{\ka@db@perfmarkhoffs}%
+ \vbox{\hrule width \ka@db@perfmarklen}\hss}%
+ \vss}\nointerlineskip
+ \ka@db@tmpdimb=\lfldmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{%
+ \rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\hspace*{\ka@db@foldmarkhoffs}%
+ \vbox{\hrule width \ka@db@foldmarklen}\hss}%
+ \vss}\nointerlineskip
+ \else
+ \ka@db@tmpdimb=\ufldmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{\rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \ka@db@tmpdimb=\perfmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{\rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \ka@db@tmpdimb=\lfldmarkvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{\rule{0pt}{\ka@db@tmpdimb}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.70.1}{2000/01/10}{(KB) Definition of \cmd\dbottomtext\ moved to
+% the place where other lengths are defined and
+% renamed to \cmd\bottomtextvpos}
+%
+% \begin{macro}{\ka@db@tsbottomtext}
+% \changes{0.0.0}{1994/02/08}{(KB) Changed to check the height of
+% the footer (\cmd\@@bottomtext\ now dimen,
+% no longer command)}
+% \changes{1.70.1}{2000/01/14}{(KB) \cmd\@@bottomtext\ removed and using
+% \cmd\ka@db@bottomtext\ instead (macro)
+% holding the argument of \cmd\bottomtext
+% or \cmd\relax}
+% \begin{macrocode}
+\def\ka@db@tsbottomtext{%
+% \ifdim\ht\@@bottomtext>0pt
+ \ifx\empty\ka@db@bottomtext
+ \relax
+ \else
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/08}{(KB) \cmd\@@bottomtext\ should be set
+% within a \env{\vbox to 0pt}{\cmd\vss ...}}
+% \changes{1.22.0}{1995/01/16}{(RG) rule position changed}
+% \changes{1.43.0}{1995/05/23}{(RG) rule position is now defined in a dimen
+% register}
+% \begin{macrocode}
+ \ka@db@tmpdimb=\bottomtextvpos
+ \advance\ka@db@tmpdimb by -\ka@db@vfuzz
+ \vbox to 0pt{%
+ \rule{0pt}{\ka@db@tmpdimb}%
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/08}{(KB) \cmd\hbox\{ ... \} moved to box \cmd\@@bottomtext}
+% \changes{0.0.0}{1994/11/17}{(RG) \cmd\unhbox\ changed to \cmd\unhcopy,
+% because we can have more than one letter
+% in one document. So the bottomline is
+% inserted into every first page of letters.}
+% \changes{1.70.1}{2000/01/14}{(KB) Inserting the contents of the macro
+% \cmd\ka@db@bottomtext\ into a box of height
+% and width 0pt}
+% \begin{macrocode}
+% \unhcopy\@@bottomtext
+ \hbox to 0pt{\hskip0pt minus 4truemm%
+ \vbox to 0pt {\raggedright \ka@db@bottomtext
+ \vss}%
+ \hss}
+ \vss
+ }\nointerlineskip%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@bafntsel}
+% The macro |\ka@db@bafntsel| selects the font size and other
+% parameters for the backaddress in the window.
+% \begin{macrocode}
+\def\ka@db@bafntsel{%
+ \ka@db@fontsize{8}{9pt}%
+ \ka@db@selectfont
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tstoaddress}
+% \begin{macrocode}
+\def\ka@db@tstoaddress{%
+% \ka@db@tmpdima=\addrhpos
+% \advance\ka@db@tmpdima by -\ka@db@txtlmarg
+ \vbox to 0pt{\vss%
+ \ifka@db@windowrules
+% \hbox to 0pt{\hspace*{\ka@db@tmpdima}\vbox{\hrule width \addrwd}\hss}%
+ \hbox to 0pt{\vbox{\hrule width \addrwd}\hss}%
+ \else
+ \hbox to 0pt{\hss}%
+ \fi
+ \vss
+ }%
+ \nointerlineskip
+% \end{macrocode}
+% \changes{1.70.1}{2000/01/09}{(KB) Inserted code to conditionally underline
+% the backaddress}
+% \begin{macrocode}
+ \ka@db@tmpdimb=\backaddrht
+ \advance\ka@db@tmpdimb by \ka@db@stdskip
+ \ifx\@empty\@backaddress
+ \vbox to \ka@db@tmpdimb{%
+ \vfill
+ }%
+ \nointerlineskip
+ \else
+ \vbox to \ka@db@tmpdimb{%
+ \vskip \ka@db@stdskip
+ \vss
+% \hbox to 0pt{\hspace*{\ka@db@tmpdima}%
+ \hbox to 0pt{%
+ \vbox{%
+ \hbox to \addrwd{\hfil
+ {\ka@db@bafntsel\@backaddress}\hfil}%
+ \ifka@db@baddrrule
+ \hrule width \addrwd%
+ \else
+ \hrule width 0pt%
+ \fi%
+ }\hss%
+ }%
+ }%
+ \nointerlineskip
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \moveright\addroffset%
+ \vbox to \addrht{%
+ \vss
+ \hbox to 0pt{\hskip0pt minus 4truemm%
+ \setbox\@tempboxa=\vbox{%
+ \if@letterform
+ \relax
+ \else
+ % \typeout{Start dumping \string\@addresslist}%
+ \leavevmode
+ \ka@db@ifemptyvarlocal{postremark}{}{%
+ \ka@db@usevarlocal{postremark}\\[\medskipamount]
+ }%
+ \raggedright \@addresslist
+ % \typeout{End dumping \string\@addresslist}%
+ \fi
+ }%
+ \ifdim\ht\@tempboxa>\the\addrht
+ %\@warning{Receivers address is larger than letter window}%
+ \ClassWarning{dinbrief}{%
+ Receivers address is larger than letter window}%
+ \else
+ \setbox\@tempboxa=\vbox{%
+ \hbox{%
+ \ifdim\ka@db@indadr>0pt
+ \else
+ \hbox to 0pt{\hskip4in\ka@db@usevarlocal{handling}\hss}%
+ \fi
+ \box\@tempboxa
+ }%
+ \if@toadrcenter\relax
+ \else\vskip \the\ka@db@stdskip minus \the\ka@db@stdskip
+ \fi
+ }%
+ \fi
+ \box\@tempboxa
+ \hss
+ }%
+ \if@toadrcenter
+ \vss
+ \fi
+ }\nointerlineskip
+ \vskip \ka@db@stdskip
+% \end{macrocode}
+% \begin{macrocode}
+ \vbox to 0pt{\vss%
+ \ifka@db@windowrules
+% \hbox to 0pt{\hspace*{\ka@db@tmpdima}\vbox{\hrule width \addrwd}\hss}%
+ \hbox to 0pt{\vbox{\hrule width \addrwd}\hss}%
+ \else
+ \hbox to 0pt{\hss}%
+ \fi
+ \vss
+ }\nointerlineskip
+%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tsrefline}
+% \begin{macrocode}
+\def\ka@db@tsrefline{%
+ \if@norefline\else
+% \vbox{\vskip 6truemm
+ \vbox{%
+ \if@refline
+ \@answerto
+ \else
+ \if@letterform\relax\else
+ \ifx\@empty\@place
+ \raggedleft \@date
+ \else
+ \raggedleft \@place,\space\@date
+ \fi
+ \fi
+ \fi
+ }%
+% }%
+ \nointerlineskip
+ \par
+ \bigskip
+ \fi %\if@norefline
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tsconcern}
+% \begin{macrocode}
+\def\ka@db@tsconcern{%
+ \ifx\@empty\@concern \else
+ \if@letterform\relax\else
+ \@concern \par
+ \bigskip
+ \fi
+ \fi
+ \vspace{0pt plus 10truemm}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tsopening}
+% \begin{macrocode}
+\def\ka@db@tsopening#1{%
+ \if@letterform\relax\else
+ #1\par
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% The following macros just link type above one to the calls.
+% This makes it more easy to modify parts in one letter or to
+% modify the layout.
+%
+% \begin{macro}{\ka@db@placefromaddress}
+% \begin{macro}{\ka@db@placewindowtics}
+% \begin{macro}{\ka@db@placebottomtext}
+% \begin{macro}{\ka@db@placetoaddress}
+% \begin{macro}{\ka@db@placerefline}
+% \begin{macro}{\ka@db@placeconcern}
+% \begin{macro}{\ka@db@placeopening}
+% \begin{macrocode}
+\def\ka@db@placefromaddress{%
+ \vbox to 0pt{\ka@db@tsfromaddress\vss}\nointerlineskip
+}%
+\def\ka@db@placewindowtics{%
+ \vbox to 0pt{\ka@db@tswindowtics\vss}\nointerlineskip
+}%
+\def\ka@db@placebottomtext{%
+ \vbox to 0pt{\ka@db@tsbottomtext\vss}\nointerlineskip
+}%
+\def\ka@db@placetoaddress{%
+ \ka@db@tmpdima=\addrvpos
+ \advance\ka@db@tmpdima by -\ka@db@vfuzz
+ \advance\ka@db@tmpdima by -\addrht
+ \advance\ka@db@tmpdima by -\backaddrht
+ \advance\ka@db@tmpdima by -\ka@db@stdskip
+ \vskip \ka@db@tmpdima
+ \ka@db@tmpdima=\addrht
+ \advance\ka@db@tmpdima by \backaddrht
+ \advance\ka@db@tmpdima by 2\ka@db@stdskip
+ \ka@db@tmpdimb=\addrhpos
+ \advance\ka@db@tmpdimb by -\ka@db@txtlmarg
+ \moveright\ka@db@tmpdimb\vbox to \ka@db@tmpdima{\ka@db@tstoaddress\vss}%
+ \nointerlineskip
+ \ka@db@tmpdima=\reflinevpos
+ \advance\ka@db@tmpdima by -\addrvpos
+ \advance\ka@db@tmpdima by -\ka@db@stdskip
+ \vskip \ka@db@tmpdima
+}%
+\def\ka@db@placerefline{%
+ \vbox{\ka@db@tsrefline}\nointerlineskip
+}%
+\def\ka@db@placeconcern{
+ \vbox{\ka@db@tsconcern}\nointerlineskip
+}%
+\def\ka@db@placeopening#1{%
+ \ka@db@tsopening{#1}%
+ \nobreak
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\opening}
+% This macro draws the letter from the top until the subject (concern).
+% And if available also the bottomtext.
+%
+% First we switch to a special pagestyle.
+% \begin{macrocode}
+\def\opening#1{%
+% \end{macrocode}
+% \changes{1.22.0}{1995/01/19}{(RG) State counter added to \cmd\opening.}
+% \changes{1.72.0}{2000/03/02}{(KB) Check \cmd\footskip\ set to 0pt as done by
+% the pagestyles empty, headings and myheadings
+% and calculate position of bottomtext as if
+% \cmd\footskip\ would be 8.8mm.}
+%
+% \begin{macrocode}
+ \setcounter{lt@state}{2}
+ \thispagestyle{first@page}
+% \end{macrocode}
+% Actually enlarge the first page by the negative height of the footer:
+% \begin{macrocode}
+ \ifka@db@ltxtwoe
+ \ifx\empty\ka@db@bottomtext
+ \relax
+ \else
+ \ka@db@tmpdima=\textheight
+ \advance\ka@db@tmpdima by \topmargin
+ \advance\ka@db@tmpdima by \ka@db@vfuzz
+ \ifdim\footskip>0pt
+ \advance\ka@db@tmpdima by \footskip
+ \else
+ \advance\ka@db@tmpdima by 8.8truemm
+ \fi
+ \advance\ka@db@tmpdima by -\bottomtextvpos
+ \ifdim\ka@db@tmpdima>0pt
+ \enlargethispage{-\ka@db@tmpdima}
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
+% Then we start printing the parts of the letter.
+% The following macros expect special positions on the paper to
+% print their contents on the correct position. |\ka@db@placefromaddress|,
+% |\ka@db@placewindowtics| and \hfil\break |\ka@db@placebottomtext|
+% start from the left top corner of the paper. (Maybe not correct:
+% top: 1in + |\headheight| + |\headsep| + |\topskip|(?) left: ???)
+% |\ka@db@placetoaddres| starts at the position, mentioned in the
+% DIN 676. It has to typeset to box containing the address of the
+% receiver plus the necessary space (normaly two lines).
+% The other three macros |\ka@db@placerefline|, |\ka@db@placeconcern|
+% and |\ka@db@placeopening| typeset their contents and the
+% necessary space. All these macros should typeset boxes.
+% There should be no |\interlineskip| between each of those boxes.
+%
+% \begin{macrocode}
+ \ka@db@placefromaddress
+ \ka@db@placewindowtics
+ \ka@db@placebottomtext
+ \ka@db@placetoaddress
+ \ka@db@placerefline
+ \ka@db@placeconcern
+ \ka@db@placeopening{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oldopening}
+% \changes{1.72.0}{2000/02/29}{(KB) Box \cmd\@@bottomtext\ no longer used by
+% \cmd\opening\ (and thus dropped) defined here
+% to make \cmd\oldopening\ work as before}
+% \begin{macrocode}
+\def\oldopening#1{\thispagestyle{first@page}
+% \end{macrocode}
+% Actually enlarge the first page by the negative height of the footer:
+% \begin{macrocode}
+ \ifka@db@ltxtwoe
+ \expandafter\ifx\csname @@bottomtext\endcsname\relax
+ \newbox\@@bottomtext
+ \fi
+ \ifx\empty\ka@db@bottomtext
+ \setbox\@@bottomtext=\vbox to 0pt{}
+ \else
+ \setbox\@@bottomtext=\hbox to 0pt{\hskip0pt minus 4truemm%
+ \vbox{\raggedright \ka@db@bottomtext}%
+ \hss}
+ \fi
+ \enlargethispage{-\ht\@@bottomtext}
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \ifx\@empty\@fromaddress
+ \vbox to 0pt{\vss}\nointerlineskip
+ \else
+ \vbox to 0pt{\vskip -19.4truemm\raggedright\@fromaddress\vss}%
+ \fi
+ \vskip 13.1truemm
+%
+ \ifx\@empty\@@windowtics
+ \vbox to 0pt{\rule{0pt}{62.5truemm}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \vbox to 0pt{\rule{0pt}{106.0truemm}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \vbox to 0pt{\rule{0pt}{167.5truemm}%
+ \hbox to 0pt{\vbox{\hrule width 0pt}\hss}%
+ \vss}\nointerlineskip
+ \else
+ \vbox to 0pt{%
+ \rule{0pt}{62.5truemm}%
+ \hbox to 0pt{\hspace*{-24truemm}\vbox{\hrule width 7truemm}\hss}%
+ \vss}\nointerlineskip
+ \vbox to 0pt{%
+ \rule{0pt}{106.0truemm}%
+ \hbox to 0pt{\hspace*{-18truemm}\vbox{\hrule width 6truemm}\hss}%
+ \vss}\nointerlineskip
+ \vbox to 0pt{%
+ \rule{0pt}{167.5truemm}%
+ \hbox to 0pt{\hspace*{-24truemm}\vbox{\hrule width 7truemm}\hss}%
+ \vss}\nointerlineskip
+ \fi
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/08}{(KB) Changed to check the height of
+% the footer (\cmd\@@bottomtext\ now dimen,
+% no longer command)}
+% \begin{macrocode}
+ \ifdim\ht\@@bottomtext>0pt
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/08}{(KB) \cmd\@@bottomtext\ should be set
+% within a \env{\vbox to 0pt}{\cmd\vss ...}}
+% \begin{macrocode}
+ \vbox to 0pt{%
+ \rule{0pt}{243.5truemm}%
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/08}{(KB) \cmd\hbox{ ... } moved to box \cmd\@@bottomtext}
+% \changes{0.0.0}{1994/11/17}{(RG) \cmd\unhbox\ changed to \cmd\unhcopy,
+% because we can have more than one letter
+% in one document. So the bottomline is
+% inserted into every first page of letters.}
+% \begin{macrocode}
+ \unhcopy\@@bottomtext
+ \vss}\nointerlineskip%
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+ \vbox to 0pt{\vss%
+ \ifx\@empty\@@windowrules
+ \hbox to 0pt{\hss}%
+ \else
+ \hbox to 0pt{\hspace*{-4truemm}\vbox{\hrule width 85truemm}\hss}%
+ \fi
+ \vss}\nointerlineskip
+%
+ \ifx\@empty\@backaddress
+ \vbox to 7.5truemm{
+ \vfill
+ }\nointerlineskip
+ \else
+ \vbox to 7.5truemm{
+ \vskip 2.5truemm
+ \vss
+ \hbox to 0pt{\hspace*{-4truemm}\vbox{%
+ \hbox to 85truemm{\hfill
+ {\ka@db@fontsize{8}{9pt}
+ \ka@db@selectfont \@backaddress}\hfill}%
+ \hrule width 85truemm}\hss}%
+ \vss}\nointerlineskip
+ \fi
+%
+ \vbox to 40truemm{%
+ \vss
+ \hbox to 0pt{\hskip0pt minus 4truemm%
+ \vbox{%
+ \if@letterform
+ \relax
+ \else
+ % \typeout{Start dumping \string\@addresslist}%
+ \raggedright \@addresslist %\toname \\ \toaddress%
+ % \typeout{End dumping \string\@addresslist}%
+ \if@toadrcenter\relax
+ \else\vskip 2.5truemm minus 2.5truemm
+ \fi
+ \fi
+ }%
+ \hss}
+ \if@toadrcenter
+ \vss
+ \fi
+ }\nointerlineskip
+ \vskip 2.5truemm
+%
+ \vbox to 0pt{\vss%
+ \ifx\@empty\@@windowrules
+ \hbox to 0pt{\hss}%
+ \else
+ \hbox to 0pt{\hspace*{-4truemm}\vbox{\hrule width 85truemm}\hss}%
+ \fi
+ \vss}\nointerlineskip
+%
+ \if@norefline\else
+ \vbox{\vskip 6truemm
+ \vbox{%
+ \if@refline
+ \@answerto
+ \else
+ \if@letterform\relax\else
+ \ifx\@empty\@place
+ \raggedleft \@date
+ \else
+ \raggedleft \@place,\space\@date
+ \fi
+ \fi
+ \fi
+ }%
+ }%
+ \nointerlineskip
+ \par
+ \bigskip
+ \fi %\if@norefline
+ \ifx\@empty\@concern \else
+ \if@letterform\relax\else
+ \@concern \par
+ \bigskip
+ \fi
+ \fi
+ \ifx\@empty\@footer \else
+ \fi
+ \vspace{0pt plus 10truemm}
+ \if@letterform\relax\else
+ #1\par
+ \fi
+ \nobreak}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\closing}
+% \changes{1.64.0}{1996/08/06}{(RG) closing has now an optional argument}
+% \changes{1.65.0}{1995/10/29}{(RG) removed argument hash mark \# (bug)}
+% \begin{macro}{\ka@db@closinghook}
+% \begin{macrocode}
+\long\def\closing{%
+ \@ifnextchar[%]
+ {\ka@db@closing}{\ka@db@closing[]}%
+}
+\long\def\ka@db@closing[#1]#2{%
+% \end{macrocode}
+% \changes{1.22.0}{1995/01/19}{(RG) State counter added to \cmd\closing.}
+% \changes{1.70.1}{2000/01/10}{(KB) Changed placing of the graphical signature
+% according to the proposal for a graphical
+% signature by Martin Haefele, Max Planck
+% Institute for Dynamics of Complex Technical
+% Systems at Magdeburg}
+% \begin{macrocode}
+ \setcounter{lt@state}{3}
+ \setbox\@tempboxa=\hbox{#1}
+ \ka@db@tmpdimb=\ht\@tempboxa
+ \advance\ka@db@tmpdimb by \dp\@tempboxa
+ \par\nobreak
+ \vspace{\parskip}
+ \stopbreaks
+ {%
+ \leavevmode
+ \ifka@db@enclright
+ \bgroup
+% \@tempdima=\textwidth
+ \ka@db@tmpdima=4in
+% \advance\@tempdima by -\ka@db@tmpdima
+% \hbox to 0pt{%
+% \hskip\@tempdimb\relax
+% \parbox[t]{\@tempdima}{%\parskip .7em
+% \ka@db@tsenclcc}%
+% \hss
+% }%
+ \parbox[t]{\ka@db@tmpdima}{%\parskip .7em%
+ \raggedright
+ \ifdim\ka@db@tmpdimb>0pt
+ \ignorespaces #2\\[1\baselineskip]
+ \else
+ \ignorespaces #2\\[3\baselineskip]
+ \fi
+ \leavevmode
+% \vbox to 0pt{%
+% \vskip -4\baselineskip\relax
+% \hbox to 0pt{\strut#1\hss}%
+% \vss}%
+% \ifx\@empty\@fromsig
+% \else \@fromsig
+% \fi\strut
+ \ifdim\ka@db@tmpdimb>0pt
+ \rule{0pt}{2\baselineskip}\box\@tempboxa \newline
+ \ka@db@ifemptyvar{signature}{}{%
+ \ka@db@usevar{signature}%
+ }%
+ \else
+ \ka@db@ifemptyvar{signature}{}{%
+ \ka@db@usevar{signature}%
+ }%
+ \fi
+ \strut
+ }%
+ \@tempdima=\textwidth
+ \advance\@tempdima by -\ka@db@tmpdima
+ \parbox[t]{\@tempdima}{%\parskip .7em%
+ \raggedright
+ \ka@db@tsenclcc
+ \unskip % <- removing unneccessary skip from
+ % \cmd\ka@db@tsenclcc
+ }%
+ \egroup
+ \else
+ \raggedright
+ \ifdim\ka@db@tmpdimb>0pt
+ \ignorespaces #2\\[1\baselineskip]
+ \else
+ \ignorespaces #2\\[3\baselineskip]
+ \fi
+ \leavevmode%
+% \vbox to 0pt{%
+% \vskip -4\baselineskip\relax
+% \hbox to 0pt{\strut#1\hss}%
+% \vss}%
+% \ifx\@empty\@fromsig
+% \else \@fromsig
+% \fi\strut
+ \ifdim\ka@db@tmpdimb>0pt
+ \rule{0pt}{2\baselineskip}\box\@tempboxa \\
+ \ka@db@ifemptyvar{signature}{}{%
+ \ka@db@usevar{signature}%
+ }%
+ \else
+ \ka@db@ifemptyvar{signature}{}{%
+ \ka@db@usevar{signature}%
+ }%
+ \fi
+ \strut
+ \fi
+ }%
+ \par\medskip
+ \ifka@db@enclright
+ \else
+ \raggedright
+ \ka@db@tsenclcc
+ \fi
+ \ka@db@closinghook
+}
+\def\ka@db@closinghook{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@tsenclcc}
+% \begin{macrocode}
+\def\ka@db@tsenclcc{%
+ \ka@db@ifemptyvarlocal{encl}%
+ {}{\ka@db@usevarlocal{encl}\\[\baselineskip]}%
+ \ka@db@ifemptyvarlocal{cc}%
+ {}{\ka@db@usevarlocal{cc}\\[\baselineskip]}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Initialization}
+%
+% \subsubsection{Words}
+%
+% \begin{macro}{\ccname}
+% \begin{macro}{\enclname}
+% \begin{macro}{\psname}
+% This document style/class is prepared for documents in German.
+% To prepare a version for another language, various German words must
+% be replaced.
+%
+% All German words that require replacement are
+% defined below in command names. (Not all!)
+%
+% \begin{macrocode}
+\def\ccname{Verteiler}
+\def\enclname{Anlage(n)}
+\def\psname{PS}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\headtoname}
+% \begin{macro}{\pagename}
+% These two words are used in the pagestyles |headings| and |contheadings|.
+% \begin{macrocode}
+\def\headtoname{An}
+\def\pagename{Seite}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{More letter macros}
+%
+% \begin{macro}{\handling}
+% \begin{macrocode}
+\def\handling#1{%
+ \ka@db@assignvarlocal{handling}{#1}%
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{handling}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\postremark}
+% \begin{macrocode}
+\def\postremark#1{%
+ \ka@db@assignvarlocal{postremark}{#1}%
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{postremark}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.52.0}{1995/06/29}{(RG) generic command for all enclosures added.}
+% \begin{macro}{\ka@db@genencl}
+% The macro \cmd\ka@db@genencl can be called at every
+% position inside the {\tt letter}-environment. If it is called
+% between \cmd\closing\ and \env\end{letter}\ it directly typesets
+% its arguments. If it is called before \cmd\closing\ is
+% given it stores its arguments in the variable.
+% \cmd\closing\ will typeset all the stuff.
+%
+% \begin{macrocode}
+\def\ka@db@genencl#1[#2]#3{%
+ \ifnum\c@lt@state=3\relax
+ \par
+ \noindent{%
+ \bgroup
+ \def\tmpa{#2}%
+ \expandafter\egroup
+ \ifx\tmpa\@empty\else
+ #2\hfil\break
+ \fi
+ \ignorespaces #3\strut}%
+ \par
+ \else
+ \bgroup
+ \def\tmpa{#2}%
+ \expandafter\egroup
+ \ifx\tmpa\@empty
+ \ka@db@assignvarlocal{#1}{#3}%
+ \else
+ \ka@db@assignvarlocal{#1}{#2\hfil\break #3}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.22.0}{1995/01/19}{(RG) \cmd\cc\ and \cmd\encl\ extended.}
+% \begin{macro}{\cc}
+% \begin{macro}{\encl}
+% The macros \cmd\cc\ and \cmd\encl\ new use the generic enclosures
+% macro.
+%
+% \begin{macrocode}
+\def\cc{%
+ \@ifnextchar[%]
+ {\ka@db@genencl{cc}}{\ka@db@genencl{cc}[\ccname]}%
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{cc}{}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\encl{%
+ \@ifnextchar[%]
+ {\ka@db@genencl{encl}}{\ka@db@genencl{encl}[\enclname]}%
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{encl}{}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Changed \cmd\\\ to \cmd\newline}
+% \begin{macro}{\ps}
+% \begin{macrocode}
+\def\ps#1{\par\noindent{\psname \newline
+ \ignorespaces #1\strut}\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\stopletter}
+% |\stopletter| ist a hook to execute own commands at the end
+% of a given letter.
+% \begin{macrocode}
+\def\stopletter{}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Styles for the labels}
+% \changes{0.0.0}{1993/02/06}{(RG) Labels got some styles.}
+%
+% \subsubsection{Labels with different sizes}
+%
+% \begin{macro}{\dlabelheight}
+% \begin{macro}{\dlabeltopmargin}
+% \begin{macro}{\dlabelwidth}
+% \begin{macro}{\clabelnumber}
+% The size of labels in the labelstyle plain can be modified.
+% Therefore we define some dimen-register (count-register) holding
+% the hight, the topmargin and the number of labels.
+% \begin{macrocode}
+\newdimen\dlabelheight
+\newdimen\dlabeltopmargin
+\newdimen\dlabelwidth
+\newcount\clabelnumber
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setlabelheight}
+% \begin{macro}{\setlabelwidth}
+% \begin{macro}{\setlabeltopmargin}
+% \begin{macro}{\setlabelnumber}
+% These four macros assigns values to the lengths and counter defined
+% above.
+% \begin{macrocode}
+\def\setlabelheight#1{\global\dlabelheight=#1\relax}
+\def\setlabelwidth#1{\global\dlabelwidth=#1\relax}
+\def\setlabeltopmargin#1{\global\dlabeltopmargin=#1\relax}
+\def\setlabelnumber#1{\global\clabelnumber=#1\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Etihoehe}
+% \begin{macro}{\Etirand}
+% \begin{macro}{\Etizahl}
+% These three macros assigns values to the counters defined
+% above.
+% \begin{macrocode}
+\def\Etihoehe#1{%
+ %\@warning{Use \string\setlabelheight\space instead %
+ % of \string\Etihoehe}%
+ \ClassWarning{dinbrief}{%
+ Use \string\setlabelheight\space instead of \string\Etihoehe}%
+ \setlabelheight{#1}%
+ }
+\def\Etirand#1{
+ %\@warning{Use \string\setlabeltopmargin\space instead %
+ % of \string\Etirand}%
+ \ClassWarning{dinbrief}{%
+ Use \string\setlabeltopmargin\space instead of \string\Etirand}%
+ \setlabeltopmargin{#1}%
+ }
+\def\Etizahl#1{
+ %\@warning{Use \string\setlabelnumber\space instead %
+ % of \string\Etizahl}%
+ \ClassWarning{dinbrief}{%
+ Use \string\setlabelnumber\space instead of \string\Etizahl}%
+ \setlabelnumber{#1}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Defining the standard dinbrief labels}
+% The following parameters are for the a4-label-papers
+% from Herma (copy-print, No.\ 4452).
+%
+% \begin{macrocode}
+\setlabelheight{41.15truemm}%
+\setlabeltopmargin{8.85truemm}%
+\setlabelwidth{80truemm}%
+\setlabelnumber{7}%
+% \end{macrocode}
+%
+% \subsection{Empty labels within labelstyle plain}
+%
+% \begin{macro}{\cspare}
+% \begin{macrocode}
+\newcount\cspare
+\cspare=0
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\spare}
+% \begin{macrocode}
+\def\spare#1{\cspare=#1\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{different labelstyles}
+% This version of the dinbrief supports different styles for labels.
+% This allows the generation of papers containing several labels or
+% printing directly on envelopes. The control sequence |\labelstyle|
+% allows to change the layout.
+%
+% For each layout two control sequences |\label@|STYLENAME and \hfil\break
+% |\lstyle@|STYLENAME have to be defined. |\label@|STYLENAME
+% is called from |\mlabel| for each label and has to typeset
+% this label. |\lstyle@|STYLENAME is called from |\startlabels|
+% and has to do the general setup (for example changing the
+% page layout).
+%
+% It is very difficult to say which counters and lengths have
+% to redefined in this macros.
+%
+% \begin{macro}{\labelstyle}
+% |\labelstyle| is a command to define the layout of the labels.
+% Normally, labels are printed on special paper, but some printers
+% are able to print on envelopes. Therefore we define some styles
+% for printing labels on envelops:
+%
+% \medskip
+% \begin{tabular}{clcl}
+% \hline
+% \multicolumn{2}{c}{Briefh\"ullenformat} &
+% \multicolumn{2}{c}{Gebr\"auchliches}\\
+% \multicolumn{2}{c}{} &
+% \multicolumn{2}{c}{Einlagenformat}\\
+% \multicolumn{1}{c}{Kurz-} &
+% \multicolumn{1}{c}{Au\ss enma\ss e} &
+% \multicolumn{1}{c}{Kurz-} &
+% \multicolumn{1}{c}{Ma\ss e}\\
+% \multicolumn{1}{c}{zeichen}&
+% \multicolumn{1}{c}{mm $\pm$ 1{,}5}&
+% \multicolumn{1}{c}{zeichen}&
+% \multicolumn{1}{c}{mm}\\
+% \hline
+% C6 & 114 $\times$ 162 & A6 & 105 $\times$ 148 \\
+% DL & 110 $\times$ 220 & --- & 105 $\times$ 210 \\
+% C6/C5 & 114 $\times$ 229 & --- & 105 $\times$ 210 \\
+% \hline
+% \end{tabular}
+%
+% \medskip
+% Das Einlagenformat 105 mm $\times$ 210 mm ergibt sich
+% durch Faltung nach DIN~676.
+%
+% \begin{macro}{\@labelstyle}
+% Labelstyle holds the current value.
+% \begin{macrocode}
+\def\labelstyle#1{\def\@labelstyle{#1}}
+\labelstyle{plain}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if@kadb@tracelabels}
+% \begin{macrocode}
+\newif\if@kadb@tracelabels
+\@kadb@tracelabelsfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\label@plain}
+% \begin{macrocode}
+\long\def\label@plain#1#2{\setbox0\vbox{\hsize=\dlabelwidth
+ \strut\ignorespaces #2}%{}%
+ \vbox to\dlabelheight{%
+ \if@kadb@tracelabels
+ \hrule
+ \fi
+ \vss
+ \hbox to \dlabelwidth{%
+ \hss
+ \if@kadb@tracelabels
+ \vrule
+ \fi
+ \vbox to\dlabelheight{\vss \box0 \vss}%
+ \if@kadb@tracelabels
+ \vrule
+ \fi
+ \hss
+ }%
+ \vss
+ \if@kadb@tracelabels
+ \hrule
+ \fi
+ }%
+ \advance\labelcount by 1\nointerlineskip
+ \ifnum\labelcount<\clabelnumber
+ \else
+ \vfill\newpage
+ \labelcount=0
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\label@C6}
+% \begin{macro}{\label@DL}
+% \begin{macro}{\label@C6/C5}
+% \begin{macro}{\label@deskjet}
+% \begin{macrocode}
+\long\def\label@deskjet#1#2{\setbox0\vbox{\parbox[b]{3.6in}{
+ \vbox to 0pt{\vss%
+ \ifx\@empty\@@windowrules
+ \hbox to 0pt{\hss}%
+ \else
+ \hbox to 0pt{\hspace*{-4truemm}%
+ \vbox{\hrule width 85truemm}\hss}%
+% \hbox to 0pt{\hspace*{\ka@db@addrhoffs}%
+% \vbox{\hrule width \addrwd}\hss}%
+ \fi
+ \vss}\nointerlineskip
+%
+ \vbox to 7.5truemm{
+% \ka@db@tmpdimb=\backaddrht
+% \advance\ka@db@tmpdimb by \ka@db@stdskip
+% \vbox to \ka@db@tmpdimb{%
+ \vskip 2.5truemm
+% \vskip \ka@db@stdskip
+ \vss
+ \hbox to 0pt{\hspace*{-4truemm}\vbox{%
+ \hbox to 85truemm{\hfill{\ka@db@fontsize{8}{9pt}
+ \ka@db@selectfont #1}\hfill}
+ \hrule width 85truemm}\hss}%
+% \hbox to 0pt{\hspace*{\ka@db@addrhoffs}\vbox{%
+% \hbox to \addrwd{\hfil{\ka@db@fontsize{8}{9pt}
+% \ka@db@selectfont #1}\hfil}
+% \hrule width \addrwd}\hss}%
+ \vss}\nointerlineskip
+%
+ \vbox to 40truemm{%
+% \vbox to \addrht{%
+ \vss
+ \hbox to 0pt{\hskip0pt minus 4truemm%
+ \vbox{\raggedright #2%
+ \if@toadrcenter
+ \relax\else\vskip 2.5truemm minus 2.5truemm
+% \relax\else\vskip \the\ka@db@stdskip minus \the\ka@db@stdskip
+ \fi}%
+ \hss}
+ \if@toadrcenter
+ \vss
+ \fi
+ }\nointerlineskip
+ \vskip 2.5truemm
+% \vskip \ka@db@stdskip
+%
+ \vbox to 0pt{\vss%
+ \ifx\@empty\@@windowrules
+ \hbox to 0pt{\hss}%
+ \else
+ \hbox to 0pt{\hspace*{-4truemm}%
+ \vbox{\hrule width 85truemm}\hss}%
+% \hbox to 0pt{\hspace*{\ka@db@addrhoffs}%
+% \vbox{\hrule width \addrwd}\hss}%
+ \fi
+ \vss}\nointerlineskip
+ }}%
+ \vbox to 0pt{\vss}%
+ \vskip 18.0truemm
+% \vskip ???
+ \vbox to 50.8truemm{\vss \box0 \vss}%
+% \vbox to \ka@db@???{\vss \box0 \vss}%
+ \ifnum\labelcount=4 \labelcount=0
+ \else \advance\labelcount by 1\nointerlineskip
+ \fi
+ \vfill
+ \newpage
+}
+\expandafter\let\csname label@C6\endcsname =\label@deskjet
+\expandafter\let\csname label@DL\endcsname =\label@deskjet
+\expandafter\let\csname label@C6/C5\endcsname =\label@deskjet
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\mlabel}
+% |\mlabel| typesets a single label.
+% \begin{macrocode}
+\long\def\mlabel#1#2{\@nameuse{label@\@labelstyle}{#1}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lstyle@plain}
+% \begin{macrocode}
+\def\lstyle@plain{
+ \topmargin=-25.4truemm%
+ \advance\topmargin\dlabeltopmargin
+ \headsep\z@
+ \headheight\z@
+ \topskip\z@
+ \oddsidemargin=-12.9truemm
+ \evensidemargin=-12.9truemm
+ \textheight=\clabelnumber\dlabelheight
+ \advance\textheight by .0001truemm
+ \@colht=\textheight \@colroom=\textheight \vsize=\textheight
+ \columnsep=25mm
+ \textwidth=2\dlabelwidth
+ \advance\textwidth by\columnsep
+ \ka@db@fontsize{12}{14.4pt}\ka@db@selectfont
+ \boxmaxdepth\z@
+ \parindent\z@
+ \parskip\z@skip
+ \twocolumn\relax
+ \ifnum\cspare>\z@
+ \ifnum\cspare<\clabelnumber\else
+ \mbox{}%
+ \newpage
+ \advance\cspare -\clabelnumber
+ \fi
+ \advance\labelcount by\cspare
+ \nointerlineskip
+ \vbox to \cspare\dlabelheight{\vfill}%
+% \vbox{\rule{4pt}{\cspare\dlabelheight}}%
+ \nointerlineskip
+ \nobreak
+ \else
+ \nointerlineskip
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\lstyle@deskjet}
+% \begin{macrocode}
+\def\lstyle@deskjet{
+ \textheight=25.4truecm
+ \advance\textheight by .0001truemm
+% \@colht=\textheight \@colroom=\textheight \vsize=\textheight
+ \textwidth=193.3truemm
+ \columnsep=25pt
+% \ka@db@fontsize{12}{14.4pt}\ka@db@selectfont
+% \boxmaxdepth=0pt
+% \twocolumn
+ \relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\startlabels}
+% \begin{macrocode}
+\def\startlabels{%
+ \nointerlineskip
+ \labelcount=0
+ \pagestyle{empty}
+ \let\@texttop=\relax
+% \topmargin=-17.6truemm
+% \headsep=0pt
+% \oddsidemargin=-12.3truemm
+% \evensidemargin=-12.3truemm
+% \textheight=25.4truecm
+% \advance\textheight by .0001truemm
+% \@colht=\textheight \@colroom=\textheight \vsize=\textheight
+% \textwidth=193.3truemm
+% \columnsep=25pt
+% \ka@db@fontsize{12}{14.4pt}\ka@db@selectfont
+% \boxmaxdepth=0pt
+% \twocolumn\relax
+ \@nameuse{lstyle@\@labelstyle}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Processing of a single letter}
+%
+% \begin{macro}{lt@state}
+% The counter |c@lt@state| holds values from 0 to 3. These
+% values indicate different states inside the letter.
+%
+% \smallskip
+% \begin{tabular}{cl}
+% 0 & We are outside the letter environment.\\
+% 1 & We are between \verb.\begin{letter}. and \verb.\opening.\\
+% 2 & We are between \verb.\opening. and \verb.\closing.\\
+% 3 & We are between \verb.\closing. and \verb.\end{letter}.\\
+% \end{tabular}
+% \smallskip
+%
+% This counter should replace the old boolean flag |\ifka@db@inletter|.
+% We further use the different states to change the behavior of some
+% API macros. This is necessary because the {\tt old dinbrief\/}
+% requests to have \cmd\Anlagen\ and \cmd\Verteiler\ beeing in front of
+% \cmd\closing. And our implementation wants to have \cmd\encl\
+% and \cmd\cc\ after the \cmd\closing{}-command.
+%
+% \begin{macrocode}
+\newcounter{lt@state}%
+\setcounter{lt@state}{0}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{letter}
+% The counter |letter| counts the number of letters.
+% \begin{macrocode}
+\newcounter{letter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\letter}
+% \begin{macrocode}
+\long\def\letter#1{%
+% \end{macrocode}
+% \changes{1.22.0}{1995/01/19}{(RG) State counter added to \cmd\letter.
+% Check for nested letter envs changed.}
+% \changes{1.25.0}{1995/01/21}{(RG) \cmd\ka@db@atletter-hook added and
+% use of \cs{if@ka@dbinletter} deleted.}
+% \changes{1.49.0}{1995/06/29}{(RG) \cmd\vspace\ is set to \cmd\relax\
+% while splitting the receivers address.
+% This allows using \cmd\vspace, \cmd\medskip
+% and so on.}
+% \begin{macrocode}
+ \ifnum\c@lt@state>0
+ \ka@db@error{%
+ Command \string\begin{letter} inside the
+ \string\begin{letter}-environment found.
+ }
+ \fi
+ \setcounter{lt@state}{1}%
+ % \typeout{\string\ka@db@atletter\space\ka@db@atletter}%
+ \ka@db@atletter
+ \clearpage
+ \thispagestyle{empty}
+ \cleardoublepage
+ \refstepcounter{letter}%
+ \c@page\@ne
+ \global\ka@db@lastpagefalse
+ \interlinepenalty=200
+ % \@processto{#1}%
+ % \message{Starting \string\@splitaddress}%
+ \bgroup
+ \def\protect{\noexpand\protect\noexpand}%
+ \let\\=\relax
+ \let\vspace=\relax
+ \@splitaddress{#1}
+ \egroup
+ % \message{Ending \string\@splitaddress}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endletter}
+% \begin{macrocode}
+\def\endletter{%
+% \end{macrocode}
+% \changes{1.22.0}{1995/01/19}{(RG) State counter added to \cmd\endletter}
+% \begin{macrocode}
+ \setcounter{lt@state}{0}%
+% \end{macrocode}
+% \changes{0.0.0}{1994/02/09}{(KB) Switch for last page added}
+% \begin{macrocode}
+ \ka@db@lastpagetrue
+% \end{macrocode}
+% \cmd\stopletter\ is a hook to insert commands in the \cmd\endletter.
+% \begin{macrocode}
+ \stopletter
+ \@@par
+ \pagebreak
+ \@@par
+ \gdef\@yourmail{}
+ \gdef\@mymail{}
+ \global\@reflinefalse
+ \if@filesw
+ \ifnum\c@labelgen>1
+ \begingroup
+ \def\protect{\string}
+ \let\\=\relax
+ \def\protect##1{\string##1\space}
+ \let\vspace=\relax
+ \let\rule=\relax
+ %\immediate\write\@auxout{\string\mlabel{\@backaddress}{\toname
+ %\\\toaddress}}
+ %\immediate\write\@auxout{%
+ % \string\mlabel{\@backaddress}{\@addresslist}}%
+ %\immediate\write\@auxout{\string\mlabel{\@backaddress}{%
+ % \ka@db@ifemptyvarlocal{postremark}{}{%
+ % \ka@db@usevarlocal{postremark}\\[\string\medskipamount]%
+ % }%
+ % \@addresslist
+ %}}%
+ \ka@db@ifemptyvarlocal{postremark}{% then
+ \immediate\write\@mainlbl{\string\mlabel{\@backaddress}{%
+ \@addresslist}}%
+ }{% else
+ \immediate\write\@mainlbl{\string\mlabel{\@backaddress}{%
+ \pka@db@usevarlocal{postremark}\\[\string\medskipamount]%
+ \@addresslist}}%
+ }% endif
+ \endgroup
+ \fi
+ %\ifnum\c@labelgen=1
+ % \onlabels
+ %\fi
+ \fi
+ \ka@db@atendletter
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@processto}
+% \begin{macrocode}
+\long\def\@processto#1{%
+ \@xproc #1\\@@@%
+ \ifx\toaddress\@empty
+ \else
+ \@yproc #1@@@%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xproc}
+% \begin{macrocode}
+\long\def\@xproc #1\\#2@@@{\def\toname{#1}\def\toaddress{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@yproc}
+% \begin{macrocode}
+\long\def\@yproc #1\\#2@@@{\def\toaddress{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\stopbreaks}
+% \begin{macrocode}
+\def\stopbreaks{\interlinepenalty \@M
+ \def\par{\@@par\nobreak}\let\\=\@nobreakcr
+ \let\vspace\@nobreakvspace}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nobreakvspace}
+% \begin{macrocode}
+\def\@nobreakvspace{\@ifstar{\@nobreakvspacex}{\@nobreakvspacex}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nobreakvspacex}
+% \begin{macrocode}
+\def\@nobreakvspacex#1{\ifvmode\nobreak\vskip #1\relax\else
+ \@bsphack\vadjust{\nobreak\vskip #1}\@esphack\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nobreakcr}
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \def\@nobreakcr{\@ifstar{\@normalcr*}{\@normalcr*}}
+\else
+ \def\@nobreakcr{\vadjust{\penalty\@M}\@ifstar{\@xnewline}{\@xnewline}}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\startbreaks}
+% \begin{macrocode}
+\def\startbreaks{\let\\=\@normalcr
+ \interlinepenalty 200\def\par{\@@par\penalty 200}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\labelcount}
+% \begin{macrocode}
+\newcount\labelcount
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@refline}
+% \begin{macro}{\if@norefline}
+% |\if@refline| is true if a referline according to the rules of
+% DIN 676 and Draft DIN 676 is typeset. If the user wishes no referline
+% at all, to print for example place and date on the top of the letter,
+% you can set |\if@norefline| to true.
+% \begin{macrocode}
+\newif\if@refline
+\@reflinefalse
+\newif\if@norefline
+\@noreflinefalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if@toadrcenter}
+% \begin{macrocode}
+\newif\if@toadrcenter
+\@toadrcenterfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@letterform}
+% \begin{macro}{\letterform}
+% \begin{macro}{\noletterform}
+% \begin{macrocode}
+\newif\if@letterform
+\@letterformfalse
+\def\letterform{\@letterformtrue}
+\def\noletterform{\@letterformfalse}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\centeraddress}
+% \begin{macrocode}
+\def\centeraddress{\@toadrcentertrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\normaladdress}
+% \begin{macrocode}
+\def\normaladdress{\@toadrcenterfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\signature}
+% \begin{macrocode}
+\def\signature#1{%
+ \ka@db@assignvar{signature}{#1}%
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{signature}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@fromsig}
+% \begin{macrocode}
+% \def\@fromsig{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\address}
+% \begin{macrocode}
+\long\def\address#1{\def\@fromaddress{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@fromaddress}
+% \begin{macrocode}
+\def\@fromaddress{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\footer}
+% \begin{macrocode}
+\long\def\footer#1{\def\@footer{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@footer}
+% \begin{macrocode}
+\def\@footer{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\returnaddress}
+% \begin{macrocode}
+\def\returnaddress{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\place}
+% \begin{macrocode}
+\def\place#1{\gdef\@place{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@place}
+% \begin{macrocode}
+\def\@place{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\phone}
+% \begin{macro}{\@prephone}
+% \begin{macro}{\@phone}
+% \begin{macro}{\@telephonenum}
+% \begin{macrocode}
+\def\phone#1#2{%
+ \gdef\@prephone{#1}%
+ \gdef\@phone{#2}%
+ \gdef\@telephonenum{#1#2}}
+\def\@prephone{}
+\def\@phone{}
+\def\@telephonenum{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\phonemsg}
+% \begin{macrocode}
+\def\phonemsg{Telefon}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\date}
+% \begin{macrocode}
+\def\date#1{\gdef\@date{#1}\gdef\@ntoday{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@date}
+% \begin{macrocode}
+\def\@date{\today}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sign}
+% \begin{macrocode}
+\def\sign#1{\gdef\@mymail{#1}\@reflinetrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mymail}
+% \begin{macrocode}
+\def\@mymail{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\signmsg}
+% \begin{macro}{\signmsgold}
+% \begin{macro}{\signmsgnew}
+% \begin{macrocode}
+\def\signmsgold{Unsere Zeichen}
+\def\signmsgnew{Unsere Zeichen, unsere Nachricht vom}
+\let\signmsg\signmsgold
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\datemsg}
+% \begin{macrocode}
+\def\datemsg{Datum}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\yourmail}
+% \begin{macrocode}
+\def\yourmail#1{\gdef\@yourmail{#1}\global\@reflinetrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@yourmail}
+% \begin{macrocode}
+\def\@yourmail{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\yourmailmsg}
+% \begin{macrocode}
+\def\yourmailmsg{Ihre Zeichen, Ihre Nachricht vom}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\writer}
+% This macro takes as argument the name of the writer (Sachbearbeiter)
+% and stores it in the var {\sf writer\/}. It also toggles the the
+% |\@reflinetrue|-switch to get an referline and further
+% enables the layout of the new DIN draft standard 676 from May 1991.
+% \begin{macrocode}
+\def\writer#1{%
+ \ka@db@assignvar{writer}{#1}%
+ \@reflinetrue
+ \enabledraftstandard
+}
+\ka@db@execatletter{\ka@db@assignvarlocal{writer}{}}%
+\ka@db@assignvarglobal{writer}{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\writermsg}
+% \begin{macrocode}
+\def\writermsg{,\ Bearbeiter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@concern}
+% \begin{macrocode}
+\def\@concern{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bottomtext}
+% Defines the text which is printed on the bottom of the first page.
+% This is used to include special informations such as the
+% number of the giroconto, or the name of the chairman of a corporation.
+%
+% \changes{0.0.0}{1994/02/08}{(KB) Defining macro \cmd\bottomtext\ putting
+% the specified text into box \cmd\@@bottomtext\
+% to get the height of the footer and store
+% it in \cmd\@@bottomht}
+% \changes{1.70.1}{2000/01/14}{(KB) Got rid of box \cmd\@@bottomtext\ and the
+% macros \cmd\ka@db@bottomtextmsg,
+% \cmd\ka@db@praebottomtext\ and
+% \cmd\ka@db@mainbottomtext}
+% The implementation of \cmd\bottomtext\ puts its argument into the macro
+% \cmd\ka@db@bottomtext\ preset with \cmd\relax\ (maybe, the name of this
+% internal command should be changed). This allows the bottom text to be
+% specified before \cmd\begin\arg{document}. The contents of the macro
+% \cmd\ka@db@bottomtext\ are put into a box of height and width 0pt by
+% \cmd\ka@db@tsbottomtext\ as well as \cmd\oldopening\ which is immediately
+% set into the letter (without using a box register). Wheter bottom text is
+% to be set can be checked by comparing \cmd\ka@db@bottomtext\ to
+% \cmd\relax.
+% \begin{macrocode}
+% \newbox\@@bottomtext
+% \setbox\@@bottomtext=\vbox to 0pt{}
+% \def\ka@db@bottomtextmsg{}
+% \long\def\ka@db@praebottomtext#1{%
+% \gdef\ka@db@bottomtextmsg{#1}%
+% }
+% \long\def\ka@db@mainbottomtext#1{%
+% \setbox\@@bottomtext=\hbox to 0pt{\hskip0pt minus 4truemm%
+% \vbox{\raggedright #1}%
+% \hss}%
+% }
+\def\ka@db@bottomtext{}
+\long\def\bottomtext#1{%
+ \ifka@db@ltxtwoe \relax \else
+ \@@warning{\string\bottomtext \space is reserving space for
+ typesetting its argument only in case of LaTeX 2e.
+ With other LaTeX formats you will have to place a
+ \string\clearpage-command at the appropriate position}%
+ \fi
+% \ka@db@bottomtext{#1}%
+ \long\gdef\ka@db@bottomtext{#1}%
+ % \gdef\ka@db@bottomtextmsg{#1}%
+ % \setbox\@@bottomtext=\hbox to 0pt{\hskip0pt minus 4truemm%
+ % \vbox{\raggedright #1}%
+ % \hss}%
+ }
+% \long\def\ka@db@bottomtext#1{\ka@db@praebottomtext{#1}}
+
+
+% \long\def\bottomtext#1{%
+% \ifka@db@ltxtwoe \relax \else
+% \@@warning{\string\bottomtext \space is reserving space for
+% typesetting its argument only in case of LaTeX 2e.
+% With other LaTeX formats you will have to place a
+% \string\clearpage-command at the appropriate position}%
+% \fi
+% \setbox\@@bottomtext=\hbox to 0pt{\hskip0pt minus 4truemm%
+% \vbox{\raggedright #1}%
+% \hss}%
+% % \@@bottomht \ht\@@bottomtext}
+% }
+% \end{macrocode}
+% \begin{macrocode}
+% \long\def\bottomtext#1{\def\@@bottomtext{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@bottomtext}
+% \begin{macrocode}
+% \def\@@bottomtext{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\document}
+% \begin{macrocode}
+\def\document{%
+ \endgroup
+% \end{macrocode}
+% If some options on |\documentclass| haven't been used by any
+% package we will now give a warning since this is most certainly a
+% misspelling.
+% \begin{macrocode}
+ \ifka@db@ltxtwoe
+ \ifx\@unusedoptionlist\@empty\else
+ \@latex@warning@no@line{Unused global option(s):^^J%
+ \@spaces[\@unusedoptionlist]}%
+ \fi
+ \fi
+ \@colht=\textheight
+ \@colroom=\textheight
+ \vsize=\textheight
+ \columnwidth=\textwidth
+ \@clubpenalty=\clubpenalty
+ \if@twocolumn
+ \advance\columnwidth -\columnsep
+ \divide\columnwidth\tw@
+ \hsize=\columnwidth
+ \@firstcolumntrue
+ \fi
+ \hsize=\columnwidth
+ \linewidth=\hsize
+ \begingroup
+ \@floatplacement
+ \@dblfloatplacement
+ \makeatletter
+ \ifka@db@ltxtwoe
+ \let\@writefile\@gobbletwo
+ \fi
+ \@input{\jobname@aux}%
+ \endgroup
+ \if@filesw
+ \ifnum\c@labelgen>0
+ \immediate\openout\@mainlbl=\jobname@lbl
+ \immediate\write\@mainlbl{\string\relax}%
+ \immediate\write\@mainlbl{\string\startlabels\string\@startlabels}%
+ \fi
+ \immediate\openout\@mainaux=\jobname@aux
+ \immediate\write\@mainaux{\string\relax}%
+ \fi
+ \ifka@db@ltxtwoe
+ \process@table
+ \let\glb@currsize\@empty %% Force math initialisation.
+ \fi
+ \@normalsize
+ \everypar{}%
+ \ifka@db@ltxtwoe
+ \@noskipsecfalse
+% \end{macrocode}
+% |\G@refundefinedfalse| ist not longer needed. D.\ Carlile send us
+% an E-Mail (95/12/12) to avoid conflicts with the December 1995
+% release of \LaTeXe.
+% \begin{macrocode}
+ \fi
+% \end{macrocode}
+% Just before disabling the preamble commands we execute the begin
+% document hook which contains any code contributed by
+% |\AtBeginDocument|. Also disable the gathering of the file list,
+% if no |\listfiles| has been issued. Since a value of exactly 0pt
+% for |\topskip| causes |\twocolumn[]| to misbehave, we add this
+% check, hoping that it will not cause any problems elsewhere.
+%
+% Most of the following assignments will be done globally in case
+% the user adds something like |\begin{multicols}| to the document
+% hook, ie starts a group in |\begin{document}|.
+% \begin{macrocode}
+ \ifka@db@ltxtwoe
+ \@begindocumenthook
+ \ifdim\topskip<1sp
+ \topskip 1sp
+ \relax
+ \fi
+ \let\@begindocumenthook\@undefined
+ \ifx\@listfiles\@undefined
+ \let\@filelist\relax
+ \let\@addtofilelist\@gobble
+ \fi
+ \fi
+% \end{macrocode}
+% At the very end we disable all preamble commands. This has to
+% happen after the begin document hooks was executed so that this
+% hook can still use such commands.
+% |\AtBeginDocument|.
+%
+% \begin{macrocode}
+ \def\do##1{\let ##1\@notprerr}%
+ \@preamblecmds
+% \end{macrocode}
+% The next line is a pure safty measure in case a do list is
+% ever expanded at the wrong place. In addition it will save
+% a few tokens to get rid of the above definition.
+% \begin{macrocode}
+ \global\let\do\noexpand
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \long\def\ka@db@bottomtext##1{\ka@db@mainbottomtext{##1}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enddocument}
+% \begin{macrocode}
+\def\enddocument{%
+ \@checkend{document}
+ \newpage
+ \begingroup
+ \if@filesw
+ \ifnum\c@labelgen>0
+ \immediate\closeout\@mainlbl
+ \makeatletter
+ \input \jobname@lbl\relax
+ \clearpage
+ \fi
+ \immediate\closeout\@mainaux
+ \fi
+ \endgroup
+ \deadcycles\z@
+ \@@end}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Controlling the generation of labels}
+% \cmd\makelabels\ is a preamble command to enable the generation
+% of labels. To control the generation of labels for single
+% letters, we provide three other commands. This commands
+% work only if \cmd\makelabels\ is given in the preamble.
+%
+% The other three commands \cmd\nolabels, \cmd\offlabels\ and
+% \cmd\onlabels, which only work if \cmd\makelabels\ had
+% been given in the preamle, control the generation of
+% single or in case of \cmd\offlabels\ the remaining
+% label(s). \cmd\nolabels\ avoids the label for the current
+% letter. Further if the generation of labels was permanently
+% disabled with \cmd\offlabels\ this also switches the generation
+% of labels from the next letter on.
+% \cmd\offlabels\ stops the generation of labels.
+% \cmd\onlabels\ switch the generation of label on again.
+%
+% The counter \cmd\c@labelgen\ indicates the current state
+% of the generation of labels:
+%
+% \begin{tabular}{cp{0.75\textwidth}}
+% 0 & generation of labels is switched off\\
+% 1 & generation of current label is beeing temporary switched off\\
+% 2 & generation of labels is in force\\
+% \end{tabular}
+%
+% \begin{macro}{\makelabels}
+% \cmd\makelabels\ is a command to enable the generation of
+% labels.
+% \begin{macrocode}
+\def\makelabels{%
+ % \@fileswtrue
+ \c@labelgen=2
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@labelgen}
+% \begin{macrocode}
+\newcount\c@labelgen
+\c@labelgen=0
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ka@db@asslabelgen}
+% \begin{macrocode}
+\def\ka@db@asslabelgen#1#2#3{%
+ \if@filesw
+ #3\c@labelgen=#1\relax
+ \else
+ %\@warning{\string\makelabels\space not given. %
+ % \string#2\space has no effect}%
+ \ClassWarning{dinbrief}{%
+ \string\makelabels\space not given. %
+ \string#2\space has no effect}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\nolabels}
+% \begin{macrocode}
+\def\nolabels{%
+ \ka@db@asslabelgen{1}{\nolabels}{\relax}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\offlabels}
+% \begin{macrocode}
+\def\offlabels{%
+ \ka@db@asslabelgen{0}{\offlabels}{\global}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\onlabels}
+% \begin{macrocode}
+\def\onlabels{%
+ \ka@db@asslabelgen{2}{\onlabels}{\global}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@startlabels}
+% \begin{macrocode}
+\def\@startlabels{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\let\@texttop=\relax
+% \end{macrocode}
+%
+% \changes{0.0.0}{1994/02/09}{(KB)}
+% \begin{macro}{\ifka@db@lastpage}
+% The following switch is used by pagestyle |contheadings| to detect the
+% last page.
+% \begin{macrocode}
+\newif\ifka@db@lastpage
+\ka@db@lastpagefalse
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ps@headings}
+% \begin{macrocode}
+\def\ps@headings{
+ \headheight=\ltf@headheight
+ \headsep=\ltf@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 0truemm
+ \fi
+ \footskip 0truemm
+ \def\@oddhead{%
+ \sl \headtoname\
+ \ignorespaces\toname \hfil \@date
+ \hfil \pagename{} \thepage}
+ \def\@oddfoot{}
+ \def\@evenhead{%
+ \sl \headtoname\
+ \ignorespaces\toname \hfil \@date
+ \hfil \pagename{} \thepage}
+ \def\@evenfoot{}
+%<debug> \message{executing pagestyle headings}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@empty}
+% \begin{macrocode}
+\def\ps@empty{%
+ \headheight=\lts@headheight
+ \headsep=\lts@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 0truemm
+ \fi
+ \footskip 0truemm
+ \def\@oddhead{}
+ \def\@oddfoot{}
+ \def\@evenhead{}
+ \def\@evenfoot{}
+%<debug> \message{executing pagestyle empty}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@first@page}
+% \begin{macrocode}
+\def\ps@first@page{%
+ \headheight=\lts@headheight
+ \headsep=\lts@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 4.2truemm
+ \fi
+ \footskip 8.8truemm
+% \end{macrocode}
+% We do not redefine the macros |\@oddfoot| and |\@evenfoot|.
+% So the first page gets the same layout in the foot as the
+% other pages.
+%
+% We can talk about use of such a half pagestyle. So we provide
+% here a hook |psfirstpagehook| and the user can complete this
+% pagestyle (if he wishes) simply by doing:
+%
+% \begin{quote}
+% |\def\psfirstpagehook{%|\\
+% | \def\@oddfoot{}|\\
+% | \def\@evenfoot{}}|
+% \end{quote}
+%
+% \begin{macrocode}
+ \def\@oddhead{}
+ \def\@evenhead{}
+ \expandafter\ifx\csname psfirstpagehook\endcsname\relax
+ \else
+ \psfirstpagehook
+ \fi
+%<debug> \message{executing pagestyle firstpage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psfirstpagehook}
+% \begin{macrocode}
+\def\psfirstpagehook{%
+ \def\@oddfoot{}
+ \def\@evenfoot{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@plain}
+% \begin{macrocode}
+\def\ps@plain{%
+ \headheight=\lts@headheight
+ \headsep=\lts@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 4.2truemm
+ \fi
+ \footskip 8.8truemm
+ \def\@oddhead{}
+ \def\@oddfoot{\hfil{\ka@db@fontshape{n}%
+ \ka@db@fontseries{m}\ka@db@selectfont\thepage}
+ \hfil}%
+ \def\@evenhead{}
+ \def\@evenfoot{}
+%<debug> \message{executing pagestyle plain}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ps@myheadings}
+% \begin{macrocode}
+\def\ps@myheadings{%\let\@mkboth\@gobbletwo
+ \headheight=\ltf@headheight
+ \headsep=\ltf@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 0truemm
+ \fi
+ \footskip 0truemm
+ \def\@oddhead{{\sl \rightmark}}%
+ \def\@oddfoot{}
+ \def\@evenhead{{\sl \leftmark}}%
+ \def\@evenfoot{}
+%<debug> \message{executing pagestyle myheadings}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ps@contheadings}
+% \changes{0.0.0}{1994/02/09}{(KB)}
+% Like pagestyle 'headings' with pagenumber in top line and
+% number of following page in bottom line.
+%
+% \smallskip
+% \changes{0.0.0}{1994/02/10}{(KB)}
+% Problem to be solved before this pagestyle can be introduced:
+% There must be found a method to detect the last page is typesetted
+% (endletter is not sufficient, since there may be another pagebreak when
+% \TeX\ has seen the command - due to an overfull page)
+% \begin{macrocode}
+\def\ps@contheadings{%\let\@mkboth\@gobbletwo
+ \headheight=\ltf@headheight
+ \headsep=\ltf@headsep
+ \ifka@db@ltxtwoe
+ \relax
+ \else
+ \footheight 0truemm
+ \fi
+ \footskip 8.8truemm
+ \def\@oddhead{{\sl \headtoname\ \ignorespaces\toname \hfil \@date
+ \hfil\pagename{} \thepage}}%
+ \def\@oddfoot{\ifka@db@lastpage
+ \relax
+%<debug> \message{ignoring oddfoot in contheadings}%
+ \else
+ \addtocounter{page}{1}%
+ \hfil--- \thepage{} ---\hfil%
+ \addtocounter{page}{-1}%
+%<debug> \message{executing oddfoot in contheadings}%
+ \fi}
+ \def\@evenhead{{\sl \headtoname\ \ignorespaces\toname \hfil \@date
+ \hfil\pagename{} \thepage}}%
+ \def\@evenfoot{\ifka@db@lastpage
+ \relax
+%<debug> \message{ignoring evenfoot in contheadings}%
+ \else
+ \addtocounter{page}{1}%
+ ~\hfil--- \thepage{} ---~%
+ \addtocounter{page}{-1}%
+%<debug> \message{executing evenfoot in contheadings}%
+ \fi}
+%<debug> \message{executing pagestyle contheadings}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Fonts --- paragraphing}
+% These parameters control \TeX's behaviour when two lines tend
+% to come too close together.
+%
+% \begin{macrocode}
+\lineskip 1pt
+\normallineskip 1pt
+% \end{macrocode}
+% \begin{macro}{\baselinestretch}
+% This is used as a multiplier for |\baselineskip|. The default is
+% {\em not\/} to stretch the baselines.
+% \begin{macrocode}
+\def\baselinestretch{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parskip}
+% \begin{macro}{\parindent}
+% |\parskip| gives extra vertical space between paragraphs and |\parindent|
+% is the width of the paragraph indentation.
+% \begin{macrocode}
+\parskip .7em
+\parindent 0pt
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macrocode}
+\topsep .4em
+\partopsep 0pt
+\itemsep .4em
+% \end{macrocode}
+%
+% \begin{macro}{\@lowpenalty}
+% \begin{macro}{\@medpenalty}
+% \begin{macro}{\@highpenalty}
+% The commands |\nopagebreak| and |\nolinebreak| put in penalties to
+% discourage these breaks at the point they are put in. They use
+% |\@lowpenalty|, |\@medpenalty| or |\@highpenalty|, dependant on their
+% argument.
+% \begin{macrocode}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macrocode}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty -\@lowpenalty
+\@itempenalty -\@lowpenalty
+% \end{macrocode}
+%
+% \subsection{Lists}
+%
+% \subsubsection{General list parameters}
+%
+% The following commands are used to set default values for the list
+% environment's parameters. See the \LaTeX{} manual for an explanation
+% of the meanings of these parameters. Defaults for the list
+% environment are set as follows. First, |\rightmargin|,
+% |\listparindent| and |\itemindent| are set to 0pt. Then, for a Kth
+% level list, the command |\@listK| is called, where `K' denotes `i',
+% '`i', ... , `vi'. (I.e., |\@listiii| is called for a third-level
+% list.) By convention, |\@listK| should set |\leftmargin| to
+% |\leftmarginK|.
+%
+% \begin{macro}{\leftmargin}
+% \begin{macro}{\leftmargini}
+% \begin{macro}{\leftmarginii}
+% \begin{macro}{\leftmarginiii}
+% \begin{macro}{\leftmarginiv}
+% \begin{macro}{\leftmarginv}
+% \begin{macro}{\leftmarginvi}
+% For efficiency, level-one list's values are defined at top level, and
+% |\@listi| is defined to set only |\leftmargin|.
+%
+% \begin{macrocode}
+\leftmargini 2.5em
+\leftmarginii 2.2em
+\leftmarginiii 1.87em
+\leftmarginiv 1.7em
+\leftmarginv 1em
+\leftmarginvi 1em
+% \end{macrocode}
+% Here we set the top level leftmargin.
+% \begin{macrocode}
+\leftmargin\leftmargini
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelsep}
+% \begin{macro}{\labelwidth}
+% |\labelsep| is the distance between the label and the text of an
+% item; |\labelwidth| is the width of the label.
+% \begin{macrocode}
+\labelwidth\leftmargini
+\advance\labelwidth-\labelsep
+\labelsep 5pt
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\parsep 0pt
+% \end{macrocode}
+%
+% \begin{macro}{\@listi}
+% \begin{macrocode}
+\let\@listi\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@listii}
+% \begin{macro}{\@listiii}
+% \begin{macro}{\@listiv}
+% \begin{macro}{\@listv}
+% \begin{macro}{\@listvi}
+% Here are the same macros for the higher level lists.
+% \begin{macrocode}
+\def\@listii{%
+ \leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep}
+\def\@listiii{%
+ \leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep .2em
+ \itemsep \topsep}
+\def\@listiv{%
+ \leftmargin\leftmarginiv
+ \labelwidth\leftmarginiv
+ \advance\labelwidth-\labelsep}
+\def\@listv{%
+ \leftmargin\leftmarginv
+ \labelwidth\leftmarginv
+ \advance\labelwidth-\labelsep}
+\def\@listvi{%
+ \leftmargin\leftmarginvi
+ \labelwidth\leftmarginvi
+ \advance\labelwidth-\labelsep}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Enumerate}
+%
+% The enumerate environment uses four counters: \Lcount{enumi},
+% \Lcount{enumii}, \Lcount{enumiii} and \Lcount{enumiv}, where
+% \Lcount{enumN} controls the numbering of the Nth level
+% enumeration.
+%
+% \begin{macro}{\theenumi}
+% \begin{macro}{\theenumii}
+% \begin{macro}{\theenumiii}
+% \begin{macro}{\theenumiv}
+% The counters are already defined in \file{latex.tex}, but their
+% representation is changed here.
+%
+% \begin{macrocode}
+\def\theenumi{\arabic{enumi}}
+\def\theenumii{\alph{enumii}}
+\def\theenumiii{\roman{enumiii}}
+\def\theenumiv{\Alph{enumiv}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\labelenumi}
+% \begin{macro}{\labelenumii}
+% \begin{macro}{\labelenumiii}
+% \begin{macro}{\labelenumiv}
+% The label for each item is generated by the commands \hfil\break
+% |\labelenumi| ... |\labelenumiv|.
+% \begin{macrocode}
+\def\labelenumi{\arabic{enumi}.}
+\def\labelenumii{(\alph{enumii})}
+\def\labelenumiii{\roman{enumiii}.}
+\def\labelenumiv{\Alph{enumiv}.}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\p@enumii}
+% \begin{macro}{\p@enumiii}
+% \begin{macro}{\p@enumiv}
+% The expansion of |\p@enumN||\theenumN| defines the output of a
+% |\ref| command when referencing an item of the Nth level of an
+% enumerated list.
+% \begin{macrocode}
+\def\p@enumii{\theenumi}
+\def\p@enumiii{\theenumi(\theenumii)}
+\def\p@enumiv{\p@enumiii\theenumiii}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Itemize}
+%
+% \begin{macro}{\labelitemi}
+% \begin{macro}{\labelitemii}
+% \begin{macro}{\labelitemiii}
+% \begin{macro}{\labelitemiv}
+% Itemization is controlled by four commands: |\labelitemi|,
+% |\labelitemii|, |\labelitemiii|, and |\labelitemiv|, which define
+% the labels of thevarious itemization levels: the symbols used are
+% bullet, bold en-dash, asterisk and centred dot.
+%
+% \begin{macrocode}
+\def\labelitemi{$\bullet$}
+\def\labelitemii{\bf --}
+\def\labelitemiii{$\ast$}
+\def\labelitemiv{$\cdot$}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Description}
+%
+% \begin{macro}{\description}
+% \begin{macro}{\descriptionlabel}
+% \begin{macro}{\enddescription}
+% The description environment is defined here -- while the itemize
+% and enumerate environments are defined in \file{latex.tex}.
+%
+% To change the formatting of the label, you must redefine
+% |\descriptionlabel|.
+%
+% \begin{macrocode}
+\def\descriptionlabel#1{%
+ \hspace\labelsep \bf #1}
+\def\description{%
+ \list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel}}
+\let\enddescription\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Verse}
+%
+% \begin{macro}{\verse}
+% \begin{macro}{\endverse}
+% The verse environment is defined by making clever use of the
+% list environment's parameters. The user types |\\| to end a line.
+% This is implemented by |\let|'ing |\\| equal |\@centercr|.
+%
+% \begin{macrocode}
+\def\verse{\let\\=\@centercr
+ \list{}{\itemsep\z@
+ \itemindent -15pt
+ \listparindent \itemindent
+ \rightmargin\leftmargin
+ \advance\leftmargin 15pt}\item[]}
+\let\endverse\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Quotation}
+%
+% \begin{macro}{\quotation}
+% \begin{macro}{\endquotation}
+% The quotation environment is also defined by making clever use of
+% the list environment's parameters. The lines in the environment
+% are set smaller than |\textwidth|. The first line of a paragraph
+% inside this environment is indented.
+%
+% \begin{macrocode}
+\def\quotation{%
+ \list{}{\listparindent 1.5em
+ \itemindent\listparindent
+ \rightmargin\leftmargin}%
+ \item[]}
+\let\endquotation=\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Quote}
+%
+% \begin{macro}{\quote}
+% \begin{macro}{\endquote}
+% The quote environment is like the quotation environment except
+% that paragraphs are not indented.
+%
+% \begin{macrocode}
+\def\quote{%
+ \list{}{\rightmargin\leftmargin}%
+ \item[]}
+\let\endquote=\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Setting parameters for existing environments}
+%
+% \subsubsection{Array and tabular}
+%
+% \begin{macro}{\arraycolsep}
+% The columns in an array environment are separated by
+% 2|\arraycolsep|.
+% \begin{macrocode}
+\arraycolsep 5pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tabcolsep}
+% The columns in an tabular environment are separated by
+% 2|\tabcolsep|.
+% \begin{macrocode}
+\tabcolsep 6pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\arrayrulewidth}
+% The width of rules in the array and tabular environments is given
+% by \hfil\break
+% |\arrayrulewidth|.
+% \begin{macrocode}
+\arrayrulewidth .4pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doublerulesep}
+% The space between adjacent rules in the array and tabular
+% environments is given by |\doublerulesep|.
+% \begin{macrocode}
+\doublerulesep 2pt
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Tabbing}
+%
+% \begin{macro}{\tabbingsep}
+% This controls the space that the |\'| command puts in. (See
+% \LaTeX{} manual for an explanation.)
+% \begin{macrocode}
+\tabbingsep \labelsep
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Minipage}
+%
+% \begin{macro}{\@minipagerestore}
+% The macro |\@minipagerestore| is called upon entry to a minipage
+% environment to set up things that are to be handled differently
+% inside a minipage environment. In the current styles, it does
+% nothing.
+% \end{macro}
+%
+% \begin{macro}{\@mpfootins}
+% Minipages have their own footnotes; |\skip||\@mpfootins| plays
+% the same r\^ole for footnotes in a minipage as |\skip||\footins| does
+% for ordinary footnotes.
+%
+% \begin{macrocode}
+\skip\@mpfootins = \skip\footins
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Framed boxes}
+%
+% \begin{macro}{\fboxsep}
+% The space left by |\fbox| and |\framebox| between the box and the
+% text in it.
+% \begin{macrocode}
+\fboxsep = 3pt
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fboxrule}
+% The width of the rules in the box made by |\fbox| and |\framebox|.
+% \begin{macrocode}
+\fboxsep = 3pt
+\fboxrule = .4pt
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Equation and eqnarray}
+%
+% \begin{macro}{\theequation}
+% The equation counter will be reset at beginning of a new letter.
+% The equation counter will be typeset using arabic numbers.
+%
+% \begin{macrocode}
+\def\theequation{\arabic{equation}}
+\@addtoreset{equation}{letter}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\jot}
+% |\jot| is the extra space added between lines of an eqnarray
+% environment. The default value is used.
+% \begin{macrocode}
+% \jot=3pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@eqnnum}
+% The macro |\@eqnnum| defines how equation numbers are to appear in
+% equations. Again the default is used.
+%
+% \begin{macrocode}
+% \def\@eqnnum{(\theequation)}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Footnotes}
+%
+% \begin{macro}{\footnoterule}
+% Usually, footnotes are separated from the main body of the text
+% by a small rule. This rule is drawn by the macro |\footnoterule|.
+% We have to make sure that the rule takes no vertical space (see
+% \file{plain.tex}) so we compensate for the natural heigth of the
+% rule of 0.4pt by adding the right amount of vertical skip.
+%
+% To prevent the rule from colliding with the footnote we first add
+% a little negative vertical skip, then we put the rule and make
+% sure we end up at the same point where we begun this operation.
+% \begin{macrocode}
+\def\footnoterule{%
+ \kern-1\p@
+ \hrule width .4\columnwidth
+ \kern .6\p@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@footnote}
+% The dinbrief style/class does not use this macro.
+%
+% (Footnotes are numbered within chapters in the report and book
+% document styles.)
+% \end{macro}
+%
+% \begin{macro}{\@makefntext}
+% The footnote mechanism of \LaTeX{} calls the macro |\@makefntext|
+% to produce the actual footnote. The macro gets the text of the
+% footnote as its argument and should use |\@thefnmark| as the mark
+% of the footnote. The macro |\@makefntext| is called when
+% effectively inside a |\parbox| of width |\columnwidth| (i.e.,
+% with |\hsize| = |\columnwidth|).
+%
+% An example of what can be achieved is given by the following piece
+% of \TeX\ code.
+% \begin{macrocode}
+% \long\def\@makefntext#1{%
+% \@setpar{\@@par
+% \@tempdima = \hsize
+% \advance\@tempdima-10pt
+% \parshape \@ne 10pt \@tempdima}%
+% \par
+% \parindent 1em\noindent
+% \hbox to \z@{\hss$\m@th^{\@thefnmark}$}#1}
+% \end{macrocode}
+% The effect of this definition is that all lines of the footnote
+% are indented by 10pt, while the first line of a new paragraph is
+% indented by 1em. To change these dimensions, just substitute the
+% desired value for `10pt' (in both places) or `1em'. The mark is
+% flushright against the footnote.
+%
+% In this document class we use a simpler macro, in which the
+% footnote text is set like an ordinary text paragraph, with no
+% indentation except on the first line of a paragraph, and the
+% first line of the footnote. Thus, all the macro must do is set
+% |\parindent| to the appropriate value for succeeding paragraphs
+% and put the proper indentation before the mark.
+%
+% \begin{macrocode}
+% \long\def\@makefntext#1{%
+% \parindent 1em%
+% \noindent
+% \hbox to 1.8em{\hss$\m@th^{\@thefnmark}$}#1}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@makefntext}
+% \begin{macrocode}
+\long\def\@makefntext#1{%
+ \noindent
+ \hangindent 5pt%
+ \hbox to 5pt{\hss $^{\@thefnmark}$}#1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefnmark}
+% The footnote markers printed in the text to point to the
+% footnotes should be produced by the macro |\@makefnmark|. We use
+% the default definition for it.
+% \begin{macrocode}
+%\def\@makefnmark{\hbox{$^{\@thefnmark}\m@th$}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\c@topnumber=2
+\def\topfraction{.7}
+\c@bottomnumber=1
+\def\bottomfraction{.3}
+\c@totalnumber=3
+\def\textfraction{.2}
+\def\floatpagefraction{.5}
+\c@dbltopnumber= 2
+\def\dbltopfraction{.7}
+\def\dblfloatpagefraction{.5}
+% \end{macrocode}
+%
+% \subsection{The current date}
+%
+% \begin{macro}{\today}
+% \begin{macrocode}
+\def\today{\number\day.\space\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
+ \space\number\year}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@znumber}
+% \begin{macro}{\ntoday}
+% \begin{macro}{\@ntoday}
+% \changes{1.68.0}{2000/01/03}{(RG) Y2K-bug in \cmd\@znumber\space fixed.}
+% The following code is not Y2K ready. It has to be replaced by
+% the code suggested by Heiko Oberdiek (below).
+% \begin{macrocode}
+%\yearcnt\year
+%\advance\yearcnt-\number1900
+% \end{macrocode}
+% New we cut off only the first the numbers. This should work from
+% the year 1000 up to 9999. This means Y3K, Y4K and so on ready.
+% \begin{macrocode}
+\newcount\yearcnt
+\yearcnt=\expandafter\@gobbletwo\the\year
+% \end{macrocode}
+%
+% \begin{macrocode}
+% \def\@znumber#1{\ifnum\number#1<10 0\number#1\else\number#1\fi}
+% \end{macrocode}
+% This makes the use of |\@znumber| more save. Thanks to
+% Heiko Oberdiek for this suggestion.
+% \begin{macrocode}
+\def\@znumber#1{%
+ \ifnum\number#1<10 0\fi
+ \expandafter\@firstofone\expandafter{\number#1}%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\ntoday{\@znumber{\number\day}.%
+ \@znumber{\number\month}.%
+ \@znumber{\the\yearcnt}}
+\def\@ntoday{\ntoday}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\up#1{\leavevmode \raise.16ex\hbox{#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\concern}
+% \begin{macro}{\subject}
+% \changes{1.15.0}{1994/12/14}{(RG) \cmd\newbox\cmd\@betr being moved outside of
+% \cmd\concern}
+% \begin{macrocode}
+\newbox\@betr
+\long\def\concern#1{%
+ \setbox\@betr=\hbox{}
+ \def\@concern{\hangindent=\wd\@betr
+ \hangafter=1
+ \unhbox\@betr #1\par}}
+\let\subject=\concern
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@fordate}
+% \changes{1.70.1}{2000/01/17}{(KB) length \cmd\@fordate\ eliminated and
+% width of date field set to
+% \cmd\ka@db@shfldwd=25.4mm}
+% |\@fordate| is the length of the remaining part of the
+% referline.
+% \begin{macrocode}
+%\newdimen\@fordate
+%\@fordate=\textwidth
+%\addtolength{\@fordate}{-131truemm}
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Changed \cmd\\\ to \cmd\newline}
+% \begin{macro}{\@answertoold}
+% The macro \cmd\@answertoold is used to typeset the referline in the
+% original DIN 676 style.
+%
+% %The length \cmd\@fordate\ is the width of the field for date
+% %and place. This length is being determined by subtracting the
+% %length of the other fields (50,8mm + 50,8mm + 25,4mm + 4mm)
+% %131 mm from \cmd\textwidth. (why 4mm?)
+% The length of the field for date and/or place -- the remaining part of
+% the reference line -- is no longer computed since its specific value
+% has no effect to the output. Instead, the field width is set to
+% |\ka@db@shfldwd|=25.4mm leaving 8.2mm to the right paper bound.
+%
+% \begin{macrocode}
+\def\@answertoold{%
+ \parbox[b]{\ka@db@fieldwd}{{\ka@db@fontsize{9}{11pt}\ka@db@selectfont
+ \yourmailmsg{}}%
+ \hfil\newline \@yourmail\hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@fieldwd}{{\ka@db@fontsize{9}{11pt}\ka@db@selectfont
+ \signmsg{}}%
+ \hfil\newline \@mymail\hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@shfldwd}{{\ka@db@fontsize{9}{11pt}\ka@db@selectfont
+ \phonemsg{} \@prephone{}}%
+ \hfil\newline \@phone\hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@shfldwd}{{\ka@db@fontsize{9}{11pt}\ka@db@selectfont
+ \ifx\@empty\@place
+ \vphantom{K}\rule{2pt}{0pt}
+ \else
+ \@place{}%
+ \fi
+ }\hfil\newline \@ntoday}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{1.70.1}{2000/01/09}{(KB) Changed \cmd\\\ to \cmd\newline}
+% \begin{macro}{\@answertonew}
+% The draft proposal of the new DIN 676 has an additional
+% field for the name of a person who has written the letter.
+%
+% The new DIN 676 (draft) has a big disadvantage. The referline
+% is larger than the normal \cmd\textwidth. So we have to add some
+% extra space to this box. This code should be rewritten.
+% Currently, it is just a hack.
+%
+% \begin{macrocode}
+\def\@answertonew{%
+ \hbox to \textwidth{%
+ \parbox[b]{\ka@db@fieldwd}{{\ka@db@fontsize{7}{9pt}\ka@db@selectfont
+ \yourmailmsg{}}%
+ \hfil\newline \@yourmail\hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@fieldwd}{{\ka@db@fontsize{7}{9pt}\ka@db@selectfont
+ \signmsg{}}%
+ \hfil\newline \@mymail\hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@fieldwd}{{\ka@db@fontsize{7}{9pt}\ka@db@selectfont
+ \phonemsg{}%
+ \writermsg{}%
+ }%
+ \hfil\newline
+ \ifx\@empty\@prephone\relax
+ \else
+ \@prephone{}
+ \fi
+ \@phone
+ \ka@db@ifemptyvar{writer}%
+ {}% true
+ {% false
+ \ifx\@empty\@phone\relax
+ \else
+ ,\ % insert comma and blank only
+ \fi% if both are nonempty
+ \ka@db@usevar{writer}%
+ }%
+% \ifx\@empty\@writer\relax
+% \else
+% \ifx\@empty\@phone\relax
+% \else
+% ,\ % insert comma and blank only if both
+% \fi% are nonempty
+% \@writer
+% \fi
+ \hbox{}\hss}%
+ \hskip\ka@db@fldskip%
+ \parbox[b]{\ka@db@shfldwd}{{\ka@db@fontsize{7}{9pt}\ka@db@selectfont
+ \datemsg
+ }\hfil\newline \@ntoday}
+ \hss}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enabledraftstandard}
+% \begin{macro}{\disabledraftstandard}
+% \begin{macro}{\@answerto}
+% \changes{0.94.1}{1994/08/14}{\cmd\enabledraftstandard and
+% \cmd\disabledraftstandard
+% introduced.}
+% The macros \cmd\enabledraftstandard\ and \cmd\disabledraftstandard\
+% are used to switch between the two DIN versions 676 (the old and the
+% draft one). This is simply done by letting the \cmd\@answerto pointing to
+% \cmd\@answertoold or \cmd\@answertonew.
+%
+% By default, we use the old version and therefore the german standard.
+%
+% \begin{macrocode}
+\def\enabledraftstandard{%
+ \let\signmsg=\signmsgnew
+ \let\@answerto=\@answertonew
+}
+%
+\def\disabledraftstandard{%
+ \let\signmsg=\signmsgold
+ \let\@answerto=\@answertoold
+}
+%
+\disabledraftstandard
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Old dinbrief commands}
+%
+% \begin{macro}{\Postvermerk}
+% \begin{macrocode}
+\def\Postvermerk#1{%
+ %\@warning{Use \string\postremark\space instead %
+ % of \string\Postvermerk}%
+ \ClassWarning{dinbrief}{%
+ Use \string\postremark\space instead %
+ of \string\Postvermerk}%
+ \postremark{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Behandlungsvermerk}
+% \begin{macrocode}
+\def\Behandlungsvermerk#1{%
+ %\@warning{Use \string\handling\space instead of %
+ % \string\Behandlungsvermerk}%
+ \ClassWarning{dinbrief}{%
+ Use \string\handling\space instead of %
+ \string\Behandlungsvermerk}%
+ \handling{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Datum}
+% \begin{macrocode}
+\def\Datum#1{%
+ \date{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\long\def\ka@db@splitondblpt#1{%
+ \ka@db@splitdblptx #1::\@st@p@
+ \ifx\ka@db@fromadrtwo\@empty
+ \else
+ \ka@db@splitdblpty #1\@st@p@
+ \fi
+}
+\def\ka@db@fromadrone{}%
+\def\ka@db@fromadrtwo{}%
+\long\def\ka@db@splitdblptx #1::#2\@st@p@{%
+ \def\ka@db@fromadrone{#1}%
+ \def\ka@db@fromadrtwo{#2}%
+}
+\long\def\ka@db@splitdblpty #1::#2\@st@p@{%
+ \def\ka@db@fromadrtwo{#2}%
+}
+% \end{macrocode}
+%
+% \begin{macro}{\stdaddress}
+% \begin{macrocode}
+\long\def\stdaddress#1{%
+ \ka@db@splitondblpt{#1}
+ \address{%
+ \vspace*{7truemm}
+ \leavevmode
+ \hbox to 0pt{\hbox to \textwidth{\hfil\@date}\hss}%
+ \parbox[t]{\textwidth}{\ka@db@fromadrone\ka@db@fromadrtwo}%
+ }%
+ \@noreflinetrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Absender}
+% \begin{macrocode}
+\long\def\Absender#1{%
+ %\@warning{Use \string\stdaddress\space instead of \string\Absender}%
+ \stdaddress{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Retourlabel}
+% \begin{macrocode}
+\def\Retourlabel{%
+ %\@warning{\string\Retourlabel\space not yet implemented.}%
+ \ClassWarning{dinbrief}{%
+ \string\Retourlabel\space not yet implemented.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Fenster}
+% \begin{macrocode}
+\def\Fenster{%
+ \ClassWarning{dinbrief}{%
+ \string\Fenster\space not yet implemented.}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Retouradresse}
+% \begin{macrocode}
+\def\Retouradresse#1{%
+ \ClassWarning{dinbrief}{%
+ Use \string\backaddress\space instead of \string\Retouradresse}%
+ \backaddress{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Betreff}
+% \begin{macrocode}
+\def\Betreff#1{%
+ \ClassWarning{dinbrief}{%
+ Use \string\subject\space instead of \string\Betreff}%
+ \concern{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{dinquote}
+%
+% \begin{macro}{\dinquote}
+% \begin{macro}{\enddinquote}
+% The dinquote environment is like the quote environment except
+% that the indentation on left side is 1in and there is no
+% indentation on the right side.
+%
+% \begin{macrocode}
+\def\dinquote{%
+ \list{}{\leftmargin=1in}%
+ \item[]}
+\let\enddinquote=\endlist
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\Einrueckung}
+% \begin{macrocode}
+\long\def\Einrueckung#1{%
+ \ClassWarning{dinbrief}{%
+ Use the environment dinquote in future}%
+ \begin{dinquote}%
+ #1
+ \end{dinquote}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifka@db@enclright}
+% |\ifka@db@enclright| is true if the enclosures and/or
+% the carbon copies have to placed on the right side.
+% \begin{macrocode}
+\newif\ifka@db@enclright
+\ka@db@enclrightfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enclright}
+% \begin{macrocode}
+\def\enclright{%
+ \ka@db@enclrighttrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\enclnoenclright}
+% \begin{macrocode}
+\def\noenclright{%
+ \ka@db@enclrightfalse
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\anlagenrechts}
+% The enclosures are placed on the right side (at degree 50) 101.6mm
+% from the left margin. They start at the same line as the closing
+% formula.
+% \begin{macrocode}
+\def\anlagenrechts{%
+ \ka@db@enclrighttrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Anlagen}
+% \begin{macrocode}
+\def\Anlagen#1{%
+ %\@warning{Use \string\encl\space instead of \string\Anlagen}%
+ \ClassWarning{dinbrief}{%
+ Use \string\encl\space instead of \string\Anlagen}%
+ \encl[]{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Verteiler}
+% \begin{macrocode}
+\def\Verteiler#1{%
+ %\@warning{Use \string\cc\space instead of \string\Verteiler}%
+ \ClassWarning{dinbrief}{%
+ Use \string\cc\space instead of \string\Verteiler}%
+ \cc[]{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{More initializations}
+%
+% We initially choose the normalsize font.
+% This code has to be executed following the definition of |\baselinestretch|
+% if the original \LaTeX\ font selection scheme is used.
+% \begin{macrocode}
+\ifka@db@nfss
+ \else
+ \ifka@db@nfsstwo
+ \else
+ \normalsize
+ \fi
+ \fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+\smallskipamount=.5\parskip
+\medskipamount=\parskip
+\bigskipamount=2\parskip
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pagestyle{plain}
+\pagenumbering{arabic}
+\onecolumn
+% \@fileswfalse
+\errorcontextlines=10
+% \end{macrocode}
+%
+% Finally, read the configuration file - if it exists.
+% \begin{macrocode}
+\ifka@db@ltxtwoe
+ \IfFileExists{dinbrief.cfg}{%
+ \makeatother%
+ \input{dinbrief.cfg}%
+ \makeatletter%
+ }{\relax}
+\fi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</class|style>
+% \end{macrocode}
+%
+% \subsection{The short class file/the short style file}
+% This file only inputs the dinbrief.sty file.
+%
+% \begin{macrocode}
+%<*shortclass>
+\input dinbrief.sty
+%</shortclass>
+% \end{macrocode}
+%
+% This file only inputs the dinbrief.cls file.
+%
+% \begin{macrocode}
+%<*shortstyle>
+\input dinbrief.cls
+%</shortstyle>
+% \end{macrocode}
+%
+% \subsection{The configuration file}
+% The configuration file is searched according to the standard search path
+% for \TeX\ files. It is input by the last command of the class but before
+% any package.
+%
+% \begin{macrocode}
+%<*cfg>
+% \end{macrocode}
+%<<COMMENTSONLY
+% \begin{macrocode}
+% Example configuration file
+%
+% This file is input by the last command of the class `dinbrief'
+%
+%\setaddressllhpos{100truemm}
+%\setaddressllvpos{96truemm}
+%\setaddressllcorner{20truemm}{72truemm}
+%\addressstd
+%\nobackaddressrule
+%\nowindowrules
+%\address{R\"udiger Kurz\\ % Package `german' not yet loaded!
+% Am See 1\\
+% 76133 Karlsruhe}
+%\backaddress{R.~Kurz, Am See 1, 76133 Karslruhe}
+%\place{Gralsruhe}
+%\phone{(0127)}{806-0815}
+%\signature{R\"udiger Kurz}
+%\setbottomtexttop{284.9truemm}
+%\bottomtext{%
+% \makebox[\textwidth][c]{\small\sf
+% Bankverbindung $\cdot$ Kreissparkasse Gralsruhe %
+% (BLZ~999~500~00) 98~765~4}}
+%COMMENTSONLY
+%</cfg>
+% \end{macrocode}
+%
+% \section{An example letter}
+%
+% \subsection{The letter head}
+%
+% \begin{macrocode}
+%<*brfkopf>
+% \end{macrocode}
+% \begin{macrocode}
+%
+\newlength{\UKAwd}
+\newlength{\ADDRwd}
+%
+\font\fa=cmcsc10 scaled 1440
+\font\fb=cmss12 scaled 1095
+\font\fc=cmss10 scaled 1000
+%
+\def\briefkopf{
+ \settowidth{\UKAwd}{\fa Institut f"ur Verpackungen}
+ \settowidth{\ADDRwd}{\fc EARN/BITNET: yx99 at dkauni2}
+ \expandafter\ifx\csname fontsize\endcsname\relax\else
+ \fontsize{12}{14.4pt}\selectfont
+ \fi
+%
+ \vspace*{7truemm}
+ \raisebox{-11.3mm}{%
+ \setlength{\unitlength}{1truemm}
+ \begin{picture}(15,15)(0,0)
+ \thicklines
+ \put(7.5,7.5){\circle{15}}
+ \put(7.5,7.5){\circle{10}}
+ \put(7.5,7.5){\circle{ 5}}
+ \end{picture}%
+ }
+ {\fc\hspace{.2em}}
+ \parbox[t]{\UKAwd}{\centering{\fa Universit\"at Gralsruhe} \\
+ \centering{\fa Institut f"ur Verpackungen} \\[.5ex]
+ \centering{\fb Prof.\ Dr.\ Fritz Schreiber} }
+ \hfill
+ \parbox[t]{\ADDRwd}{\fc Im Hinterhof 2 $\cdot$ Postfach 8960 \\
+ \fc D--76821 Gralsruhe \\
+ \fc Telefon: (0127) 806-0815 \\
+ \fc Electronic Mail: \\
+ \fc EARN/BITNET: yx99 at error2 }
+ }
+%
+\signature{Prof.\ Dr.\ Fritz Schreiber}
+\place{Gralsruhe}
+\address{\briefkopf}
+\phone{(0127)}{806-0815}
+\def\FS{Prof.\,F.\,Schreiber, Uni.\,Gralsruhe,
+ Postf.\,8960, 76821\,Gralsruhe\rule[-1ex]{0pt}{0pt}}
+
+% \end{macrocode}
+% \begin{macrocode}
+%</brfkopf>
+% \end{macrocode}
+%
+% \subsection{The letter}
+% \begin{macrocode}
+%<*example>
+% \end{macrocode}
+% This will be a letter.
+% \begin{macrocode}
+
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[german]{dinbrief}
+ \else
+ \begin{filecontents*}{signatur.ps}
+%!PS-Adobe-2.0 EPSF-2.0
+%%BoundingBox: 0 0 57 32
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col0 {0.000 0.000 0.000 srgb} bind def
+end
+save
+1.0 30.0 translate
+1 -1 scale
+
+/c {curveto} bind def
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/sc {scale} bind def
+/tr {translate} bind def
+/DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+%%EndProlog
+
+$F2psBegin
+10 setmiterlimit
+n -1000 1472 m -1000 -1000 l 1888 -1000 l 1888 1472 l cp clip
+ 0.06299 0.06299 sc
+25.000 slw
+n 338 432 10 10 0 360 DrawEllipse gs col0 s gr
+n 183 9 m 267 450 l gs col0 s gr
+n 273 447 m 273 444 250 427 376 22 c 376 22 400 -40 426 21 c gs col0 s gr
+n 9 390 m 9 410 35 480 59 411 c 59 411 150 224 177 3 c gs col0 s gr
+n 778 432 10 10 0 360 DrawEllipse gs col0 s gr
+n 623 9 m 707 450 l gs col0 s gr
+n 713 447 m 713 444 690 427 816 22 c 816 22 840 -40 866 21 c gs col0 s gr
+n 449 390 m 449 410 475 480 499 411 c 499 411 590 224 617 3 c gs col0 s gr
+$F2psEnd
+rs
+ \end{filecontents*}
+ \documentclass[10pt]{dinbrief}
+ \usepackage{german}
+ \usepackage{graphicx}
+ \fi
+
+\input brfkopf
+
+% \makelabels
+% \labelstyle{deskjet}
+
+\pagestyle{contheadings}
+
+\begin{document}
+
+\bottomtext{%
+ \makebox[\textwidth][c]{\small\sf
+ Bankverbindung $\cdot$ Kreissparkasse Gralsruhe %
+ (BLZ~999~500~00) 98~765~4
+ }
+}
+
+\date{9.~Juli 1999}
+
+\setlength{\topmargin}{-15pt}
+\backaddress{\FS}
+
+\begin{letter}{Prof.\ Dr.\ Hans Forschegut\\
+ Institut f"ur Abfallbeseitigung\\
+ Fachhochschule Waldstadt\\
+ Postfach 3322\\[\medskipamount]
+ 1100 Waldstadt}
+\yourmail{\ }
+\subject{Bitte um "Uberlassung einer Sammlung von Alka-Seltzer Flaschen}
+
+\opening{Sehr geehrter Herr Prof.\ Forschegut,}
+
+von Kollegen habe ich erfahren, da"s sich bei Ihnen eine gro"se
+Anzahl von Alka-Seltzer Flaschen mit nur noch einer Tablette
+angesammelt hat, da eine Flasche 25~Tabletten enth"alt, der
+Beipackzettel aber angibt, da"s stets 2~Tabletten gleichzeitig
+einzunehmen sind.
+
+Ich forsche gerade im Bereich m"oglicher Anwendungen einzelner
+Schmerztabletten. Falls Sie so freundlich w"aren, Ihre Alka-Seltzer
+Sammlung f"ur unser Projekt zu stiften, w"urde ich Ihnen gerne
+Vorabdrucke aller zuk"unftigen Forschungsberichte zur Verf"ugung
+stellen, die wir "uber dieses kritische Problem ver"offentlichen.
+
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \closing{Mit freundlichen Gr"u"sen}
+\else
+ \closing[{\includegraphics[height=2\baselineskip]{signatur.ps}}]%
+ {Mit freundlichen Gr"u"sen}
+\fi
+
+\ps{Falls Sie es w"unschen, lasse ich "uberpr"ufen, ob Sie Ihre
+ Schenkung in Verbindung mit unserer Forschung von der Steuer
+ absetzen k"onnen.}
+\encl{Forschungsbericht Nr.\ 6/99 des IfA}
+\cc{Future Pharma\\
+ Bundesministerium zur Unterst"utzung der Pharmaindustrie}
+
+\end{letter}
+
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</example>
+% \end{macrocode}
+%
+% \section{Testing the class/style}
+%
+% \begin{macrocode}
+%<*brfbody>
+% \end{macrocode}
+% \begin{macrocode}
+\yourmail{\ }
+\subject{Bitte um "Uberlassung einer Sammlung von Alka-Seltzer Flaschen}
+
+\opening{Sehr geehrter Herr Prof.\ Forschegut,}
+
+von Kollegen habe ich erfahren, da"s sich bei Ihnen eine gro"se
+Anzahl von Alka-Seltzer Flaschen mit nur noch einer Tablette
+angesammelt hat, da eine Flasche 25~Tabletten enth"alt, der
+Beipackzettel aber angibt, da"s stets 2~Tabletten gleichzeitig
+einzunehmen sind.
+
+Ich forsche gerade im Bereich m"oglicher Anwendungen einzelner
+Schmerztabletten. Falls Sie so freundlich w"aren, Ihre Alka-Seltzer
+Sammlung f"ur unser Projekt zu stiften, w"urde ich Ihnen gerne
+Vorabdrucke aller zuk"unftigen Forschungsberichte zur Verf"ugung
+stellen, die wir "uber dieses kritische Problem ver"offentlichen.
+
+{\bf Testing \verb|itemize|}\hfil\break
+\begin{itemize}
+ \item Dies ist ein \verb|\item|.
+ \begin{itemize}
+ \item \verb|\item| in Level 2.
+ \item
+ \begin{itemize}
+ \item \verb|\item| in Level 3.
+ \end{itemize}
+ \end{itemize}
+ \item Zweites \verb|\item|.
+\end{itemize}
+
+{\bf Testing \verb|enumerate|}\hfil\break
+\begin{enumerate}
+ \item Dies ist ein \verb|\item|.
+ \begin{enumerate}
+ \item \verb|\item| in Level 2.
+ \item
+ \begin{enumerate}
+ \item \verb|\item| in Level 3.
+ \end{enumerate}
+ \end{enumerate}
+ \item Zweites \verb|\item|.
+\end{enumerate}
+
+{\bf Testing \verb|description|}\hfil\break
+\begin{description}
+ \item[First] Dies ist ein \verb|\item|.
+ \begin{description}
+ \item[Second] \verb|\item| in Level 2.
+ \item[Third]
+ \begin{description}
+ \item \verb|\item| in Level 3.
+ \item Zweites \verb|\item| in Level 3.
+ \end{description}
+ \end{description}
+ \item[Second] Zweites \verb|\item|.
+\end{description}
+
+{\bf Testing Lists}\hfil\break
+\begin{description}
+ \item[First] Dies ist ein \verb|\item|.
+ \begin{itemize}
+ \item \verb|\item| in Level 2.
+ \item
+ \begin{enumerate}
+ \item \verb|\item| in Level 3.
+ \item Zweites \verb|\item| in Level 3.
+ \end{enumerate}
+ \end{itemize}
+ \item[Second] Zweites \verb|\item|.
+ \item[Third]
+ \begin{enumerate}
+ \item Genius \LaTeX.
+ \item Why has been there so large distance between the label
+ and the first number in elder versions of \LaTeX?
+ \end{enumerate}
+\end{description}
+
+{\bf Testing \verb|verse|}\hfil\break
+\begin{verse}
+{\bf Die F"u"se im Feuer\/}
+
+Wild zuckt der Blitz,\\
+im fahlen Lichte steht ein Turn,\\
+der Donner rollt,\\
+ein Reiter k"ampft mit seinem Ro"s,\\
+springt ab un pocht ans Tor und l"armt.\\
+Sein Mantel saust im Wind,\\
+und knarrent "offnet jetzt das Tor ein Edelmann.\\
+\dots\\
+Der Reiter tritt in einen dunklen Ahnensaal.
+
+Von eines weiten Herdes Feuer schwach erhellt,\\
+droht hier ein Hugenott im Harnisch,\\
+dort ein Weib, ein stolzes Weib in braunen Ebenbild.\\
+Der Reiter wirft sich in den Sessel vor dem Herd\\
+und starrt in den lebendgen Brand\\
+\dots \\
+Die Flamme zischt, zwei F"u"se zucken in der Glut.
+
+\dots
+\end{verse}
+
+{\bf Testing \verb|quotation|}\hfil\break
+\begin{quotation}
+``Ich finde'', sagte einst Winston Churchill im
+Unterhaus, ``die Art von Kritik, wie ich sie am
+Sonntagmorgen bei meiner Ankunft in den Zeitungen
+fand, erinnert mich immer an die Geschichte von
+dem Matrosen, der in ein Hafenbecken sprang ---
+in Plymouth, glaube ich ---, um einen kleinen
+Jungen vom Ertrinken zu retten.
+
+Dort sprach eine Frau den Matrosen an:\\
+`Sind Sie der Mann, der meinen Sohn neulich
+aus dem Wasser gezogen hat?'\\
+Bescheiden erwiderte der Matrose:\\
+`Ja, das stimmt.'\\
+`Aha', sagte die Frau: `Ich suche Sie schon
+die ganze Zeit \dots\ Wo ist seine M"utze?'{}''
+\end{quotation}
+
+{\bf Testing \verb|quote|}\hfil\break
+\begin{quote}
+Ein {\em klassisches\/} Werk ist ein Buch,\\
+das die Leute loben,\\
+aber nie lesen. \hfill({\em E.\ Hemingway\/})
+\end{quote}
+
+{\bf Testing \verb|equation|}\hfil\break
+\begin{equation}
+ x^2 = y^2 + z^2
+\end{equation}
+
+{\bf Testing \verb|tabular|}\hfil\break
+
+{\bf Testing \verb|tabbing|}\hfil\break
+
+\closing{Mit freundlichen Gr"u"sen}
+
+\ps{Falls Sie es w"unschen, lasse ich "uberpr"ufen, ob Sie Ihre
+ Schenkung in Verbindung mit unserer Forschung von der Steuer
+ absetzen k"onnen.}
+\encl{Forschungsbericht Nr.\ 6/99 des IfA}
+\cc{Future Pharma\\
+ Bundesministerium zur Unterst"utzung der Pharmaindustrie}
+
+% \end{macrocode}
+% \begin{macrocode}
+%</brfbody>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*10pt>
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[german]{dinbrief}
+ \typeout{Using the command \string\documentstyle.}
+ \else
+ \documentclass[10pt]{dinbrief}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+%</10pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*11pt>
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[11pt,german]{dinbrief}
+ \typeout{Using the command \string\documentstyle.}
+ \else
+ \documentclass[11pt]{dinbrief}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+%</11pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*12pt>
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[12pt,german]{dinbrief}
+ \typeout{Using the command \string\documentstyle.}
+ \else
+ \documentclass[12pt]{dinbrief}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+%</12pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*norm>
+% \end{macrocode}
+% \begin{macrocode}
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[norm,german]{dinbrief}
+ \typeout{Using the command \string\documentstyle.}
+ \else
+ \documentclass[norm]{dinbrief}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+% \end{macrocode}
+% \begin{macrocode}
+%</norm>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*test>
+% \end{macrocode}
+% \begin{macrocode}
+\input brfkopf.tex
+
+\newcommand{\oneletter}{%
+\begin{letter}{%
+Herrn Professor\\
+Dr.\ Hans Forschegut\\
+Institut f"ur Abfallbeseitigung\\
+Fachhochschule Waldstadt\\
+Postfach 3322\\[\medskipamount]
+{\bf 1100 Waldstadt}}
+
+\input brfbody.tex
+
+\end{letter}
+
+}
+
+\begin{document}
+
+\bottomtext{%
+ \makebox[\textwidth][c]{\small\sf
+ Bankverbindung $\cdot$ Kreissparkasse Gralsruhe %
+ (BLZ~999~500~00) 98~765~4
+ }
+}
+
+\backaddress{\FS}
+
+\pagestyle{empty}
+
+\enabledraftstandard
+
+\oneletter
+
+\disabledraftstandard
+
+\oneletter
+
+\pagestyle{plain}
+
+\writer{Gussmann}
+
+\enabledraftstandard
+
+\oneletter
+
+\disabledraftstandard
+
+\oneletter
+
+\pagestyle{headings}
+
+\writer{Gussmann}
+
+\enabledraftstandard
+
+\oneletter
+
+\disabledraftstandard
+
+\oneletter
+
+\pagestyle{contheadings}
+
+\enabledraftstandard
+
+\oneletter
+
+\disabledraftstandard
+
+\oneletter
+
+% \end{macrocode}
+% \begin{macrocode}
+%</test>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*10pt|11pt|12pt|norm>
+\end{document}
+%</10pt|11pt|12pt|norm>
+% \end{macrocode}
+%
+% \section{Example for using the old {\tt dinbrief\/} API}
+%
+% \begin{macrocode}
+%<*dinbriefold>
+% \end{macrocode}
+% \begin{macrocode}
+ %
+ % example letter, example receiver addresses
+ %
+ % Most of the following code has taken from the dinbrief released
+ % at May 11th, 1992. This code is originated by Rainer Sengerling.
+ %
+ % The following example contains all commands of the old dinbrief.sty
+ % API (application programming interface). We recommend to use the
+ % new dinbrief API which is much more powerfull. The outcome may be
+ % quiet unsatisfied if you mix both APIs. We had made a few changes
+ % to adapt the file to \LaTeXe.
+ %
+\expandafter\ifx\csname documentclass\endcsname\relax
+ \documentstyle[german]{dinbrief}
+ \typeout{Using the command \string\documentstyle.}
+ \else
+ \documentclass[10pt]{dinbrief}
+ \usepackage{german}
+ \typeout{Using the command \string\documentclass.}
+ \fi
+
+\Etihoehe{41mm}%
+\Etirand{46.3mm}%
+\Etizahl{6}%
+\makelabels
+\spare{1}
+ %\pagestyle{empty}
+\begin{document}
+ %
+ % Musterbrief -- Anfang
+ % In der vorliegenden Version (beachte Auskommentierungen mit %)
+ % liefert er das Anwendungsbeispiel 4 von DIN 5008
+ %
+\begin{letter}{%
+Stadt G"ottingen\\
+Stadtbauamt\\
+Postfach 28 17\par
+3400 G"ottingen
+}
+\Postvermerk{Einschreiben}
+\Behandlungsvermerk{E\ i\ l\ t}
+\Datum{G"ottingen, 29.04.86}
+\Absender{Klaus Waldmann\\B"urgerstra"se 135\\3400 G"ottingen\\::Tel.\
+(05 51) 9 34 56}
+\Retourlabel
+\Fenster
+\Retouradresse{K. Waldmann $\cdot$ B"urgerstr.\ 135 $\cdot$
+ 3400 G"ottingen}
+\Betreff{Mein Bauvorhaben Waldrebenweg 9}
+\signature{K. Waldmann}
+\opening{Sehr geehrte Damen und Herren,}
+den Antrag zur Genehmigung f"ur den Neubau eines Einfamilienhauses auf
+meinem Grund\-st"uck G"ottingen, Waldrebenweg 9, hat der Architekt,
+Herr Dipl.-Ing.\ G. Schwarz, mit allen erforderlichen Unterlagen am
+03.01.86 eingereicht. Die Baugenehmigung habe ich bis heute nicht
+erhaltern.
+
+\Einrueckung{%Der folgende Text wird eingerueckt
+Da ich die Finanzierung des Bauvorhabens ohne die Baugenehmigung nicht
+endg"ultig kl"aren kann und der Beginn der Bauarbeiten nicht verz"ogert
+werden soll, bitte ich dringend, das Genehmigungsverfahren zu
+beschleunigen.
+} % Ende der Einrueckung
+
+Gleichzeitig bitte ich um Auskunft, ob damit zu rechnen ist, da"s der
+nur geschotterte Waldrebenweg in absehbarer Zeit zu einer "`Stra"se im
+vorl"aufigen Ausbau"' umgestaltet wird.
+
+\anlagenrechts
+\Anlagen{2 Anlagen}
+\Verteiler{Verteiler:\\Landratsamt}
+
+\closing{Mit freundlichen Gr"u"sen}
+\ps{Also bis bald!}
+\end{letter}
+
+ % normgerecht geschriebene Adressen
+
+\begin{letter}{Frau\\Erika Werner\\bei M"uller\\Bahnhofstr.\ 4 -- 6
+
+8580 Bayreuth}
+\end{letter}
+
+\begin{letter}{Frau\\ Annemarie Hartmann\\Vogelsangstr.\ 17 II\par
+2870 Delmenhorst}
+\Postvermerk{Briefdrucksache}
+\end{letter}
+
+\begin{letter}{02694/73\\Herrn Gutsverwalter\\Dipl.-Ldw.\ Otto Winter\\
+Hauptstr.\ 3
+
+8221 Alm Post Neukirchen}
+\Postvermerk{Nicht nachsenden}
+\end{letter}
+
+\begin{letter}{Eheleute\\Erika und Hans M"uller\\Hochstr.\ 4
+
+4709 Bergkamen}
+\Postvermerk{Warensendung}
+\end{letter}
+
+\begin{letter}{Herrn Staatsanwalt\\Dr.\ Ernst Meyer und Frau\\
+Talblick 2
+
+8200 Rosenheim}
+\Postvermerk{Eilzustellung -- auch nachts}
+\end{letter}
+
+\begin{letter}{Herrn Rechtsanwalt\\Dr.\ Otto Freiherr von Bergheim\\
+Leonhard-Eck-Str.\ 7 W 36
+
+8000 M"unchen 19}
+\Postvermerk{Einschreiben -- R"uckschein}
+\end{letter}
+
+\begin{letter}{Herrn Direktor\\Dipl.-Kfm.\ Kurt Gr"aser\\Massivbau AG\\
+Postfach 21 03 14
+
+5600 Wuppertal 21}
+\end{letter}
+
+\begin{letter}{Frau Luise Weber\\Herrn Max Weber\\Rosenstra"se 35
+
+7030 B"oblingen}
+\end{letter}
+
+\begin{letter}{Lack- und Farbwerke\\Dr.\ Hans Sendler \& Co.\\
+Abt.\ FDM 412/10\\Postfach 80 19 36\par
+6230 Frankfurt 80}
+\end{letter}
+
+\begin{letter}{Lehmann \& Krause KG\\z.\ H. Herrn E. Winkelmann\\
+Gartenhaus III r.\\Johannisberger Str.\ 5 a\par 1000 Berlin 31}
+\end{letter}
+
+\begin{letter}{W"aschegro"shandel\\Robert Bergmann\\Venloer
+Stra"se 80 -- 82\par 5000 K"oln 30}
+\end{letter}
+
+\begin{letter}{Firma\\Otto Pfleiderer\\Braunenweiler\\Hauptstr.\ 5\par
+7968 Saulgau 1}
+\Postvermerk{Drucksache}
+\end{letter}
+
+\begin{letter}{Amtsgericht Leer\\Grundbuchamt\\Postfach 11 24\par
+2950 Leer}
+\end{letter}
+
+\begin{letter}{Regierungspr"asident\\Dezernat 44.II.2\\
+Postfach 59 07\par 4400 M"unster}
+\end{letter}
+
+\begin{letter}{Nassauische Heimst"atte GmbH\\
+Abt.\ Landestreuhandstelle\\Postfach 10 29 17\par 6000 Frankfurt 1}
+\end{letter}
+
+\begin{letter}{Volksbank Friedberg\\Hauptzweigstelle Bad Nauheim\\
+Aliceplatz 4\par 6350 Bad Nauheim}
+\end{letter}
+
+\begin{letter}{VEB Ph"onix-Apparatewerk\\
+Absatzabteilung\\Inselstr.\ 14/20
+
+DDR-7021 Leipzig}
+\Postvermerk{Einschreiben}
+\end{letter}
+
+\begin{letter}{Mevrouv J. de Vries\\ Poste restante A. Cuypstraat\\
+Postbus 99730\\1000 NA AMSTERDAM
+
+NIEDERLANDE}
+\end{letter}
+
+\begin{letter}{Monsieur P. Dubois\\Expert en assurances\\
+Escalier 3, b\^atiment C\\4, rue Jean Jaur\`es
+
+F-58500 CLAMECY}
+\end{letter}
+
+\begin{letter}{Mr.\ W. Smith\\514 Kingsbridge Road\\PURLEY, SURREY\\DE
+1\\GROSSBRITANNIEN CRZ 4TH}
+\end{letter}
+
+\end{document}
+% \end{macrocode}
+% \begin{macrocode}
+%</dinbriefold>
+% \end{macrocode}
+%
+% \section{The documentation driver file}
+%
+% We have our own document class to format the \LaTeXe
+% documentation.
+% \changes{1.0.6}{1993/12/07}{Use class ltxdoc document class}
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{german}
+\originalTeX
+% \end{macrocode}
+%
+% We don't want everything to appear in the index
+%
+% We start with a nearly empty list and go then further and
+% further. So we can catch all interesting macros.
+%
+% \begin{macrocode}
+\DoNotIndex{\@empty,\\,\space,\@warning}
+\DoNotIndex{\begin,\bfseries,\bgroup,\box,\def,\edef,\egroup}
+\DoNotIndex{\else,\end,\endcsname,\expandafter,\fi,\gdef}
+\DoNotIndex{\hbox}
+\DoNotIndex{\hfil,\hfill,\hss,\ifx,\item,\let,\long,\message}
+\DoNotIndex{\nointerlineskip}
+\DoNotIndex{\originalTeX,\p@,\par,\parbox,\parsep,\relax}
+\DoNotIndex{\setlength}
+\DoNotIndex{\space,\string,\strut,\tmpa,\typeout,\verb}
+\DoNotIndex{\vbox,\vskip,\vspace,\vss}
+\DoNotIndex{\xdef,\z@,\z@skip}
+\DoNotIndex{\LaTeX,\LaTeXe}
+\DoNotIndex{\OnlyDescription,\PrintChanges,\PrintIndex,\RecordChanges}
+% \end{macrocode}
+% We do want an index, using linenumbers
+% \begin{macrocode}
+\EnableCrossrefs
+\CodelineIndex
+ %\DisableCrossrefs
+\RecordChanges
+ %\OnlyDescription
+\typeout{Expect some under- and overfull boxes}
+% \end{macrocode}
+% We also want the full details.
+% \begin{macrocode}
+\begin{document}
+\DocInput{dinbrief.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% End each file with |\endinput|.
+% \begin{macrocode}
+\endinput
+% \end{macrocode}
+%
+% \Finale
+%
+\endinput
+%% End of DINBRIEF.DTX (or CLS, STY, TEX)
diff --git a/Master/texmf-dist/source/latex/dinbrief/dinbrief.ins b/Master/texmf-dist/source/latex/dinbrief/dinbrief.ins
new file mode 100644
index 00000000000..59023cb3562
--- /dev/null
+++ b/Master/texmf-dist/source/latex/dinbrief/dinbrief.ins
@@ -0,0 +1,215 @@
+%%
+%% $Id: dinbrief.ins,v 1.14 2000/03/06 11:38:08 rz32 Exp $
+%%
+%% $Log: dinbrief.ins,v $
+%% Revision 1.14 2000/03/06 11:38:08 rz32
+%% <CR><LF> replaced by UNIX's newline.
+%%
+%% Revision 1.13 2000/01/19 00:32:54 rz32
+%% - Added support for additional file 'dinbrief.cfg'
+%% - Combined multiple \generateFile commands to a single \generate command
+%% - Second (identical) preamble remmoved
+%%
+%% Revision 1.12 2000/01/12 06:51:59 Gussmann
+%% License conditions changed to the Latex Project Public License.
+%%
+%% Revision 1.11 2000/01/03 05:06:25 Gussmann
+%% - Changed the license conditions to the LaTeX Project Public
+%% License (LPPL).
+%%
+%% Revision 1.10 1996/10/29 20:50:50 Gussmann
+%% - date changed.
+%%
+%% Revision 1.9 1995/07/06 02:37:49 Gussmann
+%% In both preambles word style canged to class.
+%%
+%% Revision 1.8 1995/07/06 01:32:14 Gussmann
+%% - Only copyright date changed.
+%% - Internal installation script d.ins works also now.
+%%
+%% Revision 1.7 1995/05/11 02:45:27 Gussmann
+%% Copyright message changed.
+%%
+%% Revision 1.6 1995/01/15 23:59:09 Gussmann
+%% Changes:
+%% * RCS comments deleted.
+%% * generation of dbold.tex added.
+%%
+%% Revision 1.5 1994/12/21 23:56:22 Gussmann
+%% * Global switch to overwrite all files, if there
+%% exist old ones.
+%%
+%% Revision 1.4 1994/11/16 18:34:47 Gussmann
+%% Test version complete.
+%%
+%% Revision 1.3 1994/11/16 22:07:57 Gussmann
+%% Generates now output files for test cases in the pt-sizes
+%% 10, 11, 12 and norm.
+%%
+%% Revision 1.2 1994/11/16 22:02:36 Gussmann
+%% *** empty log message ***
+%%
+%% Revision 1.1 1994/11/16 21:54:35 Gussmann
+%% Initial revision
+%%
+%% =======================================================================
+%%
+%% This docstrip .ins file makes it possible to unpack a docstrip
+%% file using initex. This would enable a doc format LaTeX distribution
+%% to be bootstrapped just from the web (2c) sources for TeX, and the
+%% LaTeX files. It saves building plain.fmt :-)
+%%
+%% David Carlisle 1993/10/23
+%%
+\catcode`\Z=\catcode`\%
+\ifnum1=\catcode`\{{\egroup\else
+ \catcode`\Z=9
+Z
+Z \catcode`\{=1 \catcode`\}=2
+Z \catcode`\#=6 \catcode`\^=7
+Z \catcode`\@=11 \catcode`\^^L=13
+Z \let\bgroup={ \let\egroup=}
+Z
+Z \dimendef\z@=10 \z@=0pt \chardef\@ne=1 \countdef\m@ne=22 \m@ne=-1
+Z
+Z \def\wlog{\immediate\write\m@ne} \def\space{ }
+Z
+Z \count10=22 % allocates \count registers 23, 24, ...
+Z \count15=9 % allocates \toks registers 10, 11, ...
+Z \count16=-1 % allocates input streams 0, 1, ...
+Z \count17=-1 % allocates output streams 0, 1, ...
+Z
+Z \def\alloc@#1#2#3{\advance\count1#1\@ne#2#3\count1#1\relax}
+Z
+Z \def\newcount{\alloc@0\countdef} \def\newtoks{\alloc@5\toksdef}
+Z \def\newread{\alloc@6\chardef} \def\newwrite{\alloc@7\chardef}
+Z
+Z \def\newif#1{%
+Z \@if\def#1{true}{\let#1\iftrue}\@if\def#1{false}{\let#1\iffalse}%
+Z \@if\relax#1{false}}
+Z
+Z \def\@if#1#2#3{%
+Z \expandafter#1\csname\expandafter\@gobblethree\string#2#3\endcsname}
+Z \def\@gobblethree#1#2#3{}
+Z
+Z \def\loop#1\repeat{\def\body{#1}\iterate}
+Z \def\iterate{\body \let\next\iterate \else\let\next\relax\fi \next}
+Z \let\repeat\fi
+Z
+Z \def\empty{}
+Z
+Z \def\tracingall{\tracingcommands2 \tracingstats2
+Z \tracingpages1 \tracingoutput1 \tracinglostchars1
+Z \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+Z \showboxbreadth 10000 \showboxdepth 10000 \errorstopmode
+Z \errorcontextlines 10000 \tracingonline1 }
+Z
+\bgroup}\fi\catcode`\Z=11
+
+
+\def\batchfile{dinbrief.ins}
+\input docstrip.tex
+
+\let\OriginalAsk=\Ask
+\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, I will asssume `y' for all future questions^^J%
+ without prompting.}%
+ \ifx\y\noprompt\gdef\Ask##1##2{\def##1{y}}\else
+ \ifx\yes\noprompt\gdef\Ask##1##2{\def##1{y}}\fi\fi}
+
+\keepsilent
+
+
+\preamble
+
+=======================================================================
+
+Copyright (C) 1993, 96, 97 by University of Karlsruhe (Computing Center).
+Copyright (C) 1998, 2000 by University of Karlsruhe (Computing Center)
+ and Richard Gussmann.
+All rights reserved.
+For additional copyright information see further down in this file.
+
+This file is part of the DINBRIEF package
+-----------------------------------------------------------------------
+
+It may be distributed under the terms of the LaTeX Project Public
+License (LPPL), as described in lppl.txt in the base LaTeX distribution.
+Either version 1.1 or, at your option, any later version.
+
+The latest version of this license is in
+
+ http://www.latex-project.org/lppl.txt
+
+LPPL Version 1.1 or later is part of all distributions of LaTeX
+version 1999/06/01 or later.
+
+
+For error reports in case of UNCHANGED versions see readme files.
+
+Please do not request updates from us directly. Distribution is
+done through Mail-Servers, TeX organizations and others.
+
+If you receive only some of these files from someone, complain!
+
+\endpreamble
+
+\generate{\file{dinbrief.sty}{\from{dinbrief.dtx}{shortstyle}}
+ \file{dinbrief.cls}{\from{dinbrief.dtx}{class}}
+ \file{dinbrief.tex}{\from{dinbrief.dtx}{documentation}}
+ \file{dintab.tex}{\from{dinbrief.dtx}{dintab}}
+ \file{brfkopf.tex}{\from{dinbrief.dtx}{brfkopf}}
+ \file{example.tex}{\from{dinbrief.dtx}{example}}
+ \file{brfbody.tex}{\from{dinbrief.dtx}{brfbody}}
+ \file{test10.tex}{\from{dinbrief.dtx}{test,10pt}}
+ \file{test11.tex}{\from{dinbrief.dtx}{test,11pt}}
+ \file{test12.tex}{\from{dinbrief.dtx}{test,12pt}}
+ \file{testnorm.tex}{\from{dinbrief.dtx}{test,norm}}
+ \file{dbold.tex}{\from{dinbrief.dtx}{dinbriefold}}
+ \file{dinbrief.drv}{\from{dinbrief.dtx}{driver}}
+ \nopreamble\nopostamble
+ \file{dinbrief.cfg}{\from{dinbrief.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 dinbrief.cls}
+\Msg{* \space\space dinbrief.sty}
+\Msg{*}
+\Msg{* To setup a standard configuration for letters, edit the}
+\Msg{* configuration file}
+\Msg{*}
+\Msg{* \space\space dinbrief.cfg}
+\Msg{*}
+\Msg{* and copy it to an appropriate directory of your search}
+\Msg{* path for TeX input files.}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.drv' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\Msg{}
+\Msg{********************************************************}
+\Msg{*}
+\Msg{* Now run LaTeX 2.09 or LaTeX 2e and enjoy the dinbrief}
+\Msg{*}
+\Msg{********************************************************}
+\Msg{}
+
+
+\endinput
+
+# Local Variables:
+# mode: latex
+# End:
diff --git a/Master/texmf-dist/source/latex/ebezier/ebezier.dtx b/Master/texmf-dist/source/latex/ebezier/ebezier.dtx
new file mode 100644
index 00000000000..267dbd7d6ca
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ebezier/ebezier.dtx
@@ -0,0 +1,1875 @@
+% \iffalse meta comment
+%
+% Copyright (c) Gerhard A. Bachmaier 2001-2005
+%
+% 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/ as file lppl.txt; either
+% version 1 of the License, or (at your option) any later version.
+%
+% Gerhard A. Bachmaier
+% Institute for Medical Informatics, Statistics, and Documentation
+% Medical University of Graz
+% send bugs to: gerhard.bachmaier@meduni-graz.at
+%
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\ProvidesFile{ebezier.drv}
+%</driver>
+%<package>\ProvidesPackage{ebezier}
+ [2005/03/01 v4]
+%
+%<*driver>
+\documentclass{article}
+\usepackage{ebezier}
+\usepackage{calc}
+\usepackage{doc}
+\EnableCrossrefs
+\CodelineIndex
+%\DisableCrossrefs
+\begin{document}
+ \DocInput{ebezier.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{1955}
+%
+% \DoNotIndex{\@X,\@Xa,\@Xb,\@Xc,\@Y,\@Ya,\@Yb,\@Yc}
+% \DoNotIndex{\@Z,\@Za,\@Zb,\@Zc,\@Zd,\@Ze,\@Zf,\@Zg,\@Zh,\@Zi,\@Zj}
+% \DoNotIndex{\@clnht,\@clnwd,\@dashdim,\@ifnextchar,\@killglue,\@ne}
+% \DoNotIndex{\@ovdx,\@ovdy,\@ovri,\@ovro,\@ovxx,\@ovyy}
+% \DoNotIndex{\@tempdima,\@tempdimb,\@tempdimc,\@tfor,\@und@fined}
+% \DoNotIndex{\@whilenum,\@xdim,\@ydim,\advance,\approx,\bullet}
+% \DoNotIndex{\c@@cnta,\c@@cntb,\c@@cntc,\c@@cntd,\chardef,\copy}
+% \DoNotIndex{\csname,\def,\dimen,\divide,\do,\dp,\else,\endcsname,\fi}
+% \DoNotIndex{\gdef,\hb@xt@,\hbox,\hskip,\hss,\ht,\ifdim,\ifnum,\ifx}
+% \DoNotIndex{\ignorespaces,\kern,\let,\long,\loop,\lower,\Lpack}
+% \DoNotIndex{\magstep,\magstephalf}
+% \DoNotIndex{\multiply,\myname,\NeedsTeXFormat,\newcommand,\newcounter}
+% \DoNotIndex{\newfont,\newif,\newlength,\newsavebox,\oval,\pi,\put}
+% \DoNotIndex{\raise,\ratio,\realname,\relax,\repeat,\RequirePackage}
+% \DoNotIndex{\reserved@a,\setbox,\setcounter,\setlength,\space,\sqrt}
+% \DoNotIndex{\the,\thr@@,\tw@,\unhcopy,\unitlength,\value,\vrule,\wd,\z@}
+%
+% \title{Using ebezier}
+% \author{Gerhard A. Bachmaier}
+% \date{March 1, 2005}
+%
+% \renewcommand{\topfraction}{.6}
+% \renewcommand{\bottomfraction}{.6}
+% \setcounter{totalnumber}{5}
+% \renewcommand{\textfraction}{.1}
+% \setlength{\unitlength}{1pt}
+% \setlength{\parskip}{3pt}
+% \font \logo=logo10 scaled \magstep1
+% \newcommand{\formstrut}{\rule{0mm}{2mm}}
+% \providecommand{\Metafont}{%
+% {\logo META}\discretionary{}{-}{}{\logo FONT}}
+% \renewcommand{\thefootnote}{\fnsymbol{footnote}}
+% \renewcommand{\arraystretch}{1.2}
+% \newcommand\SB[2]{\setbox1=\hbox{#1#2}}
+% \newcommand*{\Lpack}[1]{\textsf {#1}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% The package \Lpack{ebezier} is an extension of the (old)
+% \Lpack{bezier.sty} which is now part of \LaTeXe. It defines
+% linear and cubic Bernste\u\i{}n polynomials together with some
+% plotting macros for arcs.
+%
+% With the aid of the \Lpack{calc} package also the calculation of
+% square roots and henceforward lengths is supplied.
+% \end{abstract}
+%
+%
+% \StopEventually{}
+%
+% \section*{Preamble}
+%
+% If you want to draw complicated and/or lots of pictures, you should use
+% \textsc{PostScript} for generating your plots and \Lpack{dvips} to include
+% them in \TeX\ documents. \textsc{PostScript} can plot lines with arbitrary
+% slope and unlimited length and circles with arbitrary radius just by using
+% one command. See also the \LaTeX\ Graphics Companion\cite{T1} for further
+% possibilities. There is also a new package \Lpack{pict2e}\cite{pict2e} a\-vail\-able
+% which is preferrable for PDF and \textsc{PostScript}.
+%
+% This package will support also lines with arbitrary slopes and unlimited
+% length, but each line has to be generated as a sample of points. Each
+% point reduces \TeX's memory and you will very likely have to overcome some
+% \texttt{TeX capacity excxeeded...} messages.
+%
+% Exact circles would involve trigonometric functions or square roots
+% to be evaluated by \TeX.
+% Even with some tricks for reducing the effort of the calculation algorithm
+% there would be hundreds of calculations for each point.\footnote{%
+% To use \TeX\ for complex computations is as satisfactory as using your desk
+% calculator for writing tasks. But if you really want to do it e.g.\ the digits 7353
+% can be read (rotating by $180^0$) as
+% \texttt{ESEL}, the german word for ``donkey''.}
+% But they may be quite
+% well approximated by cubic bezier curves, also supplied in this package
+% (The quality of interpolation is discussed in some detail in the Section
+% \textit{Fitting Arcs}.) In fact, the small circles in the \LaTeX-\texttt{lcircle} fonts
+% are also generated by the same method.
+%
+% For draft papers use all kind of bezier curves with small number of points,
+% just for the final run increase the numbers. \TeX\ memory can be set free
+% again with {\verb+\clearpage+} at the end of complicated pictures. It's
+% also a good idea to have them at an extra page (option \verb+[p]+ for
+% \texttt{figure} environments).
+%
+% For optical constructions the software LaTeXPiX\cite{PiX} may be a starting point.
+% This software supports cubic bezier curves defined in this package or from
+% \Lpack{bez123}\cite{T5}.
+%
+% \section{Mathematical Definitions}
+%
+% A Bernste\u\i{}n polynomial of degree $n-1\: (n\ge 2)$ is defined by
+% $n$ points $z_1, z_2,\ldots,z_n$
+%
+% \[ \mathcal{B}_{n-1} [t] = \sum_{i=0}^{n-1} {n-1\choose i}
+% (1-t)^{n-1-i} t^i z_{i+1}\quad t\in[0,1].\footnotemark\]%
+% \footnotetext{There are also
+% variants of this definitions with all coefficients $\equiv 1$.}
+%
+% The points $z_i, \: i\in\lbrace1,\ldots,n\rbrace$, may be considered as
+% real numbers, then $\mathcal{B}$ is really a polynomial in $t$. Or they
+% denote points in a plane, which notation we will use further. In this case
+% both \emph{components} are polynominials and the graph for $\mathcal{B}$
+% is---part of---an algebraic curve.
+%
+% \bigskip
+%
+% All these graphs have in common:
+% \begin{itemize}
+% \item The graph is contained in the convex hull of the defining points.
+% \item The graph starts at $z_1$ and stops at $z_n$.
+% \item At the endpoints the tangents coincident with
+% the directions $z_1-z_2$ and $z_{n-1}-z_n$ correspondingly.
+% \end{itemize}
+%
+% For $n=2$ the Bernste\u\i{}n polynomial $\mathcal{B}_1$ reduces to the
+% linear form spanned by $z_1$ and $z_2$. The parametrization in $t$
+%
+% \[ \mathcal{B}_1 [t] =(1-t) z_1 + t z_2=: t[z_1,z_2]\]
+%
+% is also known as \emph{convex coordinates} for the segment
+% $\overline{\formstrut z_1z_2}$.
+%
+% \begin{figure}[htb]
+% \begin{center}
+% \begin{picture}(100,60)
+% \put(-25,-10){\framebox(155,70){}}
+% \put(20,10){\line(2,1){60}}
+% \put(20,10){\makebox(0,0){$\bullet$}}
+% \put(80,40){\makebox(0,0){$\bullet$}}
+% \put(40,20){\makebox(0,0){$\bullet$}}
+% \put(-17,15){$z_1 (t=0)$}
+% \put(75,47){$z_2 (t=1)$}
+% \put(40,10){$t=1/3$}
+% \end{picture}
+% \end{center}
+% \caption{Line defined by two points}
+% \end{figure}
+%
+% \bigskip
+%
+% For $n=3$ the result is a (quadratic) parabola which can also
+% be constructed as the convex hull of all tangents in the
+% triangle $\Delta\,z_1 z_2 z_3$ (examplified in Fig.\ 2b).
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(250,120)
+% \put(-15,-10){\framebox(280,130){}}
+% \Qbezier[300](0,0)(50,100)(100,0)
+% \put(0,0){\makebox(0,0){$\bullet$}}
+% \put(100,0){\makebox(0,0){$\bullet$}}
+% \put(50,100){\makebox(0,0){$\bullet$}}
+% \put(-6,10){$z_1$}
+% \put(50,105){$z_2$}
+% \put(99,10){$z_3$}
+% \put(0,0){\line(1,2){50}}
+% \put(100,0){\line(-1,2){50}}
+%%
+% \put(150,0){\makebox(0,0){$\bullet$}}
+% \put(250,0){\makebox(0,0){$\bullet$}}
+% \put(200,100){\makebox(0,0){$\bullet$}}
+% \put(144,10){$z_1$}
+% \put(200,105){$z_2$}
+% \put(249,10){$z_3$}
+% \put(150,0){\line(1,2){50}}
+% \put(250,0){\line(-1,2){50}}
+% \lbezier[50](160,20)(210,80)
+% \lbezier[30](170,40)(220,60)
+% \lbezier[30](180,60)(230,40)
+% \lbezier[50](190,80)(240,20)
+% \lbezier[50](155,10)(205,90)
+% \lbezier[50](165,30)(215,70)
+% \lbezier[30](175,50)(225,50)
+% \lbezier[50](185,70)(235,30)
+% \lbezier[50](195,90)(245,10)
+% \end{picture}
+% \end{center}
+% \caption{Quadratic parabola (a) as Bernste\u\i{}n polynom of degree 2
+% and (b) as hull of tangents}
+% \end{figure}
+%
+% For $n=4$ finally we arrive at the cubic curves used e.g.\ in the \Metafont\
+% book\cite{T3}.
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(100,100)
+% \put(-10,-10){\framebox(130,110){}}
+% \Cbezier[500](0,0)(10,80)(70,40)(100,0)
+% \put(5,0){$z_1$}
+% \put(10,85){$z_2$}
+% \put(70,50){$z_3$}
+% \put(105,0){$z_4$}
+% \end{picture}
+% \end{center}
+% \caption{A simple cubic parabola.}
+% \end{figure}
+%
+%
+% We will not use more complicated polynomials for several reasons:
+%
+% \begin{itemize}
+% \item Higher degree polynomials require more operations to calculate
+% just one point of the graph.
+% \item For sketches (and \textbf{not} exact graphs!) cubic splines are
+% sufficient to scope with all kind of different curvature requirements.
+% \item \TeX\ can handle integers up to $2^{28}$, and ``real number'' lengths
+% are transformed to integers (multiples of scaled points: 1\,pt=$2^{16}$ sp) \cite{T2}. To stay
+% within this restricted range even for cubic beziers we have to do calculations
+% in the right order. Changing the order of multiplication and divisions will
+% result very soon in arithmetic overflows. Also multiplication with these pseudo-real
+% numbers is not an associative operation (due to the range limits!).
+% \item The maximum number of arguments for commands in \TeX\ is limited to nine,
+% which is just enough for four points and a number.
+% \end{itemize}
+%
+%
+% %
+% \section{The Plotting Macros}
+%
+% \subsection{Simple Beziers}
+%
+% There are two first level plot commands to be used in a
+% \LaTeXe\ \texttt{picture} environment:
+%
+% \begin{verbatim}
+% \lbezier[n](x1,y1)(x2,y2)
+% \cbezier[n](x1,y1)(x2,y2)(x3,y3)(x4,y4)
+% \end{verbatim}
+%
+% The arguments in square brackets are optional! If they are omitted or $n=0$ an adequate number
+% will be calculated (cf. Section 8).
+%
+% \DescribeMacro{\qbezier}
+% \verb+\lbezier+ draws line segments from point $(x_1,y_1)$
+% to $(x_2,y_2)$, or more exactly, $n+1$ intermediate points, while
+% \verb+\cbezier+ is an implementation of the cubic variant. Just for
+% completeness let me remind you that the quadratic
+% variant---\verb+\qbezier[n](x1,y1)(x2,y2)(x3,y3)+---is part of \LaTeXe.
+%
+% \DescribeMacro{\qbeziermax}
+% $n$ is always limited by the number \verb+\qbeziermax+ (=500).
+%
+% You may change \verb+\qbeziermax+ by a command like (it is not a counter!)
+% \verb+\renewcommand{\qbeziermax}{1000}+.
+%
+% \subsubsection{lbezier}
+% \DescribeMacro{\lbezier}
+% \verb+\lbezier+ is straightforward defined as
+% linear polynomial. It produces equally spaced points.
+%
+% \begin{verbatim}
+% ...
+% \put(0,25){\line(1,0){90}}
+% \lbezier[20](0,10)(90,10)
+% \lbezier[200](0,-5)(90,-5)
+% ...
+% \end{verbatim}
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(150,30)
+% \put(-20,-15){\framebox(230,50){}}
+% \put(0,25){\line(1,0){90}}
+% \put(95,25){\makebox(100,0){\protect\LaTeXe\ \protect\texttt{line}}}
+% \lbezier[20](0,10)(90,10)
+% \put(95,10){\makebox(100,0){\protect\texttt{lbezier} (21 points)}}
+% \lbezier[200](0,-5)(90,-5)
+% \put(95,-5){\makebox(100,-5){\protect\texttt{lbezier} (201 points)}}
+% \end{picture}
+% \end{center}
+% \caption{Different line commands}
+% \end{figure}
+%
+% Use \verb+\lbezier+ only in cases where the line you want to plot is not within
+% the scope of the \verb+\line+ command, i.e. the slope is not a small rational number
+% and/or the length is too small.
+%
+% \subsubsection{cbezier}
+%
+% \DescribeMacro{\cbezier}
+% Just like the \verb+\lbezier+ macro \verb+\cbezier+ uses no tricks to generate
+% the third order polynomial. The examples are from the \Metafont\ book
+% (pp. 13)\cite{T3}, where the influence of changing the order of the
+% controlling points ($z_1$ up to $z_4$) is also demonstrated.
+%
+% \begin{verbatim}
+% ...
+% % z1=(0,16) z2=(40,84) z3=(136,96) z4=(250,0)
+% % z12=(20,50) z23=(88,90) z34=(193,48) z123=(54,70)
+% % z234=(140.5,69)
+% \cbezier[400](0,16)(40,84)(136,96)(250,0)
+% \lbezier[30](0,16)(40,84)
+% \lbezier[30](40,84)(136,96)
+% \lbezier[30](136,96)(250,0)
+% \lbezier[30](20,50)(88,90)
+% \lbezier[30](88,90)(193,48)
+% \lbezier[30](54,70)(140.5,69)
+% ...
+% \end{verbatim}
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(250,100)
+% \put(-10,-10){\framebox(270,115){}}
+% \cbezier[400](0,16)(40,84)(136,96)(250,0)
+% \lbezier[30](0,16)(40,84)
+% \lbezier[30](40,84)(136,96)
+% \lbezier[30](136,96)(250,0)
+% \lbezier[30](20,50)(88,90)
+% \lbezier[30](88,90)(193,48)
+% \lbezier[30](54,70)(140.5,69)
+% \end{picture}
+% \end{center}
+% \caption{Iteration scheme for one point}
+% \end{figure}
+%
+%
+% \DescribeMacro{\Cbezier}
+% The variant \verb+\Cbezier+ draws also dots and lines for the controlling points (see
+% Fig.\ 6)\footnote{It resets also the plot symbol to the standard one; cf. Section 7}.
+%
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(184,100)
+% \put(-10,-10){\framebox(204,100){}}
+% \Cbezier[200](0,50)(12,72)(43,78)(84,50)
+% \Cbezier[200](100,50)(143,78)(112,72)(184,50)
+% \Cbezier[200](12,22)(0,0)(43,28)(84,0)
+% \Cbezier[200](100,0)(184,0)(112,22)(143,28)
+% \end{picture}
+% \end{center}
+% \caption{Examples for cubic curves with varying the order of the controlling points}
+% \end{figure}
+%
+% \subsection{Circles and Arcs}
+%
+% All complex plotting commands in this package
+% use a variant of \verb+\cbezier+ as building block. As
+% in the \Metafont\ book circles and arcs may be represented by
+% \verb+\cbezier+.
+%
+% To illustrate the procedure of the macro
+% we do one calculation explicitely.
+%
+% E.g. we want to draw the upper right quarter of a circle with end points $z_1=(0,r)$
+% and $z_4=(r,0)$. $z_2$ and $z_3$ determine the tangents. So we may introduce
+% them as $z_2=(h,r)$ and $z_3=(r,h)$ with a---so far unspecified---parameter
+% $h$.
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(50,50)
+% \put(20,10){\line(1,0){30}}
+% \put(20,10){\line(0,1){30}}
+% \put(20,40){\line(1,0){10}}
+% \put(50,10){\line(0,1){10}}
+% \put(30,40){\line(1,-1){20}}
+% \put(20,40){\makebox(0,0){$\bullet$}}
+% \put(50,20){\makebox(0,0){$\bullet$}}
+% \put(30,40){\makebox(0,0){$\bullet$}}
+% \put(50,10){\makebox(0,0){$\bullet$}}
+% \put(5,35){$z_1$}
+% \put(45,0){$z_4$}
+% \put(52,18){$z_3$}
+% \put(25,45){$z_2$}
+% \put(-5,-10){\framebox(70,70){}}
+% \end{picture}
+% \end{center}
+% \caption{Sketch for the geometrical configuration}
+% \end{figure}
+%
+% If we substitute all points in the formula for the Bernste\u\i{}n
+% polynomial for both components, we end at (for $t=1/2$)
+% \[ x[\frac{1}{2}]=y[\frac{1}{2}]=\frac{r}{2}+\frac{3h}{8}\]
+% These values should be $r/\sqrt{2}$ for a circle.
+% So we arrive at
+% \[ h=\frac{4}{3}\left(\sqrt{2}-1\right).\]
+%
+% \DescribeMacro{\cArc}
+% \DescribeMacro{\cCircle}
+% The plot commands are:
+% \begin{verbatim}
+% \cArc[n](xm,ym)(x1,y1)
+% \cCircle[n](xm,ym){r}[loc]
+% \end{verbatim}
+%
+% The optional qualifier $n$ determines the number
+% of plotted points (There are as before $n+1$ plotted points for arcs; for circles the
+% number depends on the specifier \textit{loc} and may be $n+1$, $2n+2$, or $4n+4$.).
+%
+% \verb+\cArc+ plots a half circle with centre $(x_m,y_m)$ and $x$-axis through
+% $(x_1,y_1)$ counterclockwise.
+%
+% $r$ is the radius of the circle, specified as decimal constant in terms of
+% \verb+\unitlength+.
+%
+% \verb+\cCircle+ plots full, halves and quarters of circles by specifying
+% \textit{loc} (see the corresponding table).
+%
+% \begin{table}[hbtp]
+% \caption{Location specifiers for \texttt{cCircle}s}
+% \begin{center}
+% \begin{tabular}{|l|l|}
+% \hline
+% \textit{loc} & specifies \dots\\
+% \hline
+% \texttt{f} & full circle\\
+% \texttt{l} & left half circle\\
+% \texttt{r} & right half circle\\
+% \texttt{b} & bottom half circle\\
+% \texttt{t} & top half circle\\
+% \texttt{lb} or \texttt{bl} & left bottom quarter of the circle\\
+% \texttt{lt} or \texttt{tl} & left top quarter of the circle\\
+% \texttt{rb} or \texttt{br} & right bottom quarter of the circle\\
+% \texttt{rt} or \texttt{tr} & right top quarter of the circle\\
+% \hline
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \begin{figure}[hbtp]
+% \begin{center}
+% \begin{picture}(300,100)
+% \cCircle[1600](150,50){50}[f]
+% \cCircle[150](100,0){50}[tr]
+% \cCircle[150](100,100){50}[br]
+% \cCircle[150](200,0){50}[tl]
+% \cCircle[150](200,100){50}[bl]
+% \cCircle[200](50,90){45}[b]
+% \cCircle[200](50,0){45}[t]
+% \cCircle[200](5,45){45}[r]
+% \cCircle[200](95,45){45}[l]
+% \cArc[200](250,70)(280,50)
+% \cArc[200](250,60)(280,50)
+% \cArc[200](250,50)(280,50)
+% \cArc[200](250,40)(280,50)
+% \cArc[200](250,30)(280,50)
+% \put(-10,-10){\framebox(320,120){}}
+% \end{picture}
+% \end{center}
+% \caption{Examples for \texttt{cCircle} and \texttt{cArc}}
+% \end{figure}
+% %
+%
+% \section{Fitting Arcs}
+%
+% The quality of representating arcs by cubic bezier curves is quite
+% satisfactory. The differences between circles and beziers may be
+% estimated in two ways.
+%
+% \begin{enumerate}
+% \item If we test the overall fit the area enclosed by
+% the curves is a good metric: The area of \texttt{Carc} for the quarter circle
+% is $1/30 (-33+40\sqrt{2})r^2$ to be conferred with $\pi/4\:r^2$. This is an overshot
+% by just 0.028\%!
+% \item The pointwise fit is measured by the radial difference.
+% The maximum is $\cong 0.00025\,r$ (at odd multiples of $\pi/8$),
+% it is zero for all multiples of $\pi/4$.
+% \end{enumerate}
+%
+% \section{Some \TeX{}nical Notes}
+%
+% For the macros therein a lot of counters and lengths have to
+% be declared.\footnote{Although I reuse some internal lengths I had to
+% declare some more to be used in function calls.}
+% Counters represent integer numbers, lengths are
+% ``real'' numbers (actually they are just integer multiples of
+% $1/65536=2^{-16}$). \TeX\ has just a limited number of these
+% stacks and therefore I use the same counters/lengths in all the macros.
+%
+% One cannot store a real number for further use in these internal stacks just a
+% multiplication of a \textit{decimal constant} with a length is possible (counters
+% may be multiplied also with real numbers but just the integer part of the decimal
+% constant is used!)
+%
+% The package \Lpack{calc} introduced in the \LaTeX\ Companion\cite{T4} adds a
+% new possiblity for multiplying lengths with the ratio of two lengths. This feature will be
+% utilized furthermore.
+%
+% \section{Calculating Lengths}
+%
+% If I define lengths with respect to some \verb+\unitlength+ I can now define a
+% product or fraction of two lengths:
+%
+% \verb+\lengthc = \lengtha*\ratio{\lengthb}{\unitlength}+
+%
+% and
+%
+% \verb+\lengthc = \unitlenght*\ratio{\lengtha}{\lengthb}+
+%
+% The dimension of \verb+\lengthc+ \textit{in terms of} \verb+\unitlength+ (!) is the
+% product, or factor respectively, of the two other lengths.
+%
+% With these operations it is even possible to
+% calculate square roots. Simply use the iteration scheme ($m$ integer)
+% \[ \xi_{m+1}=\frac{1}{2}\left( \xi_m + \frac{a}{\xi_m} \right) \]
+% which will converge fast (with accuracy \verb+\eps+=1\,sp) to $\sqrt a$ (starting with
+% $\xi_0=a>0$).
+%
+%
+% Lengths (in a \texttt{picture} environment) are easily calculated too, one just has to
+% care for the upper limits (the maximum length for \TeX\ is roughly 16384\,pt!).
+%
+% \DescribeMacro{\LenMult}
+% \DescribeMacro{\LenDiv}
+% \DescribeMacro{\AbsLen}
+% \DescribeMacro{\LenSqrt}
+% \DescribeMacro{\Length}
+% \DescribeMacro{\LenNorm}
+% The macros are:
+% \begin{itemize}
+% \item \verb+\LenMult#1#2#3+ and \verb+\LenDiv#1#2#3+ with two input and one output length
+% (\verb+#3+).
+% \item \verb+\AbsLen#1+ which returns the input length as positive length
+% (\TeX\ lengths can be negative!).
+% \item \verb+\LenSqrt#1#2+ returns in the length \verb+#2+ the square root of length \verb+#1+
+% (to say it again: measured in terms of \verb+\unitlength+).
+% \item \verb+\Length(#1,#2)(#3,#4)#5+ stores in \verb+#5+ the length of the line
+% segment between points \verb+(#1,#2)+ and \verb+(#3,#4)+ (coordinates may be decimal
+% constants as in the \texttt{picture} commands).
+% \item \verb+\LenNorm#1#2#3+ returns in \verb+#3+ the length of the hypothenuse of the
+% rectangular triangle with catheti \verb+#1+ and \verb+#2+.
+% \end{itemize}
+%
+% \DescribeMacro{\eps}
+% \textbf{All calculations} can be only exact up to the smallest length in \TeX\ which is
+% \verb+\eps+=1\,sp=$2^{-16}$\,pt=0.000015\,pt.
+%
+% Examples (\verb+\unitlength+=1\,pt):
+% \begin{verbatim}
+% Mult: \LenMult{3pt}{4.333333pt}{\PathLength}\the\PathLength
+% Div: \LenDiv{3pt}{4.3333333pt}{\PathLength}\the\PathLength
+% Abs: \setlength{\PathLength}{-10pt}\the\PathLength\
+% \AbsLen{\PathLength}\the\PathLength
+% Sqrt: \LenSqrt{16pt}{\PathLength}\the\PathLength\
+% \LenSqrt{2pt}{\PathLength}\the\PathLength\
+% \Length(1.5,4.3)(2.7,5){\PathLength}\the\PathLength\
+% \LenNorm{3pt}{4pt}{\PathLength}\the\PathLength
+% \end{verbatim}
+%
+% Mult: \LenMult{3pt}{4.333333pt}{\PathLength}\the\PathLength\ (exact: 13\,pt)
+%
+% Div: \LenDiv{3pt}{4.333333pt}{\PathLength}\the\PathLength\ (exact: 0.692308\,pt)
+%
+% Abs: \setlength{\PathLength}{-10pt}\the\PathLength\
+% \AbsLen{\PathLength}\the\PathLength
+%
+% Sqrt: \LenSqrt{16pt}{\PathLength}\the\PathLength\ (exact: 4\,pt)\
+% \LenSqrt{2pt}{\PathLength}\the\PathLength\ (exact: 1.414213\,pt)
+%
+% \hspace*{10mm} \Length(1.5,4.3)(2.7,5){\PathLength}\the\PathLength\ (exact: 1.389244\,pt)
+% \LenNorm{3pt}{4pt}{\PathLength}\the\PathLength (exact: 5\,pt)
+%
+% \DescribeMacro{\PathLengthQ}
+% \DescribeMacro{\PathLengthC}
+% \DescribeMacro{\PathLength}
+% \DescribeMacro{\pathmax}
+% Furthermore you can use these macros to evaluate the length of linear interpolations
+% of the curves displayed by \verb+\qbezier+ and \verb+\cbezier+. The syntax is
+% \verb+\PathLengthQ[n](x1,y1)(x2,y2)(x3,y3)+ and\\
+% \verb+\PathLengthC[n](x1,y1)(x2,y2)(x3,y3)(x4,y4)+ respectively. $n$ is the
+% number of interpolation points which is bounded by \verb+\pathmax+=50. The length
+% is stored in the%
+% ---already defined and used---length \verb+\PathLength+. Note: $n$ is \emph{not} optional
+% for these two macros.
+%
+% Example: For the cubic spline\\
+% \verb+\cbezier[200](0,0)(50,100)(50,0)(100,100)+
+% shown in Fig.~9 the results of the \verb+\PathLength+ \\
+% for $n$=2,5,10,20,30,40,50
+% are displayed below. You may increase the value of \verb+\pathmax+ as for
+% \verb+\qbeziermax+ but the result will due to the internal calculation problems
+% not become sigificant better.
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(100,80)
+% \put(0,0){\framebox(100,100){}}
+% \cbezier[300](0,0)(50,100)(50,0)(100,100)
+% \end{picture}
+% \end{center}
+% \caption{A nice cubic curve}
+% \end{figure}
+%
+% The results are: \PathLengthC[2](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[5](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[10](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[20](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[30](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[40](0,0)(50,100)(50,0)(100,100)\the\PathLength,
+% \PathLengthC[50](0,0)(50,100)(50,0)(100,100)\the\PathLength.
+% (An good numercial integration program will yield more accurate 149.999.)
+%
+% \section{More general arcs}
+%
+% \DescribeMacro{\cArcs}
+% Finally you can plot an arc (i.e.\ a cubic approximation to the circle arc) between
+% two points with given centre of the circle:\\
+% \verb+\cArcs[n](xm,ym)(x1,y1)(x2,y2)+\\
+% with $n+1$ number of points (limited by
+% \verb+\qbeziermax+ again) and centre $(x_m,y_m)$.
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(200,200)
+% \put(0,0){\framebox(200,200){}}
+% \put(100,100){\makebox(0,0){$\bullet$}}
+% \cArcs[300](100,100)(120,130)(130,120)
+% \cArcs[100](100,100)(150,110)(110,150)
+% \cArcs[300](100,100)(130,180)(130,20)
+% \cArcs[300](100,100)(120,170)(80,170)
+% \cArcs[300](100,100)(60,150)(60,50)
+% \cArcs[100](100,100)(90,90)(110,90)
+% \cArcs[200](100,100)(60,70)(130,60)
+% \end{picture}
+% \end{center}
+% \caption{Some examples for arcs; the centre is marked by $\bullet$}
+% \end{figure}
+%
+% Limitations:
+% \begin{itemize}
+% \item The arc should be smaller than the half of a circle (The limit is
+% handled by \verb+\cArc+ and is built-in again in \verb+\cArcs+.) Otherwise the shape
+% will become ``elliptic'' and ly in the wrong half plane.
+% \item There is no check for consistency if $r_1^2=(x_1-x_m)^2+(y_1-y_m)^2$ and
+% $r_2^2=(x_2-x_m)^2+(y_2-y_m)^2$ are really equal. The graph will contain in any case
+% both points as border points.
+% \end{itemize}
+% I will shortly derive the formulas used in the code. The code is even more tricky
+% due to the fact that I had just a limited number of lengths and the code reuses
+% some lengths explicitely and implicitely by calling routines.
+%
+% \begin{figure}[hbt]
+% \begin{center}
+% \begin{picture}(200,200)
+% \put(0,0){\framebox(200,200){}}
+% \put(80,20){\makebox(0,0){$\bullet$}}
+% \put(50,120){\makebox(0,0){$\bullet$}}
+% \put(171.65,70){\makebox(0,0){$\bullet$}}
+% \put(100,135){\makebox(0,0){$\bullet$}}
+% \put(146.65,115.825){\makebox(0,0){$\bullet$}}
+% \put(120.3,115.6){\makebox(0,0){$\bullet$}}
+% \lbezier[150](80,20)(50,120)
+% \lbezier[150](80,20)(171.65,70)
+% \cArcs[200](80,20)(50,120)(171.65,70)
+% \lbezier[150](50,120)(150,150)
+% \lbezier[150](171.65,70)(121.65,161.65)
+% \lbezier[30](80,20)(141.65,170)
+% \put(66,21){$M$}
+% \put(41,115){4}
+% \put(174,65){1}
+% \put(90,135){3}
+% \put(150,112){2}
+% \put(116,120){5}
+% \end{picture}
+% \end{center}
+% \caption{Sketch for the geometric situation}
+% \end{figure}
+%
+% We know the coordinates for the points $M$, 1, and 4. The tangents $\overline{43}$ and
+% $\overline{12}$ are normals to the radius in the corresponding points. The distances
+% $\overline{43}$ and $\overline{12}$ should be equal. 5 lies on the symmetry axis (dotted
+% line) with distance $r$ from $M$.
+%
+% \noindent Normal vectors: $\vec n_1=(y_m-y_1,x_1-x_m)$ and $\vec n_2=(y_4-y_m,x_m-x_4)$
+%
+% \noindent Coordinate vectors: $\vec 2 = \vec 1 + \lambda \vec n_1$ and
+% $\vec 3 = \vec 4 + \lambda \vec n_2$ ($\lambda$ is the same because both normal
+% vectors have length $r$)
+%
+% \noindent Furthermore $\vec 5={\cal B}_4 [1/2]$ (the cubic spline
+% should also be symmetric and contain 5)
+%
+% Now we have:
+% \begin{eqnarray}
+% x[ t] & = & (1-t)^3 x_1 + 3 t (1-t)^2 x_2 + 3 t^2 (1-t) x_3 +t^3 x_4\\
+% y[ t] & = & (1-t)^3 y_1 + 3 t (1-t)^2 y_2 + 3 t^2 (1-t) y_3 +t^3 y_4
+% \end{eqnarray}
+%
+% Substituting for $x_2$, $y_2$, $x_3$, and $y_3$ and $t\to1/2$:
+% \begin{eqnarray}
+% x_5=x\left[ \frac{1}{2}\right] & = & \frac{1}{2}
+% (x_1 +x_4) + \frac{3}{8} \lambda(y_4-y_1) \\
+% y_5=y\left[ \frac{1}{2}\right] & = & \frac{1}{2}
+% (y_1 +y_4) + \frac{3}{8} \lambda(x_1-x_4 )
+% \end{eqnarray}
+%
+% We could now calculate the norm of this point and set it equal to the radius $r^2=
+% (x_m-x_1)^2+(y_m-y_1)^2$. This gives a quadratic equation for
+% $\lambda$. But the result is a rather complex term with respect to our input parameters.
+%
+% A nicer term can be found if we define
+% \begin{equation}
+% x_5=x_m+\kappa (x_1+x_4-2x_m) \quad y_5=y_m+\kappa (y_1+y_4-2y_m)
+% \end{equation}
+% with aid of the symmetry vector. $\kappa$ is simply $r$ divided by the norm of the
+% symmetry vector.
+%
+% The resulting $\lambda$ is now (using just the $x$-equation)
+% \begin{equation}
+% \lambda=\frac{4}{3} (-1+2 \kappa)\frac{x_1+x_4-2x_m}{y_4-y_1}
+% \end{equation}
+%
+% Special cases:
+% \begin{itemize}
+% \item The symmetry vector is the null vector if $\overline{14}$ is a diameter of the
+% circle. But this case is already solved by \verb+\cArc+.
+% \item For $y_4=y_1$ one needs the equation for the $y$-component, i.e.\ we have as factor
+% $(y_1+y_4-2y_m)/(x_1-x_4)$ in $\lambda$.
+% \end{itemize}
+%
+%
+% \section{Varying the line thickness}
+%
+% There is another package, \Lpack{bez123}\cite{T5}, which introduces also linear and cubic
+% bezier curves, even variants which plot exactly all kind of conic curves (ellipses,
+% parabolas, and hyperbolas). There are two features in \Lpack{bez123}, which I added in the
+% third version of \Lpack{ebezier}:
+%
+% \DescribeMacro{\thinlines}
+% \DescribeMacro{\thicklines}
+% \DescribeMacro{\linethickness}
+% \DescribeMacro{\qbeziermax}
+% \begin{enumerate}
+% \item Changing the size of the plot squares by the \LaTeX\ commands\\
+% \verb+\thinlines+, \verb+\thicklines+, and/or \verb+\linethickness+.
+% \item Calulation of an optimal number of plot points if $n$=0 instead of using the
+% maximum \verb+\qbeziermax+ (see next section).
+% \end{enumerate}
+%
+% If you look close to lines you will note some peculiarity. For instance the original
+% \LaTeX\ \verb+\line+ is in horizontal/vertical mode a simple \verb+\ruler+.
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(100,100)
+% \thinlines
+% \put(-5,-5){\framebox(110,110){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,10){\line(1,0){100}}
+% \put(10,0){\line(0,1){100}}
+% \setlength{\linethickness}{10pt}
+% \put(10,10){\line(1,0){60}}
+% \put(10,10){\line(0,1){60}}
+% \end{picture}
+% \end{center}
+% \caption{Axes with standard lines}
+% \end{figure}
+%
+% Remark: The \textit{line} is exactly as long as specified.
+%
+% \DescribeMacro{\@wholewidth}
+% But the plot point used by \verb+\qbezier+, \Lpack{bez123} and \Lpack{ebezier}
+% (until version 2!) is a small square which is not centered at the control points
+% (dimension \verb+\@wholewidth+)
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(50,50)
+% \thinlines
+% \put(-5,-5){\framebox(60,60){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,25){\line(1,0){50}}
+% \put(15,0){\line(0,1){50}}
+% \DefOldPlotSymbol
+% \setlength{\linethickness}{10pt}
+% \lbezier[1](15,25)(15,25)
+% \end{picture}
+% \end{center}
+% \caption{Old plot symbol}
+% \end{figure}
+%
+% which results in a shifted $y$-axis and \textit{lines} which are actually longer
+% by an amount of one square (i.e. \verb+\@wholewidth+)
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(100,100)
+% \thinlines
+% \put(-5,-5){\framebox(110,110){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,10){\line(1,0){100}}
+% \put(10,0){\line(0,1){100}}
+% \setlength{\linethickness}{10pt}
+% \DefOldPlotSymbol
+% \setlength{\linethickness}{10pt}
+% \lbezier[10](10,10)(80,10)
+% \lbezier[10](10,10)(10,80)
+% \end{picture}
+% \end{center}
+% \caption{Axes with old plot symbol}
+% \end{figure}
+%
+% or with hollow squares ($\bullet$ references to the end points).
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(100,100)
+% \thinlines
+% \put(-5,-5){\framebox(110,110){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,10){\line(1,0){100}}
+% \put(10,0){\line(0,1){100}}
+% \thinlines
+% \put(10,5){\framebox(70,10){}}
+% \put(10,5){\framebox(10,70){}}
+% \put(10,5){\framebox(10,10){}}
+% \put(70,5){\framebox(10,10){}}
+% \put(10,65){\framebox(10,10){}}
+% \put(10,10){\makebox(0,0){$\bullet$}}
+% \put(70,10){\makebox(0,0){$\bullet$}}
+% \put(10,70){\makebox(0,0){$\bullet$}}
+% \end{picture}
+% \end{center}
+% \caption{Axes with old plot symbol (hollow)}
+% \end{figure}
+%
+%
+% This version uses centered plot symbols (standard is again a square)
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(50,50)
+% \put(-5,-5){\framebox(60,60){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,25){\line(1,0){50}}
+% \put(25,0){\line(0,1){50}}
+% \DefStandardPlotSymbol
+% \setlength{\linethickness}{10pt}
+% \lbezier[1](25,25,)(25,25)
+% \end{picture}
+% \end{center}
+% \caption{New standard plot symbol}
+% \end{figure}
+%
+% which corrects the shift of the $y$-axis. The line is again longer but this
+% time the excess is symmetrically on both ends
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(100,100)
+% \thinlines
+% \put(-5,-5){\framebox(110,110){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,10){\line(1,0){100}}
+% \put(10,0){\line(0,1){100}}
+% \setlength{\linethickness}{10pt}
+% \lbezier[10](10,10)(80,10)
+% \lbezier[10](10,10)(10,80)
+% \end{picture}
+% \end{center}
+% \caption{Axes with new standard plot symbol}
+% \end{figure}
+%
+% or again with hollow squares.
+%
+% \begin{figure}[htbp]
+% \begin{center}
+% \begin{picture}(100,100)
+% \thinlines
+% \put(-5,-5){\framebox(110,110){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,10){\line(1,0){100}}
+% \put(10,0){\line(0,1){100}}
+% \thinlines
+% \put(5,5){\framebox(70,10){}}
+% \put(5,5){\framebox(10,70){}}
+% \put(5,5){\framebox(10,10){}}
+% \put(65,5){\framebox(10,10){}}
+% \put(5,65){\framebox(10,10){}}
+% \put(10,10){\makebox(0,0){$\bullet$}}
+% \put(70,10){\makebox(0,0){$\bullet$}}
+% \put(10,70){\makebox(0,0){$\bullet$}}
+% \end{picture}
+% \end{center}
+% \caption{Axes with new standard plot symbol (hollow)}
+% \end{figure}
+%
+% \DescribeMacro{\DefOldPlotSymbol}
+% \DescribeMacro{\Qbezier}
+% To be consistent with the old version the command \verb+\DefOldPlotSymbol+
+% is supplied which uses the old form. Also a variant \verb+\Qbezier+ for
+% \verb+\qbezier+ is
+% defined which can use the new plot symbol.\footnote{This command is just for convenience.
+% A quadratic bezier can be plotted as cubic bezier as follows. If you want to plot
+% $\backslash$\texttt{qbezier[100](z1)(zm)(z4)} with $(z)=(x,y)$ you may calulate points
+% $z_2=2/3[z_m,z_1]$ and $z_3=2/3[z_m,z_4]$. The cubic bezier $\backslash$%
+% \texttt{cbezier[100](z1)(z2)(z3)(z4)} is exactly the same as the quadratic one!}%
+% \footnote{It can also use the other new symbols defined later.}
+%
+% The next point of consideration is the handling of slanted lines.
+% In the ordinary \LaTeX-\texttt{picture} environment
+% \verb+\linethickness+ has no effect on slanted lines. Now the change applies
+% but a new problem occurs. If you plot a slanted line (slope angle $\varphi$)
+% with squares
+%
+% \begin{figure}[htb]
+% \begin{center}
+% \begin{picture}(100,80)
+% \thinlines
+% \put(-5,-5){\framebox(110,90){}}
+% \put(5,5){\framebox(30,30){}}
+% \put(25,15){\framebox(30,30){}}
+% \put(45,25){\framebox(30,30){}}
+% \put(65,35){\framebox(30,30){}}
+% \put(35,5){\line(2,1){70}}
+% \put(5,35){\line(2,1){70}}
+% \put(60,5){\vector(-1,2){5}}
+% \put(55,15){\line(-1,2){23}}
+% \put(32.5,60){\vector(1,-2){5}}
+% \put(61,22){$\scriptscriptstyle\varphi$}
+% \put(32,47){$\scriptscriptstyle\varphi$}
+% \put(65,10){$d$}
+% \end{picture}
+% \end{center}
+% \caption{Effective thickness for slanted lines}
+% \end{figure}
+%
+% your line gets effective thicker! The factor of enlargement is $\sin \varphi
+% +\cos \varphi$ which has its maximum $\sqrt 2$ with slope $\varphi_0=45^0$.
+%
+%
+% There are two possiblities to correct the thickness
+% \begin{itemize}
+% \item correct the line thickness of each line or
+% \item use other plot symbols which behave better.
+% \end{itemize}
+%
+% \DescribeMacro{\Lbezier}
+% The first possibilitiy can be realized just for \verb+\lbezier+ and not
+% \verb+\cbezier+ because the slope changes from point to point in the latter case.
+% The solution is established by internally changing the \verb+\linethickness+
+% by the factor $\ell/(\Delta x+\Delta y)$ where $\ell$ denotes the length of the
+% line ($=\sqrt{\Delta^2 x +\Delta^2 y}$)
+% and $\Delta x$ is the horizontal difference of the the points
+% ($\Delta y$ respectivelly for the vertical difference).
+%
+% To use this line type call \verb+\Lbezier[n](x1,y1)(x2,y2)+.
+%
+% The second chance is to change the plot symbol to a disc. The smallest disk
+% available is the character ``.'' at 5pt. Unfortunately this method will
+% implicitely restrict the \verb+\linethickness+ to some definite values (see the
+% following table for the numbers in question).
+%
+% \begin{table}[hbtp]
+% \caption{Dimensions for various plot symbols}
+% \begin{center}
+% \begin{tabular}{|ll|rr|l|}
+% \hline
+% Font&Size for (10pt) & Width & Heigth & Rule \\
+% \hline
+% \verb+\vrm+ &tiny& \SB{\vrm}{.}\the\wd1 & \SB{\vrm}{.}\the\ht1 &
+% \SB{\vrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\virm+ &tiny for 11/12pt& \SB{\virm}{.}\the\wd1 & \SB{\virm}{.}\the\ht1 &
+% \SB{\virm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\viirm+ & scriptsize &\SB{\viirm}{.}\the\wd1 & \SB{\viirm}{.}\the\ht1 &
+% \SB{\viirm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\viiirm+ & footnotesize & \SB{\viiirm}{.}\the\wd1 & \SB{\viiirm}{.}\the\ht1 &
+% \SB{\viiirm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\ixrm+ & small &\SB{\ixrm}{.}\the\wd1 & \SB{\ixrm}{.}\the\ht1 &
+% \SB{\ixrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xrm+ & normalsize &\SB{\xrm}{.}\the\wd1 & \SB{\xrm}{.}\the\ht1 &
+% \SB{\xrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xirm+ & normalsize 11pt& \SB{\xirm}{.}\the\wd1 & \SB{\xirm}{.}\the\ht1 &
+% \SB{\xirm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xiirm+ & large &\SB{\xiirm}{.}\the\wd1 & \SB{\xiirm}{.}\the\ht1 &
+% \SB{\xiirm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xivrm+ & Large & \SB{\xivrm}{.}\the\wd1 & \SB{\xivrm}{.}\the\ht1 &
+% \SB{\xivrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xviirm+ & LARGE &\SB{\xviirm}{.}\the\wd1 & \SB{\xviirm}{.}\the\ht1 &
+% \SB{\xviirm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xxrm+ & huge &\SB{\xxrm}{.}\the\wd1 & \SB{\xxrm}{.}\the\ht1 &
+% \SB{\xxrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+\xxvrm+ & Huge &\SB{\xxvrm}{.}\the\wd1 & \SB{\xxvrm}{.}\the\ht1 &
+% \SB{\xxvrm}{.}\rule{1 cm}{\ht1} \copy1\\
+% \verb+$\bullet$+ & &\SB{$\bullet$}{}\the\wd1 &\SB{$\bullet$}{}\the\ht1&
+% \SB{$\bullet$}{}\rule{1cm}{\ht1} \copy1\\
+% \hline
+% \end{tabular}
+% \end{center}
+% \end{table}
+%
+% \DescribeMacro{\DefPlotSymbol}
+% With the aim of the command \verb+\DefPlotSymbol{item}+ you may define any
+% \textit{item} as your plot symbol\footnote{A similar approach with centered
+% symbols can be found in the packages
+% \Lpack{epic}\cite{epic} and PiC\TeX\cite{pictex}.}.
+% It will be centered as the default plot square
+% (otherwise an even larger shift of the $y$-axis would occur). Use explicit font
+% selection with the names supplied in the table to ensure style independence
+% (otherwise e.g.\
+% \verb+\DefPlotSymbol{\tiny .}+ would be different in 10pt and 11pt context).
+%
+% \DescribeMacro{\DefShiftedPlotSymbol}
+% This works
+% for all \textit{items} which have a vertical symmetry axis with respect to their
+% defining bounding box (defined by \Metafont) and which ly on the baseline
+% (or beyond if they have some defined depth). It will not work otherwise. For example the
+% circles from the circle font have heigth and depth zero and their reference point is
+% already the centre (i.e. the symbol extends backward). Or consider the ``*''-sign.
+% It does not ly on the baseline. For these cases a generalized command is supplied:\\
+% \verb+\DefShiftedPlotSymbol{item}{x-shift}{y-shift}{height}+.
+%
+% The shifts are applied
+% to the left and downward. The supplied heigth will only have effect if you specify
+% $n=0$ for the number of plotting points.
+%
+% Examples:
+% \begin{verbatim}
+% \DefShiftedPlotSymbol{\tencirc n}{0pt}{0pt}{1pt}
+% \DefShiftedPlotSymbol{\tencirc \char'176}{0pt}{0pt}{15pt}
+% \DefShiftedPlotSymbol{\fbox{\Huge *}}{0pt}{0pt}{25pt}
+% %with bounding box
+% \setbox0=\hbox{*}
+% \DefShiftedPlotSymbol{*}{.5\wd0}{.7\ht0}{.6\ht0}
+% \lbezier[1](100,30)(100,30)
+% \lbezier[0](0,20)(125,20)
+% \DefShiftedPlotSymbol{*}{.5\wd0}{.7\ht0}{10\ht0}
+% \lbezier[0](0,10)(125,10)
+% \end{verbatim}
+%
+% \setlength{\fboxsep}{0pt}
+% \setlength{\fboxrule}{0.1pt}
+%
+% \begin{figure}[hbtp]
+% \begin{center}
+% \begin{picture}(125,50)
+% \put(-5,-5){\framebox(135,60){}}
+% \setlength{\linethickness}{0.1pt}
+% \put(0,30){\line(1,0){125}}
+% \multiput(25,20)(25,0){4}{\line(0,1){20}}
+% \DefShiftedPlotSymbol{\tencirc n}{0pt}{0pt}{1pt}
+% \lbezier[1](25,30)(25,30)
+% \DefShiftedPlotSymbol{\tencirc \char'176}{0pt}{0pt}{15pt}
+% \lbezier[1](50,30)(50,30)
+% \DefShiftedPlotSymbol{\fbox{\Huge *}}{0pt}{0pt}{25pt}
+% \lbezier[1](75,30)(75,30)
+% \setbox0=\hbox{*}
+% \DefShiftedPlotSymbol{*}{.5\wd0}{.7\ht0}{.6\ht0}
+% \lbezier[1](100,30)(100,30)
+% \lbezier[0](0,20)(125,20)
+% \DefShiftedPlotSymbol{*}{.5\wd0}{.7\ht0}{10\ht0}
+% \lbezier[0](0,10)(125,10)
+% \end{picture}
+% \end{center}
+% \caption{Examples for other plot symbols}
+% \end{figure}
+%
+% \emph{Caution:} The commands for changing the line thickness have
+% implicit effects for plot symbols
+% defined with \verb+\DefPlotSymbol{item}+ or \\
+% \verb+\DefShiftedPlotSymbol+. The implicit or
+% explicit defined height is redefined. But the effect is only visible in case $n=0$.
+%
+%
+% \DescribeMacro{\DefStandardPlotSymbol}
+% In any case you may restore \textbf{default values} by stating
+% \begin{verbatim}
+% \DefStandardPlotSymbol
+% \thinlines
+% \end{verbatim}
+%
+% \section{Estimation for the number of plotting points}
+%
+% As mentioned in the last section all plotting macros will calculate the number
+% of plotting points if the value $n=0$ is active. All calculations will
+% use the actual length of the object which can
+% be calculated with the aim of the calculation macros in Section \textit{Calculating Lengths}.
+% For all these calculations \verb+\eps+ is temporarily increased by a factor of 10 and
+% for higher bezier curves just 5 intermediate points will be used. If the calculated number
+% exceeds the specified maximum \verb+\qbeziermax+ an info in the log-file will be generated.
+%
+% All macros for circles and arcs will use a simpler estimate due to their construction
+% by an intrinsic call of the cubic bezier. It uses the length of the chord and
+% the maximal deviation factor $\pi/2$ from the arc length.
+%
+%
+% \section{Joining linear beziers}
+%
+% \DescribeMacro{\ljoin}
+% A further command has been supplied to ease the drawing of polygon paths. Instead of
+% writing a sequence of \verb+\lbezier+s with common vertices you can write compactly
+% \verb+\ljoin[n](x1,y1)(x2,y2)(x3,y3)...(xm,ym)+
+%
+% Caution: There should be no spaces in the command, so break lines with \% if
+% necessary. There should be at least 2 points. The parameter $n$ is optional, internally
+% \verb-\lbezier[n](xk,yk)(xk+1,yk+1)- will be executed.
+%
+% \DescribeMacro{\Ljoin}
+% There is also a variant \verb+\Ljoin+ which uses \verb+\Lbezier+.
+%
+% \renewcommand{\qbeziermax}{1200}
+% \begin{figure}
+% \begin{center}
+% \begin{picture}(200,100)
+% \put(-5,-5){\framebox(210,110){}}
+% \begin{picture}(100,100)
+% \ljoin(0,0)(20,100)(20,0)(40,50)(40,0)(60,25)(60,0)(80,12.5)(80,0)(100,6.25)(100,0)
+% \end{picture}
+% \begin{picture}(100,100)
+% \Ljoin(0,0)(20,100)(20,0)(40,50)(40,0)(60,25)(60,0)%
+% (80,12.5)(80,0)(100,6.25)(100,0)
+% \end{picture}
+% \end{picture}
+% \end{center}
+% \caption{$\backslash$\texttt{ljoin} versus $\backslash$\texttt{Ljoin}}
+% \end{figure}
+%
+% \changes{Version 1}{2000/07/28}{original version}
+% \changes{Version 2}{2001/12/04}{major bug fix for cCircle}
+% \changes{Version 3}{2002/10/23}{major changes}
+% \changes{Version 4}{2005/03/01}{minor changes}
+%
+% \section*{Versions}
+%
+% This is Version 4 from March 1, 2004.
+%
+% Changes with regard to version 3:
+% \begin{itemize}
+% \item Bug-address changed.
+% \item Error in defining (first) equation corrected (thanks to \verb+jens.schwaiger@uni-graz.at+).
+% \item Marginal corrections with regard to \Lpack{l2tabu} (v1.8).
+% \item Documentaion as pdf supplied.
+% \end{itemize}
+%
+% Changes with regard to version 2:
+% \begin{itemize}
+% \item Implementing line thickness (\verb+\thinlines+, \verb+\thicklines+, and\\
+% \verb+\setlength{\linethickness}{dimen}+.
+% \item Different plot symbols.
+% \item \verb+\Lbezier+ for equally thick lines in all directions.
+% \item \verb+\Qbezier+ implementation to be used with new plot symbols.
+% \item Calculation of an optimal number of plot symbols (as default number for case $n$=0).
+% \item Parameter $n$ is for all \emph{plot} commands optional.
+% \item New macro for polygon paths.
+% \item Style supplied in dtx-format.
+% \item Minor style changes regarding numbers and lengths.
+% \end{itemize}
+%
+% Changes with regard to Version 1:
+% \begin{itemize}
+% \item \verb+\@tempa+ replaced by \verb+\@TempDim+. \verb+\@tempa+ was also
+% used by other packages.
+% \item Additionaly supplied \verb+\RequirePackage{calc}+.
+% \item Bug fixed for circles. The original macros did actually not support changes in
+% \verb+\unitlength+.
+% \end{itemize}
+%
+% \begin{thebibliography}{9}
+% \bibitem{T2} D.\ E.\ Knuth: \textit{The} \TeX\ \textit{Book}, Addison-Wesley,
+% Reading MA, 1986.
+% \bibitem{T3} D.\ E.\ Knuth: \textit{The} \Metafont\ \textit{Book}, Addison-Wesley,
+% Reading MA, 1986.
+% \bibitem{T4} M.\ Goossens, F.\ Mittelbach, A.\ Samarin: \textit{The} \LaTeX\ \textit{Companion},
+% Addison-Wesley, Reading MA, 1994.
+% \bibitem{T1} M.\ Goossens, S.\ Rahtz, F.\ Mittelbach: \textit{The} \LaTeX\
+% \textit{Graphics Companion}, Addison-Wesley, Reading MA, 1997.
+% \bibitem{T5} P.\ Wilson: \textit{The} \Lpack{bez123} \textit{and} \Lpack{multiply}
+% \textit{packages}, 1998;\\ packages at CTAN/macros/latex/contrib/supported/bez123.
+% \bibitem{epic} S.\ Podar: \textit{Enhancements to the Picture Environment
+% in }\LaTeX, 1986;\\ package at CTAN/macros/latex/other/epic.
+% \bibitem{pictex} M.\ J.\ Wichura: \textit{The PiC}\TeX\ \textit{Manual}, 1992;\\
+% package at CTAN/graphics/pictex.
+% \bibitem{pict2e} R.\ Niepraschk, H.\ Gaesslein: The \Lpack{pict2e} Package, 2003;\\
+% package at CTAN/macros/latex/contrib/pict2e.
+% \bibitem{PiX} N.\ J.\ H.\ M.\ van Beurden: A \LaTeX\ picture editor for Windows, 2003;\\
+% package at CTAN/systems/win32/latexpix.
+% \end{thebibliography}
+%
+% \OnlyDescription
+%
+% \section{Implementation}
+%
+% The macros \verb+\lbezier+ and \verb+\cbezier+ are rather old, they existed since
+% I realized the existence of \Lpack{bezier.sty} more then ten years ago. Therefore
+% the macros are written rather in pure \TeX\ than in \LaTeX. Only the calculation
+% macros demand for \LaTeX\ notation to use the package \Lpack{calc}. But with this
+% version the macros interact more and some \LaTeX\ part occurrs also in the plot macros.
+%
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{calc}
+%%
+% \end{macrocode}
+% I define new font names because \texttt{cmr} may not be the standard font. They
+% may be needed for plotting symbols.
+% \begin{macrocode}
+\newfont{\vrm}{cmr5}
+\newfont{\virm}{cmr6}
+\newfont{\viirm}{cmr7}
+\newfont{\viiirm}{cmr8}
+\newfont{\ixrm}{cmr9}
+\newfont{\xrm}{cmr10}
+\newfont{\xiirm}{cmr12}
+\newfont{\xviirm}{cmr17}
+\newfont{\xirm}{cmr10 scaled \magstephalf}
+\newfont{\xivrm}{cmr10 scaled \magstep2}
+\newfont{\xxrm}{cmr10 scaled \magstep4}
+\newfont{\xxvrm}{cmr10 scaled \magstep5}
+%%
+% \end{macrocode}
+%
+% I need only three new counters,
+% \begin{macrocode}
+\newcounter{@cnta}\newcounter{@cntb}\newcounter{@cntc}\newcounter{@cntd}
+%%
+% \end{macrocode}
+% but a lot of lengths. Packages like PiC\TeX\ have problems by defining too many
+% lengths, so I try to use as many already defined lengths (defined for usage
+% in a plotting context).
+% \begin{macrocode}
+%% \@TempDim#1#2#3{"count"|"dimen"|"box"|"skip"}{\myname}{\realname}
+%% allocate new one or alias is defined, so use it
+%%
+\def\@TempDim#1#2#3{%
+ \ifx\@und@fined#3\csname new#1\endcsname#2%
+ \else\let#2#3\fi}
+%%
+\@TempDim{dimen}\@X\@ovxx
+\@TempDim{dimen}\@Xa\@ovdx
+\@TempDim{dimen}\@Xb\@ovyy
+\@TempDim{dimen}\@Xc\@ovdy
+\@TempDim{dimen}\@Y\@ovro
+\@TempDim{dimen}\@Ya\@ovri
+\@TempDim{dimen}\@Yb\@xdim
+\@TempDim{dimen}\@Yc\@ydim
+\@TempDim{dimen}\@Z\@clnht
+\@TempDim{dimen}\@Za\@clnwd
+\@TempDim{dimen}\@Zb\@dashdim
+\@TempDim{dimen}\@Zc\@tempdima
+\@TempDim{dimen}\@Zd\@tempdimb
+\@TempDim{dimen}\@Ze\@tempdimc
+%%
+\newlength{\@Zf}\newlength{\@Zg}\newlength{\@Zh}
+\newlength{\@Zi}\newlength{\@Zj}
+% \end{macrocode}
+%
+% This special length will be used for the circle macros. The magic number is
+% $0.55228474983=4/3 (\sqrt{2}-1)$.
+%
+% \begin{macrocode}
+\newlength{\magicnum}
+\newcommand\set@magic{%
+ \setlength{\magicnum}{0.55228474983\unitlength}}
+%%
+% \end{macrocode}
+%
+% Another special one is \verb+\eps+. It could be initialized by \verb+\eps\@ne+
+% but due to its context to the calculation part 1sp=1/65536pt is used.
+%
+% \begin{macrocode}
+\newlength{\eps}
+\setlength{\eps}{1sp}
+%%
+% \end{macrocode}
+%
+% The last one is \verb+\PathLength+. It stores lengths which the user may need for
+% further use.
+%
+% \begin{macrocode}
+\newlength{\PathLength}
+%%
+% \end{macrocode}
+%
+% This two constants are needed in calculations, but I did not want to waste
+% any additional counter. \verb+\pathmax+ may be redefined to exceed 256, so it
+% is not defined by \verb+\chardef+.
+%
+% \begin{macrocode}
+\chardef\x@=10
+\newcommand{\pathmax}{50}
+%%
+% \end{macrocode}
+%
+% This fundamental box will keep the plotting symbol.
+%
+% \begin{macrocode}
+\newsavebox{\@pt}
+%%
+% \end{macrocode}
+%
+% I have to distinguish three cases: standard plot symbol, old standard plot symbol,
+% or any new one. For this purpose I need two logicals.
+%
+% \begin{macrocode}
+\newif\if@other@symbol
+\newif\if@standard@symbol
+% \end{macrocode}
+%
+% All plot symbols may be defined by the most general one,\\
+% \verb+\DefShiftedPlotSymbol+, but this way may be faster. The
+% other important macro is \verb+\set@width+ which redefines the plot
+% box due to changes which may have occurred (line thickness).
+%
+% \begin{macrocode}
+\newcommand{\DefStandardPlotSymbol}{%
+ \@other@symbolfalse\@standard@symboltrue
+ \setbox\@pt\hbox{\hskip -.5\wd0\vrule height\@halfwidth
+ depth\@halfwidth width\@wholewidth}}
+\newcommand{\DefOldPlotSymbol}{%
+ \@other@symbolfalse\@standard@symbolfalse
+ \setbox\@pt\hbox{\vrule height\@halfwidth
+ depth\@halfwidth width\@wholewidth}}
+\newcommand{\DefPlotSymbol}[1]{\setbox0=\hbox{#1}\@X\ht0\advance\@X-\dp0
+ \@halfwidth.5\ht0\@wholewidth\ht0
+ \@other@symboltrue\@standard@symbolfalse
+ \setbox\@pt\hbox{\hskip -.5\wd0\lower.5\@X\copy0}}
+\newcommand{\DefShiftedPlotSymbol}[4]{\setbox0=\hbox{#1}\@X #2\@Y #3
+ \@wholewidth #4\@halfwidth.5\@wholewidth
+ \@other@symboltrue\@standard@symbolfalse
+ \setbox\@pt\hbox{\hskip-\@X\lower\@Y\copy0}}
+\newcommand{\set@width}{%
+ \if@other@symbol
+ \relax
+ \else
+ \if@standard@symbol
+ \@X-.5\@wholewidth
+ \else
+ \@X\z@
+ \fi
+ \setbox\@pt\hbox{\hskip\@X\vrule height\@halfwidth
+ depth\@halfwidth width\@wholewidth}%
+ \fi}
+%%
+% \end{macrocode}
+%
+% The initialization is done here. Note that \verb+\thinlines+
+% is already default and needs not be specified here.
+%
+% \begin{macrocode}
+\DefStandardPlotSymbol
+%%
+% \end{macrocode}
+%
+% All plot macros have an optional number. Therefore an additional internal macro
+% is needed (it will have the same name with an extra @ in front of it.
+%
+% Here is the simpliest one, the linear case.
+%
+% \begin{macrocode}
+\def\lbezier{\@ifnextchar [{\@lbezier}{\@lbezier[0]}}
+\def\@lbezier[#1](#2,#3)(#4,#5){%
+ \c@@cntc#1\relax
+ \ifnum \c@@cntc<\@ne
+% \end{macrocode}
+%
+% I decrease the precision locally to speed up calculations. We need just
+% an estimate.
+%
+% \begin{macrocode}
+ \multiply\eps\x@
+ \Length(#2,#3)(#4,#5){\PathLength}%
+ \divide\eps\x@
+ \c@@cntc\PathLength
+ \@X.5\@halfwidth \divide\c@@cntc\@X
+ \ifnum \c@@cntc>\qbeziermax%
+ \PackageInfo{ebezier}{\the\c@@cntc\space points needed exceeding %
+ qbeziermax=\qbeziermax!}\fi
+ \fi
+ \ifnum \c@@cntc>\qbeziermax
+ \c@@cntc\qbeziermax\relax
+ \PackageWarning{ebezier}{Counter reset to qbeziermax=\qbeziermax!}\fi
+ \c@@cnta\c@@cntc\relax\advance\c@@cnta\@ne
+ \@Xa #4\unitlength \advance\@Xa-#2\unitlength \divide\@Xa\c@@cntc
+ \@Ya #5\unitlength \advance\@Ya-#3\unitlength \divide\@Ya\c@@cntc
+ \c@@cntb\z@\relax
+ \set@width
+ \put(#2,#3){\@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb \@Xa\@Y \c@@cntb\@Ya
+ \raise\@Y\hbox to\z@{\hskip\@X\unhcopy\@pt\hss}%
+ \advance\c@@cntb\@ne}}}
+%%
+% \end{macrocode}
+%
+% \verb+\Lbezier+ changes the line thickness. It is stored in \verb+\@Xb+.
+%
+% \begin{macrocode}
+\def\Lbezier{\@ifnextchar [{\@Lbezier}{\@Lbezier[0]}}
+\def\@Lbezier[#1](#2,#3)(#4,#5){\c@@cntc#1\relax
+ \@Xb\@wholewidth
+ \@X #4\unitlength \advance\@X-#2\unitlength \AbsLen{\@X}%
+ \@Y #5\unitlength \advance\@Y-#3\unitlength \AbsLen{\@Y}%
+ \LenNorm{\@X}{\@Y}{\@Xc}\LenMult{\@Xc}{\@wholewidth}{\@Yb}%
+ \LenDiv{\@Yb}{\@X+\@Y}{\@wholewidth}\@halfwidth .5\@wholewidth
+ \ifnum \c@@cntc<\@ne
+ \multiply\eps\x@
+ \Length(#2,#3)(#4,#5){\PathLength}%
+ \divide\eps\x@
+ \c@@cntc\PathLength
+ \@X.5\@halfwidth \divide\c@@cntc\@X
+ \ifnum \c@@cntc>\qbeziermax%
+ \PackageInfo{ebezier}{\the\c@@cntc\space points needed exceeding %
+ qbeziermax=\qbeziermax!}\fi
+ \fi
+ \ifnum \c@@cntc>\qbeziermax
+ \c@@cntc\qbeziermax\relax
+ \PackageWarning{ebezier}{Counter reset to qbeziermax=\qbeziermax!}\fi
+ \c@@cnta\c@@cntc\relax \advance\c@@cnta\@ne
+ \@Xa #4\unitlength \advance\@Xa-#2\unitlength \divide\@Xa\c@@cntc
+ \@Ya #5\unitlength \advance\@Ya-#3\unitlength \divide\@Ya\c@@cntc
+ \c@@cntb\z@\relax
+ \set@width
+ \put(#2,#3){\@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb \@Xa\@Y \c@@cntb\@Ya
+ \raise\@Y\hbox to\z@{\hskip\@X\unhcopy\@pt\hss}%
+ \advance\c@@cntb\@ne}}
+ \@wholewidth\@Xb \@halfwidth .5\@Xb}
+%%
+% \end{macrocode}
+%
+% The two joining macros need two internal steps to process an implicit list.
+%
+% \begin{macrocode}
+\def\ljoin{\@ifnextchar [{\@ljoin}{\@ljoin[0]}}
+\def\@ljoin[#1](#2,#3){\@ifnextchar ({\l@join[#1](#2,#3)}{\relax}}
+\def\l@join[#1](#2,#3)(#4,#5){%
+ \lbezier[#1](#2,#3)(#4,#5)%
+ \ljoin[#1](#4,#5)}
+%%
+\def\Ljoin{\@ifnextchar [{\@Ljoin}{\@Ljoin[0]}}
+\def\@Ljoin[#1](#2,#3){\@ifnextchar ({\L@join[#1](#2,#3)}{\relax}}
+\def\L@join[#1](#2,#3)(#4,#5){%
+ \Lbezier[#1](#2,#3)(#4,#5)%
+ \Ljoin[#1](#4,#5)}
+%%
+% \end{macrocode}
+%
+% \verb+\Qbezier+ is defined, because \verb+\qbezier+ uses an other plot box.
+% The original macro is a little bit more complicated to handle extra spaces
+% but I hope this will suffice.
+%
+% \begin{macrocode}
+\def\Qbezier{\@ifnextchar [{\@Qbezier}{\@Qbezier[0]}}
+\def\@Qbezier[#1](#2,#3)(#4,#5)(#6,#7){\c@@cntc#1\relax
+ \ifnum \c@@cntc<\@ne
+ \multiply\eps\x@
+ \PathLengthQ[5](#2,#3)(#4,#5)(#6,#7)%
+ \divide\eps\x@
+ \c@@cntc\PathLength
+ \@X.5\@halfwidth \divide\c@@cntc\@X
+ \ifnum \c@@cntc>\qbeziermax%
+ \PackageInfo{ebezier}{\the\c@@cntc\space points needed exceeding %
+ qbeziermax=\qbeziermax!}\fi
+ \fi
+ \ifnum \c@@cntc>\qbeziermax
+ \c@@cntc\qbeziermax\relax
+ \PackageWarning{ebezier}{Counter reset to qbeziermax=\qbeziermax!}\fi
+ \c@@cnta\c@@cntc\relax \advance\c@@cnta\@ne
+ \@Xa #4\unitlength \advance\@Xa-#2\unitlength \multiply\@Xa\tw@
+ \@Xb #6\unitlength \advance\@Xb-#2\unitlength
+ \advance\@Xb-\@Xa \divide\@Xb\c@@cntc
+ \@Ya #5\unitlength \advance\@Ya-#3\unitlength \multiply\@Ya\tw@
+ \@Yb #7\unitlength \advance\@Yb-#3\unitlength
+ \advance\@Yb-\@Ya \divide\@Yb\c@@cntc
+ \c@@cntb\z@\relax
+ \set@width
+ \put(#2,#3){\@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb \@Xb\@Y \c@@cntb\@Yb
+ \advance\@X\@Xa \advance\@Y\@Ya
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \raise \@Y \hb@xt@\z@{\kern\@X\unhcopy\@pt\hss}%
+ \advance\c@@cntb\@ne}}}
+%%
+% \end{macrocode}
+%
+% \verb+\cbezier+ is the most complex command. All calculations have to be
+% done in the correct order to minimize overflow conditions.
+%
+% \begin{macrocode}
+\def\cbezier{\@ifnextchar [{\@cbezier}{\@cbezier[0]}}
+\def\@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
+ \c@@cntc#1\relax
+ \ifnum \c@@cntc<\@ne
+ \multiply\eps\x@
+ \PathLengthC[5](#2,#3)(#4,#5)(#6,#7)(#8,#9)%
+ \divide\eps\x@
+ \c@@cntc\PathLength
+ \@X = 0.5\@halfwidth
+ \divide\c@@cntc\@X
+ \ifnum \c@@cntc>\qbeziermax%
+ \PackageInfo{ebezier}{\the\c@@cntc\space points needed exceeding %
+ qbeziermax=\qbeziermax!}\fi
+ \fi
+ \ifnum \c@@cntc>\qbeziermax
+ \c@@cntc\qbeziermax\relax
+ \PackageWarning{ebezier}{Counter reset to qbeziermax=\qbeziermax!}\fi
+ \c@@cnta\c@@cntc\relax \advance\c@@cnta\@ne
+ \@Xa #4\unitlength \advance\@Xa-#2\unitlength \multiply\@Xa\thr@@
+ \@Xb #6\unitlength \advance\@Xb-#2\unitlength \multiply\@Xb\thr@@
+ \advance\@Xb -2\@Xa
+ \@Xc #8\unitlength \advance\@Xc-#2\unitlength
+ \advance\@Xc-\@Xa \advance\@Xc-\@Xb
+ \@Ya #5\unitlength \advance\@Ya-#3\unitlength \multiply\@Ya\thr@@
+ \@Yb #7\unitlength \advance\@Yb-#3\unitlength \multiply\@Yb\thr@@
+ \advance\@Yb-2\@Ya
+ \@Yc #9\unitlength \advance\@Yc-#3\unitlength
+ \advance\@Yc-\@Ya \advance\@Yc-\@Yb
+ \divide\@Xc\c@@cntc \divide\@Yc\c@@cntc
+ \c@@cntb\z@\relax
+ \set@width
+ \put(#2,#3){\@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb \@Xc\@Y \c@@cntb\@Yc
+ \advance\@X\@Xb \advance\@Y\@Yb
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \advance\@X\@Xa \advance\@Y\@Ya
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \raise \@Y \hbox to \z@{\hskip \@X\unhcopy\@pt\hss}%
+ \advance\c@@cntb\@ne}}}
+%%
+% \end{macrocode}
+%
+% \verb+\Cbezier+ changes the plot symbol so a restore is needed. But it will
+% not keep the original one!
+%
+% \begin{macrocode}
+\def\Cbezier{\@ifnextchar [{\@Cbezier}{\@Cbezier[0]}}
+\def\@Cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
+ \cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9)%
+ \c@@cntc#1\relax\divide\c@@cntc\thr@@
+ \lbezier[\c@@cntc](#2,#3)(#4,#5)%
+ \lbezier[\c@@cntc](#4,#5)(#6,#7)%
+ \lbezier[\c@@cntc](#6,#7)(#8,#9)%
+ \DefPlotSymbol{$\bullet$}
+ \lbezier[1](#2,#3)(#2,#3)
+ \lbezier[1](#4,#5)(#4,#5)
+ \lbezier[1](#6,#7)(#6,#7)
+ \lbezier[1](#8,#9)(#8,#9)
+ \DefStandardPlotSymbol
+ \thinlines}
+%%
+% \end{macrocode}
+%
+% \verb+\l@put+ is like \verb+\put+ but its arguments are lengths and not
+% decimal constants. It will be used in \verb+\l@cbezier+ which also has
+% lengths as arguments. All complex plotting commands use this form.
+% Just for the calculation of plotting points four more lengths are needed.
+% I use the ``scratch'' dimens from \TeX.
+%
+% \begin{macrocode}
+\long\gdef\l@put(#1,#2)#3{%
+ \@killglue\raise#2\hb@xt@\z@{\kern#1#3\hss}\ignorespaces}
+%%
+\long\gdef\l@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
+ \c@@cntc#1\relax
+ \dimen1#2\dimen3#3
+%%
+ \@Xa #4 \advance\@Xa-#2 \multiply\@Xa\thr@@
+ \@Xb #6 \advance\@Xb-#2 \multiply\@Xb\thr@@
+ \advance\@Xb-2\@Xa
+ \@Xc #8 \advance\@Xc-#2
+ \advance\@Xc-\@Xa \advance\@Xc-\@Xb
+ \@Ya #5 \advance\@Ya-#3 \multiply\@Ya\thr@@
+ \@Yb #7 \advance\@Yb-#3 \multiply\@Yb\thr@@
+ \advance\@Yb-2\@Ya
+ \@Yc #9 \advance\@Yc-#3
+ \advance\@Yc-\@Ya \advance\@Yc-\@Yb
+%%
+%% assume half arc
+%%
+ \ifnum \c@@cntc <\@ne
+ \multiply\eps\x@
+ \dimen5#2 \advance\dimen5-#8 \AbsLen{\dimen5}%
+ \dimen7#3 \advance\dimen7-#9 \AbsLen{\dimen7}%
+ \LenNorm{\dimen5}{\dimen7}{\PathLength}%
+ \divide\eps\x@
+ \c@@cntc\PathLength
+ \dimen5.5\@halfwidth
+ \divide\c@@cntc\dimen5
+%%
+%% 11/7 \approx \pi/2
+%%
+ \divide\c@@cntc 7 \multiply\c@@cntc 11
+ \ifnum \c@@cntc>\qbeziermax
+ \PackageInfo{ebezier}{\the\c@@cntc\space points needed exceeding %
+ qbeziermax=\qbeziermax!}\fi
+ \fi
+ \ifnum\c@@cntc>\qbeziermax
+ \c@@cntc\qbeziermax\relax
+ \PackageWarning{ebezier}{Counter reset to qbeziermax=\qbeziermax!}\fi
+ \c@@cnta\c@@cntc\relax\advance\c@@cnta\@ne%
+ \divide\@Xc\c@@cntc \divide\@Yc\c@@cntc
+ \c@@cntb\z@\relax
+ \set@width
+ \l@put(\dimen1,\dimen3){\@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb \@Xc\@Y \c@@cntb\@Yc
+ \advance\@X\@Xb \advance\@Y\@Yb
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \advance\@X\@Xa \advance\@Y\@Ya
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \raise\@Y\hbox to\z@{\hskip\@X\unhcopy\@pt\hss}%
+ \advance\c@@cntb\@ne}}}
+%%
+% \end{macrocode}
+%
+% The building blocks for the circles are the four quarters. Each is defined
+% separately and will be combined by the \verb+\cCircle+ macro.
+%
+% \begin{macrocode}
+\def\@circle@rt[#1](#2,#3)#4{%
+ \set@magic
+ \@Z #4\magicnum\@Za #2\unitlength\@Zb #3\unitlength
+ \@Zc #2\unitlength \advance\@Zc\@Z
+ \@Zd #3\unitlength \advance\@Zd\@Z
+ \@Ze #4\unitlength \advance\@Ze\@Za
+ \@Zf #4\unitlength \advance\@Zf\@Zb
+ \l@cbezier[#1](\@Ze,\@Zb)(\@Ze,\@Zd)(\@Zc,\@Zf)(\@Za,\@Zf)}
+%%
+\def\@circle@lt[#1](#2,#3)#4{%
+ \set@magic
+ \@Z #4\magicnum\@Za #2\unitlength\@Zb #3\unitlength
+ \@Zc #2\unitlength \advance\@Zc-\@Z
+ \@Zd #3\unitlength \advance\@Zd\@Z
+ \@Ze -#4\unitlength \advance\@Ze\@Za
+ \@Zf #4\unitlength \advance\@Zf\@Zb
+ \l@cbezier[#1](\@Za,\@Zf)(\@Zc,\@Zf)(\@Ze,\@Zd)(\@Ze,\@Zb)}
+%%
+\def\@circle@rb[#1](#2,#3)#4{%
+ \set@magic
+ \@Z #4\magicnum\@Za #2\unitlength\@Zb #3\unitlength
+ \@Zc #2\unitlength \advance\@Zc\@Z
+ \@Zd #3\unitlength \advance\@Zd-\@Z
+ \@Ze #4\unitlength \advance\@Ze\@Za
+ \@Zf -#4\unitlength \advance\@Zf\@Zb
+ \l@cbezier[#1](\@Za,\@Zf)(\@Zc,\@Zf)(\@Ze,\@Zd)(\@Ze,\@Zb)}
+%%
+\def\@circle@lb[#1](#2,#3)#4{%
+ \set@magic
+ \@Z #4\magicnum\@Za #2\unitlength\@Zb #3\unitlength
+ \@Zc #2\unitlength \advance\@Zc-\@Z
+ \@Zd #3\unitlength \advance\@Zd-\@Z
+ \@Ze -#4\unitlength \advance\@Ze\@Za
+ \@Zf -#4\unitlength \advance\@Zf\@Zb
+ \l@cbezier[#1](\@Ze,\@Zb)(\@Ze,\@Zd)(\@Zc,\@Zf)(\@Za,\@Zf)}
+%%
+% \end{macrocode}
+%
+% I use the logicals from the \verb+\oval+ defined in \LaTeX. So I need just
+% one more logical \verb+\if@ovf+.
+%
+% \begin{macrocode}
+\newif\if@ovf
+\def\cCircle{\@ifnextchar [{\@cCircle}{\@cCircle[0]}}
+\def\@cCircle[#1](#2,#3)#4[#5]{%
+ \@ovtfalse\@ovbfalse\@ovlfalse\@ovrfalse\@ovffalse
+ \c@@cnta#1\relax
+ \@tfor\reserved@a:=#5\do{\csname @ov\reserved@a true\endcsname}%
+ \if@ovf\@ovttrue \divide\c@@cnta\tw@\fi
+ \if@ovt
+ \if@ovr
+ \@circle@rt[\c@@cnta](#2,#3){#4}
+ \else\if@ovl
+ \@circle@lt[\c@@cnta](#2,#3){#4}
+ \else\divide\c@@cnta\tw@
+ \@circle@rt[\c@@cnta](#2,#3){#4}
+ \@circle@lt[\c@@cnta](#2,#3){#4}
+ \fi\fi
+ \if@ovf
+ \@circle@rb[\c@@cnta](#2,#3){#4}
+ \@circle@lb[\c@@cnta](#2,#3){#4}
+ \fi
+ \else\if@ovb
+ \if@ovr
+ \@circle@rb[\c@@cnta](#2,#3){#4}
+ \else\if@ovl
+ \@circle@lb[\c@@cnta](#2,#3){#4}
+ \else\divide\c@@cnta\tw@
+ \@circle@rb[\c@@cnta](#2,#3){#4}
+ \@circle@lb[\c@@cnta](#2,#3){#4}
+ \fi\fi
+ \else
+ \divide\c@@cnta\tw@
+ \if@ovr
+ \@circle@rb[\c@@cnta](#2,#3){#4}
+ \@circle@rt[\c@@cnta](#2,#3){#4}
+ \else
+ \if@ovl
+ \@circle@lb[\c@@cnta](#2,#3){#4}
+ \@circle@lt[\c@@cnta](#2,#3){#4}
+ \else
+ \PackageError{Ebezier}{Missing or illegal position specifier in cCircle}
+ \fi\fi\fi\fi}
+%%
+\def\cArc{\@ifnextchar [{\@cArc}{\@cArc[0]}}
+\def\@cArc[#1](#2,#3)(#4,#5){%
+ \c@@cntc#1\relax
+ \@X #2\unitlength \@Y #3\unitlength
+ \@Za #4\unitlength \@Zb #5\unitlength
+ \@Zc 2\@X \advance\@Zc-\@Za \@Zd 2\@Y \advance\@Zd-\@Zb
+ \@Xa\@Y \advance\@Xa-\@Zb \@Ya\@Za \advance\@Ya-\@X
+ \multiply\@Xa 4 \divide\@Xa\thr@@ \multiply\@Ya 4 \divide\@Ya\thr@@
+ \@Ze\@Za \advance\@Ze\@Xa \@Zf\@Zb \advance\@Zf\@Ya
+ \@Zg\@Zc \advance\@Zg\@Xa \@Zh\@Zd \advance\@Zh\@Ya
+ \l@cbezier[#1](\@Za,\@Zb)(\@Ze,\@Zf)(\@Zg,\@Zh)(\@Zc,\@Zd)}
+%%
+% \end{macrocode}
+%
+% Historically from this point starts the calculation part. The notation
+% will be more \LaTeX\ convenient.
+%
+% All square roots are calculated by the same iteration. To keep numbers
+% small enough some scaling has to be done (factor \verb+\c@@cntd+).
+%
+% \begin{macrocode}
+\def\LenMult#1#2#3{\setlength{#3}{#1*\ratio{#2}{\unitlength}}}
+%%
+\def\LenDiv#1#2#3{\setlength{#3}{\unitlength*\ratio{#1}{#2}}}
+%%
+\def\AbsLen#1{\ifdim#1<\z@\setlength{#1}{-#1}\fi}
+%%
+\def\LenSqrt#1#2{%
+ \setlength{\@Za}{#1}%
+ \ifdim\@Za>\eps\loop\setlength{\@Zb}{(\@Za+\unitlength*\ratio{#1}{\@Za})/2}%
+ \setlength{\@Zc}{\@Za-\@Zb}\AbsLen{\@Zc}%
+ \ifdim\@Zc>\eps\setlength{\@Za}{\@Zb}\repeat\fi%
+ \setlength{#2}{\@Za}}
+%%
+\def\Length(#1,#2)(#3,#4)#5{%
+ \setlength{\@Zd}{#3\unitlength-#1\unitlength}%
+ \setlength{\@Ze}{#4\unitlength-#2\unitlength}%
+ \setcounter{@cntd}{1}%
+ \setlength{\@Zf}{\@Zd}\ifdim\@Ze>\@Zd\setlength{\@Zf}{\@Ze}\fi
+ \loop\setlength{\@Zd}{\@Zd/2}\setlength{\@Ze}{\@Ze/2}\setlength{\@Zf}{\@Zf/2}%
+ \multiply\c@@cntd\tw@\ifdim\@Zf>\x@ pt\repeat
+ \LenMult{\@Zd}{\@Zd}{\@Zg}\LenMult{\@Ze}{\@Ze}{\@Zh}\setlength{\@Zf}{\@Zg+\@Zh}%
+ \LenSqrt{\@Zf}{\@Zg}\setlength{#5}{\@Zg*\value{@cntd}}}
+%%
+\def\LenNorm#1#2#3{%
+ \setlength{\@Zd}{#1}\setlength{\@Ze}{#2}\setcounter{@cntd}{1}%
+ \setlength{\@Zf}{\@Zd}\ifdim\@Ze>\@Zd\setlength{\@Zf}{\@Ze}\fi
+ \loop\setlength{\@Zd}{\@Zd/2}\setlength{\@Ze}{\@Ze/2}\setlength{\@Zf}{\@Zf/2}%
+ \multiply\c@@cntd\tw@\ifdim\@Zf>\x@ pt\repeat
+ \LenMult{\@Zd}{\@Zd}{\@Zg}\LenMult{\@Ze}{\@Ze}{\@Zh}\setlength{\@Zf}{\@Zg+\@Zh}%
+ \LenSqrt{\@Zf}{\@Zg}\setlength{#3}{\@Zg*\value{@cntd}}}
+%%
+\def\PathLengthQ[#1](#2,#3)(#4,#5)(#6,#7){%
+ \PathLength\z@\c@@cntc#1\relax
+ \ifnum \c@@cntc<\@ne \c@@cntc\pathmax\relax\fi
+ \ifnum \c@@cntc>\pathmax \c@@cntc\pathmax\relax
+ \PackageWarning{ebezier}{Counter reset to pathmax=\pathmax!}\fi
+ \@Za\z@ \@Zb\z@ \c@@cntb\c@@cntc\relax \advance\c@@cntb\@ne
+ \@Xb #4\unitlength \advance\@Xb-#2\unitlength \multiply\@Xb\tw@
+ \@Yb #5\unitlength \advance\@Yb-#3\unitlength \multiply\@Yb\tw@
+ \@Xa #6\unitlength \advance\@Xa-#2\unitlength
+ \advance\@Xa-\@Xb \divide\@Xa\c@@cntc
+ \@Ya #7\unitlength \advance\@Ya-#3\unitlength
+ \advance\@Ya-\@Yb \divide\@Ya\c@@cntc \c@@cnta\@ne\relax
+ \@whilenum{\c@@cnta<\c@@cntb}\do
+ {\@X\c@@cnta\@Xa \advance\@X\@Xb \divide\@X\c@@cntc \multiply\@X\c@@cnta
+ \@Y\c@@cnta\@Ya \advance\@Y\@Yb \divide\@Y\c@@cntc \multiply\@Y\c@@cnta
+ \@Zi\@X\@Zj\@Y
+ \advance\@X-\@Za \advance\@Y-\@Zb \LenNorm{\@X}{\@Y}{\@Z}%
+ \advance\PathLength\@Z
+ \@Za\@Zi\@Zb\@Zj \advance\c@@cnta\@ne}}
+%%
+\def\PathLengthC[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
+ \PathLength\z@ \c@@cntc#1\relax
+ \ifnum \c@@cntc<\@ne \c@@cntc\pathmax\relax\fi
+ \ifnum \c@@cntc>\pathmax \c@@cntc\pathmax\relax
+ \PackageWarning{ebezier}{Counter reset to pathmax=\pathmax!}\fi
+ \@Za\z@ \@Zb\z@ \c@@cnta\c@@cntc\relax \advance\c@@cnta\@ne
+ \@Xa #4\unitlength \advance\@Xa-#2\unitlength \multiply\@Xa\thr@@
+ \@Xb #6\unitlength \advance\@Xb-#2\unitlength \multiply\@Xb\thr@@
+ \advance\@Xb-2\@Xa
+ \@Xc #8\unitlength \advance\@Xc-#2\unitlength
+ \advance\@Xc-\@Xa \advance\@Xc-\@Xb
+ \@Ya #5\unitlength \advance\@Ya-#3\unitlength \multiply\@Ya\thr@@
+ \@Yb #7\unitlength \advance\@Yb-#3\unitlength \multiply\@Yb\thr@@
+ \advance\@Yb-2\@Ya
+ \@Yc #9\unitlength \advance\@Yc-#3\unitlength
+ \advance\@Yc-\@Ya \advance\@Yc-\@Yb
+ \divide\@Xc\c@@cntc \divide\@Yc\c@@cntc
+ \c@@cntb\@ne\relax
+ \@whilenum{\c@@cntb<\c@@cnta}\do
+ {\@X\c@@cntb\@Xc \@Y\c@@cntb\@Yc \advance\@X\@Xb \advance\@Y\@Yb
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \advance\@X\@Xa \advance\@Y\@Ya
+ \divide\@X\c@@cntc \divide\@Y\c@@cntc
+ \multiply\@X\c@@cntb \multiply\@Y\c@@cntb
+ \@Zi\@X\@Zj\@Y
+ \advance\@X-\@Za \advance\@Y-\@Zb \LenNorm{\@X}{\@Y}{\@Z}%
+ \advance\PathLength\@Z
+ \@Za\@Zi\@Zb\@Zj\advance\c@@cntb\@ne}}
+%%
+% \end{macrocode}
+%
+% The most complex macro is explained in the text. The exception is
+% handled by the logical \verb+\if@ovf+.
+%
+% \begin{macrocode}
+\def\cArcs{\@ifnextchar [{\@cArcs}{\@cArcs[0]}}
+\def\@cArcs[#1](#2,#3)(#4,#5)(#6,#7){%
+ \c@@cntc#1\relax
+ \@ovffalse
+ \@X#2\unitlength\@Y#3\unitlength
+ \@Zi#6\unitlength\@Zj#7\unitlength
+ \setlength{\@Xa}{\@X-\@Zi}\setlength{\@Ya}{\@Y-\@Zj}%
+ \LenNorm{\@Xa}{\@Ya}{\@Xb}%
+ \@Xa#4\unitlength \advance\@Xa\@Zi \advance\@Xa-2\@X
+ \@Ya#5\unitlength \advance\@Ya\@Zj \advance\@Ya-2\@Y
+ \@Xc\@Xa\AbsLen{\@Xc}\@Yc\@Ya\AbsLen{\@Yc}%
+ \ifdim\@Xc<\eps\ifdim\@Yc<\eps\@ovftrue\fi\fi
+ \if@ovf
+ \cArc[#1](#2,#3)(#4,#5)%
+ \else
+ \LenNorm{\@Xa}{\@Ya}{\@Yb}%
+ \setlength{\@Xc}{\unitlength*\ratio{\@Xb}{\@Yb}}%
+ \setlength{\@Yc}{(-\unitlength+\@Xc*2)*4/3}%
+ \@Xb-#5\unitlength \advance\@Xb\@Zj
+ \@Z\@Xb\AbsLen{\@Z}%
+ \ifdim\@Z<100\eps \@Xb#4\unitlength \advance\@Xb-\@Zi \@Xa\@Ya\fi
+ \setlength{\@Z}{\@Yc*\ratio{\@Xa}{\@Xb}}%
+ \@Xa#4\unitlength\@Ya#5\unitlength
+ \setlength{\@Za}{\@Y-\@Ya}\setlength{\@Zb}{\@Xa-\@X}%
+ \setlength{\@Zc}{\@Zj-\@Y}\setlength{\@Zd}{\@X-\@Zi}%
+ \@Xb\@Xa \LenMult{\@Z}{\@Za}{\@Zh}\advance\@Xb\@Zh
+ \@Yb\@Ya\LenMult{\@Z}{\@Zb}{\@Zh}\advance\@Yb\@Zh
+ \@Xc\@Zi\LenMult{\@Z}{\@Zc}{\@Zh}\advance\@Xc\@Zh
+ \@Yc\@Zj\LenMult{\@Z}{\@Zd}{\@Zh}\advance\@Yc\@Zh
+ \@Z\@Xa\@Za\@Ya\@Zb\@Xb\@Zc\@Yb\@Zd\@Xc\@Ze\@Yc
+ \l@cbezier[#1](\@Z,\@Za)(\@Zb,\@Zc)(\@Zd,\@Ze)(\@Zi,\@Zj)%
+ \fi}
+%</package>
+% \end{macrocode}
+% \Finale \PrintIndex \PrintChanges
+\endinput
diff --git a/Master/texmf-dist/source/latex/ebezier/ebezier.ins b/Master/texmf-dist/source/latex/ebezier/ebezier.ins
new file mode 100644
index 00000000000..adcb4ae5b0c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ebezier/ebezier.ins
@@ -0,0 +1,32 @@
+%% LaTeX2e file `ebezier.ins'
+%% from source `ebezier' on 2005/03/01.
+%%
+%% Gerhard A. Bachmaier
+%% Institute for Medical Informatics, Statistics, and Documentation
+%% Medical University of Graz
+%% send bugs to: gerhard.bachmaier@meduni-graz.at
+%
+\def\batchfile{ebezier.ins}
+\input docstrip.tex
+\keepsilent
+\Msg{*** Generating the LaTeX2e package files ***}
+\generate{\file{ebezier.sty}{\from{ebezier.dtx}{package}}}
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file(s) into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space ebezier.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Process any name.idx file by:}
+\Msg{* \space\space\space\space makeindex -s gind.ist ebezier}
+\Msg{*}
+\Msg{* Then rerun LaTeX twice}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/ellipsis/ellipsis.dtx b/Master/texmf-dist/source/latex/ellipsis/ellipsis.dtx
new file mode 100644
index 00000000000..4db66a1410b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ellipsis/ellipsis.dtx
@@ -0,0 +1,423 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2003 by Peter J. Heslin <p.j.heslin@dur.ac.uk>
+% --------------------------------------------------
+%
+% This file 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.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{ellipsis}
+%<package> [2004/9/28 v1.6 ellipsis: fixes spacing around \dots]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{ellipsis}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+ \DocInput{ellipsis.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{135}
+%
+% \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 \~}
+%
+%
+% \changes{v1.0}{2003/09/30}{Initial version}
+% \changes{v1.1}{2003/10/01}{Modelled definition of \cs{textellipsis}
+% on \textsf{xspace.sty}, added chicago option}
+% \changes{v1.2}{2003/10/2}{Added mla option, removed hard-coded list
+% of punctuation in favor or a configurable list}
+% \changes{v1.3}{2003/10/3}{Removed \@ to make \cs{ellipsisspacing}
+% and \cs{ellipsispunctuation} user configurable. Changed
+% \cs{ellipsisspacing} from a length to a command to make em pick up
+% the font size when it is used, rather than when it is defined}
+% \changes{v1.4}{2003/10/4}{Changed \cs{ellipsisspacing} to
+% \cs{ellipsisgap} for readability, added \cs{relax} to prevent spaces
+% from being gobbled.}
+% \changes{v1.5}{2004/9/24}{Added the xspace option.}
+% \changes{v1.6}{2004/9/28}{Fixed incompatibility with French Babel.}
+%
+% \GetFileInfo{ellipsis.sty}
+%
+% \title{The \textsf{ellipsis} package\thanks{This document
+% corresponds to \textsf{ellipsis}~\fileversion, dated \filedate.
+% Many thanks to Frank Mittelbach, who made numerous suggestions
+% that greatly improved this package.}}
+% \author{Peter J. Heslin \\ \texttt{p.j.heslin@dur.ac.uk}}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% There is an unevenness in the way \LaTeX\ puts space around ellipses
+% (|\dots|) in text mode. It is a small problem, but it is a serious
+% matter for those who care about such things. This package attempts
+% to fix that bug, and this documentation offers an explanation of the
+% bug and offers advice on how to use ellipses in your text. This
+% document should not be taken as offering guidance on the use of
+% ellipses in mathematical formulas or non-English language text.
+%
+% The standard definition of |\dots| in \LaTeX\ takes the inter-word
+% stretch for the current font and puts that amount of space in
+% between three normal dots; it then also adds that amount of space
+% \emph{after} the final dot. The documentation of the \LaTeX\ code
+% acknowledges that this is a `kludge' in that the interword stretch
+% is being used for a purpose it was not meant for. There is another
+% problem with this definition, however: the extra space after the
+% final dot of the ellipsis. Thus there is always more space after
+% the ellipsis than before it, so that it is not properly centered
+% between the text on either side.
+%
+% That extra space is there for a good reason. When the ellipsis is
+% followed by another dot, as at the end of a sentence, it is
+% important that all four dots should be evenly spaced, otherwise the
+% final dot is much closer than the others and the result is hideous.
+% The same holds true for commas, exclamation marks and other
+% punctuation on the baseline. So the extra space is necessary when
+% an ellipsis is followed by certain punctuation characters, and the
+% bug consists in the fact that \LaTeX\ always adds it, regardless of
+% what text follows.
+%
+% This package implements a simple fix. It redefines the |\dots| and
+% |\textellipsis| commands so that they can look ahead at the next
+% character and change their behavior accordingly: if the next
+% character is one of .,;:?! the extra space is added, if not, no
+% extra space is added (if you load a package that makes any of these
+% characters active, you may want to reload this list; see the section
+% below on see below on |\ellipsispunctuation| and compatibility).
+% This particular list of punctuation marks was not chosen
+% arbitrarily: it includes all marks with a dot on the baseline (or a
+% comma, which is like a dot with a tail). These marks produce a
+% series of four dots which must be spaced evenly~-- no other
+% punctuation mark would normally benefit from having the extra space
+% added.
+%
+% The solution can be brittle~-- for example, if you write |\dots{}.|
+% then the extra space will \emph{not} be added, since the braces come
+% between the command and the dot; the result will be very ugly. The
+% solution to this is to enter ellipses carefully and consistently in
+% your source text. If you use ellipses as recommended below, then
+% the potential problem of evenly spacing an ellipsis that comes
+% immediately after a baseline punctuation mark does not arise, since
+% that combination of characters will not normally be used.
+%
+% There is another package, \textsf{lips.sty}, that addresses the
+% problem of text ellipses in \LaTeX. It strictly follows the advice
+% of the \emph{Chicago Manual of Style} in putting full word spaces
+% between the dots of the ellipsis, and does not provide the
+% possibility of more a tightly set ellipsis like the normal \LaTeX\
+% default. It imposes its own set of rules for the spacing before and
+% after an ellipsis. Many typographers, however, firmly reject the
+% Chicago style of setting ellipses, and rightly so; see Jan
+% Tschichold, \emph{The Form of the Book: Essays on the Morality of
+% Good Design} (Hartley \& Marks, 1991), pp~130f, or Robert
+% Bringhurst, \emph{The Elements of Typographic Style}
+% (2\textsuperscript{nd}~ed, Hartley \& Marks, 1997) pp~82f.
+% \DescribeMacro{chicago} If you nevertheless want or have to use the
+% Chicago-style, widely spaced ellipsis with this package, you can
+% pass it the option |chicago|, like so:
+% |\usepackage[chicago]{ellipsis}|. If, on the other hand, you want
+% to adhere to the full recommendations of the Chicago manual, then
+% you should probably use \textsf{lips.sty} instead of this package.
+% \DescribeMacro{mla} \textsf{Ellipsis.sty} also has an |mla| package
+% option, modeled on the same feature of \textsf{lips.sty}, which
+% automatically puts square brackets around all ellipses.
+%
+% A different solution to the general problem would be to install a
+% font which includes a precomposed ellipsis glyph, and to redefine
+% |\dots| simply to insert this character. In that case, you do not
+% need this package at all, but you should make sure that the ellipsis
+% character kerns properly, especially with following .,:;!?
+%
+% \section{Usage}
+%
+% Install the package and put |\usepackage{ellipsis}| in your
+% preamble. As noted above, you should be consistent in the way you
+% enter ellipses in your text. For English text, Bringhurst (loc.\
+% cit.) recommends putting a space before and after an ellipsis that
+% appears between two words, but no space before an ellipsis that
+% appears before a punctuation mark such as a period, comma, etc.
+% Then there is the question of breaking or non-breaking space. I
+% think it is odd to find an ellipsis at the beginning of a line, so
+% normally I would enter text like this: |uh~\dots\ oh|. If setting
+% text in narrow columns you may prefer to allow line breaks before
+% the ellipsis as well as after. Before punctuation, you would enter
+% ellipses without a space before or after, like so:
+% |one, two, three\dots, ten\dots.| Note, however, that some
+% publishers do not like to see an ellipsis combined with a period or
+% comma, and would rather a simple ellipsis at the end of a sentence
+% and so forth.
+%
+% One problem with using the |\dots| command is that it does not take
+% an argument. So there is no brace to terminate it, and if you want
+% a space to follow the ellipsis, you need to take care that it does
+% not disappear, and so to write it like this:
+% |\dots\|\textvisiblespace\ or |{\dots}|\textvisiblespace\ or
+% |\dots{}|\textvisiblespace. If you forget to do this, the space
+% will disappear, gobbled up by the macro. I frequently find myself
+% making this mistake, so I have added another option to help with
+% it. \DescribeMacro{xspace} If you pass the option |xspace| to
+% \textsf{ellipsis.sty}, an |\xspace| macro will be added after every
+% |\dots| macro. See the \emph{\LaTeX\ Companion} for full
+% information on that package, but in short, it adds a space except
+% when followed by certain punctuation characters (a superset of the
+% |\ellipsispunctuation| list mentioned above). So you automatically
+% get space after the ellipsis, unless it is immediately followed by
+% punctuation, even if you write it like this:
+% |one~\dots|\textvisiblespace|two|. If there are a few places where
+% you don't want a space after |\dots|, then write it like this:
+% |\dots{}|, and the space will be suppressed.
+%
+% \DescribeMacro{\ellipsisgap}
+% You may wish to redefine the command |\ellipsisgap|, which is the
+% space between the dots of the ellipsis. If you do this, you must do
+% it in your preamble, \emph{after} the |\usepackage| line. The
+% default value is the interword stretch of the current font, which is
+% the normal \LaTeX\ definition. If you are using a font other than
+% Computer Modern and if you are obsessive, you might wish to examine
+% the ellipsis that the font designer included in your font and
+% recreate it by defining the |\ellipsisgap| to an appropriate value,
+% like so:
+% \begin{verbatim}
+% \usepackage{ellipsis}
+% This value seems right for the native ellipsis in Adobe Caslon:
+% \renewcommand{\ellipsisgap}{0.1em}
+% \end{verbatim}
+% You should probably define this in font-size dependent units, such
+% as the em. See Bringhurst (loc.\ cit.) for further thoughts on the
+% construction of ellipses.
+%
+% \section{Compatibility}
+%
+% It was mentioned above that if certain punctuation characters are
+% made active, it will interfere with the ability of this package to
+% recognize them. One important example of that practice is in the
+% French option of Babel, which makes certain `double punctuation'
+% characters active, in order to put a bit of space before them. In
+% this particular case, however, you do \emph{not} want to redefine
+% the |\ellipsispunctuation| list to make this package aware of these
+% characters. If you were to do so, extra kerning would be added
+% after an ellipsis in addition to thin space before the following
+% punctuation, resulting in about twice as much space as needed. If
+% you leave the default value of |\ellipsispunctuation|, then these
+% active characters will not be recognized, and no extra kern will be
+% added. Instead, the ellipsis will be separated from any following
+% double punctuation by a thin space. This may not be quite the same
+% as the space between dots of the ellipsis, but it may be close
+% enough that no one will notice the difference. In any case, that's
+% what French Babel does.
+%
+% Whether Babel is here following some sophisticated French
+% typographical rule, or it's just a fudge, I don't know. Because
+% Babel French removes the extra space from after |\dots|, but only
+% adds space before `double punctuation', there is no space between an
+% ellipsis and `single punctuation', which looks ugly to my
+% (non-French) eyes. In these cases, using |ellipsis.sty| will add
+% the extra space whereas French Babel on its own does not. This may
+% be the wrong thing to do; if you are typesetting a text in French,
+% you should familiarize yourself with the relevant norms, and
+% possibly refrain from using this package. I have not familiarized
+% myself with the rules for typesetting ellipses in languages other
+% than English. If you are loading the French option of Babel because
+% you are quoting French text in a document whose main language is not
+% French, then you should not worry about these issues. Because
+% French Babel wants to redefine |\dots|, you must load |ellipsis.sty|
+% \emph{after} Babel if you are using the French option (even if you
+% have no French text in your document).
+%
+% The Spanish option of Babel has its own way of setting an
+% ellipsis,but it uses a different command (|\...|), so that doesn't
+% interfere with the working of this package.
+%
+% \StopEventually{\PrintChanges}
+%
+% \section{Implementation}
+%
+% \begin{macro}{\ellipsisgap}
+% Set the amount of space to put between the dots of the ellipse.
+% Defaults to the standard \LaTeX\ amount.
+% \begin{macrocode}
+\newcommand{\ellipsisgap}{\fontdimen3\font}
+\DeclareOption{chicago}{\renewcommand{\ellipsisgap}{\fontdimen2\font}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ellipsis@before}
+% \begin{macro}{\ellipsis@after}
+% We provide the hooks \cs{ellipsis@before} and \cs{ellipsis@after} to
+% allow the production of automatically bracketed ellipses.
+%
+% \DescribeMacro{mla}
+% The \textsf{mla} package option sets these so as to produce ellipses
+% like this: [...] If you do this, you never want the extra space
+% after the ellipsis, so we set \cs{ellipsis@alwayscentertrue}
+% \begin{macrocode}
+\newcommand{\ellipsis@before}{}
+\newcommand{\ellipsis@after}{}
+\newif\ifellipsis@alwayscenter
+\ellipsis@alwayscenterfalse
+\DeclareOption{mla}{%
+ \renewcommand{\ellipsis@before}{[\kern\ellipsisgap}%
+ \renewcommand{\ellipsis@after}{\kern\ellipsisgap ]}
+ \ellipsis@alwayscentertrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ellipsis@xspace}
+% Append |\xspace| if the |xspace| option is set.
+% \begin{macrocode}
+\newcommand\ellipsis@xspace{}
+\DeclareOption{xspace}{%
+ \renewcommand{\ellipsis@xspace}{\xspace}}
+\ProcessOptions\relax
+\RequirePackage{xspace}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ellipsis@default}
+% This is the LaTeX default definition, which is necessary to use
+% when punctuation such as .,:;!? follows.
+% \begin{macrocode}
+\newcommand{\ellipsis@default}{%
+ \ellipsis@before
+ .\kern\ellipsisgap
+ .\kern\ellipsisgap
+ .\kern\ellipsisgap
+ \ellipsis@after\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ellipsis@centered}
+% This is our new ellipsis \emph{without} the extra space after it.
+% \begin{macrocode}
+\newcommand{\ellipsis@centered}{%
+ \ellipsis@before
+ .\kern\ellipsisgap
+ .\kern\ellipsisgap
+ .\ellipsis@after\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ellipsispunctuation}
+% Here we define the list of punctuation marks before which we want
+% to put \cs{ellipsis@spacing} space. This may be redefined by the
+% user if desired. If you load a package that changes the
+% \cs{catcode} of a character in this list, such as a language
+% package that makes one of them active, and you want the extra
+% kerning to be added in front of those characters, then you `must
+% then explicitly reset the list. Otherwise the changed character
+% will no longer be recognized.' (quote from \textsf{ltfntcmd.dtx})
+% In such a case, just repeat the line below, substituting
+% \cs{renewcommand} for \cs{newcommand}.
+% \begin{macrocode}
+\newcommand\ellipsispunctuation{,.:;!?}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textellipsis}
+% This is the new definition for an ellipsis which looks ahead: if the
+% next char is in |\ellipsispunctuation| use |\default@ellipsis|, else
+% use our new |\center@ellipsis|.
+%
+% This is the auxiliary code that scans through the list of punctuation.
+%
+% \begin{macrocode}
+\def\ellipsis@scan{\expandafter\ellipsis@scan@aux\ellipsispunctuation\ellipsis@delim}
+\def\ellipsis@scan@aux #1#2\ellipsis@delim{%
+ \let\ellipsis@one=#1% the first char
+ \def\ellipsis@two{#2}% the remainder of the string
+ \ifx\ellipsis@token\ellipsis@one
+ \ellipsis@default
+ \else
+ \ifx\ellipsis@two\empty
+ \ellipsis@centered
+ \else
+ \ellipsis@scan@aux #2\ellipsis@delim
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% Here is the macro that looks ahead at the next token, put it in
+% \cs{ellipsis@token}, and invokes the code to scan for it in the
+% punctuation list.
+%
+% \begin{macrocode}
+\renewcommand{\textellipsis}{\futurelet\ellipsis@token\@textellipsis}
+\def\@textellipsis{%
+ \ifellipsis@alwayscenter\ellipsis@centered\else
+ \ellipsis@scan%
+ \fi\ellipsis@xspace}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dots}
+% Here we redefine the standard \LaTeX\ command to use our new
+% definition. (the |\expandafter| needs to be added to make
+% lookahead work). The only reason this must be done at the
+% beginning of the document is that the French option of Babel
+% unpleasantly redefines |\dots| at the beginning of the document,
+% and so we have to override it again -- and this is true even if
+% you never use any French text in your document. We need to throw
+% an error in the case where French Babel is loaded after us,
+% because its AtBeginDocument hook is about to clobber our
+% definition of |\dots|.
+% \begin{macrocode}
+\ifx\bbl@frenchdots\@undefined\else\def\ellipsis@frenchloaded{\relax}\fi
+\AtBeginDocument{%
+ \ifx\ellipsis@frenchloaded\@undefined
+ \ifx\bbl@frenchdots\@undefined\else
+ \PackageError{ellipsis}{Babel French loaded after ellipsis.sty}%
+ {If you load Babel with the French option, do it before ellipsis.sty}%
+ \fi
+ \fi
+ \DeclareRobustCommand{\dots}{%
+ \ifmmode\mathellipsis\else\expandafter\textellipsis\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\midwordellipsis}
+% An extra command: this may be useful for the rare time when you want
+% an ellipsis in the very middle of a word or whenever you just want a
+% small bit of space (the intra-ellipsis spacing) before and after the
+% ellipsis.
+% \begin{macrocode}
+\DeclareRobustCommand{\midwordellipsis}{%
+ \kern\ellipsisgap
+ .\kern\ellipsisgap
+ .\kern\ellipsisgap
+ .\kern\ellipsisgap\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/ellipsis/ellipsis.ins b/Master/texmf-dist/source/latex/ellipsis/ellipsis.ins
new file mode 100644
index 00000000000..34cc622656b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/ellipsis/ellipsis.ins
@@ -0,0 +1,56 @@
+%%
+%% Copyright (C) 2003 by Peter Heslin <p.j.heslin@dur.ac.uk>
+%%
+%% This file 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.
+%%
+
+\input docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/ellipsis}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2003 by Peter Heslin <p.j.heslin@dur.ac.uk>
+
+This file 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.
+
+\endpreamble
+
+\generate{\file{ellipsis.sty}{\from{ellipsis.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* ellipsis.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file ellipsis.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
+
diff --git a/Master/texmf-dist/source/latex/epigraph/epigraph.dtx b/Master/texmf-dist/source/latex/epigraph/epigraph.dtx
new file mode 100644
index 00000000000..c26c3e4b020
--- /dev/null
+++ b/Master/texmf-dist/source/latex/epigraph/epigraph.dtx
@@ -0,0 +1,813 @@
+% \iffalse meta-comment
+%
+% epigraph.dtx
+%
+% Copyright 1998 Peter R. Wilson
+%
+% This program is provided under the terms of the
+% LaTeX Project Public License distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt.
+%
+% Author: Peter Wilson (CUA) (now at: peter.r.wilson@boeing.com)
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\setcounter{StandardModuleDepth}{1}
+\begin{document}
+ \DocInput{epigraph.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \CheckSum{242}
+%
+% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
+% \DoNotIndex{\@centercr,\@cite}
+% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+% \DoNotIndex{\@input,\@ixpt,\@m}
+% \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
+% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+% \DoNotIndex{\advance,\Alph,\alph}
+% \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+% \DoNotIndex{\bullet}
+% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+% \DoNotIndex{\fbox}
+% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+% \DoNotIndex{\input}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+% \DoNotIndex{\NeedsTeXFormat,\newdimen}
+% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
+% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
+% \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
+% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+% \DoNotIndex{\wd,\xiipt,\year,\z@}
+%
+% \changes{v1.0}{1998/11/15}{First public release}
+% \changes{v1.1}{1998/11/29}{Added epigraphs before chapter headings}
+% \changes{v1.2}{1999/09/12}{Added cleartoevenpage and extended documentation}
+% \changes{v1.2a}{1999/12/01}{Extended documentation for epigraphs on Part pages}
+% \changes{v1.3}{1999/12/01}{Added \cs{dropchapter} and \cs{undodrop} commands}
+% \changes{v1.4}{2000/01/16}{Added flushleftright environment}
+% \changes{v1.5}{2000/02/20}{Generalised \cs{cleartoevenpage} command}
+% \changes{v1.5a}{2002/10/22}{Fixed class with ccaption package}
+%
+% \def\fileversion{v1.5}
+% \def\filedate{2000/02/20}
+% \def\fileversion{v1.5a}
+% \def\filedate{2002/10/22}
+% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
+% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
+% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
+% \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
+% \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
+% \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
+% ^^A fake a rhsepigraph for demo purposes
+% \newcommand{\tepi}[2]{\vspace{.5\baselineskip}\begin{flushright}\small
+% \begin{minipage}{2.5in}
+% \begin{minipage}{2.5in}\begin{flushleft} #1\\
+% \rule[.5ex]{2.5in}{.4pt}
+% \end{flushleft}\end{minipage} \\
+% \begin{minipage}{2.5in}\begin{flushright} #2
+% \end{flushright}\end{minipage}
+% \end{minipage}\end{flushright}\vspace{.5\baselineskip}}
+%
+% \title{The \Lpack{epigraph} package\thanks{This
+% file has version number \fileversion, last revised
+% \filedate.}}
+%
+% \author{%
+% Peter Wilson\\
+% Catholic University of America \\
+% Now at \texttt{peter.r.wilson@boeing.com}
+% }
+% \date{\filedate}
+% \maketitle
+% \begin{abstract}
+% The \Lpack{epigraph} package can be used to typeset a relevant
+% quotation or saying as an \emph{epigraph}, usually just after a
+% sectional heading. Various handles are provided to tweak the appearance.
+% \end{abstract}
+% \tableofcontents
+%
+% \StopEventually{}
+%
+%
+%
+% \section{Introduction}
+%
+% \tepi{My soul, seek not the life of immortals; but enjoy to the full
+% the resources that are within your reach}
+% {\textit{Pythian Odes \\ Pindar}}
+%
+% Some authors like to add an interesting quotation at either the start
+% or end of a section. The \Lpack{epigraph} package provides commands
+% to assist in the typesetting of a single epigraph. Other authors like to
+% add many such quotations and the package provides environments to
+% cater for these as well.
+%
+% This manual is typeset according to the conventions of the
+% \LaTeX{} \textsc{docstrip} utility which enables the automatic
+% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
+%
+% Section~\ref{sec:usc} describes the usage of the package.
+% Commented source code for the package is in Section~\ref{sec:code}.
+%
+% \section{The \Lpack{epigraph} package} \label{sec:usc}
+%
+% \tepi{The whole is more than the sum of the parts.}
+% {\textit{Metaphysica \\ Aristotle}}
+%
+% The \Lpack{epigraph} package provides commands for typesetting
+% a single epigraph and environments for typesetting a list of epigraphs.
+% Epigraphs can be typeset at either the left, the center or the right of
+% the typeblock. A few example eipgraphs are exhibited here, and
+% others can be found in an article by
+% Christina Thiele~\cite{TTC199}.
+%
+% \subsection{The \texttt{epigraph} command}
+%
+% The original inspiration for |\epigraph| was Doug Schenck's
+% for the epigraphs in our book~\cite{EBOOK}. That was hard wired for
+% the purpose at hand. The version here provides much more flexibility.
+%
+%
+%
+% \DescribeMacro{\epigraph}
+% The command |\epigraph{|\meta{text}|}{|\meta{source}|}|
+% typesets
+% an epigraph using \meta{text} as the main text of the epigraph and
+% \meta{source} being the original author (or book, article, etc.)
+% of the quoted text. By default the epigraph is placed at the right hand
+% side of the textblock, and the \meta{source} is typeset at the bottom
+% right of the \meta{text}.
+%
+%
+% \subsection{The \texttt{epigraphs} environment}
+%
+% \DescribeEnv{epigraphs}
+% The |epigraphs| environment typesets a list of epigraphs, and by default
+% places them at the right hand side of the textblock.
+%
+% \DescribeMacro{\qitem}
+% Each epigraph in the list is specified by a
+% |\qitem{|\meta{text}|}{|\meta{source}|}| command (analagous to the |\item|
+% command in ordinary list environments).
+% By default, the \meta{source} is typeset at the bottom right of the
+% \meta{text}.
+%
+%
+%
+% \subsection{General}
+%
+% \tepi{Example is the school of mankind, and they will learn at no other.}
+% {\textit{Letters on a Regicide Peace}\\ \textsc{Edmund Burke}}
+%
+% The commands described in this section apply to both the |\epigraph|
+% command and the |epigraphs| environment. But first of all, note that an
+% epigraph immediately after a heading will cause the first paragraph
+% of the following text to be indented. If you want the initial paragraph
+% to have no indentation, then start it with the |\noindent| command.
+%
+% \DescribeMacro{\epigraphwidth}
+% \DescribeMacro{\textflush}
+% The epigraphs are typeset in a minipage of width |\epigraphwidth|. The default
+% value for this can be changed using the |\setlength| command. Typically,
+% epigraphs are typset in a measure much less than the width of the textblock.
+% In order to avoid bad line breaks, the \meta{text} is normally typeset
+% raggedright.
+% The |\textflush| command controls the \meta{text} typesetting style,
+% and it can be redefined from its default value of
+% \texttt{flushleft} (which produces raggedright). The sensible values
+% are \texttt{center} for centered text, \texttt{flushright} for raggedleft
+% text, and \texttt{flushepinormal} for normal justified text.
+%
+% If by any chance you want the \meta{text} to be typeset in some
+% other layout style, the easiest
+% way to do this is by defining a new environment which sets the paragraphing
+% parameters to your desired values. For example, as the \meta{text} is
+% typeset in a minipage, there is no paragraph indentation. If you
+% want the paragraphs to be indented and justified then define
+% a new environment like:\\
+% |\newenvironment{myparastyle}{\setlength{\parindent}{1em}}{}| \\
+% and use it as: \\
+% |\renewcommand{\textflush}{myparastyle}|.
+%
+% \DescribeMacro{\epigraphflush}
+% As noted, the default position of epigraphs is at the right hand side
+% of the textblock. The positioning is controlled by |\epigraphflush|
+% whose default value is \texttt{flushright}. This can be changed
+% to \texttt{flushleft} for positioning at the left hand side or to
+% \texttt{center} for positioning at the center of the textblock.
+%
+% \DescribeMacro{\sourceflush}
+% The |\sourceflush| command controls the position of the \meta{source}.
+% The default value is \texttt{flushright}. It can be changed to
+% \texttt{flushleft}, \texttt{center} or \texttt{flushepinormal}.
+%
+% For example, to have epigraphs centered with the \meta{source} at the left,
+% add the following to your
+% document (after loading the \Lpack{epigraph} package):
+% \begin{verbatim}
+% \renewcommand{\epigraphflush}{center}
+% \renewcommand{\sourceflush}{flushleft}
+% \end{verbatim}
+%
+% \DescribeMacro{\epigraphsize}
+% Epigraphs are often typeset in a smaller font than the main text. The
+% |\epigraphsize| command sets the font size to be used.
+% If you don't like the default value, change it by redefining the command,
+% for example: \\
+% | \renewcommand{\epigraphsize}{\footnotesize}|
+%
+% \DescribeMacro{\epigraphrule}
+% By default, a rule is drawn between the \meta{text} and \meta{source},
+% with the rule thickness being given by the value of |\epigraphrule|.
+% The value can be changed by using the \LaTeX{} |\setlength| command.
+% A value of \texttt{0pt} will eliminate the rule. Personally, I dislike
+% the rule in the list environments.
+%
+% \DescribeMacro{\beforeepigraphskip}
+% \DescribeMacro{\afterepigraphskip}
+% The two |...skip| commands specify the amount of vertical space inserted
+% before and after typeset epigraphs. Again, these can be changed by
+% |\setlength|. It is desireable that the sum of their values should be an
+% integer multiple of the |\baselineskip|.
+%
+% Note that you can use normal \LaTeX{} commands in the \meta{text} and
+% \meta{source} arguments. You may wish to use different fonts for the
+% \meta{text} (say roman) and the \meta{source} (say italic).
+%
+% The epigraph at the start of this section can be specified as:
+% \begin{verbatim}
+% \epigraph{Example is the school of mankind,
+% and they will learn at no other.}%
+% {\textit{Letters on a Regicide Peace}\\ \textsc{Edmund Burke}}
+% \end{verbatim}
+%
+% \subsection{Epigraphs before chapter headings}
+%
+% The |\epigraph| command and the |epigraphs| environment typeset
+% an epigraph at the point in the text where they are placed. The
+% first thing that a |\chapter| command does is to start off a new page,
+% so another mechanism is provided for placing an epigraph just before
+% a chapter heading.
+%
+% \DescribeMacro{\epigraphhead}
+% The |\epigraphhead[|\meta{distance}|]{|\meta{text}|}| stores \meta{text}
+% for printing at \meta{distance} below the header on a page.
+% \meta{text} can be ordinary text or, more likely, can be either an
+% |\epigraph| command or an |epigraphs| environment. By default, the
+% epigraph will be typeset at the righthand margin.
+% If the command is immediately preceeded by a |\chapter| or |\chapter*|
+% command, the epigraph is typeset on the chapter title page.
+%
+% The default value for the optional \meta{distance} argument is set so
+% that an |\epigraph| consisting of a single line of quotation and a single
+% line denoting the source is aligned with the bottom of the `Chapter X'
+% line produced by the |\chapter| command. In other cases you will
+% have to experiment with the \meta{distance} value. The value for
+% \meta{distance} can be either a integer or a real number. The units
+% are in terms of the current value for |\unitlength|. A typical value
+% for \meta{distance} for a single line quotation and source for
+% a |\chapter*| might be about 70 (points). A positive value
+% of \meta{distance} places the epigraph below the page heading and a negative
+% value will raise it above the page heading.
+%
+% Here's some example code:
+% \begin{verbatim}
+% \chapter*{Celestial navigation}
+% \epigraphhead[70]{\epigraph{Star crossed lovers.}{\textit{The Bard}}}
+% \end{verbatim}
+%
+% The |\epigraphhead| command changes the page style for the page on
+% which it is specified, so there should be no text between the
+% |\chapter| and the |\epigraphhead| commands.
+%
+% The \meta{text} argument is put into a minipage of width |\epigraphwidth|.
+% If you use something other than |\epigraph| or |epigraphs| for the
+% \meta{text} argument, you may have to so some positioning of the text
+% yourself so that it is properly located in the minipage. For example
+% \begin{verbatim}
+% \chapter{Short}
+% \renewcommand{\epigraphflush}{center}
+% \epigraphhead{\centerline{Short quote}}
+% \end{verbatim}
+%
+% \changes{v1.3}{1999/12/01}{Added description of dropchapter and undodrop}
+% \DescribeMacro{\dropchapter}
+% \DescribeMacro{\undodrop}
+% If a long epigraph is placed before a chapter title it is possible that the
+% bottom of the epigraph may interfere with the chapter title. The command
+% |\dropchapter{|\meta{length}|}| will lower any subsequent chapter titles by
+% \meta{length}; a negative \meta{length} will raise the titles.
+% The command |\undodrop| restores subsequent chapter titles to their default
+% positions. For example:
+% \begin{verbatim}
+% \dropchapter{2in}
+% \chapter{Title}
+% \epigraphhead{long epigraph}
+% \undodrop
+% \end{verbatim}
+%
+% \changes{v1.2}{1999/09/12}{Added description of cleartoevenpage uses}
+% \DescribeMacro{\cleartoevenpage}
+% On occasions it may be desirable to put something (e.g., an epigraph, a map,
+% a picture) on the page facing the start
+% of a chapter, where the something belongs to the chapter that is about to
+% start rather than the chapter that has just ended. In order to do this
+% in a document that is going to be printed
+% doublesided, the chapter must start on an odd numbered page and the
+% pre-chapter material put on the immediately preceeding even numbered page.
+% The |\cleartoevenpage| command is like the |\cleardoublepage| except
+% that the page following the command will be an even numbered page, and the
+% command takes an optional argument, i.e., |\cleartoevenpage{|[arg|]|,
+% which is applied to the skipped page (if any).
+%
+% Here is an example:
+% \begin{verbatim}
+% ... end previous chapter.
+% \cleartoevenpage
+% \begin{center}
+% \begin{picture}... \end{picture}
+% \end{center}
+% \chapter{Next chapter}
+% \end{verbatim}
+% If the style is such that chapter headings are put at the top of the pages,
+% then it would be advisable to include |\thispagestyle{empty}| (or |plain|)
+% immediately after |\cleartoevenpage| to avoid a heading related to the
+% previous chapter from appearing on the page.
+%
+% If the something is like a figure with a numbered caption and the numbering
+% depends on the chapter numbering, then the numbers have to be hand set (unless
+% you define a special chapter command for the purpose). For example:
+% \begin{verbatim}
+% ... end previous chapter.
+% \cleartoevenpage[\thispagestyle{empty}] % skipped page, if any, to be empty
+% \thispagestyle{plain}
+% \addtocounter{chapter}{1} % increment the chapter number
+% \setcounter{figure}{0} % initialise figure counter
+% \begin{figure}
+% ...
+% \caption{Pre chapter figure}
+% \end{figure}
+%
+% \addtocounter{chapter}{-1} % decrement the chapter number
+% \chapter{Next chapter} % increments chapter number, initialises figure number
+% \addtocounter{figure}{1} % to account for pre-chapter figure
+% \end{verbatim}
+%
+%
+% \subsection{Epigraphs on Part pages}
+%
+% The \Lpack{epigraph} package as it stands cannot put an epigraph on the
+% same page as a |\part| or |\part*| title page in
+% a \Lpack{book} or \Lpack{report} class. This is because the |\part| command
+% internally does some page flipping before and after the title page.
+% However, it is easy enough to put epigraphs on part pages.
+%
+% \begin{itemize}
+% \item Create a file called, say, \file{epipart.sty} which looks like this:
+% \begin{verbatim}
+% % epipart.sty
+% \let\@epipart\@endpart
+% \renewcommand{\@endpart}{\thispagestyle{epigraph}\@epipart}
+% \endinput
+% \end{verbatim}
+%
+% \item Start your document like:
+% \begin{verbatim}
+% \documentclass[...]{...}
+% \usepackage{epigraph}
+% \usepackage{epipart}
+% \end{verbatim}
+%
+% \item Immediately \emph{before} each |\part| command put an
+% |\epigraphhead| command. For example:
+% \begin{verbatim}
+% \epigraphhead[300]{Epigraph text}
+% \part{Part title}
+% \end{verbatim}
+% The value of the optional argument may need changing to vertically adjust
+% the position of the epigraph. If there is any |\part| that does not have an
+% epigraph then an empty |\epigraphhead| command (i.e., |\epigraphhead{}|)
+% must be placed immediately befor the |\part| command.
+%
+% \end{itemize}
+%
+% A similar scheme may be used for epigraphs on other kinds of pages.
+% The essential
+% trick is to make sure that the \pstyle{epigraph} pagestyle is used for
+% the page.
+%
+%
+% \subsection{Epigraphed bibliographies}
+% \changes{v1.2}{1999/09/12}{Added application of an epigraph to a bibliography}
+% One author asked how to associate an epigraph with his bibliography. The
+% following is one way to do it (the example is based on the book class).
+% \begin{enumerate}
+% \item Copy the definition of the |thebibliography| environment from
+% \file{book.cls} to your own file called, say \file{epibib.sty}.
+%
+% \item Edit \file{epibib.sty} to include the definition of a vacuous
+% command called, say, |\bibadd|. Edit the definition of the |thebibliography|
+% to include |\bibadd| immediately before the |\list| command. The relevant
+% portions of \file{epibib.sty} will look like this:
+% \begin{verbatim}
+% % epibib.sty
+% ...
+% \newcommand{\bibadd}{}
+% \renewenvironment{thebibliography}[1]
+% {\chapter*{\bibname
+% \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
+% \bibadd
+% \list{\@biblabel .....
+% \end{verbatim}
+%
+% \item In your document, start it off like this:
+% \begin{verbatim}
+% \documentclass...
+% \usepackage{epigraph}
+% \usepackage{epibib}
+% \end{verbatim}
+% At the point where the bibliography is to go, do something like the following:
+% \begin{verbatim}
+% ...
+% \newcommand{\bepi}{<definition of epigraph>}
+% \renewcommand{\bibadd}{\bepi}
+% \bepi % seems to be required if using \epigraphhead in \bepi
+% \begin{thebibliography}{...} % or \bibliography{...}
+% ...
+% \end{verbatim}
+% \end{enumerate}
+% The same idea can be applied to document elements like an abstract or an
+% index. Of course |\bibadd| can be defined to be anything you want to typeset
+% between the bibliography heading and the start of the reference list.
+%
+%
+% \section{The package code} \label{sec:code}
+%
+% \tepi{And now for something completely different.}{\textit{Monty Python}}
+%
+% Announce the name and version of the package, which requires
+% \LaTeXe.
+% \begin{macrocode}
+%<*usc>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{epigraph}[2002/10/22 v1.5a typesetting epigraphs]
+% \end{macrocode}
+%
+% \begin{macro}{\beforeepigraphskip}
+% \begin{macro}{\afterepigraphskip}
+% \begin{macro}{\epigraphwidth}
+% \begin{macro}{\epigraphrule}
+% The several length commands, which can be changed by the user with
+% |\setlength|.
+% \begin{macrocode}
+\newlength{\beforeepigraphskip}
+ \setlength{\beforeepigraphskip}{.5\baselineskip}
+\newlength{\afterepigraphskip}
+ \setlength{\afterepigraphskip}{.5\baselineskip}
+\newlength{\epigraphwidth}
+ \setlength{\epigraphwidth}{.4\textwidth}
+\newlength{\epigraphrule}
+ \setlength{\epigraphrule}{.4\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\epigraphsize}
+% The size of the font to be used.
+% \begin{macrocode}
+\newcommand{\epigraphsize}{\small}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\epigraphflush}
+% \begin{macro}{\textflush}
+% \begin{macro}{\sourceflush}
+% The three commands to position epigraphs in the textblock and to position
+% the components of the epigraph.
+% \begin{macrocode}
+\newcommand{\epigraphflush}{flushright}
+\newcommand{\textflush}{flushleft}
+\newcommand{\sourceflush}{flushright}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{flushleftright}
+% An environment for |\textflush| to use normal minipage typesetting. It
+% is vacuous. Defining this was a mistake as the \Lpack{ccaption}
+% package also defines |\flushleftright|.
+% \changes{v1.5a}{2002/10/22}{Made flushleftright environment an error}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \@ifundefined{flushleftright}{%
+ \newenvironment{flushleftright}{%
+ \PackageError{epigraph}%
+ {The flushleftright environment has been removed.\MessageBreak
+ Use the flushepinormal environment instead}{\@ehc}}{}}%
+ {\PackageWarningNoLine{epigraph}%
+ {flushleftright has been previously defined.\MessageBreak
+ Use flushepinormal for epigraphs instead}}}
+
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{flushepinormal}
+% An environment for |\textflush| to use normal minipage typesetting. It
+% is vacuous.
+% \changes{v1.5a}{2002/10/22}{Added flushepinormal environment}
+% \begin{macrocode}
+\newenvironment{flushepinormal}{}{}
+
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \begin{macro}{\@epirule}
+% The internal command to draw a rule between text and source.
+% \begin{macrocode}
+\newcommand{\@epirule}{\rule[.5ex]{\epigraphwidth}{\epigraphrule}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@epitext}
+% The internal command to typeset the \meta{text}. Put it into a minipage of the
+% right size and typeset per |\textflush|.
+% \begin{macrocode}
+\newcommand{\@epitext}[1]{%
+ \begin{minipage}{\epigraphwidth}\begin{\textflush} #1\\
+% \end{macrocode}
+% Draw a rule if it will be visible, otherwise add some extra vertical space.
+% \begin{macrocode}
+ \ifdim\epigraphrule>\z@ \@epirule \else \vspace*{1ex} \fi
+ \end{\textflush}\end{minipage}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@episource}
+% The internal command for typesetting the \meta{source}, which is put
+% into a minipage and typeset according to |\sourceflush|.
+% \begin{macrocode}
+\newcommand{\@episource}[1]{%
+ \begin{minipage}{\epigraphwidth}\begin{\sourceflush} #1\end{\sourceflush}
+ \end{minipage}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\epigraph}
+% Having got the preliminaries out of the way, here's the user command
+% for a single epigraph. This is set in a minipage to prevent breaking
+% across a page. Position it according to |\epigraphflush|.
+% \begin{macrocode}
+\newcommand{\epigraph}[2]{\vspace{\beforeepigraphskip}
+ {\epigraphsize\begin{\epigraphflush}\begin{minipage}{\epigraphwidth}
+ \@epitext{#1}\\ \@episource{#2}
+ \end{minipage}\end{\epigraphflush}
+ \vspace{\afterepigraphskip}}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\qitem}
+% \begin{macro}{\qitemlabel}
+% |\qitem| is the epigraph list version of |\item|.
+% Set everything inside a minipage.
+% \begin{macrocode}
+\newcommand{\qitem}[2]{{\raggedright\item \begin{minipage}{\epigraphwidth}
+ \@epitext{#1}\\ \@episource{#2}
+ \end{minipage}}}
+% \end{macrocode}
+% |\qitemlabel| is needed for a list as well. It is not going to
+% typeset anything.
+% \begin{macrocode}
+\newcommand{\qitemlabel}[1]{\hfill}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{environment}{epigraphs}
+% Now for the epigraph list. This is defined in terms of a |list|
+% environment.
+% \begin{macrocode}
+\newenvironment{epigraphs}{%
+% \end{macrocode}
+% Do the vertical space, set the font size, position according to
+% |\epigraphflush|, and put everyting into a minipage.
+% \begin{macrocode}
+ \vspace{\beforeepigraphskip}\begin{\epigraphflush}
+ \epigraphsize
+ \begin{minipage}{\epigraphwidth}
+ \list{}%
+% \end{macrocode}
+% Make the list just fit the minipage (i.e., no indents).
+% \begin{macrocode}
+ {\itemindent\z@ \labelwidth\z@ \labelsep\z@
+ \leftmargin\z@ \rightmargin\z@
+ \let\makelabel\qitemlabel}}%
+ {\endlist\end{minipage}\end{\epigraphflush}
+ \vspace{\afterepigraphskip}}
+% \end{macrocode}
+% \end{environment}
+%
+% \subsection{Epigraphs before a chapter title}
+%
+% \begin{macro}{\cleartoevenpage}
+% Like |\cleardoublepage| except that it skips pages until an even one, and
+% its optional argument is applied to the skipped page, if any.
+% The code is based on the kernel |\cleardoublepage| in \file{ltoutput.dtx}.
+% \changes{v1.2}{1999/09/12}{Added \cs{cleartoevenpage} command}
+% \changes{v1.5}{2000/02/20}{Added optional arg to \cs{cleartoevenpage}}
+% \begin{macrocode}
+\providecommand{\cleartoevenpage}[1][\@empty]{%
+ \clearpage%
+ \ifodd\c@page\hbox{}#1\clearpage\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@epichapapp}
+% \begin{macro}{\dropchapter}
+% \begin{macro}{\undodrop}
+% \changes{v1.3}{1999/12/01}{Defined chapter dropping and support commands}
+% Commands to drop and restore positions of chapter titles. Dropping is
+% accomplished by inserting vertical space before the |\@chapapp| command.
+% \begin{macrocode}
+\newcommand{\dropchapter}[1]{%
+ \let\@epichapapp\@chapapp
+ \renewcommand{\@chapapp}{\vspace*{#1}\@epichapapp}}
+\newcommand{\undodrop}{\let\@chapapp\@epichapapp}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Placing an epigraph before a chapter title uses the scheme outlined
+% by Piet van Oostrum~\cite{OOSTRUM96}. This is to put a zero sized
+% picture into the page header.
+%
+% \begin{macro}{\if@epirhs}
+% \begin{macro}{\if@epicenter}
+% Two booleans for testing whether an epigraph is to be at the RH margin,
+% centered, or at the LH margin. The default is RH margin.
+% \begin{macrocode}
+\newif\if@epirhs \@epirhstrue
+\newif\if@epicenter \@epicentertrue
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@epipos}
+% This routine sets the |\if@epi...| booleans according to the value of
+% |\epigraphflush|. If |\epigraphflush| is neither |center| nor |flushleft|
+% then it defaults to |flushright|. We have to use this to be upward
+% compatible with |\epigraphflush| being set by the user with |\renewcommand|.
+% \begin{macrocode}
+\newcommand{\@epipos}{
+ \long\def\@ept{flushleft}
+ \ifx\epigraphflush\@ept
+ \@epirhsfalse \@epicenterfalse
+ \else
+ \long\def\@ept{center}
+ \ifx\epigraphflush\@ept
+ \@epirhsfalse \@epicentertrue
+ \else
+ \@epirhstrue \@epicenterfalse
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\epigraphhead}
+% |\epigraphhead[|\meta{distance}|]{|\meta{text}|}| puts \meta{text} at
+% \meta{distance} (a number, not a length) below the header at the
+% page position specified by |\epigraphflush|.
+% \begin{macrocode}
+\newcommand{\epigraphhead}[2][95]{%
+% \end{macrocode}
+% We have to use |\def| instead of the normal \LaTeX{} definition commands
+% as we will keep on
+% (re)defining things. For reasons that are not fully clear to me \LaTeX{}
+% doesn't seem to like me using a |\savebox| for storing the epigraph text,
+% so I'll use a command instead.
+% \begin{macrocode}
+ \def\@epitemp{\begin{minipage}{\epigraphwidth}#2\end{minipage}}
+% \end{macrocode}
+% Define an |epigraph| page style.
+% \begin{macrocode}
+ \def\ps@epigraph{\let\@mkboth\@gobbletwo
+% \end{macrocode}
+% There are three possible definitions for |\@oddhead| depending on the
+% value of |\epigraphflush|. We call |\@epipos| to decide which one to do.
+% \begin{macrocode}
+ \@epipos
+ \if@epirhs
+ \def\@oddhead{\hfil\begin{picture}(0,0)
+ \put(0,-#1){\makebox(0,0)[r]{\@epitemp}}
+ \end{picture}}
+ \else
+ \if@epicenter
+ \def\@oddhead{\hfil\begin{picture}(0,0)
+ \put(0,-#1){\makebox(0,0)[b]{\@epitemp}}
+ \end{picture}\hfil}
+ \else
+ \def\@oddhead{\begin{picture}(0,0)
+ \put(0,-#1){\makebox(0,0)[l]{\@epitemp}}
+ \end{picture}\hfil}
+ \fi
+ \fi
+ \let\@evenhead\@oddhead
+ \def\@oddfoot{\reset@font\hfil\thepage\hfil}
+ \let\@evenfoot\@oddfoot}
+% \end{macrocode}
+% Make |epigraph| be the page style for this page.
+% \begin{macrocode}
+ \thispagestyle{epigraph}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% The end of this package.
+% \begin{macrocode}
+%</usc>
+% \end{macrocode}
+%
+%
+% \bibliographystyle{alpha}
+%
+% \begin{thebibliography}{GMS94}
+%
+% \bibitem[GMS94]{GOOSSENS94}
+% Michel Goossens, Frank Mittelbach, and Alexander Samarin.
+% \newblock {\em The LaTeX Companion}.
+% \newblock Addison-Wesley Publishing Company, 1994.
+%
+% \bibitem[vO96]{OOSTRUM96}
+% Piet van Oostrum
+% \newblock {\em Page layout in \LaTeX}, June 1996.
+% \newblock (Available from CTAN as file \texttt{fancyhdr.tex}).
+%
+% \bibitem[SW94]{EBOOK}
+% Douglas Schenck and Peter Wilson.
+% \newblock {\em Information Modeling the EXPRESS Way}.
+% \newblock Oxford University Press, 1994 (ISBN 0-19-508714-3).
+%
+% \bibitem[Thi99]{TTC199}
+% Christina Thiele.
+% \newblock \emph{The Treasure Chest: Package tours from CTAN},
+% \newblock TUGboat, vol.~20, no.~1, pp~53--58, March 1999.
+%
+% \end{thebibliography}
+%
+%
+% \Finale
+% \PrintIndex
+%
+\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/latex/epigraph/epigraph.ins b/Master/texmf-dist/source/latex/epigraph/epigraph.ins
new file mode 100644
index 00000000000..f2d56d6f4fe
--- /dev/null
+++ b/Master/texmf-dist/source/latex/epigraph/epigraph.ins
@@ -0,0 +1,59 @@
+%% epigraph.ins
+%% Copyright 1998 Peter R. Wilson
+%%
+%% This program is provided under the terms of the
+%% LaTeX Project Public License distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt.
+%%
+%% Author: Peter Wilson (CUA and NIST)
+%% now at: peter.r.wilson@boeing.com
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{epigraph.ins}
+\input docstrip.tex
+\preamble
+
+Author: Peter Wilson (CUA and NIST)
+ now at: peter.r.wilson@boeing.com
+
+Copyright 1998 Peter R. Wilson
+
+ This program is provided under the terms of the
+ LaTeX Project Public License distributed from CTAN
+ archives in directory macros/latex/base/lppl.txt.
+
+\endpreamble
+
+\keepsilent
+
+%%% \Msg{*** Generating the driver file ***}
+%%% \generateFile{epigraph.drv}{t}{\from{epigraph.dtx}{driver}}
+
+\Msg{*** Generating the LaTeX2e package files ***}
+
+\generateFile{epigraph.sty}{t}{\from{epigraph.dtx}{usc}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file(s) into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space epigraph.sty}
+\Msg{*}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{* Process any name.idx file by:}
+\Msg{* \space\space\space\space makeindex -s gind.ist name}
+\Msg{* Process any name.glo file by:}
+\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/eqlist/eqlist.dtx b/Master/texmf-dist/source/latex/eqlist/eqlist.dtx
new file mode 100644
index 00000000000..e693747332f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/eqlist/eqlist.dtx
@@ -0,0 +1,551 @@
+% \def\fileversion{2.1}\def\filedate{2002/08/15}\def\docdate{2002/08/15}
+%\iffalse These lines are necessary for the doc and docstrip utilities
+%<*metainfo>
+
+% With this package you can write lists with equal indentation.
+% This package requires the eqparbox package.
+%
+% Author:
+%
+% M. V\"ath vaeth@mathematik.uni-wuerzburg.de
+%
+
+%\fi
+%
+% \def\basename{eqlist}
+%
+%% \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 \~}
+%
+% \CheckSum{180}
+%
+% \newcommand{\cmdcite}[1]{\texttt{\textbackslash#1}}
+% \newcommand{\envcite}[1]{\texttt{\{#1\}}}
+% \newcommand{\optcite}[1]{\texttt{#1}}
+% \newcommand{\filecite}[1]{\texttt{#1}}
+% \newcommand{\bracemeta}[1]{\texttt{\{}\meta{#1}\texttt{\}}}
+%
+% \iffalse
+% \RecordChanges
+% \fi
+% \def\ChangesTab{}\let\orichanges\changes
+% \def\changes#1#2#3{\orichanges{#1}{#2}{#3}
+% \expandafter\def\expandafter\ChangesTab\expandafter{\ChangesTab
+% \item[v#1 {\mdseries(\emph{#2})}] {#3.}}}
+%
+% \changes{2.1}{2002/08/18}{Added \cmdcite{longitem} and the related
+% \cmdcite{eqlistauto} mechanism. The latter was suggested by
+% Rolf Niepraschk \texttt{Rolf.Niepraschk@ptb.de}. Changed default
+% of \cmdcite{eqlistlabel} and gave some comments on spaces at the end of
+% labels in the documentation. Documented special usage of
+% \cmdcite{makelabel}}
+% \changes{1.2}{2001/08/17}{Added the \envcite{Eqlist} and \envcite{Eqlist*}
+% environments}
+% \changes{1.1}{2001/08/16}{First release}
+%
+% \iffalse
+%</metainfo>
+%
+% Everything between the following lines %<*driver> and %</driver> goes
+% into the file eqlist.tex. Also, this is the only code executed, if
+% this file here is run through latex.
+%
+%<*driver>
+\documentclass{ltxdoc}
+\OnlyDescription%% Comment this out, or
+%%\AlsoImplementation%% uncomment this line, if you want to see the source.
+
+%% If you want an index, uncomment one of the following lines.
+%% After running latex a first time, you have to use
+%% makeindex -s gind.ist eqlist
+%% Then run latex again.
+%%\CodelineIndex% comment this out if you want an index referring to codelines
+%%\PageIndex% comment this out if you want an index referring to pages
+%%\OldMakeindex% uncomment this line, if your MakeIndex is pre-v2.9
+
+\setlength\hfuzz{15pt}
+\hbadness=7000
+\begin{document}
+\DocInput{eqlist.dtx}
+\end{document}
+%</driver>
+%<*metainfo>
+% \fi
+%
+% \MakeShortVerb{"}
+% \def\itemcmd#1{\item[\mdseries\texttt{\textbackslash#1}]}
+%
+% \title{The \texttt{eqlist} package\thanks
+% {This file has version number \fileversion{}, last revised \filedate.}}
+% \author{Martin V\"ath\\{\texttt{vaeth@mathematik.uni-wuerzburg.de}}}
+% \date{\docdate}
+% \maketitle
+
+% \begin{abstract}
+% With this package you can write lists with equal indentation.
+% This package requires the \filecite{eqparbox} package.
+% \end{abstract}
+%
+% You may copy this package freely, as long as you distribute only unmodified
+% and complete versions.
+%
+% \iffalse\tableofcontents\par\pagebreak\par\fi
+%
+% \section{Changes}
+%
+% \begin{description}
+% \ChangesTab
+% \end{description}
+%
+% \section{Description}
+%
+% This package provides a list environment which sets a description-like list
+% but with the difference that the indentation corresponds to the longest item
+% of the list. The usage is simply
+% \begin{quote}
+% \DescribeEnv{eqlist}"\begin{eqlist}["\meta{optional modifications}"]"\\
+% "\item[First item] Text"\\
+% "\item[Second item] Text"\\
+% "\longitem[A special very long item] Text"\\
+% \dots\\
+% "\end{eqlist}"
+% \end{quote}
+% and there is also the environment \DescribeEnv{eqlist*}\envcite{eqlist*}
+% which is similar but has slightly different defaults
+% (which make the list appear more compact).
+% There is also the alternative call
+% \begin{quote}
+% \DescribeEnv{Eqlist}"\begin{Eqlist}["\meta{optional modifications}"]"\relax
+%\bracemeta{tag}\\
+% "\item[First item] Text"\\
+% "\item[Second item] Text"\\
+% "\longitem[A special very long item] Text"\\
+% \dots\\
+% "\end{eqlist}"
+% \end{quote}
+% and a corresponding \DescribeEnv{Eqlist*}\envcite{Eqlist*} environment.\par
+%
+% All texts within the list are indented by the length of the largest label
+% (i.e.\ "\item" entry) plus "\labelsep". For the "Eqlist" or "Eqlist*"
+% environment, all lists with the same \meta{tag} are treated equally in the
+% sense that the indentation of these lists is determined by the largest
+% "\item" of all these lists. In this case, you may also use the \meta{tag}
+% for the \filecite{eqparbox} package to read or modify the length of the
+% largest "\item" (which is internally treated as a "\eqparbox").\par
+%
+% \DescribeMacro{\longitem}"\longitem" is like "\item", but the corresponding
+% label is excluded from the calculation of the longest "\item".
+% The intention of "\longitem" is to allow exceptionally long labels to
+% occur without forcing a corresponding extreme indentation
+% of the whole list. If you want \LaTeX\ to decide automatically
+% whether "\longitem" or "\item" should be used, you can use the
+% "\eqlistauto" mechanism which is described later.
+%
+% The \meta{optional modifications} are any commands which are used to
+% initialize the list: You can modify here essentially the same variables as
+% for any \LaTeXe\ list. If this argument is not given, the default
+% initializations \DescribeMacro{\eqlistinit}"\eqlistinit" respectively
+% \DescribeMacro{\eqliststarinit}"\eqliststarinit" (for \envcite{eqlist*}
+% and \envcite{Eqlist*}) are used:
+% You can just modify these definitions to change the defaults.
+% If you have given the argument \meta{optional modifications} and additionally
+% want to use the defaults, you have to include the command "\eqlistinit"
+% respectively "\eqliststarinit" into the argument
+% \meta{optional modifications} (see the examples below).\par
+%
+% The macros "\eqlistinit" and "\eqliststarinit" both call
+% \DescribeMacro{\eqlistinitpar}"\eqlistinitpar" which sets the values for
+% "\parindent" and "\parskip" to the values outside the list
+% (this is not standard in \LaTeXe, but I prefer this style; if you do not like
+% this, use "\let\eqlistinit\relax").
+%
+% Currently, this is all which is done by "\eqlistinit"; for
+% "\eqliststarinit" additionally the values of
+% \DescribeMacro{\topsep}"\topsep" and \DescribeMacro{\itemsep}"\itemsep" are
+% set to $0$. Note that currently \DescribeMacro{\partopsep}"\partopsep" is
+% not changed from the \LaTeXe\ default. Note that the latter is by default
+% positive which means that if you are in vertical mode before the list
+% (e.g.\ if you have a "\par" in front of the list), you get slightly more
+% space above the list.\par
+%
+% Before \meta{optional modifications} (or "\eqlistinit" respectively
+% "\eqliststarinit") are expanded, the length of the largest label is already
+% stored in
+% \DescribeMacro{\labelwidth}"\labelwidth" and
+% \DescribeMacro{\leftmargin}"\leftmargin". After your modifications,
+% \DescribeMacro{\labelsep}"\labelsep" is added to the actual value of
+% "\leftmargin".
+%
+% As usual, the layout of "\item"s is done by the command
+% \DescribeMacro{\makelabel}"\makelabel". If you want, you can change the
+% default initialization of this command in the \meta{optional modifications}
+% argument. However, it is \emph{not} admissible to redefine this macro
+% within the list.
+% If you really want to change the layout of "\item"s in the middle of a list,
+% you can initialize "\makelabel" to expand to another command whose
+% definition you can change within the list instead of "\makelabel"
+% (an example will be given later).
+% The default value of \DescribeMacro{\makelabel}"\makelabel" is the
+% content of \DescribeMacro{\eqlistlabel}"\eqlistlabel" which in turn is
+% by default defined with
+% \begin{verbatim}
+% \def\eqlistlabel#1{#1}\end{verbatim}
+%
+% In version 1.1 and 1.2 of this package, the default was different:
+% A space was added at the end. This has been changed, because by a bug
+% (or feature?) in "\eqparbox" spaces at the end of an "\item" are
+% ignored anyway.
+% If you want to force a space at the end which will not be ignored,
+% you have to hide it in a box:
+% \begin{verbatim}
+% \def\eqlistlabel#1{\mbox{#1 }}\end{verbatim}
+% will force a space at the end of every "\item".\bigskip
+%
+% There is a special mechanism provided which will automatically decide for
+% an "\item" depending on the length of its label whether it is treated as
+% normal or whether it should be treated like a "\longitem": If you want to
+% use this mechanism, you only have to insert the command
+% \begin{quote}
+% \DescribeMacro{\eqlistauto}"\eqlistauto{"\meta{maximal length}"}"
+% \end{quote}
+% either inside the \meta{optional modifications} argument or within the list.
+% Here, \meta{maximal length} must be in a format which can be used within
+% \TeX's internal "\ifdim" command. It describes the maximal length of the
+% label such that the corresponding "\item" will be treated as usual---for
+% longer labels the corresponding "\item" will be treated as a "\longitem".
+% If you want to switch off the "\eqlistauto"-mechanism again, you can use
+% the command
+% \begin{quote}
+% \DescribeMacro{\eqlistnoauto}"\eqlistnoauto"
+% \end{quote}
+% The commands "\eqlistauto" and "\eqlistnoauto" need not occur in matching
+% pairs, and they can also be used several times within the same list:
+% Only the latest of the corresponding commands takes effect for a
+% corresponding "\item".
+%
+% Unfortunately, the "\eqlistauto" mechanism has a disadvantage: As long as
+% it is in effect, the corresponding "\makelabel"s for the "\item"s are
+% always executed twice (once to calculate the length and once for the actual
+% typesetting). This can cause problems if e.g.\ counters in "\item"s are
+% increased.
+%
+% The "\eqlistauto" mechanism only effects the "\item" command, not
+% "\longitem": Even if the "\eqlistauto" mechanism is active, you can use
+% "\longitem" which will have its original meaning (independent of the
+% length of the label). This means in particular that the "\makelabel" is
+% executed only once by "\longitem", no matter whether the "\eqlistauto"
+% mechanism is active or not.
+%
+% \section{Examples}
+% \begin{verbatim}
+% \begin{eqlist}[\eqliststarinit\def\makelabel#1{\bfseries#1:}\labelsep1em]
+% \item[Short label] Descriptive text
+% \item[A longer label] Descriptive text
+% \longitem[An exceptionally long label] Descriptive text
+% \item[Short again] Descriptive text
+% \end{eqlist}\end{verbatim}
+% will produce an output like\medskip\newline
+% \begin{tabular}{@{}l@{}l}
+% \bfseries Short label:\hspace{1em}\null&Descriptive text\\
+% \bfseries A longer label:\hspace{1em}\null&Descriptive text\\
+% \multicolumn{2}{@{}l}{{\bfseries An exceptionally
+% long label:\hspace{1em}}\null Descriptive text}\\
+% \bfseries Short again:\hspace{1em}\null&Descriptive text
+% \end{tabular}\bigskip\par
+%
+% The same output can be obtained using the "\eqlistauto" mechanism
+% \begin{verbatim}
+% \begin{eqlist}[\eqliststarinit
+% \def\makelabel#1{\bfseries#1:}\labelsep1em\eqlistauto{3cm}]
+% \item[Short label] Descriptive text
+% \item[A longer label] Descriptive text
+% \item[An exceptionally long label] Descriptive text
+% \item[Short again] Descriptive text
+% \end{eqlist}\end{verbatim}
+% or by using the "\eqlistauto" mechanism only locally:
+% \begin{verbatim}
+% \begin{eqlist}[\eqliststarinit\def\makelabel#1{\bfseries#1:}\labelsep1em]
+% \item[Short label] Descriptive text
+% \item[A longer label] Descriptive text
+% \eqlistauto{0pt}
+% \item[An exceptionally long label] Descriptive text
+% \eqlistnoauto
+% \item[Short again] Descriptive text
+% \end{eqlist}\end{verbatim}
+%
+% The next example demonstrates how one can change the layout of labels
+% within the list. Recall that it is forbidden to redefine "\makelabel".
+% \begin{verbatim}
+% \begin{eqlist}[\eqliststarinit
+% \def\mylabel#1{\bfseries#1:}\def\makelabel{\mylabel}\labelsep1em]
+% \item[First label] Descriptive text
+% \item[Second label] Descriptive text
+% \def\mylabel#1{\slshape#1:}
+% \item[First new-style label] Descriptive text
+% \longitem[Second new-style label which is long] Descriptive text
+% \end{eqlist}\end{verbatim}
+% The above example will produce an output as follows.\bigskip\newline
+% \begin{tabular}{@{}l@{}l}
+% \bfseries First label:\hspace{1em}\null&Descriptive text\\
+% \bfseries Second label:\hspace{1em}\null&Descriptive text\\
+% \slshape First new-style label:\hspace{1em}\null&Descriptive text\\
+% \multicolumn{2}{@{}l}{{\slshape Second new-style label
+% which is long:\hspace{1em}}\null Descriptive text}
+% \end{tabular}
+%
+% \iffalse
+%</metainfo>
+% \fi
+% \iffalse--------------------------------------------------------------\fi
+% \StopEventually{\PrintChanges}
+% \section{Implementation}
+%
+% \newcommand{\nocomment}{}
+% \setcounter{CodelineNo}{0}
+% \iffalse--------------------------------------------------------------
+%
+%
+%<*eqlist>
+% \fi
+% \begin{macrocode}
+
+\typeout{eqlist.sty by M. Vaeth: Revision 2.1}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{eqlist}[2002/08/15 v2.1]
+
+\RequirePackage{eqparbox}
+
+% \end{macrocode}
+% \begin{macro}{eqlist}\nocomment
+% \begin{macrocode}
+\newenvironment{eqlist}[1][\eqlistinit]{\eql@start{#1}}{\eql@end}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{eqlist*}\nocomment
+% \begin{macrocode}
+\newenvironment{eqlist*}[1][\eqliststarinit]{\eql@start{#1}}{\eql@end}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{Eqlist}\nocomment
+% \begin{macrocode}
+\newenvironment{Eqlist}[2][\eqlistinit]{\eql@startp{#1}{#2}}{\eql@end}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{Eqlist*}\nocomment
+% \begin{macrocode}
+\newenvironment{Eqlist*}[2][\eqliststarinit]{\eql@startp{#1}{#2}}{\eql@end}
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqlistinitpar}\nocomment
+% \begin{macrocode}
+\ifx\eqlistinitpar\undefined
+ \def\eqlistinitpar{\relax\listparindent\parindent\relax\parsep\parskip\relax}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqlistinit}\nocomment
+% \begin{macrocode}
+\ifx\eqlistinit\undefined
+ \def\eqlistinit{\eqlistinitpar}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqliststarinit}\nocomment
+% \begin{macrocode}
+\ifx\eqliststarinit\undefined
+ \def\eqliststarinit{\topsep0pt\relax\itemsep0pt\relax%\partopsep0pt\relax
+ \eqlistinitpar}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqlistlabel}\nocomment
+% \begin{macrocode}
+\ifx\eqlistlabel\undefined
+ \def\eqlistlabel#1{#1}
+\fi
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@cnt}
+% The counter "\eql@cnt" is used to generate ``unique'' names for the labels.
+% \begin{macrocode}
+\newcount\eql@cnt\relax\eql@cnt=0
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@start}
+% The macro "\eql@start" advances the counter "\eql@cnt" (globally!) and then
+% starts a list, where for the initialization "\eql@mainprep" is called with
+% the corresponding ``unique'' name and the argument.
+% \begin{macrocode}
+\long\def\eql@start#1{\global\advance\eql@cnt by1\begin{list}{}{\expandafter
+ \eql@mainprepn\expandafter{\romannumeral\eql@cnt}{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@startp}
+% The macro "\eql@startp" is similar to "\eql@start" with the difference that
+% the first argument is used as the ``unique'' name instead of a counter.
+% Thus, "\eql@startp" starts a list, where for the initialization
+% "\eql@mainprep" is used with the corresponding arguments.
+% \begin{macrocode}
+\long\def\eql@startp#1#2{\begin{list}{}{\eql@mainprep{#2}{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@end}
+% \begin{macrocode}
+\def\eql@end{\end{list}}
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@mainprep}
+% In "\eql@mainprep", we allow the environment-specific commands and
+% initialize
+% \begin{macro}{\eql@makelabel}"\eql@makelabel"\end{macro}
+% which will become later our actual "\makelabel".
+% We also save this definition into
+% \begin{macro}{\eql@normal}"\eql@normal"\end{macro}
+% and (as always if "\eql@makelabel" is changed non-temporary) we also save it
+% into
+% \begin{macro}{\eql@current}"\eql@current".\end{macro}
+% Finally, "\makelabel" is initialized to "\eqlistlabel", and the
+% length of the label (and the left margin) is initialized with
+% the length of the corresponding eqparbox with the ``unique'' name "#1".
+% Then the (default or user) initialization "#2" is executed.
+% After this, "\makelabel" is replaced by "\eql@makelabel". The
+% ``user'' definition of "\makelabel" is before saved into
+% \begin{macro}{\eql@long}"\eql@long".\end{macro}
+% \begin{macrocode}
+\long\def\eql@mainprep#1#2{\let\longitem\eql@longitem
+ \let\eqlistauto\eql@auto
+ \let\eqlistnoauto\eql@noauto
+ \def\eql@makelabel##1{\eqparbox[b]{#1}{\eql@long{##1}}\hfil}%
+ \let\eql@normal\eql@makelabel
+ \let\eql@current\eql@makelabel
+ \setlength{\labelwidth}{\eqboxwidth{#1}}%
+ \setlength{\leftmargin}{\labelwidth}%
+ \let\makelabel\eqlistlabel
+ #2\addtolength{\leftmargin}{\labelsep}%
+ \let\eql@long\makelabel\def\makelabel{\eql@makelabel}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@mainprepn}
+% Despite of its definition, "\eql@mainprepn" actually expects two arguments:
+% "\eql@mainprepn" does the same as "\eql@mainprep" with the difference that
+% the first argument should be a unique roman number instead of a ``unique''
+% name: The actual name is then obtained by prepending the text "eqlistbox"
+% to the number. Note that the number must actually be roman, since otherwise
+% (some release(s) of) the \filecite{eqparbox} package becomes confused.
+% \begin{macrocode}
+\def\eql@mainprepn#1{\eql@mainprep{eqlistbox#1}}
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\longitem}
+% "\longitem" is essentially a call of "\item" with the difference that we
+% redefine "\eql@makelabel" temporarily. To avoid usage outside of the intended
+% environment, the actual code is put into
+% \begin{macro}{\eql@longitem}"\eql@longitem".\end{macro}
+% \begin{macrocode}
+\newcommand{\longitem}{\eql@illlegal\longitem\item}
+\def\eql@longitem[#1]{\let\eql@makelabel\eql@long
+ \item[#1]\let\eql@makelabel\eql@current}
+
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqlistauto}
+% To avoid usage outside of the intended environment,
+% the actual code is put into
+% \begin{macro}{\eql@auto}"\eql@auto".\end{macro}
+% \begin{macrocode}
+\newcommand{\eqlistauto}[1]{\eql@illegal\eqlistauto}
+\def\eql@auto#1{\def\eql@makelabel##1{\setbox0\hbox{\eql@long{##1}}%
+ \ifdim#1>\wd0\relax
+ \expandafter\eql@normal
+ \else
+ \expandafter\eql@long
+ \fi{##1}}%
+ \let\eql@current\eql@makelabel}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eqlistnoauto}
+% To avoid usage outside of the intended environment,
+% the actual code is put into
+% \begin{macro}{\eql@noauto}"\eql@noauto".\end{macro}
+% \begin{macrocode}
+\newcommand{\eqlistnoauto}{\eql@illegal\eqlistnoauto}
+\def\eql@noauto{\let\eql@makelabel\eql@normal\let\eql@current\eql@makelabel}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\eql@illegal}
+% Write error message in case a command is used outside of the intended
+% environment.
+% \begin{macrocode}
+\def\eql@illegal#1{\errmessage{\string#1
+ can only be used in eqlist or Eqlist environment}}
+
+% \end{macrocode}
+% \end{macro}
+% \iffalse
+%</eqlist>
+% \fi
+%
+% \Finale\PrintIndex
+%
+% \iffalse
+%<*metainfo>
+% \fi
+\iffalse -------------------------------------------------------------
+%
+% Just in case that for some reason the file `eqlist.ins' got lost:
+% The content of this file is between the lines %<*insfile> and %</insfile>:
+%
+%\iffalse
+%</metainfo>
+%<*insfile>
+\def\batchfile{eqlist.ins}
+\input docstrip.tex
+\keepsilent
+\nopreamble
+\generateFile{eqlist.sty}{f}{\from{eqlist.dtx}{eqlist}}
+\generateFile{eqlist.tex}{f}{\from{eqlist.dtx}{driver}}
+%%\generateFile{eqlist.ins.dup}{f}{\from{eqlist.dtx}{insfile}}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* To finish the installation, you have to move the}
+\Msg{* file 'eqlist.sty' in a directory searched by TeX.}
+\Msg{*}
+\Msg{*}
+\Msg{* Run the file 'eqlist.tex' through LaTeX to produce the}
+\Msg{* documentation}
+\Msg{*}
+\Msg{*}
+\Msg{***************************************************************}
+\endbatchfile
+%</insfile>
+%<*metainfo>
+% \fi
+\fi
+% \iffalse
+%</metainfo>
+% \fi
+\endinput
+
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: "eqlist.tex"
+%%% End:
diff --git a/Master/texmf-dist/source/latex/eqlist/eqlist.ins b/Master/texmf-dist/source/latex/eqlist/eqlist.ins
new file mode 100644
index 00000000000..790ce14d726
--- /dev/null
+++ b/Master/texmf-dist/source/latex/eqlist/eqlist.ins
@@ -0,0 +1,20 @@
+\def\batchfile{eqlist.ins}
+\input docstrip.tex
+\keepsilent
+\nopreamble
+\generateFile{eqlist.sty}{f}{\from{eqlist.dtx}{eqlist}}
+\generateFile{eqlist.tex}{f}{\from{eqlist.dtx}{driver}}
+%%\generateFile{eqlist.ins.dup}{f}{\from{eqlist.dtx}{insfile}}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* To finish the installation, you have to move the}
+\Msg{* file 'eqlist.sty' in a directory searched by TeX.}
+\Msg{*}
+\Msg{*}
+\Msg{* Run the file 'eqlist.tex' through LaTeX to produce the}
+\Msg{* documentation}
+\Msg{*}
+\Msg{*}
+\Msg{***************************************************************}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/euler/euler.dtx b/Master/texmf-dist/source/latex/euler/euler.dtx
new file mode 100644
index 00000000000..1b005be9bad
--- /dev/null
+++ b/Master/texmf-dist/source/latex/euler/euler.dtx
@@ -0,0 +1,774 @@
+% \iffalse
+%
+%% File `euler.dtx'.
+%% Copyright (C) 1992 Frank Jensen. All rights reserved.
+%% Copyright (C) 1993--1995 Frank Jensen and Frank Mittelbach.
+%% All rights reserved.
+%
+% Please send error reports and suggestions for improvements to:
+%
+% Frank Jensen
+% Aalborg University
+% DK-9220 Aalborg \O
+% Denmark
+% Internet: <fj@iesd.auc.dk>
+%
+% \fi
+
+\def\fileversion{v2.5}
+\def\filedate{1995/03/05}
+
+% \CheckSum{606}
+%% \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 \~}
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\begin{document}
+ \DocInput{euler.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \newcommand\beton{\texttt{beton}}
+% \newcommand\euler{\texttt{euler}}
+% \newcommand\MF{Metafont}
+%
+% \title{The \euler\ package}
+% \author{Frank Jensen\thanks{Updates by Frank Mittelbach.}}
+% \date{\filedate}
+%
+% \maketitle
+%
+% \section{Introduction}
+%
+% The \euler\ package provides a setup for using the AMS Euler family
+% of fonts for math in \LaTeX\ documents. The AMS Euler family was
+% designed by Hermann Zapf, commissioned by the American Mathematical
+% Society. ``The underlying philosophy of Zapf's Euler design was to
+% capture the flavor of mathematics as it might be written by a
+% mathematician with excellent handwriting.''~\cite{concrete-tug}
+%
+% The \euler\ package is based on Knuth's macros for the book
+% ``Concrete Mathematics''~\cite{concrete}. Knuth's macros can be
+% found through anonymous ftp to \texttt{labrea.\allowbreak
+% stanford.edu}: look for the file \texttt{gkpmac.tex} in directory
+% \texttt{pub/tex/local/lib}. The Euler fonts can be found through
+% anonymous ftp to \texttt{e-math.ams.org}: look in directory
+% \texttt{pub/tex/amsfonts}.
+%
+% The purpose of the \euler\ package is to provide the math part of
+% the look of~\cite{concrete}. The other part (text fonts) is
+% provided by the \beton\ package. The reason for creating two
+% packages is to make it easy to use the Euler math fonts together
+% with other text fonts (in particular, it appears that the Euler
+% fonts match many of the popular PostScript fonts pretty well).
+%
+% Basically, the \euler\ package provides the same setup (the same
+% definitions, math codes, etc.)\ as \texttt{gkpmac.tex} with respect
+% to the Euler fonts. However, Knuth~\cite{concrete-tug} admits that
+% the macros were written for one specific project, namely to typeset
+% the ``Concrete Mathematics'' book~\cite{concrete}. So, the \euler\
+% package actually does a little more than \texttt{gkpmac.tex}: for
+% example, some `exotic' symbols, present in CM math italic, are
+% missing from the Euler fonts; the \euler\ package takes care of this
+% (whereas \texttt{gkpmac.tex} does not).
+%
+% The use of the \euler\ package requires a lot of care when entering
+% the manuscript, since the package will cause, e.g., math numerals to
+% come from the Euler Roman fonts; these numerals are easily
+% distinguished from the normal text numerals. This implies that
+% sloppy typing is clearly exposed: imagine how
+% ``|$x$ is either 1 or $-1$|'' will appear when typeset! In general,
+% the typist will in each case have to decide whether an input
+% fragment is a math or a non-math entity. This holds true even for
+% the tiniest details, such as punctuation characters (parentheses,
+% colons, semicolons, commas, and periods).
+%
+% Finally, a few words about the technical quality of the fonts (there
+% are no doubts about their artistic quality): The fonts are not tuned
+% for low resolution rendering: I recommend at least 600dpi. The
+% fonts employ none of the tuning machinery of CM: e.g., they do not
+% use the `blacker' parameter specified in each \MF\ mode definition,
+% indicating that they might look somewhat light on printers that
+% normally require a large `blacker' value.
+%
+% \section{What the \euler\ package provides}
+%
+% The \euler\ package defines two new math alphabet identifiers,
+% |\mathscr| (Euler Script, uppercase letters only) and |\mathfrak|
+% (Euler Fraktur, both lowercase and uppercase letters).
+%
+% By default, the original meaning of |\mathcal| is preserved, but if
+% the \euler\ package is loaded with the \texttt{mathcal} option,
+% |\mathcal| will produce Euler Script letters instead of the usual
+% Computer Modern calligraphic letters.
+%
+% Also, by default, the \euler\ package does not redefine the
+% |\mathbf| math alphabet identifier; it will still produce bold CM
+% letters and digits. However, loading the \euler\ package with the
+% \texttt{mathbf} option will cause |\mathbf| to produce bold Euler
+% Roman letters and digits. Another way to get bold symbols is to use
+% the |\boldsymbol| command provided by the \texttt{amsbsy} package
+% (part of AMS-\LaTeX).
+%
+% Some users do not like the |\hat| accent glyph present in the Euler
+% fonts (the \euler\ package uses this accent glyph be default). To
+% use the |\hat| accent glyph from the text font instead, load the
+% \euler\ package with the \texttt{text-hat-accent} option.
+%
+% In \cite{concrete}, the space around relations in displays was
+% increased (from `5mu plus 5mu' to `10mu minus 3mu'). The \euler\
+% package does not change this space, since this is (for most cases)
+% controlled by the \LaTeX\ \texttt{eqnarray} environment. Also,
+% in~\cite{concrete}, displays are left justified with a suitable
+% indentation; we leave such matters to the general layout.
+%
+% \StopEventually {
+% \begin{thebibliography}{1}
+% \bibitem{concrete}
+% \textsc{R. L. Graham}, \textsc{D. E. Knuth}, and
+% \textsc{O. Patashnik}.
+% \newblock \textit{Concrete Mathematics}.
+% \newblock Addison-Wesley, 1989.
+% \bibitem{concrete-tug}
+% \textsc{D. E. Knuth}.
+% \newblock Typesetting Concrete Mathematics.
+% \newblock \textsl{TUGboat} 10(1):31--36, 1989.
+% \end{thebibliography}
+% }
+%
+% \section{Hello world}
+%
+% First, we announce the package.
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{euler}[\filedate\space\fileversion]
+\typeout{Package: `euler' \fileversion\space <\filedate> (FJ and FMi)}
+% \end{macrocode}
+%
+% \section{Font and other definitions}
+%
+% The AMS Euler family consists of: Euler Roman (medium and bold),
+% Euler Fraktur (medium and bold), Euler Script (medium and bold), and
+% Euler Extension (medium only). The \texttt{.fd} files for these
+% fonts are defined in the \texttt{amsfonts.fdd} file (part of the
+% AMSFonts distribution).
+%
+% \subsection{Euler Roman}
+%
+% The Euler Roman fonts replace the Computer Modern Math Italic fonts,
+% located in the `letters' math symbol font:
+% \begin{macrocode}
+\DeclareSymbolFont{letters}{U}{eur}{m}{n}
+\SetSymbolFont{letters}{bold}{U}{eur}{b}{n}
+% \end{macrocode}
+%
+% In math mode, digits should come from the Euler Roman fonts. As in
+% standard \LaTeX, we assign the type |\mathalpha| to the digits which
+% means that they will vary with math alphabets. One of the reasons
+% for this is that footnote numbers are set in math mode, and we want
+% these numbers to come from the text font; this is accomplished by
+% setting the \TeX\ primitive |\fam| to zero. (See
+% Section~\ref{footnotes} below.)
+% \begin{macrocode}
+\DeclareMathSymbol{0}\mathalpha{letters}{"30}
+\DeclareMathSymbol{1}\mathalpha{letters}{"31}
+\DeclareMathSymbol{2}\mathalpha{letters}{"32}
+\DeclareMathSymbol{3}\mathalpha{letters}{"33}
+\DeclareMathSymbol{4}\mathalpha{letters}{"34}
+\DeclareMathSymbol{5}\mathalpha{letters}{"35}
+\DeclareMathSymbol{6}\mathalpha{letters}{"36}
+\DeclareMathSymbol{7}\mathalpha{letters}{"37}
+\DeclareMathSymbol{8}\mathalpha{letters}{"38}
+\DeclareMathSymbol{9}\mathalpha{letters}{"39}
+% \end{macrocode}
+% The uppercase greek letters are also taken from the Euler Roman
+% fonts. We make them ordinary symbols (i.e., of type |\mathord|) as
+% opposed to \texttt{plain.tex}, \texttt{gkpmac.tex}, and standard
+% \LaTeX, which make them vary according to |\fam|.
+% \begin{macrocode}
+\DeclareMathSymbol\Gamma \mathord{letters}{"00}
+\DeclareMathSymbol\Delta \mathord{letters}{"01}
+\DeclareMathSymbol\Theta \mathord{letters}{"02}
+\DeclareMathSymbol\Lambda \mathord{letters}{"03}
+\DeclareMathSymbol\Xi \mathord{letters}{"04}
+\DeclareMathSymbol\Pi \mathord{letters}{"05}
+\DeclareMathSymbol\Sigma \mathord{letters}{"06}
+\DeclareMathSymbol\Upsilon\mathord{letters}{"07}
+\DeclareMathSymbol\Phi \mathord{letters}{"08}
+\DeclareMathSymbol\Psi \mathord{letters}{"09}
+\DeclareMathSymbol\Omega \mathord{letters}{"0A}
+% \end{macrocode}
+% Euler doesn't have the special variants of |\sigma| and |\rho|:
+% \begin{macrocode}
+\let\varsigma=\sigma
+\let\varrho=\rho
+% \end{macrocode}
+%
+% \begin{macro}{\mathbf}
+% If the \euler\ package is loaded with the \texttt{mathbf}
+% option, |\mathbf| should produce bold Euler Roman letters and
+% digits.
+% \begin{macrocode}
+\DeclareOption{mathbf}
+ {\AtBeginDocument{\DeclareMathAlphabet\mathbf{U}{eur}{b}{n}}}
+% \end{macrocode}
+% \end{macro}
+% Note the use of |\AtBeginDocument|; it ensures that the redefinition
+% overrides the default settings (Section~\ref{text-fonts}).
+%
+% \subsection{Euler Fraktur}
+%
+% \begin{macro}{\mathfrak}
+% The Euler Fraktur fonts get their own math symbol font. We define a
+% math alphabet identifier---|\mathfrak|---to access this symbol font.
+% For compatibility with previous versions of the \euler\
+% package, we define |\frak| as an alias for |\mathfrak| (the
+% \texttt{amsfonts} package also provides this alias).
+% \begin{macrocode}
+\DeclareSymbolFont{EulerFraktur}{U}{euf}{m}{n}
+\SetSymbolFont{EulerFraktur}{bold}{U}{euf}{b}{n}
+\DeclareSymbolFontAlphabet\mathfrak{EulerFraktur}
+\@ifpackageloaded{amsfonts}{}{\newcommand\frak{\mathfrak}}
+% \end{macrocode}
+% \end{macro}
+%
+% The following characters come from the Euler Fraktur symbol font (as
+% defined in \texttt{gkpmac.tex}):
+% \begin{macrocode}
+\DeclareMathSymbol{!}\mathord {EulerFraktur}{"21}
+\DeclareMathSymbol{(}\mathopen {EulerFraktur}{"28}
+\DeclareMathSymbol{)}\mathclose{EulerFraktur}{"29}
+\DeclareMathSymbol{+}\mathbin {EulerFraktur}{"2B}
+\DeclareMathSymbol{-}\mathbin {EulerFraktur}{"2D}
+\DeclareMathSymbol{=}\mathrel {EulerFraktur}{"3D}
+\DeclareMathSymbol{[}\mathopen {EulerFraktur}{"5B}
+\DeclareMathSymbol{]}\mathclose{EulerFraktur}{"5D}
+% \end{macrocode}
+% There is a curious detail here: The type of `!' is |\mathclose| in
+% \texttt{plain.tex} (and standard \LaTeX) but |\mathord| in
+% \texttt{gkpmac.tex}. The reason for this is probably that one
+% should not use Euler punctuation characters as part of the
+% text,\footnote{In particular, one should watch out for punctuation
+% characters in displays: Is, e.g., an exclamation point part of a
+% formula or part of the text? (With Computer Modern, it didn't
+% really matter, but it does matter with Euler!)} and punctuation
+% characters in math are usually operators. E.g., in CSP
+% (Communicating Sequential Processes), `!'~denotes an output
+% operation, a tightly binding binary operator; there is usually no
+% space around this operator (to indicate the high precedence).
+%
+% The Euler Fraktur symbol font contains more punctuation characters
+% than defined above. We want to use these characters as they look
+% better when they appear in math formulas (there are some strange
+% looking formulas in~\cite{concrete}). Even if one may argue that,
+% e.g., semicolon is most often used in the text sense (in displays),
+% it is more consistent and easier to remember if everything in math
+% mode is Euler.
+% \begin{macrocode}
+\DeclareMathSymbol{"}\mathord {EulerFraktur}{"7D}
+\DeclareMathSymbol{&}\mathord {EulerFraktur}{"26}
+\DeclareMathSymbol{:}\mathrel {EulerFraktur}{"3A}
+\DeclareMathSymbol{;}\mathpunct{EulerFraktur}{"3B}
+\DeclareMathSymbol{?}\mathord {EulerFraktur}{"3F}
+\DeclareMathSymbol{^}\mathord {EulerFraktur}{"5E}
+\DeclareMathSymbol{`}\mathord {EulerFraktur}{"12}
+% \end{macrocode}
+% Here, we also changed the type of `?' to |\mathord| to be consistent
+% with the type of~`!'. Regarding the math codes assigned by
+% \texttt{INITEX}: The Euler fonts do not have the glyphs for |\#|,
+% |\$|, |\%|, and \texttt{@}, so these glyphs are still taken from the
+% text fonts. Note also that we do not set the math code for the
+% other quote character: it is active in math mode (code
+% \texttt{"8000}); it produces primes (and should continue to do so).
+% \begin{macrocode}
+\DeclareMathDelimiter{(}{EulerFraktur}{"28}{largesymbols}{"00}
+\DeclareMathDelimiter{)}{EulerFraktur}{"29}{largesymbols}{"01}
+\DeclareMathDelimiter{[}{EulerFraktur}{"5B}{largesymbols}{"02}
+\DeclareMathDelimiter{]}{EulerFraktur}{"5D}{largesymbols}{"03}
+% \end{macrocode}
+%
+% \begin{macro}{\oldstylenums}
+% \begin{macro}{\TextOldstyle}\begin{macro}{\MathOldstyle}
+% We provide a new definition of the |\oldstylenums| macro: this
+% definition allows us to modify the generation of non-aligning (aka
+% ``oldstyle'') numerals in text and in math separately, using two
+% hooks, |\TextOldstyle| and |\MathOldstyle|.
+% \begin{macrocode}
+\DeclareRobustCommand\oldstylenums[1]%
+ {\begingroup
+ \spaceskip\fontdimen\tw@\font
+ \TextOldstyle \MathOldstyle #1%
+ \endgroup}
+% \end{macrocode}
+% In math, the |\oldstylenums| macro should produce Euler oldstyle
+% digits (located in the Euler Fraktur fonts):
+% \begin{macrocode}
+\def\MathOldstyle{\mathgroup\symEulerFraktur}
+% \end{macrocode}
+% By default, oldstyle digits in text come from the Computer Modern
+% fonts:
+% \begin{macrocode}
+\providecommand\TextOldstyle{\usefont{OML}{cmm}\f@series{it}}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \subsection{Euler Script}
+%
+% \begin{macro}{\mathscr}
+% Like the Euler Fraktur fonts, the Euler Script fonts also get their
+% own symbol font. We define a math alphabet
+% identifier---|\mathscr|---to access this symbol font. For
+% compatibility with previous versions of the \euler\ package,
+% we define |\scr| as an alias for |\mathscr|.
+% \begin{macrocode}
+\DeclareSymbolFont{EulerScript}{U}{eus}{m}{n}
+\SetSymbolFont{EulerScript}{bold}{U}{eus}{b}{n}
+\DeclareSymbolFontAlphabet\mathscr{EulerScript}
+\newcommand\scr{\mathscr}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mathcal}
+% If the \euler\ package is loaded with the \texttt{mathcal}
+% option, |\mathcal| should produce Euler Script letters.
+% \begin{macrocode}
+\DeclareOption{mathcal}{\renewcommand\mathcal{\mathscr}}
+% \end{macrocode}
+% \end{macro}
+%
+% The following is equivalent to the definitions in \texttt{gkpmac.tex}
+% concerning the Euler Script fonts:
+% \begin{macrocode}
+\DeclareMathSymbol\aleph\mathord{EulerScript}{"40}
+%\DeclareMathSymbol\equiv\mathrel{EulerScript}{"11}
+%\let\cong=\equiv % lowres bars weren't spaced right
+%\DeclareMathSymbol\leq \mathrel{EulerScript}{"14}
+%\let\le=\leq % seems to have been eliminated
+%\DeclareMathSymbol\geq \mathrel{EulerScript}{"15}
+%\let\ge=\geq % ditto
+\DeclareMathSymbol\Re \mathord{EulerScript}{"3C}
+\DeclareMathSymbol\Im \mathord{EulerScript}{"3D}
+% \end{macrocode}
+% Knuth used a slightly different version of the Euler Script fonts
+% that had special `$\le$' and `$\ge$' glyphs. Actually, the source
+% for the AMS Euler Script medium (but not the bold) font also
+% contains these glyphs; however, they are commented out (no
+% explanation is given). The definitions of |\equiv| and |\cong| are
+% also commented out in \texttt{gkpmac.tex} (with the reason as given
+% above, i.e., problems with low resolution rendering).
+% \begin{macrocode}
+\DeclareMathDelimiter\vert
+ \mathord{EulerScript}{"6A}{largesymbols}{"0C}
+\DeclareMathDelimiter\backslash
+ \mathord{EulerScript}{"6E}{largesymbols}{"0F}
+% \end{macrocode}
+%
+% The Euler Script fonts constitute a partial replacement for the
+% Computer Modern `symbols' math symbol fonts. (None of the remaining
+% definitions in this section were included in \texttt{gkpmac.tex}.)
+% \begin{macrocode}
+%\DeclareMathSymbol{-}\mathbin{EulerScript}{"00} % already done
+\DeclareMathSymbol{|}\mathord{EulerScript}{"6A}
+\DeclareMathDelimiter{|}{EulerScript}{"6A}{largesymbols}{"0C}
+% \end{macrocode}
+% (The minus signs in the Euler Fraktur and Script fonts are
+% identical, i.e., the sources are identical.)
+% \begin{macrocode}
+\DeclareMathSymbol\neg \mathord{EulerScript}{"3A}
+\let\lnot=\neg
+\DeclareMathSymbol\wedge \mathbin{EulerScript}{"5E}
+\let\land=\wedge
+\DeclareMathSymbol\vee \mathbin{EulerScript}{"5F}
+\let\lor=\vee
+\DeclareMathSymbol\setminus\mathbin{EulerScript}{"6E}
+\DeclareMathSymbol\sim \mathrel{EulerScript}{"18}
+\DeclareMathSymbol\mid \mathrel{EulerScript}{"6A}
+\DeclareMathDelimiter\arrowvert
+ \mathord{EulerScript}{"6A}{largesymbols}{"3C} % ???
+% \end{macrocode}
+% (There are no |\approx| or |\simeq| to go with |\sim|.) In Plain
+% \TeX\null, the characters |{|, |\|, and~|}| are assigned math codes
+% (and |\| is also given a delimiter code); these are the only visible
+% ASCII (7-bit) characters that we don't give a math code (we don't
+% assign math codes to any of the invisible ASCII characters).
+%
+% The Euler Script fonts also contain a section sign~(\S):
+% \begin{macrocode}
+\DeclareMathSymbol\mathsection\mathord{EulerScript}{"78}
+% \end{macrocode}
+%
+% \subsection{Euler Extension}
+%
+% We allocate a new symbol font group for this font:
+% \begin{macrocode}
+\DeclareSymbolFont{EulerExtension}{U}{euex}{m}{n}
+% \end{macrocode}
+% This font contains some alternative versions of some Computer Modern
+% symbols. The \texttt{amsmath} package (part of AMS-\LaTeX)
+% redefines the |\coprod|, |\prod|, and |\sum| symbols; to make the
+% \euler\ package work correctly with the \texttt{amsmath}
+% package, we need to take different actions depending on whether the
+% \texttt{amsmath} package has been loaded before the \euler\
+% package or not. Note: This will \emph{not} work with the
+% \texttt{amstex} package.
+% \begin{macrocode}
+\@ifpackageloaded{amsmath}
+ {\DeclareMathSymbol\coprod@\mathop{EulerExtension}{"60}%
+ \DeclareMathSymbol\prod@ \mathop{EulerExtension}{"51}%
+ \DeclareMathSymbol\sum@ \mathop{EulerExtension}{"50}}
+ {\DeclareMathSymbol\coprod \mathop{EulerExtension}{"60}%
+ \DeclareMathSymbol\prod \mathop{EulerExtension}{"51}%
+ \DeclareMathSymbol\sum \mathop{EulerExtension}{"50}}
+% \end{macrocode}
+% We shall respectfully ask the user not to use the \texttt{amstex}
+% package.
+% \begin{macrocode}
+\AtBeginDocument
+ {\@ifpackageloaded{amstex}%
+ {\PackageWarningNoLine{euler}{Please do not use `amstex'.
+ Use `amsmath' instead}{}}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareMathSymbol\intop \mathop {EulerExtension}{"52}
+\DeclareMathSymbol\ointop \mathop {EulerExtension}{"48}
+\DeclareMathSymbol\braceld\mathord{EulerExtension}{"7A}
+\DeclareMathSymbol\bracerd\mathord{EulerExtension}{"7B}
+\DeclareMathSymbol\bracelu\mathord{EulerExtension}{"7C}
+\DeclareMathSymbol\braceru\mathord{EulerExtension}{"7D}
+\DeclareMathSymbol\infty \mathord{EulerExtension}{"31}
+% \end{macrocode}
+% It is not enough to substitute the Euler integral sign for the
+% Computer Modern integral sign, if we are using the \texttt{amsmath}
+% package. The multiple integral signs will look bad. The following
+% will make them look better.
+% \begin{macrocode}
+\AtBeginDocument
+ {\@ifpackageloaded{amsmath}%
+ {\def\intkern@{\mkern -6mu }%
+ \def\ints@#1{\mkern -3mu
+ \mathop{\mkern 3mu
+ \intop
+ \ifnum #1=\z@ \intdots@ \else
+ \intkern@
+ \ifnum #1>\tw@ \intop\intkern@
+ \ifnum #1>\thr@@ \intop\intkern@ \fi
+ \fi
+ \fi
+ \intop
+ }\ilimits@
+ }%
+ }{}}
+% \end{macrocode}
+% All Euler arrows come from the Euler Extension font:
+% \begin{macrocode}
+\DeclareMathSymbol\nearrow\mathrel{EulerExtension}{"25}
+\DeclareMathSymbol\searrow\mathrel{EulerExtension}{"26}
+\DeclareMathSymbol\nwarrow\mathrel{EulerExtension}{"2D}
+\DeclareMathSymbol\swarrow\mathrel{EulerExtension}{"2E}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareMathSymbol\Leftrightarrow\mathrel{EulerExtension}{"2C}
+\DeclareMathSymbol\Leftarrow \mathrel{EulerExtension}{"28}
+\DeclareMathSymbol\Rightarrow \mathrel{EulerExtension}{"29}
+\DeclareMathSymbol\leftrightarrow\mathrel{EulerExtension}{"24}
+\DeclareMathSymbol\leftarrow \mathrel{EulerExtension}{"20}
+\let\gets=\leftarrow
+\DeclareMathSymbol\rightarrow \mathrel{EulerExtension}{"21}
+\let\to=\rightarrow
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareMathDelimiter\uparrow
+ \mathrel{EulerExtension}{"22}{largesymbols}{"78}
+\DeclareMathDelimiter\downarrow
+ \mathrel{EulerExtension}{"23}{largesymbols}{"79}
+\DeclareMathDelimiter\updownarrow
+ \mathrel{EulerExtension}{"6C}{largesymbols}{"3F}
+\DeclareMathDelimiter\Uparrow
+ \mathrel{EulerExtension}{"2A}{largesymbols}{"7E}
+\DeclareMathDelimiter\Downarrow
+ \mathrel{EulerExtension}{"2B}{largesymbols}{"7F}
+\DeclareMathDelimiter\Updownarrow
+ \mathrel{EulerExtension}{"6D}{largesymbols}{"77}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareMathSymbol\leftharpoonup \mathrel{EulerExtension}{"18}
+\DeclareMathSymbol\leftharpoondown \mathrel{EulerExtension}{"19}
+\DeclareMathSymbol\rightharpoonup \mathrel{EulerExtension}{"1A}
+\DeclareMathSymbol\rightharpoondown\mathrel{EulerExtension}{"1B}
+% \end{macrocode}
+%
+% Note the funny mixture of the Euler Script and Extension fonts:
+% \begin{macrocode}
+\DeclareMathDelimiter\lbrace
+ \mathopen{EulerScript}{"66}{EulerExtension}{"08}
+\DeclareMathDelimiter\rbrace
+ \mathclose{EulerScript}{"67}{EulerExtension}{"09}
+% \end{macrocode}
+%
+% \section{More math}
+%
+% Actually, we still need some Computer Modern fonts: We need the
+% equals sign for long/extensible (horizontal) double arrows, and we
+% need the minus sign for the single arrows! The Euler Extension font
+% is based on the \MF\ code for Computer Modern, and we need the
+% Computer Modern equals and minus signs to make long/extensible arrows.
+%
+% We allocate math alphabets to produce the equals and minus signs for
+% arrows. Note that since Euler arrows are only available in medium
+% weight (they come from the Euler Extension font which is only
+% available in medium weight), we let all math versions of these math
+% alphabets refer to medium weight fonts.
+% \begin{macrocode}
+\DeclareMathAlphabet\cm@equals@alphabet{OT1}{cmr}{m}{n}
+\DeclareMathAlphabet\cm@minus@alphabet{OMS}{cmsy}{m}{n}
+% \end{macrocode}
+% Note that we use OT1 encoding for the |\cm@equals@alphabet|, even
+% though T1 encoding may be the default for the users system.
+%
+% Also, note that we already have the Computer Modern \texttt{cmsy}
+% family assigned to a symbol font (namely the `symbols' symbol font).
+% However, taking the minus sign directly from this symbol font would
+% make long/extensible arrows come out wrong in the `bold' math
+% version. (It is perhaps ``overkill'' to allocate a math alphabet
+% just for this purpose?)
+%
+% \begin{macro}{\Relbar}\begin{macro}{\relbar}
+% The long arrows are made using the macros |\Relbar| (for double
+% arrows) and |\relbar| (for single arrows). The standard \LaTeX\
+% definitions of these macros use the `\texttt{=}' and `\texttt{-}'
+% characters to produce the extension part of the long arrows. Since
+% we have changed the math codes of these characters (they are now
+% taken from the Euler Fraktur fonts in math mode), we have to
+% redefine the |\Relbar| and |\relbar| macros.
+% \begin{macrocode}
+\def\Relbar{\mathrel{\cm@equals@alphabet{\mathchar"703D}}}
+\def\cm@minus{{\cm@minus@alphabet{\mathchar"7000}}}
+\def\relbar{\mathrel{\smash\cm@minus}}
+ % \smash, because - has the same height as +
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\leftarrowfill}\begin{macro}{\rightarrowfill}
+% Unfortunately, since the definitions of the ``arrow-filling'' macros
+% (|\leftarrowfill| and |\rightarrowfill|) in standard \LaTeX\ still
+% use explicit minus signs (instead of |\relbar|), we also have to
+% redefine those macros:
+% \begin{macrocode}
+\def\leftarrowfill
+ {$\m@th\mathord\leftarrow\mkern-6mu%
+ \cleaders\hbox{$\mkern-2mu\cm@minus\mkern-2mu$}\hfill
+ \mkern-6mu\cm@minus$}
+\def\rightarrowfill
+ {$\m@th\cm@minus\mkern-6mu%
+ \cleaders\hbox{$\mkern-2mu\cm@minus\mkern-2mu$}\hfill
+ \mkern-6mu\mathord\rightarrow$}
+% \end{macrocode}
+% We have defined |\cm@minus| to produce a Computer Modern minus sign
+% of type |\mathord|. We thereby save a few |\mathord| tokens
+% (compared to the definitions of |\leftarrowfill| and
+% |\rightarrowfill| in standard \LaTeX).
+% \end{macro}\end{macro}
+%
+% There are a few symbols in the original Computer Modern Math Italic
+% fonts that are not present in the Euler fonts. We simply take them
+% from the CM fonts.
+% \begin{macrocode}
+\DeclareSymbolFont{cmmigroup}{OML}{cmm}{m}{it}
+\SetSymbolFont{cmmigroup}{bold}{OML}{cmm}{b}{it}
+\DeclareMathAccent\vec \mathord{cmmigroup}{"7E}
+\DeclareMathSymbol\triangleleft \mathbin{cmmigroup}{"2F}
+\DeclareMathSymbol\triangleright\mathbin{cmmigroup}{"2E}
+\DeclareMathSymbol\star \mathbin{cmmigroup}{"3F}
+\DeclareMathSymbol\lhook \mathrel{cmmigroup}{"2C}
+\DeclareMathSymbol\rhook \mathrel{cmmigroup}{"2D}
+\DeclareMathSymbol\flat \mathord{cmmigroup}{"5B}
+\DeclareMathSymbol\natural \mathord{cmmigroup}{"5C}
+\DeclareMathSymbol\sharp \mathord{cmmigroup}{"5D}
+\DeclareMathSymbol\smile \mathrel{cmmigroup}{"5E}
+\DeclareMathSymbol\frown \mathrel{cmmigroup}{"5F}
+% \end{macrocode}
+% Note that the arrow head of |\vec| is slanted; this looks a bit
+% strange in combination with an upright font such as Euler Roman.
+%
+% Also, note that in the `bold' math version, arrows with hooks will
+% come out wrong (the hooks will be bold, but the arrow heads will be
+% of medium weight). This can be repaired in a similar way as the
+% long/extensible arrows, but is it worth it to allocate a math
+% alphabet just for this purpose?
+%
+% Finally, Knuth wanted a little extra space before the prime
+% superscript:
+% \begin{macrocode}
+\begingroup
+ \catcode`\'=\active
+ \gdef'{^\bgroup\mskip2mu\prim@s} % more space before '
+\endgroup
+% \end{macrocode}
+%
+% Open question: The |\dots| and |\ldots| macros produce dots
+% (periods) from the Euler fonts; the |\ddots| and |\vdots| macros
+% produce dots from the text font; and the |\cdots| macro produces
+% dots from the Computer Modern `symbols' math symbol font. Should we
+% do something about this?
+%
+% \section{Text fonts in math}\label{text-fonts}
+%
+% The text fonts used in math through math alphabets and the
+% `operators' symbol font should be the same as the fonts used for the
+% main text. (It is now easy to replace the fonts for the `operators'
+% symbol font, since the uppercase greek letters are now taken from
+% the Euler Roman fonts.)
+%
+% In order to reduce the total number of fonts needed, we shall---if
+% possible---use text fonts in the same encoding for both text and
+% math. We therefore determine whether T1 encoding has been selected
+% as the default encoding. We define a switch---|\ifCorkEncoding|---for
+% that purpose.
+% \begin{macrocode}
+\newif\ifCorkEncoding
+\edef\@tempa{\encodingdefault}\def\@tempb{T1}
+\ifx\@tempa\@tempb
+ \CorkEncodingtrue
+\else
+ \CorkEncodingfalse
+\fi
+% \end{macrocode}
+% Note that we determine the encoding to use at the time the \euler\
+% package is loaded (\emph{not} at the end of the preamble). This
+% allows the user to retain OT1 encoding for text fonts used in math
+% (other packages may depend on that) by selecting T1 encoding
+% \emph{after} the \euler\ package has been loaded.
+%
+% We redefine the `operators' symbol font and all math alphabets
+% defined by the \LaTeX\ kernel. Due to the current implementation of
+% math accents that take their glyphs from text fonts, all text fonts
+% must be used in a common encoding. The only \LaTeX\ `base' package
+% that defines extra math alphabets is the \texttt{oldlfont} package.
+% However, this package cannot be used together with the \euler\
+% package (it allocates too many symbol fonts). In other words, the
+% following setup should suffice for most users.
+% \begin{macrocode}
+\ifCorkEncoding
+ \AtBeginDocument
+ {\DeclareSymbolFont{operators}{T1}\rmdefault\mddefault\updefault
+ \SetSymbolFont{operators}{bold}{T1}\rmdefault\bfdefault\updefault
+ \DeclareMathAlphabet\mathbf{T1}\rmdefault\bfdefault\updefault
+ \DeclareMathAlphabet\mathsf{T1}\sfdefault\mddefault\updefault
+ \DeclareMathAlphabet\mathit{T1}\rmdefault\mddefault\itdefault
+ \DeclareMathAlphabet\mathtt{T1}\ttdefault\mddefault\updefault
+ \SetMathAlphabet\mathsf{bold}{T1}\sfdefault\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}{T1}\rmdefault\bfdefault\itdefault}
+\else
+ \AtBeginDocument
+ {\DeclareSymbolFont{operators}{OT1}\rmdefault\mddefault\updefault
+ \SetSymbolFont{operators}{bold}{OT1}\rmdefault\bfdefault\updefault
+ \DeclareMathAlphabet\mathbf{OT1}\rmdefault\bfdefault\updefault
+ \DeclareMathAlphabet\mathsf{OT1}\sfdefault\mddefault\updefault
+ \DeclareMathAlphabet\mathit{OT1}\rmdefault\mddefault\itdefault
+ \DeclareMathAlphabet\mathtt{OT1}\ttdefault\mddefault\updefault
+ \SetMathAlphabet\mathsf{bold}{OT1}\sfdefault\bfdefault\updefault
+ \SetMathAlphabet\mathit{bold}{OT1}\rmdefault\bfdefault\itdefault}
+\fi
+% \end{macrocode}
+% Note that we perform the setup at the end of the preamble (and not
+% while the \euler\ package is being input). This implies that any
+% changes made to, e.g., |\rmdefault| by a package loaded after the
+% \euler\ package are seen.
+%
+% The standard \LaTeX\ math setup assumes that OT1 encoded text fonts
+% are used in math. When using T1 encoded fonts, we have to redefine
+% the macros that access accents from the text fonts.
+% \begin{macrocode}
+\ifCorkEncoding
+ \DeclareMathAccent\grave\mathalpha{operators}{"00}
+ \DeclareMathAccent\acute\mathalpha{operators}{"01}
+ \DeclareMathAccent\tilde\mathalpha{operators}{"03}
+ \DeclareMathAccent\ddot \mathalpha{operators}{"04}
+ \DeclareMathAccent\check\mathalpha{operators}{"07}
+ \DeclareMathAccent\breve\mathalpha{operators}{"08}
+ \DeclareMathAccent\bar \mathalpha{operators}{"09}
+ \DeclareMathAccent\dot \mathalpha{operators}{"0A}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\hat}
+% There is one more accent that is normally taken from the `operators'
+% symbol font, namely the |\hat| accent. This is the only accent
+% provided by the Euler fonts; we shall use this accent by default.
+% (A curious fact is that Knuth devoted a fairly large portion of
+% \texttt{gkpmac.tex} to the construction of a $\phi$ with a hat
+% accent---using the |\widehat| macro).
+% \begin{macrocode}
+\DeclareMathAccent\hat\mathalpha{EulerFraktur}{"5E}
+% \end{macrocode}
+% However, some users do not like this |\hat| accent. They prefer the
+% accent glyph to be taken from the text font (similar to the other
+% accents).
+% \begin{macrocode}
+\DeclareOption{text-hat-accent}
+ {\ifCorkEncoding
+ \DeclareMathAccent\hat\mathalpha{operators}{"02}%
+ \else
+ \DeclareMathAccent\hat\mathalpha{operators}{"5E}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hbar}
+% The |\hbar| macro in standard \LaTeX\ is composed of the letter~`h'
+% from the `letters' symbol font and the macron (`bar') accent from
+% the `operators' symbol font. With the `letters' symbol font now
+% being Euler Roman, the bar is no longer positioned correctly. We
+% choose the following definition (the \texttt{9mu} in the original
+% definition has been changed to \texttt{8mu}):
+% \begin{macrocode}
+\ifCorkEncoding
+ \DeclareMathSymbol\euler@hbar\mathord{operators}{"09}
+\else
+ \DeclareMathSymbol\euler@hbar\mathord{operators}{"16}
+\fi
+\def\hbar{{\euler@hbar\mkern-8muh}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Footnotes}\label{footnotes}
+%
+% \begin{macro}{\@makefnmark}
+% Footnote numbers are not math entities, so they should be produced
+% by digits from the text font. Since footnote markers (whether they
+% are numbers or symbols) are produced in math mode, we can accomplish
+% this by selecting |\operator@font|; this will cause digits to be
+% taken from the `operators' symbol font (which is the same as the
+% font used for text; see previous section).
+% \begin{macrocode}
+\def\@makefnmark{\hbox{$\operator@font^{\@thefnmark}\m@th$}}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Processing options}
+%
+% Finally, we must remember to process the options:
+% \begin{macrocode}
+\ProcessOptions
+%</package>
+% \end{macrocode}
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/euler/euler.ins b/Master/texmf-dist/source/latex/euler/euler.ins
new file mode 100644
index 00000000000..e8f009cf0b1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/euler/euler.ins
@@ -0,0 +1,11 @@
+%%
+%% Copyright (C) 1992 Frank Jensen. All rights reserved.
+%% Copyright (C) 1993--1995 Frank Jensen and Frank Mittelbach.
+%% All rights reserved.
+%%
+\def\batchfile{euler.ins}
+\input docstrip.tex
+\keepsilent
+\preamble
+\endpreamble
+\generateFile{euler.sty}{f}{\from{euler.dtx}{package}}
diff --git a/Master/texmf-dist/source/latex/euler/legal.txt b/Master/texmf-dist/source/latex/euler/legal.txt
new file mode 100644
index 00000000000..568ee1083c3
--- /dev/null
+++ b/Master/texmf-dist/source/latex/euler/legal.txt
@@ -0,0 +1,13 @@
+ The files of this package "euler" 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.
+
+ The complete listing of files covered by this license is
+ euler.dtx
+ euler.ins
+
+ May 2002, Thomas Esser with permission of the copyright owner.
diff --git a/Master/texmf-dist/source/latex/float/float.dtx b/Master/texmf-dist/source/latex/float/float.dtx
new file mode 100644
index 00000000000..af6a35b68ad
--- /dev/null
+++ b/Master/texmf-dist/source/latex/float/float.dtx
@@ -0,0 +1,873 @@
+% \iffalse
+%% Package `float' to use with LaTeX 2e
+%% Copyright (C) 1991-2000 Anselm Lingnau, all rights reserved
+%%
+% This program can be redistributed and/or modified under the terms
+% of the LaTeX Project Public License distributed from CTAN archives
+% in the directory macros/latex/base/lppl.txt; either version 1 of
+% the License, or (at your option) any later version.
+%
+% $Id: float.dtx,v 1.8 2001/11/07 23:46:25 anselm Exp $
+%
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\ProvidesPackage{float}
+%<package> [2001/11/08 v1.3d Float enhancements (AL)]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{float}
+\GetFileInfo{float.sty}
+\EnableCrossrefs
+%\DisableCrossrefs % Say \DisableCrossrefs if index is ready
+\RecordChanges % Gather update information
+\CodelineIndex % Index code by line number
+\title{An Improved Environment for Floats\thanks{This file
+ has version number \fileversion.
+ Part of this style option is based on the \textsf{here} option
+ by David P. Carlisle (\texttt{carlisle@cs.man.ac.uk}),
+ who also provided helpful criticism.}}
+\author{Anselm Lingnau\\\texttt{anselm@strathspey.org}}%
+\date{\filedate}
+\floatstyle{ruled}
+\newfloat{Program}{tbp}{lop}[section]
+\floatstyle{plain}
+\newfloat{Example}{t}{lox}[section]
+\floatstyle{boxed}
+\restylefloat{table}
+\begin{document}
+\maketitle
+\DocInput{float.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{495}
+%
+% \changes{v1.3}{18 Jul 2001}{Changed some names to reduce namespace pollution}
+% \changes{v1.2d}{29 May 99}{License changed to LPPL}
+% \changes{v1.2}{20 Jun 94}{Adapted for LaTeX2e}
+% \changes{v1.1d}{17 Dec 92}{Fixed documentation}
+%
+% \DoNotIndex{\@Mii,\@Miv,\@cons,\@currlist,\@dblarg,\@dbldeferlist}
+% \DoNotIndex{\@dblfloat,\@dottedtocline,\@eha,\@ehd,\@Esphack,\@float}
+% \DoNotIndex{\@floatpenalty,\@gobble,\@ifnextchar,\@ifundefined,\@ifstar}
+% \DoNotIndex{\@latexerr,\@latex@error,\@minipagefalse,\@mkboth,\@namedef}
+% \DoNotIndex{\@nameuse,\@parboxrestore,\@setminipage,\@setnobreak,\@spaces}
+% \DoNotIndex{\@starttoc,\@tempa,\@tempboxa,\@tempdima,\@tempf,\@undefined}
+% \DoNotIndex{\@warning}
+% \DoNotIndex{\addcontentsline,\addtocontents,\addtocounter,\advance,\arabic}
+% \DoNotIndex{\begingroup,\bfseries,\bgroup,\begin,\box,\chapter}
+% \DoNotIndex{\color@endbox,\color@vbox,\columnwidth,\csname,\def,\dimen}
+% \DoNotIndex{\docdate,\edef,\egroup,\else,\end,\end@dblfloat,\end@float}
+% \DoNotIndex{\endcsname,\endgroup,\endinput,\expandafter,\fi}
+% \DoNotIndex{\filedate,\fileversion,\global,\hbadness,\hbox,\hfil,\hrule}
+% \DoNotIndex{\hsize,\ht,\if@twocolumn,\ifdim,\iffalse,\ifnum,\iftrue,\ifvoid}
+% \DoNotIndex{\ifx,\ignorespaces,\intextsep,\kern,\let,\long}
+% \DoNotIndex{\MakeUppercase,\moveleft,\newbox,\newcommand,\newcounter,\newif}
+% \DoNotIndex{\newsavebox,\newtoks,\noexpand,\normalcolor,\normalsize}
+% \DoNotIndex{\numberline,\outer@nobreak,\PackageError,\PackageWarning}
+% \DoNotIndex{\par,\parindent,\parskip,\penalty,\prevdepth,\protect}
+% \DoNotIndex{\providecommand,\refstepcounter,\relax,\renewcommand,\reset@font}
+% \DoNotIndex{\rmfamily,\section,\setbox,\setcounter,\setlength,\space}
+% \DoNotIndex{\textheight,\textwidth,\the,\typeout,\unvbox,\uppercase}
+% \DoNotIndex{\vadjust,\value,\vbox,\vrule,\vskip,\vspace,\wd,\xdef}
+% \DoNotIndex{\z@skip,\z@}
+%
+% \begin{abstract}
+% This style option improves the interface for defining floating
+% objects such as figures and tables in \LaTeX{}.
+% It adds the notion of a `float style' that governs appearance
+% of floats.
+% New kinds of floats may be defined using a |\newfloat| command
+% analogous to |\newtheorem|.
+% This style option also incorporates the functionality
+% of David Carlisle's style option \textsf{here},
+% giving floating environments a \texttt{[H]} option
+% which means `PUT IT HERE'
+% (as opposed to the standard \texttt{[h]} option which means
+% `You may put it here if you like').
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% Among the features of \LaTeX\ are `floating' figures and tables
+% that drift from where they appear in the input text to, say, the top
+% of a page. The contents and formatting of floats is pretty much up
+% to the user, except that there is a |\caption| command that
+% governs formatting of the caption --- it is centered if it is short,
+% and formatted as a paragraph if it is longer than a single line of text.
+% Sometimes other types of floating objects, e.g., algorithms or programs,
+% are desirable, but they must be defined by analogy to the existing
+% floats since there is no simple command for doing this. This goes
+% beyond the knowledge or inclination of the average \LaTeX\ user.
+%
+% In this style option, I present an interface to floating objects
+% that attempts to fix some of these shortcomings.
+% First of all, I introduce the notion of a `float style'.
+% A float style governs the appearance of a class of floats like a page style
+% governs the appearance of a page (\LaTeX\ has page styles \texttt{plain},
+% \texttt{empty} and \texttt{headings}, among others). This style option
+% provides some exemplary float styles:
+% \begin{description}
+% \item[plain] This is the float style that \LaTeX\ normally applies to
+% its floats, i.e., nothing in particular. The only difference is
+% that the caption comes out \emph{below} the body of the float,
+% regardless of where it is given in the text.
+% \item[plaintop] This is similar to `plain' but the caption always
+% comes out \emph{above} the body of the float.
+% \item[boxed] The body of the float is printed inside a box. The caption
+% goes below that box.
+% \item[ruled] This float style is patterned on the table style of
+% {\sl Concrete Mathematics}. The caption is printed at the top of the
+% float, surrounded by rules; another rule finishes off the float.
+% \end{description}
+%
+% \begin{Program}
+% \begin{verbatim}
+% #include <stdio.h>
+%
+% int main(int argc, char **argv)
+% {
+% int i;
+% for (i = 0; i < argc; ++i)
+% printf("argv[%d] = %s\n", i, argv[i]);
+% return 0;
+% }
+% \end{verbatim}
+% \caption{The first program. This hasn't got anything to do with the package
+% but is included as an example. Note the \texttt{ruled} float style.%
+% \label{prog1.1}}
+% \end{Program}
+% To facilitate the definition of new floating objects, \textsf{float}
+% supports the |\newfloat| command. This command is comparable to
+% |\newtheorem| in that it allows the user to add a new class of floats
+% at the document level. No style option hacking is necessary.
+% There's also a |\listof| command that prints a listing of all the
+% floats of a given type, like |\listoffigures| and |\listoftables|
+% in vanilla \LaTeX.
+%
+% \section{The User Interface --- New Floats}
+%
+% \DescribeMacro{\newfloat}
+% The most important command in \textsf{float} is the |\newfloat|
+% command. As mentioned above, it is patterned on |\newtheorem|.
+% The |\newfloat| command takes three required and one optional
+% argument; it is of the form\\[2pt]
+% \hspace*{\MacroIndent}|\newfloat{|\meta{type}|}{|^^A
+% \meta{placement}|}{|\meta{ext}|}[|\meta{within}{\tt]}\\[2pt]
+% \meta{type} is the `type' of the new class of floats, like \texttt{program}
+% or \texttt{algorithm}. After the appropriate |\newfloat|, commands
+% like |\begin{program}| or |\end{algorithm*}| will be available.
+% \meta{placement} gives the default placement parameters for this class
+% of floats. The placement parameters are the same as in standard \LaTeX,
+% i.e., \texttt{t}, \texttt{b}, \texttt{p} and \texttt{h} for `top', `bottom',
+% `page' and `here', respectively.
+% When \LaTeX\ writes the captions to an auxiliary file for the list
+% of figures (or whatever), it'll use the job name followed by \meta{ext}
+% as a file name.
+% Finally, the optional argument \meta{within} determines whether floats
+% of this class will be numbered within some sectional unit of the document.
+% For example, if \meta{within}$=$\texttt{chapter}, the floats will be numbered
+% within chapters. (In standard \LaTeX, this happens with figures and tables
+% in the \textsf{report} and \textsf{book} document styles.)
+% As an example, Program~\ref{prog1.1} above was created by a command
+% sequence similar to that shown in the following Example.
+% \begin{Example}[H]
+% \begin{verse}
+% |\floatstyle{ruled}|\\
+% |\newfloat{Program}{tbp}{lop}[section]|\\
+% \dots\ loads o' stuff \dots\\
+% |\begin{Program}|\\
+% |\begin{verbatim}|\\
+% \dots\ program text \dots\\
+% |\end{verbatim}|\\
+% |\caption{|\dots\ caption \dots|}|\\
+% |\end{Program}|
+% \end{verse}
+% \caption{This is another silly floating Example. Except that this one
+% doesn't actually float because it uses the {\tt[H]} optional parameter
+% to appear \textbf{Here}. (Gotcha.)}
+% \end{Example}
+%
+% \DescribeMacro{\floatstyle}
+% The |\floatstyle| command sets a default float style. This float style
+% will be used for all the floats that are subsequently defined using
+% |\newfloat|, until another |\floatstyle| command appears.
+% The |\floatstyle| command takes one argument, the name of a float
+% style. For instance, |\floatstyle{ruled}|. Specifying a string that
+% does not name a valid float style is an error.
+%
+% \DescribeMacro{\floatname}
+% The |\floatname| command lets you define the \emph{float name} that
+% \LaTeX\ uses in the caption of a float, i.e., `Figure' for a figure
+% and so on. For example, |\floatname{program}{Program}|.
+% The |\newfloat| command sets the float name to its argument
+% \meta{type} if no other name has been specified before.
+%
+% \DescribeMacro{\floatplacement}
+% The |\floatplacement| command resets the default placement specifier
+% of a class of floats. E.g., |\floatplacement{figure}{tp}|.
+%
+% \DescribeMacro{\restylefloat}
+% The |\restylefloat| command is necessary to change styles for the
+% standard float types \texttt{figure} and \texttt{table}. Since these aren't
+% usually defined via |\newfloat|, they don't have a style associated
+% with them. Thus you have to say, for example,\\[2pt]
+% \hspace*{\MacroIndent}|\floatstyle{ruled}|\\
+% \hspace*{\MacroIndent}|\restylefloat{table}|\\[2pt]
+% to have tables come out \texttt{ruled}. The command also lets you change
+% style for floats that you define via |\newfloat|, although this
+% is, typographically speaking, not a good idea.
+% See table~\ref{table1} for an example.
+% There is a |\restylefloat*| command which will restyle an existing
+% float type but will keep the new float style from taking over the
+% |\caption| command. In this case the user is responsible for
+% handling their own captions.
+% \DeleteShortVerb{\|}
+% \begin{table} \def\B#1{$\displaystyle{n\choose#1}$}
+% \begin{center} \begin{tabular}{c|cccccccc}
+% $n$&\B0&\B1&\B2&\B3&\B4&\B5&\B6&\B7\\ \hline
+% 0 & 1\\
+% 1 & 1&1\\
+% 2 & 1&2&1\\
+% 3 & 1&3&3&1\\
+% 4 & 1&4&6&4&1\\
+% 5 & 1&5&10&10&5&1\\
+% 6 & 1&6&15&20&15&6&1\\
+% 7 & 1&7&21&35&35&21&7&1
+% \end{tabular} \end{center}
+% \caption{Pascal's triangle. This is a re-styled \LaTeX\ \texttt{table}.%
+% \label{table1}}
+% \end{table}
+% \MakeShortVerb{\|}
+%
+% \DescribeMacro{\listof}
+% The |\listof| command produces a list of all the floats of a given
+% class. Its syntax is\\[2pt]
+% \hspace*{\MacroIndent}|\listof{|\meta{type}|}{|\meta{title}^^A
+% |}|\\[2pt]
+% \meta{type} is the float type given in the |\newfloat| command.
+% \meta{title} is used for the title of the list as well as the headings
+% if the current page style includes them. Otherwise, the |\listof|
+% command is analogous to the built-in \LaTeX\ commands
+% |\listoffigures| and |\listoftables|.
+%
+% \section{The User Interface --- \texttt{[H]} Placement Specifier}
+%
+% Many people find \LaTeX's float placement specifiers too restrictive.
+% A Commonly Uttered Complaint (CUC) calls for a way to place a float
+% exactly at the spot where it occurs in the input file, i.e., to \emph{not}
+% have it float at all.
+% It seems that the \texttt{[h]} specifier should do that, but in fact it
+% only suggests to \LaTeX\ something along the lines of ``put the float
+% here if it's OK with you''. As it turns out, \LaTeX\ hardly ever feels
+% inclined to actually do that. This situation can be improved by
+% judicious manipulation of float style parameters.
+%
+% The same effect can be achieved by changing the actual method of
+% placing floats. David Carlisle's \textsf{here} option introduces a new float
+% placement specifier, namely \texttt{[H]}, which, when added to a float,
+% tells \LaTeX\ to ``put it HERE, period''. If there isn't enough space
+% left on the page, the float is carried over to the next page together
+% with whatever follows, even though there might still be room left for
+% some of that.
+% This style option provides the \texttt{[H]} specifier for newly defined
+% classes of floats as well as the predefined \texttt{figure}s and
+% \texttt{table}s, thereby superseding \textsf{here}. David suggests
+% that the \textsf{here} option be withdrawn from the archives in due course.
+%
+% The {\tt[H]} specifier may simply be added to the float as an optional
+% argument, like all the other specifiers.
+% It may \emph{not} be used in conjunction with any other placement
+% specifiers, so {\tt[Hhtbp]} is illegal.
+% Neither may it be used as the default placement specifier for a whole
+% class of floats.
+% The following table is
+% defined like this:
+% \begin{verse}
+% |\begin{table}[H]|\\
+% |\begin{tabular}{cl}|\\
+% |\tt t & Top of the page\\|\\
+% \dots\ more stuff \dots\\
+% \end{verse}
+% (It seems that I have to add some extraneous chatter here just so that
+% the float actually comes out right in the middle of a printed page.
+% When I \LaTeX ed the documentation just now it turned out that there
+% was a page break that fell exactly between the ``So now'' line and the
+% float. This wouldn't Prove Anything. Bother.)
+% So now we have the following float placement specifiers:
+% \begin{table}[H]
+% \begin{tabular}{cl}
+% \tt t & Top of the page\\
+% \tt b & Bottom of the page\\
+% \tt p & Page of floats\\
+% \tt h & Here, if possible\\
+% \tt H & Here, definitely
+% \end{tabular}
+% ^^A\caption{Could it be that this just needs a caption?}
+% \end{table}
+%
+% \StopEventually{\PrintIndex}
+%
+% \section{Implementation}
+%
+% \subsection{Basics}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% In \LaTeX, floats are assigned `type numbers' that are powers of~$2$.
+% Since there are only two classes of floats, their type numbers are
+% hardwired into the document styles. We need to be somewhat more flexible,
+% and thus we initialize a counter to hold the next type number to be
+% assigned. This counter will be incremented appropriately later.
+% \begin{macrocode}
+\newcounter{float@type}
+\@ifundefined{c@figure}%
+ {\setcounter{float@type}{1}}%
+ {\setcounter{float@type}{4}}
+% \end{macrocode}
+% To warm up, we'll look at some of the simpler commands first.
+% \begin{macro}{\floatstyle}
+% The |\floatstyle| command puts its argument into the
+% |\float@style| macro as the name of the new float style.
+% But if the argument doesn't denote a float style, an error message
+% is output instead: Each float style \meta{style} has a corresponding command
+% |\fs@|\meta{style} that contains the appropriate declarations.
+% If the control sequence |\fs@|\meta{arg} (which goes with the
+% argument \meta{arg} to |\floatstyle|) is undefined, i.e.,
+% equals |\relax| under |\ifx|, then the float style \meta{arg}
+% is unknown, and we call |\float@error{|\meta{arg}|}| for the
+% error message.
+% \begin{macrocode}
+\newcommand\floatstyle[1]{\@ifundefined{fs@#1}%
+ {\float@error{#1}}%
+ {\def\float@style{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\float@error}
+% Here's the error message. |\@eha| is the help message that says
+% `Your command was ignored.'
+% \begin{macrocode}
+\newcommand\float@error[1]{\PackageError{float}{%
+ Unknown float style `#1'
+}{\@eha}}
+% \end{macrocode}
+% \end{macro}
+%
+% The next two commands are even simpler. \LaTeX\ says that
+% |\fps@|\meta{float} contains the default placement specifier for
+% the class of floats \meta{float}. |\fname@|\meta{float} expands
+% to the name that appears in \meta{float} captions, e.g., `Figure'.
+% (This is our own definition.)
+% \begin{macrocode}
+\newcommand\floatname[2]{\@namedef{fname@#1}{#2}}
+\newcommand\floatplacement[2]{\@namedef{fps@#1}{#2}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\floatevery[2]{\csname @float@every@#1\endcsname={#2}}
+% \end{macrocode}
+% \begin{macro}{\restylefloat}
+% The |\restylefloat| command sets up everything so that subsequent
+% commands like |\begin{|\meta{float}|}| use the appropriate
+% float style. It defines |\fst@|\meta{float} to expand to a command
+% that sets up the currently selected float style (|\fs@|\meta{style}).
+% Then it defines the commands |\begin{|\meta{float}|}|,
+% |\end{|\meta{float}|}|, |\begin{|\meta{float}|*}| and
+% |\end{|\meta{float}|*}|. The |\restylefloat*| command is like
+% |\restylefloat| but will leave the captions of that float type
+% alone.
+% \changes{v1.3c}{17 Aug 2001}{Remove token register leak}
+% \changes{v1.3a}{15 Aug 2001}{Introduce star form of `restylefloat}
+% \begin{macrocode}
+\newcommand\restylefloat{\@ifstar\float@restyle@\float@restyle}
+\newcommand\float@restyle@[1]{\float@restyle{#1}%
+ \expandafter\let\csname @float@c@#1\endcsname=\@caption}
+\newcommand\float@restyle[1]{\expandafter\edef\csname
+ fst@#1\endcsname{\expandafter\noexpand\csname
+ fs@\float@style\endcsname}%
+ \@namedef{#1}{\@nameuse{fst@#1}%
+ \@float@setevery{#1}\@float{#1}}%
+ \@namedef{#1*}{\@nameuse{fst@#1}%
+ \@float@setevery{#1}\@dblfloat{#1}}%
+ \expandafter\let\csname end#1\endcsname\float@end
+ \expandafter\let\csname end#1*\endcsname\float@dblend
+ \expandafter\let\csname @float@c@#1\endcsname=\float@caption
+ \@ifundefined{@float@every@#1}{%
+ \expandafter\newtoks\csname @float@every@#1\endcsname}{}%
+ \@nameuse{@float@every@#1}={}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newfloat}
+% Now we can explain how to define a new class of floats. Recall that
+% the three required arguments to |\newfloat| are \meta{type},
+% \meta{placement} and \meta{ext}, respectively. First we save the
+% latter two; we also maintain a list of active \meta{ext}s so we can
+% later iterate over all currently-open lists of floats.
+% \begin{macrocode}
+\newtoks\float@exts
+\newcommand\newfloat[3]{\@namedef{ext@#1}{#3}
+ \let\float@do=\relax
+ \xdef\@tempa{\noexpand\float@exts{\the\float@exts \float@do{#3}}}%
+ \@tempa
+ \floatplacement{#1}{#2}%
+% \end{macrocode}
+% Then we figure out a default value for the `caption name' of this
+% class of floats. If the |\fname@|\meta{type} isn't already defined,
+% we tentatively use \meta{type} as the name. This is convenient if
+% \meta{type} is, say, \texttt{Program}, since no |\floatname| command
+% is necessary at all.
+% \begin{macrocode}
+ \@ifundefined{fname@#1}{\floatname{#1}{#1}}{}
+% \end{macrocode}
+% Then we set up the type number for \LaTeX\ in |\ftype@|\meta{type}.
+% Afterwards we have to set the |float@type| to the next greater power
+% of two, so that it is ready for the next |\newfloat|. Fortunately,
+% we just have to double it by adding. We don't bother checking for overflow
+% since it is pretty unlikely that somebody will define 25 different classes
+% of floats. Finally, we call |\restylefloat| to define the style and
+% commands for this class of floats.
+% \begin{macrocode}
+ \expandafter\edef\csname ftype@#1\endcsname{\value{float@type}}%
+ \addtocounter{float@type}{\value{float@type}}
+ \restylefloat{#1}%
+% \end{macrocode}
+% Now all that's left is to assemble the |\fnum@|\meta{type} macro
+% that \LaTeX\ wants to use in its captions. Basically it is just
+% `caption name'${}+{}$`counter value', disguised so that the command
+% \emph{names} appear in the definition instead of their expansions.
+% \begin{macrocode}
+ \expandafter\edef\csname fnum@#1\endcsname%
+ {\expandafter\noexpand\csname fname@#1\endcsname{}
+ \expandafter\noexpand\csname the#1\endcsname}
+% \end{macrocode}
+% Finally, we have to take care of the optional argument, \meta{within}.
+% If the optional argument is present, we pass control to |\float@newx|.
+% Otherwise, we just define the counter for this class of floats.
+% By default, the numbers come out |\arabic|.
+% \begin{macrocode}
+ \@ifnextchar[{\float@newx{#1}}%
+ {\@ifundefined{c@#1}{\newcounter{#1}\@namedef{the#1}{\arabic{#1}}}%
+ {}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@newx}
+% Here we deal with the optional argument to |\newfloat|. We have
+% to create a new counter as per |\newcounter{|\meta{type}|}|
+% and add that counter to the list of counters to be reset whenever
+% counter \meta{within} is stepped. The standard command
+% |\newcounter{|\meta{type}|}[|\meta{within}{\tt]} takes care of that.
+% However, we can't define the \meta{type} counter if it's already defined.
+% While this case is simply ignored when \meta{within} is not present,
+% we issue a warning here since what comes out is probably not what the user
+% expects.
+% \begin{macrocode}
+\def\float@newx#1[#2]{\@ifundefined{c@#1}{\newcounter{#1}[#2]%
+ \expandafter\edef\csname the#1\endcsname{%
+ \expandafter\noexpand\csname
+ the#2\endcsname.\noexpand\arabic{#1}}}%
+ {\PackageWarning{float}{Can't redefine counter variable for #1.}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Adapting \LaTeX\ internals}
+%
+% We have to adapt some of \LaTeX's internal macros to our needs.
+% There are several things that have to be changed around
+% in order to provide the functionality of David Carlisle's \textsf{here}.
+% The following is thus lifted from \textsf{here}, with changes and with
+% David's permission:
+%
+% \begin{macro}{\@float@Hx}
+% We save the original version of |\@xfloat|. (This macro is called from
+% |\@float|, which we used above to define the environment commands for a
+% new class of floats.)
+% \begin{macrocode}
+\let\@float@Hx\@xfloat
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@xfloat}
+% The new version of |\@xfloat| looks for a |[H]| argument.
+% If it is present |\@float@HH| is called, otherwise the original macro
+% (renamed to |\@float@Hx|) is called.
+% \begin{macrocode}
+\def\@xfloat#1[{\@ifnextchar{H}{\@float@HH{#1}[}{\@float@Hx{#1}[}}
+% \end{macrocode}
+% \end{macro}
+% Later on we'll need a box to save a |[H]| float.
+% \begin{macrocode}
+\newsavebox\float@box
+\newif\if@flstyle
+% \end{macrocode}
+% \begin{macro}{\@float@HH}
+% First gobble the |[H]|. Note that \texttt{H} should not be used in
+% conjunction with the other placement options, nor as the value of the
+% default placement, as set in |\fps@|{\it type}.
+% \begin{macrocode}
+\def\@float@HH#1[H]{%
+% \end{macrocode}
+% Locally redefine the end of the environment.
+% \begin{macrocode}
+ \expandafter\let\csname end#1\endcsname\float@endH
+% \end{macrocode}
+% We don't get a |\@currbox| if we don't actually use the float mechanism.
+% Therefore we fake one using the |\float@box| defined above.
+% \begin{macrocode}
+ \let\@currbox\float@box
+% \end{macrocode}
+% Now we save the current float class name for use in constructing the
+% |\caption|. The caption box (defined below) is initialised to an empty
+% box to avoid trouble with floats not having a caption. Then we start the
+% box that'll hold the float itself.
+% |\parindent| is set to zero for compatibility with the standard \texttt{[h]}
+% option.
+% \changes{v1.2c}{29 Mar 95}{Bring H floats more in line with normal floats}
+% \begin{macrocode}
+ \def\@captype{#1}\setbox\@floatcapt=\vbox{}%
+ \expandafter\ifx\csname fst@#1\endcsname\relax
+ \@flstylefalse\else\@flstyletrue\fi
+ \setbox\@currbox\color@vbox\normalcolor
+ \vbox\bgroup \hsize\columnwidth \@parboxrestore
+ \@floatboxreset \@setnobreak
+% \end{macrocode}
+% The final |\ignorespaces| is needed to gobble any spaces or newlines
+% after the {\tt[H]} tokens.
+% \begin{macrocode}
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\newtoks\@float@everytoks
+\let\@float@boxreset=\@floatboxreset
+\def\@floatboxreset{\@float@boxreset\the\@float@everytoks}
+\def\@float@setevery#1{\@float@everytoks=\@nameuse{@float@every@#1}}
+% \end{macrocode}
+%
+% \begin{macro}{\float@makebox}
+% Basically, we must arrange for `style commands' to be executed
+% at certain points during the generation of the float.
+% \LaTeX\ puts a float into a vertical box |\@currbox| which it takes
+% off a list of empty boxes for insertions. When the |\float@makebox| macro
+% is called, |\@currbox| contains the complete float, minus the caption
+% --- we'll see later that we use our own |\caption| command to
+% put the caption into a |\vbox| of its own. This is the only way
+% we can control the position of the caption by the float style,
+% regardless of where the caption appears in the float's input text itself.
+% So the `style commands' are |\@fs@pre|, which is inserted at the
+% very beginning of the float, |\@fs@mid|, which comes between the
+% float and the caption (or the caption and the float, if captions are put
+% at the top), and |\@fs@post|, which finishes off the float.
+% The caption may appear at the top or at the bottom of the float,
+% as defined by |\@fs@iftopcapt|. Therefore, before we hand the
+% float to \LaTeX\ for positioning, it is taken apart and reassembled
+% using the style commands.
+% \changes{v1.3a}{15 Aug 2001}{Changed `ifvbox to `ifvoid}
+% \begin{macrocode}
+\newcommand\float@makebox[1]{%
+ \vbox{\hsize=#1 \@parboxrestore
+ \@fs@pre\@fs@iftopcapt
+ \ifvoid\@floatcapt\else\unvbox\@floatcapt\par\@fs@mid\fi
+ \unvbox\@currbox
+ \else\unvbox\@currbox
+ \ifvoid\@floatcapt\else\par\@fs@mid\unvbox\@floatcapt\fi
+ \fi\par\@fs@post\vskip\z@}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\float@end}
+% The internal macro |\end@float| appears here under the name of |\float@end|.
+% The main thing which is changed is that we call |\float@makebox| to
+% reconstruct the float according to the float style.
+% We want to do exactly what the \LaTeX\ kernel does without copying
+% actual kernel code if we can help it; therefore we finish off the
+% float using the kernel |\@endfloatbox|, then replace \LaTeX's
+% contents of the |\@currbox| with our own processed version, and then
+% hand the thing off to \LaTeX again. Of course we have already done
+% |\@endfloatbox|, which comes at the beginning of |\end@float|, ourselves;
+% therefore we neutralize it before calling |\end@float|. This doesn't
+% matter since we're in a group anyway (we wanted to keep the style
+% commands local), so everything is undone at the end of the environment.
+% \changes{v1.3d}{08 Nov 2001}{Removed an extraneous level of grouping}
+% \changes{v1.3b}{17 Aug 2001}{Still another new method}
+% \changes{v1.3}{18 Jul 2001}{Simplified according to H. A. Sommerfeldt}
+% \changes{v1.2a}{29 Mar 95}{Fixed float end handling for LaTeX2e of Dec94}
+% \begin{macrocode}
+\newcommand\float@end{\@endfloatbox
+ \global\setbox\@currbox\float@makebox\columnwidth
+ \let\@endfloatbox\relax\end@float}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@endH}
+% The |\float@endH| command is, again, derived from \textsf{here}. It'll
+% deal correctly with a non-floating float, inserting the proper amounts
+% of white space above and below.
+% \changes{v1.3b}{18 Aug 2001}{Move more processing to LaTeX kernel}
+% \changes{v1.2c}{29 Mar 95}{Bring H floats more in line with normal floats}
+% \begin{macrocode}
+\newcommand\float@endH{\@endfloatbox\vskip\intextsep
+ \if@flstyle\setbox\@currbox\float@makebox\columnwidth\fi
+ \box\@currbox\vskip\intextsep\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@dblend}
+% The |\float@dblend| command finishes up double-column floats. This
+% uses the same approach as |\float@end| above. It seems to work.
+% \changes{v1.3b}{17 Aug 2001}{Still another new method}
+% \changes{v1.3}{18 Jul 2001}{Rewritten after H. A. Sommerfeldt}
+% \changes{v1.2e}{09 Mar 2000}{Fixed bug in double-column floats}
+% \changes{v1.2a}{29 Mar 95}{Fixed float end handling for LaTeX2e of Dec94}
+% \begin{macrocode}
+\newcommand\float@dblend{\@endfloatbox
+ \global\setbox\@currbox\float@makebox\textwidth
+ \let\@endfloatbox\relax\end@dblfloat}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Captions and lists of floats}
+%
+% Now for the caption routines.
+% We use a box, |\@floatcapt|, to hold the caption while the float
+% is assembled.
+% \begin{macrocode}
+\newsavebox\@floatcapt
+% \end{macrocode}
+%
+% \begin{macro}{\caption}
+% This is the only \LaTeX\ macro that this document style supersedes.
+% Our |\caption| command checks whether there is a custom style
+% defined for the current float (whose type can be found in |\@captype|).
+% If so, the caption routines from \textsf{float} are used, otherwise
+% (or when the float style has been applied via |\restylefloat*| so
+% that captions aren't handled by this package)
+% we call the vanilla \LaTeX\ routines.
+% \begin{macrocode}
+\renewcommand\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \let\@tempf\@caption
+ \expandafter\ifx\csname @float@c@\@captype\endcsname\relax\else
+ \expandafter\expandafter\let
+ \expandafter\@tempf\csname @float@c@\@captype\endcsname\fi\fi
+ \@dblarg{\@tempf\@captype}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@caption}
+% The |\float@caption| macro takes care of entering the caption into
+% the appropriate listing. It also controls the typesetting of the caption
+% itself, although a style-dependent macro |\@fs@capt| is called
+% to handle the specifics. Note that because the caption is saved in a box
+% instead of being output to the float right away, you cannot simply put
+% a legend after the caption proper; it has to follow the |\caption|
+% command in an optional argument.
+%
+% First of all, we call |\addcontentsline| to update the list of
+% floats of this class. Note that |\float@caption| is |\long|
+% to allow for paragraph breaks in its arguments.
+% \begin{macrocode}
+\long\def\float@caption#1[#2]#3{\addcontentsline{\@nameuse{ext@#1}}{#1}%
+ {\protect\numberline{\@nameuse{the#1}}{\ignorespaces #2}}
+% \end{macrocode}
+% Now we collect the caption proper. The caption name and number are
+% taken from |\fnum@|\meta{float}, where \meta{float} is the class
+% of float we're currently handling.
+% \begin{macrocode}
+ \global\setbox\@floatcapt\vbox\bgroup\@parboxrestore
+ \normalsize\@fs@capt{\@nameuse{fnum@#1}}{\ignorespaces #3}%
+% \end{macrocode}
+% Finally we check for the presence of the optional argument. If there is
+% one, we call |\float@ccon| to pick it up; otherwise, the |\egroup|
+% finishes off the box.
+% \begin{macrocode}
+ \@ifnextchar[{\float@ccon}{\egroup}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@ccon}
+% The |\float@ccon| macro expands to the optional argument of a
+% |\caption| command, followed by |\par\egroup|. Note that this
+% precludes using |\verb| \& Co.\ in the optional argument; the
+% interested reader is urged to fix this problem as an exercise.
+% \begin{macrocode}
+\long\def\float@ccon[#1]{#1\par\egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\listof}
+% The |\listof| command reads the desired list of floats from the
+% appropriate auxiliary file. The file is then restarted.
+% First of all, we check whether the float style that's supposed to be
+% listed is actually defined. If not, we output a |\float@error|.
+% \begin{macrocode}
+\newcommand*{\listof}[2]{%
+ \@ifundefined{ext@#1}{\float@error{#1}}{%
+% \end{macrocode}
+% All's well until now. We define the |\l@|\meta{float} command
+% that \LaTeX\ needs for formatting the list, and then typeset the
+% appropriate list header.
+% \begin{macrocode}
+ \@namedef{l@#1}{\@dottedtocline{1}{1.5em}{2.3em}}%
+ \float@listhead{#2}%
+% \end{macrocode}
+% Next we call |\@starttoc| with the correct file extension
+% to do the actual work.
+% If |\parskip| is non-zero, vertical space would be added between
+% the individual list entries. To avoid this, we zero |\parskip|
+% locally. This should be done after the |\float@listhead| above since
+% |\parskip| also influences the spacing of headings, and the listings
+% would look different from other chapters otherwise. (Suggested by
+% Markus Kohm.)
+% \changes{v1.3c}{17 Aug 2001}{Set parskip to zero for listing}
+% \begin{macrocode}
+ \begingroup\setlength{\parskip}{\z@}%
+ \@starttoc{\@nameuse{ext@#1}}%
+ \endgroup}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@listhead}
+% This command generates the beginning of a list of floats.
+% Currently the list appears at the chapter or the section level, depending
+% on whether chapters are supported in the document class. According to
+% a suggestion from Markus Kohm, this is now in a separate command so it
+% can be overridden by other packages. We also use |\MakeUppercase| instead
+% of |\uppercase|; when this piece of code was first written |\MakeUppercase|
+% hadn't been invented yet, and for some reason this never got updated.
+% \changes{v1.3}{18 Jul 2001}{Factored out list-of-float starting code}
+% \begin{macrocode}
+\providecommand*{\float@listhead}[1]{%
+ \@ifundefined{chapter}{\def\@tempa{\section*}}%
+ {\def\@tempa{\chapter*}}%
+ \@tempa{#1\@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\float@addtolists}
+% This command allows \LaTeX\ programmers to add something to all
+% currently-defined lists of floats, such as some extra vertical
+% space at the beginning of a new chapter in the main text
+% (|\float@addtolists{\protect\addvspace{10pt}}|), without knowing
+% exactly which lists of floats are currently being constructed.
+% This command currently does \emph{not} operate on the |lot| and |lof|
+% lists.
+% \changes{v1.3}{18 Jul 2001}{Added command}
+% \begin{macrocode}
+\newcommand\float@addtolists[1]{%
+ \def\float@do##1{\addtocontents{##1}{#1}} \the\float@exts}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{The Float Styles}
+%
+% Finally, we define the standard float styles that were outlined
+% in the Introduction. Every float style \meta{style} corresponds to a
+% command |\fs@|\meta{style} which contains the definitions of the
+% style commands, namely
+% \begin{center}\begin{tabular}{rl}
+% |\@fs@pre|&top of the float\\
+% |\@fs@mid|&between float and caption\\
+% |\@fs@post|&bottom of the float\\
+% |\@fs@capt|&formatting routine for caption\\
+% |\@fs@cfont|&font for caption name \& number
+% \end{tabular}\end{center}
+%
+% \begin{macro}{\floatc@plain}
+% The |\floatc@plain| macro formats a caption the way \LaTeX\ does
+% it: if the caption is fairly short, it is centered, otherwise it is
+% formatted as a paragraph. The only difference is that the portion
+% containing the caption name and number uses the |\@fs@captfont|.
+% \begin{macrocode}
+\newcommand\floatc@plain[2]{\setbox\@tempboxa\hbox{{\@fs@cfont #1:} #2}%
+ \ifdim\wd\@tempboxa>\hsize {\@fs@cfont #1:} #2\par
+ \else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fs@plain}
+% The \texttt{plain} float style is similar to what \LaTeX\ does of its
+% own accord; the only difference is that the caption is guaranteed
+% to come out at the bottom of the float.
+% \changes{v1.3a}{15 Aug 2001}{Use `abovecaptionskip rather than
+% hard-coded value}
+% \begin{macrocode}
+\newcommand\fs@plain{\def\@fs@cfont{\rmfamily}\let\@fs@capt\floatc@plain
+ \def\@fs@pre{}\def\@fs@post{}%
+ \def\@fs@mid{\vspace\abovecaptionskip\relax}%
+ \let\@fs@iftopcapt\iffalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fs@plaintop}
+% The \texttt{plaintop} float style is similar to the \texttt{plain}
+% float style except that the caption comes out at the top.
+% \changes{v1.3}{18 Jul 2001}{Added plaintop float style}
+% \changes{v1.3a}{15 Aug 2001}{Use `belowcaptionskip rather than
+% hard-coded value}
+% \begin{macrocode}
+\newcommand\fs@plaintop{\fs@plain
+ \def\@fs@mid{\vspace\belowcaptionskip\relax}%
+ \let\@fs@iftopcapt\iftrue}
+\let\floatc@plaintop=\floatc@plain
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\floatc@ruled}
+% The |\floatc@ruled| command is even simpler than the
+% |\floatc@plain| macro. The caption is simply printed `as is'.
+% \begin{macrocode}
+\newcommand\floatc@ruled[2]{{\@fs@cfont #1} #2\par}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fs@ruled}
+% In the \texttt{ruled} float style, the caption appears at the top of the
+% float, preceded and followed by horizontal rules.
+% Another rule followes the whole of the float.
+% \begin{macrocode}
+\newcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled
+ \def\@fs@pre{\hrule height.8pt depth0pt \kern2pt}%
+ \def\@fs@post{\kern2pt\hrule\relax}%
+ \def\@fs@mid{\kern2pt\hrule\kern2pt}%
+ \let\@fs@iftopcapt\iftrue}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fs@boxed}
+% The \texttt{boxed} float style puts the float into a box (which is slightly
+% larger than the usual |\textwidth|). The caption appears below
+% the box.
+% \changes{v1.2b}{29 Mar 95}{Fixed bug in boxed floatstyle}
+% \begin{macrocode}
+\newcommand\fs@boxed{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain
+ \def\@fs@pre{\setbox\@currbox\vbox{\hbadness10000
+ \moveleft3.4pt\vbox{\advance\hsize by6.8pt
+ \hrule \hbox to\hsize{\vrule\kern3pt
+ \vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}}}%
+ \def\@fs@mid{\kern2pt}%
+ \def\@fs@post{}\let\@fs@iftopcapt\iffalse}
+% \end{macrocode}
+% \end{macro}
+%
+% Before we finish, we set the float style to \texttt{plain}.
+% \begin{macrocode}
+\floatstyle{plain}
+% \end{macrocode}
+% Other float styles can be added without much ado.
+% If there are many more float styles, it should be worthwhile
+% to invent a scheme similar to that used in Frank Mittelbach's
+% \textsf{theorem} option in order to conserve space, i.e., put the
+% float styles into individual files that can be loaded on demand.
+% I would like to hear from people who define interesting
+% float styles.
+% \PrintChanges
+% \Finale
+% \end{document}
+\endinput
diff --git a/Master/texmf-dist/source/latex/float/float.ins b/Master/texmf-dist/source/latex/float/float.ins
new file mode 100644
index 00000000000..faac2066028
--- /dev/null
+++ b/Master/texmf-dist/source/latex/float/float.ins
@@ -0,0 +1,31 @@
+
+\def\filedate{2000/03/09}
+\def\batchfile{float.ins}
+\input docstrip.tex
+\def\SimplePackage#1{\generateFile{#1.sty}{t}{\from{#1.dtx}{package}}}
+\keepsilent
+\preamble
+
+IMPORTANT NOTICE:
+This file is a stripped version of `float.dtx',
+copyright (c) 1991-2000 Anselm Lingnau
+(lingnau@tm.informatik.uni-frankfurt.de)
+
+This file may only be distributed together with the corresponding
+`float.dtx' file. See `float.dtx' for distribution conditions on
+the original source.
+
+\endpreamble
+
+\SimplePackage{float}
+
+\Msg{*************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the file}
+\Msg{* `float.sty' into a directory searched by TeX:}
+\Msg{*}
+\Msg{* To produce the documentation run `float.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*************************************************************}
+
diff --git a/Master/texmf-dist/source/latex/fmp/fmp-doc.hs b/Master/texmf-dist/source/latex/fmp/fmp-doc.hs
new file mode 100644
index 00000000000..cbece3f2337
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fmp/fmp-doc.hs
@@ -0,0 +1,37 @@
+--
+-- This is file `fmp-doc.hs',
+-- generated with the docstrip utility.
+--
+-- The original source files were:
+--
+-- fmp.dtx (with options: `examples')
+--
+-- Example source code for the FMP package
+--
+module FMPDoc where
+import FMP
+import FMPTree
+
+example1 = binom 5
+ where
+ ce = circle empty
+ binom 0 = node ce []
+ binom n = node ce [edge (binom i)
+ | i <- [(n-1),(n-2)..0]]
+ #setAlign AlignRight
+
+example2 = box (math "U" |||
+ ooalign [toPicture [cArea a 0.7,
+ cArea b 0.7,
+ cArea ab 0.4],
+ bOverA])
+ where
+ cArea a c = toArea a #setColor c
+ bOverA = column [math "B" #setBGColor white,
+ vspace 50,
+ math "A" #setBGColor white]
+ a = transformPath (scaled 30) fullcircle
+ b = transformPath (scaled 30 & shifted (0,-30))
+ fullcircle
+ ab = buildCycle a b
+
diff --git a/Master/texmf-dist/source/latex/fmp/fmp.dtx b/Master/texmf-dist/source/latex/fmp/fmp.dtx
new file mode 100644
index 00000000000..9384c0f008a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fmp/fmp.dtx
@@ -0,0 +1,675 @@
+% \iffalse meta-comment
+%
+% Copyright 2001 Marco Kuhlmann
+%
+% This program is distributed under the conditions of the
+% LaTeX Project Public License, which can be found in
+% http://www.latex-project.org/lppl.txt
+%
+% This program consists of the files fmp.ins and fmp.dtx
+%
+% \fi
+%
+%
+% \CheckSum{260}
+%
+% \changes{v1.0a}{2001/04/03}{%
+% Initial release.}
+%
+% \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 \~}
+%
+% \title{Functional {\MP} for {\LaTeX}\thanks{%
+% This file has version number \fileversion.}}
+% \author{Marco Kuhlmann\thanks{%
+% E-Mail: \texttt{marco.kuhlmann@gmx.net}}}
+% \date{\filedate}
+% \maketitle
+%
+%
+% \begin{abstract}
+% Functional {\MP} (\FMP) is a powerful frontend to the {\MP}
+% language. This package adds basic {\FMP} support to {\LaTeX},
+% enabling users to keep {\FMP} source code within their
+% documents and, by a two-run mechanism, including
+% automatically generated {\FMP} figures.
+% \end{abstract}
+%
+%
+% \section{Introduction}
+%
+% Functional {\MP} by Joachim Korittky (\cite{Diplomarbeit}) adds
+% a high-level interface to the {\MP} language (\cite{MetaPost1},
+% \cite{MetaPost2}), enabling the user to program their graphics
+% using the Haskell language. Impressive examples of Functional
+% {\MP} can be found in Korittky's diploma thesis; some of them
+% will be given below. The system and the documentation can be
+% downloaded from
+% \begin{quote}
+% \texttt{http://www.informatik.uni-bonn.de/\~{}ralf/software.html}
+% \end{quote}
+%
+% Using Functional {\MP} as my standard graphics developing tool,
+% I felt a need to write a {\LaTeX} package which smoothly
+% integrates {\FMP} into daily work, similar to the |emp| package
+% by Thorsten Ohl (\cite{EMP}); this is how |fmp| came to being.
+% The earliest version supported only the possibility to
+% automatically produce shell-scripts for graphics generation.
+% Since then, I have added the possibility to encapsulate {\FMP}
+% code -- though I still ask myself if this way of maintaining
+% code is as natural for {\FMP} as it is for pure {\MP} in |emp|.
+%
+% In case you have any questions or comments on this package,
+% feel free to send me an email. May |fmp| help {\FMP} to spread
+% around the world. \texttt{:-)}
+%
+%
+% \subsection{Examples of Functional {\MP}}
+%
+% Before I start to present the |fmp| package, let me first give
+% you two mouth-watering examples of {\FMP} (the Haskell code for
+% them can be found at the end of this document):
+% figure~\ref{figure:example1} gives a binominal tree of
+% rank~$5$, figure~\ref{figure:example2} shows a simple Venn
+% diagram. Among other things, these examples exhibit two
+% features in which {\FMP} is superior to many other graphics
+% drawing packages around:
+% \begin{itemize}
+% \item By embedding {\MP} into the Haskell programming language,
+% {\FMP} gives the user (and especially users who have previous
+% experience in functional programming) a great tool to program
+% graphics on a very high-level level of abstraction. This not
+% only helps you to focus on the logical structure rather than
+% on layout questions, but also is especially important if you
+% want to scale and re-use old material.
+% \item {\FMP} can be easily extended. For example, for
+% figure~\ref{figure:example1}, the core language has been
+% augmented by tree drawing features, using much better
+% algorithms than those of any other tree drawing package
+% around. This is especially good news for computer scientists,
+% who need trees very often, but did not yet have a package to
+% draw them on such a level of abstraction.
+% \end{itemize}
+%
+% \begin{figure}
+% \begin{center}
+% \fmpfigure{example1}
+% \end{center}
+% \caption{A binominal tree of rank~$5$}
+% \label{figure:example1}
+% \end{figure}
+%
+% \begin{figure}
+% \begin{center}
+% \fmpfigure{example2}
+% \end{center}
+% \caption{A Venn diagram (cf.\ figure~22 in \cite{MetaPost2})}
+% \label{figure:example2}
+% \end{figure}
+%
+% To be able to use {\FMP}, you need a Haskell interpreter, such
+% as |hugs|, and the {\MP} program, which should be part of any
+% somewhat complete distribution of {\LaTeX}. Having produced a
+% Haskell source, you feed it into |hugs| and issue the
+% |generate| command provided by {\FMP}. This will translate your
+% code into low-level {\MP} commands, and finally produce a
+% ready-to use PostScript file.
+%
+% \subsection{How this package works}
+%
+% Calling |hugs| and typing in the generation commands is a
+% tedious job if you keep more than but a few illustrations
+% around. This package offers the |\fmpfigure| command, which
+% generates a shell script (at present, this only works for
+% $*$n$*$x), which you then can execute to have all the graphics
+% files generated at once. At the next run of {\LaTeX}, these
+% graphic files will appear at their proper positions. Besides,
+% |fmp| enables you to store Haskell code within a {\LaTeX} file,
+% in case you want to have all the code for one document at one
+% place.
+%
+%
+% \section{Usage}
+%
+% \subsection{Including graphics}
+%
+% \changes{v1.0b}{2001/10/22}{%
+% Documentation: Improvements as suggested by Peter Bartke.}
+% Using \verb|fmp| to include graphics from some {\FMP} source is
+% straightforward. Let us assume that you keep two {\FMP} figures
+% (Haskell values) \verb|example1| and \verb|example2| in a file
+% called \verb|fmp-doc.hs|. A minimal document using the package to
+% include these two figures would then look like this:
+%
+% \medskip\noindent\bgroup\small
+% \verb|\documentclass{article}|\\
+% \verb|\usepackage{fmp}|\\
+% \verb|\fmpsourcefilename{fmp-doc}|\\
+% \verb|\begin{document}|\\
+% \verb|\fmpfigure{example1}|\\
+% \verb|\fmpfigure{example2}|\\
+% \verb|\end{document}|\\
+% \verb|\end{verbatim}|
+% \medskip\par\egroup
+%
+% \DescribeMacro{\fmpfigure} You include a figure into your
+% {\LaTeX} document by using the |\fmpfigure| macro. It takes, as
+% its mandatory argument, the string identifying the figure in
+% the Haskell source, and creates a shell script containing all
+% the |hugs| calls needed for the actual generation. After the
+% shell script has been written, you can execute it and run
+% {\LaTeX} again; if everything went right, the graphics file
+% will appear at the place where you issued the |\fmpfigure|
+% command.
+%
+% \changes{v1.1a}{2001/11/19}{%
+% Documentation: Optional arguments to \cs{fmpfigure} are now
+% passed to the \texttt{graphicx} package.}
+% Any optional arguments to |\fmpfigure| will be passed to the
+% |graphicx| package and interpreted as if they appeared together
+% with a |\includegraphics| command. This allows you to change
+% the visual appearance of the included figure (e.\,g., the size
+% to which the figure shall be scaled). Refer to \cite{graphicx}
+% for more information about possible paramters.
+%
+% \subsection{Including code}
+%
+% \DescribeEnv{fmp} You can also store your {\FMP} code in the same
+% file than your {\LaTeX} source, included within the |fmp|
+% environment. During compilation, the contents of this environment
+% are written to an external file (see below).
+%
+% \subsection{Changing file names}
+%
+% \DescribeMacro{\fmpsourcefilename}
+% \DescribeMacro{\fmpscriptfilename}
+% \DescribeMacro{\fmpfigurebasename}
+% You can control the names of three different files:
+% \begin{itemize}
+% \item the Haskell source (|\fmpsourcefilename|, defaults to
+% \meta{jobname}|.hs|),
+% \item the shell script (|\fmpscriptfilename|, defaults to
+% |fmpgenerate.sh|) and
+% \item the graphics file base name (|\fmpfigurebasename|,
+% defaults to |fmpfigure|), which is the base file name of the
+% graphics files that will be generated by |hugs|. (An index
+% number specifying their order in the document will be
+% appended to this name.)
+% \end{itemize}
+% You can modify all three file names by calling the respective
+% macros, each of which takes the new name as its argument.
+%
+% \subsection{Preamble and postamble}
+%
+% \DescribeMacro{\fmpsourcepreamble}
+% \DescribeMacro{\fmpaddtosourcepreamble}
+% \DescribeMacro{\fmpscriptpreamble}
+% \DescribeMacro{\fmpaddtoscriptpreamble}
+% \DescribeMacro{\fmpsourcepostamble}
+% \DescribeMacro{\fmpaddtosourcepostamble}
+% \DescribeMacro{\fmpscriptpostamble}
+% \DescribeMacro{\fmpaddtoscriptpostamble}
+% Before something is written to the source file or the shell
+% script file, the package will output a \emph{preamble} to that
+% file. The source code preamble could contain everything from
+% comments to Haskell module identifications and basic imports,
+% while the shell script preamble should probably contain the
+% line that calls |hugs| and tells it to input the rest of the
+% file as comment. Have a sample run to see the default contents
+% of the preamble. If you wish to change the text: you can set a
+% new preamble by the |\fmpsourcepreamble| command, and you can
+% append a new line to the current preamble calling
+% |\fmpaddtosourcepreamble|. (Similar commands are available for
+% the shell script preamble.) There is also a postamble, which is
+% written as the very last thing to the source code or shell
+% script.
+%
+% \MP\ uses the environment variable \verb|$TEX| to determine which
+% \TeX\ it has to call when generating labels etc. On many systems,
+% this variable defaults to \verb|tex|, which is certainly not what
+% you want in conjunction with \verb|fmp|. One common usage for the
+% preamble therefore is to include a line like
+% \verb|export TEX=latex| (or something similar, depending on your
+% shell) into the generation script.
+%
+% \subsection{Graphics file formats}
+%
+% The |graphicx| package is used to handle the inclusion of
+% generated {\FMP} figures. If |fmp| is called from within
+% |pdflatex|, |graphicx| is loaded with the |pdftex| driver
+% option. In this case, the fall-back behaviour when
+% encountering an |\fmpfigure| command is to read the
+% corresponding graphics file as |mps| ({\MP} output); it will
+% then internally be converted to \textsc{pdf} by |graphicx|.
+% When called from within normal |latex|, graphics files are
+% handled as |eps| (encapsulated PostScript). You probably need
+% to load a specific PostScript driver for |graphicx| in this
+% case -- do so by supplying |fmp| with the same package option
+% that you would use for |graphicx| (see the |graphicx| user
+% manual for further information on that).
+%
+%
+% \subsection*{Acknowledgements}
+%
+% The help of Ralf Hinze and the suggestions of Peter Bartke and
+% Ferenc Wagner are gratefully acknowledged.
+%
+%
+% \section*{Source code for the examples}
+%
+% \verbatiminput{fmp-doc.hs}
+%
+%
+% \StopEventually{%
+% \begin{thebibliography}{XXX99}
+% \bibitem[Hob89]{MetaPost1}
+% \textsc{John D.\ Hobby:}
+% \emph{A {\MF}-like System with PostScript Output.}
+% TUGboat vol.~10, no.~2, pp.\ 505--512, 1989
+% \bibitem[Hob92]{MetaPost2}
+% \textsc{John D.\ Hobby:}
+% \emph{A User's manual for {\MP}.}
+% Computing Science Technical Report no.~162, AT\&T Bell
+% Laboratories, Murray Hill, New Jersey, 1992
+% \bibitem[Kor98]{Diplomarbeit}
+% \textsc{Joachim Korittky:}
+% \emph{functional {\MP}. Eine Beschreibungsspra\-che
+% f\"ur Grafiken.}
+% Diplomarbeit an der Rheinischen
+% Friedrich-Wilhelms-Universit\"at Bonn, 1998
+% \bibitem[Ohl97]{EMP}
+% \textsc{Thorsten Ohl:}
+% \emph{EMP: Encapsulated {\MP} for {\LaTeX}.}
+% Technische Hochschule Darmstadt, 1998
+% \bibitem[Car99]{graphicx}
+% \changes{v1.1a}{2001/11/19}{%
+% Added to bibliography: Reference to \texttt{graphicx}
+% package user documentation.}
+% \textsc{David Carlisle:}
+% \emph{Packages in the `graphics' bundle.}
+% User documentation, 1999
+% \end{thebibliography}}
+%
+%
+% \section{The Documentation Driver File}
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{fmp}
+\usepackage{mflogo}
+\OnlyDescription
+\GetFileInfo{fmp.sty}
+\newcommand*{\FMP}{\textsc{fmp}}
+\fmpsourcefilename{fmp-doc}
+\setcounter{topnumber}{1}
+\makeatletter
+\let\verbatim@oldfont=\verbatim@font
+\def\verbatim@font{\small\verbatim@oldfont}
+\makeatother
+\tolerance=2000
+\emergencystretch=20pt
+\RecordChanges
+\begin{document}
+\DocInput{fmp.dtx}
+\PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+%
+% \section{The Implementation}
+%
+% \subsection{Setup}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% We start with the usual identification procedure. All the
+% options that |fmp| cannot cater for itself are passed to the
+% |graphicx| package, as they probably are requests for special
+% PostScript drivers (see above).
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1995/05/16]
+\ProvidesPackage{fmp}
+[2001/11/19 v1.1a Support for Functional MetaPost]
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
+\ProcessOptions
+% \end{macrocode}
+%
+% Depending on whether or not |fmp| is called from within
+% |pdflatex|, the |graphicx| package has to be loaded with or
+% without the |pdftex| option. A fall-back rule is declared for
+% |\includegraphics| commands.
+% \begin{macrocode}
+\@ifundefined{pdfoutput}{%
+ \RequirePackage{graphicx}[1999/02/16]%
+ \DeclareGraphicsRule{*}{eps}{*}{}}{%
+ \RequirePackage[pdftex]{graphicx}[1994/12/15]%
+ \DeclareGraphicsRule{*}{mps}{*}{}}
+% \end{macrocode}
+%
+% The |verbatim| package is used for writing the contents of the
+% |fmp| environment (see below) into a file.
+% \begin{macrocode}
+\RequirePackage{verbatim}
+% \end{macrocode}
+%
+% We set up new streams |\fmp@sourceout| and |\fmp@scriptout| for
+% the Haskell source and the shell script to be written, as well
+% as conditionals to remember whether or not we have already
+% opened these streams.
+% \begin{macrocode}
+\newwrite\fmp@sourceout
+\newwrite\fmp@scriptout
+\newif\iffmp@sourceio
+\fmp@sourceiofalse
+\newif\iffmp@scriptio
+\fmp@scriptiofalse
+% \end{macrocode}
+%
+% Finally, we need a counter for the figures that we want to
+% generate.
+% \begin{macrocode}
+\newcounter{fmpfigure}
+% \end{macrocode}
+%
+% \subsection{Writing the source code}
+%
+% \begin{environment}{fmp}
+% The |fmp| environment writes its contents into the
+% |\fmp@sourceout| stream. This is done in an almost
+% ``classical'' way, employing the |verbatim| package.
+% \begin{macrocode}
+\newenvironment*{fmp}{}{}
+\def\fmp{%
+ \begingroup
+ \@bsphack
+ \let\do\@makeother\dospecials
+ \catcode`\^^M\active
+ \def\verbatim@processline{\fmp@sourcewrite{\the\verbatim@line}}%
+ \verbatim@start}
+\def\endfmp{%
+ \@esphack
+ \endgroup}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\fmp@sourcewrite}
+% This is the wrapper used for writing to the source file. Every
+% time it is called, it checks whether or not the
+% |\fmp@sourceout| stream has already been opened. If not, it
+% calls |\fmp@sourceopen| to do so. (I do so because I want to
+% avoid situations like in the |emp| package, where the outstream
+% is opened and a file is created, even when at the end nothing
+% is written to it. Is this too expensive?)
+% \begin{macrocode}
+\def\fmp@sourcewrite#1{%
+ \iffmp@sourceio \else \global\fmp@sourceiotrue\fmp@sourceopen \fi%
+ \immediate\write\fmp@sourceout{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@sourceopen}
+% Opens the output stream for the source file and writes the
+% preamble.
+% \begin{macrocode}
+\def\fmp@sourceopen{%
+ \immediate\openout\fmp@sourceout\fmp@sourcefilename%
+ \edef\@tempa{\the\fmp@sourcepreamble}%
+ \immediate\write\fmp@sourceout{\@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmpsourcefilename}
+% \begin{macro}{\fmp@sourcefilename}
+% Set the filename of the source file.
+% \begin{macrocode}
+\newcommand*{\fmpsourcefilename}[1]{%
+ \gdef\fmp@sourcefilename{#1}}
+\@onlypreamble{\fmpsourcefilename}
+\def\fmp@sourcefilename{\jobname.hs}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fmp@sourcepreamble}
+% \begin{macro}{\fmpsourcepreamble}
+% \begin{macro}{\fmpaddtosourcepreamble}
+% Sets up the preamble for the source file, as well as macros to
+% reset them or append new lines to it.
+% \begin{macrocode}
+\newtoks\fmp@sourcepreamble
+\newcommand*{\fmpsourcepreamble}[1]{%
+ \global\fmp@sourcepreamble={#1}}
+\@onlypreamble{\fmpsourcepreamble}
+\newcommand*{\fmpaddtosourcepreamble}[1]{%
+ \fmp@sourcepreamble=\expandafter{\the\fmp@sourcepreamble#1}}
+\@onlypreamble{\fmpaddtosourcepreamble}
+\fmp@sourcepreamble={-- This is file `\fmp@sourcefilename',
+ created automatically. Do not edit!^^J}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fmp@sourceclose}
+% This is added to \LaTeX's |\@enddocumenthook|. It writes the
+% postamble to the source file and closes the output stream.
+% \begin{macrocode}
+\def\fmp@sourceclose{%
+ \iffmp@sourceio
+ \edef\@tempa{\the\fmp@sourcepostamble}%
+ \fmp@sourcewrite{\@tempa}%
+ \immediate\closeout\fmp@sourceout
+ \fi}
+\AtEndDocument{\fmp@sourceclose}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@sourcepostamble}
+% \begin{macro}{\fmpsourcepostamble}
+% \begin{macro}{\fmpaddtosourcepostamble}
+% Sets up the postamble for the source file, as well as macros to
+% reset and update it.
+% \begin{macrocode}
+\newtoks\fmp@sourcepostamble
+\newcommand*{\fmpsourcepostamble}[1]{%
+ \global\fmp@sourcepostamble={#1}}
+\@onlypreamble{\fmpsourcepostamble}
+\newcommand*{\fmpaddtosourcepostamble}[1]{%
+ \fmp@sourcepostamble=\expandafter{\the\fmp@sourcepostamble#1}}
+\@onlypreamble{\fmpaddtosourcepostamble}
+\fmp@sourcepostamble={^^J-- End of file `\fmp@sourcefilename'}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Writing the shell script}
+%
+% \begin{macro}{\fmpfigure}
+% \changes{v1.1a}{2001/11/19}{%
+% Pass through optional arguments to the \texttt{graphicx}
+% package, as suggested by Ferenc Wagner.}
+% Writes a new line to the |\fmp@scriptout| stream, which is
+% connected to the generation shell script file, telling |hugs|
+% to generate a graphics file with the name specified. Any
+% optional argument is passed to the |graphicx| package.
+% \begin{macrocode}
+\newcommand*{\fmpfigure}[2][]{%
+ \fmp@scriptwrite{%
+ generate "\fmp@figurebasename" \thefmpfigure\space #2}%
+ \fmp@includegraphics{#1}{\fmp@figurebasename}{\thefmpfigure}%
+ \refstepcounter{fmpfigure}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@scriptwrite}
+% Wrapper for writing to the shell script file.
+% \begin{macrocode}
+\def\fmp@scriptwrite#1{%
+ \iffmp@scriptio \else \global\fmp@scriptiotrue\fmp@scriptopen \fi%
+ \immediate\write\fmp@scriptout{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@scriptopen}
+% Opens the output stream for the shell script file and writes
+% the preamble.
+% \begin{macrocode}
+\def\fmp@scriptopen{%
+ \immediate\openout\fmp@scriptout\fmp@scriptfilename%
+ \edef\@tempa{\the\fmp@scriptpreamble}%
+ \immediate\write\fmp@scriptout{\@tempa}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@scriptpreamble}
+% \begin{macro}{\fmpscriptpreamble}
+% \begin{macro}{\fmpaddtoscriptpreamble}
+% Set up the preamble for the shell script file as well as macros
+% to reset and append information to it.
+% \begin{macrocode}
+\newtoks\fmp@scriptpreamble
+\newcommand*{\fmpscriptpreamble}[1]{%
+ \global\fmp@scriptpreamble={#1}}
+\@onlypreamble{\fmpscriptpreamble}
+\newcommand*{\fmpaddtoscriptpreamble}[1]{%
+ \fmp@scriptpreamble=\expandafter{\the\fmp@scriptpreamble#1}}
+\@onlypreamble{\fmpaddtoscriptpreamble}
+\fmp@scriptpreamble={hugs \fmp@sourcefilename\space <<!}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fmpscriptfilename}
+% \begin{macro}{\fmp@scriptfilename}
+% This sets the filename of the shell script which can be used
+% for generation.
+% \begin{macrocode}
+\newcommand*{\fmpscriptfilename}[1]{%
+ \gdef\fmp@scriptfilename{#1}}
+\@onlypreamble{\fmpscriptfilename}
+\def\fmp@scriptfilename{fmpgenerate.sh}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fmpfigurebasename}
+% \begin{macro}{\fmp@figurebasename}
+% This sets the base name for the graphics files that will be
+% created by |hugs|.
+% \begin{macrocode}
+\newcommand*{\fmpfigurebasename}[1]{%
+ \gdef\fmp@figurebasename{#1}}
+\@onlypreamble{\fmpfigurebasename}
+\def\fmp@figurebasename{fmpfigure}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fmp@includegraphics}
+% \changes{v1.1a}{2001/11/19}{%
+% Pass through optional arguments to the \texttt{graphicx}
+% package, as suggested by Ferenc Wagner.}
+% This is a wrapper for the |\includegraphics| command. If the
+% |graphicx| package has been loaded correctly, it should be able
+% to import the graphics file, either directly in |eps| format,
+% or after a transformation to |pdf| by the Con{\TeX}t macros
+% included in the |pdftex| driver.
+% \begin{macrocode}
+\def\fmp@includegraphics#1#2#3{%
+ \leavevmode
+ \IfFileExists{#2.#3}%
+ {\includegraphics[#1]{#2.#3}}%
+ {\typeout{fmp: Could not find file #2.#3}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@scriptclose}
+% Write the shell script postamble and close the output stream.
+% \begin{macrocode}
+\def\fmp@scriptclose{%
+ \iffmp@scriptio
+ \edef\@tempa{\the\fmp@scriptpostamble}%
+ \fmp@scriptwrite{\@tempa}%
+ \immediate\closeout\fmp@scriptout
+ \fi}
+\AtEndDocument{\fmp@scriptclose}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fmp@scriptpostamble}
+% \begin{macro}{\fmpscriptpostamble}
+% \begin{macro}{\fmpaddtoscriptpostamble}
+% Set up the postamble for the shell script file as well as macros
+% to reset and append information to it.
+% \begin{macrocode}
+\newtoks\fmp@scriptpostamble
+\newcommand*{\fmpscriptpostamble}[1]{%
+ \global\fmp@scriptpostamble={#1}}
+\@onlypreamble{\fmpscriptpostamble}
+\newcommand*{\fmpaddtoscriptpostamble}[1]{%
+ \fmp@scriptpostamble=\expandafter{\the\fmp@scriptpostamble#1}}
+\@onlypreamble{\fmpaddtoscriptpostamble}
+\fmp@scriptpostamble={:quit}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+%
+% \Finale
+%
+%
+%<*examples>
+module FMPDoc where
+import FMP
+import FMPTree
+
+example1 = binom 5
+ where
+ ce = circle empty
+ binom 0 = node ce []
+ binom n = node ce [edge (binom i)
+ | i <- [(n-1),(n-2)..0]]
+ #setAlign AlignRight
+
+example2 = box (math "U" |||
+ ooalign [toPicture [cArea a 0.7,
+ cArea b 0.7,
+ cArea ab 0.4],
+ bOverA])
+ where
+ cArea a c = toArea a #setColor c
+ bOverA = column [math "B" #setBGColor white,
+ vspace 50,
+ math "A" #setBGColor white]
+ a = transformPath (scaled 30) fullcircle
+ b = transformPath (scaled 30 & shifted (0,-30))
+ fullcircle
+ ab = buildCycle a b
+%</examples>
+
+
+
diff --git a/Master/texmf-dist/source/latex/fmp/fmp.ins b/Master/texmf-dist/source/latex/fmp/fmp.ins
new file mode 100644
index 00000000000..b2bbf98bb42
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fmp/fmp.ins
@@ -0,0 +1,72 @@
+%
+% fmp.ins
+%
+% Copyright 2001 Marco Kuhlmann
+%
+% This program is distributed under the conditions of the
+% LaTeX Project Public License, which can be found in
+% http://www.latex-project.org/lppl.txt
+%
+% This program consists of the files fmp.ins and fmp.dtx
+%
+
+\input docstrip
+\keepsilent
+
+% Produce documentation
+
+\preamble
+
+Copyright 2001 Marco Kuhlmann
+
+This program 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.
+
+This program consists of the files fmp.ins and fmp.dtx
+
+\endpreamble
+
+\generate{\file{fmp.sty}{\from{fmp.dtx}{package}}}
+
+\def\MetaPrefix{--}
+
+% Produce example source code
+
+\preamble
+
+Example source code for the FMP package
+
+\endpreamble
+
+\nopostamble
+
+\generate{\file{fmp-doc.hs}{\from{fmp.dtx}{examples}}}
+
+% That's all, folks!
+
+\Msg{*****************************************************************}
+\Msg{*}
+\Msg{* To complete the installation, move `fmp.sty' to a place where}
+\Msg{* LaTeX can find it.}
+\Msg{*}
+\Msg{* To produce the documentation run}
+\Msg{* - latex fmp.dtx}
+\Msg{* - makeindex -s gglo.ist -o fmp.gls fmp.glo}
+\Msg{* - sh fmpgenerate.sh}
+\Msg{* - latex fmp.dtx}
+\Msg{*}
+\Msg{* (This assumes that you have the hugs Haskell compiler installed}
+\Msg{* and a working version of Functional MetaPost running.)}
+\Msg{*}
+\Msg{* Happy FMPing!}
+\Msg{*}
+\Msg{*****************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/fundus/calligra.dtx b/Master/texmf-dist/source/latex/fundus/calligra.dtx
new file mode 100644
index 00000000000..08fa3134106
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/calligra.dtx
@@ -0,0 +1,169 @@
+\def\filename{calligra.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: calligra.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{calligra}[1996/07/18 v1.8 LaTeX package calligra]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{calligra}
+\GetFileInfo{calligra.sty}
+\begin{document}
+\title{The \texttt{calligra} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{calligra.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{22}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release.}
+% \changes{v1.1}{1996//0519}{Macro textcalligra added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The font calligra provides a calligraphic font. Calligra can be found on
+% the CTAN in the directory \texttt{tex-archive/fonts/calligra}.
+% This package provides means to use this font in \LaTeXe.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font family calligra
+% is defined. This could also have been done by providing a
+% font definition file.
+%
+% The font definitions in this file scale down the original fonts to
+% allow \LaTeX{} to choose the right baselineskip.
+%
+%
+% \DescribeMacro{\calligra}
+% The command |\calligra| changes the current font family to calligra and
+% the encoding to T1. Usually this should be used in a \TeX{} group only
+% since the macros |\ss| is redefined as well.
+%
+%
+% \DescribeMacro{\textcalligra}
+% The command |\calligra| typesets its argument with the calligra font.
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the calligra font.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{calligra}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present calligra15. The
+% appropriate factor seems to be magstep 2 = 1.44.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{calligra}{m}{n}{<->s*[1.44]callig15}{}
+% \end{macrocode}
+%
+% Now we define the font changing command.
+%
+% \begin{macro}{\calligra}
+% The macro |\calligra| selects the calligra family. Since the kerning
+% of the \ss{} is terribly wrong we correct it within the macro |\ss|.
+% \begin{macrocode}
+\DeclareRobustCommand\calligra{%
+ \renewcommand\ss{\symbol{255}\kern-.22em}%
+ \fontfamily{calligra}%
+ \fontencoding{T1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\textcalligra}
+% The macro |\textcalligra| typesets its argument with the calligra font.
+% \begin{macrocode}
+\newcommand\textcalligra[1]{\begingroup
+ \renewcommand\ss{\symbol{255}\kern-.22em}%
+ \fontfamily{calligra}%
+ \fontencoding{T1}%
+ \selectfont #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/calligra.ins b/Master/texmf-dist/source/latex/fundus/calligra.ins
new file mode 100644
index 00000000000..5e9d0e302cb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/calligra.ins
@@ -0,0 +1,134 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{calligra.ins}
+\input docstrip.tex
+\preamble
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{calligra.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{calligra.sty}{t}{\from{calligra.dtx}{package}}
+
+\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 calligra.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/la.dtx b/Master/texmf-dist/source/latex/fundus/la.dtx
new file mode 100644
index 00000000000..0cb4f905efe
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/la.dtx
@@ -0,0 +1,236 @@
+\def\filename{la.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: la.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{la}[1996/07/18 v1.2 LaTeX package la]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{la}
+\GetFileInfo{la.sty}
+\begin{document}
+\title{The \texttt{la} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{la.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{61}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release.}
+% \changes{v1.1}{1996/05/19}{Macros textla, textlla added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The fonts la and lla provide glyphs for producing a handwritten
+% writing as tought in primary school. These fonts have been
+% written by Johannes Heuer. They can be found on
+% the CTAN in the directory \texttt{tex-archive/fonts/calligra}.
+% This package provides means to use those fonts in \LaTeXe.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font families la
+% and lla are defined. This could also have been done by providing two
+% font definition files.
+%
+% The font definitions in this file scale down the original fonts to
+% \LaTeX{} choose the right baselineskip. The original size of the la
+% fonts can be selected with the commands |\LARGE\la| or |\LARGE\lla|.
+%
+%
+% \DescribeMacro{\la}
+% The command |\la| changes the current font family to la and the
+% encoding to T1. Usually this should be used in a \TeX{} group only.
+%
+% \DescribeMacro{\textla}
+% This macro typesets its argument in the la font.
+%
+% \DescribeMacro{\lla}
+% The command |\lla| changes the current font family to lla and the
+% encoding to T1. Usually this should be used in a \TeX{} group only.
+%
+% \DescribeMacro{\textlla}
+% This macro typesets its argument in the lla font.
+%
+% \DescribeMacro{\llafill}
+% The command |\llafill| fills the rest of the line with lines as used
+% in the lla font. The result may be unexpected if not used where the
+% font family is not lla.
+%
+% \DescribeMacro{\llaline}
+% The command |\llaline| takes its argument and adds lines as used in
+% the lla font underneath. This is similar to the |\underline|
+% macro.
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the la font.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{la}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present la14. Since the
+% design size is 14 we have to scale down the font by $1/14=0.71428571$.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{la}{m}{n}{<->s*[0.71428571]la14}{}
+% \end{macrocode}
+%
+% Now we define the next font family for the font with lines in the
+% background.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{lla}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present lla14. Since the
+% design size is 14 we have to scale down the font by $1/14=0.71428571$.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{lla}{m}{n}{<->s*[0.71428571]lla14}{}
+% \end{macrocode}
+%
+% Now we define font changing commands.
+%
+% \begin{macro}{\la}
+% The macro |\la| selects the la family.
+% \begin{macrocode}
+\DeclareRobustCommand\la{\fontfamily{la}\fontencoding{T1}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textla}
+% The macro |\textla| typesets its arguments in the la font.
+% \begin{macrocode}
+\newcommand\textla[1]{\begingroup
+ \fontfamily{la}\fontencoding{T1}\selectfont #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lla}
+% The macro |\lla| selects the lla family.
+% \begin{macrocode}
+\DeclareRobustCommand\lla{\fontfamily{lla}\fontencoding{T1}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textlla}
+% The macro |\textla| typesets its arguments in the lla font.
+% \begin{macrocode}
+\newcommand\textlla[1]{\begingroup
+ \fontfamily{lla}\fontencoding{T1}\selectfont #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\llafill}
+% The macro |\llafill| is modeled after the macro |\underline|. The
+% symbol 24 in the lla font provides just the lines.
+% \begin{macrocode}
+\newcommand\llafill{\leaders\hbox{\kern.2em\symbol{24}}\hfill\symbol{24}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\llaline}
+% The macro |\llaline| packs its argument into a box. Then a box of
+% the same size is filled with empty lines and the original box is
+% typeset in a box of width 0 afterwards.
+% \begin{macrocode}
+\newcommand\llaline[1]{%
+ {\lla\symbol{24}%
+ \mbox{\setbox0=\hbox{#1}\hbox to \wd0{\llafill}\llap{\usebox0}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{llapar}
+% This environment typesets one or more paragraphs with the lla
+% font. The |\llaline| instructions are inserted automatically at
+% the end of each paragraph.
+%
+% \begin{macrocode}
+\newenvironment{llapar}{\par\begingroup\lla
+ \let\lla@par=\par
+ \def\par{\llafill\lla@par}}{\par\endgroup}
+% \end{macrocode}
+% \end{environment}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/la.ins b/Master/texmf-dist/source/latex/fundus/la.ins
new file mode 100644
index 00000000000..814c2ce9054
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/la.ins
@@ -0,0 +1,135 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{la.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{la.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{la.sty}{t}{\from{la.dtx}{package}}
+
+\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 la.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/outline.dtx b/Master/texmf-dist/source/latex/fundus/outline.dtx
new file mode 100644
index 00000000000..17f3481cf18
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/outline.dtx
@@ -0,0 +1,185 @@
+\def\filename{outline.dtx}
+\def\fileversion{1.1}
+\def\filedate{1997/08/26}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1997 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: outline.dtx
+%% Copyright (C) 1997 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{outline}[1997/08/26 v1.1 LaTeX package outline]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{outline}
+\GetFileInfo{outline.sty}
+\begin{document}
+\title{The \texttt{outline} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{outline.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{19}
+%% \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 \~}
+%
+% \changes{v1.0}{1997/08/01}{First internal version.}
+% \changes{v1.1}{1997/08/26}{Renaming and some rearrangements.}
+%
+%
+% \section{Introduction}
+%
+% Doug Henderson has provided some routines in METAFONT to create
+% outlined versions of arbitrary METAFONT fonts. They can be found
+% on the CTAN in the directory
+% \texttt{tex-archive/fonts/cm/cmoutlines} together with some
+% sample files which show outlined versions of a few computer
+% modern fonts.
+% This package provides means to use suich outlined fonts in \LaTeXe.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards some new commands
+% are defined which are described below. Note that before these
+% commands can be used a font has to be selected. This is done with
+% the following command:
+%
+% \DescribeMacro{\SetOutlineFonts}
+% The command |\SetOutlineFonts| initializes the fonts used for
+% the outlining macros. The first argument is a font specification
+% as used by \verb|\newfont|. Note that no spaces are allowed at
+% the beginning. This font is loaded together with a font which has
+% an \verb|o| prepended to its name. The font specification may
+% contain scaling instructions. Thus the following invocation is
+% legal:
+%
+% \verb|\SetOutlineFonts{cmbx12 scaled \magstep2}|
+%
+% This instruction requires the tfm files of the fonts
+% \texttt{cmbx12} and \texttt{ocmbx12} to be loadable in the given
+% sizes. The font with the prepended \verb|o| is assumed to contain
+% the outlined version of the font without the leading \verb|o|.
+%
+% \DescribeMacro{\outline}
+% The command |\outline| typesets its argument in a box using the
+% outlined font declared with \verb|\SetOutlineFonts|.
+%
+% \DescribeMacro{\OutLine}
+% The command |\OutLine| typesets its third argument in a box
+% using the outlined font declared with \verb|\SetOutlinedFonts|.
+% The interior of the characters is drawn in the color given as
+% first argument. The outline is drawn in the color given as second
+% argument. The colors can take any color names accepted by the
+% color package. Thus
+%
+% \verb|\OutLine{yellow}{red}{Outlined text}|
+%
+% typesets the text ``Outlined text'' in yellow bordered in red.
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% \begin{macrocode}
+\RequirePackage{color}
+% \end{macrocode}
+%
+% \begin{macro}{\SetOutlineFonts}
+% The macro |\SetOutlineFonts| loads the fonts for the outline macros.
+% \begin{macrocode}
+\newcommand\SetOutlineFonts[1]{%
+ \newfont\OL@i{o#1}%
+ \newfont\OL@ii{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\outline}
+% The macro |\outline| typesets its argument with the outline font.
+% \begin{macrocode}
+\newcommand\outline[1]{\mbox{\OL@i #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\OutLine}
+% The macro |\OutLine| typesets its argument with the outline
+% font. The interior is filled with the color given as second
+% argument. The color of the outline is given as third argument.
+
+% \begin{macrocode}
+\newcommand\OutLine[3]{%
+ \mbox{\rlap{\textcolor{#1}{\OL@ii #3}}\textcolor{#2}{\OL@i #3}}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/outline.ins b/Master/texmf-dist/source/latex/fundus/outline.ins
new file mode 100644
index 00000000000..0b6e288e578
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/outline.ins
@@ -0,0 +1,133 @@
+%%
+%% 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 1997 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{outline.ins}
+\input docstrip.tex
+\preamble
+
+This is a generated file.
+
+Copyright 1997 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+\endpreamble
+\def\filedate{1997/08/26}
+\def\batchfile{outline.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{outline.sty}{t}{\from{outline.dtx}{package}}
+
+\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 outline.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/pvscript.dtx b/Master/texmf-dist/source/latex/fundus/pvscript.dtx
new file mode 100644
index 00000000000..27456221b9c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/pvscript.dtx
@@ -0,0 +1,175 @@
+\def\filename{pvscript.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: pvscript.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{pvscript}[1996/07/18 v1.2 LaTeX package pvscript]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{pvscript}
+\GetFileInfo{pvscript.sty}
+\begin{document}
+\title{The \texttt{pvscript} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{pvscript.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{63}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release}
+% \changes{v1.1}{1996/05/19}{Macro textpvscript added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The font pvscript provides a handwritten font. It can be found on
+% the CTAN in the directory \texttt{tex-archive/fonts/script}.
+% This package provides means to use this font.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font family pvscript
+% is defined. This could also have been done by providing a
+% font definition file.
+%
+%
+% \DescribeMacro{\pvscript}
+% The command |\pvscript| changes the current font family to pvscript and
+% the encoding to OT1. Usually this should be used in a \TeX{} group only
+% since it changes the font encoding and redefines the umlaut macro.
+%
+% \DescribeMacro{\textpvscript}
+% The macro |\textpvscript| typesets its argument in the pvscript font.
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the pvscript font.
+% \begin{macrocode}
+\DeclareFontFamily{OT1}{pvscript}{}
+% \end{macrocode}
+%
+% This font is available in the normal shape and in a bold variant.
+% Here we can get the desired font by (silently) scaling the present fonts.
+%
+% \begin{macrocode}
+\DeclareFontShape{OT1}{pvscript}{m}{n}{<-> s * [12.84]script10}{}
+\DeclareFontShape{OT1}{pvscript}{bx}{n}{<-> s * [12.84]scriptb10}{}
+\DeclareFontShape{OT1}{pvscript}{b}{n}{<-> sub * pvscript/bx/n}{}
+% \end{macrocode}
+%
+% Next we define some macros to perform the mapping of umlaut
+% characters which have to be combined out of two characters each.
+% \begin{macrocode}
+\newcommand\pvscript@a{\mbox{\rlap{\kern.25em\symbol{34}}a}}
+\newcommand\pvscript@o{\mbox{\rlap{\kern.1em\symbol{34}}o}}
+\newcommand\pvscript@u{\mbox{\rlap{\kern.1em\symbol{34}}u}}
+\newcommand\pvscript@A{\mbox{\rlap{\kern.5em\raisebox{1ex}{\symbol{34}}}A}}
+\newcommand\pvscript@O{\mbox{\rlap{\kern.4em\raisebox{1ex}{\symbol{34}}}O}}
+\newcommand\pvscript@U{\mbox{\rlap{\kern.4em\raisebox{1ex}{\symbol{34}}}U}}
+% \end{macrocode}
+%
+% Now we define the font changing command.
+%
+% \begin{macro}{pvscript}
+% The macro |\pvscript| selects the pvscript family.
+% \begin{macrocode}
+\DeclareRobustCommand\pvscript{
+ \let\pvscript@original@umlaut=\"
+ \def\"##1{%
+ \@ifundefined{pvscript@##1}{%
+ \pvscript@original@umlaut{##1}}{%
+ \@nameuse{pvscript@##1}}}%
+ \def\ss{ss}%
+ \fontfamily{pvscript}%
+ \fontencoding{OT1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{textpvscript}
+% The macro |\textpvscript| typesets its argument in the pvscript font.
+% \begin{macrocode}
+\newcommand\textpvscript[1]{\begingroup\pvscript #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/pvscript.ins b/Master/texmf-dist/source/latex/fundus/pvscript.ins
new file mode 100644
index 00000000000..816d8d7d182
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/pvscript.ins
@@ -0,0 +1,135 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{pvscript.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{pvscript.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{pvscript.sty}{t}{\from{pvscript.dtx}{package}}
+
+\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 pvscript.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/startrek.dtx b/Master/texmf-dist/source/latex/fundus/startrek.dtx
new file mode 100644
index 00000000000..43d038e4feb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/startrek.dtx
@@ -0,0 +1,201 @@
+%<*package>
+\def\filename{startrek.dtx}
+\def\fileversion{1.0}
+\def\filedate{1996/08/12}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: startrek.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{startrek}[1996/08/12 v1.0 LaTeX package startrek]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{startrek}
+\GetFileInfo{startrek.sty}
+\begin{document}
+\title{The \texttt{startrek} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeXe}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{startrek.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{50}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/08/12}{First release.}
+%
+%
+% \section{Introduction}
+%
+% This package provides a means to use some PostScript fonts with
+% \LaTeX. The fonts are similar to some fonts used in the context
+% of the startrek films.
+%
+% The PostScript fionts are not contained in the distribution but
+% have to be a got separately.
+%
+% \section{Usage}
+%
+%
+%
+% \DescribeMacro{\la}
+% The command |\la| changes the current font family to la and the
+% encoding to T1. Usually this should be used in a \TeX{} group only.
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+% \begin{macro}{\TNG}
+% The macro |\TNG| selects the StarTrekTNGCrilleA family.
+% \begin{macrocode}
+\DeclareRobustCommand\TNG{\fontfamily{ftc}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textTNG}
+% The macro |\textTNG| typesets its arguments in the
+% StarTrekTNGCrilleA font.
+% \begin{macrocode}
+\DeclareTextFontCommand\textTNG{\fontfamily{ftc}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\STClassic}
+% The macro |\STClassic| selects the StarTrekClassicA family.
+% \begin{macrocode}
+\DeclareRobustCommand\STClassic{\fontfamily{fsc}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textSTClassic}
+% The macro |\textSTClassic| typesets its arguments in the
+% StarTrekClassicA font.
+% \begin{macrocode}
+\DeclareTextFontCommand\textSTClassic{\fontfamily{fsc}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\STMovie}
+% The macro |\STMovie| selects the StarTrekClassicMoviesA family.
+% \begin{macrocode}
+\DeclareRobustCommand\STMovie{\fontfamily{fsm}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textSTMovie}
+% The macro |\textSTMovie| typesets its arguments in the
+% StarTrekClassicMoviesA font.
+% \begin{macrocode}
+\DeclareTextFontCommand\textSTMovie{\fontfamily{fsm}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TNGtitle}
+% The macro |\TNGtitle| selects the StarTrekTNGTitleA family.
+% \begin{macrocode}
+\DeclareRobustCommand\TNGtitle{\fontfamily{ftt}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textTNGtitle}
+% The macro |\textTNGtitle| typesets its arguments in the
+% StarTrekTNGTitleA font.
+% \begin{macrocode}
+\DeclareTextFontCommand\textTNGtitle{\fontfamily{ftt}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TNGmon}
+% The macro |\TNGmon| selects the TNGMonitorsPlain family.
+% \begin{macrocode}
+\DeclareRobustCommand\TNGmon{\fontfamily{ftm}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textTNGmon}
+% The macro |\textTNGmon| typesets its arguments in the
+% TNGMonitorsPlain font.
+% \begin{macrocode}
+\DeclareTextFontCommand\textTNGmon{\fontfamily{ftm}\selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+%</package>
+%<*map>
+% \begin{macrocode}
+ftc0 StarTrekTNGCrilleA <ftc0.pfb
+fsc0 StarTrekClassicA <fsc0.pfb
+fsm0 StarTrekClassicMoviesA <fsm0.pfb
+ftt0 StarTrekTNGTitleA <ftt0.pfb
+ftm0 TNGMonitorsPlain <ftm0.pfb
+% \end{macrocode}
+%</map>
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/startrek.ins b/Master/texmf-dist/source/latex/fundus/startrek.ins
new file mode 100644
index 00000000000..36401769c39
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/startrek.ins
@@ -0,0 +1,141 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{startrek.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/08/09}
+\def\batchfile{startrek.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{startrek.sty}{t}{\from{startrek.dtx}{package}}
+
+\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 startrek.sty}
+\Msg{*}
+\Msg{* and append the contents of}
+\Msg{*}
+\Msg{* \space\space startrek.map}
+\Msg{*}
+\Msg{* to psfonts.map (virtuall or physically).}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/startrek.map b/Master/texmf-dist/source/latex/fundus/startrek.map
new file mode 100644
index 00000000000..c626d3224a9
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/startrek.map
@@ -0,0 +1,9 @@
+%------------------------------------------------------------------------------
+%
+fscr0 StarTrekClassicA <fscr0.pfb
+fslr0 Slider <fslr0.pfb
+fsmr0 StarTrekClassicMoviesA <fsmr0.pfb
+ftcr0 StarTrekTNGCrilleA <ftcr0.pfb
+ftmr0 TNGMonitorsPlain <ftmr0.pfb
+fttr0 StarTrekTNGTitleA <fttr0.pfb
+%------------------------------------------------------------------------------
diff --git a/Master/texmf-dist/source/latex/fundus/stclass.zip b/Master/texmf-dist/source/latex/fundus/stclass.zip
new file mode 100644
index 00000000000..f978f967516
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/stclass.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/fundus/stmov.zip b/Master/texmf-dist/source/latex/fundus/stmov.zip
new file mode 100644
index 00000000000..e5202fb97d0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/stmov.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/fundus/suetterl.dtx b/Master/texmf-dist/source/latex/fundus/suetterl.dtx
new file mode 100644
index 00000000000..e2701bbcf6d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/suetterl.dtx
@@ -0,0 +1,173 @@
+\def\filename{suetterl.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: suetterl.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{suetterl}[1996/07/18 v1.2 LaTeX package suetterl]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{suetterl}
+\GetFileInfo{suetterl.sty}
+\begin{document}
+\title{The \texttt{suetterl} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{suetterl.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{18}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release}
+% \changes{v1.1}{1996/05/19}{Macro textsuetterlin added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The font suetterl provides a suetterlin kind of font. This fonts
+% are the handwritten variants of the gothic fonts. The sutterl and
+% the schwell font have been written by B.~Ludewig. They can be
+% found on the CTAN in the directory
+% \texttt{tex-archive/fonts/gothic/sueterl}.
+% This package provides means to use this font.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font family suetterl
+% is defined. This could also have been done by providing a
+% font definition file.
+%
+% The font definitions in this file scale down the original fonts
+% to let \LaTeX{} choose the right baselineskip.
+%
+% \DescribeMacro{\suetterlin}
+% The command |\suetterlin| changes the current font family to
+% suetterl and the encoding to T1. Usually this should be used in a
+% \TeX{} group only since the macros |\s| is redefined as well.
+%
+% \DescribeMacro{\textsuetterlin}
+% The command |\textsuetterlin| typesets its argument in the
+% suetterl font.
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the suetterl font.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{suetterl}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present suett15. The
+% appropriate factor seems to be magstep 2 = 1.44.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{suetterl}{m}{n}{<->s*[0.8]suet14}{}
+\DeclareFontShape{T1}{suetterl}{m}{it}{<->s*[0.7]schwell}{}
+% \end{macrocode}
+%
+% Now we define font changing command.
+%
+% \begin{macro}{\sutterlin}
+% The macro |\suetterlin| selects the suetterl family. The macro |\s|
+% is used for the short s.
+% \begin{macrocode}
+\DeclareRobustCommand\suetterlin{%
+ \renewcommand\s{\symbol{28}}%
+ \fontfamily{suetterl}%
+ \fontencoding{T1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\s}
+% Usually |\s| produces a normal s.
+% \begin{macrocode}
+\newcommand\s{s}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textsutterlin}
+% The macro |\textsuetterlin| typesets is argument in the sutterl font.
+% \begin{macrocode}
+\newcommand\textsuetterlin[1]{\begingroup\suetterlin #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/suetterl.ins b/Master/texmf-dist/source/latex/fundus/suetterl.ins
new file mode 100644
index 00000000000..1891fb89af0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/suetterl.ins
@@ -0,0 +1,135 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{suetterl.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{suetterl.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{suetterl.sty}{t}{\from{suetterl.dtx}{package}}
+
+\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 suetterl.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/tngcril.zip b/Master/texmf-dist/source/latex/fundus/tngcril.zip
new file mode 100644
index 00000000000..29182c33cd2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/tngcril.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/fundus/tngmon.zip b/Master/texmf-dist/source/latex/fundus/tngmon.zip
new file mode 100644
index 00000000000..efbaa809b27
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/tngmon.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/fundus/tngtit.zip b/Master/texmf-dist/source/latex/fundus/tngtit.zip
new file mode 100644
index 00000000000..82719ab22a5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/tngtit.zip
Binary files differ
diff --git a/Master/texmf-dist/source/latex/fundus/twcal.dtx b/Master/texmf-dist/source/latex/fundus/twcal.dtx
new file mode 100644
index 00000000000..b2a9bae6eba
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/twcal.dtx
@@ -0,0 +1,193 @@
+\def\filename{twcal.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: twcal.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{twcal}[1996/07/18 v1.2 LaTeX package twcal]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{twcal}
+\GetFileInfo{twcal.sty}
+\begin{document}
+\title{The \texttt{twcal} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{twcal.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{64}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release.}
+% \changes{v1.1}{1996/05/19}{Macro texttwcal added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The font twcal provides a calligraphic font. This font has been
+% written by Thomas Weinmann. It can be found on the CTAN in the
+% directory \texttt{tex-archive/fonts/twcal}.
+% This package provides means to use this font.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font family twcal
+% is defined. This could also have been done by providing a
+% font definition file.
+%
+%
+% \DescribeMacro{\twcal}
+% The command |\twcal| changes the current font family to twcal and the
+% encoding to OT1. Usually this should be used in a \TeX{} group only
+% since it changes the font encoding and redefines the umlaut macro.
+%
+% \DescribeMacro{\texttwcal}
+% The macro |\texttwcal| typesets its argument in the twcal font.
+%
+% \DescribeMacro{\twcallogo}
+% The command |\twcallogo| typesetz the logo for the twcal font as
+% defined by the author of the font.
+%
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the twcal font.
+% \begin{macrocode}
+\DeclareFontFamily{OT1}{twcal}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present fonts.
+%
+% \begin{macrocode}
+\DeclareFontFamily{OT1}{twcal}{}
+\DeclareFontShape{OT1}{twcal}{m}{n}{<->s*[0.7]twcal14}{}
+% \end{macrocode}
+%
+% Next we define some macros to perform the mapping of umlaut
+% characters to the unusual positions used in this font.
+% \begin{macrocode}
+\newcommand\twcal@a{\char26}
+\newcommand\twcal@o{\char27}
+\newcommand\twcal@u{\char28}
+\newcommand\twcal@A{\char29}
+\newcommand\twcal@O{\char30}
+\newcommand\twcal@U{\char31}
+% \end{macrocode}
+%
+% Now we define the font changing command.
+%
+% \begin{macro}{\twcal}
+% The macro |\twcal| selects the twcal family.
+% \begin{macrocode}
+\DeclareRobustCommand\twcal{%
+ \let\twcal@original@umlaut=\"
+ \def\"##1{%
+ \@ifundefined{twcal@##1}{%
+ \twcal@original@umlaut{##1}}{%
+ \@nameuse{twcal@##1}}}%
+ \fontfamily{twcal}%
+ \fontencoding{OT1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\texttwcal}
+% The macro |\texttwcal| typesets its argument in the twcal font.
+% \begin{macrocode}
+\newcommand\texttwcal[1]{\begingroup\twcal #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\twcallogo}
+% Finally we provide the logo for this font as defined by the author
+% of the font.
+% \begin{macrocode}
+\newcommand\twcallogo{\mbox{\({
+ \lower-0.3ex\hbox{T}\kern-0.22em
+ \lower0.3ex\hbox{W}\kern-0em
+ \lower-0.3ex\hbox{C}\kern-0.24em
+ \lower0.3ex\hbox{A}\kern-0.14em
+ \lower-0.3ex\hbox{L}}\kern-0.19em
+ \lower0.1ex\hbox{1}\kern-0.14em
+ \lower-0.1ex\hbox{4}\)}}
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/twcal.ins b/Master/texmf-dist/source/latex/fundus/twcal.ins
new file mode 100644
index 00000000000..9b8a48b3e3c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/twcal.ins
@@ -0,0 +1,135 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{twcal.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{twcal.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{twcal.sty}{t}{\from{twcal.dtx}{package}}
+
+\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 twcal.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/va.dtx b/Master/texmf-dist/source/latex/fundus/va.dtx
new file mode 100644
index 00000000000..0e0eff01d21
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/va.dtx
@@ -0,0 +1,195 @@
+\def\filename{va.dtx}
+\def\fileversion{1.2}
+\def\filedate{1996/07/18}
+\let\docversion=\fileversion
+\let\docdate=\filedate
+% \iffalse meta-comment
+%
+% Copyright 1996 by Gerd Neugebauer
+%
+% For further copyright information, and conditions for modification
+% and distribution, see the file legal.txt, and any other copyright
+% notices in this file.
+%
+% This system 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.
+%
+% For error reports concerning UNCHANGED versions of this file no
+% more than one year old, see bugs.txt.
+%
+% Please do not request updates from us directly. Primary
+% distribution is through the CTAN archives.
+%
+%
+% IMPORTANT COPYRIGHT NOTICE:
+%
+% You are NOT ALLOWED to distribute this file alone.
+%
+% You are allowed to distribute this file under the condition that it
+% is distributed together with all the files listed in manifest.txt.
+%
+% If you receive only some of these files from someone, complain!
+%
+%
+% Permission is granted to copy this file to another file with a
+% clearly different name and to customize the declarations in that
+% copy to serve the needs of your installation, provided that you
+% comply with the conditions in the file legal.txt.
+%
+% However, NO PERMISSION is granted to produce or to distribute a
+% modified version of this file under its original name.
+%
+% You are NOT ALLOWED to change this file.
+%
+%
+%
+% \fi
+% \iffalse
+%%% File: la.dtx
+%% Copyright (C) 1996 Gerd Neugebauer
+%% all rights reserved.
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{va}[1996/07/18 v1.2 LaTeX package la]
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{va}
+\GetFileInfo{va.sty}
+\begin{document}
+\title{The \texttt{va} package\thanks
+ {This file has version number \fileversion, dated \filedate.}\\
+ for use with \LaTeX2e}
+\author{Gerd Neugebauer\\Mainzer Str.~16\\56321 Rhens\\
+ \texttt{gerd@informatik.uni-koblenz.de}}
+\date{\docdate}
+\maketitle
+\DocInput{va.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{24}
+%% \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 \~}
+%
+% \changes{v1.0}{1996/03/03}{First release.}
+% \changes{v1.1}{1996//0519}{Macros textva, textvacal added.}
+% \changes{v1.2}{1996/07/18}{Some commands made robust.}
+%
+%
+% \section{Introduction}
+%
+% The fonts va and vacal provide glyphs for producing a handwritten
+% writing. This package provides means to use those fonts.
+%
+%
+% \section{Usage}
+%
+% This file can be used as a package by placing its name
+% in the argument of |\usepackage|. Afterwards the font families va
+% and vacal are defined. This could also have been done by providing two
+% font definition files.
+%
+% The font definitions in this file scale down the original fonts to
+% \LaTeX{} choose the right baselineskip. The original size of the va
+% fonts can be selected with the commands |\Large\va| or |\Large\vacal|.
+%
+%
+% \DescribeMacro{\va}
+% The command |\va| changes the current font family to va and the
+% encoding to T1. Usually this should be used in a \TeX{} group only.
+%
+% \DescribeMacro{\textva}
+% The command |\textva| typesets its argument in the va font.
+%
+% \DescribeMacro{\vacal}
+% The command |\vacal| changes the current font family to vacal and the
+% encoding to T1. Usually this should be used in a \TeX{} group only.
+%
+% \DescribeMacro{\textvacal}
+% The command |\textvacal| typesets its argument in the vacal font.
+%
+% \StopEventually{}
+%
+%
+% \section{Implementation}
+%
+%
+% First we declare a new font family for the va font.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{va}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present va14. Since the
+% design size is 14 we have to scale down the font.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{va}{m}{n}{<->s*[0.7]va14}{}
+% \end{macrocode}
+%
+% Next we do the same things for the font family vacal.
+% \begin{macrocode}
+\DeclareFontFamily{T1}{vacal}{}
+% \end{macrocode}
+%
+% This font is only available in the normal shape. Here we can get the
+% desired font by (silently) scaling the only present vacal14. Since the
+% design size is 14 we have to scale down the font.
+%
+% \begin{macrocode}
+\DeclareFontShape{T1}{vacal}{m}{n}{<->s*[0.7]vacal14}{}
+% \end{macrocode}
+%
+% Now we define font changing commands.
+%
+% \begin{macro}{\va}
+% The macro |\va| selects the va family.
+% \begin{macrocode}
+\DeclareRobustCommand\va{%
+ \fontfamily{va}%
+ \fontencoding{T1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textva}
+% The macro |\textva| typesets its argument in the va font.
+% \begin{macrocode}
+\newcommand\textva[1]{\begingroup\va #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\vacal}
+% The macro |\vacal| selects the vacal family.
+% \begin{macrocode}
+\DeclareRobustCommand\vacal{%
+ \fontfamily{vacal}%
+ \fontencoding{T1}%
+ \selectfont}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textva}
+% The macro |\textvacal| typesets its argument in the vacal font.
+% \begin{macrocode}
+\newcommand\textvacal[1]{\begingroup\vacal #1\endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/fundus/va.ins b/Master/texmf-dist/source/latex/fundus/va.ins
new file mode 100644
index 00000000000..655094c7928
--- /dev/null
+++ b/Master/texmf-dist/source/latex/fundus/va.ins
@@ -0,0 +1,135 @@
+%%
+%% 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 1996 by Gerd Neugebauer
+%%
+%% For further copyright information, and conditions for modification
+%% and distribution, see the file legal.txt, and any other copyright
+%% notices in this file.
+%%
+%% This system 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.
+%%
+%% For error reports concerning UNCHANGED versions of this file no
+%% more than one year old, see bugs.txt.
+%%
+%% Please do not request updates from us directly. Primary
+%% distribution is through the CTAN archives.
+%%
+%%
+%% IMPORTANT COPYRIGHT NOTICE:
+%%
+%% You are NOT ALLOWED to distribute this file alone.
+%%
+%% You are allowed to distribute this file under the condition that it
+%% is distributed together with all the files listed in manifest.txt.
+%%
+%% If you receive only some of these files from someone, complain!
+%%
+%%
+%% No other permissions to distribute this file in any form are
+%% granted and in particular NO PERMISSION to modify its contents.
+%%
+%% You are NOT ALLOWED to change this file.
+%%
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{va.ins}
+\input docstrip.tex
+\preamble
+
+
+This is a generated file.
+
+Copyright 1996 by Gerd Neugebauer
+
+For further copyright information, and conditions for modification
+and distribution, see the file legal.txt, and any other copyright
+notices in this file.
+
+ This system 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.
+
+ For error reports concerning UNCHANGED versions of this file no
+ more than one year old, see bugs.txt.
+
+ Please do not request updates from us directly. Primary
+ distribution is through the CTAN archives.
+
+
+IMPORTANT COPYRIGHT NOTICE:
+
+You are NOT ALLOWED to distribute this file alone.
+
+You are allowed to distribute this file under the condition that it
+is distributed together with all the files listed in manifest.txt.
+
+If you receive only some of these files from someone, complain!
+
+
+Permission is granted to copy this file to another file with a
+clearly different name and to customize the declarations in that
+copy to serve the needs of your installation, provided that you
+comply with the conditions in the file legal.txt.
+
+However, NO PERMISSION is granted to generate or to distribute a
+modified version of this file under its original name.
+
+You are NOT ALLOWED to change this file.
+
+
+MODIFICATION ADVICE:
+
+If you want to customize this file, it is best to make a copy of
+the source file(s) from which it was produced. Use a different
+name for your copy(ies) and modify the copy(ies); this will ensure
+that your modifications do not get overwritten when you install a
+new release of the standard system. You should also ensure that
+your modified source file does not generate any modified file with
+the same name as a standard file.
+
+You can then easily distribute your modifications by distributing
+the modified and renamed copy of the source file, taking care to
+observe the conditions in legal.txt; this will ensure that other
+users can safely use your modifications.
+
+You will also need to produce your own, suitably named, .ins file to
+control the generation of files from your source file; this file
+should contain your own preambles for the files it generates, not
+those in the standard .ins files.
+
+The names of the source files used are shown above.
+
+
+
+\endpreamble
+\def\filedate{1996/03/03}
+\def\batchfile{va.dtx}
+\input docstrip.tex
+
+\keepsilent
+
+\Msg{*** Generating .sty file ***}
+
+\generateFile{va.sty}{t}{\from{va.dtx}{package}}
+
+\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 va.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX2e.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/glossary/glossary.dtx b/Master/texmf-dist/source/latex/glossary/glossary.dtx
new file mode 100644
index 00000000000..bf00b2ba979
--- /dev/null
+++ b/Master/texmf-dist/source/latex/glossary/glossary.dtx
@@ -0,0 +1,4778 @@
+%\iffalse
+% glossary.dtx generated using makedtx version 0.9b (c) Nicola Talbot
+% Command line args:
+% -macrocode ".*\.p.*l"
+% -macrocode ".*\.bat"
+% -setambles ".*\.p.*l=>\nopreamble\nopostamble"
+% -setambles ".*\.bat=>\nopreamble\nopostamble"
+% -src "(.+)\.(sty)=>\1.\2"
+% -src "(.+)\.(pl)=>\1.\2"
+% -src "(.+)\.(bat)=>\1.\2"
+% -src "(.+)\.(perl)=>\1.\2"
+% -src "(.+)\.(tex)=>\1.\2"
+% -doc "manual.tex"
+% -author "Nicola Talbot"
+% -dir "source"
+% glossary
+% Created on 2005/9/27 12:20
+%\fi
+%\iffalse
+%<*package>
+%% \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 \~}
+%</package>
+%\fi
+% \iffalse
+% Doc-Source file to use with LaTeX2e
+% Copyright (C) 2005 Nicola Talbot, all rights reserved.
+% \fi
+% \iffalse
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage{ifthen}
+\usepackage[colorlinks,
+ bookmarks,
+ hyperindex=false,
+ pdfauthor={N.L.C. Talbot},
+ pdftitle={glossary.sty: LaTeX2e Package to Assist Generating Glossaries},
+ pdfkeywords={LaTeX,package,glossary}]{hyperref}
+
+ %hyperindex conflicts with doc
+ %(end up with |usage|hyperpage in indexentry)
+ %This unfortunately means that the changes section doesn't
+ %have active links, but at least it will keep makeindex happy.
+
+
+\renewcommand{\usage}[1]{\textit{\hyperpage{#1}}}
+\renewcommand{\main}[1]{\hyperpage{#1}}
+\newcommand{\see}[2]{\emph{see} #1}
+\makeatletter
+\def\index@prologue{\section*{Index}}
+\makeatother
+\RecordChanges
+\PageIndex
+\OnlyDescription
+
+
+\newcommand{\cmdname}[1]{\texttt{\symbol{92}#1}}
+\newcommand{\istkey}[1]{\texttt{#1}\index{makeindex key>#1|hyperpage}}
+\newcommand{\icmdname}[1]{\texttt{\symbol{92}#1}\SpecialMainIndex{#1}}
+\newcommand{\appname}[1]{\texttt{#1}\index{#1=\texttt{#1}|hyperpage}}
+\newcommand{\gloskey}[1]{\texttt{#1}\index{glossary keys=\cmdname{glossary} keys>#1|hyperpage}}
+\newcommand{\setglos}[1]{\texttt{#1}\index{setglossary keys=\cmdname{setglossary} keys>#1|hyperpage}}
+\newcommand{\glsnumfmt}[1]{\texttt{#1}%
+\index{page number formats>#1|hyperpage}%
+\index{glossary keys=\cmdname{glossary} keys>format>#1|hyperpage}}
+\newcommand{\pkgopt}[2][]{%
+\ifthenelse{\equal{#1}{}}{%
+\texttt{#2}\index{package options>#2|hyperpage}}{%
+\texttt{#2=#1}\index{package options>#2>#1|hyperpage}}}
+\newcommand{\pkgoptval}[2]{\texttt{#1}\index{package options>#2>#1|hyperpage}}
+\newcommand{\filetype}[1]{\texttt{#1}\index{file types>#1|hyperpage}}
+\newcommand{\stynamefmt}[1]{\textsf{#1}\index{#1=\textsf{#1}|hyperpage}}
+\newcommand{\envname}[1]{\textsf{#1}}
+
+
+\begin{document}
+\DocInput{glossary.dtx}
+\end{document}
+%</driver>
+%\fi
+%\MakeShortVerb{"}
+%\DeleteShortVerb{\|}
+%
+% \title{glossary.sty v 2.24: \LaTeXe\ Package to Assist Generating Glossaries}
+% \author{Nicola L.C. Talbot}
+% \date{27th September 2005}
+% \maketitle
+%\tableofcontents
+%
+% \section{Introduction}
+% \changes{1.0}{2004 July 29}{Initial version}
+% The \stynamefmt{glossary} package is provided to assist
+%generating a glossary. It has a certain amount of flexibility,
+%allowing the user to customize the format of the glossary, and
+%define new glossary-style objects.
+%
+%\section{Installation}
+%
+%You need to make sure you have downloaded the following three
+%files:
+%\begin{verbatim}
+%glossary.ins
+%glossary.dtx
+%README
+%\end{verbatim}
+%To extract the code from the \texttt{glossary.dtx} file, you
+%will need to run the installation file through LaTeX:
+%\begin{verbatim}
+%latex glossary.ins
+%\end{verbatim}
+%This will create the following files:
+%\begin{verbatim}
+%glossary.sty
+%glossary.perl
+%makeglos.pl
+%makeglos.bat
+%\end{verbatim}
+%along with several sample files. The file \texttt{glossary.sty}
+%should be placed somewhere in the \LaTeX\ path, e.g.\
+%\texttt{texmf/tex/latex/glossary/}. The file
+%\texttt{glossary.perl} is a \LaTeX2HTML\ style file, and should
+%be placed in the \LaTeX2HTML\ style file directory (usually
+%\texttt{latex2html/styles/}). The file \texttt{makeglos.pl}
+%is a Perl script which calls \appname{makeindex}. If you are
+%using UNIX or Linux, you will need to set the permissions so
+%that you can execute the file:
+%\begin{verbatim}
+%chmod a+x makeglos.pl
+%\end{verbatim}
+%You should then place this file somewhere on your path.
+%(You may also need to edit the first line of
+%this file, if \appname{perl} is located in a directory other than \verb"/usr/bin/"\footnote{and you can also remove the \texttt{.pl}
+%extension which isn't to everyone's liking.}.)
+%
+%If you are not using UNIX or Linux, you may have to explicitly
+%load the file into Perl, so you would need to do
+%\texttt{perl makeglos.pl} instead of just \texttt{makeglos.pl}.
+%If you are using Windows, a batch file, \texttt{makeglos.bat}
+%is provided which will run Perl on \texttt{makeglos.pl}.
+%Both \texttt{makeglos.pl} and \texttt{makeglos.bat} should
+%be placed somewhere specified by the PATH environment
+%variable. (For example, put them both in the same
+%directory as \appname{makeindex}, which will probably
+%be in \verb+\texmf\miktex\bin\+).
+%\changes{2.22}{2005 Sept 12}{added makeglos.bat file}
+%
+%If you don't have Perl installed on your system, you can just use
+%\appname{makeindex}, only you will have to remember all the
+%command line switches, and you won't be able to merge entries
+%that have the same name, but different descriptions.
+%
+% \section{Generating Glossary Information}
+%
+% The standard \LaTeX\ command \cmdname{makeglossary}\DescribeMacro{\makeglossary}{} (analogous to \cmdname{makeindex})
+% should be placed in the document preamble. If this command
+%is omitted, glossary information will be ignored. Glossary
+%entries are generated using the command
+%\cmdname{glossary}\verb"{"\meta{key-val list}\verb'}'\DescribeMacro{\glossary}.
+% This command is a slightly modified version of the standard
+%\cmdname{glossary} command, in order to separate out the
+%information into \meta{entry-name} and \meta{entry-description}.
+%The argument to \cmdname{glossary} must be a comma-separated
+%list of \meta{key}=\meta{value} pairs. The following keys are
+%available:
+%\begin{center}
+%\begin{tabular}{ll}
+%\bfseries Key & \bfseries Value\\
+%\ttfamily \gloskey{name} & The entry name\\
+%\ttfamily \gloskey{description} & A description about the entry\\
+%\ttfamily \gloskey{sort} & How to sort the entry. (Entry name used if sort omitted)\\
+%\ttfamily \gloskey{format} & How to format the page number
+%\end{tabular}
+%\end{center}
+% For example:
+%\begin{verbatim}
+%\glossary{name={singular matrix},
+% description={A matrix with zero determinant}}
+%\end{verbatim}
+% The following example sorts on the text \texttt{U} instead of
+%\verb"$\mathcal{U}$":
+%\begin{verbatim}
+%\glossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U}
+%\end{verbatim}
+%The page format for individual entries can be changed using the
+%\gloskey{format} key. This should be the name of a \LaTeX\
+%formatting command without the preceding \verb'\' (as with the
+%\verb'|' operator in \cmdname{index}.) For example:
+%\begin{verbatim}
+%\glossary{name={$\mathbb{R}$},
+% description={The set of real numbers},
+% sort=R,
+% format=textbf}
+%\end{verbatim}
+%In addition, the following formats are also available:
+%\changes{2.0}{2004 September 21}{Hyper page formats:
+%\texttt{'hypersf}, \texttt{'hypertt}, \texttt{'hyperbf} and
+%\texttt{'hyperbf}}
+%\changes{2.12}{2004 November 1}{Hyper page format:
+%\texttt{'hyperrm}}
+%\begin{center}
+%\begin{tabular}{ll}
+%\glsnumfmt{hyperrm} & The number is a hyper link in roman \\
+%\glsnumfmt{hypersf} & The number is a hyper link in sans-serif \\
+%\glsnumfmt{hypertt} & The number is a hyper link in typewriter font \\
+%\glsnumfmt{hyperbf} & The number is a hyper link in bold \\
+%\glsnumfmt{hyperit} & The number is a hyper link in italic
+%\end{tabular}
+%\end{center}
+%If the \pkgopt{hyper} option has not been set,
+%\glsnumfmt{hyperrm} etc are equivalent to \texttt{textrm} etc.
+%You should use \icmdname{hyperrm} instead of
+%\cmdname{hyperpage}, as \cmdname{hyperpage} won't
+%work on a list or range of numbers in the glossary%
+%\footnote{This is because the list and number ranges are
+%delimited using \cmdname{delimR} and \cmdname{delimN} instead of
+%explicitly using a comma or en-dash.}.
+%
+%As with the \cmdname{index} command, care must be taken if you
+%want to use the special characters: \verb'@' \verb/|/ \verb+"+ and
+%\verb'!'. These characters should be preceded by the double quote
+%character. For example:
+%\begin{verbatim}
+%\glossary{name={$"|\mathcal{S}"|$,
+%description=The cardinality of the set \mathcal{S}}}
+%\end{verbatim}
+%There is no provision for sub-entries, as these are
+%generally only applicable in an index, and not in a glossary.
+%
+%\changes{2.14}{2005 May 28}{'xglossary added}%
+%As from version 2.14, there is an additional command available:
+%\DescribeMacro{\xglossary}
+%\par\vspace{10pt}\noindent\cmdname{xglossary}\verb'{'\meta{gls-entry}%
+%\verb'}{'\meta{text}\verb"}"
+%\par\vspace{10pt}\noindent This is equivalent to\meta{text}\icmdname{glossary}\verb'{'\meta{gls-entry}\verb"}",
+%where \meta{text} will be made a hyperlink to the
+%relevant entry in the glossary, if hyper
+%links are supported.
+%
+%\subsection{Storing Glossary Information}
+%
+%\changes{2.17}{2005 June 28}{'storeglosentry added}
+%\DescribeMacro{\storeglosentry}
+%The following command:\\[10pt]
+%\begin{ttfamily}
+%\cmdname{storeglosentry}[\textrm{\meta{gls-type}}]\{\textrm{\meta{label}}\}\{\textrm{\meta{gls-entry}}\}
+%\end{ttfamily}\\[10pt]
+%can be used to store glossary information. That information
+%can then be used later with any of the following commands:
+%\changes{2.14}{2005 May 28}{'useglosentry added}
+%\changes{2.14}{2005 May 28}{'useGlosentry added}
+%\changes{2.18}{2005 July 5}{'gls added}
+%\DescribeMacro{\useglosentry}
+%\DescribeMacro{\useGlosentry}
+%\DescribeMacro{\gls}\\[10pt]
+%\begin{ttfamily}
+%\cmdname{useglosentry}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}\\
+%\cmdname{useGlosentry}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}\{\textrm{\meta{text}}\}\\
+%\cmdname{gls}[\textrm{\meta{opt}}]\{\textrm{\meta{label}}\}
+%\end{ttfamily}\\[10pt]
+%\cmdname{useglosentry} adds the stored glossary entry
+%\meta{gls-entry} to the appropriate glossary,
+%\cmdname{useGlosentry} adds the stored glossary entry, and
+%makes \meta{text} a hyperlink to that entry (if hyperlinks are
+%supported). The third command, \cmdname{gls}, is like
+%\cmdname{useGlosentry}, but forms \meta{text} from the name
+%given in \meta{gls-entry}.
+%
+%Returning to an earlier example, instead of typing:
+%\begin{verbatim}
+%\glossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U}
+%\end{verbatim}
+%every time you want to add this entry to the glossary, you
+%can instead store the information:
+%\changes{2.19}{2005 July 8}{fixed bug in 'storeglosentry}
+%\begin{verbatim}
+%\storeglosentry{glos:U}{name={$\protect\mathcal{U}$},
+% description={The universal set},
+% sort=U}
+%\end{verbatim}
+%(Note the use of \cmdname{protect}.) Now, instead of continually
+%copying and pasting the glossary command for this entry (which
+%can have quite a large \gloskey{description} field), you can use either:
+%\begin{verbatim}
+%\useglosentry{glos:U}
+%\end{verbatim}
+%which is equivalent to:
+%\begin{verbatim}
+%\glossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U}
+%\end{verbatim}
+%or you can use:
+%\begin{verbatim}
+%\useGlosentry{glos:U}{text}
+%\end{verbatim}
+%which is equivalent to:
+%\begin{verbatim}
+%\xglossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U}{text}
+%\end{verbatim}
+%or you can use:
+%\begin{verbatim}
+%\gls{glos:U}
+%\end{verbatim}
+%which is equivalent to:
+%\begin{verbatim}
+%\xglossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U}{$\mathcal{U}$}
+%\end{verbatim}
+%The optional argument \meta{gls-type} indicates the glossary
+%type (see \autoref{sec:newglostype} to find out how to define new
+%glossary types). If omitted, the standard glossary is used.
+%
+%The optional argument \meta{opt} allows you to add additional
+%information to the glossary entry, for example:
+%\begin{verbatim}
+%\useglosentry[format=textbf]{glos:U}
+%\end{verbatim}
+%is equivalent to:
+%\begin{verbatim}
+%\glossary{name={$\mathcal{U}$},
+% description={The universal set},
+% sort=U,
+% format=textbf}
+%\end{verbatim}
+%The identifying label, \meta{label}, should not contain any
+%special characters, and since \cmdname{storeglosentry} is
+%fragile, care should be taken when using commands within its
+%argument. If in doubt, use \cmdname{protect}.
+%
+%\section{makeglos.pl}
+%
+%The glossary information (as given by the commands
+%\cmdname{glossary} and \cmdname{xglossary}) is saved in the file
+%with the extension \filetype{glo} (unless the
+%\icmdname{makeglossary} command is omitted, in which case the
+%glossary information is simply ignored.) A \appname{makeindex}
+%style file\index{makeindex style file (.ist)|see{file types, ist}}
+%(\filetype{ist}) is also created, which is customized for the
+%document, and can be passed to \appname{makeindex}.
+%
+%For example, suppose your document is called \texttt{mydoc.tex},
+%the glossary will be saved in the file
+%\texttt{mydoc.}\filetype{glo}, and the \appname{makeindex} style
+%file \texttt{mydoc.}\filetype{ist} will be created.
+% These files can then be passed to \appname{makeindex} as follows:
+%\begin{verbatim}
+%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
+%\end{verbatim}
+%which generates the output file \texttt{mydoc.}\filetype{gls},
+%with transcript written to
+%\texttt{mydoc.}\filetype{glg}.
+%
+%The Perl script \appname{makeglos.pl} provided with this package
+%allows you to use \appname{makeindex} without having to remember
+%all the command line options. The command
+%\begin{verbatim}
+%makeglos.pl mydoc.glo
+%\end{verbatim}
+%will perform the command:
+%\begin{verbatim}
+%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
+%\end{verbatim}
+%The \filetype{glo} extension may be omitted. In addition,
+%\appname{makeglos.pl} also takes the option
+%\texttt{-m} which can be used to collate entries where the
+%same name has multiple descriptions.
+%\changes{2.14}{2005 May 28}{makeglos -m switch added}
+%
+%\appname{makeglos.pl} has the following syntax:
+%\begin{verbatim}
+%makeglos.pl [-ilqrgm] [-s sty] [-o gls] [-t log] [-p num] <filename>
+%\end{verbatim}
+%where all switches, apart from \texttt{-m} are the same as
+%those for \appname{makeindex}. In addition, if the extension
+%to the input file name is omitted, \filetype{glo} will be
+%assumed. If there are multiple glossary types (see
+%\autoref{sec:newglostype}) and the file extension is omitted, \appname{makeglos.pl} will
+%iterate through each glossary type.
+%
+%The name of the \filetype{ist} file can be changed by redefining
+%the command \cmdname{istfilename}\DescribeMacro{\istfilename}.
+%For example:
+%\begin{verbatim}
+%\renewcommand{\istfilename}{foo.ist}
+%\end{verbatim}
+%However, you will need to explicitly pass the name of this
+%file to \appname{makeglos.pl} using the \texttt{-s} switch.
+%
+%Creation of the \filetype{ist} file can be suppressed by issuing
+%the command \cmdname{noist}\DescribeMacro{\noist}\ before
+%\icmdname{makeglossary}. It will also be suppressed when the
+%command \icmdname{nofiles} is used, or if the command
+%\icmdname{makeglossary} is omitted.
+%
+%It should be noted that there are a few packages that can
+%cause problems with the creation of the \filetype{ist} file,
+%for example \stynamefmt{ngerman}. If you encounter problems
+%when \LaTeX\ is processing the \icmdname{makeglossary} command,
+%or if you get errors from \appname{makeindex} complaining about
+%the style file, this is the most probable cause.
+%See \autoref{sec:trouble}, item~\ref{itm:ngerman} for
+%information on how to fix this.
+%
+%\section{Displaying the Glossary}
+%
+% Once the \filetype{gls} file has been created by
+%\appname{makeindex} (as described in the previous
+% section) the glossary can then be included in the document with
+%the command \cmdname{printglossary}\DescribeMacro{\printglossary}.
+% If chapters are defined, the glossary will start
+%with\SpecialMainIndex{glossaryname}
+%\begin{verbatim}
+%\chapter*{\glossaryname}
+%\end{verbatim}
+%If not, it will start with
+%\begin{verbatim}
+%\section*{\glossaryname}
+%\end{verbatim}
+%The format of the main body of the glossary depends on the
+%options passed to the package.
+%
+%\section{Package Options}
+%
+%The package options must be specified as a comma-separated list
+%of \meta{key}=\meta{value} pairs. Available options are:
+%\begin{description}
+%\item[\pkgopt{style}] The glossary style. Values:
+%\index{glossary style|see{package options, style}}
+%\begin{description}
+%\item[\pkgoptval{list}{style}] use
+%\envname{description} environment in the glossary
+%\item[\pkgoptval{altlist}{style}] modified
+%version of \pkgopt[list]{style}. The description starts on the
+%line following the name of the term being defined.
+%\changes{2.0}{2004 September 21}{Package option \texttt{altlist}
+%style}
+%\item[\pkgoptval{super}{style}] use
+%\envname{supertabular} environment in the glossary
+%\item[\pkgoptval{long}{style}] use
+%\envname{longtable} environment in the glossary (Default)
+%\end{description}
+%
+%\item[\pkgopt{header}]\index{glossary header|see{package options, header}} Glossary
+%header. Values:
+%\begin{description}
+%\item[\pkgoptval{none}{header}] The glossary
+%doesn't have a heading (Default)
+%\item[\pkgoptval{plain}{header}] The glossary
+%has a heading
+%\end{description}
+%
+%\item[\pkgopt{border}]\index{glossary border|see{package options, border}} Glossary
+%border. Values:
+%\begin{description}
+%\item[\pkgoptval{none}{border}] The glossary
+%doesn't have a border (Default)
+%\item[\pkgoptval{plain}{border}] Border
+%around the main body of the glossary
+%\end{description}
+%
+%\item[\pkgopt{cols}]\index{glossary columns|see{package options, cols}} Number of
+%columns. Values:
+%\begin{description}
+%\item[\pkgoptval{2}{cols}] The entry name and description are in two separate
+%columns with the associated page numbers in the same column as
+%the description. (Default)
+%\item[\pkgoptval{3}{cols}] The entry name, description and associated page numbers
+%are in three separate columns.
+%\end{description}
+%
+% \changes{1.1}{2004 August 14}{Package option \texttt{number}}
+%\item[\pkgopt{number}]
+% Associated number corresponding to each entry. Values:
+%\begin{description}
+%\item[\pkgoptval{page}{number}]
+%Each entry has the corresponding page number(s) where the
+%entry is defined. (Default)
+%\item[\pkgoptval{section}{number}]
+%Each entry has the corresponding section number(s) where
+%the entry is defined.
+%\item[\pkgoptval{none}{number}] The corresponding numbers are
+%suppressed.
+%\end{description}
+%
+%\item[\pkgopt{toc}]\index{table of contents, adding to|see{package options, toc}}
+%Boolean variable:
+%\changes{2.0}{2004 September 21}{Package option \texttt{toc}}
+%\begin{description}
+%\item[\pkgoptval{true}{toc}] Add glossary to table of contents
+%\item[\pkgoptval{false}{toc}] Omit glossary from table of contents (Default)
+%\end{description}
+%Note that if you specify this option, you will need to run
+%\LaTeX\ twice after generating the glossary.
+%
+%\item[\pkgopt{hypertoc}]
+%Boolean variable. This is similar to the package option
+%\pkgopt{toc}, but if you are using the \stynamefmt{hyperref}
+%package, \pkgopt{hypertoc} will generate a link to the
+%beginning of the page, whereas \pkgopt{toc} will have
+%a hyperlink to jst after the glossary title. Note
+%that you can not use both \pkgopt[true]{toc} and
+%\pkgopt[true]{hypertoc}. Default value:
+%\pkgopt[false]{hypertoc}.
+%\changes{2.24}{2005 September 27}{Package option \texttt{hypertoc}}
+%
+%\item[\pkgopt{hyper}] Boolean
+%variable:
+%\changes{2.0}{2004 September 21}{Package option \texttt{hyper}}
+%\begin{description}
+%\item[\pkgoptval{true}{hyper}] Make associated numbers in the
+%glossary a hypertext link, and also make acronyms, and the text
+%given by \icmdname{xglossary} have a hyperlink to their
+%corresponding entries in the glossary.
+%\item[\pkgoptval{false}{hyper}] Don't make associated numbers a hypertext link
+%\end{description}
+%If the \stynamefmt{hyperref} or \stynamefmt{html} package has
+%been loaded prior to loading \texttt{glossary.sty},
+%\pkgopt[true]{hyper} is set, otherwise
+%the default is \pkgopt[false]{hyper}. Note that this package
+%option now encompasses the old \pkgopt{hyperacronym} option.
+%
+%\item[\pkgopt{section}] Boolean variable:
+%\changes{2.12}{2004 November 1}{Package option \texttt{section}}
+%\begin{description}
+%\item[\pkgoptval{true}{section}] Make the glossary an unnumbered
+%section, even if chapters are defined%
+%
+%\item[\pkgoptval{false}{section}] Only make glossary an
+%unnumbered section if chapters are not defined (default).
+%\end{description}
+%
+%\item[\pkgopt{acronym}] Boolean variable:
+%\changes{2.17}{2005 June 28}{Package option \texttt{acronym}}
+%\begin{description}
+%\item[\pkgoptval{true}{acronym}] Make the list of acronyms
+%separate from the main glossary.
+%
+%\item[\pkgoptval{false}{acronym}] The acronyms will all
+%be placed in the main glossary. (Default)
+%\end{description}
+%\end{description}
+% The \pkgopt{border}, \pkgopt{header} and \pkgopt{cols} options
+%should not be used in conjunction with \pkgopt[list]{style}
+%or \pkgopt[altlist]{style}, as they only make sense with one of
+%the tabular-style options.
+%The value for the boolean variables can be omitted if they are
+%to be set. For example
+% \pkgopt{toc} is equivalent to \pkgopt[true]{toc}. Note that the
+%\pkgoptval{altlist}{style} style is better suited to
+%glossaries with long entry names.
+%
+%You can set up your own preferred defaults in a configuration
+%file%
+%\index{glossary.cfg|see{file type, cfg}}.
+%The file must be called \texttt{glossary.}\filetype{cfg} and
+%should be placed somewhere on the \TeX\ path. In this file you
+%can use the command \DescribeMacro{\glossarypackageoptions}%
+%\noindent
+%\cmdname{glossarypackageoptions}\verb'{'\meta{option-list}\verb/}/
+%\noindent
+%where \meta{option-list} is a comma-separated list of
+%\meta{key}=\meta{value} pairs, as passed to the
+%\stynamefmt{glossary}
+%package. Note that this command may only be used in the
+%configuration file.
+%
+%\subsection{Examples}
+% Suppose the document has the following \icmdname{glossary}
+%commands:
+%\begin{center}\ttfamily
+%\begin{tabular}{@{\rmfamily}ll@{}l}
+%\bfseries Page & \multicolumn{2}{c}{\bfseries\rmfamily Command}\\
+%1 & \cmdname{glossary}\{&name=diagonal matrix,\\
+% & &description=Matrix whose only non-zero\\
+% & &entries are along the leading diagonal\}\\
+%2 & \cmdname{glossary}\{&name=identity matrix,\\
+% & &description=Diagonal matrix with 1s along the \\
+% & &leading diagonal\}\\
+%4 & \cmdname{glossary}\{&name=singular matrix,\\
+% & &description=Matrix with zero determinant\}
+%\end{tabular}
+%\end{center}
+%
+%\noindent Variations:
+%\begin{enumerate}
+%\item If \pkgopt[list]{style} is chosen, the glossary will look like:
+%\begin{description}
+%\item[diagonal matrix] Matrix whose only non-zero entries are along the leading
+% diagonal, 1
+%\item[identity matrix] Diagonal matrix with 1s along the leading diagonal, 2
+%\item[singular matrix] Matrix with zero determinant, 4
+%\end{description}
+%
+%\item If \pkgopt[altlist]{style} is chosen, the glossary will look like:
+%\begin{description}
+%\item[diagonal matrix]\mbox{}\par Matrix whose only non-zero entries are along the leading
+% diagonal, 1
+%\item[identity matrix]\mbox{}\par Diagonal matrix with 1s along the leading diagonal, 2
+%\item[singular matrix]\mbox{}\par Matrix with zero determinant, 4
+%\end{description}
+%
+%\item If \pkgopt[list]{style},\pkgopt[none]{number}%
+% is chosen, the glossary will look like:
+%\begin{description}
+%\item[diagonal matrix] Matrix whose only non-zero entries are along the leading
+% diagonal
+%\item[identity matrix] Diagonal matrix with 1s along the leading diagonal
+%\item[singular matrix] Matrix with zero determinant
+%\end{description}
+%
+%\item If \pkgopt[long]{style},\pkgopt[none]{border},%
+%\pkgopt[none]{header},\pkgopt[page]{number}
+%is chosen (default), the glossary will look like:\\[10pt]
+%\newlength{\descriptionwidth}\setlength{\descriptionwidth}{0.6\textwidth}
+%\begin{tabular}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}} &
+%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
+% diagonal, 1
+%\\ &
+%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
+%\\ &
+%\\ singular matrix & Matrix with zero determinant, 4
+%\end{tabular}
+%
+%\item If \pkgopt[long]{style},\pkgopt[plain]{border},%
+%\pkgopt[none]{header} is chosen,
+%the glossary will look like:
+%\\[10pt]
+%\begin{tabular}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}\hline &
+%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
+% diagonal, 1
+%\\ &
+%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
+%\\ &
+%\\ singular matrix & Matrix with zero determinant, 4
+%\\ & \\\hline
+%\end{tabular}
+%
+%\item If \pkgopt[long]{style},\pkgopt[plain]{border},%
+%\pkgopt[plain]{header} is
+%chosen, the glossary will look like:
+%\\[10pt]
+%\begin{tabular}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}\hline
+%\bfseries Notation & \bfseries Description\\\hline\hline &
+%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
+% diagonal, 1
+%\\ &
+%\\identity matrix & Diagonal matrix with 1s along the leading diagonal, 2
+%\\ &
+%\\ singular matrix & Matrix with zero determinant, 4
+%\\ & \\\hline
+%\end{tabular}
+%
+%\item If \pkgopt[long]{style},\pkgopt[none]{border},%
+%\pkgopt[plain]{header},\pkgopt[3]{cols} is chosen, the
+%glossary will look like:
+%\\[10pt]
+%\begin{tabular}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}
+%\bfseries Notation & \bfseries Description & \\ &
+%\\ diagonal matrix & Matrix whose only non-zero entries are along the leading
+% diagonal & 1
+%\\ &
+%\\identity matrix & Diagonal matrix with 1s along the leading diagonal & 2
+%\\ &
+%\\ singular matrix & Matrix with zero determinant & 4
+%\\ & \\
+%\end{tabular}
+%\end{enumerate}
+%
+%
+%\section{Defining New Glossary Types}
+%\label{sec:newglostype}
+%
+%A new type of glossary can be defined using the command:\DescribeMacro{\newglossarytype}\\[5pt]
+%\cmdname{newglossarytype}\verb/[/\meta{log-ext}\verb"]{"\meta{name}\verb'}{'\meta{out-ext}\verb+}{+\meta{in-ext}\verb!}!\\[5pt]
+%For example, suppose you want your document to have a separate
+%index of terms and index of notation,
+%you could use \icmdname{makeglossary}, \icmdname{glossary},
+%\icmdname{xglossary} and \icmdname{printglossary} for the first
+%glossary, and define a new type of glossary called say,
+%\texttt{notation}, using
+%\begin{verbatim}
+%\newglossarytype[nlg]{notation}{not}{ntn}
+%\end{verbatim}
+%which will create the analogous commands:
+%\cmdname{makenotation}, \cmdname{notation}, \cmdname{xnotation}
+%and \cmdname{printnotation} which can be used for the second
+%glossary.
+%
+%The command \cmdname{newglossarytype} should only occur in the
+%preamble. The new commands
+% \cmdname{make}\meta{name}, \verb'\'\meta{name},
+%\verb'\x'\meta{name} and \cmdname{print}\meta{name} all have the
+%same format as their ``glossary'' counter-parts.
+%
+%The glossary information will be saved to a file
+%with the extension given by \meta{out-ext} (analogous to
+%\filetype{glo}), which can then be passed to \appname{makeindex}
+%either directly or via \appname{makeglos.pl},
+%and the file to be read in (i.e.\ the file created by
+%\appname{makeindex}) will have the extension \meta{in-ext}
+%(analogous to \filetype{gls}).
+%
+%The optional argument \meta{log-ext} indicates
+%the extension for the \appname{makeindex} log file, if omitted the
+%extension \filetype{glg} is used. This is not used by \LaTeX,
+%however \appname{makeglos.pl} reads in this information from
+%the \LaTeX\ auxiliary file and passes it to \appname{makeindex}.\changes{2.22}{2005 Sept 12}{changed makeglos to read information in from .aux instead of .log file}
+%
+%For the above \texttt{notation}
+%example, if your document is called, say, \texttt{mydoc.tex},
+% you will need to do the following:
+%\begin{verbatim}
+%latex mydoc
+%makeglos.pl mydoc
+%latex mydoc
+%\end{verbatim}
+%(You may need to do an extra \verb"latex mydoc" to get
+%cross-references up-to-date.) Note that if you don't specify the
+%file extension when using \appname{makeglos.pl}, it will
+%check the transcript file from the \LaTeX\ run to determine
+%all the glossary types, so, for this example,
+%\begin{verbatim}
+%makeglos.pl mydoc
+%\end{verbatim}
+%is equivalent to:
+%\begin{verbatim}
+%makeglos.pl mydoc.glo
+%makeglos.pl mydoc.not
+%\end{verbatim}
+%since \appname{makeglos.pl} has read in the information
+%for the \texttt{notation} glossary type from the file
+%\texttt{mydoc.log}.
+%
+%If you don't have Perl installed
+%on your system, or for any other reason are unable to use
+%\appname{makeglos.pl}, you can call \appname{makeindex}
+%explicitly:
+%\begin{verbatim}
+%latex mydoc
+%makeindex -s mydoc.ist -t mydoc.glg -o mydoc.gls mydoc.glo
+%makeindex -s mydoc.ist -t mydoc.nlg -o mydoc.ntn mydoc.not
+%latex mydoc
+%\end{verbatim}
+%
+%Note that you can use the command
+%\icmdname{printglossary}\texttt[\meta{name}\texttt]
+%instead of \verb'\print'\meta{name}.
+%These two commands have the same effect when using \LaTeX,
+%however, they have a slightly different effect when
+%using \LaTeX2HTML (see \autoref{sec:l2h}).
+%
+%If the command \verb'\'\meta{glossary-type}\verb"name"
+%is defined, (e.g.\ \verb'\notationname' in the above example)
+%this will be used as the title for the specified
+%glossary. If this command is not defined, \icmdname{glossaryname}
+%will be used instead.
+%If the command \verb'\short'\meta{glossary-type}\verb"name"
+%is defined, (e.g.\ \cmdname{shortnotationname} in the above
+%example) this will be used for the table of contents
+%entry, otherwise \verb'\'\meta{glossary-type}\verb"name" will
+%be used instead.
+%For example:
+%\begin{verbatim}
+%\newglossarytype[nlg]{notation}{not}{ntn}
+%\newcommand{\notationname}{Index of Notation}
+%\newcommand{\shortnotationname}{Notation}
+%\end{verbatim}
+%
+%\section{Acronyms}
+%
+%\changes{2.0}{2004 September 21}{Acronyms}
+%The \stynamefmt{glossary} package provides the command\DescribeMacro{\newacronym}:\\[5pt]
+%\begin{ttfamily}
+%\cmdname{newacronym}[\textrm{\meta{cmd-name}}]\{\textrm{\meta{acronym}}\}\{\textrm{\meta{long}}\}\{\textrm{\meta{glossary entry}}\}
+%\end{ttfamily}\\[5pt]
+%which can be used to define acronyms. The argument \meta{long}
+%is the full name, the argument \meta{acronym} is the acronym for
+%\meta{long} and \meta{glossary entry} is the glossary information
+%in the form used by the \icmdname{glossary} command. If the
+%optional argument \meta{cmd-name} is missing,
+%\cmdname{newacronym} will create a command called
+%\verb!\!\meta{acronym}, otherwise it will create a command
+%called \verb'\'\meta{cmd-name} (henceforth denoted \cmdname{}\meta{acr-name}).
+%This command can then be used throughout the text. The first
+%instance of this command is equivalent to:\\[10pt]
+%\meta{long} \texttt(\icmdname{xacronym}\verb"{"\gloskey{name}\texttt{=}\meta{long} \texttt(\meta{acronym}\texttt{),}\meta{glossary entry}\verb'}{'\meta{acronym}\verb/}/\texttt)\\[10pt]
+%subsequent instances will be equivalent to:\\[10pt]
+%\icmdname{xacronym}\verb"{"\gloskey{name}\texttt{=}\meta{long} \texttt(\meta{acronym}\texttt{),}\meta{glossary entry}\verb'}{'\meta{acronym}\verb/}/\\[10pt]
+%The command \cmdname{}\meta{acr-name} also has a starred
+%version, which will make the first letter of \meta{long}
+%uppercase (for use at the start of a sentence).
+%
+%Note that if you want to change the format of the acronym,
+%for example, if you want the acronym to appear in small caps,
+%you will need to not only use the optional argument, but you
+%will also need to use the \gloskey{sort} key, otherwise you
+%will get an error. For example:
+%\begin{verbatim}
+%\newacronym[SVM]{\textsc{svm}}{Support Vector Machine}%
+%{description=Statistical pattern recognition
+%technique,sort=svm}
+%\end{verbatim}
+%
+%If the package option \pkgopt{acronym} is not set (default)
+%\icmdname{xacronym}, is a synonym for \icmdname{xglossary}.
+%If the package option \pkgopt[true]{acronym} is specified, a
+%new glossary type called \texttt{acronym} will be defined as:
+%\begin{verbatim}
+%\newglossarytype[alg]{acronym}{acr}{acn}
+%\newcommand{\acronymname}{List of Acronyms}
+%\end{verbatim}
+%You will then need to use the commands \icmdname{makeacronym}
+%and \icmdname{printacronym} to make the list of acronyms appear.
+%You will also need to run the \filetype{acr} file through
+%\appname{makeindex} (or \appname{makeglos.pl}). For example:
+%\begin{verbatim}
+%makeindex -s mydoc.ist -t mydoc.alg -o mydoc.acn mydoc.acr
+%\end{verbatim}
+%alternatively:
+%\begin{verbatim}
+%makeglos.pl mydoc
+%\end{verbatim}
+%Note that the package option \pkgopt[true]{acronym} is only
+%appropriate if you want both a glossary and a separate list of
+%acronyms.
+%
+%\changes{2.1}{2004 October 25}{name field can be omitted in
+%\texttt{'newacronym}}
+%The \gloskey{name} key is not used in \meta{glossary
+%entry}, as it is constructed from \meta{long} and
+%\meta{acronym}. By default this will be in the form:
+%\meta{long} (\meta{acronym}), however the format can be
+%overridden using the
+%command:\DescribeMacro{\setacronymnamefmt}\\[10pt]
+%\cmdname{setacronymnamefmt}\{\meta{format}\}\\[10pt]
+%Within \meta{format} the following commands may
+%be used to represent \meta{long} and \meta{acronym}:
+%\DescribeMacro{\glolong}\icmdname{glolong} and
+%\DescribeMacro{\gloshort}\icmdname{gloshort}. For example,
+%suppose you just want the acronym to appear in the glossary entry,
+%and not its full length name, then you would need to do:
+%\begin{verbatim}
+%\setacronymnamefmt{\gloshort}
+%\end{verbatim}
+%
+%Given an acronym named \meta{acr-name} (the command name
+%associated with the acronym as defined in
+%\cmdname{newacronym} without the preceding backslash),
+%the following commands are also available:
+%
+%\vspace{10pt}
+%\changes{2.11}{2004 October 25}{\texttt{'useacronym}}
+%\changes{2.18}{2005 July 5}{Fixed bug in 'useacronym}
+%\noindent
+%\cmdname{useacronym}\verb"["\meta{insert}\verb']{'\meta{acr-name}\verb!}!\DescribeMacro{\useacronym}\\[5pt]
+%This command can be used instead of \cmdname{}\meta{acr-name}.
+%\cmdname{useacronym} also has a starred version equivalent to
+%\cmdname{}\meta{acr-name}\texttt{*}.
+%The optional argument \meta{insert} allows you to insert text
+%after \meta{long}, if this is the first occurrence of the
+%acronym, or after the acronym on subsequent occurrences.
+%
+%\vspace{10pt}
+%\changes{2.14}{2005 May 28}{'resetacronym added}\noindent
+%\cmdname{resetacronym}\verb'{'\meta{acr-name}\verb"}"
+%\DescribeMacro{\resetacronym}\\[10pt]
+%This command will cause the next use of \cmdname{}\meta{acr-name}
+%to produce the long version. To reset all acronyms
+%do \cmdname{resetallacronyms}.\DescribeMacro{\resetallacronyms}
+%\changes{2.21}{2005 July 27}{'resetallacronyms added}
+%
+%\vspace{10pt}
+%\changes{2.14}{2005 May 28}{'ifacronymfirstuse added}\noindent
+%\cmdname{ifacronymfirstuse}%
+%\verb'{'\meta{acr-name}%
+%\verb'}{'\meta{true text}\verb"}{"\meta{false text}\verb!}!
+%\DescribeMacro{\ifacronymfirstuse}\\[10pt]
+%This will test if the acronym has been used yet. If it has been
+%used, \meta{true text} will be implemented, otherwise
+%\meta{false text} will be implemented.
+%
+%The long and short forms of an acronym can be produced explicitly
+%without a corresponding glossary entry, using the commands:\\[10pt]
+%\changes{2.19}{2005 July 8}{'acrln added}%
+%\cmdname{acrln}\verb'{'\meta{acr-name}\verb/}/\DescribeMacro{\acrln}\\
+%\cmdname{acrsh}\verb'{'\meta{acr-name}\verb/}/\DescribeMacro{\acrsh}
+%\changes{2.19}{2005 July 8}{'acrsh added}\\[10pt]
+%Or, alternatively:\\[10pt]
+%\cmdname{}\meta{acr-name}\texttt{long}\\
+%\cmdname{}\meta{acr-name}\texttt{short}\\[10pt]
+%The first two commands (\cmdname{acrln} and \cmdname{acrsh})
+%have a starred form that makes the first letter uppercase.
+%The other two commands, simply contain \meta{long} and
+%\meta{acronym}.
+%
+%Note that since these four commands do not generate glossary
+%entries they will therefore not contain any hyperlinks, even if
+%you have specified the \pkgopt{hyper} package option. They are
+%provided for use in situations where the associated glossary
+%command may cause problems (e.g.\ in the table of contents entry.)
+%
+%Note that, as with all \LaTeX\ commands, spaces following
+%command names are ignored so if, for example, you defined
+%a new acronym called, say, SVM, then the \verb/\SVM/ will
+%ignore any spaces following it. To force a space, you
+%can either place an empty set of braces after the command
+%name (e.g.\ \verb/\SVM{}/) or use
+%\cmdname{\textvisiblespace} i.e.\ a backslash followed by
+%a space (e.g.\ \verb/\SVM\ /). Alternatively, as from
+%version 2.22, if you load the \stynamefmt{xspace} package
+%before loading the \stynamefmt{glossary} package, spaces will
+%be put in automatically using \icmdname{xspace}.
+%\changes{2.22}{2005 Sept 16}{Added provision for 'xspace}
+%\changes{2.23}{2005 Sept 17}{Fixed minor bug with hyperlinks and 'glsxspace}
+%
+%\DescribeMacro{\acronymfont}
+%\changes{2.22}{2005 Sept 12}{Added 'acronymfont}%
+%If you want the acronym to appear in a particular font,
+%for example, small caps, you can redefine the command
+%\cmdname{acronymfont}. For example:
+%\begin{verbatim}
+%\renewcommand{\acronymfont}[1]{\textsc{#1}}
+%\end{verbatim}
+%The default definition of \cmdname{acronymfont} is:
+%\begin{verbatim}
+%\newcommand{\acronymfont}[1]{#1}
+%\end{verbatim}
+%
+%\subsection{Examples}
+%
+%\begin{verbatim}
+%\newacronym{SVM}{Support Vector Machine}{description=Statistical
+%pattern recognition technique}
+%\end{verbatim}
+%This will define the command \cmdname{SVM}. The first time this
+%command is used will display the text: Support Vector Machine
+%(SVM). Subsequent use will simply display: SVM. The next
+%example uses the optional argument \meta{cmd-name} since the
+%acronym contains a non-alphabetical character:
+%\begin{verbatim}
+%\newacronym[KSVM]{K-SVM}{Kernel Support Vector
+%Machine}{description=Statistical pattern recognition
+%technique using the ``kernel trick''}
+%\end{verbatim}
+%This will define the command \cmdname{KSVM}. The first time
+%this command is used will display the text: Kernel Support Vector
+%Machine (K-SVM). Subsequent use will simply display: K-SVM.
+%
+%To test whether or not an acronym has been used:
+%\begin{verbatim}
+%\ifacronymfirstuse{SVM}{a}{an} \SVM\ is \ldots
+%\end{verbatim}
+%If the acronym has not been used, the following text will
+%be produced:\\[10pt]
+%a Support Vector Machine is \ldots\\[10pt]
+%otherwise it will produce:\\[10pt]
+%an SVM is \ldots\\[10pt]
+%To expand the acronym a second time:
+%\begin{verbatim}
+%\chapter{An overview of the \protect\SVM}
+%\resetacronym{SVM}
+%The \SVM\ \ldots
+%\end{verbatim}
+%Note the use of \cmdname{protect} (see
+%note~\ref{itm:fragile} on page~\pageref{itm:fragile}.) In fact, in this situation
+%it would be better to do:
+%\begin{verbatim}
+%\chapter[An overview of the \SVMlong]{An overview of the \protect\SVM}
+%\resetacronym{SVM}
+%The \SVM\ \ldots
+%\end{verbatim}
+%
+%Now suppose you want the text: support vector machine,
+%instead of Support Vector Machine (i.e.\ you don't like the
+%uppercase letters). You can define the acronym as follows:
+%\begin{verbatim}
+%\newacronym{SVM}{support vector machine}{description=Statistical
+%pattern recognition technique}
+%\end{verbatim}
+%however, if the command \cmdname{SVM} occurs at the start of the
+%sentence, you would clearly want the first letter as an
+%uppercase letter. This can be done using \cmdname{SVM*} instead
+%of \cmdname{SVM}. For example:
+%\begin{verbatim}
+%\SVM*\ techniques are widely used \ldots
+%\end{verbatim}
+%This will then come out as: Support vector machine (SVM)
+%techniques are widely used \ldots (Assuming this is the first
+%use of either \cmdname{SVM} or \cmdname{SVM*}.)
+%
+%Alternatively, \icmdname{useacronym}\verb'{SVM}' can be used instead of
+%\cmdname{SVM}. For example:
+%\begin{verbatim}
+%\useacronym*[s]{SVM} are widely used in the area of pattern
+%recognition.
+%\end{verbatim}
+%If this is the first use of the acronym SVM, it will produce the
+%following text:\\[10pt]
+%Support vector machines (SVM) are widely used in the area of
+%pattern recognition.\\[10pt]
+%If this is not the first use of this acronym, it will produce the
+%following text:\\[10pt]
+%SVMs are widely used in the area of pattern recognition.
+%
+%\section{Customizing the Glossary}
+%The \stynamefmt{glossary} package provides commands which can be redefined to customize the
+%glossary. The following name commands are defined by this package:
+%\begin{center}\DescribeMacro{\glossaryname}\DescribeMacro{\entryname}\DescribeMacro{\descriptionname}\relax
+%\begin{tabular}{ll}
+%\bfseries Command & \bfseries Default Value\\
+%\cmdname{glossaryname} & Glossary\\
+%\cmdname{shortglossaryname} & \cmdname{glossaryname}\\
+%\cmdname{entryname} & Notation\\
+%\cmdname{descriptionname} & Description
+%\end{tabular}
+%\end{center}
+%\changes{2.2}{2005 July 15}{'glossaryname now defined using 'providecommand instead of 'newcommand}
+% \changes{2.15}{2005 June 5}{'shortglossaryname}
+%\changes{2.16}{2005 June 8}{fixed bug preventing changes
+%to 'glossaryname and 'shortglossaryname}
+%\DescribeMacro{\shortglossaryname}
+%The command \cmdname{shortglossaryname} is used for the
+%page headers and table of contents entry.
+% \changes{1.1}{2004 August 14}{'glossarypreamble}%
+% \changes{1.1}{2004 August 14}{'glossarypostamble}%
+%Any text required before or after the glossary can be added
+%by redefining the commands \DescribeMacro{\glossarypreamble}\cmdname{glossarypreamble}
+%and \DescribeMacro{\glossarypostamble}\cmdname{glossarypostamble}.
+%For example.
+%\begin{verbatim}
+%\renewcommand{\glossarypreamble}{Page numbers in
+%italic indicate the main definition\par}
+%\end{verbatim}
+%By default, \cmdname{glossarypreamble} and \cmdname{glossarypostamble} do nothing.
+%
+%\changes{1.1}{2004 August 14}{\relax Increased User Flexibility}%
+%\changes{2.14}{2005 May 29}{'setglossary added}
+%\DescribeMacro{\setglossary}
+%The command \cmdname{setglossary}\verb'{'\meta{key-val list}\verb"}"
+%can be used to modify some of the glossary settings. The argument
+%\meta{key-val list} is a comma-separated list of
+%\meta{key}=\meta{value} pairs. Available keys are:
+%\begin{description}
+%\item[\setglos{type}] This is the glossary type.
+%If it is omitted, the standard glossary is assumed.
+%
+%\item[\setglos{glsnumformat}]
+%\changes{1.1}{2004 August 14}{\texttt{'glsnumformat}}%
+%This is the name of the command,
+%\emph{without} the preceding backslash\footnote{Note, you should
+%no longer try redefining the command \cmdname{glsnumformat}, as
+%this now takes an optional argument, allowing for different
+%glossary types}, to format the
+%entry numbers. For example, to make all the entry numbers italic,
+%do:
+%\begin{verbatim}
+%\setglossary{glsnumformat=textit}
+%\end{verbatim}
+%To suppress numbering altogether, you can do:
+%\begin{verbatim}
+%\setglossary{glsnumformat=ignore}
+%\end{verbatim}
+%
+%\item[\setglos{glodelim}] This
+%specifies what to do after the entry description and
+%before the page numbers. The default value is a comma, unless the \pkgopt[3]{cols} option is specified,
+%in which case it has the value \verb"&", or if
+%\pkgopt[altlist]{style},
+%in which case it is simply a space\footnote{This
+%is because the \texttt{altlist} style is intended for use with long descriptions that will look better ending with a
+% full stop which the user can add if desired.}. If the package option \pkgopt[none]{number} is
+%specified, \setglos{glodelim} will have an empty value (unless
+%\pkgopt[3]{cols} is specified,
+%where, again, it will have the value \verb"&".)
+%This setting corresponds to the \istkey{delim\_0} key in the
+%\appname{makeindex} style file.
+%
+%\item[\setglos{delimN}]
+%\changes{1.1}{2004 August 14}{\texttt{'delimN}}
+%The delimiter to be inserted between two
+%page numbers for the same entry. (This corresponds to the
+%\istkey{delim\_n} key in the \appname{makeindex} style file.)
+%By default, this has the value
+%\texttt{,\textvisiblespace} (comma followed by a space). If the
+%package option \pkgopt[none]{number} is chosen, the value is set
+%to empty.
+%
+%\item[\setglos{delimR}]
+%\changes{1.1}{2004 August 14}{'delimR}
+%The delimiter to be inserted between the starting and ending page
+%number range for the same entry. (This corresponds to the
+%\istkey{delim\_r} key in the \appname{makeindex} style file.)
+%By default, this has the value \verb"--". If the
+%package option \pkgopt[none]{number} is chosen, the value is set
+%to empty.
+%
+%\end{description}
+%Note that:
+%\begin{verbatim}
+%\setglossary{glsnumformat=ignore}
+%\end{verbatim}
+%is equivalent to
+%\begin{verbatim}
+%\setglossary{glsnumformat=ignore,delimN={},delimR={}}
+%\end{verbatim}
+%
+%The number associated with each entry is, by default, the page number where
+% that entry was defined. If the package option
+%\pkgopt[section]{number} has been chosen, this
+% will be the section number instead. You can choose a different counter
+% by changing the value of the command \cmdname{theglossarynum}\DescribeMacro{\theglossarynum}.
+%For example, suppose you have the following code:
+%\begin{verbatim}
+%\begin{equation}
+%\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
+%\end{equation}
+%\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+%\end{verbatim}
+%and you want the glossary to refer to the equation number, instead of the
+%page or section number, this can be done by redefining \cmdname{theglossarynum}
+%as follows:
+%\begin{verbatim}
+%\renewcommand{\theglossarynum}{\theequation}
+%\end{verbatim}
+%If the equation number depends on another counter (such as
+%\texttt{chapter})
+%you will need to specify that the number is in the form \meta{NUM}.\meta{num}
+% (e.g.\ 3.24). This can be done by redefining the \cmdname{pagecompositor}\DescribeMacro{\pagecompositor}\ command:
+%\begin{verbatim}
+%\renewcommand{\pagecompositor}{.}
+%\end{verbatim}
+%(By default this value is \texttt{-}, unless the package option
+%\pkgopt[section]{number} has
+%been chosen, in which case this command has the value \texttt{.}\
+%(full stop), as in the example above).
+%The \cmdname{pagecompositor} command must be
+%redefined before \icmdname{makeglossary} for it to have any effect.
+%If the package option \pkgopt[none]{number} is used,
+%the numbering will be suppressed, regardless
+%of the value of \icmdname{theglossarynum}.
+%This command corresponds to the \istkey{page\_compositor} key
+%in the \appname{makeindex} style file.
+%
+%The start and end of the main body of the glossary is given by the commands:
+%\cmdname{beforeglossary}\DescribeMacro{\beforeglossary}{} and
+%\cmdname{afterglossary}\DescribeMacro{\afterglossary}.
+%If the \pkgopt[list]{style}
+%or \pkgopt[altlist]{style}
+%package options are chosen these commands simply begin and end
+%the \envname{description}
+%environment, otherwise these commands begin and end the
+%\envname{longtable} or
+%\envname{supertabular}
+%environment with argument specified by
+%\cmdname{glossaryalignment}.\DescribeMacro{\glossaryalignment}
+%
+%\changes{2.1}{2004 October 25}{made glossary compatible with array package}
+%The above conflicts with the \stynamefmt{array} package, so as
+%from version 2.1, if the \stynamefmt{array} package has been
+%loaded \emph{prior} to loading the \stynamefmt{glossary} package,
+%the new column type \texttt{G} will be defined and used
+%instead of \cmdname{glossaryalignment}.
+%
+%The command \cmdname{gloitem}\DescribeMacro{\gloitem}\ indicates
+%what to do at the start of each glossary entry.
+%This command takes one argument, which will be the text specified by the \gloskey{name} key
+%in the \icmdname{glossary} command. In the case of the
+%\pkgopt[list]{style} option,
+%\cmdname{gloitem}\verb"{"\meta{text}\verb'}'
+%will do\\[5pt]
+%\verb"\item["\meta{text}\verb']'\\[5pt]
+%or if \pkgopt[altlist]{style}:\\[5pt]
+%\verb"\item["\meta{text}\verb']\mbox{}\par'\\[5pt]
+%otherwise it will do\\[5pt]
+%\meta{text}\verb" &"\\[5pt]
+%if it's the first
+%item of the page or\\[5pt]
+%\verb'\\ '\meta{text}\verb" &"\\[5pt]
+%otherwise.
+%This command corresponds to the \istkey{item\_0} key in the
+%\appname{makeindex} style file.
+%
+%The command \cmdname{gloskip}\DescribeMacro{\gloskip}\ specifies what to do between groups.
+%If \pkgopt[list]{style} or \pkgopt[altlist]{style} this has the
+%value \cmdname{indexspace}, otherwise it creates a blank line
+% in the \envname{longtable} or \envname{supertabular} environment.
+%This command corresponds to the \istkey{group\_skip} key in
+%the \appname{makeindex} style file.
+%
+%The command \cmdname{glossaryheader}\DescribeMacro{\glossaryheader}\ (if \pkgopt[long]{style} or \pkgopt[super]{style} is selected)
+%indicates what to do at the start of the \envname{longtable} or
+%\envname{supertabular} environment. If \pkgopt[none]{border}, it
+%is defined as:
+%\begin{verbatim}
+%\bfseries\entryname & \bfseries \descriptionname\\
+%\end{verbatim}
+%So, if you want the \icmdname{descriptionname} to be centred, you could do:
+%\begin{verbatim}
+%\renewcommand{\glossaryheader}{\bfseries\entryname &
+% \hfil\bfseries\descriptionname\\}
+%\end{verbatim}
+%The command \cmdname{glosstail}\DescribeMacro{\glosstail}\ indicates what to do at the end of
+%the \envname{longtable} or \envname{supertabular} environment.
+%
+%The width of the second column for the tabular-type styles is given by the length
+%\cmdname{descriptionwidth}\DescribeMacro{\descriptionwidth}. This value can be changed using
+%the \cmdname{setlength} command (the default value is \verb"0.6\textwidth").
+%
+%\section{Sample Documents}
+%This package comes with the following sample documents:
+%\begin{itemize}
+%\item \texttt{sampleSec.tex} --- This document uses the options:
+%\pkgopt[altlist]{style}, \pkgopt{toc} and
+%\pkgopt[section]{number}. It also loads the
+%\stynamefmt{hyperref} package before loading the
+%\stynamefmt{glossary} package, so the glossary has hyperlinks
+%to the section numbers. Experimenting with different package
+%options, will illustrate the different glossary styles.
+%You will need to do:
+%\begin{verbatim}
+%pdflatex sampleSec
+%makeglos.pl sampleSec
+%pdflatex sampleSec
+%pdflatex sampleSec
+%\end{verbatim}
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sampleSec.ist -t sampleSec.glg -o sampleSec.gls sampleSec.glo
+%\end{verbatim}
+%
+%\item \texttt{sampleNtn.tex} --- This has a glossary and defines
+%a new glossary type called \texttt{notation}. The glossary has
+%associated page numbers, but the new glossary type doesn't.
+%You will need to do:
+%\begin{verbatim}
+%latex sampleNtn
+%makeglos.pl sampleNtn
+%latex sampleNtn
+%latex sampleNtn
+%\end{verbatim}
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sampleNtn.ist -t sampleNtn.glg -o sampleNtn.gls sampleNtn.glo
+%makeindex -s sampleNtn.ist -t sampleNtn.nlg -o sampleNtn.ntn sampleNtn.not
+%\end{verbatim}
+%
+%\item \texttt{sampleNtn2.tex} ---This is similar to
+%\texttt{sampleNtn.tex}, but uses \icmdname{storeglosentry}.
+%
+%\item \texttt{sampleEq.tex} --- This has a glossary where the
+%numbers in the glossary refer to the equation number rather than
+%the page number. The \icmdname{pagecompositor},
+%\icmdname{theglossarynum}, \icmdname{glossaryname} and
+%\icmdname{glossaryheader} are all redefined to customize the
+%glossary. You will need to do:
+%\begin{verbatim}
+%latex sampleEq
+%makeglos.pl sampleEq
+%latex sampleEq
+%\end{verbatim}
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sampleEq.ist -t sampleEq.glg -o sampleEq.gls sampleEq.glo
+%\end{verbatim}
+%
+%\item \texttt{sampleEqPg.tex} --- This is a modified version of
+%\texttt{sampleEq.tex}. This example has one glossary, where some
+%of the entry numbers refer to the corresponding page number, and
+%some of the entry numbers refer to the corresponding equation
+%number. You will need to do:
+%\begin{verbatim}
+%latex sampleEqPg
+%makeglos.pl sampleEqPg
+%latex sampleEqPg
+%\end{verbatim}
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sampleEqPg.ist -t sampleEqPg.glg -o sampleEqPg.gls sampleEqPg.glo
+%\end{verbatim}
+%
+%\item \texttt{sampleAcr.tex} --- This has a glossary containing
+%acronyms. It uses the style \pkgoptval{altlist}{style} as this is better
+%suited to glossaries with long names. It also uses the
+%\stynamefmt{hyperref} package, so the page numbers in the
+%glossary will automatically be hyperlinks, and the acronyms
+%within the text will have hyperlinks to their corresponding entry
+%in the glossary. You will need to do:
+%\begin{verbatim}
+%pdflatex sampleAcr
+%makeglos.pl sampleAcr
+%pdflatex sampleAcr
+%pdflatex sampleAcr
+%\end{verbatim}
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sampleAcr.ist -t sampleAcr.glg -o sampleAcr.gls sampleAcr.glo
+%\end{verbatim}
+%
+%
+%\item \texttt{sample.tex} --- This has a glossary entry
+%with two different definitions of the same name.
+%If you just use \appname{makeindex}, the two entries
+%will be treated separately, however, if you want them
+%concatenated, you can use \appname{makeglos.pl} with
+%the \texttt{-m} switch. You will need to do:
+%\begin{verbatim}
+%pdflatex sample
+%makeglos.pl -m sample
+%pdflatex sample
+%pdflatex sample
+%\end{verbatim}
+%(Depending on the configuration of your system, you
+%may have to do \texttt{perl makeglos.pl} instead of
+%just \appname{makeglos.pl})
+%
+%If you don't want to use \appname{makeglos.pl}, you will need
+%to do
+%\begin{verbatim}
+%makeindex -s sample.ist -t sample.glg -o sample.gls sample.glo
+%\end{verbatim}
+%however, the entries with the same name but multiple descriptions
+%will not be merged.
+%
+%\end{itemize}
+%
+%\section{LaTeX2HTML Style File}
+%\label{sec:l2h}
+%
+%A \LaTeX2HTML\ Perl script, \texttt{glossary.}\filetype{perl}, is
+%provided with this package for those wishing to use the
+%glossary package with the \LaTeX2HTML translator.
+%The file \texttt{glossary.}\filetype{perl} should be extracted
+%along with \texttt{glossary.sty} when you run the
+%installation script (\texttt{glossary.ins}) through \LaTeX.
+%
+%\subsection{Limitations}
+%
+%\begin{itemize}
+%\item The only package options supported are:
+%\pkgopt[altlist]{style}, \pkgopt[true]{hyper}, \pkgopt[true]{toc},
+%\pkgopt[true]{acronym} and \pkgopt[false]{acronym}.
+%
+%\item If you have more than one glossary type, the
+%secondary glossaries will occur in the same segment
+%as the primary glossary if you use the command
+%\verb'\print'\meta{name} instead of
+%\verb'\printglossary['\meta{name}\verb"]", where
+%\meta{name} is the name of the glossary type.
+%
+%\item The command \icmdname{setglossary} must be
+%placed in the preamble to have an effect.
+%
+%\item The \icmdname{storeglosentry} commands must be in
+%the document environment to have an effect. (They don't
+%seem to work in the preamble, I don't know why.)
+%
+%\item If you place a \icmdname{glossary} command
+%inside an environment not translated by \LaTeX2HTML
+%(for example, inside a mathematics environment),
+%it will not be entered into the glossary.
+%
+%\item The combinations \verb'""', \verb!"|!, \verb+"!+
+%and \verb'"@' will be correctly translated, unless they
+%occur within a maths environment. This is because
+%the maths environment is translated before being
+%passed to \icmdname{glossary}. You can overcome this
+%by doing, e.g.:\\
+%\cmdname{begin}\verb'{latexonly}'\\
+%\verb'\glossary{name=$"|\mathcal{S}"|$,description=cardinality of set'\\
+%\verb'$\mathcal{S}$,sort=cardinality}'\\
+%\cmdname{end}\verb'{latexonly}'\\
+%\cmdname{begin}\verb'{htmlonly}'\\
+%\verb'\glossary{name=$|\mathcal{S}|$,description=cardinality of set'\\
+%\verb'$\mathcal{S}$,sort=cardinality}'\\
+%\cmdname{end}\verb'{htmlonly}'
+%
+%Alternative, you can use \cmdname{mid} instead:
+%\begin{verbatim}
+%\glossary{name=$\mid\mathcal{S}\mid$,description=cardinality of
+%set $\mathcal{S}$,sort=cardinality}
+%\end{verbatim}
+%
+%\item Glossary items with the same names but different
+%definitions will not be merged.
+%
+%\item The command \icmdname{theglossarynum} is ignored
+%by \LaTeX2HTML, as page numbers have no meaning within
+%HTML files.
+%
+%\item The configuration file \texttt{glossary.cfg} is ignored.
+%
+%\end{itemize}
+%
+%
+%\section{Troubleshooting}
+%\label{sec:trouble}
+%\begin{enumerate}
+%\item My glossary hasn't appeared.
+%
+%Check the following:
+%\begin{itemize}
+%\item Have you included the command \icmdname{makeglossary}
+%in the preamble?
+%
+%\item Have you put the command \icmdname{printglossary} where
+%you want the glossary to appear?
+%
+%\item Have you used \appname{makeglos.pl} or \appname{makeindex},
+%and if you did, did it successfully create the \filetype{gls}
+%file? (Check the transcript \filetype{glg} file.)
+%
+%\begin{itemize}
+%\item If you used \appname{makeindex} directly, did you specify
+%the \filetype{ist} file created by \icmdname{makeglossary},
+%and did you remember to specify the output file with the extension
+%\filetype{gls}?
+%
+%\item When \appname{makeindex} scans the \filetype{ist} file,
+%it should generate the message:
+%\begin{verbatim}
+%9 attributes redefined, 0 ignored
+%\end{verbatim}
+%If you have a number other than 0 ignored, then there is something
+%wrong with the \filetype{ist} file. Some packages can cause
+%problems with the creation of this file, see
+%item~\ref{itm:ngerman} below.
+%\end{itemize}
+%
+%\item Have you remembered to \LaTeX\ your document again
+%after using \appname{makeglos.pl} or \appname{makeindex}?
+%
+%\item Have you used \icmdname{glossary} or \icmdname{xglossary}?
+%
+%\item If you have used \icmdname{storeglosentry}, have you also
+%used \icmdname{useglosentry}, \icmdname{useGlosentry} or
+%\icmdname{gls}?
+%\end{itemize}
+%
+%If you have defined a new glossary type, have you checked
+%all the analogous commands to the above?
+%
+%\item My list of acronyms hasn't appeared.
+%
+%Have you used the \pkgopt[true]{acronym} package option? If no,
+%check the answers to the previous item, if yes, make sure
+%you have used \icmdname{makeacronym} and \icmdname{printacronym}.
+%Have you used any of the acronyms you have defined? Remember
+%that \cmdname{acrsh}, \cmdname{acrln},
+%\cmdname{}\meta{acr-name}\texttt{short} and
+%\cmdname{}\meta{acr-name}\texttt{long} don't generate entries
+%in the list of acronyms, where \cmdname{}\meta{acr-name} is the
+%name of an acronym command.
+%
+%\item I get an error when using the command
+%\icmdname{saveglosentry}.
+%
+%Don't use this command it's obsolete, use
+%\icmdname{storeglosentry} instead.
+%
+%\item One of more of my glossary entries hasn't appeared.
+%
+%Check the following
+%\begin{itemize}
+%\item If you defined the entry using \icmdname{storeglosentry}
+%have you used either \icmdname{useglosentry},
+%\icmdname{useGlosentry} or \icmdname{gls}?
+%
+%\item Have you remembered to \icmdname{protect} commands
+%such as \cmdname{mathcal} within \icmdname{storeglosentry}?
+%
+%\item Have you used the characters \texttt{@} \texttt{!}
+%\texttt{\textbar} \verb'"'? If so, have you preceded them
+%with a double quote character?
+%\end{itemize}
+%
+%Check the \appname{makeindex} log file to see if there are
+%any error messages.
+%
+%\item My glossary has duplicate entries on separate lines.
+%
+%\LaTeX\ treats multiple spaces equivalent to a single space, but \appname{makeindex}
+%takes spaces into account when determining whether two entries are identical.
+%For example:
+%\begin{verbatim*}
+%\glossary{name=Identity matrix,
+%description=diagonal matrix with 1's along the diagonal}
+%\end{verbatim*}
+%and
+%\begin{verbatim*}
+%\glossary{name=Identity matrix,
+%description=diagonal matrix with 1's along the diagonal}
+%\end{verbatim*}
+%will be treated as different entries by \appname{makeindex},
+%because the first has only one space
+%between `Identity' and `matrix' and the second has two.
+%The easiest way to ensure consistency is to use
+%\icmdname{storeglosentry} together with \icmdname{useglosentry},
+%\icmdname{useGlosentry} or \icmdname{gls}.
+%
+%\item I had an error, fixed it, but I keep getting the same error message.
+%
+%Suppose you've made an error in the \icmdname{glossary} command. For example:
+%\begin{verbatim}
+%\glossary{name=Java,description=A programming language,format=texbf}
+%\end{verbatim}
+%In this case \texttt{textbf} has been mis-spelt. This error will be copied to the \filetype{glo} file,
+%which in turn will be copied to the \filetype{gls} file by
+%\appname{makeindex}. A subsequent run of \LaTeX\ will
+%read this error in. If you fix the error in your main document, the error will still be read in from
+%the \filetype{gls} file. The best thing to do is to delete the
+%\filetype{gls} file, and try again.
+%
+%\item My glossary has ended up wider than my page.
+%
+%This may occur if you have long entry names, and you are using
+%either the \pkgopt[long]{style} or \pkgopt[super]{style}
+%options. The width of the description column is proportional to
+%the text width (in fact, it's \verb"0.6\textwidth")
+%but the first column is as wide as the widest entry name. You
+%can either redefine \icmdname{glossaryalignment} to change the
+%column specifications, or use one of the list-type styles.
+%
+%\item The page numbers in my glossary don't match up with the actual page numbers where the entry
+%was defined.
+%
+%You may need to \LaTeX\ your document again (just as you have to do with \cmdname{tableofcontents}, \cmdname{listoffigures} etc).
+%
+%\item I'm getting a \appname{keyval} error.
+%
+%The \stynamefmt{glossary} package uses the \stynamefmt{keyval}
+%package to extract the information from \meta{key}=\meta{value}
+%comma separated lists. You need to make sure the syntax is correct. If your \meta{value} contains a
+%comma, you will need to enclose \meta{value} in curly braces. See the \stynamefmt{keyval} documentation for
+%further information\footnote{This should be in the directory
+%\texttt{texmf/doc/latex/graphics/}}.
+%
+%\item I've used the \pkgopt{hyper} option, but nothing happens
+%when I click on the numbers in the glossary.
+%
+%Check the following:
+%\begin{enumerate}
+%\item Have you remembered to use PDF\LaTeX\ instead of \LaTeX,
+%or used a driver that understands hyperlinks?
+%\item Have you remembered to use the \stynamefmt{hyperref} or
+%\stynamefmt{html} package?
+%\item Have you remembered to use a formatting command which uses \cmdname{hyperlink}? (E.g.\ using \glsnumfmt{hyperbf} instead
+%of \texttt{textbf})? Remember to check the \gloskey{format} key
+%in your \icmdname{glossary} commands, and the
+%\setglos{glsnumformat} key in the \icmdname{setglossary}
+%command.
+%\item What application are you using to view the PDF file?
+%Ghostview can display a PDF file, but ignores the links. If you are using Windows, try
+%using Adobe's Acrobat Reader, or if you are using UNIX or Linux, try using \appname{xpdf} or \appname{acroread}.
+%\end{enumerate}
+%
+%\item The \stynamefmt{glossary} package conflicts with the
+%\stynamefmt{datetime} package.
+%\changes{2.01}{21 Oct 2004}{Fixed conflict with datetime package}
+%
+%This has been fixed in version 2.01.
+%
+%\item I get an error when using certain commands, such as \cmdname{cite} or \verb"~" in \icmdname{newacronym}.
+%
+%This has been fixed in version 2.1.
+%
+%\item I get the following error:
+%\begin{verbatim}
+%! Package array Error: Illegal pream-token (\glossaryalignment): `c' used.
+%\end{verbatim}
+%
+%The \stynamefmt{glossary} package used to conflict with the
+%\stynamefmt{array} package. This was fixed in version 2.1,
+%however, you must load the \stynamefmt{array} package
+%\emph{prior} to loading the \stynamefmt{glossary} package.
+%
+%\item\label{itm:fragile} I get the following error:
+%\begin{verbatim}
+%Use of \@chapter doesn't match its definition
+%\end{verbatim}
+%or
+%\begin{verbatim}
+%! Argument of \@sect has an extra }
+%\end{verbatim}
+%
+%If you want to use an acronym command in a moving argument (such as a chapter heading)
+%you need to \cmdname{protect} it first. Note that if you do put an acronym in a chapter etc
+%heading, it will be expanded for the first time in the table of contents, not
+%in the chapter heading. The best way to get around this is to use the
+%optional argument, e.g.
+%\begin{verbatim}
+%\chapter[Introduction to Kernel Support Vector Machines]{Introduction
+%to \protect\KSVM}
+%\end{verbatim}
+%You will also need to do this if you are using bookmarks in a PDF document.
+%
+%Alternatively, you can do:
+%\begin{verbatim}
+%\resetacronym{KSVM}
+%\chapter{Introduction to \protect\KSVM}
+%\end{verbatim}
+%or if you are using PDFLaTeX:
+%\begin{verbatim}
+%\resetacronym{KSVM}
+%\chapter{Introduction to \texorpdfstring{\protect\KSVM}{KSVM}}
+%\end{verbatim}
+%
+%\item\label{itm:ngerman} The \stynamefmt{glossary} package conflicts with
+%\stynamefmt{ngerman}.
+%
+%This problem is caused by the fact that \stynamefmt{ngerman}
+%redefines the effect of the double quote
+%character, but this character is used in the creation of the
+%\filetype{ist} \appname{makeindex} style file.
+%Try one of the following methods:
+%\begin{enumerate}
+%\item Include the \stynamefmt{ngerman} package after the
+%\icmdname{makeglossary} command:
+%\begin{verbatim}
+%\usepackage{glossary}
+%\makeglossary
+%\usepackage{ngerman}
+%\end{verbatim}
+%
+%\item First omit the \stynamefmt{ngerman} package and include
+%\icmdname{makeglossary} then \LaTeX\ your document.
+%This will create the \filetype{ist} file. Then include the
+%\stynamefmt{ngerman} package, and insert \icmdname{noist} before
+%the \icmdname{makeglossary} command, this will prevent further attempts to generate the \filetype{ist} file.
+%\begin{verbatim}
+%\usepackage{ngerman}
+%\usepackage{glossary}
+%\noist\makeglossary
+%\end{verbatim}
+%
+%\item Use \icmdname{noist}, as above, and create the
+%\filetype{ist} file
+%in an ordinary text editor. The file should contain the
+%following lines:
+%\begin{verbatim}
+%keyword "\\glossaryentry"
+%preamble "\\begin{theglossary}"
+%postamble "\n\\end{theglossary}\n"
+%group_skip "\\gloskip "
+%item_0 "\n\\gloitem "
+%delim_0 "\n\\glodelim "
+%page_compositor "-"
+%delim_n "\\delimN "
+%delim_r "\\delimR "
+%\end{verbatim}
+%\end{enumerate}
+%It is possible that there may be other packages which will
+%also cause a problem, if so, try any of the above.
+%
+%\item \appname{makeglos.pl} gives the following error message:
+%\begin{verbatim}
+%unable to extract name from glossary item:
+%\end{verbatim}
+%
+%You are using an old version of \appname{makeglos.pl} with a
+%new version of the \stynamefmt{glossary} package. You will need
+%to update your version \appname{makeglos.pl}.
+%\end{enumerate}
+%Let me know if you encounter any other problems or if you have any comments regarding this package.
+%
+%\section{Obsolete Commands}
+%
+%The commands described in this section are now obsolete, but
+%are currently still provided for backwards compatibility. Their
+%use is deprecated.
+%
+%\changes{2.14}{2005 May 28}{'saveglosentry added}
+%\DescribeMacro{\saveglosentry}
+%\icmdname{saveglosentry}\{\textrm{\meta{name}}\}\{\meta{description}\}\\
+%This command has now been replaced by \cmdname{storeglosentry}.
+%
+%\changes{2.0}{2004 November 1}{primary acronym number format
+%\texttt{'glsprimaryfmt}}
+%\changes{2.12}{2004 November 1}{primary acronym number format
+%\texttt{'glsprimaryfmt} no longer used}
+%\DescribeMacro{\glsprimaryfmt}%
+%The command \cmdname{glsprimaryfmt} is no longer used in \icmdname{newacronym} as you can end up with duplicate
+%page numbers, however the command is currently still defined (although it
+% may be removed in future versions.)
+%
+%The package option \pkgopt{hyperacronym} is now superseded by the package option
+%\pkgopt{hyper}. This option was implemented prior to the
+%introduction of the command \icmdname{xglossary}. Since the
+%acronyms now use \icmdname{xglossary}, there is no difference
+%between the \pkgopt{hyperacronym} and \pkgopt{hyper} options.
+%This option has a boolean value:
+%\changes{2.13}{2004 December 1}{Package option \texttt{hyperacronym}}
+%\begin{description}
+%\item[\pkgoptval{true}{hyperacronym}] Make acronyms link to their corresponding entry in the glossary
+%\item[\pkgoptval{false}{hyperacronym}] Acronyms don't have a hyperlink.
+%\end{description}
+%If the \stynamefmt{hyperref} package has been loaded prior to
+%loading \texttt{glossary.sty} or if \pkgopt[true]{hyper} is set,
+%\pkgopt[true]{hyperacronym} otherwise
+%\pkgopt[false]{hyperacronym}.%
+%
+%\section{Contact Details}
+%\noindent
+%Dr Nicola Talbot\\
+%School of Computing Sciences\\
+%University of East Anglia\\
+%Norwich. Norfolk\\
+%NR4 7TJ. United Kingdom.\\
+%\url{http://theoval.cmp.uea.ac.uk/~nlct/}
+%
+%\section{Acknowledgements}
+%
+%I would like to thank the following people for their
+%suggestions:
+%Jens~Happe,
+%Dmitry~Katsubo,
+%Markus~Lazanowski,
+%Slava~Pestov and
+%Dario~Teixeira
+%
+% \StopEventually{\PrintChanges\addcontentsline{toc}{section}{Change History}\PrintIndex\addcontentsline{toc}{section}{Index}}
+%
+%
+%
+%
+%\section{The Code}
+% \begin{macrocode}
+%<*glossary.sty>
+% \end{macrocode}
+% \subsection{Package Definition}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glossary}[2005/09/27 2.24 (NLCT)]
+% \end{macrocode}
+% Load packages needed by glossary.sty:
+% \begin{macrocode}
+\RequirePackage{ifthen}
+\RequirePackage{keyval}
+% \end{macrocode}
+% The package options are in the form of a comma-separated list of
+% \meta{key}=\meta{value} pairs. First need to set up the keys.
+% \begin{macrocode}
+\define@key{gloss}
+ {style}
+ {\ifthenelse{\equal{#1}{list} \or \equal{#1}{altlist} \or \equal{#1}{super} \or \equal{#1}{long}}
+ {\def\gls@style{#1}}
+ {\PackageError{glossary}
+ {Unknown glossary style '#1'}
+ {Available styles are: list, altlist, super and long}}}
+
+\define@key{gloss}
+ {header}[plain]{\ifthenelse{\equal{#1}{none} \or \equal{#1}{plain}}
+ {\def\gls@header{#1}}
+ {\PackageError{glossary}
+ {Unknown glossary style '#1'}
+ {Available styles are: none and plain}}}
+
+\define@key{gloss}
+ {border}[plain]{\ifthenelse{\equal{#1}{none} \or \equal{#1}{plain}}
+ {\def\gls@border{#1}}
+ {\PackageError{glossary}
+ {Unknown glossary border '#1'}
+ {Available styles are: none and plain}}}
+\newcount\gls@cols
+\define@key{gloss}{cols}{\gls@cols=#1\relax
+\ifthenelse{\gls@cols<2 \or \gls@cols>3}
+ {\PackageError{glossary}
+ {invalid number of columns}
+ {The cols option can only be 2 or 3}}
+ {}}
+
+\define@key{gloss}
+ {number}
+ {\ifthenelse{\equal{#1}{none}\or\equal{#1}{page}\or\equal{#1}{section}}
+ {\def\gls@number{#1}}
+ {\PackageError{glossary}
+ {Unknown glossary number style '#1'}
+ {Available styles are: none, page and section}}}
+
+\newif\ifgls@toc
+\define@key{gloss}{toc}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
+ {\csname gls@toc#1\endcsname}
+ {\PackageError{glossary}{Glossary option 'toc' is boolean}
+ {The value of 'toc' can only be set to 'true' or 'false'}}}
+
+\newif\ifgls@hypertoc
+ \define@key{gloss}{hypertoc}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
+ {\csname gls@hypertoc#1\endcsname}
+ {\PackageError{glossary}{Glossary option 'hypertoc' is boolean}
+ {The value of 'hypertoc' can only be set to 'true' or 'false'}}}
+
+\newif\ifgls@section
+\define@key{gloss}{section}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
+ {\csname gls@section#1\endcsname}
+ {\PackageError{glossary}{Glossary option 'section' is boolean}
+ {The value of 'section' can only be set to 'true' or 'false'}}}
+\gls@sectionfalse
+
+
+\newif\ifglshyper
+\newif\ifglshyperacronym
+\define@key{gloss}{hyper}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
+ {\csname glshyper#1\endcsname\glshyperacronymtrue}
+ {\PackageError{glossary}{Glossary option 'hyper' is boolean}
+ {The value of 'hyper' can only be set to 'true' or 'false'}}}
+
+\define@key{gloss}{hyperacronym}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}
+ {\csname glshyperacronym#1\endcsname}
+ {\PackageError{glossary}{Glossary option 'hyperacronym' is boolean}
+ {The value of 'hyperacronym' can only be set to 'true' or 'false'}}}
+
+\newif\ifglsacronym
+\define@key{gloss}{acronym}[true]{\ifthenelse{\equal{#1}{true} \or \equal{#1}{false}}{\setboolean{glsacronym}{#1}}{%
+\PackageError{glossary}{Glossary option 'acronym' is boolean}{The value of 'acronym' canonly be set to 'true' or 'false'}}}
+% \end{macrocode}
+% Set up defaults
+% \begin{macrocode}
+\def\gls@style{long}
+\def\gls@header{none}
+\def\gls@border{none}
+\def\gls@number{page}
+\gls@cols=2\relax
+\gls@tocfalse
+\@ifundefined{hyperpage}{\glshyperfalse\glshyperacronymfalse}{\glshypertrue\glshyperacronymtrue}
+
+\@ifundefined{hypertarget}{
+% no hyperlinks
+\newcommand{\glosslabel}[2]{#2}%
+\newcommand{\glossref}[2]{#2}%
+}{%
+\newcommand{\glosslabel}[2]{\hypertarget{#1}{#2}}%
+\newcommand{\glossref}[2]{\hyperlink{#1}{#2}}
+}
+% \end{macrocode}
+% If the xspace package has been loaded, use \verb/\xspace/
+% in acronyms.
+% \begin{macrocode}
+\@ifundefined{xspace}{%
+\let\glsxspace\relax}{%
+\let\glsxspace\xspace}
+% \end{macrocode}
+% Temporarily disable xspace:
+% \begin{macrocode}
+\newcommand{\gls@noxspace}[1]{{\let\glsxspace\relax#1}}
+% \end{macrocode}
+% Load configuation file if it exists
+% \begin{macrocode}
+\newcommand{\glossarypackageoptions}[1]{\setkeys{gloss}{#1}}
+\InputIfFileExists{glossary.cfg}{%
+\typeout{Glossary configuration file loaded}}{%
+\typeout{No configuration file glossary.cfg found}}
+\renewcommand{\glossarypackageoptions}[1]{%
+\PackageError{glossary}{Command \string\glossarypackageoptions
+^^Jcan only be used in configuration file}{}}
+% \end{macrocode}
+% Process options
+% \begin{macrocode}
+\DeclareOption*{\edef\@pkg@ptions{\noexpand\setkeys{gloss}{\CurrentOption}}
+\ifthenelse{\equal{\CurrentOption}{}}{}{\@pkg@ptions}}
+
+\ProcessOptions
+% \end{macrocode}
+%Check to make sure that the options don't conflict.
+% \begin{macrocode}
+\ifthenelse{\(\equal{\gls@style}{list} \or \equal{\gls@style}{altlist}\) \and \(\not\equal{\gls@header}{none} \or \not\equal{\gls@border}{none} \or \gls@cols=3\)}
+{\PackageError{glossary}{You can't have option 'style=list' or 'style=altlist' in combination with any of the other options}
+{The 'list' and 'altlist' options don't have a header, border or number of columns option.}}
+{}
+% \end{macrocode}
+% Can't have both toc and hypertoc. Make it a warning rather
+% than an error.
+% \begin{macrocode}
+\ifthenelse{\boolean{gls@hypertoc} \and \boolean{gls@toc}}{%
+\PackageWarning{glossary}{Can't have both 'toc' and
+'hypertoc', ignoring 'toc' option}
+\ifgls@hypertoc\gls@tocfalse\fi}{}
+% \end{macrocode}
+%\subsection{Redefining \texttt{\symbol{92}glossary} format}
+% The glossary is going to be redefined so that it accepts \meta{key}=\meta{value}
+% information, so need to define the keys (see keyval documentation for further details
+% on how to do this)
+% \begin{macrocode}
+\define@key{wrgloss}{name}{\gdef\@glo@n@me{#1}}
+\define@key{wrgloss}{description}{\def\@descr{#1}}
+\define@key{wrgloss}{sort}{\gdef\@s@rt{#1}}
+\define@key{wrgloss}{format}{\def\@f@rm@t{#1}}
+% \end{macrocode}
+% Redefine "\@wrglossary" so that it separates out the entry name and
+% entry description. Substitute "\thepage" for "\theglossarynum" which
+% the user can redefine to be "\theequation" etc,
+% \begin{macrocode}
+\newcommand{\@@wrglossary}{}
+\newcommand{\@glo@l@bel}{}
+
+\renewcommand{\@wrglossary}[1]{\relax
+\gdef\@glo@n@me{}\def\@descr{}\def\@s@rt{}\def\@f@rm@t{}\relax
+ \setkeys{wrgloss}{#1}\relax
+\ifthenelse{\equal{\@s@rt}{}}{\gdef\@s@rt{\@glo@n@me}}{}%
+\ifthenelse{\equal{\@glo@l@bel}{}}{\gdef\@glo@l@bel{GGG:\@s@rt}}{}%
+\ifthenelse{\equal{\@f@rm@t}{}}
+ {\protected@write\@glossaryfile{}%
+ {\string\glossaryentry{\@s@rt @{%
+ \string\glosslabel{\@glo@l@bel}{\@glo@n@me}}\@descr
+ \string\relax|glsnumformat}{\theglossarynum}}}
+ {\protected@write\@glossaryfile{}%
+ {\string\glossaryentry{\@s@rt @{%
+ \string\glosslabel{\@glo@l@bel}{\@glo@n@me}}\@descr
+ \string\relax|\@f@rm@t}{\theglossarynum}}}\relax
+ \endgroup\@esphack
+\@@wrglossary
+}
+% \end{macrocode}
+% Command to extract name key from glossary entry.
+% \begin{macrocode}
+\newcommand{\@gls@getn@me}[1]{\@bsphack\begingroup\@sanitize
+\gdef\@glo@n@me{}\setkeys{wrgloss}{#1}\relax
+\endgroup\@esphack}
+% \end{macrocode}
+% Now do macro so you can have a hyperlink that takes
+% you to the entry in the glossary
+% \begin{macrocode}
+\newcommand{\xglossary}{\renewcommand{\@@wrglossary}[1]{%
+\glossref{\@glo@l@bel}{##1}\renewcommand{\@@wrglossary}{}}%
+\glossary}
+% \end{macrocode}
+% Save a bit of typing. The followig command is new to v2.17
+% \begin{macrocode}
+\newcommand*{\storeglosentry}[3][glossary]{%
+\@ifundefined{glo@#2@entry}{%
+\expandafter\def\csname glo@#2@type\endcsname{#1}%
+\expandafter\def\csname glo@#2@entry\endcsname{#3}%
+\@gls@getn@me{#3}%
+\expandafter\protected@edef\csname glo@#2@name\endcsname{\@glo@n@me}%
+}{%
+\PackageError{glossary}{Glossary entry '#2' already
+defined}{There already exists a glossary entry with the label '#2'}}%
+}
+
+\providecommand{\useglosentry}[2][\relax]{%
+\@ifundefined{glo@#2@type}{%
+\PackageError{glossary}{Glossary entry '#2' undefined}{You need
+to define the entry using \string\storeglosentry\space before
+using it.}}{%
+\edef\@glostype{\csname glo@#2@type\endcsname}%
+\ifx#1\relax
+\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname}}%
+\else
+\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype{\csname glo@#2@entry\endcsname,#1}}%
+\fi
+\@glo@cmd
+}}
+
+\providecommand{\useGlosentry}[3][\relax]{%
+\@ifundefined{glo@#2@type}{%
+\PackageError{glossary}{Glossary entry '#2' undefined}{You need
+to define the entry using \string\storeglosentry\space before
+using it.}}{%
+\edef\@glostype{x\csname glo@#2@type\endcsname}%
+\ifx#1\relax
+\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname}}%
+\else
+\protected@edef\@glo@cmd{\expandafter\noexpand\csname \@glostype\endcsname{\csname glo@#2@entry\endcsname,#1}}%
+\fi
+\@glo@cmd{#3}%
+}}
+
+\newcommand{\gls}[2][\relax]{\useGlosentry[#1]{#2}{\csname glo@#2@name\endcsname}}
+% \end{macrocode}
+% This command was defined in earlier verions, but doesn't
+% work very well, currently retained for backwards compatibility,
+% but may well be removed at a later date.
+% \begin{macrocode}
+\providecommand{\saveglosentry}[3][glossary]{%
+\expandafter\def\csname glo@#2@type\endcsname{#1}%
+\expandafter\def\csname glo@#2@entry\endcsname{name={#2},description={#3}}
+}
+
+% \end{macrocode}
+%Set up default number formats, dependent on the package "number" option.
+%Define default page compositor. Any redefinition of the page compositor
+%will need to come before the ".ist" file is written. The other commands
+%can be redefined at any point before "\printglossary"
+% \begin{macrocode}
+\ifthenelse{\equal{\gls@number}{page}}{
+ \newcommand{\theglossarynum}{\thepage}
+ \newcommand{\pagecompositor}{-}
+ \newcommand{\@glossary@delimN}{, }
+ \newcommand{\@glossary@delimR}{--}
+ \ifglshyper
+ \newcommand{\glsXglossaryXnumformat}[1]{\hyperrm{#1}}%
+ \else
+ \newcommand{\glsXglossaryXnumformat}[1]{#1}\fi}
+ {\ifthenelse{\equal{\gls@number}{section}}
+ {\newcommand{\theglossarynum}{\thesection}
+ \newcommand{\pagecompositor}{.}
+ \newcommand{\@glossary@delimN}{, }
+ \newcommand{\@glossary@delimR}{--}
+ \ifglshyper
+ \newcommand{\glsXglossaryXnumformat}[1]{\hyperrm{#1}}%
+ \else
+ \newcommand{\glsXglossaryXnumformat}[1]{#1}%
+ \fi}
+ {\newcommand{\theglossarynum}{\thepage}
+ \newcommand{\pagecompositor}{-}
+ \newcommand{\@glossary@delimN}{}
+ \newcommand{\@glossary@delimR}{}
+ \newcommand{\glsXglossaryXnumformat}[1]{}}}
+
+\newcommand{\glsnumformat}[2][glossary]{%
+\@ifundefined{glsX#1Xnumformat}{%
+\PackageError{glossary}{Glossary type '#1' undefined}{}}{%
+\csname glsX#1Xnumformat\endcsname{#2}}}
+
+\def\@glostype{glossary}
+\newcommand{\delimN}{\csname @\@glostype @delimN\endcsname}
+\newcommand{\delimR}{\csname @\@glostype @delimR\endcsname}
+\newcommand{\glodelim}{\csname @\@glostype @glodelim\endcsname}
+
+% \end{macrocode}
+% Allow user to change number format for different
+% glossary types.
+% \begin{macrocode}
+\define@key{glossnum}{glsnumformat}{\def\@glsnumformat{#1}}
+\define@key{glossnum}{type}{\def\@glsnumtype{#1}}
+\define@key{glossnum}{delimN}{\def\@delimN{#1}}
+\define@key{glossnum}{delimR}{\def\@delimR{#1}}
+\define@key{glossnum}{glodelim}{\def\@glodelim{#1}}
+
+\providecommand{\ignore}[1]{}
+\newcommand{\setglossary}[1]{%
+\def\@glsnumformat{}%
+\def\@glsnumtype{glossary}%
+\def\@delimN{@dontchange@}%
+\def\@delimR{@dontchange@}%
+\def\@glodelim{@dontchange@}%
+\setkeys{glossnum}{#1}\relax
+\@ifundefined{print\@glsnumtype}{%
+\PackageError{glossary}{Invalid glossary type '\@glsnumtype'}{%
+Glossary type '\@glsnumtype' has not been defined}
+}{%
+\ifthenelse{\equal{\@glsnumformat}{}}{}{%
+\expandafter\xdef\csname glsX\@glsnumtype Xnumformat\endcsname{%
+\noexpand\csname\@glsnumformat\noexpand\endcsname}%
+\ifthenelse{\equal{\@glsnumformat}{ignore}}{%
+\expandafter\xdef\csname @\@glsnumtype @delimN\endcsname{}%
+\expandafter\xdef\csname @\@glsnumtype @delimR\endcsname{}%
+}{}%
+}%
+
+\ifthenelse{\equal{\@delimN}{@dontchange@}}{}{%
+\expandafter\xdef\csname @\@glsnumtype @delimN\endcsname{%
+\@delimN}}
+
+\ifthenelse{\equal{\@delimR}{@dontchange@}}{}{%
+\expandafter\xdef\csname @\@glsnumtype @delimR\endcsname{%
+\@delimR}}
+
+\ifthenelse{\equal{\@glodelim}{@dontchange@}}{}{%
+\expandafter\xdef\csname @\@glsnumtype @glodelim\endcsname{%
+\@glodelim}
+}
+}}
+% \end{macrocode}
+% Now define the command "\printglossary" which will print the contents of the glossary file.
+% \begin{macrocode}
+\newcommand{\@gls@glossary@inext}{gls}
+\newcommand\printglossary[1][glossary]{%
+\def\@glostype{#1}%
+\@ifundefined{#1name}{%
+\renewcommand{\@glossaryname}{\glossaryname}}{%
+\renewcommand{\@glossaryname}{\csname #1name\endcsname}}%
+\@ifundefined{short#1name}{%
+\renewcommand{\@shortglossaryname}{\@glossaryname}}{%
+\renewcommand{\@shortglossaryname}{\csname short#1name\endcsname}}%
+\@input@{\jobname.\csname @gls@#1@inext\endcsname}}
+% \end{macrocode}
+% Define contextual names. Changed \verb/\newcommand/
+% to \verb/\providecommand/ in version 2.2.
+% \begin{macrocode}
+\providecommand{\glossaryname}{Glossary}
+\newcommand{\shortglossaryname}{\glossaryname}
+\newcommand{\entryname}{Notation}
+\newcommand{\descriptionname}{Description}
+\newcommand{\istfilename}{\jobname.ist}
+\def\@glossaryname{\glossaryname}
+\def\@shortglossaryname{\shortglossaryname}
+% \end{macrocode}
+% Define command to generate glossary title (new to
+% version 2.24)
+% \begin{macrocode}
+\providecommand{\glossarytitle}{%
+\@ifundefined{chapter}
+{\section*{\@glossaryname}\relax
+ \ifgls@toc\@glosaddtoc{section}\fi}
+{\ifthenelse{\boolean{gls@section}}
+ {\section*{\@glossaryname}\relax
+ \ifgls@toc\@glosaddtoc{section}\fi}
+ {\ifgls@hypertoc\@ifundefined{if@twoside}{\clearpage}{%
+ \if@twoside\@ifundefined{cleardoublepage}{\cleardoublepage}{\clearpage}\else
+ \clearpage\fi}\phantomsection\@glosaddtoc{chapter}\fi\chapter*{\@glossaryname}\relax
+ \ifgls@toc\@glosaddtoc{chapter}\fi}}
+\markboth{\@shortglossaryname}{\@shortglossaryname}%
+}
+% \end{macrocode}
+% Now define theglossary environment. Version 2.2:
+% check to see if defined already
+% \begin{macrocode}
+\@ifundefined{theglossary}{
+\newenvironment{theglossary}
+{\glossarytitle
+ \glossarypreamble\@bef@reglos}
+ {\@ftergl@s\glossarypostamble}
+}{%
+\PackageWarning{glossary}{Redefining 'theglossary' environment}
+\renewenvironment{theglossary}
+{\glossarytitle
+ \glossarypreamble\@bef@reglos}
+ {\@ftergl@s\glossarypostamble}
+}
+% \end{macrocode}
+% Provide a means to add text to the beginning or end
+% of the glossary.
+% \begin{macrocode}
+\newcommand{\glossarypreamble}{}
+\newcommand{\glossarypostamble}{}
+% \end{macrocode}
+% By default, add the short title to the table of contents.
+% \begin{macrocode}
+\newcommand{\@glosaddtoc}[1]{%
+\addcontentsline{toc}{#1}{\@shortglossaryname}
+}
+% \end{macrocode}
+% Set up switch to determine whether the item is the first item in the
+% glossary (in the event that a special case is needed for the first item)
+% \begin{macrocode}
+
+\newif\ifgloitemfirst
+\newcommand{\@bef@reglos}{\global\gloitemfirsttrue\beforeglossary}
+\newcommand{\@ftergl@s}{\afterglossary\global\gloitemfirstfalse}
+% \end{macrocode}
+% Now define what to do depending on which style has been selected.
+%First deal with the "list" and "altlist" style, as they're the easiest.
+% \begin{macrocode}
+
+\ifthenelse{\equal{\gls@style}{list} \or \equal{\gls@style}{altlist}}
+{
+\newcommand{\beforeglossary}{\begin{description}}
+\newcommand{\afterglossary}{\end{description}}
+\newcommand{\gloskip}{\indexspace}
+\ifthenelse{\equal{\gls@style}{list}}
+ {\newcommand{\gloitem}[1]{\item[#1]}
+ \newcommand{\@glossary@glodelim}{, }}
+ {\newcommand{\gloitem}[1]{\item[#1]\mbox{}\par}
+ \newcommand{\@glossary@glodelim}{ }}
+}{
+% \end{macrocode}
+%Now deal with the other styles. I orginally used a "tabular" environment,
+%but obviously this doesn't work for a glossary longer than one page.
+%Nick van Foreest recommended the "supertabular" environment. The
+% "longtable" environment also works, so have both options, and leave it to
+% the user.
+% \begin{macrocode}
+\ifthenelse{\equal{\gls@style}{super}}{
+\IfFileExists{supertab.sty}{\RequirePackage{supertab}}
+{\IfFileExists{supertabular.sty}{\RequirePackage{supertabular}}
+{\PackageError{glossary}{Option "super" chosen, but can't find "supertab" package}
+{If you want the "super" option, you have to have the "supertab" package installed.}}}
+}
+{\RequirePackage{longtable}}
+
+\newlength{\descriptionwidth}
+\setlength{\descriptionwidth}{0.6\textwidth}
+
+\ifthenelse{\equal{\gls@header}{none}}
+{
+ \ifthenelse{\equal{\gls@border}{none}}
+ {\newcommand{\glossaryheader}{}}
+ {\newcommand{\glossaryheader}{\hline }}
+}
+{
+\ifnum\gls@cols=2\relax
+ \ifthenelse{\equal{\gls@border}{none}}
+ {\newcommand{\glossaryheader}
+ {\bfseries\entryname & \bfseries \descriptionname\\}}
+ {\newcommand{\glossaryheader}
+ {\hline\bfseries\entryname & \bfseries\descriptionname
+ \\\hline\hline}}
+\else
+ \ifthenelse{\equal{\gls@border}{none}}
+ {\newcommand{\glossaryheader}
+ {\bfseries\entryname & \bfseries \descriptionname & \\}}
+ {\newcommand{\glossaryheader}
+ {\hline\bfseries\entryname &\bfseries\descriptionname &
+ \\\hline\hline}}
+\fi
+}
+
+\ifthenelse{\equal{\gls@border}{none}}
+{
+\ifnum\gls@cols=2\relax
+ \@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}}}{
+ \newcolumntype{G}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}}}
+\else
+ \@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}}{
+ \newcolumntype{G}{@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l}}
+\fi
+
+ \ifthenelse{\equal{\gls@style}{super}}{
+ \newcommand{\afterglossary}{ \\\end{supertabular}}
+ }
+ {
+ \newcommand{\afterglossary}{ \\\end{longtable}}
+ }
+
+ \newcommand{\glosstail}{}
+}
+{
+\ifnum\gls@cols=2\relax
+ \@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}}{
+ \newcolumntype{G}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}|}}
+\else
+ \@ifundefined{newcolumntype}{\newcommand{\glossaryalignment}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l|}}{
+ \newcolumntype{G}{|@{\hspace{\tabcolsep}\bfseries}lp{\descriptionwidth}l|}}
+\fi
+
+ \ifthenelse{\equal{\gls@style}{super}}{
+ \newcommand{\afterglossary}{ \\\hline\end{supertabular}}
+ }
+ {
+ \newcommand{\afterglossary}{ \\\hline\end{longtable}}
+ }
+
+ \newcommand{\glosstail}{\hline}
+}
+
+\ifthenelse{\equal{\gls@style}{super}}
+{
+ \@ifundefined{newcolumntype}{
+ \newcommand{\beforeglossary}
+ {\tablehead{\glossaryheader}\tabletail{\glosstail}
+ \begin{supertabular}{\glossaryalignment}}}
+ {\newcommand{\beforeglossary}
+ {\tablehead{\glossaryheader}\tabletail{\glosstail}
+ \begin{supertabular}{G}}}
+}
+{
+ \@ifundefined{newcolumntype}{\newcommand{\beforeglossary}
+ {\begin{longtable}{\glossaryalignment}
+ \glossaryheader\endhead\glosstail\endfoot}}
+ {\newcommand{\beforeglossary}
+ {\begin{longtable}{G}
+ \glossaryheader\endhead\glosstail\endfoot}}
+}
+
+\ifnum\gls@cols=2\relax
+\newcommand{\gloskip}{\ifgloitemfirst\global\gloitemfirstfalse \else\\ \fi &}
+\newcommand{\@glossary@glodelim}{, }
+\else
+\newcommand{\gloskip}{\ifgloitemfirst\global\gloitemfirstfalse \else\\ \fi & &}
+\newcommand{\@glossary@glodelim}{& }
+\fi
+\newcommand{\gloitem}[1]{\ifgloitemfirst\global\gloitemfirstfalse #1 \else \\#1 \fi &}
+}
+
+\ifthenelse{\equal{\gls@number}{none} \and \gls@cols<3}{\renewcommand{\@glossary@glodelim}{}}{}
+% \end{macrocode}
+% \subsection{Makeindex style file}
+%This is the code to generate the ".ist" file.
+% \begin{macrocode}
+\newif\ifist
+\let\noist=\istfalse
+\if@filesw\isttrue\else\istfalse\fi
+
+\newwrite\istfile
+\catcode`\%11\relax
+\newcommand{\writeist}{
+\openout\istfile=\istfilename
+\write\istfile{% makeindex style file created by LaTeX for document "\jobname" on \the\year-\the\month-\the\day}
+\write\istfile{keyword "\string\\glossaryentry"}
+\write\istfile{preamble "\string\\begin{theglossary}"}
+\write\istfile{postamble "\string\n\string\\end{theglossary}\string\n"}
+\write\istfile{group_skip "\string\\gloskip "}
+\write\istfile{item_0 "\string\n\string\\gloitem "}
+\write\istfile{delim_0 "\string\n\string\\glodelim "}
+\write\istfile{page_compositor "\pagecompositor"}
+\write\istfile{delim_n "\string\\delimN "}
+\write\istfile{delim_r "\string\\delimR "}
+\closeout\istfile
+}
+\catcode`\%14\relax
+% \end{macrocode}
+%Redefine "\makeglossary" so that it creates the ".ist" file. Once it is
+% created, the "\ifist" flag is set to false to prevent repeated creation of
+% the file in the event that another glossary-style type is created. If a
+% different ".ist" file is desired for each glossary type, you will need
+% to precede each "\make"\meta{type} with "\isttrue" and changed the definition
+% of "\istfilename". (This is unlikely to occur unless more than one type
+% of page compositor is required.)
+% The "\glossary" command has been modified to allow for
+% an optional argument to modify the label.
+% \begin{macrocode}
+\renewcommand{\makeglossary}{
+\newwrite\@glossaryfile
+\immediate\openout\@glossaryfile=\jobname.glo
+\renewcommand{\glossary}[1][]{\gdef\@glo@l@bel{##1}%
+\@bsphack \begingroup \@sanitize \@wrglossary }
+\typeout {Writing glossary file \jobname .glo }
+\let \makeglossary \@empty
+\ifist\writeist\fi
+\noist}
+
+\renewcommand{\glossary}[1][]{%
+\@bsphack\begingroup\@sanitize\@index}
+% \end{macrocode}
+%\subsection{Defining new glossary type}
+%First parameter name of new glossary type e.g.\ "notation".
+%Second parameter extension of output file (equivalent to "ind" or "glo".
+%Third parameter extension of input file (equivalent to "idx" or "gls").
+% \begin{macrocode}
+\newcommand{\@newglossarytype}[4][glg]{}
+\newcommand{\newglossarytype}[4][glg]{
+\@ifundefined{#2}{%
+\protected@write\@auxout{}{\@newglossarytype[#1]{#2}{#3}{#4}}%
+\def\@glstype{#2}\def\@glsout{#3}\def\@glsin{#4}%
+\expandafter\gdef\csname glsX\@glstype Xnumformat\endcsname{\glsXglossaryXnumformat}%
+\expandafter\gdef\csname @\@glstype @delimN\endcsname{\@glossary@delimN}%
+\expandafter\gdef\csname @\@glstype @delimR\endcsname{\@glossary@delimR}%
+\expandafter\gdef\csname @\@glstype @glodelim\endcsname{\@glossary@glodelim}%
+\expandafter\gdef\csname @gls@\@glstype @inext\endcsname{#4}%
+\expandafter\def\csname @gls@#2@type\endcsname{#4}%
+\expandafter\edef\csname make\@glstype\endcsname{%
+\noexpand\@m@kegl@ss{\@glstype}{\@glsout}}
+\expandafter\edef\csname \@glstype\endcsname{%
+\noexpand\@gl@ss@ary{\@glstype}}
+\expandafter\edef\csname x\@glstype\endcsname{%
+\noexpand\@Gl@ss@ary{\@glstype}}
+\expandafter\edef\csname print\@glstype\endcsname{%
+\noexpand\def\noexpand\@glostype{\@glstype}%
+\noexpand\@ifundefined{\@glstype name}{%
+\noexpand\def\noexpand\@glossaryname{\noexpand\glossaryname}%
+}{%
+\noexpand\def\noexpand\@glossaryname{%
+\noexpand\csname\@glstype name\noexpand\endcsname}}%
+%
+\noexpand\@ifundefined{short\@glstype name}{%
+\noexpand\def\noexpand\@shortglossaryname{\noexpand\@glossaryname}%
+}{%
+\noexpand\edef\noexpand\@shortglossaryname{%
+\noexpand\csname short\@glstype name\noexpand\endcsname}}%
+\noexpand\@prntgl@ss@ry{\@glsin}}
+}{\PackageError{glossary}{Command
+\expandafter\string\csname #2\endcsname \space already defined}{%
+You can't call your new glossary type '#2' because there already
+exists a command with this name}}
+}
+% \end{macrocode}
+% Define equivalent of "\makeglossary":
+% \begin{macrocode}
+\newcommand\@m@kegl@ss[2]{
+\expandafter\newwrite\csname @#1file\endcsname
+\expandafter\immediate\expandafter
+ \openout\csname @#1file\endcsname=\jobname.#2
+\typeout {Writing #1 file \jobname .#2 }
+\expandafter\let \csname make#1\endcsname \@empty
+\ifist\writeist\fi
+\expandafter\def\csname the#1num\endcsname{\thepage}
+\noist
+}
+% \end{macrocode}
+% Define equivalent of "\@wrglossary":
+% \begin{macrocode}
+\newcommand{\@wrgl@ss@ry}[2]{\relax
+\gdef\@glo@n@me{}\def\@descr{}\def\@s@rt{}\def\@f@rm@t{}\relax
+\xdef\@pr@fix{\csname @gls@#1@type\endcsname}%
+\ifthenelse{\equal{\@s@rt}{}}{\gdef\@s@rt{\@glo@n@me}}{}%
+\ifthenelse{\equal{\@glo@l@bel}{}}{\gdef\@glo@l@bel{\@pr@fix:\@s@rt}}{}%
+\setkeys{wrgloss}{#2}\relax
+ \ifthenelse{\equal{\@f@rm@t}{}}
+ {\expandafter\protected@write\csname @#1file\endcsname{}{%
+\string\glossaryentry{\@s@rt @{%
+\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}%
+\@descr\string\relax|glsnumformat[#1]}{\csname the#1num\endcsname}}}
+ {\expandafter\protected@write\csname @#1file\endcsname{}{%
+\string\glossaryentry{\@s@rt @{%
+\string\glosslabel{\@glo@l@bel}{\@glo@n@me}}%
+\@descr\string\relax|\@f@rm@t}{\csname the#1num\endcsname}}}\relax
+\endgroup\@esphack
+\@@wrgl@ss@ry
+}
+
+\newcommand{\@@wrgl@ss@ry}{}
+% \end{macrocode}
+% Define the equivalent of "\glossary".
+% \begin{macrocode}
+\newcommand\@gl@ss@ary[2][]{\@ifundefined{@#2file}{%
+\@bsphack\begingroup \@sanitize \@index}{%
+\gdef\@glo@l@bel{#1}%
+\@bsphack \begingroup \@sanitize \@wrgl@ss@ry{#2}}}
+% \end{macrocode}
+% Define the equivalent of "\xglossary".
+% \begin{macrocode}
+\newcommand{\@Gl@ss@ary}{%
+\renewcommand{\@@wrgl@ss@ry}[1]{%
+\glossref{\@glo@l@bel}{##1}\renewcommand{\@@wrgl@ss@ry}{}}%
+\@gl@ss@ary}
+% \end{macrocode}
+% Define equivalent of "\printglossary".
+% \begin{macrocode}
+\newcommand\@prntgl@ss@ry[1]{\@input@{\jobname.#1}}
+% \end{macrocode}
+% The command "\newglossarytype" should only be used in the preamble.
+% \begin{macrocode}
+\@onlypreamble{\newglossarytype}
+% \end{macrocode}
+% Define "\newacronym"[\meta{cmd-name}]\{\meta{abbrv}\}\{\meta{long name}\}\{\meta{glos entry}\}
+% \begin{macrocode}
+\newcommand\@acrnmsh{}
+\newcommand\@sacrnmsh{}
+\newcommand\@acrnmln{}
+\newcommand\@acrnmcmd{}
+\newcommand\@acrnmgls{}
+\newcommand\@acrnmins{}
+% \end{macrocode}
+% List of all defined acronyms.
+% \begin{macrocode}
+\toksdef\@glo@tb=2
+\newcommand{\@acr@list}{}
+% \end{macrocode}
+% append acronym to list
+% \begin{macrocode}
+\newcommand{\@acr@addtolist}[1]{\edef\@glo@ta{#1}%
+\ifthenelse{\equal{\@acr@list}{}}{%
+\edef\@acr@list{\@glo@ta}}{%
+\@glo@tb=\expandafter{\@acr@list}%
+\edef\@acr@list{\the\@glo@tb,\@glo@ta}}}
+% \end{macrocode}
+% This should no longer be used
+% \begin{macrocode}
+\newcommand{\glsprimaryfmt}[1]{\textbf{\glsnumformat{#1}}}
+% \end{macrocode}
+% \begin{macrocode}
+%\newcommand{\acronymlabprefix}{GGG}
+\newcommand{\@acronymnamefmt}{\glolong\ (\gloshort)}
+\newcommand{\setacronymnamefmt}[1]{\def\@acronymnamefmt{#1}}
+% \end{macrocode}
+% Format the acronym abbreviation in the format specified
+% by \verb'\acronymfont'. This simply prints its
+% argument by default.
+% \begin{macrocode}
+\newcommand{\acronymfont}[1]{#1}
+% \end{macrocode}
+% This command has been restructured as from v2.17
+% \begin{macrocode}
+\newcommand{\newacronym}[4][]{%
+\ifthenelse{\equal{#1}{}}{\renewcommand\@acrnmcmd{#2}}{\renewcommand\@acrnmcmd{#1}}
+\@ifundefined{\@acrnmcmd}{%
+\expandafter\newcommand\csname\@acrnmcmd short\endcsname{#2\protect\glsxspace}
+\expandafter\newcommand\csname\@acrnmcmd long\endcsname{#3\protect\glsxspace}
+\def\@acrn@entry{#4}
+{
+\def\glolong{#3}%
+\def\gloshort{\noexpand\acronymfont{#2}}%
+\expandafter\protected@xdef\expandafter\@acrnamefmt{\@acronymnamefmt}
+}
+\@acr@addtolist{\@acrnmcmd}
+\protected@edef\@acr@glsentry{name=\@acrnamefmt,format=glsnumformat,sort=\@acrnmcmd,\@acrn@entry}
+\newboolean{\@acrnmcmd first}\setboolean{\@acrnmcmd first}{true}
+\expandafter\protected@edef\csname \@acrnmcmd\endcsname{\noexpand\@ifstar{\csname @s@\@acrnmcmd\endcsname}{\csname @\@acrnmcmd\endcsname}}
+\ifglshyperacronym
+% unstarred version
+\expandafter\protected@edef\csname @\@acrnmcmd\endcsname{%
+\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
+\noexpand\gls@noxspace{\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
+(\noexpand\xacronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
+})}\noexpand\setboolean{\@acrnmcmd first}{false}%
+}{\noexpand\xacronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}\noexpand\@acrnmins}}\noexpand\glsxspace}
+% starred version
+\expandafter\protected@edef\csname @s@\@acrnmcmd\endcsname{%
+\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
+\noexpand\gls@noxspace{\noexpand\expandafter\noexpand\MakeUppercase
+\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
+(\noexpand\xacronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
+})}%
+\noexpand\setboolean{\@acrnmcmd first}{false}}{%
+\noexpand\xacronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\noexpand\expandafter\noexpand\MakeUppercase
+\csname\@acrnmcmd short\endcsname}%
+\noexpand\@acrnmins}}\noexpand\glsxspace}
+\else
+% unstarred version
+\expandafter\protected@edef\csname @\@acrnmcmd\endcsname{%
+\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
+\noexpand\gls@noxspace{\csname\@acrnmcmd long\endcsname\
+(\noexpand\acronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
+})}\noexpand\setboolean{\@acrnmcmd first}{false}%
+}{\noexpand\acronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}}}%
+\noexpand\glsxspace}
+% starred version
+\expandafter\protected@edef\csname @s@\@acrnmcmd\endcsname{%
+\noexpand\ifthenelse{\noexpand\boolean{\@acrnmcmd first}}{%
+\noexpand\gls@noxspace{\noexpand\expandafter
+\noexpand\MakeUppercase
+\csname\@acrnmcmd long\endcsname\noexpand\@acrnmins\
+(\noexpand\acronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\csname\@acrnmcmd short\endcsname}%
+})}%
+\noexpand\setboolean{\@acrnmcmd first}{false}}{%
+\noexpand\acronym{\@acr@glsentry}{%
+\noexpand\acronymfont{\noexpand\expandafter\noexpand\MakeUppercase
+\csname\@acrnmcmd short\endcsname}%
+\noexpand\@acrnmins}}\noexpand\glsxspace}
+\fi
+}{%
+\PackageError{glossary}{Command '\expandafter\string\csname\@acrnmcmd\endcsname' already defined}{
+ The command name specified by \string\newacronym already exists.}}}
+
+\newcommand{\useacronym}{\@ifstar\@suseacronym\@useacronym}
+\newcommand{\@suseacronym}[2][]{{\let\glsxspace\relax
+\def\@acrnmins{#1}\csname @s@#2\endcsname}%
+\setboolean{#2first}{false}}
+\newcommand{\@useacronym}[2][]{{\let\glsxspace\relax
+\def\@acrnmins{#1}\csname @#2\endcsname}%
+\setboolean{#2first}{false}}
+
+\newcommand{\acrln}{\@ifstar\@sacrln\@acrln}
+
+\newcommand{\@acrln}[1]{\@ifundefined{#1long}{%
+\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
+\gls@noxspace{\csname#1long\endcsname}}}
+
+\newcommand{\@sacrln}[1]{\@ifundefined{#1long}{%
+\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
+\gls@noxspace{\expandafter\expandafter\expandafter
+\MakeUppercase\csname#1long\endcsname}}}
+
+\newcommand{\acrsh}{\@ifstar\@sacrsh\@acrsh}
+
+\newcommand{\@acrsh}[1]{\@ifundefined{#1short}{%
+\PackageError{glossary}{Acronym '#1' has not been defined}{}}{\acronymfont{\gls@noxspace{\csname#1short\endcsname}}}}
+
+\newcommand{\@sacrsh}[1]{\@ifundefined{#1short}{%
+\PackageError{glossary}{Acronym '#1' has not been defined}{}}{%
+\acronymfont{\gls@noxspace{\expandafter\expandafter\expandafter\MakeUppercase\csname#1short\endcsname}}}}
+
+\newcommand{\ifacronymfirstuse}[3]{%
+\@ifundefined{if#1first}{%
+\PackageError{glossary}{Acronym '#1' not defined}{}}{%
+\ifthenelse{\boolean{#1first}}{#2}{#3}}}
+
+\newcommand{\resetacronym}[1]{%
+\@ifundefined{if#1first}{%
+\PackageError{glossary}{Acronym '#1' not defined}{}}{%
+\setboolean{#1first}{true}}}
+
+\newcommand{\resetallacronyms}{%
+\@for\@acr:=\@acr@list\do{\resetacronym{\@acr}}}
+% \end{macrocode}
+%These commands are provided to make it easier change the page number format to bf, sf, tt and it
+%if you are using hyperlinks
+% \begin{macrocode}
+\ifglshyper
+% this is modified from definition of "\hyperpage" in "hyperref.sty"
+\def\glshyperpage#1{\@glshyperpage#1\delimR \delimR \\}
+\def\@glshyperpage#1\delimR #2\delimR #3\\{%
+ \ifx\\#2\\%
+ \@delimNhyperpage{#1}%
+ \else
+ \@ifundefined{hyperlink}{#1\delimR #2}{\hyperlink{page.#1}{#1}\delimR \hyperlink{page.#2}{#2}}%
+ \fi
+}
+
+\def\@delimNhyperpage#1{\@@delimNhyperpage#1\delimN \delimN\\}
+\def\@@delimNhyperpage#1\delimN #2\delimN #3\\{%
+ \ifx\\#2\\%
+ \@ifundefined{hyperlink}{#1}{\hyperlink{page.#1}{#1}}%
+ \else
+ \@ifundefined{hyperlink}{#1\delimN #2}{\hyperlink{page.#1}{#1}\delimN \hyperlink{page.#2}{#2}}%
+ \fi
+}
+
+\def\glshypersection#1{\@glshypersection#1\delimR \delimR \\}
+\def\@glshypersection#1\delimR #2\delimR #3\\{%
+ \ifx\\#2\\%
+ \@delimNhypersection{#1}%
+ \else
+ \@ifundefined{hyperlink}{#1\delimR #2}{\hyperlink{section.#1}{#1}\delimR \hyperlink{section.#2}{#2}}%
+ \fi
+}
+
+\def\@delimNhypersection#1{\@@delimNhypersection#1\delimN \delimN\\}
+\def\@@delimNhypersection#1\delimN #2\delimN #3\\{%
+ \ifx\\#2\\%
+ \@ifundefined{hyperlink}{#1}{\hyperlink{section.#1}{#1}}%
+ \else
+ \@ifundefined{hyperlink}{#1\delimN #2}{\hyperlink{section.#1}{#1}\delimN \hyperlink{section.#2}{#2}}%
+ \fi
+}
+
+\ifthenelse{\equal{\gls@number}{section}}{
+\ifglshyper
+\@ifundefined{chapter}
+ {}
+ {\let\@gls@old@chapter\@chapter
+ \def\@chapter[#1]#2{\@gls@old@chapter[{#1}]{#2}\@ifundefined{hyperdef}{}{\hyperdef{section}{\thechapter.0}{}}}}
+\fi
+
+\providecommand\hyperrm[1]{\textrm{\glshypersection{#1}}}
+\providecommand\hypersf[1]{\textsf{\glshypersection{#1}}}
+\providecommand\hypertt[1]{\texttt{\glshypersection{#1}}}
+\providecommand\hyperbf[1]{\textbf{\glshypersection{#1}}}
+\providecommand\hyperit[1]{\textit{\glshypersection{#1}}}
+}
+{
+\providecommand\hyperrm[1]{\textrm{\glshyperpage{#1}}}
+\providecommand\hypersf[1]{\textsf{\glshyperpage{#1}}}
+\providecommand\hypertt[1]{\texttt{\glshyperpage{#1}}}
+\providecommand\hyperbf[1]{\textbf{\glshyperpage{#1}}}
+\providecommand\hyperit[1]{\textit{\glshyperpage{#1}}}
+}
+\else
+\providecommand\hyperrm[1]{\textsf{#1}}
+\providecommand\hypersf[1]{\textsf{#1}}
+\providecommand\hypertt[1]{\texttt{#1}}
+\providecommand\hyperbf[1]{\textbf{#1}}
+\providecommand\hyperit[1]{\textit{#1}}
+\fi
+% \end{macrocode}
+% Check to see if acronyms should be separate from glossary
+% \begin{macrocode}
+\ifglsacronym
+\newglossarytype[alg]{acronym}{acr}{acn}
+\newcommand{\acronymname}{List of Acronyms}
+\else
+\let\acronym=\glossary
+\let\xacronym=\xglossary
+\fi
+% \end{macrocode}
+%\subsection{makeglos code}
+% \begin{macrocode}
+%</glossary.sty>
+% \end{macrocode}
+% \begin{macrocode}
+%<*makeglos.pl>
+% \end{macrocode}
+% \begin{macrocode}
+#!/usr/bin/perl
+
+# File : makeglos
+# Author : Nicola Talbot
+# Version : 1.3 (2005/06/28)
+# Description: simple Perl script that calls makeindex.
+# Intended for use with "glossary.sty" (saves having to remember
+# all the various switches)
+
+use Getopt::Std;
+
+if ($#ARGV < 0)
+{
+ die "Syntax : $0 [-ilqrcgm] [-s sty] [-o gls] [-t log] [-p num] <filename>\n";
+}
+
+getopt('sotp');
+getopts('ilqrcgm');
+
+# define known extensions
+
+ %exttype = (
+ glossary => {in=>'glo', out=>'gls', 'log'=>'glg'},
+ );
+
+$ext = '';
+
+if (length(@ARGV[0]) < 4)
+{
+ $name = @ARGV[0];
+}
+elsif (substr(@ARGV[0],-4,1) eq ".")
+{
+ $name = substr(@ARGV[0],0,length(@ARGV[0])-4);
+
+ $ext = substr(@ARGV[0],-3,3);
+}
+else
+{
+ $name = @ARGV[0];
+}
+
+# check log file for other glossary types
+
+if (open AUXFILE, "$name.aux")
+{
+ while (<AUXFILE>)
+ {
+ if (m/\\\@newglossarytype\s*\[(.*)\]{(.*)}{(.*)}{(.*)}/)
+ {
+ $exttype{$2}{'in'} = $3;
+ $exttype{$2}{'out'} = $4;
+ $exttype{$2}{'log'} = $1;
+
+ if (!$opt_q)
+ {
+ print "added glossary type '$2' ($3,$4,$1)\n";
+ }
+ }
+ }
+
+ close AUXFILE;
+}
+else
+{
+ print "unable to open $name.aux\n";
+}
+
+# save all the general makeindex switches
+
+$mkidxopts = '';
+
+if ($opt_i)
+{
+ $mkidxopts .= " -i";
+}
+
+if ($opt_l)
+{
+ $mkidxopts .= " -l";
+}
+
+if ($opt_q)
+{
+ $mkidxopts .= " -q";
+}
+
+if ($opt_r)
+{
+ $mkidxopts .= " -r";
+}
+
+if ($opt_c)
+{
+ $mkidxopts .= " -c";
+}
+
+if ($opt_g)
+{
+ $mkidxopts .= " -g";
+}
+
+unless ($opt_p eq "")
+{
+ $mkidxopts .= " -p $opt_p";
+}
+
+if ($opt_s eq "")
+{
+ $istfile = "$name.ist";
+}
+else
+{
+ $istfile = $opt_s;
+}
+
+if ($ext ne '')
+{
+ %thistype = %{$exttype{'glossary'}}; #default
+
+ foreach $type (keys %exttype)
+ {
+ if ($exttype{$type}{'in'} eq $ext)
+ {
+ %thistype = %{$exttype{$type}};
+
+ last;
+ }
+ }
+
+ if ($opt_o eq "")
+ {
+ $outfile = "$name.$thistype{out}";
+ }
+ else
+ {
+ $outfile = $opt_o;
+ }
+
+ if ($opt_t eq "")
+ {
+ $transcript = "$name.$thistype{'log'}";
+ }
+ else
+ {
+ $transcript = $opt_t;
+ }
+
+ &makeindex("$name.$ext",$outfile,$transcript,$istfile,
+ $mkidxopts,$opt_q,$opt_m);
+}
+else
+{
+ foreach $type (keys %exttype)
+ {
+ %thistype = %{$exttype{$type}};
+
+ $inputfile = "$name.$thistype{in}";
+
+ if (-r $inputfile)
+ {
+ if ($opt_o eq "")
+ {
+ $outfile = "$name.$thistype{out}";
+ }
+ else
+ {
+ $outfile = $opt_o;
+ }
+
+ if ($opt_t eq "")
+ {
+ $transcript = "$name.$thistype{'log'}";
+ }
+ else
+ {
+ $transcript = $opt_t;
+ }
+
+ &makeindex($inputfile,$outfile,$transcript,
+ $istfile,$mkidxopts,$opt_q,$opt_m);
+ }
+ elsif (!$opt_q)
+ {
+ print "no read access for '$inputfile'\n";
+ }
+ }
+}
+
+sub makeindex{
+ local($in,$out,$trans,$ist,$rest,$quiet,$merge) = @_;
+ local($name,$cmdstr,$buffer,$n,$i,$j);
+ local(@stuff,@item);
+
+ if ($merge)
+ {
+ $cmdstr = "$rest -s $ist -t $trans -o tmp_$out $in";
+ }
+ else
+ {
+ $cmdstr = "$rest -s $ist -t $trans -o $out $in";
+ }
+
+ unless ($quiet)
+ {
+ print "makeindex $cmdstr\n";
+ }
+
+ `makeindex $cmdstr`;
+
+ if ($merge)
+ {
+ print "Merging entries\n";
+
+ open INPUT, "<tmp_$out";
+
+ $buffer = "";
+
+ while (<INPUT>)
+ {
+ $buffer .= $_;
+ }
+
+ close INPUT;
+
+ open OUTPUT, ">$out";
+
+ @stuff = split /\\gloitem /, $buffer;
+
+ $n = scalar(@stuff);
+
+ if ($n < 2)
+ {
+ print OUTPUT $buffer;
+ }
+ else
+ {
+ print OUTPUT $stuff[0];
+
+ for ($i = 1, $j=-1; $i < $n; $i++)
+ {
+ if ($stuff[$i]=~s/{\\glosslabel{(.+)}{(.+)}}//)
+ {
+ $name = $&;
+
+ if ($j==-1)
+ {
+ $j = 0;
+ $item[0]{'name'} = $name;
+ $item[0]{'desc'} = $stuff[$i];
+ }
+ else
+ {
+ # makeindex has already sorted the entries
+ # alphabetically, so duplicate entries
+ # will be one after the other
+
+ if ($item[$j]{'name'} eq $name)
+ {
+ $item[$j]{'desc'} .= $stuff[$i];
+
+ print "collating $name\n";
+ }
+ else
+ {
+ $j++;
+ $item[$j]{'name'} = $name;
+ $item[$j]{'desc'} = $stuff[$i];
+ }
+ }
+ }
+ else
+ {
+ print STDERR
+ "unable to extract name from glossary item:\n",
+ $stuff[$i];
+ }
+ }
+
+ for ($i=0; $i <= $j; $i++)
+ {
+ print OUTPUT "\\gloitem ", $item[$i]{'name'},
+ $item[$i]{'desc'};
+ }
+ }
+
+ close OUTPUT;
+
+ print "Output written in $out\n";
+
+ unlink "tmp_$out" or print "Can't delete tmp_$out: $!\n";
+ }
+}
+
+1;
+% \end{macrocode}
+% \begin{macrocode}
+%</makeglos.pl>
+% \end{macrocode}
+% \begin{macrocode}
+%<*makeglos.bat>
+% \end{macrocode}
+% \begin{macrocode}
+@rem = '-*- Perl -*-
+@echo off
+perl -S %0.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
+% \end{macrocode}
+% \begin{macrocode}
+%</makeglos.bat>
+% \end{macrocode}
+% \begin{macrocode}
+%<*glossary.perl>
+% \end{macrocode}
+% \begin{macrocode}
+# File : glossary.perl
+# Author : Nicola Talbot
+# Date : 8 July 2005
+# Version : 1.02
+# Description : LaTeX2HTML implementation of glossary package.
+
+package main;
+
+# These are the only package options implemented.
+
+sub do_glossary_style_altlist{
+}
+
+sub do_glossary_style_hyper{
+}
+
+sub do_glossary_style_hyper_true{
+}
+
+sub do_glossary_style_hyperacronym{
+}
+
+sub do_glossary_style_hyperacronym_true{
+}
+
+sub do_glossary_toc{
+}
+
+sub do_glossary_toc_true{
+}
+
+$acronymtype = 'glossary';
+
+sub do_glossary_acronym{
+ &do_glossary_acronym_true
+}
+
+sub do_glossary_acronym_true{
+ $gls_mark{'acronym'} = "<tex2html_acronym_mark>";
+ $gls_file_mark{'acronym'} = "<tex2html_acronym_file_mark>";
+ $gls_title{'acronym'} = "\\acronymname";
+ $delimN{'acronym'} = ", ";
+ $glodelim{'acronym'} = " ";
+ $glsnumformat{'acronym'} = "textrm";
+ $acronymtype = 'acronym';
+}
+
+sub do_glossary_acronym_false{
+ $acronymtype = 'glossary';
+}
+
+sub do_cmd_acronymname{
+ join('', 'List of Acronyms', $_[0]);
+}
+
+# modify set_depth_levels so that glossary is added
+
+$gls_mark{'glossary'} = "<tex2html_gls_mark>";
+$gls_file_mark{'glossary'} = "<tex2html_gls_file_mark>";
+$gls_title{'glossary'} = "Glossary";
+$delimN{'glossary'} = ", ";
+$glodelim{'glossary'} = " ";
+$glsnumformat{'glossary'} = "textrm";
+
+sub replace_glossary_markers{
+ foreach $type (keys %gls_mark)
+ {
+ if (defined &add_gls_hook)
+ {&add_gls_hook if (/$gls_mark{$type}/);}
+ else
+ {&add_gls($type) if (/$gls_mark{$type}/);}
+
+ s/$gls_file_mark{$type}/$glsfile{$type}/g;
+ }
+}
+
+# there must be a better way of doing this
+# other than copying the orginal code and adding to it.
+sub replace_general_markers {
+ if (defined &replace_infopage_hook) {&replace_infopage_hook if (/$info_page_mark/);}
+ else { &replace_infopage if (/$info_page_mark/); }
+ if (defined &add_idx_hook) {&add_idx_hook if (/$idx_mark/);}
+ else {&add_idx if (/$idx_mark/);}
+ &replace_glossary_markers;
+
+ if ($segment_figure_captions) {
+s/$lof_mark/$segment_figure_captions/o
+ } else { s/$lof_mark/$figure_captions/o }
+ if ($segment_table_captions) {
+s/$lot_mark/$segment_table_captions/o
+ } else { s/$lot_mark/$table_captions/o }
+ &replace_morelinks();
+ if (defined &replace_citations_hook) {&replace_citations_hook if /$bbl_mark/;}
+ else {&replace_bbl_marks if /$bbl_mark/;}
+ if (defined &add_toc_hook) {&add_toc_hook if (/$toc_mark/);}
+ else {&add_toc if (/$toc_mark/);}
+ if (defined &add_childs_hook) {&add_childs_hook if (/$childlinks_on_mark/);}
+ else {&add_childlinks if (/$childlinks_on_mark/);}
+ &remove_child_marks;
+
+ if (defined &replace_cross_references_hook) {&replace_cross_references_hook;}
+ else {&replace_cross_ref_marks if /$cross_ref_mark||$cross_ref_visible_mark/;}
+ if (defined &replace_external_references_hook) {&replace_external_references_hook;}
+ else {&replace_external_ref_marks if /$external_ref_mark/;}
+ if (defined &replace_cite_references_hook) {&replace_cite_references_hook;}
+ else { &replace_cite_marks if /$cite_mark/; }
+ if (defined &replace_user_references) {
+ &replace_user_references if /$user_ref_mark/; }
+
+}
+
+sub add_gls{
+ local($sidx_style, $eidx_style) =('<STRONG>','</STRONG>');
+ if ($INDEX_STYLES) {
+if ($INDEX_STYLES =~/,/) {
+local(@styles) = split(/\s*,\s*/,$INDEX_STYLES);
+ $sidx_style = join('','<', join('><',@styles) ,'>');
+ $eidx_style = join('','</', join('></',reverse(@styles)) ,'>');
+} else {
+ $sidx_style = join('','<', $INDEX_STYLES,'>');
+ $eidx_style = join('','</', $INDEX_STYLES,'>');
+}
+ }
+ &add_real_gls
+}
+
+sub gloskeysort{
+ local($x, $y) = ($a, $b);
+ $x=~s/^(.*)###(\d+)$/\l\1/;
+ local($x_id) = $2;
+ $y=~s/^(.*)###(\d+)$/\l\1/;
+ local($y_id) = $2;
+
+ local($n) = ($x cmp $y);
+
+ if ($n == 0)
+ {
+ $n = ($x_id <=> $y_id);
+ }
+
+ $n;
+}
+
+sub add_real_gls{
+ local($type) = @_;
+ print "\nDoing the $type ...";
+ local($key, $str, @keys, $glossary, $level, $count,
+ @previous, @current, $id, $linktext, $delimN);
+
+ @keys = keys %{$glossary{$type}};
+
+ @keys = sort gloskeysort @keys;
+
+ $level = 0;
+
+ $delimN = $delimN{$type};
+
+ foreach $key (@keys) {
+ $current = $key;
+$str = $current;
+$str =~ s/\#\#\#\d+$//o; # Remove the unique id's
+ #$linktext = $cross_ref_visible_mark;
+ $id = ++$global{'max_id'};
+ $linktext = "\\$glossary_format{$type}{$key}${OP}$id${CP}$glossary_linktext{$type}{$key}${OP}$id${CP}";
+ $linktext = &translate_commands($linktext);
+$glossary .=
+ # If it's the same string don't start a new line
+ (&index_key_eq($current, $previous) ?
+ $delimN
+ . $glossary{$type}{$key}
+ . $linktext
+ . "</A>\n"
+ : "<DT>"
+ . $glossary_name{$type}{$key}
+ . "<DD>". $glossary_desc{$type}{$key}
+ . $glodelim{$type} . $glossary{$type}{$key}
+ . $linktext. "</A>\n");
+$previous = $current;
+ }
+ $glossary = '<DD>'.$glossary unless ($glossary =~ /^\s*<D(T|D)>/);
+
+ $glossary =~ s/(<A [^>]*>)(<D(T|D)>)/$2$1/g;
+
+ $str = &translate_commands("\\glossarypostamble");
+ s/$gls_mark{$type}/$preglossary\n<DL COMPACT>\n$glossary<\/DL>$str\n/s;
+}
+
+sub set_depth_levels {
+ # Sets $outermost_level
+ local($level);
+ # scan the document body, not the preamble, for use of sectioning commands
+ my ($contents) = $_;
+ if ($contents =~ /\\begin\s*((?:$O|$OP)\d+(?:$C|$CP))document\1|\\startdocument/s) {
+$contents = $';
+ }
+ foreach $level ("part", "chapter", "section", "subsection",
+ "subsubsection", "paragraph") {
+last if (($outermost_level) = $contents =~ /\\($level)$delimiter_rx/);
+last if (($outermost_level) = $contents =~ /\\endsegment\s*\[\s*($level)\s*\]/s);
+if ($contents =~ /\\segment\s*($O\d+$C)[^<]+\1\s*($O\d+$C)\s*($level)\s*\2/s)
+{ $outermost_level = $3; last };
+ }
+ $level = ($outermost_level ? $section_commands{$outermost_level} :
+ do {$outermost_level = 'section'; 3;});
+
+ if ($REL_DEPTH && $MAX_SPLIT_DEPTH) {
+$MAX_SPLIT_DEPTH = $level + $MAX_SPLIT_DEPTH;
+ } elsif (!($MAX_SPLIT_DEPTH)) { $MAX_SPLIT_DEPTH = 1 };
+
+ %unnumbered_section_commands = (
+ 'tableofcontents', $level
+, 'listoffigures', $level
+, 'listoftables', $level
+, 'bibliography', $level
+, 'textohtmlindex', $level
+, 'textohtmlglossary', $level
+ , %unnumbered_section_commands
+ );
+
+ %section_commands = (
+ %unnumbered_section_commands
+ , %section_commands
+ );
+}
+
+sub add_bbl_and_idx_dummy_commands {
+ local($id) = $global{'max_id'};
+
+ s/([\\]begin\s*$O\d+$C\s*thebibliography)/$bbl_cnt++; $1/eg;
+ ## if ($bbl_cnt == 1) {
+s/([\\]begin\s*$O\d+$C\s*thebibliography)/$id++; "\\bibliography$O$id$C$O$id$C $1"/geo;
+ #}
+ $global{'max_id'} = $id;
+ s/([\\]begin\s*$O\d+$C\s*theindex)/\\textohtmlindex $1/o;
+ s/[\\]printindex/\\textohtmlindex /o;
+ &add_gls_dummy_commands;
+ &lib_add_bbl_and_idx_dummy_commands() if defined(&lib_add_bbl_and_idx_dummy_commands);
+}
+
+# this gets called before do_cmd_newglossarytype
+# so currently only substitutes \\printglossary and \\printacronym
+sub add_gls_dummy_commands{
+ #foreach $type (keys %gls_mark)
+ #{
+ # #$id = ++$global{'max_id'};
+ # s/[\\]print$type/\\textohtmlglossary[$type]/sg;
+ #}
+
+ s/[\\]printglossary/\\textohtmlglossary/sg;
+ s/[\\]printacronym/\\textohtmlglossary[$acronymtype]/sg;
+}
+
+# This is modified from do_cmd_textohtmlindex
+
+sub do_cmd_textohtmlglossary{
+ local($_) = @_;
+
+ local($type);
+
+ $_[0]=~s/^\s*\[([^]]*)\]//;
+ $type = $1;
+ if ($type eq '') {$type = 'glossary';}
+
+ unless (defined $gls_mark{$type})
+ {
+ &write_warnings("glossary type '$type' not implemented");
+ }
+
+ if (eval "(defined \&do_cmd_${type}name) ||\$new_command{\"${type}name\"}")
+ {
+ local($br_id)=++$global{'max_id'};
+ $TITLE = &translate_environments("$O$br_id$C\\${type}name$O$br_id$C");
+ }
+ else
+ { $TITLE = $gls_title{$type} }
+ $toc_sec_title = $TITLE;
+ $glsfile{$type} = $CURRENT_FILE;
+ if (%glossary_labels) { &make_glossary_labels(); }
+ if (($SHORT_INDEX) && (%glossary_segment))
+ { &make_preglossary(); }
+ else
+ { $preglossary = &translate_commands("\\glossarypreamble"); }
+ local $idx_head = $section_headings{'textohtmlindex'};
+ local($heading) = join(''
+ , &make_section_heading($TITLE, $idx_head)
+ , $gls_mark{$type} );
+ local($pre,$post) = &minimize_open_tags($heading);
+ join('',"<BR>\n" , $pre, $_[0]);
+}
+
+sub make_glossary_labels {
+ local($key, @keys);
+ @keys = keys %glossary_labels;
+ foreach $key (@keys) {
+ if (($ref_files{$key}) && !($ref_files{$key} eq "$glsfile{'glossary'}")) {
+ local($tmp) = $ref_files{$key};
+ &write_warnings("\nmultiple label $key , target in $glsfile{'glossary'} masks $tmp ");
+ }
+ $ref_files{$key} .= $glsfile{'glossary'};
+ }
+}
+
+sub make_preglossary{ &make_real_preglossary }
+sub make_real_preglossary{
+ local($key, @keys, $head, $body);
+ $head = "<HR>\n<H4>Legend:</H4>\n<DL COMPACT>";
+ @keys = keys %glossary_segment;
+ foreach $key (@keys) {
+ local($tmp) = "segment$key";
+ $tmp = $ref_files{$tmp};
+ $body .= "\n<DT>$key<DD>".&make_named_href('',$tmp,$glossary_segment{$key});
+ }
+ $preglossary = join('', $head, $body, "\n</DL>") if ($body);
+}
+
+sub do_cmd_glossary { &do_real_glossary(@_) }
+sub do_real_glossary {
+ local($_) = @_;
+ local($br_id, $str);
+ local($type) = "glossary";
+ local($anchor);
+
+ if (s/^\S*$OP(\d+)${CP}type=(.+)$OP\1$CP//)
+ {
+ $type = $2;
+ }
+
+ local($idx_option,$pat) = &get_next_optional_argument;
+
+ $str = &missing_braces unless (
+(s/$next_pair_pr_rx/($br_id, $str) = ($1, $2);''/eo)
+||(s/$next_pair_rx/($br_id, $str) = ($1, $2);''/eo));
+
+ # the maths gets processed before being passed
+ # to do_cmd_glossary. How can I do this
+ # substitution before it gets converted to an image?
+ $str=~s/\"\"/\"/gs;
+ $str=~s/\"\|/\|/gs;
+ $str=~s/\"@/@/gs;
+ $str=~s/\"!/!/gs;
+
+ $str=~s/;SPMquot;;SPMquot;/;SPMquot;/gs;
+ $str=~s/;SPMquot;\|/\|/gs;
+ $str=~s/;SPMquot;\@/\@/gs;
+ $str=~s/;SPMquot;!/!/gs;
+
+ $anchor = &make_glossary_entry($br_id,$str,$anchor_invisible_mark,$type);
+
+ join('', $anchor, $_);
+}
+
+sub make_glossary_entry { &make_real_glossary_entry(@_) }
+sub make_real_glossary_entry {
+ local($br_id,$str,$text,$type) = @_;
+ local($this_file) = $CURRENT_FILE;
+ $TITLE = $saved_title if (($saved_title)&&(!($TITLE)||($TITLE eq $default_title)));
+ #extract name, sort, description and format data from $str
+ local($name,$sort,$description,$format);
+
+ unless (($str=~/name\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($name=$2)) ||
+ ($str=~/name\s*=\s*([^,]+)\s*,?/s && ($name=$1)))
+ {
+ &write_warnings("can't determine name key from $str");
+ }
+
+ unless (($str=~/sort\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($sort=$2)) ||
+ ($str=~/sort\s*=\s*([^,]+)\s*,?/s && ($sort=$1)))
+ {
+ $sort = $name;
+ }
+
+ unless (($str=~/description\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($description=$2)) ||
+ ($str=~/description\s*=\s*([^,]+)\s*,?/s && ($description=$1)))
+ {
+ &write_warnings("can't determine description key from $str");
+ }
+
+ unless (($str=~/format\s*=\s*${OP}(\d+)${CP}(.+)${OP}\1${CP}\s*,?/s && ($format=$2)) ||
+ ($str=~/format\s*=\s*([^,]+)\s*,?/s && ($format=$1)))
+ {
+ $format = "glsnumformat[$type]";
+ }
+
+ # Save the reference
+ $str = "$sort$description###" . ++$global{'max_id'}; # Make unique
+ # concatenate multiple spaces into a single space
+ # otherwise keys won't sort properly
+ $str=~s/\s+/ /gs;
+ $glossary{$type}{$str} .= &make_half_href($this_file."#$br_id");
+ $glossary_name{$type}{$str} = $name;
+ $glossary_format{$type}{$str} = $format;
+ $glossary_desc{$type}{$str} = $description;
+ $glossary_linktext{$type}{$str} = $TITLE;
+ "<A HREF=$gls_file_mark{$type}#tex2html$href_name NAME=\"$br_id\">$text<\/A>";
+}
+
+sub do_cmd_xglossary{
+ local($_) = @_;
+ local($entry,$text);
+ local($type) = "glossary";
+
+ if (s/^$OP(\d+)${CP}type=(.+)$OP\1$CP//)
+ {
+ $type = $2;
+ }
+
+ $entry = &missing_braces unless
+ s/$next_pair_pr_rx/$entry=$2;''/eo;
+
+ $text = &missing_braces unless
+ s/$next_pair_pr_rx/$text=$2;''/eo;
+
+ $entry=~s/\"\"/\"/gs;
+ $entry=~s/\"\|/\|/gs;
+ $entry=~s/\"\@/\@/gs;
+ $entry=~s/\"!/!/gs;
+
+ $entry=~s/;SPMquot;;SPMquot;/;SPMquot;/gs;
+ $entry=~s/;SPMquot;\|/\|/gs;
+ $entry=~s/;SPMquot;\@/\@/gs;
+ $entry=~s/;SPMquot;!/!/gs;
+
+ $br_id = ++$global{'max_id'};
+ join('', &make_glossary_entry($br_id,$entry,$text,$type),
+ $_);
+}
+
+sub do_cmd_newglossarytype{
+ local($type,$out,$in);
+ $type = &missing_braces unless
+ ($_[0]=~s/$next_pair_pr_rx//o&&($type=$2));
+ $out = &missing_braces unless
+ ($_[0]=~s/$next_pair_pr_rx//o&&($out=$2));
+ $in = &missing_braces unless
+ ($_[0]=~s/$next_pair_pr_rx//o&&($in=$2));
+
+ &make_newglossarytype($type);
+
+ $_[0];
+}
+
+sub make_newglossarytype{
+ local($type) = @_;
+
+ eval ("sub do_cmd_make$type\{\}");
+
+ $gls_mark{$type} = "<tex2html_${type}_mark>";
+ $gls_file_mark{$type} = "<tex2html_${type}_file_mark>";
+ $gls_title{$type} = "\\glossaryname";
+
+ local($tmp) = 'sub do_cmd_' . $type. '{';
+ $tmp .= 'local($id) = ++$global{\'max_id\'};';
+ $tmp .= '"\\\\glossary$OP$id${CP}type=' . $type . '$OP$id$CP".$_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_x' . $type. '{';
+ $tmp .= 'local($id) = ++$global{\'max_id\'};';
+ $tmp .= '"\\\\xglossary$OP$id${CP}type=' . $type . '$OP$id$CP".$_[0];';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_print' . $type. '{';
+ #$tmp .= 'local($id)=++$global{\'max_id\'};';
+ $tmp .= '"\\\\textohtmlglossary[' . $type
+ . ']" . $_[0]';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $delimN{$type} = ", ";
+ $glodelim{$type} = "";
+ $glsnumformat{$type} = "";
+
+}
+
+sub do_cmd_gloshort{
+ local($_) = @_;
+ join('', "<tex2html_GLOSHORT_mark>", $_);
+}
+
+sub do_cmd_glolong{
+ local($_) = @_;
+ join('', "<tex2html_GLOLONG_mark>", $_);
+}
+
+$acronymnamefmt = "<tex2html_GLOLONG_mark> (<tex2html_GLOSHORT_mark>)";
+
+sub do_cmd_setacronymnamefmt{
+ local($_) = @_;
+
+ $acronymnamefmt = &missing_braces unless
+ s/$next_pair_pr_rx/$acronymnamefmt=$2;''/eo;
+
+ $_;
+}
+
+sub do_cmd_acronymfont{
+ local($_) = @_;
+ local($text) = &missing_braces unless
+ s/$next_pair_pr_rx/$text=$2;''/eo;
+
+ $text . $_;
+}
+
+ %acronym = ();
+
+sub do_cmd_newacronym{
+ local($_) = @_;
+ local($cmdname,$pat,$abbrv,$long,$glsentry,$name);
+
+ ($cmdname,$pat) = &get_next_optional_argument;
+
+ $abbrv = &missing_braces unless
+ (s/$next_pair_pr_rx/$abbrv=$2;''/eo);
+ $long = &missing_braces unless
+ (s/$next_pair_pr_rx/$long=$2;''/eo);
+ $glsentry = &missing_braces unless
+ (s/$next_pair_pr_rx/$glsentry=$2;''/eo);
+
+ if ($cmdname eq '')
+ {
+ $cmdname = $abbrv;
+ }
+
+ local($id);
+ $id = ++$global{'max_id'};
+ local($fmtedabbrv) = &translate_commands("\\acronymfont$OP$id$CP$abbrv$OP$id$CP");
+
+ unless ($glsentry=~/name=/)
+ {
+ $name = $acronymnamefmt;
+ $name=~s/<tex2html_GLOSHORT_mark>/$fmtedabbrv/egs;
+ $name=~s/<tex2html_GLOLONG_mark>/$long/egs;
+ $id = ++$global{'max_id'};
+ $glsentry .= ",name=$OP$id$CP$name$OP$id$CP";
+ }
+
+ $global{"${cmdname}first"} = 1;
+ $acronym{$cmdname}{'abbrv'} = $abbrv;
+ $acronym{$cmdname}{'long'} = $long;
+ $acronym{$cmdname}{'entry'} = $glsentry;
+
+ local($tmp);
+
+ unless ($cmdname=~/[^a-zA-Z]/)
+ {
+ $tmp = 'sub do_cmd_' . $cmdname . '{';
+ $tmp .= 'local($_)=@_;';
+ $tmp .= 'local($id)=++$global{\'max_id\'};';
+ $tmp .= 'local($str);';
+ $tmp .= '$str="${OP}$id${CP}'
+ . $cmdname
+ . '${OP}$id${CP}";';
+ $tmp .= '&do_cmd_useacronym($str . $_[0])';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_' . $cmdname . 'star{';
+ $tmp .= 'local($_)=@_;';
+ $tmp .= 'local($id)=++$global{\'max_id\'};';
+ $tmp .= 'local($str);';
+ $tmp .= '$str="${OP}$id${CP}'
+ . $cmdname
+ . '${OP}$id${CP}";';
+ $tmp .= '&do_cmd_useacronymstar($str . $_[0])';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_' . $cmdname . 'long{';
+ $tmp .= 'local($_)=@_;';
+ $tmp .= 'join("", \'' . $long . '\', $_[0])';
+ $tmp .= '}';
+
+ eval($tmp);
+
+ $tmp = 'sub do_cmd_' . $cmdname . 'short{';
+ $tmp .= 'local($_)=@_;';
+ $tmp .= 'join("", \'' . $fmtedabbrv . '\', $_[0])';
+ $tmp .= '}';
+
+ eval($tmp);
+ }
+
+ $_;
+}
+
+sub do_cmd_acrsh{
+ local($_) = @_;
+ local($cmdname,$text,$id);
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
+
+ $text = &translate_commands("\\${cmdname}short");
+
+ $text . $_;
+}
+
+sub do_cmd_acrshstar{
+ local($_) = @_;
+ local($cmdname,$text,$id);
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
+
+ $text = &translate_commands("\\${cmdname}short");
+
+ $text=~s/(<.*>)?(\w)/\1\u\2/;
+
+ $text . $_;
+}
+
+sub do_cmd_acrln{
+ local($_) = @_;
+ local($cmdname,$text,$id);
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
+
+ $text = &translate_commands("\\${cmdname}long");
+
+ $text . $_;
+}
+
+sub do_cmd_acrlnstar{
+ local($_) = @_;
+ local($cmdname,$text,$id);
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$id=$1;$cmdname=$2;''/eo);
+
+ $text = &translate_commands("\\${cmdname}long");
+
+ $text=~s/(\w)/\u\1/;
+
+ $text . $_;
+}
+
+sub do_cmd_useacronym{
+ local($_)=@_;
+ local($str,$abbrv,$long,$entry,$id);
+
+ local($optarg,$pat)=&get_next_optional_argument;
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$cmdname=$2;''/eo);
+
+ if (defined %{$acronym{$cmdname}})
+ {
+ $abbrv = $acronym{$cmdname}{'abbrv'};
+ $long = $acronym{$cmdname}{'long'};
+ $entry = $acronym{$cmdname}{'entry'};
+ $id = ++$global{'max_id'};
+ $abbrv = "\\acronymfont$OP$id$CP$abbrv$OP$id$CP";
+
+ $id = ++$global{'max_id'};
+ $str = "\\xglossary${OP}$id${CP}type="
+ . $acronymtype. "${OP}$id${CP}";
+ $id = ++$global{'max_id'};
+ $str .= "${OP}$id${CP}"
+ . $entry . "${OP}$id${CP}";
+ $id = ++$global{'max_id'};
+ $str .= "${OP}$id${CP}";
+ $str .= ($global{"${cmdname}first"} ? "$long$optarg ($abbrv)" : "$abbrv$optarg");
+ $str .= "${OP}$id${CP}";
+
+ $global{"${cmdname}first"} = 0;
+ }
+ else
+ {
+ &write_warnings("acronym '$cmdname' not defined");
+ }
+
+ $str . $_
+}
+
+sub do_cmd_useacronymstar{
+ local($_)=@_;
+ local($str,$abbrv,$long,$entry,$id);
+ local($optarg,$pat)=&get_next_optional_argument;
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$cmdname=$2;''/eo);
+
+ if (defined %{$acronym{$cmdname}})
+ {
+ $abbrv = $acronym{$cmdname}{'abbrv'};
+ $long = $acronym{$cmdname}{'long'};
+ $entry = $acronym{$cmdname}{'entry'};
+
+ if ($global{"${cmdname}first"})
+ {
+ $long=~s/^([^a-zA-Z]*)([a-zA-Z])/\1\u\2/;
+ }
+ else
+ {
+ $abbrv=~s/^([^a-zA-Z]*)([a-zA-Z])/\1\u\2/;
+ }
+
+ $id = ++$global{'max_id'};
+ $abbrv = "\\acronymfont$OP$id$CP$abbrv$OP$id$CP";
+
+ $name = ($global{"${cmdname}first"} ? "$long$optarg ($abbrv)" : "$abbrv$optarg");
+
+ $id = ++$global{'max_id'};
+ $str = "\\xglossary${OP}$id${CP}type="
+ . $acronymtype . "${OP}$id${CP}";
+ $id = ++$global{'max_id'};
+ $str .= "${OP}$id${CP}"
+ . $entry . "${OP}$id${CP}";
+ $id = ++$global{'max_id'};
+ $str .= "${OP}$id${CP}";
+ $str .= $name;
+ $str .= "${OP}$id${CP}";
+
+ $global{"${cmdname}first"} = 0;
+ }
+ else
+ {
+ &write_warnings("acronym '$cmdname' not defined");
+ }
+
+ $str . $_
+}
+
+sub do_cmd_ifacronymfirstuse{
+ local($_) = @_;
+ local($acronym,$truebit,$falsebit,$str);
+
+ $acronym = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($acronym=$2));
+ $truebit = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($truebit=$2));
+ $falsebit = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($falsebit=$2));
+
+ $str = ($global{"${acronym}true"} ? $truebit : $falsebit);
+
+ $str . $_[0];
+}
+
+sub do_cmd_resetacronym{
+ local($_) = @_;
+ local($cmdname);
+
+ $cmdname = &missing_braces unless
+ (s/$next_pair_pr_rx/$cmdname=$2;''/eo);
+
+ if (defined %{$acronym{$cmdname}})
+ {
+ $global{"${cmdname}first"} = 1;
+ }
+ else
+ {
+ &write_warnings("acronym '$cmdname' not defined");
+ }
+
+ $_;
+}
+
+sub do_cmd_resetallacronyms{
+ local($_) = @_;
+
+ foreach $key (keys %acronym)
+ {
+ $global{"${key}first"} = 1;
+ }
+
+ $_;
+}
+
+ %savedglosentry = ();
+
+# This command is deprecated
+sub do_cmd_saveglosentry{
+ local($_) = @_;
+ local($name,$desc,$type,$pat);
+
+ ($type,$pat) = &get_next_optional_argument;
+
+ $name = &missing_braces unless
+ s/$next_pair_pr_rx/$name=$2;''/eo;
+ $desc = &missing_braces unless
+ s/$next_pair_pr_rx/$desc=$2;''/eo;
+
+ $savedglosentry{$name}{'entry'} = "name=$name,description=$desc";
+ $savedglosentry{$name}{'type'} = $type;
+
+ $_;
+}
+
+sub do_cmd_storeglosentry{
+ local($_) = @_;
+ local($type,$pat,$entry,$label);
+
+ ($type,$pat) = &get_next_optional_argument;
+
+ if ($type eq '')
+ {
+ $type = 'glossary';
+ }
+
+ $label = &missing_braces unless
+ s/$next_pair_pr_rx/$label=$2;''/eo;
+
+ $entry = &missing_braces unless
+ s/$next_pair_pr_rx/$entry=$2;''/eo;
+
+ $savedglosentry{$label}{'entry'} = $entry;
+ $savedglosentry{$label}{'type'} = $type;
+
+ $_;
+}
+
+sub do_cmd_useglosentry{
+ local($_) = @_;
+ local($optarg,$pat,$name,$str,$id);
+ ($optarg,$pat) = &get_next_optional_argument;
+
+ $name = &missing_braces unless
+ (s/$next_pair_pr_rx/$name=$2;''/eo);
+
+ if (defined $savedglosentry{$name}{type})
+ {
+ $id = ++$global{'max_id'};
+ $str = "\\$savedglosentry{$name}{type}${OP}$id${CP}$savedglosentry{$name}{entry}";
+
+ unless ($optarg eq "")
+ {
+ $str .= ",$optarg";
+ }
+
+ $str .= "${OP}$id${CP}";
+ }
+ else
+ {
+ &write_warnings("glossary entry '$name' undefined");
+ $str = '';
+ }
+
+ $str . $_;
+}
+
+sub do_cmd_useGlosentry{
+ local($_) = @_;
+ local($optarg,$pat,$name,$str,$id);
+ ($optarg,$pat) = &get_next_optional_argument;
+
+ $name = &missing_braces unless
+ (s/$next_pair_pr_rx/$name=$2;''/eo);
+
+ if (defined $savedglosentry{$name}{type})
+ {
+ $id = ++$global{'max_id'};
+ $str = "\\x$savedglosentry{$name}{type}${OP}$id${CP}$savedglosentry{$name}{entry}";
+
+ unless ($optarg eq "")
+ {
+ $str .= ",$optarg";
+ }
+
+ $str .= "${OP}$id${CP}";
+ }
+ else
+ {
+ &write_warnings("glossary entry '$name' undefined");
+ $str = '';
+ }
+
+ $str . $_;
+}
+
+sub do_cmd_gls{
+ local($_) = @_;
+ local($optarg,$pat,$label,$str,$id,$name);
+ ($optarg,$pat) = &get_next_optional_argument;
+
+ $label = &missing_braces unless
+ (s/$next_pair_pr_rx/$label=$2;''/eo);
+
+ if (defined $savedglosentry{$label}{type})
+ {
+ $str = $savedglosentry{$label}{'entry'};
+
+ if ($str=~/name=[ ]*${OP}(\d+)${CP}(.*)${OP}\1${CP}/s)
+ {
+ $name = $2;
+ }
+ elsif (($str=~/name=[ ]*([^,]+),/m)
+ || ($str=~/name=[ ]*([^,]+)\Z(?!\n)/m))
+ {
+ $name = $1;
+ }
+
+ $id = ++$global{'max_id'};
+ $str = "\\x$savedglosentry{$label}{type}${OP}$id${CP}$savedglosentry{$label}{entry}";
+
+ unless ($optarg eq "")
+ {
+ $str .= ",$optarg";
+ }
+
+ $str .= "${OP}$id${CP}";
+ $id = ++$global{'max_id'};
+ $str .= "${OP}$id${CP}$name${OP}$id${CP}";
+ }
+ else
+ {
+ &write_warnings("glossary entry '$label' undefined");
+ $str = '';
+ }
+
+ $str . $_;
+}
+
+sub do_cmd_glossarypreamble{
+ local($_) = @_;
+ $_[0];
+}
+
+sub do_cmd_glossarypostamble{
+ local($_) = @_;
+ $_[0];
+}
+
+sub do_cmd_glsnumformat{
+ local($_) = @_;
+ local($type,$pat) = &get_next_optional_argument;
+
+ if ($type eq '')
+ {
+ $type = 'glossary';
+ }
+
+ local($cmd) = '';
+ unless ($glsnumformat{$type} eq '')
+ {
+ $cmd = "\\$glsnumformat{$type}";
+ }
+
+ $cmd . $_;
+}
+
+sub do_cmd_setglossary{
+ local($_) = @_;
+ local($str,$type,$format,$delimN,$glodelim);
+ $str = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($str=$2));
+
+ unless (($str=~/type=([^,]+),|$/&&($type=$1)) ||
+ ($str=~/type=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($type=$2)))
+ {
+ $type = 'glossary';
+ }
+
+ if ($str=~/glsnumformat=[ ]*${OP}(\d+)${CP}(.*)${OP}\1${CP}/s)
+ {
+ $format = $2;
+ }
+ elsif (($str=~/glsnumformat=[ ]*([^,]+),/m)
+ || ($str=~/glsnumformat=[ ]*([^,]+)\Z(?!\n)/m))
+ {
+ $format = $1;
+ }
+
+ if ($format ne '')
+ {
+ $glsnumformat{$type} = $format;
+
+ if ($format eq 'ignore')
+ {
+ $delimN{$type} = '';
+ }
+ }
+
+ if (($str=~/delimN=([^,]+),|$/&&($delimN=$1)) ||
+ ($str=~/delimN=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($delimN=$2)))
+ {
+ $delimN{$type} = $delimN;
+ }
+
+ if (($str=~/glodelim=([^,]+),|$/&&($glodelim=$1)) ||
+ ($str=~/glodelim=${OP}(\d+)${CP}(.*)${OP}\1${CP}/&&($glodelim=$2)))
+ {
+ $glodelim{$type} = $glodelim;
+ }
+
+ $_[0];
+}
+
+sub do_cmd_ignore{
+ local($_) = @_;
+ local($str);
+ $str = &missing_braces unless ($_[0]=~s/$next_pair_pr_rx//o&&($str=$2));
+
+ $_[0];
+}
+
+sub do_cmd_hyperit{
+ join('', "\\textit ", $_[0]);
+}
+
+sub do_cmd_hyperrm{
+ join('', "\\textrm ", $_[0]);
+}
+
+sub do_cmd_hypertt{
+ join('', "\\texttt ", $_[0]);
+}
+
+sub do_cmd_hypersf{
+ join('', "\\textsf ", $_[0]);
+}
+
+sub do_cmd_hyperbf{
+ join('', "\\textbf ", $_[0]);
+}
+
+&ignore_commands( <<_IGNORED_CMDS_ );
+makeglossary
+makeacronym
+_IGNORED_CMDS_
+
+1;
+% \end{macrocode}
+% \begin{macrocode}
+%</glossary.perl>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sample.tex>
+% \end{macrocode}
+\documentclass[a4paper]{report}
+
+\usepackage[plainpages=false,colorlinks]{hyperref}
+\usepackage{glossary}
+
+\makeglossary
+
+\begin{document}
+
+\title{Sample Document Using glossary Package}
+\author{Nicola Talbot}
+\pagenumbering{alph}% prevent duplicate page link names if using PDF
+\maketitle
+
+\pagenumbering{roman}
+\tableofcontents
+
+\chapter{Introduction}
+\pagenumbering{arabic}
+
+A \xglossary{name=glossary,description=1) list of technical
+words}{glossary} is a very useful addition to any
+technical document, although a \xglossary{name=glossary,
+description=2) collection of glosses}{glossary} can
+also simply be a collection of glosses, which is
+another thing entirely.
+
+Once you have run your document through \LaTeX, you
+will then need to run the \texttt{.glo} file through
+\texttt{makeindex}. You will need to set the output
+file so that it creates a \texttt{.gls} file instead
+of an \texttt{.ind} file, and change the name of
+the log file so that it doesn't overwrite the index
+log file (if you have an index for your document).
+Rather than having to remember all the command line
+switches, you can call the \xglossary{name=\texttt{Perl},
+sort=Perl,description=A scripting language}{Perl} script
+\texttt{makeglos.pl} which provides a convenient
+wrapper.
+
+If you have two terms with different meanings in your
+\xglossary{name=glossary,description=1) list of technical
+words}{glossary},
+\texttt{makeindex} will of course treat them as two
+separate entries, however, some people prefer to
+merge them. This can be done using
+\texttt{makeglos.pl}, and passing the option
+\texttt{-m}.
+
+\printglossary
+
+\end{document}
+% \begin{macrocode}
+%</sample.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleAcr.tex>
+% \end{macrocode}
+\documentclass[a4paper]{report}
+
+\usepackage{xspace}
+\usepackage[colorlinks,plainpages=false]{hyperref}
+\usepackage[style=altlist,toc,number=none]{glossary}
+
+\makeglossary
+
+\renewcommand{\acronymfont}[1]{\textmd{\scshape #1}}
+
+\setacronymnamefmt{\gloshort: \expandafter\MakeUppercase\glolong}
+
+\newacronym{svm}{support vector machine}{description=Statistical pattern recognition technique~\cite{svm}}
+
+\newacronym[ksvm]{k-svm}{kernel support vector machine}{description=Statistical pattern recognition technique using
+the ``kernel trick'' (see also SVM)}
+
+\begin{document}
+\tableofcontents
+\printglossary
+
+
+\chapter{Support Vector Machines}
+
+The \svm is used widely in the area of pattern recognition.
+\useacronym*[s]{svm} are \ldots
+
+This is the long version: \svmlong or alternatively:
+\acrln*{svm}.
+Abbreviation: \svmshort or \acrsh*{svm}.
+
+\chapter{Kernel Support Vector Machines}
+
+The \ksvm\ is \ifacronymfirstuse{svm}{a}{an} \svm\ that uses the so called ``kernel trick''.
+
+%\resetacronym{ksvm}
+\resetallacronyms
+\useacronym*[s]{ksvm} \ldots
+\svm.
+
+\begin{thebibliography}{1}
+\bibitem{svm} \ldots
+\end{thebibliography}
+
+\end{document}
+% \begin{macrocode}
+%</sampleAcr.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleEq.tex>
+% \end{macrocode}
+\documentclass[a4paper,12pt]{report}
+
+\usepackage{amsmath}
+\usepackage[header,border=none,cols=3]{glossary}
+
+
+\newcommand{\erf}{\operatorname{erf}}
+\newcommand{\erfc}{\operatorname{erfc}}
+
+\renewcommand{\theglossarynum}{\theequation}
+\renewcommand{\pagecompositor}{.}
+
+\renewcommand{\glossaryname}{Index of Special Functions and Notations}
+
+\renewcommand{\glossaryheader}{\bfseries Notation &
+\multicolumn{2}{c}{\bfseries
+\begin{tabular}{c}Name of the Function and\\the number of
+the formula\end{tabular}}\\}
+
+\makeglossary
+
+\begin{document}
+\title{A Sample Document Using glossary.sty}
+\author{Nicola Talbot}
+\maketitle
+
+\begin{abstract}
+This is a sample document illustrating the use of the \textsf{glossary}
+package. The functions here have been taken from ``Tables of
+Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.
+The glossary is a list of special functions, so
+the equation number has been used rather than the page number. This can be
+done by defining \verb|\theglossarynum| to be \verb|\theequation|.
+The equation numbers are a composite number made up of the chapter number
+and number of equation within the chapter. The two parts of the page
+number are separated by a fullstop. The default compositor is
+a dash \verb|-|, so it needs to be set to a dot by redefining the command
+\verb|\pagecompositor|. (This needs to be done \emph{before} the command
+\verb|\makeglossary|.)
+\end{abstract}
+
+\printglossary
+
+\chapter{Gamma Functions}
+
+\begin{equation}
+\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\Gamma(x+1) = x\Gamma(x)
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\gamma(\alpha, x) = \int_0^x e^{-t}t^{\alpha-1}\,dt
+\end{equation}
+\glossary{name={$\gamma(\alpha,x)$},description=Incomplete gamma function,sort=gamma}
+
+\begin{equation}
+\Gamma(\alpha, x) = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
+\end{equation}
+\glossary{name={$\Gamma(\alpha,x)$},description=Incomplete gamma function,sort=Gamma}
+
+\newpage
+
+\begin{equation}
+\Gamma(\alpha) = \Gamma(\alpha, x) + \gamma(\alpha, x)
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\psi(x) = \frac{d}{dx}\ln\Gamma(x)
+\end{equation}
+\glossary{name=$\psi(x)$,description=Psi function,sort=psi}
+
+\chapter{Error Functions}
+
+\begin{equation}
+\erf(x) = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
+\end{equation}
+\glossary{name=$\erf(x)$,description=Error function,sort=erf}
+
+\begin{equation}
+\erfc(x) = 1 - \erf(x)
+\end{equation}
+\glossary{name=$\erfc(x)$,description=Complementary error function,sort=erfc}
+
+\chapter{Beta Function}
+
+\begin{equation}
+B(x,y) = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+Alternatively:
+\begin{equation}
+B(x,y) = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+
+\begin{equation}
+B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+
+\begin{equation}
+B_x(p,q) = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
+\end{equation}
+\glossary{name={$B_x(p,q)$},description=Incomplete beta function,sort=Bx}
+
+\chapter{Polynomials}
+
+\section{Chebyshev's polynomials}
+
+\begin{equation}
+T_n(x) = \cos(n\arccos x)
+\end{equation}
+\glossary{name=$T_n(x)$,description=Chebyshev's polynomials of the first kind,sort=Tn}
+
+\begin{equation}
+U_n(x) = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
+\end{equation}
+\glossary{name=$U_n(x)$,description=Chebyshev's polynomials of the second kind,sort=Un}
+
+\section{Hermite polynomials}
+
+\begin{equation}
+H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
+\end{equation}
+\glossary{name=$H_n(x)$,description=Hermite polynomials,sort=Hn}
+
+\section{Laguerre polynomials}
+
+\begin{equation}
+L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} \frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
+\end{equation}
+\glossary{name=$L_n^\alpha(x)$,description=Laguerre polynomials,sort=Lna}
+
+\chapter{Bessel Functions}
+
+Bessel functions $Z_\nu(z)$ are solutions of
+\begin{equation}
+\frac{d^2Z_\nu}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} +
+\left(
+1-\frac{\nu^2}{z^2}Z_\nu = 0
+\right)
+\end{equation}
+\glossary{name=$Z_\nu(z)$,description=Bessel functions,sort=Z}
+
+\chapter{Confluent hypergeometric function}
+
+\begin{equation}
+\Phi(\alpha,\gamma;z) = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
++ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
++\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\,\frac{z^3}{3!}
++ \cdots
+\end{equation}
+\glossary{name={$\Phi(\alpha,\gamma;z)$},description=confluent hypergeometric function,sort=Pagz}
+
+\begin{equation}
+k_\nu(x) = \frac{2}{\pi}\int_0^{\pi/2}\cos(x \tan\theta - \nu\theta)\,d\theta
+\end{equation}
+\glossary{name=$k_\nu(x)$,description=Bateman's function,sort=kv}
+
+\chapter{Parabolic cylinder functions}
+
+\begin{equation}
+D_p(z) = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
+\left\{
+\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
+\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
+-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
+\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
+\right\}
+\end{equation}
+\glossary{name=$D_p(z)$,description=Parabolic cylinder functions,sort=Dp}
+
+\chapter{Elliptical Integral of the First Kind}
+
+\begin{equation}
+F(\phi, k) = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
+\end{equation}
+\glossary{name={$F(\phi,k)$},description=Elliptical integral of the first kind,sort=Fpk}
+
+\chapter{Constants}
+
+\begin{equation}
+C = 0.577\,215\,664\,901\ldots
+\end{equation}
+\glossary{name=$C$,description=Euler's constant,sort=C}
+
+\begin{equation}
+G = 0.915\,965\,594\ldots
+\end{equation}
+\glossary{name=$G$,description=Catalan's constant,sort=G}
+
+\end{document}
+% \begin{macrocode}
+%</sampleEq.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleEqPg.tex>
+% \end{macrocode}
+\documentclass[a4paper,12pt]{report}
+
+\usepackage{amsmath}
+\usepackage[header,toc,border=none,cols=3]{glossary}
+
+
+\newcommand{\erf}{\operatorname{erf}}
+\newcommand{\erfc}{\operatorname{erfc}}
+
+\renewcommand{\theglossarynum}{\theequation}
+\renewcommand{\pagecompositor}{.}
+
+\renewcommand{\glossaryname}{Index of Special Functions and Notations}
+
+\renewcommand{\glossarypreamble}{Numbers in italic indicate the equation number,
+numbers in bold indicate page numbers where the main definition occurs.\par}
+
+\setglossary{glsnumformat=textit}
+
+\renewcommand{\glossaryheader}{\bfseries Notation &
+\multicolumn{2}{c}{\bfseries
+\begin{tabular}{c}Name of the Function and\\the number of
+the formula\end{tabular}}\\}
+
+\renewcommand{\shortglossaryname}{Special Functions}
+
+\makeglossary
+
+\pagestyle{headings}
+
+\begin{document}
+
+\title{Sample Document Using Interchangable Numbering}
+\author{Nicola Talbot}
+\maketitle
+
+\begin{abstract}
+This is a sample document illustrating the use of the \textsf{glossary}
+package. The functions here have been taken from ``Tables of
+Integrals, Series, and Products'' by I.S.~Gradshteyn and I.M~Ryzhik.
+
+The glossary lists both page number and equation numbers. Since the
+equation numbers depend on chapter numbers, the page compositor needs
+to be redefined. (Note that this example will only work where the
+page number and equation number compositor is the same. So it won't work
+if, say, the page numbers are of the form 2-4 and the equation numbers
+are of the form 4.6) As most of the glossary entries should have an italic
+format, it is easiest to set the default format to italic.
+
+\end{abstract}
+
+\tableofcontents
+
+\printglossary
+
+%It's a bit cumbersome having to keep redefining \theglossarynum. It
+%would probably be easier to define a new command which sets \theglossarynum
+%and then calls \glossary
+%For example:
+\newcommand{\myglossary}[2]{%
+\renewcommand{\theglossarynum}{#1}\glossary{#2}}
+%You can then do something like, say
+%\myglossary{\thepage}{name=$\Gamma(z)$,description=Gamma function,sort=Gamma,format=textbf}
+
+%or, alternatively, you could define
+\newcommand{\glossarypage}[1]{%
+\renewcommand{\theglossarynum}{\thepage}\glossary{#1,format=textbf}}
+%and
+\newcommand{\glossaryequation}[1]{%
+\renewcommand{\theglossarynum}{\theequation}\glossary{#1}}
+
+\chapter{Gamma Functions}
+
+The gamma function is defined as
+\renewcommand{\theglossarynum}{\thepage}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma,format=textbf}
+\renewcommand{\theglossarynum}{\theequation}
+\begin{equation}
+\Gamma(z) = \int_{0}^{\infty}e^{-t}t^{z-1}\,dt
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\Gamma(x+1) = x\Gamma(x)
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\gamma(\alpha, x) = \int_0^x e^{-t}t^{\alpha-1}\,dt
+\end{equation}
+\glossary{name={$\gamma(\alpha,x)$},description=Incomplete gamma function,sort=gamma}
+
+\begin{equation}
+\Gamma(\alpha, x) = \int_x^\infty e^{-t}t^{\alpha-1}\,dt
+\end{equation}
+\glossary{name={$\Gamma(\alpha,x)$},description=Incomplete gamma function,sort=Gamma}
+
+\newpage
+
+\begin{equation}
+\Gamma(\alpha) = \Gamma(\alpha, x) + \gamma(\alpha, x)
+\end{equation}
+\glossary{name=$\Gamma(z)$,description=Gamma function,sort=Gamma}
+
+\begin{equation}
+\psi(x) = \frac{d}{dx}\ln\Gamma(x)
+\end{equation}
+\glossary{name=$\psi(x)$,description=Psi function,sort=psi}
+
+\chapter{Error Functions}
+
+The error function is defined as:
+\renewcommand{\theglossarynum}{\thepage}
+\glossary{name=$\erf(x)$,description=Error function,sort=erf,format=textbf}
+\renewcommand{\theglossarynum}{\theequation}
+\begin{equation}
+\erf(x) = \frac{2}{\surd\pi}\int_0^x e^{-t^2}\,dt
+\end{equation}
+\glossary{name=$\erf(x)$,description=Error function,sort=erf}
+
+\begin{equation}
+\erfc(x) = 1 - \erf(x)
+\end{equation}
+\glossary{name=$\erfc(x)$,description=Complementary error function,sort=erfc}
+
+\chapter{Beta Function}
+
+\begin{equation}
+B(x,y) = 2\int_0^1 t^{x-1}(1-t^2)^{y-1}\,dt
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+Alternatively:
+\begin{equation}
+B(x,y) = 2\int_0^{\frac\pi2}\sin^{2x-1}\phi\cos^{2y-1}\phi\,d\phi
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+
+\begin{equation}
+B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} = B(y,x)
+\end{equation}
+\glossary{name={$B(x,y)$},description=Beta function,sort=B}
+
+\begin{equation}
+B_x(p,q) = \int_0^x t^{p-1}(1-t)^{q-1}\,dt
+\end{equation}
+\glossary{name={$B_x(p,q)$},description=Incomplete beta function,sort=Bx}
+
+\chapter{Chebyshev's polynomials}
+
+\begin{equation}
+T_n(x) = \cos(n\arccos x)
+\end{equation}
+\glossary{name=$T_n(x)$,description=Chebyshev's polynomials of the first kind,sort=Tn}
+
+\begin{equation}
+U_n(x) = \frac{\sin[(n+1)\arccos x]}{\sin[\arccos x]}
+\end{equation}
+\glossary{name=$U_n(x)$,description=Chebyshev's polynomials of the second kind,sort=Un}
+
+\chapter{Hermite polynomials}
+
+\begin{equation}
+H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n}(e^{-x^2})
+\end{equation}
+\glossary{name=$H_n(x)$,description=Hermite polynomials,sort=Hn}
+
+\chapter{Laguerre polynomials}
+
+\begin{equation}
+L_n^{\alpha} (x) = \frac{1}{n!}e^x x^{-\alpha} \frac{d^n}{dx^n}(e^{-x}x^{n+\alpha})
+\end{equation}
+\glossary{name=$L_n^\alpha(x)$,description=Laguerre polynomials,sort=Lna}
+
+\chapter{Bessel Functions}
+
+Bessel functions $Z_\nu(z)$ are solutions of
+\begin{equation}
+\frac{d^2Z_\nu}{dz^2} + \frac{1}{z}\,\frac{dZ_\nu}{dz} +
+\left(
+1-\frac{\nu^2}{z^2}Z_\nu = 0
+\right)
+\end{equation}
+\glossary{name=$Z_\nu(z)$,description=Bessel functions,sort=Z}
+
+\chapter{Confluent hypergeometric function}
+
+\begin{equation}
+\Phi(\alpha,\gamma;z) = 1 + \frac{\alpha}{\gamma}\,\frac{z}{1!}
++ \frac{\alpha(\alpha+1)}{\gamma(\gamma+1)}\,\frac{z^2}{2!}
++\frac{\alpha(\alpha+1)(\alpha+2)}{\gamma(\gamma+1)(\gamma+2)}\,\frac{z^3}{3!}
++ \cdots
+\end{equation}
+\glossary{name={$\Phi(\alpha,\gamma;z)$},description=confluent hypergeometric function,sort=Pagz}
+
+\begin{equation}
+k_\nu(x) = \frac{2}{\pi}\int_0^{\pi/2}\cos(x \tan\theta - \nu\theta)\,d\theta
+\end{equation}
+\glossary{name=$k_\nu(x)$,description=Bateman's function,sort=kv}
+
+\chapter{Parabolic cylinder functions}
+
+\begin{equation}
+D_p(z) = 2^{\frac{p}{2}}e^{-\frac{z^2}{4}}
+\left\{
+\frac{\surd\pi}{\Gamma\left(\frac{1-p}{2}\right)}
+\Phi\left(-\frac{p}{2},\frac{1}{2};\frac{z^2}{2}\right)
+-\frac{\sqrt{2\pi}z}{\Gamma\left(-\frac{p}{2}\right)}
+\Phi\left(\frac{1-p}{2},\frac{3}{2};\frac{z^2}{2}\right)
+\right\}
+\end{equation}
+\glossary{name=$D_p(z)$,description=Parabolic cylinder functions,sort=Dp}
+
+\chapter{Elliptical Integral of the First Kind}
+
+\begin{equation}
+F(\phi, k) = \int_0^\phi \frac{d\alpha}{\sqrt{1-k^2\sin^2\alpha}}
+\end{equation}
+\glossary{name={$F(\phi,k)$},description=Elliptical integral of the first kind,sort=Fpk}
+
+\chapter{Constants}
+
+\begin{equation}
+C = 0.577\,215\,664\,901\ldots
+\end{equation}
+\glossary{name=$C$,description=Euler's constant,sort=C}
+
+\begin{equation}
+G = 0.915\,965\,594\ldots
+\end{equation}
+\glossary{name=$G$,description=Catalan's constant,sort=G}
+
+\end{document}
+% \begin{macrocode}
+%</sampleEqPg.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleNtn.tex>
+% \end{macrocode}
+\documentclass{report}
+
+\usepackage[plainpages=false,colorlinks]{hyperref}
+\usepackage{html}
+\usepackage[toc]{glossary}
+
+\makeglossary
+
+\newglossarytype{notation}{not}{ntn}
+
+% Set up notation style
+\newcommand{\notationname}{Notation}
+% Don't display numbers, remove commas and number hyphens
+% for notation entries
+\setglossary{type=notation,glsnumformat=ignore,%
+glodelim={.}}
+
+\makenotation
+
+\begin{document}
+
+\title{Sample Document using glossary Package}
+\author{Nicola Talbot}
+\pagenumbering{alph}
+\maketitle
+
+\begin{abstract}
+\pagenumbering{Alph}%stop hyperref complaining about duplicate page identifiers
+This is a sample document illustrating the use of the
+\textsf{glossary} package. In this example, a new glossary type
+called \texttt{notation} is defined, so that the document can have a
+separate glossary of terms and index of notation. The index of notation
+doesn't have associated numbers.
+\end{abstract}
+
+
+\pagenumbering{roman}
+\tableofcontents
+
+\printglossary
+
+% Either of the following 2 commands will have
+% the same effect with LaTeX. Effect slightly
+% different with LaTeX2HTML.
+
+%\printnotation
+\printglossary[notation]
+
+\chapter{Introduction}
+\pagenumbering{arabic}
+
+Sets\glossary{name=set,description=A collection of distinct objects}
+are denoted by a caligraphic font
+e.g.\ $\mathcal{S}$%
+\notation{name=$\mathcal{S}$,description=A set,sort=S}.
+
+Let $\mathcal{U}$ denote the universal set\notation{name=$\mathcal{U}$,description={The universal set},sort=U}.
+
+The cardinality\glossary{name=cardinality,description=The number of elements in the specified set} of a set $\mathcal{S}$ is denoted
+$|\mathcal{S}|$%
+\notation{name=$\mid\mathcal{S}\mid$,description=cardinality of $\mathcal{S}$,sort=cardinality}
+
+\chapter{Next}
+
+Now for a hyperlink:
+\xnotation{name=$\mathcal{U}$,description={The universal
+set},sort=U}{$\mathcal{U}$}.
+
+\end{document}
+% \begin{macrocode}
+%</sampleNtn.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleNtn2.tex>
+% \end{macrocode}
+\documentclass{report}
+
+\usepackage[plainpages=false,colorlinks]{hyperref}
+\usepackage{html}
+\usepackage[toc]{glossary}
+
+\makeglossary
+
+\newglossarytype{notation}{not}{ntn}
+
+% Set up notation style
+\newcommand{\notationname}{Notation}
+% Don't display numbers, remove commas and number hyphens
+% for notation entries
+\setglossary{type=notation,glsnumformat=ignore,%
+glodelim={.}}
+
+\makenotation
+
+\begin{document}
+
+% Save details for later use (note the use of \protect):
+\storeglosentry[notation]{not:set}{name={$\protect\mathcal{S}$},description=A set,sort=S}
+
+\storeglosentry[notation]{not:U}{name=$\protect\mathcal{U}$,description={The universal set},sort=U}
+
+\storeglosentry[notation]{not:card}{name=$\mid\protect\mathcal{S}\mid$,description=cardinality of $\protect\mathcal{S}$,sort=cardinality}
+
+\storeglosentry{glos:set}{name=set,description=A collection of distinct objects}
+
+\storeglosentry{glos:card}{name=cardinality,description=The number of elements in the specified set}
+
+\title{Sample Document using glossary Package}
+\author{Nicola Talbot}
+\pagenumbering{alph}
+\maketitle
+
+\begin{abstract}
+\pagenumbering{Alph}%stop hyperref complaining about duplicate page identifiers
+This is a sample document illustrating the use of the
+\textsf{glossary} package. In this example, a new glossary type
+called \texttt{notation} is defined, so that the document can have a
+separate glossary of terms and index of notation. The index of notation
+doesn't have associated numbers.
+\end{abstract}
+
+
+\pagenumbering{roman}
+\tableofcontents
+
+\printglossary
+
+% Either of the following 2 commands will have
+% the same effect with LaTeX. Effect slightly
+% different with LaTeX2HTML.
+
+\printnotation
+%\printglossary[notation]
+
+\chapter{Introduction}
+\pagenumbering{arabic}
+
+Sets\useglosentry{glos:set}
+are denoted by a caligraphic font
+e.g.\ $\mathcal{S}$\useglosentry{not:set}.
+
+Let \gls{not:U} denote the universal set.
+
+The \gls{glos:card} of a set $\mathcal{S}$ is denoted
+\gls{not:card}.
+
+\end{document}
+% \begin{macrocode}
+%</sampleNtn2.tex>
+% \end{macrocode}
+% \begin{macrocode}
+%<*sampleSec.tex>
+% \end{macrocode}
+\documentclass{report}
+
+\usepackage[plainpages=false,colorlinks]{hyperref}
+\usepackage[style=altlist,toc,number=section]{glossary}
+
+\makeglossary
+
+% This just saves a bit of typing
+
+\storeglosentry{glos:I}{name=identity matrix,description=diagonal
+matrix with 1s along the leading diagonal}
+
+\begin{document}
+
+\pagenumbering{roman}
+\tableofcontents
+
+\printglossary
+
+\chapter{Introduction}
+\pagenumbering{arabic}
+This is a sample document illustrating the use of the
+\textsf{glossary} package.
+
+\chapter{Diagonal matrices}
+
+A diagonal matrix\glossary{name=diagonal matrix,
+description=matrix whose only non-zero entries are along the leading diagonal,format=hyperit}
+is a matrix where all elements not on the leading diagonal are zero. This is the
+primary definition, so an italic font is used for the page number.
+
+\newpage
+\section{Identity matrix}
+The identity matrix\glossary{name=identity matrix,
+description=diagonal matrix with 1s along the leading diagonal}
+\ldots
+
+Here is another entry for a diagonal matrix\glossary{name=diagonal matrix,
+description=matrix whose only non-zero entries are along the leading diagonal}
+
+\chapter{Singular Matrices}
+
+A singular matrix\glossary{name=singular matrix,
+description=matrix with zero determinant}
+\ldots
+
+Another \useGlosentry{glos:I}{identity matrix} entry.
+
+\end{document}
+% \begin{macrocode}
+%</sampleSec.tex>
+% \end{macrocode}
+%\Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/glossary/glossary.ins b/Master/texmf-dist/source/latex/glossary/glossary.ins
new file mode 100644
index 00000000000..f67fe529aa4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/glossary/glossary.ins
@@ -0,0 +1,36 @@
+% glossary.ins generated using makedtx version 0.9b 2005/9/27 12:20
+\input docstrip
+
+\preamble
+Copyright (C) 2005 Nicola Talbot, all rights reserved.
+If you modify this file, you must change its name first.
+You are NOT ALLOWED to distribute this file alone. You are NOT
+ALLOWED to take money for the distribution or use of either this
+file or a changed version, except for a nominal charge for copying
+etc.
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{\file{makeglos.pl}{\nopreamble\nopostamble\from{glossary.dtx}{makeglos.pl}}
+\file{sampleSec.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleSec.tex,package}}
+\file{sampleNtn.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleNtn.tex,package}}
+\file{sampleEqPg.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleEqPg.tex,package}}
+\file{makeglos.bat}{\nopreamble\nopostamble\from{glossary.dtx}{makeglos.bat}}
+\file{sample.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sample.tex,package}}
+\file{sampleNtn2.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleNtn2.tex,package}}
+\file{glossary.perl}{\nopreamble\nopostamble\from{glossary.dtx}{glossary.perl}}
+\file{glossary.sty}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{glossary.sty,package}}
+\file{sampleAcr.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleAcr.tex,package}}
+\file{sampleEq.tex}{\usepreamble\defaultpreamble
+\usepostamble\defaultpostamble\from{glossary.dtx}{sampleEq.tex,package}}
+}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/hyphenat/hyphenat.dtx b/Master/texmf-dist/source/latex/hyphenat/hyphenat.dtx
new file mode 100644
index 00000000000..53c67ef70e7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/hyphenat/hyphenat.dtx
@@ -0,0 +1,893 @@
+% \iffalse meta-comment
+%
+% hyphenat.dtx
+% Copyright 1998, 1999 Peter R. Wilson
+%
+% This program is provided under the terms of the
+% LaTeX Project Public License distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt.
+%
+% Author: Peter Wilson (CUA and NIST) (now at: peter.r.wilson@boeing.com)
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\setcounter{StandardModuleDepth}{1}
+\begin{document}
+ \DocInput{hyphenat.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \CheckSum{401}
+%
+% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
+% \DoNotIndex{\@centercr,\@cite}
+% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+% \DoNotIndex{\@input,\@ixpt,\@m}
+% \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
+% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+% \DoNotIndex{\advance,\Alph,\alph}
+% \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+% \DoNotIndex{\bullet}
+% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+% \DoNotIndex{\fbox}
+% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+% \DoNotIndex{\input}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+% \DoNotIndex{\NeedsTeXFormat,\newdimen}
+% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
+% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
+% \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
+% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+% \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+% \DoNotIndex{\wd,\xiipt,\year,\z@}
+%
+% \changes{v11}{1997/09/30}{Output character table to class and package files only}
+% \changes{v2.3}{2001/01/02}{Fixed problem with non-CMR fonts doing double hyphens}
+%
+% ^^A \def\fileversion{v2.3}
+% ^^A \def\filedate{1999/02/13}
+% \def\fileversion{v2.3a}
+% \def\filedate{2001/01/02}
+% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
+% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
+% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
+% \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
+% \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
+% \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
+%
+% \title{The \Lpack{hyphenat} package\thanks{This
+% file has version number \fileversion, last revised
+% \filedate.}}
+%
+% \author{%
+% Peter Wilson\\
+% Catholic University of America\thanks{This work was originally
+% performed as
+% a Guest Researcher at the National Institute of Standards and Technology.} \\
+% Now at {\tt peter.r.wilson@boeing.com}
+% }
+% \date{\filedate}
+% \maketitle
+% \begin{abstract}
+% The \Lpack{hyphenat} package can be used to either disable hyphenation
+% throughout a document or to enable automatic hyphenation within words
+% that include analphabetic characters. It also provides for hyphenatable
+% monospaced fonts.
+% \end{abstract}
+% \tableofcontents
+%
+% \StopEventually{}
+%
+%
+%
+% \section{Introduction}
+%
+% Questions about hyphenation seem to pop up fairly regularly on
+% \texttt{comp.text.tex} newsgroup. Broadly speaking the questions
+% take one of two forms:
+% \begin{itemize}
+% \item How can I disable hyphenation in my document?
+% \item How can I enable hyphenation after the character \ldots ?
+% \end{itemize}
+% The \Lpack{hyphenat} package attempts to provide solutions for
+% both of these questions. This package is an extension of the
+% \Lpack{uschyp} package which was developed as part of a class
+% and package bundle for typesetting ISO standards~\cite{PRW96i}.
+% This manual is typeset according to the conventions of the
+% \LaTeX{} \textsc{docstrip} utility which enables the automatic
+% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
+%
+% Section~\ref{sec:usc} describes a package to enable `words'
+% containing analphabetic characters to be automatically hyphenated,
+% or to disable hyphenation throught a document or just disable
+% it for short pieces of text. It also enables hyphenation, if required,
+% of text typeset using monospaced (TT) fonts. For convenience I use TT
+% to mean a monospaced font; TT does \emph{not} indicate TrueType fonts.
+% Commented source code for the package is in Section~\ref{sec:code}.
+%
+% \section{The \Lpack{hyphenat} package} \label{sec:usc}
+%
+% The \Lpack{hyphenat} package has an option called \Lopt{none}.
+% Use of this option prevents any hyphenation throughout the document.
+% If \TeX{} is prevented from hyphenating it may complain about bad
+% line breaks and you may find bits of text sticking out into the
+% margin. If you use this option you should also consider using
+% |\sloppy| and/or |\raggedright|.
+%
+% The other option, \Lopt{htt}, enables hyphenation of text typeset
+% using Computer Modern Typewriter fonts (or their equivalent, such as
+% Adobe Courier).
+% If this option is used, then text typeset via
+% either |\texttt| or |\ttfamily| will be in the default TT font and
+% may be automatically hyphenated. Note that this will not affect any
+% TT text typeset by either |\verb| or in a |verbatim| environment
+% because they locally inhibit hyphenation. If you use this option
+% you are likely to get a lot of \texttt{Font Warning} messages about
+% being unable to load a font. It is reasonably safe to suggest that you
+% can ignore these.
+%
+% \DescribeMacro{\textnhtt}
+% \DescribeMacro{\nhttfamily}
+% The command |\textnhtt{|\meta{text}|}| will typeset \meta{text} in
+% the default TT font with no automatic hyphenation. It has the same
+% effect as |\texttt| when the \Lopt{htt} option is not used.
+% The |\nhttfamily| declaration is a companion to the |\textnhtt| command
+% and is analagous to the |\ttfamily| declaration in that it prevents
+% any hyphenation of TT fonts. For example, if the Courier font is used
+% as the monospaced font instead of the CM typewriter font, then hyphenation
+% may occur with the Courier in places where it wouldn't with CM. The command
+% or environment may be used to ensure that Courier is treated the same as
+% CM regarding hyphenation.
+%
+% \DescribeMacro{\nohyphens}
+% The command |\nohyphens{|\meta{text}|}| will typeset \meta{text} without
+% any automatic hyphenation. This is intended to be used for short pieces
+% of text.
+%
+% An \textit{analphabetic} character is a character than does not appear
+% in the alphabet. Analphabetic characters include the numerals and
+% punctuation characters. If a `word' contains any analphabetic characters,
+% \TeX's automatic hyphenation capability is disabled for any syllables
+% following the (first) of the analpabetic characters in the word.
+% Words containing analphabetic characters often occur as the names
+% of variables in computer programs, and of course, as URLs on the Web.
+% The \Lopt{hyphenat} package provides several commands enabling automatic
+% hyphenation of words containing analphabetics.
+%
+% \DescribeMacro{\_}
+% In \LaTeX{} a `word' containing an underscore
+% (e.g., |`letters_with_underscores'|) can be hyphenated at
+% the underscore by using a discretionary hyphen. That is, write the
+% word like |letters\_\-with\_\-underscores|. This has two potential
+% disadvantages: (a) more typing is involved, and (b) if the word is broken
+% at one underscore, hyphenation of any succeeding syllables is disabled.
+% The \Lpack{hyphenat} package redefines the |\_| command so that hyphenation
+% can automatically occur after an underscore and further hyphenation
+% within the word is not disabled. Thus, this example word can just be
+% written as |letters\_with\_underscores|.
+%
+% Note that following the revised |\_| command with a discretionary hyphen
+% makes its behaviour revert to the \LaTeX{} default.
+%
+% \DescribeMacro{\bshyp}
+% The |\bshyp| command can be used to print a backslash and have
+% following hyphenation.
+%
+% \DescribeMacro{\fshyp}
+% The |\fshyp| command can be used to print a forward slash and have
+% following hyphenation.
+%
+% \DescribeMacro{\dothyp}
+% The |\dothyp| command can be used to print a period (full stop) and have
+% following hyphenation.
+%
+% \DescribeMacro{\colonhyp}
+% The |\colonhyp| command can be used to print a colon and have
+% following hyphenation.
+%
+%
+% For example, to typeset |first\second/third.fourth:fifth_sixth|,
+% allowing hyphenation at the analphabetic characters the source would be:
+% \begin{verbatim}
+% first\bshyp{}second\fshyp{}third\dothyp{}fourth\colonhyp{}fifth\_sixth
+% \end{verbatim}
+%
+% \DescribeMacro{\hyp}
+% \TeX{} does not want to hyphenate a word that appears in the source
+% already hyphenated, such as |electromagnetic-endioscopy|.
+% The |\hyp| command is like the other |\...hyp| commands, only it
+% typesets a hyphen and allows full automatic hyphenation of the other
+% words forming the compound word. It is used like
+% |electromagnetic\hyp{}endioscopy|.
+%
+%
+% \section{The package code} \label{sec:code}
+%
+% \changes{v2.1}{1998/10/14}{Renamed the package from uschyp to hyphenat}
+% \changes{v2.2}{1998/12/31}{Added hyphenation of TT fonts}
+% \changes{v2.3}{1999/02/13}{Added hyp command}
+%
+% Announce the name and version of the package, which requires
+% \LaTeXe.
+% \begin{macrocode}
+%<*usc>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{hyphenat}[2001/01/02 v2.3a hyphenation utilities]
+% \end{macrocode}
+%
+% An option is provided whereby all hyphenation throught a document
+% is disabled.
+% \changes{v2.1}{1998/10/14}{Added the `none' option}
+% Hyphenation throughout a document can be disabled in at least the following
+% ways:
+% \begin{enumerate}
+% \item Set |\exhyphenpenalty| and |\hyphenpenalty| to 10000
+% (the \textit{\TeX book} exercise 14.6);
+% \item Use an `unknown' language (i.e., one that has no hyphenation
+% patterns, but for a complete document this would cause problems
+% if a package like \Lpack{babel} was used);
+% \item Set |\lefthyphenmin| and |\righthyphenmin| to large values (see
+% \file{lthyphen.dtx}) to prevent hypenation in the first |\lefthyphenmin|
+% characters and in the last |\righthyphenmin| characters.
+% \end{enumerate}
+% I have chosen the \textit{\TeX book} solution for global hyphenation
+% suppression as it is generic.
+% \begin{macrocode}
+\DeclareOption{none}%
+ {\hyphenpenalty=10000\exhyphenpenalty=10000\relax}
+% \end{macrocode}
+% \changes{v2.2}{1998/12/31}{Added the `htt' option}
+% \changes{v2.2a}{1999/01/30}{Added warning with the `htt' option}
+% An option is provided whereby TT text may be hyphenated.
+% See~\S\ref{sec:tt} for how it is implemented via the |\touchttfonts|
+% and |\touchextrattfonts| commands. At the end we have to ensure that the
+% normal text font is selected.
+% \begin{macrocode}
+\DeclareOption{htt}{%
+ \PackageWarningNoLine{hyphenat}{%
+ *******************************\MessageBreak
+ * You have used the htt option.\MessageBreak
+ * You are likely to get many Font Warning messages.\MessageBreak
+ * These can usually be ignored.\MessageBreak
+ *******************************}
+ \AtBeginDocument{\touchttfonts\touchextrattfonts\normalfont}}
+\ProcessOptions
+% \end{macrocode}
+%
+% \begin{macro}{\langwohyphens}
+% We will use a non-existant language as a local means of disabling
+% hyphenation.
+% \begin{macrocode}
+\newlanguage\langwohyphens
+% \end{macrocode}
+% \end{macro}
+%
+% This package redefines the |\_| command to include a
+% discretionary hyphen.\footnote{Thanks to Donald Arseneau for pointing
+% the author in the right direction.}
+% The new definition provides for full hyphenation throughout
+% a construct such as |long\_identifier|.
+% The default \LaTeX{} behaviour
+% is that this kind of construct has to be written as
+% as |long\_\-identifier| if hyphenation
+% is to be enabled at the position of the underscore; this also
+% switched off hypenation after the first use of |\_| or
+% |_\-| within the construct.
+%
+% Users of this package must not use a discretionary hyphen
+% in conjunction with an underscore.
+%
+% The behaviour of |_| as a subscript command in math mode is
+% unaffected as is the use of a naked |_| in text (an error).
+%
+% The original attempt was to enable a naked |_| to be used in
+% ordinary text. The code for this follows. The problem that arose
+% with this was that, for example, |\input{long_filename}| would
+% fail. With the original code, a naked |_| could not be used
+% in |\label|, |\cite| or |\ref| commands as |\protect| is not
+% properly enabled in these commands.
+% \begin{verbatim}
+% % uscaslet.sty
+% % (Email from Donald Arseneau 10 October 1997)
+% \newcommand{\BreakableUnderscore}{\leavevmode
+% \nobreak\hskip\z@skip
+% \textunderscore
+% \-\nobreak\hskip\z@skip}
+% \def\UnderOrSub0{\ifmmode\sb\else\BreakableUnderscore\fi}
+% \AtBeginDocument{\catcode`\_\active}
+% \begingroup\catcode`\_\active
+% \@firstofone{\endgroup\def_{\protect\UnderOrSub0}}
+% \DeclareRobustCommand{\_}{%
+% \ifmmode\nfss@text{\textunderscore}\else\BreakableUnderscore\fi}
+% \endinput
+% \end{verbatim}
+% Donald Arseneau has since developed his \Lopt{underscore} package,
+% available on CTAN, that eliminates the above problems.
+%
+% \changes{v2}{1997/11/30}{Removed the uschypne package}
+%
+% Now for the \Lopt{hyphenat} version. This is reduced from Donald Arseneau's code
+% (Email from him on Friday 10 October 1997) with my comments.
+%
+% This version includes macros for breakable backslashes,
+% forward slashes and periods as well as underscores.
+%
+% \begin{macro}{\prw@zbreak}
+% |\prw@zbreak| is just defined to save some potential typos further on.
+% \begin{macrocode}
+\newcommand{\prw@zbreak}{\nobreak\hskip\z@skip}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\BreakableUnderscore}
+% This macro adds a discretionary hyphen after an underscore. As Ray
+% Goult discovered, using the shorthand |\-| for |\discretionary{-}{}{}|
+% causes problems in a \Lenv{tabbing} environment which modifies the
+% definition of |\-|, so we have to use the long form.
+% \changes{v2}{1997/11/30}{Changed use of \cs{-} to \cs{discretionary}}
+% \begin{macrocode}
+\newcommand{\BreakableUnderscore}{\leavevmode%
+ \prw@zbreak\textunderscore\discretionary{-}{}{}\prw@zbreak}
+% \end{macrocode}
+% \end{macro}
+%
+% The next bit of Donald Arseneau's code preserves any following spaces
+% (yes, that is a zero at the
+% end of the command name). Unfortunately this is not required any more.
+% \begin{verbatim}
+% \def\UnderOrSub0{\ifmmode\sb\else\BreakableUnderscore\fi}
+% \end{verbatim}
+% Originally the underscore was made active only at the beginning
+% of the document
+% to avoid possibly upsetting other packages that had been loaded:
+% \begin{verbatim}
+% \AtBeginDocument{\catcode`\_\active}
+% \end{verbatim}
+% but this broke input of files with names that included underscores.
+% Next a new underscore command was defined.
+% \begin{verbatim}
+% \begingroup\catcode`\_\active
+% \@firstofone{\endgroup\def_{\protect\UnderOrSub0}}
+% \end{verbatim}
+% but again this broke file names.
+%
+% And finally redefine the |\_| command.
+% \begin{macrocode}
+\DeclareRobustCommand{\_}{%
+ \ifmmode\nfss@text{\textunderscore}\else\BreakableUnderscore\fi}
+% \end{macrocode}
+%
+% \begin{macro}{\BreakableBackslash}
+% \begin{macro}{\BreakableSlash}
+% \begin{macro}{\BreakablePeriod}
+% \begin{macro}{\BreakableColon}
+% We do similar breakable definitions for |\|, |/| and |.| characters.
+% \begin{macrocode}
+\newcommand{\BreakableBackslash}{\leavevmode%
+ \prw@zbreak\textbackslash\discretionary{-}{}{}\prw@zbreak}
+\newcommand{\BreakableSlash}{\leavevmode%
+ \prw@zbreak/\discretionary{-}{}{}\prw@zbreak}
+\newcommand{\BreakablePeriod}{\leavevmode%
+ \prw@zbreak.\discretionary{-}{}{}\prw@zbreak}
+\newcommand{\BreakableColon}{\leavevmode%
+ \prw@zbreak:\discretionary{-}{}{}\prw@zbreak}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bshyp}
+% \begin{macro}{\fshyp}
+% \begin{macro}{\dothyp}
+% \begin{macro}{\colonhyp}
+% Now for the user commands. I was hoping to have these of the form
+% |\\|, |\/| and |\.|, but these are all part of the basic set of
+% commands. |\?| appears to be the only unused single
+% analphabetic command, and I chose this for a breakable period
+% (at least the symbol does include a dot). Normal alphabetic
+% commands are used for the others. For the second release, I changed
+% my mind and replaced the original |\?| command with |\dothyp|
+% instead:
+% \begin{itemize}
+% \item |\dothyp| is more consistent with the other breakable commands;
+% \item |\?| might be used in other classes or packages;
+% \item I, or someone else, might want to later use |\?| for a breakable
+% question mark.
+% \end{itemize}
+%
+% To print |first\second/third.fourth:fifth|, allowing hyphenation within
+% each `word' and also at the |\|, |/|, |.| and |:| characters,
+% the source should be: \\
+% |first\bshyp{}second\fshyp{}third\dothyp{}fourth\colonhyp{}fifth|
+%
+% \changes{v2}{1997/11/30}{Added \cs{dothyp} command as synonym for \cs{?} command}
+% \changes{v2}{1997/11/30}{Deprecated the \cs{?} command}
+% \changes{v2.1}{1998/10/14}{Removed the \cs{?} command}
+% \begin{macrocode}
+\DeclareRobustCommand{\bshyp}{%
+ \ifmmode\backslash\else\BreakableBackslash\fi}
+\DeclareRobustCommand{\fshyp}{%
+ \ifmmode/\else\BreakableSlash\fi}
+\DeclareRobustCommand{\dothyp}{%
+ \ifmmode.\else\BreakablePeriod\fi}
+\DeclareRobustCommand{\colonhyp}{%
+ \ifmmode:\else\BreakableColon\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\BreakableHyphen}
+% \begin{macro}{\hyp}
+% Gabriel Zachmann (\texttt{zach@igd.fhg.de}) discovered on 2000/12/21 that
+% my original code for this which included |\discretionary{-}{}{}| in some
+% circumstances and with some non-CMR fonts produced a double hyphen. The
+% revised code has not broken (yet).
+% \begin{macrocode}
+\newcommand{\BreakableHyphen}{\leavevmode%
+ \prw@zbreak-\discretionary{}{}{}\prw@zbreak}
+\DeclareRobustCommand{\hyp}{%
+ \ifmmode-\else\BreakableHyphen\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Hyphenation of TT text} \label{sec:tt}
+%
+% The default specification for the Computer Modern Typewriter font disables
+% hyphenation by setting the |\hyphenchar| for the font to be -1 (in other
+% fonts the |\hyphenchar| is normally 45). To enable hyphenation for
+% text typeset with the cmtt font(s) we need to set the |\hyphenchar|
+% to the position of the hyphen in the font. This can be done by:
+% \begin{enumerate}
+% \item Replacing the default \file{...tt.fd} file;
+% \item Define a new virtual font with the |\hyphenchar| set;
+% \item Define a new font family based on cmtt with the |\hyphenchar| set.
+% \end{enumerate}
+% The first choice is not good because it is effectively a global change
+% to a \LaTeX{} installation. The second involves some amount of work
+% (both on the package writer's and users' parts)
+% and depends on the DVI driver being able to handle virtual fonts.
+% The third option was initially chosen as being the simplest and most portable.
+% It principally involved defining \file{.fd} files for a font family
+% that I called cmhtt, as being a hyphenatable version of cmtt.
+%
+% \begin{macro}{\textnhtt}
+% \begin{macro}{\nhttfamily}
+% |\textnhtt| is equivalent to |\texttt| but it ensures that its argument
+% will never be hyphenated. Similarly the |\nhttfamily| declaration is
+% the corresponding equivalent to the |\ttfamily| declaration.
+% On the assumption that this will only be used for short pieces of
+% text we will implement this by using a non-existant language; this does
+% mean, however, that any language-specific typesetting (for example
+% via the \Lpack{babel} package) will be locally disabled.
+% \begin{macrocode}
+\DeclareTextFontCommand{\textnhtt}{\nhttfamily}
+\DeclareRobustCommand{\nhttfamily}
+ {\not@math@alphabet\nhttfamily\mathtt
+ \fontfamily\ttdefault\selectfont\language\langwohyphens}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\nohyphens}
+% While we are at it, we might as well define a general command to disable
+% hyphenation of its argument text.
+% \begin{macrocode}
+\newcommand{\nohyphens}[1]{{\language\langwohyphens #1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\touchttfonts}
+% There is a fourth way of specifying hyphenatable TT fonts that does not
+% depend on generating any extra \file{.fd} files but does depend on the fact
+% that \TeX{} only touches (loads) a font once. The method is to select
+% all likely TT fonts at the beginning of the document, and then to select
+% the normal font. When each TT font is selected its |\hyphenchar| is
+% set to the default hyphen character for the font rather than to the -1
+% as specified in the \file{.fd} files.
+% The command |\touchttfonts| selects all likely TT fonts once. (This has
+% been tested with no font packages (i.e., vanilla \LaTeX{} cmtt fonts),
+% with the PSNFSS
+% font packages, and with the \Lpack{pandora} package using the Pandora pntt
+% TT font).
+%
+% \begin{macrocode}
+\newcommand{\touchttfonts}{%
+% \end{macrocode}
+% The Medium series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% The Bold series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{b}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{b}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{b}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{b}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% The Bold Extended series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{bx}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{bx}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{bx}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{bx}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% The Semi-bold series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{sb}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{sb}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{sb}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{sb}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% The Condensed series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{c}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{c}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{c}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{c}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% The Light series in Normal, Italic, Slanted and Small Caps.
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{l}\fontshape{n}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{l}\fontshape{it}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{l}\fontshape{sl}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{l}\fontshape{sc}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% Miscellaneous cmtt not covered above (from \file{cmfonts.fdd}).
+% \begin{macrocode}
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{ui}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{bx}\fontshape{ui}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+ \fontfamily{\ttdefault}\fontseries{m}\fontshape{In}\selectfont%
+ \hyphenchar\font=\defaulthyphenchar
+% \end{macrocode}
+% End of the definition of |\touchttfonts|.
+% \begin{macrocode}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\touchextrattfonts}
+% This macro is provided as a hook in case |\touchttfonts| does not cover
+% the required range. It should be redefined in the preamble after loading
+% the \Lpack{hyphenat} package. The definition of |\touchttfonts| can be
+% used as a template for the new definition.
+% \begin{macrocode}
+\newcommand{\touchextrattfonts}{}
+% \end{macrocode}
+% \end{macro}
+%
+% This completes the package.
+% \begin{macrocode}
+%</usc>
+% \end{macrocode}
+%
+% Just in case anyone is interested, the following is my original
+% specification of a hyphenatable TT font family.
+%
+% Now to specify the various \file{.fd} files for the cmhtt font.
+% These are essentially copies of the files generateable from
+% \file{cmfonts.fdd} (1998/03/27), which is part of the \LaTeX{} base
+% distribution.
+%
+% \begin{macrocode}
+%<*ot1>
+% \end{macrocode}
+% The OT1 coding for normal typesetting.
+% \begin{macrocode}
+\ProvidesFile{ot1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
+\DeclareFontFamily{OT1}{cmhtt}{\hyphenchar\font45}
+\DeclareFontShape{OT1}{cmhtt}{m}{n}
+ {%
+ <5><6><7><8>cmtt8<9>cmtt9%
+ <10><10.95>cmtt10%
+ <12><14.4><17.28><20.74><24.88>cmtt12%
+ }{}
+\DeclareFontShape{OT1}{cmhtt}{m}{it}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmitt10%
+ }{}
+\DeclareFontShape{OT1}{cmhtt}{m}{sl}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10%
+ }{}
+\DeclareFontShape{OT1}{cmhtt}{m}{sc}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10%
+ }{}
+\DeclareFontShape{OT1}{cmhtt}{m}{ui}
+ {<->ssub*cmhtt/m/it}{}
+\DeclareFontShape{OT1}{cmhtt}{bx}{n}
+ {<->ssub*cmhtt/m/n}{}
+\DeclareFontShape{OT1}{cmhtt}{bx}{it}
+ {<->ssub*cmhtt/m/it}{}
+\DeclareFontShape{OT1}{cmhtt}{bx}{ui}
+ {<->ssub*cmhtt/m/it}{}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</ot1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ot1slides>
+% \end{macrocode}
+% The OT1 coding for \Lpack{slides} class.
+% \begin{macrocode}
+\ProvidesFile{ot1lcmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts for slides]
+\DeclareFontFamily{OT1}{lcmhtt}{\hyphenchar\font45}
+\DeclareFontShape{OT1}{lcmhtt}{m}{n}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ cmtt8%
+ }{}
+\DeclareFontShape{OT1}{lcmhtt}{m}{In}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ icmtt8%
+ }{}
+\DeclareFontShape{OT1}{lcmhtt}{m}{it}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ cmitt10%
+ }{}
+\DeclareFontShape{OT1}{lcmhtt}{m}{ui}
+ {<->ssub*lcmhtt/m/it}{}
+\DeclareFontShape{OT1}{lcmhtt}{bx}{ui}
+ {<->ssub*lcmhtt/m/it}{}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</ot1slides>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*u>
+% \end{macrocode}
+% The U coding for normal typesetting.
+% \begin{macrocode}
+\ProvidesFile{ucmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
+\DeclareFontFamily{U}{cmhtt}{\hyphenchar\font45}
+\DeclareFontShape{U}{cmhtt}{m}{n}
+ {%
+ <5><6><7><8>cmtt8<9>cmtt9%
+ <10><10.95>cmtt10%
+ <12><14.4><17.28><20.74><24.88>cmtt12%
+ }{}
+\DeclareFontShape{U}{cmhtt}{m}{it}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmitt10%
+ }{}
+\DeclareFontShape{U}{cmhtt}{m}{sl}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmsltt10%
+ }{}
+\DeclareFontShape{U}{cmhtt}{m}{sc}
+ {%
+ <5><6><7><8><9>%
+ <10><10.95><12><14.4><17.28><20.74><24.88>cmtcsc10%
+ }{}
+\DeclareFontShape{U}{cmhtt}{m}{ui}
+ {<->ssub*cmhtt/m/it}{}
+\DeclareFontShape{U}{cmhtt}{bx}{n}
+ {<->ssub*cmhtt/m/n}{}
+\DeclareFontShape{U}{cmhtt}{bx}{it}
+ {<->ssub*cmhtt/m/it}{}
+\DeclareFontShape{U}{cmhtt}{bx}{ui}
+ {<->ssub*cmhtt/m/it}{}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</u>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*t1>
+% \end{macrocode}
+% The T1 coding for normal typesetting.
+% \begin{macrocode}
+\ProvidesFile{t1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
+\providecommand{\EC@httfamily}[5]{%
+ \DeclareFontShape{#1}{#2}{#3}{#4}%
+ {<5><6><7><8>#50800%
+ <9><10><10.95><12><14.4><17.28><20.74><24.88><29.86>%
+ <35.83>genb*#5}{}}
+\DeclareFontFamily{T1}{cmhtt}{\hyphenchar\font45}
+\EC@httfamily{T1}{cmhtt}{m}{n}{ectt}
+\EC@httfamily{T1}{cmhtt}{m}{sl}{ecst}
+\EC@httfamily{T1}{cmhtt}{m}{it}{ecit}
+\EC@httfamily{T1}{cmhtt}{m}{sc}{ectc}
+\DeclareFontShape{T1}{cmhtt}{bx}{n}%
+ {<->ssub*cmhtt/m/n}{}
+\DeclareFontShape{T1}{cmhtt}{bx}{it}%
+ {<->ssub*cmhtt/m/it}{}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</t1>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*t1slides>
+% \end{macrocode}
+% The T1 coding for \Lpack{slides} class typesetting.
+% \begin{macrocode}
+\ProvidesFile{t1lcmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts for slides]
+\DeclareFontFamily{T1}{lcmhtt}{\hyphenchar\font45}
+\DeclareFontShape{T1}{lcmhtt}{m}{n}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ ecltt8%
+ }{}
+\DeclareFontShape{T1}{lcmhtt}{m}{In}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ iecltt8%
+ }{}
+\DeclareFontShape{T1}{lcmhtt}{m}{it}
+ {%
+ <13.82><16.59><19.907><23.89><28.66><34.4><41.28>%
+ ecit1000%
+ }{}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</t1slides>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%<*ts1>
+% \end{macrocode}
+% The TS1 coding for normal typesetting.
+% \begin{macrocode}
+\ProvidesFile{ts1cmhtt.fd}[1998/12/31 Hyphenatable cmtt fonts]
+\providecommand{\EC@httfamily}[5]{%
+ \DeclareFontShape{#1}{#2}{#3}{#4}%
+ {<5><6><7><8>#50800%
+ <9><10><10.95><12><14.4><17.28><20.74><24.88><29.86>%
+ <35.83>genb*#5}{}}
+\DeclareFontFamily{TS1}{cmhtt}{\hyphenchar\font45}
+\EC@httfamily{TS1}{cmhtt}{m}{n}{tctt}
+\EC@httfamily{TS1}{cmhtt}{m}{sl}{tcst}
+\EC@httfamily{TS1}{cmhtt}{m}{it}{tcit}
+% \end{macrocode}
+% That's all for this file.
+% \begin{macrocode}
+%</ts1>
+% \end{macrocode}
+%
+%
+%
+%
+%
+% \subsection{Package features and caveats}
+%
+% \begin{description}
+% \item[Features] :
+% \begin{itemize}
+% \item The \Lopt{none} option disables all hyphenation. If
+% you use this option you should also consider using
+% |\sloppy| (to reduce \TeX 's moans about bad line breaks)
+% or |\raggedright| (to reduce moans about overfull boxes).
+% \item |\_| prints an underscore (per the traditional command).
+% \item |_| makes a subscript in math mode, and an error in text mode.
+% \item Words surrounding |\_| are hyphenated normally
+% and there is a discretionary hyphenation point immediately after
+% the underscore.
+% \item An underscore character is used if the font
+% encoding has one, otherwise it uses a drawn underscore.
+% \end{itemize}
+%
+% \item[Caveats] :
+% \begin{itemize}
+% \item Using |\_\-| together disables hyphenation in any succeeding
+% word.
+% \item Using |\nohyphens| disables any language-specific commands
+% within its argument. The same applies to |\textnhtt|
+% and |\nhttfamily|.
+% \item If the \Lopt{htt} option is used, then any resetting of
+% the default TT font must be done in the preamble before
+% the |\begin{document}|.
+% \end{itemize}
+%
+% \end{description}
+%
+%
+% \bibliographystyle{alpha}
+%
+% \begin{thebibliography}{GMS94}
+%
+% \bibitem[GMS94]{GOOSSENS94}
+% Michel Goossens, Frank Mittelbach, and Alexander Samarin.
+% \newblock {\em The LaTeX Companion}.
+% \newblock Addison-Wesley Publishing Company, 1994.
+%
+% \bibitem[Wil96]{PRW96i}
+% Peter~R. Wilson.
+% \newblock {\em {LaTeX for standards: The LaTeX package files user manual}}.
+% \newblock NIST Report NISTIR, June 1996.
+%
+% \end{thebibliography}
+%
+%
+% \Finale
+% \PrintIndex
+%
+\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/latex/hyphenat/hyphenat.ins b/Master/texmf-dist/source/latex/hyphenat/hyphenat.ins
new file mode 100644
index 00000000000..e6de3088c6b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/hyphenat/hyphenat.ins
@@ -0,0 +1,74 @@
+%% hyphenat.ins
+%% Copyright 1998, 1999 Peter R. Wilson
+%%
+%% This program is provided under the terms of the
+%% LaTeX Project Public License distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt.
+%%
+%% Author: Peter Wilson (CUA and NIST)
+%% now at: peter.r.wilson@boeing.com
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{hyphenat.ins}
+\input docstrip.tex
+\preamble
+
+Author: Peter Wilson (CUA and NIST)
+ now at: peter.r.wilson@boeing.com
+ Copyright 1998, 1999 Peter R. Wilson
+
+ This program is provided under the terms of the
+ LaTeX Project Public License distributed from CTAN
+ archives in directory macros/latex/base/lppl.txt.
+
+\endpreamble
+
+\keepsilent
+
+%%% \Msg{*** Generating the driver file ***}
+%%% \generateFile{hyphenat.drv}{t}{\from{hyphenat.dtx}{driver}}
+
+\Msg{*** Generating the LaTeX2e package files ***}
+
+\generateFile{hyphenat.sty}{t}{\from{hyphenat.dtx}{usc}}
+
+%%% \Msg{*** Generating the LaTeX2e font definition ***}
+
+%%% \generateFile{ot1cmhtt.fd}{t}{\from{hyphenat.dtx}{ot1}}
+%%% \generateFile{ot1lcmhtt.fd}{t}{\from{hyphenat.dtx}{ot1slides}}
+%%% \generateFile{ucmhtt.fd}{t}{\from{hyphenat.dtx}{u}}
+%%% \generateFile{t1cmhtt.fd}{t}{\from{hyphenat.dtx}{t1}}
+%%% \generateFile{t1lcmhtt.fd}{t}{\from{hyphenat.dtx}{t1slides}}
+%%% \generateFile{ts1cmhtt.fd}{t}{\from{hyphenat.dtx}{ts1}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file(s) into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space hyphenat.sty}
+%%% \Msg{* \space\space ot1cmhtt.fd}
+%%% \Msg{* \space\space ot1lcmhtt.fd}
+%%% \Msg{* \space\space ucmhtt.fd}
+%%% \Msg{* \space\space t1cmhtt.fd}
+%%% \Msg{* \space\space t1lcmhtt.fd}
+%%% \Msg{* \space\space ts1cmhtt.fd}
+\Msg{*}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{* Process any name.idx file by:}
+\Msg{* \space\space\space\space makeindex -s gind.ist name}
+\Msg{* Process any name.glo file by:}
+\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/lcd/lcd.dtx b/Master/texmf-dist/source/latex/lcd/lcd.dtx
new file mode 100644
index 00000000000..76d60073600
--- /dev/null
+++ b/Master/texmf-dist/source/latex/lcd/lcd.dtx
@@ -0,0 +1,972 @@
+% \iffalse meta-comment
+%
+% Package lcd
+% Copyright (c) 2004 Mike Kaufmann, all rights reserved
+%
+% This program is provided under the terms of the
+% LaTeX Project Public License distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt.
+%
+% Author: Mike Kaufmann
+% Mike.Kaufmann@ei.fh-giessen.de
+% \fi
+%% \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 \~}
+%%
+% \CheckSum{469}
+%
+% \iffalse meta-comment
+%
+%<*package>
+\def\fileversion{0.3}
+\def\filedate{2004/01/05}
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage[latin1]{inputenc}
+% redefine µ (\mu) to get it right in source code listing
+\DeclareInputText{181}{\ensuremath{\mu}}
+\usepackage{lcd}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%\OnlyDescription
+\begin{document}
+ \DocInput{lcd.dtx}
+\end{document}
+%</driver>
+%
+%<*package>
+% \fi
+%
+% ^^A Don't ask me why, but the first two \DoNotIndex-line don't work
+% \DoNotIndex{\",\#,\$,\%,\&,\^,\_,\~}
+% \DoNotIndex{\^^b0,\^^b5,\^^b7,\^^df,\^^e4,\^^f6,\^^fc}
+% \DoNotIndex{\@@end,\@empty,\@ifundefined}
+% \DoNotIndex{\@tempa,\@tempcnta,\@tempcntb}
+% \DoNotIndex{\AtBeginDocument,\advance,\addtocounter}
+% \DoNotIndex{\begin,\begingroup}
+% \DoNotIndex{\csname,\catcode,\color,\colorbox}
+% \DoNotIndex{\def}
+% \DoNotIndex{\else,\end,\endgroup,\endcsname,\expandafter}
+% \DoNotIndex{\fboxsep,\framebox}
+% \DoNotIndex{\global}
+% \DoNotIndex{\fi,\filedate,\fileversion}
+% \DoNotIndex{\hspace}
+% \DoNotIndex{\if,\ifnum,\ifx}
+% \DoNotIndex{\let,\line,\linethickness}
+% \DoNotIndex{\makebox,\multiply}
+% \DoNotIndex{\NeedsTeXFormat,\newcommand,\newcounter,\newlength,\newif}
+% \DoNotIndex{\obeyspaces}
+% \DoNotIndex{\ProvidesPackage,\put}
+% \DoNotIndex{\relax}
+% \DoNotIndex{\space,\setlength,\setcounter,\settoheight,\stepcounter}
+% \DoNotIndex{\the}
+% \DoNotIndex{\unitlength}
+% \DoNotIndex{\z@}
+%
+% ^^A\changes{0.3}{2004/01/04}{initial release}
+%
+% ^^A\MakeShortVerb{\+}
+% ^^A\DeleteShortVerb{\|}
+%
+% \newcommand*{\bs}{\char '134 }
+% \newcommand*{\lb}{\char '173 }
+% \newcommand*{\rb}{\char '175 }
+% \newcommand*{\param}[1]{\texttt{\textit{#1}}}
+% \newcommand*\lcd{\textLCD{3}|LCD|}
+%
+% \title{The \lcd\ Package\\alphanumerical LCDisplays with \LaTeX}
+% \author{Mike Kaufmann\\|Mike.Kaufmann@ei.fh-giessen.de|}
+% \date{\filedate~(v\fileversion)}
+% ^^A--------------------------------------------------------------------------
+% \maketitle
+% \begin{abstract}
+% The \lcd\ Package provides macros that display text which looks like on
+% alphanumerical LCDisplays.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% ^^A--------------------------------------------------------------------------
+% \newpage
+% \section{Introduction}
+% \subsection{Why this Package}\label{sec:why}
+% Without this package you can show the contents of an alphanumerical LCDisplay
+% with the typewriter font or you can take a picture and include it in your
+% document. The typewriter font doesn't provide all characters possible on an
+% LCD and perhaps a picture will need postprocessing.
+%
+% \begin{center}
+% \LCD{4}{40}+With the LCD package text appears like +
+% +on an alphanumerical LCDisplay (colors +
+% +are available) and you can easily define+
+% +your own symbols (5x7 dot matrix). +
+% \end{center}
+%
+% ^^A---------------------------------------------
+% \subsection{Making the Stylefile}
+% Because character with ASCII-codes greater then 127 are used in the
+% macro code, your TeX must be able to handle 8-bit ASCII to get a correct
+% stylefile!
+%
+% After generating the file lcd.sty search for the string ``|^^|'' (followed
+% by a hex-number). If you find it, you are in trouble.
+%
+% If you are using teTeX the command
+% \begin{verbatim}
+% tex --translate-file=cp8bit lcd.ins\end{verbatim}
+% ^^A\end{verbatim}
+% will work properly.
+%
+% Here a list of the hex-number--character pairs:\newline
+% |^^b5| $\to \mu$, |^^b0| $\to \;^\circ$, |^^b7| $\to \cdot$,
+% |^^e4| $\to$ \"a, |^^f6| $\to$ \"o, |^^fc| $\to$ \"u,
+% |^^df| $\to$ \ss.\newline
+% The list applies to Linux. There might be more trouble with other operating
+% systems. But in worst case only these characters will not work.
+%
+% ^^A---------------------------------------------
+% \subsection{Legal Stuff}
+% This program is provided under the terms of the
+% LaTeX Project Public License distributed from CTAN
+% archives in directory macros/latex/base/lppl.txt.
+%
+% ^^A--------------------------------------------------------------------------
+% \section{Using the Package}
+% \subsection{The main \protect\lcd\ Macros}\label{sec:mac}
+% \DescribeMacro\LCD
+% To show the contents of an alphanumerical LCDisplay the macro
+% \begin{center}
+% |\LCD{|\param{LCDlines}|}{|\param{LCDcolumns}|}|\meta{delimchar}\param{LCDtext}\meta{delimchar}\\
+% \ldots \meta{delimchar}\param{LCDtext}\meta{delimchar}
+% \end{center}
+% can be used.
+%
+% Here \param{LCDlines} is the number of lines you want to have. It has to be
+% at least one, which is tested and corrected if necessary, but without any
+% message or warning.
+%
+% The parameter \param{LCDcolumns} is the number of columns you want to have. It also
+% has to be at least one, but there is no test, message or warning jet.
+%
+% The numbers of lines and columns are not limited by the macro. But of course
+% there are limits by \TeX.
+%
+% The delimiter character \meta{delimchar} has to follow immediately after the
+% \param{LCDcolumns} parameter. It can be any character with catcode 11 or 12,
+% which means that active characters, a space and characters with a special
+% meaning to \TeX\ are not allowed. Of course \meta{delimchar} must not be part
+% of \param{LCDtext}.
+%
+% The opening \meta{delimchar} of one LCD-line can follow
+% immediately after the closing \meta{delimchar} of the line before. And there
+% can be spaces and/or newlines between these delimiters. Also text can be
+% there, but since it will be ignored it wouldn't make any sense.
+%
+% The \param{LCDtext} can consist of nearly any characters you can type, expect
+% of |\|, |{| and |}|. The braces are used to enclose so called multi-letter
+% characters, which are used to show symbols you can't type (e.g.\ |{clock}| to
+% get a clock symbol; see \ref{sec:pre} for more).
+%
+% The example in \ref{sec:why} was produced with
+% \begin{verbatim}
+% \LCD{4}{40}+With the LCD package text appears like +
+% +on an alphanumerical LCDisplay (colors +
+% +are available) and you can easily define+
+% +your own symbols (5x7 dot matrix). +\end{verbatim}
+% ^^A\end{verbatim}
+%
+% \DescribeMacro\textLCD
+% To put \param{LCDtext} in normal text the macro
+% \begin{center}
+% |\textLCD[|\param{LCDcorr}|]{|\param{LCDcolumns}|}|\meta{delimchar}\param{LCDtext}\meta{delimchar}
+% \end{center}
+% can be used.
+%
+% For \param{LCDcolumns}, \meta{delimchar} and \param{LCDtext} applies the same as
+% for these parameters in |\LCD|.
+%
+% The parameter \param{LCDcorr} is optional. It is used to reduce or enlarge
+% the space between the \param{LCDtext} and the surrounding normal text. The
+% default value ($-2$) fits for white backgrounded \param{LCDtext}. If you have
+% a background color the correct value is 0. It has to be a decimal number.
+%
+% \DescribeMacro\textLCDcorr
+% The default value is defined as the macro
+% |\textLCDcorr|. If you want to change the default value globaly, you can
+% redefine this macro in the preamble by typing
+% |\renewcommand{\textLCDcorr}{|\param{newdefault}|}| where \param{newdefault}
+% must be only a decimal number.
+%
+% ^^A---------------------------------------------
+% \subsection{Restrictions}
+% There are some restrictions you have to remember when using the \lcd\ package.
+% Ignoring them will lead to strange behavior or strange error messages.
+% And there are no package errors or package warnings jet. Here are the
+% restrictions:
+%
+% \begin{itemize}
+% \item There have to be exactly the number of LCD-lines given in the
+% \param{LCDlines}-Parameter. Lines that are too much will be printed as
+% normal text including the delimiter characters. If there are not enough
+% lines, you'll get a ``Runaway argument'' error or other strange things.
+% \item After a multi-letter character there have to be at least one other
+% charater, otherwise you'll get the word instead of the symbol
+% (e.g.\ the word ``clock'' and not the clock symbol). If a multi-letter
+% character is the last one in the line, just type a space after it.
+% \item The number of characters in a line is not tested. If there are too many
+% characters, they will be drawn over the right end.
+% \item It is not possible to place comments between the LCD-lines, the \%-sign
+% will be ignored there and in \param{LCDtext} it is a normal character.
+% \item There can't be a linebreak in \param{LCDtext} when using |\textLDC|.
+% \item You can't use the |\LCD| and |\textLCD| macro in other macros or as
+% parameter to a macro. Well, if the LCD-text only consists of letters,
+% digits and some other characters it would work. But a space, active
+% characters and characters with a special meaning to \TeX\ (all
+% characters with other catcodes than 11 or 12) wouldn't work. If you want
+% to use |\textLCD| in sectioning commands or in captions, you have to
+% |\protect| it.
+% \item You can't use the |\LCD| and |\textLCD| macro in boxes like |\parbox|,
+% |\raisebox| or |\makebox| (with the same exceptions as to the point
+% above). But you can use it in environments like |minipage| or |figure|.
+% \end{itemize}
+%
+% ^^A---------------------------------------------
+% \subsection{Size}\label{sec:size}
+% \DescribeMacro\LCDunitlength
+% To specify the absolte size of the LCD representation you have to set the length
+% |\LCDunitlength|. It represents the width of a dot plus the gap between the
+% dots. The default value is 0.5\,mm.
+%
+% For |\textLCD| the size is calculated automaticly so that the height of
+% \param{LCDtext} and the surrounding text fits. This does not affect
+% |\LCDunitlength|.
+%
+% ^^A---------------------------------------------
+% \subsection{Frames}\label{sec:frame}
+% \DescribeMacro\LCDnoframe
+% \DescribeMacro\LCDframe
+% By default a frame is drawn around the LCD representation. You can change this
+% behavior with the macro
+% |\LCDnoframe| in the preamble or befor the |\LCD| command. With
+% |\LCDframe| you can switch back to the default. Note that with |\textLCD|
+% there will never be a frame for typographical reasons.
+%
+% ^^A---------------------------------------------
+% \subsection{Using Colors}\label{sec:color}
+% \DescribeMacro\LCDcolors
+% To use colors you need the color package and you have to define foreground,
+% background and frame colors. The latter because the \lcd\ package only handles
+% named colors. After that you can set the colors with
+% \begin{center}
+% |\LCDcolors[|\param{framecolor}|]{|\param{foregroundcolor}|}{|\param{backgroundcolor}|}|.
+% \end{center}
+% This can be done in the preamble or befor the |\LCD| or |\textLCD| command.
+% The parameter \param{framecolor} is optional and the frame color will be set
+% to black if it is not given. The default colors where set with
+% |\LCDcolors{black}{white}|.
+%
+% ^^A---------------------------------------------
+% \subsection{Predefined Characters}\label{sec:pre}
+% Of course all letters (A--Z and a--z), digits (0--9) and the characters
+% ! ' ( ) * + , - . / : ; $<$ = $>$ ? [ ] ` and $\vert$ are predefined.
+% You can also type \$ \# $\mu$ $^\circ$ $\cdot$ \"a \"o \"u \ss\ " \% \&
+% \^\ and \_ dircetly. The character \~\ will be shown as a space.
+%
+% Some characters are available as multi-letter characters.
+% These are a clock symbol (|{clock}|), a right arrow (|{rarrow}|), a left arrow
+% (|{larrow}|), $\Omega$ (|{Omega}|), $\Sigma$ (|{Sigma}|), $\pi$ (|{pi}|),
+% a square root symbol (|{sqrt}|), a rectangle (|{rect}|),
+% a full cursor (|{fcur}|), \{ (|{lb}|), \} (|{rb}|) and $\alpha$ (|{alpha}|).
+%
+% ^^A---------------------------------------------
+% \subsection{Defining new Characters}\label{sec:def}
+% \DescribeMacro\DefineLCDchar
+% New characters can be defined with
+% |\DefineLCDchar{|\param{char}|}{|\param{charmatrix}|}|.
+%
+% Here \param{char} can be a single character or multiple letters. Note
+% that characters with catcodes other than 11 or 12 (characters that are
+% control sequences or have a special meaning to \TeX) will cause troubble.
+% Use mutiple letters instead.
+%
+% LCD characters are shown as a $5\times7$ dot matrix. Other matrix dimensions
+% are not possible. So in \param{charmatrix} you have to type exactly 35
+% times |0| or |1|, the ones are for visible dots. The first five ar for the
+% first dot row, the next five are for the second dot row and so on.
+%
+% As example, lets define an Euro symbol:
+%
+% \begin{figure}[htbp]
+% \centering
+% \unitlength2mm
+% \begin{picture}(54,10)
+% \put(0,8){\makebox(0,0)[bl]{
+% \texttt{\bs DefineLCDchar\lb euro\rb\lb00111010001111101000111110100000111\rb}}}
+% \put(5.5,6.5){\line(1,0){16.7}}\put(22.2,6.5){\line(0,1){1}}\put(20.2,7.5){\line(1,0){4}}
+% \put(5.5,5.5){\line(1,0){21.4}}\put(26.9,5.5){\line(0,1){2}}\put(24.9,7.5){\line(1,0){4}}
+% \put(5.5,4.5){\line(1,0){26.1}}\put(31.6,4.5){\line(0,1){3}}\put(29.5,7.5){\line(1,0){4}}
+% \put(5.5,3.5){\line(1,0){30.8}}\put(36.3,3.5){\line(0,1){4}}\put(34.3,7.5){\line(1,0){4}}
+% \put(5.5,2.5){\line(1,0){35.5}}\put(41.0,2.5){\line(0,1){5}}\put(39.0,7.5){\line(1,0){4}}
+% \put(5.5,1.5){\line(1,0){40.2}}\put(45.7,1.5){\line(0,1){6}}\put(43.7,7.5){\line(1,0){4}}
+% \put(5.5,0.5){\line(1,0){44.9}}\put(50.4,0.5){\line(0,1){7}}\put(48.4,7.5){\line(1,0){4}}
+% \multiput(0,0)(1,0){6}{\line(0,1){7}}
+% \multiput(0,0)(0,1){8}{\line(1,0){5}}
+% \linethickness{0.7\unitlength}
+% \put(2,6.35){\line(1,0){0.7}}
+% \put(3,6.35){\line(1,0){0.7}}
+% \put(4,6.35){\line(1,0){0.7}}
+% \put(1,5.35){\line(1,0){0.7}}
+% \put(0,4.35){\line(1,0){0.7}}
+% \put(1,4.35){\line(1,0){0.7}}
+% \put(2,4.35){\line(1,0){0.7}}
+% \put(3,4.35){\line(1,0){0.7}}
+% \put(4,4.35){\line(1,0){0.7}}
+% \put(1,3.35){\line(1,0){0.7}}
+% \put(0,2.35){\line(1,0){0.7}}
+% \put(1,2.35){\line(1,0){0.7}}
+% \put(2,2.35){\line(1,0){0.7}}
+% \put(3,2.35){\line(1,0){0.7}}
+% \put(4,2.35){\line(1,0){0.7}}
+% \put(1,1.35){\line(1,0){0.7}}
+% \put(2,0.35){\line(1,0){0.7}}
+% \put(3,0.35){\line(1,0){0.7}}
+% \put(4,0.35){\line(1,0){0.7}}
+% \end{picture}
+% \caption{Defining a new Character}
+% \end{figure}
+%
+% ^^A---------------------------------------------
+% \subsection{Package Options}
+% Only for completeness: there are no package options in this version.
+%
+% ^^A--------------------------------------------------------------------------
+% \StopEventually{\newpage\PrintIndex \PrintChanges}
+%
+% ^^A--------------------------------------------------------------------------
+% \newpage
+% \section{The Code}
+% \subsection{The Usual}
+% First the usual things.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[2001/06/01]
+\ProvidesPackage{lcd}[\filedate\space
+ v\fileversion\space drawing alphanumerical LCDisplays]
+% \end{macrocode}
+%
+% ^^A---------------------------------------------
+% \subsection{Defining Characters and predefined Characters}
+% \begin{macro}{\DefineLCDchar}
+% The macro |\DefineLCDchar| defines a macro |\@LCD@|\param{char} for every
+% character.
+% \begin{macrocode}
+\newcommand*\DefineLCDchar[2]{%
+ \global\expandafter\def\csname @LCD@#1\endcsname{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \noindent
+% Here are the predefined characters.
+% \begin{macrocode}
+\DefineLCDchar{A}{01110100011000110001111111000110001}
+\DefineLCDchar{B}{11110100011000111110100011000111110}
+\DefineLCDchar{C}{01110100011000010000100001000101110}
+\DefineLCDchar{D}{11100100101000110001100011001011100}
+\DefineLCDchar{E}{11111100001000011111100001000011111}
+\DefineLCDchar{F}{11111100001000011111100001000010000}
+\DefineLCDchar{G}{01110100011000010111100011000101110}
+\DefineLCDchar{H}{10001100011000111111100011000110001}
+\DefineLCDchar{I}{01110001000010000100001000010001110}
+\DefineLCDchar{J}{00111000100001000010000101001001100}
+\DefineLCDchar{K}{10001100101010011000101001001010001}
+\DefineLCDchar{L}{10000100001000010000100001000011111}
+\DefineLCDchar{M}{10001110111010110101100011000110001}
+\DefineLCDchar{N}{10001100011100110101100111000110001}
+\DefineLCDchar{O}{01110100011000110001100011000101110}
+\DefineLCDchar{P}{11110100011000111110100001000010000}
+\DefineLCDchar{Q}{01110100011000110001101011001001101}
+\DefineLCDchar{R}{11110100011000111110101001001010001}
+\DefineLCDchar{S}{01111100001000001110000010000111110}
+\DefineLCDchar{T}{11111001000010000100001000010000100}
+\DefineLCDchar{U}{10001100011000110001100011000101110}
+\DefineLCDchar{V}{10001100011000110001100010101000100}
+\DefineLCDchar{W}{10101101011010110101101011010101010}
+\DefineLCDchar{X}{10001100010101000100010101000110001}
+\DefineLCDchar{Y}{10001100011000101010001000010000100}
+\DefineLCDchar{Z}{11111000010001000100010001000011111}
+\DefineLCDchar{a}{00000000000111100001011111000101111}
+\DefineLCDchar{b}{10000100001011011001100011000111110}
+\DefineLCDchar{c}{00000000000111010000100001000101110}
+\DefineLCDchar{d}{00001000010110110011100011000101111}
+\DefineLCDchar{e}{00000000000111010001111111000001110}
+\DefineLCDchar{f}{00110010010100011100010000100001000}
+\DefineLCDchar{g}{00000011111000110001011110000101110}
+\DefineLCDchar{h}{10000100001011011001100011000110001}
+\DefineLCDchar{i}{00100000000110000100001000010001110}
+\DefineLCDchar{j}{00010000000011000010000101001001100}
+\DefineLCDchar{k}{10000100001001010100110001010010010}
+\DefineLCDchar{l}{01100001000010000100001000010001110}
+\DefineLCDchar{m}{00000000001101010101101011000110001}
+\DefineLCDchar{n}{00000000001011011001100011000110001}
+\DefineLCDchar{o}{00000000000111010001100011000101110}
+\DefineLCDchar{p}{00000000001111010001111101000010000}
+\DefineLCDchar{q}{00000000000110110011011110000100001}
+\DefineLCDchar{r}{00000000001011011001100001000010000}
+\DefineLCDchar{s}{00000000000111010000011100000111110}
+\DefineLCDchar{t}{01000010001110001000010000100100110}
+\DefineLCDchar{u}{00000000001000110001100011001101101}
+\DefineLCDchar{v}{00000000001000110001100010111000100}
+\DefineLCDchar{w}{00000000001010110101101011010101110}
+\DefineLCDchar{x}{00000000001000101010001000101010001}
+\DefineLCDchar{y}{00000000001000110001011110000101110}
+\DefineLCDchar{z}{00000000001111100010001000100011111}
+\DefineLCDchar{0}{01110100011001110101110011000101110}
+\DefineLCDchar{1}{00100011000010000100001000010001110}
+\DefineLCDchar{2}{01110100010000100010001000100011111}
+\DefineLCDchar{3}{11111000100010000010000011000101110}
+\DefineLCDchar{4}{00010001100101010010111110001000010}
+\DefineLCDchar{5}{11111100001111000001000011000101110}
+\DefineLCDchar{6}{00110010001000011110100011000101110}
+\DefineLCDchar{7}{11111000010001000100010000100001000}
+\DefineLCDchar{8}{01110100011000101110100011000101110}
+\DefineLCDchar{9}{01110100011000101111000010001001100}
+\DefineLCDchar{!}{00100001000010000100000000000000100}
+\DefineLCDchar{'}{01100001000100000000000000000000000}
+\DefineLCDchar{(}{00010001000100001000010000010000010}
+\DefineLCDchar{)}{01000001000001000010000100010001000}
+\DefineLCDchar{*}{00000001001010101110101010010000000}
+\DefineLCDchar{+}{00000001000010011111001000010000000}
+\DefineLCDchar{,}{00000000000000000000011000010001000}
+\DefineLCDchar{-}{00000000000000011111000000000000000}
+\DefineLCDchar{.}{00000000000000000000000000110001100}
+\DefineLCDchar{/}{00000000010001000100010001000000000}
+\DefineLCDchar{:}{00000011000110000000011000110000000}
+\DefineLCDchar{;}{00000011000110000000011000010001000}
+\DefineLCDchar{<}{00010001000100010000010000010000010}
+\DefineLCDchar{=}{00000000001111100000111110000000000}
+\DefineLCDchar{>}{10000010000010000010001000100010000}
+\DefineLCDchar{?}{01110100010000100010001000000000100}
+\DefineLCDchar{[}{01110010000100001000010000100001110}
+\DefineLCDchar{]}{01110000100001000010000100001001110}
+\DefineLCDchar{`}{01000001000001000000000000000000000}
+\DefineLCDchar{|}{00100001000010000100001000010000100}
+% \end{macrocode}
+%
+% \noindent
+% And the predefined multi-letter characters.
+% \begin{macrocode}
+\DefineLCDchar{clock}{01110100011000111101101011010101110}
+\DefineLCDchar{rarrow}{00000001000001011111000100010000000}
+\DefineLCDchar{larrow}{00000001000100011111010000010000000}
+\DefineLCDchar{Omega}{00000011101000110001010101101100000}
+\DefineLCDchar{Sigma}{11111100000100000100010001000011111}
+\DefineLCDchar{pi}{00000000001111101010010100101010011}
+\DefineLCDchar{sqrt}{00000000000011100100001001010001000}
+\DefineLCDchar{rect}{00000111111000110001100011000111111}
+\DefineLCDchar{fcur}{11111111111111111111111111111111111}
+\DefineLCDchar{lb}{00010001000010001000001000010000010}
+\DefineLCDchar{rb}{01000001000010000010001000010001000}
+\DefineLCDchar{alpha}{00000000000100110101100101001001101}
+% \end{macrocode}
+%
+% \noindent
+% The next characters normaly can't be typed dirctly, so the catcodes are
+% changed before defining them.
+% \begin{macrocode}
+\begingroup
+\catcode`\~=11 \catcode`\$=11 \catcode`\µ=11 \catcode`\°=11
+\catcode`\·=11 \catcode`\ä=11 \catcode`\ö=11 \catcode`\ü=11
+\catcode`\ß=11 \catcode`\"=11 \catcode`\#=11 \catcode`\&=11
+\catcode`\^=11 \catcode`\_=11
+\DefineLCDchar{$}{00100011111010001110001011111000100}%$
+\DefineLCDchar{#}{01010010101111101010111110101001010}
+\DefineLCDchar{µ}{00000100011000110001100111110110000}
+\DefineLCDchar{°}{11100101001110000000000000000000000}
+\DefineLCDchar{·}{00000000000000001100011000000000000}
+\DefineLCDchar{ä}{01010000000111000001011111000101111}
+\DefineLCDchar{ö}{01010000000111010001100011000101110}
+\DefineLCDchar{ü}{01010000001000110001100011001101101}
+\DefineLCDchar{ß}{00000011101000111110100011111010000}
+\DefineLCDchar{"}{01010010100101000000000000000000000}
+\DefineLCDchar{&}{01100100101010001000101011001011101}
+\DefineLCDchar{^}{00100010101000100000000000000000000}
+\DefineLCDchar{_}{00000000000000000000000000000011111}
+\DefineLCDchar{~}{00000000000000000000000000000000000}
+\catcode`\%=11
+\DefineLCDchar{%}{11000110010001000100010001001100011}
+\endgroup
+% \end{macrocode}
+%
+% ^^A---------------------------------------------
+% \subsection{Registers needed}
+% \begin{macro}{\LCDunitlength}
+% The dimen |\LCDunitlength| is described in \ref{sec:size}.
+% \begin{macrocode}
+\newlength\LCDunitlength
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@@LCDdotx}
+% The counter |\c@@LCDdotx| is used to calculate and hold the horizontal
+% position of the actual dot.
+% \begin{macrocode}
+\newcounter{@LCDdotx}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@@LCDdoty}
+% The counter |\c@@LCDdoty| is used to calculate and hold the vertical
+% position of the actual dot.
+% \begin{macrocode}
+\newcounter{@LCDdoty}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@@LCDchrx}
+% The counter |\c@@LCDchrx| holds the number of the actual character in a line,
+% beginning with zero.
+% \begin{macrocode}
+\newcounter{@LCDchrx}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@@LCDlines}
+% The counter |\c@@LCDlines| is used to check the number of lines and after
+% that the number of lines left to do is counted down there.
+% \begin{macrocode}
+\newcounter{@LCDlines}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\c@@LCDlower}
+% The counter |\c@@LCDlower| is used to lower the LCD contents in normal text.
+% For |\LCD| it is set to zero, which means the contents isn't lowered. For
+% |\textLCD| it is set to two, so the baselines of LCD contents and surrounding
+% text will fit.
+% \begin{macrocode}
+\newcounter{@LCDlower}
+% \end{macrocode}
+% \end{macro}
+%
+% ^^A---------------------------------------------
+% \subsection{Setups and Defaults}
+% \begin{macro}{\LCDframe}
+% \begin{macro}{\@LCDbox}
+% The macro |\LCDframe| (see \ref{sec:frame}) sets the internal macro
+% |\@LCDbox| to |\framebox|, so frames will be drawn.
+% \begin{macrocode}
+\newcommand*\LCDframe{\let\@LCDbox\framebox}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\LCDnoframe}
+% \begin{macro}{\@LCDbox}
+% The macro |\LCDnoframe| (see \ref{sec:frame}) sets the internal macro
+% |\@LCDbox| to |\makebox|, so frames will not be drawn.
+% \begin{macrocode}
+\newcommand*\LCDnoframe{\let\@LCDbox\makebox}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\LCDcolors}
+% \begin{macro}{\@LCDfr}
+% \begin{macro}{\@LCDfg}
+% \begin{macro}{\@LCDbg}
+% The macro |\LCDcolors| (see \ref{sec:color}) defines three internal macros.
+% |\@LCDfr| will be the framecolor, |\@LCDfg| will be the foregroundcolor and
+% |\@LCDbg| will be the backgroundcolor.
+% \begin{macrocode}
+\newcommand*\LCDcolors[3][black]{%
+ \def\@LCDfr{#1}\def\@LCDfg{#2}\def\@LCDbg{#3}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \noindent
+% And now setting up the defaults.
+% \begin{macrocode}
+\setlength\LCDunitlength{0.5mm}
+\LCDframe
+\LCDcolors{black}{white}
+% \end{macrocode}
+%
+% \noindent
+% If the color package is not loaded the macros |\color| and |\colorbox| are
+% defined, because they are used in |\@LCDstart|.
+% \begin{macrocode}
+\AtBeginDocument{
+ \@ifundefined{color}{\def\color#1{}}{}
+ \@ifundefined{colorbox}{\def\colorbox#1#2{#2}}{}}
+% \end{macrocode}
+%
+% ^^A---------------------------------------------
+% \subsection{Drawing}
+% \begin{macro}{\@DrawLCDDot}
+% The macro |\@DrawLCDDot| draws a single dot of a character.
+% \begin{macrocode}
+\newcommand*\@DrawLCDDot{%
+ \put(\the\c@@LCDdotx,\the\c@@LCDdoty.35){\line(1,0){0.7}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@DrawLCDRow}
+% The macro |\@DrawLCDRow| draws one dot line of a character. The parameters
+% are five zeros or ones from the character matrix (see \ref{sec:def}).
+% \begin{macrocode}
+\newcommand*\@DrawLCDRow[5]{%
+ \def\@tempa{#1}\if\@tempa0\relax\else\@DrawLCDDot\fi\stepcounter{@LCDdotx}%
+ \def\@tempa{#2}\if\@tempa0\relax\else\@DrawLCDDot\fi\stepcounter{@LCDdotx}%
+ \def\@tempa{#3}\if\@tempa0\relax\else\@DrawLCDDot\fi\stepcounter{@LCDdotx}%
+ \def\@tempa{#4}\if\@tempa0\relax\else\@DrawLCDDot\fi\stepcounter{@LCDdotx}%
+ \def\@tempa{#5}\if\@tempa0\relax\else\@DrawLCDDot\fi
+ \addtocounter{@LCDdotx}{-4}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@DrawLCDRows}
+% The macro |\@DrawLCDRows| draws all seven dot rows of a character. It is
+% first called with the complete character matrix (see \ref{sec:def}). The
+% first five zeros or ones will be the parameters |#1| to |#5|, which are passed
+% to |\@DrawLCDRow|. The parameter |#6| takes the rest of the character matrix.
+% |\@DrawLCDRows| is called recursively until the whole matrix is processed.
+% \begin{macrocode}
+\def\@DrawLCDRows#1#2#3#4#5#6\@@end{%
+ \@DrawLCDRow#1#2#3#4#5\addtocounter{@LCDdoty}{-1}%
+ \def\@tempa{#6}\ifx\@tempa\@empty\else\@DrawLCDRows#6\@@end\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@DrawLCDchar}
+% At first in |\@DrawLCDchar| the position of the upper left dot of the
+% character is calculated. Then |\@DrawLCDRows| is called with the already
+% expanded character matrix. The parameters are the position of the character
+% in x- (|#1|) and y-direction (|#2|) and the character to draw (|#3|). Note:
+% the positions of the characters are beginning with 0,0 in the lower left
+% corner.
+% \begin{macrocode}
+\newcommand*\@DrawLCDchar[3]{%
+ \setcounter{@LCDdotx}{#1}\multiply\c@@LCDdotx 6\addtocounter{@LCDdotx}{2}%
+ \setcounter{@LCDdoty}{#2}\multiply\c@@LCDdoty 10\addtocounter{@LCDdoty}{8}%
+ \expandafter\expandafter\expandafter
+ \@DrawLCDRows\csname @LCD@#3\endcsname\@@end}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@DrawLCDchars}
+% The macro |\@DrawLCDchars| draws all characters of a LCD-line. First spaces
+% are skiped. In |\c@@LCDchrx| the characters x-position is counted (beginning
+% with zero). |\@DrawLCDchars| is first called with the line positon (zero for
+% the lowest line) as parameter |#1| and the whole line text. Here the first
+% character becomes parameter |#2| and the rest parameter |#3|.
+% |\@DrawLCDchars| is called recursively with the line positon and the rest of
+% the line text until all characters are processed.
+% \begin{macrocode}
+\def\@DrawLCDchars#1#2#3\@@end{%
+ \def\@tempa{#2}\if\@tempa\space\else\@DrawLCDchar{\the\c@@LCDchrx}{#1}{#2}\fi
+ \stepcounter{@LCDchrx}%
+ \def\@tempa{#3}\ifx\@tempa\@empty\else\@DrawLCDchars{#1}#3\@@end\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@DrawLCDLine}
+% In |\@DrawLCDLine| |\c@@LCDchrx| is set to zero and the initial call of
+% |\@DrawLCDchars| is done, but only if |#2| is not empty. The parameters
+% are the line position (|#1|) and the
+% complete line text (|#2|).
+% \begin{macrocode}
+\newcommand*\@DrawLCDLine[2]{%
+ \def\@tempa{#2}\ifx\@tempa\@empty\else
+ \setcounter{@LCDchrx}{0}%
+ \@DrawLCDchars{#1}#2\@@end\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% ^^A---------------------------------------------
+% \subsection{Help Macros}
+% \begin{macro}{\if@textLCD}
+% \begin{macro}{\@textLCDtrue}
+% \begin{macro}{\@textLCDfalse}
+% In |\textLCD| the picture height is reduced by the height of the upper
+% border, otherwise there would be extra space over the actual line. But
+% the height of the box for colored background must not be reduced.
+% The boolean |\if@textLCD| is needed to distinguish if the background box
+% has to be corrected or not.
+% \begin{macrocode}
+\newif\if@textLCD
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@LCDstart}
+% The macro |\@LCDstart| starts the picture environment, sets the colors,
+% draws the frame if wanted and fixes the height of the bachground box
+% if necessary.
+% \begin{macrocode}
+\newcommand*\@LCDstart{\unitlength\LCDunitlength
+ \begin{picture}(\the\@tempcntb.7,\the\@tempcnta.7)(0,\the\c@@LCDlower)
+ \color{\@LCDfr}
+ \if@textLCD\advance\@tempcnta 2\fi
+ \put(0,0){\fboxsep\z@\colorbox{\@LCDbg}{\@LCDbox(\the\@tempcntb.7,\the\@tempcnta.7){}}}
+ \color{\@LCDfg}
+ \linethickness{0.7\unitlength}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@LCDend}
+% The macro |\@LCDend| only ends the picture environment.
+% \begin{macrocode}
+\newcommand*\@LCDend{\end{picture}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do@LCDspecials}
+% The macro |\do@LCDspecials| sets new catcodes for the characters that
+% normaly can't be typed dirctly.
+% \begin{macrocode}
+\newcommand*\do@LCDspecials{%
+ \catcode`\~=11 \catcode`\$=11 \catcode`\µ=11 \catcode`\°=11
+ \catcode`\·=11 \catcode`\ä=11 \catcode`\ö=11 \catcode`\ü=11
+ \catcode`\ß=11 \catcode`\"=11 \catcode`\&=11 \catcode`\#=11
+ \catcode`\^=11 \catcode`\_=11 \catcode`\%=11 \obeyspaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\calc@LCDsize}
+% In |\calc@LCDsize| only the size of the picture environment is calculated.
+% \begin{macrocode}
+\newcommand*\calc@LCDsize[2]{\@tempcnta#1\multiply\@tempcnta10\relax
+ \@tempcntb#2\multiply\@tempcntb6\advance\@tempcntb2\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% ^^A---------------------------------------------
+% \subsection{The Main Macros}
+% \begin{macro}{\textLCDcorr}
+% The macro |\textLCDcorr| provides the ability to change the default of the
+% first parameter of |\textLCD| to the user. Here it is defined to be the value
+% needed for white background.
+% \begin{macrocode}
+\newcommand*\textLCDcorr{-2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\textLCD}
+% Everything in |\textLCD| is done within a group (ended in |\@textLCD|), so
+% changes to registers, macros and catcodes are local. The parameters |#1| and
+% |#2| are described in \ref{sec:mac}. Parameter |#3| takes the first
+% \meta{delimchar}, needed to define |\@textLCD|.
+%
+% First, some setups are done here and |\LCDunitlength| is calculated so that
+% the height of \param{LCDtext} fits to the surrounding text.
+% \begin{macrocode}
+\newcommand*\textLCD[3][\textLCDcorr]{\begingroup
+ \LCDnoframe\settoheight{\LCDunitlength}{M}%
+ \setlength{\LCDunitlength}{0.146342\LCDunitlength}%
+ \setcounter{@LCDlower}{2}\setcounter{@LCDlines}{1}%
+% \end{macrocode}
+% The first |\hspace| corrects the space before \param{LCDtext}, which will
+% always be to large without it. The second and the one at the end of
+% |\@textLCD| are needed to shrink the spaces around \param{LCDtext} if the
+% background color is white.
+% \begin{macrocode}
+ \hspace{-.25em}\hspace{#1\LCDunitlength}%
+% \end{macrocode}
+% After calculating the picture size its height is reduced to prevent wrong
+% linespacing.
+% \begin{macrocode}
+ \calc@LCDsize{1}{#2}\advance\@tempcnta-2\@textLCDtrue\do@LCDspecials
+% \end{macrocode}
+% \begin{macro}{\@textLCD}
+% Now |\@textLCD| can be defined so that the \meta{delimchar} (|#3|) denotes
+% the end of its parameter which is taken as \param{LCDtext}. The macro is
+% called at the very end of |\textLCD|, so its parameter begins with the first
+% character after the leading \meta{delimchar}.
+% \begin{macrocode}
+ \def\@textLCD##1#3{\@LCDstart
+ \@DrawLCDLine{0}{##1}\@LCDend\hspace{#1\LCDunitlength}\endgroup}
+ \@textLCD}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\LCD}
+% Also in |\LCD| everything is done within a group (ended in |\@LCDlast|) to
+% keep changes to registers, macros and catcodes local, which are done for
+% setup.
+%
+% The parameters |#1| and |#2| are described in \ref{sec:mac}. Parameter |#3|
+% takes the first \meta{delimchar}, needed to define |\@LCD| and |\@LCDlast|.
+% \begin{macrocode}
+\newcommand*\LCD[3]{\begingroup
+ \setcounter{@LCDlower}{0}\setcounter{@LCDlines}{#1}%
+% \end{macrocode}
+% Here the number of lines given is tested and corrected if necessary (and
+% other setups are done).
+% \begin{macrocode}
+ \ifnum\c@@LCDlines<1\setcounter{@LCDlines}{1}\fi
+ \calc@LCDsize{\c@@LCDlines}{#2}\@textLCDfalse\do@LCDspecials
+% \end{macrocode}
+% \begin{macro}{\@LCDlast}
+% Now |\@LCDlast| is defined so that the \meta{delimchar} (|#3|) denotes the
+% end of its parameter which is taken as \param{LCDtext}. It only handles the
+% last line.
+% \begin{macrocode}
+ \def\@LCDlast##1#3{\@DrawLCDLine{0}{##1}\@LCDend\endgroup}
+% \end{macrocode}
+% \begin{macro}{\@LCD}
+% The macro |\@LCD| handles all lines expect the last. The number of lines left
+% to do are counted down here. Parameter |##1| is taken as \param{LCDtext},
+% parameter |##2| takes everything between the ending \meta{delimchar} of an
+% LCD-line and the leading one of the next. Because |##2| is not used, things
+% between two LCD-lines are ignored. Note: due to the fact that |%| is catcoded
+% to 11 when calling |\@LCD|, comments are not possible.
+% \begin{macrocode}
+ \def\@LCD##1#3##2#3{%
+ \addtocounter{@LCDlines}{-1}\@DrawLCDLine{\c@@LCDlines}{##1}
+% \end{macrocode}
+% \begin{macro}{\@LCDnext}
+% If there is more then one line to process |\@LCDnext| is set to |\@LCD|,
+% else to |\@LCDlast|.
+% \begin{macrocode}
+ \ifnum\c@@LCDlines>1\let\@LCDnext\@LCD\else
+ \let\@LCDnext\@LCDlast\fi\@LCDnext}
+% \end{macrocode}
+% \begin{macro}{\@LCDnext}
+% Here |\@LCDnext| is set the first time. It's called at the very end of |\LCD|,
+% so the (first) parameter of |\@LCD| or |\@LCDlast| begins with the first
+% character after the leading \meta{delimchar}.
+% \begin{macrocode}
+ \ifnum\c@@LCDlines>1\let\@LCDnext\@LCD\else\let\@LCDnext\@LCDlast\fi
+ \@LCDstart\@LCDnext}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \Finale\endinput
+%</package>
+% ^^A Now the source of the example
+%<*example>
+\documentclass[a4paper]{article}
+\usepackage[latin1]{inputenc}
+\usepackage{color}
+\usepackage{lcd}
+
+\parindent0pt
+\parskip1ex plus.3ex minus.2ex
+\pagestyle{empty}
+
+\newcommand\lcd{\textLCD{3}|LCD|}
+\newcommand\bs{\char '134 }
+\definecolor{lightgreen}{rgb}{0.05,0.97,0.55}
+\definecolor{darkgreen}{rgb}{0.22,0.26,0.19}
+\definecolor{lightblue}{rgb}{0.9,0.91,0.99}
+\definecolor{darkblue}{rgb}{0.14,0.2,0.66}
+\definecolor{lightred}{rgb}{1.0,0.27,0.37}
+\definecolor{darkred}{rgb}{0.37,0.14,0.18}
+
+\DefineLCDchar{euro}{00111010001111101000111110100000111}
+
+\begin{document}
+\centerline{\textbf{\LARGE Some Examples for the \lcd\ package.\footnote{The
+source of this example file is part of \texttt{lcd.dtx}.}}}
+
+As seen in the headline and here, the \lcd\ package calculates the size for
+LCD-text in normal text (\verb|\textLCD|) automaticly. It works for all
+fontsizes:
+
+\begin{center}
+{\tiny MM M \lcd\ M MM tiny}\hfill{\Huge Huge MM M \lcd\ M MM}
+
+{\scriptsize MM M \lcd\ M MM scriptsize}\hfill{\huge huge MM M \lcd\ M MM}
+
+{\footnotesize MM M \lcd\ M MM footnotesize}\hfill{\LARGE LARGE MM M \lcd\ M MM}
+
+{\small MM M \lcd\ M MM small}\hfill{\Large Large MM M \lcd\ M MM}
+
+{\normalsize MM M \lcd\ M MM normalsize}\hfill{\large large MM M \lcd\ M MM}
+\end{center}
+
+Now let's have some colored
+\LCDcolors{darkgreen}{lightgreen}\textLCD[0]{8}|LCD-text|.
+Here first the colors where set with
+\verb|\LCDcolors{darkgreen}{lightgreen}|\footnote{The color names where
+defined with \texttt{\bs definecolor} from the \textsf{color} package in the
+preamble.}
+and then the LCD-text where done with \verb+\textLCD[0]{8}|LCD-text|+.
+To invert the LCD, just exchange the
+\LCDcolors{lightgreen}{darkgreen}\textLCD[0]{6}|colors|
+(\verb|\LCDcolors{lightgreen}{darkgreen}|).
+
+\begin{minipage}[t]{.5\textwidth}
+Now some seperate LCD representations. But first let's change the colors
+to some not as ugly. The LCD was generated with
+\begin{verbatim}
+\LCD{4}{18}|LCD representation|
+ |made with the LCD |
+ |package for LaTeX |
+ |04.01.2004 {clock} 18:23|
+\end{verbatim}
+\end{minipage}
+\hspace{\fill}
+\begin{minipage}[t]{.46\textwidth}
+\mbox{}
+
+\LCDcolors{darkblue}{lightblue}%
+\LCD{4}{18}|LCD representation|
+ |made with the LCD |
+ |package for LaTeX |
+ |04.01.2004 {clock} 18:23|
+\end{minipage}
+
+The \verb|{clock}| is a so called multi-letter character. It generates the
+clock symbol.
+
+As you can see, there is a black colored frame around it. The frame color
+can be changed with the optional first argument of \verb|\LCDcolors|
+(\verb|\LCDcolors[red]|\ldots; left part of figure 1). And
+with \verb|\LCDnoframe| you can disable frames (reenabled with
+\verb|\LCDframe|; right part of figure 1).
+Of course \verb|\LCD| works within a figure environment.
+
+\begin{figure}[h]
+\LCDcolors[red]{darkblue}{lightblue}%
+\LCD{4}{18}|LCD representation|
+ |made with the LCD |
+ |package for LaTeX |
+ |04.01.2004 {clock} 18:45|
+\hspace{\fill}\LCDnoframe
+\LCD{4}{18}|LCD representation|
+ |made with the LCD |
+ |package for LaTeX |
+ |04.01.2004 {clock} 18:47|
+\caption{Example with red colored frame and without frame}
+\end{figure}
+
+\LCDcolors[lightgreen]{lightred}{darkred}\LCDframe
+\LCD{2}{36}|For more information please refer to|
+ |the documentation! |
+\end{document}
+%</example>
diff --git a/Master/texmf-dist/source/latex/lcd/lcd.ins b/Master/texmf-dist/source/latex/lcd/lcd.ins
new file mode 100644
index 00000000000..9c595c4b10a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/lcd/lcd.ins
@@ -0,0 +1,67 @@
+%%
+%% 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 (c) 2004 Mike Kaufmann, all rights reserved
+%%
+%% This program is provided under the terms of the
+%% LaTeX Project Public License distributed from CTAN
+%% archives in directory macros/latex/base/lppl.txt.
+%%
+%% Author: Mike Kaufmann
+%% Mike.Kaufmann@ei.fh-giessen.de
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+
+\input docstrip.tex
+
+% some macros for conditional generation of example files
+\newif\ifaskforexample
+\newif\ifgenerateexample
+\generateexampletrue
+\askforexampletrue
+% \generateexample \askforexample then
+% true false generate example
+% true true ask and generate only if answer is y/yes
+% false don' care do not generate
+\def\generateExample#1{%
+ \ifgenerateexample
+ \ifaskforexample
+ \Ask\answer{^^JThere is an example file in \jobname.dtx.^^JGenerate it? [y/n]}
+ \ifx\answer\y \generate{#1}\else
+ \ifx\answer\yes \generate{#1}\fi\fi
+ \else\generate{#1}\fi\fi}
+
+\preamble
+
+Copyright (c) 2004 Mike Kaufmann, all rights reserved
+
+This program is provided under the terms of the
+LaTeX Project Public License distributed from CTAN
+archives in directory macros/latex/base/lppl.txt.
+
+Author: Mike Kaufmann
+ Mike.Kaufmann@ei.fh-giessen.de
+
+\endpreamble
+
+\generate{\file{lcd.sty}{\from{lcd.dtx}{package}}}
+\generateExample{\file{example.tex}{\from{lcd.dtx}{example}}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space lcd.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the files ending with}
+\Msg{* `.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/mailing/mailing.dtx b/Master/texmf-dist/source/latex/mailing/mailing.dtx
new file mode 100644
index 00000000000..01aabfcfd43
--- /dev/null
+++ b/Master/texmf-dist/source/latex/mailing/mailing.dtx
@@ -0,0 +1,307 @@
+% \iffalse meta-comment
+%
+% Copyright 1994-2004 Johannes Braams. All rights reserved.
+%
+% This file is part of the mailing package.
+% -----------------------------------------
+%
+% 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 mailing package is
+% given in the file `manifest.txt'.
+%
+% 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{157}
+%
+%\iffalse
+%% Copyright (C) 1999-2004 Johannes L. Braams texniek at braams.cistron.nl
+%%
+%%
+%<*dtx>
+\ProvidesFile{mailing.dtx}
+%</dtx>
+\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{mailing}
+%<driver>\ProvidesFile{mailing.drv}
+%\fi
+%\ProvidesFile{mailing}
+ [2004/02/20 v1.0b Send letters to multiple addresses]
+%\iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\begin{document}
+\pagestyle{myheadings}
+\DocInput{mailing.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+% \GetFileInfo{mailing}
+% \title{Creating a mailing}
+% \author{Johannes Braams}
+% \date{september 7, 1994}
+% \maketitle
+%
+% \markboth
+% {mailing package version \fileversion\space as of \filedate}
+% {mailing package version \fileversion\space as of \filedate}
+%
+% \section{Introduction}
+%
+% This package is intended to be used when you want to send a large
+% number of letters, all with (almost) the same text.
+%
+% This package is based on the former style option \texttt{merge}
+% by Graeme McKinstry, but is is a reimplementation with a
+% different user interface.
+%
+% \section{The user interface}
+%
+% \DescribeMacro{\addressfile}
+% The commands |\addressfile| takes a filename as its argument.
+% When the file can't be found by \LaTeX, the user will be asked to
+% supply a different name.
+%
+% The address file should have the following format:
+% \begin{verbatim}
+%Name of addressee
+%Street\\town
+%Opening text of the letter
+%(optional definitions)
+%<blank line>
+%Name of addressee
+%Street\\town
+%Opening text of the letter
+%(optional definitions)
+%<blank line>
+%...
+% \end{verbatim}
+% The various addresses are separated by a blank line in the file
+% (multiple blank lines in between addresses are allowed).
+% It is also possible to have multiple lines with definitions; they
+% will all be executed.
+%
+% \DescribeMacro{\mailingtext}
+% The text of the mailing is entered as the argument of
+% |\mailingtext|. A difference with the original \texttt{merge.sty}
+% is that this package allows control sequences in the argument of
+% |\mailingtext|. These control sequences should then be defined in
+% the file with the address information.
+%
+% \DescribeMacro{\makemailing}
+% When |\makemailing| is called the letters are produced, combining
+% the information found in the address file with the text of the
+% mailing.
+%
+% \StopEventually{}
+%
+% \section{The implementation}
+%
+% \subsection{User interface}
+%
+% \begin{macro}{\addressfile}
+% The argument to |\adressfile| is the name of the file with the
+% address information.
+% \begin{macrocode}
+\newcommand{\addressfile}[1]{%
+ \def\M@filename{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mailingtext}
+% The argument to this macro contains the entire text of the
+% mailing. The text may contain control sequences to be able to
+% make variations in the text.
+% \begin{macrocode}
+\long\def\mailingtext#1{\global\mailing@text={#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\makemailing}
+% The command |\makemailing| will produce the mailing, reading
+% addresses, openings and optional definitions of variable text
+% parts from an external file.
+% \begin{macrocode}
+\def\makemailing{%
+ \M@openadrfile
+ \loop
+ \read@info
+ \if@notready
+ \begin{letter}{\M@toname\\\M@toaddress}%
+ \opening{\M@opening}%
+ \vskip\baselineskip
+ \the\mailing@text
+ \end{letter}
+ \fi
+ \if@notready
+ \repeat}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Allocations}
+%
+% \begin{macro}{\M@adrfile}
+% We need to allocate an input stream for the file with the address
+% information.
+% \begin{macrocode}
+\newread\M@adrfile
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mailing@text}
+% The contents of the letter are stored in a token register
+% \begin{macrocode}
+\newtoks\mailing@text
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@notready}
+% A switch which indicates if the file |\M@adrfile| has been
+% exhausted.
+% \begin{macrocode}
+\newif\if@notready
+\newif\if@notemptyoreof
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Internal macros}
+%
+% \begin{macro}{\M@openadrfile}
+% The macro |\M@openadrfile| tries to open |\M@filename|. It that
+% doesn't succeed it asks the user to supply a new name. This is
+% done untill a file is found.
+% \begin{macrocode}
+\def\M@openadrfile{%
+ \openin\M@adrfile\M@filename\relax
+ \ifeof\M@adrfile
+ \loop
+ %\PackageWarning{mailing}{I can't find the file \M@filename}
+ \typeout{I can't find the file \M@filename!}
+ \closein\M@adrfile
+ \typein[\M@filename]{Enter a new name}
+ \openin\M@adrfile\M@filename
+ \ifeof\M@adrfile
+ \repeat
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\read@info}
+% The macro |\read@info| takes care of the reading of all the
+% information from |\M@adrfile|, needed to format another letter.
+% \begin{macrocode}
+\def\read@info{%
+ \skip@empty@lines
+% \end{macrocode}
+% The macro |\skip@empty@lines| leaves the non-empty line it found
+% in |\M@lines|. If it found an end of file condition the
+% |\if@notready| flag will be set to |\iffalse|.
+% \begin{macrocode}
+ \if@notready
+ \let\M@toname\M@line
+ \read\M@adrfile to\M@toaddress
+ \read\M@adrfile to\M@opening
+ \test@eof
+ \if@notready\read@defs\fi
+ \fi
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\read@defs}
+% Reads definitions of control sequences from the file |\M@adrfile|
+% until either an empty line is found or the end of file is
+% reached. Each line is stored in a control sequence and it is
+% executed after all definitions are read.
+% \begin{macrocode}
+\def\read@defs{%
+ \def\M@defns{}%
+ {\loop
+ \endlinechar=-1
+ \read\M@adrfile to\M@line
+ \endlinechar=`\^^M
+% \end{macrocode}
+% We need to get the expansion of |\M@line| into the definition of
+% |\M@defns|, not |\M@line| itself. Therefore |\M@line| is expanded
+% before |\M@defns|.
+% \begin{macrocode}
+ \expandafter\toks@\expandafter\expandafter
+ \expandafter{\expandafter\M@defns\M@line}%
+ \xdef\M@defns{\the\toks@}%
+ \test@emptyoreof
+ \if@notemptyoreof
+ \repeat}%
+ \M@defns
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\test@eof}
+% The macro |\test@eof| tests the status of of the input file.
+% \begin{macrocode}
+\def\test@eof{%
+ \ifeof\M@adrfile
+ \@notreadyfalse
+ \else
+ \@notreadytrue
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\test@emptyoreof}
+% The macro |\test@emptyoreof| checks whether we reached an empty
+% line \emph{or} the end of the file.
+% \begin{macrocode}
+\def\test@emptyoreof{%
+ \@notemptyoreoftrue
+ \ifx\M@line\@empty
+ \global\@notemptyoreoffalse
+ \fi
+ \ifeof\M@adrfile
+ \global\@notemptyoreoffalse
+ \global\@notreadyfalse
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\skip@empty@lines}
+% This macro skips empty lines until it finds either a non-empty
+% line or the end of the file. If necessary it sets the
+% |\if@notready| flag. The last line read is left in |\M@line|.
+% \begin{macrocode}
+\def\skip@empty@lines{%
+ {\loop
+ \endlinechar=-1
+ \ifeof\M@adrfile
+ \global\@notreadyfalse
+ \@tempswafalse
+ \else
+ \global\@notreadytrue
+ \global\read\M@adrfile to\M@line
+ \ifx\M@line\@empty
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+ \fi
+ \if@tempswa
+ \repeat}%
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/mailing/mailing.ins b/Master/texmf-dist/source/latex/mailing/mailing.ins
new file mode 100644
index 00000000000..b9143a89b68
--- /dev/null
+++ b/Master/texmf-dist/source/latex/mailing/mailing.ins
@@ -0,0 +1,86 @@
+%%
+%% 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-2004 Johannes L. Braams. All rights reserved.
+%%
+%% This file is part of the mailing package.
+%% ------------------------------------------
+%%
+%% 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 mailing package is
+%% given in the file `manifest.txt.
+%%
+%% 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 ------------------
+%%
+% ignored commands
+\def\filedate{2004/02/20}
+\def\batchfile{mailing.ins}
+\input docstrip.tex
+
+
+% package file
+
+\preamble
+
+Copyright (C) 1999-2004 Johannes Braams. All rights reserved.
+
+This file was generated from file(s) of the mailing package.
+------------------------------------------------------------
+
+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
+mailing package. You may however distribute the mailing package
+without such generated files.
+
+The list of all files belonging to the mailing package is
+given in the file `manifest.txt.
+
+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
+
+\generateFile{mailing.sty}{t}{\from{mailing.dtx}{package}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space smailing.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file mailing.dtx}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/method/method.dtx b/Master/texmf-dist/source/latex/method/method.dtx
new file mode 100644
index 00000000000..13f6b38ec6e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/method/method.dtx
@@ -0,0 +1,845 @@
+% \iffalse Meta-Kommentar
+%
+% Copyright 1997, 1998, 1998, 1999
+% Thomas Leineweber
+% Lehrstuhl VI, Fachbereich Informatik,
+% Universitaet Dortmund
+% (leineweb@ls6.cs.uni-dortmund.de)
+%
+% This package is based on work by J. Wahlmann and R. Garmann.
+% I took their package and enhanced it.
+%
+% Enhancements provided by
+% Jean-Pierre Drucbert
+%
+% This is the documented macrocode for the generation and
+% documentation of the package `method'.
+%
+% This file may be distributed under the terms of the LaTeX Project Public
+% License, as described in lppl.txt in the base LaTeX distribution.
+% Either version 1.0 or, at your option, any later version.
+%
+% \fi
+%
+% \CheckSum{787}
+%% \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 \~}
+%
+% \title{\LaTeX-package for an easy declaration of functions and variables}
+% \author{Thomas Leineweber}
+% \maketitle
+%
+% \changes{v1.0}{????/??/??}{First version by J. Wahlmann}
+% \changes{v1.1}{1995/10/17}{Facelifting by R. Garmann}
+% \changes{v1.1}{1995/10/18}{Facelifting by R. Garmann}
+% \changes{v1.1}{1995/10/19}{New environment data for variables}
+% \changes{v1.1}{1995/10/19}{init and del for the environment data added}
+% \changes{v1.1}{1995/10/25}{Test for the use of the special commands
+% outside the environments}
+% \changes{v1.2}{1997/06/25}{Change documentation to a dtx-file}
+% \changes{v1.3}{1997/06/29}{Documentation changes}
+% \changes{v1.6}{1999/01/04}{Documentation changes}
+% \changes{v1.7}{1999/01/28}{Documentation changes}
+% \changes{v1.7}{1999/01/28}{First parts for internationalization}
+% \changes{v1.8}{1999/02/04}{Change standard to english}
+% \changes{v2.0}{1999/02/05}{First public version with
+% internationalization and localization for english and german}
+% \changes{v2.0b}{1999/03/25}{Change licencse to lppl}
+%
+% \section{Overview}
+% The package method can be used to easily format method- and
+% variabledeclarations with \LaTeX.
+% It is based on work by J. Wahlmann and Robert Garmann.
+%
+%\section{Usage}
+% The package is used as usual:
+%\begin{quote}
+% |\usepackage[<language>]{method}|
+%\end{quote}
+% It defines two new environments: method and data. Method is used to
+% typeset method-declarations, data for variable-declarations.
+% At the moment the two options \textsf{english} and \textsf{german}
+% are defined. With these options it is possible to select the language
+% used to typeset the declarations. In the future some other languages
+% will be added.
+%
+%\section{The environment method}
+% \DescribeEnv{method}
+% Within the environment
+% method the following commands are defined:
+%
+%\begin{itemize}
+%\item \DescribeMacro{\head}
+% \cs{head}\texttt{\{\emph{Header}\}:} The header of the method.
+%\item \DescribeMacro{\para}
+% \cs{para}\texttt{\{\emph{Name}\}\{\emph{Description}\}:}
+% Name and description of a parameter.
+%\item \DescribeMacro{\precond}
+% \cs{precond}\texttt{\{\emph{Precondition}\}:}
+% Description of a precondition of the method.
+%\item \DescribeMacro{\descr}
+% \cs{descr}\texttt{\{\emph{Description}\}:}
+% Description of the method itself.
+%\item \DescribeMacro{\postcond}
+% \cs{postcond}\texttt{\{\emph{postcondition}\}:}
+% Description of a postcondition of the method.
+%\item \DescribeMacro{\error}
+% \cs{error}\texttt{\{\emph{Exception}\}:} Error and exceptions.
+%\item \DescribeMacro{\return}
+% \cs{return}\texttt{\{\emph{Return value}\}:}
+% Description of the data returned by the method.
+%\item \DescribeMacro{\see}
+% \cs{see}\texttt{\{\emph{where}\}:} Cross-References.
+%\end{itemize}
+%
+%These commands have the following in common:
+%\begin{itemize}
+%\item All parameters are simple texts.
+%\item The sequence of the commands inside the method-environment is
+% not relevant. The parts are typeset automatically.
+%\item Up to 26 \cs{para}-commands are allowed inside a method
+% environment. When there are more, a warning will be issued und the
+% following parameters will be ignored.
+%\item The header of the method and the parameters are typeset in a
+%typewriter font.
+%\item If the header is extremely long, it can be typeset in more
+%lines with the following macros (an example is given further down):
+%\begin{verbatim}
+% \headtabbed{<functionname>} Name of the function
+% \headpara{<parametername>} one or more parameter
+%\end{verbatim}
+%\end{itemize}
+%
+%\section{The environment data} \DescribeEnv{data}
+% The environment data equals to the environment method. The macros
+% \cs{head}, \cs{descr} and \cs{see} can also be used inside a
+% data-environment.
+% Further macros inside a data-environment are:
+%\begin{itemize}
+%\item \DescribeMacro{\init}
+% \cs{init}\texttt{\{\emph{Info}\}:} Information about the generation
+% of the objekt.
+%\item \DescribeMacro{\del}
+% \cs{del}\texttt{\{\emph{Info}\}:} Information about the release of
+% the object.
+%\end{itemize}
+%
+%\section{Examples}
+%In this section some examples for the usage of the environments
+%method and data are shown.
+%\begin{verbatim}
+% \begin{method}
+% \head{int div(int a, int b, double \&c);}
+% \para{a}{dividend}
+% \para{b}{divisor}
+% \para{\&c}{result of the division}
+% \precond{no preconditions}
+% \descr{Divides \texttt{a} by \texttt{b} and gives the result
+% in \texttt{c}}
+% \postcond{no postconditions}
+% \error{no errors}
+% \return{\texttt{-1}, when \texttt{b==0}, else \texttt{0}}
+% \see{your favourite mathematics book}
+% \end{method}
+%
+% \begin{method}
+% \headtabbed{PrimObject(}
+% \headpara{const Matrix transformation,}
+% \headpara{AbstGeometry *geometry = 0,}
+% \headpara{MaterialApplication *material = 0,}
+% \headpara{AbstBumpMap *bumpMap = 0,}
+% \headpara{Distribution *distribution = 0);}
+% \para{transformation}{Transformation matrix}
+% \para{*geometry}{\ldots}
+% \descr{\ldots}
+% \end{method}
+%
+% \begin{data}
+% \head{char *name}
+% \descr{Name of the user}
+% \end{data}
+% \begin{data}
+% \head{char *no}
+% \descr{Telephone-number of the user}
+% \see{Telephone Book}
+% \end{data}
+%\end{verbatim}
+%
+% \StopEventually
+%
+% \section{Identification und documentation}
+%
+% This package can only be used with \LaTeXe. Therefore make sure,
+% we use no other \TeX-format.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+% \end{macrocode}
+%
+% Show the name of the package and its version
+% \begin{macrocode}
+%<+method>\ProvidesPackage{method}
+%<+method> [1999/03/25 v2.0b
+%<+method> LaTeX-package for method- and
+%<+method> data-descriptions (TL)]
+% \end{macrocode}
+%
+%
+% We have a specialized class for the documentation.
+% \begin{macrocode}
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+% \end{macrocode}
+% Set the specific options for the documentation of the package.
+% \begin{macrocode}
+\DoNotIndex{\",\\,\addtolength,\begin,\CodelineIndex,\CodelineNumbered}
+\DoNotIndex{\def,\DocInput,\documentclass,\DoNotIndex,\EnableCrossrefs}
+\DoNotIndex{\end,\fbox,\fboxrule,\hfill,\hspace,\ifcase,\or,\fi}
+\DoNotIndex{\ifnum,\fi,\item,\itemindent,\labelsep,\labelwidth}
+\DoNotIndex{\leftmargin,\listparindent,\NeedsTeXFormat,\newcommand}
+\DoNotIndex{\newcount,\newcounter,\newenvironment,\newlength,\sloppy}
+\DoNotIndex{\nopagebreak,\PackageError,\parbox,\parindent,\stepcounter}
+\DoNotIndex{\PrintChanges,\PrintIndex,\ProvidesPackage,\RecordChanges}
+\DoNotIndex{\setcounter,\setlength,\textbf,\texttt,\usepackage,\vspace}
+\DoNotIndex{\settowidth,\textwidth,\topsep}
+\CodelineNumbered
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+\setcounter{StandardModuleDepth}{1}
+\usepackage[T1]{fontenc}
+\usepackage[latin1]{inputenc}
+% \end{macrocode}
+% Give all details.
+% \begin{macrocode}
+\begin{document}
+\DocInput{method.dtx}
+\PrintIndex
+\PrintChanges
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+%
+%\section{Package internals}
+%
+% At the start of a method-environment the actual textwidth is read
+% and saved for the layout of the description.
+%
+% The commands for the parts, namely \cs{head}, \cs{para},
+% \cs{precond}, ..., define
+% internal commands with the names \cs{meth@head}, \cs{meth@pa},
+% \cs{meth@pb}, ..., \cs{meth@pz},
+% \cs{meth@precond}, ... which are defined with the actual
+% parameters.
+%
+% At the end of a method-environment all these internal saved data is
+% typeset in a (hopefully) fashionable way.
+
+%
+% \section{Helping commands}
+% \begin{macro}{\meth@paranum}
+% \begin{macro}{\meth@headparanum}
+% The counter \cs{meth@paranum} counts the number of
+% \cs{para}-commands within a
+% method-environment:
+% \begin{macrocode}
+\newcounter{meth@paranum}
+% \end{macrocode}
+% The counter \cs{meth@headparanum} stores how many
+% \cs{headpara}-commands are given within a method-environment:
+% \begin{macrocode}
+\newcounter{meth@headparanum}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%\begin{macro}{\meth@totwid}
+% The header will be typeset inside a framed minipage with a width of
+% \cs{@totwid} (= \cs{textwidth} - 6mm):
+% \begin{macrocode}
+\newlength{\meth@totwid}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\meth@indent}
+%\begin{macro}{\meth@listdecl}
+% \changes{v1.3}{1997/06/29}{Minimale Änderung.}
+% The descriptions are organized as lists with the following parameters:
+% \begin{macrocode}
+\def\meth@indent{3.5cm}
+\def\meth@listdecl{\labelwidth3cm \labelsep0.5cm
+ \itemindent0cm \leftmargin\meth@indent
+ \topsep0cm \listparindent0cm}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%
+% \begin{macro}{\meth@righttotwid}
+% The right part of the list has a width of \cs{meth@righttotwid}
+% (= \cs{meth@totwid} - \cs{meth@indent}):
+% \begin{macrocode}
+\newlength{\meth@righttotwid}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\meth@namewid}
+%\begin{macro}{\meth@nameindent}
+%\begin{macro}{\meth@rightnamewid}
+% The following lengths are used for the macro \cs{headtabbed}:
+% \begin{macrocode}
+\newlength{\meth@namewid}
+\newlength{\meth@nameindent}
+\newlength{\meth@rightnamewid}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{Options}
+%\begin{macro}{\textsee}
+%\begin{macro}{\textinit}
+%\begin{macro}{\textdel}
+%\begin{macro}{\textreturn}
+%\begin{macro}{\textprecond}
+%\begin{macro}{\textpostcond}
+%\begin{macro}{\textdescr}
+%\begin{macro}{\texterror}%
+% Now we have the option-processing. The option defines the language,
+% which will be used to print the textual parts of the
+% descriptions. At the moment only the languages english and german
+% are defined.
+%
+% First, define the parts for german descriptions
+% \begin{macrocode}
+\DeclareOption{german}{\def\textsee{Siehe auch:}
+ \def\textinit{Erzeugung:}
+ \def\textdel{Freigabe:}
+ \def\textreturn{R\"uckgabewert:}
+ \def\textprecond{Vorbed.:}
+ \def\textpostcond{Nachbed.:}
+ \def\textdescr{Beschreibung:}
+ \def\texterror{Ausnahmebeh.:}}
+
+% \end{macrocode}
+% Now for the english descriptions:
+% \begin{macrocode}
+\DeclareOption{english}{\def\textsee{see also:}
+ \def\textinit{initialisation:}
+ \def\textdel{disposal:}
+ \def\textreturn{return value:}
+ \def\textprecond{precondition:}
+ \def\textpostcond{postcondition:}
+ \def\textdescr{description:}
+ \def\texterror{exceptions:}}
+% \end{macrocode}
+% \changes{v2.0a}{1999/02/18}{French localization (thanks to
+% Jean-Pierre Drucbert)}
+% The french descriptions, provided by Jean-Pierre Drucbert:
+% \begin{macrocode}
+\DeclareOption{french}{\def\textsee{voir aussi:}
+ \def\textinit{initialisation:}
+ \def\textdel{lib\'eration:}
+ \def\textreturn{valeur de retour:}
+ \def\textprecond{pr\'econdition:}
+ \def\textpostcond{postcondition:}
+ \def\textdescr{description:}
+ \def\texterror{exceptions:}}
+% \end{macrocode}
+% Make the english version the default version and process the options.
+% \begin{macrocode}
+\ExecuteOptions{english}
+\ProcessOptions\relax
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{Error-detection}
+%\begin{macro}{\meth@where}
+%\begin{macro}{\meth@checkdoubleopen}
+%\begin{macro}{\meth@checknotopen}
+%\changes{v1.3}{1997/06/29}{Show error messages with \cs{PackageError}}
+% The macro \cs{head} can be used both in the environments method and
+% data. The following value is used to differentiate if method or data
+% is active. If none is active, the counter is set to 99. Method sets
+% it to 0, data to 1.
+% \begin{macrocode}
+\newcount\meth@where \meth@where=99
+% \end{macrocode}
+% Now define the error messages:
+% \begin{macrocode}
+\def\meth@checkdoubleopen{
+ \ifnum\meth@where<99
+ \PackageError{method}%
+ {There is an method.sty-environment open!}%
+ {}
+ \fi
+}
+\def\meth@checknotopen{
+ \ifnum\meth@where=99
+ \PackageError{method}%
+ {There is no method.sty-environment open!}%
+ {}
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\end{macro}
+%\end{macro}
+%
+%\section{The environment method}
+%\begin{environment}{method}
+% Now we define the environment method.
+% \begin{macrocode}
+\newenvironment{method}
+{
+% \end{macrocode}
+% First we check, wether a method or data-environment is open. After
+% that we set \cs{meth@where} to 0, which shows, that we are inside a
+% method-environment.
+% \begin{macrocode}
+ \meth@checkdoubleopen
+ \meth@where=0
+% \end{macrocode}
+% Define the lengths used for the typesetting of the method.
+% \changes{v1.1}{????/??/??}{Abzug von \cs{meth@totwid} von 4~mm auf 6~mm erhhöht}
+% \begin{macrocode}
+ \setlength{\meth@totwid}{\textwidth}
+ \addtolength{\meth@totwid}{-6mm}
+ \setlength{\meth@righttotwid}{\meth@totwid}
+ \addtolength{\meth@righttotwid}{-\meth@indent}
+% \end{macrocode}
+% The right column is not very wide. Therfore use \cs{sloppy}.
+% \begin{macrocode}
+ \sloppy
+% \end{macrocode}
+% All parts are defined to nothing.
+%\changes{v1.5}{1998/01/19}{extend to 26 parameters}
+% \begin{macrocode}
+ \def\meth@head{}
+ \def\meth@headtabbed{}
+ \setcounter{meth@headparanum}{0}
+ \def\meth@hpa{}\def\meth@hpb{}\def\meth@hpc{}\def\meth@hpd{}
+ \def\meth@hpe{}\def\meth@hpf{}\def\meth@hpg{}\def\meth@hph{}
+ \def\meth@hpi{}\def\meth@hpj{}\def\meth@hpk{}\def\meth@hpl{}
+ \def\meth@hpm{}\def\meth@hpn{}\def\meth@hpo{}\def\meth@hpp{}
+ \def\meth@hpq{}\def\meth@hpr{}\def\meth@hps{}\def\meth@hpt{}
+ \def\meth@hpu{}\def\meth@hpv{}\def\meth@hpw{}\def\meth@hpx{}
+ \def\meth@hpy{}\def\meth@hpz{}
+ \setcounter{meth@paranum}{0}
+ \def\meth@pa{}\def\meth@pb{}\def\meth@pc{}\def\meth@pd{}
+ \def\meth@pe{}\def\meth@pf{}\def\meth@pg{}\def\meth@ph{}
+ \def\meth@pi{}\def\meth@pj{}\def\meth@pk{}\def\meth@pl{}
+ \def\meth@pm{}\def\meth@pn{}\def\meth@po{}\def\meth@pp{}
+ \def\meth@pq{}\def\meth@pr{}\def\meth@ps{}\def\meth@pt{}
+ \def\meth@pu{}\def\meth@pv{}\def\meth@pw{}\def\meth@px{}
+ \def\meth@py{}\def\meth@pz{}
+ \def\meth@precond{}
+ \def\meth@descr{}
+ \def\meth@postcond{}
+ \def\meth@error{}
+ \def\meth@return{}
+ \def\meth@see{}
+% \end{macrocode}
+% Now for the end of the environment. The first line in a paragraph
+% is not indented and a small space is made above the header.
+% \begin{macrocode}
+}{
+ \parindent0cm
+ \vspace{2mm}
+% \end{macrocode}
+% now a sorted list of all given parts inside the environment. The
+% user has to see, that only one of
+% \cs{meth@head} and \cs{meth@headtabbed} is used.
+% \changes{v1.3}{1997/06/29}{Minimal change in the format of typesetting}%
+% \changes{v1.5}{1998/01/19}{extend to 26 parameters}
+% \begin{macrocode}
+ \meth@head\meth@headtabbed
+ \nopagebreak[4]
+ \meth@pa \meth@pb \meth@pc \meth@pd \meth@pe \meth@pf \meth@pg
+ \meth@ph \meth@pi \meth@pj \meth@pk \meth@pl \meth@pm \meth@pn
+ \meth@po \meth@pp \meth@pq \meth@pr \meth@ps \meth@pt \meth@pu
+ \meth@pv \meth@pw \meth@px \meth@py \meth@pz
+ \meth@precond
+ \meth@descr
+ \meth@postcond
+ \meth@error
+ \meth@return
+ \meth@see
+% \end{macrocode}
+% Now set \cs{meth@where} back to 99.
+% \begin{macrocode}
+ \meth@where=99
+% \end{macrocode}
+% This is the end of the definition of the environment method.
+% \begin{macrocode}
+}
+% \end{macrocode}
+%\end{environment}
+%
+%\section{The environment data}
+%\begin{environment}{data}
+% The environment data is nearly equivalent to the environment method.
+% \changes{v1.3}{1997/06/29}{Change \cs{meth@totwid} from 4~mm to 6~mm.}
+% \begin{macrocode}
+\newenvironment{data}
+{
+ \meth@checkdoubleopen
+ \meth@where=1
+ \setlength{\meth@totwid}{\textwidth}
+ \addtolength{\meth@totwid}{-6mm}
+ \sloppy
+ \def\meth@head{}
+ \def\meth@descr{}
+ \def\meth@init{}
+ \def\meth@del{}
+ \def\meth@see{}
+}{
+ \parindent0cm
+ \vspace{2mm}
+ \meth@head
+ \nopagebreak
+ \meth@descr
+ \meth@init
+ \meth@del
+ \meth@see
+ \meth@where=99
+}
+% \end{macrocode}
+%\end{environment}
+%
+%\section{Macros for the parts inside the environments}
+%
+% The definitions for the parts of the environments data and method
+% \subsection{\cs{head}}
+% \begin{macro}{\head}
+% The macro \cs{head} is used to typeset the header of the method or
+% the definition of the variable.
+% \begin{macrocode}
+\newcommand{\head}[1]{
+% \end{macrocode}
+% First check, if the environment is active at the moment.
+% \begin{macrocode}
+ \meth@checknotopen
+% \end{macrocode}
+% If \cs{meth@where} is set to 0, the environment method is active.
+% \begin{macrocode}
+ \ifnum\meth@where=0
+ \def\meth@head{
+% \end{macrocode}
+% The code to typeset the header.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+ {\setlength{\fboxrule}{0.2mm}%
+ \fbox{\parbox{\meth@indent}{\hfill}
+ \begin{minipage}{\meth@righttotwid}
+ {\parindent-\meth@indent \texttt{#1}}
+ \end{minipage}
+ }}
+ }
+ \fi%
+% \end{macrocode}
+% If \cs{meth@where} is set to 1, the environment data is active.
+% \begin{macrocode}
+ \ifnum\meth@where=1
+ \def\meth@head{
+% \end{macrocode}
+% The code to typeset the header.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+ {\setlength{\fboxrule}{0.1mm}%
+ \fbox{\hspace{2mm}\begin{minipage}{\meth@totwid}
+ \texttt{#1}
+ \end{minipage}}
+ }
+ }
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{headtabbed}}
+% \begin{macro}{\headtabbed}
+% \cs{headtabbed} takes care of the first line, which will be
+% formatted in the header of the method and defines the macro
+% \cs{meth@headtabbed}, which does the output.
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \begin{macrocode}
+\newcommand{\headtabbed}[1]{
+ \meth@checknotopen
+ \def\meth@headtabbed{
+ \setlength{\fboxrule}{0.2mm}%
+ \settowidth{\meth@namewid}{\texttt{#1}}%
+ \setlength{\meth@rightnamewid}{\meth@totwid}
+ \addtolength{\meth@rightnamewid}{-\meth@namewid}
+ \setlength{\meth@nameindent}{\meth@namewid}
+ \addtolength{\meth@nameindent}{2mm}
+ \fbox{\parbox{\meth@nameindent}{\hfill}%
+ \begin{minipage}{\meth@rightnamewid}
+ \parindent-\meth@namewid
+ \texttt{#1\meth@hpa
+ \meth@hpb
+ \meth@hpc
+ \meth@hpd
+ \meth@hpe
+ \meth@hpf
+ \meth@hpg
+ \meth@hph
+ \meth@hpi
+ \meth@hpj
+ \meth@hpk
+ \meth@hpl
+ \meth@hpm
+ \meth@hpn
+ \meth@hpo
+ \meth@hpp
+ \meth@hpq
+ \meth@hpr
+ \meth@hps
+ \meth@hpt
+ \meth@hpu
+ \meth@hpv
+ \meth@hpw
+ \meth@hpx
+ \meth@hpy
+ \meth@hpz}%
+ \end{minipage}%
+ }
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{headpara}}
+% \begin{macro}{\meth@defheadpara}
+% \changes{v1.5}{1997/01/19}{extend to 26 parameters}
+% \cs{meth@defheadpara} searches for the first empty macro of
+% \cs{meth@hpa}, \ldots, \cs{meth@hpz}. In this macro the new line can
+% be saved. This macro is used by \cs{headpara}.
+% \begin{macrocode}
+\newcommand{\meth@defheadpara}[1]{
+ \ifcase\value{meth@headparanum}
+ \def\meth@hpa{#1} \or
+ \def\meth@hpb{\\#1} \or
+ \def\meth@hpc{\\#1} \or
+ \def\meth@hpd{\\#1} \or
+ \def\meth@hpe{\\#1} \or
+ \def\meth@hpf{\\#1} \or
+ \def\meth@hpg{\\#1} \or
+ \def\meth@hph{\\#1} \or
+ \def\meth@hpi{\\#1} \or
+ \def\meth@hpj{\\#1} \or
+ \def\meth@hpk{\\#1} \or
+ \def\meth@hpl{\\#1} \or
+ \def\meth@hpm{\\#1} \or
+ \def\meth@hpn{\\#1} \or
+ \def\meth@hpo{\\#1} \or
+ \def\meth@hpp{\\#1} \or
+ \def\meth@hpq{\\#1} \or
+ \def\meth@hpr{\\#1} \or
+ \def\meth@hps{\\#1} \or
+ \def\meth@hpt{\\#1} \or
+ \def\meth@hpu{\\#1} \or
+ \def\meth@hpv{\\#1} \or
+ \def\meth@hpw{\\#1} \or
+ \def\meth@hpx{\\#1} \or
+ \def\meth@hpy{\\#1} \or
+ \def\meth@hpz{\\#1} \or
+ \PackageError{method}%
+ {Too many parameters in method-environment !}{}
+ \fi
+ \stepcounter{meth@headparanum}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\meth@defheadpara}
+% Now for the definition of the macro \cs{headpara}. Check first, if
+% the correspondent environment is open. Then use the macro
+% \cs{meth@defheadpara}.
+% \begin{macrocode}
+\newcommand{\headpara}[1]{
+ \meth@checknotopen
+ \meth@defheadpara{#1}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{\cs{para}}
+% \begin{macro}{\meth@defpara}
+% \begin{macrocode}
+\newcommand{\meth@defpara}[1]{
+ \ifcase\value{meth@paranum}
+ \def\meth@pa{#1} \or
+ \def\meth@pb{#1} \or
+ \def\meth@pc{#1} \or
+ \def\meth@pd{#1} \or
+ \def\meth@pe{#1} \or
+ \def\meth@pf{#1} \or
+ \def\meth@pg{#1} \or
+ \def\meth@ph{#1} \or
+ \def\meth@pi{#1} \or
+ \def\meth@pj{#1} \or
+ \def\meth@pk{#1} \or
+ \def\meth@pl{#1} \or
+ \def\meth@pm{#1} \or
+ \def\meth@pn{#1} \or
+ \def\meth@po{#1} \or
+ \def\meth@pp{#1} \or
+ \def\meth@pq{#1} \or
+ \def\meth@pr{#1} \or
+ \def\meth@ps{#1} \or
+ \def\meth@pt{#1} \or
+ \def\meth@pu{#1} \or
+ \def\meth@pv{#1} \or
+ \def\meth@pw{#1} \or
+ \def\meth@px{#1} \or
+ \def\meth@py{#1} \or
+ \def\meth@pz{#1} \or
+ \PackageError{method}%
+ {Too many parameters in method.sty-environment !}
+ \fi
+ \stepcounter{meth@paranum}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\para}
+% Here the definition for \cs{para}:
+% \changes{v1.3}{1997/06/29}{\cs{tt} replaced by \cs{texttt}.}
+% \changes{v1.4}{1997/06/29}{insert braces, which were missing before}
+% \begin{macrocode}
+\newcommand{\para}[2]{
+ \meth@checknotopen
+ \meth@defpara{\begin{list}{\texttt{#1}}{\meth@listdecl}
+ \item #2
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{The other macros}
+% \begin{macro}{\precond}
+% The other macros are very simple. The create a list-environment and
+% put their data inside of this list.
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\precond}[1]{
+ \meth@checknotopen
+ \def\meth@precond{\begin{list}{\textbf{\textprecond}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\postcond}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\postcond}[1]{
+ \meth@checknotopen
+ \def\meth@postcond{\begin{list}{\textbf{\textpostcond}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\descr}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\descr}[1]{
+ \meth@checknotopen
+ \def\meth@descr{\begin{list}{\textbf{\textdescr}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\error}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\error}[1]{
+ \meth@checknotopen
+ \def\meth@error{\begin{list}{\textbf{\texterror}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\return}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\return}[1]{
+ \meth@checknotopen
+ \def\meth@return{\begin{list}{\textbf{\textreturn}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\see}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\see}[1]{
+ \meth@checknotopen
+ \def\meth@see{\begin{list}{\textbf{\textsee}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\init}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\init}[1]{
+ \meth@checknotopen
+ \def\meth@init{\begin{list}{\textbf{\textinit}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\del}
+% \changes{v1.3}{1997/06/29}{\cs{bf} replaced by \cs{textbf}.}
+% \changes{v1.4}{1997/06/29}{insert missing braces.}
+% \begin{macrocode}
+\newcommand{\del}[1]{
+ \meth@checknotopen
+ \def\meth@del{\begin{list}{\textbf{\textdel}}{\meth@listdecl}
+ \item #1
+ \end{list}}
+}
+% \end{macrocode}
+%\end{macro}
+% \Finale
+%
+\endinput
+%
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/method/method.ins b/Master/texmf-dist/source/latex/method/method.ins
new file mode 100644
index 00000000000..1f02bf45063
--- /dev/null
+++ b/Master/texmf-dist/source/latex/method/method.ins
@@ -0,0 +1,60 @@
+%%
+%% 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 (C) 1997-1999 Thomas Leineweber
+%% Lehrstuhl VI
+%% Fachbereich Informatik
+%% Universitaet Dortmund
+%%
+%%
+%% This file is based upon the standard .ins-Files shipped with the
+%% LaTeX-Distribution
+%%
+%% It may be distributed under the terms of the LaTeX Project Public
+%% License, as described in lppl.txt in the base LaTeX distribution.
+%% Either version 1.0 or, at your option, any later version.
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+\def\batchfile{method.ins}
+\input docstrip.tex
+\preamble
+
+This is a generated file.
+Copyright (C) 1997-1999 Thomas Leineweber, University of Dortmund.
+
+This file may be distributed under the terms of the LaTeX Project Public
+License, as described in lppl.txt in the base LaTeX distribution.
+Either version 1.0 or, at your option, any later version.
+
+For error reports in case of UNCHANGED versions see the readme file.
+
+Please do not request updates from me directly. Distribution is
+done through the Comprehensive TeX Archive Network (CTAN).
+
+\endpreamble
+\keepsilent
+
+\Msg{*** Generating method style file ***}
+
+\generateFile{method.sty}{t}{
+ \from{method.dtx}{method}}
+
+\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 method.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file `method.dtx'}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/method/readme b/Master/texmf-dist/source/latex/method/readme
new file mode 100644
index 00000000000..501b1e3afdd
--- /dev/null
+++ b/Master/texmf-dist/source/latex/method/readme
@@ -0,0 +1,66 @@
+README for the package method
+
+
+License
+=======
+
+The files in this directory (method distribution) are Copyright 1998 1999
+Thomas Leineweber, Univerity of Dortmund, Germany
+
+
+The files associated with the method-package (see below for a list) may be
+distributed under the terms of the LaTeX Project Public License, as
+described in lppl.txt in the base LaTeX distribution. Either version 1.0
+or, at your option, any later version.
+
+ERROR REPORTS
+=============
+
+Before you report an error, please check that:
+
+ - the error isn't caused by obsolete versions of other software;
+ LaTeX from 1986 is a good candidate ...
+
+ - you use an original version of the package.
+
+
+ If you think you found a genuine bug please report it together
+ with the following information:
+
+ - version of the file
+
+ - version (date!) of your LaTeX
+
+ - a short test file showing the behavior with all unnecessary
+ code removed.
+
+ - a transcript (log file) of the session that shows the error.
+
+Please note that it is important to make the file as small as possible
+to allow me to find and fix the error soon.
+
+If you have an unchanged version of my package method, you can send me
+error reports to
+
+ leineweb@ls6.cs.uni-dortmund.de
+
+
+Files distributed with this package
+===================================
+
+method.ins This is the installation script that will produce
+ the executable file method.sty when run through LaTeX
+ or TeX
+method.dtx `method' style for LaTeX in docstrip format.
+readme This file
+methtest.tex A test file showing the usage of the package.
+
+
+
+Acknowledgements
+================
+
+This readme is mostly copied from the readme from the dinbrief package by
+K.D. Braune and R. Gussmann
+
+Jean-Pierre Drucbert for the french translation
diff --git a/Master/texmf-dist/source/latex/moresize/moresize.dtx b/Master/texmf-dist/source/latex/moresize/moresize.dtx
new file mode 100644
index 00000000000..27ad2feab94
--- /dev/null
+++ b/Master/texmf-dist/source/latex/moresize/moresize.dtx
@@ -0,0 +1,669 @@
+%\iffalse <Not read by DocStrip>
+% Copyright 1997,1998,1999 Christian Cornelssen
+% 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.
+%<*driver>
+\documentclass{ltxdoc}
+\begin{document}
+ \DocInput{moresize.dtx}
+\end{document}
+%</driver>
+%\fi
+%\def\basename{moresize}
+%\def\fileversion{v1.9}
+%\def\filedate{1999/07/26}
+%\newcommand\testfile[1][.tex]{\fln{msizetst#1}}
+%\newcommand\fnt[1]{\textrm{#1}} ^^A for fonts
+%\newcommand\fln[1]{\texttt{#1}} ^^A for filenames
+%\newcommand\pkg[1]{\textsf{#1}} ^^A for packages
+%\newcommand\opt[1]{\texttt{#1}} ^^A for package options
+%\newcommand\env[1]{\texttt{#1}} ^^A for environments
+%\newcommand\this{\pkg{\basename}} ^^A for this package
+%\newcommand\thisfln[1]{\fln{\basename #1}} ^^A for related files
+%\newcommand\fntcm{\fnt{CM}}
+%\newcommand\fntdc{\fnt{DC}}
+%\newcommand\fntec{\fnt{EC}}
+%\newcommand\NFSS{\textrm{NFSS}}
+%\providecommand\MF{\textsc{Metafont}}
+%\title{\this: More font sizes with \LaTeX}
+%\author{Christian Cornelssen (\texttt{cornsub1@flintstone.ukbf.fu-berlin.de})}
+%\date{\fileversion\ [\filedate]}
+%\maketitle
+%\section{Introduction}
+% When writing yet another \LaTeX\ introduction with a demonstration of
+% font sizes, I discovered that \cmd{\Huge} and \cmd{\huge} were set to
+% the same size. No good for a demonstration! I localized the definition
+% in the \fln{size12.clo} class option file and found that the font size
+% for \cmd{\Huge} had to be increased from 24.88pt to 29.86pt.
+%
+% \DescribeMacro{\HUGE}
+% Therefore, I produced a package \this\ redefining \cmd{\Huge} and
+% defining an even ``bigger'' font size command \cmd{\HUGE}, because I
+% wanted to be able to use font sizes up to 35.83pt, as provided by the
+% \fntec\ fonts' standard edition.
+%
+% \DescribeMacro{\ssmall}
+% Additionally, I defined a size command \cmd{\ssmall} filling the
+% gap between the sizes selectable by \cmd{\tiny} and \cmd{\scriptsize}.
+%
+% The documentation in the \LaTeXe\ distribution's source file
+% \fln{fontdef.dtx} reminded me to also declare math sizes for the new
+% text sizes.
+% When studying the docs, I found that the math script sizes defined in
+% \fln{fontdef.dtx} grew faster than the text sizes, and that at least
+% the script sizes for 24.88pt seemed to be absolutely inappropriate.
+% Therefore, I designed two sets of text/math size combinations
+% including the new 29.86pt and 35.83pt text sizes,
+% one set just fixing the 25pt math script and scriptscript sizes,
+% and another one with somewhat smaller scriptscript sizes in order to
+% maintain the typical $10:7:5$ ratio for text sizes from 10pt upwards.
+% The math size changings can be activated by means of options
+% passed to the \this\ package.
+%
+% For testing the new sizes and for visualizing the effects of the math size
+% settings, a \LaTeX\ file \testfile\ containing sample text and math
+% expressions at various sizes is provided.
+%
+%\section{User Interface}
+% The \this\ package can be loaded by the \LaTeXe\ command
+% \begin{quote}
+% |\usepackage|\oarg{options}|{|\thisfln{}|}|
+% \end{quote}
+% By default, \this\ neither redefines existing macros nor changes
+% the standard math size declarations.
+% However, the package provides the additional font size selection commands
+% \cmd{\HUGE} and \cmd{\ssmall}, and declares math sizes
+% for the new 29.86pt and 35.83pt text sizes.
+%
+% Available Options are:
+% \begin{description}
+% \item[\opt{10pt}]
+% This option provides the same settings as the default.
+% \cmd{\HUGE} is defined to select a 29.86pt font size, and
+% \cmd{\ssmall} is made to give 6pt.
+% These definitions continuously extend the set of size commands given in
+% the \fln{size10.clo} standard class option file.
+%
+% \item[\opt{11pt}]
+% This option makes \cmd{\HUGE} and \cmd{\ssmall} select 29.86pt and
+% 7pt, respectively, which is suitable for use with the settings given in
+% the \fln{size11.clo} standard class option file.
+%
+% \item[\opt{12pt}]
+% With this option, \cmd{\HUGE} and \cmd{\ssmall} are defined to
+% select 35.83pt and 7pt, respectively.
+%
+% Additionally, the size selection command \cmd{\Huge} is redefined
+% to give 29.86pt.
+% This is done because the setting given in the \fln{size12.clo} standard
+% class option file saturates the \cmd{\Huge} font size at the same level
+% as given by \cmd{\huge} (24.88pt)---presumably with the \fntcm\ font
+% restrictions of old \LaTeX~2.09 in mind.
+% Nowadays, with \LaTeXe's flexible \NFSS, font size selection commands
+% are not associated with a predetermined font family any longer,
+% hence such restrictions are out of place.
+% Note that \NFSS\ automatically resorts to lower sizes if a demanded font
+% size is not available, so standard \fntcm\ font users will not be
+% affected by the new size settings, but \fntec\ font users can benefit
+% from them.
+%
+% \item[\opt{ecpatch}]
+% This is a bug fix for the \fntec\ font declarations given in the
+% \LaTeXe\ releases from December 1996 through December 1997.
+% Therein, the declarations of the \fntec\ fonts do not include
+% font sizes above 24.88pt, although the \fntec\ font standard edition
+% provides font metrics files for 29.86pt and 35.83pt.
+% As a consequence, \NFSS\ would deny usage of those font sizes
+% and substitute 24.88pt instead.
+%
+% The \opt{ecpatch} option installs macros which override any declaration
+% of an \fntec\ font with an own declaration including the 29.86pt
+% and 35.83pt sizes.
+%
+% Regard this patch as a temporary bug fix; the proper way requires
+% updating the \LaTeXe\ distribution source file \fln{cmfonts.fdd}
+% from which the \fln{t1cm*.fd} files are generated, and remaking the
+% \LaTeXe\ format file.
+% Indeed, a proper fix has been incorporated into the \LaTeXe\
+% distribution shortly after December 1997; therefore, recent distributions
+% should not require the \opt{ecpatch} option.
+%
+% As can be concluded from the above, the decision whether to use
+% \opt{ecpatch} or not should be determined by the availibility of
+% \fntec\ (\emph{not} \fntdc!) fonts and by the version of the
+% \LaTeXe\ base distribution both of which may vary independently from the
+% author's main \LaTeX\ input file.
+% Therefore, the appropriate spot for invoking \opt{ecpatch}
+% is a configuration file placed somewhere in the \LaTeXe\ input
+% directory tree with filename \thisfln{.cfg},
+% containing a line like
+% \begin{quote}
+%\begin{verbatim}
+%\ExecuteOptions{ecpatch}
+%\end{verbatim}
+% \end{quote}
+% This frees authors of \LaTeXe\ input files from the need of specifying
+% \opt{ecpatch} themselves when using the \this\ package
+% and thus preserves the portability of \LaTeXe\ documents across
+% different \LaTeXe\ releases.
+%
+% Note that \opt{ecpatch} is useful only if the following conditions
+% are met:
+% \begin{enumerate}
+% \item
+% The ``official'' \fntec\ fonts are available,
+% including TFM files for the sizes 29.86pt and 35.83pt.
+% With \fntdc\ fonts instead, \opt{ecpatch} will not work
+% correctly.\footnote{
+% \opt{ecpatch} may work with the last (``new'')
+% \fntdc\ font release if provided with TFM files for all standard
+% \fntec\ font sizes.
+% Typically, the 29.86pt size would be missing.}
+% \item
+% The \LaTeXe\ base has been configured to support \fntec\ fonts
+% (i.e.\ \fln{cmfonts.fdd} has been unpacked by \fln{ec.ins}\footnote{
+% Using \fln{newdc.ins} for \fntdc\ fonts with all TFM files mentioned
+% above could also work.}).
+% \item
+% The \LaTeXe\ base (or at least its \fln{cmfonts.fdd}) has a release
+% date before 1998. Later releases do not need \opt{ecpatch}.\footnote{
+% Applying \opt{ecpatch} to newer \LaTeXe\ releases has not caused
+% any harm in my testings so far.}
+% \end{enumerate}
+% Anyway---upgrading your system to a recent \LaTeXe\ base
+% with ``official'' \fntec\ fonts would be a better solution
+% than using \opt{ecpatch}.
+%
+% \item[\opt{normalscripts}]
+% This option decreases the script and scriptscript sizes associated
+% with the 24.88pt text size by one magstep, in order to damp the
+% script size explosion defined in the \LaTeXe\ source file
+% \fln{fontdef.dtx}.
+% With this setting, a formula like $\frac{X}{Y}$ within a \cmd{\Huge}
+% paragraph (e.\,g.\ a document title) does no longer affect line spacing,
+% as should be.
+%
+% \item[\opt{smallscripts}]
+% Starting from the \opt{normalscripts} math size settings, this option
+% further reduces the scriptscript sizes associated with text sizes of
+% 17.28pt and above.
+% The idea behind this is to maintain an approximate $10:7:5$ ratio
+% between text, script, and scriptscript sizes in bigger-than-normal
+% writings.
+% \end{description}
+%
+% The math script size option names roughly describe the changes to the
+% standard \LaTeX\ setup.
+% Therefore, \opt{normalscripts} may not look ``normal'' in the sense of
+% ``just right'', but differs from the standard setup in 24.88pt
+% writings only.
+% I prefer \opt{smallscripts} which results in scriptscript sizes that are
+% not really small---they are simply not as big as the standard ones.
+% Note that this option only affects math expressions with nested fractions
+% and/or sub-/superscripts in large writings (17.28pt text size and above),
+% e.\,g.\ in titles or section headers.
+% Therefore, it is quite likely that you have not encountered an example
+% of that kind so far.
+% But once you have, you should remember this package\dots
+%
+%\section{The test file \testfile}
+% A test file \testfile\ is provided for evaluating the math size
+% settings. You may rename it and then manipulate it as you wish,
+% typically for testing the options passed to the \this\ package.
+% The test document shows sample text and math expressions at various
+% sizes, each framed above and below by horizontal lines delimiting the
+% amount of vertical space that is normally available for math expressions
+% within paragraphs of text.
+% If the expressions overprint the delimiters, they are likely to cause
+% stretching of the baseline skip when used within a paragraph.
+%
+% However, the output for sizes above 24.88pt may be erroneous or
+% misleading under certain circumstances:
+% \begin{itemize}
+% \item
+% Even when using \fntec\ text fonts, math expressions may still use
+% \fntcm\ fonts which are limited to 24.88pt in their declarations
+% to \NFSS\@.
+% This does not matter for scripts and scriptscripts because even
+% \cmd{\HUGE} writings do not request script sizes greater than 24.88pt.
+% However, the main (i.\,e.\ non-script) symbols of math expressions in
+% \cmd{\HUGE}, or even in \cmd{\Huge} (for \opt{12pt} documents),
+% will be shrinked to 24.88pt size,
+% thereby issuing \NFSS\ warnings about unavailable font sizes
+% for OT1, OML, or OMS encodings.
+% (If there are messages about unavailable T1 font sizes,
+% you should try the \opt{ecpatch} option or get a recent
+% version of \LaTeX\ and of the \fntec\ fonts.)
+%
+% \item
+% As another effect of the main symbol size shrinking,
+% the vertical position of the main math axis is lowered,
+% thereby moving fraction rules towards the denominators.
+%
+% \item
+% The calculation of the amount of vertical space available within a
+% normal line yields wrong results if fonts with the desired size
+% are not available.
+% In detail, the appearant amount of free vertical space gets increased by
+% twice the difference between the requested font size and the size chosen
+% by \NFSS\@.
+%
+% If you use properly-declared \fntec\ fonts for testing the samples,
+% this problem should not occur.
+% \end{itemize}
+%
+% By adding extreme magnification factors to the \fntcm\ font declarations,
+% I have verified that the aforementioned artifacts disappear
+% when math fonts in the requested sizes are made available (though heavily
+% ``bolded'' by the magnification).
+% However, I have not included that hack for demonstration,
+% in order not to provide any means for over-using the \fntcm\ math fonts.
+% According to the \LaTeXe\ newsletters \fln{ltnews09.tex}
+% and \fln{ltnews11.tex}, \TeX\ users can look forward to a modern
+% math font concept allowing easy setup and use of alternate math fonts.
+% Therefore, making documents which explicitly misuse \fntcm\ fonts for
+% huge math expressions would be counterproductive.
+% However, even without math fonts at more than 24.88pt, the improvements
+% in typesetting huge math expressions can be demonstrated by varying
+% the options passed to the \this\ package in the test file \testfile.
+%
+%\StopEventually{}
+%\section{Package Code}
+% This section documents the contents of the ready-to-use package file
+% \thisfln{.sty}.
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Preliminaries}
+% Announce the file as a \LaTeXe\ package.
+% \begin{macrocode}
+\ProvidesPackage{moresize}[1999/07/26 v1.9 (more font sizes)]
+% \end{macrocode}
+%
+% \begin{macro}{\@xxxpt}
+% \begin{macro}{\@xxxvipt}
+% As a convention, declare macros for the new point sizes.
+% \begin{macrocode}
+\providecommand\@xxxpt{29.86}
+\providecommand\@xxxvipt{35.83}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Size Selection Commands}
+% \begin{macro}{\HUGE}
+% \begin{macro}{\ssmall}
+% Define the author commands \cmd{\HUGE} and \cmd{\ssmall},
+% depending on the main document font size option.
+% In case of \opt{12pt}, fix the clipping of \cmd{\Huge} which
+% occurs in \fln{size12.clo} (\fln{classes.dtx}).
+% \begin{macrocode}
+\DeclareOption{10pt}{
+ \def\ssmall{\@setfontsize\ssmall\@vipt\@viipt}
+ \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
+\DeclareOption{11pt}{
+ \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
+ \def\HUGE{\@setfontsize\HUGE\@xxxpt{36}}}
+\DeclareOption{12pt}{
+ \def\ssmall{\@setfontsize\ssmall\@viipt\@viiipt}
+ \def\Huge{\@setfontsize\Huge\@xxxpt{36}}
+ \def\HUGE{\@setfontsize\HUGE\@xxxvipt{43}}}
+% \end{macrocode}
+% The definitions given here are similar to most size command definitions
+% in \LaTeXe's \fln{classes.dtx}.
+% The following rules have been observed and taken as guidelines:
+% \begin{itemize}
+% \item
+% Size commands other than \cmd{\footnotesize}--\cmd{\normalsize} are
+% not intended for typesetting document structures more complex
+% than paragraphs.
+% Therefore, their definitions do not contain specifications
+% of dimension parameters for list environments or displayed equations.
+% \item
+% Baselineskips for text sizes below 8pt are chosen to be
+% 1pt higher than the text size.
+% Baselineskips above 10pt are set to somewhat rounded pt sizes
+% around 1.2~times the text size.
+% \end{itemize}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Math Size Options}
+% Consider the declarations in \LaTeXe's \fln{fontdef.dtx}:
+% \begin{quote}
+%\begin{verbatim}
+%\DeclareMathSizes{\@xpt}{\@xpt}{7}{5}
+%\DeclareMathSizes{\@xipt}{\@xipt}{8}{6}
+%\DeclareMathSizes{\@xiipt}{\@xiipt}{8}{6}
+%\DeclareMathSizes{\@xivpt}{\@xivpt}{\@xpt}{7}
+%\DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{\@xpt}
+%\DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xiipt}
+%\DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xxpt}{\@xviipt}
+%\end{verbatim}
+% \end{quote}
+% The script and scriptscript sizes for |\@xxvpt| are one magstep
+% bigger than the sizes extrapolated from the context.
+% This seems to be an error. And in fact, fractions like $\frac{X}{Y}$
+% placed in 25pt text strech the baseline skip, whereas this does not
+% happen at lower sizes.
+%
+% This will be fixed when given the option \opt{normalscripts}:
+% \begin{macrocode}
+\DeclareOption{normalscripts}{
+ \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xivpt}}
+% \end{macrocode}
+%
+% In any case, declare math sizes for the new point sizes.
+% \begin{macrocode}
+\DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xviipt}
+\DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xxpt}
+% \end{macrocode}
+%
+% There remains a one-magstep ratio between the script and scriptscript
+% sizes for text sizes above |\@xivpt|, whereas for text sizes between
+% |\@xpt| and |\@xivpt|, approximately two magsteps are taken.
+% An option is defined for applying the two-magsteps rule to text sizes
+% above |\@xivpt|, including the new |\@xxxpt| and |\@xxxvipt| sizes.
+% \begin{macrocode}
+\DeclareOption{smallscripts}{
+ \DeclareMathSizes{\@xviipt}{\@xviipt}{\@xiipt}{8}
+ \DeclareMathSizes{\@xxpt}{\@xxpt}{\@xivpt}{\@xpt}
+ \DeclareMathSizes{\@xxvpt}{\@xxvpt}{\@xviipt}{\@xiipt}
+ \DeclareMathSizes{\@xxxpt}{\@xxxpt}{\@xxpt}{\@xivpt}
+ \DeclareMathSizes{\@xxxvipt}{\@xxxvipt}{\@xxvpt}{\@xviipt}}
+% \end{macrocode}
+%
+% \subsection{\fntec\ Font Declaration Patch}
+% \begin{macro}{\UndeclareFontFamily}
+% |\UndeclareFontFamily|\marg{ENC}\marg{family} makes \NFSS\ forget
+% the font information for the font family \meta{family} with encoding
+% \meta{ENC} and thus causes the corresponding font declaration file
+% (\fln{\meta{enc}\meta{family}.fd}) to be reloaded on demand.
+% \begin{macrocode}
+\newcommand\UndeclareFontFamily[2]{%
+ \global\expandafter\let\csname#1+#2\endcsname\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% The \fntec\ font declaration patch is an optional bug fix,
+% and possibly obsolete.
+% \begin{macrocode}
+\DeclareOption{ecpatch}{
+ \typeout
+ {*** Using EC font declaration patch for pre-1998 LaTeX2e releases ***}
+% \end{macrocode}
+%
+% \begin{macro}{\EC@family}
+% Declaration of font families from the \fntec\ or the previously
+% released \fntdc\ edition is done by the macro \cmd{\EC@family}.
+% It is defined in the relevant font definition files by means of
+% \cmd{\providecommand}.
+% Hence, predefining this macro will override the definition given in the
+% \fln{fd} files.
+% Now take the original definition and complete the size specification
+% with 29.86pt and 35.83pt entries.
+% Since \cmd{\nfss@catcodes} have not been activated, white space in the
+% \cmd{\DeclareFontShape} call must be avoided.
+% \begin{macrocode}
+ \def\EC@family#1#2#3#4#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}{}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EC@ttfamily}
+% For the typewriter families, a similar macro is used.
+% \begin{macrocode}
+ \def\EC@ttfamily#1#2#3#4#5{%
+ \DeclareFontShape{#1}{#2}{#3}{#4}{%
+ <5><6><7><8>#50800%
+ <9><10><10.95><12><14.4><17.28><20.74><24.88>%
+ <29.86><35.83>genb*#5}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% Now undeclare font families that are usually mapped
+% to \fntec\ or \fntdc\ fonts.
+% On demand, they will be redeclared under control of the predefined
+% \cmd{\EC@family} or \cmd{\EC@ttfamily} macros.
+% \begin{macrocode}
+ \UndeclareFontFamily{T1}{cmr}
+ \UndeclareFontFamily{TS1}{cmr}
+ \UndeclareFontFamily{T1}{cmss}
+ \UndeclareFontFamily{TS1}{cmss}
+ \UndeclareFontFamily{T1}{cmtt}
+ \UndeclareFontFamily{TS1}{cmtt}
+ \UndeclareFontFamily{T1}{cmvtt}
+ \UndeclareFontFamily{TS1}{cmvtt}
+ \UndeclareFontFamily{T1}{cmsc}% from `smallcap' package
+ \UndeclareFontFamily{T1}{cmdh}
+ \UndeclareFontFamily{T1}{cmfib}
+ \UndeclareFontFamily{T1}{cmfr}
+% \end{macrocode}
+% The patch is now complete.
+% \begin{macrocode}
+}
+% \end{macrocode}
+% Of course, a proper way in \NFSS\ for adding size specifications to
+% existing font shape declarations would be appreciated.
+% But once the fonts are declared properly, this should not be necessary
+% at all.
+%
+% \subsection{Configuration}
+% In the standard classes, 10pt writing is the default.
+% Therefore, the same is assumed here.
+% Global options or explicitly given package options may override this.
+% \begin{macrocode}
+\ExecuteOptions{10pt}
+% \end{macrocode}
+% Before processing the package options, a configuration file
+% \thisfln{.cfg} may be input,
+% typically containing |\ExecuteOptions{ecpatch}|
+% for systems with installed \fntec\ fonts and a \LaTeXe\ version
+% released before 1998.
+% \begin{macrocode}
+\InputIfFileExists{moresize.cfg}{}{}
+\ProcessOptions
+%</package>
+% \end{macrocode}
+%
+%\section{Test Code}
+% This section documents the contents of the test document source file
+% \testfile.
+% \begin{macrocode}
+%<*testfile>
+% \end{macrocode}
+%
+% This is a \LaTeXe\ document.
+% \begin{macrocode}
+%% This is a test file for text and math size settings.
+%% You might want to test several configurations. Therefore,
+%% it might be a good idea to save different versions of this file
+%% under different names.
+\documentclass[11pt,a4paper]{article}
+\usepackage{exscale} %% for scaled \sum, \int etc.
+
+% \end{macrocode}
+%
+% Here the package of interest is loaded.
+% \begin{macrocode}
+%% Available options for the `moresize' package:
+%% 10pt, 11pt, 12pt (in \documentclass) determines font sizes
+%% normalscripts avoid script size explosion in huge writings
+%% smallscripts smaller, more appropriate script sizes
+%% ecpatch tell NFSS that huge EC fonts are available
+\usepackage[smallscripts]{moresize}
+
+% \end{macrocode}
+%
+% For testing the 29.86pt and 35.83pt sizes, the T1-encoded \fntec\ or
+% \fntdc\ fonts may be needed.
+% \begin{macrocode}
+%% Use the `t1enc' package for testing with DC/EC fonts
+\usepackage{t1enc}
+
+% \end{macrocode}
+%
+% \begin{macro}{\calcmathspace}
+% \begin{macro}{\mathht}
+% \begin{macro}{\mathdp}
+% The amount of vertical space usable for math expressions within
+% a paragraph without probably stretching the baseline skip
+% can be calculated by means of the macro \cmd{\calcmathspace}.
+% When called, \cmd{\calcmathspace} uses the caller's current text size
+% and \cmd{\baselineskip} settings as well as height and depth of the
+% characters |[| and |]| from the roman text font for estimating
+% the height and depth which an inline math expression may have.
+% The results are stored in the length parameters \cmd{\mathht} and
+% \cmd{\mathdp}, respectively.
+% \begin{macrocode}
+%% Consider a paragraph with a text line of depth d (below the baseline),
+%% followed by a line with an inline formula,
+%% followed by a text line with height h (above the baseline).
+%% Then the formula's height may not exceed \baselineskip - d,
+%% and its depth may not exceed \baselineskip - h,
+%% or the baseline skips will be stretched.
+%% The roman-text brackets `[' and `]' are used for estimating d and h.
+%% Note that the space for the formula seems to get larger if NFSS
+%% substitutes a smaller font, because \baselineskip does not shrink
+%% accordingly!
+\newlength\mathht %% height available for an inline formula
+\newlength\mathdp %% depth available for an inline formula
+\newcommand\calcmathspace{%
+ \settodepth\mathht{\textrm{[}}%
+ \setlength\mathht{-\mathht}%
+ \addtolength\mathht{\baselineskip}%
+ \settoheight\mathdp{\textrm{]}}%
+ \setlength\mathdp{-\mathdp}%
+ \addtolength\mathdp{\baselineskip}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\linebox}
+% The command \cmd{\linebox}\marg{text} typesets \meta{text} in a box
+% with fixed height and depth corresponding to a line that extends so high
+% and so deep that it just touches the preceding and following lines
+% which are assumed to contain ordinary text.
+% The upper and lower bounds of the box are delimited by horizontal lines.
+% \begin{macrocode}
+%% The following command shows its argument, typeset in text style,
+%% between two horizontal lines showing the available space in a text line.
+%% If the argument overprints the lines, it would stretch
+%% the baseline skip in a paragraph.
+\newcommand\linebox[1]{\calcmathspace\begin{tabular}{@{}l@{}}\hline
+ \raisebox{0pt}[\mathht][\mathdp]{#1}\\\hline\end{tabular}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\msample}
+% The macro \cmd{\msample} should contain fairly simple math expressions
+% with nested sub- or superscripts and/or fractions which should fit
+% into paragraphs of text without stretching the baseline skip.
+% \begin{macrocode}
+%% A macro for sample math expressions.
+%% The original definition gives expressions which should fit into
+%% paragraphs without enlarging the baseline skip.
+%% For variable-sized \sum or \int symbols, \usepackage{exscale} is needed.
+%% Caution: Main (i.e. non-script) symbols are 24.88pt maximum
+%% with CM math fonts. You may try using text fonts instead,
+%% but some vertical positionings and spacings still go wrong then.
+\newcommand\msample{\ensuremath{
+ \frac{X}{Y}
+\, g^{i_1\ldots i_n}_{j_1\ldots j_n}
+\, \frac{t^2}{2!}
+\, e^{-\frac{t}{\tau}}
+}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Size}
+% Interested testers may like to directly specify point sizes instead of
+% using author commands.
+% The command \cmd{\Size}\marg{font size}\marg{baselineskip}
+% is provided for easying such specifications.
+% \meta{font size} and \meta{baselineskip} must be specified as numbers
+% of pt, with the |pt| omitted.
+% \begin{macrocode}
+%% None of the size options 10pt, 11pt, and 12pt offers the entire spectrum
+%% of available font sizes.
+%% For example, the 10pt option offers no command for selecting 10.95pt,
+%% and the 12pt option does not provide a command for 9pt.
+%% The 11pt option fills both gaps, but misses the extremes 35.83pt and 5pt.
+%% Therefore, a shorthand for lower-level size switches is provided.
+%% E.g. \Size{20.74}{25} selects a 20.74pt font size with 25pt baselineskip.
+\newcommand\Size[2]{\fontsize{#1}{#2}\selectfont}
+
+% \end{macrocode}
+% \end{macro}
+%
+% Now typesetting can begin. Only one page should be needed.
+% Remember to echo the options used.
+% \begin{macrocode}
+\begin{document}
+\parindent0pt
+
+%% The test output should fit onto one page
+\pagestyle{empty}
+\enlargethispage{1in}
+
+%% Don't forget to list the moresize options in the test output!
+\textsf{moresize} options:
+%%[10pt]
+[11pt]
+%%[12pt]
+%%[normalscripts]
+[smallscripts]
+%%[ecpatch]
+
+%% Are you using HUGE fonts?
+%%Using CM fonts only.
+%%Using DC fonts for text, CM fonts for math.
+Using EC fonts for text, CM fonts for math.
+
+% \end{macrocode}
+%
+% Now comes a table containing samples at sizes down to 5pt.
+% The original font size directives are intended for use with the \opt{11pt}
+% option; with \opt{12pt} (\opt{10pt}) instead, the 35.83pt (5pt) size would
+% appear twice.
+% \begin{macrocode}
+\begin{center}
+\newcommand\n{\\\\[-1ex]} %% for separating the tabular lines
+\begin{tabular}{@{}ll@{}}
+ \Size{35.83}{43}\linebox{36pt}
+ & \Size{35.83}{43}\linebox{\msample}
+\n \HUGE\linebox{HUGE} & \HUGE\linebox{\msample}
+\n \Huge\linebox{Huge} & \Huge\linebox{\msample}
+\n \huge\linebox{huge} & \huge\linebox{\msample}
+\n \LARGE\linebox{LARGE} & \LARGE\linebox{\msample}
+\n \Large\linebox{Large} & \Large\linebox{\msample}
+\n \large\linebox{large} & \large\linebox{\msample}
+\n \normalsize\linebox{normalsize}
+ & \normalsize\linebox{\msample}
+\n \small\linebox{small} & \small\linebox{\msample}
+\n \footnotesize\linebox{footnotesize}
+ & \footnotesize\linebox{\msample}
+\n \scriptsize\linebox{scriptsize}
+ & \scriptsize\linebox{\msample}
+\n \ssmall\linebox{ssmall} & \ssmall\linebox{\msample}
+\n \tiny\linebox{tiny} & \tiny\linebox{\msample}
+\n \Size{5}{6}\linebox{5pt}
+ & \Size{5}{6}\linebox{\msample}
+\end{tabular}
+\end{center}
+% \end{macrocode}
+%
+% That's all on one test page.
+% \begin{macrocode}
+\end{document}
+%</testfile>
+% \end{macrocode}
+%\endinput
diff --git a/Master/texmf-dist/source/latex/moresize/moresize.ins b/Master/texmf-dist/source/latex/moresize/moresize.ins
new file mode 100644
index 00000000000..46fb3de7f3a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/moresize/moresize.ins
@@ -0,0 +1,45 @@
+\input docstrip
+
+\keepsilent
+\askforoverwritefalse
+
+%% (C) 1997,1998,1999 Christian Cornelssen
+%% This file will unpack the \LaTeXe\ files contained in the package file
+%% `moresize.dtx' when run through plain TeX or LaTeX.
+
+\preamble
+
+ Version: v1.9 [1999/07/26]
+ Author : Christian Cornelssen <cornsub1@flintstone.ukbf.fu-berlin.de>
+
+ Copyright 1997,1998,1999 Christian Cornelssen
+ 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.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+\generate{
+ \file{moresize.sty}{\from{moresize.dtx}{package}}
+% \file{moresize.drv}{\from{moresize.dtx}{driver}}
+ \file{msizetst.tex}{\from{moresize.dtx}{testfile}}}
+
+\ifToplevel{
+\Msg{*****************************************************************}
+\Msg{* To finish the installation, you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space moresize.sty}
+\Msg{*}
+\Msg{* To produce the documentation, run moresize.dtx through LaTeX.}
+\Msg{* For testing, edit msizetst.tex and run it through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{*****************************************************************}
+}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/moresize/moresize.upl b/Master/texmf-dist/source/latex/moresize/moresize.upl
new file mode 100644
index 00000000000..661a6dfef20
--- /dev/null
+++ b/Master/texmf-dist/source/latex/moresize/moresize.upl
@@ -0,0 +1,52 @@
+Dear DANTE members, supporters and users,
+
+I have uploaded version 1.9 [1999/07/26] of the LaTeX2e `moresize' package.
+
+FILES
+ moresize.dtx documented LaTeX2e source file.
+ moresize.ins TeX installation script
+ moresize.upl this info (can serve as README file, too)
+
+The moresize.* files are intended for replacing the corresponding files
+in the directory
+
+ /tex-archive/macros/latex/contrib/other.
+
+DESCRIPTION
+
+The `moresize' package allows using font sizes up to 35.83pt,
+for example with the new EC fonts.
+
+Two new author commands \HUGE and \ssmall for selecting font sizes
+are provided, together with some options working around current LaTeX2e
+shortcomings in using big font sizes.
+The package also provides options for improving the typesetting of paragraphs
+(or headlines) with embedded math expressions at font sizes above 17.28pt.
+
+COPYRIGHT
+
+ Version: v1.9 [1999/07/26]
+ Author : Christian Cornelssen <cornsub1@flintstone.ukbf.fu-berlin.de>
+
+ Copyright 1997,1998,1999 Christian Cornelssen
+ 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.
+
+INSTALLATION is done as usual:
+
+Run TeX on `moresize.ins' for extracting
+the ready-to-use package file `moresize.sty' (DocStrip option `package')
+and a test file `msizetst.tex' (DocStrip option `testfile')
+from `moresize.dtx'.
+
+DOCUMENTATION can be obtained by running LaTeX on `moresize.dtx'.
+
+For general use, move `moresize.sty' into the LaTeX input files area
+and `moresize.dtx' and `moresize.ins' to the LaTeX documentation input files
+area (which might be the same as the LaTeX input files area).
+
+Happy LaTeXing,
+
+1999/07/26 Christian Cornelssen <cornsub1@flintstone.ukbf.fu-berlin.de>
diff --git a/Master/texmf-dist/source/latex/oldstyle/oldstyle.dtx b/Master/texmf-dist/source/latex/oldstyle/oldstyle.dtx
new file mode 100644
index 00000000000..ec40bfabf79
--- /dev/null
+++ b/Master/texmf-dist/source/latex/oldstyle/oldstyle.dtx
@@ -0,0 +1,144 @@
+% \iffalse meta-comment
+%
+% Copyright 1995,1999 The University of Cambridge and Robin Fairbairns.
+% All rights reserved.
+%
+% This file is distributed under the conditions of the LaTeX Project
+% Public Licence; see the file lppl.txt in the LaTeX distribution for
+% details.
+%
+% \fi
+% \CheckSum{22}
+%
+% \section*{Document Preambles}
+%
+% \begin{macrocode}
+%<*!(driver|Ucmm)>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+%</!(driver|Ucmm)>
+%<Ucmm> \ProvidesFile{Ucmm.fd}%
+%<oldstyle>\ProvidesPackage{oldstyle}%
+%<*driver>
+ \ProvidesFile{oldstyle.dtx}%
+%</driver>
+ [1999/05/17 v0.2 Oldstyle numerals font definitions]
+% \end{macrocode}
+% \iffalse (we don't want to typeset this rubbish)
+%
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{oldstyle.dtx}
+\usepackage{oldstyle}
+\title{The file \texttt{oldstyle.dtx} for use with
+ \LaTeXe.\thanks{This file has version
+ number \fileversion, dated \filedate.}}
+\date{Printed \today}
+\author{Robin Fairbairns}
+\begin{document}
+\maketitle
+ \DocInput{oldstyle.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%
+% \section{Introduction}
+%
+% This file contains the external font information needed to load the
+% |cmmi| and |cmmib| fonts for use to produce oldstyle numbers in
+% \LaTeX{} text, together with a trivial \LaTeXe{} package to
+% enable them to be used in LaTeX text.
+%
+% The package |oldstyle| implements two commands (one in \LaTeX~2.09
+% style~--- |\oldstyle|~--- and one in \LaTeXe{} style~--- |\textos|).
+%
+% The numbers look like this:
+%
+% \begin{center}\sf
+% \begin{tabular}{ll}
+% Command & Typeset text \\
+% \hline
+% |0123456789| & \textrm{0123456789} \\
+% & (normal numbers) \\
+% |\textos{0123456789}| & \textos{0123456789} \\
+% |\textbf{0123456789}| & \textbf{\textrm{0123456789}} \\
+% & (normal boldface) \\
+% |\textbf{%| & \\
+% | \textos{0123456789}}| & \textbf{\textos{0123456789}}
+% \end{tabular}
+% \end{center}
+%
+% These macros do not currently address the use of old-style numerals
+% from the {\small TS}1 encoding. I do have macros for doing such a
+% thing, but haven't yet integrated them with this environment.
+%
+% \StopEventually{}
+%
+% \section{The \texttt{.fd} file}
+%
+% The |.fd| file specifies a version of the font family |cmm| in |U|
+% encoding. This is the best I could think of (only the digits are
+% oldstyle numbers, after all).
+%
+% I have done what I believe to be the \emph{proper}, and made
+% oldstyle a new font shape, but I'm not (yet) sure about the `name'
+% (|os|) I've given it. Hence, this release is still only preliminary.
+%
+% \begin{macrocode}
+%<*Ucmm>
+\DeclareFontFamily{U}{cmm}{\skewchar\font'177}
+\DeclareFontShape{U}{cmm}{m}{os}
+ { <5> <6> <7> <8> <9> gen * cmmi
+ <10><10.95>cmmi10
+ <12><14.4><17.28><20.74><24.88>cmmi12
+ }{}
+\DeclareFontShape{U}{cmm}{b}{os}{%
+ <5> <6> <7> <8> <9> gen * cmmib
+ <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> cmmib10
+ }{}
+\DeclareFontShape{U}{cmm}{bx}{os}
+ {<-> ssub * cmm/b/os}{}
+%</Ucmm>
+% \end{macrocode}
+%
+% \section{The \texttt{.sty} file}
+%
+% The package is also trivial. It defines an oldstyle family and then
+% declares commands to use it.
+%
+% \begin{macrocode}
+%<*oldstyle>
+\DeclareOldFontCommand {\oldstyle}{\usefont{U}{cmm}{m}{os}}%
+ {\mathos}
+\DeclareTextFontCommand{\textos}{\oldstylefamily}
+\DeclareMathAlphabet {\mathos}{U}{cmm}{m}{os}
+% \end{macrocode}
+%
+% A series of constructs follows that enable the above to work; the
+% constructs are mostly copied from the source of \LaTeXe{} itself.
+% \begin{macrocode}
+\DeclareRobustCommand\oldstylefamily{%
+ \not@math@alphabet\osshape\mathos
+ \usefont{U}{cmm}\f@series{os}}
+%</oldstyle>
+% \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/latex/oldstyle/oldstyle.ins b/Master/texmf-dist/source/latex/oldstyle/oldstyle.ins
new file mode 100644
index 00000000000..2483e15845d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/oldstyle/oldstyle.ins
@@ -0,0 +1,25 @@
+\def\batchfile{oldstyle.ins}
+\input docstrip.tex
+
+\keepsilent
+\askforoverwritefalse
+
+\generate{\file{Ucmm.fd}{\from{oldstyle.dtx}{Ucmm}}%
+ \file{oldstyle.sty}{\from{oldstyle.dtx}{oldstyle}}}
+
+\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 Ucmm.fd, oldstyle.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file}
+\Msg{* `oldstyle.dtx' through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/petri-nets/COPYING b/Master/texmf-dist/source/latex/petri-nets/COPYING
new file mode 100644
index 00000000000..60549be514a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/petri-nets/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 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
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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/latex/petri-nets/pn2pdf b/Master/texmf-dist/source/latex/petri-nets/pn2pdf
new file mode 100644
index 00000000000..38f2deda1eb
--- /dev/null
+++ b/Master/texmf-dist/source/latex/petri-nets/pn2pdf
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+
+## This file is part of the Petri-nets packages. See file README for
+## copyright notice.
+
+use strict;
+use Digest::MD5 qw(md5_hex);
+
+my $keep = 0;
+
+foreach my $job (@ARGV) {
+ ##
+ ## check argument
+ ##
+ if ($job =~ /^(-k|--keep)$/) {
+ $keep = 1;
+ next;
+ } elsif ($job =~ /^(-c|--clean)$/) {
+ $keep = 0;
+ next;
+ } elsif ($job =~ /^(-f|--force)$/) {
+ unlink "$job.sum" if -f "$job.sum";
+ next;
+ } elsif ($job =~ /^(-h|--help)$/) {
+ print "Usage: pn2pdf [OPTION]... DOC...\n";
+ print "Create Petri net figures from DOC.\n\n";
+ print " -k, --keep keep temporary files\n";
+ print " -c, --clean delete temporary files\n";
+ print " -f, --force force the rendering of all pictures\n";
+ print " -h, --help display this help and exit\n\n";
+ print "Report bugs to <pommereau\@univ-paris12.fr>\n";
+ exit 0;
+ }
+ ##
+ ## load MD5 sums if available
+ ##
+ my %sum = ();
+ if (-f "$job.sum") {
+ open SUM, "$job.sum"
+ or die "pn2pdf: unable to open $job.sum -- $!\n";
+ while (<SUM>) {
+ if (/(\d+)\s+(.*)/) {
+ $sum{$1} = $2;
+ } else {
+ warn "pn2pdf: invalid checksum in $job.sum\n";
+ }
+ }
+ close SUM;
+ }
+ ##
+ ## process file
+ ##
+ my $preamble = "";
+ open TEX, "$job.tex"
+ or die "pn2pdf: unable to open $job.tex -- $!\n";
+ open SUM, ">$job.sum"
+ or die "pn2pdf: unable to open $job.sum -- $!\n";
+ while (<TEX>) {
+ $preamble .= $_;
+ last if /\\begin\{document\}/;
+ $preamble =~ s/(\\begin\{document\}).*$/$1/;
+ }
+ $preamble .= "\\thispagestyle\{empty\}\n";
+ my $count = 0;
+ my $petrinet;
+ while (<TEX>) {
+ last if /^\\end\{document\}$/;
+ if (/(\\begin\{petrinet\}.*)/) {
+ $count++;
+ $petrinet = "$1\n";
+ while (<TEX>) {
+ $petrinet .= $_;
+ last if /\\end\{petrinet\}/;
+ }
+ $petrinet =~ s/(\\end\{petrinet\}).*$/$1\n/;
+ ##
+ ## create fig-file
+ ##
+ my $md5 = md5_hex ("$preamble$petrinet");
+ print SUM "$count $md5\n";
+ next if ($md5 eq $sum{$count}) && (-f "$job-fig$count.pdf");
+ open FIG, ">$job-fig$count.tex"
+ or die "pn2pdf: unable to open $job-fig$count.tex -- $!\n";
+ print FIG "$preamble$petrinet\\end\{document\}\n";
+ close FIG;
+ ##
+ ## process fig-file
+ ##
+ system "latex", "$job-fig$count";
+ system "dvips", ("-E", "-Pcmz", "-Pamz",
+ "-o", "$job-fig$count.eps",
+ "$job-fig$count");
+ system "epstopdf", "$job-fig$count.eps";
+ unlink ("$job-fig$count.tex", "$job-fig$count.log",
+ "$job-fig$count.aux", "$job-fig$count.dvi",
+ "$job-fig$count.eps") unless $keep;
+ }
+ }
+ close TEX;
+ close SUM;
+}
+
diff --git a/Master/texmf-dist/source/latex/pict2e/p2e-drivers.dtx b/Master/texmf-dist/source/latex/pict2e/p2e-drivers.dtx
new file mode 100644
index 00000000000..13b716b4a2c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pict2e/p2e-drivers.dtx
@@ -0,0 +1,526 @@
+% \iffalse meta-comment
+%
+% p2e-drivers.dtx
+% Time-stamp: "p2e-drivers.dtx 2004-06-25 08:23:34 CEST Friday hubertjg"
+%
+%
+% Copyright (C) 2003, 2004
+% Rolf Niepraschk, Rolf.Niepraschk@ptb.de
+% Hubert Gaesslein, HubertJG@open.mind.de
+%
+%
+% This work 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 "author-maintained".
+%
+% This work consists of all files listed in manifest.txt.
+%
+%
+% This file is part of the New Implementation of the Standard LaTeX
+% picture commands (package pict2e). It complements the file
+% drivers.dtx from the Standard LaTeX `Graphics Bundle'.
+%
+%
+%<template, >\ProvidesFile{p2e-template.def}
+%<dvips, >\ProvidesFile{p2e-dvips.def}
+%<xdvi, >\ProvidesFile{p2e-xdvi.def}
+%<pdftex, >\ProvidesFile{p2e-pdftex.def}
+%<vtex, >\ProvidesFile{p2e-vtex.def}
+%<dvipdfm, >\ProvidesFile{p2e-dvipdfm.def}
+%<textures, >\ProvidesFile{p2e-textures.def}
+%<pctexps, >\ProvidesFile{p2e-pctexps.def}
+%<pctex32, >\ProvidesFile{p2e-pctex32.def}
+%
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesFile{p2e-drivers.dtx}
+%</driver>
+%
+%<cfg>\ProvidesFile{pict2e.cfg}%
+ [2004/06/25 v0.1r
+%<*!cfg>
+ Driver-dependant file (RN,HjG)]
+%</!cfg>
+%<cfg> pict2e configuration for teTeX/TeXLive]
+%
+%<*driver>
+\documentclass{ltxdoc}
+ \GetFileInfo{p2e-drivers.dtx}
+ \def\docdate{2004/06/25}
+\begin{document}
+ \title{Graphics drivers for \textsf{pict2e}\thanks
+ {This document corresponds to \textsf{\filename} \fileversion,
+ dated \filedate, documentation dated \docdate.}}
+ \author{Rolf Niepraschk\thanks{\texttt{Rolf.Niepraschk@ptb.de}}
+ \,and Hubert G\"a{\ss}lein\thanks{\texttt{HubertJG@open.mind.de}}}
+ \date{\filedate}
+ % \maketitle
+ \DocInput{p2e-drivers.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{101}
+%
+% \changes{v0.1g}{2003/11/07}{Translated documentation to English (HjG)}
+% \changes{v0.1g}{2003/11/07}{Added driver \texttt{dvipdfm} (RN)}
+% \changes{v0.1h}{2003/11/12}{Move check for \texttt{ver@\backslash Gin@driver}
+% to package pict2e (RN,HjG)}
+% \changes{v0.1h}{2003/11/12}{General cleaning (RN,HjG)}
+% \changes{v0.1h}{2003/11/12}{More general cleaning (HjG)}
+% \changes{v0.1i}{2003/11/22}{M-x delete-trailing-whitespace (HjG)}
+% \changes{v0.1j}{2003/12/13}{Resurrect reference to latexbugs address (HjG)}
+% \changes{v0.1j}{2003/12/13}{Try new driver for \textsf{xdvi}---to no avail (HjG)}
+% \changes{v0.1k}{2003/12/18}{Polish up documentation (HjG)}
+% \changes{v0.1l}{2003/12/19}{Some tentative entries for new drivers (HjG)}
+% \changes{v0.1l}{2003/12/19}{Polish up documentation (HjG)}
+% \changes{v0.1m}{2003/12/21}{Polish up documentation (HjG)}
+% \changes{v0.1o}{2004/02/19}{Fix some typos (HjG)}
+% \changes{v0.1p}{2004/03/26}{Minor changes to documentation (HjG)}
+% \changes{v0.1q}{2004/04/22}{Added lppl (RN/HjG)}
+% \changes{v0.1r}{2004/06/25}{Small fixes in documentation (HjG)}
+%
+% \newcommand*\PS{PostScript}
+% \newcommand*\PDF{PDF}
+% \newcommand*\teTeX{te\kern-.11em\TeX}
+% \newcommand*\TeXlive{\TeX live}
+%
+% \makeatletter
+% \@ifundefined{ifdeveloping}{\newif\ifdeveloping}{} ^^A false by default
+% \makeatother
+%
+% \ifdeveloping
+% \makeatletter
+%
+% \newcommand*\isodattim{}
+% \begingroup
+% \count@\time
+% \divide\count@ 60
+% \count2=-\count@
+% \multiply\count2 60
+% \advance\count2 \time
+% \xdef\isodattim{^^A
+% \the\year-\two@digits{\the\month}-\two@digits{\the\day}^^A
+% ~\two@digits{\the\count@}:\two@digits{\the\count2}}
+% \endgroup
+%
+% \newcommand*\ps@myfootings{^^A cf. \ps@plain
+% \let\@mkboth\@gobbletwo
+% \let\@oddhead\@empty
+% \let\@evenhead\@empty
+% \def\@oddfoot{\reset@font
+% \rlap{\textsf{\filename}~\fileversion~\filedate}^^A
+% \hfil\thepage\hfil
+% \llap{\TeX ed \texttt{\isodattim}}}^^A
+% \def\@evenfoot{\reset@font
+% \rlap{\TeX ed \texttt{\isodattim}}^^A
+% \hfil\thepage\hfil
+% \llap{\filedate~\fileversion~\textsf{\filename}}}^^A
+% }
+% \pagestyle{myfootings}
+% \let\pagestyle\@gobble
+% \let\thispagestyle\@gobble
+%
+% \makeatother
+% \else
+% \makeatletter
+% ^^A \ifdim\overfullrule>\z@\else\let\ps@myfootings\ps@plain\fi
+% \makeatother
+% \fi
+%
+%
+% \maketitle
+%
+%
+% \section{Driver files}
+%
+% This file implements some of the currently supported drivers for
+% the new version of the \textsf{pict2e} package.
+% If the driver you use is not in this list then a `\texttt{.def}'
+% file may be distributed with the pict2e package,
+% or may be distributed with the standard \LaTeX\ graphics bundle,
+% or may be distributed with your driver.
+%
+% If not, send us some details of the driver's |\special| syntax, and
+% we will try to produce a suitable file.
+%
+% Note that some of these files are for graphics drivers to which we
+% have no access, so they are untested.
+% Please send any corrections to the latexbugs address or directly to
+% the authors.
+%
+% \StopEventually{}
+%
+% \subsection{Template}
+%
+% A template for a \textsf{pict2e} driver file.
+%
+% \begin{macro}{\pIIe@mode}
+% This macro serves as an indicator to the \textsf{pict2e} package
+% which mode the driver supports:
+%
+% \smallskip
+% \begin{tabular}{rl}
+% $-1$ & inapt\slash incapable (default,
+% already set in \textsf{pict2e}) \\
+% $0$ & standard \LaTeX\ only \\
+% $1$ & \PS \\
+% $2$ & \PDF \\
+% & (other values are reserved for future use)
+% \end{tabular}
+% \smallskip
+%
+% \noindent
+% Incapable drivers should not alter the default value given by the
+% \textsf{pict2e} package, or set it explicitly to $-1$.
+% ^^A (Or set it to $0$ to request standard \LaTeX\ mode.)
+% \begin{macrocode}
+%<*template>
+\def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% The \textsf{pict2e} package expects the driver file to define the
+% \cmd{\pIIe@code} command in a suitable way.
+%
+% This command should locally establish the standard \PS\slash\PDF\
+% coordinate system
+% (i.e., a cartesian coordinate system
+% with positive x-axis pointing right
+% and positive y-axis pointing up,
+% and with unit $1\,\mathrm{bp} = 1/72\,\mathrm{in}$),
+% albeit with the origin at \TeX's current point instead of the lower
+% left corner of the page.
+%
+% Furthermore, it should save and restore the graphics state
+% (|gsave|\slash|grestore| in \PS, |q|\slash|Q| in \PDF.)
+% This may be achieved by using appropriate \cmd{\special} (or
+% \cmd{\pdfliteral}, respectively) commands.
+%
+% Moreover, this command should preserve (i.e., it should not change)
+% the current colour as defined by the user via the commands of the
+% \textsf{color} package from the graphics bundle.
+%
+% Thus, the \cmd{\Gin@PS@restored} command that various
+% \meta{driver}|.def| files from the graphics bundle provide should
+% usually come close to what is expected here.
+% \begin{macrocode}
+\def\pIIe@code#1{}
+%</template>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{dvips}
+%
+% A \textsf{pict2e} driver file for the \textsf{dvips} driver.
+%
+% \begin{macro}{\pIIe@mode}
+% We are about to generate \PS\ code.
+% \begin{macrocode}
+%<*dvips>
+\def\pIIe@mode{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% In this case the code inserted by the driver on behalf of the
+% \cmd{\Gin@PS@restored} command performs a ``|0| |setgray|''
+% operation, thus resetting any colour the user might have set by
+% means of the \textsf{color} package.
+% \ (See also \LaTeX\ problem report graphics/3569.) \ ^^A
+% We therefore have to resort to the following kludge:
+% As long as we output only simple picture objects, our operations are
+% ``atomic.''
+% Hence, we won't need to set colours or gray shades within the \PS\
+% code generated by \textsf{pict2e};
+% thus the offending |setgray| operator may as well be a no-op.
+% To keep this redefinition local, we enclose the call to
+% \cmd{\Gin@PS@restored} by a |save|\slash|restore| pair.
+% \changes{v0.1}{2003/08/27}{Fix for dvips' \cmd{\Gin@PS@restored}
+% (prevent resetting current color to black). (HjG,RN)}
+% \begin{macrocode}
+\def\pIIe@code#1{%
+ \Gin@PS@raw{save /setgray { pop } def}%
+ \Gin@PS@restored{#1}%
+ \Gin@PS@raw{restore}%
+}
+%</dvips>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{pdftex}
+%
+% A \textsf{pict2e} driver file for the \textsf{pdftex} driver.
+%
+% \begin{macro}{\pIIe@mode}
+% We are about to generate \PDF\ code.
+% (Only, if pdf\TeX\ is actually generating \PDF;
+% otherwise nothing will be output.)
+% \begin{macrocode}
+%<*pdftex>
+\begingroup
+ \@ifundefined{pdfoutput}{}{%
+ \ifnum\pdfoutput>0\relax
+ \gdef\pIIe@mode{2}
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% The save\slash restore operators are necessary here to prevent the
+% change of the CTM (scaling and rotation operations) that
+% \textsf{pict2e} inserts from propagating.
+% \begin{macrocode}
+\ifcase\pIIe@mode\relax \or\or
+ \def\pIIe@code#1{\pdfliteral{ q #1 Q }}
+\fi
+%</pdftex>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{vtex}
+%
+% A \textsf{pict2e} driver file for the \textsf{vtex} driver.
+%
+% \begin{macro}{\pIIe@mode}
+% With \textsf{V\TeX}, we should use \PS\ code also for \PDF\ mode
+% (Email from Michael Vulis, MicroPress).
+% \begin{macrocode}
+%<*vtex>
+\begingroup
+ \@ifundefined{VTeXversion}{}{%
+ \ifnum\OpMode>0\relax
+ \ifnum\OpMode<3\relax
+ \gdef\pIIe@mode{1}%
+ \fi
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% Here |\Gin@PS@restored| suffices as provided by the graphics driver
+% file |vtex.def|.
+% \begin{macrocode}
+\ifcase\pIIe@mode\relax \or
+ \let\pIIe@code\Gin@PS@restored
+\fi
+%</vtex>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{dvipdfm}
+%
+% A \textsf{pict2e} driver file for the \textsf{dvipdfm} driver.
+%
+% \begin{macro}{\pIIe@mode}
+% We are about to generate \PDF\ code.
+% \begin{macrocode}
+%<*dvipdfm>
+\def\pIIe@mode{2}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% This seems to be sufficient.
+% \begin{macrocode}
+\def\pIIe@code#1{\special{pdf: content #1}}
+%</dvipdfm>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%\iffalse
+% \subsection{xdvi}
+%
+% A \textsf{pict2e} driver file for the \textsf{xdvi} driver.
+%
+% \begin{macro}{\pIIe@mode}
+% We are about to generate \PS\ code.
+% \begin{macrocode}
+%<*xdvi>
+\def\pIIe@mode{1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% As long as our operations are ``atomic,'' we won't need to set
+% colours or gray shades within our code, hence the offending
+% \verb+setgray+ operator may as well be a no-op.
+% See also \LaTeX\ problem report graphics/3569.
+% \changes{v0.1}{2003/08/27}{Fix for dvips' \cmd{\Gin@PS@restored}
+% (prevent resetting current color to black). (HjG,RN)}
+% \begin{macrocode}
+\def\pIIe@code#1{%
+ % \Gin@PS@raw{save /setgray { pop } def}%
+ \Gin@PS@restored{#1}%
+ % \Gin@PS@raw{restore}%
+}
+%</xdvi>
+% \end{macrocode}
+% \end{macro}
+%\fi
+%
+%
+% \subsection{dvipdf}
+%
+% A \textsf{pict2e} driver file for the \textsf{dvipdf} driver
+% (not yet implemented).
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macrocode}
+%<*dvipdf>
+ %\def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% This is the same as the definition for |\Gin@PS@restored|
+% in |dvipdf.def| as defined in |drivers.dtx|!
+% Better use the higher-level macro instead of the |\special|?
+% \begin{macrocode}
+ %\def\pIIe@code#1{\special{" #1}} % \Gin@PS@restored{#1}
+%</dvipdf>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{textures}
+%
+% A \textsf{pict2e} driver file for the \textsf{textures} driver
+% (not yet implemented).
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macrocode}
+%<*textures>
+ % \def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% \begin{macrocode}
+ % \def\pIIe@code#1{}
+%</textures>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{dvipsone}
+%
+% A \textsf{pict2e} driver file for the \textsf{dvipsone} driver
+% (not yet implemented).
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macrocode}
+%<*dvipsone>
+ % \def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% \begin{macrocode}
+ % \def\pIIe@code#1{}
+%</dvipsone>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{pctexps}
+%
+% A \textsf{pict2e} driver file for the \textsf{pctexps} driver
+% (not yet implemented).
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macrocode}
+%<*pctexps>
+ % \def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% \begin{macrocode}
+ % \def\pIIe@code#1{}
+%</pctexps>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{pctex32}
+%
+% A \textsf{pict2e} driver file for the \textsf{pctex32} driver
+% (not yet implemented).
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macrocode}
+%<*pctex32>
+ % \def\pIIe@mode{-1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@code}
+% \begin{macrocode}
+ % \def\pIIe@code#1{}
+%</pctex32>
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{A Sample Configuration File}
+%
+% ^^A Preamble?
+%
+% This one is taken from |color.cfg| of the
+% \teTeX\slash\TeXlive\ distributions.
+% \begin{macrocode}
+%<*cfg>
+%% Select an appropriate default driver.
+\begingroup
+ \chardef\x=0 %
+ % check pdfTeX
+ \@ifundefined{pdfoutput}{}{%
+ \ifcase\pdfoutput
+ \else
+ \chardef\x=1 %
+ \fi
+ }%
+ % check VTeX
+ \@ifundefined{OpMode}{}{%
+ \chardef\x=2 %
+ }%
+\expandafter\endgroup
+\ifcase\x
+ % default case
+ \ExecuteOptions{dvips}%
+\or
+ % pdfTeX is running in pdf mode
+ \ExecuteOptions{pdftex}%
+\else
+ % VTeX is running
+ \ExecuteOptions{vtex}%
+\fi
+% \end{macrocode}
+% You can also specify other options to the \textsf{pict2e} package in
+% the configuration file.
+% For example, if you prefer PSTricks-like arrows, just uncomment the
+% line below.
+% \begin{macrocode}
+%% \ExecuteOptions{pstarrows}
+%</cfg>
+% \end{macrocode}
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/pict2e/pict2e.dtx b/Master/texmf-dist/source/latex/pict2e/pict2e.dtx
new file mode 100644
index 00000000000..19d15341143
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pict2e/pict2e.dtx
@@ -0,0 +1,3239 @@
+% \iffalse meta-comment
+%
+% Time-stamp: "pict2e.dtx 2004-08-06 15:01:38 CEST Tuesday hubertjg"
+%
+%
+% Copyright (C) 2003, 2004
+% Rolf Niepraschk, Rolf.Niepraschk@ptb.de
+% Hubert Gaesslein, HubertJG@open.mind.de
+%
+%
+% This work 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 "author-maintained".
+%
+% This work consists of all files listed in manifest.txt.
+%
+%
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] % ???
+%<package>\ProvidesPackage{pict2e}
+%<package> [2004/08/06 v0.2q Improved picture commands (HjG,RN)]
+%
+%<*driver>
+\listfiles
+\errorcontextlines5
+\documentclass{ltxdoc}
+\usepackage{pict2e} % [pstarrows]
+%%\usepackage[debug]{pict2e}
+\IfFileExists{ebezier.sty}{\usepackage{ebezier}}{%
+ } % \providecommand*\cbezier{}
+\usepackage{color}
+\usepackage{graphicx}
+\usepackage{array}
+%%\usepackage{pstcol}
+\usepackage{longtable}
+\IfFileExists{geometry.sty}{%
+ \usepackage[left=\marginparwidth,textwidth=1.15\textwidth,%
+ top=20mm,bottom=30mm]{geometry}}{}
+\IfFileExists{url.sty}{\usepackage{url}}
+ {\newcommand*\url[1]{\texttt{#1}}}
+%%\OnlyDescription
+%%\AlsoImplementation
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+%%\tracingmacros\maxdimen
+%%\tracingall \tracingonline0
+%%\loggingall
+ \setlength\emergencystretch{3em}
+ \DocInput{pict2e.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{pict2e.sty}
+% \def\docdate{2004/08/06}
+%
+% \CheckSum{1499}
+%
+% ^^A ========
+%
+% \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 \~}
+%
+%
+% ^^A ========
+%
+% \makeatletter
+% \@ifundefined{ifdeveloping}{\newif\ifdeveloping}{} ^^A false by default
+% \makeatother
+%
+% ^^A ========
+%
+% \ifdeveloping ^^A Should be further refined
+%
+% \changes{v0.1a}{2003/07/18}{First version. New code for \cmd{\@sline}. (RN)}
+% \changes{v0.1b}{2003/07/20}{New code for \cmd{\@circle} and \cmd{\@dot}
+% added. (RN)}
+% \changes{v0.1c}{2003/07/21}{More flexibility with sampling the graphic
+% operators in token register (\cmd{\pIIe@GRAPH}). (RN)}
+% \changes{v0.1c}{2003/07/21}{Code for \cmd{\@bezier} added. (RN)}
+% \changes{v0.1d}{2003/07/22}{New code for \cmd{\cbezier}
+% (package `ebezier'). (RN)}
+% \changes{v0.1e}{2003/07/24}{New option ``debug''}
+% \changes{v0.1f}{2003/08/17}{Changed mode numbers. (RN)}
+% \changes{v0.1f}{2003/08/17}{\cmd{\pIIe@add@rcurveto} added. (RN)}
+% \changes{v0.1f}{2003/08/17}{\cmd{\pIIe@add@XY} added. (RN)}
+% \changes{v0.1g}{2003/08/23}{Changed code for \cmd{\pIIe@add@qcircle}.
+% (HjG,RN)}
+% \changes{v0.1g}{2003/08/23}{New code for \cmd{\@oval}. (HjG,RN)}
+% \changes{v0.1i}{2003/08/28}{Translation, scaling, rotation added. (HjG,RN)}
+% \changes{v0.1j}{2003/08/29}{Loads now `color.cfg' instead of `graphics.cfg'
+% for system default driver (no more trouble with commands like
+% \cmd{\DeclareGraphicsRule}) (RN)}
+% \changes{v0.1j}{2003/08/29}{Driver specific code now in new files
+% ``p2e-DRIVER.def''. (RN)}
+% \changes{v0.1k}{2003/08/30}{\cmd{\pIIe@PTtoBP} removed. Scaling with
+% PS/PDF code instead. (RN)}
+% \changes{v0.1l}{2003/09/24}{First implementation of \cmd{\vector}. (RN,HjG)}
+% \changes{v0.1m}{2003/09/26}{\cmd{\vector} complete (arctan version). (RN,HjG)}
+% \changes{v0.1n}{2003/10/01}{Loads now the own configuration file `pict2e.cfg'
+% instead of `color.cfg' (RN,HjG)}
+% \changes{v0.1n}{2003/10/01}{New Option `hide' suppresses the ps or pdf output (RN)}
+% \changes{v0.1o}{2003/10/17}{New implementation of opt. arg. to \cmd{\oval} (HjG,RN)}
+% \changes{v0.1p}{2003/10/29}{Improve \cmd{\@sline} (HjG,RN)}
+% \changes{v0.1p}{2003/10/29}{Some cleaning (HjG,RN)}
+% \changes{v0.1p}{2003/10/29}{Rudimentary Documentation, translated to English (HjG,RN)}
+% \changes{v0.1q}{2003/11/02}{Small fixes in documentation (HjG)}
+% \changes{v0.1r}{2003/11/12}{Cleaning and revamping (RN,HjG)}
+% \changes{v0.1r}{2003/11/12}{Rename commands: operators get `@op' suffix,
+% drawing commands loose `@add' (RN,HjG)}
+% \changes{v0.1s}{2003/11/13}{Avoid use of dimen registers
+% \cmd{\@tempdima} and \cmd{\@tempdimb} in all but low level auxillary
+% macros -- avoid potential pitfall (RN,HjG)}
+% \changes{v0.1t}{2003/11/13}{Some code and documentation cleaning (RN)}
+% \changes{v0.1u}{2003/11/18}{M-x delete-trailing-whitespace (HjG)}
+% \changes{v0.1u}{2003/11/19}{Some cleaning and revamping (HjG)}
+% \changes{v0.1u}{2003/11/20}{Finally, bring code snippets in a more
+% meaningful order (HjG)}
+% \changes{v0.1u}{2003/11/21}{Save many tokens by introducing ancillary macros (HjG)}
+% \changes{v0.1v}{2003/11/21}{More cleaning and revamping (HjG)}
+% \changes{v0.1v}{2003/11/22}{Return of ``cleaning and revamping'' (HjG)}
+% \changes{v0.1w}{2003/11/25}{Son of ``cleaning and revamping'' (HjG)}
+% \changes{v0.1w}{2003/11/25}{More documentation about usage (HjG)}
+% \changes{v0.1w}{2003/11/27}{Small fixes (RN,HjG)}
+% \changes{v0.1x}{2003/11/27}{Improve PSTricks-like arrows. (RN,HjG)}
+% \changes{v0.1y}{2003/11/27}{Implement LaTeX-like arrows. (RN,HjG)}
+% \changes{v0.1z}{2003/12/04}{Change \cmd{\cbezier}. (RN,HjG)}
+% \changes{v0.2a}{2003/12/04}{Return of the son of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2a}{2003/12/05}{M-x delete-trailing-whitespace (HjG)}
+% \changes{v0.2}{2003/12/11}{Minor changes. (RN,HjG)}
+% \changes{v0.2b}{2003/12/13}{Merge v0.2a and v0.2 (HjG)}
+% \changes{v0.2c}{2003/12/13}{Grandson of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2c}{2003/12/13}{Try new driver for \textsf{xdvi}---to no avail (HjG)}
+% \changes{v0.2*}{2003/12/17}{Improve LaTeX-like arrows. (RN,HjG)}
+% \changes{v0.2d}{2003/12/18}{Merge v0.2c and v0.2*. (HjG)}
+% \changes{v0.2e}{2003/12/18}{Merge new figures created by RN. (HjG)}
+% \changes{v0.2e}{2003/12/19}{Return of the grandson of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2f}{2003/12/19}{Cousin of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2f}{2003/12/20}{Return of the cousin of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2g}{2003/12/21}{Nephew of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2h}{2004/01/07}{Documentation and small code improvements (RN,HjG)}
+% \changes{v0.2i}{2004/01/29}{Slope arguments for \cmd{\vector} restricted
+% to values $\vert s \vert \le 1000$ (RN,HjG)}
+% \changes{v0.2i*}{2004/02/11}{Final touches for release (RN)}
+% \changes{v0.2j}{2004/02/19}{Final touches for release (HjG)}
+% \changes{v0.2k}{2004/03/24}{Return of the nephew of ``cleaning and revamping'' (HjG)}
+% \changes{v0.2k}{2004/03/26}{Better control for history entries
+% while debugging (HjG)}
+% \changes{v0.2l}{2004/04/08}{Added redefinition of \cmd{\line} (RN,HjG)}
+% \changes{v0.2m}{2004/04/10}{Minor touches (HjG)}
+% \changes{v0.2n}{2004/04/22}{Added lppl (RN,HjG)}
+% \changes{v0.2o}{2004/06/25}{Fix two bugs (HjG)}
+% \changes{v0.2o}{2004/06/25}{Numerous small fixes in documentation (HjG)}
+% \changes{v0.2p}{2004/07/06}{Small fixes in documentation (HjG)}
+%
+% \fi
+%
+% \changes{v0.1a}{2003/07/18}{First version. (RN)}
+% \changes{v0.2j}{2004/02/27}{First release to CTAN
+% (2004/02/19 v0.2j). (LaTeX Team)}
+% \changes{v0.2n}{2004/05/27}{Second release to CTAN
+% (2004/04/22 v0.2n). (RN/HjG)}
+% \changes{v0.2o}{2004/06/25}{Third release to CTAN
+% (2004/06/25 v0.2o). (RN/HjG)}
+% \changes{v0.2p}{2004/07/28}{Fourth release to CTAN
+% (2004/07/28 v0.2p). (RN)}
+% \changes{v0.2q}{2004/08/06}{Fourth release to CTAN
+% (2004/08/06 v0.2q). (RN/HjG)}
+%
+%
+% \DoNotIndex{\newcommand,\renewcommand,\newenvironment,\renewenvironment}
+% \DoNotIndex{\providecommand,\def,\edef,\let,\gdef,\xdef,\global,\newtoks}
+% \DoNotIndex{\RequirePackage,\DeclareOption,\ProcessOptions,\ExecuteOptions}
+% \DoNotIndex{\input,\InputIfFileExists}
+% \DoNotIndex{\@ifdefinable,\@ifundefined,\@percentchar}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage}
+% \DoNotIndex{\PackageError,\PackageWarning,\PackageWarningNoLine,\PackageInfo}
+% \DoNotIndex{\MessageBreak,\typeout}
+%
+% \DoNotIndex{\z@,\z@skip,\p@,\@ne,\tw@,\thr@@,\@iv,\two@fourteen,\strip@pt}
+% \DoNotIndex{\the,\if,\else,\or,\fi,\ifnum,\ifdim,\ifcase,\ifodd}
+% \DoNotIndex{\advance,\multiply,\divide}
+% \DoNotIndex{\@tfor,\do}
+% \DoNotIndex{\csname,\endcsname,\begingroup,\endgroup}
+% \DoNotIndex{\expandafter,\afterassignment,\noexpand}
+%
+% \changes{v0.1w}{2003/11/25}{Index use of temporary registers
+% while debugging (HjG)}
+% \changes{v0.2k}{2004/03/26}{Better control for indexing temporary
+% registers while debugging (HjG)}
+%^^A \ifdim0pt<\overfullrule\else
+% \ifdeveloping\else
+% \DoNotIndex{\@tempdima,\@tempdimb,\@tempdimc,\@tempcnta,\@tempcntb}
+% \DoNotIndex{\@halfwidth,\@wholewidth,\unitlength}
+% \DoNotIndex{\@clnwd,\@clnht,\@ovdx,\@ovdy,\@ovro,\@ovri,\@ovxx,\@ovyy}
+% \DoNotIndex{\@xarg,\@xdim,\@yarg,\@ydim,\@linelen,\@dashdim,\dimen@}
+% \fi
+%
+% \DoNotIndex{\reserved@a,\relax,\protect,\space}
+% \DoNotIndex{\if@tempswa,\@tempswatrue,\@tempswafalse}
+% \DoNotIndex{\if@ovt,\if@ovb,\if@ovl,\if@ovr}
+% \DoNotIndex{\@ovttrue,\@ovbtrue,\@ovltrue,\@ovrtrue}
+% \DoNotIndex{\@ovtfalse,\@ovbfalse,\@ovlfalse,\@ovrfalse}
+%
+% \DoNotIndex{\pdfcompresslevel}
+%
+% \DoNotIndex{\x,\y}
+% ^^A \DoNotIndex{}
+%
+% \newcommand*\BigIndent{\hspace{.2\linewidth}}
+% \renewcommand*\floatpagefraction{0.8}
+%
+% \newcommand*\PS{PostScript}
+% \newcommand*\PSTricks{PSTricks}
+% \newcommand*\PDF{PDF}
+% \newcommand*\SL{Standard \LaTeX}
+% ^^A stolen from pictex.tex
+% \newcommand*\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
+% \newcommand*\PiCTeX{\PiC\kern-.11em\TeX}
+% \newcommand*\teTeX{te\kern-.11em\TeX}
+% \newcommand*\TeXlive{\TeX live}
+%
+% \newenvironment*{ltxquote}{\quote\slshape}{\endquote}
+%
+% \changes{v0.2k}{2004/03/26}{Better control over funny pagestyle
+% while debugging (HjG)}
+% \changes{v0.2l}{2004/04/08}{Even better control over funny pagestyle
+% while debugging (RN)}
+% \ifdeveloping
+% \makeatletter
+%
+% \newcommand*\isodattim{}
+% \begingroup
+% \count@\time
+% \divide\count@ 60
+% \count2=-\count@
+% \multiply\count2 60
+% \advance\count2 \time
+% \xdef\isodattim{^^A
+% \the\year-\two@digits{\the\month}-\two@digits{\the\day}^^A
+% ~\two@digits{\the\count@}:\two@digits{\the\count2}}
+% \endgroup
+%
+% \newcommand*\ps@myfootings{^^A cf. \ps@plain
+% \let\@mkboth\@gobbletwo
+% \let\@oddhead\@empty
+% \let\@evenhead\@empty
+% \def\@oddfoot{\reset@font
+% \rlap{\textsf{\filename}~\fileversion~\filedate}^^A
+% \hfil\thepage\hfil
+% \llap{\TeX ed \texttt{\isodattim}}}^^A
+% \def\@evenfoot{\reset@font
+% \rlap{\TeX ed \texttt{\isodattim}}^^A
+% \hfil\thepage\hfil
+% \llap{\filedate~\fileversion~\textsf{\filename}}}^^A
+% }
+% \pagestyle{myfootings}
+% \let\pagestyle\@gobble
+% \let\thispagestyle\@gobble
+%
+% \makeatother
+% \else
+% \makeatletter
+% ^^A \ifdim\overfullrule>\z@\else\let\ps@myfootings\ps@plain\fi
+% \makeatother
+% \fi
+%
+% \DeleteShortVerb{\|}
+% \newcommand*\abs[1]{\ensuremath{|#1|}}
+% \MakeShortVerb{\|}
+%
+% ^^A ========
+%
+% \newcommand*\OPOINT{^^A
+% \begingroup
+% \setlength\unitlength{.8pt}^^A
+% \circle{5}^^A
+% \endgroup
+% }
+% \newcommand*\FPOINT{^^A
+% \begingroup
+% \setlength\unitlength{.8pt}^^A
+% \circle*{5}^^A
+% \endgroup
+% }
+% \newcommand*\THICKLINES{\linethickness{1.4pt}}
+% \newcommand*\CBEZIER[4]{^^A
+% \cbezier(#1)(#2)(#3)(#4)^^A
+% \put(#2){\FPOINT}\put(#3){\FPOINT}}
+%
+% \newcommand*\LINETEST[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \begin{minipage}{100\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(100,100)^^A (-50,-50)^^A
+% \put(0,0){\framebox(100,100){}}^^A
+% \linethickness{2.6\unitlength}
+% \put(0,0){\line(1,0){50}}^^A
+% \put(0,0){\line(2,1){50}}^^A
+% \put(0,0){\line(1,1){50}}^^A
+% \put(0,0){\line(1,2){50}}^^A
+% \put(0,0){\line(0,1){50}}^^A
+% \ifnum #1>0
+% \color{red}^^A
+% \linethickness{3.8\unitlength}^^A
+% \put(50,0){\line(966,259){25}}^^A 15 degrees
+% \put(50,0){\line(866,500){25}}^^A 30 degrees
+% \put(50,0){\line(707,707){25}}^^A 45 degrees
+% \put(50,0){\line(500,866){25}}^^A 60 degrees
+% \put(50,0){\line(259,966){25}}^^A 75 degrees
+% \normalcolor^^A
+% \fi
+% \color{blue}^^A
+% \thicklines
+% \put(50,0){\line(4,2){50}}
+% \put(50,0){\line(2,4){50}}
+% ^^A \put(50,0){\line(5,5){50}}
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\VECTORTEST[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \begin{minipage}{100\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(100,100)(-50,-50)^^A
+% \put(-50,-50){\framebox(100,100){}}^^A
+% \thinlines
+% \put(0,0){\vector(1,0){50}}^^A
+% \thicklines
+% \put(0,0){\vector(2,1){50}}^^A
+% \linethickness{1.4pt}^^A
+% \put(0,0){\vector(1,1){50}}^^A
+% \linethickness{2.0pt}^^A
+% \put(0,0){\vector(1,2){25}}^^A
+% \ifnum #1>0
+% \color{red}^^A
+% \linethickness{2.6pt}^^A
+% \put(0,0){\vector(259,966){13}}^^A 75 degrees
+% \linethickness{3.8pt}^^A
+% \put(0,0){\vector(-259,966){13}}^^A
+% \normalcolor^^A
+% \fi
+% \linethickness{3.2pt}^^A
+% \put(0,0){\vector(0,1){50}}^^A
+% \linethickness{4.4pt}^^A
+% \put(0,0){\vector(-1,1){50}}^^A
+% \linethickness{5.0pt}^^A
+% \put(0,0){\vector(-1,-1){50}}^^A
+% \linethickness{8.0pt}^^A
+% \put(0,0){\vector(1,-1){50}}^^A
+% \thicklines^^A
+% \thinlines^^A
+% \put(1,-30){\line(1,0){10}}^^A
+% \put(-1,-30){\line(-1,0){10}}^^A
+% \put(0,-30){\vector(0,-1){0}}^^A
+% \put(0,-30){\vector(1,1){0}}^^A
+% \put(0,-30){\vector(-1,1){0}}^^A
+% ^^A \put(0,15){\psline[linecolor=green,linewidth=8.0pt,unit=\unitlength]{->}(50,-50)}^^A
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\CIRCLETEST[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \setlength\fboxsep{0pt}
+% \fbox{^^A
+% \begin{minipage}{118\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(118,60)(-45,-30)^^A
+% \linethickness{1.6pt}^^A
+% \put(-30,0){\circle{15}}^^A
+% \put(-20,0){\circle{20}}^^A
+% \put(-10,0){\circle{25}}^^A
+% \put(0,0){\circle{30}}^^A
+% \put(10,0){\circle{35}}^^A
+% \put(20,0){\circle{40}}^^A
+% \put(30,0){\circle{45}}^^A
+% \put(40,0){\circle{50}}^^A
+% \end{picture}^^A
+% \par
+% \begin{picture}(118,35)(-45,-20)^^A
+% \put(-20,0){\circle*{30}}^^A
+% \put(-10,0){\circle*{25}}^^A
+% \put(0,0){\circle*{20}}^^A
+% \put(10,0){\circle*{15}}^^A
+% \put(20,0){\circle*{12}}^^A
+% \put(30,0){\circle*{9}}^^A
+% \put(40,0){\circle*{6}}^^A
+% \put(50,0){\circle*{3}}^^A
+% \end{picture}^^A
+% \end{minipage}}
+% }
+%
+% \newcommand*\OVALTESTi[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \begin{minipage}{100\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(100,80)^^A
+% \put(0,0){\framebox(100,80){}}
+% ^^A \linethickness{1\unitlength}
+% \thicklines
+% ^^A \color{blue}^^A
+% \put(55,40){\oval[2](80,70)[r]}^^A
+% \put(55,40){\oval[2](65,40)[r]}^^A
+% \put(55,40){\oval[2](60,20)[r]}^^A
+% \put(55,40){\oval[2](55,15)[r]}^^A
+% \put(55,40){\oval[2](50,10)[r]}^^A
+% \put(55,40){\oval[2](45,5)[r]}^^A
+% \put(55,40){\oval[2](40,2)[r]}^^A
+% ^^A \color{black}^^A
+% \put(45,40){\oval(80,70)[l]}^^A
+% \put(45,40){\oval(65,40)[l]}^^A
+% \put(45,40){\oval(60,20)[l]}^^A
+% \put(45,40){\oval(55,15)[l]}^^A
+% \put(45,40){\oval(50,10)[l]}^^A
+% \put(45,40){\oval(45,5)[l]}^^A
+% \put(45,40){\oval(40,2)[l]}^^A
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\OVALTESTii[1]{^^A
+% \renewcommand*\maxovalrad{#1}^^A
+% \setlength\unitlength{.0060\linewidth}^^A
+% \noindent
+% \begin{minipage}{155\unitlength}
+% \begin{picture}(155,50)^^A
+% \put(0,0){\framebox(155,50){}}^^A
+% \put(0,0){^^A NE
+% \setlength\unitlength{.5\unitlength}^^A
+% \begin{picture}(100,100)(-50,-50)^^A
+% \put(-50,-50){\framebox(100,100){}}^^A
+% \put(0,0){\oval(80,80)}%
+% \put(0,0){\makebox(0,0){2.5}}%
+% \end{picture}^^A
+% }^^A
+% \put(55,0){^^A NW
+% \setlength\unitlength{.4\unitlength}^^A
+% \begin{picture}(100,100)(-50,-50)^^A
+% \put(-50,-50){\framebox(100,100){}}^^A
+% \put(0,0){\oval(80,80)}%
+% \put(0,0){\makebox(0,0){2}}%
+% \end{picture}^^A
+% }^^A
+% \put(100,0){^^A SW
+% \setlength\unitlength{.3\unitlength}^^A
+% \begin{picture}(100,100)(-50,-50)^^A
+% \put(-50,-50){\framebox(100,100){}}^^A
+% \put(0,0){\oval(80,80)}%
+% \put(0,0){\makebox(0,0){1.5}}%
+% \end{picture}^^A
+% }^^A
+% \put(135,0){^^A SE
+% \setlength\unitlength{.2\unitlength}^^A
+% \begin{picture}(100,100)(-50,-50)^^A
+% \put(-50,-50){\framebox(100,100){}}^^A
+% \put(0,0){\oval(80,80)}%
+% \put(0,0){\makebox(0,0){1}}%
+% \end{picture}^^A
+% }^^A
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\QBEZIERTEST[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \begin{minipage}{120\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(120,100)^^A
+% \put(0,0){\framebox(120,100){}}
+% \qbezier[0](10,10)(40,90)(110,90)
+% \put(10,10){\FPOINT}\put(40,90){\OPOINT}\put(110,90){\FPOINT}
+% \color{green}^^A
+% \qbezier[0](10,10)(20,90)(30,10)
+% \put(10,10){\FPOINT}\put(20,90){\OPOINT}\put(30,10){\FPOINT}
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\CBEZIERTEST[1][1]{^^A
+% \setlength\unitlength{.01\linewidth}^^A
+% \begin{minipage}{80\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(80,80)(-40,-40)^^A
+% \put(-40,-40){\framebox(80,80){}}
+% \cbezier(-10,-10)(-30,30)(30,30)(30,-5)
+% \cbezier(30,-5)(30,-30)(0,-35)(-20,-20)
+% \put(-10,-10){\FPOINT}
+% \put(-30,30){\OPOINT}\put(30,30){\OPOINT}
+% \put(30,-5){\FPOINT}
+% \put(30,-30){\OPOINT}\put(0,-35){\OPOINT}
+% \put(-20,-20){\FPOINT}
+% \color{green}^^A
+% \cbezier(0,36)(24,36)(24,24)(0,0)
+% \cbezier(0,0)(-24,-24)(-24,-36)(0,-36)
+% \put(0,36){\FPOINT}
+% \put(24,36){\OPOINT}\put(24,24){\OPOINT}
+% \put(0,0){\FPOINT}
+% \put(-24,-24){\OPOINT}\put(-24,-36){\OPOINT}
+% \put(0,-36){\FPOINT}
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% \newcommand*\QCBEZIERTEST[1][1]{^^A
+% \setlength\unitlength{.007\linewidth}^^A
+% \begin{minipage}{100\unitlength}
+% \ifnum #1>0 \else\OriginalPictureCmds\fi^^A
+% \begin{picture}(100,120)(-50,-60)^^A
+% \put(-50,-60){\framebox(100,120){}}
+% \color{green}^^A
+% \qbezier[0](-40,-30)(-30,10)(0,10)
+% \qbezier[0](0,10)(30,10)(40,50)
+% \put(-40,-30){\FPOINT}\put(-30,10){\OPOINT}
+% \put(0,10){\FPOINT}
+% \put(30,10){\OPOINT}\put(40,50){\FPOINT}
+% \color{black}^^A
+% \cbezier[0](-40,-50)(-20,30)(20,-50)(40,30)
+% \put(-40,-50){\FPOINT}\put(-20,30){\OPOINT}
+% \put(20,-50){\OPOINT}\put(40,30){\FPOINT}
+% \end{picture}^^A
+% \end{minipage}
+% }
+%
+% ^^A ========
+%
+% \newcommand*\Acknowledgements{%
+% \section*{Acknowledgements}
+% We would like to thank Michael Wichura for granting us permission to
+% use his implementation of the algorithm for ``pythagorean addition''
+% from his \PiCTeX\ package.
+% Thanks go to Michael Vulis (MicroPress) for hints regarding a driver
+% for the \textsf{V\TeX} system.
+% Walter Schmidt has reviewed the documentation and code, and has
+% tested the V\TeX\ driver.
+% The members of the ``\TeX-Stamm\-tisch'' in Berlin, Germany, have
+% been involved in the development of this package as our guinea pigs,
+% i.e., alpha-testers;
+% Jens-Uwe Morawski and Herbert Voss have also been helpful with many
+% suggestions and discussions.
+% \par
+% Finally we thank the members of The \LaTeX\ Team for taking the time
+% to evaluate our new implementation of the picture mode commands, and
+% eventually accepting it as the ``official'' \textsf{pict2e} package,
+% as well as providing the \texttt{README} file.
+% \par
+% }
+%
+% ^^A ========
+%
+% \title{The \textsf{pict2e} package\thanks{This document
+% corresponds to \textsf{\filename} \fileversion,
+% dated \filedate, documentation dated \docdate.}}
+% \author{%
+% Hubert G\"a{\ss}lein\thanks{\texttt{HubertJG@open.mind.de}}
+% \,and
+% Rolf Niepraschk\thanks{\texttt{Rolf.Niepraschk@ptb.de}}}
+%
+% \date{\filedate}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package was described in the 2nd edition of ``\LaTeX{}: A
+% Document Preparation System'', but the \LaTeX{} project team
+% declined to produce the package.
+% For a long time, \LaTeX{} has included a ``pict2e package''
+% that merely produced an apologetic error message.
+%
+% The new package extends the existing \LaTeX{} \texttt{picture}
+% environment, using the familiar technique (cf.\ the
+% \textsf{graphics} and \textsf{color} packages) of driver
+% files.
+% In the user-level part of this documentation there is a fair
+% number of examples of use, showing where things are improved by
+% comparison with the \SL\ \texttt{picture} environment.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \listoffigures
+%
+% \section{Introduction}
+%
+% Here's a quote from the obsolete original official version of the
+% \textsf{pict2e} package (1993--2003):
+% \begin{ltxquote}
+% The package \textsf{pict2e} that is mentioned in the 2nd edition of
+% ``\LaTeX: A Document Preparation System'' has not yet been produced.
+% It is unlikely that the \LaTeX3 Project Team will ever produce this
+% package thus we would be very happy if someone else creates it.
+% \end{ltxquote}
+% Finally,
+% \marginpar[\hfill\texttt{:-)}]{\texttt{:-)}}
+% someone has produced a working implementation of the
+% \textsf{pict2e} package.
+%
+% This package redefines some of the drawing commands of the \LaTeX\ %
+% \textsf{picture} environment.
+% Like the \textsf{graphics} and \textsf{color} packages, it uses
+% driver files.
+%
+% ^^A Depending on the output format, we use \PS\ or \PDF\ Operators.
+% Currently there are only back-ends for \PS\ and \PDF.
+% (Other output formats may be added in the future.)
+%
+% \bigskip ^^A \pagebreak[2]
+% \noindent
+% Note/Warning:
+% \begin{itemize}
+% \item Documentation has been written somewhat ``hastily'' and may be
+% inaccurate.
+% \item
+% The status of this package is currently somewhere between ``beta''
+% and ``release'' \dots\
+% Users and package programmers should \emph{not} rely on
+% \emph{any} feature sported by the internal commands.
+% (Especially, the internal control sequence names may change without
+% notice in future versions of this package.)
+% \end{itemize}
+%
+% \section{Usage}
+%
+% To use the \textsf{pict2e} package, you put a
+% |\usepackage|\linebreak[0]\oarg{optionlist}\linebreak[0]|{pict2e}|
+% instruction in the preamble of your document.
+% Likewise, class or package writers just say
+% |\RequirePackage|\linebreak[0]\oarg{optionlist}\linebreak[0]|{pict2e}|
+% in an appropriate place in their class or package file.
+% (Nothing unusual here.)
+%
+% \noindent
+% Like the \textsf{graphics} and \textsf{color} packages, the
+% \textsf{pict2e} package supports a
+% configuration file (see Section~\ref{sec:cfg-file}).
+%
+% \subsection{Package options}
+%
+% \subsubsection{Driver options}
+%
+% \begin{minipage}{.5\textwidth}
+% \begin{tabular}{@{}lc@{\qquad\qquad}lc@{}}
+% driver & notes & driver & notes\\ \hline
+% dvips & x & dvipsone & x? \\
+% xdvi & x & dviwindo & x? \\
+% pdftex & x & dvipdf & x? \\
+% vtex & x & textures & x? \\
+% dvipdfm & x & pctexps & x? \\
+% oztex & (x) & pctex32 & x? \\ \hline
+% ^^A emtex & --
+% \end{tabular}
+%
+% \smallskip
+% \noindent x\,=\,supported; (x)\,=\,supported but untested; \par
+% \noindent x?\,=\,not yet implemented
+% ^^A --\,=\,unlikely to be ever supported
+% \end{minipage}
+%
+% \smallskip
+% The driver options are (mostly) implemented by means of definition
+% files (|p2e-|\meta{driver}\linebreak[0]|.def|).
+% For details, see file \texttt{p2e-drivers.dtx}.
+%
+% \begin{em}
+% Note:
+% You should specify the same driver for \textsf{pict2e} you use with
+% the \textsf{graphics/x} and \textsf{color} packages.
+% Otherwise, things may go haywire.
+% \par
+% \end{em}
+%
+% \subsubsection{Other options}
+%
+% Currently, there are two options that allow you to choose between
+% variants of the arrows-heads generated by the \cmd{\vector}
+% command.
+% See Figure~\ref{fig:vector:comparison}
+% in Section~\ref{sec:usage:vector} for the difference.
+%
+% \noindent
+% \begin{tabular}{@{}lp{.7\textwidth}@{}}
+% option & meaning \\
+% \hline
+% ltxarrows & Draw \LaTeX\ style vectors (default). \\
+% pstarrows & Draw \PSTricks\ style vectors. \\
+% \hline
+% \end{tabular}
+%
+% \subsubsection{Debugging options}
+%
+% These options are (mainly) for development and testing purposes.
+%
+% \noindent
+% \begin{tabular}{@{}lp{.7\textwidth}@{}}
+% option & meaning \\
+% \hline
+% original & Suppresses the new definitions. \\
+% debug & Suppresses the compressing of pdf\TeX\ output;
+% marks the \textsf{pict2e} generated code in the output
+% files. \\
+% hide & Suppresses all graphics output from \textsf{pict2e}. \\
+% \hline
+% \end{tabular}
+%
+% \subsection{Configuration file}
+% \label{sec:cfg-file}
+%
+% Similar to the \textsf{graphics} and \textsf{color} packages,
+% in most cases it is not necessary to give a driver option explicitly
+% withe the \cmd{\usepackage} (or \cmd{\RequirePackage}) command,
+% if a suitable configuration file \texttt{pict2e.cfg} is present on your
+% system (see the example file \texttt{pict2e-example.cfg}).
+% On many systems it may be sufficient to copy
+% \texttt{pict2e-example.cfg} to \texttt{pict2e.cfg};
+% on others you might need to modify your copy to suit your system.
+%
+% \subsection{Details: Changes to user-level commands}
+%
+% This section describes the improvements of the new implementation of
+% (some of) the \texttt{picture} commands.
+% For details, look up ``\texttt{pict2e} package'' in the index of the
+% \LaTeX\ manual~\cite{LAMPORT}.
+%
+% Here's a collection of quotes relevant to the \textsf{pict2e} package
+% from the \LaTeX\ manual~\cite{LAMPORT}.
+%
+% ^^A Indicate Chapter/Section with these quotes ???
+%
+% From \cite[p.~118]{LAMPORT}:
+% \begin{ltxquote}
+% However, the \texttt{pict2e} package uses device-driver support to
+% provide enhanced versions of these commands that remove some of
+% their restrictions.
+% The enhanced commands can draw straight lines and arrows of any
+% slope, circles of any size, and lines (straight and curved) of any
+% thickness.
+% \end{ltxquote}
+%
+% From \cite[p.~179]{LAMPORT}:
+% \begin{ltxquote}
+% \begin{description}
+% \item[\texttt{pict2e}]
+% Defines enhanced versions of the \texttt{picture} environment
+% commands that remove restrictions on the line slope, circle
+% radius, and line thickness.
+% \end{description}
+% \end{ltxquote}
+%
+% From \cite[pp.~221--223]{LAMPORT}:
+% \begin{ltxquote}
+% \begin{description}
+% \item[\cmd{\qbezier}]\mbox{}\\
+% (With the \texttt{pict2e} package, there is no limit to the
+% number of points plotted.)
+% \item[\cmd{\line}\textrm{ and }\cmd{\vector}]
+% Slopes $\abs x,\abs y \le 6 \mbox{ or } 4$, with no common
+% divisor except $\pm1$:\\
+% (These restrictions are eliminated by the \texttt{pict2e}
+% package.)
+% \item[\cmd{\line}\textrm{ and }\cmd{\vector}]
+% Smallest horizontal extent of sloped lines and vectors that can
+% be drawn:\\
+% (This does not apply when the \texttt{pict2e} package is
+% loaded.)
+% \item[\cmd{\circle}\textrm{ and }\cmd{\circle*}]
+% Largest circles and disks that can be drawn:\\
+% (With the \texttt{pict2e} package, any size circle or disk can
+% be drawn.)
+% \item[\cmd{\oval}]
+% \oarg{rad}:\\
+% An explicit \emph{rad} argument can be used only with the
+% \texttt{pict2e} package; the default value is the radius of the
+% largest quarter-circle \LaTeX\ can draw without the
+% \texttt{pict2e} package.
+% \end{description}
+% \end{ltxquote}
+%
+% \subsubsection{Line}
+% \label{sec:usage:line}
+%
+% \DescribeMacro\line
+% |\line|\parg{X,Y}\marg{LEN}\\
+% In the \SL\ implementation the slope arguments \parg{X,Y} are
+% restricted to integers in the range $-6 \le X,Y \le +6$, with no
+% common divisors except $\pm 1$.
+% (I.e., $X$ and $Y$ must be relatively prime.)
+% Furthermore, only horizontal and vertical lines can assume arbitrary
+% thickness;
+% sloped lines are restricted to the widths given by
+% the |\thinlines| and |\thicklines| declarations
+% (i.e., 0.4pt and 0.8pt, respectively).
+%
+% From \cite[p.~222]{LAMPORT}:
+% \begin{ltxquote}
+% These restrictions are eliminated by the \texttt{pict2e} package.
+% \end{ltxquote}
+%
+% However, to avoid overflow of \TeX's integer (dimen) arithmetic,
+% the current implementation restricts the slope arguments to
+% integers in the range $-1000 \le X,Y \le +1000$, which should be
+% enough.
+% ^^A ???
+%
+% Furthermore, unlike the \SL\ implementation, which silently converts
+% the ``impossible'' slope to a vertical line extending in the upward
+% direction ($(0,0) \mapsto (0,1)$), the \textsf{pict2e} package now
+% treats this as an error.
+% ^^A ???
+%
+% In the \SL\ implementation the horizontal extent of sloped lines
+% must be at least 10\,pt.
+% ^^A exactly or approximately ???
+%
+% From \cite[p.~222]{LAMPORT}:
+% \begin{ltxquote}
+% This does not apply when the \texttt{pict2e} package is loaded.
+% \end{ltxquote}
+%
+% Figure~\ref{fig:line} shows the difference between the old and new
+% implementations:
+% The black lines in the left half of each picture all have slopes
+% that conform to the restrictions of \SL.
+% However, with the new implementation of \textsf{pict2e} sloped lines
+% may assume any arbitrary width given by the |\linethickness|
+% declaration.
+% The right half demonstrates that now arbitrary slopes are possible.
+%
+% The blue lines represent ``illegal'' slopes specifications,
+% i.e., with common divisors.
+% Note the funny effect \SL\ produces in such cases.
+% (In \LaTeX\ releases prior to 2003/12/01,
+% some such ``illegal'' slopes might even lead to infinite loops!
+% Cf.\ problem report latex/3570.)
+%
+% The new implementation imposes no restriction with respect to line
+% thickness, minimal horizontal extent, and slope.
+%
+% The red lines correspond to angles of \(15^\circ\), \(30^\circ\),
+% \(45^\circ\), \(60^\circ\), and \(75^\circ\), respectively.
+% This was achieved by multiplying the sine and cosine of each angle
+% by 1000 and rounding to the nearest integer, like this:
+%\begin{verbatim}
+% \put(50,0){\line(966,259){25}}
+% \put(50,0){\line(866,500){25}}
+% \put(50,0){\line(707,707){25}}
+% \put(50,0){\line(500,866){25}}
+% \put(50,0){\line(259,966){25}}
+%\end{verbatim}
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \LINETEST[0] & \LINETEST
+% \end{tabular}
+% \caption{Line}
+% \label{fig:line}
+% \end{figure}
+%
+% \subsubsection{Vector}
+% \label{sec:usage:vector}
+%
+% \DescribeMacro\vector
+% |\vector|\parg{X,Y}\marg{LEN}\\
+% In the \SL\ implementation the slope arguments \parg{X,Y} are
+% restricted to integers in the range $-4 \le X,Y \le +4$, with no
+% common divisors except $\pm 1$.
+% (I.e., $X$ and $Y$ must be relatively prime.)
+% Furthermore, arrow heads come only in two shapes, corresponding to
+% the |\thinlines| and |\thicklines| declarations.
+% (There's also a flaw: the lines will be printed over the arrow
+% heads.
+% ^^A pr/???
+% See vertical vector in Figure~\ref{fig:vector}.)
+%
+% From \cite[p.~222]{LAMPORT}:
+% \begin{ltxquote}
+% These restrictions are eliminated by the \texttt{pict2e} package.
+% \end{ltxquote}
+%
+% However, to avoid overflow of \TeX's integer (dimen) arithmetic,
+% the current implementation restricts the slope arguments to
+% integers in the range $-1000 \le X,Y \le +1000$, which should be
+% enough.
+% ^^A ???
+%
+% Furthermore, unlike the \SL\ implementation, which silently converts
+% the ``impossible'' slope to a vertical vector extending in the upward
+% direction ($(0,0) \mapsto (0,1)$), the \textsf{pict2e} package now
+% treats this as an error.
+% ^^A ???
+%
+% In the \SL\ implementation the horizontal extent of sloped vectors
+% must be at least 10\,pt.
+% ^^A exactly or approximately ???
+%
+% From \cite[p.~222]{LAMPORT}:
+% \begin{ltxquote}
+% This does not apply when the \texttt{pict2e} package is loaded.
+% \end{ltxquote}
+%
+% Figure~\ref{fig:vector} shows the difference between the old and new
+% implementations:
+% The black arrows all have ``legal'' slopes.
+% The red arrows have slope arguments out of the range permitted by \SL.
+% Slope arguments that are ``illegal'' in \SL\ produce results similar
+% to those with the \cmd{\line} command (this has not been
+% demonstrated here).
+%
+% The new implementation imposes no restriction with respect to line
+% thickness, minimal horizontal extent, and slope.
+%
+% As with \SL, the arrow head will always be drawn.
+% In particular, only the arrow head will be drawn, if the total length
+% of the arrow is less than the length of the arrow head.
+% ^^A \SL: only if =0 ???
+% See right hand side of Figure~\ref{fig:vector:comparison}.
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \VECTORTEST[0] & \VECTORTEST[1]
+% \end{tabular}
+% \caption{Vector}
+% \label{fig:vector}
+% \end{figure}
+%
+% The current version of the \textsf{pict2e} package offers two
+% variants for the shape of the arrow heads, controlled by package
+% options.
+% One variant tries to mimic the fonts used in the \SL\
+% implementation (package option \textsf{ltxarrows}, the default;
+% see Figure~\ref{fig:vector:comparison}, top row),
+% though it is difficult to extrapolate from just two design sizes.
+% The other one is implemented like the arrows of the \PSTricks\
+% package~\cite{PSTRICKS} (package option \textsf{pstarrows};
+% see Figure~\ref{fig:vector:comparison}, bottom row).
+% ^^A See Figure~\ref{fig:vector:comparison}.
+%
+% \begin{figure}
+% \setlength\unitlength{.004\linewidth}^^A
+% \centering
+% \begin{picture}(200,100)
+% \put(0,0){\framebox(200,100){}}
+% \linethickness{12\unitlength}
+% \makeatletter \let\pIIe@vector=\pIIe@vector@pst \makeatother
+% \put(15,25){\vector(1,0){100}}
+% \put(185,25){\vector(1,0){0}}
+% \makeatletter \let\pIIe@vector=\pIIe@vector@ltx \makeatother
+% \put(15,75){\vector(1,0){100}}
+% \put(185,75){\vector(1,0){0}}
+% \end{picture}
+% \caption[Vector: shape variants of the arrow-heads]%
+% {Vector: shape variants of the arrow-heads.
+% Top: \LaTeX\ style vectors.
+% Bottom: \PSTricks\ style vectors.}
+% \label{fig:vector:comparison}
+% \end{figure}
+%
+% \subsubsection{Circle and Dot}
+% \label{sec:usage:circle+dot}
+%
+% \DescribeMacro\circle
+% \DescribeMacro{\circle*}
+% |\circle|\marg{DIAM}\\
+% |\circle*|\marg{DIAM}\\
+% The (hollow) circles and disks (filled circles) of the \SL\ ^^A
+% implementation had severe restrictions on the number of different
+% diameters and maximum diameters available.
+%
+% From \cite[p.~222]{LAMPORT}:
+% \begin{ltxquote}
+% With the \texttt{pict2e} package, any size circle or disk can be
+% drawn.
+% \end{ltxquote}
+%
+% \noindent
+% With the new implementation there are no more restrictions to the
+% diameter argument.
+% (However, negative
+% ^^A or zero
+% diameters are now trapped as an error.)
+%
+% Furthermore, hollow circles (like sloped lines) can now be drawn
+% with any line thickness.
+% Figure~\ref{fig:circle-dot} shows the difference.
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \CIRCLETEST[0] & \CIRCLETEST
+% \end{tabular}
+% \caption{Circle and Dot}
+% \label{fig:circle-dot}
+% \end{figure}
+%
+% \subsubsection{Oval}
+% \label{sec:usage:oval}
+%
+% \DescribeMacro\oval
+% |\oval|\oarg{rad}\parg{X,Y}\oarg{POS}\\
+% In the \SL\ implementation, the user has no control over the shape
+% of an oval besides its size, since its corners would always consist
+% of the ``quarter circles of the largest possible radius less than or
+% equal to \emph{rad}''~\cite[p.~223]{LAMPORT}.
+%
+% From \cite[p.~223]{LAMPORT}:
+% \begin{ltxquote}
+% An explicit \emph{rad} argument can be used only with the
+% \texttt{pict2e} package; the default value is the radius of the
+% largest quarter-circle \LaTeX\ can draw without the \texttt{pict2e}
+% package.
+% \end{ltxquote}
+%
+% This default value is 20\,pt, a length.
+% However, in an early reimplementation of the picture
+% commands~\cite{PSPICTURE}, there is such an optional argument too,
+% but it is given as a mere number, to be multiplied by |\unitlength|.
+%
+% Since both alternatives may make sense, we left the choice to the
+% user.
+% \ (See Figure~\ref{fig:oval:rad:2} for the differences.) \ ^^A
+% I.e., this implementation of \cmd{\oval} will ``auto-detect''
+% whether its \oarg{rad} argument is a length or a number.
+% \DescribeMacro\maxovalrad
+% Furthermore, the default value is not hard-wired either;
+% the user may access it under the moniker \cmd{\maxovalrad},
+% by the means of \cmd{\renewcommand*}.
+% (Names or values of length and counter registers may be given as
+% well, both as an explicit \oarg{rad} argument and when redefining
+% \cmd{\maxovalrad}.)
+%
+% (Both \oarg{rad} and the default value \cmd{\maxovalrad} are ignored
+% in ``standard \LaTeX\ mode'').
+%
+% The behaviour of |\oval| in the absence of the \oarg{rad} argument
+% is shown in Figure~\ref{fig:oval:rad:1}, left half of each picture.
+% Note that in the \SL\ implementation there is a minimum radius as
+% well (innermost ``salami'' is ``broken'').
+% In the right half of each picture, a \oarg{rad} argument has been
+% used: it has no effect with the original |\oval| command.
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands}\tabularnewline[1ex]
+% \OVALTESTi[0] & \OVALTESTi
+% \end{tabular}
+% \caption{Oval: Radius argument for \cmd{\oval} vs.\ \cmd{\maxovalrad}}
+% \label{fig:oval:rad:1}
+% \end{figure}
+%
+% Both \oarg{rad} and \cmd{\maxovalrad} may be given as an explicit
+% (rigid) length (i.e., with unit) or as a number.
+% In the latter case the value is used as a factor to multiply by
+% \cmd{\unitlength}.
+% \ (A length or counter register will do as well, of course.)
+%
+% If a number is given, the rounded corners of an oval will scale
+% according to the current value of \cmd{\unitlength}.
+% (See Figure~\ref{fig:oval:rad:2}, first row.)
+%
+% If a length is specified, the rounded corners of an oval will be the
+% same regardless of the current value of \cmd{\unitlength}.
+% (See Figure~\ref{fig:oval:rad:2}, second row.)
+%
+% The default value is 20\,pt as specified for the \oarg{rad}
+% argument of \cmd{\oval} by the \LaTeX\ manual \cite[p.~223]{LAMPORT}.
+% (See Figure~\ref{fig:oval:rad:2}, third row.)
+%
+% \bigskip
+%
+% \begin{figure}
+% \centering
+% \noindent
+% \begin{tabular}{@{}c@{}}
+% \textbf{Original Commands},
+% \oarg{rad} or \cmd{\maxovalrad} ignored\\[1ex]
+% \OriginalPictureCmds\OVALTESTii{0}\tabularnewline[1ex]\tabularnewline
+% \textbf{New Commands},
+% \oarg{rad} or \cmd{\maxovalrad} depends on \cmd{\unitlength}\\[1ex]
+% \OVALTESTii{20}\tabularnewline[1ex]\tabularnewline
+% \textbf{New Commands},
+% \oarg{rad} or \cmd{\maxovalrad} a fixed length\\[1ex]
+% \OVALTESTii{10.44pt}
+% \end{tabular}
+% \caption[Oval: Radius argument for \cmd{\oval}: length vs.\ number]%
+% {Oval: Radius argument for \cmd{\oval}: length vs.\ number.
+% The number at the centre of each oval gives the relative value of
+% \texttt{\char`\\unitlength}.}
+% \label{fig:oval:rad:2}
+% \end{figure}
+%
+% \subsubsection{Bezier Curves}
+% \label{sec:usage:bezier-curves}
+%
+% \DescribeMacro\bezier
+% \DescribeMacro\qbezier
+% \DescribeMacro\cbezier
+% \DescribeMacro\qbeziermax
+% |\bezier|\marg{N}\parg{AX,AY}\parg{BX,BY}\parg{CX,CY}\\
+% |\qbezier|\oarg{N}\parg{AX,AY}\parg{BX,BY}\parg{CX,CY}\\
+% |\cbezier|\oarg{N}\parg{AX,AY}\parg{BX,BY}\parg{CX,CY}\parg{DX,DY}\\
+% In \SL, the \emph{N} argument specifies the number of points to
+% ^^A ??? off by 1 !!!
+% plot, with the maximum defined by \cmd{\qbeziermax}.
+% ^^A Cite Lamport !!!
+% With \LaTeX\ versions prior to 2003/12/01, the quadratic Bezier
+% curves plotted by this package will not match those of the \SL\
+% implementation exactly, due to a bug in positioning the dots used to
+% produce a curve (cf.~latex/3566).
+%
+% \cmd{\bezier} is the obsolescent variant from the old
+% \textsf{bezier} package of vintage \LaTeX2.09.
+%
+% The |\cbezier| command draws a cubic Bezier curve;
+% see~\cite{EBEZIER}.
+% (This is not mentioned in \cite{LAMPORT} and has been added to the
+% package deliberately.)
+%
+% From \cite[p.~221--223]{LAMPORT}:
+% \begin{ltxquote}
+% With the \texttt{pict2e} package, there is no limit to the number
+% of points plotted.
+% \end{ltxquote}
+%
+% \noindent
+% More accurately, the argument specifying the maximum number of
+% points to plot is simply ignored in this new implementation of
+% \textsf{pict2e}, as is \cmd{\qbeziermax},
+% since the \textsf{pict2e} package uses primitive operators of the
+% output (back-end) format, using only the given ``control points''.
+% (For details, see the implementation part.)
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \QBEZIERTEST[0] & \QBEZIERTEST
+% \end{tabular}
+% \caption{Quadratic Bezier curves}
+% \label{fig:qbezier2}
+% \end{figure}
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \IfFileExists{ebezier.sty}{\CBEZIERTEST[0]}{%
+% \begin{slshape}^^A
+% Note:
+% Since the \textsf{ebezier} package is not installed on your system,
+% the `original' \cmd{\cbezier} command can't be used here.\par
+% \end{slshape}} & \CBEZIERTEST
+% \end{tabular}
+% \caption{Cubic Bezier curves}
+% \label{fig:cbezier}
+% \end{figure}
+%
+% \begin{figure}
+% \noindent
+% \begin{tabular}
+% {@{}>{\centering}p{.5\textwidth}@{}
+% >{\centering}p{.5\textwidth}@{}}
+% \textbf{Original Commands} & \textbf{New Commands} \tabularnewline[1ex]
+% \IfFileExists{ebezier.sty}{\QCBEZIERTEST[0]}{%
+% \begin{slshape}^^A
+% Note:
+% Since the \textsf{ebezier} package is not installed on your system,
+% the `original' \cmd{\cbezier} command can't be used here.\par
+% \end{slshape}} & \QCBEZIERTEST
+% \end{tabular}
+% \caption{Quadratic (green) and Cubic Bezier curves}
+% \label{fig:qcbezier}
+% \end{figure}
+%
+% \StopEventually{^^A
+% \Acknowledgements
+% ^^A \typeout{!!!
+% ^^A \ifx\Finale\relax \string\OnlyDescription
+% ^^A \else \string\AlsoImplementation \fi}^^A
+% ^^A Dirty Hack:
+% \ifx\Finale\relax ^^A \OnlyDescription
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{LAMPORT} Leslie Lamport: \textit{\LaTeX\ -- A Document
+% Preparation System}, 2nd ed., 1994
+%
+% \bibitem{PSTRICKS} Timothy Van Zandt: \textit{The pstricks bundle.}
+% \texttt{CTAN:~graphics/pstricks/}, 1993, 1994, 2000
+%
+% \bibitem{PSPICTURE} David Carlisle: \textit{The pspicture package.}
+% \texttt{CTAN:~macros/latex/contrib/carlisle/}, 1992
+%
+% \bibitem{EBEZIER} Gerhard A. Bachmaier: \textit{The ebezier package.}
+% \texttt{CTAN:~macros/latex/contrib/ebezier/}, 2002
+%
+% \end{thebibliography}^^A
+%\else ^^A \AlsoImplementation
+% \begin{thebibliography}{9}
+% \raggedright
+%
+% \bibitem{LAMPORT} Leslie Lamport: \textit{\LaTeX\ -- A Document
+% Preparation System}, 2nd ed., 1994
+%
+% \bibitem{COMPANION} Michel Goossens, Frank Mittelbach, Alexander
+% Samarin: \textit{The \LaTeX\ Companion}, 1993
+%
+% \bibitem{EBEZIER} Gerhard A. Bachmaier: \textit{The ebezier package.}
+% \texttt{CTAN:~macros/latex/contrib/ebezier/}, 2002
+%
+% \bibitem{PICTEX} Michael Wichura: \textit{The PiC\TeX\ package.}
+% \texttt{CTAN:~graphics/pictex}, 1987
+%
+% \bibitem{PSPICTURE} David Carlisle: \textit{The pspicture package.}
+% \texttt{CTAN:~macros/latex/contrib/carlisle/}, 1992
+%
+% \bibitem{TRIG} David Carlisle: \textit{The trig package.}
+% \texttt{CTAN:~macros/latex/required/graphics/}, 1999
+%
+% \bibitem{PSPIC} Kresten Krab Thorup: \textit{The pspic package.}
+% \texttt{CTAN:~macros/latex209/contrib/misc/}, 1991
+%
+% \bibitem{PSTRICKS} Timothy Van Zandt: \textit{The pstricks bundle.}
+% \texttt{CTAN:~graphics/pstricks/}, 1993, 1994, 2000
+%
+% ^^A Wichura@Galton.Uchicago.EDU
+%
+% \end{thebibliography}
+%
+% \PrintChanges
+% \PrintIndex
+%
+%\fi
+% } ^^A \StopEventually
+%
+% ^^A
+% \clearpage
+%
+% \section{Implementation}
+%
+% ^^A cite some of these packages !!! ???
+% Unlike other packages that have reimplemented or extended some of
+% the commands from \SL's \texttt{picture} environment,
+% we do not use special fonts,
+% nor draw arbitrary shapes by the means of myriads of small (point)
+% characters,
+% nor do we use sophisticated programming in some back-end
+% programming language.
+%
+% In its present state, this implementation supports just \PS\ and
+% \PDF\ as back-end formats.
+% It just calculates the necessary control points and uses primitive
+% path drawing operators.
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Initialisation}
+%
+% \begin{macro}{\Gin@codes}
+% First we save the catcodes of some characters, and set them to
+% fixed values whilst this file is being read.
+% \changes{v0.2o}{2004/06/25}
+% {Save and restore catcodes (HjG)}
+% (This is done in almost the same manner as in the \textsf{graphics}
+% and \textsf{color} packages. Alas, we don't need nor want to have
+% |*| as part of control sequence names, so we omit it here.)
+% \begin{macrocode}
+\edef\Gin@codes{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax
+ \catcode`\noexpand\"\the\catcode`\"\relax
+% \catcode`\noexpand\*\the\catcode`\*\relax
+ \catcode`\noexpand\!\the\catcode`\!\relax
+ \catcode`\noexpand\:\the\catcode`\:\relax}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\catcode`\^^A=\catcode`\%
+\@makeother\"%
+% \catcode`\*=11
+\@makeother\!%
+\@makeother\:%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Preliminaries}
+%
+% \begin{macro}{\pIIe@mode}
+% \begin{macro}{\pIIe@code}
+% \begin{macro}{\Gin@driver}
+% The first two of these commands determine how the \textsf{pict2e}
+% package works internally;
+% they should be defined properly by the
+% |p2e-|\meta{driver}\linebreak[0]|.def|
+% files.
+% (See file \texttt{p2e-drivers.dtx} for details and sample
+% implementations.)
+%
+% The latter command is well known from the \textsf{graphics} and
+% \textsf{color} packages from the \SL\ graphics bundle;
+% it should be set by a package option---most likely in a (system
+% dependent) configuration file \texttt{pict2e.cfg}.
+% (File \texttt{p2e-drivers.dtx} contains an example configuration
+% file suitable for the \teTeX\ and \TeXlive\ distributions;
+% it will be extracted as \texttt{pict2e-example.cfg}.)
+% \begin{macrocode}
+\newcommand*\pIIe@mode{-1}
+\newcommand*\pIIe@code[1]{}
+\providecommand*\Gin@driver{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@tempa}
+% \begin{macro}{\pIIe@tempb}
+% \begin{macro}{\pIIe@tempc}
+% At times, we need some temporary storage bins.
+% However, we only use some macros and do not allocate any new
+% registers; the ``superfluous'' ones from the picture module of the
+% kernel (|ltpictur.dtx|) and the general scratch registers should
+% suffice.
+% ^^A (This leads to somewhat vulnerable code below!)
+% \begin{macrocode}
+\newcommand*\pIIe@tempa{}
+\newcommand*\pIIe@tempb{}
+\newcommand*\pIIe@tempc{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Option processing}
+%
+% The driver options are not much of a surprise:
+% they are similar to those of the \textsf{graphics} and
+% \textsf{color} packages.
+% \begin{macrocode}
+\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
+\DeclareOption{xdvi}{\ExecuteOptions{dvips}}
+\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
+\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}}
+\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
+\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
+\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
+\DeclareOption{oztex}{\ExecuteOptions{dvips}}
+\DeclareOption{textures}{\def\Gin@driver{textures.def}}
+\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
+\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
+\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
+% \end{macrocode}
+% Request ``original'' \LaTeX\ mode.
+% ^^A Emulation. To be implemented yet.
+% \begin{macrocode}
+\DeclareOption{original}{\def\pIIe@mode{0}}
+% \end{macrocode}
+% Arrow shape options.
+% The values for \LaTeX-style arrows are ``hand optimized'';
+% they should be regarded as experimental,
+% i.e., they may change in future versions of this package.
+% The values for \PSTricks-style arrows are the default ones used by
+% that bundle.
+% If the \textsf{pstricks} package is actually loaded, then
+% \textsf{pict2e} will obey the current values of the corresponding
+% internal \PSTricks\ parameters;
+% this feature should be regarded as experimental,
+% i.e., it may change in future versions of this package.
+% \begin{macrocode}
+\DeclareOption{ltxarrows}{\AtEndOfPackage{%
+ \let\pIIe@vector=\pIIe@vector@ltx
+ \def\pIIe@FAL{1.52}%
+ \def\pIIe@FAW{3.2}%
+ \def\pIIe@CAW{1.5pt}%
+ \def\pIIe@FAI{0.25}%
+ }}
+\DeclareOption{pstarrows}{\AtEndOfPackage{%
+ \let\pIIe@vector=\pIIe@vector@pst
+ \def\pIIe@FAL{1.4}%
+ \def\pIIe@FAW{2}%
+ \def\pIIe@CAW{1.5pt}%
+ \def\pIIe@FAI{0.4}%
+ }}
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@debug@comment}
+% This makes debugging easier.
+% \begin{macrocode}
+\newcommand*\pIIe@debug@comment{}
+\DeclareOption{debug}{%
+ \def\pIIe@debug@comment{^^J^^J\@percentchar\space >>> pict2e <<<^^J}%
+ \begingroup
+ \@ifundefined{pdfcompresslevel}{}{\global\pdfcompresslevel\z@}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+% A special variant of debugging. (Obsolescent? Once used for
+% performance measurements: arctan vs.\ pyth-add versions of
+% \cmd{\vector}.)
+% \begin{macrocode}
+\DeclareOption{hide}{\AtEndOfPackage{%
+% \def\pIIe@code#1{}%
+ \let\pIIe@code\@gobble
+}}
+% \end{macrocode}
+% Unknown options default to mode ``original.''
+% \begin{macrocode}
+\DeclareOption*{\ExecuteOptions{original}}
+% \end{macrocode}
+% By default, arrows are in the \LaTeX\ style.
+% \begin{macrocode}
+\ExecuteOptions{ltxarrows}
+% \end{macrocode}
+% Like the \textsf{graphics} and \textsf{color} packages, we support a
+% configuration file. (See file \texttt{p2e-drivers.dtx} for details
+% and an example.)
+% \begin{macrocode}
+\InputIfFileExists{pict2e.cfg}{}{}
+% \end{macrocode}
+% This now should make clear which ``mode'' and ``code'' we should use.
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Output driver check}
+%
+% \begin{macrocode}
+\ifnum\pIIe@mode=\z@
+ \PackageInfo{pict2e}{Package option `original' requested}
+\else
+% \end{macrocode}
+% This code fragment is more or less cloned from the
+% \textsf{graphics} and \textsf{color} packages.
+% \begin{macrocode}
+ \if!\Gin@driver!
+ \PackageError{pict2e}
+ {No driver specified at all}
+ {You should make a default driver option in a file\MessageBreak
+ pict2e.cfg\MessageBreak eg: \protect\ExecuteOptions{dvips}}%
+ \else
+ \PackageInfo{pict2e}{Driver file: \Gin@driver}
+ \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
+ \PackageInfo{pict2e}{Driver file for pict2e: p2e-\Gin@driver}
+ \InputIfFileExists{p2e-\Gin@driver}{}{%
+ \PackageError{pict2e}%
+ {Driver file ``p2e-\Gin@driver'' not found}%
+ {Q: Is the file properly installed? A: No!}}
+ \fi
+\fi
+% \end{macrocode}
+%
+% \subsection{Mode check}
+%
+% For \PS\ and \PDF\ modes.
+% \begin{macrocode}
+\ifnum\pIIe@mode>\z@
+ \ifnum\pIIe@mode<\thr@@
+ \RequirePackage{trig}
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@oldline}
+% \begin{macro}{\pIIe@old@sline}
+% \begin{macro}{\pIIe@oldvector}
+% \begin{macro}{\pIIe@old@circle}
+% \begin{macro}{\pIIe@old@dot}
+% \begin{macro}{\pIIe@old@bezier}
+% \begin{macro}{\pIIe@old@cbezier}
+% \begin{macro}{\pIIe@oldoval}
+% \begin{macro}{\pIIe@old@oval}
+% Saved versions of some macros. (Or dummy definitions.)
+% \begin{macrocode}
+ \let\pIIe@oldline\line
+ \let\pIIe@old@sline\@sline
+ \let\pIIe@oldvector\vector
+ \let\pIIe@old@circle\@circle
+ \let\pIIe@old@dot\@dot
+ \let\pIIe@old@bezier\@bezier
+ \AtBeginDocument{%
+ \@ifundefined{@cbezier}{%
+ \def\pIIe@old@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){}%
+ }{\let\pIIe@old@cbezier\@cbezier}}
+ \let\pIIe@oldoval\oval
+ \let\pIIe@old@oval\@oval
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\OriginalPictureCmds}
+% Switches back to the original definitions;
+% for testing and demonstration purposes only.
+% \begin{macrocode}
+ \newcommand*\OriginalPictureCmds{%
+ \let\@sline\pIIe@old@sline
+ \let\line\pIIe@oldline
+ \let\vector\pIIe@oldvector
+ \let\@circle\pIIe@old@circle
+ \let\@dot\pIIe@old@dot
+ \let\@bezier\pIIe@old@bezier
+ \let\@cbezier\pIIe@old@cbezier
+ \renewcommand*\oval[1][]{\pIIe@oldoval}%
+ \let\@oval\pIIe@old@oval
+ }
+% \end{macrocode}
+% \end{macro}
+% Overambitious drivers.
+% \begin{macrocode}
+ \else
+ \PackageError{pict2e}
+ {Unsupported mode (\pIIe@mode) specified}
+ {The driver you specified requested a mode\MessageBreak
+ not supported by this version of this package}
+ \fi
+% \end{macrocode}
+% Incapable drivers.
+% \begin{macrocode}
+\else
+ \ifnum\pIIe@mode<\z@
+ \PackageError{pict2e}
+ {No suitable driver specified}
+ {You should make a default driver option in a file\MessageBreak
+ pict2e.cfg\MessageBreak eg: \protect\ExecuteOptions{dvips}}
+ \fi
+\fi
+% \end{macrocode}
+% Big switch,\label{big-switch-begin}
+% completed near the end of the package
+% (see page~\pageref{big-switch-end}).
+% \begin{macrocode}
+\ifnum\pIIe@mode>\z@
+% \end{macrocode}
+%
+% \subsection{Graphics operators}
+%
+% The following definitions allow the \PS\ and \PDF\ operations below
+% to share some of the code.
+% \begin{macrocode}
+\ifcase\pIIe@mode\relax
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@moveto@op}
+% \begin{macro}{\pIIe@lineto@op}
+% \begin{macro}{\pIIe@setlinewidth@op}
+% \begin{macro}{\pIIe@stroke@op}
+% \begin{macro}{\pIIe@fill@op}
+% \begin{macro}{\pIIe@curveto@op}
+% \begin{macro}{\pIIe@concat@op}
+% \PS
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@moveto@op{moveto}
+ \newcommand*\pIIe@lineto@op{lineto}
+ \newcommand*\pIIe@setlinewidth@op{setlinewidth}
+ \newcommand*\pIIe@stroke@op{stroke}
+ \newcommand*\pIIe@fill@op{fill}
+ \newcommand*\pIIe@curveto@op{curveto}
+ \newcommand*\pIIe@concat@op{concat}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@moveto@op}
+% \begin{macro}{\pIIe@lineto@op}
+% \begin{macro}{\pIIe@setlinewidth@op}
+% \begin{macro}{\pIIe@stroke@op}
+% \begin{macro}{\pIIe@fill@op}
+% \begin{macro}{\pIIe@curveto@op}
+% \begin{macro}{\pIIe@concat@op}
+% \PDF
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@moveto@op{m}
+ \newcommand*\pIIe@lineto@op{l}
+ \newcommand*\pIIe@setlinewidth@op{w}
+ \newcommand*\pIIe@stroke@op{S}
+ \newcommand*\pIIe@fill@op{f}
+ \newcommand*\pIIe@curveto@op{c}
+ \newcommand*\pIIe@concat@op{cm}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \noindent
+% (Currently, there are no other modes.)
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \subsection{Low-level operations}
+%
+% \subsubsection{Collecting the graphics instructions and handling the output}
+%
+% \begin{macro}{\pIIe@GRAPH}
+% \begin{macro}{\pIIe@addtoGraph}
+% \changes{v0.1h}{2003/08/27}{Added newline code (to be improved eventually).
+% (RN,HjG)}
+% We collect all \PS\slash\PDF\ output code for a single picture
+% object in a token register.
+% \begin{macrocode}
+ \@ifdefinable\pIIe@GRAPH{\newtoks\pIIe@GRAPH}
+ \newcommand*\pIIe@addtoGraph[1]{%
+ \begingroup
+ \edef\x{\the\pIIe@GRAPH\space#1}%
+ \global\pIIe@GRAPH\expandafter{\x}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@fillGraph}
+% The path will either be filled \dots
+% \begin{macrocode}
+ \newcommand*\pIIe@fillGraph{\begingroup \@tempswatrue\pIIe@drawGraph}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@strokeGraph}
+% \dots\ or stroked.
+% \begin{macrocode}
+ \newcommand*\pIIe@strokeGraph{\begingroup \@tempswafalse\pIIe@drawGraph}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@drawGraph}
+% Common code.
+% When we are done with collecting the path of the picture object, we
+% output the contents of the token register.
+%
+% \changes{v0.1d}{2003/07/22}{``gsave/grestore'' added. (RN)}
+% \changes{v0.1g}{2003/08/23}{``gsave/grestore'' removed. (RN)}
+% \changes{v0.1i}{2003/08/28}{``gsave/grestore'' restored for PDF
+% (see `p2e-drivers.dtx'). (RN)}
+% \begin{macrocode}
+ \newcommand*\pIIe@drawGraph{%
+ \edef\x{\pIIe@debug@comment\space
+% \end{macrocode}
+% Instead of scaling individual coordinates, we scale the graph as a whole
+% (pt$\rightarrow$bp);
+% see Section~\ref{sec:implementation:transformations}.
+% \begin{macrocode}
+ \pIIe@scale@PTtoBP}%
+ \if@tempswa
+ \edef\y{\pIIe@fill@op}%
+ \else
+ \edef\x{\x\space\strip@pt\@wholewidth
+ \space\pIIe@setlinewidth@op}%
+ \edef\y{\pIIe@stroke@op}%
+ \fi
+ \expandafter\pIIe@code\expandafter{%
+ \expandafter\x\the\pIIe@GRAPH\space\y}%
+% \end{macrocode}
+% \changes{v0.1u}{2003/11/19}{Clear current point after output (HjG)}
+% Clear the graph and the current point after output.
+% \begin{macrocode}
+ \global\pIIe@GRAPH{}\xdef\pIIe@CPx{}\xdef\pIIe@CPy{}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Auxilliary macros}
+%
+% The following macros save us a plethora of tokens in subsequent code.
+%
+% Note that since we are using \cmd{\@tempdima} and \cmd{\@tempdimb}
+% both here and in medium-level macros below, we must be careful not
+% to spoil their values.
+%
+% \begin{macro}{\pIIe@CPx}
+% \begin{macro}{\pIIe@CPy}
+% \begin{macro}{\pIIe@add@CP}
+% \changes{v0.1u}{2003/11/21}{%
+% Rename \cmd{\pIIe@add@XY} to \cmd{\pIIe@add@CP} (HjG)}
+% The lengths (coordinates) given as arguments will be stored as
+% ``real'' numbers using the common trick; i.e., they are put in
+% `dimen' registers, scaled by $2^{16}$.
+% At the same time, we remember the ``current point.''
+% (Not strictly necessary for \PS, but for some operations in \PDF,
+% e.g., \textsl{rcurveto} emulation.)
+% \begin{macrocode}
+ \newcommand*\pIIe@CPx{} \newcommand*\pIIe@CPy{}
+ \newcommand*\pIIe@add@CP[2]{%
+ \begingroup
+ \@tempdima#1\xdef\pIIe@CPx{\the\@tempdima}%
+ \@tempdimb#2\xdef\pIIe@CPy{\the\@tempdimb}%
+ \pIIe@addtoGraph{\strip@pt\@tempdima\space\strip@pt\@tempdimb}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@add@nums}
+% Similar, but does not set the ``current point.''
+% Values need not be coordinates (e.g., may be scaling factors, etc.).
+% \begin{macrocode}
+ \newcommand*\pIIe@add@nums[2]{%
+ \begingroup
+ \@tempdima#1\relax
+ \@tempdimb#2\relax
+ \pIIe@addtoGraph{\strip@pt\@tempdima\space\strip@pt\@tempdimb}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@add@num}
+% Likewise, for a single argument.
+% \begin{macrocode}
+ \newcommand*\pIIe@add@num[1]{%
+ \begingroup
+ \@tempdima#1\relax
+ \pIIe@addtoGraph{\strip@pt\@tempdima}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Medium-level operations}
+%
+% \subsubsection{Transformations}
+% \label{sec:implementation:transformations}
+%
+% Transformation operators; not all are currently used.
+% (Hence, some are untested.)
+%
+% \begin{macro}{\pIIe@PTtoBP}
+% Scaling factor, used below.
+% ``pt$\rightarrow$bp'' ($72 / 72.27 \approx 0.99626401$).
+% Note the trailing space!
+% (Don't delete it, it saves us some tokens.)
+% \begin{macrocode}
+ \newcommand*\pIIe@PTtoBP{0.99626401 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\ifcase\pIIe@mode\relax
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@concat}
+% \begin{macro}{\pIIe@translate}
+% \begin{macro}{\pIIe@rotate}
+% \begin{macro}{\pIIe@scale}
+% \begin{macro}{\pIIe@scale@PTtoBP}
+% \PS: Use some operators directly.
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@concat[6]{%
+ \begingroup
+ \pIIe@addtoGraph{[}%
+ \@tempdima#1\relax \@tempdimb#2\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#3\relax \@tempdimb#4\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#5\relax \@tempdimb#6\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \pIIe@addtoGraph{] \pIIe@concat@op}%
+ \endgroup}
+ \newcommand*\pIIe@translate[2]{\pIIe@add@nums{#1}{#2}\pIIe@addtoGraph{translate}}
+ \newcommand*\pIIe@rotate[1]{\pIIe@add@num{#1}\pIIe@addtoGraph{rotate}}
+ \newcommand*\pIIe@scale[2]{\pIIe@add@nums{#1}{#2}\pIIe@addtoGraph{scale}}
+ \newcommand*\pIIe@scale@PTtoBP{\pIIe@PTtoBP \pIIe@PTtoBP scale}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@concat}
+% \begin{macro}{\pIIe@translate}
+% \begin{macro}{\pIIe@rotate}
+% \begin{macro}{\pIIe@scale}
+% \begin{macro}{\pIIe@scale@PTtoBP}
+% \PDF: Emulate. \mbox{\texttt{:-(}}
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@concat[6]{%
+ \begingroup
+ \@tempdima#1\relax \@tempdimb#2\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#3\relax \@tempdimb#4\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#5\relax \@tempdimb#6\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \pIIe@addtoGraph\pIIe@concat@op
+ \endgroup}
+ \newcommand*\pIIe@translate[2]{\pIIe@concat\p@\z@\z@\p@{#1}{#2}}
+ \newcommand*\pIIe@rotate[1]{%
+ \begingroup
+ \@tempdima#1\relax
+ \edef\pIIe@tempa{\strip@pt\@tempdima}%
+ \CalculateSin\pIIe@tempa
+ \CalculateCos\pIIe@tempa
+ \edef\pIIe@tempb{\UseSin\pIIe@tempa}%
+ \edef\pIIe@tempc{\UseCos\pIIe@tempa}%
+ \pIIe@concat{\pIIe@tempc\p@}{\pIIe@tempb\p@}%
+ {-\pIIe@tempb\p@}{\pIIe@tempc\p@}\z@\z@
+ \endgroup}
+ \newcommand*\pIIe@scale[2]{\pIIe@concat{#1}\z@\z@{#2}\z@\z@}
+ \newcommand*\pIIe@scale@PTtoBP{\pIIe@PTtoBP 0 0 \pIIe@PTtoBP 0 0 \pIIe@concat@op}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \noindent
+% (Currently, there are no other modes.)
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \subsubsection{Path definitions}
+% \label{sec:implementation:path-definitions}
+%
+% \begin{macro}{\pIIe@moveto}
+% Simple things \dots
+% \begin{macrocode}
+ \newcommand*\pIIe@moveto[2]{%
+ \pIIe@add@CP{#1}{#2}\pIIe@addtoGraph\pIIe@moveto@op}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@lineto}
+% \dots\ have to be defined, too.
+% \begin{macrocode}
+ \newcommand*\pIIe@lineto[2]{%
+ \pIIe@add@CP{#1}{#2}\pIIe@addtoGraph\pIIe@lineto@op}
+% \end{macrocode}
+% \end{macro}
+%
+% \noindent
+% We'll use \cmd{\pIIe@rcurveto} to draw quarter circles.
+% (\cmd{\circle} and \cmd{\oval}).
+% \begin{macrocode}
+\ifcase\pIIe@mode\relax
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@rcurveto}
+% \PS:
+% Use the ``rcurveto'' operator directly.
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@rcurveto[6]{%
+ \begingroup
+ \@tempdima#1\relax \@tempdimb#2\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#3\relax \@tempdimb#4\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#5\relax \@tempdimb#6\relax
+ \pIIe@add@CP\@tempdima\@tempdimb
+ \pIIe@addtoGraph{rcurveto}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@rcurveto}
+% \PDF:
+% It's necessary to emulate the \PS\ operator ``rcurveto''.
+% For this, the ``current point'' must be known, i.e., all macros which
+% change the ``current point'' must set \cmd{\pIIe@CPx} and
+% \cmd{\pIIe@CPy}.
+% \begin{macrocode}
+\or
+ \newcommand*\pIIe@rcurveto[6]{%
+ \begingroup
+ \@tempdima#1\advance\@tempdima\pIIe@CPx\relax
+ \@tempdimb#2\advance\@tempdimb\pIIe@CPy\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#3\advance\@tempdima\pIIe@CPx\relax
+ \@tempdimb#4\advance\@tempdimb\pIIe@CPy\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#5\advance\@tempdima\pIIe@CPx\relax
+ \@tempdimb#6\advance\@tempdimb\pIIe@CPy\relax
+ \pIIe@add@CP\@tempdima\@tempdimb
+ \pIIe@addtoGraph\pIIe@curveto@op
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \noindent
+% (Currently, there are no other modes.)
+% \begin{macrocode}
+\fi
+% \end{macrocode}
+%
+% \begin{macro}{\pIIe@curveto}
+% This is currently only used for Bezier curves and for drawing the
+% heads of \LaTeX-like arrows.
+% Note: It's the same for \PS\ and \PDF.
+% \begin{macrocode}
+ \newcommand*\pIIe@curveto[6]{%
+ \begingroup
+ \@tempdima#1\relax \@tempdimb#2\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#3\relax \@tempdimb#4\relax
+ \pIIe@add@nums\@tempdima\@tempdimb
+ \@tempdima#5\relax \@tempdimb#6\relax
+ \pIIe@add@CP\@tempdima\@tempdimb
+ \pIIe@addtoGraph\pIIe@curveto@op
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{``Pythagorean Addition'' and Division}
+%
+% \begin{macro}{\pIIe@pyth}
+% This algorithm is copied from the \PiCTeX\ package
+% \cite{PICTEX} by Michael Wichura, with his permission
+% ^^A (cite Email!?).
+%
+% Here is his description:
+% \begin{quote}
+% Suppose $x>0$, $y>0$.
+% Put $s = x+y$. Let $z = (x^2+y^2)^{1/2}$.
+% Then $z = s\times f$, where
+% \[
+% f = (t^2 + (1-t)^2)^{1/2} = ((1+\tau^2)/2)^{1/2}
+% \]
+% and $t = x/s$ and $\tau = 2(t-1/2)$.
+% \end{quote}
+% \begin{macrocode}
+\newcommand*\pIIe@pyth[3]{%
+ \begingroup
+ \@tempdima=#1\relax
+% \end{macrocode}
+% $\cmd{\@tempdima}=\mathrm{abs}(x)$
+% \begin{macrocode}
+ \ifnum\@tempdima<\z@\@tempdima=-\@tempdima\fi
+ \@tempdimb=#2\relax
+% \end{macrocode}
+% $\cmd{\@tempdimb}=\mathrm{abs}(y)$
+% \begin{macrocode}
+ \ifnum\@tempdimb<\z@\@tempdimb=-\@tempdimb\fi
+% \end{macrocode}
+% $\cmd{\@tempdimb} = s = \mathrm{abs}(x)+\mathrm{abs}(y)$
+% \begin{macrocode}
+ \advance\@tempdimb\@tempdima
+ \ifnum\@tempdimb=\z@
+% \end{macrocode}
+% $\cmd{\@tempdimc} = z = \sqrt{(x^2+y^2)}$
+% \begin{macrocode}
+ \global\@tempdimc=\z@
+ \else
+% \end{macrocode}
+% $\cmd{\@tempdima} = 8 \times\mathrm{abs}(x)$
+% \begin{macrocode}
+ \multiply\@tempdima 8\relax
+% \end{macrocode}
+% $\cmd{\@tempdimc} = 8\,t = 8 \times\mathrm{abs}(x) / s$
+% \begin{macrocode}
+ \pIIe@@divide\@tempdima\@tempdimb
+% \end{macrocode}
+% $\cmd{\@tempdimc} = 4\tau = (8\,t-4)$
+% \begin{macrocode}
+ \advance\@tempdimc -4pt
+ \multiply\@tempdimc 2
+ \edef\pIIe@tempa{\strip@pt\@tempdimc}%
+% \end{macrocode}
+% $\cmd{\@tempdima} = (8\,\tau)^2$
+% \begin{macrocode}
+ \@tempdima=\pIIe@tempa\@tempdimc
+% \end{macrocode}
+% $\cmd{\@tempdima} = [64+(8\,\tau)^2]/2 =(8\,f)^2$
+% \begin{macrocode}
+ \advance\@tempdima 64pt
+ \divide\@tempdima 2\relax
+% \end{macrocode}
+% initial guess at $\sqrt{(u)}$
+% \begin{macrocode}
+ \@dashdim=7pt
+% \end{macrocode}
+% $\cmd{\@dashdim} = \sqrt{(u)}$
+% \begin{macrocode}
+ \pIIe@@pyth\pIIe@@pyth\pIIe@@pyth
+ \edef\pIIe@tempa{\strip@pt\@dashdim}%
+ \@tempdimc=\pIIe@tempa\@tempdimb
+% \end{macrocode}
+% $\cmd{\@tempdimc} = z = (8\,f)\times s / 8$
+% \begin{macrocode}
+ \global\divide\@tempdimc 8
+ \fi
+ \endgroup
+ #3=\@tempdimc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@@pyth}
+% $\cmd{\@dashdim} = g \leftarrow (g + u/g)/2$
+% \begin{macrocode}
+\newcommand*\pIIe@@pyth{%
+ \pIIe@@divide\@tempdima\@dashdim
+ \advance\@dashdim\@tempdimc
+ \divide\@dashdim\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@@divide}
+% This division algorithm is similar to the one used for the tangent
+% in the \textsf{trig} package~\cite{TRIG}.
+% It does not allow large arguments. ^^A ???
+% A~very small denominator argument leads to division by zero.
+% \begin{macrocode}
+\newcommand*\pIIe@@divide[2]{%
+% \end{macrocode}
+% $2^{16}$ (sp)
+% \begin{macrocode}
+ \@tempcnta\p@
+% \end{macrocode}
+% $2^{30} > \cmd{\maxdimen}$ !
+% \begin{macrocode}
+ \multiply\@tempcnta\two@fourteen
+ \@clnwd#2\relax
+ \divide\@clnwd\@iv
+ \divide\@tempcnta\@clnwd
+ \@clnht\@tempcnta sp\relax
+ \@clnwd#1\relax
+ \@tempdimc\strip@pt\@clnwd\@clnht}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@divide}
+% Improve this documentation!
+% \[
+% \mbox{\#3} =
+% \frac{2^{30}\cdot \mbox{\#1}}{2^{-2}\cdot \mbox{\#2} \cdot 2^{16}}
+% \]
+% (The factor \(2^{16}\) is implied by \TeX's division.)
+% \begin{macrocode}
+\newcommand*\pIIe@divide[3]{%
+ \pIIe@@divide{#1}{#2}%
+ #3=\@tempdimc}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{High-level operations}
+%
+% \begin{macro}{\pIIe@checkslopeargs}
+% \changes{v0.2o}{2004/06/25}{Macro added (HjG)}
+% Common code for \cmd{\line} and \cmd{\vector}.
+% \begin{macrocode}
+\newcommand*\pIIe@checkslopeargs{%
+% \end{macrocode}
+% Missing macro: \cmd{\@abs}\marg{val} -- should be in the kernel!
+%\begin{verbatim}
+%\def\@abs#1{\ifnum#1<\z@-\fi#1}
+%\end{verbatim}
+% It would save a plethora of tokens here and in other packages
+% and even in the kernel itself
+% (e.g., cf.\ \cmd{\vector} in \texttt{ltpictur.dtx}).
+% Should we define it in this package?
+% \begin{macrocode}
+ \ifnum\ifnum\@xarg<\z@-\fi\@xarg>\@m \@badlinearg \fi
+ \ifnum\ifnum\@yarg<\z@-\fi\@yarg>\@m \@badlinearg \fi
+% \end{macrocode}
+% A bit incompatible with \SL:
+% slope \((0,0)\) raises an error.
+% \begin{macrocode}
+ \ifnum\@xarg=\z@ \ifnum\@yarg=\z@ \@badlinearg \fi\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Line}
+% \label{sec:implementation:line}
+%
+% \begin{macro}{\line}
+% \changes{v0.2l}{2004/04/08}{Macro added (RNH/HjG)}
+% \cmd{\line}\parg{x,y}\marg{$l_x$}:
+% \changes{v0.2o}{2004/06/25}{Use \cmd{\pIIe@checkslopeargs} (HjG)}
+% \begin{macrocode}
+ \def\line(#1,#2)#3{%
+ \@xarg #1\relax \@yarg #2\relax
+ \@linelen #3\unitlength
+ \pIIe@checkslopeargs
+ \ifdim\@linelen<\z@\@badlinearg\else
+ \ifnum\@xarg =\z@ \@vline
+ \else
+ \ifnum\@yarg =\z@ \@hline \else \@sline\fi
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sline}
+% (The implementation here is different from \cmd{\vector}!)
+% \begin{macrocode}
+ \def\@sline{%
+ \begingroup
+ \ifnum\@xarg<\z@\@linelen-\@linelen\fi
+ \pIIe@divide{\@yarg\p@}{\@xarg\p@}\dimen@
+ \@ydim=\strip@pt\dimen@\@linelen
+ \pIIe@moveto\z@\z@
+ \pIIe@lineto\@linelen\@ydim
+ \pIIe@strokeGraph
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Vector}
+% \label{sec:implementation:vector}
+%
+% \begin{macro}{\vector}
+% Unlike \cmd{\line}, \cmd{\vector} must be redefined, because
+% the kernel version checks for illegal slope arguments.
+%
+% \cmd{\vector}\parg{x,y}\marg{$l_x$}:
+% Instead of calculating \(\theta = \arctan \frac{y}{x}\), we use
+% ``pythagorean addition''~\cite{PICTEX}
+% to determine \(s=\sqrt{x^2+y^2}\) and to obtain the length
+% of the vector \(l = l_x \cdot \frac{s}{x}\)
+% and the values of \(\sin \theta = \frac{y}{s}\) and
+% \(\cos \theta = \frac{x}{s}\) for the rotation of the coordinate system.
+% ^^A (This is faster; is it more accurate?)
+% \changes{v0.2o}{2004/06/25}{Use \cmd{\pIIe@checkslopeargs} (HjG)}
+% \begin{macrocode}
+ \def\vector(#1,#2)#3{%
+ \begingroup
+ \@xarg#1\relax \@yarg#2\relax
+ \@linelen#3\unitlength
+ \pIIe@checkslopeargs
+ \ifdim\@linelen<\z@ \@badlinearg \else
+ \pIIe@pyth{\@xarg\p@}{\@yarg\p@}\dimen@
+ \ifnum\@xarg=\z@
+ \else\ifnum\@yarg=\z@
+ \else
+% \end{macrocode}
+% This calculation is only necessary, if the vector is actually
+% sloped.
+% \begin{macrocode}
+ \pIIe@divide\dimen@{\@xarg\p@}\@xdim
+ \@linelen\strip@pt\@xdim\@linelen
+ \ifdim\@linelen<\z@\@linelen-\@linelen\fi
+ \fi
+ \fi
+% \end{macrocode}
+% \BigIndent $\sin\theta$ and $\cos\theta$
+% \begin{macrocode}
+ \pIIe@divide{\@yarg\p@}\dimen@\@ydim
+ \pIIe@divide{\@xarg\p@}\dimen@\@xdim
+% \end{macrocode}
+% Rotate the following vector\slash arrow outlines by angle $\theta$.
+% \begin{macrocode}
+ \pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim\z@\z@
+% \end{macrocode}
+% Internal command to draw the outline of the vector\slash arrow.
+% \begin{macrocode}
+ \pIIe@vector
+ \pIIe@fillGraph
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@vector}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% This command should be \cmd{\def}'ed or \cmd{\let} to a macro
+% that generates the vector's outline path.
+% Now initialized by package options, via |\AtEndOfPackage|.
+% \begin{macrocode}
+ \newcommand*\pIIe@vector{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@FAL}
+% \begin{macro}{\pIIe@FAW}
+% \begin{macro}{\pIIe@CAW}
+% \begin{macro}{\pIIe@FAI}
+% \changes{v0.1x}{2003/11/27}{Introduce ``inset''. (RN,HjG)}
+% \begin{macro}{\pIIe@@firstnum}
+% \changes{v0.1x}{2003/11/27}{New ancillary macro (RN,HjG)}
+% \begin{macro}{\pIIe@@secondnum}
+% \changes{v0.1x}{2003/11/27}{New ancillary macro (RN,HjG)}
+% Some macros to parametrize the shape of the vector outline.
+% ^^A Should be user-level macros or changeable via key-value interface.
+% ^^A (Defered to future version.)
+% See Figures~\ref{fig:vector:ltx} and~\ref{fig:vector:pst}.
+%\iffalse
+% Note that when the \textsf{pstricks} package has been loaded, its
+% arrow-drawing parameters will be dynamically evaluated;
+% of course,
+% this is only useful with the \textsf{pstarrows} package
+% option.
+% probably\slash most likely not useful with the default
+% \textsf{ltxarrows} package option.
+%\fi
+% \begin{macrocode}
+ \newcommand*\pIIe@FAL{}\newcommand*\pIIe@FAW{}\newcommand*\pIIe@CAW{}
+ \newcommand*\pIIe@FAI{}
+ \newcommand*\pIIe@@firstnum{}\newcommand*\pIIe@@secondnum{}
+ \AtBeginDocument{%
+ \@ifpackageloaded{pstricks}{%
+ \def\pIIe@FAL{\psk@arrowlength}%
+ \def\pIIe@FAW{\expandafter\pIIe@@secondnum\psk@arrowsize}%
+ \def\pIIe@CAW{\expandafter\pIIe@@firstnum\psk@arrowsize}%
+ \def\pIIe@FAI{\psk@arrowinset}%
+ \def\pIIe@@firstnum#1 #2 {#1\p@}%
+ \def\pIIe@@secondnum#1 #2 {#2}%
+ }{}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \paragraph{\LaTeX\ version}
+%
+% The arrows drawn by the variant generated by the \textsf{ltxarrows}
+% package option are
+% modeled after those in the fonts used by the \SL\ version of the
+% picture commands (|ltpictur.dtx|).
+% ^^A line10 linew10
+% See Figure~\ref{fig:vector:ltx}.
+%
+% \begin{figure}
+% \setlength\unitlength{.0067\linewidth}\hfill
+% \makebox[0pt][r]{^^A
+% \begin{minipage}[c]{17em}^^A
+% \unboldmath\small
+% \setlength\arraycolsep{.5\arraycolsep}^^A
+% \begin{eqnarray*}
+% L & = & \cmd{\@linelen} \\
+% W & = & \cmd{\@wholewidth} = 2\times\cmd{\@halfwidth} \\
+% AW & = & \cmd{\pIIe@FAW}\times W + \cmd{\pIIe@CAW} \\
+% AL & = & \cmd{\pIIe@FAL}\times AW \\
+% IN & = & \cmd{\pIIe@FAI}\times AW / 2
+% \end{eqnarray*}
+% \end{minipage}}^^A
+% \hspace{\marginparsep}
+% \begin{minipage}[c]{105\unitlength}^^A
+% \rule{\linewidth}{0pt}
+% \begin{picture}(105,55)(0,-25)
+% \boldmath\bfseries
+% \THICKLINES
+% \put(100,0){\FPOINT} \put(101,-1){$P_1$}
+% ^^A \makeatletter
+% ^^A \pIIe@addtoGraph{^^J^^J\@percentchar\space >>> HUGO <<<^^J}^^A
+% ^^A \makeatother
+% \CBEZIER{100,0}{86.67,-1.67}{73.33,-8.33}{60,-20}^^A P1--P2
+% \put(60,-20){\FPOINT} \put(61,-23){$P_2$}
+% \put(60,-20){\line(0,1){10}}^^A P2--P3
+% \put(60,-10){\FPOINT} \put(61,-9){$P_3$}
+% \put(60,-10){\line(-1,0){60}}^^A P3--P4
+% \put(0,-10){\FPOINT} \put(1,-8){$P_4$}
+% \put(0,-10){\line(0,1){20}}^^A P4--P5
+% \put(0,10){\FPOINT} \put(1,6){$P_5$}
+% \put(0,10){\line(1,0){60}}^^A P5--P6
+% \put(60,10){\FPOINT} \put(61,7){$P_6$}
+% \put(60,10){\line(0,1){10}}^^A P6--P7
+% \put(60,20){\FPOINT} \put(61,21){$P_7$}
+% ^^A \makeatletter
+% ^^A \pIIe@addtoGraph{^^J^^J\@percentchar\space >>> HUGO <<<^^J}^^A
+% ^^A \makeatother
+% \CBEZIER{60,20}{73.33,8.33}{86.67,1.67}{100,0}^^A P7--P1
+% \thinlines
+% \put(100,0){\line(-2,-1){40}}^^A P1--P2
+% \put(60,20){\line(2,-1){40}}^^A P7--P1
+% ^^A
+% \put(93,-8){$P_a$}
+% \put(93,-6){\line(-3,2){6}}^^A
+% \put(80,-5){\OPOINT}
+% \put(73,-5){$P_m$}
+% \put(67,-8){$P_b$}
+% ^^A
+% \put(93,6){$P_d$}
+% \put(93,6){\line(-3,-2){6}}^^A
+% \put(80,5){\OPOINT}
+% \put(73,3){$P_n$}
+% \put(67,6){$P_c$}
+% ^^A
+% \put(-2,0){\line(1,0){4}}
+% \put(10,-7){\vector(-10,7){10}}\put(10,-8){$\,(0,0)$}
+% ^^A
+% \put(60,-20){\line(0,-1){5}}\put(100,0){\line(0,-1){25}}
+% \put(60,-25){\vector(1,0){40}}\put(100,-25){\vector(-1,0){40}}
+% \put(77,-24){$AL$}
+% ^^A
+% \put(0,10){\line(0,1){15}}\put(100,0){\line(0,1){25}}
+% \put(0,25){\vector(1,0){100}}\put(100,25){\vector(-1,0){100}}
+% \put(48,26){$L$}
+% ^^A
+% \put(60,-20){\line(-1,0){5}} \put(60,20){\line(-1,0){5}}
+% \put(55,-20){\vector(0,1){40}} \put(55,20){\vector(0,-1){40}}
+% \put(47,-2){$AW$}
+% ^^A
+% \put(25,-10){\vector(0,1){20}}\put(25,10){\vector(0,-1){20}}
+% \put(20,-2){$W$}
+% \put(80,-10){\line(1,0){5}} \put(80,-5){\line(1,0){5}}
+% \put(85,-7.5){\vector(0,-1){2.5}} \put(85,-7.5){\vector(0,1){2.5}}
+% \put(86,-10){$IN$}
+% \end{picture}
+% \end{minipage}
+% \caption[\LaTeX-like implementation of \cmd{\vector}]^^A
+% {Sketch of the path drawn by the \LaTeX-like implementation
+% of \cmd{\vector}. (Note: We are using the redefined macros of
+% \textsf{pict2e}!)}
+% \label{fig:vector:ltx}
+% \end{figure}
+%
+% \begin{macro}{\pIIe@vector@ltx}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% \changes{v0.1y}{2003/11/27}{First implementation. (RN,HjG)}
+% The arrow outline.
+% (Not yet quite the same as with \LaTeX's fonts.)
+%
+% Problem: Extrapolation.
+% There are only two design sizes (thicknesses) for \LaTeX's line
+% drawing fonts.
+% Where can we go from there?
+%
+% Note that only the arrow head will be drawn, if the length argument
+% of the \cmd{\vector} command is smaller than the calculated length
+% of the arrow head.
+% ^^A (Orig.\ \LaTeX: only, if length =~0!?)
+% \begin{macrocode}
+ \newcommand*\pIIe@vector@ltx{%
+ \@ydim\pIIe@FAW\@wholewidth \advance\@ydim\pIIe@CAW\relax
+ \@ovxx\pIIe@FAL\@ydim
+ \@xdim\@linelen \advance\@xdim-\@ovxx
+ \divide\@ydim\tw@
+ \divide\@ovxx\tw@ \advance\@ovxx\@xdim
+ \@ovyy\@ydim
+ \divide\@ovyy\tw@ \advance\@ovyy-\pIIe@FAI\@ydim
+% \end{macrocode}
+% \noindent
+% \BigIndent $P_d = P_1 + 1/3 (P_n - P_1)$
+% \begin{macrocode}
+ \pIIe@bezier@QtoC\@linelen\@ovxx\@ovro
+ \pIIe@bezier@QtoC\z@\@ovyy\@ovri
+% \end{macrocode}
+% \BigIndent $P_c = P_7 + 1/3 (P_n - P_7)$
+% \begin{macrocode}
+ \pIIe@bezier@QtoC\@xdim\@ovxx\@clnwd
+ \pIIe@bezier@QtoC\@ydim\@ovyy\@clnht
+% \end{macrocode}
+% \BigIndent $P_1$
+% \begin{macrocode}
+ \pIIe@moveto\@linelen\z@
+% \end{macrocode}
+% \BigIndent $P_a \quad P_b \quad P_2$
+% \begin{macrocode}
+ \pIIe@curveto\@ovro{-\@ovri}\@clnwd{-\@clnht}\@xdim{-\@ydim}%
+ \ifdim\@xdim>\z@
+% \end{macrocode}
+% \BigIndent $P_3$
+% \begin{macrocode}
+ \pIIe@lineto\@xdim{-\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_4$
+% \begin{macrocode}
+ \pIIe@lineto\z@{-\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_5$
+% \begin{macrocode}
+ \pIIe@lineto\z@{\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_6$
+% \begin{macrocode}
+ \pIIe@lineto\@xdim{\@halfwidth}%
+ \fi
+% \end{macrocode}
+% \BigIndent $P_7$
+% \begin{macrocode}
+ \pIIe@lineto\@xdim\@ydim
+% \end{macrocode}
+% \BigIndent $P_c \quad P_d \quad P_1$
+% \begin{macrocode}
+ \pIIe@curveto\@clnwd\@clnht\@ovro\@ovri\@linelen\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \paragraph{\PSTricks\ version}
+%
+% The arrows drawn by the variant generated by the \textsf{pstarrows}
+% package option are
+% modeled after those in the \textsf{pstricks} package~\cite{PSTRICKS}.
+% See Figure~\ref{fig:vector:pst}.
+%
+% \begin{figure}
+% \setlength\unitlength{.0067\linewidth}\hfill
+% \makebox[0pt][r]{^^A
+% \begin{minipage}[c]{17em}^^A
+% \unboldmath\small
+% \setlength\arraycolsep{.5\arraycolsep}^^A
+% \begin{eqnarray*}
+% L & = & \cmd{\@linelen} \\
+% W & = & \cmd{\@wholewidth} = 2\times\cmd{\@halfwidth} \\
+% AW & = & \cmd{\pIIe@FAW}\times W + \cmd{\pIIe@CAW} \\
+% AL & = & \cmd{\pIIe@FAL}\times AW \\
+% IN & = & \cmd{\pIIe@FAI}\times AL
+% \end{eqnarray*}
+% \end{minipage}}^^A
+% \hspace{\marginparsep}
+% \begin{minipage}[c]{105\unitlength}^^A
+% \rule{\linewidth}{0pt}
+% \begin{picture}(105,55)(0,-25)
+% \boldmath\bfseries
+% \THICKLINES
+% \put(100,0){\FPOINT} \put(101,-1){$P_1$}
+% \put(100,0){\line(-2,-1){40}}^^A P1--P2
+% \put(60,-20){\FPOINT} \put(61,-23){$P_2$}
+% \put(60,-20){\line(4,5){8}}^^A P2--P3
+% \put(68,-10){\FPOINT} \put(70,-11){$P_3$}
+% \put(68,-10){\line(-1,0){68}}^^A P3--P4
+% \put(0,-10){\FPOINT} \put(1,-8){$P_4$}
+% \put(0,-10){\line(0,1){20}}^^A P4--P5
+% \put(0,10){\FPOINT} \put(1,6){$P_5$}
+% \put(0,10){\line(1,0){68}}^^A P5--P6
+% \put(68,10){\FPOINT} \put(70,9){$P_6$}
+% \put(68,10){\line(-4,5){8}}^^A P6--P7
+% \put(60,20){\FPOINT} \put(61,21){$P_7$}
+% \put(60,20){\line(2,-1){40}}^^A P7--P1
+% \thinlines
+% \put(76,0){\FPOINT} \put(78,-1){$P_i$}
+% \put(68,-10){\line(4,5){8}}^^A P3--Pi
+% \put(68,10){\line(4,-5){8}}^^A P6--Pi
+% ^^A
+% \put(-2,0){\line(1,0){4}}
+% \put(10,-7){\vector(-10,7){10}}\put(10,-8){$\,(0,0)$}
+% ^^A
+% \put(60,-20){\line(0,-1){5}}\put(100,0){\line(0,-1){25}}
+% \put(60,-25){\vector(1,0){40}}\put(100,-25){\vector(-1,0){40}}
+% \put(77,-24){$AL$}
+% ^^A
+% \put(0,10){\line(0,1){15}}\put(100,0){\line(0,1){25}}
+% \put(0,25){\vector(1,0){100}}\put(100,25){\vector(-1,0){100}}
+% \put(48,26){$L$}
+% ^^A
+% \put(60,-20){\line(-1,0){5}} \put(60,20){\line(-1,0){5}}
+% \put(55,-20){\vector(0,1){40}} \put(55,20){\vector(0,-1){40}}
+% \put(47,-2){$AW$}
+% ^^A
+% \put(60,-20){\line(0,1){40}}
+% \put(60,0){\vector(1,0){15}}
+% \put(76,0){\vector(-1,0){16}}
+% \put(65,1){$IN$}
+% ^^A
+% \put(25,-10){\vector(0,1){20}}\put(25,10){\vector(0,-1){20}}
+% \put(20,-2){$W$}
+% \end{picture}
+% \end{minipage}
+% \caption[\PSTricks-like implementation of \cmd{\vector}]^^A
+% {Sketch of the path drawn by the \PSTricks-like implementation
+% of \cmd{\vector}. (Note: We are using the redefined macros of
+% \textsf{pict2e}!)}
+% \label{fig:vector:pst}
+% \end{figure}
+%
+% \begin{macro}{\pIIe@vector@pst}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% The arrow outline.
+% Note that only the arrowhead will be drawn, if the length argument
+% of the \cmd{\vector} command is smaller than the calculated length
+% of the arrow head.
+% ^^A (Orig.\ \LaTeX: only, if length =~0!?)
+% \begin{macrocode}
+ \newcommand*\pIIe@vector@pst{%
+ \@ydim\pIIe@FAW\@wholewidth \advance\@ydim\pIIe@CAW\relax
+ \@ovxx\pIIe@FAL\@ydim
+ \@xdim\@linelen \advance\@xdim-\@ovxx
+ \divide\@ydim\tw@
+ \@ovyy\@ydim \advance\@ovyy-\@halfwidth
+ \@ovdx\pIIe@FAI\@ovxx
+ \pIIe@@divide\@ovdx\@ydim
+ \@ovxx\strip@pt\@ovyy\@tempdimc
+ \advance\@ovxx\@xdim
+ \advance\@ovdx\@xdim
+% \end{macrocode}
+% \BigIndent $P_1$
+% \begin{macrocode}
+ \pIIe@moveto\@linelen\z@
+% \end{macrocode}
+% \BigIndent $P_2$
+% \begin{macrocode}
+ \pIIe@lineto\@xdim{-\@ydim}%
+ \ifdim\@xdim>\z@
+% \end{macrocode}
+% \BigIndent $P_3$
+% \begin{macrocode}
+ \pIIe@lineto\@ovxx{-\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_4$
+% \begin{macrocode}
+ \pIIe@lineto\z@{-\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_5$
+% \begin{macrocode}
+ \pIIe@lineto\z@{\@halfwidth}%
+% \end{macrocode}
+% \BigIndent $P_6$
+% \begin{macrocode}
+ \pIIe@lineto\@ovxx{\@halfwidth}%
+ \else
+% \end{macrocode}
+% \BigIndent $P_i$
+% \begin{macrocode}
+ \pIIe@lineto\@ovdx\z@
+ \fi
+% \end{macrocode}
+% \BigIndent $P_7$
+% \begin{macrocode}
+ \pIIe@lineto\@xdim\@ydim
+% \end{macrocode}
+% \BigIndent $P_1$
+% \begin{macrocode}
+ \pIIe@lineto\@linelen\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Circle and Dot}
+% \label{sec:implementation:circle+dot}
+%
+% \begin{macro}{\@circle}
+% The circle will either be stroked \dots
+% \begin{macrocode}
+ \def\@circle#1{\begingroup \@tempswafalse\pIIe@circ{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@dot}
+% \dots\ or filled.
+% \begin{macrocode}
+ \def\@dot#1{\begingroup \@tempswatrue\pIIe@circ{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@circ}
+% Common code.
+% ^^A (Could\slash should be named \cmd{\@circ}!?)
+% \begin{macrocode}
+ \newcommand*\pIIe@circ[1]{%
+% \end{macrocode}
+% We need the radius instead of the diameter.
+% Unlike \SL, we check for negative or zero diameter argument.
+% ^^A Useful: error check when calculating coordinates.
+% \changes{v0.2h}{2004/01/07}{Check for negative or zero diameter
+% argument (RN,HjG)}
+% \changes{v0.2n}{2004/04/22}{Allow zero diameter (RN/HjG)}
+% \begin{macrocode}
+ \@tempdima#1\unitlength
+ \ifdim\@tempdima<\z@ \pIIe@badcircarg \fi
+ \divide\@tempdima\tw@
+ \pIIe@circle\@tempdima
+% \end{macrocode}
+% With the current state of affairs, we could use
+% \cmd{\pIIe@drawGraph} directly; but that would possibly be a case of
+% premature optimisation.
+% (Note to ourselves:
+% Use of the |@tempswa| switch both here and inside quarter-circle!
+% Hence a group is necessary there.)
+% \begin{macrocode}
+ \if@tempswa \pIIe@fillGraph \else \pIIe@strokeGraph \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@circle}
+% Approximate a full circle by four quarter circles.
+% \changes{v0.1g}{2003/08/23}{Changed code (using
+% \cmd{\pIIe@add@qcircle}). (HjG,RN)}
+% \begin{macrocode}
+ \newcommand*\pIIe@circle[1]{%
+ \pIIe@qcircle[1]\z@{#1}\pIIe@qcircle \@ne{#1}%
+ \pIIe@qcircle \tw@{#1}\pIIe@qcircle\thr@@{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@qcircle}
+% \changes{v0.1u}{2003/11/21}{%
+% Change coding of quadrant number to match bit number in
+% \cmd{\pIIe@get@quadrants} (HjG)}
+% \changes{v0.1v}{2003/11/22}{Exchange \cmd{\@xdim} and \cmd{\@ydim} to
+% \cmd{\@ovri} and \cmd{\@ovro} (HjG)}
+% Approximate a quarter circle, using cubic Bezier splines.
+%
+% \begin{figure}
+% \setlength\unitlength{.0033\linewidth}\hfill
+% \begin{minipage}{125\unitlength}
+% \begin{picture}(125,122)(-13,-3)
+% \boldmath\bfseries
+% \thinlines
+% ^^A\put(-13,-3){\framebox(125,122){}}
+% \put(0,0){\OPOINT}\put(2,4){$(0,0)$}
+% \put(2,0){\vector(1,0){96}}\put(98,0){\vector(-1,0){96}}
+% \put(40,2){$radius$}
+% \put(0,2){\vector(0,1){96}}\put(0,98){\vector(0,-1){96}}
+% \put(-7,40){\rotatebox{90}{$radius$}}
+% \put(100,0){\FPOINT}\put(89,4){$P_0$}
+% \put(100,55){\OPOINT}\put(95,59){$P_1$}
+% \put(100,0){\line(1,0){10}}\put(102,55){\line(1,0){8}}
+% \put(110,0){\vector(0,1){55}}\put(110,55){\vector(0,-1){55}}
+% \put(104,2){{\footnotesize\rotatebox{90}{$0.5523\times radius$}}}
+% ^^A
+% \put(0,100){\line(0,1){10}}\put(55,102){\line(0,1){8}}
+% \put(0,110){\vector(1,0){55}}\put(55,110){\vector(-1,0){55}}
+% \put(2,112){{\footnotesize $0.5523\times radius$}}
+% ^^A
+% \put(55, 100){\OPOINT}\put(57,98){$P_2$}
+% \put(0,100){\FPOINT}\put(-12,98){$P_3$}
+% \THICKLINES
+% \cbezier(100,0)(100,55)(55,100)(0,100)
+% \end{picture}
+% \end{minipage}\hspace*{\fill}
+% \caption[Auxillary macro \cmd{\pIIe@qcircle}---draw a quarter circle]^^A
+% {Sketch of the quarter circle path drawn by \cmd{\pIIe@qcircle} (NE~quarter)}
+% \label{fig:qcircle}
+% \end{figure}
+%
+% \#1=Switch (0=no `moveto', 1=`moveto'),
+% \#2=Quadrant No., \#3=Radius.
+%
+% \begin{tabular}{l@{\qquad}l}
+% 0 = 1st Quadrant (NE) & 1 = 2nd Quadrant (NW) \\
+% 2 = 3rd Quadrant (SW) & 3 = 4th Quadrant (SE)
+% \end{tabular}
+%
+% \noindent
+% (\PS: We could use the \texttt{arc} operator!)
+%
+% $ 0.55228474983 = $``magic\ number'' (see~\cite{EBEZIER}).
+%
+% Sacrifice a save level (otherwise a private ``switch'' macro were
+% necessary!)
+% \begin{macrocode}
+ \newcommand*\pIIe@qcircle[3][0]{%
+ \begingroup
+ \@ovro#3\relax \@ovri0.55228474983\@ovro
+ \@tempdimc\@ovri \advance\@tempdimc-\@ovro
+ \ifnum#1>\z@ \@tempswatrue \else \@tempswafalse \fi
+ \ifcase#2\relax
+% \end{macrocode}
+% \BigIndent NE
+% \begin{macrocode}
+ \pIIe@@qcircle\@ovro\z@\z@\@ovri\@tempdimc\@ovro{-\@ovro}\@ovro
+ \or
+% \end{macrocode}
+% \BigIndent NW
+% \begin{macrocode}
+ \pIIe@@qcircle\z@\@ovro{-\@ovri}\z@{-\@ovro}\@tempdimc{-\@ovro}{-\@ovro}%
+ \or
+% \end{macrocode}
+% \BigIndent SW
+% \begin{macrocode}
+ \pIIe@@qcircle{-\@ovro}\z@\z@{-\@ovri}{-\@tempdimc}{-\@ovro}\@ovro{-\@ovro}%
+ \or
+% \end{macrocode}
+% \BigIndent SE
+% \begin{macrocode}
+ \pIIe@@qcircle\z@{-\@ovro}\@ovri\z@\@ovro{-\@tempdimc}\@ovro\@ovro
+ \fi
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@@qcircle}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% Ancillary macro; saves us some tokens above.
+%
+% Note:
+% Use of |rcurveto| instead of |curveto| makes it possible (or at
+% least much easier) to re-use this macro for the rounded corners of
+% ovals.
+% \begin{macrocode}
+ \newcommand*\pIIe@@qcircle[8]{%
+ \if@tempswa\pIIe@moveto{#1}{#2}\fi \pIIe@rcurveto{#3}{#4}{#5}{#6}{#7}{#8}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@badcircarg}
+% \changes{v0.2h}{2004/01/07}{New error message. (RN,HjG)}
+% Obvious cousin to |\@badlinearg| from the \LaTeX\ kernel.
+% \begin{macrocode}
+ \newcommand*\pIIe@badcircarg{%
+ \PackageError{pict2e}%
+ {Illegal argument in \protect\circle(*) or \protect\oval}%
+ {The radius of a circle, dot or oval corner must be greater than zero.}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Oval}
+% \label{sec:implementation:oval}
+%
+% \begin{macro}{\maxovalrad}
+% User level command, may be redefined by \cmd{\renewcommand*}.
+% It may be given as an explicit (rigid) length (i.e., with unit)
+% or as a number.
+% In the latter case it is used as a factor to be multiplied by
+% \cmd{\unitlength}.
+% \ (|dimen| and |count| registers should work, too.) \ ^^A
+% The default value is 20\,pt as specified for the \oarg{rad}
+% argument of \cmd{\oval} by the \LaTeX\ manual
+% \cite[p.~223]{LAMPORT}.
+% \begin{macrocode}
+\newcommand*\maxovalrad{20pt}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@defaultUL}
+% \begin{macro}{\pIIe@def@UL}
+% The aforementioned behaviour seems necessary, since
+% \cite[p.~223]{LAMPORT} does not specify explicitly whether the
+% \oarg{rad} argument should be given in terms of \cmd{\unitlength} or
+% as an absolute length.
+% To implement this feature, we borrow from the \textsf{graphics}
+% package:
+% See \cmd{\Gin@defaultbp} and \cmd{\Gin@def@bp} from
+% \texttt{graphics.dtx}.
+% \begin{macrocode}
+\newcommand*\pIIe@defaultUL[2]{%
+ \afterassignment\pIIe@def@UL\dimen@#2\unitlength\relax{#1}{#2}}
+% \end{macrocode}
+% However, things are simpler in our case, since we always need the
+% value stored in \cmd{\dimen@}.
+% Hence, we could\slash should omit the unnecessary argument!?)
+% \changes{v0.2h}{2004/01/07}{Check for negative or zero radius
+% argument (RN,HjG)}
+% \changes{v0.2n}{2004/04/22}{Moved radius test to \cmd{\oval},
+% where it belongs (RN/HjG)}
+% \begin{macrocode}
+\newcommand*\pIIe@def@UL{}
+\def\pIIe@def@UL#1\relax#2#3{%
+% \if!#1!%
+% \def#2{#3}% \edef ?
+% \else
+% \edef#2{\strip@pt\dimen@}%
+% \fi
+ \edef#2{\the\dimen@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\oval}
+% \begin{macro}{\pIIe@maxovalrad}
+% The variant of \cmd{\oval} defined here takes an additional optional
+% argument, which specifies the maximum radius of the rounded corners
+% (default = 20\,pt, as given above).
+% ^^A [Test: length or counter register as optional argument?]
+% Unlike \SL, we check for negative or zero radius argument.
+% \cmd{\pIIe@maxovalrad} is the internal variant of \cmd{\maxovalrad}.
+% \changes{v0.2n}{2004/04/22}{Moved radius test from \cmd{\pIIe@def@UL}
+% (RN/HjG)}
+% \changes{v0.2n}{2004/04/22}{Allow zero diameter (RN/HjG)}
+% \begin{macrocode}
+\newcommand*\pIIe@maxovalrad{}
+\renewcommand*\oval[1][\maxovalrad]{%
+ \begingroup \pIIe@defaultUL\pIIe@maxovalrad{#1}%
+ \ifdim\pIIe@maxovalrad<\z@ \pIIe@badcircarg \fi
+% \end{macrocode}
+% Can't close the group here, since arguments must be parsed.
+% (This is done by calling the saved original.)
+% \begin{macrocode}
+ \pIIe@oldoval}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@oval}
+% (This is called in turn by the saved original.)
+% \begin{macrocode}
+\def\@oval(#1,#2)[#3]{%
+% \end{macrocode}
+% In analogy to circles, we need only half of the size value.
+% \begin{macrocode}
+ \@ovxx#1\unitlength \divide\@ovxx\tw@
+ \@ovyy#2\unitlength \divide\@ovyy\tw@
+ \@tempdimc \ifdim\@ovyy>\@ovxx \@ovxx \else \@ovyy \fi
+ \ifdim\pIIe@maxovalrad<\@tempdimc \@tempdimc\pIIe@maxovalrad\relax \fi
+% \end{macrocode}
+% Subtract the radius of the corners to get coordinates for the
+% straight line segments.
+% \begin{macrocode}
+ \@xdim\@ovxx \advance\@xdim-\@tempdimc
+ \@ydim\@ovyy \advance\@ydim-\@tempdimc
+% \end{macrocode}
+% Determine which parts of the oval we have to draw.
+% \begin{macrocode}
+ \pIIe@get@quadrants{#3}%
+% \end{macrocode}
+% ``\verb+@tempswa+ = false'' means, that we have to suppress the `moveto'
+% in the following quadrant.
+% \begin{macrocode}
+ \@tempswatrue
+% \end{macrocode}
+% The following isn't strictly necessary, but yields a single (unfragmented)
+% path even for \verb+[r]+ (right half of oval only).
+% Useful for future extensions.
+%
+% \noindent
+% Bits 3 and 0 set? (SE/NE)
+% \begin{macrocode}
+ \ifnum9=\@tempcnta
+ \pIIe@qoval\z@{-\@ovyy}{\@xdim}{-\@ovyy}\thr@@\@tempdimc\@ovxx\z@
+% \end{macrocode}
+% Bit 0 set! (NE)
+% \begin{macrocode}
+ \@tempcnta\@ne
+ \fi
+% \end{macrocode}
+% Bit 0 set? (NE)
+% \begin{macrocode}
+ \pIIe@qoval\@ovxx\z@\@ovxx\@ydim\z@\@tempdimc\z@\@ovyy
+% \end{macrocode}
+% Bit 1 set? (NW)
+% \begin{macrocode}
+ \pIIe@qoval\z@\@ovyy{-\@xdim}\@ovyy\@ne\@tempdimc{-\@ovxx}\z@
+% \end{macrocode}
+% Bit 2 set? (SW)
+% \begin{macrocode}
+ \pIIe@qoval{-\@ovxx}\z@{-\@ovxx}{-\@ydim}\tw@\@tempdimc\z@{-\@ovyy}%
+% \end{macrocode}
+% Bit 3 set? (SE)
+% \begin{macrocode}
+ \pIIe@qoval\z@{-\@ovyy}{\@xdim}{-\@ovyy}\thr@@\@tempdimc\@ovxx\z@
+% \end{macrocode}
+% Now we've finished, draw the oval and finally close the group opened
+% by \cmd{\oval} above.
+% \begin{macrocode}
+ \pIIe@strokeGraph
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@qoval}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% \changes{v0.1w}{2003/11/25}{Rename \cmd{\pIIe@oval}
+% to \cmd{\pIIe@qoval} (HjG)}
+% Ancillary macro; saves us some tokens above.
+%
+% \noindent
+% (\PS: We could use the \texttt{arc} or \texttt{arcto} operator!)
+% \begin{macrocode}
+ \newcommand*\pIIe@qoval[8]{%
+% \end{macrocode}
+% Bit set?
+% \begin{macrocode}
+ \ifodd\@tempcnta
+ \if@tempswa\pIIe@moveto{#1}{#2}\fi
+ \pIIe@lineto{#3}{#4}\pIIe@qcircle{#5}{#6}\pIIe@lineto{#7}{#8}%
+ \@tempswafalse
+ \else
+ \@tempswatrue
+ \fi
+% \end{macrocode}
+% Shift by one bit.
+% \begin{macrocode}
+ \divide\@tempcnta\tw@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@get@quadrants}
+% \changes{v0.1t}{2003/11/13}{Rename \cmd{\pIIe@get@ovalquadrants} to
+% \cmd{\pIIe@get@quadrants} (RN)}
+% According to the parameter (\texttt{tlbr}) bits are set in
+% \cmd{\@tempcnta}:\par
+% \begin{tabular}{l@{\qquad}l}
+% 0 = 1st Quadrant (NE) & 1 = 2nd Quadrant (NW) \\
+% 2 = 3rd Quadrant (SW) & 3 = 4th Quadrant (SE)
+% \end{tabular}\par\noindent
+% (Cf.\ \cmd{\@oval} and \cmd{\@ovvert} in the \LaTeX\ kernel.)
+% We abuse \cmd{\@setfpsbit} from the float processing modules of the
+% kernel.
+% ^^A (Should this go to section low-level?)
+% \begin{macrocode}
+ \newcommand*\pIIe@get@quadrants[1]{%
+ \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue \@tempcnta\z@
+ \@tfor\reserved@a:=#1\do{\csname @ov\reserved@a false\endcsname}%
+ \if@ovr \if@ovb\@setfpsbit2\fi \if@ovt\@setfpsbit4\fi \fi
+ \if@ovl \if@ovb\@setfpsbit1\fi \if@ovt\@setfpsbit8\fi \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Quadratic Bezier Curve}
+% \label{sec:implementation:bezier-curves}
+%
+% \begin{macro}{\@bezier}
+% \changes{v0.1u}{2003/11/21}{Change calculation of cubic bezier parameters
+% to use less tokens (HjG)}
+% \changes{v0.2o}{2004/06/25}
+% {Supply \cmd{\ignorespaces} to match kernel version (HjG)}
+% \changes{v0.2p}{2004/07/27}{\cmd{\@killglue} added. (RN)}
+% \#1, the maximum number of points to use, is simply ignored,
+% as well as \cmd{\qbeziermax}.
+%
+% The kernel version of \cmd{\@bezier} uses \cmd{\put} internally,
+% which features \cmd{\@killglue} and \cmd{\ignorespaces} commands
+% in turn (at the beginning and end, respectively).
+% Since we don't use \cmd{\put}, we have to add the latter commands
+% by hand.
+% \begin{macrocode}
+ \def\@bezier#1(#2,#3)(#4,#5)(#6,#7){%
+% \end{macrocode}
+% \BigIndent $P_0=(\#2,\#3)$\quad$P_m=(\#4,\#5)$\quad$P_3=(\#6,\#7)$
+% \begin{macrocode}
+ \@killglue
+ \begingroup
+ \@ovxx#2\unitlength \@ovyy#3\unitlength
+ \@ovdx#4\unitlength \@ovdy#5\unitlength
+ \@xdim#6\unitlength \@ydim#7\unitlength
+% \end{macrocode}
+% \noindent
+% \BigIndent $P_1 = P_m + 1/3 (P_0 - P_m)$
+% \begin{macrocode}
+ \pIIe@bezier@QtoC\@ovxx\@ovdx\@ovro
+ \pIIe@bezier@QtoC\@ovyy\@ovdy\@ovri
+% \end{macrocode}
+% \BigIndent $P_2 = P_m + 1/3 (P_3 - P_m)$
+% \begin{macrocode}
+ \pIIe@bezier@QtoC\@xdim\@ovdx\@clnwd
+ \pIIe@bezier@QtoC\@ydim\@ovdy\@clnht
+% \end{macrocode}
+% \BigIndent $(P_{0x},P_{0y})$
+% \begin{macrocode}
+ \pIIe@moveto\@ovxx\@ovyy
+% \end{macrocode}
+% \BigIndent $(P_{1x},P_{1y})$\quad$(P_{2x},P_{2y})$\quad$(P_{3x},P_{3y})$
+% \begin{macrocode}
+ \pIIe@curveto\@ovro\@ovri\@clnwd\@clnht\@xdim\@ydim
+ \pIIe@strokeGraph
+ \endgroup
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pIIe@bezier@QtoC}
+% \changes{v0.1u}{2003/11/21}{New ancillary macro (HjG)}
+% Ancillary macro; saves us some tokens above.
+%
+% \noindent
+% Transformation:
+% quadratic bezier parameters $\rightarrow$ cubic bezier parameters.
+%
+% \noindent
+% (Missing: Reference for mathematical formula. Or is this trivial?)
+% \begin{macrocode}
+ \newcommand*\pIIe@bezier@QtoC[3]{%
+ \@tempdimc#1\relax \advance\@tempdimc-#2\relax
+ \divide\@tempdimc\thr@@ \advance\@tempdimc #2\relax
+ #3\@tempdimc}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Commands from other packages}
+%
+% \subsubsection{Package \textsf{ebezier}}
+% \label{sec:implementation:ebezier}
+%
+% One feature from~\cite{EBEZIER}.
+%
+% \begin{macro}{\cbezier}
+% \begin{macro}{\@cbezier}
+% \changes{v0.2o}{2004/06/25}
+% {Supply \cmd{\ignorespaces} to match kernel version (HjG)}
+% \changes{v0.2p}{2004/07/27}{\cmd{\@killglue} added. (RN)}
+% \begin{macro}{\pIIe@@cbezier}
+% \#1, the maximum number of points to use, is simply ignored,
+% as well as \cmd{\qbeziermax}.
+%
+% Like the kernel version of \cmd{\@bezier},
+% the original version of \cmd{\@cbezier} uses \cmd{\put} internally,
+% which features \cmd{\@killglue} and \cmd{\ignorespaces} commands
+% in turn (at the beginning and end, respectively).
+% Since we don't use \cmd{\put}, we have to add the latter commands
+% by hand.
+%
+% ^^A (What about |\lbezier|?)
+%
+% \noindent
+% Original head of the macro:\par
+% \verb|\def\cbezier{\@ifnextchar [{\@cbezier}{\@cbezier[0]}}|\par
+% \noindent Changed analogous to the \LaTeX\ kernel's \cmd{\qbezier} and
+% \cmd{\bezier}:
+% \begin{macrocode}
+ \AtBeginDocument{\@ifundefined{cbezier}{\newcommand}{\renewcommand}*%
+ \cbezier[2][0]{\pIIe@@cbezier[#1]#2}%
+ \@ifdefinable\pIIe@@cbezier{}%
+ \def\pIIe@@cbezier#1)#2(#3)#4(#5)#6({\@cbezier#1)(#3)(#5)(}%
+ \def\@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
+ \@killglue
+ \pIIe@moveto{#2\unitlength}{#3\unitlength}%
+ \pIIe@curveto{#4\unitlength}{#5\unitlength}%
+ {#6\unitlength}{#7\unitlength}{#8\unitlength}{#9\unitlength}%
+ \pIIe@strokeGraph
+ \ignorespaces}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Other packages}
+% \label{sec:implementation:others}
+%
+% Other macros from various packages may be included in future
+% versions of this package.
+% ^^A (Or in a sibling package \textsf{pict2x} or \textsf{pict2ext}.)
+%
+% \subsection{Mode `original'}
+%
+% ^^A Necessary? Useful?
+% ^^A \bigskip
+%
+% \noindent
+% Other branch of the big switch,\label{big-switch-end}
+% started near the beginning of the code
+% (see page~\pageref{big-switch-begin}).
+% \begin{macrocode}
+\else
+% \end{macrocode}
+%
+% \begin{macro}{\oval}
+% \begin{macro}{\maxovalrad}
+% \begin{macro}{\OriginalPictureCmds}
+% Gobble the new optional argument and continue with saved version.
+% \cmd{\maxovalrad} is there to avoid error messages in case the
+% user's document redefines it with \cmd{\renewcommand*}.
+% Likewise, \cmd{\OriginalPictureCmds} is only needed for test
+% documents.
+% \begin{macrocode}
+ \renewcommand*\oval[1][]{\pIIe@oldoval}
+ \newcommand*\maxovalrad{20pt}
+ \newcommand*\OriginalPictureCmds{}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Final clean-up}
+%
+% Restore Catcodes.
+% \begin{macrocode}
+\Gin@codes
+\let\Gin@codes\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+%
+%\ifdeveloping
+%
+% \section{Bugs}
+%
+% Das muss hier besser werden! Wie? longtable!?
+%
+% \bigskip
+% \noindent
+% \begin{tabular}{@{}rlccclp{30mm}@{}}
+% \hline
+% No. & Submitted by & Reported & V.no. & Fixed & Fixed by
+% & Remark \\
+% \hline
+% \hline
+% 1 & Volker Kiefel & 2004/05/29 & v0.2o & 2004/06/25 & HjG
+% & Trouble with language support; e.g., \texttt{german.sty}.
+% ($\mapsto$ Save and restore catcodes.) \\
+% \hline
+% 2 & Dwight Aplevich & 2004/06/04 & v0.2o & 2004/06/25 & HjG
+% & Cannot connect two |\cbezier| curves (second one displaced).
+% ($\mapsto$ Supply |\ignorespaces| in definition of bezier
+% commands.) \\
+% \hline
+% 3 & Alan G. Isaac & 2004/06/23 & v0.2o & 2004/06/25 & HjG
+% & Like \#2. \\
+% \hline
+% \end{tabular}
+%
+%\iffalse
+% \newenvironment{erratalist}
+% {\begin{longtable}{r>{\raggedright}p{2cm}l>{\raggedright}p{10cm}l}}
+% {\endgobble\end{longtable}}
+%\fi
+%
+% \bigskip
+% \noindent
+% \begin{longtable}{@{}r^^A No.
+% >{\raggedright}p{2cm}^^A Submitted
+% >{\raggedright}p{2cm}^^A Fixed
+% >{\raggedright}p{8.5cm}^^A Remark
+% @{}}
+% \hline
+% No. & Submitted & Fixed & Remark (Synopsis and Fix)
+% \tabularnewline \hline \hline
+% 1 & v0.2n? 2004/05/29 Volker Kiefel
+% & v0.2o 2004/06/25 HjG
+% & Trouble with language support; e.g., \texttt{german.sty}.
+% \\ ($\mapsto$ Save and restore catcodes.)
+% \tabularnewline \hline
+% 2 & v0.2n? 2004/06/04 Dwight Aplevich
+% & v0.2o 2004/06/25 HjG
+% & Cannot connect two |\cbezier| curves (second one displaced).
+% \\ ($\mapsto$ Supply |\ignorespaces| in definition of bezier
+% commands.)
+% \tabularnewline \hline
+% 3 & v0.2n? 2004/06/23 Alan G. Isaac
+% & v0.2o 2004/06/25 HjG
+% & Like \#2.
+% \tabularnewline \hline
+% \end{longtable}
+%
+% \bigskip
+% \noindent
+% \begin{tabular}{@{}r>{\raggedright}p{.6\textwidth}@{}}^^A tabularx? RN
+% \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 1 \\
+% Submitted by & Volker Kiefel \\
+% Reported & 2004/05/29 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Trouble with language support; e.g., \texttt{german.sty}.
+% ($\mapsto$\,Save and restore catcodes.)
+% \tabularnewline \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 2 \\
+% Submitted by & Dwight Aplevich \\
+% Reported & 2004/06/04 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Cannot connect two |\cbezier| curves (second one displaced).
+% ($\mapsto$ Supply |\ignorespaces| in definition of bezier
+% commands.)
+% \tabularnewline \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 3 \\
+% Submitted by & Alan G. Isaac \\
+% Reported & 2004/06/23 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Like \#2.
+% \tabularnewline \hline
+% \end{tabular}
+%
+% \bigskip
+% \noindent
+% \begin{longtable}{@{}rp{.6\textwidth}@{}}
+% \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 1 \\
+% Submitted by & Volker Kiefel \\
+% Reported & 2004/05/29 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Trouble with language support; e.g., \texttt{german.sty}.
+% ($\mapsto$\,Save and restore catcodes.)
+% \tabularnewline \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 2 \\
+% Submitted by & Dwight Aplevich \\
+% Reported & 2004/06/04 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Cannot connect two |\cbezier| curves (second one displaced).
+% ($\mapsto$ Supply |\ignorespaces| in definition of bezier
+% commands.)
+% \tabularnewline \hline
+% \begin{tabular}[t]{@{}>{\bfseries}rl@{}}
+% No. & 3 \\
+% Submitted by & Alan G. Isaac \\
+% Reported & 2004/06/23 \\
+% Version & v0.2o \\
+% Fixed & 2004/06/25 \\
+% Fixed by & HjG
+% \end{tabular} &
+% Like \#2.
+% \tabularnewline \hline
+% \end{longtable}
+%
+%\fi
+%
+%
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/pict2e/pict2e.ins b/Master/texmf-dist/source/latex/pict2e/pict2e.ins
new file mode 100644
index 00000000000..aa839aa59ee
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pict2e/pict2e.ins
@@ -0,0 +1,102 @@
+% Time-stamp: "pict2e.ins 2004-02-19 23:18:13 CET Thursday hubertjg"
+%%
+%% Copyright (C) 2003, 2004
+%% Rolf Niepraschk, Rolf.Niepraschk@ptb.de
+%% Hubert Gaesslein, HubertJG@open.mind.de
+%%
+%% This file is part of the LaTeX `pict2e' package.
+%% ------------------------------------------------
+%%
+%% This work 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 "author-maintained".
+%%
+%% In particular, NO PERMISSION is granted to modify the contents of this
+%% file since it contains the legal notices that are placed in the files
+%% it generates.
+%%
+%% This work consists of all files listed in manifest.txt.
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+
+\input docstrip
+
+\preamble
+
+Copyright (C) 2003, 2004
+Rolf Niepraschk, Rolf.Niepraschk@ptb.de
+Hubert Gaesslein, HubertJG@open.mind.de
+
+This work 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 "author-maintained".
+
+This work consists of all files listed in `manifest.txt'.
+
+\endpreamble
+
+\keepsilent
+\askforoverwritefalse
+
+\usedir{tex/latex/pict2e}
+
+\generate{\file{pict2e.sty}{\from{pict2e.dtx}{package}}}
+
+%% Generate a `template' .def file as an example for a new driver.
+%% (This is not set up yet.)
+%% \generate{\file{p2e-template.def}{%
+%% \from{p2e-drivers.dtx}{template}}}
+
+\generate{
+ \file{p2e-dvips.def}{%
+ \from{p2e-drivers.dtx}{dvips}}
+% \file{p2e-xdvi.def}{%
+% \from{p2e-drivers.dtx}{xdvi}}
+ \file{p2e-pdftex.def}{%
+ \from{p2e-drivers.dtx}{pdftex}}
+ \file{p2e-vtex.def}{%
+ \from{p2e-drivers.dtx}{vtex}}
+ \file{p2e-dvipdfm.def}{%
+ \from{p2e-drivers.dtx}{dvipdfm}}
+ \file{p2e-textures.def}{%
+ \from{p2e-drivers.dtx}{textures}}
+ \file{p2e-pctexps.def}{%
+ \from{p2e-drivers.dtx}{pctexps}}
+ \file{p2e-pctex32.def}{%
+ \from{p2e-drivers.dtx}{pctex32}}
+}
+
+
+%\usepreamble\empty
+%\usepostamble\empty
+\generate{\file{pict2e-example.cfg}{\from{p2e-drivers.dtx}{cfg}}}
+
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by TeX:}
+\Msg{*}
+\Msg{* All the files with extension `.sty' and `.def'}
+\Msg{*}
+\Msg{* To produce the documentation run the .dtx files through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/piff/ams.dtx b/Master/texmf-dist/source/latex/piff/ams.dtx
new file mode 100644
index 00000000000..21eba8ad40c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/piff/ams.dtx
@@ -0,0 +1,206 @@
+% \iffalse meta-comment
+% \begin{macrocode}
+%<*ams>
+\def\fileversion{3.16}
+\def\filedate{09 Jan 1996 13:53:56 BST}
+\def\filename{ams.dtx}
+\def\Copyright{Copyright (C) 1990,1995 Mike Piff, University of Sheffield, England}
+%</ams>
+% \end{macrocode}
+%
+%You are not allowed to change this file.
+%
+%You are NOT ALLOWED to distribute this file alone. You are NOT
+%ALLOWED to take money for the distribution or use of this
+%file except for a nominal charge for copying etc.
+%
+%Please address any problems to:
+%
+%M.Piff@sheffield.ac.uk
+%
+%For updates, contact your nearest CTAN site.
+%
+% \fi
+%
+% \CheckSum{139}
+%
+% \title{Use of common American Mathematical Society fonts in \LaTeXe}
+% \author{Copyright (C) 1994 by Mike Piff}
+%
+% \maketitle
+% \tableofcontents
+%
+% \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[12pt]{ltxdoc}
+\usepackage[defs]{ams}
+\usepackage{verbatim}
+\begin{document}
+ \DocInput{ams.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \section{Introduction}
+%
+% This package is a minimal one that allows access to the three
+% common AMS symbol font families. To use it, you will need the
+% |amsfonts| package.
+%
+% \section{User interface}
+%
+% The package needs to be included with the command
+% \begin{verbatim}
+% \usepackage[defs]{ams}
+% \end{verbatim}
+% Its effect is to prepare the symbol fonts |msam| and |msbm|
+% and the fraktur font |eufm|. Specification of option |defs|
+% causes all the usual AMS symbol definitions to be made.
+% For instance, after this one can obtain $\curvearrowright$ by
+% typing |$\curvearrowright$|.
+%
+%
+% \DescribeMacro{\Bbb}
+% \newcommand{\SF}{$\langle$\textit{sub-formula}$\rangle$}
+% The command |\Bbb{|\SF|}| typesets \SF\ in blackboard bold.
+% For instance, |\Bbb{ANYTHING}| produces \Bbb{ANYTHING}.
+% Care must be taken to ensure that \SF\ contains only uppercase
+% letters. The math style modifier is |\mathbb|.
+%
+% The commonest letters in mathematics are defined by the commands
+% |\C|, |\F|, |\N|, |\Q|, |\R|, |\T| and |\Z|, producing \C, \F,
+% \N, \Q, \R, \T, \Z\ respectively.
+%
+% \DescribeMacro{\frak}
+% \DescribeMacro{\goth}
+% |\frak| and |\goth| are similar to |\Bbb| except that they use the
+% fractur font, and are not limited to uppercase. Thus |\frak{K}|
+% produces \frak{K}. There is a math style modifier |\mathfrak| too.
+%
+% |\Bbb|, |\frak| and |\goth| work in text and math modes.
+%
+% \DescribeMacro{\MakeBbb}
+% The command |\MakeBbb{X}| has the effect of setting |\X| to expand
+% to |\Bbb{X}|, and thus further blackboard bold symbols are easily
+% defined.
+% \StopEventually{}
+%
+%
+% \section{Identification}
+%
+% This package can only be used with \LaTeXe, so
+% an appropriate message is displayed when another
+% format is used.
+% \begin{macrocode}
+%<*ams>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+% \end{macrocode}
+%
+%
+% Announce the package name and its version:
+% \begin{macrocode}
+\ProvidesPackage{ams}[1996/01/09]
+% \end{macrocode}
+%
+% And display it on the terminal (and the log file):
+% \begin{macrocode}
+\typeout{Package `ams' <\filedate>.}
+\typeout{\Copyright}
+% \end{macrocode}
+%
+% \section{The definition option}
+%
+% There is a single option |defs| that is recognized.
+% \begin{macrocode}
+\DeclareOption{defs}{\AtEndOfPackage{\RequirePackage{amssymb}}}
+\ProcessOptions
+% \end{macrocode}
+%
+% \section{Defining the interface}
+%
+% We load the |amsfonts| package.
+% \begin{macrocode}
+\RequirePackage{amsfonts}
+% \end{macrocode}
+% We make |\Bbb|, |\goth| and |\frak| work in text mode too.
+% \begin{macrocode}
+\def\frak#1{\ensuremath{\mathfrak{#1}}}
+\def\Bbb#1{\ensuremath{\mathbb{#1}}}
+\let\goth\frak
+% \end{macrocode}
+%
+% The next command is a little trickier, but is worth the effort.
+% \begin{macrocode}
+\def\MakeBbb#1{%
+ \edef\tmp{%
+ \noexpand\def\csname#1\endcsname
+ {\noexpand\protect\csname p#1\endcsname}%
+ \noexpand\def\csname p#1\endcsname
+ {\noexpand\Bbb{#1}}%
+ }%
+ \tmp
+}
+% \end{macrocode}
+% We can now define short forms of standard symbols.
+% \begin{macrocode}
+\MakeBbb{C}
+\MakeBbb{F}
+\MakeBbb{N}
+\MakeBbb{Q}
+\MakeBbb{R}
+\MakeBbb{T}
+\MakeBbb{Z}
+% \end{macrocode}
+%
+% We tell the user how to define all of the AMS symbols by name.
+% \begin{macrocode}
+\typeout{Use option defs to define all the AMS symbol names}
+% \end{macrocode}
+%
+% Another job is to replace the awful |cm| inequality symbols.
+% Thus, |a\leq b| will now produce $a\leq b$. We also define the
+% symbols in package |latexsym|, but taking equivalents from the
+% AMS fonts. ($\mho$, $\Join$, $\Box$, $\Diamond$, $\leadsto$
+% $\sqsubset$, $\sqsupset$, $\lhd$, $\unlhd$, $\rhd$ and $\unrhd$.)
+% \begin{macrocode}
+\let\leq\undefined \let\geq\undefined
+\DeclareMathSymbol{\leq} {\mathrel}{AMSa}{"36}
+\DeclareMathSymbol{\geq} {\mathrel}{AMSa}{"3E}
+\let\le\leq \let\ge\geq
+ \let\mho\undefined \let\sqsupset\undefined
+ \let\Join\undefined \let\lhd\undefined
+ \let\Box\undefined \let\unlhd\undefined
+ \let\Diamond\undefined \let\rhd\undefined
+ \let\leadsto\undefined \let\unrhd\undefined
+ \let\sqsubset\undefined
+
+ \DeclareMathSymbol\mho {\mathord}{AMSb}{"66}
+ \DeclareMathSymbol\Box {\mathord}{AMSa}{"03}
+ \let\square\Box
+ \DeclareMathSymbol\Diamond {\mathord}{AMSa}{"06}
+ \DeclareMathSymbol\leadsto {\mathrel}{AMSa}{"20}
+ \DeclareMathSymbol\sqsubset{\mathrel}{AMSa}{"40}
+ \DeclareMathSymbol\sqsupset{\mathrel}{AMSa}{"41}
+ \DeclareMathSymbol\lhd {\mathrel}{AMSa}{"43}
+ \DeclareMathSymbol\unlhd {\mathrel}{AMSa}{"45}
+ \DeclareMathSymbol\rhd {\mathrel}{AMSa}{"42}
+ \DeclareMathSymbol\unrhd {\mathrel}{AMSa}{"44}
+ \def\Join{\mathrel{{\rhd}\mkern-4mu{\lhd}}}
+%</ams>
+% \end{macrocode}
+%\section{The symbol definitions}
+%
+%Here is a listing of the definition file supplied by the AMS.
+%Use the corresponding |\DeclareMathSymbol| line to define a single symbol.
+%If you want all of them, use the |defs| package option.
+%\verbatiminput{amssymb.sty}
+%
+% \Finale
+%
+\endinput
+%
+
diff --git a/Master/texmf-dist/source/latex/piff/ams.ins b/Master/texmf-dist/source/latex/piff/ams.ins
new file mode 100644
index 00000000000..39145f4d245
--- /dev/null
+++ b/Master/texmf-dist/source/latex/piff/ams.ins
@@ -0,0 +1,49 @@
+%%
+%% 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{ams.ins}
+\input docstrip.tex
+\preamble
+
+Copyright (C) 1990,1995 Mike Piff, University of Sheffield, England
+
+You are not allowed to change this file.
+
+You are NOT ALLOWED to distribute this file alone. You are NOT
+ALLOWED to take money for the distribution or use of this
+file except for a nominal charge for copying etc.
+
+Please address any problems to:
+
+M.Piff@sheffield.ac.uk
+
+For updates, contact your nearest CTAN site.
+
+\endpreamble
+
+\keepsilent
+
+\Msg{*** Generating the package file ***}
+
+\generateFile{ams.sty}{f}{\from{ams.dtx}{ams}}
+
+\ifToplevel{%
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the file}
+\Msg{* ams.sty into a directory searched by TeX.}
+\Msg{* To produce the documentation, run the file ams.dtx through LaTeX.}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/prettyref/prettyref.dtx b/Master/texmf-dist/source/latex/prettyref/prettyref.dtx
new file mode 100644
index 00000000000..13f2648b17e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/prettyref/prettyref.dtx
@@ -0,0 +1,134 @@
+% \iffalse meta-comment
+%%
+%% prettyref v3.0
+%%
+%% Copyright 1995,1998. by Kevin Ruland kevin@rodin.wustl.edu
+%%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{doc}
+\CodelineNumbered
+\begin{document}
+ \DocInput{prettyref.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \fi
+%
+% \iffalse
+%<*style>
+% \fi
+%
+% \title{Improved reference formatting for \LaTeX2e}
+%
+% \author{Kevin S. Ruland}
+%
+% \maketitle
+%
+% There is a significant change to the newrefformat command in
+% version~3.0. Please see the new discussion of that command below.
+%
+% This package has been completely reimplemented (in version 2.0).
+% Please note the user level commands have changed syntax. This was done
+% because most of the packages providing hypertext/www functionality
+% (such as, |hyper|, |hyperref| and |latex2html|)
+% also modify the |\newlabel| structure. In order to make this package
+% compatable with those, I have decided not to change the |\newlabel|
+% structure, but have the refence type stored in the label name.
+%
+% This package provides additional functionality to \LaTeX2e label--reference
+% mechanism. It allows the author to ``preformat'' all types of labels.
+%
+% A long standing problem with \LaTeX\ |\ref| command is that it only
+% provides a raw number. The author is responsible for properly formatting
+% the number correctly. For example, in order to correctly format a reference
+% to an equation, the author must use |\textup{(\ref{eq:1})}|. Or similarly
+% for a figure, |Figure~(\ref{fig:2})|. This way the ``format'' of the
+% reference is hard coded into the paper. If the author decides to change
+% figure references to |Figure~\ref{fig:2}|, she must search and replace all
+% the strings in the tex source.
+%
+% AMS\LaTeX\ has partially addressed this problem by providing the package
+% |upref| and command |\eqref| in |amsmath|. This is a partial solution
+% for equation numbers and forces equation numbers in upright style.
+%
+% This package provides a more comprehensive solution by allowing the author
+% to define various formats for the labels. For example, to label a
+% table the author would use |\label{tab:1}|. To access the formatted
+% reference the author uses |\prettyref{tab:1}|. |\pageref{tab:1}|
+% and |\ref{tab:1}| work as usual.
+%
+% |\prettyref| is robust enough to be used within |\caption| and in
+% |theorem| optional arguements.
+%
+% Labels in the document must be of the form |format:name| where the
+% string |format| is used to determine the format. Do not use the character
+% |:| anywhere within the label except to seperate |format| from
+% |name|. |format:name| must be unique for it is used as the label.
+%
+% \begin{macrocode}
+\ProvidesPackage{prettyref}[1998/07/09 v3.0]
+% \end{macrocode}
+%
+% \DescribeMacro{\newrefformat}
+% The command |\newrefformat| defines formats for pretty references.
+%
+% Usage: |\newrefformat{NAME}{FORMAT}|
+%
+% The |NAME| arguement is the name of the refernece type.
+%
+% The |FORMAT| argument is interpreted as the replacement text for
+% an internal one-argument function.
+% The |#1| will be replaced with the label name.
+% \begin{macrocode}
+\def\newrefformat#1#2{%
+ \@namedef{pr@#1}##1{#2}}
+% \end{macrocode}
+%
+% These define the default formats for table, eq, lemma, thm, section, and
+% figure. They also demonstrate the useage of |\newrefformat|.
+% \begin{macrocode}
+\newrefformat{eq}{\textup{(\ref{#1})}}
+\newrefformat{lem}{Lemma \ref{#1}}
+\newrefformat{thm}{Theorem \ref{#1}}
+\newrefformat{cha}{Chapter \ref{#1}}
+\newrefformat{sec}{Section \ref{#1}}
+\newrefformat{tab}{Table \ref{#1} on page \pageref{#1}}
+\newrefformat{fig}{Figure \ref{#1} on page \pageref{#1}}
+% \end{macrocode}
+%
+% \DescribeMacro{\prettyref}
+% The character |:| is used as a seperator. It must be appended to
+% the label string to terminate the |name| portion.
+%
+% \begin{macrocode}
+\def\prettyref#1{\@prettyref#1:}
+% \end{macrocode}
+%
+% \DescribeMacro{\@prettyref}
+% The internal macro |\@prettyref| does all the work. It takes two
+% arguements delimited by |:|. The first arguement is the format name.
+% If the format has not been defined, a warning is issued and |\ref|
+% is used. Otherwise, the reference is formatted. |\@prettyref|
+% uses the \LaTeX\ macros |\ref| and |\pageref| to access the
+% |\newlabel| data structure. Hopefully this makes the package
+% robust enough to use with various other pacakges.
+%
+% \begin{macrocode}
+\def\@prettyref#1:#2:{%
+ \expandafter\ifx\csname pr@#1\endcsname\relax%
+ \PackageWarning{prettyref}{Reference format #1\space undefined}%
+ \ref{#1:#2}%
+ \else%
+ \csname pr@#1\endcsname{#1:#2}%
+ \fi%
+}
+% \end{macrocode}
+%
+% \endinput
+%
+\endinput
+%</style>
+%
diff --git a/Master/texmf-dist/source/latex/prettyref/prettyref.ins b/Master/texmf-dist/source/latex/prettyref/prettyref.ins
new file mode 100644
index 00000000000..e360235c2f5
--- /dev/null
+++ b/Master/texmf-dist/source/latex/prettyref/prettyref.ins
@@ -0,0 +1,10 @@
+\def\batchfile{prettyref.ins}
+\input docstrip.tex
+
+\keepsilent
+\preamble
+
+Copyright (c) 1995 Kevin Ruland
+
+\endpreamble
+\generateFile{prettyref.sty}{t}{\from{prettyref.dtx}{style}}
diff --git a/Master/texmf-dist/source/latex/pst-3d/pst-3d.dtx b/Master/texmf-dist/source/latex/pst-3d/pst-3d.dtx
new file mode 100644
index 00000000000..291524ae593
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-3d/pst-3d.dtx
@@ -0,0 +1,1608 @@
+% \iffalse meta-comment, etc.
+%%
+%% Package `pst-3d.dtx'
+%%
+%% Timothy Van Zandt <tvz@nwu.edu> (tvz)
+%% Herbert Voss <voss@pstricks.de> (hv)
+%%
+%% September 03, 2005
+%%
+%% This file is under the LaTeX Project Public License
+%% See CTAN archives in directory macros/latex/base/lppl.txt.
+%%
+%% DESCRIPTION:
+%% `pst-3d' is a PSTricks package for tilting and other pseudo-3D tricks
+%%
+% \fi
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{pst-3d.dtx}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp,fancyvrb}
+\usepackage{graphics,showexpl}
+\usepackage{amsmath,array}
+\usepackage{multido}
+\usepackage{pstricks,pst-node,pst-plot}
+\usepackage{pst-3d}
+\AtBeginDocument{
+% \OnlyDescription % comment out for implementation details
+ \EnableCrossrefs
+ \RecordChanges
+ \CodelineIndex}
+\AtEndDocument{
+ \PrintChanges
+ \PrintIndex}
+\hbadness=7000 % Over and under full box warnings
+\hfuzz=3pt
+\begin{document}
+ \DocInput{pst-3d.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v1.00}{2005/09/08}{%
+% using the extended pst-xkey instead of the old pst-key package;
+% creating a dtx file;
+% new \LaTeX\ wrapper file (hv)}
+% \changes{v0.90}{2001/02/16}{First public release. (tvz)}
+%
+% \DoNotIndex{\!,\",\#,\$,\%,\&,\',\(,\+,\*,\,,\-,\.,\/,\:,\;,\<,\=,\>,\?}
+% \DoNotIndex{\@,\@B,\@K,\@cTq,\@f,\@fPl,\@ifnextchar,\@nameuse,\@oVk}
+% \DoNotIndex{\[,\\,\],\^,\_,\ }
+% \DoNotIndex{\^,\\^,\\\^,$\^$,$\\^$,$\\^$}
+% \DoNotIndex{\0,\2,\4,\5,\6,\7,\8,}
+% \DoNotIndex{\A,\a}
+% \DoNotIndex{\B,\b,\Bc,\begin,\Bq,\Bqc}
+% \DoNotIndex{\C,\c,\catcode,\cJA,\CodelineIndex,\csname}
+% \DoNotIndex{\D,\def,\define@key,\Df,\divide,\DocInput,\documentclass,\pst@addfams}
+% \DoNotIndex{\eCN,\edef,\else,\eHd,\eMcj,\EnableCrossrefs,\end,\endcsname}
+% \DoNotIndex{\endCenterExample,\endExample,\endinput,\endpsclip}
+% \DoNotIndex{\PrintIndex,\PrintChanges,\ProvidesFile}
+% \DoNotIndex{\endpspicture,\endSideBySideExample,\Example}
+% \DoNotIndex{\F,\f,\FdUrr,\fi,\filedate,\fileversion,\FV@Environment}
+% \DoNotIndex{\FV@UseKeyValues,\FV@XRightMargin,\FVB@Example,\fvset}
+% \DoNotIndex{\G,\g,\GetFileInfo,\gr,\GradientLoaded,\gsFKrbK@o,\gsj,\gsOX}
+% \DoNotIndex{\hbadness,\hfuzz,\HLEmphasize,\HLMacro,\HLMacro@i}
+% \DoNotIndex{\HLReverse,\HLReverse@i,\hqcu,\HqY}
+% \DoNotIndex{\I,\i,\ifx,\input,\Ir,\IU}
+% \DoNotIndex{\j,\jl,\JT,\JVodH}
+% \DoNotIndex{\K,\k,\kfSlL}
+% \DoNotIndex{\L,\let}
+% \DoNotIndex{\message,\mHNa,\mIU}
+% \DoNotIndex{\N,\nB,\newcmykcolor,\newdimen,\newif,\nW}
+% \DoNotIndex{\O,\oCDJDo,\ocQhVI,\OnlyDescription,\oRKJ}
+% \DoNotIndex{\P,\p,\ProvidesPackage,\psframe,\pslinewidth,\psset}
+% \DoNotIndex{\PstAtCode,\PSTricksLoaded}
+% \DoNotIndex{\q,\Qr,\qssRXq,\qu,\qXjFQp,\qYL}
+% \DoNotIndex{\R,\r,\RecordChanges,\relax,\RlaYI,\rN,\Rp,\rp,\RPDXNn,\rput}
+% \DoNotIndex{\S,\scalebox,\SgY,\SideBySide@Example,\SideBySideExample}
+% \DoNotIndex{\SgY,\sk,\Sp,\space,\sZb}
+% \DoNotIndex{\T,\the,\tw@}
+% \DoNotIndex{\u,\UiSWGEf@,\uJi,\usepackage,\uVQdMM,\UYj}
+% \DoNotIndex{\VerbatimEnvironment,\VerbatimInput,\VrC@}
+% \DoNotIndex{\WhZ,\WjKCYb,\WNs}
+% \DoNotIndex{\XkN,\XW}
+% \DoNotIndex{\Z,\ZCM,\Ze}
+% \DoNotIndex{\addtocounter,\advance,\alph,\arabic,\AtBeginDocument,\AtEndDocument}
+% \DoNotIndex{\AtEndOfPackage,\begingroup,\bfseries,\bgroup,\box,\csname}
+% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\expandafter,\fi}
+% \DoNotIndex{\TeX,\z@,\p@,\@one,\xdef,\thr@@,\string,\sixt@@n,\reset,\or,\multiply,\repeat,\RequirePackage}
+% \DoNotIndex{\@cclvi,\@ne,\@ehpa,\@nil,\copy,\dp,\global,\hbox,\hss,\ht,\ifodd,\ifdim,\ifcase,\kern}
+% \DoNotIndex{\chardef,\loop,\leavevmode,\ifnum,\lower}
+% \setcounter{IndexColumns}{2}
+%
+% \let\pstIIIDFileVersion\fileversion
+% \let\pstIIIDFileDate\filedate
+% \newcommand{\PstIIIDPackage}{`\textsf{pst-3d}'}
+% \newcommand{\PstIIIDMacro}{\cs{Pst3d}}
+%
+% ^^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}}
+%
+% \makeatletter
+%
+% ^^A Utility macros
+%
+% ^^A Example macros - adapted from the `fvrb-ex' package
+% ^^A ---------------------------------------------------
+%
+% ^^A Take care that we use here the four /?_Z characters as escape
+% ^^A characters, so we can't use these characters in the examples!
+%
+% ^^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`\Z=12}]{\jobname.tmp}}
+%
+% \def\Below@Example#1{%
+% \VerbatimInput[gobble=0,commentchar=Z,commandchars=/?_,frame=single,
+% numbers=left,numbersep=3pt]{\jobname.tmp}
+% \catcode`\%=14\relax
+% \catcode`\Z=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`\Z=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=Z,commandchars=/?_,
+% frame=single,numbers=left,numbersep=3pt,
+% xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
+% \end{minipage}
+% \vskip 1mm}
+%
+% ^^A End of example macros from `fvrb-ex'
+%
+% ^^A Customizations of the "Verbatim" environment
+% \RecustomVerbatimEnvironment{Verbatim}{Verbatim}%
+% {gobble=4,frame=single,numbers=left,numbersep=3pt,commandchars=/?_}
+%
+% ^^A For the possible index and changes log
+% \setlength{\columnseprule}{0.6pt}
+%
+%
+% \def\PiCTeX{PiC\TeX}
+% \def\arc{\texttt{arc}}
+% \def\sign{\texttt{sign}}
+%
+% ^^A Beginning of the documentation itself
+%
+% \title{The \PstIIIDPackage{} package\\Tilting and other pseudo-3D tricks with PSTricks}
+% \author{Timothy Van Zandt\\
+% Herbert Vo\ss}
+% \date{Version \pstIIIDFileVersion\ \pstIIIDFileDate\ \\
+% {\small Documentation revised \today\ (hv)}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% \texttt{pst-3d} provides basic macros for shadows, tilting and
+% three dimensional representations of text or graphical objects.
+% \end{abstract}
+%
+% \clearpage
+% \tableofcontents
+%
+% \section{introduction}
+%
+% The base package \texttt{pstricks} already disposes of some macros with which three
+% dimensional effects can be obtained.
+% There are several packages though which support the creation of three
+% dimensional objects or functions. A compilation is shown in
+% table~\ref{tab:pst3d:pakete}. Here already several of the packages overlap, for
+% parallel developments are nothing unusual in the \TeX{} world. Although
+% \verb+pst-3d+ is one of the older packages, it shall be dealt with nevertheless,
+% for it also contains the preliminary stage of the 3D representations, that is
+% shadow creation and tilting.
+%
+% \begin{table}[htb]
+% \caption{Summary of all 3D packages}\label{tab:pst3d:pakete}
+% \centering
+% \begin{tabular}{ll}
+% \emph{package} & \emph{content}\\\hline
+% \texttt{pst-3d} & basic 3D operations\\
+% \texttt{pst-3dplot} & Three dimensional plots\\
+% \texttt{pst-fr3d} & Three dimensional framed Boxes\\
+% \texttt{pst-gr3d} & 3D grids\\
+% \texttt{pst-map3dII}& 3D Geographical Projection\\
+% \texttt{pst-ob3d} & Three dimensional basic objects\\
+% \texttt{pst-vue3d} & Three dimensional views\\
+% \end{tabular}
+% \end{table}
+%
+%
+% \section{Shadow}\label{sec:pst3d:schattenwurf}
+% \verb+pst-3d+ defines the macro \verb+\psshadow+ with the following syntax:
+% \begin{verbatim}
+% \psshadow[<parameters>]{<material>]
+% \end{verbatim}
+% As parameters the ones given in table~\ref{tab:pst-3d:schattenparameter} are
+% available next to all previously defined, if they have a meaning for the
+% material to be shadowed. This can be anything text-like, text, rules and
+% mathematical expressions in inline mode.
+%
+% \medskip
+% \begin{SideBySideExample}[xrightmargin=.35\linewidth]
+% \newgray{gray75}{.75}
+% \psset{Tshadowcolor=gray75}
+% \psshadow{\huge Shadow}\\[10pt]
+% \psshadow{\huge $f(x)=x^2$}\\[15pt]
+% \psshadow[Tshadowsize=2.5]{%
+% \rule{2cm}{10pt}}
+% \end{SideBySideExample}
+%
+% \subsection{Parameters}\label{subsec:pst3d:schattenparameter}
+% Table~\ref{tab:pst-3d:schattenparameter} shows a compilation of the used
+% parameters.
+%
+%
+%
+%
+% \begin{table}[htb]
+% \caption{Summary of all \texttt{shadow} parameters}\label{tab:pst-3d:schattenparameter}
+% \centering
+% \begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+% \textrm{\emph{name}} & \textrm{\emph{values}} & \textrm{\emph{default}}\\\hline
+% Tshadowangle & <angle> & 60\\
+% Tshadowcolor & <colour> & lightgray\\
+% Tshadowsize & <value> & 1
+% \end{tabular}
+% \end{table}
+%
+%
+% \subsubsection{\texttt{Tshadowangle}}\label{subsubsec:pst3d:tshadowangle}
+% \verb+Tshadowangle+ denotes the angle of the shadow,
+% referring to the perpendicular of the paper plane. The angle of $90$° therewith
+% corresponds to the text itself. Negative angles cause the shadow to arise
+% from the paper plane.
+
+% \medskip
+% \begin{SideBySideExample}[xrightmargin=.25\linewidth]
+% \newgray{gray75}{.75}
+% \psset{Tshadowcolor=gray75}
+% \psshadow{\huge shadow}\\[5pt]
+% \psshadow[Tshadowangle=30]{\huge shadow}\\[5pt]
+% \psshadow[Tshadowangle=70]{\huge shadow}\\[5pt]
+% \psshadow[Tshadowangle=-30]{\huge shadow}
+% \end{SideBySideExample}
+%
+% \medskip
+% \begin{itemize}
+% \item Angular values of $0$° and $180$° are not allowed.
+% \end{itemize}
+%
+%
+%
+% \subsubsection{\texttt{Tshadowcolor}}\label{subsubsec:pst3d:tshadowcolor}
+% \verb+Tshadowcolor+ deontes the shadow colour.
+%
+% \begin{SideBySideExample}[xrightmargin=.25\linewidth]
+% \psshadow{\huge shadow}\\[5pt]
+% \psshadow[Tshadowcolor=red]{\huge shadow}\\[5pt]
+% \psshadow[Tshadowcolor=green]{\huge shadow}\\[5pt]
+% \psshadow[Tshadowcolor=blue]{\huge shadow}
+% \end{SideBySideExample}
+%
+%
+% \subsubsection{\texttt{Tshadowsize}}\label{subsubsec:pst3d:tshadowsize}
+% \verb+Tshadowsize+ determines the size of the
+% shadow\index{shadow!size} as a scaling factor\index{scaling factor}.
+%
+% \begin{SideBySideExample}[xrightmargin=.25\linewidth]
+% \psshadow{\Huge shadow}\\[5pt]
+% \psshadow[Tshadowsize=0.5]{\Huge shadow}\\[10pt]
+% \psshadow[Tshadowsize=1.5]{\Huge shadow}\\[20pt]
+% \psshadow[Tshadowsize=2.5]{\Huge shadow}
+% \end{SideBySideExample}
+%
+%
+%
+%
+%
+% \section{Tilting}\label{sec:pst3d:kippen}
+% With the tilting of objects the
+% perspective views of three dimensional objects can be simulated. \verb+pst-3d+
+% defines two macros for this.
+%
+% \begin{verbatim}
+% \pstilt[<parameters>]{<angle>}{<material>}
+% \psTilt[<parameters>]{<angle>}{<material>}
+% \end{verbatim}
+%
+% Figure~\ref{fig:pst3d:demo} shows the difference between these two macros.
+% Principally everything can be given as argument to those macros and therewith
+% tilted. With vertical material, as distinguished formulae, eventually the
+% argument has to be put into a \verb+\parbox+ before (see
+% example),
+%
+% \begin{figure}[htb]
+% \centering
+% \bgroup
+% \begin{pspicture}(0,-0.2)(9,3)
+% \psline[linestyle=dashed](0,2)(9,2)
+% \psline{->}(9,0)
+% \def\Bar{\psframe*[linecolor=lightgray](0,0)(0.5,2)}
+% \rput(0.5,0){\Bar}
+% \psset{arrowscale=2,linewidth=0.1pt,tbarsize=2mm}
+% \psline{|<->|}(0.25,0)(0.25,2)\rput*{90}(0.25,1){\small 2cm}
+% \rput(2,0){\psTilt{30}{\Bar}}
+% \psarc{->}(2.2,0){2}{0}{26}\rput(4.5,0.5){30°}
+% \pnode(2,0.3){A}\pnode(5.3,2.25){B}
+% \ncline{|<->|}{A}{B}\ncput*[nrot=:U]{\small 4cm}
+% \rput(6,0){\pstilt{30}{\Bar}}
+% \psarc{->}(6.2,0){2}{0}{26}\rput(8.5,0.5){30°}
+% \pnode(6,0.3){A}\pnode(7.65,1.25){B}
+% \ncline{|<->|}{A}{B}\ncput*[nrot=:U]{\small 2cm}
+% \uput[90](0.5,2.5){\cs{Bar}}
+% \uput[90](3.75,2.5){\cs{psTilt\{30\}\{\textbackslash Bar\}}}
+% \uput[90](7.25,2.5){\cs{pstilt\{30\}\{\textbackslash Bar\}}}
+% \end{pspicture}
+% \egroup
+% \caption{Demonstration of the difference between \cs{pstilt} and \cs{psTilt}}\label{fig:pst3d:demo}
+% \end{figure}
+%
+% \medskip
+% \begin{itemize}
+% \item Angular values of $0$\textdegree\ and $180$\textdegree\ are not allowed.
+% \end{itemize}
+%
+% \subsection{\cs{pstilt}}\label{subsec:pst3d:pstilt}
+% \verb+\pstilt+ tilts objects that their original height appears
+% as new length of the tilted object, wherewith the object becomes smaller. The
+% hynotenuse of the triangle from nadir, height and perpendicular now corresponds
+% to the old height (see figure~\ref{fig:pst3d:demo}). At this the length is
+% calculated from the middle of the base side.
+%
+%
+% \medskip\noindent
+% \begin{SideBySideExample}[xrightmargin=.4\linewidth]
+% \def\Bar{\psframe(0,0)(0.25,2)}
+% \begin{pspicture}(5,2)
+% \multido{\nA=15+15}{11}{\rput(2.5,0){%
+% \pstilt{\nA}{\Bar}}}
+% \end{pspicture}
+% \end{SideBySideExample}
+%
+%
+%
+% \medskip\noindent
+% \begin{SideBySideExample}[xrightmargin=.4\linewidth]
+% \pstilt{60}{%
+% \begin{pspicture}(-0.5,-0.5)(2,2)
+% \psaxes[axesstyle=frame](2,2)
+% \end{pspicture}}
+% \end{SideBySideExample}
+%
+%
+% \medskip\noindent
+% \begin{SideBySideExample}[xrightmargin=.4\linewidth]
+% \newpsstyle{TCyan}{%
+% fillstyle=vlines,hatchcolor=cyan,
+% hatchwidth=0.1\pslinewidth,%
+% hatchsep=1.5\pslinewidth}
+% \begin{pspicture}(2,4)
+% \rput[lb](0,0){\pstilt{45}{%
+% \psframe[linestyle=dashed,%
+% fillstyle=solid,fillcolor=red](2,4)}}
+% \psframe[style=TCyan](0,0)(2,4)
+% \end{pspicture}
+% \end{SideBySideExample}
+%
+%
+% \medskip
+% With the package \verb+rotating+ macros to rotate text are
+% provided, to achieve slant table headings for example. It is more difficult when
+% they are provided with a frame. With \cs{pstilt} or \cs{psTilt} this is no
+% problem. The program listing given below only shows the application of
+% \cs{pstilt} for the macro only has to be replaced by \cs{psTilt} to obtain the
+% other example.
+
+% \begin{SideBySideExample}[xrightmargin=.3\linewidth]
+% \begin{tabular}{l}
+% \pstilt{60}{%
+% \begin{tabular}{|p{1em}|p{1em}|p{1em}|}\hline
+% \psrotateleft{column 1\ }
+% & \psrotateleft{column 2\ }
+% & \psrotateleft{column 3\ }
+% \end{tabular}}\\
+% \begin{tabular}{|p{1em}|p{1em}|p{1em}|}\hline
+% 1 & 2 & 3 \\\hline
+% 4 & 5 & 6 \\\hline
+% \end{tabular}
+% \end{tabular}
+% \end{SideBySideExample}
+%
+%
+% \subsection{\cs{psTilt}}\label{subsec:pst3d:psTilt}
+% \verb+\psTilt+ tilts objects that their original height is
+% preserved, so that the object could become infinitely long in theory (see
+% figure~\ref{fig:pst3d:demo}).
+%
+%
+% \medskip\noindent
+% \begin{CenterExample}
+% \begin{pspicture}(5,2)
+% \def\Bar{\psframe(0,0)(0.25,2)}
+% \multido{\nA=15+15}{11}{\rput(2.5,0){%
+% \psTilt{\nA}{\Bar}}}
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+%
+% \medskip\noindent
+% \begin{SideBySideExample}[xrightmargin=.4\linewidth]
+% \psTilt{60}{%
+% \begin{pspicture}(-0.5,-0.5)(2,2)
+% \psaxes[axesstyle=frame](2,2)
+% \end{pspicture}}
+% \end{SideBySideExample}
+%
+%
+% \medskip\noindent
+% \begin{SideBySideExample}[xrightmargin=.475\linewidth]
+% \newpsstyle{TCyan}{%
+% fillstyle=vlines,hatchcolor=cyan,
+% hatchwidth=0.1\pslinewidth,%
+% hatchsep=1.5\pslinewidth}
+% \begin{pspicture}(2,4)
+% \rput[lb](0,0){\psTilt{45}{%
+% \psframe[linestyle=dashed,%
+% fillstyle=solid,%
+% fillcolor=red](2,4)}}
+% \psframe[style=TCyan](0,0)(2,4)
+% \end{pspicture}
+% \end{SideBySideExample}
+%
+%
+% \section[Three dimensional representations]{%
+% Three dimensional representations\protect\footnote{Some of the examples were created by Manuel Luque.}}\label{sec:pst3d:3d}
+%
+%
+% \verb+pst-3d+ only supports parallel projections, so that geometrical objects
+% such as spheres or cylinders can only be displayed restricted. Although
+% \verb+pst-3d+ principally only defines one single macro for the 3D
+% projection, the package is very efficient in its
+% application and is also used as a base for other packages.\cite{pst-3dplot}\cite{pst-vue3d}
+%
+% \subsection{\cs{ThreeDput}}\label{subsec:pst3d:threedput}
+% \verb+pst-3d+ only defines this single macro, which can be
+% used to arbitrarily display line or area shaped objects in the three dimensional
+% space in the end though.
+%
+% \begin{verbatim}
+% \ThreeDput[<parameters>]{<material>}
+% \ThreeDput[<parameters>](<x,y,z>){<material>}
+% \end{verbatim}
+%
+% Without a specification of coordinates, $(0,0,0)$ is taken as origin of
+% ordinates as a rule. As ``material''{} anything is understood that can be put
+% into a box. If it is vertical material in the \TeX{} sense, it has to be put in
+% a \verb+\parbox+ or \verb+minipage+ before.
+%
+% To simplify the specified source code, the macro \verb+\IIIDKOSystem+ is used in
+% the following, which draws the coordinate axes with the grid and is not
+% specified in the following anymore.
+%
+%
+% \makeatletter
+% \newgray{gray75}{0.75}\newgray{gray80}{0.80}newgray{gray85}{0.85}
+% \newgray{gray90}{0.90}\newgray{gray95}{0.95}
+% \def\xyPlain#1{%
+% \ThreeDput[normal=0 0 1](0,0,0){%
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)%
+% \psline{->}(0,0)(0,#1)\psline{->}(0,0)(#1,0)%
+% \ifdim\psk@gridlabels pt>\z@
+% \uput[180]{0.2}(0,#1){$y$}\uput[-90]{0.2}(#1,0){$x$}\fi}}
+% \def\xzPlain#1{%
+% \ThreeDput[normal=0 -1 0](0,0,0){%
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)%
+% \psline{->}(0,0)(0,5) \psline{->}(0,0)(#1,0)%
+% \ifdim\psk@gridlabels pt>\z@%
+% \uput[180]{0.2}(0,#1){$z$}\uput[-90]{0.2}(#1,0){$x$}%
+% \fi}}
+% \def\yzPlain#1{%
+% \ThreeDput[normal=1 0 0](0,0,0){%
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)%
+% \psline{->}(0,0)(0,#1) \psline{->}(0,0)(#1,0)%
+% \ifdim\psk@gridlabels pt>\z@%
+% \uput[180]{0.2}(0,#1){$z$}\uput[-90]{0.2}(#1,0){$y$}%
+% \fi}}
+% \def\IIIDKOSystem{\@ifnextchar[{\IIIDKOSystem@i}{\IIIDKOSystem@i[]}}
+% \def\IIIDKOSystem@i[#1]#2{%
+% \psset{#1}%
+% \xyPlain{#2}\xzPlain{#2}\yzPlain{#2}}
+% \makeatother
+%
+% \medskip\noindent
+% \begin{CenterExample}
+% \makeatletter
+% \def\xyPlain#1{%
+% \ThreeDput[normal=0 0 1](0,0,0){% xy-plane
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)
+% \psline{->}(0,0)(0,#1) \psline{->}(0,0)(#1,0)
+% \ifdim\psk@gridlabels pt>\z@
+% \uput[180]{0.2}(0,#1){$y$}\uput[-90]{0.2}(#1,0){$x$}\fi }}
+% \def\xzPlain#1{%
+% \ThreeDput[normal=0 -1 0](0,0,0){% xz-plane
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)
+% \psline{->}(0,0)(0,5) \psline{->}(0,0)(#1,0)
+% \ifdim\psk@gridlabels pt>\z@
+% \uput[180]{0.2}(0,#1){$z$}\uput[-90]{0.2}(#1,0){$x$}%
+% \fi }}
+% \def\yzPlain#1{%
+% \ThreeDput[normal=1 0 0](0,0,0){% yz-plane
+% \psgrid[subgriddiv=0,gridcolor=lightgray](0,0)(#1,#1)
+% \psline{->}(0,0)(0,#1) \psline{->}(0,0)(#1,0)
+% \ifdim\psk@gridlabels pt>\z@
+% \uput[180]{0.2}(0,#1){$z$}\uput[-90]{0.2}(#1,0){$y$}%
+% \fi }}
+% \def\IIIDKOSystem{\@ifnextchar[{\IIIDKOSystem@i}{\IIIDKOSystem@i[]}}
+% \def\IIIDKOSystem@i[#1]#2{%
+% \psset{#1}%
+% \xyPlain{#2}\xzPlain{#2}\yzPlain{#2}}
+% \makeatother
+% \newgray{gray75}{0.75}
+% \newgray{gray80}{0.8}
+% \newgray{gray85}{0.85}
+% \newgray{gray95}{0.95}
+% \begin{pspicture}(0,-1.25)(5,6)
+% \psset{viewpoint=1 -1 0.75}
+% \IIIDKOSystem{5}
+% \ThreeDput{\psframe*[linecolor=gray80](3,3)}
+% \ThreeDput(1.5,1.5,0){\Huge below}
+% \ThreeDput(0,0,1.5){\psframe*[linecolor=gray75](3,3)}
+% \ThreeDput(1.5,1.5,1.5){\Huge center}
+% \ThreeDput(0,0,3){\psframe*[linecolor=gray85](3,3)}
+% \ThreeDput(1.5,1.5,3){\Huge above}
+% \xzPlain{5}
+% \ThreeDput(4,4,0){\psframe*[linecolor=gray95](-1,-1)(1,1)}
+% \ThreeDput(4,4,0){\psdot[dotscale=3]}
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+% The coordinates of \verb+ThreeDput+ refer to the centre of the object, which
+% does not necessarily need to be the geometrical centre.
+% \begin{verbatim}
+% \psframe(2,2)% centre bottom left (0,0)
+% \psframe(-1,-1(1,1)% centre in the middle (0,0)
+% arbitrary text% centre in the middle of the base line
+% \end{verbatim}
+%
+% In the above example the smaller square with its centre $(0,0)$ has been set
+% exactly to the coordinated $(4,4,0)$.
+% The macro \verb+ThreeDput+ can be manifoldly applied, which is performed
+% especially by the package \verb+pst-vue3d+\cite{pst-vue3d}. By
+% specifying the normal vector $\vec{n}$ and a point $P(x,y,z)$ of the stright
+% line and/or the plane the posture in space can be determined definitely. Areas
+% can be provided with different levels of brightness to increase the spatial
+% impression.
+%
+%
+%
+% \medskip\noindent
+% \begin{CenterExample}
+% \newgray{gray75}{0.75}\newgray{gray85}{0.85}\newgray{gray95}{0.95}
+% \begin{pspicture}(-4.5,-3.5)(3,4.75)
+% \psset{viewpoint=1 1.5 1}
+% \IIIDKOSystem[gridlabels=0pt,gridcolor=lightgray,subgriddiv=0]{5}%
+% \ThreeDput[normal=0 0 1]{% xy-plane
+% \psline[linewidth=3pt,linecolor=blue]{->}(4,4)(4,5.5)%
+% \uput[90](4,5.5){\color{blue}$\vec{n}-{A}$}}%
+% \ThreeDput[normal=0 -1 0]{% xz-plane
+% \psline[linewidth=3pt,linecolor=green]{->}(4,0)(5.5,0)%
+% \uput[90](5.5,0){\psscalebox{-1 1}{%
+% \textcolor{green}{$\vec{n}-B$}}}}%
+% \ThreeDput[normal=1 0 0]{% yz-plane
+% \psline[linewidth=3pt,linecolor=red]{->}(0,4)(0,5.5)%
+% \uput[0](0,5.5){$\vec{n}-{top}$}}% cube and axes
+% \ThreeDput[normal=0 0 1](0,0,4){%
+% \psframe*[linecolor=gray75](4,4)\rput(2,2){\Huge\textbf{TOP}}}%
+% \ThreeDput[normal=0 1 0](4,4,0){%
+% \psframe*[linecolor=gray95](4,4)\rput(2,2){\Huge\textbf{side A}}}%
+% \ThreeDput[normal=1 0 0](4,0,0){%
+% \psframe*[linecolor=gray85](4,4)\rput(2,2){\Huge\textbf{side B}}}%
+% \ThreeDput[normal=0 0 1](0,0,4){%
+% \psline(4,0)\uput[90](3,0){$X-top$}\psline(0,4)\uput[0](0,3){$Y-top$}}%
+% \ThreeDput[normal=0 1 0](4,4,0){%
+% \psline(4,0)\uput[90](3,0){$X-A$}\psline(0,4)\uput[0](0,3){$Y-A$}}%
+% \ThreeDput[normal=1 0 0](4,0,0){%
+% \psline(4,0)\uput[90](3,0){$X-B$}\psline(0,4)\uput[0](0,3){$Y-B$}}%
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+% \subsection{3D parameters}\label{subsec:pst3d:3dParameter}
+% Table~\ref{tab:pst-3d:3dparameter} shows a compilation of
+% the parameters which can be used to influence 3D representations.
+%
+% \begin{table}[htb]
+% \caption{Summary of all 3D parameters}\label{tab:pst-3d:3dparameter}
+% \begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
+% \textrm{name} & \textrm{values} & \textrm{default}\\\hline
+% viewpoint & <valuex valuey valuez> & 1 -1 1\\
+% viewangle & <angle> & 0\\
+% normal & <valuex valuey valuez> & 0 0 1\\
+% embedangle & <angle> & 0
+% \end{tabular}
+% \end{table}
+%
+% \subsubsection{\texttt{viewpoint}}\label{subsubsec:pst3d:viewpoint}
+% The viewing direction to the 3D object influences the
+% representation essentially. With \verb+viewpoint+ the $(x,y,z)$ coordinates
+% which denote the vector of the viewing direction are specified. Because of the
+% parallel projection the length of this vector is unimportant, so that
+% \verb+(10.5 1.5)+ and \verb+(2 1 3)+ yield the same representations.
+% Figure~\ref{fig:pst3d:viewpoint} shows who somebody would regard this
+% representation, whereat the representation itself is of course regarded from
+% another point in this case, otherwise one had to look directly onto the vector.
+%
+%
+% \SpecialCoor
+% \def\oeil{%
+% \pscurve(1;160)(0.8;180)(1;200)
+% \pscustom{\gsave\psarc(0,0){1}{165}{195}
+% \pscurve(1;195)(0.85;180)(1;165)
+% \fill[fillstyle=solid,fillcolor=blue]\grestore}
+% \pscurve[linewidth=.4pt](1;195)(0.85;180)(1;165)
+% {\psset{linewidth=2pt}
+% \psarc(0,1){1}{180}{270}
+% \psarc(0,-1){1}{90}{180}}
+% \psarc(0,0){1}{150}{210}
+% \psset{linewidth=4pt,linecolor=gray}
+% \pscurve(-.5,3.5)(-1,3)(-1.2,2.5)(-1.3,2)(-1.4,1)(-1.35,0.5)(-1.2,-.2)(-1.35,-.5)
+% (-1.4,-1)(-1.5,-1.5)(-1.8,-2)(-1.8,-2.3)(-1.65,-2.5)(-1.35,-2.55)(-.95,-2.8)
+% (-.95,-3.35)(-1,-3.65)(-.8,-4)(-.4,-4.1)
+% \pscurve(-.8,-4)(-.8,-4.2)(-.5,-4.5)(-.4,-5)(-.25,-5.5)(0,-5.8)(.5,-6)}
+%
+%
+% \begin{figure}[htb]
+% \centering
+% \begin{pspicture}(-5,-1)(5,6)
+% \psset{viewpoint=3 5 2}
+% \psset{unit=2}
+% \ThreeDput[normal=0 0 1](0,0,0){%
+% \psline{->}(0,0)(2,0)
+% \uput[90](2,0){$x$}
+% \qdisk(1,0.5){2pt}
+% \psline(1,0)(1,0.5)\psline(1,0.5)(0,0.5)
+% \psline[linestyle=dotted](0,0)(1,0.5)
+% \psset{fillstyle=solid,fillcolor=lightgray,linestyle=none}
+% \psframe(1,0)(1.15,.15)
+% \psframe(0,.5)(.15,.65)}
+% \ThreeDput[normal=1 0 0](0,0,0){%
+% \psline{->}(0,0)(2,0)
+% \uput[90](2,0){$y$}
+% \psline{->}(0,0)(0,2)
+% \uput[180](0,2){$z$}
+% \uput[90](0.5,0){0.5}
+% \uput[180](0,1.5){1.5}
+% \uput[135](0,0){0}
+% \rput(1.2,1.5){\large 3D representations}}
+% \ThreeDput[normal=0 1 0](0,0,0){%
+% \uput[90](-2,0){$x$}
+% \uput[90](-1,0){1}
+% \rput(-1.5,1){\texttt{pst-3d}}}
+% \ThreeDput[normal=.5 -1 0](0,0,0){%
+% \psframe[linestyle=none,fillstyle=hlines,hatchwidth=0.1pt,
+% hatchsep=2pt,hatchcolor=gray90](0,0)(1.118,1.5)
+% \psline[linewidth=3pt,linecolor=red,arrowinset=0]{->}(0,0)(1.118,1.5)
+% \psline[linestyle=dashed](0,0)(2.236,3)
+% \psline(1.118,0)(1.118,1.5)
+% \psline(1.118,1.5)(0,1.5)
+% \rput{53.3}(2.5348,3.4009){\psscalebox{0.2}{\oeil}}}
+% \end{pspicture}
+% \caption{Definition of the \texttt{viewpoints}}\label{fig:pst3d:viewpoint}
+% \end{figure}
+%
+%
+% For figure~\ref{fig:pst3d:viewpoint} a viewpoint of \verb+viewpoint=3 5 2+ was
+% defined. If one desires to regard it for instance from the $y$ axis from a
+% larger height, \verb+viewpoint=0 1 3+ could be chosen. The viewer has moved one
+% unit in $y$ direction and four units in $z$ direction from the centre (origin)
+% and regards everything from there.
+%
+%
+% \medskip
+% \begin{itemize}
+% \item The \verb+viewpoint+ principally \textbf{has} to be defined with
+% values not equal to zero, for this would lead to a division by zero.
+% Specifications of $0.001$ for a coordinate are already sufficing to
+% escape the division by zero and blind out the coordinate.
+% \end{itemize}
+%
+% A good value for the viewpoint would be \verb+viewpoint=1 1 0.5+ for instance,
+% which corresponds to a horizontal rotation by 45° and a vertical by ca. 20°.
+% Another meaningful point is also \verb+viewpoint=1.5 1 0.5+, which now
+% corresponds to a horizontal rotation by 33° and the same vertical rotation. Both
+% can be seen in the examples below.
+%
+% \medskip
+% \begin{CenterExample}
+% \begin{pspicture}(-3,-2.5)(-3,4)
+% \psset{unit=0.75}
+% \psset{viewpoint=1 1 0.5}
+% \IIIDKOSystem{5}
+% \end{pspicture}\hfill
+% \begin{pspicture}(-3,-2.5)(2.2,4)
+% \psset{unit=0.75}
+% \psset{viewpoint=1 1.5 0.5}
+% \psset{gridlabels=6pt}
+% \IIIDKOSystem{5}
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+% \subsubsection{\texttt{viewangle}}\label{subsubsec:pst3d:viewangle}
+% Additional to the \verb+viewpoint+ option one can rotate the object by another
+% option called \verb+viewangle+. This could also be done by the macro \verb+\rotatebox+,
+% but \verb+viewangle+ has some advantages .
+%
+%
+% \bigskip\noindent
+% \begin{CenterExample}
+% \begin{pspicture}(-1,-2.5)(4,4)
+% \psset{unit=0.7,viewpoint=1 1 0.5,viewangle=20}
+% \IIIDKOSystem{5}
+% \ThreeDput(0,0,0){\psframe*[linecolor=gray80](4,4)}
+% \ThreeDput(2,2,0){\Huge Unten}
+% \end{pspicture}
+% \begin{pspicture}(-3,-2.5)(1,4)
+% \psset{unit=0.7,viewpoint=1 1.5 0.5,viewangle=-30}
+% \IIIDKOSystem{5}
+% \ThreeDput(0,0,0){\psframe*[linecolor=gray80](4,4)}
+% \ThreeDput(2,2,0){\Huge Unten}
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+% \subsubsection{\texttt{normal}}\label{subsubsec:pst3d:normal}
+% \verb+normal+ denotes the direction of the normal
+% vector which is perpendicular to a corresponding area.
+% Therewith the posture of an object in three dimensional space is definitely
+% determined by the normal vector.
+%
+% \medskip\noindent
+% \begin{CenterExample}
+% \newgray{gray75}{0.75}\newgray{gray85}{0.85}\newgray{gray95}{0.95}
+% \begin{pspicture}(-3.5,-2.5)(-3,5)
+% \psset{viewpoint=1 1.5 0.5}
+% \IIIDKOSystem{5}
+% \ThreeDput(0,0,0){\psframe*[linecolor=gray80](4,4)}
+% \ThreeDput(2,2,0){\huge\psrotatedown{xy-plane}}
+% \ThreeDput[normal=0 -1 0](0,0,0){\psframe*[linecolor=gray85](4,4)}
+% \ThreeDput[normal=0 1 0](2,0,2){\huge xz-plane}
+% \ThreeDput[normal=1 0 0](0,0,0){\psframe*[linecolor=gray90](4,4)}
+% \ThreeDput[normal=1 0 0](0,2,2){\huge yz-plane}
+% \ThreeDput[normal=0 0 1](0,0,0){% xy-plane
+% \psline{->}(0,0)(0,5)\psline{->}(0,0)(5,0)}
+% \ThreeDput[normal=0 1 0](0,0,0){\psline{->}(0,0)(0,5)}
+% \end{pspicture}
+% \end{CenterExample}
+%
+%
+% Without a assignment through the normal vector the above example could not have
+% been created that easily. Let us step through the code for a better
+% understanding.
+%
+% \begin{description}
+% \item[\cs{psset\{viewpoint=1 1.5 0.5\}}:] the
+% \verb+viewpoint+ is set to the point $P(1,1.5,0.5)$.
+% \item[\cs{IIIDKOSystem\{5\}}:] first the coordinate system with the grid is
+% drawn, so that axes and grid remain visible on the areas, which makes a
+% better optical allocation possible.
+% \item[\cs{ThreeDput(0,0,0)\{\textbackslash psframe*[linecolor=gray80](4,4)\}}:]
+% puts a square with a side length of four into the origin of ordinates with
+% the lower left edge. Since no normal vector is specified here, the default
+% value $\vec{n}=(0,0,1)$ is taken, wherewith the area is positioned in the
+% first quadrant of the $xy$ plane.
+% \item[\cs{ThreeDput(2,2,0)\{\textbackslash huge\textbackslash psrotatedown\{xy-plane\}\}}:]
+% puts the text rotated by $180$° centric to the point $(2,2,0)$ in the
+% \verb+xy-plane+.
+% \item[\cs{ThreeDput[normal=0 -1 0](0,0,0)\{\textbackslash psframe*[linecolor=gray85](4,4)\}}:]
+% puts a square with a side length of four in the origin of ordinates with the
+% lower left edge. Since the normal vector is the ``negative''{} $y$ axis, the
+% square is positioned in the first quadrant of the $xz$ plane. With
+% \verb+normal=0 1 0+ it would have been the second quadrant.
+% \item[\cs{ThreeDput[normal=0 1 0](2,0,2)\{\textbackslash huge xz-plane\}}:]
+% puts the text in the \verb+xy-plane+ centric to the point $(2,0,2)$. Because
+% the $xz$ plane is regarded from the back from the viewpoint, the normal
+% vector of the area has to be reversed, otherwise the text would be read from
+% the ``back''{}.
+% \item[\cs{ThreeDput[normal=1 0 0](0,0,0)\{\textbackslash psframe*[linecolor=gray90](4,4)\}}:]
+% puts a square with a side length of four in the origin of ordinates with the
+% lower left edge. The unit vector is the ``positive''{} $x$ axis, therefore
+% the square is positioned in the first quadrant of the $yz$ plane.
+% \item[\cs{ThreeDput[normal=1 0 0](0,2,2)\{\textbackslash huge yz-plane\}}:]
+% puts the text in the \verb+yz-plane+ centric to the point $(0,2,2)$. Since
+% the text is written at the ``positive''{} side of the area, the normal
+% vector stays the same.
+% \item[\cs{ThreeDput[normal=0 0 1](0,0,0)}:] the coordinate axes have been
+% overwritten by the three areas and are redrawn now, first the $xy$ axes.
+% \item[\cs{ThreeDput[normal=0 1 0](0,0,0)}:] and now the $z$ axis is drawn.
+% \end{description}
+%
+% \subsubsection{\texttt{embedangle}}\label{subsubsec:pst3d:embedangle}
+% With \verb+viewangle+ a rotation perpendicular to the plane
+% of the viewer could be made. With \verb+embedangle+ a rotation perpendicular to
+% the normal vector can be made. The counting of the angles is made in the
+% mathematical sense, counterclockwise.
+%
+% \medskip
+% \begin{CenterExample}
+% \newgray{gray75}{0.75}\newgray{gray85}{0.85}\newgray{gray95}{0.95}
+% \def\tBlack#1#2{%
+% \psframe[style=#2](2,2)
+% \rput(1,1){\textcolor{#1}{\textbf{PSTricks}}}}
+% \newpsstyle{SolidYellow}{fillstyle=solid,fillcolor=yellow}
+% \newpsstyle{TransparencyRed}{fillstyle=vlines,hatchcolor=red,
+% hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth}
+% \newpsstyle{TransparencyBlue}{fillstyle=vlines,hatchcolor=gray75,%
+% hatchwidth=0.1\pslinewidth,hatchsep=1\pslinewidth}
+% \begin{pspicture}(-1.2,-1.75)(4.8,3.7)
+% \ThreeDput{\psgrid[subgriddiv=0](-2,0)(4,3)}
+% \ThreeDput(-1,0,0){\tBlack{black}{SolidYellow}}
+% \ThreeDput(2,0,0){\tBlack{black}{SolidYellow}}
+% \ThreeDput[embedangle=50](-1,0,0){\tBlack{gray}{TransparencyRed}}
+% \ThreeDput[embedangle=50](2,0,0){\tBlack{gray}{TransparencyBlue}}
+% \ThreeDput[normal=0 1 0](-1,0,0){\psline[linewidth=0.1,linecolor=red](0,4)}
+% \ThreeDput[normal=0 1 0](2,0,0){\psline[linewidth=0.1,linecolor=blue](0,4)}
+% \end{pspicture}
+% \psset{viewpoint=1 1 100}
+% \begin{pspicture}(-2.5,-4.5)(2.8,1.7)
+% \ThreeDput{\psgrid[subgriddiv=0](-2,0)(4,3)}
+% \ThreeDput(-1,0,0){\tBlack{black}{SolidYellow}}
+% \ThreeDput(2,0,0){\tBlack{black}{SolidYellow}}
+% \ThreeDput[embedangle=50](-1,0,0){\tBlack{gray}{TransparencyRed}}
+% \ThreeDput[embedangle=50](2,0,0){\tBlack{gray}{TransparencyBlue}}
+% \ThreeDput[normal=0 1 0](-1,0,0){\psline[linewidth=0.1,linecolor=red](0,4)}
+% \ThreeDput[normal=0 1 0](2,0,0){\psline[linewidth=0.1,linecolor=blue](0,4)}
+% \end{pspicture}
+% \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.
+%
+%
+% \section{\PstIIIDPackage{} \LaTeX{} wrapper}
+%
+% \begin{macrocode}
+%<*latex-wrapper>
+%%
+\RequirePackage{pstricks}
+\ProvidesPackage{pst-3d}[2005/09/02 package wrapper for
+ pst-3d.tex (hv)]
+\input{pst-3d.tex}
+\ProvidesFile{pst-3d.tex}
+ [\filedate\space v\fileversion\space `PST-3d' (tvz)]
+%</latex-wrapper>
+% \end{macrocode}
+%
+% \section{\PstIIIDPackage{} code}
+%
+%<*pst-3d>
+%
+% \verb+pst-3d+ Require the basic \verb+pstricks+ package and for the key value
+% operations the \verb+pst-xkey+ package.
+%
+% \begin{macrocode}
+\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
+\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi % (hv 2005-09-03)
+% \end{macrocode}
+%
+% Catcodes changes.
+%
+% \begin{macrocode}
+\edef\PstAtCode{\the\catcode`\@}
+\catcode`\@=11\relax
+% \end{macrocode}
+%
+% Add the key-family name to the xkeyval package
+%
+% \begin{macrocode}
+\pst@addfams{pst-3d}
+% \end{macrocode}
+%
+\def\fileversion{1.00}
+\def\filedate{2005/09/03}
+\message{`PST-3d' v\fileversion, \filedate\space (tvz)}
+%
+% Mark the package as loaded
+%
+% \begin{macrocode}
+\csname PSTthreeDLoaded\endcsname
+\let\PSTthreeDLoaded\endinput
+% \end{macrocode}
+%
+% \subsection{Basic 3D transformations}
+%
+% \begin{macro}{\tx@SetMatrixThreeD}
+% Viewpoint for 3D coordinates is given by three angles: $\alpha$, $\beta$ and
+% $\gamma$. $\alpha$ and $\beta$ determine the direction from which one is
+% looking. $\gamma$ then determines the orientation of the observing.
+% When $\alpha$, $\beta$ and $\gamma$ are all zero, the observer is looking
+% from the negative part of the $y$-axis, and sees the $xz$-plane the way in
+% 2D one sees the $xy$ plan. Hence, to convert the 3D coordinates to their 2D
+% project, $\langle x, y, z\rangle$ map to $\langle x, z\rangle$.
+% When the orientation is different, we rotate the coordinates, and then
+% perform the same projection.
+% We move up to latitude $\beta$, over to longitude $\alpha$, and then rotate
+% by $\gamma$. This means that we first rotate around $y$-axis by $\gamma$,
+% then around $x$-axis by $\beta$, and the around $z$-axis by $\alpha$.
+%
+% Here are the matrices:
+% \begin{eqnarray*}
+% R_z(\alpha) & = & \left[
+% \begin{array}{ccc}
+% \cos \alpha & -\sin \alpha & 0 \\
+% \sin \alpha & cos \alpha & 0 \\
+% 0 & 0 & 1
+% \end{array} \right] \\
+% R_x(\beta) & = & \left[
+% \begin{array}{ccc}
+% 1 & 0 & 0 \\
+% 0 & \cos \beta & \sin \beta \\
+% 0 & -\sin \beta & \cos \beta
+% \end{array} \right] \\
+% R_y(\gamma) & = & \left[
+% \begin{array}{ccc}
+% \cos \gamma & 0 & -\sin \gamma \\
+% 0 & 1 & 0 \\
+% \sin \gamma & 0 & \cos \gamma
+% \end{array} \right]
+% \end{eqnarray*}
+%
+% The rotation of a coordinate is then performed by the matrix $R_z(\alpha)
+% R_x(\beta) R_y(\gamma)$. The first and third columns of the matrix are the
+% basis vectors of the plan upon which the 3D coordinates are project (the old
+% basis vectors were $\langle 1, 0, 0\rangle$ and $\langle 0, 0, 1\rangle$; rotating these
+% gives the first and third columns of the matrix).
+%
+% These new base vectors are:
+% \begin{eqnarray*}
+% \tilde{x} & = & \left[
+% \begin{array}{c}
+% \cos\alpha \cos\gamma - \sin\beta \sin\alpha \sin\gamma \\
+% \sin\alpha \cos\gamma + \sin\beta \cos\alpha \sin\gamma \\
+% \cos\beta \sin\gamma
+% \end{array} \right] \\
+% \tilde{z} & = & \left[
+% \begin{array}{c}
+% -\cos\alpha \sin\gamma - \sin\beta \sin\alpha \cos\gamma \\
+% -\sin\alpha \sin\gamma + \sin\beta \cos\alpha \cos\gamma \\
+% \cos\beta \cos\gamma
+% \end{array} \right]
+% \end{eqnarray*}
+%
+% Rather than specifying the angles $\alpha$ and $\beta$, the user gives a
+% vector indicating where the viewpoint is. This new viewpoint is the rotation
+% o the old viewpoint. The old viewpoint is $\langle 0, -1, 0\rangle$, and so the new
+% viewpoint is
+% \[
+% R_z(\alpha) R_x(\beta) \left[ \begin{array}{c} 0\\-1\\0 \end{array} \right]
+% \, = \,
+% \left[ \begin{array}{c}
+% \cos\beta \sin\alpha \\
+% -\cos\beta \cos\alpha \\
+% \sin\beta
+% \end{array} \right]
+% \, = \,
+% \left[ \begin{array}{c} v_1 \\ v_2 \\ v_3 \end{array} \right]
+% \]
+% Therefore,
+% \begin{eqnarray*}
+% \alpha & = & \arc\tan (v_1 / -v_2) \\
+% \beta & = & \arc\tan (v_3 \sin\alpha / v_1)
+% \end{eqnarray*}
+% Unless $p_1=p_2=0$, in which case $\alpha=0$ and $\beta=\sign(p_3)90$, or
+% $p_1=p_3=0$, in which case $\beta=0$.
+%
+% The syntax of \verb+SetMatrixThreeD+ is
+% \[
+% v_1\ v_2\ v_3\ \gamma\ \mathrm{SetMatrixThreeD}
+% \]
+% \verb+SetMatrixThreeD+ first computes
+% \[
+% \begin{array}{ll}
+% a=\sin\alpha & b=\cos\alpha\\
+% c=\sin\beta & d=\cos\beta\\
+% e=\sin\gamma & f=\cos\gamma
+% \end{array}
+% \]
+% and then sets \verb+Matrix3D+ to \verb+[+$\tilde{x}$ $\tilde{z}$\verb+]+.
+%
+% \begin{macrocode}
+\pst@def{SetMatrixThreeD}<%
+ dup sin /e ED cos /f ED
+ /p3 ED /p2 ED /p1 ED
+ p1 0 eq
+ { /a 0 def /b p2 0 le { 1 } { -1 } ifelse def
+ p3 p2 abs
+ }
+ { p2 0 eq
+ { /a p1 0 lt { -1 } { 1 } ifelse def /b 0 def
+ p3 p1 abs
+ }
+ { p1 dup mul p2 dup mul add sqrt dup
+ p1 exch div /a ED
+ p2 exch div neg /b ED
+ p3 p1 a div
+ }
+ ifelse
+ }
+ ifelse
+ atan dup sin /c ED cos /d ED
+ /Matrix3D
+ [
+ b f mul c a mul e mul sub
+ a f mul c b mul e mul add
+ d e mul
+ b e mul neg c a mul f mul sub
+ a e mul neg c b mul f mul add
+ d f mul
+ ] def>
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tx@ProjThreeD}
+% The syntax of the macro \verb+tx@ProjThreeD+ is
+% \[
+% x\ y\ z\ \mathrm{ProjThreeD}\ x'\ y'
+% \]
+% where $x'=\langle x, y, z\rangle \cdot \tilde{x}$ and $y'=\langle x, y, z\rangle \cdot
+% \tilde{z}$.
+%
+% \begin{macrocode}
+\pst@def{ProjThreeD}<%
+ /z ED /y ED /x ED
+ Matrix3D aload pop
+ z mul exch y mul add exch x mul add
+ 4 1 roll
+ z mul exch y mul add exch x mul add
+ exch>
+% \end{macrocode}
+%
+% To embed 2D $\langle x, y\rangle$ coordinates in 3D, the user specifies the normal
+% vector and an angle. If we decompose this normal vector into an angle, as
+% when converting 3D coordinates to 2D coordinates, and let $\hat\alpha$,
+% $\hat\beta$ and $\hat\gamma$ be the three angles, then when these angles are
+% all zero the coordinate $\langle x, y\rangle$ gets mapped to $\langle x, 0, y\rangle$, and
+% otherwise $\langle x, y\rangle$ gets mapped to
+% \[
+% R_z(\hat\alpha) R_x(\hat\beta) R_y(\hat\gamma)
+% \left[ \begin{array}{c} x \\ 0 \\ y \end{array} \right]
+% \, = \,
+% \left[ \begin{array}{c}
+% \hat{x}_1 x + \hat{z}_1 y\\
+% \hat{x}_2 x + \hat{z}_2 y\\
+% \hat{x}_3 x + \hat{z}_3 y
+% \end{array} \right]
+% \]
+% where $\hat{x}$ and $\hat{z}$ are the first and third columns of $R_z(\hat\alpha) R_x(\hat\beta) R_y(\hat\gamma)$.
+%
+% Now add on a 3D-origin:
+% \[
+% \left[ \begin{array}{c}
+% \hat{x}_1 x + \hat{z}_1 y + x_0\\
+% \hat{x}_2 x + \hat{z}_2 y + y_0\\
+% \hat{x}_3 x + \hat{z}_3 y + z_0
+% \end{array} \right]
+% \]
+%
+% Now when we project back onto 2D coordinates, we get
+% \begin{align*}
+% x' & = \tilde{x}_1(\hat{x}_1 x + \hat{z}_1 y + x_0) +
+% \tilde{x}_2(\hat{x}_2 x + \hat{z}_2 y + y_0) +
+% \tilde{x}_3(\hat{x}_3 x + \hat{z}_3 y + z_0)\\
+% & =
+% (\tilde{x}_1\hat{x}_1 + \tilde{x}_2\hat{x}_2 + \tilde{x}_3\hat{x}_3) x
+% + (\tilde{x}_1\hat{z}_1 + \tilde{x}_2\hat{z}_2 + \tilde{x}_3\hat{z}_3) y
+% + \tilde{x}_1 x_0 + \tilde{x}_2 y_0 + \tilde{z}_3 z_0\\
+% y' & = \tilde{z}_1(\hat{x}_1 x + \hat{z}_1 y + x_0) +
+% \tilde{z}_2(\hat{x}_2 x + \hat{z}_2 y + y_0) +
+% \tilde{z}_3(\hat{x}_3 x + \hat{z}_3 y + z_0)\\
+% & =
+% (\tilde{z}_1\hat{x}_1 + \tilde{z}_2\hat{x}_2 + \tilde{z}_3\hat{x}_3) x
+% + (\tilde{z}_1\hat{z}_1 + \tilde{z}_2\hat{z}_2 + \tilde{z}_3\hat{z}_3) y
+% + \tilde{z}_1 x_0 + \tilde{z}_2 y_0 + \tilde{z}_3 z_0
+% \end{align*}
+% Hence, the transformation matrix is:
+% \[
+% \left[ \begin{array}{c}
+% \tilde{x}_1\hat{x}_1 + \tilde{x}_2\hat{x}_2 + \tilde{x}_3\hat{x}_3) \\
+% \tilde{z}_1\hat{x}_1 + \tilde{z}_2\hat{x}_2 + \tilde{z}_3\hat{x}_3) \\
+% \tilde{x}_1\hat{z}_1 + \tilde{x}_2\hat{z}_2 + \tilde{x}_3\hat{z}_3) \\
+% \tilde{z}_1\hat{z}_1 + \tilde{z}_2\hat{z}_2 + \tilde{z}_3\hat{z}_3) \\
+% \tilde{x}_1 x_0 + \tilde{x}_2 y_0 + \tilde{z}_3 z_0 \\
+% \tilde{z}_1 x_0 + \tilde{z}_2 y_0 + \tilde{z}_3 z_0
+% \end{array} \right]
+% \]
+% \end{macro}
+% \begin{macro}{\tx@SetMatrixEmbed}
+% The syntax of \verb+SetMatrixEmbed+ is
+% \begin{align*}
+% x_0\ y_0\ z_0\ \hat{v_1}\ \hat{v_2}\ \hat{v_3}\ \hat{\gamma}\\
+% v_1\ v_2\ v_3\ \gamma\ \mathrm{setMatrixEmbed}
+% \end{align*}
+% \verb+SetMatrixEmbed+ first sets \verb+<x1 x2 x3 y1 y2 y3>+ to the basis vectors for
+% the viewpoint projection (the tilde stuff above). Then it sets \verb+Matrix3D+ to
+% the basis vectors for the embedded plane. Finally, it sets the
+% transformation matrix to the matrix given above.
+%
+% \begin{macrocode}
+\pst@def{SetMatrixEmbed}<%
+ \tx@SetMatrixThreeD
+ Matrix3D aload pop
+ /z3 ED /z2 ED /z1 ED /x3 ED /x2 ED /x1 ED
+ \tx@SetMatrixThreeD
+ [
+ Matrix3D aload pop
+ z3 mul exch z2 mul add exch z1 mul add 4 1 roll
+ z3 mul exch z2 mul add exch z1 mul add
+ Matrix3D aload pop
+ x3 mul exch x2 mul add exch x1 mul add 4 1 roll
+ x3 mul exch x2 mul add exch x1 mul add
+ 3 -1 roll 3 -1 roll 4 -1 roll 8 -3 roll 3 copy
+ x3 mul exch x2 mul add exch x1 mul add 4 1 roll
+ z3 mul exch z2 mul add exch z1 mul add
+ ]
+ concat>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Parameter}
+%
+% \begin{macro}{\psk@viewpoint}
+% First we need a macro \verb+\pssetzlength+ for the third coordinate. It is adopted from
+% the definition of the y-axes:
+% \begin{macrocode}
+\let\pssetzlength\pssetylength
+% \end{macrocode}
+% The viewpoint is set by its three coordinates $(x\ y\ z)$. It is preset
+% to $x=1$, $y=-1$ and $z=1$.
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{viewpoint}{%
+ \pst@expandafter\psset@@viewpoint#1 {} {} {} \@nil
+ \let\psk@viewpoint\pst@tempg}
+\def\psset@@viewpoint#1 #2 #3 #4\@nil{%
+ \begingroup
+ \pssetxlength\pst@dima{#1}%
+ \pssetylength\pst@dimb{#2}%
+ \pssetzlength\pst@dimc{#3}%
+ \xdef\pst@tempg{%
+ \pst@number\pst@dima \pst@number\pst@dimb \pst@number\pst@dimc}%
+ \endgroup}
+\psset[pst-3d]{viewpoint=1 -1 1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psk@viewangle}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{viewangle}{%
+ \pst@getangle{#1}\psk@viewangle}
+\psset[pst-3d]{viewangle=0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psk@normal}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{normal}{%
+ \pst@expandafter\psset@@viewpoint#1 {} {} {} \@nil
+ \let\psk@normal\pst@tempg}
+\psset[pst-3d]{normal=0 0 1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psk@embedangle}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{embedangle}{%
+ \pst@getangle{#1}\psk@embedangle}
+\psset[pst-3d]{embedangle=0}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psTshadowsize}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{Tshadowsize}{%
+ \pst@checknum{#1}\psTshadowsize}
+\psset[pst-3d]{Tshadowsize=1}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psk@Tshadowangle}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{Tshadowangle}{%
+ \pst@getangle{#1}\psk@Tshadowangle}
+\psset[pst-3d]{Tshadowangle=60}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psTshadowcolor}
+% \begin{macrocode}
+\define@key[psset]{pst-3d}{Tshadowcolor}{%
+ \pst@getcolor{#1}\psTshadowcolor}
+\psset[pst-3d]{Tshadowcolor=lightgray}
+% \end{macrocode}
+% \end{macro}
+%
+
+% \subsection{\texttt{PostScript} code}
+%
+% \begin{macro}{\tx@TMSave}
+% \begin{macrocode}
+\pst@def{TMSave}<%
+ tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } def } if
+ /TMatrix [ TMatrix CM ] cvx def>
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tx@TMRestore}
+% \begin{macrocode}
+\pst@def{TMRestore}<%
+ CP /TMatrix [ TMatrix setmatrix ] cvx def moveto>
+%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tx@TMChange}
+% The syntax:
+% \begin{verbatim}
+% {<Proc for modifying tm>} TMChange
+% \end{verbatim}
+% \begin{macrocode}
+\pst@def{TMChange}<%
+ \tx@TMSave
+ /cp [ currentpoint ] cvx def % ??? Check this later.
+ CM
+% \end{macrocode}
+%
+% Set ''standard`` coordinate system , with \verb+pt+ units and origin at currentpoint.
+% This let's us rotate, or whatever, around \TeX's current point, without
+% having to worry about strange coordinate systems that the dvi-to-ps
+% driver might be using.
+% \begin{macrocode}
+ CP T \tx@STV
+% \end{macrocode}
+% Let M = old matrix (on stack), and M' equal current matrix. Then
+% go from M' to M by applying M Inv(M').
+% \begin{macrocode}
+ CM matrix invertmatrix % Inv(M')
+ matrix concatmatrix % M Inv(M')
+% \end{macrocode}
+% Now modify transformation matrix:
+% \begin{macrocode}
+ exch exec
+% \end{macrocode}
+% Now apply M Inv(M')
+% \begin{macrocode}
+ concat cp moveto>
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Three dimensional operations}
+%
+% There is only one macro which collects all the basic operations for three dimansional representation
+% of a text or graphic object.
+%
+% \begin{macro}{\ThreeDput}
+% \begin{macrocode}
+\def\ThreeDput{\def\pst@par{}\pst@object{ThreeDput}}
+\def\ThreeDput@i{\@ifnextchar({\ThreeDput@ii}{\ThreeDput@ii(\z@,\z@,\z@)}}
+\def\ThreeDput@ii(#1,#2,#3){%
+ \pst@killglue\pst@makebox{\ThreeDput@iii(#1,#2,#3)}}
+\def\ThreeDput@iii(#1,#2,#3){%
+ \begingroup
+ \use@par
+ \if@star\pst@starbox\fi
+ \pst@makesmall\pst@hbox
+ \pssetxlength\pst@dima{#1}%
+ \pssetylength\pst@dimb{#2}%
+ \pssetzlength\pst@dimc{#3}%
+ \leavevmode
+ \hbox{%
+ \pst@Verb{%
+ { \pst@number\pst@dima
+ \pst@number\pst@dimb
+ \pst@number\pst@dimc
+ \psk@normal
+ \psk@embedangle
+ \psk@viewpoint
+ \psk@viewangle
+ \tx@SetMatrixEmbed
+ } \tx@TMChange}%
+ \box\pst@hbox
+ \pst@Verb{\tx@TMRestore}}%
+ \endgroup
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Arithmetic\label{Arithmetic}}
+%
+% \begin{macro}{\pst@sinandcos}
+% Syntax:
+% \begin{LVerbatim}
+% \pst@sinandcos{<dim>}{<int>}
+% \end{LVerbatim}
+% <dim>, in "sp" units, should equal 100,000 times the angle, in degrees
+% between 0 and 90. <int> should equal the angle's quadrant (0, 1, 2 or 3).
+% \verb+\pst@dimg+ is set to $\sin(\theta)$ and \verb+\pst@dimh+ is set to
+% $\cos(\theta)$ (in pt's).
+%
+% The algorithms uses the usual McLaurin expansion.
+% \begin{macrocode}
+\def\pst@sinandcos#1{%
+ \begingroup
+ \pst@dima=#1\relax
+ \pst@dima=.366022\pst@dima %Now 1pt=1/32rad
+ \pst@dimb=\pst@dima % dimb->32sin(angle) in pts
+ \pst@dimc=32\p@ % dimc->32cos(angle) in pts
+ \pst@dimtonum\pst@dima\pst@tempa
+ \pst@cntb=\tw@
+ \pst@cntc=-\@ne
+ \pst@cntg=32
+ \loop
+ \ifnum\pst@dima>\@cclvi % 256
+ \pst@dima=\pst@tempa\pst@dima
+ \divide\pst@dima\pst@cntg
+ \divide\pst@dima\pst@cntb
+ \ifodd\pst@cntb
+ \advance\pst@dimb \pst@cntc\pst@dima
+ \pst@cntc=-\pst@cntc
+ \else
+ \advance\pst@dimc by \pst@cntc\pst@dima
+ \fi
+ \advance\pst@cntb\@ne
+ \repeat
+ \divide\pst@dimb\pst@cntg
+ \divide\pst@dimc\pst@cntg
+ \global\pst@dimg\pst@dimb
+ \global\pst@dimh\pst@dimc
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pst@getsinandcos}
+% \verb+\pst@getsinandcos+ normalizes the angle to be in the first quadrant, sets
+% \verb+\pst@quadrant+ to 0 for the first quadrant, 1 for the second, 2 for the
+% third, and 3 for the fourth, invokes \verb+\pst@sinandcos+, and sets \verb+\pst@sin+
+% to the sine and \verb+\pst@cos+ to the cosine.
+% \begin{macrocode}
+\def\pst@getsinandcos#1{%
+ \pst@dimg=100000sp
+ \pst@dimg=#1\pst@dimg
+ \pst@dimh=36000000sp
+ \pst@cntg=0
+ \loop
+ \ifnum\pst@dimg<\z@
+ \advance\pst@dimg\pst@dimh
+ \repeat
+ \loop
+ \ifnum\pst@dimg>\pst@dimh
+ \advance\pst@dimg-\pst@dimh
+ \repeat
+ \pst@dimh=9000000sp
+ \def\pst@tempg{%
+ \ifnum\pst@dimg<\pst@dimh\else
+ \advance\pst@dimg-\pst@dimh
+ \advance\pst@cntg\@ne
+ \ifnum\pst@cntg>\thr@@ \advance\pst@cntg-4 \fi
+ \expandafter\pst@tempg
+ \fi}%
+ \pst@tempg
+ \chardef\pst@quadrant\pst@cntg
+ \ifdim\pst@dimg=\z@
+ \def\pst@sin{0}%
+ \def\pst@cos{1}%
+ \else
+ \pst@sinandcos\pst@dimg
+ \pst@dimtonum\pst@dimg\pst@sin
+ \pst@dimtonum\pst@dimh\pst@cos
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Tilting}
+%
+% \begin{macro}{\pstilt}
+% \begin{macrocode}
+\def\pstilt#1{\pst@makebox{\pstilt@{#1}}}
+\def\pstilt@#1{%
+ \begingroup
+ \leavevmode
+ \pst@getsinandcos{#1}%
+ \hbox{%
+ \ifcase\pst@quadrant
+ \kern\pst@cos\dp\pst@hbox
+ \pst@dima=\pst@cos\ht\pst@hbox
+ \ht\pst@hbox=\pst@sin\ht\pst@hbox
+ \dp\pst@hbox=\pst@sin\dp\pst@hbox
+ \or
+ \kern\pst@sin\ht\pst@hbox
+ \pst@dima=\pst@sin\dp\pst@hbox
+ \ht\pst@hbox=\pst@cos\ht\pst@hbox
+ \dp\pst@hbox=\pst@cos\dp\pst@hbox
+ \or
+ \kern\pst@cos\ht\pst@hbox
+ \pst@dima=\pst@sin\dp\pst@hbox
+ \pst@dimg=\pst@sin\ht\pst@hbox
+ \ht\pst@hbox=\pst@sin\dp\pst@hbox
+ \dp\pst@hbox=\pst@dimg
+ \or
+ \kern\pst@sin\dp\pst@hbox
+ \pst@dima=\pst@sin\ht\pst@hbox
+ \pst@dimg=\pst@cos\ht\pst@hbox
+ \ht\pst@hbox=\pst@cos\dp\pst@hbox
+ \dp\pst@hbox=\pst@dimg
+ \fi
+ \pst@Verb{%
+ { [ 1 0
+ \pst@cos\space \ifnum\pst@quadrant>\@ne neg \fi
+ \pst@sin\space
+ \ifnum\pst@quadrant>\z@\ifnum\pst@quadrant<\thr@@ neg \fi\fi
+ \ifodd\pst@quadrant exch \fi
+ 0 0
+ ] concat
+ } \tx@TMChange}%
+ \box\pst@hbox
+ \pst@Verb{\tx@TMRestore}%
+ \kern\pst@dima}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\psTilt}
+% \begin{macrocode}
+\def\psTilt#1{\pst@makebox{\psTilt@{#1}}}
+\def\psTilt@#1{%
+ \begingroup
+ \leavevmode
+ \pst@getsinandcos{#1}%
+ \hbox{%
+ \ifodd\pst@quadrant
+ \pst@@divide{\dp\pst@hbox}{\pst@cos\p@}%
+ \ifnum\pst@quadrant=\thr@@\kern\else\pst@dima=\fi\pst@sin\pst@dimg
+ \pst@@divide{\ht\pst@hbox}{\pst@cos\p@}%
+ \ifnum\pst@quadrant=\@ne\kern\else\pst@dima=\fi\pst@sin\pst@dimg
+ \else
+ \ifdim\pst@sin\p@=\z@
+ \@pstrickserr{\string\psTilt\space angle cannot be 0 or 180}\@ehpa
+ \def\pst@sin{.7071}%
+ \def\pst@cos{.7071}%
+ \fi
+ \pst@@divide{\dp\pst@hbox}{\pst@sin\p@}%
+ \ifnum\pst@quadrant=\z@\kern\else\pst@dima=\fi\pst@cos\pst@dimg
+ \pst@@divide{\ht\pst@hbox}{\pst@sin\p@}%
+ \ifnum\pst@quadrant=\tw@\kern\else\pst@dima=\fi\pst@cos\pst@dimg
+ \fi
+ \ifnum\pst@quadrant>\@ne
+ \pst@dimg=\ht\pst@hbox
+ \ht\pst@hbox=\dp\pst@hbox
+ \dp\pst@hbox=\pst@dimg
+ \fi
+ \pst@Verb{%
+ { [ 1 0
+ \pst@cos\space \pst@sin\space
+ \ifodd\pst@quadrant exch \fi
+ \tx@Div
+ \ifnum\pst@quadrant>\z@\ifnum\pst@quadrant<\thr@@ neg \fi\fi
+ \ifnum\pst@quadrant>\@ne -1 \else 1 \fi
+ 0 0
+ ] concat
+ } \tx@TMChange}%
+ \box\pst@hbox
+ \pst@Verb{\tx@TMRestore}%
+ \kern\pst@dima}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Shadow}
+%
+% \begin{macro}{\psshadow}
+% \begin{macrocode}
+\def\psshadow{\pst@object{psshadow}}
+\def\psshadow@i{\pst@makebox{\psshadow@ii}}
+\def\psshadow@ii{%
+ \begingroup
+ \use@par
+ \leavevmode
+ \pst@getsinandcos{\psk@Tshadowangle}%
+ \hbox{%
+ \lower\dp\pst@hbox\hbox{%
+ \pst@Verb{%
+ { [ 1 0
+ \pst@cos\space \psTshadowsize mul
+ \ifnum\pst@quadrant>\@ne neg \fi
+ \pst@sin\space \psTshadowsize mul
+ \ifnum\pst@quadrant>\z@\ifnum\pst@quadrant<\thr@@ neg \fi\fi
+ \ifodd\pst@quadrant exch \fi
+ 0 0
+ ] concat
+ } \tx@TMChange}}%
+ \hbox to\z@{% patch 2 (hv), to get it run with xcolor _and_ TeX
+ \pst@Verb{ gsave \pst@usecolor\psTshadowcolor}%
+ \copy\pst@hbox
+ \pst@Verb{ grestore}\hss}%
+% \hbox to\z@{{\@nameuse{\psTshadowcolor}\copy\pst@hbox\hss}}%
+ \pst@Verb{\tx@TMRestore}%
+ \box\pst@hbox}%
+ \endgroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Closing}
+%
+% Catcodes restoration.
+%
+% \begin{macrocode}
+\catcode`\@=\PstAtCode\relax
+% \end{macrocode}
+%
+%</pst-3d>
+%
+\endinput
+%%
+%% END pst-3d.tex
diff --git a/Master/texmf-dist/source/latex/pst-3d/pst-3d.ins b/Master/texmf-dist/source/latex/pst-3d/pst-3d.ins
new file mode 100644
index 00000000000..deba1b20071
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-3d/pst-3d.ins
@@ -0,0 +1,38 @@
+%% `pst-lens.ins'
+%%
+%% Docstrip installation instruction file for docstyle `pst-lens'
+%%
+%% Timothy Van Zandt <tvz@nwu.edu> (tvz)
+%% Herbert Voss <voss@pstricks.de> (hv)
+%%
+%% September 03, 2005
+
+\def\batchfile{pst-3d.ins}
+\input docstrip.tex
+\keepsilent
+\Msg{*** Generating the `pst-3d' package ***}
+\askforoverwritefalse
+\generate{\file{pst-3d.tex}{\from{pst-3d.dtx}{pst-3d}}}
+\generate{\file{pst-3d.sty}{\from{pst-3d.dtx}{latex-wrapper}}}
+%
+\ifToplevel{%
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the files}
+\Msg{* pst-3d.sty and pst-3d.tex in a directory/folder searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation, run the file `pst-3d.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-3d'}
+\Msg{* `makeindex -s gglo.ist -o pst-3d.gls pst-3d.glo'}
+\Msg{* and recompile.}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endinput
+%%
+%% End of file `pst-3d.ins'
diff --git a/Master/texmf-dist/source/latex/pst-poly/pst-poly.dtx b/Master/texmf-dist/source/latex/pst-poly/pst-poly.dtx
new file mode 100644
index 00000000000..5b3d427240b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-poly/pst-poly.dtx
@@ -0,0 +1,1679 @@
+% \iffalse meta-comment, etc.
+%%
+%% Package `pst-poly.dtx'
+%%
+%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
+%% Herbert Voss <voss _at_ pstricks.de>
+%%
+%% Novermber 20, 2004
+%%
+%% 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-poly' is a PSTricks package to draw easily various kinds of regular
+%% or non regular polygons, with various customizations.
+%%
+% \fi
+%
+% \changes{v1.60}{2004/11/20}{new macro pspolygonbox,
+% using pst-xkey}
+% \changes{v1.50}{2001/02/08}{Standard packaging (.ins + .dtx files).}
+% \changes{v1.40}{1998/07/09}{Define `PolyRotation' parameter as a real number
+% and not as an angle, to allow to use the macro
+% `degrees' before to draw a polygon.}
+% \changes{v1.30}{1998/02/06}{Rename `PsPicture' parameter to `PstPicture' for
+% consistancy.}
+% \changes{v1.20}{1997/06/27}{First public release.}
+%
+% \DoNotIndex{\\,\%,\@}
+% \DoNotIndex{\@eha,\@empty,\@ifnextchar,\@nameuse,\@nil,\@pstrickserr}
+% \DoNotIndex{\@tempdimb,\@undefined}
+% \DoNotIndex{\advance,\Alph,\begin,\begingroup,\Below@Example,\BS}
+% \DoNotIndex{\catcode,\CenterExample,\changes,\clearpage,\CodelineIndex}
+% \DoNotIndex{\colorbox,\csname}
+% \DoNotIndex{\def,\define@key,\degrees,\divide,\DocInput,\documentclass}
+% \DoNotIndex{\edef,\else,\EnableCrossrefs,\end,\endCenterExample}
+% \DoNotIndex{\endcsname,\endExample,\endgroup,\endinput,\endpspicture}
+% \DoNotIndex{\endSideBySideExample,\Example}
+% \DoNotIndex{\fboxsep,\fi,\filedate,\fileversion,\FV@Environment}
+% \DoNotIndex{\FV@UseKeyValues,\FV@XRightMargin,\FVB@Example,\fvset}
+% \DoNotIndex{\GetFileInfo}
+% \DoNotIndex{\hbadness,\hfuzz,\HLEmphasize,\HLMacro,\HLMacro@i}
+% \DoNotIndex{\HLReverse,\HLReverse@i,\hspace}
+% \DoNotIndex{\i,\if@star,\ifnum,\ifodd,\ifx,\input,\jobname}
+% \DoNotIndex{\let,\lineto,\makeatletter,\makeatother,\message,\moveto}
+% \DoNotIndex{\multido,\multidocount,\MultidoLoaded,\multiply}
+% \DoNotIndex{\n,\newbox,\newcommand,\newcounter,\newdimen,\newif}
+% \DoNotIndex{\OnlyDescription}
+% \DoNotIndex{\par,\parindent,\pnode,\providecommand,\ProvidesPackage}
+% \DoNotIndex{\pscurve,\pscustom,\psdots,\psline,\pspicture,\pspolygon}
+% \DoNotIndex{\psset,\pssetlength,\pst@cnta,\pst@getint,\pst@ifstar}
+% \DoNotIndex{\PstAtCode,\PSTricksLoaded,\psxunit,\psyunit}
+% \DoNotIndex{\RecordChanges,\relax,\rput}
+% \DoNotIndex{\savebox,\setcounter,\setlength,\shortstack}
+% \DoNotIndex{\SideBySide@Example,\SideBySideExample,\small,\solid@star}
+% \DoNotIndex{\space,\SpecialCoor,\Star,\symbol}
+% \DoNotIndex{\textbf,\textcolor,\textit,\texttt,\textwidth,\the,\topsep,\tw@}
+% \DoNotIndex{\usebox,\usepackage}
+% \DoNotIndex{\VerbatimEnvironment,\VerbatimInput,\vskip,\Z}
+%
+% \setcounter{IndexColumns}{2}
+%
+% \newcommand{\KeyValPackage}{`\textsf{keyval}'}
+% \newcommand{\PstPolygonPackage}{`\textsf{pst-poly}'}
+% \newcommand{\PstPolygonMacro}{\cs{PstPolygon}}
+% \newcommand{\PstPolygonNodeMacro}{\cs{PstPolygonNode}}
+% \newcommand{\XYpic}{%
+% \leavevmode\hbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}-pic}}
+%
+% ^^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}}
+%
+% \makeatletter
+%
+% ^^A For the references
+% \newcommand\acro[1]{\textsc{#1}\@}
+% \def\CTAN{\acro{CTAN}}
+% \let\texttub\textsl
+% \def\TUB{\texttub{TUGboat}}
+%
+% ^^A From the `ctandir' package from the `ltugboat' package
+% ^^A (`ltubguid' on 1997/06/12)
+% ^^A Experimental CTAN location information macros for use with Donald
+% ^^A Arseneau's |url.sty|
+%
+% \newcommand\CTANdirectory[1]{\expandafter\urldef
+% \csname CTAN@#1\endcsname\path}
+%
+% ^^A Use the standard label-referencing mechanism to get the warning for
+% ^^A an undefined label
+% \newcommand\CTANref[1]{\expandafter\@setref\csname CTAN@#1\endcsname
+% \relax{#1}}
+%
+% ^^A Utility macros
+%
+% ^^A Example macros - adapted from the `fvrb-ex' package
+% ^^A ---------------------------------------------------
+%
+% ^^A Take care that we use here the four /?_Z characters as escape
+% ^^A characters, so we can't use these characters in the examples!
+%
+% ^^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`\Z=12}]{\jobname.tmp}}
+%
+% \def\Below@Example#1{%
+% \VerbatimInput[gobble=0,commentchar=Z,commandchars=/?_,frame=single,
+% numbers=left,numbersep=3pt]{\jobname.tmp}
+% \catcode`\%=14\relax
+% \catcode`\Z=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`\Z=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=Z,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 Define CTAN addresses using the commands of the |ctandir| package
+% \CTANdirectory{pstricks}{graphics/pstricks}
+% \CTANdirectory{xypic}{macros/generic/diagrams/xypic}
+%
+% ^^A For the possible index and changes log
+% \setlength{\columnseprule}{0.6pt}
+%
+% ^^A Beginning of the documentation itself
+%
+% \title{The \PstPolygonPackage{} package\\A PSTricks package for polygons}
+% \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{\today\\
+% {\small Documentation revised November 20, 2004\\
+% by Herbert Voss}}
+%
+% \maketitle
+%
+% \begin{abstract}
+% This package allow to draw easily various kinds of regular or non
+% regular polygons, using the unique macro \PstPolygonMacro, with various
+% customization parameters.
+%
+% It is also a good example of the great power and flexibility of
+% PSTricks, as in fact it is a very short program (it body is only 100~lines
+% long) but nevertheless really powerful.
+%
+% And last, it is also a good pedagogical example of how to design and
+% program \emph{high level graphic objects} above PSTricks own ones.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Introduction}
+%
+% \PstPolygonPackage{} offer a unique macro (plus some aliases to define
+% some often used polygons) with few parameters to interact on it. But we can
+% also use all the relevant PSTricks parameters to change the size, the
+% characteristics of lines, to add filling, etc.
+%
+% The polygons are always drawn counter clockwise.
+%
+% \vspace{1mm}
+% The syntax is simply:
+% \fbox{\PstPolygonMacro\texttt{*[optional\_parameters]}}
+%
+% \vspace{1mm}
+% As for PSTricks closed objects, the \texttt{*} version use a solid style
+% to fill the polygon, use the line color for fill color and set the linewidth
+% to 0.
+%
+% A preliminary version, limited to \emph{regular} polygons, was shown at
+% TUG'95 conference, St Petersburg, Florida, as part of my talk
+% \emph{Building high level objects in PSTricks} \cite{Girou95}.
+%
+% \emph{Note}: You can take advantage to look also at the polygon feature of
+% the \XYpic{} package \cite{XYpic}, \cite{LGC97}.
+%
+% \section{Usage}
+%
+% \subsection{Parameters}
+%
+% There are \textbf{eight} specific parameters defined to change the way the
+% polygons are defined:
+%
+% \begin{optlist}
+% \item [PstPicture (boolean)]: to define or not a \texttt{pspicture}
+% environment for the polygon. We have to define this parameter to
+% \emph{false} if we want to mix the polygon with other PSTricks objects
+% --- see examples later
+% (\emph{Default:~true} --- which is not the case for basic PSTricks
+% objects).
+% \end{optlist}
+%
+% \begin{optlist}
+% \item [PolyRotation (real)]: rotation angle applied to the polygon
+% (\emph{Default:~0} --- no rotation).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \PstPolygon\hfill
+% \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?18_]\hfill
+% \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?36_]\hfill
+% \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?45_]
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyNbSides (integer)]: number of sides of the polygon
+% (\emph{Default:~5}).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \PstPolygon
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?3_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?4_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?5_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?8_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?50_]
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyOffset (integer)]: number of nodes to bypass to obtain each
+% time the next one
+% (\emph{Default:~1} --- no node bypassed).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \PstPolygon
+% \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?2_]
+% \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?3_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyOffset_=/HLReverse?4_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?17_,/HLEmphasize?PolyOffset_=/HLReverse?6_]
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyIntermediatePoint (real)]: position of the intermediate point
+% used to join each time the next node
+% (\emph{Default:~empty} --- not used).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \PstPolygon
+% \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]
+% \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.2_]
+% \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?1.2_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
+% /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?21_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
+% /HLEmphasize?PolyIntermediatePoint_=/HLReverse?-1.25_]
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyCurves (boolean)]: boolean value to choose between straight
+% line and curve to join each time the next node
+% (\emph{Default:~false} --- straight lines).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \psset{/HLEmphasize?PolyCurves_=/HLReverse?true_}
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]\hfill
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?11_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.6_]\hfill
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.2_,
+% /HLEmphasize?PolyOffset_=/HLReverse?2_]\hfill
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_]\hfill
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?15_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?1.2_]
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyEpicycloid (boolean)]: boolean value to choose between
+% polygon and epicycloid
+% (\emph{Default:~false} --- polygon).
+% \end{optlist}
+%
+% \begin{CenterExample}
+% \psset{linewidth=0.001,/HLEmphasize?PolyNbSides_=/HLReverse?72_,/HLEmphasize?PolyEpicycloid_=/HLReverse?true_}
+% % /HLEmphasize?Epicycloid of factor 1 is cardioid and of factor 2 nephroid_
+% \multido{\i=2+1}{4}{\PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?\i_]\hfill}
+% \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?72_]\hfill % /HLEmphasize?Epicycloid of factor 71_
+% \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?73_] % /HLEmphasize?Epicycloid of factor 72_
+% \end{CenterExample}
+%
+% \begin{optlist}
+% \item [PolyName (string)]: name of the polygon, useful to have different
+% names for the nodes of different polygons
+% (\emph{Default:~empty} --- no name).
+% \end{optlist}
+%
+% The center of the polygon has name \texttt{PolyName0} and the nodes
+% (vertices) have names \texttt{PolyName1} to \texttt{PolyNameN}.
+%
+% With this parameter, we can connect as we want nodes of different polygons:
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \psset{PstPicture=false}
+% \begin{pspicture}(-1,-1)(1,1)
+% \PstPolygon[unit=0.8,/HLEmphasize?PolyName_=/HLReverse?A_,/HLEmphasize?PolyNbSides_=/HLReverse?6_]
+% \PstPolygon[unit=1.2,/HLEmphasize?PolyName_=/HLReverse?B_,/HLEmphasize?PolyNbSides_=/HLReverse?12_]
+% \end{pspicture}
+% \multido{\i=1+2}{6}{%
+% \ncline{A\the\multidocount}{B\i}}
+% \end{SideBySideExample}
+%
+% It is also a way (limited in fact...) to define three dimensional objects
+% in perspective (this was used first in \cite{XYpic}):
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \psset{unit=0.8}
+% \begin{pspicture}(3,2.5)
+% % /HLEmphasize?\PstSquare is described later_
+% \rput[lb](0,0){\PstSquare[/HLEmphasize?PolyName_=/HLReverse?A_]}
+% \rput[lb](2.5,2){\PstSquare[unit=0.5,
+% /HLEmphasize?PolyName_=/HLReverse?B_]}
+% \multido{\i=1+1}{4}{\ncline{A\i}{B\i}}
+% \end{pspicture}
+% \end{SideBySideExample}
+%
+% Of course, we can mix specific \PstPolygonPackage{} parameters with
+% relevant PSTricks ones and combine it with other generic macros
+% (for repetitions, projection in the 3d space, etc.)
+%
+% \begin{CenterExample}
+% \PstPolygon[unit=/HLReverse?1.5_,linestyle=/HLReverse?dashed_]
+% \PstPolygon[linewidth=/HLReverse?1mm_]
+% \PstPolygon[fillstyle=/HLReverse?crosshatch_,/HLEmphasize?PolyNbSides_=/HLReverse?6_]
+% \PstPolygon[linecolor=/HLReverse?red_,fillstyle=/HLReverse?solid_,fillcolor=/HLReverse?yellow_,
+% /HLEmphasize?PolyRotation_=/HLReverse?18_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
+% \PstPolygon*[linecolor=/HLReverse?cyan_,/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\i=5+2}{6}{%
+% \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?\i_,/HLEmphasize?PolyCurves_=/HLReverse?true_,
+% /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_,/HLEmphasize?PolyOffset_=/HLReverse?3_]}
+% \end{CenterExample}
+%
+% \subsection{Pre-defined polygons}
+%
+% Some often used polygons and other related geometric objects are
+% pre-defined, for immediate usage :
+%
+% \begin{CenterExample}
+% \PstTriangle
+% \PstSquare
+% \PstPentagon[unit=0.5,linestyle=dotted]
+% \PstHexagon[fillstyle=hlines,hatchangle=90]
+% \PstHeptagon[fillstyle=vlines]
+% \PstOctogon*[unit=0.8,linecolor=red]
+% \PstNonagon[unit=0.5]
+% \PstDecagon
+% \PstDodecagon[linecolor=green]
+% \PstStarFiveLines
+% \PstStarFive
+% \end{CenterExample}
+%
+% \subsection{Non regular polygons}
+%
+% Until now, we have described only the so-called \emph{regular} polygons,
+% which are from far the most useful ones (all of them have equal edges and
+% angles). Nevertheless, it is not so difficult to extend these polygon to
+% \emph{non regular} ones, using a different value for horizontal and vertical
+% units (nevertheless, the code is more tricky, as we must do all the
+% trigonometry explicitely...)
+%
+% \begin{CenterExample}
+% \PstPentagon[xunit=/HLReverse?0.5_]\hfill
+% \PstHexagon[yunit=/HLReverse?0.5_]\hfill
+% \PstStarFive[xunit=/HLReverse?0.5_,yunit=/HLReverse?1.5_]\hfill
+% \PstPolygon[xunit=/HLReverse?0.8_,yunit=/HLReverse?1.5_,/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
+% /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_,/HLEmphasize?PolyCurves_=/HLReverse?true_]
+% \end{CenterExample}
+%
+% \subsection{Nodes (vertices)}
+%
+% And another powerful possibility is to define a command
+% \PstPolygonNodeMacro{} which will be excuted at each node
+% (\emph{Default:~empty} --- nothing executed). The counter name for nodes is
+% \cs{INode}, starting from 0. The \cs{multidocount} counter, from the
+% \cs{multido} command, start itself from 1.
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \providecommand{\PstPolygonNode}{%
+% /HLReverse?\psdots[dotsize=0.2,linecolor=cyan](1;\INode)_}
+% \PstPentagon
+% \end{SideBySideExample}
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \newcounter{Letter}
+% \providecommand{\PstPolygonNode}{%
+% /HLReverse?\setcounter{Letter}{\the\multidocount}_%
+% /HLReverse?\rput*{*0}(1;\INode){\small\Alph{Letter}}_}
+% \PstHeptagon[PolyOffset=3]
+% \end{SideBySideExample}
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \providecommand{\PstPolygonNode}{%
+% /HLReverse?\psdots[dotstyle=o,dotsize=0.2](1;\INode)_
+% /HLReverse?\psline[linecolor=red]{->}(0.9;\INode)_}
+% \PstPolygon[PolyNbSides=8]
+% \end{SideBySideExample}
+%
+% \vspace{3mm}
+% It is also a way to nest polygons:
+% \vspace{3mm}
+%
+% \begin{SideBySideExample}[xrightmargin=3cm]
+% \newbox{\Star}
+% \savebox{\Star}{%
+% \PstStarFive*[unit=0.15,linecolor=red]}
+% \providecommand{\PstPolygonNode}{%
+% /HLReverse?\rput{*0}(1;\INode){\usebox{\Star}}_}
+% \shortstack{\PstNonagon\\[5mm]
+% \PstDodecagon[linestyle=none]}
+% \end{SideBySideExample}
+%
+% \vspace{3mm}
+% Here we redraw one of the polygon examples built with the \XYpic{} package
+% in \cite[example 5-5-34, page 203]{LGC97}:
+%
+% \begin{CenterExample}
+% \psset{unit=2,PstPicture=false}
+% \begin{pspicture}(-1.6,-1.6)(1.6,1.6)
+% % /HLEmphasize?Just to name the nodes, to be able to join some of them._
+% % /HLEmphasize?by solid curves. We can't draw the polygons now,_
+% % /HLEmphasize?as the node numbers must erase the solid curves..._
+% \PstHexagon[unit=0.8,linestyle=none,PolyName=H]
+% \PstDodecagon[unit=1.2,linestyle=none,PolyName=D]
+% {\SpecialCoor
+% \psset{linewidth=0.4pt,border=2pt,nodesep=0.45}
+% \psccurve(H1)(H4)(D8)([angle=-30]D9)(D11)
+% \psccurve(D3)(H3)(H6)(D12)([angle=90]D1)
+% \psccurve(D4)(H2)(H5)(D7)([angle=90]D6)}
+% \psset{linestyle=dotted,framesep=1pt}
+% \PstTriangle[unit=0.23]
+% \providecommand{\PstPolygonNode}{%
+% \rput*{*0}(1;\INode){\small\the\multidocount}}
+% \PstHexagon[unit=0.8]
+% \PstDodecagon[unit=1.2]
+% \PstDodecagon[unit=1.6]
+% \end{pspicture}
+% \end{CenterExample}
+%
+% \section[Polygonbox]{Polygonbox\protect\footnote{written by Herbert Vo\ss.}}
+% The valid options with the predefined values are
+% \begin{verbatim}
+% PolyNbSides =3
+% PolyRotation=0
+% \end{verbatim}
+%
+% \begin{itemize}
+% \item There are some problems with linearcs and rounding errors, which are seen in the
+% following examples for \verb+PolyNbSides=7+.
+% \item To rotate the text inside the box, one can use the \verb+\rotatebox+ macro from
+% the \verb+rotating+ package (see examples).
+% \end{itemize}
+%
+% \begin{CenterExample}
+% \multido{\nA=3+1}{8}{%
+% \pspolygonbox[PolyNbSides=\nA,framesep=3mm]{Text}~}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\nA=3+1}{8}{\pspolygonbox[PolyNbSides=\nA,%
+% framesep=2mm,doubleline=true]{Text}~}
+% \end{CenterExample}
+%
+%
+% \begin{CenterExample}
+% \psset{PolyNbSides=4}
+% \multido{\nA=0+60}{8}{\pspolygonbox[PolyRotation=\nA,%
+% framesep=2mm,doubleline=true,%
+% linecolor=red,doublecolor=blue]{\magenta Text}~}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\nA=0+60,\nB=45+60}{8}{\pspolygonbox%
+% [PolyRotation=\nA,framesep=2mm,doubleline=true,%
+% linecolor=red,doublecolor=blue,linearc=0.4]%
+% {\rotatebox{\nB}{\blue Text}}~}\\[1cm]
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\nA=3+1}{8}{%
+% \pspolygonbox[PolyNbSides=\nA,rot=60,framesep=2pt,%
+% doubleline=true,linearc=0.2]{Text}~}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\nA=3+1}{8}{%
+% \pspolygonbox[PolyNbSides=\nA,framesep=10pt,%
+% fillstyle=solid,fillcolor=cyan,linearc=0.2]{Text}~}
+% \end{CenterExample}
+%
+% \begin{CenterExample}
+% \multido{\nA=-5+5}{8}{\pspolygonbox[framesep=\nA pt,%
+% PolyRotation=90]{\Huge\red T}~}
+% \end{CenterExample}
+%
+%
+% \begin{CenterExample}
+% \multido{\nA=-5+5}{8}{\pspolygonbox[framesep=\nA pt,%
+% PolyRotation=90,boxsep=false]{\Huge\red T}~}
+% \end{CenterExample}
+%
+%
+% ^^A Bibliography
+% \begin{thebibliography}{9}
+% \bibitem{Girou94} Denis Girou, Pr\'esentation de PSTricks,
+% \emph{Cahiers GUTenberg}, Number~16, pages 21--70,
+% February~1994 (in french).
+%
+% \bibitem{Girou95} Denis Girou, Building high level objects in PSTricks,
+% TUG'95, St Petersburg, Florida, 1995. Available at
+% {\url{http://www.tug.org/applications/PSTricks/TUG95-PSTricks_4.ps.gz}}
+%
+% \bibitem{LGC97} Michel Goossens, Sebastian Rahtz and Frank Mittelbach,
+% \emph{The \LaTeX{} Graphics Companion}, Addison-Wesley, 1997.
+%
+% \bibitem{Hoenig98} Alan Hoenig, \emph{\TeX{} Unbound: \LaTeX{} \& \TeX{}
+% Strategies, Fonts, Graphics, and More},
+% Oxford University Press, 1998.
+%
+% \bibitem{voss04} Herbert Vo\ss, PSTricks -- Grafik mit {P}ost{S}cript f\"ur \TeX{}
+% und \LaTeX{}, Lehmanns, July 2004 (in german).
+%
+% \bibitem{XYpic} Kristoffer~H. Rose and Ross Moore, \XYpic. Polygon feature,
+% available from \CTAN, 1991-1998, \CTANref{xypic}.
+%
+% \bibitem{vanZandt93} Timothy van Zandt, PSTricks. PostScript macros for
+% Generic \TeX, available from \CTAN, 1993,
+% \CTANref{pstricks}.
+%
+% \bibitem{vanZandtGirou94} Timothy van Zandt and Denis Girou, Inside PSTricks,
+% \emph{\TUB}, Volume~15, Number~3, pages 239--246,
+% September 1994.
+% \end{thebibliography}
+%
+%
+% \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-poly.dtx}
+\usepackage{fancyvrb}
+\usepackage{pstricks}
+\usepackage{pst-poly}
+\usepackage{rotating}
+\usepackage{url}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\OnlyDescription % Comment it for implementation details
+\hbadness=7000 % Over and under full box warnings
+\hfuzz=3pt
+\begin{document}
+ \DocInput{pst-poly.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \section{\PstPolygonPackage{} \LaTeX{} wrapper}
+%
+% \begin{macrocode}
+%<*latex-wrapper>
+\RequirePackage{pstricks}
+\ProvidesPackage{pst-poly}[2004/11/20 package wrapper for
+ pst-poly.tex (hv)]
+\input{pst-poly.tex}
+\ProvidesFile{pst-poly.tex}
+ [\filedate\space v\fileversion\space `PST-poly' (DG)]
+%</latex-wrapper>
+% \end{macrocode}
+%
+% \section{\PstPolygonPackage{} code}
+%
+% As it is a general and very powerful way to build \emph{high level graphic
+% objects} above PSTricks own ones, we will comment precisely the code,
+% focusing these comments on the case of \emph{regular} polygons, which is
+% enough to show all useful major technics. In fact, all real difficulties
+% in the code of \PstPolygonPackage{} are for the \emph{non regular} case,
+% which involve some trigonometry.
+%
+% \begin{macrocode}
+%<*pst-poly>
+% \end{macrocode}
+%
+% \subsection{Preambule}
+%
+% Who we are.
+%
+% \begin{macrocode}
+%
+\def\fileversion{1.60}
+\def\filedate{2004/11/20}
+\message{`PST-Polygon' v\fileversion, \filedate\space (DG/hv)}
+\csname PSTPolygonLoaded\endcsname
+\let\PSTPolygonLoaded\endinput
+%
+% \end{macrocode}
+%
+% Require the PSTricks, `\textsf{pst-node}' and `\textsf{multido}' packages.
+%
+% \begin{macrocode}
+%
+\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
+\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
+\ifx\MultidoLoaded\endinput\else\input multido.tex\fi
+%
+% \end{macrocode}
+%
+% \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-poly}
+%
+% \end{macrocode}
+%
+% \subsection{Definition of the parameters}
+%
+% \texttt{PstPicture} will define if the polygon must be set inside a
+% \texttt{pspicture} environment or not. It is a \emph{boolean} value, so we
+% define a new \cs{if} \TeX{} variable. The \texttt{true} value specified
+% will give the default to used when no value is affected to this parameter
+% (so \texttt{PstPicture} will be equivalent to \texttt{PstPicture=true}).
+% Take care that it is not the default value for the parameter itself (we
+% will see later that here we choose \texttt{false} as default value...).
+% We don't prefix this parameter name by \texttt{Poly} because it is not
+% specific to polygons. Note also that \texttt{psset} is for the
+% \KeyValPackage{} package the generic name for all PSTricks parameters.
+%
+% \begin{macrocode}
+\newif\ifPst@PstPicture
+\define@key[psset]{pst-poly}{PstPicture}[true]{\@nameuse{Pst@PstPicture#1}}
+% \end{macrocode}
+%
+% \texttt{PolyRotation} will be the rotation angle to apply to the
+% polygon. It is a \emph{real} value used as an \emph{angle}.
+%
+% \begin{macrocode}
+\define@key[psset]{pst-poly}{PolyRotation}{\edef\PstPoly@Rotation{#1}}
+% \end{macrocode}
+%
+% \texttt{PolyNbSides} will be the number of sides (edges) of the polygon.
+% It is an \emph{integer} value and we store it into a \TeX{} macro (in this
+% way, we can define a lot of integer parameters without having the risk to
+% exhaust \TeX{} limitations of numbers of counters).
+%
+% \begin{macrocode}
+\define@key[psset]{pst-poly}{PolyNbSides}{\pst@getint{#1}{\PstPoly@NbSides}}
+% \end{macrocode}
+%
+% \texttt{PolyOffset} will be the offset to obtain the next vertice to
+% connect, for each one of the polygon. It is an \emph{integer} value.
+%
+% \begin{macrocode}
+\define@key[psset]{pst-poly}{PolyOffset}{\pst@getint{#1}{\PstPoly@Offset}}
+% \end{macrocode}
+%
+% \texttt{PolyIntermediatePoint} will be the position of an intermediate
+% point to used between the current vertice and the next one, for each edge.
+% It will defined a \emph{relative} position, which will be the same for
+% each edge. As it is a \emph{real} value on which we will have to make some
+% computations, we use here a dimension register.
+%
+% \begin{macrocode}
+\newdimen\PstPoly@IntermediatePointDim
+\define@key[psset]{pst-poly}{PolyIntermediatePoint}{\edef\PstPoly@IntermediatePoint{#1}}
+% \end{macrocode}
+%
+% \texttt{PolyName} will be the name assigned to the polygon, which will be
+% useful if we would like to connect edges of different polygons. It is a
+% \texttt{string} that we store in a macro.
+%
+% \begin{macrocode}
+\define@key[psset]{pst-poly}{PolyName}{\edef\PstPoly@Name{#1}}
+% \end{macrocode}
+%
+% \texttt{PolyCurves} will define if the edges are lines or curves. It is a
+% \emph{boolean value}. And logically, there will be no effect of it if there
+% is no intermediate point defined.
+%
+% \begin{macrocode}
+\newif\ifPstPoly@Curves
+\define@key[psset]{pst-poly}{PolyCurves}[true]{\@nameuse{PstPoly@Curves#1}}
+% \end{macrocode}
+%
+% \texttt{PolyEpicycloid} will define if we will draw a polygon or an
+% epicycloid (which is of course not a polygon, but this was a functionality
+% very easy to add to this package!) It is a \emph{boolean} value.
+%
+% \begin{macrocode}
+\newif\ifPstPoly@Epicycloid
+\define@key[psset]{pst-poly}{PolyEpicycloid}[true]{\@nameuse{PstPoly@Epicycloid#1}}
+% \end{macrocode}
+%
+% Next, we set the default values for all these new parameters.
+% We choose to have no rotation, five sides, no offset (so a value of 1),
+% no intermediate point, no name, connections by lines (so no curved ones)
+% and polygons (so no epicycloids).
+%
+% \begin{macrocode}
+\psset{%
+ PstPicture=true,PolyRotation=0,PolyNbSides=5,PolyOffset=1,
+ PolyIntermediatePoint=,PolyName=,PolyCurves=false,PolyEpicycloid=false}
+%
+% \end{macrocode}
+%
+% \subsection{Main macro}
+%
+% The general \cs{PstPolygon} macro to draw polygons.
+%
+% First we look if the \texttt{*} convention is used, as for many PSTricks
+% macros, to fill the graphic object using the current color of the line.
+%
+% \begin{macro}{\PstPolygon}
+% \begin{macrocode}
+%
+\def\PstPolygon{\pst@ifstar{\@ifnextchar[{\PstPolygon@i}{\PstPolygon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% Then we define the auxiliary macro which will handle the parameters if
+% some are used. Note also the usage of the double \verb+{{+ to have only
+% changes of parameter values for this specific object, as redefinitions
+% of them must be local.
+%
+% \begin{macro}{\PstPolygon@i}
+% \begin{macrocode}
+\def\PstPolygon@i[#1]{{%
+% \end{macrocode}
+%
+% After that, we can set the values of local parameters if defined and
+% take account of the \texttt{*} convention if used.
+%
+% \begin{macrocode}
+\psset{#1}%
+\if@star\solid@star\fi
+% \end{macrocode}
+%
+% For security, we make some checks on the validity of the parameters.
+%
+% \begin{macrocode}
+\ifnum\PstPoly@NbSides<3
+ \@pstrickserr{PolyNbSides must be greater than 2
+ (and not `\PstPoly@NbSides')}{\@eha}%
+\fi
+\ifnum\PstPoly@NbSides>200
+ \@pstrickserr{PolyNbSides must be less than 201
+ (and not `\PstPoly@NbSides')}{\@eha}%
+\fi
+\ifnum\PstPoly@Offset<1
+ \@pstrickserr{PolyOffset must be greater than 0
+ (and not `\PstPoly@Offset')}{\@eha}%
+\fi
+% \end{macrocode}
+%
+% And now, we can start the \emph{real} code. First we affect a special
+% value for the case where an offset will be used. There are only two cases,
+% as the offset can be \emph{odd} or \emph{even}.
+%
+% \begin{macrocode}
+\ifodd\PstPoly@Offset
+ \def\PstPoly@Decimal{.5}%
+\else
+ \def\PstPoly@Decimal{}%
+\fi
+% \end{macrocode}
+%
+% We must say to use non cartesian coordinates (we will used polar ones
+% --- and special ones computed by trigonometry and defined in PostScript
+% for \emph{non} regular polygons).
+%
+% \begin{macrocode}
+%
+\SpecialCoor
+% \end{macrocode}
+%
+% We look at the definition of a ``\texttt{pspicture}'' environment or not.
+%
+% \begin{macrocode}
+\ifPst@PstPicture\pspicture(-1,-1)(1,1)\fi
+% \end{macrocode}
+%
+% We rotate the polygon if necessary (if not, we will use a rotation of
+% angle 0, which will have of course no effect).
+%
+% \begin{macrocode}
+\rput{\PstPoly@Rotation}(0,0){%
+% \end{macrocode}
+%
+% We will used polar coordinates, with a unit given by the number of sides
+% of the polygon.
+%
+% \begin{macrocode}
+ \degrees[\PstPoly@NbSides]
+% \end{macrocode}
+%
+% We must recompute it here if the unit has changed after assignation
+% (for instance \verb+\psset{PolyIntermediatePoint=0.38}\PstPolygon[unit=2]+)
+%
+% \begin{macrocode}
+ \pssetlength{\PstPoly@IntermediatePointDim}{\PstPoly@IntermediatePoint}
+% \end{macrocode}
+%
+% If there is a name for this polygon, we assign this name followed by 0
+% to the center of it, and different names to all vertices, indexed by the
+% number of the vertice.
+%
+% \begin{macrocode}
+ \ifx\PstPoly@Name\@empty
+ \else
+ \pnode(0,0){\PstPoly@Name 0}
+ \ifnum\psxunit=\psyunit
+ \def\PstPoly@Node{\pnode(1;\i)}%
+ \else
+ \def\PstPoly@Node{%
+ \pnode(! \i\space 360 \PstPoly@NbSides\space div mul cos
+ \i\space 360 \PstPoly@NbSides\space div mul sin)}%
+ \fi
+ \multido{\i=0+1}{\PstPoly@NbSides}{%
+ \PstPoly@Node{\PstPoly@Name\the\multidocount}}
+ \fi
+% \end{macrocode}
+%
+% Now we are ready to draw the polygon. We use a \cs{pscustom} environment.
+%
+% \begin{macrocode}
+ \pscustom{%
+% \end{macrocode}
+%
+% First, the case of epicycloids. We must only join each vertice to the
+% opposite one, using the defined offset as gap.
+%
+% \begin{macrocode}
+ \ifPstPoly@Epicycloid
+ \pst@cnta=\PstPoly@NbSides
+ \divide\pst@cnta\tw@
+ \multido{\i=0+1}{\PstPoly@NbSides}{%
+ \moveto(1;\i)
+ \lineto(1;\the\pst@cnta)
+ \advance\pst@cnta\PstPoly@Offset}
+% \end{macrocode}
+%
+% Now, we can see the case of polygons. First, we move to the starting point.
+%
+% \begin{macrocode}
+ \else
+ \ifnum\psxunit=\psyunit
+ \moveto(1,0)
+ \else
+ \moveto(! 1 0)
+ \fi
+% \end{macrocode}
+%
+% If there is no intermediate point, we must only have a loop to join all
+% vertices, according to the number of edges. And we use each time the
+% defined value of the offset to obtain the next vertice.
+%
+% \begin{macrocode}
+ \ifx\PstPoly@IntermediatePoint\@empty
+ \ifnum\psxunit=\psyunit
+ \def\PstPoly@Junction{\lineto(1;\i)}%
+ \else
+ \def\PstPoly@Junction{\lineto%
+ (! \i\space 360 \PstPoly@NbSides\space div mul cos
+ \i\space 360 \PstPoly@NbSides\space div mul sin)}%
+ \fi
+ \multido{\i=\PstPoly@Offset+\PstPoly@Offset}{\PstPoly@NbSides}{%
+ \PstPoly@Junction}
+% \end{macrocode}
+%
+% If there is an intermediate point, first we see if vertices will be joined
+% by lines or curves.
+%
+% \begin{macrocode}
+ \else
+ \ifPstPoly@Curves
+ \let\PstPoly@JunctionType\pscurve
+ \else
+ \let\PstPoly@JunctionType\psline
+ \fi
+ \ifnum\psxunit=\psyunit
+ \def\PstPoly@Junction{\PstPoly@JunctionType%
+ (\PstPoly@IntermediatePointDim;\the\pst@cnta\PstPoly@Decimal)
+ (1;\i)}%
+ \else
+ \def\PstPoly@Junction{\PstPoly@JunctionType%
+ (! \PstPoly@IntermediatePoint\space
+ \the\pst@cnta\PstPoly@Decimal\space 360
+ \PstPoly@NbSides\space div mul cos mul
+ \PstPoly@IntermediatePoint\space
+ \the\pst@cnta\PstPoly@Decimal\space 360
+ \PstPoly@NbSides\space div mul sin mul)
+ (! \i\space 360 \PstPoly@NbSides\space div mul cos
+ \i\space 360 \PstPoly@NbSides\space div mul sin)}%
+ \fi
+% \end{macrocode}
+%
+% We compute half of the value of the offset. We use a counter for that,
+% which is an integer, so we will add the value of the \cs{PstPoly@Decimal}
+% macro defined above, which has value 0.5 if the offset is an odd number.
+%
+% \begin{macrocode}
+ \pst@cnta=\PstPoly@Offset
+ \divide\pst@cnta\tw@
+% \end{macrocode}
+%
+% Now, we can execute the main loop: for each vertice we join the current
+% one to the next, using each time the intermediate point defined.
+%
+% \begin{macrocode}
+ \multido{\i=\PstPoly@Offset+\PstPoly@Offset}{\PstPoly@NbSides}{%
+ \PstPoly@Junction
+ \advance\pst@cnta\PstPoly@Offset}
+% \end{macrocode}
+%
+% Now, we can close the opened \emph{if} structures and the
+% \texttt{pscustom} environment.
+%
+% \begin{macrocode}
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% In the case where there is a special macro of name \cs{PstPolygonNode}
+% defined, we execute it at each node, and we close the rotation command.
+% The counter used is \cs{INode}.
+%
+% \begin{macrocode}
+ \ifx\PstPolygonNode\@undefined
+ \else
+ \multido{\INode=\z@+\PstPoly@Offset}{\PstPoly@NbSides}{%
+ \PstPolygonNode}
+ \fi}
+% \end{macrocode}
+%
+% Then we close the ``\texttt{pspicture}'' environment, if defined,
+% and the \cs{PstPolygon@i} macro.
+%
+% \begin{macrocode}
+\ifPst@PstPicture
+ \endpspicture
+\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Pre-defined polygons}
+%
+% Triangle (three sides).
+%
+% \begin{macro}{\PstTriangle}
+% \begin{macrocode}
+\def\PstTriangle{%
+\pst@ifstar{\@ifnextchar[{\PstTriangle@i}{\PstTriangle@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstTriangle@i}
+% \begin{macrocode}
+\def\PstTriangle@i[#1]{{%
+\psset{PolyNbSides=3,PolyRotation=90}% For triangle (360/3*(3/4))
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Square (four sides).
+%
+% \begin{macro}{\PstSquare}
+% \begin{macrocode}
+\def\PstSquare{%
+\pst@ifstar{\@ifnextchar[{\PstSquare@i}{\PstSquare@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstSquare@i}
+% \begin{macrocode}
+\def\PstSquare@i[#1]{{%
+\psset{PolyNbSides=4,PolyRotation=45}% For square (360/4/2)
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Pentagon (five sides).
+%
+% \begin{macro}{\PstPentagon}
+% \begin{macrocode}
+\def\PstPentagon{%
+\pst@ifstar{\@ifnextchar[{\PstPentagon@i}{\PstPentagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstPentagon@i}
+% \begin{macrocode}
+\def\PstPentagon@i[#1]{{%
+\psset{PolyNbSides=5,PolyRotation=18}% For pentagon (360/5/4)
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Hexagon (six sides).
+%
+% \begin{macro}{\PstHexagon}
+% \begin{macrocode}
+\def\PstHexagon{%
+\pst@ifstar{\@ifnextchar[{\PstHexagon@i}{\PstHexagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstHexagon@i}
+% \begin{macrocode}
+\def\PstHexagon@i[#1]{{%
+\psset{PolyNbSides=6}%
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Heptagon (seven sides).
+%
+% \begin{macro}{\PstHeptagon}
+% \begin{macrocode}
+\def\PstHeptagon{%
+\pst@ifstar{\@ifnextchar[{\PstHeptagon@i}{\PstHeptagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstHeptagon@i}
+% \begin{macrocode}
+\def\PstHeptagon@i[#1]{{%
+\psset{PolyNbSides=7,PolyRotation=38.57}% For heptagon (360/7*(3/4))
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Octogon (height sides).
+%
+% \begin{macro}{\PstOctogon}
+% \begin{macrocode}
+\def\PstOctogon{%
+\pst@ifstar{\@ifnextchar[{\PstOctogon@i}{\PstOctogon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstOctogon@i}
+% \begin{macrocode}
+\def\PstOctogon@i[#1]{{%
+\psset{PolyNbSides=8,PolyRotation=22.5}% For octogon (360/8/2)
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Nonagon (nine sides).
+%
+% \begin{macro}{\PstNonagon}
+% \begin{macrocode}
+\def\PstNonagon{%
+\pst@ifstar{\@ifnextchar[{\PstNonagon@i}{\PstNonagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstNonagon@i}
+% \begin{macrocode}
+\def\PstNonagon@i[#1]{{%
+\psset{PolyNbSides=9,PolyRotation=10}% For nonagon (360/9/4)
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Decagon (ten sides).
+%
+% \begin{macro}{\PstDecagon}
+% \begin{macrocode}
+\def\PstDecagon{%
+\pst@ifstar{\@ifnextchar[{\PstDecagon@i}{\PstDecagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstDecagon@i}
+% \begin{macrocode}
+\def\PstDecagon@i[#1]{{%
+\psset{PolyNbSides=10}%
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Dodecagon (twelve sides).
+%
+% \begin{macro}{\PstDodecagon}
+% \begin{macrocode}
+\def\PstDodecagon{%
+\pst@ifstar{\@ifnextchar[{\PstDodecagon@i}{\PstDodecagon@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstDodecagon@i}
+% \begin{macrocode}
+\def\PstDodecagon@i[#1]{{%
+\psset{PolyNbSides=12,PolyRotation=15}% For dodecagon (360/12/2)
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Star with five leaves, with internal lines.
+%
+% \begin{macro}{\PstStarFiveLines}
+% \begin{macrocode}
+\def\PstStarFiveLines{%
+\pst@ifstar{\@ifnextchar[{\PstStarFiveLines@i}{\PstStarFiveLines@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstStarFiveLines@i}
+% \begin{macrocode}
+\def\PstStarFiveLines@i[#1]{{%
+\psset{PolyOffset=2,PolyRotation=18}%
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% Star with five leaves.
+%
+% \begin{macro}{\PstStarFive}
+% \begin{macrocode}
+\def\PstStarFive{%
+\pst@ifstar{\@ifnextchar[{\PstStarFive@i}{\PstStarFive@i[]}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PstStarFive@i}
+% \begin{macrocode}
+\def\PstStarFive@i[#1]{{%
+\psset{PolyIntermediatePoint=0.38,PolyRotation=18}%
+\psset{#1}%
+\if@star\solid@star\fi
+\PstPolygon}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pspolygonbox}
+% \begin{macrocode}
+\newdimen\pst@dimm
+\newdimen\pst@dimn
+\newdimen\pst@dimo
+\newdimen\pst@dimp
+\def\pspolygonbox{\pst@object{pspolygonbox}}% voss 2004-11-20
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\pspolygonbox@i}
+% \begin{macrocode}
+\def\pspolygonbox@i{\pst@makebox\pspolygonbox@ii}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pspolygonbox@ii}
+% \begin{macrocode}
+%
+\def\pspolygonbox@ii{{%
+ \begingroup%
+ \pst@useboxpar%
+ \pst@dima=\pslinewidth%
+ \ifpsdoubleline%
+ \advance\pst@dima by \psdoublesep\pslinewidth%
+ \advance\pst@dima by \pslinewidth%
+ \fi%
+ \advance\pst@dima by \psframesep%
+ \pst@dimc=\wd\pst@hbox%
+ \pst@dimp=\pst@dimc\advance\pst@dimp by 2\pst@dima%
+ \pst@dimb=\dp\pst@hbox\pst@dimo=\pst@dimb%
+ \pst@dimd=\ht\pst@hbox\advance\pst@dimo by \pst@dimd% totalheight
+ \pst@pyth\pst@dimp\pst@dimo\pst@dimm%
+ \divide\pst@dimm by 2% Radius
+ \setbox\pst@hbox=\hbox{%
+ \ifpsboxsep\kern\pst@dima\fi% left side
+ \begin@ClosedObj%
+ \addto@pscode{%
+ /framesep \pst@number\pst@dima def
+ /boxdepth \pst@number\pst@dimb framesep add def
+ /boxheight0 \pst@number\pst@dimd def
+ /boxheight boxheight0 framesep add def
+ /boxwidth \pst@number\pst@dimc def
+ /radius \pst@number\pst@dimm def
+ /order \PstPoly@NbSides\space def
+ /dAlpha 360 order div def
+ /alpha \PstPoly@Rotation\space def
+ \pst@cp
+ \tx@polygonB
+ \psline@iii
+%% \tx@Line
+ \tx@Polygon
+ }%
+ \def\pst@linetype{1}%
+ \showpointsfalse%
+ \end@ClosedObj%
+ \box\pst@hbox%
+ \ifpsboxsep\kern\pst@dima\fi%% right side
+ }%
+ \ifpsboxsep%
+ \pst@dimn=-.5\pst@dimo\advance\pst@dimn by \pst@dimb%
+ \advance\pst@dimn by 0.809\pst@dimm%
+ \dp\pst@hbox=\pst@dimn%
+ \pst@dimn=\pst@dimm\advance\pst@dimn by 0.5\pst@dimo%
+ \advance\pst@dimn by -\pst@dimb%
+ \ht\pst@hbox=\pst@dimn\fi%
+ \leavevmode%
+ \box\pst@hbox%
+ \endgroup%
+}\ignorespaces}
+%
+%
+% \begin{macro}{polygonB}
+% \begin{macrocode}
+%
+\pst@def{polygonB}<{%
+ /x1 framesep neg def
+ /x2 boxwidth framesep add def
+ /y1 boxdepth framesep add neg def
+ /y2 boxheight framesep add def
+ x2 x1 add 2 div y2 y1 add 2 div translate
+ [
+ alpha cos radius mul
+ alpha sin radius mul
+ order { /alpha alpha dAlpha add def
+ radius alpha cos mul
+ radius alpha sin mul
+ } repeat
+}>
+% \end{macrocode}
+% \end{macro}
+%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Closing}
+%
+% Catcodes restoration.
+%
+% \begin{macrocode}
+\catcode`\@=\PstAtCode\relax
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</pst-poly>
+% \end{macrocode}
+%
+% \section{\PstPolygonPackage{} test file}
+%
+% \begin{macrocode}
+%<*tst-poly>
+%% `pst-poly' test file.
+%%
+\documentclass{article}
+
+\usepackage{fancyvrb}
+\usepackage[width=18cm]{geometry}
+\usepackage{pstricks}
+\usepackage{pst-poly}
+
+% Example macros - adapted from the `fvrb-ex' package
+% ---------------------------------------------------
+
+\makeatletter
+
+% Take care that we use here the four /?_Z characters as escape
+% characters, so we can't use these characters in the examples!
+
+% 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{\jobname.tmp}
+\endgroup}
+
+\def\CenterExample{\FV@Environment{}{Example}}
+\def\endCenterExample{%
+\end{VerbatimOut}
+\begin{center}
+\Below@Example{\jobname.tmp}
+\end{center}
+\endgroup}
+
+\def\SideBySideExample{\FV@Environment{}{Example}}
+\def\endSideBySideExample{%
+\end{VerbatimOut}
+\SideBySide@Example{\jobname.tmp}
+\endgroup}
+
+\def\FVB@Example{%
+\begingroup
+\FV@UseKeyValues
+\parindent=0pt
+\multiply\topsep by 2
+\VerbatimEnvironment
+\begin{VerbatimOut}[gobble=2,codes={\catcode`\Z=12}]{\jobname.tmp}}
+
+\def\Below@Example#1{%
+\VerbatimInput[commentchar=Z,commandchars=/?_,frame=single,
+ numbers=left,numbersep=3pt]{#1}
+\catcode`\%=14\relax
+\catcode`\Z=9\relax
+% 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}%
+\input{#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`\Z=9\relax
+ % 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}%
+ \input{#1}
+\end{minipage}%
+\@tempdimb=\textwidth
+\advance\@tempdimb -\FV@XRightMargin
+\advance\@tempdimb 5mm
+\begin{minipage}[c]{\@tempdimb}
+ \VerbatimInput[commentchar=Z,commandchars=/?_,
+ frame=single,numbers=left,numbersep=3pt,
+ xleftmargin=5mm,xrightmargin=0pt]{#1}
+\end{minipage}
+\vskip 1mm}
+
+\makeatother
+
+% End of example macros from `fvrb-ex'
+
+\begin{document}
+
+% First serie
+
+\begin{CenterExample}
+ \multido{\i=3+1}{6}{%
+ \PstPolygon[PolyNbSides=\i]\hspace{5mm}}
+ \PstPolygon[PolyNbSides=30]
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=3+2}{6}{%
+ \PstPolygon[PolyOffset=2,PolyNbSides=\i]\hspace{5mm}}
+ \PstPolygon[PolyOffset=2,PolyNbSides=31]
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=3+1}{7}{%
+ \PstPolygon[PolyOffset=3,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=5+1}{7}{%
+ \PstPolygon[PolyOffset=4,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=5+2}{7}{%
+ \PstPolygon[PolyOffset=5,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\clearpage
+\begin{CenterExample}
+ \multido{\i=5+2}{7}{%
+ \PstPolygon[PolyOffset=7,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=5+2}{7}{%
+ \PstPolygon[PolyOffset=8,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=1+1}{7}{%
+ \PstPolygon[PolyOffset=\i,PolyNbSides=5]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=1+1}{7}{%
+ \PstPolygon[PolyOffset=\i,PolyNbSides=7]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=5+1}{7}{%
+ \PstPolygon[PolyCurves,PolyIntermediatePoint=0.1,PolyNbSides=\i]
+ \hspace{5mm}}
+\end{CenterExample}
+
+\clearpage
+\begin{CenterExample}
+ \multido{\i=5+1}{7}{%
+ \PstPolygon[PolyCurves,PolyIntermediatePoint=0.2,
+ PolyOffset=2,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\i=5+2}{7}{%
+ \PstPolygon[PolyCurves,PolyIntermediatePoint=0.1,
+ PolyOffset=3,PolyNbSides=\i]\hspace{5mm}}
+\end{CenterExample}
+
+% Second serie
+
+\begin{CenterExample}
+ \multido{\n=-1.4+0.5}{7}{%
+ \PstPolygon[PolyNbSides=3,PolyOffset=2,PolyIntermediatePoint=\n]
+ \hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\n=-1.4+0.5}{7}{%
+ \PstPolygon[PolyNbSides=5,PolyOffset=2,PolyIntermediatePoint=\n]
+ \hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\n=-1.4+0.5}{7}{%
+ \PstPolygon[PolyNbSides=13,PolyOffset=2,PolyIntermediatePoint=\n]
+ \hspace{5mm}}
+\end{CenterExample}
+
+\begin{CenterExample}
+ \multido{\n=-1.4+0.5}{7}{%
+ \PstPolygon[PolyNbSides=21,PolyOffset=2,PolyIntermediatePoint=\n]
+ \hspace{5mm}}
+\end{CenterExample}
+
+% Third serie
+
+\begin{CenterExample}
+ \psset{unit=1.4,linewidth=0.001,PolyNbSides=72,PolyEpicycloid}
+ \multido{\i=2+1}{4}{%
+ % Epicycloid of factor 1 is cardioid and of factor 2 nephroid
+ \PstPolygon[PolyOffset=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\begin{SideBySideExample}[xrightmargin=5cm]
+ % Epicycloid of factor 10
+ \PstPolygon[unit=2,linewidth=0.003,
+ PolyEpicycloid,PolyNbSides=72,PolyOffset=11]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}[xrightmargin=5cm]
+ % Epicycloid of factor 22
+ \PstPolygon[unit=2,linewidth=0.003,
+ PolyEpicycloid,PolyNbSides=72,PolyOffset=23]
+\end{SideBySideExample}
+
+\clearpage
+\begin{CenterExample}
+ \psset{unit=1.9,linewidth=0.001,PolyNbSides=72,PolyEpicycloid}
+ \multido{\i=71+1}{3}{%
+ \PstPolygon[PolyOffset=\i]\hspace{5mm}}
+\end{CenterExample}
+
+\fvset{xrightmargin=5cm} % 5cm reserved for the graphic
+
+\begin{SideBySideExample}
+ % Epicycloid of factor 100
+ \PstPolygon[unit=2,linewidth=0.003,
+ PolyEpicycloid,PolyNbSides=72,PolyOffset=101]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}[xrightmargin=5cm]
+ % Epicycloid of factor 153
+ \PstPolygon[unit=2,linewidth=0.003,
+ PolyEpicycloid,PolyNbSides=72,PolyOffset=154]
+\end{SideBySideExample}
+
+\clearpage
+
+% Fourth serie
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \psdots[dotsize=0.2,linecolor=cyan](1;\INode)}
+ \PstPentagon[unit=2]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \rput{*0}(1.2;\INode){\small\the\multidocount}}
+ \PstPolygon[unit=2,PolyNbSides=7,PolyOffset=2]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \rput*{*0}(1;\INode){\small\the\multidocount}}
+ \PstHeptagon[unit=2,PolyOffset=2]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \newcounter{Letter}
+ \providecommand{\PstPolygonNode}{%
+ \setcounter{Letter}{\the\multidocount}%
+ \rput*{*0}(1;\INode){\small\Alph{Letter}}}
+ \PstHeptagon[unit=2,PolyOffset=3]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \SpecialCoor
+ \degrees[3]
+ \rput{0.5}(0.5;\INode){%
+ \pspolygon*(0.5;0.5)(0.5;1.5)(0.5;2.5)}}
+ \PstTriangle
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \psdots[dotstyle=o,dotsize=0.2](1;\INode)
+ \psline[linecolor=red]{->}(0.9;\INode)}
+ \PstPolygon[unit=2,PolyNbSides=8]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \providecommand{\PstPolygonNode}{%
+ \psline[linewidth=0.1mm,doubleline=true,
+ linecolor=green]{<->}(0;0)(1;\INode)}
+ \PstHexagon[unit=2]
+\end{SideBySideExample}
+
+\begin{SideBySideExample}
+ \newbox{\Star}
+ \savebox{\Star}{%
+ \PstStarFive*[unit=0.15,linecolor=red]}
+ \providecommand{\PstPolygonNode}{%
+ \rput{*0}(1;\INode){\usebox{\Star}}}
+ \shortstack{%
+ \PstNonagon\\[5mm]
+ \PstDodecagon[linestyle=none]}
+\end{SideBySideExample}
+
+\end{document}
+%</tst-poly>
+% \end{macrocode}
+%
+%
+% \Finale
+% \PrintIndex
+% \PrintChanges
+%
+\endinput
+%%
+%% End of file `pst-poly.dtx'
diff --git a/Master/texmf-dist/source/latex/pst-poly/pst-poly.ins b/Master/texmf-dist/source/latex/pst-poly/pst-poly.ins
new file mode 100644
index 00000000000..881fbeaca83
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-poly/pst-poly.ins
@@ -0,0 +1,38 @@
+%% `pst-poly.ins'
+%%
+%% Docstrip installation instruction file for docstyle `pst-poly'
+%%
+%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
+%%
+%% February 19, 2001
+
+\def\batchfile{pst-poly.ins}
+\input docstrip.tex
+\keepsilent
+\Msg{*** Generating the `pst-poly' package ***}
+\askforoverwritefalse
+\generate{\file{pst-poly.tex}{\from{pst-poly.dtx}{pst-poly}}}
+\generate{\file{pst-poly.sty}{\from{pst-poly.dtx}{latex-wrapper}}}
+\generate{\file{tst-poly.tex}{\from{pst-poly.dtx}{tst-poly}}}
+
+\ifToplevel{%
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the files}
+\Msg{* pst-poly.sty and pst-poly.tex in a directory/folder searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation, run the file `pst-poly.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-poly'}
+\Msg{* `makeindex -s gglo.ist -o pst-poly.gls pst-poly.glo'}
+\Msg{* and recompile.}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endinput
+%%
+%% End of file `pst-poly.ins'
diff --git a/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
new file mode 100644
index 00000000000..ee9d71c9c04
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/ltxdocext.dtx
@@ -0,0 +1,1208 @@
+% \iffalse &pdflatex ltxdoc klootch
+% ltxdocext.dtx: package to extend the ltxdoc class of standard LaTeX
+% Copyright (c) 1999 Arthur Ogawa
+%
+% Disclaimer
+% This file is distributed WITHOUT ANY WARRANTY;
+% without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+% ReadMe
+% For the documentation and more detailed instructions for
+% installation, typeset this document with \LaTeX.
+% \fi
+% \CheckSum{938}
+%% \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 \~}%
+%
+% \iffalse ltxdoc klootch
+%%% @LaTeX-file{
+%%% filename = "ltxdocext.dtx",
+%%% version = "0.0a0",
+%%% date = "1999/06/04",
+%%% time = "11:23:00 GMT",
+%%% checksum = "929",
+%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com)",
+%%% copyright = "Copyright (C) 1999 Arthur Ogawa,
+%%% all rights reserved. Copying of this file is
+%%% authorized only if either:
+%%% (1) you make absolutely no changes to your copy,
+%%% including name; OR
+%%% (2) if you do make changes, you first rename it
+%%% to some other name.",
+%%% address = "Arthur Ogawa,
+%%% USA",
+%%% telephone = "",
+%%% FAX = "",
+%%% email = "ogawa@teleport.com",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "latex, ltxdoc",
+%%% supported = "yes",
+%%% abstract = "extensions to the ltxdoc class",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+% \fi
+%
+% \iffalse ltxdoc klootch
+% The following references the \file{00readme.txt} file,
+% which contains basic information about this package.
+% The contents of this file are generated when
+% you typeset the programmer's documentation.
+% Search on "{filecontents*}{00readme.txt}" to locate it.
+% \fi\input{00readme.txt}%
+%
+% \subsection{Bill of Materials}
+%
+% Following is a list of the files in this distribution arranged
+% according to provenance.
+%
+% \subsubsection{Primary Source}%
+% One single file generates all.
+%\begin{verbatim}
+%ltxdocext.dtx
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{latex ltxdocext.dtx}}%
+% Typesetting the source file under \LaTeX\
+% generates the readme and the installer.
+%\begin{verbatim}
+%00readme.txt ltxdocext.ins
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{tex ltxdocext.ins}}%
+% Typesetting the installer generates
+% the package files.
+%\begin{verbatim}
+%ltxdocext.sty acrofont.sty
+%\end{verbatim}
+%
+% \subsubsection{Documentation}%
+% The following are the online documentation:
+% \begin{verbatim}
+%ltxdocext.pdf
+% \end{verbatim}
+%
+% \subsubsection{Auxiliary}%
+% The following are auxiliary files generated
+% in the course of running \LaTeX:
+% \begin{verbatim}
+%ltxdocext.aux ltxdocext.idx ltxdocext.ind ltxdocext.log ltxdocext.toc
+% \end{verbatim}
+%
+% \section{Code common to all modules}%
+%
+% The following may look a bit klootchy, but we
+% want to require only one place in this file
+% where the version number is stated,
+% and we also want to ensure that the version
+% number is embedded into every generated file.
+%
+% Now we declare that
+% these files can only be used with \LaTeXe.
+% An appropriate message is displayed if
+% a different \TeX{} format is used.
+% \begin{macrocode}
+%<*doc|extensions|fonts>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%</doc|extensions|fonts>
+% \end{macrocode}
+% As desired, the following modules all
+% take common version information:
+% \begin{macrocode}
+%<extensions>\ProvidesFile{ltxdocext.sty}%
+%<fonts>\ProvidesFile{acrofont.sty}%
+%<*doc>
+\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+%</doc>
+% \end{macrocode}
+%
+% The following line contains, for once and for all,
+% the version and date information.
+% By various means, this information is reproduced
+% consistently in all generated files and in the
+% typeset documentation.
+% \begin{macrocode}
+ [1999/06/04 0.0a0 ltxdoc extensions package]% \fileversion
+% \end{macrocode}
+%
+%
+% \section{The driver module \texttt{doc}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{.ins} installer and \file{00readme.txt} as required.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{doc} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``doc'' {\sc docstrip} module.
+% Module delimiters are nonetheless required so that
+% this code does not find its way into the other modules.
+%
+% The \enve{document} command concludes the typesetting run.
+%
+% \begin{macrocode}
+%<*doc>
+% \end{macrocode}
+%
+% \subsection{Stubs for \file{ltxdocext.sty} and \file{acrofont.sty}}
+%
+% This \env{filecontents} environment generates stub files
+% \file{ltxdocext.sty} and \file{acrofont.sty}.
+% Stubs are needed because the documentation for this package
+% requires them and they might not yet be present.
+%
+% A real version of these files will be generated
+% when you typeset \file{ltxdocext.ins}, at which point
+% the stub file will be overwritten (you will have to give {\sc docstrip}
+% permission to do this).
+% \begin{macrocode}
+\begin{filecontents}{ltxdocext.sty}
+% Stub version of ltxdocext.sty
+\end{filecontents}
+\begin{filecontents}{acrofont.sty}
+% Stub version of acrofont.sty
+\end{filecontents}
+% \end{macrocode}
+%
+% \subsection{The Preamble}
+% The programmers documentation is formatted
+% with the \classname{ltxdoc} class with local customizations,
+% and with the usual code line indexing.
+% \begin{macrocode}
+\documentclass[draft]{ltxdoc}
+\RequirePackage{ltxdocext}%
+\RequirePackage{acrofont}%
+\CodelineIndex\EnableCrossrefs
+% \end{macrocode}
+%
+% \subsubsection{Docstrip and info directives}
+% We use so many {\sc docstrip} modules that we set the
+% \texttt{StandardModuleDepth} counter to 1.
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+% \end{macrocode}
+% The following command retrieves the date and version information
+% from this file.
+% \begin{macrocode}
+\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
+% \end{macrocode}
+%
+%
+% \subsection{The installer file}
+%
+% The installer \file{ltxdocext.ins} appears here.
+% If you have retrieved the standard distribution of this package,
+% the installer file is already on your filesystem.
+% If you are bootstrapping,
+% the first typesetting of the \file{.dtx} file
+% will cause the installer to be generated.
+%
+% The following modules are used to direct
+% {\sc docstrip} in generating the external files:
+% \begin{center}
+% \begin{tabular}{lll}
+% \textbf{Module}&\textbf{File}&\textbf{Description}\\
+% doc &\file{ltxdocext.drv}&driver for programmer's documantation\\
+% extensions&\file{ltxdocext.sty}&ltxdoc extensions package\\
+% fonts &\file{acrofont.sty} &package to use only Acrobat fonts
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\begin{filecontents}{ltxdocext.ins}
+%% This file will generate documentation and runtime files
+%% from ltxdocext.dtx when run through LaTeX or TeX.
+\input docstrip
+\preamble
+
+This is a generated file;
+altering it directly is inadvisable;
+instead, modify the original source file.
+See the URL in the file 00readme.txt.
+
+Copyright notice.
+
+ These files are distributed
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+\endpreamble
+\keepsilent
+ \generate{%
+ \file{ltxdocext.drv}{\from{ltxdocext.dtx}{doc}}%
+ \file{ltxdocext.sty}{\from{ltxdocext.dtx}{extensions}}%
+ \file{acrofont.sty}{\from{ltxdocext.dtx}{fonts}}%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxdocext.sty}
+\Msg{* into a directory searched by TeX.}
+\Msg{*}
+\Msg{* To produce the user documentation,
+ run ltxdocext.tex through LaTeX.}
+\Msg{*}
+\Msg{* To produce the programmer documentation,
+ run ltxdocext.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+\end{filecontents}
+% \end{macrocode}
+% Note that, because all of the files generated by the installer
+% are part of the standard distribution, it will
+% be necessary to run the installer only when bootstrapping
+% (or, of course, during development).
+% Note, too, that it is rare to generate the \file{doc}
+% module because it suffices to simply typeset the \file{.dtx} file itself.
+%
+% \subsection{The ``Read Me'' File}
+% As promised above, here is the contents of the
+% ``Read Me'' file. That file serves a double purpose,
+% since it also constitutes the beginining of the
+% programmer's documentation. What better thing, after
+% all, to have appear at the beginning of the
+% typeset documentation?
+%
+% A good discussion of how to write a ReadMe file can be found in
+% Engst, Tonya, ``Writing a ReadMe File? Read This''
+% \emph{MacTech} October 1998, p. 58.
+%
+% Note the appearance of the
+% \cmd\StopEventually\ command, which marks the
+% dividing line between the user documentation
+% and the programmer documentation.
+%
+% The usual user will not be asked to
+% do a full build, not to speak
+% of the bootstrap.
+% Instructions for carrying these processes
+% begin the programmer's manual.
+%
+% \begin{macrocode}
+\begin{filecontents*}{00readme.txt}
+\title{%
+ Extensions to the \classname{ltxdoc} class%
+ \thanks{%
+ This file has version number \fileversion,
+ last revised \filedate.%
+ % For version number and date, search on "\fileversion" in the .dtx file,
+ % or see the end of the 00readme.txt file.
+ }%
+}%
+
+\author{%
+Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
+\fileversion\\Copyright (C) 1999 Arthur Ogawa
+}%
+\maketitle
+
+This file embodies the \classname{ltxdocext} package,
+the implementation and its user documentation.
+
+The distribution point for this work is
+\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxdocext...},
+which contains fully unpacked, prebuilt runtime files and documentation.
+
+To use this document class, you must have a working
+\TeX\ installation equipped with \LaTeXe\
+and possibly pdftex and Adobe Acrobat Reader or equivalent.
+
+To install, retrieve the distribution,
+unpack it into a directory on the target computer,
+and move the files \file{ltxdocext.sty} and \file{acrofont.sty}
+into a location in your filesystem where they will be found by \LaTeX.
+
+If you will be using the \classname{acrofont} package, you must
+also install the virtual fonts
+\file{zpsynocmrv}, \file{zptmnocmr},
+\file{zptmnocmrm}, and \file{zpzcnocmry}.
+The corresponding \file{.tfm}, \file{.vf}, and \file{.vpl}
+files are part of this distribution.
+
+To use, read the user documentation \file{ltxdocext.pdf}.
+The \file{.dtx} file, \file{ltxdocext.dtx}, constitutes
+in itself an instance of use of the \classname{ltxdocext}
+package and the \classname{acrofont} package.
+
+\tableofcontents
+
+\section{Processing Instructions}
+
+The package files \file{ltxdocext.sty} and \file{acrofont.sty}
+are generated from this file, \file{ltxdocext.dtx},
+via the {\sc docstrip} facility of \LaTeX
+via |tex ltxdocext.ins|.
+The typeset documentation that you are now reading is generated from
+the same file by typesetting it with \LaTeX\ or pdftex
+via |latex ltxdocext.dtx| or |pdflatex ltxdocext.dtx|.
+
+\subsection{Build Instructions}
+
+You may bootstrap this suite of files solely from \file{ltxdocext.dtx}.
+Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
+then carry out the following steps:
+\begin{enumerate}
+\item
+Within an otherwise empty directory,
+typeset \file{ltxdocext.dtx} with \LaTeX\ or pdflatex;
+you will obtain the typeset documentation you are now reading,
+along with
+the installer \file{ltxdocext.ins},
+and the file \file{00readme.txt}.
+\item
+Now typeset \file{ltxdocext.ins},
+thereby generating the package file \file{ltxdocext.sty},
+and the package file \file{acrofont.sty}.
+Make sure that {\sc docstrip} receives permission
+to overwrite existing versions of these packages.
+\item
+Install \classname{ltxdocext.sty} and \classname{acrofont.sty}
+by moving them to a location
+in your filesystem where they will be found by \LaTeX.
+\item
+Now complete the typesetting of the documentation by
+retypesetting \file{ltxdocext.dtx}.
+Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+\LaTeX\ again in order to obtain a valid index and table of contents.
+\end{enumerate}
+\end{filecontents*}
+% \end{macrocode}
+%
+% \subsection{The Document Body}
+%
+% Here is the document body, containing only a
+% \cmd\DocInput\ directive---referring to this very file.
+% This very cute self-reference is a common \classname{ltxdoc} idiom.
+% \begin{macrocode}
+\begin{document}%
+\expandafter\DocInput\expandafter{\jobname.dtx}%
+% ^^A\PrintChanges
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</doc>
+% \end{macrocode}
+%
+% \section{Using the \classname{ltxdoc} and \classname{acrofont} packages}%
+% These packages are an adjunct to the
+% standard \LaTeX\ \classname{ltxdoc} class and may be
+% simply invoked as follows:
+%\begin{verbatim}
+%\documentclass[draft]{ltxdoc}
+%\RequirePackage{ltxdocext}%
+%\RequirePackage{acrofont}%
+%\CodelineIndex\EnableCrossrefs
+%\end{verbatim}
+%
+% Your document should simply cleave to the standards of the
+% \classname{ltxdoc} class, with extensions and alterations as noted.
+%
+% \subsection{Extensions to the \classname{ltxdoc} class}%
+%
+% \subsubsection{Extensions to the \env{verbatim} environment and \cs{verb} command}%
+%
+% The delimiters \verb$<<$ and \verb$>>$ within the scope of the verbatim environment
+% or within the argument of the \cmd\verb\ command produce
+% italics surrounded by angle brackets.
+% This typographic convention usually indicates
+% \emph{metalanguage}, i.e., a placeholder.
+%
+% To obtain the angle bracket character per se,
+% double the character, viz., ``\verb$the delimiter \verb+<<<<+$''.
+%
+% \subsubsection{The -\texttt{matter} Commands Work}
+% The sectioning commands \cmd\frontmatter, \cmd\mainmatter, and \cmd\backmatter
+% of the standard \LaTeX\ \classname{book} class are operative in the
+% \classname{ltxdoc} class.
+%
+% \subsubsection{The \cs{GetFileInfo} command}\label{sec:GetFileInfo}
+% You can use the \cmd\GetFileInfo\ command to extract
+% the date, version, and file info of a file which has registered itself
+% via the \cmd\ProvidesFile\ or \cmd\ProvidesClass\ command
+% (employing the optional argument thereto).
+%
+% For instance, if your document contains the following:
+%\begin{verbatim}
+%\RequirePackage{ltxdocext}%
+%\GetFileInfo{ltxdocext.sty}%
+%\end{verbatim}
+% then the following control sequence names will have
+% a value corresponding to that package's \cmd\ProvidesFile\
+% command:
+% \cmd\filedate: the file's date,
+% \cmd\fileversion: the file's version, and
+% \cmd\fileinfo: the file's info.
+%
+% \subsubsection{Self-Indexing Commands}%
+% Certain commands automatically produce an index entry
+% (or several related entries) according to the meaning.
+%
+% \begin{unnumtable}
+% \begin{tabular}{ll}
+% meta-text &\cmd\m\arg{text}\\
+% command &\cmd\cmd\cmd\csname\\
+% environment name &\cmd\env\arg{name}\\
+% \cmd\begin\verb`{foo}`&\cmd\envb\arg{foo}\\
+% \cmd\end\verb`{foo}` &\cmd\enve\arg{foo}\\
+% argument &\cmd\arg\arg{name}\\
+% optional &\cmd\oarg\arg{name}\\
+% filename &\cmd\file\arg{name}\\
+% url &\cmd\url\arg{name}\\
+% document class &\cmd\classname\arg{name}\\
+% document substyle &\cmd\substyle\arg{name}\\
+% class option &\cmd\classoption\arg{name}
+% \end{tabular}
+% \end{unnumtable}
+%
+% \subsubsection{Unnumbered Tables}%
+%
+% When your documentation requires the use of an unnumbered table,
+% use the \env{unnumtable} environment:
+% \begin{verbatim}
+%\begin{unnumtable}
+%\begin{tabular}{ll}
+%<table rows>
+%\end{tabular}
+%\end{unnumtable}
+% \end{verbatim}
+%
+% \subsubsection{Structuring Tables}%
+% The commands \cmd\toprule, \cmd\colrule, and \cmd\botrule
+% allow you to mark the beginning of the column heads
+% the beginning of the table body, and the end of
+% the table body, respectively.
+% In context,
+% \begin{verbatim}
+%\begin{tabular}{ll}
+%\toprule
+%<table head rows>
+%\colrule
+%<table rows>
+%\botrule
+%\end{tabular}
+% \end{verbatim}
+%
+% \subsubsection{A Sectioning Command Below \cs{subsection}}%
+% The \cmd\subsubsection\ command is defined.
+%
+%
+% \subsection{Alterations to the \classname{ltxdoc} class}%
+% The following involve no new markup, but they
+% do change the appearance of your formatted documentation:
+% \begin{enumerate}
+% \item
+% Using the \classname{acrofont} package causes your
+% document to be formatted using the standard
+% Acrobat fonts to the greatest extent possible.
+% This means that for most documents, Computer Modern
+% is not used at all.
+% Math that unavoidable must use CM still exists, however.
+% \item
+% An index will be produced at the end of the document
+% without your needing to explicitly mark it up, and
+% it will have an entry in the TOC.
+% \item
+% The \env{quote} environment has a slightly smaller left margin.
+% \item
+% Array columns are set tight by default.
+% \item
+% A host of \cmd\DoNotIndex\ directives are invoked.
+% I intend this list to grow to encompass
+% even more commands. Send me your suggestions.
+% \end{enumerate}
+%
+%
+%
+%\StopEventually{}
+%
+% \section{Extensions to the ltxdoc class}
+% The \file{extensions} {\sc docstrip} module comprises the
+% package \classname{ltxdocext.sty}, which provides extensions
+% to the standard \LaTeX\ \classname{ltxdoc} class.
+%
+% \subsection{Beginning of the \file{extensions} {\sc docstrip} module}
+% \begin{macrocode}
+%<*extensions>
+\def\class@name{ltxdocext}%
+\expandafter\PackageInfo\expandafter{\class@name}{%
+ An extension to the \protect\LaTeXe\space ltxdoc class
+ by A. Ogawa (ogawa@teleport.com)%
+}%
+% \end{macrocode}
+%
+% \subsection{Incorporate \classname{ltxguide.cls} extensions}
+%
+% Code extracted from \classname{ltxguide.cls}, by Alan Jeffrey.
+% ``This code stolen from \classname{ltxguide.cls}:
+% Some hacks with verbatim... NB: this would be better done with the
+% verbatim package, but this document has to run on any \LaTeX
+% installation.''
+% \begin{macrocode}
+\RequirePackage{verbatim}%
+\let\o@verbatim\verbatim
+\def\verbatim{%
+ \ifhmode\unskip\par\fi
+% \nopagebreak % Overridden by list penalty
+ \ifx\@currsize\normalsize
+ \small
+ \fi
+ \o@verbatim
+}%
+% \end{macrocode}
+%
+% Here we extend the font-setting command to include making \texttt{<>} active
+% (i.e., adjusting the input encoding).
+% \begin{macrocode}
+\renewcommand \verbatim@font {%
+ \normalfont \ttfamily
+ \catcode`\<=\active
+ \catcode`\>=\active
+}%
+% \end{macrocode}
+%
+% Make \verb$|...|$ a synonym for \cmd\verb\verb$|...|$.
+% \begin{macrocode}
+\RequirePackage{shortvrb}
+\AtBeginDocument{%
+ \MakeShortVerb{\|}%
+}%
+% \end{macrocode}
+%
+% Make active bracket characters produce italics surrounded by angle brackets
+% (used in \env{verbatim} and \cmd\verb).
+% \verb|<<| produces a less-than, and \verb|>>| produces a greater-than.
+% \begin{macrocode}
+\begingroup
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \gdef<{\@ifnextchar<\@lt\@meta}
+ \gdef>{\@ifnextchar>\@gt\@gtr@err}
+ \gdef\@meta#1>{\m{#1}}
+ \gdef\@lt<{\char`\<}
+ \gdef\@gt>{\char`\>}
+\endgroup
+\def\@gtr@err{%
+ \ClassError{ltxguide}{%
+ Isolated \protect>%
+ }{%
+ In this document class, \protect<...\protect>
+ is used to indicate a parameter.\MessageBreak
+ I've just found a \protect> on its own.
+ Perhaps you meant to type \protect>\protect>?
+ }%
+}
+\def\verbatim@nolig@list{\do\`\do\,\do\'\do\-}
+% \end{macrocode}
+% End of code stolen from \file{ltxguide.cls}. Thanks, Alan.
+%
+% Add functionality from doc.dtx:
+% (code stolen from doc.dtx):
+% \begin{macrocode}
+\def\GetFileInfo#1{%
+ \def\filename{#1}%
+ \def\@tempb##1 ##2 ##3\relax##4\relax{%
+ \def\filedate{##1}%
+ \def\fileversion{##2}%
+ \def\fileinfo{##3}}%
+ \edef\@tempa{\csname ver@#1\endcsname}%
+ \expandafter\@tempb\@tempa\relax? ? \relax\relax}
+% \end{macrocode}
+% (end of code stolen from doc.dtx. Thanks FMi.)
+%
+% Various forms of self-indexing commands:
+% \begin{macrocode}
+\DeclareRobustCommand{\m}[1]{%
+ \meta{#1}%
+ \index{#1=\string\meta{#1} placeholder}\index{placeholder>#1=\string\meta{#1}}%
+}%
+\DeclareRobustCommand\meta[1]{%
+ \mbox{\LANGLE\itshape#1\/\RANGLE}%
+}%
+\def\LANGLE{$\langle$}%
+\def\RANGLE{$\rangle$}%
+\DeclareRobustCommand{\arg}[1]{%
+ {\ttfamily\string{}\meta{#1}{\ttfamily\string}}%
+ \index{#1=\string\ttt{#1}, argument}\index{argument>#1=\string\ttt{#1}}%
+}%
+\let\oarg\undefined
+\DeclareRobustCommand{\oarg}[1]{%
+ {\ttfamily[%]
+ }\meta{#1}{\ttfamily%[
+ ]}%
+ \index{#1=\string\ttt{#1}, optional argument}%
+ \index{argument, optional>#1=\string\ttt{#1}}%
+}%
+\DeclareRobustCommand\cmd{\begingroup\makeatletter\@cmd}%
+\def\@cmd#1{%
+ \endgroup
+ \cs{\expandafter\cmd@to@cs\string#1}%
+ \expandafter\cmd@to@index\string#1\@nil
+}%
+\def\cmd@to@cs#1#2{\char\number`#2\relax}%
+\def\cmd@to@index#1#2\@nil{%
+ \index{#2=\string\cmd#1#2}%\index{command>#2=\string\cmd#1#2}%
+}%
+\DeclareRobustCommand\cs[1]{{\ttfamily\char`\\#1}}%
+\def\scmd#1{%
+ \cs{\expandafter\cmd@to@cs\string#1}%
+ \expandafter\scmd@to@index\string#1\@nil
+}%
+\def\scmd@to@index#1#2\@nil#3{%
+ \index{\string$#3=\string\cmd#1#2---#3}%
+%\index{command>\string$#3=\string\cmd#1#2---#3}%
+}%
+\DeclareRobustCommand\env{\name@idx{environment}}%
+\DeclareRobustCommand\envb[1]{%
+ {\ttfamily\string\begin\string{}\env{#1}{\ttfamily\string}}%
+}%
+\DeclareRobustCommand\enve[1]{{\ttfamily\string\end\string{}\env{#1}{\ttfamily\string}}}%
+\DeclareRobustCommand*{\file}[1]{%
+ {\ttfamily#1}%
+ \index{#1=\string\ttt{#1}}\index{file>#1=\string\ttt{#1}}%
+}%
+\DeclareRobustCommand\substyle{\name@idx{document substyle}}%
+\DeclareRobustCommand\classoption{\name@idx{document class option}}%
+\DeclareRobustCommand\classname{\name@idx{document class}}%
+\def\name@idx#1#2{%
+ {\ttfamily#2}%
+ \index{#2\space#1=\string\ttt{#2}\space#1}\index{#1>#2=\string\ttt{#2}}%
+}%
+\DeclareRobustCommand\url@ltxdocext{\begingroup\catcode`\/\active\catcode`\.\active\catcode`\:\active\@url}%
+\AtBeginDocument{%
+ \ifx\url\undefined\let\url\url@ltxdocext\fi
+}%
+\def\@url#1{%
+ \url@break{\ttfamily#1}%
+ \url@char\edef\@tempa{#1=\string\url{#1}}%
+ \expandafter\index\expandafter{\@tempa}%
+ \expandafter\index\expandafter{\expandafter u\expandafter r\expandafter l\expandafter >\@tempa}%
+ \endgroup
+}%
+{\catcode`\:\active\aftergroup\def\aftergroup:}{\active@colon}%
+\def\colon@break{\colon@char\allowbreak}%
+\def\colon@char{:}%
+{\catcode`\/\active\aftergroup\def\aftergroup/}{\active@slash}%
+\def\slash@break{\slash@char\allowbreak}%
+\def\slash@char{/}%
+{\catcode`\.\active\aftergroup\def\aftergroup.}{\active@dot}%
+\def\dot@break{\dot@char\allowbreak}%
+\def\dot@char{.}%
+\def\url@break{\let\active@slash\slash@break\let\active@dot\dot@break\let\active@colon\colon@break}%
+\def\url@char{\let\active@slash\slash@char\let\active@dot\dot@char\let\active@colon\colon@char}%
+% \end{macrocode}
+%
+% \subsection{Changes to the base class of the ltxdoc class}
+% Modify \env{theindex} environment so that it produces a TOC entry
+% \begin{macrocode}
+\renewenvironment{theindex}
+ {\if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \columnseprule \z@
+ \columnsep 35\p@
+\def\see##1##2{\textit{See} ##1}%
+\def\seealso##1##2{\textit{See also} ##1}%
+\def\cmd##1{\cs{\expandafter\cmd@to@cs\string##1}}%
+\def\@url##1{\url@break\ttt{##1}\endgroup}%
+\def\ttt##1{{\ttfamily##1}}%
+\mathchardef\save@secnumdepth\c@secnumdepth
+\c@secnumdepth\m@ne
+ \twocolumn[\section{\indexname}]%
+% \@mkboth{\MakeUppercase\indexname}%
+% {\MakeUppercase\indexname}%
+\c@secnumdepth\save@secnumdepth
+ \thispagestyle{plain}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \let\item\@idxitem}
+ {\if@restonecol\onecolumn\else\clearpage\fi}
+\renewenvironment{quote}
+ {\list{}{%
+ \leftmargin1em\relax
+ \rightmargin\leftmargin
+ }%
+ \item\relax}
+ {\endlist}
+% \end{macrocode}
+%
+% \subsection{Extensions to the base class of \classname{ltxdoc.cls}}
+%
+% Matter commands from \classname{book.cls}
+% \begin{macrocode}
+\newif\if@mainmatter
+\newif\if@openright
+\@openrighttrue
+\DeclareRobustCommand\frontmatter{%
+ \cleartorecto
+ \@mainmatterfalse
+ \pagenumbering{roman}%
+}%
+\DeclareRobustCommand\mainmatter{%
+ \cleartorecto
+ \@mainmattertrue
+ \pagenumbering{arabic}%
+}%
+\DeclareRobustCommand\backmatter{%
+ \if@openright
+ \cleartorecto
+ \else
+ \clearpage
+ \fi
+ \@mainmatterfalse
+}%
+\ifx\undefined\cleartorecto
+ \def\cleartorecto{\cleardoublepage}%
+\fi
+% \end{macrocode}
+%
+% Unnumbered tables
+%
+% \begin{environment}{unnumtable}
+% An unnumbered table does not float.
+% \begin{macrocode}
+\def\@to{to}%
+\newenvironment{unnumtable}{%
+ \par
+ \addpenalty\predisplaypenalty
+ \addvspace\abovedisplayskip
+ \hbox\@to\hsize\bgroup\hfil\ignorespaces
+ \let\@Hline\@empty
+}{%
+ \unskip\hfil\egroup
+ \penalty\postdisplaypenalty
+ \vskip\belowdisplayskip
+ \aftergroup\ignorespaces
+ \@endpetrue
+}%
+% \end{macrocode}
+% \end{environment}
+%
+% Emulate \cmd\toprule\ and friends
+% \begin{macrocode}
+\newcommand\toprule{\hline\hline}%
+\newcommand\colrule{\\\hline}%
+\newcommand\botrule{\\\hline\hline}%
+% \end{macrocode}
+%
+% Define sectioning command below \cmd\subsubsection.
+% \begin{macrocode}
+\DeclareRobustCommand\subsubsubsection{%
+ \@startsection{subsubsection}{4}%
+ {\z@}{-15\p@\@plus-5\p@\@minus-2\p@}%
+ {5\p@}{\normalfont\normalsize\itshape}%
+}%
+% \end{macrocode}
+%
+% \subsection{In lieu of \file{ltxdoc.cfg}}
+% We don't want everything to appear in the index
+% \begin{macrocode}
+\DoNotIndex{\',\.,\@M,\@@input,\@Alph,\@alph,\@addtoreset,\@arabic}
+\DoNotIndex{\@badmath,\@centercr,\@cite}
+\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
+\DoNotIndex{\@input,\@ixpt,\@m,\@minus,\@mkboth}
+\DoNotIndex{\@ne,\@nil,\@nomath,\@plus,\roman,\@set@topoint}
+\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
+\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
+\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
+\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
+\DoNotIndex{\advance,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
+\DoNotIndex{\bullet}
+\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
+\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
+\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
+\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
+\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
+\DoNotIndex{\fbox}
+\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
+\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
+\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
+\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
+\DoNotIndex{\input}
+\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
+\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
+\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
+\DoNotIndex{\NeedsTeXFormat,\newdimen}
+\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
+\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
+\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
+\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
+\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
+\DoNotIndex{\refstepcounter,\relax,\renewcommand}
+\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily}
+\DoNotIndex{\secdef,\selectfont,\setbox,\setcounter,\setlength}
+\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
+\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
+\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
+\DoNotIndex{\viipt,\vipt,\vskip,\vspace}
+\DoNotIndex{\wd,\xiipt,\year,\z@}
+\DoNotIndex{\next}
+% \end{macrocode}
+%
+% Direct \classname{ltxdoc} to produce an index.
+% \begin{macrocode}
+\AtEndDocument{\PrintIndex}%
+% \end{macrocode}
+%
+% \subsection{Extension to \LaTeX's \env{filecontents} Environment}
+% We want to
+% coax the version number into \env{filecontents}-generated files.
+% Note that we expect \cmd\fileversion\ and \cmd\filedate\ to
+% hold the needed information. For this to be the case,
+% your document should execute the \cmd\GetFileInfo\ command
+% (as documented in section~\ref{sec:GetFileInfo}) before
+% any instances of \env{filecontents}.
+% \begin{macrocode}
+\makeatletter
+\def\endfilecontents{%
+ \immediate\write\reserved@c{%
+ \string\iffalse\space ltxdoc klootch^^J%
+ \ifx\undefined\fileversion\else
+ \ifx\undefined\filedate\else
+ This file has version number \fileversion, last revised \filedate.%
+ \fi\fi
+ \string\fi
+ }%
+ \immediate\closeout\reserved@c
+ \def\T##1##2##3{%
+ \ifx##1\@undefined\else
+ \@latex@warning@no@line{##2 has been converted to Blank ##3e}%
+ \fi
+ }%
+ \T\L{Form Feed}{Lin}%
+ \T\I{Tab}{Spac}%
+ \immediate\write\@unused{}%
+}%
+\expandafter\let\csname endfilecontents*\endcsname\endfilecontents
+\makeatother
+% \end{macrocode}
+%
+% Alter formatting in arrays; set them tight.
+% \begin{macrocode}
+\setlength\arraycolsep{0pt}%
+% \end{macrocode}
+%
+% \subsection{End of the \file{extensions} {\sc docstrip} module}
+% Here ends the module.
+% \begin{macrocode}
+%</extensions>
+% \end{macrocode}
+%
+%
+% \section{Font Package for Acrobat Compatability}%
+% The package \classname{acrofont}
+% substitutes Acrobat-standard fonts for Computer Modern where possible,
+% even in math mode.
+% Documents typeset with this package in effect will require as little
+% downloaded font data as possible, but will not be exemplars of
+% fine math typesetting.
+%
+% \subsection{Beginning of the \file{fonts} {\sc docstrip} module}
+% The document class module comprises this and the next
+% four sections.
+% \begin{macro}{\class@base}
+% We define in exactly one spot the base class.
+% Typically that class will be one of \classname{book},
+% \classname{article}, or \classname{report}.
+% The base class effectively defines the use and the markup scheme
+% of the class of documents to be handled by this class.
+%
+% This class is a variant of the standard \LaTeX\ book class:
+% \url{ftp://ctan.tug.org/tex-archive/macros/latex/unpacked}.
+% \begin{macrocode}
+%<*fonts>
+\def\class@name{ltxdocext}%
+\expandafter\ClassInfo\expandafter{\class@name}{%
+ Written for \protect\LaTeXe\space
+ by A. Ogawa (ogawa@teleport.com)%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Variants on psfonts packages}%
+% The following uses \file{times.sty} from \url{/packages/psnfss/psfonts.dtx}
+% \begin{macrocode}
+\RequirePackage{times}%
+% \end{macrocode}
+%
+% The following uses \file{mathptm.sty} from \url{/packages/psnfss/psfonts.dtx}
+% \begin{macrocode}
+\RequirePackage{mathptm}%
+% \end{macrocode}
+%
+% The following is a customization of \file{ot1ptmcm.fd}.
+% The virtual font referred to here \file{zptmnocmr} is
+% a variant of Sebastian Rahtz's \file{zptmcmr}, but with
+% even more glyphs moved from CM to Acrobat-standard fonts.
+% \begin{macrocode}
+\DeclareFontFamily{OT1}{ptmcm}{}
+\DeclareFontShape{OT1}{ptmcm}{m}{n}{
+ <-> zptmnocmr
+}{}
+\DeclareFontShape{OT1}{ptmcm}{l}{n}{<->ssub * ptmnocm/m/n}{}
+% \end{macrocode}
+%
+% The following is a customization of \file{omlptmcm.fd}
+% The virtual font referred to here \file{zptmnocmrm} is
+% a variant of Sebastian Rahtz's \file{zptmcmrm}, but with
+% even more glyphs moved from CM to Acrobat-standard fonts.
+% \begin{macrocode}
+\DeclareFontFamily{OML}{ptmcm}{\skewchar \font =127}
+\DeclareFontShape{OML}{ptmcm}{m}{it}{
+ <-> zptmnocmrm
+}{}
+\DeclareFontShape{OML}{ptmcm}{l}{it}{<->ssub * ptmcm/m/it}{}
+\DeclareFontShape{OML}{ptmcm}{m}{sl}{<->ssub * ptmcm/m/it}{}
+\DeclareFontShape{OML}{ptmcm}{l}{sl}{<->ssub * ptmcm/m/sl}{}
+% \end{macrocode}
+%
+% The following is a customization of \file{omspzccm.fd}
+% The virtual font referred to here \file{zpzcnocmry} is
+% a variant of Sebastian Rahtz's \file{zpzccmry}, but with
+% even more glyphs moved from CM to Acrobat-standard fonts.
+% \begin{macrocode}
+\DeclareFontFamily{OMS}{pzccm}{}
+\DeclareFontShape{OMS}{pzccm}{m}{n}{
+ <-> zpzcnocmry
+}{}% cmsy10 Symbol Zapf Chancery Medium-Italic Times-Roman
+\DeclareFontShape{OMS}{pzccm}{l}{n}{<->ssub * pzccm/m/n}{}
+% \end{macrocode}
+%
+% The following is a customization of \file{omxpsycm.fd}
+% The virtual font referred to here \file{zpsynocmrv} is
+% a variant of Sebastian Rahtz's \file{zpsycmrv}, but with
+% even more glyphs moved from CM to Acrobat-standard fonts.
+% \begin{macrocode}
+\DeclareFontFamily{OMX}{psycm}{}
+\DeclareFontShape{OMX}{psycm}{m}{n}{
+ <-> zpsynocmrv
+}{}
+\DeclareFontShape{OMX}{psycm}{l}{n}{<->ssub * psycm/m/n}{}
+%
+\DeclareFontEncoding{8r}{}{}% from file: 8renc.def
+\DeclareFontFamily{8r}{cmr}{\hyphenchar\font45 }% from file: 8rcmr.fd
+\DeclareFontShape{8r}{cmr}{m}{n}{
+ <-> cmr10
+}{}
+% \end{macrocode}
+%
+% \subsection{Font definition files}%
+%
+% The following forces \LaTeX\ to do now what it would do anyway:
+% load the `font definition' information for the fonts that we
+% use. In this way, we prepare for faster processing through
+% the \cmd\dump\ of a preformatted macro package that will not
+% need to read in any packages or font definitions from disk.
+% \begin{macrocode}
+\input{8rphv.fd}%
+\input{8rptm.fd}%
+\input{ot1phv.fd}%
+\input{ot1ptm.fd}%
+\input{t1ptm.fd}%
+% \end{macrocode}
+%
+% \subsection{More math substitutions}%
+%
+% The following definitions arrange to get certain glyphs from the
+% text font instead of out of math pi fonts.
+% In particular, the copyright and registered symbols
+% are single glyphs instead of composites involving
+% the big circle from the \file{cmsy} font.
+% \begin{macrocode}
+ \def\eightRChar#1{{\def\encodingdefault{8r}\fontencoding\encodingdefault\selectfont\char"#1}}%
+ \def\LANGLE{$<$}%{\eightRChar{8B}}%
+ \def\RANGLE{$>$}%{\eightRChar{9B}}%
+%\def\ASTER{\eightRChar{2A}}%
+%\def\DAGGER{\eightRChar{86}}%
+%\def\DDAGGER{\eightRChar{87}}%
+ \def\BULLET{\eightRChar{95}}%
+%\def\SECTION{\eightRChar{A7}}%
+%\def\PARAGRAPH{\eightRChar{B6}}%
+ \def\VERTBAR{\eightRChar{7C}}%
+ \def\COPYRIGHT{\eightRChar{A9}}%
+ \def\REGISTERED{\eightRChar{AE}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\textbar{\VERTBAR}%
+ \def\textbullet{\BULLET}%
+ \def\textcopyright{\COPYRIGHT}%
+ \def\textregistered{\REGISTERED}%
+% \end{macrocode}
+%
+% I have removed \cmd\ensuremath\ from the following definition, and
+% all commands like \cmd\mathsection have been converted to
+% e.g., \cmd\textsection.
+% \begin{macrocode}
+\def\@makefnmark{\@thefnmark}%
+\def\@fnsymbol#1{{\ifcase#1\or *\or \dagger\or \ddagger\or
+ \textsection\or \textparagraph\or \|\or **\or \dagger\dagger
+ \or \ddagger\ddagger \else\@ctrerr\fi}}
+% \end{macrocode}
+%
+% \subsection{End of the \file{fonts} {\sc docstrip} module}
+% Here ends the module.
+% \begin{macrocode}
+%</fonts>
+% \end{macrocode}
+%
+%
+% \section{Programming Conventions}%
+% In writing the above code, I cleave to certain conventions, noted
+% here.
+% My goal in explaining them is to encourage others maintaining this
+% body of code to consider following them as well.
+% The benefits are twofold:
+% Some of the coding conventions aim to avoid programming pitfalls;
+% following them reduces maintenance costs.
+% Others make the code easier to read; following these eases the
+% process of understanding how the code works.
+%
+% And, for my part, I prefer to read code of this type.
+%
+% \subsection{Whitespace Conventions}%
+% Exactly where code lines break and indent, and where additional
+% whitespace is inserted is explained here.
+% \begin{itemize}
+% \item
+% Each new macro definition or register assignment begins a new line.
+% Therefore, \cmd\def, \cmd\newcommand, and their ilk will start in column
+% 1.
+% \item
+% Code is indented one space for each level of nesting within braces
+% \verb|{}|.
+% \item
+% Likewise, if possible, for \cmd\if\dots and matching \cmd\fi.
+% \item
+% However, the closing brace or \cmd\fi\ is outdented by one so that it
+% falls
+% at the same level of indentation as its matching brace or \cmd\if,
+% and it appears alone on its line.
+% \item
+% Use of the |tab| character is deprecated
+% (tabs are not standardized across all applications and operating
+% systems).
+% \item
+% Lines of code are limited to 72 characters.
+% I follow this convention mostly to ease the transmission of files
+% via email (a deprecated practice) and to accomodate people with
+% small monitors.
+% But \classname{ltxdoc} output looks better with the shorter lines, too.
+% \item
+% Extraneous whitespace is avoided by using the comment character |%|.
+% In most cases, if falling at the end of a line of code,
+% a brace will be immediately followed by a comment character,
+% as will the macro parameter |#1| and any one-letter control sequence,
+% like |\\|.
+% \end{itemize}
+% These conventions taken together are illustrated by the following:
+% \begin{verbatim}
+%\def\prepdef#1#2{%
+% \@ifxundefined#1{\toks@{}}{\toks@\expandafter{#1}}%
+% \toks@ii{#2}%
+% \edef#1{\the\toks@ii\the\toks@}%
+%}%
+% \end{verbatim}
+% In the above, the definition of \cmd\prepdef\ would not fit on a single
+% line,
+% and required breaking. The first and last lines have matching braces,
+% and are a the same level of indentation, with the last line containing
+% a single brace.
+%
+% Each of the three intervening lines has balanced braces and is
+% indented by one space. Each line that would otherwise end in a single
+% brace character is terminated by a comment character.
+%
+% Some coders rely on the fact that a space character seen by \TeX's
+% scanner while in vertical mode is a no-op.
+% Be that as it may, I eliminate them unless actually intentional.
+%
+% \subsection{Conventions For Procedures}%
+% Here are some of my preferences when writing procedures:
+% \begin{itemize}
+%
+% \item
+% I dislike defining a macro within another macro, especially when the
+% pattern part is non-nil.
+% You know, you are not saving much space in |mem| when you do this,
+% right?
+% You do save space in the hash table and the string pool, though.
+% On the other hand, we are not dealing with small \TeX\ engines
+% anymore; Team \LaTeX\ has made sure of this.
+%
+% \item
+% If two or more macros have very similar replacement parts, consider
+% layering.
+%
+% \item
+% Macros may perform parsing, may maintain tokens or registers, or may
+% set type (produce marks). I try to avoid combining the three functions
+% in a single macro.
+%
+% \item
+% When a procedure both does assignments and sets type, I try to have a
+% clean separations between the two activities. Try to avoid:
+% \begin{verbatim}
+% \vskip10pt
+% \parindent=0pt
+% \leavevmode
+% \end{verbatim}
+%
+% \item
+% The Boolean calculus (cf. \cmd\@ifx)
+% is very useful and produces code that executes nicely.
+% Using it also helps avoid your having to debug problems where
+% \cmd\if\dots\ and \cmd\fi\ are not properly balanced
+% (a nightmare in case you didn't already experience it).
+%
+% \end{itemize}
+%
+% \subsection{Conventions For \LaTeX}%
+% Team \LaTeX\ make certain recommendations in \file{clsguide.tex}.
+% Ones that I particularly pay attention to are:
+% \begin{itemize}
+%
+% \item
+% For the sake of ``color safety'',
+% use \cmd\sbox\ rather than \cmd\setbox, \cmd\mbox\ rather than \cmd\hbox, and
+% \cmd\parbox\ or \env{minipage} rather than \cmd\vbox.
+%
+% \item
+% Use \cmd\newcommand\ and \cmd\newenvironment\ to declare user-level commands
+% and environments. Avoid the idiom \cmd\def\cmd\foo, \cmd\def\cmd\endfoo\ to define
+% an environment.
+% Ideally, all user-level markup could be extracted from the
+% document class by grepping on \cmd\newcommand\ and \cmd\newenvironment.
+%
+% \item
+% Prefer to use \cmd\setlength\ to assign registers.
+%
+% \end{itemize}
+% I cannot help but notice that much of the code of \LaTeX\ itself fails
+% to comply with many of the coding recommendations of Team \LaTeX.
+%
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
new file mode 100644
index 00000000000..ab0209ed098
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/ltxgrid.dtx
@@ -0,0 +1,4815 @@
+% \iffalse ltxdoc klootch
+% ltxgrid.dtx: package to change page grid, MVL.
+% Copyright (c) 1999 Arthur Ogawa
+%
+% Disclaimer
+% This file is distributed WITHOUT ANY WARRANTY;
+% without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+% ReadMe
+% For the documentation and more detailed instructions for
+% installation, typeset this document with \LaTeX.
+% \fi
+% \GetFileInfo{ltxgrid.dtx}\CheckSum{4234}
+%
+% \iffalse ltxdoc klootch
+%<*ltxgrid>
+%%% @LaTeX-file{
+%%% filename = "ltxgrid.dtx",
+%%% version = "1.0rc5",
+%%% date = "2001/07/26",
+%%% time = "12:23:00 GMT+8",
+%%% checksum = "4234",
+%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com),
+%%% commissioned by the American Physical Society.
+%%% ",
+%%% copyright = "Copyright (C) 1999, 2000 Arthur Ogawa,
+%%% distributed under the terms of the
+%%% LaTeX Project Public License, see
+%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
+%%% ",
+%%% address = "Arthur Ogawa,
+%%% USA",
+%%% telephone = "",
+%%% FAX = "",
+%%% email = "ogawa@teleport.com",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "latex, page grid, main vertical list",
+%%% supported = "yes",
+%%% abstract = "package to change page grid, MVL",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+%</ltxgrid>
+% \fi
+%
+% \iffalse ltxdoc klootch
+% The following references the \file{00readme.txt} file,
+% which contains basic information about this package.
+% The contents of this file are generated when
+% you typeset the programmer's documentation.
+% Search on "{filecontents*}{00readme.txt}" to locate it.
+% \fi\input{00readme.txt}%
+%
+% \subsection{Bill of Materials}
+%
+% Following is a list of the files in this distribution arranged
+% according to provenance.
+%
+% \subsubsection{Primary Source}%
+% One single file generates all.
+%\begin{verbatim}
+%ltxgrid.dtx
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{latex ltxgrid.dtx}}%
+% Typesetting the source file under \LaTeX\
+% generates the readme and the installer.
+%\begin{verbatim}
+%00readme.txt ltxgrid.ins
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{tex ltxgrid.ins}}%
+% Typesetting the installer generates
+% the package files.
+%\begin{verbatim}
+%ltxgrid.sty
+%\end{verbatim}
+%
+% \subsubsection{Documentation}%
+% The following are the online documentation:
+% \begin{verbatim}
+%ltxgrid.pdf
+% \end{verbatim}
+%
+% \subsubsection{Auxiliary}%
+% The following are auxiliary files generated
+% in the course of running \LaTeX:
+% \begin{verbatim}
+%ltxgrid.aux ltxgrid.idx ltxgrid.ind ltxgrid.log ltxgrid.toc
+% \end{verbatim}
+%
+% \section{Code common to all modules}%
+%
+% The following may look a bit klootchy, but we
+% want to require only one place in this file
+% where the version number is stated,
+% and we also want to ensure that the version
+% number is embedded into every generated file.
+%
+% Now we declare that
+% these files can only be used with \LaTeXe.
+% An appropriate message is displayed if
+% a different \TeX{} format is used.
+% \begin{macrocode}
+%<*doc|ltxgrid>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%</doc|ltxgrid>
+% \end{macrocode}
+% As desired, the following modules all
+% take common version information:
+% \begin{macrocode}
+%<ltxgrid>\ProvidesFile{ltxgrid.sty}%
+%<*doc>
+\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+%</doc>
+% \end{macrocode}
+%
+% The following line contains, for once and for all,
+% the version and date information.
+% By various means, this information is reproduced
+% consistently in all generated files and in the
+% typeset documentation.
+% \begin{macrocode}
+%<*doc|ltxgrid>
+ [2001/07/26 1.0rc5 page grid package]% \fileversion
+%</doc|ltxgrid>
+% \end{macrocode}
+%
+%
+% \section{The driver module \texttt{doc}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{.ins} installer and \file{00readme.txt} as required.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{doc} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``doc'' {\sc docstrip} module.
+% Module delimiters are nonetheless required so that
+% this code does not find its way into the other modules.
+%
+% The \enve{document} command concludes the typesetting run.
+%
+% \begin{macrocode}
+%<*doc>
+% \end{macrocode}
+%
+% \subsection{The Preamble}
+% The programmers documentation is formatted
+% with the \classname{ltxdoc} class with local customizations,
+% and with the usual code line indexing.
+% \begin{macrocode}
+\documentclass{ltxdoc}
+\RequirePackage{ltxdocext}%
+\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
+\ifx\package@font\@undefined\else
+ \expandafter\expandafter
+ \expandafter\RequirePackage
+ \expandafter\expandafter
+ \expandafter{%
+ \csname package@font\endcsname
+ }%
+\fi
+\CodelineIndex\EnableCrossrefs
+% \end{macrocode}
+%
+% \subsubsection{Docstrip and info directives}
+% We use so many {\sc docstrip} modules that we set the
+% \texttt{StandardModuleDepth} counter to 1.
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+% \end{macrocode}
+% The following command retrieves the date and version information
+% from this file.
+% \begin{macrocode}
+\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
+% \end{macrocode}
+%
+%
+% \subsection{The installer file}
+%
+% The installer \file{ltxgrid.ins} appears here.
+% If you have retrieved the standard distribution of this package,
+% the installer file is already on your filesystem.
+% If you are bootstrapping,
+% the first typesetting of the \file{.dtx} file
+% will cause the installer to be generated.
+%
+% The following modules are used to direct
+% {\sc docstrip} in generating the external files:
+% \begin{center}
+% \begin{tabular}{lll}
+% \textbf{Module}&\textbf{File}&\textbf{Description}\\
+% doc &\file{ltxgrid.drv}&driver for programmer's documentation\\
+% ltxgrid,ltxgrid-krn &\file{ltxgrid.sty}&this package\\
+% ltxgrid-krn& &the portion of this package suitable for inclusion within another package
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\begin{filecontents}{ltxgrid.ins}
+%% This file will generate documentation and runtime files
+%% from ltxgrid.dtx when run through LaTeX or TeX.
+\input docstrip
+\preamble
+
+This is a generated file;
+altering it directly is inadvisable;
+instead, modify the original source file.
+See the URL in the file 00readme.txt.
+
+Copyright notice.
+
+ These files are distributed
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+\endpreamble
+\keepsilent
+ \generate{%
+ \file{ltxgrid.drv}{\from{ltxgrid.dtx}{doc}}%
+ \file{ltxgrid.sty}{%
+ \from{ltxgrid.dtx}{ltxgrid,ltxgrid-krn}%
+ }%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxgrid.sty}
+\Msg{* into a directory searched by TeX;}
+\Msg{* in a TDS-compliant installation:}
+\Msg{* texmf/tex/macros/latex/ao/.}
+\Msg{*}
+\Msg{* To produce the documentation,
+ run ltxgrid.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+\end{filecontents}
+% \end{macrocode}
+% Note that, because all of the files generated by the installer
+% are part of the standard distribution, it will
+% be necessary to run the installer only when bootstrapping
+% (or, of course, during development).
+% Note, too, that it is rare to generate the \file{doc}
+% module because it suffices to simply typeset the \file{.dtx} file itself.
+%
+% \subsection{The ``Read Me'' File}
+% As promised above, here is the contents of the
+% ``Read Me'' file. That file serves a double purpose,
+% since it also constitutes the beginining of the
+% programmer's documentation. What better thing, after
+% all, to have appear at the beginning of the
+% typeset documentation?
+%
+% A good discussion of how to write a ReadMe file can be found in
+% Engst, Tonya, ``Writing a ReadMe File? Read This''
+% \emph{MacTech} October 1998, p. 58.
+%
+% Note the appearance of the
+% \cmd\StopEventually\ command, which marks the
+% dividing line between the user documentation
+% and the programmer documentation.
+%
+% The usual user will not be asked to
+% do a full build, not to speak
+% of the bootstrap.
+% Instructions for carrying these processes
+% begin the programmer's manual.
+%
+% \begin{macrocode}
+\begin{filecontents*}{00readme.txt}
+\title{%
+ A \LaTeX\ Package for changing the page grid and MVL%
+ \thanks{%
+ This file has version number \fileversion,
+ last revised \filedate.%
+ % For version number and date,
+ % search on "\fileversion" in the .dtx file,
+ % or see the end of the 00readme.txt file.
+ }%
+}%
+
+\author{%
+Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
+\fileversion\\Copyright (C) 1999, 2000 Arthur Ogawa
+}%
+\maketitle
+
+This file embodies the \classname{ltxgrid} package,
+the implementation and its user documentation.
+
+The distribution point for this work is
+\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxgrid...},
+which contains fully unpacked, prebuilt runtime files and documentation.
+
+The \classname{ltxgrid} package was commissioned by the American Physical Society
+and is distributed under the terms of the \LaTeX\ Project Public License,
+the same license under which all the portions of \LaTeX\ itself is distributed.
+Please see \url{http://ctan.tug.org/macros/latex/base/lppl.txt} for details.
+
+To use this document class, you must have a working
+\TeX\ installation equipped with \LaTeXe\
+and possibly pdftex and Adobe Acrobat Reader or equivalent.
+
+To install, retrieve the distribution,
+unpack it into a directory on the target computer,
+into a location in your filesystem where it will be found by \LaTeX;
+in a TDS-compliant installation this would be:
+\file{texmf/tex/macros/latex/ao/.}
+
+To use, read the user documentation \file{ltxgrid.pdf}.
+
+\tableofcontents
+
+\section{Processing Instructions}
+
+The package file \file{ltxgrid.sty}
+is generated from this file, \file{ltxgrid.dtx},
+using the {\sc docstrip} facility of \LaTeX
+via |tex ltxgrid.ins|.
+The typeset documentation that you are now reading is generated from
+the same file by typesetting it with \LaTeX\ or pdftex
+via |latex ltxgrid.dtx| or |pdflatex ltxgrid.dtx|.
+
+\subsection{Build Instructions}
+
+You may bootstrap this suite of files solely from \file{ltxgrid.dtx}.
+Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
+then carry out the following steps:
+\begin{enumerate}
+\item
+Within an otherwise empty directory,
+typeset \file{ltxgrid.dtx} with \LaTeX\ or pdflatex;
+you will obtain the typeset documentation you are now reading,
+along with
+the installer \file{ltxgrid.ins},
+and the file \file{00readme.txt}.
+
+Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+\LaTeX\ again in order to obtain a valid index and table of contents.
+\item
+Now typeset \file{ltxgrid.ins},
+thereby generating the package file \file{ltxgrid.sty}.
+\item
+Install \classname{ltxgrid.sty}
+by moving it to a location
+in your filesystem where they will be found by \LaTeX.
+\end{enumerate}
+\end{filecontents*}
+% \end{macrocode}
+%
+% \subsection{The Document Body}
+%
+% Here is the document body, containing only a
+% \cmd\DocInput\ directive---referring to this very file.
+% This very cute self-reference is a common \classname{ltxdoc} idiom.
+% \begin{macrocode}
+\begin{document}%
+\expandafter\DocInput\expandafter{\jobname.dtx}%
+% ^^A\PrintChanges
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</doc>
+% \end{macrocode}
+%
+% \section{Using this package}
+% Once this package is installed on your filesystem, you can employ it in
+% adding functionality to \LaTeX\ by invoking it in your document or document class.
+%
+% \subsection{Invoking the package}
+% In your document, you can simply call it up in your preamble:
+% \begin{verbatim}
+%\documentclass{book}%
+%\usepackage{ltxgrid}%
+%\begin{document}
+%<your document here>
+%\end{document}
+% \end{verbatim}
+% However, the preferred way is to invoke this package from within your
+% customized document class:
+% \begin{verbatim}
+%\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%\ProvidesClass{myclass}%
+%\LoadClass{book}%
+%\RequirePackage{ltxgrid}%
+%<class customization commands>
+%\endinput
+% \end{verbatim}
+%
+% Note that this package requires the features of the \classname{ltxutil} package,
+% available at
+% \url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxutil/}.
+%
+% Once loaded, the package gives you acccess to certain procedures,
+% usually to be invoked by a \LaTeX\ command or environment, but not at the document level.
+%
+% \subsection{Changing the page grid}%
+% This package provides two procedures, \cmd\onecolumngrid, \cmd\twocolumngrid,
+% that change the page grid (it can be extended to more columns and to other page grids).
+%
+% They differ from standard \LaTeX's \cmd\onecolumn\ and \cmd\twocolumn\ commands in that
+% they do not force a page break. Also, upon leaving a multiple-column grid, the columns are balanced.
+% In other respects they work same.
+%
+% They differ from the grid-changing commands of Frank Mittelbach's \classname{multicol} package
+% in that they allow floats of all types (single- and double column floats, that is) and
+% preserve compatability with the \classname{longtable} package.
+%
+% These commands must be issued in vertical mode (conceivably via a \cmd\vadjust) such that
+% they are ultimately present in the MVL, where they can do their work.
+% Because they do not work in \LaTeX's left-right mode, they are unsuitable at the
+% document level.
+% Furthermore, packaging a grid command in a \cmd\vadjust, although possible, will probably
+% not acheive satisfactory page layout.
+%
+% Page grid commands are not intended to be issued unnecessarily: only the first of
+% two successive \cmd\onecolumngrid\ commands is effective; the second will be silently ignored.
+%
+% \DescribeMacro\onecolumngrid
+% You command \LaTeX\ to return to the one-column grid with the
+% \cmd\onecolumngrid\ command. If you are already in the one-column grid, this
+% is a no-op. The one-column grid is considered special of all page grids, in that
+% no portion of the page is held back (in \cmd\pagesofar); all items that might go
+% on the current page (with the exception of floats and footnotes) are on the MVL.
+%
+% \DescribeMacro\twocolumngrid
+% You command \LaTeX\ to return to the two-column grid with the
+% \cmd\twocolumngrid\ command. If you are already in the two-column grid, this
+% is a no-op.
+%
+% These two commands should be issued by a macro procedure that can ensure that
+% \TeX\ is in outer vertical mode.
+%
+% \subsection{Changing the MVL}%
+%
+% This package also provides commands to modify the main vertical list (MVL) in a safe way.
+% The scheme here is to structure, insofar possible, \TeX's MVL as follows:
+%\begin{quotation}
+%box or boxes\\
+%penalty\\
+%glue
+%\end{quotation}
+% This should be a familiar sequence. It is the prototype sequence for a vertical list,
+% and is followed when \TeX\ breaks paragraphs into lines, and when \TeX\ generates
+% a display math equation.
+%
+% If you (as a macro programmer) wish to modify the value of the penalty or glue item,
+% you can use one of the MVL-altering commands to do so. Certain operations are implemented
+% here; you can make up your own.
+%
+% Note that these commands must be issued in vertical mode, perhaps via a \cmd\vadjust\ or a \cmd\noalign.
+% They can work directly if you are in inner mode (say within a parbox or a minipage).
+%
+% \DescribeMacro\removestuff
+% You instruct \LaTeX\ to remove both the penalty and the glue item with this command.
+%
+% \DescribeMacro\addstuff
+% You issue the \cmd\addstuff\arg{penalty}\arg{glue} command to add a penalty, glue, or both.
+% If you do not wish to add one or the other, the corresponding argument should be nil.
+% Note that the effect of \cmd\addstuff\ is to stack the penalties and glue items.
+% Therefore, the lesser of the two penalties takes effect,
+% and the two glue items add together.
+%
+% \cmd\addstuff\ is limited because once applied, it cannot be applied again with correct results.
+%
+% \DescribeMacro\replacestuff
+% The \cmd\replacestuff\ command is syntactically the same as \cmd\addstuff, but works
+% differently: the existing penalty and glue are replaced or modified.
+%
+% The specified penalty is not inserted if the existing penalty is greater than 10000
+% (that is, in case of a \cmd\nobreak), otherwise, the lower (non-zero) of the two penalties is inserted.
+%
+% If the specified glue has a larger natural component than the existing glue, we replace the glue.
+% However, if the specified glue's natural component is negative, then the existing glue's natural component is
+% changed by that amount.
+%
+% \cmd\replacestuff\ can be applied mutiple times bceause it retains the list structure in the canonical form.
+%
+% Note that we treat two penalties specially (as does \TeX): a penalty of 10000 is considered
+% a garbage value, to be replaced if found. This is the signal value that \TeX\ inserts on
+% the MVL replacing the penalty that caused the page break (if the page break occurred at a penalty).
+% Also, a penalty of zero is indistinguishable from no penalty at all, so it will always
+% be replaced by the given value.
+%
+% Therefore, it is highly recommended to never set any of \TeX's penalty parameters to
+% zero (a value of, say, 1, is practically the same), nor should a skip parameter be set to zero
+% (instead, use, say, 1sp). Also, to prevent a pagebreak, do not use a penalty of 10000, use, say
+% 10001 instead.
+%
+% You can define your own construct that modifies the MVL:
+% Define a command, say, \cmd\myadjust, as follows:
+%\begin{verbatim}
+%\def\myadjust#1{\noexpand\do@main@vlist{\noexpand\@myadjust{#1}}\@tempa}%
+%\end{verbatim}
+% that is, \cmd\myadjust\ invokes \cmd\do@main@vlist, passing it the procedure name
+% \cmd\@myadjust\ along with the arguments thereof pre-expanded.
+% Next, define the procedure \cmd\@myadjust:
+%\begin{verbatim}
+%\def\@myadjust#1{<meddle with the MVL>}%
+%\end{verbatim}
+% when \cmd\@myadjust\ executes, you will be in the output routine (in inner vertical mode)
+% and the MVL will be that very vertical list.
+%
+%
+%
+%
+% \section{Compatability with \LaTeX's Required Packages}
+% Certain packages, usually ones written by members of the
+% \LaTeX\ Project itself, have been designated ``required'' and
+% are distributed as part of standard \LaTeX.
+% These packages have been placed in a priviledged position
+% vis \'a vis the \LaTeX\ kernel in that they override the definitions of certain kernel macros.
+%
+% Compatability between \classname{ltxgrid} and these packages is complicated
+% by a number of factors. First is that \classname{ltxgrid} alters the meaning of some of the same
+% kernel macros as certain of the ``required'' packages.
+% Second is that fact that certain of the ``required'' packages of \LaTeX\ are incompatible with
+% each other.
+%
+% Examples of the first kind are the \classname{ftnright}, \classname{multicol}, and \classname{longtable}
+% packages.
+% The \classname{ltxgrid} package is not compatible with \classname{multicol},
+% but if you are using \classname{ltxgrid}, you do not need to use \classname{ftnright} or \classname{multicol}
+% anyway. The \classname{ltxgrid} package does however attempt to be compatible with \classname{longtable}.
+%
+% Among the ``required'' packages that are mutually incompatible are \classname{multicol} and \classname{longtable},
+% the incompatibility arising because both packages replace \LaTeX's output routine:
+% if one package is active, the other must not be so.
+% This state of affairs has remained essentially unchanged since the introduction of the two as \LaTeX2.09 packages in the late 1980s.
+%
+% The reason that \classname{ltxgrid} can remain compatible with \classname{longtable} is due to the
+% introduction of a more modern architecture, the ``output routine dispatcher'', which allows all macro packages access to the
+% safe processing environment of the output routine, on an equal footing.
+% The relevant portions of the \classname{longtable} package are reimplemented in \classname{ltxgrid}
+% to take advantage of this mechanism.
+%
+% Timing is critical:
+% the \classname{ltxgrid} package will be incompatible with any package that
+% redefines any of the kernel macros that \classname{ltxgrid} patches---if that
+% package is loaded \emph{after} \classname{ltxgrid}.
+%
+% Hereinafter follows some notes on specific \LaTeX\ packages.
+%
+% \subsection{ftnright}
+% Frank Mittelbach's \classname{ftnright} package effects a change to \LaTeX's
+% \cmd\twocolumn\ mode such that footnotes are set at the bottom of the right-hand
+% column instead of at the foot of each of the two columns.
+%
+% Note that it overwrites three \LaTeX\ kernel macros: \cmd\@outputdblcol, \cmd\@startcolumn, and \cmd\@makecol.
+% Fortunately none of the three are patched by \classname{ltxgrid}, so that compatability
+% is not excluded on this basis.
+%
+% At the same time, it changes the meaning of \cmd\footnotesize, the macro that is automatically
+% invoked when setting a document's footnote into type.
+% One might well argue that it is an error for the meaning of \cmd\footnotesize\ to be determined by
+% a package such as \classname{ftnright}, that indeed such a choice should be made in the
+% document class, or in a file such as \file{bk10.clo}.
+%
+% To avoid being tripped up by this misfeature in \classname{ftnright}, it is only necessary to
+% reassert our meaning for \cmd\footnotesize\ later on, after \classname{ftnright} has been loaded.
+%
+% Note that \classname{ftnright} inserts code that demands that \LaTeX's flag \cmd\if@twocolumn\
+% is true, that is, it will complain if deployed in a \cmd\onecolumn\ document.
+% It is therefore necessary for any other multicolumn package to assert that flag in order to
+% avoid this package's complaint. It is an interesting question exactly why this package has
+% this limitation. After all, a one-column page grid is just a degenerate case of the
+% two column.
+%
+% \subsection{longtable}
+% David Carlisle's \classname{longtable} package sets tables that can be so long as to break over pages.
+% According to its author, it uses the same override of \LaTeX's output routine as
+% Frank Mittelbach's \classname{multicol} package. By implication, then, it has a hard
+% incompatability with the latter.
+%
+% The \classname{longtable} package also performs a check of whether the document is in
+% \cmd\twocolumn\ mode, and declines to work if this is the case. It is not clear, however,
+% that there is any true incompatability present if so. It's just that David did not see any reason
+% anyone would want to set such long tables in a multicolumn document, hence the check.
+%
+% There does not appear to be any indication that \classname{longtable} would work less
+% well under \classname{ltxgrid} than under standard \LaTeX's \cmd\twocolumn\ mode.
+% Therefore, this \classname{ltxgrid} patches \classname{longtable} (if loaded) so as to provide
+% compatability. In the course of which, \classname{longtable} becomes more robust
+% (\classname{longtable} has mumerous bugs and incompatabilities of long standing,
+% some of which are repaired by \classname{ltxgrid}).
+%
+% One problem remains, namely that, if a \env{longtable} environment breaks over columns
+% and thereby inserts its special headers and footers at that break, and those columms are then
+% balanced (due to a return to the one-column page grid), then those inserted rows
+% will remain, and may no longer fall at the column break. This will, of course look
+% wrong.
+%
+% The only way to fix this problem is to avoid doing column balancing in the way
+% I have implemented here; such an enhancement to this package is possible.
+%
+% \subsection{multicol}
+% Frank Mittelbach's \classname{multicol} package provides a page grid with many columns,
+% albeit denies the placement of floats in individual columns.
+%
+% It esablishes its own \cmd\output\ routine, which is the reason it runs afoul of
+% the \classname{longtable} package. On the other hand, \classname{ltxgrid} specifically
+% allows for the case where a package installs its own \cmd\output\ routine, so
+% there is no incompatability on that basis.
+%
+% Still, it is pointless to use \classname{multicol} if you are using \classname{ltxgrid},
+% since both packages provide multicolumn page layouts.
+% Therefore, \classname{multicol} is not supported by \classname{ltxgrid}.
+%
+% \subsection{ltxgrid}
+% It has been pointed out that one of the disadvantages of adopting the \classname{ltxgrid} package is that
+% it does alter the \LaTeX\ kernel.
+% Any package that itself alters the \LaTeX\ kernel may be incompatible with \classname{ltxgrid}, and new packages
+% (destined perhaps to become part of the successor to \LaTeXe) may break \classname{ltxgrid}.
+%
+% The consequence is that packages introduced in future, and future changes to \LaTeX\ may be incompatible
+% with \classname{ltxgrid}.
+% This is, of course, true.
+% The development plan for \classname{ltxgrid} is that when such packages and \LaTeX\ kernel changes come about,
+% the burden will be on \classname{ltxgrid} to change in a way that provides for continued compatability with
+% those packages and \LaTeX\ kernel changes.
+%
+%
+% \section{How \classname{ltxgrid} places footnotes}
+%
+% In conventional multicolumn layouts, a footnote will appear at the bottom of the column in which it is called out.
+% The \classname{ltxgrid} package implements this conventional layout choice by default.
+% However, other choices are possible (a la \classname{ftnright}, whose compatability with \classname{ltxgrid} has not been tested).
+%
+% One unusual feature of \classname{ltxgrid}'s default implementation must be mentioned, though,
+% namely the case in a two-column page grid, where a footnote is followed by a temporary change to the one-column page grid
+% (e.g., for a wide equation).
+% In such a case, the material above the wide material is split into two columns, and a footnote whose callout
+% appears in the right-hand column will nonetheless be set at the base of the left column.
+%
+% This arrangement was chosen because it ensures that the footnotes at the bottom of any page will appear in
+% numerical order. It can be argued that this choice is ``incorrect'', but be that as it may,
+% the \classname{ltxgrid} package does not foreclose on other arrangements for the footnotes.
+% The package can be adapted to accomodate any page design desired.
+%
+% \section{Limitations in \classname{ltxgrid}'s default column balancing method}%
+%
+% In a multicolumn page grid, when encountering a page that is not completely full,
+% it is customary to set the material in balanced columns (typically with the last column no longer than any of the others).
+% Such a case also crops up when temporarily interrupting the multicolumn grid to set material on the full width of the page:
+% the material on the page above the break is customarily set in balanced columns.
+%
+% An awkward case arises when we have already set one or more complete columns of type before encountering the need to
+% balance columns. In this subset of cases, the default in \classname{ltxgrid} is to
+% do an operation I call ``re-balancing'':
+% the material on the page so far is pasted back together into a single column, and new, balanced column breaks are
+% calculated.
+%
+% This scheme typically works fine, but it has a significant vulnerability:
+% any discardable items trimmed at the original column break is lost, never to be retrieved.
+% Consequently, after re-balancing, an element like, say, a section head can fail to have the correct amount of whitespace above.
+%
+% This problem is due to an unfortunate optimization in \TeX, wherein a certain class of nodes is trimmed from the
+% top of main vertical list upon returning from the output routine:
+% any penalty, glue, or leader node falls in to this class of discardable nodes,
+% and trimming proceeds until a non-discardable node (such as a box, or rule) is encountered.
+% It gets better: a third class of nodes is transparent to this trimming process;
+% they are neither discarded nor do they halt the process of trimming:
+% mark nodes and all whatsits fall into this class of transparent nodes;
+% they are quietly passed over during trimming.
+%
+% An alternative approach for \TeX\ to take would have been,
+% rather than discarding the node entirely, to simply mark it as discarded.
+% (Implementors of NTS, please note!)
+% Then, upon shipping out, such nodes would not make it into the DVI.
+% \TeX's optimization, driven by the small computer architectures current when it was developed,
+% does save mem, but at the cost of revisiting page breaks in a reliable way.
+%
+% FIXME: how to fix a column break in the above case? Widetext?
+%
+%\StopEventually{}
+%
+% \section{Implementation of package}
+%
+% Special acknowledgment: this package uses concepts pioneered
+% and first realized by William Baxter (mailto:web@superscript.com)
+% in his SuperScript line of commercial typesetting tools, and
+% which are used here with his permission. His thorough understanding
+% of \TeX's output routine underpins the entire \classname{ltxgrid}
+% package.
+%
+% \subsection{Beginning of the \file{ltxgrid} {\sc docstrip} module}
+% Requires the underpinnings of the \classname{ltxkrnext} package.
+% \begin{macrocode}
+%<*ltxgrid>
+\def\package@name{ltxgrid}%
+\expandafter\PackageInfo\expandafter{\package@name}{%
+ Page grid for \protect\LaTeXe,
+ by A. Ogawa (ogawa@teleport.com)%
+}%
+\RequirePackage{ltxutil}%
+%</ltxgrid>
+% \end{macrocode}
+%
+% \subsection{Banner}%
+% Credit where due.
+% \begin{macrocode}
+%<*ltxgrid-krn>
+\typeout{%
+ ltxgrid: portions licensed from W. E. Baxter (web@superscript.com)%
+}%
+% \end{macrocode}
+%
+% \subsection{Sundry}%
+% Here are assorted macro definitions.
+% \begin{macro}{\lineloop}
+% The document-level command \cmd\lineloop\ sets numbered lines until the
+% specified count is reached.
+% This command is mainly used to construct test documents.
+% \begin{macrocode}
+\newcounter{linecount}
+\def\lineloop#1{%
+ \loop
+ \ifnum\c@linecount<#1\relax
+ \global\advance\c@linecount\@ne
+ \par
+ \hb@xt@\hsize{%
+ \ifnum\c@linecount<100 0\fi\ifnum\c@linecount<10 0\fi\number\c@linecount
+ \vrule depth2.5\p@
+ \leaders\hrule\hfil
+ }%
+ \penalty\interlinepenalty
+ \repeat
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Mark Components}%
+%
+% Override LaTeX's mark macros to allow more components.
+%
+% We remain bound by the weakness of LaTeX's scheme in that
+% one cannot emulate the action of \TeX\ whereby
+% material with marks can be inserted in the middle of
+% a vertical list such that the marks are reliably calculated.
+% If we did that, \cmd\@themark\ would no longer be utilized.
+%
+% A more robust scheme involves placing all marks (component and value)
+% into a list (using global scoping, i.e., \cmd\gdef),
+% and using \cmd\@@mark to place an index on that list into the MVL.
+% Then, e.g., \cmd\@@botmark signifies the place where that list is to be cut,
+% and the \cmd\botmark\ of any component is
+% the value of the last element of the cut
+% list having the given component. The \cmd\firstmark\ and \cmd\topmark\
+% can likewise be defined relative to \cmd\@@firstmark\ and \cmd\@@topmark,
+% except in the latter case, we want the first following the cut instead of the last
+% preceding the cut.
+%
+% The limitation of this scheme is its demands upon \TeX's mem.
+% The list of marks would need to be trimmed back to, effectively,
+% \cmd\topmark\ at the beginning of every page.
+%
+% This approach is not yet part of the extended LaTeX kernel.
+%
+% \begin{macro}{\@@mark}
+% \begin{macro}{\@@topmark}
+% \begin{macro}{\@@firstmark}
+% \begin{macro}{\@@botmark}
+% \begin{macro}{\@@splitfirstmark}
+% \begin{macro}{\@@splitbotmark}
+% Remember primitives under a new set of names.
+% \begin{macrocode}
+\let\@@mark\mark
+\let\@@topmark\topmark
+\let\@@firstmark\firstmark
+\let\@@botmark\botmark
+\let\@@splitfirstmark\splitfirstmark
+\let\@@splitbotmark\splitbotmark
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Procedures that expose the component data structure}%
+% This portion of the code exposes the internal representation of
+% the mark components. If we wish to add more components, we will have to revise
+% these macro definitions:
+% \cmd\@themark,
+% \cmd\nul@mark,
+% \cmd\set@mark@netw@,
+% \cmd\set@marktw@,
+% \cmd\set@markthr@@,
+% \cmd\get@mark@@ne,
+% \cmd\get@mark@tw@,
+% \cmd\get@mark@thr@@,
+% \cmd\get@mark@f@ur.
+%
+% \begin{macro}{\@themark}
+%FIXME: is it safer to eliminate \cmd\@themark\ in favor of a message that evaluates \cmd\@@botmark?
+%
+% Note: these definitions expose the data structure of mark components.
+% \begin{macrocode}
+\def\@themark{{}{}{}{}}%
+\def\nul@mark{{}{}{}{}\@@nul}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@mark@netw@}
+% \begin{macro}{\set@marktw@}
+% \begin{macro}{\set@markthr@@}
+% These procedures insert the new value of a particular mark component into the given argument.
+% They expose the data structure of mark components.
+%
+% \begin{macrocode}
+\def\set@mark@netw@#1#2#3#4#5#6#7{\gdef#1{{#6}{#7}{#4}{#5}}\do@mark}%
+\def\set@marktw@#1#2#3#4#5#6{\gdef#1{{#2}{#6}{#4}{#5}}\do@mark}%
+\def\set@markthr@@#1#2#3#4#5#6{\gdef#1{{#2}{#3}{#6}{#5}}\do@mark}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\get@mark@@ne}
+% \begin{macro}{\get@mark@tw@}
+% \begin{macro}{\get@mark@thr@@}
+% \begin{macro}{\get@mark@f@ur}
+% These procedures retreive the value of a particular mark component.
+% They expose the data structure of mark components.
+% \begin{macrocode}
+\def\get@mark@@ne#1#2#3#4#5\@@nul{#1}%
+\def\get@mark@tw@#1#2#3#4#5\@@nul{#2}%
+\def\get@mark@thr@@#1#2#3#4#5\@@nul{#3}%
+\def\get@mark@f@ur#1#2#3#4#5\@@nul{#4}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Procedures that do not expose the component data structure}%
+%
+% \begin{macro}{\mark@netw@}
+% \begin{macro}{\marktw@}
+% \begin{macro}{\markthr@@}
+% These procedures insert the new value of a particular mark component into \cmd\@themark,
+% then execute \cmd\do@mark.
+% They constitute the implementation layer for mark components one, two, and three.
+% An analogous procedure for component four could be defined; call it \cmd\markf@ur.
+%
+% \begin{macrocode}
+\def\mark@netw@{\expandafter\set@mark@netw@\expandafter\@themark\@themark}%
+\def\marktw@{\expandafter\set@marktw@\expandafter\@themark\@themark}%
+\def\markthr@@{\expandafter\set@markthr@@\expandafter\@themark\@themark}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\do@mark}
+% \begin{macro}{\do@@mark}
+% Access procedures \cmd\mark (AKA \cmd\@@mark).
+% The \cmd\do@mark\ procedure is used when a mark is being put down into the MVL;
+% \cmd\do@@mark\ when this happens in the output routine.
+% \begin{macrocode}
+\def\do@mark{\do@@mark\@themark\nobreak@mark}%
+\def\do@@mark#1{%
+ \begingroup
+ \let@mark
+ \@@mark{#1}%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\let@mark}
+% \begin{macro}{\nobreak@mark}%
+% The procedure that makes \cmd\csname s robust within a mark.
+% Use \cmd\appdef\ and \cmd\robust@\ to extend the list.
+% \begin{macrocode}
+\def\let@mark{%
+ \let\protect\@unexpandable@protect
+ \let\label\relax
+ \let\index\relax
+ \let\glossary\relax
+}%
+\def\nobreak@mark{%
+ \@if@sw\if@nobreak\fi{\@ifvmode{\nobreak}{}}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Using mark components}%
+%
+% These procedures use the component mark mechanism to implement
+% a mark component that remembers the current environment (used in page makeup)
+% and the the two mark components left over from the original \LaTeX.
+% The fourth component is presently unused.
+%
+% \begin{macro}{\mark@envir}
+% The third mark component's access procedures.
+% The \cmd\mark@envir\ and \cmd\bot@envir\ commands are a good model of how to write
+% access procedures for a new mark component.
+% \begin{macrocode}
+\def\mark@envir{\markthr@@}%
+\def\bot@envir{%
+ \expandafter\expandafter
+ \expandafter\get@mark@thr@@
+ \expandafter\@@botmark
+ \nul@mark
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\markboth}
+% \begin{macro}{\markright}
+% \begin{macro}{\leftmark}
+% \begin{macro}{\rightmark}
+% Set procedures for legacy components.
+% \begin{macrocode}
+\def\markboth{\mark@netw@}%
+\def\markright{\marktw@}%
+% \end{macrocode}
+%
+% Retrieval procedures for legacy mark components.
+% The procedure for retrieving the first component from \cmd\botmark\
+% and the second component from \cmd\firstmark have names in \LaTeX;
+% they are called, respectively, \cmd\leftmark\ and \cmd\rightmark.
+%
+% It is possible to retrieve the components of \cmd\topmark\
+% as well: use \cmd\saved@@topmark.
+% \begin{macrocode}
+\def\leftmark{%
+ \expandafter\expandafter
+ \expandafter\get@mark@@ne
+ \expandafter\saved@@botmark
+ \nul@mark
+}%
+\def\rightmark{%
+ \expandafter\expandafter
+ \expandafter\get@mark@tw@
+ \expandafter\saved@@firstmark
+ \nul@mark
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{Output Super-routine}%
+%
+% We want to change \LaTeX's output routine, but do not wish to remain vulnerable
+% to interference from such ``required'' packages as
+% \classname{multicol} (authored by Frank Mittelbach)
+% and \classname{longtable} (authored by David P. Carlisle), which
+% swap in their own output routines when the respective package is active.
+%
+% The better mechanism, used here, is due to William Baxter (web@superscript.com),
+% who has allowed his several ideas to be used in this package.
+%
+% In what follows, we effectively wrap up the old \LaTeX\ output routine inside
+% a new, more flexible ``super routine''. When the output routine is called,
+% the ``super routine'' acts as a dispatcher. If the old routine is needed, it is called.
+%
+% If a package attempts to substitute in their own output routine, they will effectively
+% be modifying a token register by the name of \cmd\output.
+% The primitive \cmd\output\ is now known by a different name, which should no longer be
+% necessary to use.
+%
+% Usage note: to make a visit to the output routine employing the dispatcher, enter
+% with a value of \cmd\outputpenalty\ that corresponds to a macro. Defining as follows:
+%\begin{verbatim}
+%\@namedef{output@10000}{<your code here>}%
+%\end{verbatim}
+% by convention, your output routine should void out \cmd\box\cmd\@cclv.
+%
+% In rewriting \LaTeX's output dispatcher
+% in a much simpler form, we also avoid the sin of multiple \cmd\shipout s
+% within a single visit to the output routine.
+%
+% Conceptually, we divide visits to the output routine into two classes.
+% The first involves natural page breaks
+% (at a \cmd\newpage\ or when \cmd\pagetotal $>$ \cmd\pagegoal)
+% and usually resulting in \cmd\box\cmd\@cclv\ either being shipped out or
+% salted away (e.g., each column in a multicolumn layout).
+% We might call this class the ``natural output routines''; the \cmd\outputpenalty\
+% will never be less than $-10000$.
+% Furthermore, we ensure that \cmd\holdinginserts\ is cleared when
+% calling such routines.
+%
+% The other class involves a forced visit to the output routine
+% via a large negative penalty ($< -10000$). They do not generally
+% result in a \cmd\shipout\ of \cmd\box\cmd\@cclv: they may be dead cycles.
+% We provide a mechanism (call it a ``one-off'' output routine) that allows
+% us to specify certain processing to be done when \TeX\ reaches
+% the current position on the page.
+%
+% One-off output routines themselves fall into two divisions, ones
+% that process \cmd\box\cmd\@cclv, and ones that work on the main vertical list (MVL).
+% The former are typified by changes to the page grid, perhaps
+% even column balancing.
+% The latter involve the insertion of penalties or glue and the processing of floats.
+%
+% The natural output routine is a single procedure. We have not introduced multiple
+% natural output routines based on the \cmd\outputpenalty\ because \TeX\ does not
+% support such a thing: \TeX\ sometimes lays down a penalty whose value is the sum
+% of other penalties. Because of this, we cannot depend on the value of \cmd\outputpenalty\
+% in such areas.
+%
+% We do introduce flexibility in the form of a mechanism for patching into the
+% natural output routine. Three hooks are offered, allowing a procedure
+% to prepare for the upcoming visit to the output routine,
+% access to \cmd\box\cmd\@cclv, and after shipping out (or otherwise
+% committing the material to the page).
+%
+% Environments, commands, and even packages can install their
+% own procedures into these hooks.
+% For instance, if the longtable package is loaded, it will install
+% its procedures, but those procedures will punt if the page break
+% being processed does not actually fall within a longtable environment.
+%
+% \begin{macro}{\primitive@output}
+% Here we remember the \TeX\ primitive \cmd\output\ and its value,
+% and then proceed to take over the \cmd\csname\ of \cmd\output,
+% making it a \cmd\toks\ register and installing the old value of
+% the output routine.
+% \begin{macrocode}
+\let\primitive@output\output
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\output}
+% Grab the tokens in \cmd\the\cmd\output\ (but without the extra set of braces).
+% The value of \cmd\toks@\ must remain untouched until loaded into the appropriate token
+% register; this is done a few lines below.
+% \begin{macrocode}
+\long\def\@tempa#1\@@nil{#1}%
+\toks@
+\expandafter\expandafter
+\expandafter{%
+\expandafter \@tempa
+ \the\output
+ \@@nil
+ }%
+\newtoks\output
+\output\expandafter{\the\toks@}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dispatch@output}
+% We now install our own output routine in place of the
+% old one, which is still available as \cmd\the\cmd\output.
+%
+% The output routine is simply the procedure \cmd\dispatch@output.
+% It either dispatches to a procedure based on a particular value of
+% \cmd\outputpenalty\ or it executes \cmd\the\cmd\output\ tokens.
+% \begin{macrocode}
+\primitive@output{\dispatch@output}%
+\def\dispatch@output{%
+ \let\par\@@par
+ \expandafter\let\expandafter\@tempa\csname output@\the\outputpenalty\endcsname
+ \outputdebug@sw{%
+ \saythe\badness
+ \saythe\outputpenalty
+ \saythe\holdinginserts
+ \say\thepagegrid
+ \saythe\pagegrid@col
+ \saythe\pagegrid@cur
+ %\say\bot@envir
+ \saythe\insertpenalties
+ %\say\@@topmark
+ %\say\saved@@topmark
+ %\say\@@firstmark
+ %\say\saved@@firstmark
+ \say\@@botmark
+ %\say\saved@@botmark
+ \saythe\pagegoal
+ \saythe\pagetotal
+ \saythe{\badness\@cclv}%
+ \expandafter\@ifx\expandafter{\csname output@-\the\execute@message@pen\endcsname\@tempa}{%
+ \say\@message@saved
+ }{%
+ \expandafter\say\csname output@\the\outputpenalty\endcsname
+ }%
+ \say\@toplist
+ \say\@botlist
+ \say\@dbltoplist
+ \say\@deferlist
+ {\tracingall\scrollmode
+ \showbox\@cclv
+ \showbox\@cclv@saved
+ \showbox\pagesofar
+ \showbox\footbox
+ \showbox\footins@saved
+ \showbox\footins
+ \showlists
+ }%
+ }{}%
+ \@ifnotrelax\@tempa{\@tempa}{\the\output}%
+}%
+\@ifxundefined{\outputdebug@sw}{%
+ \@booleanfalse\outputdebug@sw
+}{}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Further thoughts about inserts}
+%
+% The only safe way to deal with inserts is to either set \cmd\holdininserts\ or
+% to commit to using whatever insert comes your way: you cannot change your mind
+% once you see a non-void \cmd\box\cmd\footins, say.
+%
+% Therefore all output routine processing must proceed with \cmd\holdinginserts\ set
+% until you are sure of the material to be committed to the page. At that point, you
+% can clear \cmd\holdinginserts, spew \cmd\box\cmd\@cclv, put down the appropriate penalty,
+% and exit, with the knowledge that \TeX\ will re-find the same pagebreak, this time
+% visiting the output routine with everything, including inserts, in their proper
+% place.
+% This technique applies to split elements (screens, longtable, index) as well as to
+% manufactured pages (float pages and clearpage pages).
+%
+% Therefore, the output routine must not make assumptions about whether \cmd\holdinginserts\
+% should be cleared; instead this must be left to the one-off output routines or the natural output routine.
+%
+% If we are manufacturing pages (``float page processing''), and if \cmd\pagegoal\ is not equal to
+% \cmd\vsize, then inserts are at hand, and our criterion should take into account the insert
+% material, even though we cannot measure its height based on the size of \cmd\box\cmd\footins\
+% (because \cmd\holdinginserts\ is set, you see).
+%
+% It would be better to take the complement of \cmd\floatpagefraction\ and use that
+% as a standard for the looseness of the page. Since \cmd\pagegoal\ reflects the inserted material,
+% the criterion becomes the difference of the aggregate height of the floats and the \cmd\pagegoal\
+% versus this "page looseness" standard.
+%
+% As a check, consider what happens if we bail out: \cmd\@deferlist\ has never been touched, so it
+% requires no attention. Also, \cmd\holdinginserts\ has never been cleared, so inserts require
+% no attention. So we only have to ensure that marks are preserved, which is already taken
+% care of by the message handler mechanism.
+%
+% If we are doing ordinary page cutting, then the scheme would be to detect whether we are within
+% a screen (or longtable as may be), do the adjustment to the page height, and return, but this time
+% with \cmd\holdinginserts\ cleared. Upon reentering the output routine, we may or may not be within
+% the screen environment, but we are now sure to have a final page break, and we can commit this
+% material (by shipping out or by saving it out as a full column).
+%
+% In the above, the first of the two visits to the output routine is a dead cycle and requires
+% propagation of marks, but nothing else.
+%
+% The natural output routine
+%
+% Here is the portion of the output routine that fields cases not handled by
+% the dispatcher.
+%
+% The default is to ship out a page and then look around for more material
+% that might constitute a ``float page''. However, because \cmd\holdinginserts\
+% is normally set, this output routine must first have a dead cycle and
+% come back again with \cmd\holdinginserts\ cleared.
+% Then, after shipping out, it puts down a message that
+% will manufacture zero or more float pages, finally terminating
+% with a procedure that commits floats to a new unfinished page.
+%
+% To accomodate special processing, we execute hooks whose name is based
+% on the value of the "envir" mark component. The default is "document",
+% ensured by an initial mark of that value; the associated procedures
+% are all nil. Any unknown envir value will "\cmd\relax\ out".
+%
+% The code \cmd\move@insert@sw\ tells whether we are on our first visit to
+% the output routine (with \cmd\holdinginserts\ still set), or our second
+% (with \cmd\holdinginserts\ cleared). The output routine will toggle the
+% setting.
+%
+% The commands \cmd\hold@insertions\ and \cmd\move@insertions\ respectively
+% clear and set the state of \cmd\move@insert@sw, so this procedure effectively
+% clears \cmd\holdinginserts\ just long enough to pick up the insertions.
+% Important: any output routine that clears \cmd\holdinginserts\
+% must guarentee that it is restored on the subsequent visit to the output routine.
+% Or, to put it another way, if an output routine detects that \cmd\holdinginserts\
+% is cleared, it should take it upon itself to restore it before exiting.
+%
+% The branch with \cmd\holdinginserts\ set is executed first; the other
+% branch follows on practically immediately thereafter. In the first branch,
+% we simply execute the appropriate hook and then execute a dead cycle.
+%
+% In the branch with \cmd\holdinginserts\ cleared, the procedure
+% builds up the current column, which is now complete, with \cmd\@makecol, then
+% dispatches to the shipout routine associated with the current page grid, \cmd\output@column@.
+% At the end, it triggers the execution of an output routine to prepare the next column (or page).
+%
+% \subsection{Natural output routine}%
+%
+% \begin{macro}{\output}
+% Here is what has become of the output routine of \LaTeX.
+% It is of necessity divided into phases, \cmd\output@holding\ is executed upon first encountering the natural page-breaking point, while inserts are being held.
+% The second phase, \cmd\output@moving, is set in motion by the first: here the same material (in most cases) will be processed with \cmd\holdinginserts\ cleared.
+%
+% \begin{macrocode}
+\output={\toggle@insert\output@holding\output@moving}%
+% \end{macrocode}
+%
+% The procedure \cmd\output@holding\
+% is our first cycle through the output routine; \cmd\holdinginserts\ is still set.
+% We give the current environment a heads up
+% (it is through this means that \classname{longtable} sets its running header and footer),
+% then we execute a dead cycle, which should propagate marks.
+%
+% One corner case that can crop up is the presence of a single unbreakable chunk whose size is larger
+% than \cmd\vsize.
+% Doing a dead cycle under such circumstances will not find the same breakpoint as this time
+% (remember we threw in a \cmd\mark\ node).
+% Instead, we attempt to remove the excess height of the material, so we can continue to propagate marks.
+%
+% The corner case is at hand if the natural size of \cmd\box\cmd\@cclv\ exceeds \cmd\pagegoal\ and
+% the contents cannot be shrunk to fit.
+%
+% \begin{macrocode}
+\def\output@holding{%
+ \csname output@init@\bot@envir\endcsname
+%\vbadness\@M
+%\vfuzz\maxdimen
+ \@if@exceed@pagegoal{\unvcopy\@cclv}{%
+ \setbox\z@\vbox{\unvcopy\@cclv}%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\z@}}{}%
+ \dimen@\ht\@cclv\advance\dimen@-\ht\z@
+ \dead@cycle@repair\dimen@
+ }{%
+ \dead@cycle
+ }%
+}%
+\def\@if@exceed@pagegoal#1{%
+ \begingroup
+ \setbox\z@\vbox{#1}%
+ \dimen@\ht\z@\advance\dimen@\dp\z@
+ \outputdebug@sw{\saythe\dimen@}{}%
+ \@ifdim{\dimen@>\pagegoal}{%
+ \setbox\z@\vbox{\@@mark{}\unvbox\z@}%
+ \splittopskip\topskip
+ \splitmaxdepth\maxdepth
+ \vbadness\@M
+ \vfuzz\maxdimen
+ \setbox\tw@\vsplit\z@ to\pagegoal
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\tw@\showbox\z@}}{}%
+ \setbox\tw@\vbox{\unvbox\tw@}%
+ \@ifdim{\ht\tw@=\z@}{%
+ \ltxgrid@info{Found overly large chunk while preparing to move insertions. Attempting repairs}%
+ \aftergroup\true@sw
+ }{%
+ \aftergroup\false@sw
+ }%
+ }{%
+ \aftergroup\false@sw
+ }%
+ \endgroup
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\output@moving\
+% is our second cycle through the output routine; \cmd\holdinginserts\ is now cleared,
+% and \cmd\insert s will have been split off into their respective box registers, like \cmd\footins.
+%
+% \begin{enumerate}
+% \item
+% Set the values of \cmd\topmark\ and \cmd\firstmark.
+% \item
+% If we got here because of a \cmd\clearpage\ command, remove the protection box that this mechanism has left on the MVL.
+% \item
+% If the contents of \cmd\box\cmd\@cclv\ are non-trivial, commit it to the current page or ship it out as the case may call for.
+% \item
+% If not, discard it (we are at the end of \cmd\clearpage\ processing).
+% \item
+% Set various values, including the available space for setting type on the next column (\cmd\@colroom).
+% \end{enumerate}
+%
+% The processing for a non-trivial \cmd\box\cmd\@cclv\ are:
+% \begin{enumerate}
+% \item
+% Execute the head procedure for the current environment.
+% \item
+% Make up a column and ship it out (or commit it to the current page) via a procedure keyed to the current page grid.
+% \item
+% Put down an interrupt for \cmd\do@startcolumn@pen: this will force a visit to the output routine for the
+% purpose of committing floats to the next column.
+% \item
+% Possibly put down an interrupt to continue \cmd\clearpage\ proccessing.
+% \item
+% Execute the tail procedure for the current environment.
+% \end{enumerate}
+%
+%
+% The processing for a trivial \cmd\box\cmd\@cclv\ are:
+% \begin{enumerate}
+% \item
+% Void out \cmd\box\cmd\@cclv\ and give appropriate warning messages and diagnostics.
+%% \item
+%% Put down the same interrupts as for the non-trivial case above.
+% \end{enumerate}
+%
+% \begin{macrocode}
+\def\output@moving{%
+ \set@top@firstmark
+ \@ifnum{\outputpenalty=\do@newpage@pen}{%
+ \setbox\@cclv\vbox{%
+ \unvbox\@cclv
+ \setbox\z@\lastbox
+ \@ifdim{\ht\z@=\ht\@protection@box}{\box\lastbox}{\unskip}%
+ }%
+ }{}%
+ \@cclv@nontrivial@sw{%
+ \csname output@prep@\bot@envir \endcsname
+ \@makecol\csname output@column@\thepagegrid\endcsname
+ \protect@penalty\do@startcolumn@pen
+ \clearpage@sw{%
+ \protect@penalty\do@endpage@pen
+ }{}%
+ \csname output@post@\bot@envir \endcsname
+ }{%
+ {\setbox\z@\box\@cclv}%
+ }%
+ \set@colroom
+ \global\@mparbottom\z@
+ \global\@textfloatsheight\z@ %FIXME: this legacy LaTeX variable is set, but never queried!
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\@cclv@nontrivial@sw\ determines if this visit to \cmd\output@moving\
+% is a trivial one, which happens at the end of \cmd\clearpage\ processing and under some pathological circumstances.
+% It emits a Boolean, so it is syntactically like \cmd\true@sw, albeit does not execute solely via expansion.
+%
+% Note: the case where \cmd\box\cmd\@cclv\ is void comes up at the very beginning of the job, when
+% typesetting a (full-page-width) title block in a two-column layout.
+%
+% Note: the code that removes the last box and skip from the output is intended to detect the case
+% where the output has whatit nodes followed by topskip and a protection box.
+% This is what happens under normal circumstances at the end of \cmd\clearpage\ processing.
+% \begin{macrocode}
+\def\@cclv@nontrivial@sw{%
+ \@ifx@empty\@toplist{%
+ \@ifx@empty\@botlist{%
+ \@ifvoid\footins{%
+ \@ifvoid\@cclv{%
+ \false@sw
+ }{%
+ \setbox\z@\vbox{\unvcopy\@cclv}%
+ \@ifdim{\ht\z@=\topskip}{%
+ \setbox\z@\vbox{%
+ \unvbox\z@
+ \setbox\z@\lastbox\dimen@\lastskip\unskip
+ \@ifdim{\ht\z@=\ht\@protection@box}{%
+ \advance\dimen@\ht\z@
+ \@ifdim{\dimen@=\topskip}{%
+ \aftergroup\true@sw
+ }{%
+ \aftergroup\false@sw
+ }%
+ }{%
+ \aftergroup\false@sw
+ }%
+ }%
+ {%
+ \false@sw % Normal for \clearpage
+ }{%
+ \true@sw
+ }%
+ }{%
+ \@ifdim{\ht\z@=\z@}{%
+ \ltxgrid@info{Found trivial column. Discarding it}%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\@cclv}}{}%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }%
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+}%
+% \end{macrocode}
+%
+%
+% \end{macro}
+%
+% \begin{macro}{\protect@penalty}
+% The procedure \cmd\protect@penalty\ is the utility procedure for invoking a
+% one-off output routine. Such a routine can expect to find the protection box
+% above it in \cmd\box\cmd\@cclv: it should remove that box.
+%
+% Note that \cmd\execute@message\ does the same thing as \cmd\protect@penalty, but
+% in a slightly different way.
+%
+% We create a specially formulated box that will be universally used when a protection box is needed.
+% In this way, we can always recognize when \cmd\box\cmd\@cclv\ is trivial:
+% it will consist of whatsits followed by \cmd\topskip\ glue and the \cmd\@protection@box.
+% \begin{macrocode}
+\def\protect@penalty#1{\protection@box\penalty-#1\relax}%
+\newbox\@protection@box
+\setbox\@protection@box\vbox to1986sp{\vfil}%
+\def\protection@box{\nointerlineskip\copy\@protection@box}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dead@cycle}
+% \begin{macro}{\dead@cycle@repair}
+% The procedure \cmd\dead@cycle\ is defined separately as a utility which can be used by
+% any output processing routine to emulate what takes place in the standard output routine.
+%
+% Here, we have entered the output routine with \cmd\holdinginserts\ enabled, which means that we
+% are not yet ready to ship out material, because the \cmd\insert\ registers are being held.
+% We want to clear \cmd\holdinginserts\ and come back here with the same page break as before, whereupon
+% we may properly proceed with page makeup.
+%
+% To do this, we
+% propagate marks, then spew the contents of \cmd\box\cmd\@cclv\ followed by the
+% original output penalty that landed us here (but only if it is not 10000,
+% the flag value for a pagebreak not at a penalty).
+%
+% However, the natural output routine should do this only if \cmd\box\cmd\@cclv\ is nontrivial.
+% A pathological case exists wherein a box of height greater than \cmd\textheight\ would cause an infinite loop involving the output routine.
+% The procedure \cmd\dead@cycle@repair, attempts to catch this case and avoid the loop.
+%
+% The test of the height of \cmd\box\cmd\@cclv\ is not the correct one, because this test will run afoul in
+% the case where \cmd\box\cmd\@cclv\ contains nothing but an \cmd\insert\ node. What to do?
+%
+% It is possible that the pathological case can be detected by looking at \cmd\pagetotal. If that quantity is
+% zero, then \cmd\box\cmd\@cclv\ really is trivial.
+%
+% In the procedure \cmd\dead@cycle@repair, if \cmd\box\cmd\@cclv\ is nontrivial, we execute \cmd\dead@cycle,
+% otherwise it contains nothing but a mark, so we dispense with propagating marks
+% and we simply spew out \cmd\box\cmd\@cclv\ without an accompanying mark.
+% This has the effect of failing to propagate marks, but this problem is preferrable to the infinite loop,
+% which in principle could crash even a robust operating system by filling up the file system.
+%
+% If a document has such a large chunk, it should be fixed, so we give a message in the log.
+%
+% You ask, ``In what way does this infinite loop come about?'' Good question!
+%
+% The setup is a chunk in the MVL that is taller than \cmd\textheight.
+% (Yes, it's that simple.)
+% As soon as the previous page ships out, the MVL will contain a mark (propagated from the previous page) followed
+% by that large chunk (call it the `big bad box', albeit does not need to be a single box).
+% The next visit to the output routine will be a natural page break, but
+% \TeX\ will select the juncture between the mark and the big bad box as the least-cost page break.
+% Unless the test in \cmd\dead@cycle\ is done, the cycle is perpetuated when the macro
+% reinserts the mark.
+%
+% The crux matter is achieving, in a robust way, the goal of going from a \cmd\holdinginserts\ state to one
+% where the insertions are moving.
+%
+% \begin{macrocode}
+\def\dead@cycle@repair#1{%
+ \expandafter\do@@mark
+ \expandafter{%
+ \@@botmark
+ }%
+ \unvbox\@cclv
+ \nointerlineskip
+ \vbox to#1{\vss}%
+ \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
+}%
+\def\dead@cycle@repair@protected#1{%
+ \expandafter\do@@mark
+ \expandafter{%
+ \@@botmark
+ }%
+ \begingroup
+ \unvbox\@cclv
+ \setbox\z@\lastbox % Remove protection box
+ \nointerlineskip
+ \advance#1-\ht\@protection@box
+ \vbox to#1{\vss}%
+ \protection@box % Reinsert protection box
+ \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
+ \endgroup
+}%
+\def\dead@cycle{%
+ \expandafter\do@@mark
+ \expandafter{%
+ \@@botmark
+ }%
+ \unvbox\@cclv
+ \@ifnum{\outputpenalty<\@M}{\penalty\outputpenalty}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\output@init@document}
+% \begin{macro}{\output@prep@document}
+% \begin{macro}{\output@post@document}
+% The default processing simply provides for insertion of held-over footnotes.
+% At a natural page break, we are either at the bottom of a column or at the bottom
+% of a page. In either case, the \cmd\output@init@\ processing adjusts for the height
+% of the held-over footnotes and bails out.
+% Upon our return, at \cmd\output@prep@\ time, the page break will accomodate the material;
+% it is now actually inserted by concatenating it with the contents of \cmd\footins.
+% The default processing for \cmd\output@post@\ is nil.
+% \begin{macrocode}
+\def\output@init@document{%
+ \@ifvoid\footbox{}{%
+ \global\advance\vsize-\ht\footbox
+ \global\advance\vsize-\dp\footbox
+ }%
+}%
+\def\output@prep@document{%
+ \@ifvoid\footbox{}{%
+% {\tracingall\scrollmode\showbox\footbox\showbox\footins}%
+ \setbox\footins\vbox{\unvbox\footbox\unvbox\footins}%
+ }%
+}%
+\def\output@post@document{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@opcol}
+% The standard \LaTeX\ procedure \cmd\@opcol\ is now completely obsoleted.
+% \begin{macrocode}
+\let\@opcol\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makecol}
+% The procedure \cmd\@makecol\ packages up a page along with all its insertions and floats.
+% Therefore it is essential that it be executed with \cmd\holdininserts\ cleared.
+%
+% Note that there is a corner case when in a multi-column grid, where the change back to
+% one-column grid occurs just after a complete page ships out. We want to detect when
+% \cmd\@cclv\ contains nothing but a \cmd\mark, but this is a \TeX\ impossibility.
+%
+% Note on \cmd\@kludgeins: we have removed this mechanism from \LaTeX, because the implementation
+% of \cmd\enlargethispage\ no longer requires it.
+% Here, for consistency sake, we remove \cmd\@makespecialcolbox.
+% \begin{macrocode}
+\def\@makecol{%
+ \setbox\@outputbox\vbox{%
+ \boxmaxdepth\@maxdepth
+ \@tempdima\dp\@cclv
+ \unvbox\@cclv
+ \vskip-\@tempdima
+ }%
+ \xdef\@freelist{\@freelist\@midlist}\global\let\@midlist\@empty
+ \@combinefloats
+ \@combineinserts\@outputbox\footins
+%\@ifvbox\@kludgeins{%
+% \@makespecialcolbox
+%}{%
+ \set@adj@colht\dimen@
+ \count@\vbadness
+ \vbadness\@M
+ \setbox\@outputbox\vbox to\dimen@{%
+ \@texttop
+ \dimen@\dp\@outputbox
+ \unvbox\@outputbox
+ \vskip-\dimen@
+ \@textbottom
+ }%
+ \vbadness\count@
+%}%
+ \global\maxdepth\@maxdepth
+}%
+\let\@makespecialcolbox\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@combineinserts}
+% We split out the procedure to add the \cmd\footins\ insertions to the packaged-up page.
+% Any other non-trivial insertions should also be dealt with at this time.
+% \begin{macrocode}
+\def\@combineinserts#1#2{%
+ \setbox#1\vbox{%
+ \unvbox#1%
+% {\tracingall\scrollmode\showbox#2}%
+ \vbox{%
+ \@ifvoid#2{}{%
+ \vskip\skip\footins
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \nointerlineskip
+ \box#2%
+ \color@endgroup
+ }{}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@floatplacement}
+% In standard \LaTeX, someone (DPC?) makes the assumption that \cmd\@fpmin\ can be assigned
+% locally. This is no longer true now that we ship no more than one page per visit to the output routine.
+% We apply a bandaid.
+% \begin{macrocode}
+\appdef\@floatplacement{%
+ \global\@fpmin\@fpmin
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pagebreak@pen}
+% While we are in the way of registering certain penalty values,
+% let us register the smallest one that will force a visit to the output routine.
+% However, this penalty will not have an assciated macro: we wish to execute the
+% natural output routine instead.
+%
+% Note that this penalty is invoked by \cmd\clearpage\ and \cmd\newpage.
+% \begin{macrocode}
+\mathchardef\pagebreak@pen=\@M
+\expandafter\let\csname output@-\the\pagebreak@pen\endcsname\relax
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Float placement}%
+%
+% \begin{macro}{\do@startcolumn@pen}
+% The procedure \cmd\do@startcolumn@pen\ is executed as a one-off output routine
+% just after a page is shipped out (or, in a multicolumn page grid, a column is salted away).
+%
+% Its job is to either generate a ``float page'' (in reality a column) for shipping out,
+% or to commit deferred floats to the fresh column, concluding with a dead cycle.
+% In the former case, we accomodate split footnotes and other insertions (by comparing \cmd\vsize\ and \cmd\pagegoal):
+% the floats are spewed onto the page, whereupon \LaTeX's output routine will place the footnotes and ship out,
+% iterating the process once again.
+%
+% Note that when this procedure is invoked, \cmd\box\cmd\@cclv\ still has within it the protection box, so we
+% start by removing it. Note also that if there was a split insertion held over from the previous page, the
+% insert node will be present in \cmd\box\cmd\@cclv, \emph{prior to} the protection box. For this reason, we cannot
+% just throw away that box, as we might be tempted to do.
+%
+% FIXME: where else do we possibly inappropriately discard \cmd\box\cmd\@cclv?
+%
+% Note that, because a column or page page had previously just been completed,
+% we can assume that there is nothing of importance on the page,
+% and because no message is being passed, we can preserve marks in a simple way.
+%
+% A Note on terminology:
+% In a single-column page grid, you might expect that we would execute the procedure \cmd\do@startpage.
+% But this is not so.
+% \LaTeX\ has a confustion of long standing,
+% in which the procedures that handle full-page width floats in a two-column page grid all have in their names
+% the string `dbl', which erroneously suggests having something to do with ``double''. It does not:
+% when you see `dbl', think ``full page width''.
+% \begin{macrocode}
+\mathchardef\do@startcolumn@pen=10005
+\@namedef{output@-\the\do@startcolumn@pen}{\do@startcolumn}%
+\def\do@startcolumn{%
+ \setbox\@cclv\vbox{\unvbox\@cclv\setbox\z@\lastbox\unskip}%
+ \clearpage@sw{\@clearfloatplacement}{\@floatplacement}%
+ \set@colroom
+ \@booleanfalse\pfloat@avail@sw
+ \begingroup
+ \@colht\@colroom
+ \@booleanfalse\float@avail@sw
+ \@tryfcolumn\test@colfloat
+ \float@avail@sw{\aftergroup\@booleantrue\aftergroup\pfloat@avail@sw}{}%
+ \endgroup
+ \fcolmade@sw{%
+ \setbox\@cclv\vbox{\unvbox\@outputbox\unvbox\@cclv}%
+% \csname float@column@\thepagegrid\endcsname
+% \csname output@column@\thepagegrid\endcsname
+ \outputpenalty-\pagebreak@pen % ask for a return visit, this time with insertions and all.
+ \dead@cycle
+ }{%
+ \begingroup
+ \let\@elt\@scolelt
+ \let\reserved@b\@deferlist\global\let\@deferlist\@empty\reserved@b
+ \endgroup
+ \clearpage@sw{%
+ \outputpenalty\@M
+ }{%
+ \outputpenalty\do@newpage@pen
+ }%
+ \dead@cycle
+ }%
+ \check@deferlist@stuck\do@startcolumn
+ \set@vsize
+}%
+\def\@scolelt#1{\def\@currbox{#1}\@addtonextcol}%
+\def\test@colfloat#1{%
+ \csname @floatselect@sw@\thepagegrid\endcsname#1{}{\@testtrue}%
+ \@if@sw\if@test\fi{}{\aftergroup\@booleantrue\aftergroup\float@avail@sw}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@addtonextcol}
+% We must adjust \cmd\@addtonextcol\ to take held-over inserts into account.
+% Now that all deferred floats are queued up together (in order), we must have a way of
+% differentiating them; this is done by the page grid-dependent procedure \cmd\@floatselect@sw@.
+% \begin{macrocode}
+\def\@addtonextcol{%
+ \begingroup
+ \@insertfalse
+ \@setfloattypecounts
+ \csname @floatselect@sw@\thepagegrid\endcsname\@currbox{%
+ \@ifnum{\@fpstype=8 }{}{%
+ \@ifnum{\@fpstype=24 }{}{%
+ \@flsettextmin
+ \@reqcolroom \ht\@currbox
+ \advance \@reqcolroom \@textmin
+ \advance \@reqcolroom \vsize % take into account split insertions
+ \advance \@reqcolroom -\pagegoal
+ \@ifdim{\@colroom>\@reqcolroom}{%
+ \@flsetnum \@colnum
+ \@ifnum{\@colnum>\z@}{%
+ \@bitor\@currtype\@deferlist
+ \@if@sw\if@test\fi{}{%
+ \@addtotoporbot
+ }%
+ }{}%
+ }{}%
+ }%
+ }%
+ }{}%
+ \@if@sw\if@insert\fi{}{%
+ \@cons\@deferlist\@currbox
+ }%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do@startpage@pen}
+% \begin{macro}{\forcefloats@sw}
+% \begin{macro}{\@sdblcolelt}
+% \begin{macro}{\test@dblfloat}
+% \begin{macro}{\@if@notdblfloat}
+% Similar to \cmd\do@startcolumn,
+% the procedure \cmd\do@startpage\ starts up a new page (not column) in a multi-column page grid.
+% It is invoked after a page is shipped out in a multi-column page grid, and
+% it commits full-page-width floats to the fresh page, possibly resulting in a float page.
+% In implementation, it is similar to \cmd\do@startcolumn, except that
+% it commits effectively via \cmd\@addtodblcol\ instead of \cmd\@addtonextcol.
+% Note that this procedure will inevitably be followed by \cmd\do@startcolumn.
+%
+% Some details of the procedure:
+%
+% We begin by removing the protection box from \cmd\box\cmd\@cclv, then setting the values of the
+% float placement parameters appropriately, and resetting \cmd\@colht, \cmd\@colroom, and \cmd\vsize\ to base values.
+%
+% Next we attempt to compose a float page, a page consisting entirely of floats. If successful,
+% we ship out the float page and lay down an interrupt that will send us back here for another try.
+%
+% If no float page is formed, we attempt to commit full-page-width floats to the text page, and return with a dead cycle.
+% We are now ready to compose columns of text.
+%
+% Note that all floats (both column floats and full-page-width floats) move through a single queue.
+% To differentiate between the two, the width of the float is compared to \cmd\textwidth.
+% This comparison is encapsulated in the macro \cmd\@if@notdblfloat, which should be used whenever
+% such a determination must be made. This procedure returns a Boolean.
+% \begin{macrocode}
+\mathchardef\do@startpage@pen=10006
+\@namedef{output@-\the\do@startpage@pen}{\do@startpage}%
+\def\do@startpage{%
+ \setbox\@cclv\vbox{\unvbox\@cclv\setbox\z@\lastbox\unskip}%
+ \clearpage@sw{\@clearfloatplacement}{\@dblfloatplacement}%
+ \set@colht
+ \@booleanfalse\pfloat@avail@sw
+ \begingroup
+ \@booleanfalse\float@avail@sw
+ \@tryfcolumn\test@dblfloat
+ \float@avail@sw{\aftergroup\@booleantrue\aftergroup\pfloat@avail@sw}{}%
+ \endgroup
+ \fcolmade@sw{%
+ \global\setbox\pagesofar\vbox{\unvbox\pagesofar\unvbox\@outputbox}%
+ \@combinepage
+ \@combinedblfloats
+ \@outputpage
+ \global\pagegrid@cur\@ne
+ \protect@penalty\do@startpage@pen
+ }{%
+ \begingroup
+ \@booleanfalse\float@avail@sw
+ \let\@elt\@sdblcolelt
+ \let\reserved@b\@deferlist\global\let\@deferlist\@empty\reserved@b
+ \endgroup
+ \@ifdim{\@colht=\textheight}{% No luck...
+ \pfloat@avail@sw{% ...but a float *was* available!
+ \forcefloats@sw{%
+ \ltxgrid@warn{Forced dequeueing of floats stalled}%
+ }{%
+ \ltxgrid@warn{Dequeueing of floats stalled}%
+ }%
+ }{}%
+ }{}%
+ \outputpenalty\@M
+ \dead@cycle
+ }%
+ \check@deferlist@stuck\do@startpage
+ \set@colht
+%\set@colroom
+}%
+\def\@sdblcolelt#1{\def\@currbox{#1}\@addtodblcol}%
+\def\test@dblfloat#1{%
+ \@if@notdblfloat{#1}{\@testtrue}{}%
+ \@if@sw\if@test\fi{}{\aftergroup\@booleantrue\aftergroup\float@avail@sw}%
+}%
+\def\@if@notdblfloat#1{\@ifdim{\wd#1<\textwidth}}%
+\@booleanfalse\forcefloats@sw
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@addtodblcol}
+%
+% The procedure \cmd\@addtodblcol\ is called into play at the beginning of each fresh page
+% and operates on each deferred float, in the hopes of placing one or more such floats
+% at the top of the current page.
+%
+% We alter the procedure of standard \LaTeX\ by putting failed floats into
+% \cmd\@deferlist\ instead of \cmd\@dbldeferlist. Having done so, we must have a means
+% of differentiating full-page-width floats from column-width floats.
+% We assume that the latter will always be narrower than \cmd\textwidth.
+%
+% In aid of detecting a stalled float flushing process, we set a Boolean if we encounter
+% a qualified full-page-width float here. Any that qualify but fail the rest of the tests
+% might still pass when reconsidered on an otherwise blank page.
+% \begin{macrocode}
+\def\@addtodblcol{%
+ \begingroup
+ \@if@notdblfloat{\@currbox}{%
+ \false@sw
+ }{%
+ \@setfloattypecounts
+ \@getfpsbit \tw@
+ \@bitor \@currtype \@deferlist
+ \@if@sw\if@test\fi{%
+ \false@sw
+ }{%
+ \@ifodd\@tempcnta{%
+ \aftergroup\@booleantrue\aftergroup\float@avail@sw
+ \@flsetnum \@dbltopnum
+ \@ifnum{\@dbltopnum>\z@}{%
+ \@ifdim{\@dbltoproom>\ht\@currbox}{%
+ \true@sw
+ }{%
+ \@ifnum{\@fpstype<\sixt@@n}{%
+ \begingroup
+ \advance \@dbltoproom \@textmin
+ \@ifdim{\@dbltoproom>\ht\@currbox}{%
+ \endgroup\true@sw
+ }{%
+ \endgroup\false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }%
+ }%
+ {%
+ \@tempdima -\ht\@currbox
+ \advance\@tempdima
+ -\@ifx{\@dbltoplist\@empty}{\dbltextfloatsep}{\dblfloatsep}%
+ \global \advance \@dbltoproom \@tempdima
+ \global \advance \@colht \@tempdima
+ \global \advance \@dbltopnum \m@ne
+ \@cons \@dbltoplist \@currbox
+ }{%
+ \@cons \@deferlist \@currbox
+ }%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tryfcolumn}
+% \begin{macro}{\@wtryfc}
+% \begin{macro}{\@xtryfc}
+% \begin{macro}{\@ztryfc}
+% Whenever a page is shipped out, \LaTeX\ automatically tries out a float column:
+% a page containing nothing but floats (and, as we have added here, split footnotes).
+%
+% The following four procedures employ certain macros to communicate between each other:
+%
+% \cmd\fcolmade@sw, a boolean, says whether we were successful in making a float column.
+%
+% \cmd\if@test, a \cmd\newif\ switch, says a float has failed some test.
+%
+% \cmd\@deferlist, is the input to the process, a list, of deferred floats.
+%
+% \cmd\@trylist, a list, stores the deferred floats to be tried out on the float column.
+%
+% \cmd\@failedlist, a list of floats that have failed the selection for the float column.
+%
+% \cmd\@flfail, a list of floats that have failed the second selection for the float column.
+%
+% \cmd\@flsucceed, a list, the floats that have been successfully placed on the float column.
+%
+% \cmd\@freelist, a list, receives any freed floats.
+%
+% \cmd\@colht, a dimen, the available space for the column, including column floats and insertions (footnotes).
+%
+% \cmd\@fpmin, a dimen, the required minimum height for the float column.
+%
+% \cmd\@outputbox, a box, the output of the process.
+%
+% \cmd\@fptop, \cmd\@fpsep, \cmd\@fpbot, glue, placed above, between, and below floats on the float column.
+%
+% \cmd\@currtype, a count, used temporarily for the float's bits.
+%
+% \cmd\@tempcnta, a count, used temporarily for the float's bits.
+%
+% In \cmd\@tryfcolumn, we alter the criterion for a float page, because if footnotes are present at this point
+% (presumably due to a split insertion) then \cmd\@fpmin is no longer the right threshold to apply.
+%
+% Note that we have changed \cmd\@tryfcolumn, \cmd\@xtryfc, and \cmd\@ztryfc\ syntactically so that the procedure
+% to test for the float's being a column float versus a full-page-width float is passed in as an
+% argument.
+%
+% \begin{macrocode}
+\def\@tryfcolumn#1{%
+ \global\@booleanfalse\fcolmade@sw
+ \@ifx@empty\@deferlist{}{%
+ \global\let\@trylist\@deferlist
+ \global\let\@failedlist\@empty
+ \begingroup
+ \dimen@\vsize\advance\dimen@-\pagegoal\@ifdim{\dimen@>\z@}{%
+ \advance\@fpmin-\dimen@
+ }{}%
+ \def\@elt{\@xtryfc#1}\@trylist
+ \endgroup
+ \fcolmade@sw{%
+ \global\setbox\@outputbox\vbox{\vskip \@fptop}%
+ \let \@elt \@wtryfc \@flsucceed
+ \global\setbox\@outputbox\vbox{\unvbox\@outputbox
+ \unskip \vskip \@fpbot
+ }%
+ \let \@elt \relax
+ \xdef\@deferlist{\@failedlist\@flfail}%
+ \xdef\@freelist{\@freelist\@flsucceed}%
+ }{}%
+ }%
+}%
+\def\@wtryfc #1{%
+ \global\setbox\@outputbox\vbox{\unvbox\@outputbox
+ \box #1\vskip\@fpsep
+ }%
+}%
+\def\@xtryfc#1#2{%
+ \@next\reserved@a\@trylist{}{}% trim \@trylist. Ugly!
+ \@currtype \count #2%
+ \divide\@currtype\@xxxii\multiply\@currtype\@xxxii
+ \@bitor \@currtype \@failedlist
+ \@testfp #2%
+ #1#2%
+ \@ifdim{\ht #2>\@colht }{\@testtrue}{}%
+ \@if@sw\if@test\fi{%
+ \@cons\@failedlist #2%
+ }{%
+ \begingroup
+ \gdef\@flsucceed{\@elt #2}%
+ \global\let\@flfail\@empty
+ \@tempdima\ht #2%
+ \def \@elt {\@ztryfc#1}\@trylist
+ \@ifdim{\@tempdima >\@fpmin}{%
+ \global\@booleantrue\fcolmade@sw
+ }{%
+ \@cons\@failedlist #2%
+ }%
+ \endgroup
+ \fcolmade@sw{%
+ \let \@elt \@gobble
+ }{}%
+ }%
+}%
+\def\@ztryfc #1#2{%
+ \@tempcnta \count#2%
+ \divide\@tempcnta\@xxxii\multiply\@tempcnta\@xxxii
+ \@bitor \@tempcnta {\@failedlist \@flfail}%
+ \@testfp #2%
+ #1#2%
+ \@tempdimb\@tempdima
+ \advance\@tempdimb \ht#2\advance\@tempdimb\@fpsep
+ \@ifdim{\@tempdimb >\@colht}{%
+ \@testtrue
+ }{}%
+ \@if@sw\if@test\fi{%
+ \@cons\@flfail #2%
+ }{%
+ \@cons\@flsucceed #2%
+ \@tempdima\@tempdimb
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Clearing pages}%
+%
+% Clearing the page is an elaboration of ending the page: it entails flushing all floats.
+%
+% This package might make number of float flushing algorithms available,
+% a very simple one that does not try to produce excellent pages,
+% another that tries to make the best use of space,
+% and a more complex one that tries to balance columns.
+%
+% At the beginning of the page-clearing process, by definition all of the paragraph text involved is on the MVL and all floats have been encountered.
+% There may be material in \cmd\pagesofar, and (in a multi-column page grid) any number of columns of the page have been composed.
+% Also, there might be footnote material saved up in \cmd\footbox.
+%
+% Because we did not want to perform multiple \cmd\shipout s per visit to the output routine,
+% our multi-column page makeup will not compose multiple columns per visit.
+% This implementation detail may not require alteration, but it is not a limitation that is truly necessary:
+% it is only multiple \cmd\shipout s per visit that must be avoided.
+%
+% The crux matter is how to continue with flushing floats even after the material in the MVL is exhausted.
+% At that point, we must, upon completion of the output routine,
+% insert into the MVL an interrupt that triggers the next step in the processing.
+%
+% Therefore, after processing a \cmd\do@startcolumn\ interrupt, we must somehow force the completion of that column.
+% This could be done by inserting a \cmd\do@newpage@pen\ interrupt.
+%
+% And after processing a \cmd\do@startpage@pen\ interrupt, that results in \cmd\@dbltopinsert s,
+% we must ensure that the multiple columns on the page get completed, so that the page itself finally gets shipped out.
+% This part will proceed automatically given that \cmd\do@startcolumn\ processing completes successfully.
+%
+% The process will not be complete until all deferred floats have been placed and shipped out, and all saved-up footnotes have been inserted.
+%
+% Full-page-width floats can get out of order of column floats. This problem can be remedied by holding them all in the same list.
+% We therefore stop using \cmd\@dbldeferlist\ entirely, and all of the procedures that formerly used it have been rewritten to
+% use \cmd\@deferlist\ instead. When traversing the list, we apply a selector on the given box that determines whether it is a column-width or page-width float.
+% This selector is different depending on the page grid.
+%
+% When the \cmd\@deferlist\ is processed (by any means), we have to take care of the case where a float of one category is passed over but we are looking for a float of the other category.
+% Here, we must terminate processing, to avoid disordering the floats. This we do by the usual means.
+%
+% The system has a Boolean that says we are clearing pages: \cmd\clearpage@sw; if it is true,
+% then at the tail of \cmd\do@startcolumn\ processing, we should put down a (\cmd\vfil?) \cmd\do@newpage@pen\ interrupt.
+% This is because the MVL is now empty, so we have to force the columns to complete.
+%
+% One potential very pathological case would be where there is one or more deferred floats that never successfully get placed:
+% placing floats has stalled, and we will ship out blank pages indefinitely. How to detect this case?
+%
+% First, \cmd\do@startpage\ will evidently be stalled if the following are all true:
+% a) \cmd\@tryfcolumn\ and \cmd\@sdblcolelt\ both fail,
+% b) there are deferred floats available for page placement, and
+% c) the \cmd\@colht=\cmd\textheight, that is, the full page height is available for placement of column floats.
+%
+% Second, \cmd\do@startcolumn\ will evidently be stalled if the following are all true:
+% a) tryfcolumn fails,
+% b) there are deferred floats available for column placement, and
+% a) the \cmd\@colroom=\cmd\textheight, that is, the full page height is available for placement of column floats.
+%
+%
+% \begin{macro}{\cleardoublepage}
+% \begin{macro}{\clearpage}
+% \begin{macro}{\newpage}
+% \begin{macro}{\newpage@prep}
+% The function of \cmd\clearpage\ is to end the current page with \cmd\newpage\ and then
+% ship out additional pages until (\footins) inserts and (deferred) floats are exhausted.
+%
+% The method involves setting the float placement parameters to completely permissive values
+% and kicking out the current page (using a non-discardable penalty).
+% A possibly short page will be shipped out, followed
+% by any number of float pages. However these float pages, because using permissive float placement,
+% will exhaust all inserts and deferred floats.
+%
+% Bug Note: in the code for \cmd\clearpage, the first penalty we output is an unprotected \cmd\pagebreak@pen.
+% I tried using a protected \cmd\do@newpage@pen, but that gave rise to a corner case where a blank page
+% was output.
+%
+% At present, the \cmd\clearpage\ procedure does the same as \cmd\newpage,
+% except that \cmd\clearpage@sw\ is turned on,
+% and the (discardable) \cmd\newpage\ is inevitably followed by the same procedures
+% that are executed if a page is shipped out.
+%
+% FIXME: it seems that better than \cmd\pagebreak@pen\ would be an unprotected penalty of a special value that would
+% entail output routine processing consisting of the following steps:
+% 3) \cmd\unvbox\cmd\@cclv,
+% 1) set \cmd\clearpage@sw\ to \cmd\true@sw,
+% 2) put down a protected \cmd\do@startcolumn@pen,
+% 4) take a dead cycle.
+%
+% The effect would be to liberalize float placement options for the current column as well as further columns that may be output as part of \cmd\clearpage\ processing.
+% Of course, it would still be necessary to set \cmd\clearpage@sw\ again via an interrupt.
+%
+% An optimization might be to clear \cmd\clearpage@sw\ as part of the same interrupt,
+% but that would actually not work properly, because it is necessary for \cmd\do@endpage\ to
+% possibly invoke furhter visits to the output routine before clearpage processing ceases.
+% \begin{macrocode}
+\def\newpage@prep{%
+ \if@noskipsec
+ \ifx \@nodocument\relax
+ \leavevmode
+ \global \@noskipsecfalse
+ \fi
+ \fi
+ \if@inlabel
+ \leavevmode
+ \global \@inlabelfalse
+ \fi
+ \if@nobreak \@nobreakfalse \everypar{}\fi
+ \par
+}%
+\def \newpage {%
+ \newpage@prep
+ \do@output@MVL{%
+ \vfil
+ \penalty-\pagebreak@pen
+ }%
+}%
+\def\clearpage{%
+ \newpage@prep
+ \do@output@MVL{%
+ \vfil
+ \penalty-\pagebreak@pen
+ \global\@booleantrue\clearpage@sw
+ \protect@penalty\do@startcolumn@pen
+ \protect@penalty\do@endpage@pen
+ }%
+ \do@output@MVL{%
+ \global\@booleanfalse\clearpage@sw
+ }%
+}%
+\def\cleardoublepage{%
+ \clearpage
+ \@if@sw\if@twoside\fi{%
+ \@ifodd\c@page{}{%
+ \null\clearpage
+ }%
+ }{}%
+}%
+\@booleanfalse\clearpage@sw
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\do@endpage@pen}
+% The penalty \cmd\do@endpage@pen\ simply dispatches to the page grid procedure that forces an end page.
+% That procedure should test whether there is anything to ship out (say committed floats), then act accordingly.
+% Note that as part of this work, it should \cmd\unvbox\cmd\@cclv, which has been left boxed up so it can be
+% measured.
+% \begin{macrocode}
+\mathchardef\do@endpage@pen=10007
+\@namedef{output@-\the\do@endpage@pen}{%
+ \csname end@column@\thepagegrid\endcsname
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do@newpage@pen}
+% The penalty \cmd\do@newpage@pen\ allows a ``non-discardable \cmd\newpage'' command:
+% a \cmd\newpage\ command that will not disappear at a pagebreak.
+% This visit to the output routine will not be dispatched to an interrupt,
+% rather the natural output routine will be executed, where it
+% will remove the protection box.
+%
+% Call this routine by executing \cmd\protect@penalty\cmd\do@newpage@pen.
+% \begin{macrocode}
+\mathchardef\do@newpage@pen=10001
+\expandafter\let\csname output@-\the\do@newpage@pen\endcsname\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@clearfloatplacement}
+% The procedure \cmd\@clearfloatplacement\ sets all of the float placement parameters
+% to completely permissive values. The standard values appear as comments.
+% \begin{macrocode}
+\def\@clearfloatplacement{%
+ \global\@topnum \maxdimen % \c@topnumber
+ \global\@toproom \maxdimen % \topfraction\@colht
+ \global\@botnum \maxdimen % \c@bottomnumber
+ \global\@botroom \maxdimen % \bottomfraction\@colht
+ \global\@colnum \maxdimen % \c@totalnumber
+%\global\@fpmin \z@ % \floatpagefraction\@colht
+ \global\@dbltopnum \maxdimen % \c@dbltopnumber
+ \global\@dbltoproom \maxdimen % \dbltopfraction\@colht
+ \global\@textmin \z@ % \@colht\advance \@textmin -\@dbltoproom
+ \global\@fpmin \z@ % \dblfloatpagefraction\textheight
+ \let\@testfp\@gobble
+ \appdef\@setfloattypecounts{\@fpstype16\advance\@fpstype\m@ne}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@doclearpage}
+% The \cmd\@doclearpage\ procedure is now obsoleted, as is \cmd\@makefcolumn, which it invoked.
+% \begin{macrocode}
+\let\@doclearpage\@undefined
+\let\@makefcolumn\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clr@top@firstmark}
+% \begin{macro}{\set@top@firstmark}
+% \begin{macro}{\@outputpage}
+% We want accurate values of \cmd\topmark\ and \cmd\firstmark, but we must deal with
+% the fact that there are many different ways of contributing material
+% to the page. Only upon the first contribution to the page is the value of \cmd\topmark\
+% accurate. However, with \cmd\firstmark\ we must potentially examine each contribution
+% because the first mark on the page may happen to fall in the last piece of material contributed.
+%
+% To begin, we define the procedure that initializes the macros to appropriate flag values.
+% \begin{macrocode}
+\def\clr@top@firstmark{%
+ \global\let\saved@@topmark\@undefined
+ \global\let\saved@@firstmark\@empty
+ \global\let\saved@@botmark\@empty
+}%
+\clr@top@firstmark
+% \end{macrocode}
+%
+% Note that the flag value for \cmd\saved@@topmark\ is \cmd\@undefined, just as one would
+% expect. But that for \cmd\saved@@firstmark\ and \cmd\saved@@botmark\ is \cmd\@empty.
+%
+% Next, we define procedure \cmd\set@top@firstmark; it will be exercised everywhere material is contributed,
+% capturing the mark values if appropriate.
+% \begin{macrocode}
+\def\set@top@firstmark{%
+ \@ifxundefined\saved@@topmark{\expandafter\gdef\expandafter\saved@@topmark\expandafter{\@@topmark}}{}%
+ \@if@empty\saved@@firstmark{\expandafter\gdef\expandafter\saved@@firstmark\expandafter{\@@firstmark}}{}%
+ \@if@empty\@@botmark{}{\expandafter\gdef\expandafter\saved@@botmark\expandafter{\@@botmark}}%
+}%
+% \end{macrocode}
+% When should \cmd\set@top@firstmark\ be called?
+% A good candidate for a universal procedure for handling contributed material is
+% the natural output routine; are any other calls needed?
+%
+% Yes, in \cmd\save@column\ we must execute \cmd\set@top@firstmark\ because we are about to
+% save away \cmd\box\cmd\@cclv, and we will never see its marks again (unless it is unboxed into the MVL),
+% because \TeX\ lets one access a box's marks only within an output routine that has put that box into \cmd\box\cmd\@cclv.
+%
+% As soon as a page is shipped out, we initialize the two macros that
+% hold the values of \cmd\topmark\ and \cmd\firstmark, respectively.
+% \LaTeX\ has exactly one procedure \cmd\@outputpage\ that does \cmd\shipout,
+% which is as it should be: we tailpatch it, and the job is done.
+% \begin{macrocode}
+\appdef\@outputpage{%
+ \clr@top@firstmark
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Other interfaces to \LaTeX}%
+%
+% \begin{macro}{\@float}
+% \begin{macro}{\@dblfloat}
+% \begin{macro}{\@yfloat}
+% \begin{macro}{\fps@}
+% \begin{macro}{\fpsd@}
+% The \LaTeX\ kernel procedures \cmd\@float\ and \cmd\@dblfloat\ are treated on an equal footing.
+% Each now takes environment-specific float placement defaults.
+% If none are defined for the calling environment, we apply a default.
+%
+% A parameter is passed that will set the width of text within the float, normally \cmd\columnwidth,
+% and in the "dbl" version, \cmd\textwidth. However, an environment such as \env{turnpage}
+% may change the meanings of these macros to allow turnpage floats.
+%
+% \begin{macrocode}
+\def\@float#1{%
+ \@ifnextchar[{%}]{%Brace-matching klootch
+ \@yfloat\width@float{#1}%
+ }{%
+ \@ifxundefined@cs{fps@#1}{%
+ \edef\reserved@a{\noexpand\@yfloat\noexpand\width@float{#1}[\csname fps@\endcsname]}\reserved@a
+ }{%
+ \edef\reserved@a{\noexpand\@yfloat\noexpand\width@float{#1}[\csname fps@#1\endcsname]}\reserved@a
+ }%
+ }%
+}%
+\def\@dblfloat#1{%
+ \@ifnum{\pagegrid@col=\@ne}{%
+ \@float{#1}%
+ }{%
+ \@ifnextchar[{%}]{%Brace-matching klootch
+ \@yfloat\widthd@float{#1}%
+ }{%
+ \@ifxundefined@cs{fpsd@#1}{%
+ \edef\reserved@a{\noexpand\@yfloat\noexpand\widthd@float{#1}[\csname fpsd@\endcsname]}\reserved@a
+ }{%
+ \edef\reserved@a{\noexpand\@yfloat\noexpand\widthd@float{#1}[\csname fpsd@#1\endcsname]}\reserved@a
+ }%
+ }%
+ }%
+}%
+\def\@yfloat#1#2[#3]{%
+ \@xfloat{#2}[#3]%
+ \hsize#1\linewidth\hsize
+ \minipagefootnote@init
+}%
+\def\fps@{tbp}%
+\def\fpsd@{tp}%
+\def\width@float{\columnwidth}%
+\def\widthd@float{\textwidth}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\end@float}
+% \begin{macro}{\end@dblfloat}
+% \begin{macro}{\end@@float}
+% \begin{macro}{\check@currbox@count}
+% \begin{macro}{\minipagefootnote@init}
+% \begin{macro}{\minipagefootnote@here}
+% \LaTeX\ kernel procedures \cmd\end@float\ and \cmd\end@dblfloat\
+% have been changed to work alike; in particular, floats of both classes
+% are deferred into the same queue.
+% This measure ensures that they will be placed in their original order,
+% an aspect in which \LaTeX\ is broken.
+%
+% Note: when retrieving floats from the queues, we can differentiate those of the two categories
+% by the width of the box.
+%
+% Floats are processed via an output routine message, and are checked for
+% sanity in re the float placement options. In the case of full-page-width floats,
+% we ensure that the h and b float placement options are never asserted, because they
+% make no sense.
+%
+% Note that if we get to the end of the float box and still have pending
+% footnotes, we put then out.
+%
+% LaTeX Bug note: if a user types \cmd\begin{table*}[h], the float will never succeed in being placed!
+% we try to catch such cases.
+%
+% Note that the macro \cmd\check@currbox@count\ trys to catch cases where the float placement options
+% are such that the float can never be placed.
+% \begin{macrocode}
+\def\end@float{%
+ \end@@float{%
+ \check@currbox@count
+ }%
+}%
+\def\end@dblfloat{%
+ \@ifnum{\pagegrid@col=\@ne}{%
+ \end@float
+ }{%
+ \end@@float{%
+ \@boxfpsbit\@currbox{1}\@ifodd\@tempcnta{\global\advance\count\@currbox\m@ne}{}%
+ \@boxfpsbit\@currbox{4}\@ifodd\@tempcnta{\global\advance\count\@currbox-4\relax}{}%
+ \global\wd\@currbox\textwidth % Klootch
+ \check@currbox@count
+ }%
+ }%
+}%
+\def\end@@float#1{%
+ \minipagefootnote@here
+%\minipagefootnotes
+ \@endfloatbox
+ #1%
+ \@ifnum{\@floatpenalty <\z@}{%
+ \@largefloatcheck
+ \@cons\@currlist\@currbox
+ \@ifnum{\@floatpenalty <-\@Mii}{%
+ \do@output@cclv{\@add@float}%
+ }{%
+ \vadjust{\do@output@cclv{\@add@float}}%
+ \@Esphack
+ }%
+ }{}%
+}%
+\def\check@currbox@count{%
+ \@ifnum{\count\@currbox>\z@}{%
+ \count@\count\@currbox\divide\count@\sixt@@n\multiply\count@\sixt@@n
+ \@tempcnta\count\@currbox\advance\@tempcnta-\count@
+ \@ifnum{\@tempcnta=\z@}{%
+ \ltxgrid@warn{Float cannot be placed}%
+ }{}%
+ }{%
+ % Is a \marginpar
+ }%
+}%
+\providecommand\minipagefootnote@init{}%
+\providecommand\minipagefootnote@here{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@specialoutput}
+% The \cmd\@add@float\ procedure used to reside in standard \LaTeX's \cmd\@specialoutput,
+% which is no more.
+%
+% Historical Note: \cmd\@specialoutput\ and Lamport's method of an output routine dispatcher
+% is the genesis of our more powerful and refined way of using \TeX's output routine to
+% safely accomplish page makeup tasks. To it and to him we owe acknowledgement and thanks.
+% \begin{macrocode}
+\let\@specialoutput\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@add@float}
+% In the following, we do not need to execute \cmd\@reinserts, which was wrong anyway, as you cannot
+% reliably recover insertions when they split (unless you have a way of reinserting the captured insertion
+% ahead of the split-off part).
+%
+% Now that full-page-width floats are being processed the same as column floats, we
+% have to nip in here and cause them always to be deferred.
+%
+% At the very end, the \cmd\vsize\ is adjusted for any newly committed float.
+% \begin{macrocode}
+\def\@add@float{%
+ \@pageht\ht\@cclv\@pagedp\dp\@cclv
+ \unvbox\@cclv
+ \@next\@currbox\@currlist{%
+ \csname @floatselect@sw@\thepagegrid\endcsname\@currbox{%
+ \@ifnum{\count\@currbox>\z@}{%
+ \advance \@pageht \@pagedp
+ \advance \@pageht \vsize \advance \@pageht -\pagegoal % do not assume \holdinginserts is cleared!
+% \@ifvbox\@kludgeins{%
+% \@ifdim{\wd\@kludgeins=\z@}{%
+% \advance \@pageht \ht\@kludgeins
+% }{}%
+% }{}%
+% \@reinserts
+ \@addtocurcol % Commit an h float
+ }{%
+% \@reinserts
+ \@addmarginpar
+ }%
+ }{%
+ \@resethfps
+ \@cons\@deferlist\@currbox
+ }%
+ }{\@latexbug}%
+ \@ifnum{\outputpenalty<\z@}{%
+ \@if@sw\if@nobreak\fi{%
+ \nobreak
+ }{%
+ \addpenalty \interlinepenalty
+ }%
+ }{}%
+ \set@vsize
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@reinserts}
+% The \cmd\@reinserts\ procedure of standard \LaTeX\ is now obsoleted.
+% \begin{macrocode}
+\let\@reinserts\@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@addtocurcol}
+% We modify the \cmd\@addtocurcol\ procedure of standard \LaTeX\
+% so that a float placed ``here'' may break over pages.
+% \begin{macrocode}
+\def \@addtocurcol {%
+ \@insertfalse
+ \@setfloattypecounts
+ \ifnum \@fpstype=8
+ \else
+ \ifnum \@fpstype=24
+ \else
+ \@flsettextmin
+ \advance \@textmin \@textfloatsheight
+ \@reqcolroom \@pageht
+ \ifdim \@textmin>\@reqcolroom
+ \@reqcolroom \@textmin
+ \fi
+ \advance \@reqcolroom \ht\@currbox
+ \ifdim \@colroom>\@reqcolroom
+ \@flsetnum \@colnum
+ \ifnum \@colnum>\z@
+ \@bitor\@currtype\@deferlist
+ \if@test
+ \else
+ \@bitor\@currtype\@botlist
+ \if@test
+ \@addtobot
+ \else
+ \ifodd \count\@currbox
+ \advance \@reqcolroom \intextsep
+ \ifdim \@colroom>\@reqcolroom
+ \global \advance \@colnum \m@ne
+ \global \advance \@textfloatsheight \ht\@currbox
+ \global \advance \@textfloatsheight 2\intextsep
+ \@cons \@midlist \@currbox
+ \if@nobreak
+ \nobreak
+ \@nobreakfalse
+ \everypar{}%
+ \else
+ \addpenalty \interlinepenalty
+ \fi
+ \vskip \intextsep
+ \unvbox\@currbox %AO
+ \penalty\interlinepenalty
+ \vskip\intextsep
+ \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi
+ \outputpenalty \z@
+ \@inserttrue
+ \fi
+ \fi
+ \if@insert
+ \else
+ \@addtotoporbot
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \if@insert
+ \else
+ \@resethfps
+ \@cons\@deferlist\@currbox
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@twocolumn}
+% The \cmd\newif\ switch \cmd\if@twocolumn\ is entirely unused. However its access words are invoked by
+% \LaTeX's \cmd\document\ procedure, so we de-fang it.
+% \begin{macrocode}
+\@twocolumnfalse
+\let\@twocolumntrue\@twocolumnfalse
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@addmarginpar}
+% The procedure \cmd\@addmarginpar\ used to access \cmd\if@twocolumn, but that switch is not reliable;
+% the better way is to use \cmd\thepagegrid. We establish a convention for a page-grid-oriented
+% procedure, e.g., \cmd\@addmarginpar@one, that emits a boolean, telling this procedure
+% whether to set the marginpar on the left or right.
+% \begin{macrocode}
+\def\@addmarginpar{%
+ \@next\@marbox\@currlist{%
+ \@cons\@freelist\@marbox\@cons\@freelist\@currbox
+ }\@latexbug
+ \setbox\@marbox\hb@xt@\columnwidth{%
+ \csname @addmarginpar@\thepagegrid\endcsname{%
+ \hskip-\marginparsep\hskip-\marginparwidth
+ \box\@currbox
+ }{%
+ \hskip\columnwidth\hskip\marginparsep
+ \box\@marbox
+ }%
+ \hss
+ }%
+ \setbox\z@\box\@currbox
+ \@tempdima\@mparbottom
+ \advance\@tempdima -\@pageht
+ \advance\@tempdima\ht\@marbox
+ \@ifdim{\@tempdima >\z@}{%
+ \@latex@warning@no@line {Marginpar on page \thepage\space moved}%
+ }{%
+ \@tempdima\z@
+ }%
+ \global\@mparbottom\@pageht
+ \global\advance\@mparbottom\@tempdima
+ \global\advance\@mparbottom\dp\@marbox
+ \global\advance\@mparbottom\marginparpush
+ \advance\@tempdima -\ht\@marbox
+ \global\setbox \@marbox
+ \vbox {\vskip \@tempdima
+ \box \@marbox}%
+ \global \ht\@marbox \z@
+ \global \dp\@marbox \z@
+ \kern -\@pagedp
+ \nointerlineskip
+ \box\@marbox
+ \nointerlineskip
+ \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{turnpage}
+% Any float (viz., \env{figure} or \env{table}) within the scope of this environment
+% will be a turnpage float: It will be assumed to occupy an entire page (constitute a float page),
+% the width will be \cmd\textheight, the height \cmd\textwidth, and the entire float will be presented
+% rotated 90 degrees.
+%
+% The implementation requires the services of the \cmd\rotatebox\ command, so we supply a dummy definition
+% that explains things to the user.
+% \begin{macrocode}
+\newenvironment{turnpage}{%
+ \def\width@float{\textheight}%
+ \def\widthd@float{\textheight}%
+ \appdef\@endfloatbox{%
+ \@ifxundefined\@currbox{%
+ \ltxgrid@warn{Cannot rotate! Not a float}%
+ }{%
+ \setbox\@currbox\vbox to\textwidth{\vfil\unvbox\@currbox\vfil}%
+ \global\setbox\@currbox\vbox{\rotatebox{90}{\box\@currbox}}%
+ }%
+ }%
+}{%
+}%
+\def\rotatebox@dummy#1#2{%
+ \ltxgrid@warn{You must load the graphics or graphicx package in order to use the turnpage environment}%
+ #2%
+}%
+\AtBeginDocument{%
+ \@ifxundefined\rotatebox{\let\rotatebox\rotatebox@dummy}{}%
+}%
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \subsection{One-off output routines}
+%
+% These procedures are executed in lieu of \cmd\the\cmd\output\ when the output penalty has the associated flag value.
+%
+% \begin{macro}{output@-1073741824}
+% The first one-off output routine handles the end of the job, wherein
+% \LaTeX\ executes \cmd\@@end, and breaks to the output with a penalty of
+% $"40000000 = 2^{32}/4$. We simply discard \cmd\box\cmd\@cclv\ and leave.
+% This means that \LaTeX\ is obligated to do \cmd\clearpage\ as part of
+% its \enve{document} processing, otherwise material will be lost.
+% \begin{macrocode}
+\@namedef{output@-1073741824}{%"40000000
+ \deadcycles\z@
+%\showbox\@cclv
+ \setbox\z@\box\@cclv
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\save@column@pen}
+% The one-off output routine associated with \cmd\penalty\cmd\save@column@pen\
+% will be called within a sequence of three such routines by \cmd\execute@message
+% or its companion routine \cmd\execute@message@insert.
+% This procedure must save away any the current page and preserve marks.
+% \begin{macrocode}
+\mathchardef\save@column@pen=10016
+\@namedef{output@-\the\save@column@pen}{\save@column}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@cclv@saved}
+% We take over the \cmd\@holdpg\ box register. Hereafter,
+% we no longer use the \cmd\@holdpg\ box register, so let the world know.
+% This should decisively break packages that assume standard \LaTeX.
+% Breaking decisively is preferred to quietly proceeding erroneously.
+% \begin{macrocode}
+\let \@cclv@saved \@holdpg
+\let \@holdpg \@undefined
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\save@column}
+% The procedure \cmd\save@column\ does the actual work of saving away the material
+% on the page. It is invoked both by \cmd\save@column@pen\ and by \cmd\save@column@insert@pen.
+% We save \cmd\box\cmd\@cclv\ and the primitive \cmd\@@topmark.
+% \begin{macrocode}
+\def\save@column{%
+ \@ifvoid\@cclv@saved{%
+ \set@top@firstmark
+ \global\@topmark@saved\expandafter{\@@topmark}%
+ }{}%
+ \global\setbox\@cclv@saved\vbox{%
+ \@ifvoid\@cclv@saved{}{%
+ \unvbox\@cclv@saved
+ \marry@baselines
+ }%
+ \unvbox\@cclv
+ \lose@breaks
+ \setbox\z@\lastbox
+ }%
+}%
+\newtoks\@topmark@saved
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\prep@cclv}
+% The procedure \cmd\prep@cclv\ is used by message handlers to set up their environment
+% to ape that of the usual output routine, with the boxed-up page in \cmd\box\cmd\@cclv.
+% Here, we retrieve the material from \cmd\@cclv@saved, where it was saved away by
+% the one-off output routine associated with \cmd\save@column@pen.
+% \begin{macrocode}
+\def\prep@cclv{%
+ \setbox\z@\box\@cclv
+ \setbox\@cclv\box\@cclv@saved
+ \vbadness\@M
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\save@column@insert@pen}
+% The one-off output routine associated with \cmd\penalty\cmd\save@column@insert@pen\
+% is similar to that of \cmd\save@column@pen\ augmented with the processing of insertions.
+% It is called by \cmd\execute@message@insert\ (i.e., at a grid change)
+% and saves away the current page and preserves marks.
+% In addition, it saves away any insertions that fall on the current page.
+% As with the regular output routine, it executes in two phases,
+% first with \cmd\holdinginserts\ set, then with it cleared.
+% \begin{macrocode}
+\mathchardef\save@column@insert@pen=10017
+\@namedef{output@-\the\save@column@insert@pen}{\toggle@insert\savecolumn@holding\savecolumn@moving}%
+% \end{macrocode}
+% The procedure \cmd\savecolumn@holding\ is the first phase of saving a column with its inserts.
+% This phase must detect and remedy the one circumstance that will confound our efforts to propagate marks.
+% It is similar to \cmd\output@holding, except that we have to deal with the protection box, which must
+% remain, because the messaging mechanism is being used.
+%
+% If it appears that we have the pathological ``Big Bad Box'' case at hand, we use the \cmd\dead@cycle@repair@protected\
+% procedure instead of \cmd\dead@cycle\ to do our dead cycle.
+% \begin{macrocode}
+\def\savecolumn@holding{%
+ \@if@exceed@pagegoal{\unvcopy\@cclv\setbox\z@\lastbox}{%
+ \setbox\z@\vbox{\unvcopy\@cclv\setbox\z@\lastbox}%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\z@}}{}%
+ \dimen@\ht\@cclv\advance\dimen@-\ht\z@
+ \dead@cycle@repair@protected\dimen@
+ }{%
+ \dead@cycle
+ }%
+}%
+% \end{macrocode}
+% The procedure \cmd\save@column@moving\ is the second phase of saving a column with its inserts.
+% Now that \cmd\holdinginserts\ is cleared, we can look in the various \cmd\insert\ registers for
+% our inserts (at present there is only one, \cmd\footins).
+% if anything is there, we save it away and ask for another cycle (because it may have split).
+%
+% Note that the message that is about to be executed had better deal properly with the contents of
+% the \cmd\footins@saved\ box.
+% \begin{macrocode}
+\def\savecolumn@moving{%
+ \@cclv@nontrivial@sw{%
+ \save@column
+ }{%
+ {\setbox\z@\box\@cclv}%
+ }%
+ \@ifvoid\footins{}{%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\footins}}{}%
+ \global\setbox\footins@saved\vbox{\unvbox\footins@saved\marry@baselines\unvbox\footins}%
+ \protect@penalty\save@column@insert@pen
+ }%
+}%
+\newbox\footins@saved
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\save@message@pen}
+% The one-off output routine associated with \cmd\penalty\cmd\save@message@pen\
+% saves away the message that has been passed.
+% This procedure is penultimate in a sequence of one-off output routine calls;
+% earlier ones have saved away the MVL and preserved marks, the last executes the message.
+%
+% Note that we are passing tokens to \TeX's primitive \cmd\mark\ mechanism, so we must ensure
+% that they are not inappropriately expanded. We use the same mechanism for all such cases,
+% namely \cmd\let@mark.
+%
+% Note: we expect that \cmd\box\cmd\@cclv's contents are well known:
+% \cmd\topskip, protection box, and a \cmd\mark, the latter havin the
+% message.
+% But if we came here via \cmd\penalty 10017, there might be an \cmd\insert\ node here as well, because
+% a footnote split.
+% Because this procedure simply voids out \cmd\box\cmd\@cclv, such material would be lost.
+% Perhaps we can repair things by manipulating the \cmd\insert \ mechanism temporarily.
+% \begin{macrocode}
+\mathchardef\save@message@pen=10018
+\@namedef{output@-\the\save@message@pen}{\save@message}%
+\def\save@message{%
+ \setbox\z@\box\@cclv %FIXME: what if \box\@cclv is not empty?
+ \toks@\expandafter{\@@firstmark}%
+ \expandafter\gdef\expandafter\@message@saved\expandafter{\the\toks@}%
+ \expandafter\do@@mark\expandafter{\the\@topmark@saved}%
+}%
+\gdef\@message@saved{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\execute@message@pen}
+% The one-off output routine associated with \cmd\execute@message@pen\
+% simply executes the given message. It is last in a sequence of one-off output routine calls;
+% earlier ones have saved all that require saving.
+% \begin{macrocode}
+\mathchardef\execute@message@pen=10019
+\@namedef{output@-\the\execute@message@pen}{\@message@saved}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Output messages}
+%
+% Message handlers are procedures that execute output messages, tokens that are passed to
+% the output routine for execution in an environment appropriate to page makeup.
+%
+% How it works. We put down three large negative penalties, each of which will be handled by
+% the output dispatcher (not the output routine), each penalty being protected by
+% a removable, non-discardable item (i.e., a box).
+% Either three or four invocations of one-off output routines are involved per message.
+%
+% We make the last of the three protection boxes have a depth equal to the value of \cmd\prevdepth\
+% that was current when the procedure is called. This effectively restores \cmd\prevdepth.
+%
+% In each case, the one-off output routine will remove the extraneous box we have inserted.
+% And the second and third one-off routines will simply void \cmd\box\cmd\@cclv, because its contents
+% are entirely artificial.
+%
+% FIXME: not so! If \cmd\holdinginserts\ is cleared, that box may have an insert node; it must be preserved, too.
+%
+% The first routine saves away the current column contents and remembers the \cmd\topmark\ for later
+% use. There is a variant routine that first clears \cmd\holdinginserts, so that the message can
+% handle any inserts present in the boxed-up page; this of course entails yet another
+% visit to the output routine.
+%
+% The penultimate routine saves away the tokens transmitted in via the \cmd\@@mark: the argument of
+% the macro. These tokens are of course the very thing we wish to execute within the safety
+% of the output routine. It also puts down a mark containing the \cmd\topmark\ tokens saved
+% by the first routine. By this means, the mark, which we have clobbered, is restored.
+%
+% The last routine simply executes the given tokens.
+% In the course of doing this, it must take care of \cmd\box\cmd\@cclv, either by shipping it out,
+% or by \cmd\unvbox ing it onto the MVL.
+%
+% \begin{macro}{\execute@message}
+% The procedure \cmd\execute@message\ simply calls the utility procedure \cmd\@execute@message\
+% with a penalty value for the standard treatment.
+% \begin{macrocode}
+\def\execute@message{%
+ \@execute@message\save@column@pen %Implicit #2
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\execute@message@insert}
+% The procedure \cmd\execute@message@insert\ is like \cmd\execute@message\ in all respects
+% except that the penalty value is \cmd\save@column@insert@pen, which arranges for the
+% message handler involved to deal with the page's insertions.
+% At the same time, we prepare the \cmd\footins\ box so that these insertions can be dealt with.
+%
+% Note:
+% If more insertions are added to \LaTeX\ (presumably via \cmd\newinsert), then they
+% must be dealt with in a way entirely analogous to \cmd\footins.
+% \begin{macrocode}
+\def\execute@message@insert#1{%
+ \@execute@message\save@column@insert@pen{\setbox\footins\box\footins@saved#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@execute@message}
+% The utility procedure \cmd\@execute@message\ is called by \cmd\execute@message\ and \cmd\execute@message@insert.
+% We prepare by creating a \cmd\vbox\ containing all the needed nodes and proceed by simply
+% \cmd\unvbox ing that box onto the MVL.
+% We ensure that \cmd\box\cmd\@cclv\ is properly set up for the output message handler
+% by always inserting \cmd\prep@cclv\ in advance of the argument.
+%
+% Note that each one-off output routine is invoked effectively the same as
+% \cmd\protect@penalty, except that the second invocation involves an additional
+% \cmd\mark\ node, and the third a specially prepared protection box.
+%
+% Note also that \TeX's primitive \cmd\mark\ is called here without any expansion protection.
+% This is the only place where it is called that way, but it's OK because those tokens
+% have have been pre-expanded by procedures that call \cmd\execute@message.
+% FIXME: all procedures calling \cmd\execute@message\ must pre-expand their tokens!
+% \begin{macrocode}
+\long\def\@execute@message#1#2{%
+ \begingroup
+ \dimen@\prevdepth\@ifdim{\dimen@<\z@}{\dimen@\z@}{}%
+ \setbox\z@\vbox{%
+ \protect@penalty#1%
+ \protection@box
+ \toks@{\prep@cclv#2}%
+ \@@mark{\the\toks@}%
+ \penalty-\save@message@pen
+% \hbox{\vrule\@height\z@\@width\z@\@depth\dimen@}%
+ \setbox\z@\null\dp\z@\dimen@\ht\z@-\dimen@
+ \nointerlineskip\box\z@
+ \penalty-\execute@message@pen
+ }\unvbox\z@
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do@output@cclv}
+% The procedure \cmd\do@output@cclv\ provides access to message handlers at their simplest.
+% The message will execute in the usual environment of the output routine, with
+% the boxed-up page in \cmd\box\cmd\@cclv, and we assume that \cmd\holdinginserts\ remains set.
+% This procedure must be invoked within main vertical mode;
+% it is the obligation of the macro writer to ensure that this is the case.
+% \begin{macrocode}
+\def\do@output@cclv{\execute@message}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\do@output@MVL}
+% The procedure \cmd\do@output@MVL, like \cmd\do@output@cclv, is an interface for messages,
+% but provides two additional services: the command may also be invoked in horizontal mode, and
+% the message handler will execute with the MVL unboxed.
+% \begin{macrocode}
+\def\do@output@MVL#1{%
+ \@ifvmode{%
+ \begingroup\execute@message{\unvbox\@cclv#1}\endgroup
+ }{%
+ \@ifhmode{%
+ \vadjust{\execute@message{\unvbox\@cclv#1}}%
+ }{%
+ \@latexerr{\string\do@output@MVL\space cannot be executed in this mode!}\@eha
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lose@breaks}
+% The purpose of this procedure is to get rid of all the extraneous
+% \cmd\penalty\cmd\@M\ nodes that tend to build up in the MVL.
+% \begin{macrocode}
+\def\lose@breaks{%
+ \loopwhile{%
+ \count@\lastpenalty
+ \@ifnum{\count@=\@M}{% 10000 is a TeX magic number!
+ \unpenalty\true@sw
+ }{%
+ \false@sw
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\removestuff}
+% \cmd\removestuff\ is a document-level command that removes the bottom skip glue item
+% from the MVL.
+% \begin{macrocode}
+\def\removestuff{\do@output@MVL{\unskip\unpenalty}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\removephantombox}
+% The procedure \cmd\removephantombox\ is a special-purpose message handler exclusively for
+% preventing incorrect spacing above display math. It must be issued in
+% horizontal mode within the phantom paragraph generated when display math starts up in
+% vertical mode.
+% \begin{macrocode}
+\def\removephantombox{%
+ \vadjust{%
+ \execute@message{%
+ \unvbox\@cclv
+ \setbox\z@\lastbox
+ \unskip
+ \unskip
+ \unpenalty
+ \penalty\predisplaypenalty
+ \vskip\abovedisplayskip
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\addstuff}
+% \cmd\addstuff\ is a document-level command that adds penalty, glue, or both to the
+% MVL. The penalty and glue items are rearranged so that all penalties nodes precede all the glue nodes,
+% which is the canonical arrangement.
+% \begin{macrocode}
+\def\addstuff#1#2{\edef\@tempa{\noexpand\do@output@MVL{\noexpand\@addstuff{#1}{#2}}}\@tempa}%
+\def\@addstuff#1#2{%
+ \skip@\lastskip\unskip
+ \count@\lastpenalty\unpenalty
+ \@if@empty{#1}{}{\penalty#1\relax}%
+ \@ifnum{\count@=\z@}{}{\penalty\count@}%
+ \vskip\skip@
+ \@if@empty{#2}{}{\vskip#2\relax}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\replacestuff}
+% \cmd\replacestuff\ is a document-level command similar to \cmd\addstuff;
+% but it replaces penalty, glue, or both in the MVL.
+% The penalty and glue items are rearranged so that all penalties nodes precede all the glue nodes,
+% which is the canonical arrangement.
+% \begin{macrocode}
+\def\replacestuff#1#2{\edef\@tempa{\noexpand\do@output@MVL{\noexpand\@replacestuff{#1}{#2}}}\@tempa}%
+\def\@replacestuff#1#2{%
+ \skip@\lastskip\unskip
+ \count@\lastpenalty\unpenalty
+ \@if@empty{#1}{}{%
+ \@ifnum{\count@>\@M}{}{%
+ \@ifnum{\count@=\z@}{\count@=#1\relax}{%
+ \@ifnum{\count@<#1\relax}{}{%
+ \count@=#1\relax
+ }%
+ }%
+ }%
+ }%
+ \@ifnum{\count@=\z@}{}{\penalty\count@}%
+ \@if@empty{#2}{}{%
+ \@tempskipa#2\relax
+ \@ifdim{\z@>\@tempskipa}{%
+ \advance\skip@-\@tempskipa
+ }{%
+ \@ifdim{\skip@>\@tempskipa}{}{%
+ \skip@\@tempskipa
+ }%
+ }%
+ }%
+ \vskip\skip@
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\move@insertions}
+% \begin{macro}{\hold@insertions}
+% \begin{macro}{\move@insert@sw}
+% In order to avoid bolluxing up \cmd\insert\ registers by our one-off
+% output routines, we set \cmd\holdinginserts\ to zero by default and only
+% clear it (briefly) while we handle cases where we want inserts to show up.
+% \begin{macrocode}
+\def\move@insertions{\global\holdinginserts\z@}%
+\def\hold@insertions{\global\holdinginserts\@ne}%
+\hold@insertions
+\def\move@insert@sw{\@ifnum{\holdinginserts=\z@}}%
+\def\toggle@insert#1#2{%
+ \@ifnum{\holdinginserts=\z@}{\hold@insertions#2}{\move@insertions#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Messages to alter the page grid}%
+%
+% Here is the implementation of the grid-switching procedures.
+% We perform two checks when changing the page grid; first to ensure that
+% the target page grid is known (defensive programming), second to ensure that
+% the switch is a non-trivial one. The latter check must be performed within
+% the safety of the output routine, so requires using an output message.
+% Thus, a grid change requires two messages, for a total of six visits to the output routine.
+%
+% \begin{macro}{\do@columngrid}
+% Utility procedure \cmd\do@columngrid\ changes the page grid.
+% Note that this command forces an end to the current paragraph. This is necessary, because
+% a page grid change makes no sense unless we can alter the \cmd\hsize\ before commencing to
+% typeset the following paragraph. So the command should never be executed in horizontal mode
+% anyway.
+% \begin{macrocode}
+\def\do@columngrid#1#2{%
+ \par
+ \expandafter\let\expandafter\@tempa\csname open@column@#1\endcsname
+ \@ifx{\relax\@tempa}{%
+ \ltxgrid@warn{Unknown page grid #1. No action taken}%
+ }{%
+ \do@output@MVL{\start@column{#1}{#2}}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\start@column}
+% Procedure \cmd\start@column\ lays down the interrupts to switch the page grid.
+% If the change to the page grid would have been trivial, it bails out.
+% It seems a reasonable tradeoff of processing versus security: once we commit
+% to changing the page grid, we clear \cmd\holdinginserts, so there is no turning back.
+%
+% Note that the second argument to the macro allows us to pass an argument to the
+% page grid that is starting up. This can be handy, because a single procedure can
+% handle multiple page grids, differing only by the value of a parameter.
+%
+% FIXME: this means that you cannot switch between mlt page grids in a single step.
+% But do we want to do this, at all, at all?
+% \begin{macrocode}
+\def\start@column#1#2{%
+ \def\@tempa{#1}\@ifx{\@tempa\thepagegrid}{%
+ \ltxgrid@info{Already in page grid \thepagegrid. No action taken}%
+ }{%
+ \expandafter\execute@message@insert
+ \expandafter{%
+ \csname shut@column@\thepagegrid\expandafter\endcsname
+ \csname open@column@#1\endcsname{#2}%
+ \set@vsize
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thepagegrid}
+% The macro \cmd\thepagegrid\ tracks what kind of page grid we are in.
+%
+% Note: Access \cmd\thepagegrid\ only within the safety of the output routine.
+%
+% Warning: The page grid should be changed only within the safety of the output routine.
+% People who write multicol page grid mechanisms appear not to understand the matter, so they
+% should particularly heed this warning. Think about it: obviously Lamport did so, which is why
+% his \cmd\twocolumn\ command forced a pagebreak, which is limiting, but safe.
+% \begin{macrocode}
+\def\thepagegrid{one}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Application Note: implementing a page grid}
+%
+% If you want to create a new page grid for \LaTeX,
+% you must define five procedures with specific names:
+% \cmd\open@column@ name, \cmd\shut@column@ name, \cmd\end@column@ name,
+% \cmd\output@column@ name, and \cmd\@addmarginpar@ name, where ``name'' is the
+% name of your page grid.
+%
+% The procedure \cmd\open@column@ name starts the new page grid. It should define \cmd\thepagegrid,
+% deal with \cmd\box\cmd\pagesofar\ and \cmd\box\cmd\footbox\ (perhaps by leaving them alone),
+% and it should set the values of \LaTeX's page layout parameters for the column size and height.
+%
+% The procedure \cmd\shut@column@ name should expect to be called with \cmd\holdinginserts\
+% cleared (it can assume that \cmd\holdinginserts\ will automatically be restored).
+% It should properly deal with insertions (like footnotes); calling \cmd\@makecol\
+% is a good way to do this. It should know that the page grid is being terminated
+% in the middle of a page, so it should make arrangements to carry the footnotes down to the
+% bottom of the column or page, and it should possibly salt away the material for later
+% incorporation into the page. The box registers \cmd\footbox\ and \cmd\pagesofar\ are customarily used
+% for this purpose.
+%
+% The procedure \cmd\end@column@ name should kick out a possibly short page containing all the
+% floats committed to the page. It will be invoked during \cmd\clearpage\ processing.
+% After that, it should \cmd\unvbox\cmd\@cclv.
+%
+% The procedure \cmd\output@column@ name should ship out or commit the current \cmd\@outputbox.
+% In a one-column layout, you ship out; in a multicolumn layout, you commit the box as the contents
+% of a particular column, and if that column is the last, you ship out.
+%
+% The procedure \cmd\@addmarginpar@ name should return a boolean (either \cmd\true@sw\ or \cmd\false@sw\ or an equivalent)
+% to tell the marginpar mechanism to place the marginal material to the right or left, respectively.
+%
+% You can use the existing page grids ``one'' and ``mlt'' as a point of departure for creating others.
+% The former can be the basis for, say, a single-column page grid with a side column.
+%
+% \begin{macro}{\pagesofar}
+% \begin{macro}{\footbox}
+% \begin{macrocode}
+\newbox\pagesofar
+\newbox\footbox
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{One-column page grid}
+%
+% \begin{macro}{\onecolumngrid}
+% \begin{macro}{\open@column@one}
+% \begin{macro}{\shut@column@one}
+% \begin{macro}{\float@column@one}
+% \begin{macro}{\end@column@one}
+% \begin{macro}{\output@column@one}
+% \begin{macro}{\@addmarginpar@one}
+% Here are all the procedures necessary for the standard page grid named ``one'':
+% a single column layout. It is, of course, \LaTeX's familiar \cmd\onecolumn\ layout.
+% We begin with the procedure exposed to the style writer.
+% This is, however, not a \LaTeX\ command; users should not change the page grid.
+% \begin{macrocode}
+\newcommand\onecolumngrid{\do@columngrid{one}{\@ne}}%
+% \end{macrocode}
+%
+% Note that a document class that issues the command \cmd\onecolumn\ will break. This includes
+% \LaTeX's standard classes.dtx-based classes: if your class descends from one of these, you
+% must expunge it of all such commands.
+% \begin{macrocode}
+\let\onecolumn\@undefined
+% \end{macrocode}
+%
+% The procedure \cmd\open@column@one\ takes advantage of the special nature of the one-column
+% page grid to deal with \cmd\box\cmd\pagesofar, therefore it must also reset \cmd\@colroom.
+% \begin{macrocode}
+\def\open@column@one#1{%
+ \unvbox\pagesofar
+ \gdef\thepagegrid{one}%
+ \global\pagegrid@col#1%
+ \global\pagegrid@cur\@ne
+ \set@colht
+%\set@colroom
+ \set@column@hsize\pagegrid@col
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\shut@column@one\ saves away the one-column material into the box register \cmd\pagesofar.
+% Because it is called from a message handler, we are assured that marks are properly taken care of.
+% \begin{macrocode}
+\def\shut@column@one{%
+ \@makecol
+ \global\setbox\pagesofar\vbox{\unvbox\@outputbox\recover@footins}%
+ \set@colht
+%\set@colroom
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\float@column@one\ takes care of a float column that has been built by \cmd\@tryfcolumn,
+% in the single-column page grid.
+% \begin{macrocode}
+\def\float@column@one{%
+ \@makecol
+ \@outputpage
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\end@column@one\ is executed at the end of \cmd\clearpage\ processing,
+% if we were in a one-column page grid, once all permissive float pages have been shipped out.
+% At this point, one could perhaps
+% assume that nothing more need be done, but let us anyway test for committed floats and force a shipout.
+%
+% FIXME: this procedure does the same as \cmd\end@column@mlt
+% (except for the test of \cmd\@ifx@empty\cmd\@dbltoplist):
+% the two could almost be the same procedure.
+%
+% I have changed this procedure to avoid the testing it once did: it simply puts down interrupts,
+% upon which it relies to correctly do what \cmd\clearpage\ requires.
+% \begin{macrocode}
+\def\end@column@one{%
+ \unvbox\@cclv\setbox\z@\lastbox
+ \protect@penalty\do@newpage@pen
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\output@column@one\ is dispatched from the output routine when
+% we have completed a page (that is, a column in a one-column page grid).
+% It ships out the page using the \cmd\@outputpage\ of standard \LaTeX,
+% which has been retained (it is needed also in \cmd\output@column@mlt,
+% and in any case should remain as the sole procedure in \LaTeX\ where \cmd\shipout\ is performed).
+% It will be followed up with an output routine message to prepare a new column.
+% \begin{macrocode}
+\def\output@column@one{%
+ \@outputpage
+}%
+% \end{macrocode}
+%
+% The following procedure determines which side of the page a marginpar will appear.
+% It reproduces the behavior of standard \LaTeX.
+% \begin{macrocode}
+\def\@addmarginpar@one{%
+ \@if@sw\if@mparswitch\fi{%
+ \@ifodd\c@page{\false@sw}{\true@sw}%
+ }{\false@sw}{%
+ \@if@sw\if@reversemargin\fi{\false@sw}{\true@sw}%
+ }{%
+ \@if@sw\if@reversemargin\fi{\true@sw}{\false@sw}%
+ }%
+}%
+% \end{macrocode}
+%
+% The following procedure yields a Boolean value; it determines whether a float in the deferred queue
+% is appropriate for placing. In the one-column grid, all floats are so.
+% \begin{macrocode}
+\def\@floatselect@sw@one#1{\true@sw}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\onecolumngrid@push{%
+ \do@output@MVL{%
+ \@ifnum{\pagegrid@col=\@ne}{%
+ \global\let\restorecolumngrid\@empty
+ }{%
+ \xdef\restorecolumngrid{%
+ \noexpand\start@column{\thepagegrid}{\the\pagegrid@col}%
+ }%
+ \start@column{one}{\@ne}%
+ }%
+ }%
+}%
+\def\onecolumngrid@pop{%
+ \do@output@MVL{\restorecolumngrid}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Two-column page grid}
+%
+% \begin{macro}{\twocolumngrid}
+% \begin{macro}{\open@column@mlt}
+% \begin{macro}{\shut@column@mlt}
+% \begin{macro}{\end@column@mlt}
+% \begin{macro}{\output@column@mlt}
+% \begin{macro}{\@addmarginpar@mlt}
+% Here are all the procedures necessary for the standard page grid named ``mlt'':
+% the multi-column page grid. With an argument of "2", it is,
+% of course, \LaTeX's familiar \cmd\twocolumn\ layout.
+%
+% We start with the procedure to switch to the two-column page grid.
+% \begin{macrocode}
+\newcommand\twocolumngrid{\do@columngrid{mlt}{\tw@}}%
+% \end{macrocode}
+%
+% The corresponding command of \LaTeX\ is obsolete.
+% \begin{macrocode}
+\let\twocolumn\@undefined
+% \end{macrocode}
+%
+% Of course, \cmd\@topnewpage\ is also obsolete. Just do
+%\begin{quote}
+% \cmd\clearpage\cmd\onecolumngrid<vertical mode material>\cmd\twocolumngrid.
+%\end{quote}
+% \begin{macrocode}
+\let\@topnewpage\@undefined
+% \end{macrocode}
+%
+% If your document class descends from one of \LaTeX's standard classes.dtx-derived
+% classes, it will break. You must expunge from it all such commands.
+%
+% \begin{macrocode}
+\def\open@column@mlt#1{%
+ \gdef\thepagegrid{mlt}%
+ \global\pagegrid@col#1%
+ \global\pagegrid@cur\@ne
+ \set@column@hsize\pagegrid@col
+ \set@colht
+%\set@colroom
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\shut@column@mlt\ ends the current column, balances the columns, and
+% salts away all in \cmd\pagesofar. Because it is called in a message handler,
+% we are assured that marks are handled properly.
+% Attention: because this procedure balances columns, all footnotes are
+% held aside in \cmd\footbox\ for placement at the bottom of the page.
+%
+% Bug note: the last macro executed by this procedure is \cmd\set@colht, but had been erroneously \cmd\set@colroom.
+% I now believe that the latter should be changed pretty much everywhere to the former.
+% \begin{macrocode}
+\def\shut@column@mlt{%
+ \@cclv@nontrivial@sw{%
+ \@makecol
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{%
+ \expandafter\global\expandafter\setbox\csname col@\the\pagegrid@cur\endcsname\box\@outputbox
+ \global\advance\pagegrid@cur\@ne
+ }{}%
+ }{%
+ {\setbox\z@\box\@cclv}%
+ }%
+ \@ifnum{\pagegrid@cur>\@ne}{%
+ \csname balance@\the\pagegrid@col\endcsname
+ \grid@column{}%
+ \@combinepage
+ \@combinedblfloats
+ \global\setbox\pagesofar\box\@outputbox
+ }{}%
+ \set@colht
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\float@column@mlt\ takes care of a float page that has been built by \cmd\@tryfcolumn,
+% in the multi-column page grid.
+% \begin{macrocode}
+\def\float@column@mlt{%
+ \@combinepage
+ \@combinedblfloats
+ \@outputpage
+ \global\pagegrid@cur\@ne
+ \protect@penalty\do@startpage@pen
+}%
+% \end{macrocode}
+%
+% The procedure \cmd\end@column@mlt\ is executed at the end of \cmd\clearpage\ processing,
+% if we were in a multi-column page grid, once all permissive float pages have been shipped out.
+% If no floats are committed and if no columns are yet filled, we have nothing to do.
+% Otherwise, we kick out a column and try again.
+%
+% Note that in our code to kick out a column, we must deal properly with the case where the column
+% is trivial: it will have nothing but \cmd\topskip\ glue plus a protection box. We substitute an ordinary
+% \cmd\null\ for the protection box.
+%
+% \begin{macrocode}
+\def\end@column@mlt{%
+ \@ifx@empty\@toplist{%
+ \@ifx@empty\@botlist{%
+ \@ifx@empty\@dbltoplist{%
+ \@ifx@empty\@deferlist{%
+ \@ifnum{\pagegrid@cur=\@ne}{%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ % true = kick out a column and try again
+ {%
+ \@cclv@nontrivial@sw{%
+ \unvbox\@cclv\setbox\z@\lastbox
+ }{%
+ \unvbox\@cclv\setbox\z@\lastbox\unskip\null
+ }%
+ \protect@penalty\do@newpage@pen
+ \protect@penalty\do@endpage@pen
+ }{%
+ \unvbox\@cclv\setbox\z@\lastbox
+ }%
+}%
+% \end{macrocode}
+% The procedure \cmd\output@column@mlt (cf. \cmd\output@column@one)
+% is dispatched from the output routine when
+% we have completed a column in a multi-column page grid).
+% (It replaces the \cmd\@outputdblcol\ of standard \LaTeX.)
+% If a complete set of columns is at hand, it ships out the page and
+% lays down an interrupt for \cmd\do@startpage@pen, which will commit the
+% full-page-width floats to the next page.
+% Like \cmd\output@column@mlt, this is followed by
+% an output routine message to prepare a new column.
+% \begin{macrocode}
+\def\output@column@mlt{%
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{%
+ \expandafter\global\expandafter\setbox\csname col@\the\pagegrid@cur\endcsname\box\@outputbox
+ \global\advance\pagegrid@cur\@ne
+ }{%
+ \set@adj@colht\dimen@
+% \advance\dimen@-\topskip
+ \grid@column{}%{\dimen@}%
+ \@combinepage
+ \@combinedblfloats
+ \@outputpage
+ \global\pagegrid@cur\@ne
+ \protect@penalty\do@startpage@pen
+ }%
+}%
+% \end{macrocode}
+% The procedure \cmd\output@column@mlt\ obsoletes \LaTeX's \cmd\@outputdblcol
+% \begin{macrocode}
+\let\@outputdblcol\@undefined
+% \end{macrocode}
+%
+% The following procedure yields a Boolean value; it determines whether a float in the deferred queue
+% is appropriate for placement in the column. In the multi-column grid, only those narrower than \cmd\textwidth\ are so.
+% \begin{macrocode}
+\def\@floatselect@sw@mlt#1{\@if@notdblfloat{#1}}%
+% \end{macrocode}
+%
+% The following procedure determines which side of the page a marginpar will appear.
+% It reproduces the behavior of standard \LaTeX.
+% \begin{macrocode}
+\def\@addmarginpar@mlt{% emits a boolean
+ \@ifnum{\pagegrid@cur=\@ne}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Page grid utility procedures}
+%
+% \begin{macro}{\pagegrid@cur}
+% \begin{macro}{\pagegrid@col}
+% \begin{macro}{\col@}
+% \begin{macro}{\pagegrid@init}
+% We take over \LaTeX's \cmd\col@number\ and \cmd\@leftcolumn, which are obsolete.
+% We create two counters to hold the columns in the page grid and the current column within.
+% We also create the first of a set of box registers to hold the committted columns.
+% \begin{macrocode}
+\let\pagegrid@cur\col@number
+\let\col@number\@undefined
+\newcount\pagegrid@col
+\pagegrid@cur\@ne
+\expandafter\let\csname col@\the\pagegrid@cur\endcsname\@leftcolumn
+\let\@leftcolumn\@undefined
+% \end{macrocode}
+%
+% The default is for maximum two columns.
+% If your class will require more columns, assign that number to \cmd\pagegrid@col\
+% before \envb{document} time.
+% \begin{macrocode}
+\pagegrid@col\tw@
+% \end{macrocode}
+%
+% The procedure \cmd\pagegrid@init\ exercises \cmd\newbox\ sufficiently to create the
+% boxes for holding the columns in the page grid.
+% \begin{macrocode}
+\def\pagegrid@init{%
+ \advance\pagegrid@cur\@ne
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{%
+ \csname newbox\expandafter\endcsname\csname col@\the\pagegrid@cur\endcsname
+ \pagegrid@init
+ }{%
+ }%
+}%
+\appdef\class@documenthook{%
+ \pagegrid@init
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\grid@column}
+% The procedure \cmd\grid@column\ knows how to lay up the columns in a multi-column page grid.
+% It uses utility procedures \cmd\append@column\ and \cmd\box@column.
+%
+% \begin{macrocode}
+\def\grid@column#1{%
+ \global\setbox\@outputbox\vbox{%
+ \hb@xt@\textwidth{%
+ \vrule\@height\z@\@width\z@\@if@empty{#1}{}{\@depth#1}%
+ \pagegrid@cur\@ne
+ \append@column
+ \box@column\@outputbox
+ }%
+ \vskip\z@skip % FIXME: page depth!
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\append@column}
+% \begin{macro}{\box@column}
+% \begin{macro}{\marry@baselines}
+% The procedure \cmd\append@column\ appends columns for \cmd\grid@column,
+% \cmd\box@column\ builds the columns for \cmd\append@column,
+% and \cmd\marry@baselines\ pastes vertical things back together.
+% \changes{v4.0rc1}{2001/06/18}
+% {Introoduce \cs{marry@height} }
+%
+% Note that \cmd\box@column\ makes an attempt to prevent excessive \cmd\topskip\
+% or \cmd\baselineskip\ glue
+% from being applied by \TeX\ when \cmd\@outputbox\ is contributed to the MVL.
+% If this is not done, it is possible to get into an infinite loop in the corner case,
+% wherein the page grid is changed to one column and the balanced-up columns are
+% already sufficient to fill the page.
+%
+% Note (AO 0920): I have changed the dimension involved with \cmd\box@column\ from
+% \cmd\vsize\ to \cmd\textheight, because the former is certainly not the correct value
+% to use: it will change if floats have been placed in the last column of the page.
+% I believe \cmd\textheight\ is the correct parameter to use here.
+%
+% A REVTeX4 beta user, Sergey Strelkov (strelkov@maik.rssi.ru), wants the option
+% of ragged-bottom columns. Implementing this feature properly means reboxing the
+% columns to their natural height only if \cmd\raggedcolumn@sw\ is true.
+% Otherwise, they get reboxed to their common height (\cmd\@colht?).
+%
+% Note that the default has hereby changed from ragged to flush.
+% It's not clear that anyone but Sergey will notice.
+%
+% The macro \cmd\marry@skip\ addresses (in a limited way)
+% the fact that neither the value of \cmd\baselineskip\ nor that of \cmd\topskip\
+% can be relied upon for the purpose of marrying the baselines of two split columns.
+% (Because there might have been a local change to their values at the point where
+% the output routine got triggered.)
+%
+% For best results, your document class should call for grid changes only when in basal text
+% settings. The \cmd\marry@baselines\ procedure will use the values appropriate to that point
+% when attempting to put the columns back together.
+%
+% In any case, we are not attempting to solve the more general problem of how to marry baselines
+% where the leading can change arbitrarily within the galley or where glue could have been trimmed
+% at a page top.
+% \begin{macrocode}
+\def\append@column{%
+ \@ifnum{\pagegrid@cur<\pagegrid@col}{%
+ \expandafter\box@column\csname col@\the\pagegrid@cur\endcsname
+ \hfil
+ \vrule \@width\columnseprule
+ \hfil
+ \advance\pagegrid@cur\@ne
+ \append@column
+ }{%
+ }%
+}%
+\def\box@column#1{%
+ \raise\topskip
+ \hb@xt@\columnwidth{%
+ \dimen@\ht#1\@ifdim{\dimen@>\@colht}{\dimen@\@colht}{}%
+% \advance\dimen@-\topskip
+ \count@\vbadness\vbadness\@M
+ \dimen@ii\vfuzz\vfuzz\maxdimen
+ \outputdebug@sw{\saythe\@colht\saythe\dimen@}{}%
+ \vtop to\dimen@
+% \@ifdim{\ht#1>\textheight}{to\textheight}{}%
+ {\hrule\@height\z@
+ \unvbox#1%
+ \raggedcolumn@skip
+ }%
+ \vfuzz\dimen@ii
+ \vbadness\count@
+ \hss
+ }%
+}%
+\def\marry@baselines{%
+%{\tracingall\scrollmode\showlists}%
+%\skip@\baselineskip\advance\skip@-\topskip %FIXME: cannot assume \baselineskip nor \topskip
+ \vskip\marry@skip\relax
+}%
+\gdef\marry@skip{\z@skip}%
+\def\set@marry@skip{%
+ \begingroup
+ \skip@\baselineskip\advance\skip@-\topskip
+ \@ifdim{\skip@>\z@}{%
+ \xdef\marry@skip{\the\skip@}%
+ }{}%
+ \endgroup
+}%
+\AtBeginDocument{%
+ \@ifxundefined\raggedcolumn@sw{\@booleanfalse\raggedcolumn@sw}{}%
+}%
+\def\raggedcolumn@skip{%
+ \vskip\z@\raggedcolumn@sw{\@plus.0001fil\@minus.0001fil}{}\relax
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@combinepage}
+% The procedure \cmd\@combinepage\ prepends the stored page to \cmd\@outputbox.
+% \begin{macrocode}
+\def\@combinepage{%
+ \@ifvoid\pagesofar{}{%
+ \setbox\@outputbox\vbox{%
+ \unvbox\pagesofar
+ \marry@baselines
+ \unvbox\@outputbox
+ }%
+ }%
+ \@ifvoid\footbox{}{%
+ \setbox\@outputbox\vbox{%
+ \unvbox\@outputbox
+ \marry@baselines
+ \unvbox\footbox
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@combinedblfloats}
+% We modify \LaTeX's \cmd\@combinedblfloats\ to be more appropriate for incremental page building:
+% we \cmd\unvbox\ the \cmd\@outputbox.
+% \begin{macrocode}
+\def\@combinedblfloats{%
+ \@ifx@empty\@dbltoplist{}{%
+ \setbox\@tempboxa\vbox{}%
+ \let\@elt\@comdblflelt\@dbltoplist
+ \let\@elt\relax\xdef\@freelist{\@freelist\@dbltoplist}%
+ \global\let\@dbltoplist\@empty
+ \setbox\@outputbox\vbox{%
+ %\boxmaxdepth\maxdepth %% probably not needed, CAR
+ \unvbox\@tempboxa\unskip
+ \@ifnum{\@dbltopnum>\m@ne}{\dblfigrule}{}%FIXME: how is \@dbltopnum maintained?
+ \vskip\dbltextfloatsep
+ \unvbox\@outputbox
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@column@hsize}%
+% The procedure \cmd\set@column@hsize\ takes care of setting up the horizontal dimensions
+% for the current page grid. The present routine will certainly not be adequate for more
+% complex page layouts (e.g., with a side column), but works for the common ones.
+% \changes{v4.0rc1}{2001/06/18}
+% {Introoduce \cs{set@marry@height} }
+% \begin{macrocode}
+\def\set@column@hsize#1{%
+ \pagegrid@col#1%
+ \global\columnwidth\textwidth
+ \global\advance\columnwidth\columnsep
+ \global\divide\columnwidth\pagegrid@col
+ \global\advance\columnwidth-\columnsep
+ \global\hsize\columnwidth
+ \global\linewidth\columnwidth
+ \skip@\baselineskip\advance\skip@-\topskip
+ \@ifnum{\pagegrid@col>\@ne}{\set@marry@skip}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\set@colht}%
+% \begin{macro}{\set@colroom}%
+% \begin{macro}{\set@vsize}%
+% \begin{macro}{\set@adj@colht}%
+% The story of \cmd\textheight, \cmd\@colht, \cmd\@colroom, and \cmd\vsize.
+%
+% \cmd\textheight---height of the text column. Not a running parameter, however, each time a page is
+% shipped out, the \cmd\textheight\ could in principle be altered. This must be done before
+%
+% \cmd\@colht---\cmd\textheight\ minus the height of any full-page-width floats. The latter are committed
+% only just after shipping out, and only if we are in a multicolumn page grid.
+% Therefore, \cmd\@colht\ should be set after a \cmd\shipout\ (by \cmd\@outputpage) and
+% will be adjusted when full-page-width floats are committed to the fresh page by \cmd\do@startpage.
+%
+% \cmd\@colroom---\cmd\@colht\ (adjusted by \cmd\pagesofar) minus the height of any column-width floats.
+% The latter are committed anywhere on the page, at which point \cmd\@colroom\ must be adjusted.
+% Therefore, \cmd\@colroom\ should be set (by \cmd\set@colroom) whenever a column is prepared (by ).
+%FIXME: committed (by \cmd\output@column@) and
+% will be adjusted (by \cmd\@add@float\ or \cmd\do@startcolumn) whenever a float is committted to the column.
+%
+% \cmd\vsize---\cmd\@colroom.
+% Therefore, \cmd\vsize\ should be set (by \cmd\set@vsize) whenever
+% the \cmd\@colroom\ is set (by \cmd\set@colroom) or adjusted (by \cmd\@add@float\ or \cmd\do@startcolumn)
+%FIXME: or when the \cmd\pagesofar\ box is changed (after invoking \cmd\open@column@).
+%
+% Question: what if there are committed floats? Footnotes?
+% Answer: full-page-width floats are only committed at top, and they are already reckoned with in \cmd\@colht.
+% Column-width committed floats are incorporated by \cmd\@makecol; footnotes need help.
+%
+% Note: FIXME: adjusting for \cmd\pagesofar\ is done at not quite the right time. I need to reexamine \cmd\set@colht,
+% because \cmd\@dbltoplist\ and \cmd\pagesofar\ really should be on the same footing.
+% Perhaps \cmd\@colht\ and \cmd\@colroom\ should both deal with their respective ``lists'' in the same way?
+%
+% These concerns will be particularly germane if we ever extend this package to deal with full-page-width floats
+% placed at the bottom of the page, or committed on the same page as called out.
+%
+% It occurs to me that we should ditch \cmd\set@colroom\ and only ever execute \cmd\set@colht, which sets \cmd\@colroom\ as a side effect.
+% If so, we can make \cmd\@colht\ take \cmd\pagesofar\ into account, as it should. Then \cmd\@colht\ will return to its
+% original significance as the value that \cmd\@colroom\ is set to after a column is committed.
+%
+% On the other hand, why not simply forget all this caching and (re-)calculate \cmd\vsize\ as late as possible?
+% Paticularly, \cmd\@colht\ is an artifact of the old way of doing things, where once it was set, it would never change.
+%
+% \begin{macrocode}
+\def\set@colht{%
+ \set@adj@textheight\@colht
+ \global\let\enlarge@colroom\@empty
+ \set@colroom
+}%
+\def\set@adj@textheight#1{%
+ #1\textheight
+ \def\@elt{\adj@page#1}%
+ \@booleantrue\firsttime@sw\@dbltoplist
+ \let\@elt\relax
+%\@ifvoid\pagesofar{}{%
+% \advance#1-\ht\pagesofar\advance#1-\dp\pagesofar
+%}%
+ \global#1#1\relax
+ \outputdebug@sw{\saythe#1}{}%
+}%
+\def\set@colroom{%
+ \set@adj@colht\@colroom
+ \@if@empty\enlarge@colroom{}{%
+ \global\advance\@colroom\enlarge@colroom\relax
+ }%
+ \outputdebug@sw{\saythe\@colroom}{}%
+ \@ifdim{\@colroom>\topskip}{}{%
+ \ltxgrid@info{Not enough room: \string\@colroom=\the\@colroom; increasing to \the\topskip}%
+ \@colroom\topskip
+ }%
+ \global\@colroom\@colroom
+ \set@vsize
+}%
+%
+\def\set@vsize{%
+ \global\vsize\@colroom
+ \outputdebug@sw{\saythe\vsize}{}%
+}%
+%
+\def\set@adj@colht#1{%
+ #1\@colht
+ \@ifvoid\pagesofar{}{%
+ \advance#1-\ht\pagesofar\advance#1-\dp\pagesofar
+ }%
+ \@ifvoid\footbox{}{%
+ \advance#1-\ht\footbox\advance#1-\dp\footbox
+ }%
+ \def\@elt{\adj@column#1}%
+ \@booleantrue\firsttime@sw\@toplist
+ \@booleantrue\firsttime@sw\@botlist
+ \let\@elt\relax
+ \outputdebug@sw{\saythe#1}{}%
+}%
+\def\adj@column#1#2{%
+ \advance#1-\ht#2%
+ \advance#1-\firsttime@sw{\textfloatsep\@booleanfalse\firsttime@sw}{\floatsep}%
+}%
+\def\adj@page#1#2{%
+ \advance#1-\ht#2%
+ \advance#1-\firsttime@sw{\dbltextfloatsep\@booleanfalse\firsttime@sw}{\dblfloatsep}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@outputpage}%
+% At the tail of \cmd\@outputpage, we set \cmd\@colht\ and the float placement parameters
+% (this is the one point where it is appropriate to set \cmd\@colht).
+% At \cmd\do@startpage\ time, we adjust \cmd\@colht's value to reflect committed
+% full-page-width floats.
+%
+% Note: with a correctly written output routine, a call to \cmd\@outputpage\ will inevitably be
+% followed by a call to \cmd\do@startpage, so these procedure calls would be unneeded.
+% \begin{macrocode}
+\appdef\@outputpage{%
+ \set@colht % FIXME: needed?
+ \@floatplacement % FIXME: needed?
+ \@dblfloatplacement % FIXME: needed?
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{balance@2}
+% We define procedures for balancing columns in a multicolumn layout.
+% For now, we define only one: a procedure for the two-column grid.
+% All others will simply \cmd\relax\ out.
+% \begin{macrocode}
+\@namedef{balance@2}{%
+ \expandafter\balance@two\csname col@1\endcsname\@outputbox
+ % Avoid a bug by preventing a restore when leaving this group
+ \global\setbox\csname col@1\endcsname\box\csname col@1\endcsname
+ \@ifvoid\footbox{}{%
+ \global\setbox\footbox\vbox{%
+ \setbox\z@\box\@tempboxa
+ \let\recover@footins\relax
+ \balance@two\footbox\@tempboxa
+ \hb@xt@\textwidth{\box\footbox\hfil\box\@tempboxa}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\balance@two}
+% The procedure \cmd\balance@two\ takes two columns and balances them; in the process it removes
+% any footnotes that may be present to a place of safety, for later placement at the foot of the
+% shipped-out page.
+% The box register \cmd\box\cmd\@ne\ is the aggregate of all columns.
+% The box register \cmd\box\cmd \z@\ is the last column.
+% The box register \cmd\box\cmd\tw@\ is the first column.
+% The \cmd\dimen\ register \cmd\dimen@\ is the trial value to balance to,
+% initially half the height of \cmd\box\cmd\@ne.
+% The \cmd\dimen\ register \cmd\dimen@i\ is the increment for the next trial;
+% its initial value is equal to the initial value of \cmd\dimen@.
+% The \cmd\dimen\ register \cmd\dimen@ii\ is the difference of the heights of the two columns.
+%
+% The procedure uses a binary search for that value of \cmd\dimen@\ which is stable to within .5\cmd\p@\ and which
+% makes the last column be shorter than the others.
+%
+% This procedure can be extended to multiple columns simply by changing it to execute \cmd\vsplit\ multiple
+% times (one less than the total number of columns in the page layout) and to calculating \cmd\dimen@ii\
+% to be the difference of the heights of last column and the \cmd\dimen@.
+% Upon termination of the search, one would excute the \cmd\vsplit s once again, this time
+% using the actual \cmd\col@\ box registers to store the
+% balanced columns, thereby clobbering their former contents.
+%
+% Bug Note:
+% as originally written, this macro had a bug, which is well worth avoiding under similar circumstances anywhere.
+% So, learn from the mistakes of others, as they say.
+% In trying to remove the depth of the boxes created via \cmd\vsplit\ within the \cmd\loopwhile\ control,
+% I originally coded
+% \cmd\unvbox
+% \cmd\z@\
+% \cmd\setbox
+% \cmd\z@
+% \cmd\lastbox\
+% \cmd\dimen@
+% \cmd\dp
+% \cmd\z@\
+% \cmd\box
+% \cmd\z@\
+% \cmd\vskip-%
+% \cmd\dimen@.
+% The error here is that the shift of the last box in the vertical list will be lost in the process.
+% Simply put, \cmd\setbox\cmd\z@\cmd\lastbox\ fails to retain the shift of the box node in the vertical list,
+% and when it is put down again via \cmd\box\cmd\z@, it will no longer have the correct shift.
+%
+% This bug affected things placed in the MVL with \cmd\moveleft, \cmd\moveright, \cmd\parshape, and
+% \cmd\hangindent, as well as things shifted by \TeX's primitive mechanisms.
+%
+% A superior strategy for removing the depth of the last line of the list is more expensive, but safer:
+% make a separate copy of the list, measure the depth of the last box as above, but then discard
+% the list, retaining only the value of the dimension.
+%
+% Note that this procedure will not work if the material within is excessively chunky.
+% A particular failure mode exists where none of the material is allocated to the last (right) column.
+% We detect this case and revert to unbalanced columns.
+%
+% Another failure mode is where a large chunk occurs at the beginning of the composite box.
+% In this case, the left column may fill up even when \cmd\dimen@\ is very small.
+% If this configuration leaves the left column longer than the right, then we are done,
+% but \cmd\dimen@\ by no means represents the height of either finished box.
+%
+% Therefore the last step in the process is to rebox the two columns to a common height determined
+% independently of the balancing process.
+%
+% The dimension involved is checked against the current \cmd\@colroom\ to guard against the case where
+% excessive material happens to fall in either column.
+% \begin{macrocode}
+\def\balance@two#1#2{%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox#1\showbox#2}}{}%
+ \setbox\@ne\vbox{%
+ \@ifvoid#1{}{%
+ \unvcopy#1\recover@footins
+ \@ifvoid#2{}{\marry@baselines}%
+ }%
+ \@ifvoid#2{}{%
+ \unvcopy#2\recover@footins
+ }%
+ }%
+ \dimen@\ht\@ne\divide\dimen@\tw@
+ \dimen@i\dimen@
+ \vbadness\@M
+ \vfuzz\maxdimen
+ \loopwhile{%
+ \dimen@i=.5\dimen@i
+ \outputdebug@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
+ \setbox\z@\copy\@ne\setbox\tw@\vsplit\z@ to\dimen@
+ \setbox\z@ \vbox{%
+ \unvcopy\z@
+ \setbox\z@\vbox{\unvbox\z@ \setbox\z@\lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
+ }%
+ \setbox\tw@\vbox{%
+ \unvcopy\tw@
+ \setbox\z@\vbox{\unvbox\tw@\setbox\z@\lastbox\aftergroup\vskip\aftergroup-\expandafter}\the\dp\z@\relax
+ }%
+ \dimen@ii\ht\tw@\advance\dimen@ii-\ht\z@
+ \@ifdim{\dimen@i>.5\p@}{%
+ \advance\dimen@\@ifdim{\dimen@ii<\z@}{}{-}\dimen@i
+ \true@sw
+ }{%
+ \@ifdim{\dimen@ii<\z@}{%
+ \advance\dimen@\tw@\dimen@i
+ \true@sw
+ }{%
+ \false@sw
+ }%
+ }%
+ }%
+ \outputdebug@sw{\saythe\dimen@\saythe\dimen@i\saythe\dimen@ii}{}%
+ \@ifdim{\ht\z@=\z@}{%
+ \@ifdim{\ht\tw@=\z@}{%
+ \true@sw
+ }{%
+ \false@sw
+ }%
+ }{%
+ \true@sw
+ }%
+ {%
+ }{%
+ \ltxgrid@info{Unsatifactorily balanced columns: giving up}%
+ \setbox\tw@\box#1%
+ \setbox\z@ \box#2%
+ }%
+ \setbox\tw@\vbox{\unvbox\tw@\vskip\z@skip}%
+ \setbox\z@ \vbox{\unvbox\z@ \vskip\z@skip}%
+ \set@colroom
+ \dimen@\ht\z@\@ifdim{\dimen@<\ht\tw@}{\dimen@\ht\tw@}{}%
+ \@ifdim{\dimen@>\@colroom}{\dimen@\@colroom}{}%
+ \outputdebug@sw{\saythe{\ht\z@}\saythe{\ht\tw@}\saythe\@colroom\saythe\dimen@}{}%
+ \setbox#1\vbox to\dimen@{\unvbox\tw@\unskip\raggedcolumn@skip}%
+ \setbox#2\vbox to\dimen@{\unvbox\z@ \unskip\raggedcolumn@skip}%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox#1\showbox#2}}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\recover@footins}
+% The procedure \cmd\recover@footins\ is the utility procedure for recovering the footnotes
+% from the bottom of a column. It is used when the page grid is changed, so that footnotes can be
+% set at the bottom of the shipped out page.
+% \begin{macrocode}
+\def\recover@footins{%
+ \skip\z@ \lastskip\unskip
+ \skip\@ne\lastskip\unskip
+ \setbox\z@\lastbox
+ \@ifvbox\z@{%
+ \setbox\z@\vbox{%
+ \unvbox\z@
+ \setbox\z@\lastbox
+% \outputdebug@sw{{\tracingall\showbox\lastbox}}{}%
+ \@ifvoid\z@{}{%
+ \global\setbox\footbox\vbox{%
+ \unvbox\footbox
+ \@ifvbox\z@{%
+ \unvbox\z@
+ }{%
+ \box\z@
+ }%
+ }%
+ }%
+ }%
+ }{}%
+ \outputdebug@sw{{\tracingall\scrollmode\showbox\footbox}}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@begindocumenthook}
+% Initialization:
+% we initialize to the page grid named ``one''.
+% If the class decides to initially set type in a different grid, it
+% should execute these same commands, but changing the first to the appropriate procedure.
+%
+% Note that the point where this sequence is executed would be an excellent place to arrange for
+% floats to be committed to the first page of a document.
+% That is, we execute \cmd\do@startpage, which triggers \cmd\do@startcolumn.
+%
+% FIXME: it should be the job of the page grid to determine the procedure to execute at
+% the start of the job. Make this a hook.
+% \begin{macrocode}
+\prepdef\@begindocumenthook{%
+ \open@column@one\@ne
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% Comment: our technique of balancing columns is severely limited, because it cannot properly work
+% with \env{longtable}, which places material at the bottom and top of the column break.
+%
+% The proper way to handle a grid change in the middle of the page is to accumulate all the material for
+% an entire article (or chapter) and then assemble finished pages therefrom. This approach is fundamentally
+% superior for complex layouts: it corresponds to real-world workflows.
+% Such a scheme is an excellent subject for another \LaTeX\ package.
+%
+%
+% \subsection{Patches for the longtable package}%
+%
+% \LaTeX's ``required'' package \classname{longtable} (written by David P. Carlilsle),
+% which is part of /latex/required/tools, is incmpatible with both
+% \LaTeX's ``required'' package \classname{multicol} and with
+% \LaTeX's native \cmd\twocolumn\ capability. There is no essential reason
+% for this incompatability, aside from implementation details, and the
+% \classname{ltxgrid} package gives us the ability to lift them.
+%
+% Only four of \classname{longtable}'s procedures require rewriting:
+% \cmd\longtable,
+% \cmd\endlongtable,
+% \cmd\LT@start, and
+% \cmd\LT@end@hd@ft.
+% The procedure \cmd\switch@longtable\ checks against their expected meanings
+% and, if all is as expected, applies the patches.
+% In the process, we simplify things considerably and also make them more
+% secure.
+%
+% Why does \classname{longtable} need to access the output routine, anyway?
+% What it comes down to, is what happens when a pagebreak falls within a
+% long table. If this happens, we would like to append a row at the bottom of
+% the broken table and add a row at the top of the next page.
+%
+% These things can be accomodated easily by the \classname{ltxgrid} output
+% routine hooks.
+%
+%
+% \begin{macro}{\longtable}
+% \begin{macrocode}
+\def\longtable@longtable{%
+ \par
+ \ifx\multicols\@undefined\else\ifnum\col@number>\@ne\@twocolumntrue\fi\fi
+ \if@twocolumn\LT@err{longtable not in 1-column mode}\@ehc\fi
+ \begingroup
+ \@ifnextchar[\LT@array{\LT@array[x]}%
+}%
+\def\longtable@new{%
+ \par
+ \@ifnextchar[\LT@array{\LT@array[x]}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endlongtable}
+% \begin{macrocode}
+\def\endlongtable@longtable{%
+ \crcr
+ \noalign{%
+ \let\LT@entry\LT@entry@chop
+ \xdef\LT@save@row{\LT@save@row}}%
+ \LT@echunk
+ \LT@start
+ \unvbox\z@
+ \LT@get@widths
+ \if@filesw
+ {\let\LT@entry\LT@entry@write\immediate\write\@auxout{%
+ \gdef\expandafter\noexpand
+ \csname LT@\romannumeral\c@LT@tables\endcsname
+ {\LT@save@row}}}%
+ \fi
+ \ifx\LT@save@row\LT@@save@row
+ \else
+ \LT@warn{Column \@width s have changed\MessageBreak
+ in table \thetable}%
+ \LT@final@warn
+ \fi
+ \endgraf\penalty -\LT@end@pen
+ \endgroup
+ \global\@mparbottom\z@
+ \pagegoal\vsize
+ \endgraf\penalty\z@\addvspace\LTpost
+ \ifvoid\footins\else\insert\footins{}\fi
+}%
+\def\endlongtable@new{%
+ \crcr
+ \noalign{%
+ \let\LT@entry\LT@entry@chop
+ \xdef\LT@save@row{\LT@save@row}%
+ }%
+ \LT@echunk
+ \LT@start
+ \unvbox\z@
+ \LT@get@widths
+ \@if@sw\if@filesw\fi{%
+ {%
+ \let\LT@entry\LT@entry@write
+ \immediate\write\@auxout{%
+ \gdef\expandafter\noexpand\csname LT@\romannumeral\c@LT@tables\endcsname
+ {\LT@save@row}%
+ }%
+ }%
+ }{}%
+ \@ifx\LT@save@row\LT@@save@row{}{%
+ \LT@warn{%
+ Column \@width s have changed\MessageBreak in table \thetable
+ }\LT@final@warn
+ }%
+ \endgraf
+ \nobreak
+ \box\@ifvoid\LT@lastfoot{\LT@foot}{\LT@lastfoot}%
+ \global\@mparbottom\z@
+ \endgraf
+ \LT@post
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@start}
+% \begin{macrocode}
+\def\LT@start@longtable{%
+ \let\LT@start\endgraf
+ \endgraf
+ \penalty\z@
+ \vskip\LTpre
+ \dimen@\pagetotal
+ \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi
+ \advance\dimen@ \ht\LT@foot
+ \dimen@ii\vfuzz\vfuzz\maxdimen
+ \setbox\tw@\copy\z@
+ \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox
+ \setbox\tw@\vbox{\unvbox\tw@}%
+ \vfuzz\dimen@ii
+ \advance\dimen@ \ht
+ \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@\dp
+ \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi
+ \advance\dimen@ -\pagegoal
+ \ifdim \dimen@>\z@\vfil\break\fi
+ \global\@colroom\@colht
+ \ifvoid\LT@foot\else
+ \advance\vsize-\ht\LT@foot
+ \global\advance\@colroom-\ht\LT@foot
+ \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@
+ \maxdepth\z@
+ \fi
+ \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi
+ \output{\LT@output}%
+}%
+\def\LT@start@new{%
+ \let\LT@start\endgraf
+ \endgraf
+ \markthr@@{}%
+ \LT@pre
+ \@ifvoid\LT@firsthead{\LT@top}{\box\LT@firsthead\nobreak}%
+ \mark@envir{longtable}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@end}
+% \begin{macrocode}
+\def\LT@end@hd@ft@longtable#1{%
+ \LT@echunk
+ \ifx\LT@start\endgraf
+ \LT@err{Longtable head or foot not at start of table}{Increase LTchunksize}%
+ \fi
+ \setbox#1\box\z@
+ \LT@get@widths\LT@bchunk
+}%
+\def\LT@end@hd@ft@new#1{%
+ \LT@echunk
+ \@ifx{\LT@start\endgraf}{%
+ \LT@err{Longtable head or foot not at start of table}{Increase LTchunksize}%
+ }%
+ \global\setbox#1\box\z@
+ \LT@get@widths
+ \LT@bchunk
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@array}
+% \begin{macrocode}
+\def\LT@array@longtable[#1]#2{%
+ \refstepcounter{table}\stepcounter{LT@tables}%
+ \if l#1%
+ \LTleft\z@ \LTright\fill
+ \else\if r#1%
+ \LTleft\fill \LTright\z@
+ \else\if c#1%
+ \LTleft\fill \LTright\fill
+ \fi\fi\fi
+ \let\LT@mcol\multicolumn
+ \let\LT@@tabarray\@tabarray
+ \let\LT@@hl\hline
+ \def\@tabarray{%
+ \let\hline\LT@@hl
+ \LT@@tabarray}%
+ \let\\\LT@tabularcr\let\tabularnewline\\%
+ \def\newpage{\noalign{\break}}%
+ \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
+ \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
+ \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
+ \@tempdima\ht\strutbox
+ \let\@endpbox\LT@endpbox
+ \ifx\extrarowheight\@undefined
+ \let\@acol\@tabacol
+ \let\@classz\@tabclassz \let\@classiv\@tabclassiv
+ \def\@startpbox{\vtop\LT@startpbox}%
+ \let\@@startpbox\@startpbox
+ \let\@@endpbox\@endpbox
+ \let\LT@LL@FM@cr\@tabularcr
+ \else
+ \advance\@tempdima\extrarowheight
+ \col@sep\tabcolsep
+ \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr
+ \fi
+ \setbox\@arstrutbox\hbox{\vrule
+ \@height \arraystretch \@tempdima
+ \@depth \arraystretch \dp \strutbox
+ \@width \z@}%
+ \let\@sharp##\let\protect\relax
+ \begingroup
+ \@mkpream{#2}%
+ \xdef\LT@bchunk{%
+ \global\advance\c@LT@chunks\@ne
+ \global\LT@rows\z@\setbox\z@\vbox\bgroup
+ \LT@setprevdepth
+ \tabskip\LTleft\halign to\hsize\bgroup
+ \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}%
+ \endgroup
+ \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
+ \LT@make@row
+ \m@th\let\par\@empty
+ \everycr{}\lineskip\z@\baselineskip\z@
+ \LT@bchunk
+}%
+\def\LT@LR@l{\LTleft\z@ \LTright\fill}%
+\def\LT@LR@r{\LTleft\fill \LTright\z@ }%
+\def\LT@LR@c{\LTleft\fill \LTright\fill}%
+\def\LT@array@new[#1]#2{%
+ \refstepcounter{table}\stepcounter{LT@tables}%
+ \table@hook
+ \LTleft\fill \LTright\fill
+ \csname LT@LR@#1\endcsname
+ \let\LT@mcol\multicolumn
+ \let\LT@@hl\hline
+ \prepdef\@tabarray{\let\hline\LT@@hl}%
+ \let\\\LT@tabularcr
+ \let\tabularnewline\\%
+ \def\newpage{\noalign{\break}}%
+ \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
+ \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
+ \let\hline\LT@hline
+ \let\kill\LT@kill
+ \let\caption\LT@caption
+ \@tempdima\ht\strutbox
+ \let\@endpbox\LT@endpbox
+ \@ifxundefined\extrarowheight{%
+ \let\@acol\@tabacol
+ \let\@classz\@tabclassz
+ \let\@classiv\@tabclassiv
+ \def\@startpbox{\vtop\LT@startpbox}%
+ \let\@@startpbox\@startpbox
+ \let\@@endpbox\@endpbox
+ \let\LT@LL@FM@cr\@tabularcr
+ }{%
+ \advance\@tempdima\extrarowheight
+ \col@sep\tabcolsep
+ \let\@startpbox\LT@startpbox
+ \let\LT@LL@FM@cr\@arraycr
+ }%
+%
+ \let\@acoll\@tabacoll
+ \let\@acolr\@tabacolr
+ \let\@acol\@tabacol
+%
+ \setbox\@arstrutbox\hbox{%
+ \vrule
+ \@height \arraystretch \@tempdima
+ \@depth \arraystretch \dp \strutbox
+ \@width \z@
+ }%
+ \let\@sharp##%
+ \let\protect\relax
+ \begingroup
+ \@mkpream{#2}%
+ \@mkpream@relax
+ \edef\@preamble{\@preamble}%
+ \prepdef\@preamble{%
+ \global\advance\c@LT@chunks\@ne
+ \global\LT@rows\z@
+ \setbox\z@\vbox\bgroup
+ \LT@setprevdepth
+ \tabskip\LTleft
+ \halign to\hsize\bgroup
+ \tabskip\z@
+ \@arstrut
+ }%
+ \appdef\@preamble{%
+ \tabskip\LTright
+ \cr
+ }%
+ \global\let\LT@bchunk\@preamble
+ \endgroup
+ \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols
+ \LT@make@row
+ \m@th
+ \let\par\@empty
+ \everycr{}%
+ \lineskip\z@
+ \baselineskip\z@
+ \LT@bchunk
+}%
+\appdef\table@hook{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\switch@longtable}
+%
+% Here is the switch from standard \classname{longtable} to the new, \classname{ltxgrid}-compatible values.
+%
+% At this point, we extend \env{longtable} with a \env{longtable*} form, which signifies that we want to
+% use the full page width for setting the table.
+% You can think this way: \env{longtable*} is to \env{longtable} as \env{table*} is to \env{table}.
+%
+%FIXME: the following is no longer true:
+%% Note that it is not enough to define the environment itself; we also have to create the corresponding
+%% \cmd\output\ routine procedures, which provide for continued footers and headers
+%% (the very feature of \env{longtable} requiring support in the output routine).
+%
+%% This same consideration would arise in defining any syntactic extension to \env{longtable}, because
+%% the environment name itself is exposed in the output routine.
+%
+% \begin{macrocode}
+\def\switch@longtable{%
+ \@ifpackageloaded{longtable}{%
+ \@ifx{\longtable\longtable@longtable}{%
+ \@ifx{\endlongtable\endlongtable@longtable}{%
+ \@ifx{\LT@start\LT@start@longtable}{%
+ \@ifx{\LT@end@hd@ft\LT@end@hd@ft@longtable}{%
+ \@ifx{\LT@array\LT@array@longtable}{%
+ \true@sw
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ }{\false@sw}%
+ {%
+ \class@info{Patching longtable package}%
+ }{%
+ \class@info{Patching unrecognized longtable package. (Proceeding with fingers crossed)}%
+ }%
+ \let\longtable\longtable@new
+ \let\endlongtable\endlongtable@new
+ \let\LT@start\LT@start@new
+ \let\LT@end@hd@ft\LT@end@hd@ft@new
+ \let\LT@array\LT@array@new
+ \newenvironment{longtable*}{%
+ \onecolumngrid@push
+ \longtable
+ }{%
+ \endlongtable
+ \onecolumngrid@pop
+ }%
+% \expandafter\let\csname output@init@longtable*\endcsname\output@init@longtable
+% \expandafter\let\csname output@prep@longtable*\endcsname\output@prep@longtable
+% \expandafter\let\csname output@post@longtable*\endcsname\output@post@longtable
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\LT@pre}
+% \begin{macro}{\LT@bot}
+% \begin{macro}{\LT@top}
+% \begin{macro}{\LT@post}
+% \begin{macro}{\LT@adj}
+% Note that at the end of the longtable environment, we reestablish the \cmd\mark@envir\ of the
+% containing environment. We have left \cmd\curr@envir\ alone, so this will work.
+% \begin{macrocode}
+\def\LT@pre{\penalty\z@\vskip\LTpre}%
+\def\LT@bot{\nobreak\copy\LT@foot\vfil}%
+\def\LT@top{\copy\LT@head\nobreak}%
+\def\LT@post{\penalty\z@\addvspace\LTpost\mark@envir{\curr@envir}}%
+\def\LT@adj{%
+ \setbox\z@\vbox{\null}\dimen@-\ht\z@
+ \setbox\z@\vbox{\unvbox\z@\LT@bot}\advance\dimen@\ht\z@
+ \global\advance\vsize-\dimen@
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{output@init}
+% \begin{macro}{output@prep}
+% \begin{macro}{output@post}
+% \begin{macrocode}
+\def\output@init@longtable{\LT@adj}%
+\def\output@prep@longtable{\setbox\@cclv\vbox{\unvbox\@cclv\LT@bot}}%
+\def\output@post@longtable{\LT@top}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Patches for index processing}%
+%
+% Another feature that uses the output routine hooks occurs within
+% an index, where one wishes to apply a ``continue head'' when a
+% column breaks within a primary index entry.
+% Some book designs call for the continue head to only be applied
+% at a turnpage break.
+%
+% In any case, it is easy enough for \cmd\output@post@theindex\
+% to do this in conjunction with component marks.
+% Only the bare outlines are shown here.
+%
+% \begin{macro}{\output@init}
+% \begin{macro}{\output@prep}
+% \begin{macro}{\output@post}
+% \begin{macrocode}
+\let\output@init@theindex\@empty
+\let\output@prep@theindex\@empty
+\def\output@post@theindex{%
+ \@ifodd\c@page{}{%
+ \@ifnum{\pagegrid@cur=\@ne}{% we have the leftmost column of a verso page
+ % insert the current top-level continued head
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Checking the auxiliary file}%
+%
+% We relegate the checking of the auxiliary file to the output routine.
+% This task must wait until the last page is shipped out, because otherwise
+% the stream might get closed before the last page is shipped out.
+% Obviously, we must use \cmd\do@output@MVL\ for the job.
+%
+% \begin{macro}{\check@aux}
+% \begin{macrocode}
+\def\check@aux{\do@output@MVL{\do@check@aux}}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Dealing with stuck floats and stalled float dequeueing}%
+%
+% \LaTeX's float placement mechanism is fundamentally flawed, as evidenced by
+% its warning message ``too many unprocessed floats'', which users understandably find frustrating.
+% The \classname{ltxgrid} package provides tools for ameliorating the situation somewhat.
+%
+% Two cases require detection and rectification:
+% \begin{enumerate}
+% \item
+% A float is ``stuck'' in the \cmd\@deferlist: for whatever reason, the float fails to be committed,
+% even at the start of a fresh page.
+% Once this condition prevails, following floats can never be committed, subsequently all of \LaTeX's
+% float registers are used up.
+%
+% If this condition is detected, we reconsider float dequeueing under permissive (\cmd\clearpage-style) processing.
+%
+% \item
+% The \cmd\@freelist\ is exhausted:
+% a large concentration of floats, say, uses up all of \LaTeX's float registers all at once.
+% This condition commonly occurs when the user collects floats at the end of the document, for some reason.
+%
+% When a float is encountered, \LaTeX\ uses a float register (allocated from a pool of free registers) to contain it until it can be placed.
+% However, no further action is taken until the pagebuilder is visited, so floats can accumulate.
+% Also, even after the pagebuilder is visited, deferred floats can accumulate, and these are not committed
+% until a column (or page) of text is completed.
+%
+% Once the last free float register is used, action should be taken that will commit some of the deferred floats,
+% even if this might require ending the page right where we are (resulting in a short page).
+%
+% Perhaps, committed floats should be stored using some mechanism other than a list, as is currently done.
+% A feasible alternative storage method would be to use a \cmd\box\ register in place of
+% \cmd\@toplist,
+% \cmd\@botlist, and
+% \cmd\@dbltoplist.
+% This is probably just fine, since such committed floats are not reconsidered (I think).
+%
+% \end{enumerate}
+%
+% The emergency processing implemented here immediately ends the current page and begins to output float pages under (\cmd\clearpage-style) rules.
+% It proceeds until all deferred floats have been flushed.
+%
+% Users should expect non-optimal page makeup under these circumstances.
+%
+% Note that there is a weakness in our approach that we have not attempted to repair: if floats are being
+% added as part of a paragraph, we will not be able to take these remedial steps until the paragraph ends.
+% This means that the approach implemented here cannot fix all \LaTeX\ documents. Users can still construct
+% documents that exhaust \LaTeX's pool of float registers!
+%
+% \begin{macro}{\check@deferlist@stuck}
+% \begin{macro}{\@outputpage}
+% We detect the case where, at the start of a fresh page, there are deferred floats, but none are
+% committed. We memorize the \cmd\@deferlist\ at \cmd\shipout\ time, then examine it at the point where
+% our efforts to commit floats to the new page are complete.
+% If it has not changed, the first float must be stuck, and we
+% attempt to fix things via \cmd\force@deferlist@stuck.
+%
+% This simple approach is comp[letely effective in for typical documents.
+%
+% Note that we try to avoid an infinite loop by examining the value of \cmd\clearpage@sw:
+% if we come here with that boolean true, we are in a loop.
+% \begin{macrocode}
+\def\check@deferlist@stuck#1{%
+ \@ifx{\@deferlist@postshipout\@empty}{}{%
+ \@ifx{\@deferlist@postshipout\@deferlist}{%
+ \@fltstk
+ \clearpage@sw{%
+ \ltxgrid@warn{Deferred float stuck during \string\clearpage\space processing}%
+ }{%
+ \force@deferlist@stuck#1%
+ }%
+ }{%
+ %Successfully committed float(s)
+ }%
+ \global\let\@deferlist@postshipout\@empty
+ }%
+}%
+\def\@fltstk{%
+ \@latex@warning{A float is stuck (cannot be placed without \string\clearpage)}%
+}%
+\appdef\@outputpage{%
+ \global\let\@deferlist@postshipout\@deferlist
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@next}
+% \begin{macro}{\@xnext}
+% We rewrite the \LaTeX\ kernel macros that dequeue float registers from, e.g., \cmd\@deferlist,
+% providing a test for the condition where the pool of free registers is about to underflow.
+%
+% In this case, we attempt to fix things via \cmd\force@deferlist@empty.
+% \begin{macrocode}
+\def\@next#1#2{%
+ \@ifx{#2\@empty}{\false@sw}{%
+ \expandafter\@xnext#2\@@#1#2%
+ \true@sw
+ }%
+}%
+\def\@xnext\@elt#1#2\@@#3#4{%
+ \def#3{#1}%
+ \gdef#4{#2}%
+ \def\@tempa{#4}\def\@tempb{\@freelist}%
+ \@ifx{\@tempa\@tempb}{%
+ \@ifx{#4\@empty}{%
+ \force@deferlist@empty%{Float register pool exhausted}%
+ }{}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\force@deferlist@stuck}
+% \begin{macro}{\force@deferlist@empty}
+% \begin{macro}{\force@deferlist@sw}
+% \begin{macro}{\do@forcecolumn@pen}
+% \begin{macro}{\do@forcecolumn}
+% The procedure \cmd\force@deferlist@empty\ is an attempt to rectify a situation where \LaTeX's float placement mechanism
+% may fail (``too many unprocessed floats'').
+%
+% We put down interrupts that call for the float placement to be redone, but under permissive conditions,
+% just the same as if \cmd\clearpage\ had been invoked.
+%
+% Note that the attempt to rectify the error is contingent on the setting of \cmd\force@deferlist@sw,
+% default false. A document class using this package that wishes to enable this error recovery mechanism should
+% set this boolean to true.
+%
+% The interrupt \cmd\do@forcecolumn@pen, which invokes the procedure \cmd\do@forcecolumn,
+% does the same as \cmd\do@startcolumn, except under permissive conditions:
+% we are trying to empty out the float registers completely.
+%
+% In order to properly with the case where there is material in \cmd\box\cmd\@cclv,
+% \cmd\@toplist, \cmd\@botlist, \cmd\@dbltoplist, etc,
+% we do what amounts to \cmd\newpage\ to get things rolling.
+%
+% In \cmd\force@deferlist@stuck, we take advantage of already being in the output routine:
+% simply reinvoke \cmd\do@startcolumn\ under permissive conditions.
+%
+% \begin{macrocode}
+\def\force@deferlist@stuck#1{%
+ \force@deferlist@sw{%
+ \@booleantrue\clearpage@sw
+ \@booleantrue\forcefloats@sw
+ #1%
+ }{%
+ }%
+}%
+\def\force@deferlist@empty{%
+ \force@deferlist@sw{%
+% \ltxgrid@info{#1, attempting rectification}%
+ \penalty-\pagebreak@pen
+ \protect@penalty\do@forcecolumn@pen
+ }{%
+% \ltxgrid@info{#1}%
+ }%
+}%
+\@booleanfalse\force@deferlist@sw
+\mathchardef\do@forcecolumn@pen=10009
+\@namedef{output@-\the\do@forcecolumn@pen}{\do@forcecolumn}%
+\def\do@forcecolumn{%
+ \@booleantrue\clearpage@sw
+ \@booleantrue\forcefloats@sw
+%\unvbox\@cclv
+%\vfil
+%\penalty-\pagebreak@pen
+ \do@startcolumn
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% A more thorough revision of \LaTeX's float placement mechanism would involve substituting a single \cmd\box\
+% register for the \cmd\@deferlist. This way, \LaTeX's ability to have latent floats would be limited by
+% box memory alone.
+%
+% Because only the \cmd\box\ and \cmd\count\ components of the float box register are actually used by \LaTeX,
+% our scheme can be accomplished if we can find a way to encode the information held in the \cmd\count\ component.
+%
+% A first-in, first-out mechanism exists, wherein a box-penalty pair is dequeued by \cmd\lastbox\cmd\lastpenalty\cmd\unpenalty\ and enqueued
+% by \cmd\setbox\cmd\foo=\cmd\hbox\cmd\bgroup\cmd\penalty\cmd\floatpenalty\cmd\box\cmd\floatbox\cmd\unhbox\cmd\foo\cmd\egroup.
+%
+% Note that this scheme is made possible by our change to \LaTeX's float placement mechanism,
+% wherein we consolidated the two \cmd\@deferlist s into one.
+%
+% \section{Support for legacy \LaTeX\ commands}
+%
+% We provide support for the \cmd\enlargethispage\ command.
+%
+% Note: using a command of this sort is questionable.
+% Instead, people should enlarge the entire spread.
+%
+% Timing Note: In a multicolumn page grid, the user should issue the \cmd\enlargethispage\ command
+% while the first column of the page is being typeset.
+% We provide a helpful message if the timing is wrong.
+%
+% This code can serve as a model for introducing commands that need to execute within the safety of the output routine.
+% We ensure that the arguments are fully expanded, then execute \cmd\do@output@MVL\ to cause an output procedure,
+% \cmd\@@enlargethispage, to execute. When it does execute, the MVL will be exposed.
+%
+% The \cmd\@@enlargethispage\ procedure simply adjusts the vertical dimensions of the page.
+% The adjustment will persist until the column is committed, at which point the page dimension
+% will revert to its standard value.
+% \begin{macrocode}
+\def\enlargethispage{%
+ \@ifstar{%
+ \@enlargethispage{}%
+ }{%
+ \@enlargethispage{}%
+ }%
+}%
+\def\@enlargethispage#1#2{%
+ \begingroup
+ \dimen@#2\relax
+ \edef\@tempa{#1}%
+ \edef\@tempa{\noexpand\@@enlargethispage{\@tempa}{\the\dimen@}}%
+ \expandafter\do@output@MVL\expandafter{\@tempa}%
+ \endgroup
+}%
+\def\@@enlargethispage#1#2{%
+ \def\@tempa{one}%
+ \@ifx{\thepagegrid\@tempa}{%
+ \true@sw
+ }{%
+ \def\@tempa{mlt}%
+ \@ifx{\thepagegrid\@tempa}{%
+ \@ifnum{\pagegrid@cur=\@ne}{% OK to adjust this page
+ \gdef\enlarge@colroom{#2}%
+ \true@sw
+ }{% Can only adjust this column; give up
+ \ltxgrid@warn{Too late to enlarge this page; move the command to the first column.}%
+ \false@sw
+ }%
+ }{% Unknown page grid
+ \ltxgrid@warn{Unable to enlarge a page of this kind.}%
+ \false@sw
+ }%
+ }%
+ {%
+ \class@info{Enlarging page \thepage\space by #2}%
+ \global\advance\@colroom#2\relax
+ \set@vsize
+ }{%
+ % Could not adjust this page
+ }%
+}%
+\let\enlarge@colroom\@empty
+% \end{macrocode}
+% The \cmd\@kludgeins\ insert register is now unneeded.
+% Ensure that packages using this mechanism break (preferrable to subtle bugs).
+% \begin{macrocode}
+\let\@kludgeins\@undefined
+% \end{macrocode}
+%
+% \subsubsection{Building the page for shipout}
+%
+% \begin{macro}{\@outputpage}
+% The procedures that build \cmd\@outputbox\ just before a page is shipped out by \cmd\@outputpage\ are:
+% \cmd\@makecol,
+% \cmd\@combinepage, and
+% \cmd\@combinedblfloats.
+% We headpatch \cmd\@outputpage\ to make the \cmd\@outputbox\ be of fixed height.
+% \begin{macrocode}
+\@booleantrue\textheight@sw
+\prepdef\@outputpage{%
+ \textheight@sw{%
+ \count@\vbadness\vbadness\@M
+ \dimen@\vfuzz\vfuzz\maxdimen
+ \setbox\@outputbox\vbox to\textheight{\unvbox\@outputbox}%
+ \vfuzz\dimen@
+ \vbadness\count@
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Warning message}
+%
+% \begin{macro}{\ltxgrid@info}
+% \begin{macro}{\ltxgrid@warn}
+% Something has happened that the user might be interested in.
+% Print a message to the log, but only if the user selected the verbose option.
+% \begin{macrocode}
+\def\ltxgrid@info{%
+ \ltxgrid@info@sw{\class@info}{\@gobble}%
+}%
+\@booleanfalse\ltxgrid@info@sw
+\def\ltxgrid@warn{%
+ \ltxgrid@warn@sw{\class@warn}{\@gobble}%
+}%
+\@booleantrue\ltxgrid@warn@sw
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \section{End of the \file{ltxgrid} {\sc docstrip} module}
+% Here ends the module.
+% \begin{macrocode}
+%</ltxgrid-krn>
+% \end{macrocode}
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
+%%EOF
diff --git a/Master/texmf-dist/source/latex/revtex/ltxutil.dtx b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
new file mode 100644
index 00000000000..5553e3a863e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/ltxutil.dtx
@@ -0,0 +1,3534 @@
+% \iffalse ltxdoc klootch
+% ltxutil.dtx: package to add utilties to LaTeX
+% Copyright (c) 2000 Arthur Ogawa
+%
+% Disclaimer
+% This file is distributed WITHOUT ANY WARRANTY;
+% without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+% ReadMe
+% For the documentation and more detailed instructions for
+% installation, typeset this document with \LaTeX.
+% \fi
+% \GetFileInfo{ltxutil.dtx}\CheckSum{3641}
+%
+% \iffalse ltxdoc klootch
+%<*ltxutil>
+%%% @LaTeX-file{
+%%% filename = "ltxutil.dtx",
+%%% version = "1.0rc5b",
+%%% date = "2001/07/31",
+%%% time = "12:23:00 GMT+8",
+%%% checksum = "3641",
+%%% author = "Arthur Ogawa (mailto:ogawa@teleport.com),
+%%% commissioned by the American Physical Society.
+%%% ",
+%%% copyright = "Copyright (C) 1999 Arthur Ogawa,
+%%% distributed under the terms of the
+%%% LaTeX Project Public License, see
+%%% ftp://ctan.tug.org/macros/latex/base/lppl.txt
+%%% ",
+%%% address = "Arthur Ogawa,
+%%% USA",
+%%% telephone = "",
+%%% FAX = "",
+%%% email = "ogawa@teleport.com",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "latex, utility, kernel",
+%%% supported = "yes",
+%%% abstract = "package to add utilties to LaTeX",
+%%% docstring = "The checksum field above generated by ltxdoc",
+%%% }
+%</ltxutil>
+% \fi
+%
+% \iffalse ltxdoc klootch
+% The following references the \file{00readme.txt} file,
+% which contains basic information about this package.
+% The contents of this file are generated when
+% you typeset the programmer's documentation.
+% Search on "{filecontents*}{00readme.txt}" to locate it.
+% \fi\input{00readme.txt}%
+%
+% \subsection{Bill of Materials}
+%
+% Following is a list of the files in this distribution arranged
+% according to provenance.
+%
+% \subsubsection{Primary Source}%
+% One single file generates all.
+%\begin{verbatim}
+%ltxutil.dtx
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{latex ltxutil.dtx}}%
+% Typesetting the source file under \LaTeX\
+% generates the readme and the installer.
+%\begin{verbatim}
+%00readme.txt ltxutil.ins
+%\end{verbatim}
+%
+% \subsubsection{Generated by \texttt{tex ltxutil.ins}}%
+% Typesetting the installer generates
+% the package files.
+%\begin{verbatim}
+%ltxutil.sty
+%\end{verbatim}
+%
+% \subsubsection{Documentation}%
+% The following are the online documentation:
+% \begin{verbatim}
+%ltxutil.pdf
+% \end{verbatim}
+%
+% \subsubsection{Auxiliary}%
+% The following are auxiliary files generated
+% in the course of running \LaTeX:
+% \begin{verbatim}
+%ltxutil.aux ltxutil.idx ltxutil.ind ltxutil.log ltxutil.toc
+% \end{verbatim}
+%
+% \section{Code common to all modules}%
+%
+% The following may look a bit klootchy, but we
+% want to require only one place in this file
+% where the version number is stated,
+% and we also want to ensure that the version
+% number is embedded into every generated file.
+%
+% Now we declare that
+% these files can only be used with \LaTeXe.
+% An appropriate message is displayed if
+% a different \TeX{} format is used.
+% \begin{macrocode}
+%<*doc|ltxutil>
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%</doc|ltxutil>
+% \end{macrocode}
+% As desired, the following modules all
+% take common version information:
+% \begin{macrocode}
+%<ltxutil>\ProvidesFile{ltxutil.sty}%
+%<*doc>
+\expandafter\ProvidesFile\expandafter{\jobname.dtx}%
+%</doc>
+% \end{macrocode}
+%
+% The following line contains, for once and for all,
+% the version and date information.
+% By various means, this information is reproduced
+% consistently in all generated files and in the
+% typeset documentation.
+% \begin{macrocode}
+%<*doc|ltxutil>
+ [2001/07/31 1.0rc5b utilities package]% \fileversion
+%</doc|ltxutil>
+% \end{macrocode}
+%
+%
+% \section{The driver module \texttt{doc}}
+%
+% This module, consisting of the present section,
+% typesets the programmer's documentation,
+% generating the \file{.ins} installer and \file{00readme.txt} as required.
+%
+% Because the only uncommented-out lines of code at the beginning of
+% this file constitute the \file{doc} module itself,
+% we can simply typeset the \file{.dtx} file directly,
+% and there is thus rarely any need to
+% generate the ``doc'' {\sc docstrip} module.
+% Module delimiters are nonetheless required so that
+% this code does not find its way into the other modules.
+%
+% The \enve{document} command concludes the typesetting run.
+%
+% \begin{macrocode}
+%<*doc>
+% \end{macrocode}
+%
+% \subsection{The Preamble}
+% The programmers documentation is formatted
+% with the \classname{ltxdoc} class with local customizations,
+% and with the usual code line indexing.
+% \begin{macrocode}
+\documentclass{ltxdoc}
+\RequirePackage{ltxdocext}%
+\let\url\undefined
+\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
+\expandafter\ifx\csname package@font\endcsname\@undefined\else
+ \expandafter\RequirePackage\expandafter{\csname package@font\endcsname}%
+\fi
+\CodelineIndex\EnableCrossrefs
+% \end{macrocode}
+%
+% \subsubsection{Docstrip and info directives}
+% We use so many {\sc docstrip} modules that we set the
+% \texttt{StandardModuleDepth} counter to 1.
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+% \end{macrocode}
+% The following command retrieves the date and version information
+% from this file.
+% \begin{macrocode}
+\expandafter\GetFileInfo\expandafter{\jobname.dtx}%
+% \end{macrocode}
+%
+%
+% \subsection{The installer file}
+%
+% The installer \file{ltxutil.ins} appears here.
+% If you have retrieved the standard distribution of this package,
+% the installer file is already on your filesystem.
+% If you are bootstrapping,
+% the first typesetting of the \file{.dtx} file
+% will cause the installer to be generated.
+%
+% The following modules are used to direct
+% {\sc docstrip} in generating the external files:
+% \begin{center}
+% \begin{tabular}{lll}
+% \textbf{Module}&\textbf{File}&\textbf{Description}\\
+% doc &\file{ltxutil.drv}&driver for programmer's documentation\\
+% ltxutil,ltxutil-krn &\file{ltxutil.sty}&this package\\
+% ltxutil-krn& &the portion of this package suitable for inclusion within another package
+% \end{tabular}
+% \end{center}
+%
+% \begin{macrocode}
+\begin{filecontents}{ltxutil.ins}
+%% This file will generate documentation and runtime files
+%% from ltxutil.dtx when run through LaTeX or TeX.
+\input docstrip
+\preamble
+
+This is a generated file;
+altering it directly is inadvisable;
+instead, modify the original source file.
+See the URL in the file 00readme.txt.
+
+Copyright notice.
+
+ These files are distributed
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+\endpreamble
+\keepsilent
+ \generate{%
+ \file{ltxutil.drv}{\from{ltxutil.dtx}{doc}}%
+ \file{ltxutil.sty}{%
+ \from{ltxutil.dtx}{ltxutil,ltxutil-krn}%
+ }%
+ }%
+\ifToplevel{
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, please move}
+\Msg{* ltxutil.sty}
+\Msg{* into a directory searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation,
+ run ltxutil.dtx through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+}
+\endbatchfile
+\end{filecontents}
+% \end{macrocode}
+% Note that, because all of the files generated by the installer
+% are part of the standard distribution, it will
+% be necessary to run the installer only when bootstrapping
+% (or, of course, during development).
+% Note, too, that it is rare to generate the \file{doc}
+% module because it suffices to simply typeset the \file{.dtx} file itself.
+%
+% \subsection{The ``Read Me'' File}
+% As promised above, here is the contents of the
+% ``Read Me'' file. That file serves a double purpose,
+% since it also constitutes the beginining of the
+% programmer's documentation. What better thing, after
+% all, to have appear at the beginning of the
+% typeset documentation?
+%
+% A good discussion of how to write a ReadMe file can be found in
+% Engst, Tonya, ``Writing a ReadMe File? Read This''
+% \emph{MacTech} October 1998, p. 58.
+%
+% Note the appearance of the
+% \cmd\StopEventually\ command, which marks the
+% dividing line between the user documentation
+% and the programmer documentation.
+%
+% The usual user will not be asked to
+% do a full build, not to speak
+% of the bootstrap.
+% Instructions for carrying these processes
+% begin the programmer's manual.
+%
+% \begin{macrocode}
+\begin{filecontents*}{00readme.txt}
+\title{%
+ A \LaTeX\ Package of utility macros%
+ \thanks{%
+ This file has version number \fileversion,
+ last revised \filedate.%
+ % For version number and date,
+ % search on "\fileversion" in the .dtx file,
+ % or see the end of the 00readme.txt file.
+ }%
+}%
+
+\author{%
+Arthur Ogawa (\texttt{mailto:ogawa@teleport.com}),
+\fileversion\\Copyright (C) 1999 Arthur Ogawa
+}%
+\maketitle
+
+This file embodies the \classname{ltxutil} package,
+the implementation and its user documentation.
+
+The distribution point for this work is
+\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxutil...},
+which contains fully unpacked, prebuilt runtime files and documentation.
+
+The \classname{ltxutil} package was commissioned by the American Physical Society
+and is distributed under the terms of the \LaTeX\ Project Public License,
+the same license under which all the portions of \LaTeX\ itself is distributed.
+Please see \url{http://ctan.tug.org/macros/latex/base/lppl.txt} for details.
+
+To use this document class, you must have a working
+\TeX\ installation equipped with \LaTeXe\
+and possibly pdftex and Adobe Acrobat Reader or equivalent.
+
+To install, retrieve the distribution,
+unpack it into a directory on the target computer,
+and move the file \file{ltxutil.sty}
+into a location in your filesystem where it will be found by \LaTeX.
+
+To use, read the user documentation \file{ltxutil.pdf}.
+
+\tableofcontents
+
+\section{Processing Instructions}
+
+The package file \file{ltxutil.sty}
+is generated from this file, \file{ltxutil.dtx},
+using the {\sc docstrip} facility of \LaTeX
+via |tex ltxutil.ins|.
+The typeset documentation that you are now reading is generated from
+the same file by typesetting it with \LaTeX\ or pdftex
+via |latex ltxutil.dtx| or |pdflatex ltxutil.dtx|.
+
+\subsection{Build Instructions}
+
+You may bootstrap this suite of files solely from \file{ltxutil.dtx}.
+Prepare by installing \LaTeXe\ (and either tex or pdftex) on your computer,
+then carry out the following steps:
+\begin{enumerate}
+\item
+Within an otherwise empty directory,
+typeset \file{ltxutil.dtx} with \LaTeX\ or pdflatex;
+you will obtain the typeset documentation you are now reading,
+along with
+the installer \file{ltxutil.ins},
+and the file \file{00readme.txt}.
+
+Note: you will have to run \LaTeX\ twice, then \file{makeindex}, then
+\LaTeX\ again in order to obtain a valid index and table of contents.
+\item
+Now typeset \file{ltxutil.ins},
+thereby generating the package file \file{ltxutil.sty}.
+\item
+Install \classname{ltxutil.sty}
+by moving it to a location
+in your filesystem where they will be found by \LaTeX.
+\end{enumerate}
+\end{filecontents*}
+% \end{macrocode}
+%
+% \subsection{The Document Body}
+%
+% Here is the document body, containing only a
+% \cmd\DocInput\ directive---referring to this very file.
+% This very cute self-reference is a common \classname{ltxdoc} idiom.
+% \begin{macrocode}
+\begin{document}%
+\expandafter\DocInput\expandafter{\jobname.dtx}%
+% ^^A\PrintChanges
+\end{document}
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</doc>
+% \end{macrocode}
+%
+% \section{Using this package}
+% Once this package is installed on your filesystem, you can employ it in
+% adding functionality to \LaTeX\ by invoking it in your document or document class.
+%
+% \subsection{Invoking the package}
+% In your document, you can simply call it up in your preamble:
+% \begin{verbatim}
+%\documentclass{book}%
+%\usepackage{ltxutil}%
+%\begin{document}
+%<your document here>
+%\end{document}
+% \end{verbatim}
+% However, the preferred way is to invoke this package from within your
+% customized document class:
+% \begin{verbatim}
+%\NeedsTeXFormat{LaTeX2e}[1995/12/01]%
+%\ProvidesClass{myclass}%
+%\RequirePackage{ltxutil}%
+%\LoadClass{book}%
+%<class customization commands>
+%\endinput
+% \end{verbatim}
+%
+% Once loaded, the package gives you acccess to certain procedures,
+% usually to be invoked by a \LaTeX\ command or environment, but not at the document level.
+%
+%
+% \section{Compatability with \LaTeX's Required Packages}
+% Certain packages, usually ones written by members of the
+% \LaTeX\ Project itself, have been designated ``required'' and
+% are distributed as part of standard \LaTeX.
+% These packages have been placed in a priviledged position
+% vis \'a vis the \LaTeX\ kernel in that they override the definitions of certain kernel macros.
+%
+% The \classname{ltxutil} package will be incompatible with any package that
+% redefines any of the kernel macros that \classname{ltxutil} patches---if that
+% package is loaded \emph{after} \classname{ltxutil}. This means that for
+% greatest compatability, \classname{ltxutil} should be loaded \emph{after},
+% say, \classname{ftnright}, which overwrites \LaTeX's kernel
+% procedures \cmd\@outputdblcol, \cmd\@startcolumn, and \cmd\@makecol.
+%
+% Hereinafter follows some notes on specific \LaTeX\ packages.
+%
+% \subsection{array}
+% This package alters the way tabular environments are done,
+% therefore it could run afoul of the \LaTeX\ ``required'' package \classname{array} or any
+% package that calls for it to be loaded.
+% However, this package has provisions for remaining compatible with \classname{array}.
+% So long as the version of \classname{array} that is used with this package has the appropriate
+% meanings for the procedures it overwrites, all should be well.
+%
+% \subsection{longtable}
+% David Carlisle's \classname{longtable} package modifies both the \LaTeX\ kernel and the
+% \classname{array} package. This package must therefore alter \cmd\LT@array.
+% For now, that job is handled by \classname{ltxgrid}.
+%
+%
+%\StopEventually{}
+%
+% \section{Implementation of package}
+%
+% Special acknowledgment: this package uses concepts pioneered
+% and first realized by William Baxter (mailto:web@superscript.com)
+% in his SuperScript line of commercial typesetting tools, and
+% which are used here with his permission.
+%
+% \subsection{Beginning of the \file{ltxutil} {\sc docstrip} module}
+% \begin{macrocode}
+%<*ltxutil>
+\def\package@name{ltxutil}%
+\expandafter\PackageInfo\expandafter{\package@name}{%
+ Utility macros for \protect\LaTeXe,
+ by A. Ogawa (ogawa@teleport.com)%
+}%
+%</ltxutil>
+% \end{macrocode}
+%
+% \subsection{Banner}%
+% Credit where due.
+% \begin{macrocode}
+%<*ltxutil-krn>
+\typeout{%
+ ltxutil: portions licensed from W. E. Baxter (web@superscript.com)%
+}%
+% \end{macrocode}
+%
+% \subsection{Errors and warnings}
+%
+% \begin{macro}{\class@err}
+% \begin{macro}{\class@warn}
+% \begin{macro}{\class@info}
+% A few shorthands for Class messages.
+% Your document class should define \cmd\class@name.
+% \begin{macrocode}
+\def\class@err#1{\ClassError{\class@name}{#1}\@eha}%
+\def\class@warn#1{\ClassWarningNoLine{\class@name}{#1}}%
+\def\class@info#1{\ClassInfo{\class@name}{#1}}%
+\def\obsolete@command#1{%
+ \class@warn@end{Command \string#1\space is obsolete.^^JPlease remove from your document}%
+ \global\let#1\@empty
+ #1%
+}%
+\def\replace@command#1#2{%
+ \class@warn@end{Command \string#1\space is obsolete;^^JUse \string#2\space instead}%
+ \global\let#1#2%
+ #1%
+}%
+\def\replace@environment#1#2{%
+ \class@warn@end{Environment #1 is obsolete;^^JUse #2 instead}%
+ \glet@environment{#1}{#2}%
+ \@nameuse{#1}%
+}%
+\def\incompatible@package#1{%
+ \@ifpackageloaded{#1}{%
+ \def\@tempa{I cannot continue. You must remove the \string\usepackage\ statement that caused that package to be loaded.}%
+ \ClassError{\class@name}{The #1 package cannot be used with \class@name}%
+ \@tempa\stop
+ }{%
+ \class@info{#1 was not loaded (OK!)}%
+ }%
+}%
+\def\class@warn@end#1{%
+ \gappdef\class@enddocumenthook{\class@warn{#1}}%
+}%
+\AtEndOfClass{%
+ \@ifxundefined\class@name{\def\class@name{Generic Class}}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{New Tools}%
+%
+% \begin{macro}{\t@}
+% \begin{macrocode}
+\def\t@{to}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dimen@iii}
+% \begin{macrocode}
+\dimendef\dimen@iii\thr@@
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\halignt@}
+% \begin{macrocode}
+\def\halignt@{\halign\t@}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\f@ur}
+% Analogous to \cmd\@ne, \cmd\tw@, and \cmd\thr@@.
+% \begin{macrocode}
+\chardef\f@ur=4\relax
+\chardef\cat@letter=11\relax
+\chardef\other=12\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\let@environment}
+% \begin{macro}{\glet@environment}
+% The directive \cmd\let@environment\ takes care of a common programming
+% idiom whereby one environment is made a synonym for another.
+% \begin{macrocode}
+\def\let@environment#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname\csname#2\endcsname
+ \expandafter\let
+ \csname end#1\expandafter\endcsname\csname end#2\endcsname
+}%
+\def\glet@environment#1#2{%
+ \global\expandafter\let
+ \csname#1\expandafter\endcsname\csname#2\endcsname
+ \global\expandafter\let
+ \csname end#1\expandafter\endcsname\csname end#2\endcsname
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tracingplain}
+% The command \cmd\tracingplain\ causes \TeX's tracing parameters to
+% return to the values set by default. This command is sometimes
+% useful when you have said \cmd\tracingall\ somewhere and want to
+% restore.
+% The \cmd\traceoutput\ command causes \cmd\tracingoutput\ diagnostics
+% upon \cmd\shipout.
+% \begin{macrocode}
+\newcommand\tracingplain{%
+ \tracingonline\z@\tracingcommands\z@\tracingstats\z@
+ \tracingpages\z@\tracingoutput\z@\tracinglostchars\@ne
+ \tracingmacros\z@\tracingparagraphs\z@\tracingrestores\z@
+ \showboxbreadth5\showboxdepth3\relax %\errorstopmode
+ }%
+\newcommand\traceoutput{%
+ \appdef\@resetactivechars{\showoutput}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\say}
+% \begin{macro}{\saythe}
+% The commands \cmd\say\ and \cmd\saythe\ cause diagnostic messages in the
+% \TeX\ log that give the value of a control sequence name or a register
+% respectively.
+% \begin{macrocode}
+\newcommand\say[1]{\typeout{<\noexpand#1=\meaning#1>}}%
+\newcommand\saythe[1]{\typeout{<\noexpand#1=\the#1>}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\fullinterlineskip}
+% Resets the \cmd\prevdepth\ so that the full amount of \cmd\baselineskip\ glue will be inserted by
+% the \cmd\baselinesklip\ mechanism.
+% Can be invoked just after a \cmd\hrule\ to undo its default suppression of base line skip.
+% \begin{macrocode}
+\def\fullinterlineskip{\prevdepth\z@}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\count@i}
+% \begin{macro}{\count@ii}
+%
+% \begin{macrocode}
+\countdef\count@i\@ne
+\countdef\count@ii\tw@
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Boolean Control}%
+% We introduce just enough of the Boolean calculus for \TeX.
+% Alan Jeffrey was the pioneer here, with an article in TUGboat
+% (Vol. 11, No. 2, page 237).
+% This implementation owes a debt to
+% William Baxter (web@superscript.com).
+% See articles by Baxter and Ogawa in the proceedings of the
+% 1994 TUG meeting, TUGboat Vol.~15, No.~3.
+%
+% \begin{macro}{\prepdef}
+% \begin{macro}{\appdef}
+% \begin{macro}{\gappdef}
+%
+% Provide the capability of performing head- and tail patches.
+% The procedure \cmd\prepdef\ prepends to the given macro
+% the tokens specified in its second argument.
+% Likewise for \cmd\appdef, except that it appends.
+% Note that the first 10 toks registers are utility registers,
+% and we simply make a control sequence name, \cmd\toks@ii, for one of
+% them.
+% \begin{macrocode}
+\long\def\prepdef#1#2{%
+ \@ifxundefined#1{\toks@{}}{\toks@\expandafter{#1}}%
+ \toks@ii{#2}%
+ \edef#1{\the\toks@ii\the\toks@}%
+}%
+\long\def\appdef#1#2{%
+ \@ifxundefined#1{\toks@{}}{\toks@\expandafter{#1}}%
+ \toks@ii{#2}%
+ \edef#1{\the\toks@\the\toks@ii}%
+}%
+\long\def\gappdef#1#2{%
+ \@ifxundefined#1{\toks@{}}{\toks@\expandafter{#1}}%
+ \toks@ii{#2}%
+ \global\edef#1{\the\toks@\the\toks@ii}%
+}%
+\long\def\appdef@val#1#2{%
+ \appdef#1{{#2}}%
+}%
+\long\def\appdef@e#1#2{%
+ \expandafter\appdef
+ \expandafter#1%
+ \expandafter{#2}%
+}%
+\long\def\appdef@eval#1#2{%
+ \expandafter\appdef@val
+ \expandafter#1%
+ \expandafter{#2}%
+}%
+\toksdef\toks@ii=\tw@
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ifxundefined}
+% \begin{macro}{\@ifnotrelax}
+% \begin{macro}{\@argswap}
+% \begin{macro}{\@argswap@val}
+%
+% Certain utility procedures use \cmd\@ifxundefined,
+% which is defined here in terms of \cmd\@ifx.
+% Others use \cmd\@ifnotrelax, namely when
+% the control sequence name is manufactured by
+% the use of \cmd\csname.
+%
+% The procedures \cmd\@argswap and \cmd\@argswap@val
+% are used to facilitate control of expansion.
+%
+% \begin{macrocode}
+\long\def\@ifxundefined#1{\@ifx{\undefined#1}}%
+\long\def\@ifnotrelax#1#2#3{\@ifx{\relax#1}{#3}{#2}}%
+\long\def\@argswap#1#2{#2#1}%
+\long\def\@argswap@val#1#2{#2{#1}}%
+\def\@ifxundefined@cs#1{\expandafter\@ifx\expandafter{\csname#1\endcsname\relax}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@boolean}
+% \begin{macro}{\@boole@def}
+% In order to define \cmd\@ifx, we first must create the
+% ``defining word'' (term taken form our Forth vocabulary)
+% \cmd\@boole@def, which employs \cmd\@boolean\ to do its job.
+% \begin{macrocode}
+\def\@boolean#1#2{%
+ \long\def#1{%
+ #2% \if<something>
+ \expandafter\true@sw
+ \else
+ \expandafter\false@sw
+ \fi
+ }%
+}%
+\def\@boole@def#1#{\@boolean{#1}}% Implicit #2
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@booleantrue}
+% \begin{macro}{\@booleanfalse}
+% The procedures \cmd\@booleantrue\ and
+% \cmd\@booleanfalse\ are assignment operators
+% for Boolean flags.
+% \begin{macrocode}
+\def\@booleantrue#1{\let#1\true@sw}%
+\def\@booleanfalse#1{\let#1\false@sw}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ifx}
+% \begin{macro}{\@ifx@empty}
+% \begin{macro}{\@if@empty}
+% \begin{macro}{\@ifcat}%
+% \begin{macro}{\@ifdim}%
+% \begin{macro}{\@ifeof}%
+% \begin{macro}{\@ifhbox}%
+% \begin{macro}{\@ifhmode}%
+% \begin{macro}{\@ifinner}%
+% \begin{macro}{\@ifmmode}%
+% \begin{macro}{\@ifnum}%
+% \begin{macro}{\@ifodd}%
+% \begin{macro}{\@ifvbox}%
+% \begin{macro}{\@ifvmode}%
+% \begin{macro}{\@ifvoid}%
+% We can now invoke the defining word to create
+% the procedures \cmd\@ifx\ and friends.
+%
+% Compatability Note: earlier versions of this package
+% defined a procedure \cmd\@ifempty. However, for compatability with AMS\LaTeX,
+% we must avoid the following three names:
+% \cmd\@ifempty, \cmd\@xifempty, and \cmd\@ifnotempty.
+%
+% \begin{macrocode}
+\@boole@def\@ifx#1{\ifx#1}%
+\@boole@def\@ifx@empty#1{\ifx\@empty#1}%
+\@boole@def\@if@empty#1{\if!#1!}%
+%\@boole@def\@if@sw#1{\csname if#1\endcsname}%
+\def\@if@sw#1#2{#1\expandafter\true@sw\else\expandafter\false@sw#2}%
+\@boole@def\@ifdim#1{\ifdim#1}%
+\@boole@def\@ifeof#1{\ifeof#1}%
+\@boole@def\@ifhbox#1{\ifhbox#1}%
+\@boole@def\@ifhmode{\ifhmode}%
+\@boole@def\@ifinner{\ifinner}%
+\@boole@def\@ifmmode{\ifmmode}%
+\@boole@def\@ifnum#1{\ifnum#1}%
+\@boole@def\@ifodd#1{\ifodd#1}%
+\@boole@def\@ifvbox#1{\ifvbox#1}%
+\@boole@def\@ifvmode{\ifvmode}%
+\@boole@def\@ifvoid#1{\ifvoid#1}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\true@sw}
+% \begin{macro}{\false@sw}
+%
+% Note that when a Boolean operator expands, it
+% employs two macros that act as selectors, defined here.
+%
+% \begin{macrocode}
+\long\def\true@sw#1#2{#1}%
+\long\def\false@sw#1#2{#2}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\loopuntil}
+% \begin{macro}{\loopwhile}
+%
+% Loop control using the Boolean idiom.
+% Superior to \cmd\loop\dots\cmd\repeat\ because these can be nested.
+% The tail of the argument must have a Boolean predicate.
+%
+% \begin{macrocode}
+\long\def\loopuntil#1{#1{}{\loopuntil{#1}}}%
+\long\def\loopwhile#1{#1{\loopwhile{#1}}{}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@provide}
+%
+% A defining word that refuses to clobber a prior meaning.
+%
+% \begin{macrocode}
+\def\@provide#1{%
+ \@ifx{\undefined#1}{\true@sw}{\@ifx{\relax#1}{\true@sw}{\false@sw}}%
+ {\def#1}{\def\j@nk}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Begin Document Structure}
+% The standard \LaTeX\ mechanism \cmd\AtBeginDocument\
+% is inadequate because the \cmd\vsize\ is bound much too early.
+% We supply here a mechanism whereby decisions about the
+% page layout can be deferred until \cmd\AtBeginDocument\ time.
+%
+% The problem we are working around is that the \cmd\AtBeginDocument\
+% hook in \cmd\document\ appears long after the calculation of
+% \cmd\vsize\ and \cmd\hsize, that is, \LaTeX\ provides no mechanism
+% for deferring the decision about the page grid until \cmd\AtBeginDocument\ time.
+% We fix things by prepending a hook at the very beginning of \cmd\document.
+%
+% The price we pay for this facility is to depend on the stability of this part
+% of \LaTeX's kernel code (the first token of \cmd\document),
+% which could change, you see. But considering that \LaTeX\ is
+% at this point essentially stagnant once more, we risk it.
+%
+% \begin{macro}{\document}
+% We begin by installing hooks into \cmd\document\ that
+% we will manage ourselves.
+% First, we do as \cmd\document\ does: end the group
+% begun by \cmd\begin. Last, we conclude our shenanigans by absorbing
+% the first token of the expansion of \cmd\document, which
+% we assume to be \cmd\endgroup.
+% \begin{macrocode}
+\prepdef\document{%
+ \endgroup
+ \init@documenthook
+ \set@typesize@hook
+ \normalsize
+ \set@pica@hook
+ \true@sw{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\class@documenthook}
+% \begin{macro}{\class@enddocumenthook}
+% We install the first \cmd\AtBeginDocument\ hook, namely the
+% procedure \cmd\class@documenthook. Within the document class,
+% we will use this hook exclusively, so as to avoid interference from other packages.
+% Similarly with \cmd\class@enddocumenthook, installed via \cmd\AtEndDocument.
+%
+% A document class using this package should do as this package does and
+% just say, \cmd\appdef\cmd\class@documenthook\ and \cmd\appdef\cmd\class@enddocumenthook\
+% instead of \cmd\AtBeginDocument\ and \cmd\AtEndDocument.
+% \begin{macrocode}
+\def\init@documenthook{}%
+\AtBeginDocument{%
+ \class@documenthook
+}%
+\AtEndDocument{%
+ \class@enddocumenthook
+}%
+\def\class@documenthook{}%
+\def\class@enddocumenthook{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\set@typesize@hook}
+% \begin{macro}{\set@pica@hook}
+% The macros \cmd\set@typesize@hook\ and \cmd\set@pica@hook\ provide everything we need.
+% To use, simply \cmd\appdef\ your tokens to the appropriate hook.
+% \begin{macrocode}
+\def\set@typesize@hook{}%
+\def\set@pica@hook{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\enddocument}
+% \begin{macro}{\check@aux}
+% \begin{macro}{\do@check@aux}
+% The standard \LaTeX\ \enve{document} processing is a potential problem,
+% particularly when the output routine has been changed by \classname{ltxgrid}.
+% We separate out the procedure that checks the auxiliary file at the end of
+% the job so that later it can be called from the safety of the output
+% routine.
+% We will do this to ensure that the \cmd\@mainaux\ stream is not closed until
+% the last page of the job is shipped out, and that can only be done by coordinating
+% with the output routine.
+% \begin{macrocode}
+\def\enddocument{%
+ \@enddocumenthook
+ \@checkend{document}%
+ \clear@document
+ \check@aux
+ \deadcycles\z@
+ \@@end
+}%
+\def\clear@document{\clearpage}%
+\def\check@aux{\do@check@aux}%
+\def\do@check@aux{%
+ \@if@sw\if@filesw\fi{%
+ \immediate\closeout\@mainaux
+ \let\@setckpt\@gobbletwo
+ \let\@newl@bel\@testdef
+ \@tempswafalse
+ \makeatletter
+ \input\jobname.aux\relax
+ }{}%
+ \@dofilelist
+ \@ifdim{\font@submax >\fontsubfuzz\relax}{%
+ \@font@warning{%
+ Size substitutions with differences\MessageBreak
+ up to \font@submax\space have occured.\@gobbletwo
+ }%
+ }{}%
+ \@defaultsubs
+ \@refundefined
+ \@if@sw\if@filesw\fi{%
+ \@ifx{\@multiplelabels\relax}{%
+ \@if@sw\if@tempswa\fi{%
+ \@latex@warning@no@line{%
+ Label(s) may have changed.
+ Rerun to get cross-references right
+ }%
+ }{}%
+ }{%
+ \@multiplelabels
+ }%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Type Tools}%
+%
+% \begin{macro}{\flushing}
+% Undoes \cmd\centering. Should also undo \cmd\raggedleft\ and \cmd\raggedright.
+% \begin{macrocode}
+\def\flushing{%
+ \let\\\@normalcr
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \@rightskip\z@skip
+ \parfillskip\@flushglue
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Display Math}%
+%
+% \begin{macro}{\eqnarray@LaTeX}
+% \begin{macro}{\eqnarray@fleqn@fixed}
+% Team \LaTeX\ has stated they will never repair Leslie's broken definition of \env{eqnarray}.
+% Let us be bold\dots.
+%
+% Note on \classname{hyperref} package compatability: that package overrides
+% \cmd\eqnarray\ by wrapping it up in a larger procedure, so its changes
+% are compatible with this package's changes.
+%
+% \begin{macrocode}
+\def\eqnarray@LaTeX{%
+ \stepcounter{equation}%
+ \def\@currentlabel{\p@equation\theequation}%
+ \global\@eqnswtrue
+ \m@th
+ \global\@eqcnt\z@
+ \tabskip\@centering
+ \let\\\@eqncr
+ $$\everycr{}\halign\t@\displaywidth\bgroup
+ \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
+ &\global\@eqcnt\@ne\hskip \tw@\arraycolsep \hfil${##}$\hfil
+ &\global\@eqcnt\tw@ \hskip \tw@\arraycolsep
+ $\displaystyle{##}$\hfil\tabskip\@centering
+ &\global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup
+ \tabskip\z@skip
+ \cr
+}
+\long\def\eqnarray@fleqn@fixed{%
+ \stepcounter{equation}\def\@currentlabel{\p@equation\theequation}%
+ \global\@eqnswtrue\m@th\global\@eqcnt\z@
+ \tabskip\mathindent
+ \let\\=\@eqncr
+ \setlength\abovedisplayskip{\topsep}%
+ \ifvmode\addtolength\abovedisplayskip{\partopsep}\fi
+ \addtolength\abovedisplayskip{\parskip}%
+ \setlength\belowdisplayskip{\abovedisplayskip}%
+ \setlength\belowdisplayshortskip{\abovedisplayskip}%
+ \setlength\abovedisplayshortskip{\abovedisplayskip}%
+ $$%
+ \everycr{}%
+ \halignt@\linewidth\bgroup
+ \hskip\@centering$\displaystyle\tabskip\z@skip{##}$\@eqnsel
+ &\global\@eqcnt\@ne
+ \hskip\tw@\eqncolsep
+ \hfil${{}##{}}$\hfil
+ &\global\@eqcnt\tw@
+ \hskip\tw@\eqncolsep
+ $\displaystyle{##}$\hfil\tabskip\@centering
+ &\global\@eqcnt\thr@@\hb@xt@\z@\bgroup\hss##\egroup
+ \tabskip\z@skip
+ \cr
+}%
+\@ifx{\eqnarray\eqnarray@LaTeX}{%
+ \class@info{Repairing broken LaTeX eqnarray}%
+ \let\eqnarray\eqnarray@fleqn@fixed
+ \newlength\eqncolsep
+ \setlength\eqncolsep\z@
+ \let\eqnarray@LaTeX\relax
+ \let\eqnarray@fleqn@fixed\relax
+}{}%
+\def\mathindent{\@centering}%
+\def\set@eqnarray@skips{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Footnotes}
+%
+% \changes{v4.0beta 4}{2000/04/10}
+% {New kernel fix. For bug 174}
+%
+% \begin{macro}{\footnote}
+% \begin{macro}{\footnotemark}
+% \begin{macro}{\@xfootnote}
+% \begin{macro}{\@xfootnotemark}
+% \begin{macro}{\@yfootnote}
+% We repair an error in the \LaTeX\ kernel (see \file{ltfloat.dtx}) involving footnotes.
+% The symptom is that the \cmd\footnotemark\ command does not work properly within a \env{minipage} environment.
+% The source of the problem is in the way the \cmd\footnotemark\ and \cmd\@xfootnotemark\ procedures are defined:
+% they do not share the method used by the \cmd\footnote\ and other procedures that allows a context switch to
+% change the way footnotes behave within a minipage environment.
+% This is a \LaTeX\ bug of long standing; this fix dates to 1987.
+%
+% While we are at it, we rewrite both the \cmd\footnote\ and \cmd\footnotemark\ procedures,
+% achieving a slightly cleaner separation of syntax and semantics.
+% Note that the \cmd\@footnotemark\ and \cmd\@footnotetext\ procedures are not altered here;
+% they continue as the methods of formatting the footnote mark and footnote text, respectively.
+%
+% A note about the context switch mentioned above:
+% the \env{minipage} environment executes the following in order to alter the way footnotes
+% behave:
+%\begin{verbatim}
+%\def\@mpfn{mpfootnote}%
+%\def\thempfn{\thempfootnote}%
+%\let\@footnotetext\@mpfootnotetext
+%\c@mpfootnote\z@
+%\end{verbatim}
+% This code changes the counter used in autonumbered footnotes, the choice of footnote marker,
+% and the procedure used on the footnote text. Changing the counter is needed because minipage
+% footnotes are in their own sequence, and the footnote marker is customarily different within
+% a minipage. The procedure that works on the footnote text must be different because the footnotes
+% are placed at the bottom of the minipage, not the bottom of the text column.
+%
+% Any procedure that establishes a minipage-like context (e.g., floats) can do the same.
+% \begin{macrocode}
+\def\footnote{%
+ \@ifnextchar[\@xfootnote{\@yfootnote\@footnotetext}%
+}%
+\def\footnotemark{%
+ \@ifnextchar[\@xfootnotemark{\@yfootnote}%
+}%
+\def\@xfootnote[#1]{%
+ \@xfootnotemark[#1]%
+ \@footnotetext
+}%
+\def\@xfootnotemark@ltx[#1]{%
+ \begingroup
+ \csname c@\@mpfn\endcsname #1\relax
+ \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \endgroup
+ \H@@footnotemark
+}%
+\def\@yfootnote{%
+ \stepcounter\@mpfn
+ \protected@xdef\@thefnmark{\thempfn}%
+ \H@@footnotemark
+}%
+% \end{macrocode}
+%
+% Note on \classname{hyperref} compatability:
+% In its ``Automated \LaTeX\ hypertext cross-references'',
+% the \classname{hyperref} package alters footnote processing,
+% thereby imperiling these fixes and necessiating defensive measures.
+%
+% The main thing \classname{hyperref} does is to take over the \cmd\@mpfootnotetext\ and
+% \cmd\@footnotetext\ procedures, feeding its own arguments to these macros.
+% It also rewrites \cmd\@footnotemark, making it a hyperlink.
+%
+% But at the same time, it attempts to turn off these changes during
+% \cmd\maketitle\ processing, necessitating rewriting \cmd\@xfootnotemark.
+% At this point it is on the slippery slope.
+%
+% We make ourself \classname{hyperref} friendly:
+% we give \classname{hyperref} what it needs, but avoid its change to
+% \cmd\@xfootnotemark.
+%
+% Any other package that rewrites \LaTeX's footnote macros will be incompatible
+% with this package.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifxundefined\H@@footnotemark{%
+ \let\H@@footnotemark\@footnotemark
+ }{}%
+ \let\@xfootnotemark\@xfootnotemark@ltx
+}%
+% \end{macrocode}
+%
+% Two thoughts about \classname{hyperref}: what for does it define \cmd\realfootnote?
+% Also: a document class that desires high hypertext capabilities might
+% well wish to reimplement \cmd\maketitle\ so that footnotes called out from there
+% are hypertext links: the \classname{hyperref} package's
+% ``Automated \LaTeX\ hypertext cross-references''
+% does not do any of this:
+%\begin{quotation}
+% But the special footnotes
+% in |\maketitle| are much too hard to deal with
+% properly. Let them revert to plain behaviour.
+%\end{quotation}
+% Note that the document class, in reimplementing \cmd\maketitle, must ensure
+% that the \classname{hyperref} package does not clobber its own definition!
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@footnotetext}
+% \begin{macro}{\@mpfootnotetext}
+% \begin{macro}{\@tpfootnotetext}
+% \begin{macro}{\make@footnotetext}
+% \begin{macro}{\set@footnotewidth}
+% The two procedures \cmd\@footnotetext\ and \cmd\@mpfootnotetext\ share code.
+% We make that explicit here.
+%
+% Note that the procedure calling \cmd\make@footnotetext\ will open a group
+% with \cmd\bgroup\ which is then closed by \cmd\minipagefootnote@drop.
+%
+% Difference from \LaTeX: here we do not set \cmd\floatingpenalty\ to infinity.
+% Doing this must date back to a time when \LaTeX\ could not accomodate split insertions (footnotes).
+% I cannot think of any other reason to do have done this.
+% At any rate, with the \classname{ltxgrid} package, split insertions are specifically properly
+% taken care of, so we allow it.
+%
+% We provide the hook \cmd\set@footnotewidth\
+% that sets the footnote on a particular measure.
+% Some page grids are such as to set a footnote in a context where \cmd\columnwidth
+% is not the right parameter to use for the set width of a footnote.
+% In such a case, for the applicable scope, you should define
+% \cmd\set@footnotewidth\ to perform this job correctly.
+%
+% A procedure, \cmd\set@footnotewidth@ii, illustrates how to do this when in a two-column page grid.
+% In general, remember that footnotes, like all insertions (including floats),
+% are a step outside of the galley context, and all aspects of insertions need to be
+% properly handled, including the set width.
+% \begin{macrocode}
+\long\def\@footnotetext{%
+ \insert\footins\bgroup
+ \make@footnotetext
+}%
+\long\def\@mpfootnotetext{%
+ \minipagefootnote@pick
+ \make@footnotetext
+}%
+\def\make@footnotetext#1{%
+ \reset@font\footnotesize
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\footnotesep
+ \splitmaxdepth\dp\strutbox
+% \floatingpenalty\@MM
+ \set@footnotewidth
+ \@parboxrestore
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark
+ }%
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+ }%
+ \color@endgroup
+ \minipagefootnote@drop
+}%
+\def\set@footnotewidth{%
+ \hsize\columnwidth
+ \linewidth\hsize
+}%
+\def\set@footnotewidth@ii{%
+ \hsize\textwidth
+ \advance\hsize\columnsep
+ \divide\hsize\tw@
+ \advance\hsize-\columnsep
+ \linewidth\hsize
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Floats}
+%
+% \subsubsection{Usage notes}%
+% We extend the \LaTeX\ kernel for three purposes:
+% \begin{enumerate}
+%
+% \item
+% When the \cmd\footnote\ command is used within the
+% scope of a float, we do as \env{minipage} does.
+%
+% \item
+% We provide a mechanism to write floats out to an external
+% stream for temporary storage (deferred floats).
+%
+% \item
+% We provide mechanism for placing a float \texttt{here}
+% invariably, that is, floats are unfloated.
+% This mechanism is used to read the external stream mentioned above.
+%
+% \end{enumerate}
+%
+% To use these mechanisms, the document class should
+% define a float, say, \env{figure} as per usual, and in addition:
+% \begin{enumerate}
+%
+% \item
+% Optionally define an alternative, say \env{figure@write} as follows:
+% \begin{verbatim}
+%\newenvironment{figure@write}{%
+% \write@float{figure}%
+%}{%
+% \endwrite@float
+%}%
+% \end{verbatim}
+% That is, the alternative environment executes \cmd\write@float\
+% instead of \cmd\@float.
+% Note that this step is not needed if the float environment
+% is defined in the simple way of \file{classes.dtx}.
+% However, an environment like \env{longtable} will require it.
+%
+% \item
+% Install into \cmd\AtBeginDocument\ a call to \cmd\do@if@floats,
+% with the float name and an appropriate file extension as its arguments.
+% \begin{verbatim}
+%\AtBeginDocument{\do@if@floats{figure}{.fgx}}%
+% \end{verbatim}
+%
+% \item
+% Optionally define a text entity \cmd\figuresname\ that will
+% be the text of the head that is set over the
+% deferred floats.
+% If not defined, there will be no head.
+%
+% \item
+% Optionally define a user-level command to allow
+% the document to determine where the figures are printed out
+% (default is to print at end of document). E.g.,
+% \begin{verbatim}
+%\newcommand\printfigures{\print@float{figure}}%
+% \end{verbatim}
+% \item
+% Install into \cmd\appdef\cmd\class@enddocumenthook\ a call to \cmd\printfigures,
+% or, if the latter is not defined, as follows:
+% \begin{verbatim}
+%\appdef\class@enddocumenthook{\print@float{figure}}%
+% \end{verbatim}
+% Note that installing this command into \cmd\AtBeginDocument
+% is best done earlier than calls that assume the last page of
+% the document is at hand.
+%
+% \end{enumerate}
+%
+% \subsubsection{Robustifying fragile commands}%
+% Certain of \LaTeX's commands cannot be written out to a file or appear within a \cmd\mark\ command argument
+% because they do calculations during expansion.
+% We provide for a little help, but without changing the meanings of these commands.
+%
+% \begin{macro}{\addtocontents}
+%
+% \begin{macrocode}
+\def\addtocontents#1#2{%
+ \protected@write\@auxout{%
+ \let \label \@gobble \let \index \@gobble \let \glossary \@gobble
+ \def\({\string\(}%
+ \def\){\string\)}%
+ \def\\{\string\\}%
+ }{\string \@writefile {#1}{#2}}%
+}%
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \subsubsection{Preparing for the \classname{hyperref package}}%
+%
+% \begin{macro}{\addcontentsline}
+% \begin{macro}{\contentsline}
+% The \classname{hyperref} package assumes that the \cmd\contentsline\ command will be given four arguments.
+% Therefore it cannot successfully process a \filename{.toc} file that had been written by standard \LaTeX.
+% We fix things up by always writing that fourth argument and by supplying a \cmd\contentsline\ command that
+% can read them.
+%
+% We also give the \cmd\newlabel\ command's second argument five tokens.
+%
+% This means that a document class that uses this package will itself have trouble taking over a \filename{.toc} file that was written by standard \LaTeX. Sigh.
+% \begin{macrocode}
+\def\addcontentsline#1#2#3{%
+ \addtocontents{#1}{%
+ \protect\contentsline{#2}{#3}{\thepage}{}%
+ }%
+}%
+\def\contentsline#1#2#3#4{%
+ \csname l@#1\endcsname{#2}{#3}%
+}%
+\def\label#1{%
+ \@bsphack
+ \protected@write\@auxout{}{%
+ \string\newlabel{#1}{{\@currentlabel}{\thepage}{}{}{}}%
+ }%
+ \@esphack
+}%
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Footnotes within floats, unfloating floats, float font}%
+%
+% \begin{macro}{\caption}
+% DPC: Er a bit of a hack, but seems best way of supporting normal
+% \LaTeX\ syntax at this point: If a caption is used below a table,
+% then put out the footnotes before the caption.
+% \changes{v4.0beta 2}{1999/06/20}
+% {Support the hack with \cs{prepdef}, and delay until \cs{AtBeginDocument} time,
+% since \classname{hyperref} clobbers \cs{caption}.}
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \prepdef\caption{\minipagefootnote@here}%
+}%
+% \end{macrocode}
+%
+% Note on \classname{hyperref} compatability:
+% this change to the \cmd\caption\ command is compatible with the
+% ``Automated \LaTeX\ hypertext cross-references'' patches of
+% that package.
+%
+% All the same, I think Sebastian's changes to \cmd\caption\ and \cmd\@caption\
+% could bear with some improvement.
+% The following implementation requires knowing only the pattern part of the
+% \cmd\@caption\ macro:
+%\begin{verbatim}
+%\def\caption{%
+% \H@refstepcounter\@captype
+% \hyper@makecurrent{\@captype}%
+% \@dblarg{\H@caption\@captype}%
+%}%
+%\def\H@caption#1[#2]#3{%
+% \@caption{#1}[#2]{%
+% \ifHy@nesting
+% \hyper@@anchor{\@currentHref}{#3}%
+% \else
+% \hyper@@anchor{\@currentHref}{\relax}#3%
+% \fi
+% }%
+%}%
+%
+%\end{verbatim}
+%
+% \end{macro}
+%
+% \begin{macro}{\minipagefootnote@init}
+% \begin{macro}{\minipagefootnote@here}
+% \begin{macro}{\minipagefootnote@foot}
+% \begin{macro}{\minipagefootnote@pick}
+% \begin{macro}{\minipagefootnote@drop}
+% Procedure to deal with footnotes accumulated within a minipage environment.
+% These procedures encapsulate all uses of the \cmd\@mpfootins\ box.
+%
+%
+% Note: \cmd\minipagefootnote@here\ must \emph{not} be executed within the MVL!
+% \begin{macrocode}
+\def\minipagefootnote@init{%
+ \setbox\@mpfootins\box\voidb@x
+}%
+\def\minipagefootnote@pick{%
+ \global\setbox\@mpfootins\vbox\bgroup
+ \unvbox\@mpfootins
+}%
+\def\minipagefootnote@drop{%
+ \egroup
+}%
+\def\minipagefootnote@here{%
+ \par
+ \@ifvoid\@mpfootins{}{%
+ \vskip\skip\@mpfootins
+ \fullinterlineskip
+ \@ifinner{%
+ \vtop{\unvcopy\@mpfootins}%
+ {\setbox\z@\lastbox}%
+ }{}%
+ \unvbox\@mpfootins
+ }%
+}%
+\def\minipagefootnote@foot{%
+ \@ifvoid\@mpfootins{}{%
+ \insert\footins\bgroup\unvbox\@mpfootins\egroup
+ }%
+}%
+\def\endminipage{%
+ \par
+ \unskip
+ \minipagefootnote@here
+ \@minipagefalse %% added 24 May 89
+ \color@endgroup
+ \egroup
+ \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\floats@sw}
+% The Boolean \cmd\floats@sw\ signifies that floats are to be floated;
+% if false, that floats are to be deferred to the end of the document.
+% Note that the state of this Boolean is to be changed by
+% the document class in response to user-selected options.
+% Here we display model code that assigns a default value
+% at \cmd\AtBeginDocument\ time.
+% \begin{verbatim}
+%\AtBeginDocument{%
+% \@ifxundefined\floats@sw{\@booleantrue\floats@sw}{}%
+%}%
+% \end{verbatim}
+% \end{macro}
+%
+% \begin{macro}{\@xfloat}
+% \begin{macro}{\@mpmakefntext}
+% The float start-code is redefined to set up footnotes in the style of minipage.
+% Also, the \cmd\floats@sw\ Boolean informs us that floats are to be
+% all placed \texttt{here}.
+% Note that, to protect against the Boolean being undefined
+% at this late hour, we default it globally to true.
+%
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: Removed superfluous \cs{def}s, changed to using \cs{floats@sw} as the flag.
+% Also stopped using DPC's \cs{if@twocolumn} flag: using \cs{floats@sw} instead.
+% Also added \cs{par}\cs{vskip}\cs{z@skip} after the \cs{minipagefootnotes}
+% so that the float box would have zero depth like the kernel one.
+% }
+% \changes{v4.0beta 3}{1999/11/13}
+% {bug fix 110. Install hooks for endfloats processing}
+% \changes{v4.0beta 4}{2000/04/10}
+% {bug fix 127. Floats placed [h] to allow page breaks}
+% \changes{v4.0beta 4}{2000/05/19}
+% {bug fix 224. Hyperref compatability.}
+% \changes{v4.0beta 5}{2000/11/16}
+% {bug fix 221. Remove samepage command from @xfloat@prep: If the float can break over pages, we want better control.}
+%FIXME: why does hyperref override \cmd\@xfootnotenext?
+%
+% \begin{macrocode}
+\let\@xfloat@LaTeX\@xfloat
+\def\@xfloat#1[#2]{%
+ \@xfloat@prep
+ \@nameuse{fp@proc@#2}%
+ \@ifxundefined\floats@sw{\global\@booleantrue\floats@sw}{}%
+ \floats@sw{\@xfloat@LaTeX{#1}[#2]}{\@xfloat@anchored{#1}[]}%
+}%
+\def\@xfloat@prep{%
+ \let\footnote\footnote@latex
+ \def\@mpfn{mpfootnote}%
+ \def\thempfn{\thempfootnote}%
+% \def\thefootnote{\thempfootnote}%
+ \c@mpfootnote\z@
+ \let\@footnotetext\@mpfootnotetext
+ \let\H@@footnotetext\@mpfootnotetext
+ \let\@makefntext\@mpmakefntext
+% \samepage
+}%
+\appdef\class@documenthook{%
+ \let\footnote@latex\footnote
+}%
+%\def\fp@proc@h{\@booleanfalse\floats@sw}%
+%\def\fp@proc@H{\@booleanfalse\floats@sw}%
+\def\@xfloat@anchored#1[#2]{%
+ \def\@captype{#1}%
+ \begin@float@pagebreak
+%\vbox\bgroup
+ \let\end@float\end@float@anchored
+ \let\end@dblfloat\end@float@anchored
+% do as \@xfloat does:
+ \hsize\columnwidth
+ \@parboxrestore
+ \@floatboxreset
+ \minipagefootnote@init
+% \pagegrid@col\@ne % Klootch to avoid processing as a float
+}%
+\def\end@float@anchored{%
+ \minipagefootnote@here
+ \par\vskip\z@skip %% \par\vskip\z@ added 15 Dec 87
+%\egroup
+ \par
+ \end@float@pagebreak
+}%
+\def\begin@float@pagebreak{\par\addvspace\intextsep}%
+\def\end@float@pagebreak{\par\addvspace\intextsep}%
+\def\@mpmakefntext#1{%
+ \parindent=1em
+ \noindent
+ \hb@xt@1em{\hss\@makefnmark}%
+ #1%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Writing floats out to a file}%
+%
+% \begin{macro}{\do@if@floats}
+% The procedure \cmd\do@if@floats\ should be executed at
+% \cmd\AtBeginDocument\ time, and arranges to write out
+% the floats of the given class to a temporary file, to be
+% read back later (deferred floats),
+% given that \cmd\floats@sw\ is false.
+% Note that, to protect against the Boolean being undefined
+% at this late hour, we default it globally to true.
+% \begin{macrocode}
+\def\do@if@floats#1#2{%
+ \@ifxundefined\floats@sw{\global\@booleantrue\floats@sw}{}%
+ \floats@sw{}{%
+% \end{macrocode}
+% Open the stream to save out the document's floats of this class.
+% \begin{macrocode}
+ \expandafter\newwrite
+ \csname#1write\endcsname
+ \expandafter\def
+ \csname#1@stream\endcsname{\jobname#2}%
+ \expandafter\immediate
+ \expandafter\openout
+ \csname#1write\endcsname
+ \csname#1@stream\endcsname\relax
+% \end{macrocode}
+% Swap environments.
+% If the class writer has defined, e.g., \env{figure@write},
+% then we use this as the procedure to execute for writing
+% the float out to the external stream.
+% Otherwise, the replacement of \cmd\@float\ by \cmd\write@float\
+% should do the right thing for float environments defined
+% in the simple way of \classname{classes.dtx}.
+% \begin{macrocode}
+ \@ifxundefined\@float@LaTeX{%
+ \let\@float@LaTeX\@float
+ \let\@dblfloat@LaTeX\@dblfloat
+ \let\@float\write@float
+ \let\@dblfloat\write@floats
+ }{}%
+ \let@environment{#1@float}{#1}%
+ \let@environment{#1@floats}{#1*}%
+ \@ifxundefined@cs{#1@write}{}{%
+ \let@environment{#1}{#1@write}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\print@float}
+% The procedure \cmd\print@float\ prints out the
+% deferred floats.
+% \changes{v4.0beta 2}{1999/06/20}
+% {only execute if there really were floats of the given type}
+% \changes{v4.0beta 3}{1999/11/13}
+% {*-form mandates pagebreak at each float;
+% only print section head if there is something there.}
+% \changes{v4.0beta 4}{2000/05/23}
+% {Allow things to break over pages by setting array@default.}
+%
+% \begin{macrocode}
+\def\triggerpar{\leavevmode\@@par}%
+\def\oneapage{\def\begin@float@pagebreak{\newpage}\def\end@float@pagebreak{\newpage}}%
+\def\print@float#1#2{%
+ \@ifxundefined@cs{#1write}{}{%
+ \begingroup
+ \@booleanfalse\floats@sw
+ #2%
+ \raggedbottom
+ \def\array@default{v}% floats must
+ \let\@float\@float@LaTeX
+ \let\@dblfloat\@dblfloat@LaTeX
+ \let\trigger@float@par\triggerpar
+ \let@environment{#1}{#1@float}%
+ \let@environment{#1*}{#1@floats}%
+ \expandafter\prepdef\csname#1\endcsname{\trigger@float@par}%
+ \expandafter\prepdef\csname#1*\endcsname{\trigger@float@par}%
+ \@namedef{fps@#1}{h!}%
+ \expandafter\immediate
+ \expandafter\closeout
+ \csname#1write\endcsname
+ \everypar{%
+ \global\let\trigger@float@par\relax
+ \global\everypar{}\setbox\z@\lastbox
+ \@ifxundefined@cs{#1sname}{}{%
+ \begin@float@pagebreak
+ \expandafter\section
+ \expandafter*%
+ \expandafter{%
+ \csname#1sname\endcsname
+ }%
+ }%
+ }%
+ \input{\csname#1@stream\endcsname}%
+ \endgroup
+ \global\expandafter\let\csname#1write\endcsname\relax
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\write@float}
+% \begin{macro}{\write@floats}
+% \begin{macro}{\write@@float}
+% Handles the case where the name of the float is the same as
+% that of the stream. Note that
+% \env{longtable} does \emph{not} fit this case.
+% Note also: \cmd\write@float\ is \emph{not} a user-level environment
+% therefore it is properly not defined with \cmd\newenvironment.
+% \begin{macrocode}
+\def\write@float#1{\write@@float{#1}{#1}}%
+\def\endwrite@float{\@Esphack}%
+\def\write@floats#1{\write@@float{#1*}{#1}}%
+\def\endwrite@floats{\@Esphack}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\write@@float}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: Fixed spurious \texttt{CR} and (return) characters in output file.
+% Also, if the document did not have the \cs{end}\texttt{figure} on a line of its own,
+% the macro wouldn't work. Fixed.}
+% \begin{macrocode}
+\def\write@@float#1#2{%
+ \ifhmode
+ \@bsphack
+ \fi
+ \chardef\@tempc\csname#2write\endcsname
+ \toks@{\begin{#1}}%
+ \def\@tempb{#1}%
+ \expandafter\let\csname end#1\endcsname\endwrite@float
+ \catcode`\^^M\active
+ \@makeother\{\@makeother\}\@makeother\%
+ \write@floatline
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\write@floatline}
+% \begin{macro}{\@write@floatline}
+% \begin{macro}{\float@end@tag}
+% The procedure \cmd\write@floatline\ only parses, and passes
+% its result to \cmd\@write@floatline, which
+% writes the line to output, then tests the line
+% for the \cmd\end\arg{float} tokens with
+% aid of the \cmd\float@end@tag\ procedure.
+% \begin{macrocode}
+\begingroup
+ \catcode`\[\the\catcode`\{\catcode`\]\the\catcode`\}\@makeother\{\@makeother\}%
+ \gdef\float@end@tag#1\end{#2}#3\@nul[%
+ \def\@tempa[#2]%
+ \@ifx[\@tempa\@tempb][\end[#2]][\write@floatline]%
+ ]%
+ \obeylines%
+ \gdef\write@floatline#1^^M[%
+ \begingroup%
+ \newlinechar`\^^M%
+ \toks@\expandafter[\the\toks@#1]\immediate\write\@tempc[\the\toks@]%
+ \endgroup%
+ \toks@[]%
+ \float@end@tag#1\end{}\@nul%
+ ]%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{Counters}
+% The following definitions override those of the \LaTeX\ kernel,
+% providing for a greater range of inputs.
+% \begin{macrocode}
+\def\@alph#1{\ifcase#1\or a\or b\or c\or d\else\@ialph{#1}\fi}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@ialph#1{\ifcase#1\or \or \or \or \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\or aa\or bb\or cc\or dd\or ee\or ff\or gg\or hh\or ii\or jj\or
+ kk\or ll\or mm\or nn\or oo\or pp\or qq\or rr\or ss\or tt\or uu\or
+ vv\or ww\or xx\or yy\or zz\else\@ctrerr\fi}
+% \end{macrocode}
+%
+%
+% \subsection{Customization of Sections}%
+%
+% Patch the standard \LaTeX\ sectioning procedure to:
+%\begin{itemize}
+%\item
+% Allow a sectioning command to trigger the title page, or more generally
+% to recognize that it is the first object in the document,
+% so we headpatch \cmd\@startsection.
+%
+%\item
+% Allow a tail command in |#6| to uppercase the title, so we retain
+% DPC's braces.
+%
+%\item
+% Allow each type of sectioning command to format its number differently,
+% so we generalize \cmd\@seccntformat.
+%
+%\item
+% Allow each type of sectioning command to format its argument differently,
+% so we generalize \cmd\@hangfrom.
+%
+%\item
+% Allow the starred form of the command to
+% mark (the running head) and
+% make an entry in the TOC,
+% so we put \cmd\@ssect\ on the same footing as \cmd\@sect.
+%
+% Note that the tokens passed to the TOC now are \emph{not}
+% the optional argument of the command, but the required.
+% This means that the user can no longer use the former
+% to put variant content in to the TOC as the Manual says.
+%
+% Instead, the optional argument is used to put an alternative
+% title into the running headers, a better choice.
+%
+%\end{itemize}
+%
+% \begin{macro}{\@startsection}
+% Patch a head hook into the basic sectioning command.
+% Treat \cmd\@sect\ and \cmd\@ssect\ on an equal footing:
+% now their pattern parts are identical.
+% \begin{macrocode}
+\def\@startsection#1#2#3#4#5#6{%
+ \@startsection@hook
+ \if@noskipsec \leavevmode \fi
+ \par
+ \@tempskipa #4\relax
+ \@afterindenttrue
+ \ifdim \@tempskipa <\z@
+ \@tempskipa -\@tempskipa \@afterindentfalse
+ \fi
+ \if@nobreak
+ \everypar{}%
+ \else
+ \addpenalty\@secpenalty\addvspace\@tempskipa
+ \fi
+ \@ifstar
+ {\@dblarg{\@ssect@ltx{#1}{#2}{#3}{#4}{#5}{#6}}}%
+ {\@dblarg{\@sect@ltx {#1}{#2}{#3}{#4}{#5}{#6}}}%
+}%
+\def\@startsection@hook{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@sect}
+% When defining \cmd\@svsec, do not expand \cmd\@seccntformat.
+% Put brace characters back where they were before David Carlisle got at them
+% (i.e., as if \cmd\@hangfrom\ had two arguments).
+% Protect the mark mechanism from an undefined meaning.
+% Pass |#8| to the TOC instead of |#7|.
+% Remove \cmd\relax\ from the replacement part of \cmd\@svsec.
+%
+% The procedure \cmd\@hangfrom\ and \cmd\@runin@to\ can
+% be used to process the argument of the head.
+% The head can define, e.g., \cmd\@hangfrom@section, to
+% do its own processing.
+%
+% In using \cmd\H@refstepcounter\ in place of \cmd\refstepcounter\ we rely on
+% either loading before any package that patches the latter, or
+% the convention that the former is the original \LaTeX\ procedure.
+%
+% \begin{macrocode}
+\class@info
+ {Repairing broken LateX \string\@sect}%
+\def\@sect@ltx#1#2#3#4#5#6[#7]#8{%
+ \@ifnum{#2>\c@secnumdepth}{%
+ \def\H@svsec{\phantomsection}%
+ \let\@svsec\@empty
+ }{%
+ \H@refstepcounter{#1}%
+ \def\H@svsec{%
+ \phantomsection
+ }%
+ \protected@edef\@svsec{{#1}}%
+ \@ifundefined{@#1cntformat}{%
+ \prepdef\@svsec\@seccntformat
+ }{%
+ \expandafter\prepdef
+ \expandafter\@svsec
+ \csname @#1cntformat\endcsname
+ }%
+ }%
+ \@tempskipa #5\relax
+ \@ifdim{\@tempskipa>\z@}{%
+ \begingroup
+ \interlinepenalty \@M
+ #6{%
+ \@ifundefined{@hangfrom@#1}{\@hang@from}{\csname @hangfrom@#1\endcsname}%
+ {\hskip#3\relax\H@svsec}{\@svsec}{#8}%
+ }%
+ \@@par
+ \endgroup
+ \@ifundefined{#1mark}{\@gobble}{\csname #1mark\endcsname}{#7}%
+ \addcontentsline{toc}{#1}{%
+ \@ifnum{#2>\c@secnumdepth}{%
+ \protect\numberline{}%
+ }{%
+ \protect\numberline{\csname the#1\endcsname}%
+ }%
+ #8}%
+ }{%
+ \def\@svsechd{%
+ #6{%
+ \@ifundefined{@runin@to@#1}{\@runin@to}{\csname @runin@to@#1\endcsname}%
+ {\hskip#3\relax\H@svsec}{\@svsec}{#8}%
+ }%
+ \@ifundefined{#1mark}{\@gobble}{\csname #1mark\endcsname}{#7}%
+ \addcontentsline{toc}{#1}{%
+ \@ifnum{#2>\c@secnumdepth}{%
+ \protect\numberline{}%
+ }{%
+ \protect\numberline{\csname the#1\endcsname}%
+ }%
+ #8}%
+ }%
+ }%
+ \@xsect{#5}%
+}%
+\def\@hang@from#1#2#3{\@hangfrom{#1#2}#3}%
+\def\@runin@to #1#2#3{#1#2#3}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@ssect}
+% Put brace characters back where they were before David Carlisle got at them
+% (as if \cmd\@hangfrom\ has two arguments).
+% Possibly set a mark.
+% Make a TOC entry.
+%
+% Note that, for compatability with the \classname{hyperref} package, we
+% need to provide the interface required by that package
+% (actually required by \file{pdfmark.def} and \file{nameref.sty}),
+% namely
+% the definition of \cmd\@currentlabelname\ (but now removed),
+% the insertion of the procedure \cmd\Sectionformat\ (but why is this needed?), and
+% the call to \cmd\phantomsection\ (which must precede the call to \cmd\addcontentsline).
+% We also have to sidestep the patch to \cmd\@ssect\ in that same file, therefore
+% we use a different control sequence name in the call from \cmd\@startsection.
+% \changes{v4.0beta 3}{1999/11/13}
+% {Bug 116: Hyperref compatability}
+% \changes{v4.0rc3b}{2001/07/13}
+% {Bug 404: Hyperref compatability}
+% \begin{macrocode}
+\def\@ssect@ltx#1#2#3#4#5#6[#7]#8{%
+% \def\@currentlabelname{#8}%
+ \def\H@svsec{\phantomsection}%
+ \@tempskipa #5\relax
+ \@ifdim{\@tempskipa>\z@}{%
+ \begingroup
+ \interlinepenalty \@M
+ #6{%
+ \@ifundefined{@hangfroms@#1}{\@hang@froms}{\csname @hangfroms@#1\endcsname}%
+% {\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}%
+ {\hskip#3\relax\H@svsec}{#8}%
+ }%
+ \@@par
+ \endgroup
+ \@ifundefined{#1smark}{\@gobble}{\csname #1smark\endcsname}{#7}%
+ \addcontentsline{toc}{#1}{\protect\numberline{}#8}%
+ }{%
+ \def\@svsechd{%
+ #6{%
+ \@ifundefined{@runin@tos@#1}{\@runin@tos}{\csname @runin@tos@#1\endcsname}%
+% {\hskip#3\relax\H@svsec}{\Sectionformat{#8}{#1}}%
+ {\hskip#3\relax\H@svsec}{#8}%
+ }%
+ \@ifundefined{#1smark}{\@gobble}{\csname #1smark\endcsname}{#7}%
+ \addcontentsline{toc}{#1}{\protect\numberline{}#8}%
+ }%
+ }%
+ \@xsect{#5}%
+}%
+\def\@hang@froms#1#2{#1#2}%
+\def\@runin@tos #1#2{#1#2}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\init@documenthook}
+% Document classes that incorporate this package will be \classname{hyperref}-savvy.
+% (To accomplish this, we ensure that \cmd\hyperanchor\ and \cmd\hyper@last\ are both defined.)
+% Being \classname{hyperref}-savvy levels some requirements on us, but the benefits are many.
+%
+% One is that the TOC will not get amnesia and require a full set of three typesetting runs before its formatting is stable.
+% Instead, only two runs are required: the first updates the auxiliary file, the second the TOC.
+% However, the formatting of the document does not change.
+%
+% Another aspect of being \classname{hyperref}-savvy is that the syntax of commands in the \filename{.aux} file will now change
+% if \classname{hyperref} is turned on or off.
+%
+% Note that \cmd\hyper@anchorstart\ and \cmd\hyper@anchorend\ constitute the programming interface
+% for a hypertext anchor (the target of a hypertext link); \cmd\hyper@linkstart\ and \cmd\hyper@linkend\
+% are the interface for a hypertext link.
+% \begin{macrocode}
+\appdef\init@documenthook{%
+ \providecommand\phantomsection{}%
+%\@ifx{\Sectionformat\@undefined}{\let\Sectionformat\@firstoftwo}{}%
+ \providecommand\hyper@anchor[1]{}%
+ \providecommand\hyper@last{}%
+ \providecommand\Hy@raisedlink[1]{#1}%
+ \providecommand\hyper@anchorstart[1]{}%
+ \providecommand\hyper@anchorend{}%
+ \providecommand\hyper@linkstart[2]{}%
+ \providecommand\hyper@linkend{}%
+}%
+\let\H@refstepcounter\refstepcounter
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sec@upcase}
+% Upper case for sections (optional upper case items). These are
+% created so that some headings can be toggled between mixed case and
+% upper case readily.
+% Headings that might be changed can be wrapped in the style file in
+% \cmd\sec@upcase\arg{text} constructs;
+% the expansion of \cmd\sec@upcase\ is
+% controlled here. It is \cmd\relax\ by default (mixed case heads), and
+% can easily be changed to \cmd\uppercase\ if desired.
+% If mixed-case headings are wanted by the editor, authors {\em must}
+% supply mixed case text, although this is what authors should be doing
+% anyway.
+% (Mixed can be converted to upper,
+% but the reverse transformation cannot be automated.)
+%
+% The following setting gives the \LaTeX\ default.
+% \begin{macrocode}
+\def\sec@upcase#1{\relax{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Patch the \env{tabular} and \env{array} Environments}
+%
+% \begin{macro}{\endtabular}
+% \begin{macro}{\endarray}
+% We headpatch the begin processing and tailpatch the end processing
+% of the \env{tabular} and \env{array} environments.
+% A document class can define these hooks as needed.
+%
+% We proceed with care to make further patches to
+% support tabulars that break over pages.
+% Our patches will not necessarily be effective for
+% other packages that replace the \LaTeX\ \env{array} and \env{tabular}
+% environments. I know of none that do so.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifpackageloaded{array}{\switch@array}{\switch@tabular}%
+ \prepdef\endtabular{\endtabular@hook}%
+ \@provide\endtabular@hook{}%
+ \prepdef\endarray{\endarray@hook}%
+ \@provide\endarray@hook{}%
+ \providecommand\array@hook{}%
+% \end{macrocode}
+% Install, effectively, a head patch to \cmd\tabular.
+% In order to avoid interference from, e.g., the \classname{array} package,
+% we must perform this patch only \emph{after} packages load.
+% \changes{v4.0beta 3}{1999/11/13}
+% {Bug 130. Interference from array package}
+% \begin{macrocode}
+ \prepdef\@tabular{\tabular@hook}%
+ \@provide\tabular@hook{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\switch@tabular}
+% \begin{macro}{\switch@array}
+% The two procedures \cmd\switch@tabular\ and \cmd\switch@array\
+% apply needed patches to the various tabular procedures,
+% the former applying to the \LaTeX\ kernel, the latter to the
+% required \classname{array} package (and to the number of other
+% required packages that load it).
+%
+% \begin{macrocode}
+\def\switch@tabular{%
+ \let\@array@sw\@array@sw@array
+ \@ifx{\@array\@array@LaTeX}{%
+ \@ifx{\multicolumn\multicolumn@LaTeX}{%
+ \@ifx{\@tabular\@tabular@LaTeX}{%
+ \@ifx{\@tabarray\@tabarray@LaTeX}{%
+ \@ifx{\array\array@LaTeX}{%
+ \@ifx{\endarray\endarray@LaTeX}{%
+ \@ifx{\endtabular\endtabular@LaTeX}{%
+ \@ifx{\@mkpream\@mkpream@LaTeX}{%
+ \@ifx{\@addamp\@addamp@LaTeX}{%
+ \@ifx{\@arrayacol\@arrayacol@LaTeX}{%
+ \@ifx{\@tabacol\@tabacol@LaTeX}{%
+ \@ifx{\@arrayclassz\@arrayclassz@LaTeX}{%
+ \@ifx{\@tabclassiv\@tabclassiv@LaTeX}{%
+ \@ifx{\@arrayclassiv\@arrayclassiv@LaTeX}{%
+ \@ifx{\@tabclassz\@tabclassz@LaTeX}{%
+ \@ifx{\@classv\@classv@LaTeX}{%
+ \@ifx{\hline\hline@LaTeX}{%
+ \@ifx{\@tabularcr\@tabularcr@LaTeX}{%
+ \@ifx{\@xtabularcr\@xtabularcr@LaTeX}{%
+ \@ifx{\@xargarraycr\@xargarraycr@LaTeX}{%
+ \@ifx{\@yargarraycr\@yargarraycr@LaTeX}{%
+ \true@sw
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ {%
+ \class@info{Patching LaTeX tabular.}%
+ }{%
+ \class@info{Unrecognized LaTeX tabular. Please update this document class! (Proceeding with fingers crossed.)}%
+ }%
+ \let\@array\@array@ltx
+ \let\multicolumn\multicolumn@ltx
+ \let\@tabular\@tabular@ltx
+ \let\@tabarray\@tabarray@ltx
+ \let\array\array@ltx
+ \let\endarray\endarray@ltx
+ \let\endtabular\endtabular@ltx
+ \let\@mkpream\@mkpream@ltx
+ \let\@addamp\@addamp@ltx
+ \let\@arrayacol\@arrayacol@ltx
+ \let\@tabacol\@tabacol@ltx
+ \let\@arrayclassz\@arrayclassz@ltx
+ \let\@tabclassiv\@tabclassiv@ltx
+ \let\@arrayclassiv\@arrayclassiv@ltx
+ \let\@tabclassz\@tabclassz@ltx
+ \let\@classv\@classv@ltx
+ \let\hline\hline@ltx
+ \let\@tabularcr\@tabularcr@ltx
+ \let\@xtabularcr\@xtabularcr@ltx
+ \let\@xargarraycr\@xargarraycr@ltx
+ \let\@yargarraycr\@yargarraycr@ltx
+}%
+\def\switch@array{%
+ \let\@array@sw\@array@sw@LaTeX
+ \@ifx{\@array\@array@array}{%
+ \@ifx{\@tabular\@tabular@array}{%
+ \@ifx{\@tabarray\@tabarray@array}{%
+ \@ifx{\array\array@array}{%
+ \@ifx{\endarray\endarray@array}{%
+ \@ifx{\endtabular\endtabular@array}{%
+ \@ifx{\@mkpream\@mkpream@array}{%
+ \@ifx{\@classx\@classx@array}{%
+ \@ifx{\insert@column\insert@column@array}{%
+ \@ifx{\@arraycr\@arraycr@array}{%
+ \@ifx{\@xarraycr\@xarraycr@array}{%
+ \@ifx{\@xargarraycr\@xargarraycr@array}{%
+ \@ifx{\@yargarraycr\@yargarraycr@array}{%
+ \true@sw
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }%
+ }{%
+ \false@sw
+ }{%
+ \class@info{Patching array package.}%
+ }{%
+ \class@info{Unrecognized array package. Please update this document class! (Proceeding with fingers crossed.)}%
+ }%
+ \let\@array \@array@array@new
+ \let\@@array \@array % Cosi fan tutti
+ \let\@tabular \@tabular@array@new
+ \let\@tabarray \@tabarray@array@new
+ \let\array \array@array@new
+ \let\endarray \endarray@array@new
+ \let\endtabular\endtabular@array@new
+ \let\@mkpream \@mkpream@array@new
+ \let\@classx \@classx@array@new
+ \let\@arrayacol\@arrayacol@ltx
+ \let\@tabacol \@tabacol@ltx
+ \let\insert@column\insert@column@array@new
+ \expandafter\let\csname endtabular*\endcsname\endtabular % Cosi fan tutti
+ \let\@arraycr \@arraycr@new
+ \let\@xarraycr \@xarraycr@new
+ \let\@xargarraycr\@xargarraycr@new
+ \let\@yargarraycr\@yargarraycr@new
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@array@sw}
+% The Boolean \cmd\@array@sw\ must be different depending on
+% whether the \classname{array} package is loaded.
+% \begin{macrocode}
+\def\@array@sw@LaTeX{\@ifx{\\\@tabularcr}}%
+\def\@array@sw@array{\@ifx{\d@llarbegin\begingroup}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabular}
+% We provide the old versions of \cmd\@tabular\ along with the respective new versions.
+% The change here is to avoid committing to LR mode. That will be done later (as late as possible, naturally).
+% \begin{macrocode}
+\def\@tabular@LaTeX{%
+ \leavevmode
+ \hbox\bgroup$%
+ \let\@acol\@tabacol
+ \let\@classz\@tabclassz
+ \let\@classiv\@tabclassiv
+ \let\\\@tabularcr
+ \@tabarray
+}%
+\def\@tabular@ltx{%
+ \let\@acoll\@tabacoll
+ \let\@acolr\@tabacolr
+ \let\@acol\@tabacol
+ \let\@classz\@tabclassz
+ \let\@classiv\@tabclassiv
+ \let\\\@tabularcr
+ \@tabarray
+}%
+\def\@tabular@array{%
+ \leavevmode
+ \hbox\bgroup$%
+ \col@sep\tabcolsep
+ \let\d@llarbegin\begingroup
+ \let\d@llarend\endgroup
+ \@tabarray
+}%
+\def\@tabular@array@new{%
+ \let\@acoll\@tabacoll
+ \let\@acolr\@tabacolr
+ \let\@acol\@tabacol
+ \let\col@sep\@undefined
+ \let\d@llarbegin\begingroup
+ \let\d@llarend\endgroup
+ \@tabarray
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabarray}
+% Here we provide old and new versions of the \cmd\@tabarray\ procedure.
+% The change here is to parametrize the default vertical alignment,
+% which is 'c' in standard \LaTeX.
+% Under some circumstances, we want to change this to, say, 'v'.
+%
+% FIXME: must decouple \env{array} and \env{tabular}.
+% \begin{macrocode}
+\def\@tabarray@LaTeX{%
+ \m@th\@ifnextchar[\@array{\@array[c]}%
+}%
+\def\@tabarray@ltx{%
+ \m@th\@ifnextchar[\@array{\expandafter\@array\expandafter[\array@default]}%
+}%
+\def\@tabarray@array{%
+ \@ifnextchar[{\@@array}{\@@array[c]}%
+}%
+\def\@tabarray@array@new{%
+ \@ifnextchar[{\@@array}{\expandafter\@@array\expandafter[\array@default]}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabularcr}
+% \begin{macro}{\@tbpen}
+% \begin{macro}{\@tabularcr}
+% \begin{macro}{\@xtabularcr}
+% \begin{macro}{\@xargarraycr}
+% \begin{macro}{\@yargarraycr}
+% \begin{macro}{\@arraycr}
+% \begin{macro}{\@xarraycr}
+% We provide for the \cmd\\ command within \env{tabular} to provide control over page breaking, just the same as
+% that of \env{eqnarray}.
+%
+% The count register \cmd\intertabularlinepenalty\ is similar to \cmd\interdisplaylinepenalty: it is the penalty
+% associated with each row of a tabular. When it is set to \cmd\@M, the tabular will cleave together.
+%
+% The count register \cmd\@tbpen\ is similar to \cmd\@eqpen: it memorizes the penalty to use after the current tabular row.
+% If the \cmd\\ command is in its star form, then \cmd\@eqpen\ is set to \cmd\@M.
+%
+% We append code to \cmd\samepage\ so that a tabular within its scope will cleave together.
+%
+% We keep the standard definition of \cmd\@tabularcr\ in \cmd\@tabularcr@LaTeX\ for reference,
+% and provide a new definition that works like \cmd\@eqncr: it sets \cmd\@tbpen\ to \cmd\@M\ if the star was given.
+%
+% We also provide new versions of \cmd\@xtabularcr, \cmd\@xargarraycr, and \cmd\@yargarraycr, all of which invoke \cmd\@tbpen.
+%
+% The \cmd\switch@tabular\ procedure switches in the new definitions.
+% \begin{macrocode}
+\newcount\intertabularlinepenalty
+\intertabularlinepenalty=100
+\newcount\@tbpen
+\appdef\samepage{\intertabularlinepenalty\@M}%
+\def\@tabularcr@LaTeX{{\ifnum 0=`}\fi \@ifstar \@xtabularcr \@xtabularcr}%
+\def\@tabularcr@ltx{{\ifnum 0=`}\fi \@ifstar {\global \@tbpen \@M \@xtabularcr }{\global \@tbpen \intertabularlinepenalty \@xtabularcr }}%
+\def\@xtabularcr@LaTeX{\@ifnextchar [\@argtabularcr {\ifnum 0=`{\fi }\cr }}%
+\def\@xtabularcr@ltx{\@ifnextchar [\@argtabularcr {\ifnum 0=`{\fi }\cr \noalign {\penalty \@tbpen }}}%
+\def\@xargarraycr@LaTeX#1{\@tempdima #1\advance \@tempdima \dp \@arstrutbox \vrule \@height \z@ \@depth \@tempdima \@width \z@ \cr}%
+\def\@xargarraycr@ltx#1{\@tempdima #1\advance \@tempdima \dp \@arstrutbox \vrule \@height \z@ \@depth \@tempdima \@width \z@ \cr \noalign {\penalty \@tbpen }}%
+\def\@yargarraycr@LaTeX#1{\cr \noalign {\vskip #1}}%
+\def\@yargarraycr@ltx#1{\cr \noalign {\penalty \@tbpen \vskip #1}}%
+% \end{macrocode}
+%
+% If the \classname{array} package has been loaded, we must alter the meanings of
+% \cmd\@arraycr, \cmd\@xarraycr, \cmd\@xargarraycr, and \cmd\@yargarraycr.
+% In this case, it is \cmd\switch@array\ that switches in the new definitions.
+% \begin{macrocode}
+\def\@arraycr@array{%
+ \relax
+ \iffalse{\fi\ifnum 0=`}\fi
+ \@ifstar \@xarraycr \@xarraycr
+}%
+\def\@arraycr@new{%
+ \relax
+ \iffalse{\fi\ifnum 0=`}\fi
+ \@ifstar {\global \@tbpen \@M \@xarraycr }{\global \@tbpen \intertabularlinepenalty \@xarraycr }%
+}%
+\def\@xarraycr@array{%
+ \@ifnextchar [%]
+ \@argarraycr {\ifnum 0=`{}\fi\cr}%
+}%
+\def\@xarraycr@new{%
+ \@ifnextchar [%]
+ \@argarraycr {\ifnum 0=`{}\fi\cr \noalign {\penalty \@tbpen }}%
+}%
+\def\@xargarraycr@array#1{%
+ \unskip
+ \@tempdima #1\advance\@tempdima \dp\@arstrutbox
+ \vrule \@depth\@tempdima \@width\z@
+ \cr
+}%
+\def\@xargarraycr@new#1{%
+ \unskip
+ \@tempdima #1\advance\@tempdima \dp\@arstrutbox
+ \vrule \@depth\@tempdima \@width\z@
+ \cr
+ \noalign {\penalty \@tbpen }%
+}%
+\def\@yargarraycr@array#1{%
+ \cr
+ \noalign{\vskip #1}%
+}%
+\def\@yargarraycr@new#1{%
+ \cr
+ \noalign{\penalty \@tbpen \vskip #1}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\array}
+% We provide old and new versions of the \cmd\array\ procedure for both \LaTeX\ and the \classname{array} package.
+% The change here is to accomodate the new procedures that will be called for the array boundaries, even
+% though at present they are not special.
+% A thought: here is where matrices can be readily accomodated.
+% \begin{macrocode}
+\def\array@LaTeX{%
+ \let\@acol\@arrayacol
+ \let\@classz\@arrayclassz
+ \let\@classiv\@arrayclassiv
+ \let\\\@arraycr
+ \let\@halignto\@empty
+ \@tabarray
+}%
+\def\array@ltx{%
+ \@ifmmode{}{\@badmath$}%
+ \let\@acoll\@arrayacol
+ \let\@acolr\@arrayacol
+ \let\@acol\@arrayacol
+ \let\@classz\@arrayclassz
+ \let\@classiv\@arrayclassiv
+ \let\\\@arraycr
+ \let\@halignto\@empty
+ \@tabarray
+}%
+\def\array@array{%
+ \col@sep\arraycolsep
+ \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%
+ \@tabarray
+}
+\def\array@array@new{%
+ \@ifmmode{}{\@badmath$}%
+ \let\@acoll\@arrayacol
+ \let\@acolr\@arrayacol
+ \let\@acol\@arrayacol
+\let\col@sep\@undefined
+ \def\d@llarbegin{$}%
+ \let\d@llarend\d@llarbegin
+ \gdef\@halignto{}%
+ \@tabarray
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@array}
+% Here we provide old and new versions of \cmd\@array.
+% The change here is to provide a convenient, flexible, and extensible
+% mechanism for new vertical alignment options.
+%
+% Instead of testing the optional argument with \cmd\if, we
+% use a dispatcher based on \cmd\csname.
+%
+% We also refrain from using \cmd\ialign, which would set
+% the \cmd\tabskip\ to the wrong value.
+%
+% Finally, the procedure to set the \cmd\@arstrutbox\
+% is broken out so that it can be patched.
+% \begin{macrocode}
+\def\@array@LaTeX[#1]#2{%
+ \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
+ \bgroup
+ \setbox\@arstrutbox\hbox{%
+ \vrule \@height\arraystretch\ht\strutbox
+ \@depth\arraystretch \dp\strutbox
+ \@width\z@}%
+ \@mkpream{#2}%
+ \edef\@preamble{%
+ \ialign \noexpand\@halignto
+ \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}%
+ \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
+ \let\tabularnewline\\%
+ \let\par\@empty
+ \let\@sharp##%
+ \set@typeset@protect
+ \lineskip\z@skip\baselineskip\z@skip
+ \ifhmode \@preamerr\z@ \@@par\fi
+ \@preamble
+}%
+\def\@array@ltx[#1]#2{%
+ \@nameuse{@array@align@#1}%
+ \set@arstrutbox
+ \@mkpream{#2}%
+ \prepdef\@preamble{%
+ \tabskip\tabmid@skip
+ \@arstrut
+ }%
+ \appdef\@preamble{%
+ \tabskip\tabright@skip
+ \cr
+ \array@row@pre
+ }%
+% \let\@startpbox\@@startpbox
+% \let\@endpbox\@@endpbox
+ \let\tabularnewline\\%
+ \let\par\@empty
+ \let\@sharp##%
+ \set@typeset@protect
+ \lineskip\z@skip\baselineskip\z@skip
+ \tabskip\tableft@skip\relax
+ \ifhmode \@preamerr\z@ \@@par\fi
+ \everycr{}%
+ \expandafter\halign\expandafter\@halignto\expandafter\bgroup\@preamble
+}%
+%
+\def\set@arstrutbox{%
+ \setbox\@arstrutbox\hbox{%
+ \vrule \@height\arraystretch\ht\strutbox
+ \@depth\arraystretch \dp\strutbox
+ \@width\z@
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@array@array}
+%
+% \begin{macrocode}
+\def\@array@array[#1]#2{%
+ \@tempdima \ht \strutbox
+ \advance \@tempdima by\extrarowheight
+ \setbox \@arstrutbox \hbox{\vrule
+ \@height \arraystretch \@tempdima
+ \@depth \arraystretch \dp \strutbox
+ \@width \z@}%
+ \begingroup
+ \@mkpream{#2}%
+ \xdef\@preamble{\noexpand \ialign \@halignto
+ \bgroup \@arstrut \@preamble
+ \tabskip \z@ \cr}%
+ \endgroup
+ \@arrayleft
+ \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
+ \bgroup
+ \let \@sharp ##\let \protect \relax
+ \lineskip \z@
+ \baselineskip \z@
+ \m@th
+ \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble
+}%
+\def\@array@array@new[#1]#2{%
+ \@tempdima\ht\strutbox
+ \advance\@tempdima by\extrarowheight
+ \setbox\@arstrutbox\hbox{%
+ \vrule \@height\arraystretch\@tempdima
+ \@depth \arraystretch\dp\strutbox
+ \@width \z@
+ }%
+ \begingroup
+ \@mkpream{#2}%
+ \xdef\@preamble{\@preamble}%
+ \endgroup
+ \prepdef\@preamble{%
+ \tabskip\tabmid@skip
+ \@arstrut
+ }%
+ \appdef\@preamble{%
+ \tabskip\tabright@skip
+ \cr
+ \array@row@pre
+ }%
+ \@arrayleft
+ \@nameuse{@array@align@#1}%
+ \m@th
+ \let\\\@arraycr
+ \let\tabularnewline\\%
+ \let\par\@empty
+ \let\@sharp##%
+ \set@typeset@protect
+ \lineskip\z@\baselineskip\z@
+ \tabskip\tableft@skip
+ \everycr{}%
+ \expandafter\halign\expandafter\@halignto\expandafter\bgroup\@preamble
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endarray}
+% Here we provide old and new versions of \cmd\endarray.
+% The change here is to use a single procedure to close
+% out any array-like structure, namely \cmd\endarray@ltx.
+% It merely closes out the \cmd\halign.
+% \begin{macrocode}
+\def\endarray@LaTeX{%
+ \crcr\egroup\egroup
+}%
+\def\endarray@ltx{%
+ \crcr\array@row@pst\egroup\egroup
+}%
+\def\endarray@array{%
+ \crcr \egroup \egroup \@arrayright \gdef\@preamble{}%
+}%
+\def\endarray@array@new{%
+ \crcr\array@row@pst\egroup\egroup % Same as \endarray@ltx
+ \@arrayright
+ \global\let\@preamble\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endtabular}
+%
+% \begin{macrocode}
+\def\endtabular@LaTeX{%
+ \crcr\egroup\egroup $\egroup
+}%
+\def\endtabular@ltx{%
+ \endarray
+}%
+\def\endtabular@array{%
+ \endarray $\egroup
+}%
+\def\endtabular@array@new{%
+ \endarray
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{endtabular*}
+% Here we provide a proper definition for the star-form of \enve{endtabular}.
+% It is one of the enduring curiosities that the \LaTeX\ kernel continues to use
+% dangerously and inappropriately ``optimized'' definitions for such commands.
+% \begin{macrocode}
+\@namedef{endtabular*}{\endtabular}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\multicolumn}
+%
+% \begin{macrocode}
+\long\def\multicolumn@LaTeX#1#2#3{%
+ \multispan{#1}\begingroup
+ \@mkpream{#2}%
+ \def\@sharp{#3}\set@typeset@protect
+ \let\@startpbox\@@startpbox\let\@endpbox\@@endpbox
+ \@arstrut \@preamble\hbox{}\endgroup\ignorespaces
+}%
+\long\def\multicolumn@ltx#1#2#3{%
+ \multispan{#1}%
+ \begingroup
+ \@mkpream{#2}%
+ \def\@sharp{#3}%
+ \set@typeset@protect
+ %\let\@startpbox\@@startpbox\let\@endpbox\@@endpbox
+ \@arstrut
+ \@preamble
+ \hbox{}%
+ \endgroup
+ \ignorespaces
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@array@align@}
+% \begin{macro}{\array@default}
+% Here are the various procedures for the vertical alignment options.
+% The change from standard \LaTeX\ is that we do not go into math mode
+% in every case: only when required by \cmd\vcenter.
+% Also, we use \cmd\aftergroup\ to close out the boxes and modes we have started.
+% It requires only that each procedure issue exactly one unmatched \cmd\bgroup.
+%
+% We establish here the default vertical alignment.
+% \begin{macrocode}
+\def\@array@align@t{\leavevmode\vtop\bgroup}%
+\def\@array@align@b{\leavevmode\vbox\bgroup}%
+\def\@array@align@c{\leavevmode\@ifmmode{\vcenter\bgroup}{$\vcenter\bgroup\aftergroup$\aftergroup\relax}}%
+\def\@array@align@v{%
+ \@ifmmode{%
+ \@badmath
+ \vcenter\bgroup
+ }{%
+ \@ifinner{%
+ $\vcenter\bgroup\aftergroup$
+ }{%
+ \@@par\bgroup
+ }%
+ }%
+}%
+\def\array@default{c}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\array@row@pre}
+% \begin{macro}{\array@row@pst}
+% \begin{macro}{\array@row@rst}
+% The procedure \cmd\array@row@rst\ reestablishes a default context for
+% an alignment, so that they can be nested.
+% Any environment or procedure that alters the way alignments are formatted
+% must patch this procedure to restore from that alteration.
+% To start things off, we equate \cmd\@array@align@v\ to \cmd\@array@align@c,
+% because it does not make sense to do the former in any context other
+% than the MVL or in a list that will be unboxed onto the MVL.
+% \begin{macrocode}
+\def\array@row@rst{%
+ \let\@array@align@v\@array@align@c
+}%
+\def\array@row@pre{}%
+\def\array@row@pst{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\toprule}
+% \begin{macro}{\colrule}
+% \begin{macro}{\botrule}
+% Default definitions for \cmd\toprule, \cmd\colrule, \cmd\botrule
+% \begin{macrocode}
+\newcommand\toprule{\tab@rule{\column@font}{\column@fil}{\frstrut}}%
+\newcommand\colrule{\unskip\lrstrut\\\tab@rule{\body@font}{}{\frstrut}}%
+\newcommand\botrule{\unskip\lrstrut\\\noalign{\hline@rule}{}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\hline}
+% \begin{macrocode}
+\def\hline@LaTeX{%
+ \noalign{\ifnum0=`}\fi\hrule \@height \arrayrulewidth \futurelet
+ \reserved@a\@xhline
+}%
+\def\hline@ltx{%
+ \noalign{%
+ \ifnum0=`}\fi
+ \hline@rule
+ \futurelet\reserved@a\@xhline
+ % \noalign ended in \@xhline
+}%
+\def\@xhline@unneeded{%
+ \say\reserved@a
+ \ifx\reserved@a\hline
+ \vskip\doublerulesep
+ \vskip-\arrayrulewidth
+ \fi
+ \ifnum0=`{\fi}%
+}%
+\def\tab@rule#1#2#3{%
+ \crcr
+ \noalign{%
+ \hline@rule
+ \gdef\@arstrut@hook{%
+ \global\let\@arstrut@hook\@empty
+ #3%
+ }%
+ \gdef\cell@font{#1}%
+ \gdef\cell@fil{#2}%
+ }%
+}%
+\def\column@font{}%
+\def\column@fil{}%
+\def\body@font{}%
+\def\cell@font{}%
+\def\frstrut{}%
+\def\lrstrut{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@arstrut@hline}
+% \begin{macro}{\@arstrut@org}
+% \begin{macro}{\@arstrut@hook}
+% \begin{macro}{\@arstrutbox@hline}
+% \begin{macro}{\set@arstrutbox}
+% \begin{macro}{\hline@rule}
+% The procedure \cmd\@arstrut@hline\ is substantially the same as
+% \cmd\@arstrut, except the strut copied in is \cmd\@arstrutbox@hline
+% instead of \cmd\@arstrutbox.
+%
+% The procedure \cmd\@arstrut@hook\ is redefined in \cmd\tab@rule!
+%
+% The register \cmd\@arstrutbox@hline.
+%
+% We append to \cmd\set@arstrutbox\ the code necessary to set a strut following an \cmd\hline.
+%
+% The procedure \cmd\hline@rule\ lays down a rule, and changes the meaning of \cmd\@arstrut\
+% so that the next line will be correctly strutted.
+%
+% The \cmd\@arstrut@hline@clnc\ is a klootch, a magic number.
+% \begin{macrocode}
+\def\@arstrut@hline{%
+ \relax
+ \@ifmmode{\copy}{\unhcopy}\@arstrutbox@hline
+ \@arstrut@hook
+}%
+%
+\let\@arstrut@org\@arstrut
+\def\@arstrut@hook{%
+ \global\let\@arstrut\@arstrut@org
+}%
+%
+\newbox\@arstrutbox@hline
+\appdef\set@arstrutbox{%
+ \setbox\@arstrutbox@hline\hbox{%
+ \setbox\z@\hbox{$0^{0}_{}$}%
+ \dimen@\ht\z@\advance\dimen@\@arstrut@hline@clnc
+ \@ifdim{\dimen@<\arraystretch\ht\strutbox}{\dimen@=\arraystretch\ht\strutbox}{}%
+ \vrule \@height\dimen@
+ \@depth\arraystretch \dp\strutbox
+ \@width\z@
+ }%
+}%
+%
+\def\hline@rule{%
+ \hrule \@height \arrayrulewidth
+ \global\let\@arstrut\@arstrut@hline
+}%
+\def\@arstrut@hline@clnc{2\p@}% % Klootch: magic number
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tableft@skip}
+% \begin{macrocode}
+\def\tableft@skip{\z@skip}%
+\def\tabmid@skip{\z@skip}%\@flushglue
+\def\tabright@skip{\z@skip}%
+\def\tableftsep{\tabcolsep}%
+\def\tabmidsep{\tabcolsep}%
+\def\tabrightsep{\tabcolsep}%
+\def\cell@fil{}%
+\def\pbox@hook{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@arstrut}
+% \begin{macrocode}
+\appdef\@arstrut{\@arstrut@hook}%
+\let\@arstrut@hook\@empty
+\def\@addtopreamble{\appdef\@preamble}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mkpream}
+% \begin{macrocode}
+\def\@mkpream@LaTeX#1{%
+ \@firstamptrue\@lastchclass6
+ \let\@preamble\@empty
+ \let\protect\@unexpandable@protect
+ \let\@sharp\relax
+ \let\@startpbox\relax\let\@endpbox\relax
+ \@expast{#1}%
+ \expandafter\@tfor \expandafter
+ \@nextchar \expandafter:\expandafter=\reserved@a\do
+ {\@testpach\@nextchar
+ \ifcase \@chclass \@classz \or \@classi \or \@classii \or \@classiii
+ \or \@classiv \or\@classv \fi\@lastchclass\@chclass}%
+ \ifcase \@lastchclass \@acol
+ \or \or \@preamerr \@ne\or \@preamerr \tw@\or \or \@acol \fi
+}%
+\def\@mkpream@ltx#1{%
+ \@firstamptrue
+ \@lastchclass6
+ \let\@preamble\@empty
+ \let\protect\@unexpandable@protect
+ \let\@sharp\relax
+%\let\@startpbox\relax\let\@endpbox\relax
+ \@expast{#1}%
+ \expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=\reserved@a
+ \do{%
+ \expandafter\@testpach\expandafter{\@nextchar}%
+ \ifcase\@chclass
+ \@classz
+ \or
+ \@classi
+ \or
+ \@classii
+ \or
+ \@classiii
+ \or
+ \@classiv
+ \or
+ \@classv
+ \fi
+ \@lastchclass\@chclass
+ }%
+ \ifcase\@lastchclass
+ \@acolr % right-hand column
+ \or
+ \or
+ \@preamerr\@ne
+ \or
+ \@preamerr\tw@
+ \or
+ \or
+ \@acolr % right-hand column
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\insert@column}
+% \begin{macrocode}
+\def\insert@column@array{%
+ \the@toks \the \@tempcnta
+ \ignorespaces \@sharp \unskip
+ \the@toks \the \count@ \relax
+}%
+\def\insert@column@array@new{%
+ \the@toks\the\@tempcnta
+ \array@row@rst\cell@font
+ \ignorespaces\@sharp\unskip
+ \the@toks\the\count@
+ \relax
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mkpream@relax}
+% The procedure \cmd\@mkpream@relax\ participates in a strange and wonderful
+% method of binding the alignment procedure---but only certain parts thereof.
+%
+% Here is how it works: in \LaTeX, the \classname{array} package, and in the
+% \classname{longtable} package alike, there is a need to create an alignment
+% preamble (using \cmd\@mkpream) for use by the upcoming \cmd\halign.
+% Then, in both \classname{array} and \classname{longtable}, \TeX's \cmd\edef\
+% is used to `compile in place' that alignment preamble.
+%
+% In the case of \classname{array}, the operation is done in order to
+% pre-expand the use of \texttt{*}, in \classname{longtable}, it is to
+% set the widths of the columns.
+%
+% Now, during this \cmd\edef, certain control sequence names must \emph{not}
+% be expanded, and those are robustified by \cmd\@mkpream@relax.
+%
+% \begin{macrocode}
+\def\@mkpream@relax{%
+ \let\tableftsep\relax
+ \let\tabmidsep\relax
+ \let\tabrightsep\relax
+ \let\array@row@rst\relax
+ \let\cell@font\relax
+ \let\@startpbox\relax
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mkpream}
+% \begin{macrocode}
+\def\@mkpream@array#1{%
+ \gdef\@preamble{}\@lastchclass 4 \@firstamptrue
+ \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
+ \@temptokena{#1}\@tempswatrue
+ \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
+ \count@\m@ne
+ \let\the@toks\relax
+ \prepnext@tok
+ \expandafter \@tfor \expandafter \@nextchar
+ \expandafter :\expandafter =\the\@temptokena \do
+ {\@testpach
+ \ifcase \@chclass \@classz \or \@classi \or \@classii
+ \or \save@decl \or \or \@classv \or \@classvi
+ \or \@classvii \or \@classviii
+ \or \@classx
+ \or \@classx \fi
+ \@lastchclass\@chclass}%
+ \ifcase\@lastchclass
+ \@acol \or
+ \or
+ \@acol \or
+ \@preamerr \thr@@ \or
+ \@preamerr \tw@ \@addtopreamble\@sharp \or
+ \or
+ \else \@preamerr \@ne \fi
+ \def\the@toks{\the\toks}%
+}%
+\def\@mkpream@array@new#1{%
+ \gdef\@preamble{}%
+ \@lastchclass\f@ur
+ \@firstamptrue
+ \let\@sharp\relax
+ \@mkpream@relax
+%\let\@startpbox\relax\let\@endpbox\relax
+ \@temptokena{#1}\@tempswatrue
+ \@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%
+ \count@\m@ne
+ \let\the@toks\relax
+ \prepnext@tok
+ \expandafter\@tfor\expandafter\@nextchar\expandafter:\expandafter=\the\@temptokena
+ \do{%
+ \@testpach
+ \ifcase\@chclass
+ \@classz
+ \or
+ \@classi
+ \or
+ \@classii
+ \or
+ \save@decl
+ \or
+ \or
+ \@classv
+ \or
+ \@classvi
+ \or
+ \@classvii
+ \or
+ \@classviii
+ \or
+ \@classx
+ \or
+ \@classx
+ \fi
+ \@lastchclass\@chclass
+ }%
+ \ifcase\@lastchclass
+ \@acolr % right-hand column
+ \or
+ \or
+ \@acolr % right-hand column
+ \or
+ \@preamerr\thr@@
+ \or
+ \@preamerr\tw@\@addtopreamble\@sharp
+ \or
+ \or
+ \else
+ \@preamerr\@ne
+ \fi
+ \def\the@toks{\the\toks}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@addamp}
+% \begin{macrocode}
+\def\@addamp@LaTeX{%
+ \if@firstamp\@firstampfalse\else\edef\@preamble{\@preamble &}\fi
+}%
+\def\@addamp@ltx{%
+ \if@firstamp\@firstampfalse\else\@addtopreamble{&}\fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@arrayacol}
+% \begin{macrocode}
+\def\@arrayacol@LaTeX{%
+ \edef\@preamble{\@preamble \hskip \arraycolsep}%
+}%
+\def\@arrayacol@ltx{%
+ \@addtopreamble{\hskip\arraycolsep}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabacol}
+% \begin{macrocode}
+\def\@tabacoll{%
+ \@addtopreamble{\hskip\tableftsep\relax}%
+}%
+\def\@tabacol@LaTeX{%
+ \edef\@preamble{\@preamble \hskip \tabcolsep}%
+}%
+\def\@tabacol@ltx{%
+ \@addtopreamble{\hskip\tabmidsep\relax}%
+}%
+\def\@tabacolr{%
+ \@addtopreamble{\hskip\tabrightsep\relax}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@arrayclassz}
+% \begin{macrocode}
+\def\@arrayclassz@LaTeX{%
+ \ifcase \@lastchclass \@acolampacol \or \@ampacol \or
+ \or \or \@addamp \or
+ \@acolampacol \or \@firstampfalse \@acol \fi
+ \edef\@preamble{\@preamble
+ \ifcase \@chnum
+ \hfil$\relax\@sharp$\hfil \or $\relax\@sharp$\hfil
+ \or \hfil$\relax\@sharp$\fi}%
+}%
+\def\@arrayclassz@ltx{%
+ \ifcase\@lastchclass
+ \@acolampacol
+ \or
+ \@ampacol
+ \or
+ \or
+ \or
+ \@addamp
+ \or
+ \@acolampacol
+ \or
+ \@firstampfalse\@acoll
+ \fi
+ \ifcase\@chnum
+ \@addtopreamble{%
+ \hfil\array@row@rst$\relax\@sharp$\hfil
+ }%
+ \or
+ \@addtopreamble{%
+ \array@row@rst$\relax\@sharp$\hfil
+ }%
+ \or
+ \@addtopreamble{%
+ \hfil\array@row@rst$\relax\@sharp$%
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabclassz}
+% \begin{macrocode}
+\def\@tabclassz@LaTeX{%
+ \ifcase\@lastchclass
+ \@acolampacol
+ \or
+ \@ampacol
+ \or
+ \or
+ \or
+ \@addamp
+ \or
+ \@acolampacol
+ \or
+ \@firstampfalse\@acol
+ \fi
+ \edef\@preamble{%
+ \@preamble{%
+ \ifcase\@chnum
+ \hfil\ignorespaces\@sharp\unskip\hfil
+ \or
+ \hskip1sp\ignorespaces\@sharp\unskip\hfil
+ \or
+ \hfil\hskip1sp\ignorespaces\@sharp\unskip
+ \fi}}%
+}%
+\def\@tabclassz@ltx{%
+ \ifcase\@lastchclass
+ \@acolampacol
+ \or
+ \@ampacol
+ \or
+ \or
+ \or
+ \@addamp
+ \or
+ \@acolampacol
+ \or
+ \@firstampfalse\@acoll
+ \fi
+ \ifcase\@chnum
+ \@addtopreamble{%
+ {\hfil\array@row@rst\cell@font\ignorespaces\@sharp\unskip\hfil}%
+ }%
+ \or
+ \@addtopreamble{%
+ {\cell@fil\hskip1sp\array@row@rst\cell@font\ignorespaces\@sharp\unskip\hfil}%
+ }%
+ \or
+ \@addtopreamble{%
+ {\hfil\hskip1sp\array@row@rst\cell@font\ignorespaces\@sharp\unskip\cell@fil}%
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabclassiv}
+% \begin{macrocode}
+\def\@tabclassiv@LaTeX{%
+ \@addtopreamble\@nextchar
+}%
+\def\@tabclassiv@ltx{%
+ \expandafter\@addtopreamble\expandafter{\@nextchar}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@arrayclassiv}
+% \begin{macrocode}
+\def\@arrayclassiv@LaTeX{%
+ \@addtopreamble{$\@nextchar$}%
+}%
+\def\@arrayclassiv@ltx{%
+ \expandafter\@addtopreamble\expandafter{\expandafter$\@nextchar$}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@classv}
+% \begin{macrocode}
+\def\@classv@LaTeX{%
+ \@addtopreamble{\@startpbox{\@nextchar}\ignorespaces
+ \@sharp\@endpbox}%
+}%
+\def\@classv@ltx{%
+ \expandafter\@addtopreamble
+ \expandafter{%
+ \expandafter \@startpbox
+ \expandafter {\@nextchar}%
+ \pbox@hook\array@row@rst\cell@font\ignorespaces\@sharp\@endpbox
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@classx}
+% \begin{macrocode}
+\def\@classx@array{%
+ \ifcase \@lastchclass
+ \@acolampacol \or
+ \@addamp \@acol \or
+ \@acolampacol \or
+ \or
+ \@acol \@firstampfalse \or
+ \@addamp
+ \fi
+}%
+\def\@classx@array@new{%
+ \ifcase \@lastchclass
+ \@acolampacol
+ \or
+ \@addamp \@acol
+ \or
+ \@acolampacol
+ \or
+ \or
+ \@firstampfalse\@acoll
+ \or
+ \@addamp
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Repair other broken parts of \LaTeX}
+%
+% \begin{macro}{\@xbitor}
+% Expansion part has extraneous space token. Removed.
+% \begin{macrocode}
+\def\@xbitor@LaTeX #1{\@tempcntb \count#1
+ \ifnum \@tempcnta =\z@
+ \else
+ \divide\@tempcntb\@tempcnta
+ \ifodd\@tempcntb \@testtrue\fi
+ \fi}%
+\def\@xbitor@ltx#1{%
+ \@tempcntb\count#1%
+ \@ifnum{\@tempcnta=\z@}{}{%
+ \divide\@tempcntb\@tempcnta
+ \@ifodd\@tempcntb{\@testtrue}{}%
+ }%
+}%
+\@ifx{\@xbitor\@xbitor@LaTeX}{%
+ \class@info{Repairing broken LaTeX \string\@xbitor}%
+}{%
+ \class@info{Unrecognized LaTeX \string\@xbitor. Please update this document class! (Proceeding with fingers crossed.)}%
+}%
+\let\@xbitor\@xbitor@ltx
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Syntax}
+% \begin{macro}{\@gobble@opt@one}
+% The \cmd\@gobble@opt@one\ command eats up an optional argument
+% and one required argument.
+% \begin{macrocode}
+\newcommand*\@gobble@opt@one[2][]{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Auto-indented Contents}
+% Facility to automatically determine the proper indentation of
+% the TOC entries.
+%
+% Note on \classname{hyperref} compatibility:
+% We must respect that
+% \cmd\contentsline now has a 4th argument.
+% So, instead of trying to override the meaning of \cmd\contentsline,
+% we use the aux file to remember max values from one run to the next.
+%
+% In this respect, this package retains compatability with
+% \classname{hyperref}.
+%
+% \begin{macro}{\@starttoc}
+% Install hooks at beginning and end of the TOC processing.
+% \begin{macrocode}
+\def\@starttoc#1{%
+ \begingroup
+ \toc@pre
+ \makeatletter
+ \@input{\jobname.#1}%
+ \if@filesw
+ \expandafter\newwrite\csname tf@#1\endcsname
+ \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \fi
+ \@nobreakfalse
+ \toc@post
+ \endgroup
+}%
+\def\toc@pre{}%
+\def\toc@post{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@@font}
+% Interface for setting the formatting characteristics of this part
+% of the TOC.
+%
+% Note: \cmd\toc@@font\ is the common font for all auto-sizing toc commands,
+% although this, too, could become a dispatcher.
+% \begin{macrocode}
+\def\toc@@font{}%{\footnotesize\rmfamily}%
+\def\@dotsep{\z@}%{5.5pt}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% Interface for determining which TOC elements are automatically indented.
+%
+% All of the \cmd\l@\dots\ commands simply go through the
+% bottleproc \cmd\l@@sections. The calling convention is
+% to pass the name of self and the name of parent.
+% If you want to exclude any of these from the indentation
+% scheme, simply leave the \cmd\l@\dots\ command undefined.
+%
+% Note that the parent of ``section'' is nil, so we have to
+% define a stub.
+% \begin{verbatim}
+%\def\l@section{%
+% \l@@sections{}{section}% Implicit #3#4
+%}%
+%\def\tocleft@{\z@}%
+%\def\l@subsection{%
+% \l@@sections{section}{subsection}% Implicit #3#4
+%}%
+%\def\l@subsubsection{%
+% \l@@sections{subsection}{subsubsection}% Implicit #3#4
+%}%
+%\def\l@paragraph{%
+% \l@@sections{subsubsection}{paragraph}% Implicit #3#4
+%}%
+%\def\l@subparagraph#1#2{%
+% \l@@sections{paragraph}{subparagraph}% Implicit #3#4
+%}%
+% \end{verbatim}
+% \end{macro}
+%
+% Glom some \cmd\dimen\ registers.
+% \begin{macrocode}
+\let\tocdim@section \leftmargini
+\let\tocdim@subsection \leftmarginii
+\let\tocdim@subsubsection \leftmarginiii
+\let\tocdim@paragraph \leftmarginiv
+\let\tocdim@appendix \leftmarginv
+\let\tocdim@pagenum \leftmarginvi
+% \end{macrocode}
+%
+% \begin{macro}{\toc@pre@auto}
+% \begin{macro}{\toc@post@auto}
+% We patch \cmd\@starttoc\ to:
+% 1) before TOC processing,
+% initialize the max registers and
+% set the needed dimensions from
+% the values stored in the auxiliary file, and
+% 2) after TOC processing,
+% store out those max register values into the auxiliary file.
+%
+% Note that the font is set here: all other TOC entries must
+% override these font settings.
+%
+% To activate this override of the standard \LaTeX\ processing,
+% the substyle does: \cmd\let\cmd\toc@pre\cmd\toc@pre@auto\
+% and \cmd\let\cmd\toc@post\cmd\toc@post@auto.
+% \begin{macrocode}
+\def\toc@pre@auto{%
+ \toc@@font
+ \@tempdima\z@
+ \toc@setindent\@tempdima{section}%
+ \toc@setindent\@tempdima{subsection}%
+ \toc@setindent\@tempdima{subsubsection}%
+ \toc@setindent\@tempdima{paragraph}%
+ \toc@letdimen{appendix}%
+ \toc@letdimen{pagenum}%
+}%
+\def\toc@post@auto{%
+ \if@filesw
+ \begingroup
+ \toc@writedimen{section}%
+ \toc@writedimen{subsection}%
+ \toc@writedimen{subsubsection}%
+ \toc@writedimen{paragraph}%
+ \toc@writedimen{appendix}%
+ \toc@writedimen{pagenum}%
+ \endgroup
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\toc@setindent}
+% \begin{macrocode}
+\def\toc@setindent#1#2{%
+ \csname tocdim@#2\endcsname\tocdim@min\relax
+ \@ifundefined{tocmax@#2}{\@namedef{tocmax@#2}{\z@}}{}%
+ \advance#1\@nameuse{tocmax@#2}\relax
+ \expandafter\edef\csname tocleft@#2\endcsname{\the#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@letdimen}
+% \begin{macrocode}
+\def\toc@letdimen#1{%
+ \csname tocdim@#1\endcsname\tocdim@min\relax
+ \@ifundefined{tocmax@#1}{\@namedef{tocmax@#1}{\z@}}{}%
+ \expandafter\let\csname tocleft@#1\expandafter\endcsname\csname tocmax@#1\endcsname
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\toc@writedimen}
+% \begin{macrocode}
+\def\toc@writedimen#1{%
+ \immediate\write\@auxout{%
+ \gdef\expandafter\string\csname tocmax@#1\endcsname{%
+ \expandafter\the\csname tocdim@#1\endcsname
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@@sections}
+% The procedure for formatting the indented TOC entries.
+% We use control sequence names such as \cmd\tocmax@section\ and
+% \cmd\tocleft@section, the former being written to the auxiliary file
+% and the latter only defined for the duration of the TOC processing.
+%
+% Note that the assignment of \cmd\box\cmd\z@\ must endure
+% over the invocation of |#3|.
+% \begin{macrocode}
+\def\l@@sections#1#2#3#4{%
+ % #1 - superior section
+ % #2 - this section
+ % #3 - content, including possible \numberline
+ % #4 - page number
+ \begingroup
+ \everypar{}%
+ \set@tocdim@pagenum{#4}%
+ \global\@tempdima\csname tocdim@#2\endcsname
+ \leftskip\csname tocleft@#2\endcsname\relax
+ \dimen@\csname tocleft@#1\endcsname\relax
+ \parindent-\leftskip\advance\parindent\dimen@
+ \rightskip\tocleft@pagenum plus 1fil\relax
+ \skip@\parfillskip\parfillskip\z@
+ \let\numberline\numberline@@sections
+ \@nameuse{l@f@#2}%
+ \ignorespaces#3\unskip\nobreak\hskip\skip@
+ \hb@xt@\rightskip{\hfil\unhbox\@tempboxa}\hskip-\rightskip\hskip\z@skip
+ \par
+ \expandafter\aftergroup\csname tocdim@#2\endcsname\expandafter
+ \endgroup\the\@tempdima\relax
+}%
+\def\set@tocdim@pagenum#1{%
+ \setbox\@tempboxa\hbox{\ignorespaces#1}%
+ \@ifdim{\tocdim@pagenum<\wd\z@}{\global\tocdim@pagenum\wd\z@}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\numberline@@sections}
+% The bottleproc for all \cmd\numberline\ processing in indented TOC entries.
+% The first argument is self.
+%
+% We use \cmd\@tempdima\ to pass a value around (via global assignment) because
+% \cmd\numberline\ executes inside a group if the
+% \classname{hyperref} package is loaded.
+% Would that it were not so!
+% \begin{macrocode}
+\def\numberline@@sections#1{%
+ \leavevmode\hb@xt@-\parindent{%
+ \hfil
+ \@if@empty{#1}{}{%
+ \setbox\z@\hbox{#1.\kern\@dotsep}%
+ \@ifdim{\@tempdima<\wd\z@}{\global\@tempdima\wd\z@}{}%
+ \unhbox\z@
+ }%
+ }%
+ \ignorespaces
+}%
+\def\tocdim@min{\z@}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Lists}
+% \begin{macro}{\list}
+% Using \cmd\parshape\ to implement lists was always suspect
+% (can you get behind \cmd\parshape\cmd\@ne?) and we now see that
+% it was a mistake all along. Why? Because \cmd\parshape, like
+% \cmd\hangindent, achieves its effect via ``shifting'' the \cmd\hbox es
+% in a paragraph
+% instead of using \cmd\leftskip\ and \cmd\parindent, which is
+% robust during column balancing.
+%
+% We introduce the alternative method with a hook into
+% the \LaTeX\ kernel procedure \cmd\list, which is
+% the implementation of all lists.
+%
+% \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
+ \set@listindent
+ \ignorespaces
+}%
+\def\set@listindent@parshape{%
+ \parindent\listparindent
+ \advance\@totalleftmargin\leftmargin
+ \advance\linewidth-\rightmargin
+ \advance\linewidth-\leftmargin
+ \parshape\@ne\@totalleftmargin\linewidth
+}%
+\def\set@listindent@{%
+ \parindent\listparindent
+ \advance\@totalleftmargin\leftmargin
+ \advance\rightskip\rightmargin
+ \advance\leftskip\@totalleftmargin
+}%
+\let\set@listindent\set@listindent@parshape
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{End of the \file{ltxutil} {\sc docstrip} module}
+% Here ends the module.
+% \begin{macrocode}
+%</ltxutil-krn>
+% \end{macrocode}
+%
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
+%%EOF
diff --git a/Master/texmf-dist/source/latex/revtex/revtex4.dtx b/Master/texmf-dist/source/latex/revtex/revtex4.dtx
new file mode 100644
index 00000000000..693747ef47f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/revtex4.dtx
@@ -0,0 +1,8728 @@
+% \iffalse
+% ****** Start of file revtex4.dtx ****** %
+%
+% This file is part of the APS files in the REVTeX 4 distribution.
+% For version number, search on the string "%FileInfo"
+%
+% First revision by David Carlisle,
+% later versions by Arthur Ogawa.
+%
+% Copyright (c) 2000 The American Physical Society.
+% http://publish.aps.org/revtex4/
+% mailto:revtex@aps.org
+%
+%
+% See the REVTeX 4 README file for restrictions and more information.
+% \fi
+% \iffalse
+%<*driver>
+ \ProvidesFile{revtex4.dtx}
+%</driver>
+%<class-pre|aps|rmp>\NeedsTeXFormat{LaTeX2e}[1996/12/01]
+%<class-pre>\ProvidesClass{revtex4}
+%<aps>\ProvidesFile{aps.rtx}
+%<rmp>\ProvidesFile{rmp.rtx}
+%<10pt>\ProvidesFile{10pt.rtx}
+%<11pt>\ProvidesFile{11pt.rtx}
+%<12pt>\ProvidesFile{12pt.rtx}
+%<revsymb&!class-pre>\ProvidesPackage{revsymb}
+%<driver>\ProvidesFile{revtex.drv}
+%<*!class-pst>
+ [2001/08/02 v4.0 (http://publish.aps.org/revtex4/ for documentation)]%FileInfo
+%</!class-pst>
+%<*driver>
+\listfiles
+\documentclass{ltxdoc}
+\RequirePackage{ltxdocext}%
+\let\url\undefined
+\RequirePackage[colorlinks=true,linkcolor=blue]{hyperref}%
+\expandafter\ifx\csname package@font\endcsname\relax\else
+ \expandafter\expandafter
+ \expandafter\RequirePackage
+ \expandafter\expandafter
+ \expandafter{\csname package@font\endcsname}%
+\fi
+\CodelineIndex\EnableCrossrefs
+\begin{document}
+\gdef\lquote{`}\gdef\rquote{'}%
+%{\tracingall\showlists}
+\DocInput{revtex4.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{revtex4.dtx}\CheckSum{7177}
+%
+% \title{The \classname{revtex4} document class of the American Physical Society}
+% \author{Arthur Ogawa%
+% \thanks{First revision by David Carlisle}%
+% }%
+% \date{Version \fileversion, dated \filedate}%
+% \newcommand\revtex{REV\TeX}
+%
+% \maketitle
+%
+% This file embodies the implementation of the APS \revtex\ 4 document class
+% for electronic submissions to journals.
+%
+% The distribution point for this work is
+% \url{http://publish.aps.org/revtex4/},
+% which contains fully unpacked, prebuilt runtime files and documentation.
+%
+% \tableofcontents
+%
+% \section{Using \protect\revtex}
+%
+% The file \file{README} has retrieval and installation information.
+%
+% User documentation is presented separately in \file{revguide.tex}.
+%
+% The file \file{template.aps} is a boilerplate file.
+%
+% \StopEventually{}
+%
+% \changes{v4.a}{1998/01/16}
+% {Initial version}
+% \changes{v4.0beta 2}{1999/06/20}
+% {First modifications by Arthur Ogawa (mailto:ogawa@teleport.com)}
+% \changes{v4.0beta 3}{1999/11/13}
+% {New ltxgrid-based code, other bug fixes}
+% \changes{v4.0beta 4}{2000/05/10}
+% {More features and bug fixes: compatability with longtable and array packages.
+% Now certainly incompatible with multicol.}
+% \changes{v4.0beta 5}{2000/11/14}
+% {Bug fixes and minor new features: title block affiliations can have ancillary data, just like authors;
+% clearpage processing revamped, with floats staying in order; widetext ornaments.}
+% \changes{v4.0beta 6}{2001/02/13}
+% {Last bug fixes before release.}
+%
+% \section{Overview}%
+% \revtex\ is a \LaTeXe\ document class, aomewhat like a hybrid of
+% the standard \LaTeX\ \classname{book} and \classname{article} classes.
+%
+% Certain packages are (should be) loaded by this class in any case:
+% \classname{amssymb}, \classname{amsmath}, \classname{bm}, \classname{natbib}.
+%
+% Certain packages are automatically loaded by this class
+% when a corresponding class option has been invoked:
+%
+% \begin{tabular}{ll}
+% \textbf{\revtex\ option}&\textbf{package}\\
+% \classoption{amsfonts}&\classname{amsfonts}\\
+% \classoption{amssymb}&\classname{amssymb}\\
+% \classoption{aps}&\classname{overcite}\\
+% \end{tabular}
+%
+% Certain other packages are to be loaded by the
+% document through explicit use of \cmd\usepackage.
+% Some mentioned in the user documentation are
+% \classname{graphicx}, \classname{longtable},
+% and \classname{bm}.
+%
+% Certain commonly used packages are known to be incompatible with
+% \revtex, among them \classname{multicol} and \classname{cite}.
+% If such a package is found to be loaded, \revtex\ issues an error message
+% and halts the job.
+% Halting might be considered severe punishment for loading an incompatible
+% package, but if we were to proceed, an even weirder error might be encountered
+% further down the road.
+%
+% This document class implements the substyle: a set of mutually
+% exclusive class options that, in this case, allow the
+% document class to address multiple societies.
+% It also implements a sub-substyle, giving the
+% journal of the given society.
+% The only society currently implemented is \classoption{aps},
+% however, code is in place for another society, the \classoption{osa}.
+%
+% FIXME: should always load the \classname{graphicx} package.
+%
+% QUERY: since \classname{amsfonts} and \classname{amssymb} extend
+% syntax, why not load them in any case?
+%
+% QUERY: if you say \cmd\documentclass|[prb,osa]{revtex4}|, then
+% the value of \cmd\@society\ will be wrong, or? Fixed.
+%
+% Certain events occur at \cmd\AtEndOfClass\ time:
+% \begin{enumerate}
+% \item
+% Optionally read in packages
+% \classname{amsfonts}, \classname{amssymb}.
+% \item
+% Read in society substyle \file{.rtx} file.
+% \item
+% Read in type size \file{.rtx} file.
+% \item
+% Read in the job's style file, the \file{.rty} file.
+% \item
+% Define things based on \cmd\secnumarabic@sw.
+% \item
+% Install procedures to execute at the very end of the class's
+% \cmd\AtBeginDocument\ processing, such as
+% \begin{enumerate}
+% \item
+% closing out the page grid
+% \item
+% putting out the LastPage label.
+% \item
+% issuing a \cmd\bibliographystyle\ command, based on the value set
+% by the society substyle.
+% \item
+% setting default values for parameters used in the document.
+%FIXME: differentiate between class's parameters that can wait until
+% they are used in the document, and parameters that are used at \cmd\AtBeginDocument\ time.
+% \end{enumerate}
+% \item
+% Install procedures to execute the very last at \cmd\AtEndDocument\ time,
+% such as the \cmd\clearpage\ processing.
+% \end{enumerate}
+%
+% Certain events are optionally scheduled for \cmd\AtBeginDocument\ time:
+% \begin{enumerate}
+% \item
+% Setting default values for the Booleans and for other procedures used in formatting.
+% \item
+% In response to class options options, adjusting parameters and procedures used in formatting.
+% \item
+% Implementing the \classoption{eqsecnum} option, if required.
+% \item
+% Setting the state engine for data commands.
+% \item
+% Memorizing procedures for later use.
+% \item
+% Setting type size and area, for use by later calculations.
+% \end{enumerate}
+%
+% Certain events are scheduled for \cmd\class@enddocumenthook\ time:
+% \begin{enumerate}
+% \item
+% Print out the migrated floats or the end notes, if needed.
+% \item
+% Close out the page grid.
+% \item
+% Label the last page of the document
+% \item
+% (\classname{natbib}) prepare to read in the \file{.aux} file.
+% \end{enumerate}
+%
+%
+% \section{The installer file}
+% We include here a reference copy of the installer file, \file{revtex4.ins}.
+% It is not intended that one actually generate that file using \file{docstrip}
+% via the revtex4 installer file, because that would involve overwriting the
+% file that \TeX\ is typesetting. Instead, the installer file is provided
+% pre-generated.
+%
+% For the most part, the installer is simple: it generates \file{revtex4.cls} and
+% a collection of \file{.rtx} files from \file{revtex4.dtx}.
+%
+% However, the process of generating \file{revtex4.cls} involves the incorporation
+% of portions of two of the \file{ltx} series of files, \file{ltxutil.dtx},
+% and \file{ltxgrid.dtx}. The former is a collection of macro definitions that
+% serve as the lowest level of extensions to \LaTeX, the latter implements
+% an alternative output routine and page gridding mechanism that provides for
+% multicolumn page layouts, but without the sorry limitations of the
+% \LaTeX\ required package, \classname{multicol}, and is also compatible with
+% the \classname{longtable} package (which \classname{multicol} is not).
+% \begin{macrocode}
+%<*ins>
+% This file requires docstrip version 2.4 or higher available from
+% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.tex
+\input docstrip
+\preamble
+
+This file is part of the APS files in the REVTeX 4 distribution.
+For the version number, search on the string %FileInfo
+
+Copyright (c) 2000 The American Physical Society.
+http://publish.aps.org/revtex4/
+mailto:revtex@aps.org
+
+Maintained by Arthur Ogawa (mailto:ogawa@teleport.com)
+under contract to the American Physical Society.
+
+See the REVTeX 4 README file for restrictions and more information.
+
+\endpreamble
+\keepsilent
+\askforoverwritefalse
+\generate{%
+ \file{revtex4.cls}{%
+ \from{revtex4.dtx}{class-pre}%
+ \from{ltxutil.dtx}{ltxutil-krn}%
+ \from{ltxgrid.dtx}{ltxgrid-krn}%
+ \from{textcase.dtx}{package}%
+ \from{revtex4.dtx}{class-pst}%
+ }%
+ \file{aps.rtx}{\from{revtex4.dtx}{aps}}%
+ \file{rmp.rtx}{\from{revtex4.dtx}{rmp}}%
+ \file{10pt.rtx}{\from{revtex4.dtx}{10pt}}%
+ \file{11pt.rtx}{\from{revtex4.dtx}{11pt}}%
+ \file{12pt.rtx}{\from{revtex4.dtx}{12pt}}%
+ \file{revsymb.sty}{\from{revtex4.dtx}{revsymb}}%
+}%
+\endbatchfile
+%</ins>
+% \end{macrocode}
+%
+%
+% \section{Writing journal-specifc extensions to \revtex}
+%
+% With this version of \revtex, we introduce a somewhat different
+% scheme for adapting \revtex\ to the needs of a specific journal.
+%
+% To create a journal substyle, you create new class options in
+% \revtex\ for the society, say \classoption{osa}, and any of that society's journals,
+% one of which is, say, \classoption{josaa},
+% using the code for the APS as a guide.
+% In particular, each of your new options should separately define \cmd\@society\
+% and \cmd\@journal. That for the former will be the same for
+% all options relating to a particular society.
+%
+% Then, for the society, you create a corresponding \file{.rtx}
+% file, in our case \file{osa.rtx}.
+% Within that file, you override procedures and parameter assignments as you see fit.
+% Ideally they will be generally applicable to all of that society's
+% journals (see the file \file{aps.rtx} for a realization of this scheme).
+% Also within that file, you include a
+% section of code for each journal, that for josaa looks like:
+% \begin{verbatim}
+% \@ifx{\@journal\journal@josaa}{%
+% <code specific to the josaa>
+% }{}%
+% \end{verbatim}
+%
+% Thus far, the scheme is similar to that used in \revtex\ 3.1.
+% However, the new scheme does differ from the old in that
+% the \file{.rtx} file should define no syntactical extensions
+% to \revtex.
+%
+% \section{The \classname{revtex4} Document Class}
+%
+% \begin{macrocode}
+%<*class-pre>
+\def\class@name{revtex4}%
+% \end{macrocode}
+%
+% Print a banner in the log:
+% \begin{macrocode}
+\GenericInfo{}{\space
+ Copyright (c) 2001 The American Physical Society.^^J
+ mailto:revtex@aps.org^^J
+ Licensed under the LPPL:^^Jhttp://www.ctan.org/tex-archive/macros/latex/base/lppl.txt^^J
+ Arthur Ogawa <ogawa@teleport.com>^^J
+ Based on work by David Carlisle <david@dcarlisle.demon.co.uk>%
+ \@gobble
+}%
+% \end{macrocode}
+%
+% \subsection{Compatability Processing}
+%
+% If the document has \cmd\documentstyle|{revtex4}|,
+% then, instead of attempting to run in compatability mode,
+% just complain and exit.
+% \changes{v4.0beta 3}{1999/11/13}
+% {Lose compatability mode.}
+% \begin{macrocode}
+\if@compatibility
+ \edef\reserved@a{\errhelp{%
+ Change your \string\documentstyle\space statement to
+ \string\documentclass\space and rerun.
+ }}\reserved@a
+ \errmessage{You cannot run \class@name\space in compatability mode}%
+ \expandafter\@@end
+\fi
+% \end{macrocode}
+%
+%
+% \section{Extensions to the \LaTeX\ Kernel}
+% I am introducing
+% some portions of the \classname{ltxkrnext} package
+% (\url{ftp://ftp.teleport.com/users/ogawa/macros/latex/contrib/supported/ltxkrnext/}).
+%
+% First, de-fang unwanted commands and turn \cmd\ProvidesPackage\ into an informative message.
+% \begin{macrocode}
+\let\DeclareOption@latex\DeclareOption
+\let\DeclareOption\@gobbletwo
+\let\ProcessOptions@latex\ProcessOptions
+\let\ProcessOptions\@empty
+\let\ProvidesPackage@latex\ProvidesPackage
+\def\ProvidesPackage#1[#2]{%
+ \class@info{Incorporating package #1 [#2].}%
+}%
+%</class-pre>
+% \end{macrocode}
+% Now load the utility and page grid packages.
+% The \classname{ltxutil} and \classname{ltxgrid} packages are distributed with
+% \revtex.
+% \begin{macrocode}
+%\RequirePackage{ltxutil}%
+%\RequirePackage{ltxgrid}%
+% \end{macrocode}
+%
+% The \classname{textcase} package is available from
+% \url{CTAN:/macros/latex/contrib/supported/carlisle/textcase.dtx} and is
+% used at the suggestion, and by permission, of David~P. Carlisle.
+% \begin{quotation}
+% \cmd\ProvidesFile{textcase.dtx}
+% [1998/11/12 v0.06 Text only upper/lower case changing (DPC)]
+% \end{quotation}
+%
+% David, in turn, suggests that Donald Arseneau be credited for some of the ideas in
+% the \classname{textcase} package, so let it hereby be so understood.
+%
+% Note that David's package has a bug, which is fixed as follows:
+% Change:
+%\begin{verbatim}
+% \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}
+%\end{verbatim}
+% To:
+%\begin{verbatim}
+% \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
+%\end{verbatim}
+%
+% \begin{macrocode}
+%\RequirePackage{textcase}%
+% \end{macrocode}
+%
+% Next, restore those cammands we de-fanged:
+% \begin{macrocode}
+%<*class-pst>
+\let\ProvidesPackage\ProvidesPackage@latex
+\let\ProcessOptions\ProcessOptions@latex
+\let\DeclareOption\DeclareOption@latex
+% \end{macrocode}
+% And let the \classname{textcase} commands override those of \LaTeX:
+% \begin{macrocode}
+\expandafter
+\let\csname MakeUppercase \expandafter\endcsname
+ \csname MakeTextUppercase \endcsname
+\expandafter
+\let\csname MakeLowercase \expandafter\endcsname
+ \csname MakeTextLowercase \endcsname
+% \end{macrocode}
+%
+% Try to patch \classname{longtable}.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \switch@longtable
+}%
+% \end{macrocode}
+%
+% Try to provide a more robust version of \cmd\boldmath.
+% If Team \LaTeX\ ever gets around to fixing this problem, we will bow out.
+% (This relates to bug \#394.)
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \expandafter\@ifnotrelax\csname boldmath \endcsname{}{%
+ \expandafter\let\csname boldmath \endcsname\boldmath
+ \expandafter\def\expandafter\boldmath\expandafter{\expandafter\protect\csname boldmath \endcsname}%
+ }%
+}%
+% \end{macrocode}
+%
+%
+%
+% \section{Options}\label{sec:options}%
+%
+% \subsection{Define Booleans Used in Options}%
+% The following Booleans are used within the document class to
+% allow the document or the substyle to make selections
+% of formatting.
+% Because an explicit document class option always overrides a substyle,
+% any substyle wishing to assign a value to a flag must first test the flag to
+% confirm that it is still undefined.
+% This further means that the default value of the flag must be
+% assigned late, at the end of \cmd\AtBeginDocument\ time, and that
+% the flag may be queried no earlier than that time.
+%
+% \begin{macro}{\class@inithook}
+% The hook \cmd\class@inithook\ is installed into \cmd\class@documenthook,
+% and thereafter serves as the focal point for all code that
+% gives default values to the class's parameters.
+%
+% A typical code might be:
+% \begin{verbatim}
+%\appdef\class@inithook{%
+% \@ifxundefined\twocolumn@sw{\@booleanfalse\twocolumn@sw}{}%
+%}%
+% \end{verbatim}
+% which ensures that the switch \cmd\twocolumn@sw\ is never left undefined.
+%
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \class@inithook
+}%
+\def\class@inithook{}%
+%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\twocolumn@sw}
+% The boolean \cmd\twocolumn@sw\ signifies that we are to use a two-column grid.
+%
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\twocolumn@sw{\@booleanfalse\twocolumn@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\footinbib@sw}
+% The boolean \cmd\footinbib@sw\ signifies that
+% footnotes are to be set in the bibliography, as endnotes.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\footinbib@sw{\@booleanfalse\footinbib@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\preprintsty@sw}
+% The boolean \cmd\preprintsty@sw\ signifies that
+% the document is to be formatted in preprint style.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\preprintsty@sw{\@booleanfalse\preprintsty@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\preprint@sw}
+% The boolean \cmd\preprint@sw\ signifies that
+% the preprints (cf. \cmd\preprint) are to be formatted (usually on the title page).
+% The default is to do so; the option \classoption{nopreprintnumbers}
+% declares not to.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\preprint@sw{\@booleanfalse\preprint@sw}{}%
+ \preprintsty@sw{\@booleantrue\preprint@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\galley@sw}
+% The boolean \cmd\galley@sw\ signifies that
+% the document is to be formatted in galley style.
+%
+% Asserting both \cmd\galley@sw\ and \cmd\preprintsty@sw\
+% may produce strange formatting results, but it is not illegal.
+% However, it \emph{is} illegal to assert galley and any
+% twocolumn option.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\galley@sw{\@booleanfalse\galley@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\groupauthors@sw}
+% The flag \cmd\groupauthors@sw\ signifies that authors are to be grouped.
+% This affects the meaning of \cmd\@author@present\ and \cmd\@tempaffil.
+%
+% FIXME: apparently \cmd\@tempaffil\ and its aliases are never used.
+% \end{macro}
+%
+% \begin{macro}{\runinaddress@sw}
+% The flag \cmd\runinaddress@sw\ signifies that author addresses are to be
+% run in.
+% \end{macro}
+%
+% \begin{macro}{\@affils@sw}
+% If \cmd\@affils@sw\ is false, an address is never recognised as ``new''
+% and is therefore always entered into the affiliation list,
+% stopping groups of authors at the same address being amalgamated
+% into the same list:
+% the address will be printed the same number of times it is entered.
+% \end{macro}
+%
+% \begin{macro}{\showPACS@sw}
+% \begin{macro}{\showKEYS@sw}
+% If \cmd\showPACS@sw\ is true, print the PACS information in the title block,
+% otherwise not.
+% Similarly for \cmd\showKEYS@sw\ and the keywords.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\showPACS@sw{\@booleanfalse\showPACS@sw}{}%
+ \@ifxundefined\showKEYS@sw{\@booleanfalse\showKEYS@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\floats@sw}
+% The Boolean \cmd\floats@sw\ signifies that floats are to be floated;
+% if false, that floats are to be deferred to the end of the document.
+% By default, the former.
+% Note that the state of this Boolean is to be changed by
+% the document class in response to user-selected options.
+%
+% This boolean and the assignment of its default value is done by
+% the \classname{ltxutil} package.
+% \end{macro}
+%
+% \begin{macro}{\floatp@sw}
+% The Boolean \cmd\floatp@sw\ signifies that endfloats are to be set one per page;
+% if false, that endfloats are to be set with multiple floats per page permitted.
+% By default, the latter.
+% Note that the state of this Boolean is to be changed by
+% the document class in response to user-selected options.
+% The default is established here.
+% \end{macro}
+%
+% \begin{macro}{\twoside@sw}
+% The flag \cmd\twoside@sw\ signifies that the document is to be
+% formatted for duplex printing.
+% At \cmd\AtBeginDocument\ time, we must align the value
+% of the kernel \cmd\newif\ switch \cmd\if@twoside\
+% to that of \cmd\twoside@sw.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
+ \twoside@sw{\@twosidetrue}{\@twosidefalse}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\draft@sw}
+% The flag \cmd\draft@sw\ signifies that the document is to be
+% formatted in draft mode.
+% Certain packages may pay attention to the
+% class option \classoption{draft} that sets this Boolean.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\draft@sw{\@booleanfalse\draft@sw}{}%
+ \draft@sw{\overfullrule 5\p@}{\overfullrule\z@}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tightenlines@sw}
+% The boolean \cmd\tightenlines@sw\ signifies that
+% the leading is to be made standard amount.
+% If false, it means that the leading is to be set extra open.
+% Has no effect on 10pt size option.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\tightenlines@sw{\@booleanfalse\tightenlines@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lengthcheck@sw}
+% The flag \cmd\lengthcheck@sw\ signifies that
+% the length checking is in effect.
+% It is up to the individual journal substyle
+% to alter its formatting accordingly.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\lengthcheck@sw{\@booleanfalse\lengthcheck@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eqsecnum@sw}
+% The flag \cmd\eqsecnum@sw\ signifies that equations are to be
+% numbered with the section, e.g., ``Eq. (2.13)''.
+% This flag is neither set nor queried.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\eqsecnum@sw{\@booleanfalse\eqsecnum@sw}{}%
+ \eqsecnum@sw{%
+ \@addtoreset{equation}{section}%
+ \def\theequation@prefix{\arabic{section}.}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\byrevtex@sw}
+% The flag \cmd\byrevtex@sw\ signifies that the document should
+% bear an imprint to the effect that it was formatted by this document class.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\byrevtex@sw{\@booleanfalse\byrevtex@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Declare Options}%
+%
+% \subsubsection{Checkin: for Editorial Use}%
+% A document class option declaring that the document is being processed by the
+% editorial staff.
+%
+% This option should:
+% \begin{itemize}
+% \item
+% put date in footer along with folio
+% \item
+% Have the effect of selecting the \classoption{preprint} class option.
+% \item
+% Have the effect of selecting the \classoption{showpacs} class option.
+% \item
+% specify that when a float is placed h or H, it will be allowed to break over pages.
+% (Note: be sure that if the enclosed \env{tabular} has an optional argument, you change it to [v], or remove it entirely.)
+% \end{itemize}
+% \changes{v4.0beta 3}{1999/11/13}
+% {New option ``checkin''}
+% \begin{macrocode}
+\DeclareOption{checkin}{%
+ \@booleantrue\dateinRH@sw
+ \@booleantrue\preprintsty@sw
+ \def\@pointsize{12}%
+ \@booleantrue\showPACS@sw
+ \@booleantrue\showKEYS@sw
+ \def\fp@proc@h{\allow@breaking@tables}%
+ \def\fp@proc@H{\allow@breaking@tables}%
+}%
+\@booleanfalse\dateinRH@sw
+\def\checkindate{\dateinRH@sw{{\tiny(\today)}}{}}%
+\def\allow@breaking@tables{%
+ \def\array@default{v}% tabular can break over pages
+ \@booleanfalse\floats@sw % table can break over pages
+}%
+% \end{macrocode}
+%
+% \subsubsection{Preprint Style}%
+% \changes{v4.d}{1998/01/31}
+% {Rearrange the ordering so numerical ones come first. AO: David, what does this mean?}
+%
+% \changes{v4.g}{1998/06/10}
+% {comma not space between email and homepage}
+%
+% \changes{v4.0beta 2}{1999/06/20}
+% {Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+% \begin{macrocode}
+\DeclareOption{preprint}{%
+ \@booleantrue\preprintsty@sw
+ \def\@pointsize{12}%
+}%
+\DeclareOption{manuscript}{%
+ \class@warn{Document class option manuscript is obsolete; use preprint instead}%
+ \ExecuteOptions{preprint}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Showing PACS and keywords}%
+% \changes{v4.0beta 2}{1999/06/20}
+% {New option}
+% \changes{v4.0beta 5}{2000/09/20}
+% {New option showkeys}
+% \begin{macrocode}
+\DeclareOption{showpacs}{%
+ \@booleantrue\showPACS@sw
+}%
+\DeclareOption{noshowpacs}{%
+ \@booleanfalse\showPACS@sw
+}%
+\DeclareOption{showkeys}{%
+ \@booleantrue\showKEYS@sw
+}%
+\DeclareOption{noshowkeys}{%
+ \@booleanfalse\showKEYS@sw
+}%
+% \end{macrocode}
+%
+% \subsubsection{Balance the last page when in two-column page grid}%
+% If we are in a two-column page grid, we may wish to balance the columns
+% of the last page. This will be done automatically if the
+% \classoption{twocolumn} document class option is chosen.
+% This action will be turned off by the \classoption{nobalancelastpage}.
+% A complementary class option, \classoption{balancelastpage} is also provided.
+% \begin{macrocode}
+\DeclareOption{balancelastpage}{%
+ \@booleantrue\balancelastpage@sw
+}%
+\DeclareOption{nobalancelastpage}{%
+ \@booleanfalse\balancelastpage@sw
+}%
+\appdef\class@inithook{%
+ \@ifxundefined\balancelastpage@sw{%
+ \@booleantrue\balancelastpage@sw
+ }{}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Showing preprint numbers}%
+% \changes{v4.0beta 4}{2000/04/10}
+% {New option}
+% \begin{macrocode}
+\DeclareOption{nopreprintnumbers}{\@booleanfalse\preprint@sw}%
+\DeclareOption{preprintnumbers}{\@booleantrue\preprint@sw}%
+% \end{macrocode}
+%
+% \subsubsection{Hypertext Option}%
+%
+% \changes{v4.e}{1998/01/31}
+% {protect against hyperref revtex kludges which are not needed now}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Move this ``complex'' option to the front, where it can be overridden by ``simple'' options.}
+% \changes{v4.0rc4}{2001/07/23}
+% {hyperref is no longer loaded via class option: use a usepackage statement instead}
+% \begin{macrocode}
+\DeclareOption{hyperref}{%
+%\AtEndOfClass{%
+% \begingroup
+% \edef\@tempa{%
+% \let
+% \noexpand\@clsextension
+% \noexpand\@empty
+% \noexpand\RequirePackage{hyperref}%
+% \def\noexpand
+% \@clsextension{\@clsextension}%
+% }%
+% \expandafter
+% \endgroup
+% \@tempa
+%}%
+% \end{macrocode}
+%
+% If you have a hyper-foo enabled browser you may prefer this format
+% which does not print the URL for the home page, but just makes the
+% name a link, but by default print it so it works on paper.
+% \changes{v4.e}{1998/01/31}
+% {print homepage}
+%
+% \begin{macrocode}
+% \def\@pointsize{10}%
+ \class@warn{Class option "hyperref" is no longer supported.^^JEmploy \string\usepackage{hyperref} instead}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Type Size}%
+% Use \cmd\@pointsize|=10| rather than \cmd\@ptsize|=0| to allow easy extensions
+% to 9pt or whatever.
+% Note: the three alternatives are mutually exclusive. Furthermore
+% if \cmd\@pointsize\ is still undefined at \cmd\AtEndOfClass\ time,
+% then the substyle can conclude that the user accepts the default.
+% \begin{macrocode}
+\DeclareOption{10pt}{\def\@pointsize{10}}
+\DeclareOption{11pt}{\def\@pointsize{11}}
+\DeclareOption{12pt}{\def\@pointsize{12}}
+% \end{macrocode}
+%
+% \subsubsection{Media Size}%
+% \changes{v4.0beta 2}{1999/06/20}
+% {Restore all media size class option of \protect\file{classes.dtx}}
+% \begin{macrocode}
+\DeclareOption{a4paper}
+ {\setlength\paperheight {297mm}%
+ \setlength\paperwidth {210mm}}
+\DeclareOption{a5paper}
+ {\setlength\paperheight {210mm}%
+ \setlength\paperwidth {148mm}}
+\DeclareOption{b5paper}
+ {\setlength\paperheight {250mm}%
+ \setlength\paperwidth {176mm}}
+\DeclareOption{letterpaper}
+ {\setlength\paperheight {11in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{legalpaper}
+ {\setlength\paperheight {14in}%
+ \setlength\paperwidth {8.5in}}
+\DeclareOption{executivepaper}
+ {\setlength\paperheight {10.5in}%
+ \setlength\paperwidth {7.25in}}
+\DeclareOption{landscape}
+ {\setlength\@tempdima {\paperheight}%
+ \setlength\paperheight {\paperwidth}%
+ \setlength\paperwidth {\@tempdima}}
+% \end{macrocode}
+%
+% \subsubsection{Bibnotes}%
+% Frontmatter footnotes result from frontmatter commands like
+% \cmd\email, \cmd\homepage, \cmd\altaffiliation, and \cmd\thanks.
+% The default for \cmd\frontmatter@footnote@produce\ is
+% \cmd\frontmatter@footnote@produce@footnote, which formats the frontmatter footnotes
+% at the foot of the title page. The \classoption{bibnotes} class option
+% defers them to the bibliography.
+% \begin{macrocode}
+\DeclareOption{bibnotes}{\@booleantrue\bibnotes@sw}%
+\DeclareOption{nobibnotes}{\@booleanfalse\bibnotes@sw}%
+\appdef\class@enddocumenthook{\auto@bib}%
+\appdef\class@inithook{%
+ \@ifxundefined\bibnotes@sw{\@booleanfalse\bibnotes@sw}{}%
+ \bibnotes@sw{%
+ \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
+ }{%
+ \let\frontmatter@footnote@produce\frontmatter@footnote@produce@footnote
+ }%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Footinbib}%
+% \begin{macrocode}
+\DeclareOption{footinbib}{\@booleantrue\footinbib@sw}
+\DeclareOption{nofootinbib}{\@booleanfalse\footinbib@sw}
+% \end{macrocode}
+%
+% \subsubsection{altaffilletter}%
+%
+% \begin{macrocode}
+\DeclareOption{altaffilletter}{\@booleantrue\altaffilletter@sw}%
+\DeclareOption{altaffilsymbol}{\@booleanfalse\altaffilletter@sw}%
+\appdef\class@inithook{%
+ \@ifxundefined\altaffilletter@sw{\@booleanfalse\altaffilletter@sw}{}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{superbib}%
+% The document may invoke superscript bibliography style.
+% If not, the journal substyle may make a selection.
+% If neither, the class itself selects a default.
+% This is really a quite deep nesting of defaults.
+% \begin{macrocode}
+\DeclareOption{superbib}{%
+ \def\place@bibnumber{\place@bibnumber@sup}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{citeautoscript}%
+% This class option allows you to automatically accomodate a change from non-superscripted, numbered references
+% to superscripted, bunmbered references.
+%
+% Note: you should always mark up your document with the assumption that references are \emph{not} going to be superscripted.
+% Otherwise this option has no hope of working properly.
+%
+% \begin{macrocode}
+\DeclareOption{citeautoscript}{%
+ \@booleantrue\citeautoscript@sw
+}%
+\@booleanfalse\citeautoscript@sw
+% \end{macrocode}
+%
+% \subsubsection{Simplex/Duplex Pages}%
+% \changes{v4.e}{1998/01/31}
+% {4.d had twoside option setting twoside switch to false}
+% The complementary options \classoption{twoside} and \classoption{oneside}
+% assert formatting for duplex or simplex printing, respectively.
+% At the same time, we arrange for the selection of the page grid
+% with respect to the marginal column:
+% Because \cmd\if@reversemargin\ remains default (false),
+% if duplex printing, this column will always be on the (right),
+% if simplex printing, it will always be on the (outside).
+% QUERY: correct choice?
+% \begin{macrocode}
+\DeclareOption{twoside}{\@booleantrue\twoside@sw \@mparswitchfalse}
+\DeclareOption{oneside}{\@booleanfalse\twoside@sw\@mparswitchtrue}
+% \end{macrocode}
+%
+% \subsubsection{Two-Column Page Grid}%
+%
+% \begin{macro}{\twocolumn@sw}
+% The flag \cmd\twocolumn@sw\ signifies that the document is to be
+% formatted in the two-column page grid.
+%
+% If no options relating to page grid are invoked by
+% \cmd\AtBeginDcoument\ time, we set default values.
+% Up to that point, the class can check if \cmd\twocolumn@sw\
+% is \cmd\undefined\ to see if any related options have been invoked.
+%
+% At \cmd\AtBeginDocument\ time, we must align the value
+% of the kernel \cmd\newif\ switch \cmd\if@twocolumn\
+% to that of \cmd\twocolumn@sw.
+%
+% We install into \cmd\class@enddocumenthook\
+% all tasks that we know must be completed at \cmd\AtEndDocument\ time.
+% The first thing it does is end the current paragraph.
+% The last is
+% to return us to one-column page grid.
+% (This task is installed as late as possible,
+% i.e., after items like \cmd\printtables.)
+% \begin{macrocode}
+\AtEndOfClass{%
+ \def\clear@document{%
+ \close@column
+ }%
+ \appdef\class@inithook{%
+ \@ifxundefined\close@column{%
+ \let\close@column\close@column@default
+ }{}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% The \classoption{twocolumn} class option employs the standard mechanism for
+% changing the column grid: the \classname{ltxgrid} package.
+% \begin{macrocode}
+\DeclareOption{twocolumn}{%
+ \@booleantrue\twocolumn@sw
+}%
+% \end{macrocode}
+%
+% \classoption{onecolumn} specifies one-column page grid.
+% \begin{macrocode}
+\DeclareOption{onecolumn}{%
+ \@booleanfalse\twocolumn@sw
+}%
+% \end{macrocode}
+%
+% \classoption{galley} emulates setting the galleys of
+% a two-column journal.
+% FIXME: this option should effectively set \cmd\preprintsty@sw\ false.
+% NOTE: it makes no sense to assert both galley and twocolumn.
+%
+% \begin{macrocode}
+\DeclareOption{galley}{%
+ \ExecuteOptions{onecolumn}%
+ \@booleantrue\galley@sw
+ \appdef\set@pica@hook{%
+ \advance\textwidth-\columnsep
+ \textwidth.5\textwidth
+ }%
+}%
+% \end{macrocode}
+%
+%
+% \subsubsection{raggedbottom or flushbottom}%
+% The class options \classoption{raggedbottom} and \classoption{flushbottom} determine whether the columns (page)
+% are ragged bottom or flush bottom.
+% Note that we do not select a default here; that is done by the journal substyle.
+% \begin{macrocode}
+\DeclareOption{raggedbottom}{\@booleantrue\raggedcolumn@sw}
+\DeclareOption{flushbottom}{\@booleanfalse\raggedcolumn@sw}
+% \end{macrocode}
+%
+% \subsubsection{tightenlines}%
+% This class option specifies that standard leading
+% is to be used to set the type.
+% If lacking, the leading will be loose.
+%
+% \begin{macrocode}
+\DeclareOption{tightenlines}{\@booleantrue\tightenlines@sw}
+% \end{macrocode}
+%
+% \subsubsection{lengthcheck}%
+% This class option specifies that the formatted document
+% should approach as closely as possible the
+% formatting of an actual journal article
+% to facilitate the author's performance of a length check.
+%
+% \begin{macrocode}
+\DeclareOption{lengthcheck}{%
+ \@booleantrue\lengthcheck@sw
+ \@booleantrue\twoside@sw
+ \@booleantrue\twocolumn@sw
+}%
+% \end{macrocode}
+%
+% \subsubsection{Draft and Final}%
+% \begin{macrocode}
+\DeclareOption{draft}{%
+ \@booleantrue\draft@sw
+}%
+\DeclareOption{final}{%
+ \@booleanfalse\draft@sw
+}%
+% \end{macrocode}
+%
+% \subsubsection{eqsecnum}%
+% The \classoption{eqsecnum} class option signifies that equations are
+% to be numbered within sections.
+% \begin{macrocode}
+\DeclareOption{eqsecnum}{\@booleantrue\eqsecnum@sw}
+% \end{macrocode}
+%
+% \subsubsection{secnumarabic}%
+% The \classoption{secnumarabic} class option signifies that sectioning commands are
+% to be numbered arabic.
+% \begin{macrocode}
+\DeclareOption{secnumarabic}{\@booleantrue\secnumarabic@sw}
+% \end{macrocode}
+% The code that polls the Boolean \cmd\secnumarabic@sw\ appears
+% in Section~\ref{sec:secnumarabic}.
+%
+% FIXME: model fleqn after amsfonts. I no longer understand why I said this.
+% \begin{macrocode}
+\DeclareOption{fleqn}{\input{fleqn.clo}}
+% \end{macrocode}
+%
+% \subsubsection{floats/endfloats}%
+% These options control, via the Boolean \cmd\floats@sw,
+% whether floats are to be migrated to the end of the document.
+% \begin{macrocode}
+\DeclareOption{floats}{\@booleantrue\floats@sw\@booleanfalse\floatp@sw}
+\DeclareOption{endfloats}{\@booleanfalse\floats@sw\@booleanfalse\floatp@sw}
+\DeclareOption{endfloats*}{\@booleanfalse\floats@sw\@booleantrue\floatp@sw}
+\appdef\class@inithook{%
+ \@ifxundefined\floats@sw{\@booleantrue\floats@sw}{}%
+ \@ifxundefined\floatp@sw{\@booleantrue\floatp@sw}{}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{titlepage/notitlepage}%
+% These options control, via \cmd\titlepage@sw,
+% whether the title block is to be set on a separate page.
+% \begin{macro}{\titlepage@sw}
+% The flag \cmd\titlepage@sw\ signifies that a forced
+% page break is to follow the title page: the article
+% title appears on a page by itself.
+%
+% The Boolean \cmd\titlepage@sw\ is in an odd situation:
+% its value is set by one or more substyles, contingent
+% upon the value of another Boolean.
+% Therefore that code must be invoked at \cmd\AtBeginDocument\ time.
+% Therefore we must assign the default value at the very end
+% of \cmd\AtBeginDocument\ processing: we use \cmd\defaults@hook.
+% Luckily, this Boolean does not need to be queried at
+% \cmd\AtBeginDocument\ time, or we'd be in dire straights.
+% \begin{macrocode}
+\DeclareOption{titlepage}{\@booleantrue\titlepage@sw}
+\DeclareOption{notitlepage}{\@booleanfalse\titlepage@sw}
+\appdef\defaults@hook{%
+ \@ifxundefined\titlepage@sw{\@booleanfalse\titlepage@sw}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Substyle and Sub-substyle}%
+%
+% If the society has already been assigned,
+% notify user that \cmd\@society\ is being overridden.
+%
+% \begin{macrocode}
+\def\change@society#1{%
+ \def\@tempa{#1}%
+ \@ifxundefined\@society{}{%
+ \@ifx{\@tempa\@society}{}{%
+ \class@warn{Conflicting society \@tempa<>\@society.}%
+ }%
+ }%
+ \let\@society\@tempa
+}%
+% \end{macrocode}
+% Here are the class options relating to the APS
+% \begin{macrocode}
+\DeclareOption{aps}{\change@society{aps}\def\@journal{}}%
+\DeclareOption{pra}{\change@society{aps}\def\@journal{pra}}%
+\DeclareOption{prb}{\change@society{aps}\def\@journal{prb}}%
+\DeclareOption{prc}{\change@society{aps}\def\@journal{prc}}%
+\DeclareOption{prd}{\change@society{aps}\def\@journal{prd}}%
+\DeclareOption{pre}{\change@society{aps}\def\@journal{pre}}%
+\DeclareOption{prl}{\change@society{aps}\def\@journal{prl}}%
+\DeclareOption{prstab}{\change@society{aps}\def\@journal{prstab}}%
+\DeclareOption{rmp}{\change@society{aps}\def\@journal{rmp}}%
+% \end{macrocode}
+% Here are the class options relating to the Optical Society of America
+% \begin{macrocode}
+\DeclareOption{osa}{\change@society{osa}\def\@journal{}}%
+\DeclareOption{osameet}{\change@society{osa}\def\@journal{osameet}}%
+\DeclareOption{opex}{\change@society{osa}\def\@journal{opex}}%
+\DeclareOption{tops}{\change@society{osa}\def\@journal{tops}}%
+\DeclareOption{josa}{\change@society{osa}\def\@journal{josa}}%
+% \end{macrocode}
+%
+% NOTE: \file{revguide.tex} does not mention any \cmd\@journal\ options
+% besides \classoption{prb}.
+%
+% \begin{macro}{amsfonts}
+% The class option \classoption{amsfonts} has the
+% same effect as if the document preamble contained
+% a \cmd\usepackage\verb${amsfonts}$ statement.
+% \begin{macrocode}
+\DeclareOption{amsfonts}{%
+ \def\class@amsfonts{\RequirePackage{amsfonts}}%
+}%
+\DeclareOption{noamsfonts}{%
+ \let\class@amsfonts\@empty
+}%
+\AtEndOfClass{%
+ \@ifxundefined\class@amsfonts{}{\class@amsfonts}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{amssymb}
+% The class option \classoption{amssymb} has the
+% same effect as if the document preamble contained
+% a \cmd\usepackage\verb${amssymb}$ statement.
+% \begin{macrocode}
+\DeclareOption{amssymb}{%
+ \def\class@amssymb{\RequirePackage{amssymb}}%
+}%
+\DeclareOption{noamssymb}{%
+ \let\class@amssymb\@empty
+}%
+\AtEndOfClass{%
+ \@ifxundefined\class@amssymb{}{\class@amssymb}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{amsmath}
+% The class option \classoption{amsmath} has the
+% same effect as if the document preamble contained
+% a \cmd\usepackage\verb${amsmath}$ statement.
+%
+% We require version 1.2 (datestamped 1997/03/20) or later.
+% The \expandafter\cmd\csname ver@amsmath.sty\endcsname, will
+%
+% \LaTeX\ note:
+% Certain \LaTeX\ procedures have an arbitrary and pointless restriction that they may be used only within the preamble.
+% We get around this by preserving the procedures in private \cmd\csname s.
+%
+% FIXME note: it is difficult to ensure that an error summary will be printed on the console at the very end,
+% but \classname{ltxgrid} allows accomplishing this via an interrupt, put down at \cmd\AtEndDocument\ time.
+%
+% \begin{macrocode}
+\DeclareOption{amsmath}{%
+ \def\class@amsmath{\RequirePackage{amsmath}[\ver@amsmath@prefer]}%
+}%
+\DeclareOption{noamsmath}{%
+ \let\class@amsmath\@empty
+}%
+\AtEndOfClass{%
+ \preserve@LaTeX
+ \@ifxundefined\class@amsmath{}{\class@amsmath}%
+ \appdef\class@enddocumenthook{\test@amsmath@ver}%
+}%
+\appdef\preserve@LaTeX{%
+ \let\@ifl@aded@LaTeX\@ifl@aded
+ \let\@ifpackageloaded@LaTeX\@ifpackageloaded
+ \let\@pkgextension@LaTeX\@pkgextension
+ \let\@ifpackagelater@LaTeX\@ifpackagelater
+ \let\@ifl@ter@LaTeX\@ifl@ter
+ \let\@ifl@t@r@LaTeX\@ifl@t@r
+ \let\@parse@version@LaTeX\@parse@version
+}%
+\appdef\restore@LaTeX{%
+ \let\@ifl@aded\@ifl@aded@LaTeX
+ \let\@ifpackageloaded\@ifpackageloaded@LaTeX
+ \let\@pkgextension\@pkgextension@LaTeX
+ \let\@ifpackagelater\@ifpackagelater@LaTeX
+ \let\@ifl@ter\@ifl@ter@LaTeX
+ \let\@ifl@t@r\@ifl@t@r@LaTeX
+ \let\@parse@version\@parse@version@LaTeX
+}%
+\def\test@amsmath@ver{%
+ \begingroup
+ \restore@LaTeX
+ \@ifpackageloaded{amsmath}{%
+ \@ifpackagelater{amsmath}{\ver@amsmath@prefer}{}{%
+ \class@warn{%
+ You have loaded amsmath, version "\csname ver@amsmath.sty\endcsname",\MessageBreak
+ but this class requires version "\ver@amsmath@prefer", or later.\MessageBreak
+ Please update your LaTeX installation.
+ }%
+ }%
+ }{%
+ }%
+ \endgroup
+}%
+\def\ver@amsmath@prefer{2000/01/15 v2.05 AMS math features}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Presenting Authors and Their Affiliations}%
+% \changes{v4.0beta 2}{1999/06/20}
+% {These options are now mutually exclusive. But is this correct?}
+%
+% The \classoption{runinaddress} option is the only one that sets \cmd\runinaddress@sw\ to true.
+%
+% The \classoption{unsortedaddress} option is the only one that sets \cmd\@affils@sw\ to false.
+%
+% If we take the \classoption{groupedaddress} option as the default, then we can look upon
+% the \classoption{superscriptaddress} option as simply turning \cmd\groupauthors@sw\ to false.
+%
+% \classoption{groupedaddress}, the default, groups authors above a common address.
+% In order to assert the default and still provide for proper precedence
+% for document-supplied options, we carry out our action at \cmd\AtBeginDocument\ time,
+% and only if none of the related class options were invoked.
+% \begin{macrocode}
+\DeclareOption{groupedaddress}{\clo@groupedaddress}%
+\def\clo@groupedaddress{%
+ \@booleantrue\groupauthors@sw
+ \@booleantrue\@affils@sw
+ \@booleanfalse\runinaddress@sw
+}%
+\appdef\class@inithook{%
+ \@ifxundefined\groupauthors@sw{\clo@groupedaddress}{}%
+}%
+% \end{macrocode}
+%
+% \classoption{unsortedaddress} is similar to \classoption{groupedaddress},
+% but turns off \cmd\@affils@sw,
+% with the result that each address that is entered will be printed.
+% \begin{macrocode}
+\DeclareOption{unsortedaddress}{\clo@unsortedaddress}%
+\def\clo@unsortedaddress{%
+ \@booleantrue\groupauthors@sw
+ \@booleanfalse\@affils@sw
+ \@booleanfalse\runinaddress@sw
+}%
+% \end{macrocode}
+%
+% \classoption{runinaddress} is similar to \classoption{groupedaddress},
+% with the addition of the Boolean \cmd\runinaddress@sw,
+% which causes the authors associated with a particular address group
+% to be formatted in a paragraph instead of on separate lines.
+% \begin{macrocode}
+\DeclareOption{runinaddress}{\clo@runinaddress}%
+\def\clo@runinaddress{%
+ \@booleantrue\groupauthors@sw
+ \@booleantrue\@affils@sw
+ \@booleantrue\runinaddress@sw
+}%
+% \end{macrocode}
+%
+% \classoption{superscriptaddress} presents author affiliations
+% as superscripts. Authors with like affiliations share the same
+% superscript.
+%
+% FIXME: if \cmd\groupauthors@sw\ is false, would not \cmd\@affils@sw\ be a don't care?
+% \begin{macrocode}
+\DeclareOption{superscriptaddress}{\clo@superscriptaddress}%
+\def\clo@superscriptaddress{%
+ \@booleanfalse\groupauthors@sw
+ \@booleantrue\@affils@sw
+ \@booleanfalse\runinaddress@sw
+}%
+% \end{macrocode}
+%
+%
+% \subsubsection{Typeset by \revtex}%
+%
+% The class option \classoption{byrevtex} signifies that you want the
+% ``Typeset by \revtex'' byline to appear on your formatted output.
+% By default, no such byline appears.
+% \begin{macrocode}
+\DeclareOption{byrevtex}{\@booleantrue\byrevtex@sw}%
+% \end{macrocode}
+%
+%
+% \subsection{Attempt to fix float placement failure}%
+%
+% \revtex\ uses the \classname{ltxgrid} package, which provides the ability to attempt repairs when
+% \LaTeX's float placement mechanism is about to fail, but that facility is turned off by default.
+% Users should invoke the \classoption{floatfix} document class option to enable this \LaTeX\ extension.
+% If not, a helpful message is printed in the log, indicating how to work around the difficulty.
+% \begin{macrocode}
+\DeclareOption{floatfix}{\@booleantrue\force@deferlist@sw}%
+\DeclareOption{nofloatfix}{\@booleanfalse\force@deferlist@sw}%
+\appdef\class@inithook{%
+ \@ifxundefined\force@deferlist@sw{\@booleanfalse\force@deferlist@sw}{}%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\@fltovf}
+% \begin{macro}{\@fltstk}
+% The \LaTeX\ kernel error message \cmd\@fltovf\ may now be a bit more helpful to the user;
+% likewise for the \cmd\@fltstk\ message of \classname{ltxgrid}.
+% \begin{macrocode}
+\gdef\@fltovf{%
+ \@latex@error{%
+ Too many unprocessed floats%
+ \force@deferlist@sw{}{; try class option [floatfix]}%
+ }\@ehb
+}%
+\def\@fltstk{%
+ \@latex@warning{%
+ A float is stuck (cannot be placed)%
+ \force@deferlist@sw{}{; try class option [floatfix]}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ltxgrid@info@sw}
+% \begin{macro}{\outputdebug@sw}
+% The two options \classoption{ltxgridinfo} and \classoption{outputdebug} turn on informative diagnostics within the
+% package \classname{ltxgrid}. Only people who really want to see this output will select these class options.
+% Consult documentation for the \classname{ltxgrid} package to see what output the related switches enable.
+% \begin{macrocode}
+\DeclareOption{ltxgridinfo}{\@booleantrue\ltxgrid@info@sw}%
+\DeclareOption{outputdebug}{\@booleantrue\outputdebug@sw}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Option to relax page height}%
+%
+% The \classname{ltxgrid} package can set text pages to their natural height or force them to the full
+% text height; the latter is the default.
+% If setting the pages with a variable length,
+% the running foot will move up or down with the natural length of the text column.
+% While I recommend against doing so, this option will turn that switch to the latter setting.
+% \begin{macrocode}
+\DeclareOption{raggedfooter}{\@booleanfalse\textheight@sw}%
+\DeclareOption{noraggedfooter}{\@booleantrue\textheight@sw}%
+% \end{macrocode}
+%
+% \subsection{Selecting procedure for processing abstract}%
+%
+% There are two different procedures for processing an abstract; the options
+% \classoption{newabstract} and \classoption{oldabstract} determine which one the user
+% prefers. At present, the default is to use the old, but this may change.
+% \begin{macrocode}
+\DeclareOption{newabstract}{\@booleanfalse\oldabstract@sw}%
+\DeclareOption{oldabstract}{\@booleantrue \oldabstract@sw}%
+\appdef\class@inithook{%
+ \@ifxundefined\oldabstract@sw{\@booleanfalse\oldabstract@sw}{}%
+ \oldabstract@sw{%
+ \let@environment{abstract}{abstract-old}%
+ }{}%
+}%
+% \end{macrocode}
+%
+%
+%
+%
+% \subsection{Default Option}%
+%
+% The default handling for a document class option is to
+% treat it as the name of a society and
+% hunt for a corresponding \file{.rtx} file to read in.
+% This behavior is much like the \LaTeX2.09 handling, where
+% one looked for a \file{.sty} file, except that
+% in this case, we must catch the case where multiple
+% unknown options are declared.
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \IfFileExists{\CurrentOption\substyle@ext}{%
+ \expandafter\change@society\expandafter{\CurrentOption}%
+ }{%
+ \OptionNotUsed
+ }%
+}%
+\def\substyle@ext{.rtx}%
+\AtEndOfClass{%
+ \@ifxundefined\@society{%
+ \class@warn{No Society specified, using generic APS style}%
+ \def\@society{aps}\def\@journal{}%
+ }{}%
+ \expandafter\input\expandafter{\@society\substyle@ext}%
+}%
+% \end{macrocode}
+%
+% \subsection{Class-Asserted Options}%
+% \changes{v4.0beta 2}{1999/06/20}
+% {%
+% Removed invocation of nonexistent class option \protect\classoption{groupauthors}
+% and all other class options that should only be invoked by the document.
+% (Otherwise precedence of class options does not work.)
+% }
+% Here we establish the default document class options.
+% Those of the document itself will override these.
+% \begin{macrocode}
+\ExecuteOptions{10pt}
+% \end{macrocode}
+%
+% \subsection{Execute Options}%
+% The document class options are processed in the order
+% they are declared in this document class file.
+%
+% Precedence is established in the following way:
+%
+% First, the single \file{.rtx} file is read in.
+% It may set values to any of the Booleans that represent class options,
+% and it may elect to do so only if that Boolean is undefined, signifying
+% that its corresponding document class options were absent from
+% the document's option list.
+% In this way correct precedence of class options is maintained.
+%
+% Second, the type size option is acted upon. Type size code
+% should not require altering the values of any of the Booleans carrying
+% class options.
+%
+% Next, at \cmd\AtEndOfClass\ time, certain packages are read in.
+%
+% Finally, at \cmd\AtBeginDocument\ time, the state of the Booleans determines
+% how the formatting will go.
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+%
+% \section{Procedures Dependent Upon Options}
+%
+% Here we introduce \classname{classes.dtx} definitions for
+% the page styles that people will expect to be able to use.
+% \begin{macro}{\ps@headings}
+% \begin{macro}{\ps@myheadings}
+% \begin{macrocode}
+ \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}}}%
+\def\ps@myheadings{%
+ \let\@oddfoot\@empty\let\@evenfoot\@empty
+ \def\@evenhead{\thepage\hfil\slshape\leftmark}%
+ \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ps@article@twoside}
+% \begin{macro}{\ps@article@oneside}
+% \begin{macro}{\ps@preprint}
+% \changes{v4.e}{1998/01/31}
+% {Move after process options, so the following test works}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Defer decision until \cs{AtBeginDocument} time}
+% \changes{v4.0beta 3}{1999/11/13}
+% {Insert procedure \cs{checkindate}}
+% \changes{v4.0rc1}{2001/06/17}
+% {Running headers always as if two-sided}
+% \begin{macrocode}
+\def\ps@article{%
+ \@provide\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
+ \@provide\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
+ \@provide\@oddfoot{}%
+ \@provide\@evenfoot{}%
+ \let\@mkboth\markboth
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+}%
+\def\ps@article@final{%
+ \@provide\@evenhead{\let\\\heading@cr\thepage\quad\checkindate\hfil{\leftmark}}%
+ \@provide\@oddhead{\let\\\heading@cr{\rightmark}\hfil\checkindate\quad\thepage}%
+ \@provide\@oddfoot{}%
+ \@provide\@evenfoot{}%
+ \let\@mkboth\markboth
+ \def\sectionmark##1{%
+ \markboth{%
+ \MakeTextUppercase{%
+ \@ifnum{\c@secnumdepth >\z@}{\thesection\hskip 1em\relax}{}%
+ ##1%
+ }%
+ }{}%
+ }%
+ \def\subsectionmark##1{%
+ \markright {%
+ \@ifnum{\c@secnumdepth >\@ne}{\thesubsection\hskip 1em\relax}{}%
+ ##1%
+ }%
+ }%
+}%
+\appdef\class@inithook{%
+%\twoside@sw{%
+%}{%
+%}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\heading@cr{\unskip\space\ignorespaces}%
+% \end{macrocode}
+%
+% \changes{v4.0beta 3}{1999/11/13}
+% {Do not put by REVTeX in every page foot}
+% \changes{v4.0beta 3}{1999/11/13}
+% {Insert procedure \cs{checkindate}}
+% \begin{macrocode}
+\def\ps@preprint{%
+ \@provide\@oddfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \@provide\@evenfoot{\hfil\thepage\quad\checkindate\hfil}%
+ \@provide\@oddhead{}%
+ \@provide\@evenhead{}%
+ \let\@mkboth\@gobbletwo
+ \let\sectionmark\@gobble
+ \let\subsectionmark\@gobble
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\@oddhead\@undefined
+\let\@evenhead\@undefined
+\let\@oddfoot\@undefined
+\let\@evenfoot\@undefined
+\AtEndOfClass{%
+ \appdef\class@documenthook{%
+ \@provide\@oddhead{}%
+ \@provide\@evenhead{}%
+ \@provide\@oddfoot{}%
+ \@provide\@evenfoot{}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\lastpage@putlabel}
+% Support the default meaning of \cmd\@endpage.
+% \changes{v4.d}{1998/01/31}
+% {Move after process options, so \cs{clearpage} not in scope of
+% twocolumn}
+% Name of this macro (and the \cmd\label\ key) taken from
+% \url{CTAN:/macros/latex/contrib/other/lastpage}%
+% with code optimised slightly.
+% \begin{macrocode}
+\def\lastpage@putlabel{%
+ \if@filesw
+ \begingroup
+ \advance\c@page\m@ne
+ \immediate\write\@auxout{\string\newlabel{LastPage}{{}{\thepage}}}%
+ \endgroup
+ \fi
+}%
+% \end{macrocode}
+% Install a late hook into \cmd\class@enddocumenthook\ that
+% labels the last page of the document.
+% This is done just before the \file{.aux} file
+% is closed, and does not require a \cmd\shipout, because it writes
+% directly to the \file{.aux} file.
+% Note that we invoke \cmd\clearpage: this means that no more typesetting
+% should be done past this point.
+% CHECKME: are there any more things installed via
+% \cmd\AtEndOfClass\allowbreak\cmd\class@enddocumenthook?
+% \begin{macrocode}
+\AtEndOfClass{%
+ \appdef\clear@document{%
+ \clearpage
+ \lastpage@putlabel
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Required Packages}
+% \url{CTAN:macros/latex/contrib/other/misc/url.sty}%
+% \begin{macrocode}
+\RequirePackage{url}%
+% \end{macrocode}
+%
+% \section{Incompatible Packages}
+% Known to be incompatible are \classname{multicol} and \classname{cite}.
+% The former is incompatible with \classname{ltxgrid}, which replaces it.
+% The latter is incompatible with \classname{natbib}, which replaces its functionality.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \incompatible@package{cite}%
+ \incompatible@package{multicol}%
+}%
+% \end{macrocode}
+%
+% \section{Society- and Journal-Specific Code}
+%
+% \begin{macro}{\@journal}
+% Journal test helper, used as
+% \begin{verbatim}
+%\@ifx{\@journal\journal@pra}{%
+% <journal-specific setup>
+%\fi
+% \end{verbatim}
+% Journal code might like to further specify (if as yet undefined) or distinguish on
+% the following Booleans.
+%
+% Note: the journal substyle code should only alter the value of one of these Booleans if
+% the Boolean is \cmd\undefined. This convention is what makes the document's
+% options take precedence over the values set by the journal.
+%
+% FIXME: make this table an exhaustive listing of all the parameters set by
+% the class options.
+%
+% \begin{tabular}{ll}
+% \cmd\@pointsize &(10|11|12), depending on the type size\\
+% \cmd\footinbib@sw &true if footnotes are to be formatted in the bibliography\\
+% \cmd\preprintsty@sw &true for preprint and hyperpreprint\\
+% \cmd\eqsecnum@sw &true means that equations are numbered within sections\\
+% \cmd\secnumarabic@sw &true means the sections are to be numbered arabic\\
+% \cmd\groupauthors@sw &true means authors listed separately for each address\\
+% \cmd\preprint@sw &true means to produce the preprint numbers as part of the title block\\
+% \cmd\showPACS@sw &true means to produce the PACS as part of the title block\\
+% \cmd\showKEYS@sw &true means to produce the keywords as part of the title block\\
+% \cmd\@affils@sw &true means each affiliation is printed, for each author\\
+% \cmd\runinaddress@sw &true means author addresses are printed run-in\\
+% \cmd\draft@sw &true implies that PACS will be printed\\
+% \cmd\tightenlines@sw &true if preprint single spaced\\
+% \cmd\lengthcheck@sw &true if length checking is in effect\\
+% \cmd\byrevtex@sw &true means to announce ``typeset by \revtex''\\
+% \cmd\titlepage@sw &true for title is to be set on a separate page\\
+% \cmd\twocolumn@sw &true if two-column page grid\\
+% \cmd\twocolumn@sw &true if we are to automatically balance the columns of the last page\\
+% \cmd\twoside@sw &true means to format pages for duplex printing\\
+% \cmd\floats@sw &false means floats are migrated to end of document\\
+% \cmd\floatp@sw &true means endfloats are set one to a page\\
+% \cmd\class@amsfonts &if \cmd\@empty, means that \classname{amsfonts} will \emph{not} be loaded\\
+% \cmd\class@amssymb &if \cmd\@empty, means that \classname{amssymb} will \emph{not} be loaded\\
+% \cmd\frontmatter@footnote &if \cmd\undefined, means that the default (\cmd\footnote) will be used\\
+% \cmd\place@bibnumber &if \cmd\undefined, means that the default (inline) will be used\\
+% \end{tabular}
+%
+% Note: if \cmd\twocolumn@sw\ and \cmd\preprintsty@sw\ are both false,
+% then `galley' style is in effect. The \classoption{galley} option invokes
+% \classoption{onecolumn}, but does not affect the \cmd\preprintsty@sw.
+%
+% Note: \cmd\paperwidth\ and \cmd\paperheight\ are not integrated into this scheme,
+% and should be selected by the document alone.
+% \end{macro}
+%
+%
+% \section{Front Matter}
+%
+% \subsection{The title command}%
+%
+% \begin{macro}{\title}
+% \begin{macro}{\do@title}
+% The author uses \cmd\title\ to specify the title. As in the AMS
+% classes, \cmd\title\ has an optional argument specifying a short form
+% for use in running heads.
+%
+% Once the \cmd\title\ is given, you can specify any combination of
+% \cmd\thanks, \cmd\email, \cmd\homepage, and \cmd\altaffiliation\ commands,
+% applying to the title of the document.
+% \begin{macrocode}
+\renewcommand\title[2][]{%
+ \def\@title{#2}%
+ \def\@shorttitle{#1}%
+ \let\@AF@join\@title@join
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@title}
+% \begin{macro}{\@shorttitle}
+% The arguments to \cmd\title\ are saved in these internal
+% macros, which are set up to produce a warning if \cmd\title\ has not
+% been used before \cmd\maketitle.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \def\@title{\class@warn{No title}}%
+ \let\@shorttitle\@empty
+ \let\@title@aux\@title@aux@cleared
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@title@join}
+% \begin{macro}{\@title@join@}
+% \begin{macro}{\@title@aux@cleared}
+%
+% \begin{macrocode}
+\def\@title@join{\expandafter\@title@join@\@title@aux}%
+\def\@title@join@#1#2{%
+ \def\@title@aux{{\@join{\@separator}{#1}{#2}}}%
+}%
+\def\@title@aux@cleared{{}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{The author, affiliation, and related commands}%
+%
+% \begin{macro}{\c@affil}
+% A counter to store the affiliation numbers used for the
+% superscript marks. This command defines \cmd\theaffil.
+% \begin{macrocode}
+\newcounter{affil}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Commands for author or collaboration}%
+%
+% \begin{macro}{\author}
+% Each author is given in a \emph{separate} \cmd\author\ command.
+% This is similar to the AMS classes, but the AMS also try to support
+% the \classname{article} class's \cmd\and\ command for putting multiple
+% authors in one \cmd\author\ command.
+% \revtex, however, does not support the \cmd\and\ command.
+%
+% When the \cmd\author\ command is encountered, the previous author, author group, affiliation, and affiliation group are at an end.
+% This procedure moves the previous author to the author group (\cmd\move@AU),
+% moves the previous affiliation to the affiliation group (\cmd\move@AF),
+% and terminates the previous author/affiliation group (\cmd\move@AUAF) as the case may require.
+% \begin{macrocode}
+\renewcommand\author{% implicit #1
+ \@author@def{}% implicit #2
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\collaboration}
+% \begin{macro}{\@collaboration@}
+% Specify the collaboration (given after a group of authors).
+%
+% This procedure does exactly what \cmd\author\ does, and sets
+% a flag signifying that the \cmd\collaboration\ command was given.
+%
+% Note: earlier versions attempted to ignore the collaboration command if it was considered inappropriate.
+% We must not do this, however, because it throws the state machine out of kilter.
+% \begin{macrocode}
+\def\collaboration{% implicit #1
+ \groupauthors@sw{%
+ \class@warn{%
+ \string\collaboration\space is only allowed with superscriptaddress option.
+ Use superscriptaddress in place of groupedaddress, unsortedaddress, or runinaddress%
+ }%
+ }{}%
+ \@author@def{\@booleantrue\collaboration@sw}% implicit #2
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@author@init}
+% \begin{macro}{\@author@cleared}
+% \begin{macro}{\@authorclear@sw}
+% \begin{macro}{\@author@def}
+% \begin{macro}{\@author@join@}
+% \begin{macro}{\@author@join}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Change handling of \cs{@author} to prevent parsing problems.
+% (Helps in error recovery when syntax errors exist)}
+%
+% Here are all the access procedures for the author data structure.
+%
+% We define a flag value for \cmd\@author (private),
+% a procedure for setting \cmd\@author\ to the flag value (\cmd\@author@init),
+% a Boolean to test against the flag value (\cmd\@authorclear@sw),
+% and a procedure to add new ancillary data to the author.
+% \begin{macrocode}
+\def\@author@cleared{{}{}}%
+\def\@author@init{%
+ \let\@author\@author@cleared
+}%
+\def\@authorclear@sw{\@ifx{\@author\@author@cleared}}%
+\appdef\class@inithook{%
+ \@author@init
+}%
+\def\@author@def#1#2{%
+ \move@AU\move@AF\move@AUAF
+ \let\@AF@join\@author@join
+ #1%
+ \def\@author{{#2}{}}%
+}%
+\def\@author@join@#1#2#3{%
+ \def\@author{{#1}{\@join{\@separator}{#2}{#3}}}%
+}%
+\def\@author@join{\expandafter\@author@join@\@author}%
+\def\@author@gobble#1#2{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\move@AU}
+% Move the most recent author to the list of current authors.
+% If we recently did a \cmd\@author@init, this is a no-op.
+% If we recently encountered a \cmd\collaboration,
+% we preface the author with the \cmd\CO@opr \ intercollated operator,
+% otherwise we apply \cmd\AU@opr.
+% \begin{macrocode}
+\def\move@AU{%
+ \@authorclear@sw{}{%
+ \collaboration@sw{%
+ \expandafter\appdef
+ \expandafter\AU@grp
+ \expandafter{%
+ \expandafter \CO@opr
+ \@author
+ }%
+ }{%
+ \expandafter\appdef
+ \expandafter\AU@grp
+ \expandafter{%
+ \expandafter \AU@opr
+ \@author
+ }%
+ }%
+ }%
+ \@author@init
+ \@booleanfalse\collaboration@sw
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@author@finish}
+% We define a procedure to terminate author/affiliation parsing just before the title block is formatted.
+% We detect the case where an author group is not followed by an affiliation group.
+% \changes{v4.0beta 6}{2001/02/13}
+% {Actually append AU@grp to @AAClist.}
+%
+% We first finish off any author- or affiliation groups in progress.
+% Next, we detect the case where there is an author group in progress, but no affiliation group.
+% If so, we emit a diagnositic message and act as if a \cmd\noaffiliation\ command had been given.
+% In any case, we finish off any author/affiliation pair that may remain.
+% Formatting of the title block may now proceed.
+% \begin{macrocode}
+\def\@author@finish{%
+ \move@AU\move@AF
+ \@ifx{\AU@grp\@empty}{}{%
+ \@ifx{\AF@grp\@empty}{%
+ \begingroup
+ \let\href\@secondoftwo
+ \let\AU@opr\@firstoftwo
+ \let\CO@opr\@firstoftwo
+ \class@warn{Assuming \string\noaffiliation\space for \AU@grp}%
+ \endgroup
+ \begingroup\@affiliation{\blankaffiliation}%\endgroup in \@affiliation
+ \move@AF
+%
+% \appdef \@AAC@list{\AF@opr}%
+% \appdef@eval\@AAC@list{\AF@grp}%
+% \appdef@e \@AAC@list{\AU@grp}%
+% \let\AU@grp\@empty
+% \let\AF@grp\@empty
+ }{}%
+ }%
+ \move@AUAF
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@join}
+% The procedure \cmd\@join\ inserts
+% a separator between two tokens, or, if the first token is
+% nil, elides both that token and the separator.
+% \begin{macrocode}
+\def\@join#1#2#3{%
+ \@if@empty{#2}{#3}{#2#1#3}%
+}%
+\def\@separator{;\space}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\surname}
+% \begin{macro}{\firstname}
+% No-op to allow better post-processing of the file.
+% \begin{macrocode}
+\let\surname\@firstofone
+\let\firstname\@firstofone
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\AU@grp}
+% The control sequence name \cmd\AU@grp\ accretes
+% consecutive \cmd\author\ entries (with \cmd\AU@opr\ as the intercollated operator)
+% and \cmd\collaboration\ entries (with \cmd\CO@opr\ as the intercollated operator).
+% Ultimately, its contents are appended to the author/affiliation list \cmd\@AAC@list.
+% It must be initialized to \cmd\@empty.
+%
+% Note on \cmd\AU@opr\ and \cmd\CO@opr: it is essential to treat these two operators to the greatest extent possible on an equal footing.
+% Therefore we invariably assign values to the pair of them within the same procedure.
+%
+% \begin{macrocode}
+\let\AU@grp\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\and}
+% The original \LaTeX\ idea of using one \cmd\author\ command to capture
+% all authors and their address just doesn't work with multiple authors
+% possibly sharing addresses, so in this class disable \cmd\and.
+% \begin{macrocode}
+\renewcommand\and{\class@err{\protect\and\space is not supported}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Commands for affiliation}%
+%
+% \begin{macro}{\affiliation}
+% After each group of authors with the same address,
+% give that address in \cmd\affiliation.
+% If later in the list you have an author
+% with the address of an earlier author, repeat the \cmd\affiliation\
+% command: the system will detect the similarity and (if using the \classoption{superscriptaddress} option) only print the
+% affiliation once, reusing the superscript marker.
+%
+% When the \cmd\affiliation\ command is encountered, the current author and author group (if any) are at an end.
+% Also, the current affiliation is at an end.
+%
+% FIXME: changes to catcode required elsewhere now?
+% \begin{macrocode}
+\def\cat@comma@active{\catcode`\,\active}%
+{\cat@comma@active\gdef,{\active@comma}}%
+\def\active@comma{,\penalty-300\relax}%
+\newcommand\affiliation{%
+ \move@AU\move@AF
+ \begingroup
+ \cat@comma@active
+ \@affiliation
+}%
+\def\@affiliation#1{%
+ \endgroup
+ \let\@AF@join\@affil@join
+ \@affil@def{#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\noaffiliation}
+% User-level command signifying that the current group of authors has \emph{no} affiliation.
+%
+% This is implemented by acting as if the \cmd\affiliation\ command has been given, and using a
+% flag value of \cmd\blankaffiliation, which \cmd\@affil@group\ can recognize as a no-op.
+% \begin{macrocode}
+\newcommand\noaffiliation{%
+ \move@AU\move@AF
+% \edef\AF@grp{\AF@grp}%
+ \begingroup\@affiliation{\blankaffiliation}%
+% \move@AF
+}%
+\def\blankaffiliation{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@cleared}
+% \begin{macro}{\@affil@init}
+% \begin{macro}{\@affilclear@sw}
+% \begin{macro}{\@affil@def}
+% \begin{macro}{\@affil@join@}
+% \begin{macro}{\@affil@join}
+%
+% Here are all the access procedures for the affiliation data structure.
+% Note the similarity to those of the \cmd\@author\ data structure.
+%
+% We define a flag value for \cmd\@affil\ (private),
+% a procedure for setting \cmd\@affil\ to the flag value (\cmd\@affil@init),
+% a Boolean to test against the flag value (\cmd\@affilclear@sw),
+% and a procedure to add new ancillary data to the affiliation.
+% \begin{macrocode}
+\def\@affil@cleared{{}{}}%
+\def\@affil@init{%
+ \let\@affil\@affil@cleared
+}%
+\def\@affilclear@sw{\@ifx{\@affil\@affil@cleared}}%
+\appdef\class@inithook{%
+ \@affil@init
+}%
+\def\@affil@def#1{\def\@affil{{#1}{}}}%
+\def\@affil@join@#1#2#3{%
+ \def\@affil{{#1}{\@join{\@separator}{#2}{#3}}}%
+}%
+\def\@affil@join{\expandafter\@affil@join@\@affil}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\move@AF}
+% Move the most recent affiliation to the affiliation group.
+% If we recently did a \cmd\@affil@init, this is a no-op.
+% \begin{macrocode}
+\def\move@AF{%
+ \@affilclear@sw{}{%
+% \end{macrocode}
+% Set the \cmd\temp@sw\ to false, then execute the affiliation list (\cmd\@AFF@list)
+% with the intercollated operator set to \cmd\@affil@match\
+% and with \cmd\@tempa\ holding the first component of \cmd\@affil, the current affiliation, which is to be matched.
+% If the current affiliation has been seen before, \cmd\temp@sw\ will be set to true,
+% \cmd\@tempc\ will be set to the existing affiliation number,
+% and \cmd\@tempd\ will be set to the affiliation's ancillary data.
+% The Boolean \cmd\@affils@sw\ being false prevents this test from ever returning a positive result.
+%
+% This procedure uses \cmd\@tempa\ and sets \cmd\@tempc, \cmd\@tempd, and \cmd\temp@sw.
+% \begin{macrocode}
+ \@booleanfalse\temp@sw
+ \let\@tempd\@empty
+ \@affils@sw{%
+ \expandafter\@firstoftwodef\expandafter\@tempa\@affil
+ \def\AFF@opr{\@affil@match\@tempa}%
+ \@AFF@list
+ }{}\temp@sw
+% \end{macrocode}
+% True clause: This affiliation has been seen before.
+% If ancillary data for the affiliation have been given but are not identical to those seen before, give a warning.
+% \begin{macrocode}
+ {%
+ \expandafter\@secondoftwodef\expandafter\@tempb\@affil
+ \@ifx{\@tempb\@empty}{}{%
+ \@ifx{\@tempb\@tempd}{}{%
+ \class@warn{%
+ Ancillary information for \@tempa\space must not be different!
+ Please put it on the first instance%
+ }%
+ }%
+ }%
+ \appdef@eval\AF@grp\@tempc
+ }%
+% \end{macrocode}
+% False clause: This is a new address:
+% increment the counter to get a unique ID for the new affiliation
+% and append the new number, address, and footnote to the list \cmd\@AFF@list.
+% \begin{macrocode}
+ {%
+ \@if@empty{\expandafter\@firstoftwo\@affil}{%
+ \edef\@tempc{\z@}%
+ }{%
+ \stepcounter{affil}%
+ \edef\@tempc{\theaffil}%
+ }%
+ \appdef \@AFF@list{\AFF@opr}%
+ \appdef@eval\@AFF@list\@tempc
+ \appdef@e \@AFF@list{\@affil}%
+ \appdef@eval\AF@grp\@tempc
+ }%
+% \end{macrocode}
+% Append the ID of the affiliation to the affiliation group of the current author group.
+% \begin{macrocode}
+ \@affil@init
+ }%
+}%
+\def\@firstoftwodef#1#2#3{%
+ \def#1{#2}%
+}%
+\def\@secondoftwodef#1#2#3{%
+ \def#1{#3}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\move@AUAF}
+% \changes{v4.h}{1998/06/25}
+% {Changes to support groups of affiliations}
+% Append \cmd\AF@grp\ and \cmd\AU@grp\ to \cmd\@AAC@list\ %
+% and merge any new \cmd\AF@grp\ to \cmd\@AFG@list.
+% \begin{macrocode}
+\def\move@AUAF{%
+% \end{macrocode}
+% Entire procedure is predicated on something non-trivial to move.
+%
+% If both author and affiliation are nil, bail out.
+%
+% No, try that again:
+%
+% If we have seen any affiliations, then it is time to move the current
+% affiliation group and author group to \cmd\@AAC@list.
+% If not, we are picking up authors into an author group, and we
+% should bail out.
+% \begin{macrocode}
+%\@ifx{\AU@grp\@empty}{\@ifx{\AF@grp\@empty}{\true@sw}{\false@sw}}{\false@sw}%
+ \@ifx{\AF@grp\@empty}%
+ {}{%
+% \end{macrocode}
+% First, append current affiliation group (expansion of \cmd\AF@grp)
+% to the author/affiliation list (\cmd\@AAC@list),
+% using \cmd\AF@opr\ as the intercollated operator;
+% also append the current authors (\cmd\AU@grp).
+% \begin{macrocode}
+ \appdef \@AAC@list{\AF@opr}%
+ \appdef@eval\@AAC@list{\AF@grp}%
+ \appdef@e \@AAC@list{\AU@grp}%
+% \end{macrocode}
+% Next, append the current affiliation group to \cmd\@AFG@list,
+% (if it is not already there)
+% using \cmd\AFS@opr\ as the intercollated operator.
+%
+% Note that \cmd\@AFG@list\ is a list of \emph{unique} affiliation groups.
+% \begin{macrocode}
+ \@ifx{\@empty\AU@grp}{}{%
+ \@ifx{\@empty\AF@grp}{}{%
+ \@booleanfalse\temp@sw
+ \def\AFS@opr{\x@match\AF@grp}%
+ \@AFG@list
+ \temp@sw{}{%
+ \appdef \@AFG@list{\AFS@opr}%
+ \appdef@eval\@AFG@list{\AF@grp}%
+ }%
+ }%
+ }%
+% \end{macrocode}
+% Finally, null out the macros holding the author group and affiliation group, respectively.
+% \begin{macrocode}
+ \let\AU@grp\@empty
+ \let\AF@grp\@empty
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@AAC@list}
+% The \cmd\@AAC@list\ macro accretes
+% authors (using \cmd\AU@opr\ as the intercollated operator),
+% collaborations (using \cmd\CO@opr\ as the intercollated operator),
+% and
+% affiliations (using \cmd\AF@opr\ as the intercollated operator).
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \let\@AAC@list\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@AFG@list}
+% The macro \cmd\@AFG@list\ accretes \cmd\AF@grp,
+% with \cmd\AFS@opr\ as the intercollated operator.
+%
+% This token list is employed when and only when \classoption{groupedaddress} is in effect.
+%
+% It must be empty at the beginning of the document.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \let\@AFG@list\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@AFF@list}
+% The macro \cmd\@AFF@list\ accretes the list of affiliations
+% with \cmd\AFF@opr\ as the intercollated operator.
+% It must be empty at the beginning of the document.
+%
+% Each \cmd\affiliation\ command in the document contributes
+% to this list, as long as the argument of that instance of the command
+% is ``new''.
+%
+% Each entry in this list consists of the \cmd\AFF@opr\ intercollated operator
+% followed by three brace-delimited tokens, representing, in order:
+% \begin{enumerate}
+% \item
+% the affiliation's unique ID, a number increasing monotonically for
+% each new entry,
+% \item
+% the optional argument of the \cmd\affiliation\ command,
+% the footnote to the affiliation, and
+% \item
+% the text of the affiliation.
+% \end{enumerate}
+%
+% At various junctures in the code, the control sequence name
+% \cmd\AFF@opr\ assumes the meaning of
+% \cmd\@affil@footnote\ (FIXME: never used),
+% \cmd\@affil@group, \cmd\affil@script,
+% or is defined to expand to \cmd\@affil@match\cmd\@tempa.
+% and the list \cmd\@AFF@list\ is expanded.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \let\@AFF@list\@empty
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AF@grp}
+% The macro \cmd\AF@grp\ accretes affiliation IDs into an affiliation group.
+% It must be empty at the beginning of the document.
+% \begin{macrocode}
+\let\AF@grp\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@match}
+% The definition for the \cmd\AFF@opr, the intercollated operator for \cmd\@AFF@list,
+% when adding a new affiliation: seeks a match with any earlier affiliation.
+% When the affiliation list is executed, this procedure tests each entry against
+% the `new' affiliation (which has been stored in \cmd\@tempa).
+%
+% Uses \cmd\temp@sw, \cmd\@tempc, and \cmd\@tempd\ to communicate back:
+% if it returns \cmd\temp@sw\ true, a match was found,
+% then \cmd\@tempc\ will be the footnote number of the matching entry
+% and \cmd\@tempd\ will be the auxiliary information of the matching entry.
+% \begin{macrocode}
+\def\@affil@match#1#2#3#4{%
+ \temp@sw{}{%
+ \def\@tempifx{#3}%
+ \@ifx{\@tempifx#1}{%
+ \@booleantrue\temp@sw
+ \def\@tempc{#2}%
+ \def\@tempd{#4}%
+ }{%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tempaffil@script}
+% Give a superscript marker to the address,
+% and junk the text argument (|#2|).
+% \begin{macrocode}
+%\def\@tempaffil@script#1#2{%
+% ,\,#1%
+%}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tempaffil@group}
+%
+% Execute if we are grouping authors above `main addresses' (\classoption{groupedaddress}).
+% Put temp address in a footnote, with explanatory text.
+% Note: this procedure uses \cmd\@tempb\ and \cmd\@tempc\
+% to communicate to \cmd\AFF@opr.
+% \begin{macrocode}
+%\def\@tempaffil@group#1#2{%
+% \def\@tempc{#1}%
+% \def\@tempb{#2}%
+% \begingroup
+% \let\AFF@opr \@affil@footnote
+% \@AFF@list
+% \endgroup
+%}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@footnote}
+% The alias of \cmd\AFF@opr\ when \cmd\@AFF@list\
+% is executed by \cmd\@tempaffil@group.
+% If we find a match of the affiliation number to \cmd\@tempc,
+% then footnotes are formatted with the relevant content and \cmd\@tempb.
+% \begin{macrocode}
+%\def\@affil@footnote#1#2#3{%
+% \def\@tempifx{#1}%
+% \@ifx{\@tempifx\@tempc}{%
+% \comma@space
+% \expandafter\frontmatter@footnote\expandafter{\@tempb#2}%
+% \frontmatter@footnote{#3}%
+% }{%
+% }%
+%}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@AF@join}
+% The \cmd\csname\ \cmd\@AF@join\ is a procedure used within
+% \cmd\email, \cmd\homepage, \cmd\thanks, and \cmd\altaffiliation.
+% When such a command appears after an \cmd\author, \cmd\collaboration, or \cmd\affiliation
+% command, the \cmd\@AF@join\ procedure appends the argument given to the appropriate
+% macro.
+% Its default is to give an error message, since these commands are legal only within
+% the particular context mentioned.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \let\@AF@join\@AF@join@error
+}%
+\def\@AF@join@error#1{%
+ \class@warn{%
+ \string\email, \string\homepage, \string\thanks, or \string\altaffiliation\space
+ appears in wrong context.
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Commands for auxiliary information}%
+%
+% \begin{macro}{\email}
+% Just tacks the email address on to the current author or affiliation.
+% \begin{macrocode}
+\def\sanitize@url{%
+ \@makeother\%%
+ \@makeother\~%
+ \@makeother\_%
+}%
+\newcommand*\email[1][Electronic address: ]{\begingroup\sanitize@url\@email{#1}}%
+\def\@email#1#2{%
+ \endgroup
+ \@AF@join{#1\href{mailto:#2}{#2}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\homepage}
+% Just tacks the URL on to the current author or affiliation.
+% Note: group opened in \cmd\homepage\ is closed in \cmd\@homepage.
+% \begin{macrocode}
+\newcommand*\homepage[1][URL:~]{\begingroup\sanitize@url\@homepage{#1}}%
+\def\@homepage#1#2{%
+ \endgroup
+ \@AF@join{#1\url{#2}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\url}
+% \begin{macro}{\href}
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \providecommand\url{\texttt}%
+ \providecommand\href[2]{\url{#2}}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thanks}
+%
+% The operative version of \cmd\thanks\ appends an item to \cmd\@author, or \cmd\@affil's auxiliary data.
+% \begin{macrocode}
+\def\thanks{% implicit #1
+ \@AF@join
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\altaffiliation}
+% \changes{v4.d}{1998/01/31}
+% {change name from \cs{tempaffiliation}}
+% \changes{v4.l}{1998/09/01}
+% {add optional argument handling back}
+% Implemented more or less like \cmd\thanks\ but shares the affiliation
+% counter.
+% Optional argument may be used to give explanatory text eg
+% `currently staying at'
+% This will be placed before the address, if used in a footnote.
+% \begin{macrocode}
+\newcommand*\altaffiliation[2][]{%
+ \@AF@join{#1#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Procedures for author, collaboration, and affiliation}%
+%
+% Macros that list off, say, authors, and which require punctuation, like ``A, B, and C'', will use
+% \cmd\set@listcomma@list, \cmd\set@listcomma@count, \cmd\@listand, and \cmd\@listcomma.
+% These macros use the \cmd\@tempcnta\ register to keep track of how many items remain to be listed off.
+%
+% At present, \cmd\@author@present\ will decrement that counter.
+%
+% \begin{macro}{\set@listcomma@list}
+% \begin{macro}{\set@listcomma@count}
+% \changes{v4.l}{1998/09/01}
+% {macro added}
+% Pop the author count for this collaboration.
+%
+% Note: by side effect, it assigns \cmd\@listcomma:
+% for a list of length two, suppress comma addition.
+% \begin{macrocode}
+\def\set@listcomma@list#1{%
+ \expandafter\@reset@ac\expandafter#1#1{0}\@reset@ac{%
+ \let\@listcomma\relax
+ }{%
+ \let\@listcomma\@listcomma@comma
+ }%
+}%
+\def\set@listcomma@count#1{%
+ \@ifnum{#1=\tw@}{%
+ \let\@listcomma\relax
+ }{%
+ \let\@listcomma\@listcomma@comma
+ }%
+}%
+% \end{macrocode}
+% Does the actual pop operation, then generates a Boolean which selects one of the two assignments for \cmd\@listcomma.
+%
+% Note: this procedure sets \cmd\@tempcnta\ to reflect the number of items to list off.
+% \begin{macrocode}
+\def\@reset@ac#1#2#3\@reset@ac{%
+ \def#1{#3}%
+ \@tempcnta#2\relax
+ \@ifnum{#2=\tw@}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\listand}
+% Might need extending with penalties etc.
+%
+% Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
+% \begin{macrocode}
+\def\@listand{\@ifnum{\@tempcnta=\tw@}{\andname\space}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@listcomma}
+% This definition, with \cmd\@ne\ puts a comma before and.
+%
+% David Carlisle says: In UK English (at least) would have \cmd\tw@\ here,
+% which would then implement the convention of indicating conjunction with comma or ``and'', but not both.
+%
+% Note: this procedure expects \cmd\@tempcnta\ to reflect the current number of items remaining to list off.
+% \begin{macrocode}
+\def\@listcomma@comma{\@ifnum{\@tempcnta>\@ne}{,}{}}%
+\def\@listcomma@comma@UK{\@ifnum{\@tempcnta>\tw@}{,}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@collaboration@err}
+% This command will be executed if are in a \classoption{groupedaddress} situation and
+% the document contained a \cmd\collaboration\ command.
+%
+% There already has been issued a warning message explaining that \cmd\collaboration\ is wrong in this case,
+% so here we simply gobble.
+% \begin{macrocode}
+\def\@collaboration@err#1#2{%
+%\class@warn{An illegal \string\collaboration\ command has been entered!}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doauthor}
+% Main control over how authors are typeset.
+%
+% |#1| is loaded by \cmd\author
+%
+% |#2| is loaded by \cmd\email, \cmd\homepage, \cmd\altaffiliation, or \cmd\thanks
+%
+% |#3| is the superscript affiliation, if at all used.
+%
+% First, the author name is formatted, followed by a comma,
+% then come any marks relating to affiliation (if present),
+% then come the homepage URL and email address, if any, with
+% appropriate punctuation.
+% \begin{macrocode}
+\def\doauthor#1#2#3{%
+ \ignorespaces#1\unskip\@listcomma
+ \def\@tempifx{#3}%
+ \@ifx{\@tempifx\@empty}{%
+ \def\@tempifx{#2}%
+ \@ifx{\@tempifx\@empty}{}{\frontmatter@footnote{#2}}%
+ }{%
+ #3%
+ \def\@tempifx{#2}%
+ \@ifx{\@tempifx\@empty}{}{\comma@space\frontmatter@footnote{#2}}%
+ }%
+ \space \@listand
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AF@opr}
+% DPC: The number(s) associated to the affiliation address(es).
+% \end{macro}
+%
+% \begin{macro}{\@thanks}
+% \changes{v4.d}{1998/01/31}
+% {\cs{comma@space} added}
+% Society-specific options may change this. \cmd\comma@space\ is a separator
+% between adjacent footnotes.
+% \begin{macrocode}
+\def\@thanks{\comma@space\footnote}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\x@match}
+% Procedure \cmd\x@match\ is used as an alias \cmd\AFS@opr,
+% probing the list of affiliation groups
+% and setting a Boolean if a match is found to \#1 (usually the current affiliation group).
+%
+% Procedure \cmd\y@match\ is used as an alias to \cmd\@TBN@opr,
+% probing the list of unique title block footnotes for a match to the footnote text:
+% when the first match is found it sets a Boolean,
+% defining \cmd\@tempb\ to the number of that footnote.
+% \begin{macrocode}
+\def\x@match#1#2{%
+ \temp@sw{}{%
+ \def\@tempifx{#2}%
+ \@ifx{\@tempifx#1}{%
+ \@booleantrue\temp@sw
+ }{%
+ }%
+ }%
+}%
+\def\y@match#1#2#3{%
+ \temp@sw{}{%
+ \def\@tempifx{#3}%
+ \@ifx{\@tempifx#1}{%
+ \@booleantrue\temp@sw
+ \def\@tempb{#2}%
+ }{%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@footnote}
+% Used when typesetting a title block footnote.
+% (Item 290: merge duplicates.)
+%
+% Maintains a list of frontmatter footnotes along with associated device.
+% Uniquifies each footnote by traversing the list and looking for a match to the footnote text.
+% If found, define \cmd\@tempb\ to the corresponding footnote device, and typeset it with \cmd\@footnotemark.
+% If never found, manually increment footnote counter,
+% determine the corresponding footnote device, and
+% add footnote text and device to the list of frontmatter footnotes.
+%
+% The list \cmd\@FMN@list\ is processed later in the title block production.
+%
+% Note that this method of making footnotes runs afoul of \classname{hyperref}'s patches of the \LaTeX\ kernel.
+% Therefore, we avoid trouble by refraining from using \cmd\@footnotemark\ and by creating our own hypertext links.
+% \begin{macrocode}
+\def\frontmatter@footnote#1{%
+ \begingroup
+ \@booleanfalse\temp@sw
+ \def\@tempa{#1}%
+ \let\@tempb\@empty
+ \def\@TBN@opr{\y@match\@tempa}%
+ \@FMN@list
+ \temp@sw{%
+ \expandafter\frontmatter@footnotemark
+ \expandafter{\@tempb}%
+ }{%
+ \stepcounter\@mpfn
+ \protected@xdef\@tempb{\the\csname c@\@mpfn\endcsname}%
+ \expandafter\frontmatter@footnotemark
+ \expandafter{\@tempb}%
+ \expandafter\g@addto@macro
+ \expandafter\@FMN@list
+ \expandafter{%
+ \expandafter \@TBN@opr
+ \expandafter {\@tempb}{#1}%
+ }%
+ }%
+ \endgroup
+}%
+\appdef\class@inithook{%
+ \global\let\@FMN@list\@empty
+}%
+\def\frontmatter@footnotemark#1{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ \begingroup
+ \hyper@linkstart {link}{frontmatter@#1}%
+ \csname c@\@mpfn\endcsname#1\relax
+ \def\@thefnmark{\thempfn}%
+ \@makefnmark
+ \hyper@linkend
+ \endgroup
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{The keywords command}%
+% \begin{macro}{\keywords}
+% \begin{macro}{\@keywords}
+% Usual game, save text in a macro for processing by \cmd\maketitle.
+% \begin{macrocode}
+\def\keywords#1{%
+ \aftermaketitle@chk{\keywords}%
+ \gdef\@keywords{#1}%
+}%
+\def\@keywords{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{The \cs{date} command and related commands}%
+% \begin{macro}{\date}
+% \begin{macro}{\received}
+% \begin{macro}{\revised}
+% \begin{macro}{\accepted}
+% \begin{macro}{\published}
+% \begin{macro}{\@date}
+% \begin{macro}{\@received}
+% \begin{macro}{\@revised}
+% \begin{macro}{\@accepted}
+% \begin{macro}{\@published}
+% Use the \cmd\date\ command to specify the document date,
+% the \cmd\received\ command to specify the date received,
+% \cmd\revised\ for date revised,
+% \cmd\accepted\ for date accepted, and
+% \cmd\published\ for date published.
+% Normally only \cmd\date\ to be used by author,
+% the remainder used only by editors.
+%
+% DPC: As for \cmd\keywords, but this time don't flag a warning if there is no
+% revision date specified.
+%
+% In each case the user-level command defines the value of a
+% macro which buffers the data entered by the user.
+% For instance, \cmd\received\ causes \cmd\@received\ to
+% acquire a value.
+% The optional argument allows the user to override the
+% text that will be typeset along with the date;
+% the default value of that text is itself
+% a localized macro.
+% \begin{macrocode}
+\renewcommand*\date[2][\Dated@name]{\def\@date{#1#2}}%
+\def\@date{}%
+\newcommand*\received[2][\Received@name]{\def\@received{#1#2}}%
+\def\@received{}%
+\newcommand*\revised[2][\Revised@name]{\def\@revised{#1#2}}%
+\def\@revised{}%
+\newcommand*\accepted[2][\Accepted@name]{\def\@accepted{#1#2}}%
+\def\@accepted{}%
+\newcommand*\published[2][\Published@name]{\def\@published{#1#2}}%
+\def\@published{}%
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{The pacs command}%
+% PACS, the Physics and Astronomy Classification Scheme.
+% \begin{macro}{\pacs}
+% \begin{macro}{\@pacs}
+% As for \cmd\keywords\
+% \begin{macrocode}
+\def\pacs#1{%
+ \aftermaketitle@chk{\pacs}%
+ \gdef\@pacs{#1}%
+}%
+\def\@pacs{}%{\class@warn{No PACS numbers}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{The \cs{preprint} command}
+%
+% \changes{v4.g}{1998/06/10}
+% {multiple preprint commands}
+% \begin{macrocode}
+\def\preprint#1{\gappdef\@preprint{\preprint{#1}}}%
+\let\@preprint\@empty
+% \end{macrocode}
+%
+% \subsection{draft}
+% DPC: Name clash with draft option. \LaTeX\ doesn't care, but it confuses me.
+%
+% This command is a 3.1 relic, now removed.
+% \begin{macrocode}
+%\newcommand\draft{\@booleantrue\draft@sw}%
+% \end{macrocode}
+%
+% \subsection{The \env{abstract} environment}%
+%
+% \changes{v4.0beta 2}{1999/06/20}
+% {Gathered all code for the abstract environment together
+% and abstracted out the formatting details for journals to override.}
+%
+% \begin{macro}{\absbox}
+%
+% \begin{macrocode}
+\newbox\absbox
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{abstract}
+% Abstract, as in AMS classes, must be specified \emph{before}
+% \cmd\maketitle. It just saves everything up in \cmd\absbox.
+% \changes{v4.d}{1998/01/31}
+% {If empty \cs{abstractname} omit spacing}
+% \begin{macrocode}
+% \changes{v4.e}{1998/01/31}
+% {hookify}
+% Note that the specifics of how the abstract is to be
+% formatted are set by \cmd\frontmatter@abstractwidth,
+% \cmd\frontmatter@abstractheading, and \cmd\frontmatter@abstractfont.
+%
+% Here we wish to set the abstract into type but save it away in a box, much like
+% the \cmd\minipage\ command does.
+%
+% Note that the \cmd\endabstract\ portion of the environment
+% begins with code that mostly duplicates \cmd\endminipage, but without the \cmd\@iiiparbox.
+% At the end, we simply transfer the contents of the \cmd\minipage\
+% into a box of our own.
+%
+% However, we also have to end the gratuitous
+% paragraph begun by \cmd\minipage.
+% We ensure that no trace of that paragraph is left,
+% by absorbing the \cmd\parindent\ box.
+% Doing so destroys the paragraph entirely, except
+% for the \cmd\parskip\ glue, and that morsel is pruned, because we are at the top
+% of a page.
+%
+% This mechanism is vulnerable, however, because anything placed into the horizontal list
+% after the \cmd\parindent\ box will confound it.
+% And that is exactly what happens under Mik\TeX:
+% There seems to be an extension to the \TeX\ standard operating here which inserts a \cmd\special \ at the beginning of every paragraph.
+% (The mechnism is \emph{not} based on \cmd\everypar.)
+%
+% To accomodate this state of affairs,
+% we have a new mechanism that offers an even more complete rewrite of \env{minipage}.
+%
+% The user can elect to use this new mechanism via the \classoption{newabstract};
+% likewise the old mechanism via the \classoption{oldabstract}.
+%
+% \begin{macrocode}
+\newenvironment{abstract}{%
+ \aftermaketitle@chk{\begin{abstract}}%
+ \global\setbox\absbox\vbox\bgroup
+ \color@begingroup
+ \columnwidth\textwidth
+ \hsize\columnwidth
+ \@parboxrestore
+ \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@
+ \let\@footnotetext\frontmatter@footnotetext
+ \minipagefootnote@init
+ \let\@listdepth\@mplistdepth \@mplistdepth\z@
+ \@minipagerestore
+ \@setminipage
+ \frontmatter@abstractheading
+ \frontmatter@abstractfont
+ \let\footnote\mini@note
+}{%
+ \par
+ \unskip
+ \minipagefootnote@here
+ \@minipagefalse %% added 24 May 89
+ \color@endgroup
+ \egroup
+}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\frontmatter@footnotetext}
+% We reimplement \cmd\@mpfootnotetext\ under a new name (so as not to be overridden by the \classname{hyperref} package)
+% and extend it to accomodate hyperrefs.
+%
+% Note that this procedure is very like \classname{ltxutil}'s \cmd\mp@footnotetext, except that it
+% uses \texttt{p@mpfootnote} instead of \texttt{p@mpfootnote}, and
+% \cmd\frontmatter@makefntext\ instead of \cmd\@makefntext.
+%
+% \begin{macrocode}
+\long\def\frontmatter@footnotetext#1{%
+ \minipagefootnote@pick
+ \reset@font\footnotesize
+ \interlinepenalty \interfootnotelinepenalty
+ \splittopskip \footnotesep
+ \splitmaxdepth \dp \strutbox
+ \set@footnotewidth
+ \@parboxrestore
+ \protected@edef\@currentlabel{\csname p@mpfootnote\endcsname\@thefnmark}%
+ \color@begingroup
+ \frontmatter@makefntext{%
+ \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox
+ }%
+ \color@endgroup
+ \minipagefootnote@drop
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractheading}
+% The default abstract head; journals will override this procedure.
+% \begin{macrocode}
+\def\frontmatter@abstractheading{%
+ \begingroup
+ \centering\large
+ \abstractname
+ \par
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractfont}
+% The default type specification for the body of the abstract.
+% Journals will override this setting.
+% \begin{macrocode}
+\def\frontmatter@abstractfont{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractwidth}
+% The default setting is the full text width;
+% journals can override this setting.
+% \begin{macrocode}
+\def\frontmatter@abstractwidth{\textwidth}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstract@produce}
+% This procedure determines how the abstract is incorporated
+% into the title block. We split this out in anticipation
+% of the need to lift the limitation that the abstract not break over pages.
+%
+% If we are in preprint style, we provide an easy pagebreak point immediately above the abstract.
+% This means that the abstract will either fit entirely on the same page as the title block,
+% or it will start a page of its own (which may itself break onto a subsequent page if necessary).
+% \begin{macrocode}
+\def\frontmatter@abstract@produce{%
+ \par
+% \tracingall
+ \preprintsty@sw{%
+ \do@output@MVL{%
+ \vskip\frontmatter@preabstractspace
+ \vskip200\p@\@plus1fil
+ \penalty-200\relax
+ \vskip-200\p@\@plus-1fil
+ }%
+ }{%
+ \addvspace{\frontmatter@preabstractspace}%
+ }%
+% \leavevmode
+ \begingroup
+ \dimen@\baselineskip
+ \setbox\z@\vtop{\unvcopy\absbox}%
+ \advance\dimen@-\ht\z@\advance\dimen@-\prevdepth
+ \@ifdim{\dimen@>\z@}{\vskip\dimen@}{}%
+ \endgroup
+ \unvbox\absbox
+ \@ifx{\@empty\mini@notes}{}{\mini@notes\par}%
+% \par
+ \addvspace\frontmatter@postabstractspace
+% \showlists
+% \tracingplain
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@preabstractspace}
+% \begin{macro}{\frontmatter@postabstractspace}
+% Space above and space below abstract in title block
+% \begin{macrocode}
+\def\frontmatter@preabstractspace{.5\baselineskip}
+\def\frontmatter@postabstractspace{.5\baselineskip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+% \subsection{Formatting the title block}%
+%
+% \begin{environment}{titlepage}
+% This is \LaTeXe's \classname{article} class version,
+% with modifications.
+% \changes{v4.0beta 3}{1999/11/13}
+% {grid changes with ltxgrid}
+% \begin{macrocode}
+\newenvironment{titlepage}{%
+ \twocolumn@sw{\onecolumngrid}{\newpage}%
+ \thispagestyle{titlepage}%
+ \setcounter{page}\@ne
+}{%
+ \twocolumn@sw{\twocolumngrid}{\newpage}%
+ \twoside@sw{}{%
+ \setcounter{page}\@ne
+ }%
+}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\maketitle}
+% \changes{v4.d}{1998/01/31}
+% {hookify}
+% Put it all together to format the title block.
+% \begin{macrocode}
+\def\maketitle{%
+ \@author@finish
+ \title@column\titleblock@produce
+ \suppressfloats[t]%
+% \end{macrocode}
+% Now save some memory.
+% \begin{macrocode}
+ \let\and\relax
+ \let\affiliation\@gobble
+% \let\address\affiliation
+ \let\author\@gobble
+ \let\@AAC@list\@empty
+ \let\@AFF@list\@empty
+ \let\@AFG@list\@empty
+% \let\keywords\@gobble
+% \let\@keywords\@empty
+ \let\@AF@join\@AF@join@error
+ \let\email\@gobble
+ \let\@address\@empty
+ \let\maketitle\relax
+ \let\thanks\@gobble
+ \titlepage@sw{%
+ \vfil
+ \clearpage
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\titleblock@produce}
+% This procedure produces the title block.
+%
+% It effectively executes inside a group
+% and always returns us to vertical mode.
+%
+% Note: we assume that it is OK to set the footnote counter to zero at this point.
+% Is this a safe assumption?
+% \begin{macrocode}
+\def\titleblock@produce{%
+ \begingroup
+% \end{macrocode}
+% Special footnote version [of footnotes] for \cmd\thanks,
+% copied from \classname{article} class \cmd\maketitle.
+% \changes{v4.0beta 2}{1999/06/20}
+% {Set \cs{footnote} to \LaTeX\ standard version for this scope.}
+% \begin{macrocode}
+ \let\footnote\footnote@latex
+ \let\@makefnmark\@makefnmark@latex
+ \let\@footnotemark\@footnotemark@latex
+ \let\thefootnote\frontmatter@thefootnote
+% \let\@makefntext\frontmatter@makefntext
+ \global\c@footnote\z@
+ \let\@makefnmark\frontmatter@makefnmark
+ \frontmatter@setup
+ \thispagestyle{titlepage}\label{FirstPage}%
+% \end{macrocode}
+% Produce the title:
+% \begin{macrocode}
+ \frontmatter@title@produce
+% \end{macrocode}
+% Produce the author list:
+% \begin{macrocode}
+ \groupauthors@sw{%
+ \frontmatter@author@produce@group
+ }{%
+ \frontmatter@author@produce@script
+ }%
+% \end{macrocode}
+% Produce the dates:
+% \begin{macrocode}
+ \frontmatter@RRAPformat{%
+ \expandafter\produce@RRAP\expandafter{\@date}%
+ \expandafter\produce@RRAP\expandafter{\@received}%
+ \expandafter\produce@RRAP\expandafter{\@revised}%
+ \expandafter\produce@RRAP\expandafter{\@accepted}%
+ \expandafter\produce@RRAP\expandafter{\@published}%
+ }%
+% \end{macrocode}
+% Produce the abstract, PACS, and keywords, and end any paragraph.
+% \begin{macrocode}
+ \frontmatter@abstract@produce
+ \@pacs@produce\@pacs
+ \@keywords@produce\@keywords
+ \par
+ \frontmatter@finalspace
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@title@produce}
+% The default formatting procedure for the article title.
+% This procedure should take care of the vertical space below the title.
+%
+% Journals may override this procedure, but it is more likely that they will
+% use the hooks \cmd\frontmatter@title@above, \cmd\frontmatter@title@format, and \cmd\frontmatter@title@below.
+%
+% At this point, we patch into \cmd\let@mark\ so that the common markup idiom \cmd\\ is taken care of.
+% \begin{macrocode}
+\def\frontmatter@title@produce{%
+ \begingroup
+ \frontmatter@title@above
+ \frontmatter@title@format
+ \@title
+ \@ifx{\@title@aux\@title@aux@cleared}{}{%
+ \expandafter\frontmatter@footnote\expandafter{\@title@aux}%
+ }%
+ \par
+% \@ifx{\@shorttitle\@empty}{%
+% \markboth{\@title}{\@title}%
+% }{%
+% \markboth{\@shorttitle}{\@shorttitle}%
+%% \class@warn{Unused short title ignored}%
+% }%
+ \frontmatter@title@below
+ \endgroup
+}%
+\appdef\let@mark{\let\\\relax}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@title@above}
+% \begin{macro}{\frontmatter@title@format}
+% \begin{macro}{\frontmatter@title@below}
+% The default values for formatting specifications for the article title.
+%
+% The procedure \cmd\frontmatter@title@above\ should take care of the vertical space above the title;
+% \cmd\frontmatter@title@below\ below.
+% The procedure \cmd\frontmatter@title@format\ should invoke any font switches, etc.
+% that may apply to the title.
+%
+% Journals will override this procedure.
+% \begin{macrocode}
+\def\frontmatter@title@above{}%
+\def\frontmatter@title@format{}%
+\def\frontmatter@title@below{\addvspace{\baselineskip}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Authors and affiliations in superscriptaddress style}
+%
+% \begin{macro}{\frontmatter@author@produce@script}
+% \cmd\frontmatter@author@produce@script\ is an alias for \cmd\frontmatter@author@produce,
+% the procedure that formats the author/affiliation list.
+%
+% In this case, the authors affiliations are being superscripted
+% (class option \classoption{superscriptaddress}).
+%
+% This procedure must ensure that any paragraph that it starts gets ended finally.
+% \begin{macrocode}
+\def\frontmatter@author@produce@script{%
+ \begingroup
+ \let\@author@present\@author@present@script
+% \end{macrocode}
+% \changes{v4.l}{1998/09/01}
+% {Changes to add collaboration processing, which now
+% means doing comma/and processing on each sublist}
+% When the author/affiliation list \cmd\@AAC@list\ is executed,
+% \cmd\@tempcnt\ counts each author,
+% and
+% \cmd\@tempa\ stores a list of author indices for the current collaboration.
+%
+% Note: this procedure uses \cmd\AU@temp\ to hold a list of author counts for each collaboration.
+% Note: also uses \cmd\@tempcnta\ to communicate between procedures.
+% This usage ot \cmd\@tempcnta\ is OK, because the expansion of \cmd\@AAC@list\ will trigger only the execution of
+% our own procedures.
+% \begin{macrocode}
+ \let\AU@temp\@empty
+ \@tempcnta\z@
+% \end{macrocode}
+%
+% We wish to know how many authors are in each collaboration, for the purposes of \cmd\listcomma\ and \cmd\listand.
+%
+% Here we assign values for the intercollated operators appearing within \cmd\@AAC@list,
+% then execute that macro, registering the authors in each collaboration.
+% Afterwards, clean up by emulating an empty collaboration.
+%
+% The result, stored in \cmd\AU@temp, is a list of brace-delmited tokens, each a number
+% representing the number of authors in that collaboration.
+% \begin{macrocode}
+ \let\AF@opr \@gobble
+ \def\AU@opr{\@author@count\@tempcnta}%
+ \def\CO@opr{\@collaboration@count\AU@temp\@tempcnta}%
+ \@AAC@list
+ \expandafter\CO@opr\@author@cleared
+% \end{macrocode}
+% Next, present the authors and their affiliations.
+%
+% We assign values for the intercollated operators appearing within \cmd\@AAC@list.
+% Next, assign \cmd\@listcomma\ based on the number of authors in the first collaboration.
+% Then expand \cmd\@AAC@list.
+%
+% Upon completion, there will be two space tokens following the last author because of \cmd\listand\ processing;
+% remove them, then end the last paragraph.
+%
+% FIXME: this juncture would be a good time to effectively eliminate the unused affiliations in \cmd\@AFF@list.
+% \begin{macrocode}
+ \begingroup
+ \frontmatter@authorformat
+ \let\AF@opr \@affilID@def
+ \let\AU@opr \@author@present
+ \def\CO@opr{\@collaboration@present\AU@temp}%
+ \set@listcomma@list\AU@temp
+ \@AAC@list
+ \unskip\unskip
+ \par
+ \endgroup
+% \end{macrocode}
+% We now list out the affiliations in the order they appeared.
+% \begin{macrocode}
+ \begingroup
+ \frontmatter@above@affiliation@script
+% \let\@AFU@list\@empty
+% \let\AFS@opr \affils@present@script
+% \@AFG@list
+% \let\AF@opr \affil@present@script
+% \@AFU@list
+ \let\AFF@opr \@affil@script
+% \say\@AFF@list
+ \@AFF@list
+ \frontmatter@footnote@produce
+ \par
+ \endgroup
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@author@count}
+% This version of \cmd\AU@opr\ counts the number of authors it processes.
+% \begin{macrocode}
+\def\@author@count#1{\advance#1\@ne\@author@gobble}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@collaboration@present}
+% Format a collaboration.
+% Note that we immediately end the paragraph thus begun, because we only support
+% \classoption{superscriptaddress}-style processing.
+%
+% Note also that the execution of the production procedures takes place inside of a group;
+% for reasons of protective programming.
+%
+% Bug note: originally, the number of authors in each collaboration was stored in \cmd\@tempa,
+% but this exposed us to procedures in our production that modified the meaning of \cmd\@tempa.
+%
+% The last action done in this procedure is to assign \cmd\@listcomma\ based on the number of authors in the next collaboration.
+% \begin{macrocode}
+\def\@collaboration@present#1#2#3{%
+ \par
+ \begingroup
+ \frontmatter@collaboration@above
+ \@author@present{(\ignorespaces#2\unskip)}{#3}%
+ \par
+ \endgroup
+ \set@listcomma@list#1%
+}%
+\def\frontmatter@collaboration@above{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@collaboration@count}
+% Simply register each author in this collaboration.
+% Note: \#1 is a \cmd\csname\ to hold the value, \#2 is the \cmd\count\ register holding the count of interest.
+% \begin{macrocode}
+\def\@collaboration@count#1#2{%
+ \appdef@eval#1{\the#2}#2\z@
+ \@author@gobble
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affilID@def}
+%
+% The \cmd\@affilID@def\ procedure, an alias of \cmd\AF@opr\ used during \cmd\frontmatter@author@produce@script\ processing,
+% memorizes the affiliation in \cmd\@affilID@temp.
+% \begin{macrocode}
+\def\@affilID@def{\def\@affilID@temp}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affilID@temp}
+%
+% The macro \cmd\@affilID@temp\ is used to communicate between
+% \cmd\doauthor\ and instances of \cmd\AF@opr\ within the author list.
+% \begin{macrocode}
+\let\@affilID@temp\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\affils@present@script}
+% An alias of \cmd\AFS@opr, this procedure is applied to \cmd\@AFG@list\ and builds
+% \cmd\@AFU@list, a list of unique affiliations found within affiliation groups.
+%
+% \begin{macrocode}
+%\def\affils@present@script#1{%
+% \get@affil#1{}%
+%}%
+%\def\get@affil#1{%
+% \def\@tempa{#1}%
+% \@ifx{\@empty\@tempa}{}{%
+% \@booleanfalse\temp@sw
+% \def\AF@opr{\x@match\@tempa}%
+% \@AFU@list
+% \temp@sw{}{%
+% \appdef\@AFU@list{\AF@opr{#1}}%
+% }%
+% \get@affil
+% }%
+%}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\affil@present@script}
+% An alias of \cmd\AF@opr, this procedure is applied to \cmd\@AFU@list\ when formatting the affiliations
+% under \classoption{superscriptaddress}.
+% It in turn applies \cmd\affil@script\ to \cmd\@AFF@list, thereby formatting the affiliation
+% associated with this affiliation index.
+%
+% Note: it traverses the \cmd\@AFF@list\ for each entry in the \cmd\@AFU@list, thereby making this
+% portion of code execute in $N^{2}$ time.
+% \begin{macrocode}
+%\def\affil@present@script#1{%
+% \def\@tempa{#1}%
+% \begingroup
+% \frontmatter@affiliationfont
+% \let\AFF@opr \affil@script
+% \@AFF@list
+% \endgroup
+%}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\affil@script}
+% Alias of \cmd\AFF@opr, this procedure is applied to \cmd\@AFF@list\ when formatting the affiliations
+% under \classoption{superscriptaddress}.
+% It rejects all entries not matching the affiliation index held in \cmd\@tempa.
+% \begin{macrocode}
+\def\affil@script#1#2#3{%
+ \def\@tempifx{#1}\@ifx{\@tempifx\@tempa}{%
+ \@if@empty{#2}{}{%
+ \par
+ \begingroup
+ \textsuperscript{\normalfont#1}%
+ #2%
+ \@if@empty{#3}{}{\frontmatter@footnote{#3}}%
+ \par
+ \endgroup
+ }%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@script}
+% Alias of \cmd\AFF@opr:
+% The affiliations are being formatted in the case
+% where affiliations are being superscripted:
+% make a list out of the affiliations with the numbers printed.
+% Society-specific code can change the formatting
+% by overriding the definition of \cmd\frontmatter@affiliationfont.
+%
+% FIXME: dead code.
+% \begin{macrocode}
+\def\@affil@script#1#2#3{%
+ \@ifnum{#1=\z@}{}{%
+ \par
+ \begingroup
+ \frontmatter@affiliationfont
+% \textsuperscript{\normalfont#1}%
+ \textsuperscript{#1}%
+ #2%
+ \@if@empty{#3}{}{\frontmatter@footnote{#3}}%
+ \par
+ \endgroup
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@author@present@script}
+% \changes{v4.h}{1998/06/25}
+% {Changes to support groups of affiliations}
+% This version of \cmd\AU@opr\ applies to the \classoption{superscriptaddress} class option.
+% Need to add commas between groups
+% of address numbers, which are passed in the macro \cmd\@affilID@temp\ in the form
+% |{3}{4}{7}| if this set of authors is related to addresses, 3, 4 and 7.
+% \begin{macrocode}
+\def\@author@present@script#1#2{%
+ \begingroup
+% \parskip\@author@parskip\relax
+ \gdef\comma@space{\textsuperscript{,\,}}%
+% \@ifx{\@affilID@temp\@empty}{%
+% \doauthor{#1}{#2}{}%
+% }{%
+% \expandafter\set@count@\@affilID@temp{}{}\@@nil
+% \@ifnum{\count@=\z@}{%
+% \doauthor{#1}{#2}{}%
+% }{%
+% \doauthor{#1}{#2}{%
+% \textsuperscript{\expandafter\@affilcomma\@affilID@temp\relax\relax}%
+% }%
+% }%
+% }%
+ \doauthor{#1}{#2}{%
+ \let\@tempa\@empty
+ \expandafter\@affil@present@script\@affilID@temp\relax
+ }%
+ \endgroup
+ \advance\@tempcnta\m@ne
+}%
+%\def\set@count@#1#2\@@nil{%
+% \count@#1\relax
+%}%
+\def\@affilcomma#1#2{%
+ \@ifx{\z@#1}{%
+ \@ifx{\relax#2}{}{%
+ \@affilcomma{#2}%
+ }%
+ }{%
+ #1%
+ \@ifx{\relax#2}{}{%
+ \@ifx{\z@#2}{%
+ \@affilcomma
+ }{%
+ ,\,\@affilcomma{#2}%
+ }%
+ }%
+ }%
+}%
+\def\@affil@present@script#1{%
+ \@ifx{\relax#1}{%
+ \@ifx{\@tempa\@empty}{}{%
+ \textsuperscript{\expandafter\@affilcomma\@tempa\relax\relax}%
+ }%
+ }{%
+ \@ifx{\z@#1}{}{\appdef\@tempa{{#1}}}%
+ \@affil@present@script
+ }%
+}%
+\@provide\@author@parskip{\z@skip}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Authors and affiliations in groupedaddress style}
+%
+% \begin{macro}{\frontmatter@author@produce@group}
+% \cmd\frontmatter@author@produce@group\ is an alias for \cmd\frontmatter@author@produce,
+% the procedure that formats the author/affiliation list when \classoption{groupedaddress} is in effect.
+%
+% In this case, the authors are being grouped above their shared addresses.
+% How it works: the \cmd\@AFG@list, a list of all unique affiliation groups, is expanded.
+% For each such group, all authors belonging to that group are formatted above the affiliation group.
+% Collaborations are silently passed over.
+%
+% This procedure must ensure that any paragraph that it starts gets ended finally.
+% \begin{macrocode}
+\def\frontmatter@author@produce@group{%
+ \begingroup
+ \let\@author@present\@author@present@group
+ \frontmatter@authorformat
+ \let\AFS@opr \affils@present@group
+ \let\@listcomma\relax
+ \@AFG@list
+ \frontmatter@footnote@produce
+ \par
+ \endgroup
+ \frontmatter@authorbelow
+}%
+\@provide\frontmatter@authorbelow{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\affils@present@group}
+% Alias of \cmd\AFS@opr, this procedure is used on every element of
+% \cmd\@AFG@list, the list of unique affiliation groups,
+% when formatting the author/affiliation block:
+% It presents all authors sharing this affiliation group.
+%
+% This procedure is called via the procedure
+% \cmd\frontmatter@author@produce@group, an alias for \cmd\frontmatter@author@produce,
+%
+% Its use pertains to the class options
+% \classoption{groupedaddress}, \classoption{unsortedaddress}, and \classoption{runinaddress}
+% (that is, \cmd\groupauthors@sw\ is true).
+%
+% For each invocation, the entire \cmd\@AAC@list\ is run through (twice),
+% making this process execute in $N^{2}$ time. (Is this really true?)
+% \begin{macrocode}
+\def\affils@present@group#1{%
+% \end{macrocode}
+% Count (using \cmd\@tempcnta) the authors in the author list whose affiliation is |#1|.
+%
+% Note that \cmd\AF@temp\ is used as a storage register for the argument
+% of the procedure, for purposes of comparison using \cmd\ifx.
+%
+% Note: here we use \cmd\@tempcnta\ to communicate accumulate the number of authors in the current affiliation set.
+%
+% QUERY: does the value of \cmd\AF@temp\ and \cmd\AF@opr\ need to persist?
+%
+% QUERY: what value does \cmd\AU@opr\ have at this point?
+% ANSWER: the \cmd\@affilID@count\ and \cmd\@affilID@match\ procedures
+% assign meanings to \cmd\AU@opr\ and \cmd\CO@opr\ dynamically.
+% We initialize the two operators to \cmd\undefined\ so as to catch the
+% pathological cases.
+% \begin{macrocode}
+ \begingroup
+ \def\AF@temp{#1}% % 0B13
+ \@tempcnta\z@
+ \let\AU@opr \undefined % 0B13
+ \let\CO@opr \undefined % 0B13
+ \def\AF@opr{\@affilID@count\AF@temp\@tempcnta}% 0B13
+ \@AAC@list
+% \end{macrocode}
+%
+% If no authors using this affiliation group, skip it.
+% \begin{macrocode}
+ \@ifnum{\@tempcnta=\z@}{}{%
+% \end{macrocode}
+%
+% DPC: If we have a list of length two, need to locally zap a comma.
+% \begin{macrocode}
+ \begingroup
+ \frontmatter@above@affilgroup
+ \set@listcomma@count\@tempcnta
+% \end{macrocode}
+% Run through the author list, presenting (with \cmd\@author@present)
+% those authors whose affiliation matched the given one.
+% \begin{macrocode}
+ \let\AU@opr \undefined % 0B13
+ \let\CO@opr \undefined % 0B13
+ \def\AF@opr{\@affilID@match\AF@temp}%
+ \@AAC@list
+ \endgroup
+% \end{macrocode}
+% Now that the authors have all been presented, present the affiliations, grouped.
+%
+% Note: \cmd\@tempcnta\ is used to count the number of affiliations for this set of authors.
+% \begin{macrocode}
+ \begingroup
+ \par
+ \frontmatter@above@affiliation
+ \frontmatter@affiliationfont
+ \let\\\frontmatter@addressnewline
+ \@tempcnta\z@
+ \@tfor\AF@temp:=#1\do{%
+ \expandafter\@ifx\expandafter{\z@\AF@temp}{}{%
+ \advance\@tempcnta\@ne
+ }%
+ }%
+ \@ifnum{\@tempcnta=\tw@}{%
+ \let\@listcomma\relax
+ }{}%
+ \def\after@address{\@listcomma\ \@listand}%
+ \runinaddress@sw{%
+ }{%
+ \tightenlines@sw{%
+ }{%
+ \parskip\z@ %space between affilations in grouped mode
+ }%
+ \appdef\after@address\par
+ }%
+ \let\AFF@opr \@affil@group
+ \do@affil@fromgroup\@AFF@list#1\relax
+ \endgroup
+% \end{macrocode}
+% End of branch handling authors.
+% \begin{macrocode}
+ }%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \par
+ \endgroup
+%\smallskip
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affilID@count}
+% \begin{macro}{\@affilID@match}
+%
+% The control sequence name \cmd\AF@opr\ is placed in the
+% author/affiliation list (\cmd\@AAC@list) for each (new) affiliation, with that affiliation as its argument.
+%
+% The control sequence name \cmd\AF@opr\ is an alias of a procedure
+% to count the number of authors at a given affiliation (\cmd\@affilID@count)
+% or to present the given authors (\cmd\@affilID@match).
+% These two procedures are executed when formatting under the \classoption{groupedaddress} class option.
+% \begin{macrocode}
+\def\@affilID@count#1#2#3{%
+ \def\@tempifx{#3}%
+ \@ifx{\@tempifx#1}{%
+ \def\AU@opr{\@author@count#2}%
+ }{%
+ \let\AU@opr \@author@gobble
+ }%
+ \let\CO@opr \@collaboration@err
+}%
+\def\@affilID@match#1#2{%
+ \def\@tempifx{#2}%
+ \@ifx{\@tempifx#1}{%
+ \let\AU@opr \@author@present
+ }{%
+ \let\AU@opr \@author@gobble
+ }%
+ \let\CO@opr \@collaboration@err
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\do@affil@fromgroup}
+% Executes iteratively:
+% selects the next address ID to print,
+% and then re-execute the list of addresses to print the text of that address.
+%
+% Note: an argument of \cmd\relax\ breaks out of this iteration,
+% while an argument of \cmd\z@\ (\cmd\noaffiliation) is a no-op.
+%
+% Note: we have createed an $N^{2}$ computing process.
+% FIXME: can use hashing instead, you know.
+% \begin{macrocode}
+\def\do@affil@fromgroup#1#2{%
+ \@ifx{\relax#2}{}{%
+ \count@#2\relax
+ \@ifnum{\count@=\z@}{}{#1}%
+ \do@affil@fromgroup#1%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@affil@group}
+% The alias of \cmd\AFF@opr\ when the list \cmd\@AFF@list\
+% is executed by \cmd\do@affil@fromgroup (\classoption{groupedaddress}):
+% Print the address if its number matches \cmd\count@\ (value set by \cmd\do@affil@fromgroup).
+%
+% Note that we detect a \cmd\noaffiliation\ here by the second parameter's being the token \cmd\blankaffiliation.
+% \begin{macrocode}
+\def\@affil@group#1#2#3{%
+ \@ifnum{\count@=#1\relax}{%
+ \@ifx{#2\blankaffiliation}{}{%
+ #2%
+ \@if@empty{#3}{}{%
+ \frontmatter@footnote{#3}%
+ }%
+ \after@address
+ }%
+ \advance\@tempcnta\m@ne
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@author@present@group}
+% \changes{v4.d}{1998/01/31}
+% {\cs{comma@space}}
+% This version of \cmd\AU@opr\ applies to the \classoption{groupedaddress} class option.
+% Traverse the list calling the \cmd\doauthor\ hook on each author.
+% \begin{macrocode}
+\def\@author@present@group#1#2{%
+ \gdef\comma@space{\gdef\comma@space{\textsuperscript{,\,}}}%
+ \doauthor{#1}{#2}{}%
+ \advance\@tempcnta\m@ne
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@pacs@produce}
+% PACS, keywords and dates.
+% \changes{v4.d}{1998/01/31}
+% {PACS boxed to width of abstract}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Separate option now controls production}
+% \changes{v4.0beta 5}{2000/09/20}
+% {Warn if no production}
+% \begin{macrocode}
+\def\@pacs@produce#1{%
+ \showPACS@sw{%
+ \begingroup
+ \frontmatter@PACS@format
+ \@pacs@name#1\par
+ \endgroup
+ }{%
+ \@if@empty{#1}{}{%
+ \class@warn{\PACS@warn}%
+ }%
+ }%
+}%
+\def\PACS@warn{If you want your PACS to appear in your output, use document class option showpacs}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@keywords@produce}
+% \changes{v4.0beta 5}{2000/09/20}
+% {Keywords on same footing as PACS}
+% \begin{macrocode}
+\def\@keywords@produce#1{%
+ \showKEYS@sw{%
+ \begingroup
+ \frontmatter@keys@format
+ \@keys@name#1\par
+ \endgroup
+ }{%
+ \@if@empty{#1}{}{%
+ \class@warn{If you want your keywords to appear in your output, use document class option showkeys}%
+ }%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@footnote@produce@footnote}
+% \begin{macro}{\frontmatter@footnote@produce@endnote}
+% Produce any footnotes to appear at the bottom of the title page.
+%
+% If frontmatter footnotes have been redirected to the bibliography, this will be a no-op.
+% ref.: \cmd\present@bibnote.
+% \begin{macrocode}
+\def\frontmatter@footnote@produce@footnote{%
+ \let\@TBN@opr\present@FM@footnote
+ \@FMN@list
+ \global\let\@FMN@list\@empty
+}%
+\def\present@FM@footnote#1#2{%
+ \begingroup
+ \csname c@\@mpfn\endcsname#1\relax
+ \def\@thefnmark{\thempfn}%
+ \frontmatter@footnotetext{#2}%
+ \endgroup
+}%
+\def\frontmatter@footnote@produce@endnote{%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@thefootnote}
+% The in the title block, the footnote symbol (used for alternate affiliation and sundry)
+% is a \cmd\@fnsymbol\ or a lowercase letter, as selected by a boolean.
+% \begin{macrocode}
+\def\frontmatter@thefootnote{%
+ \altaffilletter@sw{\@alph}{\@fnsymbol}\c@footnote
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@makefnmark}
+% The default procedure for setting the footnote mark within the frontmatter.
+% Journals will override this procedure.
+% \begin{macrocode}
+\def\frontmatter@makefnmark{%
+ \@textsuperscript{%
+ \normalfont\@thefnmark
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@makefntext}
+% This procedure is used when setting footnotes within the title block.
+% \begin{macrocode}
+\long\def\frontmatter@makefntext#1{%
+ \parindent 1em
+ \noindent
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter@\the\c@footnote}\hyper@anchorend}%
+ \@makefnmark
+ #1%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@setup}
+% The default type specification for the title page.
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@setup{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@RRAPformat}
+% \begin{macro}{\punct@RRAP}
+% \begin{macro}{\produce@RRAP}
+% The procedure \cmd\frontmatter@RRAPformat\ is the formatting procedure
+% for the ``Received, Revised, etc.'' block on the title page.
+% The macro \cmd\punct@RRAP\ produces the punctuation between the entries.
+% Journals will override these two definitions.
+%
+% The procedure \cmd\produce@RRAP\ is fairly general, and should be used by most
+% journal substyles.
+%
+% The procedure \cmd\frontmatter@RRAP@format\ will be overridden by the journal.
+% \begin{macrocode}
+\def\frontmatter@RRAPformat#1{%
+ \removelastskip
+ \begingroup
+ \frontmatter@RRAP@format
+ #1\par
+ \endgroup
+}%
+\def\punct@RRAP{; }%
+\def\produce@RRAP#1{%
+ \@if@empty{#1}{}{%
+ \@ifvmode{\leavevmode}{\unskip\punct@RRAP\ignorespaces}%
+ #1%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@authorformat}
+% The default type specification for the author list.
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@authorformat{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affilgroup}
+% The default amount of space above an affiliation group
+% (in a \cmd\affils@present@group\ production).
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@above@affilgroup{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affiliation}
+% \begin{macro}{\frontmatter@above@affiliation@script}
+% The \cmd\frontmatter@above@affiliation\ is the amount of space above affiliations in the \classoption{groupedaddress}
+% style, and \cmd\frontmatter@above@affiliation@script\ is that for \classoption{superscriptaddress}.
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@above@affiliation{}%
+\def\frontmatter@above@affiliation@script{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@affiliationfont}
+% The default type specification for the affiliation.
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@affiliationfont{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@RRAP@format}
+% The default type specification for the dates.
+% Journals will override this definition.
+% \begin{macrocode}
+\def\frontmatter@RRAP@format{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@PACS@format}
+% Specify the formatting of the title page PACS statement.
+%
+% Journals will override.
+% \begin{macrocode}
+\def\frontmatter@PACS@format{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@keys@format}
+% Specify the formatting of the title page keywords statement.
+%
+% Journals will override.
+% \begin{macrocode}
+\def\frontmatter@keys@format{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@finalspace}
+%
+% \begin{macrocode}
+\def\frontmatter@finalspace{\addvspace{18\p@}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@addressnewline}
+% \changes{v4.h}{1998/06/25}
+% {new hook}
+% The definition of \cmd\\\ for address handling. Default puts all the `lines'
+% on a run-in line, separated by comma and space.
+% DPC: was \newline space between lines of addresss.
+% \begin{macrocode}
+\def\frontmatter@addressnewline{%
+ \@ifhmode{\skip@\lastskip\unskip\unpenalty\break\hskip\skip@}{}%
+ % was: \vskip-.5ex
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\frontmatter@preabstractspace}
+% \begin{macro}{\frontmatter@postabstractspace}
+% Space above and space below abstract in title block
+% \begin{macrocode}
+\def\frontmatter@preabstractspace{5.5\p@}
+\def\frontmatter@postabstractspace{6.5\p@}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\aftermaketitle@chk}
+% Error-checking code.
+% \begin{macrocode}
+\def\aftermaketitle@chk#1{%
+ \@ifx{\maketitle\relax}{%
+ \class@err{\protect#1 must be used before \protect\maketitle}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@titlepage}
+% Default page style for title page.
+% Journals will override this procedure.
+% \begin{macrocode}
+\def\ps@titlepage{\ps@empty}%
+% \end{macrocode}
+% \end{macro}
+%
+%FIXME: there is a limitation to the default meaning of
+% \cmd\@startpage, the label ``FirstPage'' is only
+% defined if the document has a \cmd\maketitle\ command.
+%
+% \begin{macrocode}
+\def\volumeyear#1{\gdef\@volumeyear{#1}}%
+\def\@volumeyear{}%
+\def\volumenumber#1{\gdef\@volumenumber{#1}}%
+\def\@volumenumber{}%
+\def\issuenumber#1{\gdef\@issuenumber{#1}}%
+\def\@issuenumber{}%
+\def\eid#1{\gdef\@eid{#1}}%
+\def\@eid{}%
+%
+\def\startpage#1{\gdef\@startpage{#1}\c@page#1\relax}%
+\def\@startpage{\pageref{FirstPage}}%
+\def\endpage#1{\gdef\@endpage{#1}}%
+\def\@endpage{\pageref{LastPage}}%
+% \end{macrocode}
+%
+%
+% \subsection{Printing out the ``list-of'' elements}%
+%
+% FIXME: The \cmd\appendix@toc\ procedure should change the meaning
+% of \cmd\l@section\ so that the \cmd\section s can be appropriately formatted,
+% reflecting their status as appendices.
+%
+% \begin{macrocode}
+\def\print@toc#1{%
+ \begingroup
+% \c@secnumdepth-\maxdimen
+ \expandafter\section
+ \expandafter*%
+ \expandafter{%
+ \csname#1name\endcsname
+ }%
+ \let\appendix\appendix@toc
+ \@starttoc{#1}%
+ \endgroup
+}%
+\def\appendix@toc{}%
+% \end{macrocode}
+%
+%
+% \section{Body}
+%
+% \subsection{counters}
+% The following definitions are probably identical to those in
+% \file{classes.dtx}%
+% \begin{macrocode}
+\def\labelenumi{\theenumi.}
+\def\theenumi{\arabic{enumi}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\labelenumii{(\theenumii)}
+\def\theenumii{\alph{enumii}}
+\def\p@enumii{\theenumi}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\labelenumiii{\theenumiii.}
+\def\theenumiii{\roman{enumiii}}
+\def\p@enumiii{\theenumi(\theenumii)}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\labelenumiv{\theenumiv.}
+\def\theenumiv{\Alph{enumiv}}
+\def\p@enumiv{\p@enumiii\theenumiii}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\labelitemi{\textbullet}
+\def\labelitemii{\normalfont\bfseries\textendash}
+\def\labelitemiii{\textasteriskcentered}
+\def\labelitemiv{\textperiodcentered}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\pagenumbering{arabic}
+% \end{macrocode}
+%
+% \subsection{float parameters}
+%
+% from the old aps.sty. (DPC: same as article I think)
+% AO: here, \LaTeX's standard classes fail very poorly
+% (the price of backward compatability): the values for
+% \cmd\floatpagefraction\ and \cmd\dblfloatpagefraction\
+% need to be raised to avoid creating extremely short
+% float pages.
+% \begin{macrocode}
+\setcounter{topnumber}{2}
+\def\topfraction{.9}
+\setcounter{bottomnumber}{1}
+\def\bottomfraction{.9}
+\setcounter{totalnumber}{3}
+\def\textfraction{.1}
+\def\floatpagefraction{.9}
+\setcounter{dbltopnumber}{2}
+\def\dbltopfraction{.9}
+\def\dblfloatpagefraction{.9}
+% \end{macrocode}
+%
+% \subsection{List Environments}
+%
+% \begin{macrocode}
+\newenvironment{verse}{%
+ \let\\=\@centercr
+ \list{}{%
+ \itemsep\z@ \itemindent -1.5em\listparindent \itemindent
+ \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]%
+}{%
+ \endlist
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newenvironment{quotation}{%
+ \list{}{%
+ \listparindent 1.5em
+ \itemindent\listparindent
+ \rightmargin\leftmargin \parsep \z@ \@plus\p@}\item[]%
+}{%
+ \endlist
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newenvironment{quote}{%
+ \list{}{%
+ \rightmargin\leftmargin}\item[]%
+}{%
+ \endlist
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\descriptionlabel#1{%
+ \hspace\labelsep \normalfont\bfseries #1%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newenvironment{description}{%
+ \list{}{%
+ \labelwidth\z@ \itemindent-\leftmargin
+ \let\makelabel\descriptionlabel
+ }%
+}{%
+ \endlist
+}%
+% \end{macrocode}
+%
+% \subsection{Sectioning Commands}
+%
+% \subsubsection{Counters and Their Productions}%
+% \begin{macrocode}
+\newcounter{part}
+\newcounter{section}
+\newcounter{subsection}[section]
+\newcounter{subsubsection}[subsection]
+\newcounter{paragraph}[subsubsection]
+\newcounter{subparagraph}[paragraph]
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\thepart {\Roman{part}} %
+\def\thesection {\Roman{section}}
+\def\p@section {}
+\def\thesubsection {\Alph{subsection}}
+\def\p@subsection {\thesection\,}
+\def\thesubsubsection {\arabic{subsubsection}}
+\def\p@subsubsection {\thesection\,\thesubsection\,}
+\def\theparagraph {\alph{paragraph}}
+\def\p@paragraph {\thesection\,\thesubsection\,\thesubsubsection\,}
+\def\thesubparagraph {\arabic{subparagraph}}
+\def\p@subparagraph {\thesection\,\thesubsection\,\thesubsubsection\,\theparagraph\,}
+% \end{macrocode}
+%
+% \subsubsection{The Acknowledgments Environment}%
+% This user-level markup produces a head introducing
+% the acknowledgments, and acts as a wrapper for the text.
+% In this implementation, it is an unnumbered section,
+% but appears within the toc.
+%
+% For compatiability's sake, we implement it under the alternative
+% spelling \env{acknowledgements}.
+% \changes{v4.0beta 3}{1999/11/13}
+% {also spelled ``acknowledgements''.}
+% \changes{v4.0beta 4}{2000/05/18}
+% {But alternative spelling is deprecated.}
+% \begin{macrocode}
+\newenvironment{acknowledgments}{%
+ \acknowledgments@sw{%
+ \section*{\acknowledgmentsname}%
+ }{%
+ \par
+ \phantomsection
+ \addcontentsline{toc}{section}{\protect\numberline{}\acknowledgmentsname}%
+ }%
+}{%
+ \par
+}%
+\@booleantrue\acknowledgments@sw
+\newenvironment{acknowledgements}{%
+ \replace@environment{acknowledgements}{acknowledgments}%
+}{%
+ \endacknowledgments
+}%
+% \end{macrocode}
+%
+% \subsubsection{Part Opener}%
+% section setup copied verbatim from revtex3 aps/osa.
+% Does not explicitly depend on pointsize options.
+% \begin{macrocode}
+\def\part{\par
+ \addvspace{4ex}%
+ \@afterindentfalse
+ \secdef\@part\@spart}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@part[#1]#2{%
+ \@ifnum{\c@secnumdepth >\m@ne}{%
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ }{%
+ \addcontentsline{toc}{part}{#1}%
+ }%
+ \begingroup
+ \parindent \z@ \raggedright
+ \interlinepenalty\@M
+ \@ifnum{\c@secnumdepth >\m@ne}{%
+ \Large \bf \partname~\thepart%
+ \par\nobreak
+ }{}%
+ \huge \bf
+ #2%
+ \markboth{}{}\par
+ \endgroup
+ \nobreak
+ \vskip 3ex
+ \@afterheading
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@spart#1{{\parindent \z@ \raggedright
+ \interlinepenalty\@M
+ \huge \bf
+ #1\par}
+ \nobreak
+ \vskip 3ex
+ \@afterheading}
+% \end{macrocode}
+%
+% \subsubsection{Stacked Heads}%
+% Here are the class default definitions for sectioning commands.
+% A society or a journal substyle will likely override these definitions.
+%
+% In doing so, you can customize the formatting for a particular level by defining,
+% e.g., \cmd\@hangfrom@section\ or \cmd\@subsectioncntformat.
+% \begin{macrocode}
+\def\section{%
+ \@startsection
+ {section}%
+ {1}%
+ {\z@}%
+ {0.8cm \@plus1ex \@minus .2ex}%
+ {0.5cm}%
+ {\normalfont\small\bfseries}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subsection{%
+ \@startsection
+ {subsection}%
+ {2}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {\normalfont\small\bfseries}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subsubsection{%
+ \@startsection
+ {subsubsection}%
+ {3}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {\normalfont\small\itshape}%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Runin Heads}%
+% \begin{macrocode}
+\def\paragraph{%
+ \@startsection
+ {paragraph}%
+ {4}%
+ {\parindent}%
+ {\z@}%
+ {-1em}%
+ {\normalfont\normalsize\itshape}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subparagraph{%
+ \@startsection
+ {subparagraph}%
+ {5}%
+ {\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}%
+}%
+% \end{macrocode}
+%
+%
+% \subsection{Math}
+%
+% \begin{macro}{\theequation}
+% We change the production of the equation counter so that
+% we can accomodate the \classoption{eqsecnum} option.
+% \begin{macrocode}
+\def\theequation{%
+ \theequation@prefix\arabic{equation}%
+}%
+\def\theequation@prefix{}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Type Size-Dependent Settings}
+%
+% Note that many parameters, as well as the meaning of
+% \cmd\normalsize, are deferred until
+% \cmd\AtEndOfClass\ time.
+% Therefore, code elsewhere in this class \emph{should not}
+% assume these things' values have been set!
+% \begin{macrocode}
+\AtEndOfClass{%
+ \expandafter\input\expandafter{\@pointsize pt\substyle@ext}%
+}%
+% \end{macrocode}
+%
+%
+% \subsection{All Point Sizes}
+% \begin{macrocode}
+\setcounter{secnumdepth}{4}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\lineskip 1pt
+\normallineskip 1pt
+\def\baselinestretch{1}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@lowpenalty 51
+\@medpenalty 151
+\@highpenalty 301
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@beginparpenalty -\@lowpenalty
+\@endparpenalty -\@lowpenalty
+\@itempenalty -\@lowpenalty
+% \end{macrocode}
+%
+% \begin{macrocode}
+\arraycolsep 3pt
+\tabcolsep 2pt
+\arrayrulewidth .4pt
+\doublerulesep 2pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\skip\@mpfootins = 0pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\fboxsep = 3.0pt
+\fboxrule = 0.4pt
+% \end{macrocode}
+%
+% \subsection{Figures}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Processing delayed to \cs{AtBeginDocument} time}
+%
+% \begin{environment}{figure}
+% We define the \env{figure} environment.
+% Later, we will horse around with its meaning
+% in order to accomodate \cmd\floats@sw.
+% \begin{macrocode}
+\newenvironment{figure}
+ {\@float{figure}}
+ {\end@float}
+\newenvironment{figure*}
+ {\@dblfloat{figure}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\@makecaption}
+% If caption is one line long, to be centered; if lines turn, then set justified.
+% \begin{macrocode}
+\newlength\abovecaptionskip
+\newlength\belowcaptionskip
+\setlength\abovecaptionskip{10\p@}
+\setlength\belowcaptionskip{2\p@}
+% \end{macrocode}
+%
+% \changes{v4.0beta 2}{1999/06/20}
+% {One-line caption sets flush left.}
+% \changes{v4.0beta 3}{1999/11/13}
+% {Prevent an inner footnote from performing twice}
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \par
+% \nobreak
+ \vskip\abovecaptionskip
+ \begingroup
+ \small\rmfamily
+ \sbox\@tempboxa{%
+ \let\\\heading@cr
+ #1: #2%
+ }%
+ \@ifdim{\wd\@tempboxa >\hsize}{%
+ \begingroup
+ \samepage
+ \flushing
+ \let\footnote\@footnotemark@gobble
+ #1: #2\par
+ \endgroup
+ }{%
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\unhbox\@tempboxa\hfil}%
+ }%
+ \endgroup
+ \vskip\belowcaptionskip
+}%
+\def\@footnotemark@gobble{%
+ \@footnotemark
+ \@ifnextchar[{\@gobble@opt@i}{\@gobble}%
+}%
+\def\@gobble@opt@i[#1]#2{}%
+\def\@mpmakefntext#1{%
+ \flushing
+ \parindent=1em
+ \noindent
+ \hb@xt@1em{\hss\@makefnmark}%
+ #1%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thefigure}
+% The figure counter and float placement defaults.
+% \begin{macrocode}
+\newcounter{figure}
+\renewcommand \thefigure {\@arabic\c@figure}
+% \end{macrocode}
+% Note that we give the `!' modifier by default.
+% This is an effort to avoid the syndrome wherein
+% a deferred float finds itself unqualified for
+% placement, thereby getting carried until \cmd\clearpage.
+% \begin{macrocode}
+\def\fps@figure{tbp}
+\def\ftype@figure{1}
+\def\ext@figure{lof}
+\def\fnum@figure{\figurename~\thefigure}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Deferring \env{figure} Floats}%
+%
+% We install a hook at \cmd\AtBeginDocument\ time which determines if
+% figures will float or will be deferred until
+% \cmd\printfigures\ time.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \do@if@floats{figure}{.fgx}%
+}%
+\appdef\class@enddocumenthook{%
+ \printfigures\relax
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\printfigures}
+% The user-level command \cmd\printfigures\ determines
+% where the figures are to appear in a document in which
+% \cmd\floats@sw\ is false.
+% If the user invokes the \classoption{endfloats} class option and fails to
+% insert a \cmd\printfigures\ command,
+% the figures will be printed at the end of the document.
+% If the command is given, but floats are not being deferred,
+% it amounts to a no-op.
+% \changes{v4.0beta 2}{1999/06/20}
+% {call \cs{print@floats}}
+% \changes{v4.0beta 3}{1999/11/13}
+% {*-form mandates pagebreak}
+% \begin{macrocode}
+\newcommand\printfigures{%
+ \@ifstar{\true@sw}{\floatp@sw{\true@sw}{\false@sw}}%
+ {%
+ \print@float{figure}{\oneapage}%
+ }{%
+ \print@float{figure}{}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@xfloat@prep}
+% We patch into the procedure \cmd\@xfloat@prep.
+% This patch applies to all floats (not \env{figure} alone)
+% and makes the type center.
+% \begin{macrocode}
+\appdef\@xfloat@prep{%
+ \appdef\@parboxrestore{\centering}%
+ \let\@makefnmark\@makefnmark@latex
+ \let\@footnotemark\@footnotemark@latex
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Tables}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Processing delayed to \cs{AtBeginDocument} time}
+%
+% DPC: More or less taken from \file{revtex2} \file{aps.sty},
+% but using dcolumn for decimal alignment.
+% \begin{environment}{table}
+% We define the \env{table} environment.
+% Later, we will horse around with its meaning
+% in order to accomodate \cmd\floats@sw.
+% \begin{macrocode}
+\newenvironment{table}
+ {\@float{table}}
+ {\end@float}
+\newenvironment{table*}
+ {\@dblfloat{table}}
+ {\end@dblfloat}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\thetable}
+% Table counter and default float placement declarations.
+% \begin{macrocode}
+\newcounter{table}
+\renewcommand\thetable{\@Roman\c@table}
+% \end{macrocode}
+% Note that we give the `!' modifier by default.
+% This is an effort to avoid the syndrome wherein
+% a deferred float finds itself unqualified for
+% placement, thereby getting carried until \cmd\clearpage.
+% \begin{macrocode}
+\def\fps@table{tbp}
+\def\ftype@table{2}
+\def\ext@table{lot}
+\def\fnum@table{\tablename~\thetable}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\table@hook}
+% \begin{macro}{\squeezetable}
+% Assign a meaning to the hook installed into float processing.
+%
+% By default floats are \cmd\small. The \cmd\squeezetable\ declaration
+% makes them smaller (\cmd\scriptsize). In general you can locally
+% redefine \cmd\table@hook\ to be whatever you like.
+% (DPC: |\Huge\color{magenta}|\ldots?)
+% \begin{macrocode}
+\def\table@hook{\small}%
+\def\squeezetable{\def\table@hook{\scriptsize}}%
+\appdef\@floatboxreset{\table@hook}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Deferring \env{table} Floats}%
+%
+% We install a hook at
+% \cmd\AtBeginDocument\ time which determines if
+% tables will float or will be deferred until
+% \cmd\printtables\ time.
+%
+% We also deal with the possibility of \env{longtable} environments.
+%
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \floats@sw{}{%
+ \let@environment{longtable@float}{longtable}%
+ \let@environment{longtable}{longtable@write}%
+ \let@environment{longtable*@float}{longtable*}%
+ \let@environment{longtable*}{longtable*@write}%
+ \let@environment{turnpage@float}{turnpage}%
+ \let@environment{turnpage}{turnpage@write}%
+ }%
+ \do@if@floats{table}{.tbx}%
+}%
+\appdef\class@enddocumenthook{%
+ \printtables\relax
+}%
+\newenvironment{longtable@write}{%
+ \write@@float{longtable}{table}%
+}{%
+ \endwrite@float
+}%
+\newenvironment{longtable*@write}{%
+ \write@@float{longtable*}{table}%
+}{%
+ \endwrite@float
+}%
+\newenvironment{turnpage@write}{%
+ \immediate\write\tablewrite{\string\begin{turnpage}}%
+}{%
+ \immediate\write\tablewrite{\string\end{turnpage}}%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\printtables}
+% The user-level command \cmd\printtables\ determines
+% where the tables are to appear in a document in which
+% \cmd\floats@sw\ is false.
+% If the user invokes the \classoption{nofloats} and fails to
+% insert a \cmd\printtables\ command,
+% the tables will be printed at the end of the document.
+% If the command is given, but floats are not being deferred,
+% it amounts to a no-op.
+% \changes{v4.0beta 2}{1999/06/20}
+% {only execute if appropriate}
+% \changes{v4.0beta 3}{1999/11/13}
+% {*-form mandates pagebreak}
+% \changes{v4.0beta 4}{2000/05/17}
+% {make longtable trigger the head, too}
+% \begin{macrocode}
+\newcommand\printtables{%
+ \begingroup
+ \let@environment{longtable}{longtable@float}%
+ \let@environment{longtable*}{longtable*@float}%
+ \let@environment{turnpage}{turnpage@anchored}%
+ \prepdef\longtable{\trigger@float@par}%
+ \expandafter\prepdef\csname longtable*\endcsname{\trigger@float@par}%
+ \expandafter\prepdef\csname table@floats\endcsname{%
+ \onecolumngrid@push
+ }%
+ \expandafter\appdef\csname endtable@floats\endcsname{%
+ \onecolumngrid@pop
+ }%
+ \@ifstar{\true@sw}{\floatp@sw{\true@sw}{\false@sw}}%
+ {%
+ \print@float{table}{\oneapage}%
+ }{%
+ \print@float{table}{}%
+ }%
+ \endgroup
+}%
+\newenvironment{turnpage@anchored}{%
+ \onecolumngrid@push
+ \setbox\z@\vbox to\textwidth\bgroup
+ \columnwidth\textheight
+}{%
+ \vfil
+ \egroup
+ \rotatebox{90}{\box\z@}%
+ \onecolumngrid@pop
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{Tabular}
+% Every tabular has a double (Scotch) rule above and below.
+% The column specifier ``d'' is implemented using the \classname{dcolumn}
+% package, if available.
+% FIXME: always load dcolumn!
+% \begin{macro}{\tabular@hook}
+% \begin{macro}{\endtabular@hook}
+% \begin{environment}{ruledtabular}
+% \begin{macrocode}
+\def\endtabular@hook{}%
+%\RequirePackage{dcolumn}%
+\appdef\class@documenthook{%
+ \@ifpackageloaded{dcolumn}{%
+ \newcolumntype{d}{D{.}{.}{-1}}%
+ }{}%
+}%
+\def\toprule{\hline\hline}%
+\def\colrule{\hline}%
+\def\botrule{\hline\hline}%
+\newenvironment{ruledtabular}{%
+ \def\array@default{v}%
+ \appdef\tabular@hook{\def\@halignto{to\hsize}}%
+ \let\tableft@skip@default\tableft@skip
+ \let\tableft@skip\tableft@skip@float
+ \let\tabmid@skip@default\tabmid@skip
+ \let\tabmid@skip\tabmid@skip@float
+ \let\tabright@skip@default\tabright@skip
+ \let\tabright@skip\tabright@skip@float
+ \let\array@row@pre@default\array@row@pre
+ \let\array@row@pre\array@row@pre@float
+ \let\array@row@pst@default\array@row@pst
+ \let\array@row@pst\array@row@pst@float
+ \appdef\array@row@rst{%
+ \let\array@row@pre\array@row@pre@default
+ \let\array@row@pst\array@row@pst@default
+ \let\tableft@skip\tableft@skip@default
+ \let\tabmid@skip\tabmid@skip@default
+ \let\tabright@skip\tabright@skip@default
+ \appdef\tabular@hook{\let\@halignto\@empty}%
+ }%
+}{%
+}%
+% \end{macrocode}
+% \end{environment}
+% \end{macro}
+% \end{macro}
+%
+% \section{Footnote Text}
+%
+% \changes{v4.g}{1998/06/10}
+% {single space footnotes}
+% \changes{v4.0beta 2}{1999/06/20}
+% {%
+% Frank Mittelbach, has stated in \protect\classname{multicol}:
+% ``The kernel command \cs{@footnotetext} should not be modified.''
+% Thus, I have removed David Carlisle's redefinition of that command.
+% Note, however, that later versions of \protect\classname{multicol} do not require
+% this workaround. Belt and suspenders.
+% }%
+%
+% \begin{macro}{\@makefntext}
+% \begin{macrocode}
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \reset@font\footnotesize
+ \parindent 1em%
+ \noindent
+ \hb@xt@1.8em{%
+ \Hy@raisedlink{\hyper@anchorstart{footnote@\the\c@footnote}\hyper@anchorend}%
+ \hss\@makefnmark
+ }%
+ #1\par
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Citations, Bibliography, Endnotes}
+%
+% \subsubsection{Bibliography}
+%
+% Load Patrick Daly's \classname{natbib} package,
+% \url{ftp://ctan.tug.org/macros/latex/contrib/supported/natbib}
+%
+% Note that \classname{natbib} assumes that it loads
+% over a document class, such as the \classname{article} class,
+% that has already defined \env{thebibliography} and \cmd\@listi.
+%
+% Note also that \classname{natbib} also installs a command
+% \cmd\NAT@set@cites\ into \cmd\AtBeginDocument\ which presumes
+% that the proper \cmd\bibpunct\ command has been issued.
+%
+% We have a problem with \classname{natbib} in that it does not
+% accomodate late binding of its package options. This means
+% that those options must be known at the time the package
+% loads. Therefore, we select \classoption{sort\&compress}
+% now, and thereby foreclose on alternative uses of \classname{natbib}.
+%
+% Certain societies may prefer an alternative; they are out of luck.
+% If you find yourself in this position, please let the author
+% of \classname{natbib} know that his package should be modified to
+% accomodate late binding of package options.
+%
+% To remedy the situation, note that the macro \cmd\NAT@sort\ controls
+% whether citations are left alone (\cmd\NAT@sort=0), sorted (\cmd\NAT@sort=1), or sorted and compressed (\cmd\NAT@sort=2).
+% Since we give \classname{natbib} the \classoption{sort\&compress} option,
+% if you prefer \classoption{sort}, you need only define \cmd\NAT@sort\ to be 1.
+% However, if you prefer the effect of having neither \classoption{sort} nor \classoption{sort\&compress},
+% you must define \cmd\NAT@sort\ to be 0 and you must also define
+% \cmd\NAT@sort@cites:
+%\begin{verbatim}
+%\renewcommand\NAT@sort@cites[1]{\edef\NAT@cite@list{#1}}%
+%\end{verbatim}
+%
+% For other \classname{natbib} customizations, you may proceed as if you were going to use
+% the \file{natbib.cfg} file: anything that you can modify by this means is fair game.
+% Once \revtex\ is finished loading, you can assert any definitions for \classname{natbib} that you wish.
+%
+% \begin{macrocode}
+\newenvironment{thebibliography}{}{}%
+\let\@listi\@empty
+\RequirePackage[sort&compress]{natbib}[1999/05/28 7.0]%
+\let\NAT@thebibliography\thebibliography
+\let\NAT@endthebibliography\endthebibliography
+\let\bibliographystyle@latex\bibliographystyle
+% \end{macrocode}
+%
+% \begin{macro}{\NAT@citesuper}
+% We redefine \classname{natbib}'s procedure \cmd\NAT@citesuper,
+% which is executed when setting a superscript citation.
+% The \cmd\hspace\ is removed: in any case, it
+% should really be \cmd\hspace*, to prevent an unwanted pagebreak.
+% \begin{macrocode}
+\renewcommand\NAT@citesuper[3]{%
+ \ifNAT@swa
+ \leavevmode
+ \unskip
+% \hspace{1\p@}%
+ \textsuperscript{#1}%
+ \if*#3*\else\ (#3)\fi
+ \else
+ #1%
+ \fi
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@makefnmark@cite}
+% We define a procedure that will set a footnote mark the same way that
+% a citation is set. If footnotes are put in the bibliography with
+% \cmd\footinbib@sw, then the corresponding mark should look the same
+% as the result of a \cmd\cite. This is how we do it.
+% \begin{macrocode}
+\def\@makefnmark@cite{\begingroup\NAT@swatrue\@cite{{\@thefnmark}}{}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibliographystyle}
+% We arrange for the selection of bibliography style
+% to occur either due to the document's explicit
+% \cmd\bibliographystyle\ statement or
+% via the journal substyle.
+%
+% Note that \revtex\ is now incompatible with
+% any package that patches \cmd\bibliographystyle,
+% except for those (like \classname{natbib}) that load before here.
+% \begin{macrocode}
+\let\bibliographystyle@latex\bibliographystyle
+\def\bibliographystyle{\def\@bibstyle}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibsection}
+% \begin{macro}{\NAT@bibsetnum}
+% \begin{macro}{\NAT@bibsetup}
+% \begin{macro}{\bibpreamble}
+% \begin{macro}{\newblock}
+% \begin{macro}{\bibnumfmt}
+% We define the sectioning command to use when starting the bibliography
+% and gently coax \classname{natbib} into using
+% the formatting procedures that \emph{we} want it to use.
+%
+% This way of setting up \env{thebibliography}
+% automatically sets the label width based on
+% the largest number used within the bibliography.
+% This scheme will not work properly using the
+% author/year style of bib entry, though.
+%
+% We define \cmd\bibnumfmt\ to be \cmd\place@bibnumber, which is a macro
+% managed by \revtex. If the document defines \cmd\bibnumfmt, then that
+% definition will be used instead, which is what the \classname{natbib}
+% package gives as its programming interface.
+%
+% And if the substyle does not give a meaning to \cmd\place@bibnumber,
+% we give it that of the original \cmd\bibnumfmt.
+% \begin{macrocode}
+\def\bibsection{%
+ \@ifx@empty\refname{%
+ \par
+ }{%
+ \let\@hangfroms@section\@hang@froms
+ \section*{\refname}%
+ \@nobreaktrue
+ }%
+}%
+\let\NATx@bibsetnum\NAT@bibsetnum
+\def\NAT@bibsetnum#1{%
+ \setlength{\topsep}{\z@}%
+ \NATx@bibsetnum{\ref{LastBibItem}}%
+}%
+\let\NATx@bibsetup\NAT@bibsetup
+\def\NAT@bibsetup{%
+ \setlength{\labelwidth}{\z@}%
+ \setlength{\labelsep}{\z@}%
+ \setlength{\itemindent}{\z@}%
+ \setlength{\listparindent}{\z@}%
+ \setlength{\topsep}{\z@}%
+ \setlength{\parsep}{\z@}%
+ \NATx@bibsetup
+}%
+\let\bibpreamble\@empty
+\def\newblock{\ }%
+\let\NATx@bibnumfmt\bibnumfmt
+\def\bibnumfmt{\place@bibnumber}%
+\AtEndOfClass{%
+ \appdef\class@documenthook{%
+ \@ifxundefined\place@bibnumber{%
+ \let\place@bibnumber\NATx@bibnumfmt
+ }{}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\NAT@onlinecite}
+% We anticipate using numerical citations.
+% If superscript citations are used, we nonetheless need a way to
+% use numerical citations as required by the author.
+% These should be accessible via the \cmd\citet\ command.
+%
+% Therefore we remember how to do a numerical citation
+% even when the superscript citation has been selected.
+%
+% Can you say ``inelegant hack''? I knew you could!
+% \begin{macrocode}
+\let\NAT@citeyear\citeyear
+\def\NAT@onlinecite#1{%
+ \begingroup
+ \let\@cite\NAT@citenum
+ \let\NAT@mbox\mbox
+ \let\citeyear\NAT@citeyear
+ \def\NAT@space{ }%
+ \cite{#1}%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{+}
+% \begin{macro}{\textcite}
+% We extend \classname{natbib}'s syntax with two commands to set a citation
+% on the baseline (as opposed to superscripted) and as text (rather than parenthetical), respectively.
+% A journal substyle that makes citations be superscripted or parenthetical as the case may be, should ensure
+% that the author has continued access to these two styles.
+%
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\@onlinecite{\def\@onlinecite{\citealp}}{}%
+ \@ifxundefined\@textcite{\def\@textcite{\citet}}{}%
+}%
+\DeclareRobustCommand\onlinecite{\@onlinecite}%
+\DeclareRobustCommand\textcite{\@textcite}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{thebibliography}%
+% \begin{macro}{\present@bibnote}%
+% We put a tail patch into \cmd\thebibliogrphy\ and
+% a headpatch into \cmd\endthebibliography.
+%
+% We also apply a fix to the \cmd\list\ procedure
+% so that, at least within the bibliography,
+% items are not formatted via \cmd\parshape,
+% which caused problems during column balancing.
+% (Other list-like environments may also require fixing,
+% but we will save that for another day.)
+%
+% Here we provide a default treatment for frontmatter notes
+% deferred to the bibliography; a journal substyle
+% might want to override the definition of \cmd\present@bibnote.
+% \begin{macrocode}
+\renewenvironment{thebibliography}[1]{%
+ \NAT@thebibliography{#1}%
+ \@clubpenalty\clubpenalty
+ \let\@TBN@opr\present@bibnote
+ \@FMN@list
+}{%
+ \@endnotesinbib
+ \edef\@currentlabel{\arabic{NAT@ctr}}%
+ \label{LastBibItem}%
+ \NAT@endthebibliography
+ \global\let\auto@bib\@empty
+}%
+\def\present@bibnote#1#2{%
+ \item[%
+ \textsuperscript{%
+ \normalfont
+ \Hy@raisedlink{\hyper@anchorstart{frontmatter@#1}\hyper@anchorend}%
+ \begingroup
+ \c@footnote#1\relax
+ \frontmatter@thefootnote
+ \endgroup
+ }%
+ ]#2\par
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{environment}
+%
+% \begin{macro}{\place@bibnumber@sup}
+% \begin{macro}{\place@bibnumber@inl}
+% For producing the \cmd\bibitem\ device,
+% we define two procedures to select from.
+%
+% Note that we could have used \classname{natbib}'s \cmd\ifNAT@super\
+% switch, but it does not allow for altering the meaning of \cmd\bibnumfmt.
+% \begin{macrocode}
+\def\place@bibnumber@sup#1{\textsuperscript{#1}}%
+\def\place@bibnumber@inl#1{[#1]}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%% \begin{macro}{\@cite}
+%% \begin{macro}{\nocite}
+% \begin{macro}{write@bibliographystyle}
+% We wish to delay committing the \cmd\bibliographystyle\ until as late as possible.
+% The journal substyle will define a default bibliography style, and
+% the document's explicit \cmd\bibliographystyle\ command, if any, will override that default.
+%% For the sake of Bib\TeX, we must execute the \cmd\bibliographystyle\ command
+%% (putting a \cmd\bibstyle\ command into the auxiliary file)
+%% somewhere before the first \cmd\cite\ command (or any other like command),
+%% which puts a \cmd\citation\ command into the auxiliary file.
+%%
+%% Therefore, we headpatch the two procedures in \classname{natbib} that can result in
+%% the appearance in the auxiliary file of a \cmd\citation\ command.
+%% These two procedures are \cmd\@cite\ and \cmd\nocite.
+%%
+%% Not!
+%
+% The \cmd\bibstyle\ command may appear quite late in the \filename{.aux} file.
+% We now delay the automatic writing of the \cmd\bibstyle\ command to the end of the job.
+%
+% The procedure \cmd\write@bibliographystyle\ tests whether a \cmd\bibliographystyle\ command has
+% already been given.
+% If not, it effectively executes the needed \cmd\bibliographystyle\ command, then neutralizes itself
+% (we only need to do this once per job).
+%
+% \begin{macrocode}
+%\AtBeginDocument{%
+% \let\natbib@@cite\@cite
+% \def\@cite{\write@bibliographystyle\natbib@@cite}%
+% \let\natbib@nocite\nocite
+% \def\nocite{\write@bibliographystyle\natbib@nocite}%
+%}%
+\def\write@bibliographystyle{%
+ \@ifxundefined\@bibstyle{}{%
+ \expandafter\bibliographystyle@latex\expandafter{\@bibstyle}%
+ }%
+ \global\let\write@bibliographystyle\relax
+}%
+\AtEndDocument{\write@bibliographystyle}%
+% \end{macrocode}
+% \end{macro}
+%% \end{macro}
+%% \end{macro}
+%
+% \begin{macro}{\super@cite}
+% \begin{macro}{\super@cite@}
+% The \cmd\super@cite\ procedure takes the place of \cmd\@citex\ and implements the feature of the
+% \classoption{citeautoscript} class option.
+% This means that the document should be marked up as if citations were \emph{not} superscripted,
+% and then if you select a journal substyle that has superscripted citations, \revtex\ will do its best
+% to alter the formatting of the \cmd\cite s to accomodate superscript style.
+%
+% Note that the commands \cmd\onlinecite\ and \cmd\textcite\ are not affected by this procedure.
+%
+% Here's a subtle one: when is the argument of \cmd\super@cite@@\ not the same as the token \cmd\@let@token?
+% Answer: when the latter is \cmd\@sptoken! This case has to be handled separately.
+%
+% \begin{macrocode}
+\def\super@cite[#1][#2]#3{%
+ \leavevmode
+ \skip@\lastskip
+ \unskip
+ \begingroup
+ \def\@tempa{[#1][#2]{#3}}%
+ \super@cite@
+}%
+\def\super@cite@{%
+ \futurelet\@let@token\super@cite@@
+}%
+\long\def\super@cite@@#1{%
+ \@ifx{\@let@token\@sptoken}{%
+ \aftergroup\@sptoken\false@sw
+ }{%
+ \@ifx{\@let@token.}{\true@sw}{%
+ \@ifx{\@let@token,}{\true@sw}{%
+ \@ifx{\@let@token'}{\true@sw}{%
+ \@ifx{\@let@token)}{\true@sw}{%
+ \false@sw
+ }%
+ }%
+ }%
+ }%
+ }%
+ {%
+ #1%
+ \super@cite@
+ }{%
+ \expandafter\@citex@NAT\@tempa\endgroup
+ #1%
+ }%
+}%
+\AtBeginDocument{%
+ \citeautoscript@sw{%
+ \@ifx{\place@bibnumber\place@bibnumber@sup}{%
+ \let\@citex@NAT\@citex\let\@citex\super@cite
+ }{}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% Resolve an incompatability between \classname{natbib} and \classname{listings}.
+% The latter package tests \cmd\chapter (which has now been \cmd\let\ to \cmd\relax\ as a side effect \classname{natbib}'s use of \LaTeX's \cmd\@ifundefined).
+%
+% We couch our fix in such terms that will not be disruptive if \cmd\chapter\ is actually defined at this point.
+% \begin{macrocode}
+\@ifx{\chapter\relax}{\let\chapter\@undefined}{}%
+% \end{macrocode}
+%
+%
+% \subsubsection{\cs{endnote}s and \cs{rtx@bibnote}s}
+% FIXME: check hyperref compatibility!
+%
+% \begin{macro}{\mini@note}
+% \begin{macro}{\save@note}
+% \begin{macrocode}
+\def\mini@note{\save@note\mini@notes}%Implicit #1
+\def\save@note#1#2{%
+ \stepcounter{footnote}%
+ \protected@xdef\@thefnmark{\the\c@footnote}%
+ \@footnotemark
+ \expandafter\g@addto@macro
+ \expandafter#1%
+ \expandafter{%
+ \expandafter \@@footnotetext
+ \expandafter {\@thefnmark}{#2}%
+ }%
+}%
+\long\def\@@footnotetext#1{\def\@thefnmark{#1}\@footnotetext}%
+\let\mini@notes\@empty
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\endnote}
+% A version of footnote that appears at the end of the document.
+% Actually it just appears where \cmd\printendnotes\ appears.
+% \begin{macrocode}
+\def\endnote{%
+ \begingroup
+ \aftergroup\@footnotemark
+ \aftergroup\@endnotetext
+ \@ifnextchar[{%
+ \@xendnote
+ }{%
+ \stepcounter{footnote}%
+ \protected@xdef\@tempa{\thefootnote}%
+ \expandafter\@xendnote\expandafter[\@tempa]%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xendnote}
+% \begin{macrocode}
+\def\@xendnote[#1]{%
+ \begingroup
+ \c@footnote#1\relax
+ \unrestored@protected@xdef\@thefnmark{endnote\thefootnote}%
+ \endgroup
+ \endgroup
+}%
+\def\@endnotemark{%
+ \expandafter\cite\expandafter{\@thefnmark}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endnote@ext}
+% \begin{macrocode}
+\def\endnote@ext{.end}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@endnotetext}
+% The commands \cmd\label, \cmd\index, and \cmd\glossary,
+% which are robustified for \cmd\markright\ and \cmd\addcontentsline,
+% are likewise robustified here.
+%
+% Note the similarity to \cmd\protected@write.
+% \begin{macrocode}
+\long\def\@endnotetext#1{%
+ \@ifxundefined\@endnoteout{%
+ \newwrite\@endnoteout
+ \gdef\endnote@stream{\jobname\endnote@ext}%
+ \immediate\openout\@endnoteout\endnote@stream\relax
+ }{}%
+ \begingroup
+ \let\label\relax \let\index\relax \let\glossary\relax
+ \let\cite \relax \let\ref \relax \let\pageref \relax
+ \let\( \relax \let\) \relax \let\\ \relax
+% \let\protect\noexpand
+ \let \protect \@unexpandable@protect
+ \newlinechar`\^^M%
+% \newlinechar`\ %
+ \immediate\write\@endnoteout{\string\@doendnote{\@thefnmark}{#1}}%
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endnotetext}
+% \begin{macrocode}
+\def\endnotetext{%
+ \@ifnextchar[{%
+ \@xendnotenext
+ }{%
+ \protected@xdef\@thefnmark{\thefootnote}%
+ \@endnotetext
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xendnotenext}
+% \begin{macrocode}
+\def\@xendnotenext[#1]{%
+ \begingroup
+ \c@footnote#1\relax
+ \unrestored@protected@xdef\@thefnmark{\thefootnote}%
+ \endgroup
+ \@endnotetext
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\printendnotes}
+% \begin{macrocode}
+\def\printendnotes{%
+ \@ifx{\@endnoteout\@undefined}{}{%
+ \begingroup
+ \c@secnumdepth-\maxdimen
+ \section{%
+ \notesname
+ }%
+ \immediate\closeout\@endnoteout
+ \global\let\@endnoteout\@undefined
+ \begin{enumerate}%
+ \makeatletter
+ \input{\endnote@stream}%
+ \end{enumerate}%
+ \endgroup
+ }%
+}%
+\appdef\class@enddocumenthook{%
+ \printendnotes
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\firstnote@num}
+% \begin{macro}{\set@firstnote}
+%
+% In \revtex, we have permanently altered the way
+% that the footnote counter gets reset at the beginning
+% of the document.
+%
+% If footnotes appear in the bibliography, we initialise
+% the footnote counter to number of cites (found last time)
+% via \cmd\set@firstnote.
+%
+% \begin{macrocode}
+\mathchardef\firstnote@num\z@
+\appdef\class@documenthook{%
+ \global\c@footnote\firstnote@num
+ \appdef\maketitle{\global\c@footnote\firstnote@num}%
+}%
+\def\set@firstnote#1{%
+ \@ifnum{\firstnote@num=#1\relax}{}{%
+ \class@warn@end{Endnote numbers changed: rerun LaTeX}%
+ }%
+ \immediate\write\@mainaux{%
+ \global\chardef\string\firstnote@num#1\relax
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@endnotesinbib}
+% \begin{macro}{\@endnotesinbibliography}
+% We define a function \cmd\@endnotesinbib,
+% and a variant \cmd\@endnotesinbibliography.
+% The former is invoked at the start of
+% the end processing for \enve{thebibliography};
+% the latter is a synonym.
+%
+% The procedure typesets the footnotes that are to
+% appear in the bibliography; the default is to
+% simply arrange for the footnote counter to be
+% reset at the start of the document.
+%
+% The switchover to setting footnotes in the bibliography
+% is done via \cmd\AtBeginDocument\ code that
+% changes the meaning of \cmd\footnote\ and
+% that substitutes the synonym for
+% \cmd\@endnotesinbib.
+%
+% Note that this code make the assumption that
+% the counter used in \env{thebibliography} is \cmd\c@NAT@ctr.
+%
+% \begin{macrocode}
+\def\@endnotesinbib{%
+ \set@firstnote\z@
+}%
+\def\@endnotesinbibliography{%
+ \expandafter\set@firstnote\expandafter{\the\c@NAT@ctr}%
+ \@ifx{\@endnoteout\@undefined}{}{%
+ \immediate\closeout\@endnoteout
+ \global\let\@endnoteout\@undefined
+ \makeatletter
+ \input{\endnote@stream}%
+ }%
+}%
+\appdef\class@documenthook{%
+ \let\@makefnmark@latex\@makefnmark
+ \let\@footnotemark@latex\@footnotemark
+ \footinbib@sw{%
+ \let\footnote\endnote
+ \let\@footnotemark\@endnotemark
+ \let\@makefnmark\@makefnmark@cite
+ \let\@endnotesinbib\@endnotesinbibliography
+ \appdef\class@enddocumenthook{\auto@bib}%
+ \let\printendnotes\relax
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\auto@bib}
+% Under some circumstances, we must typeset the bibliography automatically.
+% For instance, the document specifies footnotes in the bibliography, but contains
+% no bibliography.
+%
+% Note that this facility is not able to work more than once per document.
+% If multiple bibliographys are required (e.g., per article), it will be the responsibility of the journal style
+% to restore \cmd\auto@bib\ to its original meaning so it can be re-invoked.
+% \begin{macrocode}
+\def\auto@bib{%
+ \@ifx@empty\@FMN@list{%
+ \@ifxundefined\@endnoteout{%
+ \false@sw
+ }{%
+ \true@sw
+ }%
+ }{%
+ \true@sw
+ }{%
+ \begin{thebibliography}{}\end{thebibliography}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@doendnote}
+% \begin{macrocode}
+\def\@doendnote#1#2{\bibitem{#1}#2}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \section{Initial setup}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Defer assignment until \cs{AtBeginDocument} time.}
+% Note that this code is executed at \cmd\AtBeginDocument\ time
+% in order to handle a particular timing problem.
+% Please do not move this code any earlier!
+% \begin{macrocode}
+\appdef\class@documenthook{%
+% \end{macrocode}
+% We assert our own page style only if nobody else has done so.
+% Users wishing to customize their documents will be able to invoke a \cmd\pagestyle\
+% command anywhere in the preamble.
+% \begin{macrocode}
+ \@ifxundefined\@evenhead{%
+ \@ifxundefined\@oddhead{%
+ \@ifxundefined\@oddfoot{%
+ \@ifxundefined\@evenfoot{%
+ \preprintsty@sw{%
+ \ps@preprint
+ }{%
+ \ps@article
+ }%
+ }{}%
+ }{}%
+ }{}%
+ }{}%
+ \pagenumbering{arabic}%
+ \normalsize
+ \tabbingsep \labelsep
+ \leftmargin\leftmargini
+ \labelwidth\leftmargin\advance\labelwidth-\labelsep
+ \let\@listi\@listI
+ \@listi
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\twoside@sw{}{%
+% \raggedbottom
+%}%
+% \end{macrocode}
+% We make sure that the ``environment'' component mark is set.
+% \begin{macrocode}
+ \def\curr@envir{document}%
+ \mark@envir{\curr@envir}%
+% \end{macrocode}
+%
+% \changes{v4.0beta 3}{1999/11/13}
+% {Grid changes with ltxgrid}
+% \changes{v4.0beta 4}{2000/04/10}
+% {Also alter how lists get indented.}
+% When setting the column grid, we have to alter the procedure
+% for formatting lists. Because \cmd\twocolumngrid\ requires
+% rebalancing columns at some points, lists must \emph{not}
+% involve the use of \cmd\moveleft, \cmd\moveright, or \cmd\parshape.
+% The alternative procedure only involves the manipulation of
+% \cmd\leftskip\ and \cmd\rightskip.
+%
+% FIXME: Always sloppy??
+% \begin{macrocode}
+ \twocolumn@sw{%
+ \open@column@mlt\tw@
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+ \sloppy
+ \@booleanfalse\raggedcolumn@sw
+ \let\set@listindent\set@listindent@
+ }{%
+ \open@column@one\@ne
+ \set@colht
+ \@floatplacement
+ \@dblfloatplacement
+ \sloppy
+% \raggedbottom
+ \let\set@listindent\set@listindent@parshape
+ }%
+}%
+% \end{macrocode}
+%
+%
+% \section{\cs{appendix}}
+%
+% \begin{macrocode}
+%\newif\ifappendixon
+% \end{macrocode}
+% Note that, within appendices,
+% equations are numbered within sections (appendices).
+% \begin{macrocode}
+\def\appendix{%
+ \par
+%\appendixontrue
+ \setcounter{section}\z@
+ \setcounter{subsection}\z@
+ \setcounter{subsubsection}\z@
+ \def\thesubsection{\arabic{subsection}}%
+ \def\thesubsubsection{\alph{subsubsection}}%
+ \@addtoreset{equation}{section}%
+ \def\theequation@prefix{\thesection}%
+ \addtocontents{toc}{\protect\appendix}%
+ \@ifstar{%
+ \def\thesection{\unskip}%
+ \def\theequation@prefix{A.}%
+ }{%
+ \def\thesection{\Alph{section}}%
+ }%
+}%
+% \end{macrocode}
+%
+% \section{Changing the page grid}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Define three separate environments,
+% defer assignment to \cs{AtBeginDocument} time.
+% }
+%
+% \subsection{Avoiding Grid Changes}%
+%
+% In preprint styles, ``wide text'' is a no-op, and the title page
+% processing involves no grid change.
+%
+% \begin{macro}{\title@column@default}%
+% \begin{macro}{\close@column@default}%
+%
+% \begin{macrocode}
+\def\title@column@default#1{%
+ \minipagefootnote@init
+ #1%
+ \minipagefootnote@foot
+}%
+\def\close@column@default{%
+ \newpage
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Galley Style: Margin Changes}%
+% A variant of preprint processing. Emulate journal appearance somewhat.
+%
+% \begin{environment}{widetext@galley}
+% DPC: We're in galley style so do a lob sided display environment.
+%
+% QUERY: How can we be sure that we are in galley style?
+% ANSWER: as noted elsewhere, require both \cmd\twocolumn@sw\ and \cmd\preprintsty@sw\ to be false.
+% \begin{macrocode}
+\def\galley@outdent{\rightmargin-\columnwidth\advance\rightmargin-\columnsep}%
+\let\widetext@outdent\@empty
+\newenvironment{widetext@galley}{%
+ \list{}{%
+ \topsep \z@skip
+ \listparindent \parindent
+ \itemindent \parindent
+ \leftmargin \z@
+ \parsep \z@\@plus\p@
+ \widetext@outdent
+ \relax
+ }%
+ \item\relax
+}{
+ \endlist
+}%
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \subsection{Grid Changing Via \classname{ltxgrid}}%
+%
+% In case \classoption{twocolumngrid} has been invoked,
+% switch column grid using the column grid-changing commands.
+% Supply stub definitions of those commands here.
+% \changes{v4.0beta 3}{1999/11/13}
+% {grid changes with ltxgrid}
+%
+% \begin{macro}{\title@column@grid}%
+% \begin{macro}{\close@column@grid}%
+% The title block always starts at the top of a new page.
+% \changes{v4.0beta 3}{1999/11/13}
+% {grid changes with ltxgrid}
+%
+% Note that, for the procedure \cmd\close@column@grid,
+% we balance columns by switching to the one-column page grid,
+% then we return to a two-column page grid in anticipation of the
+% upcoming \cmd\clearpage.
+% \begin{macrocode}
+\def\title@column@grid#1{%
+ \minipagefootnote@init
+ \onecolumngrid
+ \begingroup
+ \let\@footnotetext\frontmatter@footnotetext
+ \let\set@footnotewidth\set@footnotewidth@ii
+ #1%
+ \endgroup
+ \twocolumngrid
+ \minipagefootnote@foot
+}%
+\def\close@column@grid{%
+ \balancelastpage@sw{%
+ \onecolumngrid
+% \twocolumngrid
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{environment}{widetext@grid}
+% \changes{v4.0beta 3}{1999/11/13}
+% {grid changes via ltxgrid procedures}
+% \changes{v4.0beta 5}{2000/11/21}
+% {adornments above and below.}
+% We slip into the one-column page grid
+% within the scope of this environment.
+%
+% Note that we set adornments above and below the \env{widettext}.
+% These are set as leaders, so they will disappear at a page break.
+% \begin{macrocode}
+\newenvironment{widetext@grid}{%
+ \par\ignorespaces
+ \setbox\widetext@top\vbox{%
+ \vskip15\p@
+ \hb@xt@\hsize{%
+ \leaders\hrule\hfil
+ \vrule\@height6\p@
+ }%
+ \vskip6\p@
+ }%
+ \setbox\widetext@bot\hb@xt@\hsize{%
+ \vrule\@depth6\p@
+ \leaders\hrule\hfil
+ }%
+ \onecolumngrid
+ \dimen@\ht\widetext@top\advance\dimen@\dp\widetext@top
+ \cleaders\box\widetext@top\vskip\dimen@
+ \let\set@footnotewidth\set@footnotewidth@ii
+}{%
+ \par
+ \setbox\widetext@bot\vbox{%
+ \hb@xt@\hsize{\hfil\box\widetext@bot}%
+ \vskip14\p@
+ }%
+ \dimen@\ht\widetext@bot\advance\dimen@\dp\widetext@bot
+ \cleaders\box\widetext@bot\vskip\dimen@
+ \twocolumngrid\global\@ignoretrue
+ \@endpetrue
+}%
+\newbox\widetext@top
+\newbox\widetext@bot
+% \end{macrocode}
+% \end{environment}
+%
+%
+% Decide, finally, how the page grid is to be manipulated.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \twocolumn@sw{%
+ \let@environment{widetext}{widetext@grid}%
+ \let\title@column\title@column@grid
+ \let\close@column\close@column@grid
+ }{%
+ \let@environment{widetext}{widetext@galley}%
+ \preprintsty@sw{%
+% \end{macrocode}
+% Change the page grid not at all.
+% \begin{macrocode}
+ }{%
+% \end{macrocode}
+% If we are galley style, change the page margin only.
+% \begin{macrocode}
+ \galley@sw{%
+ \let\widetext@outdent\galley@outdent
+ }{%
+ }%
+ }%
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\title@column}
+% Provide a default meaning for \cmd\title@column\
+% in case it was never defined.
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\title@column{%
+ \let\title@column\title@column@default
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Old font commands}
+%
+% \begin{macrocode}
+\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}
+\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
+\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
+% \end{macrocode}
+%
+% \section{English-Language Texts}
+% As this class is just for English language journals, we
+% could hardwire these texts,
+% but to make it easier to use this as a
+% basis for the code for similar journal styles, separate out all the
+% fixed text strings into babel-style macros of the form
+% |\|\ldots|name|
+%
+% Note: for babel compatability, use version 1999/05/05 v3.6x or later.
+%
+% Some of these might need changing in the society-specific code.
+%
+% \begin{macro}{\today}
+% Procedure \cmd\today\ is used in the article class, but not in
+% this document class.
+% \begin{macrocode}
+\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}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\notesname}
+% Text entity \cmd\notesname\ is used in \cmd\printendnotes.
+% \begin{macrocode}
+\def\notesname{Notes}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\partname}
+% Text entity \cmd\partname\ is used in \cmd\@part.
+% \begin{macrocode}
+\def\partname{Part}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tocname}
+% Text entity \cmd\tocname\ is used in \cmd\tableofcontents,
+% as defined in the standard \LaTeX\ book class.
+% \begin{macrocode}
+\def\tocname{Contents}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lofname}
+% Text entity \cmd\lofname\ is used in \cmd\listoffigures,
+% as defined in the standard \LaTeX\ book class.
+% \begin{macrocode}
+\def\lofname{List of Figures}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lotname}
+% Text entity \cmd\lotname\ is used in \cmd\listoftables,
+% as defined in the standard \LaTeX\ book class.
+% \begin{macrocode}
+\def\lotname{List of Tables}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\refname}
+% Text entity \cmd\refname\ is used in \env{thebibliography}.
+% \begin{macrocode}
+\def\refname{References}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\indexname}
+% Text entity \cmd\indexname\ is used in \env{theindex},
+% as defined in the standard \LaTeX\ book class.
+% \begin{macrocode}
+\def\indexname{Index}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\figurename}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Added localization of \cs{figuresname}}
+% Text entity \cmd\figurename\ is used in \env{figure},
+% \cmd\figuresname\ in \cmd\printfigures.
+% \begin{macrocode}
+\def\figurename{FIG.}
+\def\figuresname{Figures}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tablename}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Added localization of \cs{tablesname}}
+% Text entity \cmd\tablename\ is used in \env{table},
+% \cmd\tablesname\ in \cmd\printtables.
+% \begin{macrocode}
+\def\tablename{TABLE}
+\def\tablesname{Tables}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\abstractname}
+% Text entity \cmd\abstractname\ is used in \env{abstract}.
+% \begin{macrocode}
+\def\abstractname{Abstract}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\appendixesname}
+% \begin{macro}{\appendixname}
+% Text entity \cmd\appendixesname\ is used in TOC.
+% \begin{macrocode}
+\def\appendixesname{Appendixes}%
+\def\appendixname{Appendix}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\acknowledgmentsname}
+% Text entity \cmd\acknowledgmentsname\ is used in \env{acknowledgments}.
+% \begin{macrocode}
+\def\acknowledgmentsname{Acknowledgments}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\journalname}
+% This should be set by the society journal options, eg `pra'.
+% \begin{macrocode}
+\def\journalname{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\copyrightname}
+% Default layout does not assign copyright, but a journal that wants
+% to might use this.
+% \begin{macrocode}
+\def\copyrightname{??}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\andname}
+% The text string ``and'' for use in author lists.
+% \begin{macrocode}
+\def\andname{and}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@pacs@name}
+% \begin{macro}{\@keys@name}
+% The text string prepended to PACS numbers, resp. to keywords.
+% \begin{macrocode}
+\def\@pacs@name{PACS numbers: }%
+\def\@keys@name{Keywords: }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ppname}
+% The text string ``pp'' for use in page ranges.
+% \begin{macrocode}
+\def\ppname{pp}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\numbername}
+% The text string ``number'' for use in article reference.
+% \begin{macrocode}
+\def\numbername{number}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\volumename}
+% The text string ``volume'' for use in article reference.
+% \begin{macrocode}
+\def\volumename{volume}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Dated@name}
+% \begin{macro}{\Received@name}
+% \begin{macro}{\Revised@name}
+% \begin{macro}{\Accepted@name}
+% \begin{macro}{\Published@name}
+% These texts are used in the \cmd\date, et al. commands.
+% \begin{macrocode}
+\def\Dated@name{Dated: }%
+\def\Received@name{Received }%
+\def\Revised@name{Revised }%
+\def\Accepted@name{Accepted }%
+\def\Published@name{Published }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \section{Legacy Commands}
+% We deffine some commands left over from version 3.1, or give default meanings.
+% Some definitions can be overridden
+% in the document preamble or in included packages.
+%
+% Note on the namespace: command names like \cmd\REV@\emph{name} are used here,
+% because it is not clear that any of this code is generally useful.
+% \begin{macrocode}
+\def\address{\replace@command\address\affiliation}%
+\def\altaddress{\replace@command\altaddress\altaffiliation}%
+\newenvironment{references}{%
+ \class@warn@end{The references environment is not supported; use thebibliography instead.}
+ \gdef\references{\thebibliography{}}\references
+}{%
+ \endthebibliography
+}%
+\def\draft{%
+ \class@warn@end{Command \string\draft\space is obsolete;^^JInvoke option draft instead.}%
+ \@booleantrue\draft@sw
+}%
+\def\tighten{%
+ \class@warn@end{Command \string\tighten\space is obsolete;^^JInvoke option tightenlines instead.}%
+ \@booleantrue\tightenlines@sw
+}%
+\def\tableline{%
+ \noalign{%
+ \class@warn@end{Command \string\tableline\space is obsolete;^^JUse \string\colrule\space instead.}%
+ \global\let\tableline\colrule
+ }%
+ \tableline
+}%
+\def\case{\replace@command\case\frac}%
+\def\slantfrac{\replace@command\slantfrac\frac}%
+\def\tablenote{\replace@command\tablenote\footnote}%
+\def\tablenotemark{\replace@command\tablenotemark\footnotemark}%
+\def\tablenotetext{\replace@command\tablenotetext\footnotetext}%
+% Lose the following definition:
+\DeclareRobustCommand\REV@text[1]{%
+ \relax
+ \ifmmode
+ \mathchoice
+ {\hbox{{\everymath{\displaystyle }#1}}}%
+ {\hbox{{\everymath{\textstyle }#1}}}%
+ {\hbox{{\everymath{\scriptstyle }\let\f@size\sf@size\selectfont#1}}}%
+ {\hbox{{\everymath{\scriptscriptstyle}\let\f@size\ssf@size\selectfont#1}}}%
+ \glb@settings
+ \else
+ \mbox{#1}%
+ \fi
+}%
+% Lose the following definition:
+\DeclareRobustCommand\REV@bbox[1]{%
+ \relax
+ \ifmmode
+ \mathchoice
+ {\hbox{{\everymath{\displaystyle }\boldmath$#1$}}}%
+ {\hbox{{\everymath{\textstyle }\boldmath$#1$}}}%
+ {\hbox{{\everymath{\scriptstyle }\boldmath$#1$}}}%
+ {\hbox{{\everymath{\scriptscriptstyle}\boldmath$#1$}}}%
+ \glb@settings
+ \else
+ \mbox{#1}%
+ \fi
+}%
+\DeclareRobustCommand\REV@bm[1]{%
+ \class@warn@end{To use \string\bm, please load the bm package!}%
+ \global\let\bm\relax
+}%
+\def\FL{\obsolete@command\FL}%
+\def\FR{\obsolete@command\FR}%
+\def\narrowtext{\obsolete@command\narrowtext}%
+\def\mediumtext{\obsolete@command\mediumtext}%
+\newenvironment{quasitable}{%
+ \let@environment{tabular}{longtable}%
+}{%
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\text}
+% \begin{macro}{\bm}
+% \begin{macro}{\bibinfo}
+% \begin{macro}{\eprint}
+% \begin{macro}{\url}
+%
+% If not otherwise defined, give default meanings to certain commands.
+% \changes{v4.0beta 4}{2000/04/10}
+% {eprint takes an aoptional argument, syntactical only in this case.}
+% \begin{macrocode}
+\appdef\class@inithook{%
+ \@ifxundefined\text{\let\text\REV@text}{}%
+ \@ifxundefined\bm{\let\bm\REV@bm}{}%
+ \providecommand\bibinfo[2]{#2}%
+ \providecommand\eprint[2][]{#2}%
+ \providecommand\url[1]{#1}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bbox}
+%
+% \begin{macrocode}
+\def\bbox#1{%
+ \class@warn@end{\string\bbox\space is obsolete,^^Jload the bm package and use \string\bm\space instead.}%
+ \global\let\bbox\relax
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mathletters}
+%
+% \begin{macrocode}
+\newenvironment{mathletters}{%
+ \class@warn@end{Environment {mathletters} is obsolete;^^Jload the amsmath package and use {subequations}!}%
+ \global\let\mathletters\@empty
+}{%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eqnum}
+%
+% \begin{macrocode}
+\def\eqnum#1{%
+ \class@warn@end{\string\eqnum\space is obsolete, load the amsmath package and use \string\tag!}%
+ \global\let\eqnum\@gobble
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% We read in the symbol definitions.
+% \begin{macrocode}
+\RequirePackage{revsymb}%
+\appdef\class@inithook{\revsymb@inithook}%
+% \end{macrocode}
+%
+% \section{Endgame for the Document Class}
+%
+% This section contains definitions related to the
+% end-of-class processing:
+% we want to control exactly what happens next.
+%
+% We provide for a ``job macro package'' that can override
+% definitions made by the class or any other packages it loads.
+% We act on the value of \cmd\secnumarabic@sw;
+% this code is a model for dealing with the job macro package.
+% We also install a the very last procedures into
+% \cmd\AtEndOfClass, ones that need to tail on to
+% any processing performed either by the
+% class, by any of its included packages, or
+% by the job macro package and any packages it may have loaded.
+%
+% \subsection{Job Macro Package}
+% You can create a ``job macro package'' for your document
+% that will be read in automatically every time
+% your document is processed.
+% Thus, if your job is a file called \file{myarticle.tex},
+% then the file \file{myarticle.rty} will be read in
+% just the same as if you had placed a
+% \cmd\usepackage|{myarticle.rty}| statement
+% immediately following your \cmd\documentclass\ statement.
+%
+% Within your \file{.rty} file,
+% you can define and use control sequence names that use the |@| character
+% and you can override any of the definitions or assignments made
+% by the \revtex\ document class or the selected journal substyle.
+% That is, you have the power to really mess things up badly.
+%
+% If you choose to have a job macro package, you are well
+% advised to read the \LaTeX\ guide to document classes,
+% \filename{clsguide.tex} or read up on the subject
+% in a book line the \LaTeX\ Companion.
+%
+% The file \filename{template.rty} contains a template for
+% creating your own job macro package.
+%
+% \begin{macrocode}
+\AtEndOfClass{%
+ \InputIfFileExists{\jobname.rty}{}{}%
+}%
+% \end{macrocode}
+%
+% \subsection{\cs{secnumarabic@sw}}\label{sec:secnumarabic}
+% \begin{macro}{\secnumarabic@sw}
+% The flag \cmd\secnumarabic@sw\ signifies that sectioning commands are
+% to be numbered arabic.
+% The effect of this command should override any settings
+% made by the journal substyle or by the job macro package.
+% However, it should be lower in precedence to definitions
+% appearing in the document preamble.
+% Therefore, we install its code into \cmd\AtEndOfClass,
+% but do it \emph{after} the corresponding code
+% for the journal substyle and the job macro package.
+%
+% Note: \cmd\thesection\ must \emph{not} be redefined,
+% say, at \cmd\AtBeginDocument\ time by some delayed code.
+% \begin{macrocode}
+\AtEndOfClass{%
+ \@ifxundefined\secnumarabic@sw{\@booleanfalse\secnumarabic@sw}{}%
+ \secnumarabic@sw{%
+ \def\p@section {}%
+ \def\thesection {\arabic{section}}%
+ \def\p@subsection {}%
+ \def\thesubsection {\thesection.\arabic{subsection}}%
+ \def\p@subsubsection {}%
+ \def\thesubsubsection {\thesubsection.\arabic{subsubsection}}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Hook for default values of Booleans}
+% This portion of the code for this class file
+% \emph{must} appear at the very end.
+% \begin{macro}{\defaults@hook}
+% The procedure \cmd\defaults@hook\ should hereby
+% be the very last to be installed into \cmd\AtBeginDocument.
+% We provide it with a default in case it has not been
+% used up til now.
+%
+% CHECKME: is any other hook installed later than \cmd\defaults@hook?
+% \begin{macrocode}
+\AtEndOfClass{%
+ \appdef\class@documenthook{%
+ \defaults@hook
+ }%
+}%
+\@ifxundefined\defaults@hook{\let\defaults@hook\@empty}{}%
+% \end{macrocode}
+% \end{macro}
+%
+% End of the class file.
+% \begin{macrocode}
+%</class-pst>
+% \end{macrocode}
+%
+%
+% \section{Symbols: the \texttt{revsymb} module}
+% We immediately define a utility command: this module's warning.
+% \begin{macrocode}
+%<*revsymb>
+\def\REVSYMB@warn#1{\PackageWarningNoLine{revsymb}{#1}}%
+% \end{macrocode}
+%
+% \begin{macro}{\lambdabar}
+% \begin{macrocode}
+\DeclareRobustCommand\lambdabar{%
+ \bgroup
+ \def\@tempa{%
+ \hbox{%
+ \raise.73\ht\z@
+ \hb@xt@\z@{%
+ \kern.25\wd\z@
+ \vrule \@width.5\wd\z@\@height.1\p@\@depth.1\p@
+ \hss
+ }%
+ \box\z@
+ }%
+ }%
+ \mathchoice
+ {\setbox\z@\hbox{$\displaystyle \lambda$}\@tempa}%
+ {\setbox\z@\hbox{$\textstyle \lambda$}\@tempa}%
+ {\setbox\z@\hbox{$\scriptstyle \lambda$}\@tempa}%
+ {\setbox\z@\hbox{$\scriptscriptstyle\lambda$}\@tempa}%
+ \egroup
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\openone}
+% DPC: Really should use a font that includes this glyph.
+% Unfortunately not in AMS ones, but is in bbold, cmbb.
+% (I think, must check),
+% \changes{v4.d}{1998/01/31}
+% {use font-dependent spacing}
+% FIXME: check for bbold.
+% \begin{macrocode}
+\DeclareRobustCommand\openone{\leavevmode\hbox{\small1\normalsize\kern-.33em1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\corresponds}
+% \begin{macro}{\overdots}
+% \begin{macro}{\overcirc}
+% J\"org Knappen suggests the replacements:
+% replace \cmd\corresponds\ with \cmd\triangleq, source \classname{amssymb};
+% replace \cmd\overcirc\ with \cmd\mathring, source \classname{latex2e};
+% replace \cmd\overdots\ with \cmd\dddot, source \classname{amsmath}.
+%
+% Any use of any of these commands will result in a warning message at the end
+% of the log file. If the corresponding package is not loaded, a
+% definition will quietly be provided.
+% \begin{macrocode}
+\DeclareRobustCommand\corresponds{\replace@command\corresponds\triangleq}%
+\DeclareRobustCommand\overcirc{\replace@command\overcirc\mathring}%
+\DeclareRobustCommand\overdots{\replace@command\overdots\dddot}%
+\DeclareRobustCommand\REV@triangleq{%
+ {\lower.2ex\hbox{=}}{\kern-.75em^\triangle}%
+}%
+\DeclareRobustCommand\REV@dddot[1]{%
+ \@ontopof{#1}{\cdots}{1.0}\mathord{\box2}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\succsim}
+% \begin{macro}{\precsim}
+% \begin{macro}{\lesssim}
+% \begin{macro}{\gtrsim}
+% \begin{macro}{\alt}
+% \begin{macro}{\agt}
+% These version 3.1 commands are always supplied,
+% but the definitions in \classname{amssymb} are preferred.
+% \begin{macrocode}
+\DeclareRobustCommand\altsuccsim{\succ\kern-.9em_\sim\kern.3em}%
+\DeclareRobustCommand\altprecsim{\prec\kern-1em_\sim\kern.3em}%
+\let\REV@succsim\altsuccsim
+\let\REV@precsim\altprecsim
+\DeclareRobustCommand\REV@lesssim{\mathrel{\mathpalette\vereq{<}}}%
+\DeclareRobustCommand\REV@gtrsim{\mathrel{\mathpalette\vereq{>}}}%
+\DeclareRobustCommand\alt{\lesssim}
+\DeclareRobustCommand\agt{\gtrsim}
+\def\vereq#1#2{%
+ \lower3\p@\vbox{%
+ \baselineskip1.5\p@
+ \lineskip1.5\p@
+ \ialign{$\m@th#1\hfill##\hfil$\crcr#2\crcr\sim\crcr}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\tensor}
+% \begin{macro}{\overstar}
+% \begin{macro}{\loarrow}
+% \begin{macro}{\roarrow}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: remove duplicates}
+% \begin{macrocode}
+\DeclareRobustCommand\tensor[1]{\@ontopof{#1}{\leftrightarrow}{1.15}\mathord{\box2}}
+\DeclareRobustCommand\overstar[1]{\@ontopof{#1}{\ast}{1.15}\mathord{\box2}}
+\DeclareRobustCommand\loarrow[1]{\@ontopof{#1}{\leftarrow}{1.15}\mathord{\box2}}
+\DeclareRobustCommand\roarrow[1]{\@ontopof{#1}{\rightarrow}{1.15}\mathord{\box2}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@ontopof}
+% \begin{macrocode}
+\def\@ontopof#1#2#3{%
+ {%
+ \mathchoice
+ {\@@ontopof{#1}{#2}{#3}\displaystyle \scriptstyle }%
+ {\@@ontopof{#1}{#2}{#3}\textstyle \scriptstyle }%
+ {\@@ontopof{#1}{#2}{#3}\scriptstyle \scriptscriptstyle}%
+ {\@@ontopof{#1}{#2}{#3}\scriptscriptstyle\scriptscriptstyle}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@ontopof}
+% Same as \revtex3, more or less.
+% \begin{macrocode}
+\def\@@ontopof#1#2#3#4#5{%
+ \setbox\z@\hbox{$#4#1$}%
+ \setbox\f@ur\hbox{$#5#2$}%
+ \setbox\tw@\null\ht\tw@\ht\z@ \dp\tw@\dp\z@
+ \@ifdim{\wd\z@>\wd\f@ur}{%
+ \setbox\f@ur\hb@xt@\wd\z@{\hss\box\f@ur\hss}%
+ \mathord{\rlap{\raise#3\ht\z@\box\f@ur}\box\z@}%
+ }{%
+ \setbox\f@ur\hb@xt@.9\wd\f@ur{\hss\box\f@ur\hss}%
+ \setbox\z@\hb@xt@\wd\f@ur{\hss$#4\relax#1$\hss}%
+ \mathord{\rlap{\copy\z@}\raise#3\ht\z@\box\f@ur}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frak}
+% Deal with legacy \cmd\frak:
+% if \classname{amsfonts} not loaded, defined in such a way as to ask for that package.
+% Also, says to use \cmd\mathfrak\ instead.
+% \begin{macrocode}
+\DeclareRobustCommand\frak{%
+ \REVSYMB@warn{%
+ Command \string\frak\space unsupported:^^J%
+ please use \string\mathfrak\space instead.%
+ }%
+ \global\let\frak\mathfrak
+ \frak
+}%
+\DeclareRobustCommand\REV@mathfrak{%
+ \REVSYMB@warn{%
+ Command \string\mathfrak\space undefined:^^J%
+ please specify the amsfonts or amssymb option!%
+ }%
+ \global\let\mathfrak\@firstofone
+ \mathfrak
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Bbb}
+% Deal with legacy \cmd\Bbb:
+% if \classname{amsfonts} not loaded, defined in such a way as to ask for that package.
+% Also, says to use \cmd\mathbb\ instead.
+% \begin{macrocode}
+\DeclareRobustCommand\Bbb{%
+ \REVSYMB@warn{%
+ Command \string\Bbb\space unsupported:^^J%
+ please use \string\mathbb\space instead.%
+ }%
+ \global\let\Bbb\mathbb
+ \Bbb
+}%
+\DeclareRobustCommand\REV@mathfrak{%
+ \REVSYMB@warn{%
+ Command \string\mathbb\space undefined:^^J%
+ please specify the amsfonts or amssymb option!%
+ }%
+ \global\let\mathbb\@firstofone
+ \mathbb
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\Bigglb}
+% Deal with legacy bold delimiters.
+% Each of the following takes an implicit argument consisting of
+% the delimiter to be made big and bold.
+% FIXME: \cmd\DeclareBoldMathCommand\ is not the right tool!
+% \begin{macrocode}
+\def\Bigglb{\REV@boldopen \Bigg}%
+\def\Biglb {\REV@boldopen \Big }%
+\def\bigglb{\REV@boldopen \bigg}%
+\def\biglb {\REV@boldopen \big }%
+\def\Biggrb{\REV@boldclose\Bigg}%
+\def\Bigrb {\REV@boldclose\Big }%
+\def\biggrb{\REV@boldclose\bigg}%
+\def\bigrb {\REV@boldclose\big }%
+\def\REV@pmb#1{%
+ \hbox{%
+ \setbox\z@=\hbox{#1}%
+ \kern-.02em\copy\z@\kern-\wd\z@
+ \kern .04em\copy\z@\kern-\wd\z@
+ \kern-.02em
+ \raise.04em\copy\z@
+ }%
+}%
+\def\REV@boldopen #1#2{\mathopen {\REV@pmb{$#1#2$}}}%
+\def\REV@boldclose#1#2{\mathclose{\REV@pmb{$#1#2$}}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AtBeginDocument}
+% Package dependencies are taken care of
+% \cmd\AtBeginDocument\ time.
+% \begin{macrocode}
+\def\revsymb@inithook{%
+ \@ifxundefined\dddot{\let\dddot\REV@dddot}{}%
+ \@ifxundefined\triangleq{\let\triangleq\REV@triangleq}{}%
+ \@ifxundefined\succsim{\let\succsim\altsuccsim}{}%
+ \@ifxundefined\precsim{\let\precsim\altprecsim}{}%
+ \@ifxundefined\lesssim{\let\lesssim\REV@lesssim}{}%
+ \@ifxundefined\gtrsim {\let\gtrsim \REV@gtrsim }{}%
+ \@ifxundefined\mathfrak{\let\mathfrak\REV@mathfrak}{}%
+ \@ifxundefined\mathbb{\let\mathbb\REV@mathbb}{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+%</revsymb>
+% \end{macrocode}
+%
+% \section{The \classoption{10pt} class option: the \texttt{10pt} module}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: all code for \protect\classoption{10pt} is in this module.}
+% The file \file{10pt.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@pointsize\ has the value 10.
+%
+% \begin{macrocode}
+%<*10pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\normalsize{%
+ \@setfontsize\normalsize\@xpt{11.5}%
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\small{%
+ \@setfontsize\small\@ixpt{10.5}%
+ \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ \@plus2\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{%
+ \leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\footnotesize{%
+ \@setfontsize\footnotesize\@viiipt{9.5pt}%
+ \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
+ \def\@listi{%
+ \leftmargin\leftmargini
+ \topsep 3\p@ \@plus\p@ \@minus\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\scriptsize{%
+ \@setfontsize\scriptsize\@viipt\@viiipt
+}%
+\def\tiny{%
+ \@setfontsize\tiny\@vpt\@vipt
+}%
+\def\large{%
+ \@setfontsize\large\@xiipt{14pt}%
+}%
+\def\Large{%
+ \@setfontsize\Large\@xivpt{18pt}%
+}%
+\def\LARGE{%
+ \@setfontsize\LARGE\@xviipt{22pt}%
+}%
+\def\huge{%
+ \@setfontsize\huge\@xxpt{25pt}%
+}%
+\def\Huge{%
+ \@setfontsize\Huge\@xxvpt{30pt}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\appdef\class@documenthook{%
+ \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
+ \twoside@sw{%
+% \oddsidemargin -.1in
+% \evensidemargin -.4in
+ \oddsidemargin -20pt
+ \evensidemargin -20pt
+ \marginparwidth 107pt
+ }{%
+ \oddsidemargin -.25in
+ \evensidemargin -.25in
+ \marginparwidth 30pt
+ }%
+%}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\marginparsep 6pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\topmargin -61pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\headheight 25pt
+\headsep 16pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\topskip 10pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\footskip 30pt
+% \end{macrocode}
+%
+% Was: 57\cmd\baselineskip + \cmd\topskip
+% \begin{macrocode}
+%\appdef\set@pica@hook{%
+ \textheight = 56pc
+%}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\textwidth42.5pc
+% \end{macrocode}
+%
+% \begin{macrocode}
+\columnsep 1.5pc
+\columnseprule 0pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\footnotesep 1pt
+\skip\footins 39pt plus 4pt minus 2pt
+\def\footnoterule{\kern-19pt\hrule width.5in\kern18.6pt\relax}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\floatsep 12pt plus 2pt minus 2pt
+\textfloatsep 20pt plus 2pt minus 4pt
+\intextsep 12pt plus 2pt minus 2pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\dblfloatsep 12pt plus 2pt minus 2pt
+\dbltextfloatsep 20pt plus 2pt minus 4pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@fptop 0pt plus 1fil
+\@fpsep 8pt plus 2fil
+\@fpbot 0pt plus 1fil
+\@dblfptop 0pt plus 1fil
+\@dblfpsep 8pt plus 2fil
+\@dblfpbot 0pt plus 1fil
+% \end{macrocode}
+%
+% \begin{macrocode}
+\marginparpush 5pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\parskip 0pt plus 1pt
+\parindent 10pt
+\emergencystretch8\p@
+% \end{macrocode}
+%
+% \begin{macrocode}
+\partopsep 2pt plus 1pt minus 1pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\leftmargini 25pt
+\leftmarginii 22pt
+\leftmarginiii 18.7pt
+\leftmarginiv 17pt
+\leftmarginv 10pt
+\leftmarginvi 10pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listI{%
+ \leftmargin\leftmargini
+ \parsep 4\p@ plus2\p@ minus\p@
+ \topsep 8\p@ plus2\p@ minus4\p@
+ \itemsep 4\p@ plus2\p@ minus\p@
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\labelsep 4pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listii{%
+ \leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep 4\p@ plus2\p@ minus\p@
+ \parsep 2\p@ plus\p@ minus\p@
+ \itemsep \parsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listiii{%
+ \leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep 2\p@ plus\p@ minus\p@
+ \parsep \z@
+ \partopsep \p@ plus\z@ minus\p@
+ \itemsep \topsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listiv{%
+ \leftmargin\leftmarginiv
+ \labelwidth\leftmarginiv
+ \advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listv{%
+ \leftmargin\leftmarginv
+ \labelwidth\leftmarginv
+ \advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listvi{%
+ \leftmargin\leftmarginvi
+ \labelwidth\leftmarginvi
+ \advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</10pt>
+% \end{macrocode}
+%
+% \section{The \classoption{11pt} class option: the \texttt{11pt} module}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: all code for \protect\classoption{11pt} is in this module.}
+% The file \file{11pt.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@pointsize\ has the value 11.
+%
+% \begin{macrocode}
+%<*11pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\normalsize{%
+ \@setfontsize\normalsize\@xipt{13.6}%
+ \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\small{%
+ \@setfontsize\small\@xpt\@xiipt
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 6\p@ \@plus2\p@ \@minus2\p@
+ \parsep 3\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+ \belowdisplayskip \abovedisplayskip
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\footnotesize{%
+ \@setfontsize\footnotesize\@ixpt{11}%
+ \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+ \belowdisplayskip \abovedisplayskip
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\scriptsize{%
+ \@setfontsize\scriptsize\@viiipt{9.5}%
+}%
+\def\tiny{%
+ \@setfontsize\tiny\@vipt\@viipt
+}%
+\def\large{%
+ \@setfontsize\large\@xiipt{14}%
+}%
+\def\Large{%
+ \@setfontsize\Large\@xivpt{18}%
+}%
+\def\LARGE{%
+ \@setfontsize\LARGE\@xviipt{22}%
+}%
+\def\huge{%
+ \@setfontsize\huge\@xxpt{25pt}%
+}%
+\def\Huge{%
+ \@setfontsize\Huge\@xxvpt{30pt}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</11pt>
+% \end{macrocode}
+%
+% \section{The \classoption{12pt} class option: the \texttt{12pt} module}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: all code for \protect\classoption{12pt} is in this module.}
+% The file \file{12pt.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@pointsize\ has the value 12.
+%
+% \begin{macrocode}
+%<*12pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\normalsize{%
+ \@setfontsize\normalsize\@xiipt{14pt}%
+ \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ plus3\p@
+ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+ \let\@listi\@listI
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \def\small{%
+ \@setfontsize\small\@xipt{14.5pt}%
+ \abovedisplayskip 8\p@ \@plus3\p@ \@minus6\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
+ \def\@listi{%
+ \leftmargin\leftmargini
+ \topsep 9\p@ \@plus3\p@ \@minus5\p@
+ \parsep 4.5\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+}%
+% \end{macrocode}
+%
+% Same baselineskip as \cmd\small\ ?
+% \begin{macrocode}
+ \def\footnotesize{%
+ \@setfontsize\footnotesize\@xpt{14.5pt}%
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \def\@listi{%
+ \leftmargin\leftmargini
+ \topsep 6\p@ \@plus2\p@ \@minus2\p@
+ \parsep 3\p@ \@plus2\p@ \@minus\p@
+ \itemsep \parsep
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\scriptsize{%
+ \@setfontsize\scriptsize\@viiipt{9.5pt}%
+}%
+\def\tiny{%
+ \@setfontsize\tiny\@vipt{7pt}%
+}%
+\def\large{%
+ \@setfontsize\large\@xivpt{18pt}%
+}%
+\def\Large{%
+ \@setfontsize\Large\@xviipt{22pt}%
+}%
+\def\LARGE{%
+ \@setfontsize\LARGE\@xxpt{25pt}%
+}%
+\def\huge{%
+ \@setfontsize\huge\@xxvpt{30pt}%
+}%
+\let\Huge=\huge
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</12pt>
+% \end{macrocode}
+%
+% \section{Page parameters}%
+% This code is common to both \classoption{11pt} and \classoption{12pt}.
+%
+% \begin{macrocode}
+%<*11pt|12pt>
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\appdef\class@documenthook{%
+ \@ifxundefined\twoside@sw{\@booleanfalse\twoside@sw}{}%
+ \twoside@sw{%
+ \oddsidemargin 0pt
+ \evensidemargin 0pt
+ \marginparwidth 60pt
+ }{%
+ \oddsidemargin 0pt
+ \evensidemargin 0pt
+ \marginparwidth 44pt
+ }%
+%}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\marginparsep 10pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\topmargin -37pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\headheight 12pt
+\headsep 25pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\topskip 10pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\footskip 30pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+%\appdef\set@pica@hook{%
+ \@ifxundefined\tightenlines@sw{\@booleanfalse\tightenlines@sw}{}%
+ \textheight=665.5\p@
+ \tightenlines@sw{%
+ \def\baselinestretch{1}%
+ }{%
+ \def\baselinestretch{1.5}%
+ }%
+%}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\textwidth 468pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\columnsep 10pt
+\columnseprule 0pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\footnotesep 1pt
+\skip\footins 25.25pt plus 4pt minus 2pt
+\def\footnoterule{\kern-5.25pt\hrule width.5in\kern4.85pt\relax}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\floatsep 14pt plus 2pt minus 4pt
+\textfloatsep 20pt plus 2pt minus 4pt
+\intextsep 14pt plus 4pt minus 4pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\dblfloatsep 14pt plus 2pt minus 4pt
+\dbltextfloatsep 20pt plus 2pt minus 4pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\@fptop 0pt plus 1fil
+\@fpsep 10pt plus 2fil
+\@fpbot 0pt plus 1fil
+\@dblfptop 0pt plus 1fil
+\@dblfpsep 10pt plus 2fil%
+\@dblfpbot 0pt plus 1fil
+% \end{macrocode}
+%
+% \begin{macrocode}
+\marginparpush 7pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\parskip 0pt plus 1pt
+\parindent 15pt
+\emergencystretch8\p@
+\partopsep 3pt plus 2pt minus 2pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\leftmargini 30pt
+\leftmarginii 26pt
+\leftmarginiii 22pt
+\leftmarginiv 20pt
+\leftmarginv 12pt
+\leftmarginvi 12pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listI{\leftmargin\leftmargini \parsep 5\p@ plus2.5\p@ minus\p@
+ \topsep 10\p@ plus4\p@ minus6\p@
+ \itemsep 5\p@ plus2.5\p@ minus\p@
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\labelsep 6pt
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listii{\leftmargin\leftmarginii
+ \labelwidth\leftmarginii\advance\labelwidth-\labelsep
+ \topsep 5\p@ plus2.5\p@ minus\p@
+ \parsep 2.5\p@ plus\p@ minus\p@
+ \itemsep \parsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listiii{\leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
+ \topsep 2.5\p@ plus\p@ minus\p@
+ \parsep \z@ \partopsep \p@ plus\z@ minus\p@
+ \itemsep \topsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listiv{\leftmargin\leftmarginiv
+ \labelwidth\leftmarginiv\advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listv{\leftmargin\leftmarginv
+ \labelwidth\leftmarginv\advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\@listvi{\leftmargin\leftmarginvi
+ \labelwidth\leftmarginvi\advance\labelwidth-\labelsep
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</11pt|12pt>
+% \end{macrocode}
+%
+% \section{The \classoption{aps} class option: the \texttt{aps} module}
+% \changes{v4.0beta 2}{1999/06/20}
+% {AO: made aps.rtx part of revtex4.dtx}
+% The file \file{aps.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@society\ has the value \classoption{aps}.
+%
+% Here, code specific to APS journals is separated out from the \revtex\ document class.
+% (Other societies can customize \revtex\ by supplying their own \file{.rtx} file.)
+%
+% We first give some text entities (amounting to journal abbreviations),
+% then some APS-specific initialisations,
+% then code for particular APS journals.
+% In the latter case, the choice is
+% keyed off the macro \cmd\@journal.
+%
+% Note on \cmd\AtEndOfClass:
+% this file, like all journal substyles, is read in at \cmd\AtEndOfClass\ time,
+% so you should not use this command in this file.
+% Mote for \LaTeX\ developers: It would be an improvement in \LaTeX\ to
+% \cmd\let\cmd\AtEndOfClass\ to something like \cmd\@firstofone.
+% This change would be effected in \cmd\@onefilewithoptions.
+%
+% \begin{macrocode}
+%<*aps>
+% \end{macrocode}
+%
+% \subsection{Defend Against Forseeable Errors}%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+% \end{macrocode}
+%
+% \subsection{Abbreviations}%
+% The following macros constitute typing shortcuts for
+% certain journal names.
+% \begin{macrocode}
+\def\ao{Appl.\ Opt.\ }
+\def\ap{Appl.\ Phys.\ }
+\def\apl{Appl.\ Phys.\ Lett.\ }
+\def\apj{Astrophys.\ J.\ }
+\def\bell{Bell Syst.\ Tech.\ J.\ }
+\def\jqe{IEEE J.\ Quantum Electron.\ }
+\def\assp{IEEE Trans.\ Acoust.\ Speech Signal Process.\ }
+\def\aprop{IEEE Trans.\ Antennas Propag.\ }
+\def\mtt{IEEE Trans.\ Microwave Theory Tech.\ }
+\def\iovs{Invest.\ Ophthalmol.\ Vis.\ Sci.\ }
+\def\jcp{J.\ Chem.\ Phys.\ }
+\def\jmo{J.\ Mod.\ Opt.\ }
+\def\josa{J.\ Opt.\ Soc.\ Am.\ }
+\def\josaa{J.\ Opt.\ Soc.\ Am.\ A }
+\def\josab{J.\ Opt.\ Soc.\ Am.\ B }
+\def\jpp{J.\ Phys.\ (Paris) }
+\def\nat{Nature (London) }
+\def\oc{Opt.\ Commun.\ }
+\def\ol{Opt.\ Lett.\ }
+\def\pl{Phys.\ Lett.\ }
+\def\pra{Phys.\ Rev.\ A }
+\def\prb{Phys.\ Rev.\ B }
+\def\prc{Phys.\ Rev.\ C }
+\def\prd{Phys.\ Rev.\ D }
+\def\pre{Phys.\ Rev.\ E }
+\def\prl{Phys.\ Rev.\ Lett.\ }
+\def\rmp{Rev.\ Mod.\ Phys.\ }
+\def\pspie{Proc.\ Soc.\ Photo-Opt.\ Instrum.\ Eng.\ }
+\def\sjqe{Sov.\ J.\ Quantum Electron.\ }
+\def\vr{Vision Res.\ }
+% \end{macrocode}
+%
+% \subsection{APS Setup}%
+% Here we define the default procedures for APS journals.
+% Individual APS journals may override these definitions.
+%
+% \subsubsection{Title block}%
+%
+% The specifics of the title block.
+% Apply to all APS journals; individual journals may override these settings.
+%
+% \begin{macro}{\@fnsymbol}
+% The \LaTeX\ kernel definition of \cmd\@fnsymbol\ is overridden.
+% \begin{macrocode}
+\def\@fnsymbol#1{%
+ \ensuremath{%
+ \ifcase#1\or
+ *\or \dagger \or
+ \ddagger \or \mathsection \or
+ \mathparagraph\or
+ **\or \dagger\dagger \or
+ \ddagger\ddagger \or \mathsection \mathsection \or
+ \mathparagraph\mathparagraph\or
+ *{*}*\ignorespaces \or \dagger\dagger\dagger \or
+ \ddagger\ddagger\ddagger\or \mathsection \mathsection \mathsection \or
+ \mathparagraph\mathparagraph\mathparagraph\or
+ \else
+ \@ctrerr
+ \fi
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\titlepage}
+% \begin{macrocode}
+\renewenvironment{titlepage}{%
+ \let\wastwocol@sw\twocolumn@sw
+ \onecolumngrid
+ \newpage
+ \thispagestyle{titlepage}%
+ \c@page\z@% article sets this to one not zero???
+}{%
+ \wastwocol@sw{\twocolumngrid}{\newpage}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractheading}
+% APS Journals all set the abstract head the same way, with no head.
+% However, if the user has specified the \classoption{preprint} class option,
+% then the abstract will have a head.
+% \begin{macrocode}
+\def\frontmatter@abstractheading{%
+ \preprintsty@sw{%
+ \begingroup
+ \centering\large
+ \abstractname
+ \par
+ \endgroup
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractwidth}
+% All APS journals set the abstract to the same width.
+% \begin{macrocode}
+\def\frontmatter@abstractwidth{400\p@}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractfont}
+% All APS journals set the abstract body the same way.
+% \changes{v4.0beta 3}{1999/11/13}
+% {Bug 123: add parskip to the abstract.}
+% \begin{macrocode}
+\def\frontmatter@abstractfont{%
+ \small
+ \parindent1em\relax
+ \adjust@abstractwidth
+}%
+\def\adjust@abstractwidth{%
+ \dimen@\textwidth\advance\dimen@-\frontmatter@abstractwidth
+ \divide\dimen@\tw@
+ \galley@sw{%
+ \advance\rightskip\tw@\dimen@
+ }{%
+ \advance\leftskip\dimen@
+ \advance\rightskip\dimen@
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% All APS journal preprints use separate titlepage and full-width abstract.
+%
+% Note that we defer polling the \cmd\preprintsty@sw\ Boolean until
+% \cmd\AtBeginDocument\ time, because the document preamble
+% may legitimately change the state of that variable.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \preprintsty@sw{%
+ \@ifxundefined\titlepage@sw{\@booleantrue\titlepage@sw}{}%
+% \tightenlines@sw{%
+% \def\baselinestretch{1}%
+% }{%
+% \def\baselinestretch{1.5}%
+% }%
+ \def\frontmatter@abstractwidth{\textwidth}%
+ \def\frontmatter@affiliationfont{\it}%
+ \let\section\section@preprintsty
+% \let\@hangfrom@section\@hangfrom@section@preprintsty
+ \let\subsection\subsection@preprintsty
+ \let\subsubsection\subsubsection@preprintsty
+ }{}%
+ }%
+% \end{macrocode}
+%
+% \begin{macro}{\frontmatter@authorformat}
+% All APS journals set the author list the same.
+% The leading is 11.5 points, and
+% there is 11.5 points of extra space above the first author line
+% (which amounts to the same thing as 11.5 points extra below the title)
+% for a total of 23 points base-to-base.
+%
+% \begin{macrocode}
+\def\frontmatter@authorformat{%
+ \skip@\@flushglue
+ \@flushglue\z@ plus.3\hsize\relax
+ \centering
+ \advance\baselineskip\p@
+ \parskip11.5\p@\relax
+ \@flushglue\skip@
+%\preprintsty@sw{}{%
+% \addvspace{0\p@}%
+%}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affilgroup}
+% The default amount of space above affiliation.
+% APS Journals have 24 points b-b above an affiliation group.
+% \begin{macrocode}
+\def\frontmatter@above@affilgroup{%
+%\preprintsty@sw{}{%
+% \addvspace{11\p@}%
+%}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@above@affiliation}
+% \begin{macro}{\frontmatter@above@affiliation@script}
+% The default amount of space above affiliation.
+% APS Journals have no extra space between author group down to common affiliation.
+% \begin{macrocode}
+\def\frontmatter@above@affiliation@script{%
+ \skip@\@flushglue
+ \@flushglue\z@ plus.3\hsize\relax
+ \centering
+ \@flushglue\skip@
+ \addvspace{3.5\p@}%
+}%
+\def\frontmatter@above@affiliation{%
+ \preprintsty@sw{}{%
+% \addvspace{12\p@}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@affiliationfont}
+% All APS journals set the affiliation the same.
+% \begin{macrocode}
+\def\frontmatter@affiliationfont{%
+ \small\it
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@collaboration@above}
+% PRL: 1.5 points extra: 13 points base-to-base above.
+% \begin{macrocode}
+\def\frontmatter@collaboration@above{%
+ \preprintsty@sw{%
+ }{%
+ \parskip1.5\p@\relax
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% Set up the default APS style for title block authors and affiliations.
+% \begin{macrocode}
+\@ifxundefined\groupauthors@sw{%
+ \clo@groupedaddress
+}{}%
+% \end{macrocode}
+%
+% \begin{macro}{\frontmatter@setup}
+% All APS journals set the title page using the same font and size.
+% However, justification varies for the title block elements, so
+% we assert none here.
+% \begin{macrocode}
+\def\frontmatter@setup{%
+ \normalfont
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@title@above}
+% \begin{macro}{\frontmatter@title@format}
+% \begin{macro}{\frontmatter@title@below}
+% All APS journals set the article title the same.
+%
+% Note: Spacing from title to author is 23 points base-to-base.
+% \begin{macrocode}
+\def\frontmatter@title@above{\addvspace{6\p@}}%
+\def\frontmatter@title@format{\large\bfseries\centering\parskip\z@skip}%
+\def\frontmatter@title@below{}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@makefnmark}
+% All APS journals share this procedure for setting the titlepage footnote text.
+% \begin{macrocode}
+\def\@author@parskip{3\p@}%
+\def\frontmatter@makefnmark{%
+ \@textsuperscript{%
+ \normalfont\@thefnmark
+ }%
+}%
+\def\frontmatter@authorbelow{%
+ \addvspace{3\p@}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@RRAP@format}
+% All APS journals use the same format for the ``Received, Revised, etc.'' block on the title page.
+%
+% Change note: 11.5 points b-b from author/affiliation down to date.
+% \begin{macrocode}
+\def\frontmatter@RRAP@format{%
+ \small
+ \centering
+% \preprintsty@sw{}{\parskip.5ex\relax}%
+ \everypar{\hbox\bgroup(\@gobble@leavemode@uppercase}%
+ \def\par{\@ifvmode{}{\unskip)\egroup\@@par}}%
+}%
+\def\punct@RRAP{;\egroup\ \hbox\bgroup}%
+\def\@gobble@leavemode@uppercase#1#2{\expandafter\MakeTextUppercase}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@PACS@format}
+%
+% \begin{macrocode}
+\def\frontmatter@PACS@format{%
+ \addvspace{11\p@}%
+ \footnotesize
+ \adjust@abstractwidth
+ \parindent\z@
+ \parskip\z@skip
+ \samepage
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@keys@format}
+%
+% \begin{macrocode}
+\def\frontmatter@keys@format{%
+ \footnotesize
+ \adjust@abstractwidth
+ \parindent\z@
+ \samepage
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@titlepage}
+% \changes{v4.g}{1998/06/10}
+% {multiple preprint commands}
+% \changes{v4.0beta 2}{1999/06/20}
+% {Stack \cs{preprint} args flush right at right margin.}
+% Title page style. Currently empty except for preprint header,
+% which consists of all the \cmd\preprint\ arguments,
+% stacked flush right at the right margin.
+% \changes{v4.0beta 3}{1999/11/13}
+% {Insert procedure \cs{checkindate}}
+% \begin{macrocode}
+\def\ps@titlepage{%
+ \def\@oddhead{%
+ \hfill
+ \produce@preprints\@preprint
+ }%
+ \let\@evenhead\@oddhead
+ \def\@oddfoot{%
+ \hb@xt@\z@{\byrevtex\hss}%
+ \hfil
+ \preprintsty@sw{\thepage}{}%
+ \quad\checkindate
+ \hfil
+ }%
+ \let\@evenfoot\@oddfoot
+}%
+\def\byrevtex{\byrevtex@sw{Typeset by REV\TeX}{}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\produce@preprints}
+% \changes{v4.0beta 3}{1999/11/13}
+% {Bug 115. If three or more preprints specified, set on single line, with commas.}
+% \begin{macrocode}
+\def\produce@preprints#1{%
+ \preprint@sw{%
+ \vtop to \z@{%
+ \def\baselinestretch{1}%
+ \small
+ \let\preprint\preprint@count
+ \count@\z@#1\@ifnum{\count@>\tw@}{%
+ \hbox{%
+ \let\preprint\preprint@hlist
+ #1\setbox\z@\lastbox
+ }%
+ }{%
+ \let\preprint\preprint@cr
+ \halign{\hfil##\cr#1\crcr}%
+ \par
+ \vss
+ }%
+ }%
+ }{}%
+}%
+\def\preprint@cr#1{#1\cr}%
+\def\preprint@count#1{\advance\count@\@ne}%
+\def\preprint@hlist#1{#1\hbox{, }}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Stacked Heads}%
+% All APS journals put a period (.), followed by quad space, after the section number.
+% Also, no hanging section number.
+% \begin{macrocode}
+\def\@seccntformat#1{\csname the#1\endcsname.\quad}%
+\def\@hang@from#1#2#3{#1#2#3}%
+% \end{macrocode}
+%
+% Note that in the following, we wish to set the section head uppercase, so we use
+% David Carlisle's \cmd\MakeTextUppercase. However, because this procedure effectively
+% parses its argument (looking for things to \emph{not} translate), it has to be invoked
+% in such a way that the argument of the \cmd\section\ command is passed to it as its
+% own argument.
+%
+% To accomplish this, we use the \cmd\@hangfrom@\ hook, which was developed for this
+% purpose.
+%
+% \begin{macrocode}
+\def\section{%
+ \@startsection
+ {section}%
+ {1}%
+ {\z@}%
+ {0.8cm \@plus1ex \@minus .2ex}%
+ {0.5cm}%
+ {%
+ \normalfont\small\bfseries
+ \centering
+ }%
+}%
+\def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subsection{%
+ \@startsection
+ {subsection}%
+ {2}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont\small\bfseries
+ \centering
+ }%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subsubsection{%
+ \@startsection
+ {subsubsection}%
+ {3}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont\small\itshape
+ \centering
+ }%
+}%
+% \end{macrocode}
+%
+% \subsubsection{Runin Heads}%
+% \begin{macrocode}
+\def\paragraph{%
+ \@startsection
+ {paragraph}%
+ {4}%
+ {\parindent}%
+ {\z@}%
+ {-1em}%
+ {\normalfont\normalsize\itshape}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\subparagraph{%
+ \@startsection
+ {subparagraph}%
+ {5}%
+ {\parindent}%
+ {3.25ex \@plus1ex \@minus .2ex}%
+ {-1em}%
+ {\normalfont\normalsize\bfseries}%
+}%
+% \end{macrocode}
+%
+%
+%
+% \begin{macro}{\section@preprintsty}
+% \begin{macro}{\subsection@preprintsty}
+% \begin{macro}{\subsubsection@preprintsty}
+% Here are the formatting procedures specific to the preprint style;
+% the only difference is that the heads are flush left instead of centered.
+%
+% \begin{macrocode}
+\def\section@preprintsty{%
+ \@startsection
+ {section}%
+ {1}%
+ {\z@}%
+ {0.8cm \@plus1ex \@minus .2ex}%
+ {0.5cm}%
+ {%
+ \normalfont\small\bfseries
+% \centering
+ }%
+}%
+%\def\@hangfrom@section@preprintsty#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\subsection@preprintsty{%
+ \@startsection
+ {subsection}%
+ {2}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont\small\bfseries
+% \centering
+ }%
+}%
+% \end{macrocode}
+% \begin{macrocode}
+\def\subsubsection@preprintsty{%
+ \@startsection
+ {subsubsection}%
+ {3}%
+ {\z@}%
+ {.8cm \@plus1ex \@minus .2ex}%
+ {.5cm}%
+ {%
+ \normalfont\small\itshape
+% \centering
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Effectively invoke the \classoption{bibnote} class option,
+% if \cmd\frontmatter@footnote@produce\ has not yet been set.
+% \begin{macrocode}
+ \@ifxundefined\frontmatter@footnote@produce{%
+ \let\frontmatter@footnote@produce\frontmatter@footnote@produce@endnote
+ }{}%
+% \end{macrocode}
+%
+%
+% \subsubsection{Table of Contents}%
+% The toc will itself make an entry in the toc,
+% but we temporarily turn off toc formatting for the duration.
+% \begin{macrocode}
+\def\@pnumwidth{1.55em}
+\def\@tocrmarg {2.55em}
+\def\@dotsep{4.5pt}
+\setcounter{tocdepth}{3}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tableofcontents{%
+ \addtocontents{toc}{\string\tocdepth@munge}%
+ \print@toc{toc}%
+ \addtocontents{toc}{\string\tocdepth@restore}%
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tocdepth@munge{%
+ \let\l@section@saved\l@section
+ \let\l@section\@gobble@tw@
+}%
+\def\@gobble@tw@#1#2{}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\tocdepth@restore{%
+ \let\l@section\l@section@saved
+}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\l@part#1#2{\addpenalty{\@secpenalty}%
+ \begingroup
+ \set@tocdim@pagenum{#2}%
+% \@tempdima 3em %
+ \parindent \z@
+ \rightskip\tocleft@pagenum plus 1fil\relax
+ \skip@\parfillskip\parfillskip\z@
+ \addvspace{2.25em plus\p@}%
+ \large \bf %
+ \leavevmode\ignorespaces#1\unskip\nobreak\hskip\skip@
+ \hb@xt@\rightskip{\hfil\unhbox\z@}\hskip-\rightskip\hskip\z@skip
+ \par
+ \nobreak %
+ \endgroup
+}%
+% \end{macrocode}
+%
+% \begin{macro}{\l@section}
+% Determine which TOC elements are automatically indented.
+% \begin{macrocode}
+\def\tocleft@{\z@}%
+\def\tocdim@min{5\p@}%
+\def\l@section{%
+ \l@@sections{}{section}% Implicit #3#4
+}%
+\def\l@f@section{%
+ \addpenalty{\@secpenalty}%
+ \addvspace{1.0em plus\p@}%
+ \bf
+}%
+\def\l@subsection{%
+ \l@@sections{section}{subsection}% Implicit #3#4
+}%
+\def\l@subsubsection{%
+ \l@@sections{subsection}{subsubsection}% Implicit #3#4
+}%
+\def\l@paragraph#1#2{}%
+\def\l@subparagraph#1#2{}%
+% \end{macrocode}
+% \end{macro}
+%
+% Activate the auto TOC processing.
+% \begin{macrocode}
+\let\toc@pre\toc@pre@auto
+\let\toc@post\toc@post@auto
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\listoffigures{\print@toc{lof}}%
+\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\listoftables{\print@toc{lot}}%
+\let\l@table\l@figure
+% \end{macrocode}
+%
+% \subsubsection{Default column bottom}%
+% All APS journal styles have flush bottoms.
+%
+% Note that we defer polling the \cmd\raggedcolumn@sw\ Boolean until
+% \cmd\AtBeginDocument\ time, because the document preamble
+% may legitimately change the state of that variable.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifxundefined\raggedcolumn@sw{\@booleantrue\raggedcolumn@sw}{}%
+ \raggedcolumn@sw{\raggedbottom}{\flushbottom}%
+}%
+% \end{macrocode}
+%
+%
+% \subsubsection{Table alignment style}%
+%
+% \begin{macro}{\tableft@skip@float}
+% \begin{macro}{\tabmid@skip@float}
+% \begin{macro}{\tabright@skip@float}
+% \begin{macro}{\array@row@pre@float}
+% \begin{macro}{\array@row@pst@float}
+% All APS publications have the same table specification:
+% Scotch rules above and below, centered in column.
+% \begin{macrocode}
+\def\tableft@skip@float{\z@ plus\hsize}%
+\def\tabmid@skip@float{\@flushglue}%
+\def\tabright@skip@float{\z@ plus\hsize}%
+\def\array@row@pre@float{\hline\hline\noalign{\vskip\doublerulesep}}%
+\def\array@row@pst@float{\noalign{\vskip\doublerulesep}\hline\hline}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Footnote formatting}%
+% We customize the formatting of footnotes for all APS journals.
+% \begin{macro}{\@makefntext}
+% \begin{macrocode}
+\def\@makefntext#1{%
+ \def\baselinestretch{1}%
+ \reset@font
+ \footnotesize
+ \leftskip1em
+ \parindent1em
+ \noindent\nobreak\hskip-\leftskip
+ \hb@xt@\leftskip{%
+ \Hy@raisedlink{\hyper@anchorstart{footnote@\the\c@footnote}\hyper@anchorend}%
+ \hss\@makefnmark\
+ }%
+ #1%
+ \par
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Appendix}%
+% \begin{macro}{\appendix}
+% \begin{macro}{\@hangfrom@appendix}
+% \begin{macro}{\@hangfroms@appendix}
+% \begin{macro}{\@appendixcntformat}
+% \changes{v4.0beta 3}{1999/11/13}
+% {Bug 129: section* within appendix was producing appendixname}
+% \begin{macrocode}
+\prepdef\appendix{%
+ \par
+ \let\@hangfrom@section\@hangfrom@appendix
+ \let\@hangfroms@section\@hangfroms@appendix
+ \let\@sectioncntformat\@appendixcntformat
+}%
+\def\@hangfrom@appendix#1#2#3{%
+ #1%
+ \@if@empty{#2}{%
+ #3%
+ }{%
+ #2\@if@empty{#3}{}{:\ #3}%
+ }%
+}%
+\def\@hangfroms@appendix#1#2{%
+ #1#2%
+}%
+\def\@appendixcntformat#1{\appendixname\ \csname the#1\endcsname}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Bibliography}%
+%
+% Customize \revtex\ for the journal substyle;
+% this task requires three components:
+% the \BibTeX\ \file{apsrev.bst} style file,
+% customizing code for \file{natbib}, and
+% customizations of the \env{thebibliography} environment.
+%
+% \begin{macro}{\@bibstyle}
+% Define the argument of the \cmd\bibliographystyle\ command
+% (if the document does not do so).
+% The user must have installed a \file{.bst} file of the corresponding name.
+% This file will then be used by \BibTeX\ when compiling the document's \file{.bbl} file.
+%
+% The default bibliography style for the APS journal substyles, \file{apsrev.bst},
+% was originally called \file{revtex.bst}, but
+% that name is much too generic and should be given to a \file{.bst} file that
+% that applies generally to any \revtex\ jounal substyle, an impossibility.
+%
+% To generate \file{apsrev.bst}, use \classname{custom-bib} version 4.0b2 or later.
+% Run the \file{.bst} generator, \file{makebst.tex}, and
+% accept all defaults, with the following exceptions:
+%
+% \begin{enumerate}
+% \item
+% ORDERING OF REFERENCES: c: seq-no (references in order of Citation);
+% \item
+% AUTHOR NAMES: i: nm-init,ed-au (Initials + surname);
+% \item
+% NUMBER OF AUTHORS: l: max 12, min 12 (there will be three prompts total);
+% \item
+% TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft,nmft-def (User defined author font);
+% \item
+% FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font);
+% \item
+% EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors);
+% \item
+% DATE FORMAT: p: yr-par (Date in parentheses);
+% \item
+% SUPPRESS MONTH: x: xmth (Date is year only);
+% \item
+% TITLE OF ARTICLE: i: tit-it (Title italic)
+% \item
+% ARTICLE TITLE PRESENT: x: jtit-x (No article title);
+% \item
+% JOURNAL NAME FONT: r: jttl-rm (Journal title normal);
+% \item
+% TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
+% \item
+% JOURNAL VOLUME: b: vol-bf (Volume bold);
+% \item
+% VOLUME PUNCTUATION: c: volp-com (Volume with comma);
+% \item
+% PAGE NUMBERS: f: jpg-1 (Only start page number);
+% \item
+% JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
+% \item
+% PUBLISHER IN PARENTHESES: d: pub-date (Publisher and date in parentheses);
+% \item
+% PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
+% \item
+% ISBN NUMBER: isbn: (Include ISBN for books, booklets)
+% \item
+% ISSN NUMBER: issn: (Include ISSN for periodicals)
+% \item
+% EDITOR IN COLLECTIONS: b: edby (Booktitle, edited by \dots);
+% \item
+% PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
+% \item
+% ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
+% \item
+% ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
+% \item
+% OTHER ABBREVIATIONS: a: abr (Abbreviations);
+% \item
+% ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
+% \item
+% EDITION NUMBERS: n: ord (Numerical editions);
+% \item
+% STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
+% \item
+% FONT OF `ET AL': i: etal-it (Italic et al);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields collaboration, eid, eprint, numpages, url)
+% \item
+% NEW FONT SELECTION SCHEME: n: nfss (NFSS);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
+% \item
+% REFERENCE COMPONENT TAGS: y: reference component tags;
+% \item
+% URL ADDRESS: n: URL as note;
+% \end{enumerate}
+%
+% A file \file{apsrev.dbj} file equivalent to the following should result:
+% \begin{verbatim}
+% \input docstrip
+% \preamble
+% ----------------------------------------
+% *** REVTeX-compatible apsrev.bst ***
+% \endpreamble
+% \postamble
+% End of customized bst file
+% \endpostamble
+% \keepsilent
+% \askforoverwritefalse
+% \def\MBopts{\from{merlin.mbs}{%
+% seq-no%: Citation order (unsorted, like unsrt.bst)
+% ,nm-init,ed-au%: Initials + surname (J. F. Smith)
+% ,nmlm%: Limited authors (et al replaces missing names)
+% ,x10%: Maximum of 10 authors
+% ,m10%: Minimum of 10 authors
+% ,nmft,nmft-def%: User defined author font (\bibnamefont)
+% ,fnm-def%: First names in user defined font (\bibfnamefont)
+% ,nmfted%: Editors incollection like authors font
+% ,yr-par%: Date in parentheses as (May 1993)
+% ,xmth%: Date is year only
+% ,tit-it%: Title italic (\em)
+% ,jtit-x%: No article title
+% ,jttl-rm%: Journal name normal font
+% ,trtit-b%: Tech. report title like books
+% ,vol-bf%: Volume bold as {\bf vol}(num)
+% ,volp-com%: Volume with comma as vol(num), ppp
+% ,jpg-1%: Only start page number
+% ,jnm-x%: Space after journal name
+% ,pub-date%: Publisher and date in parentheses (Oxford, 1994)
+% ,pre-pub%: Publisher before chapter, pages
+% ,isbn%: Include ISBN for books, booklets, etc.
+% ,issn%: Include ISSN for periodicals
+% ,edby%: In booktitle, edited by .. (where .. is names)
+% ,blk-com%: Comma between blocks
+% ,pp%: `Page' abbreviated as p. or pp.
+% ,ed%: `Editor' abbreviated as ed. or eds.
+% ,abr%: Abbreviations of such words
+% ,ednx%: `Edition' abbreviated as `ed'
+% ,ord%: Numerical editions as 1st, 2nd, 3rd, etc
+% ,jabr%: Abbreviated journal names
+% ,etal-it%: Italic et al
+% ,revdata,eprint,url,url-blk%: Include REVTeX data fields collaboration, eid, eprint, numpages, url
+% ,url,url-nt%: URL as note
+% ,bibinfo%: Reference component tags like \bibinfo in the content of \bibitem
+% ,nfss%: NFSS use \textbf, \emph, not \bf, \em
+% }}
+% \generate{\file{\jobname.bst}{\MBopts}}
+% \endbatchfile
+% \end{verbatim}
+%
+% To get a banner in the \file{.blg} file, patch by hand into \file{apsrev.bst}:
+% \begin{verbatim}
+% FUNCTION {banner.log} {"REVTeX-compatible apsrev.bst 9812" warning$}
+% \end{verbatim}
+% and invoke \texttt{banner.log} from within \texttt{begin.bib}
+%
+% We ensure that the journal substyle has the first word
+% in the matter by installing the (default) APS code
+% later on (see Section~\ref{sec:aps-defaults}).
+% \end{macro}
+%
+% \begin{macro}{\bibpunct}
+% The following commands effectively establish the style in which \cmd\cite\ commands are
+% formatted.
+% You can think of them as the second needed component for the bibliography.
+%
+% Set up for numerical citations.
+%
+% The journal substyles can override these choices.
+%
+% Note that setting \cmd\NAT@sort\ at this late hour is not totally effective.
+% You have to give \classname{natbib} the relevant options at load time.
+% \begin{macrocode}
+ \bibpunct{[}{]}{,}{n}{}{,}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibsection}
+% We define the sectioning command to use when starting the bibliography.
+%
+% \changes{v4.0rc1}{2001/06/18}
+% {grid changes with push and pop}
+% \begin{macrocode}
+ \def\bibsection{%
+ \par
+% \twocolumn@sw{\onecolumngrid}{}%
+ \onecolumngrid@push
+ \begingroup
+ \baselineskip26\p@
+% \def\@currentHref{section.bib}%
+ \bib@device{\textwidth}{245.5\p@}%
+ \endgroup
+ \nobreak\@nobreaktrue
+ \addvspace{19\p@}%
+ \par
+% \twocolumn@sw{\twocolumngrid}{}%
+ \onecolumngrid@pop
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bib@device}
+% \begin{macro}{\bibpreamble}
+% \begin{macro}{\bibsep}
+% \begin{macro}{\newblock}
+% We define the sectioning command to use when starting the bibliography.
+% \begin{macrocode}
+\def\bib@device#1#2{%
+ \hb@xt@#1{%
+ \hfil
+ \phantomsection
+ \addcontentsline {toc}{section}{\protect\numberline{}\refname}%
+% \hyper@anchorstart {\@currentHref }%
+ \hb@xt@#2{%
+ \skip@\z@\@plus-1fil\relax
+ \leaders\hrule height.25 \p@ depth.25 \p@ \hskip\z@\@plus1fil
+ \hskip\skip@
+ \hskip\z@\@plus0.125fil\leaders\hrule height.375\p@ depth.375\p@ \hskip\z@\@plus0.75fil \hskip\z@\@plus0.125fil
+ \hskip\skip@
+ \hskip\z@\@plus0.25 fil\leaders\hrule height.5 \p@ depth.5 \p@ \hskip\z@\@plus0.5 fil \hskip\z@\@plus0.25 fil
+ \hskip\skip@
+ \hskip\z@\@plus0.375fil\leaders\hrule height.625\p@ depth.625\p@ \hskip\z@\@plus0.25fil \hskip\z@\@plus0.375fil
+ % \hskip\skip@
+ % \hfil
+ }%
+%\hyper@anchorend
+ \hfil
+ }%
+}%
+\let\bibpreamble\@empty
+\bibsep\z@\relax
+\def\newblock{\ }%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bibfont}
+% We define the font switch that applies to the body of the bibliography.
+%
+% \begin{macrocode}
+ \def\bibfont{%
+ \small
+ }%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Index}%
+% FIXME: the following call to \cmd\twocolumn\ appears wrong if we were in two-column grid.
+% \changes{v4.0beta 3}{1999/11/13}
+% {grid changes with ltxgrid}
+% \changes{v4.0rc1}{2001/06/18}
+% {grid changes with push and pop}
+% \begin{macrocode}
+\newenvironment{theindex}{%
+%\let\wastwocol@sw\twocolumn@sw
+ \columnseprule \z@
+ \columnsep 35\p@
+ \c@secnumdepth-\maxdimen
+ \onecolumngrid@push
+ \section{\indexname}%
+ \thispagestyle{plain}%
+ \parindent\z@
+ \parskip\z@ plus.3\p@\relax
+ \let\item\@idxitem
+%\wastwocol@sw{\twocolumngrid}{}%
+ \onecolumngrid@pop
+}{%
+%\onecolumngrid@pop
+}%
+%
+\def\@idxitem{\par\hangindent 40\p@}
+%
+\def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}}
+%
+\def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}}
+%
+\def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax}
+% \end{macrocode}
+%
+%
+% \subsection{Journal-Specific Code}%
+%
+% For APS journals, we supply code specific to PRA, PRB, PRC, PRD, PRE, PRL, and RMP.
+% At present, they are identical,
+% with the exception of PRB's code for superscript citations.
+%
+% \begin{macrocode}
+\def\journal@pra{pra}%
+\def\journal@prb{prb}%
+\def\journal@prc{prc}%
+\def\journal@prd{prd}%
+\def\journal@pre{pre}%
+\def\journal@prl{prl}%
+\def\journal@prstab{prstab}%
+\def\journal@rmp{rmp}%
+% \end{macrocode}
+%
+% Note: the convention in this document class is that
+% the substyle must not override any explicit class options
+% declared by the document.
+% This means that the various Booleans of Section~\ref{sec:options}
+% may be assigned here only if they are still undefined at this point.
+%
+% For most all of the APS journals, the journal-dependent
+% code is relatively meager and is therefore embedded in this file.
+% However, the RMP code is sufficiently extensive that
+% splitting it out into a separate file is more convenient.
+%
+% \subsubsection{\classoption{pra}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@pra}{%
+% \end{macrocode}
+%
+% End of \classoption{pra} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{prb}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@prb}{%
+% \end{macrocode}
+% PRB requires superscript citations.
+% We use Patrick Daly's \classname{natbib} package,
+% and hyperref and other packages are already set up to cope with this.
+%
+% \begin{macro}{\bibpunct}
+% By default, PRB selects the \classoption{bibnotes} option.
+% We also set up for numerical citations.
+% \begin{macrocode}
+ \@ifxundefined\bibnotes@sw{\@booleantrue\bibnotes@sw}{}%
+ \bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
+ \def\@onlinecite#1{\begingroup\let\@cite\NAT@citenum\citealp{#1}\endgroup}%
+% \end{macrocode}
+% \end{macro}
+%
+% Invoke \classoption{superbib} option if the document
+% has made no selection of its own.
+% \begin{macrocode}
+ \appdef\class@documenthook{%
+ \@ifxundefined\place@bibnumber{%
+ \let\place@bibnumber\place@bibnumber@sup
+ }{}%
+ }%
+% \end{macrocode}
+%
+% End of \classoption{prb} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{prc}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@prc}{%
+% \end{macrocode}
+%
+% End of \classoption{prc} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{prd}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@prd}{%
+% \end{macrocode}
+%
+% End of \classoption{prd} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{pre}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@pre}{%
+% \end{macrocode}
+%
+% End of \classoption{prd} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{prl}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@prl}{%
+% \end{macrocode}
+% In PRL, the default is the \classoption{bibnotes} option,
+% and the Acknowledgments section has no head.
+%
+% However, the References head is a device that may be described as a lozenge centered on the baseline,
+% 71 points wide by 2 points thick, with the ends tapering to a half point in thickness.
+% Space above 26 points base to base, below 31 base to base.
+% \begin{macrocode}
+ \@ifxundefined\bibnotes@sw{\@booleantrue\bibnotes@sw}{}%
+ \@booleanfalse\acknowledgments@sw
+%\let\acknowledgmentsname\@empty
+ \def\bibsection{%
+ \par
+ \begingroup
+ \baselineskip26\p@
+ \bib@device{\hsize}{72\p@}%
+ \endgroup
+ \nobreak\@nobreaktrue
+ \addvspace{19\p@}%
+ }%
+% \end{macrocode}
+% Implement length checking.
+% Use the \classname{times} and \classname{mathtime} packages,
+% plus whatever other processing is required
+% to make the formatted output be true
+% to the metrics of the journal.
+%
+% Wait. Do not use mathtime after all. APS has their own way of doing math pi, involving
+% Adobe Mathematical Pi and other fonts.
+% \begin{macrocode}
+%\appdef\class@documenthook{%
+ \@ifxundefined\lengthcheck@sw{\@booleanfalse\lengthcheck@sw}{}%
+ \lengthcheck@sw{%
+ \RequirePackage{times}%
+% \RequirePackage{mathtime}%
+ }{%
+ }%
+%}%
+% \end{macrocode}
+% A PRL does not have numbered sections.
+% \begin{macrocode}
+ \c@secnumdepth=-\maxdimen
+% \end{macrocode}
+% Note: we defer this code until after type size file is read in.
+% \begin{macrocode}
+ \appdef\set@typesize@hook{%
+ \@ifnum{\@pointsize=10\relax}{%
+ \lengthcheck@sw{%
+ \def\large{%
+ \@setfontsize\large{12.5}{14\p@}%
+ }%
+ \def\normalsize{%
+ \@setfontsize\normalsize{10.5}\@xiipt
+ \abovedisplayskip 6\p@ \@plus6\p@ \@minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+ }%
+ \def\small{%
+ \@setfontsize\small{9.5}\@xipt
+ \abovedisplayskip 5\p@ \@plus5\p@ \@minus4\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+ }%
+ \DeclareMathSizes{12.5}{12.5}{9}{6}%
+ \DeclareMathSizes{10.5}{10.5}{7.5}{5}%
+ \DeclareMathSizes{9.5}{9.5}{7.0}{5}%
+ }{%
+ \def\normalsize{%
+ \@setfontsize\normalsize\@xpt\@xiipt
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+ }%
+ }%
+ }{}%
+ }%
+%\appdef\set@pica@hook{%
+ \@ifnum{\@pointsize=10\relax}{%
+ \textheight = 694.0\p@
+% \textheight = 55\baselineskip
+% \advance\textheight by \topskip
+ }{}%
+%}%
+% \end{macrocode}
+%
+% End of \classoption{prl} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{prstab}}%
+% \begin{macrocode}
+\@ifx{\@journal\journal@prstab}{%
+% \end{macrocode}
+%
+% End of \classoption{prstab} code.
+% \begin{macrocode}
+}{}%
+% \end{macrocode}
+%
+% \subsubsection{\classoption{rmp}}%
+% Read in the code from a file.
+% \begin{macrocode}
+\@ifx{\@journal\journal@rmp}{\input{\@journal\substyle@ext}}{}%
+% \end{macrocode}
+%
+%
+% \subsection{Establish APS Defaults}\label{sec:aps-defaults}
+%
+% \begin{macro}{\footinbib@sw}
+% All APS journals except RMP invoke the \classoption{footinbib} option.
+% We rely on the RMP-specific code to give a value to this switch.
+% \begin{macrocode}
+\@ifxundefined\footinbib@sw{\@booleantrue\footinbib@sw}{}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\place@bibnumber}
+% \begin{macro}{\@bibstyle}
+% We install code that will select the presentation for \cmd\bibitem s
+% and govern the \BibTeX\ processing.
+% If the user has not selected any related option and if
+% the journal substyle also has not, then the \classoption{aps}
+% option choses these defaults.
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifxundefined\place@bibnumber{%
+ \let\place@bibnumber\place@bibnumber@inl
+ }{}%
+ \@ifxundefined\@bibstyle{%
+ \def\@bibstyle{apsrev}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \begin{macrocode}
+%</aps>
+% \end{macrocode}
+%
+%
+% \section{The \classoption{rmp} journal substyle: the \texttt{rmp} module}
+%
+% The file \file{rmp.rtx} is read in by the \classname{revtex4} document class
+% if \cmd\@society\ has the value \classoption{aps}
+% and \cmd\@journal\ has the value \classoption{rmp}.
+%
+% It is read at the end of the \filename{aps.rtx}, so all definitions
+% and assignments in that file are operative unless overridden here.
+%
+%
+% \begin{macrocode}
+%<*rmp>
+% \end{macrocode}
+%
+% Protect this file from being read in by anything but \revtex.
+% \begin{macrocode}
+\ifx\undefined\substyle@ext
+ \def\@tempa{%
+ \endinput
+ \GenericWarning{I must be read in by REVTeX! (Bailing out)}%
+ }%
+ \expandafter\else
+ \def\@tempa{}%
+ \expandafter\fi\@tempa
+% \end{macrocode}
+%
+% Protect this file from being read in as a society instead of a journal.
+% In such a case, \cmd\@journal\ will be \cmd\@empty.
+% \begin{macrocode}
+\@ifx@empty\@journal{%
+ \class@warn{I have to read in the aps substyle first!}%
+ \endinput
+ \def\@society{aps}\def\@journal{rmp}%
+ \expandafter\input\expandafter{\@society\substyle@ext}%
+}{}%
+% \end{macrocode}
+%
+% \subsection{Frontmatter}%
+%
+% \begin{macro}{\frontmatter@setup}
+%
+% \begin{macrocode}
+\def\frontmatter@setup{%
+ \normalfont\sffamily\raggedright
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\PACS@warn}
+% Per Mark Doyle, RMP never displays the PACS, so they don't want the `use showpacs' warning spit out.
+% \begin{macrocode}
+\def\PACS@warn{RMP documents do not display PACS. Your \string\pacs\space will be ignored}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@title@above}
+% \begin{macro}{\frontmatter@title@format}
+% \begin{macro}{\frontmatter@title@below}
+%
+% \begin{macrocode}
+\def\frontmatter@title@above{}%
+\def\frontmatter@title@format{\Large\bfseries\raggedright}% HelveticaNeue-Medium(Italic) 14pt.
+\def\frontmatter@title@below{\addvspace{12\p@}}% 24pt b-b down to first author
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@authorformat}
+% Set the rag to a milder value, because we want to do true ragged right
+% typesetting, as opposed to the \LaTeX\ default, which gives very poor results.
+%
+% Note: author font is 9.8bp. 19.2bp/14.3bp above/below.
+% \begin{macrocode}
+\def\frontmatter@authorformat{%
+ \preprintsty@sw{\vskip0.5pc\relax}{}%
+ \@tempskipa\@flushglue
+ \@flushglue\z@ plus50\p@\relax
+ \raggedright\advance\leftskip.5in\relax
+ \@flushglue\@tempskipa
+ \parskip\z@skip
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@affiliationfont}
+% The hook \cmd\frontmatter@affiliationfont\ controls the formatting of affiliations and affiliation groups.
+% The hook \cmd\frontmatter@above@affilgroup\ is invoked just before proceeding with author/affiliation processing.
+% The \cmd\frontmatter@above@affiliation\ is the amount of space above affiliations in the \classoption{groupedaddress} style,
+% and \cmd\frontmatter@above@affiliation@script\ is that for \classoption{superscriptaddress}.
+%
+% Note: affiliation font is 9.03/10.4bp, 14.3bp/19.2bp b-b above/below
+% \begin{macrocode}
+\def\frontmatter@affiliationfont{% Helvetica 9/10.2
+ \small\slshape\selectfont\baselineskip10.5\p@\relax
+ \@tempskipa\@flushglue
+ \@flushglue\z@ plus50\p@\relax
+ \raggedright\advance\leftskip.5in\relax
+ \@flushglue\@tempskipa
+}%
+\def\frontmatter@above@affilgroup{\addvspace{7.2\p@}}% additional leading above an author
+\def\frontmatter@above@affiliation{\addvspace{5.3\p@}}%
+\def\frontmatter@above@affiliation@script{}%
+% \end{macrocode}
+% \end{macro}
+%
+% Set up the default RMP style for title block authors and affiliations.
+% This command should effectively override the effect of the
+% corresponding command in the parent substyle.
+% \begin{macrocode}
+\@ifxundefined\groupauthors@sw{%
+ \clo@groupedaddress
+}{}%
+% \end{macrocode}
+%
+% \begin{macro}{\frontmatter@RRAP@format}
+% Note: in RMP, if we are not in preprint mode, the date will not be produced.
+%
+% Note: Helvetica C/lc, 8.98bp, space above: 16.3bp b-b.
+% \begin{macrocode}
+\def\frontmatter@RRAP@format{%
+ \addvspace{7.3\p@}%
+ \small
+ \raggedright\advance\leftskip.5in\relax
+% \parskip.5ex\relax
+% \everypar{\hbox\bgroup(\@gobble@leavemode@uppercase}%
+% \def\par{\@ifvmode{}{\unskip)\egroup\@@par}}%
+% \preprintsty@sw{}{\let\@date\@empty}%
+}%
+%\def\@gobble@leavemode@uppercase#1#2{\expandafter\MakeTextUppercase}%
+\def\produce@RRAP#1{%
+ \@if@empty{#1}{}{%
+ \@ifvmode{\leavevmode}{}%
+ \unskip(\ignorespaces#1\unskip)\quad
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractheading}
+% Space above 21.8bp b-b.
+% \begin{macrocode}
+\def\frontmatter@abstractheading{%
+ \preprintsty@sw{%
+ \begingroup
+ \centering\large
+ \abstractname
+ \par
+ \endgroup
+ \vspace{.5pc}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@abstractfont}
+% TimesTen 8.93bp/9.6bp X 360bp, indented 36bp, with 21.9/37.6bp b-b above/below
+% \begin{macrocode}
+\def\frontmatter@abstractfont{%
+ \footnotesize
+ \hsize360\p@
+ \leftskip=0.5in
+ \advance\hsize\leftskip
+%\rightskip=\leftskip
+ \parindent\z@
+%\hsize5.5in
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter@preabstractspace}
+% \begin{macro}{\frontmatter@postabstractspace}
+% Space above and space below abstract in title block.
+% Should be 22/36 points base-to-base.
+% \begin{macrocode}
+\def\frontmatter@preabstractspace{7.7\p@}%
+\def\frontmatter@postabstractspace{24.6\p@}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% FIXME: Not done: PACS.
+% FIXME: TOC: Head is same as \section: HelveticaNeue 8.98. 32/22bp b-b above/below,
+% Body: TimesTen 8/10.5.
+%
+% \subsection{General Text}%
+%
+% If not in preprint mode, set the type size to 10/12 point. Note: s/b 11.6bp leading
+% \begin{macrocode}
+ \appdef\set@typesize@hook{%
+ \@ifxundefined\preprintsty@sw{}{%
+ \preprintsty@sw{}{%
+ \def\normalsize{%
+ \@setsize\normalsize{12pt}\xpt\@xpt
+ \abovedisplayskip 10\p@ plus2\p@ minus5\p@
+ \belowdisplayskip \abovedisplayskip
+ \abovedisplayshortskip \abovedisplayskip
+ \belowdisplayshortskip \abovedisplayskip
+ \let\@listi\@listI
+ }%
+ }%
+ }%
+ }%
+% \end{macrocode}
+%
+% Footnote mods:
+% \begin{macrocode}
+ \footnotesep 9.25pt
+ \skip\footins 36pt plus 4pt minus 2pt
+ \def\footnoterule{\kern-13pt\hrule width.5in\kern15.6pt\relax}%
+% \end{macrocode}
+%
+%
+% \subsection{Sectioning}
+%
+% \begin{macrocode}
+\def\thepart{\Roman{part}} %
+\def\thesection{\Roman{section}}
+\def\p@section{}
+\def\thesubsection{\Alph{subsection}}
+\def\p@subsection{\thesection.}
+\def\thesubsubsection{\arabic{subsubsection}}
+\def\p@subsubsection{\thesection.\thesubsection.}
+\def\theparagraph{\alph{paragraph}}
+\def\p@paragraph{\thesection.\thesubsection.\thesubsubsection.}
+\def\thesubparagraph{\arabic{subparagraph}}
+\def\p@subparagraph{\thesection.\thesubsection.\thesubsubsection.\theparagraph.}
+% \end{macrocode}
+%
+% In RMP, put a period (.), followed by nut space, after the section number.
+% Also, hang the section number (the \LaTeX\ default).
+% \begin{macrocode}
+\def\@seccntformat#1{\csname the#1\endcsname.\hskip0.5em\relax}%
+% \end{macrocode}
+%
+% Note that we wish to set the section head uppercase, so we use
+% David Carlisle's \cmd\MakeTextUppercase. However, because this procedure effectively
+% parses its argument (looking for things to \emph{not} translate), it has to be invoked
+% in such a way that the argument of the \cmd\section\ command is passed to it as its
+% own argument.
+%
+% To accomplish this, we use the \cmd\@hangfrom@\ hook, which was developed for this
+% purpose.
+% \begin{macrocode}
+ \def\section{%
+ \@startsection{section}{1}{\z@}{0.8cm plus1ex minus.2ex}{0.4cm}%
+ {%
+ \small\sffamily\bfseries\selectfont
+ \raggedright
+ \parindent\z@
+ }%
+ }%
+ \def\@hangfrom@section#1#2#3{\@hangfrom{#1#2}\MakeTextUppercase{#3}}%
+ \def\subsection{%
+ \@startsection{subsection}{2}{\z@}{0.8cm plus1ex minus.2ex}{0.4cm}%
+ {%
+ \small\sffamily\bfseries
+ \raggedright
+ \parindent\z@
+ }%
+ }%
+ \def\subsubsection{%
+ \@startsection{subsubsection}{3}{\z@}{.8cm plus1ex minus.2ex}{0.4cm}%
+ {%
+ \small\sffamily\selectfont
+ \raggedright
+ \parindent\z@
+ }%
+ }%
+ \def\paragraph{%
+ \@startsection{paragraph}{4}{\z@}{.8cm plus1ex minus.2ex}{-1em}%
+ {%
+ \small\slshape\selectfont
+ \raggedright
+ \parindent\z@
+ }%
+ }%
+ \def\subparagraph{%
+ \@startsection{subparagraph}{4}{\parindent}{3.25ex plus1ex minus.2ex}{-1em}%
+ {\normalsize\bfseries\selectfont}%
+ }%
+%
+ \setcounter{tocdepth}{4}% FIXME: has no effect
+% \end{macrocode}
+%
+% \begin{macro}{\appendix}
+% \begin{macro}{\@hangfrom@appendix}
+% \begin{macro}{\@hangfroms@appendix}
+% \begin{macro}{\@appendixcntformat}
+% \begin{macrocode}
+\appdef\appendix{%
+ \let\@hangfrom@section\@hangfrom@appendix
+ \let\@hangfroms@section\@hangfroms@appendix
+ \let\@sectioncntformat\@appendixcntformat
+}%
+\def\@hangfrom@appendix#1#2#3{%
+ #1%
+ \@if@empty{#2}{%
+ #3%
+ }{%
+ #2\@if@empty{#3}{}{:\ #3}%
+ }%
+}%
+\def\@hangfroms@appendix#1#2{%
+ #1\appendixname\@if@empty{#2}{}{:\ #2}%
+}%
+\def\@appendixcntformat#1{\appendixname\ \csname the#1\endcsname}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Figure and Table Caption Formatting}
+% \begin{macro}{\@makecaption}
+%
+% \begin{macrocode}
+\setlength\belowcaptionskip{2\p@}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \vbox{%
+ \flushing
+ \small\rmfamily
+% \hsize\@capwidth
+ \noindent
+ #1\nobreak\hskip.5em plus.2em\ignorespaces#2\par
+ }%
+ \vskip\belowcaptionskip
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Citations and Bibliography}%
+%
+% Customize \revtex\ for the journal substyle;
+% this task requires three components:
+% a \BibTeX\ \file{.bst} style file,
+% customizing code for \file{natbib}, and
+% customizations of the \env{thebibliography} environment.
+%
+% \begin{macro}{\@bibstyle}
+% Define the argument of the \cmd\bibliographystyle\ command
+% (if the document does not do so).
+%
+% The user must have installed a \file{.bst} file of the corresponding name.
+% This file will then be used by \BibTeX\ when compiling the document's \file{.bbl} file.
+%
+% To generate \file{apsrmp.bst}, use \classname{custom-bib} version 3.89d1 or later.
+% Run the \file{.bst} generator, \file{makebst.tex}, with the following options:
+%
+% \begin{enumerate}
+% \item
+% STYLE OF CITATIONS: a: ay( Author-year with some non-standard interface)
+% \item
+% AUTHOR-YEAR SUPPORT SYSTEM: nat: (Natbib for use with natbib v5.3 or later)
+% \item
+% ORDERING OF REFERENCES: *: (Alphabetical);
+% \item
+% ORDER ON VON PART: x: vonx (Sort without von part---de la Maire after Mahone)
+% \item
+% AUTHOR NAMES: a: nm-rev1 (Only first name reversed, initials---AGU style: Smith, J. F., H. K. Jones)
+% \item
+% POSITION OF JUNIOR: jnrlst (Junior comes last as Smith, John, Jr.)
+% \item
+% NUMBER OF AUTHORS: l: max 12, min 12 (three prompts in all);
+% \item
+% TYPEFACE FOR AUTHORS IN LIST OF REFERENCES: u: nmft, nmft-def (User defined author font---\cmd\bibnamefont)
+% \item
+% FONT FOR FIRST NAMES: u: fnm-def (First names in user defined font---\cmd\bibfnamefont)
+% \item
+% EDITOR NAMES IN INCOLLECTION ETC: a: nmfted (Editors incollection like authors font)
+% \item
+% FONT FOR `AND' IN LIST: r: nmand-rm (`And' in normal font---JONES and JAMES)
+% \item
+% FONT OF CITATION LABELS IN TEXT: u: lab, lab-def (User-defined citation font---\cmd\citenamefont)
+% \item
+% LABEL WHEN AUTHORS MISSING: keyxyr (Year blank when KEY replaces missing author---for natbib 7.0)
+% \item
+% DATE POSITION: b: dt-beg (Date after authors)
+% \item
+% SUPPRESS MONTH: xmth (Date is year only)
+% \item
+% DATE FORMAT: yr-com (Date preceded by comma as `, 1993')
+% \item
+% TRUNCATE YEAR: note-yr (Year text full as 1990--1993 or `in press')
+% \item
+% ARTICLE TITLE PRESENT: x: jtit-x (No article title);
+% \item
+% JOURNAL TITLE FONT: r: jttl-rm (Journal title normal);
+% \item
+% TECHNICAL REPORT TITLE: b: trtit-b (Tech. report title like books);
+% \item
+% JOURNAL VOLUME: b: vol-bf (Volume bold);
+% \item
+% VOLUME PUNCTUATION: c: volp-com (Volume with comma);
+% \item
+% PAGE NUMBERS: f: jpg-1 (Only start page number);
+% \item
+% POSITION OF PAGES: e: pp-last (Pages at end, but before any notes)
+% \item
+% NUMBER AND SERIES FOR COLLECTIONS: num-xser (Allows number without series and suppresses word ``number'')
+% \item
+% JOURNAL NAME PUNCTUATION: x: jnm-x (Space after journal);
+% \item
+% PUBLISHER IN PARENTHESES: p: pub-par (Publisher in parentheses)
+% \item
+% PUBLISHER POSITION: p: pre-pub (Publisher before chapter, pages);
+% \item
+% ISBN NUMBER: *: isbn (Include ISBN);
+% \item
+% ISSN NUMBER: *: isbn (Include ISSN for periodicals);
+% \item
+% `EDITOR' AFTER NAMES: a: edpar (`Name (editor),' in parentheses, after name, comma after)
+% \item
+% EDITOR IN COLLECTIONS: b: edby (In booktitle, edited by\dots---where \dots is names)
+% \item
+% PUNCTUATION BETWEEN SECTIONS (BLOCKS): c: blk-com (Comma between blocks);
+% \item
+% `IN' WITH JOURNAL NAMES: i: injnl (Add `in' before journal name in style for incollection)
+% \item
+% ABBREVIATE WORD `PAGES': a: pp (`Page' abbreviated);
+% \item
+% ABBREVIATE WORD `EDITORS': a: ed (`Editor' abbreviated);
+% \item
+% ABBREVIATION FOR `EDITION': a: ednx (`Edition' abbreviated as `ed');
+% \item
+% EDITION NUMBERS: xedn (Editions as in database saving much processing memory)
+% \item
+% STORED JOURNAL NAMES: a: jabr (Abbreviated journal names);
+% \item
+% FONT OF `ET AL': i: etal-it (Italic et al);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: r: revdata, eprint, url, url-blk (Include REVTeX data fields)
+% \item
+% NEW FONT SELECTION SCHEME: n: nfss (NFSS);
+% \item
+% ADDITIONAL REVTeX DATA FIELDS: y: revdata (additional data fields);
+% \item
+% REFERENCE COMPONENT TAGS: r: bibinfo (reference component tags);
+% \end{enumerate}
+%
+% A file \file{apsrmp.dbj} file equivalent to the following should result:
+% \begin{verbatim}
+% \input docstrip
+% \preamble
+% ----------------------------------------
+% *** REVTeX-compatible apsrmp.bst ***
+% \endpreamble
+% \postamble
+% End of customized bst file
+% \endpostamble
+% \keepsilent
+% \askforoverwritefalse
+% \def\MBopts{\from{merlin.mbs}{%
+% ay%: Author-year with some non-standard interface
+% ,nat%: Natbib for use with natbib v5.3 or later
+% ,vonx%: Sort without von part (de la Maire after Mahone)
+% ,nm-rev1%: Only first name reversed, initials (AGU style: Smith, J. F., H. K. Jones)
+% ,jnrlst%: Junior comes last as Smith, John, Jr.
+% ,nmlm%: Limited authors (et al replaces missing names)
+% ,x10%: Maximum of 10 authors
+% ,m10%: Minimum of 10 authors
+% ,nmft,nmft-def%: User defined author font (\bibnamefont)
+% ,fnm-def%: First names in user defined font (\bibfnamefont)
+% ,nmfted%: Editors incollection like authors font
+% ,nmand-rm%: `And' in normal font (JONES and JAMES)
+% ,lab,lab-def%: User defined citation font (\citenamefont)
+% ,keyxyr%: Year blank when KEY replaces missing author (for natbib 7.0)
+% ,dt-beg%: Date after authors
+% ,xmth%: Date is year only
+% ,yr-com%: Date preceded by comma as `, 1993'
+% ,note-yr%: Year text full as 1990--1993 or `in press'
+% ,jtit-x%: No article title
+% ,jttl-rm%: Journal name normal font
+% ,trtit-b%: Tech. report title like books
+% ,vol-bf%: Volume bold as {\bf vol}(num)
+% ,volp-com%: Volume with comma as vol(num), ppp
+% ,jpg-1%: Only start page number
+% ,pp-last%: Pages at end but before any notes
+% ,num-xser%: Allows number without series and suppresses word "number"
+% ,jnm-x%: Space after journal name
+% ,pub-par%: Publisher in parentheses
+% ,pre-pub%: Publisher before chapter, pages
+% ,isbn%: Include ISBN for books, booklets, etc.
+% ,issn%: Include ISSN for periodicals
+% ,edpar%: `Name (editor),' in parentheses, after name, comma after
+% ,edby%: In booktitle, edited by .. (where .. is names)
+% ,blk-com%: Comma between blocks
+% ,injnl%: Add `in' before journal name in style for incollection
+% ,pp%: `Page' abbreviated as p. or pp.
+% ,ed%: `Editor' abbreviated as ed. or eds.
+% ,xedn%: Editions as in database saving much processing memory
+% ,jabr%: Abbreviated journal names
+% ,etal-it%: Italic et al
+% ,revdata,eprint,url,url-blk%: Include REVTeX data fields collaboration, eid, eprint, numpages, url
+% ,bibinfo%: Reference component tags like \bibinfo in the content of \bibitem
+% ,nfss%: NFSS use \textbf, \emph, not \bf, \em
+% }}
+% \generate{\file{\jobname.bst}{\MBopts}}
+% \endbatchfile
+% \end{verbatim}
+%
+% \begin{macrocode}
+\appdef\class@documenthook{%
+ \@ifxundefined\@bibstyle{%
+ \def\@bibstyle{apsrmp}%
+ }{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibpunct}
+% The following commands effectively etablish the style in which \cmd\cite\ commands are
+% formatted.
+% You can think of them as the second needed component for the bibliography.
+%
+% Set up for author-year citations:
+% when \cmd\NAT@set@cites\ executes (at \envb{document} time), the \cmd\@biblabel\ will
+% be set to \cmd\NAT@biblabel.
+%
+% Per Karie Friedman (friedman@phys.washington.edu), multiple citations are separated by semicolons, e.g.,
+% (Jones, 1999; Abbott and Smith, 2000; Wortley, 2001a),
+% and
+% multiple citations by the same author by commas, e.g.,
+% Abela et al. (1995, 1997a, 1997b).
+% The third argument of \cmd\bibpunct\ handles the former.
+%
+% The fifth argument puts a comma after the author when the year is not in parens:
+% (Lee et al., 1996).
+%
+% \begin{macrocode}
+ \bibpunct{(}{)}{;}{a}{,}{,}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cite}
+% Per Mark Doyle, \cmd\cite\ is mapped to \cmd\citep\ in RMP.
+%
+% \begin{macrocode}
+ \let\cite\citep
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\bibsection}
+% \begin{macro}{\bibpreamble}
+% \begin{macro}{\newblock}
+% \begin{macro}{\bibhang}
+% \begin{macro}{\bibsep}
+% We define the sectioning command to use when starting the bibliography.
+%
+% \begin{macrocode}
+\def\bibsection{%
+ \let\@hangfroms@section\@hang@froms
+ \section*{\refname}%
+ \@nobreaktrue
+}%
+\let\bibpreamble\@empty
+\def\newblock{\ }%
+\bibhang10\p@
+\bibsep\z@
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\footinbib@sw}
+% Footnotes in bibliography are inconsistent with author-year
+% references, and are particularly nast under \classname{natbib}:
+% the packcage will automatically change to numbered references if
+% any \cmd\bibitem\ commands lack the optional argument.
+% Therefore, we must uninvoke it now, even if invoked by the document.
+% \begin{macrocode}
+\@ifxundefined\footinbib@sw{}{%
+ \footinbib@sw{%
+ \class@warn{%
+ Footnotes in bibliography are incompatible with RMP.^^J%
+ Undoing the footinbib option.
+ }%
+ }{}%
+}%
+\@booleanfalse\footinbib@sw
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\eprint}
+% RMP requires the \cmd\eprint\ field in the bib entry to be set off with the word ``eprint''.
+% \begin{macrocode}
+\def\eprint#1{eprint #1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Table of Contents}
+%
+% We set up for auto-sizing of certain TOC elements.
+%
+% To do this, we override certain definitions for
+% the default TOC font (\cmd\toc@@font) and spacing (\@dotsep),
+% and define
+% formatting for the needed elements (\cmd\l@\dots).
+% Finally, we activate the autosizing by
+% assigning \cmd\toc@pre\ and \cmd\toc@post.
+%
+% \begin{macro}{\toc@@font}
+% Set the formatting characteristics of the auto-indenting part
+% of the TOC.
+% \begin{macrocode}
+\def\toc@@font{%
+ \footnotesize\rmfamily
+ \def\\{\space\ignorespaces}%
+}%
+\def\@dotsep{5.5pt}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l@section}
+% Determine which TOC elements are automatically indented.
+% \begin{macrocode}
+\def\tocleft@{\z@}%
+\def\tocdim@min{5\p@}%
+\def\l@section{%
+ \l@@sections{}{section}% Implicit #3#4
+}%
+\def\l@subsection{%
+ \l@@sections{section}{subsection}% Implicit #3#4
+}%
+\def\l@subsubsection{%
+ \l@@sections{subsection}{subsubsection}% Implicit #3#4
+}%
+%\def\l@subsubsection#1#2{}%
+\def\l@paragraph#1#2{}%
+\def\l@subparagraph#1#2{}%
+% \end{macrocode}
+% \end{macro}
+%
+% Activate the TOC processing.
+% \begin{macrocode}
+\let\toc@pre\toc@pre@auto
+\let\toc@post\toc@post@auto
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%</rmp>
+% \end{macrocode}
+%
+%
+% \Finale
+% %Here ends the programmer's documentation.
+% \endinput
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/revtex/revtex4.ins b/Master/texmf-dist/source/latex/revtex/revtex4.ins
new file mode 100644
index 00000000000..96cf5b09722
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/revtex4.ins
@@ -0,0 +1,36 @@
+% This file requires docstrip version 2.4 or higher available from
+% ftp://ctan.tug.org/tex-archive/macros/latex/unpacked/docstrip.tex
+\input docstrip
+\preamble
+
+This file is part of the APS files in the REVTeX 4 distribution.
+For the version number, search on the string %FileInfo
+
+Original version by David Carlisle
+Modified by Arthur Ogawa (mailto:ogawa@teleport.com)
+
+Copyright (c) 1999 The American Physical Society.
+http://publish.aps.org/revtex4/
+mailto:revtex4@aps.org
+
+See the REVTeX 4 README file for restrictions and more information.
+
+\endpreamble
+\keepsilent
+\askforoverwritefalse
+\generate{
+ \file{revtex4.cls}{%
+ \from{revtex4.dtx}{class-pre}%
+ \from{ltxutil.dtx}{ltxutil-krn}%
+ \from{ltxgrid.dtx}{ltxgrid-krn}%
+ \from{textcase.dtx}{package}%
+ \from{revtex4.dtx}{class-pst}%
+ }%
+ \file{aps.rtx}{\from{revtex4.dtx}{aps}}
+ \file{rmp.rtx}{\from{revtex4.dtx}{rmp}}
+ \file{10pt.rtx}{\from{revtex4.dtx}{10pt}}
+ \file{11pt.rtx}{\from{revtex4.dtx}{11pt}}
+ \file{12pt.rtx}{\from{revtex4.dtx}{12pt}}
+ \file{revsymb.sty}{\from{revtex4.dtx}{revsymb}}
+}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/revtex/textcase.dtx b/Master/texmf-dist/source/latex/revtex/textcase.dtx
new file mode 100644
index 00000000000..60010e5ee67
--- /dev/null
+++ b/Master/texmf-dist/source/latex/revtex/textcase.dtx
@@ -0,0 +1,404 @@
+% \iffalse
+%% Source File: textcase.dtx
+%% Copyright 1997 1998 David Carlisle
+%%
+%% This file may be distributed under the terms of the LPPL.
+%% See 00readme.txt for details.
+%
+%<*dtx>
+ \ProvidesFile{textcase.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{textcase}
+%<driver> \ProvidesFile{textcase.drv}
+% \fi
+% \ProvidesFile{textcase.dtx}
+ [1998/11/12 v0.06 Text only upper/lower case changing (DPC)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{textcase}
+\begin{document}
+\DocInput{textcase.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{textcase.dtx}
+% \CheckSum{110}
+%
+% \changes{v0.01}{1997/09/28}
+% {Posted to c.t.t}
+% \changes{v0.02}{1997/09/28}
+% {Support \cs{ensuremath}}
+% \changes{v0.03}{1997/12/12}
+% {Donald Arseneau: support \cs{ref} \cs{cite} \cs{label}}
+% \changes{v0.04}{1997/12/14}
+% {Convert to dtx form, add \cs{NoCaseChange}}
+% \changes{v0.04}{1997/12/14}
+% {Support (most uses of) optional argument of \cs{cite}}
+% \changes{v0.05}{1997/12/16}
+% {More comments from Donald,
+% perhaps I should just give him this package for Christmas}
+% \changes{v0.06}{1998/11/12}
+% {overload option}
+%
+%
+% \title{The \textsf{textcase} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{David Carlisle\thanks{%^^A
+% Reorganisation to suppport skipping a wider class of
+% things than just math done by Donald Arseneau}}
+%
+% \date{\filedate}
+%
+% \maketitle
+%
+% \section{Introduction}\label{intro}
+% |\MakeTextUppercase| and |\MakeTextLowercase| are versions of the
+% standard |\MakeUppercase| and |\MakeLowercase| that do not change
+% the case of any math sections in their arguments.
+%\begin{verbatim}
+% \MakeTextUppercase{abc\ae\ \( a = b \) and $\alpha \neq a$
+% or even \ensuremath{x=y} and $\ensuremath{x=y}$}
+%\end{verbatim}
+% Should produce:
+% \begin{quotation}
+% ABC\AE\ \( a = b \) AND $\alpha \neq a$
+% OR EVEN \ensuremath{x=y} AND $\ensuremath{x=y}$
+% \end{quotation}
+%
+% Version 0.03 of this package incorporates some changes suggested by
+% Donald Arseneau so that as well as math mode, the arguments of
+% |\cite|, |\label| and |\ref| are also prevented from being uppercased.
+% So you can now go
+%\begin{verbatim}
+% \MakeTextUppercase{%
+% Text in section~\ref{intro}, about \cite[pp 2--4]{bbb}}
+%\end{verbatim}
+% which produces
+% \begin{quotation}
+% \MakeTextUppercase{%
+% Text in section~\ref{intro}, about \cite[pp 2--4]{bbb}}
+% \end{quotation}
+% If, instead, the standard |\MakeUppercase| were used here, the keys
+% `into' and `bbb' would be uppercased and generate errors about
+% undefined references to INTRO and BBB.
+%
+% Sometimes there may be a special section of text that should not be
+% uppercased. This can be marked with |\NoCaseChange|, as follows.
+%\begin{verbatim}
+% \MakeTextUppercase{%
+% Text \NoCaseChange{More Text} yet more text}
+%\end{verbatim}
+% which produces
+% \begin{quotation}
+% \MakeTextUppercase{%
+% Text \NoCaseChange{More Text} yet more text}
+% \end{quotation}
+%
+% |\NoCaseChange| has other uses. If for some reason you need a
+% tabular environment within an uppercased section, then you need
+% to ensure that the name `tabular' and the preamble (eg `ll')
+% does not get uppercased:
+%\begin{verbatim}
+% \MakeTextUppercase{%
+% Text \NoCaseChange{\begin{tabular}{ll}}%
+% table&stuff\\goes&here
+% \NoCaseChange{\end{tabular}}
+% More text}
+%\end{verbatim}
+% which produces
+% \begin{quotation}
+% \MakeTextUppercase{%
+% Text \NoCaseChange{\begin{tabular}{ll}}%^^A
+% table&stuff\\goes&here
+% \NoCaseChange{\end{tabular}}
+% More text}
+% \end{quotation}
+%
+% \section{Features and Foibles}
+%
+% \subsection{Nested text}
+% The commands defined here only skip math sections and |\ref| arguments
+% if they are not `hidden' inside a |{ }| brace group. All text inside
+% such a group will be made uppercase just as with the standard
+% |\MakeUppercase|.
+%\begin{verbatim}
+% \MakeTextUppercase{a b {c $d$} $e$}
+%\end{verbatim}
+% produces
+% \begin{quotation}
+% \MakeTextUppercase{a b {c $d$} $e$}
+% \end{quotation}
+% Of course, this restriction does not apply to the arguments of the
+% supported commands |\ensuremath|, |\label|, |\ref|, and |\cite|.
+%
+% If you cannot arrange for your
+% mathematics to be at the outer level of brace grouping, you should
+% use the following basic technique (which works even with the standard
+% |\MakeUppercase| command). Define a new command that expands to your
+% math expression, and then use that command, with |\protect|, in the
+% text to be uppercased. Note that if the text being uppercased is in a
+% section title or other moving argument you may need to make the
+% definition in the document preamble, rather than just before the
+% section command, so that the command is defined when the table of
+% contents file is read.
+%\begin{verbatim}
+% \MakeTextUppercase{%
+% Text \fbox{$a=b$ and $x=y$}}%
+%
+% \newcommand{\mathexprone}{$a=b$}
+% \newcommand{\mathexprtwo}{$x=y$}
+% \MakeTextUppercase{%
+% Text \fbox{\protect\mathexprone\ and \protect\mathexprtwo}}%
+%\end{verbatim}
+% which produces
+% \begin{quotation}
+% \MakeTextUppercase{%
+% Text \fbox{$a=b$ and $x=y$}}%
+%
+% \newcommand{\mathexprone}{$a=b$}
+% \newcommand{\mathexprtwo}{$x=y$}
+% \MakeTextUppercase{%
+% Text \fbox{\protect\mathexprone\ and \protect\mathexprtwo}}%
+% \end{quotation}
+%
+% \subsection{Citations}
+% As documented above, |\cite| and |\ref| commands are not uppercased by
+% |\MakeTextUppercase|. If you are using a non-numeric citation scheme
+% you may want the replacement text for |\cite| to be uppercased.
+%
+% It is difficult to arrange that |\MakeTextUppercase| uppercases such
+% text, not least because this would lead to interaction with the many
+% bibliography packages which redefine |\cite| one way or another. One
+% possibility to achieve this is to use Donald Arseneau's cite package
+% and to locally redefine |\citeform| to add |\MakeUppercase| around
+% the final text string produced by |\cite|.
+%\begin{verbatim}
+% \MakeTextUppercase{%
+% Text \cite{bbb} and \cite{ccc}}
+%
+% {\renewcommand\citeform{\MakeUppercase}\MakeTextUppercase{%
+% Text \cite{bbb} and \cite{ccc}}}
+%\end{verbatim}
+% which produces\footnote{This is faked, so this document does not
+% rely on \texttt{cite.sty} being installed}
+% \begin{quotation}
+% TEXT [1] AND [David Carlisle 1997]
+%
+% TEXT [1] AND [DAVID CARLISLE 1997]
+% \end{quotation}
+%
+% \subsection{overload Option}
+% By default the package only defines new commands, |\MakeTextUppercase|
+% and |\MakeTextlowercase| as described above. You may wish to redefine
+% the standard |\MakeUppercase| and |\MakeLowercase| commands to be
+% the same as these new commands. So that for example headings in the
+% book class have this new feature without any further redefinition.
+% You may use the package option |[overload]| in which case these
+% new definitions will be overloaded on to the existing command names.
+%
+% \begin{thebibliography}{9}
+%
+% \bibitem{bbb} Something numeric
+% \bibitem[David Carlisle 1997]{ccc} Something textual
+% \end{thebibliography}
+%
+% \StopEventually{}
+%
+% \section{Implementation}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macro}{\@uclcnotmath}
+% This is the main macro of this package. It is basically
+% a copy of |\MakeTextUppercase| and |\MakeTextLowercase|
+% from the \LaTeX\ kernel, modified slightly so that they
+% can share code (that modification could be done to the
+% standard versions as well) and then further changed to
+% skip certain features like math mode and |\label| arguments.
+%
+% The arguments are:\\
+% |#1|: Extra commands to apply for case changing.
+% Used to locally redefine |\i| and |\j| for uppercasing.\\
+% |#2|: Either |##1##2| or |##2##1| to control the order
+% in which |\let| is applied to the pairs of control
+% sequences in |\@uclclist|.\\
+% |#3|: |\uppercase| or |\lowercase|.\\
+% |#4|: The text to be upper (or lower) cased.
+% \begin{macrocode}
+\def\@uclcnotmath#1#2#3#4{\begingroup
+% \end{macrocode}
+% Run extra commands (currently just to redefine |\i| and |\j|).
+% \begin{macrocode}
+ #1%
+% \end{macrocode}
+%
+% Locally set |\( \)| to be just |$ $|, so that the math skipping
+% code can be simplified, just to look for |$|.
+% \begin{macrocode}
+ \def\({$}\let\)\(%
+% \end{macrocode}
+%
+% Set up the `non-math' things that also have to be skipped.
+% \begin{macrocode}
+ \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
+ \@nonchangecase\label
+ \@nonchangecase\ref
+ \@nonchangecase\ensuremath
+% \end{macrocode}
+%
+% |\cite| a bit trickier, as we want to uppercase any optional argument.
+% This will fail if the optional argument contains a brace group, but
+% should catch most cases.
+%
+% |text \cite[page 1]{foo} more text| ends up as
+%\begin{verbatim}
+% \uppercase{text \toks@{\cite[page1]}%
+% \the\toks@{foo}%
+% \uppercase{ more text}
+%\end{verbatim}
+% \begin{macrocode}
+ \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
+ \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
+% \end{macrocode}
+% (|\@citex| is a scratch macro here, not a redefinition of the existing
+% |\@citex|.)
+%
+% The following is essentially taken from |\MakeUppercase|.
+% Recursively execute |\reserved@a| to |\let| the pairs in |\@uclclist|.
+% The strange construction with |\@gobble| at the end just gobbles the
+% final recursive call.
+%
+% Incidentally, packages should not use the |\reserved@|\ldots\ scratch
+% macros, which are `reserved' for use within the \LaTeX\ kernel, but
+% (a) this code is essentially a copy from the kernel, and
+% (b) I'm allowed to break the rules, so there.
+% \begin{macrocode}
+ \def\reserved@a##1##2{\let#2\reserved@a}%
+ \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
+% \end{macrocode}
+%
+% Expand everything first so that the `skipping' code can see what to
+% skip and so that tokens are revealed to |\uppercase|.
+% This makes the argument `moving'.
+% The |$\valign$| is just a fake math expression used to terminate
+% the parsing done by |\@skipmath|.
+% \begin{macrocode}
+ \protected@edef\reserved@a{\endgroup
+ \noexpand\@skipmath#3#4$\valign$}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \reserved@a}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nonchangecase}
+% \begin{macrocode}
+\def\@nonchangecase#1{\def#1##1{\NoCaseChange{#1{##1}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\NoCaseChange}
+% For hiding arbitrary text from |\uppercase|. This innocuous
+% definition is used for any occurrence of |\NoCaseChange|
+% in text that is not passed to |\MakeTextUppercase|. For example a
+% section heading may be uppercased, but the toc entry may not.
+% It is also used for nested definitions of |\cite| etc, where the
+% |\NoCaseChange| is inserted by expansion, but not removed as it is
+% hidden by the brace group.
+% \begin{macrocode}
+\let\NoCaseChange\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+%\begin{macro}{\@skipmath}
+% |#1|: operation |\uppercase| / |\lowercase|\\
+% |#2|: text up to first (next) |$|\\
+% |#3|: first math mode material (or |\valign| sentinel)
+% \begin{macrocode}
+\def\@skipmath#1#2$#3${%
+ \@skip@nonchangecase#1#2\NoCaseChange\valign
+ \ifx\valign#3%
+ \else
+ $#3$%
+ \expandafter\@skipmath\expandafter#1%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%\begin{macro}{\@skip@nonchangecase}
+% |#1|: |\uppercase| or |\lowercase|\\
+% |#2|: Text up to the first command (such as |\cite|) made `safe'.
+% or the first use of |\NoCaseChange|.
+% \begin{macrocode}
+\def\@skip@nonchangecase#1#2\NoCaseChange#3{%
+ #1{#2}%
+ \ifx\valign#3%
+ \else
+ #3%
+ \expandafter\@skip@nonchangecase\expandafter#1%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTextUppercase}
+% \changes{v0.06}{1998/11/12}
+% {Add edef to make behaviour more like \cs{MakeUppercase}}
+% Put it all together. Arrange for \i\ and \j\ to uppercase, and
+% to read the pairs in the ucase list `forwards'.
+% \begin{macrocode}
+\DeclareRobustCommand\MakeTextUppercase{%
+ \@uclcnotmath{\def\i{I}\def\j{J}}{##1##2}\uppercase}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\protected@edef\MakeTextUppercase#1{\MakeTextUppercase{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTextLowercase}
+% \changes{v0.06}{1998/11/12}
+% {Add edef to make behaviour more like \cs{MakeLowercase}}
+% probably will never be used, but it is easy to implement.
+% Use |\lowercase| and read the pairs in the uppercase list `backwards'.
+% \begin{macrocode}
+\DeclareRobustCommand\MakeTextLowercase{%
+ \@uclcnotmath{}{##2##1}\lowercase}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\protected@edef\MakeTextLowercase#1{\MakeTextLowercase{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeUppercase}
+% \begin{macro}{\MakeLowercase}
+% \changes{v0.06}{1998/11/12}
+% {Option to overload added. latex/2906}
+% \begin{macrocode}
+\DeclareOption{overload}{%
+ \expandafter\let\csname MakeUppercase \expandafter\endcsname
+ \csname MakeTextUppercase \endcsname
+ \expandafter\let\csname MakeLowercase \expandafter\endcsname
+ \csname MakeTextLowercase \endcsname}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/Master/texmf-dist/source/latex/scalebar/scalebar.dtx b/Master/texmf-dist/source/latex/scalebar/scalebar.dtx
new file mode 100644
index 00000000000..7977dd67b30
--- /dev/null
+++ b/Master/texmf-dist/source/latex/scalebar/scalebar.dtx
@@ -0,0 +1,518 @@
+% \iffalse meta-comment
+%
+% This is the scalebar package, scalebar.dtx
+%
+% Copyright (C) 2003 by Michael Lake <mikel@speleonics.com.au>
+%
+% This file 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.
+%
+%
+%<*driver>
+\ProvidesFile{scalebar.dtx}
+%</driver>
+%
+%
+%<package>\ProvidesPackage{scalebar}%
+ [2003/05/01 v1.0 Scalebars for maps and diagrams]
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<package>\RequirePackage{ifthen}
+%<package>\RequirePackage{calc}
+%<package>\RequirePackage{fp}
+%
+%<*driver>
+\documentclass{ltxdoc}
+\GetFileInfo{scalebar.dtx}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%\OnlyDescription
+\begin{document}
+ \DocInput{scalebar.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \CheckSum{187}
+%
+% \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 \~}
+%
+% \changes{v1.0}{2003/05/01}{Initial version}
+%
+% \DoNotIndex{
+% \newcounter,\setcounter,\addtocounter,\newlength,\setlength,
+% \else,\fi,\hfill,\hspace,\rule,\newcommand}
+%
+% \setlength{\parskip}{0.4\baselineskip}
+% \setlength{\parindent}{0pt}
+%
+% \title{The \textsf{scalebar} package}
+% \author{Michael Lake\\ \texttt{mikel@speleonics.com.au}}
+% \date{\fileversion{} -- \filedate}
+% \maketitle
+%
+%
+%
+% \section{Introduction}
+%
+% This document describes the \textsf{scalebar} package for \LaTeXe, which
+% creates scalebars for maps, diagrams or photos.
+% It was designed for use with cave maps, but
+% can be used for anything from showing a scalebar in kilometers for
+% topographic maps to a scalebar in micrometers for
+% an electron microscope image.
+%
+% Here is an example scalebar.
+% See the scalebar\_examples file for further examples and possible uses.
+%
+% ^^A In the scalebar below I have not used the \scalebar command
+% ^^A as the user would not have it yet to typeset the scalebar so I
+% ^^A have used two temporary commands to typeset some rules and created
+% ^^A the scalebar from those.
+% \newcommand{\tempA}[1]{\rule{#1}{2mm}\hspace{-#1}\raisebox{-2mm}{\rule{#1}{0.2mm}}}
+% \newcommand{\tempB}[1]{\raisebox{1.8mm}{\rule{#1}{0.2mm}}\hspace{-#1}\raisebox{-2mm}{\rule{#1}{2mm}}}
+% ^^A Now from the above two commands create a scalebar.
+% \raisebox{-2mm}{\rule{0.2mm}{4mm}}\tempA{5mm}\tempB{5mm}\tempA{5mm}\tempB{5mm}\tempA{20mm}\tempB{20mm}\tempA{20mm}\tempB{20mm}\raisebox{-2mm}{\rule{0.2mm}{4mm}}
+%
+% ^^A Scale the text manually. Normally \scalebar would do this for you.
+%\hspace{-0.5ex}0\hspace{1.85cm}2\hspace{1.8cm}4\hspace{1.85cm}6\hspace{1.8cm}8\hspace{1.75cm}10\,m
+%
+% \section{Usage}
+%
+%
+% \DescribeMacro{\scalebar}
+% The \textsf{scalebar} package defines one user command.
+% To use the command you write;
+%
+% |\scalebar|\oarg{inverse}\marg{length}\marg{minordivs}\marg{majordivs}\\
+% | |\marg{starting No.}\marg{ending No.}\marg{units}
+%
+% \noindent where the six mandatory arguments are:
+%
+% \begin{tabular}{lp{9.5cm}}
+% \meta{length}&the desired length of the scalebar on paper
+% e.g.\ 10cm or 4in\\
+% \meta{minordivs}&number of minor divisions within the first major
+% division e.g.\ 4 (the first major division will always be
+% subdivided unless this value is set to 1)\\
+% \meta{majordivs}&number of major divisions e.g.\ 5 \\
+% \meta{starting No.}&the number that the scalebar text will start from
+% e.g.\ 0 or -0.5\\
+% \meta{ending No.}&the number that the scalebar text will end with
+% e.g.\ 2.5 or 25\\
+% \meta{units}&the units for the scalebar text e.g.\ $\mu$m or km.
+% \end{tabular}
+% \vspace{0.4\baselineskip}
+%
+% The optional argument \meta{inverse} reverses the black and white regions.
+% The default setting is for the top of the first bar to be black.
+%
+%
+% \newpage
+% \section{Current Limitations and Future Enhancements}
+% \begin{description}
+% \item[Scalebar height/text ratio is hardcoded]
+% The height of the black rules in the scalebars is |1.2ex| so it scales
+% with the current font height. This value seems about right but if you
+% want a different height compared to the text height you will have to modify
+% the style file (modify |\SB@Height|). This could possibly be set as
+% an optional argument to the package.
+% \item[Thickness of the thin rule is fixed] The thickness of the thin rule
+% is set to 0.2\,mm. This seems about right. If you wish to change it is easy
+% to modify the style file (|\SB@Thick|).
+% \item[Number of decimal places is limited to one] Scalebars rarely display
+% more than one decimal place in the scalebar text. This package rounds the
+% decimals of the displayed text to one place. If you want two decimal places
+% you will have to modify the style file.
+% \end{description}
+%
+% Please let me know if you encounter any problems.
+% If you have suggestions for extra options to add, then code for that
+% would be appeciated.
+%
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+% \section{Implementation}
+%
+% First we have to decide how a scalebar is constructed. Looking a a scalebar
+% one can see that it is made up of alternating black and white bars. It would
+% seem sensible therefore to define some sort of ``unit'' or ``building block''
+% that can be iterated any number of times to create a scalebar of arbitary
+% length and with an arbitary number of divisions. The diagram below of a
+% scalebar and its deconstruction shows one way to break it up into units.
+% \vspace{0.4\baselineskip}
+%
+% \raisebox{-2mm}{\rule{0.2mm}{4mm}}\tempA{5mm}\tempB{5mm}\tempA{5mm}\tempB{5mm}\tempA{20mm}\tempB{20mm}\tempA{20mm}\raisebox{-2mm}{\rule{0.2mm}{4mm}}
+% \vspace{0.6\baselineskip}
+%
+% \raisebox{-2mm}{\rule{0.2mm}{4mm}} \mbox{}
+% \tempA{5mm} \mbox{} \tempB{5mm} \mbox{} \tempA{5mm} \mbox{} \tempB{5mm} \mbox{}
+% \tempA{20mm} \mbox{} \tempB{20mm} \mbox{} \tempA{20mm} \mbox{} \raisebox{-2mm}{\rule{0.2mm}{4mm}}
+% \vspace{0.8\baselineskip}
+%
+% Looking at the parts above you can see there is a thin vertical rule at the
+% start of each scalebar. This is followed by repeating ``scalebar units'' each
+% one of which alternates in color. Finally there is a thin vertical rule to
+% close the end of the scalebar.
+%
+% I have therefore defined two scalebar units. The first one typesets the thick
+% black rule on the top. After writing this rule we then move back
+% horizontally a distance equal to the width of the rule written. Then we write
+% the thinner rule underneath it by using a raisebox with a negative vertical
+% distance. This unit looks like this:
+%
+% \hspace{2em}\tempA{5mm}\ X%
+% \hspace{2em}(the X shows the position of the baseline)
+% \vspace{0.2\baselineskip}
+%
+% The second type of unit has the thick black rule on the bottom like this:
+%
+% \hspace{2em}\tempB{5mm}\ X
+% \vspace{0.2\baselineskip}
+%
+% By stringing these two types of units together within a while loop
+% we can create our scalebars.
+% Let's now proceed to the start of the macro.
+%
+% \subsection{Required Packages}
+%
+% We have used the \textsf{fp} package to provide floating point calculations
+% and a rounding function via the |\FPupn| macro. The \textsf{calc} package
+% provides an easy calculation syntax for simple subtraction of lengths.
+% The \textsf{ifthen} package provides the whiledo loop and the
+% ifthenelse contruct.
+%
+% \subsection{Initialisation}
+%
+% Note that we have to place a \% at the end of each command to suppress any
+% whitespace. Otherwise the scalebar will ``break apart''.
+%
+% \begin{macro}{counters/lengths}
+%
+% Define counters and lengths.
+%
+% The first three mandatory arguments specify the length of the scalebar and
+% the numbers of the divisions. The arguments that specify the format of text
+% underneath the scalebar will be introduced later.
+%
+% \begin{macrocode}
+\newlength{\SB@Length}%
+\newcounter{SB@majordivs}%
+\newcounter{SB@minordivs}%
+% \end{macrocode}
+%
+% These are some further general counters and lengths.
+%
+% \begin{macrocode}
+\newcounter{SB@evenodd}%
+\newcounter{SB@countup}%
+\newlength{\SB@Height}%
+\newlength{\SB@Thick}%
+\newlength{\SB@MajorWidth}%
+\newlength{\SB@MinorWidth}%
+\newlength{\SB@DivisionWidth}%
+\newlength{\SB@TextWidth}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% Now define two small commands to typeset the two `scalebar units'.
+%
+% \begin{macro}{\SB@unitT}
+%
+% This command typesets the unit with the thick black rule on the \emph{top}.
+%
+% \begin{macrocode}
+\newcommand{\SB@unitT}{%
+\rule{\SB@DivisionWidth}{\SB@Height}\hspace{-\SB@DivisionWidth}%
+\raisebox{-\SB@Height}{\rule{\SB@DivisionWidth}{\SB@Thick}}}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\SB@unitB}
+%
+% This command typesets the thick black rule on the \emph{bottom}.
+%
+% \begin{macrocode}
+\newcommand{\SB@unitB}{%
+\raisebox{\SB@Height-\SB@Thick}%
+{\rule{\SB@DivisionWidth}{\SB@Thick}}\hspace{-\SB@DivisionWidth}%
+\raisebox{-\SB@Height}{\rule{\SB@DivisionWidth}{\SB@Height}}}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \newpage
+% \subsection{The scalebar macro}
+%
+% \begin{macro}{\scalebar}
+% Start the scalebar command and process the command arguments.
+%
+% \begin{macro}{args}
+% The first argument is an optional argument which is set to
+% nothing as default. Normally the value
+% of |SB@evenodd| is 0 which will result in the black rule of
+% the first division being on top. If \meta{inverse} is set the
+% black rule will be set on the bottom.
+%
+% \begin{macrocode}
+\newcommand{\scalebar}[7][]{%
+%
+\ifthenelse{\equal{inverse}{#1}}%
+{\setcounter{SB@evenodd}{1}}%
+{\setcounter{SB@evenodd}{0}}%
+% \end{macrocode}
+%
+% Read in the next three mandatory arguments.
+%
+% \begin{macrocode}
+\setlength{\SB@Length}{#2}%
+\setcounter{SB@minordivs}{#3}%
+\setcounter{SB@majordivs}{#4}%
+% \end{macrocode}
+%
+% Define the number at which the text will start by |\SB@StartNo|;
+% the number at which it will end by |\SB@EndNo| and the units the text
+% represents by |\SB@TextUnits|. These are set to the last three mandatory
+% arguments.
+%
+% \begin{macrocode}
+\def\SB@StartNo{#5}%
+\def\SB@EndNo{#6}%
+\def\SB@TextUnits{#7}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% Set the height of the scalebar and thickness of the thin enclosing rule.
+%
+% Let the height of the thick black rule of a division be |\SB@Height| and set
+% it to a value related to the x-height of the current font. This is because
+% we want the scalebar to increase in height if the user specifies a change in
+% font size. It's set after the command begins rather than earlier as we want
+% it to pickup a font change immediately before the scalebar command if any.
+% The thin rule that encloses the divisions (|\SB@Thick|) will be hard coded to
+% 0.2\,mm. This was chosen as it looked about right :-)
+%
+% \begin{macrocode}
+\setlength{\SB@Height}{1.2ex}%
+\setlength{\SB@Thick}{0.2mm}%
+% \end{macrocode}
+%
+%
+% Calculate the lengths of the divisions.
+%
+% Let's define |\SB@MajorWidth| to be the width (i.e.\ length) of a
+% major division.
+% To calculate this we take the total scalebar length and divide by
+% the number of major divisions.
+% To calculate the length of a minor division, |\SB@MinorWidth|, we divide
+% the major division length just calculated by the number of minor divisions.
+%
+% \begin{macrocode}
+\setlength{\SB@MajorWidth}{\SB@Length / \theSB@majordivs}%
+\setlength{\SB@MinorWidth}{\SB@MajorWidth / \theSB@minordivs}%
+% \end{macrocode}
+%
+%
+%
+% \subsection{Drawing the scalebar}
+%
+% Now we can start placing ink to paper.
+% Place onto the page the thin vertical rule at the start of the scalebar.
+% As it starts at the baseline we have to make it twice the height of
+% |\SB@Height| and lower it by |\SB@Height|.
+%
+% \begin{macrocode}
+\raisebox{-\SB@Height}{\rule{\SB@Thick}{2\SB@Height}}%
+% \end{macrocode}
+%
+%
+% Use a while loop to place the minor divisions onto the page. (Use a new
+% counter rather than decrementing minordivs variable.) Note
+% that we alternate between using the |\SB@unitT| or the |\SB@unitB| unit
+% depending on the value of the |SB@evenodd| variable. That value
+% is set at the beginning and depends on the setting of the optional
+% \meta{inverse} argument.
+%
+% \begin{macrocode}
+\setlength{\SB@DivisionWidth}{\SB@MinorWidth}%
+\setcounter{SB@countup}{0}%
+\whiledo{\not\theSB@countup=\theSB@minordivs}{%
+\ifthenelse{\isodd{\value{SB@evenodd}}}{\SB@unitB}{\SB@unitT}%
+\addtocounter{SB@evenodd}{1}%
+\addtocounter{SB@countup}{1}}%
+% \end{macrocode}
+%
+%
+% Now that the minor divisions are done we can write the major divisions.
+%
+% Note that we have to reset the length of the rule from the
+% current width of a minor division to the width of a major division.
+% Set the counter this time to start at 1 rather than 0
+% as we have already written all the minor divisions which adds up
+% to one major division.
+%
+% \begin{macrocode}
+\setlength{\SB@DivisionWidth}{\SB@MajorWidth}%
+\setcounter{SB@countup}{1}%
+\whiledo{\not\theSB@countup=\theSB@majordivs}{%
+\ifthenelse{\isodd{\value{SB@evenodd}}}{\SB@unitB}{\SB@unitT}%
+\addtocounter{SB@evenodd}{1}%
+\addtocounter{SB@countup}{1}}%
+% \end{macrocode}
+%
+% Finally we have to print the thin vertical rule at the end.
+%
+% \begin{macrocode}
+\raisebox{-\SB@Height}{\rule{\SB@Thick}{2\SB@Height}}%
+% \end{macrocode}
+%
+%
+% \subsection{Typesetting the scalebar numbers}
+%
+% Typesetting of the text underneath the scalebar requires three
+% pieces of information; the number at which the text will start,
+% the number at which it will end and what units the text represents.
+% The numbering does not have to start at zero.
+%
+% Some scalebars will consist of integers only as in the text below.\\
+% 0\hspace{1.5cm}2\hspace{1.5cm}4\hspace{1.5cm}6\hspace{1.5cm}8\hspace{1.5cm}10\,km
+%
+% Other scalebars will have decimals. Althought usually scalebars only show
+% one decimal place at most. \\
+% -0.5\hspace{1.5cm}0\hspace{1.5cm}1.5\hspace{1.5cm}2.0\hspace{1.5cm}2.5\,cm
+%
+%
+% We now use macros provided by the fp.sty (fixed point)
+% package to perform some simple arithmetic and rounding.
+%
+% Calculate how much we will increment the numbers by subtracting
+% the starting and ending numbers (|SB@StartNo| and |SB@EndNo|) then dividing their difference by the
+% number of major divisions.
+%
+% \begin{macrocode}
+\FPupn\SBIncrement%
+{\the\value{SB@majordivs} \SB@StartNo{} \SB@EndNo{} - /}%
+% \end{macrocode}
+%
+%
+% Now we need to work out how many decimal places to display for the numbers.
+%
+% Start off with rounding set to none. If the calculated increment
+% is an integer then don't do anything, otherwise set rounding on and
+% round the increment to one decimal place. This would suffice for many
+% variations of starting and ending number, however if the user entered
+% -0.5 to 2.5 for these values respectively then the increment (3.0) would be
+% an integer and the rounding would be set to zero. In theses cases though
+% the starting and ending numbers must be non-integer thus by testing all three
+% numbers we can cover all cases.
+%
+% \begin{macrocode}
+\def\SBRound{0}%
+\FPifint\SBIncrement%
+\else\def\SBRound{1}\FPupn\SBIncrement{\SBIncrement{} 1 round}\fi%
+\FPifint\SB@StartNo%
+\else\def\SBRound{1}\FPupn\SB@StartNo{\SB@StartNo{} 1 round}\fi%
+\FPifint\SB@EndNo%
+\else\def\SBRound{1}\FPupn\SB@EndNo{\SB@EndNo{} 1 round}\fi%
+% \end{macrocode}
+%
+%
+% Now remember that we are at the end of the scalebar so to print the
+% text underneath we have to move back to the left and down.
+% Move left by a distance equal to the scalebar length (|\SB@Length|)
+% plus a little bit more to take into account the thickness of the thin
+% line at the start and end of the scalebar (|\SB@Thick|).
+% Then move down by enough to place the
+% text at a nice distance below the scalebar. Remember that the distance
+% |\SB@Height| depends on the current font in a fixed ratio set earlier.
+%
+% \begin{macrocode}
+\hspace{-\SB@Length}\hspace{-\SB@Thick}%
+\raisebox{-3\SB@Height}{%
+% \end{macrocode}
+%
+% Now we are ready to print the numbers.
+% The length |\SB@TextWidth| contains the
+% width of the text that we are about to put to page.
+% We need to calculate this so that we can fine position the center of
+% the text to be exactly under the start of each major division.
+% Note how we use the value of |\SBRound| to set the number of
+% decimal places in the text we typeset.
+%
+% \begin{macrocode}
+\FPset\SBNextNo\SB@StartNo%
+\setcounter{SB@countup}{0}%
+\whiledo{\not\theSB@countup>\theSB@majordivs}{%
+\FPupn\SBNextNo{\SBNextNo{} \SBRound{} round}%
+\settowidth{\SB@TextWidth}{\SBNextNo}%
+\hspace{-0.5\SB@TextWidth}%
+\SBNextNo\hspace{-0.5\SB@TextWidth}\hspace{\SB@MajorWidth}%
+\FPupn\SBNextNo{\SBNextNo{} \SBIncrement{} add}%
+\addtocounter{SB@countup}{1}}%
+% \end{macrocode}
+%
+% Now all the numbers are on the page we are nearly ready to append
+% the scalebars units to the end. First though we have to move back
+% by the distance |\SB@MajorWidth| as the last while loop added
+% this unwanted space, then forward half of the width of the last
+% number printed.
+% Finally add a thin space and the units and finish the scalebar
+% command with its closing brace.
+%
+% \begin{macrocode}
+\hspace{-\SB@MajorWidth}\hspace{0.5\SB@TextWidth}\,\SB@TextUnits}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% That's the end of the macro.
+%
+% \section*{License}\label{sec:license}
+% This program 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
+%
+% \hspace{2em}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.
+%
+% This program consists of the files \textsf{scalebar.dtx} and
+% \textsf{scalebar.ins}
+%
+%
+% \section*{Acknowledgements}
+%
+% Thanks to the people on the \textsf{comp.text.tex} newsgroup for their
+% help to me in developing this package.
+%
+%
+% \Finale{\vspace{\baselineskip}\hfill\rule{3in}{0.1pt}\hfill}
+\endinput
diff --git a/Master/texmf-dist/source/latex/scalebar/scalebar.ins b/Master/texmf-dist/source/latex/scalebar/scalebar.ins
new file mode 100644
index 00000000000..af2287fba79
--- /dev/null
+++ b/Master/texmf-dist/source/latex/scalebar/scalebar.ins
@@ -0,0 +1,55 @@
+%%
+%% Copyright (C) 2003 by Michael Lake <mikel@speleonics.com.au>
+%%
+%% This file 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.
+%%
+
+\input docstrip.tex
+\askforoverwritefalse
+\keepsilent
+
+\usedir{tex/latex/misc/}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2003 by Michael Lake <mikel@speleonics.com.au>
+
+This file 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.
+
+\endpreamble
+
+\generate{\file{scalebar.sty}{\from{scalebar.dtx}{package}}}
+
+\Msg{***************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space scalebar.sty}
+\Msg{*}
+\Msg{* To produce the documentation run the file scalebar.dtx}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{***********************************************************}
+
+\endbatchfile
+
diff --git a/Master/texmf-dist/source/latex/soul/Makefile b/Master/texmf-dist/source/latex/soul/Makefile
new file mode 100644
index 00000000000..1a0103f695c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/soul/Makefile
@@ -0,0 +1,57 @@
+# $Id: Makefile,v 1.7 2003/06/22 09:23:35 m Rel $
+
+NAME=soul
+ARCHNAME=$(NAME).tar.gz
+ARCHIVE=$(NAME).dtx Makefile $(NAME).txt $(NAME).ins
+MAKEIDXOPT=
+DVIPSOPT=#-Pcmz -Pamz
+DEP=$(NAME).sty
+
+all: $(NAME).sty $(NAME).ps
+
+print: $(NAME).ps
+ psbook $(NAME).ps|psnup -2|psselect -e|lpr
+ @ echo -n revert paper stack and hit return
+ @ read key
+ psbook $(NAME).ps|psnup -2|psselect -o -r|lpr
+
+ps: $(NAME).ps
+
+%.ps: %.dvi
+ dvips $(DVIPSOPT) $< -o $@
+
+hyper: $(NAME).dtx $(NAME).sty
+ pdflatex "\relax\let\makehyperref\active\input $(NAME).dtx"
+
+$(NAME).pdf: $(NAME).dtx $(NAME).sty
+ pdflatex $(NAME).dtx
+
+archive:
+ @ tar -czf $(ARCHNAME) $(ARCHIVE)
+ @ echo $(ARCHNAME)
+
+clean:
+ rm -f $(NAME).{log,toc,lot,lof,idx,ilg,ind,aux,blg,bbl,dvi,ins,out}
+
+distclean: clean
+ rm -f $(NAME).{ps,sty,pdf} $(ARCHNAME)
+
+
+REFWARN = 'Rerun to get cross-references'
+LATEXMAX = 5
+
+%.dvi: %.dtx $(DEP)
+ latex $< ; true
+ RUNS=$(LATEXMAX); \
+ while [ $$RUNS -gt 0 ] ; do \
+ if grep $(REFWARN) $*.log > /dev/null; \
+ then latex $< ; else break; fi; \
+ RUNS=`expr $$RUNS - 1`; \
+ done
+
+$(NAME).sty: $(NAME).ins soul.dtx
+ tex $(NAME).ins
+
+$(NAME).ins:
+ latex $(NAME).dtx
+
diff --git a/Master/texmf-dist/source/latex/soul/soul.dtx b/Master/texmf-dist/source/latex/soul/soul.dtx
new file mode 100644
index 00000000000..064634cf111
--- /dev/null
+++ b/Master/texmf-dist/source/latex/soul/soul.dtx
@@ -0,0 +1,4520 @@
+% \iffalse
+%% File: soul.dtx Copyright (C) 1998--2003 Melchior FRANZ
+%% $Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel $
+%% $Version: 2.4 $
+%
+%<*batchfile>
+%
+% on Unix/Linux just run "make" to get the style file and the documentation,
+% else generate the driver soul.ins (if you don't already have it):
+%
+% $ latex soul.dtx
+%
+% You'll probably get an error message that you may ignore. Now generate
+% the style file:
+%
+% $ tex soul.ins
+%
+% And finally to produce the documentation run LaTeX three times:
+%
+% $ latex soul.dtx
+%
+%
+%
+%
+% DISCLAIMER: note that a Makefile could actually contain malign commands
+% that erase your whole account, so having a look at it before won't hurt!
+% I take no responsibility for any damage, but I do what I can to make
+% using the original Makefile safe.
+%
+% COPYRIGHT NOTICE:
+% This package is free software that can be redistributed and/or modified
+% under the terms of the LaTeX Project Public License as specified
+% in the file macros/latex/base/lppl.txt on any CTAN archive server,
+% such as ftp://ftp.dante.de/.
+%
+%$
+%% ====================================================================
+%% @LaTeX-package-file{
+%% author = "Melchior FRANZ",
+%% version = "2.4",
+%% date = "17 November 2003",
+%% filename = "soul.dtx",
+%% address = "Melchior FRANZ
+%% Rieder Hauptstrasse 52
+%% A-5212 SCHNEEGATTERN
+%% AUSTRIA",
+%% telephone = "++43 7746 3109",
+%% URL = "http://www.unet.univie.ac.at/~a8603365/",
+%% email = "a8603365@unet.univie.ac.at",
+%% codetable = "ISO/ASCII",
+%% keywords = "spacing out, letterspacing, underlining, striking out,
+%% highlighting",
+%% supported = "yes",
+%% docstring = "This article describes the `soul' package, which
+%% provides hyphenatable letterspacing (spacing out),
+%% underlining, and some derivatives.
+%% All features are based upon a common mechanism
+%% that allows to typeset text syllable by syllable,
+%% where the excellent TeX hyphenation algorithm is
+%% used to find the proper hyphenation points.
+%% Two examples show how to use the provided interface to
+%% implement things such as `an-a-lyz-ing syl-la-bles'.
+%% Although the package is optimized for LaTeX2e,
+%% it works with Plain TeX and with other
+%% packages, too.",
+%% }
+%% ====================================================================
+%
+%
+%
+%
+%
+\begin{filecontents}{soul.ins}
+\def\batchfile{soul.ins}
+\input docstrip.tex
+\askforoverwritefalse
+\keepsilent % <-- this is for you, Christina ;-)
+\generate{\file{soul.sty}{\from{soul.dtx}{package}}}
+\endbatchfile
+\end{filecontents}
+%</batchfile>
+%
+%
+%
+%
+%
+%<*driver>
+\def\fileversion{2.4}
+\def\filedate{2003/11/17}
+%
+%
+%
+\documentclass{ltxdoc}
+%
+%
+%
+\makeatletter\let\SOUL@sethyphenchar\relax\makeatother
+\IfFileExists{soul.sty}{%
+ \usepackage{soul}[2002/01/10]
+ \expandafter\ifx\csname sloppyword\endcsname\relax % old version?
+ \def\sloppyword{\textbf{?? [obsolete soul version]}}
+ \fi
+ \let\SOULSTYfound\active
+}{%
+ \GenericWarning{soul.dtx}{%
+ Package file `soul.sty' couldn't be found. You should however find^^J^^A
+ a file `soul.ins' in the current directory. If you type "tex soul.ins"^^J^^A
+ on the command line, `soul.sty' will be generated. After that
+ run "latex soul.dtx" again and you won't see this message again.
+ }%
+}%
+%
+%
+%
+\ifx\makehyperref\SOULundefined
+ \newcommand*\texorpdfstring[2]{#1}
+\else ^^A for "make hyper"
+ \usepackage{hyperref}
+ \hypersetup{
+ bookmarksopen,
+ colorlinks,
+ pdftitle={The soul package},
+ pdfauthor={Melchior FRANZ},
+ pdfsubject={${}$Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel ${}$},
+ pdfkeywords={space out, letterspacing, underlining, overstriking, highlighting}
+ }
+ \usepackage[pdftex]{graphicx,color}
+\fi
+%
+%
+%
+%\RecordChanges
+%
+\begin{document}
+\setcounter{tocdepth}{2}
+\DocInput{soul.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%
+%
+%
+%
+%
+%
+% \CheckSum{2006}
+% \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 \~}
+%
+%
+%
+% \title{The \texttt{soul} package}
+%
+% \author{Melchior \caps{FRANZ}}
+%
+% \date{November 17, 2003}
+%
+%^^A=====================================================
+%
+%^^A These messy macros allow to typeset the `example' sections
+%^^A conveniently. You'd better ignore them. I do! :-)
+%
+% \makeatletter
+%
+% \def\squarebull{\rule[.2ex]{.8ex}{.8ex}}
+%
+% \newenvironment{examples}
+% {\parindent\z@\small\fontencoding{OT1}\selectfont}
+% {\rule{\hsize}{.4pt}}
+%
+% \def\soultest#1|{\bgroup\rule[.5ex]{\hsize}{.4pt}\par
+% \parbox[t]{.34\hsize}{\raggedright\textit{#1\unskip.}}%
+% \hspace{1.5em}$\vtop\bgroup\hb@xt@.4\hsize\bgroup
+% \llap{\squarebull\hspace{.4em}}\soulttest}
+%
+% {\catcode`\|=13\gdef\soulttest{%
+% \bgroup\def\do##1{\catcode`##1=12}\dospecials\ttfamily
+% \catcode`\|=13\unskip\def|{\hss\egroup\egroup\soultttest}}}
+%
+% \def\soultttest#1{\hbox{\vtop{\hsize.4\hsize\hbadness\@M
+% \leavevmode\llap{\squarebull\hspace{.4em}}#1\null}}%
+% \egroup$\hspace{1.5em}\parbox[t]{1mm}{\hyphenpenalty-\@M
+% \exhyphenpenalty-\@M\hbadness\@M\hfuzz\maxdimen
+% \strut\llap{\squarebull\hspace{.4em}}#1\null}%
+% \goodbreak\vspace{2ex}
+% \egroup}
+%
+% \newcommand*\DescribeOption[1]{\marginpar{\raggedleft\textsf{#1}\ignorespaces}}
+%
+%
+%^^A similar to the `description' environment
+%
+% \def\describemacro{^^A
+% \bgroup
+% \let\do\@makeother
+% \dospecials
+% \catcode`{=1
+% \catcode`}=2
+% \SOUL@@@descmacro
+% }
+%
+% \def\SOUL@@@descmacro#1{^^A
+% \texttt{#1}^^A
+% \DescribeMacro{#1}^^A
+% \expandafter\edef\expandafter\x\expandafter{\expandafter\@gobble#1}^^A
+% \expandafter\label{cmd:\x}^^A
+% \egroup
+% }
+%
+%
+% \def\SOUL@@@verbitem[#1: {^^A
+% \bgroup
+% \let\do\@makeother
+% \dospecials
+% \SOUL@@@verbscan{#1}^^A
+% }
+%
+% \def\SOUL@@@verbscan#1#2]{^^A
+% \egroup
+% \goodbreak
+% \def\@currentlabel{\S\,\the\SOUL@@@itemnr}^^A
+% \label{par:#1}^^A
+% \SOUL@@@item[\textbf{\@currentlabel\hskip.6em#1:}]\hfil\break
+% Example: \texttt{#2}\hfil\break^^A
+% \advance\SOUL@@@itemnr1
+% }
+%
+% \let\SOUL@@@item\item
+% \newcount\SOUL@@@itemnr
+%
+% \newenvironment{verblist}[1]{^^A
+% \SOUL@@@itemnr=#1
+% \list{}{^^A
+% \settowidth{\labelwidth}{\indent\indent}^^A
+% \leftmargin\labelwidth
+% \advance\leftmargin\labelsep
+% \def\makelabel##1{##1}^^A
+% \let\item\SOUL@@@verbitem
+% }^^A
+% }{^^A
+% \endlist
+% }
+%
+% \newenvironment{labeling}[1]{^^A
+% \list{}{^^A
+% \settowidth{\labelwidth}{\textbf{#1}}^^A
+% \leftmargin\labelwidth\advance\leftmargin\labelsep
+% \def\makelabel##1{\textbf{##1}\hfil}^^A
+% }^^A
+% }{^^A
+% \endlist
+% }
+%
+% \newenvironment{syntax}{^^A
+% \par\medskip\def\<##1>{$\langle$\syn{##1}$\rangle$}^^A
+% \indent\begin{tabular}{l}^^A
+% }{^^A
+% \end{tabular}^^A
+% \noindentafter\medbreak
+% }
+%
+%
+% \newenvironment{example}[1][.9\textwidth]
+% {\par\medskip\indent\begin{tabular}{p{#1}l}}
+% {\end{tabular}\noindentafter\medbreak}
+%
+% \newcommand*\noindentafter{^^A
+% \global\everypar{{\setbox\z@\lastbox}\everypar{}}}
+%
+% \newcommand*\errsquare{\leavevmode\vrule height.8em depth.2em width1em\relax}
+%
+%
+% \ifx\SOULSTYfound\active
+%^^A analyze syllables---described somewhere below
+%
+% \DeclareRobustCommand*\sy{^^A
+% \SOUL@setup
+% \def\SOUL@preamble{\lefthyphenmin0\righthyphenmin0}^^A
+% \def\SOUL@everysyllable{\the\SOUL@syllable}^^A
+% \def\SOUL@everyspace##1{##1\space}^^A
+% \def\SOUL@everyhyphen{^^A
+% \discretionary{^^A
+% \SOUL@setkern\SOUL@hyphkern
+% \SOUL@sethyphenchar
+% }{}{^^A
+% \hbox{\kern1pt$\cdot$}^^A
+% }^^A
+% }^^A
+% \def\SOUL@everyexhyphen##1{^^A
+% \SOUL@setkern\SOUL@hyphkern
+% \hbox{##1}^^A
+% \discretionary{}{}{^^A
+% \SOUL@setkern\SOUL@charkern
+% }^^A
+% }^^A
+% \SOUL@}
+%
+%^^A analyze the engine---described somewhere below, too
+%
+% \DeclareRobustCommand*\an{^^A
+% \def\SOUL@preamble{$^{^P}$}^^A
+% \def\SOUL@everyspace##1{##1\texttt{\char`\ }}^^A
+% \def\SOUL@postamble{$^{^E}$}^^A
+% \def\SOUL@everyhyphen{$^{^-}$}^^A
+% \def\SOUL@everyexhyphen##1{##1$^{^=}$}^^A
+% \def\SOUL@everysyllable{$^{^S}$}^^A
+% \def\SOUL@everytoken{\the\SOUL@token$^{^T}$}^^A
+% \def\SOUL@everylowerthan{$^{^L}$}^^A
+% \SOUL@}
+%
+%^^A magazine-like (truly awful) paragraphs
+%^^A If you know what you're doing, you can copy it to your personal `soul.cfg' file.
+%
+% \DeclareRobustCommand*\magstylepar{\SOUL@sosetup
+% \def\SOUL@preamble{^^A
+% \edef\SOUL@soletterskip{\z@\@plus\fontdimen2\font\@minus\z@}^^A
+% \edef\SOUL@soinnerskip{\the\fontdimen2\font
+% \@plus\the\fontdimen3\font\@minus\the\fontdimen4\font}^^A
+% \let\SOUL@soouterskip\SOUL@soinnerskip
+% \SOUL@sopreamble}^^A
+% \lefthyphenmin2\righthyphenmin2\SOUL@}
+%
+%\else
+%
+%^^A The package has not been found, so we're providing some dummies, just
+%^^A to avoid all these `Undefined command sequence' messages.
+%
+% \def\SOUL@@@X#1{\textbf{??}}%
+% \let\so\SOUL@@@X
+% \let\textso\SOUL@@@X
+% \let\caps\SOUL@@@X
+% \let\textcaps\SOUL@@@X
+% \let\ul\SOUL@@@X
+% \let\textul\SOUL@@@X
+% \let\st\SOUL@@@X
+% \let\textst\SOUL@@@X
+% \let\hl\SOUL@@@X
+% \let\texthl\SOUL@@@X
+% \let\sy\SOUL@@@X
+% \let\an\SOUL@@@X
+% \let\magstylepar\SOUL@@@X
+% \let\sloppyword\SOUL@@@X
+% \def\sodef#1#2#3#4{\let#1\relax\SOUL@@@X}%
+% \fi
+%
+% \newcommand*\xpath{^^A
+% \bgroup
+% \let\do\@makeother
+% \dospecials
+% \catcode`\{=1
+% \catcode`\}=2
+% \def\{{\char"7B}^^A
+% \def\}{\char"7D}^^A
+% \SOUL@@@code
+% }
+%
+% \newcommand*\SOUL@@@code[1]{\normalfont\texttt{#1}\egroup}
+%
+% \let\cs\xpath
+% \let\option\textsf
+% \def\package#1{{\normalfont\texttt{#1}}}
+% \let\program\texttt
+% \let\bibtitle\textit
+% \let\syn\textit
+%
+% \sodef\person{\scshape}{0.06em}{0.45em}{0.4em}
+% \sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}
+% \DeclareRobustCommand*\versal[1]{^^A
+% \MakeUppercase{\SOUL@@@versal{#1}}^^A
+% }
+%
+% \def\ConTeXt{Con\TeX t}
+% \def\CTAN{{\small\caps{CTAN}}}
+% \def\soul{\package{soul}}
+%
+% ^^A set some parameters as used in Plain TeX
+% \def\plainsetup{^^A
+% \pretolerance100
+% \tolerance200
+% \hbadness1000
+% \linepenalty10
+% \hyphenpenalty50
+% \exhyphenpenalty50
+% \doublehyphendemerits10000
+% \finalhyphendemerits5000
+% \adjdemerits10000
+% \hfuzz.1pt
+% \overfullrule5pt
+% }
+%
+% \def\FIXME#1{\message{<FIXME>}#1}
+%
+% \makeatother
+%
+%
+% \lefthyphenmin2
+% \righthyphenmin3
+% \hyphenation{Le-se-ty-po-gra-phie Ver-bin-dung fak-si-mi-le}
+%
+%
+%^^A=====================================================
+%
+%
+% \changes{v1.0}{1998/10/16}{Initial version}%
+%^^A due to an error in the documentation of v1.0, there's no v1.1 :-(
+% \changes{v1.1a}{1998/12/08}{fixed a bunch of bugs; `magstylepar command
+% banned; `caps introduced; `so and `caps recognize following spaces;
+% error message added; `so parameters are mandatory}
+%
+% \changes{v1.2}{1999/01/11}{fixed the newline bug; added the `\(>\) command}
+%
+% \changes{v1.3}{1999/05/15}{changed allowhyphen, preambles; added a paragraph
+% in the `features' section}
+%
+% \changes{v2.0}{2002/01/03}{(almost) complete rewrite}
+%
+% \changes{v2.1}{2002/01/10}{Happy (64th) birthday, Don!
+% ``The now-traditional fix for the
+% now-traditional brown-paper-bag major release.''
+% as Eric S. RAYMOND commented on his CML2.0.1 release. ;-)}
+%
+% \changes{v2.2}{2002/05/12}{fixed a couple of bugs; added support for
+% the Plain TeX color.sty wrapper}
+%
+% \changes{v2.3}{2002/05/29}{compatibility with cmbright/ccfonts}
+%
+% \changes{v2.4}{2003/11/17}{Fix the font bug. Fix a scanner bug.
+% Other bugfixes; change caps set handling; add footnote and
+% textsuperscript support}
+%
+%
+%
+%
+%
+% \maketitle
+%
+%
+%
+% \begin{abstract}
+% This article describes the \soul\ package^^A
+%^^A%%
+% \footnote{This file has version number \fileversion, last revised \filedate.},
+%^^A%%
+% which provides \so{hyphenatable letterspacing (spacing out),} \ul{underlining}
+% and some derivatives such as \st{overstriking} and highlighting.
+% Although the package is optimized for \LaTeXe, it also works with
+% Plain \TeX\ and with other flavors of \TeX\ like, for instance, \ConTeXt.
+% By the way, the package name |soul| is only a combination
+% of the two macro names \cs{\so} (space out) and \cs{\ul}
+% (underline)---nothing poetic at all.^^A :-(
+% \end{abstract}
+%
+%
+% {\setlength\parskip{0pt}\tableofcontents }
+% \addtocontents{toc}{\protect\begin{multicols}{2}}
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{Typesetting rules}
+% \label{sec:typesetting}
+%
+% There are several possibilities to emphasize parts of a paragraph,
+% not all of which are considered good style. While underlining
+% is commonly rejected, experts dispute about whether letterspacing
+% should be used or not, and in which cases. If you are not interested
+% in such debates, you may well skip to the next section.
+%
+%
+% \subsection*{Theory \dots}
+% \label{sec:theory}
+%
+% To understand the experts' arguments we have to know about the
+% conception of \emph{page grayness.} The sum of all characters on
+% a page represents a certain amount of grayness, provided that
+% the letters are printed black onto white paper.
+%
+% \person{Jan Tschichold} \cite{Tschichold}, a well known and recognized
+% typographer, accepts only forms of emphasizing, which do not disturb this
+% grayness. This is only true of italic shape, caps, and
+% caps-and-small-caps fonts, but not of ordinary letterspacing, underlining,
+% bold face type and so on, all of which appear as either dark or light
+% spots in the text area. In his opinion emphasized text shall not catch the eye when
+% running over the text, but rather when actually reading the respective words.
+%
+% Other, less restrictive typographers \cite{Willberg} call this kind of emphasizing
+% `integrated' or `aesthetic', while they describe `active' emphasizing apart from it,
+% which actually \emph{has} to catch the reader's eye. To the latter group belong commonly
+% despised things like letterspacing, demibold face type and even underlined and colored text.
+%
+% On the other hand, \person{Tschichold} suggests
+% to space out caps and caps-and-small-caps fonts on title pages, headings and running headers from
+% 1\,pt up to 2\,pt.
+% Even in running text legibility of uppercase letters should be improved with slight
+% letterspacing, since (the Roman) majuscules don't look right, if they are spaced
+% like (the Carolingian) minuscules.\footnote{This suggestion is followed throughout this article,
+% although Prof.~\person{Knuth} already considered slight letterspacing with his |cmcsc| fonts.}
+%
+%
+%
+%\subsection*{\dots\ and Practice}
+%
+% However, in the last centuries letterspacing was excessively used,
+% underlining at least sometimes, because capitals and italic shape could
+% not be used together with the \emph{Fraktur} font and other black-letter fonts,
+% which are sometimes also called ``old German'' fonts.
+% This tradition is widely continued until today. The same limitations apply still today
+% to many languages with non-latin glyphs, which is why letterspacing has a strong
+% tradition in eastern countries where Cyrillic fonts are used.
+%
+% The \person{Duden} \cite{Duden}, a well known German dictionary, explains how to space out properly:
+% \emph{Punctuation marks are spaced out like letters, except quotation marks and periods.
+% Numbers are never spaced out. The German syllable \mbox{\emph{-sche}} is not spaced
+% out in cases like \emph{``der {\so{Virchow{sche}}} Versuch''}\footnote{the \person{Virchow} experiment}.
+% In the old German \emph{Fraktur} fonts the ligatures \emph{|ch|, |ck|, |sz|~(\ss)} and~\emph{|tz|} are
+% not broken within spaced out text.}
+%
+% While some books follow all these rules \cite{Muszynski}, others don't
+% \cite{Reglement}. In fact, most books in my personal library do \emph{not} space out commas.
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{Short introduction and common rules}
+%
+% The \soul\ package provides five commands that are aimed at emphasizing
+% text parts. Each of the commands takes one argument that can either be
+% the text itself or the name of a macro that contains text (e.\,g.~|\so\text|)^^A
+% ^^A
+% \footnote{See~\ref{par:Unexpandable material in command sequences} for
+% some additional information about the latter mode.}^^A
+% ^^A
+% .
+% See table~\ref{tab:survey} for a complete command survey.
+%
+% {\catcode`\|=12
+% \begin{center}
+% \begin{tabular}{r@{\hspace{1.5em}}l}
+% \verb+\so{letterspacing}+&\so{letterspacing}\\
+% \verb+\caps{CAPITALS, Small Capitals}+&\caps{CAPITALS, Small Capitals}\\
+% \verb+\ul{underlining}+&\ul{underlining}\\
+% \verb+\st{overstriking}+&\st{overstriking}\\
+% \verb+\hl{highlighting}+&highlighting\footnotemark\\
+% \end{tabular}
+% \end{center}
+% \footnotetext{The look of highlighting is nowhere demonstrated
+% in this documentation, because it requires a Postscript aware
+% output driver and would come out as ugly black bars on other
+% devices, looking very much like censoring bars. Think of it as
+% the effect of one of those coloring text markers.}
+% }
+%
+% \noindent
+% The \cs{\hl} command does only highlight if the \package{color} package
+% was loaded, otherwise it falls back to underlining.\footnote{Note that
+% you can also use \LaTeX's \package{color} package with Plain \TeX.
+% See~\ref{sec:plain} for details.} The highlighting
+% color is by default yellow, underlines and overstriking lines are by
+% default black. The colors can be changed using the following commands:
+%
+% {\catcode`\|=12
+% \begin{center}
+% \begin{tabular}{r@{\hspace{1.5em}}l}
+% \verb+\setulcolor{red}+&set underlining color\\
+% \verb+\setstcolor{green}+&set overstriking color\\
+% \verb+\sethlcolor{blue}+&set highlighting color\\
+% \end{tabular}
+% \end{center}
+% }
+%
+% \noindent
+% |\setulcolor{}| and |\setstcolor{}| turn coloring off.
+% There are only few colors predefined by the \package{color}
+% package, but you can easily add custom color definitions.
+% See the \package{color} package documentation~\cite{color} for further
+% information.
+%
+% \begin{example}
+% |\usepackage{color,soul}|\\
+% |\definecolor{lightblue}{rgb}{.90,.95,1}|\\
+% |\sethlcolor{lightblue}|\\
+% |...|\\
+% |\hl{this is highlighted in light blue color}|\\
+% \end{example}
+%
+%
+%
+%
+%
+%
+%
+% \subsection[Some things work]{Some things work \dots}
+%
+% The following examples may look boring and redundant, because they describe
+% nothing else than common \LaTeX\ notation with a few exceptions, but this is
+% only the half story: The \soul\ package has to pre-process the argument
+% before it can split it into characters and syllables, and all described
+% constructs are only allowed because the package explicitly implements them.
+%
+% \begin{verblist}{1}
+% \item[Accents: \so{na\"\i ve}]
+% Accents can be used naturally.
+% Support for the following accents is built-in: |\`|, |\'|, |\^|, |\"|, |\~|,
+% |\=|, |\.|, |\u|, |\v|, |\H|, |\t|, |\c|, |\d|, |\b|, and |\r|. Additionally,
+% if the \package{german} package \cite{german} is loaded you can also use the |"|
+% accent command and write |\so{na"ive}|. See section~\ref{sec:soulaccent} for how to add
+% further accents.
+% \item[Quotes: \so{``quotes''}]
+% The \soul\ package recognizes the quotes ligatures |``|, |''| and |,,|.
+% The Spanish ligatures |!`| and |?`| are not recognized and have, thus,
+% to be written enclosed in braces like in |\caps{{!`}Hola!}|.
+% \item[Mathematics: \so{foo$x^3$bar}]
+% Mathematic formulas are allowed, as long as they are
+% surrounded by~\texttt\$. Note that the \LaTeX\
+% equivalent |\(...\)| does not work.
+% \item[Hyphens and dashes: \so{re-sent}]
+% Explicit hyphens as well as en-dashes~(|--|), em-dashes~(|---|)
+% and the |\slash| command work as usual.
+% \item[Newlines: \so{new\\line}]
+% The |\\|~command fills the current line with white space
+% and starts a new line. Spaces or linebreaks afterwards are ignored.
+% Unlike the original \LaTeX\ command \soul's version does not handle
+% optional parameters like in |\\*[1ex]|.
+% \item[Breaking lines: \so{foo\linebreak bar}]
+% The \cs{\linebreak} command breaks the line without
+% filling it with white space at the end. \soul's version
+% does not handle optional parameters like in |\linebreak[1]|.
+% \cs{\break} can be used as a synonym.
+% \item[Unbreakable spaces: \so{don't~break}]
+% The |~|~command sets an unbreakable space.
+% \item[Grouping: \so{Virchow{sche}}]
+% A pair of braces can be used to let a group of characters
+% be seen as one entity, so that \soul\ does
+% for instance not space it out. The contents must, however,
+% not contain potential hyphenation points. (See~\ref{par:Protecting})
+% \item[Protecting: \so{foo \mbox{little} bar}]
+% An \cs{\mbox} also lets \soul\ see the contents as one
+% item, but these may even contain hyphenation points. \cs{\hbox} can
+% be used as a synonym.
+% \item[Omitting: \so{\soulomit{foo}}]
+% The contents of \cs{\soulomit} bypass the soul core and are typeset
+% as is, without being letterspaced or underlined. Hyphenation points are
+% allowed within the argument. The current font remains active, but can be
+% overridden with \cs{\normalfont} etc.
+% \item[Font switching commands: \so{foo \texttt{bar}}]
+% All standard \TeX\ and \LaTeX\ font switching commands are allowed, as
+% well as the \package{yfonts} package \cite{yfonts} font commands like \cs{\textfrak} etc.
+% Further commands have to be registered using the \cs{\soulregister}
+% command (see section~\ref{sec:soulregister}).
+% \item[Breaking up ligatures: \ul{Auf{}lage}]
+% Use |{}| or \cs{\null} to break up ligatures like `fl' in \cs{\ul}, \cs{\st} and \cs{\hl}
+% arguments.
+% This doesn't make sense for \cs{\so} and \cs{\caps}, though, because they break up
+% every unprotected (ungrouped\slash unboxed) ligature, anyway, and would
+% then just add undesirable extra space around the additional item.
+% \end{verblist}
+%
+%
+%
+%
+% \subsection{\texorpdfstring{\dots\ }{... }others don't}
+%
+% Although the new \soul\ is much more robust and forgiving than
+% versions prior to~2.0, there are
+% still some things that are not allowed in arguments.
+% This is due to the complex engine, which has to read and inspect every
+% character before it can hand it over to \TeX's paragraph builder.
+%
+% \begin{verblist}{20}
+% \item[Grouping hyphenatable material: \so{foo {little} bar}]
+% Grouped characters must not contain hyphenation points. Instead of
+% |\so{foo {little}}| write |\so{foo \mbox{little}}|. You get a
+% \texttt{`Re\-con\-struction failed'} error and a black square like
+% \errsquare\ in the \caps{DVI} file where you violated this rule.
+% \item[Discretionary hyphens: \so{Zu\discretionary{k-}{}{c}ker}]
+% The argument must not contain discretionary hyphens. Thus, you have to
+% handle cases like the German word |Zu\discretionary{k-}{}{c}ker| by yourself.
+% \item[Nested soul commands: \ul{foo \so{bar} baz}]
+% \soul\ commands must not be nested. If you really
+% need such, put the inner stuff in a box and use this box. It will, of
+% course, not get broken then.\\
+% \null\qquad|\newbox\anyboxname|\\
+% \null\qquad|\sbox\anyboxname{ \so{the worst} }|\\
+% \null\qquad|\ul{This is by far{\usebox\anyboxname}example!}|\\
+% yields:\\
+% \newbox\anyboxname
+% \sbox\anyboxname{ \so{the worst} }
+% \null\qquad\ul{This is by far{\usebox\anyboxname}example!}
+% \item[Leaking font switches: \def\foo{\bf bar} \so{\foo baz}]
+% A hidden font switching command that leaks into its neighborship
+% causes a \texttt{`Reconstruction failed'} error. To avoid this either
+% register the `container' (|\soulregister{\foo}{0}|), or limit its
+% scope as in |\def\foo{{\bf bar}}|. Note that both
+% solutions yield slightly different results.
+% \item[Material that needs expansion: \so{\romannumeral\year}]
+% In this example \cs{\so} would try to put space between \cs{\romannumeral}
+% and \cs{\year}, which can, of course, not work.
+% You have to expand the argument before you feed it to \soul, or even better:
+% Wrap the material up in a command sequence and let \soul\ expand it:
+% |\def\x{\romannumeral\year}| |\so\x|. \soul\ tries hard to expand
+% enough, yet not too much.
+% \item[Unexpandable material in command sequences: \def\foo{\bar} \so\foo]
+% Some macros might not be expandable in an \cs{\edef} definition^^A
+% \footnote{Try \texttt{\string\edef\string\x\char`\{\string\copyright\char`\}}.
+% Yet \texttt{\string\copyright} works in \soul\ arguments, because it is
+% explicitly taken care of by the package}
+% and have to be protected with \cs{\noexpand} in front. This is automatically done
+% for the following tokens: |~|, \cs{\,}, \cs{\TeX}, \cs{\LaTeX},
+% \cs{\S}, \cs{\slash}, \cs{\textregistered}, \cs{\textcircled}, and \cs{\copyright},
+% as well as for all registered fonts and accents. Instead of putting \cs{\noexpand}
+% manually in front of such commands, as in |\def\foo{foo {\noexpand\bar} bar}| |\so\foo|,
+% you can also register them as special (see section \ref{sec:soulregister}).
+% \item[Other weird stuff: \so{foo \verb|\bar| baz}]
+% \soul\ arguments must not contain \LaTeX\ environments, command definitions,
+% and fancy stuff like |\vadjust|. \soul's |\footnote| command replacement
+% does not support optional arguments. As long as you are writing simple,
+% ordinary `horizontal' material, you are on the safe side.
+% \end{verblist}
+%
+%
+%
+%
+%
+%
+%
+% \begin{table}
+% \begin{center}
+% \catcode`\|=12
+% \newcommand*\pref[1]{{\footnotesize\pageref{cmd:#1}}}
+% \newcommand*\Ast{\rlap{$^\ast$}}
+% \let\m\cs
+% \let\ti\textit
+% \begin{tabular}{r@{\hspace{.6em}}c@{\hspace{.6em}}l}
+% &\hbox to0pt{\hss\footnotesize page\hss}&\\[.5ex]
+% \verb+\so{letterspacing}+& \pref{so} &\so{letterspacing}\\
+% \verb+\caps{CAPITALS, Small Capitals}+& \pref{caps} &\caps{CAPITALS, Small Capitals}\\
+% \verb+\ul{underlining}+& \pref{ul} &\ul{underlining}\\
+% \verb+\st{striking out}+& \pref{st} &\st{striking out}\\
+% \verb+\hl{highlighting}+& \pref{hl} &highlighting\\
+% \\
+% \verb+\soulaccent{\cs}+& \pref{soulaccent} &\ti{add accent} \cs{\cs} \ti{to accent list}\\
+% \verb+\soulregister{\cs}{0}+& \pref{soulregister} &\ti{register command} \m{\cs}\\
+% \verb+\sloppyword{text}+& \pref{sloppyword} &\ti{typeset} \m{text} \ti{with stretchable spaces}\\
+% \\
+% \verb+\sodef\cs{1em}{2em}{3em}+& \pref{sodef} &\ti{define new spacing command} \m{\cs}\\
+% \verb+\resetso+& \pref{resetso} &\ti{reset} \m{\so} \ti{dimensions}\\
+% \verb+\capsdef{////}{1em}{2em}{3em}+\Ast& \pref{capsdef} &\ti{define (default)} \m{\caps} \ti{data entry}\\
+% \verb+\capssave{name}+\Ast& \pref{capssave} &\ti{save} \m{\caps} \ti{database under name} \rlap{\texttt{name}}\\
+% \verb+\capsselect{name}+\Ast& \pref{capssave} &\ti{restore} \m{\caps} \ti{database of name} \rlap{\texttt{name}}\\
+% \verb+\capsreset+\Ast& \pref{capsreset} &\ti{clear caps database}\\
+% \verb+\setul{1ex}{2ex}+& \pref{setul} &\ti{set} \m{\ul} \ti{dimensions}\\
+% \verb+\resetul+& \pref{resetul} &\ti{reset} \m{\ul} \ti{dimensions}\\
+% \verb+\setuldepth{y}+& \pref{setuldepth} &\ti{set underline depth to depth of an} y\\
+% \verb+\setuloverlap{1pt}+& \pref{setuloverlap} &\ti{set underline overlap width}\\
+% \verb+\setulcolor{red}+& \pref{setulcolor} &\ti{set underline color}\\
+% \verb+\setstcolor{green}+& \pref{setstcolor} &\ti{set overstriking color}\\
+% \verb+\sethlcolor{blue}+& \pref{sethlcolor} &\ti{set highlighting color}\\
+% \end{tabular}
+% \caption{List of all available commands. The number points to the
+% page where the command is described. Those marked
+% with a little asterisk are only available when the package
+% is used together with \LaTeX, because they rely on the
+% \emph{New Font Selection Scheme (NFSS)} used in \LaTeX.}
+% \label{tab:survey}
+% \end{center}
+% \end{table}
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Troubleshooting}
+%
+% Unfortunately, there's just one helpful error message provided by
+% the \soul\ package, that actually describes the underlying problem. All other
+% messages are generated directly by \TeX\ and show the low-level
+% commands that \TeX\ wasn't happy with. They'll hardly point you
+% to the violated rule as described in the paragraphs above.
+% If you get such a mysterious error message for a line that contains
+% a \soul\ statement, then comment that statement out and see if the message
+% still appears.
+% \texttt{`Incomplete }\cs{\ifcat}\texttt{'} is such a non-obvious message.
+% If the message doesn't appear now, then check the argument for
+% violations of the rules as listed in~\S\S\,20--26.
+%
+%
+%
+% \subsubsection{\texttt{`Reconstruction failed'}}
+%
+% This message appears, if \ref{par:Grouping hyphenatable material} or
+% \ref{par:Leaking font switches} was
+% violated. It is caused by the fact that the reconstruction pass
+% couldn't collect tokens with an overall width of the syllable that
+% was measured by the analyzer. This does either occur when you
+% grouped hyphenatable text or used an unregistered command
+% that influences the syllable width. Font switching commands belong
+% to the latter group. See the above cited sections for how to fix
+% these problems.
+%
+%
+%
+% \subsubsection{Missing characters}
+%
+% If you have redefined the internal font as described in section \ref{sec:internalfont},
+% you may notice that some characters are omitted without any error message
+% being shown. This happens if you have chosen, let's say, a font with
+% only 128~characters like the |cmtt10| font, but are using characters
+% that aren't represented in this font, e.\,g.~characters with codes
+% greater than~127.
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{\texorpdfstring{\so{Letterspacing}}{Letterspacing}}
+%
+% \subsection{How it works}
+% \label{sec:so}
+%
+% The base macro for letterspacing is called \describemacro{\so}.
+% It typesets the given argument with \syn{inter-letter space}
+% between every two characters, \syn{inner space} between words
+% and \syn{outer space} before and after the spaced out text.
+% If we let ``$\cdot$'' stand for \syn{inter-letter space}, ``$\ast$''
+% for \syn{inner spaces} and ``$\bullet$'' for \syn{outer
+% spaces,} then the input on the left side of the following table
+% will yield the schematic output on the right side:
+%
+% \begin{center}
+% \def\.{$\cdot$}
+% \def\-{\kern1pt$\ast$\kern1pt}
+% \def\*{$\bullet$}
+% \def\_{\texttt{\char"20}}
+% \begin{tabular}{ccc}
+% 1.& \verb*|XX\so{aaa bbb ccc}YY|& \textsf{XXa\.a\.a\-b\.b\.b\-c\.c\.cYY}\\
+% 2.& \verb*|XX \so{aaa bbb ccc} YY|& \textsf{XX\*a\.a\.a\-b\.b\.b\-c\.c\.c\*\kern-1ptYY}\\
+% 3.& \verb*|XX {\so{aaa bbb ccc}} YY|& \textsf{XX\*a\.a\.a\-b\.b\.b\-c\.c\.c\*\kern-1ptYY}\\
+% 4.& \verb*|XX \null{\so{aaa bbb ccc}}{} YY|& \textsf{XX\_a\.a\.a\-b\.b\.b\-c\.c\.c\_YY}\\
+% \end{tabular}
+% \end{center}
+% ^^A* % fool vim (fixes syntax highlighting)
+%
+% \noindent
+% Case~1 shows how letterspacing macros (\cs{\so} and \cs{\caps}) behave if
+% they aren't following or followed by a space: they omit outer space around
+% the \soul\ statement. Case~2 is what you'll mostly need---letterspaced
+% text amidst running text. Following and leading space get replaced by
+% \syn{outer space}. It doesn't matter if there are opening braces before
+% or closing braces afterwards. \soul\ can see through both of them (case~3).
+% Note that leading space has to be at least |5sp| wide to be recognized as
+% space, because \LaTeX\ uses tiny spaces generated by |\hskip1sp| as marker.
+% Case~4 shows how to enforce normal spaces instead of \syn{outer spaces:}
+% Preceding space can be hidden by |\kern0pt| or \cs{\null} or any character.
+% Following space can also be hidden by any token, but note that a typical macro name
+% like \cs{\relax} or \cs{\null} would also hide the space thereafter.
+%
+%
+% The values are predefined for typesetting facsimiles mainly with
+% \emph{Fraktur} fonts.
+% You can define your own spacing
+% macros or overwrite the original \cs{\so} meaning using the macro
+% \describemacro{\sodef}:
+%
+% \begin{syntax}
+% |\sodef|\<cmd>|{|\<font>|}{|\<inter-letter space>|}{|\<inner space>|}{|\<outer space>|}|
+% \end{syntax}
+%
+% The space dimensions, all of which are mandatory, should be defined in terms of |em|
+% letting them grow and shrink with the respective fonts.
+%
+% \begin{example}
+% |\sodef\an{}{.4em}{1em plus1em}{2em plus.1em minus.1em}|
+% \end{example}
+%
+% After that you can type `|\an{example}|' to get
+% {\sodef\an{}{.4em}{1em plus1em}{2em plus.1em minus.1em}^^A
+% `\an{example}'.}
+% The \describemacro{\resetso} command resets \cs{\so}
+% to the default values.
+%
+%
+%
+%
+% \subsection{Some examples}
+%
+%^^A=====================================================
+% \begin{examples}
+%
+% \soultest{Ordinary text}
+% |\so{electrical industry}|
+% {\so{electrical industry}}
+%
+% \soultest{Use \texttt{\string\-} to mark hyphenation points}
+% |\so{man\-u\-script}|
+% {\so{man\-u\-script}}
+%
+% \soultest{Accents are recognized}
+% |\so{le th\'e\^atre}|
+% {\so{le th\'e\^atre}}
+%
+% \soultest{\texttt{\string\mbox} and \texttt{\string\hbox} protect material that
+% contains hyphenation points. The contents are treated as one, unbreakable entity}
+% |\so{just an \mbox{example}}|
+% {\so{just an \mbox{example}}}
+%
+% \soultest{Punctuation marks are spaced out, if they are
+% put into the group}
+% |\so{inside.} \& \so{outside}.|
+% {\so{inside.} \& \so{outside}.}
+%
+% \soultest{Space-out skips may be removed by typing \texttt{\string\<}.
+% It's, however, desirable to put the quotation marks out of
+% the argument}
+% |\so{``\<Pennsylvania\<''}|
+% {\so{``\<Pennsylvania\<''}}
+%
+% \soultest{Numbers should never be spaced out}
+% |\so{1\<3 December {1995}}|
+% {\so{1\<3 December {1995}}}
+%
+% \soultest{Explicit hyphens like |-|, |--| and |---| are recognized.
+% \texttt{\string\slash} outputs a slash and enables \TeX\ to break the line
+% afterwards}
+% |\so{input\slash output}|
+% {\so{input\slash output}}
+%
+% \soultest{To keep \TeX\ from breaking lines between the hyphen and `jet'
+% you have to protect the hyphen. This is no \soul\ restriction
+% but normal \TeX\ behavior}
+% |\so{\dots and \mbox{-}jet}|
+% {\so{\dots and \mbox{-}jet}}
+%
+% \soultest{The \texttt{\~} command inhibits line breaks}
+% |\so{unbreakable~space}|
+% {\so{unbreakable~space}}
+%
+% \soultest{\texttt{\string\\} works as usual. Additional arguments
+% like \texttt{*} or vertical space are not accepted, though}
+% |\so{broken\\line}|
+% {\so{broken\\line}}
+%
+% \soultest{\texttt{\string\break} breaks the line without filling it with white space}
+% |\so{pretty awful\break test}|
+% {\so{pretty awful\break test}}
+%
+% \end{examples}
+%^^A=====================================================
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \subsection[Typesetting \texorpdfstring{\caps{caps-and-small-caps}}{caps-and-small-caps} fonts]
+% {Typesetting capitals-and-small-capitals fonts}
+%
+% There is a special letterspacing command called \describemacro{\caps},
+% which differs from \cs{\so} in that it switches to caps-and-small-caps
+% font shape, defines only slight spacing and is able to select spacing
+% value sets from a database. This is a requirement for high-quality
+% typesetting \cite{Tschichold}. The following lines show the effect
+% of \cs{\caps} in comparison with the normal textfont and with
+% small-capitals shape:
+%
+% \def\sampletext{DONAUDAMPFSCHIFFAHRTSGESELLSCHAFT}
+% \medskip\noindent
+% \begin{tabular}{rl}
+% |\normalfont|&\sampletext\\
+% |\scshape|&{\scshape\sampletext}\\
+% |\caps|&\caps\sampletext\\
+% ^^A|\person|&\person\sampletext\\
+% \end{tabular}
+%
+% \medbreak\noindent
+% The \cs{\caps} font database is by default empty, i.\,e., it contains
+% just a single default entry, which yields the result as shown in the
+% example above.
+% New font entries may be added \emph{on top} of this list using the \describemacro{\capsdef}
+% command, which takes five arguments: The first argument describes the font with
+% \emph{encoding, family, series, shape,} and \emph{size,}^^A
+% \footnote{as defined by the \caps{NFSS}, the ``New Font Selection Scheme''}
+% each optionally
+% (e.\,g.~|OT1/cmr/m/n/10| for this very font, or only |/ppl///12| for all
+% \emph{palatino} fonts at size 12\,pt). The \emph{size} entry may also contain
+% a size range (\texttt{5-10}), where zero is assumed for an omitted lower
+% boundary (\texttt{-10}) and a very, very big number for an omitted upper
+% boundary (\texttt{5-}). The
+% upper boundary is not included in the range, so, in the example below, all
+% fonts with sizes greater or equal 5\,pt and smaller than 15\,pt are accepted
+% ($5\,\mbox{pt}\le size<15\,\mbox{pt}$).
+% The second argument may contain font switching commands such as \cs{\scshape},
+% it may as well be empty or contain debugging commands (e.\,g.~|\message{*}|).
+% The remaining three, mandatory arguments are the spaces as described in
+% section~\ref{sec:so}.
+%
+% \begin{example}
+% |\capsdef{T1/ppl/m/n/5-15}{\scshape}{.16em}{.4em}{.2em}|
+% \end{example}
+%
+% The \cs{\caps} command goes through the data list from top to bottom
+% and picks up the first matching set, so the order of definition is essential.
+% The last added entry is examined first, while the pre-defined default entry
+% will be examined last and will match any font, if no entry was taken before.
+%
+% To override the default values, just define a new default entry using
+% the identifier |{////}|. This entry should be defined first, because no
+% entry after it can be reached.
+%
+% The \cs{\caps} database can be cleared with the \describemacro{\capsreset}
+% command and will only contain the default entry thereafter. The
+% \describemacro{\capssave} command saves the whole current database
+% under the given name. \describemacro{\capsselect} restores such a database.
+% This allows to predefine different groups of \cs{\caps} data sets:
+%
+% \begin{example}
+% |\capsreset|\\
+% |\capsdef{/cmss///12}{}{12pt}{23pt}{34pt}|\\
+% |\capsdef{/cmss///}{}{1em}{2em}{3em}|\\
+% |...|\\
+% |\capssave{wide}|\\
+% \end{example}
+% \indent
+% \begin{example}
+% |%---------------------------------------|\\
+% |\capsreset|\\
+% |\capsdef{/cmss///}{}{.1em}{.2em}{.3em}|\\
+% |...|\\
+% |\capssave{narrow}|\\
+% \end{example}
+% \indent
+% \begin{example}
+% |%---------------------------------------|\\
+% |{\capsselect{wide}|\\
+% |\title{\caps{Yet Another Silly Example}}|\\
+% |}|\\
+% \end{example}
+%
+% See the `|example.cfg|' file for a detailed example.
+% If you have defined a bunch of sets for different fonts and sizes,
+% you may lose control over what fonts are used by the package. With the
+% package option \DescribeOption{capsdefault}\option{capsdefault} selected,
+% \cs{\caps} prints its argument underlined, if no set was specified for a
+% particular font and the default set had to be used.
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Typesetting Fraktur}
+% \label{sec:fraktur}
+%
+% Black letter fonts^^A
+%^^A%%
+% \footnote{See the great black letter fonts, which \person{Yannis Haralambous}
+% kindly provided, and the \package{oldgerm} and \package{yfonts} package~\cite{yfonts}
+% as their \LaTeX\ interfaces.}
+%^^A%%
+% deserve some additional considerations. As stated in section~\ref{sec:typesetting},
+% the ligatures |ch|, |ck|, |sz|~(\cs{\ss}), and~|tz| have to remain unbroken in spaced out
+% \emph{Fraktur} text. This may look strange at first glance, but you'll get used to it:
+%
+% \begin{example}
+% |\textfrak{\so{S{ch}u{tz}vorri{ch}tung}}|
+% \end{example}
+%
+% You already know that grouping keeps the |soul| mechanism from separating such ligatures.
+% This is quite important for |s:|, |a*|, and~|"a|. As hyphenation is stronger than
+% grouping, especially the |sz| may cause an error, if hyphenation happens to occur between
+% the letters |s| and~|z|. (\TeX\ hyphenates the German word |auszer| wrongly like
+% |aus-zer| instead of like |au-szer|, because the German hyphenation patterns
+% do, for good reason, not see |sz| as `\cs{\ss}'.) In such cases you can protect tokens with the
+% sequence e.\,g.~|\mbox{sz}| or a properly defined command. The \cs{\ss} command,
+% which is defined by the \package{yfonts} package, and similar commands will suffice as well.
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Dirty tricks}
+% \label{sec:dirtytricks}
+%
+% Narrow columns are hard to set, because they don't allow much spacing
+% flexibility, hence long words often cause overfull boxes. A macro
+% could use \cs{\so} to insert stretchability between the single
+% characters. Table~\ref{tab:dirtytricks} shows some text typeset with such
+% a macro at the left side and under \emph{plain} conditions at
+% the right side, both with a width of~6\,pc.
+%
+% \def\sampletext{Some magazines and newspapers prefer this kind of spacing
+% because it reduces hyphenation problems to a minimum\<. Unfortunately\<, such
+% paragraphs aren't especially beautiful\<.}
+% \newbox\dirtytrick
+% \setbox\dirtytrick\vbox{
+% \batchmode ^^A we don't want to see all these overfull boxes ...
+% \leavevmode\hspace{0ptplus1fil}
+% \hbox{\parindent0pt\plainsetup\let\<\relax
+% \vtop{\hsize6pc\raggedright\sampletext}\hskip1em
+% \vtop{\hsize6pc\magstylepar\sampletext}\hskip1em
+% \vtop{\hsize6pc\sampletext}\hss}
+% \errorstopmode}
+%
+% \begin{table}
+% \begin{center}
+% \overfullrule5pt
+% \usebox\dirtytrick
+% \caption{Ragged-right, magazine style (using \soul), and block-aligned
+% in comparison. But, frankly, none of them is really acceptable.
+% (Don't do this at home, children!)}
+% \label{tab:dirtytricks}
+% \end{center}
+% \end{table}
+%
+%
+%
+%
+%
+%
+%
+% \section{\texorpdfstring{\ul{Underlining}}{Underlining}}
+%
+% The underlining macros are my answer to Prof.~\person{Knuth'{\normalfont s}}
+% exercise 18.26 from his \TeX{}book~\cite{DEK}. \texttt{:-)} Most of what
+% is said about the macro \describemacro{\ul} is also true of the
+% striking out macro \describemacro{\st} and the highlighting macro \describemacro{\hl},
+% both of which are in fact derived from the former.
+%
+%
+%
+%
+% \subsection{Settings}
+%
+% \subsubsection{Underline depth and thickness}
+%
+% The predefined \syn{underline depth} and \syn{thickness}
+% work well with most fonts. They can be changed using the macro \describemacro{\setul}.
+%
+% \begin{syntax}
+% |\setul{|\<underline depth>|}{|\<underline thickness>|}|
+% \end{syntax}
+%
+% Either dimension can be omitted, in which case there has to be
+% an empty pair of braces.
+% Both values should be defined in terms of |ex|, letting them
+% grow and shrink with the respective fonts.
+% The \describemacro{\resetul} command restores the standard values.
+%
+% Another way to set the \syn{underline depth} is to use the macro
+% \describemacro{\setuldepth}. It sets the depth such that the
+% underline's upper edge lies 1\,pt beneath the given argument's
+% deepest depth. If the argument is empty, all
+% letters---i.\,e.\ all characters whose \cs{\catcode} currently
+% equals 11---are taken. Examples:
+%
+% \begin{example}
+% |\setuldepth{ygp}|\\
+% |\setuldepth\strut|\\
+% |\setuldepth{}|\\
+% \end{example}
+%
+%
+%
+% \subsubsection{Line color}
+%
+% The underlines are by default black. The color can be changed by
+% using the \describemacro{\setulcolor} command. It takes one argument that can be any
+% of the color specifiers as described in the |color| package. This package
+% has to be loaded explicitly.
+%
+% \indent
+% \begin{example}
+% |\documentclass{article}|\\
+% |\usepackage{color,soul}|\\
+% |\definecolor{darkblue}{rgb}{0,0,0.5}|\\
+% |\setulcolor{darkblue}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |\begin{document}|\\
+% |...|\\
+% |\ul{Cave: remove all the underlines!}|\\
+% |...|\\
+% |\end{document}|\\
+% \end{example}
+%
+%
+% The colors for overstriking lines and highlighting are likewise set
+% with \describemacro{\setstcolor} (default: black) and \describemacro{\sethlcolor}
+% (default: yellow). If the \package{color} package wasn't loaded,
+% underlining and overstriking color are black, while highlighting
+% is replaced by underlining.
+%
+%
+%
+%
+%
+%
+%
+% \subsubsection{The \program{dvips} problem}
+% \label{sec:dvips}
+%
+% \ul{Underlining}, \st{striking out} and highlighting build up
+% their lines with many short line segments. If you used the `\program{dvips}'
+% program with default settings, you would get little gaps on some places, because
+% the \emph{maxdrift} parameter allows the single objects to drift
+% this many pixels from their real positions.
+% \bigbreak
+%
+% \noindent
+% There are two ways to avoid the problem, where the \soul\ package
+% chooses the second by default:
+% \begin{enumerate}
+% \item
+% Set the \emph{maxdrift} value to zero, e.\,g.: |dvips -e 0 file.dvi|.
+% This is probably not a good idea, since the letters may then no longer be
+% spaced equally on low resolution printers.
+% \item
+% Let the lines stick out by a certain amount on each side so that they
+% overlap. This overlap amount can be set using the \describemacro{\setuloverlap}
+% command. It is set to 0.25\,pt by default. |\setuloverlap{0pt}| turns overlapping off.
+% \end{enumerate}
+%
+%
+%
+%
+%
+%
+% \subsection{Some examples}
+%
+%^^A=====================================================
+% \begin{examples}
+%
+% \soultest{Ordinary text}
+% |\ul{electrical industry}|
+% {\ul{electrical industry}}
+%
+% \soultest{Use \texttt{\string\-} to mark hyphenation points}
+% |\ul{man\-u\-script}|
+% {\ul{man\-u\-script}}
+%
+% \soultest{Accents are recognized}
+% |\ul{le th\'e\^atre}|
+% {\ul{le th\'e\^atre}}
+%
+% \soultest{\texttt{\string\mbox} and \texttt{\string\hbox} protect material that
+% contains hyphenation points. The contents are treated as one, unbreakable entity}
+% |\ul{just an \mbox{example}}|
+% {\ul{just an \mbox{example}}}
+%
+% \soultest{Explicit hyphens like |-|, |--| and |---| are recognized.
+% \texttt{\string\slash} outputs a slash and enables \TeX\ to break the line
+% afterwards}
+% |\ul{input\slash output}|
+% {\ul{input\slash output}}
+%
+% \soultest{To keep \TeX\ from breaking lines between the hyphen and `jet'
+% you have to protect the hyphen. This is no \soul\ restriction
+% but normal \TeX\ behavior}
+% |\ul{\dots and \mbox{-}jet}|
+% {\ul{\dots and \mbox{-}jet}}
+%
+% \soultest{The \texttt{\~} command inhibits line breaks}
+% |\ul{unbreakable~space}|
+% {\ul{unbreakable~space}}
+%
+% \soultest{\texttt{\string\\} works as usual. Additional arguments
+% like \texttt{*} or vertical space are not accepted, though}
+% |\ul{broken\\line}|
+% {\ul{broken\\line}}
+%
+% \soultest{\texttt{\string\break} breaks the line without filling it with white space}
+% |\ul{pretty awful\break test}|
+% {\ul{pretty awful\break test}}
+%
+% \soultest{Italic correction needs to be set manually}
+% |\ul{foo \emph{bar\/} baz}|
+% {\ul{foo \emph{bar\/} baz}}
+%
+% \end{examples}
+%^^A=====================================================
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{Customization}
+%
+% \subsection{Adding accents}
+% \label{sec:soulaccent}
+%
+% The \soul\ scanner generally sees every input token separately.
+% It has to be taught that some tokens belong together. For accents this is done
+% by registering them via the \describemacro{\soulaccent} macro.
+%
+% \begin{syntax}
+% |\soulaccent{|\<accent command>|}|
+% \end{syntax}
+%
+% The standard accents, however, are already pre-registered:
+% |\`|, |\'|, |\^|, |\"|, |\~|, |\=|, |\.|, |\u|, |\v|, |\H|, |\t|,
+% |\c|, |\d|, |\b|, and |\r|. If used together with the \package{german}
+% package, \soul\ automatically adds the |"| command.
+% Let's assume you have defined |\%| to put some weird accent on
+% the next character. Simply put the following line into your |soul.cfg|
+% file (see section~\ref{sec:config}):
+%
+% \begin{example}
+% |\soulaccent{\%}|
+% \end{example}
+%
+% Note that active characters like the |"| command have already
+% to be \cs{\active} when they are stored or they won't be recognized
+% later. This can be done temporarily, as in |{\catcode\`"\active\soulaccent{"}}|.
+%
+%
+%
+%
+% \subsection{Adding font commands}
+% \label{sec:soulregister}
+%
+% To convince \soul\ not to feed font switching (or other)
+% commands to the analyzer, but rather to execute them immediately,
+% they have to be registered, too. The \describemacro{\soulregister} macro
+% takes the name of a command name and either |0| or |1| for the number
+% of arguments:
+%
+% \begin{syntax}
+% |\soulregister{|\<command name>|}{|\<number of arguments>|}|
+% \end{syntax}
+%
+% If \cs{\bf} and \cs{\emph} weren't already registered, you would
+% write the following into your |soul.cfg| configuration file:
+%
+% \begin{example}
+% |\soulregister{\bf}{0} % {\bf foo}| \\
+% |\soulregister{\emph}{1} % \emph{bar}|\\
+% \end{example}
+%
+%
+% All standard \TeX\ and \LaTeX\ font commands, as well as the
+% \package{yfonts} commands are already pre-registered:
+%
+% \begin{example}
+% |\em, \rm, \bf, \it, \tt, \sc, \sl, \sf, \emph, \textrm,|\\
+% |\textsf, \texttt, \textmd, \textbf, \textup, \textsl,|\\
+% |\textit, \textsc, \textnormal, \rmfamily, \sffamily,|\\
+% |\ttfamily, \mdseries, \upshape, \slshape, \itshape,|\\
+% |\scshape, \normalfont, \tiny, \scriptsize, \footnotesize,|\\
+% |\small, \normalsize, \large, \Large, \LARGE, \huge, \Huge,|\\
+% |\MakeUppercase, \textsuperscript, \footnote,|\\
+% |\textfrak, \textswab, \textgoth, \frakfamily,|\\
+% |\swabfamily, \gothfamily|\\
+% \end{example}
+%
+% You can also register other commands as fonts, so the
+% analyzer won't see them. This may be necessary for some
+% macros that \soul\ refuses to typeset correctly.
+% But note, that \cs{\so} and \cs{\caps} won't put their
+% letter-skips around then.
+%
+%
+%
+%
+%
+%
+% \subsection{Changing the internal font}
+% \label{sec:internalfont}
+%
+% The \soul\ package uses the |ectt1000| font while it analyzes
+% the syllables. This font is used, because it
+% has 256~mono-spaced characters without any kerning.
+% It belongs to \person{J\"org Knappen'\textrm{s}}
+% \caps{EC}-fonts, which should be part of every modern \TeX\ installation.
+% If \TeX\ reports ``\texttt{I can't find file `ectt1000'}'' you don't
+% seem to have this font installed. It is recommended that
+% you install at least the file |ectt1000.tfm| which has less than 1.4\,kB\null.
+% Alternatively, you can let the \soul\ package use the |cmtt10| font that
+% is part of any installation, or some other mono-spaced font:
+%
+% \begin{example}
+% |\font\SOUL@tt=cmtt10|
+% \end{example}
+%
+% Note, however, that \soul\ does only handle characters,
+% for which the internal font has a character with the same
+% character code. As |cmtt10| contains only characters with codes
+% 0 to~127, you can't typeset characters with codes 128 to~255.
+% These 8-bit character codes are used by many fonts with non-ascii
+% glyphs. So the |cmtt10| font will, for example, not work for |T2A|
+% encoded cyrillic characters.
+%
+%
+%
+%
+%
+%
+%
+% \subsection{The configuration file}
+% \label{sec:config}
+%
+% If you want to change the predefined settings or add new features,
+% then create a file named `|soul.cfg|' and put it in a directory, where \TeX\
+% can find it. This configuration file will then be loaded
+% at the end of the |soul.sty| file, so you may redefine
+% any settings or commands therein, select package options and even
+% introduce new ones. But if you intend to give
+% your documents to others, don't forget to give them the
+% required configuration files, too! That's how such a file
+% could look like:
+%
+% \indent
+% \begin{example}
+% |% define macros for logical markup|\\
+% |\sodef\person{\scshape}{0.125em}{0.4583em}{0.5833em}|\\
+% \\
+% |\sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}|\\
+% |\DeclareRobustCommand*\versal[1]{%|\\
+% | \MakeUppercase{\SOUL@@@versal{#1}}%|\\
+% |}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |% load the color package and set|\\
+% |% a different highlighting color|\\
+% |\RequirePackage{color}|\\
+% |\definecolor{lightblue}{rgb}{.90,.95,1}|\\
+% |\sethlcolor{lightblue}|\\
+% |\endinput|
+% \end{example}
+%
+% You can safely use the |\SOUL@@@| namespace for internal macros---it
+% won't be used by the \soul\ package in the future.
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{Miscellaneous}
+%
+% \subsection{Using \texorpdfstring{\soul\ }{soul }with other flavors of \texorpdfstring{\TeX}{TeX}}
+% \label{sec:plain}
+%
+% This documentation describes how to use \soul\ together
+% with \LaTeXe, for which it is optimized. It works, however, with
+% all other flavors of \TeX, too. There are just some minor restrictions
+% for Non-\LaTeX\ use:
+%
+% The \cs{\caps} command doesn't use a database, it is only a dumb
+% definition with fixed values. It switches to \cs{\capsfont}, which---unless
+% defined explicitly like in the following example---won't really change
+% the used font at all. The commands \cs{\capsreset} and \cs{\capssave}
+% do nothing.
+%
+% \begin{example}
+% |\font\capsfont=cmcsc10|\\
+% |\caps{Tschichold}|\\
+% \end{example}
+%
+% None of the commands are made `robust', so they have to be
+% explicitly protected in fragile environments like in \cs{\write}
+% statements.
+% To make use of colored underlines or highlighting you have to
+% use the \package{color} package wrapper from \caps{CTAN}^^A
+% \footnote{\texttt{CTAN:/macros/plain/graphics/\char`\{miniltx.tex,color.tex\char`\}}},
+% instead of the \package{color} package directly:
+%
+% \begin{example}
+% |\input color|\\
+% |\input soul.sty|\\
+% |\hl{highlighted}|\\
+% |\bye|\\
+% \end{example}
+%
+% The \option{capsdefault} package option is mapped to a simple command
+% \describemacro{\capsdefault}.
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Using \texorpdfstring{\soul\ }{soul }commands for logical markup}
+% \label{sec:markup}
+%
+% It's generally a bad idea to use font style commands like \cs{\textsc}
+% in running text. There should always be some reasoning behind changing
+% the style, such as ``names of persons shall be typeset in a caps-and-small-caps
+% font''. So you declare in your text just that some words are the name of a
+% person, while you define in the preamble or, even better, in a separate
+% style file how to deal with persons:
+%
+% \begin{example}
+% |\newcommand*\person{\textsc}|\\
+% |...|\\
+% |``I think it's a beautiful day to go to the zoo and feed|\\
+% |the ducks. To the lions.'' --~\person{Brian Kantor}|\\
+% \end{example}
+%
+% It's quite simple to use \soul\ commands that way:
+%
+% \begin{example}
+% |\newcommand\comment*{\ul} % or \let\comment=\ul|\\
+% |\sodef\person{\scshape}{0.125em}{0.4583em}{0.5833em}|\\
+% \end{example}
+%
+% Letterspacing commands like \cs{\so} and \cs{\caps} have to
+% check whether they are followed by white space, in which case
+% they replace that space by \syn{outer space}. Note that \soul\
+% does look through closing braces. Hence you can conveniently bury
+% a \soul\ command within another macro like in the following
+% example. Use any other token to hide following space if necessary,
+% for example the \cs{\null} macro.
+%
+% \begin{example}
+% |\DeclareRobustCommand*\versal[1]{%|\\
+% | \MakeUppercase{\SOUL@@@versal{#1}}%|\\
+% |}|\\
+% |\sodef\SOUL@@@versal{\upshape}{0.125em}{0.4583em}{0.5833em}|\\
+% \end{example}
+%
+%
+% But what if the \soul\ command is for some reason not the last one
+% in that macro definition and thus cannot look ahead at the following token?
+%
+%
+% \begin{example}
+% |\newcommand*\somsg[1]{\so{#1}\message{#1}}|\\
+% |...|\\
+% |foo \somsg{bar} baz % wrong spacing after `bar'!|\\
+% \end{example}
+%
+% In this case you won't get the following space replaced by \emph{outer space}
+% because when \soul\ tries to look ahead, it only sees the token
+% \cs{\message} and consequently decides that there is no space to replace.
+% You can get around this by explicitly calling the space scanner again.
+%
+% \begin{example}
+% |\newcommand*\somsg[1]{{%|\\
+% | \so{#1}%|\\
+% | \message{bar}%|\\
+% | \let\\\SOUL@socheck|\\
+% | \\%|\\
+% |}}|\\
+% \end{example}
+%
+% However, \cs{\SOUL@socheck} can't be used directly, because it would discard
+% any normal space. \cs{\\} doesn't have this problem.
+% The additional pair of braces avoids that its definition leaks out
+% of this macro. In the example above you could, of course, simply
+% have put \cs{\message} in front, so you hadn't needed to
+% use the scanner macro \cs{\SOUL@socheck} at all.
+%
+% Many packages do already offer logical markup commands that default
+% to some standard \LaTeX\ font commands or to \cs{\relax}. One example
+% is the \package{jurabib} package~\cite{jurabib}, which makes the use of
+% \soul\ a challenge. This package implements lots of
+% formatting macros. Let's have a look at one of them, \cs{\jbauthorfont},
+% which is used to typeset author names in citations.
+% The attempt to simply
+% define |\let\jbauthorfont\caps| fails, because the macro isn't directly
+% applied to the author name as in |\jbauthorfont{Don Knuth}|, but
+% to another command sequence: |\jbauthorfont{\jb@@author}|. Not even
+% \cs{\jb@@author} contains the name, but instead further commands that
+% at last yield the requested name. That's why we have to expand
+% the contents first. This is quite tricky, because we must not
+% expand too much, either. Fortunately, we can offer the contents
+% wrapped up in yet another macro, so that \soul\ knows that it has to
+% use its own macro expansion mechanism:
+%
+% \begin{example}
+% |\renewcommand*\jbauthorfont[1]{{%|\\
+% | \def\x{#1}%|\\
+% | \caps\x|\\
+% |}}|\\
+% \end{example}
+%
+% Some additional kerning after |\caps\x| wouldn't hurt, because
+% the look-ahead scanner is blinded by further commands that follow
+% in the \package{jurabib} package. Now we run into the next problem:
+% cited names may contain commands
+% that must not get expanded. We have to register them as special
+% command:
+%
+% \begin{example}
+% |\soulregister\jbbtasep{0}|\\
+% |...|\\
+% \end{example}
+%
+% But such registered commands bypass \soul's kernel and we don't
+% get the correct spacing before and afterwards. So we end up
+% redefining \cs{\jbbtasep}, whereby you should, of course, use
+% variables instead of numbers:
+%
+% \begin{example}
+% |\renewcommand*\jbbtasep{%|\\
+% | \kern.06em|\\
+% | \slash|\\
+% | \hskip.06em|\\
+% | \allowbreak|\\
+% |}|\\
+% \end{example}
+%
+% Another problem arises: bibliography entries that must not get
+% teared apart are supposed to be enclosed in additional braces.
+% This, however, won't work with \soul\ because of
+% \ref{par:Grouping hyphenatable material}. A simple trick will
+% get you around that problem: define a dummy command that only
+% outputs its argument, and register that command:
+%
+% \begin{example}
+% |\newcommand*\together[1]{#1}|\\
+% |\soulregister\together{1}|\\
+% \end{example}
+%
+% Now you can write ``|Author = {\together{Don Knuth}}|'' and
+% \package{jurabib} won't dare to reorder the parts of the name.
+% And what if some name shouldn't get letterspaced at all? Overriding
+% a conventional font style like \cs{\textbf} that was globally
+% set is trivial, you just have to specify the style that you
+% prefer in that very bibliography entry. In our example, if we
+% wanted to keep \soul\ from letterspacing a particular entry,
+% although they are all formatted by our \cs{\jbauthorfont}
+% and hence fed to \cs{\caps}, we'd use the following construction:
+%
+% \begin{example}
+% |Author = {\soulomit{\normalfont\huge Donald E. Knuth}}|\\
+% \end{example}
+%
+% The \package{jurabib} package is probably one of the more
+% demanding packages to collaborate with \soul. Everything else
+% can just become easier.
+%
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Typesetting long words in narrow columns}
+% \label{sec:sloppyword}
+%
+% Narrow columns are best set |flushleft|, because not even the best
+% hyphenation algorithm can guarantee acceptable line breaks without
+% overly stretched spaces.
+% However, in some rare cases one may be \emph{forced} to typeset
+% block aligned. When typesetting in languages like German, where
+% there are really long words, the \describemacro{\sloppyword} macro
+% might help a little bit. It adds enough stretchability between the
+% single characters to make the hyphenation algorithm happy, but
+% is still not as ugly as the example in section~\ref{sec:dirtytricks}
+% demonstrates. In the following example the left column was typeset
+% as ``|Die \sloppyword{Donau...novelle} wird ...|'':
+%
+% \begin{center}
+% \def\word{Do\-nau\-dampf\-schiff\-fahrts\-ge\-sell\-schafts\-^^A
+% ka\-pi\-t\"ans\-wit\-wen\-pen\-si\-ons\-ge\-setz\-no\-vel\-le}
+% \begin{minipage}{1.5in}
+% \plainsetup
+% Die
+% \expandafter\sloppyword\expandafter{\word}
+% wird mit sofortiger Wirkung au\ss er Kraft gesetzt.
+% \end{minipage}
+% \hspace{1em}
+% \batchmode
+% \begin{minipage}{1.5in}
+% \plainsetup
+% Die \word\ wird mit sofortiger Wirkung au\ss er Kraft gesetzt.
+% \end{minipage}
+% \errorstopmode
+% \end{center}
+%
+%
+%
+%
+%
+%
+%
+% \subsection{Using \texorpdfstring{\soul\ }{soul }commands in section headings}
+%
+% Letterspacing was often used for section titles in the past,
+% mostly centered and with a closing period. The following example
+% shows how to achieve this using the \package{titlesec}
+% package \cite{titlesec}:
+%
+% \begin{example}
+% |\newcommand*\periodafter[2]{#1{#2}.}|\\
+% |\titleformat{\section}[block]|\\
+% | {\normalfont\centering}|\\
+% | {\thesection.}|\\
+% | {.66em}|\\
+% | {\periodafter\so}|\\
+% |...|\\
+% |\section{Von den Maassen und Maassst\"aben}|\\
+% \end{example}
+%
+% \bigbreak
+% This yields the following output:
+%
+% \bigskip
+% \newbox\examplebox
+% \sbox\examplebox{
+% \begin{minipage}{.9\textwidth}
+% \small
+% \bigskip
+% \begin{center}
+% \so{1\<. Von den Maassen und Maassst\"aben}.
+% \bigskip
+% \end{center}
+% \end{minipage}}
+% \fbox{\usebox\examplebox}
+% \bigbreak
+%
+% \noindent
+% The \cs{\periodafter} macro adds a period to the title, but not to
+% the entry in the table of contents. It takes the name of a command as
+% argument, that shall be applied to the title, for example~\cs{\so}.
+% Here's a more complicated and complete example:
+%
+% \begin{example}
+% |\documentclass{article}|\\
+% |\usepackage[latin1]{inputenc}|\\
+% |\usepackage[T1]{fontenc}|\\
+% |\usepackage{german,soul}|\\
+% |\usepackage[indentfirst]{titlesec}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |\newcommand*\sectitle[1]{%|\\
+% | \MakeUppercase{\so{#1}.}\\[.66ex]|\\
+% | \rule{13mm}{.4pt}}|\\
+% |\newcommand*\periodafter[2]{#1{#2.}}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |\titleformat{\section}[display]|\\
+% | {\normalfont\centering}|\\
+% | {\S. \thesection.}|\\
+% | {2ex}|\\
+% | {\sectitle}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |\titleformat{\subsection}[block]|\\
+% | {\normalfont\centering\bfseries}|\\
+% | {\thesection.}|\\
+% | {.66em}|\\
+% | {\periodafter\relax}|\\
+% \end{example}
+%
+% \indent
+% \begin{example}
+% |\begin{document}|\\
+% |\section{Von den Maassen und Maassst\"aben}|\\
+% |\subsection{Das L\"angenmaass im Allgemeinen}|\\
+% \\
+% |Um L\"angen genau messen und vergleichen zu k\"onnen,|\\
+% |bedarf es einer gewissen, bestimmten Einheit, mit der|\\
+% |man untersucht, wie oft sie selbst, oder ihre Theile,|\\
+% |in der zu bestimmenden L\"ange enthalten sind.|\\
+% |...|\\
+% |\end{document}|
+% \end{example}
+%
+% \bigbreak
+% This example gives you roughly the following output,
+% which is a facsimile from~\cite{Muszynski}.
+%
+% \bigskip
+% \sbox\examplebox{
+% \begin{minipage}{.9\textwidth}
+% \small
+% \bigskip
+% \begin{center}
+% \S. 1.\\[2ex]
+% \so{VON DEN MAASSEN UND MAASSST\"ABEN}.\\[.66ex]
+% \rule{12mm}{.4pt}\\[1.66ex]
+% \textbf{1. Das L\"angenmaass im Allgemeinen.}\\[.66em]
+% \end{center}
+% \leavevmode\qquad
+% Um L\"angen genau messen und vergleichen zu k\"onnen,
+% bedarf es einer gewissen, bestimmten Einheit, mit der
+% man untersucht, wie oft sie selbst, oder ihre Theile,
+% in der zu bestimmenden L\"ange enthalten sind.
+% \bigskip
+% \end{minipage}}
+% \fbox{\usebox\examplebox}
+% \bigbreak
+%
+% \noindent
+% Note that the definition of \cs{\periodafter} decides if
+% the closing period shall be spaced out with the title (1), or
+% follow without space (2):
+%
+% \begin{example}
+% 1.\qquad|\newcommand*\periodafter[2]{#1{#2.}}|\\
+% 2.\qquad|\newcommand*\periodafter[2]{#1{#2}.}|\\
+% \end{example}
+%
+%
+%
+% \noindent
+% If you need to underline section titles, you can easily
+% do it with the help of the \package{titlesec} package. The following
+% example underlines the section title, but not the section
+% number:
+%
+% \begin{example}
+% |\titleformat{\section}|\\
+% | {\LARGE\titlefont}|\\
+% | {\thesection}|\\
+% | {.66em}|\\
+% | {\ul}|\\
+% \end{example}
+%
+% \noindent
+% The \cs{\titlefont} command is provided by the \caps{``\small{KOMA}}~script''
+% package. You can write |\normalfont\sffamily\bfseries| instead.
+% The following example does additionally underline the section number:
+%
+% \begin{example}
+% |\titleformat{\section}|\\
+% | {\LARGE\titlefont}|\\
+% | {\ul{\thesection{\kern.66em}}}|\\
+% | {0pt}|\\
+% | {\ul}|\\
+% \end{example}
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+%
+% \section{How the package works}
+%
+% \subsection{The kernel}
+% \so{Letterspacing,} \ul{underlining}, \st{striking out} and highlighting
+% use the same kernel. It lets a \emph{word scanner} run over the given argument,
+% which inspects every token. If a token is a command registered via \cs{\soulregister},
+% it is executed immediately. Other tokens are only counted and trigger some action
+% when a certain number is reached (quotes and dashes). Three subsequent `|-|', for example,
+% trigger |\SOUL@everyexhyphen{---}|. A third group leads to special actions,
+% like |\mbox| that starts reading-in a whole group to protect its contents and let them be
+% seen as one entity. All other tokens, mostly characters and digits, are collected in
+% a word register, which is passed to the analyzer, whenever a whole word was read in.
+%
+% The analyzer typesets the word in a 1\,sp ($=\frac1{65536}$\,pt) wide \cs{\vbox},
+% hence encouraging \TeX\ to break lines at every possible hyphenation point. It
+% uses the mono-spaced \cs{\SOUL@tt} font (|ectt1000|), so as to avoid any inter-character
+% kerning. Now the \cs{\vbox} is decomposed splitting off \cs{\hbox} after \cs{\hbox}
+% from the bottom. All boxes, each of which contains one syllable, are pushed onto a
+% stack, which is provided by \TeX's grouping mechanism. When returning from the
+% recursion, box after box is fetched from the stack, its width measured and fed to the
+%``reconstructor''.
+%
+% This reconstruction macro (\cs{\SOUL@dosyllable}) starts to read tokens
+% from the just analyzed word until the given syllable
+% width is obtained. This is repeated for each syllable. Every time the engine
+% reaches a relevant state, the corresponding driver macro is executed
+% and, if necessary, provided with some data. There is a macro that is
+% executed for each token, one for each syllable, one for each space etc\null.
+%
+% The engine itself doesn't know how to letterspace or to underline. It
+% just tells the selected driver about the structure of the given argument.
+% There's a default driver (\cs{\SOUL@setup}) that does only set the
+% interface macros to a reasonable default state, but doesn't really do anything.
+% Further drivers can safely inherit these settings and only need to
+% redefine what they want to change.
+%
+%
+%
+%
+%
+% \subsection{The interface}
+% \label{sec:interface}
+%
+% \subsubsection{The registers}
+%
+% The package offers eight interface macros that can be used to define
+% the required actions. Some of the macros receive data as macro parameter
+% or in special \emph{token} or \emph{dimen} registers. Here is a list of
+% all available registers:
+%
+% \begin{labeling}{\hspace{.36\hsize}}
+% \item[\texttt{\string\SOUL@token}]
+% This token register contains the current token. It has to be used as |\the\SOUL@token|.
+% The macro \cs{\SOUL@gettoken} reads the next token into \cs{\SOUL@token} and
+% can be used in any interface macro. If you don't want to lose the old meaning,
+% you have to save it explicitly. \cs{\SOUL@puttoken} pushes the token
+% back into the queue, without changing \cs{\SOUL@token}. You can only
+% put one token back, otherwise you get an error message.
+% \item[\texttt{\string\SOUL@lasttoken}]
+% This token register contains the last token.
+% \item[\texttt{\string\SOUL@syllable}]
+% This token register contains all tokens that were already collected for
+% the current syllable. When used in \cs{\SOUL@everysyllable}, it
+% contains the \emph{whole} syllable.
+% \item[\texttt{\string\SOUL@charkern}]
+% This dimen register contains the kerning value between the current and the next character.
+% Since most character pairs don't require a kerning value to be applied and the
+% output in the logfile shouldn't be cluttered with |\kern0pt| it is
+% recommended to write |\SOUL@setkern\SOUL@charkern|, which sets
+% kerning for non-zero values only.
+% \item[\texttt{\string\SOUL@hyphkern}]
+% This dimen register contains the kerning value between the current character
+% and the hyphen character or, when used in \cs{\SOUL@everyexhyphen}, the
+% kerning between the last character and the explicit hyphen.
+% \end{labeling}
+%
+%
+%
+%
+%
+%
+% \subsubsection{The interface macros}
+%
+% The following list describes each of the interface macros and which
+% registers it can rely on. The mark between label and description
+% will be used in section \ref{sec:interfaceexamples} to show when
+% the macros are executed. The addition |#1| means that the macro
+% takes one argument.
+%
+% \begin{labeling}{\hspace{.36\hsize}}
+% \def\m#1{\leavevmode\llap{\hbox to1em{\hss#1\hss}\hskip.7em}}
+% \item[\texttt{\string\SOUL@preamble}]\m{$P$}^^A
+% executed once at the beginning
+% \item[\texttt{\string\SOUL@postamble}]\m{$E$}^^A
+% executed once at the end
+% \item[\texttt{\string\SOUL@everytoken}]\m{$T$}^^A
+% executed after scanning a token; It gets that
+% token in \cs{\SOUL@token} and has to care for inserting
+% the kerning value \cs{\SOUL@charkern} between this and the next character.
+% To look at the next character, execute \cs{\SOUL@gettoken}, which
+% replaces \cs{\SOUL@token} by the next token. This token has to
+% be put back into the queue using \cs{\SOUL@puttoken}.
+% \item[\texttt{\string\SOUL@everysyllable}]\m{$S$}^^A
+% This macro is executed after scanning a whole syllable. It gets the
+% syllable in \cs{\SOUL@syllable}.
+% \item[\texttt{\string\SOUL@everyhyphen}]\m{$-$}^^A
+% This macro is executed at every implicit hyphenation point.
+% It is responsible for setting the hyphen and will likely do this
+% in a \cs{\discretionary} statement. It has to care about the
+% kerning values. The registers \cs{\SOUL@lasttoken}, \cs{\SOUL@syllable},
+% \cs{\SOUL@charkern} and \cs{\SOUL@hyphkern} contain useful information.
+% Note that \cs{\discretionary} inserts \cs{\exhyphenpenalty}
+% if the first part of the discretionary is empty, and
+% \cs{\hyphenpenalty} else.
+% \item[\texttt{\string\SOUL@everyexhyphen\#1}]\m{$=$}^^A
+% This macro is executed at every explicit hyphenation point. The
+% hyphen `character' (one of hyphen, en-dash, em-dash or \cs{\slash})
+% is passed as parameter |#1|. A minimal implementation
+% would be |{#1\penalty\exhyphenpenalty}|. The kerning value
+% between the last character and the hyphen is passed in \cs{\SOUL@hyphkern},
+% that between the hyphen and the next character in \cs{\SOUL@charkern}.
+% The last syllable can be found in \cs{\SOUL@syllable}, the last
+% character in \cs{\SOUL@lasttoken}.
+% \item[\texttt{\string\SOUL@everyspace\#1}]\m{\texttt{\char`\ }}^^A
+% This macro is executed between every two words. It is responsible for
+% setting the space. The engine submits a \cs{\penalty} setting as
+% parameter |#1| that should be put in front of the space. The
+% macro should at least do |{#1\space}|. Further information can be found in
+% \cs{\SOUL@lasttoken} and \cs{\SOUL@syllable}. Note that this macro does not
+% care for the leading and trailing space. This is the job of
+% \cs{\SOUL@preamble} and \cs{\SOUL@postamble}.
+% \end{labeling}
+%
+%
+%
+%
+%
+%
+% \subsubsection{Some examples}
+% \label{sec:interfaceexamples}
+%
+% The above list's middle column shows a mark that indicates in the
+% following examples, when the respective macros are executed:\nopagebreak
+%
+% \begin{labeling}{\hspace{.36\hsize}}
+% \item[\normalfont\an{word}]
+% \cs{\SOUL@everytoken}$^T$ is executed for every token. \cs{\SOUL@everysyllable}$^S$
+% is \emph{additionally} executed for every syllable. You will mostly just
+% want to use either of them.
+% \item[\normalfont\an{one two}]
+% The macro |\SOUL@everyspace| is executed at every space within
+% the \soul\ argument. It has to take one argument, that can either
+% be empty or contain a penalty, that should be applied to the space.
+% \item[\normalfont\an{example}\kern-1em]
+% The macro |\SOUL@everyhyphen| is executed at every possible
+% implicit hyphenation point.
+% \item[\normalfont\an{beta-test}]
+% Explicit hyphens trigger \cs{\SOUL@everyexhyphen}.
+% \end{labeling}
+%
+%
+%
+% \bigbreak
+% \noindent
+% It's only natural that these examples, too,
+% were automatically typeset by the |soul| package
+% using a special driver:
+%
+% \begin{example}
+% |\DeclareRobustCommand*\an{%|\\
+% | \def\SOUL@preamble{$^{^P}$}%|\\
+% | \def\SOUL@everyspace##1{##1\texttt{\char`\ }}%|\\
+% | \def\SOUL@postamble{$^{^E}$}%|\\
+% | \def\SOUL@everyhyphen{$^{^-}$}%|\\
+% | \def\SOUL@everyexhyphen##1{##1$^{^=}$}%|\\
+% | \def\SOUL@everysyllable{$^{^S}$}%|\\
+% | \def\SOUL@everytoken{\the\SOUL@token$^{^T}$}%|\\
+% | \def\SOUL@everylowerthan{$^{^L}$}%|\\
+% | \SOUL@}|\\
+% \end{example}
+%
+%
+%
+%
+%
+%
+%
+%
+% \subsection{A driver example}
+%
+% Let's define a \soul\ driver that allows to typeset text
+% with a \cs{\cdot} at every potential hyphenation point. The name of
+% the macro shall be \cs{\sy} (for \emph{syllables}).
+% Since the \soul\ mechanism is highly fragile, we use the \LaTeX\
+% command \cs{\DeclareRobustCommand}, so that the \cs{\sy} macro
+% can be used even in section headings etc. The \cs{\SOUL@setup}
+% macro sets all interface macros to reasonable default definitions.
+% This could of course be done manually, too. As we won't
+% make use of \cs{\SOUL@everytoken} and \cs{\SOUL@postamble}
+% and both default to \cs{\relax}, anyway, we don't have to
+% define them here.
+%
+% \begin{example}
+% |\DeclareRobustCommand*\sy{%|\\
+% | \SOUL@setup|\\
+% \end{example}
+%
+% We only set \cs{\lefthyphenmin} and \cs{\righthyphenmin} to zero
+% at the beginning. All changes are restored automatically,
+% so there's nothing to do at the end.
+%
+% \begin{example}
+% | \def\SOUL@preamble{\lefthyphenmin=0 \righthyphenmin=0 }%|\\
+% \end{example}
+%
+% We only want simple spaces. Note that these are not provided
+% by default! \cs{\SOUL@everyspace} may get a penalty to be
+% applied to that space, so we set it before.
+%
+% \begin{example}
+% | \def\SOUL@everyspace##1{##1\space}%|\\
+% \end{example}
+%
+% There's nothing to do for \cs{\SOUL@everytoken}, we rather let
+% \cs{\SOUL@everysyllable} handle a whole syllable at once.
+% This has the advantage, that we don't have to deal with
+% kerning values, because \TeX\ takes care of that.
+%
+% \begin{example}
+% | \def\SOUL@everysyllable{\the\SOUL@syllable}|\\
+% \end{example}
+%
+% The \TeX\ primitive \cs{\discretionary}
+% takes three arguments: 1.~pre-hyphen material
+% 2.~post-hyphen material, and 3.~no-hyphenation material.
+%
+% \begin{example}
+% | \def\SOUL@everyhyphen{%|\\
+% | \discretionary{%|\\
+% | \SOUL@setkern\SOUL@hyphkern|\\
+% | \SOUL@sethyphenchar|\\
+% | }{}{%|\\
+% | \hbox{\kern1pt$\cdot$}%|\\
+% | }%|\\
+% | }%|\\
+%\end{example}
+%
+% Explicit hyphens like dashes and slashes shall be set normally.
+% We just have to care for kerning. The hyphen has to be put in
+% a box, because, as \cs{\hyphenchar}, it would yield its own, internal
+% \cs{\discretionary}. We need to set ours instead, though.
+%
+% \begin{example}
+% | \def\SOUL@everyexhyphen##1{%|\\
+% | \SOUL@setkern\SOUL@hyphkern|\\
+% | \hbox{##1}%|\\
+% | \discretionary{}{}{%|\\
+% | \SOUL@setkern\SOUL@charkern|\\
+% | }%|\\
+% | }|%\\
+% \end{example}
+%
+% Now that the interface macros are defined, we can start the scanner.
+%
+% \begin{example}
+% | \SOUL@|\\
+% |}|\\
+% \end{example}
+%
+% \hyphenation{al-go-rithm lin-guists ex-cel-lent} ^^A correct?
+% \noindent
+% \emph{\sy{This little macro will hardly be good enough
+% for linguists, although it uses {\TeX's} excellent hyphenation algorithm,
+% but it is at least a nice alternative to the}} \cs{\showhyphens} \emph{\sy{command}.}
+%
+%
+%
+%
+%
+%
+%
+% \section*{Acknowledgements}
+%
+% A big thank you goes to \person{Stefan Ulrich} for his tips and bug reports
+% during the development of versions 1.\lower2pt\hbox{*} and for his lessons on high quality
+% typesetting. The \cs{\caps} mechanism was very much influenced by his
+% suggestions. Thanks to \person{Alexander Shibakov} and \person{Frank Mittelbach,}
+% who sent me a couple of bug reports and feature requests, and finally encouraged
+% me to (almost) completely rewrite \soul. \person{Thorsten Manegold} contributed
+% a series of bug reports, helping to fix \soul's macro expander and hence making
+% it work together with the \package{jurabib} package.
+% Thanks to \person{Axel Reichert, Anshuman Pandey,} and \person{Peter Kreynin} for
+% detailed bug reports.
+% \person{Rowland McDonnel} gave useful hints for how to improve the documentation,
+% but I'm afraid he will still not be satisfied, and rightfully so. If only documentation
+% writing weren't that boring.~~\texttt{;-)}
+%
+%
+%
+%
+%
+%
+%
+% \begin{thebibliography}{00}
+% \raggedright
+%
+% \bibitem{jurabib}{\person{Berger, Jens:} \bibtitle{The jurabib package.} \CTAN-Archive, 2002, v0.52h.}
+%
+% \bibitem{titlesec}{\person{Bezos, Javier:} \bibtitle{The titlesec and titletoc package.}
+% \CTAN-Archive, 1999, v2.1.}
+%
+% \bibitem{color}{\person{Carlisle, D. P.:} \bibtitle{The color package.} \CTAN-Archive, 1997, v1.0d.}
+%
+% \bibitem{Duden}{Duden, Volume 1. \bibtitle{Die Rechtschreibung.} Bibliographisches Institut,
+% Mann\-heim--\hskip0pt Wien--Z\"urich, 1986, 19th~edition.}
+%
+% \bibitem{DEK}{\person{Knuth, Donald E.:} \bibtitle{The \TeX book.}
+% Addison--Wesley Publishing Company, Reading/Massachusetts, 1989, 16th~edition.}
+%
+% \bibitem{Muszynski}{\person{Muszynski, Carl} and \person{P\v rihoda, Eduard:}
+% \bibtitle{Die Terrainlehre in Verbindung mit der Darstellung, Beurtheilung und
+% Beschreibung des Terrains vom milit\"arischen
+% Standpunkte.}
+% L.\,W.~Seidel \&\ Sohn, Wien, 1872.}
+%
+% \bibitem{Reglement}{Normalverordnungsblatt f\"ur das k.\,u.\,k.~Heer.
+% \bibtitle{Exercier-Reglement f\"ur die k.\,u.\,k.~Cavallerie, I. Theil.}
+% Wien, k.\,k.~Hof- und Staatsdruckerei, 1898, 4th~edition.}
+%
+% \bibitem{german}{\person{Raichle, Bernd:} \bibtitle{The german package.} \CTAN-Archive, 1998, v2.5e.}
+%
+% \bibitem{yfonts}{\person{Schmidt, Walter:} \bibtitle{Ein Makropaket f\"ur die gebrochenen
+% Schriften.} \CTAN-Archive, 1998, v1.2.}
+%
+% \bibitem{Tschichold}{\person{Tschichold, Jan:} \bibtitle{Ausgew\"ahlte Aufs\"atze \"uber Fragen
+% der Gestalt des Buches und der Typographie.} Birkh\"auser, Basel,
+% 1987, 2nd~edition.}
+%
+% \bibitem{Willberg}{\person{Willberg, Hans Peter} and \person{Forssmann, Friedrich:}
+% \bibtitle{Lesetypographie.} H. Schmidt, Mainz, 1997.}
+%
+% \end{thebibliography}
+%
+%
+% \StopEventually{\addtocontents{toc}{\protect\end{multicols}}}
+%
+%
+%
+%
+%
+%
+%
+%
+%^^A max 72 columns
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \section{The implementation}
+%
+% \subsection*{The package preamble}
+%
+% This piece of code makes sure that the package is only loaded
+% once. While this is guaranteed by \LaTeX, we have to do it
+% manually for all other flavors of \TeX.
+%
+% \begin{macrocode}
+\expandafter\ifx\csname SOUL@\endcsname\relax\else
+ \expandafter\endinput
+\fi
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% Fake some of the \LaTeX\ commands if we were loaded by another flavor
+% of \TeX. This might break some previously loaded packages, though,
+% if e.\,g.~\cs{\mbox} was already in use. But we don't care \dots
+%
+% \begin{macrocode}
+\ifx\documentclass\SOULundefined
+ \chardef\atcode=\catcode`@
+ \catcode`\@=11
+ \def\DeclareRobustCommand*{\def}
+ \let\newcommand\DeclareRobustCommand
+ \def\DeclareOption#1#2{\expandafter\def\csname#1\endcsname{#2}}
+ \def\PackageError#1#2#3{{%
+ \newlinechar`^^J%
+ \errorcontextlines\z@
+ \edef\\{\errhelp{#3}}\\%
+ \errmessage{Package #1 error: #2}%
+ }}
+ \def\@height{height}
+ \def\@depth{depth}
+ \def\@width{width}
+ \def\@plus{plus}
+ \def\@minus{minus}
+ \font\SOUL@tt=ectt1000
+ \let\@xobeysp\space
+ \let\linebreak\break
+ \let\mbox\hbox
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% \soul\ tries to be a good \LaTeX\ citizen if used under \LaTeX\ and
+% declares itself properly. Most command sequences in the package
+% are protected by the |SOUL@| namespace, all other macros are first
+% defined to be empty. This will give us an error message \emph{now}
+% if one of those was already used by another package.
+%
+% \begin{macrocode}
+\else
+ \NeedsTeXFormat{LaTeX2e}
+ \ProvidesPackage{soul}
+ [2003/11/17 v2.4 letterspacing/underlining (mf)]
+ \newfont\SOUL@tt{ectt1000}
+ \newcommand*\sodef{}
+ \newcommand*\resetso{}
+ \newcommand*\capsdef{}
+ \newcommand*\capsfont{}
+ \newcommand*\setulcolor{}
+ \newcommand*\setuloverlap{}
+ \newcommand*\setul{}
+ \newcommand*\resetul{}
+ \newcommand*\setuldepth{}
+ \newcommand*\setstcolor{}
+ \newcommand*\sethlcolor{}
+ \newcommand*\so{}
+ \newcommand*\ul{}
+ \newcommand*\st{}
+ \newcommand*\hl{}
+ \newcommand*\caps{}
+ \newcommand*\soulaccent{}
+ \newcommand*\soulregister{}
+ \newcommand*\soulfont{}
+ \newcommand*\soulomit{}
+\fi
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% Other packages wouldn't be happy if we reserved piles of \cs{\newtoks} and
+% \cs{\newdimen}, so we try to get away with their \cs{\...def} counterparts
+% where possible.
+% Local registers are always even, while global ones are odd---this is a
+% \TeX\ convention.
+%
+% \begin{macrocode}
+\newtoks\SOUL@word
+\newtoks\SOUL@lasttoken
+\toksdef\SOUL@syllable\z@
+\newtoks\SOUL@cmds
+\newtoks\SOUL@buffer
+\newtoks\SOUL@token
+\dimendef\SOUL@syllgoal\z@
+\dimendef\SOUL@syllwidth\tw@
+\dimendef\SOUL@charkern=4
+\dimendef\SOUL@hyphkern=6
+\countdef\SOUL@minus\z@
+\countdef\SOUL@comma\tw@
+\countdef\SOUL@apo=4
+\countdef\SOUL@grave=6
+\newskip\SOUL@spaceskip
+\newif\ifSOUL@ignorespaces
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% ^^A\FIXME{\newpage}
+% \begin{macro}{\soulomit}
+% \begin{macro}{\SOUL@ignorem}
+% \begin{macro}{\SOUL@ignore}
+% \begin{macro}{\SOUL@stopm}
+% \begin{macro}{\SOUL@stop}
+% \begin{macro}{\SOUL@relaxm}
+% \begin{macro}{\SOUL@lowerthanm}
+% \begin{macro}{\SOUL@hyphenhintm}
+% These macros are used as markers. To be able to check for such a
+% marker with \cs{\ifx} we have also to create a macro that contains
+% the marker. \cs{\SOUL@spc} shall contain a normal space with a
+% \cs{\catcode} of~10.
+%
+% \begin{macrocode}
+\def\soulomit#1{#1}
+\def\SOUL@stopM{\SOUL@stop}
+\let\SOUL@stop\relax
+\def\SOUL@lowerthan{}
+\def\SOUL@lowerthanM{\<}
+\def\SOUL@hyphenhintM{\-}
+\def\SOUL@n*{\let\SOUL@spc= }\SOUL@n* %
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The kernel}
+%
+% \begin{macro}{\SOUL@}
+% This macro is the entry to \soul. Using it does only make
+% sense after setting up a \soul\ driver. The next token after
+% the \soul\ command will be assigned to \cs{\SOUL@@}. This can be
+% some text enclosed in braces, or the name of a macro that contains text.
+%
+% \begin{macrocode}
+\def\SOUL@{%
+ \futurelet\SOUL@@\SOUL@expand
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@expand}
+% If the first token after the \soul\ command was an opening
+% brace we start scanning. Otherwise,
+% if the first token was a macro name, we expand that macro and
+% call \cs{\SOUL@} with its contents again. Unfortunately, we have to
+% exclude some macros therein from expansion.
+%
+% \begin{macrocode}
+\def\SOUL@expand{%
+ \ifcat\bgroup\noexpand\SOUL@@
+ \let\SOUL@n\SOUL@start
+ \else
+ \bgroup
+ \def\\##1##2{\def##2{\noexpand##2}}%
+ \the\SOUL@cmds
+ \SOUL@buffer={%
+ \\\TeX\\\LaTeX\\\soulomit\\\mbox\\\hbox\\\textregistered
+ \\\slash\\\textcircled\\\copyright\\\S\\\,\\\<\\\>\\~%
+ \\\\%
+ }%
+ \def\\##1{\def##1{\noexpand##1}}%
+ \the\SOUL@buffer
+ \let\protect\noexpand
+ \xdef\SOUL@n##1{\noexpand\SOUL@start{\SOUL@@}}%
+ \egroup
+ \fi
+ \SOUL@n
+}
+\long\def\SOUL@start#1{{%
+ \let\<\SOUL@lowerthan
+ \let\>\empty
+ \def\soulomit{\noexpand\soulomit}%
+ \gdef\SOUL@eventuallyexhyphen##1{}%
+ \let\SOUL@soeventuallyskip\relax
+ \SOUL@spaceskip=\fontdimen\tw@\font\@plus\fontdimen\thr@@\font
+ \@minus\fontdimen4\font
+ \SOUL@ignorespacesfalse
+ \leavevmode
+ \SOUL@preamble
+ \SOUL@lasttoken={}%
+ \SOUL@word={}%
+ \SOUL@minus\z@
+ \SOUL@comma\z@
+ \SOUL@apo\z@
+ \SOUL@grave\z@
+ \SOUL@do{#1}%
+ \SOUL@postamble
+}}
+\long\def\SOUL@do#1{%
+ \SOUL@scan#1\SOUL@stop
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The scanner}
+%
+% \begin{macro}{\SOUL@scan}
+% This is the entry point for the scanner. It calls \cs{\SOUL@eval}
+% and will in turn be called by \cs{\SOUL@eval} again for every
+% new token to be scanned.
+%
+% \begin{macrocode}
+\def\SOUL@scan{%
+ \futurelet\SOUL@@\SOUL@eval
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@eval}
+% And here it is: the scanner's heart. It cares for quotes and dashes
+% ligatures and handles all commands that must not be fed to the
+% analyzer.
+%
+% \begin{macrocode}
+\def\SOUL@eval{%
+ \def\SOUL@n*##1{\SOUL@scan}%
+ \if\noexpand\SOUL@@\SOUL@spc
+ \else
+ \SOUL@ignorespacesfalse
+ \fi
+ \ifnum\SOUL@minus=\thr@@
+ \SOUL@flushminus
+ \else\ifnum\SOUL@comma=\tw@
+ \SOUL@flushcomma
+ \else\ifnum\SOUL@apo=\tw@
+ \SOUL@flushapo
+ \else\ifnum\SOUL@grave=\tw@
+ \SOUL@flushgrave
+ \fi\fi\fi\fi
+ \ifx\SOUL@@-\else\SOUL@flushminus\fi
+ \ifx\SOUL@@,\else\SOUL@flushcomma\fi
+ \ifx\SOUL@@'\else\SOUL@flushapo\fi
+ \ifx\SOUL@@`\else\SOUL@flushgrave\fi
+ \ifx\SOUL@@-%
+ \advance\SOUL@minus\@ne
+ \else\ifx\SOUL@@,%
+ \advance\SOUL@comma\@ne
+ \else\ifx\SOUL@@'%
+ \advance\SOUL@apo\@ne
+ \else\ifx\SOUL@@`%
+ \advance\SOUL@grave\@ne
+ \else
+ \SOUL@flushminus
+ \SOUL@flushcomma
+ \SOUL@flushapo
+ \SOUL@flushgrave
+ \ifx\SOUL@@\SOUL@stop
+ \def\SOUL@n*{%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ }%
+ \else\ifx\SOUL@@\par
+ \def\SOUL@n*\par{\par\leavevmode\SOUL@scan}%
+ \else\if\noexpand\SOUL@@\SOUL@spc
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \ifSOUL@ignorespaces
+ \else
+ \SOUL@everyspace{}%
+ \fi
+ \def\SOUL@n* {\SOUL@scan}%
+ \else\ifx\SOUL@@\\%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\unskip\nobreak\hfil\break}%
+ \SOUL@ignorespacestrue
+ \else\ifx\SOUL@@~%
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen\null
+ \SOUL@everyspace{\nobreak}%
+ \else\ifx\SOUL@@\slash
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{/}%
+ \SOUL@exhyphen{/}%
+ \else\ifx\SOUL@@\mbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\hbox
+ \def\SOUL@n*{\SOUL@addprotect}%
+ \else\ifx\SOUL@@\soulomit
+ \def\SOUL@n*\soulomit##1{%
+ \SOUL@doword
+ {\spaceskip\SOUL@spaceskip##1}%
+ \SOUL@scan
+ }%
+ \else\ifx\SOUL@@\break
+ \SOUL@doword
+ \break
+ \else\ifx\SOUL@@\linebreak
+ \SOUL@doword
+ \SOUL@everyspace{\linebreak}%
+ \else\ifcat\bgroup\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addgroup{}}%
+ \else\ifcat$\noexpand\SOUL@@
+ \def\SOUL@n*{\SOUL@addmath}%
+ \else
+ \def\SOUL@n*{\SOUL@dotoken}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi
+ \SOUL@n*%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@flushminus}
+% \begin{macro}{\SOUL@flushcomma}
+% \begin{macro}{\SOUL@flushapo}
+% \begin{macro}{\SOUL@flushgrave}
+% As their names imply, these macros flush special tokens or token
+% groups to the word register. They don't do anything if the respective
+% counter equals zero. \cs{\SOUL@minus} does also flush the word
+% register, because hyphens disturb the analyzer.
+%
+% \begin{macrocode}
+\def\SOUL@flushminus{%
+ \ifcase\SOUL@minus
+ \else
+ \SOUL@doword
+ \SOUL@eventuallyexhyphen{-}%
+ \ifcase\SOUL@minus
+ \or
+ \SOUL@exhyphen{-}%
+ \or
+ \SOUL@exhyphen{--}%
+ \or
+ \SOUL@exhyphen{---}%
+ \fi
+ \SOUL@minus\z@
+ \fi
+}
+\def\SOUL@flushcomma{%
+ \ifcase\SOUL@comma
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word,}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{,,}}}}\x
+ \fi
+ \SOUL@comma\z@
+}
+\def\SOUL@flushapo{%
+ \ifcase\SOUL@apo
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word'}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{''}}}}\x
+ \fi
+ \SOUL@apo\z@
+}
+\def\SOUL@flushgrave{%
+ \ifcase\SOUL@grave
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word`}}\x
+ \or
+ \edef\x{\SOUL@word={\the\SOUL@word{{``}}}}\x
+ \fi
+ \SOUL@grave\z@
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@dotoken}
+% Command sequences from the \cs{\SOUL@cmds} list are handed over
+% to \cs{\SOUL@docmd}, everything else is added to \cs{\SOUL@word},
+% which will be fed to the analyzer every time a word is completed.
+% Since \emph{robust} commands come with an additional space, we
+% have also to examine if there's a space variant. Otherwise we
+% couldn't detect pre-expanded formerly robust commands.
+%
+% \begin{macrocode}
+\def\SOUL@dotoken#1{%
+ \def\SOUL@@{\SOUL@addtoken{#1}}%
+ \def\\##1##2{%
+ \edef\SOUL@x{\string#1}%
+ \edef\SOUL@n{\string##2}%
+ \ifx\SOUL@x\SOUL@n
+ \def\SOUL@@{\SOUL@docmd{##1}{#1}}%
+ \else
+ \edef\SOUL@n{\string##2\space}%
+ \ifx\SOUL@x\SOUL@n
+ \def\SOUL@@{\SOUL@docmd{##1}{#1}}%
+ \fi
+ \fi
+ }%
+ \the\SOUL@cmds
+ \SOUL@@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@docmd}
+% Here we deal with commands that were registered with \cs{\soulregister}
+% or \cs{\soulaccent} or were already predefined in \cs{\SOUL@cmds}.
+% Commands with identifier |9| are accents that are put in a
+% group with their argument. Identifier |8| is reserved for the \cs{\footnote}
+% command, and |7| for the \cs{\textsuperscript} or similar commands.
+% The others are mostly (but not necessarily)
+% font switching commands, which may (|1|) or may not (|0|) take
+% an argument. A registered command leads to the current word
+% buffer being flushed to the analyzer, after which the command
+% itself is executed.
+%
+% Font switching commands which take an argument need special
+% treatment: They need to increment the level counter, so that
+% \cs{\SOUL@eval} knows where to stop scanning. Furthermore the
+% scanner has to be enabled to see the next token after the opening
+% brace.
+%
+%
+% \begin{macrocode}
+\def\SOUL@docmd#1#2{%
+ \ifx9#1%
+ \def\SOUL@@{\SOUL@addgroup{#2}}%
+ \else\ifx8#1%
+ \SOUL@doword
+ \def\SOUL@@##1{%
+ \SOUL@token={\footnotemark}%
+ \SOUL@everytoken
+ \SOUL@syllable={\footnotemark}%
+ \SOUL@everysyllable
+ \footnotetext{##1}%
+ \SOUL@doword
+ \SOUL@scan
+ }%
+ \else\ifx7#1%
+ \SOUL@doword
+ \def\SOUL@@##1{%
+ \SOUL@token={#2{##1}}%
+ \SOUL@everytoken
+ \SOUL@syllable={#2{##1}}%
+ \SOUL@everysyllable
+ \SOUL@doword
+ \SOUL@scan
+ }%
+ \else\ifx1#1%
+ \SOUL@doword
+ \def\SOUL@@##1{%
+ #2{\protect\SOUL@do{##1}}%
+ \SOUL@scan
+ }%
+ \else
+ \SOUL@doword
+ #2%
+ \let\SOUL@@\SOUL@scan
+ \fi\fi\fi\fi
+ \SOUL@@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@addgroup}
+% \begin{macro}{\SOUL@addmath}
+% \begin{macro}{\SOUL@addprotect}
+% \begin{macro}{\SOUL@addtoken}
+% The macro names say it all. Each of these macros adds some
+% token to the word buffer \cs{\SOUL@word}. Setting \cs{\protect}
+% is necessary to make things like |\so{{a\itshape b}}| work.
+%
+% \begin{macrocode}
+\def\SOUL@addgroup#1#2{%
+ {\let\protect\noexpand
+ \edef\x{\global\SOUL@word={\the\SOUL@word{{\noexpand#1#2}}}}\x}%
+ \SOUL@scan
+}
+\def\SOUL@addmath$#1${%
+ {\let\protect\noexpand
+ \edef\x{\global\SOUL@word={\the\SOUL@word{{\hbox{$#1$}}}}}\x}%
+ \SOUL@scan
+}
+\def\SOUL@addprotect#1#2{%
+ {\let\protect\noexpand
+ \edef\x{\global\SOUL@word={\the\SOUL@word{{\hbox{#2}}}}}\x}%
+ \SOUL@scan
+}
+\def\SOUL@addtoken#1{%
+ \edef\x{\SOUL@word={\the\SOUL@word\noexpand#1}}\x
+ \SOUL@scan
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@exhyphen}
+% Dealing with explicit hyphens can't be done before we know the
+% following character, because we need to know if a kerning value
+% has to be inserted, hence we delay the \cs{\SOUL@everyexhyphen} call.
+% Unfortunately, the word scanner has no look-ahead mechanism.
+%
+% \begin{macrocode}
+\def\SOUL@exhyphen#1{%
+ \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}{#1}%
+ \gdef\SOUL@eventuallyexhyphen##1{%
+ \SOUL@getkern{#1}{\SOUL@charkern}{##1}%
+ \SOUL@everyexhyphen{#1}%
+ \gdef\SOUL@eventuallyexhyphen####1{}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@cmds}
+% Here is a list of pre-registered commands that the analyzer
+% cannot handle, so the scanner has to look after them. Every
+% entry consists of a handle (\cs{\\}), an identifier and the
+% macro name. The class identifier can be |9| for accents,
+% |8| for the \cs{\footnote} command, |7| for the
+% \cs{\textsuperscript} command,
+% |0| for commands without arguments and |1| for commands that
+% take one argument. Commands with two or more arguments are
+% not supported.
+%
+% \begin{macrocode}
+\SOUL@cmds={%
+ \\9\`\\9\'\\9\^\\9\"\\9\~\\9\=\\9\.%
+ \\9\u\\9\v\\9\H\\9\t\\9\c\\9\d\\9\b\\9\r
+ \\1\emph\\1\textrm\\1\textsf\\1\texttt\\1\textmd\\1\textbf
+ \\1\textup\\1\textsl\\1\textit\\1\textsc\\1\textnormal
+ \\0\rmfamily\\0\sffamily\\0\ttfamily\\0\mdseries\\0\upshape
+ \\0\slshape\\0\itshape\\0\scshape\\0\normalfont
+ \\0\em\\0\rm\\0\bf\\0\it\\0\tt\\0\sc\\0\sl\\0\sf
+ \\0\tiny\\0\scriptsize\\0\footnotesize\\0\small
+ \\0\normalsize\\0\large\\0\Large\\0\LARGE\\0\huge\\0\Huge
+ \\1\MakeUppercase\\7\textsuperscript\\8\footnote
+ \\1\textfrak\\1\textswab\\1\textgoth
+ \\0\frakfamily\\0\swabfamily\\0\gothfamily
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\soulregister}
+% \begin{macro}{\soulfont}
+% \begin{macro}{\soulaccent}
+% Register a font switching command (or some other command) for the
+% scanner. The first argument is the macro name, the second is
+% the number of arguments (|0|~or~|1|). Example: |\soulregister{\bold}{0}|.
+% \cs{\soulaccent} has only one argument---the accent macro name.
+% Example: |\soulaccent{\~}|. It is a shortcut for |\soulregister{\~}{9}|.
+% The \cs{\soulfont} command is a synonym for \cs{\soulregister}
+% and is kept for compatibility reasons.
+%
+% \begin{macrocode}
+\def\soulregister#1#2{{%
+ \edef\x{\global\SOUL@cmds={\the\SOUL@cmds
+ \noexpand\\#2\noexpand#1}}\x
+}}
+\def\soulaccent#1{\soulregister{#1}9}
+\let\soulfont\soulregister
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The analyzer}
+%
+% \begin{macro}{\SOUL@doword}
+% The only way to find out, where a given word can be broken into
+% syllables, is to let \TeX\ actually typeset the word under conditions
+% that enforce every possible hyphenation. The result is a paragraph with one
+% line for every syllable.
+%
+% \begin{macrocode}
+\def\SOUL@doword{%
+ \edef\x{\the\SOUL@word}%
+ \ifx\x\empty
+ \else
+ \SOUL@buffer={}%
+ \setbox\z@\vbox{%
+ \SOUL@tt
+ \hyphenchar\font`\-
+ \hfuzz\maxdimen
+ \hbadness\@M
+ \pretolerance\m@ne
+ \tolerance\@M
+ \leftskip\z@
+ \rightskip\z@
+ \hsize1sp
+ \everypar{}%
+ \parfillskip\z@\@plus1fil
+ \hyphenpenalty-\@M
+ \noindent
+ \hskip\z@
+ \relax
+ \the\SOUL@word}%
+ \let\SOUL@errmsg\SOUL@error
+ \let\-\relax
+ \count@\m@ne
+ \SOUL@analyze
+ \SOUL@word={}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% We store the hyphen width of the |ectt1000| font,
+% because we will need it in |\SOUL@doword|. (|ectt1000| is a mono-spaced
+% font, so every other character would have worked, too.)
+%
+% \begin{macrocode}
+\setbox\z@\hbox{\SOUL@tt-}
+\newdimen\SOUL@ttwidth
+\SOUL@ttwidth\wd\z@
+\def\SOUL@sethyphenchar{%
+ \ifnum\hyphenchar\font=\m@ne
+ \else
+ \char\hyphenchar\font
+ \fi
+}
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@analyze}
+% This macro decomposes the box that |\SOUL@doword| has built.
+% Because we have to start at the bottom, we put every
+% syllable onto the stack and execute ourselves recursively. If there
+% are no syllables left, we return from the recursion and pick syllable
+% after syllable from the stack again---this time from top to bottom---and
+% hand the syllable width |\SOUL@syllgoal| over to |\SOUL@dosyllable|.
+% All but the last syllable end with the hyphen character, hence
+% we subtract the hyphen width accordingly. After processing a
+% syllable we calculate the hyphen kern (i.\,e.~the kerning amount
+% between the last character and the hyphen). This might be needed
+% by \cs{\SOUL@everyhyphen}, which we call now.
+%
+% \begin{macrocode}
+\def\SOUL@analyze{{%
+ \setbox\z@\vbox{%
+ \unvcopy\z@
+ \unskip
+ \unpenalty
+ \global\setbox\@ne=\lastbox}%
+ \ifvoid\@ne
+ \else
+ \setbox\@ne\hbox{\unhbox\@ne}%
+ \SOUL@syllgoal=\wd\@ne
+ \advance\count@\@ne
+ \SOUL@analyze
+ \SOUL@syllwidth\z@
+ \SOUL@syllable={}%
+ \ifnum\count@>\z@
+ \advance\SOUL@syllgoal-\SOUL@ttwidth
+ \SOUL@dosyllable
+ \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@hyphkern}%
+ {\SOUL@sethyphenchar}%
+ \SOUL@everyhyphen
+ \else
+ \SOUL@dosyllable
+ \fi
+ \fi
+}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@dosyllable}
+% This macro typesets token after token from \cs{\SOUL@word}
+% until \cs{\SOUL@syllwidth} has reached
+% the requested width \cs{\SOUL@syllgoal}. Furthermore the kerning
+% values are prepared in case \cs{\SOUL@everytoken} needs them.
+% The \cs{\<} command used by \cs{\so} and \cs{\caps} needs some
+% special treatment: It has to be checked for, even before
+% we can end a syllable.
+%
+% \begin{macrocode}
+\def\SOUL@dosyllable{%
+ \SOUL@gettoken
+ \SOUL@eventuallyexhyphen{\the\SOUL@token}%
+ \edef\x{\the\SOUL@token}%
+ \ifx\x\SOUL@hyphenhintM
+ \let\SOUL@n\SOUL@dosyllable
+ \else\ifx\x\SOUL@lowerthanM
+ \SOUL@gettoken
+ \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern}
+ {\the\SOUL@token}%
+ \SOUL@everylowerthan
+ \SOUL@puttoken
+ \let\SOUL@n\SOUL@dosyllable
+ \else\ifdim\SOUL@syllwidth=\SOUL@syllgoal
+ \SOUL@everysyllable
+ \SOUL@puttoken
+ \let\SOUL@n\relax
+ \else\ifx\x\SOUL@stopM
+ \SOUL@errmsg
+ \global\let\SOUL@errmsg\relax
+ \let\SOUL@n\relax
+ \else
+ \setbox\tw@\hbox{\SOUL@tt\the\SOUL@token}%
+ \advance\SOUL@syllwidth\wd\tw@
+ \global\SOUL@lasttoken=\SOUL@token
+ \SOUL@gettoken
+ \SOUL@getkern{\the\SOUL@lasttoken}{\SOUL@charkern}
+ {\the\SOUL@token}%
+ \SOUL@puttoken
+ \global\SOUL@token=\SOUL@lasttoken
+ \SOUL@everytoken
+ \edef\x{\SOUL@syllable={\the\SOUL@syllable\the\SOUL@token}}\x
+ \let\SOUL@n\SOUL@dosyllable
+ \fi\fi\fi\fi
+ \SOUL@n
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@gettoken}
+% Provide the next token in \cs{\SOUL@token}. If there's already one
+% in the buffer, use that one first.
+%
+% \begin{macrocode}
+\def\SOUL@gettoken{%
+ \edef\x{\the\SOUL@buffer}%
+ \ifx\x\empty
+ \SOUL@nexttoken
+ \else
+ \global\SOUL@token=\SOUL@buffer
+ \global\SOUL@buffer={}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@puttoken}
+% The possibility to put tokens back makes the scanner design much
+% cleaner. There's only room for one token, though, so we issue
+% an error message if \cs{\SOUL@puttoken} is told to put a token
+% back while the buffer is still in use. Note that \cs{\SOUL@debug}
+% is actually undefined. This won't hurt as it can only happen
+% during driver design. No user will ever see this message.
+%
+% \begin{macrocode}
+\def\SOUL@puttoken{%
+ \edef\x{\the\SOUL@buffer}%
+ \ifx\x\empty
+ \global\SOUL@buffer=\SOUL@token
+ \global\SOUL@token={}%
+ \else
+ \SOUL@debug{puttoken called twice}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@nexttoken}
+% \begin{macro}{\SOUL@splittoken}
+% If the word buffer \cs{\SOUL@word} is empty, deliver a \cs{\SOUL@stop},
+% otherwise take the next token.
+%
+% \begin{macrocode}
+\def\SOUL@nexttoken{%
+ \edef\x{\the\SOUL@word}%
+ \ifx\x\empty
+ \SOUL@token={\SOUL@stop}%
+ \else
+ \expandafter\SOUL@splittoken\the\SOUL@word\SOUL@stop
+ \fi
+}
+\def\SOUL@splittoken#1#2\SOUL@stop{%
+ \global\SOUL@token={#1}%
+ \global\SOUL@word={#2}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@getkern}
+% Assign the kerning value between the first and the third argument
+% to the second, which has to be a \cs{\dimen} register.
+% |\SOUL@getkern{A}{\dimen0}{V}| will assign the kerning value
+% between `A' and `V' to |\dimen0|.
+%
+% \begin{macrocode}
+\def\SOUL@getkern#1#2#3{%
+ \setbox\tw@\hbox{#1#3}%
+ #2\wd\tw@
+ \setbox\tw@\hbox{#1\null#3}%
+ \advance#2-\wd\tw@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@setkern}
+% Set a kerning value if it doesn't equal 0\,pt. Of course, we could
+% also set a zero value, but that would needlessly clutter the
+% logfile.
+%
+% \begin{macrocode}
+\def\SOUL@setkern#1{\ifdim#1=\z@\else\kern#1\fi}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@error}
+% This error message will be shown once for every word that couldn't
+% be reconstructed by \cs{\SOUL@dosyllable}.
+%
+% \begin{macrocode}
+\def\SOUL@error{%
+ \vrule\@height.8em\@depth.2em\@width1em
+ \PackageError{soul}{Reconstruction failed}{%
+ I came across hyphenatable material enclosed in group
+ braces,^^Jwhich I can't handle. Either drop the braces or
+ make the material^^Junbreakable using an \string\mbox\space
+ (\string\hbox). Note that a space^^Jalso counts as possible
+ hyphenation point. See page 4 of the manual.^^JI'm leaving
+ a black square so that you can see where I am right now.%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@setup}
+% This is a null driver, that will be used as the basis for
+% other drivers. These have then to redefine only interface commands
+% that shall differ from the default.
+%
+% \begin{macrocode}
+\def\SOUL@setup{%
+ \let\SOUL@preamble\relax
+ \let\SOUL@postamble\relax
+ \let\SOUL@everytoken\relax
+ \let\SOUL@everysyllable\relax
+ \def\SOUL@everyspace##1{##1\space}%
+ \let\SOUL@everyhyphen\relax
+ \def\SOUL@everyexhyphen##1{##1}%
+ \let\SOUL@everylowerthan\relax
+}
+\SOUL@setup
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The \texorpdfstring{\so{letterspacing}}{letterspacing} driver}
+%
+% \begin{macro}{\SOUL@sosetletterskip}
+% A handy helper macro that sets the inter-letter skip with a
+% draconian \cs{\penalty}.
+%
+% \begin{macrocode}
+\def\SOUL@sosetletterskip{\nobreak\hskip\SOUL@soletterskip}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@sopreamble}
+% If letterspacing (\cs{\so} or \cs{\caps}) follows a white space, we
+% replace it with our \syn{outer space}. \LaTeX\ uses |\hskip1sp| as
+% marker in tabular entries, so we ignore tiny skips.
+%
+% \begin{macrocode}
+\def\SOUL@sopreamble{%
+ \ifdim\lastskip>5sp
+ \unskip
+ \hskip\SOUL@soouterskip
+ \fi
+ \spaceskip\SOUL@soinnerskip
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@sopostamble}
+% Start the look-ahead scanner \cs{\SOUL@socheck} outside the \cs{\SOUL@}
+% scope. That's why we make the \syn{outer space} globally available in
+% \cs{\skip@}.
+%
+% \begin{macrocode}
+\def\SOUL@sopostamble{%
+ \global\skip@=\SOUL@soouterskip
+ \aftergroup\SOUL@socheck
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@socheck}
+% \begin{macro}{\SOUL@sodoouter}
+% Read the next token after the \soul\ command into \cs{\SOUL@@}
+% and examine it. If it's some kind of space, replace it with
+% \syn{outer space} and the appropriate penalty, else if it's
+% a closing brace, continue scanning. If it is neither: do nothing.
+%
+% \begin{macrocode}
+\def\SOUL@socheck{%
+ \futurelet\SOUL@@\SOUL@sodoouter
+}
+\def\SOUL@sodoouter{%
+ \def\SOUL@n*##1{\hskip\skip@}%
+ \ifcat\egroup\noexpand\SOUL@@
+ \unkern
+ \egroup
+ \def\SOUL@n*{\afterassignment\SOUL@socheck\let\SOUL@x=}%
+ \else\ifx\SOUL@spc\SOUL@@
+ \def\SOUL@n* {\hskip\skip@}%
+ \else\ifx~\SOUL@@
+ \def\SOUL@n*~{\nobreak\hskip\skip@}%
+ \else\ifx\ \SOUL@@
+ \else\ifx\space\SOUL@@
+ \else\ifx\@xobeysp\SOUL@@
+ \else
+ \def\SOUL@n*{}%
+ \let\SOUL@@\relax
+ \fi\fi\fi\fi\fi\fi
+ \SOUL@n*%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@soeverytoken}
+% Typeset the token and put an unbreakable inter-letter skip
+% thereafter. If the token is \cs{\<} then remove the last skip instead.
+% Gets the character kerning value between the actual and the
+% next token in \cs{\SOUL@charkern}.
+%
+% \begin{macrocode}
+\def\SOUL@soeverytoken{%
+ \edef\x{\the\SOUL@token}%
+ \ifx\x\SOUL@lowerthanM
+ \else
+ \global\let\SOUL@soeventuallyskip\SOUL@sosetletterskip
+ \the\SOUL@token
+ \SOUL@gettoken
+ \edef\x{\the\SOUL@token}%
+ \ifx\x\SOUL@stopM
+ \else
+ \SOUL@setkern\SOUL@charkern
+ \SOUL@sosetletterskip
+ \SOUL@puttoken
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@soeveryspace}
+% This macro sets an \syn{inner space}. The argument may contain
+% penalties and is used for the |~| command. This construction was
+% needed to make colored underlines work, without having to put
+% any of the coloring commands into the core. |\kern\z@| prevents
+% in subsequent \cs{\so} commands that the second discards the
+% \syn{outer space} of the first. To remove the space simply
+% use |\unkern\unskip|.
+%
+% \begin{macrocode}
+\def\SOUL@soeveryspace#1{#1\space\kern\z@}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@soeveryhyphen}
+% Sets implicit hyphens. The kerning value between the current token
+% and the hyphen character is passed in \cs{\SOUL@hyphkern}.
+%
+% \begin{macrocode}
+\def\SOUL@soeveryhyphen{%
+ \discretionary{%
+ \unkern
+ \SOUL@setkern\SOUL@hyphkern
+ \SOUL@sethyphenchar
+ }{}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@soeveryexhyphen}
+% Sets the explicit hyphen that is passed as argument.
+% \cs{\SOUL@soeventuallyskip} equals \cs{\SOUL@sosetletterskip},
+% except when a \cs{\<} had been detected. This is necessary because
+% \cs{\SOUL@soeveryexhyphen} wouldn't know otherwise, that it
+% follows a~\cs{\<}.
+%
+% \begin{macrocode}
+\def\SOUL@soeveryexhyphen#1{%
+ \SOUL@setkern\SOUL@hyphkern
+ \SOUL@soeventuallyskip
+ \hbox{#1}%
+ \discretionary{}{}{%
+ \SOUL@setkern\SOUL@charkern
+ }%
+ \SOUL@sosetletterskip
+ \global\let\SOUL@soeventuallyskip\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@soeverylowerthan}
+% Let \cs{\<} remove the last inter-letter skip. Set the kerning value
+% between the token before and that after the \cs{\<} command.
+%
+%
+% \begin{macrocode}
+\def\SOUL@soeverylowerthan{%
+ \unskip
+ \unpenalty
+ \global\let\SOUL@soeventuallyskip\relax
+ \SOUL@setkern\SOUL@charkern
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@sosetup}
+% Override all interface macros by our letterspacing versions. The
+% only unused macro is \cs{\SOUL@everysyllable}.
+%
+% \begin{macrocode}
+\def\SOUL@sosetup{%
+ \SOUL@setup
+ \let\SOUL@preamble\SOUL@sopreamble
+ \let\SOUL@postamble\SOUL@sopostamble
+ \let\SOUL@everytoken\SOUL@soeverytoken
+ \let\SOUL@everyspace\SOUL@soeveryspace
+ \let\SOUL@everyhyphen\SOUL@soeveryhyphen
+ \let\SOUL@everyexhyphen\SOUL@soeveryexhyphen
+ \let\SOUL@everylowerthan\SOUL@soeverylowerthan
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@setso}
+% A handy macro for internal use.
+%
+% \begin{macrocode}
+\def\SOUL@setso#1#2#3{%
+ \def\SOUL@soletterskip{#1}%
+ \def\SOUL@soinnerskip{#2}%
+ \def\SOUL@soouterskip{#3}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\sodef}
+% This macro assigns the letterspacing skips as well as an optional
+% font switching command to a command sequence name. \cs{\so} itself
+% will be defined using this macro.
+%
+% \begin{macrocode}
+\def\sodef#1#2#3#4#5{%
+ \DeclareRobustCommand*#1{\SOUL@sosetup
+ \def\SOUL@preamble{%
+ \SOUL@setso{#3}{#4}{#5}%
+ #2%
+ \SOUL@sopreamble
+ }%
+ \SOUL@
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\resetso}
+% Let \cs{\resetso} define reasonable default values for letterspacing.
+%
+% \begin{macrocode}
+\def\resetso{%
+ \sodef\textso{}{.25em}{.65em\@plus.08em\@minus.06em}%
+ {.55em\@plus.275em\@minus.183em}%
+}
+\resetso
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\sloppyword}
+% Set up a letterspacing macro that inserts slightly stretchable
+% space between the characters. This can be used to typeset long
+% words in narrow columns, where ragged paragraphs are undesirable.
+% See section~\ref{sec:sloppyword}.
+%
+% \begin{macrocode}
+\sodef\sloppyword{%
+ \linepenalty10
+ \hyphenpenalty10
+ \adjdemerits\z@
+ \doublehyphendemerits\z@
+ \finalhyphendemerits\z@
+ \emergencystretch.1em}%
+ {\z@\@plus.1em}%
+ {.33em\@plus.11em\@minus.11em}%
+ {.33em\@plus.11em\@minus.11em}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection[The \texorpdfstring{\caps{caps}}{caps} driver]{The caps driver}
+%
+% \begin{macro}{\caps}
+% Unless run under \LaTeX, make \cs{\caps} just another simple letterspacing
+% macro that selects a font \cs{\capsfont} (defaulting to \cs{\relax}) but
+% doesn't have any special capabilities.
+%
+% \begin{macrocode}
+\ifx\documentclass\@undefined
+\let\capsfont\relax
+\let\capsreset\relax
+\def\capsdef#1#2#3#4#5{}
+\def\capssave#1{}
+\def\capsselect#1{}
+\sodef\textcaps{\capsfont}
+ {.028em\@plus.005em\@minus.01em}%
+ {.37em\@plus.1667em\@minus.111em}%
+ {.37em\@plus.1em\@minus.14em}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\capsreset}
+% \dots\ else, if run under \LaTeX\ prepare a set of macros that
+% maintain a database with certain letterspacing values for different
+% fonts. \cs{\capsreset} clears the database and inserts a default rule.
+%
+% \begin{macrocode}
+\else
+\DeclareRobustCommand*\capsreset{%
+ \let\SOUL@capsbase\empty
+ \SOUL@capsdefault
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\capsdef}
+% Add an entry to the database, which is of course nothing else than
+% a \TeX\ macro. See section ``List macros'' of appendix~D in the
+% \TeX{}book~\cite{DEK} for details.
+%
+% \begin{macrocode}
+\def\capsdef#1#2#3#4#5{{%
+ \toks\z@{\\{#1/#2/#3/#4/#5}}%
+ \toks\tw@=\expandafter{\SOUL@capsbase}%
+ \xdef\SOUL@capsbase{\the\toks\z@\the\toks\tw@}%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\capssave}
+% \begin{macro}{\capsselect}
+% Save the current database in a macro within the |SOUL@| namespace
+% and let |\capsselect| restore this database.
+%
+% \begin{macrocode}
+\DeclareRobustCommand*\capssave[1]{%
+ \expandafter\global\expandafter\let
+ \csname SOUL@db@#1\endcsname\SOUL@capsbase
+}
+\DeclareRobustCommand*\capsselect[1]{%
+ \expandafter\let\expandafter\SOUL@capsbase
+ \csname SOUL@db@#1\endcsname
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@capsfind}
+% \begin{macro}{\SOUL@caps}
+% Go through the database entries and pick the first entry that matches
+% the currently active font. Then define an internal macro that uses
+% the respective spacing values in a macro that is equivalent to the
+% \cs{\textso} command.
+%
+% \begin{macrocode}
+\def\SOUL@capsfind#1/#2/#3/#4/#5/#6/#7/#8/#9/{%
+ \let\SOUL@match=1%
+ \SOUL@chk{#1}\f@encoding
+ \SOUL@chk{#2}\f@family
+ \SOUL@chk{#3}\f@series
+ \SOUL@chk{#4}\f@shape
+ \SOUL@dimchk{#5}\f@size
+ \if\SOUL@match1%
+ \let\\\@gobble
+ \gdef\SOUL@caps{%
+ \SOUL@sosetup
+ \def\SOUL@preamble{\SOUL@setso{#7}{#8}{#9}#6%
+ \SOUL@sopreamble}%
+ \SOUL@}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@chk}
+% Sets the \cs{\SOUL@match} flag if both parameters are equal.
+% This is used for all \caps{\small NFSS} elements except the font size.
+%
+% \begin{macrocode}
+\def\SOUL@chk#1#2{%
+ \if$#1$%
+ \else
+ \def\SOUL@n{#1}%
+ \ifx#2\SOUL@n\else\let\SOUL@match=0\fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@dimchk}
+% \begin{macro}{\SOUL@rangechk}
+% We do not only want to check if a given font size |#1| matches |#2|,
+% but also if it fits into a given range. An omitted lower boundary
+% is replaced by \cs{\z@} and an omitted upper boundary by \cs{\maxdimen}.
+% The first of a series of \cs{\SOUL@chk} and \cs{\SOUL@dimchk}
+% statements, which detects that the arguments don't match, sets the
+% \cs{\SOUL@match} flag to zero. A value of~1 indicates that an
+% entry in the font database matches the currently used font.
+%
+% \begin{macrocode}
+\def\SOUL@dimchk#1#2{\if$#1$\else\SOUL@rangechk{#2}#1--\@ne\@@\fi}
+\def\SOUL@rangechk#1#2-#3-#4\@@{%
+ \count@=#4%
+ \ifnum\count@>\z@
+ \ifdim#1\p@=#2\p@\else\let\SOUL@match=0\fi
+ \else
+ \dimen@=\if$#2$\z@\else#2\p@\fi
+ \ifdim#1\p@<\dimen@\let\SOUL@match=0\fi
+ \dimen@=\if$#3$\maxdimen\else#3\p@\fi
+ \ifdim#1\p@<\dimen@\else\let\SOUL@match=0\fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\textcaps}
+% Find a matching entry in the database and start the letterspacing
+% mechanism with the given spacing values.
+%
+% \begin{macrocode}
+\DeclareRobustCommand*\textcaps{{%
+ \def\\##1{\expandafter\SOUL@capsfind##1/}%
+ \SOUL@capsbase
+ \aftergroup\SOUL@caps
+}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@capsdefault}
+% Define a default database entry and a default font.
+%
+% \begin{macrocode}
+\def\SOUL@capsdefault{%
+ \capsdef{////}%
+ \SOUL@capsdfltfnt
+ {.028em\@plus.005em\@minus.01em}%
+ {.37em\@plus.1667em\@minus.1em}%
+ {.37em\@plus.111em\@minus.14em}%
+}
+\let\SOUL@capsdfltfnt\scshape
+\capsreset
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The \texorpdfstring{\ul{underlining}}{underlining} driver}
+%
+% \begin{macro}{\SOUL@ulleaders}
+% This macro sets the underline under the following \cs{\hskip}.
+%
+% \begin{macrocode}
+\newdimen\SOUL@uldp
+\newdimen\SOUL@ulht
+\def\SOUL@ulleaders{%
+ \leaders\hrule\@depth\SOUL@uldp\@height\SOUL@ulht\relax
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@ulunderline}
+% Set an underline under the given material. It draws the line first,
+% and the given material afterwards. This is needed for highlighting,
+% but gives less than optimal results for colored overstriking, which,
+% however, will hardly ever be used, anyway.
+%
+% \begin{macrocode}
+\def\SOUL@ulunderline#1{{%
+ \setbox\z@\hbox{#1}%
+ \dimen@=\wd\z@
+ \dimen@i=\SOUL@uloverlap
+ \advance\dimen@2\dimen@i
+ \rlap{%
+ \null
+ \kern-\dimen@i
+ \SOUL@ulcolor{\SOUL@ulleaders\hskip\dimen@}%
+ }%
+ \unhcopy\z@
+}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@ulpreamble}
+% Just set up the line dimensions and the space skip. Normally,
+% \cs{\spaceskip} is unset and not used by \TeX. We need it, though,
+% because we feed it to the \cs{\leaders} primitive.
+%
+% \begin{macrocode}
+\def\SOUL@ulpreamble{%
+ \SOUL@uldp=\SOUL@uldepth
+ \SOUL@ulht=-\SOUL@uldp
+ \advance\SOUL@uldp\SOUL@ulthickness
+ \spaceskip\SOUL@spaceskip
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@uleverysyllable}
+% By using \cs{\SOUL@everysyllable} we don't have to care about
+% kerning values and get better results for highlighting, where
+% negative kerning values would otherwise cut off characters.
+%
+% \begin{macrocode}
+\def\SOUL@uleverysyllable{%
+ \SOUL@ulunderline{%
+ \the\SOUL@syllable
+ \SOUL@setkern\SOUL@charkern
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@uleveryspace}
+% Set a given penalty and an underlined \cs{\space} equivalent.
+% The \cs{\null} prevents a nasty gap in |\textfrak| |{a \textswab{b}}|,
+% while it doesn't seem to hurt in all other cases. I didn't investigate
+% this.
+%
+% \begin{macrocode}
+\def\SOUL@uleveryspace#1{%
+ \SOUL@ulcolor{%
+ #1%
+ \SOUL@ulleaders
+ \hskip\spaceskip
+ }%
+ \null
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@uleveryhyphen}
+% If hyphenation takes place, output an underlined hyphen with the
+% required hyphen kerning value.
+%
+% \begin{macrocode}
+\def\SOUL@uleveryhyphen{%
+ \discretionary{%
+ \unkern
+ \SOUL@ulunderline{%
+ \SOUL@setkern\SOUL@hyphkern
+ \SOUL@sethyphenchar
+ }%
+ }{}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@uleveryexhyphen}
+% Underline the given hyphen, en-dash, em-dash or \cs{\slash} and care
+% for kerning.
+%
+% \begin{macrocode}
+\def\SOUL@uleveryexhyphen#1{%
+ \SOUL@setkern\SOUL@hyphkern
+ \SOUL@ulunderline{#1}%
+ \discretionary{}{}{%
+ \SOUL@setkern\SOUL@charkern
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@ulcolor}
+% \begin{macro}{\setulcolor}
+% Define the underline color or turn off coloring, in which case the lines are not
+% just colored black, but remain uncolored. This makes them appear
+% black, nevertheless, and has the advantage, that no Postscript
+% \cs{\specials} are cluttering the output.
+%
+% \begin{macrocode}
+\let\SOUL@ulcolor\relax
+\def\setulcolor#1{%
+ \if$#1$
+ \let\SOUL@ulcolor\relax
+ \else
+ \def\SOUL@ulcolor{\textcolor{#1}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\setuloverlap}
+% \begin{macro}{\SOUL@uloverlap}
+% Set the overlap amount, that helps to avoid gaps on sloppy output
+% devices.
+%
+% \begin{macrocode}
+\def\setuloverlap#1{\def\SOUL@uloverlap{#1}}
+\setuloverlap{.25pt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@ulsetup}
+% The underlining driver is quite simple. No need for \cs{\SOUL@postamble}
+% and \cs{\SOUL@everytoken}.
+%
+% \begin{macrocode}
+\def\SOUL@ulsetup{%
+ \SOUL@setup
+ \let\SOUL@preamble\SOUL@ulpreamble
+ \let\SOUL@everysyllable\SOUL@uleverysyllable
+ \let\SOUL@everyspace\SOUL@uleveryspace
+ \let\SOUL@everyhyphen\SOUL@uleveryhyphen
+ \let\SOUL@everyexhyphen\SOUL@uleveryexhyphen
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@textul}
+% Describing self-explanatory macros is \emph{so} boring!
+%
+% \begin{macrocode}
+\DeclareRobustCommand*\textul{\SOUL@ulsetup\SOUL@}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\setul}
+% \begin{macro}{\SOUL@uldepth}
+% \begin{macro}{\SOUL@ulthickness}
+% Set the underlining dimensions. Either value may be omitted and
+% lets the respective macro keep its current contents.
+%
+% \begin{macrocode}
+\def\setul#1#2{%
+ \if$#1$\else\def\SOUL@uldepth{#1}\fi
+ \if$#2$\else\def\SOUL@ulthickness{#2}\fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\resetul}
+% Set reasonable default values that fit most latin fonts.
+%
+% \begin{macrocode}
+\def\resetul{\setul{.65ex}{.1ex}}
+\resetul
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\setuldepth}
+% This macro sets all designated ``letters'' (\cs{\catcode=11}) or the
+% given material in a box and sets the underlining dimensions according
+% to the box depth.
+%
+% \begin{macrocode}
+\def\setuldepth#1{{%
+ \def\SOUL@n{#1}%
+ \setbox\z@\hbox{%
+ \tracinglostchars\z@
+ \ifx\SOUL@n\empty
+ \count@\z@
+ \loop
+ \ifnum\catcode\count@=11\char\count@\fi
+ \ifnum\count@<\@cclv
+ \advance\count@\@ne
+ \repeat
+ \else
+ #1%
+ \fi
+ }%
+ \dimen@\dp\z@
+ \advance\dimen@\p@
+ \xdef\SOUL@uldepth{\the\dimen@}%
+}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The \texorpdfstring{\st{overstriking}}{overstriking} driver}
+%
+% \begin{macro}{\SOUL@stpreamble}
+% Striking out is just underlining with a raised line of a different
+% color. Hence we only need to define the preamble accordingly and
+% let the underlining preamble finally do its job. Not that colored
+% overstriking was especially useful, but we want at least to keep
+% it black while we might want to set underlines in some fancy color.
+%
+% \begin{macrocode}
+\def\SOUL@stpreamble{%
+ \dimen@\SOUL@ulthickness
+ \dimen@i=-.5ex
+ \advance\dimen@i-.5\dimen@
+ \edef\SOUL@uldepth{\the\dimen@i}%
+ \let\SOUL@ulcolor\SOUL@stcolor
+ \SOUL@ulpreamble
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@stsetup}
+% We re-use the whole underlining setup and just replace the preamble
+% with our modified version.
+%
+% \begin{macrocode}
+\def\SOUL@stsetup{%
+ \SOUL@ulsetup
+ \let\SOUL@preamble\SOUL@stpreamble
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\textst}
+% These pretzels are making me thirsty \dots
+%
+% \begin{macrocode}
+\DeclareRobustCommand*\textst{\SOUL@stsetup\SOUL@}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@stcolor}
+% \begin{macro}{\setstcolor}
+% Set the overstriking color. This won't be used often, but is required
+% in cases, where the underlines are colored. You wouldn't want to
+% overstrike in the same color. Note that overstriking lines are
+% drawn \emph{beneath} the text, hence bright colors won't look good.
+%
+% \begin{macrocode}
+\let\SOUL@stcolor\relax
+\def\setstcolor#1{%
+ \if$#1$
+ \let\SOUL@stcolor\relax
+ \else
+ \def\SOUL@stcolor{\textcolor{#1}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection{The highlighting driver}
+%
+% \begin{macro}{\SOUL@hlpreamble}
+% This is nothing else than overstriking with very thick lines.
+%
+% \begin{macrocode}
+\def\SOUL@hlpreamble{%
+ \setul{}{2.5ex}%
+ \let\SOUL@stcolor\SOUL@hlcolor
+ \SOUL@stpreamble
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\SOUL@hlsetup}
+% No need to re-invent the wheel. Just use the overstriking setup
+% with a different preamble.
+%
+% \begin{macrocode}
+\def\SOUL@hlsetup{%
+ \SOUL@stsetup
+ \let\SOUL@preamble\SOUL@hlpreamble
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \begin{macro}{\texthl}
+% \begin{macro}{\sethlcolor}
+% \begin{macro}{\SOUL@hlcolor}
+% Define the highlighting macro and the color setting macro with a
+% simple default color. Yellow isn't really pleasing, but it's already
+% predefined by the \package{color} package.
+%
+% \begin{macrocode}
+\DeclareRobustCommand*\texthl{\SOUL@hlsetup\SOUL@}
+\def\sethlcolor#1{\if$#1$\else\def\SOUL@hlcolor{\textcolor{#1}}\fi}
+\sethlcolor{yellow}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \subsection*{The package postamble}
+%
+% \begin{macro}{\so}
+% \begin{macro}{\ul}
+% \begin{macro}{\st}
+% \begin{macro}{\hl}
+% \begin{macro}{\caps}
+% OK, I lied. The short macro names are just abbreviations for their
+% longer counterpart. Some people might be used to |\text*| style commands
+% to select a certain font. And then it doesn't hurt to reserve
+% these early enough.
+%
+% \begin{macrocode}
+\let\so\textso
+\let\ul\textul
+\let\st\textst
+\let\hl\texthl
+\let\caps\textcaps
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% When used in an environment other than \LaTeX\ and the \package{german}
+% package was already loaded, define the double quotes as accent.
+%
+% \begin{macrocode}
+\ifx\documentclass\@undefined
+ \ifx\mdqoff\@undefined
+ \else
+ \soulaccent{"}%
+ \fi
+ \catcode`\@=\atcode
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \noindent
+% If we have been loaded by a \LaTeX\ environment and the \package{color}
+% package wasn't also loaded, we disable all colors. Then we add the umlaut accent
+% |"| if the \package{german} package is present. The quotes character has to
+% be \cs{\catcode}'d \cs{\active} now, or it won't get recognized later.
+% The \option{capsdefault}
+% option overrides the \cs{\caps} driver and lets \cs{\SOUL@} set an underline.
+% Finally load the local configuration, process the |capsdefault|
+% option and exit.
+%
+% \begin{macrocode}
+\else
+ \bgroup
+ \catcode`\"\active
+ \AtBeginDocument{%
+ \@ifundefined{color}{%
+ \let\SOUL@color\relax
+ \let\setulcolor\@gobble
+ \let\setstcolor\@gobble
+ \let\sethlcolor\@gobble
+ \let\hl\ul
+ }{}
+ \@ifundefined{mdqoff}{}{\soulaccent{"}}
+ }
+ \egroup
+ \DeclareOption{capsdefault}{%
+ \AtBeginDocument{%
+ \def\SOUL@capsdfltfnt#1{%
+ \SOUL@ulsetup
+ \SOUL@ulpreamble
+ \scshape
+ }%
+ }%
+ }
+ \InputIfFileExists{soul.cfg}%
+ {\PackageInfo{soul}{Local config file soul.cfg used}}{}
+ \ProcessOptions
+\fi
+\endinput
+% \end{macrocode}
+%
+%
+%
+%
+%^^A--------------------------------------------------------------------
+%
+%
+%
+%
+% \vspace{2explus1fill}
+%\begin{verbatim}
+%$Id: soul.dtx,v 1.128 2003/11/17 22:57:24 m Rel $
+%\end{verbatim}
+% \Finale
+%
+%
+% ^^A.E.I.O.U.^^
+%^^A vim:ts=4:sw=4:et
diff --git a/Master/texmf-dist/source/latex/soul/soul.ins b/Master/texmf-dist/source/latex/soul/soul.ins
new file mode 100644
index 00000000000..451343f7dff
--- /dev/null
+++ b/Master/texmf-dist/source/latex/soul/soul.ins
@@ -0,0 +1,10 @@
+%% LaTeX2e file `soul.ins'
+%% generated by the `filecontents' environment
+%% from source `soul' on 2003/11/17.
+%%
+\def\batchfile{soul.ins}
+\input docstrip.tex
+\askforoverwritefalse
+\keepsilent % <-- this is for you, Christina ;-)
+\generate{\file{soul.sty}{\from{soul.dtx}{package}}}
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/splitindex/install.sh b/Master/texmf-dist/source/latex/splitindex/install.sh
new file mode 100644
index 00000000000..5d75fb85f7e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/install.sh
@@ -0,0 +1,178 @@
+#!/bin/sh
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ --prefix)
+ if [ $# -lt 2 ]; then
+ echo "$0: argument expected after --prefix" >&2
+ exit 1
+ else
+ prefix=$2
+ shift 2
+ fi
+ ;;
+ --prefix=*)
+ prefix=${1#--prefix=}
+ shift 1
+ ;;
+ --bindir)
+ if [ $# -lt 2 ]; then
+ echo "$0: argument expected after --bindir" >&2
+ exit 1
+ else
+ bindir=$2
+ shift 2
+ fi
+ ;;
+ --bindir=*)
+ bindir=${1#--bindir=}
+ shift 1
+ ;;
+ --mandir)
+ if [ $# -lt 2 ]; then
+ echo "$0: argument expected after --mandir" >&2
+ exit 1
+ else
+ mandir=$2
+ shift 2
+ fi
+ ;;
+ --mandir=*)
+ mandir=${1#--mandir=}
+ shift 1
+ ;;
+ --texmf)
+ if [ $# -lt 2 ]; then
+ echo "$0: argument expected after --texmf" >&2
+ exit 1
+ else
+ texmf=$2
+ shift 2
+ fi
+ ;;
+ --texmf=*)
+ texmf=${1#--texmf=}
+ shift 1
+ ;;
+ --version|-v)
+ echo "install.sh v0.1"
+ echo "Copyright (c) Markus Kohm 2002"
+ exit 0
+ ;;
+ --help|-h)
+ echo "Usage: install.sh [OPTIONS]"
+ echo
+ echo "Installs SplitIndex for all unix like environments."
+ echo
+ echo "OPTIONS:"
+ echo "--prefix=<DIR> install binaries at <DIR>/bin and manuals at <DIR>/man"
+ echo " (default: /usr/local)"
+ echo "--bindir=<DIR> install binaries at <DIR>"
+ echo "--mandir=<DIR> install manuals at <DIR>"
+ echo "--texmf=<DIR> install packages and TeX programs at <DIR>/tex/latex/misc,"
+ echo " documentation (dvi and pdf) at <DIR>/doc/latex/splitidx and"
+ echo " sources at <DIR>/source/latex/splitidx"
+ echo " (default: \$TEXMFLOCAL if you are root and \$HOMETEXMF if"
+ echo " you are not root)"
+ exit 0
+ ;;
+ --dist)
+ mkdir splitidx
+ cp -a splitindex splitindex-Linux-i386
+ cp -a splitindex.tex splitindex.pl splitindex.c splitindex.java \
+ splitindex.class splitindex.exe splitidx.dtx splitidx.ins \
+ splitindex-Linux-i386 splitindex-OpenBSD-i386 \
+ splitindex.1 install.txt manifest.txt install.sh \
+ README splitidx
+ tar jcvf splitidx-`date -I`.tar.bz2 splitidx
+ cd splitidx
+ ./install.sh --prefix ../chroot --texmf ../chroot/texmf
+ cd ..
+ rm -r splitidx
+ find chroot | sed 's/chroot\//+-/g;s/[a-z0-9]*\//-/g'
+ exit 0
+ ;;
+ *)
+ echo "unkown option \`$1'" >&2
+ echo "Try \`./install.sh --help' for more information." >&2
+ exit 1;
+ ;;
+ esac
+done
+
+case `uname -s -m` in
+ OpenBSD*i?86*)
+ cp -pf splitindex-OpenBSD-i386 splitindex
+ splitindex=splitindex
+ ;;
+ Linux*i?86*)
+ cp -pf splitindex-Linux-i386 splitindex
+ splitindex=splitindex
+ ;;
+ CYGWIN*i?86*)
+ splitindex=splitindex.exe
+ ;;
+ *)
+ if ! ./splitindex -V; then
+ echo 'Os '`uname -s -m`' not supported!'
+ echo 'Trying to compile the source:'
+ gcc -O3 -Wall -o splitindex splitindex.c || \
+ gcc -O3 -Wall -DNO_LONGOPT -o splitindex splitindex.c || \
+ echo 'You have to compile splitindex.c by your own!'
+ fi
+ if ./splitindex -V; then
+ splitindex=splitindex
+ fi
+ ;;
+esac
+
+if [ -z "$prefix" ]; then
+ prefix=/usr/local
+fi
+if [ -z "$bindir" ]; then
+ bindir=$prefix/bin
+fi
+if [ -z "$mandir" ]; then
+ mandir=$prefix/man
+fi
+if [ -z "$texmf" ]; then
+ if [ "r$USER" = "rroot" ]; then
+ texmf=`kpsexpand '$TEXMFLOCAL'`
+ else
+ texmf=`kpsexpand '$HOMETEXMF'`
+ fi
+ if [ -z "$texmf" ]; then
+ echo "kpsexpand '$TEXMFLOCAL' or kpsexpand '$HOMETEXMF' failed!" >&2
+ echo "You have to use option --texmf=<DIR>." >&2
+ echo "This error is fatal!" >&2
+ exit 1
+ fi
+fi
+
+latex splitidx.ins
+
+latex splitidx.dtx
+latex splitidx.dtx
+mkindex splitidx
+latex splitidx.dtx
+
+pdflatex splitidx.dtx
+pdflatex splitidx.dtx
+mkindex splitidx
+pdflatex splitidx.dtx
+
+install -m 755 -d $bindir
+install -m 755 -d $mandir/man1
+install -m 755 -d $texmf/tex/latex/misc
+install -m 755 -d $texmf/source/latex/splitidx
+install -m 755 -d $texmf/doc/latex/splitidx
+install -m 755 $splitindex splitindex.pl $bindir
+install -m 644 splitindex.class $bindir
+install -m 644 splitindex.1 $mandir/man1
+install -m 644 splitindex.tex splitidx.sty $texmf/tex/latex/misc
+install -m 644 splitidx.dvi splitidx.pdf $texmf/doc/latex/splitidx
+
+install README splitindex.c splitindex.java splitindex.exe \
+ splitindex-Linux-i386 splitindex-OpenBSD-i386 \
+ splitidx.dtx manifest.txt install.txt install.sh \
+ $texmf/source/latex/splitidx
diff --git a/Master/texmf-dist/source/latex/splitindex/splitidx.dtx b/Master/texmf-dist/source/latex/splitindex/splitidx.dtx
new file mode 100644
index 00000000000..68f775c2c26
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitidx.dtx
@@ -0,0 +1,1393 @@
+% \CheckSum{487}
+% \iffalse
+% ======================================================================
+% splitindex.dtx
+% Copyright (c) Markus Kohm, 2002
+%
+% $Id: splitidx.dtx,v 1.14 2003/01/05 10:50:42 mjk Exp $
+%
+% This file is part of the `SplitIndex bundle'.
+% ---------------------------------------------
+%
+% This file can be redistributed 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.
+%
+% You are not allowed to redistribute this file without all the
+% other files of the `SplitIndex bundle'. The list of all files
+% belonging to the `SplitIndex bundle' is given in the file
+% `manifest.txt'.
+% ======================================================================
+%
+%<*dtx>
+% \fi
+\ProvidesFile{splitidx.dtx}[%
+% \iffalse
+%</dtx>
+%<driver>\ProvidesFile{splitidx.drv}[%
+%<package>\ProvidesPackage{splitidx}[%
+% \fi
+ 2003/01/05 v0.2a multiple indices for LaTeX]
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{color,alltt}
+\newcommand*{\Prompt}{{\color{green}\textbf{\$}}}
+\newcommand*{\Package}{}\let\Package\textsf
+\newcommand*{\Class}{}\let\Class\textsf
+\newcommand*{\Program}{}\let\Program\textsf
+\newcommand*{\File}{}\let\File\texttt
+\newcommand*{\Cmdline}{}\let\Cmdline\texttt
+\providecommand*{\url}{\texttt}
+\CodelineIndex
+\RecordChanges
+\EnableCrossrefs
+\GetFileInfo{splitidx.dtx}
+\title{Creating More Than One Index Using \Package{splitidx} And
+ \Program{SplitIndex}\thanks{This file is version \fileversion{} of file
+ \File{\filename}. Nevertheless it should be stable.}}
+\author{Markus Kohm\thanks{Markus Kohm \textless kohm@gmx.de\textgreater}}
+\date{\filedate}
+\begin{document}
+\maketitle
+\begin{abstract}
+ With \Package{makeidx} there's a standard package at \LaTeX{} to create
+ one index to each document. But some times more than one index is
+ needed. There are different packages with different solutions and different
+ problems to achieve multiple indices. Here is one more.
+\end{abstract}
+\tableofcontents
+\DocInput{splitidx.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \DoNotIndex{\DeclareOption,\AtEndOfPackage,\renewcommand,\g@addto@macro}
+% \DoNotIndex{\renewcommand,\ProcessOptions,\relax,\newcommand,\emph}
+% \DoNotIndex{\providecommand,\@bsphack,\@esphack,\@sanitize,\typeout}
+% \DoNotIndex{\begingroup,\endgroup,\jobname,\ifx,\else,\fi,\expandafter}
+% \DoNotIndex{\csname,\endcsname,\protected@write,\AtBeginDocument}
+% \DoNotIndex{\ifHy@hyperindex,\@indexfile,\thepage,\Hy@temp@A}
+% \DoNotIndex{\HyInd@ParenLeft,\HyInd@ParenRight,\string,\@ifstar,\@input@}
+% \DoNotIndex{\@ifnextchar,\edef,\let,\@empty,\@for,\@tempa,\xdef,\def}
+% \DoNotIndex{\catcode,\lowercase,\do,\@ifundefined,\PackageError}
+% \DoNotIndex{\MessageBreak,\gdef,\@namedef,\setcounter,\@gobble.\-,\\}
+% \DoNotIndex{\@onlypreamble,\@tempb,\@wrindex,\immediate,\newif,\newwrite}
+% \DoNotIndex{\openout,\@gobble}
+%
+% \section{Introduction}
+%
+% First of all you have to know how index generation normally would be
+% done. Read \cite{makeindex} and e.g. \cite{makeindexmanual} if you
+% don't.
+%
+% Generally you load a package e.g. \Package{makeidx}, put \cs{index} commands
+% into your document, which are written as \cs{indexentry} commands to the raw
+% index file ``\File{\cs{jobname}.idx}''. Then you call an \emph{index
+% processor} like \Program{MakeIndex} or \Program{xindy}, which generates a
+% sorted index file ``\File{\cs{jobname}.ind}''. This will be included with a
+% command like \cs{printindex} at the end of your document.
+%
+% Most packages, which allows more than one index, open more than one raw
+% index file. Each of these files costs a write file handle. \TeX{} has only
+% 16 of these. \LaTeX{} itself needs some of these for e.g. \File{.aux},
+% \File{.toc}, \File{.lot}, \File{.lof} and maybe other more or less temporary
+% files depends on what you are doing. With package option \texttt{split}
+% package \Package{splitidx} works like those packages.
+%
+% Without option \texttt{split} the \Package{splitidx} package needs only one
+% raw index file like \Package{makeidx} would. This one raw index files
+% contains all the index entries for all the indices you defined. But to do so
+% \Package{splitidx} and the index processor need help. Before calling the
+% index processor the one raw index file has to be splitted into multiple raw
+% index files. Each of these contains the index entries of one index. This
+% splitting can be done with the \Program{splitindex} program.
+%
+% There is not only one \Program{SplitIndex} program, there are
+% \Program{SplitIndex} programs in different programming languages:
+% \begin{description}
+% \item[\Program{splitindex.pl}] This is written in perl. You need a perl
+% interpreter to run it. If you are a Unix user, you have a perl interpreter
+% and you can call \Program{splitindex.pl} like you would call a binary
+% program or a shell script from your shell. This is the reference
+% implementation. I prefers to use this\,---\,because it was the first, the
+% easiest and the shortest to be written.
+% \item[\Program{splitindex.jar}] This is written using Sun Java 1.4.1. You
+% can find the source at \File{splitindex.java}. I wrote it, because Java is
+% everywhere and may be installed everywhere and a lot of people are able to
+% understand Java source files. But if you don't have Sun Java 1.4 the start
+% of this program will result in errors\,---\,e.g.
+% \begin{quote}
+% \texttt{Exception in thread "main" java.util.zip.ZipException: No such
+% file or directory}
+% \end{quote}
+% if you try to start it with Sun Java 1.3.
+% \item[\Program{splitindex-Linux-i386}] This is a Linux-i386-ELF binary from
+% the C source file \File{splitindex.c}. It will be renamed to
+% \Program{splitindex} during installation, if you are using Linux-i386. At
+% section~\ref{C} you find a introduction in how to compile
+% \File{splitindex.c} yourself e.g. if you are using Linux-PPC. I wrote the
+% C source, because a lot of people like to have a binary and most software
+% authors understand C and some people want fast binaries instead of slow
+% Java bit code\,---\,even, if the Java program is fast enough.
+% \item[\Program{splitindex-OpenBSD-i386}] This is a OpenBSD-i386 binary from
+% the C source file \File{splitindex.c}. It will be renamed to
+% \Program{splitindex} during installation, if you are using
+% OpenBSD-i386. It is almost the same like
+% \Program{splitindex-Linux-i386}\,---\,but it doesn't understand long
+% option names.
+% \item[\Program{splitindex.exe}] This is a CygWin binary from the C source
+% file \File{splitindex.c}. A CygWin binary is a Windows (Win32) binary
+% using the CygWin DLL. At section~\ref{C} you find a introduction in how to
+% use a CygWin binary without installing a whole CygWin
+% environment\,---\,nevertheless it is nice to have a almost complete
+% CygWin.
+% \item[\Program{splitindex.tex}] This is a \TeX{} version of the
+% program. Yes, you are right: it is a program written in \TeX{}. It has not
+% the whole functionality of the other programs (see section~\ref{TeX}), but
+% it is system independent and you don't need to install a other program
+% like perl or Sun Java 1.4. It is not impossible to fix all the
+% disadvantages of this program\,---\,but it isn't easy and much more work
+% than all the other program.
+% \end{description}
+% Without the \TeX{} version of \Program{splitindex} all of these programs are
+% also able to call the index processor after creating the raw index files.
+%
+% And where is the lisp, the smalltalk, the prolog, the \dots{} version of
+% \Program{splitindex}? Hey, four languages are enough for me! If you need one
+% more, write it!
+%
+%
+% \section{Using the \Package{splitidx} package}
+% \label{package}
+%
+%
+% \subsection{Generating a raw index}
+%
+% You may use \Package{splitidx} as a drop-in-replacement for
+% \Package{makeidx}. If you do so, you just have to replace:
+% \begin{verbatim}
+% \usepackage{makeidx}
+% \end{verbatim}\vspace{-\baselineskip}
+% by
+% \begin{verbatim}
+% \usepackage{splitidx}
+% \end{verbatim}\vspace{-\baselineskip}
+%
+% \DescribeMacro{\makeindex}
+% To activate index generation you may use \cs{makeindex}, which is declared
+% by the \LaTeX{} kernel.
+% You may also load the package with option
+% \texttt{makeindex}:
+% \begin{verbatim}
+% \usepackage[makeindex]{splitidx}
+% \end{verbatim}\vspace{-\baselineskip}
+% which is almost the same like:
+% \begin{verbatim}
+% \usepackage{splitidx}\makeindex
+% \end{verbatim}\vspace{-\baselineskip}
+%
+% \DescribeMacro{\index}
+% After loading the package you may use command \cs{index}. You can find the
+% description of the argument and features of this command at
+% \cite{makeindex}. The \Program{splitindex} programs (see
+% section~\ref{program}) put all index entries, which are produced with
+% \cs{index} to the index with shortcut ``\texttt{idx}''.
+%
+% \DescribeMacro{\sindex}
+% The \Package{splitidx} package also defines the command \cs{sindex} with the
+% syntax:
+% \begin{quote}
+% \cs{sindex}\oarg{shortcut}\marg{index-entry}
+% \end{quote}
+% to be used to put an index
+% entry into the index with the optional given shortcut. If you omit optional
+% \meta{shortcut} the shortcut ``\texttt{idx}'' will be used.
+% If you use \cs{sindex} you need to split the raw index file into several raw
+% index files, before generating the index with an index processor like
+% \Program{MakeIndex}. See section~\ref{program} for more information about
+% splitting the raw index file.
+%
+% The shortcut is used not only to distinguish between the different
+% indices. It is also used as part of the name of the raw index file generated
+% by a \Program{splitindex} program (see section~\ref{program}) and the
+% corresponding index file generated by an index processor like
+% \Program{MakeIndex} (see \cite{makeindexmanual}). So you should not use
+% characters or symbols at \meta{shortcut} which are not allowed at
+% filenames. At file systems, which are not case sensitive, you should not mix
+% upper and lower case letters. Best would be, if you'll use only lower case
+% letters.
+%
+% Under some unfortunate circumstances you may be forced to put all your index
+% entries back to one index. The easiest way to do this without changing all
+% \cs{sindex} commands into \cs{index} commands is the package option
+% \texttt{allatone}. If you load the package with:
+% \begin{verbatim}
+% \usepackage[allatone]{splitidx}
+% \end{verbatim}\vspace{-\baselineskip}
+% or
+% \begin{verbatim}
+% \usepackage[allatone,makeindex]{splitidx}
+% \end{verbatim}\vspace{-\baselineskip}
+% \cs{sindex}\oarg{shortcut}\marg{indexentry} will result in
+% \cs{index}\marg{indexentry}.
+%
+%
+% \subsection{Printing an index}
+%
+% \DescribeMacro{\newindex}
+% If you want to generate more than one index without shortcut, you should
+% declare this using \cs{newindex} with syntax:
+% \begin{quote}
+% \cs{newindex}\oarg{index name}\marg{shortcut}.
+% \end{quote}
+% The mandatory argument \meta{shortcut} is used to distinguish the different
+% indices. See description of \cs{sindex} for more information about this. The
+% optional argument \meta{index name} is the name of the index. This is also
+% the default heading of this index used from \cs{printindex} and
+% \cs{printsubindex}. If you omit \meta{index name} the shortcut will be used
+% as index name.
+%
+% Some people do not like to call an extra program like
+% \Program{splitindex}. For those the package option \texttt{split} has been
+% implemented. With this option \Package{splitidx} opens a new file for each
+% index, which is declared using \cs{newindex}. If you are using this option,
+% you have to declare all indices you want to use at the preamble of your
+% document. This also uses the default \File{idx} file for index entries to
+% index with shortcut \texttt{idx}. The number of index files, you can open is
+% limited, if you are using this option. This is because of the limitation of
+% output streams \TeX{} provides. With this option not only \cs{newindex} may
+% result in an error but also \cs{tableofcontents}, \cs{listoffigures},
+% \cs{listoftables} and each other command, which allocates an output stream.
+%
+% Some people do not like to write \cs{sindex[foo]}\marg{entry}. They want to
+% write \cs{foo}\marg{entry}. For those of you the package option
+% `\texttt{idxcommands}' has been implemented. This defines a command with the
+% name of the \meta{shortcut} for each declared index. If you are using this
+% option, you'll get an error, if a shortcut is the name of an already defined
+% command. And if you are using this option, the characters of the shortcuts
+% must be letters.
+%
+%
+% \DescribeMacro{\printindex}
+% \changes{v0.2a}{2003/01/05}{fix of documentation bug}
+% The \cs{printindex} command is used to print one index or all indices, which
+% are declared using \cs{newindex}. How it behaves depends on the syntax you
+% are using.
+%
+% With syntax
+% \begin{quote}
+% \cs{printindex}\oarg{shortcut}\oarg{index name}
+% \end{quote}
+% the index file with the optional shortcut will be loaded and titled with
+% optional given index name. If \meta{index name} is omitted the default index
+% name declared with \cs{newindex} will be used.
+%
+% If the both optional arguments, \meta{shortcut} and \meta{index name}, are
+% omitted and you are using simply
+% \begin{quote}
+% \cs{printindex}
+% \end{quote}
+% it behaves like \cs{printindex} from package \Package{makeidx}. You should
+% not use this, if you are using \cs{sindex} with optional argument.
+%
+% You may also print all indices, which were declared using \cs{newindex}. Use
+% syntax:
+% \begin{quote}
+% \cs{printindex*}
+% \end{quote}
+% to do so. The indices will be printed in the order you declared them using
+% \cs{newindex}.
+%
+% \cs{printindex} uses the default index output of the class and the
+% index processor you are using. Most this will be \texttt{theindex}
+% environment, but it needn't. But \cs{printindex} will fail to set the name
+% of the index if \cs{indexname} isn't use to print the name of the
+% index. This would be a failure of the class not of the \Package{splitidx}
+% package. I don't know any class with this failure.
+%
+%
+% \DescribeMacro{\printsubindex}
+% The \cs{printsubindex} command behaves like \cs{printindex} with same syntax
+% but it does some redefinitions before printing the index, to:
+% \begin{itemize}
+% \item use \cs{section} instead of \cs{chapter} level at classes, which have
+% \cs{chapter} and \cs{subsection} instead of \cs{section} level at classes,
+% which haven't \cs{chapter},
+% \item deactivate \cs{onecolumn}, \cs{twocolumn} and \cs{clearpage},
+% \cs{cleardoublepage} to start a new page at each index,
+% \item change the mark mechanism not to use \cs{markboth} but \cs{markright}
+% for setting up the running headline.
+% \end{itemize}
+% Using this you can print multiple indices at one chapter, if you are using a
+% class with \cs{chapter}, or at one section, if you are using a class without
+% \cs{chapter}.
+%
+%
+% \DescribeMacro{\setindexpreamble}
+% If you are using a KOMA-Script class, you'll know this command. Package
+% \Package{splitidx} redefines this command to syntax:
+% \begin{quote}
+% \cs{setindexpreamble}\oarg{shortcut}\marg{preamble}
+% \end{quote}
+% So you can define a preamble for each index. Note: Package
+% \Package{splitidx} doesn't print the preamble itself. But it lets
+% \cs{index@preamble} to be the preamble of the index with the actual
+% shortcut, before printing an index using \cs{printindex} or
+% \cs{printsubindex}.
+%
+%
+% \DescribeMacro{\useindexpreamble}
+% If you are defining your own index environment or if you extend
+% \texttt{theindex} environment using e.g. \cs{extendtheindex}, you may use
+% \cs{useindexpreamble} with syntax:
+% \begin{quote}
+% \cs{useindexpreamble}\oarg{additional commands}
+% \end{quote}
+% to print the preamble of the actual index, which was set using
+% \cs{setindexpreamble}. This is not related to the KOMA-Script classes, it
+% can also be used e.g. with the standard classes. The commands from optional
+% argument \meta{additional commands} are only used, if the preamble is
+% defined and not empty.
+%
+%
+% \DescribeMacro{\indexshortcut}
+% The macro \cs{indexshortcut} is only defined at \cs{printindex} and
+% \cs{printsubindex}. It expands to the shortcut of the actual index. So you
+% may use it at your own index environment or extending the \texttt{theindex}
+% environment using e.g. \cs{extendtheindex}.
+%
+%
+% \DescribeMacro{\extendtheindex}
+% Most classes define the environment \texttt{theindex} to be used for
+% printing the index. Using \cs{extendtheindex} with syntax
+% \begin{quote}
+% \cs{extendtheindex}\marg{before begin}\marg{after begin}^^A
+% \marg{before end}\mbox{\marg{after end}}
+% \end{quote}
+% you may extend this command. The commands from \meta{before begin} are used
+% at \cs{begin\{theindex\}} just after starting the group but before starting
+% the index. The commands from \meta{after begin} are used after
+% \cs{begin\{theindex\}}. The commands from \meta{before end} are used before
+% \cs{end\{theindex\}}. The commands from \meta{after end} are used at
+% \cs{end\{theindex\}} just after ending the index but just before ending the
+% group.
+%
+%
+% \subsection{Examples}
+% \label{examples}
+%
+% Let's see how you may get more than one index. The text of the example is
+% silly, so don't think about the text, think about the usage of
+% \Package{splitidx}.
+%
+% \begin{flushleft}\ttfamily
+% \cs{documentclass}\{article\} \percentchar \textit{ We use \Class{article}
+% class \dots}\\
+% \cs{usepackage}\{splitidx\} \percentchar \textit{ \dots\ and the
+% \Package{splitidx} package}\\
+% \cs{makeindex} \percentchar \textit{ And we want index generation}\\
+% ~\\
+% \percentchar \textit{ We define 4 indices:}\\
+% \cs{newindex}[General Index]\{idx\} \percentchar \textit{ Name and shortcut
+% of the 1st index}\\
+% \cs{newindex}[Index of Animals]\{ani\} \percentchar \textit{ \dots\ 2nd
+% index}\\
+% \cs{newindex}[Index of Fruits]\{fru\} \percentchar \textit{ \dots\ 3rd
+% index}\\
+% \cs{newindex}[Index of Vegetables]\{veg\} \percentchar \textit{ \dots\ 4th
+% index}\\
+% ~\\
+% \cs{begin}\{document\}\\
+% Apples\cs{sindex}[fru]\{apple\} \percentchar \textit{ an entry to
+% }fru\texttt{ index}\\
+% and oranges\cs{sindex}[fru]\{orange\} \percentchar \textit{ an entry to
+% }fru\texttt{ index}\\
+% are fruits\cs{sindex}\{fruits\}.\ \percentchar \textit{ an implicit entry
+% to }idx\textit{ index}\\
+% Tomatoes\cs{sindex}[veg]\{tomato\} \percentchar \textit{ an entry to
+% }veg\textit{ index}\\
+% are\\
+% vegetables\cs{index}\{vegetables\}.\ \percentchar \textit{ an implicit
+% entry to }idx\textit{ index}\\
+% Cats\cs{sindex}[ani]\{cat\} \percentchar \textit{ an entry to
+% }ani\textit{ index}\\
+% are animals\cs{sindex}[idx]\{animals\}.\ \percentchar \textit{ an explicite
+% entry to }idx\textit{ index}\\
+% ~\\
+% \cs{printindex*} \percentchar \textit{ print all indices}\\
+% \cs{end}\{document\}
+% \end{flushleft}
+% After processing the file above with \LaTeX{} you'll get a raw index file
+% with following contents:
+% \begin{verbatim}
+% \indexentry[fru]{apple}{1}
+% \indexentry[fru]{orange}{1}
+% \indexentry{fruits}{1}
+% \indexentry[veg]{tomato}{1}
+% \indexentry{vegetables}{1}
+% \indexentry[ani]{cat}{1}
+% \indexentry[idx]{animals}{1}
+% \end{verbatim}\vspace{-\baselineskip}
+% Section~\ref{program} shows, how you can process this raw index file to get
+% several raw index files and several index files. You will get four index
+% files. Each of it will be input with the single \cs{printindex*} command at
+% the example above. Each will produce a single section starting on an new
+% page with one column section headings ``General Index'', ``Index of
+% Animals'', ``Index of Fruits'' and ``Index of Vegetables''. Each index is
+% printed in twocolumn mode.
+%
+% Maybe you would like to have all indices being subsections at one
+% section. You can do this, if you replace the \cs{printindex*} command at the
+% example above by the following:
+% \begin{flushleft}\ttfamily
+% \cs{twocolumn}[\percentchar\textit{ set the title onecolumn}\\
+% \ \cs{section*}\{Indices\} \percentchar\textit{ the section with the
+% indices}\percentchar\\
+% \ \cs{markboth}\{Indices\}\{Indices\} \percentchar\textit{ setting up the
+% running headline }\percentchar\\
+% ]\percentchar\textit{ but the indices twocolumn}\\
+% \cs{printsubindex*} \percentchar\textit{ print all indices}
+% \end{flushleft}
+% Note that I've used \cs{printsubindex*} instead of \cs{printindex*} at this
+% modification. You don't need to setup the running headline, if you are using
+% page style \texttt{plain}, which is default at \Class{article} class. But if
+% you're using page style \texttt{headings} you should do this, if you are
+% using \cs{section*}. If you are using a KOMA-Script class, you can use
+% \cs{addsec} or \cs{addsec*} instead of \cs{section*} to not need manual
+% updating of the running headline.
+%
+% Maybe you want the general index to be the section, while the other indices
+% should be subsections of the general index. Maybe you'll try to replace the
+% above by the following:
+% \begin{flushleft}\ttfamily
+% \percentchar\textit{\#\#\#\#\# This will not do the thing you wanted!
+% \#\#\#\#\#}\\
+% \cs{printindex}[idx] \percentchar\textit{ print index }idx\textit{ as
+% section}\\
+% \cs{printsubindex}[ani] \percentchar\textit{ print index }ani\textit{ as
+% subsection}\\
+% \cs{printsubindex}[fru] \percentchar\textit{ print index }fru\textit{ as
+% subsection}\\
+% \cs{printsubindex}[veg] \percentchar\textit{ print index }veg\textit{ as
+% subsection}\\
+% \end{flushleft}
+% But this will result in a twocolumn section with general index \texttt{idx}
+% and three onecolumn subsections with the other indices and a page break
+% after the general index. Why? At the end of \texttt{theindex} environment of
+% \cs{printindex} the onecolumn mode, which was valid before \cs{printindex}
+% will be restored. If twocolumn mode was valid before \cs{printindex} a
+% \cs{clearpage} command will be included at the end of \texttt{theindex}.
+% So what's the solution? Remembering the \cs{extendtheindex} command you can
+% write:
+% \begin{flushleft}\ttfamily
+% \cs{begingroup} \percentchar\textit{ hold following extension local to this
+% group}\\
+% \ \cs{extendtheindex}\percentchar \textit{ some changes of
+% }theindex\textit{ environment}\\
+% \ \ \{\}\percentchar\textit{ no change before beginning}\\
+% \ \ \{\}\percentchar\textit{ no change after beginning}\\
+% \ \ \{\cs{let}\cs{onecolumn}\cs{relax} \percentchar\textit{ deactivate
+% \cs{onecolumn} before ending}\\
+% \ \ \ \cs{let}\cs{clearpage}\cs{relax} \percentchar\textit{ deactivate
+% \cs{clearpage} before ending}\\
+% \ \ \}\percentchar \textit{ changes before ending}\\
+% \ \ \{\}\percentchar\textit{ no change after ending}\\
+% \ \cs{printindex}[idx] \percentchar\textit{ print index }idx\textit{ as
+% section}\\
+% \cs{endgroup} \percentchar\textit{ end group with extended }theindex\textit{
+% environment}\\
+% \cs{printsubindex}[ani] \percentchar\textit{ print index }ani\textit{ as
+% subsection}\\
+% \cs{printsubindex}[fru] \percentchar\textit{ print index }fru\textit{ as
+% subsection}\\
+% \cs{printsubindex}[veg] \percentchar\textit{ print index }veg\textit{ as
+% subsection}\\
+% \cs{onecolumn} \percentchar\textit{ finish the indices}
+% \end{flushleft}
+% With this extension the whole index will be set twocolumn with no page break
+% before the first subsection. But you have to switch back to onecolumn mode
+% manually at the end of the indices.
+%
+% The example above may be modified, if you want a onecolumn index:
+% \begin{flushleft}\ttfamily
+% \cs{begingroup} \percentchar\textit{ hold following extension local to this
+% group}\\
+% \ \cs{makeatletter} \percentchar\textit{ allow }@\textit{ at macro names}\\
+% \ \cs{extendtheindex}\percentchar \textit{ some changes of
+% }theindex\textit{ environment}\\
+% \ \ \{\cs{let}\cs{twocolumn}\cs{@firstoptofone} \percentchar\textit{
+% deactivate \cs{twocolumn}}\\
+% \ \ \ \cs{let}\cs{onecolumn}\cs{@firstoptofone} \percentchar\textit{
+% deactivate \cs{twocolumn}}\\
+% \ \ \ \cs{let}\cs{clearpage}\cs{relax} \percentchar\textit{ deactivate
+% \cs{clearpage}}\\
+% \ \ \}\percentchar \textit{ changes before beginning}\\
+% \ \ \{\}\percentchar\textit{ no change after beginning}\\
+% \ \ \{\}\percentchar\textit{ no change before ending}\\
+% \ \ \{\}\percentchar\textit{ no change after ending}\\
+% \ \cs{makeatother} \percentchar\textit{ deactivate \cs{makeatletter}}\\
+% \ \cs{printindex} \percentchar\textit{ print index}\\
+% \cs{endgroup} \percentchar\textit{ end group with extended }theindex\textit{
+% environment}
+% \end{flushleft}
+% This not only works with splitted index. You may use this also with one
+% single index.
+%
+% I hope, that these examples were useful to understand, how to use
+% \Package{splitidx}. Next section will show you, how to generate the indices
+% from a single raw index.
+%
+%
+% \section{Splitting the index}
+% \label{program}
+%
+% At most you'll call one of the \Program{splitindex} programs with one
+% parameter, the name of the raw index file, to split the raw index file into
+% several raw index files and call the index processor
+% \Program{MakeIndex}. Some of you will also set options to use another index
+% processor e.g. \Program{xindy} or to set some options of the index processor
+% e.g. ``\Cmdline{-g}'' to use German sorting with \Program{MakeIndex}. Only
+% few of you will also change the parsing of the raw index file and the
+% generation if the filenames and contents of the several new raw index files.
+%
+% The names of the options and the syntax of the Arguments is same at all of
+% the programs except \Program{splitindex.tex} (see section~\ref{TeX}):
+% \begin{description}\setlength{\labelsep}{1em}
+% \item[\texttt{--help}]
+% \item[{\makebox[1.2em][l]{\texttt{-h}}}]\vspace{-2\itemsep}
+% Show information about usage, options and arguments and terminate without
+% processing a index file.
+% \item[\texttt{--makeindex} \meta{program name}]~
+% \item[\texttt{-m} \meta{program name}]\vspace{-2\itemsep}
+% Call \meta{program name}
+% instead of \Program{makeindex} to process each generated raw index
+% file. You may set this variable to an empty value. How this may be done
+% depends on the shell, which you are using. Using bash you may achieve an
+% empty value e.g. using \texttt{""} or \texttt{''}. An empty value means:
+% Don't call an index processor.
+% \item[\texttt{--identify} \meta{regular expression}]~
+% \item[\texttt{-i} \meta{regular expression}]\vspace{-2\itemsep}
+% Uses \meta{regular
+% expression} to identify the index short cut and the contents of the
+% raw index file with this shortcut. The default value is:
+% ``\verb|^(\\indexentry)\[([^]]*)\](.*)$|''. This means:
+% \begin{description}
+% \item[{\makebox[1em][l]{\texttt{\textasciicircum}}}]
+% Search from beginning of the line.
+% \item[\texttt{(\string\\indexentry)}]~\par
+% Search for ``\verb|\indexentry|'' and
+% set group 1 to this.
+% \item[{\makebox[1em][l]{\texttt{\string\[}}}]
+% Search for ``\verb|[|'' and ignore it.
+% \item[\texttt{([\textasciicircum]]*)}]~\par
+% Search for any character which is not ``]'' and set group 2 to this.
+% \item[{\makebox[1em][l]{\texttt{\string\]}}}]
+% Search for ``\verb|]|'' and ignore it.
+% \item[\texttt{(.*)\$}]~\par
+% Search for all characters till end of line and set group 3 to these.
+% \end{description}
+% The \meta{regular expression} is POSIX~1003.2 compatible.
+% \item[\texttt{--resultis} \meta{pattern}]~
+% \item[\texttt{-r} \meta{pattern}]\vspace{-2\itemsep}
+% Set the lines, which are written to the
+% generated raw index files after identification (see option
+% \texttt{--identify}) to \meta{pattern}. Each \texttt{\$}\meta{digit} at
+% \meta{pattern} will be replaced by the corresponding group, e.g. \verb|$1|
+% will be replaced by the first group (see \texttt{--identify}). The default
+% is: ``\verb|$1$3|'', which means: contents of group 1 and group 3.
+%
+% If the \meta{regular expression} of option \texttt{--identify} doesn't
+% match a line at the raw index file the line itself will be written.
+% \item[\texttt{--suffixis} \meta{pattern}]~
+% \item[\texttt{-s} \meta{pattern}]\vspace{-2\itemsep}
+% Set the suffix of the names of the generated raw index files after
+% identification (see option \texttt{--identify}) to \meta{pattern}. Each
+% \texttt{\$}\meta{digit} at \meta{pattern} will be replaced by the
+% corresponding group, e.g. \verb|$1| will be replaced by the first group
+% (see \texttt{--identify}). The default is: ``\verb|-$2|'', which means:
+% character `\texttt{-}' followed by contents of group 2.
+%
+% If the \meta{regular expression} of option \texttt{--ifentify} doesn't
+% match a line at the raw index file, all groups will be set to
+% ``\texttt{idx}''.
+% \item[\texttt{--verbose}]
+% \item[{\makebox[1.2em][l]{\texttt{-v}}}]\vspace{-2\itemsep}
+% Increase verbosity by one. More verbose means: tell the user more about,
+% what the program is doing.
+% \item[\texttt{--version}]
+% \item[{\makebox[1.2em][l]{\texttt{-V}}}]\vspace{-2\itemsep}
+% Show information about program version and terminate without processing a
+% index file.
+% \end{description}
+% The OpenBSD binary \Program{splitindex-OpenBSD-i386} doesn't understand the
+% long option names (\texttt{--makeindex}, \texttt{--identify} \dots). But you
+% can use the alternative short option names (\texttt{-m}, \texttt{-i} \dots).
+%
+% The first no-option-argument at the command line is the name if the raw
+% index file, which has to be processed. All arguments, which follow the
+% argument ``\texttt{--}'' are interpreted as no-optional-arguments. All but
+% the first no-option-arguments will be passed to the index processor.
+%
+% You will find some examples at the following subsections.
+%
+%
+% \subsection{Using \Program{splitindex.pl}}
+% \label{perl}
+%
+% This is the reference implementation. Let's use an example to demonstrate,
+% how it works. If you have following \LaTeX{} file ``\File{allabout.tex}'':
+% \begin{verbatim}
+% \documentclass{article}
+% \usepackage[makeindex]{splitidx}
+% \begin{document}
+% Apples\sindex[fru]{apple} and oranges\sindex[fru]{orange} are
+% fruits\sindex{fruits}.
+% Tomatos\sindex[veg]{tomato} are vegetables\sindex{vegetables}.
+% Cats\sindex[ani]{cat} are animals\sindex[idx]{animals}.
+% \end{document}
+% \end{verbatim}\vspace{-\baselineskip}
+% this generates a file ``File{allabout.idx}'':
+% \begin{verbatim}
+% \indexentry[fru]{apple}{1}
+% \indexentry[fru]{orange}{1}
+% \indexentry{fruits}{1}
+% \indexentry[veg]{tomato}{1}
+% \indexentry{vegetables}{1}
+% \indexentry[ani]{cat}{1}
+% \indexentry[idx]{animals}{1}
+% \end{verbatim}\vspace{-\baselineskip}
+%
+% This file can't be processed by a index processor like
+% \Program{MakeIndex}. If you want so split these raw index file into several
+% and run the default index processor, you do the following call (the
+% \Prompt{} is a symbol for the shell prompt):
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl allabout.idx|
+% \end{quote}
+% You may omit the extension ``\File{.idx}'':
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl allabout|
+% \end{quote}
+% Both commands will result in a file \File{allabout-fru.idx}:
+% \begin{verbatim}
+% \indexentry[fru]{apple}{1}
+% \indexentry[fru]{orange}{1}
+% \end{verbatim}\vspace{-\baselineskip}
+% a file \File{allabout-idx.idx}
+% \begin{verbatim}
+% \indexentry{fruits}{1}
+% \indexentry{vegetables}{1}
+% \indexentry{animals}
+% \end{verbatim}\vspace{-\baselineskip}
+% a file \File{allabout-veg.idx}:
+% \begin{verbatim}
+% \indexentry[veg]{tomato}{1}
+% \end{verbatim}\vspace{-\baselineskip}
+% and a file \File{allabout-ani.idx}:
+% \begin{verbatim}
+% \indexentry[ani]{cat}{1}
+% \end{verbatim}\vspace{-\baselineskip}
+% After generation of these files, it calls the default index processor using
+% the command lines:
+% \begin{verbatim}
+% makeindex allabout-fru.idx
+% makeindex allabout-idx.odx
+% makeindex allabout-veg.idx
+% makeindex allabout-ani.idx
+% \end{verbatim}\vspace{-\baselineskip}
+% These calls create the raw index files \File{allabout-fru.ind},
+% \File{allabout-idx.ind}, \File{allabout-veg.ind} and
+% \File{allabout-ani.ind}, which can be loaded to the document using
+% e.g. \cs{printindex} from package \Package{splitidx}.
+%
+% If you don't want \Program{splitindex} to call any index processor, use
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl -m "" allabout|
+% \end{quote}
+% instead of the shell command above.
+%
+% You may achieve the same files like above using (it's one input line not two
+% like shown here):
+% \begin{quote}\raggedright
+% \Prompt{}\verb|splitindex.pl -i '^\\indexentry\[([^]]*)\](.*)$'|
+% \verb|-s '-$1'| \verb|-r '\\indexentry$2' allabout|
+% \end{quote}
+%
+% If you want \Program{splitindex} to call \Program{makeindex} with additional
+% options ``\verb|-s foo.ist|'' to use the MakeIndex style file
+% \File{foo.ist}, you can do this call:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl allabout -- -s foo.ist|
+% \end{quote}
+% As you see ``\verb|--|'' is used to tell \Program{splitindex} to not
+% interprete ``\verb|-s foo.ist|'' as option ``\verb|--suffixis foo.ist|''.
+% All \Program{splitindex} options must be put before ``\verb|--|'' but you
+% can put the raw file argument ``\verb|allabout|'' after that:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl -- allabout -s foo.ist|
+% \end{quote}
+%
+% If you want so use index processor \Program{xindy} instead of default index
+% processor \Program{MakeIndex} you can do this call:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl -m xindy allabout|
+% \end{quote}
+% If this is not at the standard \texttt{PATH} you may set the whole path:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl -m /home/me/bin/xindy allabout|
+% \end{quote}
+% With most perl implementations perl module \verb|Getopt::Long| allows to
+% put options after no-option-arguments. So you may also write:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.pl allabout -m /home/me/bin/xindy|
+% \end{quote}
+% with the same result.
+%
+%
+% \subsection{Using \Program{splitindex.jar}}
+% \label{Java}
+%
+% This should also be portable. If you are not using Sun Java 1.4.1 you may
+% try to recompile this using the shell command:
+% \begin{quote}
+% \Prompt{}\verb|javac splitindex.java|
+% \end{quote}
+% This should result in a new \File{splitindex.class}. But it will fail
+% e.g. with Sun Java 1.3, because regular expressions are needed, which are
+% not available at Sun Java 1.3.
+%
+% The call of \Program{splitindex.class} is almost the same like shown at
+% section~\ref{perl} for \Program{splitindex.pl}, but you have to replace
+% ``\verb|splitindex.pl|'' by ``\verb|java splitindex|''. So the last example
+% from section~\ref{perl} becomes:
+% \begin{quote}
+% \Prompt{}\verb|java splitindex allabout -m /home/me/bin/xindy|
+% \end{quote}
+%
+%
+% \subsection{Using \Program{splitindex} or \Program{splitindex.exe}}
+% \label{C}
+%
+% The Linux program \Program{splitindex} was compiled using glibc, so it works
+% same like \Program{splitindex.pl} and you may use not only:
+% \begin{quote}
+% \Prompt{}\verb|splitindex -m /home/me/bin/xindy allabout|
+% \end{quote}
+% but also:
+% \begin{quote}
+% \Prompt{}\verb|splitindex allabout -m /home/me/bin/xindy|
+% \end{quote}
+%
+% But the CygWin program \Program{splitindex.exe} was compiled using a
+% CygWin library. Because of this all options must be put before the first
+% no-option-argument. So you have to use:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.exe -m /home/me/bin/xindy allabout|
+% \end{quote}
+% At:
+% \begin{quote}
+% \Prompt{}\verb|splitindex.exe allabout -m /home/me/bin/xindy|
+% \end{quote}
+% the arguments ``\verb|-m /home/me/bin/xindy|'' will be passed to the default
+% index processor \Program{MakeIndex}!
+%
+% You need the CygWin-DLL \File{cygwin1.dll} to run
+% \Program{splitindex.exe}. If you haven't already installed it, you may
+% download the DLL from \url{http://cygwin.com/snapshots}. You need
+% \Program{bzip2}, which can be found at \url{http://source.redhat.com/bzip2},
+% to decompress it. You may use \url{http://cygwin.com/setup.exe} to download
+% and install a minimal CygWin environment alternatively.
+%
+% The Linux-i386-ELF binary \Program{splitindex} was compiled and linked
+% using:
+% \begin{quote}\raggedright
+% \Prompt{}\verb|gcc -O3 -Wall -osplitindex splitindex.c|\\
+% \Prompt{}\verb|strip splitindex|\\
+% \end{quote}
+% The \Program{gcc} was:
+% \begin{verbatim}
+% gcc (GCC) 3.2
+% Copyright (C) 2002 Free Software Foundation, Inc.
+% \end{verbatim}\vspace{-\baselineskip}
+% The used \Program{glibc} is version 2.1.
+%
+% If you compile another binary e.g. for BSD, please contact me, so we may put
+% the new binary into the distribution or can build another binary
+% distribution.
+%
+%
+% \subsection{Using \Program{splitindex.tex}}
+% \label{TeX}
+%
+% The \TeX{} or \LaTeX{} program \Program{splitindex.tex} doesn't know any
+% options or arguments. It number of files, which can be generated, is limited
+% to to number of \TeX's free write handles. If there are other lines than
+% ``\verb|\indexentry|''-lines at the raw index file, running
+% \Program{splitindex.tex} will result in an error.
+%
+% You may use \Program{splitindex.tex} interactive:
+% \begin{quote}
+% \Prompt{}\verb|tex splitindex|
+% \end{quote}
+% or
+% \begin{quote}
+% \Prompt{}\verb|latex splitindex|
+% \end{quote}
+% If you do so, you will be asked for the name of the raw index file. You have
+% to omit the extension ``\File{.idx}'' answering that question.
+%
+% You may also use the \Program{splitindex.tex} not interactive e.g. if you
+% are working with a batch. To do so you have to define macro \cs{IDX} to the
+% name of the raw index file without extension ``\texttt{.idx}''. So the first
+% example of section~\ref{perl} would become:
+% \begin{quote}
+% \Prompt{}\verb|tex \def\IDX{allabout}\input splitindex|
+% \end{quote}
+% You may also use \LaTeX{} instead of \TeX:
+% \begin{quote}
+% \Prompt{}\verb|latex \def\IDX{allabout}\input splitindex|
+% \end{quote}
+%
+% The current version of \Program{splitindex.tex} doesn't call any index
+% processor. But maybe in future a version will be able to do so.
+%
+% \StopEventually{^^A
+% \begin{thebibliography}{99}
+% \bibitem{makeindex} \textsc{Leslie Lamport}: \textit{MakeIndex: An Index
+% Processor For \LaTeX}, 17 February 1987
+% \bibitem{makeindexmanual} \textsc{Pehong Chen}, \textsc{Rick P. C. Rodgers}:
+% \textit{MAKEINDEX(1L)}, Manual page, 10 December 1991
+% \end{thebibliography}
+% \PrintIndex\PrintChanges}
+%
+%
+% \section{Combining Indices}
+%
+% Now you should know, how to use package \Package{splitidx} and the
+% \Program{SplitIndex} programs to split the index. But what about combining
+% two or more indices to one, e.g. you don't want vegetables and fruits in the
+% same index? Try this:
+% \begin{flushleft}\ttfamily
+% \cs{documentclass}\{article\} \percentchar \textit{ We use \Class{article}
+% class \dots}\\
+% \cs{usepackage}\{splitidx\} \percentchar \textit{ \dots\ and the
+% \Package{splitidx} package}\\
+% \cs{makeindex} \percentchar \textit{ And we want index generation}\\
+% ~\\
+% \percentchar \textit{ We define 4 indices:}\\
+% \cs{newindex}[General Index]\{idx\} \percentchar \textit{ Name and shortcut
+% of the 1st index}\\
+% \cs{newindex}[Index of Animals]\{ani\} \percentchar \textit{ \dots\ 2nd
+% index}\\
+% \cs{newindex}[Index of Fruits And Vegetables]\{fru\} \percentchar
+% \textit{ \dots\ 3rd
+% index}\\
+% ~\\
+% \cs{begin}\{document\}\\
+% Apples\cs{sindex}[fru]\{apple\} \percentchar \textit{ an entry to
+% }fru\texttt{ index}\\
+% and oranges\cs{sindex}[fru]\{orange\} \percentchar \textit{ an entry to
+% }fru\texttt{ index}\\
+% are fruits\cs{sindex}\{fruits\}.\ \percentchar \textit{ an implicit entry
+% to }idx\textit{ index}\\
+% Tomatoes\cs{sindex}[veg]\{tomato\} \percentchar \textit{ an entry to
+% }veg\textit{ index}\\
+% are\\
+% vegetables\cs{index}\{vegetables\}.\ \percentchar \textit{ an implicit
+% entry to }idx\textit{ index}\\
+% Cats\cs{sindex}[ani]\{cat\} \percentchar \textit{ an entry to
+% }ani\textit{ index}\\
+% are animals\cs{sindex}[idx]\{animals\}.\ \percentchar \textit{ an explicite
+% entry to }idx\textit{ index}\\
+% ~\\
+% \cs{printindex*} \percentchar \textit{ print all indices}\\
+% \cs{end}\{document\}
+% \end{flushleft}
+% And do the following call after splitting the index using
+% \Program{SplitIndex}:
+% \begin{quote}\raggedright
+% \Prompt{}\verb|makeindex allabout-veg.idx allabout-fru.idx|\\
+% \end{quote}
+% Alternatively you can concatenate \File{allabout-fru.idx} to
+% \File{allabout-veg.idx} before running the index processor on
+% \File{allabout-veg.idx}.
+%
+%
+%
+% \section{Implementation of \Package{splitidx}}
+%
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \subsection{Options}
+%
+% The first option is used to activate index generation.
+% \begin{macrocode}
+\DeclareOption{makeindex}{\AtEndOfPackage{\makeindex}}
+% \end{macrocode}
+%
+% There is also an option to make \cs{sindex} ignores it optional argument and
+% behaves like \cs{index}.
+% \begin{macrocode}
+\DeclareOption{allatone}{%
+ \AtEndOfPackage{%
+ \renewcommand*{\sindex}[1][]{\index}%
+ \g@addto@macro\makeindex{\renewcommand*{\sindex}[1][]{\index}}%
+ }%
+}
+% \end{macrocode}
+%
+% \changes{v0.2}{2002/11/15}{new option \texttt{idxcommands}}
+% With option \texttt{idxcommands} every \cs{newindex} also defines a new index
+% command.
+% \begin{macrocode}
+\newif\if@newidxcmd\@newidxcmdfalse
+\DeclareOption{idxcommands}{\@newidxcmdtrue}
+% \end{macrocode}
+%
+% \changes{v0.2}{2002/11/15}{new option \texttt{split}}
+% With option \texttt{split} each index uses its own index file.
+% \begin{macrocode}
+\newif\if@splitidx\@splitidxfalse
+\DeclareOption{split}{\@splitidxtrue}
+% \end{macrocode}
+%
+% Processing the options
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+%
+% \subsection{Setting an Index Entry}
+%
+% \begin{macro}{\see}
+% \begin{macro}{\seealso}
+% \begin{macro}{\seename}
+% \begin{macro}{\alsoname}
+% These are four standard macros, which are also defined at
+% \Package{makeidx}. Hey, these definitions are stolen from \Package{makeidx}!
+% No, no, I'm not a bad guy, read ``\File{legal.txt}'', which comes with
+% \Package{makeidx}.
+% \begin{macrocode}
+\newcommand*\see[2]{\emph{\seename} #1}
+\providecommand*\seealso[2]{\emph{\alsoname} #1}
+\providecommand\seename{see}
+\providecommand*\alsoname{see also}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\sindex}
+% \begin{macro}{\@wrsindex}
+% \begin{macro}{\@@wrsindex}
+% This works similar to original \cs{index} but uses a splitted index. So it
+% allows an optional argument.
+% \begin{macrocode}
+\newcommand*{\sindex}[2][]{%
+}
+\g@addto@macro\makeindex{%
+ \renewcommand*{\sindex}{%
+ \@bsphack\begingroup
+ \@sanitize
+ \@wrsindex
+ }%
+ \typeout{Using splitted index at \jobname.idx}%
+}
+% \end{macrocode}
+% At the following \cs{@@wrsindex} is used as a hook. If it is defines, it is
+% used to write out the index entry. This hook may be used from
+% e.g. \Package{hyperref} to add \verb|hyperpage| to the font selection of the
+% page number. This only works with \verb+encap |+.
+% \begin{macrocode}
+\newcommand*{\@wrsindex}[2][]{%
+ \ifx\relax#1\relax
+ \if@splitidx
+ \@wrsindex[idx]{#2}%
+ \else
+ \@wrindex{#2}%
+ \fi
+ \else
+ \expandafter\ifx\csname @@wrsindex\endcsname\relax
+ \@@@wrsindex{#1}{{#2}{\thepage}}%
+ \else
+ \@@wrsindex{#1}#2||\\%
+ \fi
+ \endgroup
+ \@esphack
+ \fi
+}
+\newcommand*{\@@@wrsindex}[2]{%
+ \begingroup
+ \if@splitidx
+ \expandafter\ifx\csname @indexfile@#1\endcsname\relax
+ \PackageError{splitidx}{%
+ Index entry for not existing index%
+ }{%
+ You've tried to set an index to index `#1', without
+ defining\MessageBreak
+ that index before using \string\newindex.\MessageBreak
+ This is only allowed, if you are not using package option
+ `split'.%
+ }%
+ \else
+ \expandafter\protected@write\csname @indexfile@#1\endcsname{}{%
+ \string\indexentry#2%
+ }%
+ \fi
+ \else
+ \protected@write\@indexfile{}{%
+ \string\indexentry[#1]#2%
+ }%
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+% If \Package{hyperref} was loaded at \cs{begin{document}} and
+% \Package{hyperref}-option \texttt{hyperindex} isn't disabled, and the hook
+% is not used, define it:
+% \begin{macrocode}
+\AtBeginDocument{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ifHy@hyperindex\endcsname\relax
+ \else
+ \csname ifHy@hyperindex\endcsname
+ \expandafter\ifx\csname @@wrsindex\endcsname\relax
+ \def\@@wrsindex#1#2|#3|#4\\{%
+ \ifx\\#3\\%
+ \@@@wrsindex{#1}{{#2|hyperpage}{\thepage}}%
+ \else
+ \def\Hy@temp@A{#3}%
+ \ifx\Hy@temp@A\HyInd@ParenLeft
+ \@@@wrsindex{#1}{{#2|#3hyperpage}{\thepage}}%
+ \else
+ \ifx\Hy@temp@A\HyInd@ParenRight
+ \@@@wrsindex{#1}{{#2|#3hyperpage}{\thepage}}%
+ \else
+ \@@@wrsindex{#1}{{#2|#3}{\thepage}}%
+ \fi
+ \fi
+ \fi
+ }%
+ \fi
+ \csname fi\endcsname
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsection{Printing One Or More Indices}
+%
+% \begin{macro}{\printindex}
+% \begin{macro}{\printindex*}
+% This is used to print an index in the normal way. In most cases this uses
+% |theindex| environment, but it need not.
+% \begin{macrocode}
+\newcommand*{\printindex}{%
+% \end{macrocode}
+% The command may be called in the star version, which prints all defined
+% indices. This is same as \cs{printindices}.
+% \begin{macrocode}
+ \@ifstar {%
+ \begingroup
+ \let\printindex@@endhook=\printindex@endhook
+ \let\printindex@endhook=\relax
+ \printindices%
+ \csname printindex@@endhook\endcsname
+ \endgroup
+ }{%
+% \end{macrocode}
+% It may also be called with optional arguments to print one of the indices:
+% \begin{macrocode}
+ \@ifnextchar [\@printindex%] brace check comment
+% \end{macrocode}
+% Or it is called without any parameter and so it is same as at
+% \Package{makeidx} package:
+% \begin{macrocode}
+ {%
+ \@input@{\jobname.ind}%
+ \csname printindex@endhook\endcsname
+ }%
+ }%
+}
+% \end{macrocode}
+% \begin{macro}{\@printindex}
+% This is used to print one of the indices. The optional (here obligatory)
+% argument is the shortcut of the index.
+% \begin{macrocode}
+\newcommand*{\@printindex}{}
+\def\@printindex[#1]{%
+% \end{macrocode}
+% There can be one more optional argument, which is the title of the index. If
+% not, the default title \cs{index@\meta{shortcut}@name} is used.
+% \begin{macrocode}
+ \@ifnextchar [%
+ {\@@printindex[{#1}]}%
+ {\@@printindex[{#1}][\csname index@#1@name\endcsname]}%
+}
+% \end{macrocode}
+% \begin{macro}{\@@pintindex}
+% \changes{v0.2}{2002/11/15}{with option \texttt{split} general index has no
+% suffix}
+% We use the default environment to print one of the indices, but we redefine
+% \cs{indexname} to the title of the wanted index, \cs{indexshortcut} to the
+% shortcut of the wanted index and \cs{index@preamble} to the preamble of the
+% wanted index. We do this in a group so it is local.
+% \begin{macrocode}
+\newcommand*{\@@printindex}{}
+\def\@@printindex[#1][#2]{%
+ \begingroup
+ \edef\indexshortcut{#1}%
+ \def\indexname{#2}%
+ \let\index@preamble\relax
+ \expandafter\let\expandafter\index@preamble
+ \csname index@\indexshortcut @preamble\endcsname
+ \if@splitidx
+ \def\@tempa{idx}\def\@tempb{#1}%
+ \ifx\@tempa\@tempb\let\@indexsuffix\@gobble\fi
+ \fi
+ \@input@{\jobname\@indexsuffix{#1}.ind}%
+ \endgroup
+ \csname printindex@endhook\endcsname
+}
+% \end{macrocode}
+% \begin{macro}{\@indexsuffix}
+% This generated the suffix from the shortcut. You may redefine this
+% function, if you need. I`m using a trick here, to define the macro with
+% proper catcodes but not to define it global. You may also use
+% \cs{@firstofone} instead of \cs{lowercase}.
+% \begin{macrocode}
+\begingroup
+\catcode`\-12
+\lowercase{\endgroup
+ \newcommand*{\@indexsuffix}[1]{-#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\printindices}
+% This is used to print all defined indices in the order of their definition
+% and with their default titles. If the list is empty, is behaves like
+% \cs{printindex} without star and optional arguments.
+% \begin{macrocode}
+\newcommand*{\printindices}{%
+ \ifx\@indices\@empty
+ \printindex
+ \else
+ \begingroup
+ \@for\@tempa:=\@indices\do{%
+ \expandafter\printindex\expandafter[\@tempa]%
+ }%
+ \endgroup
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newindex}
+% \changes{v0.2}{2002/11/15}{optional definition of index-shortcut-command}
+% \changes{v0.2}{2002/11/15}{optional opening a new index file}
+% The definition of a new index has an obligatory argument, the shortcut for
+% this index, and an optional argument, the name of this index. If you omit
+% the optional argument the shortcut is used for the default name if the
+% index. The definition will be done global!
+% \begin{macrocode}
+\newcommand*{\newindex}[2][\relax]{%
+ \@ifundefined{index@#2@name}{%
+ \ifx\@indices\@empty
+ \xdef\@indices{#2}%
+ \else
+ \xdef\@indices{\@indices,#2}%
+ \fi
+ \ifx \relax#1
+ \expandafter\xdef\csname index@#2@name\endcsname{#2}%
+ \else
+ \expandafter\xdef\csname index@#2@name\endcsname{#1}%
+ \fi
+ \if@newidxcmd
+ \expandafter\newcommand\expandafter*\csname #2\endcsname{%
+ \sindex[#2]%
+ }%
+ \fi
+ \if@splitidx
+ \def\@tempa{#2}\def\@tempb{idx}%
+ \ifx\@tempa\@tempb
+ \let\@indexfile@idx=\@indexfile
+ \else
+ \expandafter\newwrite\csname @indexfile@#2\endcsname
+ \expandafter\immediate\expandafter\openout
+ \csname @indexfile@#2\endcsname=\jobname-#2.idx
+ \fi
+ \fi
+ }{%
+% \end{macrocode}
+% If the index is already defined, an error occurs:
+% \begin{macrocode}
+ \PackageError{splitidx}{%
+ index `#2' already defined%
+ }{%
+ You have already defined an index with shortcut `#2'.\MessageBreak
+ You can't define a new index with the same shortcut. If you'll continue
+ \MessageBreak
+ The new definition will be ignored.%
+ }%
+ }%
+}
+\if@splitidx
+ \@onlypreamble\newindex
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@indices}
+% This macro stores a list of the index shortcuts. This is needed by
+% e.g. \cs{printindices} and build by \cs{newindex}.
+% \begin{macrocode}
+\newcommand*{\@indices}{}
+\gdef\@indices{}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\extendtheindex}
+% Extend \verb|theindex| by some macros called before starting the index,
+% after starting the index, before stopping the index and after stopping the
+% index. This may be used to change index behaviour. One additional change is
+% done, which may be useful: before the index \cs{index@preamble} is set to
+% \cs{index@\meta{shortcut}@preamble}.
+% \begin{macrocode}
+\newcommand{\extendtheindex}[4]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname splitindex@theindex\endcsname\relax
+ \let\splitindex@theindex=\theindex
+ \let\endsplitindex@theindex=\endtheindex
+ \fi
+ \renewcommand*{\theindex}{%
+ #1\splitindex@theindex #2%
+ }%
+ \renewcommand*{\endtheindex}{%
+ #3\endsplitindex@theindex #4%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\setindexpreamble}
+% Set one of the splitted index preambles or the original one.
+% \begin{macrocode}
+\newcommand{\splitindex@setip}{}
+\let\splitindex@setip\setindexpreamble
+\let\setindexpreamble\relax
+\newcommand{\setindexpreamble}[2][]{%
+ \ifx \relax#1\relax
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname splitindex@setip\endcsname\relax
+ \@namedef{index@preamble}{#2}%
+ \else
+ \splitindex@setip{#2}%
+ \fi
+ \else
+ \@namedef{index@#1@preamble}{#2}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\useindexpreamble}
+% Use the index preamble and optional add additional information after it, if
+% it exists and if it is not empty:
+% \begin{macrocode}
+\newcommand{\useindexpreamble}[1][]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname index@preamble\endcsname\relax\else
+ \ifx\index@preamble\@empty\else
+ \index@preamble #1%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\printsubindex}
+% \begin{macro}{\printsubindex*}
+% Works like \cs{printindex} but changes some macros before to level down the
+% headings at the index generation.
+% \begin{macrocode}
+\newcommand*{\printsubindex}{%
+ \begingroup
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname chapter\endcsname\relax
+ \let\section\subsection
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname addsec\endcsname\relax\else
+ \def\addsec{\setcounter{secnumdepth}{0}\subsection}%
+ \fi
+ \else
+ \let\chapter\section
+ \def\@makeschapterhead{\section*}
+ \let\@makechapterhead\section
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname addchap\endcsname\relax\else
+ \let\addchap\addsec
+ \fi
+ \fi
+% \end{macrocode}
+% Also, \cs{onecolumn} and \cs{twocolumn} and even \cs{clearpage} must be
+% disabled. The macros \cs{onecolumn} and \cs{twocolumn} cannot be let
+% \cs{relax} because the have an optional argument which must be used.
+% \begin{macrocode}
+ \let\onecolumn\@firstoptofone
+ \let\twocolumn\@firstoptofone
+ \let\clearpage\relax
+ \let\cleardoublepage\relax
+% \end{macrocode}
+% And the mark mechanism must also use one down:
+% \begin{macrocode}
+ \def\markboth{\expandafter\markright\@gobble}%
+ \ifx\@mkboth\@gobble\else\let\@mkboth\markboth\fi
+% \end{macrocode}
+% And the page style shouldn't change too:
+% \begin{macrocode}
+ \let\thispagestyle\@gobble
+% \end{macrocode}
+% Now, using \cs{printindex} enables all of it's features:
+% \begin{macrocode}
+ \let\printindex@endhook=\endgroup
+ \printindex
+}
+% \end{macrocode}
+% \begin{macro}{\@firstoptofone}
+% Read the optional argument and do it.
+% \begin{macrocode}
+\providecommand{\@firstoptofone}[1][]{#1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
+\endinput
+%
+% end of file `splitindex.dtx'
+%%% Local Variables:
+%%% mode: latex
+%%% TeX-master: t
+%%% End:
diff --git a/Master/texmf-dist/source/latex/splitindex/splitidx.ins b/Master/texmf-dist/source/latex/splitindex/splitidx.ins
new file mode 100644
index 00000000000..529b3777771
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitidx.ins
@@ -0,0 +1,87 @@
+%%
+%% splitindex.ins
+%% Copyright (c) Markus Kohm, 2002
+%%
+%% $Id: splitidx.ins,v 1.1 2002/11/08 10:37:38 mjk Exp $
+%%
+%% This file is part of the `SplitIndex bundle'.
+%% ---------------------------------------------
+%%
+%% This file can be redistributed 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.
+%%
+%% In particular, NO PERMISSION is granted to modify the contents of this
+%% file since it contains the legal notices that are placed in the files
+%% it generates.
+%%
+%% You are not allowed to redistribute this file without all the
+%% other files of the `SplitIndex bundle'. The list of all files
+%% belonging to the `SplitIndex bundle' is given in the file
+%% `manifest.txt'.
+%%
+%% This file will generate fast loadable files and documentation
+%% driver files from the doc files in this package when run through
+%% LaTeX or TeX.
+%%
+%%
+%% --------------- start of docstrip commands ------------------
+%%
+
+\input docstrip
+
+\preamble
+
+This is a generated file.
+
+Copyright (c) Markus Kohm, 2002
+
+This file was generated from file(s) of the `SplitIndex bundle'.
+----------------------------------------------------------------
+
+It 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.
+
+This file may only be distributed together with a copy of the
+`SplitIndex bundle'. You may however distribute the `SpitIndex
+bundle' without such generated files.
+
+The list of all files belonging to the `SplitIndex bundle' is
+given in the file `manifest.txt'.
+
+\endpreamble
+
+\keepsilent
+\usedir{tex/latex/misc}
+
+\generate{\file{splitidx.sty}{\from{splitidx.dtx}{package}}}
+
+\Msg{*************************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move `splitidx.sty'}
+\Msg{* files into a directory searched by TeX.}
+\Msg{* Using a TDS compatible TeX distribution, this would be e.g.}
+\Msg{* tex/latex/misc of your main or your local or your private}
+\Msg{* texmf path. If you don't know these paths, have a look}
+\Msg{* at your `texmf.cnf' or try:}
+\Msg{* \space\space kpsexpand \string\$TEXMFMAIN}
+\Msg{* \space\space kpsexpand \string\$TEXMFLOCAL}
+\Msg{* \space\space kpsexpand \string\$HOMETEXMF}
+\Msg{* You may also use another folder at your TEXINPUTS path.}
+\Msg{*}
+\Msg{* To produce the documentation run splitidx.dtx files}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy TeXing}
+\Msg{************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex-Linux-i386 b/Master/texmf-dist/source/latex/splitindex/splitindex-Linux-i386
new file mode 100644
index 00000000000..42566f25083
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex-Linux-i386
Binary files differ
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex-OpenBSD-i386 b/Master/texmf-dist/source/latex/splitindex/splitindex-OpenBSD-i386
new file mode 100644
index 00000000000..17e865dd061
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex-OpenBSD-i386
Binary files differ
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex.c b/Master/texmf-dist/source/latex/splitindex/splitindex.c
new file mode 100644
index 00000000000..41a092af734
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex.c
@@ -0,0 +1,576 @@
+/*
+ * splitindex.c
+ * Copyright (c) Markus Kohm, 2002
+ *
+ * $Id: splitindex.c,v 1.6 2003/01/05 10:50:07 mjk Exp $
+ *
+ * This file is part of the SplitIndex package
+ *
+ * This file can be redistributed 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.
+ *
+ * You are not allowed to redistribute this file without all the
+ * other files of the SplitIndex package
+ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <regex.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+enum {
+ OPT_HELP = 'h', OPT_MAKEINDEX = 'm', OPT_IDENTIFY = 'i',
+ OPT_RESULTIS = 'r', OPT_VERBOSE = 'v', OPT_SUFFIXIS = 's',
+ OPT_VERSION = 'V'
+};
+
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined (NO_LONGOPT)
+
+#define HAS_LONGOPT 0
+#define HAPAR ""
+
+#else /* defined(__OpenBSD__) || defined(__FreeBSD__) || defined(NO_LONGOPT) */
+
+#define HAS_LONGOPT 1
+#define HAPAR "\n\t\t"
+
+#include <getopt.h>
+
+static const struct option long_options[] = {
+ { "help", 0, NULL, OPT_HELP },
+ { "makeindex", 1, NULL, OPT_MAKEINDEX },
+ { "identify", 1, NULL, OPT_IDENTIFY },
+ { "resultis", 1, NULL, OPT_RESULTIS },
+ { "suffixis", 1, NULL, OPT_SUFFIXIS },
+ { "verbose", 0, NULL, OPT_VERBOSE },
+ { "version", 0, NULL, OPT_VERSION },
+ { NULL, 0, NULL, 0 },
+};
+
+#endif
+
+static const char short_options[] = {
+ OPT_HELP,
+ OPT_MAKEINDEX, ':',
+ OPT_IDENTIFY, ':',
+ OPT_RESULTIS, ':',
+ OPT_SUFFIXIS, ':',
+ OPT_VERBOSE,
+ OPT_VERSION,
+};
+
+int Verbose = 0;
+
+char *MakeIndex = "makeindex";
+char *Identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)$";
+char *ResultIs = "$1$3";
+char *SuffixIs = "-$2";
+char *IDX = NULL;
+char *Jobname = NULL;
+char * const * MakeIndexArgs = NULL;
+char *prgname = "splitindex";
+int MakeIndexArgc = 0;
+
+static void show_version( void ) {
+ printf( "splitindex 0.2a\n"
+ "Copyright (c) 2002 Markus Kohm <kohm@gmx.de>\n" );
+}
+
+static void show_usage( FILE *out ) {
+ fputs( "Usage: splitindex [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n",
+ out );
+}
+
+static void usage_error( const char *format, ... ) {
+ if ( format != NULL ) {
+ va_list ap;
+ va_start( ap, format );
+ vfprintf( stderr, format, ap );
+ va_end( ap );
+ }
+ fputs( "Try `splitindex "
+#if HAS_LONGOPT
+ "--help"
+#else
+ "-h"
+#endif
+ "' for more information.\n", stderr );
+ exit( 1 );
+}
+
+static void show_help( void ) {
+ show_version();
+ printf( "\n" );
+ show_usage( stdout );
+ printf(
+ "Split a single raw index file into multiple raw index files.\n"
+ "Example: splitindex.pl foo.idx.\n"
+ "\n"
+ "Options:\n"
+ " -h"
+#if HAS_LONGOPT
+ ", --help "
+#else
+ " "
+#endif
+ "\tshow this help and terminate\n"
+ " -m"
+#if HAS_LONGOPT
+ ", --makeindex"
+#endif
+ " PROGNAME " HAPAR
+ "\tcall PROGNAME instead of default `%s'.\n",
+ MakeIndex
+ );
+ printf(
+ " -i"
+#if HAS_LONGOPT
+ ", --identify"
+#endif
+ " EXPRESSION " HAPAR
+ "\tuse regular EXPRESSION to match entries\n"
+ "\t\t\t(see also option --resultis and --suffixis).\n"
+ "\t\t\tDefault is `%s'.\n",
+ Identify
+ );
+ printf(
+ " -r"
+#if HAS_LONGOPT
+ ", --resultis"
+#endif
+ " PATTERN " HAPAR
+ "\tcreate line to be written from PATTERN after matching\n"
+ "\t\t\tlines (see also option --identify).\n"
+ "\t\t\tDefault is `%s'.\n",
+ ResultIs
+ );
+ printf(
+ " -s"
+#if HAS_LONGOPT
+ ", --suffixis"
+#endif
+ " PATTERN " HAPAR
+ "\tcreate suffix to be used from PATTERN after matching\n"
+ "\t\t\tlines (see also option --identify).\n"
+ "\t\t\tDefault is `%s'.\n",
+ SuffixIs
+ );
+ printf(
+ " -v"
+#if HAS_LONGOPT
+ ", --verbose "
+#else
+ " "
+#endif
+ "\tbe more verbose\n"
+ "\t\t\t(can be used multiple to increase verbosity)\n"
+ " -V"
+#if HAS_LONGOPT
+ ", --version "
+#else
+ " "
+#endif
+ "\tshow version and terminate\n"
+ );
+ exit(0);
+}
+
+static void ScanArguments( int argc, char * const argv[] ) {
+ int retVal;
+ char *hs;
+ if ( argc > 0 )
+ prgname = argv[0];
+#if HAS_LONGOPT
+ while ( ( retVal = getopt_long( argc, argv, short_options,
+ long_options, NULL ) ) != - 1 ) {
+#else
+ while ( ( retVal = getopt( argc, argv, short_options ) ) != - 1 ) {
+#endif
+ switch( retVal ) {
+ case OPT_HELP:
+ show_help();
+ break; /* should never be reached */
+ case OPT_VERSION:
+ show_version();
+ exit( 0 );
+ break; /* should never be reached */
+ case OPT_MAKEINDEX:
+ MakeIndex = optarg;
+ break;
+ case OPT_IDENTIFY:
+ Identify = optarg;
+ break;
+ case OPT_RESULTIS:
+ ResultIs = optarg;
+ break;
+ case OPT_SUFFIXIS:
+ SuffixIs = optarg;
+ break;
+ case OPT_VERBOSE:
+ Verbose++;
+ break;
+ case ':':
+ case '?':
+ usage_error( NULL );
+ break; /* should never be reached */
+ }
+ }
+ if ( optind < argc ) {
+ IDX = argv[optind++];
+ MakeIndexArgc = argc - optind;
+ MakeIndexArgs = argv + optind;
+ } else {
+ usage_error( "missing raw index file\n" );
+ return; /* should never be reached */
+ }
+
+ if ( ( Jobname = strdup( IDX ) ) == NULL ) {
+ perror( prgname );
+ exit( errno );
+ }
+
+ if ( ( ( hs = strrchr( Jobname, '.' ) ) != NULL )
+ && !strcmp( hs, ".idx" ) )
+ *hs = 0;
+}
+
+static char *regsub( const char *string, const char *replace,
+ int nmatch, regmatch_t pmatch[] ) {
+ int pass;
+ int size, n;
+ const char *hs;
+ char c;
+ char *retVal = NULL;
+ char *ts;
+
+ /* Two times parsing to get size and replace */
+ for ( pass = size = 0; pass < 2; pass++ ) {
+ ts = retVal;
+ for ( hs = replace; *hs; hs++ ) {
+ switch( *hs ) {
+ case '$':
+ if ( isdigit( hs[1] ) ) {
+ n = *++hs - '0';
+ if ( ( pmatch[n].rm_so >= 0 )
+ && ( pmatch[n].rm_so < pmatch[n].rm_eo ) ) {
+ /* maybe group n is not empty */
+ if ( pass ) {
+ strncpy( ts,
+ string + pmatch[n].rm_so,
+ pmatch[n].rm_eo - pmatch[n].rm_so );
+ ts += pmatch[n].rm_eo - pmatch[n].rm_so;
+ } else {
+ size += pmatch[n].rm_eo - pmatch[n].rm_so;
+ }
+ }
+ } else {
+ if ( pass ) {
+ *ts++ = '$';
+ } else {
+ size++;
+ }
+ }
+ break;
+ case '\\':
+ switch( c = *++hs ) {
+ case 0: c = '\\'; hs--; break;
+ case 'b': c = '\b'; break;
+ case 'f': c = '\f'; break;
+ case 'n': c = '\n'; break;
+ case 'r': c = '\r'; break;
+ case 't': c = '\t'; break;
+ }
+ if ( pass ) {
+ *ts++ = c;
+ } else {
+ size++;
+ }
+ break;
+ default:
+ if ( pass ) {
+ *ts++ = *hs;
+ } else {
+ size++;
+ }
+ break;
+ }
+ }
+ if ( pass ) {
+ *ts = '\0';
+ } else {
+ if ( ( retVal = malloc( size + 1 ) ) == NULL ) {
+ perror( prgname );
+ exit( 1 );
+ }
+ }
+ }
+
+ return retVal;
+}
+
+static struct list {
+ struct list *next;
+ char *name;
+ FILE *file;
+} *IDXfiles = NULL;
+
+static FILE *findsuffix( const char *name ) {
+ struct list *run;
+ for ( run = IDXfiles;
+ run != NULL;
+ run = run->next ) {
+ const char *suffix = strchr( run->name, '\0' );
+ suffix -= 4; /* .idx */
+ suffix -= strlen( name );
+ if ( ( suffix >= run->name )
+ && !strncmp( suffix, name, strlen( name ) ) ) {
+ return run->file;
+ }
+ }
+ return NULL;
+}
+
+static struct list *addentry( char *name, FILE *file ) {
+ struct list *newentry = malloc( sizeof( struct list ) );
+ if ( !newentry ) {
+ perror( prgname );
+ exit( 1 );
+ }
+ newentry->name = name;
+ newentry->file = file;
+ if ( IDXfiles == NULL ) {
+ newentry->next = NULL;
+ } else {
+ newentry->next = IDXfiles;
+ }
+ IDXfiles = newentry;
+ return IDXfiles;
+}
+
+static FILE *newentry( const char *suffix ) {
+ char *name;
+ FILE *file;
+
+ if ( ( name = malloc( strlen( Jobname ) + strlen( suffix ) + 5 ) ) == NULL ) {
+ perror( prgname );
+ exit( 1 );
+ }
+
+ strcpy( name, Jobname );
+ strcat( name, suffix );
+ strcat( name, ".idx" );
+
+ if ( ( file = fopen( name, "w" ) ) == NULL ) {
+ perror( name );
+ exit( errno );
+ }
+
+ if ( Verbose > 1 )
+ printf( "New index file %s\n", name );
+ addentry( name, file );
+ return file;
+}
+
+static void CloseAllIDX( void ) {
+ struct list *run;
+ for ( run = IDXfiles; run != NULL; run = run->next )
+ if ( fclose( run->file ) ) {
+ perror( run->name );
+ exit( 1 );
+ }
+}
+
+static void CallMakeIndex( void ) {
+ char **argv;
+ int idx;
+ struct list *run, *next;
+
+ if ( ( argv = calloc( MakeIndexArgc + 3, sizeof( char * ) ) ) == NULL ) {
+ perror( prgname );
+ exit( 0 );
+ }
+
+ for ( idx = 0; idx < MakeIndexArgc; idx++ )
+ argv[idx+1] = MakeIndexArgs[idx];
+
+ idx++;
+ argv[0] = MakeIndex;
+
+ for ( run = IDXfiles; run != NULL; run = next ) {
+ pid_t fret;
+ int status;
+ argv[idx] = run->name;
+
+ if ( ( fret = fork() ) == 0 ) {
+ /* This is the child */
+ if ( Verbose > 1 ) {
+ int i;
+ for ( i = 0; argv[i] != NULL; i++ )
+ printf( "\"%s\" ", argv[i] );
+ printf( "\n" );
+ }
+ if ( execvp( MakeIndex, argv ) ) {
+ perror( MakeIndex );
+ exit( 1 );
+ }
+ } else if ( fret == -1 ) {
+ perror( prgname );
+ exit( 1 );
+ } else {
+ /* Parent */
+ waitpid( fret, &status, 0 );
+ if ( ! WIFEXITED( status ) ) {
+ fprintf( stderr, "%s terminated abnormally!\n", MakeIndex );
+ exit( 1 );
+ }
+ }
+
+ free( (void *)run->name );
+ next = run->next;
+ free( run );
+ }
+
+
+}
+
+static void ProcessIDXFile( void ) {
+ FILE *fIDX;
+ char *line;
+ regex_t preg;
+ int retVal;
+ int buffersize = 2050;
+ regmatch_t pmatch[10];
+
+ if ( ( line = malloc( buffersize ) ) == NULL ) {
+ perror( prgname );
+ exit( errno );
+ }
+
+ if ( ( retVal = regcomp( &preg, Identify, REG_EXTENDED ) ) != 0 ) {
+ regerror( retVal, &preg, line, buffersize );
+ fprintf( stderr, "Error at identify: %s\n", line );
+ free( line );
+ exit( 1 );
+ }
+
+ if ( ( fIDX = fopen( IDX, "r" ) ) == NULL ) {
+ if ( !strcmp ( IDX, Jobname ) ) {
+ if ( ( IDX = malloc( strlen( Jobname + 5 ) ) ) == NULL ) {
+ perror( prgname );
+ regfree( &preg );
+ free( line );
+ exit( errno );
+ }
+ strcpy( IDX, Jobname );
+ strcat( IDX, ".idx" );
+ if ( ( fIDX = fopen( IDX, "r" ) ) == NULL ) {
+ fprintf( stderr,
+ "Can read neither file %s nor file %s\n",
+ Jobname, IDX );
+ regfree( &preg );
+ free( line );
+ exit( 1 );
+ }
+ } else {
+ fprintf( stderr,
+ "Can't red file %s\n", IDX );
+ regfree( &preg );
+ free( line );
+ exit( 1 );
+ }
+ }
+
+ while ( fgets( line, buffersize, fIDX ) != NULL ) {
+ char *hs;
+ char *result, *suffix;
+ FILE *f;
+ while ( ( ( hs = strchr( line, '\n' ) ) == NULL )
+ && ! feof( fIDX ) ) {
+ if ( ( line = realloc( line, 2 * buffersize ) ) == NULL ) {
+ perror( prgname );
+ exit( errno );
+ }
+ if ( fgets( line + buffersize - 1, buffersize + 1, fIDX ) == NULL )
+ break;
+ buffersize *= 2;
+ }
+ if ( ferror( fIDX ) )
+ break;
+ if ( ( hs = strchr( line, '\n' ) ) != NULL ) // remove newline
+ *hs = 0;
+ if ( ( retVal = regexec( &preg, line, 10, pmatch, 0 ) ) == 0 ) {
+ result = regsub( line, ResultIs, 10, pmatch );
+ suffix = regsub( line, SuffixIs, 10, pmatch );
+ } else {
+ int i;
+ result = strdup( line );
+ for ( i = 0; i < 10; i++ ) {
+ pmatch[i].rm_so = 0;
+ pmatch[i].rm_eo = 3;
+ }
+ suffix = regsub( "idx", SuffixIs, 10, pmatch );
+ }
+ if ( !result || !suffix ) {
+ perror( prgname );
+ exit ( 1 );
+ }
+
+ if ( ( f = findsuffix( suffix ) ) == NULL )
+ f = newentry( suffix );
+ fprintf( f, "%s\n", result );
+
+ free( suffix );
+ free( result );
+ }
+
+ regfree( &preg );
+ free( line );
+ if ( ferror( fIDX ) ) {
+ perror( IDX );
+ fclose( fIDX );
+ exit( errno );
+ }
+ fclose( fIDX );
+
+ CloseAllIDX();
+
+ CallMakeIndex();
+}
+
+int main( int argc, char * const argv[] ) {
+ int retVal = 0;
+
+ ScanArguments( argc, argv );
+
+ if ( Verbose > 0 ) {
+ show_version();
+ if ( Verbose > 9 ) {
+ int i;
+ printf( "Identify: \"%s\"\n", Identify );
+ printf( "ResultIs: \"%s\"\n", ResultIs );
+ printf( "SuffixIs: \"%s\"\n", SuffixIs );
+ printf( "IDX: \"%s\"\n", IDX );
+ printf( "Jobname: \"%s\"\n", Jobname );
+ printf( "MakeIndex: \"%s\"", MakeIndex );
+ for ( i = 0; i < MakeIndexArgc; i++ )
+ printf( " \"%s\"", MakeIndexArgs[i] );
+ printf( "\n" );
+ }
+ }
+
+ ProcessIDXFile();
+
+ return retVal;
+}
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex.class b/Master/texmf-dist/source/latex/splitindex/splitindex.class
new file mode 100644
index 00000000000..288ad25d588
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex.class
Binary files differ
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex.exe b/Master/texmf-dist/source/latex/splitindex/splitindex.exe
new file mode 100644
index 00000000000..08aa74d1291
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex.exe
Binary files differ
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex.java b/Master/texmf-dist/source/latex/splitindex/splitindex.java
new file mode 100644
index 00000000000..9b52f9f7fdf
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex.java
@@ -0,0 +1,415 @@
+/*
+ * splitindex.java
+ * Copyright (c) Markus Kohm, 2002
+ *
+ * $Id: splitindex.java,v 1.2 2003/01/05 15:05:46 mjk Exp $
+ *
+ * This file is part of the SplitIndex package
+ *
+ * This file can be redistributed 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.
+ *
+ * You are not allowed to redistribute this file without all the
+ * other files of the SplitIndex package
+ */
+
+/*
+ I know, I should never write an application in a single static class
+ like I do here. But I wanted the program at earch language to be one
+ file.
+*/
+
+import java.util.*;
+import java.util.regex.*;
+import java.io.*;
+
+public final class splitindex {
+ private static ArrayList MakeIndexArgs = new ArrayList();
+// private static String Identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)$";
+ private static String Identify = "^(\\\\indexentry)\\[([^\\]]*)\\](.*)$";
+ private static String ResultIs = "$1$3";
+ private static String SuffixIs = "-$2";
+ private static int Verbose = 0;
+ private static String IDX = null;
+ private static String Jobname = null;
+ private static HashMap IDXwriters = new HashMap();
+
+ private static void ShowHelp() {
+ String nl = System.getProperty( "line.separator" );
+ ShowVersion();
+ System.out.println();
+ ShowUsage();
+ System.out.println(
+ "Split a single raw index file into multiple raw index files." +nl+
+ "Example: java splitindex foo.idx." +nl+
+ nl+
+ "Options:" +nl+
+ " -h, --help " +
+ "\tshow this help and terminate" +nl+
+ " -m, --makeindex PROGNAME" +nl+
+ "\t\t\tcall PROGNAME instead of default `makeindex'." +nl+
+ " -i, --identify EXPRESSION" +nl+
+ "\t\t\tuse regular EXPRESSION to match entries" +nl+
+ "\t\t\t(see also option --resultis and --suffixis)." +nl+
+ "\t\t\tDefault is \'" + Identify + "\'." +nl+
+ " -r, --resultis PATTERN" +nl+
+ "\t\t\tcreate line to be written from PATTERN after matching" +nl+
+ "\t\t\tlines (see also option --identify)." +nl+
+ "\t\t\tDefault is \'" + ResultIs + "\'." +nl+
+ " -s, --suffixis PATTERN" +nl+
+ "\t\t\tcreate suffix to be used from PATTERN after matching" +nl+
+ "\t\t\tlines (see also option --identify)." +nl+
+ "\t\t\tDefault is \'" + SuffixIs +"\'." +nl+
+ " -v, --verbose " +
+ "\tbe more verbose" +nl+
+ "\t\t\t(can be used multiple to increase verbosity)" +nl+
+ " --version " +
+ "\tshow version and terminate"
+ );
+ System.exit( 0 );
+ }
+
+ private static void ShowVersion() {
+ System.out.println( "splitindex.pl 0.1" );
+ System.out.println( "Copyright (c) 2002 Markus Kohm <kohm@gmx.de>" );
+ }
+
+ private static void ShowUsage( PrintStream out ) {
+ out.println( "Usage: java splitindex [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]..." );
+ }
+
+ private static void ShowUsage() {
+ ShowUsage( System.out );
+ }
+
+ private static void UsageError( String msg ) {
+ System.err.println( msg );
+ System.err.println( "Try `java splitindex --help' for more information." );
+ System.exit( 1 );
+ }
+
+ private static void ScanArguments(String[] args) {
+ String MakeIndex = "makeindex";
+ for (int i = 0; i < args.length; i++) {
+ if ( args[i].charAt(0) == '-' ) {
+ // Option
+ if ( args[i].charAt(1) == '-' ) {
+ // Long Option
+ if ( args[i].substring(2).equals( "help" ) ) {
+ ShowHelp();
+ System.exit(0);
+ } else if ( args[i].substring(2).equals( "version" ) ) {
+ ShowVersion();
+ System.exit(0);
+ } else if ( args[i].substring(2).equals( "verbose" ) ) {
+ Verbose++;
+ } else if ( args[i].substring(2).equals( "makeindex" ) ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option makeindex requires an argument" );
+ }
+ MakeIndex = args[i];
+ } else if ( ( args[i].length() >= 11 ) &&
+ ( args[i].substring(2,11).equals( "makeindex=" ) ) ) {
+ MakeIndex = args[i].substring(12);
+ } else if ( args[i].substring(2).equals( "identify" ) ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option identify requires an argument" );
+ }
+ Identify = args[i];
+ } else if ( ( args[i].length() >= 10 ) &&
+ ( args[i].substring(2,10).equals( "identify=" ) ) ) {
+ Identify = args[i].substring(11);
+ } else if ( args[i].substring(2).equals( "resultis" ) ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option resultis requires an argument" );
+ }
+ ResultIs = args[i];
+ } else if ( ( args[i].length() >= 10 ) &&
+ ( args[i].substring(2,10).equals( "resultis=" ) ) ) {
+ ResultIs = args[i].substring(11);
+ } else if ( args[i].substring(2).equals( "suffixis" ) ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option suffixis requires an argument" );
+ }
+ SuffixIs = args[i];
+ } else if ( ( args[i].length() >= 10 ) &&
+ ( args[i].substring(2,10).equals( "suffixis=" ) ) ) {
+ SuffixIs = args[i].substring(11);
+ } else if ( args[i].equals( "--" ) ) {
+ while ( ++i < args.length ) {
+ MakeIndexArgs.add( args[i] );
+ }
+ } else {
+ UsageError( "Unknown option " + args[i].substring(2) );
+ }
+ } else {
+ // Short Option
+ for ( int n = 1; n < args[i].length(); ) {
+ switch( args[i].charAt(n++) ) {
+ case 'h':
+ ShowHelp();
+ System.exit(0);
+ case 'm':
+ if ( n >= args[i].length() ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option makeindex requires an argument" );
+ } else {
+ MakeIndex = args[i];
+ n = args[i].length();
+ }
+ } else {
+ MakeIndex = args[i].substring( n );
+ n = args[i].length();
+ }
+ break;
+ case 'i':
+ if ( n >= args[i].length() ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option identify requires an argument" );
+ } else {
+ Identify = args[i];
+ n = args[i].length();
+ }
+ } else {
+ Identify = args[i].substring( n );
+ n = args[i].length();
+ }
+ break;
+ case 'r':
+ if ( n >= args[i].length() ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option resultis requires an argument" );
+ } else {
+ ResultIs = args[i];
+ n = args[i].length();
+ }
+ } else {
+ ResultIs = args[i].substring( n );
+ n = args[i].length();
+ }
+ break;
+ case 's':
+ if ( n >= args[i].length() ) {
+ if ( ++i >= args.length ) {
+ UsageError( "Option suffixis requires an argument" );
+ } else {
+ SuffixIs = args[i];
+ n = args[i].length();
+ }
+ } else {
+ SuffixIs = args[i].substring( n );
+ n = args[i].length();
+ }
+ break;
+ case 'v':
+ Verbose++;
+ break;
+ }
+ }
+ }
+ } else {
+ MakeIndexArgs.add( args[i] );
+ }
+ }
+
+ // Args --> IDX + Stringarray
+ if ( MakeIndexArgs.isEmpty() ) {
+ UsageError( "missing raw index file" );
+ } else {
+ IDX = (String)MakeIndexArgs.get(0);
+ MakeIndexArgs.remove(0);
+ MakeIndexArgs.add( 0, MakeIndex );
+ }
+
+ if ( IDX.endsWith( ".idx" ) ) {
+ Jobname = IDX.substring( 0, IDX.length() - 4 );
+ } else {
+ Jobname = IDX;
+ }
+ }
+
+ public static void main(String[] args) {
+ ScanArguments(args);
+
+ if ( Verbose > 0 ) {
+ ShowVersion();
+ System.out.println();
+ if ( Verbose > 9 ) {
+ System.out.println( "Identify: \"" + Identify + "\"" );
+ System.out.println( "ResultIs: \"" + ResultIs + "\"" );
+ System.out.println( "SuffixIs: \"" + SuffixIs + "\"" );
+ System.out.println( "IDX: \"" + IDX + "\"" );
+ System.out.println( "Jobname: \"" + Jobname + "\"" );
+ System.out.print( "MakeIndex:" );
+ for ( int i = 0; i < MakeIndexArgs.size(); i++ )
+ System.out.print( " \"" + (String)MakeIndexArgs.get(i) + "\"" );
+ System.out.println();
+ }
+ }
+
+ ProcessIDXFile();
+ }
+
+ private static void ProcessIDXFile() {
+ File fIDX = new File( IDX );
+ LineNumberReader rIDX = null;
+ boolean error = false;
+ if ( !fIDX.canRead() ) {
+ if ( IDX.equals( Jobname ) ) {
+ IDX = IDX.concat( ".idx" );
+ fIDX = new File( IDX );
+ if ( !fIDX.canRead() ) {
+ System.err.println( "Can read neither file " + Jobname +
+ " nor file " + IDX );
+ System.exit( 1 );
+ }
+ } else {
+ System.err.println( "Can't read file " + Jobname );
+ System.exit( 1 );
+ }
+ }
+
+ try {
+ FileReader reader = new FileReader( fIDX );
+ rIDX = new LineNumberReader( reader );
+ } catch ( FileNotFoundException ex ) {
+ System.err.println( ex.getMessage() );
+ System.exit( 1 );
+ }
+
+ try {
+ Pattern search = Pattern.compile( Identify );
+ while ( rIDX.ready() ) {
+ String line = rIDX.readLine();
+ Matcher match = search.matcher( line );
+ String suffix, result;
+
+ try {
+ if ( match.find() ) {
+ suffix = match.replaceFirst( SuffixIs );
+ result = match.replaceFirst( ResultIs );
+ } else {
+ result = line;
+ suffix = SuffixIs.replaceFirst( "\\$\\d", "idx" );
+ }
+ WriteToIndex( Jobname + suffix + ".idx", result );
+ } catch ( Exception ex ) {
+ System.err.println( ex.getMessage() );
+ error = true;
+ break;
+ }
+ }
+
+ if ( ! CloseAllIndex() )
+ error = true;
+ else if ( ! CallAllMakeIndex() )
+ error = true;
+ } catch ( IOException ex ) {
+ System.err.println( ex.getMessage() );
+ }
+
+ try {
+ rIDX.close();
+ } catch ( IOException ex ) {
+ System.err.println( ex.getMessage() );
+ System.exit( 1 );
+ }
+
+ if ( error )
+ System.exit( 1 );
+
+ }
+
+ static void WriteToIndex( String Name, String line )
+ throws FileNotFoundException, SecurityException {
+ PrintWriter fOut;
+ if ( ( fOut = (PrintWriter)IDXwriters.get( Name ) ) == null ) {
+ if ( Verbose > 1 ) {
+ System.out.println( "New index file " + Name );
+ }
+ fOut = new PrintWriter( new FileOutputStream( Name ) );
+ IDXwriters.put( Name, fOut );
+ }
+ fOut.println( line );
+ }
+
+ static boolean CloseAllIndex() {
+ Iterator all = IDXwriters.entrySet().iterator();
+ boolean retVal = true;
+ while ( all.hasNext() ) {
+ Map.Entry entry = (Map.Entry)all.next();
+ PrintWriter writer = (PrintWriter)entry.getValue();
+ if ( Verbose > 1 ) {
+ System.out.println( "Close " + entry.getKey() );
+ }
+ writer.close();
+ if ( writer.checkError() ) {
+ System.err.println( "Error writing " + entry.getKey() );
+ retVal = false;
+ }
+ }
+ return retVal;
+ }
+
+ static boolean CallAllMakeIndex() {
+ Iterator all = IDXwriters.entrySet().iterator();
+ boolean retVal = true;
+ ArrayList processes = new ArrayList();
+ while ( all.hasNext() ) {
+ Map.Entry entry = (Map.Entry)all.next();
+ String name = (String)entry.getKey();
+ try {
+ MakeIndexArgs.add(name);
+ String Args[] = new String[MakeIndexArgs.size()];
+ Args = (String[])MakeIndexArgs.toArray( Args );
+ MakeIndexArgs.remove(MakeIndexArgs.size()-1);
+ if ( Verbose > 1 ) {
+ System.out.print( "MakeIndex:" );
+ for ( int i = 0; i < Args.length; i++ )
+ System.out.print( " \"" + Args[i] + "\"" );
+ System.out.println();
+ }
+ processes.add(Runtime.getRuntime().exec( Args ));
+ } catch ( Exception ex ) {
+ System.err.println( ex.getMessage() );
+ retVal = false;
+ }
+ }
+
+ for ( int i = 0; i < processes.size(); i++ ) {
+ Process p = (Process)processes.get( i );
+ InputStream out = p.getInputStream();
+ byte[] buffer = new byte[1024];
+ for ( boolean oncemore = true; oncemore; ) {
+ oncemore = false;
+ try {
+ while ( out.available() > 0 ) {
+ out.read( buffer );
+ System.out.print( new String(buffer) );
+ }
+ for ( out = p.getErrorStream();
+ out.available() > 0; ) {
+ out.read( buffer );
+ System.err.print( new String( buffer ) );
+ }
+ } catch ( Exception ex ) {
+ System.err.println( ex.getMessage() );
+ retVal = false;
+ }
+ try {
+ if ( p.exitValue() != 0 )
+ retVal = false;
+ } catch ( IllegalThreadStateException ex ) {
+ oncemore = true;
+ }
+ }
+ }
+
+ return retVal;
+ }
+}
diff --git a/Master/texmf-dist/source/latex/splitindex/splitindex.pl b/Master/texmf-dist/source/latex/splitindex/splitindex.pl
new file mode 100644
index 00000000000..378fb25e68c
--- /dev/null
+++ b/Master/texmf-dist/source/latex/splitindex/splitindex.pl
@@ -0,0 +1,186 @@
+#! /usr/bin/perl -w
+eval 'exec perl -S $0 ${1+"$@"}'
+ if 0; #$running_under_some_shell
+
+# ======================================================================
+# splitindex.pl
+# Copyright (c) Markus Kohm, 2002
+#
+# $Id: splitindex.pl,v 1.5 2002/11/05 10:54:27 mjk Exp $
+#
+# This file is part of the SplitIndex package
+#
+# This file can be redistributed 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.
+#
+# You are not allowed to redistribute this file without all the
+# other files of the SplitIndex package
+# ======================================================================
+
+use strict;
+use Getopt::Long;
+
+my $makeindex = "makeindex";
+# my $identify = "^(.*)\\\\UseIndex *\\{([^\\}]*)\\}(.*)\$";
+my $identify = "^(\\\\indexentry)\\[([^]]*)\\](.*)\$";
+my $suffixis = "-\$2";
+my $lineis = "\$1\$3";
+my $verbose = 0; # option verbose with default value
+my $result = GetOptions(
+ 'help' => sub { help() },
+ 'makeindex=s' => \$makeindex,
+ 'identify=s' => \$identify,
+ 'resultis=s' => \$lineis,
+ 'suffixis=s' => \$suffixis,
+ 'verbose|v+' => \$verbose,
+ 'version' => sub { version(); exit 0; }
+ );
+
+usage("missing raw index file") if ( $#ARGV < 0 );
+
+my $indexinput = shift;
+my $jobname = ( $indexinput =~ /^(.*)\.idx$/ ) ? $1 : $indexinput;
+
+my %idxfile;
+my %linesatidxfile;
+
+version() if ($verbose > 0);
+
+if ( !( open (IDX,"<$indexinput") ) ) {
+ if ( $indexinput ne "$jobname.idx" ) {
+ open (IDX,"<$jobname.idx") ||
+ die "Cannot read raw index file $indexinput nor $jobname.idx";
+ $indexinput = "$jobname.idx";
+ } else {
+ die "Cannot read raw index file $indexinput";
+ }
+}
+
+while (<IDX>) {
+ my $line;
+ my $suffix;
+ if ( /$identify/ ) {
+ my $eval = "\$line = \"$lineis\n\"";
+ eval $eval;
+ $eval = "\$suffix = \"$suffixis\"";
+ eval $eval;
+ } else {
+ $line = $_;
+ $suffix = "";
+ $suffix .= "$1" if ( $suffixis =~ /^(.*)\$/ );
+ $suffix .= "idx";
+ $suffix .= "$1" if ( $suffixis =~ /\$[123456789](.*)$/ );
+ }
+ while ( $suffix =~ /(^[^,]+)(.*)$/ ) {
+ $suffix = $2;
+ writetoidx ($1,$line);
+ }
+}
+
+closeallind();
+
+close(IDX);
+
+generateallind(@ARGV);
+
+exit 0;
+
+sub generateallind {
+ my $name;
+ my $file;
+
+ if ( $makeindex ne "" ) {
+ while (($name,$file) = each %idxfile) {
+ system( "$makeindex @ARGV $jobname$name.idx" );
+ }
+ }
+}
+
+sub closeallind {
+ my $name;
+ my $file;
+ my $lines;
+ while (($name,$file) = each %idxfile) {
+ print "Close $jobname$name.idx\n"
+ if ( $verbose > 1 );
+ close( $file );
+ $idxfile{$name}=0;
+ }
+ if ( $verbose > 0 ) {
+ print "\n";
+ while (($name,$lines) = each %linesatidxfile) {
+ print "$jobname$name.idx with $lines lines\n";
+ }
+ }
+}
+
+sub writetoidx {
+ my $suffix = $_[0];
+ my $line = $_[1];
+ my $file = $idxfile{$suffix};
+ if ( ! $file ) {
+ open ( $file, ">$jobname$suffix.idx" ) ||
+ die "Cannot write to file $jobname$suffix.idx";
+ $idxfile{$suffix} = $file;
+ $linesatidxfile{$suffix} = 0;
+ print( "New index file $jobname$suffix.idx\n" )
+ if ( $verbose > 1 );
+ }
+ print ($file $line);
+ $linesatidxfile{$suffix}++;
+}
+
+sub help {
+ version();
+ print "\n";
+ usage();
+ print
+ "Split a single raw index file into multiple raw index files.\n".
+ "Example: splitindex.pl foo.idx.\n".
+ "\n".
+ "Options:\n" .
+ " -h, --help " .
+ "\tshow this help and terminate\n" .
+ " -m, --makeindex PROGNAME\n" .
+ "\t\t\tcall PROGNAME instead of default \`makeindex\'.\n" .
+ " -i, --identify EXPRESSION\n" .
+ "\t\t\tuse regular EXPRESSION to match entries\n".
+ "\t\t\t(see also option --resultis and --suffixis).\n".
+ "\t\t\tDefault is \'$identify\'.\n".
+ " -r, --resultis PATTERN\n" .
+ "\t\t\tcreate line to be written from PATTERN after matching\n".
+ "\t\t\tlines (see also option --identify).\n".
+ "\t\t\tDefault is \'$lineis\'.\n".
+ " -s, --suffixis PATTERN\n" .
+ "\t\t\tcreate suffix to be used from PATTERN after matching\n".
+ "\t\t\tlines (see also option --identify).\n".
+ "\t\t\tDefault is \'$suffixis\'.\n".
+ " -v, --verbose " .
+ "\tbe more verbose\n".
+ "\t\t\t(can be used multiple to increase verbosity)\n" .
+ " --version " .
+ "\tshow version and terminate\n";
+ exit 0;
+}
+
+sub version {
+ print "splitindex.pl 0.1\n" .
+ "Copyright (c) 2002 Markus Kohm \<kohm\@gmx.de\>\n";
+}
+
+sub usage {
+ my $text = "Usage: splitindex.pl [OPTION]... RAWINDEXFILE [MAKEINDEXOPTION]...\n";
+ if ( $#_ >= 0 ) {
+ print STDERR @_;
+ print STDERR "\n$text";
+ print STDERR "Try \`splitindex.pl --help\' for more information.\n";
+ exit 1;
+ } else {
+ print $text;
+ }
+}
diff --git a/Master/texmf-dist/source/latex/svn/Makefile b/Master/texmf-dist/source/latex/svn/Makefile
new file mode 100644
index 00000000000..5b31a57232b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svn/Makefile
@@ -0,0 +1,68 @@
+#$Id$
+#Makefile for the svn distribution
+
+#Most Useful Options are as follows:
+# make sty #(or `make svn.sty' or just `make') generate svn.sty only
+# make all #generate svn.sty and its documentation (.dvi format)
+# make dvi #or (`make svn.dvi'): generate documentation (.dvi format)
+# make ps #or (`make svn.ps'): generate documentation (.ps format)
+# make pdf #or (`make svn.pdf'): generate documentation (.pdf format)
+# make alldocs #generate documentation in .dvi,.ps and .pdf format
+
+# make clean #(or `make clean-dotfiles') remove all `dotfiles' (.aux, .log etc)
+# make distclean #as `make clean', but delete all .sty and documentation
+# #files too
+
+SHELL=/bin/sh
+
+#TeX and friends
+LATEX=latex
+PDFLATEX=pdflatex
+MAKEINDEX=makeindex
+
+#before running $(MAKEINDEX) we first need to run $(MAKEIDX) on the .dtx
+#to generate the .idx $(MAKEIDX) is $(LATEX) or $(PDFLATEX), depending on
+#whether we want a .dvi/.ps or .pdf at the end.
+#the default is to make dvi
+MAKEIDX=$(LATEX)
+
+sty: svn.sty
+svn.sty: svn.ins svn.dtx
+ @echo "Generating svn.sty"
+ $(LATEX) svn.ins
+
+svn.ind: svn.dtx
+ $(MAKEIDX) svn.dtx
+ makeindex -s gind.ist -o svn.ind svn.idx
+
+dvi ps svn.dvi svn.ps: MAKEIDX=$(LATEX)
+pdf svn.pdf: MAKEIDX=$(PDFLATEX)
+
+dvi: svn.dvi
+svn.dvi: svn.dtx svn.sty svn.ind
+ @echo "Generating svn.dvi"
+ $(LATEX) svn.dtx
+
+ps: svn.ps
+svn.ps: svn.dvi
+ @echo "Generating svn.ps"
+ dvips svn.dvi
+
+pdf: svn.pdf
+svn.pdf: svn.dtx svn.sty svn.ind
+ @echo "Generating svn.pdf"
+ $(PDFLATEX) svn.dtx
+
+.SUFFIXES:
+.PHONY: all alldocs clean clean-dotfiles distclean dvi ps pdf sty
+all: svn.sty svn.dvi
+
+alldocs: dvi pdf ps
+
+clean clean-dotfiles:
+ @echo "Deleting unnecessary (pdf)(la)TeX temp files"
+ -rm svn.{aux,idx,ilg,ind,log}
+
+distclean: clean-dotfiles
+ @echo "Deleting svn.{sty,ps,pdf,dvi}"
+ -rm svn.{sty,dvi,ps,pdf} \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/svn/svn.dtx b/Master/texmf-dist/source/latex/svn/svn.dtx
new file mode 100644
index 00000000000..141a1550378
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svn/svn.dtx
@@ -0,0 +1,500 @@
+% \iffalse meta-comment
+% $Id: svn.dtx 32 2003-09-21 19:08:50Z rpil2 $
+%
+% This file 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.
+%
+% \fi
+%
+% \iffalse
+%<*package>
+%\NeedsTeXFormat{LaTeX2e}
+%\def\svn@Id $Id: #1 #2 #3-#4-#5 #6$%
+% {\def\svn@date{#3/#4/#5}%
+% \def\svn@revision{#2}}
+%
+%\svn@Id $Id: svn.dtx 32 2003-09-21 19:08:50Z rpil2 $
+%\edef\next{%
+% \noexpand\ProvidesPackage{svn}[\svn@date\space r\svn@revision\space
+% Typeset subversion keywords.]}
+%\next
+%</package>
+%
+%<*driver>
+\documentclass{ltxdoc}
+ \usepackage[T1]{fontenc}
+ \usepackage[latin1]{inputenc}
+ \usepackage[british]{babel}
+ \usepackage{svn}
+ \EnableCrossrefs
+ \CodelineIndex
+%\OnlyDescription
+%\RecordChanges
+ \begin{document}
+ \DocInput{svn.dtx}
+ \end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{107}
+%
+% \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 \~}
+%
+% \GetFileInfo{svn.sty}
+% \DoNotIndex{\NeedsTeXFormat,\ProvidesPackage,\next}
+% \DoNotIndex{\newcommand,\def,\edef,\gdef,\global,\let}
+% \DoNotIndex{\noexpand,\expandafter,\csname,\endcsname}
+% \DoNotIndex{\protect}
+% \DoNotIndex{\if,\ifx,\else,\fi,\begingroup,\endgroup}
+% \DoNotIndex{\space,\@empty,\@ifundefined,\@nameuse}
+%
+%
+% \let\prog\textsf
+% \let\format\texttt
+% \def\shell#1{`\texttt{#1}'}
+% \let\package\textsf
+% \let\email\texttt
+% \let\url\texttt
+% \def\param#1{\texttt{\##1}}
+% \def\Subversion{\prog{Subversion}}
+% \def\CVS{\prog{CVS}}
+% \def\RCS{\prog{RCS}}
+%
+% \title{The \package{svn} package\thanks{This document
+% corresponds to \package{svn}~\fileversion, dated \filedate.}}
+% \author{Richard Lewis \\ \email{rpil+svn@rtf.org.uk}}
+%
+% \def\convertfiledate/#1/#2/#3/{%
+% \def\convertedfiledate{\begingroup\day#3 \month#2 \year#1 \today\endgroup}
+% }
+% \expandafter\convertfiledate\expandafter/\filedate/
+% \date{\convertedfiledate}
+% \maketitle
+%
+% \section{Introduction}
+% \Subversion\ is a replacement for \CVS\ and \RCS. It is similar to
+% \CVS\ but with some improvements (e.g., it understands
+% renaming and deletion of version controlled files---see
+% \url{http://subversion.tigris.org/} for more information). As with
+% \CVS\ and \RCS, a file registered with \Subversion\ may
+% contain keywords (such as |$Date$| or |$Revision$|) that
+% \Subversion\ will replace with status information about the file
+% (such as the date the file was last committed, or the revision at
+% which it last changed).\footnote{Unlike \RCS\ and \CVS, the
+% expansion of such keywords is customisable, and not enabled by
+% default: use \shell{svn propset svn:keywords "Date Id" myfile.tex}
+% to tell \Subversion\ to expand the keywords
+% \texttt{\string$Date\string$} and \texttt{\string$Id\string$} in
+% \shell{myfile.tex}.}
+%
+% For typesetting the contents of \RCS\ and \CVS\ keywords
+% there is the \package{rcs} package\footnote{Written by Joachim
+% Schrod with minor modification by Jeffrey Goldberg}; although highly
+% recommended, that package does not cope with the format of
+% \Subversion's |$Date$| keyword, so I wrote the \package{svn} package
+% to do just that.
+%
+% \section{Usage}
+% \subsection{Quick Example}
+% The main use for this package is to get the date the file was last
+% committed into the output of |\maketitle|. The solution is simple:
+%
+% \begin{verbatim}
+% \documentclass{article}
+% \usepackage{svn}
+% \SVNdate $Date$
+% \begin{verbatim}
+% \title{Hope this works}
+%
+% \begin{document}
+% \maketitle
+% \end{document}
+% \end{verbatim}
+%
+% \subsection{More General Usage}
+% As usual, load the \package{svn} package with |\usepackage{svn}|.
+%
+% The main command is |\SVN $|\meta{Keyword}|$| (which mimics
+% `|\RCS $|\meta{Keyword}|$|' from the \package{rcs} package).
+% By default the following happens:
+% \begin{itemize}
+% \item If you say |\SVN $Keyword: stuff $| (i.e,
+% |$Keyword$| has been expanded to `|stuff|') then:
+% \begin{itemize}
+% \item If |$Keyword$| is |$Date$| or |$\LastChangedDate$|, then
+% |\SVNDate| is defined to be the date the file was checked in,
+% |\SVNTime| is the time of check-in, and |\SVNRawDate| is defined
+% to be `|stuff|'.
+% \item Otherwise a command |\SVNKeyword| is defined to be
+% `|stuff|'.
+% \end{itemize}
+% \item If you say |\SVN $Keyword$| (i.e., |$Keyword$| was
+% not expanded---perhaps it doesn't appear in the \url{svn:keywords}
+% property, or perhaps the file has not been checked in since the
+% line was added), then:
+% \begin{itemize}
+% \item If |$Keyword$| is |$Date$| (or |$\LastChangedDate$|), then
+% |\SVNDate| is defined to be |\today|, |\SVNTime| and
+% |\SVNRawDate| are set to |\SVNempty|, (which is empty by default
+% and can be changed with |\renewcommand|).
+% \item Otherwise |\SVNKeyword| is defined to be |\SVNempty|.
+% \end{itemize}
+% \end{itemize}
+% In principal you may use |\SVN| anywhere, but you may find problems
+% if some package (e.g., \package{babel} with the |french| option) has
+% made characters appearing in keywords active. |\SVN| should always
+% work in the preamble.
+%
+% \subsection{\texttt{\string\SVNdate}}
+% Since you probably want to have the date of check-in the output of
+% |\maketitle|, we provide the construct `|\SVNdate $Date$|' to do
+% just that (note the difference between this and |\SVNDate|: the
+% latter expands to the check-in time (or |\today|)). This is exactly
+% the same as saying `|\SVN $Date$ \date{\SVNDate}|', but saves some
+% typing.
+%
+%
+% \subsection{Advanced Usage and Customisation}
+% The default behaviour described above can be modified to do all
+% kinds of fancy things with all kinds of fancy keywords. When you
+% say |\SVN $keYwoRd: stuff$|, if the command |\SVN@keYwoRd@expanded|
+% exists\footnote{As ever, `exists' means ``defined and not equal to
+% `\texttt{\string\relax}'} then it will be executed with two arguments:
+% `|\SVN@keYwoRd@expanded{keYwoRd}{stuff : }|' (note the trailing
+% `\verb*| : |'). If |\SVN@keYwoRd@expanded| does not exist then
+% |\SVN@generic@expanded| is run (again with arguments
+% `|{keYwoRd}{stuff : }|), which defines |\SVNkeYwoRD| to be |stuff|.
+%
+% If instead we had an unexpanded keyword (e.g., `|\SVN $keYwoRd$|')
+% then \package{svn} will try and run
+% |\SVNkeYwoRd@unexpanded{keYwoRd}{}|, falling back to
+% |\SVN@generic@unexpanded{keYwoRd}{}| if
+% |\SVN@keYwoRd@unexpanded| does not exist.
+% |\SVN@generic@unexpanded{keYwoRd}{}| will define |\SVNkeYwoRd| to be
+% |\SVNempty|, which is initially just |\relax|, but may be redefined
+% (just use |\renewcommand|).
+%
+% So if you want some fancy behaviour for some fancy new keyword, you
+% just need to define |\SVN@|\meta{Keyword}|@expanded| and
+% |\SVN@|\meta{Keyword}|@unexpanded| to do what you want. Both variants
+% should take two arguments which are \marg{KeywordName}\marg{expansion}.
+% |\SVN@|\meta{Keyword}|@unexpanded| will be called with
+% \meta{expansion} empty, and |\SVN@|\meta{Keyword}|@expanded| will
+% be called with \meta{expansion} as the keyword expansion text plus a
+% trailing `\verb*| : |' (which can be removed using the predefined
+% |\svn@set| command---see the following example).
+%
+% As a simple example, |\SVN $Rev$| will define a
+% |\SVNRevsion| command. Subversion treats |$LastChangedRevision$| as
+% an alias for |$Rev$|, so if you wanted both
+% |\SVN $Rev$| and |\SVN $LastChangedRevision$| to define both
+% |\SVNLastChangedRevision| and |\SVNRev| then you
+% could put the following in your preamble:
+% \begin{verbatim}
+% \makeatletter
+% %%These first two are run when \SVN sees a `Rev' keyword.
+% \def\SVN@Rev@unexpanded#1#2{%
+% \let\SVNRev\SVNempty
+% \let\SVNLastChangedRevision\SVNRev
+% }
+% %%The `@expanded' receives the keyword name as #1 and the
+% %%keyword expansion (with trailing ` : ') as #2.
+% \def\SVN@Rev@expanded#1#2{%
+% \svn@set\SVNRev$#2$%
+% \let\SVNLastChangedRevision\SVNRev
+% }
+% %%These next two lines make \SVN treat `LastChangedRevision'
+% %%exactly the same as `Rev'
+% \let\SVN@LastChangedRevision@unexpanded\SVN@Rev@unexpanded
+% \let\SVN@LastChangedRevision@expanded\SVN@Rev@expanded
+% \makeatother
+% \end{verbatim}
+% \subsection{Known Issues}
+% If you use \package{babel} you will get the date produced by the
+% |\SVNDate| command in the correct style for the current language,
+% and if you change the language, the text produced by |\SVNDate| may
+% change. This may be undesirable, and the naïve solution is to say
+% |\edef\SVNDateText{\SVNDate}| before the language change. However,
+% with the code stolen from the \package{rcs}, inside an |\edef|
+% |\SVNDate| expands to |\today|, whatever the check-in date. To work
+% around this |\SVNDate| has been designed to generate an error inside
+% an |\edef|.
+%
+% One way to store the check-in date in a language-independent way is
+% the following, which defines |\fixatedSVNDate| to be the german
+% version of the check-in date, but note that
+% |\edef\foo{\fixatedSVNDate}\foo| will still give |\today|'s date
+% (and no error).
+% \begin{verbatim}
+% \def\fixateSVNDate{%
+% \def\foo{\today}
+% \ifx\SVNDate\foo
+% \let\fixatedSVNDate\today
+% \else
+% \expandafter\fixateSVNDateExpanded\SVNDate
+% \fi
+% }
+%
+% \def\fixateSVNDateExpanded\begingroup#1\day#2\today\endgroup{%
+% \let\fixedtoday\today
+% \def\fixatedSVNDate{\begingroup\day#2\fixedtoday\endgroup}%
+% }
+%
+% %% To fix the Date format, use \fixateSVNDate:
+% \SVN $Date: 3999-07-30 14:58:54 +0100 (Thu, 30 Jul 3999) $
+% german: \selectlanguage{german}\fixateSVNDate\SVNDate\\
+% english : \selectlanguage{english} \SVNDate\\
+% We still have access to german format: \fixatedSVNDate
+% \end{verbatim}
+%
+% The second known issue is that the \format{ps} and \format{pdf} formatted
+% documentation is different from the \format{dvi} format (look at
+% page 6). This happens even when converting \format{dvi}
+% to \format{ps} via \shell{dvips}, so may be a bug in
+% \shell{ggv}?
+%
+% \subsection{Avoiding Unwanted Keyword Expansion}
+% Although nothing to do with this package, the following may be
+% useful.
+%
+% Sometimes your document contains strings of the form `|$...$|' which,
+% although looking like keywords, should not be expanded by
+% \Subversion. There are several ways to stop this expansion.
+%
+% Firstly, \Subversion\ only expands the keywords you tell it to,
+% so if you say \shell{svn propset svn:keywords "Id" myfile.tex}
+% (and then commit), |$Date$| will not be expanded anywhere. This
+% leaves the case where you want to use something like
+% |\SVNdate $Date$| at the top, but also use |$Date$| somewhere else.
+% \begin{description}
+% \item[In-line maths:] If you are using |$Date$| because it
+% is the product of the variables $D$, $a$, $t$ and $e$, then you
+% could use |\newcommand{\somemaths}[1]{$#1$}| and then
+% |\somemaths{Date}|.
+% Alternatively, replace the dollars with |^^24|: `|^^24Date^^24|'.
+% \item[Verbatim:] If you want the string |$Date$|
+% to appear verbatim in your \format{dvi}, then you could use
+% |\texttt{\string$Date\string$}| (or use |\verb| around the |$|, but
+% that will break in footnotes)
+% \end{description}
+%
+% \StopEventually{\PrintIndex}
+%
+% \section{Implementation}
+% \subsection{General Admin Stuff}
+% \begin{macro}{\svn@date}
+% \begin{macro}{\svn@revision}
+% First we do the usual |\ProvidesPackage| stuff. Of course,
+% \url{svn.dtx} is itself under \Subversion, and we want to get the
+% package date and version from the \texttt{\string$Id\string$}
+% keyword.
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\def\next $Id: #1 #2 #3-#4-#5 #6${%
+ \def\svn@date{#3/#4/#5}%
+ \def\svn@revision{#2}%
+}
+\next $Id: svn.dtx 32 2003-09-21 19:08:50Z rpil2 $
+\edef\next{%
+ \noexpand\ProvidesPackage{svn}[\svn@date\space r\svn@revision\space
+ Typeset Subversion keywords.]%
+}
+\next
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%\subsection{The generic \texttt{\string\SVN} command}
+% \begin{macro}{\SVN}
+% |\SVN| is the main construct (see above for
+% usage). The single argument should be of the form
+% |$|\meta{Keyword}|$| or
+% |$|\meta{Keyword}:\meta{space}\meta{value}\meta{space}|$|, where \meta{Keyword}
+% and \meta{value} must be non-empty as well as brace- and
+% |\if|--|\fi|- balanced. \meta{space} is a single space (if more are
+% present they will be subsumed into \meta{value}).
+% If `|$empty$|', `|$generic$|', `|$RawDate$|', |$Time$| or ever become
+% keywords, or if keywords containing |@| ever exist then we may have
+% problems.
+% \begin{macrocode}
+\def\SVN $#1${\svn@$#1: $}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SVNempty}
+% If \meta{Keyword} is unexpanded then |\SVNKeyword| is |\let| to
+% |\SVNempty|, which is initially empty.
+% \begin{macrocode}
+\let\SVNempty\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\svn@}
+% \begin{macro}{\svn@tmp}
+% |\snv@| does the work for |\SVN|. It takes two arguments, the first
+% is the \meta{Keyword}'s name, the second is empty (in which case
+% \meta{Keyword} was unexpanded) or \meta{value}, the expansion of
+% \meta{keyword}.
+% \begin{macrocode}
+\def\svn@$#1: #2${%
+ \def\svn@tmp{#2}%
+% \end{macrocode}
+% \begin{macro}{\svn@suffix}
+% If \param2 is empty, then the keyword was unexpanded and
+% |\svn@suffix| is set to |@unexpanded|, otherwise we had an expanded
+% keyword so |\svn@suffix| is set to |@expanded|.
+% \begin{macrocode}
+ \ifx\svn@tmp\@empty
+ \def\svn@suffix{@unexpanded}%
+ \else
+ \def\svn@suffix{@expanded}%
+ \fi
+% \end{macrocode}
+% If |\SVN@|\param1\meta{suffix} is defined
+% then run it with arguments `\param1\param2', else
+% run |\SVN@generic@|\meta{suffix} (again with argument
+% \param1\param2---by default this defines `|\SVN|\meta{\param1}' to
+% be \param2, or |\SVNempty| in the unexpanded case).
+% \begin{macrocode}
+ \@ifundefined{SVN@#1\svn@suffix}%
+ {\@nameuse{SVN@generic\svn@suffix}{#1}{#2}}%
+ {\@nameuse{SVN@#1\svn@suffix}{#1}{#2}}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Dealing with general \texttt{\string$Keyword\string$}s}
+% \begin{macro}{\SVN@generic@expanded}
+% When we see |\SVN $KeyWord: <stuff> $|, and no
+% |\SVN@KeyWord@expanded| command exists, we use
+% |\SVN@generic@expanded{KeyWord}{<stuff>}|
+% to define |\SVNKeyWord| to be |<stuff>|.
+% \begin{macrocode}
+\def\SVN@generic@expanded#1#2{%
+ \expandafter\svn@set\csname SVN#1\endcsname$#2$%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\SVN@generic@unexpanded}
+% When we see |\SVN $KeyWord$| and no
+% |\SVN@KeyWord@unexpanded| command exists, we use
+% |\SVN@generic@unexpanded{KeyWord}|
+% to define |\SVNKeyWord| to be |\SVNempty|.
+% \begin{macrocode}
+\def\SVN@generic@unexpanded#1#2{%
+ \expandafter\global\expandafter\let\csname SVN#1\endcsname\SVNempty
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\svn@set}
+% |\svn@set#1$#2$| defines the command in \param{1} to be \param{2}
+% without the trailing `\verb*| : |' that the call to |\svn@| added.
+% \begin{macrocode}
+\def\svn@set#1$#2 : ${\gdef#1{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Dealing with the \texttt{\string$Date\string$} keyword}
+% \begin{macro}{\SVN@Date@unexpanded}
+% \begin{macro}{\SVN@LastChangedDate@unexpanded}
+% When we see a |\SVN $Date$| (or |\SVN $LastChangedDate$|), we
+% define |\SVNDate| and |\SVNTime| to be the current date and
+% time. The argument \param1 will be the name of the keyword
+% actually used (i.e., |Date| or |LastChangedDate|), and \param2 will be
+% empty since \param1 was not expanded.
+% Note that we don't say |\let\SVNDate\today| as we want \package{bable} to
+% be able to influence the formatting of |\SVNDate|.
+% \begin{macrocode}
+\def\SVN@Date@unexpanded#1#2{%
+ \gdef\SVNDate{\today}%
+ \global\let\SVNTime\SVNempty
+ \global\let\SVNRawDate\SVNempty
+}
+\let\SVN@LastChangedDate@unexpanded\SVN@Date@unexpanded
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SVN@Date@expanded}
+% \begin{macro}{\SVN@LastChangedDate@expanded}
+% When we see |\SVN $Date: <date> <time> ... $|,
+% we set |\SVNRawDate| to the whole `|<date> <time> ...|' string, and
+% put the date and time of check-in into |\SVNDate| and
+% |\SVNTime|.
+% \begin{macrocode}
+\def\SVN@Date@expanded#1#2{%
+ \svn@set\SVNRawDate$#2$%
+ \svn@parse@date$#2$%
+}
+\let\SVN@LastChangedDate@expanded\SVN@Date@expanded
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\svn@parse@date}
+% \begin{macro}{\SVNDate}
+% \begin{macro}{\SVNTime}
+% |\svn@parse@date| is what actually puts the date of check-in (or
+% |\today|) into |\SVNDate|. The idea for this is copied from the
+% \package{rcs} package.
+%
+% We use the |$|'s to remove the leading space and then, inside a group,
+% we change the current date and then call |\today|---this way if
+% \package{babel} is used, we'll get |\SVNdate| in the correct
+% language format. Since the |\day| commands are not
+% expandable but |\today| is, we add a |\def| to give an error
+% inside an |\edef| (see also the ``Known Issues'' section).
+% \begin{macrocode}
+\def\svn@parse@date$#1-#2-#3 #4:#5:#6 #7${%
+ \gdef\SVNDate{%
+ \begingroup
+ \def\svn@tmp{\PackageError{svn}{\SVNDate should not
+ be used in an \protect\edef}{See the svn.sty documentation for a
+ work around.}}%
+ \day#3 \month#2 \year#1
+ \today
+ \endgroup}%
+% \end{macrocode}
+% We could add `GMT' to |\SVNTime|. Or not bother.
+% \begin{macrocode}
+ \gdef\SVNTime{#4:#5:#6}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SVNdate}
+% |\SVNdate $Date$| puts the check-in date into the output of |\maketitle|.
+% \begin{macrocode}
+\def\SVNdate $#1${\SVN $#1$\date{\SVNDate}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \Finale
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/svn/svn.ins b/Master/texmf-dist/source/latex/svn/svn.ins
new file mode 100644
index 00000000000..d4c5c215631
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svn/svn.ins
@@ -0,0 +1,58 @@
+%% $Id: svn.ins 32 2003-09-21 19:08:50Z rpil2 $
+%%
+%% Copyright (C) 2003 by Richard Lewis <rpil+svn@rtf.org.uk>
+%%
+%% This file 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.
+%%
+
+\input docstrip.tex
+%\keepsilent
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2003 by Richard Lewis <rpil+svn@rtf.org.uk>
+
+This file 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.
+
+\endpreamble
+
+\generate{\file{svn.sty}{\from{svn.dtx}{package}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* svn.sty *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file svn.dtx *}
+\Msg{* through LaTeX: *}
+\Msg{* latex svn.dtx *}
+\Msg{* (If you then do *}
+\Msg{* makeindex -s gind.ist -o svn.ind svn.idx *}
+\Msg{* latex svn.dtx *}
+\Msg{* the documentation will be indexed). *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/latex/svninfo/Makefile b/Master/texmf-dist/source/latex/svninfo/Makefile
new file mode 100644
index 00000000000..968b2ea99f7
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svninfo/Makefile
@@ -0,0 +1,108 @@
+########################################################################
+## LaTeX2e Makefile
+##
+## For configuration, update the following defines:
+##
+## $Id: Makefile 1490 2005-09-30 14:30:44Z brucker $
+##
+## This file ist part of the svninfo package. Please see the file
+## svninfo.dtx for copyright information.
+########################################################################
+
+BASE = svninfo
+
+TEXDIR =
+CONTRIB = $(TEXDIR)/lib/texmf/tex/latex2e/contrib/$(BASE)
+DOCDIR = $(TEXDIR)/doc/latex2e
+
+DVIPS = dvips
+LATEX = latex
+MAKEINDEX = makeindex
+LATEX2HTML = latex2html
+PDFLATEX = pdflatex
+
+ HTML_VER = 4.0,latin1,math
+
+HTML_DIR = html
+
+TAR = tar
+
+########################################################################
+
+REV = 0.3
+TAR_FILE = svninfo-$(REV).tar.gz
+TAR_DIR = svninfo-$(REV)
+SRC = svninfo.dtx svninfo.ins README-$(REV) Makefile
+GEN = svninfo.sty svninfo2html.tex svninfo.perl svninfo.cfg \
+ svninfo.init
+
+all: $(BASE).sty dvi ps html pdf clean
+
+sty: svninfo.sty
+dtx: svninfo.dtx svninfo2html.tex
+dvi: svninfo.dvi svninfo2html.dvi
+ps: svninfo.ps svninfo2html.ps
+pdf: svninfo.pdf svninfo2html.pdf
+idx: $(BASE).ind $(BASE).gls
+ $(LATEX) $(BASE).dtx
+
+%.sty:%.dtx %.ins
+ $(LATEX) $*.ins
+
+svninfo.cfg: svninfo.sty
+svninfo2html.tex: svninfo.sty
+svninfo.perl: svninfo.sty
+svninfo.init: svninfo.sty
+
+%.dvi:%.dtx
+ $(LATEX) $*.dtx
+ makeindex -s gind.ist -o svninfo.ind svninfo.idx
+ makeindex -s gglo.ist -o svninfo.gls svninfo.glo
+ $(LATEX) $*.dtx
+
+%.dvi:%.tex
+ $(LATEX) $*.tex
+ $(LATEX) $*.tex
+
+%.pdf:%.dtx
+ rm -f *.toc *.out
+ $(PDFLATEX) $*.dtx
+ $(PDFLATEX) $*.dtx
+
+%.pdf:%.tex
+ $(PDFLATEX) $*.tex
+ $(PDFLATEX) $*.tex
+
+%.ps:%.dvi
+ $(DVIPS) $*.dvi
+
+html: svninfo.perl svninfo2html.tex
+ rm -fr $(HTML_DIR)
+ mkdir $(HTML_DIR)
+ @if type $(LATEX2HTML) > /dev/null 2>&1; \
+ then $(LATEX) svninfo2html.tex; \
+ $(LATEX2HTML) -dir $(HTML_DIR) -init_file svninfo.init \
+ -html_version $(HTML_VER) svninfo2html.tex; \
+ else echo; echo; \
+ echo "******* no $(LATEX2HTML) installed"; \
+ echo; echo; \
+ fi
+
+tar: distclean
+ rm -f README-$(REV)
+ cp README README-$(REV)
+ rm -fr $(TAR_DIR) $(TAR_FILE) $(TAR_FILE).gz
+ mkdir $(TAR_DIR)
+ cp -p $(SRC) $(TAR_DIR)
+ $(TAR) -zcvf $(TAR_FILE) $(TAR_DIR);
+ rm -rf $(TAR_DIR)
+
+clean:
+ rm -f *.log *.aux *.lof *.lot *.toc *.idx *.ind *.glo *.gls *~ *.ilg \
+ *.out
+
+realclean: clean
+ rm -fr $(HTML_DIR) *.dvi *.ps $(GEN) *.pdf
+
+distclean: realclean
+ rm -fr README-*
diff --git a/Master/texmf-dist/source/latex/svninfo/svninfo.dtx b/Master/texmf-dist/source/latex/svninfo/svninfo.dtx
new file mode 100644
index 00000000000..4ab963da6e1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svninfo/svninfo.dtx
@@ -0,0 +1,1328 @@
+%\iffalse
+%<*header>
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% `svninfo' package to use with LaTeX2e.
+%%
+%% This package is used to extract the revision and file information provided
+%% by the Subversion revision control system.
+%% A PERL-package supporting svninfo and LaTeX2HTML is provieded too.
+%%
+%% Copyright (C) 1995 Dr. Juergen Vollmer
+%% Copyright (C) 2003-2005 Achim D. Brucker
+%%
+%% License:
+%% 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.
+%%
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%
+%\iffalse
+% to test the checksum, uncomment \OnlyDescription
+% in the driver
+%\fi
+%
+%% \CheckSum{345}
+%% \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 \~}
+%</header>
+%\fi
+
+% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs}
+% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo}
+% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage}
+% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage}
+% \DoNotIndex{\LoadClass,\PassOptionsToClass,\PassOptionsToPackage}
+% \DoNotIndex{\DeclareOption,\CurrentOption,\ProcessOptions,\ExecuteOptions}
+% \DoNotIndex{\AtEndOfClass,\AtEndOfPackage,\AtBeginDocument,\AtEndDocument}
+% \DoNotIndex{\InputIfFileExists,\IfFileExists,\ClassError,\PackageError}
+% \DoNotIndex{\if,\else,\fi,\emph,\footnotesize,\footrulewidth,\let}
+% \DoNotIndex{\newcount,\newif,\number,\or,\parindent,\plainfootrulewidth}
+% \DoNotIndex{\PrintChanges,\PrintIndex,\relax,\setlength,\space}
+% \DoNotIndex{\the,\textwidth,\thepage,\newcommand,\texttt,\verb,\vfill}
+% \DoNotIndex{\input,\newpage,\setcounter,\newcounter,\\,\ ,\typeout,\today}
+%
+% \MakeShortVerb{\|}
+% \newcommand{\LatexToHtml}{\LaTeX 2\texttt{HTML}}
+% \newcommand{\Cmd}[1]{\texttt{$\backslash$#1}}
+% \newcommand{\SVN}{\emph{Subversion}}
+% \newcommand{\blank}{{\tiny$_\sqcup$}}
+% \newcommand{\Id}{\texttt{\$Id\$}}
+% \newcommand{\SvnInfoCmd}[1]{\texttt{$\backslash$svnInfo\blank\$Id#1\$}}
+%
+% \changes{v0.3}{2005/09/30}{Added support for \texttt{\$Id:\$} keywords without
+% owner information (a bug reported by Uwe Ziegenhagen).}
+% \changes{v0.2.1}{2005/04/07}{Added \texttt{\\svnId} (suggested by Thomas Weber).}
+% \changes{v0.2}{2005/01/17}{Removed \LatexToHtml{} build-dependency.}
+% \changes{v0.1}{2003/08/14}{Initial version, mainly a modified version
+% of the \texttt{rcsinfo} package.}
+%
+% \title{The \texttt{svninfo} package}
+% \author{Achim D.~Brucker\\
+% {\footnotesize email: brucker@freiburg.linux.de}}
+% \date{Oktober 3, 2005\\Version 0.3}
+%
+% \maketitle
+%
+% \begin{abstract}
+% \noindent This package is used to extract the revision and file
+% information provided by the \SVN\ revision control system
+% (\texttt{http://subversion.tigris.org}). Support for the \LatexToHtml\
+% conversion tool is provided\footnote{\LatexToHtml\ is a conversion
+% tool that allows documents written in \LaTeX\ to become part of the
+% World Wide Web. It's written by \emph{Nikos Drakos, Computer Based
+% Learning Unit, University of Leeds.}}.
+% \end{abstract}
+%
+%\section{Introduction}
+%
+% To maintain different versions of a document or to keep track on the
+% development of one,
+% the document is kept under a revison control system like \emph{SCCS},
+% \emph{CVS}, or \SVN.
+% This package assumes you are using the \SVN\ system.
+% To present the version information of a document, one needs to extract it
+% from some kind of text inserted by the revision control system.
+% \SVN\ offers therefore the \Id\ keyword, which is expanded by the \SVN\
+% \emph{update} command and contains a
+% lot of useful information. This information is made available through
+% this package.
+%
+% The information obtained from the expanded \Id\ string are
+% \begin{itemize}
+% \item the filename,
+% \item the revision number,
+% \item the date and time of the last \SVN\ \emph{co} command, and
+% \item name of the user who has done this action.
+% \end{itemize}
+% For each of these items a macro is defined.
+% When \emph{updating} a file, the \SVN\ keywords should be contained in
+% the \emph{updated} source. Further, one has to set the \SVN property
+% for keyword expansion of that file, e.g.\
+% \begin{verbatim}
+% svn propset svn:keywords "Id" svninfo.dtx
+% \end{verbatim}
+% See the \SVN\ documentation for more details.
+% If the user wishes, the |\today| macro is redefined, so that it returns
+% the \SVN\ date.
+%
+% If you want to read about the implementation, put a \% before
+% |\Only|\-|Description| in the code marked with |<*driver>| in the file
+% |svninfo.dtx|.
+%
+%\section{User Interface}
+%
+%\subsection{Options}
+%
+% Options for this package are:
+%
+% \begin{description}
+% \item[today]
+% Set the date of |\today| to the date obtained by the \SVN\ information.
+% If the \Id\ string is not expanded (see below), the current date is
+% used.
+% \item[notoday]
+% Don't use the \SVN\ date for |\today|.
+% \item[fancyhdr]
+% We use the \texttt{fancyhdr} package to fill the footline with
+% \SVN\ information: filename, revision-number and date.
+%
+% If the \texttt{fancyhdr} package is not already loaded, it will be
+% loaded
+% by this package. To use the footnotes, put something like:\\
+% \hspace*{1em}|\pagestyle{fancyplain}|\\
+% \hspace*{1em}|\fancyhead[RE,LO]{\leftmark}|\\
+% \hspace*{1em}|\fancyhead[LE,RO]{\thepage}|\\
+% in the preamble.
+% \item[nofancy]
+% We don't define the footline. The
+% \texttt{fancyhdr} package is not loaded.
+% \item[long]
+% If used together with \texttt{fancy} / \texttt{fancyhdr} the date
+% string is printed in the long format
+% as |\today| returns it. If \texttt{fancy} / \texttt{fancyhdr}
+% is not used, nothing.
+% \item[short]
+% If used together with \texttt{fancy} / \texttt{fancyhdr} the date
+% string is printed in the short
+% format \emph{YYYY-MM-DD}.
+% If \texttt{fancy} / \texttt{fancyhdr} is not used, nothing.
+% \end{description}
+% If the \texttt{babel} package is used, the |\today| string is language
+% dependent.
+%
+% The default options are: \emph{today,long}. In the configuration file
+% |svninfo.cfg| one of fancy heading packages may be set as a default
+% option too.
+%
+%\subsection{Commands}
+%
+% \subsubsection{Defining the \SVN\ information}
+%
+% There is only one macro to define the information:
+% |\svnInfo|\DescribeMacro{\svnInfo}.
+% Since it must collaborate with \SVN\ it has an ``unusual'' calling sequence:
+% The arguments are surrouned by \$.
+% The following arguments are valid:\\
+% \hspace*{0.5em} \SvnInfoCmd{}\\
+% \hspace*{0.5em} \SvnInfoCmd{:}\\
+% \hspace*{0.5em} \SvnInfoCmd{:\blank\emph{file}\blank\emph{rev}\blank\emph{YYYY-MM-DD}\blank\emph{hh:mm:ss}\blank\emph{owner}}
+%
+% In the first two forms, \SVN\ has not expanded the \Id\ string.
+% This form will usually be used before the file is \emph{checked in}
+% the first time.
+%
+% \emph{YYYY-MM-DD} is a date, \emph{hh:mm:ss} a time.
+% Note: when you perform the \SVN\ \emph{check out} command, the \Id\ string
+% is expanded by \SVN\ automatically.
+%
+% To take effect, |\svnInfo| must follow the |\begin{document}|.
+% If you are using multiple files for a document, you could place
+% |\svnInfo| at the
+% beginning of each file, so the information from the current file is
+% obtained (this is not valid, when translating with \LatexToHtml, see below).
+%
+% \subsubsection{Accessing the \SVN\ information}
+% There are the following macros to access the information provided by \SVN.
+% If \SVN\ has not expanded the \Id\ string, or no |\svnInfo| command is given,
+% default values are returned.
+%
+% \begin{itemize}
+% \item \DescribeMacro{\svnInfoFile} The name of the source file.
+% Default: \texttt{--sourcefile--}.
+% \item \DescribeMacro{\svnInfoRevision} The \SVN\ revision number, of the
+% \emph{checked out} file.
+% Default: \texttt{--revision--}.
+% \item \DescribeMacro{\svnInfoDate} The date in the form \emph{YYYY-MM-DD},
+% when the file was \emph{checked out}.
+% Default: the current date.
+% \item \DescribeMacro{\svnInfoTime} The time, when the file was
+% \emph{checked out}.
+% Default: \texttt{--time--}.
+% \item \DescribeMacro{\svnInfoOwner} The user name of the file owner.
+% Default: \texttt{--owner--}.
+% \item \DescribeMacro{\svnInfoYear} The year \emph{YYYY} of |\svnInfoDate|.
+% Default: the current year.
+% \item \DescribeMacro{\svnInfoMonth} The month \emph{MM} of |\svnInfoDate|.
+% Default: the current month.
+% \item \DescribeMacro{\svnInfoDay} The day \emph{DD} of |\svnInfoDate|.
+% Default: the current day.
+% \item \DescribeMacro{\svnInfoLongDate} The date in the form of |\today|
+% when the file was \emph{checked out}. This is language dependend.
+% Default: the current date.
+% \item \DescribeMacro{\svnId} Mimicks the behavior of the \Id\ strings, i.e.\ it
+% prints a string with a summary of the above described information.
+% \end{itemize}
+%
+% \subsection{\LatexToHtml}
+%
+% When converting a \LaTeX\ document to \texttt{HTML} using the
+% \LatexToHtml\ tool,
+% it's possible to use the \SVN\ information in the \texttt{HTML} document too.
+% This functionality is offered by the extension file \texttt{svninfo.perl}
+% which should be placed into the directory \texttt{LATEX2HTML/styles}.
+% For more information have a look at the documentation of \LatexToHtml.
+%
+% An example is given in the file \texttt{svninfo2html.tex}.
+%
+% \noindent\underline{Notes}
+% \begin{itemize}
+% \item Use at least version \emph{99.1 release (March 30, 1999)} of
+% \LatexToHtml.
+%
+% \item You should |\usepackage{html}|.
+%
+% \item You must run \LaTeX\ on the input file before running \LatexToHtml.
+%
+% \item In order to make \LatexToHtml\ read the \verb|.aux| file, you must
+% either:
+% \begin{itemize}
+% \item call \LatexToHtml\ with the option
+% \verb|-show_section_numbers| or
+% \item include the \verb|.aux| file explicitly in your \LaTeX-source, by
+% adding the lines in the preamble:\\
+% \verb|\begin{htmlonly}|\\
+% \verb|\input{|\emph{source}\verb|.aux}|\\
+% \verb|\end{htmlonly}|\\
+% which requires \verb|\usepackage{html}|.
+% \end{itemize}
+% If you don't do so, the \verb|\svnInfo...| commands give no value.
+%
+% \item If using the \LatexToHtml\ tool, only the last |\svnInfo| takes
+% effect, e.g.~if using several input files each having the |\svnInfo|
+% command, only the vales of the last included file are used.
+% (If this is a serious problem for you, drop me a mail).
+%
+% \item If the \verb|fancy| / \verb|fancyhdr| option is given to the
+% \verb|svninfo| package,
+% the date of the \verb|ADDRESS| at the bottom of the \texttt{HTML}
+% page is set to the \SVN\ date.
+%
+% \item If you would like to set your own \verb|ADDRESS| text, you should
+% define a procedure, which sets \texttt{perl} \verb|$main::ADDRESS|
+% variable in your local \texttt{.latex2html} initialization file.
+% The routine may use the \texttt{perl}
+% variables shown below. Assign a reference of this procdure to the
+% \texttt{perl}-variable
+% \verb|$svninfo::SetAddressProc|.
+% E.g.\ if you have a \texttt{perl} routine \verb|&my_address_field|,
+% then \\
+% \verb|$svninfo::SetAddressProc = &my_address_field|.
+% \end{itemize}
+%
+% \newcommand{\Var}[1]{\texttt{\$svninfo::#1}}
+% \noindent
+% Here are the commands, the Perl-variables and their output:\\
+% \begin{tabular}{lll}
+% \LaTeX-command & \texttt{perl} variable & Result for this file \\\hline
+% \verb|\today| & \texttt{\$today} & \today \\
+% \verb|\svnInfoFile| & \Var{File} & \svnInfoFile \\
+% \verb|\svnInfoRevision| & \Var{Revision} & \svnInfoRevision \\
+% \verb|\svnInfoOwner| & \Var{Owner} & \svnInfoOwner \\
+% \verb|\svnInfoDate| & \Var{Date} & \svnInfoDate \\
+% \verb|\svnInfoLongDate| & \Var{LongDate} & \svnInfoLongDate \\
+% \verb|\svnInfoDay| & \Var{Day} & \svnInfoDay \\
+% \verb|\svnInfoMonth| & \Var{Month} & \svnInfoMonth \\
+% \verb|\svnInfoYear| & \Var{Year} & \svnInfoYear \\
+% \end{tabular}
+%
+% \section{Examples}
+%
+% \newcommand{\svnExample}{
+% \begin{tabular}[t]{rl}
+% \Cmd{svnInfoFile} & \svnInfoFile \\
+% \Cmd{svnInfoRevision} & \svnInfoRevision \\
+% \Cmd{svnInfoDate} & \svnInfoDate \\
+% \Cmd{svnInfoTime} & \svnInfoTime \\
+% \Cmd{svnInfoOwner} & \svnInfoOwner \\
+% \end{tabular}
+% \begin{tabular}[t]{rl}
+% \Cmd{svnInfoYear} & \svnInfoYear \\
+% \Cmd{svnInfoMonth} & \svnInfoMonth \\
+% \Cmd{svnInfoDay} & \svnInfoDay \\
+% \Cmd{svnInfoLongDate} & \svnInfoLongDate \\
+% \Cmd{today} & \today \\
+% \end{tabular}\\
+% \Cmd{svnId} \svnId
+% \bigskip
+%}
+%
+% \svnInfo $Id$
+% |\svnInfo| not expanded, no colon\\
+% \verb+\svnInfo $+\verb+Id$+\\
+% \svnExample
+%
+% \svnInfo $Id:$
+% |\svnInfo| not expanded, having colon\\
+% \verb+\svnInfo $+\verb+Id:$+\\
+% \svnExample
+%
+% \svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $
+% |\svnInfo| standard version\\
+% {\small\verb+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $+}\\
+% \svnExample
+%
+% \svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z $
+% |\svnInfo| standard version without owner\\
+% {\small\verb+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z $+}\\
+% \svnExample
+%
+% \svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $
+% |\svnInfo| no leading \$\\
+% {\footnotesize\verb+\svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $+}\\
+% \svnExample
+%
+% \section{Acknowledgements}
+% %%%%%%%%%%%%%%%%%%%%%%%%%
+% This package is directly based on \texttt{rcsinfo} from
+% Dr.~J{\"u}rgen Vollmer which is distributed via the CTAN archives
+% in directory '\texttt{macros/latex/contrib/rcsinfo}'. All the honour
+% belongs to him, I only adopted his code to the format of the
+% \verb+Id+ line subversion uses % and removed the support for
+% the outdated fancyheadings package.
+%
+% \section{Copyright and License}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{tabular}{ll}
+% Copyright (\copyright) 1995 & Dr. J{\"u}rgen Vollmer\\
+% Copyright (\copyright) 2003--2005 & Achim D.~Brucker \texttt{brucker@freiburg.linux.de}\\
+% \end{tabular}
+%
+% \noindent This program can be redistributed and/or modified under
+% the terms of the \LaTeX Project Public License Distributed from CTAN
+% archives in directory '\texttt{macros/latex/base/lppl.txt}'; either
+% version 1 of the License, or any later version.
+%
+% \StopEventually{}
+%
+% \section{The Documentation 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.
+%
+% If you want to read about the implementation, put a \% before
+% |\OnlyDescription| in the following code.
+% \begin{macrocode}
+%<*driver>
+\documentclass{article}
+\usepackage{doc}
+\usepackage{svninfo}
+\OnlyDescription
+\makeatletter
+\if@svnInfoUseFancyhdr@
+\pagestyle{fancyplain}
+\if@twoside
+\fancyhead[RE,LO]{\leftmark}
+\fancyhead[LE,RO]{\thepage}
+\else
+\fancyhead[R]{\leftmark}
+\fancyhead[L]{\thepage}
+\fi
+\fi
+\makeatother
+\RecordChanges
+\EnableCrossrefs
+\CodelineIndex
+\begin{document}
+\DocInput{svninfo.dtx}
+\PrintChanges
+\setcounter{IndexColumns}{2}
+\PrintIndex
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{The Configuration File}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% You can set up the default fancy headings package in the file
+% |svninfo.cfg|.
+% Use the |fancyhdr| package, by setting the default option: |fancyhdr|.
+% \begin{macrocode}
+%<*config>
+\ExecuteOptions{fancyhdr}
+%</config>
+% \end{macrocode}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \section{The Implementation}
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The implementation is based on cracking the \Id\ string. To support
+% \LatexToHtml\ some macro definitions are written to the |.aux| file.
+% These macros are the used by \LatexToHtml\ and |svninfo.perl| to extract
+% the \SVN\ info.
+%
+% What do we need, and who we are:
+% \begin{macrocode}
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{svninfo}[2005/09/29 v0.3]
+% \end{macrocode}
+%
+% Declare some local counters to store the \SVN\ date
+% \begin{macrocode}
+\newcount\@svnInfoDay
+\newcount\@svnInfoMonth
+\newcount\@svnInfoYear
+% \end{macrocode}
+% Declare some local counters to hold some temporary information
+% \begin{macrocode}
+\newcount\@svnInfoYearTmp
+\newcount\@svnInfoMonthTmp
+\newcount\@svnInfoDayTmp
+% \end{macrocode}
+%
+% To memorize, that we want to set |\today| to the date obtained by the
+% \SVN\ information.
+% \begin{macrocode}
+\newif\if@svnInfoToday@
+% \end{macrocode}
+%
+% |\today| should return the date obtained by the \SVN\ information.
+% \begin{macrocode}
+\DeclareOption{today}{
+ \@svnInfoToday@true
+}
+% \end{macrocode}
+%
+% Ok we don't want do use it.
+% \begin{macrocode}
+\DeclareOption{notoday}{
+ \@svnInfoToday@false
+}
+% \end{macrocode}
+%
+% To memorize, that we want to have the the new
+% \texttt{fancyhdr} footline filled with \SVN\ information.
+% \begin{macrocode}
+\newif\if@svnInfoUseFancyhdr@
+% \end{macrocode}
+%
+% We want to use the \texttt{fancyhdr}
+% package, and set the footline with the \SVN\ information.
+% Only one option may be in effect.
+% \begin{macrocode}
+\DeclareOption{fancy}{
+ \@svnInfoUseFancyhdr@false
+}
+\DeclareOption{fancyhdr}{
+ \@svnInfoUseFancyhdr@true
+}
+% \end{macrocode}
+%
+% Ok we don't want do use it.
+% \begin{macrocode}
+\DeclareOption{nofancy}{
+ \@svnInfoUseFancyhdr@false
+}
+% \end{macrocode}
+%
+% To memorize, that we want to use the long date format.
+% \begin{macrocode}
+\newif\if@svnInfoLong@
+% \end{macrocode}
+%
+% We want to use the long date format.
+% \begin{macrocode}
+\DeclareOption{long}{
+ \@svnInfoLong@true
+}
+% \end{macrocode}
+%
+% Ok we don't want do use it.
+% \begin{macrocode}
+\DeclareOption{short}{
+ \@svnInfoLong@false
+}
+% \end{macrocode}
+%
+% Use these default options,
+% \begin{macrocode}
+\ExecuteOptions{today,long}
+% \end{macrocode}
+%
+% read the configuration file, to set the default fancy headings package,
+% \begin{macrocode}
+\IfFileExists{svninfo.cfg}{\input{svninfo.cfg}}{}
+% \end{macrocode}
+%
+% and the process the user options.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+% Load \texttt{fancyhdr} if neccessary.
+% \begin{macrocode}
+\if@svnInfoUseFancyhdr@
+ \RequirePackage{fancyhdr}
+\fi
+% \end{macrocode}
+%
+% If no language for the |babel| package is given in the document,
+% we have to redefine |\today| (otherwise the changed |\year|, |\month| and
+% |\day| won't work). In this case use the english version of |\today|.
+% \begin{macrocode}
+\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}
+% \end{macrocode}
+%
+% We have a problem, since the number of arguments of |\svnInfo| vary from
+% zero to five.
+% To deal with that, we use some kind ``contuinuation passing'' style of
+% programming.
+% |\@svnInfoNext| contains the action to be done next.
+%
+% Some packages (e.g.\ the |babel|-package with the |french|-option)
+% change the catcode of |:| (colon). If this happens, we have to
+% undo this in order to parse the \Id\ string (which contains a colon)
+% and restore its original catcode afterwards.
+% This flag is used to store whether the state of the colon was changed to
+% be active.
+% \begin{macrocode}
+\newif\if@svnInfoColonIsActive@
+% \end{macrocode}
+
+%\begin{macro}{\svnInfo}
+% Extract the \SVN\ information, and give commands shown above their values.
+% Check the catcode of |:| and set the flag. The restoration is done after the
+% |:| has been read. Allow \_ (underscore) in file names, hence change the
+% |\catcode| of it.
+% \begin{macrocode}
+\def\svnInfo {
+ \catcode`\_=13
+ \ifnum\catcode`\:=13
+ \@svnInfoColonIsActive@true
+ \catcode`:=12
+ \else
+ \@svnInfoColonIsActive@false
+ \fi
+ \@svnInfoReadArgs
+}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\@svnInfoReadArgs}
+% First check, if the \Id\ string is not-expanded.
+% Set the default values, so that for not expanded \Id\ strings, we get them.
+% The \$ before |Id| may be omitted (I use this to avoid expansion of
+% \$Id-Tags to be expanded by SVN in some cases).
+% Restore the catcode of the |:|.
+% \begin{macrocode}
+\def\@svnInfoReadArgs #1Id#2 {
+ \@svnInfoDefaults
+ \if $#2 \let \@svnInfoNext = \@svnInfoEat
+ \else \let \@svnInfoNext = \@svnInfoEatColon
+ \fi
+% \end{macrocode}
+% |#2| contains either |$| or |:$| or |:|\blank\ hence we have read the colon
+% and can restore the catode of it.
+% \begin{macrocode}
+ \if@svnInfoColonIsActive@
+ \catcode`:=13
+ \fi
+% \end{macrocode}
+% Start processing the \Id\ string.
+% \begin{macrocode}
+ \@svnInfoNext $Id#2
+}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\@svnInfoEat}
+% This macro eats up its argument, i.e.\ removes it from the input.
+% Reset the |\catcode| of the underscore.
+% \begin{macrocode}
+\def\@svnInfoEat #1 {\catcode`\_=8}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\@svnInfoEatColon}
+% This macro eats up the colon following \texttt{Id}.
+% The colon may be followed by a \$, which means that the \Id\ string is not
+% expanded.
+% \begin{macrocode}
+\def\@svnInfoEatColon $Id:#1 {
+ \if $#1 \let \@svnInfoNext = \@svnInfoEat
+ \else \let \@svnInfoNext = \@svnInfoCrackAndEat
+ \fi
+ \@svnInfoNext #1
+}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\@svnInfoCrackAndEat}
+% Take an expanded \Id\ string pass it to the crack routine
+% |\@svnInfoCrack|\-|String|, which specifies what has to be done
+% after it. We have already eaten the \$.
+% Note: here we don't give an argument to |\@svnInfoNext|, since it is taken
+% form the source, in case of |\@svnInfoEat|.
+% We have to take the next 7 tokens.
+% Note, first argument (\verb|#1|) contains only spaces.
+% \begin{macrocode}
+\def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6 {
+ \@svnInfoCrackString #2 #3 #4 #5 #6
+ \@svnInfoNext
+}
+% \end{macrocode}
+%\end{macro}
+
+%\begin{macro}{\@svnInfoCrackString}
+% Take an expanded \Id\ string and crack it:\\
+% \#1: filename, \#2 revision, \#3 date, \#4 time, \#5 owner\\
+% Hence we have to consume the terminating \$ afterwards. Reset
+% the |\catcode| of the underscore.
+%
+% If the document checked into the repository without authentication,
+% the owner may be empty. In that case the argument \#5 is \$ and
+% we already consumed the terminating \$.
+%
+% Split the date into year,month and day.
+% If the option \texttt{today} is given, |\today| returns from now
+% on the \SVN\ date.
+%
+% Write some macro definitions to the |.aux| file, to support \LatexToHtml.
+% \begin{macrocode}
+\def\@svnInfoCrackString #1 #2 #3 #4 #5 {
+ \def\svnInfoFile{#1}
+ \def\svnInfoRevision{#2}
+ \def\svnInfoTime{#4}
+ \if $#5 \let \@svnInfoNext = \relax
+ \def\svnInfoOwner{}
+ \def\svnId{#1\ #2\ #3\ #4}
+ \else \let \@svnInfoNext = \@svnInfoEat
+ \def\svnInfoOwner{#5}
+ \def\svnId{#1\ #2\ #3\ #4\ #5}
+ \fi
+ \write\@mainaux{\string\def\string\svnInfoFILE{#1}}
+ \write\@mainaux{\string\def\string\svnInfoREVISION{#2}}
+ \write\@mainaux{\string\def\string\svnInfoTIME{#4}}
+ \write\@mainaux{\string\def\string\svnInfoOWNER{#5}}
+
+
+
+ \catcode`\_=8
+ \@svnInfoSplitDate x#3x
+ \def\svnInfoLongDate{\@svnInfoToday}
+ \if@svnInfoToday@
+ \year = \@svnInfoYear
+ \month = \@svnInfoMonth
+ \day = \@svnInfoDay
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@svnInfoSplitDate}
+% This macro sets |\svnInfoYear|, |\svnInfoMonth|, and |\svnInfoDay|.
+% It takes a \texttt{x}\emph{YYYY-MM-DD}\texttt{x} style of argument.
+% \begin{macrocode}
+\def\@svnInfoSplitDate x#1-#2-#3x{
+ \@svnInfoDay = #3
+ \@svnInfoMonth= #2
+ \@svnInfoYear = #1
+ \write\@mainaux{\string\def\string\svnInfoDAY{#3}}
+ \write\@mainaux{\string\def\string\svnInfoMONTH{#2}}
+ \write\@mainaux{\string\def\string\svnInfoYEAR{#1}}
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@svnInfoToday}
+% Returns the \SVN\ date in the form as |\today| does it.
+% To do this, we set |\year|, |\month| and |\day| commands to the
+% corresponding \SVN\ information, let |\today| does its work, i.e.\
+% transforming the date into a language dependent string and reset
+% |\year|, |\month| and |\day| to their previous value.
+%
+% \begin{macrocode}
+\def\@svnInfoToday {%
+ \@svnInfoYearTmp = \year
+ \@svnInfoMonthTmp = \month
+ \@svnInfoDayTmp = \day
+ \year = \@svnInfoYear
+ \month = \@svnInfoMonth
+ \day = \@svnInfoDay
+ \today%
+ \year = \@svnInfoYearTmp
+ \month = \@svnInfoMonthTmp
+ \day = \@svnInfoDayTmp
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@svnInfoDefaults}
+% This macro sets the default values.
+% \begin{macrocode}
+\def\@svnInfoDefaults {
+ \@svnInfoYear = \year
+ \@svnInfoMonth = \month
+ \@svnInfoDay = \day
+ \def\svnInfoFile{--sourcefile--}
+ \def\svnInfoDate{\the\@svnInfoYear-\two@digits\@svnInfoMonth-%
+ \two@digits\@svnInfoDay}
+ \def\svnInfoTime{--time--}
+ \def\svnInfoRevision{--revision--}
+ \def\svnInfoOwner{--owner--}
+ \def\svnInfoYear{\the\@svnInfoYear}
+ \def\svnInfoMonth{\the\@svnInfoMonth}
+ \def\svnInfoDay{\the\@svnInfoDay}
+ \def\svnInfoLongDate{\@svnInfoToday}
+ \def\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner}
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\@svnInfoFancyFoot}
+% This defines the contents of the footline
+% \begin{macrocode}
+\def\@svnInfoFancyFoot {
+ \if@svnInfoLong@
+ \def\@svnInfoFancyInfo{{\footnotesize%
+ \emph{Rev: \svnInfoRevision,
+ \svnInfoLongDate}}}
+ \else
+ \def\@svnInfoFancyInfo{{\footnotesize%
+ \emph{Rev: \svnInfoRevision,
+ \svnInfoDate}}}
+ \fi
+ \def\@svnInfoFancyFile{{\footnotesize\emph{\svnInfoFile}}}
+% \end{macrocode}
+% and set it for the \texttt{fancyhdr} package.
+% \begin{macrocode}
+ \if@svnInfoUseFancyhdr@
+ \if@twoside
+ \fancyfoot[LE,RO]{\@svnInfoFancyInfo}
+ \fancyfoot[LO,RE]{\@svnInfoFancyFile}
+ \fancyfoot[CO,CE]{\thepage}
+ \else
+ \fancyfoot[L,RO]{\@svnInfoFancyInfo}
+ \fancyfoot[LO,R]{\@svnInfoFancyFile}
+ \fancyfoot[C]{\thepage}
+ \fi
+ \renewcommand{\footrulewidth}{0.4pt}
+ \if@twoside
+ \fancypagestyle{plain}{%
+ \fancyfoot[LE,RO]{\@svnInfoFancyInfo}
+ \fancyfoot[LO,RE]{\@svnInfoFancyFile}
+ \fancyfoot[CO,CE]{\thepage}
+ \renewcommand{\footrulewidth}{0.4pt}
+ }
+ \else
+ \fancypagestyle{plain}{%
+ \fancyfoot[L,RO]{\@svnInfoFancyInfo}
+ \fancyfoot[LO,R]{\@svnInfoFancyFile}
+ \fancyfoot[C]{\thepage}
+ \renewcommand{\footrulewidth}{0.4pt}
+ }
+ \fi
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+
+% Initialize the defaults
+% \begin{macrocode}
+\@svnInfoDefaults
+% \end{macrocode}
+
+% At the start of the document, if we use the
+% \texttt{fancyhdr} footline, we should set it here.
+% \begin{macrocode}
+\AtBeginDocument{
+ \if@svnInfoUseFancyhdr@
+ \@svnInfoFancyFoot
+ \fi
+}
+%</package>
+% \end{macrocode}
+% \centerline{That's the end}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \Finale
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \iffalse
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following stuff does not show up in the documentation of the package:
+%
+% svninfo2html.tex: the example file for transforming to HTML
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%<*html>
+\documentclass{article}
+\IfFileExists{html.sty}{\usepackage{html}}{}
+\usepackage{svninfo}
+
+\IfFileExists{html.sty}{%
+% the svninfo.perl stuff needs that the .aux file has been read!
+\begin{htmlonly}%
+\input{svninfo2html.aux}%
+\end{htmlonly}%
+}{}
+
+\newcommand{\LatexToHtml}{\LaTeX 2\texttt{HTML}}
+\newcommand{\Var}[1]{\texttt{\$svninfo::#1}}
+\newcommand{\SVN}{\emph{SVN}}
+
+\pagestyle{fancy}
+
+\begin{document}
+\svnInfo $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $
+
+\author{Achim D. Brucker\\
+ \small{\texttt{brucker@freiburg.linux.de}}}
+\date{\today}
+\title{Example for converting a \LaTeX\ document to \texttt{HTML}\\
+ using \LatexToHtml\ and the \texttt{svninfo}-package}
+\maketitle
+
+\section{Notes}
+%%%%%%%%%%%%%%%
+
+\begin{itemize}
+\item Use at least version \emph{99.1 release (March 30, 1999)} of
+ \LatexToHtml.
+
+\item You should \verb|\usepackage{html}|.
+
+\item You must run \LaTeX\ on the input file before running \LatexToHtml.
+
+\item In order to make \LatexToHtml\ read the \verb|.aux| file, you must
+ either:
+ \begin{itemize}
+ \item call \LatexToHtml\ with the option
+ \verb|-show_section_numbers| or
+ \item include the \verb|.aux| file explicitly in your \LaTeX-source, by
+ adding the lines in the preamble:\\
+ \verb|\begin{|\verb|htmlonly}|\\ % looks ulgy, but otherwise
+ \verb|\input{|\emph{source}\verb|.aux}|\\
+ \verb|\end{|\verb|htmlonly}|\\ % latex2html fails.
+ which requires \verb|\usepackage{html}|.
+ \end{itemize}
+ If you don't do so, the \verb|\svnInfo...| commands give no value.
+
+\item If using the \LatexToHtml\ tool, only the last \verb|\svnInfo| takes
+ effect, e.g.~if using several input files each having the \verb|\svnInfo|
+ command, only the vales of the last included file are used.
+ (If this is a serious problem for you, drop me a mail).
+
+\item If the \verb|fancy| / \verb|fancyhdr| option is given to the
+ \verb|svninfo| package,
+ the date of the \verb|ADDRESS| at the bottom of the \texttt{HTML}
+ page is set to the \SVN\ date.
+
+\item If you would like to set your own \verb|ADDRESS| text, you should
+ define a procedure, which sets \texttt{perl} \verb|$main::ADDRESS|
+ variable in your local \texttt{.latex2html} initialization file.
+ The routine may use the \texttt{perl}
+ variables shown below. Assign a reference of this procdure to the
+ \texttt{perl}-variable
+ \verb|$svninfo::SetAddressProc|.
+ E.g.\ if you have a \texttt{perl} routine \verb|&my_address_field|,
+ then \\
+ \verb|$svninfo::SetAddressProc = &my_address_field|.
+
+ For example the follownig \texttt{perl}-code does the job:
+\begin{verbatim}
+sub my_address_field
+{
+ $ADDRESS = '<hr>This file was last updated on ' .
+ $svninfo::Date .
+ '&nbsp; by ' .
+ '<a href="mailto: brucker@freiburg.linux.de">' .
+ 'Achim D. Brucker ' .
+ '&lt;brucker@freiburg.linux.de&gt;</a>';
+}
+$svninfo::SetAddressProc = \&my_address_field;
+\end{verbatim}
+\end{itemize}
+
+\newpage
+
+\section{Example}
+%%%%%%%%%%%%%%%%%
+
+\label{sec-examples}
+Here are the commands and their output:
+
+\begin{tabular}{lll}
+\LaTeX-command & \texttt{perl} variable & Result for this file \\\hline
+\verb|\today| & \texttt{\$today} & \today \\
+\verb|\svnInfoFile| & \Var{File} & \svnInfoFile \\
+\verb|\svnInfoRevision| & \Var{Revision} & \svnInfoRevision \\
+\verb|\svnInfoOwner| & \Var{Owner} & \svnInfoOwner \\
+\verb|\svnInfoDate| & \Var{Date} & \svnInfoDate \\
+\verb|\svnInfoLongDate| & \Var{LongDate} & \svnInfoLongDate \\
+\verb|\svnInfoDay| & \Var{Day} & \svnInfoDay \\
+\verb|\svnInfoMonth| & \Var{Month} & \svnInfoMonth \\
+\verb|\svnInfoYear| & \Var{Year} & \svnInfoYear \\
+\end{tabular}
+
+\end{document}
+%</html>
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following stuff does not show up in the documentation of the package:
+% svninfo.ins
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%<*ins>
+\def\batchfile{svninfo.ins}
+\input docstrip.tex
+
+\Msg{}
+\Msg{***********************************************************}
+\Msg{** Hello to the installation of the `svninfo' package.}
+\Msg{** Version 0.3, September 29, 2005}
+\Msg{***********************************************************}
+\Msg{}
+
+\generate{
+ \askforoverwritefalse
+% \file{svninfo.ins}{\from{svninfo.dtx}{header,ins}}
+ \file{svninfo.sty}{\from{svninfo.dtx}{header,package}}
+ \file{svninfo2html.tex}{\from{svninfo.dtx}{header,html}}
+ \usepreamble\empty
+ \usepostamble\empty
+ \file{svninfo.perl}{\from{svninfo.dtx}{perl}}
+ \file{svninfo.init}{\from{svninfo.dtx}{init}}
+ \file{svninfo.cfg}{\from{svninfo.dtx}{header,config}}
+}
+
+\Msg{}
+\Msg{***********************************************************}
+\Msg{** Edit the file svninfo.cfg and set the default fancy headings package}
+\Msg{** To finish the installation move the file `svninfo.sty' and}
+\Msg{** svninfo.cfg to a place where LaTeX will find it.}
+\Msg{** To Get the documentation: `latex svninfo.dtx'}
+\Msg{** and `latex svninfo2html.dtx'}
+\Msg{** If you are using LaTeX2HTML, move the PERL-package}
+\Msg{** `svninfo.perl' to a place where LaTeX2HTML will find it.}
+\Msg{** `svninfo.perl' is created by running `latex svninfo.dtx'.}
+\Msg{** Happy TeXing}
+\Msg{***********************************************************}
+\Msg{}
+%</ins>
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following stuff does not show up in the documentation of the package:
+% svninfo.perl
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%<*perl>
+###############################################################################
+# SVNINFO.PERL
+# Copyright 1995 Dr. Juergen Vollmer <Juergen.Vollmer@acm.org>
+# Copyright 2003-2005 Achim D. Brucker <brucker@freiburg.linux.de>
+#
+# Extension to LaTeX2HTML to translate LaTeX commands of the
+# svninfo
+# package to equivalent HTML commands.
+#
+# This is file `svninfo.perl',
+# generated with the docstrip utility.
+#
+# The original source files were:
+#
+# svninfo.dtx (with options: `perl')
+#
+# IMPORTANT NOTICE:
+#
+# For the copyright see the source file.
+#
+# Any modified versions of this file must be renamed
+# with new filenames distinct from svninfo.perl.
+#
+# For distribution of the original source see the terms
+# for copying and modification in the file svninfo.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.)
+#
+# $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $
+#
+###############################################################################
+
+package svninfo;
+
+($Dummy1,$PackageVersionDate,$PackageVersionTime,$Dummy2) =
+ split (/ /,'$Date: 2005-04-08 08:18:47 +0200 (Fr, 08 Apr 2005) $');
+
+print "\n\t svninfo style interface for LaTeX2HTML, $PackageVersionDate\n";
+
+# set defaults options
+$OptionFancy = 1;
+$OptionToday = 1;
+$OptionLong = 1;
+
+# set default values
+$Date = `date '+%Y/%m/%d'`;
+$Time = `date '+%H:%M:%S'`;
+$File = "--sourcefile--";
+$Revision = "--revision--";
+$Owner = "--owner--";
+$Year = `date '+%Y'`;
+$Month = `date '+%m'`;
+$Day = `date '+%d'`;
+$LongDate = $Date;
+
+sub SetAddress
+{
+ $main::address_data[1] = "Revision: $svninfo::Revision, $svninfo::LongDate";
+ # Supply your own string if you don't like the default <Name> <Date>
+ $main::ADDRESS = "<I>$main::address_data[0] <BR>\n$main::address_data[1]</I>";
+}
+if ($SetAddressProc == "") {
+ $SetAddressProc = \&svninfo::SetAddress;
+}
+sub make_cmds
+{
+ my $cmd;
+ foreach $cmd (File,Revision,Date,Time,Owner,Year,Month,Day,LongDate) {
+ eval "sub main::do_cmd_svnInfo$cmd { "
+ . 'my $val = $svninfo::' . "$cmd; "
+# . 'printf STDERR "\ndo_cmd_svnInfo%s=%s\n", ' . $cmd .', $val;'
+ . "join('',\$val,\$_[0]);"
+ . "}";
+ }
+}
+
+@GermanMonthName = ('','Januar','Februar','M&auml;rz','April','Mai','Juni','Juli',
+ 'August','September','Oktober','November','Dezember');
+@EnglishMonthName = ('','January','February','March','April','May','June','July',
+ 'August','September','October','November','December');
+@FrenchMonthName = ('','Janvier','F&eacute;vrier','Mars','Avril','Mai','Juin',
+ 'Juillet','Ao&ucirc;t','Septembre','Octobre','Novembre',
+ 'D&eacute;cembre');
+
+###############################################################################
+
+package main;
+
+# handling package options
+sub do_svninfo_fancyhdr { $svninfo::OptionFancy = 1; }
+sub do_svninfo_fancy { $svninfo::OptionFancy = 1; }
+sub do_svninfo_nofancy { $svninfo::OptionFancy = 0; }
+sub do_svninfo_today { $svninfo::OptionToday = 1; }
+sub do_svninfo_notoday { $svninfo::OptionToday = 0; }
+sub do_svninfo_short { $svninfo::OptionLong = 0; }
+sub do_svninfo_long { $svninfo::OptionLong = 1; }
+
+# handling of LaTeX commands
+sub do_cmd_svnInfo
+{
+
+ local ($_) = @_;
+
+ # printf STDERR "\ndo_cmd_svnInfo\n";
+
+ # see latex2html, procedure: substitute_meta_cmds, process_body_newcommand
+ # the format of the variable $new_command{cmd} is:
+ # $new_command{$cmd} = join(':!:',$argn,$body,$opt);
+ # note: opt = "}" means: Flag for no optional arg
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoFILE};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoREVISION};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoYEAR};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoMONTH};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoDAY};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoTIME};
+ # printf STDERR "xxxxxxxxxxx `%s'\n", $new_command{svnInfoOWNER};
+
+ # the following assumes: LaTeX2HTML Version 99.1 release (March 30, 1999)
+ # may be later
+ my ($argn, $opt);
+ if (exists $new_command{svnInfoFILE}) {
+ ($argn, $svninfo::File, $opt) = split(/:!:/, $new_command{svnInfoFILE});
+ } else {
+ $svninfo::File = $File
+ }
+ if (exists $new_command{svnInfoREVISION}) {
+ ($argn, $svninfo::Revision, $opt) = split(/:!:/, $new_command{svnInfoREVISION});
+ } else {
+ $svninfo::Revision = $Revision
+ }
+ if (exists $new_command{svnInfoYEAR}) {
+ ($argn, $svninfo::Year, $opt) = split(/:!:/, $new_command{svnInfoYEAR});
+ } else {
+ $svninfo::Year = $Year
+ }
+ if (exists $new_command{svnInfoMONTH}) {
+ ($argn, $svninfo::Month, $opt) = split(/:!:/, $new_command{svnInfoMONTH});
+ } else {
+ $svninfo::Month = $Month
+ }
+ if (exists $new_command{svnInfoDAY}) {
+ ($argn, $svninfo::Day, $opt) = split(/:!:/, $new_command{svnInfoDAY});
+ } else {
+ $svninfo::Day = $Day
+ }
+ if (exists $new_command{svnInfoTIME}) {
+ ($argn, $svninfo::Time, $opt) = split(/:!:/, $new_command{svnInfoTIME});
+ } else {
+ $svninfo::Time = $Time
+ }
+ if (exists $new_command{svnInfoOWNER}) {
+ ($argn, $svninfo::Owner, $opt) = split(/:!:/, $new_command{svnInfoOWNER});
+ } else {
+ $svninfo::Owner = $Owner
+ }
+
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::File;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Revision;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Year;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Month;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Day;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Time;
+ # printf STDERR "yyyyyyyyyyy `%s'\n", $svninfo::Owner;
+
+ # the following code is for oldfashioned latex2hmtl, not anymore supported
+ # format of $_:
+ # vvvvvv that's text following the SVN-Id-string
+ # <#nr#>.....<#nr>......
+ # ^ ^ ^ that's the SVN-Id-string
+# my ($Nr,$IdString,$Rest) = /(<#\d+#>)(.*)\1(.*)/s ;
+
+ # The Id-String may contain various tags, remove them
+# $IdString =~ s/<[^>]*>//g;
+
+ # The Id-String may contain various tags, remove them
+# $IdString =~ s/<[^>]*>//g;
+
+ # split the Id-string
+# my ($id,$file,$revision,$date,$time,$owner) = split(/\s/,$IdString);
+
+ # remove trailing ,v
+# $file =~ s/,v$//;
+
+ # split date
+# ($svninfo::Year,$svninfo::Month,$svninfo::Day) = split (/\//,$date);
+
+# $svninfo::Revision = $revision;
+# $svninfo::File = $file;
+# $svninfo::Date = $date;
+# $svninfo::Time = $time;
+# $svninfo::Owner = $owner;
+
+ if ($default_language eq 'german' || $default_language eq 'austrian') {
+ $svninfo::LongDate = $svninfo::Day . '.&nbsp;' .
+ $svninfo::GermanMonthName[$svninfo::Month] . '&nbsp;' .
+ $svninfo::Year;
+ $svnInfo::Date = $svninfo::Day . '.&nbsp;' . $svninfo::Month . '.&nbsp;' . $svninfo::Year;
+ } elsif ($default_language eq 'french') {
+ $svninfo::LongDate = $svninfo::Day . '.&nbsp;' .
+ $svninfo::FrenchMonthName[$svninfo::Month] . '&nbsp;' .
+ $svninfo::Year;
+ $svnInfo::Date = $svninfo::Day . '.&nbsp;' .$svninfo::Month . '.&nbsp;' . $svninfo::Year;
+ } else { # english is the default
+ $svninfo::LongDate = $svninfo::EnglishMonthName[$svninfo::Month] . '&nbsp;' .
+ $svninfo::Day . ',&nbsp;' .
+ $svninfo::Year;
+ $svnInfo::Date = $svninfo::Year . '/' .$svninfo::Month . '/' . $svninfo::Day;
+ }
+
+ if ($svninfo::OptionFancy == 1) {
+ &$svninfo::SetAddressProc;
+ }
+ svninfo::make_cmds();
+
+ # printf STDERR "xxx $HTML_VERSION, $HTML_OPTIONS\n";
+ # remove stuff generated for the $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $-string
+ # we assume that noting follows the "\svnInfo $Id....$"
+ if ($HTML_VERSION >= 3.2) {
+ /^<tex2html_verbatim_mark>[^\n]*/;
+ return $';
+ } elsif ($HTML_VERSION == 3.1 || $HTML_VERSION == 2.1) {
+ /^<tex2html_image_mark>[^\n]*/;
+ return $';
+ } else {
+ if ($HTML_OPTIONS =~ /math/) {
+ /^<tex2html_verbatim_mark>[^\n]*/;
+ return $';
+ } else {
+ /^<tex2html_image_mark>[^\n]*/;
+ return $';
+ }
+ }
+}
+
+# Replace do_cmd_today (\today) using the SVN date.
+sub do_cmd_today {
+ local($today);
+ if ($svninfo::OptionToday == 1) {
+ $today = $svninfo::LongDate;
+ } else {
+ if ($default_language eq 'german' || $default_language eq 'austrian') {
+ $today = (`date "+%m:%d, 20%y"`);
+ $today =~ s/(\d{1,2}):0?(\d{1,2}),/$2. $svninfo::GermanMonthName[$1]/o;
+ $today =~ s/20([7|8|9]\d{1})/19$1/o;
+ } elsif ($default_language eq 'french') {
+ $today = (`date "+%m:%d, 20%y"`);
+ $today =~ s/(\d{1,2}):0?(\d{1,2}),/$2 $svninfo::FrenchMonthName[$1]/o;
+ $today =~ s/20([7|8|9]\d{1})/19$1/o;
+ } else { # english is the default
+ $today = (`date "+%m:%d, 20%y"`);
+ $today =~ s/(\d{1,2}):0?/$svninfo::EnglishMonthName[$1] /o;
+ $today =~ s/20([7|8|9]\d{1})/19$1/o;
+ }
+ }
+ join('',$today,$_[0]);
+}
+
+1;
+
+###############################################################################
+%</perl>
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The following stuff does not show up in the documentation of the package:
+% latex2html.init
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%<*init>
+# This is file `svninfo.init',
+# generated with the docstrip utility.
+#
+# The original source files were:
+#
+# svninfo.dtx (with options: `init')
+#
+# IMPORTANT NOTICE:
+#
+# For the copyright see the source file.
+#
+# Any modified versions of this file must be renamed
+# with new filenames distinct from svninfo.init.
+#
+# For distribution of the original source see the terms
+# for copying and modification in the file svninfo.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.)
+#
+# This file should be used as initialization file for LaTeX2HTML
+# when transforming svninfo2html.tex --> HTML
+#
+# $Id: svninfo.dtx 1168 2005-04-08 06:18:47Z brucker $
+###############################################################################
+sub my_address_field
+{
+ $ADDRESS = '<hr>This file was last updated on ' .
+ $svninfo::Date .
+ '&nbsp; by ' .
+ '<a href="mailto: brucker @ freiburg.linux.de@">' .
+ 'Achim D. Brucker ' .
+ '&lt;brucker @ freiburg.linux.de&gt;</a>';
+}
+$svninfo::SetAddressProc = \&my_address_field;
+###############################################################################
+%</init>
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% E N D of R C S I N F O . D T X
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%\fi
diff --git a/Master/texmf-dist/source/latex/svninfo/svninfo.ins b/Master/texmf-dist/source/latex/svninfo/svninfo.ins
new file mode 100644
index 00000000000..0d93559e720
--- /dev/null
+++ b/Master/texmf-dist/source/latex/svninfo/svninfo.ins
@@ -0,0 +1,97 @@
+%%
+%% This is file `svninfo.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% svninfo.dtx (with options: `header,ins')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% Any modified versions of this file must be renamed
+%% with new filenames distinct from svninfo.ins.
+%%
+%% For distribution of the original source see the terms
+%% for copying and modification in the file svninfo.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.)
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% `svninfo' package to use with LaTeX2e.
+%%
+%% This package is used to extract the revision and file information provided
+%% by the Subversion revision control system.
+%% A PERL-package supporting svninfo and LaTeX2HTML is provieded too.
+%%
+%% Copyright (C) 1995 Dr. Juergen Vollmer
+%% Copyright (C) 2003 Achim D. Brucker
+%% License:
+%% 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.
+%%
+%%
+%% $Id: svninfo.dtx 99 2003-09-06 15:13:28Z abrucker $
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% \CheckSum{389}
+%% \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 \~}
+
+\def\batchfile{svninfo.ins}
+\input docstrip.tex
+
+\Msg{}
+\Msg{***********************************************************}
+\Msg{** Hello to the installation of the `svninfo' package.}
+\Msg{** Version 0.3, September 29, 2005}
+\Msg{***********************************************************}
+\Msg{}
+
+\generate{
+ \askforoverwritefalse
+ \file{svninfo.sty}{\from{svninfo.dtx}{header,package}}
+ \file{svninfo2html.tex}{\from{svninfo.dtx}{header,html}}
+ \usepreamble\empty
+ \usepostamble\empty
+ \file{svninfo.perl}{\from{svninfo.dtx}{perl}}
+ \file{svninfo.init}{\from{svninfo.dtx}{init}}
+ \file{svninfo.cfg}{\from{svninfo.dtx}{header,config}}
+}
+
+\Msg{}
+\Msg{***********************************************************}
+\Msg{** Edit the file svninfo.cfg and set the default fancy headings package}
+\Msg{** To finish the installation move the file `svninfo.sty' and}
+\Msg{** svninfo.cfg to a place where LaTeX will find it.}
+\Msg{** To Get the documentation: `latex svninfo.dtx'}
+\Msg{** and `latex svninfo2html.dtx'}
+\Msg{** If you are using LaTeX2HTML, move the PERL-package}
+\Msg{** `svninfo.perl' to a place where LaTeX2HTML will find it.}
+\Msg{** `svninfo.perl' is created by running `latex svninfo.dtx'.}
+\Msg{** Happy TeXing}
+\Msg{***********************************************************}
+\Msg{}
+\endinput
+%%
+%% End of file `svninfo.ins'.
diff --git a/Master/texmf-dist/source/latex/tcldoc/dtxload.dtx b/Master/texmf-dist/source/latex/tcldoc/dtxload.dtx
new file mode 100644
index 00000000000..f68a0ca3a8b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/dtxload.dtx
@@ -0,0 +1,1256 @@
+%
+%
+% \iffalse Meta-comment
+%
+%<*driver>
+\documentclass{tcldoc}
+
+\DeclareRobustCommand{\package}[1]{\textsf{#1}}
+\newcommand{\Alpha}{\textit{Alpha}}
+\newcommand{\AlphaTk}{\textit{Alphatk}}
+
+\PageIndex
+\setcounter{IndexColumns}{2}
+\CodelineNumbered
+\RecordChanges
+\IndexPrologue{\section*{Index}\markboth{Index}{Index}%
+ Numbers written in italic refer to the page where
+ the corresponding entry is described; numbers underlined refer
+ to the definition; numbers in roman refer to the pages where
+ the entry is used.}
+\expandafter\def \expandafter\GlossaryParms \expandafter{\GlossaryParms
+ \hbadness=10000\emergencystretch=2cm}
+
+\begin{document}
+\DocInput{dtxload.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \title{\package{dtxload} --- loading \Tcllogo\ code directly from
+% \texttt{.dtx} source files}
+% \author{Lars Hellstr\"om^^A
+% \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}}
+% \date{December 20, 2000}
+% \maketitle
+%
+% \begin{abstract}
+% \package{dtxload} is a feature for the text editor \Alpha. It
+% implements a command for loading a piece of \Tcllogo\ code directly
+% from a \texttt{.dtx} file.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Usage}
+%
+% \subsection{About \Alpha}
+%
+% About \Alpha\ itself, the \Alpha~v\,7.3 manual says the following:
+% \begin{quotation}
+% \Alpha\ is a very powerful, multi-purpose text editor.
+% \Alpha\ is multi-modal, which means it switches between different
+% modes depending on which type of document you are editing. Everybody
+% who has used Emacs knows about this concept. The idea with different
+% modes is to change \Alpha's behaviour depending on which kind of text
+% you're editing. For example if you're programming in C$^{++}$ or
+% editing a \LaTeX\ document you want different features.
+%
+% \Alpha\ is very customizable. Much of \Alpha's functionality is
+% implemented in `packages' or `extensions'. [\dots]
+% \Alpha\ uses Dr.~Ousterhout's \emph{Tool Command Language} (\Tcllogo) as
+% an extension language. Many of the functions bound to keystrokes,
+% as well as many of the functions in the menus, are written in \Tcllogo.
+% All the `packages' or `extensions' just mentioned are all written
+% in \Tcllogo. Anybody who wants can write new packages for \Alpha!
+%
+% Of course, you don't have to learn \Tcllogo\ to use \Alpha. You can
+% have lots of use of \Alpha\ without knowing anything about \Tcllogo.
+% But if you want to become a real power user, you should consider
+% trying it out. Then the possibilities of customizing \Alpha\ are
+% unlimited.
+% \end{quotation}
+% Originally \Alpha\ only existed on the \mbox{MacOS} platform, but
+% recently the program was rewritten in Tk.\footnote{Tk is an extension of
+% \Tcllogo\ which includes GUI support.} In that form (which is called
+% \AlphaTk), \Alpha\ can be run on any platform for which there exists
+% a port of Tk!
+%
+% \medskip
+%
+% There are also some \Alpha-related URLs which should be mentioned.
+% \Alpha's official home page is~\cite{AlphaHome}, but it is currently
+% rather out-of-date. More recent information can be found on
+% e.g.~\cite{DocScriptingAlpha}, which also has links to many other
+% \Alpha-related sites. The home page for \AlphaTk\ is~\cite{Alphatk}.
+%
+%
+%
+% \subsection{Installation}
+%
+% To install \package{dtxload} as an \Alpha\ feature, you first \LaTeX\
+% the file \texttt{dtxload.ins}---this will generate a file
+% \texttt{dtxload.tcl}, which contains the \Tcllogo\ code for the
+% package in a form that \Alpha\ understands. Then follow the normal
+% procedure for installing an \Alpha\ package, i.e., open
+% \texttt{dtxload.tcl}\footnote{Which should be somewhere outside
+% \Alpha's directory subtree.} in \Alpha---this will trigger the
+% automatic installation dialog for the package and you proceed as
+% usual.
+%
+%
+% \subsection{Loading \Tcllogo\ code}
+% \label{Ssec:Loading}
+%
+% To load (evaluate) a piece of \Tcllogo\ code in a \texttt{.dtx}
+% document, simply select that code and press \marginpar{Loading code:
+% \textsf{Cmd--L}}Command--L. The commands are evaluated one by one and
+% the result of each command will be shown at the current log destination
+% (by default the status line, but that can be changed). In case one of
+% the commands return with an error, that error will be shown as well,
+% evaluation of further commands is cancelled, and the insertion point is
+% moved to the beginning of the erroneous command. Furthermore the mark
+% will be left at the end of the selection, so that the part of the
+% original selection which has not yet been successfully evaluated can
+% easily be reselected using the \textsf{Mark Hilite} command.
+%
+% Loading \Tcllogo\ code does not necessary mean all text in the
+% selection will be evaluated; only extractable code will be passed on
+% to the \Tcllogo\ interpreter. There are several factors which affect
+% whether a piece of text is extractable code or not, but the foremost
+% is that text on \package{docstrip} comment lines (i.e., lines which
+% begin by a `|%|' that is not immediately followed by a `|<|') is
+% \emph{not} extractable code. Secondly, if the selection contains a
+% \package{docstrip} guard line which marks the start of a module then
+% \package{dtxload} will ask you whether you want the code in that
+% module to be loaded. If you answer no, it naturally won't be.
+%
+% Thus far the factors which may restrict which text is extractable
+% code correspond exactly to what the \package{docstrip}
+% program~\cite{docstrip} might do when generating a file of extracted
+% code, but \package{dtxload} has two additional mechanisms which may
+% categorize text as ``not extractable code''. Both are however
+% controlled by preferences in the \Alpha\ \TeX\ mode, so they can be
+% switched off if you don't like them.
+% The first is the \describestring[var.][]{onlyLoadDtxFiles}
+% \textsf{Only Load Dtx Files} preference, which when on restricts
+% loading to files with suffix \texttt{.dtx}. For \TeX\ files with other
+% suffixes I suspect that Command--L is pressed more often by accident
+% than because there actually is some \Tcllogo\ code that should be
+% loaded \textellipsis\space The second mechanism is controlled by the
+% \describestring[var.][]{onlyLoadTclEnvs} \textsf{Only Load Tcl Envs}
+% preference, which when on adds the restriction that extractable code
+% must appear inside a \texttt{tcl} or \texttt{tcl*} environment
+% (defined by the \package{tcldoc} \LaTeX\ package~\cite{tcldoc}). This
+% is primarily useful when a \texttt{.dtx} file contains both \Tcllogo\
+% code in \texttt{tcl} environments and code in some other language in
+% e.g.\ \texttt{macrocode} environments, since if the preference had been
+% off then \package{dtxload} would stop at the \package{docstrip} guard
+% that must appear at the beginning of each non-\Tcllogo\ code section
+% and ask whether the code should be included, whereas if it is on then
+% \package{dtxload} doesn't even have to ask whether the code in the
+% \texttt{macrocode} environments should be loaded.
+%
+% \medskip
+%
+% As an example of how the load \Tcllogo\ code command works, consider
+% the following code:
+% \DontCheckModules\iffalse
+%<*example>
+%<<EXAMPLE
+% \fi\begin{macrocode}
+% Text text text text text
+% \begin{tcl}
+set a A
+%<*andB>
+append a B
+%</andB>
+append a C
+%<*andD>
+append a D
+%</andB>
+expr $a
+string length $a
+% \end{tcl}
+% text text text.
+% \end{macrocode}\iffalse
+%EXAMPLE
+%</example>
+% \fi \CheckModules
+% If lines 1--7 above are selected and Command--L is pressed,
+% \package{dtxload} will display the message ``\texttt{Tcl eval OK}'' on
+% the status line and the following information will have been added to
+% the log.\footnote{This shows the window log format, but there are
+% other formats. Furthermore the `\texttt{<}' and `\texttt{>}' will
+% actually be guillemets in \Alpha\ (but not in \AlphaTk).}
+% \begin{trivlist}\item\small
+% |<dtxload> set a A|\\
+% |A|\\[\medskipamount]
+% |<dtxload> append a B|\\
+% |AB|\\[\medskipamount]
+% |<dtxload> append a C|\\
+% |ABC|
+% \end{trivlist}
+% The |<dtxload>| lines show the commands that were evaluated and the
+% lines after these contain the respective results of these commands.
+% Before the |append a B| command is evaluated, \package{dtxload} will
+% stop and ask
+% \begin{quote}
+% \textsf{Should \textless andB\textgreater\ modules be included?}
+% \end{quote}
+% In the case above the answer given was `Yes'; if it had been `No' then
+% the |append a B| command would neither be logged nor evaluated, and
+% the result of the |append a C| command would have been |AC|.
+%
+% If one continues by selecting lines 9--12 and pressing Command--L
+% then \package{dtxload} will display the message ``\texttt{Tcl eval
+% error}'' on the status line, the insertion point will be moved to the
+% beginning of line 11, and the following information will be found in
+% the log:
+% \begin{trivlist}\item\small
+% |<dtxload> append a D|\\
+% |ABCD|\\[\medskipamount]
+% |<dtxload> expr $a|\\
+% |Error: syntax error in expression "ABCD"|
+% \end{trivlist}
+% If then line 11 is changed to |expr {$a}| and lines 11--12 are again
+% selected (e.g. using \textsf{Mark Hilite}) and loaded then
+% \package{dtxload} will log:
+% \begin{trivlist}\item\small
+% |<dtxload> expr {$a}|\\
+% |ABCD|\\[\medskipamount]
+% |<dtxload> string length $a|\\
+% |4|
+% \end{trivlist}
+%
+% Finally, if lines 3--12 are selected and loaded then these are the
+% questions \package{dtxload} will ask:
+% \begin{itemize}
+% \item \textsf{Should \textless andB\textgreater\ modules be included?}
+% (Possible answers are `Yes' and `No'.)
+% \item \textsf{Should \textless andD\textgreater\ modules be included?}
+% (Possible answers are `Yes' and `No'.)
+% \item \textsf{Module nesting error: \textless*andD\textgreater\
+% module ended by \textless/andB\textgreater. For which
+% guards should the positions be pushed?}
+% (Possible answers are `None', `Start', `End', and `Both'.)
+% \end{itemize}
+% In the last case, \package{dtxload} has noticed that the guard
+% expressions that began (\textsf{andD}) and ended (\textsf{andB}) a
+% module are not equal (which is an error). Answering `Both' here will
+% push the positions of (the beginning of) both guard lines (8 and 10) onto
+% the bookmark stack so that they can easily be jumped to and corrected
+% later, but \package{dtxload} will continue evaluating the rest of the
+% selection after you answer.
+%
+%
+% \subsection{Selecting log destination}
+%
+% At startup, \package{dtxload} is logging results on the status line,
+% i.e., after a command has been evaluated it either displays the message
+% \begin{quote}
+% \texttt{Tcl eval OK:\ }\meta{result}
+% \end{quote}
+% or
+% \begin{quote}
+% \texttt{Tcl eval error:\ }\meta{error message}
+% \end{quote}
+% depending on whether the command returned an error or not. The
+% evaluation log can however be sent to a window instead.
+%
+% To set the destination for the log, one uses the procedure
+% \describestring[proc][dtxload]{logdest}|dtxload::logdest|. To set the
+% log destination to the window \word{win}, one gives the command
+% \begin{quote}
+% |dtxload::logdest window| \word{win}
+% \end{quote}
+% When the log destination is a window, the log shows the commands
+% that were evaluated as well as their result. If there is no window
+% named \word{win} then it is created. A slight
+% variation on this is the command
+% \begin{quote}
+% |dtxload::logdest shell| \word{win}
+% \end{quote}
+% which makes the \word{win} window a \Alpha\ \Tcllogo\ shell window if
+% it has to create it. When the log destination is a shell window, the
+% commands that are executed will be saved on the history list as well
+% as inserted in the window.
+%
+% A short form which may be convenient is
+% \begin{quote}
+% |dtxload::logdest here|
+% \end{quote}
+% which simply makes the current window the log destination. Finally,
+% the log destination is reset to the status line after the command
+% \begin{quote}
+% |dtxload::logdest status|
+% \end{quote}
+% Evaluation will also be logged on the status line if the log
+% destination window is closed.
+%
+%
+% \subsection{Other features and surprises}
+%
+% If nothing is selected when Command--L is pressed, \package{dtxload}
+% will continue as if all text was selected.
+%
+% Like \Alpha's \Tcllogo\ shell, \package{dtxload} can send the commands
+% to evaluate to a remote \Tcllogo\ interpreter rather than \Alpha's
+% built-in interpreter. In both cases the choice of target interpreter is
+% controlled by the global \Alpha\ variable
+% \describestring[var.][]{evaluateRemotely}|evaluateRemotely|. The
+% easiest way of changing this variable is via the \Tcllogo-tk submenu
+% of \Alpha's \Tcllogo\ menu.
+%
+% If the \textsf{Only Load Tcl Envs} preference is on and lines 4--6 in
+% the code example of Subsection~\ref{Ssec:Loading} are loaded then
+% \package{dtxload} will simply display the message
+% \begin{quote}
+% \texttt{No extractable code found.}
+% \end{quote}
+% The reason for this is that the first character of the selection is
+% a |%|; when the first character in the interval to load is a percent
+% character then \package{dtxload} will guess that this position is not
+% in a \texttt{tcl} or \texttt{tcl*} environment, and therefore it won't
+% try to extract any code until it has seen a comment line that contains
+% |\begin{tcl}| or |\begin{tcl*}|. You can always avoid making a
+% \package{docstrip} guard the first thing in the selection to load.
+%
+%
+%
+% \StopEventually{
+% \begin{thebibliography}{9}
+% \bibitem{Alphatk}
+% Vince Darley: \textit{Alphatk} ({\small WWW} page),
+% \texttt{http}://\texttt{www.santafe.edu}\slash
+% \texttt{\~{}vince}\slash \texttt{alphatk}\slash
+% \texttt{about.html}
+% \bibitem{DocScriptingAlpha}
+% Donavan Hall: \textit{Alpha} ({\small WWW} page),
+% \texttt{http}://\texttt{magnet.fsu.edu}\slash
+% \texttt{\~{}hall}\slash\texttt{docscripting}\slash
+% \texttt{alpha}/.
+% \bibitem{tcldoc}
+% Lars Hellstr\"om:
+% \textit{The \package{tcldoc} package and class},
+% \texttt{ftp}:/\slash\texttt{ftp.tex.ac.uk}\slash
+% \texttt{tex-archive}\slash \texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash
+% \texttt{supported}\slash \texttt{tcldoc.dtx}.
+% \bibitem{AlphaHome}
+% Pete Keleher: \textit{Alpha Home Page} ({\small WWW} page),
+% \texttt{http}://\texttt{alpha.olm.net}/.
+% \bibitem{docstrip}
+% Frank Mittelbach, Denys Duchier, Johannes Braams, Marcin
+% Woli\'nski, and Mark Wooding: \textit{The \textsf{DocStrip}
+% program}, The \LaTeX3 Project;
+% \texttt{ftp}:/\slash\texttt{ftp.tex.ac.uk}\slash
+% \texttt{tex-archive}\slash \texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{docstrip.dtx}.
+% \end{thebibliography}
+% }
+%
+% \section{Implementation}
+%
+%
+% \subsection{Interface to \Alpha}
+%
+% The package begins with an |alpha::feature| command to declare itself
+% to \Alpha. As it is hardly useful outside the \texttt{TeX} mode, it
+% declares itself as being specific to that mode.
+% \begin{tcl}
+%<*tcl>
+alpha::feature dtxload 1.1 {TeX} {
+% \end{tcl}
+%
+% \begin{variable}{onlyLoadDtxFiles}
+% \begin{variable}{onlyLoadTclEnvs}
+% Next comes the initialization script for the feature, which
+% declares the two preference variables used by \package{dtxload}.
+% Both variables are flags. |onlyLoadDtxFiles| is |1| if loading of
+% code is restricted to files with suffix \texttt{.dtx} and |0| if
+% there is no restriction. |onlyLoadTclEnvs| is |1| if only code
+% surrounded by a \texttt{tcl} or \texttt{tcl*} environment is loaded
+% and |0| if there is no such restriction. Both preferences are by
+% default |1|.
+% \begin{tcl}
+ # When set, the Load Tcl Code command will be disabled in
+ # TeX files whose suffix is not dtx.
+ newPref flag onlyLoadDtxFiles 1 TeX
+ # When set, the Load Tcl Code command will only extract code
+ # from code lines in tcl and tcl* environments.
+ newPref flag onlyLoadTclEnvs 1 TeX
+% \end{tcl}
+% \end{variable}\end{variable}
+% \begin{variable}{loadTclCode}
+% The initialization script also declares a keybinding preference (to
+% the |dtxload::load| procedure), which is used for
+% \package{dtxload}'s only command. The default value is Command--L
+% and the binding is specific to the \texttt{TeX} mode.
+% \begin{tcl}
+ # This is the key binding for dtxload's Load Tcl Code command.
+ newPref binding loadTclCode <O/L TeX "" dtxload::load TeX
+% \end{tcl}
+% \end{variable}
+%
+% After the initialization script comes the activation and deactivation
+% scripts (which, if I understood things correctly, are called when
+% switching between modes), but these need not contain anything for
+% \package{dtxload}. Instead the arguments of |alpha::feature| continue
+% with the uninstallation procedure
+% \begin{tcl}
+} "" "" uninstall {this-file} \
+% \end{tcl}
+% the maintainer specification (|\x9a| is \texttt{\"{o}})
+% \begin{tcl}
+ maintainer {"Lars Hellstr\x9am" Lars.Hellstrom@math.umu.se} \
+% \end{tcl}
+% and a short help text
+% \begin{tcl}
+ help {The dtxload package implements a command for loading
+ Tcl code that is embedded in a .dtx file without docstripping
+ the file first. For more help, LaTeX the file dtxload.dtx.}
+% \end{tcl}
+% It is possible that the help should rather be |file dtxload.dtx|, but
+% then this file would have to be installed somewhere that \Alpha\
+% would find it. I haven't studied the matter.
+%
+% Next the |dtxload| namespace is declared to \Tcllogo.
+% \begin{tcl}
+namespace eval dtxload {}
+% \end{tcl}
+% \setnamespace{dtxload}
+%
+%
+% \subsection{Code extraction}
+%
+%
+% The code extraction algorithm of \package{dtxload} lack a few of the
+% features of proper \package{docstrip}, but I don't think any of them
+% are essential for the kind of work \package{dtxload} is designed for.
+% The differences to \package{docstrip} are:
+% \begin{itemize}
+% \item The values of guard expressions are not determined from a
+% base set of options, instead the user is inquired for the value of
+% each guard expression.
+% \item Extraction of \package{docstrip} verbatim mode lines is not
+% supported, but it isn't needed for \Tcllogo\ code either.
+% \item Metacomments aren't extracted, but they hardly contain any
+% code of interest to the \Tcllogo\ interpreter anyway.
+% \item \package{dtxload} may scan the comment lines for certain
+% known markup elements (beginning and end of \texttt{tcl} and
+% \texttt{tcl*} environments) and choose to enable or disable
+% extraction based on that.
+% \end{itemize}
+% \package{dtxload} does however act on the guard modifiers and it also
+% looks for errors in the syntax of guards.
+%
+% \begin{variable}{module_stack}
+% \begin{variable}{next_module_idx}
+% The |dtxload::module_stack| variable is keeps track of how modules
+% are nested around the currently considered line. The variable is a
+% stack implemented as a list in which the last element corresponds to
+% the innermost module. Each element in this list is itself a list
+% with the structure
+% \begin{quote}
+% \word{expression} \word{start pos.} \word{previous}\regopt
+% \end{quote}
+% The \word{expression} is the guard expression, as a string. The
+% \word{start pos.} is the position in the file where the module
+% started. Finally, the \word{previous} is a boolean value which
+% records the inclusion status (value of |dtxload::module_included|)
+% that was in force before the module was entered.
+%
+% The |dtxload::next_module_idx| variable holds the index in the
+% |dtxload:|\penalty\hyphenpenalty|:module_stack| list of the next
+% module whose expression has not yet been evaluated; it is equal to
+% |llength ${dtxload::module_stack}| if all module expressions have
+% been evaluated. Those elements in the |dtxload::module_stack| list
+% which have index $\geq$ |dtxload::next_module_idx| do not have a
+% \word{previous} element.
+% \end{variable}\end{variable}
+%
+% \begin{arrayvar}{known_expressions}[expression]
+% The |dtxload::known_expressions| array records the values of all
+% known expressions, i.e., those expressions about whose values the
+% user has been inquired. The entries are either |0| (for ``don't
+% include'') or |1| (for ``include'').
+% \end{arrayvar}
+%
+% \begin{proc}{eval_guard}
+% The |dtxload::eval_guard| procedure takes the string that is a guard
+% expression as argument. It returns |1| if the expression evaluates
+% to true and |0| if it evaluates to false.
+%
+% If the expression has an entry in the |dtxload::known_expressions|
+% array then the |dtxload::eval_guard| procedure returns that value,
+% and if it does not the user is inquired for the value.
+% \begin{tcl}
+proc dtxload::eval_guard {e} {
+ global dtxload::known_expressions
+ if {![info exists dtxload::known_expressions($e)]} then {
+ set dtxload::known_expressions($e)\
+ [expr {"yes" ==\
+ "[askyesno "Should <$e> modules be included?"]"}]
+ }
+ set dtxload::known_expressions($e)
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{push_module}
+% The |dtxload::push_module| procedure pushes a block module onto the
+% module stack, but it does not modify the value of
+% |dtxload::module_included|. The syntax of |dtxload::push_module| is
+% \begin{quote}
+% |dtxload::push_module| \word{expression} \word{position}
+% \end{quote}
+% where \word{expression} is the expression string and
+% \word{position} is the position where the guard begins.
+% \begin{tcl}
+proc dtxload::push_module {e p} {
+ global dtxload::module_stack
+ lappend dtxload::module_stack [list $e $p]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{pop_module}
+% The |dtxload::pop_module| procedure pops a block module off the
+% module stack and checks that the modules are properly nested. Its
+% syntax is
+% \begin{quote}
+% |dtxload::pop_module| \word{expression} \word{position}
+% \end{quote}
+% where \word{expression} is the expression string of the module to
+% pop and \word{position} is the position where the (end of module)
+% guard begins.
+%
+% If the module nesting is incorrect then the user is presented with
+% a dialog with buttons for pushing the positions of the incorrect
+% modules. It is not an error if the module stack is empty, since it
+% is perfectly reasonable that the beginning of the code to evaluate
+% is in the middle of a module.
+% \begin{tcl}
+proc dtxload::pop_module {e p} {
+ global dtxload::module_stack dtxload::module_included\
+ dtxload::next_module_idx
+ set len [llength ${dtxload::module_stack}]
+ if {$len==0} then {return}
+ set L [lindex ${dtxload::module_stack} [expr {$len-1}]]
+ if {[lindex $L 0] != $e} then {
+ switch [buttonAlert "Module nesting error: <*[lindex $L 0]>\
+ module ended by </$e>. For which guards should the positions\
+ be pushed?" None Start End Both]\
+ {
+ Start {dtxload::push_bookmarks [lindex $L 1]}
+ End {dtxload::push_bookmarks $p}
+ Both {dtxload::push_bookmarks [lindex $L 1] $p}
+ }
+ }
+ set dtxload::module_stack\
+ [lreplace ${dtxload::module_stack} end end]
+ if {$len>=${dtxload::next_module_idx}} then {
+ incr dtxload::next_module_idx -1
+ }
+ if {[llength $L]>2} then {
+ set dtxload::module_included [lindex $L 2]
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{push_bookmarks}
+% The |dtxload::push_bookmarks| procedure pushes one or several
+% positions in the current window onto the bookmarks stack. The
+% arguments are the positions to push.
+% \begin{tcl}
+proc dtxload::push_bookmarks {args} {
+ global markStack markName
+ foreach pos $args {
+ set name mark$markName
+ incr markName
+ createTMark $name $pos
+ set fileName [win::Current]
+ set markStack [linsert $markStack 0 [list $fileName $name]]
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{variable}{module_included}
+% \begin{variable}{in_tcl_env}
+% The |dtxload::module_included| variable keeps track of whether the
+% current position is in an included module. It is |1| if the current
+% position should be included and |0| if it shouldn't.
+% The |dtxload::in_tcl_env| variable is used for keeping track of
+% what markup context surrounds the currently considered line in the
+% file. It is set to |1| when a |\begin{tcl}| or |\begin{tcl*}| is
+% scanned, and set to |0| when a |\end{tcl}| or |\end{tcl*}| is scanned.
+% \end{variable}\end{variable}
+%
+% \begin{proc}{update_included}
+% Simply pushing a module onto the module stack does not update the
+% |dtxload:|\penalty\hyphenpenalty|:module_included| variable; that is
+% instead done by the |dtxload::update_included| procedure, which
+% should be called right before the value of |dtxload::module_included|
+% is used. The reason for this arrangement is that it avoids evaluating
+% guard expressions whose values do not matter.
+%
+% |dtxload::update_included| has no arguments.
+% \begin{tcl}
+proc dtxload::update_included {} {
+ global dtxload::module_included dtxload::module_stack\
+ dtxload::next_module_idx
+ while {${dtxload::module_included} &&\
+ ${dtxload::next_module_idx}<[llength ${dtxload::module_stack}]}\
+ {
+ set L [lindex ${dtxload::module_stack} ${dtxload::next_module_idx}]
+ lappend L ${dtxload::module_included}
+ set dtxload::module_stack [lreplace ${dtxload::module_stack}\
+ ${dtxload::next_module_idx} ${dtxload::next_module_idx} $L]
+ incr dtxload::next_module_idx
+ set dtxload::module_included [dtxload::eval_guard [lindex $L 0]]
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{extract_line}
+% The |dtxload::extract_line| procedure steps forward in the file one
+% line at a time until it has found a codeline that can be extracted or
+% it reaches the end of the part of the file from which code is to be
+% extracted. Its syntax is
+% \begin{quote}
+% |dtxload::extract_line| \word{startpos} \word{endpos}
+% \end{quote}
+% Here \word{startpos} is the position at which it should start to
+% look for an extractable code line, and \word{endpos} is the
+% position at which the search should stop if no such line is found.
+% \word{startpos} is assumed to be at the beginning of a line (for
+% identification of code, comment, and guard line purposes) but no
+% test for this is made.
+%
+% The return value of |dtxload::extract_line| is a list with the
+% structure
+% \begin{quote}
+% \word{nextpos} \word{line}\regopt\ \word{foundpos}\regopt
+% \end{quote}
+% \word{nextpos} is the first position in the file after the part that
+% was searched. \word{line} is the extracted codeline and
+% \word{foundpos} is the position at which it began, but these two items
+% are missing if there was no more codeline.
+%
+% The overall structure of |dtxload::extract_line| is a loop
+% which steps through the lines until it reaches the |endpos|. When a
+% line to extract is actually found the procedure returns from within
+% the loop using the |return| command. The local variable |pos|
+% stores the current position, and |pos2| stores the position of the
+% beginning of the next line.
+% \begin{tcl}
+proc dtxload::extract_line {startpos endpos} {
+ global dtxload::in_tcl_env onlyLoadTclEnvs dtxload::module_included
+ for {set pos $startpos} {[pos::compare {$pos<$endpos}]}\
+ {set pos $pos2} {
+% \end{tcl}
+% Inside the loop, the next line is extracted and stored in the local
+% variable |line|. Then |switch| is used for classifying the line and
+% taking appropriate actions.
+% \begin{tcl}
+ set pos2 [nextLineStart $pos]
+ if {$pos2>$endpos} then {set pos2 $endpos}
+ set line [getText $pos $pos2]
+ switch -regexp -- $line {
+% \end{tcl}
+% \changes{v\,1.0}{2000/10/15}{Corrected regular expressions; only
+% percents on the beginning of a line are significant. (LH)}
+% \changes{v\,1.1}{2000/12/03}{Guard lines will affect code extraction.
+% (LH)}
+% \changes{v\,1.1}{2000/12/18}{The code extraction procedures can
+% now handle \package{docstrip} verbatim mode guards, provided
+% they do not appear in a block of extractable code. (LH)}
+% Lines that begin with |%<<| are \package{docstrip} guard lines that
+% start verbatim mode. Extracting code from such lines is currently
+% not supported by \package{dtxload}, so if such a guard is ever
+% encountered the extraction is stopped, but \package{dtxload} can
+% skip verbatim sections from which it shouldn't extract code.
+% \begin{tcl}
+ {^%<<} {
+ if {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}} then {
+ alertnote "docstrip verbatim mode guard line\
+ encountered. Verbatim mode extraction is\
+ currently not supported, so I stop here."
+ goto $pos
+ return [list $endpos]
+ }
+ }
+% \end{tcl}
+% The part of the guard line which comes after the |%<<| is called an
+% end-tag. Verbatim mode ends with the next line which consists of a
+% percent character followed by this end-tag, and therefore all lines
+% up to and including that one are skipped. A technical matter here
+% is that spaces at the end of the line does not count (\TeX\ cannot
+% see them), but spaces inside the end-tag do count!
+% \begin{tcl}
+ set endtag %[string trimright [string trimright\
+ [string range $line 3 end] \n\r] \ ]
+ while {[string trimright [string trimright $line \n\r] \ ]\
+ != $endtag} {
+ set pos $pos2
+ if {[pos::compare {$pos>=$endpos}]}\
+ then {return [list $pos]}
+ set pos2 [nextLineStart $pos]
+ if {$pos2>$endpos} then {set pos2 $endpos}
+ set line [getText $pos $pos2]
+ }
+ }
+% \end{tcl}
+% Lines that begin with |%<*| or |%</| are \package{docstrip} guard
+% lines that delimit block modules, but they do not contain any code
+% themselves. The module is pushed onto or popped off the module stack
+% when the guard line is encountered, but evaluating it is deferred
+% until the first extractable code line.
+% \begin{tcl}
+ {^%<[*/]} {
+ if {![regexp {^%<(\*|/)([^>]+)>} $line foo modifier\
+ expression]}\
+ then {
+ if {"[askyesno "Malformed guard line \"$line\"\
+ encountered. Push position?"]"=="yes"}\
+%
+ then {dtxload::push_bookmarks $pos}
+ } elseif {$modifier=="*"} then {
+ dtxload::push_module $expression $pos
+ } else {
+ dtxload::pop_module $expression $pos
+ }
+ }
+% \end{tcl}
+%
+% Other lines that begin with |%<| are also \package{docstrip}
+% guard lines, but in these cases the lines (i) contain some code
+% and (ii) the guard only affect the code on that line. There must be
+% a |>| somewhere on the line, and the part of the line after the |>|
+% is code that \package{docstrip} can extract.
+% \begin{tcl}
+ {^%<} {
+ if {![regexp {^%<(-|\+|)([^>]+)>(.*)$} $line\
+ foo modifier expression code]}\
+ then {
+ if {"[askyesno "Malformed guard line \"$line\"\
+ encountered. Push position?"]"=="yes"}\
+%
+ then {dtxload::push_bookmarks $pos}
+ } elseif {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}} then {
+ if {[dtxload::eval_guard $expression] !=\
+ ($modifier=="-")}\
+ then {return [list $pos2 $code $pos]}
+ }
+ }
+ }
+% \end{tcl}
+% Remaining lines that begin with |%| are considered comment lines,
+% but they could technically be metacomment lines (begin with |%%|) or
+% a line that \package{docstrip} would process in verbatim mode. In
+% both these cases \package{docstrip} would copy the line, but as there
+% is little point in using these \package{docstrip} features for lines
+% that the \Tcllogo\ interpreter would miss, \package{dtxload} ignores
+% those subtleties.
+% \begin{tcl}
+ {^%} {
+ while {[regexp -indices {\\(begin|end) *{tcl\*?}} $line\
+ match type]} {
+ set dtxload::in_tcl_env\
+ [expr {"[eval string range \$line $type]"=="begin"}]
+ set line [string range $line\
+ [expr {[lindex $match 1]+1}] end]
+ }
+ }
+% \end{tcl}
+% Finally, all lines that do not begin with a |%| are code lines.
+% \begin{tcl}
+ default {
+ if {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}}\
+%
+ then {return [list $pos2 $line $pos]}
+ }
+ }
+ }
+ }
+ list $endpos
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+% \subsection{Evaluating the code}
+%
+% The code in this subsection is based on the \Alpha\ procedures
+% |Alpha::evaluate| and |tcltk::evaluate|, but |dtxload::evaluate|
+% tries to return a bit more information.
+%
+% \begin{proc}{evaluate}
+% The |dtxload::evaluate| procedure takes a script as argument and
+% evaluates it in the global variable context. Any errors that occur
+% are caught. The returned value is a list with the structure
+% \begin{quote}
+% \word{code} \word{message}
+% \begin{regexp}[\regopt]\word{errorInfo}
+% \word{errorCode}\end{regexp}
+% \end{quote}
+% \word{code} is the \Tcllogo\ return code, as returned by |catch|
+% when evaluating the script. \word{message} is the value returned by
+% the script; it is an error message if an error occurred.
+% \word{errorInfo} is the value that the global variable |errorInfo|
+% got after the script was evaluated and \word{errorCode} is the
+% corresponding value of |errorCode|.
+%
+% When the \Alpha\ global variable |evaluateRemotely| is |0| the
+% evaluation is carried out by \Alpha\ itself, but when
+% |evaluateRemotely| is |1| the script is instead sent to a separate
+% \Tcllogo\ shell for evaluation. The current implementation does not
+% return the values of the |errorInfo| and |errorCode| variables in
+% that case, which is why they may be absent from the return value of
+% |dtxload::evaluate|.
+% \changes{v\,1.0}{2000/10/17}{Moved \texttt{history} interaction to
+% \texttt{dtxload::shell\_log}. (LH)}
+% \changes{v\,1.1}{2000/12/05}{Added code for remote evaluation. (LH)}
+% \begin{tcl}
+proc dtxload::evaluate {t} {
+ global errorInfo errorCode evaluateRemotely tcl_platform
+ if {!$evaluateRemotely} then {
+ if {[set code [catch {uplevel \#0 $t} msg]] == 1} then {
+% \end{tcl}
+% If there was an error, the last part of the value of |errorInfo|
+% will be due to the |uplevel| command. As that command was not
+% requested by the user, it would be confusing and it is therefore
+% best to remove it.
+% \begin{tcl}
+ set L [split $errorInfo \n]
+ set errorInfo [join [lrange $L 0 [expr {[llength $L] - 4}]] \n]
+ }
+ list $code $msg $errorInfo $errorCode
+ } elseif {$tcl_platform(platform) == "macintosh"} then {
+% \end{tcl}
+% On the \mbox{MacOS} platform, the script is sent to a remote
+% \Tcllogo\ shell via AppleEvents.
+% \begin{tcl}
+ global tclshSig
+ app::ensureRunning $tclshSig
+ list [catch {
+ aebuild::result -t 30000 '${tclshSig}' misc dosc ----\
+ [aebuild::TEXT $t]
+ } res]\
+ $res
+ } else {
+% \end{tcl}
+% On the other platforms I don't really know what should be done. The
+% following code is based on that in |tcltk::evaluate|, but I haven't
+% been able to test it (help, please?).
+% \begin{tcl}
+ global tclshInterp
+ if {![info exists tclshInterp]} {
+ if {[catch {tcltk::findTclshInterp}]} {
+ return [list 1 "No shell selected"]
+ }
+ }
+ if {$tcl_platform(platform) == "windows"} {
+ if {[dde services Tk $tclshInterp] == ""} {
+ alertnote "The remote shell has died, please select a new one."
+ unset tclshInterp
+ return [dtxload::evaluate $t]
+ }
+ list [catch {dde execute Tk $tclshInterp $t} res] $res
+ } else {
+ list [catch {send $tclshInterp $t} res] $res
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Logging}
+%
+% The code in this subsection is based on the \Alpha\ procedures
+% |Shel::carriageReturn| and |Alpha::evaluate|, but many details had to
+% be changed because, amongst other things, the window to which text is
+% written is not the frontmost one.
+%
+% \begin{proc}{message_log}
+% The |dtxload::message_log| procedure handles logging a script
+% evaluation on the status line. It takes one argument, which is the
+% script to evaluate, and returns a boolean value that specifies whether
+% an error occurred (|0| is no error, |1| is that there was an error).
+%
+% Since the status line is rather limited in size there isn't very
+% much that can be logged on it. |dtxload::message_log| simply displays
+% the result or error that occurred.
+% \begin{tcl}
+proc dtxload::message_log {script} {
+ set res [dtxload::evaluate $script]
+ if {[lindex $res 0]==1} then {
+ message "Tcl eval error: [lindex $res 1]"
+ expr 1
+ } else {
+ if {[string length [lindex $res 1]] == 0} then {
+ message "Tcl eval OK."
+ } else {
+ message "Tcl eval OK: [lindex $res 1]"
+ }
+ expr 0
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{window_log}
+% \changes{v\,1.1}{2000/12/05}{Renamed procedure (old name was
+% \texttt{dtxload:\discretionary{}{}{}:shell\_log}). (LH)}
+% \begin{variable}{log_window_name}
+% \changes{v\,1.1}{2000/12/05}{Renamed variable (old name was
+% \texttt{dtxload:\discretionary{}{}{}:shell\_window\_name}). (LH)}
+% The |dtxload::window_log| procedure handles logging a script
+% evaluation in a window, which must be open when this procedure is
+% called. It takes one argument, which is the script to evaluate, and
+% returns a boolean value that specifies whether an error occurred
+% (|0| is no error, |1| is that there was an error).
+%
+% When it is set the |dtxload::log_window_name| variable holds the
+% name of the window which is used in logging, and when it isn't set
+% this means that logging should be in the status line. Initially it
+% is unset.
+% \begin{tcl}
+if {[info exists dtxload::log_window_name]} then {
+ unset dtxload::log_window_name
+}
+% \end{tcl}
+% \end{variable}
+%
+% If the log window has mode |Shel| then the |script| is recorded in
+% the history list, but since the shells have trouble handling history
+% items that contain more than one line, all newlines in the recorded
+% script will be replaced by semicolons. This \emph{can} change the
+% meaning of the script, but hopefully that happens so rarely that one
+% can live with it.
+% \changes{v\,1.0}{2000/11/01}{Scripts added to the history list are
+% converted to one-liners. (LH)}
+% \begin{tcl}
+proc dtxload::window_log {script} {
+ upvar #0 dtxload::log_window_name win
+ global win::Modes Shel::startPrompt Shel::endPrompt
+ if {[set win::Modes($win)] == "Shel"} then {
+ global Shel::histnum
+ regsub -all \n [string trimright $script] " ; " text
+ history add $text
+ set Shel::histnum [history nextid]
+ }
+% \end{tcl}
+%
+% Next the script is inserted into (at the end of) the log window.
+% The lines on which logged scripts are written are marked out using
+% a special \package{dtxload} prompt, which is constructed as
+% \begin{quote}
+% |"${Shel::startPrompt}dtxload${Shel::endPrompt} "|
+% \end{quote}
+% If the log window mode is |Shel| and the last thing in the window
+% is the current prompt for the window, then that prompt is replaced
+% by the \package{dtxload} prompt, otherwise a newline followed by a
+% \package{dtxload} prompt will be appended to the window. The result
+% of a logged script is put on the line after the last line of the
+% script.
+% \begin{tcl}
+ set pos [maxPos -w $win]
+ select -w $win $pos $pos
+ set dtxprompt "${Shel::startPrompt}dtxload${Shel::endPrompt} "
+ if {[set win::Modes($win)] != "Shel"} then {
+ insertText -w $win \r$dtxprompt
+ } else {
+ set stdprompt [Alpha::Prompt]
+ set pos2 [pos::math $pos - [string length $stdprompt]]
+ if {[getText -w $win $pos2 $pos] != $stdprompt} then {
+ insertText -w $win \r$dtxprompt
+ } else {
+ replaceText -w $win $pos2 $pos $dtxprompt
+ refresh
+ }
+ }
+% \end{tcl}
+% There currently is a bug (it is fixed in \Alpha~8) in
+% |replaceText| which causes it to always draw in the current window.
+% The |refresh| restores the proper window contents.
+% \changes{v\,1.0}{2000/10/16}{\texttt{refresh} inserted to overcome
+% \texttt{replaceText} bug. (LH)}
+%
+% Inserting the actual script text is basically an |insertText|, but
+% before the script is inserted all newlines in it (except the last)
+% are replaced by newlines followed by a \package{dtxload} prompt.
+% Since |dtxload::load| converts all newlines to linefeeds, it is
+% sufficient to replace linefeeds. It seems that newlines in \Alpha\
+% are always carriage returns (regardless of the window's ``platform''
+% attribute), and I assume that the \package{dtxload} prompt doesn't
+% contain any regexp metacharacter.
+% \changes{v\,1.0}{2000/10/16}{Assuming newlines in the script to log
+% are linefeeds. (LH)}
+% \begin{tcl}
+ regsub -all \n [string trimright $script] \r$dtxprompt text
+ insertText -w $win "$text\r"
+% \end{tcl}
+% After the script has been logged, it is time to evaluate it and log
+% the result.
+% \begin{tcl}
+ set res [dtxload::evaluate $script]
+ if {[lindex $res 0]==1} then {
+ insertText -w $win "Error: [lindex $res 1]\r"
+ if {[llength $res]>2} then {
+ global errorInfo
+ set errorInfo [lindex $res 2]
+ }
+ message "Tcl eval error"
+ } else {
+ if {[string length [lindex $res 1]]>0}\
+ then {insertText -w $win "[lindex $res 1]\r"}
+ message "Tcl eval OK"
+ }
+% \end{tcl}
+% If the window has mode |Shel| then the window's current prompt is
+% inserted. It is necessary to call |Alpha::Prompt| again because
+% evaluating the script might have changed the prompt. Then the return
+% value is finally computed.
+% \begin{tcl}
+ if {[set win::Modes($win)] == "Shel"}\
+ then {insertText -w $win [Alpha::Prompt]}
+ expr {[lindex $res 0]==1}
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+%
+% \subsection{Putting it all together}
+%
+% \begin{proc}{load}
+% The |dtxload::load| procedure implements the \package{dtxload} user
+% command---it extracts and evaluates the code in the current
+% selection (if something is selected) or the entire front window (if
+% nothing is selected). The evaluation is logged a window or on the
+% status line depending on the current value of
+% |dtxload::log_window_name|.
+%
+% Code is extracted and evaluated one command (or as close as one gets)
+% at a time. In case an error occurs the loading is stopped and the
+% insertion point is moved to the beginning of the problematic script,
+% whereas the mark is put at the end of the code to load. This way a
+% simple \textsf{Mark Hilite} will select the part of the code that
+% remains to be loaded.
+%
+% The very first thing |dtxload::load| does is to check whether it is
+% allowed to load any code in this window.
+% \begin{tcl}
+proc dtxload::load {} {
+ global onlyLoadDtxFiles
+ if {$onlyLoadDtxFiles && ![string match *.dtx [win::CurrentTail]]}\
+ then {
+ message "Not a .dtx file."
+ return
+ }
+% \end{tcl}
+% Then the interval from which code should be extracted is
+% determined.
+% \begin{tcl}
+ set startpos [getPos]
+ set endpos [selEnd]
+ if {[pos::compare {$startpos == $endpos}]} then {
+ set startpos [minPos]
+ set endpos [maxPos]
+ }
+% \end{tcl}
+% Next it is determined what logging method should be used. The name
+% of the procedure gets stored in the local variable |log|.
+% \begin{tcl}
+ global dtxload::log_window_name
+ if {
+ [info exists dtxload::log_window_name] &&
+ [lsearch -exact [winNames] ${dtxload::log_window_name}]!=-1
+ } then {set log dtxload::window_log}\
+ else {set log dtxload::message_log}
+% \end{tcl}
+% After that a couple of extraction-related variables are initialized.
+% The idea behind how the |dtxload::in_tcl_env| variable is set is that
+% if one is loading a short piece of code inside a \texttt{tcl}
+% environment then the first line probably doesn't start with a |%|,
+% whereas if one is loading an entire file (and thus starts in
+% non-\texttt{tcl}-environment) the first character quite likely is a
+% |%|.
+% \begin{tcl}
+ global dtxload::in_tcl_env dtxload::module_stack\
+ dtxload::next_module_idx dtxload::module_included
+ set dtxload::in_tcl_env\
+ [expr {[getText $startpos [pos::math {$startpos+1}]] != "%"}]
+ set dtxload::module_stack {}
+ set dtxload::next_module_idx 0
+ set dtxload::module_included 1
+% \end{tcl}
+% The last piece of initialization concerns the |script| local
+% variable, in which the extracted lines are collected until they
+% make up an entire command. The |escaped| variable is a boolean
+% which is true when the newline at the end of the last line of
+% |script| was escaped. The |spos| variable stores the position at
+% which the command currently being collected began, but it is
+% initialized to |none| here to help distinguishing the case that no
+% extractable code was found.
+% \begin{tcl}
+ set script ""
+ set escaped 0
+ set spos none
+ while {[pos::compare $startpos < $endpos]} {
+ set extract [dtxload::extract_line $startpos $endpos]
+ if {[llength $extract]>1} then {
+% \end{tcl}
+% When a line of code has been extracted, it must be appended to
+% |script|. This isn't as easy as one might imagine, because \Tcllogo\
+% code being |source|d (which is what loading must function as) is fed
+% through a few more conversion steps than code being |eval|ed. In
+% particular all escaped newlines are converted to spaces and all
+% other newlines are converted to linefeeds, so that must be done
+% explicitly. A newline is considered to be escaped if is is preceded
+% by an odd number of backslashes, and if it is then the last backslash
+% and the newline are replaced by a single space. If the last line of
+% |script| ended by an escaped newline then the script is considered
+% incomplete and more code will be collected before evaluation is
+% attempted. Evaluation of |script| is also conditioned by that |info\
+% complete $script| returns |1|.
+% \changes{v\,1.0}{2000/10/16}{Converting nonescaped newlines to
+% linefeeds, since \Tcllogo\ doesn't consider carriage returns to
+% be command separators. (LH)}
+% \begin{tcl}
+ if {[string length $script]==0} then {
+ set spos [lindex $extract 2]
+ }
+ set line [lindex $extract 1]
+ if {$escaped} then {set line [string trimleft $line]}
+ set escaped [regsub -all\
+ "((^|\[^\\\\\])(\\\\\\\\)*)\\\\(\r|\n|\r\n)$" $line {\1 } line]
+ if {!$escaped} then {regsub "\r\n?\$" $line \n line}
+ append script $line
+ if {!$escaped && [info complete $script]} then {
+ if {[$log $script]} then {
+ select $spos $endpos
+ markHilite
+ return
+ } else {
+ set script ""
+ }
+ }
+ } elseif {$spos=="none"} then {
+ message "No extractable code found."
+ }
+ set startpos [lindex $extract 0]
+ }
+% \end{tcl}
+% If the |script| variable isn't empty, then try to evaluate whatever
+% is in it before returning. If not even that causes an error the
+% |dtxload:|\penalty\hyphenpenalty|:known_expressions| array is unset
+% so that one can use other options for the next piece of code loaded.
+% \begin{tcl}
+ if {[string length $script]>0 && [$log $script]} then {
+ select $spos $endpos
+ markHilite
+ } else {
+ global dtxload::known_expressions
+ if {[info exists dtxload::known_expressions]}\
+ then {unset dtxload::known_expressions}
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Setting the log destination}
+%
+% \begin{proc}{logdest}
+% \changes{v\,1.0}{2000/10/16}{Procedure added. (LH)}
+% \changes{v\,1.1}{2000/12/07}{Procedure renamed from
+% \texttt{dtxload::redirect} and the syntax was changed. (LH)}
+% The log destination is set using the |dtxload::logdest| procedure.
+% The general syntax for this procedure is
+% \begin{quote}
+% |dtxload::logdest| \word{keyword} \word{window name}\regopt
+% \end{quote}
+% where the \word{keyword} (mainly) specifies the type of log
+% destination and \word{window name} is the name of the target
+% window (ignored for some \word{keyword}s).
+% \begin{tcl}
+proc dtxload::logdest {type {win "dtxload log"}} {
+ global dtxload::log_window_name
+ switch -exact -- $type {
+% \end{tcl}
+% The first form of |dtxload::logdest| has the syntax
+% \begin{quote}
+% |dtxload::logdest status|
+% \end{quote}
+% It makes the status line the log destination.
+% \begin{tcl}
+ status {
+ if {[info exists dtxload::log_window_name]}\
+ then {unset dtxload::log_window_name}
+ }
+% \end{tcl}
+% The second form has the syntax
+% \begin{quote}
+% |dtxload::logdest here|
+% \end{quote}
+% It makes the current window the log destination, regardless of what
+% may already be in it or which mode it has.
+% \begin{tcl}
+ here {set dtxload::log_window_name [win::CurrentTail]}
+% \end{tcl}
+% The third form has the syntax
+% \begin{quote}
+% |dtxload::logdest window| \word{window name}
+% \end{quote}
+% It sets the log destination to the window named \word{window name},
+% regardless of what may already be in it or which mode it has. If
+% the window does not already exist it is created.
+% \begin{tcl}
+ window {
+ if {[lsearch -exact [winNames] $win] == -1} then {
+ new -n $win -shell 1 -text "This is a dtxload log window.\r"
+ }
+ set dtxload::log_window_name $win
+ }
+% \end{tcl}
+% The fourth and final form has the syntax
+% \begin{quote}
+% |dtxload::logdest shell| \word{window name}
+% \end{quote}
+% It calls |Shel::start| to open a \Tcllogo\ shell window and sets the
+% log destination to that window.
+% \begin{tcl}
+ shell {
+ Shel::start "Alpha" $win\
+ "This is a dtxload log window (and Alpha Tcl shell).\r"
+ set dtxload::log_window_name $win
+ }
+ }
+}
+%</tcl>
+% \end{tcl}
+% \end{proc}
+%
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/tcldoc/dtxload.ins b/Master/texmf-dist/source/latex/tcldoc/dtxload.ins
new file mode 100644
index 00000000000..4e33fb87512
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/dtxload.ins
@@ -0,0 +1,54 @@
+% dtxload.ins --- DOCSTRIP installation script for dtxload.
+\input docstrip
+
+% Redefine the \MetaPrefix; it should be something which starts a
+% until-end-of-line comment:
+\edef\MetaPrefix{\string#\string#}
+
+
+% Redefine the file preamble and postamble; this is necessary because
+% otherwise the old \metaPrefix is inserted at the beginning of these
+% lines.
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+% Add a (auto-install) line at the top of the preamble, so that
+% Alpha will auto-install it.
+\edef\defaultpreamble{%
+ \MetaPrefix\space (auto-install)^^J%
+ \defaultpreamble
+}
+
+% Actually make dtxload.tcl:
+\generate{\file{dtxload.tcl}{\from{dtxload.dtx}{tcl}}}
+
+
+\Msg{}
+\Msg{**********************************************}
+\Msg{*}
+\Msg{* To complete installation,}
+\Msg{* have Alpha open the file dtxload.tcl}
+\Msg{* somewhere outside Alpha's folder hierarchy.}
+\Msg{*}
+\Msg{**********************************************}
+\Msg{}
+
+
+\end
+
diff --git a/Master/texmf-dist/source/latex/tcldoc/dtxload.tcl b/Master/texmf-dist/source/latex/tcldoc/dtxload.tcl
new file mode 100644
index 00000000000..af26546a774
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/dtxload.tcl
@@ -0,0 +1,361 @@
+## (auto-install)
+##
+## This is file `dtxload.tcl',
+## generated with the docstrip utility.
+##
+## The original source files were:
+##
+## dtxload.dtx (with options: `tcl')
+##
+## This file 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.
+##
+## This file may only be distributed together with a copy of the source
+## file from which it was generated. You may distribute that source file
+## without this generated file.
+##
+alpha::feature dtxload 1.1 {TeX} {
+ # When set, the Load Tcl Code command will be disabled in
+ # TeX files whose suffix is not dtx.
+ newPref flag onlyLoadDtxFiles 1 TeX
+ # When set, the Load Tcl Code command will only extract code
+ # from code lines in tcl and tcl* environments.
+ newPref flag onlyLoadTclEnvs 1 TeX
+ # This is the key binding for dtxload's Load Tcl Code command.
+ newPref binding loadTclCode <O/L TeX "" dtxload::load TeX
+} "" "" uninstall {this-file} \
+ maintainer {"Lars Hellstr\x9am" Lars.Hellstrom@math.umu.se} \
+ help {The dtxload package implements a command for loading
+ Tcl code that is embedded in a .dtx file without docstripping
+ the file first. For more help, LaTeX the file dtxload.dtx.}
+namespace eval dtxload {}
+proc dtxload::eval_guard {e} {
+ global dtxload::known_expressions
+ if {![info exists dtxload::known_expressions($e)]} then {
+ set dtxload::known_expressions($e)\
+ [expr {"yes" ==\
+ "[askyesno "Should <$e> modules be included?"]"}]
+ }
+ set dtxload::known_expressions($e)
+}
+proc dtxload::push_module {e p} {
+ global dtxload::module_stack
+ lappend dtxload::module_stack [list $e $p]
+}
+proc dtxload::pop_module {e p} {
+ global dtxload::module_stack dtxload::module_included\
+ dtxload::next_module_idx
+ set len [llength ${dtxload::module_stack}]
+ if {$len==0} then {return}
+ set L [lindex ${dtxload::module_stack} [expr {$len-1}]]
+ if {[lindex $L 0] != $e} then {
+ switch [buttonAlert "Module nesting error: <*[lindex $L 0]>\
+ module ended by </$e>. For which guards should the positions\
+ be pushed?" None Start End Both]\
+ {
+ Start {dtxload::push_bookmarks [lindex $L 1]}
+ End {dtxload::push_bookmarks $p}
+ Both {dtxload::push_bookmarks [lindex $L 1] $p}
+ }
+ }
+ set dtxload::module_stack\
+ [lreplace ${dtxload::module_stack} end end]
+ if {$len>=${dtxload::next_module_idx}} then {
+ incr dtxload::next_module_idx -1
+ }
+ if {[llength $L]>2} then {
+ set dtxload::module_included [lindex $L 2]
+ }
+}
+proc dtxload::push_bookmarks {args} {
+ global markStack markName
+ foreach pos $args {
+ set name mark$markName
+ incr markName
+ createTMark $name $pos
+ set fileName [win::Current]
+ set markStack [linsert $markStack 0 [list $fileName $name]]
+ }
+}
+proc dtxload::update_included {} {
+ global dtxload::module_included dtxload::module_stack\
+ dtxload::next_module_idx
+ while {${dtxload::module_included} &&\
+ ${dtxload::next_module_idx}<[llength ${dtxload::module_stack}]}\
+ {
+ set L [lindex ${dtxload::module_stack} ${dtxload::next_module_idx}]
+ lappend L ${dtxload::module_included}
+ set dtxload::module_stack [lreplace ${dtxload::module_stack}\
+ ${dtxload::next_module_idx} ${dtxload::next_module_idx} $L]
+ incr dtxload::next_module_idx
+ set dtxload::module_included [dtxload::eval_guard [lindex $L 0]]
+ }
+}
+proc dtxload::extract_line {startpos endpos} {
+ global dtxload::in_tcl_env onlyLoadTclEnvs dtxload::module_included
+ for {set pos $startpos} {[pos::compare {$pos<$endpos}]}\
+ {set pos $pos2} {
+ set pos2 [nextLineStart $pos]
+ if {$pos2>$endpos} then {set pos2 $endpos}
+ set line [getText $pos $pos2]
+ switch -regexp -- $line {
+ {^%<<} {
+ if {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}} then {
+ alertnote "docstrip verbatim mode guard line\
+ encountered. Verbatim mode extraction is\
+ currently not supported, so I stop here."
+ goto $pos
+ return [list $endpos]
+ }
+ }
+ set endtag %[string trimright [string trimright\
+ [string range $line 3 end] \n\r] \ ]
+ while {[string trimright [string trimright $line \n\r] \ ]\
+ != $endtag} {
+ set pos $pos2
+ if {[pos::compare {$pos>=$endpos}]}\
+ then {return [list $pos]}
+ set pos2 [nextLineStart $pos]
+ if {$pos2>$endpos} then {set pos2 $endpos}
+ set line [getText $pos $pos2]
+ }
+ }
+ {^%<[*/]} {
+ if {![regexp {^%<(\*|/)([^>]+)>} $line foo modifier\
+ expression]}\
+ then {
+ if {"[askyesno "Malformed guard line \"$line\"\
+ encountered. Push position?"]"=="yes"}\
+ then {dtxload::push_bookmarks $pos}
+ } elseif {$modifier=="*"} then {
+ dtxload::push_module $expression $pos
+ } else {
+ dtxload::pop_module $expression $pos
+ }
+ }
+ {^%<} {
+ if {![regexp {^%<(-|\+|)([^>]+)>(.*)$} $line\
+ foo modifier expression code]}\
+ then {
+ if {"[askyesno "Malformed guard line \"$line\"\
+ encountered. Push position?"]"=="yes"}\
+ then {dtxload::push_bookmarks $pos}
+ } elseif {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}} then {
+ if {[dtxload::eval_guard $expression] !=\
+ ($modifier=="-")}\
+ then {return [list $pos2 $code $pos]}
+ }
+ }
+ }
+ {^%} {
+ while {[regexp -indices {\\(begin|end) *{tcl\*?}} $line\
+ match type]} {
+ set dtxload::in_tcl_env\
+ [expr {"[eval string range \$line $type]"=="begin"}]
+ set line [string range $line\
+ [expr {[lindex $match 1]+1}] end]
+ }
+ }
+ default {
+ if {!$onlyLoadTclEnvs || ${dtxload::in_tcl_env}} then {
+ dtxload::update_included
+ if {${dtxload::module_included}}\
+ then {return [list $pos2 $line $pos]}
+ }
+ }
+ }
+ }
+ list $endpos
+}
+proc dtxload::evaluate {t} {
+ global errorInfo errorCode evaluateRemotely tcl_platform
+ if {!$evaluateRemotely} then {
+ if {[set code [catch {uplevel \#0 $t} msg]] == 1} then {
+ set L [split $errorInfo \n]
+ set errorInfo [join [lrange $L 0 [expr {[llength $L] - 4}]] \n]
+ }
+ list $code $msg $errorInfo $errorCode
+ } elseif {$tcl_platform(platform) == "macintosh"} then {
+ global tclshSig
+ app::ensureRunning $tclshSig
+ list [catch {
+ aebuild::result -t 30000 '${tclshSig}' misc dosc ----\
+ [aebuild::TEXT $t]
+ } res]\
+ $res
+ } else {
+ global tclshInterp
+ if {![info exists tclshInterp]} {
+ if {[catch {tcltk::findTclshInterp}]} {
+ return [list 1 "No shell selected"]
+ }
+ }
+ if {$tcl_platform(platform) == "windows"} {
+ if {[dde services Tk $tclshInterp] == ""} {
+ alertnote "The remote shell has died, please select a new one."
+ unset tclshInterp
+ return [dtxload::evaluate $t]
+ }
+ list [catch {dde execute Tk $tclshInterp $t} res] $res
+ } else {
+ list [catch {send $tclshInterp $t} res] $res
+ }
+ }
+}
+proc dtxload::message_log {script} {
+ set res [dtxload::evaluate $script]
+ if {[lindex $res 0]==1} then {
+ message "Tcl eval error: [lindex $res 1]"
+ expr 1
+ } else {
+ if {[string length [lindex $res 1]] == 0} then {
+ message "Tcl eval OK."
+ } else {
+ message "Tcl eval OK: [lindex $res 1]"
+ }
+ expr 0
+ }
+}
+if {[info exists dtxload::log_window_name]} then {
+ unset dtxload::log_window_name
+}
+proc dtxload::window_log {script} {
+ upvar #0 dtxload::log_window_name win
+ global win::Modes Shel::startPrompt Shel::endPrompt
+ if {[set win::Modes($win)] == "Shel"} then {
+ global Shel::histnum
+ regsub -all \n [string trimright $script] " ; " text
+ history add $text
+ set Shel::histnum [history nextid]
+ }
+ set pos [maxPos -w $win]
+ select -w $win $pos $pos
+ set dtxprompt "${Shel::startPrompt}dtxload${Shel::endPrompt} "
+ if {[set win::Modes($win)] != "Shel"} then {
+ insertText -w $win \r$dtxprompt
+ } else {
+ set stdprompt [Alpha::Prompt]
+ set pos2 [pos::math $pos - [string length $stdprompt]]
+ if {[getText -w $win $pos2 $pos] != $stdprompt} then {
+ insertText -w $win \r$dtxprompt
+ } else {
+ replaceText -w $win $pos2 $pos $dtxprompt
+ refresh
+ }
+ }
+ regsub -all \n [string trimright $script] \r$dtxprompt text
+ insertText -w $win "$text\r"
+ set res [dtxload::evaluate $script]
+ if {[lindex $res 0]==1} then {
+ insertText -w $win "Error: [lindex $res 1]\r"
+ if {[llength $res]>2} then {
+ global errorInfo
+ set errorInfo [lindex $res 2]
+ }
+ message "Tcl eval error"
+ } else {
+ if {[string length [lindex $res 1]]>0}\
+ then {insertText -w $win "[lindex $res 1]\r"}
+ message "Tcl eval OK"
+ }
+ if {[set win::Modes($win)] == "Shel"}\
+ then {insertText -w $win [Alpha::Prompt]}
+ expr {[lindex $res 0]==1}
+}
+proc dtxload::load {} {
+ global onlyLoadDtxFiles
+ if {$onlyLoadDtxFiles && ![string match *.dtx [win::CurrentTail]]}\
+ then {
+ message "Not a .dtx file."
+ return
+ }
+ set startpos [getPos]
+ set endpos [selEnd]
+ if {[pos::compare {$startpos == $endpos}]} then {
+ set startpos [minPos]
+ set endpos [maxPos]
+ }
+ global dtxload::log_window_name
+ if {
+ [info exists dtxload::log_window_name] &&
+ [lsearch -exact [winNames] ${dtxload::log_window_name}]!=-1
+ } then {set log dtxload::window_log}\
+ else {set log dtxload::message_log}
+ global dtxload::in_tcl_env dtxload::module_stack\
+ dtxload::next_module_idx dtxload::module_included
+ set dtxload::in_tcl_env\
+ [expr {[getText $startpos [pos::math {$startpos+1}]] != "%"}]
+ set dtxload::module_stack {}
+ set dtxload::next_module_idx 0
+ set dtxload::module_included 1
+ set script ""
+ set escaped 0
+ set spos none
+ while {[pos::compare $startpos < $endpos]} {
+ set extract [dtxload::extract_line $startpos $endpos]
+ if {[llength $extract]>1} then {
+ if {[string length $script]==0} then {
+ set spos [lindex $extract 2]
+ }
+ set line [lindex $extract 1]
+ if {$escaped} then {set line [string trimleft $line]}
+ set escaped [regsub -all\
+ "((^|\[^\\\\\])(\\\\\\\\)*)\\\\(\r|\n|\r\n)$" $line {\1 } line]
+ if {!$escaped} then {regsub "\r\n?\$" $line \n line}
+ append script $line
+ if {!$escaped && [info complete $script]} then {
+ if {[$log $script]} then {
+ select $spos $endpos
+ markHilite
+ return
+ } else {
+ set script ""
+ }
+ }
+ } elseif {$spos=="none"} then {
+ message "No extractable code found."
+ }
+ set startpos [lindex $extract 0]
+ }
+ if {[string length $script]>0 && [$log $script]} then {
+ select $spos $endpos
+ markHilite
+ } else {
+ global dtxload::known_expressions
+ if {[info exists dtxload::known_expressions]}\
+ then {unset dtxload::known_expressions}
+ }
+}
+proc dtxload::logdest {type {win "dtxload log"}} {
+ global dtxload::log_window_name
+ switch -exact -- $type {
+ status {
+ if {[info exists dtxload::log_window_name]}\
+ then {unset dtxload::log_window_name}
+ }
+ here {set dtxload::log_window_name [win::CurrentTail]}
+ window {
+ if {[lsearch -exact [winNames] $win] == -1} then {
+ new -n $win -shell 1 -text "This is a dtxload log window.\r"
+ }
+ set dtxload::log_window_name $win
+ }
+ shell {
+ Shel::start "Alpha" $win\
+ "This is a dtxload log window (and Alpha Tcl shell).\r"
+ set dtxload::log_window_name $win
+ }
+ }
+}
+##
+##
+## End of file `dtxload.tcl'.
diff --git a/Master/texmf-dist/source/latex/tcldoc/examples/README.txt b/Master/texmf-dist/source/latex/tcldoc/examples/README.txt
new file mode 100644
index 00000000000..2d3d8abe5da
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/examples/README.txt
@@ -0,0 +1,40 @@
+README for the parsetcl and writepdf packages:
+==============================================
+
+The parsetcl package implements basic parsing
+of Tcl scripts, and is written completely in
+Tcl. To generate parsetcl.tcl, run LaTeX on
+parsetcl.ins. To typeset the documentation,
+run LaTeX on parsetcl.dtx. To see an example
+of what it does, you can try the following
+commands in a Tcl shell:
+
+ source parsetcl.tcl
+ auto_load parray
+ set tree [parsetcl::simple_parse_script [info body parray]]
+ parsetcl::format_tree $tree {} { }
+
+The tree variable will be set to a parser tree
+for the body of the parray procedure. The last
+command reformats this tree (mostly replacing
+whitespace between list elements) to make the
+structure more visible.
+
+
+The writepdf package is written completely in
+Tcl and provides basic commands for writing
+well-formed PDF files. To generate writepdf.tcl,
+run LaTeX on pdf.ins. To typeset the
+documentation, run LaTeX on pdf.dtx. To see an
+example of what it does, you can try the following
+commands in a Tcl shell:
+
+ source writepdf.tcl
+ source hellopdf.tcl
+
+This will generate a file hello.pdf that contains
+a single page with the two words "Hello world!".
+
+
+Lars Hellström,
+20 July 2003
diff --git a/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.dtx b/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.dtx
new file mode 100644
index 00000000000..22609d6fa4e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.dtx
@@ -0,0 +1,1155 @@
+%
+% \iffalse
+%<*driver>
+\documentclass{tclldoc}
+
+\newcommand{\ParseTcl}{Parse\Tcllogo}
+\providecommand{\href}[2]{#2}
+
+\begin{document}
+\DocInput{parsetcl.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%
+% \title{\ParseTcl\ --- a parser for \Tcllogo\ code}
+% \author{Lars Hellstr\"om}
+%
+% \maketitle
+%
+%
+% \begin{abstract}
+% \ParseTcl\ is a \Tcllogo\ package for parsing \Tcllogo\ code.
+% It is written completely in \Tcllogo, and make heavy use of some
+% new additions in \Tcllogo\,8.4.
+% \end{abstract}
+%
+% \begin{tcl}
+%<*pkg>
+namespace eval parsetcl {}
+package require Tcl 8.4
+package provide parsetcl 0.1
+% \end{tcl}
+% \setnamespace{parsetcl}
+%
+% \tableofcontents
+%
+% \section{Parser results}
+%
+% The values returned by the parser are conceptually rooted trees, but
+% technically the return values are lists. The general format of a
+% subtree is
+% \begin{quote}
+% \word{type} \word{interval} \word{text} \word{subtree}\regstar
+% \end{quote}
+% where there is one \word{subtree} for each component that remains if
+% the root of the subtree under consideration is deleted. The
+% \word{type} specifies what kind of construction the subtree
+% corresponds to. The \word{interval} is a list with the structure
+% \begin{quote}
+% \word{first} \word{last}
+% \end{quote}
+% where \word{first} and \word{last} are integers; the indices into
+% the input string of the first and last respectively character that
+% corresponds to this part of the parser tree. The \word{text} is,
+% depending on the \word{type}, either empty or the explicit string
+% that corresponds to this subtree.
+%
+% The \word{type}s are generally two-character strings, where the first
+% letter specifies a major category and the second letter an exact type
+% within that category, but this system is not enforced by any code.
+% \begin{description}
+% \item[Null types]
+% The \emph{null} types all begin with an |N|. These correspond to
+% information which isn't part of the script proper, but still is
+% useful to include in the parse result. It is generally possible
+% to add or remove subtrees of this type without changing the
+% meaning of the reconstruction of the script.
+% \begin{enumerate}
+% \item[\texttt{Nc}] \describestring[subtree type]{Nc}
+% This type is for comments, and it normally appears only in
+% places where one would expect a command subtree. The
+% \word{interval} includes the |#| beginning the comment, but not
+% the newline ending it. The \word{text} is the text in the
+% comment (initial |#| not included).
+% \item[\texttt{Ne}] \describestring[subtree type]{Ne}
+% This type is for syntax errors; rather than stopping at every
+% error, the parser routines will try to recover as best they can,
+% and an error item will be inserted in the parser tree. This
+% type of item generally appears as a \word{subtree} of whatever
+% was being parsed when the error was detected. The \word{text} is
+% a human-readable error message. The \word{interval} specifies
+% the erroneous characters; if the error is that some character(s)
+% is missing then the end of the interval is the index of the
+% character before that which is missing, and the start of the
+% interval is the character after that which is missing.
+% \item[\texttt{Np}] \describestring[subtree type]{Np}
+% This type is merely a placeholder; both the \word{interval} and
+% the \word{text} are empty strings. It is used when there was
+% nothing to return, but call syntax requires that a subtree is
+% returned. If some call returns an item of this type then it
+% usually means that its caller also has reached the end of
+% whatever that was parsing.
+% \end{enumerate}
+%
+% \item[Literate types]
+% The literate, or verbatim, types all begin with an |L|. Words (of
+% a command) where no variable or command substitution will happen
+% usually belong in this category. There are three types of
+% literates: \describestring[subtree type]{Lb}|Lb|s are delimited by
+% braces and \describestring[subtree type]{Lq}|Lq|s are delimited by
+% quotes, whereas \describestring[subtree type]{Lr}|Lr|s have no
+% particular delimiters. In each case, the \word{text} is the string
+% that this interval of the input gets parsed into.
+%
+% Backslash--newline substitution is silently performed, but other
+% types of substitution will result in that the item is considered
+% to consist of one or more parts, each of which will be
+% represented as a separate \word{subtree}. The delimiting quotes
+% of an |Lq| is never included in the \word{interval} of any
+% \word{subtree}. An |Lb| never has any \word{subtree}s due to
+% substitution, since it can only be subject to backslash--newline
+% substitution, but it may have |Ne| subtrees.
+%
+% \item[Merge types]
+% The merge types all begin with an |M|. They are similar to the
+% literate types, but are used for intervals of the input for which
+% the \emph{text} cannot be completely determined.
+% \describestring[subtree type]{Mq}|Mq|s are delimited by quotes,
+% whereas \describestring[subtree type]{Mr}|Mr|s have no particular
+% delimiters. The \word{text} is set to an empty string. There is
+% always at least one \word{subtree}.
+%
+% \item[Substitution types]
+% The substitution types all begin with an |S|. As the name
+% indicates, they are used for intervals of the input that will be
+% substituted by a \Tcllogo\ parser.
+% \begin{enumerate}
+% \item[\texttt{Sb}] \describestring[subtree type]{Sb}
+% This type is for backslash substitution. The \word{text} is
+% the character produced by this substitution. There is always
+% an |Lr| subtree for the text following the initial backslash.
+% \item[\texttt{Sv}] \describestring[subtree type]{Sv}
+% This type is for scalar variable substitution. The
+% \word{text} is empty, and there is one \word{subtree} for the
+% name of the variable being substituted. The type of this
+% subtree is either |Lr| or |Lb|, depending on whether the name
+% is surrounded by braces or not.
+% \item[\texttt{Sa}] \describestring[subtree type]{Sa}
+% This type is for array variable substitution. The
+% \word{text} is empty, and there are two \word{subtree}s: one
+% for the name of the array (always an |Lr|) and one for the
+% index into the array (either an |Lr| or an |Mr|).
+% \item[\texttt{Sc}] \describestring[subtree type]{Sc}
+% This type is for command substitution. The \word{text} is
+% empty, and there is one \word{subtree} for each command in
+% the script.
+% \end{enumerate}
+%
+% \item[The command type]
+% The \describestring[subtree type]{Cd}|Cd| type is for complete
+% commands. The \word{text} is empty, and each word in the command
+% has its own \word{subtree} (naturally, these are in the order of
+% the words in the command).
+%
+% \item[Root types]
+% The root types are used for the root in a parser tree, but they
+% may also appear as proper subtrees if the parser is invoked
+% recursively. This is for example what one does with the body
+% argument of the |while| command: technically it is a string just
+% like any other string, but it makes most sense to parse that
+% string as a script and replace the original literate item by the
+% entire tree generated by parsing this string.
+%
+% The root types all begin with an |R|. They are
+% \begin{enumerate}
+% \item[\texttt{Rs}] \describestring[subtree type]{Rs}
+% This type is for script parsing. The \word{text} is usually
+% empty, and each \word{subtree} is a command of the script.
+% \item[\texttt{Rx}] \describestring[subtree type]{Rx}
+% This type is for |expr| expression parsing.
+% \end{enumerate}
+%
+% \end{description}
+%
+% \subsection{Some examples}
+%
+% The script
+% \begin{quote}
+% |set a "b\nc"|
+% \end{quote}
+% will be parsed as the list
+%\begin{verbatim}
+% Rs {0 11} {} \
+% {Cd {0 11} {}
+% {Lr {0 2} set}
+% {Lr {4 4} a}
+% {Lq {6 11} b\nc
+% {Lr {7 7} b}
+% {Sb {8 9} \n {Lr {9 9} n}}
+% {Lr {10 10} c}
+% }
+% }
+%\end{verbatim}
+% NB: This is not the canonical string representation, but one that was
+% chosen for clarity of exposition. The |parsetcl::format_tree|
+% procedure can be used to reformat a parser tree with indentation as
+% shown above.
+%
+%
+% \section{Basic script parsing}
+%
+% Basic script parsing makes a purely syntactic parsing of a script. It
+% does not make any assumptions about the meaning of the commands used
+% in the script, and hence it will not try to parse as scripts any
+% argument of a commands (not even the byte-compiled commands).
+%
+% The parsing relies on a set of procedures which parses the next item
+% of a particular sort, and returns the corresponding parse subtree.
+% These procedures can call each other recursively in complicated ways,
+% following the actual structure of the script that is being parsed.
+% The general syntax for calling such a procedure is
+% \begin{quote}
+% \word{proc name} \word{string} \word{index-var-name}
+% \word{extra}\regstar
+% \end{quote}
+% where \word{string} is the string from which something should be
+% parsed and \word{index-var-name} is the name of a variable in the
+% local context of the caller which holds the index of the first
+% character that hasn't been parsed yet (or possibly the last character
+% that has been parsed, it may depend on what is most convenient for
+% that particular procedure). There are two reasons for using this
+% set-up. One is that the calling procedure usually needs to continue
+% parsing the string after the part that it made a recursive call to
+% have parsed, and for that purpose this variable provides a convenient
+% method of returning the value. The other reason is one of efficiency:
+% If the script as a whole is passed as an argument to all procedures
+% that are involved in the parsing process, as opposed to passing only
+% the part that hasn't been parsed yet, then the need to copy the data
+% decreases drastically.
+%
+%
+% \subsection{Commands and scripts}
+%
+% \begin{proc}{flush_whitespace}
+% The |flush_whitespace| procedure advances the index past a
+% whitespace sequence. The syntax is
+% \begin{quote}
+% |parsetcl::flush_whitespace| \word{script} \word{index-var-name}
+% \word{cmdsep}
+% \end{quote}
+% where \word{cmdsep} is |1| if command separators (newlines and
+% semicolons) should be flushed as well, but |0| if they should be
+% treated separately. The return value is the number of characters
+% that were flushed.
+% \begin{tcl}
+proc parsetcl::flush_whitespace {script index_var cmdsep} {
+ upvar 1 $index_var index
+ if {[
+ if {$cmdsep} then {
+ regexp -start $index -- {\A([ \t-\r;]|\\\n)+} $script match
+ } else {
+ regexp -start $index -- {\A([ \t\v\f\r]|\\\n)+} $script match
+ }
+ ]} then {
+ incr index [string length $match]
+ return [string length $match]
+ } else {
+ return 0
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{parse_command}
+% The |parse_command| procedure parses the next command, returning a
+% |Cd|, |Nc|, or |Np| item to its caller. The syntax is
+% \begin{quote}
+% |parsetcl::parse_command| \word{script} \word{index-var-name}
+% \word{nested}
+% \end{quote}
+% The \word{nested} argument is |1| if the context is that of command
+% substitution (in which case |]| acts as command terminator), and |0|
+% otherwise. Upon return, the index variable generally points to the
+% character that terminates the command.
+%
+% The procedure skips past any whitespace or command separators in front
+% of the actual command.
+% \begin{tcl}
+proc parsetcl::parse_command {script index_var nested} {
+ upvar 1 $index_var index
+% \end{tcl}
+% The first step is to scan past the whitespace in front of the
+% command.
+% \begin{tcl}
+ flush_whitespace $script index 1
+% \end{tcl}
+% Then there are two ``not a command'' cases to take care of: there
+% might be a comment or the command sequence might have ended. In the
+% former case, the extent of the comment is determined and a
+% corresponding |Nc| item is returned. Backslash--newline
+% substitution adds a bit complexity to the problem of finding the end
+% of the comment, since an escaped newline may be part of the comment,
+% although a backslash is only escaping if it isn't itself escaped.
+% \begin{tcl}
+ switch -- "[string index $script $index]$nested" {#0} - {#1} {
+ regexp -start $index -indices -- {\A#([^\n\\]|\\.)*(\\$)?}\
+ $script interval
+ incr index
+ regsub -all -- {\\\n[ \t]*}\
+ [string range $script $index [lindex $interval 1]]\
+ { } text
+ set index [expr {[lindex $interval 1] + 1}]
+ return [list Nc $interval $text]
+ } 0 - 1 - \]1 {
+% \end{tcl}
+% In the latter case, an |Np| item is returned. It happens if
+% |$index| is past the last character in the string, but also if
+% |$index| is at a right bracket and the command is \word{nested}.
+% \begin{tcl}
+ return [list Np "" ""]
+ }
+% \end{tcl}
+% But if we get this far, then there is a command to parse. One only
+% has to parse all the words.
+% \begin{tcl}
+ set res [list Cd [list $index ""] ""]
+ set next [parse_word $script index $nested]
+ while {[lindex $next 0] ne "Np"} {
+ lappend res $next
+ set next [parse_word $script index $nested]
+ }
+ lset res 1 1 [lindex $res end 1 1]
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{basic_parse_script}
+% The |basic_parse_script| procedure parses a script (that is to say, a
+% sequence of commands) and returns the corresponding |Rs| item.
+% The syntax is
+% \begin{quote}
+% |parsetcl::basic_parse_script| \word{script}
+% \end{quote}
+% \begin{tcl}
+proc parsetcl::basic_parse_script {script} {
+ set index 0
+ set res [list Rs [list $index ""] ""]
+ while {[lindex [set next [parse_command $script index 0]] 0] ne "Np"} {
+ lappend res $next
+ }
+ incr index -1
+ lset res 1 1 $index
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Parsing words}
+%
+% \begin{proc}{parse_word}
+% The |parse_word| procedure parses the next command word, returning
+% an |Lb|, |Lq|, |Lr|, |Mq|, |Mr|, or |Np| item to its caller. The
+% syntax is
+% \begin{quote}
+% |parsetcl::parse_word| \word{script} \word{index-var-name}
+% \word{nested}
+% \end{quote}
+% The \word{nested} argument is |1| if the context is that of command
+% substitution (in which case |]| acts as command terminator), and |0|
+% otherwise. It is assumed that the index variable points to the first
+% character of the word when this procedure is called. Upon return,
+% the index variable points to the first none-whitespace character
+% (or command separator) after the word that was parsed.
+%
+% Most of the actual work is done by the helper procedures
+% |parse_raw_word|, |parse_quoted_word|, and |parse_braced_word|.
+% \begin{tcl}
+proc parsetcl::parse_word {script index_var nested} {
+ upvar 1 $index_var index
+ switch -- [string index $script $index] \{ {
+ parse_braced_word $script index $nested
+ } \" {
+ parse_quoted_word $script index $nested
+ } "" - \; - \n {
+ list Np "" ""
+ } \] {
+ if {$nested} then {
+ list Np "" ""
+ } else {
+ parse_raw_word $script index $nested
+ }
+ } default {
+ parse_raw_word $script index $nested
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{parse_braced_word}
+% The |parse_braced_word| procedure parses a brace-delimited word and
+% returns the corresponding |Lb| item to its caller. The syntax is
+% \begin{quote}
+% |parsetcl::parse_braced_word| \word{script} \word{index-var-name}
+% \word{nested}
+% \end{quote}
+% where the arguments and call conventions are as for |parse_word|.
+% In case the braced word is followed by some non-whitespace
+% characters, then this will be interpreted as though a space was
+% missing after the brace. A corresponding |Ne| subtree will be
+% attached to the |Lb| item returned, and the index variable will be
+% pointed to that none-whitespace character after the brace.
+% \begin{tcl}
+proc parsetcl::parse_braced_word {script index_var nested} {
+ upvar 1 $index_var index
+ set res [list Lb [list $index ""]]
+ set depth 1
+ set text ""
+ incr index
+ while {$depth>0} {
+% \end{tcl}
+% Each iteration of this loop takes care of one non-trivial character
+% combination and whatever piece of trivial material that preceeds
+% it. Braces which are not escaped obviously constitute non-trivial
+% material (because they change the nesting depth), but escaped
+% newlines are also non-trivial (because they are subject to
+% substitution).
+% \begin{tcl}
+ regexp -start $index -- {\A([^{}\\]|\\[^\n])*} $script match
+ append text $match
+ incr index [string length $match]
+ switch -- [string index $script $index] \{ {
+ incr depth
+ incr index
+ } \} {
+ incr depth -1
+ incr index
+ } \\ {
+ if {[regexp -start $index -- {\A\\\n[ \t]*} $script match]}\
+ then {
+ incr index [string length $match]
+ append text { }
+ } else {
+% \end{tcl}
+% In this (rather curious) case, the \word{script} ended with an
+% escaping backslash, but there is nothing to escape. This is
+% interpreted as just the backslash. However, there will be an error
+% since the braces apparently haven't been properly balanced.
+% \begin{tcl}
+ append text \\
+ break
+ }
+ } "" {
+ break
+ }
+ }
+ if {$depth>0} then {
+ lset res 1 1 $index
+ lappend res $text [list Ne [list "" $index] {missing close-brace}]
+ lset res 3 1 0 [incr index]
+ return $res
+ }
+ lset res 1 1 [expr {$index - 1}]
+ lappend res $text
+% \end{tcl}
+% What remains now is to check that there aren't any stray characters
+% following the close-brace. If there is whitespace to flush then
+% everything is alright. Things are also alright if the next character
+% is a command terminator or we're at the end of the string.
+% \begin{tcl}
+ if {[flush_whitespace $script index 0]} then {return $res}
+ switch -- [string index $script $index] \n - \; - {} {
+ return $res
+ } \] {
+ if {$nested} then {return $res}
+ }
+% \end{tcl}
+% But if that is not the case then there is an error, and an |Ne| item
+% should be appended to |res|. The exact appearence of this item does
+% however depend on how the parser attempts to recover from the error,
+% and that is not immediately obvious. The \Tcllogo\ parser makes no
+% attempt to recover---and can therefore report the error as ``extra
+% characters after close-brace''---but the best way to recover rather
+% seems to be to assume that a space is missing. That is why the
+% following error message is non-standard.
+% \begin{tcl}
+ lappend res [list Ne [list $index [expr {$index - 1}]]\
+ {missing space after close-brace}]
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{parse_quoted_word}
+% The |parse_quoted_word| procedure parses a quote-delimited word and
+% returns the corresponding |Lq| or |Mq| item to its caller. The
+% syntax is
+% \begin{quote}
+% |parsetcl::parse_quoted_word| \word{script} \word{index-var-name}
+% \word{nested}
+% \end{quote}
+% where the arguments and call conventions are as for |parse_word|.
+% In case the quoted word is followed by some non-whitespace
+% characters, then this will be interpreted as though a space was
+% missing after the last quote. A corresponding |Ne| subtree will
+% be be put last in the |Lq| or |Mq| item returned, and the index
+% variable will be pointed to that none-whitespace character after
+% the quote.
+% \begin{tcl}
+proc parsetcl::parse_quoted_word {script index_var nested} {
+ upvar 1 $index_var index
+ set res [list Lq [list $index ""] ""]
+ set text ""
+ incr index
+ while {1} {
+% \end{tcl}
+% Each iteration of this loop adds one subtree to |res| and the
+% corresponding literate material to |text|. If some substitution
+% happens which does not produce literate material then the |Lq|
+% in |res| is changed to an |Mq|.
+% \begin{tcl}
+ switch -- [string index $script $index] \\ {
+ lappend res [parse_backslash $script index]
+ append text [lindex $res end 2]
+ } \$ {
+ lappend res [parse_dollar $script index]
+ lset res 0 Mq
+ } \[ {
+ lappend res [parse_bracket $script index]
+ lset res 0 Mq
+ } \" {
+ incr index
+ break
+ } "" {
+ lappend res [list Ne [list $index [expr {$index - 1}]]\
+ {missing close-quote}]
+ break
+ } default {
+ regexp -start $index -- {[^\\$\["]*} $script match
+ set t $index
+ incr index [string length $match]
+ lappend res [list Lr [list $t [expr {$index - 1}]] $match]
+ append text $match
+ }
+ }
+ lset res 1 1 [expr {$index - 1}]
+ if {[lindex $res 0] eq "Lq"} then {
+ lset res 2 $text
+% \end{tcl}
+% An |Lq| item that has precisely one subtree that furthermore is of
+% type |Lr| can do without that subtree, since all the interesting
+% information is in the |text|.
+% \begin{tcl}
+ if {[llength $res] == 4 && [lindex $res 3 0] eq "Lr"} then {
+ set res [lrange $res 0 2]
+ }
+ }
+% \end{tcl}
+% What remains now is to check that there aren't any stray characters
+% following the close-quote. If there is whitespace to flush then
+% everything is alright. Things are also alright if the next character
+% is a command terminator or we're at the end of the string.
+% \begin{tcl}
+ if {[flush_whitespace $script index 0]} then {return $res}
+ switch -- [string index $script $index] \n - \; - {} {
+ return $res
+ } \] {
+ if {$nested} then {return $res}
+ }
+% \end{tcl}
+% But if that is not the case then there is an error, and an |Ne| item
+% should be appended to |res|. As with characters after close-quotes,
+% it is assumed that a space is missing.
+% \begin{tcl}
+ lappend res [list Ne [list $index [expr {$index - 1}]]\
+ {missing space after close-quote}]
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{parse_raw_word}
+% The |parse_raw_word| procedure parses a whitespace-delimited word
+% of a command and returns the corresponding |Lr| or |Mr| item to its
+% caller. The syntax is
+% \begin{quote}
+% |parsetcl::parse_raw_word| \word{script} \word{index-var-name}
+% \word{nested}
+% \end{quote}
+% where the arguments and call conventions are as for |parse_word|.
+% \begin{tcl}
+proc parsetcl::parse_raw_word {script index_var nested} {
+ upvar 1 $index_var index
+ set res [list]
+ set type Lr
+ set interval [list $index]
+ set text ""
+ while {1} {
+% \end{tcl}
+% Each iteration of this loop adds one subtree to |res| and the
+% corresponding literate material to |text|. If some substitution
+% happens which does not produce literate material then |type| is set
+% to an |Mr|.
+% \begin{tcl}
+ switch -- [string index $script $index] \\ {
+ if {[string index $script [expr {$index+1}]] eq "\n"} then {
+ break
+ }
+ lappend res [parse_backslash $script index]
+ append text [lindex $res end 2]
+ continue
+ } \$ {
+ lappend res [parse_dollar $script index]
+ set type Mr
+ continue
+ } \[ {
+ lappend res [parse_bracket $script index]
+ set type Mr
+ continue
+ } \t - \n - \v - \f - \r - " " - \; - "" {
+ break
+ }
+ if {$nested} then {
+ if {![
+ regexp -start $index -- {\A[^\\$\[\]\t-\r ;]+} $script match
+ ]} then {break}
+ } else {
+ regexp -start $index -- {\A[^\\$\[\t-\r ;]+} $script match
+ }
+ set t $index
+ incr index [string length $match]
+ lappend res [list Lr [list $t [expr {$index - 1}]] $match]
+ append text $match
+ }
+% \end{tcl}
+% In case there is only a single element in |res| then that will be
+% the result.
+% \begin{tcl}
+ if {[llength $res]==1} then {
+ set res [lindex $res 0]
+ } else {
+ lappend interval [expr {$index - 1}]
+ if {$type ne "Lr"} then {set text ""}
+ set res [linsert $res 0 $type $interval $text]
+ }
+ flush_whitespace $script index 0
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Parsing substitutions}
+%
+% \begin{proc}{parse_backslash}
+% The |parse_backslash| procedure parses a backslash sequence and
+% returns the corresponding |Sb| item. The syntax is
+% \begin{quote}
+% |parsetcl::parse_backslash| \word{script} \word{index-var-name}
+% \end{quote}
+% and it is assumed that the index character in \word{script} is the
+% initial backslash in the sequence. Upon return, the index character
+% is the first character after the backslash sequence.
+% \begin{tcl}
+proc parsetcl::parse_backslash {script index_var} {
+ upvar 1 $index_var index
+ set start $index
+ incr index
+ set ch [string index $script $index]
+ set res [list Lr [list $index $index] $ch]
+ switch -- $ch a {
+ set res [list Sb [list $start $index] \a $res]
+ } b {
+ set res [list Sb [list $start $index] \b $res]
+ } f {
+ set res [list Sb [list $start $index] \f $res]
+ } n {
+ set res [list Sb [list $start $index] \n $res]
+ } r {
+ set res [list Sb [list $start $index] \r $res]
+ } t {
+ set res [list Sb [list $start $index] \t $res]
+ } v {
+ set res [list Sb [list $start $index] \v $res]
+ } x {
+ if {[regexp -start [expr {$index + 1}] -- {\A[0-9A-Fa-f]+}\
+ $script match]} then {
+ scan [string range $match end-1 end] %x code
+ incr index [string length $match]
+ lset res 1 1 $index
+ lset res 2 "x$match"
+ set res [list Sb [list $start $index]\
+ [format %c $code] $res]
+ } else {
+ set res [list Sb [list $start $index] x $res]
+ }
+ } u {
+ if {[regexp -start [expr {$index + 1}] -- {\A[0-9A-Fa-f]{1,4}}\
+ $script match]} then {
+ scan $match %x code
+ incr index [string length $match]
+ lset res 1 1 $index
+ lset res 2 "u$match"
+ set res [list Sb [list $start $index]\
+ [format %c $code] $res]
+ } else {
+ set res [list Sb [list $start $index] u $res]
+ }
+ } \n {
+ regexp -start [expr {$index + 1}] -- {\A[ \t]*} $script match
+ incr index [string length $match]
+ lset res 1 1 $index
+ lset res 2 "\n$match"
+ set res [list Sb [list $start $index] " " $res]
+ } "" {
+ return [list Sb [list $start $start] \\]
+ } default {
+ if {[regexp -start $index -- {\A[0-7]{1,3}} $script match]} then {
+ scan $match %o code
+ incr index [expr {[string length $match]-1}]
+ lset res 1 1 $index
+ lset res 2 $match
+ set res [list Sb [list $start $index] [format %c $code] $res]
+ } else {
+ set res [list Sb [list $start $index] $ch $res]
+ }
+
+ }
+ incr index
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{parse_bracket}
+% The |parse_bracket| procedure parses one pair of command
+% substitution brackets and returns the corresponding |Sc| item.
+% The syntax is
+% \begin{quote}
+% |parsetcl::parse_bracket| \word{script} \word{index-var-name}
+% \end{quote}
+% and it is assumed that the index character in \word{script} is the
+% initial bracket in the sequence. Upon return, the index character
+% is the first character after the close-bracket.
+% \begin{tcl}
+proc parsetcl::parse_bracket {script index_var} {
+ upvar 1 $index_var index
+ set res [list Sc [list $index ""] ""]
+ incr index
+ while {[lindex [set next [parse_command $script index 1]] 0] ne "Np"} {
+ lappend res $next
+ }
+ if {[string index $script $index] eq "\]"} then {
+ lset res 1 1 $index
+ incr index
+ return $res
+ } else {
+ lappend res [list Ne [list $index [expr {$index-1}]]\
+ {missing close-bracket}]
+ lset res 1 1 [expr {$index-1}]
+ return $res
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{variable}{varname_RE}
+% The |varname_RE| is the regular expression used with |$|
+% substitution for grabbing the name of the variable.
+% \begin{tcl}
+set parsetcl::varname_RE {\A(\w|::)+}
+% \end{tcl}
+% The reason for factoring this out into a variable is that
+% \Tcllogo\ isn't using the natural (Unicode) definition of an
+% alphanumeric character here, but relies on a locale-dependent
+% C~library function to perform this test. They generally agree on
+% ASCII characters, but outside that one probably cannot rely on that
+% the test produces sensible results. Hence if a script needs to be
+% parsed where some non-Unicode behaviour of this library function is
+% significant, then you might need to change the above regexp.
+%
+% There is a \Tcllogo\ bug report~\cite{Letter-bug} on the matter,
+% and hopefully there will be no need to ever change this regexp
+% once that has been resolved.
+% \end{variable}
+%
+% \begin{proc}{parse_dollar}
+% The |parse_dollar| procedure parses one |$|-sequence and returns
+% the corresponding |Sv|, |Sa|, or |Lr| item. The syntax is
+% \begin{quote}
+% |parsetcl::parse_dollar| \word{script} \word{index-var-name}
+% \end{quote}
+% and it is assumed that the index character in \word{script} is the
+% initial |$| in the sequence. Upon return, the index character
+% is the first character after the parsed sequence.
+% \begin{tcl}
+proc parsetcl::parse_dollar {script index_var} {
+ upvar 1 $index_var index
+ set res [list "" [list $index ""] ""]
+ incr index
+% \end{tcl}
+% If the first character after the |$| is a left brace, then the
+% variable is scalar and its name is terminated by the next right
+% brace. Note that braces do not nest in this case.
+% \begin{tcl}
+ if {[string index $script $index] eq "\{"} then {
+ lset res 0 Sv
+ set end [string first \} $script $index]
+ if {$end<0} then {
+ set end [expr {[string length $script] - 1}]
+ lappend res [list Lb [list $index $end]\
+ [string range $script [expr {$index + 1}] end]]\
+ [list Ne [list [expr {$end+1}] $end]\
+ {missing close-brace for variable name}]
+ } else {
+ lappend res [list Lb [list $index $end]\
+ [string range $script [expr {$index + 1}] [expr {$end-1}]]]
+ }
+ lset res 1 1 $end
+ set index [expr {$end + 1}]
+ return $res
+ }
+% \end{tcl}
+% Otherwise see if there is something which can be interpreted as an
+% alphanumeric variable name. First treat the case when there isn't;
+% in that case the |$| is just a literate |$| and it is returned as an
+% |Lr| iterm. Then treat the case that the variable is scalar.
+% \begin{tcl}
+ variable varname_RE
+ if {![regexp -start $index -- $varname_RE $script match]} then {
+ if {[string index $script $index] eq "("} then {
+ set match ""
+ } else {
+ return [list Lr [list [lindex $res 1 0] [lindex $res 1 0]] \$]
+ }
+ }
+ set t $index
+ incr index [string length $match]
+ lappend res [list Lr [list $t [expr {$index-1}]] $match]
+ if {[string index $script $index] ne "("} then {
+ lset res 0 Sv
+ lset res 1 1 [lindex $res 3 1 1]
+ return $res
+ }
+% \end{tcl}
+% What remains is to treat the case of an array variable. This is
+% very much like |parse_quoted_word|, but it is the right parenthesis
+% rather than |"| that acts as terminator.
+% \begin{tcl}
+ lset res 0 Sa
+ incr index
+ set subres [list Lr [list $index ""] ""]
+ lappend res ""
+ set text ""
+ while {1} {
+% \end{tcl}
+% Each iteration of this loop adds one subtree to |subres| and the
+% corresponding literate material to |text|. If some substitution
+% happens which does not produce literate material then the |Lr|
+% in |subres| is changed to an |Mr|.
+% \begin{tcl}
+ switch -- [string index $script $index] \\ {
+ lappend subres [parse_backslash $script index]
+ append text [lindex $subres end 2]
+ } \$ {
+ lappend subres [parse_dollar $script index]
+ lset subres 0 Mr
+ } \[ {
+ lappend subres [parse_bracket $script index]
+ lset subres 0 Mr
+ } ) {
+ lset subres 1 1 [expr {$index - 1}]
+ break
+ } "" {
+ lappend res\
+ [list Ne [list $index [incr index -1]] {missing )}]
+ lset subres 1 1 $index
+ break
+ } default {
+ regexp -start $index -- {[^\\$\[)]*} $script match
+ set t $index
+ incr index [string length $match]
+ lappend subres [list Lr [list $t [expr {$index - 1}]] $match]
+ append text $match
+ }
+ }
+ if {[lindex $subres 0] eq "Lr"} then {lset subres 2 $text}
+ if {[llength $subres] == 4} then {set subres [lindex $subres 3]}
+ lset res 1 1 $index
+ incr index
+ lset res 4 $subres
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+% \section{Some utility procdures}
+%
+% \subsection{Viewing parser trees}
+%
+% It is useful to have a surveyable presentation of parser trees. An
+% easy step towards this would be to ensure that nesting depth is
+% mirrored in the indentation.
+%
+% \begin{proc}{format_tree}
+% The |format_tree| procedure takes a parser tree, a base indentation
+% (string of whitespace), and an indentation step (string of whitespace)
+% as argument. It returns a string that is list-wise equivalent to
+% |[list]| of the original tree, but has indentation mirroring the
+% nesting depth.
+% \begin{tcl}
+proc parsetcl::format_tree {tree base step} {
+ set res $base
+ append res \{ [lrange $tree 0 1] { }
+% \end{tcl}
+% The following is a trick to make a list element string
+% representation for the \word{text} that does not contain any sort
+% of newline: making the element unbalanced with respect to braces
+% forces escape-quoting also for newlines.
+% \begin{tcl}
+ if {[regexp {[\n\r]} [lindex $tree 2]]} then {
+ append res [string range [list "[lindex $tree 2]\{"] 0 end-2]
+ } else {
+ append res [lrange $tree 2 2]
+ }
+ if {[llength $tree]<=3} then {
+ append res \}
+ return $res
+ } elseif {[llength $tree] == 4 &&\
+ [string match {S[bv]} [lindex $tree 0]]} then {
+% \end{tcl}
+% This is a slight optimization: |Sb| and |Sv| trees look better on
+% one line than on three.
+% \begin{tcl}
+ append res " " [format_tree [lindex $tree 3] "" ""] \}
+ return $res
+ }
+ append res \n
+ foreach subtree [lrange $tree 3 end] {
+ append res [format_tree $subtree $base$step $step] \n
+ }
+ append res $base \}
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Offsetting intervals}
+%
+% \begin{proc}{offset_intervals}
+% This procedure modifies a \word{tree} by adding \word{offset} to
+% all endpoints of each interval in that tree, and returns the
+% modified tree. The syntax is
+% \begin{quote}
+% |parsetcl::offset_intervals| \word{tree} \word{offset}
+% \end{quote}
+% \begin{tcl}
+proc parsetcl::offset_intervals {tree offset} {
+ set res [lrange $tree 0 2]
+ foreach i {0 1} {
+ lset res 1 $i [expr {[lindex $res 1 $i] + $offset}]
+ }
+ foreach subtree [lrange $tree 3 end] {
+ lappend res [offset_intervals $subtree $offset]
+ }
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{reparse_Lb_as_script}
+% The |reparse_Lb_as_script| procedure replaces an |Lb| node from an
+% existing parser tree with the |Rs| node produced by parsing the text
+% between the braces as a script. The syntax is
+% \begin{quote}
+% |parsetcl::reparse_Lb_as_script| \word{tree-var} \word{node-index}
+% \word{parsed string}
+% \end{quote}
+% where \word{tree-var} is the name in the caller's local context of
+% the variable in which the tree to substitute is stored and
+% \word{node-index} is the index list of the node to replace. The
+% procedure returns |2| if the node was an |Lb| node, |1| if is was
+% an |Lr| or |Lq| node, and |0| if the node was not of any of these
+% types. In the last case, the tree is not modified. In the case that
+% |1| is returned, the node has been substituted, but the intervals
+% may be slightly off since the string to parse was taken from the
+% \word{text} part of the substituted node. The normal case is that |2|
+% is returned, and in this case the intervals unambiguously refer to
+% positions in the \word{parsed string}.
+% \begin{tcl}
+proc parsetcl::reparse_Lb_as_script {tree_var index parsed} {
+ upvar 1 $tree_var tree
+ set node [lindex $tree $index]
+ switch -- [lindex $node 0] Lb - Lr - Lq {
+ set base [expr {[lindex $node 1 0] + 1}]
+ if {[lindex $node 0] eq "Lb"} then {
+ set script [string range $parsed $base\
+ [expr {[lindex $node 1 1] - 1}]]
+ } else {
+ set script [lindex $node 2]
+ }
+ lset tree $index\
+ [offset_intervals [basic_parse_script $script] $base]
+ if {[lindex $node 0] eq "Lb"} then {
+ return 2
+ } else {
+ return 1
+ }
+ } default {
+ return 0
+ }
+}
+% \end{tcl}
+% \end{proc}
+
+
+%
+%
+% \subsection{Traversing parser trees}
+%
+% \begin{proc}{walk_tree}
+% The |walk_tree| procedure has the syntax
+% \begin{quote}
+% |parsetcl::walk_tree| \word{tree-var} \word{index-var}
+% \begin{regblock}[\regplus]\word{type-pattern}
+% \word{body}\end{regblock}
+% \end{quote}
+% It walks through each node in the tree stored in the
+% \word{tree-var} in the order that they appear in the string, i.e.,
+% first the root of a tree, then it walks through each subtree in
+% sequence. When visiting a node, the type of the node is
+% regexp-matched against the \word{type-pattern}s, and the first
+% matching \word{body} is evaluated (entirely using |switch -regexp|)
+% in the local context of the caller. While walking, the procedure is
+% updating the \word{index-var} variable so that it always contains
+% the index list specifying the current node in the tree.
+%
+% It is OK to modify the tree while walking through it, provided that
+% the index list of the current node remains valid throughout. It is
+% particular possible to change the contents of the current node (add
+% or remove children) without messing things up.
+%
+% There is no particular return value from this procedure.
+% \begin{tcl}
+proc parsetcl::walk_tree {tree_var index_var args} {
+ upvar 1 $tree_var tree $index_var idxL
+ set idxL [list]
+ set i 0
+ while {$i>=0} {
+ if {$i==0} then {
+ uplevel 1 [list switch -regexp --\
+ [lindex [lindex $tree $idxL] 0] $args]
+ set i 3
+ } elseif {$i < [llength [lindex $tree $idxL]]} then {
+ lappend idxL $i
+ set i 0
+ } elseif {[llength $idxL]} then {
+ set i [lindex $idxL end]
+ set idxL [lrange $idxL 0 end-1]
+ incr i
+ } else {
+ set i -1
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{simple_parse_script}
+% The |simple_parse_script| procedure is similar to
+% |basic_parse_script|, but it tries to recognise some common control
+% structures (|if|, |for|, etc.) and reparses those arguments that
+% (for standard command definitions) are scripts. The syntax is
+% \begin{quote}
+% |parsetcl::simple_parse_script| \word{script}
+% \end{quote}
+% and it returns the parsed script.
+% \begin{tcl}
+proc parsetcl::simple_parse_script {script} {
+ set tree [parsetcl::basic_parse_script $script]
+ walk_tree tree indices Cd {
+ switch -- [lindex [lindex $tree $indices] 3 2] if {
+ for {set i 3} {$i < [llength [lindex $tree $indices]]}\
+ {incr i} {
+ switch -- [lindex [lindex $tree $indices] $i 2]\
+ if - elseif {
+ incr i; continue
+ } then - else {
+ incr i
+ }
+ parsetcl::reparse_Lb_as_script tree\
+ [linsert $indices end $i] $script
+ }
+ } while {
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 5]\
+ $script
+ } for {
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 4]\
+ $script
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 6]\
+ $script
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 7]\
+ $script
+ } foreach {
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end end]\
+ $script
+ } catch {
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 4]\
+ $script
+ } proc {
+ parsetcl::reparse_Lb_as_script tree [linsert $indices end 6]\
+ $script
+ }
+ }
+ return $tree
+}
+% \end{tcl}
+% \end{proc}
+%
+% \section{Parsing expressions}
+%
+% This hasn't been implemented yet.
+%
+%
+% \section{Advanced script parsing}
+%
+% Most of the meaning of a \Tcllogo\ script depends on its commands
+% rather than being given by the syntax---there is e.g. nothing in the
+% general syntax that makes the last argument of a |foreach| command
+% more likely to contain a script than any of the other arguments---and
+% therefore any higher level parsing of \Tcllogo\ scripts must employ a
+% table of commands
+%
+% This hasn't been implemented yet.
+%
+%
+% \section{Script reconstruction}
+%
+% This hasn't been implemented yet, but the parser trees contain
+% the necessary information. Applications of script reconstruction
+% includes writing a |proc|-like command that inlines code in the body
+% argument before the procedure is created.
+%
+%
+% \begin{thebibliography}{9}
+% \bibitem{Letter-bug}
+% Kevin B. Kenny and Jeffrey Hobbs:
+% \textit{Dollar-substitution and non-Latin-1},
+% \Tcllogo~project bug \#408568 (2001, still open April~2003);
+% \href{https://sourceforge.net/tracker/^^A
+% ?func=detail&aid=408568&group_id=10894&atid=110894}^^A
+% {\textsc{https}:/\slash \texttt{sourceforge.net}\slash
+% \texttt{tracker}\slash
+% \texttt{?func=detail\&}\penalty\exhyphenpenalty
+% \texttt{aid=408568\&}\penalty\exhyphenpenalty
+% \texttt{group\_id=10894\&}\penalty\exhyphenpenalty
+% \texttt{atid=110894}.}
+%
+% \end{thebibliography}
+%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.ins b/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.ins
new file mode 100644
index 00000000000..645dc77f8a8
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/examples/parsetcl.ins
@@ -0,0 +1,54 @@
+% parsetcl.ins --- DOCSTRIP installation script for parsetcl.
+\input docstrip
+
+% Redefine the \MetaPrefix; it should be something which starts a
+% until-end-of-line comment:
+\edef\MetaPrefix{\string#\string#}
+
+
+% Redefine the file preamble and postamble; this is necessary because
+% otherwise the old \metaPrefix is inserted at the beginning of these
+% lines.
+\preamble
+
+In other words:
+ ***************************************
+ * This Source is not the True Source. *
+ ***************************************
+The True Source is parsetcl.dtx in
+ http://ftp.ctan.org/tex-archive/macros/latex/contrib/tclldoc/examples
+
+It is preferred that you apply the distribution and modification
+conditions of the LaTeX Project Public License (LPPL) for this file,
+but you may alternatively choose to apply BSD/Tcl-style license
+conditions (either is OK). The latest version of the LPPL 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.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+
+% Actually make the files:
+\generate{
+ \file{parsetcl.tcl}{\from{parsetcl.dtx}{pkg}}
+}
+
+
+\Msg{}
+\Msg{************************************************}
+\Msg{*}
+\Msg{* To complete installation,}
+\Msg{* place parsetcl.tcl in a Tcl library directory}
+\Msg{* and run pkg_mkIndex to rebuild the package}
+\Msg{* index.}
+\Msg{*}
+\Msg{************************************************}
+\Msg{}
+
+
+\end
+
diff --git a/Master/texmf-dist/source/latex/tcldoc/examples/pdf.dtx b/Master/texmf-dist/source/latex/tcldoc/examples/pdf.dtx
new file mode 100644
index 00000000000..249a28ee6c3
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/examples/pdf.dtx
@@ -0,0 +1,796 @@
+%
+% \iffalse
+%<*driver>
+\documentclass{tclldoc}
+\PageIndex\CodelineNumbered
+\IndexPrologue{%
+ \section*{Index}%
+ All numbers in this index are page numbers.
+ Underlined entries refer to places where the item in
+ question is defined.%
+}
+\setcounter{IndexColumns}{2}
+\begin{document}
+\DocInput{pdf.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \title{A simple PDF writer in \Tcllogo}
+% \author{Lars Hellstr\"om}
+% \maketitle
+%
+% \begin{abstract}
+% This file contains some basic routines that allow a \Tcllogo\
+% script to write PDF files.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{PDF files and objects}
+%
+% A Portable Document Format (PDF) file is, when compared with for example
+% a PostScript file or HTML file, a rather disorganised document. This
+% is because at the basic level, a PDF file is a heap rather than a
+% text; it \emph{can} be ``disorganised'' since its logical structure
+% is based on cross-referencing rather than on sequentiality. The first
+% step is therefore to provide support for writing well-formed heaps.
+%
+% \changes{0.0}{2003/01/02}{Initial version. (LH)}
+%
+% \begin{tcl}
+%<*pkg>
+package require Tcl 8.1
+package provide writepdf 0.1
+namespace eval pdf {}
+% \end{tcl}
+% \setnamespace{pdf}
+%
+%
+% \subsection{Building objects}
+%
+% The independent units in a PDF file are called objects. An
+% \emph{object} is essentially a value (which includes a type). The
+% procedures below construct strings of PDF code that encode objects of
+% various types. The strings returned are generally such that one must
+% insert whitespace between two such strings if the data is to be
+% properly encoded. The strings may contain newlines if some building
+% routine thinks the lines should otherwise be too long.
+%
+% \begin{proc}{boolean_obj}
+% The |boolean_obj| procedure returns a boolean object, corresponding
+% to the string passed as its only argument. Most of it is about
+% parsing this string: \texttt{true}, \texttt{yes}, \texttt{on}, and
+% nonzero numbers are interpreted as boolean true, whereas
+% \texttt{false}, \texttt{no}, \texttt{off}, and the zero number is
+% interpreted as boolean false. The matching is case-insensitive.
+% \begin{tcl}
+proc pdf::boolean_obj {value} {
+ switch -nocase -- $value {
+ true - yes - on {return true}
+ false - no - off {return false}
+ default {
+ if {$value} then {return true} else {return false}
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{int_obj}
+% The |int_obj| procedure returns the PDF object corresponding to
+% the integer supplied as argument.
+% \begin{tcl}
+proc pdf::int_obj {value} {format %d $value}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{real_obj}
+% \begin{variable}{precision}
+% The |real_obj| procedure returns the PDF object corresponding to
+% the real number supplied as argument. The syntax is
+% \begin{quote}
+% |pdf::real_obj| \word{value} \word{precision}\regopt
+% \end{quote}
+% where \word{precision} is the number of decimals that will be
+% included in the object. If omitted, the value of the |precision|
+% variable is used, and that defaults to $3$.
+% \begin{tcl}
+set pdf::precision 3
+proc pdf::real_obj {value {precision -1}} {
+ if {$precision<0} then {
+ unset precision
+ variable precision
+ }
+ format %.[format %d $precision]f $value
+}
+% \end{tcl}
+% \end{variable}\end{proc}
+%
+% \begin{proc}{string_obj}
+% The |string_obj| procedure returns the PDF string object
+% corresponding to the argument. Backslashes and parentheses are
+% escaped. Control characters are converted to escape sequences.
+% Characters with character code above 255 cause an error to be
+% thrown (PDF strings correspond more to \Tcllogo\ byte arrays than to
+% general strings). If the string produced is longer than 100
+% characters, then backslash--newline sequences are inserted in
+% suitable places.
+% \begin{tcl}
+proc pdf::string_obj {str} {
+ if {[regexp "\[^\n\r -\xff\]" $str]} then {
+ set estr [string map [list \\ \\\\ ( \\( ) \\) \r \\r \n \\n] $str]
+ set str "("
+ set len 1
+ foreach ch [split $estr {}] {
+ scan $ch %c code
+ if {$code==92} then {
+ append str \\
+ incr len
+ continue
+ } elseif {$code<32} then {
+ append str "\\[format %03o $code]"
+ incr len 4
+ } elseif {$code<256} then {
+ append str $ch
+ incr len
+ } else {
+ error "Bad character $ch [format (U+%04x) $code]\
+ in PDF string."
+ }
+ if {$len > 100} then {
+ append str \\\n
+ set len 0
+ }
+ }
+ append str ")"
+ } else {
+ set L [list]
+ while {[string length $str]>=100} {
+ lappend L [string map [list \\ \\\\ ( \\( ) \\) \r \\r \n \\n]\
+ [string range $str 0 99]]
+ set str [string range $str 100 end]
+ }
+ if {[string length $str]} then {
+ lappend L\
+ [string map [list \\ \\\\ ( \\( ) \\) \r \\r \n \\n] $str]
+ }
+ set str ([join $L \\\n])
+ }
+ return $str
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{hexstring_obj}
+% The |hexstring_obj| procedure returns the PDF string object,
+% encoded as hexadecimal digits, that corresponds to the argument.
+% If the string is longer than 31 characters then it will be broken
+% on several lines.
+% \begin{tcl}
+proc pdf::hexstring_obj {str} {
+ set hstr "<"
+ set len 1
+ foreach ch [split $str {}] {
+ scan $ch %c code
+ if {$len>=63} then {
+ append hstr \n
+ set len 0
+ }
+ if {$code<256} then {
+ append hstr [format %02x $code]
+ incr len 2
+ } else {
+ error "Bad character $ch [format (U+%04x) $code]\
+ in PDF string."
+ }
+ }
+ append hstr ">"
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{text_obj}
+% The |text_obj| procedure returns the PDF string object, encoded as
+% hexadecimal digits, that corresponds to the argument string. This is
+% meant to be used for \emph{text strings}
+% (see~\cite[Ssec.~4.4.1]{PDFspec}), which are \Tcllogo-style strings
+% rather than byte arrays. Text strings may contain general Unicode
+% characters, although they will then be encoded using UTF-16BE.
+%
+% The implementation constructs the 8-bit and 16-bits encodings of the
+% string in parallel, and only when it is done will it decide which to
+% return.
+% \begin{tcl}
+proc pdf::text_obj {str} {
+ set hstr "<"
+ set ustr "<FEFF"
+ set lenh 1
+ set lenu 5
+ set eight_ok 1
+ foreach {chh chl} [split [encoding convertto unicode $str] {}] {
+ scan $chh %c codeh
+ scan $chl %c codel
+ if {$lenu>=62} then {
+ append ustr \n
+ set lenu 0
+ }
+ append ustr [format %02x%02x $codeh $codel]
+ incr lenu 4
+ if {$codeh>0} then {set eight_ok 0}
+ if {!$eight_ok} then {continue}
+ if {$lenh>=63} then {
+ append hstr \n
+ set lenh 0
+ }
+ append hstr [format %02x $codel]
+ incr lenh 2
+ }
+ append hstr ">"
+ append ustr ">"
+ if {$eight_ok && ![string match {<feff*} $hstr]} then {
+ return $hstr
+ } else {
+ return $ustr
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{name_obj}
+% The |name_obj| procedure returns the PDF name object corresponding
+% to its argument. It is useful mainly for names with strange
+% characters in them (such as spaces), but most names (e.g.\ dictionary
+% keys) appearing in PDF files do not require any quoting and can
+% therefore just as well be written as explicit PDF code.
+% \begin{tcl}
+proc pdf::name_obj {str} {
+ if {[string length $str]>126} then {
+ error "String too long to be a PDF name."
+ }
+ set res /
+ foreach ch [split $str {}] {
+ switch -glob -- $ch {
+ ( - ) - < - > - \\[ - \\] - \{ - \} - / - % - # {
+ scan $ch %c code
+ append res [format #%02x $code]
+ }
+ [!-~] {append res $ch}
+ default {
+ scan $ch %c code
+ append res [format #%02x $code]
+ }
+ }
+ }
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{array_obj}
+% The |array_obj| procedure builds an array object of the objects it
+% is given as arguments. The syntax is
+% \begin{quote}
+% |pdf::array_obj| \word{object}\regstar
+% \end{quote}
+% Newlines are inserted between the objects if it does not appear as
+% if the object would fit on a single (100 character) line.
+% \begin{tcl}
+proc pdf::array_obj {args} {
+ set res \[
+ set len 1
+ foreach item $args {
+ if {[string length $item] + $len >= 100} then {
+ append res \n
+ set len 0
+ } elseif {[string length $res]>1} then {
+ append res " "
+ incr len
+ }
+ append res $item
+ incr len [string length $item]
+ }
+ if {$len >= 100} then {
+ append res \n
+ }
+ append res \]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{dict_obj}
+% The |dict_obj| procedure builds a dictionary object from its
+% arguments. The syntax is
+% \begin{quote}
+% |pdf::dict_obj|
+% \begin{regexp}[\regstar]\word{key} \word{value}\end{regexp}
+% \end{quote}
+% where each \word{key} must be a name object and each \word{value}
+% must be an object. It is checked that the number of elements is
+% correct and that the keys begin with a slash.
+% \begin{tcl}
+proc pdf::dict_obj {args} {
+ if {[llength $args] % 2 != 0} then {
+ error "Not the same number of keys and values."
+ }
+ set res "<<\n"
+ foreach {key value} $args {
+ if {![string match {/*} $key]} then {
+ error "'$key' isn't a name object."
+ }
+ if {[string length $key] + [string length $value]>99} then {
+ append res $key \n $value \n
+ } else {
+ append res $key { } $value \n
+ }
+ }
+ append res ">>"
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{null_obj}
+% The |null_obj| procedure returns a null object. It has no arguments.
+% \begin{tcl}
+proc pdf::null_obj {} {return null}
+% \end{tcl}
+% \end{proc}
+%
+%
+% Objects can also be \emph{streams}, but those have a special relation
+% to the file structure and are therefore best treated in conjunction
+% with that. In particular, streams cannot be used as arguments of
+% |array_obj| or |dict_obj|. The arguments of these procedures can
+% however be \emph{indirect references} to objects of any type, but
+% these too are best treated in the context of the basic PDF file
+% structure.
+%
+%
+% \subsection{File structure}
+%
+% The body of a PDF file consists of a sequence of \emph{indirect
+% objects}, which are mainly a sort of declarations: a pair of integers
+% are associated with an object value. Since any composite object can
+% (and in several cases must) contain a reference to any indirect object,
+% this makes it possible to build up arbitrary data structures. It is
+% however also a complication, since it requires that there is a
+% mechanism for allocating these numbers.
+%
+% \begin{arrayvar}{file\meta{fnum}}
+% Every file that \Tcllogo\ opens gets a unique identifier which is
+% used in calls to |puts| and such. This identifier is also used as
+% the name of an array in the |pdf| namespace, in which the
+% procedures below store all auxiliary information they need to create
+% a proper PDF file.
+% \end{arrayvar}
+%
+% \begin{arrayentry}{file\meta{fnum}}{!\meta{reference label}}
+% \begin{arrayentry}{file\meta{fnum}}{last_object_num}
+% In this API, references to indirect objects can be arbitrary
+% strings, called \emph{reference labels}. The correspondence to the
+% object numbers actually found in the file is given by the
+% \texttt{!}\meta{reference label} entries in the array of the file in
+% question. The entries in this array are lists with the structure
+% \begin{quote}
+% \word{object number} \word{generation number} \word{file
+% position}\regopt
+% \end{quote}
+% where the \word{file position} is present only if the indirect
+% object in question has been written to file already. The
+% \word{object number} is the number of the object referred to. The
+% \word{generation number} is currently always zero; it appears that
+% it can only be nonzero for files that have incrementally updated,
+% and this API only supports creating a file from scratch. The
+% \word{file position} is the position in the file of the beginning
+% of the indirect object begin referred to.
+%
+% The |last_object_num| entry in the array holds the most recently
+% allocated object number. It is incremented whenever a new reference
+% label is encountered.
+% \end{arrayentry}\end{arrayentry}
+%
+% \begin{proc}{obj_ref}
+% The |obj_ref| procedure returns PDF code for an indirect reference
+% to an object. The syntax is
+% \begin{quote}
+% |pdf::obj_ref| \word{file} \word{reference label}
+% \end{quote}
+% where \word{file} is the indentifier of the PDF file in question.
+% If the \word{reference label} has not been encountered before for
+% this particular file, then a new object number is allocated for it.
+% \begin{tcl}
+proc pdf::obj_ref {F label} {
+ upvar #0 [namespace current]::$F A
+ if {![info exists A(!$label)]} then {
+ incr A(last_object_num)
+ set A(!$label) [list $A(last_object_num) 0]
+ }
+ format {%d %d R} [lindex $A(!$label) 0] [lindex $A(!$label) 1]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{begin_stream}
+% \begin{proc}{end_stream}
+% The |begin_stream| and |end_stream| procedures delimit the creation
+% of a \emph{stream object}. Between two such commands, it is possible
+% to write arbitrary text (usually page descriptors or some sort of
+% embedded data) to the PDF file and have it inserted correctly into
+% the file as the data stored in the stream object.
+%
+% The syntax for |begin_stream| is
+% \begin{quote}
+% |pdf::begin_stream| \word{file} \word{reference label}
+% \begin{regexp}[\regstar]\word{key} \word{value}\end{regexp}
+% \end{quote}
+% where \word{file} of course is the file to write to and
+% \word{reference label} is the string that should be used to
+% reference this object. Each stream consists of one dictionary part
+% and one data part, where the primary task of the dictionary part is
+% to specify how the data part should be interpreted. The most
+% important element in the dictionary is the \texttt{/Length} key and
+% its value---these are inserted by the |begin_stream| and
+% |end_stream| commands, so one needs not worry about those---but if
+% for example the data part is encoded in some special way (for
+% example, it might be compressed) then it is necessary to include
+% additional elements in the dictionary. This is what the \word{key}
+% and \word{value} arguments are for.
+%
+% \begin{arrayentry}{file\meta{fnum}}{current_stream}
+% The |current_stream| entry in a PDF file array is set if and only
+% if the current position in that file is inside a stream. It is
+% not possible to begin a new stream when this entry is set. The
+% value of this entry is a list with the structure
+% \begin{quote}
+% \word{reference label} \word{start}
+% \end{quote}
+% where \word{reference label} is the reference label of the stream
+% and \word{start} is the position in the file of the first byte in
+% the stream data. Both of these are needed at |end_stream| to
+% record the length of the stream data.
+% \end{arrayentry}
+%
+% \begin{arrayentry}{file\meta{fnum}}{?\meta{reference label}}
+% This kind of entry is used for indirect objects that are lengths
+% of the stream whose reference label is the \meta{reference label}.
+% They have the same syntax as their |!| ordinary counterparts.
+% \end{arrayentry}
+%
+% \begin{tcl}
+proc pdf::begin_stream {F label args} {
+ upvar #0 [namespace current]::$F A
+ if {[info exists A(current_stream)]} then {
+ error "There is already a stream ([lindex $A(current_stream) 0])\
+ being written to in this file."
+ }
+ if {![info exists A(!$label)]} then {
+ incr A(last_object_num)
+ set A(!$label) [list $A(last_object_num) 0]
+ }
+ set A(?$label) [list [incr A(last_object_num)] 0]
+ lappend A(!$label) [tell $F]
+ puts $F\
+ [format {%d %d obj} [lindex $A(!$label) 0] [lindex $A(!$label) 1]]
+ puts $F [eval\
+ [list dict_obj /Length [format {%d 0 R} $A(last_object_num)]]\
+ $args]
+ puts $F stream
+ set A(current_stream) [list $label [tell $F]]
+}
+% \end{tcl}
+%
+% The |end_stream| procedure takes the target file as its only argument.
+% It finishes off the stream as necessary. It also evaluates
+% everything that has been placed in the backlog of the file.
+%
+% \begin{arrayentry}{file\meta{fnum}}{backlog}
+% It is not possible to output a new indirect object when a stream
+% is being written to, but it can still be at such a time that the
+% need for such an object is discovered. The |backlog| entry
+% provides a way around that limitation---this entry is a script
+% that is evaluated (and cleared) at the end of every |end_stream|,
+% hence commands can be delayed by appending them to this script,
+% instead of evaluating them immediately.
+%
+% New commands are appended to the |backlog|, and must be preceeded
+% by a command separator.
+% \end{arrayentry}
+%
+% \begin{tcl}
+proc pdf::end_stream {F} {
+ upvar #0 [namespace current]::$F A
+ if {![info exists A(current_stream)]} then {
+ error "There is no stream to end."
+ }
+ set length [expr {[tell $F] - [lindex $A(current_stream) 1]}]
+ set label [lindex $A(current_stream) 0]
+ unset A(current_stream)
+ puts $F "endstream endobj"
+ lappend A(?$label) [tell $F]
+ puts $F [format {%d %d obj %d endobj} [lindex $A(?$label) 0]\
+ [lindex $A(?$label) 1] $length]
+ eval "set A(backlog) {}; $A(backlog)"
+}
+% \end{tcl}
+% \end{proc}\end{proc}
+%
+% \begin{proc}{put_obj}
+% The |put_obj| procedure writes a direct object to a PDF file. The
+% syntax is
+% \begin{quote}
+% |pdf::put_obj| \word{file} \word{reference label} \word{object}
+% \end{quote}
+% \begin{tcl}
+proc pdf::put_obj {F label obj} {
+ upvar #0 [namespace current]::$F A
+ if {[info exists A(current_stream)]} then {
+ append A(backlog) \n [list put_obj $F $label $obj]
+ return
+ }
+ if {![info exists A(!$label)]} then {
+ incr A(last_object_num)
+ set A(!$label) [list $A(last_object_num) 0]
+ }
+ lappend A(!$label) [tell $F]
+ puts $F\
+ [format {%d %d obj} [lindex $A(!$label) 0] [lindex $A(!$label) 1]]
+ puts $F $obj
+ puts $F endobj
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{rewrite_pdf}
+% The |rewrite_pdf| procedure opens a new PDF file for writing and
+% initialises the associated data structures. The syntax is
+% \begin{quote}
+% |pdf::rewrite_pdf| \word{file name} \meta{options}
+% \end{quote}
+% and the return value is the identifier of the file opened. The
+% \word{file name} is of course the name of that file. The
+% \meta{options} is zero or more of
+% \begin{quote}
+% |-permissions| \word{integer}\\
+% |-header| \word{string}
+% \end{quote}
+% The permissions are the default permissions for the file in question.
+% If this is not specified, then no such value is specified to |open|,
+% The header is a string that will be put first in the file (as header).
+% It defaults to
+% \begin{quote}
+% \texttt{\%PDF-1.3}\\
+% \texttt{\%\r{a}\"a\"o}
+% \end{quote}
+% where the first line is a standard header line, and the second line
+% is there to help some software understand that the file should be
+% treated as a binary file. \textbf{Note} that no newline is inserted
+% after this string; be sure to include it in the string if necessary.
+% \begin{tcl}
+proc pdf::rewrite_pdf {name args} {
+ set Opt(-header) %PDF-1.3\n%\xe5\xe4\xf6\n
+ array set Opt $args
+ if {[info exists Opt(-permissions)]} then {
+ set F [open $name w $Opt(-permissions)]
+ } else {
+ set F [open $name w]
+ }
+ fconfigure $F -translation binary
+ puts -nonewline $F $Opt(-header)
+ upvar #0 [namespace current]::$F A
+ array unset A
+ set A(last_object_num) 0
+ set A(backlog) ""
+ return $F
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{close_pdf}
+% The |close_pdf| procedure performs the non-trivial task of finishing
+% off the PDF file and closing it. The syntax is
+% \begin{quote}
+% |pdf::close_pdf| \word{file} \word{catalog label}
+% \begin{regexp}[\regstar]\word{key} \word{value}\end{regexp}
+% \end{quote}
+% and the return value is a report detailing any problems
+% encountered (such as objects that are referred to but never
+% defined). This is a report rather than an error, because there is
+% in many cases no sharp distinction. If the return value is
+% non-empty, then there is probably a bug in your program that needs
+% to be fixed.
+%
+% The \word{file} is the identifier of the file to write. The
+% \word{catalog label} is the reference label of the Catalog object
+% in the document. The remaining arguments can be used to insert
+% additional information (such as a reference to the Info dictionary
+% of the document) in the trailer dictionary.
+%
+% \begin{tcl}
+proc pdf::close_pdf {F label args} {
+ upvar #0 [namespace current]::$F A
+ set reportL [list]
+% \end{tcl}
+% The first step is to compile the cross-reference table of the
+% document. I originally made one subsection for each range of defined
+% indirect objects, giving the mandatory free entry \#0 a separate
+% subsection, but for some reason Adobe software didn't like that at
+% all.\footnote{Whether this means Adobe isn't following their own
+% standard I leave to others to decide. Neither GhostScript nor
+% Quartz (the PDF-based graphics system in Mac~OS~X) seemed to have
+% any problems with this arrangement.} Hence the current
+% implementation is to make a cross-reference table with only one
+% subsection, with an explicit free entry for every missing item.
+%
+% \changes{0.1}{2003/02/24}{Changed cross-reference section to avoid
+% what is probably a bug in Adobe PDF readers. (LH)}
+%
+% The |xrA| array constructed below is a prototype for the
+% cross-reference section. It is indexed by object number and the
+% entries have the list structure
+% \begin{quote}
+% \word{file position} \word{generation number} \word{type}
+% \end{quote}
+% Just as in a PDF file, the \word{type} is either \texttt{f} or
+% \texttt{n} depending on whether the entry is ``free'' or
+% ``in use''. The \word{file position} and \word{generation number}
+% are however not padded with zeros, and the \word{file position} is
+% initially an empty string in the ``free'' entries.
+%
+% This first round simply collects the information and detects
+% collisions.
+% \begin{tcl}
+ set xrA(0) [list "" 65535 f]
+ foreach lbl [array names A {[!?]*}] {
+ set idx [lindex $A($lbl) 0]
+ set ent [list [lindex $A($lbl) 2] [lindex $A($lbl) 1] n]
+ if {[llength $A($lbl)]<3} then {
+ lappend reportL "There is no indirect object with label:\
+ [string range $lbl 1 end]"
+ set ent [replace $ent 2 2 f]
+ } elseif {[llength $A($lbl)]>3} then {
+ lappend reportL "Multiple indirect objects for label\
+ [string range $lbl 1 end]; at\
+ [join [lrange $A($lbl) 2 end]]."
+ }
+ if {![info exists xrA($idx)]} then {
+ set xrA($idx) $ent
+ } elseif {[lindex $xrA($idx) 2]=="f" && [lindex $ent 2]=="n"}\
+ then {
+ lappend reportL "This shouldn't happen:\
+ There are several reference labels for\
+ indirect object $idx. Using that with label:\
+ [string range $lbl 1 end]"
+ set xrA($idx) $ent
+ } else {
+ lappend reportL "This shouldn't happen:\
+ There are several reference labels for\
+ indirect object $idx. Ignoring that with label:\
+ [string range $lbl 1 end]"
+ }
+ }
+% \end{tcl}
+% The second round makes sure that there is a contiguous sequence of
+% reference numbers and constructs the linked list of free entries.
+% \begin{tcl}
+ set last_free 0
+ set maxidx [lindex [lsort -integer -decreasing [array names xrA]] 0]
+ for {set n $maxidx} {$n>=0} {incr n -1} {
+ if {![info exists xrA($n)]} then {
+ set xrA($n) [list "" 0 f]
+ lappend reportL "This shouldn't happen:\
+ Object number $n was allocated, but not\
+ assigned a reference label."
+ }
+ if {[lindex $xrA($n) 2]=="f"} then {
+ set xrA($n) [lreplace $xrA($n) 0 0 $last_free]
+ set last_free $n
+ }
+ }
+% \end{tcl}
+% Now the cross-reference section can be written to file.
+% \begin{tcl}
+ set startxref [tell $F]
+ puts $F xref
+ puts $F [format {%d %d} 0 [expr {$maxidx + 1}]]
+ for {set n 0} {$n<=$maxidx} {incr n} {
+ puts $F [eval [list format {%010d %05d %1s }] $xrA($n)]
+ }
+% \end{tcl}
+% Having completed the cross-reference table, the second step is
+% to write the trailer.
+% \begin{tcl}
+ puts $F trailer
+ if {[info exists A(!$label)]} then {
+ lappend args /Root [format {%d %d R} [lindex $A(!$label) 0]\
+ [lindex $A(!$label) 1]]
+ } else {
+ lappend reportL "ERROR: The document does not have a catalog."\
+ "There is no indirect object with label: $label"
+ }
+ lappend args /Size [array size xrA]
+ puts $F [eval [list dict_obj] $args]
+ puts $F "startxref\n${startxref}\n%%EOF"
+% \end{tcl}
+% The final step is to close the file and compile the report.
+% \begin{tcl}
+ close $F
+ join $reportL \n
+}
+%</pkg>
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Hello World}
+%
+% The code below creates a PDF file matching the basic ``Hello World''
+% example \cite[Sec.~A.2]{PDFspec}.
+%
+% \begin{tcl}
+%<*example1>
+set F [pdf::rewrite_pdf hello.pdf]
+pdf::put_obj $F "The catalog" [pdf::dict_obj\
+%
+ /Type /Catalog\
+%
+ /Pages [pdf::obj_ref $F "The pages"]\
+%
+ /Outlines [pdf::obj_ref $F "The outlines"]]
+pdf::put_obj $F "The outlines"\
+ [pdf::dict_obj /Type /Outlines /Count [pdf::int_obj 0]]
+pdf::put_obj $F "The pages" [pdf::dict_obj\
+%
+ /Type /Pages\
+%
+ /Count [pdf::int_obj 1]\
+%
+ /Kids [pdf::array_obj [pdf::obj_ref $F "Page 1"]]]
+pdf::put_obj $F "Page 1" [pdf::dict_obj\
+%
+ /Type /Page\
+%
+ /Parent [pdf::obj_ref $F "The pages"]\
+%
+ /Resources [pdf::dict_obj\
+%
+ /Font [pdf::dict_obj /F1 [pdf::obj_ref $F "Helvetica"]]\
+%
+ /ProcSet [pdf::obj_ref $F "The procs"]]\
+%
+ /MediaBox [pdf::array_obj [pdf::int_obj 0] [pdf::int_obj 0]\
+ [pdf::int_obj 612] [pdf::int_obj 792]]\
+%
+ /Contents [pdf::obj_ref $F "Page 1 contents"]]
+pdf::begin_stream $F "Page 1 contents"
+puts $F {BT}
+puts $F {/F1 24 Tf}
+puts $F {100 100 Td (Hello World) Tj}
+puts $F {ET}
+pdf::end_stream $F
+pdf::put_obj $F "The procs" [pdf::array_obj /PDF /Text]
+pdf::put_obj $F "Helvetica" [pdf::dict_obj\
+ /Type /Font /Subtype /Type1\
+ /Name /F1 /BaseFont /Helvetica /Encoding /MacRomanEncoding]
+pdf::close_pdf $F "The catalog"
+%</example1>
+% \end{tcl}
+%
+%
+% \begin{thebibliography}{9}
+% \bibitem{PDFspec}
+% Adobe Systems Incorporated:
+% \textit{Portable Document Format Reference Manual},
+% version~1.3 (second edition), Addison--Wesley, 1999;
+% ISBN 0-201-61588-6;
+% \textsc{http:}/\slash \texttt{partners.adobe.com}\slash
+% \texttt{asn}\slash \texttt{developer}\slash \texttt{acrosdk}\slash
+% \texttt{docs}\slash \texttt{filefmtspecs}\slash
+% \texttt{PDFReference13.pdf}.
+% \emph{Note:} There is now a version~1.4 of this specification.
+% \end{thebibliography}
+%
+% \PrintIndex
+%
+%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/tcldoc/examples/pdf.ins b/Master/texmf-dist/source/latex/tcldoc/examples/pdf.ins
new file mode 100644
index 00000000000..00bea9f775e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/examples/pdf.ins
@@ -0,0 +1,55 @@
+% pdf.ins --- DOCSTRIP installation script for writepdf.
+\input docstrip
+
+% Redefine the \MetaPrefix; it should be something which starts a
+% until-end-of-line comment:
+\edef\MetaPrefix{\string#\string#}
+
+
+% Redefine the file preamble and postamble; this is necessary because
+% otherwise the old \metaPrefix is inserted at the beginning of these
+% lines.
+\preamble
+
+In other words:
+ ***************************************
+ * This Source is not the True Source. *
+ ***************************************
+The True Source is pdf.dtx in
+ http://ftp.ctan.org/tex-archive/macros/latex/contrib/tclldoc/examples
+
+It is preferred that you apply the distribution and modification
+conditions of the LaTeX Project Public License (LPPL) for this file,
+but you may alternatively choose to apply BSD/Tcl-style license
+conditions (either is OK). The latest version of the LPPL 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.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+
+% Actually make the files:
+\generate{
+ \file{writepdf.tcl}{\from{pdf.dtx}{pkg}}
+ \file{hellopdf.tcl}{\from{pdf.dtx}{example1}}
+}
+
+
+\Msg{}
+\Msg{************************************************}
+\Msg{*}
+\Msg{* To complete installation,}
+\Msg{* place pdfwrite.tcl in a Tcl library directory}
+\Msg{* and run pkg_mkIndex to rebuild the package}
+\Msg{* index.}
+\Msg{*}
+\Msg{************************************************}
+\Msg{}
+
+
+\end
+
diff --git a/Master/texmf-dist/source/latex/tcldoc/pstokens.dtx b/Master/texmf-dist/source/latex/tcldoc/pstokens.dtx
new file mode 100644
index 00000000000..26f2a71e28b
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/pstokens.dtx
@@ -0,0 +1,979 @@
+%
+% \iffalse
+%<*driver>
+\documentclass{tcldoc}
+
+\usepackage{array}
+
+
+% Logos:
+%
+\DeclareFontFamily{U}{logo}{}
+\DeclareFontShape{U}{logo}{m}{n}{
+ <-9> logo8
+ <9-10> logo9
+ <10-> logo10
+}{}
+\DeclareFontShape{U}{logo}{bx}{n}{<-> logobf10}{}
+\DeclareFontShape{U}{logo}{b}{n}{<-> ssub * logo/bx/n}{}
+\DeclareFontShape{U}{logo}{m}{sl}{<-> logosl10}{}
+\DeclareFontShape{U}{logo}{m}{it}{<-> ssub * logo/m/sl}{}
+
+% \DeclareRobustCommand\META{{%
+% \fontencoding{U}\fontfamily{logo}\selectfont META%
+% }}
+\DeclareRobustCommand\MF{%
+ {\fontencoding{U}\fontfamily{logo}\selectfont META}\-%
+ {\fontencoding{U}\fontfamily{logo}\selectfont FONT}%
+}
+\DeclareRobustCommand\MP{%
+ {\fontencoding{U}\fontfamily{logo}\selectfont META}\-%
+ {\fontencoding{U}\fontfamily{logo}\selectfont POST}%
+}
+\DeclareRobustCommand\PS{PostScript}
+\DeclareRobustCommand\TOne{Type~1}
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+
+
+% Useful environments:
+%
+% \begin{environment}{isyntax}
+% |isyntax| is for ``informal'' syntax specifications, such as
+% \begin{quote}
+% A \meta{varchar command} can be one of\\
+% \begin{quote}
+% |\vartop|\marg{glyph}\\
+% |\varmid|\marg{glyph}\\
+% |\varbot|\marg{glyph}\\
+% |\varrep|\marg{glyph}
+% \end{quote}
+% \end{quote}
+% The implementation is based on that of the \texttt{verse}
+% environment.It usually works just as fine with \texttt{quote}, but
+% \texttt{isyntax} handles breaking long lines better (and more
+% elegantly).
+% \changes{1.37}{2000/05/14}{Increased \cs{rightskip} stretchability
+% and added setting of \cs{linepenalty}. (LH)}
+% \begin{macrocode}
+\makeatletter
+\newenvironment{isyntax}{%
+ \let\\\@centercr
+ \list{}{%
+ \itemsep \z@
+ \itemindent -1.5em%
+ \listparindent \itemindent
+ \advance \leftmargin 1.5em%
+ }%
+ \advance \rightskip \z@\@plus0.7\linewidth \relax
+ \linepenalty=100\relax
+ \item\relax
+}{\endlist}
+\makeatother
+% \end{macrocode}
+% \end{environment}
+
+
+% Tabular notes:
+\makeatletter
+\newcommand\tabnotemark[1]{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
+ \hbox{\@textsuperscript{%
+ \normalfont\itshape
+ \count@=#1\relax\@alph\count@
+ }}%
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
+}
+\newenvironment{tabnotes}{%
+ \list{\the\c@mpfootnote}{%
+ \usecounter{mpfootnote}%
+ \def\makelabel##1{\hfil\tabnotemark{##1}}%
+ \normalfont\footnotesize
+ \setlength\leftmargin{0pt}%
+ \setlength\labelsep{0pt}%
+ \setlength\labelwidth{1.8em}%
+ \setlength\itemindent{\labelwidth}%
+ \setlength\listparindent{1em}%
+ \setlength\parsep{0pt plus 1pt}%
+ \setlength\itemsep{\parsep}%
+ \setlength\topsep{\footnotesep}%
+ }%
+}{\endlist}
+\makeatother
+
+
+\CodelineIndex
+
+\title{\texttt{pstokens.dtx}}
+\author{Lars Hellstr\"om}
+\date{Work in progress}
+\begin{document}
+\maketitle
+
+\DocInput{pstokens.dtx}
+
+\end{document}
+%</driver>
+% \fi
+%
+% \begin{abstract}
+% \package{pstokens} is a collection of utility routines for
+% \Tcllogo\ programs that need to view a file as a sequence of
+% \PS\ tokens rather than as a sequence of characters or lines.
+% \end{abstract}
+%
+%
+% \setnamespace{pstokens}
+%
+% First of all, the \texttt{pstokens} namespace must be defined.
+% \begin{tcl}
+namespace eval pstokens {}
+% \end{tcl}
+%
+% \section{Reading and writing tokens}
+%
+% This section contains the routines for reading a text file as a
+% sequence of tokens (tokenizing) and writing a sequence of tokens
+% to a text file (detokenizing).
+%
+%
+% \subsection{Data structures for tokens}
+%
+% A \emph{token} is a \Tcllogo\ list with the format
+% \begin{quote}
+% \word{type} \word{data}\regstar
+% \end{quote}
+% The interpretation of the \word{data} depends on what the \word{type}
+% is, as specified below. Some of the token types only occur internally
+% in the tokenizer and some others have no meaning to a \PS\ interpreter,
+% but this organisation seems to be the most convenient here.
+%
+% A primary goal for the format of tokens is that if a sequence of
+% tokens are read from one file and written to another then the only
+% things that may have changed should be the whitespace between the
+% tokens, not the tokens themselves. Therefore the tokenizer generally
+% avoids interpreting the tokens any more than necessary;
+% interpretation of tokens is instead handled in the next section.
+%
+% The token types that occur in \package{pstokens} are
+% \begin{description}
+% \item[\texttt{number}, \texttt{radixnumber}]
+% \describestring[token type]{number}
+% \describestring[token type]{radixnumber}
+% A number (integer or real), and radix number, respectively. There
+% is one \word{data} item, which contains the string that
+% represented the number in the tokenized text.
+% \item[\texttt{string}, \texttt{hexstring}, \texttt{base-85}]
+% \describestring[token type]{string}
+% \describestring[token type]{hexstring}
+% \describestring[token type]{base-85}
+% A parenthesis-delimited string, hexadecimal string, and ASCII
+% base-85 string, respectively. There is one \word{data} item,
+% which contains the string (minus delimiters) that represented
+% the string in the tokenized text.
+% \item[\texttt{executable}, \texttt{literal}, \texttt{immediate}]
+% \describestring[token type]{executable}
+% \describestring[token type]{literal}
+% \describestring[token type]{immediate}
+% An executable (normal), literal, and immediately evaluated name
+% respectively. There is one \word{data} item, which simply contains
+% the name as a \Tcllogo\ string, not including any initial slashes.
+% \item[\texttt{procedure}]
+% \describestring[token type]{procedure}
+% An executionable array. The data is simply the sequence of tokens
+% in the array.
+% \item[\texttt{comment}]
+% \describestring[token type]{comment}
+% This is not a \PS\ token at all, but a representation of a
+% comment. The reason comments are tokenized is that they often
+% contain interesting information (especially structured comments).
+% The structure of this kind of token is
+% \begin{quote}
+% |comment| \word{head} \word{tail}
+% \end{quote}
+% The \word{head} is the part of the line which is after the |%|
+% that started the comment and before the first whitespace character
+% after it. The \word{tail} is the rest of the line (including the
+% whitespace character, if there is one). Any of \word{head} and
+% \word{tail} may be empty. The structured comment
+% \begin{quote}
+% |%%Pages: 2|
+% \end{quote}
+% would have \word{head} equal to \verb*"%Pages:" and \word{tail}
+% equal to \verb*" 2".
+% \item[\texttt{eof}]
+% \describestring[token type]{eof}
+% This is a pseudotoken which denotes that the end of the file was
+% reached while looking for the next token. There structure is
+% \begin{quote}
+% |eof| \word{token}\regopt
+% \end{quote}
+% If the \word{token} is present then it is a composite token which
+% was being read when the file unexpectedly ended. It is an error
+% if the \word{token} is present.
+% \item[\texttt{special}]
+% \describestring[token type]{special}
+% This token type can be used to extend the token type syntax
+% without having to change the actual routines for reading and
+% writing tokens. The structure of a |special| token is
+% \begin{quote}
+% |special| \word{token} \word{extra data}\regstar
+% \end{quote}
+% If a |special| token gets sent to the token writer then it will be
+% treated as the token \word{token} (which usually has another
+% type), but other routines may treat it differently based on the
+% information in the \word{extra data}.
+% \item[\texttt{error}]
+% \describestring[token type]{error}
+% A token of this type is returned from the tokenizer whenever it
+% encounters anything which is syntactically incorrect. The
+% general structure of this kind of token is
+% \begin{quote}
+% |error| \word{error type} \word{data}\regstar
+% \end{quote}
+% where the \word{error type} more precisely specifies the error.
+% So far, the following error types are used
+% \begin{quote}
+% |error| |extra| \word{string} \word{line no.}\\
+% |error| |missing| \word{string} \word{line no.}\\
+% |error| |missing/extra| \word{m-string} \word{e-string}
+% \word{line no.}
+% \end{quote}
+% |extra| means that there is an occurence of \word{string} which
+% shouldn't have been there, whereas |missing| means that there
+% should have been a \word{string} there, but isn't. |missing/extra|
+% is the combination that there either should have been an
+% \word{m-string} there, but isn't, or there is an \word{e-string}
+% there, but there shouldn't be.
+% \word{line no.} is the line on which the error was encountered.
+% \end{description}
+%
+%
+% \subsection{Reading tokens}
+%
+% \begin{arrayvar}{input_line}[file-id]
+% \begin{arrayvar}{input_line_no}[file-id]
+% Since the |gets| procedure always reads an entire line (which
+% usually contain several tokens) each time it is used, it is
+% necessary to store the most recently read line somewhere. This is
+% the purpose of the |input_line| array, which is indexed by the file
+% id. In general, text is removed from the entires in |input_line| as
+% it is tokenized.
+%
+% The |input_line_no| array stores the number of the line in the
+% corresponding |input_line| entry. The first line in a file has
+% number one.
+% \end{arrayvar}\end{arrayvar}
+%
+% \begin{proc}{open_input}
+% \begin{proc}{close_input}
+% These procedures are wrappers around \Tcllogo's |open| and |close|
+% procedures respectively which additionally initialize and unset the
+% relevant entry of the |input_line| and |input_line_no| arrays. Thus
+% their syntaxes are
+% \begin{quote}
+% |pstokens::open_input| \word{file-name} \word{access}\regopt\
+% \word{permissions}\regopt\\
+% |pstokens::close_input| \word{file-id}
+% \end{quote}
+% and they return the same things as |open| and |close| respectively.
+%
+% A possible development of tokenizer is to implement filtered input,
+% in which case more support data structures would have to be
+% initialized, but then the |open_input| and |close_input| procedures
+% would be redefined to cope with this.
+% \begin{tcl}
+%<*tokenio>
+proc pstokens::open_input {args} {
+ set res [eval open $args]
+ global pstokens::input_line pstokens::input_line_no
+ set pstokens::input_line($res) ""
+ set pstokens::input_line_no($res) 0
+ return $res
+}
+% \medskip
+proc pstokens::close_input {file_id} {
+ global pstokens::input_line pstokens::input_line_no
+ unset pstokens::input_line($file_id)
+ unset pstokens::input_line_no($file_id)
+ close $file_id
+}
+% \end{tcl}
+% \end{proc}\end{proc}
+%
+% The tokenizer has a couple of extra internal token types for things
+% which later become parts of other tokens.
+% \begin{description}
+% \item[\texttt{beginproc}, \texttt{endproc}]
+% \describestring[token type]{beginproc}
+% \describestring[token type]{endproc}
+% These are the |{| and |}| at the beginning and end respectively of
+% a \PS\ procedure. There is no \word{data}.
+% \item[\texttt{beginstring}, \texttt{beginhex}, \texttt{beginbase85}]
+% \describestring[token type]{beginstring}
+% \describestring[token type]{beginhex}
+% \describestring[token type]{beginbase85}
+% These token types are the |(|, |<|, and |<~| at the beginning of
+% a \PS\ literal, hex, and base-85 string respectively. There is no
+% \word{data}.
+% \end{description}
+%
+%
+% \begin{proc}{get_primitive_token}
+% The |get_primitive_token| procedure returns the next primitive
+% token in the input file. It takes the file id of the source to read
+% from as its only argument.
+%
+% A \emph{primitive token} is a smallest syntactic unit in the \PS\
+% file. Smallest syntactic units are characterized by that the
+% insertion of a space anywhere in them changes its meaning. One
+% exception is however the left parenthesis characters; it is
+% convenient to include |(| among the primitive tokens even though
+% inserting a space after it will change the meaning of
+% the corresponding token.
+%
+% The first step in |get_primitive_token| is to read ahead until some
+% non-whitespace (or the end of the file) is encountered.
+% \begin{tcl}
+proc pstokens::get_primitive_token {file} {
+ global pstokens::input_line pstokens::input_line_no
+ set pstokens::input_line($file)\
+ [string trimleft [set pstokens::input_line($file)] \t\n\f\r\ ]
+ while {[string length [set pstokens::input_line($file)]]==0} {
+ if {[gets $file pstokens::input_line($file)]==-1} then {
+ return {eof}
+ }
+ incr pstokens::input_line_no($file)
+ set pstokens::input_line($file)\
+ [string trimleft [set pstokens::input_line($file)] \t\n\f\r\ ]
+ }
+% \end{tcl}
+% The second step is to isolate the part of the text that constitutes
+% the next token. This is done using regular expressions, but as these
+% get rather complicated it seems best to explain how they are
+% constructed. The ASCII characters null (|\x00|), tab (|\x09|), line
+% feed (|\x0a|), form feed (|\x0c|), carriage return (|\x0d|), and
+% space (|\x20|) count as whitespace and delimit tokens, but null is
+% currently ignored because \Tcllogo\ before v\,8 cannot keep them in
+% strings anyway. The ASCII characters |(|, |)|, |<|, |>|, |[|, |]|,
+% |{|, |}|, |/|, and |%| also delimit tokens, and therefore the
+% regular expression for a \PS\ name is
+% \begin{quote}
+% |(/?/?)([^][()<>{}/%|\meta{tab}\meta{LF}\meta{FF}\meta{CR}^^A
+% \verb*" ]+)|//?"
+% \end{quote}
+% (Note that the first right bracket above does not end a character
+% range, but is part of the list of characters which are exculded
+% from it. Also note that |/| and |//| are valid \PS\ tokens.)
+% The number of initial slashes determine whether the name is
+% \texttt{executable}, \texttt{literal}, or \texttt{immediate}.
+%
+% The executable tokens are however somewhat tricky, because the above
+% regular expression will also match all numbers. An \emph{integer} is
+% any token which matches the regular expression \verb"[+-]?[0-9]+",
+% whereas a \emph{real number} is anything else which matches the
+% regular expression
+% \begin{quote}
+% \verb"[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][+-]?[0-9]+)?"
+% \end{quote}
+% and a \emph{radix number} is anything which matches the regular
+% expression\footnote{Actually there is also the restriction that
+% none of the characters after the \texttt{\#} may represent a digit
+% greater than or equal to the decimal number before the \texttt{\#},
+% but I'm ignoring that, for now.}
+% \begin{quote}
+% |[0-9][0-9]?#[0-9A-Za-z]+|
+% \end{quote}
+% \begin{tcl}
+ if {[regexp "^(/?/?)(\[^\]\[()<>\{\}/%\t\n\f\r\ \]+)|^//?"\
+ [set pstokens::input_line($file)] tokenstr slashes name]}\
+ then {
+ if {[regexp\
+ {^[+-]?([0-9]+(\.[0-9]*)?|\.[0-9]+)([eE][+-]?[0-9]+)?$}\
+ $tokenstr]}\
+ then {
+ set token [list number $tokenstr]
+ } elseif {[regexp {^[0-9][0-9]?#[0-9A-Za-z]+$} $tokenstr]} then {
+ set token [list radixnumber $tokenstr]
+ } else {
+ if {"$tokenstr"=="/" || "$tokenstr"=="//"}\
+ then {set slashes $tokenstr}
+ set token [list [lindex {executable literal immediate}\
+ [string length $slashes]] $name]
+ }
+ }\
+% \end{tcl}
+% There are also a couple of primitive tokens which consist of
+% non-whitespace delimiting characters, namely
+% \begin{quote}
+% |{|, |}|, |<|, |<~|, |<<|, |>>|, |[|, |]|, |(|,
+% \end{quote}
+% The right parenthesis and greater than characters does not appear in
+% the list because they may not appear outside a string. Finally
+% there are the comments, which have the regular expression
+% \begin{quote}
+% |^%([^|\meta{tab}\meta{LF}\meta{FF}\meta{CR}\verb*" ]*)(.*)$"
+% \end{quote}
+% Here the first parenthesis is the head of the comment and the second
+% is the tail.
+% \begin{tcl}
+ else {
+ switch -regexp -- [set pstokens::input_line($file)] {
+ ^\{ {set token beginproc ; set tokenstr \{}
+ ^\} {set token endproc ; set tokenstr \}}
+ ^\\\[ {set token {executable [} ; set tokenstr \[}
+ ^\\\] {set token {executable ]} ; set tokenstr \]}
+ ^< {set token beginhex ; set tokenstr <}
+ ^<~ {set token beginbase85 ; set tokenstr <~}
+ ^<< {set token {executable <<} ; set tokenstr <<}
+ ^>> {set token {executable >>} ; set tokenstr >>}
+ ^\\( {set token beginstring ; set tokenstr (}
+ ^% {
+ regexp "^%(\[^\t\n\f\r\ \]*)(.*)\$"\
+ [set pstokens::input_line($file)] tokenstr head tail
+ set token [list comment $head $tail]
+ }
+ default {
+% \end{tcl}
+% But if none of the above matched the next character must be
+% erroneous.
+% \begin{tcl}
+ set tokenstr\
+ [string index [set pstokens::input_line($file)] 0]
+ set token [list error extra $tokenstr\
+ [set pstokens::input_line_no($file)] ]
+ }
+ }
+ }
+ set pstokens::input_line($file)\
+ [string range [set pstokens::input_line($file)]\
+ [string length $tokenstr] end]
+ return $token
+}
+% \end{tcl}
+%
+% \end{proc}
+%
+% \begin{proc}{get_string}
+% The |get_string| procedure reads a \PS\ literal string and converts
+% it to a \texttt{string} token, which it returns. The only argument
+% is the file id of the input file. It is assumed that the next thing
+% on the input file line is the character after the left parenthesis
+% that started the string.
+%
+% The only conversion of the data that |get_string| performs is that
+% escaped newlines are skipped and non-escaped newlines are replaced
+% by |\n| escapes. If the end-of-file is encountered while reading a
+% string then the necessary number of right parentheses are added to
+% the string and the resulting string token is built into an |eof|
+% token, which is returned.
+%
+% The local variable |level| keeps track of the parenthesis nesting
+% level, the local variable |data| is the string read so far, and the
+% local variable is a flag which is |1| if the next character should
+% be escaped and |0| otherwise.
+% \begin{tcl}
+proc pstokens::get_string {file} {
+ upvar #0 pstokens::input_line line
+ global pstokens::input_line_no
+ set level 1
+ set data ""
+ set escaped 0
+ while {$level>0} {
+ while {$level>0 && [string length $line($file)]>0} {
+ set c [string index $line($file) 0]
+ if {$escaped} then {
+ append data $c
+ set escaped 0
+ } else {
+ switch -exact -- $c {
+ ( {incr level ; append data $c}
+ ) {
+ incr level -1
+ if {$level>0} then {append data $c}
+ }
+ \\ {set escaped 1 ; append data $c}
+ default {append data $c}
+ }
+ }
+ set line($file) [string range $line($file) 1 end]
+ }
+ if {$level>0} then {
+ if {!$escaped} then {append data \\n}
+ set escaped 0
+ if {[gets $file line($file)]==-1} then {
+ while {$level>1} {append data ) ; incr level -1}
+ return [list eof [list string $data]]
+ }
+ incr pstokens::input_line_no($file)
+ }
+ }
+ list string $data
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{get_hexstring}
+% The |get_hexstring| procedure reads a \PS\ hexadecimal string and
+% converts it to a \texttt{hexstring} token, which it returns. The
+% only argument is the file id of the input file. It is assumed that
+% the next thing on the input file line is the character after the
+% less than character that started the string.
+%
+% The only conversion of the data that |get_hexstring| performs is that
+% embedded whitespace is removed. If a character which is neither
+% whitespace, a hexadecimal digit, or the closing |>| is encountered
+% then an \texttt{error} token is returned and the text read is put
+% back into the |input_line| buffert (followed by an |>| which is
+% inserted to terminate the string. If the end-of-file is
+% encountered while reading a string then what has been read so far
+% is returned as a hexstring token built into an |eof| token.
+% \begin{tcl}
+proc pstokens::get_hexstring {file} {
+ upvar #0 pstokens::input_line line
+ global pstokens::input_line_no
+ set data ""
+ while 1 {
+ while {[string length $line($file)]==0} {
+ if {[gets $file line($file)]==-1} then {
+ return [list eof [list hexstring $data]]
+ }
+ incr pstokens::input_line_no($file)
+ }
+ set c [string index $line($file) 0]
+ set line($file) [string range $line($file) 1 end]
+ switch -regexp -- $c {
+ {[0-9a-fA-F]} {append data $c}
+ \[\t\n\f\r\ \] {}
+ > {break}
+ default {
+ set line($file) <$data>$c$line($file)
+ return [list error missing/extra > $c\
+ [set pstokens::input_line_no($file)]]
+ }
+ }
+ }
+ list hexstring $data
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{get_base85string}
+% The |get_base85string| procedure reads a \PS\ base-85 string and
+% converts it to a \texttt{base-85} token, which it returns. The
+% only argument is the file id of the input file. It is assumed that
+% the next thing on the input file line is the character after the
+% |<~| characters that started the string.
+%
+% The only conversion of the data that |get_base85string| performs is
+% that embedded whitespace is removed. If a character which is neither
+% whitespace, a base-85 digit, the letter |z|, or the closing |~| is
+% encountered then an \texttt{error} token is returned and the text
+% read is put back into the |input_line| buffert (followed by a |~>|
+% that terminates the string). If the end-of-file is encountered while
+% reading a string then what has been read so far is returned as a
+% base-85 string token built into an |eof| token.
+% \begin{tcl}
+proc pstokens::get_base85string {file} {
+ upvar #0 pstokens::input_line line pstokens::input_line_no line_no
+ set data ""
+ while 1 {
+ while {[string length $line($file)]==0} {
+ if {[gets $file line($file)]==-1} then {
+ return [list eof [list base-85 $data]]
+ }
+ incr line_no($file)
+ }
+ set c [string index $line($file) 0]
+ set line($file) [string range $line($file) 1 end]
+ switch -regexp -- $c {
+ {[!-uz]} {append data $c}
+ \[\t\n\f\r\ \] {}
+ ~ {break}
+ default {
+ set line($file) <~$data~>$c$line($file)
+ return [list error missing/extra ~> $c $line_no($file)]
+ }
+ }
+ }
+% \end{tcl}
+% If the character after the closing |~| is not a |>| then the entire
+% string is put back in the |input_line| buffert and a |missing| error
+% is issued.
+% \begin{tcl}
+ if {[string length $line($file)]>0 &&\
+ "[string index $line($file) 0]"==">"} then {
+ set line($file) [string range $line($file) 1 end]
+ list base-85 $data
+ } else {
+ set line($file) <~$data~>$line($file)
+ list error missing > $line_no($file)
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{get_token}
+% \begin{proc}{get_token_rek}
+% The |get_token| procedure has the syntax
+% \begin{quote}
+% |pstokens::get_token| \word{file-id}
+% \end{quote}
+% and returns the next \PS\ token in the \word{file-id} file.
+%
+% Most of the work is however done by the |get_token_rek| procedure,
+% which is a recursive form of |get_token|. |get_token_rek| handles
+% converting the various |begin|\textellipsis\ token types to their
+% complete forms, and it calls itself recursively to get the tokens
+% that form a procedure. |get_token| only checks that there are no
+% lone |endproc| tokens.
+% \begin{tcl}
+proc pstokens::get_token {file} {
+ set token [pstokens::get_token_rek $file]
+ if {"[lindex $token 0]" == "endproc"} then {
+ global pstokens::input_line_no
+ set token [list error extra \} [set pstokens::input_line_no($file)]]
+ }
+ return $token
+}
+% \medskip
+proc pstokens::get_token_rek {file} {
+ set token [pstokens::get_primitive_token $file]
+ switch -exact [lindex $token 0] {
+ beginproc {
+ set token {procedure}
+ while {"[lindex [set token2 [pstokens::get_token_rek $file]] 0]"\
+ != "endproc" && "[lindex $token2 0]" != "eof"} {
+ lappend token $token2
+ }
+ if {"[lindex $token2 0]" == "eof"} then {
+ if {[llength $token2]>1} then {
+ lappend token [lindex $token2 1]
+ }
+ set token [list eof $token]
+ }
+ }
+ beginstring {set token [pstokens::get_string $file]}
+ beginhex {set token [pstokens::get_hexstring $file]}
+ beginbase85 {set token [pstokens::get_base85string $file]}
+ }
+ return $token
+}
+% \end{tcl}
+%
+% These procedures, and in particular |get_token_rek|, could be made
+% more intelligent when it comes to handling errors that occur inside
+% procedures. Currently they just embed the |error| token in the
+% procedure.
+% \end{proc}\end{proc}
+%
+%
+% \subsection{Writing tokens}
+%
+% Writing tokens is simpler than reading them; the only real
+% complication is that the length of lines must be bounded. In order to
+% achieve this, data is written linewise to the file (much like the way
+% it is read).
+%
+% \begin{arrayvar}{output_line}[file-id]
+% The |output_line| array stores each output line until it is
+% actually written to file. Like with the |input_line| array, each
+% active output file has its own entry in this array.
+% \end{arrayvar}
+%
+% \begin{proc}{flush_line}
+% The |flush_line| procedure has the syntax
+% \begin{quote}
+% |pstokens::flush_line| \word{file-id} \word{physical}\regopt
+% \end{quote}
+% It flushes buffered data that is to be written to the file with id
+% \word{file-id}. The \word{physical} argument controls whether the
+% data actually should be physically written to file (when |1|) or
+% merely flushed from the |output_line| array (when |0|). The default
+% is |0|. Calling |flush_line| starts a new line in the output file
+% unless the |output_line| entry is empty.
+% \begin{tcl}
+proc pstokens::flush_line {fileid {physical 0}} {
+ global pstokens::output_line
+ if {[string length [set pstokens::output_line($fileid)]]>0} then {
+ puts $fileid [set pstokens::output_line($fileid)]
+ set pstokens::output_line($fileid) ""
+ }
+ if {$physical} then {flush $fileid}
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{open_output}
+% \begin{proc}{close_output}
+% These procedures are wrappers around \Tcllogo's |open| and |close|
+% procedures respectively which additionally initialize and unset the
+% relevant entry of the |output_line|. Thus their syntaxes are
+% \begin{quote}
+% |pstokens::open_output| \word{file-name} \word{access}\regopt\
+% \word{permissions}\regopt\\
+% |pstokens::close_output| \word{file-id}
+% \end{quote}
+% and they return the same things as |open| and |close| respectively.
+% Note however that unlike the case with |open|, the \word{access}
+% argument of |open_output| defaults to |w|.
+%
+% A possible development of the routines for writing tokens would be
+% to support output channels other than files. In that case more
+% support data structures would have to be initialized, but then the
+% |open_output| and |close_output| procedures would be redefined to
+% cope with this.
+% \begin{tcl}
+proc pstokens::open_output {name {access w} args} {
+ set res [eval open \$name \$access $args]
+ global pstokens::output_line
+ set pstokens::output_line($res) ""
+ return $res
+}
+% \medskip
+proc pstokens::close_output {file_id} {
+ pstokens::flush_line $file_id 1
+ close $file_id
+ global pstokens::output_line
+ unset pstokens::output_line($file_id)
+}
+% \end{tcl}
+% \end{proc}\end{proc}
+%
+% \begin{variable}{wrap_length}
+% The |wrap_length| variable stores the maximal number of characters
+% that may appear on a single output line. The same value applies for
+% all output files.
+% \begin{tcl}
+set pstokens::wrap_length 72
+% \end{tcl}
+% \end{variable}
+%
+% \begin{proc}{put_word}
+% The |put_word| procedure has the syntax
+% \begin{quote}
+% |pstokens::put_word| \word{file-id} \word{string}
+% \end{quote}
+% It writes \meta{string} to the file with id \word{file-id},
+% preceeded by a whitespace character if the current line is
+% nonempty. The whitespace character is usually a space, but it
+% will be a newline if the length of what has already been written
+% to the current line is too large to also fit the \word{string}
+% within the length specified by the |wrap_length| variable.
+% \begin{tcl}
+proc pstokens::put_word {file str} {
+ global pstokens::output_line pstokens::wrap_length
+ set l [string length [set pstokens::output_line($file)]]
+ if {$l==0} then {
+ set pstokens::output_line($file) $str
+ } elseif {$l + [string length $str] < ${pstokens::wrap_length}}\
+ then {
+ append pstokens::output_line($file) " $str"
+ } else {
+ puts $file [set pstokens::output_line($file)]
+ set pstokens::output_line($file) $str
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{put_breakable}
+% The |put_breakable| procedure has the syntax
+% \begin{quote}
+% |pstokens::put_breakable| \word{file-id}
+% \word{prefix} \word{text} \word{suffix}
+% \end{quote}
+% It writes \meta{prefix}\meta{text}\meta{suffix} to the file with
+% id \word{file-id} and inserts whitspace (newlines) into the
+% \meta{text} in such a way that the |wrap_length| linewidth isn't
+% exceeded. This is primarily useful for hexadecimal and base-85
+% strings.
+% \begin{tcl}
+proc pstokens::put_breakable {file prefix text suffix} {
+ upvar #0 pstokens::output_line line pstokens::wrap_length wrap
+ if {[string length $line($file)] + [string length $prefix] +\
+ [string length $text] + [string length $suffix] < $wrap} then {
+ append line($file) " $prefix$text$suffix"
+ } else {
+ pstokens::flush_line $file
+ set line($file) $prefix
+ while {[string length $line($file)] + [string length $text] +\
+ [string length $suffix] < $wrap} {
+ set t [expr {$wrap -[string length $line($file)]}]
+ append line($file) [string range $text 0 [expr {$t-1}]]
+ set text [string range $text $t end]
+ pstokens::flush_line $file
+ }
+ append line($file) $text$suffix
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{put_string}
+% The |put_string| procedure has the syntax
+% \begin{quote}
+% |pstokens::put_string| \word{file-id} \word{text}
+% \end{quote}
+% It writes |(|\meta{text}|)| to the file with id \word{file-id} and
+% inserts backslash+newline items into the \meta{text} in such a way
+% that the |wrap_length| linewidth isn't exceeded and the
+% tokenization of the string is unaffected.
+%
+% The only places where it is unsafe to insert a backslash+newline is
+% inside an escape squence. A position can only be inside such a
+% sequence if the part of the \meta{text} which is before it gets a
+% match against the regular expression
+% \begin{quote}
+% \verb"(^|[^\])(\\\\)*(\\[0-7]?[0-7]?)$"
+% \end{quote}
+% and in this case the position between the second and third
+% parenthesis is safe.
+% \begin{tcl}
+proc pstokens::put_string {file text} {
+ upvar #0 pstokens::output_line line pstokens::wrap_length wrap
+ if {[string length $line($file)] + [string length $text] + 2 <\
+ $wrap} then {
+ append line($file) " ($text)"
+ } else {
+ pstokens::flush_line $file
+ set line($file) (
+ while {[string length $line($file)] + [string length $text] +\
+ 1 < $wrap} {
+ set t [expr {$wrap -[string length $line($file)]}]
+ set s [string range $text 0 [expr {$t-1}]]
+ if {[regexp {(^|[^\])(\\\\)*(\\[0-7]?[0-7]?)$} $s\
+ foo bar baz escape]}\
+ then {
+ incr t -[string length $escape]
+ set s [string range $text [expr {$t-1}]]
+ }
+ append line($file) $s
+ set text [string range $text $t end]
+ pstokens::flush_line $file
+ }
+ append line($file) $text)
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{put_token}
+% The |put_token| procedure has the syntax
+% \begin{quote}
+% |pstokens::put_token| \word{file-id} \word{token}
+% \end{quote}
+% It writes the \PS\ token \word{token} to the file with id
+% \word{file-id}.
+% \begin{tcl}
+proc pstokens::put_token {file token} {
+ switch [lindex $token 0] {
+ number -
+ radixnumber -
+ executable {pstokens::put_word $file [lindex $token 1]}
+ literal {pstokens::put_word $file /[lindex $token 1]}
+ immediate {pstokens::put_word $file //[lindex $token 1]}
+ string {pstokens::put_string $file [lindex $token 1]}
+ comment {
+ pstokens::flush_line $file 0
+ puts $file %[lindex $token 1][lindex $token 2]
+ }
+ special {pstoken::put_token $file [lindex $token 1]}
+ procedure {
+ pstokens::put_word $file \{
+ foreach subtok [lrange $token 1 end] {
+ pstokens::put_token $file $subtok
+ }
+ pstokens::put_word $file \}
+ }
+ hexstring {pstokens::put_breakable $file < [lindex $token 1] >}
+ base-85 {pstokens::put_breakable $file <~ [lindex $token 1] ~>}
+ eof {
+ if {[llength $token]>1} then {
+ pstokens::put_token $file [lindex $token 1]
+ }
+ pstokens::terminal_print "Token unexpectedly terminated by\
+ end of file."
+ }
+ error {
+ pstokens::terminal_print "Error token intercepted at put:\
+ [switch [lindex $token 1] {
+ extra {expr {"extra [lindex $token 2] at input line\
+ [lindex $token 3]"}}
+ missing {expr {"missing [lindex $token 2] at input\
+ line [lindex $token 3]"}}
+ missing/extra {expr {"missing [lindex $token 2], or\
+ extra [lindex $token 3], at input line\
+ [lindex $token 4]"}}
+ default {expr {"!!!-unimplemented error-!!!"}}
+ }]."
+ }
+ default {
+ pstokens::terminal_print\
+ "Token of unknown type encountered: $token"
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+
+
+% \begin{tcl}
+%</tokenio>
+% \end{tcl}
+%
+% \section{Token stream editing}
+%
+% This section I still have ToDo.
+%
+%
+% \begin{thebibliography}{99}
+%
+% \bibitem{PSman}
+% Adobe Systems Incorporated:
+% \textit{\PS\ language reference manual, 3rd ed.},
+% Addison--Wesley, 1999; ISBN 0-201-37922-8;
+% http:/\slash\texttt{partners.adobe.com}\slash
+% \texttt{asn}\slash\texttt{developer}\slash\texttt{PDFS}\slash
+% \texttt{TN}\slash\texttt{PLRM.pdf}.
+%
+% \bibitem{MPinTUG}
+% John D.\ Hobby: \textit{A \MF-like System with \PS\ output},
+% TUGboat \textbf{10} (4) (1989), 505--512.
+% %^^A 2 or 4 ? Hobby's bibliography says 2, but Bebee's
+% %^^A tugboat.bib says 4.
+% %^^A @article{Hobby89a,
+% %^^A author = {John D. Hobby},
+% %^^A title = {A {METAFONT}-like System with PostScript Output},
+% %^^A journal = {{TUG}boat},
+% %^^A volume = {10},
+% %^^A number = {2},
+% %^^A pages = {505--512},
+% %^^A year = {1989}
+% %^^A }
+% \bibitem{MPman}
+% John D.\ Hobby: \textit{A User's Manual for \MP},
+% AT\&T Bell Laboratories Computing Science Technical Report no.~162
+% (1992);
+% \textit{see} http:/\slash \texttt{cm.bell-labs.com}\slash
+% \texttt{who}\slash\texttt{hobby}\slash\texttt{MetaPost.html}.
+% %^^A @techreport{Hobby92,
+% %^^A title = {A User's manual for {MetaPost}},
+% %^^A author = {John D. Hobby},
+% %^^A institution = {AT\&T Bell Laboratories},
+% %^^A address = {Murray Hill, New Jersey},
+% %^^A type = {Computing Science Technical Report},
+% %^^A number = {no.~162},
+% %^^A year = {1992}
+% %^^A }
+%
+% \end{thebibliography}
+%
+%
+% \Finale
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/tcldoc/tcldoc.dtx b/Master/texmf-dist/source/latex/tcldoc/tcldoc.dtx
new file mode 100644
index 00000000000..ce2114822b4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tcldoc.dtx
@@ -0,0 +1,3402 @@
+% \CheckSum{1549}
+%
+% \title{The \package{tcldoc} package and class}
+% \author{Lars Hellstr\"om^^A
+% \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}
+% \emph{et al.}}
+% \date{2001/01/04}
+% \maketitle
+%
+% \iffalse
+%
+%<class|pkg>\NeedsTeXFormat{LaTeX2e}
+%<class>\ProvidesClass{tcldoc}
+%<pkg>\ProvidesPackage{tcldoc}
+%<class|pkg> [2000/12/20 v2.13 Tcl documentation
+%<class> class]
+%<pkg> package]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{amsmath}
+\IfFileExists{xdoc2.sty}{\usepackage[dolayout]{xdoc2}[2000/11/18]}{}
+
+\makeatletter
+\@ifpackageloaded{xdoc2}{}{%
+ \@ifpackagelater{doc}{2000/05/20}{}{%
+ \let\XD@fragile@meta=\meta
+ \def\meta{%
+ \ifx \protect\@typeset@protect
+ \expandafter\futurelet \expandafter\@let@token
+ \expandafter\XD@fragile@meta
+ \else
+ \noexpand\meta
+ \fi
+ }%
+ }%
+}
+\@ifundefined{option}{%
+ \newenvironment{option}[1]{%
+ \trivlist
+ \if@inlabel\else \macro@cnt=\z@ \fi
+ \item[]\ignorespaces
+ }{\endtrivlist}%
+}{}
+\makeatother
+
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+\DeclareRobustCommand\Tcl{T\kern-0.1em cl}
+\DeclareRobustCommand\word[1]{\mbox{$\{$\itshape#1\/$\}$}}
+
+\providecommand*\describeoption[1]{\marginpar{\texttt{#1} option}}
+\providecommand*\PrintChar[1]{\char#1\relax}
+\providecommand*{\DoNotIndexHarmless}[1]{}
+\providecommand*{\DoNotIndexBy}[1]{}
+\DoNotIndexBy{@}
+\DoNotIndexBy{@@}
+\DoNotIndexBy{TD@}
+\newenvironment{isyntax}{%
+ \list{}{%
+ \setlength\parsep{0pt plus 1pt}%
+ \setlength\listparindent{-1em}%
+ \setlength\itemindent{\listparindent}%
+ \addtolength\leftmargin{1em}%
+ }%
+ \item\relax \rightskip=1.0\rightskip plus 5cm
+}{\endlist}
+
+\setcounter{IndexColumns}{2}
+\hfuzz=10pt
+\expandafter\def \expandafter\GlossaryParms \expandafter{%
+ \GlossaryParms \hbadness=10000
+}
+
+\CodelineIndex
+% \EnableCrossrefs
+% \RecordChanges
+
+\begin{document}
+\DocInput{tcldoc.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \begin{abstract}
+% The \package{tcldoc} package defines a couple of environments and
+% macros for documenting \Tcl\ source code in \texttt{.dtx}-style
+% documented source files, much like what the \package{doc}
+% package~\cite{doc} does for \TeX\ source code. The \package{tcldoc}
+% class is analogous to the \package{ltxdoc} document
+% class~\cite{ltxdoc}---it loads the package to gain the basic
+% functionality and changes some layout parameters to values that
+% are better suited for documented source than those set by the
+% standard \package{article} document class.
+%
+% The \package{tcldoc} package builds on the \package{doc} and
+% \package{xdoc}~\cite{xdoc} packages.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \DoNotIndex{\advance,\begingroup,\bgroup,\big,\Big,\bigg,\Bigg,\box}
+% \DoNotIndex{\catcode,\char,\chardef,\cleaders,\color@begingroup}
+% \DoNotIndex{\color@endgroup,\copy,\csname,\DeclareOption}
+% \DoNotIndex{\DeclareRobustCommand,\DeclareTextCommand}
+% \DoNotIndex{\DeclareTextSymbol,\def,\discretionary,\divide,\do}
+% \DoNotIndex{\edef,\egroup,\else,\@empty,\endcsname,\endgroup}
+% \DoNotIndex{\expandafter,\fi,\@firstoftwo,\font,\fontdimen}
+% \DoNotIndex{\futurelet,\gdef,\global,\@gobble,\hb@xt@,\hbox}
+% \DoNotIndex{\hfill,\if,\ifcase,\ifcat,\ifmmode,\ifnum,\ifvbox}
+% \DoNotIndex{\ifvmode,\ifvoid,\ifx,\ignorespaces,\immediate,\indent}
+% \DoNotIndex{\input,\@@input,\InputIfFileExists,\IfFileExists}
+% \DoNotIndex{\item,\kern,\language,\lastbox,\lastpenalty,\lastskip}
+% \DoNotIndex{\lccode,\leavevmode,\let,\llap,\LoadClass,\lowercase}
+% \DoNotIndex{\m@ne,\m@th,\@makeother,\mathord,\mkern,\multiply}
+% \DoNotIndex{\@ne,\newbox,\newcommand,\newcount,\NewDescribeCommand}
+% \DoNotIndex{\newenvironment,\newif,\NewMacroEnvironment,\nfss@text}
+% \DoNotIndex{\noexpand,\normalfont,\null,\number,\or,\p@,\@@par}
+% \DoNotIndex{\parshape,\PassOptionsToClass,\PassOptionsToPackage}
+% \DoNotIndex{\penalty,\@plus,\predisplaypenalty,\prevdepth,\prevgraf}
+% \DoNotIndex{\ProcessOptions,\protect,\protected@edef}
+% \DoNotIndex{\providecommand,\ProvideTextCommandDefault,\relax}
+% \DoNotIndex{\RequirePackage,\RequirePackageWithOptions,\rightarrow}
+% \DoNotIndex{\sbox,\selectfont,\setbox,\skewchar,\space,\string}
+% \DoNotIndex{\TextSymbolUnavailable,\texttt,\the,\tracingparagraphs}
+% \DoNotIndex{\ttfamily,\tw@,\typeout,\unhbox,\unpenalty,\unskip}
+% \DoNotIndex{\unrestored@protected@xdef,\unskip,\unvbox,\vadjust}
+% \DoNotIndex{\vbox,\vert,\vrule,\vskip,\wd,\write,\xdef,\z@,\z@skip}
+%
+% \section{Introduction}
+% \label{Sec:Introduction}
+%
+% This introduction is meant to be comprehensible even for readers
+% unfamiliar with writing \texttt{.dtx} files and using the \package{doc}
+% package. Readers who are experienced with this will probably want to
+% skip right to the next section.
+%
+% A \texttt{.dtx} file has a dual nature. On one hand it is a container
+% for some lines of code---it could be a program, a macro package, a
+% configuration file for some program, merely a part of any of the
+% aforementioned, or even arbitrary combinations of the above---and on
+% the other hand it is a \LaTeX\ document which documents this code. One
+% important advantage with this arrangement is that one can keep all the
+% pieces of a project that has to do with a specific task at one place;
+% experience has shown that this greatly furthers really keeping all
+% parts of a project up to date with each other.
+%
+% Slightly simplified, one can say that a \texttt{.dtx} file contains
+% three kinds of lines. A \emph{code line} is a line that doesn't begin
+% with a `|%|' character; such lines can be extracted (copied) using the
+% \package{docstrip} program~\cite{docstrip}. A \emph{guard line} is a
+% line that begins with the two characters `|%<|'; guards are used to
+% structure the set of code lines so that \package{docstrip} can extract
+% different code lines to different generated files. A \emph{comment
+% line}, finally, is a line that begins with a `|%|' character that is
+% not immediately followed by a `|<|' character. The comment lines are
+% ignored by \package{docstrip}, but are part of (and usually make up
+% most of) the \LaTeX\ document in the \texttt{.dtx} file.
+%
+%
+% \subsection{Special conventions and basic features in a \texttt{.dtx}
+% \LaTeX\ document}
+%
+% An important difference between normal \LaTeX\ documents and
+% \texttt{.dtx} \LaTeX\ documents is that the percent character `|%|'
+% doesn't start a comment in the latter; in fact it is usually ignored.
+% This allows \LaTeX\ to see and typeset the text in the comment lines
+% of a \texttt{.dtx} file. Hence if one wants to include the sentence
+% ``Your hovercraft is full of eels!'', which in a normal \LaTeX\
+% document could have been written as the line\iffalse
+%<*example>
+% \fi
+%\begin{verbatim}
+%Your hovercraft is full of eels!
+%\end{verbatim}
+% one would instead write the line as
+%\begin{verbatim}
+%% Your hovercraft is full of eels!
+%\end{verbatim}
+% in a \texttt{.dtx} document. The space after the |%| is not
+% necessary, but most \texttt{.dtx} documents you see include
+% it---probably because the ``comment out \TeX\ code'' action of most
+% text editors consists of inserting a percent \emph{and} a space at
+% the beginning of each line.
+%
+% The code lines present the opposite problem, as they usually
+% shouldn't be treated as normal \LaTeX\ code although the normal \LaTeX\
+% reading conventions would make them the entire document. The usual way
+% around this is to surround each group of code lines with two comment
+% lines that begin and end an environment in which the code lines get
+% typeset verbatim. The \package{tcldoc} package provides the \texttt{tcl}
+% environment for this purpose, so the code lines
+%\begin{verbatim}
+%proc factorial {n} {
+% set result 1
+% for {set i 1} {$i<=$n} {incr i} {
+% set result [expr {$result * $i}]
+% }
+% return $result
+%}
+%\end{verbatim}
+% could be included in a \texttt{.dtx} document as the lines
+%\begin{verbatim}
+%% \begin{tcl}
+%proc factorial {n} {
+% set result 1
+% for {set i 1} {$i<=$n} {incr i} {
+% set result [expr {$result * $i}]
+% }
+% return $result
+%}
+%% \end{tcl}
+%\end{verbatim}
+% When typeset, this will look as
+% \begin{macrocode}
+proc factorial {n} {
+ set result 1
+ for {set i 1} {$i<=$n} {incr i} {
+ set result [expr {$result * $i}]
+ }
+ return $result
+}
+% \end{macrocode}
+% The tiny numbers at the beginning of each line enumerate the code lines.
+% Index references to code usually specify such code line numbers, but
+% the enumeration can be switched off.
+%
+% In mathematical papers, the statements of e.g.\ theorems are usually
+% made inside a \texttt{theorem} (or whatever) environment which
+% provides certain text formatting, a heading, and a position in the
+% document that can be referenced from other parts of it. In \texttt{.dtx}
+% documents one usually does something similar for each named piece of
+% code: macros, environments, templates, etc. In particular, the
+% \package{tcldoc} package provides two environments \texttt{proc} (for
+% procedures) and \texttt{variable} (for variables).
+% Figure~\ref{Fig:procex} contains an example of how \texttt{proc}
+% might be used in describing a procedure for computing the greatest
+% common divisor of two integers.
+%
+% \begin{figure}
+%
+% \begin{trivlist}
+% \item[]\leavevmode\llap{\texttt{gcd} (proc)\kern\marginparsep}^^A
+% The |gcd| procedure takes two arguments $a$ and $b$ which must be
+% integers and returns their greatest common divisor $\gcd(a,b)$,
+% which is computed using Euclid's algorithm. As a special case,
+% $\gcd(0,0)$ is considered to be $0$, so formally |gcd $a $b|
+% computes $\lvert a \rvert \wedge \lvert b \rvert$, where $\wedge$
+% denotes the meet operation in the divisor lattice of non-negative
+% integers.
+% \begin{macrocode}
+proc gcd {a b} {
+ set a [expr {abs($a)}]
+ set b [expr {abs($b)}]
+ while {$b>0} {
+ set r [expr {$a%$b}]
+ set a $b
+ set b $r
+ }
+ return $a
+}
+% \end{macrocode}
+% \end{trivlist}
+%
+% \begin{center}
+% (a) A typeset procedure with description
+% \end{center}
+%
+%\begin{verbatim}
+%% \begin{proc}{gcd}
+%% The |gcd| procedure takes two arguments $a$ and $b$ which must be
+%% integers and returns their greatest common divisor $\gcd(a,b)$,
+%% which is computed using Euclid's algorithm. As a special case,
+%% $\gcd(0,0)$ is considered to be $0$, so formally |gcd $a $b|
+%% computes $\lvert a \rvert \wedge \lvert b \rvert$, where $\wedge$
+%% denotes the meet operation in the divisor lattice of non-negative
+%% integers.
+%% \begin{tcl}
+%proc gcd {a b} {
+% set a [expr {abs($a)}]
+% set b [expr {abs($b)}]
+% while {$b>0} {
+% set r [expr {$a%$b}]
+% set a $b
+% set b $r
+% }
+% return $a
+%}
+%% \end{tcl}
+%% \end{proc}
+%\end{verbatim}
+%
+% \begin{center}
+% (b) The code for the example in (a)
+% \end{center}
+%
+% \caption{An example of the \texttt{proc} environment}
+% \label{Fig:procex}
+% \end{figure}
+%
+% What does the \texttt{proc} environment do more precisely? First
+% there's the marginal heading which can be seen in Figure~^^A
+% \ref{Fig:procex}. Such headings make it easier to find the procedure in
+% the typeset form of the document. Then the \texttt{proc} environment
+% makes an index entry which tells you where the procedure is defined,
+% and finally it stores the procedure name in a variable so that
+% subsequent |\changes|\footnote{The \cs{changes} command is defined by
+% the \package{doc} package~\cite{doc}. It is used for adding entries
+% to a global list of changes for code in the \texttt{.dtx} document.}
+% commands know to what the change that they are recording was made.
+%
+% The \texttt{variable} environment does the same things except that it
+% writes ``(var.)'' rather than ``(proc)''. This environment wasn't used
+% for describing the three local variables |a|, |b|, and |r| in the
+% example; this is since there is no point in referring to these
+% variables from elsewhere in the program. Instead the \texttt{variable}
+% environment is primarily meant for global variables (although it could
+% also be useful for local variables that are meant to be accessed using
+% |upvar| or |uplevel|), and as such it can often be of great help, since
+% the description of a global variable can otherwise be hard to find,
+% especially with languages like \Tcl\ where variables don't have to be
+% declared and thus have no natural ``home'' in the code.
+%
+% Another noteworthy feature in the example is the use of vertical
+% bar `\verb+|+' characters to delimit short pieces of verbatim \Tcl\
+% code in the comment lines. It is often necessary for the explanation
+% to include short examples of code in the documentation, and the
+% standard \LaTeX\ |\verb| command is exactly what one would need for
+% this. As such code sections are rather frequent however, it has become
+% the custom to use a single character for both starting and ending such
+% a piece of code. The \package{tcldoc} document class defines \verb+|+
+% as a shorthand for \verb+\tclverb|+, where |\tclverb| is a variant of
+% |\verb| which has been designed specifically for \Tcl\ code.
+%
+% The above description was meant to give a basic understanding of how
+% \Tcl\ code and documentation thereof can be mixed in a \texttt{.dtx}
+% file, it neither explains all the environments and commands that
+% the \package{tcldoc} package provides, nor mentions all the
+% features of the environments that were described. That information can
+% instead be found in Section~\ref{Sec:Manual} of this paper. It should
+% also be mentioned that the \package{doc} package~\cite{doc} defines
+% several commands and environments that may be of use for describing
+% code, and it is well worth getting acquainted with the features of
+% that package as well (although parts of its documentation has become
+% rather archaic).
+%
+%
+% \subsection{Guards and \package{docstrip} installation scripts}
+%
+% The central command in a \package{docstrip} installation script is
+% |\generate|, since this is the command which actually causes code to
+% be extracted. |\generate|'s syntax is
+% \begin{quote}
+% |\generate|\marg{files}
+% \end{quote}
+% where \meta{files} consists of one or several |\file| commands, each
+% of which has the syntax
+% \begin{quote}
+% |\file|\marg{output}\marg{sources}
+% \end{quote}
+% where \meta{output} is a filename and \meta{sources} consists of one
+% or several |\from| commands, each of which has the syntax
+% \begin{quote}
+% |\from|\marg{input}\marg{options}
+% \end{quote}
+% where, finally, \meta{input} is a filename and \meta{options} is a
+% comma-separated list of alphanumerical strings. Thus a |\generate|
+% command might look like
+%\begin{verbatim}
+% \generate{\file{p1.sty}{\from{s1.dtx}{foo,bar}}
+% \file{p2.sty}{\from{s2.dtx}{baz}
+% \from{s3.dtx}{baz}}
+% \file{p3.sty}{\from{s1.dtx}{zip}
+% \from{s2.dtx}{zap}}
+% }
+%\end{verbatim}
+% The meaning of this command is
+% \begin{quote}
+% Generate the three files \texttt{p1.sty}, \texttt{p2.sty}, and
+% \texttt{p3.sty}. Extract the code for \texttt{p1.sty} from
+% \texttt{s1.dtx} with options \texttt{foo} and \texttt{bar}, extract
+% the code for \texttt{p2.sty} from \texttt{s2.dtx} with option
+% \texttt{baz} and \texttt{s3.dtx} (the code from \texttt{s2.dtx}
+% will be put before the code from \texttt{s3.dtx}) with option
+% \texttt{baz}, and finally extract the code for \texttt{p3.sty} from
+% \texttt{s1.dtx} with option \texttt{zip} and \texttt{s2.dtx} with
+% option \texttt{zap}.
+% \end{quote}
+% The \emph{options} are used to control which parts of the source files
+% should be extracted to which generated file. A source file can
+% contain a number of \emph{modules}, and at the beginning of each
+% module \package{docstrip} decides, for each output file separately,
+% whether the code lines in that module should be extracted to the
+% output file. The beginning of a module is marked by a guard line which
+% has the syntax
+% \begin{quote}
+% |%<*|\meta{expression}|>|
+% \end{quote}
+% and the end by a corresponding
+% \begin{quote}
+% |%</|\meta{expression}|>|
+% \end{quote}
+% guard line. In their simplest form, the \meta{expression}s are names
+% of options, and in that case the code lines in the module are only
+% extracted if that option appears in the \meta{options} for that
+% combination of input file and output file. The \meta{expression}s can
+% however be arbitrarily complicated boolean expressions;
+% see~\cite{docstrip} for more information.
+% Modules may nest inside each other, and in that case the code lines in
+% an inner module can only be included if all surrounding modules are
+% being included. It is checked that matching |*| and |/| guard lines
+% contain the same (as strings) \meta{expression}, and case is
+% significant in the names of options.
+%
+% One application of modules which has already been mentioned is to
+% bundle code for several different generated files in the same
+% \texttt{.dtx} file---one example of this is the file
+% \texttt{doc.dtx} (part of the \LaTeX\ base distribution) which
+% contains both the \package{doc} package (\texttt{doc.sty}) and two
+% \package{makeindex} style files (\texttt{gglo.ist} and
+% \texttt{gind.ist}). Another application is to keep variant sections
+% of code---such as special code for debugging or gathering
+% statistics---in the \texttt{.dtx} source file for a program without
+% thereby making it a part of the normal form of that program. It is
+% quite possible to use \package{docstrip} as a simple pre-processor
+% for languages whose compiler\slash interpreter haven't got one built
+% in.
+%
+% There are many other commands available in a \package{docstrip}
+% installation script beside those listed above, but those are well
+% described in the \package{docstrip} manual~\cite{docstrip} and need
+% little attention here. Instead I'm going to finish this subsection
+% with a quick guide to the particular difficulties one faces when using
+% \package{docstrip} to extract \Tcl\ code, and how to overcome them.
+%
+% The main problem is that \package{docstrip} insert a few comment lines
+% at the beginning and end of each file it generates. This is a good
+% thing, because a file consisting entirely of extracted code lines
+% would normally be completely void of commentary and quite
+% unintelligible for the casual user. These few comment lines explain
+% that the file was generated by \package{docstrip} from other files
+% (which contain the documentation of the code), lists those files,
+% and normally also contains a copyright (or more commonly some kind of
+% copyleft) notice. The problem lies in that comments look different in
+% different languages, and as the default is to write \TeX\ style
+% comments, one must tell \package{docstrip} to write \Tcl\ style
+% comments. This can be done through the command
+%\begin{verbatim}
+%\edef\MetaPrefix{\string#}
+%\end{verbatim}
+% which tells \package{docstrip} to begin each inserted comment line
+% with the character `|#|'.
+%
+% The comment lines inserted at the beginning of a generated file is
+% called the \emph{preamble} and those of the end the \emph{postamble}.
+% To set the preamble, one writes
+% \begin{trivlist}
+% \item |\preamble|\\
+% \meta{preamble lines}\\
+% |\endpreamble|
+% \end{trivlist}
+% and correspondingly to set the postamble
+% \begin{trivlist}
+% \item |\postamble|\\
+% \meta{postamble lines}\\
+% |\endpostamble|
+% \end{trivlist}
+% The \meta{preamble lines} and \meta{postamble lines} can be any number
+% of lines (including zero). Unlike the text in source files, the text in
+% these preamble and postamble lines is not read verbatim, so things in
+% these lines which have special meaning to \TeX\ (such as control
+% sequences) will be treated as such; the only exception is that spaces
+% and newlines are preserved (instead of concatenated to single spaces
+% as they normally would). It is important that the preamble and
+% postamble \emph{are} set after |\MetaPrefix| is changed, because each
+% line specified between |\preamble| and |\endpreamble| or |\postamble|
+% and |\endpostamble| respectively will be prefixed by the current value
+% of |\MetaPrefix|.
+%
+% Finally, some programs assign special meaning to the first line of a
+% file, so one might want to control what gets put there. Merely using
+% |\preamble| doesn't achieve this, because the \meta{preamble lines}
+% specified that way are put after the lines saying ``this is a
+% generated file \textellipsis''. You can however add things to the
+% preamble by explicitly setting the macro |\defaultpreamble|, which is
+% where \package{docstrip} stores the preamble. To make the first line
+% a comment which simply contains the text `|-*-Tcl-*-|', you could give
+% the command
+%\begin{verbatim}
+%\edef\defaultpreamble{\MetaPrefix\space -*-Tcl-*-^^J\defaultpreamble}
+%\end{verbatim}
+% but an explanation of this is a bit beyond this introduction.
+%
+% In summary, a \package{docstrip} installation script for extracting a
+% file \texttt{foo.tcl} from \texttt{foo.dtx}, using \Tcl\ style
+% comments, inserting a GPL copyleft notice in the preamble, and
+% beginning with the line |# -*-Tcl-*-| could look as follows:
+%\begin{verbatim}
+%\input docstrip.tex
+%
+%\edef\MetaPrefix{\string#}
+%
+%\preamble
+%
+%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.
+%See the file "license.terms" for information on usage and
+%redistribution of this file, and for a DISCLAIMER OF ALL
+%WARRANTIES.
+%
+%\endpreamble
+%
+%\postamble
+%\endpostamble
+%
+%\edef\defaultpreamble{\MetaPrefix\space -*-Tcl-*-^^J\defaultpreamble}
+%
+%\generate{\file{foo.tcl}{\from{foo.dtx}{bar}}}
+%
+%\end
+%\end{verbatim}
+%
+% The generated file \texttt{foo.tcl} will contain
+%\begin{verbatim}
+%# -*-Tcl-*-
+%#
+%# This is file `foo.tcl',
+%# generated with the docstrip utility.
+%#
+%# The original source files were:
+%#
+%# foo.dtx (with options: `bar')
+%#
+%# 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.
+%# See the file "license.terms" for information on usage and
+%# redistribution of this file, and for a DISCLAIMER OF ALL
+%# WARRANTIES.
+%#
+%\end{verbatim}
+% \meta{lines extracted from \texttt{foo.dtx}}
+%\begin{verbatim}
+%#
+%#
+%# End of file `foo.tcl'.
+%\end{verbatim}
+%
+%
+%
+% \subsection{The structure of the \LaTeX\ document}
+%
+% All this has been about the local appearance of a \texttt{.dtx} file,
+% but what about the overall structure? There are several points to
+% raise about that as well.
+%
+% The first is that \LaTeX\ to begin with treat \texttt{.dtx} documents
+% just like any other document---a `|%|' starts a comment and only lines
+% \emph{not} beginning with a `|%|' contain anything that \LaTeX\ can
+% see. Somehow \LaTeX\ must be instructed to start applying the special
+% reading rules that were described above. This is the job of the
+% so-called \emph{driver}, which (for a file \texttt{myfile.dtx}) in its
+% simplest form can look like
+%\begin{verbatim}
+%\documentclass{tcldoc}
+%\begin{document}
+%\DocInput{myfile.dtx}
+%\end{document}
+%\end{verbatim}
+% The important command here is |\DocInput|, because that is what tells
+% \LaTeX\ to apply the special \texttt{.dtx} reading rules. More
+% precisely it means ``Start ignoring `|%|' characters in the text you
+% read, input the file \texttt{myfile.dtx}, and when you're done return
+% to treating `|%|' characters as before.''
+%
+% The driver is usually put in the very first stretch of code lines in
+% the \texttt{.dtx} file. This means that \LaTeX, when ordered to typeset
+% the \texttt{.dtx} file, will start to read along, possibly ignoring
+% hundreds of lines beginning with `|%|' because they are comments. Then
+% it encounters the driver, and after the |\documentclass| and
+% |\begin{document}| commands it executes the |\DocInput|. This will
+% cause it to not ignore lines beginning with `|%|', so when it starts
+% reading the file again it will see all the lines it skipped the first
+% time through. The file will be read to end, after which \LaTeX\
+% returns to the command after the |\DocInput|. As that command happens
+% to be |\end{document}|, it finishes the typeset document and stops.
+% This stop prevents it from seeing and interpreting as \LaTeX\ commands
+% the remaining code lines in the file.
+%
+% The second time through the driver shouldn't be interpreted as
+% \LaTeX\ commands, since for example the |\documentclass| command may
+% only be used once in a \LaTeX\ document. One way of achieving this is
+% to put an |\iffalse| command right before the driver and a |\fi|
+% command right after it. This says to \LaTeX\ that the driver code is
+% conditional material, and since the condition evaluates to false
+% (|\iffalse| always evaluates to false), this conditional material
+% should be skipped. Thus the first few lines of \texttt{myfile.dtx}
+% typically might be
+%\begin{verbatim}
+%% \iffalse
+%%<*driver>
+%\documentclass{tcldoc}
+%\begin{document}
+%\DocInput{myfile.dtx}
+%\end{document}
+%%</driver>
+%% \fi
+%\end{verbatim}
+% The \texttt{driver} guard lines are there to stop \package{docstrip}
+% from including the driver code in the generated files.
+%
+% After the driver comes the actual \LaTeX\ document. The document
+% usually consists of two parts, where the first part is a manual for
+% the \emph{usage} of the code defined in the file, and the second part
+% contains the actual \emph{implementation} (documented code). The idea
+% is that most people are (at least the first time) quite content with
+% learning how to use something, so one should make it simple for them
+% to find that information.\footnote{One needn't take this as an absolute
+% rule---I for one haven't written all my packages that way---but
+% structuring the document like this generally makes it more accessible.}
+% To further this approach one puts the command |\StopEventually| at the
+% start of the implementation part and the command |\Finale| at the end
+% of it. Normally |\StopEventually| doesn't make itself felt, but if one
+% previously has given the command |\OnlyDescription| then rest of the
+% file will not be read; this can be used to produce a ``manual only''
+% version of the documentation. |\StopEventually| takes one argument and
+% the code in this argument is executed at the |\Finale| (if the
+% implementation part is being included) or immediately (if the
+% implementation part isn't being included). Thus this argument is the
+% place to put things that should appear at the very end of the
+% document.
+%
+% The \texttt{tcl}, \texttt{proc}, and \texttt{variable} environments
+% described above all typically appear in the implementation part of the
+% document.
+%
+%
+% \section{Usage of commands and environments}
+% \label{Sec:Manual}
+%
+%
+% \subsection{The actual source code}
+%
+% The \DescribeEnv{tcl}\texttt{tcl} environment is used for wrapping up
+% a group of code lines which contain \Tcl\ code. Lines inside this
+% environment which begin with a percent character are called
+% \emph{command} lines and can contain \LaTeX\ commands which get
+% executed, whereas lines that do not begin with a percent character are
+% called \emph{normal} lines and get typeset verbatim (or nearly
+% verbatim). Lines that begin with |%<| (\package{docstrip} guard lines)
+% do however constitute a special case, as the guard expression will get
+% typeset as in \package{doc}'s \texttt{macrocode} environment and the
+% remainder of the line will get processed in command mode if it is a
+% |*| or |/| guard, but in normal mode if the guard line was of any other
+% type.
+%
+% The \texttt{tcl} environment uses the same general formatting
+% parameters as \package{doc}'s \texttt{macrocode} environment. In
+% particular this means that the text on a normal line is typeset in
+% |\MacroFont| (by default the same thing as \cs{normalfont}\penalty0
+% \cs{ttfamily}\penalty0\cs{small}) or |\AltMacroFont| (by default the same
+% thing as \cs{normalfont}\penalty0\cs{ttfamily}\penalty0\cs{itshape}^^A
+% \penalty0\cs{small}) depending on the current \package{docstrip} module
+% nesting level. The \package{tcldoc} class sets the
+% \texttt{StandardModuleDepth} counter to 1, which means that the
+% |\AltMacroFont| is used when the modules two levels deep or more.
+%
+% If a normal line is too long to fit on one line then the \texttt{tcl}
+% environment will try to break it. Legal breakpoints are spaces which
+% could be replaced by a backslash and a newline without changing the
+% meaning of the command; thus most spaces are legal breakpoints. When a
+% line is broken at a space like this, the space is replaced by a
+% backslash so that the line is still ``syntactically correct''. The
+% opposite happens to lines which actually end with an escaped newline;
+% such lines are concatenated with the following line and are treated as
+% one long line. This is so that a sequence of breakpoints can be chosen
+% which is optimal for the actual line width of the document (as opposed
+% to the line width used in the text file, which can be something quite
+% different). For example
+%\begin{verbatim}
+%% \begin{tcl}
+%lsearch -exact\
+% [concat $a [lrange $b $first end] c d e f]\
+% [lindex $g $h]
+%% \end{tcl}
+%\end{verbatim}\iffalse
+%</example>
+% \fi
+% could be typeset as any of the code examples in
+% Figure~\ref{Fig:Radbrytning}, depending on how wide a line is.
+% \begin{figure}
+% \begin{center}
+% \small
+% \(\left\lvert
+% \begin{minipage}{350pt}
+% \begin{flushleft}
+% |lsearch -exact [concat $a [lrange $b $first end] c d e f]|^^A
+% | [lindex $g $h]|
+% \end{flushleft}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{298pt}
+% \begin{flushright}
+% \noindent |lsearch -exact [concat $a [lrange $b $first|^^A
+% | end] c d e f]|\textbackslash\hfill\vadjust{}\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{241pt}
+% \begin{flushright}
+% \noindent |lsearch -exact|\textbackslash\hfill\vadjust{}\\
+% |[concat $a [lrange $b $first end] c d e f]|\textbackslash\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{184pt}
+% \begin{flushright}
+% \noindent |lsearch -exact [concat $a|\textbackslash\hfill
+% \vadjust{}\\
+% |[lrange $b $first end] c d e f]|\textbackslash\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+% \end{center}
+%
+% \caption{The same \Tcl\ code, set in different linewidths}
+% \label{Fig:Radbrytning}
+% \end{figure}
+% The environment tries to put the linebreaks at the lowest possible
+% nesting (of braces and brackets) level; I believe this gives the best
+% readability.\footnote{When I first started programming in \Tcl\ I
+% used a completely different method for breaking long lines in the
+% code---I mainly implemented the current method because it was
+% simple to program---but I was quite surprised by how readable it made
+% the code.} There is however a way to override this automatic choice
+% of breakpoints: if a normal line which ends with an escaped newline is
+% followed by a command line (even a command line that doesn't contain
+% any commands) then it will not be concatenated with the next normal
+% line.
+%
+% There are a couple of restrictions on the code in command lines. First
+% of all it is not allowed to start a new paragraph (there will be an
+% error message). Secondly a command may not be broken across several
+% lines---all the arguments must appear on the same line as the
+% control sequence. Thirdly some characters have other catcodes than
+% in normal \LaTeX, so it is not certain that all commands work. Some
+% commands that do work and may be useful are:
+% \begin{itemize}
+% \item Vertical space commands (|\smallskip|, |\medskip|, etc.)
+% The command line `|% \medskip|' is more to type than a blank
+% normal line, but it looks slightly better.
+% \item Indexing commands (|\index|, |\IndexEntry|,\footnote{This
+% command is defined by the \package{xdoc} package~\cite{xdoc}.}
+% etc.)
+% \item The \cs{TclInput} and |\settabsize| commands (see below).
+% \end{itemize}
+% And of course the |\end{tcl}| command works in a command line, since
+% that is how one ends a \texttt{tcl} environment.
+%
+% Besides the \texttt{tcl} environment there is also a
+% \DescribeEnv{tcl*}\texttt{tcl*} environment which is different from
+% \texttt{tcl} only in that spaces and tabs are typeset as special
+% visible space `\textvisiblespace' and visible tab
+% `\makebox[6\fontdimen2\font]{\( - \mkern-7mu
+% \cleaders\hbox{$\mkern-2mu - \mkern-2mu$}\hfill \mkern-7mu
+% \mathord\rightarrow \mkern-1mu \vrule \mkern1mu\)}' characters. This
+% can be useful for pieces of code where the exact number of spaces in
+% a sequence is significant, such as code for writing tables that align.
+%
+% For shorter pieces of \Tcl\ code, e.g.\ examples, there's the
+% \DescribeMacro{\tclverb}|\tclverb| command. |\tclverb| is very similar
+% to the standard \LaTeX\ command |\verb|, but there are two differences.
+% The first is that text typeset by |\tclverb| can contain breakpoints
+% at whitespace; these behave just as in the \texttt{tcl} environment.
+% The second is that the verbatim text that follows |\tclverb| may contain
+% newlines, provided that these newlines are escaped by a backslash. Like
+% a \Tcl\ interpreter, |\tclverb| ignores whitespace following an escaped
+% newline. Unlike a \Tcl\ interpreter, |\tclverb| also ignores one percent
+% character before the ignored whitespace, if it is the first character
+% on the following line. Thus
+%\begin{verbatim}
+%% \tclverb|append a $b| is much more efficient than \tclverb|set a\
+%% $a$b| if \tclverb|$a| is long.
+%\end{verbatim}
+% is perfectly legal, and the escaped newline between |a| and |$a$b| is
+% treated just like the space between |set| and |a|. Like |\verb|, the
+% |\tclverb| command has a starred form \DescribeMacro{\tclverb*}^^A
+% |\tclverb*| which also typesets spaces and tabs as visible characters.
+%
+%
+% The \DescribeMacro{\MakeShortTclverb}|\MakeShortTclverb| command works
+% just like the \package{doc}\slash\package{shortvrb} command
+% |\MakeShortVerb|, except that it makes the active character a shorthand
+% reference for |\tclverb|\textellipsis\ instead of |\verb|\textellipsis.
+% Use |\DeleteShortVerb| to undo the effect of a |\MakeShortTclverb|. The
+% \package{tcldoc} class executes the command
+% \begin{quote}
+% \verb"\MakeShortTclverb{\|}"
+% \end{quote}
+% which makes \verb"|" a shorthand for \verb"\tclverb|".
+%
+% Since there is no universally accepted standard for the size
+% (equivalent number of spaces) of a tab, there is a command
+% \DescribeMacro{\settabsize}|\settabsize| for changing this.
+% |\settabsize| takes as its only argument the new tab size, which must
+% be an integer in the range 2--255. The default value is 8.
+% |\settabsize| makes a local assignment to the tab size. The tab size
+% can be changed inside a \texttt{tcl} (or \texttt{tcl*}) environment.
+%
+% There is also a command \DescribeMacro{\TclInput}|\TclInput| which
+% is used for typesetting ``raw'' (not in \texttt{.dtx} format) \Tcl\ code
+% files. |\TclInput| is meant to be used on a \emph{command} line of a
+% \texttt{tcl} or \texttt{tcl*} environment, and it efficiently makes
+% things look as if the |\TclInput| command had been replaced by the
+% inputted file in its entirety (preceded by a newline, and followed
+% by a percent and a space). |\TclInput| takes as its only argument the
+% name of the file to input.
+%
+% To typeset the file \texttt{myscript.tcl} one would write
+%\begin{verbatim}
+%% \begin{tcl}
+%% \TclInput{myscript.tcl}
+%% \end{tcl}
+%\end{verbatim}
+% or even
+%\begin{verbatim}
+% \begin{tcl}\TclInput{myscript.tcl}\end{tcl}
+%\end{verbatim}
+% anywhere in a \package{tcldoc} document. This works since the
+% \texttt{tcl} environment is in command mode right after the initial
+% |\begin{tcl}|, and the |\end{tcl}| need not be the first command on a
+% command mode line.
+%
+% Finally, if the \package{rtkinenc} package~\cite{rtkinenc} is being
+% used then the verbatim code environments and commands described above
+% are to some extent able to catch errors that would otherwise occur
+% because the fonts in use do not contain all characters in the input
+% encoding. Rather than printing nothing, missing characters will be
+% written as the corresponding |\x|\meta{hh} backslash sequence in a
+% slightly different font than the rest of the text. This provides an
+% unambiguous representation regardless of input encoding.
+%
+%
+% \subsection{Markup of named things}
+%
+% The two environments \DescribeEnv{proc}\texttt{proc} and
+% \DescribeEnv{variable}\texttt{variable}, which are analogues of
+% \package{doc}'s \texttt{macro} environment, for procedures and
+% variables respectively have already been mentioned in
+% Section~\ref{Sec:Introduction}. In addition to those there are two
+% environments \DescribeEnv{arrayentry}\texttt{arrayentry} and
+% \DescribeEnv{arrayvar}\texttt{arrayvar} which are meant for entries
+% in array variables and array variables as a whole. The complete
+% syntaxes of these environments are
+% \begin{quote}
+% |\begin{proc}|\oarg{namespace}\marg{proc name}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{proc}|
+%
+% |\begin{variable}|\oarg{namespace}\marg{variable name}\\
+% \vadjust{}\quad$\vdots$\\
+% \quad|\end{variable}|
+%
+% |\begin{arrayentry}|\oarg{namespace}\marg{array name}^^A
+% \marg{entry name}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{arrayentry}|
+%
+% |\begin{arrayvar}|\oarg{namespace}\marg{array name}^^A
+% \oarg{index-des}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{arrayvar}|
+% \end{quote}
+% The \meta{proc name}, \meta{variable name}, and \meta{array name}
+% arguments are quite evidently the names of the procedure, variable,
+% and array respectively. The \meta{namespace} argument can be to
+% specify the namespace part of a qualified name; having the name split
+% like this makes it easier to treat the namespace differently from the
+% rest of the qualified name.\footnote{By redefining \cs{TD@main@index}
+% one can for example make the index sorted first by name, and then by
+% namespace.} The command \DescribeMacro{\buildname}|\buildname|
+% constructs a qualified name from a namespace and a name. If there is
+% no \meta{namespace} argument then the namespace used will be the
+% default namespace. The default namespace is set using the
+% \DescribeMacro{\setnamespace}|\setnamespace| command, which takes the
+% namespace name as its only argument. The default namespace at the
+% beginning of the document is the global namespace, whose name is the
+% empty string.
+%
+% The \texttt{arrayentry} environment is intended for certain
+% distinguished entries in an array, such as entries inserted to
+% make the boundary cases of an algorithm work correctly and entries
+% which have a special meaning to the program. Not all arrays contain
+% such special entries, but when they do it is a good practice
+% to explain them explicitly. The \meta{index-des} argument of the
+% \texttt{arrayvar} environment can be used to specify what is used as
+% index into the array; the text in this argument will appear both in
+% the margin and in the index, but note that \meta{index-des} is a
+% moving argument. There is little difference between the
+% \texttt{variable} and \texttt{arrayvar} environments when the
+% \meta{index-des} argument of the latter isn't used, but the index
+% entries they make behave differently with respect to
+% \texttt{arrayentry} index entries. An \texttt{arrayentry} index entry
+% will be put as a subentry of the corresponding \texttt{arrayvar}
+% entry, whereas a \texttt{variable} entry would appear separately.
+%
+% The above environments usually only appear in the implementation part
+% of a \texttt{.dtx} file. For the usage part there is a command
+% \DescribeMacro{\describestring}|\describestring| which produces
+% marginal headings and index entries. The syntax of |\describestring|
+% is
+% \begin{quote}
+% |\describestring|\oarg{type}\oarg{namespace}\marg{text}
+% \end{quote}
+% The \meta{text} is the string for which a heading and index entry will
+% be made, whereas the \meta{type} (if given) is put after the text.
+% If the \meta{namespace} is given then the thing described is supposed
+% to be the name of something namespace-relative (like a procedure or
+% global variable) and in this case the complete name is formed by
+% passing \meta{namespace} and \meta{text} to |\buildname|. If
+% \meta{type} is \texttt{proc}, \texttt{var.}, or \texttt{array} and a
+% namespace is given then the index entry made will fit that made by
+% a corresponding \texttt{proc}, \texttt{variable}, or
+% \texttt{arrayvar} respectively environment. The \meta{type} argument
+% is, in \LaTeX\ terminology, moving.
+%
+% The \meta{text} and \meta{namespace} arguments can contain arbitrary
+% characters and most characters can be entered verbatim. Amongst the
+% exceptions are `|%|', `|\|', `|{|', and `|}|', which instead can be
+% entered as
+% |\PrintChar|\discretionary{}{}{}|{`\%}|,
+% |\PrintChar|\discretionary{}{}{}|{`\\}|,
+% |\PrintChar|\discretionary{}{}{}|{`\{}|, and
+% |\PrintChar|\discretionary{}{}{}|{`\}}| respectively. See the
+% \package{xdoc} package~\cite{xdoc} documentation for an explanation of
+% the |\PrintChar| command. The \meta{text} argument can also contain
+% ``variant'' parts made using the \DescribeMacro{\meta}|\meta| command.
+% As an example,
+% \begin{quote}
+% |\describestring[array]{\meta{mode}modeVars}|
+% \end{quote}
+% puts the text
+% \begin{quote}
+% \meta{mode}|modeVars| (array)
+% \end{quote}
+% in the margin and index. The arguments of such |\meta| commands are
+% moving.
+%
+%
+% \subsection{Describing command syntaxes}
+%
+% One important part of documentation is to describe the syntaxes of
+% commands. The previous subsection contains examples of the conventions
+% for this that has been developed for \LaTeX\
+% commands---mandatory arguments are denoted as `\marg{argument}' and
+% optional arguments are denoted as `\oarg{argument}'. These two classes
+% suffice rather well for \LaTeX\ commands, but the syntaxes of \Tcl\
+% commands are not seldom much more complex. Therefore a more powerful
+% form of syntax specification is called for, and one which is close at
+% hand is that used in regular expressions since it is already part of
+% the \Tcl\ language anyway.
+%
+% \DescribeMacro\regopt
+% \DescribeMacro\regstar
+% \DescribeMacro\regplus
+% The simplest commands available are the modifiers |\regopt|,
+% |\regstar|, and |\regplus|, which correspond to the |?|,
+% |*|, and |+| metacharacters in a regular expression; using |\regopt|
+% after a term says that it is optional, |\regstar| says that the term
+% can be repeated an arbitrary number of times (including zero), and
+% |\regplus| says that the term occurs at least once. The typeset
+% results of these commands are $^?$, $^*$, and $^+$ respectively
+% (recall that exponents are sometimes used to denote repetition).
+%
+% The terminals in the expression are best made using |\tclverb| (for
+% ``fixed'' material, e.g.\ procedure names) and
+% \DescribeMacro{\word}|\word| (for variable material, e.g.\
+% arguments). The syntax of |\word| is
+% \begin{quote}
+% |\word|\marg{text}
+% \end{quote}
+% and e.g.\ |\word{script}| gets typeset as
+% \begin{quote}
+% \word{script}
+% \end{quote}
+% Using these, one can for example specify the syntaxes of the \Tcl\
+% commands |append| and |catch| through
+% \begin{quote}
+% \verb"|append| \word{var-name} \word{value}\regplus"\\
+% \verb"|catch| \word{script} \word{var-name}\regopt"
+% \end{quote}
+% (recall that `\verb"|"' is a shorthand for `\verb"\tclverb|"'). These
+% get typeset as
+% \begin{quote}
+% |append| \word{var-name} \word{value}\(^+\)\\
+% |catch| \word{script} \word{var-name}\(^?\)
+% \end{quote}
+%
+% Terms in regular expressions can also consist of parenthesised
+% subexpressions, which are made using the \DescribeEnv{regexp}^^A
+% \texttt{regexp} environment. The syntax of this environment is
+% \begin{quote}
+% |\begin{regexp}|\oarg{modifier}\quad\dots\quad |\end{regexp}|
+% \end{quote}
+% If \texttt{regexp} environments are nested then the parentheses of
+% the outer environment will grow to be larger than those of the inner
+% environment. A side-effect of this is that the \texttt{regexp}
+% environment wants to know if a modifier will be applied to it, since
+% the amount by which the modifier should be raised in this case depends
+% on the size of the parenthesis before it, and this is what the
+% \meta{modifier} optional argument is for. \LaTeX\ does not provide
+% for arguments at the |\end| of an environment, so it has to be placed
+% at the |\begin|. Using these elements, the syntax of |if| can be
+% specified through
+% \begin{quote}
+% \verb"|if| \word{expression} |then|\regopt\ \word{script}"\\
+% \verb"\begin{regexp}[\regstar]|elseif| \word{expression}"\\
+% \verb"|then|\regopt\ \word{script}\end{regexp}"\\
+% \verb"\begin{regexp}[\regopt]|else| \word{script}\end{regexp}"
+% \end{quote}
+% which typesets as
+% \begin{isyntax}
+% |if| \word{expression} |then|\(^?\) \word{script} \(\bigl(\)^^A
+% |elseif| \word{expression} |then|\(^?\) \word{script}\(\bigr)^*\)
+% \(\bigl(\)|else|~\word{script}\(\bigr)^?\)
+% \end{isyntax}
+%
+% The final regular expression construction that is supported is that
+% of branches of a regular expression. A \texttt{regexp} environment
+% consist of one or several branches that are separated by
+% \DescribeMacro{\regalt}|\regalt| commands. Visually the |\regalt|
+% command gets typeset as a vertical bar that has the same size as the
+% parentheses of the surrounding \texttt{regexp} environment. The
+% |\regalt| command may only be used inside a \texttt{regexp} environment.
+% An example of the use of |\regalt| is the following specification of
+% the syntax of \Tcl's |regexp| command:
+% \begin{quote}
+% \verb"|regexp| \begin{regexp}[\regstar]|-nocase|\regalt"\\
+% \verb"|-indices|\end{regexp} |--|\regopt \word{regular expression}"\\
+% \verb"\word{string} \word{var-name}\regstar"
+% \end{quote}
+% which typesets as
+% \begin{isyntax}
+% |regexp| \((\)|-nocase|~\(\mid\) |-indices|\()^*\) |--|\(^?\)
+% \word{regular expression} \word{string} \word{var-name}\(^*\)
+% \end{isyntax}
+%
+% Finally a note about the relationship between the |\word| command and
+% \package{doc}'s |\meta| command. Whereas the argument of |\word| is
+% encapsulated in braces (and thus ought to be a separate word for a
+% \Tcl\ interpreter), the argument of |\meta| is encapsulated in angle
+% brackets. The idea is that |\word| should be used for things which are
+% separate words to \Tcl, whereas |\meta| should be used for things which
+% are merely part of words. Thus in the command |set b Z${a}Y|, the second
+% word |b| would be a `\word{var-name}' and the third word |Z${a}Y| would
+% be a `|Z|\meta{string}|Y|'.
+%
+%
+%
+% \subsection{Options and customisation}
+%
+% The \package{tcldoc} package does not have any options, but all
+% options passed to it are passed on to the \package{xdoc} package.
+% The \package{tcldoc} class accepts all options that the standard
+% \LaTeX\ document class \package{article} accepts, with the exception
+% of \texttt{a5paper}.
+%
+% In addition, the \package{tcldoc} class also accepts the option
+% \describeoption{macinputenc}\texttt{macinputenc}, which causes a lot
+% of things to be set up so that input characters from outside 7-bit
+% ASCII can be interpreted according to the Macintosh character set.
+%
+% Like the \package{ltxdoc} class, the \package{tcldoc} class will look
+% for a special configuration file \texttt{tcldoc.cfg} and input that
+% file if it exists. This file can be used to declare extra options for
+% the class, have certain options always given, etc. Section~2 of
+% \texttt{ltxdoc.dtx}~\cite{ltxdoc} is a good introduction to how such
+% configuration files can be used with \texttt{.dtx} sources in general.
+%
+% When customising the \package{tcldoc} document class, you affect how
+% all documents using that class will be typeset in your particular \TeX\
+% installation. It is \emph{not} something you have to do, but it can
+% make \package{tcldoc} documents work better with the printers, paper
+% formats, fonts, etc.\ that are available in your installation. It
+% will usually cause line and page breaks to occur at other places than
+% they would do if typeset using an uncustomised \package{tcldoc}
+% class, so the typographical quality of the document can be decreased,
+% but it is uncommon to find an \texttt{.dtx} document whose author
+% have given these matters much attention anyway. Hence the typographic
+% arguments against customisation are weak.
+%
+% A common form of customisation is to use additional packages, since
+% various kinds of document-wide font selection is often done by
+% packages. Due to that the code in \texttt{tcldoc.cfg} is executed when
+% the \package{tcldoc} class does its option processing, at which time
+% \LaTeX\ does not allow loading packages, such customisation is not
+% straightforward. There is a way around that however; to load e.g.\ the
+% \package{textcomp} package, use the command
+%\begin{verbatim}
+%\AtEndOfClass{\usepackage{textcomp}}
+%\end{verbatim}
+% Using |\AtEndOfClass| like this delays the command until it may be
+% executed.
+%
+% Finally, and in particular if you are typesetting documents that use
+% the \texttt{macinputenc} option, you can put code that define
+% ``fakes'' for various text commands in the \texttt{tcldoc.cfg} file.
+% For example, the `diamond' character in the Macintosh encoding is not
+% available in any of the standard \LaTeX\ text fonts, and therefore the
+% \texttt{tcl} environment will typeset this character as the escape
+% code `\textbackslash xd7'. There is a diamond character in the math
+% fonts however, and you can make the \texttt{tcl} environment use that
+% character instead by adding the commands
+%\begin{verbatim}
+%\DeclareTextSymbol{\textdiamond}{OMS}{5}
+%\DeclareTextSymbolDefault{\textdiamond}{OMS}
+%\end{verbatim}
+% to you \texttt{tcldoc.cfg} file. Note however, that this kind of
+% configuration is \emph{advanced} \LaTeX, and you should probably
+% familiarise yourself with the contents of the file
+% \texttt{ltoutenc.dtx}~\cite{ltoutenc} before attempting to design
+% anything along these lines yourself.
+%
+%
+% \subsection{Miscellanea}
+%
+% For writing ``\Tcl'', the \package{tcldoc} package defines the command
+% \DescribeMacro{\Tcllogo}|\Tcllogo|, which for most fonts look slightly
+% better than simply typing |Tcl|. (|\Tcllogo| becomes \Tcl, whereas
+% |Tcl| becomes Tcl.)
+%
+%
+% \section{Acknowledgements}
+%
+% The \package{tcldoc} document class and \LaTeX\ package were
+% constructed starting from three other sources: (i)~the \package{ltxdoc}
+% document class~\cite{ltxdoc} by David Carlisle,
+% (ii)~the \package{doc} package~\cite{doc} by Frank Mittelbach,
+% B.~Hamilton Kelly, Andrew Mills, Dave Love, and Joachim Schrod, and
+% (iii)~my own \package{pasdoc} document class. Hence the `et al.'\ in
+% the author field above. This complicated heritage in the code is
+% mirrored by the documented source---there are paragraphs below that
+% are rather about one of (i)--(iii), than about \package{tcldoc}.
+%
+%
+%
+% \StopEventually{
+% \begin{thebibliography}{9}
+% \bibitem{ltoutenc}
+% Johannes Braams, David Carlisle, Alan Jeffrey, Frank
+% Mittelbach, Chris Rowley, and Rainer Sch\"opf:
+% \textit{ltoutenc.dtx}, The \LaTeX3 Project;
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{ltoutenc.dtx}.
+% \bibitem{ltxdoc}
+% David Carlisle:
+% \textit{The file \texttt{ltxdoc.dtx} for use with \LaTeXe},
+% The \LaTeX3 Project;
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{ltxdoc.dtx}.
+% \bibitem{rtkinenc}
+% Lars Hellstr\"om:
+% \textit{The \package{rtkinenc} package};
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash
+% \texttt{supported}\slash \texttt{rtkinenc}\slash
+% \texttt{rtkinenc.dtx}.
+% \bibitem{xdoc}
+% Lars Hellstr\"om:
+% \textit{The \package{xdoc} package --- experimental
+% reimplementations of features from \package{doc},
+% second~prototype}, 2000;
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{exptl}\slash \texttt{xdoc}\slash
+% \texttt{xdoc2.dtx}.
+% \bibitem{docstrip}
+% Frank Mittelbach, Denys Duchier, Johannes Braams, Marcin
+% Woli\'nski, and Mark Wooding: \textit{The \textsf{DocStrip}
+% program}, The \LaTeX3 Project;
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{docstrip.dtx}.
+% \bibitem{doc}
+% Frank Mittelbach, B.~Hamilton Kelly, Andrew Mills, Dave Love, and
+% Joachim \mbox{Schrod}: \textit{The \package{doc} and
+% \package{shortvrb} Packages}, The \LaTeX3 Project;
+% CTAN:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{doc.dtx}.
+% \end{thebibliography}
+% \begin{flushleft}\footnotesize
+% The ``CTAN:'' above is short for ``any of the servers in the
+% Comprehensive \TeX\ Archive Network (or any of their mirrors)''.
+% You get a working URL if you replace this by e.g.\
+% ``\texttt{ftp://ftp.tex.ac.uk/tex-archive/}''.%
+% \end{flushleft}
+% }
+%
+%
+% \changes{v\,1.90}{2000/01/02}{Took a copy of \texttt{pasdoc.dtx} and
+% started modifying it into \texttt{tcldoc.dtx}. (LH)}
+%
+% \section{Initial stuff in the \package{tcldoc} package}
+%
+% The |\NeedsTeXFormat| and |\ProvidesPackage| commands for the
+% \package{tcldoc} package appear at the top of \texttt{tcldoc.dtx} (not
+% shown in the typeset document). Apart from that the only initial
+% action required is to load the \package{xdoc} package (and thereby
+% the \package{doc} package).
+%
+% \begin{macrocode}
+%<*pkg>
+\RequirePackageWithOptions{xdoc2}[2000/11/26]
+% \end{macrocode}
+%
+%
+% \section{Verbatim typesetting of \Tcl\ code}
+%
+% \changes{v\,2.10}{2000/10/03}{Major overhaul of the \texttt{tcl}
+% environment, to make it possible to assign different penalties to
+% different breakpoints. (LH)}
+%
+% The main feature in the \package{tcldoc} package is the \texttt{tcl}
+% environment, which typesets embedded code in a way more adapted to
+% \Tcl\ code than what the \texttt{macrocode} environment does.
+%
+%
+% \subsection{Beginning of line processing}
+%
+% The organization of the text in \emph{lines} is crucial for its
+% interpretation by the \texttt{tcl} environment. In particular the
+% following features rely on being at the beginning of a line:
+% \begin{itemize}
+% \item indentation of \Tcl\ code,
+% \item invoking command mode,
+% \item recognizing \package{docstrip} guards.
+% \end{itemize}
+%
+% \begin{macro}{\TD@percent@token}
+% A control sequence |\let| to a |%|$_{12}$, mainly for use in |\ifx|
+% comparisons.
+% \DoNotIndex{\%}
+% \begin{macrocode}
+\begingroup
+ \catcode`\%=12
+ \global\let\TD@percent@token=%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@start@n@line}
+% \begin{macro}{\TD@start@n@line@}
+% \begin{macro}{\TD@start@n@line@i}
+% The macro |\TD@start@n@line| is used at the beginning of every line.
+% The macro first clears the |\TD@line@indent| and |\TD@nesting@level|
+% registers and then it checks if the next character is a percent. If
+% it is then this is a command line. If it isn't then it is a normal
+% line and it is time to start a codeline paragraph and count the
+% character indentation.
+%
+% |\TD@|\-|start@|\-|n@|\-|line@| is the macro which actually does
+% these things; |\TD@|\-|start@|\-|n@|\-|line| is usually |\let| to
+% |\TD@|\-|start@|\-|n@|\-|line@|. When a file is being |\TclInput|ed
+% however, |\TD@|\-|start@|\-|n@|\-|line| is |\let| to
+% |\TD@|\-|start@|\-|n@|\-|line@i| which peeks at the next token
+% before calling |\TD@|\-|start@|\-|n@|\-|line@|. If it didn't,
+% |\TD@|\-|start@|\-|n@|\-|line@| would have a problem at the end of
+% the file, since the end of a file counts as being |\outer|.
+% \begin{macrocode}
+\def\TD@start@n@line@#1{%
+ \global\TD@line@indent=\z@
+ \TD@nesting@level=\z@
+ \ifx #1\TD@percent@token
+ \expandafter\TD@module
+ \else
+ \global\advance \c@codelineno \@ne
+ \TD@begin@tclpar
+ \expandafter\TD@count@indent \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\let\TD@start@n@line=\TD@start@n@line@
+\def\TD@start@n@line@i{\futurelet\next\TD@start@n@line@}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@count@indent}
+% The purpose of the |\TD@count@indent| macro is to compute the
+% indentation of the current line. It grabs the next character, and
+% as long as that is a space or tab it will just increment
+% |\TD@line@indent| accordingly and continue with the next character.
+% |!| and |"| are used to make space and tab respectively with
+% suitable catcode.
+% \DoNotIndex{\!,\",\ ,\^}
+% \begin{macrocode}
+\begingroup
+ \catcode`\!=\active
+ \catcode`\"=\active
+ \lccode`\!=`\ %
+ \lccode`\"=`\^^I%
+ \lowercase{%
+\endgroup
+ \def\TD@count@indent#1{%
+ \ifx !#1%
+ \global\advance \TD@line@indent \@ne
+ \expandafter\TD@count@indent
+ \else \ifx "#1%
+ \global\divide \TD@line@indent \TD@tab@size
+ \global\advance \TD@line@indent \@ne
+ \global\multiply \TD@line@indent \TD@tab@size
+ \expandafter\expandafter \expandafter\TD@count@indent
+ \else
+ \TD@setup@parshape
+ \expandafter\expandafter \expandafter#1%
+ \fi\fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@module}
+% When command mode has been properly established it is time to
+% check if the next character is |<|, in which case the following
+% \package{docstrip} guard must be processed.
+% \changes{v\,2.13}{2000/12/20}{Always check whether the current line
+% is a guard line, since the \texttt{\PrintChar{\number`\<}} in
+% the guard would otherwise start a new paragraph, which is an
+% error. (LH)}
+% \begin{macrocode}
+\def\TD@module{%
+ \TD@command
+ \futurelet\next
+ \TD@ch@angle
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@ch@angle}
+% The module checking in \package{tcldoc} takes advantage of the
+% macros for this in \package{doc}---|\ch@plus@etc| is a \package{doc}
+% macro. |<| is active because it is in the nolig list
+% (|\verbatim@|\-|nolig@|\-|list|).
+% \begin{macrocode}
+\begingroup
+ \catcode`<=\active
+ \gdef\TD@ch@angle{%
+ \ifx <\next
+ \global\advance \c@codelineno \@ne
+ \TD@begin@tclpar
+ \expandafter\futurelet \expandafter\next
+ \expandafter\ch@plus@etc
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@pm@module}
+% The |\TD@pm@module| macro is used instead of \package{doc}'s
+% |\pm@module| when in the \texttt{tcl} environment. This is necessary
+% since the paragraph man\oe uvres of the \texttt{tcl} environment would
+% not work right with \package{doc}'s |\pm@module|.
+%
+% If we're not dealing with a block directive (|*| or |/|), i.e.,
+% it's a single special line, we set everything up to the next |>|
+% appropriately, return to normal mode, possibly change font, and
+% start counting indentation spaces.
+% \DoNotIndex{\>}
+% \begin{macrocode}
+\begingroup
+ \catcode`\>=\active
+ \gdef\TD@pm@module#1>{%
+ \Module{#1}%
+ \TD@normal
+ \ifnum \guard@level<\c@StandardModuleDepth \else
+ \AltMacroFont
+ \fi
+ \TD@count@indent
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@star@module}
+% \begin{macro}{\TD@slash@module}
+% The |\TD@star@module| and |\TD@slash@module| macros are, like
+% |\TD@pm@module|, used instead of \package{doc}'s |\star@module| and
+% |\slash@module| respectively when in the \texttt{tcl} environment.
+% The only difference is that the |\TD@|\textellipsis\ macros also end
+% the paragraph started in |\TD@ch@angle|, but without that
+% difference, the module guard would incorrectly be reported as
+% ``horizontal material on command line''.
+% \DoNotIndex{\>}
+% \begin{macrocode}
+\begingroup
+ \catcode`\>=\active
+ \gdef\TD@star@module#1>{%
+ \Module{#1}\TD@end@tclpar
+ \global\advance \guard@level \@ne
+ \ifnum \c@StandardModuleDepth<\guard@level
+ \global\let\macro@font=\AltMacroFont
+ \macro@font
+ \fi
+ }
+ \gdef\TD@slash@module#1>{%
+ \Module{#1}\TD@end@tclpar
+ \global\advance \guard@level \m@ne
+ \ifnum \guard@level=\c@StandardModuleDepth
+ \global\let\macro@font\MacroFont
+ \macro@font
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@gobble@whitespace}
+% This macro gobbles all normal mode spaces and tabs following it.
+% \begin{macrocode}
+\def\TD@gobble@whitespace#1{%
+ \if \ifx #1\TD@active@space
+ 0%
+ \else
+ \ifx #1\TD@active@tab 0\else 1\fi
+ \fi 0%
+ \expandafter\TD@gobble@whitespace
+ \else
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Typographical elements}
+%
+% This subsection contains definitions of the typographical
+% elements---special symbols and the like--that are used in the
+% \texttt{tcl} and \texttt{tcl*} environments.
+%
+%
+% \begin{macro}{\TD@typography}
+% \begin{macro}{\TD@nontcl@font}
+% The |\TD@typography| macro does all the typographic set-up that is
+% common to the \texttt{tcl} environment, the \texttt{tcl*}
+% environment, and the |\tclverb| command.
+%
+% The |\TD@nontcl@font| macro selects an ``escape'' font for \Tcl\
+% material. This font is used for various kinds of escape codes that
+% are typeset instead of some character---either because the
+% character is not available, or because the line needs to be broken.
+% The escape font will have the same font family (and same encoding)
+% as the text surrounding the \texttt{tcl} environment or |\tclverb|
+% command. Therefore |\TD@nontcl@font| must be defined before the
+% \Tcl\ material font is selected. I don't think it is necessary to
+% use |\protected@edef| below, but it can't hurt either.
+% \begin{macrocode}
+\def\TD@typography{%
+ \protected@edef\TD@nontcl@font{%
+ \noexpand\fontencoding{\cf@encoding}%
+ \noexpand\fontfamily{\f@family}\noexpand\selectfont
+ }%
+% \end{macrocode}
+% The most frequent escape symbol is the single backslash used for
+% escaping the end of lines, and this is stored in the
+% |\TD@backslash@box| box.
+%
+% The following code have to do with how characters outside
+% visible ASCII are typeset when they appear in the \texttt{tcl} or
+% \texttt{tcl*} environment. The commands are defined by the
+% \package{rtkinenc} package.
+% \begin{macrocode}
+ \InputModeCode
+ \SetUnavailableAction{\leavevmode{%
+ \TD@nontcl@font\textbackslash x\TypesetHexNumber{##1}%
+ }}%
+ \DeclareInputMath{0}{\RIE@undefined{0}}%
+ \DeclareInputMath{12}{\RIE@undefined{12}}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@typeset@space}
+% This macro typesets a space, as it should be in the \texttt{tcl}
+% environment (and other places too). It generates a kern, not glue, so
+% that it can be used in a |\discretionary|.
+% \begin{macrocode}
+\def\TD@typeset@space{\kern\fontdimen\tw@\font}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@discretionary@space}
+% This is the macro which offers all the breakpoints in |\tclverb|
+% code. The name comes from the fact that all the breakpoints are
+% discretionaries which appear to be spaces when not broken. When
+% they are broken, they are backslashes. To give some visual hint
+% that these backslashes need not be backslashes in the source, they
+% are typeset in the same font family (and same encoding) as the
+% text surrounding the \texttt{tcl} environment.
+% \begin{macrocode}
+\def\TD@discretionary@space{%
+ \discretionary{\copy\TD@backslash@box}{}{\TD@typeset@space}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@breakable@space}
+% The valid breakpoints inside \texttt{tcl} and \texttt{tcl*}
+% environments are made in the |\TD@|\-|breakable@|\-|space| macro.
+% This macro contributes an |\hbox| (which contains a
+% |\TD@typeset@space|), a penalty, and an empty |\vadjust| to the
+% current horizontal list. If a line break is made at the penalty,
+% the |\hbox| will later be removed and replaced by a non-macro font
+% backslash (from |\TD@backslash@box|). The |\vadjust| is there to
+% prevent that any discardable items disappears after the breakpoint.
+% \begin{macrocode}
+\def\TD@breakable@space{%
+ \hbox{\TD@typeset@space}%
+ \TD@nesting@penalty
+ \vadjust{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@typeset@tab}
+% This is an unbreakable space whose width equals that of
+% |\TD@tab@size| spaces.
+% \begin{macrocode}
+\def\TD@typeset@tab{\kern\TD@tab@size\fontdimen\tw@\font}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@visible@whitespace}
+% The |\TD@visible@whitespace| macro locally redefines the macros
+% which typesets spaces and tabs to make visible symbols. The visible
+% tab is roughly a |\rightarrowfill| and a |\vrule|, but a difference
+% is that the minuses that form the extensible ``tail'' to the
+% |\rightarrow| are not smashed. Not doing that gives the |\vrule| a
+% suitable height, but I had rather expected the nominal height of
+% the |\rightarrow| to be larger \textellipsis\ It's yet another
+% mysterious math font feature, I suppose.
+%
+% \begin{macrocode}
+\def\TD@visible@whitespace{%
+ \def\TD@typeset@space{\char32 }%
+ \def\TD@typeset@tab{%
+ \hb@xt@\TD@tab@size\fontdimen\tw@\font{%
+ $\m@th-\mkern-7mu%
+ \cleaders\hbox{$\mkern-2mu-\mkern-2mu$}\hfill
+ \mkern-7mu\mathord\rightarrow\mkern-1mu\vrule\mkern1mu$%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Catcodes and active characters}
+%
+% Like any \texttt{verbatim}-like environment, the \texttt{tcl}
+% environment does some rather extensive alterations of catcodes. This
+% is handled by the three macros |\TD@general|, |\TD@normal|, and
+% |\TD@command|. Set-up that is common for both modes is made by
+% |\TD@general| when the \texttt{tcl} environment is entered.
+% Mode-dependent set-up is made by |\TD@normal| and |\TD@command|
+% whenever a mode switch occurs.
+%
+% \begin{macro}{\TD@let@active}
+% One technicality here is that all of these routines need to set the
+% definition of some active character, and this character is often not
+% active with normal \LaTeX\ catcodes. To overcome this difficulty,
+% there is a macro |\TD@let@active| which takes two arguments: a
+% control sequence with a single character name, and an arbitrary
+% control sequence. The active character with the same name as the
+% first control sequence is |\let| locally to the second control
+% sequence.
+% \begin{macrocode}
+\begingroup
+ \catcode\z@=\active
+ \gdef\TD@let@active#1{%
+ \begingroup
+ \lccode\z@=`#1%
+ \lowercase{%
+ \endgroup
+ \let^^@%
+ }%
+ }%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@general}
+% The |\TD@general| macro does the initial set-ups that are common for
+% both modes of the \texttt{tcl} environment and for the |\tclverb|
+% command. These include definitions of various active characters and
+% |\catcode| assignments.
+%
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@general{%
+ \let\do\do@noligs
+ \verbatim@nolig@list
+ \let\do\@makeother
+ \dospecials
+ \catcode`\^^M=\active
+ \TD@let@active\^^I\TD@active@tab
+ \TD@let@active\^^M\TD@active@CR
+ \TD@let@active\ \TD@active@space
+ \TD@let@active\\\TD@active@backslash
+ \TD@let@active\{\TD@active@braceleft
+ \TD@let@active\}\TD@active@braceright
+ \TD@let@active\[\TD@active@bracketleft
+ \TD@let@active\]\TD@active@bracketright
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@normal}
+% This macro sets up the normal mode, changing everything that is
+% different in any of the other modes. Note that the catcodes in
+% normal mode are such that no character is a space. This makes it
+% possible for macros used in normal mode to look ahead by simply
+% grabbing the next character in an undelimited argument.
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@normal{%
+ \catcode`\^^I=\active
+ \catcode`\ =\active
+ \catcode`\\=\active
+ \catcode`\{=\active
+ \catcode`\}=\active
+ \catcode`\[=\active
+ \catcode`\]=\active
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@command}
+% This macro switches from normal mode to command mode.
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@command{%
+ \catcode`\^^I=10%
+ \catcode`\ =10%
+ \catcode`\[=12%
+ \catcode`\]=12%
+ \catcode`\\=\z@
+ \catcode`\{=\@ne
+ \catcode`\}=\tw@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@active@space}
+% \begin{macro}{\TD@active@space@}
+% This macro is used for spaces in normal mode. Its main problem is
+% to determine whether it is followed by more whitespace or not. If it
+% is, then it is an unbreakable space. If it isn't, then it is a
+% breakable space.
+% \begin{macrocode}
+\def\TD@active@space#1{%
+ \ifx #1\TD@active@backslash
+ \expandafter\TD@active@space@
+ \else
+ \ifx #1\TD@active@space
+ \TD@typeset@space
+ \else\ifx #1\TD@active@tab
+ \TD@typeset@space
+ \else
+ \TD@breakable@space
+ \fi\fi
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% The special case to look out for is that the next character is a
+% backslash which escapes a newline.
+% \begin{macrocode}
+\def\TD@active@space@#1{%
+ \ifx #1\TD@active@CR
+ \TD@typeset@space
+ \else
+ \TD@breakable@space
+ \fi
+ \TD@active@backslash #1%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@active@tab}
+% The |\TD@active@tab| macro is what the active character tab is
+% |\let| to inside the \texttt{tcl} and \texttt{tcl*} environments.
+% \begin{macrocode}
+\def\TD@active@tab{\TD@typeset@tab}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@active@CR}
+% This macro is called at the end of a line. The |\catcode| tests the
+% current mode.
+% \DoNotIndex{\\}
+% \begin{macrocode}
+\def\TD@active@CR{%
+ \ifnum \catcode`\\=\z@
+ \ifvmode\else
+ \PackageError{tcldoc}{Horizontal material on command line}\@ehc
+ \@@par
+ \fi
+ \TD@normal
+ \else
+ \TD@end@tclpar
+ \fi
+ \TD@start@n@line
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@active@CRv}
+% This is what |\tclverb| defines the |^^M| active character as
+% being. Cf.\ the standard \LaTeX\ macro |\verb@eol@error|.
+% \begin{macrocode}
+\def\TD@active@CRv{%
+ \verb@egroup
+ \PackageError{tcldoc}{\protect\tclverb\space ended by end of line}%
+ \@ehc
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@active@backslash}
+% \changes{v\,2.10}{2000/10/08}{First checking if next character is
+% active, and only expands the macro containing the detailed tests
+% if it is. (LH)}
+% \begin{macro}{\TD@active@backslash@}
+% \begin{macro}{\TD@active@backslash@v}
+% |\TD@active@backslash| is used for backslashes in normal mode. Its
+% main problem is to determine whether the backslash is escaping
+% something (which would normally be treated specially by the
+% environment) or not. The primary test for this is whether the
+% argument grabbed is an active character, and if it is then
+% processing continues (in |\TD@active@backslash@|) to determine what
+% should be done.
+% \begin{macrocode}
+\def\TD@active@backslash#1{%
+ \ifcat \noexpand#1\noexpand~%
+ \expandafter\TD@active@backslash@
+ \else
+ \@backslashchar
+ \fi
+ #1%
+}
+% \end{macrocode}
+%
+% \changes{v\,2.11}{2000/11/06}{Escaped spaces are no longer breakable.
+% (LH)}
+% \begin{macrocode}
+\def\TD@active@backslash@#1{%
+ \ifcase
+ \ifx #1\TD@active@CR 0%
+ \else\ifx #1\TD@active@backslash 1%
+ \else\ifx #1\TD@active@braceleft 2%
+ \else\ifx #1\TD@active@braceright 2%
+ \else\ifx #1\TD@active@bracketleft 2%
+ \else\ifx #1\TD@active@bracketright 2%
+ \else\ifx #1\TD@active@space 3%
+ \else 4\fi\fi\fi\fi\fi\fi\fi
+ \space
+ \expandafter\TD@active@backslash@i
+ \or
+ \@backslashchar\@backslashchar
+ \or
+ \@backslashchar \string#1%
+ \or
+ \@backslashchar \TD@typeset@space
+ \else
+ \@backslashchar
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% Escaped newlines that are followed by command mode lines are not
+% converted to discretionary spaces.
+% \begin{macrocode}
+\def\TD@active@backslash@i#1{%
+ \ifx #1\TD@percent@token
+ \copy\TD@backslash@box
+ \expandafter\TD@active@CR
+ \else
+ \TD@breakable@space
+ \global\advance \c@codelineno \@ne
+ \expandafter\TD@gobble@whitespace
+ \fi
+ #1%
+}
+% \end{macrocode}
+% The |\tclverb| command uses |\TD@active|\-|@backslash@v| instead of
+% |\TD|\-|@active|\-|@backslash@i|, since it is intended for use on
+% lines that may begin with |%|.
+% \begin{macrocode}
+\def\TD@active@backslash@v#1{%
+ \TD@discretionary@space
+ \ifx #1\TD@percent@token
+ \expandafter\@firstoftwo
+ \fi
+ \TD@gobble@whitespace #1%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@active@braceleft}
+% \begin{macro}{\TD@active@braceright}
+% \begin{macro}{\TD@active@bracketleft}
+% \begin{macro}{\TD@active@bracketright}
+% These macros mainly typeset the corresponding characters, but they
+% also increase or decrease the |\TD@nesting@level| count by one.
+% \DoNotIndex{\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\begingroup
+ \catcode`\{=12 \catcode`\}=12
+ \catcode`\[=1 \catcode`\]=2
+ \gdef\TD@active@braceleft[{\advance\TD@nesting@level\@ne]
+ \gdef\TD@active@braceright[}\advance\TD@nesting@level\m@ne]
+\endgroup
+% \end{macrocode}
+% \begin{macrocode}
+\def\TD@active@bracketleft{[\advance\TD@nesting@level\@ne}
+\def\TD@active@bracketright{]\advance\TD@nesting@level\m@ne}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \subsection{Paragraph formatting}
+%
+% This subsection contains definitions of control sequences that are
+% mainly related to the formatting of paragraphs.
+%
+% The new implementation of the \texttt{tcl} and \texttt{tcl*}
+% environments is based on inserting the ``discretionary'' backslashes
+% at the linebreaks \emph{after} the paragraph has been broken.
+% Doing this involves reboxing every line in the paragraph, and in this
+% process the line adjustments are changed as well.
+%
+% \begin{macro}{\TD@backslash@box}
+% The |\TD@backslash@box| box register is set to a backslash in the
+% special |\TD@nontcl@font| at the beginning of each \texttt{tcl} and
+% \texttt{tcl*} environment. These backslashes are used to denote
+% ``backslash escaping newline''. The primary reason for keeping this
+% glyph in a box is not that this might be slightly faster to
+% typeset, but to have the \emph{width} of it easily accessible.
+% \begin{macrocode}
+\newbox\TD@backslash@box
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@nesting@level}
+% \begin{macro}{\TD@nesting@penalty}
+% |\TD@nesting@level| is a count register which keeps track of how
+% many brace\slash bracket groups surrounds the current position in
+% the line. It is cleared to zero at the beginning of each paragraph.
+% \begin{macrocode}
+\newcount\TD@nesting@level
+% \end{macrocode}
+% |\TD@nesting@penalty| makes a |\penalty| whose value should depend
+% on the nesting level (the deeper the nest, the larger the penalty).
+% It may also adjust the value of |\linepenalty| to counter that
+% the nesting level has become negative. This is typically needed for
+% lines which say things like ``|} else {|''. The default definition is
+% to make the nesting penalty $100$ times the nesting level and to
+% make the |\linepenalty| equal to
+% \(10 - \min\{0,\mbox{least penalty}\}\).
+% \begin{macrocode}
+\def\TD@nesting@penalty{%
+ \penalty \the\TD@nesting@level 00\relax
+ \ifnum \lastpenalty<-\linepenalty
+ \linepenalty=10%
+ \advance \linepenalty -\lastpenalty
+ \fi
+}
+% \end{macrocode}
+% I doubt that this is necessarily the best algorithm for computing
+% these penalties, so if you are really thorough about your
+% typography you may well want to experiment with other definitions of
+% |\TD@nesting@penalty|. In case you should then find something which
+% works even better then I'm interested to learn about it.
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@reformat@lines}
+% The |\TD@reformat@lines| macro calls itself recursively to reformat
+% all lines on the current vertical list. The first line will remain
+% flush left, but all other lines will be reset flush right. The
+% visible material on the last line will be left as it is, but the
+% last box in all other lines will be replaced by a non-macro font
+% backslash.
+%
+% It is very important that the current vertical list is not the main
+% vertical list.
+% It is assumed that the current vertical list consists of a sequence
+% of \meta{box}, \meta{penalty}, \meta{glue}, with an extra glue item
+% at the top of the list. It is OK if some penalty or glue item is
+% missing. In case the list contains other material as well the line
+% reformatting may be stopped prematurely, but there is a trick that
+% allows one to put arbitrary material between the lines of the
+% reformatted paragraph: rather than doing e.g.
+% \begin{quote}
+% |\mark|\marg{text}
+% \end{quote}
+% in the paragraph, do
+% \begin{quote}
+% |\vadjust{\vbox{\mark{|\meta{text}|}}}|
+% \end{quote}
+% The |\vbox| will be recognised by the paragraph reformatting
+% mechanism as a container for vertical mode material that appears
+% between the lines of the paragraph, so it will simply be unboxed.
+% \changes{v\,2.12}{2000/11/11}{\cs{vbox} containers for vertical
+% material are allowed between the lines of a reformatted
+% paragraph. (LH)}
+%
+% Each line's horizontal list ends with
+% \begin{itemize}
+% \item a box (which contains the space that is to be replaced by a
+% backslash),
+% \item a penalty (at which the paragraph was broken), and
+% \item a glue item (the |\rightskip|).
+% \end{itemize}
+%
+% A tricky feature in the implementation is that the
+% |\bgroup|--|\egroup| nesting will be off by one. The |\bgroup| at
+% the beginning of a |\TD@reformat@line| will be matched by the
+% |\egroup| at the end of the |\TD@reformat@line| that the first one
+% calls!
+% \begin{macrocode}
+\def\TD@reformat@lines{%
+ \bgroup
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \ifvoid\z@
+% \end{macrocode}
+% The recursion had already descended down to the last line of the
+% paragraph, and it is now time to reformat it.
+% \begin{macrocode}
+ \egroup
+ \prevdepth=\TD@prevdepth
+ \hbox{%
+ \unhbox\z@
+ \unskip \unpenalty
+ \setbox\z@=\lastbox
+ \copy\TD@backslash@box
+ }%
+ \else
+% \end{macrocode}
+% Else there may be another line, and the |\TD@reformat@lines| recursion
+% must continue to descend. Upon return the box currently in box
+% register zero must be reformatted as a non-first line (flush
+% right) and it cannot be the last line in the paragraph, so it is
+% always correct to replace the last box by a backslash.
+% \begin{macrocode}
+ \TD@reformat@lines
+ \ifvbox\z@ \unvbox\z@ \else
+ \hb@xt@\dimen@{%
+ \hfill
+ \unhbox\z@
+ \unskip \unpenalty
+ \setbox\z@=\lastbox
+ \copy\TD@backslash@box
+ }%
+ \fi
+ \fi
+ \ifnum \count@=\z@ \else \penalty\count@ \fi
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@reformat@par}
+% The |\TD@reformat@par| macro reformats all lines (they're supposed
+% to constitute a paragraph, but that isn't so important) in the
+% current vertical list. The restrictions of |\TD@reformat@lines| on
+% what may appear in the list apply and there must be at least two
+% lines in the list. |\dimen@| is used to hold the desired width of
+% reformatted paragraphs.
+%
+% More precisely |\TD@reformat@par| takes care of the last line of
+% the paragraph and the possible |\vbox| containers for vertical
+% material that may follow it. Everything in the paragraph that comes
+% before the last line is handled by |\TD@reformat@lines|.
+% \changes{v\,2.12}{2000/11/11}{\cs{vbox} containers for vertical
+% material are allowed after the last line of a reformatted
+% paragraph. (LH)}
+% \begin{macrocode}
+\def\TD@reformat@par{%
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \ifvbox\z@
+ \bgroup
+ \TD@reformat@par
+ \egroup
+ \unvbox\z@
+ \else\ifnum \prevgraf>\@ne
+ \dimen@=\@totalleftmargin
+ \advance \dimen@ \linewidth
+ \bgroup
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \TD@reformat@lines
+ \hb@xt@\dimen@{\hfill \unhbox\z@ \unskip}%
+ \else
+ \unskip
+ \prevdepth=\TD@prevdepth
+ \box\z@
+ \fi\fi
+ \ifnum \count@=\z@ \else \penalty\count@ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@prevdepth}
+% |\TD@prevdepth| is a macro which is used for storing the value of
+% |\prevdepth| at times where \TeX\ modifies the primitive in unwanted
+% ways. It should always be set globally.
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@begin@tclpar}
+% The |\TD@begin@tclpar| macro is called when a paragraph in a
+% \texttt{tcl} or \texttt{tcl*} environment is about to start. It
+% takes care of setting up things so that the paragraph can later be
+% reformatted using |\TD@reformat@par|, but it also has to make sure
+% that this reformatting doesn't affect the way the paragraph blends
+% in with vertical material before and after it.
+%
+% Reformatting requires that the paragraph is first built in
+% restricted vertical mode, i.e., it has to be built in an explicit
+% |\vbox|. A problem with this is however that it changes the value of
+% |\prevdepth|, which must therefore be explicitly restored.
+% \begin{macrocode}
+\def\TD@begin@tclpar{%
+ \xdef\TD@prevdepth{\the\prevdepth}%
+ \setbox\z@=\vbox\bgroup
+ \color@begingroup
+ \prevdepth=\TD@prevdepth
+ \indent
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@end@tclpar}
+% The |\TD@end@tclpar| macro ends a paragraph begun by
+% |\TD@begin@tclpar|, reformats it (|\TD@reformat@par|), and
+% contributes it to the surrounding vertical list. The |\begingroup|
+% and |\endgroup| are there to sort things out in case the recursion
+% in |\TD@reformat@par| fails to match as intended. The second
+% |\@@par| sees to that the page builder is exercised (without it,
+% several pages may go onto the main vertical list without anything
+% being shipped out).
+% \begin{macrocode}
+\def\TD@end@tclpar{%
+ \@@par
+ \begingroup
+ \skip@=\lastskip
+ \TD@reformat@par
+ \vskip\skip@
+ \endgroup
+ \xdef\TD@prevdepth{\the\prevdepth}%
+ \color@endgroup
+ \egroup
+ \unvbox\z@
+ \prevdepth=\TD@prevdepth
+ \@@par
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@line@indent}
+% |\TD@line@indent| is a |\count| register holding the indentation of
+% the current line, in number of spaces. |\TD@line@indent| should
+% always be assigned globally.
+% \begin{macrocode}
+\newcount\TD@line@indent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@par@setup}
+% This macro sets up various paragraph formatting parameters for the
+% normal mode. It mainly consists of code from |\macro@code| of
+% \package{doc}.
+% \begin{macrocode}
+\def\TD@par@setup{%
+% \end{macrocode}
+%
+% In theory a \texttt{tcl} environment should consist of a
+% \texttt{trivlist} environment, but the empty space before and after
+% the environment should not be too large.
+% \begin{macrocode}
+ \topsep\MacrocodeTopsep
+% \end{macrocode}
+%
+% The next parameter we set is |\@beginparpenalty|, in order
+% to prevent a page break before such an environment.
+% \begin{macrocode}
+ \@beginparpenalty\predisplaypenalty
+% \end{macrocode}
+%
+% We then start a |\trivlist|, set |\parskip| back to
+% zero and start an empty |\item|.
+% \changes{ \package{doc} v\,1.9b}{1993/12/03}{Forcing any label
+% from macro env.}
+% \begin{macrocode}
+ \if@inlabel\leavevmode\fi
+ \trivlist
+ \parskip\z@skip
+ \item[]%
+% \end{macrocode}
+% However, the \texttt{trivlist} environment is only started to make
+% standard \LaTeX\ happy (and to have the various list-related
+% measurements properly calculated). Everything below will instead
+% by done with \TeX\ primitives.
+% \changes{ \package{pasdoc} v\,1.31}{1999/09/02}{\cs{parshape}
+% assignment added. (LH)}
+% \changes{v\,2.10}{2000/10/08}{\cs{parshape} assignment removed (now
+% done in \cs{TD@begin@tclpar}). (LH)}
+%
+% It is important that the change to a special font does not take
+% place before the above |\item|, otherwise a change to
+% |\baselineskip| will affect the paragraph above.
+% \begin{macrocode}
+ \macro@font
+ \frenchspacing
+% \end{macrocode}
+%
+% \leavevmode
+% \changes{v\,2.12}{2000/11/11}{Assignment to \cs{TD@backslash@box}
+% moved from \cs{TD@typography} to here, so that the size will be
+% right. (LH)}^^A
+% One escape symbol that is particularly common is a single
+% backslash, and this is stored in the |\TD@backslash@box| box. As
+% some encodings (e.g.\ \texttt{OT1}) does not contain a backslash,
+% these escape backslashes are made with |\textbackslash|, rather
+% than an explicit character.
+% \begin{macrocode}
+ \sbox\TD@backslash@box{\TD@nontcl@font\textbackslash}%
+% \end{macrocode}
+%
+% The |\rightskip| is given a generous stretchability of |\linewidth|
+% so that it doesn't matter too much if the lengths of lines in the
+% paragraph varies. Decreasing this value would make the nesting in
+% the code less important.
+% \begin{macrocode}
+ \parindent=\@totalleftmargin
+ \advance \parindent \MacroIndent
+ \leftskip=\z@skip
+ \rightskip=\z@ \@plus \linewidth\relax
+% \end{macrocode}
+% The next two lines are from the definition of the
+% \texttt{macrocode} environment, and I (LH) have no idea what they are
+% good for, but I suppose I can keep them, at least for now.
+% \begin{macrocode}
+ \global\@newlistfalse
+ \global\@minipagefalse
+% \end{macrocode}
+% \changes{ \package{pasdoc} v\,1.31}{1999/09/02}{Made list
+% environments indent line numbers. (LH)}
+% Line numbers are inserted using |\everypar|.
+% \begin{macrocode}
+ \ifcodeline@index
+ \everypar={\llap{\PrintCodelineNo\ }}%
+ \else
+ \everypar={}%
+ \fi
+% \end{macrocode}
+%
+% These commands replace \package{doc}'s final module processing
+% macros with macros that work in the \texttt{tcl} environment.
+% \begin{macrocode}
+ \let\pm@module=\TD@pm@module
+ \let\star@module=\TD@star@module
+ \let\slash@module=\TD@slash@module
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@setup@parshape}
+% This macro sets the shape of the current paragraph, primarily based
+% on the value in |\TD@line@indent|, and makes the final indentation
+% of the first line. By the time it gets called, there usually already
+% is some material (|\indent|, codeline number, and possibly a
+% \package{docstrip} guard) in the paragraph horizontal list.
+%
+% The basic area in which the paragraph material is to be put has a
+% left margin at |\@totalleftmargin|${}+{}$|\MacroIndent| and a right
+% margin at |\@totalleftmargin|${}+{}$|\linewidth| (in both cases the
+% position is that much to the right of the left edge of the galley).
+% The printed codeline number (if there is one) will be put to the
+% left of the left margin, but all other material is indented at least
+% the width of another |\TD@line@indent| spaces. In the first line
+% that will be done through an explicit kern, but in subsequent lines
+% it will instead be done through a |\parshape| assignment. On these
+% subsequent lines, there will be an additional indentation of\/
+% $1\,\mathrm{em}$ to mark the continuation.
+%
+% When the paragraph is broken, the right margin will be moved to the
+% right by the width of a space minus the width of the
+% |\TD@backslash@box|. The reason for this is that the paragraph will
+% be broken with spaces (from |\TD@breakable@space|) at the end of
+% lines, but that these spaces will later be replaced by the
+% backslash in |\TD@backslash@box|. As that doesn't happen in the
+% very last line of the paragraph however, something special must be
+% done there. The option chosen is to give the |\parfillskip| a
+% nonzero natural width.
+%
+% The length |\@totalleftmargin|${}+{}$|\MacroIndent| is put in
+% |\parindent| at the beginning of the environment.
+% \begin{macrocode}
+\def\TD@setup@parshape{%
+ \parfillskip=\fontdimen\tw@\font \@plus 1fil%
+ \advance \parfillskip -\wd\TD@backslash@box
+ \dimen@=\MacroIndent
+ \advance \dimen@ \TD@line@indent\fontdimen\tw@\font
+ \advance \dimen@ 1em%
+ \dimen@ii=\linewidth
+ \advance \dimen@ii -\dimen@
+ \dimen4=\linewidth
+ \advance \dimen@ \@totalleftmargin
+ \advance \dimen4 \@totalleftmargin
+ \advance \dimen@ii -\parfillskip
+ \advance \dimen4 -\parfillskip
+ \parshape \tw@ \z@ \dimen4 \dimen@ \dimen@ii
+% \end{macrocode}
+% Then one just needs one more kern to indent the first line
+% properly.
+% \begin{macrocode}
+ \kern \TD@line@indent\fontdimen\tw@\font
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@trace@pardimen}
+% This macro is for tracing dimens that are of interest for paragraph
+% breaking. Its call syntax is
+% \begin{quote}
+% |\TD@trace@pardimen|\marg{text}\marg{dimen}
+% \end{quote}
+% where \meta{text} will be written to the log file to identify the
+% dimension, and \meta{dimen} is the dimen register in question (it
+% can be anything that can appear after |\the|).
+%
+% To reduce the amount of text written, this macro only does anything
+% if the \TeX\ parameter |\tracingparagraphs| is positive.
+% \begin{macrocode}
+%<*partrace>
+\def\TD@trace@pardimen#1#2{%
+ \ifnum \tracingparagraphs>\z@
+ \immediate\write\m@ne{#1 \the#2}%
+ \fi
+}
+%</partrace>
+% \end{macrocode}
+% \changes{ \package{pasdoc} v\,1.21}{1999/08/15}{Added macro and
+% some calls of it. All of those are however surrounded by
+% \texttt{partrace} guards. (LH)}
+% \end{macro}
+%
+%
+%
+% \subsection{User interface}
+%
+% This subsection defines the actual environment and the
+% commands and parameters intended to be user-definable.
+%
+%
+% \begin{macro}{\settabsize}
+% \changes{v\,2.12}{2000/11/09}{New command for setting the tab size.
+% (LH)}
+% \begin{macro}{\TD@tab@size}
+% \changes{v\,2.12}{2000/11/09}{New name for \cs{c@tabSize}; no longer a
+% count register. (LH)}
+% The |\TD@tab@size| control sequence stores (as a |\chardef| token)
+% the number of spaces that are equivalent to one tab; the default
+% value is 8. To set this number, one uses the command |\settabsize|,
+% which has the syntax
+% \begin{quote}
+% |\settabsize|\marg{new size}
+% \end{quote}
+% The effect of |\settabsize| is local.
+% \begin{macrocode}
+\newcommand*\settabsize[1]{\chardef\TD@tab@size=#1\relax}
+\settabsize{8}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{environment}{tcl}
+% \begin{environment}{tcl*}
+% This is some kind of a definition. There are aspects of the
+% interaction with \texttt{trivlist} that I (LH) don't understand,
+% but it appears to work.
+% \begin{macrocode}
+\newenvironment{tcl}{%
+ \TD@general
+ \TD@typography
+ \TD@par@setup
+ \TD@command
+}{%
+ \global\@inlabelfalse
+ \endtrivlist
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newenvironment{tcl*}{%
+ \TD@visible@whitespace
+ \TD@general
+ \TD@typography
+ \TD@par@setup
+ \TD@command
+}{%
+ \global\@inlabelfalse
+ \endtrivlist
+}
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+% \begin{macro}{\tclverb}
+% \begin{macro}{\TD@verb}
+% The |\tclverb| macro is for typesetting short passages of \Tcl\ code
+% which one does not want to have a special paragraph for. It is
+% similar to the standard \LaTeX\ command |\verb|, but it has a couple
+% of extra features. One is that spaces that are not followed by more
+% whitespace are discretionary breakpoints, just as in the \texttt{tcl}
+% environment. Another is that a newline can be escaped by putting a
+% backslash at the end of an input line. Such an escaped newline will
+% count as a space, and whitespace at the beginning of the line
+% following it will be ignored. A percent character immediately
+% following an escaped newline will also be ignored.
+%
+% |\tclverb| has a |*| form |\tclverb*|, which is analogous to the
+% standard \LaTeX\ |\verb*|, i.e., spaces are typeset using ``visible
+% space'' symbols.
+% \begin{macrocode}
+\newcommand\tclverb{%
+ \relax\ifmmode\hbox\else\leavevmode\null\fi
+ \bgroup
+ \@ifstar{\TD@visible@whitespace\TD@verb}\TD@verb
+}
+% \end{macrocode}
+% \DoNotIndex{\ ,\^,\\}
+% \begin{macrocode}
+\def\TD@verb{%
+ \let\TD@active@backslash@i=\TD@active@backslash@v
+ \let\TD@active@CR=\TD@active@CRv
+ \let\TD@breakable@space=\TD@discretionary@space
+ \TD@general
+ \catcode`\^^I=\active
+ \catcode`\ =\active
+ \catcode`\\=\active
+ \TD@typography
+ \verbatim@font
+ \sbox\TD@backslash@box{\TD@nontcl@font\textbackslash}%
+ \@sverb
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TclInput}
+% The |\TclInput| macro is very much like the standard \LaTeX\
+% |\input|, but it is intended to be used in command mode, for
+% inputting \Tcl\ files that have not been marked up. |\input| would
+% work in this case, but there would be errors at the first and last
+% lines of the |\input|ted file.
+% \begin{macrocode}
+\newcommand\TclInput[1]{%
+ \IfFileExists{#1}{%
+ \@addtofilelist{#1}%
+ \begingroup
+ \TD@normal
+ \let\TD@start@n@line=\TD@start@n@line@i
+ \expandafter\TD@start@n@line
+ \@@input\@filef@und\TD@percent@token
+ \endgroup
+ }{\PackageError{tcldoc}{No file #1}\@eha}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeShortTclverb}
+% This definition follows \package{doc}'s |\MakeShortVerb| pretty
+% close.
+% \DoNotIndex{\~}
+% \begin{macrocode}
+\newcommand\MakeShortTclverb[1]{%
+ \expandafter\ifx \csname cc\string#1\endcsname\relax
+ \PackageInfo{tcldoc}{%
+ Made \expandafter\@gobble\string#1 a short %
+ reference for \string\tclverb}%
+ \add@special{#1}%
+ \expandafter\xdef \csname cc\string#1\endcsname{\the\catcode`#1}%
+ \begingroup
+ \lccode`\~=`#1%
+ \lowercase{%
+ \global\expandafter\let
+ \csname ac\string#1\endcsname ~%
+ \gdef~{\tclverb~}}%
+ \endgroup
+ \global\catcode`#1\active
+ \else
+ \PackageInfo{tcldoc}{%
+ \expandafter\@gobble\string#1 already a short verb %
+ reference}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Miscellaneous markup features}
+%
+% \subsection{Namespaces}
+%
+% \changes{v\,2.10}{2000/10/13}{Added namespace support. (LH)}
+%
+% \begin{macro}{\setnamespace}
+% \begin{macro}{\TD@namespace}
+% Since it is common that many identifiers in the same namespace are
+% defined in sequence, one can specify a default namespace to use for
+% all commands where no explicit namespace is given. This is done
+% using the |\setnamespace| command, whose syntax is
+% \begin{quote}
+% |\setnamespace|\marg{namespace}
+% \end{quote}
+% This converts the \meta{namespace} to a harmless character string
+% and locally assigns it to the |\TD@namespace| macro, which stores
+% the current default namespace.
+% \begin{macrocode}
+\newcommand\setnamespace[1]{\MakeHarmless\TD@namespace{#1}}
+% \end{macrocode}
+% At the beginning of a document, the default namespace is the global
+% namespace, which is represented by the empty string.
+% \begin{macrocode}
+\let\TD@namespace\@empty
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\buildname}
+% \changes{v\,2.13}{2000/12/16}{Added \cs{@empty} after test for
+% \cs{NoValue}, so that it works for empty arguments. (LH)}
+% \begin{macro}{\namespacesepator}
+% \changes{v\,2.12}{2000/11/25}{Command added. (LH)}
+% The |\buildname| macro builds a qualified name from a namespace and
+% a name tail. It has the syntax
+% \begin{quote}
+% |\buildname|\marg{namespace}\marg{name}
+% \end{quote}
+% where \meta{name} is a harmless character sequence and
+% \meta{namespace} is a harmless character sequence or the token
+% |\NoValue|. If \meta{namespace} is |\NoValue| then the default
+% namespace is used. |\buildname| does all processing at expand-time.
+%
+% If the namespace is the empty string (the global namespace) then
+% \meta{name} is returned without a `|::|' prefix; this is for the
+% sake of compatibility with pre-v\,8 \Tcl s.
+% \begin{macrocode}
+\newcommand\buildname[2]{%
+ \ifx \NoValue#1\@empty
+ \ifx \@empty\TD@namespace \else
+ \TD@namespace\namespaceseparator
+ \fi
+ \else
+ \ifx $#1$\else #1\namespaceseparator \fi
+ \fi
+ #2%
+}
+% \end{macrocode}
+% The |\namespaceseparator| command typesets a namespace separator. By
+% default it is two colons separated by a penalty, but the user may
+% redefine it.
+% \begin{macrocode}
+\DeclareRobustCommand\namespaceseparator{:\penalty\hyphenpenalty:}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \subsection{\texttt{macro}-like environments}
+%
+% This subsection contains the definitions of a couple of environments
+% which, like \package{doc}'s \texttt{macro}, are for marking up the
+% document (what is defined and where). These environments are defined
+% using the |\New|\-|Macro|\-|Environment| command of the \package{xdoc2}
+% package.
+% \changes{ \package{pasdoc} v\,1.40}{1999/12/05}{\texttt{macro}-like
+% environments redefined. (LH)}
+% \changes{v\,2.00}{2000/07/17}{\texttt{macro}-like environments are
+% defined using the \cs{NewMacroEnvironment} command. The
+% \cs{TD@identifier}, \cs{SpecialMainTclIndex}, and
+% \cs{PrintTclName} macros were removed. (LH)}
+% \changes{v\,2.12}{2000/11/26}{Using starred form of
+% \cs{NewMacroEnvironment} for the \texttt{variable}, \texttt{proc},
+% \texttt{arrayvar}, and \texttt{arrayentry} environments, so that
+% the marginal headings can be broken. (LH)}
+%
+%
+% \begin{environment}{variable}
+% The \texttt{variable} environment has the syntax
+% \begin{quote}
+% |\begin{variable}|\oarg{namespace}\marg{variable}
+% \end{quote}
+% It makes a marginal heading, index entry, etc.\@ for the
+% \meta{variable} variable in the \meta{namespace} namespace
+% (if specified, otherwise in the default namespace).
+% \begin{macrocode}
+\NewMacroEnvironment*{variable}%
+ {\XD@grab@harmless@oarg\XD@grab@harmless\relax}{2}%
+ {\XDParToMargin{\MacroFont\buildname{#1}{#2} \normalfont (var.)}}%
+ {\TD@main@index{#1}{#2}{var.}{}}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} variable}}
+ {}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{proc}
+% The \texttt{proc} environment has the syntax
+% \begin{quote}
+% |\begin{proc}|\oarg{namespace}\marg{proc}
+% \end{quote}
+% It makes a marginal heading, index entry, etc.\@ for the \meta{proc}
+% procedure in the \meta{namespace} namespace (if specified, otherwise
+% in the default namespace).
+% \begin{macrocode}
+\NewMacroEnvironment*{proc}%
+ {\XD@grab@harmless@oarg\XD@grab@harmless\relax}{2}%
+ {\XDParToMargin{\MacroFont\buildname{#1}{#2} \normalfont (proc)}}%
+ {\TD@main@index{#1}{#2}{proc}{}}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} proc}}
+ {}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{arrayvar}
+% \changes{v\,2.00}{2000/07/17}{Environment added. (LH)}
+% \changes{v\,2.12}{2000/11/09}{Made last argument optional. (LH)}
+% \changes{v\,2.13}{2000/12/15}{Not using \cs{meta} for the
+% \meta{index-des} argument. (LH)}
+% \begin{environment}{arrayentry}
+% \changes{v\,2.02}{2000/08/21}{Environment added. (LH)}
+% The \texttt{arrayvar} and \texttt{arrayentry} environments are for
+% array variables; \texttt{arrayvar} is for the array as a whole,
+% whereas \texttt{arrayentry} is for individual entries in the array
+% that (for some reason) are important enough to warrant special
+% attention. The respective syntaxes are
+% \begin{quote}
+% |\begin{arrayvar}|\oarg{namespace}\marg{array}\oarg{index-des}\\
+% |\begin{arrayentry}|\oarg{namespace}\marg{array}\marg{entry}
+% \end{quote}
+% Here \meta{array} is the name of an array variable, \meta{entry} is
+% the name of an entry, and \meta{index-des} is a short piece of text
+% (seldom more than one word) which describes what is used as indices
+% into that array.
+% \begin{macrocode}
+\NewMacroEnvironment*{arrayvar}{%
+ \XD@grab@harmless@oarg\XD@grab@harmless\relax\XD@grab@harmless@oarg
+}{3}%
+ {\XDParToMargin{\MetaNormalfont\MacroFont \buildname{#1}{#2}%
+ \ifx \NoValue#3%
+ \space\normalfont (array)%
+ \else
+ \penalty\hyphenpenalty(\mbox{\meta@font@select#3})%
+ \fi
+ }}%
+ {\TD@main@index{#1}{#2}{array}{%
+ \ifx \NoValue#3\else
+ \LevelSorted{#3}{\protect\mbox{\textit{#3}} entries}%
+ \fi
+ }}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} array}}
+ {}%
+% \end{macrocode}
+% \begin{macrocode}
+\NewMacroEnvironment*{arrayentry}{%
+ \XD@grab@harmless@oarg\XD@grab@harmless\relax\XD@grab@harmless\relax
+}{3}%
+ {\XDParToMargin{%
+ \MetaNormalfont\MacroFont \buildname{#1}{#2}%
+ \penalty\hyphenpenalty(#3)%
+ }}%
+ {\TD@main@index{#1}{#2}{array}{\LevelSorted{#3}{\texttt{#3}}}}%
+ {{\buildname{#1}{#2}(#3)}{\texttt{\buildname{#1}{#2}(#3)}}}
+ {}%
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+% \begin{macro}{\describestring}
+% \changes{v\,2.01}{2000/08/12}{Command added. (LH)}
+% \changes{v\,2.12}{2000/11/21}{Optional argument added. (LH)}
+% \changes{v\,2.13}{2000/12/16}{Second optional argument added. (LH)}
+% The |\describestring| command has the syntax
+% \begin{quote}
+% |\describestring|\oarg{type}\oarg{namespace}\marg{string}
+% \end{quote}
+% It is similar to \package{xdoc}'s own |\describe|\-|cs|\-|family|
+% command, but it has a couple of extra features which are connected
+% to the optional arguments and it doesn't prepend a backslash to
+% the name of the thing being described. When the \meta{type} argument
+% is present, it is taken as a ``type declaration'' of the
+% \meta{string} being described and `(\meta{type})' will be put as a
+% suffix to the \meta{string}. When the \oarg{namespace} argument is
+% present it means that the string being described is really the name
+% of something (e.g.\ a procedure or variable) which exists in a
+% namespace, and the complete name is formed by passing both
+% \meta{namespace} and \meta{string} as arguments to |\buildname|.
+% Note that an empty \meta{namespace} argument is not quite the
+% same thing as no \meta{namespace} argument.
+% \begin{macrocode}
+\NewDescribeCommand{\describestring}{%
+ \XD@grab@oarg\XD@grab@harmless@oarg\XD@grab@harmless{}%
+}{3}{%
+ \GenericDescribePrint{%
+ \MetaNormalfont\MacroFont
+ \ifx \NoValue#2\@empty
+ #3%
+ \else
+ \buildname{#2}{#3}%
+ \fi
+ \ifx \NoValue#1\@empty \else\ \normalfont(#1)\fi
+ }%
+ \begingroup
+ \def\meta##1{(##1)}%
+ \unrestored@protected@xdef\@gtempa{%
+ #3\ifx \NoValue#2\@empty \else\ifx $#2$\else, #2\fi\fi
+ }%
+ \endgroup
+ \IndexEntry{%
+ \LevelSorted{\@gtempa}{%
+ \texttt{%
+ \ifx \NoValue#2\@empty
+ \protect\MetaNormalfont#3%
+ \else
+ \buildname{#2}{#3}%
+ \fi
+ }%
+ \ifx \NoValue#1\@empty \else\space(#1)\fi
+ }%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@main@index}
+% \changes{v\,2.10}{2000/10/14}{Generalized macro. (LH)}
+% \changes{v\,2.12}{2000/11/25}{Sorting by base name first, not by
+% namespace first. (LH)}
+% The |\TD@main@index| macro has the syntax
+% \begin{quote}
+% |\TD@main@index|\marg{namespace}\marg{name}\marg{type}^^A
+% \marg{extra}
+% \end{quote}
+% It makes a \texttt{main} index entry. The top level of this entry
+% is like an entry for the \meta{name} object of type \meta{type} in
+% the \meta{namespace} namespace. The entry may have one or more
+% sublevels\footnote{But no more than one extra level is recommended,
+% as this macro is intended to be redefinable to make a two-level
+% entry by default and \package{makeindex} can handle at most three
+% levels.} specified in the \meta{extra}; these are then made using
+% explicit |\LevelSame| or |\LevelSorted| commands. \meta{name} and
+% \meta{namespace} are as for the |\buildname| macro, whereas
+% \meta{type} is a description, e.g. `\texttt{proc}', that gets
+% appended to the printed text of the entry's top level.
+% \begin{macrocode}
+\def\TD@main@index#1#2#3#4{%
+ \XDMainIndex{%
+ \LevelSorted{%
+ #2%
+ \ifx \NoValue#1%
+ \ifx \@empty\TD@namespace \else , \TD@namespace\fi
+ \else
+ \ifx $#1$\else , #1\fi
+ \fi
+ }{\texttt{\buildname{#1}{#2}} (#3)}%
+ #4%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Regular expressions and friends}
+%
+% I have noticed that when one is describing the syntax of some \Tcl\
+% command\slash procedure, one often ends up writing argument lists with
+% lots of optional, repeated, or variant parts. In general one can of
+% course specify these using BNF syntax diagrams, but whereas occurrences
+% of the three syntactic constructions mentioned above are plenty,
+% there are much fewer occurrences of for example nesting. Since
+% furthermore even the simplest optional or repeated element
+% requires an extra syntactic term to be defined, it becomes interesting
+% to search for an alternative way of specifying these constructions.
+% One that is close at hand is that of regular expressions, as that is
+% anyway a part of the \Tcl\ language.
+%
+% \begin{macro}{\regstar}
+% \begin{macro}{\regplus}
+% \begin{macro}{\regopt}
+% These commands are used to modify the meaning of another syntactic
+% element. |\regstar| puts a star $^*$ on something, meaning it is
+% repeated zero or more times. |\regplus| puts a plus $^+$ on
+% something, meaning it is repeated one or more times. |\regopt| puts
+% a question mark $^?$ on something, meaning it is optional. Normally
+% these commands are simply put right after what they should modify,
+% but if the ``something'' is a regular expression block, i.e., a
+% \texttt{regexp} environment, then these things should be put as the
+% \meta{modifier} in
+% \begin{quote}
+% |\begin{regexp}|\oarg{modifier}\\
+% | |\textellipsis\\
+% |\end{regexp}|
+% \end{quote}
+% In particular, they should \emph{not} be put after the
+% |\end{regexp}|, as that may impair the placement of the exponent.
+% \begin{macrocode}
+\newcommand\regstar{\ensuremath{^*}}
+\newcommand\regplus{\ensuremath{^+}}
+\newcommand\regopt{\ensuremath{^?}}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\TD@delim@size}
+% \begin{macro}{\TD@delim@size@G}
+% These control sequences are used in determining what size the
+% delimiters (parentheses) around a regular expression block should
+% have. The values specify what should be the least size of a
+% delimiter that bracket a piece of text, and are interpreted as
+% follows: \(0={}\)normal size, \(1={}\)|\big| size, \(2={}\)|\Big|
+% size, \(3={}\)|\bigg| size, and $4$ and above is |\Bigg| size.
+%
+% |\TD@delim@size@G| is a macro which is always set globally and
+% which keeps track of the delimiter size at the innermost level.
+% |\TD@delim@size| is a |\count| register that is assigned locally
+% and is used for keeping track of delimiter sizes at all other
+% levels. Commands like |\word|, which contribute a delimiter to some
+% piece of text, should set |\TD@delim@size@G|.
+% \begin{macrocode}
+\newcount\TD@delim@size
+\gdef\TD@delim@size@G{0}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{environment}{regexp}
+% The \texttt{regexp} environment embarks upon a rather tricky scheme
+% of boxing and unboxing to determine the proper delimiter size. The
+% basic idea is that the contents of the environment are first typeset
+% in an \texttt{lrbox} environment, and |\TD@delim@size@G| is set to
+% its proper value. Then the left delimiter is set at this size, the
+% saved box is unboxed, and finally the right delimiter is set. All
+% through the process, the value of |\TD@delim@size@G| at the
+% beginning of the \texttt{regexp} environment has been saved in
+% |\TD@delim@size| and at the end |\TD@delim@size@G| is set to the
+% maximum of its old value and one plus its value inside the
+% \texttt{regexp} environment. This makes it possible to nest
+% \texttt{regexp} environments.
+%
+% It is not quite that easy, though. A regular expression can consist
+% of several branches, which must be separated by vertical bars.
+% These bars should be the same size as the delimiters around the
+% regular expression, and hence the bars cannot be typeset before
+% every branch has been typeset. Therefore the \texttt{regexp}
+% environment starts an extra horizontal list (the |\hbox|) for the
+% sole purpose of storing the branches that have already been typeset
+% (and \emph{only} these). Each branch is put on the list as a box.
+% When all branches have been typeset, they are first removed from the
+% list (by |\TD@join@branches|), and then they are inserted again, but
+% this time they are unboxed and separated by suitable delimiters.
+% Finally the |\hbox| is ended and almost immediately unboxed.
+%
+% \begin{macrocode}
+\newenvironment{regexp}[1][]{%
+ \leavevmode
+ \def\TD@modifier{#1}%
+ \TD@delim@size=\TD@delim@size@G
+ \let\regalt=\TD@regalt
+ \setbox\z@=\hbox\bgroup
+ \TD@delim@size=\z@
+ \begin{lrbox}{\z@}%
+ \gdef\TD@delim@size@G{0}%
+ \ignorespaces
+}{%
+ \end{lrbox}%
+ \ifnum \TD@delim@size@G>\TD@delim@size
+ \TD@delim@size=\TD@delim@size@G\relax
+ \fi
+ {\TD@join@branches}%
+ \unhbox\z@
+ $\TD@size@delimiter)\TD@modifier$%
+ \advance \TD@delim@size \@ne
+ \xdef\TD@delim@size@G{\the\TD@delim@size}%
+ \egroup
+ \ifnum \TD@delim@size@G<\TD@delim@size
+ \xdef\TD@delim@size@G{\the\TD@delim@size}%
+ \fi
+ \unhbox\z@
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\TD@join@branches}
+% \changes{v\,2.12}{2000/11/13}{Made penalty for linebreak after
+% \cs{regalt} depend on the delimiter size. (LH)}
+% The |\TD@join@branches| macro uses |\lastbox| to retrieve all boxes
+% in the current horizontal list, and unboxes them. Between the
+% unboxed boxes it puts a |\vert| delimiter, and before the first it
+% puts a left parenthesis. Both will be the current delimiter size.
+% \begin{macrocode}
+\def\TD@join@branches{%
+ \setbox\z@=\lastbox
+ \ifvoid\z@
+ $\TD@size@delimiter($%
+ \else
+ {\TD@join@branches}%
+ \unhbox\z@
+ ~$\TD@size@delimiter\vert$%
+ \count@=\TD@delim@size
+ \advance \count@ \@ne
+ \multiply \count@ -\@lowpenalty
+ \penalty\count@\ %
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\regalt}
+% \begin{macro}{\TD@regalt}
+% The |\regalt| command is used in a \texttt{regexp} environment
+% to separate two branches. It ends an \texttt{lrbox} environment,
+% puts the box collected in the surrounding horizontal list (which
+% was begun by the |\hbox| in |\lrbox|), and begins a new
+% \texttt{lrbox} environment. As this would not make sense outside a
+% \texttt{regexp} environment however, the |\regalt| command does by
+% default only produce an error message. The ``real'' definition is
+% kept in |\TD@regalt| and the \texttt{regexp} environment locally
+% redefines |\regalt|.
+% \begin{macrocode}
+\newcommand\regalt{%
+ \PackageError{tcldoc}{%
+ Lonely \protect\regalt--perhaps a missing regexp environment%
+ }\@eha
+}
+\def\TD@regalt{%
+ \end{lrbox}%
+ \box\z@
+ \ifnum \TD@delim@size@G>\TD@delim@size
+ \TD@delim@size=\TD@delim@size@G\relax
+ \fi
+ \begin{lrbox}{\z@}%
+ \gdef\TD@delim@size@G{0}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@size@delimiter}
+% This macro expands to nothing, |\big|, |\Big|, |\bigg|, or |\Bigg|
+% depending on the value of |\TD@delim@size|.
+% \begin{macrocode}
+\def\TD@size@delimiter{%
+ \ifcase\TD@delim@size
+ \or \expandafter\big \or \expandafter\Big \or
+ \expandafter\bigg \else \expandafter\Bigg
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\word}
+% \changes{v\,2.10}{2000/10/13}{Reimplemented like the new \cs{meta}.
+% (LH)}
+% \changes{v\,2.12}{2000/11/21}{Using braces instead of angle brackets.
+% (LH)}
+% This command works like |\meta|, but the argument is enclosed in
+% braces rather than angle brackets and it communicates with the
+% \texttt{regexp} environment (the braces count as a smallest-size
+% delimiter). Something marked out using |\word| rather than |\meta|
+% is meant to always denote a separate \Tcl\ word.
+% \begin{macrocode}
+\DeclareRobustCommand\word[1]{%
+ \leavevmode
+ \ifmmode \expandafter \nfss@text \fi
+ {%
+ $\{$%
+ \meta@font@select
+ \edef\meta@hyphen@restore
+ {\hyphenchar\the\font\the\hyphenchar\font}%
+ \hyphenchar\font\m@ne
+ \language\l@nohyphenation
+ #1\/%
+ \meta@hyphen@restore
+ $\}$%
+ }%
+ \ifnum \TD@delim@size@G<\@ne \gdef\TD@delim@size@G{1}\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Logos}
+%
+% \begin{macro}{\Tcllogo}
+% \changes{v\,2.03}{2000/09/15}{Macro added. (LH)}
+% The |\Tcllogo| command makes a \Tcl\ ``logo'', which simply consists
+% of the three letters `T', `c', and `l' in the current font. The only
+% special thing about it is that there is a kern between the `T' and
+% the `c', since most fonts doesn't have that kern. No work has been
+% put into tuning the kern, but the size is about right. As a
+% comparison the kern between `T' and `o' in \texttt{cmr10} is
+% $-0.083334\,\mathrm{em}$.
+% \begin{macrocode}
+\DeclareRobustCommand\Tcllogo{T\kern-0.1em cl}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v\,2.03}{2000/09/15}{\cs{DescribeResource} command removed.
+% Just in case anyone is interested in using it, I have included it as
+% a code example in the source for the \package{xdoc} package. (LH)}
+%
+%
+% \section{The \package{tcldoc} class}
+%
+% \subsection{Pre-options definitions}
+%
+% \begin{macro}{\if@rtkinenc@}
+% Switch. True iff the \package{rtkinenc} package should be loaded.
+% It starts out false.
+% \begin{macrocode}
+%<*class>
+\newif\if@rtkinenc@
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Option declarations and processing}
+%
+% \begin{option}{a5paper}
+% \begin{option}{olddocinclude}
+% The \texttt{a5paper} (to the \package{article} document class) and
+% the \texttt{olddocinclude} (to the \package{xdoc} package) are not
+% supported for the \package{tcldoc} class.
+% \begin{macrocode}
+\DeclareOption{a5paper}{%
+ \ClassError{tcldoc}{The a5paper option is not supported}\@eha
+}
+\DeclareOption{olddocinclude}{%
+ \ClassError{tcldoc}{The olddocinclude option is not supported}\@eha
+}
+% \end{macrocode}
+% \end{option}\end{option}
+%
+% \begin{option}{macinputenc}
+% The \texttt{macinputenc} option enables some special code for
+% supporting the typesetting of \Tcl\ code written for the Macintosh
+% input encoding (cf.\ the \texttt{applemac} option to the
+% \package{inputenc} package).
+% \begin{macrocode}
+\DeclareOption{macinputenc}{%
+ \PassOptionsToPackage{applemac}{rtkinenc}%
+ \@rtkinenc@true
+}
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassOptionsToClass{\CurrentOption}{article}}
+% \end{macrocode}
+%
+%
+%
+% Input a local configuration file, if it exists.
+% \begin{macrocode}
+\InputIfFileExists{tcldoc.cfg}
+ {\typeout{*************************************^^J%
+ * Local config file tcldoc.cfg used^^J%
+ *************************************}}
+ {}
+% \end{macrocode}
+%
+%
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Loading the base class}
+%
+% \begin{macrocode}
+\LoadClass{article}
+% \end{macrocode}
+%
+%
+% \subsection{Input encoding and font representations}
+%
+% There are some rather tricky issues concerning interpretation of the
+% input in \Tcl\ code. If the |\MacroFont| font contains a character that
+% correctly represents a character in the input, then that character is
+% obviously what one would like to appear in the typeset output. If no
+% font in the entire \TeX\ system contains a character that looks like
+% the one in the input, then just as obviously must one examine whether
+% there exists some other method of specifying that character. In the
+% case of \Tcl\ code, a suitable method seems to be to typeset the
+% equivalent |\x|\meta{dd} escape sequence instead. It is for the
+% purpose of being able to detect these cases that the \package{tcldoc}
+% class (if the user so requests) loads the \package{rtkinenc} package,
+% rather than the standard \LaTeX\ \package{inputenc} package.
+%
+% The problem of determining for each input character which method of
+% representation that should be used---single character or escape
+% sequence---does not have a unique solution. Therefore the default
+% set-up is to not define any special fakes at all, which means the
+% escape sequence method will be chosen in the doubtful cases. There are
+% also a couple of options for the \package{tcldoc} class that define
+% all (or nearly all) possible fakes---the difference between them lie
+% in which fonts are assumed to be present in the system. A user who
+% does not like any of these predefined options also has the option of
+% putting the corresponding |\Declare|\-|Text|\-|Default|\textellipsis
+% \ commands directly into the \texttt{tcldoc.cfg} file.
+%
+% \begin{macrocode}
+\if@rtkinenc@
+ \RequirePackage{rtkinenc}
+%</class>
+% \end{macrocode}
+%
+% \begin{macro}{\InputModeCode}
+% \begin{macro}{\SetUnavailableAction}
+% \begin{macro}{\DeclareInputMath}
+% \begin{macro}{\RIE@undefined}
+% The \package{tcldoc} package uses some commands defined by the
+% \package{rtkinenc} package, but since \package{rtkinenc} is not
+% required by the \package{tcldoc} package, the \package{tcldoc}
+% package must provide its own definitions, even though these can be
+% no-ops. Definition of these commands is delayed until
+% |\begin|\nolinebreak[1]|{document}| to avoid problems if the user
+% loads the \package{rtkinenc} package after the \package{tcldoc}
+% package.
+% \begin{macrocode}
+%<*pkg>
+\AtBeginDocument{%
+ \providecommand*\InputModeCode{}%
+ \providecommand*\SetUnavailableAction[1]{}%
+ \providecommand*\DeclareInputMath[2]{}%
+ \providecommand*\RIE@undefined[1]{\@inpenc@undefined}%
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\.}
+% \begin{macro}{\H}
+% \begin{macro}{\textemdash}
+% \begin{macro}{\textendash}
+% \begin{macro}{\textexclamdown}
+% \begin{macro}{\textquestiondown}
+% \begin{macro}{\textquotedblleft}
+% The following text commands are defined by \texttt{OT1enc.def}, but
+% their definitions will not work for \texttt{OT1}-encoded typewriter
+% fonts. Therefore they are redefined, either so that they work
+% anyway (|\textexclamdown| and |\textquestiondown|) or so that they
+% call |\TextSymbolUnavailable| when \package{rtkinenc} is in code
+% mode. This should make things work for the best in most
+% reasonable situations.
+%
+% It could be noted here that the definitions below for |\.| and |\H|
+% does not quite behave as if the commands had not been defined at
+% all (I'm assuming that \package{rtkinenc} is in code mode here); an
+% undefined command would leave its argument to be typeset, but the
+% definitions below will swallow it in those cases.
+% \begin{macrocode}
+%<*class>
+ \DeclareTextCommand{\.}{OT1}[1]{%
+ \IfInputModeCode{\TextSymbolUnavailable\.}%
+ {\add@accent{95}{#1}}%
+ }
+ \DeclareTextCommand{\H}{OT1}[1]{%
+ \IfInputModeCode{\TextSymbolUnavailable\H}%
+ {\add@accent{125}{#1}}%
+ }
+ \DeclareTextCommand{\textemdash}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textemdash}{\char 124 }%
+ }
+ \DeclareTextCommand{\textendash}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textendash}{\char 123 }%
+ }
+ \DeclareTextCommand{\textexclamdown}{OT1}{!`}
+ \DeclareTextCommand{\textquestiondown}{OT1}{?`}
+ \DeclareTextCommand{\textquotedblleft}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textquotedblleft}%
+ {\char 92 }%
+ }
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}
+%
+% Several of the definitions in \texttt{applemac.def} can be improved.
+% Most of it is about seeing to that all characters have a proper text
+% mode definition, so that their unavailability can be trapped.
+%
+% \begin{macrocode}
+ \def\@tempa{applemac}
+ \ifx \@tempa\RIE@encoding
+ \DeclareInputBoth{173}{\textneq}{\neq}
+ \DeclareInputBoth{176}{\textinfty}{\infty}
+ \DeclareInputBoth{177}{\textpm}{\pm}
+ \DeclareInputBoth{178}{\textleq}{\leq}
+ \DeclareInputBoth{179}{\textgeq}{\geq}
+ \DeclareInputBoth{181}{\textmu}{\mu}
+ \DeclareInputBoth{182}{\textpartial}{\partial}
+ \DeclareInputBoth{183}{\textSigma}{\Sigma}
+ \DeclareInputBoth{184}{\textPi}{\Pi}
+ \DeclareInputBoth{185}{\textpi}{\pi}
+ \DeclareInputBoth{186}{\textint}{\int}
+ \DeclareInputBoth{189}{\textohm}{\Omega}
+ \DeclareInputBoth{194}{\textlnot}{\lnot}
+ \DeclareInputBoth{195}{\textsurd}{\surd}
+ \DeclareInputBoth{197}{\textapprox}{\approx}
+ \DeclareInputBoth{198}{\textDelta}{\Delta}
+ \DeclareInputBoth{214}{\textdiv}{\div}
+ \DeclareInputBoth{215}{\textdiamond}{\diamond}
+ \DeclareInputBoth{218}{\textfractionsolidus}{/}
+% \end{macrocode}
+%
+% Several of the above text commands are not defined in the \LaTeX\
+% kernel. Therefore one must either define them in some encoding, or
+% define a default for them, to make them proper text commands. If they
+% are not then their unavailability cannot be trapped. |\textapplelogo|
+% appears in \texttt{applemac.def}.
+% \begin{macrocode}
+ \ProvideTextCommandDefault{\textneq}{%
+ \TextSymbolUnavailable\textneq
+ }
+ \ProvideTextCommandDefault{\textapplelogo}{%
+ \TextSymbolUnavailable\textapplelogo
+ }
+ \DeclareTextSymbol{\textinfty}{OMS}{49}
+ \DeclareTextSymbol{\textpm}{OMS}{6}
+ \DeclareTextSymbol{\textleq}{OMS}{20}
+ \DeclareTextSymbol{\textgeq}{OMS}{21}
+% \DeclareTextSymbol{\textmu}{TS1}{181}
+ \DeclareTextSymbol{\textpartial}{OML}{64}
+ \DeclareTextSymbol{\textSigma}{OT1}{6}
+ \DeclareTextSymbol{\textPi}{OT1}{5}
+ \DeclareTextSymbol{\textpi}{OML}{25}
+ \DeclareTextSymbol{\textint}{OMS}{115}
+ \DeclareTextSymbol{\textohm}{OT1}{10} % Kind of \textOmega
+% \DeclareTextSymbol{\textlnot}{TS1}{172}
+% \DeclareTextSymbol{\textsurd}{TS1}{187}
+ \DeclareTextSymbol{\textapprox}{OMS}{25}
+ \DeclareTextSymbol{\textDelta}{OT1}{1}
+% \DeclareTextSymbol{\textdiv}{TS1}{246}
+ \DeclareTextSymbol{\textdiamond}{OMS}{5}
+% \DeclareTextSymbol{\textfractionsolidus}{TS1}{47}
+ \input{TS1enc.def}
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\let\if@rtkinenc@=\@undefined
+\let\@rtkinenc@true=\@undefined
+\let\@rtkinenc@false=\@undefined
+% \end{macrocode}
+% The |@rtkinenc@| switch isn't needed any more, so it might just as
+% well be undefined.
+%
+%
+% \subsection{The layout}
+%
+% Increase the text width slightly so that with the standard fonts
+% 72 columns of code may appear in a |macrocode| environment.
+% \changes{ \package{ltxdoc} v\,2.0c}{1994/03/15}{Set \cs{textwidth}.}
+% \begin{macrocode}
+\setlength{\textwidth}{355pt}
+% \end{macrocode}
+%
+% Increase the marginpar width slightly, for long command names.
+% And increase the left margin by a similar amount
+% \changes{ \package{ltxdoc} v\,2.0l}
+% {1994/05/25}{Increase \cs{marginparwidth}}
+% \changes{ \package{ltxdoc} v\,2.0q}{1995/11/28}
+% {Increase \cs{marginparwidth} and page margin.}
+% \begin{macrocode}
+\addtolength\oddsidemargin{20pt}
+\addtolength\evensidemargin{20pt}
+% \end{macrocode}
+%
+%
+% Change some defaults for list formatting. In particular, continue to
+% indent paragraphs in |\list| environments and don't put extra space
+% between them.
+% \changes{ \package{pasdoc} v\,1.30}{1999/08/31}{Modifying the list
+% formatting. (LH)}
+%
+% \begin{macro}{\TD@list}
+% \begin{macro}{\@listi}
+% \begin{macro}{\@listI}
+% \begin{macro}{\@listii}
+% \begin{macro}{\@listiii}
+% \begin{macro}{\@listiv}
+% \begin{macro}{\@listv}
+% \begin{macro}{\@listvi}
+% \begin{macrocode}
+\def\@tempa#1{%
+ \expandafter\def \expandafter#1\expandafter{#1\TD@list}%
+}
+\def\TD@list{%
+ \advance \itemsep \parsep
+ \parsep=\z@\@plus\p@\relax
+ \advance \itemsep -\parsep
+ \listparindent=1em\relax
+}
+\@tempa\@listi
+\let\@listI\@listi
+\@tempa\@listii
+\@tempa\@listiii
+\@tempa\@listiv
+\@tempa\@listv
+\@tempa\@listvi
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}\end{macro}
+%
+%
+% \subsection{Loading the \package{tcldoc} package}
+%
+% \begin{macrocode}
+\RequirePackage[dolayout]{tcldoc}
+% \end{macrocode}
+%
+% \begingroup
+% Make \verb+|+ be a `short verb' character, but not in the document
+% preamble, where an active character may interfere with packages that
+% are loaded.
+% \DoNotIndex{\|}
+% \begin{macrocode}
+\AtBeginDocument{\MakeShortTclverb{\|}}
+% \end{macrocode}
+% \endgroup
+%
+% As \texttt{.dtx} documents tend to have a lot of monospaced material,
+% set up some \texttt{cmtt} substitutions to occur silently.
+% \changes{ \package{ltxdoc} v\,2.0p}{1995/11/02}{Add font substitutions}
+% \begin{macrocode}
+\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{}
+\DeclareFontFamily{OMS}{cmtt}{\skewchar\font'60}
+\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{}
+\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{}
+% \end{macrocode}
+% This substitution is in the standard fd file, but not silent.
+% \begin{macrocode}
+\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{}
+% \end{macrocode}
+%
+%
+% \subsection{More layout}
+%
+% \changes{v\,2.12}{2000/11/26}{Setting \cs{marginparwidth} so that the
+% outer edge of the marginpar is $1\,\mathrm{cm}$ from the paper
+% edge. (LH)}
+% \changes{v\,2.12}{2000/11/27}{Rearranged code so that
+% the \cs{marginparwidth} is set after \package{tcldoc} has been
+% loaded; otherwise \package{doc} might overwrite it! (LH)}
+% \begin{macrocode}
+\setlength\marginparwidth{\evensidemargin}
+\addtolength\marginparwidth{1in}
+\addtolength\marginparwidth{-\marginparsep}
+\addtolength\marginparwidth{-1cm}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\CodelineNumbered
+\DisableCrossrefs
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+% \end{macrocode}
+%
+%
+% \subsection{Useful abbreviations}
+% \changes{v\,2.10}{2000/10/11}{\LaTeX\ abbreviation commands from
+% \package{ltxdoc} commented out. (LH)}
+%
+% The commands currently found in this section are inherited from the
+% \package{ltxdoc} package, but as they aren't of much use with \Tcl,
+% they have been commented out.
+%
+% |\cmd{\foo}| Prints |\foo| verbatim. It may be used inside moving
+% arguments. |\cs{foo}| also prints |\foo|, for those who prefer that
+% syntax. (This second form may even be used when |\foo| is |\outer|).
+% \begin{macro}{\cmd}
+% \begin{macro}{\cs}
+% \DoNotIndex{\\}
+% \begin{macrocode}
+% \def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
+% \def\cmd@to@cs#1#2{\char\number`#2\relax}
+% \DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\marg}
+% |\marg{text}| prints \marg{text}, `mandatory argument'.
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+% \providecommand\marg[1]{%
+% {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oarg}
+% |\oarg{text}| prints \oarg{text}, `optional argument'.
+% \begin{macrocode}
+% \providecommand\oarg[1]{%
+% {\ttfamily[}\meta{#1}{\ttfamily]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parg}
+% |\parg{te,xt}| prints \parg{te,xt}, `picture mode argument'.
+% \begin{macrocode}
+% \providecommand\parg[1]{%
+% {\ttfamily(}\meta{#1}{\ttfamily)}}
+%</class>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+% \changes{v\,2.00}{2000/07/17}{Section with \cs{DocInclude} removed,
+% since that is defined by \package{xdoc}. (LH)}
+%
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/tcldoc/tcldoc.ins b/Master/texmf-dist/source/latex/tcldoc/tcldoc.ins
new file mode 100644
index 00000000000..f4ae5b3c944
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tcldoc.ins
@@ -0,0 +1,45 @@
+% This file is the docstrip installation script for the tcldoc package.
+%
+% It may be distributed 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.
+%
+% Copyright 2000 Lars Hellstr\"om
+
+\input docstrip.tex
+
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+\endpreamble
+
+\usedir{tex/latex/misc}
+
+\keepsilent
+
+\generate{%
+ \file{tcldoc.cls}{%
+ \from{tcldoc.dtx}{class}
+ }%
+ \file{tcldoc.sty}{%
+ \from{tcldoc.dtx}{pkg}
+ }%
+}
+
+\endbatchfile
+\endinput
diff --git a/Master/texmf-dist/source/latex/tcldoc/tclldoc.dtx b/Master/texmf-dist/source/latex/tcldoc/tclldoc.dtx
new file mode 100644
index 00000000000..6106dcce36f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tclldoc.dtx
@@ -0,0 +1,4065 @@
+% \CheckSum{1849}
+%
+% \title{The \package{tclldoc} package and class}
+% \author{Lars Hellstr\"om^^A
+% \thanks{E-mail: \texttt{Lars.Hellstrom@math.umu.se}}
+% \emph{et al.}}
+% \date{2003/07/19}
+% \maketitle
+%
+% \iffalse
+%
+%<class|pkg>\NeedsTeXFormat{LaTeX2e}
+%<class>\ProvidesClass{tclldoc}
+%<compclass>\ProvidesClass{tcldoc}
+%<pkg>\ProvidesPackage{tclldoc}
+%<comppkg>\ProvidesPackage{tcldoc}
+%<class|pkg|compclass|comppkg> [2003/04/05 v2.40
+%<class|pkg> Tcl documentation
+%<compclass|comppkg> tclldoc compatibility
+%<class|compclass> class]
+%<pkg|comppkg> package]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{amsmath}
+\IfFileExists{xdoc2.sty}{\usepackage[dolayout]{xdoc2}[2000/11/18]}{}
+
+\makeatletter
+\@ifpackageloaded{xdoc2}{}{%
+ \@ifpackagelater{doc}{2000/05/20}{}{%
+ \let\XD@fragile@meta=\meta
+ \def\meta{%
+ \ifx \protect\@typeset@protect
+ \expandafter\futurelet \expandafter\@let@token
+ \expandafter\XD@fragile@meta
+ \else
+ \noexpand\meta
+ \fi
+ }%
+ }%
+}
+\@ifundefined{option}{%
+ \newenvironment{option}[1]{%
+ \trivlist
+ \if@inlabel\else \macro@cnt=\z@ \fi
+ \item[]\ignorespaces
+ }{\endtrivlist}%
+}{}
+\@ifundefined{instance}{%
+ \newenvironment{instance}[2]{%
+ \trivlist
+ \if@inlabel\else \macro@cnt=\z@ \fi
+ \item[]\ignorespaces
+ }{\endtrivlist}%
+}{}
+\makeatother
+
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+\DeclareRobustCommand\Tcl{T\kern-0.1em cl}
+\DeclareRobustCommand\word[1]{\mbox{$\{$\itshape#1\/$\}$}}
+
+\makeatletter
+\newcommand{\swtpc}{%
+ \sbox\z@{ }%
+ \expandafter\makebox \expandafter[\the\wd\z@]%
+ {\textperiodcentered}%
+}
+\makeatother
+
+\providecommand*\describeoption[1]{\marginpar{\texttt{#1} option}}
+\providecommand*\PrintChar[1]{\char#1\relax}
+\providecommand*{\DoNotIndexHarmless}[1]{}
+\providecommand*{\DoNotIndexBy}[1]{}
+\DoNotIndexBy{@}
+\DoNotIndexBy{@@}
+\DoNotIndexBy{TD@}
+\newenvironment{isyntax}{%
+ \list{}{%
+ \setlength\parsep{0pt plus 1pt}%
+ \setlength\listparindent{-1em}%
+ \setlength\itemindent{\listparindent}%
+ \addtolength\leftmargin{1em}%
+ }%
+ \item\relax \rightskip=1.0\rightskip plus 5cm
+}{\endlist}
+
+\setcounter{IndexColumns}{2}
+\hfuzz=10pt
+\expandafter\def \expandafter\GlossaryParms \expandafter{%
+ \GlossaryParms \hbadness=10000
+}
+
+\CodelineIndex
+\EnableCrossrefs
+\RecordChanges
+
+\begin{document}
+\DocInput{tclldoc.dtx}
+\PrintChanges
+\PrintIndex
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \begin{abstract}
+% The \package{tclldoc} package defines a couple of environments and
+% macros for documenting \Tcl\ source code in \texttt{.dtx}-style
+% documented source files, much like what the \package{doc}
+% package~\cite{doc} does for \TeX\ source code. The \package{tclldoc}
+% class is analogous to the \package{ltxdoc} document
+% class~\cite{ltxdoc}---it loads the package to gain the basic
+% functionality and changes some layout parameters to values that
+% are better suited for documented source than those set by the
+% standard \package{article} document class.
+%
+% The \package{tclldoc} package builds on the \package{doc},
+% \package{xdoc}~\cite{xdoc}, and \package{docindex}~\cite{docindex}
+% packages.
+%
+% Note: The \package{tclldoc} package and class used to be called
+% \package{tcldoc}, but it turned out that there already existed a
+% Perl~(!!)\ script \Tcl Doc that has a similar function. Therefore I
+% added an extra `\textsf{l}'---which stands for both \LaTeX\ and
+% Literate---to avoid confusing the community of \Tcl\ programmers.
+% For compatibility, a package and a class named \package{tcldoc} are
+% installed with \package{tclldoc}, but they shouldn't be used for
+% new documents.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \DoNotIndex{\advance,\begingroup,\bgroup,\big,\Big,\bigg,\Bigg,\box}
+% \DoNotIndex{\catcode,\char,\chardef,\cleaders,\color@begingroup}
+% \DoNotIndex{\color@endgroup,\copy,\csname,\DeclareOption}
+% \DoNotIndex{\DeclareRobustCommand,\DeclareTextCommand}
+% \DoNotIndex{\DeclareTextSymbol,\def,\discretionary,\divide,\do}
+% \DoNotIndex{\edef,\egroup,\else,\@empty,\endcsname,\endgroup}
+% \DoNotIndex{\expandafter,\fi,\@firstoftwo,\font,\fontdimen}
+% \DoNotIndex{\futurelet,\gdef,\global,\@gobble,\hb@xt@,\hbox}
+% \DoNotIndex{\hfill,\if,\ifcase,\ifcat,\ifmmode,\ifnum,\ifvbox}
+% \DoNotIndex{\ifvmode,\ifvoid,\ifx,\ignorespaces,\immediate,\indent}
+% \DoNotIndex{\input,\@@input,\InputIfFileExists,\IfFileExists}
+% \DoNotIndex{\item,\kern,\language,\lastbox,\lastpenalty,\lastskip}
+% \DoNotIndex{\lccode,\leavevmode,\let,\llap,\LoadClass,\lowercase}
+% \DoNotIndex{\m@ne,\m@th,\@makeother,\mathord,\mkern,\multiply}
+% \DoNotIndex{\@ne,\newbox,\newcommand,\newcount,\NewDescribeCommand}
+% \DoNotIndex{\newenvironment,\newif,\NewMacroEnvironment,\nfss@text}
+% \DoNotIndex{\noexpand,\normalfont,\null,\number,\or,\p@,\@@par}
+% \DoNotIndex{\parshape,\PassOptionsToClass,\PassOptionsToPackage}
+% \DoNotIndex{\penalty,\@plus,\predisplaypenalty,\prevdepth,\prevgraf}
+% \DoNotIndex{\ProcessOptions,\protect,\protected@edef}
+% \DoNotIndex{\providecommand,\ProvideTextCommandDefault,\relax}
+% \DoNotIndex{\RequirePackage,\RequirePackageWithOptions,\rightarrow}
+% \DoNotIndex{\sbox,\selectfont,\setbox,\skewchar,\space,\string}
+% \DoNotIndex{\TextSymbolUnavailable,\texttt,\the,\tracingparagraphs}
+% \DoNotIndex{\ttfamily,\tw@,\typeout,\unhbox,\unpenalty,\unskip}
+% \DoNotIndex{\unrestored@protected@xdef,\unskip,\unvbox,\vadjust}
+% \DoNotIndex{\vbox,\vert,\vrule,\vskip,\wd,\write,\xdef,\z@,\z@skip}
+%
+% \section{Introduction}
+% \label{Sec:Introduction}
+%
+% This introduction is meant to be comprehensible even for readers
+% unfamiliar with writing \texttt{.dtx} files and using the \package{doc}
+% package. Readers who are experienced with this will probably want to
+% skip right to the next section.
+%
+% A \texttt{.dtx} file has a dual nature. On one hand it is a container
+% for some lines of code---it could be a program, a macro package, a
+% configuration file for some program, merely a part of any of the
+% aforementioned, or even arbitrary combinations of the above---and on
+% the other hand it is a \LaTeX\ document which documents this code. One
+% important advantage with this arrangement is that one can keep all the
+% pieces of a project that has to do with a specific task at one place;
+% experience has shown that this greatly furthers really keeping all
+% parts of a project up to date with each other.
+%
+% Slightly simplified, one can say that a \texttt{.dtx} file contains
+% three kinds of lines. A \emph{code line} is a line that doesn't begin
+% with a `|%|' character; such lines can be extracted (copied) using the
+% \package{docstrip} program~\cite{docstrip}. A \emph{guard line} is a
+% line that begins with the two characters `|%<|'; guards are used to
+% structure the set of code lines so that \package{docstrip} can extract
+% different code lines to different generated files. A \emph{comment
+% line}, finally, is a line that begins with a `|%|' character that is
+% not immediately followed by a `|<|' character. The comment lines are
+% ignored by \package{docstrip}, but are part of (and usually make up
+% most of) the \LaTeX\ document in the \texttt{.dtx} file.
+%
+%
+% \subsection{Special conventions and basic features in a \texttt{.dtx}
+% \LaTeX\ document}
+%
+% An important difference between normal \LaTeX\ documents and
+% \texttt{.dtx} \LaTeX\ documents is that the percent character `|%|'
+% doesn't start a comment in the latter; in fact it is usually ignored.
+% This allows \LaTeX\ to see and typeset the text in the comment lines
+% of a \texttt{.dtx} file. Hence if one wants to include the sentence
+% ``Your hovercraft is full of eels!'', which in a normal \LaTeX\
+% document could have been written as the line\iffalse
+%<*example>
+% \fi
+%\begin{verbatim}
+%Your hovercraft is full of eels!
+%\end{verbatim}
+% one would instead write the line as
+%\begin{verbatim}
+%% Your hovercraft is full of eels!
+%\end{verbatim}
+% in a \texttt{.dtx} document. The space after the |%| is not
+% necessary, but most \texttt{.dtx} documents you see include
+% it---probably because the ``comment out \TeX\ code'' action of most
+% text editors consists of inserting a percent \emph{and} a space at
+% the beginning of each line.
+%
+% The code lines present the opposite problem, as they usually
+% shouldn't be treated as normal \LaTeX\ code although the normal \LaTeX\
+% reading conventions would make them the entire document. The usual way
+% around this is to surround each group of code lines with two comment
+% lines that begin and end an environment in which the code lines get
+% typeset verbatim. The \package{tclldoc} package provides the \texttt{tcl}
+% environment for this purpose, so the code lines
+%\begin{verbatim}
+%proc factorial {n} {
+% set result 1
+% for {set i 1} {$i<=$n} {incr i} {
+% set result [expr {$result * $i}]
+% }
+% return $result
+%}
+%\end{verbatim}
+% could be included in a \texttt{.dtx} document as the lines
+%\begin{verbatim}
+%% \begin{tcl}
+%proc factorial {n} {
+% set result 1
+% for {set i 1} {$i<=$n} {incr i} {
+% set result [expr {$result * $i}]
+% }
+% return $result
+%}
+%% \end{tcl}
+%\end{verbatim}
+% When typeset, this will look as
+% \begin{macrocode}
+proc factorial {n} {
+ set result 1
+ for {set i 1} {$i<=$n} {incr i} {
+ set result [expr {$result * $i}]
+ }
+ return $result
+}
+% \end{macrocode}
+% The tiny numbers at the beginning of each line enumerate the code lines.
+% Index references to code usually specify such code line numbers, but
+% the enumeration can be switched off.
+%
+% In mathematical papers, the statements of e.g.\ theorems are usually
+% made inside a \texttt{theorem} (or whatever) environment which
+% provides certain text formatting, a heading, and a position in the
+% document that can be referenced from other parts of it. In \texttt{.dtx}
+% documents one usually does something similar for each named piece of
+% code: macros, environments, templates, etc. In particular, the
+% \package{tclldoc} package provides two environments \texttt{proc} (for
+% procedures) and \texttt{variable} (for variables).
+% Figure~\ref{Fig:procex} contains an example of how \texttt{proc}
+% might be used in describing a procedure for computing the greatest
+% common divisor of two integers.
+%
+% \begin{figure}
+%
+% \begin{trivlist}
+% \item[]\leavevmode\llap{\texttt{gcd} (proc)\kern\marginparsep}^^A
+% The |gcd| procedure takes two arguments $a$ and $b$ which must be
+% integers and returns their greatest common divisor $\gcd(a,b)$,
+% which is computed using Euclid's algorithm. As a special case,
+% $\gcd(0,0)$ is considered to be $0$, so formally |gcd $a $b|
+% computes $\lvert a \rvert \wedge \lvert b \rvert$, where $\wedge$
+% denotes the meet operation in the divisor lattice of non-negative
+% integers.
+% \begin{macrocode}
+proc gcd {a b} {
+ set a [expr {abs($a)}]
+ set b [expr {abs($b)}]
+ while {$b>0} {
+ set r [expr {$a%$b}]
+ set a $b
+ set b $r
+ }
+ return $a
+}
+% \end{macrocode}
+% \end{trivlist}
+%
+% \begin{center}
+% (a) A typeset procedure with description
+% \end{center}
+%
+%\begin{verbatim}
+%% \begin{proc}{gcd}
+%% The |gcd| procedure takes two arguments $a$ and $b$ which must be
+%% integers and returns their greatest common divisor $\gcd(a,b)$,
+%% which is computed using Euclid's algorithm. As a special case,
+%% $\gcd(0,0)$ is considered to be $0$, so formally |gcd $a $b|
+%% computes $\lvert a \rvert \wedge \lvert b \rvert$, where $\wedge$
+%% denotes the meet operation in the divisor lattice of non-negative
+%% integers.
+%% \begin{tcl}
+%proc gcd {a b} {
+% set a [expr {abs($a)}]
+% set b [expr {abs($b)}]
+% while {$b>0} {
+% set r [expr {$a%$b}]
+% set a $b
+% set b $r
+% }
+% return $a
+%}
+%% \end{tcl}
+%% \end{proc}
+%\end{verbatim}
+%
+% \begin{center}
+% (b) The code for the example in (a)
+% \end{center}
+%
+% \caption{An example of the \texttt{proc} environment}
+% \label{Fig:procex}
+% \end{figure}
+%
+% What does the \texttt{proc} environment do more precisely? First
+% there's the marginal heading which can be seen in Figure~^^A
+% \ref{Fig:procex}. Such headings make it easier to find the procedure in
+% the typeset form of the document. Then the \texttt{proc} environment
+% makes an index entry which tells you where the procedure is defined,
+% and finally it stores the procedure name in a variable so that
+% subsequent |\changes|\footnote{The \cs{changes} command is defined by
+% the \package{doc} package~\cite{doc}. It is used for adding entries
+% to a global list of changes for code in the \texttt{.dtx} document.}
+% commands know to what the change that they are recording was made.
+%
+% The \texttt{variable} environment does the same things except that it
+% writes ``(var.)'' rather than ``(proc)''. This environment wasn't used
+% for describing the three local variables |a|, |b|, and |r| in the
+% example; this is since there is no point in referring to these
+% variables from elsewhere in the program. Instead the \texttt{variable}
+% environment is primarily meant for global variables (although it could
+% also be useful for local variables that are meant to be accessed using
+% |upvar| or |uplevel|), and as such it can often be of great help, since
+% the description of a global variable can otherwise be hard to find,
+% especially with languages like \Tcl\ where variables don't have to be
+% declared and thus have no natural ``home'' in the code.
+%
+% Another noteworthy feature in the example is the use of vertical
+% bar `\verb+|+' characters to delimit short pieces of verbatim \Tcl\
+% code in the comment lines. It is often necessary for the explanation
+% to include short examples of code in the documentation, and the
+% standard \LaTeX\ |\verb| command is exactly what one would need for
+% this. As such code sections are rather frequent however, it has become
+% the custom to use a single character for both starting and ending such
+% a piece of code. The \package{tclldoc} document class defines \verb+|+
+% as a shorthand for \verb+\tclverb|+, where |\tclverb| is a variant of
+% |\verb| which has been designed specifically for \Tcl\ code.
+%
+% The above description was meant to give a basic understanding of how
+% \Tcl\ code and documentation thereof can be mixed in a \texttt{.dtx}
+% file, it neither explains all the environments and commands that
+% the \package{tclldoc} package provides, nor mentions all the
+% features of the environments that were described. That information can
+% instead be found in Section~\ref{Sec:Manual} of this paper. It should
+% also be mentioned that the \package{doc} package~\cite{doc} defines
+% several commands and environments that may be of use for describing
+% code, and it is well worth getting acquainted with the features of
+% that package as well (although parts of its documentation has become
+% rather archaic).
+%
+%
+% \subsection{Guards and \package{docstrip} installation scripts}
+%
+% The central command in a \package{docstrip} installation script is
+% |\generate|, since this is the command which actually causes code to
+% be extracted. |\generate|'s syntax is
+% \begin{quote}
+% |\generate|\marg{files}
+% \end{quote}
+% where \meta{files} consists of one or several |\file| commands, each
+% of which has the syntax
+% \begin{quote}
+% |\file|\marg{output}\marg{sources}
+% \end{quote}
+% where \meta{output} is a filename and \meta{sources} consists of one
+% or several |\from| commands, each of which has the syntax
+% \begin{quote}
+% |\from|\marg{input}\marg{options}
+% \end{quote}
+% where, finally, \meta{input} is a filename and \meta{options} is a
+% comma-separated list of alphanumerical strings. Thus a |\generate|
+% command might look like
+%\begin{verbatim}
+% \generate{\file{p1.sty}{\from{s1.dtx}{foo,bar}}
+% \file{p2.sty}{\from{s2.dtx}{baz}
+% \from{s3.dtx}{baz}}
+% \file{p3.sty}{\from{s1.dtx}{zip}
+% \from{s2.dtx}{zap}}
+% }
+%\end{verbatim}
+% The meaning of this command is
+% \begin{quote}
+% Generate the three files \texttt{p1.sty}, \texttt{p2.sty}, and
+% \texttt{p3.sty}. Extract the code for \texttt{p1.sty} from
+% \texttt{s1.dtx} with options \texttt{foo} and \texttt{bar}, extract
+% the code for \texttt{p2.sty} from \texttt{s2.dtx} with option
+% \texttt{baz} and \texttt{s3.dtx} (the code from \texttt{s2.dtx}
+% will be put before the code from \texttt{s3.dtx}) with option
+% \texttt{baz}, and finally extract the code for \texttt{p3.sty} from
+% \texttt{s1.dtx} with option \texttt{zip} and \texttt{s2.dtx} with
+% option \texttt{zap}.
+% \end{quote}
+% The \emph{options} are used to control which parts of the source files
+% should be extracted to which generated file. A source file can
+% contain a number of \emph{modules}, and at the beginning of each
+% module \package{docstrip} decides, for each output file separately,
+% whether the code lines in that module should be extracted to the
+% output file. The beginning of a module is marked by a guard line which
+% has the syntax
+% \begin{quote}
+% |%<*|\meta{expression}|>|
+% \end{quote}
+% and the end by a corresponding
+% \begin{quote}
+% |%</|\meta{expression}|>|
+% \end{quote}
+% guard line. In their simplest form, the \meta{expression}s are names
+% of options, and in that case the code lines in the module are only
+% extracted if that option appears in the \meta{options} for that
+% combination of input file and output file. The \meta{expression}s can
+% however be arbitrarily complicated boolean expressions;
+% see~\cite{docstrip} for more information.
+% Modules may nest inside each other, and in that case the code lines in
+% an inner module can only be included if all surrounding modules are
+% being included. It is checked that matching |*| and |/| guard lines
+% contain the same (as strings) \meta{expression}, and case is
+% significant in the names of options.
+%
+% One application of modules which has already been mentioned is to
+% bundle code for several different generated files in the same
+% \texttt{.dtx} file---one example of this is the file
+% \texttt{doc.dtx} (part of the \LaTeX\ base distribution) which
+% contains both the \package{doc} package (\texttt{doc.sty}), the
+% \package{shortvrb} package (\texttt{shortvrb.sty}), and two
+% \package{makeindex} style files (\texttt{gglo.ist} and
+% \texttt{gind.ist}). Another application is to keep variant sections
+% of code---such as special code for debugging or gathering
+% statistics---in the \texttt{.dtx} source file for a program without
+% thereby making it a part of the normal form of that program. It is
+% quite possible to use \package{docstrip} as a simple pre-processor
+% for languages whose compiler\slash interpreter has not got one built
+% in.
+%
+% There are many other commands available in a \package{docstrip}
+% installation script beside those listed above, but those are well
+% described in the \package{docstrip} manual~\cite{docstrip} and need
+% little attention here. Instead I'm going to finish this subsection
+% with a quick guide to the particular difficulties one faces when using
+% \package{docstrip} to extract \Tcl\ code, and how to overcome them.
+%
+% The main problem is that \package{docstrip} insert a few comment lines
+% at the beginning and end of each file it generates. This is a good
+% thing, because a file consisting entirely of extracted code lines
+% would normally be completely void of commentary and quite
+% unintelligible for the casual user. These few comment lines explain
+% that the file was generated by \package{docstrip} from other files
+% (which contain the documentation of the code), lists those files,
+% and normally also contains a copyright (or more commonly some kind of
+% copyleft) notice. The problem lies in that comments look different in
+% different languages, and as the default is to write \TeX\ style
+% comments, one must tell \package{docstrip} to write \Tcl\ style
+% comments. This can be done through the command
+%\begin{verbatim}
+%\edef\MetaPrefix{\string#}
+%\end{verbatim}
+% which tells \package{docstrip} to begin each inserted comment line
+% with the character `|#|'.
+%
+% The comment lines inserted at the beginning of a generated file are
+% called the \emph{preamble} and those at the end the \emph{postamble}.
+% To set the preamble, one writes
+% \begin{trivlist}
+% \item |\preamble|\\
+% \meta{preamble lines}\\
+% |\endpreamble|
+% \end{trivlist}
+% and correspondingly to set the postamble
+% \begin{trivlist}
+% \item |\postamble|\\
+% \meta{postamble lines}\\
+% |\endpostamble|
+% \end{trivlist}
+% The \meta{preamble lines} and \meta{postamble lines} can be any number
+% of lines (including zero). Unlike the text in source files, the text in
+% these preamble and postamble lines is not read verbatim, so things in
+% these lines which have special meaning to \TeX\ (such as control
+% sequences) will be treated as such; the only exception is that spaces
+% and newlines are preserved (instead of concatenated to single spaces
+% as they normally would). It is important that the preamble and
+% postamble \emph{are} set after |\MetaPrefix| is changed, because each
+% line specified between |\preamble| and |\endpreamble| or |\postamble|
+% and |\endpostamble| respectively will be prefixed by the current value
+% of |\MetaPrefix|.
+%
+% Finally, some programs (such as the UNIX core) assign special meaning
+% to the first line of a file, so one might want to control what gets
+% put there. Merely using |\preamble| doesn't achieve this, because the
+% \meta{preamble lines} specified that way are put after the lines
+% saying ``this is a generated file \textellipsis''. You can however
+% add things to the preamble by explicitly setting the macro
+% |\defaultpreamble|, which is where \package{docstrip} stores the
+% preamble. To make the first line a comment which simply contains the
+% text `|-*-Tcl-*-|', you could give the command
+%\begin{verbatim}
+%\edef\defaultpreamble{\MetaPrefix\space -*-Tcl-*-^^J\defaultpreamble}
+%\end{verbatim}
+% Similarly to begin the file by the three standard lines
+%\begin{verbatim}
+%#! /bin/sh
+%#\
+%exec tclsh "$0" ${1+"$@"}
+%\end{verbatim}
+% (for an explanation see~\cite{execMagic})---which on UNIX allow the file
+% to function both as a \Tcl\ script and a shell script which terminates
+% the shell and runs \texttt{tclsh} on the script instead---you can use
+% the command
+%\begin{verbatim}
+%\edef\defaultpreamble{%
+% \MetaPrefix! /bin/sh^^J%
+% \MetaPrefix\string\^^J%
+% exec tclsh "$0" ${1+"$@"}^^J%
+% \defaultpreamble
+%}
+%\end{verbatim}
+% The full explanation of these commands is however far beyond this
+% introduction.\footnote{Those who want to fully understand them should
+% read \emph{The \TeX book}~\cite{TeXbook}, in particular Chapter~8.}
+%
+% In summary, a \package{docstrip} installation script for extracting a
+% file \texttt{foo.tcl} from \texttt{foo.dtx}, using \Tcl\ style
+% comments, inserting a BSD-style license notice in the preamble, and
+% beginning with the line |# -*-Tcl-*-| could look as follows:
+%\begin{verbatim}
+%\input docstrip.tex
+%
+%\edef\MetaPrefix{\string#}
+%
+%\preamble
+%
+%Copyright (c) <YEAR>, <OWNER>
+%All rights reserved.
+%
+%Redistribution and use in source and binary forms, with or without
+%modification, are permitted provided that the following conditions
+%are met:
+%* Redistributions of source code must retain the above copyright
+%notice, this list of conditions and the following disclaimer.
+%* Redistributions in binary form must reproduce the above
+%copyright notice, this list of conditions and the following
+%disclaimer in the documentation and/or other materials provided
+%with the distribution.
+%
+%THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%POSSIBILITY OF SUCH DAMAGE.
+%
+%\endpreamble
+%
+%\postamble
+%\endpostamble
+%
+%\edef\defaultpreamble{\MetaPrefix\space -*-Tcl-*-^^J\defaultpreamble}
+%
+%\generate{\file{foo.tcl}{\from{foo.dtx}{bar}}}
+%
+%\end
+%\end{verbatim}
+%
+% The generated file \texttt{foo.tcl} will contain
+%\begin{verbatim}
+%# -*-Tcl-*-
+%#
+%# This is file `foo.tcl',
+%# generated with the docstrip utility.
+%#
+%# The original source files were:
+%#
+%# foo.dtx (with options: `bar')
+%#
+%# Copyright (c) <YEAR>, <OWNER>
+%# All rights reserved.
+%#
+%# Redistribution and use in source and binary forms, with or without
+%# modification, are permitted provided that the following conditions
+%# are met:
+%# * Redistributions of source code must retain the above copyright
+%# notice, this list of conditions and the following disclaimer.
+%# * Redistributions in binary form must reproduce the above
+%# copyright notice, this list of conditions and the following
+%# disclaimer in the documentation and/or other materials provided
+%# with the distribution.
+%#
+%# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+%# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+%# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+%# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+%# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+%# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+%# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+%# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+%# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+%# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+%# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+%# POSSIBILITY OF SUCH DAMAGE.
+%#
+%\end{verbatim}
+% \meta{lines extracted from \texttt{foo.dtx}}
+%\begin{verbatim}
+%#
+%#
+%# End of file `foo.tcl'.
+%\end{verbatim}
+%
+%
+%
+% \subsection{The structure of the \LaTeX\ document}
+%
+% All this has been about the local appearance of a \texttt{.dtx} file,
+% but what about the overall structure? There are several points to
+% raise about that as well.
+%
+% The first is that \LaTeX\ to begin with treat \texttt{.dtx} documents
+% just like any other document---a `|%|' starts a comment and only lines
+% \emph{not} beginning with a `|%|' contain anything that \LaTeX\ can
+% see. Somehow \LaTeX\ must be instructed to start applying the special
+% reading rules that were described above. This is the job of the
+% so-called \emph{driver}, which (for a file \texttt{myfile.dtx}) in its
+% simplest form can look like
+%\begin{verbatim}
+%\documentclass{tclldoc}
+%\begin{document}
+%\DocInput{myfile.dtx}
+%\end{document}
+%\end{verbatim}
+% The important command here is |\DocInput|, because that is what tells
+% \LaTeX\ to apply the special \texttt{.dtx} reading rules. More
+% precisely it means ``Start ignoring `|%|' characters in the text you
+% read, input the file \texttt{myfile.dtx}, and when you're done return
+% to treating `|%|' characters as before.''
+%
+% The driver is usually put in the very first stretch of code lines in
+% the \texttt{.dtx} file. This means that \LaTeX, when ordered to typeset
+% the \texttt{.dtx} file, will start to read along, possibly ignoring
+% hundreds of lines beginning with `|%|' because they are comments. Then
+% it encounters the driver, and after the |\documentclass| and
+% |\begin{document}| commands it executes the |\DocInput|. This will
+% cause it to not ignore lines beginning with `|%|', so when it starts
+% reading the file again it will see all the lines it skipped the first
+% time through. The file will be read to end, after which \LaTeX\
+% returns to the command after the |\DocInput|. As that command happens
+% to be |\end{document}|, it finishes the typeset document and stops.
+% This stop prevents it from seeing and interpreting as \LaTeX\ commands
+% the remaining code lines in the file.
+%
+% The second time through the driver shouldn't be interpreted as
+% \LaTeX\ commands, since for example the |\documentclass| command may
+% only be used once in a \LaTeX\ document. One way of achieving this is
+% to put an |\iffalse| command right before the driver and a |\fi|
+% command right after it. This says to \LaTeX\ that the driver code is
+% conditional material, and since the condition evaluates to false
+% (|\iffalse| always evaluates to false), this conditional material
+% should be skipped. Thus the first few lines of \texttt{myfile.dtx}
+% typically might be
+%\begin{verbatim}
+%% \iffalse
+%%<*driver>
+%\documentclass{tclldoc}
+%\begin{document}
+%\DocInput{myfile.dtx}
+%\end{document}
+%%</driver>
+%% \fi
+%\end{verbatim}
+% The \texttt{driver} guard lines are there to stop \package{docstrip}
+% from including the driver code in the generated files.
+%
+% After the driver comes the actual \LaTeX\ document. The document
+% usually consists of two parts, where the first part is a manual for
+% the \emph{usage} of the code defined in the file, and the second part
+% contains the actual \emph{implementation} (documented code). The idea
+% is that most people are (at least the first time) quite content with
+% learning how to use something, so one should make it simple for them
+% to find that information.\footnote{One needn't take this as an absolute
+% rule---I for one haven't written all my packages that way---but
+% structuring the document like this generally makes it more accessible.}
+% To further this approach one puts the command |\StopEventually| at the
+% start of the implementation part and the command |\Finale| at the end
+% of it. Normally |\StopEventually| doesn't make itself felt, but if one
+% previously has given the command |\OnlyDescription| then rest of the
+% file will not be read; this can be used to produce a ``manual only''
+% version of the documentation. |\StopEventually| takes one argument and
+% the code in this argument is executed at the |\Finale| (if the
+% implementation part is being included) or immediately (if the
+% implementation part isn't being included). Thus this argument is the
+% place to put things that should appear at the very end of the
+% document.
+%
+% The \texttt{tcl}, \texttt{proc}, and \texttt{variable} environments
+% described above all typically appear in the implementation part of the
+% document.
+%
+%
+% \section{Usage of commands and environments}
+% \label{Sec:Manual}
+%
+%
+% \subsection{The actual source code}
+%
+% The \DescribeEnv{tcl}\texttt{tcl} environment is used for wrapping up
+% a group of code lines which contain \Tcl\ code. Lines inside this
+% environment which begin with a percent character are called
+% \emph{command} lines and can contain \LaTeX\ commands which get
+% executed, whereas lines that do not begin with a percent character are
+% called \emph{normal} lines and get typeset verbatim (or nearly
+% verbatim). Lines that begin with |%<| (\package{docstrip} guard lines)
+% do however constitute a special case, as the guard expression will get
+% typeset as in \package{doc}'s \texttt{macrocode} environment and the
+% remainder of the line will get processed in command mode if it is a
+% |*| or |/| guard, but in normal mode if the guard line was of any other
+% type.
+%
+% The \texttt{tcl} environment uses the same general formatting
+% parameters as \package{doc}'s \texttt{macrocode} environment. In
+% particular this means that the text on a normal line is typeset in
+% |\MacroFont| (by default the same thing as \cs{normalfont}\penalty0
+% \cs{ttfamily}\penalty0\cs{small}) or |\AltMacroFont| (by default the same
+% thing as \cs{normalfont}\penalty0\cs{ttfamily}\penalty0\cs{itshape}^^A
+% \penalty0\cs{small}) depending on the current \package{docstrip} module
+% nesting level. The \package{tclldoc} class sets the
+% \texttt{StandardModuleDepth} counter to 1, which means that the
+% |\AltMacroFont| is used when the modules are nested two levels deep or
+% more.
+%
+% If a normal line is too long to fit on one line then the \texttt{tcl}
+% environment will try to break it. Legal breakpoints are spaces which
+% could be replaced by a backslash and a newline without changing the
+% meaning of the command; thus most spaces are legal breakpoints. When a
+% line is broken at a space like this, the space is replaced by a
+% backslash so that the line is still ``syntactically correct''. The
+% opposite happens to lines which actually end with an escaped newline;
+% such lines are concatenated with the following line and are treated as
+% one long line. This is so that a sequence of breakpoints can be chosen
+% which is optimal for the actual line width of the document (as opposed
+% to the line width used in the text file, which can be something quite
+% different). For example
+%\begin{verbatim}
+%% \begin{tcl}
+%lsearch -exact\
+% [concat $a [lrange $b $first end] c d e f]\
+% [lindex $g $h]
+%% \end{tcl}
+%\end{verbatim}
+% could be typeset as any of the code examples in
+% Figure~\ref{Fig:Radbrytning}, depending on how wide a line is.
+% \begin{figure}
+% \begin{center}
+% \small
+% \(\left\lvert
+% \begin{minipage}{350pt}
+% \begin{flushleft}
+% |lsearch -exact [concat $a [lrange $b $first end] c d e f]|^^A
+% | [lindex $g $h]|
+% \end{flushleft}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{298pt}
+% \begin{flushright}
+% \noindent |lsearch -exact [concat $a [lrange $b $first|^^A
+% | end] c d e f]|\textbackslash\hfill\vadjust{}\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{241pt}
+% \begin{flushright}
+% \noindent |lsearch -exact|\textbackslash\hfill\vadjust{}\\
+% |[concat $a [lrange $b $first end] c d e f]|\textbackslash\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+%
+% \smallskip
+%
+% \(\left\lvert
+% \begin{minipage}{184pt}
+% \begin{flushright}
+% \noindent |lsearch -exact [concat $a|\textbackslash\hfill
+% \vadjust{}\\
+% |[lrange $b $first end] c d e f]|\textbackslash\\
+% |[lindex $g $h]|
+% \end{flushright}
+% \end{minipage}
+% \right\rvert\)
+% \end{center}
+%
+% \caption{The same \Tcl\ code, set in different linewidths}
+% \label{Fig:Radbrytning}
+% \end{figure}
+% The environment tries to put the linebreaks at the lowest possible
+% nesting (of braces and brackets) level; I believe this gives the best
+% readability.\footnote{When I first started programming in \Tcl\ I
+% used a completely different method for breaking long lines in the
+% code---I mainly implemented the current method because it was
+% simple to program---but I was quite surprised by how readable it made
+% the code.} There is however a way to override this automatic choice
+% of breakpoints: if a normal line which ends with an escaped newline is
+% followed by a command line (even a command line that doesn't contain
+% any commands) then it will not be concatenated with the next normal
+% line.
+%
+% There are a couple of restrictions on the code in command lines. First
+% of all it is not allowed to start a new paragraph (there will be an
+% error message). Secondly a command may not be broken across several
+% lines---all the arguments must appear on the same line as the
+% control sequence. Thirdly some characters have other catcodes than
+% in normal \LaTeX, so it is not certain that all commands work. Some
+% commands that do work and may be useful are:
+% \begin{itemize}
+% \item Vertical space commands (|\smallskip|, |\medskip|, etc.)
+% The command line `|% \medskip|' is more to type than a blank
+% normal line, but it looks slightly better.
+% \item Indexing commands (|\index|, |\IndexEntry|,\footnote{This
+% command is defined by the \package{xdoc} package~\cite{xdoc}.}
+% etc.)
+% \item The \cs{TclInput} and |\settabsize| commands (see below).
+% \end{itemize}
+% And of course the |\end{tcl}| command works in a command line, since
+% that is how one ends a \texttt{tcl} environment.
+%
+% Besides the \texttt{tcl} environment there is also a
+% \DescribeEnv{tcl*}\texttt{tcl*} environment which is different from
+% \texttt{tcl} only in that spaces and tabs are typeset as special
+% visible space `\textvisiblespace' and visible tab
+% `\makebox[6\fontdimen2\font]{\( - \mkern-7mu
+% \cleaders\hbox{$\mkern-2mu - \mkern-2mu$}\hfill \mkern-7mu
+% \mathord\rightarrow \mkern-1mu \vrule \mkern1mu\)}' characters. This
+% can be useful for pieces of code where the exact number of spaces in
+% a sequence is significant, such as code for writing tables that align.
+%
+% For shorter pieces of \Tcl\ code, e.g.\ examples, there's the
+% \DescribeMacro{\tclverb}|\tclverb| command. |\tclverb| is very similar
+% to the standard \LaTeX\ command |\verb|, but there are two differences.
+% The first is that text typeset by |\tclverb| can contain breakpoints
+% at whitespace; these behave just as in the \texttt{tcl} environment.
+% The second is that the verbatim text that follows |\tclverb| may contain
+% newlines, provided that these newlines are escaped by a backslash. Like
+% a \Tcl\ interpreter, |\tclverb| ignores whitespace following an escaped
+% newline. Unlike a \Tcl\ interpreter, |\tclverb| also ignores one percent
+% character before the ignored whitespace, if it is the first character
+% on the following line. Thus
+%\begin{verbatim}
+%% \tclverb|append a $b| is much more efficient than \tclverb|set a\
+%% $a$b| if \tclverb|$a| is long.
+%\end{verbatim}
+% is perfectly legal, and the escaped newline between |a| and |$a$b| is
+% treated just like the space between |set| and |a|. Like |\verb|, the
+% |\tclverb| command has a starred form \DescribeMacro{\tclverb*}^^A
+% |\tclverb*| which also typesets spaces and tabs as visible characters.
+%
+%
+% The \DescribeMacro{\MakeShortTclverb}|\MakeShortTclverb| command works
+% just like the \package{doc}\slash\package{shortvrb} command
+% |\MakeShortVerb|, except that it makes the active character a shorthand
+% reference for |\tclverb|\textellipsis\ instead of |\verb|\textellipsis.
+% Use |\DeleteShortVerb| to undo the effect of a |\MakeShortTclverb|. The
+% \package{tclldoc} class executes the command
+% \begin{quote}
+% \verb"\MakeShortTclverb{\|}"
+% \end{quote}
+% which makes \verb"|" a shorthand for \verb"\tclverb|".
+%
+% Since there is no universally accepted standard for the size
+% (equivalent number of spaces) of a tab, there is a command
+% \DescribeMacro{\settabsize}|\settabsize| for changing this.
+% |\settabsize| takes as its only argument the new tab size, which must
+% be an integer in the range 2--255. The default value is 8.
+% |\settabsize| makes a local assignment to the tab size. The tab size
+% can be changed inside a \texttt{tcl} (or \texttt{tcl*}) environment.
+%
+% There is also a command \DescribeMacro{\TclInput}|\TclInput| which
+% is used for typesetting ``raw'' (not in \texttt{.dtx} format) \Tcl\ code
+% files. |\TclInput| is meant to be used on a \emph{command} line of a
+% \texttt{tcl} or \texttt{tcl*} environment, and it efficiently makes
+% things look as if the |\TclInput| command had been replaced by the
+% inputted file in its entirety (preceded by a newline, and followed
+% by a percent and a space). |\TclInput| takes as its only argument the
+% name of the file to input.
+%
+% To typeset the file \texttt{myscript.tcl} one would write
+%\begin{verbatim}
+%% \begin{tcl}
+%% \TclInput{myscript.tcl}
+%% \end{tcl}
+%\end{verbatim} \iffalse
+%</example>
+% \fi
+% or even
+%\begin{verbatim}
+% \begin{tcl}\TclInput{myscript.tcl}\end{tcl}
+%\end{verbatim}
+% anywhere in a \package{tclldoc} document. This works since the
+% \texttt{tcl} environment is in command mode right after the initial
+% |\begin{tcl}|, and the |\end{tcl}| needs not be the first command on a
+% command mode line.
+%
+%
+% \subsection{Markup of named things}
+%
+% The two environments \DescribeEnv{proc}\texttt{proc} and
+% \DescribeEnv{variable}\texttt{variable}, which are analogues of
+% \package{doc}'s \texttt{macro} environment, for procedures and
+% variables respectively have already been mentioned in
+% Section~\ref{Sec:Introduction}. In addition to those there are two
+% environments \DescribeEnv{arrayentry}\texttt{arrayentry} and
+% \DescribeEnv{arrayvar}\texttt{arrayvar} which are meant for entries
+% in array variables and array variables as a whole. The complete
+% syntaxes of these environments are
+% \begin{quote}
+% |\begin{proc}|\oarg{namespace}\marg{proc name}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{proc}|
+%
+% |\begin{variable}|\oarg{namespace}\marg{variable name}\\
+% \vadjust{}\quad$\vdots$\\
+% \quad|\end{variable}|
+%
+% |\begin{arrayentry}|\oarg{namespace}\marg{array name}^^A
+% \marg{entry name}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{arrayentry}|
+%
+% |\begin{arrayvar}|\oarg{namespace}\marg{array name}^^A
+% \oarg{index-des}\\
+% \vadjust{}\quad$\vdots$\\
+% |\end{arrayvar}|
+% \end{quote}
+% The \meta{proc name}, \meta{variable name}, and \meta{array name}
+% arguments are quite evidently the names of the procedure, variable,
+% and array respectively. The \meta{namespace} argument can be to
+% specify the namespace part of a qualified name; having the name split
+% like this makes it easier to treat the namespace differently from the
+% rest of the qualified name. The command \DescribeMacro{\buildname}
+% |\buildname| is used by the commands and environments described here to
+% construct a qualified name from a namespace and a name.
+% If there is no \meta{namespace} argument then the namespace used will
+% be the default namespace. The default namespace is set using the
+% \DescribeMacro{\setnamespace}|\setnamespace| command, which takes the
+% namespace name as its only argument. The default namespace at the
+% beginning of the document is the global namespace, whose name is the
+% empty string.
+%
+% The \texttt{arrayentry} environment is intended for certain
+% distinguished entries in an array, such as entries inserted to
+% make the boundary cases of an algorithm work correctly and entries
+% which have a special meaning to the program. Not all arrays contain
+% such special entries, but when they do it is a good practice
+% to explain them explicitly. The \meta{index-des} argument of the
+% \texttt{arrayvar} environment can be used to specify what is used as
+% index into the array; the text in this argument will appear both in
+% the margin and in the index, but note that \meta{index-des} is a
+% moving argument. There is little difference between the
+% \texttt{variable} and \texttt{arrayvar} environments when the
+% \meta{index-des} argument of the latter isn't used, but the index
+% entries they make behave differently with respect to
+% \texttt{arrayentry} index entries. An \texttt{arrayentry} index entry
+% will be put as a subentry of the corresponding \texttt{arrayvar}
+% entry, whereas a \texttt{variable} entry would appear separately.
+%
+% The above environments usually only appear in the implementation part
+% of a \texttt{.dtx} file. For the usage part there is a command
+% \DescribeMacro{\describestring}|\describestring| which produces
+% marginal headings and index entries. The syntax of |\describestring|
+% is
+% \begin{quote}
+% |\describestring|\oarg{type}\oarg{namespace}\marg{text}
+% \end{quote}
+% The \meta{text} is the string for which a heading and index entry will
+% be made, whereas the \meta{type} (if given) is put after the text.
+% If the \meta{namespace} is given then the thing described is supposed
+% to be the name of something namespace-relative (like a procedure or
+% global variable) and in this case the complete name is formed by
+% passing \meta{namespace} and \meta{text} to |\buildname|. If
+% \meta{type} is \texttt{proc}, \texttt{var.}, or \texttt{array} and a
+% namespace is given then the index entry made will fit that made by
+% a corresponding \texttt{proc}, \texttt{variable}, or
+% \texttt{arrayvar} respectively environment. The \meta{type} argument
+% is, in \LaTeX\ terminology, moving.
+%
+% The \meta{text} and \meta{namespace} arguments can contain arbitrary
+% characters and most characters can be entered verbatim. Amongst the
+% exceptions are `|%|', `|\|', `|{|', and `|}|', which instead can be
+% entered as
+% |\PrintChar|\discretionary{}{}{}|{`\%}|,
+% |\PrintChar|\discretionary{}{}{}|{`\\}|,
+% |\PrintChar|\discretionary{}{}{}|{`\{}|, and
+% |\PrintChar|\discretionary{}{}{}|{`\}}| respectively. See the
+% \package{xdoc} package~\cite{xdoc} documentation for an explanation of
+% the |\PrintChar| command. The \meta{text} argument can also contain
+% ``variant'' parts made using the \DescribeMacro{\meta}|\meta| command.
+% As an example,
+% \begin{quote}
+% |\describestring[array]{\meta{mode}modeVars}|
+% \end{quote}
+% puts the text
+% \begin{quote}
+% \meta{mode}|modeVars| (array)
+% \end{quote}
+% in the margin and index. The arguments of such |\meta| commands are
+% moving.
+%
+% A case which deserves special treatment is that of options of
+% commands and for that there is the \DescribeMacro{\describeopt}
+% |\describeopt| command. The syntax of this command is
+% \begin{quote}
+% |\describeopt|*\oarg{namespace}\marg{command}\oarg{type}^^A
+% \marg{option}
+% \end{quote}
+% where \meta{command} is the command whose option is being described
+% and \meta{option} is the name of the option. \meta{namespace} is the
+% namespace of the \meta{command} and defaults to the global namespace.
+% \meta{type} is the type of the command and defaults to |proc| for
+% procedure. The \meta{namespace}, \meta{command}, and \meta{type} are
+% (currently) only used in the index entry that is generated. Options
+% for procedures will be put as subentries of the main procedure entry.
+% For built-in commands it might be more appropriate to use |command| as
+% \meta{type}, e.g.
+% \begin{quote}
+% |\describeopt{lsort}[command]{-real}|
+% \end{quote}
+% will put ``\texttt{-real} option'' in the margin and in the index as
+% a subentry of ``\texttt{lsort} (command), global namespace''. The |*|
+% is optional---including it will supress the marginal note normally
+% generated by this command.
+%
+% Since \Tcl\ is often used together with C, it might be useful to
+% also have something similar to the \texttt{proc} environment for C
+% things. This is what the \DescribeEnv{Cfunction}\texttt{Cfunction},
+% \DescribeEnv{Cvariable}\texttt{Cvariable}, and \DescribeEnv{Ctype}
+% \texttt{Ctype} environments are for. These take as their only
+% argument the name of the identifier that is defined, e.g.
+%\begin{verbatim}
+% \begin{Cfunction}{main}
+%\end{verbatim}
+% Since there seems to be several schools on how C code should be
+% formatted when typeset, the formatting of identifiers passed to these
+% environments is configurable. The three commands
+% \DescribeMacro{\Cfunctionidentifier}|\Cfunctionidentifier|,
+% \DescribeMacro{\Cvariableidentifier}|\Cvariableidentifier|, and
+% \DescribeMacro{\Ctypeidentifier}|\Ctypeidentifier| handle all
+% typesetting of identifiers; each takes as its only argument the
+% identifier (as a harmless string) to typeset. The default is to set
+% the argument in italic; this is what CWEB does.
+%
+% If you are using the \texttt{C}\dots\ environments for identifiers
+% whose names contain underscores (\_), you may want to pass the
+% \describeoption{notrawchar}\texttt{notrawchar} to \package{tclldoc}
+% (it is really an option of the \package{xdoc} package and will be
+% passed on to that automatically). This option addresses a problem
+% with \texttt{OT1}-encoded fonts that may cause underscores to display
+% as a quite different character (the \texttt{cmtt} typewriter fonts are
+% however not affected by this problem).
+%
+%
+%
+% \subsection{Describing command syntaxes}
+%
+% One important part of documentation is to describe the syntaxes of
+% commands. The previous subsection contains examples of the conventions
+% for this that has been developed for \LaTeX\
+% commands---mandatory arguments are denoted as `\marg{argument}' and
+% optional arguments are denoted as `\oarg{argument}'. These two classes
+% suffice rather well for \LaTeX\ commands, but the syntaxes of \Tcl\
+% commands are not seldom much more complex. Therefore a more powerful
+% form of syntax specification is called for, and one which is close at
+% hand is that used in regular expressions since it is already part of
+% the \Tcl\ language anyway.
+%
+% \DescribeMacro\regopt
+% \DescribeMacro\regstar
+% \DescribeMacro\regplus
+% The simplest commands available are the modifiers |\regopt|,
+% |\regstar|, and |\regplus|, which correspond to the |?|,
+% |*|, and |+| metacharacters in a regular expression; using |\regopt|
+% after a term says that it is optional, |\regstar| says that the term
+% can be repeated an arbitrary number of times (including zero), and
+% |\regplus| says that the term occurs at least once. The typeset
+% results of these commands are $^?$, $^*$, and $^+$ respectively
+% (recall that exponents are sometimes used to denote repetition).
+%
+% The terminals in the expression are best made using |\tclverb| (for
+% ``fixed'' material, e.g.\ procedure names) and
+% \DescribeMacro{\word}|\word| (for variable material, e.g.\
+% arguments). The syntax of |\word| is
+% \begin{quote}
+% |\word|\marg{text}
+% \end{quote}
+% and e.g.\ |\word{script}| gets typeset as
+% \begin{quote}
+% \word{script}
+% \end{quote}
+% Using these, one can for example specify the syntaxes of the \Tcl\
+% commands |append| and |catch| through
+% \begin{quote}
+% \verb"|append| \word{var-name} \word{value}\regplus"\\
+% \verb"|catch| \word{script} \word{var-name}\regopt"
+% \end{quote}
+% (recall that `\verb"|"' is a shorthand for `\verb"\tclverb|"'). These
+% get typeset as
+% \begin{quote}
+% |append| \word{var-name} \word{value}\(^+\)\\
+% |catch| \word{script} \word{var-name}\(^?\)
+% \end{quote}
+%
+% Terms in regular expressions can also consist of parenthesised
+% subexpressions, which are made using the \DescribeEnv{regblock}^^A
+% \texttt{regblock} environment. The syntax of this environment is
+% \begin{quote}
+% |\begin{regblock}|\oarg{modifier}\quad\dots\quad |\end{regblock}|
+% \end{quote}
+% If \texttt{regblock} environments are nested then the parentheses of
+% the outer environment will grow to be larger than those of the inner
+% environment. A side-effect of this is that the \texttt{regblock}
+% environment wants to know if a modifier will be applied to it, since
+% the amount by which the modifier should be raised in this case depends
+% on the size of the parenthesis before it, and this is what the
+% \meta{modifier} optional argument is for. \LaTeX\ does not provide
+% for arguments at the |\end| of an environment, so it has to be placed
+% at the |\begin|. Using these elements, the syntax of |if| can be
+% specified through
+% \begin{quote}
+% \verb"|if| \word{expression} |then|\regopt\ \word{script}"\\
+% \verb"\begin{regblock}[\regstar]|elseif| \word{expression}"\\
+% \verb"|then|\regopt\ \word{script}\end{regblock}"\\
+% \verb"\begin{regblock}[\regopt]|else| \word{script}\end{regblock}"
+% \end{quote}
+% which typesets as
+% \begin{isyntax}
+% |if| \word{expression} |then|\(^?\) \word{script} \(\bigl(\)^^A
+% |elseif| \word{expression} |then|\(^?\) \word{script}\(\bigr)^*\)
+% \(\bigl(\)|else|~\word{script}\(\bigr)^?\)
+% \end{isyntax}
+% In versions of \package{tclldoc} before 2.40, the \texttt{regblock}
+% environment used to be called \DescribeEnv{regexp}\texttt{regexp}.
+% That other name is still supported, but should be avoided in new
+% documents.
+%
+% The final regular expression construction that is supported is that
+% of branches of a regular expression. A \texttt{regblock} environment
+% consist of one or several branches that are separated by
+% \DescribeMacro{\regalt}|\regalt| commands. Visually the |\regalt|
+% command gets typeset as a vertical bar that has the same size as the
+% parentheses of the surrounding \texttt{regblock} environment. The
+% |\regalt| command may only be used inside a \texttt{regblock}
+% environment.
+% An example of the use of |\regalt| is the following specification of
+% the syntax of \Tcl's |regexp| command:
+% \begin{quote}
+% \verb"|regexp| \begin{regblock}[\regstar]|-nocase|\regalt"\\
+% \verb"|-indices|\end{regblock} |--|\regopt \word{regular expression}"\\
+% \verb"\word{string} \word{var-name}\regstar"
+% \end{quote}
+% which typesets as
+% \begin{isyntax}
+% |regexp| \((\)|-nocase|~\(\mid\) |-indices|\()^*\) |--|\(^?\)
+% \word{regular expression} \word{string} \word{var-name}\(^*\)
+% \end{isyntax}
+%
+% Finally a note about the relationship between the |\word| command and
+% \package{doc}'s |\meta| command. Whereas the argument of |\word| is
+% encapsulated in braces (and thus ought to be a separate word for a
+% \Tcl\ interpreter), the argument of |\meta| is encapsulated in angle
+% brackets. The idea is that |\word| should be used for things which are
+% separate words to \Tcl, whereas |\meta| should be used for things which
+% corresponds to parts of words or to several words. Thus in the command
+% |set b Z${a}Y|, the second word |b| would be a `\word{var-name}' and
+% the third word |Z${a}Y| would be a `|Z|\meta{string}|Y|'. In the
+% command |label .a -text "Hello there!"|, the last two arguments could
+% be summarised as an \meta{option}, but not as an \word{option}.
+%
+%
+% \subsection{Non-ASCII characters}
+%
+% One problem, which is only going to be more common in the future, is
+% how to deal with non-ASCII characters in scripts. The main problem
+% here lies not on the output side, as \LaTeX\ is actually pretty good
+% at producing a requested character as long as it is available in some
+% font, but on the input side. \LaTeX\ can handle input in most 8-bit
+% encodings, but in order for that to work the file must contain an
+% |\inputencoding| command which tells \LaTeX\ which encoding is being
+% used. As transporting a file from one platform to another most likely
+% changes the encoding, but not the argument of |\inputencoding|, this
+% method is rather fragile. Certainly there is room for improvements
+% but the world of 8-bit encodings is generally such a mess anyway that
+% it probably isn't worth the effort.
+%
+% A more progressive approach is to decide that all source code is in
+% Unicode (more precisely in UTF-8). The main arguments for this are:
+% (i)~\Tcl\ uses Unicode internally, (ii)~it is equally foreign on
+% all platforms and can be treated as binary data rather than ``extended
+% ASCII'' text, and (iii)~since it isn't converted, there is no loss of
+% data. Interestingly enough, \emph{it is possible to use UTF-8 ``out of
+% the box'' today!} Using the \package{ucs} package~\cite{ucs-package}
+% allows \LaTeX\ to interpret UTF-8 input and this works just as well
+% for the \Tcl\ code in a \texttt{tcl} environment as for the normal
+% \LaTeX\ text outside it. If \package{docstrip} is run on a \LaTeX\
+% format\footnote{Or, in some implementations, the \TeX\ program gets a
+% suitable option.} that preserves characters whose most significant
+% bit is set\footnote{Rather than converting them to
+% \texttt{\^{}\^{}}-sequences, which is the default.} then the non-ASCII
+% characters are simply copied verbatim and it makes no difference that
+% they may occupy more than one byte of data. Alternatively one can run
+% \package{docstrip} on Omega and (with a little extra work) get the
+% ability to have the \Tcl\ code translated to some other encoding as
+% the files are being generated!\footnote{At least in theory; I have to
+% admit I haven't actually tested the \package{docstrip} part of it.}
+%
+% But although the above paragraph describes the way to go in the long
+% run, there are some matters which make this approach slightly
+% unfeasible in the near future. This is of course my own subjective
+% opinion, but I find that two good reasons not to start using Unicode
+% throughout quite yet are that (i)~my favourite text editor doesn't
+% support Unicode (yet) and (ii)~even if I do start using it, there
+% wouldn't be that much people around who could make sense of such files
+% if I were to send it to them. Therefore I \emph{intend} to implement,
+% but as yet haven't, a kind of intermediate format where non-ASCII
+% Unicode characters are encoded using only ASCII characters plus an
+% extra escape character. The basic idea is simply that any string
+% `\meta{escape}\meta{hex digits}\meta{escape}' should be interpreted as
+% the Unicode character \texttt{U+}\meta{hex digits}, so that arbitrary
+% Unicode characters can be encoded using a character set that only
+% comprises ASCII plus one extra \meta{escape} character. Supposing that
+% this \meta{escape} character is the centered dot `\textperiodcentered',
+% I could then encode my name as
+% \begin{quote}
+% \texttt{Lars Hellstr\swtpc 00f6\swtpc m}
+% \end{quote}
+% whereas the centered dot itself would be \texttt{\swtpc 00b7\swtpc}.
+% The idea is that the file itself should contain the declaration of
+% which character is used as this Unicode escape, so that a change due
+% to translation from one 8-bit encoding to another will identically
+% alter both declaration and use of the escape character, thereby
+% preserving the internal logic of the file.
+%
+% The weak point with this scheme is that \package{docstrip} would have
+% to translate the escape sequences to proper characters when it
+% generates files. Implementing that under \TeX\ is highly non-trivial.
+% It can be done with a reasonable effort under Omega, but it still
+% requires hacking \package{docstrip}. The really interesting approach
+% would however be to implement it in a port of \package{docstrip} to
+% \Tcl, as that would remove the need to have \TeX\ to install the files.
+% Porting \package{docstrip} to \Tcl\ is by the way a project of mine
+% which I unfortunately haven't spent much time on, but if it is to be
+% of any use to have the Unicode escape format described above
+% implemented in \package{tclldoc} then I will have to make some
+% progress with it.
+%
+% \medskip
+%
+% One rather recent advancement in this direction is the code in
+% \texttt{sourcedtx.tcl}, which can be generated from the file
+% \texttt{sourcedtx.dtx} that is distributed with \package{tclldoc} as
+% an example. This implements a \Tcl\ command |dtx::source| that makes
+% it possible to source \Tcl\ code in a \texttt{.dtx} file without
+% docstripping it to a file first. This code does currently not bother
+% about encodings, but that is easy enough to add.
+%
+% \medskip
+%
+% Finally, a few notes on the old mechanism for non-ASCII characters
+% that is included in the \package{tcldoc} compatibility class. It
+% cooperates with the \package{rtkinenc} package~\cite{rtkinenc}, when
+% that has been loaded, in order to detect when an input character isn't
+% avaiable in any active font encoding. Rather than raising an error and
+% printing nothing it these cases, missing characters are written as the
+% corresponding |\x|\meta{hh} backslash sequence in a slightly different
+% font than the rest of the text. A problem here is however that most
+% input encodings contain a few characters which are interpreted as
+% \emph{math} character by \LaTeX. When such a character appears on a
+% code line it makes \TeX\ switch to math mode and things generally get
+% quite messy afterwards.
+%
+% The cure for this is to redeclare these input characters to \LaTeX\
+% so that they work as intended in text mode, but that does take some
+% lines of code. The \package{tcldoc} class does contain the
+% declarations needed for the \texttt{applemac} input encoding; passing
+% it the \describeoption{macinputenc}\texttt{macinputenc} option will
+% load the \package{rtkinenc} package, the \texttt{applemac} (macRoman)
+% input encoding, the \texttt{TS1} output encoding, and make the
+% necessary redeclarations to allow all input characters to work in
+% text. As nothing is provided for any other input encoding however,
+% this solution never was a good solution. The \texttt{macinputenc}
+% should be considered as unsupported as of \package{tclldoc} v\,2.30.
+%
+%
+%
+% \subsection{Options and customisation}
+%
+% The \package{tclldoc} package does not have any options of its own, but
+% all options passed to it are passed on to the \package{xdoc} package.
+% The \package{tclldoc} class accepts all options that the standard
+% \LaTeX\ document class \package{article} accepts, with the exception
+% of \texttt{a5paper}.
+%
+% Like the \package{ltxdoc} class, the \package{tclldoc} class will look
+% for a special configuration file \texttt{tclldoc.cfg} and input that
+% file if it exists. This file can be used to declare extra options for
+% the class, have certain options always given, etc. Section~2 of
+% \texttt{ltxdoc.dtx}~\cite{ltxdoc} is a good introduction to how such
+% configuration files can be used with \texttt{.dtx} sources in general.
+%
+% When you use a \texttt{tclldoc.cfg} file to customise the
+% \package{tclldoc} document class, you affect how all documents using
+% that class will be typeset in your particular \TeX\ installation. It
+% is \emph{not} something you have to do, but it can
+% make \package{tclldoc} documents work better with the printers, paper
+% formats, fonts, etc.\ that are available in your installation. It
+% will usually cause line and page breaks to occur at other places than
+% they would do if typeset using an uncustomised \package{tclldoc}
+% class, so the typographical quality of the document can be decreased,
+% but it is uncommon to find an \texttt{.dtx} document whose author
+% have given these matters much attention anyway. Hence the typographic
+% arguments against customisation are weak.
+%
+% A common form of customisation is to use additional packages, since
+% various kinds of document-wide font selection is often done by
+% packages. Due to that the code in \texttt{tclldoc.cfg} is executed when
+% the \package{tclldoc} class does its option processing, at which time
+% \LaTeX\ does not allow loading packages, such customisation is not
+% straightforward. There is a way around that however; to load e.g.\ the
+% \package{times} package, use the command
+%\begin{verbatim}
+%\AtEndOfClass{\usepackage{times}}
+%\end{verbatim}
+% Using |\AtEndOfClass| like this delays the command until it may be
+% executed.
+%
+%
+% \subsection{Miscellanea}
+%
+% For writing ``\Tcl'', the \package{tclldoc} package defines the command
+% \DescribeMacro{\Tcllogo}|\Tcllogo|, which for most fonts look slightly
+% better than simply typing |Tcl|. (|\Tcllogo| becomes \Tcl, whereas
+% |Tcl| becomes Tcl.)
+%
+% Between the namespace and the tail part of a qualified name, the
+% \package{tclldoc} package commands naturally put the name\-space
+% separator `|::|'. This text is stored in the macro
+% \DescribeMacro{\namespaceseparator}|\namespaceseparator|, which can be
+% redefined using the |\Declare|\-|Robust|\-|Command| command. This is
+% mainly useful for modifying how this separator behaves with respect to
+% line breaking; the default behaviour is that a line break can occur
+% between the colons.
+%
+% Another configurable piece of text is stored in the
+% \DescribeMacro{\namespacephrase}|\namespacephrase| macro. This
+% contains word `namespace' as that appears in index entries, e.g.~in
+% the last word of
+% \begin{quote}
+% \texttt{platform} (var.), \texttt{alpha} name\-space
+% \end{quote}
+% It is often convenient to replace this by something shorter. The
+% redefinition
+% \begin{quote}
+% |\renewcommand{\namespacephrase}{\textsc{ns}}|
+% \end{quote}
+% turns the above into
+% \begin{quote}
+% \texttt{platform} (var.), \texttt{alpha} \textsc{ns}
+% \end{quote}
+% Note however that either |\namespacephrase| itself or its expansion
+% must be robust.
+%
+%
+% \section{Acknowledgements}
+%
+% The \package{tclldoc} document class and \LaTeX\ package were
+% constructed starting from three other sources: (i)~the \package{ltxdoc}
+% document class~\cite{ltxdoc} by David Carlisle,
+% (ii)~the \package{doc} package~\cite{doc} by Frank Mittelbach,
+% B.~Hamilton Kelly, Andrew Mills, Dave Love, and Joachim Schrod, and
+% (iii)~my own \package{pasdoc} document class. Hence the `et al.'\ in
+% the author field above. This complicated heritage in the code is
+% mirrored by the documented source---there are paragraphs below that
+% are rather about one of (i)--(iii), than about \package{tclldoc}.
+%
+%
+%
+% \StopEventually{
+% \begin{thebibliography}{9}
+% \bibitem{ltoutenc}
+% Johannes Braams, David Carlisle, Alan Jeffrey, Frank
+% Mittelbach, Chris Rowley, and Rainer Sch\"opf:
+% \textit{ltoutenc.dtx}, The \LaTeX3 Project;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{ltoutenc.dtx}.
+% \bibitem{ltxdoc}
+% David Carlisle:
+% \textit{The file \texttt{ltxdoc.dtx} for use with \LaTeXe},
+% The \LaTeX3 Project;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{ltxdoc.dtx}.
+% \bibitem{rtkinenc}
+% Lars Hellstr\"om:
+% \textit{The \package{rtkinenc} package}, 2000;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash
+% \texttt{supported}\slash \texttt{rtkinenc}\slash
+% \texttt{rtkinenc.dtx}.
+% \bibitem{xdoc}
+% Lars Hellstr\"om:
+% \textit{The \package{xdoc} package --- experimental
+% reimplementations of features from \package{doc},
+% second~prototype}, 2000, 2001;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{exptl}\slash \texttt{xdoc}\slash
+% \texttt{xdoc2.dtx}.
+% \bibitem{docindex}
+% Lars Hellstr\"om:
+% \textit{The \package{docindex} package}, 2001;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{exptl}\slash \texttt{xdoc}\slash
+% \texttt{docindex.dtx}.
+% \bibitem{TeXbook}
+% Donald E.\ Knuth, Duane Bibby (illustrations):
+% \textit{The \TeX book}, Ad\-di\-son--Wes\-ley, 1984;
+% ISBN~0-201-13448-9 and~0-201-13447-0.
+% \bibitem{docstrip}
+% Frank Mittelbach, Denys Duchier, Johannes Braams, Marcin
+% Woli\'nski, and Mark Wooding: \textit{The \textsf{DocStrip}
+% program}, The \LaTeX3 Project;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{docstrip.dtx}.
+% \bibitem{doc}
+% Frank Mittelbach, B.~Hamilton Kelly, Andrew Mills, Dave Love, and
+% Joachim \mbox{Schrod}: \textit{The \package{doc} and
+% \package{shortvrb} Packages}, The \LaTeX3 Project;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{base}\slash \texttt{doc.dtx}.
+% \bibitem{execMagic}
+% ``Tom'', Donal Fellows, Larry Virden, Richard Suchenwirth:
+% \textit{exec magic}, The \Tcl'ers Wiki page \textbf{812};
+% \textsc{http}:/\slash \texttt{mini.net}\slash \texttt{tcl}\slash
+% \texttt{812.html}.
+% \bibitem{ucs-package}
+% Dominique~P.~G.~Unruh:
+% \textit{\texttt{ucs.sty} - Unicode Support}, 2000;
+% \textsc{ctan}:\discretionary{}{}{\thinspace}\texttt{macros}\slash
+% \texttt{latex}\slash \texttt{contrib}\slash
+% \texttt{supported}\slash \texttt{unicode}/.
+% \end{thebibliography}
+% \begin{flushleft}\footnotesize
+% The ``\textsc{ctan}:'' above is short for ``any of the servers
+% in the Comprehensive \TeX\ Archive Network (or mirror thereof)''.
+% You get a working URL if you replace this by e.g.\
+% ``\texttt{ftp://ftp.tex.ac.uk/tex-archive/}''.%
+% \end{flushleft}
+% }
+%
+%
+% \changes{v\,1.90}{2000/01/02}{Took a copy of \texttt{pasdoc.dtx} and
+% started modifying it into \texttt{tcldoc.dtx}. (LH)}
+%
+% \section{Initial stuff in the \package{tclldoc} package}
+%
+% The |\NeedsTeXFormat| and |\ProvidesPackage| commands for the
+% \package{tclldoc} package appear at the top of \texttt{tclldoc.dtx} (not
+% shown in the typeset document). Apart from that the only initial
+% action required is to load the \package{xdoc} package (and thereby
+% the \package{doc} package) and the \package{docindex} (or rather the
+% \LaTeXe\ version \package{docidx2e}) package.
+% \SortIndex{docindex package}{\package{docindex} package}
+%
+% \changes{v\,2.23}{2001/07/21}{Added message about using
+% docindex.ist. (LH)}
+% \begin{macrocode}
+%<*pkg>
+\RequirePackageWithOptions{xdoc2}[2001/11/03]
+\RequirePackage{docidx2e}
+\AtEndDocument{%
+ \typeout{********************************}%
+ \typeout{* Use docindex.ist when\@spaces\@spaces*}%
+ \typeout{* sorting .idx and .glo files. *}%
+ \typeout{********************************}%
+}%
+% \end{macrocode}
+%
+%
+% \section{Verbatim typesetting of \Tcl\ code}
+%
+% \changes{v\,2.10}{2000/10/03}{Major overhaul of the \texttt{tcl}
+% environment, to make it possible to assign different penalties to
+% different breakpoints. (LH)}
+%
+% The main feature in the \package{tclldoc} package is the \texttt{tcl}
+% environment, which typesets embedded code in a way more adapted to
+% \Tcl\ code than what the \texttt{macrocode} environment does.
+%
+%
+% \subsection{Beginning of line processing}
+%
+% The organization of the text in \emph{lines} is crucial for its
+% interpretation by the \texttt{tcl} environment. In particular the
+% following features rely on being at the beginning of a line:
+% \begin{itemize}
+% \item indentation of \Tcl\ code,
+% \item invoking command mode,
+% \item recognizing \package{docstrip} guards.
+% \end{itemize}
+%
+% \begin{macro}{\TD@percent@token}
+% A control sequence |\let| to a |%|$_{12}$, mainly for use in |\ifx|
+% comparisons.
+% \DoNotIndex{\%}
+% \begin{macrocode}
+\begingroup
+ \catcode`\%=12
+ \global\let\TD@percent@token=%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@start@n@line}
+% \begin{macro}{\TD@start@n@line@}
+% \begin{macro}{\TD@start@n@line@i}
+% The macro |\TD@start@n@line| is used at the beginning of every line.
+% The macro first clears the |\TD@line@indent| and |\TD@nesting@level|
+% registers and the |\TD@nesting@stack| stack. Then it checks if the
+% next character is a percent. If it is then this is a command line.
+% If it isn't then it is a normal line and it is time to start a
+% codeline paragraph and count the character indentation.
+%
+% |\TD@|\-|start@|\-|n@|\-|line@| is the macro which actually does
+% these things; |\TD@|\-|start@|\-|n@|\-|line| is usually |\let| to
+% |\TD@|\-|start@|\-|n@|\-|line@|. When a file is being |\TclInput|ed
+% however, |\TD@|\-|start@|\-|n@|\-|line| is |\let| to
+% |\TD@|\-|start@|\-|n@|\-|line@i| which peeks at the next token
+% before calling |\TD@|\-|start@|\-|n@|\-|line@|. If it didn't,
+% |\TD@|\-|start@|\-|n@|\-|line@| would have a problem at the end of
+% the file, since the end of a file counts as being |\outer|.
+% \begin{macrocode}
+\def\TD@start@n@line@#1{%
+ \global\TD@line@indent=\z@
+ \TD@nesting@level=\z@
+ \def\TD@nesting@stack{\TD@nesting@level}%
+ \ifx #1\TD@percent@token
+ \expandafter\TD@module
+ \else
+ \global\advance \c@codelineno \@ne
+ \TD@begin@tclpar
+ \expandafter\TD@count@indent \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \begin{macrocode}
+\let\TD@start@n@line=\TD@start@n@line@
+\def\TD@start@n@line@i{\futurelet\next\TD@start@n@line@}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@count@indent}
+% The purpose of the |\TD@count@indent| macro is to compute the
+% indentation of the current line. It grabs the next character, and
+% as long as that is a space or tab it will just increment
+% |\TD@line@indent| accordingly and continue with the next character.
+% |!| and |"| are used to make space and tab respectively with
+% suitable catcode.
+% \DoNotIndex{\!,\",\ ,\^}
+% \begin{macrocode}
+\begingroup
+ \catcode`\!=\active
+ \catcode`\"=\active
+ \lccode`\!=`\ %
+ \lccode`\"=`\^^I%
+ \lowercase{%
+\endgroup
+ \def\TD@count@indent#1{%
+ \ifx !#1%
+ \global\advance \TD@line@indent \@ne
+ \expandafter\TD@count@indent
+ \else \ifx "#1%
+ \global\divide \TD@line@indent \TD@tab@size
+ \global\advance \TD@line@indent \@ne
+ \global\multiply \TD@line@indent \TD@tab@size
+ \expandafter\expandafter \expandafter\TD@count@indent
+ \else
+ \TD@setup@parshape
+ \expandafter\expandafter \expandafter#1%
+ \fi\fi
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@module}
+% When command mode has been properly established it is time to
+% check if the next character is |<|, in which case the following
+% \package{docstrip} guard must be processed. |\TD@command| must
+% appear before the |\futurelet| so that the following character
+% won't get tokenized with incorrect catcodes.
+% \changes{v\,2.13}{2000/12/20}{Always check whether the current line
+% is a guard line, since the \texttt{\PrintChar{\number`\<}} in
+% the guard would otherwise start a new paragraph, which is an
+% error. (LH)}
+% \begin{macrocode}
+\def\TD@module{%
+ \TD@command
+ \futurelet\next
+ \TD@ch@angle
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@ch@angle}
+% The module checking in \package{tclldoc} takes advantage of the
+% macros for this in \package{doc}---|\ch@plus@etc| is a \package{doc}
+% macro. |<| is active because it is in the nolig list
+% (|\verbatim@|\-|nolig@|\-|list|).
+% \changes{v\,2.20}{2001/03/12}{Moved \cs{TD@normal} previously in
+% \cs{TD@pm@module} to here. This means \package{docstrip} guard are
+% now read in normal mode rather than command mode. This change
+% was made because of grouping problems that occured on non-block
+% guard lines. Also added local redefinition of \PrintChar{13} to
+% prevent that guard lines are concatenated with the following
+% line. (LH)}
+% \DoNotIndex{\^}
+% \begin{macrocode}
+\begingroup
+ \catcode`<=\active
+ \catcode`\^^I=\catcode`\^^M \endlinechar=`\^^I \relax
+ \catcode`\^^M=\active
+ \gdef\TD@ch@angle{%
+ \ifx <\next
+ \TD@normal
+ \global\advance \c@codelineno \@ne
+ \TD@begin@tclpar
+ \def^^M{\TD@active@CR}%
+ \expandafter\futurelet \expandafter\next
+ \expandafter\ch@plus@etc
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@pm@module}
+% The |\TD@pm@module| macro is used instead of \package{doc}'s
+% |\pm@module| when in the \texttt{tcl} environment. This is necessary
+% since the paragraph man\oe uvres of the \texttt{tcl} environment would
+% not work right with \package{doc}'s |\pm@module|.
+%
+% If we're not dealing with a block directive (|*| or |/|), i.e.,
+% it's a single special line, we set everything up to the next |>|
+% appropriately, return to normal mode, possibly change font, and
+% start counting indentation spaces.
+% \DoNotIndex{\>}
+% \begin{macrocode}
+\begingroup
+ \catcode`\>=\active
+ \gdef\TD@pm@module#1>{%
+ \Module{#1}%
+ \ifnum \guard@level<\c@StandardModuleDepth \else
+ \AltMacroFont
+ \fi
+ \TD@count@indent
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@star@module}
+% \changes{v\,2.20}{2001/03/12}{Removed \cs{TD@end@tclpar}. (LH)}
+% \changes{v\,2.22}{2001/06/13}{Reinserted \cs{TD@end@tclpar} and
+% added \cs{TD@command}; this solves a problem with grouping that
+% prevented a font change from getting effect. (LH)}
+% \begin{macro}{\TD@slash@module}
+% \changes{v\,2.20}{2001/03/12}{Removed \cs{TD@end@tclpar}. (LH)}
+% \changes{v\,2.22}{2001/06/13}{Same change as in
+% \cs{TD@star@module}. (LH)}
+% The |\TD@star@module| and |\TD@slash@module| macros are, like
+% |\TD@pm@module|, used instead of \package{doc}'s |\star@module| and
+% |\slash@module| respectively when in the \texttt{tcl} environment.
+% \DoNotIndex{\>}
+% \begin{macrocode}
+\begingroup
+ \catcode`\>=\active
+ \gdef\TD@star@module#1>{%
+ \Module{#1}%
+ \TD@end@tclpar
+ \TD@command
+ \global\advance \guard@level \@ne
+ \ifnum \c@StandardModuleDepth<\guard@level
+ \global\let\macro@font=\AltMacroFont
+ \macro@font
+ \fi
+ }
+ \gdef\TD@slash@module#1>{%
+ \Module{#1}%
+ \TD@end@tclpar
+ \TD@command
+ \global\advance \guard@level \m@ne
+ \ifnum \guard@level=\c@StandardModuleDepth
+ \global\let\macro@font\MacroFont
+ \macro@font
+ \fi
+ }
+\endgroup
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@gobble@whitespace}
+% This macro gobbles all normal mode spaces and tabs following it.
+% \begin{macrocode}
+\def\TD@gobble@whitespace#1{%
+ \if \ifx #1\TD@active@space
+ 0%
+ \else
+ \ifx #1\TD@active@tab 0\else 1\fi
+ \fi 0%
+ \expandafter\TD@gobble@whitespace
+ \else
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{Typographical elements}
+%
+% This subsection contains definitions of the typographical
+% elements---special symbols and the like--that are used in the
+% \texttt{tcl} and \texttt{tcl*} environments.
+%
+%
+% \begin{macro}{\TD@typography}
+% \begin{macro}{\TD@nontcl@font}
+% The |\TD@typography| macro does all the typographic set-up that is
+% common to the \texttt{tcl} environment, the \texttt{tcl*}
+% environment, and the |\tclverb| command.
+%
+% The |\TD@nontcl@font| macro selects an ``escape'' font for \Tcl\
+% material. This font is used for various kinds of escape codes that
+% are typeset instead of some character---either because the
+% character is not available, or because the line needs to be broken.
+% The escape font will have the same font family (and same encoding)
+% as the text surrounding the \texttt{tcl} environment or |\tclverb|
+% command. Therefore |\TD@nontcl@font| must be defined before the
+% \Tcl\ material font is selected. I don't think it is necessary to
+% use |\protected@edef| below, but it can't hurt either.
+% \begin{macrocode}
+\def\TD@typography{%
+ \protected@edef\TD@nontcl@font{%
+ \noexpand\fontencoding{\cf@encoding}%
+ \noexpand\fontfamily{\f@family}\noexpand\selectfont
+ }%
+% \end{macrocode}
+% The most frequent escape symbol is the single backslash used for
+% escaping the end of lines, and this is stored in the
+% |\TD@backslash@box| box.
+%
+% The following code have to do with how characters outside
+% visible ASCII are typeset when they appear in the \texttt{tcl} or
+% \texttt{tcl*} environment. The commands are defined by the
+% \package{rtkinenc} package.
+% \begin{macrocode}
+ \InputModeCode
+ \SetUnavailableAction{\leavevmode{%
+ \TD@nontcl@font\textbackslash x\TypesetHexNumber{##1}%
+ }}%
+ \DeclareInputMath{0}{\RIE@undefined{0}}%
+ \DeclareInputMath{12}{\RIE@undefined{12}}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@typeset@space}
+% This macro typesets a space, as it should be in the \texttt{tcl}
+% environment (and other places too). It generates a kern, not glue, so
+% that it can be used in a |\discretionary|.
+% \begin{macrocode}
+\def\TD@typeset@space{\kern\fontdimen\tw@\font}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@discretionary@space}
+% This is the macro which offers all the breakpoints in |\tclverb|
+% code. The name comes from the fact that all the breakpoints are
+% discretionaries which appear to be spaces when not broken. When
+% they are broken, they are backslashes. To give some visual hint
+% that these backslashes need not be backslashes in the source, they
+% are typeset in the same font family (and same encoding) as the
+% text surrounding the \texttt{tcl} environment.
+% \begin{macrocode}
+\def\TD@discretionary@space{%
+ \discretionary{\copy\TD@backslash@box}{}{\TD@typeset@space}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@breakable@space}
+% The valid breakpoints inside \texttt{tcl} and \texttt{tcl*}
+% environments are made in the |\TD@|\-|breakable@|\-|space| macro.
+% This macro contributes an |\hbox| (which contains a
+% |\TD@typeset@space|), a penalty, and an empty |\vadjust| to the
+% current horizontal list. If a line break is made at the penalty,
+% the |\hbox| will later be removed and replaced by a non-macro font
+% backslash (from |\TD@backslash@box|). The |\vadjust| is there to
+% prevent that any discardable items disappears after the breakpoint.
+% \begin{macrocode}
+\def\TD@breakable@space{%
+ \hbox{\TD@typeset@space}%
+ \TD@nesting@penalty
+ \vadjust{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@typeset@tab}
+% This is an unbreakable space whose width equals that of
+% |\TD@tab@size| spaces.
+% \begin{macrocode}
+\def\TD@typeset@tab{\kern\TD@tab@size\fontdimen\tw@\font}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@visible@whitespace}
+% The |\TD@visible@whitespace| macro locally redefines the macros
+% which typesets spaces and tabs to make visible symbols. The visible
+% tab is roughly a |\rightarrowfill| and a |\vrule|, but a difference
+% is that the minuses that form the extensible ``tail'' to the
+% |\rightarrow| are not smashed. Not doing that gives the |\vrule| a
+% suitable height, but I had rather expected the nominal height of
+% the |\rightarrow| to be larger \textellipsis\ It's yet another
+% mysterious math font feature, I suppose.
+%
+% \begin{macrocode}
+\def\TD@visible@whitespace{%
+ \def\TD@typeset@space{\char32 }%
+ \def\TD@typeset@tab{%
+ \hb@xt@\TD@tab@size\fontdimen\tw@\font{%
+ $\m@th-\mkern-7mu%
+ \cleaders\hbox{$\mkern-2mu-\mkern-2mu$}\hfill
+ \mkern-7mu\mathord\rightarrow\mkern-1mu\vrule\mkern1mu$%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Catcodes and active characters}
+%
+% Like any \texttt{verbatim}-like environment, the \texttt{tcl}
+% environment does some rather extensive alterations of catcodes. This
+% is handled by the three macros |\TD@general|, |\TD@normal|, and
+% |\TD@command|. Set-up that is common for both modes is made by
+% |\TD@general| when the \texttt{tcl} environment is entered.
+% Mode-dependent set-up is made by |\TD@normal| and |\TD@command|
+% whenever a mode switch occurs.
+%
+% \begin{macro}{\TD@let@active}
+% One technicality here is that all of these routines need to set the
+% definition of some active character, and this character is often not
+% active with normal \LaTeX\ catcodes. To overcome this difficulty,
+% there is a macro |\TD@let@active| which takes two arguments: a
+% control sequence with a single character name, and an arbitrary
+% control sequence. The active character with the same name as the
+% first control sequence is |\let| locally to the second control
+% sequence.
+% \begin{macrocode}
+\begingroup
+ \catcode\z@=\active
+ \gdef\TD@let@active#1{%
+ \begingroup
+ \lccode\z@=`#1%
+ \lowercase{%
+ \endgroup
+ \let^^@%
+ }%
+ }%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@general}
+% The |\TD@general| macro does the initial set-ups that are common for
+% both modes of the \texttt{tcl} environment and for the |\tclverb|
+% command. These include definitions of various active characters and
+% |\catcode| assignments.
+%
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@general{%
+ \let\do\do@noligs
+ \verbatim@nolig@list
+ \let\do\@makeother
+ \dospecials
+ \catcode`\^^M=\active
+ \TD@let@active\^^I\TD@active@tab
+ \TD@let@active\^^M\TD@active@CR
+ \TD@let@active\ \TD@active@space
+ \TD@let@active\\\TD@active@backslash
+ \TD@let@active\{\TD@active@braceleft
+ \TD@let@active\}\TD@active@braceright
+ \TD@let@active\[\TD@active@bracketleft
+ \TD@let@active\]\TD@active@bracketright
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@normal}
+% This macro sets up the normal mode, changing everything that is
+% different in any of the other modes. Note that the catcodes in
+% normal mode are such that no character is a space. This makes it
+% possible for macros used in normal mode to look ahead by simply
+% grabbing the next character in an undelimited argument.
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@normal{%
+ \catcode`\^^I=\active
+ \catcode`\ =\active
+ \catcode`\\=\active
+ \catcode`\{=\active
+ \catcode`\}=\active
+ \catcode`\[=\active
+ \catcode`\]=\active
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@command}
+% This macro switches from normal mode to command mode.
+% \DoNotIndex{\^,\ ,\\,\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\def\TD@command{%
+ \catcode`\^^I=10%
+ \catcode`\ =10%
+ \catcode`\[=12%
+ \catcode`\]=12%
+ \catcode`\\=\z@
+ \catcode`\{=\@ne
+ \catcode`\}=\tw@
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@active@space}
+% \begin{macro}{\TD@active@space@}
+% This macro is used for spaces in normal mode. Its main problem is
+% to determine whether it is followed by more whitespace or not. If it
+% is, then it is an unbreakable space. If it isn't, then it is a
+% breakable space.
+% \begin{macrocode}
+\def\TD@active@space#1{%
+ \ifx #1\TD@active@backslash
+ \expandafter\TD@active@space@
+ \else
+ \ifx #1\TD@active@space
+ \TD@typeset@space
+ \else\ifx #1\TD@active@tab
+ \TD@typeset@space
+ \else
+ \TD@breakable@space
+ \fi\fi
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% The special case to look out for is that the next character is a
+% backslash which escapes a newline.
+% \begin{macrocode}
+\def\TD@active@space@#1{%
+ \ifx #1\TD@active@CR
+ \TD@typeset@space
+ \else
+ \TD@breakable@space
+ \fi
+ \TD@active@backslash #1%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@active@tab}
+% The |\TD@active@tab| macro is what the active character tab is
+% |\let| to inside the \texttt{tcl} and \texttt{tcl*} environments.
+% \begin{macrocode}
+\def\TD@active@tab{\TD@typeset@tab}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@active@CR}
+% This macro is called at the end of a line. The |\catcode| tests the
+% current mode.
+% \DoNotIndex{\\}
+% \begin{macrocode}
+\def\TD@active@CR{%
+ \ifnum \catcode`\\=\z@
+ \ifvmode\else
+ \PackageError{tclldoc}{Horizontal material on command line}\@ehc
+ \@@par
+ \fi
+ \TD@normal
+ \else
+ \TD@end@tclpar
+ \fi
+ \TD@start@n@line
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@active@CRv}
+% This is what |\tclverb| defines the |^^M| active character as
+% being. Cf.\ the standard \LaTeX\ macro |\verb@eol@error|.
+% \begin{macrocode}
+\def\TD@active@CRv{%
+ \verb@egroup
+ \PackageError{tclldoc}{\protect\tclverb\space ended by end of line}%
+ \@ehc
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@active@backslash}
+% \changes{v\,2.10}{2000/10/08}{First checking if next character is
+% active, and only expands the macro containing the detailed tests
+% if it is. (LH)}
+% \begin{macro}{\TD@active@backslash@}
+% \begin{macro}{\TD@active@backslash@v}
+% |\TD@active@backslash| is used for backslashes in normal mode. Its
+% main problem is to determine whether the backslash is escaping
+% something (which would normally be treated specially by the
+% environment) or not. The primary test for this is whether the
+% argument grabbed is an active character, and if it is then
+% processing continues (in |\TD@active@backslash@|) to determine what
+% should be done.
+% \begin{macrocode}
+\def\TD@active@backslash#1{%
+ \ifcat \noexpand#1\noexpand~%
+ \expandafter\TD@active@backslash@
+ \else
+ \@backslashchar
+ \fi
+ #1%
+}
+% \end{macrocode}
+%
+% In order to have guard lines processed correctly, the first test
+% below really must be for |\TD@active@CR| rather than for an
+% active |^^M|.
+% \changes{v\,2.11}{2000/11/06}{Escaped spaces are no longer breakable.
+% (LH)}
+% \begin{macrocode}
+\def\TD@active@backslash@#1{%
+ \ifcase
+ \ifx #1\TD@active@CR 0%
+ \else\ifx #1\TD@active@backslash 1%
+ \else\ifx #1\TD@active@braceleft 2%
+ \else\ifx #1\TD@active@braceright 2%
+ \else\ifx #1\TD@active@bracketleft 2%
+ \else\ifx #1\TD@active@bracketright 2%
+ \else\ifx #1\TD@active@space 3%
+ \else 4\fi\fi\fi\fi\fi\fi\fi
+ \space
+ \expandafter\TD@active@backslash@i
+ \or
+ \@backslashchar\@backslashchar
+ \or
+ \@backslashchar \string#1%
+ \or
+ \@backslashchar \TD@typeset@space
+ \else
+ \@backslashchar
+ \expandafter#1%
+ \fi
+}
+% \end{macrocode}
+% Escaped newlines that are followed by command mode lines are not
+% converted to discretionary spaces.
+% \begin{macrocode}
+\def\TD@active@backslash@i#1{%
+ \ifx #1\TD@percent@token
+ \copy\TD@backslash@box
+ \expandafter\TD@active@CR
+ \else
+ \TD@breakable@space
+ \global\advance \c@codelineno \@ne
+ \expandafter\TD@gobble@whitespace
+ \fi
+ #1%
+}
+% \end{macrocode}
+% The |\tclverb| command uses |\TD@active|\-|@backslash@v| instead of
+% |\TD|\-|@active|\-|@backslash@i|, since it is intended for use on
+% lines that may begin with |%|.
+% \begin{macrocode}
+\def\TD@active@backslash@v#1{%
+ \TD@discretionary@space
+ \ifx #1\TD@percent@token
+ \expandafter\@firstoftwo
+ \fi
+ \TD@gobble@whitespace #1%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TD@active@bracketleft}
+% \begin{macro}{\TD@active@bracketright}
+% These macros mainly typeset the corresponding characters, but they
+% also increase or decrease the |\TD@nesting@level| count by one.
+% \begin{macrocode}
+\def\TD@active@bracketleft{[\advance\TD@nesting@level\@ne}
+\def\TD@active@bracketright{]\advance\TD@nesting@level\m@ne}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@active@braceleft}
+% \begin{macro}{\TD@active@braceright}
+% \begin{macro}{\TD@nesting@stack}
+% \changes{v\,2.14}{2001/01/19}{Nesting stack added to cope with code
+% (brace-delimited strings) where brackets aren't properly balanced.
+% (LH)}
+% The |\TD@active@braceleft| and |\TD@active@braceright| work very
+% much like their \texttt{bracket} counterparts, but they also push
+% and pop the current nesting level on and off the |\TD@nesting@stack|
+% macro. The reason for doing this is that brackets aren't always
+% properly balanced in \Tcl\ code, which may result in a
+% |\TD@nesting@level| value which does not mirror how the code really
+% will be interpreted. Braces must however be properly balanced, and
+% therefore it is always right to restore the value of
+% |\TD@nesting@level| that was in force before a brace group began
+% when it is ended.
+%
+% The |\TD@nesting@stack| macro is a \meta{nesting stack}, which is
+% one of the following two things
+% \begin{quote}
+% |\TD@nesting@level|
+% \meta{number}|\def\TD@nesting@stack{|\meta{nesting stack}|}|
+% \end{quote}
+% This means a value is popped off the stack by doing
+% \begin{quote}
+% |\TD@nesting@level=\TD@nesting@stack|
+% \end{quote}
+% and |\TD@nesting@level| is unchanged if the stack is empty.
+% \DoNotIndex{\[,\]}
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+\begingroup
+ \catcode`\{=12 \catcode`\}=12
+ \catcode`\[=1 \catcode`\]=2
+ \gdef\TD@active@braceleft[{%
+ \expandafter\def \expandafter\TD@nesting@stack \expandafter[%
+ \the\expandafter\TD@nesting@level
+ \expandafter\def \expandafter\TD@nesting@stack
+ \expandafter[\TD@nesting@stack]%
+ ]%
+ \advance\TD@nesting@level\@ne
+ ]
+ \gdef\TD@active@braceright[}%
+ \advance\TD@nesting@level\m@ne
+ \TD@nesting@level=\TD@nesting@stack
+ ]
+\endgroup
+\def\TD@nesting@stack{\TD@nesting@level}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+%
+% \subsection{Paragraph formatting}
+%
+% This subsection contains definitions of control sequences that are
+% mainly related to the formatting of paragraphs.
+%
+% The new implementation of the \texttt{tcl} and \texttt{tcl*}
+% environments is based on inserting the ``discretionary'' backslashes
+% at the linebreaks \emph{after} the paragraph has been broken.
+% Doing this involves reboxing every line in the paragraph, and in this
+% process the line adjustments are changed as well.
+%
+% \begin{macro}{\TD@backslash@box}
+% The |\TD@backslash@box| box register is set to a backslash in the
+% special |\TD@nontcl@font| at the beginning of each \texttt{tcl} and
+% \texttt{tcl*} environment. These backslashes are used to denote
+% ``backslash escaping newline''. The primary reason for keeping this
+% glyph in a box is not that this might be slightly faster to
+% typeset, but to have the \emph{width} of it easily accessible.
+% \begin{macrocode}
+\newbox\TD@backslash@box
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@nesting@level}
+% \begin{macro}{\TD@nesting@penalty}
+% |\TD@nesting@level| is a count register which keeps track of how
+% many brace\slash bracket groups surrounds the current position in
+% the line. It is cleared to zero at the beginning of each paragraph.
+% \begin{macrocode}
+\newcount\TD@nesting@level
+% \end{macrocode}
+% |\TD@nesting@penalty| makes a |\penalty| whose value should depend
+% on the nesting level (the deeper the nest, the larger the penalty).
+% It may also adjust the value of |\linepenalty| to counter that
+% the nesting level has become negative. This is typically needed for
+% lines which say things like ``|} else {|''. The default definition is
+% to make the nesting penalty $100$ times the nesting level and to
+% make the |\linepenalty| equal to
+% \(10 - \min\{0,\mbox{least penalty}\}\).
+% \begin{macrocode}
+\def\TD@nesting@penalty{%
+ \penalty \the\TD@nesting@level 00\relax
+ \ifnum \lastpenalty<-\linepenalty
+ \linepenalty=10%
+ \advance \linepenalty -\lastpenalty
+ \fi
+}
+% \end{macrocode}
+% I doubt that this is necessarily the best algorithm for computing
+% these penalties, so if you are really thorough about your
+% typography you may well want to experiment with other definitions of
+% |\TD@nesting@penalty|. In case you should then find something which
+% works even better then I'm interested to learn about it.
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@reformat@lines}
+% The |\TD@reformat@lines| macro calls itself recursively to reformat
+% all lines on the current vertical list. The first line will remain
+% flush left, but all other lines will be reset flush right. The
+% visible material on the last line will be left as it is, but the
+% last box in all other lines will be replaced by a non-macro font
+% backslash.
+%
+% It is very important that the current vertical list is not the main
+% vertical list.
+% It is assumed that the current vertical list consists of a sequence
+% of \meta{box}, \meta{penalty}, \meta{glue}, with an extra glue item
+% at the top of the list. It is OK if some penalty or glue item is
+% missing. In case the list contains other material as well the line
+% reformatting may be stopped prematurely, but there is a trick that
+% allows one to put arbitrary material between the lines of the
+% reformatted paragraph: rather than doing e.g.
+% \begin{quote}
+% |\mark|\marg{text}
+% \end{quote}
+% in the paragraph, do
+% \begin{quote}
+% |\vadjust{\vbox{\mark{|\meta{text}|}}}|
+% \end{quote}
+% The |\vbox| will be recognised by the paragraph reformatting
+% mechanism as a container for vertical mode material that appears
+% between the lines of the paragraph, so it will simply be unboxed.
+% \changes{v\,2.12}{2000/11/11}{\cs{vbox} containers for vertical
+% material are allowed between the lines of a reformatted
+% paragraph. (LH)}
+%
+% Each line's horizontal list ends with
+% \begin{itemize}
+% \item a box (which contains the space that is to be replaced by a
+% backslash),
+% \item a penalty (at which the paragraph was broken), and
+% \item a glue item (the |\rightskip|).
+% \end{itemize}
+%
+% A tricky feature in the implementation is that the
+% |\bgroup|--|\egroup| nesting will be off by one. The |\bgroup| at
+% the beginning of a |\TD@reformat@line| will be matched by the
+% |\egroup| at the end of the |\TD@reformat@line| that the first one
+% calls!
+% \begin{macrocode}
+\def\TD@reformat@lines{%
+ \bgroup
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \ifvoid\z@
+% \end{macrocode}
+% The recursion had already descended down to the last line of the
+% paragraph, and it is now time to reformat it.
+% \begin{macrocode}
+ \egroup
+ \prevdepth=\TD@prevdepth
+ \hbox{%
+ \unhbox\z@
+ \unskip \unpenalty
+ \setbox\z@=\lastbox
+ \copy\TD@backslash@box
+ }%
+ \else
+% \end{macrocode}
+% Else there may be another line, and the |\TD@reformat@lines| recursion
+% must continue to descend. Upon return the box currently in box
+% register zero must be reformatted as a non-first line (flush
+% right) and it cannot be the last line in the paragraph, so it is
+% always correct to replace the last box by a backslash.
+% \begin{macrocode}
+ \TD@reformat@lines
+ \ifvbox\z@ \unvbox\z@ \else
+ \hb@xt@\dimen@{%
+ \hfill
+ \unhbox\z@
+ \unskip \unpenalty
+ \setbox\z@=\lastbox
+ \copy\TD@backslash@box
+ }%
+ \fi
+ \fi
+ \ifnum \count@=\z@ \else \penalty\count@ \fi
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@reformat@par}
+% The |\TD@reformat@par| macro reformats all lines (they're supposed
+% to constitute a paragraph, but that isn't so important) in the
+% current vertical list. The restrictions of |\TD@reformat@lines| on
+% what may appear in the list apply and there must be at least two
+% lines in the list. |\dimen@| is used to hold the desired width of
+% reformatted paragraphs.
+%
+% More precisely |\TD@reformat@par| takes care of the last line of
+% the paragraph and the possible |\vbox| containers for vertical
+% material that may follow it. Everything in the paragraph that comes
+% before the last line is handled by |\TD@reformat@lines|.
+% \changes{v\,2.12}{2000/11/11}{\cs{vbox} containers for vertical
+% material are allowed after the last line of a reformatted
+% paragraph. (LH)}
+% \begin{macrocode}
+\def\TD@reformat@par{%
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \ifvbox\z@
+ \bgroup
+ \TD@reformat@par
+ \egroup
+ \unvbox\z@
+ \else\ifnum \prevgraf>\@ne
+ \dimen@=\@totalleftmargin
+ \advance \dimen@ \linewidth
+ \bgroup
+ \unskip
+ \count@=\lastpenalty \unpenalty
+ \setbox\z@=\lastbox
+ \TD@reformat@lines
+ \hb@xt@\dimen@{\hfill \unhbox\z@ \unskip}%
+ \else
+ \unskip
+ \prevdepth=\TD@prevdepth
+ \box\z@
+ \fi\fi
+ \ifnum \count@=\z@ \else \penalty\count@ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@prevdepth}
+% |\TD@prevdepth| is a macro which is used for storing the value of
+% |\prevdepth| at times where \TeX\ modifies the primitive in unwanted
+% ways. It should always be set globally.
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@begin@tclpar}
+% The |\TD@begin@tclpar| macro is called when a paragraph in a
+% \texttt{tcl} or \texttt{tcl*} environment is about to start. It
+% takes care of setting up things so that the paragraph can later be
+% reformatted using |\TD@reformat@par|, but it also has to make sure
+% that this reformatting doesn't affect the way the paragraph blends
+% in with vertical material before and after it.
+%
+% Reformatting requires that the paragraph is first built in
+% restricted vertical mode, i.e., it has to be built in an explicit
+% |\vbox|. A problem with this is however that it changes the value of
+% |\prevdepth|, which must therefore be explicitly restored.
+% \begin{macrocode}
+\def\TD@begin@tclpar{%
+ \xdef\TD@prevdepth{\the\prevdepth}%
+ \setbox\z@=\vbox\bgroup
+ \color@begingroup
+ \prevdepth=\TD@prevdepth
+ \indent
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@end@tclpar}
+% The |\TD@end@tclpar| macro ends a paragraph begun by
+% |\TD@begin@tclpar|, reformats it (|\TD@reformat@par|), and
+% contributes it to the surrounding vertical list. The |\begingroup|
+% and |\endgroup| are there to sort things out in case the recursion
+% in |\TD@reformat@par| fails to match as intended. The second
+% |\@@par| sees to that the page builder is exercised (without it,
+% several pages may go onto the main vertical list without anything
+% being shipped out).
+% \begin{macrocode}
+\def\TD@end@tclpar{%
+ \@@par
+ \begingroup
+ \skip@=\lastskip
+ \TD@reformat@par
+ \vskip\skip@
+ \endgroup
+ \xdef\TD@prevdepth{\the\prevdepth}%
+ \color@endgroup
+ \egroup
+ \unvbox\z@
+ \prevdepth=\TD@prevdepth
+ \@@par
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\TD@line@indent}
+% |\TD@line@indent| is a |\count| register holding the indentation of
+% the current line, in number of spaces. |\TD@line@indent| should
+% always be assigned globally.
+% \begin{macrocode}
+\newcount\TD@line@indent
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@par@setup}
+% This macro sets up various paragraph formatting parameters for the
+% normal mode. It mainly consists of code from |\macro@code| of
+% \package{doc}.
+% \begin{macrocode}
+\def\TD@par@setup{%
+% \end{macrocode}
+%
+% In theory a \texttt{tcl} environment should consist of a
+% \texttt{trivlist} environment, but the empty space before and after
+% the environment should not be too large.
+% \begin{macrocode}
+ \topsep\MacrocodeTopsep
+% \end{macrocode}
+%
+% The next parameter we set is |\@beginparpenalty|, in order
+% to prevent a page break before such an environment.
+% \begin{macrocode}
+ \@beginparpenalty\predisplaypenalty
+% \end{macrocode}
+%
+% We then start a |\trivlist|, set |\parskip| back to
+% zero and start an empty |\item|.
+% \changes{ \package{doc} v\,1.9b}{1993/12/03}{Forcing any label
+% from macro env.}
+% \begin{macrocode}
+ \if@inlabel\leavevmode\fi
+ \trivlist
+ \parskip\z@skip
+ \item[]%
+% \end{macrocode}
+% However, the \texttt{trivlist} environment is only started to make
+% standard \LaTeX\ happy (and to have the various list-related
+% measurements properly calculated). Everything below will instead
+% by done with \TeX\ primitives.
+% \changes{ \package{pasdoc} v\,1.31}{1999/09/02}{\cs{parshape}
+% assignment added. (LH)}
+% \changes{v\,2.10}{2000/10/08}{\cs{parshape} assignment removed (now
+% done in \cs{TD@begin@tclpar}). (LH)}
+%
+% It is important that the change to a special font does not take
+% place before the above |\item|, otherwise a change to
+% |\baselineskip| will affect the paragraph above.
+% \begin{macrocode}
+ \macro@font
+ \frenchspacing
+% \end{macrocode}
+%
+% \leavevmode
+% \changes{v\,2.12}{2000/11/11}{Assignment to \cs{TD@backslash@box}
+% moved from \cs{TD@typography} to here, so that the size will be
+% right. (LH)}^^A
+% One escape symbol that is particularly common is a single
+% backslash, and this is stored in the |\TD@backslash@box| box. As
+% some encodings (e.g.\ \texttt{OT1}) does not contain a backslash,
+% these escape backslashes are made with |\textbackslash|, rather
+% than an explicit character.
+% \begin{macrocode}
+ \sbox\TD@backslash@box{\TD@nontcl@font\textbackslash}%
+% \end{macrocode}
+%
+% The |\rightskip| is given a generous stretchability of |\linewidth|
+% so that it doesn't matter too much if the lengths of lines in the
+% paragraph varies. Decreasing this value would make the nesting in
+% the code less important.
+% \begin{macrocode}
+ \parindent=\@totalleftmargin
+ \advance \parindent \MacroIndent
+ \leftskip=\z@skip
+ \rightskip=\z@ \@plus \linewidth\relax
+% \end{macrocode}
+% The next two lines are from the definition of the
+% \texttt{macrocode} environment, and I (LH) have no idea what they are
+% good for, but I suppose I can keep them, at least for now.
+% \begin{macrocode}
+ \global\@newlistfalse
+ \global\@minipagefalse
+% \end{macrocode}
+% \changes{ \package{pasdoc} v\,1.31}{1999/09/02}{Made list
+% environments indent line numbers. (LH)}
+% \changes{v\,2.33}{2001/12/12}{Made list environments not indent
+% line numbers per default, but providing a way for the user to
+% change this. (LH)}
+% Line numbers are inserted using |\everypar|.
+% \begin{macrocode}
+ \ifcodeline@index
+ \everypar={\llap{%
+ \PrintCodelineNo\ \hskip\codelineindentfactor\@totalleftmargin
+ }}%
+ \else
+ \everypar={}%
+ \fi
+% \end{macrocode}
+%
+% These commands replace \package{doc}'s final module processing
+% macros with macros that work in the \texttt{tcl} environment.
+% \begin{macrocode}
+ \let\pm@module=\TD@pm@module
+ \let\star@module=\TD@star@module
+ \let\slash@module=\TD@slash@module
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\codelineindentfactor}
+% The |\codelineindentfactor| macro specifies by which fraction of
+% |\@totalleftmargin| that the list environment indentation of
+% codeline numbers will be countered. |0| means that the numbers will
+% be indented, |1| or empty (the default) that they will not be
+% indented. |0.5| would mean that the effective indentation is half
+% that of other material.
+% \begin{macrocode}
+\let\codelineindentfactor\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@setup@parshape}
+% This macro sets the shape of the current paragraph, primarily based
+% on the value in |\TD@line@indent|, and makes the final indentation
+% of the first line. By the time it gets called, there usually already
+% is some material (|\indent|, codeline number, and possibly a
+% \package{docstrip} guard) in the paragraph horizontal list.
+%
+% The basic area in which the paragraph material is to be put has a
+% left margin at |\@totalleftmargin|${}+{}$|\MacroIndent| and a right
+% margin at |\@totalleftmargin|${}+{}$|\linewidth| (in both cases the
+% position is that much to the right of the left edge of the galley).
+% The printed codeline number (if there is one) will be put to the
+% left of the left margin, but all other material is indented at least
+% the width of another |\TD@line@indent| spaces. In the first line
+% that will be done through an explicit kern, but in subsequent lines
+% it will instead be done through a |\parshape| assignment. On these
+% subsequent lines, there will be an additional indentation of\/
+% $1\,\mathrm{em}$ to mark the continuation.
+%
+% When the paragraph is broken, the right margin will be moved to the
+% right by the width of a space minus the width of the
+% |\TD@backslash@box|. The reason for this is that the paragraph will
+% be broken with spaces (from |\TD@breakable@space|) at the end of
+% lines, but that these spaces will later be replaced by the
+% backslash in |\TD@backslash@box|. As that doesn't happen in the
+% very last line of the paragraph however, something special must be
+% done there. The option chosen is to give the |\parfillskip| a
+% nonzero natural width.
+%
+% The length |\@totalleftmargin|${}+{}$|\MacroIndent| is put in
+% |\parindent| at the beginning of the environment.
+% \begin{macrocode}
+\def\TD@setup@parshape{%
+ \parfillskip=\fontdimen\tw@\font \@plus 1fil%
+ \advance \parfillskip -\wd\TD@backslash@box
+ \dimen@=\MacroIndent
+ \advance \dimen@ \TD@line@indent\fontdimen\tw@\font
+ \advance \dimen@ 1em%
+ \dimen@ii=\linewidth
+ \advance \dimen@ii -\dimen@
+ \dimen4=\linewidth
+ \advance \dimen@ \@totalleftmargin
+ \advance \dimen4 \@totalleftmargin
+ \advance \dimen@ii -\parfillskip
+ \advance \dimen4 -\parfillskip
+ \parshape \tw@ \z@ \dimen4 \dimen@ \dimen@ii
+% \end{macrocode}
+% Then one just needs one more kern to indent the first line
+% properly.
+% \begin{macrocode}
+ \kern \TD@line@indent\fontdimen\tw@\font
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@trace@pardimen}
+% This macro is for tracing dimens that are of interest for paragraph
+% breaking. Its call syntax is
+% \begin{quote}
+% |\TD@trace@pardimen|\marg{text}\marg{dimen}
+% \end{quote}
+% where \meta{text} will be written to the log file to identify the
+% dimension, and \meta{dimen} is the dimen register in question (it
+% can be anything that can appear after |\the|).
+%
+% To reduce the amount of text written, this macro only does anything
+% if the \TeX\ parameter |\tracingparagraphs| is positive.
+% \begin{macrocode}
+%<*partrace>
+\def\TD@trace@pardimen#1#2{%
+ \ifnum \tracingparagraphs>\z@
+ \immediate\write\m@ne{#1 \the#2}%
+ \fi
+}
+%</partrace>
+% \end{macrocode}
+% \changes{ \package{pasdoc} v\,1.21}{1999/08/15}{Added macro and
+% some calls of it. All of those are however surrounded by
+% \texttt{partrace} guards. (LH)}
+% \end{macro}
+%
+%
+%
+% \subsection{User interface}
+%
+% This subsection defines the actual environment and the
+% commands and parameters intended to be user-definable.
+%
+%
+% \begin{macro}{\settabsize}
+% \changes{v\,2.12}{2000/11/09}{New command for setting the tab size.
+% (LH)}
+% \begin{macro}{\TD@tab@size}
+% \changes{v\,2.12}{2000/11/09}{New name for \cs{c@tabSize}; no longer a
+% count register. (LH)}
+% The |\TD@tab@size| control sequence stores (as a |\chardef| token)
+% the number of spaces that are equivalent to one tab; the default
+% value is 8. To set this number, one uses the command |\settabsize|,
+% which has the syntax
+% \begin{quote}
+% |\settabsize|\marg{new size}
+% \end{quote}
+% The effect of |\settabsize| is local.
+% \begin{macrocode}
+\newcommand*\settabsize[1]{\chardef\TD@tab@size=#1\relax}
+\settabsize{8}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{environment}{tcl}
+% \begin{environment}{tcl*}
+% This is some kind of a definition. There are aspects of the
+% interaction with \texttt{trivlist} that I (LH) don't understand,
+% but it appears to work.
+% \begin{macrocode}
+\newenvironment{tcl}{%
+ \TD@general
+ \TD@typography
+ \TD@par@setup
+ \TD@command
+}{%
+ \global\@inlabelfalse
+ \endtrivlist
+}
+% \end{macrocode}
+% \begin{macrocode}
+\newenvironment{tcl*}{%
+ \TD@visible@whitespace
+ \TD@general
+ \TD@typography
+ \TD@par@setup
+ \TD@command
+}{%
+ \global\@inlabelfalse
+ \endtrivlist
+}
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+% \begin{macro}{\tclverb}
+% \begin{macro}{\TD@verb}
+% The |\tclverb| macro is for typesetting short passages of \Tcl\ code
+% which one does not want to have a special paragraph for. It is
+% similar to the standard \LaTeX\ command |\verb|, but it has a couple
+% of extra features. One is that spaces that are not followed by more
+% whitespace are discretionary breakpoints, just as in the \texttt{tcl}
+% environment. Another is that a newline can be escaped by putting a
+% backslash at the end of an input line. Such an escaped newline will
+% count as a space, and whitespace at the beginning of the line
+% following it will be ignored. A percent character immediately
+% following an escaped newline will also be ignored.
+%
+% |\tclverb| has a |*| form |\tclverb*|, which is analogous to the
+% standard \LaTeX\ |\verb*|, i.e., spaces are typeset using ``visible
+% space'' symbols.
+% \begin{macrocode}
+\newcommand\tclverb{%
+ \relax\ifmmode\hbox\else\leavevmode\null\fi
+ \bgroup
+ \@ifstar{\TD@visible@whitespace\TD@verb}\TD@verb
+}
+% \end{macrocode}
+% \DoNotIndex{\ ,\^,\\}
+% \begin{macrocode}
+\def\TD@verb{%
+ \let\TD@active@backslash@i=\TD@active@backslash@v
+ \let\TD@active@CR=\TD@active@CRv
+ \let\TD@breakable@space=\TD@discretionary@space
+ \TD@general
+ \catcode`\^^I=\active
+ \catcode`\ =\active
+ \catcode`\\=\active
+ \TD@typography
+ \verbatim@font
+ \sbox\TD@backslash@box{\TD@nontcl@font\textbackslash}%
+ \@sverb
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+%
+% \begin{macro}{\TclInput}
+% The |\TclInput| macro is very much like the standard \LaTeX\
+% |\input|, but it is intended to be used in command mode, for
+% inputting \Tcl\ files that have not been marked up. |\input| would
+% work in this case, but there would be errors at the first and last
+% lines of the |\input|ted file.
+% \begin{macrocode}
+\newcommand\TclInput[1]{%
+ \IfFileExists{#1}{%
+ \@addtofilelist{#1}%
+ \begingroup
+ \TD@normal
+ \let\TD@start@n@line=\TD@start@n@line@i
+ \expandafter\TD@start@n@line
+ \@@input\@filef@und\TD@percent@token
+ \endgroup
+ }{\PackageError{tclldoc}{No file #1}\@eha}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeShortTclverb}
+% This definition follows \package{doc}'s |\MakeShortVerb| pretty
+% close.
+% \DoNotIndex{\~}
+% \begin{macrocode}
+\newcommand\MakeShortTclverb[1]{%
+ \expandafter\ifx \csname cc\string#1\endcsname\relax
+ \PackageInfo{tclldoc}{%
+ Made \expandafter\@gobble\string#1 a short %
+ reference for \string\tclverb}%
+ \add@special{#1}%
+ \expandafter\xdef \csname cc\string#1\endcsname{\the\catcode`#1}%
+ \begingroup
+ \lccode`\~=`#1%
+ \lowercase{%
+ \global\expandafter\let
+ \csname ac\string#1\endcsname ~%
+ \gdef~{\tclverb~}}%
+ \endgroup
+ \global\catcode`#1\active
+ \else
+ \PackageInfo{tclldoc}{%
+ \expandafter\@gobble\string#1 already a short verb %
+ reference}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \section{Miscellaneous markup features}
+%
+% \subsection{Namespaces}
+%
+% \changes{v\,2.10}{2000/10/13}{Added namespace support. (LH)}
+%
+% \begin{macro}{\setnamespace}
+% \begin{macro}{\TD@convert@colons}
+% Since it is common that many identifiers in the same namespace are
+% defined in sequence, one can specify a default namespace to use for
+% all commands where no explicit namespace is given. This is done
+% using the |\setnamespace| command, whose syntax is
+% \begin{quote}
+% |\setnamespace|\marg{namespace}
+% \end{quote}
+% This converts the \meta{namespace} to a harmless character string
+% and locally assigns it to the |\TD@namespace| macro, which stores
+% the current default namespace. |\TD@convert@colons| replaces all
+% |::| substrings in the namespace by |\namespaceseparator|s.
+% \changes{v\,2.33}{2001/12/12}{Converting \texttt{::} in namespace
+% names. (LH)}
+% \begin{macrocode}
+\newcommand\setnamespace[1]{%
+ \MakeHarmless\TD@namespace{#1}%
+ \protected@edef\TD@namespace{%
+ \expandafter\TD@convert@colons \TD@namespace ::\relax
+ }
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\TD@convert@colons#1::#2{%
+ #1%
+ \ifx \relax#2\else
+ \noexpand\namespaceseparator
+ \TD@convert@colons #2%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@namespace}
+% At the beginning of a document, the default namespace is the global
+% namespace, which is represented by the empty string.
+% \begin{macrocode}
+\let\TD@namespace\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\buildname}
+% \changes{v\,2.13}{2000/12/16}{Added \cs{@empty} after test for
+% \cs{NoValue}, so that it works for empty arguments. (LH)}
+% \begin{macro}{\namespaceseparator}
+% \changes{v\,2.12}{2000/11/25}{Command added. (LH)}
+% The |\buildname| macro builds a qualified name from a namespace and
+% a name tail. It has the syntax
+% \begin{quote}
+% |\buildname|\marg{namespace}\marg{name}
+% \end{quote}
+% where \meta{name} is a harmless character sequence and
+% \meta{namespace} is a harmless character sequence or the token
+% |\NoValue|. If \meta{namespace} is |\NoValue| then the default
+% namespace is used. |\buildname| does all processing at expand-time.
+%
+% If the namespace is the empty string (the global namespace) then
+% \meta{name} is returned without a `|::|' prefix; this is for the
+% sake of compatibility with pre-v\,8 \Tcl s.
+% \begin{macrocode}
+\newcommand\buildname[2]{%
+ \ifx \NoValue#1\@empty
+ \ifx \@empty\TD@namespace \else
+ \TD@namespace\namespaceseparator
+ \fi
+ \else
+ \ifx $#1$\else #1\namespaceseparator \fi
+ \fi
+ #2%
+}
+% \end{macrocode}
+% The |\namespaceseparator| command typesets a namespace separator. By
+% default it is two colons separated by a penalty, but the user may
+% redefine it.
+% \begin{macrocode}
+\DeclareRobustCommand\namespaceseparator{:\penalty\hyphenpenalty:}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\namespacephrase}
+% The |\namespacephrase| macro stores the phrase that will be used
+% for `namespace' in indices and the like. It is meant to be
+% redefinable. The contents must be robust.
+% \changes{v\,2.25}{2001/08/14}{Macro added. (LH)}
+% \begin{macrocode}
+\providecommand*\namespacephrase{name\-space}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{instance}{docindex}{index}
+% \changes{v\,2.21}{2001/03/26}{Modified as per the v\,1.00 change to
+% \package{docindex}. (LH)}
+% The \texttt{index} instance of template type \texttt{docindex}
+% (defined by the \package{docindex} package) is redefined to allow
+% name and namespace levels to be joined.
+% \begin{macrocode}
+\@ifpackagewith{docidx2e}{usedocindexps}{%
+ \@namedef{TP@I{}{docindex}{index}}#1#2{%
+ \begingroup
+ \@letinstance\DI@indexitem@i{indexitem}{fixed-r1a}%
+ \@letinstance\DI@indexitem@ii{indexitem}{aloneaccept2}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
+ \def\DI@letter@format##1{%
+ \par
+ \hb@xt@\hsize{\hfil\textbf{##1}\hfil}%
+ \nopagebreak
+ }%
+ \def\+{-}%
+ \IfFileExists{\jobname.ind}{%
+ \ifnum \c@IndexColumns>\@ne
+ \begin{multicols}{\c@IndexColumns}[#1][\IndexMin]%
+ \else
+ \enough@room{\IndexMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \pagestyle{docindex}%
+ \small
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.ind}%
+ \DI@item@nojoin
+ \thispagestyle{docindex}
+ \ifnum \c@IndexColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.ind.}}%
+ \endgroup
+ }
+}{%
+ \@namedef{TP@I{}{docindex}{index}}#1#2{%
+ \begingroup
+ \@letinstance\DI@indexitem@i{indexitem}{fixed-r1a}%
+ \@letinstance\DI@indexitem@ii{indexitem}{aloneaccept2}%
+ \@letinstance\DI@indexitem@iii{indexitem}{fixed3}%
+ \columnsep=10pt%
+ \parskip=0pt plus 1pt%
+ \def\DI@letter@skip{10pt plus 2pt minus 3pt}%
+ \def\DI@letter@format##1{%
+ \par
+ \hb@xt@\hsize{\hfil\textbf{##1}\hfil}%
+ \nopagebreak
+ }%
+ \def\+{-}%
+ \IfFileExists{\jobname.ind}{%
+ \ifnum \c@IndexColumns>\@ne
+ \begin{multicols}{\c@IndexColumns}[#1][\IndexMin]%
+ \else
+ \enough@room{\IndexMin}%
+ #1\par
+ \addvspace\multicolsep
+ \fi
+ \small
+ \@nobreakfalse
+ \DI@ind@setup
+ \input{\jobname.ind}%
+ \DI@item@nojoin
+ \ifnum \c@IndexColumns>\@ne
+ \end{multicols}%
+ \else
+ \enough@room\postmulticols
+ \addvspace\multicolsep
+ \fi
+ \normalsize #2\par
+ }{\typeout{No file \jobname.ind.}}%
+ \endgroup
+ }
+}
+% \end{macrocode}
+% \end{instance}
+%
+%
+%
+% \subsection{\texttt{macro}-like environments}
+%
+% This subsection contains the definitions of a couple of environments
+% which, like \package{doc}'s \texttt{macro}, are for marking up the
+% document (what is defined and where). These environments are defined
+% using the |\New|\-|Macro|\-|Environment| command of the \package{xdoc2}
+% package.
+% \changes{ \package{pasdoc} v\,1.40}{1999/12/05}{\texttt{macro}-like
+% environments redefined. (LH)}
+% \changes{v\,2.00}{2000/07/17}{\texttt{macro}-like environments are
+% defined using the \cs{NewMacroEnvironment} command. The
+% \cs{TD@identifier}, \cs{SpecialMainTclIndex}, and
+% \cs{PrintTclName} macros were removed. (LH)}
+% \changes{v\,2.12}{2000/11/26}{Using starred form of
+% \cs{NewMacroEnvironment} for the \texttt{variable}, \texttt{proc},
+% \texttt{arrayvar}, and \texttt{arrayentry} environments, so that
+% the marginal headings can be broken. (LH)}
+%
+% \begin{macrocode}
+\MetaNormalfont
+% \end{macrocode}
+% \changes{v\,2.32}{2001/11/30}{Added \cs{MetaNormalfont} as a global
+% declaration and removed it from the commands that did this locally.
+% There were simply so many places where it should have been
+% otherwise that the resulting code would have looked rudiculous.
+% (LH)}
+%
+% \begin{environment}{variable}
+% The \texttt{variable} environment has the syntax
+% \begin{quote}
+% |\begin{variable}|\oarg{namespace}\marg{variable}
+% \end{quote}
+% It makes a marginal heading, index entry, etc.\@ for the
+% \meta{variable} variable in the \meta{namespace} namespace
+% (if specified, otherwise in the default namespace).
+% \begin{macrocode}
+\NewMacroEnvironment*{variable}%
+ {\XD@grab@harmless@oarg\XD@grab@harmless\relax}{2}%
+ {\XDParToMargin{\MacroFont\buildname{#1}{#2} \normalfont (var.)}}%
+ {\TD@main@index{#1}{#2}{var.}{}}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} variable}}
+ {}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{proc}
+% The \texttt{proc} environment has the syntax
+% \begin{quote}
+% |\begin{proc}|\oarg{namespace}\marg{proc}
+% \end{quote}
+% It makes a marginal heading, index entry, etc.\@ for the \meta{proc}
+% procedure in the \meta{namespace} namespace (if specified, otherwise
+% in the default namespace).
+% \begin{macrocode}
+\NewMacroEnvironment*{proc}%
+ {\XD@grab@harmless@oarg\XD@grab@harmless\relax}{2}%
+ {\XDParToMargin{\MacroFont\buildname{#1}{#2} \normalfont (proc)}}%
+ {\TD@main@index{#1}{#2}{proc}{}}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} proc}}
+ {}%
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{arrayvar}
+% \changes{v\,2.00}{2000/07/17}{Environment added. (LH)}
+% \changes{v\,2.12}{2000/11/09}{Made last argument optional. (LH)}
+% \changes{v\,2.13}{2000/12/15}{Not using \cs{meta} for the
+% \meta{index-des} argument. (LH)}
+% \begin{environment}{arrayentry}
+% \changes{v\,2.02}{2000/08/21}{Environment added. (LH)}
+% The \texttt{arrayvar} and \texttt{arrayentry} environments are for
+% array variables; \texttt{arrayvar} is for the array as a whole,
+% whereas \texttt{arrayentry} is for individual entries in the array
+% that (for some reason) are important enough to warrant special
+% attention. The respective syntaxes are
+% \begin{quote}
+% |\begin{arrayvar}|\oarg{namespace}\marg{array}\oarg{index-des}\\
+% |\begin{arrayentry}|\oarg{namespace}\marg{array}\marg{entry}
+% \end{quote}
+% Here \meta{array} is the name of an array variable, \meta{entry} is
+% the name of an entry, and \meta{index-des} is a short piece of text
+% (seldom more than one word) which describes what is used as indices
+% into that array.
+% \changes{v\,2.14}{2001/01/12}{Corrected grabbing of the third
+% argument of the \texttt{arrayvar} environment: it should be an
+% oarg, not a harmless oarg. (LH)}
+% \begin{macrocode}
+\NewMacroEnvironment*{arrayvar}{%
+ \XD@grab@harmless@oarg\XD@grab@harmless\relax\XD@grab@oarg
+}{3}%
+ {\XDParToMargin{\MacroFont \buildname{#1}{#2}%
+ \ifx \NoValue#3%
+ \space\normalfont (array)%
+ \else
+ \penalty\hyphenpenalty(\mbox{\meta@font@select#3})%
+ \fi
+ }}%
+ {\TD@main@index{#1}{#2}{array}{%
+ \ifx \NoValue#3\@empty\else
+ \LevelSorted{#3}{\protect\mbox{\textit{#3}} entries}%
+ \fi
+ }}%
+ {{\buildname{#1}{#2}}{\texttt{\buildname{#1}{#2}} array}}
+ {}%
+% \end{macrocode}
+% \begin{macrocode}
+\NewMacroEnvironment*{arrayentry}{%
+ \XD@grab@harmless@oarg\XD@grab@harmless\relax\XD@grab@harmless\relax
+}{3}%
+ {\XDParToMargin{%
+ \MacroFont \buildname{#1}{#2}%
+ \penalty\hyphenpenalty(#3)%
+ }}%
+ {\TD@main@index{#1}{#2}{array}{\LevelSorted{#3}{\texttt{#3}}}}%
+ {{\buildname{#1}{#2}(#3)}{\texttt{\buildname{#1}{#2}(#3)}}}
+ {}%
+% \end{macrocode}
+% \end{environment}\end{environment}
+%
+% \begin{macro}{\describestring}
+% \changes{v\,2.01}{2000/08/12}{Command added. (LH)}
+% \changes{v\,2.12}{2000/11/21}{Optional argument added. (LH)}
+% \changes{v\,2.13}{2000/12/16}{Second optional argument added. (LH)}
+% \changes{v\,2.20}{2001/03/03}{Putting namespace on the second
+% level. (LH)}
+% The |\describestring| command has the syntax
+% \begin{quote}
+% |\describestring|\oarg{type}\oarg{namespace}\marg{string}
+% \end{quote}
+% It is similar to \package{xdoc}'s own |\describe|\-|cs|\-|family|
+% command, but it has a couple of extra features which are connected
+% to the optional arguments and it doesn't prepend a backslash to
+% the name of the thing being described. When the \meta{type} argument
+% is present, it is taken as a ``type declaration'' of the
+% \meta{string} being described and `(\meta{type})' will be put as a
+% suffix to the \meta{string}. When the \oarg{namespace} argument is
+% present it means that the string being described is really the name
+% of something (e.g.\ a procedure or variable) which exists in a
+% namespace, and the complete name is formed by passing both
+% \meta{namespace} and \meta{string} as arguments to |\buildname|.
+% Note that an empty \meta{namespace} argument is not quite the
+% same thing as no \meta{namespace} argument.
+% \begin{macrocode}
+\NewDescribeCommand{\describestring}{%
+ \XD@grab@oarg\XD@grab@harmless@oarg\XD@grab@harmless{}%
+}{3}{%
+ \GenericDescribePrint{%
+ \MacroFont
+ \ifx \NoValue#2\@empty
+ #3%
+ \else
+ \buildname{#2}{#3}%
+ \fi
+ \ifx \NoValue#1\@empty \else\ \normalfont(#1)\fi
+ }%
+ \begingroup
+ \def\meta##1{(##1)}%
+ \unrestored@protected@xdef\@gtempa{#3}%
+ \endgroup
+ \IndexEntry{%
+ \ifx \NoValue#2\@empty
+ \LevelSorted{\@gtempa}{%
+ \texttt{#3}%
+ \ifx \NoValue#1\@empty \else\space(#1)\fi
+ }%
+ \else
+ \LevelSorted{\@gtempa}{%
+ \texttt{#3}\ifx \NoValue#1\@empty \else\space(#1)\fi
+ }%
+ \ifx $#2$%
+ \LevelSorted{ }{global \namespacephrase}%
+ \else
+ \LevelSorted{#2}{\texttt{#2} \namespacephrase}%
+ \fi
+ \fi
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\describeopt}
+% \changes{v\,2.24}{2001/08/11}{Command added. (LH)}
+% \changes{v\,2.31}{2001/11/03}{Star-form added. (LH)}
+% The |\describeopt| macro is a |\describe|\dots\ command for options
+% of commands. The syntax is
+% \begin{quote}
+% |\describeopt|*\oarg{namespace}\marg{command}\oarg{type}^^A
+% \marg{option}
+% \end{quote}
+% where \meta{command} is the name of the command and \meta{option} is
+% the name of the option. \meta{namespace} is the namespace of the
+% \meta{command}, if that is not the global namespace. \meta{type} is
+% the type description for the command, if different from `proc'.
+% The |*| form of this command does not print a marginal note: it
+% only makes an index entry.
+% \begin{macrocode}
+\NewDescribeCommand{\describeopt}{%
+ \XD@grab@sarg{*}\XD@grab@harmless@oarg\XD@grab@harmless{}%
+ \XD@grab@oarg\XD@grab@harmless{}%
+}{5}{%
+ \ifx \BooleanFalse#1%
+ \GenericDescribePrint{%
+ \MacroFont #5\ \normalfont option%
+ }%
+ \fi
+ \begingroup
+ \def\meta##1{(##1)}%
+ \unrestored@protected@xdef\@gtempa{#3}%
+ \endgroup
+ \IndexEntry{%
+ \LevelSorted{\@gtempa}{%
+ \texttt{#3} (\ifx \NoValue#4\@empty proc\else #4\fi)%
+ }%
+ \ifx \NoValue#2\@empty
+ \LevelSorted{ }{global \namespacephrase}%
+ \else
+ \LevelSorted{#2}{\texttt{#2} \namespacephrase}%
+ \fi
+ \LevelSorted{#5}{\texttt{#5} option}%
+ }{usage}{\thepage}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TD@main@index}
+% \changes{v\,2.10}{2000/10/14}{Generalized macro. (LH)}
+% \changes{v\,2.12}{2000/11/25}{Sorting by base name first, not by
+% namespace first. (LH)}
+% \changes{v\,2.20}{2001/03/03}{Putting namespace on the second
+% level. (LH)}
+% The |\TD@main@index| macro has the syntax
+% \begin{quote}
+% |\TD@main@index|\marg{namespace}\marg{name}\marg{type}^^A
+% \marg{extra}
+% \end{quote}
+% It makes a \texttt{main} index entry. The top level of this entry
+% is like an entry for the \meta{name} object of type \meta{type} in
+% the \meta{namespace} namespace. The entry may have one or more
+% sublevels\footnote{But no more than one extra level is recommended,
+% as \package{makeindex} can handle at most three levels.} specified
+% in the \meta{extra}; these are then made using explicit
+% |\LevelSame| or |\LevelSorted| commands. \meta{name} and
+% \meta{namespace} are as for the |\buildname| macro, whereas
+% \meta{type} is a description, e.g. `\texttt{proc}', that gets
+% appended to the printed text of the entry's top level.
+% \begin{macrocode}
+\def\TD@main@index#1#2#3#4{%
+ \XDMainIndex{%
+ \LevelSorted{#2}{\texttt{#2} (#3)}%
+ \ifx \NoValue#1\@empty
+ \ifx \@empty\TD@namespace
+ \LevelSorted{ }{global \namespacephrase}%
+ \else
+ \LevelSorted{\TD@namespace}%
+ {\texttt{\TD@namespace} \namespacephrase}%
+ \fi
+ \else
+ \ifx $#1$%
+ \LevelSorted{ }{global \namespacephrase}%
+ \else
+ \LevelSorted{#1}{\texttt{#1} \namespacephrase}%
+ \fi
+ \fi
+ #4%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{Cfunction}
+% \changes{v\,2.40}{2003/04/05}{Environment added. (LH)}
+% \begin{environment}{Cvariable}
+% \changes{v\,2.40}{2003/04/05}{Environment added. (LH)}
+% \begin{environment}{Ctype}
+% \changes{v\,2.40}{2003/04/05}{Environment added. (LH)}
+% The \texttt{Cfunction}, \texttt{Cvariable}, and \texttt{Ctype}
+% environments are for making a marginal heading, index entry, etc.\@
+% for a C function, variable, or type respectively. They all take as
+% their single argument the name of the thing that will be defined.
+% \begin{macrocode}
+\NewMacroEnvironment*{Cfunction}{\XD@grab@harmless\relax}{1}%
+ {\XDParToMargin{\small\Cfunctionidentifier{#1} (C~function)}}%
+ {\XDMainIndex{%
+ \LevelSorted{#1}{\Cfunctionidentifier{#1} (C~function)}%
+ }}%
+ {{#1}{\Cfunctionidentifier{#1} C~function}}
+ {}%
+\NewMacroEnvironment*{Cvariable}{\XD@grab@harmless\relax}{1}%
+ {\XDParToMargin{\small\Cvariableidentifier{#1} (C~variable)}}%
+ {\XDMainIndex{%
+ \LevelSorted{#1}{\Cvariableidentifier{#1} (C~variable)}%
+ }}%
+ {{#1}{\Cvariableidentifier{#1} C~variable}}
+ {}%
+\NewMacroEnvironment*{Ctype}{\XD@grab@harmless\relax}{1}%
+ {\XDParToMargin{\small\Ctypeidentifier{#1} (C~type)}}%
+ {\XDMainIndex{%
+ \LevelSorted{#1}{\Ctypeidentifier{#1} (C~type)}%
+ }}%
+ {{#1}{\Ctypeidentifier{#1} C~type}}
+ {}%
+% \end{macrocode}
+% \end{environment}\end{environment}\end{environment}
+%
+% \begin{macro}{\Cfunctionidentifier}
+% \changes{v\,2.40}{2003/04/05}{Macro added. (LH)}
+% \begin{macro}{\Cvariableidentifier}
+% \changes{v\,2.40}{2003/04/05}{Macro added. (LH)}
+% \begin{macro}{\Ctypeidentifier}
+% \changes{v\,2.40}{2003/04/05}{Macro added. (LH)}
+% These macros are used by \texttt{Cfunction}, \texttt{Cvariable}, and
+% \texttt{Ctype} to format the identifiers of C functions, variables,
+% and types respectively; the syntax is e.g.
+% \begin{quote}
+% |\Cfunctionidentifier|\marg{function name}
+% \end{quote}
+% They default to typeset them in an italic font---this is what CWEB
+% uses---but it is meant to be configurable.
+% \begin{macrocode}
+\newcommand*{\Cfunctionidentifier}[1]{\textit{#1}}
+\newcommand*{\Cvariableidentifier}[1]{\textit{#1}}
+\newcommand*{\Ctypeidentifier}[1]{\textit{#1}}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+%
+% \subsection{Regular expressions and friends}
+%
+% I have noticed that when one is describing the syntax of some \Tcl\
+% command\slash procedure, one often ends up writing argument lists with
+% lots of optional, repeated, or variant parts. In general one can of
+% course specify these using BNF syntax diagrams, but whereas occurrences
+% of the three syntactic constructions mentioned above are plenty,
+% there are much fewer occurrences of for example nesting. Since
+% furthermore even the simplest optional or repeated element
+% requires an extra syntactic term to be defined, it becomes interesting
+% to search for an alternative way of specifying these constructions.
+% One that is close at hand is that of regular expressions, as that is
+% anyway a part of the \Tcl\ language.
+%
+% \begin{macro}{\regstar}
+% \begin{macro}{\regplus}
+% \begin{macro}{\regopt}
+% These commands are used to modify the meaning of another syntactic
+% element. |\regstar| puts a star $^*$ on something, meaning it is
+% repeated zero or more times. |\regplus| puts a plus $^+$ on
+% something, meaning it is repeated one or more times. |\regopt| puts
+% a question mark $^?$ on something, meaning it is optional. Normally
+% these commands are simply put right after what they should modify,
+% but if the ``something'' is a regular expression block, i.e., a
+% \texttt{regblock} environment, then these things should be put as
+% the \meta{modifier} in
+% \begin{quote}
+% |\begin{regblock}|\oarg{modifier}\\
+% | |\textellipsis\\
+% |\end{regblock}|
+% \end{quote}
+% In particular, they should \emph{not} be put after the
+% |\end{regblock}|, as that may impair the placement of the exponent.
+% \begin{macrocode}
+\newcommand\regstar{\ensuremath{^*}}
+\newcommand\regplus{\ensuremath{^+}}
+\newcommand\regopt{\ensuremath{^?}}
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}
+%
+% \begin{macro}{\TD@delim@size}
+% \begin{macro}{\TD@delim@size@G}
+% These control sequences are used in determining what size the
+% delimiters (parentheses) around a regular expression block should
+% have. The values specify what should be the least size of a
+% delimiter that bracket a piece of text, and are interpreted as
+% follows: \(0={}\)normal size, \(1={}\)|\big| size, \(2={}\)|\Big|
+% size, \(3={}\)|\bigg| size, and $4$ and above is |\Bigg| size.
+%
+% |\TD@delim@size@G| is a macro which is always set globally and
+% which keeps track of the delimiter size at the innermost level.
+% |\TD@delim@size| is a |\count| register that is assigned locally
+% and is used for keeping track of delimiter sizes at all other
+% levels. Commands like |\word|, which contribute a delimiter to some
+% piece of text, should set |\TD@delim@size@G|.
+% \begin{macrocode}
+\newcount\TD@delim@size
+\gdef\TD@delim@size@G{0}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{environment}{regblock}
+% The \texttt{regblock} environment embarks upon a rather tricky scheme
+% of boxing and unboxing to determine the proper delimiter size. The
+% basic idea is that the contents of the environment are first typeset
+% in an \texttt{lrbox} environment, and |\TD@delim@size@G| is set to
+% its proper value. Then the left delimiter is set at this size, the
+% saved box is unboxed, and finally the right delimiter is set. All
+% through the process, the value of |\TD@delim@size@G| at the
+% beginning of the \texttt{regblock} environment has been saved in
+% |\TD@delim@size| and at the end |\TD@delim@size@G| is set to the
+% maximum of its old value and one plus its value inside the
+% \texttt{regblock} environment. This makes it possible to nest
+% \texttt{regblock} environments.
+%
+% It is not quite that easy, though. A regular expression can consist
+% of several branches, which must be separated by vertical bars.
+% These bars should be the same size as the delimiters around the
+% regular expression, and hence the bars cannot be typeset before
+% every branch has been typeset. Therefore the \texttt{regblock}
+% environment starts an extra horizontal list (the |\hbox|) for the
+% sole purpose of storing the branches that have already been typeset
+% (and \emph{only} these). Each branch is put on the list as a box.
+% When all branches have been typeset, they are first removed from the
+% list (by |\TD@join@branches|), and then they are inserted again, but
+% this time they are unboxed and separated by suitable delimiters.
+% Finally the |\hbox| is ended and almost immediately unboxed.
+%
+% \changes{v\,2.40}{2003/04/05}{Renamed the \texttt{regexp}
+% environment to \texttt{regblock}. A \texttt{regexp} environment
+% is provided for compatibility. (LH)}
+% \begin{macrocode}
+\newenvironment{regblock}[1][]{%
+ \leavevmode
+ \def\TD@modifier{#1}%
+ \TD@delim@size=\TD@delim@size@G
+ \let\regalt=\TD@regalt
+ \setbox\z@=\hbox\bgroup
+ \TD@delim@size=\z@
+ \begin{lrbox}{\z@}%
+ \gdef\TD@delim@size@G{0}%
+ \ignorespaces
+}{%
+ \end{lrbox}%
+ \ifnum \TD@delim@size@G>\TD@delim@size
+ \TD@delim@size=\TD@delim@size@G\relax
+ \fi
+ {\TD@join@branches}%
+ \unhbox\z@
+ $\TD@size@delimiter)\TD@modifier$%
+ \advance \TD@delim@size \@ne
+ \xdef\TD@delim@size@G{\the\TD@delim@size}%
+ \egroup
+ \ifnum \TD@delim@size@G<\TD@delim@size
+ \xdef\TD@delim@size@G{\the\TD@delim@size}%
+ \fi
+ \unhbox\z@
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{regexp}
+% This is an alias to the \texttt{regblock} environment, provided for
+% compatibility.
+% \begin{macrocode}
+\newenvironment{regexp}{\regblock}{\endregblock}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\TD@join@branches}
+% \changes{v\,2.12}{2000/11/13}{Made penalty for linebreak after
+% \cs{regalt} depend on the delimiter size. (LH)}
+% The |\TD@join@branches| macro uses |\lastbox| to retrieve all boxes
+% in the current horizontal list, and unboxes them. Between the
+% unboxed boxes it puts a |\vert| delimiter, and before the first it
+% puts a left parenthesis. Both will be the current delimiter size.
+% \begin{macrocode}
+\def\TD@join@branches{%
+ \setbox\z@=\lastbox
+ \ifvoid\z@
+ $\TD@size@delimiter($%
+ \else
+ {\TD@join@branches}%
+ \unhbox\z@
+ ~$\TD@size@delimiter\vert$%
+ \count@=\TD@delim@size
+ \advance \count@ \@ne
+ \multiply \count@ -\@lowpenalty
+ \penalty\count@\ %
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\regalt}
+% \begin{macro}{\TD@regalt}
+% The |\regalt| command is used in a \texttt{regblock} environment
+% to separate two branches. It ends an \texttt{lrbox} environment,
+% puts the box collected in the surrounding horizontal list (which
+% was begun by the |\hbox| in |\lrbox|), and begins a new
+% \texttt{lrbox} environment. As this would not make sense outside a
+% \texttt{regblock} environment however, the |\regalt| command does by
+% default only produce an error message. The ``real'' definition is
+% kept in |\TD@regalt| and the \texttt{regblock} environment locally
+% redefines |\regalt|.
+% \begin{macrocode}
+\newcommand\regalt{%
+ \PackageError{tclldoc}{%
+ Lonely \protect\regalt--perhaps a missing regblock environment%
+ }\@eha
+}
+\def\TD@regalt{%
+ \end{lrbox}%
+ \box\z@
+ \ifnum \TD@delim@size@G>\TD@delim@size
+ \TD@delim@size=\TD@delim@size@G\relax
+ \fi
+ \begin{lrbox}{\z@}%
+ \gdef\TD@delim@size@G{0}%
+}
+% \end{macrocode}
+% \end{macro}\end{macro}
+%
+% \begin{macro}{\TD@size@delimiter}
+% This macro expands to nothing, |\big|, |\Big|, |\bigg|, or |\Bigg|
+% depending on the value of |\TD@delim@size|.
+% \begin{macrocode}
+\def\TD@size@delimiter{%
+ \ifcase\TD@delim@size
+ \or \expandafter\big \or \expandafter\Big \or
+ \expandafter\bigg \else \expandafter\Bigg
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\word}
+% \changes{v\,2.10}{2000/10/13}{Reimplemented like the new \cs{meta}.
+% (LH)}
+% \changes{v\,2.12}{2000/11/21}{Using braces instead of angle brackets.
+% (LH)}
+% This command works like |\meta|, but the argument is enclosed in
+% braces rather than angle brackets and it communicates with the
+% \texttt{regblock} environment (the braces count as a smallest-size
+% delimiter). Something marked out using |\word| rather than |\meta|
+% is meant to always denote a separate \Tcl\ word.
+% \begin{macrocode}
+\DeclareRobustCommand\word[1]{%
+ \leavevmode
+ \ifmmode \expandafter \nfss@text \fi
+ {%
+ $\{$%
+ \meta@font@select
+ \edef\meta@hyphen@restore
+ {\hyphenchar\the\font\the\hyphenchar\font}%
+ \hyphenchar\font\m@ne
+ \language\l@nohyphenation
+ #1\/%
+ \meta@hyphen@restore
+ $\}$%
+ }%
+ \ifnum \TD@delim@size@G<\@ne \gdef\TD@delim@size@G{1}\fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Logos}
+%
+% \begin{macro}{\Tcllogo}
+% \changes{v\,2.03}{2000/09/15}{Macro added. (LH)}
+% The |\Tcllogo| command makes a \Tcl\ ``logo'', which simply consists
+% of the three letters `T', `c', and `l' in the current font. The only
+% special thing about it is that there is a kern between the `T' and
+% the `c', since most fonts doesn't have that kern. No work has been
+% put into tuning the kern, but the size is about right. As a
+% comparison the kern between `T' and `o' in \texttt{cmr10} is
+% $-0.083334\,\mathrm{em}$.
+% \begin{macrocode}
+\DeclareRobustCommand\Tcllogo{T\kern-0.1em cl}
+%</pkg>
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v\,2.03}{2000/09/15}{\cs{DescribeResource} command removed.
+% Just in case anyone is interested in using it, I have included it as
+% a code example in the source for the \package{xdoc} package. (LH)}
+%
+%
+% \section{The \package{tclldoc} class}
+%
+% \subsection{Option declarations and processing}
+%
+% \begin{option}{a5paper}
+% \begin{option}{olddocinclude}
+% The \texttt{a5paper} (to the \package{article} document class) and
+% the \texttt{olddocinclude} (to the \package{xdoc} package) are not
+% supported for the \package{tclldoc} class.
+% \begin{macrocode}
+%<*class>
+\DeclareOption{a5paper}{%
+ \ClassError{tclldoc}{The a5paper option is not supported}\@eha
+}
+\DeclareOption{olddocinclude}{%
+ \ClassError{tclldoc}{The olddocinclude option is not supported}\@eha
+}
+% \end{macrocode}
+% \end{option}\end{option}
+%
+% \begin{option}{notrawchar}
+% The \texttt{notrawchar} option is passed on to the
+% \package{tclldoc} package (which will pass it on to the
+% \package{xdoc} package).
+% \changes{v\,2.40}{2003/04/05}{Added processing of this option; it
+% wouldn't take if it was simply given as a global option. (LH)}
+% \begin{macrocode}
+\DeclareOption{notrawchar}{%
+ \PassOptionsToPackage{notrawchar}{tclldoc}%
+}
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassOptionsToClass{\CurrentOption}{article}}
+% \end{macrocode}
+%
+%
+%
+% Input a local configuration file, if it exists.
+% \begin{macrocode}
+\InputIfFileExists{tclldoc.cfg}
+ {\typeout{*************************************^^J%
+ * Local config file tclldoc.cfg used^^J%
+ *************************************}}
+ {}
+% \end{macrocode}
+%
+%
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Loading the base class}
+%
+% \begin{macrocode}
+\LoadClass{article}
+% \end{macrocode}
+%
+%
+% \subsection{The layout}
+%
+% Increase the text width slightly so that with the standard fonts
+% 72 columns of code may appear in a |macrocode| environment.
+% \changes{ \package{ltxdoc} v\,2.0c}{1994/03/15}{Set \cs{textwidth}.}
+% \begin{macrocode}
+\setlength{\textwidth}{355pt}
+% \end{macrocode}
+%
+% Increase the marginpar width slightly, for long command names.
+% And increase the left margin by a similar amount
+% \changes{ \package{ltxdoc} v\,2.0l}
+% {1994/05/25}{Increase \cs{marginparwidth}}
+% \changes{ \package{ltxdoc} v\,2.0q}{1995/11/28}
+% {Increase \cs{marginparwidth} and page margin.}
+% \begin{macrocode}
+\addtolength\oddsidemargin{20pt}
+\addtolength\evensidemargin{20pt}
+% \end{macrocode}
+%
+%
+% Change some defaults for list formatting. In particular, continue to
+% indent paragraphs in |\list| environments and don't put extra space
+% between them.
+% \changes{ \package{pasdoc} v\,1.30}{1999/08/31}{Modifying the list
+% formatting. (LH)}
+%
+% \begin{macro}{\TD@list}
+% \begin{macro}{\@listi}
+% \begin{macro}{\@listI}
+% \begin{macro}{\@listii}
+% \begin{macro}{\@listiii}
+% \begin{macro}{\@listiv}
+% \begin{macro}{\@listv}
+% \begin{macro}{\@listvi}
+% \begin{macrocode}
+\def\@tempa#1{%
+ \expandafter\def \expandafter#1\expandafter{#1\TD@list}%
+}
+\def\TD@list{%
+ \advance \itemsep \parsep
+ \parsep=\z@\@plus\p@\relax
+ \advance \itemsep -\parsep
+ \listparindent=1em\relax
+}
+\@tempa\@listi
+\let\@listI\@listi
+\@tempa\@listii
+\@tempa\@listiii
+\@tempa\@listiv
+\@tempa\@listv
+\@tempa\@listvi
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}\end{macro}
+%
+%
+% \subsection{Loading the \package{tclldoc} package}
+%
+% \begin{macrocode}
+\RequirePackage[dolayout]{tclldoc}
+% \end{macrocode}
+%
+% \begingroup
+% Make \verb+|+ be a `short verb' character, but not in the document
+% preamble, where an active character may interfere with packages that
+% are loaded.
+% \DoNotIndex{\|}
+% \begin{macrocode}
+\AtBeginDocument{\MakeShortTclverb{\|}}
+% \end{macrocode}
+% \endgroup
+%
+% As \texttt{.dtx} documents tend to have a lot of monospaced material,
+% set up some \texttt{cmtt} substitutions to occur silently.
+% \changes{ \package{ltxdoc} v\,2.0p}{1995/11/02}{Add font substitutions}
+% \begin{macrocode}
+\DeclareFontShape{OT1}{cmtt}{bx}{n}{<-> ssub * cmtt/m/n}{}
+\DeclareFontFamily{OMS}{cmtt}{\skewchar\font'60}
+\DeclareFontShape{OMS}{cmtt}{m}{n}{<-> ssub * cmsy/m/n}{}
+\DeclareFontShape{OMS}{cmtt}{bx}{n}{<-> ssub * cmsy/b/n}{}
+% \end{macrocode}
+% This substitution is in the standard fd file, but not silent.
+% \begin{macrocode}
+\DeclareFontShape{OT1}{cmss}{m}{it}{<->ssub*cmss/m/sl}{}
+% \end{macrocode}
+%
+%
+% \subsection{More layout}
+%
+% \changes{v\,2.12}{2000/11/26}{Setting \cs{marginparwidth} so that the
+% outer edge of the marginpar is $1\,\mathrm{cm}$ from the paper
+% edge. (LH)}
+% \changes{v\,2.12}{2000/11/27}{Rearranged code so that
+% the \cs{marginparwidth} is set after \package{tclldoc} has been
+% loaded; otherwise \package{doc} might overwrite it! (LH)}
+% \begin{macrocode}
+\setlength\marginparwidth{\evensidemargin}
+\addtolength\marginparwidth{1in}
+\addtolength\marginparwidth{-\marginparsep}
+\addtolength\marginparwidth{-1cm}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+\CodelineNumbered
+\DisableCrossrefs
+% \end{macrocode}
+%
+% \begin{macrocode}
+\setcounter{StandardModuleDepth}{1}
+%</class>
+% \end{macrocode}
+%
+%
+% \section{The \package{tcldoc} compatibility package and class}
+%
+% \changes{v\,2.30}{2001/09/02}{Renamed the package and class to
+% \package{tclldoc} to prevent confusion with the \Tcl Doc Perl
+% script. Added files \texttt{tcldoc.sty} and \texttt{tcldoc.cls}
+% for compatibility. Moved code related to the \texttt{macinputenc}
+% option to \texttt{tcldoc.cls}; this option is now unsupported.
+% (LH)}
+%
+% \subsection{Pre-options definitions}
+%
+% \begin{macro}{\if@rtkinenc@}
+% Switch. True iff the \package{rtkinenc} package should be loaded.
+% It starts out false.
+% \begin{macrocode}
+%<*compclass>
+\newif\if@rtkinenc@
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection{Option declarations and processing}
+%
+% \begin{option}{macinputenc}
+% The \texttt{macinputenc} option enables some special code for
+% supporting the typesetting of \Tcl\ code written for the Macintosh
+% input encoding (cf.\ the \texttt{applemac} option to the
+% \package{inputenc} package).
+% \begin{macrocode}
+\DeclareOption{macinputenc}{%
+ \PassOptionsToPackage{applemac}{rtkinenc}%
+ \@rtkinenc@true
+}
+% \end{macrocode}
+% \end{option}
+%
+%
+% \begin{macrocode}
+\DeclareOption*{%
+ \PassOptionsToClass{\CurrentOption}{tclldoc}}
+% \end{macrocode}
+%
+%
+%
+% Input a local configuration file, if it exists.
+% \begin{macrocode}
+\InputIfFileExists{tcldoc.cfg}
+ {\typeout{*************************************^^J%
+ * Local config file tcldoc.cfg used^^J%
+ *************************************}}
+ {}
+% \end{macrocode}
+%
+%
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+% \subsection{Loading the base package or class}
+%
+% \begin{macrocode}
+\LoadClass{tclldoc}
+%</compclass>
+%<comppkg>\LoadPackageWithOptions{tclldoc}
+% \end{macrocode}
+%
+%
+% \subsection{Input encoding and font representations}
+%
+% There are some rather tricky issues concerning interpretation of the
+% input in \Tcl\ code. If the |\MacroFont| font contains a character that
+% correctly represents a character in the input, then that character is
+% obviously what one would like to appear in the typeset output. If no
+% font in the entire \TeX\ system contains a character that looks like
+% the one in the input, then just as obviously must one examine whether
+% there exists some other method of specifying that character. In the
+% case of \Tcl\ code, a suitable method seems to be to typeset the
+% equivalent |\x|\meta{dd} escape sequence instead. It is for the
+% purpose of being able to detect these cases that the
+% \package{tcldoc} class (if the user so requests) loads the
+% \package{rtkinenc} package, rather than the standard \LaTeX\
+% \package{inputenc} package.
+%
+% The problem of determining for each input character which method of
+% representation that should be used---single character or escape
+% sequence---does not have a unique solution. Therefore the default
+% set-up is to not define any special fakes at all, which means the
+% escape sequence method will be chosen in the doubtful cases. There are
+% also a couple of options for the \package{tcldoc} class that define
+% all (or nearly all) possible fakes---the difference between them lie
+% in which fonts are assumed to be present in the system. A user who
+% does not like any of these predefined options also has the option of
+% putting the corresponding |\Declare|\-|Text|\-|Default|\textellipsis
+% \ commands directly into the \texttt{tcldoc.cfg} file.
+%
+% \begin{macro}{\InputModeCode}
+% \begin{macro}{\SetUnavailableAction}
+% \begin{macro}{\DeclareInputMath}
+% \begin{macro}{\RIE@undefined}
+% The \package{tclldoc} package calls some commands defined by the
+% \package{rtkinenc} package, but since \package{rtkinenc} is not
+% required by the \package{tclldoc} package, the \package{tclldoc}
+% package must provide its own definitions, even though these can be
+% no-ops. Definition of these commands is delayed until
+% |\begin|\nolinebreak[1]|{document}| to avoid problems if the user
+% loads the \package{rtkinenc} package after the \package{tclldoc}
+% package.
+% \begin{macrocode}
+%<*pkg>
+\AtBeginDocument{%
+ \providecommand*\InputModeCode{}%
+ \providecommand*\SetUnavailableAction[1]{}%
+ \providecommand*\DeclareInputMath[2]{}%
+ \providecommand*\RIE@undefined[1]{\@inpenc@undefined}%
+}
+%</pkg>
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}
+%
+% \begin{macrocode}
+%<*compclass>
+\if@rtkinenc@
+ \RequirePackage{rtkinenc}
+% \end{macrocode}
+%
+% \begin{macro}{\.}
+% \begin{macro}{\H}
+% \begin{macro}{\textemdash}
+% \begin{macro}{\textendash}
+% \begin{macro}{\textexclamdown}
+% \begin{macro}{\textquestiondown}
+% \begin{macro}{\textquotedblleft}
+% The following text commands are defined by \texttt{OT1enc.def}, but
+% their definitions will not work for \texttt{OT1}-encoded typewriter
+% fonts. Therefore they are redefined, either so that they work
+% anyway (|\textexclamdown| and |\textquestiondown|) or so that they
+% call |\TextSymbolUnavailable| when \package{rtkinenc} is in code
+% mode. This should make things work for the best in most
+% reasonable situations.
+%
+% It could be noted here that the definitions below for |\.| and |\H|
+% does not quite behave as if the commands had not been defined at
+% all (I'm assuming that \package{rtkinenc} is in code mode here); an
+% undefined command would leave its argument to be typeset, but the
+% definitions below will swallow it in those cases.
+% \begin{macrocode}
+ \DeclareTextCommand{\.}{OT1}[1]{%
+ \IfInputModeCode{\TextSymbolUnavailable\.}%
+ {\add@accent{95}{#1}}%
+ }
+ \DeclareTextCommand{\H}{OT1}[1]{%
+ \IfInputModeCode{\TextSymbolUnavailable\H}%
+ {\add@accent{125}{#1}}%
+ }
+ \DeclareTextCommand{\textemdash}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textemdash}{\char 124 }%
+ }
+ \DeclareTextCommand{\textendash}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textendash}{\char 123 }%
+ }
+ \DeclareTextCommand{\textexclamdown}{OT1}{!`}
+ \DeclareTextCommand{\textquestiondown}{OT1}{?`}
+ \DeclareTextCommand{\textquotedblleft}{OT1}{%
+ \IfInputModeCode{\TextSymbolUnavailable\textquotedblleft}%
+ {\char 92 }%
+ }
+% \end{macrocode}
+% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
+% \end{macro}
+%
+% Several of the definitions in \texttt{applemac.def} can be improved.
+% Most of it is about seeing to that all characters have a proper text
+% mode definition, so that their unavailability can be trapped.
+%
+% \begin{macrocode}
+ \def\@tempa{applemac}
+ \ifx \@tempa\RIE@encoding
+ \DeclareInputBoth{173}{\textneq}{\neq}
+ \DeclareInputBoth{176}{\textinfty}{\infty}
+ \DeclareInputBoth{177}{\textpm}{\pm}
+ \DeclareInputBoth{178}{\textleq}{\leq}
+ \DeclareInputBoth{179}{\textgeq}{\geq}
+ \DeclareInputBoth{181}{\textmu}{\mu}
+ \DeclareInputBoth{182}{\textpartial}{\partial}
+ \DeclareInputBoth{183}{\textSigma}{\Sigma}
+ \DeclareInputBoth{184}{\textPi}{\Pi}
+ \DeclareInputBoth{185}{\textpi}{\pi}
+ \DeclareInputBoth{186}{\textint}{\int}
+ \DeclareInputBoth{189}{\textohm}{\Omega}
+ \DeclareInputBoth{194}{\textlnot}{\lnot}
+ \DeclareInputBoth{195}{\textsurd}{\surd}
+ \DeclareInputBoth{197}{\textapprox}{\approx}
+ \DeclareInputBoth{198}{\textDelta}{\Delta}
+ \DeclareInputBoth{214}{\textdiv}{\div}
+ \DeclareInputBoth{215}{\textdiamond}{\diamond}
+ \DeclareInputBoth{218}{\textfractionsolidus}{/}
+% \end{macrocode}
+%
+% Several of the above text commands are not defined in the \LaTeX\
+% kernel. Therefore one must either define them in some encoding, or
+% define a default for them, to make them proper text commands. If they
+% are not then their unavailability cannot be trapped. |\textapplelogo|
+% appears in \texttt{applemac.def}.
+% \begin{macrocode}
+ \ProvideTextCommandDefault{\textneq}{%
+ \TextSymbolUnavailable\textneq
+ }
+ \ProvideTextCommandDefault{\textapplelogo}{%
+ \TextSymbolUnavailable\textapplelogo
+ }
+ \DeclareTextSymbol{\textinfty}{OMS}{49}
+ \DeclareTextSymbol{\textpm}{OMS}{6}
+ \DeclareTextSymbol{\textleq}{OMS}{20}
+ \DeclareTextSymbol{\textgeq}{OMS}{21}
+% \DeclareTextSymbol{\textmu}{TS1}{181}
+ \DeclareTextSymbol{\textpartial}{OML}{64}
+ \DeclareTextSymbol{\textSigma}{OT1}{6}
+ \DeclareTextSymbol{\textPi}{OT1}{5}
+ \DeclareTextSymbol{\textpi}{OML}{25}
+ \DeclareTextSymbol{\textint}{OMS}{115}
+ \DeclareTextSymbol{\textohm}{OT1}{10} % Kind of \textOmega
+% \DeclareTextSymbol{\textlnot}{TS1}{172}
+% \DeclareTextSymbol{\textsurd}{TS1}{187}
+ \DeclareTextSymbol{\textapprox}{OMS}{25}
+ \DeclareTextSymbol{\textDelta}{OT1}{1}
+% \DeclareTextSymbol{\textdiv}{TS1}{246}
+ \DeclareTextSymbol{\textdiamond}{OMS}{5}
+% \DeclareTextSymbol{\textfractionsolidus}{TS1}{47}
+ \input{TS1enc.def}
+ \fi
+\fi
+% \end{macrocode}
+% \begin{macrocode}
+\let\if@rtkinenc@=\@undefined
+\let\@rtkinenc@true=\@undefined
+\let\@rtkinenc@false=\@undefined
+% \end{macrocode}
+% The |@rtkinenc@| switch isn't needed any more, so it might just as
+% well be undefined.
+%
+%
+% \subsection{Useful abbreviations}
+% \changes{v\,2.10}{2000/10/11}{\LaTeX\ abbreviation commands from
+% \package{ltxdoc} commented out. (LH)}
+%
+% The commands currently found in this section are inherited from the
+% \package{ltxdoc} package, but as they aren't of much use with \Tcl,
+% they have been commented out.
+%
+% |\cmd{\foo}| Prints |\foo| verbatim. It may be used inside moving
+% arguments. |\cs{foo}| also prints |\foo|, for those who prefer that
+% syntax. (This second form may even be used when |\foo| is |\outer|).
+% \begin{macro}{\cmd}
+% \begin{macro}{\cs}
+% \DoNotIndex{\\}
+% \begin{macrocode}
+% \def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
+% \def\cmd@to@cs#1#2{\char\number`#2\relax}
+% \DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\marg}
+% |\marg{text}| prints \marg{text}, `mandatory argument'.
+% \DoNotIndexHarmless{\PrintChar{`\{}}
+% \DoNotIndexHarmless{\PrintChar{`\}}}
+% \begin{macrocode}
+% \providecommand\marg[1]{%
+% {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oarg}
+% |\oarg{text}| prints \oarg{text}, `optional argument'.
+% \begin{macrocode}
+% \providecommand\oarg[1]{%
+% {\ttfamily[}\meta{#1}{\ttfamily]}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\parg}
+% |\parg{te,xt}| prints \parg{te,xt}, `picture mode argument'.
+% \begin{macrocode}
+% \providecommand\parg[1]{%
+% {\ttfamily(}\meta{#1}{\ttfamily)}}
+%</compclass>
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+% \changes{v\,2.00}{2000/07/17}{Section with \cs{DocInclude} removed,
+% since that is defined by \package{xdoc}. (LH)}
+%
+% \Finale
+%
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/tcldoc/tclldoc.ins b/Master/texmf-dist/source/latex/tcldoc/tclldoc.ins
new file mode 100644
index 00000000000..aeb0a96841a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tclldoc.ins
@@ -0,0 +1,51 @@
+% This file is the docstrip installation script for the tclldoc package.
+%
+% It may be distributed 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.
+%
+% Copyright 2000 2001 Lars Hellstr\"om
+
+\input docstrip.tex
+
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+\endpreamble
+
+\usedir{tex/latex/tclldoc}
+
+\keepsilent
+
+\generate{%
+ \file{tclldoc.cls}{%
+ \from{tclldoc.dtx}{class}
+ }%
+ \file{tclldoc.sty}{%
+ \from{tclldoc.dtx}{pkg}
+ }%
+ \file{tcldoc.cls}{%
+ \from{tclldoc.dtx}{compclass}
+ }%
+ \file{tcldoc.sty}{%
+ \from{tclldoc.dtx}{comppkg}
+ }%
+}
+
+\endbatchfile
+\endinput
diff --git a/Master/texmf-dist/source/latex/tcldoc/tools/README.txt b/Master/texmf-dist/source/latex/tcldoc/tools/README.txt
new file mode 100644
index 00000000000..c8fd744afd8
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tools/README.txt
@@ -0,0 +1,46 @@
+README for eemenu and sourcetcl:
+=====================================
+
+eemenu is a package for the Alpha/Alphatk text
+editors. Among other things, it implements
+a command that makes it possible to evaluate
+all Tcl code in an open .dtx file window with
+a single keypress. For more information, run
+LaTeX on eemenu.dtx.
+
+Running LaTeX on eemenu.ins generates the two
+files
+ eemenu.tcl
+ eefor7menu.tcl
+Both implement the same commands, but eemenu.tcl
+requires version 8 of the AlphaTcl library,
+whereas eefor7menu.tcl requires version 7.5 or
+7.6 of that library.
+
+See http://alphatcl.sourceforge.net/ and the
+links there for more information about the
+Alpha/Alphatk text editors.
+
+
+
+sourcedtx implements a Tcl command dtx::source
+that one can use to source Tcl code directly from
+a .dtx file. To generate sourcetcl.tcl, run LaTeX
+on sourcetcl.ins. To typeset the documentation,
+run LaTeX on sourcetcl.dtx. To see an example of
+what it does, you can try the following commands
+in a Tcl shell:
+
+ source sourcedtx.tcl
+ dtx::source ../examples/pdf.dtx {pkg example1}
+
+(It assumes the tclldoc/examples directory is a
+sibling of the current directory.) This should
+generate a file hello.pdf in the current
+directory, which contains a single page with the
+two words "Hello world!".
+
+
+
+Lars Hellström,
+20 July 2003
diff --git a/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.dtx b/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.dtx
new file mode 100644
index 00000000000..d2383b7c1e0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.dtx
@@ -0,0 +1,4477 @@
+%
+% \iffalse
+%<*driver>
+\documentclass[a4paper]{tclldoc}
+
+\newcommand{\eemenu}{\textsf{EE} menu}
+\DeclareRobustCommand\Alpha{\textit{Alpha}}
+\DeclareRobustCommand\AlphaEight{\textit{Alpha\,8}}
+\DeclareRobustCommand\AlphaTk{\textit{Alphatk}}
+\DeclareRobustCommand\AlphaTcl{\textit{Alpha\Tcllogo}}
+\DeclareRobustCommand\TclAE{\Tcllogo\AE}
+\DeclareRobustCommand\package[1]{\textsf{#1}}
+
+\providecommand{\href}[2]{#2}
+
+\usepackage{xdoc2}
+\newenvironment{details}[1]{%
+ \description
+ \def\commandmethod{#1}%
+}{\enddescription}
+\makeatletter
+\newcommand{\detailitem}{%
+ \XD@grab@arguments{\@detailitem}{\XD@grab@harmless\relax}%
+}
+\def\@detailitem#1{%
+ \item[\texttt{#1}%
+ \IndexEntry{\LevelSame{\commandmethod\ method}%
+ \LevelSorted{#1}{\texttt{#1} detail}%
+ }{main}{\TheXDIndexNumber}%
+ ]%
+}
+\makeatother
+
+% \addtolength{\marginparwidth}{0.7cm}
+
+\CodelineIndex
+\setcounter{IndexColumns}{2}
+
+\begin{document}
+\DocInput{eemenu.dtx}
+\PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \title{The \eemenu}
+% \author{Lars Hellstr\"om}
+% \date{17 July 2003}
+% \maketitle
+%
+%
+% \begin{abstract}
+% The \eemenu\ package for the \Alpha\ family of text editors provides
+% commands for sending small pieces of code from a source file window
+% to various interpreters. It can handle multiple languages and
+% multiple source file formats.
+% \end{abstract}
+%
+% \tableofcontents
+%
+%
+% \section{Introduction}
+%
+% When writing code for an interpreted language, it is a great
+% convenience to be able to test arbitrary pieces of code by sending
+% them to a relevant interpreter and examining the results. Many of
+% \Alpha's modes provide such functionality, but not always with the
+% full generality one would need. Furthermore these features are usually
+% tied to the specific mode and thus become much less convenient if code
+% in several different languages are mixed in the same file. The
+% \eemenu\ provides a general mechanism for constructing new commands
+% of this kind, thereby making it possible to better tailor them for the
+% case at hand.
+%
+%
+% \subsection{Using an \eemenu\ command}
+%
+% The basic usage is straightforward: you select a piece of text and
+% invoke one of the \eemenu\ commands. This will \emph{extract}
+% the part of that selection which is code and send it to the relevant
+% interpreter, where it will be \emph{evaluated}. (Indeed, the \textsf{EE}
+% in \eemenu\ is for ``extract and evaluate''.) You will also get
+% a \emph{report} (by default a message on the status line) about the
+% result of the command. This is all quite similar to how the
+% \textsf{Evaluate} command in the \Tcllogo\ menu works, but it is much
+% more general.
+%
+% Two very natural questions at this point are of course ``How does it
+% know what part of the selection is `code'?'' and ``How does it know
+% which the `relevant interpreter' is?''. The answer to both these
+% questions is that this information is built into the particular command
+% you invoke. Just as the standard \textsf{Evaluate} command has its
+% definition of what `code' is (the entire selection is code) and which
+% the `relevant interpreter' is (\Alpha's internal \Tcllogo\
+% interpreter), each \eemenu\ command has built-in definitions of
+% these things. The difference is that with \textsf{Evaluate} you would
+% have to do some programming to change these things, whereas with the
+% \eemenu\ commands you don't, since there is a multitude of ways in
+% which each part of the exatract-and-evaluate process can be configured.
+%
+% To begin with, each \eemenu\ command consists of four pieces which
+% are quite independent of each other. When the \emph{extract} piece is
+% called it looks at the selection and returns the next line of code in
+% it, or says that there are no more code lines that can be extracted.
+% What happens to the extracted lines of code is of no concern to the
+% extractor. The \emph{evaluate} piece takes a list of lines and sends
+% them to an interpreter (internal or external). It also compiles a
+% sort of report on the result of the evaluation, based on the reply
+% (if there was any) that it recieves from the interpreter. This is
+% then given to the \emph{reporter}, which displays the report (or more
+% often, for brevity, the central part of the report) to the user. The
+% fourth piece is called the \emph{completeness test} and determines
+% whether a list of code lines constitute a unit that can be evaluated.
+%
+% The way it goes is that lines are extracted until the completeness
+% test says OK, then the lines are sent for evaluation and the report on
+% evaluation is sent to the reporter, after which the whole thing starts
+% again and lines are extracted until the form a new complete unit,
+% which is then evaluated, and so on. The \eemenu\ command doesn't stop
+% until all code lines in the selection have been extracted or evaluation
+% reports an error.
+% If there is an error in evaluation then the report will say so, and
+% futhermore the cursor will be moved to the beginning of the first
+% line in the code unit that failed to evaluate correctly. Furthermore
+% the pin will be moved to the end of the selection, so that a simple
+% \textsf{Hilite} will reselect the part of the original selection that
+% still has not been successfully evaluated. If there wasn't any
+% selection to start with then the extractor behaves as if the entire
+% file was selected.
+%
+%
+% \subsection{Editing and invoking \eemenu\ commands}
+%
+% Each of the four pieces of what a command does are handled by a
+% \emph{method}. There are extraction methods, completeness test
+% methods, evaluation methods, and report methods, all of which can be
+% combined arbitrarily to make up a new \eemenu\ command. This is done
+% in the \textsf{Edit Commands} dialog, which is brought up by
+% choosing that item in the \textsf{EE} menu.
+%
+% The \textsf{Edit Commands} dialog has one page for each \eemenu\
+% command that is defined. At the bottom of the dialog there is a row
+% of four buttons \textsf{New}, \textsf{Duplicate}, \textsf{Rename}, and
+% \textsf{Delete} which add, remove, or rename \eemenu\ commands. Above
+% those are four pop-up menus, in which one chooses which four methods
+% the command should consist of. Above these are four other items which
+% control how the command is invoked.
+%
+% There are two ways of invoking an \eemenu\ command. One possibility
+% is to choose it directly in the \textsf{EE} menu, although it is not
+% necessarily the case that all commands are available there. Whether a
+% command is available is controlled through the \textsf{Put in menu}
+% item on the \textsf{Edit Commands} dialog page of that command. The
+% other possibility of invoking a command is through a key binding, and
+% that is controlled through the three remaining items \textsf{Active},
+% \textsf{Command keybinding}, and \textsf{Binding mode} in the
+% \textsf{Edit Commands} dialog. The \textsf{Command keybinding} item
+% controls which key binding one should use for a command. The
+% \textsf{Binding mode} item is used to specify a mode for this
+% binding; a binding without mode will be global. Finally, a command is
+% said to be \emph{active} if there is a key binding to it. The
+% \textsf{Active} item controls whether the command should be active by
+% default (at startup).
+%
+% For temporary activation and deactivation of commands, one should
+% instead use the \textsf{Active Commands} submenu of the \textsf{EE}
+% menu. This submenu lists all \eemenu\ commands. Those that are
+% currently active have a check mark next to them, and selecting an item
+% in this menu toggles activation state of that command. If two commands
+% have the same binding then activating one will deactivate the other.
+%
+% Besides the items mentioned above, the \textsf{Edit Commands} dialog
+% also has a \textsf{Details} button in the lower left corner. This
+% button is very important, since it brings up a subdialog that shows
+% all the method-specific settings. The methods and their details are
+% described below, but it should be observed here that it is to a large
+% extent these detail settings that decide, amogst other things, what
+% text should count as extractable code and which interpreter should
+% evaluate the code. To get back from the details subdialog to the main
+% \textsf{Edit Commands} dialog, one presses the \textsf{Back} button.
+% The details subdialog is logically a part (which is normally hidden)
+% of the main \textsf{Edit Commands} dialog. Changes to items in the
+% dialog, whether those appear in the main dialog or in the subdialog,
+% are kept if one presses \textsf{OK} in the main dialog and forgotten
+% if one presses the \textsf{Cancel} button.
+%
+%
+% \subsection{Extraction methods and their details}
+%
+% The default extraction method is the \textsf{Raw} method. It
+% considers the entire selection to be extractable code and has no
+% detail settings.
+%
+% The \textsf{Regexp} extraction method uses line-oriented regular
+% expressions to decide what is extractable code. This extraction
+% process works in two steps. First the lines in the selection are
+% tested against a filter, and those lines that passes are considered to
+% contain code. The filter works in one of three modes: \texttt{off}
+% (all lines pass), \texttt{grep} (only those lines that match a
+% specific regular expression passes), and \texttt{anti-grep} (only
+% those lines that \emph{don't} match a specific regular expression
+% passes). The filter mode and the regular expression used in the
+% filter are the two detail settings that affect the filter.
+% The second step in \textsf{Regexp} extraction is to feed each line
+% that passes the filter through |regsub|. This can be used to remove
+% from the lines some piece of text that is markup rather than part of
+% the code. Both the search and the replace regular expressions in this
+% step are detail settings of the \textsf{Regexp} extraction method.
+%
+% The \textsf{Docstrip} extraction method, finally, emulates what the
+% \textsf{docstrip} program\footnote{\textsf{docstrip} is part of the
+% standard \LaTeX\ distribution.} would do with the selection. It
+% recognises all kinds of guards and processes them correctly, but it
+% does not attempt to evaluate the guard expressions---instead it will
+% ask the user whether modules guarded by a given expression should be
+% included whenever it needs to know this. The values assigned to the
+% guard expressions will be forgotten each time the entire selection
+% is evaluated without error. Unlike \textsf{docstrip} the program,
+% \textsf{Docstrip} the extraction method will not include lines
+% beginning with |%%| in what is extracted, since those anyway only
+% contains comments.
+%
+% Besides the filtering that \textsf{docstrip} the program would do,
+% \textsf{Docstrip} the extraction method has two extra filtering
+% mechanisms that are designed mainly to prevent user errors. The first
+% is that extraction will only take place if the file name matches one
+% listed in the \textsf{File patterns} detail. The default pattern is
+% \texttt{*.dtx} which is usually what one wants, but changing it to
+% \texttt{*} will let anything through. The second mechanism, which is
+% off by default, sees to that code lines will only be considered for
+% extraction if they appear to be in an environment for code lines
+% (such as \texttt{macrocode}). This is useful if you in places tend to
+% leave a few lines of documentation not commented out during
+% development. To activate this mechanism, check the \textsf{Filter by
+% environments} detail. The \textsf{Source environments} detail is the
+% list of environments that are OK to extract from.
+%
+% As an example of how this works, consider a file that looks as
+% follows:
+% \DontCheckModules\iffalse
+%<*example>
+%<<EXAMPLE
+% \fi\begin{macrocode}
+% Text text text text text
+% \begin{tcl}
+set a A
+%<*andB>
+append a B
+%</andB>
+append a C
+%<*andD>
+append a D
+%</andB>
+expr $a
+string length $a
+% \end{tcl}
+% text text text.
+% \end{macrocode}\iffalse
+%EXAMPLE
+%</example>
+% \fi \CheckModules
+% If lines 1--7 above are selected and the \textsf{dtx -\textgreater\
+% internal Tcl} command is invoked (the \eemenu\ by default binds this
+% to \textsf{Cmd--L}), then three messages will flash by on the
+% status line, the last (and therefore the lasting) of which is the
+% message \texttt{Tcl eval OK: ABC}. If using instead a command that
+% uses the \textsf{Log Window} report method, then in addition to this
+% one would have the following lines added to the log window:
+% \begin{trivlist}\item\small
+% |% set a A|\\
+% |A|\\[\smallskipamount]
+% |% append a B|\\
+% |AB|\\[\smallskipamount]
+% |% append a C|\\
+% |ABC|
+% \end{trivlist}
+% The |%| lines show the commands that were evaluated and the
+% lines after these contain the respective results of these commands.
+% Before the |append a B| command is evaluated, \Alpha\ will stop and
+% ask
+% \begin{quote}
+% \textsf{Should \textless andB\textgreater\ modules be included?}
+% \end{quote}
+% In the case above the answer given was `Yes'; if it had been `No' then
+% the |append a B| command would neither be logged nor evaluated, and
+% the result of the |append a C| command would have been |AC|.
+%
+% If one continues by selecting lines 9--12 and invokes the same
+% command again then the status line will settle for the message
+% ``\texttt{Tcl\ eval\ error:\ syntax\ error\ in\ expression\ "ABCD"}'',
+% the insertion point will be moved to the beginning of line 11, and
+% the following information will be found in the log:
+% \begin{trivlist}\item\small
+% |% append a D|\\
+% |ABCD|\\[\smallskipamount]
+% |% expr $a|\\
+% |Error: syntax error in expression "ABCD"|\\
+% |Error info:|\\
+% |syntax error in expression "ABCD"|\\
+% | while executing|\\
+% |"expr $a"|
+% \end{trivlist}
+% If then line 11 is changed to |expr {$a}|, lines 11--12 are again
+% selected (e.g. using \textsf{Mark Hilite}), and the command is invoked
+% then logged material will be:
+% \begin{trivlist}\item\small
+% |% expr {$a}|\\
+% |ABCD|\\[\smallskipamount]
+% |% string length $a|\\
+% |4|
+% \end{trivlist}
+%
+% Finally, if lines 3--12 are selected and the command is invoked then
+% the user will be asked the following questions:
+% \begin{itemize}
+% \item \textsf{Should \textless andB\textgreater\ modules be included?}
+% (Possible answers are `Yes' and `No'.)
+% \item \textsf{Should \textless andD\textgreater\ modules be included?}
+% (Possible answers are `Yes' and `No'.)
+% \item \textsf{Module nesting error: \textless*andD\textgreater\
+% module ended by \textless/andB\textgreater. For which
+% guards should the positions be pushed?}
+% (Possible answers are `None', `Start', `End', and `Both'.)
+% \end{itemize}
+% In the last case, the extraction method has noticed that the guard
+% expressions that began (\textsf{andD}) and ended (\textsf{andB}) a
+% module are not equal (which is an error). Answering `Both' here will
+% push the positions of (the beginning of) both guard lines (8 and 10) onto
+% the bookmark stack so that they can easily be jumped to and corrected
+% later. After this, the \eemenu\ command will continue as if nothing had
+% happened.
+%
+%
+% \subsection{Completeness tests}
+%
+% The three completeness tests that come with \eemenu\ are
+% \textsf{\Tcllogo\ Info Complete}, \textsf{Entire Selection}, and
+% \textsf{Every Line}. The first of these uses the |info complete|
+% command in \Alpha's built-in \Tcllogo\ interpreter test whether the
+% list of lines extracted so far constitute a complete \Tcllogo\
+% script. \textsf{Entire Selection} and \textsf{Every Line} don't look
+% at the extracted lines at all however; instead the \textsf{Entire
+% Selection} test waits until the entire selection has been extracted
+% before it says it does constitute a complete unit, whereas
+% \textsf{Every Line} thinks every line is a complete unit. None of
+% these methods have any details.
+%
+%
+% \subsection{Evaluation methods}
+%
+% The list of available evaluation methods depends very much on the
+% current platform. The basic \eemenu\ package contains code for four
+% methods named \textsf{Internal Tcl}, \textsf{Do Script AE}, \textsf{Tk
+% Send}, and \textsf{Windoze DDE}, but only those for which the
+% underlying command can be found in the interpreter are actually
+% defined. The effect is usually that only two methods are available:
+% the \textsf{Internal Tcl} method and one method which depends on the
+% platform.
+%
+% The \textsf{Internal Tcl} method joins the lines of code with
+% linefeeds and passes the resulting string to \Alpha's internal
+% \Tcllogo\ interpreter for evaluation (at the global level). Errors
+% are caught and reported with a complete |errorInfo|. There are no
+% details for this method.
+%
+% The \textsf{Do Script AE} method sends a \texttt{dosc} AppleEvent with
+% the code to evaluate; hence it is only available on Mac~OS. The target
+% application for this event is one of the detail settings. The `Wait
+% for reply' detail setting controls whether the AppleEvent requests a
+% reply (not all target applications will provide one). If no reply is
+% requested then the report will only tell how many lines were sent.
+% If a reply is requested then that reply will be the report. Finally,
+% there are three detail settings that control how the list of lines
+% are converted to the string put in the \texttt{dosc} AppleEvent. The
+% lines can be joined using either of the following four strings: line
+% feed, carriage return, carriage return plus line feed, or just a
+% single space. It is also possible to specify a prefix and a suffix,
+% which are strings put before and after the extracted code that should
+% be evaluated.
+%
+% The \textsf{Tk Send} method uses the Tk |send| command to communicate
+% with the target interpreter; hence it is probably only useful with
+% \AlphaTk\ in an X-windows environment (typically on some Unix platform).
+% Most of the details work as for the \textsf{Do Script AE} method, but
+% there is a difference in how the target is identified. One detail
+% setting is the string used for identifying the target, but since the
+% names of targets for |send| are made unique on each server, there is
+% a chance that the intended target has not got the expected name. In
+% that case, a mechanism called `aliasing' will be invoked. It usually
+% displays a list of the available targets (which includes the option to
+% start a new Wish process) for the user to choose from, and the target
+% detail setting will then be considered to be an \emph{alias} for the
+% actual name of that target. If the alias behaviour is to ``Ask once''
+% then this choice will be remembered as long as \Alpha\ is running, but
+% if it is to ``Ask each time'' then it will only work for this invocation
+% of the \eemenu\ command. The behaviour can also be to fail, in which
+% case the command stops as for an error without presenting the user with
+% a list of available targets.
+%
+% The \textsf{Windoze DDE} method uses Dynamic Data Exchange to communicate
+% with the target interpreter; hence it is probably only useful with
+% \AlphaTk\ on the Windows platform. Most of the details work as for the
+% \textsf{Tk Send} method, but there are a few extra details that have
+% to do with how the target is identified. The target is identified with
+% two details called \textsf{Service} and \textsf{Target}. For sending
+% commands to a \Tcllogo\ interpreter it seems like the \textsf{Service}
+% should be \texttt{TclEval} and the \textsf{Target} is assigned as the
+% \textsf{Target} for the \textsf{Tk Send} method, but the \Tcllogo\
+% manual seems to suggest that the normal case is that the
+% \textsf{Service} is the name of an application and the
+% \textsf{Target} the name of a document open in that application (I
+% haven't had any chance to try it out in practice). Aliasing works as
+% for the \textsf{Tk Send} method, but since the target isn't
+% necessarily a \Tcllogo sh or Wish in this case, the actual command for
+% launching the new target must be configurable as well. This is the
+% purpose of the \textsf{Launch command} detail, whose value is a piece
+% of \Tcllogo\ code that \Alpha\ evaluates at the global level whenever
+% the user requests that a new target is launched. It is typically an
+% |exec| command.
+%
+% I am well aware that there are interpreters for which neither of these
+% methods may be appropriate. The method concept has however deliberately
+% been designed so that separate \AlphaTcl\ extensions can define new
+% methods that are just as easily available as the built-in ones. I
+% recommend that anyone who finds the available methods insufficient
+% tries to work out how one might otherwise communicate with the target
+% interpreter, so that the capabilities of \eemenu\ can be extended. One
+% particular possibility that should be explored is to (on Unix) hook up
+% interpreters as `slaves' of \Alpha\ (seizing control of
+% \texttt{stdin}, \texttt{stdout}, and \texttt{stderr}), so that the
+% target interpreter thinks it is getting text typed at an interactive
+% prompt. Since one would typically not want to start a new such `slave'
+% for each time an \eemenu\ command is invoked, it would probably be
+% necessary to add some functionality for managing slaves to the
+% \eemenu.
+%
+%
+% \subsection{Report methods}
+%
+% The default report method is \textsf{Status Line}, which shows the
+% most recent evaluation result on the status line. This is often
+% sufficient when all you're interested in is whether there was an
+% error or not.
+%
+% The \textsf{Log Window} report method creates a detailed log of the
+% commands evaluated and the results returned. This can be useful for
+% example when one is trying to debug a complex mathematical calculation
+% with several intermediate results. The first two details of this
+% method---\textsf{Window name} and \textsf{Window mode}---refer to the
+% window used to log the results. The logged text is inserted at the
+% end of this window. If no window with the specified name exists, then
+% a new one with mode \textsf{Window mode} and the shell flag set is
+% opened. The other details---\textsf{Prompt} and
+% \textsf{Antiprompt}---are text strings that are prepended to the
+% lines inserted into the log window. The \textsf{Prompt} is prepended
+% to extracted code lines, whereas the \textsf{Antiprompt} is prepended
+% to result lines.
+%
+%
+% \subsection{Writing new methods}
+%
+% A method consists of a couple of procedures which reside in a child
+% namespace of the \texttt{eemenu} namespace. Declaring a new method
+% simply amounts to writing these procedures and defining the detail
+% settings for the method. The general relation between method names and
+% namespace names is explained in Subsection~\ref{Ssec:Namespaces}. It
+% is suggested that one uses the \texttt{eemenu}\namespaceseparator
+% \texttt{define\_detail} command of Subsection~\ref{Ssec:CmdDialogs}
+% for defining detail settings. Different kinds of methods need to
+% provide different procedures for the main executive to call. The
+% interfaces used are described in the beginnings of
+% Sections~\ref{Sec:Extraction}--\ref{Sec:Report}.
+%
+%
+%
+%
+% \section{Main menu functionality}
+%
+% The rest of this paper describes the implementation of \eemenu\ and
+% its methods. The information here is useful mainly for those who want
+% to extend \eemenu\ by writing additional methods for it or otherwise
+% modify the code, but it could of course be of interest also for
+% advanced users.
+%
+%
+% \subsection{Initialization}
+%
+% \changes{v\,0.1}{2001/12/15}{Renamed package from \textsf{Eval~Menu}
+% to \textsf{EE~Menu}. (LH)}
+% \changes{v\,0.3}{2003/04/02}{Updated code for \AlphaTcl\,8. (LH)}
+% \changes{v\,0.3.1}{2003/07/19}{Added help. (LH)}
+%
+% \begin{tcl}
+%<*pkg>
+alpha::menu eeMenu 0.3.1 global "EE" {
+ auto_load eemenu::main
+} {
+ eemenu::init_bindings
+ eemenu::build_menu
+} {
+ eval eemenu::deactivate [array names eemenu::cmdA]
+} requirements {
+%<atcl7> alpha::package require AlphaTcl 7.5b1
+%<!atcl7> alpha::package require AlphaTcl 8.0d1
+} uninstall {this-file} help {
+ The EE menu provides commands for sending small pieces of code
+ from a source file window to various interpreters. It can handle
+ multiple languages and multiple source file formats.
+
+ The commands are built by combining four simple pieces called
+ methods. The choice of methods and parameters for methods to
+ use in a command is completely configurable through a dialog.
+ It is also possible to write extensions that define additional
+ methods and provide these through the same easy interface.
+
+ See the file eemenu.dtx for the full documentation.
+} maintainer\
+%<atcl7> [list "Lars Hellstr[text::Ascii 154 1]m" Lars.Hellstrom@math.umu.se]
+%<!atcl7> [list "Lars Hellstr\u00f6m" Lars.Hellstrom@math.umu.se]
+namespace eval eemenu {}
+% \end{tcl}
+% \setnamespace{eemenu}
+%
+%
+% \subsection{Methods and namespaces}
+% \label{Ssec:Namespaces}
+%
+% Each method for doing something is put in its own namespace, which
+% must be a child of the |eemenu| namespace.
+%
+% \begin{proc}{Prettify}
+% \begin{proc}{Unprettify}
+% In dialogs and preferences, method names are kept in ``prettified''
+% form, similar to that used in most of \Alpha's menus. Since the
+% preference values must be restored to ``unpretty'' form before they
+% can be used, \eemenu\ has two procedures of its own that handle
+% these conversions, although the conversion is almost always the same
+% as the conversion that the standard |quote::Prettify| procedure
+% would make. The syntaxes are
+% \begin{quote}
+% |eemenu::Prettify| \word{unpretty string}\\
+% |eemenu::Unprettify| \word{pretty string}
+% \end{quote}
+% \begin{tcl}
+proc eemenu::Prettify str {
+ set a [string toupper [string index $str 0]]
+ regsub -all {([^A-Z])([A-Z])} [string range $str 1 end] {\1 \2} b
+ regsub -all {((La|Bib|Oz|CMac) )?Te X} $a$b {\2TeX } a
+ return $a
+}
+proc eemenu::Unprettify str {
+ regsub -all { } $str {} a
+ return "[string tolower [string index $a 0]][string range $a 1 end]"
+}
+% \end{tcl}
+% For these procedures to be inverses of each other, unpretty strings
+% must begin with a lower case letter and not contain any spaces.
+% \end{proc}\end{proc}
+%
+% \begin{arrayvar}{extract}[method]
+% \begin{arrayvar}{complete}[method]
+% \begin{arrayvar}{evaluate}[method]
+% \begin{arrayvar}{report}[method]
+% A method declares itself by setting its entry in the |extract|,
+% |complete|, |evaluate|, or |report| respectively array. The
+% entries in these arrays are lists of dialog item names, more
+% precisely the names of those setting details that are relevant for
+% the method in question. The indices into these arrays are unpretty
+% method names.
+% \end{arrayvar}\end{arrayvar}\end{arrayvar}\end{arrayvar}
+%
+% Most method types employ a model with distinct ``begin'', ``iterate'',
+% and ``end'' procedures that the main executive calls. For each command
+% and method, the ``begin'' is called first once, then the ``iterate''
+% may be called any number of times, and last the ``end'' is called once.
+% The details to use for the method are only provided in the call to
+% ``begin'' as that procedure is expected to store the relevant data
+% into variables private to the method (residing in its namespace). In
+% most cases, the actual code being evaluated is only handled by the
+% ``iterate'' procedure, and only the ``end'' procedure gets to know
+% how it all turned out.
+%
+% In many methods, some of these procedures do nothing at all. This is
+% then because there is nothing that needs to be done for that particular
+% method.
+%
+% \begin{proc}{multiupvar}
+% The |multiupvar| procedure does |upvar #0| for a number of
+% variables, prepending the namespace of the caller to each of the
+% \word{other-var} arguments of |upvar|. The syntax is
+% \begin{quote}
+% |eemenu::multiupvar| \word{my-var}\regplus
+% \end{quote}
+% \changes{v\,0.2}{2002/12/26}{Corrected a minor bug: one must look
+% at the first element in the list that info level returns. (LH)}
+% \begin{tcl}
+%<*!atcl7>
+proc eemenu::multiupvar {args} {
+ foreach var $args {uplevel 1 [list variable $var]}
+}
+%</!atcl7>
+%<*atcl7>
+proc eemenu::multiupvar {args} {
+ if {[info level]>1} then {
+ set ns [lindex [info level -1] 0]
+ set t [string last :: $ns]
+ if {$t<0} then {set ns {}} else {
+ set ns [string range $ns 0 [expr {$t+1}]]
+ }
+ } else {set ns {}}
+ set t 1
+ set call [list upvar #0]
+ foreach var $args {lappend call ${ns}${var} $var}
+ uplevel 1 $call
+}
+%</atcl7>
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{The main executive}
+%
+% \begin{arrayvar}{cmdA}[command name]
+% The |cmdA| array stores all definitions of \eemenu\ commands. The
+% indices into the array are the command names. The entries are
+% key--value lists which contain the settings for the command.
+%
+% The \describestring[key]{active}|active|,
+% \describestring[key]{binding}|binding|, and
+% \describestring[key]{mode}|mode| keys have to do with the key
+% binding for this command. If |active| is |1| then the binding should
+% be made upon startup. |binding| is the actual binding to use. |mode|
+% is the mode for which the binding should be made; if this is
+% |<none>| then the binding should be global.
+%
+% The \describestring[key]{in_menu}|in_menu| key controls whether
+% this command should appear as a command in the main \textsf{EE}
+% menu.
+%
+% The \describestring[key]{extractor}|extractor|,
+% \describestring[key]{complete}|complete|,
+% \describestring[key]{evaluator}|evaluator|, and
+% \describestring[key]{reporter}|reporter| keys store the particular
+% methods that are used by the command. The values are prettified
+% method names. For each of these keys there is also an \dots|_extra|
+% key whose value is the key--value list of detail settings for that
+% method. The exact names are \describestring[key]{extract_extra}
+% |extract_extra|, \describestring[key]{complete_extra}
+% |complete_extra|, \describestring[key]{eval_extra}|eval_extra|, and
+% \describestring[key]{report_extra}|report_extra|.
+%
+% If the |cmdA| array isn't set then it will be initialised in
+% Section~\ref{Sec:DefCmdA}.
+% \end{arrayvar}
+%
+%
+%
+% \begin{proc}{main}
+% The |main| procedure is meant to be called from key binding scripts
+% and menu procs to actually carry out an \eemenu\ command. The
+% syntax is
+% \begin{quote}
+% |eemenu::main| \word{command name} \meta{selection-args}
+% \end{quote}
+% The \word{command name} is the name of the \eemenu\ command. The
+% \meta{selection-args} can be used to specify what the command
+% should extract from; they are passed straight on to the extraction
+% method |start| procedure.
+%
+% If there was an error during the execution of the command then |main|
+% terminates with an error. There is no particular result from this
+% procedure.
+%
+% The first part of |main| calls the begin procedures of the methods
+% used.
+% \begin{tcl}
+proc eemenu::main {command args} {
+ global eemenu::cmdA
+ if {![info exists eemenu::cmdA($command)]} then {
+ error "Command '$command' undefined."
+ }
+ array set CMD [set eemenu::cmdA($command)]
+% \smallskip
+ set extract [eemenu::Unprettify $CMD(extractor)]
+ set cmpl [eemenu::Unprettify $CMD(complete)]
+ set eval [eemenu::Unprettify $CMD(evaluator)]
+ set report [eemenu::Unprettify $CMD(reporter)]
+% \smallskip
+ set win\
+ [eval [list eemenu::${extract}::start $CMD(extract_extra)] $args]
+ upvar #0 eemenu::${cmpl}::complete complete
+ eemenu::${report}::log_open $CMD(report_extra) $win
+% \end{tcl}
+% The main part of |main| is the following loop over extracted lines.
+% The |res| variable stores the last result returned by the evaluation
+% method. The |safe| variable is a boolean for whether the current
+% position should be considered safe. The |lines| variable contains
+% the lines extracted but not yet evaluated. The |at_end| variable is
+% |0| until the end of the extractable portion of the code has been
+% encountered.
+% \begin{tcl}
+ set res [eemenu::${eval}::begin $CMD(eval_extra) $win]
+ eval [list eemenu::${report}::log_result] $res
+ set lines [list]
+ set safe 1
+ while {![lindex $res 0]} {
+% \end{tcl}
+% First extract the next line of code and append it to |lines|.
+% \begin{tcl}
+ set at_end [catch {eemenu::${extract}::next $safe} line]
+ if {$at_end == 1} then {
+ global errorInfo
+ return -code error -errorinfo $errorInfo
+ } elseif {$at_end == 0} then {
+ lappend lines $line
+ } elseif {![llength $lines]} then {break}
+% \end{tcl}
+% Secondly check if there is a complete block of code in |lines|.
+% \begin{tcl}
+ set safe [expr $complete]
+ if {$at_end && !$safe} then {
+ set safe [expr {![dialog::yesno -y No -n Yes\
+ "The last [llength $lines] lines do not appear to be a\
+ complete block of code. Evaluate anyway?"]}]
+ if {!$safe} then {
+ set res [list 1 "" ""]
+ break
+ }
+ }
+% \end{tcl}
+% Finally log code, evaluate it, and log the result. This should
+% happen when |lines| contains a complete block of code. If there is
+% no error in evaluating the code then the current position will be
+% safe at the next iteration of the loop, and if there is an error
+% then the loop will not be iterated anyway. Hence the use of |safe|
+% is correct.
+% \begin{tcl}
+ if {$safe} then {
+ eemenu::${report}::log_code $lines
+ set res [eemenu::${eval}::item $lines]
+ eval [list eemenu::${report}::log_result] $res
+ set lines [list]
+ }
+ }
+% \end{tcl}
+% If an error has already been detected then it doesn't matter if
+% |end| evaluates without error, but it could also be that no error
+% results are returned before |end|.
+% \begin{tcl}
+ if {[lindex $res 0]} then {
+ eval [list eemenu::${report}::log_result] [eemenu::${eval}::end]
+ } else {
+ set res [eemenu::${eval}::end]
+ eval [list eemenu::${report}::log_result] $res
+ }
+ eemenu::${extract}::finish [lindex $res 0]
+ eemenu::${report}::log_close
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{The key bindings}
+%
+% There is a small system for managing the \eemenu\ key bindings. There
+% are two reasons for this: deactivating a command should only unbind a
+% binding if that binding is really currently used for that command,
+% and the \textsf{Active~Commands} submenu should match the actual
+% bindings.
+%
+% \begin{proc}{binding_index}
+% The |binding_index| procedure makes an index into the |binding| array.
+% The syntax is
+% \begin{quote}
+% |eemenu::binding_index| \word{mode} \word{binding}
+% \end{quote}
+% Both an empty string and |<none>| as \word{mode} are interpreted as
+% ``global''.
+% \begin{tcl}
+proc eemenu::binding_index {mode binding} {
+ if {"<none>"==$mode} then {set mode ""}
+ set mode [string range "[string trim $mode] " 0 3]
+ return "$mode$binding"
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{arrayvar}{binding}
+% The |binding| array is used to keep track of which command is
+% currently using a particular binding. The entries in this array are
+% command names. The indices have the form
+% \begin{quote}
+% \meta{mode}\meta{binding}
+% \end{quote}
+% where \meta{mode} is the mode and \meta{binding} is the menu-style
+% code for the binding. \meta{mode} is padded on the right with
+% spaces to exactly four characters. The \meta{mode} for global
+% bindings is four spaces.
+% \end{arrayvar}
+%
+% \begin{proc}{init_bindings}
+% The |init_bindings| procedure initialises the |binding| array and
+% the actual key bindings to match the data in the |cmdA| array. It
+% should be called when the menu is activated, but before the menu
+% itself is built.
+% \begin{tcl}
+proc eemenu::init_bindings {} {
+ eemenu::multiupvar cmdA binding
+ foreach cmd [array names cmdA] {
+% \end{tcl}
+% Only commands that are active needs to be considered.
+% \begin{tcl}
+ array set A $cmdA($cmd)
+ if {!$A(active)} then {continue}
+% \end{tcl}
+% The state of the binding must also be determined. It could be that
+% some other \textsf{EE~Menu} command is using the same binding, in
+% which case the user should be informed of this.
+% \begin{tcl}
+ set idx [eemenu::binding_index $A(mode) $A(binding)]
+ if {[info exists binding($idx)] &&\
+ ![dialog::yesno "To activate '$cmd', I must first deativate\
+ '$binding($idx)'. Proceed?"]}\
+%
+ then {continue}
+% \end{tcl}
+% Now the binding can be made for the command.
+% \begin{tcl}
+ set binding($idx) $cmd
+ set call [keys::bindKey $A(binding)]
+ lappend call [list eemenu::main $cmd]
+ if {[string compare "<none>" $A(mode)]} then {lappend call $A(mode)}
+ eval $call
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{deactivate}
+% The |deactivate| procedure has the syntax
+% \begin{quote}
+% |eemenu::deactivate| \word{\eemenu\ command}\regplus
+% \end{quote}
+% It deactivates the bindings for all commands listed as arguments
+% and updates the \textsf{Active Commands} submenu accordingly.
+% \begin{tcl}
+proc eemenu::deactivate {args} {
+ eemenu::multiupvar binding cmdA
+ foreach cmd $args {
+% \end{tcl}
+% First make sure the binding is actually active.
+% \begin{tcl}
+ array set A $cmdA($cmd)
+ set idx [eemenu::binding_index $A(mode) $A(binding)]
+ if {![info exists binding($idx)] ||\
+ [string compare $binding($idx) $cmd]} then {continue}
+% \end{tcl}
+% Then unset everything that has to do with it.
+% \begin{tcl}
+ unset binding($idx)
+ set call [keys::unbindKey $A(binding)]
+ lappend call ""
+ if {[string compare "<none>" $A(mode)]} then {lappend call $A(mode)}
+ eval $call
+ markMenuItem -m "Active Commands" $cmd off
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{activate}
+% The |activate| procedure activates the bindings for the \eemenu\
+% commands listed as arguments. It has the syntax
+% \begin{quote}
+% |eemenu::activate| \word{noisy} \word{\eemenu\ command}\regplus
+% \end{quote}
+% The procedure notices and handles the case that the binding for an
+% already active command coincides with that of some command to
+% activate, usually by deactivating the active command. The \word{noisy}
+% argument controls how it will behave in this. If \word{noisy} is |0|
+% then it will merely show a list of deactivations on the status bar,
+% but if it is |1| then it will put up a dialog and ask first.
+% \begin{tcl}
+proc eemenu::activate {noisy args} {
+ eemenu::multiupvar binding cmdA
+ set deactiveL [list]
+ foreach cmd $args {
+% \end{tcl}
+% First determine the state of the binding.
+% \begin{tcl}
+ array set A $cmdA($cmd)
+ set idx [eemenu::binding_index $A(mode) $A(binding)]
+ if {[info exists binding($idx)]} then {
+ if {![string compare $binding($idx) $cmd]} then {continue}
+% \end{tcl}
+% In this case the binding is being used by some other command.
+% Should that be deactivated?
+% \begin{tcl}
+ if {$noisy && ![dialog::yesno "To activate '$cmd', I must\
+ first deativate '$binding($idx)'. Proceed?"]} then {continue}
+% \end{tcl}
+% Here we know it should. Deactivation can be simplified since the
+% binding will anyway be overwritten later.
+% \begin{tcl}
+ lappend deactiveL $binding($idx)
+ markMenuItem -m "Active Commands" $binding($idx) off
+ }
+% \end{tcl}
+% Now activate the binding, as was the original intention.
+% \begin{tcl}
+ set binding($idx) $cmd
+ set call [keys::bindKey $A(binding)]
+ lappend call [list eemenu::main $cmd]
+ if {[string compare "<none>" $A(mode)]} then {lappend call $A(mode)}
+ eval $call
+ markMenuItem -m "Active Commands" $binding($idx) on\
+ [text::Ascii 18 1]
+ }
+ if {!$noisy && [llength $deactiveL]} then {
+ status::msg "Deactivated commands: [join $deactiveL ", "]"
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Building and handling the menu}
+%
+% \begin{proc}{build_menu}
+% The |build_menu| procedure builds the menu. It is called when the
+% menu is initially created and whenever some command settings have
+% been edited.
+% \begin{tcl}
+proc eemenu::build_menu {} {
+ eemenu::multiupvar cmdA binding
+ set items [list "Edit Commands[text::Ascii 201 1]"]
+ if {[array size cmdA] > 0} then {
+%<atcl7> set cmdL [lsort -ignore [array names cmdA]]
+%<!atcl7> set cmdL [lsort -dictionary [array names cmdA]]
+ lappend items [list Menu -n "Active Commands" -m\
+ -p eemenu::menu_proc $cmdL]
+ lappend items "(-)"
+ foreach cmd $cmdL {
+ array set A $cmdA($cmd)
+ if {$A(in_menu)} then {lappend items $cmd}
+ }
+ }
+ global eeMenu
+ Menu -n $eeMenu -m -p eemenu::menu_proc $items
+ if {[array size cmdA]} then {
+ foreach idx [array names binding] {
+ markMenuItem -m "Active Commands" $binding($idx) on\
+ [text::Ascii 18 1]
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{menu_proc}
+% The |menu_proc| handles selection of items in the \emph{EE} menu and
+% its submenu. The syntax is the standard
+% \begin{quote}
+% |eemenu::menu_proc| \word{menu} \word{item}
+% \end{quote}
+% \begin{tcl}
+proc eemenu::menu_proc {menu item} {
+ global eeMenu
+ eemenu::multiupvar cmdA binding
+ switch -- $menu $eeMenu {
+ switch -- $item "Edit Commands" {
+ eemenu::edit_commands
+ } default {
+ eemenu::main $item
+ }
+ } "Active Commands" {
+ array set A $cmdA($item)
+ set idx [eemenu::binding_index $A(mode) $A(binding)]
+ if {[info exists binding($idx)] &&\
+ ![string compare $binding($idx) $item]} then {
+ eemenu::deactivate $item
+ } else {
+ eemenu::activate 1 $item
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{The command dialogs}
+% \label{Ssec:CmdDialogs}
+%
+% The dialog for editing command settings has two levels. On the top
+% level, the dialog has one page per command. This dialog allows one to
+% select methods, but does not show any detail settings for the methods.
+% The other level has one page for each method type (or less) and shows
+% only the detail settings for that method.
+%
+% \begin{arrayvar}{detail_typeA}
+% \begin{arrayvar}{detail_helpA}
+% \begin{arrayvar}{detail_keyA}
+% The |detail_typeA| and |detail_helpA| arrays define the items in the
+% setting details dialog. They are sent as arguments to
+% |dialog::handle|, and thus the indices have the form
+% \meta{page}|,|\meta{name}. The \meta{page} is either |Extract|
+% for the extraction method page, |Complete| for the completion
+% method page, |Evaluate| for the evaulation method page, or |Report|
+% for the report method page. The |detail_keyA| array gives the keys
+% associated with the items.
+% \end{arrayvar}\end{arrayvar}\end{arrayvar}
+%
+% \begin{arrayvar}{detail_defaultA}
+% The |detail_defaultA| array is indexed by the name of a detail page
+% (|Extract|, |Complete|, |Evaluate|, or |Report|). The entries are
+% key--value lists that constitute suggested defaults for the
+% \dots|_extra| items in the main dialog.
+% \begin{tcl}
+array set eemenu::detail_defaultA\
+ {Extract {} Complete {} Evaluate {} Report {}}
+% \end{tcl}
+% \end{arrayvar}
+%
+% \begin{proc}{define_detail}
+% The |define_detail| procedure is a helper to simplify the definition
+% of items in the detail dialogs by handling internally all the odd
+% variable names that are involved. The syntax is
+% \begin{quote}
+% |eemenu::define_detail| \word{page} \word{name} \word{key}
+% \word{type} \word{value}\regopt\ \word{help}\regopt
+% \end{quote}
+% \word{page} and \word{name} specify the item. \word{key},
+% \word{type}, \word{value}, and \word{help} are what will be stored
+% into the arrays. The return value is precisely \word{name}, so that
+% one can put that in the |extract|, |complete|, |evaluate|, or
+% |report| array in the same command as the item is defined.
+%
+% It is OK to define the same item several times, provided that the
+% definitions are equal (or different only in the \word{value}s or
+% in that one has a \word{help} and the other doesn't), but it is an
+% error if they are different.
+% \begin{tcl}
+proc eemenu::define_detail {page name key type {val ""} {help ""}} {
+ upvar #0 eemenu::detail_typeA typeA eemenu::detail_helpA helpA\
+ eemenu::detail_keyA keyA eemenu::detail_defaultA valA
+ set error ""
+ set idx "$page,$name"
+ if {![info exists keyA($idx)]} then {
+ set keyA($idx) $key
+ } elseif {"$key" != "$keyA($idx)"} then {
+ append error " Different keys: '$keyA($idx)' and '$key'."
+ }
+ if {![info exists typeA($idx)]} then {
+ set typeA($idx) $type
+ } elseif {"$type" != "$typeA($idx)"} then {
+ append error " Different types: '$typeA($idx)' and '$type'."
+ }
+ if {[string length $val]} then {
+ if {[info exists valA($page)]} then {array set A $valA($page)}
+ if {![info exists A($key)] || ![string length $A($key)]} then {
+ set A($key) $val
+ set valA($page) [array get A]
+ }
+ }
+ if {[string length $help]} then {
+ if {![info exists helpA($idx)]} then {
+ set helpA($idx) $help
+ } elseif {"$help" != "$helpA($idx)"} then {
+ append error " Different help texts: '$helpA($idx)' and '$help'."
+ }
+ }
+ if {[string length $error]} then {
+ dialog::alert "The detail setting '$name' for '$page' methods\
+ has conficting definitions.$error This is an error that should
+ be fixed; for now, the second definition will be ignored."
+ }
+ return $name
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{edit_commands}
+% The |edit_commands| procedure puts up a dialog that lets the user
+% edit the command settings. It takes no arguments and returns nothing.
+% \begin{tcl}
+proc eemenu::edit_commands {} {
+ global eemenu::extract eemenu::complete eemenu::evaluate\
+ eemenu::report
+% \end{tcl}
+% The first thing to do is to determine the layout for command pages.
+% \begin{tcl}
+ set layout [list]
+ lappend layout [list active flag Active "Is the binding active?"]
+ lappend layout [list binding binding "Command keybinding"]
+ lappend layout [list mode mode "Binding mode"]
+ lappend layout [list in_menu flag "Put in menu"]
+% \smallskip
+%<*atcl7>
+ set M [list]
+ foreach method [lsort -ignore [array names eemenu::extract]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list extractor [list menu $M] "Extraction method"]
+ lappend layout [list extract_extra [list hidden keyval] extract_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -ignore [array names eemenu::complete]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list complete [list menu $M] "Completion test"]
+ lappend layout [list complete_extra [list hidden keyval] complete_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -ignore [array names eemenu::evaluate]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list evaluator [list menu $M] "Evaluation method"]
+ lappend layout [list eval_extra [list hidden keyval] eval_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -ignore [array names eemenu::report]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list reporter [list menu $M] "Report method"]
+ lappend layout [list report_extra [list hidden keyval] report_extra]
+%</atcl7>
+%<*!atcl7>
+ set M [list]
+ foreach method [lsort -dictionary [array names eemenu::extract]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list extractor [list menu $M] "Extraction method"]
+ lappend layout [list extract_extra [list hidden keyval] extract_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -dictionary [array names eemenu::complete]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list complete [list menu $M] "Completion test"]
+ lappend layout [list complete_extra [list hidden keyval] complete_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -dictionary [array names eemenu::evaluate]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list evaluator [list menu $M] "Evaluation method"]
+ lappend layout [list eval_extra [list hidden keyval] eval_extra]
+% \smallskip
+ set M [list]
+ foreach method [lsort -dictionary [array names eemenu::report]] {
+ lappend M [eemenu::Prettify $method]
+ }
+ lappend layout [list reporter [list menu $M] "Report method"]
+ lappend layout [list report_extra [list hidden keyval] report_extra]
+%</!atcl7>
+% \end{tcl}
+% Then the call to |dialog::make_paged| can be constructed (in the
+% |call| variable), but as it is convenient to do that in order, the
+% page arguments (which are the easiest) will be constructed last.
+% \begin{tcl}
+ global dialog::ellipsis
+ if {![info exists dialog::ellipsis]} then {auto_load dialog::make_paged}
+ set call [list dialog::make_paged]
+ set buttons [list]
+ lappend buttons "New${dialog::ellipsis}" "Add new command"\
+ {eemenu::add_command ""}
+ lappend buttons "Duplicate${dialog::ellipsis}"\
+ "Duplicate this command" {eemenu::add_command $currentpage}
+ lappend buttons "Rename${dialog::ellipsis}"\
+ "Rename this command" {eemenu::rename_command}
+ lappend buttons "Delete${dialog::ellipsis}"\
+ "Delete this command" {
+ if {[dialog::yesno "Are you sure you want to\
+ delete '$currentpage'?"]} {
+ set pages [dialog::delete_pages $pages\
+ [list $currentpage] delta_pages]
+ }
+ }
+ lappend buttons "Details${dialog::ellipsis}"\
+ "Setting details for this command" {
+ eemenu::command_details $dial $currentpage
+ }
+ lappend call -addbuttons $buttons -changeditems mods\
+ -alpha7pagelimit 2
+% \end{tcl}
+% Finally the page arguments to |dialog::make_paged| can be appended
+% and the actuall call made.
+% \begin{tcl}
+ global eemenu::cmdA
+%<atcl7> foreach cmd [lsort -ignore [array names eemenu::cmdA]] {
+%<!atcl7> foreach cmd [lsort -dictionary [array names eemenu::cmdA]] {
+ lappend call [list $cmd [set eemenu::cmdA($cmd)] $layout]
+ }
+ set res [eval $call]
+% \end{tcl}
+% If |make_paged| terminates with an error (the user pressed
+% \textsf{Cancel}) then processing of this procedure should stop here.
+% Thus the |eval| above is quite in order.
+%
+% After that, the settings should be updated. The first step is to
+% deactivate those commands whose activation state, binding, or mode
+% has changed, since that has to be done before the old settings
+% are cleared.
+% \begin{tcl}
+ set call [list eemenu::deactivate]
+ newforeach {cmd keys} $mods {
+ if {[lsearch -regexp $keys {^(active|binding|mode)$}]>=0 &&\
+ [info exists eemenu::cmdA($cmd)]} then {
+ lappend call $cmd
+ }
+ }
+ if {[llength $call]>1} then {eval $call}
+% \end{tcl}
+% Now the new settings can replace the old.
+% \begin{tcl}
+ unset eemenu::cmdA
+ array set eemenu::cmdA $res
+% \end{tcl}
+% Then what remains is (i) to inform \Alpha\ that the changed command
+% settings need to be saved, (ii) to make bindings for those commands
+% that are active, and (iii) to add or remove items from the menu.
+% \begin{tcl}
+ set call [list eemenu::activate 0]
+ set build_menu 0
+%<atcl7> newforeach {cmd keys} $mods {
+%<!atcl7> foreach {cmd keys} $mods {
+ prefs::modified eemenu::cmdA($cmd)
+ if {![info exists eemenu::cmdA($cmd)]}\
+ then {set build_menu 1; continue}
+ array set A [set eemenu::cmdA($cmd)]
+ if {$A(active) &&\
+ [lsearch -regexp $keys {^(active|binding|mode)$}]>=0}\
+ then {lappend call $cmd}
+ if {[lsearch -exact $keys in_menu]>=0} then {set build_menu 1}
+ }
+ if {[llength $call]>2} then {eval $call}
+ if {$build_menu} then {eemenu::build_menu}
+}
+% \end{tcl}
+% The conditions used above rely to some extent on the fact that
+% \emph{all} items on a dialog page that is added or deleted count as
+% having been changed.
+% \end{proc}
+%
+% \begin{proc}{add_command}
+% The |add_command| procedure is called by a button script to add a
+% new command page to the dialog. The syntax is
+% \begin{quote}
+% |eemenu::add_command| \word{template}
+% \end{quote}
+% where \word{template} is the name of a command whose settings should
+% be copied, or an empty string if the default settings should be used.
+% \begin{tcl}
+proc eemenu::add_command {templ} {
+ set name [getline "Name of new command"]
+ if {![string length $name]} then {return}
+%<atcl7> newforeach {page items} [uplevel 1 {set pages}] {
+%<!atcl7> foreach {page items} [uplevel 1 {set pages}] {
+ if {![string compare $page $name]} then {
+ alternote "That name is already in use!"
+ return
+ }
+ }
+% \end{tcl}
+% By default, make new commands inactive and don't put them in the
+% menu. This is to avoid silly errors in case the user wants to do
+% a ``backup'' of a command.
+% \begin{tcl}
+ set keyvals [list active 0 in_menu 0]
+ if {[string length $templ]} then {
+ set dial [uplevel 1 {set dial}]
+ set cpage [uplevel 1 {set currentpage}]
+%<atcl7> newforeach {key item}\
+%<!atcl7> foreach {key item}\
+ {binding {Command keybinding} mode {Binding mode}
+ extractor {Extraction method} extract_extra extract_extra
+ complete {Completion test} complete_extra complete_extra
+ evaluator {Evaluation method} eval_extra eval_extra
+ reporter {Report method} report_extra report_extra} {
+ lappend keyvals $key [dialog::valGet $dial "${cpage},${item}"]
+ }
+ } else {
+ lappend keyvals binding "" mode "" extractor "Raw"
+ upvar #0 eemenu::detail_defaultA defaultA
+ lappend keyvals extract_extra $defaultA(Extract)
+ lappend keyvals complete "Entire Selection" complete_extra\
+ $defaultA(Complete)
+ lappend keyvals evaluator "Internal Tcl" eval_extra\
+ $defaultA(Evaluate)
+ lappend keyvals reporter "Status Line" report_extra $defaultA(Report)
+ }
+ uplevel 1 [list dialog::add_page $name $keyvals [uplevel 2 set layout]]
+ uplevel 1 [list set currentpage $name]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{rename_command}
+% The |rename_command| procedure is called by a button script to rename
+% an existing command. There are no arguments.
+% \begin{tcl}
+proc eemenu::rename_command {} {
+ upvar 1 currentpage cpage dial dial
+ set name [getline "New name for command '$cpage'"]
+ if {![string length $name]} then {return}
+%<atcl7> newforeach {page items} [uplevel 1 {set pages}] {
+%<!atcl7> foreach {page items} [uplevel 1 {set pages}] {
+ if {![string compare $page $name]} then {
+ alternote "That name is already in use!"
+ return
+ }
+ }
+% \end{tcl}
+% Technically, the page with the old name is deleted and a new page
+% with the new name is added. The keyvals have to saved to a list in
+% between.
+% \begin{tcl}
+ set keyvals [list]
+%<atcl7> newforeach {key item} {active Active in_menu {Put in menu}\
+%<!atcl7> foreach {key item} {active Active in_menu {Put in menu}\
+ binding {Command keybinding} mode {Binding mode}\
+ extractor {Extraction method} extract_extra extract_extra\
+ complete {Completion test} complete_extra complete_extra\
+ evaluator {Evaluation method} eval_extra eval_extra\
+ reporter {Report method} report_extra report_extra} {
+ lappend keyvals $key [dialog::valGet $dial "${cpage},${item}"]
+ }
+ uplevel 1 {
+ set pages [dialog::delete_pages $pages [list $currentpage]\
+ delta_pages]
+ }
+ uplevel 1 [list dialog::add_page $name $keyvals [uplevel 2 set layout]]
+ set cpage $name
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{command_details}
+% The |command_details| procedure is called by a button script to let
+% the user see and edit the details of a command. The syntax is
+% \begin{quote}
+% |eemenu::command_details| \word{dialog ref.} \word{command}
+% \end{quote}
+% The \word{dialog ref.} is the reference to pass on to
+% |dialog::valGet| and the like, as that is the only way to access the
+% data that should be shown in the dialog. The \word{command} is the
+% name of the command whose details should be shown, which is also the
+% \meta{page} part of the array index that |dialog::valGet| needs.
+%
+% Most of this procedure consists of moving data from the data
+% structures of one dialog to those of another, and back again. More
+% precisely, data is taken from the \dots|_extra| items in the main
+% dialog and put (using |array set|) into the local arrays |A1|, |A2|,
+% |A3|, and |A4|. Then those entries in these arrays which correspond
+% to details for the current set of methods are stored as dialog item
+% values for |dial2|. At the end, those |dial2| items values that were
+% changed are copied back to the corresponding |A| array, and then
+% these arrays are put back (using |array get|) into the corresponding
+% \dots|_extra| items in the main dialog.
+%
+% At the same time as the data are copied from the main dialog to the
+% details dialog, the list of pages and items in the latter is being
+% built. The information about this is taken from the |extract|,
+% |complete|, |evaluate|, and |report| arrays.
+% \begin{tcl}
+proc eemenu::command_details {dial command} {
+ global eemenu::detail_typeA eemenu::detail_helpA\
+ eemenu::detail_keyA eemenu::extract eemenu::complete\
+ eemenu::evaluate eemenu::report
+ set pages [list]
+ set dial2 [dialog::create]
+% \end{tcl}
+% Exactly the same processing is done for all four pages of the
+% details dialog, but since the location of the source data varies a
+% bit irregularly between the pages, it is easiest to make a table of
+% which variables and indices should be used. There is one line per
+% page in the |newforeach| below.
+% \begin{tcl}
+%<atcl7> newforeach {which page layoutarr data arr} {
+%<!atcl7> foreach {which page layoutarr data arr} {
+ {Extraction method} Extract eemenu::extract extract_extra A1
+ {Completion test} Complete eemenu::complete complete_extra A2
+ {Evaluation method} Evaluate eemenu::evaluate eval_extra A3
+ {Report method} Report eemenu::report report_extra A4
+ } {
+ set method [eemenu::Unprettify\
+ [dialog::valGet $dial ${command},${which}]]
+ set L [set ${layoutarr}($method)]
+ if {[llength $L]} then {
+ lappend pages $page $L
+ array set $arr [dialog::valGet $dial ${command},${data}]
+ foreach l $L {
+ set v [set eemenu::detail_keyA($page,$l)]
+ if {[info exists ${arr}($v)]} then {
+ dialog::valSet $dial2 "$page,$l" [set ${arr}($v)]
+ } else {
+% \end{tcl}
+% It turns out \AlphaEight\ doesn't like an empty string as value for
+% a checkbox, so the value is explicitly set to |0| for flags.
+% \changes{v\,0.3}{2003/04/11}{Added special default for flag items.
+% A similar fix should be put in the dialogs code. (LH)}
+% \begin{tcl}
+ switch -- [set eemenu::detail_typeA($page,$l)] flag {
+ dialog::valSet $dial2 "$page,$l" 0
+ } default {
+ dialog::valSet $dial2 "$page,$l" ""
+ }
+ }
+ }
+ }
+ }
+% \smallskip
+ if {![llength $pages]} then {
+ dialog::alert "There are no details for these methods."
+ dialog::cleanup $dial2
+ return
+ }
+ dialog::handle $pages eemenu::detail_typeA $dial2\
+ eemenu::detail_helpA page [list]\
+ [list [list "Back" "Return to overall dialog" ""] right first]
+% \smallskip
+ set L [dialog::changed_items $dial2]
+ foreach item $L {
+ switch -glob $item {
+ Extract,* {set arr A1}
+ Complete,* {set arr A2}
+ Evaluate,* {set arr A3}
+ Report,* {set arr A4}
+ }
+ set ${arr}([set eemenu::detail_keyA($item)])\
+ [dialog::valGet $dial2 $item]
+ }
+%<atcl7> newforeach {page data arr} {
+%<!atcl7> foreach {page data arr} {
+ Extract extract_extra A1
+ Complete complete_extra A2
+ Evaluate eval_extra A3
+ Report report_extra A4
+ } {
+ if {[lsearch -glob $L "${page},*"] >= 0} then {
+ dialog::valChanged $dial "${command},${data}" [array get $arr]
+ }
+ }
+ dialog::cleanup $dial2
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{\texttt{dialogsNew} patch}
+%
+% In the testing stage, I discovered that the |edit_commands| procedure
+% managed to overstress \Alpha7's |dialog| command almost without
+% trying. It is probably the large number of popup menus that is causing
+% trouble, but regardless of the cause, I found that I couldn't use this
+% dialog if it tried to show more than two commands.
+%
+% The \textsf{Edit Filesets} command faces a similar limitation and to
+% work around that there is a separate \textsf{Edit A Fileset} command.
+% As I didn't feel that much like reconstructing the \textsf{Edit
+% Commands} dialog however, I instead redesigned |dialog::make_paged|
+% so that \emph{it} automatically splits the dialog when there are too
+% many pages in it. The redesigned |make_paged| will however probably
+% not make it into Alpha\Tcllogo\ before v\,7.6d3 and at the moment
+% that seems like a bit restrictive to me. Hence \emph{EE~Menu} will
+% patch the \texttt{dialogsNew} code if this change hasn't already
+% been incorporated.
+%
+% \begin{tcl}
+%<*dialogspatch&atcl7>
+if {![llength [info commands dialog::make_paged]]} then {
+ auto_load dialog::make_paged
+}
+if {![regexp -- -alpha7pagelimit [info body dialog::make_paged]]} then {
+% \end{tcl}
+% The following is copied from \texttt{dialogsNew.dtx} v\,1.4.
+%
+% \setnamespace{dialog}
+%
+% \begin{proc}{make_paged}
+% The |make_paged| procedure is similar to the |make| procedure, but
+% its argument argument structure is slightly different, its return
+% value is very different, and it does have a couple of features that
+% |make| doesn't (such as adding or removing pages or items in a
+% dialog). The basic syntax is the same
+% \begin{quote}
+% |dialog::make_paged| \meta{option}\regstar\ \word{page}\regplus
+% \end{quote}
+% but here each \word{page} is a list with the structure
+% \begin{quote}
+% \word{page name} \word{key--value list} \word{item list}
+% \end{quote}
+% and each \word{item list} in turn is a list of items, each of with
+% are themselves lists and have the structure
+% \begin{quote}
+% \word{key} \word{type} \word{name} \word{help}\regopt
+% \end{quote}
+% The return value is a list with the structure
+% \begin{quote}
+% \begin{regexp}[\regplus]\word{page name}
+% \word{key--value list}\end{regexp}
+% \end{quote}
+% and in both cases the \word{key--value list} has the format of a
+% list returned by |array get|, i.e.,
+% \begin{quote}
+% \begin{regexp}[\regstar]\word{key} \word{value}\end{regexp}
+% \end{quote}
+%
+% Rather than (as with |make|) including the value of an item in its
+% \word{item} list, that list contains a \word{key} which references
+% a value stored in the \word{key--value list} of that page. The idea
+% with this is that the input and output formats for values should be
+% the same, so that the caller has little overhead in converting from
+% one data format to another. The \word{key--value list} format is
+% furthermore flexible in that is completely insensitive to changes
+% that add, remove, or rearrange items within a page. Extra
+% key--value pairs in the input are ignored and an empty string is
+% substituted as value for pairs that are missing.
+%
+% The \meta{option}s understood by |make_paged| are
+% \begin{quote}
+% |-ok| \word{OK button title}\\
+% |-cancel| \word{cancel button title}\\
+% |-title| \word{dialog window title}\\
+% |-defaultpage| \word{name of default page}\\
+% |-addbuttons| \word{button list}\\
+% |-width| \word{dialog window width}\\
+% |-alpha7pagelimit| \word{maximal number of pages}\\
+% |-debug| \word{debug level}\\
+% |-changedpages| \word{var-name}\\
+% |-changeditems| \word{var-name}
+% \end{quote}
+% Those that are common with |make| work exactly the same. The
+% |-changedpages| option specifies that the caller wants to know on
+% which pages something was changed. The \word{var-name} is the name
+% of a variable in the caller's local context which will be set to
+% the list of (names of) pages where some item value was changed. The
+% |-changeditems| option is similar, but here the variable will be set
+% to a list with the structure
+% \begin{quote}
+% \begin{regexp}[\regstar]\word{page name}
+% \word{key list}\end{regexp}
+% \end{quote}
+% where the \word{key list}s are lists of the \emph{keys} of items on
+% that page whose values were changed.
+%
+% \begin{tcl}
+proc dialog::make_paged {args} {
+% \end{tcl}
+%
+% |make_paged| largely has the same local variables as |make|, but
+% there are some additions. The major arrays are
+% \begin{description}
+% \item[\texttt{pageA}]
+% The index into this array is the name of a page. An entry
+% contains the list of names of items on that page.
+% \item[\texttt{typeA}]
+% The index into this array has the form
+% \meta{page}|,|\meta{item}, where \meta{page} is the name of a
+% page and \meta{item} is the name of an item on that page. An
+% entry contains the type of that item.
+% \item[\texttt{keyA}]
+% The index has the same form as in the |typeA| array. An entry
+% contains the \word{key} for that item.
+% \item[\texttt{helpA}]
+% The index has the same form as in the |typeA| array. An entry
+% contains the help text for that entry, but an item needs not
+% have an entry in this array (it can be left unset).
+% \end{description}
+% There are a couple of additional scalar variables that are of
+% interest.
+% \begin{description}
+% \item[\texttt{retCode}, \texttt{retVal}]
+% When the |retCode| variable is set, the dialog is logically
+% closed and the procedure returns. If the variable is set to |0|
+% then |make| executes a normal return and the returned value will
+% be the list of item values. If the variable is set to anything
+% else then that will used for the |-code| option of |return| and
+% the returned value will be taken from the |retVal| variable,
+% which must then be initalised.
+% \item[\texttt{dial}]
+% This contains the reference string to use with |valGet|,
+% |valSet|, and friends when accessing the values of items in
+% the dialog.
+% \item[\texttt{currentpage}]
+% This contains the name of the current page in the dialog.
+% \item[\texttt{delta\_pages}]
+% This is the list of all pages which have been added to or
+% deleted from the dialog since it was called. The |add_page| and
+% |delete_page| procedures both directly access this list. It is
+% needed to get the information for the |-changedpages| and
+% |-changeditems| correct.
+% \item[\texttt{pages}]
+% This is a list of pages and items to show in the dialog. It is
+% similar to the result of |array get pageA|, but the order of
+% pages is as specified in the call and hidden pages are not
+% included.
+% \item[\texttt{opts(-addbuttons)}]
+% This is \word{button list} specified by the caller. Button
+% scripts can modify this list to change the text on their button.
+% \item[\texttt{state}]
+% This is initialized to |0| before the first time the dialog is
+% shown and then the procedure leaves it alone. Button scripts may
+% change it to keep track of what ``state'' (mostly: which
+% items\slash pages are currently hidden) the dialog is in.
+% \item[\texttt{splitstate}]
+% This is the dialog splitting state and works as for
+% |dialog::make|.
+% \item[\texttt{optionL}]
+% The list of additional options to pass to |dialog::handle|.
+% \end{description}
+%
+% The first part of |dialog::make_paged| processes the arguments.
+% \begin{tcl}
+ set opts(-ok) OK
+ set opts(-cancel) Cancel
+ set opts(-title) ""
+ set opts(-width) 400
+ set opts(-debug) 0
+ getOpts {-title -defaultpage -ok -cancel -addbuttons -width -debug\
+ -alpha7pagelimit -changedpages -changeditems}
+ set dial [dialog::create]
+% \end{tcl}
+% The page arguments are interpreted by the |add_page| procedure.
+% Since these pages aren't new in the sense that is relevant for the
+% |delta_pages| list, that variable is reset afterwards. The
+% |splitstate| variable is implicitly updated by |add_page|.
+% \begin{tcl}
+ set pages [list]
+ set delta_pages [list]
+ if {[info exists opts(-alpha7pagelimit)] && [info tclversion]<8.0}\
+ then {
+ set splitstate below
+ } else {
+ set splitstate off
+ }
+ foreach pagearg $args {
+ eval [list dialog::add_page] $pagearg
+ }
+ set delta_pages [list]
+ if {$splitstate=="page"} then {set splitstate menu}
+ if {[info exists opts(-defaultpage)]} then {
+ set currentpage $opts(-defaultpage)
+ } else {
+ set currentpage [lindex $pages 0]
+ }
+ set optionL [list -width $opts(-width) -title $opts(-title)]
+ set main_buttons [list\
+%
+ [list $opts(-ok) "Click here to use the current settings."\
+ {set retCode 0}\
+%
+ $opts(-cancel) "Click here to discard any\
+ changes you've made to the settings."\
+ {set retCode 1; set retVal "cancel"}]\
+%
+ first right]
+ set view_button [list [list {View dialog page}\
+ {Click here to see the items on this page.}\
+ {set splitstate page}]]
+ set back_button [list [list "Back"\
+ {Click here to go back to the pages menu.}\
+ {set splitstate menu}] first right]
+% \end{tcl}
+%
+% The second part is the loop which lets the user edit the settings.
+% \begin{tcl}
+ set state 0
+ while {![info exists retCode]} {
+ switch -exact -- $splitstate off - below {
+ if {[info exists opts(-addbuttons)]} then {
+ set script [dialog::handle $pages typeA $dial helpA\
+ currentpage $optionL [list $opts(-addbuttons)]\
+ $main_buttons]
+ } else {
+ set script [dialog::handle $pages typeA $dial helpA\
+ currentpage $optionL $main_buttons]
+ }
+ } menu {
+ set altpages [list]
+ set n 1
+ foreach item $pages {
+ if {$n} then {
+ lappend altpages $item
+ set n 0
+ } else {
+ lappend altpages {}
+ set n 1
+ }
+ }
+ set script [dialog::handle $altpages typeA $dial helpA\
+ currentpage $optionL $view_button $main_buttons]
+ } page {
+% \end{tcl}
+% This is a small test to make sure that the value of |currentpage|
+% is valid. If it isn't then one should return to the |menu| state.
+% \begin{tcl}
+ if {![info exists pageA($currentpage)]} then {
+ set splitstate menu
+ continue
+ }
+ set altpages [list $currentpage $pageA($currentpage)]
+ if {[info exists opts(-addbuttons)]} then {
+ set script [dialog::handle $altpages typeA $dial helpA\
+ currentpage $optionL [list $opts(-addbuttons)]\
+ $back_button]
+ } else {
+ set script [dialog::handle $altpages typeA $dial helpA\
+ currentpage $optionL $back_button]
+ }
+ }
+ if {[catch $script err]} then {
+% \end{tcl}
+% The rest of this loop is simply for gracefully handling errors that
+% occur when button scripts are evaluated.
+% \begin{tcl}
+ global errorInfo
+ set errinfo $errorInfo
+ if {$opts(-debug)} then {
+ tclLog "Error in button script '$script'"
+ tclLog $err
+ }
+ dialog::cleanup $dial
+ return -code 1 -errorinfo $errinfo\
+ "Error '$err' when evaluating button script."
+ }
+ }
+% \end{tcl}
+%
+% The third part is as in |make| responsible for constructing the result
+% to return (at normal returns). Unlike the case with |make|, the
+% return value covers only the items currently in |pages|. This
+% part is also responsible for constructing the lists of changed
+% pages and items. Two important variables in this are |cS| and |cA|.
+% |cS| is an array which is used to test whether a certain item has
+% been changed (via |valChanged|), but the only thing that matters is
+% whether an entry has been set or not. |cA| is an array indexed by
+% page name, whereas the entries are lists of keys of items on that
+% page which have been changed.
+% \begin{tcl}
+ if {$retCode==0} then {
+ set retVal [list]
+ global dialog::mute_types
+ foreach page $delta_pages {
+ foreach name $pageA($page) {
+ lappend cA($page) $keyA($page,$name)
+ }
+ }
+ foreach item [dialog::changed_items $dial] {set cS($item) ""}
+ newforeach {page items} $pages {
+ set res [list]
+ foreach name $items {
+ set T "$page,$name"
+ if {[lsearch -exact ${dialog::mute_types}\
+ [lindex $typeA($T) 0]] < 0} then {
+ lappend res $keyA($T) [dialog::valGet $dial $T]
+ if {[info exists cS($T)]} then {
+ lunion cA($page) $keyA($T)
+ }
+ }
+ }
+ lappend retVal $page $res
+ }
+ if {[info exists opts(-changedpages)]} then {
+ upvar 1 $opts(-changedpages) cp
+ set cp [array names cA]
+ }
+ if {[info exists opts(-changeditems)]} then {
+ upvar 1 $opts(-changeditems) ci
+ set ci [array get cA]
+ }
+ }
+ dialog::cleanup $dial
+ return -code $retCode $retVal
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{add_page}
+% The |add_page| procedure can be called from within the |make_paged|
+% procedure to add a new page to the dialog. The syntax is
+% \begin{quote}
+% |dialog::add_page| \word{page name} \word{key--value list}
+% \word{item list} \word{position}\regopt
+% \end{quote}
+% Here the \word{page name}, \word{key--value list}, and \word{item
+% list} coincide with those parts of a \word{page} argument of
+% |make_paged|.
+%
+% |add_page| works by modifying the arrays |typeA|, |keyA|, |helpA|,
+% and |pageA|, the lists |pages| and |delta_pages|, and the variable
+% |splitstate| in the caller's local context. It also uses the value
+% in the |dial| variable there as an argument to |valSet| and the
+% |opts| array to access the |-alpha7pagelimit| value. All of these
+% variables are assumed to function as they do in the |make_paged|
+% procedure.
+%
+% The \word{position} argument can be used to specify where in the
+% |pages| list that the new page should be inserted. It defaults to
+% |end|, which puts the new page last. Otherwise the argument should
+% be numeric: |0| means put first, |1| means put second, |2| means put
+% third, etc.
+%
+% If |splitstate| is |below| and the number of pages equals (or is
+% greater than) the |-alpha7pagelimit| then the |splitstate| is
+% changed to |page|. If |splitstate| is |menu| then it is also
+% changed to |page|.
+% \begin{tcl}
+proc dialog::add_page {page keyvalL itemsL {pos end}} {
+ upvar pageA pageA typeA typeA helpA helpA keyA keyA\
+ dial dial pages pages delta_pages delta_pages\
+ splitstate splitstate opts opts
+ array set local $keyvalL
+ set pageA($page) [list]
+ lunion delta_pages $page
+ foreach item $itemsL {
+ set key [lindex $item 0]
+ set name [lindex $item 2]
+ set keyA($page,$name) $key
+ if {[info exists local($key)]} then {
+ dialog::valSet $dial $page,$name $local($key)
+ } else {
+ dialog::valSet $dial $page,$name ""
+ }
+ set typeA($page,$name) [lindex $item 1]
+ if {[llength $item]>3} then {
+ set helpA($page,$name) [lindex $item 3]
+ }
+ lappend pageA($page) $name
+ }
+ if {$pos!="end"} then {
+ set pages [linsert $pages [expr {2*$pos}] $page $pageA($page)]
+ } else {
+ lappend pages $page $pageA($page)
+ }
+ if {$splitstate=="menu" || ($splitstate=="below" &&\
+ [llength $pages]>2*$opts(-alpha7pagelimit))} then {
+ set splitstate page
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{delete_pages}
+% In one sense, this procedure does the opposite of |add_page|, but
+% it can be used to achieve different effects as well. Basically it
+% takes a list of page names and items, in the format for the first
+% argument of |handle|, and returns the same list with some pages
+% removed. The syntax is
+% \begin{quote}
+% |dialog::delete_pages| \word{pages} \word{delete-list}
+% \word{deleted-var}\regopt
+% \end{quote}
+% where the \word{delete-list} is the list of names of pages to
+% remove. \word{deleted-var} is, if it is given, the name of a
+% variable in the caller's local context containing a list of page
+% names. The deleted pages are then unioned with this list. The most
+% common value for \word{deleted-var} is |delta_pages|.
+%
+% If there is a \word{deleted-var} argument then this procedure might
+% also modify the |splitstate| variable in the caller's local
+% context. A value of |page| is changed to |menu| or |below| depending
+% on how meny pages are returned and the value of
+% |opts(-alpha7pagelimit)| in the caller's local context. (Both these
+% variables must exist if |delete_pages| is called with a
+% \word{deleted-var} argument.)
+% \begin{tcl}
+proc dialog::delete_pages {pages deleteL {deletedvar {}}} {
+ set res [list]
+ if {[string length $deletedvar]} then {upvar 1 $deletedvar diffL}
+ newforeach {page items} $pages {
+ if {[lsearch -exact $deleteL $page] == -1} then {
+ lappend res $page $items
+ } else {
+ lunion diffL $page
+ }
+ }
+ if {[string length $deletedvar]} then {
+ upvar splitstate state opts(-alpha7pagelimit) limit
+ switch -exact -- $state page - menu {
+ if {[llength $res]<=2*$limit} then {
+ set state below
+ } else {
+ set state menu
+ }
+ }
+ }
+ return $res
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{tcl}
+}
+%</dialogspatch&atcl7>
+% \end{tcl}
+% \setnamespace{eemenu}
+%
+%
+% \section{Extraction methods}
+% \label{Sec:Extraction}
+%
+% The extraction method is mainly a source of input for an \eemenu\
+% command, but it is also responsible for providing some feedback to the
+% user in the event that an error occurs. This feedback should take the
+% simple form of positioning the cursor at the beginning of the first
+% piece of code that could not be evaluated successfully. Extraction
+% methods are therefore expected to constantly keep track of the
+% position where the cursor should be put if an error occurs: this is
+% called the \emph{safe} position. As no other part of an \eemenu\
+% cares about positions, these are regarded as internal matters for
+% the extraction mathod. The feedback from the main executive is
+% restricted to answers to the simple questions ``Is the current position
+% safe?'' and ``Did an error occur?''
+%
+% Extractions are begun by a call to the
+% \describestring[proc][eemenu::\meta{method}]{start}|start|
+% procedure, which has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::start| \word{settings}
+% \word{window}\regopt\
+% \begin{regexp}[\regopt]\word{start} \word{end}\end{regexp}
+% \end{quote}
+% The \word{settings} is the |extract_extra| list of the command, and
+% contain the settings that should be used until the next call to
+% |start|. This list may contain key--value pairs for details not used
+% by the current method (but which presumably are used by others), and
+% it needs not contain key--value pairs for every detail that the
+% current method uses. Therefore the method should provide defaults
+% when necessary.
+%
+% The \word{window} is the name of the window from which code should be
+% extracted. If this is omitted then the extraction should default to
+% using the current window. The \word{start} and \word{end} are
+% positions of the beginning and end respectively of the interval from
+% which code should be extracted, but they are normally not used. When
+% these are omitted then the method may do whatever seems reasonable,
+% but the following algorith is recommended:
+% \begin{itemize}
+% \item If there is a selection in the window, then substitute the
+% position of its beginning for \word{start} and the position of its
+% end for \word{end}.
+% \item Otherwise do the entire window, i.e., let \word{start} be the
+% |minPos| and \word{end} be the |maxPos|.
+% \end{itemize}
+% The main reason that \word{start} and \word{end} at all exist as
+% arguments is that this simplifies testing and debugging, but it also
+% enables virtual methods to make their own decisions about from where
+% the code should be extracted.
+%
+% The |start| procedure returns the file name (complete path, no count)
+% of the source window. This is passed on to the begin procedures of
+% other methods, but most of them ignore it anyway. If something is
+% wrong with the arguments supplied to it then |start| terminates with
+% an error.
+%
+% To actually extract a line, the main executive calls the
+% \describestring[proc][eemenu::\meta{method}]{next}|next| procedure,
+% which has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::next| \word{is safe}
+% \end{quote}
+% This procedure returns the next extractable code line, or terminates
+% with return code 9 if there is no more line.
+% \changes{v\,0.2}{2002/12/26}{Throwing abort instead of error, since
+% it otherwise catches too many real errors. (LH)}
+% The \word{is safe} argument is |1| if the current position should be
+% considered safe and |0| otherwise.
+%
+% Extraction is terminated by a call to the
+% \describestring[proc][eemenu::\meta{method}]{finish}|finish|
+% procedure. This has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::finish| \word{error?}
+% \end{quote}
+% where the \word{error?} argument is |1| if there was an error in
+% evaluation and |0| otherwise. This procedure does not return any data.
+%
+%
+% \subsection{Some position utilities}
+%
+% \textit{\textbf{Note:} The procedures in this subsection were probably
+% not a good idea to start with, so they are no longer included by
+% default.} For the historically interested reader, it may be remarked
+% that the code below predates the addition in \AlphaTcl\,7.6 of |-w|
+% options to most standard position procedures.
+%
+% Extraction procedures should generally not assume that the window from
+% which code is being extracted is the current window. The reason for
+% this is that if \Alpha\ is evaulating internally then the extracted
+% code may bring some other window to front or, more commonly, create a
+% new window (which will by default go on top of all others). This is
+% kind of tricky since many of \Alpha's commands for working with
+% positions implicitly assume that the positions are in the current
+% window, but it can be delt with by storing positions are a pair
+% |{|\word{row} \word{column}|}| instead, as the |rowColToPos| command
+% which converts this to a standard position does accept a window
+% argument.
+%
+% Handling explicitly such positions is however more work that it
+% should be, so here follows some generic utility procs to deal with
+% positions specified as lists with the structure
+% \begin{quote}
+% \word{window} \word{row} \word{column} \word{standard pos}\regopt
+% \end{quote}
+% Here, \word{window} is a full window name (as returned by the
+% |win::Current| procedure), whereas \word{row} and \word{column}
+% are integers. The optional \word{standard pos} element is the standard
+% position (that which should be used in calls to \Alpha\ primitives) if
+% it has been computed by a call to |rowColToPos|. If it has not been
+% computed then this element should not be present in the list.
+%
+% For \AlphaTk, there isn't much point in a distinction between the
+% ``standard'' and row--column position formats as standard
+% positions there are composed from a row and a column anyway.
+%
+% These procedures are put in the
+% \describestring[namespace]{pos}|pos| namespace, as there is nothing
+% in them that is specific to \eemenu.
+% \begin{tcl}
+%<*rowcol>
+namespace eval pos {}
+% \end{tcl}
+% \setnamespace{pos}
+%
+% \begin{proc}{incr_row}
+% \begin{proc}{incr_col}
+% The |incr_row| and |incr_col| procedures increment the row and
+% column respectively component of a position list. Their syntaxes are
+% \begin{quote}
+% |pos::incr_row| \word{pos-var} \word{row increment}\\
+% |pos::incr_col| \word{pos-var} \word{column increment}
+% \end{quote}
+% Incrementing the column can not cause the row to be incremented.
+% Incrementing the row sets the column to |0|. The minimal column
+% value is |0| and the minimal row value is |1|. There are no
+% maximums in either.
+% \begin{tcl}
+proc pos::incr_row {var diff} {
+ upvar 1 $var V
+ set t [expr {[lindex $V 1] + $diff}]
+ if {$t<1} then {
+ set V [list [lindex $V 0] 1 0]
+ } else {
+ set V [list [lindex $V 0] $t 0]
+ }
+}
+proc pos::incr_col {var diff} {
+ upvar 1 $var V
+ set t [expr {[lindex $V 2] + $diff}]
+ set V [lrange $V 0 1]
+ if {$t<0} then {lappend V 0} else {lappend V $t}
+}
+% \end{tcl}
+% \end{proc}\end{proc}
+%
+% \begin{proc}{get_standard}
+% The |get_standard| procedure returns the standard position
+% corresponding the row--column position stored in a variable. It has
+% the syntax
+% \begin{quote}
+% |pos::get_standard| \word{pos-var}
+% \end{quote}
+% \begin{tcl}
+proc pos::get_standard {var} {
+ upvar 1 $var V
+ if {[llength $V]<4} then {
+ lappend V [eval [list rowColToPos -w] $V]
+ }
+ return [lindex $V 3]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{polyset}
+% The |polyset| procedure is used to convert a list of standard
+% positions in a certain window to row--column form and store those
+% in variables, also given as a list. The syntax is
+% \begin{quote}
+% |pos::polyset| \word{window} \word{var-list} \word{pos-list}
+% \end{quote}
+% If there are more elements in the \word{var-list} than in the
+% \word{pos-list} then the remaining elements will not be set.
+%
+% The reason this procedure works on lists is that \Alpha\ cannot
+% (or at least will not) determine the row and column for a position
+% unless that is in the current window. Therefore this procedure might
+% have to temporarily bring some other window to front to do its stuff.
+% \begin{tcl}
+proc pos::polyset {win varL posL} {
+ if {$win != [win::Current]} then {
+ set top [win::Current]
+ bringToFront $win
+ }
+ set N [llength $varL]
+ if {$N > [llength $posL]} then {set N [llength $posL]}
+ for {set n 0} {$n < $N} {incr n} {
+ upvar 1 [lindex $varL $n] V
+ set V [concat [list $win]\
+ [posToRowCol [lindex $posL $n]] [lindex $posL $n]]
+ }
+ if {[info exists top]} then {bringToFront $top}
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{RC_compare}
+% The |RC_compare| procedure can be used to compare two row--column
+% positions. The syntax is
+% \begin{quote}
+% |pos::RC_compare| \word{first pos} \word{second pos}
+% \end{quote}
+% and the result is as for |string compare|. It is an error if the
+% \word{window} elements of the two arguments are different.
+% \begin{tcl}
+proc pos::RC_compare {a b} {
+ if {"[lindex $a 0]" != "[lindex $b 0]"} then {
+ error "Not the same <window>."
+ }
+ if {[lindex $a 1] < [lindex $b 1]} then {
+ return -1
+ } elseif {[lindex $a 1] > [lindex $b 1]} then {
+ return 1
+ } elseif {[lindex $a 2] < [lindex $b 2]} then {
+ return -1
+ } elseif {[lindex $a 2] > [lindex $b 2]} then {
+ return 1
+ } else {
+ return 0
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}[eemenu]{get_extract_positions}
+% The |get_extract_positions| procedure interprets the three optional
+% arguments for a |start| procedure and sets two specified variables
+% in the caller's local context to the row--column positions
+% corresponding to the beginning and the end respectively of interval
+% from which code should be extracted. The syntax is
+% \begin{quote}
+% |eemenu::get_extract_positions| \word{start-var} \word{end-var}
+% \word{window}\regopt\
+% \begin{regexp}[\regopt]\word{start} \word{end}\end{regexp}
+% \end{quote}
+% This procedure returns the complete window name (including count).
+% \begin{tcl}
+proc eemenu::get_extract_positions {startvar endvar {win ""}\
+ {startpos ""} {endpos ""}} {
+ if {![string length $win]} then {set win [win::Current]}
+ if {![string length $startpos]} then {
+ set startpos [getPos -w $win]
+ set endpos [selEnd -w $win]
+ if {[pos::compare $startpos == $endpos]} then {
+ set startpos [minPos]
+ set endpos [maxPos -w $win]
+ }
+ }
+ uplevel 1 [list pos::polyset $win [list $startvar $endvar]\
+ [list $startpos $endpos]]
+ return $win
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}[eemenu]{get_text}
+% The |get_text| procedure is mainly a wrapper around the |getText|
+% command. The syntax is
+% \begin{quote}
+% |eemenu::get_text| \word{start-var} \word{end-var}
+% \end{quote}
+% where \word{start-var} and \word{end-var} are names of variables
+% in the caller's local context of row--column positions. The return
+% value is the text between those positions.
+% \begin{tcl}
+proc eemenu::get_text {startvar endvar} {
+ upvar 1 $startvar S $endvar E
+ if {"[lindex $S 0]" != "[lindex $E 0]"} then {
+ error "Not the same <window>."
+ }
+ getText -w [lindex $S 0] [pos::get_standard S] [pos::get_standard E]
+}
+%</rowcol>
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+%
+% \subsection{Raw extraction}
+%
+% \begin{arrayentry}[eemenu]{extract}{raw}
+% Raw extraction has no details.
+% \begin{tcl}
+set eemenu::extract(raw) [list]
+namespace eval eemenu::raw {}
+% \end{tcl}
+% \end{arrayentry}
+% \setnamespace{eemenu::raw}
+%
+% \subsubsection{Row--column based extraction}
+%
+% This was my original implementation of raw extraction. Unfortunately
+% it seems that |rowColToPos| is rather slow in \AlphaEight. Hence
+% there is an alternative implementation below.
+%
+% \begin{proc}{start}
+% \begin{variable}{cur_pos}
+% \begin{variable}{safe_pos}
+% \begin{variable}{end_pos}
+% As this |start| procedure has no details to deal with, it only
+% has to initialize the three position variables |cur_pos| (current
+% position), |safe_pos| (most recent safe position), and |end_pos|
+% (the end position).
+% \begin{tcl}
+%<*rowcol>
+proc eemenu::raw::start {details args} {
+ eemenu::multiupvar cur_pos safe_pos end_pos
+ set win\
+ [eval [list eemenu::get_extract_positions cur_pos end_pos] $args]
+ set safe_pos $cur_pos
+ return [win::StripCount $win]
+}
+% \end{tcl}
+% \end{variable}\end{variable}\end{variable}\end{proc}
+%
+%
+% \begin{proc}{next}
+% The |next| procedure is also as simple as it can possibly be. The
+% only nontrivial thing about it is that it removes carriage returns
+% and linefeeds at the end of the text returned by
+% |eemenu::get_text|.
+% \begin{tcl}
+proc eemenu::raw::next {at_safe} {
+ eemenu::multiupvar cur_pos safe_pos end_pos
+ if {[pos::RC_compare $cur_pos $end_pos]>=0} then {return -code 9 "Done"}
+ set this $cur_pos
+ if {$at_safe} then {set safe_pos $this}
+ pos::incr_row cur_pos 1
+ if {[pos::RC_compare $cur_pos $end_pos]>0} then {
+ set cur_pos $end_pos
+ }
+ string trimright [eemenu::get_text this cur_pos] "\n\r"
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{finish}
+% The |finish| procedure is slightly trickier that it has to be.
+% Rather than doing a |goto| to the safe position, it does a |select|
+% followed by a |markHilite|, with the end position as end, so that
+% the mark will be at the end.
+% \begin{tcl}
+proc eemenu::raw::finish {was_error} {
+ if {!$was_error} then {return}
+ eemenu::multiupvar safe_pos end_pos
+ bringToFront [lindex $safe_pos 0]
+ select [pos::get_standard safe_pos] [pos::get_standard end_pos]
+ markHilite
+}
+%</rowcol>
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsubsection{Queued extraction}
+%
+% This alternative implementation of the \textsf{raw} method is based on
+% extracting a bit more than one would usually need and store the
+% surplus in a queue of lines that haven't been extracted yet.
+%
+% \begin{variable}{line_queue}
+% \begin{variable}{window}
+% \begin{variable}{cur_pos}
+% \begin{variable}{from_pos}
+% \begin{variable}{safe_pos}
+% \begin{variable}{end_pos}
+% The |window| variable holds the name of the window from which text
+% is being extracted.
+% The |line_queue| variable is the text that has been gotten from the
+% window but not yet been properly extracted, split into lines. The
+% last line is incomplete and thus text must be added to the queue
+% whenever it has length less than two.
+%
+% The |cur_pos| variable is the standard position of the beginning of
+% the first line in |line_queue|. The |from_pos| variable is the
+% first position after the last piece of data in |line_queue|. The
+% |safe_pos| is the last position reported to be safe and the |end_pos|
+% is the position at which extraction should stop.
+% \end{variable}\end{variable}\end{variable}\end{variable}\end{variable}
+% \end{variable}
+%
+% \begin{proc}{start}
+% As this |start| procedure has no details to deal with, it only
+% has to initialize the six above variables.
+% \changes{v\,0.3}{2003/05/28}{Storing the tail of the file name, not
+% the whole path. This avoids unnecessary file system accesses. (LH)
+% Cf. bug 919.}
+% \changes{v\,0.3.1}{2003/07/19}{Using complete paths in \AlphaTk, due
+% to bug~1026. (LH)}
+% \begin{tcl}
+%<*!rowcol>
+proc eemenu::raw::start {details {win ""} {startpos ""} {endpos ""}} {
+ eemenu::multiupvar line_queue window cur_pos from_pos safe_pos end_pos
+ global alpha::platform
+ if {![string length $win]} then {set win [win::Current]}
+ switch -- ${alpha::platform} alpha {
+ set win_tail [file tail $win]
+ } default {
+ set win_tail $win
+ }
+ if {![string length $startpos]} then {
+ set startpos [getPos -w $win_tail]
+ set endpos [selEnd -w $win_tail]
+ if {[pos::compare $startpos == $endpos]} then {
+ set startpos [minPos]
+ set endpos [maxPos -w $win_tail]
+ }
+ }
+ set line_queue [list ""]
+ set window $win_tail
+ set cur_pos $startpos
+ set from_pos $startpos
+ set safe_pos $startpos
+ set end_pos $endpos
+ return [win::StripCount $win]
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{next}
+% The |next| procedure first retrieves data from the window (if
+% necessary) and then it extracts the first line from the queue. Data
+% beyond the |end_pos| are never read into the queue.
+%
+% There are two versions of this procedure to account for the new
+% addition of a |-w| option to |pos::compare| and |pos::math|.
+% \changes{v\,0.1.2}{2002/12/26}{Fixed a bug concerning pos::compare,
+% where string compare syntax was used. (LH, who is sure he has
+% fixed this bug before.)}
+% \begin{tcl}
+%<*atcl7>
+if {[alpha::package vsatisfies -loose\
+ [alpha::package versions AlphaTcl] 7.6d2]} then {
+%</atcl7>
+ proc eemenu::raw::next {at_safe} {
+ eemenu::multiupvar line_queue window cur_pos from_pos safe_pos\
+ end_pos
+ if {[llength $line_queue] < 2} then {
+ if {[pos::compare -w $window $cur_pos >= $end_pos]} then {
+ return -code 9 "Done"
+ }
+ set next_pos [pos::math -w $window $from_pos + 1024]
+ if {[pos::compare -w $window $next_pos >= $end_pos]} then {
+ set next_pos $end_pos
+ }
+ set text [lindex $line_queue end]
+ append text [getText -w $window $from_pos $next_pos]
+ set line_queue [split $text "\n\r"]
+ set from_pos $next_pos
+ }
+ if {$at_safe} then {set safe_pos $cur_pos}
+ set line [lindex $line_queue 0]
+ set line_queue [lreplace $line_queue 0 0]
+ set cur_pos\
+ [pos::math -w $window $cur_pos + [expr {[string length $line]+1}]]
+ set line
+ }
+%<*atcl7>
+} else {
+ proc eemenu::raw::next {at_safe} {
+ eemenu::multiupvar line_queue window cur_pos from_pos safe_pos end_pos
+ if {[llength $line_queue] < 2} then {
+ if {[pos::compare $cur_pos >= $end_pos]} then {
+ return -code 9 "Done"
+ }
+ set next_pos [pos::math $from_pos + 1024]
+ if {[pos::compare $next_pos >= $end_pos]} then {
+ set next_pos $end_pos
+ }
+ set text [lindex $line_queue end]
+ append text [getText -w $window $from_pos $next_pos]
+ set line_queue [split $text "\n\r"]
+ set from_pos $next_pos
+ }
+ if {$at_safe} then {set safe_pos $cur_pos}
+ set line [lindex $line_queue 0]
+ set line_queue [lreplace $line_queue 0 0]
+ set cur_pos [pos::math $cur_pos + [expr {[string length $line]+1}]]
+ set line
+ }
+}
+%</atcl7>
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{finish}
+% This |finish| procedure clears the |line_queue|. It should usually
+% be empty already, but better safe than sorry!
+% \begin{tcl}
+proc eemenu::raw::finish {was_error} {
+ eemenu::multiupvar line_queue window safe_pos end_pos
+ set line_queue [list]
+ if {!$was_error} then {return}
+ bringToFront $window
+ select $safe_pos $end_pos
+ markHilite
+}
+%</!rowcol>
+% \end{tcl}
+% \end{proc}
+%
+%
+% \subsection{Regexp extraction}
+%
+% Regular expression extraction adds two features to what the raw
+% extraction does. One is the filter---only lines meeting a certain
+% condition are extracted, the others are skipped---and the other is the
+% substitution---each line returned is first fed through a |regsub|.
+% It would of course be possible to implement this from scratch, but it
+% is more instructive (and slightly shorter) to base it on the |raw|
+% method.
+%
+% \begin{arrayentry}[eemenu]{extract}{regexp}
+% Regular expression extraction has four detail settings.
+% \begin{tcl}
+set eemenu::extract(regexp) [list\
+% \end{tcl}
+% The first
+% two are used in a ``filter'' that selects which lines will be
+% extracted:
+% \begin{details}{Extraction}
+% \detailitem{filter_mode}
+% This is the mode of operation for the filter. There are three
+% possible values: |off| (no filtering, all lines are extracted),
+% |grep| (only lines matching the |filterRE| regular expression
+% are extracted), and |anti-grep| (only lines \emph{not} matching
+% the |filterRE| regular expression are extracted).
+% \begin{tcl}
+ [eemenu::define_detail Extract "Filter mode"\
+ filter_mode [list menu [list off grep anti-grep]] off]\
+% \end{tcl}
+% \detailitem{filterRE}
+% This is the regular expression for the filter
+% \begin{tcl}
+ [eemenu::define_detail Extract "Filter regular expression"\
+ filterRE var]\
+% \end{tcl}
+% \end{details}
+% The last two are used in a straightforward |regsub| that is applied
+% to each extracted line before it is returned to the main executive.
+% \begin{details}{Extraction}
+% \detailitem{searchRE}
+% This is the regular expression searched for in the line.
+% \begin{tcl}
+ [eemenu::define_detail Extract "Search (regexp):" searchRE var]\
+% \end{tcl}
+% \detailitem{replaceRE}
+% This is the regular expression for the replacement.
+% \begin{tcl}
+ [eemenu::define_detail Extract "Replace (regexp):" replaceRE var]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::regexp {}
+% \end{tcl}
+% \setnamespace{eemenu::regexp}
+%
+% \begin{proc}{start}
+% \begin{arrayvar}{detA}
+% This |start| procedure stores its details in the |D| array and calls
+% the |evalmemu::raw::start| procedure to handle everything else.
+% Note how it provides defaults for the detail settings it
+% unconditionally uses, in case these are not present in the
+% \word{details}.
+% \begin{tcl}
+proc eemenu::regexp::start {details args} {
+ global eemenu::regexp::detA
+ array set eemenu::regexp::detA\
+ {filter_mode off searchRE {} replaceRE {}}
+ array set eemenu::regexp::detA $details
+ eval [list eemenu::raw::start $details] $args
+}
+% \end{tcl}
+% \end{arrayvar}\end{proc}
+%
+% \begin{proc}{next}
+% The |next| procedure starts with a loop that continues until it
+% finds a line that passes the filter.
+% \begin{tcl}
+proc eemenu::regexp::next {at_safe} {
+ upvar #0 eemenu::regexp::detA D
+ while {1} {
+ set line [eemenu::raw::next $at_safe]
+ switch -- $D(filter_mode) {
+ off {break}
+ grep {if {[regexp -- $D(filterRE) $line]} then {break}}
+ anti-grep {
+ if {![regexp -- $D(filterRE) $line]} then {break}
+ }
+ }
+ }
+% \end{tcl}
+% Then it applies the |regsub| to the line.
+% \begin{tcl}
+ regsub -all -- $D(searchRE) $line $D(replaceRE) line
+ return $line
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{finish}
+% The |finish| procedure simply calls its equivalent for the |raw|
+% method.
+% \begin{tcl}
+proc eemenu::regexp::finish {err} {eemenu::raw::finish $err}
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+% \subsection{Docstrip extraction}
+%
+% Docstrip extraction is a descendant of the extraction mechanisms from
+% the \textsf{dtxload} package.
+%
+%
+% \begin{arrayentry}[eemenu]{extract}{docstrip}
+% There are three detail settings for |docstrip| extraction.
+% \begin{tcl}
+set eemenu::extract(docstrip) [list\
+% \end{tcl}
+% \begin{details}{Extraction}
+% \detailitem{filePatL}
+% This is a list of file patterns that the file name is tested
+% against using |string match|. If none of them fits then
+% extraction is stopped before is begins.
+% \begin{tcl}
+ [eemenu::define_detail Extract "File patterns" filePatL var\
+ "*.dtx" "List of glob-style file patterns the window must match"]\
+% \end{tcl}
+% \detailitem{lookAtEnvs}
+% If this is checked then extraction will be further conditioned
+% by that the code line is in one of the environements listed in
+% the next setting. I find this very convenient, since I often
+% forget to comment out some lines here and there in the file.
+% \begin{tcl}
+ [eemenu::define_detail Extract "Filter by environments"\
+ lookAtEnvs flag 0]\
+% \end{tcl}
+% \detailitem{sourceEnvsL}
+% The list of environments from which code may be extracted.
+% \begin{tcl}
+ [eemenu::define_detail Extract "Source environments"\
+ sourceEnvsL var {tcl tcl*}]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::docstrip {}
+% \end{tcl}
+% \setnamespace{eemenu::docstrip}
+%
+% \begin{variable}{cur_pos}
+% \begin{variable}{safe_pos}
+% \begin{variable}{end_pos}
+% The |cur_pos|, |safe_pos|, and |end_pos| variables are as for the
+% |raw| mathod. A special case is however that |safe_pos| will never
+% be inside a verbatim section, even if it is safe there, since the
+% extraction wouldn't remember that is was inside a verbatim section
+% if it was restarted. Therefore the \word{is safe} argument to |next|
+% will be ignored in verbatim sections.
+%
+% These variables are only used by the \Module{rowcol} variant.
+% \end{variable}\end{variable}\end{variable}
+%
+% \begin{variable}{module_included}
+% \begin{variable}{in_code_env}
+% \begin{variable}{in_verbatim}
+% The |module_included| variable keeps track of whether the current
+% position is in an included module. It is |1| if the current
+% position should be included and |0| if it shouldn't.
+% The |in_code_env| variable is used for keeping track of the markup
+% context of the currently considered line in the file when the
+% |lookAtEnvs| setting is on. |in_code_env| is set to |1| when a
+% |\begin{|\meta{env}|}| for an \meta{env} in the |sourceEnvsL| is
+% scanned, and set to |0| when an |\end{|\meta{env}|}| is scanned.
+% The |in_verbatim| variable is |1| when the current position is in
+% a \textsf{docstrip} verbatim module and |0| (which is the normal
+% case) otherwise.
+% \end{variable}\end{variable}\end{variable}
+%
+% \begin{variable}{module_stack}
+% \begin{variable}{next_module_idx}
+% The |module_stack| variable is keeps track of how modules
+% are nested around the currently considered line. The variable is a
+% stack implemented as a list in which the last element corresponds to
+% the innermost module. Each element in this list is itself a list
+% with the structure
+% \begin{quote}
+% \word{expression} \word{start pos.} \word{previous}\regopt
+% \end{quote}
+% The \word{expression} is the guard expression, as a string. The
+% \word{start pos.} is the (row--column) position in the file where
+% the module started.
+% Finally, the \word{previous} is a boolean value which
+% records the inclusion status (value of |module_included|)
+% that was in force before the module was entered.
+%
+% The |next_module_idx| variable holds the index in the
+% |module_stack| list of the next module whose expression has not yet
+% been evaluated; it is equal to |llength ${module_stack}| if all
+% module expressions have been evaluated. Those elements in the
+% |module_stack| list which have index $\geq$ |next_module_idx| do
+% not have a \word{previous} element.
+% \end{variable}\end{variable}
+%
+%
+% \begin{proc}{start}
+% The |docstrip| extraction |start| procedure is by far the most
+% complicated, due to the many mechanisms it must initialize.
+% \begin{tcl}
+proc eemenu::docstrip::start {details args} {
+ eemenu::multiupvar detA module_included module_stack\
+ next_module_idx in_code_env in_verbatim
+% \end{tcl}
+% First there are the position variables
+% \begin{tcl}
+%<*rowcol>
+ eemenu::multiupvar cur_pos safe_pos end_pos
+ set win [win::StripCount\
+ [eval [list eemenu::get_extract_positions cur_pos end_pos] $args]]
+ set safe_pos $cur_pos
+%</rowcol>
+%<*!rowcol>
+ set win [eval [list eemenu::raw::start $details] $args]
+%</!rowcol>
+% \end{tcl}
+% and secondly the setting details
+% \begin{tcl}
+ array set detA {filePatL *.dtx lookAtEnvs 0}
+ array set detA $details
+% \end{tcl}
+% Then the method must check whether the detail setting permit
+% extracting from this window. If not, the procedure raises an error
+% (which isn't caught by |eemenu::main|).
+% \begin{tcl}
+ set ok 0
+ foreach pat $detA(filePatL) {
+ if {[string match $pat $win]} then {set ok 1; break}
+ }
+ if {!$ok} then {
+ status::msg "Can't extract from that window. Must be\
+ [join $detA(filePatL) " or "]."
+ return -code 9 "Bad window name"
+ }
+% \end{tcl}
+% Now that it has been established that extraction will take place,
+% the various variables defining the ``state of \textsf{dostrip}''
+% must be initialised. Four of them have standard values at start and
+% present no problem.
+% \begin{tcl}
+ set module_included 1
+ set in_verbatim 0
+ set module_stack [list]
+ set next_module_idx 0
+% \end{tcl}
+% The |in_code_env| variable is however another matter, as the
+% reasonable value for it depends very much on what characters follow
+% the start position. The special value |-1| for |in_code_env| means
+% ``change to |0| or |1| as appropriate when you get the first line''.
+% \begin{tcl}
+ if {!$detA(lookAtEnvs)} then {
+ set in_code_env 1
+ } else {
+%<*rowcol>
+ set t_pos $cur_pos
+ pos::incr_col t_pos 2
+ switch -regexp -- [eemenu::get_text cur_pos t_pos] {
+ ^%< {set in_code_env 1}
+ ^% {set in_code_env 0}
+ default {set in_code_env 1}
+ }
+%</rowcol>
+%<!rowcol> set in_code_env -1
+ set detA(envsRE) {\\(begin|end) *\{(}
+ foreach env $detA(sourceEnvsL) {
+ append detA(envsRE) [quote::Regfind $env] "|"
+ }
+ append detA(envsRE) ")\}(.*)\$"
+ }
+ return $win
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{arrayentry}{detA}{envsRE}
+% The |envsRE| entry in the |detA| array is used for storing the
+% regular expression that is used when searching for code environment
+% markup in comment lines.
+% \end{arrayentry}
+%
+% Next comes a couple of utility procs that are called from the |next|
+% procedure.
+%
+% \begin{arrayvar}{known}[expression]
+% The |known| array records the values of all known expressions,
+% i.e., those expressions about whose values the user has been
+% inquired. The entries are either |0| (for ``don't include'') or
+% |1| (for ``include''). Note that this array is not initialised by
+% the |start| procedure---instead is cleared by the |finish|
+% procedure if no error occurred.
+% \end{arrayvar}
+%
+% \begin{proc}{eval_guard}
+% The |eval_guard| procedure takes the string that is a guard
+% expression as argument. It returns |1| if the expression evaluates
+% to true and |0| if it evaluates to false.
+%
+% If the expression has an entry in the |known| array then the
+% |eval_guard| procedure returns that value, and if it does not the
+% user is inquired for the value.
+% \begin{tcl}
+proc eemenu::docstrip::eval_guard {e} {
+ global eemenu::docstrip::known
+ if {![info exists eemenu::docstrip::known($e)]} then {
+ set eemenu::docstrip::known($e)\
+ [dialog::yesno "Should <$e> modules be included?"]
+ }
+ set eemenu::docstrip::known($e)
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{push_module}
+% The |push_module| procedure pushes a block module onto the
+% module stack, but it does not modify the value of
+% |module_included|. The syntax is
+% \begin{quote}
+% |eemenu::docstrip::push_module| \word{expression} \word{position}
+% \end{quote}
+% where \word{expression} is the expression string and
+% \word{position} is the position (row--column or standard, depending
+% on which kind of positions are being used) where the guard begins.
+% \begin{tcl}
+proc eemenu::docstrip::push_module {e p} {
+ global eemenu::docstrip::module_stack
+ lappend eemenu::docstrip::module_stack [list $e $p]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{pop_module}
+% The |pop_module| procedure pops a block module off the module
+% stack and checks that the modules are properly nested. Its
+% syntax is
+% \begin{quote}
+% |eemenu::docstrip::pop_module| \word{expression} \word{position}
+% \end{quote}
+% where \word{expression} is the expression string of the module to
+% pop and \word{position} is the position (row--column or standard,
+% depending on which kind of positions are being used) where the
+% end of module guard begins.
+%
+% If the module nesting is incorrect then the user is presented with
+% a dialog with buttons for pushing the positions of the incorrect
+% modules. It is not an error if the module stack is empty, since it
+% is perfectly reasonable that the beginning of the code to evaluate
+% is in the middle of a module.
+%
+% \changes{ \textsf{dtxload} v\,1.11}{2001/05/11}{Corrected ugly bug
+% which messed up the value of \texttt{next\_module\_idx}. (LH)}
+% \begin{tcl}
+proc eemenu::docstrip::pop_module {e p} {
+ eemenu::multiupvar module_stack module_included next_module_idx
+ set len [llength $module_stack]
+ if {$len==0} then {return}
+ set L [lindex $module_stack [expr {$len-1}]]
+ if {[lindex $L 0] != $e} then {
+ switch [buttonAlert "Module nesting error: <*[lindex $L 0]>\
+ module ended by </$e>. For which guards should the positions\
+ be pushed?" None Start End Both]\
+ {
+ Start {eemenu::docstrip::push_bookmarks [lindex $L 1]}
+ End {eemenu::docstrip::push_bookmarks $p}
+ Both {eemenu::docstrip::push_bookmarks [lindex $L 1] $p}
+ }
+ }
+ set module_stack [lreplace $module_stack end end]
+ if {$len<=$next_module_idx} then {
+ set next_module_idx [llength $module_stack]
+ }
+ if {[llength $L]>2} then {
+ set module_included [lindex $L 2]
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{push_bookmarks}
+% The |push_bookmarks| procedure pushes one or several positions
+% (row--column or standard, depending on which kind of positions are
+% being used) onto the bookmarks stack. The arguments are the
+% positions to push.
+% \changes{v\,0.3}{2003/05/28}{Changed some \texttt{win::Current} to
+% \texttt{win::CurrentTail}. This avoids unnecessary file system
+% accesses. (LH) Cf. bug 919.}
+% \begin{tcl}
+proc eemenu::docstrip::push_bookmarks {args} {
+ global markStack markName
+%<!rowcol> upvar #0 eemenu::raw::window win
+ set topWin [win::CurrentTail]
+ foreach pos $args {
+ set name mark$markName
+ incr markName
+%<*rowcol>
+ set win [lindex $pos 0]
+ if {"[win::CurrentTail]" != "$win"} then {bringToFront $win}
+ createTMark $name [pos::get_standard pos]
+ set fileName [win::Current]
+ set markStack [linsert $markStack 0\
+ [list $fileName $name [pos::get_standard pos]]]
+%</rowcol>
+%<*!rowcol>
+ if {[string compare [win::CurrentTail] $win]}\
+ then {bringToFront $win}
+ createTMark $name $pos
+ set fileName [win::Current]
+ set markStack [linsert $markStack 0 [list $fileName $name $pos]]
+%</!rowcol>
+ }
+ if {[string compare [win::CurrentTail] $topWin]}\
+ then {bringToFront $topWin}
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{update_included}
+% Simply pushing a module onto the module stack does not update the
+% |module_included| variable; that is instead done by the
+% |update_included| procedure, which should be called right before the
+% value of |module_included| is used. The reason for this arrangement
+% is that it avoids evaluating guard expressions whose values do not
+% matter.
+%
+% |update_included| has no arguments.
+% \begin{tcl}
+proc eemenu::docstrip::update_included {} {
+ eemenu::multiupvar module_stack module_included next_module_idx
+ while {$module_included && $next_module_idx<[llength $module_stack]} {
+ set L [lindex $module_stack $next_module_idx]
+ lappend L $module_included
+ set module_stack\
+ [lreplace $module_stack $next_module_idx $next_module_idx $L]
+ incr next_module_idx
+ set module_included [eemenu::docstrip::eval_guard [lindex $L 0]]
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{variable}{end_verb_line}
+% The |end_verb_line| variable stores the line which terminates
+% verbatim mode. It is only initialised when verbatim mode is begun.
+% \end{variable}
+%
+% \begin{proc}{next}
+% The overall structure of the |next| procedure is that of an endless
+% loop, from which the code |break|s out when it has found an
+% extractable line. Should this loop run into the |end_pos| it
+% terminates instead with a |return -code 9|. The local variable
+% |next_pos| stores the position of the beginning of the next line.
+% \begin{tcl}
+proc eemenu::docstrip::next {is_safe} {
+ eemenu::multiupvar detA module_included in_code_env\
+ in_verbatim module_stack next_module_idx end_verb_line
+%<*rowcol>
+ eemenu::multiupvar cur_pos safe_pos end_pos
+ set next_pos $cur_pos
+%</rowcol>
+%<!rowcol> upvar #0 eemenu::raw::cur_pos raw_cur_pos
+ while {1} {
+%<*rowcol>
+ pos::incr_row next_pos 1
+ if {[pos::RC_compare $next_pos $end_pos]>0} then {
+ set next_pos $end_pos
+ }
+ if {[pos::RC_compare $cur_pos $next_pos]>=0} then {
+ return -code 9 "Done"
+ }
+% \end{tcl}
+% No matter what state the extraction process is in, it will need to
+% look at the current line, so it is extracted and put in the |line|
+% variable. Spaces at end of the line are ignored for compatibility
+% with the \TeX\ \package{docstrip} (\TeX\ throws away spaces at the
+% end of a line as part of the reading process, so \package{docstrip}
+% cannot see them).
+% \begin{tcl}
+ set line [string trimright [eemenu::get_text cur_pos next_pos]\
+ "\r\n "]
+%</rowcol>
+% \end{tcl}
+% In the standard positions implementation, getting text from the
+% window is instead done by calling |eemenu::raw::next|. The position
+% at the beginning of the line (the value of |eemenu::raw::cur_pos|
+% before the call to |eemenu::raw::next|) is saved since it might be
+% needed for making bookmarks later.
+% \begin{tcl}
+%<*!rowcol>
+ set cur_pos $raw_cur_pos
+ set line [eemenu::raw::next [expr {$is_safe && !$in_verbatim}]]
+ set line [string trimright $line "\r\n "]
+ if {$in_code_env<0} then {
+ switch -glob -- $line {
+ %<* {set in_code_env 1}
+ %* {set in_code_env 0}
+ default {set in_code_env 1}
+ }
+ }
+%</!rowcol>
+% \end{tcl}
+% Verbatim mode is pretty simple. Either a line is an extractable
+% code line or it is the end of verbatim mode guard.
+% \begin{tcl}
+ if {$in_verbatim} then {
+ if {![string compare $line $end_verb_line]} then {
+ set in_verbatim 0
+ } elseif {$module_included && $in_code_env} then {
+ break
+ }
+ } else {
+% \end{tcl}
+% In non-verbatim mode, lines are classified based on the first few
+% characters of the line.
+% \begin{tcl}
+ switch -glob -- $line {
+% \end{tcl}
+% Lines that begin with |%<<| are \package{docstrip} guard lines that
+% start verbatim mode. The part of the guard line which comes after
+% the |%<<| is called an end-tag. Verbatim mode ends with the next line
+% which consists of a percent character followed by this end-tag
+% \begin{tcl}
+ %<<* {
+ eemenu::docstrip::update_included
+%<*rowcol>
+ if {$module_included && $in_code_env && $is_safe} then {
+ set safe_pos $cur_pos
+ }
+%</rowcol>
+ set in_verbatim 1
+ set end_verb_line "%[string range $line 3 end]"
+ }
+% \end{tcl}
+% Lines that begin with |%<*| or |%</| are \package{docstrip} guard
+% lines that delimit block modules, but they do not contain any code
+% themselves. The module is pushed onto or popped off the module stack
+% when the guard line is encountered, but evaluating the guard
+% expression is deferred until its value is needed.
+% \begin{tcl}
+ %<[*/]* {
+ if {![regexp {^%<(\*|/)([^>]+)>} $line foo modifier\
+ expression]}\
+ then {
+ if {[dialog::yesno "Malformed guard line '$line'\
+ encountered. Push position?"]}\
+%
+ then {eemenu::docstrip::push_bookmarks $cur_pos}
+ } elseif {$modifier=="*"} then {
+ eemenu::docstrip::push_module $expression $cur_pos
+ } else {
+ eemenu::docstrip::pop_module $expression $cur_pos
+ }
+ }
+% \end{tcl}
+% Other lines that begin with |%<| are also \package{docstrip}
+% guard lines, but in these cases the guard is followed by some code
+% and the guard only affects the code on that particular line. There
+% must be a |>| somewhere on the line, and the part of the line after
+% the |>| is code that \package{docstrip} can extract.
+% \begin{tcl}
+ %<* {
+ if {![regexp {^%<(-|\+|)([^>]+)>(.*)$} $line\
+ foo modifier expression code]}\
+ then {
+ if {[dialog::yesno "Malformed guard line '$line'\
+ encountered. Push position?"]}\
+ then {eemenu::docstrip::push_bookmarks $cur_pos}
+ } elseif {$in_code_env} then {
+ eemenu::docstrip::update_included
+ if {$module_included &&\
+ [eemenu::docstrip::eval_guard $expression] !=\
+ ($modifier=="-")} then {
+ set line $code
+ break
+ }
+ }
+ }
+% \end{tcl}
+% Remaining lines that begin with |%| are considered comment lines,
+% but they could technically be metacomment lines (begin with |%%|).
+% In that case \package{docstrip} would copy the line, but as there
+% is little point in using this \package{docstrip} features for
+% lines that the \Tcllogo\ interpreter would be interested in,
+% the |docstrip| extraction method ignores that subtlety. Comment
+% lines are ignored unless the |lookAtEnvs| details is |1|, in which
+% case they are scanned for code environment markup.
+% \begin{tcl}
+ %* {
+ while {$detA(lookAtEnvs) &&\
+ [regexp -- $detA(envsRE) $line foo type env line]} {
+ set in_code_env [expr {"$type"=="begin"}]
+ }
+ }
+% \end{tcl}
+% Finally, all lines that do not begin with a |%| are code lines.
+% \begin{tcl}
+ default {
+ if {$in_code_env} then {
+ eemenu::docstrip::update_included
+ if {$module_included} then {break}
+ }
+ }
+ }
+ }
+% \end{tcl}
+% That ends the large |switch| command and the large |if|. Now all
+% that remains in the loop is to update |cur_pos|.
+% \begin{tcl}
+%<rowcol> set cur_pos $next_pos
+ }
+% \end{tcl}
+% Whenever the procedure gets past the loop, the line that has been
+% extracted is in |line| and the only thing that remains is to update
+% the positions.
+% \begin{tcl}
+%<*rowcol>
+ if {$is_safe && !$in_verbatim} then {set safe_pos $cur_pos}
+ set cur_pos $next_pos
+%</rowcol>
+ return $line
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{finish}
+% In addition to the |raw| method |finish| procedure, this |finish|
+% also unsets the |known| array when there wasn't an error.
+% \begin{tcl}
+proc eemenu::docstrip::finish {was_error} {
+%<!rowcol> eemenu::raw::finish $was_error
+ if {$was_error} then {
+%<*rowcol>
+ eemenu::multiupvar safe_pos end_pos
+ bringToFront [lindex $safe_pos 0]
+ select [pos::get_standard safe_pos] [pos::get_standard end_pos]
+ markHilite
+%</rowcol>
+ } else {
+ global eemenu::docstrip::known
+ catch {unset eemenu::docstrip::known}
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \section{Completeness tests}
+%
+% \setnamespace{eemenu}
+%
+% Unlike the other method types, completion methods are not implemented
+% as procedures that can be called, but as an expression string stored
+% in a global variable. The string in question is called
+% \describestring[var.][eemenu::\meta{method}]{complete}|complete|
+% and it will be evaluated as an \emph{expression} in the local context
+% of the |main| procedure. The reason for this different set-up is that
+% these methods are usually much simpler to handle that way.
+%
+% Completion methods are expected to get their data from the following
+% variables:
+% \begin{description}
+% \item[\texttt{lines}]
+% A list of the lines that have been extracted by not yet evaluated.
+% This is (at least in theory) what the completion method is testing
+% for being complete.
+% \item[\texttt{at\_end}]
+% A boolean. It is |0| if the extraction has not yet reached the
+% end, and then it is set to |1|.
+% \item[\texttt{CMD(complete\_extra)}]
+% The key--value list of detail settings for completion methods.
+% None of the methods currently implemented have any detail settings.
+% \end{description}
+%
+% \begin{arrayentry}{complete}{entireSelection}
+% \setnamespace{eemenu::entireSelection}
+% \begin{variable}{complete}
+% The |entireSelection| method says `No' until the entire selection
+% has been extracted, then `Yes'. It has no detail settings.
+% \begin{tcl}
+set eemenu::complete(entireSelection) [list]
+namespace eval eemenu::entireSelection {}
+set eemenu::entireSelection::complete {$at_end}
+% \end{tcl}
+% \end{variable}\end{arrayentry}
+%
+% \begin{arrayentry}{complete}{everyLine}
+% \setnamespace{eemenu::everyLine}
+% \begin{variable}{complete}
+% The |everyLine| method says `Yes' after every line.
+% \begin{tcl}
+set eemenu::complete(everyLine) [list]
+namespace eval eemenu::everyLine {}
+set eemenu::everyLine::complete {1}
+% \end{tcl}
+% \end{variable}\end{arrayentry}
+%
+% \begin{arrayentry}{complete}{tclInfoComplete}
+% \setnamespace{eemenu::tclInfoComplete}
+% \begin{variable}{complete}
+% The |tclInfoComplete| method is the only one (defined so far) which
+% actually cares to look at what has been extracted. It calls the
+% |info complete| of \Alpha's \Tcllogo\ interpreter.
+% \begin{tcl}
+set eemenu::complete(tclInfoComplete) [list]
+namespace eval eemenu::tclInfoComplete {}
+set eemenu::tclInfoComplete::complete\
+ {[info complete [join $lines \n]\n]}
+% \end{tcl}
+% \end{variable}\end{arrayentry}
+%
+%
+% \section{Evaluation methods}
+%
+% The evaluation\slash execution method is what actually does anything
+% (all the other methods just move data around). From an input\slash
+% output perspective it takes the input from the extraction method and
+% generates the output that the report method should handle. Like
+% extraction methods, evaluation methods must declare three procedures
+% for |main| to call. These are: |begin|, |item|, and |end|. All of
+% these procedures return a \emph{result list}, which has the structure
+% \begin{quote}
+% \word{error?} \word{passing} \word{permanent}
+% \end{quote}
+% \word{error?} is a boolean that the main executive interprets to see
+% if there was an error. It is |0| when there wasn't an error.
+% \word{passing} and \word{permanent} are result strings. \word{passing}
+% should be suitable for output channels where new results replace old,
+% whereas \word{permanent} should be suitable for output channels where
+% the results are appended to each other. If the \word{passing} string
+% is empty then there is no reason to have it replace a previous
+% \word{passing} string. If the \word{permanent} string is nonempty
+% then it must end with a newline character.
+%
+% The \describestring[proc][eemenu::\meta{method}]{begin}|begin|
+% procedure is called to initialize the evaluation process. It has the
+% syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::begin| \word{details} \word{source}
+% \end{quote}
+% where the \word{details} is the key--value list of setting details
+% and \word{source} is the source window name as returned by the
+% extraction method |start| procedure. If the result of |begin| has a
+% nonzero \word{error?} then the corresponding |end| procedure will not
+% be called.
+%
+% The \describestring[proc][eemenu::\meta{method}]{item}|item|
+% procedure recieves a bunch of code to evaluate. It has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::item| \word{lines}
+% \end{quote}
+% where \word{lines} is the list of lines of code to evaluate. The
+% \describestring[proc][eemenu::\meta{method}]{end}|end| procedure is
+% called when no more lines of code will be sent for evaluation. |end|
+% takes no arguments.
+%
+% It is not necessarily in the call to |item| that the code gets
+% evaluated. The obvious alternative is that |item| simply stores the
+% code somewhere, for example by writing it to a temporary file, and
+% that it is the call to |end| that actually causes the code to be
+% evaluated. This is an important reason why all the procedures have the
+% same format for returned data.
+%
+%
+%
+% \subsection{Internal evaluation}
+%
+% The |internalTcl| evaluation method sends the code to \Alpha's internal
+% \Tcllogo\ interpreter and evaluates it there.
+%
+% \begin{arrayentry}[eemenu]{evaluate}{internalTcl}
+% There are no details for this method.
+% \begin{tcl}
+set eemenu::evaluate(internalTcl) [list]
+% \end{tcl}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::internalTcl {}
+% \end{tcl}
+% \setnamespace{eemenu::internalTcl}
+%
+% \begin{proc}{begin}
+% \begin{proc}{end}
+% Neither the |begin| nor the |end| procedure does anything.
+% \begin{tcl}
+proc eemenu::internalTcl::begin {details source} {
+ list 0 "" ""
+}
+proc eemenu::internalTcl::end {} {list 0 "" ""}
+% \end{tcl}
+% \end{proc}\end{proc}
+%
+% \begin{proc}{item}
+% The |item| procedure actually evaluates the code and suitably
+% formats the result.
+% \begin{tcl}
+proc eemenu::internalTcl::item {lines} {
+ set code [catch [list uplevel #0 [join $lines \n]] res]
+ if {$code == 1} then {
+% \end{tcl}
+% If there was an error, the last part of the value of |errorInfo|
+% will be due to the |uplevel| command. As that command was not
+% requested by the user, it would be confusing and it is therefore
+% best to remove it.
+% \begin{tcl}
+ global errorInfo
+ set L [split $errorInfo \n]
+ set L [lrange $L 0 [expr {[llength $L] - 4}]]
+ list 1 "Tcl eval error: $res"\
+ "Error: $res\nError info:\n[join $L \n]\n"
+% \end{tcl}
+% When there wasn't an error, a distinction is made between the case
+% of an empty string result (very common, e.g.\ from |proc|) and that
+% of a nonempty string result. This might seem inconsistent, but in
+% practice it looks much better.
+% \begin{tcl}
+ } elseif {[string length $res]} then {
+ list 0 "Tcl eval OK: $res" "$res\n"
+ } else {
+ list 0 "Tcl eval OK." ""
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+%
+% \subsection{DoScript AppleEvent evaluation}
+%
+% The |doScriptAE| evaluation method sends a |dosc| AppleEvent to some
+% external application, to have the script evaluated that way. Of
+% course, this only works if \TclAE\ is available, so this method is
+% only defined if that is the case.
+% \begin{tcl}
+%<atcl7>if {[llength [info commands tclAE::send]]} then {
+%<!atcl7>if {![catch {package require tclAE}]} then {
+% \end{tcl}
+%
+% \begin{arrayentry}[eemenu]{evaluate}{doScriptAE}
+% The details for the |doScriptAE| method roughly fall into three
+% categories: what is the target application, how should the
+% extracted lines be combined to a script, and what about a reply?
+% \begin{tcl}
+set eemenu::evaluate(doScriptAE) [list\
+% \end{tcl}
+% \begin{details}{Evaluate}
+% \detailitem{targetApp}
+% This is the appspec of the target application.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Target application"\
+ targetApp appspec]\
+% \end{tcl}
+% \detailitem{joinString}
+% The extracted lines is a list, but the script to send should be
+% a string, so they will have to be joined somehow. This item
+% offers a choice between some common forms of whitespace.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Join lines using"\
+ joinString [list menuindex [list Lf Cr CrLf Space]] 1]\
+% \end{tcl}
+% \detailitem{prefix}
+% This will be prepended to the script sent. It can for example be
+% used to add some command that takes care of the result.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Prefix" prefix var]\
+% \end{tcl}
+% \detailitem{suffix}
+% This will be appended to the script sent.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Suffix" suffix var]\
+% \end{tcl}
+% \detailitem{replyQ}
+% This flag controls whether the method should request a reply to
+% the AE sent.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Wait for reply" replyQ flag]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::doScriptAE {}
+% \end{tcl}
+% \setnamespace{eemenu::doScriptAE}
+%
+%
+% \begin{arrayvar}{A}
+% The |doScriptAE| method keeps its detail settings, and some derived
+% quantities, in the |A| array. Those are all the global variables it
+% has.
+% \end{arrayvar}
+%
+%
+% \begin{proc}{begin}
+% The main task of this |begin| procedure is to make sure that the
+% target application is running.
+% \begin{tcl}
+proc eemenu::doScriptAE::begin {details source} {
+ upvar #0 eemenu::doScriptAE::A A
+ array set A {prefix {} suffix {} joinString 1 targetApp {} replyQ 0}
+ array set A $details
+% \end{tcl}
+% The |targetApp| is either a quoted application signature or a full
+% path name. Exactly what will have to be done gets affected by this.
+% \begin{tcl}
+ if {[regexp {'(....)'} $A(targetApp) foo sig]} then {
+ set err [catch {app::ensureRunning $sig} passing]
+ if {$err == 1} then {set permanent $passing} else {
+ set permanent ""
+ set A(app) $A(targetApp)
+ }
+ } else {
+ set tail [file tail $A(targetApp)]
+%<*atcl7>
+ if {[info tclversion]<8.0} then {
+ set running\
+ [regexp "\{\"[quote::Regfind $tail]\" \"" [processes]]
+ } else {
+%</atcl7>
+ set running 0
+ foreach pr [processes] {
+ if {![string compare $tail [lindex $pr 0]]} then {
+ set running 1
+ break
+ }
+ }
+%<atcl7> }
+ set err 0
+ set permanent ""
+ set A(app) $tail
+ if {$running} then {
+ set passing "App is running."
+ } elseif {![catch {launch $A(targetApp)} passing]} then {
+ set passing "Launched '$A(targetApp)'"
+ } else {
+ set err 1
+ if {![file exists $A(targetApp)]} then {
+ set passing "File '$A(targetApp)' not found."
+ }
+ set permanent $passing
+ unset A(app)
+ }
+ }
+% \end{tcl}
+% The |joinString| is also decoded.
+% \begin{tcl}
+ set A(joinString) [lindex [list \n \r \r\n " "] $A(joinString)]
+ return [list $err $passing $permanent]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{item}
+% The |item| procedure is mainly about formatting data on its way
+% back and forth.
+% \begin{tcl}
+proc eemenu::doScriptAE::item {lines} {
+ upvar #0 eemenu::doScriptAE::A A
+ set script "$A(prefix)[join $lines $A(joinString)]$A(suffix)"
+ if {$A(replyQ)} then {
+ if {[catch {tclAE::build::resultData -t 30000 $A(app) misc dosc\
+ ---- [tclAE::build::TEXT $script]} res]} then {
+ list 1 "Error: $res" "Error: $res\n"
+ } elseif {[string length $res]} then {
+ list 0 $res "$res\n"
+ } else {
+ list 0 "Eval OK." ""
+ }
+ } else {
+ tclAE::send $A(app) misc dosc ---- [tclAE::build::TEXT $script]
+ list 0 "Sent [llength $lines] lines." ""
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{end}
+% The |end| procedure does nothing
+% \begin{tcl}
+proc eemenu::doScriptAE::end {} {list 0 "" ""}
+% \end{tcl}
+% \end{proc}
+%
+% This ends the |if| begun at the top of this subsection.
+% \begin{tcl}
+}
+% \end{tcl}
+%
+%
+% \subsection{\texttt{send} evaluation}
+%
+% The \texttt{send} command can be used to communicate with other Tk
+% applications via an X-windows server. This is a bit restrictive, but
+% it is anyway what \AlphaTk\ uses for remote execution of \Tcllogo\
+% code, so I suppose it is what we've got. Right now this method is
+% defined whenever the |send| command exists, but it is not uncommon
+% that the definition of |send| merely provides communication between
+% different interpreters in the same application.
+% \begin{tcl}
+if {[llength [info commands send]] && [info tclversion]>=8.0} then {
+% \end{tcl}
+%
+% \begin{arrayentry}[eemenu]{evaluate}{tkSend}
+% Many details for the |doScriptAE| method have natural counterparts
+% for the |tkSend| method, the main difference lies in the
+% identification of the target. Whereas \TclAE\ uses static
+% information (creator code or file name) to identify the target, the
+% name used by the |send| command is in principle dynamic. The
+% relevant identifier may change between different times that an
+% \textsf{EE~menu} command is used. This is handled by providing a
+% fallback for unknown targets.
+% \begin{tcl}
+set eemenu::evaluate(tkSend) [list\
+% \end{tcl}
+% \begin{details}{Evaluate}
+% \detailitem{target}
+% This is a string that identifies the target.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Target" target var]\
+% \end{tcl}
+% \detailitem{aliasing}
+% This detail controls how the |tkSend| method should behave when
+% |begin| is called but the specified target isn't available.
+% ``Ask each time'' means present the user with a list of available
+% targets each time |begin| is called, and use what the user
+% selected there. ``Ask once'' is similar, but the choice will be
+% remembered as an \emph{alias} for the specified target (until
+% \Alpha\ is quited or the alias target no longer is available).
+% ``Fail'' means fail immediately.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Alias behaviour"\
+ aliasing [list menu [list "Ask once" "Ask each time" "Fail"]]\
+ "Ask once" "The thing to do when the target is unavailable."]\
+% \end{tcl}
+% \detailitem{joinString}
+% The extracted lines is a list, but the script to send should be
+% a string, so they will have to be joined somehow. This item
+% offers a choice between some common forms of whitespace.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Join lines using"\
+ joinString [list menuindex [list Lf Cr CrLf Space]] 0]\
+% \end{tcl}
+% \detailitem{prefix}
+% This will be prepended to the script sent. It can for example be
+% used to add some command that takes care of the result.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Prefix" prefix var]\
+% \end{tcl}
+% \detailitem{suffix}
+% This will be appended to the script sent.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Suffix" suffix var]\
+% \end{tcl}
+% \detailitem{replyQ}
+% This flag controls whether the method should wait for the
+% remote shell to return a result.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Wait for reply" replyQ flag 1]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::tkSend {}
+% \end{tcl}
+% \setnamespace{eemenu::tkSend}
+%
+% \begin{arrayvar}{alias}
+% The |alias| array is used to keep track of which targets are treated
+% as aliases for other targets. The index is a value of the
+% \texttt{target} detail, the entry value is what it should be
+% replaced by.
+% \end{arrayvar}
+%
+% \begin{variable}{last_target}
+% The |last_target| variable contains the name of the most recently
+% selected target. This is so that the relevant |listpick| dialog
+% can ``remember'' the user's preference in this respect.
+% \begin{tcl}
+set eemenu::tkSend::last_target {}
+% \end{tcl}
+% \end{variable}
+%
+% \begin{arrayvar}{A}
+% The |tkSend| method keeps its detail settings, and some derived
+% quantities, in the |A| array for convenience of access.
+% \end{arrayvar}
+%
+%
+% \begin{proc}{begin}
+% The main task of this |begin| procedure is to verify that the target
+% is available.
+% \begin{tcl}
+proc eemenu::tkSend::begin {details source} {
+ eemenu::multiupvar A alias last_target
+ array set A {prefix {} suffix {} joinString 1 target {} replyQ 1\
+ aliasing "Ask once"}
+ array set A $details
+% \end{tcl}
+% The treatment of aliases depend on the |aliasing| setting. If it is
+% \texttt{Ask once} then an alias will be used even if a target with
+% the given name is available. The rationale for this is that the user
+% has specified that the commands should be sent to that application.
+% \begin{tcl}
+ set T [lsort -dictionary [winfo interps]]
+ switch -- $A(aliasing) "Ask each time" {
+ if {[lsearch -exact $T $A(target)]>=0} then {
+ set target $A(target)
+ }
+ } "Fail" {
+ if {[lsearch -exact $T $A(target)]>=0} then {
+ set target $A(target)
+ } else {
+ set passing "Target '$A(target)' unavailable."
+ return [list 1 $passing $passing]
+ }
+ } default {
+ set target $A(target)
+ if {[info exists alias($target)]} then {
+ set target $alias($target)
+ }
+ if {[lsearch -exact $T $target]<0} then {unset target}
+ }
+% \end{tcl}
+% If the local |target| variable is not set at this point then it is
+% time to ask the user.
+% \begin{tcl}
+ if {![info exists target]} then {
+ if {[catch {listpick -p "Target '$A(target)' unavailable.\
+ Please pick a new one." -L [list $last_target]\
+ [linsert $T end "------------------" "Launch new shell"]}\
+ target]} then {
+ return [list 1 "Canceled" ""]
+ }
+ switch -exact -- $target\
+ "------------------" - "Launch new shell" {
+ set before [clock seconds]
+ app::launchElseTryThese [uplevel #0 {set tclshSigs}] tclshSig\
+ {Please locate the remote Tcl application}
+ while {![string compare $T\
+ [lsort -dictionary [winfo interps]]] &&\
+ [clock seconds] - $before < 60} {update}
+ set T2 [lsort -dictionary [winfo interps]]
+ if {![string compare $T $T2]} then {
+ return [list 1 {Timed out; no new shell started within\
+ 60 seconds.} ""]
+ }
+ foreach target $T2 t $T {
+ if {[string compare $target $t]} then {break}
+ }
+ set passing "Launched new shell '$target'."
+ } default {
+ set passing "Sending code to '$target'."
+ }
+% \end{tcl}
+% The last |foreach| above locates the first |target| in |$T2| which
+% is not in |$T|. This |foreach| is the reason this code requires
+% \Tcllogo\,8.
+%
+% Now the target should be stored in the necessary variables.
+% \begin{tcl}
+ set last_target $target
+ if {![string compare $A(aliasing) "Ask once"]} then {
+ set alias($A(target)) $target
+ }
+ } else {
+ set passing "Sending code to '$target'."
+ }
+ set A(target) $target
+% \end{tcl}
+% The |joinString| is also decoded.
+% \begin{tcl}
+ set A(joinString) [lindex [list \n \r \r\n " "] $A(joinString)]
+ return [list 0 $passing ""]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{item}
+% The |item| procedure is mainly about formatting data on its way
+% back and forth.
+% \begin{tcl}
+proc eemenu::tkSend::item {lines} {
+ upvar #0 eemenu::tkSend::A A
+ set script "$A(prefix)[join $lines $A(joinString)]$A(suffix)"
+ if {$A(replyQ)} then {
+ if {[catch {send $A(target) $script} res]} then {
+ list 1 "Error: $res" "Error: $res\n"
+ } elseif {[string length $res]} then {
+ list 0 "Eval OK: $res" "$res\n"
+ } else {
+ list 0 "Eval OK." ""
+ }
+ } else {
+ send -async $A(target) $script
+ list 0 "Sent [llength $lines] lines." ""
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{end}
+% The |end| procedure does nothing
+% \begin{tcl}
+proc eemenu::tkSend::end {} {list 0 "" ""}
+% \end{tcl}
+% \end{proc}
+%
+% This ends the |if| begun at the top of this subsection.
+% \begin{tcl}
+}
+% \end{tcl}
+%
+% \subsubsection*{Test code}
+%
+% The code below fakes definitions of |send| and |winfo interps| using
+% \Tcllogo\AE\ and |processes| for the purpose of testing the above code.
+% \begin{tcl}
+%<*sendtest>
+proc send {target cmd args} {
+ set sync 1
+ if {![string compare $target -async]} then {
+ set sync 0
+ set target $cmd
+ set cmd [lindex $args 0]
+ }
+ set cmd [tclAE::build::TEXT $cmd]
+ if {$sync} then {
+ tclAE::build::resultData -t 30000 $target misc dosc ---- $cmd
+ } else {
+ tclAE::send $target misc dosc ---- $cmd
+ }
+}
+proc winfo {subcmd args} {
+ if {[string compare $subcmd "interps"]} then {
+ error "Unimplemented winfo subcommand: $subcmd"
+ }
+ set res [list]
+ global tclshSigs
+ foreach pr [processes] {
+ if {[lsearch -exact $tclshSigs [lindex $pr 1]]>=0} then {
+ lappend res [file tail [lindex $pr 0]]
+ }
+ }
+ return $res
+}
+%</sendtest>
+% \end{tcl}
+%
+%
+% \subsection{\texttt{dde} evaluation}
+%
+% Dynamic Data Exchange (\texttt{dde}) is, as I understand it, the
+% Windoze equivalent of AppleEvents, although the events sent have much
+% less structure. The machinery needed here is quite similar to that
+% for \texttt{send} evaluation, but there are a few extra details that
+% can be set.
+% \changes{v\,0.1.1}{2002/07/21}{Renamed the \textsf{Dde} method to
+% \textsf{Windoze DDE}. (LH)}
+%
+% \begin{tcl}
+if {[llength [info commands dde]] && [info tclversion]>=8.0} then {
+% \end{tcl}
+%
+% \begin{arrayentry}[eemenu]{evaluate}{windozeDDE}
+% The details for the |windozeDDE| method constitute a superset of those for
+% the |tkSend| method.
+% \begin{tcl}
+set eemenu::evaluate(windozeDDE) [list\
+% \end{tcl}
+% \begin{details}{Evaluate}
+% \detailitem{service}
+% This is a string that specifies the service to use.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Service" service var "TclEval"]\
+% \end{tcl}
+% \detailitem{target}
+% This is a string that identifies the target application, or as
+% it appears to be called, the ``topic''.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Target" target var]\
+% \end{tcl}
+% \detailitem{aliasing}
+% This detail controls how the |windozeDDE| method should behave when
+% |begin| is called but the specified target isn't available.
+% ``Ask each time'' means present the user with a list of available
+% targets each time |begin| is called, and use what the user
+% selected there. ``Ask once'' is similar, but the choice will be
+% remembered as an \emph{alias} for the specified target (until
+% \Alpha\ is quited or the alias target no longer is available).
+% ``Fail'' means fail immediately.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Alias behaviour"\
+ aliasing [list menu [list "Ask once" "Ask each time" "Fail"]]\
+ "Ask once" "The thing to do when the target is unavailable."]\
+% \end{tcl}
+% \detailitem{launchCmd}
+% This is a \Tcllogo\ command which, when executed by \Alpha,
+% should launch an application that provides a new target for
+% the given service. The command is evaluated at a global level.
+% If it is an empty string, then no option for launching will be
+% presented in the target selection dialog.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Launch command" launchCmd var2]\
+% \end{tcl}
+% \detailitem{joinString}
+% The extracted lines is a list, but the script to send should be
+% a string, so they will have to be joined somehow. This item
+% offers a choice between some common forms of whitespace.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Join lines using"\
+ joinString [list menuindex [list Lf Cr CrLf Space]] 2]\
+% \end{tcl}
+% \detailitem{prefix}
+% This will be prepended to the script sent. It can for example be
+% used to add some command that takes care of the result.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Prefix" prefix var]\
+% \end{tcl}
+% \detailitem{suffix}
+% This will be appended to the script sent.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Suffix" suffix var]\
+% \end{tcl}
+% \detailitem{request}
+% This is the name of the item to request as result from the
+% evaluation. If it is an empty string then no request is made.
+% \begin{tcl}
+ [eemenu::define_detail Evaluate "Requested data" request var]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::windozeDDE {}
+% \end{tcl}
+% \setnamespace{eemenu::windozeDDE}
+%
+% \begin{arrayvar}{alias}
+% The |alias| array is used to keep track of which targets are treated
+% as aliases for other targets. The index is a value of the
+% \texttt{target} detail, the entry value is what it should be
+% replaced by.
+% \end{arrayvar}
+%
+% \begin{variable}{last_target}
+% The |last_target| variable contains the name of the most recently
+% selected target. This is so that the relevant |listpick| dialog
+% can ``remember'' the user's preference in this respect.
+% \begin{tcl}
+set eemenu::windozeDDE::last_target {}
+% \end{tcl}
+% \end{variable}
+%
+% \begin{arrayvar}{A}
+% The |windozeDDE| method keeps its detail settings, and some derived
+% quantities, in the |A| array for convenience of access.
+% \end{arrayvar}
+%
+%
+% \begin{proc}{begin}
+% The main task of this |begin| procedure is to verify that the target
+% is available.
+% \begin{tcl}
+proc eemenu::windozeDDE::begin {details source} {
+ eemenu::multiupvar A alias last_target
+ array set A {service {} target {} aliasing "Ask once" launchCmd {}\
+ prefix {} suffix {} joinString 2 request {}}
+ array set A $details
+ if {![string length $A(service)]} then {
+ return [list 1 "No service has been specified." ""]
+ }
+% \end{tcl}
+% The treatment of aliases depend on the |aliasing| setting. If it is
+% \texttt{Ask once} then an alias will be used even if a target with
+% the given name is available. The rationale for this is that the user
+% has specified that the commands should be sent to that application.
+% \begin{tcl}
+ set T [list]
+ foreach st [dde services $A(service) {}] {lappend T [lindex $st 1]}
+ set T [lsort -dictionary $T]
+ switch -- $A(aliasing) "Ask each time" {
+ if {[lsearch -exact $T $A(target)]>=0} then {
+ set target $A(target)
+ }
+ } "Fail" {
+ if {[lsearch -exact $T $A(target)]>=0} then {
+ set target $A(target)
+ } else {
+ set passing "Target '$A(target)' unavailable."
+ return [list 1 $passing $passing]
+ }
+ } default {
+ set target $A(target)
+ if {[info exists alias($target)]} then {
+ set target $alias($target)
+ }
+ if {[lsearch -exact $T $target]<0} then {unset target}
+ }
+% \end{tcl}
+% If the local |target| variable is not set at this point then it is
+% time to ask the user.
+% \begin{tcl}
+ if {![info exists target]} then {
+ set T2 $T
+ if {[string length $A(launchCmd)]} then {
+ if {[llength $T2]} then {lappend T2 "------------------"}
+ lappend T2 "Launch another"
+ }
+ if {![llength $T2]} then {
+ return [list 1 "No '$A(service)' targets are, or could be\
+ made, available." ""]
+ }
+ if {[catch {listpick -p "Target '$A(target)' unavailable.\
+ Please pick a new one." -L [list $last_target] $T2}\
+ target]} then {
+ return [list 1 "Canceled" ""]
+ }
+ switch -exact -- $target\
+ "------------------" - "Launch another" {
+ set before [clock seconds]
+ uplevel #0 $A(launchCmd)
+ set target {}
+ while {[clock seconds] - $before < 60 &&\
+ ![string length $target]} {
+ foreach st [dde services $A(service) {}] {
+ if {[lsearch -exact $T [lindex $st 1]]<0} then {
+ set target [lindex $st 1]
+ break
+ }
+ }
+ update
+ }
+ if {![string length $target]} then {
+ return [list 1 {Timed out; no new target launched within\
+ 60 seconds.} ""]
+ }
+ set passing "Launched new shell '$target'."
+ } default {
+ set passing "Sending code to '$target'."
+ }
+% \end{tcl}
+% The last |foreach| above locates the first |target| in |$T2| which
+% is not in |$T|. This |foreach| is the reason this code requires
+% \Tcllogo\,8.
+%
+% Now the target should be stored in the necessary variables.
+% \begin{tcl}
+ set last_target $target
+ if {![string compare $A(aliasing) "Ask once"]} then {
+ set alias($A(target)) $target
+ }
+ } else {
+ set passing "Sending code to '$target'."
+ }
+ set A(target) $target
+% \end{tcl}
+% The |joinString| is also decoded.
+% \begin{tcl}
+ set A(joinString) [lindex [list \n \r \r\n " "] $A(joinString)]
+ return [list 0 $passing ""]
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{item}
+% The |item| procedure is mainly about formatting data on its way
+% back and forth.
+% \begin{tcl}
+proc eemenu::windozeDDE::item {lines} {
+ upvar #0 eemenu::windozeDDE::A A
+ set script "$A(prefix)[join $lines $A(joinString)]$A(suffix)"
+ if {[catch {dde execute $A(service) $A(target) $script} res]} then {
+ list 1 "dde error: $res" "$res\n"
+ } elseif {![string length $A(request)]} then {
+ list 0 "Sent [llength $lines] lines." ""
+ } else {
+ if {[catch {dde request $A(service) $A(target) $A(request)} res]}\
+ then {
+ list 1 "dde error: $res" "dde error: $res\n"
+ } elseif {[string length $res]} then {
+ list 0 $res "$res\n"
+ } else {
+ list 0 "Eval OK." ""
+ }
+ }
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{end}
+% The |end| procedure does nothing
+% \begin{tcl}
+proc eemenu::windozeDDE::end {} {list 0 "" ""}
+% \end{tcl}
+% \end{proc}
+%
+% This ends the |if| begun at the top of this subsection.
+% \begin{tcl}
+}
+% \end{tcl}
+%
+% \subsubsection*{Test code}
+%
+% The code below fakes a definition of |dde| using |interp|.
+% \begin{tcl}
+%<*ddetest>
+proc dde {subcmd args} {
+ switch -- $subcmd servername {
+ error "dde servername is not implemented."
+ } execute {
+ if {[llength $args] != 3} then {
+ error "Wrong number of arguments for dde execute."
+ }
+ if {"TclEval" != [lindex $args 0]} then {
+ error "Unknown servername: [lindex $args 0]"
+ }
+ interp eval [lindex $args 1] [lindex $args 2]
+ } poke {
+ if {[llength $args] != 4} then {
+ error "Wrong number of arguments for dde poke."
+ }
+ if {"TclEval" != [lindex $args 0]} then {
+ error "Unknown servername: [lindex $args 0]"
+ }
+ interp eval [lindex $args 1]\
+ [list set [lindex $args 2] [lindex $args 3]]
+ } request {
+ if {[llength $args] != 3} then {
+ error "Wrong number of arguments for dde request."
+ }
+ if {"TclEval" != [lindex $args 0]} then {
+ error "Unknown servername: [lindex $args 0]"
+ }
+ interp eval [lindex $args 1] [list set [lindex $args 2]]
+ } services {
+ if {[llength $args] != 2} then {
+ error "Wrong number of arguments for dde services."
+ }
+ set server [lindex $args 0]
+ if {[string length $server] && $server != "TclEval"} then {
+ return ""
+ }
+ set topic [lindex $args 1]
+ if {![string length $topic]} then {
+ set res [list]
+ foreach slave [interp slaves] {
+ lappend res [list TclEval $slave]
+ }
+ return $res
+ } elseif {[interp exists $topic]} then {
+ return [list [list TclEval $topic]]
+ } else {
+ return ""
+ }
+ } default {
+ error "Unimplemented subcommand: $subcmd"
+ }
+}
+%</ddetest>
+% \end{tcl}
+%
+%
+% \section{Report methods}
+% \label{Sec:Report}
+%
+% The report method takes care of sending output to the user. Like
+% extraction and evaluation methods there is one `begin' procedure
+% |log_open| and one `end' procedure |log_close| for each method, but
+% there are actually two `iterate' procedures. This is because the
+% extracted code is logged using |log_code| \emph{before} it is
+% evaluated, whereas the result is only known after the code has been
+% evaluated and is then logged using |log_result|.
+%
+% The \describestring[proc][eemenu::\meta{method}]{log_open}|log_open|
+% procedure has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::log_open| \word{details} \word{source}
+% \end{quote}
+% where the \word{details} is the key--value list of setting details
+% and \word{source} is the source window name as returned by the
+% extraction method |start| procedure. There is no result from this
+% procedure, but if there is something wrong with its argument then it
+% may stop the \eemenu\ command by returning with an error.
+%
+% The reason the \word{source} argument is provided is that some report
+% methods might want to make some aspect of their output, such as for
+% example a window title or log file name, dependent on the input source.
+% Neither the |statusLine| nor the |logWindow| method do this, though.
+%
+% The \describestring[proc][eemenu::\meta{method}]{log_code}|log_code|
+% procedure has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::log_code| \word{lines}
+% \end{quote}
+% where \word{lines} is the list of lines that will be sent to the
+% evaluation method. The
+% \describestring[proc][eemenu::\meta{method}]{log_result}|log_result|
+% procedure has the syntax
+% \begin{quote}
+% |eemenu::|\meta{method}|::log_result| \word{error?}
+% \word{passing result} \word{permanent result}
+% \end{quote}
+% where the \word{error?} is |1| if there was an evaluation error and
+% |0| otherwise. The \word{passing result} is a result string that
+% describes the current state of the evaluation process; it is meant
+% to be replaced by the next \word{passing result} the next time
+% |log_result| is called. By constrast the \word{permanent result} is
+% meant to be accumulated for each call to |log_result|. Whether a
+% report method uses one or the other (or both) depends on which makes
+% most sense for the output channels it employs. If the \word{passing
+% result} string is empty then it should not replace a previous
+% \word{passing result} string. If the \word{permanent} string is
+% nonempty then it must end with a newline character.
+%
+% The \describestring[proc][eemenu::\meta{method}]{log_close}|log_close|
+% procedure is responsible for cleaning up after the method, but only
+% to the extent that this is necessary. If |log_open| opened a file then
+% |log_close| should close it, but if |log_open| merely opened a window
+% then |log_close| should most likely not close it since the user will
+% want to see what is written in that window. The syntax is simply
+% \begin{quote}
+% |eemenu::|\meta{method}|::log_close|
+% \end{quote}
+% and there is no result from the procedure.
+%
+%
+%
+% \subsection{Status line reports}
+%
+% The |statusLine| method shows the \word{passing result}s on the
+% status line, but does nothing else.
+%
+% \setnamespace{eemenu::statusLine}
+% \begin{arrayentry}[eemenu]{report}{statusLine}
+% There are no details settings for this method.
+% \begin{tcl}
+namespace eval eemenu::statusLine {}
+set eemenu::report(statusLine) [list]
+% \end{tcl}
+% \end{arrayentry}
+%
+% \begin{proc}{log_open}
+% \begin{proc}{log_close}
+% \begin{proc}{log_code}
+% \begin{proc}{log_result}
+% Only the |log_result| procedure needs to do anything.
+% \begin{tcl}
+proc eemenu::statusLine::log_open {details source} {}
+proc eemenu::statusLine::log_close {} {}
+proc eemenu::statusLine::log_code {lines} {}
+proc eemenu::statusLine::log_result {was_err passing permanent} {
+ if {[string length $passing]} then {status::msg $passing}
+}
+% \end{tcl}
+% \end{proc}\end{proc}\end{proc}\end{proc}
+%
+%
+% \subsection{Log window reports}
+%
+% The |logWindow| method opens a particular window and inserts
+% everything that is logged there.
+%
+% \begin{arrayentry}[eemenu]{report}{logWindow}
+% There are three detail settings for |logWindow| reports.
+% \begin{tcl}
+set eemenu::report(logWindow) [list\
+% \end{tcl}
+% \begin{details}{Report}
+% \detailitem{winName}
+% This is the name of the log window.
+% \begin{tcl}
+ [eemenu::define_detail Report "Window name" winName var "Log"]\
+% \end{tcl}
+% \detailitem{winMode}
+% This is the mode to use for the log window.
+% \begin{tcl}
+ [eemenu::define_detail Report "Window mode" winMode mode "Text"]\
+% \end{tcl}
+% \detailitem{prompt}
+% This is a ``prompt'' string that will be put at the beginning of
+% each code line.
+% \begin{tcl}
+ [eemenu::define_detail Report "Prompt" prompt var\
+ "[text::Ascii 200 1] "]\
+% \end{tcl}
+% \detailitem{antiprompt}
+% This is a string that will be put at the beginning of each line
+% that is not a code line.
+% \begin{tcl}
+ [eemenu::define_detail Report "Antiprompt" antiprompt var ""]]
+% \end{tcl}
+% \end{details}
+% \end{arrayentry}
+% \begin{tcl}
+namespace eval eemenu::logWindow {}
+% \end{tcl}
+% \setnamespace{eemenu::logWindow}
+%
+% \begin{arrayvar}{A}
+% The |logWindow| method keeps its detail settings in the |A|
+% array. Those are all the global variables it has.
+% \end{arrayvar}
+%
+% \begin{proc}{log_open}
+% This procedure opens the log window (if it isn't open already)
+% and positions the cursor at the end of the window. This is
+% assumed to be at the beginning of a line.
+% \begin{tcl}
+proc eemenu::logWindow::log_open {details source} {
+ upvar #0 eemenu::logWindow::A A
+ array set A {winName {Log window} prompt {} antiprompt {}}
+ array set A $details
+ set win $A(winName)
+ if {[lsearch -exact [winNames] $win] == -1} then {
+ set call [list new -n $win -shell 1]
+ if {[mode::exists $A(winMode)]} then {lappend call -m $A(winMode)}
+ eval $call
+ }
+ set t [maxPos -w $win]
+ select -w $win $t $t
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{log_code}
+% The |log_code| procedure inserts the lines at the current position
+% in the file. This will be at the end of the file, unless the
+% evaluation modifies this.
+% \begin{tcl}
+proc eemenu::logWindow::log_code {lines} {
+ upvar #0 eemenu::logWindow::A A
+ insertText -w $A(winName) "$A(prompt)[join $lines "\n$A(prompt)"]\n"
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{log_result}
+% The |log_result| procedure inserts the \word{permanent result} at
+% the current position in the file. If the |antiprompt| is
+% nonempty then the result is first broken into lines and then
+% reassembled, however. It also displays the \word{passing result} on
+% the status line (this has to be done last, since |insertText|
+% clears the status line).
+% \begin{tcl}
+proc eemenu::logWindow::log_result {was_err passing permanent} {
+ if {[string length $permanent]} then {
+ upvar #0 eemenu::logWindow::A A
+ if {[string length $A(antiprompt)]} then {
+ set L [lreplace [split $permanent \n\r] end end]
+ set permanent "[join $L "\n$A(antiprompt)"]\n"
+ }
+ insertText -w $A(winName) "$A(antiprompt)$permanent"
+ }
+ if {[string length $passing]} then {status::msg $passing}
+}
+% \end{tcl}
+% \end{proc}
+%
+% \begin{proc}{log_close}
+% This procedure does nothing.
+% \begin{tcl}
+proc eemenu::logWindow::log_close {} {}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \section{Default command definitions}
+% \label{Sec:DefCmdA}
+%
+% This section contains some examples of \eemenu\ commands and
+% it also provides defaults for the |cmdA| array.
+%
+% \setnamespace{eemenu}
+%
+% \begin{arrayvar}{cmdA}
+% If this array is already set then there is no need to source the
+% rest of the file.
+% \begin{tcl}
+if {[info exists eemenu::cmdA]} then {return}
+% \end{tcl}
+% \end{arrayvar}
+%
+%
+% \begin{arrayentry}{cmdA}{dtx -> internal Tcl}
+% This is the command that corresponds most closely to that provided
+% by the old \textsf{dtxload} package.
+% \begin{tcl}
+set {eemenu::cmdA(dtx -> internal Tcl)} [list\
+% \end{tcl}
+% By default the command is active and bound to \textsf{Cmd--L} in
+% \TeX\ mode, but it is not put in the menu.
+% \begin{tcl}
+ active 1 binding /L<O mode TeX\
+ in_menu 0\
+% \end{tcl}
+% The extraction method is docstripping. Only code in \texttt{.dtx}
+% files that is furthermore in a \texttt{tcl} or \texttt{tcl*}
+% environment is kept. Again, these are the defaults in the
+% \textsf{dtxload} package.
+% \begin{tcl}
+ extractor Docstrip extract_extra [list\
+ filePatL *.dtx sourceEnvsL {tcl tcl*} lookAtEnvs 1\
+ ]\
+% \end{tcl}
+% The command uses |info complete| to test if it has got a complete
+% command, sends the extracted code to \Alpha's internal \Tcllogo\
+% interpreter, and logs the result on the status line.
+% \begin{tcl}
+ complete "Tcl Info Complete" complete_extra {}\
+%
+ evaluator "Internal Tcl" eval_extra {}\
+%
+ reporter "Status Line" report_extra {}\
+%
+]
+% \end{tcl}
+% Of course, this default setting needs to be saved.
+% \begin{tcl}
+prefs::modified {eemenu::cmdA(dtx -> internal Tcl)}
+% \end{tcl}
+% \end{arrayentry}
+%
+%
+% \begin{arrayentry}{cmdA}{dtx -> remote Tcl}
+% This is a command that I have lately found to be increasingly useful.
+% The functionality was provided in the \textsf{dtxload} package, but
+% it was always slightly awkward as it was not a distinct command.
+% Instead the |evaluateRemotely| variable was used as a selector
+% between this and the previous command.
+%
+% Since these two commands are anyway quite similar, I'll copy
+% settings from the above, only changing those that are different.
+% \begin{tcl}
+catch {unset A}
+array set A [set {eemenu::cmdA(dtx -> internal Tcl)}]
+% \end{tcl}
+% Since keys combinations are sort of in short supply, this command
+% is by default inactive but has the same binding and mode as its
+% \textsf{internal~Tcl} counterpart. This means that if one of these
+% commands is activated then the other is automatically deactivated
+% and so it is anyway easy to switch between them. I also put this
+% remote \Tcllogo\ command in the menu.
+% \begin{tcl}
+set A(active) 0
+set A(in_menu) 1
+% \end{tcl}
+%
+% Communication with remote interpreters is a messy business, due to
+% the many technical details one has do deal with. It is also very
+% platform-dependent. The Mac\,OS settings are however not too
+% complicated, much thanks to \TclAE.
+% \changes{v\,0.3}{2003/06/01}{Corrected condition used for selecting
+% remote evaluation method. (LH)}
+% \begin{tcl}
+if {[info exists eemenu::evaluate(doScriptAE)]} then {
+ set A(evaluator) "Do Script AE"
+ set A(eval_extra)\
+ [list targetApp '${tclshSig}' joinString 0 replyQ 1]
+} \
+% \end{tcl}
+%
+% The Windoze settings are the most complicated. One reason for this
+% is that |dde execute| does not return the result of the script, so
+% that a separate call is needed for this.
+% \begin{tcl}
+elseif {[info exists eemenu::evaluate(windozeDDE)]} then {
+ set A(evaluator) "Windoze DDE"
+ set A(eval_extra) [list\
+%
+ service TclEval target Tcl_1 launchCmd\
+ {exec $tclshSig [file join $HOME Tools winRemoteShell.tcl] &}\
+%
+ joinString 0 prefix "catch \{" suffix "\} alpha_result"\
+ request alpha_result]
+} \
+% \end{tcl}
+%
+% Finally, there are the settings for |send|, which are used on all
+% other platforms.
+% \begin{tcl}
+else {
+ set A(evaluator) "Tk Send"
+ set A(eval_extra) [list target wish joinString 0 replyQ 1]
+}
+% \end{tcl}
+% Then all that remains is to store the settings into the |cmdA| array.
+% \begin{tcl}
+set {eemenu::cmdA(dtx -> remote Tcl)} [array get A]
+prefs::modified {eemenu::cmdA(dtx -> remote Tcl)}
+unset A
+% \end{tcl}
+% \end{arrayentry}
+%
+% \begin{arrayentry}{cmdA}{Tcl example in AIDA}
+% AIDA probably isn't that well known, but in brief it is an
+% experimental source format for \Alpha\ documentation, which can
+% be converted to plain text, \LaTeX, HTML, and some other formats too.
+% Verbatim text lines (as needed for code examples) can of course be
+% included expressed in AIDA; the required markup is mainly that each
+% such line begins with the two characters \verb"(|". Such code can
+% easily be extracted using the regexp extractor.
+%
+% This code is no longer included, since AIDA isn't much used anymore.
+% \begin{tcl}
+%<*aidacode>
+set {eemenu::cmdA(Tcl example in AIDA)} [list\
+%
+ extractor Regexp extract_extra [list\
+% \end{tcl}
+% The filter should get the lines matching the expression, i.e., it
+% should work in \texttt{grep} mode, and the characters that are
+% matched should be removed.
+% \begin{tcl}
+ filter_mode grep filterRE {^\(\|} searchRE {^\(\|} replaceRE {}]\
+% \end{tcl}
+% Evaluation is internally in \Alpha, and the completion test can use
+% |info complete|.
+% \begin{tcl}
+ complete "Tcl Info Complete" complete_extra {}\
+%
+ evaluator "Internal Tcl" eval_extra {}\
+% \end{tcl}
+% Then there's the matter of how to report the result. Since that
+% hasn't been used yet, it seems a good idea to try to use a log
+% window here.
+% \begin{tcl}
+ reporter "Log Window" report_extra {winName {AIDA example log}\
+ winMode Tcl prompt {% } antiprompt {}}\
+% \end{tcl}
+% Finally there's the matter of the binding and the menu. There isn't
+% anything new here, except that the binding is only made active if
+% \texttt{AIDA} mode is installed (since modes not installed will
+% sometimes be interpreted as |<none>|, i.e., global).
+% \begin{tcl}
+ active [mode::exists AIDA] binding /L<O mode AIDA in_menu 1]
+prefs::modified {eemenu::cmdA(Tcl example in AIDA)}
+%</aidacode>
+% \end{tcl}
+% \end{arrayentry}
+%
+% \begin{arrayentry}{cmdA}{Tcl Wiki}
+% When editing a page on the \Tcllogo'ers Wiki~\cite{TclWiki} or the
+% \AlphaTcl\ Wiki~\cite{AlphaTclWiki}, one occasionally finds the need
+% to test some piece of \Tcllogo\ code on that page. This is down to a
+% single keypress with the following command, that extracts lines of
+% verbatim text from a Wiki page and feeds them to the internal
+% interpreter.
+%
+% The syntax of verbatim lines on the \Tcllogo'ers Wiki is
+% basically ``any line that starts with a space'', but unfortunately
+% there are a few exceptions. The equivalents of \LaTeX\ \verb|\item|s
+% for \texttt{itemize} or \texttt{enumerate} are coded as lines that
+% begin with three spaces, a \texttt{*} or \meta{digit}\texttt{.}
+% respectively, and another space. The equivalents of \LaTeX\
+% \verb|\item|s for \texttt{description} are coded as lines that
+% begin with \emph{at least} three spaces, some other characters, a
+% colon, and another three spaces (exactly). It is possible to write a
+% regular expression to filter out such lines.
+% \begin{tcl}
+set {eemenu::cmdA(Tcl Wiki)} [list\
+%
+ extractor Regexp extract_extra [list\
+% \end{tcl}
+% The filter works in \texttt{anti-grep} mode, and has to filter out
+% four different types of non-code lines. There is however no need
+% for further substitutions on the code lines.
+% \begin{tcl}
+ filter_mode anti-grep searchRE {} replaceRE {}\
+ filterRE {^[^ ]|^ (\*|[0-9]\.) |^ .+: [^ ]} ]\
+% \end{tcl}
+% Evaluation is internally in \Alpha, and the completion test can use
+% |info complete|.
+% \begin{tcl}
+ complete "Tcl Info Complete" complete_extra {}\
+%
+ evaluator "Internal Tcl" eval_extra {}\
+% \end{tcl}
+% Then there's the matter of how to report the result. Since that
+% hasn't been used yet, it seems a good idea to try to use a log
+% window here.
+% \begin{tcl}
+ reporter "Log Window" report_extra {winName {Wiki code log}\
+ winMode Tcl prompt {% } antiprompt {}}\
+% \end{tcl}
+% Finally there's the matter of the binding and the menu. There isn't
+% anything new here, except that the binding is only made active if
+% \texttt{Wiki} mode is installed (since modes not installed will
+% sometimes be interpreted as |<none>|, i.e., global).
+% \begin{tcl}
+ mode Wiki active [mode::exists Wiki] binding /L<O in_menu 1]
+prefs::modified {eemenu::cmdA(Tcl Wiki)}
+% \end{tcl}
+% \end{arrayentry}
+%
+% Finally, let's try something which isn't \Tcllogo.
+%
+% \begin{arrayentry}{cmdA}{Mathematica}
+% It is a fairly small modification to make a command which sends
+% DoScript AEs to Mathematica instead of Wish. There's probably a way
+% to do this using |dde| too, but I don't know what that could be.
+%
+% Since Mathematica code presumably concerns rather mathematical
+% problems, the comments to the code is likely to contain fairly
+% advanced mathematical formulae. This makes the \texttt{.dtx}
+% format an interesting choice for source format, and hence I choose
+% to use docstripping as extraction method. As there is no special
+% environment for Mathematica code, the source environments are the
+% generic \texttt{macrocode} and \texttt{macrocode*}.
+% \begin{tcl}
+set eemenu::cmdA(Mathematica) [list\
+%
+ extractor Docstrip extract_extra [list\
+ filePatL *.dtx sourceEnvsL {macrocode macrocode*} lookAtEnvs 1\
+ ]\
+% \end{tcl}
+% The extracted code is sent in a DoScript AppleEvent to the
+% Mathematica kernel. Unfortunately the kernel doesn't seem to
+% produce any result, so we'll have to leave it at that. Since there
+% is no convenient way of testing whether something is a complete
+% command in this case, all code from the entire selection is sent in
+% one event.
+% \begin{tcl}
+ evaluator "Do Script AE" eval_extra\
+ [list targetApp 'Math' joinString 1 replyQ 0]\
+%
+ complete "Entire Selection" complete_extra {}\
+%
+ reporter "Status Line" report_extra {}\
+% \end{tcl}
+% The binding and menu settings are the same as for the remote
+% \Tcllogo\ command.
+% \begin{tcl}
+ active 0 binding /L<O mode TeX in_menu 0]
+% \end{tcl}
+% Of course, this default setting needs to be saved.
+% \begin{tcl}
+prefs::modified {eemenu::cmdA(Mathematica)}
+% \end{tcl}
+% \end{arrayentry}
+%
+%
+% \begin{thebibliography}{9}
+% \bibitem{TclWiki}
+% The \Tcllogo'ers Wiki,
+% \href{http://purl.org/tcl/wiki/}{\textsc{http:}/\slash
+% \texttt{purl.org}\slash \texttt{tcl}\slash \texttt{wiki}/}
+% \bibitem{AlphaTclWiki}
+% \AlphaTcl\ Wiki, \href{http://alphatcl.sourceforge.net/wikit/}
+% {\textsc{http:}/\slash \texttt{alphatcl.sourceforge.net}\slash
+% \texttt{wikit}/}
+% \end{thebibliography}
+%
+%
+\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.ins b/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.ins
new file mode 100644
index 00000000000..6b28dcfde27
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tools/eemenu.ins
@@ -0,0 +1,66 @@
+% eemenu.ins --- DOCSTRIP installation script for eemenu.
+\input docstrip
+
+% Redefine the \MetaPrefix; it should be something which starts a
+% until-end-of-line comment:
+\edef\MetaPrefix{\string#\string#}
+
+
+% Redefine the file preamble and postamble; this is necessary because
+% otherwise the old \metaPrefix is inserted at the beginning of these
+% lines.
+\preamble
+
+This file 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.
+
+This file may only be distributed together with a copy of the source
+file from which it was generated. You may distribute that source file
+without this generated file.
+
+You may alternatively distribute, use, and modify this files under
+the conditions of a BSD-style license. In so doing, you should
+however note that
+**************************************
+* This Source is not the True Source *
+**************************************
+the true source is the file from which this one was generated.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+% Add a (auto-install) line at the top of the preamble, so that
+% Alpha will auto-install it.
+\edef\defaultpreamble{%
+ \MetaPrefix\space (auto-install)^^J%
+ \defaultpreamble
+}
+
+% Actually make eemenu.tcl:
+\generate{
+ \file{eemenu.tcl}{\from{eemenu.dtx}{pkg}}
+ \file{eefor7menu.tcl}{\from{eemenu.dtx}{pkg,atcl7,dialogspatch}}
+}
+
+
+\Msg{}
+\Msg{*********************************************}
+\Msg{*}
+\Msg{* To complete installation, have Alpha open}
+\Msg{* the file eemenu.tcl somewhere outside the}
+\Msg{* Alpha folder hierarchy. You may also have}
+\Msg{* to rebuild Alpha's Tcl and Package indices}
+\Msg{* (Alpha normally does this automatically).}
+\Msg{*}
+\Msg{*********************************************}
+\Msg{}
+
+
+\end
diff --git a/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.dtx b/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.dtx
new file mode 100644
index 00000000000..3b024427ab6
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.dtx
@@ -0,0 +1,234 @@
+%
+% \iffalse
+%<*driver>
+\documentclass{tclldoc}
+\begin{document}
+\DocInput{sourcedtx.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \title{The \textsf{sourcedtx} package}
+% \author{Lars Hellstr\"om}
+% \date{18 July 2003}
+% \maketitle
+%
+% \begin{abstract}
+% The \textsf{sourcedtx} package provides a \Tcllogo\ command
+% |dtx::source| that makes it possible to |source| \Tcllogo\ code
+% from a \textsf{doc}-style \texttt{.dtx} file without docstripping
+% it first.
+% \end{abstract}
+%
+%
+% \begin{tcl}
+%<*pkg>
+namespace eval dtx {}
+% \end{tcl}
+% \setnamespace{dtx}
+%
+% \begin{proc}{strip_string}
+% The |strip_string| procedure does the actual docstripping for
+% |source_dtx|. The syntax is
+% \begin{quote}
+% |dtx::strip_string| \word{text} \word{option list}
+% \word{meta prefix}\regopt\ \word{interaction}\regopt
+% \end{quote}
+% where \word{text} is the string to docstrip and \word{option list}
+% is the list of options to use. The \word{meta prefix} (by default
+% two percent signs) is the string to use for the \textsc{docstrip}
+% parameter \verb|\MetaPrefix|. The \word{interation} (by default 1)
+% is a flag for the ``interaction'' level to use. |0| means error
+% messages are simply written to |stderr|, whereas |1| means an error
+% will be raised. (It is possible that \word{interaction} will be
+% extended to a ``flag word'' where each bit controls some aspect of
+% the interaction.)
+%
+% When errors are raised, the |errorCode| is set to a list with the
+% format
+% \begin{quote}
+% |DOCSTRIP| \word{situation} \word{lineno}
+% \end{quote}
+% where \word{lineno} is the line number (starting at one) of the line
+% where the error was detected. The \word{situation}s are described
+% below, at the positions in the code where they can occur.
+%
+% \begin{tcl}
+proc dtx::strip_string {text options {metaprefix %%} {interaction 1}} {
+% \end{tcl}
+% The |O| array has entires for precisely the specified options, so
+% that an opion can be tested using |info exists|.
+% \begin{tcl}
+ foreach option $options {set O($option) ""}
+% \end{tcl}
+% |stripped| is where the text that passes docstripping is collected.
+% \begin{tcl}
+ set stripped ""
+% \end{tcl}
+% |block_stack| is the list of modules inside which the current line
+% lies. |offlevel| is the number of modules that must be exited
+% before code lines should once again be included. |verbatim| is a
+% flag for whether verbatim mode is in force.
+% \begin{tcl}
+ set block_stack [list]
+ set offlevel 0
+ set verbatim 0
+% \end{tcl}
+% |lineno| is the input line number counter, for use in error
+% messages.
+% \begin{tcl}
+ set lineno 1
+% \end{tcl}
+% Here starts the main loop over lines in the \word{text}. It
+% constitutes the majority of the procedure and is split in two
+% parts. The smaller part handles lines in verbatim mode (unusual),
+% the large part handles lines in normal mode (with comment lines,
+% code lines, guard lines, and so on).
+% \begin{tcl}
+ foreach line [split $text \n] {
+ if {$verbatim} then {
+ if {$line eq $endverbline} then {
+ set verbatim 0
+ } elseif {!$offlevel} then {
+ append stripped $line \n
+ }
+ } else {
+ switch -glob -- $line %%* {
+ if {!$offlevel} then {
+ append stripped $metaprefix\
+ [string range $line 2 end] \n
+ }
+ } %<<* {
+ set endverbline "%[string range $line 3 end]"
+ set verbatim 1
+ } %<* {
+ if {[regexp -- {^%<([*/+-]?)([^>]*)>(.*)$} $line ""\
+ modifier expression line]} then {
+% \end{tcl}
+% There is a well-formed guard line. First the expression is
+% evaluated, by converting it to an |expr| expression.
+% \begin{tcl}
+ regsub -all -- {\\|\{|\}|\$|\[|\]| |;} $expression\
+ {\\&} E
+ regsub -all -- {,} $E {|} E
+ regsub -all -- {[^()|&!]+} $E {[info exists O(&)]} E
+ set val [expr $E]
+ switch -exact -- $modifier * {
+ lappend block_stack $expression
+ if {$offlevel || !$val} then {incr offlevel}
+ } / {
+ if {![llength $block_stack]} then {
+% \end{tcl}
+% In this case there was no open block for this guard to end. That
+% is a \describestring[error situation]{SPURIOUS}|SPURIOUS|
+% \word{situation}.
+% \begin{tcl}
+ if {$interaction} then {
+ error "Spurious end block </$expression>\
+ ignored." ""\
+ [list DOCSTRIP SPURIOUS $lineno]
+ } else {
+ puts stderr "docstrip: Spurious end\
+ block </$expression> ignored on line\
+ $lineno."
+ }
+ } else {
+ if {[string compare $expression\
+ [lindex $block_stack end]]} then {
+% \end{tcl}
+% In this case the expression of the block being closed does not match
+% the expression on the block on top of the stack. That is a
+% \describestring[error situation]{MISMATCH}|MISMATCH|
+% \word{situation}. \textsc{docstrip} by default raises an error and
+% recovers by treating this situation as a typo.
+% \begin{tcl}
+ if {$interaction} then {
+ error "Found </$expression> instead of\
+ </[lindex $block_stack end]>." ""\
+ [list DOCSTRIP MISMATCH $lineno]
+ }
+ puts stderr "docstrip:\
+ Found </$expression> instead of\
+ </[lindex $block_stack end]> on line\
+ $lineno."
+ }
+% \end{tcl}
+% All that error processing makes it easy to lose track, but the
+% following two lines are what does the real work for an end of block
+% guard: pop a block off the stack and decrement the |offlevel|.
+% \begin{tcl}
+ if {$offlevel} then {incr offlevel -1}
+ set block_stack [lreplace $block_stack end end]
+ }
+ } - {
+ if {!$offlevel && !$val} then {
+ append stripped $line \n
+ }
+ } default {
+ if {!$offlevel && $val} then {
+ append stripped $line \n
+ }
+ }
+ } else {
+% \end{tcl}
+% In this case the line looks like a guard line, but there is no |>|
+% terminating the guard expression. This is a
+% \describestring[error situation]{BADGUARD}|BADGUARD|
+% \word{situation}.
+% \begin{tcl}
+ if {$interaction} then {
+ error "Malformed guard on line $lineno." ""\
+ [list DOCSTRIP BADGUARD $lineno]
+ } else {
+ puts stderr "docstrip: Malformed guard\
+ on line $lineno:"
+ puts stderr $line
+ }
+ }
+ } %* {}\
+% \end{tcl}
+% With comment lines, nothing is done. A line being the exact string
+% |\endinput| terminates the stripping.
+% \begin{tcl}
+ {\\endinput} {
+ break
+ } default {
+% \end{tcl}
+% Other lines are code lines. These are included or not, depending on
+% the |offlevel|.
+% \begin{tcl}
+ if {!$offlevel} then {append stripped $line \n}
+ }
+ }
+ incr lineno
+ }
+ return $stripped
+}
+% \end{tcl}
+% \end{proc}
+%
+%
+% \begin{proc}{source}
+% This procedure behaves as a docstripping |source| command: it reads
+% a file, docstrips its contents in memory, and evaluates the result
+% as a \Tcllogo\ script in the context of the caller. The syntax is
+% \begin{quote}
+% |dtx::source| \word{dtx-file} \word{options}
+% \end{quote}
+% where \word{dtx-file} is the file name and \word{options} is the
+% list of options.
+% \begin{tcl}
+proc dtx::source {name options} {
+ set F [open $name r]
+ set text [read $F]
+ close $F
+ uplevel 1 [dtx::strip_string $text $options #]
+}
+%</pkg>
+% \end{tcl}
+% \end{proc}
+%
+%
+\endinput
+
+ \ No newline at end of file
diff --git a/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.ins b/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.ins
new file mode 100644
index 00000000000..f26acf7ee73
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tcldoc/tools/sourcedtx.ins
@@ -0,0 +1,31 @@
+% sourcedtx.ins --- DOCSTRIP installation script for sourcedtx.tcl.
+\input docstrip
+
+% Redefine the \MetaPrefix; it should be something which starts a
+% until-end-of-line comment:
+\edef\MetaPrefix{\string#\string#}
+
+
+% Redefine the file preamble and postamble; this is necessary because
+% otherwise the old \metaPrefix is inserted at the beginning of these
+% lines.
+\preamble
+
+This file is put in the public domain. Note however that
+**************************************
+* This Source is not the True Source *
+**************************************
+the true source is the file from which this one was generated.
+
+\endpreamble
+
+\postamble
+\endpostamble
+
+% Actually make sourcedtx.tcl:
+\generate{
+ \file{sourcedtx.tcl}{\from{sourcedtx.dtx}{pkg}}
+}
+
+
+\end
diff --git a/Master/texmf-dist/source/latex/texshade/texshade.dtx b/Master/texmf-dist/source/latex/texshade/texshade.dtx
new file mode 100644
index 00000000000..d36d37f4aae
--- /dev/null
+++ b/Master/texmf-dist/source/latex/texshade/texshade.dtx
@@ -0,0 +1,15315 @@
+% \iffalse
+%
+% texshade.dtx
+% Docstrip archive, to extract documentation run twice through
+% LaTeX.
+% To successfully extract the documentation it is necessary to
+% first run the file `texshade.ins' through LaTeX. This produces
+% the needed style file `texshade.sty' and the parameter file
+% `texshade.def' as well as several example files. See the file
+% `texshade.txt' for further information!
+%
+%
+% Copyright (C) 1999-2005 Eric Beitz
+% See the file texshade.txt
+%
+% \fi
+%
+% \changes{1.0}{1999-5-12}{First release}
+% \changes{1.1}{1999-5-26}{%
+% Corrections: `emphregion' is not extending to the next
+% alignment any more;
+% `namecolor' & `numbercolor' are now correctly
+% reordered;
+% sequence gaps at the beginning or the end are
+% now treated correctly, i.e. no symbols are shown.
+% Introduction: `seqlength'
+% `gapcolors'
+% `rulersteps'
+% `hideresidues'
+% `showresidues'
+% `fingerprint'.}
+% \changes{1.2}{1999-6-12}{%
+% Corrections: functional shading error in funcgroup no. 8.
+% Introduction: `includeDSSP'
+% `includeSTRIDE'
+% `includePHDsec'
+% `includePHDtopo'
+% `appearance'
+% `numcount'
+% `alphacount'
+% `Alphacount'
+% `showonDSSP'
+% `hideonDSSP'
+% `showonSTRIDE'
+% `hideonSTRIDE'
+% `showonPHDsec'
+% `hideonPHDsec'
+% `showonPHDtopo'
+% `hideonPHDtopo'.}
+% \changes{1.2a}{1999-6-24}{%
+% Corrections: `namecolor' & `numbercolor' are now really
+% correctly reordered;
+% in sequence names ( and ) are now allowed;
+% option `case' in `funcshadingstyle' works now.}
+% \changes{1.3}{2000-3-3}{%
+% Corrections: features in the ttop row do not produce line
+% scrambling any more;
+% `language' replaced by `germanlanguage'
+% and `englishlanguage' due to
+% incompatibilities with babel;
+% incompatibility with amsmath's text command fixed.
+% Introduction: new feature option `translate'
+% `codon'
+% `geneticcode'
+% `backtranslabel'
+% `backtranstext'
+% `romancount'
+% `Romancount'
+% TeXtopo compatibility.}
+% \changes{1.3a}{2000-7-28}{%
+% Introduction: `showleadinggaps'
+% `hideleadinggaps' to hide or show gap symbols
+% before the actual seq start.}
+% \changes{1.3b}{2000-7-30}{%
+% Corrections: `showleadinggaps'
+% `hideleadinggaps' were extended to `ending' gaps;
+% sequence names input routine now accepts special
+% characters.}
+%
+% \changes{1.4}{2000-9-12}{%
+% Introduction: `movelegend' allows one to move the legend;
+% series of sequence numbers, e.g. in `orderseqs',
+% can now be written with a dash, e.g. {1-3,6-4,7} instead
+% of {1,2,3,6,5,4,7}.}
+%
+% \changes{1.4a}{2000-10-3}{Documentation and FAQ additions}
+%
+% \changes{1.5}{2001-02-22}{%
+% Corrections: `X's in the alignment lead to a run-time error;
+% Introduction: `ttopspace'
+% `topspace'
+% `bottomspace'
+% `bbottomspace' for controlling vertical space
+% between feature lines.
+% `showcaption' for adding a caption to the alignment.
+% the sequence lengths are now stored in the .aux
+% in order to have correct gap breaks after the seqs.}
+%
+% \changes{1.5a}{2001-03-08}{%
+% Corrections: Eckhart Guth\"orlein noticed a sorting problem
+% when in addition some sequences where `killed' and
+% the consensus was set to a particular sequence.
+% This update fixes this problem.}
+%
+% \changes{1.6}{2002-03-26}{%
+% Corrections: There is no restriction to `dvips' anymore. One
+% can add an option to the \usepackage{texshade}
+% call which is passed to color.sty, e.g. `dvipdf';
+% `noblockskip' led to over-printing of lines;
+% `namecolor' and `numbercolor' did not support
+% sequence lists - fixed (thanks to Denys Bashtovyy).
+% Introduction: The FASTA file format is now supported;
+% references to sequences can be made by name in
+% addition to number;
+% sequences can be refered to by their name in
+% addition to their number in the input file
+% (suggested by Christoph Gille);
+% `flexblockspace' optimizes the space between
+% sequence blocks to be minimal (is
+% default as before);
+% `fixblockspace' leads to an equal separation of
+% sequence blocks independent of
+% feature lines;
+% `firstcolumnDSSP' lets you choose the first numbering
+% column in DSSP input files and
+% `secondcolumnDSSP' the second column.}
+%
+% \changes{1.7}{2004-01-05}{%
+% Corrections: Several bugs were fixed.
+% In gaps the wrong character was plotted in `donotshade'
+% mode. Gaps were colored incorrectly when a single
+% sequence was set as consensus. (thanks to Jeferson J.
+% Arenzon). Another `donotshade' problem was solved
+% which led to a halt of the LaTeX run (thanks go to
+% Naomi Siew). The gap and match labels in diverse
+% mode were switched (`-' in gaps; `.' at matching
+% positions) in order to follow convention.
+% Introduction: Spanish labels (contributed by Mikel Egana Aranguren);
+% New feature label `helix'.}
+%
+% \changes{1.8}{2004-08-26}{%
+% Corrections: Minor bugs were fixed.
+% Introduction: Definition of "light" versions of all colors;
+% Definition of three color ramps:
+% Red-Blue, Green-Red and Cold-Hot;
+% New feature labels `bar' and `color'.}
+%
+% \changes{1.9}{2005-02-08}{%
+% Corrections: Fixed TeXtopo incompatibility introduced with v1.8.
+% (Thanks to Meike Schmedt)
+% Introduction: Implementation of HMMTOP topology prediction.
+% `includeHMMTOP'
+% `showonHMMTOP'
+% `hideonHMMTOP'
+% new `appearance' option {HMMTOP} with {internal}
+% {external}
+% {TM};
+% new arrow look with scalable line thickness;
+% new arrow option `ball';
+% `frameblock' colored frame around sequence block;
+% `shortcaption' allows one to define short caption
+% versions for the List of Figures.}
+%
+% \changes{1.10}{2005-03-29}{%
+% Corrections: Sped up drawing of color scales and bar graphs by
+% by more than 10fold!
+% (Thanks, Christoph Gille, for asking for it)
+% Introduction: Definition of even lighter versions of all colors;
+% implementation of a new labeling mode 'tint':
+% `tintregion'
+% `tintblock'
+% `tintdefault';
+% new `feature' option {restriction} for putting a
+% triangle label pointing between two residues;
+% data files for color scales and bar graphs can
+% now contain 'NaN' (not a number) values
+% (Also requested by Christoph Gille.)}
+%
+% \changes{1.11}{2005-04-13}{%
+% Corrections: Frames were drawn with the wrong height when
+% separation lines were used. Fixed.
+% Spacing between bar graph feature line and
+% sequence block was wrong after `bargraphstretch'.
+% Introduction: Additional optional parameter for feature rule
+% thickness;
+% additional optional parameters for feature box
+% frame color and frame thickness;
+% definition of three more color scales:
+% {RedBlue}, {RedGreen}, and {HotCold};
+% plotting of amino acid features as bar graphs
+% or color scales:
+% `hydrophobicity'
+% `molweight'
+% `charge';
+% plotting of protein sequence conservation as
+% bar graph or color scale:
+% `conservation';
+% separate command for stretching color scales:
+% `colorscalestretch';
+% color scales on consensus sequence according
+% to sequence conservation.
+% }
+%
+% \changes{1.12}{2005-09-20}{%
+% Corrections: Combination of 'setends' with regional labeling
+% using 'shaderegion', 'frameblock', 'emphregion'
+% or 'tintregion' produced incorrect output
+% (thanks to Chris Page). Fixed.
+% Introduction: Optional colors for `showconsensus' foreground
+% and background.
+% }
+%
+%
+% \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 \~}
+%
+%
+% \newsavebox{\mybox}
+% \newenvironment{fmpage}[1][0.975\textwidth]{%
+% \begin{lrbox}{\mybox}\begin{minipage}{#1}}
+% {\end{minipage}\end{lrbox}\fbox{\usebox{\mybox}}}
+%
+% \parindent0mm
+%
+%
+% \title{The \TeXshade{} package\footnote{Please cite: Eric Beitz (2000),
+% \TeX{}shade:
+% shading and labeling multiple sequence alignments using \LaTeXe.
+% \textit{Bioinformatics}: \textbf{16}, 135--139.}\\[2mm] \large
+% Typesetting \\ nucleotide and peptide alignments}
+% \author{Eric Beitz\footnote{University of T\"ubingen,
+% Pharmaceutical Chemistry, Morgenstelle 8,
+% D-72076 T\"ubingen, Germany;
+% send electronic mail to \texttt{eric.beitz@uni-tuebingen.de};
+% for further information, updates and on-line documentation
+% see my homepage at
+% \texttt{http://homepages.uni-tuebingen.de/beitz/}}}
+% \date{v1.12; 2005/09/20\\}
+% \maketitle
+% \begin{abstract}
+% Setting alignments of nucleotides and peptides for publication
+% or presentation purposes is usually a time consuming two-step process.
+% First, a scientific software is used for the calculation of the
+% alignment. This
+% is done in a few minutes. Then, in order to highlight special sequence
+% relationships and to label positions and regions of interest a
+% second software with high quality output capability is needed.
+% Manipulating sequence alignments with standard word processing
+% or graphics programs takes its time---often several hours---and
+% simple layout changes such as
+% re-breaking lines, say from 50 to 40 residues per line,
+% elongate the working time considerably.
+%
+% \TeXshade{} is an alignment shading software
+% written in \TeX/\LaTeX{} which can process
+% multiple sequence alignments in the MSF, ALN
+% and FASTA file format.
+% It provides in addition to common shading algorithms special
+% shading modes featuring functional aspects, e.\,g.\ charge or
+% hydropathy, and a plenitude of commands for handling
+% shading colors, text styles, labels, legends and even allows
+% the user to define completely new shading modes. \TeXshade{}
+% combines highest flexibility and the habitual \TeX{} output
+% quality---with reasonable time expenditure.
+%
+% \end{abstract}
+%
+% \thispagestyle{empty}
+%
+% \tableofcontents
+% \newpage
+%
+% \section{Package Overview}
+%
+% \label{over}
+%
+% After |texshade.ins| is run through \TeX{} the following files
+% should appear in the directory:
+%
+% \begin{tabbing}
+% \quad|texshade.sty|\quad\= the style file with all \TeXshade{}
+% commands\\
+% \quad|texshade.def|\> an example parameter file with the
+% standard \\
+% \> parameter settings\\
+% \quad|AQPDNA.MSF| \> an example nucleotide alignment
+% (MSF-format)\\
+% \quad|AQPpro.MSF| \> an example protein alignment
+% (MSF-format)\\
+% \quad|AQP2spec.ALN|\> a further protein alignment
+% (minimal ALN-file)\\
+% \quad|AQP1.phd|\> secondary structure information
+% (PHD-format)\\
+% \quad|AQP1.top|\> topology data extracted
+% from |AQP1.phd|\\
+% \quad|AQP1_HMM.sgl|\> topology information (single line,
+% HMMTOP-format)\\
+% \quad|AQP1_HMM.ext|\> topology information (extended,
+% HMMTOP-format)\\
+% \quad|standard.cod|\> standard genetic code definitions\\
+% \quad|ciliate.cod|\> ciliate macronuclear genetic code\\
+% \end{tabbing}
+% The alignment file examples as well as the topology data file are
+% needed for \TeX{}ing this documentation
+% and can serve as illustrations for the MSF and ALN
+% file format.
+%
+% The following subsections give an overview on the capabilities of
+% the \TeXshade{} package. All commands are described in detail
+% later on.
+%
+%
+% \subsection{Version History}
+%
+% \textbf{v1.12 2005/09/20}
+% \medskip
+%
+% \emph{Corrections:} When regional labeling with |\shaderegion|,
+% |\emphregion|, |\tintregion|, or |\frameblock| was combined with
+% |\setends| incorrect output was produced lacking the
+% labeling.\footnote{Discovered by Chris Page.} Other minor fixes.
+%
+% \emph{Introductions:} An additional optional parameter for setting
+% consensus colors was implemented in the |\showconsensus| command
+% (p.\pageref{Lshowconsensus}). This even allows one to use color
+% scales illustrating sequence conservation in the consensus line.
+% \bigskip
+%
+% \textbf{v1.11 2005/04/13}
+% \medskip
+%
+% \emph{Corrections:} Bounding boxes with |\framebox| had a wrong
+% height when |\separationline|s were used. Other minor fixes.
+%
+% \emph{Introductions:} (a) An additional parameter for setting
+% individual bar and arrow thicknesses in feature lines has been
+% introduced. (b) Additional parameters for setting the frame color
+% and thickness of boxes in feature lines have been implemented. (c)
+% Three more color scales have been defined: |RedBlue|, |RedGreen|,
+% and |HotCold|. (d) Plotting of amino acid features (|hydrophobicity|,
+% |molweight|, |charge|) as bar graphs or color scales. (e) Plotting
+% of protein sequence |conservation| as bar graph or color
+% scale\footnote{Ahmad Mirza asked for (e) and (f), great suggestion!}.
+% (f) Color scales can be used for shading the consensus sequence
+% according to protein sequence conservation.
+% (g) Separate command for stretching color scales |\colorscalestretch|.
+% \bigskip
+%
+% \textbf{v1.10 2005/03/29}
+% \medskip
+%
+% \emph{Corrections:} Plotting of color scales and bar graphs has
+% been sped up by more than a factor of 10.\footnote{This and (d)
+% I owe again to Christoph Gille.}
+%
+% \emph{Introductions:} (a) More colors have been introduced, i.e.
+% even lighter versions of the existing PostScript colors
+% `LightLight' plus color name and `LightLightLight' plus color
+% name. (b) Sequence stretches and blocks can be tinted for
+% labeling purposes |\tintreqion|, |\tintblock| and |\tintdefault|.
+% (c) A new feature label style |{restriction}| has been introduced.
+% (d) Java-typical `NaN' values are now allowed in data files for
+% bar graphs and color scales.
+% \bigskip
+%
+% \textbf{v1.9 2005/02/08}
+% \medskip
+%
+% \emph{Corrections:} \TeXshade{} version 1.8 introduced an
+% incompatibility with \TeXtopo{}. This problem was identified
+% by Meike Schmedt and has been fixed.
+%
+% \emph{Introductions:} (a) A short version of the figure caption
+% can now be defined for display in the list of figures\footnote{%
+% Meike, here you go \dots} |\shortcaption{|\meta{text}|}|. (b) A
+% colored frame can be drawn around a sequence block for labeling
+% purposes with the command |\frameblock|.\footnote{Alan Robinson,
+% this is for you.} (c) A new look for feature arrows has been
+% implemented with scalable line thickness and a new end style
+% `ball'. (d) HMMTOP topology predictions can
+% now be included for plotting feature lines with information on
+% the location of the transmembrane domains.\footnote{Implemented
+% after a request by Steffen Moeller.}
+% \bigskip
+%
+% \textbf{v1.8 2004/08/26}
+% \medskip
+%
+% \emph{Corrections:} Only minor bugs were fixed.
+%
+% \emph{Introductions:} (a) More colors have been designed, i.e.
+% `light' versions of the existing PostScript colors. (b)
+% Three color ramps in 5\% steps have been introduced:
+% i) Blue-Red, ii) Green-Red and iii) Cold-Hot.
+% (c) Two new feature label styles |bar| and |color| have been
+% introduced which allow one to display number
+% values as bar graphs or color scales along the
+% alignment\footnote{Inspired by Christoph Gille's {\tt STRAP}}.
+% \bigskip
+%
+% \newpage
+%
+% \textbf{v1.7 2004/01/05}
+% \medskip
+%
+% \emph{Corrections:} Several bugs were fixed.
+% In gaps the wrong character was plotted in `donotshade'
+% mode. Gaps were colored incorrectly when a single
+% sequence was set as consensus. Another `donotshade' problem was
+% solved which led to a halt of the LaTeX
+% run\footnote{Thanks to Jeferson J.\ Arenzon and Naomi Siew}.
+% Due to several requests, the gap and match labels in |diverse|
+% mode were switched (`|-|' in gaps; `|.|' at matching
+% positions) in order to follow convention.
+%
+% \emph{Introduction:} \TeXshade{} speaks spanish (|\spanishlanguage|).
+% Necessary translations were contributed by Mikel Ega\~na Aranguren.
+% A new feature label style |helix| has been introduced.
+% \bigskip
+%
+% \textbf{v1.6 2002/03/26}
+% \medskip
+%
+% \emph{Corrections:} The unnecessary restriction to the DVIPS
+% driver for |color.sty| has been removed\footnote{As suggested by
+% Eckhart Guth\"ohrlein.}. Any color.sty compatible
+% driver option can be given with the |\usepackage{texshade}| call
+% and is then passed to the |color| package. The `|\namecolor|' and
+% `|\numbercolor|' commands do now support sequence
+% lists.\footnote{Thanks to Denys Bashtovyy.}
+%
+% \emph{Introductions:} (a) The FASTA file format is supported by
+% \TeXshade{} as alignment inputs. (b) Two commands set the space
+% between sequence blocks either to be flexible (as so far)
+% `|\flexblockspace|' or the be fixed `|\fixblockspace|'. (c) One
+% can now refer to sequences by their name in addition to the number
+% in the input file. (d) Using
+% `|\firstcolumnDSSP|' and `|\secondcolumnDSSP|' one can choose
+% which of the first to columns should refer to the sequence numbering
+% (the second column remains default setting)\footnote{c and d were
+% suggested by Christoph Gille.}.
+% \bigskip
+%
+% \textbf{v1.5a 2001/03/08}
+% \medskip
+%
+% \emph{Corrections:} `X's in the alignment file caused a run-time
+% error. Fixed.
+%
+% \emph{Introductions:} (a) The vertical space between feature
+% lines can be controlled by four new commands: |\ttopspace|,
+% |\topspace|, |\bottomspace| and
+% |\bbottomspace|\footnote{Suggested by Ulrike Folkers.}. (b) It is
+% now easily possible to add a caption to the alignment with
+% the |\showcaption| command. (c) \TeXshade{} stores the
+% sequence lengths in the |.aux| file in order to have correct
+% breaks of the gaps after the sequences.
+% \bigskip
+%
+% \newpage
+%
+% \textbf{v1.4\&4a 2000/9/12 \& 2000/10/3}
+% \medskip
+%
+% \emph{Introductions:} (a) The alignment legend can now be moved
+% by the command `|\movelegend|'. (b) In commands with parameters
+% that contain series of sequence numbers, e.\,g. |\orderseqs|, a
+% dash can be used, e.\,g. |{1-3,6-4,7}| instead of
+% |{1,2,3,6,5,4,7}|.
+% \bigskip
+%
+% \textbf{v1.3a\&b 2000/7/28 \& 2000/7/30}
+% \medskip
+%
+% \emph{Introductions:} (a) It is now possible to force \TeXshade{} to
+% display gap symbols before and after the actual sequence
+% by the commands `|\showleadinggaps|' and `|\hideleadinggaps|'
+% (\ref{Lshowleadinggaps}).
+% (b) The sequence names input routine is now more tolerant concerning
+% special characters.
+% \bigskip
+%
+% \textbf{v1.3 2000/3/3}
+% \medskip
+%
+% \emph{Corrections:} Line scrambling occured when features where
+% set in the |ttop| row without a feature in the |top| row. Fixed.
+% The incompatible command `|\language|' with the |babel| package has been
+% replaced by `|\germanlanguage|' and `|\englishlanguage|'\footnote%
+% {Thanks to Eckhart Guth\"ohrlein.}.
+%
+% \emph{Introductions:} (a) Now, translations of sequence stretches
+% are possible. Either nucleotide or amino acid sources can be
+% translated. This is done by the new |{translate}| option for the
+% feature command. (b) The codons are defined by the new command
+% `|\codon|'. Complete codon sets can be loaded by `|\geneticcode|'.
+% (c) Further, the size and style of the nucleotide triplets of
+% backtranslations can be set by `|\backtranslabel|' and
+% `|\backtranstext|'. (d) Two more feature counter styles were introduced:
+% `|\Romancount|' and `|\romancount|'. (e) \TeXshade{} is now
+% compatible with \TeXtopo, a new \TeX{} software
+% for drawing and shading topology plots of membrane proteins.
+% \bigskip
+%
+% \textbf{v1.2a 1999/6/24 (not released)}
+% \medskip
+%
+% \emph{Minor corrections:} `|\namecolor|' and `|\numbercolor|' are
+% now really correctly reordered. Brackets ( and ) are now allowed
+% in sequence names. The option |{case}| in `|\funcshadingstyle|'
+% works now.
+% \bigskip
+%
+% \textbf{v1.2 1999/6/12}
+% \medskip
+%
+% \emph{Corrections:} (a) Functional group definitions of more than
+% seven groups produced an error when displaying group number
+% eight. These residues where skipped in the alignment. Fixed.
+%
+% \emph{Introductions:} (a) Protein secondary structure files in the DSSP,
+% STRIDE and PHD format can be included and displayed auto\-matically
+% within the alignment by `|\includeDSSP|' (and similar commands for
+% STRIDE, PHDsec and PHDtopo, \ref{structure}).
+% (b) Which types of secondary structures are to be included or
+% skipped in the alignment is chosen by `|\showonDSSP|' and
+% `|\hideonDSSP|' (and respective commands for STRIDE, PHDsec and PHDtopo).
+% (c) The appearance of the labels is defined by `|\appearance|'.
+% (d) Internal counters for repeatedly occuring structure types
+% can be activated by `|\numcount|', `|\alphacount|' and
+% `|\Alphacount|'. All commands are described in \ref{structure}.
+% \bigskip
+%
+% \textbf{v1.1 1999/5/26}
+% \medskip
+%
+% \emph{Corrections:} (a) The activation of `|emphregion|' lead to
+% an em\-pha\-sized following alignment. This has been
+% corrected. (b) `|\namecolor|' and `|\numbercolor|' were not
+% reordered with the command `|orderseqs|'. Fixed. (c) Sequence
+% gaps at the beginning or the end of a sequence, i.\,e. before
+% the first and after the last residue where labeled with the
+% gap symbol. Now these positions are left blank.
+%
+% \emph{Introductions:} (a) In order to treat the preceeding and
+% sequence following gaps correctly, \TeXshade{} needs to know the
+% length of the sequences. Therefore, the command `|\seqlength|' was
+% introduced (\ref{seqlines}). (b) With `|\gapcolors|' (also
+% \ref{seqlines}) the
+% color selection for gap symbols is independent from non conserved
+% residues. (c) The divisions of the ruler where so far fixed to
+% 10. Now, this value is changeable by `|\rulersteps|' (again
+% \ref{seqlines}). (d) `|\hideresidues|' and `|\showresidues|' turn
+% off or on the residue names, i.\,e. one can choose between a
+% display of shaded boxes only or with letters in the boxes
+% (\ref{kill}). (e) The changes (c) through (d) were necessary
+% for the introduction of `|\fingerprint|'. This command allows one to
+% display the complete sequence in one line for an easy survey of
+% the alignment (\ref{fingerprint}).
+% \bigskip
+%
+% \textbf{v1.0 1999/5/12}
+% \medskip
+%
+% First release.
+% \bigskip
+%
+%
+% \subsection{\LaTeX{} basics}
+%
+% \subsubsection{Typesetting documents using \LaTeX}
+%
+% In order to use any of the macros provided by the
+% \BioTeX-project
+% (\TeXshade/\TeXtopo) efficiently a basic understanding of the \TeX{}
+% typesetting system and its usage is required. Several books are
+% available on this topic, but a rather quick and easy introduction
+% is the \emph{Not so short introduction to \LaTeX}. This document
+% is available from all Comprehensive \TeX{} Archive Network
+% (CTAN) servers,
+% e.\,g. from |ftp://ftp.dante.de/pub/tex/documentation/lshort/|,
+% in many different languages and formats besides \LaTeX{}, such
+% as \textsc{PostScript} and on-line viewable PDF.
+% I also put a link from the \BioTeX{} (\TeXshade/\TeXtopo) homepage
+% to the document collection
+% (|http://homepages.uni-tuebingen.de/beitz/biotex.html|).
+%
+%
+% \subsubsection{Memory shortness when using \TeX{}shade}
+%
+% If you are using \TeXshade{} to align several large sequences (about 1000
+% residues/sequence), LaTeX will probably stop compiling and quit with one
+% of the following messages:
+%
+% |!\ TeX capacity exceeded, sorry [main memory size=384000]|
+%
+% or
+%
+% |!\ TeX capacity exceeded, sorry [stack size=300]|.
+%
+% \TeX{} allocates space for different kinds of internal variables.
+% Setting alignments needs lots of memory,
+% usually more than for typesetting plain text.
+% Thus, the parameter settings of a standard \TeX{} installation might not
+% be sufficient for certain projects. This manifests
+% in \TeX{} error messages about insufficient memory
+% and the setting process is interrupted. There is no reason to be
+% concerned. The parameters can be set by hand. Unfortunately,
+% each \TeX{} system hides its default parameter file in a different
+% place in the system.
+%
+% In the following, an excerpt from the FAQ-list to \TeXshade{} is added.
+% This explains how
+% to increase the settings in Oz\TeX{} for the Macintosh, Mik\TeX{}
+% for Windows and te\TeX{} for *NIX \TeX{} distributions. Please contribute
+% to this list!
+%
+% \begin{enumerate}
+%
+% \item
+%
+% \textbf{Oz\TeX{} 4.0 for the Macintosh:}
+%
+% Find the file `OzTeX:TeX:Configs:Default'. This file contains
+% all memory settings. Look for the section
+% `\% TeX parameters' and increase the values that \TeX{} complains
+% about during the run. You will have to restart Oz\TeX{} before the
+% changes are active.
+%
+% For older versions of Oz\TeX{} the configuration file has the
+% same name but the path is somewhat different.
+%
+%
+% \item
+%
+% \textbf{te\TeX{} for *NIX:} (contributed by Joerg Daehn)
+%
+% Find the file: `/usr/share/texmf/web2c/texmf.cnf' or use
+%
+% |locate texmf.cnf| at the command prompt to find it.
+%
+% Login as super user. Backup `texmf.cnf' in case you destroy something and
+% then open the `texmf.cnf' file in your favorite text editor and use its
+% search function to locate |main_memory|. This variable is set to 384000.
+% Change this to some higher value, i.e. 4000000 (works fine for me!). The
+% total amount of memory should not exceed 8000000, so check the other
+% values in that section.
+%
+% Next, you want to change the stack size. Search for |stack_size|. This
+% will be set to 300. I changed it to 4000 and it works fine.
+%
+% There might be complains by \TeX{} about further specific parameters such
+% as |stack_size|. You find all those in the same file.
+%
+% After this you have to run `texconfig init'.
+%
+% Logout as root.
+%
+% After this all should be set for large alignments. Happy \TeX{}ing!
+%
+% The information on how to achieve this was derived from a mail in the
+% te\TeX{} mail archive. The original question was posted by Pascal Francq and
+% answered by Rolf Nieprasch.
+%
+%
+% \item
+%
+% \textbf{MiK\TeX{} for Windows:}
+%
+% The MiK\TeX{} documentation describes very detailed how the memory
+% settings can be changed. In brief, you must locate the
+% configuration file `miktex/config/miktex.ini'. In the [MiKTeX]
+% section of this file you find all the parameters you need, e.\,g.\
+% |mem_min|, |mem_max|, |buf_size|, |stack_size| etc.
+%
+% It appears, that the standard settings of MiK\TeX{} are bigger
+% than that of other \TeX{} installations, so it may not always be necessary
+% to increase the values.
+%
+%
+% \end{enumerate}
+%
+%
+%
+% \subsection{System requirements}
+%
+% \TeXshade{} requires \LaTeXe{} and |color.sty| for shading.
+% David Carlisle's |color.sty| is part of the Standard \LaTeX{}
+% `Graphics Bundle' [1]. This package can be downloaded from any
+% \TeX{} archive, e.g.\ |ftp.dante.de|; usually it is already
+% included in a comprehensive \TeX{} installation.
+%
+% The |color| style allows one to use several |[|\meta{options}|]|, e.\,g.
+% |dvips|, |pdftex| or |dviwin|. These provide the commands which
+% different devices/programs need to display colored output. It is
+% advisable to make yourself familiar with the |color.sty| manual.
+% You should define a default driver in the file |color.cfg|.
+% Since there is no direct call of |color.sty| by the user, the
+% option can be stated when \TeXshade{} is loaded, see next
+% subsection. If no option is stated the |DVIPS| driver will be
+% loaded as was default before.
+%
+% With the |[dvips]| option for example the output DVI-file
+% can be converted to \textsc{PostScript} using the |DVIPS| program
+% and can later be viewed or printed with the public domain
+% |Ghostview| program which is
+% available for almost all computer platforms. Further, more and more
+% standard \TeX{} viewers are to a certain extent \textsc{PostScript} compatible,
+% e.\,g.\ Oz\TeX{} on the Macintosh. The option |pdftex| makes the
+% conversion to a PDF file easy etc.
+% \bigskip
+%
+% \subsection{The \texttt{texshade} environment}
+%
+% \label{tsenvironment}
+%
+% The commands provided by the \TeXshade{} package are enabled by
+% the following command in the document header section:
+% \medskip
+%
+% \quad |\usepackage[|\meta{option}|]{texshade}|
+%
+% \medskip
+% Make sure that the file `|texshade.sty|' is present in a directory
+% searched by \TeX{} (see the installation notes in the file
+% `|texshade.txt|').
+%
+% The \meta{option} given here is passed to |color.sty| which
+% handles the color commands for a particular output device, see
+% previous subsection and the |color.sty| manual.
+%
+% The \TeXshade{} package provides only one single new environment:
+% |texshade|. This environment has one mandatory and
+% one optional argument, both of them designating file names which
+% must be present in a directory searched by \TeX. The
+% required file \meta{alignmentfile} contains the aligned nucleotide
+% or peptide sequences
+% (see section~\ref{alignfilestruc}). This file is needed, because
+% \TeXshade{} does no alignment by
+% itself, it has to take a preprocessed alignment as input.
+% The optional file is a parameter file (section~\ref{paramfilestruc})
+% with definitions for the
+% customized calculation of the consensus, special sequence features
+% or labels etc. In this parameter file all \TeXshade{} commands
+% which are allowed in the |texshade| environment can be used and are
+% fully functional.
+% Within the environment further \TeXshade{} commands can be given
+% to replace or complete settings from the parameter file.
+%
+% Thus, setting an alignment with \TeXshade{} is as simple as
+% this:
+%
+% \begin{quote}
+% |\begin{texshade}[|\meta{parameterfile}|]|
+% |{|\meta{alignmentfile}|}|
+%
+% \quad\emph{further \emph{\TeXshade} commands, if needed}
+%
+% |\end{texshade}|
+% \end{quote}
+%
+% \subsection{Shading modes predefined in this package}
+%
+% \subsubsection{Identity mode}
+%
+% \label{ident}
+%
+% This basic type of shading is provided by almost any alignment
+% program. All identical residues at a position are shaded if the
+% number of matching residues is higher than a given threshold
+% percentage.
+%
+% \begin{texshade}{AQPpro.MSF}
+% \setends{1}{80..112}
+% \hideconsensus
+% \end{texshade}
+%
+% If you like, positions where all residues are identical can be
+% shaded in a special color and the consensus can be shown with
+% or without shading according to the degree of conservation:\label{shadecons}
+%
+% \begin{texshade}{AQPpro.MSF}
+% \allmatchspecial
+% \setends{1}{80..112}
+% \showconsensus[ColdHot]{bottom}
+% \defconsensus{.}{lower}{upper}
+% \end{texshade}
+%
+% \subsubsection{Similarity mode}
+%
+% \label{similar}
+%
+% In many cases it is expedient---mostly when comparing protein
+% sequences---to shade also residues
+% which are not identical but similar to the consensus sequence.
+% Consider a position where three out of five residues are basic
+% arginines and two more residues are also basic but lysines.
+% In similarity mode \TeXshade{} shades similar residues in a different
+% color to distinguish them from the consensus residue. Even when
+% none of the residues alone reaches the
+% threshold but a group of similar residues does these are shaded
+% in the `similarity' color. This case is given for instance
+% when at a position in a five sequence alignment two aliphatic
+% valines and two also aliphatic isoleucins are present and the
+% threshold is set to 50\%. Neither residue exceeds this percentage
+% but as a group of similars they do.
+%
+% In grayscale printouts some colors of the following alignment may appear
+% undistinguishable. Don't worry if you usually use grayscale---all
+% colors/grays can be selected freely (see \ref{colors}).
+% \medskip
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[allmatchspecial]{similar}
+% \setends{1}{80..112}
+% \hideconsensus
+% \feature{top}{1}{93..93}{fill:$\downarrow$}{first case (see text)}
+% \feature{bottom}{1}{98..98}{fill:$\uparrow$}{second case (see text)}
+% \end{texshade}
+%
+% Probably you know
+% this kind of shading from the VMS/Unix and DOS public domain program
+% |BoxShade|
+% by \textsc{Kay Hofmann} or from the Macintosh version
+% |MacBoxShade| by \textsc{Michael D. Barron}. \TeXshade{}
+% provides the same functionality---and goes truly beyond---for the
+% \TeX{} community.
+%
+%
+% \subsubsection{Diversity mode}
+%
+% \label{diverse}
+%
+% Contrary to the above described modes this shading style displays
+% sequence differences. Thus, it is most suitable for comparing very
+% similar sequences, e.\,g.\ species variants of a protein.
+%
+% One sequence is used as consensus.
+% Matching residues in other sequences are blanked out,
+% mismatches are shown in lowercase.
+% \medskip
+%
+% \begin{texshade}{AQP2spec.ALN}
+% \seqtype{P}
+% \shadingmode{diverse}
+% \setends{1}{77..109}
+% \featureslarge
+% \feature{top}{1}{77..109}{}{AQP2 species variants}
+% \namesrm\namesit
+% \hidenumbering\showruler{top}{1}
+% \shownames{left}
+% \nameseq{1}{Bos taurus}
+% \nameseq{2}{Canis familiaris}
+% \nameseq{3}{Dugong dugong}
+% \nameseq{4}{Equus caballus}
+% \nameseq{5}{Elephas maximus}
+% \frameblock{1}{82..82,106..106}{Red[1pt]}
+% \end{texshade}\label{frame}
+%
+%
+% \subsubsection{Functionality modes}
+%
+% \label{func}
+%
+% Displaying functional peptide similarities is one of \TeXshade's
+% strong capabilities. Six functional shading modes are predefined;
+% further user specific modes can easily be created. The examples
+% may not look very impressive when printed in grayscale. Enjoy
+% them on your screen or use color printouts. As mentioned before,
+% all colors can be changed to others or to grays without restrictions
+% (see chapter \ref{colors}).
+%
+% \begin{itemize}
+% \item [\textbf{charge}:] residues which are charged at physiological pH
+% (7.4) are shaded if their number at a position
+% is higher than the threshold \label{charge}
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[charge]{functional}
+% \setends{1}{138..170}
+% \feature{top}{3}{153..165}{bar[-50,50]:-50,-45,-40,-30,-20,-10,0,10,20,30,%
+% 40,45,50}{}
+% \feature{top}{3}{167..186}{color:5,10,15,20,25,30,35,40,45,50,55,%
+% 60,65,70,75,80,85,90,95,100[ColdHot]}{}
+% \showlegend
+% \end{texshade}
+%
+% \item [\textbf{hydropathy}:] discrimination between acidic and
+% basic, polar uncharged and hydrophobic nonpolar residues
+% \label{hydro}
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[hydropathy]{functional}
+% \feature{top}{1}{158..163}{brace}{tinted}
+% \tintblock{1}{158..163}
+% \setends{1}{138..170}
+% \showlegend
+% \end{texshade}
+%
+%
+% \item [\textbf{structure}:] displays the potential
+% localization within the tertiary structure of
+% the protein \label{struc}
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[structure]{functional}
+% \setends{1}{138..170}
+% \feature{top}{1}{138..157}{box[Blue,Red][0.5pt]: %
+% $\alpha$-helix[Yellow]}{transmembrane domain 4}
+% \feature{top}{1}{158..163}{translate[Blue]}{}
+% \backtranslabel{oblique}
+% \feature{bottom}{1}{158..163}{brace[Blue]}{loop D [Blue]}
+% \feature{top}{1}{164..170}{o->[Red]}{trans. dom. 5}
+% \showlegend
+% \end{texshade}
+%
+%
+% \item [\textbf{chemical}:] residues are shaded due to chemical
+% properties of
+% their functional groups \label{chem}
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[chemical]{functional}
+% \setends{1}{138..170}
+% \showlegend
+% \end{texshade}
+%
+% With |\shadeallresidues| \label{Lshadeallresidues} the
+% threshold is ignored and
+% all residues are shaded due to their group assignment.
+% This is \emph{not} identical to a threshold of 0\%
+% where only the majority group would be shaded. See the
+% difference:
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[chemical]{functional}
+% \setends{1}{138..170}
+% \shadeallresidues
+% \end{texshade}
+%
+%
+% \item [\textbf{standard area}:] this shading displays the
+% differences in the surface
+% area \label{starea}
+% of the different amino acid's sidechains
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[standard area]{functional}
+% \setends{1}{138..170}
+% \showlegend
+% \shadeallresidues
+% \end{texshade}
+%
+% \item [\textbf{accessible area}:] \label{accarea}
+% here, the surface area which can
+% be accessed by solvent molecules is used as a
+% basis for shading; low accessibility means
+% hydrophobic (i.\,e.\ strongly buried
+% residues), whereas highly accessible
+% sidechains are hydrophilic (compare to
+% \textbf{hydropathy} and \textbf{structure})
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[accessible area]{functional}
+% \setends{1}{138..170}
+% \showlegend
+% \feature{top}{1}{138..157,164..170}{helix}{membr.}
+% \feature{top}{1}{158..163}{---}{loop}
+% \featurerule{1mm}
+% \shadeallresidues
+% \end{texshade}
+% \end{itemize}
+%
+%
+%
+% \subsection{Bar graphs and color scales}
+%
+% \label{graphs}
+%
+% Amino acid properties, such as hydrophobicity, molecular weight,
+% or charge can be shown as bar graphs or color scales along the
+% alignment. Further, the degree of protein sequence conservation
+% can be indicated. As an example, in the following
+% aquaporin alignment plots of residue conservation (bars, top),
+% are shown as well as properties of the AQP1 sequence: charge (scale, top),
+% molecular weight are shown (scale, bottom), and hydrophobicity (bars, bottom).
+%
+%
+% \begin{texshade}{AQPpro.MSF}
+% \setends{1}{138..170}
+% \feature{ttop}{1}{138..170}{bar:conservation}{}
+% \ttopspace{-\baselineskip}
+% \feature{top}{1}{138..170}{color:charge}{}
+% \feature{bottom}{1}{138..170}{color:molweight[ColdHot]}{}
+% \bbottomspace{-\baselineskip}
+% \feature{bbottom}{1}{138..170}{bar:hydrophobicity[Red,Gray10]}{}
+% \hideconsensus
+% \end{texshade}
+%
+%
+%
+% \subsection{Secondary structures}
+%
+% \label{sec}
+%
+% Predicted protein secondary structures in the DSSP, STRIDE
+% PHD or HMMTOP file format can be included and displayed in the
+% alignment. As an example, the following few commands show an
+% aquaporin alignment with the PHD topology data for aquaporin
+% type 1 (top sequence).
+%
+% \vbox{%
+% \begin{verbatim}
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[allmatchspecial]{similar}
+% \includePHDtopo{1}{AQP1.phd}
+% \end{texshade}
+% \end{verbatim}
+% }
+%
+% Abbr.: \emph{int.} -- internal; \emph{ext.} -- external; \emph{TM} --
+% transmembrane domain
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[allmatchspecial]{similar}
+% \includePHDtopo{1}{AQP1.phd}
+% \end{texshade}
+%
+% \subsection{Sequence fingerprints}
+%
+% \label{finger}
+%
+% To gain a quick overview of sequence similarities or properties
+% the |\fingerprint| command has been implemented. It can depict the
+% complete sequence in one single line. The residues are presented
+% as colored vertical lines. The implementation of this kind of output
+% was inspired by the publication of \textsc{Kai-Uwe Fr\"ohlich} [6].
+% \medskip
+%
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[allmatchspecial]{similar}
+% \shadingcolors{grays}
+% \fingerprint{360}
+% \showlegend
+% \feature{top}{1}{13..36,51..68,94..112,138..156,165..185,211..232}{,-,}{TM}
+% \end{texshade}
+%
+% The higher the similarity the darker the vertical lines. In this
+% overview it becomes obvious that the transmembrane regions of the
+% aquaporin isoforms are most conserved.
+%
+%
+% \medskip
+% \begin{texshade}{AQPpro.MSF}
+% \shadingmode[charge]{functional}
+% \shadeallresidues
+% \fingerprint{360}
+% \gapchar{rule}
+% \showlegend
+% \end{texshade}
+%
+% A fingerprint of charge distribution on different aquaporins.
+% Sequence gaps can be left blank (first example) or drawn as lines
+% between the sequence blocks (shown here).
+%
+%
+%
+% \subsection{Customization of alignment outputs}
+%
+% Extensive possibilities are given to the user to customize
+% the final output of an alignment. Thus, all parameters defining the
+% appearance of letters can be changed individually for sequence
+% residues, names and numbering or the describing feature texts.
+% Additional manual shading can be applied to any region or
+% block of residues. Sequences are easily re-ordered, separated, hidden
+% or blanked out without recalculation of the entire alignment;
+% sections of the alignment can also be shown.
+% Numbering and rulers can be displayed and set to any value.
+% A powerful tool is the |\feature|
+% command which allows one to label stretches of residues with bars,
+% arrows, braces or any fill character and describing text.
+% Legends are set automatically if desired, but user commands
+% are also provided to build individual legends.
+%
+%
+% \newpage
+% \section{Format of alignment input files}
+%
+% \label{alignfilestruc}
+%
+% \TeXshade{} can handle two common alignment input formats, i.\,e.\
+% the MSF format (\underline{m}ultiple \underline{s}equence
+% \underline{f}ormat) and the ALN format
+% (\underline{al}ig\underline{n}ment format). The MSF
+% format is used by |PILEUP| of the Unix GCG sequence
+% analysis package\footnote{For a description see
+% |http://gene.md.huji.ac.il/Computer/GCG9doc|}. Files in the
+% ALN format are produced by |CLUSTAL| which is
+% available for free for Unix, DOS and Macintosh. Further, upon
+% request, the FASTA format is supported since version 1.6.
+% In addition to the mentioned software many alignment programs have
+% export filters for the MSF, ALN or FASTA
+% format, e.\,g.\ |MACAW| produces ALN files. If
+% you are not sure whether your favorite sequence aligner
+% produces one of the required formats compare its output to
+% the following examples. \TeXshade{} determines the format from
+% the internal file structure, thus extensions like MSF, ALN
+% or FASTA
+% are not required. If you can choose the alignment format
+% MSF is recommended, because this format gives information
+% about the sequence type, i.\,e.\ peptide or nucleotide sequences,
+% and length (for the correct setting of gaps at the sequence end).
+%
+% \subsection{The MSF file format}
+% Files of this type are divided into a header section and the
+% multiple sequence alignment. The header may contain the
+% following components:
+%
+%
+% \begin{itemize}
+% \item[\textbf{File Type}:] (optional) The first header line
+% reads for nucleic acids alignments
+% |!!NA_MULTIPLE_ALIGNMENT 1.0| and for amino acid sequences
+% |!!AA_MULTIPLE_ALIGNMENT 1.0| (all uppercase).
+% \item[\textbf{Description}:] (optional) Informative text
+% describing what is in the file.
+% \item[\textbf{Dividing line}:] (required!) Must include the
+% following attributes:
+% \begin{itemize}
+% \item[|MSF|:] Displays the number of bases or residues in
+% the multiple sequence alignment.
+% \item[|Type|:] Displays the sequence type, `P' for a peptide
+% and `N' for a nucleotide alignment.
+% \item[|Checksum|:] Displays an integer value that
+% characterizes the contents of the file.
+% \item[|..|] The two periods act as a divider between the
+% descriptive information and the following
+% sequence information.
+% \end{itemize}
+% \item[\textbf{Name/Weight}:] (required!) Must include the name of
+% each sequence included in the alignment, as well as its
+% length, checksum and weight.
+% \item[\textbf{Two slashes} (|//|):] (required!) This separating
+% line divides the name/weight information from the
+% sequence alignment
+% \end{itemize}
+%
+% The alignment section consists of sequence blocks divided by an
+% empty line. Each sequence line starts out with the sequence name.
+% An example file is shown here:
+% \medskip
+%
+% \parindent-1mm
+% \begin{fmpage}
+% \begin{verbatim}
+%
+% AQP.MSF MSF: 87 Type: P May 1st, 1998 Check: 2586 ..
+% Name: AQP1.PRO Len: 66 Check: 1367 Weight: 1.00
+% Name: AQP2.PRO Len: 58 Check: 2176 Weight: 1.00
+% Name: AQP3.PRO Len: 83 Check: 1893 Weight: 1.00
+% Name: AQP4.PRO Len: 63 Check: 3737 Weight: 1.00
+% Name: AQP5.PRO Len: 59 Check: 3413 Weight: 1.00
+% //
+% 1 45
+% AQP1.PRO MAS........................EIKKKLFWRAVVAEFLAM
+% AQP2.PRO MW.........................ELRSIAFSRAVLAEFLAT
+% AQP3.PRO M.........NRCG.....EMLHIRYR......LLRQALAECLGT
+% AQP4.PRO MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAM
+% AQP5.PRO MK........................KEVCSLAFFKAVFAEFLAT
+%
+% 45 87
+% AQP1.PRO TLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATL
+% AQP2.PRO LLFVFFGLGSALQWA...SS....PPSVLQIAVAFGLGIGIL
+% AQP3.PRO LILVMFGCGSVAQVVLSRGTHGGF....LTINLAFGFAVTLA
+% AQP4.PRO LIFVLLSVGSTINWG...GSENPLPVDMVLISLCFGLSIATM
+% AQP5.PRO LIFVFFGLGSALKWP...SA....LPTILQISIAFGLAIGTL
+% \end{verbatim}
+% \end{fmpage}
+% \bigskip
+%
+% \parindent0mm
+% \TeXshade{} extracts only the information from the file it
+% really needs. So, do not mind all the checksums listed
+% in the file---\TeXshade{} does not either. The same is true
+% for |Weight|. Required are the string |MSF:|
+% for the identification of the file format and |Type:| for the
+% determination of the sequence type (both in the dividing line),
+% further all |Name:| definitions and finally |//|. The MSF format
+% allows one to comment out sequences. This is done
+% by putting an exclamation point directly infront of the respective
+% |Name|. These sequences are neither displayed nor used for the
+% calculation of the consensus. This works for \TeXshade, too.
+% To comment out sequences without changing
+% the input file use the \TeXshade{} command
+% |\killseq{|\meta{seqref}|}| (\ref{kill}).
+% \medskip
+%
+% \parindent-1mm
+% \begin{fmpage}\label{commout}
+% \begin{verbatim}
+%
+% AQP.MSF MSF: 87 Type: P May 1st, 1998 Check: 2586 ..
+% Name: AQP1.PRO Len: 66 Check: 1367 Weight: 1.00
+% !Name: AQP2.PRO Len: 58 Check: 2176 Weight: 1.00
+% !Name: AQP3.PRO Len: 83 Check: 1893 Weight: 1.00
+% Name: AQP4.PRO Len: 63 Check: 3737 Weight: 1.00
+% Name: AQP5.PRO Len: 59 Check: 3413 Weight: 1.00
+% //
+% 1 45
+% AQP1.PRO MAS........................EIKKKLFWRAVVAEFLAM
+% AQP2.PRO MW.........................ELRSIAFSRAVLAEFLAT
+% AQP3.PRO M.........NRCG.....EMLHIRYR......LLRQALAECLGT
+% AQP4.PRO MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAM
+% AQP5.PRO MK........................KEVCSLAFFKAVFAEFLAT
+%
+% 45 87
+% AQP1.PRO TLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATL
+% AQP2.PRO LLFVFFGLGSALQWA...SS....PPSVLQIAVAFGLGIGIL
+% AQP3.PRO LILVMFGCGSVAQVVLSRGTHGGF....LTINLAFGFAVTLA
+% AQP4.PRO LIFVLLSVGSTINWG...GSENPLPVDMVLISLCFGLSIATM
+% AQP5.PRO LIFVFFGLGSALKWP...SA....LPTILQISIAFGLAIGTL
+% \end{verbatim}
+% \end{fmpage}
+% \parindent0mm
+% \bigskip
+%
+% The sequence lengths given after |Len:| are not used by
+% \TeXshade. Due to the fact that most alignment programms calculate the
+% sequence length by summing up residues and additionally gaps which
+% is not really correct. In order to have the sequence break right
+% after the last residue without printing further gap symbols
+% \TeXshade{} counts the number of residues by itself. You can
+% also use the command |\seqlength| in the \TeXshade{}
+% environment to set the values manually if you do not trust a machine.
+%
+% \subsection{The ALN file format}
+% ALN files are quite similar to the above described MSF files.
+% They simply lack a defined header section. Nevertheless,
+% describing text is allowed before the alignment part. \TeXshade{}
+% determines the number of sequences and their names from the last
+% sequence block---so, no further text lines are allowed after this block!
+% Due to a lacking declaration in the file the sequence type has
+% to be set in the |texshade| environment by |\seqtype{|\meta{type}|}|
+% \label{Lseqtype} with `P' for peptide and `N' for nucleotide sequences;
+% for the example below: |\seqtype{P}|. If no |\seqtype| command
+% is used \TeXshade{} assumes a nucleotide sequence.
+% \bigskip
+%
+% \parindent-1mm
+% \begin{fmpage}
+% \begin{verbatim}
+%
+% profalign May 1st, 1998, 16:58
+%
+% of AQPpro.MSF{}
+%
+% Muliple alignment parameter:
+%
+% Gap Penalty (fixed): 10.00
+% Gap Penalty (varying): .05
+% Gap separation penalty range: 8
+% Percent. identity for delay: 0%
+% List of hydrophilic residue: GPSNDQEKRH
+% Protein Weight Matrix: blosom
+%
+% 10 20 30 40
+% . . . .
+% AQP1.PRO MAS........................EIKKKLFWRAVVAEFLAM
+% AQP2.PRO MW.........................ELRSIAFSRAVLAEFLAT
+% AQP3.PRO M.........NRCG.....EMLHIRYR......LLRQALAECLGT
+% AQP4.PRO MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAM
+% AQP5.PRO MK........................KEVCSLAFFKAVFAEFLAT
+% * . ** *.
+%
+% AQP1.PRO TLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATL
+% AQP2.PRO LLFVFFGLGSALQWA...SS....PPSVLQIAVAFGLGIGIL
+% AQP3.PRO LILVMFGCGSVAQVVLSRGTHGGF....LTINLAFGFAVTLA
+% AQP4.PRO LIFVLLSVGSTINWG...GSENPLPVDMVLISLCFGLSIATM
+% AQP5.PRO LIFVFFGLGSALKWP...SA....LPTILQISIAFGLAIGTL
+% .. * .** . ** .
+% \end{verbatim}
+% \end{fmpage}
+% \bigskip
+%
+% The minimal contents of an ALN file are shown below; this
+% is fully sufficient. Many sequence alignment programs can
+% produce such an output. Have a look at |seqpup| by
+% \textsc{Don Gilbert} if you need a comprehensive conversion
+% program\footnote{Sorry, |seqpup| is much more!}.
+% \bigskip
+%
+% \parindent-1mm
+% \begin{fmpage}
+% \begin{verbatim}
+%
+% AQP1.PRO MAS........................EIKKKLFWRAVVAEFLAM
+% AQP2.PRO MW.........................ELRSIAFSRAVLAEFLAT
+% AQP3.PRO M.........NRCG.....EMLHIRYR......LLRQALAECLGT
+% AQP4.PRO MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAM
+% AQP5.PRO MK........................KEVCSLAFFKAVFAEFLAT
+%
+% AQP1.PRO TLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATL
+% AQP2.PRO LLFVFFGLGSALQWA...SS....PPSVLQIAVAFGLGIGIL
+% AQP3.PRO LILVMFGCGSVAQVVLSRGTHGGF....LTINLAFGFAVTLA
+% AQP4.PRO LIFVLLSVGSTINWG...GSENPLPVDMVLISLCFGLSIATM
+% AQP5.PRO LIFVFFGLGSALKWP...SA....LPTILQISIAFGLAIGTL
+% \end{verbatim}
+% \end{fmpage}
+% \bigskip
+%
+% \subsection{The FASTA file format}
+% In FASTA files each sequence is led
+% by a single description line starting with a `|>|'. \TeXshade{} uses
+% the first word delimited by the leading `|>|' and a space as
+% the sequence name. If no descriptive text is present \TeXshade{}
+% generates a sequence name consisting of `|seq|' plus a consecutive
+% number. The lines following the description line
+% contain the sequence.
+% \bigskip
+%
+% \begin{fmpage}
+% \begin{verbatim}
+%
+% >AQP1.PRO
+% MAS........................EIKKKLFWRAVVAEFLAM
+% TLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATL
+%
+% >AQP2.PRO
+% MW.........................ELRSIAFSRAVLAEFLAT
+% LLFVFFGLGSALQWA...SS....PPSVLQIAVAFGLGIGIL
+%
+% >AQP3.PRO
+% M.........NRCG.....EMLHIRYR......LLRQALAECLGT
+% LILVMFGCGSVAQVVLSRGTHGGF....LTINLAFGFAVTLA
+%
+% >AQP4.PRO
+% MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAM
+% LIFVLLSVGSTINWG...GSENPLPVDMVLISLCFGLSIATM
+%
+% >AQP5.PRO
+% MK........................KEVCSLAFFKAVFAEFLAT
+% LIFVFFGLGSALKWP...SA....LPTILQISIAFGLAIGTL
+% \end{verbatim}
+% \end{fmpage}
+% \bigskip
+%
+%
+% \parindent0mm
+% \newpage
+% \section{Use of a \TeX{}shade parameter file}
+%
+% \label{paramfilestruc}
+%
+% Using predefined parameter files for repeatedly occuring situations
+% can save a lot of typing and makes the output throughout the
+% publication or presentation more consistent. Further, such
+% files are an easy way to exchange self-defined shading
+% modes or new color schemes (i.\,e.\ for a satisfying grayscale output)
+% with other users. If you have created a
+% parameter file, which you think is of interest for others, please
+% submit it to me\footnote{|eric.beitz@uni-tuebingen.de|} as an e-mail
+% attachment together with a short
+% description. I will take care of those files and post them---with
+% a reference to the author---together with the next \TeXshade{}
+% distribution to make them available for all interested users.
+%
+% No special file format is required for parameter
+% files. \TeXshade{} simply calls the file using the |\input|
+% command right after resetting all parameters to default. An
+% example parameter file is present containing the standard
+% parameters of \TeXshade{} called |texshade.def|. This file can be
+% changed freely and can be used as a template for the creation of
+% personal parameter files.
+%
+% Five steps are executed by \TeXshade{} when
+% processing the |texshade| environment:
+%
+% \bigskip
+% \begin{minipage}{12cm}
+% |\begin{texshade}[|\meta{parameterfile}|]{|\meta{alignmentfile}|}|
+%
+% \begin{enumerate}
+% \item Analysis of the \meta{alignmentfile}; determination of
+% the number of sequences and sequence names
+%
+% \item Setting parameters to default
+%
+% \item Setting parameters to the definitions of the
+% \meta{parameterfile}, if existent
+%
+% \item Execution of further \TeXshade{} commands within the
+% evironment, if existent
+%
+% \parindent-1cm
+% \medskip
+% |\end{texshade}|
+%
+% \parindent0cm
+% \item Loading and setting the alignment on a line by line basis
+% \end{enumerate}
+% \end{minipage}
+%
+% \newpage
+% \section{\texttt{texshade} user commands}
+%
+% The \TeXshade{} package must be loaded by the |\usepackage|
+% command in the document header section.
+% \medskip
+%
+% \quad|\usepackage[|\meta{option}|]{texshade}|
+% \medskip
+%
+% Then, the |texshade| environment is ready to use as described
+% in \ref{tsenvironment}. See also section \ref{paramfilestruc} for
+% a description of the optional parameter file. All other
+% commands provided by \TeXshade{} (except |\molweight|,
+% |\charge| [\ref{molcharge}] and |\shadebox| [\ref{Lshadebox}]) must
+% be used within the |texshade| environment.
+%
+%
+%
+% \subsection{Using predefined shading modes}
+%
+% \label{predef}
+%
+% \label{Lshadingmode}
+% If no |\shadingmode| command is given in the |texshade|
+% environment the default shading mode (\emph{identical}, see
+% \ref{ident}) is active. For the selection of one of the other
+% predefined shading modes the following command is provided.
+% \bigskip
+%
+% \quad |\shadingmode[|\meta{option}|]{|\meta{mode}|}|
+% \bigskip
+%
+% You can choose from four shading modes and declare one option
+% which depends on the selected mode.
+%
+% \begin{enumerate}
+%
+% \item |\shadingmode[|\meta{allmatchspecial}|]{identical}|
+%
+% There is not much to explain here (see \ref{ident}). Use the
+% option |allmatchspecial| to shade positions with a special color
+% where all residues are identical.
+% \label{Lallmatchspecial}|\allmatchspecial| can also be
+% used as a command. As both, option or command
+% |allmatchspecial| is only active in the \emph{identical} and
+% \emph{similar} shading modes.
+%
+% \label{Lshadingcolors}
+% One can choose from five predefined shading color schemes with
+% the command
+% |\shadingcolors{|\meta{scheme}|}|. The sets are named `blues'
+% (used in the example, \ref{ident}), `reds', `greens',
+% `grays' and `black'. Default is |\shadingcolors{blues}|. Further, the colors
+% for the non matching, the
+% conserved and all matching residues can be set individually
+% plus the letter case (lower or upper) or any character
+% can be chosen: \label{Lnomatchresidues}
+% \label{Lconservedresidues}
+% \label{Lallmatchresidues}
+% \bigskip
+%
+% |\nomatchresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% |\conservedresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% |\allmatchresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+% \bigskip
+%
+% For how to handle colors for the foreground \meta{res.col.} and
+% the background \meta{shad.col.} see section \ref{colors}.
+% The third parameter \meta{case} tells \TeXshade{} to print the
+% corresponding residue as a lowercase or an uppercase letter or
+% even to print any other character. Finally, the \meta{style}
+% parameter tells \TeXshade{} which shape to use for the letters.
+% Use one of the following styles
+% for \meta{style}.
+%
+% \begin{center}
+% \begin{tabular}{cl}
+% \meta{style} & \emph{effect} \\ \hline
+% |bf| & bold face series\\
+% |md| & normal series \\
+% |up| & upright shape (normal shape)\\
+% |it| & italics shape \\
+% |sl| & slanted shape \\
+% |rm| & modern roman family \\
+% |sf| & sans serif family \\
+% |tt| & typewriter family \\
+% \end{tabular}
+% \end{center}
+% \medskip
+%
+% In order to change only some
+% of the parameters it is sufficient to declare these
+% and use empty braces for the others. Examples:
+% \bigskip
+%
+% \quad|\conservedresidues{White}{Blue}{upper}{bf}|: the conserved
+% residues are printed as bold face white uppercase letters on blue.
+% \bigskip
+%
+% \quad|\nomatchresidues{}{}{{$\bullet$}}{}|: instead of the non
+% matching residues a `$\bullet$' is printed. The colors and style
+% are not changed.
+% Note the double curly braces which make \TeXshade{}
+% interpret this complex symbol description as one single
+% character.
+% \bigskip
+%
+%
+% \item |\shadingmode[|\meta{allmatchspecial}|]{similar}|
+%
+% \label{Lsimilarresidues}
+% See \ref{similar} for an example output and an explanation
+% of the shading. In addition to the described commands
+% for changing shading colors this shading mode provides
+% the command |\similarresidues|.
+% Use it in analogy to the commands above.
+%
+% \label{Lpepsims}\label{Lpepgroups}
+% \label{LDNAsims}\label{LDNAgroups}
+% How does \TeXshade{} know which residues are
+% considered to be similar? These definitions are set by two command
+% couples, i.\,e.\
+% |\pepsims|,|\pepgroups| for peptides and
+% |\DNAsims|,|\DNAgroups| for nucleotides. With |\pepsims| and
+% |\DNAsims| residues are defined which are similar to the
+% consensus residue. Examples:
+%
+% \quad |\pepsims{S}{TA}|\quad If a serine is the consensus
+% residue then all threonins and alanines at this
+% position are shaded in the color for similars. This
+% definition does \emph{not} imply that threonine and
+% alanine are similar to each other! This becomes
+% obvious when you inspect the next definition:
+%
+% \quad |\pepsims{T}{S}|\quad Serine but not alanine is declared
+% to be similar to threonine.
+%
+% What happens if there is no consensus residue? How does
+% \TeXshade{} decide if a group of similars is greater than
+% the threshold? Therefore groups are pre-defined:
+%
+% \quad |\pepgroups{FYW,ILVM,RK,DE,GA,ST,NQ}| This command allows
+% one to set up to nine groups of similars, separated by commas.
+% Each residue can belong to only one group. If one residue
+% is assigned to several groups only the last assignment is
+% carried out.
+%
+% \quad |\DNAgroups{GAR,CTY}| This command is used in analogy to
+% the amino acid groups. Here, two ambiguity codes (`R' for
+% pu\underline{r}ine base and `Y' for p\underline{y}rimidine
+% base) are assigned in addition.
+%
+% Residues which do not appear in any of the four commands are
+% considered not to belong to a group. The default
+% settings for similars are listed below:
+% \bigskip
+%
+% \begin{verbatim}
+% \pepgroups{FYW,ILVM,RK,DE,GA,ST,NQ}
+%
+% \pepsims{F}{YW} % Y and W are similar to F
+% \pepsims{Y}{WF} % W and F are similar to Y
+% \pepsims{W}{YF} % Y and F are similar to W
+%
+% \pepsims{I}{LVM} % L, V and M are similar to I
+% \pepsims{L}{VMI} % V, M and I are similar to L
+% \pepsims{V}{MIL} % M, I and L are similar to V
+%
+% \pepsims{R}{KH} % K and H are similar to R
+% \pepsims{K}{HR} % H and R are similar to K
+% \pepsims{H}{RK} % R and K are similar to H
+%
+% \pepsims{A}{GS} % G and S are similar to A
+% \pepsims{G}{A} % A (but not S) is similar to G
+%
+% \pepsims{S}{TA} % T and A are similar to S
+% \pepsims{T}{S} % S (but not A) is similar to T
+%
+% \pepsims{D}{EN} % E and N (but not Q) are similar to D
+% \pepsims{E}{DQ} % D and Q (but not N) are similar to E
+% \pepsims{N}{QD} % Q and D (but not E) are similar to N
+% \pepsims{Q}{NE} % N and E (but not D) are similar to Q
+%
+% \DNAgroups{GAR,CTY}
+%
+% \DNAsims{A}{GR} % G and R are similar to A
+% \DNAsims{G}{AR} % A and R are similar to G
+% \DNAsims{R}{AG} % A and G are similar to R
+%
+% \DNAsims{C}{TY} % T and Y are similar to C
+% \DNAsims{T}{CY} % C and Y are similar to T
+% \DNAsims{Y}{CT} % C and T are similar to Y
+% \end{verbatim}
+%
+%
+% \item |\shadingmode[|\meta{seqref}|]{diverse}|
+%
+% \ref{diverse} depicts an example alignment. Choose the
+% number or the name of the sequence \meta{seqref} which will be treated
+% as the consensus and to which the other sequences are compared.
+% If no \meta{seqref} is declared the first sequence is set as
+% consensus (\meta{seqref} = 1).
+%
+% Standard definitions for |diverse|
+% mode are:
+%
+% \begin{verbatim}
+% \nomatchresidues{Black}{White}{lower}{up}
+% \similarresidues{Black}{White}{lower}{up}
+% \conservedresidues{Black}{White}{{.}}{up}
+% \allmatchresidues{Black}{White}{{.}}{up}
+% \gapchar{-}
+% \end{verbatim}
+%
+% After calling |\shadingmode{diverse}| these commands can be
+% used to redefine the |diverse| mode settings (mind the double
+% curly braces around the dot-symbol!).
+%
+% \item |\shadingmode[|\meta{type}|]{functional}|
+% There are six different functional shading modes available for
+% peptide sequences; nucleotide sequences can not be shaded due
+% to functional aspects. Four of \TeXshade's functional modes
+% correspond to the four `alphabets' employed by \textsc{Karlin}
+% and \textsc{Ghandour} for peptide alignments [2]. Additional
+% `alphabets' to the standard 20-letter array of amino acids
+% can highlight peptide similarities which were otherwise not visible.
+% For the `alphabet' definitions see below:
+%
+% \begin{itemize}
+% \item \meta{type} = |charge|\quad Acidic (D, E) and basic (H,
+% K, R).
+%
+% \item \meta{type} = |hydropathy|\quad Acidic and basic (as
+% above), polar uncharged (C, G, N, Q, S,
+% T, Y) and hydrophobic nonpolar (A, F, I, L, M,
+% P, V, W), see also \textsc{Kyte} and
+% \textsc{Doolittle} [3].
+%
+% \item \meta{type} = |structure|\quad External (D, E, H, K, N, Q, R),
+% internal (F, I, L, M, V) and ambivalent (A, C,
+% G, P, S, T, W, Y).
+%
+% \item \meta{type} = |chemical|\quad Acidic (D, E), aliphatic
+% (A, G, I, L, V), amide (N, Q), aromatic
+% (F, W, Y), basic (H, K, R), hydroxyl
+% (S, T), imino (P) and sulfur (C, M).
+%
+% \end{itemize}
+%
+% The two modes described below highlight sidechain sizes and
+% hydrophobicity, respectively, according to \textsc{Rose}
+% \emph{et al.}\ [4,5]. Standard area stands for the surface area
+% of the residue in \AA$^2$, i.\,e. it is a measure for the size
+% of a residue's sidechain. The accessible area value (also in
+% \AA$^2$) gives information about the size of the surface area
+% which is accessible by solvent molecules within the folded
+% protein. A very small area means that the residue is
+% strongly buried and is thus very hydrophobic. Hydrophilic
+% residues in turn possess large accessible areas due
+% to their prefered location at the protein surface. Therefore,
+% this kind of shading provides another method, in addition
+% to |hydropathy| and |structure|, for the
+% visualization of structural protein properties.
+%
+% \begin{itemize}
+%
+% \item \meta{type} = |standard area|\quad for the area values
+% see legend of the alignment in \ref{starea}
+%
+% \item \meta{type} = |accessible area|\quad for values see
+% \ref{accarea}
+%
+% \end{itemize}
+%
+% \label{Lclearfuncgroups}
+% If no \meta{type} or an unknown \meta{type} is designated as option
+% all functional groups and shading colors are cleared. This is
+% also achieved by the command
+% |\clearfuncgroups|. With all groups cleared one can start to
+% build new shading modes from scratch. How to do this is explained
+% in the next section.
+%
+% \label{Lfuncshadingstyle}
+% In order to exchange the colors but to keep the group definitions
+% and descriptions the command
+% |\funcshadingstyle| can be
+% employed. Usage:
+% \medskip
+%
+% \quad|\funcshadingstyle{|\meta{residue}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+%
+% \hfill|{|\meta{case}|}{|\meta{style}|}|
+% \medskip
+%
+% \meta{residue} is one representative of the whole amino acid group. The
+% colors which are declared by the next four parameters are used
+% for all residues in this group. \meta{case} and \meta{style} are
+% as described for example in |\nomatchresidues|.
+% \end{enumerate}
+%
+% \subsection{Creating new functional shading modes}
+%
+% The grouping of amino acids due to other properties can make sense as
+% suggested by \textsc{Karlin} and \textsc{Ghandour} [2], e.\,g.\
+% physical properties (molecular weight, shape), kinetic properties
+% (reaction velocity, Michaelis-Menton constant), or structure
+% ($\alpha$-helices, $\beta$-sheets, turns).
+%
+% \label{Lfuncgroup}
+% New amino acid groups are defined with the
+% |\funcgroup| command. This command needs six parameters:
+% \medskip
+%
+% \quad|\funcgroup{|\meta{descr}|}{|\meta{residues}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+%
+% \hfill|{|\meta{case}|}{|\meta{style}|}|
+% \medskip
+%
+% \meta{descr} contains descriptive text which is displayed in the legend.
+% The second parameter \meta{residues} holds the amino acids to be
+% grouped. The colors for the foreground and background are set
+% with the following two parameters, the case and style is declared by the
+% last parameters. The example below defines a
+% funcional group named `acidic ($-$)' containing the amino acids
+% aspartic and glutamic acid with white letters on a red background:
+% \bigskip
+%
+% \quad|\funcgroup{acidic ($-$)}{DE}{White}{Red}{upper}{up}|
+% \bigskip
+%
+% For the usage of colors see section \ref{colors}. Up to nine
+% individual groups can be defined. New groups are simply added to the
+% already existing groups, i.\,e.\ if an extension of the group
+% definitions of an existing shading mode is desired there is
+% no need to clear these groups und re-define them again. Just
+% add the new groups with the |\funcgroup| command. To create
+% completely new modes use the command
+% |\shadingmode{functional}| without an option
+% \emph{before} setting the new groups. The new definitions are active
+% only in the functional shading mode---so be sure to
+% have it switched on before setting the new groups.
+% Remember, |\shadingmode{functional}| without an optional parameter
+% clears all groups defined before, see above. The following example
+% shows the definitions needed to produce an output which is identical
+% to the functional mode `charge':
+% \bigskip
+%
+% \quad|\begin{texshade}{|\meta{alignmentfile}|}|
+% \medskip
+%
+% \quad\quad |\shadingmode{functional}|
+%
+% \quad\quad |\funcgroup{acidic ($-$)}{DE}{White}{Red}{upper}{up}|
+%
+% \quad\quad |\funcgroup{basic ($+$)}{HKR}{White}{Blue}{upper}{up}|
+% \medskip
+%
+% \quad|\end{texshade}|
+%
+%
+% \subsection{Appearance of the consensus line}
+%
+% \label{Lthreshold}
+% An important parameter for the calculation of the consensus is the
+% threshold percentage. Default setting is 50\%, i.\,e.\ to become
+% the consensus residue more than half of the residues at this
+% position must be identical or similar, depending on the shading
+% mode. Any percentage between 0 and 100 is allowed and can be
+% set with
+% |\threshold{|\meta{percentage}|}|, e.\,g.\ |\threshold{50}|.
+%
+% \label{Lconstosingleseq}
+% Another possibility is to set one sequence of the alignment
+% as consensus and
+% compare the other sequences to this one. Therefore, the
+% command
+% |\constosingleseq{|\meta{seqref}|}| is provided. The
+% \meta{seqref} selects the sequence to be used as consensus
+% (numbering according to the appearance in the alignment file;
+% top sequence is number~1, or use the sequence name).
+% Nevertheless, the threshold percentage is also taken into
+% account, i.\,e.\ with a threshold of 50\% half
+% of the sequences must be identical or similar compared to the
+% specified consensus sequence in order to be shaded.
+% \label{Lconstoallseqs} With |\constoallseqs| the
+% consensus is calculated considering all sequences (the case
+% described in the paragraph above).
+%
+% \label{Lshowconsensus}\label{Lhideconsensus}
+% \label{Lnameconsensus}
+% Consensus lines are displayed either on the top or at the bottom
+% of the alignment by calling
+% \medskip
+%
+% |\showconsensus[|\meta{color/scale}|[,|\meta{color/scale}|]]{|\meta{position}|}|
+% \medskip
+%
+% with
+% \meta{scale} |Gray|, |BlueRed|, |RedBlue|, |GreenRed|, |RedGreen|,
+% |ColdHot| (recommended) or |HotCold| and \meta{position} |top|
+% or |bottom|.
+%
+% The first color defines the foreground, i.e. the letters, the
+% second color---if specified---defines the background.
+% If a color scale is named the consensus will be shaded according
+% to the level of sequence conservation. For an example see page
+% \pageref{shadecons}. You can find more information on color scales
+% on page \pageref{Lgraphs}.
+%
+% To hide the consensus use
+% |\hideconsensus|. The consensus
+% line is named `consensus' in english texts, `consenso' in spanish
+% or `Konsensus' if the |german.sty| is used. With
+% |\nameconsensus{|\meta{name}|}| any name can be set.
+%
+% \label{Ldefconsensus}
+% You can tell \TeXshade{} which symbols or letters to use in
+% the consensus line for different matching qualities by
+% \bigskip
+%
+% \quad|\defconsensus{|\meta{symbol1}|}{|\meta{symbol2}|}{|\meta{symbol3}|}|.
+% \bigskip
+%
+% The following parameters are allowed for symobols 1--3:
+%
+% \begin{enumerate}
+%
+% \item \meta{symbol1} = no match symbol (if below threshold)
+%
+% \begin{itemize}
+% \item any character or letter
+% \item |{}| (empty braces) for blank space
+% \end{itemize}
+%
+% \item \meta{symbol2} = conserved symbol (if threshold is exceeded)
+%
+% \begin{itemize}
+% \item |upper| (prints the consensus residue in uppercase)
+% \item |lower| (prints the consensus residue in lowercase)
+% \item any character or letter
+% \item |{}| (empty braces) for blank space
+% \end{itemize}
+%
+% \item \meta{symbol3} = all match symbol (if all residues match and
+% \hfill |\allmatchspecial| is active)
+%
+% \begin{itemize}
+% \item see \meta{symbol2}
+% \end{itemize}
+%
+% \end{enumerate}
+%
+% Example: |\defconsensus{{}}{*}{upper}| does not show non matching
+% residues in the consensus line, marks conserved residues
+% with `|*|', and displays the uppercase letter of the consensus
+% residue at positions where all residues match.
+%
+%
+% \label{Lconsensuscolors}
+% Finally, the colors of the above defined symbols are adjustable
+% by the command:
+%
+% \begin{tabbing}
+% \quad|\consensuscolors|\=|{|\meta{res.col.1}|}{|\meta{shad.col.1}|}|\\
+%
+% \>|{|\meta{res.col.2}|}{|\meta{shad.col.2}|}|\\
+%
+% \>|{|\meta{res.col.3}|}{|\meta{shad.col.3}|}|\\
+% \end{tabbing}
+%
+% The color definitions are in the same order as in the
+% |\defconsensus| command:
+%
+% \begin{enumerate}
+%
+% \item \meta{res.col.1} = no match residue color (if below threshold)
+%
+% \meta{shad.col.1} = no match background color
+%
+% \item \meta{res.col.2} = conserved residue color (if threshold is exceeded)
+%
+% \meta{shad.col.2} = conserved background color
+%
+% \item \meta{res.col.3} = all match residue color (if all residues match and
+% \hfill |\allmatchspecial| is active)
+%
+% \meta{shad.col.3} = all match background color
+%
+% \end{enumerate}
+%
+% For colors which are not to be changed empty braces can be used.
+%
+% Example:\medskip
+%
+% \quad|\consensuscolors{}{}{Blue}{White}{Red}{Green}|
+% \medskip
+%
+% Non matching symbol colors are not changed,
+% conserved residues are displayed blue on white and where all residues
+% match red symbols on green ground are displayed in the
+% consensus line.
+%
+% \subsection{Appearance of the sequence lines}
+%
+% \label{seqlines}
+%
+% \subsubsection{Names, numbers and gaps}
+% \label{Lshownames}\label{Lshownumbering}
+% Many parameters that influence the appearance of the actual sequence
+% lines can be changed for customization.
+% Thus, the sequence names and
+% numbering can be shown and placed either left or right by
+% \medskip
+%
+% \quad|\shownames{|\meta{position}|}|
+% \medskip
+%
+% \quad|\shownumbering{|\meta{position}|}|
+% \medskip
+%
+% with \meta{position} set to |left| or |right|. Both, names and
+% numbering can be displayed on the same side.
+%
+% \label{Lnameseq}
+% \TeXshade{} uses the sequence names from the
+% alignment input file. This can cause some
+% problems during the \TeX-run when special characters are present
+% in those names! \TeXshade{} does not accept the following characters
+% in sequence names: |\ { } @| spaces and the tilde. Those have to be replaced in
+% the input file. The characters |#| and |%| can only be used with a
+% leading backslash, e.\,g. |\#|. This must also be changed in the
+% input file. All other special characters should be displayed
+% properly.
+%
+% Sequence names that are accepted by \TeXshade{} can further be
+% changed in the |texshade| environment:
+% \medskip
+%
+% \quad|\nameseq{|\meta{seqref}|}{|\meta{name}|}|
+% \medskip
+%
+% \meta{seqref} selects the sequence whose name is to be changed.
+% The basis for the \meta{seqref} is the appearance in
+% the alignment input file with the top sequence = 1, or the old
+% name.
+% \label{Lnamescolor}\label{Lnumberingcolor}
+% The colors are set by |\namescolor{|\meta{color}|}| and
+% |\numberingcolor{|\meta{color}|}|, respectively.
+% \label{Lnamecolor}\label{Lnumbercolor}
+% In order to change the colors only of some sequence names or numbers
+% the commands
+% |\namecolor{|\meta{seq1}|, ... ,|\meta{seq n}|}{|\meta{color}|}| and
+% |\numbercolor{|\meta{seq1}|, ... ,|\meta{seq n}|}{|\meta{color}|}|
+% are provided.
+%
+% \label{Lhidenames}\label{Lhidename}
+% \label{Lhidenumbering}\label{Lhidenumber}
+% In order to hide all names or the numbering use the command
+% |\hidenames| or |\hidenumbering|. If only the names or numbers of
+% some sequences should be hidden apply
+%
+% |\hidename{|\meta{seq1}|, ... ,|\meta{seq n}|}| or
+%
+% |\hidenumber{|\meta{seq1}|, ... ,|\meta{seq n}|}|, respectively.
+%
+% \label{Lstartnumber}
+% In some situations, e.\,g.\ when only sections of sequences are
+% displayed, one
+% may not want to have the residue numbering start out with number~1.
+% The command
+% |\startnumber{|\meta{seqref}|}{|\meta{first residue number}|}|
+% allows one to set the starting number of any sequence to any value
+% incl.\ negative values but except `0' which is not used in
+% sequence numbering (the transition from negative to positive
+% values is like this: \ldots\ $-2$, $-1$, 1, 2 \ldots).
+%
+% \label{Lseqlength}
+% \TeXshade{} needs to know the correct length of the sequences
+% to be able to break them right after the last residue. If
+% MSF files are used as an input the length is already given
+% but the calculation is usually wrong because the gaps are
+% also counted. Thus, \TeXshade{} counts the number of residues
+% during each run by itself and stores the values in the |.aux| file. That
+% means that it needs two runs to get the numbers right. Again,
+% this is only important if the gap symbol after the sequence end
+% should be suppressed, see below (|\hideleadinggaps|).
+%
+% If you know the correct length of the sequences you can use the
+% command
+% \medskip
+%
+% \quad|\seqlength{|\meta{seqref}|}{|\meta{length}|}|
+% \medskip
+%
+% in order to set the values by hand and have the gaps break
+% properly already in the first \TeX{} run.
+% \medskip
+%
+% Example: |\seqlength{1}{346}| means that sequence no.~1 is 346
+% residues long.
+%
+%
+% \label{Lsetends}
+% \TeXshade{} can display a section of the complete alignment
+% without the need to edit the alignment input file or even
+% to re-calculate
+% the entire alignment. This allows one to use one single
+% alignment of the full length proteins or open reading frames for
+% multiple visualizations of different sections in a document as
+% done in this manual. Thus, the file |AQPpro.MSF| contains
+% the full-length multiple protein alignment of five aquaporins but
+% only sections are displayed as examples in
+% \ref{ident} through \ref{accarea}. The definition of a section
+% is done by
+% \medskip
+%
+% \quad|\setends{|\meta{seqref}|}{|\meta{startnumber}|..|\meta{stopnumber}|}|.
+% \medskip
+%
+% Again, \meta{seqref} is the sequence number based on the
+% appearance in the alignment file, or the name; further, in order to use
+% the consensus as a measure for the sequence section the
+% string `|consensus|' as \meta{seqref} is accepted. The
+% specified sequence is truncated at
+% positions \meta{startnumber} and \meta{stopnumber}. All other
+% sequences are cut accordingly. If the number of the first
+% residue in the sequence is set to a new value with the
+% |\startnumber| command (s.\,a.) this is taken into account. Some examples:
+% \medskip
+%
+% \quad a) |\setends{1}{20..100}|
+% \medskip
+%
+% \quad b) |\startnumber{1}{15} \setends{1}{35..115}|
+% \medskip
+%
+% Both commands select the same section from the alignment but the
+% numbering for sequence 1 starts at position~20 in the first example and at
+% position~35 in the latter.
+% \medskip
+%
+% \quad c) |\setends{consensus}{20..100}|
+% \medskip
+%
+% This may describe a completely different section of the multiple
+% sequence alignment.
+%
+% \label{Lshowruler}\label{Lhideruler}
+% \label{Lrulersteps}\label{Lrulercolor}
+% Another possibility to label sequence positions is to switch
+% on a ruler on the top or at the bottom of the sequence block
+% using \label{ruler}
+% |\showruler{|\meta{position}|}{|\meta{seqref}|}|.
+% The residue ruler of one sequence \meta{seqref} or the consensus
+% (declare `|consensus|' as \meta{seqref}) can be
+% displayed at \meta{position} |top| or |bottom|.
+% The ruler is hidden with |\hideruler|. The steps between two
+% numbers are set by |\rulersteps{|\meta{number}|}|. In order to change the
+% color which is used for the ruler write
+% |\rulercolor{|\meta{color}|}|.
+%
+% \label{Lgapchar}\label{Lgaprule}
+% \label{Lgapcolors}\label{gapchar}
+% Further, the symbol which is displayed in sequence gaps is freely
+% selectable with
+% |\gapchar{|\meta{symbol}|}|. \meta{symbol} can be any character
+% or symbol. If math symbols are to be used math mode must be
+% activated by |$| characters, i.\,e. |\gapchar{{$\triangle$}}|.
+% Note the double curly braces in the last command. Everytime a
+% `complex' character is used, i.\,e. a character definition consisting
+% of more than one letter, it must be braced in order to be interpreted as one
+% character. One exception is |\gapchar{rule}|; with this
+% parameter lines are drawn in the sequence gaps with a certain
+% thickness defined by |\gaprule{|\meta{thickness}|}|, e.\,g.
+% |\gaprule{1.5pt}|. The colors of the gaps and gap symbols are set by
+% |\gapcolors{|\meta{symbol color}|}{|\meta{background color}|}|.
+%
+% There are some discussions whether or not to display gap symbols before
+% and after the actual sequence. Since v1.3a one can control the
+% appearance of those gap symbols by the commands
+% \label{Lshowleadinggaps} \label{Lhideleadinggaps}
+% |\showleadinggaps| and |\hideleadinggaps|. By default, leading
+% gaps are indicated by symbols despite my personal
+% thinking that it could suggest that
+% there are some not displayed residues upstream resp.\ downstream of the
+% gap.
+%
+%
+%
+% \subsubsection{Hiding, killing, separating and ordering}
+%
+% \label{kill}
+%
+% \label{Lhideseq}\label{Lkillseq}
+% If one or more sequences from the alignment input file should be used for
+% the calculation of the consensus but it is desired not to
+% display these sequences in the final output use the command
+% |\hideseq{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}|.
+% For consecutive sequence numbers a dash can be used, e.\,g.
+% |\hideseq{1-3}| instead of |\hideseq{1,2,3}|. Decending series
+% are also permitted, e.\,g. |\hideseq{3-1}|.
+% This command allows one for example to hide
+% the sequence which has been defined as the consensus sequence
+% with |\constosingleseq|. In order to completely exclude
+% sequences the command
+% |\killseq{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}| is
+% provided. Again, for number series the dash can be used (s.\,a.). The
+% designated sequences are neither displayed nor
+% considered for the calculation of the consensus. This is
+% another possibility to comment out sequences in addition
+% to the use of an exclamation point infront of the |Name:|
+% definition in an MSF-file (see figure on page \pageref{commout}).
+%
+% \label{Ldonotshade}
+% The command
+% |\donotshade{|\meta{seq1}|,|\meta{seq2}\ldots|,|\meta{seq n}|}|
+% makes
+% one or more sequences (remember the dash, s.\,a.) appear unshaded
+% in black letters on white background.
+% This does not influence any other sequences or the consensus
+% calculation.
+%
+% \label{Lhideresidues}\label{Lshowresidues}
+% If a very graphical output of the sequences is desired, the
+% residue symbols or letters can be blanked out by
+% |\hideresidues|. Now, only the shaded boxes are printed.
+% In combination with |\gapchar{rule}| one obtains alignments
+% in a style \`a la Mondrian.
+% The residues reappear with |\showresidues|.
+%
+% \label{Lseparationline}\label{Lsmallsep}
+% \label{Lmedsep}\label{Lbigsep}
+% \label{Lvsepspace}
+% If an alignment contains members of several subgroups of a
+% protein or a gene family it may be rather helpful to visualize the group
+% divisions by a separation line. Therefore, the command
+% |\separationline{|\meta{seqref}|}| is applicable. This
+% command inserts vertical space after the sequence which is
+% refered to by \meta{seqref}. How much space is inserted
+% is defined by one of the following commands:
+% |\smallsep|, |\medsep| (default) or |\bigsep|. These lengths
+% correspond to the known |\small|-, |\med|- and |\bigskip| commands.
+% With |\vsepspace{|\meta{length}|}| any length with any
+% \TeX{} unit can be assigned, e.\,g. |\vsepspace{2mm}|.
+%
+% \label{Lorderseqs}
+% The sequence order given by the alignment input file is easily
+% reorganized by
+% |\orderseqs{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}|
+% without the need for editing the alignment input file (which
+% would be a big copy'n'paste job).
+% Make sure that all sequences are assigned in this
+% command. If there are more sequences present than numbers or names in the
+% command an error message will occur. Here also, the dash can be
+% used for sequence number series. Example: |\orderseqs{1-3,6-4,7}|
+% is equivalent to |\orderseqs{1,2,3,6,5,4,7}|.
+% Reordering of sequences only changes the output; all commands using
+% the parameter \meta{seqref} are not influenced, because \meta{seqref}
+% always corresponds to the appearance in the alignment file. Thus,
+% to completely reverse the order of a five sequence alignment simply type
+% |\orderseqs{5-1}|.
+%
+%
+% \subsubsection{Residues per line and further settings}
+%
+% \label{Lresiduesperline}\label{Lresiduesperline*}
+% By default \TeXshade{} puts the highest possible by five
+% divisible number of residues in one line depending on the
+% |\textwidth|. With |\residuesperline{|\meta{number}|}| a new
+% value can be set. If this value exceeds the highest possible
+% number of residues per line it is ignored; lower values are
+% accepted of course. But also in the latter case the number
+% of residues printed per line is rounded such to be divisible by five.
+% To force \TeXshade{}
+% to set lines with exactly the desired number of residues use
+% the asterisk-extended command |\residuesperline*{|\meta{number}|}|.
+% Expect multiple
+% \emph{overfull hbox} errors after this command, because in this
+% mode \TeXshade{} does not check the length of the lines any
+% more.
+%
+% \label{Lcharstretch}\label{Llinestretch}
+% \TeXshade{} calculates the dimensions of a shaded box from
+% the width and height of the uppercase letter `M' and the depth of
+% the lowercase `g'. Depending on the font used for the
+% sequence residues the box dimensions might not be fully
+% satisfactory. With |\charstretch{|\meta{factor}|}| and
+% |\linestretch{|\meta{factor}|}| the width and height/depth,
+% respectively, of the boxes can be multiplied individually by a
+% \meta{factor} to stretch ($>1$) or shrink ($<1$) the dimensions.
+%
+% \label{Lnumberingwidth}
+% The reserved space for the sequence numbering is set by the
+% command |\numberingwidth{|\meta{n digits}|}|. Here, the default setting
+% is four-digit numbering, i.\,e.\ $-999$ through 9999. If this range
+% is to be changed assign the desired number as parameter
+% \meta{n digits}, e.\,g.\ |\numberingwidth{111111}| reserves
+% space for 6 digit numbering.
+%
+% The vertical space between the sequence blocks can be controlled
+% by the commands |\smallblockskip|, |\medblockskip| (default
+% setting),
+% \label{Lsmallblockskip}\label{Lmedblockskip}
+% \label{Lbigblockskip}\label{Lnoblockskip}
+% \label{Lvblockspace}
+% |\bigblockskip| or |\noblockskip|. Further, the command
+% |\vblockspace{|\meta{length}|}| allows one to set a defined space
+% length using any \TeX{} unit, e.\,g.\ |\vblockspace{0.4in}|.
+%
+% Two more commands set the space between the sequence blocks to be
+% \label{Lflexblockspace}\label{Lfixblockspace}
+% flexible (|\flexblockspace|) (default) or fixed (|\fixblockspace|).
+% Flexible means, that only the vertical white space between the
+% blocks is kept to the settings by
+% e.\,g. |\medblockskip|. This results in flexible space between
+% the actual blocks depending on the presence of feature lines. When
+% switching to fixed space the distance of the blocks is kept constant
+% by using more white space between blocks without feature lines.
+% Thus, a difference between flexible and fixed space will only be
+% noticeable when features are used.
+%
+% \label{Lalignment}
+% The position of the output can be aligned left, right
+% or centered on the page by |\alignment{|\meta{position}|}|
+% with the \meta{position} parameter |left|, |center| or
+% |right|.
+%
+%
+%
+% \subsubsection{Fingerprinting}
+%
+% \label{fingerprint}
+%
+% \label{Lfingerprint}
+% An easy way to gain an overview on complete alignments is
+% provided by displaying a so called alignment `fingerprint'.
+% In this style the whole sequence can be shown in one line. Due to
+% the lacking space the residue names are hidden and the shaded
+% boxes are reduced to thin vertical colored lines. The command
+% |\fingerprint{|\meta{res. per line}|}| takes one argument stating
+% the desired number of residues per line, e.\,g. |\fingerprint{1000}|.
+% All \TeXshade{} commands are compatible with |\fingerprint|,
+% i.\,e. all shading modes are applicable for displaying overviews
+% on similarity or every functional aspect. Also, all kinds of
+% labeling---as described in the following---work with this
+% command.
+%
+%
+% \subsection{Individual shading and labeling of sequence stretches}
+%
+% Computer calculated alignment shading is informative---but
+% even more information can be visualized by manual labeling
+% of positions and regions of interest with different colors,
+% text styles or graphical marks and descriptive text. All this
+% is provided by easy to handle \TeXshade{} commands.
+%
+%
+% \subsubsection{Manual shading of regions and blocks}
+% \label{shaderegion}
+%
+% \label{Lshaderegion}
+% Besides the shading calculated by \TeXshade{} any region can be
+% shaded manually with a color specified by the user. This is very
+% useful to highlight secondary protein modification
+% sites such as phosphorylation or glycosylation sites or longer
+% motifs for example protein/protein interaction sites.
+% This is done by the use of the following command:
+% \medskip
+%
+% \quad|\shaderegion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+% \medskip
+%
+% Example: in order to shade residue number 13 and the region
+% 20--30 of sequence number 1 in red letters on green ground
+% type the following command:
+% \medskip
+%
+% \quad|\shaderegion{1}{13..13,20..30}{Red}{Green}|
+% \medskip
+%
+% If the consensus is to be shaded use |consensus| as
+% \meta{seqref}.
+%
+% \label{Lshadeblock}
+% In analogy to |\shaderegion| which is restricted to one single
+% sequence |\shadeblock| shades the corresponding region in all
+% other sequences as well
+% except the consensus. If also the consensus is to be shaded
+% define the region using |consensus| as \meta{seqref}.
+% \medskip
+%
+% \quad|\shadeblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+% \medskip
+%
+%
+% \subsubsection{Emphasizing and tinting regions and blocks}
+%
+% \label{Lemphregion}\label{Lemphblock}
+% If it is prefered to keep the calculated shading colors
+% but distinct regions or blocks are yet to be emphasized one
+% can use the following commands to change the font style of
+% such regions:
+% \medskip
+%
+% \quad|\emphregion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% \medskip
+%
+% and
+% \medskip
+%
+% \quad|\emphblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% \medskip
+%
+% \label{Lemphdefault}
+% Which style \TeXshade{} uses for emphasizing regions is defined by
+% |\emphdefault{|\meta{style}|}|. Default setting is the
+% \emph{italics} font shape (set by |\emphdefault{it}|). In order to change
+% this setting choose one of the styles |bf, md, up, it, sl, rm, sf, tt|.
+%
+% Example: |\emphdefault{bf}|
+% \medskip
+%
+% \label{Ltintregion}\label{Ltintblock}
+% Further, it is possible to tint the region or block in question
+% by using the commands (for example see hydropathy-figure on page
+% \pageref{hydro}):
+% \medskip
+%
+% \quad|\tintregion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% \medskip
+%
+% and
+% \medskip
+%
+% \quad|\tintblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% \medskip
+%
+% \label{Ltintdefault}
+% The level of tinting in the region in question can be set by
+% |\tintdefault{|\meta{level}|}| with |weak|, |normal|, and
+% |strong| as possible \meta{level}s.
+%
+% Another option is to draw a bounding box around the sequence block
+% in question (for an example see diversity mode-figure on page
+% \pageref{frame}) with the
+% command:\footnote{Thanks to Alan Robinson for inspiration.}
+% \medskip\label{Lframeblock}
+%
+% \quad|\frameblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{color}|[|\meta{length}|]}|
+% \medskip
+%
+% With the optional parameter the default line thickness of the frame can
+% be changed, example: |\frameblock{1}{10..20,50..70}{Red[2pt]}|
+%
+% \subsubsection{Graphical labeling of sequence features}
+%
+% \label{feature}
+%
+% \label{Lfeature}
+% The |\feature| command is designed to fulfill most needs for the
+% graphical labeling of sequence stretches and the setting of descriptive
+% text. It needs five parameters:
+% \medskip
+%
+% \quad|\feature{|\meta{position}|}{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|
+%
+% \quad\quad\meta{start2}..\meta{stop2}|,|\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{labelstyle}|}{|\meta{text}|}|
+% \medskip
+%
+% In the following paragraphs all possible parameter settings of
+% this rather complex but mighty command are discussed in detail.
+% The parameter \meta{position} tells \TeXshade{} where to display
+% the feature label, i.\,e. on the top of the alignment (|top|),
+% or at the bottom (|bottom|). Further, there can be a feature line
+% ontop of the top feature line (|ttop|) or below the bottom
+% feature line (|bbottom|). Thus, up to four features
+% overlapping in four different lines may be displayed.
+% Depending on the content of the feature lines the gaps between
+% them might be not satisfactory.
+% \label{Ltopspace}\label{Lttopspace}
+% \label{Lbottomspace}\label{Lbbottomspace}
+% Therefore, four separate commands can be employed to change the
+% space between |ttop| and |top|
+% (|\ttopspace{|\meta{length}|}|), between |top| and the alignment
+% (|\topspace{|\meta{length}|}|), between the alignment and
+% |bottom| (|\bottomspace{|\meta{length}|}|) and between |bottom|
+% and |bbottom| (|\bbottomspace{|\meta{length}|}|). Use positive
+% values to further separate the lines, e.\,g.
+% |\ttopspace{3mm}| or negative values to reduce the space, e.\,g.
+% |\bottomspace{-0.1in}|.
+%
+% The argument \meta{seqref} and the third
+% parameter containing the definitions of the specified regions
+% are identical to the ones described before in several commands, e.\,g.
+% |\ruler| (\ref{ruler}) or |\shaderegion| (\ref{shaderegion}).
+%
+% New is the fourth parameter for the definition of the label style.
+% There are many possibilities like braces, helices, boxes, arrows, bars, any
+% fill character, bar graphs, color scales or even translations of the
+% specified regions.
+% \medskip
+%
+% \textbf{Braces:}\\
+% In order to display an over- or underbrace as
+% a label use the parameter |{brace}|. Depending on the
+% \meta{position} (|ttop|, |top|, |bottom| or |bbottom|) the respective brace is
+% displayed. The standard color of braces is
+% black. It can be changed by an optional parameter directly after
+% the definition of the symbol, e.\,g. |{brace[Red]}|.
+% \medskip
+%
+% \textbf{Protein $\alpha$-Helices:}\\
+% The parameter |{helix}| will plot a symbolized $\alpha$-helix
+% as a label. The standard color of the helix spiral is
+% black. It can be changed by an optional parameter directly after
+% the definition of the symbol, e.\,g. |{helix[Red]}|.
+% \medskip
+%
+% \textbf{Filling a stretch with a symbol:}\\
+% A region can be filled with any character for
+% labeling purposes using the parameter |{fill:|\meta{symbol}|}|.
+% The \meta{symbol} is freely selectable; the usage is like
+% in |\gapchar| (\ref{gapchar}). Do not use spaces before or after
+% the expression \meta{symbol}; this will shift the symbols to the
+% respective direction. The standard color of the fill symbol is
+% black. It can be changed by an optional parameter directly after
+% the definition of the symbol, e.\,g. |{fill:$\bullet$[Red]}|.
+%
+% The |\feature| command does not like special characters in
+% text mode, e.\,g. |\dag|. One has to use the math version of
+% those symbols between |$|-signs. The following quite common
+% text symbols have also a math equivalent\footnote{Thanks to
+% Darrell Conklin for giving notice to me about this problem}:
+%
+% \begin{center}
+% \begin{tabular}{cll}
+% \emph{symbol} & \emph{command} & \emph{description} \\ \hline
+% $\dagger$ & |$\dagger$| & dagger\\
+% $\ddagger$ & |$\ddagger$| & double dagger\\
+% $\mathparagraph$ & |$\mathparagraph$| & paragraph mark\\
+% $\mathsection$ & |$\mathsection$| & section mark\\
+% $\mathdollar$ & |$\mathdollar$| & dollar\\
+% $\lbrace$ & |$\lbrace$| & left brace\\
+% $\rbrace$ & |$\rbrace$| & right brace\\
+% \end{tabular}
+% \end{center}
+% \medskip
+%
+% \textbf{Labeling restriction or protease cutting sites:}\\
+% If a label is needed that points between two residues, e.\,g.
+% for showing restriction sites, simply use the feature style
+% |{restriction[|\meta{color}|]}|. This will show a filled
+% triangle with the tip right between the residues to be labeled,
+% e.\,g. |\feature{top}{1}{25..26}{restriction[Blue]}{EcoR I}|.
+%
+% \medskip
+%
+% \textbf{Boxes:}\\
+% Boxed text is printed using the parameter |{box:|\meta{text}|}|.
+% By default black letters in a white framed box are displayed. In
+% order to change these colors optional parameters can be included
+% in the argument:
+% \medskip
+%
+% \quad|{box[|\meta{framecolor,boxcolor}|][|\meta{length}|]:|\meta{text}|[|\meta{textcolor}|]}|.
+% \medskip
+%
+% If the box frame and fill colors are the same it is sufficient to
+% use only this one color as an argument in the command. The optional
+% parameter \meta{length} defines the thickness of the box frame. If
+% this parameter is not set in the command the value from the
+% |\featurerule{|\meta{length}|}| command (see below) is used.
+% \medskip
+%
+% Examples:
+% \medskip
+%
+% \quad|{box[Blue]:$\alpha$~helix[Yellow]}|
+% \smallskip
+%
+% \quad|{box[Blue,Red]:$\alpha$~helix[Yellow]}|
+% \smallskip
+%
+% \quad|{box[Blue,Red][2pt]:$\alpha$~helix[Yellow]}|
+% \medskip
+%
+% \medskip
+%
+% \textbf{Horizontal bars and arrows:}\\
+% For displaying bars and arrows a simple selection scheme
+% consisting of three consecutive characters is
+% used as the \meta{labelstyle} parameter. Each bar or arrow is
+% defined by its left end, the middle part, and the right end.
+% The following table gives some examples for the construction
+% of arrows and bars.
+%
+% \begin{center}
+% \begin{tabular}{cl}
+% middle & \\
+% \hbox to 1.6cm{\hss left end} \raisebox{1mm}{$\downarrow$} \hbox to 1.6cm{right end} & \\ \hline
+% |---|& plain bar \\
+% |===|& double bar \\
+% |-->|& right arrow \\
+% |'->|& right arrow with up hook \\
+% |<-|$\vert$ & left \emph{maps to} arrow \\
+% |<-o| & left arrow with ball at right end\\
+% |<=>|& double arrow, two heads \\
+% |,-,|& plain bar with down hooks\\
+% $\vert$|=|$\vert$ & double bar with vertical ends\\
+% \end{tabular}
+% \end{center}
+%
+% All combinations of the left-end-characters
+% (|-=<',|$\vert$o), the middle-characters (|-=|),
+% and the right-end-characters (|-=>',|$\vert$o) are
+% allowed and produce the desired arrow or bar.
+% The color is changed as described above.
+% \label{Lfeaturerule} The thickness can be generally
+% set by the separate command |\featurerule{|\meta{length}|}|
+% with any \TeX{} measure as \meta{length}, e.\,g.\ |\featurerule{3pt}|.
+% This value is then used for all arrows, bars, and boxes (see above)
+% throughout the alignment. If an individual thickness for a
+% particular arrow should be set one can add an optional
+% parameter to the \meta{labelstyle} parameter, e.g.
+% |{o->[Red][1mm]}|.
+%
+% In \TeXshade{} versions before v1.9, the original \LaTeX{}-arrows
+% were used. These have now been replaced by the more modern looking
+% arrows with scalable line thickness. If the classical look is
+% requested, use |v| instead of |<| or |>| in the arrow definition,
+% e.\,g.\, |{--v}|, to get them back. The new arrow style makes use of
+% of the AMS math symbol font (amssymb.sty). Thus, in order to
+% display the arrow heads correctly make sure that this style is
+% present on your system (usually it is in a common \LaTeX{} installation).
+% \medskip
+%
+% \textbf{Sequence translations:}\\
+% With the option |{translate}|, sequence stretches can be
+% translated from nucleotide to peptide sequences as well as
+% backtranslations from peptide to nucleotide sequences are
+% possible. Default setting for the translations is the standard
+% genetic code. Of course, the codons can be re-defined by the
+% user. The command \label{Lcodon}
+% |\codon{|\meta{amino acid}|}{|\meta{triplet1, \ldots, triplet n}|}|
+% has been implemented for this issue. The usage is simple. Replace
+% \meta{amino acid} by the single letter code of the amino acid
+% to be defined and add a list of triplets for this residue.
+% Example definition for the amino acid \emph{alanine}:
+% \medskip
+%
+% \quad |\codon{A}{GCA,GCG,GCC,GCT,GCU,GCN}|
+% \medskip
+%
+% Note the last triplet in the list. It contains an ambiguity code
+% |N| which stands for \emph{any} nucleotide. This triplet has been
+% added at the last position because the last triplet is used
+% for the generation of the backtranslated nucleotide sequence from
+% a peptide. Two files are included in the \TeXshade{}
+% distribution as examples (|standard.cod, ciliate.cod|). If you
+% want to define a new genetic code store your commands in a file
+% like the examples. Such files with the suffix |.cod| can be
+% loaded in the \TeXshade{} environment by \label{Lgeneticcode}
+% |\geneticcode{|\meta{filename}|}|, e.\,g. |\geneticcode{ciliate}|.
+% Do not designate the suffix |.cod| in \meta{filename}. Please
+% note, when inspecting the example files, that only the exchanges
+% compared to the standard code need to be defined in a new genetic code file.
+%
+% When DNA sequences are translated to protein the resulting amino
+% acids are aligned to the second nucleotide of each triplet.
+% It is more difficult to produce a satisfactory display of
+% backtranslated nucleotide sequences due to the lack of space.
+% You need thrice as much space than the original peptide sequence,
+% because single letter amino acid code is translated to a triplet
+% code. Therefore, the user can choose from five display styles
+% for backtranslations depending on personal preferences:
+% \medskip\label{Lbacktranslabel}
+%
+% \quad |\backtranslabel[|\meta{size}|]{|\meta{style}|}|, with
+% \medskip
+%
+% \begin{tabbing}
+% \qquad\qquad|{|\meta{style}|}|\ \= = |{horizontal}|\\
+% \> = |{alternating}|\\
+% \> = |{zigzag}|\\
+% \> = |{oblique}|\\
+% \> = |{vertical}|
+% \end{tabbing}
+%
+% \meta{size} can be any \TeX{} size from |tiny| up to |Huge|, but
+% |tiny| is recommended (and default setting). Translations
+% can be colored as all other labels, see above.
+% \medskip
+%
+% \textbf{Bar graphs and color scales:}\label{Lgraphs}\\
+% Sequence related numeral data, such as hydropathy or solvent
+% accessibility data etc., can be shown in a feature line as bar graphs
+% or color scales. The data are (a) pre-defined or calculated by
+% \TeXshade{} due to amino acid properties or conservation, (b) are
+% provided in a separate file or (c) may be entered by hand in the
+% |\feature| command.
+%
+% (a) Currently, three different
+% properties can be plotted, i.e. |hydrophobicity|, |molweight|, and
+% |charge|. Further, the level of sequence conservation at the given
+% protein sequence stretch can be shown (|conservation|).
+%
+% (b) The format of a data file is simple: every value must
+% appear in a separate line. Numbers and the Java-typical `NaN' for
+% `Not a Number' are permitted. Comments are allowed, because \TeXshade{}
+% ignores all lines starting with a letter except `NaN' lines (avoid
+% `|-|' as the first
+% character of a comment line as this is interpreted as a negative number).
+% Make sure that there are as many values as positions defined as the
+% sequence stretch in the feature command.
+% \TeXshade{} will read this file and determine the minimal and maximal
+% values. These data are then normalized for plotting.
+% Due to \TeX's limited calculation capabilities no values above 10\,737
+% are allowed and the difference between minimum and maximum must not
+% exceed this very number. Values below 0.001 may be susceptible to major
+% rounding errors. Thus, try to provide your data already normalized to
+% moderate scales, e.g. 0.0\,--\,1.0 or -100\,--\,100.
+
+% (c) Data which is
+% directly entered in the |\feature| command must be normalized to integer
+% values with a maximal difference of 100 between the highest and lowest
+% value, e.g. -50\,--\,50 or 0\,--\,100.
+%
+% For (b) and (c), the range to be plotted can be set by hand as an optional parameter
+% in the |\feature| command. This can be necessary when the data file
+% contains values between e.g. $-0.44$ and $0.87$. Without help \TeXshade{}
+% will assume $-0.44$ as minimum and $0.87$ as maximum. But if the actual
+% range to be plotted should be $-1.0$\,--\,$1.0$ this needs to be set
+% manually, see examples below. Be aware of the fact, that if you
+% define a scale by hand, which is more narrow than the values of the
+% input, this will stretch the bars accordingly. It is NOT recommended
+% to use this method for stretching bars vertically. Instead another
+% command has been introduced.
+% \label{Lbargraphstretch}\label{Lcolorscalestretch}
+% The plotted bars can be stretched by a factor if the appearance is
+% not as desired: |\bargraphstretch{|\meta{factor}|}|. Here, the factor
+% is multiplied with the bar length, e.g |\bargraphstretch{2}| will double
+% the bar height, |\bargraphstretch{0.5}| will make them half as high.
+% Similarly, color scales can be stretched vertically with
+% |\colorscalestretch{|\meta{factor}|}|.
+%
+% The default color of bar graphs is gray and can be changed by an
+% optional parameter at the end of the |label| definition. Further, an optional
+% background color can be chosen for the bars. Doing so will visualize
+% the maximal bar extension.
+%
+% Default for
+% color scales is a 5\% gray scale from very light gray to black (|Gray|).
+% More colorful scales have been implemented, i.e. |BlueRed|, |RedBlue|, |GreenRed|,
+% |RedGreen|, |ColdHot| and |HotCold|, the latter two being particularly
+% useful for ranges from negative to positive values.
+%
+% The general format of this feature label definition for bar graphs is:
+% \medskip
+%
+% \quad |{bar[|\meta{min}|,|\meta{max}|]:|\meta{properties/file/data}|[|\meta{color(,bgcolor)}|]}|
+% \medskip
+%
+% and for color scales:
+% \medskip
+%
+% \quad|{color[|\meta{min}|,|\meta{max}|]:|\meta{properties/file/data}|[|\meta{scale}|]}|
+% \medskip
+%
+% Some examples:
+% \medskip
+%
+% \qquad |{bar:conservation}|
+% \medskip
+%
+% \qquad |{bar:hydrophobicity}|
+% \medskip
+%
+% \qquad |{bar:charge[Red]}|
+% \medskip
+%
+% \qquad |{bar:molweight[Red,Gray10]}|
+% \medskip
+%
+% \qquad |{bar:10,20,30,40,50[Red]}|
+% \medskip
+%
+% \qquad |{bar[-20,40]:-10,0,10,20,30[Red,Gray10]}|
+% \medskip
+%
+% \qquad |{bar:data.txt}|
+% \medskip
+%
+% \qquad |{bar[-10,10]:data.txt[Red,Gray10]}|
+% \medskip
+%
+% \qquad |{color:conservation[BlueRed]}|
+% \medskip
+%
+% \qquad |{color:hydrophobicity[GreenRed]}|
+% \medskip
+%
+% \qquad |{color:charge}|
+% \medskip
+%
+% \qquad |{color:molweight}|
+% \medskip
+%
+% \qquad |{color[-10,10]:data.txt[ColdHot]}|
+% \medskip
+%
+% \qquad |{color[-0.1,0.1]:otherdata.txt[ColdHot]}|
+% \medskip
+%
+% See also the example output in section \ref{graphs} on page
+% \pageref{graphs}.
+%
+% \medskip
+%
+% \textbf{No graphical label, only text:}\\
+% If no graphical label is
+% wanted the fourth parameter of |\feature| can be empty
+% braces.
+% \medskip
+%
+% Finally, the fifth parameter of the |\feature| command contains
+% the descriptive text
+% for the labeled region. Type whatever you want incl. symbols and
+% math chars. The text field can also contain sequence translations.
+% In this case just set \meta{text} = |{translate}|. There is a
+% command for setting the size and style of backtranslated sequences
+% in the feature \meta{text} which corresponds to the one
+% described above: \label{Lbacktranstext}
+% \medskip
+%
+% \quad |\backtranstext[|\meta{size}|]{|\meta{style}|}|
+% \medskip
+%
+% Again, the color can be set by an
+% optional parameter appended to the text. For how to change the
+% font size of text or symbols in the feature style line
+% (|featurestyles|) or the in descriptive text line (|features|)
+% see section \ref{Lsetsize}, page \pageref{Lsetsize}.
+%
+%
+% Examples for the appearance of features are given in the
+% overview section (\ref{over}), see:
+% \medskip
+%
+% \emph{similarity mode} (\ref{similar}): fill-character; here, only
+% one position is labeled. It is also possible to label a longer
+% stretch, then, the character is printed several times to
+% fill the specified region.
+%
+% \quad|\feature{top}{1}{93..93}{fill:$\downarrow$}{first...}|
+%
+% \quad|\feature{bottom}{1}{98..98}{fill:$\uparrow$}{second...}|
+% \medskip
+%
+% \emph{diversity mode} (\ref{diverse}): frames, text only
+%
+% \quad|\feature{top}{1}{77..109}{}{AQP2 species variants}|
+%
+% \quad|\frameblock{1}{82..82,106..106}{Red[1pt]}|
+% \medskip
+%
+% \emph{functional mode} (\ref{func}): bar graph, color scale, tinting, box, arrow,
+% translation, brace, helix
+%
+% \quad|\feature{top}{3}{153..165}|
+%
+% \quad\quad\quad\quad\quad|{bar[-50,50]:-50,-45,-40,...,40,45,50}{}|
+% \medskip
+%
+% \quad|\feature{top}{3}{167..186}|
+%
+% \quad\quad\quad\quad\quad|{color:5,10,15,...,90,95,100[ColdHot]}{}|
+% \medskip
+%
+% \quad |\feature{top}{1}{158..163}{brace}{tinted}|
+%
+% \quad|\tintblock{1}{158..163}|
+% \medskip
+%
+% \quad|\feature{top}{1}{138..157}|
+%
+% \quad\quad\quad\quad\quad|{box[Blue,Red][0.5pt]:$\alpha$~helix[Yellow]}|
+%
+% \quad\quad\quad\quad\quad|{transmembrane domain 4}|
+%
+% \quad|\feature{top}{1}{164..170}{o->[Red]}{trans. dom. 5}|
+%
+% \quad|\feature{top}{1}{158..163}{translate[Blue]}{}|
+%
+% \quad|\backtranslabel{oblique}|
+%
+% \quad|\feature{bottom}{1}{158..163}|
+%
+% \quad\quad\quad\quad\quad|{brace[Blue]}{loop D[Blue]}|
+% \medskip
+%
+% \quad|\feature{top}{1}{138..157,164..170}{helix}{membr.}|
+%
+% \quad|\feature{top}{1}{158..163}{---}{loop}|
+%
+% \quad|\featurerule{1mm}|
+% \medskip
+%
+% \emph{bar graphs and color scales} (\ref{graphs}): sequence conservation,
+% charge, molecular weight, hydrophobicity
+%
+% \quad|\feature{ttop}{1}{138..170}{bar:conservation}{}|
+%
+% \quad|\feature{top}{1}{138..170}{color:charge}{}|
+%
+% \quad|\feature{bottom}{1}{138..170}|
+%
+% \quad\quad\quad\quad\quad|{color:molweight[ColdHot]}{}|
+%
+% \quad|\feature{bbottom}{1}{138..170}|
+%
+% \quad\quad\quad\quad\quad|{bar:hydrophobicity[Red,Gray10]}{}|
+% \medskip
+%
+% \subsubsection{Including secondary structure information}
+%
+% \label{structure}
+%
+% \label{LincludeDSSP}
+% \label{LincludeSTRIDE}
+% \label{LincludePHDsec}
+% \label{LincludePHDtopo}
+% \label{LincludeHMMTOP}
+% The DSSP [7], STRIDE [8], PHD [9] and HMMTOP [10] algorithms produce
+% secondary protein structure predictions. PHD files contain both,
+% secondary structure information and topology data. This information can be
+% displayed in an alignment by one of the commands:
+% \bigskip
+%
+% \begin{tabular}{ll}
+% |\includeDSSP| & sec. structure calculated by DSSP\\
+%
+% |\includeSTRIDE| & sec. structure calculated by STRIDE \\
+%
+% |\includePHDsec| & sec. structure calculated by PHD \\
+%
+% |\includePHDtopo| & topology data calculated by PHD \\
+%
+% |\includeHMMTOP| & topology data calculated by HMMTOP \\
+% \end{tabular}
+% \bigskip
+%
+% The syntax is |\includeDSSP{|\meta{seqref}|}{|\meta{filename}|}|,
+% with |seqref| indicating the number or name of the sequence for which
+% the secondary structure data is calculated and |filename| designating the
+% corresponding structure file to be included.
+%
+% Several types of secondary structures are predicted by these
+% programs; in order to designate them in \TeXshade{} use the names
+% from the right column:
+%
+% \begin{center}
+% \begin{tabular}{ll}
+% secondary structure & designation\\[3mm]
+% \emph{DSSP and STRIDE} & \\[2mm]
+% 4-helix ($\alpha$-helix) & |alpha| \\
+% isolated $\beta$-bridge & |bridge| \\
+% extended strand ($\beta$-strand) & |beta| \\
+% 3-helix (3$_{10}$-helix) & |3-10| \\
+% 5-helix ($\pi$-helix) & |pi| \\
+% H-bonded turn & |turn| \\[3mm]
+% \emph{PHDsec} & \\[2mm]
+% helix & |alpha| \\
+% sheet & |beta| \\[3mm]
+% \emph{PHDtopo and HMMTOP} & \\[2mm]
+% internal region & |internal| \\
+% external region & |external| \\
+% transmembrane domain & |TM| \\
+% \end{tabular}
+% \end{center}
+%
+% \label{LshowonDSSP}
+% \label{LshowonSTRIDE}
+% \label{LshowonPHDsec}
+% \label{LshowonPHDtopo}
+% \label{LshowonHMMTOP}
+% \label{LhideonDSSP}
+% \label{LhideonSTRIDE}
+% \label{LhideonPHDsec}
+% \label{LhideonPHDtopo}
+% \label{LhideonHMMTOP}
+% By default all three types of helices and the strands are
+% displayed whereas turns and bridges are skipped. If it is
+% desired to shown them as well, call for example |\shownonDSSP{bridge,turn}|.
+% In analogy to this example all structure features can be activated
+% in DSSP, STRIDE, PHDsec, PHDtopo and HMMTOP. In order to hide
+% certain structure types use for example |\hideonDSSP{3-10,pi}|.
+%
+% The DSSP format has two columns of sequence numberings. The first
+% column is consecutive, whereas the second column contains the
+% actual sequence numbering. This can be different from the first
+% column when sequence parts are missing in the DSSP file. One can
+% choose which column will be read by \TeXshade{} by
+% \label{LfirstcolumnDSSP} \label{LsecondcolumnDSSP}
+% `|\firstcolumnDSSP|' and |\secondcolumnDSSP|'. The second column
+% is still default.
+%
+% The HMMTOP algorithm can present its results as plain text or
+% as HTML---plain text needs to be selected here. Further, the
+% output can be formatted in a single line or in an extended form
+% (see the HMMTOP documentation). Both can be read and interpreted
+% by \TeXshade{}. Importantly, HMMTOP files can contain topology
+% predictions of multiple sequences. \TeXshade{} tries to find
+% the correct data based on the respective sequence name. If the
+% sequence name is not found in the file, the first topology data
+% is used. Using an optional parameter (number of the prediction
+% in the file or name) one can define which data from the file is
+% to be used:
+% \medskip
+%
+% |\includeHMMTOP{|\meta{seqref in texshade}|[|\meta{seqref in file}|]{|\meta{filename}|}|
+% \medskip
+%
+% PHD predictions: when starting the PHD software do not
+% restrict the prediction to secondary structure or topology alone.
+% This leads to changes in the PHD output file which are not
+% correctly interpretable by \TeXshade{} due to ambiguities. There
+% is no way around it---thus, run the full prediction.
+%
+% Now, some information on how \TeXshade{} extracts and displays
+% secondary structure features. In short, it is a two step process.
+% First, \TeXshade{} analyzes the secondary structure file and
+% extracts all necessary data. This data is converted into a
+% format which is readable and processable by \TeXshade{} using the
+% |feature| command (see \ref{feature}). This command allows one to
+% label sequence stretches graphically. For a detailed explanation
+% see the indicated reference. A list of feature commands is saved
+% in a file with the ending `|.sec|' for DSSP, STRIDE and PHDsec
+% or `|.top|' for PHDtopo. Then, in a second step, this file is loaded
+% again and executed. When \TeXshade{} encouters this file a
+% second time, i.\,e. in a second \TeX{} run, it uses the already
+% existing file for the output. The great advantage of this method
+% is its flexibility. Due to the simple reason that the feature
+% file can be edited in the meantime. Thus, the user has the
+% ability to change the computer generated file according to his
+% personal needs. On the other hand, one can force \TeXshade{} to
+% write a new file every time by the optional argument |[make new]| in the
+% include command, e.\,g. |\includePHDsec[make new]{1}{AQP.phd}|.
+%
+% \label{Lappearance}
+% Finally, the appearance of the feature labels can be assigned by
+% the command
+%
+% |\appearance{|\meta{filetype}|}{|\meta{type}|}{|\meta{position}|}{|\meta{labelstyle}|}{|\meta{text}|}|.
+%
+% Here, \meta{filetype} stands for one of the following secondary structure
+% file types: |DSSP|, |STRIDE|, |PHDsec|, |PHDtopo| or |HMMTOP| and
+% \meta{type} designates the secondary structure type as shown in
+% the right column of the table above. The other
+% arguments \meta{position}, \meta{labelstyle} and \meta{text}
+% are almost as described in \ref{feature}.
+% \label{Lnumcount}
+% \label{Lalphacount}
+% \label{LAlphacount}
+% \label{Lromancount}
+% \label{LRomancount}
+% One further possibility
+% is to include internal counters for each secondary structure type.
+% Just add one of the following commands
+% to the text in the feature description.
+%
+% \begin{center}
+% \begin{tabular}{ll}
+% \emph{counter} & \emph{display} \\[2mm]
+% |\numcount| & 1, 2, 3 \ldots \\
+% |\alphacount| & a, b, c \ldots \\
+% |\Alphacount| & A, B, C \ldots \\
+% |\romancount| & i, ii, iii \ldots \\
+% |\Romancount| & I, II, III \ldots \\
+% \end{tabular}
+% \end{center}
+%
+% Examples:
+%
+% \quad|\appearance{DSSP}{alpha}{ttop}|
+%
+% \quad\quad\quad\quad\quad\quad\quad|{-->}{$\alpha$-helix~\Alphacount}|
+%
+% \quad|\appearance{PHDtopo}{TM}{bottom}|
+%
+% \quad\quad\quad\quad\quad\quad\quad|{box[Blue]:TM\numcount[Yellow]}{}|
+%
+%
+% \subsection{Displaying and building legends}
+%
+% \label{Lshowlegend}\label{Lhidelegend}\label{Lmovelegend}
+% \label{Lgermanlanguage}\label{Lenglishlanguage}\label{Llegendcolor}
+% \label{Lspanishlanguage}
+% For each predefined shading mode \TeXshade{} can print an appropriate
+% legend to explain the used
+% shading colors. The commands |\showlegend| and |\hidelegend|
+% display or clear the legend at the end of the alignment.
+% The legend is displayed by default beneath the first residue
+% of the last alignment line. The location can be changed by
+% |\movelegend{|\meta{x-offset}|}{|\meta{y-offset}|}|. Both
+% parameters require a \TeX{} length, e.\,g. |\movelegend{5cm}{-2cm}|
+% moves the legend 5\,cm to the right and 2\,cm up.
+%
+% The language for the descriptions is english by default;
+% if the |\german.sty| package is active legend texts are in
+% german. So far, german, spanish and english are implemented. With the
+% commands |\germanlanguage|, |\spanishlanguage| and |\englishlanguage|
+% switching between the languages
+% is made possible. For the addition of other languages contact me.
+% Finally, the color of the describing legend texts can be set
+% with the command |\legendcolor{|\meta{color}|}|.
+%
+% User defined legends are easily built with the following command
+% \label{Lshadebox}|\shadebox{|\meta{color}|}|. Use this command outside
+% the \TeXshade{} environment, e.\,g. in the text or in the caption. As
+% \meta{color} any color can be designated (see section \ref{colors}) or
+% one of the following parameters:
+%
+% \begin{itemize}
+% \item |nomatch| = the color used for nonmatching residues
+%
+% \item |similar| = the color used for similar residues
+%
+% \item |conserved| = the color used for conserved residues
+%
+% \item |allmatch| = the color used for the case that all residues
+% match (if |\allmatchspecial| is active)
+%
+% \end{itemize}
+%
+% The command simply prints a shaded box in the specified color
+% then a describing text can be appended. Examples:
+% \medskip
+%
+% \quad|\shadebox{nomatch}---nonmatching residues|
+%
+% \quad|\shadebox{similar}: similar residues|
+%
+% \quad|\shadebox{conserved}~conserved residues|
+%
+% \quad|\shadebox{Yellow}\quad PKA phosphorylation sites|
+%
+%
+%
+% \subsection{Adding captions to the alignment}
+%
+% Since \TeXshade{} v1.5 captions can be added to the alignment.
+% So far, captions were difficult to use when the alignment was
+% bigger than one page and therefore did not fit into a
+% figure environment. The \TeXshade{} captions behave exactly as
+% normal figure captions. They
+% adopt their style, use the figure counter number and appear in
+% the list of figures as any other figure.
+%
+% The usage is slightly different from normal captions but
+% intuitive: \label{Lshowcaption}
+% \medskip
+%
+% \quad |\showcaption[|\meta{position}|]{|\meta{text}|}|
+% \medskip
+%
+% The optional \meta{position} tells \TeXshade{} to put the caption on
+% |top| or at the |bottom| of the alignment. If nothing is stated here
+% the caption will appear at the bottom. The parameter
+% \meta{text} just holds the caption text as in the normal |\caption|.
+% The command can be used at any position within the |texshade|
+% environment. A simple example would be:
+% \medskip
+%
+% \quad |\showcaption{A beautiful \TeXshade{} alignment.}|
+% \medskip
+%
+% \label{Lshortcaption}
+% In order to show a short version of the caption in the
+% "List of Figures" the |\shortcaption{|\meta{short caption text}|}|
+% command can be used.
+%
+% \subsection{Font handling}
+%
+% \subsubsection{Changing font styles}
+%
+% \label{Lsetfamily}\label{Lsetseries}
+% \label{Lsetshape}\label{Lsetsize}
+% The font styles for the numbering, the sequence names,
+% the sequence residues, the descriptive feature texts
+% and the legends can be changed by several commands.
+% \medskip
+%
+% \quad|\setfamily{|\meta{text}|}{|\meta{family}|}|
+%
+% \quad|\setseries{|\meta{text}|}{|\meta{series}|}|
+%
+% \quad|\setshape{|\meta{text}|}{|\meta{shape}|}|
+%
+% \quad|\setsize{|\meta{text}|}{|\meta{size}|}|
+% \medskip
+%
+% The first parameter selects the text whose style is to be
+% changed. Possible first parameters are
+% |numbering|, |names|, |residues|, |features|, |featurestyles| and |legend|.
+% \medskip
+%
+% The style is set by the second parameter:
+%
+% \begin{center}
+% \begin{tabular}{lll}
+% command & \meta{2. parameter} & \\
+% \hline
+% |\setfamily| & |rm| & modern roman font family \\
+% & |sf| & sans serif font family \\
+% & |tt| & typewriter font family \\ \hline
+% |\setseries| & |bf| & bold face series \\
+% & |md| & normal series \\ \hline
+% |\setshape| & |it| & italics shape \\
+% & |sl| & slanted shape \\
+% & |sc| & small capitals shape \\
+% & |up| & upright shape \\ \hline
+% |\setsize| & |tiny| & the known \TeX{} sizes \\
+% & |scriptsize| & \\
+% & |footnotesize| & \\
+% & |small| & \\
+% & |normalsize| & \\
+% & |large| & \\
+% & |Large| & \\
+% & |LARGE| & \\
+% & |huge| & \\
+% & |Huge| & \\ \hline
+% \end{tabular}
+% \end{center}
+%
+% Example: |\setfamily{features}{it} \setseries{features}{bf}|
+% \medskip
+%
+% \label{Lsetfont}
+% With the command
+% \medskip
+%
+% \quad|\setfont{|\meta{text}|}{|\meta{family}|}{|\meta{series}|}{|\meta{shape}|}{|\meta{size}|}|
+% \medskip
+%
+% all four font attributes of one \meta{text} can be changed
+% simultaneously. The order of the parameters is as indicated.
+% \medskip
+%
+% Example: |\setfont{features}{rm}{it}{bf}{normalsize}|
+% \medskip
+%
+% Further, short commands are provided to change single font
+% attributes quickly. The following commands set attributes
+% of feature texts.
+% \medskip
+% \enlargethispage{\baselineskip}
+%
+% \quad |\featuresrm| \quad |\featurestiny| \label{Lfeaturesrm}
+%
+% \quad |\featuressf| \quad |\featuresscriptsize|
+%
+% \quad |\featurestt| \quad |\featuresfootnotesize|
+%
+% \quad |\featuresbf| \quad |\featuressmall|
+%
+% \quad |\featuresmd| \quad |\featuresnormalsize|
+%
+% \quad |\featuresit| \quad |\featureslarge|
+%
+% \quad |\featuressl| \quad |\featuresLarge|
+%
+% \quad |\featuressc| \quad |\featuresLARGE|
+%
+% \quad |\featuresup| \quad |\featureshuge|
+%
+% \quad | | \quad |\featuresHuge|
+% \medskip
+%
+% Corresponding sets are provided for the
+% numbering (|\numberingrm| etc.),
+% featurestyles (|featurestylesrm| etc.), names (|\namesrm| etc.),
+% residues (|\residuesrm| etc.) and
+% legend texts (|legendrm| etc.).
+%
+%
+% \subsubsection{Using PostScript fonts}
+%
+% As already mentioned \TeXshade{} makes intensive use of
+% \textsc{PostScript} for shading. Now, that
+% \textsc{PostScript} output is active anyway, including \textsc{PostScript}
+% fonts is very easy. Just declare in the document header
+% \medskip
+%
+% \quad |\usepackage{|\meta{PS-font}|}|.
+% \medskip
+%
+%
+% The typewriter font of \TeX{} is always a topic of discussions.
+% By including the package |\usepackage{courier}| \TeX's
+% typewriter font is replaced by the widely accepted \textsc{Courier}.
+% Have a look into the directory |..texinputs:latex:psnfss|; there,
+% some styles are located which exchange the common \TeX{} fonts by
+% \textsc{PostScript} fonts, e.\,g.\ |avant.sty|, |bookman.sty|,
+% |chancery.sty|, |courier.sty|, |helvet.sty| or |utopia.sty|.
+% Depending on the style used the |\rmdefault|-, |\sfdefault|-,
+% and |\ttdefault| fonts are substituted partly or completely.
+% Thus, |courier.sty| for instance exchanges only the typewriter font,
+% whereas |bookman.sty| sets \textsc{Bookman} as |\rmdefault|,
+% \textsc{Avantgarde} as |\sfdefault| and \textsc{Courier} as
+% |\ttdefault|.
+%
+% For further information see \textsc{Tomas Rokicki}'s
+% |dvips| manual [11].
+%
+%
+%
+%
+% \subsection{Goodies---molweight and charge}
+%
+% \label{molcharge}
+%
+% \label{Lmolweight}\label{Lcharge}
+% During the process of sequence setting \TeXshade{}
+% sums up the molecular weight and charge of the
+% aligned proteins. This data can be accessed by the
+% following two commands.
+% \medskip
+%
+% \quad|\molweight{|\meta{seqref}|}{|\meta{Da/kDa}|}|
+%
+% \quad|\charge{|\meta{seqref}|}{|\meta{i/o/N/C}|}|
+% \medskip
+%
+% The first parameter \meta{seqref} selects the sequence. The
+% second parameter in the |\molweight| command allows one to
+% switch the units between Dalton (|Da|) and kilo-Dalton
+% (|kDa|). The |\charge| command needs the second parameter
+% for the correct consideration of the charged protein termini.
+% Thus, `|i|' refers to internal sequences, `|o|' to the
+% overall charge, `|N|' to N-terminal sequence parts, and
+% `|C|' to the C-terminal end of a protein.
+% \medskip
+%
+% Example: \quad Charge: |\charge{1}{o}|; Weight: |\molweight{1}{Da}|
+%
+%
+% \newpage
+% \section{The PostScript color selection scheme}
+%
+% \label{colors}
+%
+% \textsc{PostScript} provides 64 standard colors. All these
+% colors are predefined in the |color.sty|. Each color
+% has a pictorial name such as |Bittersweet| and a distinct
+% composition, e.\,g.\ 0\% cyan + 75\% magenta + 100\% yellow +
+% 24\% black---the so-called CMYK scheme. \TeXshade{} enhances this
+% color scheme by gray scales in 5\% steps.
+% The following colors and grays can be used in \TeXshade{} by
+% simply declaring the name of the color in the respective
+% command, e.\,g.\ |\consensuscolors|:
+%
+%
+% \begin{footnotesize}
+% \begin{tabbing}
+% \emph{name}\hspace{2.5cm}\= \emph{CMYK}\hspace{1.8cm}
+% \=\emph{name}\hspace{2.5cm}\= \emph{CMYK}\\
+%
+% GreenYellow \>{0.15,0,0.69,0}\>Yellow \>{0,0,1,0}\\
+% Goldenrod \>{0,0.10,0.84,0}\>Dandelion \>{0,0.29,0.84,0}\\
+% Apricot \>{0,0.32,0.52,0}\> Peach \>{0,0.50,0.70,0}\\
+% Melon \>{0,0.46,0.50,0}\> YellowOrange \>{0,0.42,1,0}\\
+% Orange \>{0,0.61,0.87,0}\>BurntOrange \>{0,0.51,1,0}\\
+% Bittersweet \>{0,0.75,1,0.24}\> RedOrange \>{0,0.77,0.87,0}\\
+% Mahagony \>{0,0.85,0.87,0.35}\>Maroon \>{0,0.87,0.68,0.32}\\
+% BrickRed \>{0,0.89,0.94,0.28}\> Red \>{0,1,1,0}\\
+% OrangeRed \>{0,1,0.50,0}\> RubineRed \>{0,1,0.13,0}\\
+% WildStrawberry\>{0,0.96,0.39,0}\> Salmon \>{0,0.53,0.38,0}\\
+% CarnationPink \>{0,0.63,0,0}\> Magenta \>{0,1,0,0}\\
+% VioletRed \>{0,0.81,0,0}\> Rhodamine \>{0,0.82,0,0}\\
+% Mulberry \>{0.34,0.90,0,0.02}\> RedViolet \>{0.07,0.90,0,0.34}\\
+% Fuchsia \>{0.47,0.91,0,0.08}\>Lavender \>{0,0.48,0,0}\\
+% Thistle \>{0.12,0.59,0,0}\>Orchid \>{0.32,0.64,0,0}\\
+% DarkOrchid \>{0.40,0.80,0.20,0}\> Purple \>{0.45,0.86,0,0}\\
+% Plum \>{0.50,1,0,0}\>Violet \>{0.79,0.88,0,0}\\
+% RoyalPurple \>{0.75,0.90,0,0}\>BlueViolet \>{0.86,0.91,0,0.04}\\
+% Periwinkle \>{0.57,0.55,0,0}\> CadetBlue \>{0.62,0.57,0.23,0}\\
+% CornflowerBlue\>{0.65,0.13,0,0}\>MidnightBlue \>{0.98,0.13,0,0.43}\\
+% NavyBlue \>{0.94,0.54,0,0}\>RoyalBlue \>{1,0.50,0,0}\\
+% Blue \>{1,1,0,0}\>Cerulean \>{0.94,0.11,0,0}\\
+% Cyan \>{1,0,0,0}\> ProcessBlue \>{0.96,0,0,0}\\
+% SkyBlue \>{0.62,0,0.12,0}\>Turquoise \>{0.85,0,0.20,0}\\
+% TealBlue \>{0.86,0,0.34,0.02}\>Aquamarine \>{0.82,0,0.30,0}\\
+% BlueGreen \>{0.85,0,0.33,0}\> Emerald \>{1,0,0.50,0}\\
+% JungleGreen \>{0.99,0,0.52,0}\>SeaGreen \>{0.69,0,0.50,0}\\
+% Green \>{1,0,1,0}\>ForestGreen \>{0.91,0,0.88,0.12}\\
+% PineGreen \>{0.92,0,0.59,0.25}\> LimeGreen \>{0.50,0,1,0}\\
+% YellowGreen \>{0.44,0,0.74,0}\>SpringGreen \>{0.26,0,0.76,0}\\
+% OliveGreen \>{0.64,0,0.95,0.40}\>RawSienna \>{0,0.72,1,0.45}\\
+% Sepia \>{0,0.83,1,0.70}\>Brown \>{0,0.81,1,0.60}\\
+% Tan \>{0.14,0.42,0.56,0}\>\>\\
+% White (Gray0) \>{0,0,0,0}\>Black (Gray100) \>{0,0,0,1}\\
+% Gray5 \>{0,0,0,0.05}\>Gray10 \>{0,0,0,0.10}\\
+% Gray15 \>{0,0,0,0.15}\>Gray20 \>{0,0,0,0.20}\\
+% Gray25 \>{0,0,0,0.25}\> Gray30 \>{0,0,0,0.30}\\
+% LightGray \>{0,0,0,0.33}\> Gray35 \>{0,0,0,0.35}\\
+% Gray40 \>{0,0,0,0.40}\>Gray45 \>{0,0,0,0.45}\\
+% Gray50 \>{0,0,0,0.50}\> Gray \>{0,0,0,0.50}\\
+% Gray55 \>{0,0,0,0.55}\> Gray60 \>{0,0,0,0.60}\\
+% Gray65 \>{0,0,0,0.65}\> DarkGray \>{0,0,0,0.66}\\
+% Gray70 \>{0,0,0,0.70}\> Gray75 \>{0,0,0,0.75}\\
+% Gray80 \>{0,0,0,0.80}\>Gray85 \>{0,0,0,0.85}\\
+% Gray90 \>{0,0,0,0.90}\> Gray95 \>{0,0,0,0.95}\\
+% LightGreenYellow\>{0.08,0,0.35,0}\> LightYellow \>{0,0,0.50,0}\\
+% LightGoldenrod \>{0,0.05,0.42,0}\> LightDandelion\> {0,0.15,0.42,0}\\
+% LightApricot \>{0,0.16,0.26,0}\> LightPeach \>{0,0.25,0.35,0}\\
+% LightMelon \>{0,0.23,0.25,0}\> LightYellowOrange \>{0,0.21,0.50,0}\\
+% LightOrange \>{0,0.31,0.44,0}\> LightBurntOrange \>{0,0.26,0.50,0}\\
+% LightBittersweet\>{0,0.38,0.50,0.12}\> LightRedOrange\>{0,0.39,0.44,0}\\
+% LightMahagony \>{0,0.43,0.44,0.18}\> LightMaroon \>{0,0.44,0.34,0.16}\\
+% LightBrickRed \>{0,0.45,0.47,0.14}\> LightRed \>{0,0.50,0.50,0}\\
+% LightOrangeRed \>{0,0.50,0.25,0}\> LightRubineRed \>{0,0.50,0.07,0}\\
+% LightWildStrawberry\>{0,0.48,0.20,0}\> LightSalmon \>{0,0.27,0.19,0}\\
+% LightCarnationPink \>{0,0.32,0,0} \> LightMagenta \>{0,0.50,0,0}\\
+% LightVioletRed \>{0,0.40,0,0} \> LightRhodamine \>{0,0.41,0,0}\\
+% LightMulberry \>{0.17,0.45,0,0.01}\> LightRedViolet \>{0.04,0.45,0,0.17}\\
+% LightFuchsia \>{0.24,0.46,0,0.04}\> LightLavender \> {0,0.24,0,0}\\
+% LightThistle \>{0.06,0.30,0,0} \> LightOrchid \>{0.16,0.32,0,0}\\
+% LightDarkOrchid \>{0.20,0.40,0.10,0}\> LightPurple \>{0.23,0.43,0,0}\\
+% LightPlum \>{0.25,0.50,0,0} \> LightViolet \>{0.40,0.44,0,0}\\
+% LightRoyalPurple\>{0.38,0.45,0,0} \> LightBlueViolet \>{0.43,0.46,0,0.02}\\
+% LightPeriwinkle \>{0.29,0.28,0,0} \> LightCadetBlue \> {0.31,0.29,0.12,0}\\
+% LightCornflowerBlue\>{0.33,0.07,0,0}\>LightMidnightBlue\>{0.49,0.07,0,0.22}\\
+% LightNavyBlue \>{0.47,0.27,0,0} \> LightRoyalBlue \> {0.50,0.25,0,0}\\
+% LightBlue \>{0.50,0.50,0,0} \> LightCerulean \> {0.47,0.06,0,0}\\
+% LightCyan \>{0.50,0,0,0} \> LightProcessBlue \> {0.48,0,0,0}\\
+% LightSkyBlue \>{0.31,0,0.06,0} \> LightTurquoise \>{0.43,0,0.10,0}\\
+% LightTealBlue \>{0.43,0,0.17,0.01}\> LightAquamarine \>{0.41,0,0.15,0}\\
+% LightBlueGreen \>{0.43,0,0.17,0}\> LightEmerald \>{0.50,0,0.25,0}\\
+% LightJungleGreen\>{0.50,0,0.26,0} \> LightSeaGreen \>{0.35,0,0.25,0}\\
+% LightGreen \>{0.50,0,0.50,0} \> LightForestGreen\>{0.46,0,0.44,0.06}\\
+% LightPineGreen \>{0.46,0,0.30,0.13}\> LightLimeGreen\>{0.25,0,0.50,0}\\
+% LightYellowGreen\>{0.22,0,0.37,0} \> LightSpringGreen \>{0.13,0,0.38,0}\\
+% LightOliveGreen \>{0.32,0,0.48,0.20} \> LightRawSienna\>{0,0.36,0.50,0.23}\\
+% LightSepia \>{0,0.44,0.50,0.35} \> LightBrown \>{0,0.41,0.50,0.30}\\
+% LightTan \>{0.07,0.21,0.28,0}\\
+% LightLight- and LightLightLight-versions were derived by dividing all values\\
+% from Light-color definitions by 2 and 4, respectively.
+% \end{tabbing}
+%
+% \begin{tabbing}
+% \emph{name}\hspace{2.5cm}\= \emph{RGB\quad}\hspace{1.8cm}
+% \=\emph{name}\hspace{2.5cm}\= \emph{RGB\quad}\\
+%
+% BlueRed5 \>{0.15,0.17,0.55} \> BlueRed10 \> {0.20,0.23,0.57}\\
+% BlueRed15 \> {0.24,0.29,0.60} \>BlueRed20 \> {0.33,0.35,0.64}\\
+% BlueRed25 \> {0.43,0.43,0.68} \>BlueRed30 \> {0.52,0.52,0.73}\\
+% BlueRed35 \> {0.60,0.60,0.78} \>BlueRed40 \> {0.70,0.70,0.84}\\
+% BlueRed45 \> {0.80,0.80,0.85} \>BlueRed50 \> {0.86,0.82,0.82}\\
+% BlueRed55 \> {0.87,0.73,0.73} \>BlueRed60 \> {0.89,0.64,0.64}\\
+% BlueRed65 \> {0.90,0.55,0.55} \>BlueRed70 \> {0.91,0.47,0.46}\\
+% BlueRed75 \> {0.91,0.39,0.37} \>BlueRed80 \> {0.90,0.33,0.28}\\
+% BlueRed85 \> {0.89,0.25,0.20} \>BlueRed90 \> {0.88,0.23,0.14}\\
+% BlueRed95 \> {0.87,0.21,0.09} \>BlueRed100\> {0.87,0.16,0.04}\\
+% GreenRed5 \> {0,1,0} \>GreenRed10\> {0.05,0.95,0}\\
+% GreenRed15 \> {0.10,0.90,0} \>GreenRed20\> {0.15,0.85,0}\\
+% GreenRed25 \> {0.20,0.80,0} \>GreenRed30\> {0.25,0.75,0}\\
+% GreenRed35 \> {0.30,0.70,0} \>GreenRed40\> {0.35,0.65,0}\\
+% GreenRed45 \> {0.40,0.60,0} \>GreenRed50\> {0.45,0.55,0}\\
+% GreenRed55 \> {0.50,0.50,0} \>GreenRed60\> {0.55,0.45,0}\\
+% GreenRed65 \> {0.60,0.40,0} \>GreenRed70\> {0.65,0.35,0}\\
+% GreenRed75 \> {0.70,0.30,0} \>GreenRed80\> {0.75,0.25,0}\\
+% GreenRed85 \> {0.80,0.20,0} \>GreenRed90\> {0.85,0.15,0}\\
+% GreenRed95 \> {0.90,0.10,0} \>GreenRed100\> {0.95,0.05,0}\\
+% ColdHot5 \> {0,0.08,1} \>ColdHot10 \> {0,0.29,1}\\
+% ColdHot15 \> {0,0.49,1} \>ColdHot20 \> {0,0.70,1}\\
+% ColdHot25 \> {0,0.90,1} \>ColdHot30 \> {0,1,0.87}\\
+% ColdHot35 \> {0,1,0.68} \>ColdHot40 \> {0,1,0.46}\\
+% ColdHot45 \> {0,1,0.25} \>ColdHot50 \> {0,1,0.04}\\
+% ColdHot55 \> {0.16,1,0} \>ColdHot60 \> {0.35,1,0}\\
+% ColdHot65 \> {0.56,1,0} \>ColdHot70 \> {0.79,1,0}\\
+% ColdHot75 \> {0.98,1,0} \>ColdHot80 \> {1,0.82,0}\\
+% ColdHot85 \> {1,0.60,0} \>ColdHot90 \> {1,0.40,0}\\
+% ColdHot95 \> {1,0.20,0} \>ColdHot100\> {0.91,0,0}\\
+% and reverse definitions: |RedBlue|, |RedGreen|, |HotCold|.\\
+% \end{tabbing}
+% \end{footnotesize}
+%
+% Type the color names with the upper case letters exactly as described above.
+% For the definition of new colors use one of the |color.sty| commands:
+% \medskip
+%
+% \quad|\definecolor{|\meta{name}|}{cmyk}{|\meta{C,M,Y,K}|}|
+% \medskip
+%
+% \quad|\definecolor{|\meta{name}|}{rgb}{|\meta{R,G,B}|}|
+% \medskip
+%
+% The \meta{name} can be chosen freely, the values for the color
+% composition must be in the range 0--1, i\,e.\ 0--100\% of the
+% respective component (`C' -- cyan, `M' -- magenta, `Y' -- yellow,
+% `K' -- black; or `R' -- red, `G' -- green, `Blue' -- blue) separated by
+% commas.
+% \medskip
+%
+% Examples:
+% \medskip
+%
+% |\definecolor{Salmon}{cmyk}{0,0.53,0.38,0}|
+% \medskip
+%
+% |\definecolor{ColdHot15}{rgb}{0,0.49,1}|
+% \medskip
+%
+% \newpage
+% \section{Listing of the \texttt{texshade} default settings}
+%
+% \subsection{Standard definitions}
+%
+% The file |texshade.def| mirrors all commands which are
+% carried out at the beginning of the |texshade| environment.
+% Short comments are also included, thus, it is refered to
+% this file for further information.
+%
+% \subsection{Colors used in the different shading modes}
+%
+% \vspace{5mm}
+%
+% Color scheme \emph{blues}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> Magenta \> similar \\
+% \>White \> RoyalBlue \> identical \\
+% \>Goldenrod \> RoyalPurple \> all match\\
+% \end{tabbing}
+% \medskip
+%
+% Color scheme \emph{greens}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> GreenYellow \> similar \\
+% \>White \> PineGreen \> identical \\
+% \>YellowOrange \> OliveGreen \> all match\\
+% \end{tabbing}
+% \medskip
+%
+% Color scheme \emph{reds}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> YellowOrange \> similar \\
+% \>White \> BrickRed \> identical \\
+% \>YellowGreen \> Mahagony \> all match\\
+% \end{tabbing}
+% \medskip
+%
+% \newpage
+% Color scheme \emph{grays}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> LightGray \> similar \\
+% \>White \> DarkGray \> identical \\
+% \>White \> Black \> all match\\
+% \end{tabbing}
+% \medskip
+%
+% Color scheme \emph{black}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> White \> similar \\
+% \>White \> Black \> identical \\
+% \>White \> Black \> all match\\
+% \end{tabbing}
+% \medskip
+%
+% Functional mode \emph{charge}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>White \> Red \> acidic \\
+% \>White \> Blue \> basic \\
+% \end{tabbing}
+% \medskip
+%
+% Functional mode \emph{hydropathy}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>White \> Red \> acidic \\
+% \>White \> Blue \> basic \\
+% \>Black \> Yellow \> polar uncharged \\
+% \>White \> Green \> hydrophobic nonpolar \\
+% \end{tabbing}
+% \medskip
+%
+% \newpage
+% Functional mode \emph{chemical}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>White \> Red \> acidic \\
+% \>White \> Black \> aliphatic \\
+% \>White \> Green \> amide \\
+% \>White \> Brown \> aromatic \\
+% \>White \> Blue \> basic \\
+% \>Black \> Magenta \> hydroxyl \\
+% \>Black \> Orange \> imino \\
+% \>Black \> Yellow \> sulfur \\
+% \end{tabbing}
+% \medskip
+%
+% Functional mode \emph{structure}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> Orange \> external \\
+% \>Black \> Yellow \> ambivalent \\
+% \>White \> Green \> internal \\
+% \end{tabbing}
+% \medskip
+%
+% Functional mode \emph{standard area}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> BrickRed \> G\\
+% \>Black \> Orange \> A, S\\
+% \>Black \> Yellow \> C, P \\
+% \>Black \> YellowGreen \> T, D, V, N \\
+% \>White \> PineGreen \> I, E \\
+% \>Black \> SkyBlue \> L, Q, H, M \\
+% \>White \> RoyalPurple \> F, K \\
+% \>White \> RedViolet \> Y \\
+% \>White \> Black \> R, W \\
+% \end{tabbing}
+% \medskip
+%
+% \newpage
+% Functional mode \emph{accessible area}:
+% \medskip
+%
+% \begin{tabbing}
+% \hspace{1cm}\=\emph{res.color}\hspace{1.5cm}\=\emph{shad.color}\hspace{1.5cm} \= \emph{residues} \\
+% \>Black \> White \> no match \\
+% \>Black \> BrickRed \> C \\
+% \>Black \> Orange \> I, V, G \\
+% \>Black \> Yellow \> F, L, M, A \\
+% \>Black \> YellowGreen \> W, S, T, H \\
+% \>White \> PineGreen \> P \\
+% \>Black \> SkyBlue \> Y, D, N \\
+% \>White \> RoyalPurple \> E, Q \\
+% \>White \> RedViolet \> R \\
+% \>White \> Black \> K \\
+% \end{tabbing}
+% \medskip
+%
+% \newpage
+% \section{Quick Reference}
+%
+% \textbf{The \TeXshade{} logo}
+% \medskip
+%
+% \quad |\TeXshade|
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{The \TeXshade{} environment} (\pageref{tsenvironment}\,ff.)
+% \medskip
+%
+% \begin{quote}
+% |\begin{texshade}[|\meta{parameterfile}|]|
+% |{|\meta{alignmentfile}|}|
+%
+% \quad\emph{further \emph{\TeXshade} commands, if needed}
+%
+% |\end{texshade}|
+% \end{quote}
+% \bigskip
+%
+% \textbf{Predefined shading modes}
+% \medskip
+%
+% \quad|\seqtype{|\meta{type}|}|
+% \hfill(|P| -- peptide, |N| -- nucleotide) \hfill[\pageref{Lseqtype}]
+%
+% \medskip
+%
+% \quad|\shadingmode[|\meta{option}|]{|\meta{mode}|}|
+% \hfill[\pageref{Lshadingmode}]
+%
+% \medskip
+%
+% \begin{center}
+% \begin{tabular}{lll}
+% \meta{mode} & \meta{option} &\\ \hline
+% |identical| & |allmatchspecial| &\\
+% |similar| & |allmatchspecial| &\\
+% |diverse| & \meta{seqref} &\\
+% |functional|& \meta{type} & |charge| \\
+% & & |hydropathy| \\
+% & & |structure| \\
+% & & |chemical| \\
+% & & |standard area| \\
+% & & |accessible area| \\ \hline
+% \end{tabular}
+% \end{center}
+% \medskip
+%
+% \quad|\shadeallresidues|
+% \hfill[\pageref{Lshadeallresidues}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Shading colors} (\pageref{Lshadingcolors}\,ff.)
+% \medskip
+%
+% \quad|\shadingcolors{|\meta{scheme}|}| \,\, (|blues|, |reds|,
+% |greens|, |grays|, |black|)
+%
+% \quad|\nomatchresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% \quad|\similarresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% \quad|\conservedresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% \quad|\allmatchresidues{|\meta{res.col.}|}{|\meta{shad.col.}|}{|\meta{case}|}{|\meta{style}|}|
+%
+% \quad|\funcshadingstyle{|\meta{residue}|}{|\meta{res.col.}|}{|\meta{shad.color}|}|
+%
+% \hfill|{|\meta{case}|}{|\meta{style}|}| [\pageref{Lfuncshadingstyle}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \newpage
+% \textbf{Residue grouping}
+% \medskip
+%
+% \quad|\pepsims{|\meta{residue}|}{|\meta{similars}|}|
+% \hfill[\pageref{Lpepsims}]
+%
+% \quad|\pepgroups{|\meta{group1}|,|\meta{group2}|, ... , |\meta{groupn}|}|
+% \hfill[\pageref{Lpepgroups}]
+%
+% \quad|\DNAsims{|\meta{residue}|}{|\meta{similars}|}|
+% \hfill[\pageref{LDNAsims}]
+%
+% \quad|\DNAgroups{|\meta{group1}|,|\meta{group2}|, ... , |\meta{groupn}|}|
+% \hfill[\pageref{LDNAgroups}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Definition of new functional shading modes}
+% \medskip
+%
+% \quad|\clearfuncgroups| \hfill [\pageref{Lclearfuncgroups}]
+%
+% \quad|\funcgroup{|\meta{descr}|}{|\meta{residues}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+%
+% \hfill|{|\meta{case}|}{|\meta{style}|}|
+% \hfill[\pageref{Lfuncgroup}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Appearance of the consensus line}
+% \medskip
+%
+% \quad|\threshold{|\meta{percentage}|}|
+% \hfill[\pageref{Lthreshold}]
+%
+% \quad|\constosingleseq{|\meta{seqref}|}|
+% \hfill[\pageref{Lconstosingleseq}]
+%
+% \quad|\showconsensus[|\meta{color/scale}|[,|\meta{color/scale}|]]{|\meta{position}|}|
+% \hfill[\pageref{Lshowconsensus}]
+%
+% \quad|\hideconsensus|
+% \hfill[\pageref{Lhideconsensus}]
+%
+% \quad|\nameconsensus{|\meta{name}|}|
+% \hfill[\pageref{Lnameconsensus}]
+%
+% \quad|\defconsensus{|\meta{symbol1}|}{|\meta{symbol2}|}{|\meta{symbol3}|}|
+% \hfill[\pageref{Ldefconsensus}]
+%
+% \vspace*{-\baselineskip}
+%
+% \begin{tabbing}
+% \quad|\consensuscolors|\=|{|\meta{res.col.1}|}{|\meta{shad.col.1}|}|\\
+%
+% \>|{|\meta{res.col.2}|}{|\meta{shad.col.2}|}|\\
+%
+% \>|{|\meta{res.col.3}|}{|\meta{shad.col.3}|}|
+% \hspace{1.2in}[\pageref{Lconsensuscolors}]\\
+% \end{tabbing}
+%
+% \textbf{Appearance of the sequence lines}
+% \medskip
+%
+% \quad|\shownames{|\meta{position}|}|
+% \hfill[\pageref{Lshownames}]
+%
+% \quad|\shownumbering{|\meta{position}|}|
+% \hfill[\pageref{Lshownumbering}]
+%
+% \quad|\nameseq{|\meta{seqref}|}{|\meta{name}|}|
+% \hfill[\pageref{Lnameseq}]
+%
+% \quad|\namescolor{|\meta{color}|}|
+% \hfill[\pageref{Lnamescolor}]
+%
+% \quad|\namecolor{|\meta{seq1}|, ... ,|\meta{seq n}|}{|\meta{color}|}|
+% \hfill[\pageref{Lnamecolor}]
+%
+% \quad|\hidenames|
+% \hfill[\pageref{Lhidenames}]
+%
+% \quad|\hidename{|\meta{seq1}|, ... ,|\meta{seq n}|}|
+% \hfill[\pageref{Lhidename}]
+%
+% \quad|\numberingcolor{|\meta{color}|}|
+% \hfill[\pageref{Lnumberingcolor}]
+%
+% \quad|\numbercolor{|\meta{seq1}|, ... ,|\meta{seq n}|}{|\meta{color}|}|
+% \hfill[\pageref{Lnumbercolor}]
+%
+% \quad|\hidenumbering|
+% \hfill[\pageref{Lhidenumbering}]
+%
+% \quad|\hidenumber{|\meta{seq1}|, ... ,|\meta{seq n}|}|
+% \hfill[\pageref{Lhidenumber}]
+%
+% \quad|\hideresidues|
+% \hfill[\pageref{Lhideresidues}]
+%
+% \quad|\showresidues|
+% \hfill[\pageref{Lshowresidues}]
+%
+% \quad|\startnumber{|\meta{seqref}|}{|\meta{first residue number}|}|
+% \hfill[\pageref{Lstartnumber}]
+%
+% \quad|\seqlength{|\meta{seqref}|}{|\meta{length}|}|
+% \hfill[\pageref{Lseqlength}]
+%
+% \quad|\setends{|\meta{seqref}|}{|\meta{startnumber}|..|\meta{stopnumber}|}|
+% \hfill[\pageref{Lsetends}]
+%
+% \quad|\showruler{|\meta{position}|}{|\meta{seqref}|}|
+% \hfill[\pageref{Lshowruler}]
+%
+% \quad|\rulersteps{|\meta{number}|}|
+% \hfill[\pageref{Lrulersteps}]
+%
+% \quad|\rulercolor{|\meta{color}|}|
+% \hfill[\pageref{Lrulercolor}]
+%
+% \quad|\hideruler|
+% \hfill[\pageref{Lhideruler}]
+%
+% \quad|\gapchar{|\meta{symbol}|}|
+% \qquad (incl. |rule|) \hfill [\pageref{Lgapchar}]
+%
+% \quad|\gapcolors{|\meta{symbol color}|}{|\meta{background color}|}|
+% \hfill[\pageref{Lgapcolors}]
+%
+% \quad|\showleadinggaps|
+% \hfill[\pageref{Lshowleadinggaps}]
+%
+% \quad|\hideleadinggaps|
+% \hfill[\pageref{Lhideleadinggaps}]
+%
+% \quad|\fingerprint{|\meta{res. per line}|}|
+% \hfill[\pageref{Lfingerprint}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Hiding, killing, separating and ordering}
+% \medskip\enlargethispage{20pt}
+%
+% \quad|\hideseq{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}|
+% \hfill[\pageref{Lhideseq}]
+%
+% \quad|\killseq{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}|
+% \hfill[\pageref{Lkillseq}]
+%
+% \quad|\donotshade{|\meta{seq1}|,|\meta{seq2},\ldots|,|\meta{seq n}|}|
+% \hfill[\pageref{Ldonotshade}]
+%
+% \quad|\separationline{|\meta{seqref}|}|
+% \hfill[\pageref{Lseparationline}]
+%
+% \quad|\smallsep|
+% \hfill[\pageref{Lsmallsep}]
+%
+% \quad|\medsep|
+% \hfill[\pageref{Lmedsep}]
+%
+% \quad|\bigsep|
+% \hfill[\pageref{Lbigsep}]
+%
+% \quad|\vsepspace{|\meta{length}|}|
+% \hfill[\pageref{Lvsepspace}]
+%
+% \quad|\orderseqs{|\meta{seq1}|,|\meta{seq2}|,|\ldots|,|\meta{seq n}|}|
+% \hfill[\pageref{Lorderseqs}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Residues per line and further settings}
+% \medskip
+%
+% \quad|\residuesperline{|\meta{number}|}|
+% \hfill[\pageref{Lresiduesperline}]
+%
+% \quad|\residuesperline*{|\meta{number}|}|
+% \hfill[\pageref{Lresiduesperline*}]
+%
+% \quad|\charstretch{|\meta{factor}|}|
+% \hfill[\pageref{Lcharstretch}]
+%
+% \quad|\linestretch{|\meta{factor}|}|
+% \hfill[\pageref{Llinestretch}]
+%
+% \quad|\numberingwidth{|\meta{n digits}|}|
+% \hfill[\pageref{Lnumberingwidth}]
+%
+% \quad|\smallblockskip|
+% \hfill[\pageref{Lsmallblockskip}]
+%
+% \quad|\medblockskip|
+% \hfill[\pageref{Lmedblockskip}]
+%
+% \quad|\bigblockskip|
+% \hfill[\pageref{Lbigblockskip}]
+%
+% \quad|\noblockskip|
+% \hfill[\pageref{Lnoblockskip}]
+%
+% \quad|\vblockspace{|\meta{length}|}|
+% \hfill[\pageref{Lvblockspace}]
+%
+% \quad|\flexblockspace|
+% \hfill[\pageref{Lflexblockspace}]
+%
+% \quad|\fixblockspace|
+% \hfill[\pageref{Lfixblockspace}]
+%
+% \quad|\alignment{|\meta{position}|}|
+% \hfill[\pageref{Lalignment}]
+%
+% \vspace{1.5\baselineskip}
+%
+%
+% \newpage
+% \textbf{Individual shading and labeling of sequence stretches}
+% \medskip
+%
+% \quad|\shaderegion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+% [\pageref{Lshaderegion}]
+%
+% \quad|\shadeblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{res.col.}|}{|\meta{shad.col.}|}|
+% [\pageref{Lshadeblock}]
+%
+% \quad|\emphregion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% [\pageref{Lemphregion}]
+%
+% \quad|\emphblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% [\pageref{Lemphblock}]
+%
+% \quad|\emphdefault{|\meta{style}|}|
+% \hfill[\pageref{Lemphdefault}]
+%
+% \quad|\tintregion{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% [\pageref{Ltintregion}]
+%
+% \quad|\tintblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}|
+% [\pageref{Ltintblock}]
+%
+% \quad|\tintdefault{|\meta{effect}|}| \qquad\qquad|weak, normal, strong|
+% \hfill[\pageref{Ltintdefault}]
+%
+% \quad|\frameblock{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|\meta{start2}..\meta{stop2}|,|
+%
+% \hfill\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{color}|[|\meta{length}|]}|
+% [\pageref{Lframeblock}]
+%
+% \quad|\feature{|\meta{position}|}{|\meta{seqref}|}{|\meta{start1}..\meta{stop1}|,|
+%
+% \hfill\meta{start2}..\meta{stop2}|,|\ldots|,|\meta{start n}..\meta{stop n}|}{|\meta{labelstyle}|}{|\meta{text}|}|
+% [\pageref{Lfeature}]
+%
+% \begin{tabbing}
+% \quad\quad\quad|{|\meta{labelstyle}|}|\ \= = |{brace[|\meta{color}|]}|\\
+% \> = |{fill:|\meta{symbol}|[|\meta{textcolor}|]}|\\
+% \> = |{restriction[|\meta{color}|]}|\\
+% \> = |{helix[|\meta{helixcolor}|]}|\\
+% \> = |{box[|\meta{framecolor,boxcolor}|][|\meta{length}|]:|\\
+% \hspace{8.7cm}\meta{text}|[|\meta{textcolor}|]}|\\
+% \> = arrows and bars (|-=<',|$\vert$|o|)(|-=|)(|-=>',|$\vert$|o|)\\
+% \> = |{translate[|\meta{color}|]}|\\
+% \> = |{bar[|\meta{min}|,|\meta{max}|]:|\\
+% \hspace{5cm}\meta{properties/file/data}|[|\meta{color(,bgcolor)}|]}|\\
+% \> = |{color[|\meta{min}|,|\meta{max}|]:|\\
+% \hspace{5cm}\meta{properties/file/data}|[|\meta{scale}|]}|\\
+% \hspace{5cm}\meta{properties}: |hydrophobicity|, |charge|,\\
+% \hspace{7.4cm}|molweight|, |conservation|\\
+% \end{tabbing}
+%
+% \quad|\ttopspace{|\meta{length}|}|
+% \hfill[\pageref{Lttopspace}]
+%
+% \quad|\topspace{|\meta{length}|}|
+% \hfill[\pageref{Ltopspace}]
+%
+% \quad|\bottomspace{|\meta{length}|}|
+% \hfill[\pageref{Lbottomspace}]
+%
+% \quad|\bbottomspace{|\meta{length}|}|
+% \hfill[\pageref{Lbottomspace}]
+%
+% \quad|\featurerule{|\meta{length}|}|
+% \hfill[\pageref{Lfeaturerule}]
+%
+% \quad|\bargraphstretch{|\meta{factor}|}|
+% \hfill[\pageref{Lbargraphstretch}]
+%
+% \quad|\colorscalestretch{|\meta{factor}|}|
+% \hfill[\pageref{Lcolorgrahstretch}]
+%
+% \quad|\codon{|\meta{amino acid}|}{|\meta{triplet1,\ldots, triplet n}|}|
+% \hfill[\pageref{Lcodon}]
+%
+% \quad|\geneticcode{|\meta{filename}|}|
+% \hfill[\pageref{Lgeneticcode}]
+%
+% \quad|\backtranslabel[|\meta{size}|]{|\meta{style}|}|
+% \hfill[\pageref{Lbacktranslabel}]
+%
+% \quad|\backtranstext[|\meta{size}|]{|\meta{style}|}|
+% \hfill[\pageref{Lbacktranstext}]
+%
+% \begin{tabbing}
+% \quad\quad\quad|{|\meta{style}|}|\ \= = |{horizontal}|\\
+% \> = |{alternating}|\\
+% \> = |{zigzag}|\\
+% \> = |{oblique}|\\
+% \> = |{vertical}|
+% \end{tabbing}
+%
+% \vspace{1.5\baselineskip}
+%
+%
+% \textbf{Including secondary structure information}
+% \medskip
+%
+% \quad|\includeDSSP[make new]{|\meta{seqref}|}{|\meta{filename}|}|
+% \hfill[\pageref{LincludeDSSP}]
+%
+% \quad|\includeSTRIDE[make new]{|\meta{seqref}|}{|\meta{filename}|}|
+% \hfill[\pageref{LincludeSTRIDE}]
+%
+% \quad|\includePHDsec[make new]{|\meta{seqref}|}{|\meta{filename}|}|
+% \hfill[\pageref{LincludePHDsec}]
+%
+% \quad|\includePHDtopo[make new]{|\meta{seqref}|}{|\meta{filename}|}|
+% \hfill[\pageref{LincludePHDtopo}]
+%
+% \quad|\includeHMMTOP[make new]{|\meta{seqref}|[|\meta{seqref}|]}{|\meta{filename}|}|
+% \hfill[\pageref{LincludeHMMTOP}]
+%
+% \quad|\showonDSSP{|\meta{structures}|}|
+% \hfill[\pageref{LshowonDSSP}]
+%
+% \quad|\showonSTRIDE{|\meta{structures}|}|
+% \hfill[\pageref{LshowonSTRIDE}]
+%
+% \quad|\showonPHDsec{|\meta{structures}|}|
+% \hfill[\pageref{LshowonPHDsec}]
+%
+% \quad|\showonPHDtopo{|\meta{structures}|}|
+% \hfill[\pageref{LshowonPHDtopo}]
+%
+% \quad|\showonHMMTOP{|\meta{structures}|}|
+% \hfill[\pageref{LshowonHMMTOP}]
+%
+% \quad|\hideonDSSP{|\meta{structures}|}|
+% \hfill[\pageref{LhideonDSSP}]
+%
+% \quad|\hideonSTRIDE{|\meta{structures}|}|
+% \hfill[\pageref{LhideonSTRIDE}]
+%
+% \quad|\hideonPHDsec{|\meta{structures}|}|
+% \hfill[\pageref{LhideonPHDsec}]
+%
+% \quad|\hideonPHDtopo{|\meta{structures}|}|
+% \hfill[\pageref{LhideonPHDtopo}]
+%
+% \quad|\hideonHMMTOP{|\meta{structures}|}|
+% \hfill[\pageref{LhideonHMMTOP}]
+%
+% \quad|\appearance{|\meta{type}|}{|\meta{position}|}{|\meta{labelstyle}|}{|\meta{text}|}|
+% \hfill[\pageref{Lappearance}]
+%
+% \quad|\numcount|
+% \hfill[\pageref{Lnumcount}]
+%
+% \quad|\alphacount|
+% \hfill[\pageref{Lalphacount}]
+%
+% \quad|\Alphacount|
+% \hfill[\pageref{LAlphacount}]
+%
+% \quad|\romancount|
+% \hfill[\pageref{Lromancount}]
+%
+% \quad|\Romancount|
+% \hfill[\pageref{LRomancount}]
+%
+% \quad|\firstcolumnDSSP|
+% \hfill[\pageref{LfirstcolumnDSSP}]
+%
+% \quad|\secondcolumnDSSP|
+% \hfill[\pageref{LsecondcolumnDSSP}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \newpage
+%
+% \textbf{Displaying and building legends}
+% \medskip
+%
+% \quad|\showlegend|
+% \hfill[\pageref{Lshowlegend}]
+%
+% \quad|\hidelegend|
+% \hfill[\pageref{Lhidelegend}]
+%
+% \quad|\movelegend{|\meta{x-offset}|}{|\meta{y-offset}|}|
+% \hfill[\pageref{Lmovelegend}]
+%
+% \quad|\germanlanguage|, |\spanishlanguage|, |\englishlanguage|
+% \hfill[\pageref{Lgermanlanguage}]
+%
+% \quad|\legendcolor{|\meta{color}|}|
+% \hfill[\pageref{Llegendcolor}]
+%
+% \quad|\shadebox{|\meta{color}|}|
+% \hfill[\pageref{Lshadebox}]
+%
+% \vspace{1.5\baselineskip}
+%
+%
+% \textbf{Adding captions to the alignment}
+% \medskip
+%
+% \quad|\showcaption[|\meta{position}|]{|\meta{text}|}|
+% \hfill[\pageref{Lshowcaption}]
+%
+% \quad|\shortcaption{|\meta{text}|}|
+% \hfill[\pageref{Lshortcaption}]
+%
+% \vspace{1.5\baselineskip}
+%
+% \textbf{Font handling}
+% \medskip
+%
+% \quad|\setfamily{|\meta{text}|}{|\meta{family}|}|
+% \hfill[\pageref{Lsetfamily}]
+%
+% \quad|\setseries{|\meta{text}|}{|\meta{series}|}|
+% \hfill[\pageref{Lsetseries}]
+%
+% \quad|\setshape{|\meta{text}|}{|\meta{shape}|}|
+% \hfill[\pageref{Lsetshape}]
+%
+% \quad|\setsize{|\meta{text}|}{|\meta{size}|}|
+% \hfill[\pageref{Lsetsize}]
+%
+% \quad|\setfont{|\meta{text}|}{|\meta{family}|}{|\meta{series}|}{|\meta{shape}|}{|\meta{size}|}|
+% \hfill[\pageref{Lsetfont}]
+%
+% \medskip
+%
+% \quad |\featuresrm| \quad |\featurestiny| \hfill[\pageref{Lfeaturesrm}]
+%
+% \quad |\featuressf| \quad |\featuresscriptsize|
+%
+% \quad |\featurestt| \quad |\featuresfootnotesize|
+%
+% \quad |\featuresbf| \quad |\featuressmall|
+%
+% \quad |\featuresmd| \quad |\featuresnormalsize|
+%
+% \quad |\featuresit| \quad |\featureslarge|
+%
+% \quad |\featuressl| \quad |\featuresLarge|
+%
+% \quad |\featuressc| \quad |\featuresLARGE|
+%
+% \quad |\featuresup| \quad |\featureshuge|
+%
+% \quad | | \quad |\featuresHuge|
+% \medskip
+%
+% Corresponding sets are provided for the
+% numbering (|\numberingrm| etc.),
+% featurestyles (|featurestylesrm| etc.), names (|\namesrm| etc.),
+% residues (|\residuesrm| etc.) and
+% legend texts (|legendrm| etc.).
+% \bigskip
+%
+% \textbf{Goodies---molweight and charge}
+% \medskip
+%
+% \quad|\molweight{|\meta{seqref}|}{|\meta{Da/kDa}|}|
+% \hfill[\pageref{Lmolweight}]
+%
+% \quad|\charge{|\meta{seqref}|}{|\meta{i/o/N/C}|}|
+% \hfill[\pageref{Lcharge}]
+%
+%
+% \StopEventually{%
+% \newpage
+% \section{References}
+% [1] \textsc{Carlisle, D.} The Standard \LaTeX{} `Graphics
+% Bundle', |color.sty|.
+%
+% [2] \textsc{Karlin, S.; Ghandour, G.} (1985) Multiple-alphabet
+% amino acid sequence comparisons of the immunoglobulin
+% $\kappa$-chain constant domain.
+% \newblock \textit{Proc. Natl. Acad. Sci. USA}: \textbf{82},
+% 8597--8601.
+%
+% [3] \textsc{Kyte, J.; Doolittle, R. F.} (1982) A simple
+% method for displaying the hydropathic character of a
+% protein.
+% \newblock \textit{J. Mol. Biol.}: \textbf{157}, 105--132.
+%
+% [4] \textsc{Rose, G. D.; Geselowitz, A. R.; Lesser, G. J.;
+% Lee, R. H.; Zehfus, M. H.} (1985) Hydrophobicity of amino
+% acid residues in globular proteins.
+% \newblock \textit{Science}: \textbf{229}, 835--838.
+%
+% [5] \textsc{Lesser, G. J.; Rose, G. D.} (1990) Hydrophobicity
+% of amino acid subgroups in proteins.
+% \newblock \textit{Proteins: structure, function and
+% genetics}: \textbf{8}, 6--13.
+%
+% [6] \textsc{Fr\"ohlich, K.-U.} (1994) Sequence similarity
+% presenter: a tool for the graphic display of similarities
+% of long sequences for use in presentations.
+% \newblock \textit{Comput. Applic. Biosci.}:
+% \textbf{10}, 179--183.
+%
+% [7] \textsc{Kabsch, W.; Sander, C.} (1983) Dictionary of
+% protein secondary structure: pattern recognition of
+% hydrogen-bonded and geometrical features.
+% \newblock \textit{Biopolymers}: \textbf{22}, 2577--2637.
+%
+% [8] \textsc{Frishman, D.; Argos, P.} (1995) Knowledge-based
+% protein secondary structure assignment.
+% \newblock \textit{Proteins: structure, function and
+% genetics}: \textbf{23}, 566--579.
+%
+% [9] \textsc{Rost, B.; Sander, C.} (1994)
+% Combining evolutionary information and neural networks to predict
+% protein secondary structure.
+% \newblock \textit{Proteins: structure, function and
+% genetics}: \textbf{19}, 55--72.
+%
+% [10] \textsc{Tusnady, G.E.; Simon, I.} (2001)
+% The HMMTOP transmembrane topology prediction server.
+% \newblock \textit{Bioinformatics}: \textbf{17}, 849-850.
+%
+% [11] \textsc{Rokicki, T.} DVIPS: A \TeX{} driver.
+%
+% }
+% \section{Implementation}
+% \subsection{Documentation Driver}
+% \begin{macrocode}
+%<*driver>
+\documentclass[12pt,a4paper]{ltxdoc}
+\usepackage{texshade}
+\openin\structurefile = hyperref.sty
+\ifeof\structurefile
+ \else
+ \usepackage[colorlinks]{hyperref}
+ \fi
+\closein\structurefile
+\DisableCrossrefs
+\sloppy
+\def\BioTeX{\textsc{Bio}\kern-0.5ex\TeX}
+\def\TeXtopo{\mbox{\TeX\textsf{topo}}}
+\begin{document}
+ \OnlyDescription
+ \DocInput{texshade.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+% \subsection{\texttt{texshade.sty}---no comments}
+% \begin{macrocode}
+%<*texshade>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{texshade}[2005/04/13 LaTeX TeXshade (v1.12)]
+\message{Package `texshade', Version 1.12 of 2005/09/20.}
+
+\PassOptionsToPackage{dvips}{color}
+\DeclareOption*{%
+ \PassOptionsToPackage{\CurrentOption}{color}%
+}
+\ProcessOptions
+\RequirePackage{color}
+
+\expandafter\ifx\csname TeXshade\endcsname\relax \else \endinput \fi
+
+\expandafter\ifx\csname TeXtopo\endcsname\relax \else
+ \PackageError{TeXtopo}
+ {TeXtopo loaded before TeXshade}
+ {\MessageBreak
+ For the proper function of the TeXtopo/TeXshade combo the \MessageBreak
+ TeXshade package must be loaded before the TeXtopo package.\MessageBreak
+ Please change the order of the \noexpand\usepackage commands in your
+ \MessageBreak
+ document header section or use the `biotex.sty'.\MessageBreak\MessageBreak
+ Quit here by typing \space X <return>. \MessageBreak
+}
+\fi
+
+\catcode`\@11
+
+\newread\structurefile \newwrite\featurefile
+\newread\alignfile
+
+\expandafter\ifx\csname blacktriangleright\endcsname\relax
+ \openin\structurefile = amssymb.sty
+ \ifeof\structurefile
+ \message{<AMS symbol style `amssymb.sty' not installed - using round heads>}
+ \def\blacktriangleright{%
+ \rule[\width@tmp]{0.65ex}{\temp@@length}\kern-0.55ex\ensuremath{\bullet}%
+ }
+ \def\blacktriangleleft{%
+ \ensuremath{\bullet}\kern-0.55ex\rule[\width@tmp]{0.65ex}{\temp@@length}%
+ }
+ \else \RequirePackage[]{amssymb} \fi
+ \closein\structurefile
+\fi
+
+\newcount\loopcount \newcount\innerloopcount \newcount\outerloopcount
+\newcount\seq@count \newcount\killseq@count
+\newcount\seq@percent \newcount\res@count
+\newcount\seq@pointer \newcount\pos@count
+\newcount\res@perline \newcount\end@count
+\newcount\cons@count \expandafter\newcount\csname res@count0\endcsname
+\newcount\temp@count \newcount\triple@count
+
+\newlength\box@width \newlength\name@width
+\newlength\box@depth \newlength\width@tmp
+\newlength\box@height \newlength\number@width
+\newlength\char@stretch \newlength\line@stretch
+\newlength\center@fill \newlength\arrow@width
+\newlength\arrow@height \newlength\rule@thick
+\newlength\arrow@thick
+\newlength\equal@width \newlength\equal@tmp
+\newlength\equal@height \newlength\temp@@length
+\newlength\vspace@legend
+\newlength\hspace@legend
+
+\newif\ifletter \newif\ifnumber
+\newif\ifnewres \newif\ifall@shade
+\newif\ifnames@right \newif\ifnumbers@left
+\newif\ifhide@cons \newif\ifshow@cons
+\newif\iffuncmode \newif\iflegend@
+\newif\ifnumbers@ \newif\ifnames@
+\newif\ifgerm@n \newif\ifsp@nish
+\newif\ifrpl@fix
+\newif\ifnosh@de \newif\ifregionalshade
+\newif\ifstart@ \newif\ifstop@
+\newif\iftopfeature \newif\ifbottomfeature
+\newif\ifttopfeature \newif\ifbbottomfeature
+\newif\ifall@fshade \newif\ifregionalemph
+\newif\ifframe@ \newif\ifregionaltint
+\newif\ifhidechar \newif\ifsh@wg@ps
+\newif\ifsimmode
+\newif\ifregionaltintnow
+\newif\ifregionalemphnow
+\newif\ifregionalshadenow
+\newif\iftopfeaturenow
+\newif\ifttopfeaturenow
+\newif\ifbottomfeaturenow
+\newif\ifbbottomfeaturenow
+\newif\ifframenow
+\newif\iffix@
+
+\expandafter\ifx\csname mdqon\endcsname\relax
+ \germ@nfalse \sp@nishfalse \def\cons@name{consensus}
+\else \germ@ntrue \sp@nishfalse \def\cons@name{Konsensus} \fi
+
+\def\n@me{Name:} \def\@msf{MSF:} \def\he@derend{//} \def\ampers@nd{&}
+\def\comm@{,} \def\@loc{LOC} \def\@asg{ASG} \def\@t{@} \def\@HP{>HP:}
+\def\gre@ter{>} \def\sm@ller{<} \def\N@{N} \def\equ@l{=} \def\H@{H}
+\def\gap@char{.} \def\yes{yes} \def\y@{y} \def\n@{n} \def\o@{o} \def\d@t{.}
+\def\gap@rule{\rule[0.3\box@height]{\box@width}{\gap@rulethick}}
+\def\fgroup@num{0} \def\max@seqnumber{0} \def\@lign@count{0}
+\def\resn@m@tch{upper} \def\ressimm@tch{upper}
+\def\resm@tch{upper} \def\res@llm@tch{upper}
+\def\tr@ns{translate} \def\gr@ydef@ult{GrayDefault}
+\xdef\par@{\expandafter\string\par}
+\expandafter\def\csname fg@textcolor/\endcsname{White}
+\expandafter\def\csname fg@color/\endcsname{White}
+\expandafter\def\csname func@style/\endcsname{\csname textup\endcsname}
+\expandafter\def\csname func@style*\endcsname{\csname textup\endcsname}
+\expandafter\def\csname funcm@tch/\endcsname{upper}
+\expandafter\def\csname funcm@tch*\endcsname{upper}
+
+\setlength\hspace@legend{0pt} \setlength\vspace@legend{0pt}
+\triple@count=0 \cons@count=0
+
+\def\clear@sims{%
+ \expandafter\xdef\csname \prfx simA\endcsname{(1)A}
+ \expandafter\xdef\csname \prfx simB\endcsname{(1)B}
+ \expandafter\xdef\csname \prfx simC\endcsname{(1)C}
+ \expandafter\xdef\csname \prfx simD\endcsname{(1)D}
+ \expandafter\xdef\csname \prfx simE\endcsname{(1)E}
+ \expandafter\xdef\csname \prfx simF\endcsname{(1)F}
+ \expandafter\xdef\csname \prfx simG\endcsname{(1)G}
+ \expandafter\xdef\csname \prfx simH\endcsname{(1)H}
+ \expandafter\xdef\csname \prfx simI\endcsname{(1)I}
+ \expandafter\xdef\csname \prfx simJ\endcsname{(1)J}
+ \expandafter\xdef\csname \prfx simK\endcsname{(1)K}
+ \expandafter\xdef\csname \prfx simL\endcsname{(1)L}
+ \expandafter\xdef\csname \prfx simM\endcsname{(1)M}
+ \expandafter\xdef\csname \prfx simN\endcsname{(1)N}
+ \expandafter\xdef\csname \prfx simO\endcsname{(1)O}
+ \expandafter\xdef\csname \prfx simP\endcsname{(1)P}
+ \expandafter\xdef\csname \prfx simQ\endcsname{(1)Q}
+ \expandafter\xdef\csname \prfx simR\endcsname{(1)R}
+ \expandafter\xdef\csname \prfx simS\endcsname{(1)S}
+ \expandafter\xdef\csname \prfx simT\endcsname{(1)T}
+ \expandafter\xdef\csname \prfx simU\endcsname{(1)U}
+ \expandafter\xdef\csname \prfx simV\endcsname{(1)V}
+ \expandafter\xdef\csname \prfx simW\endcsname{(1)W}
+ \expandafter\xdef\csname \prfx simX\endcsname{(1)X}
+ \expandafter\xdef\csname \prfx simY\endcsname{(1)Y}
+ \expandafter\xdef\csname \prfx simZ\endcsname{(1)Z}
+}
+
+\xdef\pepmwA{711} \xdef\pepmwB{1146} \xdef\pepmwC{1032}
+\xdef\pepmwD{1151} \xdef\pepmwE{1291} \xdef\pepmwF{1472}
+\xdef\pepmwG{571} \xdef\pepmwH{1372} \xdef\pepmwI{1132}
+\xdef\pepmwJ{0} \xdef\pepmwK{1282} \xdef\pepmwL{1132}
+\xdef\pepmwM{1312} \xdef\pepmwN{1141} \xdef\pepmwO{0}
+\xdef\pepmwP{971} \xdef\pepmwQ{1281} \xdef\pepmwR{1562}
+\xdef\pepmwS{871} \xdef\pepmwT{1011} \xdef\pepmwU{0}
+\xdef\pepmwV{991} \xdef\pepmwW{1862} \xdef\pepmwX{1282}
+\xdef\pepmwY{1632} \xdef\pepmwZ{1286}
+
+\xdef\DNAmwA{3462} \xdef\DNAmwB{0} \xdef\DNAmwC{3222}
+\xdef\DNAmwD{0} \xdef\DNAmwE{0} \xdef\DNAmwF{0}
+\xdef\DNAmwG{3622} \xdef\DNAmwH{0} \xdef\DNAmwI{0}
+\xdef\DNAmwJ{0} \xdef\DNAmwK{0} \xdef\DNAmwL{0}
+\xdef\DNAmwM{0} \xdef\DNAmwN{0} \xdef\DNAmwO{0}
+\xdef\DNAmwP{0} \xdef\DNAmwQ{0} \xdef\DNAmwR{0}
+\xdef\DNAmwS{0} \xdef\DNAmwT{3372} \xdef\DNAmwU{3232}
+\xdef\DNAmwV{0} \xdef\DNAmwW{0} \xdef\DNAmwX{0}
+\xdef\DNAmwY{0} \xdef\DNAmwZ{0}
+
+\xdef\pepchargeA{0} \xdef\pepchargeB{0} \xdef\pepchargeC{-30}
+\xdef\pepchargeD{-1000} \xdef\pepchargeE{-1000} \xdef\pepchargeF{0}
+\xdef\pepchargeG{0} \xdef\pepchargeH{165} \xdef\pepchargeI{0}
+\xdef\pepchargeJ{0} \xdef\pepchargeK{1000} \xdef\pepchargeL{0}
+\xdef\pepchargeM{0} \xdef\pepchargeN{0} \xdef\pepchargeO{0}
+\xdef\pepchargeP{0} \xdef\pepchargeQ{0} \xdef\pepchargeR{1000}
+\xdef\pepchargeS{0} \xdef\pepchargeT{0} \xdef\pepchargeU{0}
+\xdef\pepchargeV{0} \xdef\pepchargeW{0} \xdef\pepchargeX{0}
+\xdef\pepchargeY{0} \xdef\pepchargeZ{0}
+\xdef\chargeNterm{910} \xdef\chargeCterm{-1000}
+
+\xdef\chargeA{0} \xdef\chargeB{0} \xdef\chargeC{0}
+\xdef\chargeD{-50} \xdef\chargeE{-50} \xdef\chargeF{0}
+\xdef\chargeG{0} \xdef\chargeH{30} \xdef\chargeI{0}
+\xdef\chargeJ{0} \xdef\chargeK{50} \xdef\chargeL{0}
+\xdef\chargeM{0} \xdef\chargeN{0} \xdef\chargeO{0}
+\xdef\chargeP{0} \xdef\chargeQ{0} \xdef\chargeR{50}
+\xdef\chargeS{0} \xdef\chargeT{0} \xdef\chargeU{0}
+\xdef\chargeV{0} \xdef\chargeW{0} \xdef\chargeX{0}
+\xdef\chargeY{0} \xdef\chargeZ{0}
+
+\xdef\molwA{11} \xdef\molwB{45} \xdef\molwC{36}
+\xdef\molwD{45} \xdef\molwE{66} \xdef\molwF{70}
+\xdef\molwG{1} \xdef\molwH{62} \xdef\molwI{44}
+\xdef\molwJ{N} \xdef\molwK{55} \xdef\molwL{44}
+\xdef\molwM{58} \xdef\molwN{44} \xdef\molwO{N}
+\xdef\molwP{31} \xdef\molwQ{55} \xdef\molwR{77}
+\xdef\molwS{19} \xdef\molwT{34} \xdef\molwU{N}
+\xdef\molwV{33} \xdef\molwW{100} \xdef\molwX{55}
+\xdef\molwY{82} \xdef\molwZ{66}
+
+\xdef\HydroA{21} \xdef\HydroB{N} \xdef\HydroC{10}
+\xdef\HydroD{-31} \xdef\HydroE{-25} \xdef\HydroF{41}
+\xdef\HydroG{16} \xdef\HydroH{-14} \xdef\HydroI{47}
+\xdef\HydroJ{N} \xdef\HydroK{-52} \xdef\HydroL{36}
+\xdef\HydroM{22} \xdef\HydroN{-27} \xdef\HydroO{N}
+\xdef\HydroP{4} \xdef\HydroQ{-29} \xdef\HydroR{-53}
+\xdef\HydroS{-6} \xdef\HydroT{-2} \xdef\HydroU{N}
+\xdef\HydroV{37} \xdef\HydroW{28} \xdef\HydroX{N}
+\xdef\HydroY{9} \xdef\HydroZ{N}
+
+\xdef\consCC{100} \xdef\consCS{67} \xdef\consCT{33} \xdef\consCP{33} \xdef\consCA{33}
+\xdef\consCG{50} \xdef\consCN{33} \xdef\consCD{17} \xdef\consCE{0} \xdef\consCQ{17}
+\xdef\consCH{33} \xdef\consCR{33} \xdef\consCK{0} \xdef\consCM{33} \xdef\consCI{33}
+\xdef\consCL{33} \xdef\consCV{33} \xdef\consCF{50} \xdef\consCY{50} \xdef\consCW{50}
+\expandafter\xdef\csname consC.\endcsname{0}
+
+\xdef\consSC{67} \xdef\consSS{100} \xdef\consST{83} \xdef\consSP{67} \xdef\consSA{83}
+\xdef\consSG{83} \xdef\consSN{83} \xdef\consSD{67} \xdef\consSE{50} \xdef\consSQ{50}
+\xdef\consSH{50} \xdef\consSR{50} \xdef\consSK{50} \xdef\consSM{33} \xdef\consSI{33}
+\xdef\consSL{33} \xdef\consSV{67} \xdef\consSF{50} \xdef\consSY{50} \xdef\consSW{33}
+\expandafter\xdef\csname consS.\endcsname{0}
+
+\xdef\consTC{33} \xdef\consTS{83} \xdef\consTT{100} \xdef\consTP{67} \xdef\consTA{83}
+\xdef\consTG{67} \xdef\consTN{67} \xdef\consTD{50} \xdef\consTE{50} \xdef\consTQ{50}
+\xdef\consTH{33} \xdef\consTR{50} \xdef\consTK{67} \xdef\consTM{50} \xdef\consTI{50}
+\xdef\consTL{33} \xdef\consTV{67} \xdef\consTF{33} \xdef\consTY{33} \xdef\consTW{17}
+\expandafter\xdef\csname consT.\endcsname{0}
+
+\xdef\consPC{33} \xdef\consPS{67} \xdef\consPT{67} \xdef\consPP{100} \xdef\consPA{83}
+\xdef\consPG{67} \xdef\consPN{33} \xdef\consPD{50} \xdef\consPE{50} \xdef\consPQ{50}
+\xdef\consPH{50} \xdef\consPR{50} \xdef\consPK{33} \xdef\consPM{33} \xdef\consPI{33}
+\xdef\consPL{50} \xdef\consPV{67} \xdef\consPF{50} \xdef\consPY{33} \xdef\consPW{33}
+\expandafter\xdef\csname consP.\endcsname{0}
+
+\xdef\consAC{33} \xdef\consAS{83} \xdef\consAT{83} \xdef\consAP{83} \xdef\consAA{100}
+\xdef\consAG{83} \xdef\consAN{50} \xdef\consAD{67} \xdef\consAE{67} \xdef\consAQ{50}
+\xdef\consAH{33} \xdef\consAR{33} \xdef\consAK{50} \xdef\consAM{50} \xdef\consAI{33}
+\xdef\consAL{33} \xdef\consAV{83} \xdef\consAF{50} \xdef\consAY{33} \xdef\consAW{33}
+\expandafter\xdef\csname consA.\endcsname{0}
+
+\xdef\consGC{50} \xdef\consGS{83} \xdef\consGT{67} \xdef\consGP{67} \xdef\consGA{83}
+\xdef\consGG{100} \xdef\consGN{50} \xdef\consGD{67} \xdef\consGE{67} \xdef\consGQ{33}
+\xdef\consGH{17} \xdef\consGR{50} \xdef\consGK{33} \xdef\consGM{17} \xdef\consGI{33}
+\xdef\consGL{33} \xdef\consGV{67} \xdef\consGF{33} \xdef\consGY{33} \xdef\consGW{50}
+\expandafter\xdef\csname consG.\endcsname{0}
+
+\xdef\consNC{33} \xdef\consNS{83} \xdef\consNT{67} \xdef\consNP{33} \xdef\consNA{50}
+\xdef\consNG{50} \xdef\consNN{100} \xdef\consND{83} \xdef\consNE{67} \xdef\consNQ{50}
+\xdef\consNH{67} \xdef\consNR{50} \xdef\consNK{67} \xdef\consNM{17} \xdef\consNI{33}
+\xdef\consNL{17} \xdef\consNV{33} \xdef\consNF{33} \xdef\consNY{50} \xdef\consNW{0}
+\expandafter\xdef\csname consN.\endcsname{0}
+
+\xdef\consDC{17} \xdef\consDS{67} \xdef\consDT{50} \xdef\consDP{50} \xdef\consDA{67}
+\xdef\consDG{67} \xdef\consDN{83} \xdef\consDD{100} \xdef\consDE{83} \xdef\consDQ{67}
+\xdef\consDH{50} \xdef\consDR{33} \xdef\consDK{50} \xdef\consDM{33} \xdef\consDI{17}
+\xdef\consDL{17} \xdef\consDV{50} \xdef\consDF{17} \xdef\consDY{33} \xdef\consDW{0}
+\expandafter\xdef\csname consD.\endcsname{0}
+
+\xdef\consEC{0} \xdef\consES{50} \xdef\consET{50} \xdef\consEP{50} \xdef\consEA{67}
+\xdef\consEG{67} \xdef\consEN{67} \xdef\consED{83} \xdef\consEE{100} \xdef\consEQ{67}
+\xdef\consEH{33} \xdef\consER{50} \xdef\consEK{67} \xdef\consEM{33} \xdef\consEI{17}
+\xdef\consEL{17} \xdef\consEV{67} \xdef\consEF{33} \xdef\consEY{17} \xdef\consEW{17}
+\expandafter\xdef\csname consE.\endcsname{0}
+
+\xdef\consQC{17} \xdef\consQS{50} \xdef\consQT{50} \xdef\consQP{50} \xdef\consQA{50}
+\xdef\consQG{33} \xdef\consQN{50} \xdef\consQD{67} \xdef\consQE{67} \xdef\consQQ{100}
+\xdef\consQH{67} \xdef\consQR{50} \xdef\consQK{67} \xdef\consQM{33} \xdef\consQI{17}
+\xdef\consQL{33} \xdef\consQV{33} \xdef\consQF{17} \xdef\consQY{33} \xdef\consQW{17}
+\expandafter\xdef\csname consQ.\endcsname{0}
+
+\xdef\consHC{33} \xdef\consHS{50} \xdef\consHT{33} \xdef\consHP{50} \xdef\consHA{33}
+\xdef\consHG{17} \xdef\consHN{67} \xdef\consHD{50} \xdef\consHE{33} \xdef\consHQ{67}
+\xdef\consHH{100} \xdef\consHR{67} \xdef\consHK{50} \xdef\consHM{33} \xdef\consHI{33}
+\xdef\consHL{50} \xdef\consHV{17} \xdef\consHF{33} \xdef\consHY{50} \xdef\consHW{17}
+\expandafter\xdef\csname consH.\endcsname{0}
+
+\xdef\consRC{33} \xdef\consRS{50} \xdef\consRT{50} \xdef\consRP{50} \xdef\consRA{33}
+\xdef\consRG{50} \xdef\consRN{50} \xdef\consRD{33} \xdef\consRE{50} \xdef\consRQ{50}
+\xdef\consRH{67} \xdef\consRR{100} \xdef\consRK{83} \xdef\consRM{33} \xdef\consRI{33}
+\xdef\consRL{33} \xdef\consRV{33} \xdef\consRF{17} \xdef\consRY{17} \xdef\consRW{33}
+\expandafter\xdef\csname consR.\endcsname{0}
+
+\xdef\consKC{0} \xdef\consKS{50} \xdef\consKT{67} \xdef\consKP{33} \xdef\consKA{50}
+\xdef\consKG{33} \xdef\consKN{67} \xdef\consKD{50} \xdef\consKE{67} \xdef\consKQ{67}
+\xdef\consKH{50} \xdef\consKR{83} \xdef\consKK{100} \xdef\consKM{33} \xdef\consKI{33}
+\xdef\consKL{33} \xdef\consKV{50} \xdef\consKF{17} \xdef\consKY{17} \xdef\consKW{17}
+\expandafter\xdef\csname consK.\endcsname{0}
+
+\xdef\consMC{33} \xdef\consMS{50} \xdef\consMT{50} \xdef\consMP{33} \xdef\consMA{50}
+\xdef\consMG{17} \xdef\consMN{17} \xdef\consMD{33} \xdef\consME{33} \xdef\consMQ{33}
+\xdef\consMH{33} \xdef\consMR{33} \xdef\consMK{33} \xdef\consMM{100} \xdef\consMI{67}
+\xdef\consML{83} \xdef\consMV{67} \xdef\consMF{50} \xdef\consMY{33} \xdef\consMW{50}
+\expandafter\xdef\csname consM.\endcsname{0}
+
+\xdef\consIC{33} \xdef\consIS{33} \xdef\consIT{50} \xdef\consIP{33} \xdef\consIA{33}
+\xdef\consIG{33} \xdef\consIN{33} \xdef\consID{17} \xdef\consIE{17} \xdef\consIQ{17}
+\xdef\consIH{33} \xdef\consIR{33} \xdef\consIK{33} \xdef\consIM{67} \xdef\consII{100}
+\xdef\consIL{83} \xdef\consIV{33} \xdef\consIF{67} \xdef\consIY{50} \xdef\consIW{50}
+\expandafter\xdef\csname consI.\endcsname{0}
+
+\xdef\consLC{33} \xdef\consLS{33} \xdef\consLT{33} \xdef\consLP{50} \xdef\consLA{33}
+\xdef\consLG{33} \xdef\consLN{17} \xdef\consLD{17} \xdef\consLE{17} \xdef\consLQ{33}
+\xdef\consLH{50} \xdef\consLR{33} \xdef\consLK{33} \xdef\consLM{83} \xdef\consLI{83}
+\xdef\consLL{100} \xdef\consLV{33} \xdef\consLF{67} \xdef\consLY{50} \xdef\consLW{67}
+\expandafter\xdef\csname consL.\endcsname{0}
+
+\xdef\consVC{33} \xdef\consVS{67} \xdef\consVT{67} \xdef\consVP{67} \xdef\consVA{83}
+\xdef\consVG{67} \xdef\consVN{33} \xdef\consVD{50} \xdef\consVE{67} \xdef\consVQ{33}
+\xdef\consVH{17} \xdef\consVR{33} \xdef\consVK{50} \xdef\consVM{67} \xdef\consVI{33}
+\xdef\consVL{33} \xdef\consVV{100} \xdef\consVF{67} \xdef\consVY{50} \xdef\consVW{50}
+\expandafter\xdef\csname consV.\endcsname{0}
+
+\xdef\consFC{50} \xdef\consFS{50} \xdef\consFT{33} \xdef\consFP{50} \xdef\consFA{50}
+\xdef\consFG{33} \xdef\consFN{33} \xdef\consFD{17} \xdef\consFE{33} \xdef\consFQ{17}
+\xdef\consFH{33} \xdef\consFR{17} \xdef\consFK{17} \xdef\consFM{50} \xdef\consFI{67}
+\xdef\consFL{67} \xdef\consFV{67} \xdef\consFF{100} \xdef\consFY{83} \xdef\consFW{50}
+\expandafter\xdef\csname consF.\endcsname{0}
+
+\xdef\consYC{50} \xdef\consYS{50} \xdef\consYT{33} \xdef\consYP{33} \xdef\consYA{33}
+\xdef\consYG{33} \xdef\consYN{50} \xdef\consYD{33} \xdef\consYE{17} \xdef\consYQ{33}
+\xdef\consYH{50} \xdef\consYR{17} \xdef\consYK{17} \xdef\consYM{33} \xdef\consYI{50}
+\xdef\consYL{50} \xdef\consYV{50} \xdef\consYF{83} \xdef\consYY{100} \xdef\consYW{50}
+\expandafter\xdef\csname consY.\endcsname{0}
+
+\xdef\consWC{50} \xdef\consWS{33} \xdef\consWT{17} \xdef\consWP{33} \xdef\consWA{33}
+\xdef\consWG{50} \xdef\consWN{0} \xdef\consWD{0} \xdef\consWE{17} \xdef\consWQ{17}
+\xdef\consWH{17} \xdef\consWR{33} \xdef\consWK{17} \xdef\consWM{50} \xdef\consWI{50}
+\xdef\consWL{67} \xdef\consWV{50} \xdef\consWF{50} \xdef\consWY{50} \xdef\consWW{100}
+\expandafter\xdef\csname consW.\endcsname{0}
+
+\expandafter\xdef\csname cons.C\endcsname{0}
+\expandafter\xdef\csname cons.S\endcsname{0}
+\expandafter\xdef\csname cons.T\endcsname{0}
+\expandafter\xdef\csname cons.P\endcsname{0}
+\expandafter\xdef\csname cons.A\endcsname{0}
+\expandafter\xdef\csname cons.G\endcsname{0}
+\expandafter\xdef\csname cons.N\endcsname{0}
+\expandafter\xdef\csname cons.D\endcsname{0}
+\expandafter\xdef\csname cons.E\endcsname{0}
+\expandafter\xdef\csname cons.Q\endcsname{0}
+\expandafter\xdef\csname cons.H\endcsname{0}
+\expandafter\xdef\csname cons.R\endcsname{0}
+\expandafter\xdef\csname cons.K\endcsname{0}
+\expandafter\xdef\csname cons.M\endcsname{0}
+\expandafter\xdef\csname cons.I\endcsname{0}
+\expandafter\xdef\csname cons.L\endcsname{0}
+\expandafter\xdef\csname cons.V\endcsname{0}
+\expandafter\xdef\csname cons.F\endcsname{0}
+\expandafter\xdef\csname cons.Y\endcsname{0}
+\expandafter\xdef\csname cons.W\endcsname{0}
+\expandafter\xdef\csname cons..\endcsname{0}
+
+\def\c@d@ns{%
+\codon{A}{GCA,GCG,GCC,GCT,GCU,GCN}
+\codon{B}{---}
+\codon{C}{TGC,TGT,UGC,UGU,TGY}
+\codon{D}{GAC,GAT,GAU,GAY}
+\codon{E}{GAA,GAG,GAR}
+\codon{F}{TTC,TTT,UUC,UUU,TTY}
+\codon{G}{GGA,GGG,GGC,GGT,GGU,GGN}
+\codon{H}{CAC,CAT,CAY}
+\codon{I}{ATA,ATC,ATT,AUA,AUC,AUU,ATH}
+\codon{J}{---}
+\codon{K}{AAA,AAG,AAG,AAR}
+\codon{L}{CTA,CTG,CTC,CTT,TTA,TTG,CUG,CUG,CUC,CUU,UUA,UUG,YTN}
+\codon{M}{ATG,AUG,ATG}
+\codon{N}{AAC,AAT,AAU,AAY}
+\codon{O}{---}
+\codon{P}{CCA,CCG,CCC,CCT,CCU,CCN}
+\codon{Q}{CAA,CAG,CAR}
+\codon{R}{AGA,AGG,CGA,CGG,CGC,CGT,CGU,MGN}
+\codon{S}{TCT,TCC,TCG,TCA,AGT,AGC,UCU,UCC,UCG,UCA,AGU,WSN}
+\codon{T}{ACT,ACC,ACG,ACA,ACU,ACN}
+\codon{U}{---}
+\codon{V}{GTA,GTG,GTC,GTT,GUA,GUG,GUC,GUU,GTN}
+\codon{W}{TGG,UGG,TGG}
+\codon{X}{---}
+\codon{Y}{TAC,TAT,UAC,UAU,TAY}
+\codon{Z}{---}
+\codon{.}{TAA,TAG,TGA,UAA,UAG,UGA,TRR}
+}
+
+\definecolor{GreenYellow} {cmyk}{0.15,0,0.69,0}
+\definecolor{Yellow} {cmyk}{0,0,1,0}
+\definecolor{Goldenrod} {cmyk}{0,0.10,0.84,0}
+\definecolor{Dandelion} {cmyk}{0,0.29,0.84,0}
+\definecolor{Apricot} {cmyk}{0,0.32,0.52,0}
+\definecolor{Peach} {cmyk}{0,0.50,0.70,0}
+\definecolor{Melon} {cmyk}{0,0.46,0.50,0}
+\definecolor{YellowOrange} {cmyk}{0,0.42,1,0}
+\definecolor{Orange} {cmyk}{0,0.61,0.87,0}
+\definecolor{BurntOrange} {cmyk}{0,0.51,1,0}
+\definecolor{Bittersweet} {cmyk}{0,0.75,1,0.24}
+\definecolor{RedOrange} {cmyk}{0,0.77,0.87,0}
+\definecolor{Mahagony} {cmyk}{0,0.85,0.87,0.35}
+\definecolor{Maroon} {cmyk}{0,0.87,0.68,0.32}
+\definecolor{BrickRed} {cmyk}{0,0.89,0.94,0.28}
+\definecolor{Red} {cmyk}{0,1,1,0}
+\definecolor{OrangeRed} {cmyk}{0,1,0.50,0}
+\definecolor{RubineRed} {cmyk}{0,1,0.13,0}
+\definecolor{WildStrawberry}{cmyk}{0,0.96,0.39,0}
+\definecolor{Salmon} {cmyk}{0,0.53,0.38,0}
+\definecolor{CarnationPink} {cmyk}{0,0.63,0,0}
+\definecolor{Magenta} {cmyk}{0,1,0,0}
+\definecolor{VioletRed} {cmyk}{0,0.81,0,0}
+\definecolor{Rhodamine} {cmyk}{0,0.82,0,0}
+\definecolor{Mulberry} {cmyk}{0.34,0.90,0,0.02}
+\definecolor{RedViolet} {cmyk}{0.07,0.90,0,0.34}
+\definecolor{Fuchsia} {cmyk}{0.47,0.91,0,0.08}
+\definecolor{Lavender} {cmyk}{0,0.48,0,0}
+\definecolor{Thistle} {cmyk}{0.12,0.59,0,0}
+\definecolor{Orchid} {cmyk}{0.32,0.64,0,0}
+\definecolor{DarkOrchid} {cmyk}{0.40,0.80,0.20,0}
+\definecolor{Purple} {cmyk}{0.45,0.86,0,0}
+\definecolor{Plum} {cmyk}{0.50,1,0,0}
+\definecolor{Violet} {cmyk}{0.79,0.88,0,0}
+\definecolor{RoyalPurple} {cmyk}{0.75,0.90,0,0}
+\definecolor{BlueViolet} {cmyk}{0.86,0.91,0,0.04}
+\definecolor{Periwinkle} {cmyk}{0.57,0.55,0,0}
+\definecolor{CadetBlue} {cmyk}{0.62,0.57,0.23,0}
+\definecolor{CornflowerBlue}{cmyk}{0.65,0.13,0,0}
+\definecolor{MidnightBlue} {cmyk}{0.98,0.13,0,0.43}
+\definecolor{NavyBlue} {cmyk}{0.94,0.54,0,0}
+\definecolor{RoyalBlue} {cmyk}{1,0.50,0,0}
+\definecolor{Blue} {cmyk}{1,1,0,0}
+\definecolor{Cerulean} {cmyk}{0.94,0.11,0,0}
+\definecolor{Cyan} {cmyk}{1,0,0,0}
+\definecolor{ProcessBlue} {cmyk}{0.96,0,0,0}
+\definecolor{SkyBlue} {cmyk}{0.62,0,0.12,0}
+\definecolor{TurquoisQ} {cmyk}{0.85,0,0.20,0}
+\definecolor{TealBlue} {cmyk}{0.86,0,0.34,0.02}
+\definecolor{Aquamarine} {cmyk}{0.82,0,0.30,0}
+\definecolor{BlueGreen} {cmyk}{0.85,0,0.33,0}
+\definecolor{Emerald} {cmyk}{1,0,0.50,0}
+\definecolor{JungleGreen} {cmyk}{0.99,0,0.52,0}
+\definecolor{SeaGreen} {cmyk}{0.69,0,0.50,0}
+\definecolor{Green} {cmyk}{1,0,1,0}
+\definecolor{ForestGreen} {cmyk}{0.91,0,0.88,0.12}
+\definecolor{PineGreen} {cmyk}{0.92,0,0.59,0.25}
+\definecolor{LimeGreen} {cmyk}{0.50,0,1,0}
+\definecolor{YellowGreen} {cmyk}{0.44,0,0.74,0}
+\definecolor{SpringGreen} {cmyk}{0.26,0,0.76,0}
+\definecolor{OliveGreen} {cmyk}{0.64,0,0.95,0.40}
+\definecolor{RawSienna} {cmyk}{0,0.72,1,0.45}
+\definecolor{Sepia} {cmyk}{0,0.83,1,0.70}
+\definecolor{Brown} {cmyk}{0,0.81,1,0.60}
+\definecolor{Tan} {cmyk}{0.14,0.42,0.56,0}
+\definecolor{White} {cmyk}{0,0,0,0}
+\definecolor{Gray0} {cmyk}{0,0,0,0}
+\definecolor{Gray5} {cmyk}{0,0,0,0.05}
+\definecolor{Gray10} {cmyk}{0,0,0,0.10}
+\definecolor{Gray15} {cmyk}{0,0,0,0.15}
+\definecolor{Gray20} {cmyk}{0,0,0,0.20}
+\definecolor{Gray25} {cmyk}{0,0,0,0.25}
+\definecolor{Gray30} {cmyk}{0,0,0,0.30}
+\definecolor{LightGray} {cmyk}{0,0,0,0.33}
+\definecolor{Gray35} {cmyk}{0,0,0,0.35}
+\definecolor{Gray40} {cmyk}{0,0,0,0.40}
+\definecolor{Gray45} {cmyk}{0,0,0,0.45}
+\definecolor{Gray50} {cmyk}{0,0,0,0.50}
+\definecolor{Gray} {cmyk}{0,0,0,0.50}
+\definecolor{GrayDefault} {cmyk}{0,0,0,0.50}
+\definecolor{Gray55} {cmyk}{0,0,0,0.55}
+\definecolor{Gray60} {cmyk}{0,0,0,0.60}
+\definecolor{Gray65} {cmyk}{0,0,0,0.65}
+\definecolor{DarkGray} {cmyk}{0,0,0,0.66}
+\definecolor{Gray70} {cmyk}{0,0,0,0.70}
+\definecolor{Gray75} {cmyk}{0,0,0,0.75}
+\definecolor{Gray80} {cmyk}{0,0,0,0.80}
+\definecolor{Gray85} {cmyk}{0,0,0,0.85}
+\definecolor{Gray90} {cmyk}{0,0,0,0.90}
+\definecolor{Gray95} {cmyk}{0,0,0,0.95}
+\definecolor{Black} {cmyk}{0,0,0,1}
+\definecolor{Gray100} {cmyk}{0,0,0,1}
+\definecolor{LightGreenYellow} {cmyk}{0.08,0,0.35,0}
+\definecolor{LightYellow} {cmyk}{0,0,0.50,0}
+\definecolor{LightGoldenrod} {cmyk}{0,0.05,0.42,0}
+\definecolor{LightDandelion} {cmyk}{0,0.15,0.42,0}
+\definecolor{LightApricot} {cmyk}{0,0.16,0.26,0}
+\definecolor{LightPeach} {cmyk}{0,0.25,0.35,0}
+\definecolor{LightMelon} {cmyk}{0,0.23,0.25,0}
+\definecolor{LightYellowOrange} {cmyk}{0,0.21,0.50,0}
+\definecolor{LightOrange} {cmyk}{0,0.31,0.44,0}
+\definecolor{LightBurntOrange} {cmyk}{0,0.26,0.50,0}
+\definecolor{LightBittersweet} {cmyk}{0,0.38,0.50,0.12}
+\definecolor{LightRedOrange} {cmyk}{0,0.39,0.44,0}
+\definecolor{LightMahagony} {cmyk}{0,0.43,0.44,0.18}
+\definecolor{LightMaroon} {cmyk}{0,0.44,0.34,0.16}
+\definecolor{LightBrickRed} {cmyk}{0,0.45,0.47,0.14}
+\definecolor{LightRed} {cmyk}{0,0.50,0.50,0}
+\definecolor{LightOrangeRed} {cmyk}{0,0.50,0.25,0}
+\definecolor{LightRubineRed} {cmyk}{0,0.50,0.07,0}
+\definecolor{LightWildStrawberry}{cmyk}{0,0.48,0.20,0}
+\definecolor{LightSalmon} {cmyk}{0,0.27,0.19,0}
+\definecolor{LightCarnationPink} {cmyk}{0,0.32,0,0}
+\definecolor{LightMagenta} {cmyk}{0,0.50,0,0}
+\definecolor{LightVioletRed} {cmyk}{0,0.40,0,0}
+\definecolor{LightRhodamine} {cmyk}{0,0.41,0,0}
+\definecolor{LightMulberry} {cmyk}{0.17,0.45,0,0.01}
+\definecolor{LightRedViolet} {cmyk}{0.04,0.45,0,0.17}
+\definecolor{LightFuchsia} {cmyk}{0.24,0.46,0,0.04}
+\definecolor{LightLavender} {cmyk}{0,0.24,0,0}
+\definecolor{LightThistle} {cmyk}{0.06,0.30,0,0}
+\definecolor{LightOrchid} {cmyk}{0.16,0.32,0,0}
+\definecolor{LightDarkOrchid} {cmyk}{0.20,0.40,0.10,0}
+\definecolor{LightPurple} {cmyk}{0.23,0.43,0,0}
+\definecolor{LightPlum} {cmyk}{0.25,0.50,0,0}
+\definecolor{LightViolet} {cmyk}{0.40,0.44,0,0}
+\definecolor{LightRoyalPurple} {cmyk}{0.38,0.45,0,0}
+\definecolor{LightBlueViolet} {cmyk}{0.43,0.46,0,0.02}
+\definecolor{LightPeriwinkle} {cmyk}{0.29,0.28,0,0}
+\definecolor{LightCadetBlue} {cmyk}{0.31,0.29,0.12,0}
+\definecolor{LightCornflowerBlue}{cmyk}{0.33,0.07,0,0}
+\definecolor{LightMidnightBlue} {cmyk}{0.49,0.07,0,0.22}
+\definecolor{LightNavyBlue} {cmyk}{0.47,0.27,0,0}
+\definecolor{LightRoyalBlue} {cmyk}{0.50,0.25,0,0}
+\definecolor{LightBlue} {cmyk}{0.50,0.50,0,0}
+\definecolor{LightCerulean} {cmyk}{0.47,0.06,0,0}
+\definecolor{LightCyan} {cmyk}{0.50,0,0,0}
+\definecolor{LightProcessBlue} {cmyk}{0.48,0,0,0}
+\definecolor{LightSkyBlue} {cmyk}{0.31,0,0.06,0}
+\definecolor{LightTurquoise} {cmyk}{0.43,0,0.10,0}
+\definecolor{LightTealBlue} {cmyk}{0.43,0,0.17,0.01}
+\definecolor{LightAquamarine} {cmyk}{0.41,0,0.15,0}
+\definecolor{LightBlueGreen} {cmyk}{0.43,0,0.17,0}
+\definecolor{LightEmerald} {cmyk}{0.50,0,0.25,0}
+\definecolor{LightJungleGreen} {cmyk}{0.50,0,0.26,0}
+\definecolor{LightSeaGreen} {cmyk}{0.35,0,0.25,0}
+\definecolor{LightGreen} {cmyk}{0.50,0,0.50,0}
+\definecolor{LightForestGreen} {cmyk}{0.46,0,0.44,0.06}
+\definecolor{LightPineGreen} {cmyk}{0.46,0,0.30,0.13}
+\definecolor{LightLimeGreen} {cmyk}{0.25,0,0.50,0}
+\definecolor{LightYellowGreen} {cmyk}{0.22,0,0.37,0}
+\definecolor{LightSpringGreen} {cmyk}{0.13,0,0.38,0}
+\definecolor{LightOliveGreen} {cmyk}{0.32,0,0.48,0.20}
+\definecolor{LightRawSienna} {cmyk}{0,0.36,0.50,0.23}
+\definecolor{LightSepia} {cmyk}{0,0.44,0.50,0.35}
+\definecolor{LightBrown} {cmyk}{0,0.41,0.50,0.30}
+\definecolor{LightTan} {cmyk}{0.07,0.21,0.28,0}
+\definecolor{LightWhite} {cmyk}{0,0,0,0}
+\definecolor{LightGray0} {cmyk}{0,0,0,0}
+\definecolor{LightGray5} {cmyk}{0,0,0,0.02}
+\definecolor{LightGray10} {cmyk}{0,0,0,0.05}
+\definecolor{LightGray15} {cmyk}{0,0,0,0.07}
+\definecolor{LightGray20} {cmyk}{0,0,0,0.10}
+\definecolor{LightGray25} {cmyk}{0,0,0,0.12}
+\definecolor{LightGray30} {cmyk}{0,0,0,0.15}
+\definecolor{LightLightGray} {cmyk}{0,0,0,0.16}
+\definecolor{LightGray35} {cmyk}{0,0,0,0.17}
+\definecolor{LightGray40} {cmyk}{0,0,0,0.20}
+\definecolor{LightGray45} {cmyk}{0,0,0,0.22}
+\definecolor{LightGray50} {cmyk}{0,0,0,0.25}
+\definecolor{LightGray} {cmyk}{0,0,0,0.25}
+\definecolor{LightGray55} {cmyk}{0,0,0,0.27}
+\definecolor{LightGray60} {cmyk}{0,0,0,0.30}
+\definecolor{LightGray65} {cmyk}{0,0,0,0.32}
+\definecolor{LightDarkGray} {cmyk}{0,0,0,0.33}
+\definecolor{LightGray70} {cmyk}{0,0,0,0.35}
+\definecolor{LightGray75} {cmyk}{0,0,0,0.37}
+\definecolor{LightGray80} {cmyk}{0,0,0,0.40}
+\definecolor{LightGray85} {cmyk}{0,0,0,0.42}
+\definecolor{LightGray90} {cmyk}{0,0,0,0.45}
+\definecolor{LightGray95} {cmyk}{0,0,0,0.47}
+\definecolor{LightBlack} {cmyk}{0,0,0,0.50}
+\definecolor{LightGray100} {cmyk}{0,0,0,0.50}
+\definecolor{LightLightGreenYellow} {cmyk}{0.04,0,0.17,0}
+\definecolor{LightLightYellow} {cmyk}{0,0,0.25,0}
+\definecolor{LightLightGoldenrod} {cmyk}{0,0.02,0.21,0}
+\definecolor{LightLightDandelion} {cmyk}{0,0.07,0.21,0}
+\definecolor{LightLightApricot} {cmyk}{0,0.08,0.13,0}
+\definecolor{LightLightPeach} {cmyk}{0,0.12,0.17,0}
+\definecolor{LightLightMelon} {cmyk}{0,0.11,0.12,0}
+\definecolor{LightLightYellowOrange} {cmyk}{0,0.10,0.25,0}
+\definecolor{LightLightOrange} {cmyk}{0,0.15,0.22,0}
+\definecolor{LightLightBurntOrange} {cmyk}{0,0.13,0.25,0}
+\definecolor{LightLightBittersweet} {cmyk}{0,0.19,0.25,0.06}
+\definecolor{LightLightRedOrange} {cmyk}{0,0.14,0.22,0}
+\definecolor{LightLightMahagony} {cmyk}{0,0.21,0.22,0.09}
+\definecolor{LightLightMaroon} {cmyk}{0,0.22,0.17,0.08}
+\definecolor{LightLightBrickRed} {cmyk}{0,0.22,0.23,0.07}
+\definecolor{LightLightRed} {cmyk}{0,0.25,0.25,0}
+\definecolor{LightLightOrangeRed} {cmyk}{0,0.25,0.12,0}
+\definecolor{LightLightRubineRed} {cmyk}{0,0.25,0.03,0}
+\definecolor{LightLightWildStrawberry}{cmyk}{0,0.24,0.10,0}
+\definecolor{LightLightSalmon} {cmyk}{0,0.13,0.09,0}
+\definecolor{LightLightCarnationPink} {cmyk}{0,0.16,0,0}
+\definecolor{LightLightMagenta} {cmyk}{0,0.25,0,0}
+\definecolor{LightLightVioletRed} {cmyk}{0,0.20,0,0}
+\definecolor{LightLightRhodamine} {cmyk}{0,0.20,0,0}
+\definecolor{LightLightMulberry} {cmyk}{0.08,0.22,0,0.005}
+\definecolor{LightLightRedViolet} {cmyk}{0.02,0.22,0,0.08}
+\definecolor{LightLightFuchsia} {cmyk}{0.12,0.23,0,0.02}
+\definecolor{LightLightLavender} {cmyk}{0,0.12,0,0}
+\definecolor{LightLightThistle} {cmyk}{0.03,0.15,0,0}
+\definecolor{LightLightOrchid} {cmyk}{0.08,0.16,0,0}
+\definecolor{LightLightDarkOrchid} {cmyk}{0.10,0.20,0.05,0}
+\definecolor{LightLightPurple} {cmyk}{0.11,0.21,0,0}
+\definecolor{LightLightPlum} {cmyk}{0.12,0.25,0,0}
+\definecolor{LightLightViolet} {cmyk}{0.20,0.22,0,0}
+\definecolor{LightLightRoyalPurple} {cmyk}{0.19,0.22,0,0}
+\definecolor{LightLightBlueViolet} {cmyk}{0.21,0.23,0,0.01}
+\definecolor{LightLightPeriwinkle} {cmyk}{0.14,0.14,0,0}
+\definecolor{LightLightCadetBlue} {cmyk}{0.15,0.14,0.06,0}
+\definecolor{LightLightCornflowerBlue}{cmyk}{0.16,0.03,0,0}
+\definecolor{LightLightMidnightBlue} {cmyk}{0.24,0.03,0,0.11}
+\definecolor{LightLightNavyBlue} {cmyk}{0.23,0.13,0,0}
+\definecolor{LightLightRoyalBlue} {cmyk}{0.25,0.12,0,0}
+\definecolor{LightLightBlue} {cmyk}{0.25,0.25,0,0}
+\definecolor{LightLightCerulean} {cmyk}{0.23,0.03,0,0}
+\definecolor{LightLightCyan} {cmyk}{0.25,0,0,0}
+\definecolor{LightLightProcessBlue} {cmyk}{0.24,0,0,0}
+\definecolor{LightLightSkyBlue} {cmyk}{0.15,0,0.03,0}
+\definecolor{LightLightTurquoise} {cmyk}{0.21,0,0.05,0}
+\definecolor{LightLightTealBlue} {cmyk}{0.21,0,0.08,0.005}
+\definecolor{LightLightAquamarine} {cmyk}{0.20,0,0.07,0}
+\definecolor{LightLightBlueGreen} {cmyk}{0.21,0,0.08,0}
+\definecolor{LightLightEmerald} {cmyk}{0.25,0,0.12,0}
+\definecolor{LightLightJungleGreen} {cmyk}{0.25,0,0.13,0}
+\definecolor{LightLightSeaGreen} {cmyk}{0.17,0,0.12,0}
+\definecolor{LightLightGreen} {cmyk}{0.25,0,0.25,0}
+\definecolor{LightLightForestGreen} {cmyk}{0.23,0,0.22,0.03}
+\definecolor{LightLightPineGreen} {cmyk}{0.23,0,0.15,0.06}
+\definecolor{LightLightLimeGreen} {cmyk}{0.12,0,0.25,0}
+\definecolor{LightLightYellowGreen} {cmyk}{0.11,0,0.18,0}
+\definecolor{LightLightSpringGreen} {cmyk}{0.06,0,0.19,0}
+\definecolor{LightLightOliveGreen} {cmyk}{0.16,0,0.24,0.10}
+\definecolor{LightLightRawSienna} {cmyk}{0,0.18,0.25,0.11}
+\definecolor{LightLightSepia} {cmyk}{0,0.22,0.25,0.17}
+\definecolor{LightLightBrown} {cmyk}{0,0.20,0.25,0.15}
+\definecolor{LightLightTan} {cmyk}{0.03,0.10,0.14,0}
+\definecolor{LightLightWhite} {cmyk}{0,0,0,0}
+\definecolor{LightLightGray0} {cmyk}{0,0,0,0}
+\definecolor{LightLightGray5} {cmyk}{0,0,0,0.01}
+\definecolor{LightLightGray10} {cmyk}{0,0,0,0.02}
+\definecolor{LightLightGray15} {cmyk}{0,0,0,0.03}
+\definecolor{LightLightGray20} {cmyk}{0,0,0,0.05}
+\definecolor{LightLightGray25} {cmyk}{0,0,0,0.06}
+\definecolor{LightLightGray30} {cmyk}{0,0,0,0.07}
+\definecolor{LightLightLightGray} {cmyk}{0,0,0,0.08}
+\definecolor{LightLightGray35} {cmyk}{0,0,0,0.09}
+\definecolor{LightLightGray40} {cmyk}{0,0,0,0.10}
+\definecolor{LightLightGray45} {cmyk}{0,0,0,0.11}
+\definecolor{LightLightGray50} {cmyk}{0,0,0,0.12}
+\definecolor{LightLightGray} {cmyk}{0,0,0,0.13}
+\definecolor{LightLightGray55} {cmyk}{0,0,0,0.14}
+\definecolor{LightLightGray60} {cmyk}{0,0,0,0.15}
+\definecolor{LightLightGray65} {cmyk}{0,0,0,0.16}
+\definecolor{LightLightDarkGray} {cmyk}{0,0,0,0.17}
+\definecolor{LightLightGray70} {cmyk}{0,0,0,0.18}
+\definecolor{LightLightGray75} {cmyk}{0,0,0,0.19}
+\definecolor{LightLightGray80} {cmyk}{0,0,0,0.20}
+\definecolor{LightLightGray85} {cmyk}{0,0,0,0.21}
+\definecolor{LightLightGray90} {cmyk}{0,0,0,0.22}
+\definecolor{LightLightGray95} {cmyk}{0,0,0,0.23}
+\definecolor{LightLightBlack} {cmyk}{0,0,0,0.25}
+\definecolor{LightLightGray100} {cmyk}{0,0,0,0.25}
+\definecolor{LightLightLightGreenYellow} {cmyk}{0.02,0,0.08,0}
+\definecolor{LightLightLightYellow} {cmyk}{0,0,0.12,0}
+\definecolor{LightLightLightGoldenrod} {cmyk}{0,0.01,0.10,0}
+\definecolor{LightLightLightDandelion} {cmyk}{0,0.03,0.10,0}
+\definecolor{LightLightLightApricot} {cmyk}{0,0.04,0.06,0}
+\definecolor{LightLightLightPeach} {cmyk}{0,0.06,0.08,0}
+\definecolor{LightLightLightMelon} {cmyk}{0,0.05,0.06,0}
+\definecolor{LightLightLightYellowOrange} {cmyk}{0,0.05,0.12,0}
+\definecolor{LightLightLightOrange} {cmyk}{0,0.07,0.11,0}
+\definecolor{LightLightLightBurntOrange} {cmyk}{0,0.06,0.12,0}
+\definecolor{LightLightLightBittersweet} {cmyk}{0,0.09,0.12,0.03}
+\definecolor{LightLightLightRedOrange} {cmyk}{0,0.07,0.11,0}
+\definecolor{LightLightLightMahagony} {cmyk}{0,0.10,0.11,0.04}
+\definecolor{LightLightLightMaroon} {cmyk}{0,0.11,0.08,0.04}
+\definecolor{LightLightLightBrickRed} {cmyk}{0,0.11,0.11,0.03}
+\definecolor{LightLightLightRed} {cmyk}{0,0.12,0.12,0}
+\definecolor{LightLightLightOrangeRed} {cmyk}{0,0.12,0.06,0}
+\definecolor{LightLightLightRubineRed} {cmyk}{0,0.12,0.01,0}
+\definecolor{LightLightLightWildStrawberry}{cmyk}{0,0.12,0.05,0}
+\definecolor{LightLightLightSalmon} {cmyk}{0,0.06,0.04,0}
+\definecolor{LightLightLightCarnationPink} {cmyk}{0,0.08,0,0}
+\definecolor{LightLightLightMagenta} {cmyk}{0,0.12,0,0}
+\definecolor{LightLightLightVioletRed} {cmyk}{0,0.10,0,0}
+\definecolor{LightLightLightRhodamine} {cmyk}{0,0.10,0,0}
+\definecolor{LightLightLightMulberry} {cmyk}{0.04,0.11,0,0.002}
+\definecolor{LightLightLightRedViolet} {cmyk}{0.01,0.11,0,0.04}
+\definecolor{LightLightLightFuchsia} {cmyk}{0.06,0.11,0,0.01}
+\definecolor{LightLightLightLavender} {cmyk}{0,0.06,0,0}
+\definecolor{LightLightLightThistle} {cmyk}{0.01,0.07,0,0}
+\definecolor{LightLightLightOrchid} {cmyk}{0.04,0.08,0,0}
+\definecolor{LightLightLightDarkOrchid} {cmyk}{0.05,0.10,0.02,0}
+\definecolor{LightLightLightPurple} {cmyk}{0.05,0.10,0,0}
+\definecolor{LightLightLightPlum} {cmyk}{0.06,0.12,0,0}
+\definecolor{LightLightLightViolet} {cmyk}{0.10,0.11,0,0}
+\definecolor{LightLightLightRoyalPurple} {cmyk}{0.09,0.11,0,0}
+\definecolor{LightLightLightBlueViolet} {cmyk}{0.10,0.11,0,0.005}
+\definecolor{LightLightLightPeriwinkle} {cmyk}{0.07,0.07,0,0}
+\definecolor{LightLightLightCadetBlue} {cmyk}{0.07,0.07,0.03,0}
+\definecolor{LightLightLightCornflowerBlue}{cmyk}{0.08,0.01,0,0}
+\definecolor{LightLightLightMidnightBlue} {cmyk}{0.12,0.01,0,0.05}
+\definecolor{LightLightLightNavyBlue} {cmyk}{0.11,0.06,0,0}
+\definecolor{LightLightLightRoyalBlue} {cmyk}{0.12,0.06,0,0}
+\definecolor{LightLightLightBlue} {cmyk}{0.12,0.12,0,0}
+\definecolor{LightLightLightCerulean} {cmyk}{0.11,0.01,0,0}
+\definecolor{LightLightLightCyan} {cmyk}{0.12,0,0,0}
+\definecolor{LightLightLightProcessBlue} {cmyk}{0.12,0,0,0}
+\definecolor{LightLightLightSkyBlue} {cmyk}{0.07,0,0.01,0}
+\definecolor{LightLightLightTurquoise} {cmyk}{0.10,0,0.02,0}
+\definecolor{LightLightLightTealBlue} {cmyk}{0.10,0,0.04,0.002}
+\definecolor{LightLightLightAquamarine} {cmyk}{0.10,0,0.03,0}
+\definecolor{LightLightLightBlueGreen} {cmyk}{0.10,0,0.04,0}
+\definecolor{LightLightLightEmerald} {cmyk}{0.12,0,0.06,0}
+\definecolor{LightLightLightJungleGreen} {cmyk}{0.12,0,0.06,0}
+\definecolor{LightLightLightSeaGreen} {cmyk}{0.08,0,0.06,0}
+\definecolor{LightLightLightGreen} {cmyk}{0.12,0,0.12,0}
+\definecolor{LightLightLightForestGreen} {cmyk}{0.11,0,0.11,0.01}
+\definecolor{LightLightLightPineGreen} {cmyk}{0.11,0,0.07,0.03}
+\definecolor{LightLightLightLimeGreen} {cmyk}{0.06,0,0.12,0}
+\definecolor{LightLightLightYellowGreen} {cmyk}{0.05,0,0.09,0}
+\definecolor{LightLightLightSpringGreen} {cmyk}{0.03,0,0.09,0}
+\definecolor{LightLightLightOliveGreen} {cmyk}{0.08,0,0.12,0.05}
+\definecolor{LightLightLightRawSienna} {cmyk}{0,0.09,0.12,0.05}
+\definecolor{LightLightLightSepia} {cmyk}{0,0.11,0.12,0.06}
+\definecolor{LightLightLightBrown} {cmyk}{0,0.10,0.12,0.07}
+\definecolor{LightLightLightTan} {cmyk}{0.01,0.05,0.07,0}
+\definecolor{LightLightLightWhite} {cmyk}{0,0,0,0}
+\definecolor{LightLightLightGray0} {cmyk}{0,0,0,0}
+\definecolor{LightLightLightGray5} {cmyk}{0,0,0,0.005}
+\definecolor{LightLightLightGray10} {cmyk}{0,0,0,0.01}
+\definecolor{LightLightLightGray15} {cmyk}{0,0,0,0.015}
+\definecolor{LightLightLightGray20} {cmyk}{0,0,0,0.025}
+\definecolor{LightLightLightGray25} {cmyk}{0,0,0,0.03}
+\definecolor{LightLightLightGray30} {cmyk}{0,0,0,0.035}
+\definecolor{LightLightLightLightGray} {cmyk}{0,0,0,0.04}
+\definecolor{LightLightLightGray35} {cmyk}{0,0,0,0.045}
+\definecolor{LightLightLightGray40} {cmyk}{0,0,0,0.05}
+\definecolor{LightLightLightGray45} {cmyk}{0,0,0,0.055}
+\definecolor{LightLightLightGray50} {cmyk}{0,0,0,0.06}
+\definecolor{LightLightLightGray} {cmyk}{0,0,0,0.065}
+\definecolor{LightLightLightGray55} {cmyk}{0,0,0,0.07}
+\definecolor{LightLightLightGray60} {cmyk}{0,0,0,0.075}
+\definecolor{LightLightLightGray65} {cmyk}{0,0,0,0.08}
+\definecolor{LightLightLightDarkGray} {cmyk}{0,0,0,0.085}
+\definecolor{LightLightLightGray70} {cmyk}{0,0,0,0.09}
+\definecolor{LightLightLightGray75} {cmyk}{0,0,0,0.095}
+\definecolor{LightLightLightGray80} {cmyk}{0,0,0,0.10}
+\definecolor{LightLightLightGray85} {cmyk}{0,0,0,0.105}
+\definecolor{LightLightLightGray90} {cmyk}{0,0,0,0.11}
+\definecolor{LightLightLightGray95} {cmyk}{0,0,0,0.115}
+\definecolor{LightLightLightBlack} {cmyk}{0,0,0,0.12}
+\definecolor{LightLightLightGray100} {cmyk}{0,0,0,0.125}
+\definecolor{BlueRed5} {rgb} {0.15,0.17,0.55}
+\definecolor{BlueRed10} {rgb} {0.20,0.23,0.57}
+\definecolor{BlueRed15} {rgb} {0.24,0.29,0.60}
+\definecolor{BlueRed20} {rgb} {0.33,0.35,0.64}
+\definecolor{BlueRed25} {rgb} {0.43,0.43,0.68}
+\definecolor{BlueRed30} {rgb} {0.52,0.52,0.73}
+\definecolor{BlueRed35} {rgb} {0.60,0.60,0.78}
+\definecolor{BlueRed40} {rgb} {0.70,0.70,0.84}
+\definecolor{BlueRed45} {rgb} {0.80,0.80,0.85}
+\definecolor{BlueRed50} {rgb} {0.86,0.82,0.82}
+\definecolor{BlueRed55} {rgb} {0.87,0.73,0.73}
+\definecolor{BlueRed60} {rgb} {0.89,0.64,0.64}
+\definecolor{BlueRed65} {rgb} {0.90,0.55,0.55}
+\definecolor{BlueRed70} {rgb} {0.91,0.47,0.46}
+\definecolor{BlueRed75} {rgb} {0.91,0.39,0.37}
+\definecolor{BlueRed80} {rgb} {0.90,0.33,0.28}
+\definecolor{BlueRed85} {rgb} {0.89,0.25,0.20}
+\definecolor{BlueRed90} {rgb} {0.88,0.23,0.14}
+\definecolor{BlueRed95} {rgb} {0.87,0.21,0.09}
+\definecolor{BlueRed100} {rgb} {0.87,0.16,0.04}
+\definecolor{RedBlue100} {rgb} {0.15,0.17,0.55}
+\definecolor{RedBlue95} {rgb} {0.15,0.17,0.55}
+\definecolor{RedBlue90} {rgb} {0.20,0.23,0.57}
+\definecolor{RedBlue85} {rgb} {0.24,0.29,0.60}
+\definecolor{RedBlue80} {rgb} {0.33,0.35,0.64}
+\definecolor{RedBlue75} {rgb} {0.43,0.43,0.68}
+\definecolor{RedBlue70} {rgb} {0.52,0.52,0.73}
+\definecolor{RedBlue65} {rgb} {0.60,0.60,0.78}
+\definecolor{RedBlue60} {rgb} {0.70,0.70,0.84}
+\definecolor{RedBlue55} {rgb} {0.80,0.80,0.85}
+\definecolor{RedBlue50} {rgb} {0.86,0.82,0.82}
+\definecolor{RedBlue45} {rgb} {0.87,0.73,0.73}
+\definecolor{RedBlue40} {rgb} {0.89,0.64,0.64}
+\definecolor{RedBlue35} {rgb} {0.90,0.55,0.55}
+\definecolor{RedBlue30} {rgb} {0.91,0.47,0.46}
+\definecolor{RedBlue25} {rgb} {0.91,0.39,0.37}
+\definecolor{RedBlue20} {rgb} {0.90,0.33,0.28}
+\definecolor{RedBlue15} {rgb} {0.89,0.25,0.20}
+\definecolor{RedBlue10} {rgb} {0.88,0.23,0.14}
+\definecolor{RedBlue5} {rgb} {0.87,0.21,0.09}
+\definecolor{GreenRed5} {rgb} {0,1,0}
+\definecolor{GreenRed10} {rgb} {0.05,0.95,0}
+\definecolor{GreenRed15} {rgb} {0.10,0.90,0}
+\definecolor{GreenRed20} {rgb} {0.15,0.85,0}
+\definecolor{GreenRed25} {rgb} {0.20,0.80,0}
+\definecolor{GreenRed30} {rgb} {0.25,0.75,0}
+\definecolor{GreenRed35} {rgb} {0.30,0.70,0}
+\definecolor{GreenRed40} {rgb} {0.35,0.65,0}
+\definecolor{GreenRed45} {rgb} {0.40,0.60,0}
+\definecolor{GreenRed50} {rgb} {0.45,0.55,0}
+\definecolor{GreenRed55} {rgb} {0.50,0.50,0}
+\definecolor{GreenRed60} {rgb} {0.55,0.45,0}
+\definecolor{GreenRed65} {rgb} {0.60,0.40,0}
+\definecolor{GreenRed70} {rgb} {0.65,0.35,0}
+\definecolor{GreenRed75} {rgb} {0.70,0.30,0}
+\definecolor{GreenRed80} {rgb} {0.75,0.25,0}
+\definecolor{GreenRed85} {rgb} {0.80,0.20,0}
+\definecolor{GreenRed90} {rgb} {0.85,0.15,0}
+\definecolor{GreenRed95} {rgb} {0.90,0.10,0}
+\definecolor{GreenRed100} {rgb} {0.95,0.05,0}
+\definecolor{RedGreen100} {rgb} {0.05,0.95,0}
+\definecolor{RedGreen95} {rgb} {0.10,0.90,0}
+\definecolor{RedGreen90} {rgb} {0.15,0.85,0}
+\definecolor{RedGreen85} {rgb} {0.20,0.80,0}
+\definecolor{RedGreen80} {rgb} {0.25,0.75,0}
+\definecolor{RedGreen75} {rgb} {0.30,0.70,0}
+\definecolor{RedGreen70} {rgb} {0.35,0.65,0}
+\definecolor{RedGreen65} {rgb} {0.40,0.60,0}
+\definecolor{RedGreen60} {rgb} {0.45,0.55,0}
+\definecolor{RedGreen55} {rgb} {0.50,0.50,0}
+\definecolor{RedGreen50} {rgb} {0.55,0.45,0}
+\definecolor{RedGreen45} {rgb} {0.60,0.40,0}
+\definecolor{RedGreen40} {rgb} {0.65,0.35,0}
+\definecolor{RedGreen35} {rgb} {0.70,0.30,0}
+\definecolor{RedGreen30} {rgb} {0.75,0.25,0}
+\definecolor{RedGreen25} {rgb} {0.80,0.20,0}
+\definecolor{RedGreen20} {rgb} {0.85,0.15,0}
+\definecolor{RedGreen15} {rgb} {0.90,0.10,0}
+\definecolor{RedGreen10} {rgb} {0.95,0.05,0}
+\definecolor{RedGreen5} {rgb} {1,0,0}
+\definecolor{ColdHot5} {rgb} {0,0.08,1}
+\definecolor{ColdHot10} {rgb} {0,0.29,1}
+\definecolor{ColdHot15} {rgb} {0,0.49,1}
+\definecolor{ColdHot20} {rgb} {0,0.70,1}
+\definecolor{ColdHot25} {rgb} {0,0.90,1}
+\definecolor{ColdHot30} {rgb} {0,1,0.87}
+\definecolor{ColdHot35} {rgb} {0,1,0.68}
+\definecolor{ColdHot40} {rgb} {0,1,0.46}
+\definecolor{ColdHot45} {rgb} {0,1,0.25}
+\definecolor{ColdHot50} {rgb} {0,1,0.04}
+\definecolor{ColdHot55} {rgb} {0.16,1,0}
+\definecolor{ColdHot60} {rgb} {0.35,1,0}
+\definecolor{ColdHot65} {rgb} {0.56,1,0}
+\definecolor{ColdHot70} {rgb} {0.79,1,0}
+\definecolor{ColdHot75} {rgb} {0.98,1,0}
+\definecolor{ColdHot80} {rgb} {1,0.82,0}
+\definecolor{ColdHot85} {rgb} {1,0.60,0}
+\definecolor{ColdHot90} {rgb} {1,0.40,0}
+\definecolor{ColdHot95} {rgb} {1,0.20,0}
+\definecolor{ColdHot100} {rgb} {0.91,0,0}
+\definecolor{HotCold100} {rgb} {0,0.08,1}
+\definecolor{HotCold95} {rgb} {0,0.29,1}
+\definecolor{HotCold90} {rgb} {0,0.49,1}
+\definecolor{HotCold85} {rgb} {0,0.70,1}
+\definecolor{HotCold80} {rgb} {0,0.90,1}
+\definecolor{HotCold75} {rgb} {0,1,0.87}
+\definecolor{HotCold70} {rgb} {0,1,0.68}
+\definecolor{HotCold65} {rgb} {0,1,0.46}
+\definecolor{HotCold60} {rgb} {0,1,0.25}
+\definecolor{HotCold55} {rgb} {0,1,0.04}
+\definecolor{HotCold50} {rgb} {0.16,1,0}
+\definecolor{HotCold45} {rgb} {0.35,1,0}
+\definecolor{HotCold40} {rgb} {0.56,1,0}
+\definecolor{HotCold35} {rgb} {0.79,1,0}
+\definecolor{HotCold30} {rgb} {0.98,1,0}
+\definecolor{HotCold25} {rgb} {1,0.82,0}
+\definecolor{HotCold20} {rgb} {1,0.60,0}
+\definecolor{HotCold15} {rgb} {1,0.40,0}
+\definecolor{HotCold10} {rgb} {1,0.20,0}
+\definecolor{HotCold5} {rgb} {0.91,0,0}
+
+
+\def\make@lower{%
+\if\first@ A\xdef\first@{a}\else \if\first@ B\xdef\first@{b}\else
+\if\first@ C\xdef\first@{c}\else \if\first@ D\xdef\first@{d}\else
+\if\first@ E\xdef\first@{e}\else \if\first@ F\xdef\first@{f}\else
+\if\first@ G\xdef\first@{g}\else \if\first@ H\xdef\first@{h}\else
+\if\first@ I\xdef\first@{i}\else \if\first@ J\xdef\first@{j}\else
+\if\first@ K\xdef\first@{k}\else \if\first@ L\xdef\first@{l}\else
+\if\first@ M\xdef\first@{m}\else \if\first@ N\xdef\first@{n}\else
+\if\first@ O\xdef\first@{o}\else \if\first@ P\xdef\first@{p}\else
+\if\first@ Q\xdef\first@{q}\else \if\first@ R\xdef\first@{r}\else
+\if\first@ S\xdef\first@{s}\else \if\first@ T\xdef\first@{t}\else
+\if\first@ U\xdef\first@{u}\else \if\first@ V\xdef\first@{v}\else
+\if\first@ W\xdef\first@{w}\else \if\first@ X\xdef\first@{x}\else
+\if\first@ Y\xdef\first@{y}\else \if\first@ Z\xdef\first@{z}\else
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+\def\make@upper{%
+\if\first@ a\xdef\first@{A}\else \if\first@ b\xdef\first@{B}\else
+\if\first@ c\xdef\first@{C}\else \if\first@ d\xdef\first@{D}\else
+\if\first@ e\xdef\first@{E}\else \if\first@ f\xdef\first@{F}\else
+\if\first@ g\xdef\first@{G}\else \if\first@ h\xdef\first@{H}\else
+\if\first@ i\xdef\first@{I}\else \if\first@ j\xdef\first@{J}\else
+\if\first@ k\xdef\first@{K}\else \if\first@ l\xdef\first@{L}\else
+\if\first@ m\xdef\first@{M}\else \if\first@ n\xdef\first@{N}\else
+\if\first@ o\xdef\first@{O}\else \if\first@ p\xdef\first@{P}\else
+\if\first@ q\xdef\first@{Q}\else \if\first@ r\xdef\first@{R}\else
+\if\first@ s\xdef\first@{S}\else \if\first@ t\xdef\first@{T}\else
+\if\first@ u\xdef\first@{U}\else \if\first@ v\xdef\first@{V}\else
+\if\first@ w\xdef\first@{W}\else \if\first@ x\xdef\first@{X}\else
+\if\first@ y\xdef\first@{Y}\else \if\first@ z\xdef\first@{Z}\else
+\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+\def\type@get#1 MSF: #2 Type: #3 #4@{\def\seq@type{#3}}
+\def\inf@@get#1 #2 #3 #4 #5 #6@{%
+ \def\first@{#1}
+ \def\second@{#2}
+ \def\third@{#3}
+ \xdef\fourth@{#4 @}
+ \expandafter\check@letter\fourth@
+ \ifnumber
+ \def\fourth@{#4}
+ \else
+ \xdef\fourth@{#5 @}
+ \expandafter\check@letter\fourth@
+ \ifnumber
+ \def\fourth@{#5}
+ \else
+ \def\fourth@{99999999}
+ \fi
+ \fi
+ \def\fifth@{#5}
+ \def\last@{#6}}
+\def\check@char#1{\letterfalse \ifnum\catcode`#1=11 \lettertrue \fi
+ \numberfalse \ifnum\catcode`#1=12 \numbertrue \fi
+ \xdef\code@num{\the\catcode`#1}}
+\def\check@letter#1#2@{\letterfalse \ifnum\catcode`#1=11 \lettertrue \fi
+ \numberfalse \ifnum\catcode`#1=12 \numbertrue \fi}
+\def\seq@get#1 #2@{\def\first@{#1} \def\seq@line{#2}}
+\def\res@get#1#2@{\def\first@{#1} \def\seq@line{#2&@}}
+\def\firstchar@get#1#2@{\def\first@{#1} \def\third@{#2@}}
+\def\residue@get#1#2@{\xdef\first@{#1}
+ \ifnum`#1>96 \make@upper \fi
+ \ifnum`#1=45 \xdef\first@{\d@t} \fi
+ \expandafter\xdef\csname res\the\loopcount\endcsname{\first@}
+ \expandafter\xdef\csname sequence\the\loopcount\endcsname{#2@}}
+\def\remove@fromseq#1@{\expandafter\xdef\csname sequence\the\loopcount\endcsname{#1}}
+\def\re@write#1,#2@{%
+ \xdef\third@{#2,@}
+ \xdef\first@{\csname hide@@@seq#1\endcsname}
+ \ifx\first@\last@
+ \else
+ \xdef\first@{#1&}
+ \ifx\first@\ampers@nd \else \advance\innerloopcount by 1 \fi
+ \if\second@ e \xdef\second@{\csname @rd#1\endcsname}
+ \else \xdef\second@{\second@,\csname @rd#1\endcsname}\fi
+ \fi
+ }
+\def\order@set#1,#2@{%
+ \xdef\second@{#2,@}
+ \expandafter\xdef\csname @rd#1\endcsname{\the\loopcount}
+ \csname res@count\the\loopcount\endcsname=%
+ \csname pos#1\endcsname
+ \expandafter\xdef\csname hide@seq\the\loopcount\endcsname{%
+ \csname hide@@seq#1\endcsname}
+ \expandafter\xdef\csname hide@name\the\loopcount\endcsname{%
+ \csname hide@@name#1\endcsname}
+ \expandafter\xdef\csname hide@number\the\loopcount\endcsname{%
+ \csname hide@@number#1\endcsname}
+ \expandafter\xdef\csname seq@start\the\loopcount\endcsname{%
+ \csname seq@@start#1\endcsname}
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{%
+ \csname seq@@len#1\endcsname}
+ \expandafter\xdef\csname seqname\the\loopcount\endcsname{%
+ \csname seq@name#1\endcsname}
+ \expandafter\xdef\csname newseqname\the\loopcount\endcsname{%
+ \csname newseq@name#1\endcsname}
+ \expandafter\xdef\csname seq@gap\the\loopcount\endcsname{%
+ \csname seq@@gap#1\endcsname}
+ \expandafter\xdef\csname name@col\the\loopcount\endcsname{%
+ \csname name@@col#1\endcsname}
+ \expandafter\xdef\csname number@col\the\loopcount\endcsname{%
+ \csname number@@col#1\endcsname}
+ \expandafter\xdef\csname stack@reg\the\loopcount\endcsname{%
+ \csname stack@@reg#1\endcsname}
+ \expandafter\xdef\csname stack@tintreg\the\loopcount\endcsname{%
+ \csname stack@@tintreg#1\endcsname}
+ \expandafter\xdef\csname stack@emphreg\the\loopcount\endcsname{%
+ \csname stack@@emphreg#1\endcsname}
+ \expandafter\xdef\csname stack@framereg\the\loopcount\endcsname{%
+ \csname stack@@framereg#1\endcsname}
+ \expandafter\xdef\csname stack@top\the\loopcount\endcsname{%
+ \csname stack@@top#1\endcsname}
+ \expandafter\xdef\csname stack@ttop\the\loopcount\endcsname{%
+ \csname stack@@ttop#1\endcsname}
+ \expandafter\xdef\csname stack@bottom\the\loopcount\endcsname{%
+ \csname stack@@bottom#1\endcsname}
+ \expandafter\xdef\csname stack@bbottom\the\loopcount\endcsname{%
+ \csname stack@@bbottom#1\endcsname}
+}
+\def\reorder@seqs#1{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \csname pos\the\loopcount\endcsname=%
+ \csname res@count\the\loopcount\endcsname
+ \expandafter\xdef\csname hide@@seq\the\loopcount\endcsname{%
+ \csname hide@seq\the\loopcount\endcsname}
+ \expandafter\xdef\csname hide@@name\the\loopcount\endcsname{%
+ \csname hide@name\the\loopcount\endcsname}
+ \expandafter\xdef\csname hide@@number\the\loopcount\endcsname{%
+ \csname hide@number\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@@start\the\loopcount\endcsname{%
+ \csname seq@start\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@@len\the\loopcount\endcsname{%
+ \csname seq@len\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@name\the\loopcount\endcsname{%
+ \csname seqname\the\loopcount\endcsname}
+ \expandafter\xdef\csname newseq@name\the\loopcount\endcsname{%
+ \csname newseqname\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@@gap\the\loopcount\endcsname{%
+ \csname seq@gap\the\loopcount\endcsname}
+ \expandafter\xdef\csname name@@col\the\loopcount\endcsname{%
+ \csname name@col\the\loopcount\endcsname}
+ \expandafter\xdef\csname number@@col\the\loopcount\endcsname{%
+ \csname number@col\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@reg\the\loopcount\endcsname{%
+ \csname stack@reg\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@tintreg\the\loopcount\endcsname{%
+ \csname stack@tintreg\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@emphreg\the\loopcount\endcsname{%
+ \csname stack@emphreg\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@framereg\the\loopcount\endcsname{%
+ \csname stack@framereg\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@top\the\loopcount\endcsname{%
+ \csname stack@top\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@ttop\the\loopcount\endcsname{%
+ \csname stack@ttop\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@bottom\the\loopcount\endcsname{%
+ \csname stack@bottom\the\loopcount\endcsname}
+ \expandafter\xdef\csname stack@@bbottom\the\loopcount\endcsname{%
+ \csname stack@bbottom\the\loopcount\endcsname}
+ \ifnum\loopcount<\killseq@count \repeat
+ \xdef\third@{#1}
+ \loopcount=0 \innerloopcount=0 \xdef\last@{kill} \xdef\second@{e}
+ \loop
+ \advance\loopcount by 1
+ \expandafter\re@write\third@
+ \ifnum\loopcount<\seq@count \repeat
+ \ifnum\innerloopcount<\killseq@count
+ \@latex@error{Not enough sequences specified in `orderseqs'
+ (\the\innerloopcount/\the\killseq@count)}\@ehc
+ \fi
+ \loopcount=0 \xdef\second@{\second@,@}
+ \loop
+ \advance\loopcount by 1
+ \expandafter\order@set\second@
+ \ifnum\loopcount<\killseq@count \repeat
+ \ifnum\cons@num>0 \xdef\cons@num{\csname @rd\cons@num\endcsname} \fi
+ \ifnum\rule@num>0 \xdef\rule@num{\csname @rd\rule@num\endcsname} \fi
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \csname pos\the\loopcount\endcsname=0
+ \ifnum\loopcount<\killseq@count \repeat
+}
+\def\group@get#1,#2@{%
+ \def\group@set{\expandafter\residue@get\second@
+ \ifx\first@\ampers@nd
+ \else \expandafter\xdef\csname \prfx grp\first@\endcsname{\the\loopcount}
+ \xdef\second@{\csname sequence\the\loopcount\endcsname} \group@set
+ \fi}
+ \xdef\second@{#1 &@} \xdef\third@{#2&,@} \group@set}
+\def\get@item#1,#2@{\xdef\first@{#2@}\xdef\first@@{#2}\xdef\fourth@{#1}}
+\def\get@first@@#1-#2@{\xdef\first@@{#1}}
+\def\get@digit#1,#2@{%
+ \def\check@series##1-##2##3@{%
+ \xdef\first@@{##2}\xdef\fourth@{##1}\xdef\fourth@@{##3}}
+ \xdef\first@{#2@}
+ \xdef\fourth@{#1-&@}
+ \expandafter\check@series\fourth@
+ \ifx\first@@\ampers@nd
+ \else
+ \xdef\first@@{\first@@\fourth@@-&@}
+ \expandafter\get@first@@\first@@
+ \loopcount=\fourth@
+ \ifnum\first@@>\fourth@
+ \advance\loopcount by 1
+ \xdef\first@{\the\loopcount-\first@@,#2@}
+ \else
+ \ifnum\first@@<\fourth@
+ \advance\loopcount by -1
+ \xdef\first@{\the\loopcount-\first@@,#2@}
+ \fi
+ \fi
+ \fi
+}
+\def\donot@shade{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \xdef\third@{\csname hide@seq\first@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\first@\endcsname{noshade}
+ \fi
+ \xdef\first@{\first@@ @}
+ \donot@shade
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\third@{\csname hide@seq\fourth@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\fourth@\endcsname{noshade}
+ \fi
+ \donot@shade
+ \fi
+ \fi}
+\def\hideseq@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \xdef\third@{\csname hide@seq\first@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\first@\endcsname{true}
+ \fi
+ \xdef\first@{\first@@ @}
+ \hideseq@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\third@{\csname hide@seq\fourth@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\fourth@\endcsname{true}
+ \fi
+ \hideseq@
+ \fi
+ \fi}
+\def\hidename@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \expandafter\xdef\csname hide@name\first@\endcsname{yes}
+ \xdef\first@{\first@@ @}
+ \hidename@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \expandafter\xdef\csname hide@name\fourth@\endcsname{yes}
+ \hidename@
+ \fi
+ \fi}
+\def\hidenumber@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \expandafter\xdef\csname hide@number\first@\endcsname{yes}
+ \xdef\first@{\first@@ @}
+ \hidenumber@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \expandafter\xdef\csname hide@number\fourth@\endcsname{yes}
+ \hidenumber@
+ \fi
+ \fi}
+\def\namecolor@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \expandafter\xdef\csname name@col\first@\endcsname{\third@}
+ \xdef\first@{\first@@ @}
+ \namecolor@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \expandafter\xdef\csname name@col\fourth@\endcsname{\third@}
+ \namecolor@
+ \fi
+ \fi}
+\def\numbercolor@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \expandafter\xdef\csname number@col\first@\endcsname{\third@}
+ \xdef\first@{\first@@ @}
+ \numbercolor@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \expandafter\xdef\csname number@col\fourth@\endcsname{\third@}
+ \numbercolor@
+ \fi
+ \fi}
+\def\killseq@{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \ifnum\first@>\seq@count
+ \else
+ \ifnum\killseq@count>1
+ \xdef\third@{\csname hide@seq\first@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\first@\endcsname{kill}
+ \expandafter\xdef\csname hide@@@seq\first@\endcsname{kill}
+ \ifnum\first@=\cons@num \xdef\cons@num{0} \fi
+ \advance\killseq@count by -1
+ \seq@percent=100 \divide\seq@percent by \killseq@count
+ \fi
+ \fi\fi
+ \xdef\first@{\first@@ @}
+ \killseq@
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \ifnum\fourth@>\seq@count
+ \else
+ \ifnum\killseq@count>1
+ \xdef\third@{\csname hide@seq\fourth@\endcsname} \xdef\second@{kill}
+ \ifx\third@\second@
+ \else
+ \expandafter\xdef\csname hide@seq\fourth@\endcsname{kill}
+ \expandafter\xdef\csname hide@@@seq\fourth@\endcsname{kill}
+ \ifnum\fourth@=\cons@num \xdef\cons@num{0} \fi
+ \advance\killseq@count by -1
+ \seq@percent=100 \divide\seq@percent by \killseq@count
+ \fi
+ \fi\fi
+ \killseq@
+ \fi
+ \fi}
+\def\kill@loop{%
+ \advance\innerloopcount by 1
+ \xdef\first@{\csname hide@seq\the\innerloopcount\endcsname}
+ \ifx\first@\second@ \kill@loop \fi}
+\def\kill@seqnow{%
+ \xdef\first@{\csname hide@seq\the\loopcount\endcsname} \xdef\second@{kill}
+ \innerloopcount=\loopcount
+ \ifx\first@\second@
+ \kill@loop
+ \expandafter\xdef\csname hide@seq\the\loopcount\endcsname{%
+ \csname hide@seq\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname seqname\the\loopcount\endcsname{%
+ \csname seqname\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname newseqname\the\loopcount\endcsname{%
+ \csname newseqname\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname seq@gap\the\loopcount\endcsname{%
+ \csname seq@gap\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@reg\the\loopcount\endcsname{%
+ \csname stack@reg\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@tintreg\the\loopcount\endcsname{%
+ \csname stack@tintreg\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@emphreg\the\loopcount\endcsname{%
+ \csname stack@emphreg\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@framereg\the\loopcount\endcsname{%
+ \csname stack@framereg\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@top\the\loopcount\endcsname{%
+ \csname stack@top\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@ttop\the\loopcount\endcsname{%
+ \csname stack@ttop\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@bottom\the\loopcount\endcsname{%
+ \csname stack@bottom\the\innerloopcount\endcsname}
+ \expandafter\xdef\csname stack@bbottom\the\loopcount\endcsname{%
+ \csname stack@bbottom\the\innerloopcount\endcsname}
+ \csname res@count\the\loopcount\endcsname=%
+ \csname res@count\the\innerloopcount\endcsname
+ \expandafter\xdef\csname hide@seq\the\innerloopcount\endcsname{kill}
+ \ifnum\loopcount=\rule@num \hideruler \fi
+ \fi
+ \expandafter\xdef\csname @rd\the\innerloopcount\endcsname{\the\loopcount}
+ \advance\loopcount by 1
+ \ifnum\loopcount>\killseq@count
+ \ifnum\rule@num>0\xdef\rule@num{\csname @rd\rule@num\endcsname}\fi
+ \ifnum\cons@num>0\xdef\cons@num{\csname @rd\cons@num\endcsname}\fi
+ \else
+ \kill@seqnow
+ \fi}
+\def\set@maxseqnumber#1{%
+ \ifnum#1>\max@seqnumber
+ \loopcount=\max@seqnumber \xdef\max@seqnumber{\the #1}
+ \loop
+ \advance\loopcount by 1
+ \expandafter\newcount\csname pos\the\loopcount\endcsname
+ \expandafter\newcount\csname res@count\the\loopcount\endcsname
+ \ifnum\loopcount<\max@seqnumber \repeat
+ \fi}
+\def\get@sim#1#2@{\xdef\sim@char{#1} \xdef\last@{#2 &@}}
+\def\getsim@char{%
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>\m@x
+ \else
+ \expandafter\get@sim\last@
+ \ifx\second@\sim@char \xdef\third@{2} \innerloopcount=\m@x \fi
+ \getsim@char
+ \fi}
+\def\get@count(#1)#2@{\xdef\last@{#2 &@} \xdef\m@x{#1}}
+\def\get@nums#1..#2@{\xdef\first@{#1} \xdef\second@{#2}}
+\def\func@shading#1{%
+ \clearfuncgroups
+ \xdef\temp@{#1}
+ \xdef\second@{charge}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{sauer ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{basisch ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{\'acido ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{b\'asico ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \else
+ \funcgroup{acidic ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{basic ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \fi
+ \fi
+ \else
+ \xdef\second@{hydropathy}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{sauer ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{basisch ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{polar ungeladen}{YSTGNQC}{Black}{Yellow}{upper}{up}
+ \funcgroup{hydrophob unpolar}{AFPMWVIL}{White}{Green}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{\'acido ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{b\'asico ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{polar sin carga}{YSTGNQC}{Black}{Yellow}{upper}{up}
+ \funcgroup{hidrof\'obico no polar}{AFPMWVIL}{White}{Green}{upper}{up}
+ \else
+ \funcgroup{acidic ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{basic ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{polar uncharged}{YSTGNQC}{Black}{Yellow}{upper}{up}
+ \funcgroup{hydrophobic nonpolar}{AFPMWVIL}{White}{Green}{upper}{up}
+ \fi
+ \fi
+ \else
+ \xdef\second@{chemical}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{sauer ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{aliphatisch}{AGVIL}{White}{Black}{upper}{up}
+ \funcgroup{Amid}{NQ}{White}{Green}{upper}{up}
+ \funcgroup{aromatisch}{FYW}{White}{Brown}{upper}{up}
+ \funcgroup{basisch (+)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{Hydroxyl}{ST}{Black}{Magenta}{upper}{up}
+ \funcgroup{Imin}{P}{Black}{Orange}{upper}{up}
+ \funcgroup{Schwefel}{CM}{Black}{Yellow}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{\'acido ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{alif\'atico}{AGVIL}{White}{Black}{upper}{up}
+ \funcgroup{amida}{NQ}{White}{Green}{upper}{up}
+ \funcgroup{arom\'atico}{FYW}{White}{Brown}{upper}{up}
+ \funcgroup{b\'asico ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{hidr\'oxido}{ST}{Black}{Magenta}{upper}{up}
+ \funcgroup{imino}{P}{Black}{Orange}{upper}{up}
+ \funcgroup{azufre}{CM}{Black}{Yellow}{upper}{up}
+ \else
+ \funcgroup{acidic ($-$)}{DE}{White}{Red}{upper}{up}
+ \funcgroup{aliphatic}{AGVIL}{White}{Black}{upper}{up}
+ \funcgroup{amide}{NQ}{White}{Green}{upper}{up}
+ \funcgroup{aromatic}{FYW}{White}{Brown}{upper}{up}
+ \funcgroup{basic ($+$)}{KRH}{White}{Blue}{upper}{up}
+ \funcgroup{hydroxyl}{ST}{Black}{Magenta}{upper}{up}
+ \funcgroup{imino}{P}{Black}{Orange}{upper}{up}
+ \funcgroup{sulfur}{CM}{Black}{Yellow}{upper}{up}
+ \fi
+ \fi
+ \else
+ \xdef\second@{structure}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{extern}{DEHKNQR}{Black}{Orange}{upper}{up}
+ \funcgroup{ambivalent}{ACGPSTWY}{Black}{Yellow}{upper}{up}
+ \funcgroup{intern}{FILMV}{White}{Green}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{externo}{DEHKNQR}{Black}{Orange}{upper}{up}
+ \funcgroup{ambivalente}{ACGPSTWY}{Black}{Yellow}{upper}{up}
+ \funcgroup{interno}{FILMV}{White}{Green}{upper}{up}
+ \else
+ \funcgroup{external}{DEHKNQR}{Black}{Orange}{upper}{up}
+ \funcgroup{ambivalent}{ACGPSTWY}{Black}{Yellow}{upper}{up}
+ \funcgroup{internal}{FILMV}{White}{Green}{upper}{up}
+ \fi
+ \fi
+ \else
+ \xdef\second@{standard area}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{\ 88,1 (G); Standard Seitenkettenfl\"ache %
+ (\AA$^2$)}%
+ {G}{Black}{BrickRed}{upper}{up}
+ \funcgroup{118,2 (A); 129,8 (S)}{AS}{Black}{Orange}{upper}{up}
+ \funcgroup{146,1 (C); 146,8 (P)}%
+ {CP}{Black}{Yellow}{upper}{up}
+ \funcgroup{152,5 (T); 158,7 (D); 164,5 (V); 165,5 (N)}%
+ {TDVN}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{181,0 (I); 186,2 (E)}{IE}{White}{PineGreen}{upper}{up}
+ \funcgroup{193,1 (L); 193,2 (Q); 202,5 (H); 203,3 (M)}%
+ {LQHM}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{222,8 (F); 225,8 (K)}{FK}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{238,8 (Y)}{Y}{White}{RedViolet}{upper}{up}
+ \funcgroup{256,0 (R); 266,2 (W)}{RW}{White}{Black}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{\ 88.1 (G); Superficie est\'andar de la cadena lateral (\AA$^2$)}%
+ {G}{Black}{BrickRed}{upper}{up}
+ \funcgroup{118.2 (A); 129.8 (S)}{AS}{Black}{Orange}{upper}{up}
+ \funcgroup{146.1 (C); 146.8 (P)}%
+ {CP}{Black}{Yellow}{upper}{up}
+ \funcgroup{152.5 (T); 158.7 (D); 164.5 (V); 165.5 (N)}%
+ {TDVN}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{181.0 (I); 186.2 (E)}{IE}{White}{PineGreen}{upper}{up}
+ \funcgroup{193.1 (L); 193.2 (Q); 202.5 (H); 203.3 (M)}%
+ {LQHM}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{222.8 (F); 225.8 (K)}{FK}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{238.8 (Y)}{Y}{White}{RedViolet}{upper}{up}
+ \funcgroup{256.0 (R); 266.2 (W)}{RW}{White}{Black}{upper}{up}
+ \else
+ \funcgroup{\ 88.1 (G); Standard sidechain area (\AA$^2$)}%
+ {G}{Black}{BrickRed}{upper}{up}
+ \funcgroup{118.2 (A); 129.8 (S)}{AS}{Black}{Orange}{upper}{up}
+ \funcgroup{146.1 (C); 146.8 (P)}%
+ {CP}{Black}{Yellow}{upper}{up}
+ \funcgroup{152.5 (T); 158.7 (D); 164.5 (V); 165.5 (N)}%
+ {TDVN}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{181.0 (I); 186.2 (E)}{IE}{White}{PineGreen}{upper}{up}
+ \funcgroup{193.1 (L); 193.2 (Q); 202.5 (H); 203.3 (M)}%
+ {LQHM}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{222.8 (F); 225.8 (K)}{FK}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{238.8 (Y)}{Y}{White}{RedViolet}{upper}{up}
+ \funcgroup{256.0 (R); 266.2 (W)}{RW}{White}{Black}{upper}{up}
+ \fi
+ \fi
+ \else
+ \xdef\second@{accessible area}
+ \ifx\temp@\second@
+ \ifgerm@n
+ \funcgroup{\ 13,9 (C); Zug\"angliche Seitenkettenfl\"ache %
+ (\AA$^2$)}%
+ {CIV}{Black}{BrickRed}{upper}{up}
+ \funcgroup{\ 23,0 (I); 23,5 (V); 25,2 (G)}%
+ {IVG}{Black}{Orange}{upper}{up}
+ \funcgroup{\ 28,7 (F); 29,0 (L); 30,5 (M); 31,5 (A)}%
+ {FLMA}{Black}{Yellow}{upper}{up}
+ \funcgroup{\ 41,7 (W); 44,2 (S); 46,0 (T); 46,7 (H)}%
+ {WSTH}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{\ 53,7 (P)}{P}{White}{PineGreen}{upper}{up}
+ \funcgroup{\ 59,1 (Y); 60,9 (D); 62,2 (N)}%
+ {YDN}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{\ 72,3 (E); 74,0 (Q)}{EQ}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{\ 93,8 (R)}{R}{White}{RedViolet}{upper}{up}
+ \funcgroup{110,3 (K)}{K}{White}{Black}{upper}{up}
+ \else
+ \ifsp@nish
+ \funcgroup{\ 13.9 (C); Superficie accesible de la cadena lateral (\AA$^2$)}%
+ {CIV}{Black}{BrickRed}{upper}{up}
+ \funcgroup{\ 23.0 (I); 23.5 (V); 25.2 (G)}%
+ {IVG}{Black}{Orange}{upper}{up}
+ \funcgroup{\ 28.7 (F); 29.0 (L); 30.5 (M); 31.5 (A)}%
+ {FLMA}{Black}{Yellow}{upper}{up}
+ \funcgroup{\ 41.7 (W); 44.2 (S); 46.0 (T); 46.7 (H)}%
+ {WSTH}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{\ 53.7 (P)}{P}{White}{PineGreen}{upper}{up}
+ \funcgroup{\ 59.1 (Y); 60.9 (D); 62.2 (N)}%
+ {YDN}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{\ 72.3 (E); 74.0 (Q)}{EQ}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{\ 93.8 (R)}{R}{White}{RedViolet}{upper}{up}
+ \funcgroup{110.3 (K)}{K}{White}{Black}{upper}{up}
+ \else
+ \funcgroup{\ 13.9 (C); Accessible sidechain area (\AA$^2$)}%
+ {CIV}{Black}{BrickRed}{upper}{up}
+ \funcgroup{\ 23.0 (I); 23.5 (V); 25.2 (G)}%
+ {IVG}{Black}{Orange}{upper}{up}
+ \funcgroup{\ 28.7 (F); 29.0 (L); 30.5 (M); 31.5 (A)}%
+ {FLMA}{Black}{Yellow}{upper}{up}
+ \funcgroup{\ 41.7 (W); 44.2 (S); 46.0 (T); 46.7 (H)}%
+ {WSTH}{Black}{YellowGreen}{upper}{up}
+ \funcgroup{\ 53.7 (P)}{P}{White}{PineGreen}{upper}{up}
+ \funcgroup{\ 59.1 (Y); 60.9 (D); 62.2 (N)}%
+ {YDN}{Black}{SkyBlue}{upper}{up}
+ \funcgroup{\ 72.3 (E); 74.0 (Q)}{EQ}{White}{RoyalPurple}{upper}{up}
+ \funcgroup{\ 93.8 (R)}{R}{White}{RedViolet}{upper}{up}
+ \funcgroup{110.3 (K)}{K}{White}{Black}{upper}{up}
+ \fi
+ \fi
+ \else \message{<Unknown shading mode. Clearing `funcgroups'>}
+ \fi\fi\fi\fi\fi\fi
+}
+\def\shadeallresidues{\all@fshadetrue}
+\def\get@fromstack#1;#2;#3;#4;#5@{%
+ \xdef\first@{#1} \xdef\second@{#2}
+ \xdef\third@{#3} \xdef\fourth@{#4} \xdef\last@{#5@}
+}
+\def\getregion@fromstack#1{%
+ \xdef\temp@{#1}
+ \xdef\first@{\csname stack@reg\temp@\endcsname}
+ \expandafter\get@fromstack\first@
+ \expandafter\xdef\csname style\temp@\endcsname{\first@}
+ \expandafter\xdef\csname start\temp@\endcsname{\second@}
+ \expandafter\xdef\csname stop\temp@\endcsname{\third@}
+ \expandafter\xdef\csname all\temp@\endcsname{\fourth@}
+ \expandafter\xdef\csname stack@reg\temp@\endcsname{\last@}
+}
+\def\sort@stack{%
+ \expandafter\get@fromstack\last@
+ \ifx\first@\ampers@nd
+ \xdef\tmpstack{\tmpstack\the\loopcount;\st@rt;\st@p;\@ll;&;&;&;&;@}
+ \else
+ \ifnum\st@rt<\second@
+ \xdef\tmpstack{\tmpstack\the\loopcount;\st@rt;\st@p;\@ll;%
+ \first@;\second@;\third@;\fourth@;\last@}
+ \else
+ \xdef\tmpstack{\tmpstack\first@;\second@;\third@;\fourth@;} \sort@stack
+ \fi\fi
+}
+\def\get@regions#1..#2,#3@{%
+ \xdef\st@rt{#1} \xdef\st@p{#2} \xdef\list@{#3}
+ \xdef\last@{\csname stack@reg\seq@\endcsname}
+ \xdef\tmpstack{}
+ \sort@stack
+ \expandafter\xdef\csname stack@reg\seq@\endcsname{\tmpstack}
+}
+\def\get@fromemphstack#1;#2;#3;#4@{%
+ \xdef\first@{#1} \xdef\second@{#2}
+ \xdef\third@{#3} \xdef\last@{#4@}
+}
+\def\getregion@fromemphstack#1{%
+ \xdef\temp@{#1}
+ \xdef\first@{\csname stack@emphreg\temp@\endcsname}
+ \expandafter\get@fromemphstack\first@
+ \expandafter\xdef\csname emphstart\temp@\endcsname{\first@}
+ \expandafter\xdef\csname emphstop\temp@\endcsname{\second@}
+ \expandafter\xdef\csname emphall\temp@\endcsname{\third@}
+ \expandafter\xdef\csname stack@emphreg\temp@\endcsname{\last@}
+}
+\def\sort@emphstack{%
+ \expandafter\get@fromemphstack\last@
+ \ifx\first@\ampers@nd
+ \xdef\tmpstack{\tmpstack\st@rt;\st@p;\@ll;&;&;&;@}
+ \else
+ \ifnum\st@rt<\second@
+ \xdef\tmpstack{\tmpstack\st@rt;\st@p;\@ll;\first@;\second@;\third@;\last@}
+ \else
+ \xdef\tmpstack{\tmpstack\first@;\second@;\third@;} \sort@emphstack
+ \fi\fi
+}
+\def\get@emphregions#1..#2,#3@{%
+ \regionalemphtrue
+ \xdef\st@rt{#1} \xdef\st@p{#2} \xdef\list@{#3}
+ \xdef\last@{\csname stack@emphreg\seq@\endcsname}
+ \xdef\tmpstack{}
+ \sort@emphstack
+ \expandafter\xdef\csname stack@emphreg\seq@\endcsname{\tmpstack}
+}
+\def\getregion@fromtintstack#1{%
+ \xdef\temp@{#1}
+ \xdef\first@{\csname stack@tintreg\temp@\endcsname}
+ \expandafter\get@fromemphstack\first@
+ \expandafter\xdef\csname tintstart\temp@\endcsname{\first@}
+ \expandafter\xdef\csname tintstop\temp@\endcsname{\second@}
+ \expandafter\xdef\csname tintall\temp@\endcsname{\third@}
+ \expandafter\xdef\csname stack@tintreg\temp@\endcsname{\last@}
+}
+\def\sort@tintstack{%
+ \expandafter\get@fromemphstack\last@
+ \ifx\first@\ampers@nd
+ \xdef\tmpstack{\tmpstack\st@rt;\st@p;\@ll;&;&;&;@}
+ \else
+ \ifnum\st@rt<\second@
+ \xdef\tmpstack{\tmpstack\st@rt;\st@p;\@ll;\first@;\second@;\third@;\last@}
+ \else
+ \xdef\tmpstack{\tmpstack\first@;\second@;\third@;} \sort@tintstack
+ \fi\fi
+}
+\def\get@tintregions#1..#2,#3@{%
+ \regionaltinttrue
+ \xdef\st@rt{#1} \xdef\st@p{#2} \xdef\list@{#3}
+ \xdef\last@{\csname stack@tintreg\seq@\endcsname}
+ \xdef\tmpstack{}
+ \sort@tintstack
+ \expandafter\xdef\csname stack@tintreg\seq@\endcsname{\tmpstack}
+}
+\def\getregion@fromframestack#1{%
+ \xdef\temp@{#1}
+ \xdef\first@{\csname stack@framereg\temp@\endcsname}
+ \expandafter\get@fromemphstack\first@
+ \expandafter\xdef\csname framestart\temp@\endcsname{\first@}
+ \expandafter\xdef\csname framestop\temp@\endcsname{\second@}
+ \expandafter\xdef\csname framestyle\temp@\endcsname{\third@}
+ \expandafter\xdef\csname stack@framereg\temp@\endcsname{\last@}
+}
+\def\get@frameregions#1..#2,#3@{%
+ \frame@true
+ \xdef\st@rt{#1} \xdef\st@p{#2} \xdef\list@{#3}
+ \xdef\last@{\csname stack@framereg\seq@\endcsname}
+ \xdef\tmpstack{}
+ \sort@emphstack
+ \expandafter\xdef\csname stack@framereg\seq@\endcsname{\tmpstack}
+}
+\def\getregion@fromfstack#1{%
+ \xdef\temp@{#1}
+ \xdef\first@{\csname stack@\bottop@\temp@\endcsname}
+ \expandafter\get@fromstack\first@
+ \expandafter\xdef\csname text\bottop@\temp@\endcsname{\first@}
+ \expandafter\xdef\csname start\bottop@\temp@\endcsname{\second@}
+ \expandafter\xdef\csname stop\bottop@\temp@\endcsname{\third@}
+ \ifx\fourth@\ampers@nd \xdef\fourth@{///} \fi
+ \expandafter\xdef\csname style\bottop@\temp@\endcsname{\fourth@}
+ \expandafter\xdef\csname stack@\bottop@\temp@\endcsname{\last@}
+}
+\def\sort@fstack{%
+ \expandafter\get@fromstack\last@
+ \ifx\first@\ampers@nd
+ \xdef\tmpstack{\tmpstack\f@text@;\st@rt;\st@p;\style@;&;&;&;&;@}
+ \else
+ \ifnum\st@rt<\second@
+ \xdef\tmpstack{\tmpstack\f@text@;\st@rt;\st@p;\style@;%
+ \first@;\second@;\third@;\fourth@;\last@}
+ \else
+ \xdef\tmpstack{\tmpstack\first@;\second@;\third@;\fourth@;}
+ \sort@fstack
+ \fi\fi
+}
+\def\get@fregions#1..#2,#3@{%
+ \xdef\st@rt{#1}
+ \ifx\temp@\y@
+ \xdef\st@p{#1}
+ \else
+ \xdef\st@p{#2}
+ \fi
+ \xdef\list@{#3}
+ \xdef\last@{\csname stack@\bottop@\seq@\endcsname}
+ \xdef\tmpstack{}
+ \sort@fstack
+ \expandafter\xdef\csname stack@\bottop@\seq@\endcsname{\tmpstack}
+}
+\def\getarrow@shape#1#2#3#4&{%
+ \xdef\first@@{#1}\xdef\second@@{#2}\xdef\third@@{#3}
+ \if\first@@ v
+ \if\second@@ =
+ \else \xdef\style@{\first@@ v\third@@#4} \fi
+ \else
+ \if\first@@ v
+ \if\second@@ =
+ \else \xdef\style@{\first@@ v\third@@#4} \fi
+ \else
+ \if\third@@ v
+ \if\second@@ =
+ \else \xdef\style@{\first@@ v\third@@#4} \fi
+ \else
+ \if\third@@ v
+ \if\second@@ =
+ \else \xdef\style@{\first@@ v\third@@#4} \fi
+ \fi\fi\fi\fi
+}
+\def\get@shape#1#2#3{%
+ \xdef\first@@{#1}\xdef\second@@{#2}\xdef\third@@{#3}%
+ \if\second@@ v \xdef\second@@{arrow}%
+ \fi%
+ \if\second@@ = \xdef\second@@{doublearrow}%
+ \fi%
+}
+\def\getstyle@left#1#2#3#4@{%
+ \ifstop@
+ \xdef\style@@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \else
+ \xdef\style@@{#2}
+ \xdef\temp@{-}
+ \ifx\style@@\temp@ \xdef\style@@{#1#2-#4}
+ \else
+ \xdef\temp@{v}
+ \ifx\style@@\temp@ \xdef\style@@{#1#2-#4}
+ \else
+ \xdef\temp@{=}
+ \ifx\style@@\temp@ \xdef\style@@{#1#2=#4}
+ \else
+ \xdef\style@@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \fi\fi\fi\fi
+}
+\def\getstyle@right#1#2#3#4@{%
+ \xdef\style@@{#2}
+ \xdef\temp@{-}
+ \ifx\style@@\temp@
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{-#2#3#4}
+ \fi
+ \xdef\temp@{v}
+ \ifx\style@@\temp@
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{-#2#3#4}
+ \fi
+ \xdef\temp@{=}
+ \ifx\style@@\temp@
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{=#2#3#4}
+ \fi
+}
+\def\opt@color#1[#2]#3&{\xdef\fourth@{#1}\xdef\f@color{#2}}
+\def\graph@opt@color#1[#2]:#3[#4][#5]#6&{%
+ \xdef\fourth@{#1}
+ \xdef\f@color{#2}
+ \xdef\ffourth@{#3}
+ \xdef\ff@color{#4}
+ \xdef\fffourth@{#5}}
+\def\arrow@col@width#1[#2][#3]#4&{\xdef\fourth@{#1}\xdef\f@color{#2}\xdef\rule@@thick{#3}}
+\def\second@color#1,&{\xdef\back@color{#1}}
+\def\two@opt@color#1,#2@{%
+ \xdef\sixth@{#1}%
+ \xdef\seventh@{#2}%
+ \ifx\first@\ampers@nd%
+ \else%
+ \xdef\frame@color{#1}%
+ \ifx\seventh@\ampers@nd%
+ \xdef\back@color{#1}%
+ \else%
+ \expandafter\second@color\seventh@%
+ \fi%
+ \fi%
+}
+\def\test@fill#1:#2:#3&{%
+ \xdef\last@{#1[,][,]&}\expandafter\arrow@col@width\last@%
+ \xdef\second@@{\fourth@}%
+ \xdef\last@{///}%
+ \ifx\fourth@\last@%
+ \xdef\second@@{empty}%
+ \else
+ \xdef\last@{translate}%
+ \ifx\fourth@\last@%
+ \xdef\second@@{translate}%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \xdef\fill@char{\fourth@}%
+ \else
+ \xdef\last@{fill}%
+ \ifx\fourth@\last@
+ \xdef\second@@{fill}%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \xdef\fill@char{\fourth@}%
+ \else
+ \xdef\last@{bar}%
+ \ifx\fourth@\last@
+ \xdef\second@@{bar}%
+ \xdef\b@r{bar}%
+ \ifx\f@color\comm@
+ \xdef\g@min{,}\xdef\g@max{,}%
+ \else
+ \xdef\f@color{\f@color @}%
+ \expandafter\get@item\f@color%
+ \xdef\g@min{\fourth@} \xdef\g@max{\first@@}%
+ \xdef\pm@shift{\fourth@}%
+ \fi%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \ifx\f@color\comm@\xdef\f@color{GrayDefault}\fi%
+ \xdef\fill@char{\fourth@}%
+ \xdef\box@color{\f@color,&@}%
+ \expandafter\two@opt@color\box@color%
+ \else
+ \xdef\last@{color}%
+ \ifx\fourth@\last@
+ \xdef\second@@{color}%
+ \ifx\f@color\comm@
+ \xdef\g@min{,}\xdef\g@max{,}%
+ \else
+ \xdef\f@color{\f@color @}%
+ \expandafter\get@item\f@color%
+ \xdef\g@min{\fourth@} \xdef\g@max{\first@@}%
+ \fi%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \ifx\f@color\comm@\xdef\f@color{GrayDefault}\fi%
+ \xdef\fill@char{\fourth@}%
+ \else
+ \xdef\last@{box}%
+ \ifx\fourth@\last@%
+ \xdef\second@@{box}%
+ \ifx\f@color\comm@\xdef\f@color{White}\fi%
+ \xdef\seventh@{\f@color @}\expandafter\check@letter\seventh@%
+ \ifnumber%
+ \ifx\rule@@thick\comm@%
+ \xdef\rule@@thick{\f@color}%
+ \xdef\box@color{White,&@}%
+ \else%
+ \xdef\seventh@{\rule@@thick}%
+ \xdef\rule@@thick{\f@color}%
+ \xdef\box@color{\seventh@,&@}%
+ \fi%
+ \else%
+ \xdef\box@color{\f@color,&@}%
+ \fi%
+ \expandafter\two@opt@color\box@color%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \xdef\fill@char{\fourth@}%
+ \else
+ \xdef\last@{plotcolor}%
+ \ifx\fourth@\last@%
+ \xdef\second@@{plotcolor}%
+ \ifx\f@color\comm@%
+ \xdef\pm@shift{0}%
+ \else%
+ \xdef\pm@shift{\f@color}%
+ \fi%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \xdef\fill@char{\fourth@}%
+ \else
+ \xdef\last@{plotbar}%
+ \ifx\fourth@\last@%
+ \xdef\second@@{plotbar}%
+ \xdef\b@r{bar}%
+ \ifx\f@color\comm@
+ \xdef\pm@shift{0}%
+ \else
+ \xdef\pm@shift{\f@color}%
+ \fi%
+ \xdef\fill@char{#2[,]&}%
+ \expandafter\opt@color\fill@char%
+ \ifx\f@color\comm@\xdef\f@color{GrayDefault}\fi%
+ \xdef\fill@char{\fourth@}%
+ \xdef\box@color{\f@color,&@}%
+ \expandafter\two@opt@color\box@color%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\seventh@{\f@color @}\expandafter\check@letter\seventh@%
+ \ifnumber%
+ \ifx\rule@@thick\comm@%
+ \xdef\rule@@thick{\f@color}%
+ \xdef\f@color{Black}%
+ \else%
+ \xdef\seventh@{\rule@@thick}%
+ \xdef\rule@@thick{\f@color}%
+ \xdef\f@color{\seventh@}%
+ \fi%
+ \fi%
+ \ifx\rule@@thick\comm@\xdef\rule@@thick{\the\rule@thick}\fi%
+ \ifx\f@color\comm@\xdef\f@color{Black}\fi}
+\def\clear@groups{%
+ \expandafter\xdef\csname \prfx grpA\endcsname{ -1}
+ \expandafter\xdef\csname \prfx grpB\endcsname{ -2}
+ \expandafter\xdef\csname \prfx grpC\endcsname{ -3}
+ \expandafter\xdef\csname \prfx grpD\endcsname{ -4}
+ \expandafter\xdef\csname \prfx grpE\endcsname{ -5}
+ \expandafter\xdef\csname \prfx grpF\endcsname{ -6}
+ \expandafter\xdef\csname \prfx grpG\endcsname{ -7}
+ \expandafter\xdef\csname \prfx grpH\endcsname{ -8}
+ \expandafter\xdef\csname \prfx grpI\endcsname{ -9}
+ \expandafter\xdef\csname \prfx grpJ\endcsname{-10}
+ \expandafter\xdef\csname \prfx grpK\endcsname{-11}
+ \expandafter\xdef\csname \prfx grpL\endcsname{-12}
+ \expandafter\xdef\csname \prfx grpM\endcsname{-13}
+ \expandafter\xdef\csname \prfx grpN\endcsname{-14}
+ \expandafter\xdef\csname \prfx grpO\endcsname{-15}
+ \expandafter\xdef\csname \prfx grpP\endcsname{-16}
+ \expandafter\xdef\csname \prfx grpQ\endcsname{-17}
+ \expandafter\xdef\csname \prfx grpR\endcsname{-18}
+ \expandafter\xdef\csname \prfx grpS\endcsname{-19}
+ \expandafter\xdef\csname \prfx grpT\endcsname{-20}
+ \expandafter\xdef\csname \prfx grpU\endcsname{-21}
+ \expandafter\xdef\csname \prfx grpV\endcsname{-22}
+ \expandafter\xdef\csname \prfx grpW\endcsname{-23}
+ \expandafter\xdef\csname \prfx grpX\endcsname{-24}
+ \expandafter\xdef\csname \prfx grpY\endcsname{-25}
+ \expandafter\xdef\csname \prfx grpZ\endcsname{-26}
+ \expandafter\xdef\csname \prfx grp-\endcsname{-999}
+ \expandafter\xdef\csname \prfx grp.\endcsname{-999}
+}
+\def\inactivate@chars{%
+ \catcode`\#=12
+ \catcode`\"=12
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ }
+\def\numcount{\the\loopcount}
+\def\Alphacount{\@Alph\loopcount}
+\def\alphacount{\@alph\loopcount}
+\def\romancount{\@roman\loopcount}
+\def\Romancount{\@Roman\loopcount}
+\def\cut@name#1.#2@{\global\xdef\file@n@me{#1}}
+\def\struc@get#1 #2 #3 #4 #5 #6 #7 #8 #9@{%
+ \xdef\first@{#1} \xdef\second@{#2} \xdef\third@{#3} \xdef\fourth@{#4}
+ \xdef\fifth@{#5} \xdef\sixth@{#6} \xdef\seventh@{#7}\xdef\eighth@{#8}}
+\def\get@PHD#1|#2|#3@{\xdef\PHD@line{\PHD@line #2}}
+\def\write@PHDsec{%
+ \expandafter\get@sim\last@
+ \ifx\sim@char\c@mp
+ \def\end@{\the\innerloopcount}
+ \advance\innerloopcount by 1
+ \else
+ \ifnum\end@<\begin@ \xdef\end@{\begin@}\fi
+ \if\c@mp .
+ \else
+ \if\c@mp L
+ \else
+ \if\c@mp H
+ \ifx\show@Hsec\yes
+ \loopcount=\first@
+ \advance\loopcount by 1
+ \xdef\first@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hsec}{\begin@..\end@}%
+ {\label@Hsec}{\text@Hsec}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hsec}{\st@rt}{\begin@..\end@}%
+ {\label@Hsec}{\text@Hsec}}\fi
+ \fi
+ \else
+ \if\c@mp E
+ \ifx\show@Esec\yes
+ \loopcount=\second@
+ \advance\loopcount by 1
+ \xdef\second@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Esec}{\begin@..\end@}%
+ {\label@Esec}{\text@Esec}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Esec}{\st@rt}{\begin@..\end@}%
+ {\label@Esec}{\text@Esec}}\fi
+ \fi
+ \fi\fi\fi\fi
+ \xdef\c@mp{\sim@char}
+ \advance\innerloopcount by 1
+ \xdef\begin@{\the\innerloopcount}
+ \fi
+ \ifx\sim@char\ampers@nd\else\write@PHDsec\fi
+}
+\def\write@PHDtopo{%
+ \expandafter\get@sim\last@
+ \ifx\sim@char\c@mp
+ \def\end@{\the\innerloopcount}
+ \advance\innerloopcount by 1
+ \else
+ \ifnum\end@<\begin@ \xdef\end@{\begin@}\fi
+ \if\c@mp .
+ \else
+ \if\c@mp L
+ \else
+ \if\c@mp T
+ \ifx\show@TMtop\yes
+ \loopcount=\first@
+ \advance\loopcount by 1
+ \xdef\first@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@TMtop}{\begin@..\end@}%
+ {\label@TMtop}{\text@TMtop}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@TMtop}{\st@rt}{\begin@..\end@}%
+ {\label@TMtop}{\text@TMtop}}\fi
+ \fi
+ \else
+ \if\c@mp i
+ \ifx\show@itop\yes
+ \loopcount=\second@
+ \advance\loopcount by 1
+ \xdef\second@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@itop}{\begin@..\end@}%
+ {\label@itop}{\text@itop}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@itop}{\st@rt}{\begin@..\end@}%
+ {\label@itop}{\text@itop}}\fi
+ \fi
+ \else
+ \if\c@mp o
+ \ifx\show@etop\yes
+ \loopcount=\second@
+ \advance\loopcount by 1
+ \xdef\second@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@etop}{\begin@..\end@}%
+ {\label@etop}{\text@etop}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@etop}{\st@rt}{\begin@..\end@}%
+ {\label@etop}{\text@etop}}\fi
+ \fi
+ \fi\fi\fi\fi\fi
+ \xdef\c@mp{\sim@char}
+ \advance\innerloopcount by 1
+ \xdef\begin@{\the\innerloopcount}
+ \fi
+ \ifx\sim@char\ampers@nd\else\write@PHDtopo\fi
+}
+\def\include@DSSP{%
+ \xdef\first@{\csname optiondssp\the\loopcount\endcsname}
+ \xdef\bottop@{\csname bottopdssp\the\loopcount\endcsname}
+ \xdef\st@rt{\csname doseqdssp\the\loopcount\endcsname}
+ \xdef\structurefilename{\csname filenamedssp\the\loopcount\endcsname}
+ \bgroup
+ \xdef\file@n@me{\structurefilename .@}
+ \expandafter\cut@name\file@n@me
+ \xdef\file@n@me{\file@n@me.sec}
+ \ifx\first@\file@n@me
+ \else
+ \immediate\openin\alignfile = \file@n@me\relax
+ \ifeof\alignfile \xdef\first@{make new} \fi
+ \immediate\closein\alignfile
+ \fi
+ \xdef\temp@{make new}
+ \ifx\first@\temp@
+ \def\par{}
+ \inactivate@chars
+ \immediate\openin\structurefile = \structurefilename\relax
+ \ifeof\structurefile
+ \PackageError{TeXshade}
+ {File `\structurefilename' not found}
+ {\MessageBreak
+ The `DSSP' file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ No labels for secondary structures will be displayed. \MessageBreak
+ Type <return> to proceed. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \immediate\closein\structurefile\egroup
+ \else
+ \message{[\structurefilename] ->}
+ \xdef\second@{} \xdef\temp@{RESIDUE}
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \ifx\second@\temp@ \xdef\temp@{AA}\fi
+ \ifx\third@\temp@ \else\repeat
+ \immediate\openout\featurefile = \file@n@me
+ \xdef\c@mp{+}
+ \xdef\begin@{\csname seq@start\st@rt\endcsname}
+ \xdef\end@{\csname seq@start\st@rt\endcsname}
+ \xdef\st@rt@{\begin@}
+ \expandafter\innerloopcount=\csname seq@start\st@rt\endcsname
+ \advance\innerloopcount by -1
+ \xdef\first@@{0} \xdef\second@@{0} \xdef\third@@{0}
+ \xdef\fourth@@{0} \xdef\fifth@@{0} \xdef\sixth@@{0}
+ \xdef\seventh@@{0}
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \ifx\test@\par@
+ \else
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \if\c@mp + \xdef\c@mp{\fifth@}\fi
+ \ifx\fifth@\c@mp
+ \ifx\fc@DSSP\y@
+ \temp@count=\first@
+ \else
+ \temp@count=\second@
+ \fi
+ \advance\temp@count by \st@rt@
+ \advance\temp@count by -1
+ \xdef\end@{\the\temp@count}
+ \else
+ \ifnum\begin@>0
+ \ifnum\end@<\begin@ \xdef\end@{\begin@}\fi
+ \if\c@mp C
+ \else
+ \if\c@mp H
+ \ifx\show@Hdssp\yes
+ \loopcount=\first@@
+ \advance\loopcount by 1
+ \xdef\first@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hdssp}{\begin@..\end@}%
+ {\label@Hdssp}{\text@Hdssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hdssp}{\st@rt}{\begin@..\end@}%
+ {\label@Hdssp}{\text@Hdssp}}\fi
+ \fi
+ \else
+ \if\c@mp G
+ \ifx\show@Gdssp\yes
+ \loopcount=\second@@
+ \advance\loopcount by 1
+ \xdef\second@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Gdssp}{\begin@..\end@}%
+ {\label@Gdssp}{\text@Gdssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Gdssp}{\st@rt}{\begin@..\end@}%
+ {\label@Gdssp}{\text@Gdssp}}\fi
+ \fi
+ \else
+ \if\c@mp I
+ \ifx\show@Idssp\yes
+ \loopcount=\third@@
+ \advance\loopcount by 1
+ \xdef\third@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Idssp}{\begin@..\end@}%
+ {\label@Idssp}{\text@Idssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Idssp}{\st@rt}{\begin@..\end@}%
+ {\label@Idssp}{\text@Idssp}}\fi
+ \fi
+ \else
+ \if\c@mp E
+ \ifx\show@Edssp\yes
+ \loopcount=\fourth@@
+ \advance\loopcount by 1
+ \xdef\fourth@@{\the\loopcount}
+ \advance\innerloopcount by 1
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Edssp}{\begin@..\end@}%
+ {\label@Edssp}{\text@Edssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Edssp}{\st@rt}{\begin@..\end@}%
+ {\label@Edssp}{\text@Edssp}}\fi
+ \fi
+ \else
+ \if\c@mp B
+ \ifx\show@Bdssp\yes
+ \loopcount=\fifth@@
+ \advance\loopcount by 1
+ \xdef\fifth@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Bdssp}{\begin@..\end@}%
+ {\label@Bdssp}{\text@Bdssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Bdssp}{\st@rt}{\begin@..\end@}%
+ {\label@Bdssp}{\text@Bdssp}}\fi
+ \fi
+ \else
+ \if\c@mp T
+ \ifx\show@Tdssp\yes
+ \loopcount=\sixth@@
+ \advance\loopcount by 1
+ \xdef\sixth@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Tdssp}{\begin@..\end@}%
+ {\label@Tdssp}{\text@Tdssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Tdssp}{\st@rt}{\begin@..\end@}%
+ {\label@Tdssp}{\text@Tdssp}}\fi
+ \fi
+ \else
+ \if\c@mp S
+ \ifx\show@Sdssp\yes
+ \loopcount=\seventh@@
+ \advance\loopcount by 1
+ \xdef\seventh@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Sdssp}{\begin@..\end@}%
+ {\label@Sdssp}{\text@Sdssp}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Sdssp}{\st@rt}{\begin@..\end@}%
+ {\label@Sdssp}{\text@Sdssp}}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \xdef\c@mp{\fifth@}
+ \ifx\fc@DSSP\y@
+ \temp@count=\first@
+ \else
+ \temp@count=\second@
+ \fi
+ \advance\temp@count by \st@rt@
+ \advance\temp@count by -1
+ \xdef\begin@{\the\temp@count}
+ \fi
+ \fi
+ \ifeof\structurefile \else\repeat
+ \closein\structurefile
+ \immediate\closeout\featurefile
+ \egroup
+ \input{\file@n@me}
+ \fi
+ \else
+ \egroup
+ \message{using existing file:}
+ \input{\file@n@me}
+ \fi
+ }
+
+\def\include@HMMTOP{%
+ \def\get@HMMTOP@TMs##1-##2 ##3@{%
+ \xdef\temp@@{\temp@@\fourth@@##1\fourth@@##2}
+ \xdef\structureline{##3 @}
+ }
+ \def\get@HMMTOP{%
+ \ifnum\temp@count<\fifth@
+ \advance\temp@count by 1
+ \expandafter\get@HMMTOP@TMs\structureline
+ \get@HMMTOP
+ \fi
+ }
+ \def\rem@ve@TM@info Transmembrane helices: ##1@{%
+ \xdef\structureline{##1 @}
+ \temp@count=0
+ \get@HMMTOP
+ }
+ \xdef\bottop@{\csname bottopHMMTOP\the\loopcount\endcsname}
+ \xdef\st@rt{\csname doseqHMMTOP\the\loopcount\endcsname}
+ \xdef\first@{\csname optionHMMTOP\the\loopcount\endcsname}
+ \xdef\structurefilename{\csname filenameHMMTOP\the\loopcount\endcsname}
+ \bgroup
+ \xdef\file@n@me{\structurefilename .@}
+ \expandafter\cut@name\file@n@me
+ \xdef\file@n@me{\file@n@me.top}
+ \ifx\first@\file@n@me
+ \else
+ \immediate\openin\alignfile = \file@n@me\relax
+ \ifeof\alignfile \xdef\first@{make new} \fi
+ \immediate\closein\alignfile
+ \fi
+ \xdef\temp@{make new}
+ \ifx\first@\temp@
+ \def\par{}
+ \inactivate@chars
+ \immediate\openin\structurefile = \structurefilename\relax
+ \ifeof\structurefile
+ \PackageError{TeXshade}
+ {File `\structurefilename' not found}
+ {\MessageBreak
+ The `HMMTOP' file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ No labels for secondary structures will be displayed. \MessageBreak
+ Type <return> to proceed. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \immediate\closein\structurefile\egroup
+ \else
+ \message{[\structurefilename] ->}
+ \immediate\openout\featurefile = \file@n@me
+
+ \xdef\first@{\csname fileseqHMMTOP\the\loopcount\endcsname @}
+ \expandafter\check@letter\first@
+ \ifletter
+ \xdef\st@p{\csname fileseqHMMTOP\the\loopcount\endcsname}
+ \else
+ \xdef\first@{\csname fileseqHMMTOP\the\loopcount\endcsname}
+ \ifnum\first@=0
+ \xdef\st@p{0}
+ \else
+ \xdef\st@p{\csname fileseqHMMTOP\the\loopcount\endcsname}
+ \fi
+ \fi
+ \xdef\temp@{yes} \innerloopcount=0
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \ifx\test@\par@
+ \else
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \ifx\first@\@HP
+ \ifx\temp@\yes \xdef\temp@{\readline} \fi
+ \ifletter
+ \ifx\st@p\third@ \xdef\temp@{\readline} \fi
+ \else
+ \ifnum\st@p=0
+ \expandafter\ifx\csname seqname\st@rt\endcsname\third@
+ \xdef\temp@{\readline} \xdef\st@p{-1}
+ \else
+ \expandafter\ifx\csname newseqname\st@rt\endcsname\third@
+ \xdef\temp@{\readline} \xdef\st@p{-1}
+ \fi
+ \fi
+ \else
+ \advance\innerloopcount by 1
+ \ifnum\st@p=\innerloopcount \xdef\temp@{\readline} \fi
+ \fi
+ \fi
+ \else
+ \xdef\first@@{Protein:}
+ \ifx\first@\first@@
+ \xdef\second@@{\second@}
+ \xdef\temp@@{>HP:} \xdef\fourth@@{ }
+ \read\structurefile to \readline
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \xdef\temp@@{\temp@@\fourth@@\second@\fourth@@\second@@}
+ \read\structurefile to \readline
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \xdef\temp@@{\temp@@\fourth@@\second@}
+ \read\structurefile to \readline
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \xdef\temp@@{\temp@@\fourth@@\fifth@}
+ \read\structurefile to \readline
+ \xdef\structureline{\readline @}
+ \expandafter\rem@ve@TM@info\structureline
+ \xdef\temp@@{\temp@@\fourth@@}
+ \ifx\temp@\yes \xdef\temp@{\temp@@} \fi
+ \ifletter
+ \ifx\st@p\third@ \xdef\temp@{\temp@@} \fi
+ \else
+ \ifnum\st@p=0
+ \expandafter\ifx\csname seqname\st@rt\endcsname\second@@
+ \xdef\temp@{\temp@@}
+ \else
+ \expandafter\ifx\csname newseqname\st@rt\endcsname\second@@
+ \xdef\temp@{\temp@@}
+ \fi
+ \fi
+ \else
+ \advance\innerloopcount by 1
+ \ifnum\st@p=\innerloopcount \xdef\temp@{\temp@@} \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifeof\structurefile \else\repeat
+ \xdef\seq@line{\temp@ @}
+ \innerloopcount=0
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\seq@get\seq@line
+ \xdef\seq@line{\seq@line @}
+ \ifnum\innerloopcount=4 \xdef\c@mp{\first@} \fi
+ \ifnum\innerloopcount=5 \xdef\st@p{\first@} \else \repeat
+ \xdef\first@{IN}
+ \ifx\c@mp\first@ \xdef\c@mp{i} \else \xdef\c@mp{e} \fi
+ \xdef\begin@{1} \xdef\first@@{0} \xdef\second@@{0}
+ \innerloopcount=0
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\seq@get\seq@line
+ \xdef\seq@line{\seq@line @}
+ \temp@count=\first@
+ \advance\temp@count by -1
+ \xdef\end@{\the\temp@count}
+ \loopcount=\second@@
+ \advance\loopcount by 1
+ \xdef\second@@{\the\loopcount}
+ \if\c@mp i
+ \ifx\show@i@HMMTOP\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@i@HMMTOP}{\st@rt}{\begin@..\end@}%
+ {\label@i@HMMTOP}{\text@i@HMMTOP}}\fi
+ \xdef\c@mp{e}
+ \else
+ \ifx\show@e@HMMTOP\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@e@HMMTOP}{\st@rt}{\begin@..\end@}%
+ {\label@e@HMMTOP}{\text@e@HMMTOP}}\fi
+ \xdef\c@mp{i}
+ \fi
+ \advance\temp@count by 1
+ \xdef\begin@{\the\temp@count}
+ \expandafter\seq@get\seq@line
+ \xdef\seq@line{\seq@line @}
+ \xdef\end@{\first@}
+ \loopcount=\first@@
+ \advance\loopcount by 1
+ \xdef\first@@{\the\loopcount}
+ \ifx\show@TM@HMMTOP\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@TM@HMMTOP}{\st@rt}{\begin@..\end@}%
+ {\label@TM@HMMTOP}{\text@TM@HMMTOP}}\fi
+ \temp@count=\end@ \advance\temp@count by 1 \xdef\begin@{\the\temp@count}
+ \ifnum\innerloopcount=\st@p\else\repeat
+ \closein\structurefile
+ \immediate\closeout\featurefile
+ \egroup
+
+ \input{\file@n@me}
+ \fi
+ \else
+ \egroup
+ \message{using existing file:}
+ \input{\file@n@me}
+ \fi
+ }
+
+\def\include@stride{%
+ \xdef\first@{\csname optionstride\the\loopcount\endcsname}
+ \xdef\bottop@{\csname bottopstride\the\loopcount\endcsname}
+ \xdef\st@rt{\csname doseqstride\the\loopcount\endcsname}
+ \xdef\structurefilename{\csname filenamestride\the\loopcount\endcsname}
+ \bgroup
+ \xdef\file@n@me{\structurefilename .@}
+ \expandafter\cut@name\file@n@me
+ \xdef\file@n@me{\file@n@me.sec}
+ \ifx\first@\file@n@me
+ \else
+ \immediate\openin\alignfile = \file@n@me\relax
+ \ifeof\alignfile \xdef\first@{make new} \fi
+ \immediate\closein\alignfile
+ \fi
+ \xdef\temp@{make new}
+ \ifx\first@\temp@
+ \def\par{}
+ \inactivate@chars
+ \immediate\openin\structurefile = \structurefilename\relax
+ \ifeof\structurefile
+ \PackageError{TeXshade}
+ {File `\structurefilename' not found}
+ {\MessageBreak
+ The `STRIDE' file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ No labels for secondary structures will be displayed. \MessageBreak
+ Type <return> to proceed. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \immediate\closein\structurefile\egroup
+ \else
+ \message{[\structurefilename] ->}
+ \immediate\openout\featurefile = \file@n@me
+ \xdef\c@mp{+}
+ \xdef\begin@{\csname seq@start\st@rt\endcsname}
+ \xdef\end@{\csname seq@start\st@rt\endcsname}
+ \xdef\st@rt@{\begin@}
+ \expandafter\innerloopcount=\csname seq@start\st@rt\endcsname
+ \advance\innerloopcount by -1
+ \xdef\first@@{0} \xdef\second@@{0} \xdef\third@@{0}
+ \xdef\fourth@@{0} \xdef\fifth@@{0} \xdef\sixth@@{0}
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \ifx\test@\par@
+ \else
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \ifx\first@\@asg
+ \if\c@mp + \xdef\c@mp{\sixth@}\fi
+ \ifx\sixth@\c@mp
+ \temp@count=\fifth@
+ \advance\temp@count by \st@rt@
+ \advance\temp@count by -1
+ \xdef\end@{\the\temp@count}
+ \else
+ \ifnum\begin@>0
+ \ifnum\end@<\begin@ \xdef\end@{\begin@}\fi
+ \if\c@mp C
+ \else
+ \if\c@mp H
+ \ifx\show@Hstride\yes
+ \loopcount=\first@@
+ \advance\loopcount by 1
+ \xdef\first@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hstride}{\begin@..\end@}%
+ {\label@Hstride}{\text@Hstride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Hstride}{\st@rt}{\begin@..\end@}%
+ {\label@Hstride}{\text@Hstride}}\fi
+ \fi
+ \else
+ \if\c@mp G
+ \ifx\show@Gstride\yes
+ \loopcount=\second@@
+ \advance\loopcount by 1
+ \xdef\second@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Gstride}{\begin@..\end@}%
+ {\label@Gstride}{\text@Gstride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Gstride}{\st@rt}{\begin@..\end@}%
+ {\label@Gstride}{\text@Gstride}}\fi
+ \fi
+ \else
+ \if\c@mp I
+ \ifx\show@Istride\yes
+ \loopcount=\third@@
+ \advance\loopcount by 1
+ \xdef\third@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Istride}{\begin@..\end@}%
+ {\label@Istride}{\text@Istride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Istride}{\st@rt}{\begin@..\end@}%
+ {\label@Istride}{\text@Istride}}\fi
+ \fi
+ \else
+ \if\c@mp E
+ \ifx\show@Estride\yes
+ \loopcount=\fourth@@
+ \advance\loopcount by 1
+ \xdef\fourth@@{\the\loopcount}
+ \advance\innerloopcount by 1
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Estride}{\begin@..\end@}%
+ {\label@Estride}{\text@Estride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Estride}{\st@rt}{\begin@..\end@}%
+ {\label@Estride}{\text@Estride}}\fi
+ \fi
+ \else
+ \if\c@mp B
+ \ifx\show@Bstride\yes
+ \loopcount=\fifth@@
+ \advance\loopcount by 1
+ \xdef\fifth@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Bstride}{\begin@..\end@}%
+ {\label@Bstride}{\text@Bstride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Bstride}{\st@rt}{\begin@..\end@}%
+ {\label@Bstride}{\text@Bstride}}\fi
+ \fi
+ \else
+ \if\c@mp T
+ \ifx\show@Tstride\yes
+ \loopcount=\sixth@@
+ \advance\loopcount by 1
+ \xdef\sixth@@{\the\loopcount}
+ \ifx\m@p\yes
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Tstride}{\begin@..\end@}%
+ {\label@Tstride}{\text@Tstride}}
+ \else
+ \immediate\write\featurefile{%
+ \string\feature{\bottop@Tstride}{\st@rt}{\begin@..\end@}%
+ {\label@Tstride}{\text@Tstride}}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \xdef\c@mp{\sixth@}
+ \temp@count=\fifth@
+ \advance\temp@count by \st@rt@
+ \advance\temp@count by -1
+ \xdef\begin@{\the\temp@count}
+ \fi
+ \fi
+ \fi
+ \ifeof\structurefile \else\repeat
+ \closein\structurefile
+ \immediate\closeout\featurefile
+ \egroup
+ \input{\file@n@me}
+ \fi
+ \else
+ \egroup
+ \message{using existing file:}
+ \input{\file@n@me}
+ \fi
+ }
+\def\include@PHD{%
+ \xdef\first@{\csname optionphd\the\loopcount\endcsname}
+ \xdef\bottop@{\csname bottopphd\the\loopcount\endcsname}
+ \xdef\st@rt{\csname doseqphd\the\loopcount\endcsname}
+ \xdef\m@de{\csname modephd\the\loopcount\endcsname}
+ \xdef\structurefilename{\csname filenamephd\the\loopcount\endcsname}
+ \bgroup
+ \xdef\file@n@me{\structurefilename .@}
+ \expandafter\cut@name\file@n@me
+ \xdef\temp@{structure}
+ \ifx\m@de\temp@
+ \xdef\temp@{\file@n@me .sec}
+ \immediate\openin\alignfile = \temp@\relax
+ \ifeof\alignfile \xdef\first@{make new} \fi
+ \immediate\closein\alignfile
+ \else
+ \xdef\temp@{topology}
+ \ifx\m@de\temp@
+ \xdef\temp@{\file@n@me .top}
+ \immediate\openin\alignfile = \temp@\relax
+ \ifeof\alignfile \xdef\first@{make new} \fi
+ \immediate\closein\alignfile
+ \else
+ \message{<Unknown type. Ignoring \noexpand\includePHD>}
+ \xdef\first@{ignore}
+ \fi\fi
+ \xdef\temp@{make new}
+ \ifx\first@\temp@
+ \def\par{}
+ \xdef\PHD@line{}
+ \inactivate@chars
+ \immediate\openin\structurefile=\structurefilename\relax
+ \ifeof\structurefile
+ \PackageError{TeXshade}%
+ {File `\structurefilename' not found}%
+ {\MessageBreak
+ The `PHD' file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ No labels for secondary structures will be displayed. \MessageBreak
+ Type <return> to proceed. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \immediate\closein\structurefile\egroup
+ \else
+ \message{[\structurefilename] ->}
+ \loop
+ \read\structurefile to \readline
+ \xdef\structureline{\readline & & & & & & & & &@}
+ \expandafter\struc@get\structureline
+ \xdef\temp@{structure}
+ \ifx\m@de\temp@
+ \xdef\temp@{SUB}
+ \ifx\temp@\first@
+ \xdef\temp@{sec}
+ \ifx\temp@\second@
+ \xdef\third@{\third@ @}
+ \expandafter\get@PHD\third@
+ \fi
+ \else
+ \ifx\temp@\second@
+ \xdef\temp@{sec}
+ \ifx\temp@\third@
+ \xdef\fourth@{\fourth@ @}
+ \expandafter\get@PHD\fourth@
+ \fi
+ \fi
+ \fi
+ \else
+ \xdef\temp@{topology}
+ \ifx\m@de\temp@
+ \xdef\temp@{PHDThtm}
+ \ifx\temp@\first@
+ \xdef\second@{\second@ @}
+ \expandafter\get@PHD\second@
+ \fi
+ \fi\fi
+ \ifeof\structurefile \else\repeat
+ \closein\structurefile
+ \xdef\c@mp{+}
+ \xdef\begin@{\csname seq@start\st@rt\endcsname}
+ \xdef\end@{\csname seq@start\st@rt\endcsname}
+ \expandafter\innerloopcount=\csname seq@start\st@rt\endcsname
+ \advance\innerloopcount by -1
+ \xdef\first@{0} \xdef\second@{0} \xdef\third@{0}
+ \xdef\fourth@{0} \xdef\fifth@{0} \xdef\sixth@{0}
+ \xdef\last@{\PHD@line &@}
+ \xdef\temp@{structure}
+ \ifx\temp@\m@de
+ \xdef\file@n@me{\file@n@me .sec}
+ \immediate\openout\featurefile = \file@n@me\relax
+ \write@PHDsec
+ \fi
+ \xdef\temp@{topology}
+ \ifx\temp@\m@de
+ \xdef\file@n@me{\file@n@me .top}
+ \immediate\openout\featurefile = \file@n@me\relax
+ \write@PHDtopo
+ \fi
+ \immediate\closeout\featurefile
+ \egroup
+ \input{\file@n@me}
+ \fi
+ \else
+ \egroup
+ \xdef\temp@{ignore}
+ \ifx\temp@\first@
+ \else
+ \message{using existing file:}
+ \xdef\temp@{structure}
+ \ifx\temp@\m@de \xdef\file@n@me{\file@n@me .sec} \fi
+ \xdef\temp@{topology}
+ \ifx\temp@\m@de \xdef\file@n@me{\file@n@me .top} \fi
+ \input{\file@n@me}
+ \fi
+ \fi}
+\def\show@DSSP{%
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\temp@{alpha}
+ \ifx\fourth@\temp@ \xdef\show@Hdssp{\second@}\fi
+ \xdef\temp@{3-10}
+ \ifx\fourth@\temp@ \xdef\show@Gdssp{\second@}\fi
+ \xdef\temp@{pi}
+ \ifx\fourth@\temp@ \xdef\show@Idssp{\second@}\fi
+ \xdef\temp@{beta}
+ \ifx\fourth@\temp@ \xdef\show@Edssp{\second@}\fi
+ \xdef\temp@{bridge}
+ \ifx\fourth@\temp@ \xdef\show@Bdssp{\second@}\fi
+ \xdef\temp@{turn}
+ \ifx\fourth@\temp@ \xdef\show@Tdssp{\second@}\fi
+ \xdef\temp@{bend}
+ \ifx\fourth@\temp@ \xdef\show@Sdssp{\second@}\fi
+ \show@DSSP
+ \fi}
+\def\show@HMMTOP{%
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\temp@{internal}
+ \ifx\fourth@\temp@ \xdef\show@i@HMMTOP{\second@}\fi
+ \xdef\temp@{external}
+ \ifx\fourth@\temp@ \xdef\show@e@HMMTOP{\second@}\fi
+ \xdef\temp@{TM}
+ \ifx\fourth@\temp@ \xdef\show@TM@HMMTOP{\second@}\fi
+ \show@HMMTOP
+ \fi}
+\def\show@STRIDE{%
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\temp@{alpha}
+ \ifx\fourth@\temp@ \xdef\show@Hstride{\second@}\fi
+ \xdef\temp@{3-10}
+ \ifx\fourth@\temp@ \xdef\show@Gstride{\second@}\fi
+ \xdef\temp@{pi}
+ \ifx\fourth@\temp@ \xdef\show@Istride{\second@}\fi
+ \xdef\temp@{beta}
+ \ifx\fourth@\temp@ \xdef\show@Estride{\second@}\fi
+ \xdef\temp@{bridge}
+ \ifx\fourth@\temp@ \xdef\show@Bstride{\second@}\fi
+ \xdef\temp@{turn}
+ \ifx\fourth@\temp@ \xdef\show@Tstride{\second@}\fi
+ \show@STRIDE
+ \fi}
+\def\show@PHDtopo{%
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\temp@{internal}
+ \ifx\fourth@\temp@ \xdef\show@itop{\second@}\fi
+ \xdef\temp@{external}
+ \ifx\fourth@\temp@ \xdef\show@etop{\second@}\fi
+ \xdef\temp@{TM}
+ \ifx\fourth@\temp@ \xdef\show@TMtop{\second@}\fi
+ \show@PHDtopo
+ \fi}
+\def\show@PHDsec{%
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\temp@{alpha}
+ \ifx\fourth@\temp@ \xdef\show@Hsec{\second@}\fi
+ \xdef\temp@{beta}
+ \ifx\fourth@\temp@ \xdef\show@Esec{\second@}\fi
+ \show@PHDsec
+ \fi}
+\def\get@triplet#1,#2@{%
+ \xdef\third@{#1}
+ \ifx\third@\ampers@nd
+ \else
+ \expandafter\xdef\csname @\third@\endcsname{\first@}
+ \expandafter\xdef\csname rev@\first@\endcsname{\third@}
+ \xdef\fourth@{#2,&,@}
+ \expandafter\get@triplet\fourth@
+ \fi}
+
+\def\get@name@number{%
+ \xdef\second@{n}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\ifx\csname newseqname\the\loopcount\endcsname\first@
+ \xdef\first@{\the\loopcount} \loopcount=\seq@count
+ \xdef\second@{y}
+ \fi
+ \ifnum\loopcount=\seq@count \else \repeat
+ \ifx\second@\n@
+ \message{<Sequence name `\first@' was not found, using first sequence.>}
+ \xdef\first@{1}
+ \fi
+}
+
+
+%%%%% Definition of user commands
+
+\def\clearfuncgroups{\xdef\prfx{func} \clear@groups \xdef\fgroup@num{0}}
+\clearfuncgroups
+\def\germanlanguage{\germ@ntrue \sp@nishfalse \def\cons@name{Konsensus}}
+\def\spanishlanguage{\germ@nfalse \sp@nishtrue \def\cons@name{consenso}}
+\def\englishlanguage{\germ@nfalse \sp@nishfalse \def\cons@name{consensus}}
+\def\showlegend{\legend@true}
+\def\hidelegend{\legend@false}
+\def\movelegend#1#2{%
+ \setlength\hspace@legend{#1}
+ \setlength\vspace@legend{#2}
+}
+\newcommand{\showcaption}[2][bottom]{\def\cap@pos{#1}\def\c@p{#2}}
+\def\shortcaption#1{\def\c@pshort{#1}}
+\def\funcgroup#1#2#3#4#5#6{%
+ \xdef\first@{#1}
+ \loopcount=0 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \ifx\csname fgroup@name\the\loopcount\endcsname\first@
+ \innerloopcount=\loopcount \loopcount=\fgroup@num
+ \fi
+ \ifnum\loopcount<\fgroup@num \repeat
+ \ifnum\innerloopcount=0
+ \ifnum\fgroup@num<9
+ \innerloopcount=\fgroup@num
+ \advance\innerloopcount by 1 \xdef\fgroup@num{\the\innerloopcount}
+ \else \message{<Too many \noexpand\funcgroups>}
+ \fi
+ \fi
+ \ifnum\innerloopcount>0
+ \expandafter\xdef\csname fgroup@name\the\innerloopcount\endcsname{\first@}
+ \expandafter\xdef\csname fg@textcolor\the\innerloopcount\endcsname{#3}
+ \expandafter\xdef\csname fg@color\the\innerloopcount\endcsname{#4}
+ \expandafter\xdef\csname funcm@tch\the\innerloopcount\endcsname{#5}
+ \expandafter\def\csname func@style\the\innerloopcount\endcsname{%
+ \csname text#6\endcsname}
+ \xdef\prfx{func}
+ \xdef\third@{#2&,@} \loopcount=\innerloopcount
+ \expandafter\group@get\third@
+ \fi}
+\def\pepgroups#1{%
+ \xdef\prfx{pep}
+ \clear@groups
+ \xdef\third@{#1&,@} \loopcount=0
+ \loop \expandafter\group@get\third@ \advance\loopcount by 1
+ \ifnum\loopcount<10 \repeat}
+\def\DNAgroups#1{%
+ \xdef\prfx{DNA}
+ \clear@groups
+ \xdef\third@{#1&,@} \loopcount=0
+ \loop \expandafter\group@get\third@ \advance\loopcount by 1
+ \ifnum\loopcount<10 \repeat}
+\def\pepsims#1#2{\xdef\prfx{pep}
+ \def\sim@set{\expandafter\residue@get\second@
+ \ifx\first@\ampers@nd
+ \else \advance\innerloopcount by 1
+ \xdef\second@{\csname sequence\the\loopcount\endcsname} \sim@set
+ \fi}
+ \xdef\first@{#1} \make@upper \xdef\third@{\first@}
+ \xdef\last@{#2} \xdef\second@{#2 &@} \innerloopcount=0 \sim@set
+ \expandafter\xdef\csname \prfx sim\third@\endcsname{%
+ (\the\innerloopcount)\last@}}
+\def\DNAsims#1#2{\xdef\prfx{DNA}
+ \def\sim@set{\expandafter\residue@get\second@
+ \ifx\first@\ampers@nd
+ \else \advance\innerloopcount by 1
+ \xdef\second@{\csname sequence\the\loopcount\endcsname} \sim@set
+ \fi}
+ \xdef\first@{#1} \make@upper \xdef\third@{\first@}
+ \xdef\last@{#2} \xdef\second@{#2 &@} \innerloopcount=0 \sim@set
+ \expandafter\xdef\csname \prfx sim\third@\endcsname{%
+ (\the\innerloopcount)\last@}}
+\def\fingerprint#1{%
+ \ifnum #1 >0
+ \residuesperline*{#1}
+ \def\finger@linenum{#1}
+ \shownames{left}
+ \hidenumbering
+ \rulersteps{100}
+ \nomatchresidues{}{Gray10}{}{}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \separationline{\the\loopcount}
+ \ifnum\loopcount<\seq@count\repeat
+ \fi}
+\def\shaderegion#1#2#3#4{%
+ \regionalshadetrue
+ \xdef\seq@{#1}
+ \xdef\temp@{consensus} \ifx\seq@\temp@ \xdef\seq@{0} \fi
+ \xdef\first@{\seq@ @} \expandafter\check@letter\first@
+ \xdef\first@{\seq@}
+ \ifletter \get@name@number \xdef\seq@{\first@} \fi
+ \ifnum\seq@>\seq@count
+ \message{<Ignored `\seq@' in \noexpand\shaderegion or \noexpand\shadeblock>}
+ \else
+ \ifx\@ll\yes \xdef\@ll{y}\else \xdef\@ll{n}\fi
+ \loopcount=\seq@regions
+ \advance\loopcount by 1
+ \xdef\seq@regions{\the\loopcount}
+ \expandafter\xdef\csname fgseqregion\the\loopcount\endcsname{#3}
+ \expandafter\xdef\csname bgseqregion\the\loopcount\endcsname{#4}
+ \xdef\list@{#2,&}
+ \loop
+ \xdef\list@{\list@ @}
+ \expandafter\get@regions\list@
+ \ifx\list@\ampers@nd\else\repeat
+ \fi
+}
+\def\shadeblock#1#2#3#4{%
+ \xdef\seq@{#1}
+ \xdef\@ll{yes}
+ \shaderegion{#1}{#2}{#3}{#4}
+ \xdef\@ll{}
+}
+\def\tintregion#1#2{%
+ \xdef\seq@{#1}
+ \xdef\temp@{consensus} \ifx\seq@\temp@ \xdef\seq@{0} \fi
+ \xdef\first@{\seq@ @} \expandafter\check@letter\first@
+ \xdef\first@{\seq@}
+ \ifletter \get@name@number \xdef\seq@{\first@} \fi
+ \ifnum\seq@>\seq@count
+ \message{<Ignored seq `\seq@' in \noexpand\tintregion or \noexpand\tintblock>}
+ \else
+ \ifx\@ll\yes \xdef\@ll{y}\else \xdef\@ll{n}\fi
+ \xdef\list@{#2,&}
+ \loop
+ \xdef\list@{\list@ @}
+ \expandafter\get@tintregions\list@
+ \ifx\list@\ampers@nd\else\repeat
+ \fi
+}
+\def\tintblock#1#2{%
+ \xdef\seq@{#1}
+ \xdef\@ll{yes}
+ \tintregion{#1}{#2}
+ \xdef\@ll{}
+}
+\def\tintdefault#1{%
+ \xdef\first@{#1}
+ \xdef\second@{strong}
+ \ifx\first@\second@
+ \xdef\light@{LightLightLight}
+ \else
+ \xdef\second@{medium}
+ \ifx\first@\second@
+ \xdef\light@{LightLight}
+ \else
+ \xdef\second@{weak}
+ \ifx\first@\second@
+ \xdef\light@{Light}
+ \else
+ \xdef\light@{LightLight}
+ \fi\fi\fi
+}
+\def\emphregion#1#2{%
+ \xdef\seq@{#1}
+ \xdef\temp@{consensus} \ifx\seq@\temp@ \xdef\seq@{0} \fi
+ \xdef\first@{\seq@ @} \expandafter\check@letter\first@
+ \xdef\first@{\seq@}
+ \ifletter \get@name@number \xdef\seq@{\first@} \fi
+ \ifnum\seq@>\seq@count
+ \message{<Ignored seq `\seq@' in \noexpand\emphregion or \noexpand\emphblock>}
+ \else
+ \ifx\@ll\yes \xdef\@ll{y}\else \xdef\@ll{n}\fi
+ \xdef\list@{#2,&}
+ \loop
+ \xdef\list@{\list@ @}
+ \expandafter\get@emphregions\list@
+ \ifx\list@\ampers@nd\else\repeat
+ \fi
+}
+\def\emphblock#1#2{%
+ \xdef\seq@{#1}
+ \xdef\@ll{yes}
+ \emphregion{#1}{#2}
+ \xdef\@ll{}
+}
+\def\emphdefault#1{\def\res@style{\csname text#1\endcsname}}
+\def\frameblock#1#2#3{%
+ \xdef\seq@{#1}
+ \xdef\temp@{consensus} \ifx\seq@\temp@ \xdef\seq@{0} \fi
+ \xdef\first@{\seq@ @} \expandafter\check@letter\first@
+ \xdef\first@{\seq@}
+ \ifletter \get@name@number \xdef\seq@{\first@} \fi
+ \ifnum\seq@>\seq@count
+ \message{<Ignored seq `\seq@' in \noexpand\frameblock>}
+ \else
+ \xdef\@ll{#3}
+ \xdef\list@{#2,&}
+ \loop
+ \xdef\list@{\list@ @}
+ \expandafter\get@frameregions\list@
+ \ifx\list@\ampers@nd\else\repeat
+ \fi
+}
+\def\bargraphstretch#1{\def\b@r@stretch{#1}}
+\def\colorscalestretch#1{\def\sc@le@stretch{#1}}
+\def\rm@@measure#1#2@{%
+ \xdef\test@{#1}
+ \ifx\test@\ampers@nd
+ \else
+ \expandafter\check@char\test@
+ \ifnumber\xdef\first@{\first@ #1}
+ \xdef\second@{#2 &@}
+ \expandafter\rm@@measure\second@
+ \fi
+ \fi
+}
+\def\rm@measure#1.#2@{\xdef\first@{#1.}\xdef\second@{#2 @}\xdef\third@{#1}\expandafter\rm@@measure\second@}
+\def\pm@calc{%
+ \temp@@length=100000sp
+ \temp@@length=\g@min\temp@@length
+ \innerloopcount=\temp@@length
+ \xdef\min@{\the\innerloopcount}
+ \arrow@height=\temp@@length
+ \temp@@length=100000sp
+ \temp@@length=\g@max\temp@@length
+ \advance\temp@@length by -\arrow@height
+ \innerloopcount=\temp@@length
+ \divide\innerloopcount by 100
+ \ifnum\innerloopcount=0 \innerloopcount=1 \fi
+ \xdef\m@x{\the\innerloopcount}
+ \xdef\test@{\g@min pt}
+ \setlength\arrow@width{\test@}
+ \xdef\test@{\g@max pt}
+ \setlength\arrow@height{\test@}
+ \advance\arrow@height by -\arrow@width
+ \ifdim\arrow@width<0pt\temp@@length=-\arrow@width\xdef\test@{y}\else\temp@@length=\arrow@width\xdef\test@{n}\fi
+ \ifdim\arrow@height>0pt
+ \ifx\test@\n@ \xdef\test@{y} \else \xdef\test@{n} \fi
+ \ifdim\temp@@length<\arrow@height\temp@@length=\arrow@height\fi
+ \else
+ \ifdim\temp@@length>-\arrow@height\temp@@length=\arrow@height\fi
+ \fi
+ \ifdim\temp@@length<100pt\arrow@width=100\arrow@width\arrow@height=100\arrow@height\else
+ \ifdim\temp@@length<10pt\arrow@width=1000\arrow@width\arrow@height=1000\arrow@height\else
+ \ifdim\temp@@length<1pt\arrow@width=10000\arrow@width\arrow@height=10000\arrow@height\else
+ \ifdim\temp@@length<0.1pt\arrow@width=100000\arrow@width\arrow@height=100000\arrow@height\else
+ \ifdim\temp@@length<0.01pt\arrow@width=1000000\arrow@width \arrow@height=1000000\arrow@height\else
+ \ifdim\temp@@length<0.001pt\arrow@width=10000000\arrow@width \arrow@height=10000000\arrow@height\else
+ \ifdim\temp@@length<0.0001pt\arrow@width=100000000\arrow@width \arrow@height=100000000\arrow@height\else
+ \ifdim\temp@@length<0.00001pt\arrow@width=1000000000\arrow@width \arrow@height=1000000000\arrow@height
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \ifx\test@\y@
+ \xdef\pm@{0}
+ \else
+ \xdef\test@{-\the\arrow@height @}
+ \expandafter\rm@measure\test@
+ \divide\arrow@width by \third@
+ \xdef\pm@{\the\arrow@width @}
+ \expandafter\rm@measure\pm@
+ \xdef\pm@{\first@}
+ \fi
+}
+\def\read@graph{%
+ \bgroup
+ \immediate\openin\structurefile = \fill@char\relax
+ \ifeof\structurefile
+ \PackageError{TeXshade}
+ {File `\fill@char' not found}
+ {\MessageBreak
+ The file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ No feature graph will be displayed. \MessageBreak
+ Type <return> to proceed. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \immediate\closein\structurefile\egroup
+ \else
+ \ifx\g@min\comm@
+ \def\par@{}
+ \xdef\g@min{,} \xdef\g@max{,}
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \ifx\test@\par@
+ \else
+ \xdef\second@{\test@ @}
+ \expandafter\check@letter\second@
+ \ifletter
+ \xdef\second@{\expandafter\string\readline}
+ \xdef\second@{\second@ @}
+ \expandafter\firstchar@get\second@
+ \if\first@ - \numbertrue\fi
+ \fi
+ \ifnumber
+ \temp@@length=1pt
+ \temp@@length=\test@\temp@@length
+ \innerloopcount=\temp@@length
+ \ifx\g@min\comm@ \xdef\min@{\test@ pt} \xdef\g@min{\test@}
+ \else
+ \ifdim\temp@@length<\min@\relax \xdef\min@{\the\temp@@length} \xdef\g@min{\test@} \fi\fi%
+ \ifx\g@max\comm@ \xdef\m@x{\test@ pt} \xdef\g@max{\test@}
+ \else
+ \ifdim\temp@@length>\m@x\relax \xdef\m@x{\the\temp@@length} \xdef\g@max{\test@} \fi\fi%
+ \fi
+ \fi
+ \ifeof\structurefile\else\repeat
+ \fi
+ \immediate\closein\structurefile
+ \pm@calc
+ \expandafter\temp@count=\csname seq@start\seq@\endcsname
+ \advance\temp@count by -1
+ \xdef\temp@@@{n}
+ \immediate\openin\structurefile = \fill@char\relax
+ \loop
+ \read\structurefile to \readline
+ \xdef\test@{\expandafter\string\readline}
+ \ifx\test@\par@
+ \else
+ \xdef\second@{\test@ @}
+ \expandafter\check@letter\second@
+ \ifletter
+ \xdef\second@{\expandafter\string\readline}
+ \xdef\second@{\second@ @}
+ \expandafter\firstchar@get\second@
+ \if\first@ - \numbertrue
+ \else
+ \if\first@ N
+ \expandafter\firstchar@get\third@
+ \if\first@ a
+ \expandafter\firstchar@get\third@
+ \if\first@ N
+ \advance\temp@count by 1
+ \ifnum\temp@count=0 \temp@count=1 \fi
+ \ifnum\temp@count<\st@rt
+ \else
+ \ifnum\temp@count>\st@p
+ \else
+ \ifx\temp@@@\n@
+ \xdef\temp@@@{N}
+ \else
+ \xdef\temp@@@{\temp@@@,N}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifnumber
+ \advance\temp@count by 1
+ \ifnum\temp@count=0 \temp@count=1 \fi
+ \ifnum\temp@count<\st@rt
+ \else
+ \ifnum\temp@count>\st@p
+ \else
+ \temp@@length=100000sp
+ \temp@@length=\test@\temp@@length
+ \innerloopcount=\temp@@length
+ \advance\innerloopcount by 1
+ \xdef\test@{\pm@ pt}
+ \ifdim\test@=0pt
+ \advance\innerloopcount by -\min@
+ \else
+ \ifx\b@r\n@
+ \advance\innerloopcount by -\min@
+ \fi
+ \fi
+ \divide\innerloopcount by \m@x
+ \ifx\temp@@@\n@
+ \xdef\temp@@@{\the\innerloopcount}
+ \else
+ \xdef\temp@@@{\temp@@@,\the\innerloopcount}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifeof\structurefile\else\repeat
+ \immediate\closein\structurefile
+ \xdef\temp@@@{\temp@@@,@} \xdef\temp@@{y}
+ \fi
+ \egroup
+}
+\def\sort@gstack{%
+ \expandafter\get@fromstack\last@
+ \ifx\first@\ampers@nd
+ \xdef\tmpstack{\tmpstack\f@text@&;&;&;&;@}
+ \else
+ \ifnum\loopcount<\second@
+ \xdef\tmpstack{\tmpstack\f@text@\first@;\second@;\third@;\fourth@;\last@}
+ \else
+ \xdef\tmpstack{\tmpstack\first@;\second@;\third@;\fourth@;}
+ \sort@gstack
+ \fi\fi
+}
+\def\get@gregion#1..#2,#3&{%
+ \xdef\st@rt{#1} \xdef\st@p{#2} \xdef\list@{#3}
+}
+\def\do@bargraph{%
+ \expandafter\get@gregion\list@
+ \expandafter\ifnum\csname seq@start\seq@\endcsname>\st@rt
+ \else
+ \xdef\temp@@{n}
+ \xdef\b@r{y}
+ \xdef\pm@{0}
+ \xdef\temp@@@{\fill@char,@}
+ \expandafter\check@letter\temp@@@
+ \ifletter
+ \read@graph
+ \else
+ \ifx\g@min\comm@ \xdef\g@min{0} \fi
+ \ifx\g@max\comm@ \xdef\g@max{100} \fi
+ \pm@calc
+ \xdef\temp@@@{\fill@char,@}
+ \xdef\temp@@{y}
+ \fi
+ \ifx\temp@@\y@
+ \loopcount=\st@rt
+ \xdef\tmpstack{}
+ \loop
+ \expandafter\get@item\temp@@@
+ \xdef\temp@@@{\first@}
+ \xdef\style@{bar[\pm@,0]:\fourth@[\f@color]}
+ \xdef\tmpstack{\tmpstack\f@text@;\the\loopcount;\the\loopcount;\style@;}
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \loopcount=1 \fi
+ \ifnum\loopcount>\st@p
+ \else\repeat
+ \xdef\f@text@{\tmpstack} \xdef\tmpstack{}
+ \xdef\last@{\csname stack@\bottop@\seq@\endcsname}
+ \sort@gstack
+ \expandafter\xdef\csname stack@\bottop@\seq@\endcsname{\tmpstack}
+ \fi
+ \fi
+ \xdef\list@{\list@ &}
+ \ifx\list@\ampers@nd\else\do@bargraph\fi
+}
+\def\do@colorgraph{%
+ \expandafter\get@gregion\list@
+ \expandafter\ifnum\csname seq@start\seq@\endcsname>\st@rt
+ \else
+ \xdef\temp@@{n}
+ \xdef\b@r{n}
+ \xdef\pm@{0}
+ \xdef\temp@@@{\fill@char,@}
+ \expandafter\check@letter\temp@@@
+ \ifletter
+ \read@graph
+ \else
+ \ifx\g@min\comm@ \xdef\g@min{0} \fi
+ \ifx\g@max\comm@ \xdef\g@max{100} \fi
+ \pm@calc
+ \xdef\temp@@@{\fill@char,@}
+ \xdef\temp@@{y}
+ \fi
+ \ifx\temp@@\y@
+ \loopcount=\st@rt
+ \xdef\tmpstack{}
+ \loop
+ \xdef\last@{\csname stack@\bottop@\seq@\endcsname}
+ \expandafter\get@item\temp@@@
+ \xdef\temp@@@{\first@}
+ \ifx\fourth@\N@
+ \xdef\style@{color:50[White]}
+ \else
+ \ifnum\fourth@<1 \xdef\fourth@{1} \fi
+ \innerloopcount=\fourth@
+ \advance\innerloopcount by 4
+ \divide\innerloopcount by 5
+ \multiply\innerloopcount by 5
+ \ifnum\innerloopcount>100 \innerloopcount=100 \fi
+ \xdef\style@{color:50[\f@color\the\innerloopcount]}
+ \fi
+ \xdef\tmpstack{\tmpstack\f@text@;\the\loopcount;\the\loopcount;\style@;}
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \loopcount=1 \fi
+ \ifnum\loopcount>\st@p
+ \else\repeat
+ \xdef\f@text@{\tmpstack} \xdef\tmpstack{}
+ \xdef\last@{\csname stack@\bottop@\seq@\endcsname}
+ \sort@gstack
+ \expandafter\xdef\csname stack@\bottop@\seq@\endcsname{\tmpstack}
+ \fi
+ \fi
+ \xdef\list@{\list@ &}
+ \ifx\list@\ampers@nd\else\do@colorgraph\fi
+}
+\def\feature#1#2#3#4#5{%
+ \xdef\bottop@{#1}
+ \xdef\temp@{top}
+ \ifx\bottop@\temp@ \topfeaturetrue\fi
+ \xdef\temp@{ttop}
+ \ifx\bottop@\temp@ \ttopfeaturetrue\fi
+ \xdef\temp@{bottom}
+ \ifx\bottop@\temp@ \bottomfeaturetrue\fi
+ \xdef\temp@{bbottom}
+ \ifx\bottop@\temp@ \bbottomfeaturetrue\fi
+ \xdef\seq@{#2}
+ \xdef\temp@{consensus} \ifx\seq@\temp@ \xdef\seq@{0} \fi
+ \xdef\first@{\seq@ @} \expandafter\check@letter\first@
+ \xdef\first@{\seq@}
+ \ifletter \get@name@number \xdef\seq@{\first@} \fi
+ \ifnum\seq@>\seq@count
+ \message{<Ignored seq `\seq@' in \noexpand\feature>}
+ \else
+ \ifnum\seq@>-1
+ \xdef\temp@{#4::&}\expandafter\test@fill\temp@
+ \xdef\last@{bar}
+ \ifx\second@@\last@
+ \xdef\last@{hydrophobicity}
+ \ifx\last@\fourth@
+ \xdef\second@@{bh}
+ \else
+ \xdef\last@{molweight}
+ \ifx\last@\fourth@
+ \xdef\second@@{bm}
+ \else
+ \xdef\last@{charge}
+ \ifx\last@\fourth@
+ \xdef\second@@{bc}
+ \else
+ \xdef\last@{conservation}
+ \ifx\last@\fourth@
+ \xdef\second@@{bcons}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\last@{color}
+ \ifx\second@@\last@
+ \xdef\last@{hydrophobicity}
+ \ifx\last@\fourth@
+ \xdef\second@@{ch}
+ \else
+ \xdef\last@{molweight}
+ \ifx\last@\fourth@
+ \xdef\second@@{cm}
+ \else
+ \xdef\last@{charge}
+ \ifx\last@\fourth@
+ \xdef\second@@{cc}
+ \else
+ \xdef\last@{conservation}
+ \ifx\last@\fourth@
+ \xdef\second@@{ccons}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\last@{bar}
+ \ifx\second@@\last@
+ \xdef\list@{#3,&}
+ \xdef\style@{#4}
+ \xdef\f@text@{#5}
+ \do@bargraph
+ \xdef\temp@{bottom}
+ \ifx\bottop@\temp@ \xdef\bottom@stretch{y}\fi
+ \xdef\temp@{bbottom}
+ \ifx\bottop@\temp@ \xdef\bbottom@stretch{y}\fi
+ \else
+ \xdef\last@{color}
+ \ifx\second@@\last@
+ \xdef\list@{#3,&}
+ \xdef\style@{#4}
+ \xdef\f@text@{#5}
+ \do@colorgraph
+ \else
+ \xdef\f@text@{#5}
+ \xdef\list@{#3,&}
+ \xdef\temp@{#4&}
+ \ifx\temp@\ampers@nd
+ \xdef\style@{&}
+ \else
+ \xdef\last@{restriction}
+ \ifx\second@@\last@
+ \xdef\temp@{\bottop@ @}
+ \expandafter\firstchar@get\temp@
+ \xdef\temp@{y}
+ \if\first@ t
+ \xdef\style@{fill:\kern0.9\box@width$\blacktriangledown$[\f@color]}
+ \else
+ \xdef\style@{fill:\kern0.9\box@width$\blacktriangle$[\f@color]}
+ \fi
+ \xdef\f@text@{\kern0.9\box@width#5}
+ \else
+ \xdef\last@{bh}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{Gray50}\fi
+ \xdef\style@{plot[bar]:Hydro[\f@color][-53]}
+ \else
+ \xdef\last@{bm}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{Gray50}\fi
+ \xdef\style@{plot[bar]:molw[\f@color][0]}
+ \else
+ \xdef\last@{bc}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{Gray50}\fi
+ \xdef\style@{plot[bar]:charge[\f@color][-50]}
+ \else
+ \xdef\last@{bcons}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{Gray50}\fi
+ \xdef\style@{cons[bar]:cons[\f@color][0]}
+ \else
+ \xdef\last@{ch}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{RedGreen}\fi
+ \xdef\style@{plot[color]:Hydro[\f@color][-53]}
+ \else
+ \xdef\last@{cm}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{Gray}\fi
+ \xdef\style@{plot[color]:molw[\f@color][0]}
+ \else
+ \xdef\last@{cc}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{RedBlue}\fi
+ \xdef\style@{plot[color]:charge[\f@color][-50]}
+ \else
+ \xdef\last@{ccons}
+ \ifx\second@@\last@
+ \ifx\f@color\gr@ydef@ult\xdef\f@color{ColdHot}\fi
+ \xdef\style@{cons[color]:cons[\f@color][0]}
+ \else
+ \xdef\style@{#4} \expandafter\getarrow@shape\temp@
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \loop
+ \xdef\list@{\list@ @}
+ \expandafter\get@fregions\list@
+ \ifx\list@\ampers@nd\else\repeat
+ \fi\fi\fi
+ \fi
+}
+\def\seqtype#1{\xdef\seq@type{#1}
+ \if\seq@type P \xdef\prefix@{pep}
+ \else \if\seq@type p \xdef\seq@type{P} \xdef\prefix@{pep}
+ \else \xdef\seq@type{N} \xdef\prefix@{DNA} \fi\fi}
+\def\nameseq#1#2{%
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname newseqname\first@\endcsname{#2}
+}
+\def\threshold#1{\xdef\thresh@ld{#1}}
+\def\constosingleseq#1{%
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1} \ifletter \get@name@number \fi
+ \ifnum\first@>\seq@count
+ \message{<Ignored seq `#1' in \noexpand\constosingleseq>}
+ \else
+ \ifnum\first@>0 \xdef\cons@num{\first@} \hideconsensus\fi\fi
+}
+\def\constoallseqs{\xdef\cons@num{0}}
+\def\residuesperline{%
+ \def\@rplfix*##1{%
+ \res@perline=##1
+ \ifnum\res@perline<1 \res@perline=1\fi \rpl@fixtrue}
+ \def\@rplvar ##1{%
+ \res@perline=##1
+ \ifnum\res@perline<5 \res@perline=5\fi \rpl@fixfalse}
+ \def\decide@{\ifx\l@@k * \let\next\@rplfix \else \let\next\@rplvar \fi \next}
+ \futurelet\l@@k\decide@}
+\def\numberingwidth#1{\def\num@width{#1}}
+\def\charstretch#1{\def\char@stretch{#1}}
+\def\linestretch#1{\def\line@stretch{#1}}
+\def\noblockskip{\def\block@skip{\vspace{0pt}}}
+\def\smallblockskip{\def\block@skip{\vspace{\baselineskip}}}
+\def\medblockskip{\def\block@skip{\vspace{1.5\baselineskip}}}
+\def\bigblockskip{\def\block@skip{\vspace{2\baselineskip}}}
+\def\vblockspace#1{\def\block@skip{\vspace{#1}}}
+\def\topspace#1{\def\t@sp@ce{#1}}
+\def\ttopspace#1{\def\tt@sp@ce{#1}}
+\def\bottomspace#1{\def\b@sp@ce{#1}}
+\def\bbottomspace#1{\def\bb@sp@ce{#1}}
+\def\fixblockspace{\fix@true}
+\def\flexblockspace{\fix@false}
+\def\nosepline{\def\seq@skip{\relax}}
+\def\smallsepline{\def\seq@skip{\vspace{3pt}}\def\sep@space{3pt}}
+\def\medsepline{\def\seq@skip{\vspace{6pt}}\def\sep@space{6pt}}
+\def\bigsepline{\def\seq@skip{\vspace{12pt}}\def\sep@space{12pt}}
+\def\vsepspace#1{\def\seq@skip{\vspace{#1}}\xdef\sep@space{#1}}
+\def\separationline#1{%
+ \xdef\start@seq{#1}
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1}
+ \ifletter \get@name@number \xdef\start@seq{\first@} \fi
+ \ifnum\start@seq>\seq@count \xdef\start@seq{1}
+ \else
+ \ifnum\start@seq<0 \xdef\start@seq{1}
+ \else
+ \expandafter\def\csname seq@gap\start@seq\endcsname{yes}
+ \loopcount=\seq@gap@num
+ \advance\loopcount by 1
+ \xdef\seq@gap@num{\the\loopcount}
+ \fi
+ \fi}
+\newcommand{\shadingmode}[2][1]{%
+ \xdef\last@{#2}
+ \xdef\first@{identical}
+ \all@shadefalse
+ \ifx\first@\last@
+ \simmodefalse \funcmodefalse
+ \xdef\last@{#1} \xdef\second@{allmatchspecial}
+ \ifx\second@\last@ \all@shadetrue \fi
+ \else
+ \xdef\first@{similar}
+ \ifx\first@\last@
+ \simmodetrue \funcmodefalse
+ \xdef\last@{#1} \xdef\second@{allmatchspecial}
+ \ifx\second@\last@ \all@shadetrue \fi
+ \else
+ \xdef\first@{functional}
+ \ifx\first@\last@
+ \if\seq@type P \simmodefalse \funcmodetrue \func@shading{#1}
+ \else \message{<No functional shading on DNA sequences>} \fi
+ \else
+ \xdef\first@{diverse}
+ \ifx\first@\last@
+ \xdef\last@{#1}
+ \ifnum\last@>\seq@count \xdef\last@{1}\fi
+ \ifnum\last@<1 \xdef\last@{1}\fi
+ \simmodetrue \funcmodefalse
+ \threshold{0}
+ \donotshade{\last@} \constosingleseq{\last@}
+ \nomatchresidues{Black}{White}{lower}{up}
+ \similarresidues{Black}{White}{lower}{up}
+ \conservedresidues{Black}{White}{{.}}{up}
+ \allmatchresidues{Black}{White}{{.}}{up}
+ \gapchar{-}
+ \hideconsensus
+ \else
+ \message{<Unknown shading mode. Using `similar'>}
+ \simmodetrue \funcmodefalse
+ \fi\fi\fi\fi}
+\def\allmatchspecial{\all@shadetrue}
+\def\allmatchspecialoff{\all@shadefalse}
+\def\gapchar#1{%
+ \xdef\first@{rule}\xdef\second@{#1}
+ \ifx\first@\second@\def\gap@char{o}
+ \else\def\gap@char{#1}\fi}
+\def\gaprule#1{\def\gap@rulethick{#1}}
+\def\setends#1#2{%
+ \xdef\start@seq{#1}
+ \xdef\temp@{consensus}
+ \ifx\start@seq\temp@ \xdef\start@seq{0} \fi
+ \xdef\first@{\start@seq @} \expandafter\check@letter\first@
+ \xdef\first@{\start@seq}
+ \ifletter \get@name@number \xdef\start@seq{\first@} \fi
+ \ifnum\start@seq>\seq@count \xdef\start@seq{1}
+ \else
+ \ifnum\start@seq<0 \xdef\start@seq{1}
+ \else
+ \xdef\second@{#2@} \expandafter\get@nums\second@
+ \xdef\start@num{\first@} \xdef\end@num{\second@}
+ \start@false
+ \fi
+ \fi}
+\def\startnumber#1#2{%
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1} \ifletter \get@name@number \fi
+ \ifnum\first@>\seq@count \message{<Ignored seq `#1' in \noexpand\startnumber>}
+ \else
+ \xdef\second@{#2} \ifnum\second@=0 \xdef\second@{1} \fi
+ \expandafter\xdef\csname seq@start\first@\endcsname{\second@}
+ \csname res@count\first@\endcsname=\second@
+ \advance\csname res@count\first@\endcsname by -1
+ \fi}
+\def\seqlength#1#2{%
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1} \ifletter \get@name@number \fi
+ \ifnum\first@>\seq@count \message{<Ignored seq `#1' in \noexpand\seqlength>}
+ \else
+ \xdef\second@{#2} \ifnum\second@<0 \xdef\second@{1} \fi
+ \expandafter\xdef\csname seq@len\first@\endcsname{\second@}
+ \fi}
+\def\shownumbering#1{%
+ \xdef\first@{#1} \xdef\second@{right}
+ \ifx\first@\second@ \numbers@leftfalse \else \numbers@lefttrue \fi
+ \numbers@true}
+\def\hidenumbering{\numbers@false}
+\def\hidenumber#1{\xdef\first@{#1,&,@} \hidenumber@}
+\def\shownames#1{%
+ \xdef\first@{#1} \xdef\second@{left}
+ \ifx\first@\second@ \names@rightfalse \else \names@righttrue \fi
+ \names@true}
+\def\hidenames{\names@false}
+\def\hidename#1{\xdef\first@{#1,&,@} \hidename@}
+\def\hideresidues{\hidechartrue}
+\def\showresidues{\hidecharfalse}
+\def\alignment#1{%
+ \xdef\first@{#1}
+ \xdef\temp@{left}
+ \ifx\first@\temp@ \xdef\c@factor{0}
+ \else
+ \xdef\temp@{center}
+ \ifx\first@\temp@ \xdef\c@factor{0.5}
+ \else
+ \xdef\temp@{right}
+ \ifx\first@\temp@ \xdef\c@factor{1}
+ \fi\fi\fi}
+\def\donotshade#1{%
+ \xdef\temp@{consensus}
+ \xdef\first@{#1}
+ \ifx\first@\temp@
+ \consensuscolors{Black}{White}{Black}{White}{Black}{White}
+ \else
+ \xdef\first@{#1,&,@} \donot@shade
+ \fi}
+\def\hideseq#1{\xdef\first@{#1,&,@} \hideseq@}
+\def\killseq#1{\xdef\first@{#1,&,@} \killseq@}
+\newcommand\showconsensus[2][n]{%
+ \xdef\text@scale{n}
+ \xdef\box@scale{n}
+ \xdef\first@{#1}
+ \ifx\first@\n@
+ \xdef\collect@cons@colors{no}
+ \else
+ \xdef\first@{#1,&,@}
+ \expandafter\get@item\first@
+ \xdef\c@nsc@l{\fourth@}
+ \xdef\first@@{Gray}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{RedBlue}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{BlueRed}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{RedGreen}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{GreenRed}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{ColdHot}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}\else
+ \xdef\first@@{HotCold}
+ \ifx\c@nsc@l\first@@\xdef\text@scale{y}
+ \fi\fi\fi\fi\fi\fi\fi
+ \expandafter\get@item\first@
+ \ifx\fourth@\ampers@nd
+ \xdef\c@nssc@le{White}
+ \else
+ \xdef\c@nssc@le{\fourth@}
+ \xdef\first@{Gray}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{RedBlue}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{BlueRed}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{RedGreen}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{GreenRed}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{ColdHot}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \xdef\first@{HotCold}
+ \ifx\c@nssc@le\first@\xdef\box@scale{y}\else
+ \fi\fi\fi\fi\fi\fi\fi
+ \fi
+ \xdef\collect@cons@colors{y}
+ \fi
+ \xdef\first@{#2} \xdef\last@{top}
+ \ifx\first@\last@\xdef\cons@top{0}\else\xdef\cons@top{1}\fi
+ \show@construe}
+\def\consensuscolors#1#2#3#4#5#6{%
+ \xdef\last@{\ampers@nd}
+ \xdef\first@{#1&}\xdef\second@{#2&}
+ \ifx\first@\last@\else\def\ConsTextNomatch{#1}\fi
+ \ifx\second@\last@\else\def\ConsNomatch{#2}\fi
+ \xdef\first@{#3&}\xdef\second@{#4&}
+ \ifx\first@\last@\else\def\ConsTextMatch{#3}\fi
+ \ifx\second@\last@\else\def\ConsMatch{#4}\fi
+ \xdef\first@{#5&}\xdef\second@{#6&}
+ \ifx\first@\last@\else\def\ConsTextAllmatch{#5}\fi
+ \ifx\second@\last@\else\def\ConsAllmatch{#6}\fi
+}
+\def\defconsensus#1#2#3{%
+ \xdef\second@{#1&}
+ \ifx\second@\ampers@nd \else \def\n@m@tch{#1}\fi
+ \xdef\second@{#2&}
+ \ifx\second@\ampers@nd \else \def\m@tch{#2}\fi
+ \xdef\second@{#3&}
+ \ifx\second@\ampers@nd \else \def\@llm@tch{#3}\fi}
+\def\hideconsensus{\show@consfalse}
+\def\nameconsensus#1{\def\cons@name{#1}}
+\def\hideleadinggaps{\sh@wg@psfalse}
+\def\showleadinggaps{\sh@wg@pstrue}
+\def\showruler#1#2{%
+ \xdef\first@{consensus} \xdef\second@{#2}
+ \xdef\third@{bottom} \xdef\fourth@{#1}
+ \ifx\third@\fourth@ \xdef\rule@top{1}\else\xdef\rule@top{0}\fi
+ \ifx\first@\second@ \xdef\rule@num{0}
+ \else
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \ifnum\first@>\seq@count
+ \else
+ \ifnum\first@>0
+ \xdef\rule@num{\first@}
+ \fi
+ \fi
+ \fi
+ \xdef\ruler@{}}
+\def\hideruler{\xdef\rule@num{-1}}
+\def\rulersteps#1{\xdef\ruler@step{#1}}
+\def\featurerule#1{\setlength\rule@thick{#1}}
+\def\orderseqs#1{%
+ \def\order@loop{%
+ \expandafter\check@letter\first@
+ \ifletter
+ \expandafter\get@item\first@
+ \xdef\first@{\fourth@}
+ \get@name@number
+ \xdef\seq@order{\seq@order,\first@}
+ \xdef\first@{\first@@ @}
+ \order@loop
+ \else
+ \expandafter\get@digit\first@
+ \ifx\fourth@\ampers@nd
+ \else
+ \xdef\seq@order{\seq@order,\fourth@}
+ \order@loop
+ \fi
+ \fi}
+ \xdef\first@{#1,&,@}
+ \xdef\seq@order{}
+ \order@loop
+ \xdef\seq@order{\seq@order @}
+ \expandafter\get@item\seq@order
+ \xdef\seq@order{\first@@,@}
+}
+\def\setfamily#1#2{%
+ \xdef\second@{#2&}
+ \ifx\second@\ampers@nd
+ \else
+ \xdef\first@{#1}
+ \xdef\second@{#2}
+ \xdef\temp@{rm}
+ \ifx\second@\temp@
+ \xdef\third@{\rmdefault}
+ \else
+ \xdef\temp@{sf}
+ \ifx\second@\temp@
+ \xdef\third@{\sfdefault}
+ \else
+ \xdef\temp@{tt}
+ \ifx\second@\temp@
+ \xdef\third@{\ttdefault}
+ \else
+ \xdef\third@{\second@}
+ \fi\fi\fi
+ \xdef\temp@{features}
+ \ifx\first@\temp@ \xdef\featuretext@family{\third@}
+ \else
+ \xdef\temp@{featurestyles}
+ \ifx\first@\temp@ \xdef\featurestyles@family{\third@}
+ \else
+ \xdef\temp@{numbering}
+ \ifx\first@\temp@ \xdef\numbertext@family{\third@}
+ \else
+ \xdef\temp@{names}
+ \ifx\first@\temp@ \xdef\namestext@family{\third@}
+ \else
+ \xdef\temp@{residues}
+ \ifx\first@\temp@ \xdef\residues@family{\third@}
+ \else
+ \xdef\temp@{legend}
+ \ifx\first@\temp@ \xdef\legend@family{\third@}
+ \else
+ \xdef\temp@{labels}
+ \ifx\first@\temp@ \xdef\label@family{\third@}
+ \else
+ \xdef\temp@{all}
+ \ifx\first@\temp@
+ \xdef\featuretext@family{\third@}
+ \xdef\featurestyles@family{\third@}
+ \xdef\numbertext@family{\third@}
+ \xdef\namestext@family{\third@}
+ \xdef\residues@family{\third@}
+ \xdef\legend@family{\third@}
+ \xdef\label@family{\third@}
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+}
+\def\setseries#1#2{%
+ \xdef\second@{#2&}
+ \ifx\second@\ampers@nd
+ \else
+ \xdef\first@{#1}
+ \xdef\second@{#2}
+ \xdef\temp@{bf}
+ \ifx\second@\temp@
+ \xdef\third@{\bfdefault}
+ \else
+ \xdef\temp@{md}
+ \ifx\second@\temp@
+ \xdef\third@{\mddefault}
+ \else
+ \xdef\third@{\second@}
+ \fi\fi
+ \xdef\temp@{features}
+ \ifx\first@\temp@ \xdef\featuretext@series{\third@}
+ \else
+ \xdef\temp@{featurestyles}
+ \ifx\first@\temp@ \xdef\featurestyles@series{\third@}
+ \else
+ \xdef\temp@{numbering}
+ \ifx\first@\temp@ \xdef\numbertext@series{\third@}
+ \else
+ \xdef\temp@{names}
+ \ifx\first@\temp@ \xdef\namestext@series{\third@}
+ \else
+ \xdef\temp@{residues}
+ \ifx\first@\temp@ \xdef\residues@series{\third@}
+ \else
+ \xdef\temp@{legend}
+ \ifx\first@\temp@ \xdef\legend@series{\third@}
+ \else
+ \xdef\temp@{labels}
+ \ifx\first@\temp@ \xdef\label@series{\third@}
+ \else
+ \xdef\temp@{all}
+ \ifx\first@\temp@
+ \xdef\featuretext@series{\third@}
+ \xdef\featurestyles@series{\third@}
+ \xdef\numbertext@series{\third@}
+ \xdef\namestext@series{\third@}
+ \xdef\residues@series{\third@}
+ \xdef\legend@series{\third@}
+ \xdef\label@series{\third@}
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+}
+\def\setshape#1#2{%
+ \xdef\second@{#2&}
+ \ifx\second@\ampers@nd
+ \else
+ \xdef\first@{#1}
+ \xdef\second@{#2}
+ \xdef\temp@{it}
+ \ifx\second@\temp@
+ \xdef\third@{\itdefault}
+ \else
+ \xdef\temp@{sl}
+ \ifx\second@\temp@
+ \xdef\third@{\sldefault}
+ \else
+ \xdef\temp@{sc}
+ \ifx\second@\temp@
+ \xdef\third@{\scdefault}
+ \else
+ \xdef\temp@{up}
+ \ifx\second@\temp@
+ \xdef\third@{\updefault}
+ \else
+ \xdef\third@{\second@}
+ \fi\fi\fi\fi
+ \xdef\temp@{features}
+ \ifx\first@\temp@ \xdef\featuretext@shape{\third@}
+ \else
+ \xdef\temp@{featurestyles}
+ \ifx\first@\temp@ \xdef\featurestyles@shape{\third@}
+ \else
+ \xdef\temp@{numbering}
+ \ifx\first@\temp@ \xdef\numbertext@shape{\third@}
+ \else
+ \xdef\temp@{names}
+ \ifx\first@\temp@ \xdef\namestext@shape{\third@}
+ \else
+ \xdef\temp@{residues}
+ \ifx\first@\temp@ \xdef\residues@shape{\third@}
+ \else
+ \xdef\temp@{legend}
+ \ifx\first@\temp@ \xdef\legend@shape{\third@}
+ \else
+ \xdef\temp@{labels}
+ \ifx\first@\temp@ \xdef\label@shape{\third@}
+ \else
+ \xdef\temp@{all}
+ \ifx\first@\temp@
+ \xdef\featuretext@shape{\third@}
+ \xdef\featurestyles@shape{\third@}
+ \xdef\numbertext@shape{\third@}
+ \xdef\namestext@shape{\third@}
+ \xdef\residues@shape{\third@}
+ \xdef\legend@shape{\third@}
+ \xdef\label@shape{\third@}
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+}
+\def\setsize#1#2{%
+ \xdef\second@{#2&}
+ \ifx\second@\ampers@nd
+ \else
+ \xdef\first@{#1}
+ \xdef\temp@{features}
+ \ifx\first@\temp@
+ \def\featuretext@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{featurestyles}
+ \ifx\first@\temp@
+ \def\featurestyles@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{numbering}
+ \ifx\first@\temp@
+ \def\numbertext@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{names}
+ \ifx\first@\temp@
+ \def\namestext@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{legend}
+ \ifx\first@\temp@
+ \def\legend@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{labels}
+ \ifx\first@\temp@
+ \def\label@size{\csname #2\endcsname}
+ \else
+ \xdef\temp@{residues}
+ \ifx\first@\temp@
+ \def\residues@size{\csname #2\endcsname}
+ \xdef\res@size{#2}
+ \else
+ \xdef\temp@{all}
+ \ifx\first@\temp@
+ \def\featuretext@size{\csname #2\endcsname}
+ \def\featurestyles@size{\csname #2\endcsname}
+ \def\numbertext@size{\csname #2\endcsname}
+ \def\namestext@size{\csname #2\endcsname}
+ \def\legend@size{\csname #2\endcsname}
+ \def\label@size{\csname #2\endcsname}
+ \def\residues@size{\csname #2\endcsname}
+ \xdef\res@size{#2}
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \xdef\temp@{Huge}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname Large\endcsname}
+ \else
+ \xdef\temp@{huge}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname large\endcsname}
+ \else
+ \xdef\temp@{LARGE}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname normalsize\endcsname}
+ \else
+ \xdef\temp@{Large}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname small\endcsname}
+ \else
+ \xdef\temp@{large}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname footnotesize\endcsname}
+ \else
+ \xdef\temp@{normalsize}
+ \ifx\temp@\res@size
+ \def\bottomruler@size{\csname scriptsize\endcsname}
+ \else
+ \def\bottomruler@size{\csname tiny\endcsname}
+ \fi\fi\fi\fi\fi\fi
+ \fi
+}
+\def\setfont#1#2#3#4#5{%
+ \setfamily{#1}{#2}\setseries{#1}{#3}
+ \setshape{#1}{#4}\setsize{#1}{#5}}
+\def\featuresrm{\setfamily{features}{rm}}
+\def\featuressf{\setfamily{features}{sf}}
+\def\featurestt{\setfamily{features}{tt}}
+\def\featuresmd{\setseries{features}{md}}
+\def\featuresbf{\setseries{features}{bf}}
+\def\featuresup{\setshape {features}{up}}
+\def\featuresit{\setshape {features}{it}}
+\def\featuressl{\setshape {features}{sl}}
+\def\featuressc{\setshape {features}{sc}}
+\def\featurestiny {\setsize{features}{tiny}}
+\def\featuresscriptsize {\setsize{features}{scriptsize}}
+\def\featuresfootnotesize{\setsize{features}{footnotesize}}
+\def\featuressmall {\setsize{features}{small}}
+\def\featuresnormalsize {\setsize{features}{normalsize}}
+\def\featureslarge {\setsize{features}{large}}
+\def\featuresLarge {\setsize{features}{Large}}
+\def\featuresLARGE {\setsize{features}{LARGE}}
+\def\featureshuge {\setsize{features}{huge}}
+\def\featuresHuge {\setsize{features}{Huge}}
+\def\featurestylesrm{\setfamily{featurestyles}{rm}}
+\def\featurestylessf{\setfamily{featurestyles}{sf}}
+\def\featurestylestt{\setfamily{featurestyles}{tt}}
+\def\featurestylesmd{\setseries{featurestyles}{md}}
+\def\featurestylesbf{\setseries{featurestyles}{bf}}
+\def\featurestylesup{\setshape {featurestyles}{up}}
+\def\featurestylesit{\setshape {featurestyles}{it}}
+\def\featurestylessl{\setshape {featurestyles}{sl}}
+\def\featurestylessc{\setshape {featurestyles}{sc}}
+\def\featurestylestiny {\setsize{featurestyles}{tiny}}
+\def\featurestylesscriptsize {\setsize{featurestyles}{scriptsize}}
+\def\featurestylesfootnotesize{\setsize{featurestyles}{footnotesize}}
+\def\featurestylessmall {\setsize{featurestyles}{small}}
+\def\featurestylesnormalsize {\setsize{featurestyles}{normalsize}}
+\def\featurestyleslarge {\setsize{featurestyles}{large}}
+\def\featurestylesLarge {\setsize{featurestyles}{Large}}
+\def\featurestylesLARGE {\setsize{featurestyles}{LARGE}}
+\def\featurestyleshuge {\setsize{featurestyles}{huge}}
+\def\featurestylesHuge {\setsize{featurestyles}{Huge}}
+\def\numberingrm{\setfamily{numbering}{rm}}
+\def\numberingsf{\setfamily{numbering}{sf}}
+\def\numberingtt{\setfamily{numbering}{tt}}
+\def\numberingmd{\setseries{numbering}{md}}
+\def\numberingbf{\setseries{numbering}{bf}}
+\def\numberingup{\setshape {numbering}{up}}
+\def\numberingit{\setshape {numbering}{it}}
+\def\numberingsl{\setshape {numbering}{sl}}
+\def\numberingsc{\setshape {numbering}{sc}}
+\def\numberingtiny {\setsize{numbering}{tiny}}
+\def\numberingscriptsize {\setsize{numbering}{scriptsize}}
+\def\numberingfootnotesize{\setsize{numbering}{footnotesize}}
+\def\numberingsmall {\setsize{numbering}{small}}
+\def\numberingnormalsize {\setsize{numbering}{normalsize}}
+\def\numberinglarge {\setsize{numbering}{large}}
+\def\numberingLarge {\setsize{numbering}{Large}}
+\def\numberingLARGE {\setsize{numbering}{LARGE}}
+\def\numberinghuge {\setsize{numbering}{huge}}
+\def\numberingHuge {\setsize{numbering}{Huge}}
+\def\namesrm{\setfamily{names}{rm}}
+\def\namessf{\setfamily{names}{sf}}
+\def\namestt{\setfamily{names}{tt}}
+\def\namesmd{\setseries{names}{md}}
+\def\namesbf{\setseries{names}{bf}}
+\def\namesup{\setshape {names}{up}}
+\def\namesit{\setshape {names}{it}}
+\def\namessl{\setshape {names}{sl}}
+\def\namessc{\setshape {names}{sc}}
+\def\namestiny {\setsize{names}{tiny}}
+\def\namesscriptsize {\setsize{names}{scriptsize}}
+\def\namesfootnotesize{\setsize{names}{footnotesize}}
+\def\namessmall {\setsize{names}{small}}
+\def\namesnormalsize {\setsize{names}{normalsize}}
+\def\nameslarge {\setsize{names}{large}}
+\def\namesLarge {\setsize{names}{Large}}
+\def\namesLARGE {\setsize{names}{LARGE}}
+\def\nameshuge {\setsize{names}{huge}}
+\def\namesHuge {\setsize{names}{Huge}}
+\def\residuesrm{\setfamily{residues}{rm}}
+\def\residuessf{\setfamily{residues}{sf}}
+\def\residuestt{\setfamily{residues}{tt}}
+\def\residuesmd{\setseries{residues}{md}}
+\def\residuesbf{\setseries{residues}{bf}}
+\def\residuesup{\setshape {residues}{up}}
+\def\residuesit{\setshape {residues}{it}}
+\def\residuessl{\setshape {residues}{sl}}
+\def\residuessc{\setshape {residues}{sc}}
+\def\residuestiny {\setsize{residues}{tiny}}
+\def\residuesscriptsize {\setsize{residues}{scriptsize}}
+\def\residuesfootnotesize{\setsize{residues}{footnotesize}}
+\def\residuessmall {\setsize{residues}{small}}
+\def\residuesnormalsize {\setsize{residues}{normalsize}}
+\def\residueslarge {\setsize{residues}{large}}
+\def\residuesLarge {\setsize{residues}{Large}}
+\def\residuesLARGE {\setsize{residues}{LARGE}}
+\def\residueshuge {\setsize{residues}{huge}}
+\def\residuesHuge {\setsize{residues}{Huge}}
+\def\legendrm{\setfamily{legend}{rm}}
+\def\legendsf{\setfamily{legend}{sf}}
+\def\legendtt{\setfamily{legend}{tt}}
+\def\legendmd{\setseries{legend}{md}}
+\def\legendbf{\setseries{legend}{bf}}
+\def\legendup{\setshape {legend}{up}}
+\def\legendit{\setshape {legend}{it}}
+\def\legendsl{\setshape {legend}{sl}}
+\def\legendsc{\setshape {legend}{sc}}
+\def\legendtiny {\setsize{legend}{tiny}}
+\def\legendscriptsize {\setsize{legend}{scriptsize}}
+\def\legendfootnotesize{\setsize{legend}{footnotesize}}
+\def\legendsmall {\setsize{legend}{small}}
+\def\legendnormalsize {\setsize{legend}{normalsize}}
+\def\legendlarge {\setsize{legend}{large}}
+\def\legendLarge {\setsize{legend}{Large}}
+\def\legendLARGE {\setsize{legend}{LARGE}}
+\def\legendhuge {\setsize{legend}{huge}}
+\def\legendHuge {\setsize{legend}{Huge}}
+\def\funcshadingstyle#1#2#3#4#5{%
+ \xdef\temp@{nomatch} \xdef\first@{#1}
+ \ifx\temp@\first@
+ \xdef\first@{0}
+ \else
+ \xdef\first@{\csname funcgrp#1\endcsname}
+ \fi
+ \ifnum\first@>-1
+ \expandafter\xdef\csname fg@textcolor\first@\endcsname{#2}
+ \expandafter\xdef\csname fg@color\first@\endcsname{#3}
+ \expandafter\xdef\csname funcm@tch\first@\endcsname{#4}
+ \expandafter\def\csname func@style\first@\endcsname{\csname text#5\endcsname}
+ \fi}
+\def\shadingcolors#1{%
+ \gapcolors{Black}{White}
+ \nomatchresidues{Black}{White}{upper}{up}
+ \xdef\first@{#1} \xdef\second@{blues}
+ \ifx\first@\second@
+ \similarresidues{Black}{Magenta}{upper}{up}
+ \conservedresidues{White}{RoyalBlue}{upper}{up}
+ \allmatchresidues{Goldenrod}{RoyalPurple}{upper}{up}
+ \else \xdef\second@{greens}
+ \ifx\first@\second@
+ \similarresidues{Black}{GreenYellow}{upper}{up}
+ \conservedresidues{White}{PineGreen}{upper}{up}
+ \allmatchresidues{YellowOrange}{OliveGreen}{upper}{up}
+ \else \xdef\second@{reds}
+ \ifx\first@\second@
+ \similarresidues{Black}{YellowOrange}{upper}{up}
+ \conservedresidues{White}{BrickRed}{upper}{up}
+ \allmatchresidues{YellowGreen}{Mahagony}{upper}{up}
+ \else \xdef\second@{black}
+ \ifx\first@\second@
+ \similarresidues{Black}{White}{upper}{sl}
+ \conservedresidues{White}{Black}{upper}{up}
+ \allmatchresidues{White}{Black}{upper}{sl}
+ \else \xdef\second@{grays}
+ \ifx\first@\second@
+ \else \message{<Undefined color set. Using `grays'>} \xdef\first@{grays}\fi
+ \ifx\first@\second@
+ \similarresidues{Black}{LightGray}{upper}{up}
+ \conservedresidues{White}{DarkGray}{upper}{up}
+ \allmatchresidues{White}{Black}{upper}{up}
+ \fi\fi\fi\fi\fi}
+\def\nomatchresidues#1#2#3#4 {\xdef\first@{#1&}\xdef\second@{#2&}\xdef\third@{#3&}
+ \xdef\last@{\ampers@nd}
+ \ifx\first@\last@\else\def\TextNomatch{#1}
+ \expandafter\def\csname fg@textcolor0\endcsname{#1}
+ \fi
+ \ifx\second@\last@\else\gdef\Nomatch{#2}
+ \expandafter\def\csname fg@color0\endcsname{#2}
+ \fi
+ \ifx\third@\last@\else\def\resn@m@tch{#3}
+ \fi
+ \xdef\first@{#4&}
+ \ifx\first@\last@\else
+ \def\no@style{\csname text#4\endcsname}
+ \expandafter\def\csname func@style0\endcsname%
+ {\csname text#4\endcsname}\fi}
+\def\similarresidues#1#2#3#4 {\xdef\first@{#1&}\xdef\second@{#2&}\xdef\third@{#3&}
+ \xdef\last@{\ampers@nd}
+ \ifx\first@\last@\else\def\TextSimilar{#1}\fi
+ \ifx\second@\last@\else\gdef\Similar{#2}\fi
+ \ifx\third@\last@\else\def\ressimm@tch{#3}\fi
+ \xdef\first@{#4&}
+ \ifx\first@\last@\else
+ \def\sim@style{\csname text#4\endcsname}\fi}
+\def\conservedresidues#1#2#3#4{\xdef\first@{#1&}\xdef\second@{#2&}\xdef\third@{#3&}
+ \xdef\last@{\ampers@nd}
+ \ifx\first@\last@\else\def\TextIdentical{#1}\fi
+ \ifx\second@\last@\else\gdef\Identical{#2}\fi
+ \ifx\third@\last@\else\def\resm@tch{#3}\fi
+ \xdef\first@{#4&}
+ \ifx\first@\last@\else
+ \def\id@style{\csname text#4\endcsname}\fi}
+\def\allmatchresidues#1#2#3#4 {\xdef\first@{#1&}\xdef\second@{#2&}\xdef\third@{#3&}
+ \xdef\last@{\ampers@nd}
+ \ifx\first@\last@\else\def\TextAllmatch{#1}\fi
+ \ifx\second@\last@\else\gdef\Allmatch{#2}\fi
+ \ifx\third@\last@\else\def\res@llm@tch{#3}\fi
+ \xdef\first@{#4&}
+ \ifx\first@\last@\else
+ \def\all@style{\csname text#4\endcsname}\fi}
+\def\gapcolors#1#2 {\xdef\first@{#1&}\xdef\second@{#2&}
+ \xdef\last@{\ampers@nd}
+ \ifx\first@\last@\else\def\gap@fg{#1}
+ \expandafter\def\csname fg@textcolor*\endcsname{#1}\fi
+ \ifx\second@\last@\else\def\gap@bg{#2}
+ \expandafter\def\csname fg@color*\endcsname{#2}\fi}
+\def\shadebox#1{%
+ \xdef\first@{White}%
+ \xdef\third@{#1}%
+ \xdef\second@{nomatch}%
+ \ifx\second@\third@
+ \ifx\Nomatch\first@\white@box\else\textcolor{\Nomatch}{\box@rule}\fi%
+ \else
+ \xdef\second@{similar}%
+ \ifx\second@\third@
+ \ifx\Similar\first@\white@box\else\textcolor{\Similar}{\box@rule}\fi%
+ \else
+ \xdef\second@{conserved}%
+ \ifx\second@\third@
+ \ifx\Identical\first@\white@box\else\textcolor{\Identical}{\box@rule}\fi%
+ \else
+ \xdef\second@{allmatch}%
+ \ifx\second@\third@
+ \ifx\Allmatch\first@\white@box\else\textcolor{\Allmatch}{\box@rule}\fi%
+ \else
+ \ifx\third@\first@\white@box\else\textcolor{\third@}{\box@rule}\fi
+ \fi\fi\fi\fi}
+\def\namescolor#1{\xdef\names@fg{#1}}
+\def\namecolor#1#2{%
+ \xdef\first@{consensus} \xdef\second@{#1}
+ \ifx\first@\second@
+ \expandafter\xdef\csname name@col0\endcsname{#2}
+ \else
+ \xdef\first@{#1,&,@} \xdef\third@{#2} \namecolor@
+ \fi
+}
+\def\numberingcolor#1{\xdef\numbering@fg{#1}}
+\def\numbercolor#1#2{%
+ \xdef\first@{consensus} \xdef\second@{#1}
+ \ifx\first@\second@
+ \expandafter\xdef\csname number@col0\endcsname{#2}
+ \else
+ \xdef\first@{#1,&,@} \xdef\third@{#2} \numbercolor@
+ \fi
+}
+\def\legendcolor#1{\xdef\legend@fg{#1}}
+\def\rulercolor#1{\xdef\ruler@fg{#1}}
+\def\molweight#1#2{%
+ \xdef\temp@{Da}%
+ \xdef\second@{#2}%
+ \ifx\second@\temp@\xdef\third@{Da}\else\xdef\third@{kDa}\fi%
+ \xdef\first@{#1 @} \expandafter\check@letter\first@
+ \xdef\first@{#1} \ifletter \get@name@number \fi
+ \xdef\first@{\csname @rd\first@\endcsname}%
+ \loopcount=\csname mol@weight\first@\endcsname%
+ \divide\loopcount by 10\relax%
+ \innerloopcount=\loopcount%
+ \hbox{%
+ \ifnum\loopcount>1000%
+ \divide\loopcount by 1000\relax%
+ \pos@count=\loopcount%
+ \multiply\loopcount by 1000\relax%
+ \advance\innerloopcount by -\loopcount%
+ \loopcount=\innerloopcount%
+ \ifnum\loopcount>949\advance\pos@count by 1\relax\fi%
+ \the\pos@count%
+ \ifx\temp@\second@\ifgerm@n .\else {,}\fi\fi%
+ \else%
+ \ifx\second@\temp@ \else 0\fi%
+ \fi%
+ \ifx\second@\temp@%
+ \the\loopcount%
+ \loopcount=\csname mol@weight\first@\endcsname%
+ \innerloopcount=\loopcount%
+ \divide\loopcount by 10\relax%
+ \multiply\loopcount by 10\relax%
+ \advance\innerloopcount by -\loopcount\relax%
+ \else%
+ \divide\innerloopcount by 10\relax%
+ \advance\innerloopcount by 5\relax%
+ \divide\innerloopcount by 10\relax%
+ \fi%
+ \ifnum\innerloopcount>9\relax\innerloopcount=0\relax\fi%
+ \ifgerm@n {,}\else .\fi%
+ \the\innerloopcount~\third@}}
+\newcommand\charge[2][o]{%
+ \xdef\temp@{pep}%
+ \ifx\prefix@\temp@%
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \xdef\second@{\csname @rd\first@\endcsname}%
+ \loopcount=\csname ch@rge\second@\endcsname%
+ \xdef\first@{#1}\make@lower%
+ \if\first@ i\fi%
+ \if\first@ o\advance\loopcount by \chargeNterm%
+ \advance\loopcount by \chargeCterm\fi%
+ \if\first@ n\advance\loopcount by \chargeNterm\fi%
+ \if\first@ c\advance\loopcount by \chargeCterm\fi%
+ \hbox{\ensuremath{%
+ \ifnum\loopcount>0 +%
+ \else\ifnum\loopcount=0 \pm%
+ \else -\multiply\loopcount by -1\relax%
+ \fi\fi%
+ \innerloopcount=\loopcount%
+ \divide\loopcount by 1000\relax%
+ \the\loopcount%
+ \multiply\loopcount by 1000\relax%
+ \advance\innerloopcount by -\loopcount\relax%
+ \divide\innerloopcount by 10\relax%
+ \ifnum\innerloopcount=0%
+ \else%
+ \ifgerm@n {,}\else .\fi%
+ \ifnum\innerloopcount<10 0\fi%
+ \the\innerloopcount%
+ \fi}}%
+ \fi}
+\def\TeXshade{%
+ \setbox1=\hbox{\texttt{H}}%
+ \def\logo@rule{\vrule depth0.25\ht1 height1.25\ht1 width\wd1}%
+ \TeX%
+ \logo@rule\kern-\wd1\textcolor{White}{\texttt{s}}%
+ \logo@rule\kern-\wd1\textcolor{White}{\texttt{h}}%
+ \texttt{a}%
+ \logo@rule\kern-\wd1\textcolor{White}{\texttt{d}}%
+ \texttt{e}}
+
+\def\firstcolumnDSSP{\xdef\fc@DSSP{y}}
+\def\secondcolumnDSSP{\xdef\fc@DSSP{n}}
+
+\newcommand{\includeDSSP}[3][existing]{%
+ \temp@count=\dssp@num
+ \advance\temp@count by 1
+ \xdef\dssp@num{\the\temp@count}
+ \xdef\first@{#1} \xdef\temp@{existing}
+ \ifx\first@\temp@ \else\xdef\first@{make new}\fi
+ \expandafter\xdef\csname optiondssp\the\temp@count\endcsname{\first@}
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname doseqdssp\the\temp@count\endcsname{\first@}
+ \expandafter\xdef\csname filenamedssp\the\temp@count\endcsname{#3}
+ \expandafter\ifnum\csname doseqdssp\the\temp@count\endcsname>\seq@count
+ \message{<Ignoring `#2' in \noexpand\includeDSSP>}
+ \advance\temp@count by -1
+ \xdef\dssp@num{\the\temp@count}
+ \fi
+}
+
+\newcommand{\includeHMMTOP}[3][existing]{%
+ \temp@count=\HMMTOP@num
+ \advance\temp@count by 1
+ \xdef\HMMTOP@num{\the\temp@count}
+ \xdef\first@{#1} \xdef\temp@{existing}
+ \ifx\first@\temp@ \else\xdef\first@{make new}\fi
+ \expandafter\xdef\csname optionHMMTOP\the\temp@count\endcsname{\first@}
+ \xdef\first@{#2[,]&}\expandafter\opt@color\first@
+ \ifx\f@color\comm@
+ \expandafter\xdef\csname fileseqHMMTOP\the\temp@count\endcsname{0}
+ \else
+ \expandafter\xdef\csname fileseqHMMTOP\the\temp@count\endcsname{\f@color}
+ \fi
+ \xdef\first@{\fourth@ @} \expandafter\check@letter\first@
+ \xdef\first@{\fourth@} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname doseqHMMTOP\the\temp@count\endcsname{\first@}
+ \expandafter\xdef\csname filenameHMMTOP\the\temp@count\endcsname{#3}
+ \expandafter\ifnum\csname doseqHMMTOP\the\temp@count\endcsname>\seq@count
+ \message{<Ignoring `#2' in \noexpand\includeHMMTOP>}
+ \advance\temp@count by -1
+ \xdef\HMMTOP@num{\the\temp@count}
+ \fi
+}
+
+\newcommand{\includeSTRIDE}[3][existing]{%
+ \temp@count=\stride@num
+ \advance\temp@count by 1
+ \xdef\stride@num{\the\temp@count}
+ \xdef\first@{#1} \xdef\temp@{existing}
+ \ifx\first@\temp@ \else\xdef\first@{make new}\fi
+ \expandafter\xdef\csname optionstride\the\temp@count\endcsname{\first@}
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname doseqstride\the\temp@count\endcsname{\first@}
+ \expandafter\xdef\csname filenamestride\the\temp@count\endcsname{#3}
+ \expandafter\ifnum\csname doseqstride\the\temp@count\endcsname>\seq@count
+ \message{<Ignoring `#2' in \noexpand\includeSTRIDE>}
+ \advance\temp@count by -1
+ \xdef\stride@num{\the\temp@count}
+ \fi
+}
+\newcommand{\includePHDsec}[3][existing]{%
+ \temp@count=\PHD@num
+ \advance\temp@count by 1
+ \xdef\PHD@num{\the\temp@count}
+ \xdef\first@{#1} \xdef\temp@{existing}
+ \ifx\first@\temp@ \else\xdef\first@{make new}\fi
+ \expandafter\xdef\csname optionphd\the\temp@count\endcsname{\first@}
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname doseqphd\the\temp@count\endcsname{\first@}
+ \expandafter\xdef\csname modephd\the\temp@count\endcsname{structure}
+ \expandafter\xdef\csname filenamephd\the\temp@count\endcsname{#3}
+ \expandafter\ifnum\csname doseqphd\the\temp@count\endcsname>\seq@count
+ \message{<Ignoring `#2' in \noexpand\includePHDsec>}
+ \advance\temp@count by -1
+ \xdef\PHD@num{\the\temp@count}
+ \fi
+}
+\newcommand{\includePHDtopo}[3][existing]{%
+ \temp@count=\PHD@num
+ \advance\temp@count by 1
+ \xdef\PHD@num{\the\temp@count}
+ \xdef\first@{#1} \xdef\temp@{existing}
+ \ifx\first@\temp@ \else\xdef\first@{make new}\fi
+ \expandafter\xdef\csname optionphd\the\temp@count\endcsname{\first@}
+ \xdef\first@{#2 @} \expandafter\check@letter\first@
+ \xdef\first@{#2} \ifletter \get@name@number \fi
+ \expandafter\xdef\csname doseqphd\the\temp@count\endcsname{\first@}
+ \expandafter\xdef\csname modephd\the\temp@count\endcsname{topology}
+ \expandafter\xdef\csname filenamephd\the\temp@count\endcsname{#3}
+ \expandafter\ifnum\csname doseqphd\the\temp@count\endcsname>\seq@count
+ \message{<Ignoring `#2' in \noexpand\includePHDtopo>}
+ \advance\temp@count by -1
+ \xdef\PHD@num{\the\temp@count}
+ \fi
+}
+\def\appearance#1#2#3#4#5{%
+ \xdef\first@{#1} \xdef\second@{#2}
+ \xdef\temp@{PHDsec}
+ \ifx\temp@\first@
+ \xdef\temp@{alpha}
+ \ifx\second@\temp@
+ \def\bottop@Hsec{#3}
+ \def\label@Hsec{#4}
+ \def\text@Hsec{#5}
+ \else
+ \xdef\temp@{beta}
+ \ifx\second@\temp@
+ \def\bottop@Esec{#3}
+ \def\label@Esec{#4}
+ \def\text@Esec{#5}
+ \fi\fi
+ \else
+ \xdef\temp@{PHDtopo}
+ \ifx\temp@\first@
+ \xdef\temp@{internal}
+ \ifx\second@\temp@
+ \def\bottop@itop{#3}
+ \def\label@itop{#4}
+ \def\text@itop{#5}
+ \else
+ \xdef\temp@{external}
+ \ifx\second@\temp@
+ \def\bottop@etop{#3}
+ \def\label@etop{#4}
+ \def\text@etop{#5}
+ \else
+ \xdef\temp@{TM}
+ \ifx\second@\temp@
+ \def\bottop@TMtop{#3}
+ \def\label@TMtop{#4}
+ \def\text@TMtop{#5}
+ \fi\fi\fi
+ \else
+ \xdef\temp@{STRIDE}
+ \ifx\temp@\first@
+ \xdef\temp@{alpha}
+ \ifx\second@\temp@
+ \def\bottop@Hstride{#3}
+ \def\label@Hstride{#4}
+ \def\text@Hstride{#5}
+ \else
+ \xdef\temp@{3-10}
+ \ifx\second@\temp@
+ \def\bottop@Gstride{#3}
+ \def\label@Gstride{#4}
+ \def\text@Gstride{#5}
+ \else
+ \xdef\temp@{pi}
+ \ifx\second@\temp@
+ \def\bottop@Istride{#3}
+ \def\label@Istride{#4}
+ \def\text@Istride{#5}
+ \else
+ \xdef\temp@{beta}
+ \ifx\second@\temp@
+ \def\bottop@Estride{#3}
+ \def\label@Estride{#4}
+ \def\text@Estride{#5}
+ \else
+ \xdef\temp@{bridge}
+ \ifx\second@\temp@
+ \def\bottop@Bstride{#3}
+ \def\label@Bstride{#4}
+ \def\text@Bstride{#5}
+ \else
+ \xdef\temp@{turn}
+ \ifx\second@\temp@
+ \def\bottop@Tstride{#3}
+ \def\label@Tstride{#4}
+ \def\text@Tstride{#5}
+ \fi\fi\fi\fi\fi\fi
+ \else
+ \xdef\temp@{DSSP}
+ \ifx\temp@\first@
+ \xdef\temp@{alpha}
+ \ifx\second@\temp@
+ \def\bottop@Hdssp{#3}
+ \def\label@Hdssp{#4}
+ \def\text@Hdssp{#5}
+ \else
+ \xdef\temp@{3-10}
+ \ifx\second@\temp@
+ \def\bottop@Gdssp{#3}
+ \def\label@Gdssp{#4}
+ \def\text@Gdssp{#5}
+ \else
+ \xdef\temp@{pi}
+ \ifx\second@\temp@
+ \def\bottop@Idssp{#3}
+ \def\label@Idssp{#4}
+ \def\text@Idssp{#5}
+ \else
+ \xdef\temp@{beta}
+ \ifx\second@\temp@
+ \def\bottop@Edssp{#3}
+ \def\label@Edssp{#4}
+ \def\text@Edssp{#5}
+ \else
+ \xdef\temp@{bridge}
+ \ifx\second@\temp@
+ \def\bottop@Bdssp{#3}
+ \def\label@Bdssp{#4}
+ \def\text@Bdssp{#5}
+ \else
+ \xdef\temp@{turn}
+ \ifx\second@\temp@
+ \def\bottop@Tdssp{#3}
+ \def\label@Tdssp{#4}
+ \def\text@Tdssp{#5}
+ \else
+ \xdef\temp@{bend}
+ \ifx\second@\temp@
+ \def\bottop@Sdssp{#3}
+ \def\label@Sdssp{#4}
+ \def\text@Sdssp{#5}
+ \fi\fi\fi\fi\fi\fi\fi
+ \else
+ \xdef\temp@{HMMTOP}
+ \ifx\temp@\first@
+ \xdef\temp@{internal}
+ \ifx\second@\temp@
+ \def\bottop@i@HMMTOP{#3}
+ \def\label@i@HMMTOP{#4}
+ \def\text@i@HMMTOP{#5}
+ \else
+ \xdef\temp@{external}
+ \ifx\second@\temp@
+ \def\bottop@e@HMMTOP{#3}
+ \def\label@e@HMMTOP{#4}
+ \def\text@e@HMMTOP{#5}
+ \else
+ \xdef\temp@{TM}
+ \ifx\second@\temp@
+ \def\bottop@TM@HMMTOP{#3}
+ \def\label@TM@HMMTOP{#4}
+ \def\text@TM@HMMTOP{#5}
+ \fi\fi\fi
+ \fi\fi\fi\fi\fi
+}
+
+\def\showonDSSP#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{yes} \show@DSSP}
+\def\hideonDSSP#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{no} \show@DSSP}
+
+\def\showonSTRIDE#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{yes} \show@STRIDE}
+\def\hideonSTRIDE#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{no} \show@STRIDE}
+
+\def\showonPHDtopo#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{yes} \show@PHDtopo}
+\def\hideonPHDtopo#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{no} \show@PHDtopo}
+
+\def\showonPHDsec#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{yes} \show@PHDsec}
+\def\hideonPHDsec#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{no} \show@PHDsec}
+
+\def\showonHMMTOP#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{yes} \show@HMMTOP}
+\def\hideonHMMTOP#1{%
+ \xdef\first@{#1,&,@} \xdef\second@{no} \show@HMMTOP}
+
+\def\codon#1#2{%
+ \xdef\first@{#1}
+ \xdef\second@{#2,&,@}
+ \expandafter\get@triplet\second@}
+\def\geneticcode#1{%
+ \xdef\first@{#1}
+ \xdef\temp@{standard}
+ \ifx\first@\temp@
+ \c@d@ns
+ \else
+ \input{#1.cod}
+ \fi}
+\newcommand{\backtranslabel}[2][tiny]{%
+ \def\trans@size{\csname #1\endcsname}
+ \xdef\first@{#2}
+ \xdef\temp@{horizontal}
+ \ifx\temp@\first@ \xdef\tr@nsstyle{0}\fi
+ \xdef\temp@{zigzag}
+ \ifx\temp@\first@ \xdef\tr@nsstyle{1}\fi
+ \xdef\temp@{alternating}
+ \ifx\temp@\first@ \xdef\tr@nsstyle{2}\fi
+ \xdef\temp@{oblique}
+ \ifx\temp@\first@ \xdef\tr@nsstyle{3}\fi
+ \xdef\temp@{vertical}
+ \ifx\temp@\first@ \xdef\tr@nsstyle{4}\fi
+}
+\newcommand{\backtranstext}[2][tiny]{%
+ \def\transtext@size{\csname #1\endcsname}
+ \xdef\first@{#2}
+ \xdef\temp@{horizontal}
+ \ifx\temp@\first@ \xdef\tr@nstextstyle{0}\fi
+ \xdef\temp@{zigzag}
+ \ifx\temp@\first@ \xdef\tr@nstextstyle{1}\fi
+ \xdef\temp@{alternating}
+ \ifx\temp@\first@ \xdef\tr@nstextstyle{2}\fi
+ \xdef\temp@{oblique}
+ \ifx\temp@\first@ \xdef\tr@nstextstyle{3}\fi
+ \xdef\temp@{vertical}
+ \ifx\temp@\first@ \xdef\tr@nstextstyle{4}\fi
+}
+
+%%%%% Calculate consensus
+
+\def\check@sim{%
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \xdef\first@{\csname \prefix@ grp\first@\endcsname}
+ \newrestrue
+ \ifnum\first@<0 \newresfalse
+ \else
+ \innerloopcount=\loopcount
+ \ifnum\loopcount=\cons@num \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count
+ \loop
+ \advance\innerloopcount by 1
+ \xdef\second@{\csname res\the\innerloopcount\endcsname}
+ \expandafter\ifx\csname \prefix@ grp\second@\endcsname\first@
+ \newresfalse \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+ \fi
+ \fi
+
+ \ifnewres
+ \expandafter\csname pos\the\loopcount\endcsname=0
+ \innerloopcount=0
+ \loop
+ \advance\innerloopcount by 1
+ \xdef\second@{\csname res\the\innerloopcount\endcsname}
+ \expandafter\ifx\csname \prefix@ grp\second@\endcsname\first@
+ \expandafter\advance\csname pos\the\loopcount\endcsname by 1 \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+
+ \expandafter\multiply\csname pos\the\loopcount\endcsname by \seq@percent
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname<\thresh@ld
+ \else
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname>\m@x
+ \xdef\m@x{\the\csname pos\the\loopcount\endcsname}
+ \xdef\cons@seq{\the\loopcount} \xdef\match@case{\c@se}
+ \xdef\simgroup@{\first@}
+ \else
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname=\m@x
+ \xdef\match@case{0}
+ \fi
+ \fi
+ \fi
+ \fi
+
+ \ifnum\loopcount=\cons@num \loopcount=1 \fi
+ \advance\loopcount by -1
+ \ifnum\loopcount>0 \check@sim \fi}
+
+\def\check@ident{%
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \newrestrue \expandafter\check@char\first@
+ \ifletter
+ \innerloopcount=\loopcount
+ \ifnum\loopcount=\cons@num \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\ifx\csname res\the\innerloopcount\endcsname\first@
+ \newresfalse \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+ \fi
+ \else
+ \newresfalse
+ \expandafter\xdef\csname res\the\loopcount\endcsname{\d@t}
+ \fi
+
+ \ifnewres
+ \expandafter\csname pos\the\loopcount\endcsname=0
+ \innerloopcount=0
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\ifx\csname res\the\innerloopcount\endcsname\first@
+ \expandafter\advance\csname pos\the\loopcount\endcsname by 1 \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname=\seq@count
+ \xdef\cons@seq{\the\loopcount} \xdef\match@case{2} \loopcount=1
+ \else
+ \expandafter\multiply\csname pos\the\loopcount\endcsname by \seq@percent
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname<\thresh@ld
+ \else
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname>\m@x
+ \xdef\m@x{\the\csname pos\the\loopcount\endcsname}
+ \xdef\cons@seq{\the\loopcount} \xdef\match@case{1}
+ \else
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname=\m@x
+ \xdef\match@case{0}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+
+ \ifnum\loopcount=\cons@num \loopcount=1 \fi
+ \advance\loopcount by -1
+ \ifnum\loopcount>0 \check@ident \fi}
+
+\def\get@simchar{%
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \newrestrue \expandafter\check@char\first@
+ \ifletter
+ \innerloopcount=\loopcount
+ \ifnum\loopcount=\cons@num \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\ifx\csname res\the\innerloopcount\endcsname\first@
+ \newresfalse \innerloopcount=\seq@count \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+ \fi
+ \else
+ \newresfalse
+ \fi
+
+ \ifnewres
+ \expandafter\csname pos\the\loopcount\endcsname=0
+ \innerloopcount=0
+ \loop
+ \advance\innerloopcount by 1
+ \expandafter\ifx\csname res\the\innerloopcount\endcsname\first@
+ \xdef\second@{\csname res\the\innerloopcount\endcsname}
+ \expandafter\ifx\csname \prefix@ grp\second@\endcsname\simgroup@
+ \expandafter\advance\csname pos\the\loopcount\endcsname by 1 \fi
+ \fi
+ \ifnum\innerloopcount<\seq@count \repeat
+
+ \expandafter\ifnum\csname pos\the\loopcount\endcsname>\m@x
+ \xdef\m@x{\the\csname pos\the\loopcount\endcsname}
+ \xdef\cons@seq{\the\loopcount}
+ \fi
+ \fi
+
+ \ifnum\loopcount=\cons@num \loopcount=1 \fi
+ \advance\loopcount by -1
+ \ifnum\loopcount>0 \get@simchar \fi}
+
+\def\unc@nserved{%
+ \ifsimmode
+ \ifnum\cons@num>0 \loopcount=\cons@num \else \loopcount=\seq@count \fi
+ \xdef\match@case{0} \xdef\m@x{1} \check@sim
+ \ifnum\match@case=0
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\first@
+ \expandafter\ifx\csname res\the\loopcount\endcsname\d@t
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname3\gap@char}
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 3\csname res\the\loopcount\endcsname}
+ \fi
+ \else
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\third@{7}\def\first@{\gap@char}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \else
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname3\first@}
+ \fi
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\low@up{lower} \ifx\n@m@tch\low@up \xdef\first@{{ }} \else
+ \xdef\low@up{upper} \ifx\n@m@tch\low@up \xdef\first@{{ }}
+ \else \xdef\first@{\n@m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq0\endcsname\y@
+ \expandafter\xdef\csname tint@seq0\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq0\endcsname\y@
+ \expandafter\xdef\csname emph@seq0\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \xdef\consensus{\consensus 4\first@}
+ \expandafter\ifx\csname res\cons@num\endcsname\d@t
+ \else\xdef\constopo{\constopo 0}\fi
+ \else
+ \ifnum\cons@num>0
+ \xdef\tmp@{\csname res\cons@num\endcsname}
+ \else
+ \xdef\m@x{0} \loopcount=\seq@count \get@simchar
+ \xdef\tmp@{\csname res\cons@seq\endcsname}
+ \fi
+ \xdef\second@{\csname \prefix@ grp\tmp@\endcsname}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\first@
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t\def\first@{\gap@char}\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 3\first@}
+ \else
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \xdef\last@{\csname res\the\loopcount\endcsname}
+ \expandafter\ifnum\csname \prefix@ grp\last@\endcsname=\second@
+ \xdef\third@{2}
+ \xdef\low@up{lower} \ifx\ressimm@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\ressimm@tch\low@up
+ \else \xdef\first@{\ressimm@tch} \fi\fi
+ \else
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\third@{7}\def\first@{\gap@char}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \fi
+ \fi
+ \else
+ \xdef\third@{3}
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\first@{\tmp@}
+ \xdef\low@up{lower} \ifx\m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\m@tch\low@up
+ \else \xdef\first@{\m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq0\endcsname\y@
+ \expandafter\xdef\csname tint@seq0\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq0\endcsname\y@
+ \expandafter\xdef\csname emph@seq0\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \xdef\consensus{\consensus5\first@}
+ \xdef\constopo{\constopo 1}
+ \fi
+ \else
+ \iffuncmode
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \def\first@{{}} \def\third@{/}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \def\first@{{}} \def\third@{/}
+ \fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \else
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname0\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \else
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\first@
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t\def\first@{\gap@char}\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 3\first@}
+ \else
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\third@{7}\def\first@{\gap@char}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \else
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname3\first@}
+ \fi
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\low@up{lower} \ifx\n@m@tch\low@up \xdef\first@{{ }} \else
+ \xdef\low@up{upper} \ifx\n@m@tch\low@up \xdef\first@{{ }}
+ \else \xdef\first@{\n@m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq0\endcsname\y@
+ \expandafter\xdef\csname tint@seq0\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq0\endcsname\y@
+ \expandafter\xdef\csname emph@seq0\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \xdef\consensus{\consensus 4\first@}
+ \xdef\constopo{\constopo 0}
+ \fi\fi}
+
+\def\c@nserved{%
+ \xdef\tmp@{\csname res\cons@seq\endcsname}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\first@
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t\def\first@{\gap@char}\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 3\first@}
+ \else
+ \xdef\second@{\csname res\the\loopcount\endcsname}
+ \ifx\tmp@\second@
+ \xdef\third@{1}
+ \else
+ \xdef\third@{3}
+ \ifsimmode
+ \xdef\last@{\csname \prefix@ sim\tmp@\endcsname &@}
+ \expandafter\get@count\last@
+ \innerloopcount=0 \getsim@char
+ \fi
+ \fi
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifcase\third@ \or
+ \xdef\low@up{lower} \ifx\resm@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resm@tch\low@up
+ \else \xdef\first@{\resm@tch} \fi\fi
+ \or
+ \xdef\low@up{lower} \ifx\ressimm@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\ressimm@tch\low@up
+ \else \xdef\first@{\ressimm@tch} \fi\fi
+ \else
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \fi
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\third@{7}\def\first@{\gap@char}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{7}
+ \else
+ \def\first@{{}} \def\third@{8}
+ \fi
+ \fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\first@{\csname res\cons@seq\endcsname}
+ \xdef\second@{lower} \ifx\m@tch\second@ \make@lower \else
+ \xdef\second@{upper} \ifx\m@tch\second@
+ \else \xdef\first@{\m@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq0\endcsname\y@
+ \expandafter\xdef\csname tint@seq0\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq0\endcsname\y@
+ \expandafter\xdef\csname emph@seq0\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \xdef\consensus{\consensus 5\first@}
+ \xdef\constopo{\constopo 2}}
+
+\def\allm@tch{%
+ \ifall@shade \xdef\third@{0} \else \xdef\third@{1} \fi
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\first@
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 3\first@}
+ \else
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \xdef\low@up{lower} \ifx\res@llm@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\res@llm@tch\low@up
+ \else \xdef\first@{\res@llm@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\first@{\csname res\cons@seq\endcsname}
+ \xdef\second@{lower} \ifx\@llm@tch\second@ \make@lower \else
+ \xdef\second@{upper} \ifx\@llm@tch\second@
+ \else \xdef\first@{\@llm@tch} \fi\fi
+ \expandafter\ifx\csname tint@seq0\endcsname\y@
+ \expandafter\xdef\csname tint@seq0\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq0\endcsname\y@
+ \expandafter\xdef\csname emph@seq0\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \xdef\consensus{\consensus 6\first@}
+ \xdef\constopo{\constopo 3}}
+
+\def\functi@nal{%
+ \ifnum\cons@num>0
+ \xdef\first@{\csname res\cons@num\endcsname}
+ \else
+ \xdef\first@{\csname res\cons@seq\endcsname}
+ \fi
+ \xdef\second@{\csname funcgrp\first@\endcsname}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\third@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\third@
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 0\first@}
+ \else
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \def\first@{{}} \def\third@{/}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\third@{*}
+ \else
+ \def\first@{{}} \def\third@{/}
+ \fi
+ \fi
+ \fi
+ \else
+ \expandafter\ifnum\csname funcgrp\first@\endcsname=\second@
+ \xdef\low@up{lower}
+ \expandafter\ifx\csname funcm@tch\second@\endcsname\low@up
+ \make@lower \fi
+ \xdef\third@{\second@}
+ \else \xdef\third@{0}
+ \xdef\low@up{lower} \ifx\resn@m@tch\low@up \make@lower \else
+ \xdef\low@up{upper} \ifx\resn@m@tch\low@up
+ \else \xdef\first@{\resn@m@tch} \fi\fi
+ \fi
+ \fi
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname\third@\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat}
+
+\def\all@funcshade{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \xdef\second@{\csname funcgrp\first@\endcsname}
+ \ifnum\second@<0 \xdef\second@{0} \fi
+ \ifx\first@\d@t
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@start\the\loopcount\endcsname
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\second@{*}
+ \else
+ \def\first@{{}} \def\second@{/}
+ \fi
+ \else
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname%
+ <\csname seq@len\the\loopcount\endcsname
+ \def\first@{\gap@char}\def\second@{*}
+ \else
+ \ifsh@wg@ps
+ \def\first@{\gap@char}\def\second@{*}
+ \else
+ \def\first@{{}} \def\second@{/}
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\low@up{lower}
+ \expandafter\ifx\csname funcm@tch\second@\endcsname\low@up
+ \make@lower \fi
+ \xdef\third@{noshade}
+ \expandafter\ifx\csname hide@seq\the\loopcount\endcsname\third@
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ 0\first@}
+ \else
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \xdef\first@{=\first@}\fi
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \xdef\first@{,\first@}\fi
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ \second@\first@}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat}
+
+\def\getregion@fromstack@first{%
+ \expandafter\getregion@fromstack{\the\loopcount}
+ \expandafter\ifx\csname start\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname stop\the\loopcount\endcsname<\first@@
+ \getregion@fromstack@first
+ \else
+ \expandafter\ifx\csname all\the\loopcount\endcsname\y@
+ \innerloopcount=\csname style\the\loopcount\endcsname
+ \fi
+ \expandafter\xdef\csname shade@style\the\loopcount\endcsname{%
+ \csname style\the\loopcount\endcsname}
+ \fi
+ \fi
+}
+
+\def\calc@regshade{%
+ \loopcount=-1 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname shade@style\the\loopcount\endcsname{y}
+ \ifnum\loopcount=0 \xdef\first@@{\the\cons@count}
+ \else \xdef\first@@{\the\csname res@count\the\loopcount\endcsname} \fi
+ \expandafter\ifx\csname start\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\the\loopcount\endcsname>\first@@
+ \else
+ \expandafter\ifnum\csname stop\the\loopcount\endcsname<\first@@
+ \getregion@fromstack@first
+ \else
+ \expandafter\ifx\csname all\the\loopcount\endcsname\y@
+ \innerloopcount=\csname style\the\loopcount\endcsname
+ \fi
+ \expandafter\xdef\csname shade@style\the\loopcount\endcsname{%
+ \csname style\the\loopcount\endcsname}
+ \expandafter\ifnum\csname stop\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromstack{\the\loopcount}
+ \fi
+ \fi
+ \fi\fi
+ \ifnum\loopcount<\seq@count \repeat
+ \loopcount=0
+ \expandafter\ifx\csname shade@style\the\loopcount\endcsname\y@
+ \else
+ \xdef\consensus{\consensus&\csname shade@style\the\loopcount\endcsname)}
+ \fi
+ \loop
+ \advance\loopcount by 1
+ \expandafter\ifx\csname shade@style\the\loopcount\endcsname\y@
+ \ifnum\innerloopcount>0
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ &\the\innerloopcount)}
+ \fi
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ &\csname shade@style\the\loopcount\endcsname)}
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+}
+
+\def\getregion@fromemphstack@first{%
+ \expandafter\getregion@fromemphstack{\the\loopcount}
+ \expandafter\ifx\csname emphstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname emphstop\the\loopcount\endcsname<\first@@
+ \getregion@fromemphstack@first
+ \else
+ \expandafter\ifx\csname emphall\the\loopcount\endcsname\y@
+ \innerloopcount=1
+ \fi
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{y}
+ \fi
+ \fi
+}
+
+\def\calc@regemph{%
+ \loopcount=-1 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \xdef\first@@{\the\cons@count}
+ \else \xdef\first@@{\the\csname res@count\the\loopcount\endcsname} \fi
+ \expandafter\ifx\csname emphstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname emphstart\the\loopcount\endcsname>\first@@
+ \else
+ \expandafter\ifnum\csname emphstop\the\loopcount\endcsname<\first@@
+ \getregion@fromemphstack@first
+ \else
+ \expandafter\ifx\csname emphall\the\loopcount\endcsname\y@
+ \innerloopcount=1
+ \fi
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{y}
+ \expandafter\ifnum\csname emphstop\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromemphstack{\the\loopcount}
+ \fi
+ \fi
+ \fi\fi
+ \ifnum\loopcount<\seq@count \repeat
+ \loopcount=0
+ \expandafter\ifx\csname emph@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{y}
+ \fi
+ \ifnum\innerloopcount>0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{y}
+ \ifnum\loopcount<\seq@count \repeat
+ \fi
+}
+
+\def\getregion@fromtintstack@first{%
+ \expandafter\getregion@fromtintstack{\the\loopcount}
+ \expandafter\ifx\csname tintstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname tintstop\the\loopcount\endcsname<\first@@
+ \getregion@fromtintstack@first
+ \else
+ \expandafter\ifx\csname tintall\the\loopcount\endcsname\y@
+ \innerloopcount=1
+ \fi
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{y}
+ \fi
+ \fi
+}
+
+\def\calc@regtint{%
+ \loopcount=-1 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \xdef\first@@{\the\cons@count}
+ \else \xdef\first@@{\the\csname res@count\the\loopcount\endcsname} \fi
+ \expandafter\ifx\csname tintstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname tintstart\the\loopcount\endcsname>\first@@
+ \else
+ \expandafter\ifnum\csname tintstop\the\loopcount\endcsname<\first@@
+ \getregion@fromtintstack@first
+ \else
+ \expandafter\ifx\csname tintall\the\loopcount\endcsname\y@
+ \innerloopcount=1
+ \fi
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{y}
+ \expandafter\ifnum\csname tintstop\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromtintstack{\the\loopcount}
+ \fi
+ \fi
+ \fi\fi
+ \ifnum\loopcount<\seq@count \repeat
+ \loopcount=0
+ \expandafter\ifx\csname tint@seq\the\loopcount\endcsname\y@
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{y}
+ \fi
+ \ifnum\innerloopcount>0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{y}
+ \ifnum\loopcount<\seq@count \repeat
+ \fi
+}
+
+\def\getregion@fromframestack@first{%
+ \expandafter\getregion@fromframestack{\the\loopcount}
+ \expandafter\ifx\csname framestart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname framestop\the\loopcount\endcsname<\first@@
+ \getregion@fromframestack@first
+ \else
+ \ifnum\frame@on=0
+ \xdef\frame@on{1}
+ \xdef\frame@{1}
+ \expandafter\xdef\csname fr@style\the\loopcount\endcsname{%
+ \csname framestyle\the\loopcount\endcsname}
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;&;}
+ \xdef\frame@pos{\the\pos@count}
+ \fi
+ \expandafter\ifnum\csname framestop\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromframestack{\the\loopcount}
+ \ifnum\frame@on=1
+ \xdef\frame@on{0}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \ifnum\pos@count=\res@perline
+ \ifnum\frame@on=1
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=\end@num\relax
+ \ifnum\frame@on=1
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \fi
+ \fi
+}
+
+\def\calc@frame{%
+ \advance\pos@count by -1
+ \loopcount=-1 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \xdef\first@@{\the\cons@count}
+ \else \xdef\first@@{\the\csname res@count\the\loopcount\endcsname} \fi
+ \expandafter\ifx\csname framestart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname framestart\the\loopcount\endcsname>\first@@
+ \else
+ \expandafter\ifnum\csname framestop\the\loopcount\endcsname<\first@@
+ \getregion@fromframestack@first
+ \else
+ \ifnum\frame@on=0
+ \xdef\frame@on{1}
+ \xdef\frame@{1}
+ \expandafter\xdef\csname fr@style\the\loopcount\endcsname{%
+ \csname framestyle\the\loopcount\endcsname}
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;&;}
+ \xdef\frame@pos{\the\pos@count}
+ \fi
+ \expandafter\ifnum\csname framestop\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromframestack{\the\loopcount}
+ \ifnum\frame@on=1
+ \xdef\frame@on{0}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \ifnum\pos@count=\res@perline
+ \ifnum\frame@on=1
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=\end@num\relax
+ \ifnum\frame@on=1
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by 1
+ \advance\innerloopcount by -\frame@pos
+ \xdef\styleframe{\styleframe&\the\innerloopcount;%
+ \csname fr@style\the\loopcount\endcsname;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \xdef\frame@pos{\the\innerloopcount}
+ \fi
+ \fi
+ \fi
+ \fi\fi
+ \ifnum\loopcount<\seq@count \repeat
+ \advance\pos@count by 1
+}
+
+\def\get@nextres#1#2:{%
+ \xdef\first@{#1}
+ \xdef\temp@{#2:}
+ \ifnum`#1>96 \make@upper \fi
+ \ifx\first@\gap@char \expandafter\get@nextres\temp@
+ \else
+ \if\first@ @
+ \xdef\temp@{}
+ \else
+ \xdef\temp@{+\first@}
+ \expandafter\xdef\csname last@res\bottop@\endcsname{}
+ \fi
+ \fi}
+\def\get@@nextres#1#2:{%
+ \xdef\first@{#1}
+ \xdef\temp@@{#2:}
+ \ifnum`#1>96 \make@upper \fi
+ \ifx\first@\gap@char \expandafter\get@@nextres\temp@@
+ \else
+ \if\first@ @
+ \xdef\temp@@{}
+ \else
+ \xdef\temp@@{+\first@}
+ \expandafter\xdef\csname last@res\bottop@\endcsname{}
+ \fi
+ \fi}
+
+\def\char@get#1#2@{\xdef\first@{#1} \xdef\tr@nsl@ted{#2@}}
+\def\trans@now#1#2@{%
+ \xdef\first@{#1}
+ \xdef\tr@nsl@ted{#2@}
+ \ifx\first@\ampers@nd
+ \else
+ \expandafter\check@char\first@
+ \ifletter
+ \xdef\triplet@{\triplet@\first@}
+ \advance\triple@count by 1
+ \ifnum\triple@count=1
+ \xdef\out@{\out@{-}}
+ \fi
+ \ifnum\triple@count=3
+ \expandafter\ifx\csname @\triplet@\endcsname\relax
+ \expandafter\xdef\csname @\triplet@\endcsname{?} \fi
+ \xdef\out@{\out@\csname @\triplet@\endcsname\out@@{-}}
+ \triple@count=0
+ \xdef\triplet@{}
+ \xdef\out@@{}
+ \fi
+ \fi
+ \if\first@ -
+ \ifnum\triple@count<2
+ \xdef\out@{\out@{-}}
+ \else
+ \xdef\out@@{\out@@{-}}
+ \fi
+ \fi
+ \if\first@ +
+ \expandafter\char@get\tr@nsl@ted
+ \xdef\triplet@{\triplet@\first@}
+ \advance\triple@count by 1
+ \ifnum\triple@count=3
+ \expandafter\ifx\csname @\triplet@\endcsname\relax
+ \expandafter\xdef\csname @\triplet@\endcsname{?} \fi
+ \xdef\out@{\out@\csname @\triplet@\endcsname\out@@}
+ \triple@count=0
+ \xdef\triplet@{}
+ \xdef\out@@{}
+ \fi
+ \fi
+ \if\first@ 2
+ \loop
+ \expandafter\char@get\tr@nsl@ted
+ \ifx\first@\ampers@nd
+ \lettertrue
+ \xdef\tr@nsl@ted{&@}
+ \else
+ \expandafter\check@char\first@
+ \fi
+ \ifletter\else\xdef\out@{\out@{-}}\repeat
+ \xdef\out@{\out@{-}}
+ \fi
+ \expandafter\trans@now\tr@nsl@ted
+ \fi
+}
+
+\def\do@translation{%
+ \xdef\triplet@{}
+ \xdef\out@{}
+ \xdef\out@@{}
+ \xdef\tr@nsl@ted{\tr@nsl@ted &@}
+ \triple@count=0
+ \expandafter\trans@now\tr@nsl@ted
+ \xdef\tr@nsl@ted{\out@}
+}
+
+\def\trans@pep#1#2@{%
+ \xdef\first@{#1}
+ \xdef\tr@nsl@ted{#2@}
+ \ifx\first@\ampers@nd
+ \else
+ \expandafter\check@char\first@
+ \ifletter
+ \xdef\out@{\out@\csname rev@\first@\endcsname}
+ \else
+ \xdef\out@{\out@{-}{-}{-}}
+ \fi
+ \expandafter\trans@pep\tr@nsl@ted
+ \fi
+}
+
+\def\rev@translation{%
+ \xdef\out@{}
+ \xdef\tr@nsl@ted{\tr@nsl@ted &@}
+ \expandafter\trans@pep\tr@nsl@ted
+ \xdef\tr@nsl@ted{\out@}
+}
+
+\def\sum@up{%
+ \advance\innerloopcount by 1
+ \xdef\second@@@{\csname res\the\innerloopcount\endcsname}
+ \xdef\third@@@{\csname cons\first@@@\second@@@\endcsname}
+ \advance\temp@count by \third@@@
+ \ifnum\innerloopcount<\seq@count\sum@up\fi
+}
+
+\def\sum@up@cons{%
+ \innerloopcount=\outerloopcount
+ \xdef\first@@@{\csname res\the\outerloopcount\endcsname}
+ \sum@up
+ \advance\outerloopcount by 1\relax
+ \ifnum\outerloopcount<\seq@count
+ \sum@up@cons
+ \else
+ \innerloopcount=\seq@count
+ \advance\innerloopcount by -1
+ \multiply\innerloopcount by \seq@count
+ \multiply\temp@count by 2
+ \divide\temp@count by \innerloopcount
+ \xdef\cons@val{\the\temp@count}
+ \fi
+}
+
+\def\collect@cons@res{%
+ \xdef\temp@{\temp@\csname res\the\innerloopcount\endcsname}
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>\seq@count\relax
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \else
+ \collect@cons@res
+ \fi
+}
+
+\def\calc@feature{%
+ \advance\pos@count by -1
+ \loopcount=-1 \innerloopcount=0
+ \loop
+ \advance\loopcount by 1
+ \ifnum\loopcount=0 \xdef\first@@{\the\cons@count}
+ \else \xdef\first@@{\the\csname res@count\the\loopcount\endcsname} \fi
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>\first@@
+ \else
+ \expandafter\ifnum\csname stop\bottop@\the\loopcount\endcsname<\first@@
+ \expandafter\getregion@fromfstack{\the\loopcount}
+ \else
+ \innerloopcount=\loopcount
+ \expandafter\ifnum\csname featureon\bottop@\endcsname=0
+ \expandafter\xdef\csname featureon\bottop@\endcsname{1}
+ \expandafter\xdef\csname feature@\bottop@\endcsname{1}
+ \expandafter\xdef\csname ftext\bottop@\the\loopcount\endcsname{%
+ \csname text\bottop@\the\loopcount\endcsname}
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{%
+ \csname style\bottop@\the\loopcount\endcsname}
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by -\csname featurepos\bottop@\endcsname
+ \expandafter\xdef\csname textfeature\bottop@\endcsname{%
+ \csname textfeature\bottop@\endcsname%
+ &\the\innerloopcount;{};}
+ \expandafter\xdef\csname stylefeature\bottop@\endcsname{%
+ \csname stylefeature\bottop@\endcsname%
+ &\the\innerloopcount;&;}
+ \expandafter\xdef\csname featurepos\bottop@\endcsname{\the\pos@count}
+ \xdef\temp@@@{n}
+ \xdef\fourth@{}
+ \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns \xdef\temp@@@{y} \fi
+ \xdef\fourth@{}
+ \xdef\temp@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns \xdef\temp@@@{y} \fi
+ \ifx\temp@@@\y@
+ \ifnum\loopcount=0
+ \message{<No translations of the consensus sequence>}
+ \expandafter\xdef\csname ftext\bottop@\the\loopcount\endcsname{%
+ No consensus translations!}
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{%
+ ///}
+ \else
+ \if\seq@type P
+ \expandafter\xdef\csname collect@res\bottop@\endcsname{yes}
+ \expandafter\xdef\csname tr@nsseq\bottop@\endcsname{\the\loopcount}
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{%
+ \csname res\the\loopcount\endcsname}
+ \else
+ \expandafter\xdef\csname collect@res\bottop@\endcsname{yes}
+ \expandafter\xdef\csname tr@nsseq\bottop@\endcsname{\the\loopcount}
+ \expandafter\ifx\csname res\the\loopcount\endcsname\gap@char
+ \expandafter\xdef\csname triple@count\bottop@\endcsname{0}
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{-}
+ \else
+ \expandafter\xdef\csname triple@count\bottop@\endcsname{1}
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{%
+ \csname res\the\loopcount\endcsname}
+ \expandafter\xdef\csname last@@res\bottop@\endcsname{%
+ \csname res\the\loopcount\endcsname}
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\temp@{plot}
+ \ifx\temp@\fourth@
+ \ifnum\loopcount=0
+ \message{<No bar graphs/scales with the consensus sequence>}
+ \expandafter\xdef\csname ftext\bottop@\the\loopcount\endcsname{}
+ \expandafter\xdef\csname fstyle\bottop@\the\loopcount\endcsname{%
+ ///}
+ \else
+ \expandafter\xdef\csname collect@val\bottop@\endcsname{yes}
+ \expandafter\xdef\csname v@lseq\bottop@\endcsname{\the\loopcount}
+ \expandafter\xdef\csname ffourth@\bottop@\endcsname{\ffourth@}
+ \xdef\temp@{\ffourth@\csname res\the\loopcount\endcsname}
+ \expandafter\xdef\csname v@l\bottop@\endcsname{\csname \temp@\endcsname}
+ \fi
+ \fi
+ \xdef\temp@{cons}
+ \ifx\temp@\fourth@
+ \expandafter\xdef\csname collect@cons@graph\bottop@\endcsname{yes}
+ \expandafter\xdef\csname v@lseq\bottop@\endcsname{\the\loopcount}
+ \expandafter\xdef\csname ffourth@\bottop@\endcsname{\ffourth@}
+ \innerloopcount=1
+ \collect@cons@res
+ \expandafter\xdef\csname v@l\bottop@\endcsname{\cons@val}
+ \fi
+ \else
+ \ifnum\pos@count=1\relax
+ \xdef\temp@{\csname fstyle\bottop@\the\loopcount\endcsname @}
+ \expandafter\getstyle@right\temp@
+ \xdef\temp@@@{n}
+ \xdef\fourth@{}
+ \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns \xdef\temp@@@{y} \fi
+ \xdef\fourth@{}
+ \xdef\temp@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns \xdef\temp@@@{y} \fi
+ \ifx\temp@@@\y@
+ \if\seq@type P
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{%
+ \csname res\the\loopcount\endcsname}
+ \else
+ \expandafter\ifnum\csname triple@count\bottop@\endcsname=2
+ \expandafter\ifx\csname res\the\loopcount\endcsname\gap@char
+ \else
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{%
+ +\csname last@res\bottop@\endcsname%
+ \csname tr@nslate\bottop@\endcsname}
+ \fi
+ \fi
+ \expandafter\ifnum\csname triple@count\bottop@\endcsname=1
+ \expandafter\xdef\csname last@res\bottop@\endcsname{%
+ \csname last@@res\bottop@\endcsname}
+ \expandafter\ifx\csname res\the\loopcount\endcsname\gap@char
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{%
+ +\csname last@res\bottop@\endcsname%
+ \csname tr@nslate\bottop@\endcsname}
+ \fi
+ \fi
+ \fi
+ \fi
+ \xdef\temp@{plot}
+ \ifx\temp@\fourth@
+ \expandafter\ifx\csname res\the\loopcount\endcsname\gap@char
+ \expandafter\xdef\csname v@l\bottop@\endcsname{N}
+ \else
+ \xdef\temp@{\ffourth@\csname res\the\loopcount\endcsname}
+ \expandafter\xdef\csname v@l\bottop@\endcsname{%
+ \csname \temp@\endcsname}
+ \fi
+ \fi
+ \xdef\temp@{cons}
+ \ifx\temp@\fourth@
+ \innerloopcount=1
+ \collect@cons@res
+ \expandafter\xdef\csname v@l\bottop@\endcsname{\cons@val}
+ \fi
+ \fi
+ \fi
+ \expandafter\ifnum\csname stop\bottop@\the\loopcount\endcsname=\first@@
+ \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\temp@@@{n}
+ \xdef\fourth@{}
+ \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns
+ \ifx\f@color\comm@
+ \xdef\f@color{} \else \xdef\f@color{[\f@color]}
+ \fi
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \if\seq@type N \do@translation \else \rev@translation \fi
+ \xdef\temp@{translate:\tr@nsl@ted\f@color}
+ \xdef\temp@@@{y}
+ \else
+ \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \fi
+ \xdef\fourth@{}
+ \xdef\temp@@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \xdef\temp@@{\temp@@[,]:[,][]&}\expandafter\graph@opt@color\temp@@
+ \ifx\fourth@\tr@ns
+ \ifx\f@color\comm@
+ \xdef\f@color{} \else \xdef\f@color{[\f@color]}
+ \fi
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \if\seq@type N \do@translation \else \rev@translation \fi
+ \xdef\temp@@{translate:\tr@nsl@ted\f@color}
+ \xdef\temp@@@{y}
+ \else
+ \xdef\temp@@{plot}
+ \ifx\temp@@\fourth@
+ \xdef\temp@@{plot\f@color[\fffourth@]:\csname v@l\bottop@\endcsname[\ff@color]}
+ \expandafter\xdef\csname collect@val\bottop@\endcsname{no}
+ \expandafter\xdef\csname v@l\bottop@\endcsname{}
+ \else
+ \xdef\temp@@{cons}
+ \ifx\temp@@\fourth@
+ \xdef\temp@@{plot\f@color[\fffourth@]:\csname v@l\bottop@\endcsname[\ff@color]}
+ \expandafter\xdef\csname collect@cons@graph\bottop@\endcsname{no}
+ \expandafter\xdef\csname v@l\bottop@\endcsname{}
+ \else
+ \xdef\temp@@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \fi
+ \fi
+ \fi
+ \ifx\temp@@@\y@
+ \expandafter\xdef\csname collect@res\bottop@\endcsname{no}
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{}
+ \fi
+ \expandafter\ifnum\csname featureon\bottop@\endcsname=1
+ \expandafter\xdef\csname featureon\bottop@\endcsname{0}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \advance\innerloopcount by -\csname featurepos\bottop@\endcsname
+ \expandafter\xdef\csname textfeature\bottop@\endcsname{%
+ \csname textfeature\bottop@\endcsname%
+ &\the\innerloopcount;\temp@;}
+ \expandafter\xdef\csname stylefeature\bottop@\endcsname{%
+ \csname stylefeature\bottop@\endcsname%
+ &\the\innerloopcount;\temp@@;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \expandafter\xdef\csname %
+ featurepos\bottop@\endcsname{\the\innerloopcount}
+ \fi
+ \fi
+ \ifnum\pos@count=\res@perline
+ \expandafter\ifnum\csname featureon\bottop@\endcsname=1
+ \innerloopcount=\pos@count
+ \advance\innerloopcount by 1
+ \advance\innerloopcount by -\csname featurepos\bottop@\endcsname
+ \xdef\temp@{\csname fstyle\bottop@\the\loopcount\endcsname @}
+ \expandafter\getstyle@left\temp@
+ \xdef\temp@@@{n}
+ \xdef\fourth@{}
+ \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \xdef\temp@{\temp@[,]:[,][]&}\expandafter\graph@opt@color\temp@
+ \ifx\fourth@\tr@ns
+ \ifx\f@color\comm@
+ \xdef\f@color{} \else \xdef\f@color{[\f@color]}
+ \fi
+ \expandafter\ifnum\csname triple@count\bottop@\endcsname=2
+ \if\seq@type N
+ \xdef\temp@{\csname sequence\the\loopcount\endcsname:}
+ \expandafter\get@nextres\temp@
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname\temp@}
+ \do@translation
+ \xdef\temp@@@{2}
+ \else
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \rev@translation
+ \xdef\temp@@@{}
+ \fi
+ \xdef\temp@{translate:\tr@nsl@ted\f@color}
+ \else
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \if\seq@type N \do@translation \else \rev@translation \fi
+ \xdef\temp@{translate:\tr@nsl@ted\f@color}
+ \xdef\temp@@@{}
+ \fi
+ \else \xdef\temp@{\csname ftext\bottop@\the\loopcount\endcsname}
+ \fi
+ \xdef\fourth@{}
+ \xdef\temp@@{\csname fstyle\bottop@\the\loopcount\endcsname}
+ \xdef\temp@@{\temp@@[,]:[,][]&}\expandafter\graph@opt@color\temp@@
+ \ifx\fourth@\tr@ns
+ \ifx\f@color\comm@
+ \xdef\f@color{} \else \xdef\f@color{[\f@color]}
+ \fi
+ \expandafter\ifnum\csname triple@count\bottop@\endcsname=2
+ \if\seq@type N
+ \xdef\temp@@{\csname sequence\the\loopcount\endcsname:}
+ \expandafter\get@@nextres\temp@@
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname\temp@@}
+ \do@translation
+ \xdef\temp@@@{2}
+ \else
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \rev@translation
+ \xdef\temp@@@{}
+ \fi
+ \xdef\temp@@{translate:\tr@nsl@ted\f@color}
+ \else
+ \xdef\tr@nsl@ted{\csname tr@nslate\bottop@\endcsname}
+ \if\seq@type N \do@translation \else \rev@translation \fi
+ \xdef\temp@@{translate:\tr@nsl@ted\f@color}
+ \xdef\temp@@@{}
+ \fi
+ \else
+ \xdef\temp@@{plot}
+ \ifx\temp@@\fourth@
+ \xdef\temp@@{plot\f@color[\fffourth@]:\csname v@l\bottop@\endcsname[\ff@color]}
+ \else
+ \xdef\temp@@{cons}
+ \ifx\temp@@\fourth@
+ \xdef\temp@@{plot\f@color[\fffourth@]:\csname v@l\bottop@\endcsname[\ff@color]}
+ \else
+ \xdef\temp@@{\style@@}
+ \fi
+ \fi
+ \fi
+ \ifx\temp@@@\n@
+ \else
+ \expandafter\xdef\csname tr@nslate\bottop@\endcsname{\temp@@@}
+ \fi
+ \expandafter\xdef\csname textfeature\bottop@\endcsname{%
+ \csname textfeature\bottop@\endcsname%
+ &\the\innerloopcount;\temp@;}
+ \expandafter\xdef\csname stylefeature\bottop@\endcsname{%
+ \csname stylefeature\bottop@\endcsname%
+ &\the\innerloopcount;\temp@@;}
+ \innerloopcount=\pos@count \advance\innerloopcount by 1
+ \expandafter\xdef\csname %
+ featurepos\bottop@\endcsname{\the\innerloopcount}
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \advance\pos@count by 1
+}
+
+\def\c@nsensus{%
+ \ifnum\pos@count>\res@perline
+ \else
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\seq@line{\csname sequence\the\loopcount\endcsname}
+ \expandafter\residue@get\seq@line
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \expandafter\check@char\first@
+ \ifletter
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=0
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \fi
+ \ifnum\loopcount=\rule@num\relax
+ \expandafter\ifnum\csname res@count\rule@num\endcsname=\rule@tens
+ \xdef\ruler@{\ruler@ !<\rule@tens>}
+ \innerloopcount=\rule@tens \advance\innerloopcount by \ruler@step
+ \ifnum\innerloopcount=0 \innerloopcount=1 \fi
+ \advance\innerloopcount by -1
+ \ifnum\innerloopcount=\ruler@step
+ \else \advance\innerloopcount by 1 \fi
+ \xdef\rule@tens{\the\innerloopcount}
+ \else
+ \xdef\ruler@{\ruler@ -}
+ \fi
+ \fi
+ \ifx\collect@valtop\yes
+ \ifnum\v@lseqtop=\loopcount
+ \xdef\v@ltop{\v@ltop,\csname \ffourth@top\first@\endcsname}
+ \fi\fi
+ \ifx\collect@valttop\yes
+ \ifnum\v@lseqttop=\loopcount
+ \xdef\v@lttop{\v@lttop,\csname \ffourth@ttop\first@\endcsname}
+ \fi\fi
+ \ifx\collect@valbottom\yes
+ \ifnum\v@lseqbottom=\loopcount
+ \xdef\v@lbottom{\v@lbottom,\csname \ffourth@bottom\first@\endcsname}
+ \fi\fi
+ \ifx\collect@valbbottom\yes
+ \ifnum\v@lseqbbottom=\loopcount
+ \xdef\v@lbbottom{\v@lbbottom,\csname \ffourth@bbottom\first@\endcsname}
+ \fi\fi
+ \ifx\collect@restop\yes
+ \ifnum\tr@nsseqtop=\loopcount
+ \xdef\last@restop{\last@@restop}
+ \xdef\tr@nslatetop{\tr@nslatetop\first@}
+ \xdef\last@@restop{\first@}
+ \innerloopcount=\triple@counttop
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>3 \innerloopcount=1 \fi
+ \xdef\triple@counttop{\the\innerloopcount}
+ \fi\fi
+ \ifx\collect@resttop\yes
+ \ifnum\tr@nsseqttop=\loopcount
+ \xdef\last@resttop{\last@@resttop}
+ \xdef\tr@nslatettop{\tr@nslatettop\first@}
+ \xdef\last@@resttop{\first@}
+ \innerloopcount=\triple@countttop
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>3 \innerloopcount=1 \fi
+ \xdef\triple@countttop{\the\innerloopcount}
+ \fi\fi
+ \ifx\collect@resbottom\yes
+ \ifnum\tr@nsseqbottom=\loopcount
+ \xdef\last@resbottom{\last@@resbottom}
+ \xdef\tr@nslatebottom{\tr@nslatebottom\first@}
+ \xdef\last@@resbottom{\first@}
+ \innerloopcount=\triple@countbottom
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>3 \innerloopcount=1 \fi
+ \xdef\triple@countbottom{\the\innerloopcount}
+ \fi\fi
+ \ifx\collect@resbbottom\yes
+ \ifnum\tr@nsseqbbottom=\loopcount
+ \xdef\last@resbbottom{\last@@resbbottom}
+ \xdef\tr@nslatebbottom{\tr@nslatebbottom\first@}
+ \xdef\last@@resbbottom{\first@}
+ \innerloopcount=\triple@countbbottom
+ \advance\innerloopcount by 1
+ \ifnum\innerloopcount>3 \innerloopcount=1 \fi
+ \xdef\triple@countbbottom{\the\innerloopcount}
+ \fi\fi
+ \innerloopcount=\csname mol@weight\the\loopcount\endcsname
+ \advance\innerloopcount by \csname \prefix@ mw\first@\endcsname
+ \expandafter\xdef\csname mol@weight\the\loopcount\endcsname{%
+ \the\innerloopcount}
+ \innerloopcount=\csname ch@rge\the\loopcount\endcsname
+ \advance\innerloopcount by \csname pepcharge\first@\endcsname
+ \expandafter\xdef\csname ch@rge\the\loopcount\endcsname{%
+ \the\innerloopcount}
+ \else
+ \ifnum\loopcount=\rule@num \xdef\ruler@{\ruler@ -} \fi
+ \ifx\collect@valtop\yes
+ \ifnum\v@lseqtop=\loopcount
+ \xdef\v@ltop{\v@ltop,N}
+ \fi\fi
+ \ifx\collect@valttop\yes
+ \ifnum\v@lseqttop=\loopcount
+ \xdef\v@lttop{\v@lttop,N}
+ \fi\fi
+ \ifx\collect@valbottom\yes
+ \ifnum\v@lseqbottom=\loopcount
+ \xdef\v@lbottom{\v@lbottom,N}
+ \fi\fi
+ \ifx\collect@valbbottom\yes
+ \ifnum\v@lseqbbottom=\loopcount
+ \xdef\v@lbbottom{\v@lbbottom,N}
+ \fi\fi
+ \ifx\collect@restop\yes
+ \ifnum\tr@nsseqtop=\loopcount
+ \xdef\tr@nslatetop{\tr@nslatetop -}
+ \fi\fi
+ \ifx\collect@resttop\yes
+ \ifnum\tr@nsseqttop=\loopcount
+ \xdef\tr@nslatettop{\tr@nslatettop -}
+ \fi\fi
+ \ifx\collect@resbottom\yes
+ \ifnum\tr@nsseqbottom=\loopcount
+ \xdef\tr@nslatebottom{\tr@nslatebottom -}
+ \fi\fi
+ \ifx\collect@resbbottom\yes
+ \ifnum\tr@nsseqbbottom=\loopcount
+ \xdef\tr@nslatebbottom{\tr@nslatebbottom -}
+ \fi\fi
+ \fi
+ \ifnum\loopcount<\seq@count \repeat
+ \ifx\collect@cons@graphtop\yes
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \xdef\v@ltop{\v@ltop,\cons@val}
+ \fi
+ \ifx\collect@cons@graphttop\yes
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \xdef\v@lttop{\v@lttop,\cons@val}
+ \fi
+ \ifx\collect@cons@graphbottom\yes
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \xdef\v@lbottom{\v@lbottom,\cons@val}
+ \fi
+ \ifx\collect@cons@graphbbottom\yes
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \xdef\v@lbbottom{\v@lbbottom,\cons@val}
+ \fi
+ \ifx\collect@cons@colors\y@
+ \outerloopcount=1\relax
+ \temp@count=0\relax
+ \sum@up@cons
+ \outerloopcount=\cons@val
+ \advance\outerloopcount by 4
+ \divide\outerloopcount by 5
+ \multiply\outerloopcount by 5
+ \ifnum\outerloopcount<5\relax\outerloopcount=5\fi
+ \xdef\c@nscol{\c@nscol\the\outerloopcount,}
+ \fi
+
+ \global\advance\cons@count by 1\relax
+ \global\csname res@count0\endcsname=\cons@count
+ \ifnum\rule@num=0
+ \ifnum\cons@count=\rule@tens
+ \xdef\ruler@{\ruler@ !<\rule@tens>}
+ \innerloopcount=\rule@tens \advance\innerloopcount by \ruler@step
+ \ifnum\innerloopcount=0 \innerloopcount=1 \fi
+ \advance\innerloopcount by -1
+ \ifnum\innerloopcount=\ruler@step
+ \else \advance\innerloopcount by 1 \fi
+ \xdef\rule@tens{\the\innerloopcount}
+ \else
+ \xdef\ruler@{\ruler@ -}
+ \fi
+ \fi
+ \advance\pos@count by 1
+ \ifregionalshadenow \calc@regshade \fi
+ \ifregionaltintnow \calc@regtint \fi
+ \ifregionalemphnow \calc@regemph \fi
+ \ifframenow \calc@frame \fi
+ \iftopfeaturenow \xdef\bottop@{top} \calc@feature \fi
+ \ifttopfeaturenow \xdef\bottop@{ttop} \calc@feature \fi
+ \ifbottomfeaturenow \xdef\bottop@{bottom} \calc@feature \fi
+ \ifbbottomfeaturenow \xdef\bottop@{bbottom} \calc@feature \fi
+ \ifall@fshade \all@funcshade
+ \else
+ \ifnum\cons@num>0 \loopcount=\cons@num \else \loopcount=\seq@count \fi
+ \xdef\match@case{0} \xdef\m@x{1}
+ \iffuncmode
+ \xdef\prfx{\prefix@} \xdef\prefix@{func} \xdef\c@se{3} \check@sim
+ \xdef\prefix@{\prfx}
+ \else \xdef\c@se{1} \check@ident \fi
+ \ifcase\match@case \unc@nserved \or \c@nserved \or \allm@tch \else \functi@nal \fi
+ \fi
+ \expandafter\ifnum\csname res@count\start@seq\endcsname<\end@num\relax
+ \c@nsensus
+ \else
+ \global\stop@true
+ \loopcount=\pos@count \advance\loopcount by -1 \relax
+ \res@perline=\loopcount
+ \iftopfeature \xdef\bottop@{top} \calc@feature \fi
+ \ifttopfeature \xdef\bottop@{ttop} \calc@feature \fi
+ \ifbottomfeature \xdef\bottop@{bottom} \calc@feature \fi
+ \ifbbottomfeature \xdef\bottop@{bbottom} \calc@feature \fi
+ \pos@count=0
+ \fi
+ \fi}
+
+\def\c@unt{%
+ \advance\loopcount by 1
+ \xdef\seq@line{\csname sequence\the\loopcount\endcsname}
+ \expandafter\residue@get\seq@line
+ \xdef\first@{\csname res\the\loopcount\endcsname}
+ \expandafter\check@char\first@
+ \ifletter
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=0
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \fi
+ \ifnum\rule@num=\loopcount
+ \temp@count=\csname res@count\the\loopcount\endcsname
+ \divide\temp@count by \ruler@step
+ \multiply\temp@count by \ruler@step
+ \ifnum\temp@count<0 \else \advance\temp@count by \ruler@step \fi
+ \xdef\rule@tens{\the\temp@count}
+ \fi
+ \fi
+ \ifnum\loopcount<\seq@count \c@unt\fi}
+\def\count@first{%
+ \advance\end@count by 1
+ \ifnum\end@count<\start@number
+ \loopcount=0
+ \c@unt
+ \count@first
+ \fi}
+\def\findc@nsensus{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname sequence\the\loopcount\endcsname{%
+ \csname sequence\the\loopcount\endcsname @}
+ \ifnum\loopcount<\seq@count \repeat
+ \end@count=0 \count@first \end@count=0 \xdef\start@number{0}
+ \regionalshadenowfalse \regionalemphnowfalse \regionaltintnowfalse
+ \framenowfalse
+ \topfeaturenowfalse \bottomfeaturenowfalse
+ \ttopfeaturenowfalse \bbottomfeaturenowfalse
+ \innerloopcount=\cons@count
+ \advance\innerloopcount by \res@perline \advance\innerloopcount by 1
+ \loopcount=0
+ \ifregionalshade
+ \expandafter\ifx\csname start\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionalshadenowtrue
+ \fi
+ \fi
+ \fi
+ \ifregionaltint
+ \expandafter\ifx\csname tintstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname tintstart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionaltintnowtrue
+ \fi
+ \fi
+ \fi
+ \ifregionalemph
+ \expandafter\ifx\csname emphstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname emphstart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionalemphnowtrue
+ \fi
+ \fi
+ \fi
+ \ifframe@
+ \expandafter\ifx\csname framestart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname framestart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \framenowtrue
+ \fi
+ \fi
+ \fi
+ \iftopfeature
+ \xdef\bottop@{top}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \topfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifttopfeature
+ \xdef\bottop@{ttop}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \ttopfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifbottomfeature
+ \xdef\bottop@{bottom}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \bottomfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifbbottomfeature
+ \xdef\bottop@{bbottom}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \bbottomfeaturenowtrue
+ \fi
+ \fi
+ \fi
+\loop
+ \advance\loopcount by 1
+ \ifnumbers@left
+ \innerloopcount=\csname seq@len\the\loopcount\endcsname
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=%
+ \innerloopcount
+ \else
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=0
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \fi
+ \fi
+ \ifnames@right
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \the\csname res@count\the\loopcount\endcsname)}
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ <\csname newseqname\the\loopcount\endcsname>
+ \the\csname res@count\the\loopcount\endcsname)}
+ \fi
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=%
+ \innerloopcount
+ \else
+ \global\advance\csname res@count\the\loopcount\endcsname by -1
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=0
+ \global\advance\csname res@count\the\loopcount\endcsname by -1
+ \fi
+ \fi
+ \else
+ \ifnames@right
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{}
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ <\csname newseqname\the\loopcount\endcsname>}
+ \fi
+ \fi
+ \innerloopcount=\csname res@count\the\loopcount\endcsname
+ \advance\innerloopcount by \res@perline \advance\innerloopcount by 1
+ \ifregionalshade
+ \expandafter\ifx\csname start\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionalshadenowtrue
+ \fi
+ \fi
+ \fi
+ \ifregionaltint
+ \expandafter\ifx\csname tintstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname tintstart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionaltintnowtrue
+ \fi
+ \fi
+ \fi
+ \ifregionalemph
+ \expandafter\ifx\csname emphstart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname emphstart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \regionalemphnowtrue
+ \fi
+ \fi
+ \fi
+ \ifframe@
+ \expandafter\ifx\csname framestart\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname framestart\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \framenowtrue
+ \fi
+ \fi
+ \fi
+ \iftopfeature
+ \xdef\bottop@{top}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \topfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifttopfeature
+ \xdef\bottop@{ttop}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \ttopfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifbottomfeature
+ \xdef\bottop@{bottom}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \bottomfeaturenowtrue
+ \fi
+ \fi
+ \fi
+ \ifbbottomfeature
+ \xdef\bottop@{bbottom}
+ \expandafter\ifx\csname start\bottop@\the\loopcount\endcsname\ampers@nd
+ \else
+ \expandafter\ifnum\csname start\bottop@\the\loopcount\endcsname>%
+ \innerloopcount
+ \else
+ \bbottomfeaturenowtrue
+ \fi
+ \fi
+ \fi
+\ifnum\loopcount<\seq@count \repeat
+ \c@nsensus}
+
+%%%%% Output routines
+
+\def\white@box{%
+ \bgroup
+ \fboxsep-0.5pt\fboxrule0.5pt
+ \fcolorbox{Black}{White}{\box@hstrut\box@wstrut}\egroup}
+\def\box@rule{\vrule depth\box@depth height\box@height width\box@width}
+\def\box@hstrut{\vrule depth\box@depth height\box@height width 0pt}
+\def\box@wstrut{\vrule depth 0pt height 0pt width\box@width}
+\def\do@legend{%
+ \baselineskip=1.2\baselineskip
+ \xdef\first@{White}
+ \fontfamily{\legend@family}%
+ \fontseries{\legend@series}%
+ \fontshape{\legend@shape}%
+ \iffuncmode
+ \ifnum\fgroup@num>0
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\third@{\csname fg@color\the\loopcount\endcsname}%
+ \noindent%
+ \ifnames@\ifnames@right\else\hbox to \name@width{\hss}\fi\fi%
+ \ifnumbers@\ifnumbers@left\hbox to \number@width{\hss}\fi\fi%
+ \hbox to \hspace@legend{\hss}%
+ \ifx\third@\first@\white@box\else\textcolor{\third@}{\box@rule}\fi%
+ \xdef\third@{\csname fg@textcolor\the\loopcount\endcsname}%
+ \def\res@@style{\csname func@style\the\loopcount\endcsname}%
+ \def\temp@{X}\xdef\low@up{lower}%
+ \expandafter\ifx\csname funcm@tch\the\loopcount\endcsname\low@up%
+ \def\temp@{x}\fi%
+ \ifhidechar\xdef\temp@{}\fi%
+ \kern-\box@width\textcolor{\third@}{\hbox to \box@width{%
+ \res@@style{\hss\temp@\hss}}}%
+ \kern2ex\textcolor{\legend@fg}{%
+ \legend@size{\csname fgroup@name\the\loopcount\endcsname}}
+ \newline\hbox{}%
+ \ifnum\loopcount<\fgroup@num \repeat
+ \fi
+ \else
+ \noindent
+ \ifnames@\ifnames@right\else\hbox to \name@width{\hss}\fi\fi%
+ \ifnumbers@\ifnumbers@left \hbox to \number@width{\hss}\fi\fi%
+ \hbox to \hspace@legend{\hss}%
+ \ifx\Nomatch\first@\white@box\else\textcolor{\Nomatch}{\box@rule}\fi%
+ \def\res@@style{\csname no@style\endcsname}%
+ \def\temp@{X}\xdef\low@up{lower}\ifx\resn@m@tch\low@up\def\temp@{x}\fi%
+ \ifhidechar\xdef\temp@{}\fi%
+ \kern-\box@width\textcolor{\TextNomatch}{\hbox to \box@width{%
+ \res@@style{\hss\temp@\hss}}}%
+ \textcolor{\legend@fg}{%
+ \ifgerm@n\kern2ex\legend@size{nicht konserviert}%
+ \else\ifsp@nish\kern2ex\legend@size{no conservado}%
+ \else\kern2ex\legend@size{non conserved}\fi\fi}
+ \newline\hbox{}\noindent%
+ \ifsimmode%
+ \ifnames@\ifnames@right\else\hbox to \name@width{\hss}\fi\fi
+ \ifnumbers@\ifnumbers@left \hbox to \number@width{\hss}\fi\fi
+ \hbox to \hspace@legend{\hss}%
+ \ifx\Similar\first@\white@box\else\textcolor{\Similar}{\box@rule}\fi
+ \def\res@@style{\csname sim@style\endcsname}%
+ \def\temp@{X}\xdef\low@up{lower}\ifx\ressimm@tch\low@up\def\temp@{x}\fi%
+ \ifhidechar\xdef\temp@{}\fi%
+ \kern-\box@width\textcolor{\TextSimilar}{\hbox to \box@width{%
+ \res@@style{\hss\temp@\hss}}}%
+ \textcolor{\legend@fg}{%
+ \ifgerm@n\kern2ex\legend@size{\"ahnlich}%
+ \else\ifsp@nish\kern2ex\legend@size{similar}%
+ \else\kern2ex\legend@size{similar}\fi\fi}
+ \newline\hbox{}\noindent%
+ \fi%
+ \ifnames@\ifnames@right\else\hbox to \name@width{\hss}\fi\fi
+ \ifnumbers@\ifnumbers@left \hbox to \number@width{\hss}\fi\fi
+ \hbox to \hspace@legend{\hss}%
+ \ifx\Identical\first@\white@box\else\textcolor{\Identical}{\box@rule}\fi
+ \def\res@@style{\csname id@style\endcsname}%
+ \def\temp@{X}\xdef\low@up{lower}\ifx\resm@tch\low@up\def\temp@{x}\fi%
+ \ifhidechar\xdef\temp@{}\fi%
+ \kern-\box@width\textcolor{\TextIdentical}{\hbox to \box@width{%
+ \res@@style{\hss\temp@\hss}}}%
+ \textcolor{\legend@fg}{%
+ \ifgerm@n\kern2ex\legend@size{konserviert}%
+ \else\ifsp@nish\kern2ex\legend@size{conservado}%
+ \else\kern2ex\legend@size{conserved}\fi\fi}
+ \newline\hbox{}\noindent%
+ \ifall@shade%
+ \ifnames@\ifnames@right\else\hbox to \name@width{\hss}\fi\fi
+ \ifnumbers@\ifnumbers@left \hbox to \number@width{\hss}\fi\fi
+ \hbox to \hspace@legend{\hss}%
+ \ifx\Allmatch\first@\white@box\else\textcolor{\Allmatch}{\box@rule}\fi
+ \def\res@@style{\csname all@style\endcsname}%
+ \def\temp@{X}\xdef\low@up{lower}\ifx\res@llm@tch\low@up\def\temp@{x}\fi%
+ \ifhidechar\xdef\temp@{}\fi%
+ \kern-\box@width\textcolor{\TextAllmatch}{\hbox to \box@width{%
+ \res@@style{\hss\temp@\hss}}}%
+ \textcolor{\legend@fg}{%
+ \ifgerm@n\kern2ex\legend@size{alle identisch}%
+ \else\ifsp@nish\kern2ex\legend@size{todos id\'enticos}%
+ \else\kern2ex\legend@size{all match}\fi\fi}
+ \newline\hbox{}\noindent
+ \fi
+ \fi
+}
+\def\put@name<#1>#2@{%
+ \ifnames@%
+ \expandafter\ifx\csname hide@name\the\loopcount\endcsname\yes%
+ \xdef\temp@{}\else\xdef\temp@{#1}\fi%
+ \expandafter\ifx\csname name@col\the\loopcount\endcsname\yes%
+ \def\second@{\names@fg}%
+ \else\def\second@{\csname name@col\the\loopcount\endcsname}\fi%
+ \fontfamily{\namestext@family}%
+ \fontseries{\namestext@series}%
+ \fontshape{\namestext@shape}%
+ \selectfont%
+ \textcolor{\second@}{%
+ \hbox to \name@width{\@kern\namestext@size{\temp@}\hss}}\fi%
+ \xdef\first@{#2@}%
+}
+\def\put@number#1)#2@{%
+ \ifnumbers@%
+ \expandafter\ifx\csname hide@number\the\loopcount\endcsname\yes%
+ \xdef\temp@{}\else\xdef\temp@{#1}\fi%
+ \expandafter\ifx\csname number@col\the\loopcount\endcsname\yes%
+ \def\second@{\numbering@fg}%
+ \else\def\second@{\csname number@col\the\loopcount\endcsname}\fi%
+ \fontfamily{\numbertext@family}%
+ \fontseries{\numbertext@series}%
+ \fontshape{\numbertext@shape}%
+ \selectfont%
+ \textcolor{\second@}{%
+ \hbox to \number@width{\hss\numbertext@size{\temp@}\@kern}}\fi%
+ \xdef\first@{#2@}%
+}
+\def\special@shade#1)#2#3#4@{%
+ \xdef\second@{\second@#1}%
+ \xdef\boxc@l@r{\csname bgseqregion\second@\endcsname}%
+ \xdef\textc@l@r{\csname fgseqregion\second@\endcsname}%
+ \xdef\first@{#4@}%
+ \xdef\second@{#3}%
+ \def\res@@style{\csname relax\endcsname}%
+}
+\def\get@second@#1#2@{\xdef\second@{#1}\xdef\first@{#2@}}
+\def\next@char#1#2#3@{%
+ \xdef\first@{#3@}%
+ \xdef\second@{#2}%
+ \xdef\last@{#1}%
+ \xdef\temp@@{}%
+ \ifx\last@\ampers@nd\def\last@{0}\expandafter\special@shade\first@%
+ \else%
+ \iffuncmode%
+ \xdef\boxc@l@r{\csname fg@color#1\endcsname}%
+ \xdef\textc@l@r{\csname fg@textcolor#1\endcsname}%
+ \def\res@@style{\csname func@style#1\endcsname}%
+ \if\last@ *\def\last@{0}\fi
+ \if\last@ /\def\last@{10}\fi
+ \else%
+ \ifcase#1\xdef\boxc@l@r{\Allmatch}\xdef\textc@l@r{\TextAllmatch}%
+ \def\res@@style{\all@style}%
+ \or\xdef\boxc@l@r{\Identical}\xdef\textc@l@r{\TextIdentical}%
+ \def\res@@style{\id@style}%
+ \or\xdef\boxc@l@r{\Similar}\xdef\textc@l@r{\TextSimilar}%
+ \def\res@@style{\sim@style}%
+ \or\xdef\boxc@l@r{\Nomatch}\xdef\textc@l@r{\TextNomatch}%
+ \def\res@@style{\no@style}%
+ \or\xdef\boxc@l@r{\ConsNomatch}\xdef\textc@l@r{\ConsTextNomatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\ConsMatch}\xdef\textc@l@r{\ConsTextMatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\ConsAllmatch}\xdef\textc@l@r{\ConsTextAllmatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\gap@bg}\xdef\textc@l@r{\gap@fg}%
+ \def\res@@style{\csname relax\endcsname}%
+ \else\xdef\boxc@l@r{White}\xdef\textc@l@r{White}%
+ \def\res@@style{\csname relax\endcsname}%
+ \fi\fi\fi%
+ \ifx\second@\comm@%
+ \def\temp@{\res@style}%
+ \expandafter\get@second@\first@%
+ \else%
+ \def\temp@{\csname relax\endcsname}%
+ \fi%
+ \ifx\second@\equ@l%
+ \xdef\temp@@{\light@}%
+ \expandafter\get@second@\first@%
+ \fi%
+ \textcolor{\temp@@\boxc@l@r}{\box@rule}%
+ \ifhidechar%
+ \ifx\second@\o@%
+ \def\second@{\gap@rule}%
+ \hbox to -\box@width{\hss\textcolor{\temp@@\textc@l@r}%
+ {\residues@size{\res@@style{\temp@{\second@}}}}\hss}%
+ \kern\box@width%
+ \fi%
+ \else%
+ \ifx\second@\o@\def\second@{\gap@rule}\fi%
+ \hbox to -\box@width{\hss\textcolor{\temp@@\textc@l@r}%
+ {\residues@size{\res@@style{\temp@{\second@}}}}\hss}%
+ \kern\box@width\fi%
+}
+\def\put@char{%
+ \ifnum\innerloopcount>\res@perline
+ \else
+ \expandafter\next@char\first@
+ \advance\innerloopcount by 1
+ \put@char%
+ \fi}
+\def\next@cons#1#2#3@{%
+ \xdef\last@{#1}%
+ \ifx\last@\ampers@nd\def\last@{0}\expandafter\special@shade\first@%
+ \else%
+ \ifx\collect@cons@colors\y@%
+ \expandafter\get@item\first@@@%
+ \xdef\first@@@{\first@}%
+ \ifx\box@scale\y@%
+ \xdef\boxc@l@r{\c@nssc@le\fourth@}%
+ \else%
+ \xdef\boxc@l@r{\c@nssc@le}%
+ \fi%
+ \ifx\text@scale\y@%
+ \xdef\textc@l@r{\c@nsc@l\fourth@}%
+ \else%
+ \xdef\textc@l@r{\c@nsc@l}%
+ \fi%
+ \def\res@@style{\csname relax\endcsname}%
+ \else%
+ \ifcase#1\xdef\boxc@l@r{\Allmatch}\xdef\textc@l@r{\TextAllmatch}%
+ \def\res@@style{\all@style}%
+ \or\xdef\boxc@l@r{\Identical}\xdef\textc@l@r{\TextIdentical}%
+ \def\res@@style{\id@style}%
+ \or\xdef\boxc@l@r{\Similar}\xdef\textc@l@r{\TextSimilar}%
+ \def\res@@style{\sim@style}%
+ \or\xdef\boxc@l@r{\Nomatch}\xdef\textc@l@r{\TextNomatch}%
+ \def\res@@style{\no@style}%
+ \or\xdef\boxc@l@r{\ConsNomatch}\xdef\textc@l@r{\ConsTextNomatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\ConsMatch}\xdef\textc@l@r{\ConsTextMatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\ConsAllmatch}\xdef\textc@l@r{\ConsTextAllmatch}%
+ \def\res@@style{\csname relax\endcsname}%
+ \or\xdef\boxc@l@r{\gap@bg}\xdef\textc@l@r{\gap@fg}%
+ \def\res@@style{\csname relax\endcsname}%
+ \else\xdef\boxc@l@r{White}\xdef\textc@l@r{White}%
+ \def\res@@style{\csname relax\endcsname}%
+ \fi\fi\fi%
+ \xdef\first@{#3@}%
+ \xdef\second@{#2}%
+ \ifx\second@\comm@%
+ \def\temp@{\res@style}%
+ \expandafter\get@second@\first@%
+ \else%
+ \def\temp@{\csname relax\endcsname}%
+ \fi%
+ \textcolor{\boxc@l@r}{\box@rule}%
+ \ifhidechar%
+ \ifx\second@\o@%
+ \def\second@{\gap@rule}%
+ \hbox to -\box@width{\hss\textcolor{\textc@l@r}%
+ {\residues@size{\res@@style{\temp@{\second@}}}}\hss}%
+ \kern\box@width%
+ \fi%
+ \else%
+ \ifx\second@\o@\def\second@{\gap@rule}\fi%
+ \hbox to -\box@width{\hss\textcolor{\textc@l@r}%
+ {\residues@size{\res@@style{\temp@{\second@}}}}\hss}%
+ \kern\box@width\fi%
+}
+\def\put@cons{%
+ \ifnum\innerloopcount>\res@perline
+ \else
+ \expandafter\next@cons\first@
+ \advance\innerloopcount by 1
+ \put@cons%
+ \fi}
+\def\put@line{%
+ \ifnames@right\else\def\@kern{\kern0em}\expandafter\put@name\first@\fi
+ \ifnumbers@left\def\@kern{\kern1em}\expandafter\put@number\first@\fi
+ \fontfamily{\residues@family}%
+ \fontseries{\residues@series}%
+ \fontshape{\residues@shape}%
+ \selectfont%
+ \ifx\cons@now\y@%
+ \innerloopcount=1\relax\put@cons%
+ \else
+ \innerloopcount=1\relax\put@char%
+ \fi
+ \ifnumbers@left\else\def\@kern{\kern0em}\expandafter\put@number\first@\fi
+ \ifnames@right\def\@kern{\kern1em}\expandafter\put@name\first@\fi
+ \newline\hbox{}%
+}
+
+\def\set@consensus{%
+ \ifnames@right
+ \ifnumbers@left
+ \xdef\consensus{)\consensus<\cons@name>}%
+ \else
+ \xdef\consensus{\consensus)<\cons@name>}%
+ \fi
+ \else
+ \ifnumbers@left
+ \xdef\consensus{<\cons@name>)\consensus}%
+ \else
+ \xdef\consensus{<\cons@name>\consensus)}%
+ \fi
+ \fi}
+
+\def\get@rulenum<#1>#2@{%
+ \xdef\first@{#2@}%
+ \ifcase\rule@top
+ \def\third@{\ensuremath{\,\stackrel{\mathtt{#1}}{.}}}%
+ \else
+ \def\third@{\bottomruler@size\ensuremath{\,\stackrel{.}{\mathtt{#1}}}}%
+ \fi}
+
+\def\next@rulechar#1#2@{%
+ \xdef\third@{#1}%
+ \xdef\first@{#2@}%
+ \xdef\second@{!}%
+ \ifx\third@\second@ \expandafter\get@rulenum\first@%
+ \else \xdef\third@{}\fi
+ \hbox to \box@width{\hss\third@\hss}%
+ }
+
+\def\put@rulechar{%
+ \ifnum\innerloopcount>\res@perline
+ \else
+ \expandafter\next@rulechar\first@
+ \advance\innerloopcount by 1
+ \put@rulechar%
+ \fi}
+
+\def\put@ruler{%
+ \ifnames@right
+ \ifnumbers@left \xdef\ruler@{)\ruler@<>}\else\xdef\ruler@{\ruler@)<>}\fi
+ \else
+ \ifnumbers@left \xdef\ruler@{<>)\ruler@}\else\xdef\ruler@{<>\ruler@)}\fi
+ \fi
+ \xdef\first@{\ruler@ @}%
+ \ifnames@right\else\def\@kern{\kern0em}\expandafter\put@name\first@\fi
+ \ifnumbers@left\def\@kern{\kern1em}\expandafter\put@number\first@\fi
+ \vspace{-0.25\baselineskip}%
+ \innerloopcount=1\relax\textcolor{\ruler@fg}{\put@rulechar}%
+ \newline\hbox{}%
+}
+\def\get@firstfill#1#2&{\xdef\second@@{#1}\xdef\fill@char{#2&}}
+\def\get@firstv@l#1,#2&{\xdef\second@@{#1}\xdef\fill@char{#2&}}
+\def\get@tripletfill#1#2#3#4&{%
+ \multiply\temp@count by -1%
+ \def\second@@{#1}\def\second@@@{#2}\def\second@@@@{#3}\def\fill@char{#4&}}
+\def\putfeature@style#1{%
+ \residues@size%
+ \setbox1=\hbox{\ensuremath{\overrightarrow{\hbox{}}}}%
+ \arrow@height=\ht1%
+ \arrow@width=\wd1%
+ \xdef\second@@{#1}%
+ \xdef\last@{\second@@::&}\expandafter\test@fill\last@%
+ \xdef\last@{empty}%
+ \ifx\second@@\last@%
+ \hbox to \second@\box@width{\hss}%
+ \else%
+ \xdef\last@{translate}%
+ \ifx\second@@\last@%
+ \fontfamily{\featurestyles@family}%
+ \fontseries{\featurestyles@series}%
+ \fontshape{\featurestyles@shape}%
+ \selectfont%
+ \xdef\fill@char{\fill@char &}%
+ \if\seq@type N%
+ \loop%
+ \expandafter\get@firstfill\fill@char%
+ \if\second@@ -\def\second@@{\hss}\fi%
+ \hbox to \box@width{\hss\textcolor{\f@color}{\featurestyles@size{\second@@}}\hss}%
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \else%
+ \temp@count=1%
+ \loop%
+ \expandafter\get@tripletfill\fill@char%
+ \if\second@@ -\ifnum\tr@nsstyle>0\hbox to \box@width{\hss}\fi%
+ \else%
+ \ifcase\tr@nsstyle%
+ \hbox{\trans@size\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\,\hss}}%
+ \or%
+ \ifnum\temp@count=1%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}}%
+ \else%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}}%
+ \fi%
+ \or%
+ \ifnum\temp@count=1%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss}}}%
+ \else%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\hss}}}%
+ \fi%
+ \or%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}}%
+ \or%
+ \vbox{\trans@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@\hss}}}%
+ \fi%
+ \fi%
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \fi%
+ \else%
+ \xdef\last@{brace}%
+ \ifx\second@@\last@%
+ \xdef\last@{top}%
+ \textcolor{\f@color}{%
+ \ifx\bottop@\last@%
+ \ensuremath{\overbrace{\hbox to \second@\box@width{\hss%
+ \rule[0.2\arrow@height]{0pt}{0pt}\hss}}}%
+ \else%
+ \xdef\last@{ttop}%
+ \ifx\bottop@\last@%
+ \ensuremath{\overbrace{\hbox to \second@\box@width{\hss%
+ \rule[0.2\arrow@height]{0pt}{0pt}\hss}}}%
+ \else%
+ \raisebox{1.75\arrow@height}{\ensuremath{\underbrace{\hbox to %
+ \second@\box@width{}}}}%
+ \fi\fi}%
+ \else%
+ \xdef\last@{fill}%
+ \ifx\second@@\last@%
+ \fontfamily{\featurestyles@family}%
+ \fontseries{\featurestyles@series}%
+ \fontshape{\featurestyles@shape}%
+ \selectfont%
+ \ifx\bottop@\temp@\xdef\last@{0.35}\else\xdef\last@{0}\fi%
+ \kern0.15\box@width%
+ \loopcount=0\relax%
+ \loop%
+ \advance\loopcount by 1\relax%
+ \raisebox{\last@\arrow@height}{%
+ \hbox to \box@width{\hss{\textcolor{\f@color}{\featurestyles@size\fill@char}}\hss}}%
+ \ifnum\loopcount<\second@ \repeat%
+ \else%
+ \xdef\last@{bar}%
+ \ifx\second@@\last@%
+ \setlength\arrow@width{\pm@shift\box@height}%
+ \setlength\arrow@width{\b@r@stretch\arrow@width}%
+ \ifx\fill@char\N@%
+ \raisebox{\pm@shift\box@height}{\vrule width\box@width}%
+ \else%
+ \kern-0.6\box@width%
+ \ifx\frame@color\back@color%
+ \else%
+ \setlength\arrow@height{\box@height}%
+ \advance\arrow@height by -\pm@shift\box@height%
+ \setlength\arrow@height{\b@r@stretch\arrow@height}%
+ \raisebox{\arrow@width}{%
+ \hbox to \box@width{\hss{\textcolor{\back@color}{\vrule depth\arrow@width%
+ height\arrow@height width\box@width}}\hss}}%
+ \kern-\box@width%
+ \fi%
+ \setlength\arrow@height{\fill@char\box@height}%
+ \setlength\arrow@height{\b@r@stretch\arrow@height}%
+ \divide\arrow@height by 100\relax%
+ \ifdim\arrow@height<0pt%
+ \arrow@height=-\arrow@height%
+ \raisebox{\arrow@width}{%
+ \hbox to \box@width{\hss{\textcolor{\frame@color}{\vrule depth\arrow@height width0.8\box@width}}\hss}}%
+ \else%
+ \raisebox{\arrow@width}{%
+ \hbox to \box@width{\hss{\textcolor{\frame@color}{\vrule height\arrow@height width0.8\box@width}}\hss}}\fi%
+ \kern-\box@width%
+ \raisebox{\arrow@width}{\textcolor{Black}{\vrule height0.25pt depth0.25pt width\box@width}}%
+ \fi%
+ \else%
+ \xdef\last@{color}%
+ \ifx\second@@\last@%
+ \setlength\arrow@height{\fill@char\box@height}%
+ \setlength\arrow@height{\sc@le@stretch\arrow@height}%
+ \divide\arrow@height by 100\relax%
+ \raisebox{0.2\box@height}{%
+ \hbox to \box@width{\hss{\textcolor{\f@color}{\vrule height\arrow@height width\box@width}}\hss}}%
+ \else%
+ \xdef\last@{plotcolor}%
+ \ifx\second@@\last@%
+ \xdef\fill@char{\fill@char,&}%
+ \loop%
+ \expandafter\get@firstv@l\fill@char%
+ \ifx\second@@\N@\hbox to \box@width{\hss}%
+ \else
+ \loopcount=\second@@%
+ \advance\loopcount by -\pm@shift%
+ \advance\loopcount by 4%
+ \divide\loopcount by 5%
+ \multiply\loopcount by 5%
+ \ifnum\loopcount>100\loopcount=100\fi%
+ \ifnum\loopcount<5\loopcount=5\fi%
+ \setlength\arrow@height{50\box@height}%
+ \divide\arrow@height by 100\relax%
+ \setlength\arrow@height{\sc@le@stretch\arrow@height}%
+ \raisebox{0.2\box@height}{%
+ \hbox to \box@width{\hss{\textcolor{\f@color\the\loopcount}{\vrule height\arrow@height width\box@width}}\hss}}%
+ \fi
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \else%
+ \xdef\last@{plotbar}%
+ \ifx\second@@\last@%
+ \xdef\fill@char{\fill@char,&}%
+ \ifnum\pm@shift>0%
+ \setlength\arrow@width{0pt}%
+ \else
+ \setlength\arrow@width{-\pm@shift\box@height}%
+ \divide\arrow@width by 100%
+ \setlength\arrow@width{\b@r@stretch\arrow@width}%
+ \fi%
+ \loop%
+ \expandafter\get@firstv@l\fill@char%
+ \ifx\second@@\N@\hbox to \box@width{\hss}%
+ \else\relax%
+ \ifx\frame@color\back@color%
+ \else%
+ \setlength\arrow@height{\b@r@stretch\box@height}%
+ \hbox to \box@width{\hss{\textcolor{\back@color}%
+ {\vrule height\arrow@height width\box@width}}\hss}%
+ \kern-\box@width%
+ \fi%
+ \setlength\arrow@height{\second@@\box@height}%
+ \divide\arrow@height by 100\relax%
+ \setlength\arrow@height{\b@r@stretch\arrow@height}%
+ \ifdim\arrow@height<0pt%
+ \arrow@height=-\arrow@height%
+ \raisebox{\arrow@width}{%
+ \hbox to \box@width{\hss{\textcolor{\frame@color}%
+ {\vrule depth\arrow@height width0.8\box@width}}\hss}}%
+ \else%
+ \raisebox{\arrow@width}{%
+ \hbox to \box@width{\hss{\textcolor{\frame@color}%
+ {\vrule height\arrow@height width0.8\box@width}}\hss}}\fi%
+ \kern-\box@width%
+ \raisebox{\arrow@width}{\textcolor{Black}%
+ {\vrule height0.25pt depth0.25pt width\box@width}}%
+ \fi
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \else%
+ \xdef\last@{helix}%
+ \ifx\second@@\last@%
+ \fontfamily{\rmdefault}%
+ \fontseries{\mddefault}%
+ \fontshape{\itdefault}%
+ \selectfont%
+ \ifx\bottop@\temp@\xdef\last@{0.35}\else\xdef\last@{0}\fi%
+ \kern0.15\box@width%
+ \setbox1=\hbox{\ensuremath{\smile}\kern-1.13exo\kern-1.02ex}%
+ \arrow@width=\second@\box@width%
+ \divide\arrow@width by \wd1%
+ \arrow@width=2\wd1%
+ \loop%
+ \textcolor{\f@color}{\raisebox{-0.25ex}{\ensuremath{\smile}}%
+ \kern-1.13ex\raisebox{0.3ex}{o}}\kern-1.02ex%
+ \advance\arrow@width by \wd1\relax%
+ \ifdim\arrow@width<\second@\box@width \repeat%
+ \textcolor{\f@color}{\raisebox{-0.25ex}{\ensuremath{\smile}}}%
+ \else%
+ \xdef\last@{box}%
+ \ifx\second@@\last@%
+ \fontfamily{\featurestyles@family}%
+ \fontseries{\featurestyles@series}%
+ \fontshape{\featurestyles@shape}%
+ \selectfont%
+ \kern-\second@\box@width%
+ \bgroup%
+ \textcolor{\back@color}{%
+ \vrule width\second@\box@width height\box@height depth\box@depth}%
+ \kern-\second@\box@width%
+ \fboxsep-\rule@@thick\fboxrule\rule@@thick%
+ \textcolor{\frame@color}{%
+ \fbox{\makebox[\second@\box@width]%
+ {\vrule\@height\box@height\@depth\box@depth \@width\z@}}}%
+ \egroup%
+ \setbox1=\hbox{\residues@size{\fill@char}}%
+ \temp@count=\wd1 \xdef\wd@{\the\temp@count}%
+ \width@tmp=\second@\box@width%
+ \temp@count=\width@tmp%
+ \xdef\sb@{\the\temp@count}%
+ \ifnum\wd@>\sb@ \xdef\fill@char{}\fi%
+ \hbox to -\second@\box@width{\hss\textcolor{\f@color}%
+ {\residues@size{\fill@char}}\hss}%
+ \else%
+ \expandafter\get@shape\second@@%
+ \xdef\last@{arrow}%
+ \ifx\second@@\last@%
+ \kern-0.75\box@width%
+ \ifx\bottop@\temp@ \xdef\last@{0.35}\else\xdef\last@{-0.55}\fi%
+ \textcolor{\f@color}{%
+ \raisebox{\last@\arrow@height}{%
+ \if\first@@ ,%
+ \rule{0.1\arrow@height}{\arrow@height}\kern-0.35\arrow@height%
+ \else%
+ \if\first@@ |%
+ \rule{0.1\arrow@height}{2\arrow@height}\kern-0.35\arrow@height%
+ \else%
+ \if\first@@ `\xdef\first@@{'}\fi%
+ \if\first@@ '%
+ \rule[\arrow@height]%
+ {0.1\arrow@height}{\arrow@height}\kern-0.35\arrow@height%
+ \else%
+ \if\first@@ -%
+ \rule{0pt}{0pt}\kern-0.35\arrow@height%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \if\third@@ v%
+ \if\first@@ v%
+ \ensuremath{\overleftarrow{\hbox to %
+ \second@\box@width{\rule[0.4\arrow@height]{0pt}{0pt}\hss}}}%
+ \kern-\arrow@width%
+ \ensuremath{\overrightarrow{\hbox%
+ {\rule[0.4\arrow@height]{0pt}{0pt}\hss}}}%
+ \else%
+ \ensuremath{\overrightarrow{\hbox to %
+ \second@\box@width{\rule[0.4\arrow@height]{0pt}{0pt}\hss}}}%
+ \fi%
+ \else%
+ \if\first@@ v%
+ \ensuremath{\overleftarrow{\hbox to %
+ \second@\box@width{\rule[0.4\arrow@height]{0pt}{0pt}\hss}}}%
+ \else
+ \kern0.35\arrow@height%
+ \rule[0.9\arrow@height]{\second@\box@width}{0.1\arrow@height}%
+ \kern0.35\arrow@height%
+ \fi
+ \if\third@@ ,%
+ \kern-0.4\arrow@height\rule{0.1\arrow@height}{\arrow@height}%
+ \else%
+ \if\third@@ |%
+ \kern-0.4\arrow@height\rule{0.1\arrow@height}{2\arrow@height}%
+ \else%
+ \if\third@@ `\xdef\third@@{'}\fi%
+ \if\third@@ '%
+ \kern-0.4\arrow@height%
+ \rule[\arrow@height]{0.1\arrow@height}{\arrow@height}%
+ \fi%
+ \fi%
+ \fi%
+ \fi}}%
+ \else%
+ \xdef\last@{doublearrow}%
+ \ifx\second@@\last@%
+ \setbox1=\hbox{\ensuremath{\Rightarrow}}%
+ \arrow@height=\ht1%
+ \arrow@width=\wd1%
+ \setbox1=\hbox to \second@\box@width{}%
+ \width@tmp=\wd1%
+ \kern-0.75\box@width%
+ \xdef\temp@{top}%
+ \ifx\bottop@\temp@ \xdef\last@{0.25}%
+ \else%
+ \xdef\temp@{ttop}%
+ \ifx\bottop@\temp@ \xdef\last@{0.25}%
+ \else%
+ \xdef\last@{-0.25}\fi\fi%
+ \textcolor{\f@color}{%
+ \raisebox{\last@\arrow@height}{%
+ \if\first@@ ,%
+ \rule[-0.5\arrow@height]{0.1\arrow@height}{1.5\arrow@height}%
+ \kern-0.1\arrow@height%
+ \else%
+ \if\first@@ |%
+ \rule[-0.5\arrow@height]{0.1\arrow@height}{2.25\arrow@height}%
+ \kern-0.1\arrow@height%
+ \else%
+ \if\first@@ `\xdef\first@@{'}\fi%
+ \if\first@@ '%
+ \rule[0.4\arrow@height]%
+ {0.1\arrow@height}{1.5\arrow@height}%
+ \kern-0.1\arrow@height%
+ \else%
+ \if\first@@ <%
+ \ensuremath{\Leftarrow}\kern-0.5\arrow@width%
+ \advance\width@tmp by -0.5\arrow@width
+ \else
+ \rule{0pt}{0pt}%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \if\third@@ >%
+ \advance\width@tmp by -0.5\arrow@width%
+ \rule[0.37\arrow@height]{\width@tmp}{0.1\arrow@height}%
+ \kern-\width@tmp%
+ \rule[0.9\arrow@height]{\width@tmp}{0.1\arrow@height}%
+ \kern-0.5\arrow@width\ensuremath{\Rightarrow}%
+ \else%
+ \rule[0.37\arrow@height]{\width@tmp}{0.1\arrow@height}%
+ \kern-\width@tmp%
+ \rule[0.9\arrow@height]{\width@tmp}{0.1\arrow@height}%
+ \if\third@@ ,%
+ \kern-0.05\arrow@height%
+ \rule[-0.5\arrow@height]{0.1\arrow@height}{1.5\arrow@height}%
+ \else%
+ \if\third@@ |%
+ \kern-0.05\arrow@height%
+ \rule[-0.5\arrow@height]{0.1\arrow@height}{2.25\arrow@height}%
+ \else%
+ \if\third@@ `\xdef\third@@{'}\fi%
+ \if\third@@ '%
+ \kern-0.05\arrow@height%
+ \rule[0.4\arrow@height]{0.1\arrow@height}{1.5\arrow@height}%
+ \fi%
+ \fi%
+ \fi%
+ \fi}}%
+ \else
+ \loopcount=0\relax%
+ \width@tmp=\arrow@height%
+ \temp@@length=\rule@@thick%
+ \advance\width@tmp by -0.5\temp@@length%
+ \if\first@@ o\xdef\first@@{O}\fi%
+ \if\third@@ o\xdef\third@@{O}\fi%
+ \ifx\bottop@\temp@ \else \advance\width@tmp by -0.4\arrow@height\fi%
+ \textcolor{\f@color}{%
+ \if\first@@ ,%
+ \rule{\temp@@length}{\arrow@height}\kern-\temp@@length%
+ \else%
+ \if\first@@ |%
+ \rule{\temp@@length}{2\arrow@height}\kern-\temp@@length%
+ \else%
+ \if\first@@ O%
+ \raisebox{0.06ex}{\ensuremath{\bullet}}\kern-0.55ex%
+ \rule[\width@tmp]{0.65ex}{\temp@@length}%
+ \else%
+ \if\first@@ <%
+ \raisebox{0.06ex}{\ensuremath{\blacktriangleleft}}\kern-0.35ex%
+ \else
+ \if\first@@ `\xdef\first@@{'}\fi%
+ \if\first@@ '%
+ \advance\width@tmp by 0.5\temp@@length%
+ \rule[\width@tmp]{\temp@@length}{\arrow@height}\kern-\temp@@length%
+ \advance\width@tmp by -0.5\temp@@length%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \loopcount=\second@%
+ \if\first@@ <\advance\loopcount by -1\relax\ifnum\loopcount<0 \loopcount=0\fi\fi%
+ \if\third@@ >\advance\loopcount by -1\relax\ifnum\loopcount<0 \loopcount=0\fi\fi%
+ \if\first@@ O\advance\loopcount by -1\relax\ifnum\loopcount<0 \loopcount=0\fi\fi%
+ \if\third@@ O\advance\loopcount by -1\relax\ifnum\loopcount<0 \loopcount=0\fi\fi%
+ \xdef\second@{\the\loopcount}%
+ \rule[\width@tmp]{\second@\box@width}{\temp@@length}%
+ \if\third@@ ,%
+ \kern-\temp@@length\rule{\temp@@length}{\arrow@height}%
+ \else%
+ \if\third@@ |%
+ \kern-\temp@@length\rule{\temp@@length}{2\arrow@height}%
+ \else%
+ \if\third@@ O%
+ \rule[\width@tmp]{0.65ex}{\temp@@length}%
+ \kern-0.55ex\raisebox{0.06ex}{\ensuremath{\bullet}}%
+ \else%
+ \if\third@@ >%
+ \kern-0.35ex\raisebox{0.06ex}{\ensuremath{\blacktriangleright}}%
+ \else
+ \if\third@@ `\xdef\third@@{'}\fi%
+ \if\third@@ '%
+ \advance\width@tmp by 0.5\temp@@length%
+ \kern-\temp@@length\rule[\width@tmp]{\temp@@length}{\arrow@height}%
+ \fi%
+ \fi%
+ \fi%
+ \fi
+ \fi}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+ \fi
+}
+\def\next@featuretext&#1;#2;#3@{%
+ \xdef\first@{#3@}%
+ \xdef\last@{#2::&}\expandafter\test@fill\last@%
+ \ifx\f@color\comm@\xdef\f@color{Black}\fi%
+ \fontfamily{\featuretext@family}%
+ \fontseries{\featuretext@series}%
+ \fontshape{\featuretext@shape}%
+ \selectfont%
+ \xdef\last@{translate}%
+ \ifx\last@\second@@%
+ \xdef\fill@char{\fill@char &}%
+ \if\seq@type N
+ \loop%
+ \expandafter\get@firstfill\fill@char%
+ \if\second@@ -\def\second@@{\hss}\fi%
+ \hbox to \box@width{\hss\textcolor{\f@color}{%
+ \featuretext@size{\strut\second@@}}\hss}%
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \else
+ \hbox to #1\box@width{\hss%
+ \temp@count=1%
+ \loop%
+ \expandafter\get@tripletfill\fill@char%
+ \if\second@@ -\ifnum\tr@nstextstyle>0\hbox to \box@width{\hss}\fi%
+ \else%
+ \ifcase\tr@nstextstyle%
+ \hbox{\transtext@size\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\,\hss}}%
+ \or%
+ \ifnum\temp@count=1%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}}%
+ \else%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}}%
+ \fi%
+ \or%
+ \ifnum\temp@count=1%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss}}}%
+ \else%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}%
+ {\hss\second@@\second@@@\second@@@@\hss}}}%
+ \fi%
+ \or%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}{\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@}}}%
+ \or%
+ \vbox{\transtext@size%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@\hss}}%
+ \hbox to \box@width{\textcolor{\f@color}{\hss\second@@@@\hss}}}%
+ \fi%
+ \fi%
+ \ifx\fill@char\ampers@nd\else\repeat%
+ \hss}
+ \fi%
+ \else%
+ \textcolor{\f@color}{%
+ \hbox to #1\box@width{\hss\featuretext@size{\strut\fourth@}\hss}}%
+ \fi%
+}
+\def\put@featuretext{%
+ \if\first@ @%
+ \else
+ \expandafter\next@featuretext\first@%
+ \put@featuretext%
+ \fi}
+\def\next@featurestyle&#1;#2;#3@{%
+ \xdef\first@{#2}%
+ \xdef\second@{#1}%
+ \ifx\first@\ampers@nd \hbox to \second@\box@width{\hss}%
+ \else%
+ \hbox to \second@\box@width%
+ {\hss\expandafter\putfeature@style{\first@}\hss}\fi%
+ \xdef\first@{#3@}%
+}
+\def\put@featurestyle{%
+ \if\first@ @%
+ \else
+ \expandafter\next@featurestyle\first@%
+ \put@featurestyle%
+ \fi
+}
+\def\put@feature{%
+ \vspace{-\baselineskip}%
+ \newline\hbox{}%
+ \ifnames@right\else\ifnames@\hbox to \name@width{\hss}\fi\fi%
+ \ifnumbers@left\ifnumbers@\hbox to \number@width{\hss}\fi\fi%
+ \xdef\temp@{ttop}%
+ \ifx\temp@\bottop@%
+ \xdef\first@{\csname textfeature\bottop@\endcsname @}%
+ \put@featuretext%
+ \else%
+ \xdef\temp@{top}%
+ \ifx\temp@\bottop@%
+ \xdef\first@{\csname textfeature\bottop@\endcsname @}%
+ \put@featuretext%
+ \else
+ \xdef\first@{\csname stylefeature\bottop@\endcsname @}%
+ \put@featurestyle%
+ \fi\fi%
+ \newline\hbox{}%
+ \ifnames@right\else\ifnames@\hbox to \name@width{\hss}\fi\fi%
+ \ifnumbers@left\ifnumbers@\hbox to \number@width{\hss}\fi\fi%
+ \ifx\temp@\bottop@%
+ \xdef\first@{\csname stylefeature\bottop@\endcsname @}%
+ \put@featurestyle%
+ \else%
+ \xdef\temp@{ttop}%
+ \ifx\temp@\bottop@%
+ \xdef\first@{\csname stylefeature\bottop@\endcsname @}%
+ \put@featurestyle%
+ \else
+ \xdef\first@{\csname textfeature\bottop@\endcsname @}%
+ \put@featuretext%
+ \fi\fi%
+ \newline\hbox{}%
+}
+\def\put@@@frame#1{%
+ \xdef\last@{#1[,]&}\expandafter\opt@color\last@%
+ \xdef\second@@{\fourth@}%
+ \ifx\f@color\comm@%
+ \xdef\third@@{0.2\box@width}%
+ \else%
+ \xdef\third@@{\f@color}%
+ \fi%
+ \setlength\arrow@width{\temp@@length}%
+ \advance\arrow@width by -\third@@%
+ \textcolor{\second@@}{%
+ \rule{\second@\box@width}{\third@@}%
+ \kern-\second@\box@width%
+ \rule{\third@@}{\arrow@width}%
+ \kern-\third@@%
+ \rule[\arrow@width]{\second@\box@width}{\third@@}%
+ \kern-\third@@%
+ \rule{\third@@}{\arrow@width}}%
+}
+\def\next@frame&#1;#2;#3@{%
+ \xdef\first@{#2}%
+ \xdef\second@{#1}%
+ \ifx\first@\ampers@nd \hbox to \second@\box@width{\hss}%
+ \else%
+ \expandafter\put@@@frame{\first@}%
+ \fi%
+ \xdef\first@{#3@}%
+}
+\def\put@@frame{%
+ \if\first@ @%
+ \else
+ \expandafter\next@frame\first@%
+ \put@@frame%
+ \fi%
+}
+\def\put@frame{%
+ \temp@count=\seq@count%
+ \setlength\temp@@length{\box@height}%
+ \advance\temp@@length by \box@depth%
+ \setlength\arrow@height{0.5\temp@@length}%
+ \setlength\temp@@length{\temp@count\temp@@length}%
+ \advance\temp@@length by \arrow@height%
+ \setlength\arrow@width{\sep@space}%
+ \setlength\arrow@width{\seq@gap@num\arrow@width}%
+ \advance\temp@@length by \arrow@width%
+ \vspace{\arrow@height}%
+ \vspace{-\temp@@length}%
+ \vspace{-\baselineskip}%
+ \ifshow@cons\ifnum\cons@top=1 \vspace{-\baselineskip}\fi\fi%
+ \newline\hbox{}%
+ \ifnames@right\else\ifnames@\hbox to \name@width{\hss}\fi\fi%
+ \ifnumbers@left\ifnumbers@\hbox to \number@width{\hss}\fi\fi%
+ \xdef\first@{\styleframe @}%
+ \put@@frame%
+ \vspace{-\arrow@height}%
+ \ifshow@cons\ifnum\cons@top=1 \vspace{\baselineskip}\fi\fi%
+ \newline\hbox{}%
+}
+\def\set@lines{%
+ \pos@count=1
+ \xdef\frame@pos{1}%
+ \xdef\featurepostop{1}\xdef\featureposbottom{1}%
+ \xdef\featureposttop{1}\xdef\featureposbbottom{1}%
+ \findc@nsensus%
+ \noindent%
+ \ifnum\feature@ttop=1
+ \ifnum\featureonttop=0 \xdef\feature@ttop{0} \fi
+ \xdef\bottop@{ttop}%
+ \put@feature%
+ \vspace{\tt@sp@ce}%
+ \vspace{-\baselineskip}%
+ \newline\hbox{}%
+ \else
+ \iffix@\ifttopfeature \vspace{\tt@sp@ce}\newline\hbox{}\newline\hbox{}\fi\fi
+ \fi
+ \ifnum\feature@top=1
+ \ifnum\featureontop=0 \xdef\feature@top{0} \fi
+ \xdef\bottop@{top}%
+ \put@feature%
+ \vspace{\t@sp@ce}%
+ \vspace{-\baselineskip}%
+ \newline\hbox{}%
+ \else
+ \iffix@\iftopfeature \vspace{\t@sp@ce}\newline\hbox{}\newline\hbox{}\fi\fi
+ \fi
+ \ifnum\rule@num<0 \else \ifnum\rule@top=0 \loopcount=0 \put@ruler \fi\fi
+ \set@consensus
+ \ifshow@cons\ifnum\cons@top=0
+ \xdef\cons@now{y}%
+ \xdef\first@{\consensus @}%
+ \xdef\first@@@{\c@nscol @}%
+ \loopcount=0\relax%
+ \put@line%
+ \xdef\c@nscol{}%
+ \xdef\cons@now{no}%
+ \fi\fi
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\second@{\csname hide@seq\the\loopcount\endcsname}%
+ \xdef\first@{noshade}\nosh@defalse%
+ \ifx\second@\first@ \nosh@detrue \xdef\second@{false}\fi
+ \xdef\first@{false}%
+ \ifx\second@\first@
+ \ifnames@right
+ \ifnumbers@left
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ <\csname newseqname\the\loopcount\endcsname>}%
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ \the\csname res@count\the\loopcount\endcsname)%
+ <\csname newseqname\the\loopcount\endcsname>}%
+ \fi
+ \else
+ \ifnumbers@left
+ \else
+ \expandafter\xdef\csname seq\the\loopcount\endcsname{%
+ \csname seq\the\loopcount\endcsname%
+ \the\csname res@count\the\loopcount\endcsname)}%
+ \fi
+ \fi
+ \xdef\first@{\csname seq\the\loopcount\endcsname @}%
+ \expandafter\ifx\csname seq@gap\the\loopcount\endcsname\yes%
+ \ifnum\finger@linenum=0\seq@skip%
+ \else%
+ \ifnum\loopcount<\seq@count\seq@skip\fi%
+ \fi%
+ \fi%
+ \put@line%
+ \fi
+ \ifnum\loopcount<\seq@count\repeat
+ \ifshow@cons\ifnum\cons@top=1
+ \xdef\cons@now{y}%
+ \xdef\first@{\consensus @}%
+ \xdef\first@@@{\c@nscol @}%
+ \loopcount=0\relax%
+ \put@line%
+ \xdef\c@nscol{}%
+ \xdef\cons@now{no}%
+ \fi\fi
+ \ifnum\frame@=1
+ \ifnum\frame@on=0 \xdef\frame@{0}\fi
+ \put@frame
+ \fi
+ \ifnum\rule@num<0
+ \else
+ \ifnum\rule@top=1
+ \loopcount=0\relax%
+ \put@ruler%
+ \vspace{0.25\baselineskip}%
+ \fi
+ \fi
+ \ifnum\feature@bottom=1
+ \ifnum\featureonbottom=0 \xdef\feature@bottom{0}\fi
+ \xdef\bottop@{bottom}%
+ \vspace{\b@sp@ce}%
+ \if\bottom@stretch y%
+ \vspace{-\box@height}%
+ \vspace{\b@r@stretch\box@height}%
+ \fi%
+ \put@feature
+ \else
+ \iffix@
+ \if\bottom@stretch y%
+ \vspace{-\box@height}%
+ \vspace{\b@r@stretch\box@height}%
+ \fi%
+ \ifbottomfeature
+ \vspace{\b@sp@ce}\newline\hbox{}\newline\hbox{}
+ \fi
+ \fi
+ \fi
+ \ifnum\feature@bbottom=1
+ \ifnum\featureonbbottom=0 \xdef\feature@bbottom{0}\fi
+ \xdef\bottop@{bbottom}%
+ \vspace{\bb@sp@ce}%
+ \if\bbottom@stretch y%
+ \vspace{-\box@height}%
+ \vspace{\b@r@stretch\box@height}%
+ \fi%
+ \put@feature
+ \else
+ \iffix@
+ \if\bbottom@stretch y%
+ \vspace{-\box@height}%
+ \vspace{\b@r@stretch\box@height}%
+ \fi%
+ \ifbbottomfeature
+ \vspace{\bb@sp@ce}\newline\hbox{}\newline\hbox{}
+ \fi
+ \fi
+ \fi
+ \xdef\consensus{} \xdef\ruler@{}
+ \xdef\styleframe{}
+ \xdef\textfeaturetop{} \xdef\textfeaturebottom{}
+ \xdef\textfeaturettop{} \xdef\textfeaturebbottom{}
+ \xdef\stylefeaturetop{} \xdef\stylefeaturebottom{}
+ \xdef\stylefeaturettop{} \xdef\stylefeaturebbottom{}
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \xdef\seq@line{\csname sequence\the\loopcount\endcsname}
+ \expandafter\remove@fromseq\seq@line
+ \ifnum\loopcount<\seq@count \repeat}
+
+\def\block@output{%
+ \expandafter\ifnum\csname res@count\start@seq\endcsname<\end@num\relax
+ \message{.}
+ \ifx\out@put\y@
+ \vbox{\set@lines}\par
+ \block@skip
+ \else
+ \pos@count=1
+ \findc@nsensus
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1\relax
+ \xdef\seq@line{\csname sequence\the\loopcount\endcsname}
+ \expandafter\remove@fromseq\seq@line
+ \ifnum\loopcount<\seq@count \repeat
+ \fi
+ \ifstop@
+ \else
+ \advance\seq@pointer by -\res@perline
+ \ifnum\seq@pointer>\res@perline \block@output \fi
+ \fi
+ \fi}
+
+%%%%% Basic input routines
+
+\def\savedseqlength#1#2#3{%
+ \expandafter\xdef\csname savelength#1seq#2\endcsname{#3}}
+
+\def\set@savedseqlength{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\ifx%
+ \csname savelength\@lign@count seq\the\loopcount\endcsname\relax
+ \else
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{%
+ \csname savelength\@lign@count seq\the\loopcount\endcsname}
+ \fi
+ \ifnum\loopcount<\seq@count\repeat
+}
+
+\def\save@lengths{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1\relax
+ \immediate\write\@auxout{%
+ \string\savedseqlength{\@lign@count}{\the\loopcount}%
+ {\expandafter\the\csname res@count\the\loopcount\endcsname}}
+ \ifnum\loopcount<\seq@count \repeat
+}
+
+\def\do@cleanup{%
+ \expandafter\firstchar@get\third@
+ \expandafter\check@char\first@
+ \ifletter
+ \xdef\second@{\second@\first@}
+ \else
+ \ifnumber
+ \ifx\first@\gre@ter
+ \xdef\second@{\second@{$>$}}
+ \else
+ \ifx\first@\sm@ller
+ \xdef\second@{\second@{$<$}}
+ \else
+ \xdef\second@{\second@\first@}
+ \fi\fi
+ \else
+ \ifnum\code@num=6
+ \xdef\second@{\second@\#}
+ \else
+ \ifnum\code@num=14
+ \xdef\second@{\second@\%}
+ \else
+ \xdef\second@{\second@\noexpand\string\first@}
+ \fi\fi
+ \fi
+ \fi
+ \ifx\third@\@t \else \do@cleanup \fi
+}
+
+\def\cleanup@name{%
+ \xdef\third@{\csname seqname\the\loopcount\endcsname @}
+ \xdef\second@{}
+ \do@cleanup
+ \expandafter\xdef\csname newseqname\the\loopcount\endcsname{\second@}
+}
+
+\def\clear@seq{%
+ \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\def\csname sequence\the\loopcount\endcsname{}
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\consensus{}
+ \xdef\constopo{}
+ \xdef\frame@on{0}
+ \xdef\textfeaturetop{} \xdef\featureontop{0}
+ \xdef\textfeaturettop{} \xdef\featureonttop{0}
+ \xdef\textfeaturebottom{} \xdef\featureonbottom{0}
+ \xdef\textfeaturebbottom{}\xdef\featureonbbottom{0}
+ \xdef\styleframe{}
+ \xdef\stylefeaturetop{}
+ \xdef\stylefeaturettop{}
+ \xdef\stylefeaturebottom{}
+ \xdef\stylefeaturebbottom{}}
+\def\do@count{%
+ \expandafter\res@get\seq@line
+ \if\first@\ampers@nd
+ \else
+ \advance\innerloopcount by 1
+ \expandafter\check@char\first@
+ \ifletter
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \expandafter\ifnum\csname res@count\the\loopcount\endcsname=0
+ \global\advance\csname res@count\the\loopcount\endcsname by 1
+ \fi
+ \fi
+ \do@count
+ \fi}
+\def\residue@@count{%
+ \xdef\seq@line{\csname sequence\the\loopcount\endcsname &@}
+ \innerloopcount=0 \do@count
+ \advance\loopcount by 1
+ \ifnum\loopcount>\seq@count \else\residue@@count\fi}
+\def\residue@count{%
+ \expandafter\res@get\seq@line
+ \if\first@\ampers@nd
+ \else
+ \advance\innerloopcount by 1
+ \ifstart@ \advance\res@count by 1
+ \else
+ \ifnum\start@seq=0
+ \advance\end@count by 1
+ \else
+ \expandafter\check@char\first@
+ \ifletter \advance\end@count by 1 \fi
+ \fi
+ \ifnum\end@count=\start@num\relax
+ \xdef\start@number{\the\innerloopcount}
+ \ifnum\start@seq=0
+ \cons@count=\start@number
+ \advance\cons@count by -1
+ \fi
+ \start@true \res@count=1
+ \fi
+ \fi
+ \residue@count
+ \fi}
+\def\read@loop{%
+ \read\alignfile to \inline
+ \xdef\last@{\expandafter\string\inline}
+ \ifx\last@\par@
+ \else
+ \xdef\inline{\inline @}
+ \expandafter\seq@get\inline
+ \ifstop@
+ \else
+ \innerloopcount=\csname @rd\the\loopcount\endcsname\relax
+ \expandafter\ifx\csname seq@name\the\loopcount\endcsname\first@
+ \expandafter\xdef\csname sequence\the\innerloopcount\endcsname{%
+ \csname sequence\the\innerloopcount\endcsname\seq@line}
+ \ifnum\start@seq=0
+ \ifnum\loopcount=1
+ \res@count=0 \innerloopcount=0
+ \xdef\seq@line{\seq@line &@} \residue@count
+ \fi
+ \else
+ \ifnum\innerloopcount=\start@seq
+ \res@count=0 \innerloopcount=0
+ \xdef\seq@line{\seq@line &@} \residue@count
+ \fi
+ \fi
+ \advance\loopcount by 1
+ \ifnum\loopcount>\seq@count
+ \ifstart@
+ \else
+ \loopcount=1\residue@@count\clear@seq
+ \fi
+ \advance\seq@pointer by \res@count
+ \ifnum\seq@pointer>\res@perline \block@output \fi
+ \loopcount=1
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifeof\alignfile \else \read@loop \fi}
+\def\read@fasta{%
+ \read\alignfile to \inline
+ \xdef\last@{\expandafter\string\inline}
+ \ifx\last@\par@
+ \else
+ \xdef\seq@line{\inline}
+ \xdef\inline{\inline @}
+ \expandafter\firstchar@get\inline
+ \ifstop@
+ \else
+ \ifx\first@\gre@ter
+ \advance\loopcount by 1\relax
+ \expandafter\seq@get\third@
+ \xdef\seq@name{\first@}
+ \xdef\second@{\first@ &}
+ \ifx\second@\ampers@nd \xdef\seq@name{seq\the\loopcount}\fi
+ \innerloopcount=\csname @rd\the\loopcount\endcsname\relax
+ \else
+ \expandafter\ifx\csname seq@name\the\loopcount\endcsname\seq@name
+ \expandafter\xdef\csname sequence\the\innerloopcount\endcsname{%
+ \csname sequence\the\innerloopcount\endcsname\seq@line}
+ \fi
+ \fi
+ \fi
+ \fi
+ \ifeof\alignfile
+ \ifnum\start@seq=0
+ \xdef\seq@line{\csname sequence1\endcsname &@}
+ \else
+ \xdef\seq@line{\csname sequence\start@seq\endcsname &@}
+ \fi
+ \res@count=0
+ \innerloopcount=0
+ \residue@count
+ \advance\seq@pointer by \res@count
+ \ifnum\seq@pointer>\res@perline \block@output \fi
+ \else
+ \read@fasta
+ \fi}
+\def\read@lines{%
+ \openin\alignfile = \alignfilename
+ \clear@seq
+ \ifnum\start@seq>0
+ \xdef\start@seq{\csname @rd\start@seq\endcsname} \fi
+ \loopcount=\start@num
+ \advance\loopcount by -\csname res@count\start@seq\endcsname\relax
+ \expandafter\ifnum\csname res@count\start@seq\endcsname<\start@num\relax
+ \xdef\start@num{\the\loopcount}
+ \else \start@true \fi
+ \loopcount=\end@num
+ \advance\loopcount by -\csname res@count\start@seq\endcsname\relax
+ \res@count=0 \seq@pointer=0 \end@count=0
+ \xdef\start@number{0}
+ \ifx\f@st@\y@
+ \loopcount=0
+ \read@fasta
+ \else
+ \loopcount=1
+ \read@loop
+ \fi
+ \ifnum\seq@pointer>0
+ \ifstop@
+ \else
+ \res@count=\res@perline
+ \res@perline=\seq@pointer
+ \block@output
+ \fi
+ \fi
+ \message{)}
+ \closein\alignfile}
+
+%%%%% Read alignment, decide whether MSF or ALN, interpret
+
+\def\readalignfile#1{%
+ \def\alignfilename{#1}
+ \xdef\first@{byhand}
+ \ifx\alignfilename\first@
+ \else
+ \openin\alignfile = #1
+ \ifeof\alignfile
+ \PackageError{TeXshade}
+ {File `#1' not found}
+ {\MessageBreak
+ The alignment file you specified is missing or you have \MessageBreak
+ misspelled it. \MessageBreak\MessageBreak
+ Stop here, otherwise you're likely getting in trouble. \MessageBreak
+ Type X <return> to quit. \MessageBreak
+}
+ \else
+ \message{(\alignfilename :}
+ \xdef\seq@type{} \xdef\he@der{no} \xdef\f@st@{no}
+ \xdef\first@line{y}
+ \seq@count=0 \loopcount=0 \innerloopcount=0 \temp@count=0
+ \loop
+ \read\alignfile to \inline
+ \xdef\test@{\expandafter\string\inline}
+ \ifx\test@\par@ \innerloopcount=0
+ \else
+ \xdef\msfline{\inline & & & & @}
+ \expandafter\inf@@get\msfline
+ \ifx\first@\@msf \expandafter\type@get\msfline \fi
+ \ifx\second@\@msf \expandafter\type@get\msfline \fi
+ \ifx\third@\@msf \expandafter\type@get\msfline \fi
+ \ifx\first@\n@me \advance\loopcount by 1\relax
+ \expandafter\xdef\csname seqname\the\loopcount\endcsname{\second@}
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{\fourth@}
+ \fi
+ \ifx\first@\he@derend
+ \ifnum\loopcount>0 \xdef\he@der{yes} \fi
+ \fi
+ \xdef\alnline{\inline @}
+ \expandafter\check@letter\alnline
+ \ifletter
+ \expandafter\seq@get\alnline
+ \advance\innerloopcount by 1\relax
+ \seq@count=\innerloopcount
+ \expandafter\xdef\csname newseqname\the\seq@count\endcsname{\first@}
+ \else
+ \expandafter\firstchar@get\alnline
+ \ifx\first@\gre@ter
+ \ifx\first@line\y@ \xdef\f@st@{y}\fi
+ \expandafter\seq@get\third@
+ \advance\temp@count by 1\relax
+ \xdef\second@{\first@ &}
+ \ifx\second@\ampers@nd \xdef\first@{seq\the\temp@count}\fi
+ \expandafter\xdef\csname seq@name\the\temp@count\endcsname{\first@}
+ \fi
+ \fi
+ \fi
+ \xdef\first@line{n}
+ \ifeof\alignfile \else\repeat
+ \closein\alignfile
+ \xdef\first@{no}
+ \ifx\he@der\first@
+ \loopcount=0
+ \ifx\f@st@\y@
+ \seq@count=\temp@count \loopcount=0
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname seqname\the\loopcount\endcsname{%
+ \csname seq@name\the\loopcount\endcsname}
+ \expandafter\xdef\csname newseqname\the\loopcount\endcsname{%
+ \csname seq@name\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{99999999}
+ \ifnum\loopcount<\seq@count \repeat
+ \else
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname seqname\the\loopcount\endcsname{%
+ \csname newseqname\the\loopcount\endcsname}
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{99999999}
+ \ifnum\loopcount<\seq@count \repeat
+ \fi
+ \else
+ \seq@count=\loopcount \loopcount=0 \box@width=0pt
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname newseqname\the\loopcount\endcsname{%
+ \csname seqname\the\loopcount\endcsname}
+ \ifnum\loopcount<\seq@count \repeat
+ \fi
+ \set@savedseqlength
+ \ifnum\seq@count>\max@seqnumber \set@maxseqnumber\seq@count \fi
+ \loopcount=0 \xdef\seq@order{}
+ \expandafter\xdef\csname stack@reg\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@tintreg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@emphreg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@framereg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@top\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@ttop\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@bottom\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@bbottom\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname seq@start\the\loopcount\endcsname{1}
+ \expandafter\xdef\csname name@col\the\loopcount\endcsname{yes}
+ \expandafter\xdef\csname number@col\the\loopcount\endcsname{yes}
+ \loop
+ \advance\loopcount by 1
+ \expandafter\xdef\csname @rd\the\loopcount\endcsname{\the\loopcount}
+ \csname res@count\the\loopcount\endcsname=0
+ \cleanup@name
+ \expandafter\xdef\csname tint@seq\the\loopcount\endcsname{n}
+ \expandafter\xdef\csname emph@seq\the\loopcount\endcsname{n}
+ \expandafter\xdef\csname hide@seq\the\loopcount\endcsname{false}
+ \expandafter\xdef\csname hide@name\the\loopcount\endcsname{no}
+ \expandafter\xdef\csname name@col\the\loopcount\endcsname{yes}
+ \expandafter\xdef\csname hide@number\the\loopcount\endcsname{no}
+ \expandafter\xdef\csname number@col\the\loopcount\endcsname{yes}
+ \expandafter\xdef\csname stack@reg\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@tintreg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@emphreg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@framereg\the\loopcount\endcsname{&;&;&;@}
+ \expandafter\xdef\csname stack@top\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@ttop\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@bottom\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname stack@bbottom\the\loopcount\endcsname{&;&;&;&;@}
+ \expandafter\xdef\csname seq@gap\the\loopcount\endcsname{no}
+ \expandafter\xdef\csname seq@start\the\loopcount\endcsname{1}
+ \expandafter\xdef\csname mol@weight\the\loopcount\endcsname{0}
+ \expandafter\xdef\csname ch@rge\the\loopcount\endcsname{0}
+ \ifnum\loopcount=1 \xdef\seq@order{\the\loopcount}
+ \else \xdef\seq@order{\seq@order,\the\loopcount}\fi
+ \ifnum\loopcount<\seq@count \repeat
+ \xdef\seq@order{\seq@order,@}
+ \killseq@count=\seq@count
+ \seq@percent=100
+ \ifnum\seq@count>0 \divide\seq@percent by \seq@count \fi
+ \if\seq@type P \xdef\prefix@{pep}
+ \else \if\seq@type p \xdef\prefix@{pep} \xdef\seq@type{P}
+ \else \seqtype{N} \xdef\prefix@{DNA} \fi\fi
+ \fi
+ \fi
+}
+
+%%%%% TeXshade
+
+\def\calc@widths{%
+ \fontfamily{\residues@family}
+ \fontseries{\residues@series}
+ \fontshape{\residues@shape}
+ \selectfont
+ \setbox1=\hbox{\residues@size{W}}\box@width=\wd1
+ \global\setlength\box@width{\char@stretch\box@width}
+ \box@height=1.2\ht1
+ \setbox1=\hbox{\residues@size{g}}\box@depth=1.1\dp1
+ \global\setlength\box@height{\line@stretch\box@height}
+ \global\setlength\box@depth{\line@stretch\box@depth}
+ \baselineskip=\box@height \advance\baselineskip by \box@depth
+ \lineskip=0pt
+ \ifshow@cons\setbox1=\hbox{\cons@name}\name@width=\wd1\else\name@width=0pt\fi
+ \loopcount=0
+ \expandafter\getregion@fromstack{\the\loopcount}
+ \expandafter\getregion@fromtintstack{\the\loopcount}
+ \expandafter\getregion@fromemphstack{\the\loopcount}
+ \expandafter\getregion@fromframestack{\the\loopcount}
+ \xdef\bottop@{top} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{ttop} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{bottom} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{bbottom}\expandafter\getregion@fromfstack{\the\loopcount}
+ \fontfamily{\namestext@family}
+ \fontseries{\namestext@series}
+ \fontshape{\namestext@shape}
+ \selectfont
+ \loopcount=1
+ \loop
+ \setbox1=\hbox{\namestext@size\csname newseqname\the\loopcount\endcsname}
+ \ifnum\wd1>\name@width \name@width=\wd1 \fi
+ \ifnum\ht1>\box@height
+ \box@height=1.1\ht1
+ \global\setlength\box@height{\line@stretch\box@height}
+ \baselineskip=\box@height \advance\baselineskip by \box@depth
+ \fi
+ \ifnum\dp1>\box@depth
+ \box@depth=1.1\dp1
+ \global\setlength\box@depth{\line@stretch\box@depth}
+ \baselineskip=\box@height \advance\baselineskip by \box@depth
+ \fi
+ \expandafter\getregion@fromstack{\the\loopcount}
+ \expandafter\getregion@fromtintstack{\the\loopcount}
+ \expandafter\getregion@fromemphstack{\the\loopcount}
+ \expandafter\getregion@fromframestack{\the\loopcount}
+ \xdef\bottop@{top} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{ttop} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{bottom} \expandafter\getregion@fromfstack{\the\loopcount}
+ \xdef\bottop@{bbottom}\expandafter\getregion@fromfstack{\the\loopcount}
+ \innerloopcount = \csname seq@len\the\loopcount\endcsname
+ \advance\innerloopcount by \csname seq@start\the\loopcount\endcsname
+ \advance\innerloopcount by -1
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{\the\innerloopcount}
+ \ifsh@wg@ps
+ \expandafter\xdef\csname seq@len\the\loopcount\endcsname{99999999}
+ \fi
+ \advance\loopcount by 1
+ \ifnum\loopcount>\seq@count \else \repeat
+ \advance\name@width by 1em
+ \fontfamily{\numbertext@family}
+ \fontseries{\numbertext@series}
+ \fontshape{\numbertext@shape}
+ \selectfont
+ \setbox1=\hbox{\numbertext@size\num@width}
+ \number@width=\wd1
+ \advance\number@width by 1em
+ \loopcount=\textwidth
+ \ifnames@ \advance\loopcount by -\name@width \fi
+ \ifnumbers@ \advance\loopcount by -\number@width \fi
+ \divide\loopcount by \box@width
+ \divide\loopcount by 5 \multiply\loopcount by 5
+ \ifrpl@fix\else
+ \ifnum\res@perline>\loopcount \res@perline=\loopcount\fi\fi
+ \ifnum\finger@linenum>0
+ \width@tmp=\textwidth
+ \ifnames@ \advance\width@tmp by -\name@width \fi
+ \ifnumbers@ \advance\width@tmp by -\number@width \fi
+ \divide\width@tmp by \finger@linenum
+ \global\setlength\box@width{\width@tmp}
+ \fi
+ \center@fill=\textwidth
+ \ifnames@ \advance\center@fill by -\name@width \fi
+ \ifnumbers@ \advance\center@fill by -\number@width \fi
+ \width@tmp=\box@width \multiply\width@tmp by \res@perline
+ \advance\center@fill by -\width@tmp
+ \ifx\out@put\y@\leftskip\c@factor\center@fill\fi
+}
+
+\def\multiple@dssp{%
+ \advance\loopcount by 1
+ \include@DSSP
+ \ifnum\loopcount<\dssp@num\multiple@dssp\fi}
+
+\def\multiple@stride{%
+ \advance\loopcount by 1
+ \include@stride
+ \ifnum\loopcount<\stride@num\multiple@stride\fi}
+
+\def\multiple@PHD{%
+ \advance\loopcount by 1
+ \include@PHD
+ \ifnum\loopcount<\PHD@num\multiple@PHD\fi}
+
+\def\multiple@HMMTOP{%
+ \advance\loopcount by 1
+ \include@HMMTOP
+ \ifnum\loopcount<\HMMTOP@num\multiple@HMMTOP\fi}
+
+\newenvironment{texshade}[2][&]%
+ {\standarddefinitions
+ \c@d@ns
+ \xdef\first@{#1}\ifx\first@\ampers@nd\else\input{#1}\fi
+ \readalignfile{#2}
+ }%
+ {\ifnum\seq@count>0
+ \loopcount=0
+ \ifnum\loopcount<\dssp@num \multiple@dssp\fi
+ \loopcount=0
+ \ifnum\loopcount<\stride@num \multiple@stride\fi
+ \loopcount=0
+ \ifnum\loopcount<\PHD@num \multiple@PHD\fi
+ \loopcount=0
+ \ifnum\loopcount<\HMMTOP@num \multiple@HMMTOP\fi
+ \loopcount=1 \kill@seqnow
+ \reorder@seqs\seq@order \seq@count=\killseq@count
+ \ifnum\csname res@count\start@seq\endcsname<0
+ \ifnum\start@num>0
+ \loopcount=\start@num
+ \advance\loopcount by -1
+ \xdef\start@num{\the\loopcount}
+ \fi
+ \fi
+ \ifnum\rule@num>0
+ \loopcount=\csname res@count\rule@num\endcsname
+ \divide\loopcount by \ruler@step
+ \multiply\loopcount by \ruler@step
+ \ifnum\loopcount<0 \else \advance\loopcount by \ruler@step \fi
+ \xdef\rule@tens{\the\loopcount}
+ \else
+ \xdef\rule@tens{\ruler@step}
+ \fi
+ \xdef\first@{top}
+ \ifx\cap@pos\first@
+ \xdef\@captype{figure}
+ \ifx\c@pshort\n@
+ \caption{\c@p}
+ \else
+ \caption[\c@pshort]{\c@p}
+ \fi
+ \fi
+ \bgroup
+ \ifx\out@put\y@\bigskip\fi
+ \iffuncmode \show@consfalse \fi
+ \ifall@fshade \iffuncmode \else \all@fshadefalse \fi\fi
+ \ifnum\finger@linenum>0
+ \show@consfalse
+ \hidechartrue
+ \message{<fingerprinting---please wait>}
+ \fi
+ \calc@widths
+ \read@lines
+ \save@lengths
+ \iflegend@
+ \vspace{\vspace@legend}
+ \setbox1=\vbox{\do@legend}
+ \vbox{\do@legend}\par
+ \ifnum\ht1<-\vspace@legend
+ \vspace{-\ht1}\vspace{-\vspace@legend}
+ \fi
+ \fi
+ \egroup
+ \xdef\first@{bottom}
+ \ifx\cap@pos\first@
+ \vspace{-\baselineskip}
+ \xdef\@captype{figure}
+ \ifx\c@pshort\n@
+ \caption{\c@p}
+ \else
+ \caption[\c@pshort]{\c@p}
+ \fi
+ \fi
+ \fi}
+
+\def\standarddefinitions{%
+\xdef\prfx{pep}\clear@groups\clear@sims
+\xdef\prfx{DNA}\clear@groups\clear@sims
+\clearfuncgroups
+\loopcount=\@lign@count
+\advance\loopcount by 1\relax
+\xdef\@lign@count{\the\loopcount}
+\start@true \xdef\start@num{1} \xdef\start@seq{0}
+\stop@false \xdef\end@num{99999999} \xdef\seq@regions{0}
+\cons@count=0 \csname res@count0\endcsname=0
+\regionalshadefalse\regionalemphfalse\regionaltintfalse
+\frame@false
+\topfeaturefalse\bottomfeaturefalse
+\ttopfeaturefalse\bbottomfeaturefalse
+\all@fshadefalse\hidecharfalse
+\xdef\finger@linenum{0}
+\xdef\dssp@num{0} \xdef\stride@num{0} \xdef\PHD@num{0} \xdef\HMMTOP@num{0}
+\xdef\bottop@{top} \expandafter\xdef\csname feature@\bottop@\endcsname{0}
+\xdef\bottop@{ttop} \expandafter\xdef\csname feature@\bottop@\endcsname{0}
+\xdef\bottop@{bottom} \expandafter\xdef\csname feature@\bottop@\endcsname{0}
+\xdef\bottop@{bbottom}\expandafter\xdef\csname feature@\bottop@\endcsname{0}
+\xdef\frame@{0}
+\xdef\show@Hdssp{no} \xdef\show@Gdssp{no} \xdef\show@Idssp{no}
+\xdef\show@Edssp{no} \xdef\show@Bdssp{no} \xdef\show@Tdssp{no}
+\xdef\show@Sdssp{no}
+\xdef\show@Hstride{no} \xdef\show@Gstride{no} \xdef\show@Istride{no}
+\xdef\show@Estride{no} \xdef\show@Bstride{no} \xdef\show@Tstride{no}
+\xdef\show@itop{no} \xdef\show@etop{no} \xdef\show@TMtop{no}
+\xdef\show@i@HMMTOP{no} \xdef\show@e@HMMTOP{no} \xdef\show@TM@HMMTOP{no}
+\xdef\show@Hsec{no} \xdef\show@Esec{no}
+\xdef\collect@restop{no} \xdef\collect@resttop{no}
+\xdef\collect@resbottom{no} \xdef\collect@resbbottom{no}
+\xdef\tr@nslatetop{} \xdef\tr@nslatettop{}
+\xdef\tr@nslatebottom{} \xdef\tr@nslatebbottom{}
+\xdef\tr@nsseqtop{0} \xdef\tr@nsseqttop{0}
+\xdef\tr@nsseqbottom{0} \xdef\tr@nsseqbbottom{0}
+\xdef\triple@counttop{0} \xdef\triple@countttop{0}
+\xdef\triple@countbottom{0} \xdef\triple@countbbottom{0}
+\xdef\last@@restop{} \xdef\last@@resttop{}
+\xdef\last@@resbottom{} \xdef\last@@resbbottom{}
+\xdef\out@put{y} \xdef\m@p{no}
+\xdef\t@sp@ce{0mm} \xdef\tt@sp@ce{0mm}
+\xdef\b@sp@ce{0mm} \xdef\bb@sp@ce{0mm}
+\xdef\seq@gap@num{0}
+\xdef\h@ndalign{no} \xdef\sep@space{0pt}
+\xdef\c@pshort{n}
+\xdef\bottom@stretch{n} \xdef\bbottom@stretch{n}
+\xdef\c@nscol{} \xdef\c@nssc@le{ColdHot}
+\xdef\collect@cons@colors{no} \xdef\cons@now{no}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% Default parameter settings for the LaTeX ``TeXshade'' package %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% Under any circumstances: %%%%%
+%%%%% %%%%%
+%%%%% DO NOT CHANGE ANY SETTINGS !!! %%%%%
+%%%%% %%%%%
+%%%%% Please define your personal parameter file! Store your new file %%%%%
+%%%%% together with this style-file in the same directory and load the %%%%%
+%%%%% file by naming it as an optional parameter in the `texshade' en- %%%%%
+%%%%% vironment. The file `texshade.def' can be used as a template for %%%%%
+%%%%% the new creation. See the manual for further help. %%%%%
+%%%%% %%%%%
+%%%%% THANK YOU !!! %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\shadingmode{identical} % Shade identical residues only
+\shadingcolors{blues} % Select the blue color scheme for shading
+\constoallseqs % Calculate consensus considering all seqs
+\threshold{50} % Consensus threshold percentage is 50
+\residuesperline{999} % As many residues as possible per line
+\numberingwidth{9999} % Assign space for 4 digit numbering
+\charstretch{1.15} % Stretch character width 1.15fold
+\linestretch{1} % Do not stretch lines
+\gapchar{.} % . is printed in sequence gaps
+\gaprule{0.3pt} % If a rule is printed in gaps use 0.3 pt
+\gapcolors{Black}{White} % Gap symbols appear `Black on White'
+\numberingcolor{Black} % Numbering color is `Black'
+\shownumbering{left} % Show sequence numbering on the left
+\namescolor{Black} % Names' color is `Black'
+\shownames{right} % Show sequence names on the right
+\consensuscolors{Black}{White} % All consensus symbols/letters
+ {Black}{White} % appear `Black on White'
+ {Black}{White} %
+\showconsensus{bottom} % Show consensus line at bottom with
+\defconsensus{{}}{*}{!} % Blank =no match; * =match; ! =all match
+\showleadinggaps % Show gap symbols before sequence start
+\rulercolor{Black} % Ruler's color is `Black'
+\hideruler % Do not show the ruler
+\rulersteps{10} % Ruler ticks every 10 residues
+\legendcolor{Black} % Legend text color is `Black'
+\hidelegend % Do not show the legend
+\alignment{center} % Center alignment on page
+\medsepline % Medium height if separation line is on
+\medblockskip % Medium skip between sequence blocks
+\flexblockspace % Use optimized space between blocks
+\featurerule{0.5ex} % Set feature rule thickness to 1/2 ex
+\bargraphstretch{1} % Do not stretch bars in feature graphs
+\colorscalestretch{1} % Do not stretch color scales in features
+\backtranstext{horizontal} % Horizontal triplets in feature texts
+\backtranslabel{alternating} % Alternating triplets in feature styles
+\setfamily{residues}{tt} % Use typewriter family for residues
+\setseries{residues}{md} % Use normal series for residues
+\setshape {residues}{up} % Use upright shape for residues
+\setsize {residues}{normalsize} % Use normal size for residues
+\setfamily{numbering}{tt} % Use typewriter family for numbering
+\setseries{numbering}{md} % Use normal series for numbering
+\setshape {numbering}{up} % Use upright shape for numbering
+\setsize {numbering}{normalsize} % Use normal size for numbering
+\setfamily{names}{tt} % Use typewriter family for names
+\setseries{names}{md} % Use normal series for names
+\setshape {names}{up} % Use upright shape for names
+\setsize {names}{normalsize} % Use normal size for names
+\setfamily{features}{rm} % Use roman family for feature texts
+\setseries{features}{md} % Use normal series for feature texts
+\setshape {features}{it} % Use italics shape for feature texts
+\setsize {features}{normalsize} % Use normal size for feature texts
+\setfamily{featurestyles}{tt} % Use typewriter family for feature styles
+\setseries{featurestyles}{md} % Use normal series for feature styles
+\setshape {featurestyles}{up} % Use upright shape for feature styles
+\setsize {featurestyles}{normalsize}% Use normal size for feature styles
+\setfamily{legend}{tt} % Use typewriter family for legend texts
+\setseries{legend}{md} % Use normal series for legend texts
+\setshape {legend}{up} % Use upright shape for legend texts
+\setsize {legend}{normalsize} % Use normal size for legend texts
+\tintdefault{medium} % Use medium tint intensity
+\emphdefault{it} % Use italics to emphasize regions
+\showonPHDsec{alpha,beta} % Show helices and strands (PHD input)
+\showonPHDtopo{internal,external,TM}% Show int., ext. and TM's (PHD input)
+\showonHMMTOP{TM} % Show TM's (not int/ext on HMMTOP input)
+\showonSTRIDE{alpha,3-10,pi,beta} % Show helices and strands (STRIDE input)
+\showonDSSP{alpha,3-10,pi,beta} % Show helices and strands (DSSP input)
+\secondcolumnDSSP % Use numbering from 2. column in DSSP
+\appearance{PHDtopo}{internal} % \
+ {bottom}{'-'} % \
+ {int.\ \Alphacount} % |
+\appearance{PHDtopo}{external} % |
+ {top}{,-,} % |
+ {ext.\ \Alphacount} % |
+\appearance{PHDtopo}{TM}{top} % |
+ {box[LightGray]:TM\numcount}{} % |
+\appearance{HMMTOP}{internal} % |
+ {bottom}{'-'} % |
+ {int.\ \Alphacount} % |
+\appearance{HMMTOP}{external} % |
+ {top}{,-,} % |
+ {ext.\ \Alphacount} % |
+\appearance{HMMTOP}{TM}{top} % |
+ {helix}{TM\numcount} % |
+\appearance{PHDsec}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % |
+\appearance{PHDsec}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{STRIDE}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % | Definitions for the appearance of
+\appearance{STRIDE}{3-10}{top} % \
+ {fill:$\circ$}{3$_{10}$} % > secondary structures included from|
+\appearance{STRIDE}{pi} % /
+ {top}{---}{$\pi$} % | PHD-, STRIDE-, or DSSP-files.
+\appearance{STRIDE}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{STRIDE}{bridge} % |
+ {top}{fill:$\uparrow$}{} % |
+\appearance{STRIDE}{turn} % |
+ {top}{,-,}{turn} % |
+\appearance{DSSP}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % |
+\appearance{DSSP}{3-10}{top} % |
+ {fill:$\circ$}{3$_{10}$} % |
+\appearance{DSSP}{pi} % |
+ {top}{---}{$\pi$} % |
+\appearance{DSSP}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{DSSP}{bridge} % |
+ {top}{fill:$\uparrow$}{} % |
+\appearance{DSSP}{turn} % |
+ {top}{,-,}{turn} % |
+\appearance{DSSP}{bend}{top} % /
+ {fill:$\diamond$}{} % /
+
+\pepgroups{FYW,ILVM,RK,DE,GA,ST,NQ} % Amino acid grouping due to similarity
+
+\pepsims{F}{YW} % Y and W are similar to F
+\pepsims{Y}{WF} % W and F are similar to Y
+\pepsims{W}{YF} % Y and F are similar to W
+
+\pepsims{I}{LVM} % L, V and M are similar to I
+\pepsims{L}{VMI} % V, M and I are similar to L
+\pepsims{V}{MIL} % M, I and L are similar to V
+
+\pepsims{R}{KH} % K and H are similar to R
+\pepsims{K}{HR} % H and R are similar to K
+\pepsims{H}{RK} % R and K are similar to H
+
+\pepsims{A}{GS} % G and S are similar to A
+\pepsims{G}{A} % A (but not S) is similar to G
+
+\pepsims{S}{TA} % T and A are similar to S
+\pepsims{T}{S} % S (but not A) is similar to T
+
+\pepsims{D}{EN} % E and N (but not Q) are similar to D
+\pepsims{E}{DQ} % D and Q (but not N) are similar to E
+\pepsims{N}{QD} % Q and D (but not E) are similar to N
+\pepsims{Q}{NE} % N and E (but not D) are similar to Q
+
+\DNAgroups{GAR,CTY} % Nucleotide grouping due to similarity
+
+\DNAsims{A}{GR} % G and R are similar to A
+\DNAsims{G}{AR} % A and R are similar to G
+\DNAsims{R}{AG} % A and G are similar to R
+
+\DNAsims{C}{TY} % T and Y are similar to C
+\DNAsims{T}{CY} % C and Y are similar to T
+\DNAsims{Y}{CT} % C and T are similar to Y
+
+}
+\catcode`\@=12
+%</texshade>
+% \end{macrocode}
+% \subsection{\file{texshade.def}}
+% \begin{macrocode}
+%<*definitions>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% Default parameter settings for the LaTeX ``TeXshade'' package %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% This example file contains all standard settings of the TeXshade %%%%%
+%%%%% package. It can be used as a template for the creation of perso- %%%%%
+%%%%% nal parameter files. All TeXshade user commands are allowed and %%%%%
+%%%%% functional when specified here. %%%%%
+%%%%% %%%%%
+%%%%% To activate these settings for your alignment load this file by %%%%%
+%%%%% naming it as optional parameter at the beginning of the texshade %%%%%
+%%%%% environment, e.g. %%%%%
+%%%%% %%%%%
+%%%%% \begin{texshade}[myparameterfile]{alignmentfile} %%%%%
+%%%%% . %%%%%
+%%%%% . %%%%%
+%%%%% \end{texshade} %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+\shadingmode{identical} % Shade identical residues only
+\shadingcolors{blues} % Select the blue color scheme for shading
+\constoallseqs % Calculate consensus considering all seqs
+\threshold{50} % Consensus threshold percentage is 50
+\residuesperline{999} % As many residues as possible per line
+\numberingwidth{9999} % Assign space for 4 digit numbering
+\charstretch{1.15} % Stretch character width 1.15fold
+\linestretch{1} % Do not stretch lines
+\gapchar{.} % . is printed in sequence gaps
+\gaprule{0.3pt} % If a rule is printed in gaps use 0.3 pt
+\gapcolors{Black}{White} % Gap symbols appear `Black on White'
+\numberingcolor{Black} % Numbering color is `Black'
+\shownumbering{left} % Show sequence numbering on the left
+\namescolor{Black} % Names' color is `Black'
+\shownames{right} % Show sequence names on the right
+\consensuscolors{Black}{White} % All consensus symbols/letters
+ {Black}{White} % appear `Black on White'
+ {Black}{White} %
+\showconsensus{bottom} % Show consensus line at bottom with
+\defconsensus{{}}{*}{!} % Blank =no match; * =match; ! =all match
+\rulercolor{Black} % Ruler's color is `Black'
+\hideruler % Do not show the ruler
+\showleadinggaps % Show gap symbols before sequence start
+\rulersteps{10} % Ruler ticks every 10 residues
+\legendcolor{Black} % Legend text color is `Black'
+\hidelegend % Do not show the legend
+\alignment{center} % Center alignment on page
+\medsepline % Medium height if separation line is on
+\medblockskip % Medium skip between sequence blocks
+\flexblockspace % Use optimized space between blocks
+\featurerule{0.5ex} % Set feature rule thickness to 1/5 ex
+\bargraphstretch{1} % Do not stretch bars in feature graphs
+\colorscalestretch{1} % Do not stretch color scales in features
+\backtranstext{horizontal} % Horizontal triplets in feature texts
+\backtranslabel{alternating} % Alternating triplets in feature styles
+\setfamily{residues}{tt} % Use typewriter family for residues
+\setseries{residues}{md} % Use normal series for residues
+\setshape {residues}{up} % Use upright shape for residues
+\setsize {residues}{normalsize} % Use normal size for residues
+\setfamily{numbering}{tt} % Use typewriter family for numbering
+\setseries{numbering}{md} % Use normal series for numbering
+\setshape {numbering}{up} % Use upright shape for numbering
+\setsize {numbering}{normalsize} % Use normal size for numbering
+\setfamily{names}{tt} % Use typewriter family for names
+\setseries{names}{md} % Use normal series for names
+\setshape {names}{up} % Use upright shape for names
+\setsize {names}{normalsize} % Use normal size for names
+\setfamily{features}{rm} % Use roman family for feature texts
+\setseries{features}{md} % Use normal series for feature texts
+\setshape {features}{it} % Use italics shape for feature texts
+\setsize {features}{normalsize} % Use normal size for feature texts
+\setfamily{legend}{tt} % Use typewriter family for legend texts
+\setseries{legend}{md} % Use normal series for legend texts
+\setshape {legend}{up} % Use upright shape for legend texts
+\setsize {legend}{normalsize} % Use normal size for legend texts
+\tintdefault{medium} % Use medium tint intensity
+\emphdefault{it} % Use italics to emphasize regions
+\showonPHDsec{alpha,beta} % Show helices and strands (PHD input)
+\showonPHDtopo{internal,external,TM}% Show int., ext. and TM's (PHD input)
+\showonHMMTOP{TM} % Show TM's (not int/ext on HMMTOP input)
+\showonSTRIDE{alpha,3-10,pi,beta} % Show helices and strands (STRIDE input)
+\showonDSSP{alpha,3-10,pi,beta} % Show helices and strands (DSSP input)
+\secondcolumnDSSP % Use numbering from 2. column in DSSP
+\appearance{PHDtopo}{internal} % \
+ {bottom}{'-'} % \
+ {int.\ \Alphacount} % |
+\appearance{PHDtopo}{external} % |
+ {top}{,-,} % |
+ {ext.\ \Alphacount} % |
+\appearance{PHDtopo}{TM}{top} % |
+ {box[LightGray]:TM\numcount}{} % |
+\appearance{HMMTOP}{internal} % |
+ {bottom}{---} % |
+ {int.\ \Alphacount} % |
+\appearance{HMMTOP}{external} % |
+ {top}{---} % |
+ {ext.\ \Alphacount} % |
+\appearance{HMMTOP}{TM}{top} % |
+ {helix}{TM\numcount} % |
+\appearance{PHDsec}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % |
+\appearance{PHDsec}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{STRIDE}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % | Definitions for the appearance of
+\appearance{STRIDE}{3-10}{top} % \
+ {fill:$\circ$}{3$_{10}$} % > secondary structures included from|
+\appearance{STRIDE}{pi} % /
+ {top}{---}{$\pi$} % | PHD-, STRIDE-, or DSSP-files.
+\appearance{STRIDE}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{STRIDE}{bridge} % |
+ {top}{fill:$\uparrow$}{} % |
+\appearance{STRIDE}{turn} % |
+ {top}{,-,}{turn} % |
+\appearance{DSSP}{alpha}{top} % |
+ {box:$\alpha$\numcount}{} % |
+\appearance{DSSP}{3-10}{top} % |
+ {fill:$\circ$}{3$_{10}$} % |
+\appearance{DSSP}{pi} % |
+ {top}{---}{$\pi$} % |
+\appearance{DSSP}{beta}{top} % |
+ {-->}{$\beta$\numcount} % |
+\appearance{DSSP}{bridge} % |
+ {top}{fill:$\uparrow$}{} % |
+\appearance{DSSP}{turn} % |
+ {top}{,-,}{turn} % |
+\appearance{DSSP}{bend}{top} % /
+ {fill:$\diamond$}{} % /
+
+
+\pepgroups{FYW,ILVM,RK,DE,GA,ST,NQ} % Amino acid grouping due to similarity
+
+\pepsims{F}{YW} % Y and W are similar to F
+\pepsims{Y}{WF} % W and F are similar to Y
+\pepsims{W}{YF} % Y and F are similar to W
+
+\pepsims{I}{LVM} % L, V and M are similar to I
+\pepsims{L}{VMI} % V, M and I are similar to L
+\pepsims{V}{MIL} % M, I and L are similar to V
+
+\pepsims{R}{KH} % K and H are similar to R
+\pepsims{K}{HR} % H and R are similar to K
+\pepsims{H}{RK} % R and K are similar to H
+
+\pepsims{A}{GS} % G and S are similar to A
+\pepsims{G}{A} % A (but not S) is similar to G
+
+\pepsims{S}{TA} % T and A are similar to S
+\pepsims{T}{S} % S (but not A) is similar to T
+
+\pepsims{D}{EN} % E and N (but not Q) are similar to D
+\pepsims{E}{DQ} % D and Q (but not N) are similar to E
+\pepsims{N}{QD} % Q and D (but not E) are similar to N
+\pepsims{Q}{NE} % N and E (but not D) are similar to Q
+
+
+\DNAgroups{GAR,CTY} % Nucleotide grouping due to similarity
+
+\DNAsims{A}{GR} % G and R are similar to A
+\DNAsims{G}{AR} % A and R are similar to G
+\DNAsims{R}{AG} % A and G are similar to R
+
+\DNAsims{C}{TY} % T and Y are similar to C
+\DNAsims{T}{CY} % C and Y are similar to T
+\DNAsims{Y}{CT} % C and T are similar to Y
+%</definitions>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQPDNA>
+AQPDNA.MSF MSF: 979 Type: N Freitag, 12. Februar 1999 Check: 2594 ..
+Name: AQP1nuc.SEQ Len: 807 Check: 8330 Weight: 1.00
+Name: AQP2nuc.SEQ Len: 813 Check: 7220 Weight: 1.00
+Name: AQP3nuc.SEQ Len: 855 Check: 7590 Weight: 1.00
+Name: AQP4nuc.SEQ Len: 960 Check: 8696 Weight: 1.00
+Name: AQP5nuc.SEQ Len: 795 Check: 758 Weight: 1.00
+//
+ 1 60
+AQP1nuc.SEQ ATGGCCAGCGAAATCAAGAAGAAGC.................TCTTCT........GGAG
+AQP2nuc.SEQ ATGTG....GGAACTCAG.........................ATCCAT...........
+AQP3nuc.SEQ ATG........AACC........GTTGCGGGG.AGATG.....CTCC.............
+AQP4nuc.SEQ ATGAGTGACGGAGCTGCAGCGAGGCGGTGGGGTAAGTGTGGACCTCCCTGCAGCAGAGAG
+AQP5nuc.SEQ ATGAAAAA.GGAGGTGTG.........................CTCCCT...........
+
+ 61 120
+AQP1nuc.SEQ GGC..TGTGGTGGCT.....GAGTTCCTGGCCATGA.CCCTCTTCG..............
+AQP2nuc.SEQ ...................................AGCCTTCTCCCGAGCAGTGCTGGCT
+AQP3nuc.SEQ .ACATCC.....GCTACCGG......CTG.........CTTCGCCA....GGCTCTGGCG
+AQP4nuc.SEQ AGCATCATGGTGGCTTTCAAAGGCGTCTGGACTCAAGCCTTCTGGAAGGCGGTCACAGCA
+AQP5nuc.SEQ ...................................TGCCTTCTTCAAGGCGGTGTTCGCA
+
+ 121 180
+AQP1nuc.SEQ ....TCTTCATCAGCATCGGTTCTGCCCTA...GGCTT.....CAATTACCCACTGGAGA
+AQP2nuc.SEQ GAGTTCTTGGCCACGCTCCTTTTTGTCTTCTTTGGCCTTGGCTCAGCCCTCCA.....GT
+AQP3nuc.SEQ GAGTGCCTGGGGACCCTCATCCTTGTGATGTTCGGCTGTGGTTCCGTGGCTCAA.GTGGT
+AQP4nuc.SEQ GAGTTCCTGGCCATGCTCATCTTTGTTCTGCTCAGCGTGGGATCCACCATTAACTGGGGT
+AQP5nuc.SEQ GAGTTCCTGGCCACCCTCATCTTCGTCTTCTTTGGCCTGGGCTCAGCACTCAA.....GT
+
+ 181 240
+AQP1nuc.SEQ GA...AACCAGACGCTGGTCCA.GGACAATGTGAAGGTGTCACTGGCCTTTGGTCTGAGC
+AQP2nuc.SEQ GGGCCAGCT....CCCCACCCTC...TGTGCTCCAGATCGCCGTGGCCTTTGGTCTGGGC
+AQP3nuc.SEQ GCTCAGCCGAGGGACCCATG.GTGG.CTTCCTCACCATCAACTTGGCTTTTGGCTTCGCT
+AQP4nuc.SEQ GGCTCAGAGAACCCCCTACCTGTGGACATGGTCCTCATCTCCCTCTGCTTTGGACTCAGC
+AQP5nuc.SEQ GGCCCTCGG....CTCTGCCCAC...CATTCTGCAAATCTCAATTGCCTTTGGCCTGGCC
+
+ 241 300
+AQP1nuc.SEQ ATCGCTACTCTGGCCCAAAGTGTGGGTCACATCAGTGGTGCTCACTCCAACCCAGCGGTC
+AQP2nuc.SEQ ATCGGCATCCTGGTTCAGGCTCTGGGCCATGTCAGCGGGGCACACATCAACCCCGCCGTG
+AQP3nuc.SEQ GTCACCCTTGCCATCTTGGTGGCTGGCCAAGTGTCTGGAGCCCACTTGAACCCTGCTGTG
+AQP4nuc.SEQ ATTGCCACCATGGTTCAGTGCTTCGGCCACATCAGCGGTGGCCACATCAACCCAGCGGTG
+AQP5nuc.SEQ ATAGGTACCTTAGCCCAAGCTCTGGGACCTGTGAGTGGTGGCCACATCAATCCAGCCATT
+
+ 301 360
+AQP1nuc.SEQ ACACTGGGGCTTCTGCTCAGCTGTCAGATCAGCATCCTCCGGGCTGTCA.TGTATATCAT
+AQP2nuc.SEQ ACTGTGGCATGCCTGGTGGGTTGCCATGTCTCCTTCCTTCGAGCTGCCT.TCTATGTGGC
+AQP3nuc.SEQ ACCTTTGCAATG.TGCTTCCTGGCACGAGAGCCCTGGATCAAGCTGCCCATCTACACACT
+AQP4nuc.SEQ ACAGTGGCCATGGTGTGCACACGAAAGATCAGCATCGCCAAGTCTGTCT.TCTACATCAC
+AQP5nuc.SEQ ACTCTGGCCCTCTTAATAGGAAACCAGATCTCGCTGCTCCGAGCTGTCT.TCTACGTGGC
+
+ 361 420
+AQP1nuc.SEQ CGCCCAGTGTGTGGGAGCCATCGTTGCCTCCGCCATCCTCTCCGGCATCACCTCCTCCCT
+AQP2nuc.SEQ TGCCCAGCTGCTGGGCGCCGTGGCTGGGGCTGCCATCCTCCATGAGATTAC.TCCAGTAG
+AQP3nuc.SEQ GGCACAGACCCTCGGGGCCTTCTTGGGTGCTGGGATTGTTTTTGGGCT..CTACTA..TG
+AQP4nuc.SEQ TGCGCAGTGCCTGGGGGCCATCATCGGAGCTGGGATCCTCTACCTGGTCAC.ACCCCCCA
+AQP5nuc.SEQ AGCCCAGCTGGTGGGCGCCATTGCTGGGGCAGGCATCCTGTACTGGCTGGC.GCCACTCA
+
+ 421 480
+AQP1nuc.SEQ GCTCGAGAACTCACTTGGCCGA.AATGACCTGGCTCGAGGTGTGAACTCCGGCCAGGGCC
+AQP2nuc.SEQ AAATCCGTGGGGACCTGGCTGTCAATGCTCTCCACAACAACGCCACAGCTGGCCAGGCTG
+AQP3nuc.SEQ ATGCAATCTGGGCCTTTGCTGGCAATGAGCT.........TGTTGTCTCCGGCC.....C
+AQP4nuc.SEQ GCGTGGTGGGAGGATTGGGAGTCACCACGGTTCATGGAAACCTCACTGCTGGCCATGGGC
+AQP5nuc.SEQ ATGCCCGGGGTAACCTGGCCGTCAATGCGCTGAACAACAACACAACGCCTGGCAAGGCCA
+
+ 481 540
+AQP1nuc.SEQ TGGGCATTGAGATCATTGGCACCCTGCAGCTGGTGCTGTGCGT.TCTGGCTACCACTGAC
+AQP2nuc.SEQ TGACTGTAGAGCTCTTCCTGACCATGCAGCTGGTGCTGTGCAT.CTTTGCCTCCACCGAC
+AQP3nuc.SEQ CAATGGCACAGCTGGTATC..TTTGCCACCTATCCCTCTGGACACTTGGATATGGTCAAT
+AQP4nuc.SEQ TCCTGGTGGAGCTAATAATCACTTTCCAGCTGGTATTCACCAT.TTTTGCCAGCTGTGAT
+AQP5nuc.SEQ TGGTGGTGGAGTTAATCTTGACTTTCCAGCTAGCCCTCTGCAT.CTTCTCCTCCACCGAC
+
+ 541 600
+AQP1nuc.SEQ CGGAGGCGCCGAGACTTAGGTGGCTCAGCCCCACTTGCCATTGGCTTGTCTGTGGCTCTT
+AQP2nuc.SEQ GAGCGCCGCGGTGACAACCTGGGTAGCCCTGCCCTCTCCATTGGTTTCTCTGTTACCCTG
+AQP3nuc.SEQ GGCTTCTTTGATCAGTTCATAGGCACAGCAGCCCTTATTGTGTGTGTGCTGGCCATTGTT
+AQP4nuc.SEQ TCCAAACGGACTGATGTTACTGGTTCCGTTGCTTTAGCAATTGGGTTTTCCGTTGCAATT
+AQP5nuc.SEQ TCTCGCCGAACCAGCCCTGTGGGCTCCCCAGCCTTATCCATTGGCTTGTCTGTCACACTG
+
+ 601 660
+AQP1nuc.SEQ GGACACCTGCTGGCCATTGACTACACTGGCTGTGGGATCAACCCTGCCCGGTCATT.TGG
+AQP2nuc.SEQ GGCCACCTCCTTGGGATCTATTTCACCGGTTGCTCCATGAATCCAGCCCGCTCCCT.GGC
+AQP3nuc.SEQ GACC..CTTATAACAACCCTGTGCCCCGGGGCCTGGAGGCCTTCACTGTGGGCCTTGTGG
+AQP4nuc.SEQ GGACATTTGTTTGCAATCAATTATACCGGAGCCAGCATGAATCCAGCTCGATCCTT.TGG
+AQP5nuc.SEQ GGCCATCTTGTGGGGATCTACTTCACCGGCTGTTCCATGAACCCAGCCCGATCTTT.CGG
+
+ 661 720
+AQP1nuc.SEQ CTCTGCTGTGCTCACCCGCAACTTCTCAAAC...CACTGGATTTTCTGGGTGGGACCATT
+AQP2nuc.SEQ TCCAGCAGTTGTCACTGGCAAGTTTGATGA...TCACTGGGTCTTCTGGATCGGACCCCT
+AQP3nuc.SEQ TCCTG.....GTCATTGGGACCTCCATGGGCTTCAATTCTGGCTATGCCGTCAACCCAGC
+AQP4nuc.SEQ CCCTGCAGTTATCATGGGAAACTGGGAAAAC...CACTGGATATATTGGGTTGGACCAAT
+AQP5nuc.SEQ CCCTGCGGTGGTCATGAACCGGTTCAGCCCCTCTCACTGGGTCTTCTGGGTAGGGCCTAT
+
+ 721 780
+AQP1nuc.SEQ CATTGGGAGTGCCCTGGCAGTGCTGATCTATGACTTCATC..CTGGCCCCACGC..AGC.
+AQP2nuc.SEQ GGTGGGCGCCATCATCGGCTCCCTCCTCTACAACTAC..CTGCTGTTC..........CC
+AQP3nuc.SEQ T.....CGTGACTTTGG..ACCTCGCCTTTTCACTGCCCTGGCTGGC......TGGGGTT
+AQP4nuc.SEQ CATAGGCGCTGTGCTGGCAGGTGCACTTTACGAGTATGTCTTCTGTCCTGACGTGGAGCT
+AQP5nuc.SEQ TGTGGGGGCCATGCTGGCGGCCATCCTCTATTTCTAC..CTGCTCTTC..........CC
+
+ 781 840
+AQP1nuc.SEQ ..AGCG.........................ACTTTACAG.............ACCGCAT
+AQP2nuc.SEQ C.....TCGGCAAAG...AGCCTGCAGGAGCGCTTGGCAGTGCTCAAGGG.......CCT
+AQP3nuc.SEQ CAGAAGTC.TTTACGACTGGCC...AGAACTGGTGGTGGGTACCCATCGTCTCTCCACTC
+AQP4nuc.SEQ CAAACGTCGCCTAAAGGAAGCCTTCAGCAAAGCTGCACAGCAGACGAAAGGGAGCTACAT
+AQP5nuc.SEQ C.....TCCTCTCTG...AGCCTCCATGATCGCGTGGCTGTCGTCAAAGG.......CAC
+
+ 841 900
+AQP1nuc.SEQ GAAGGTGTGGACCAGT...GGCCAAGTGGA.....GGAGTATGACCTGGATGC.......
+AQP2nuc.SEQ GGAGCCCGACACCGACTGGGA.......GGAACGTGAAGTGCGG..CGGCGGCAGTCGGT
+AQP3nuc.SEQ CTGGGTTC.CATTGGTGGTGTCTTCGTGT.ACCAGCT..CATGAT.TGGCTGCCACC..T
+AQP4nuc.SEQ GGAGGTGGAGGACAACCGGAGCCAAGTGGAGACAGAAGACTTGATCCTGAAGCCCGGGGT
+AQP5nuc.SEQ ATA...TGA.GCCGG..AGGA.......GGACTGGGAAGATCAT..CGAGAGGAGAGGAA
+
+ 901 960
+AQP1nuc.SEQ ........TGAT.GATATCAACTCCAGGGTGGAGATGAAG....................
+AQP2nuc.SEQ GGAGC......TC..CACTCTCCTCAGAG...................CCTGCCTCGCG.
+AQP3nuc.SEQ GGAGCA.GCCCCCGCCTTCCACT..GAGGCAGAGAATGTGAAGCTGG.CCCACATGAAGC
+AQP4nuc.SEQ GGTGCATGTGATCGACATTGACCGTGGAGACGAGAAGAAGGGGAAGGACTCGTCTGGAGA
+AQP5nuc.SEQ GAAG............ACCATC....GAG........................CTGACG.
+
+ 961 979
+AQP1nuc.SEQ ..........CCCAAATAG
+AQP2nuc.SEQ .GCAGCAAGGCCTG....A
+AQP3nuc.SEQ ACAAGGA..GCAGATCTGA
+AQP4nuc.SEQ GGTATTATCTTCTGTATGA
+AQP5nuc.SEQ .GCA.CA....CTG....A
+
+%</AQPDNA>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQPpro>
+AQPpro.MSF MSF: 356 Type: P Freitag, 12. Februar 1999 Check: 2586 ..
+Name: AQP1.PRO Len: 269 Check: 5367 Weight: 1.00
+Name: AQP2.PRO Len: 271 Check: 6176 Weight: 1.00
+Name: AQP3.PRO Len: 285 Check: 2893 Weight: 1.00
+Name: AQP4.PRO Len: 323 Check: 9737 Weight: 1.00
+Name: AQP5.PRO Len: 265 Check: 8413 Weight: 1.00
+//
+ 1 60
+AQP1.PRO MAS........................EIKKKLFWRAVVAEFLAMTLFVFISIGSALGFN
+AQP2.PRO MW.........................ELRSIAFSRAVLAEFLATLLFVFFGLGSALQWA
+AQP3.PRO M.........NRCG.....EMLHIRYR......LLRQALAECLGTLILVMFGCGSVAQVV
+AQP4.PRO MSDGAAARRWGKCGPPCSRESIMVAFKGVWTQAFWKAVTAEFLAMLIFVLLSVGSTINWG
+AQP5.PRO MK........................KEVCSLAFFKAVFAEFLATLIFVFFGLGSALKWP
+
+ 61 120
+AQP1.PRO YPLERNQTLVQDNVKVSLAFGLSIATLAQSVGHISGAHSNPAVTLGLLLSCQISILRAVM
+AQP2.PRO ...SS....PPSVLQIAVAFGLGIGILVQALGHVSGAHINPAVTVACLVGCHVSFLRAAF
+AQP3.PRO LSRGTHGGF....LTINLAFGFAVTLAILVAGQVSGAHLNPAVTFAMCFLAREPWIKLPI
+AQP4.PRO ...GSENPLPVDMVLISLCFGLSIATMVQCFGHISGGHINPAVTVAMVCTRKISIAKSVF
+AQP5.PRO ...SA....LPTILQISIAFGLAIGTLAQALGPVSGGHINPAITLALLIGNQISLLRAVF
+
+ 121 180
+AQP1.PRO YIIAQCVGAIVASAILSGI..........TSSLLENSLGRNDLARGVNSGQ.....GLGI
+AQP2.PRO YVAAQLLGAVAGAAILHEI..........TPVEIRGDLAVNALHNNATAGQ.....AVTV
+AQP3.PRO YTLAQTLGAFLGAGIVFGLYYDAIWAFAGNELVVSGPNGTAGIFATYPSGHLDMVNGFFD
+AQP4.PRO YITAQCLGAIIGAGILYLV..........TPPSVVGGLGVTTVHGNLTAGH.....GLLV
+AQP5.PRO YVAAQLVGAIAGAGILYWL..........APLNARGNLAVNALNNNTTPGK.....AMVV
+
+ 181 240
+AQP1.PRO EIIGTLQLVLCVLATTDR.RRRDLGGSAPLAIGLSV.ALGHLLAIDYTGCGINPARSFGS
+AQP2.PRO ELFLTMQLVLCIFASTDE.RRGDNLGSPALSIGFSV.TLGHLLGIYFTGCSMNPARSLAP
+AQP3.PRO QFIGTAALIVCVLAIVDPYNNPVPRGLEAFTVGLVVLVIGTSMGFN.SGYAVNPARDFGP
+AQP4.PRO ELIITFQLVFTIFASCDS.KRTDVTGSVALAIGFSV.AIGHLFAINYTGASMNPARSFGP
+AQP5.PRO ELILTFQLALCIFSSTDS.RRTSPVGSPALSIGLSV.TLGHLVGIYFTGCSMNPARSFGP
+
+ 241 300
+AQP1.PRO AVLTR..NFS.N......HWIFWVGPFIGSALAVL..IYDFILAPRSSDFTDRMK.....
+AQP2.PRO AVVTG..KFD.D......HWVFWIGPLVGAIIGSL..LYNYLLFPSAKSLQERL..AVLK
+AQP3.PRO RLFTALAGWGSEVFTTGQNW..WWVPIVSPLLGSIGGVFVYQL.................
+AQP4.PRO AVIMG..NWE.N......HWIYWVGPIIGAVLAGA..LYEYV.FCPDVELKRRLKEAFSK
+AQP5.PRO AVVMN..RFSPS......HWVFWVGPIVGAMLAAI..LYFYLLFPSSLSLHDRV..AVVK
+
+ 301 356
+AQP1.PRO .......VWTS.....GQVEEYDLDAD.......DINSRVEMKPK...........
+AQP2.PRO G.LEPDTDWEEREVRRRQ..SVELHSPQSLPRG...................SKA.
+AQP3.PRO ..................MIGCHLEQPPPSTEAENV.KLAHMKHKE.......QI.
+AQP4.PRO AAQQTKGSYMEVEDNRSQVETEDLILKPGVVHVIDIDRGDEKKGKDSSGEVLSSV.
+AQP5.PRO GTYEPEEDWEDHREERKK..TIELTAH.............................
+
+%</AQPpro>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQP2spec>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% This is a minimal .ALN file--many sequence aligners can produce them %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+AQP2bt SIAFSRAVLAEFLATLLFVFFGLGSALNWPQALPSVLQIAMAFGLAIGTLVQALGHVSGA
+AQP2cf SVAFSRAVFAEFLATLLFVFFGLGSALNWPQALPSVLQIAMAFGLGIGTLVQALGHVSGA
+AQP2dd SIAFSRAVFSEFLATLLFVFFGLGSALNWPQALPSVLQIAMAFGLAIGTLVQALGHISGA
+AQP2ec SIAFSRAVLAEFLATLLFVFFGLGSALNWPQAMPSVLQIAMAFGLAIGTLVQALGHVSGA
+AQP2em SIAFSRAVFSEFLATLLFVFFGLGSALNWPQALPSVLQIAMAFGLAIGTLVQTLGHISGA
+
+
+AQP2bt HINPAVTVACLVGCHVSFLRAVFYVAAQLLGAVAGAALLHEITPPAIRG
+AQP2cf HINPAVTVACLVGCHVSFLRAAFYVAAQLLGAVAGAALLHEITPPHVRG
+AQP2dd HINPAVTVACLVGCHVSFLRATFYLAAQLLGAVAGAAILHEITPPDIRG
+AQP2ec HINPAVTVACLVGCHVSFLRAAFYVAAQLLGAVAGAALLHEITPPDIRR
+AQP2em HINPAVTVACLVGCHVSFLRATFYLAAQLLGAVAGAALLHELTPPDIRG
+
+%</AQP2spec>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQP1topo>
+\feature{bottom}{1}{1..14}{'-'}{int.\ A}
+\feature{top}{1}{15..32}{box[LightGray]:TM1}{}
+\feature{top}{1}{33..49}{,-,}{ext.\ B}
+\feature{top}{1}{50..68}{box[LightGray]:TM2}{}
+\feature{bottom}{1}{69..81}{'-'}{int.\ C}
+\feature{top}{1}{82..106}{box[LightGray]:TM3}{}
+\feature{top}{1}{107..136}{,-,}{ext.\ D}
+\feature{top}{1}{137..154}{box[LightGray]:TM4}{}
+\feature{bottom}{1}{155..168}{'-'}{int.\ E}
+\feature{top}{1}{169..186}{box[LightGray]:TM5}{}
+\feature{top}{1}{187..211}{,-,}{ext.\ F}
+\feature{top}{1}{212..230}{box[LightGray]:TM6}{}
+\feature{bottom}{1}{231..269}{'-'}{int.\ G}
+%</AQP1topo>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQP1PHD>
+
+From phd@EMBL-Heidelberg.de Wed Nov 25 10:24:25 1998
+Date: Tue, 24 Nov 1998 17:45:25 +0100
+From: Protein Prediction <phd@EMBL-Heidelberg.de>
+To: eric.beitz@uni-tuebingen.de
+Subject: PredictProtein
+
+
+
+
+The following information has been received by the server:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+________________________________________________________________________________
+
+reference predict_h25873 (Tue Nov 24 17:43:21 MET 1998)
+from eric.beitz@uni-tuebingen.de
+password(###)
+resp MAIL
+orig HTML
+prediction of: -secondary structure (PHDsec)-solvent accessibility (PHDacc)-
+return msf format
+# no description
+MASEIKKKLFWRAVVAEFLAMTLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSIATLAQSVGHISGAHSNPAVT
+LGLLLSCQISILRAVMYIIAQCVGAIVASAILSGITSSLLENSLGRNDLARGVNSGQGLGIEIIGTLQLVLCVLATTDRR
+RRDLGGSAPLAIGLSVALGHLLAIDYTGCGINPARSFGSAVLTRNFSNHWIFWVGPFIGSALAVLIYDFILAPRSSDFTD
+RMKVWTSGQVEEYDLDADDINSRVEMKPK
+
+________________________________________________________________________________
+
+
+
+
+
+Result of PROSITE search (Amos Bairoch):
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+please quote: A Bairoch, P Bucher & K Hofmann: The PROSITE database,
+its status in 1997. Nucl. Acids Res., 1997, 25, 217-221.
+
+________________________________________________________________________________
+
+
+--------------------------------------------------------
+
+--------------------------------------------------------
+
+Pattern-ID: ASN_GLYCOSYLATION PS00001 PDOC00001
+Pattern-DE: N-glycosylation site
+Pattern: N[^P][ST][^P]
+ 42 NQTL
+ 250 NFSN
+
+Pattern-ID: GLYCOSAMINOGLYCAN PS00002 PDOC00002
+Pattern-DE: Glycosaminoglycan attachment site
+Pattern: SG.G
+ 135 SGQG
+
+Pattern-ID: PKC_PHOSPHO_SITE PS00005 PDOC00005
+Pattern-DE: Protein kinase C phosphorylation site
+Pattern: [ST].[RK]
+ 157 TDR
+ 398 TDR
+
+Pattern-ID: CK2_PHOSPHO_SITE PS00006 PDOC00006
+Pattern-DE: Casein kinase II phosphorylation site
+Pattern: [ST].{2}[DE]
+ 118 SLLE
+ 383 SRVE
+
+Pattern-ID: MYRISTYL PS00008 PDOC00008
+Pattern-DE: N-myristoylation site
+Pattern: G[^EDRKHPFYW].{2}[STAGCN][^P]
+ 30 GSALGF
+ 92 GLSIAT
+ 179 GLLLSC
+ 288 GAIVAS
+ 407 GITSSL
+ 544 GVNSGQ
+ 722 GLSVAL
+ 917 GINPAR
+ 1141 GSALAV
+
+Pattern-ID: PROKAR_LIPOPROTEIN PS00013 PDOC00013
+Pattern-DE: Prokaryotic membrane lipoprotein lipid attachment site
+Pattern: [^DERK]{6}[LIVMFWSTAG]{2}[LIVMFYSTAGCQ][AGS]C
+ 77 PAVTLGLLLSC
+
+Pattern-ID: MIP PS00221 PDOC00193
+Pattern-DE: MIP family signature
+Pattern: [HNQA].NP[STA][LIVMF][ST][LIVMF][GSTAFY]
+ 74 HSNPAVTLG
+
+
+
+
+________________________________________________________________________________
+
+
+
+
+
+Result of ProDom domain search (Corpet, Gouzy, Kahn):
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- please quote: ELL Sonnhammer & D Kahn, Prot. Sci., 1994, 3, 482-492
+
+________________________________________________________________________________
+
+
+--- ------------------------------------------------------------
+--- Results from running BLAST against PRODOM domains
+---
+--- PLEASE quote:
+--- F Corpet, J Gouzy, D Kahn (1998). The ProDom database
+--- of protein domain families. Nucleic Ac Res 26:323-326.
+---
+--- BEGIN of BLASTP output
+BLASTP 1.4.7 [16-Oct-94] [Build 17:06:52 Oct 31 1994]
+
+Reference: Altschul, Stephen F., Warren Gish, Webb Miller, Eugene W. Myers,
+and David J. Lipman (1990). Basic local alignment search tool. J. Mol. Biol.
+215:403-10.
+
+Query= prot (#) ppOld, no description /home/phd/server/work/predict_h25873
+ (269 letters)
+
+Database: /home/phd/ut/prodom/prodom_34_2
+ 53,597 sequences; 6,740,067 total letters.
+Searching..................................................done
+
+ Smallest
+ Sum
+ High Probability
+Sequences producing High-scoring Segment Pairs: Score P(N) N
+
+ 390 p34.2 (45) MIP(6) AQP1(4) GLPF(4) // PROTEIN INTRIN... 270 2.0e-32 1
+ 45663 p34.2 (1) AQPZ_ECOLI // AQUAPORIN Z. 90 3.2e-13 2
+ 45611 p34.2 (1) AQP2_HUMAN // AQUAPORIN-CD (AQP-CD) (WAT... 136 6.0e-13 1
+ 304 p34.2 (61) AQP2(10) GLPF(6) MIP(5) // PROTEIN CHANN... 121 9.2e-11 1
+ 45607 p34.2 (1) PMIP_NICAL // POLLEN-SPECIFIC MEMBRANE I... 80 1.2e-07 2
+ 45606 p34.2 (1) BIB_DROME // NEUROGENIC PROTEIN BIG BRAIN. 80 1.2e-05 2
+ 2027 p34.2 (15) GLPF(9) AQP3(2) // PROTEIN FACILITATOR ... 60 3.4e-05 2
+ 45615 p34.2 (1) GLPF_STRPN // GLYCEROL UPTAKE FACILITATO... 63 0.024 1
+ 45638 p34.2 (1) AQP5_HUMAN // AQUAPORIN 5. 61 0.044 1
+
+
+
+>390 p34.2 (45) MIP(6) AQP1(4) GLPF(4) // PROTEIN INTRINSIC CHANNEL WATER
+ AQUAPORIN TONOPLAST MEMBRANE FOR PLASMA LENS
+ Length = 88
+
+ Score = 270 (125.3 bits), Expect = 2.0e-32, P = 2.0e-32
+ Identities = 47/67 (70%), Positives = 56/67 (83%)
+
+Query: 156 TTDRRRRDLGGSAPLAIGLSVALGHLLAIDYTGCGINPARSFGSAVLTRNFSNHWIFWVG 215
+ T D+RR +GGSAPL IG SVALGHL+ I YTGCG+NPARSFG AV+T NF+NHW++WVG
+Sbjct: 22 TDDKRRGSVGGSAPLPIGFSVALGHLIGIPYTGCGMNPARSFGPAVVTGNFTNHWVYWVG 81
+
+Query: 216 PFIGSAL 222
+ P IG+ L
+Sbjct: 82 PIIGAVL 88
+
+ Score = 95 (44.1 bits), Expect = 2.3e-06, P = 2.3e-06
+ Identities = 20/33 (60%), Positives = 23/33 (69%)
+
+Query: 136 GQGLGIEIIGTLQLVLCVLATTDRRRRDLGGSA 168
+ GQ L +EIIGT QLV CV ATTD +RR G +
+Sbjct: 1 GQNLVVEIIGTFQLVYCVFATTDDKRRGSVGGS 33
+
+
+>45663 p34.2 (1) AQPZ_ECOLI // AQUAPORIN Z.
+ Length = 96
+
+ Score = 90 (41.8 bits), Expect = 3.2e-13, Sum P(2) = 3.2e-13
+ Identities = 18/36 (50%), Positives = 25/36 (69%)
+
+Query: 166 GSAPLAIGLSVALGHLLAIDYTGCGINPARSFGSAV 201
+ G AP+AIGL++ L HL++I T +NPARS A+
+Sbjct: 25 GFAPIAIGLALTLIHLISIPVTNTSVNPARSTAVAI 60
+
+ Score = 63 (29.2 bits), Expect = 3.2e-13, Sum P(2) = 3.2e-13
+ Identities = 11/25 (44%), Positives = 14/25 (56%)
+
+Query: 210 WIFWVGPFIGSALAVLIYDFILAPR 234
+ W FWV P +G + LIY +L R
+Sbjct: 71 WFFWVVPIVGGIIGGLIYRTLLEKR 95
+
+
+>45611 p34.2 (1) AQP2_HUMAN // AQUAPORIN-CD (AQP-CD) (WATER CHANNEL PROTEIN FOR
+ RENAL COLLECTING DUCT) (ADH WATER CHANNEL) (AQUAPORIN 2) (COLLECTING DUCT
+ WATER CHANNEL PROTEIN) (WCH-CD).
+ Length = 49
+
+ Score = 136 (63.1 bits), Expect = 6.0e-13, P = 6.0e-13
+ Identities = 23/42 (54%), Positives = 34/42 (80%)
+
+Query: 50 VKVSLAFGLSIATLAQSVGHISGAHSNPAVTLGLLLSCQISI 91
+ +++++AFGL I TL Q++GHISGAH NPAVT+ L+ C +S+
+Sbjct: 8 LQIAMAFGLGIGTLVQALGHISGAHINPAVTVACLVGCHVSV 49
+
+
+>304 p34.2 (61) AQP2(10) GLPF(6) MIP(5) // PROTEIN CHANNEL WATER AQUAPORIN
+ INTRINSIC DUCT COLLECTING FOR TONOPLAST WCH-CD
+ Length = 43
+
+ Score = 121 (56.1 bits), Expect = 9.2e-11, P = 9.2e-11
+ Identities = 24/43 (55%), Positives = 31/43 (72%)
+
+Query: 70 ISGAHSNPAVTLGLLLSCQISILRAVMYIIAQCVGAIVASAIL 112
+ ISG H NPAVT+GLL+ + LRAV YI AQ +GA+ +A+L
+Sbjct: 1 ISGGHINPAVTIGLLIGGRFPFLRAVFYIAAQLLGAVAGAALL 43
+
+
+>45607 p34.2 (1) PMIP_NICAL // POLLEN-SPECIFIC MEMBRANE INTEGRAL PROTEIN.
+ Length = 69
+
+ Score = 80 (37.1 bits), Expect = 1.2e-07, Sum P(2) = 1.2e-07
+ Identities = 17/54 (31%), Positives = 32/54 (59%)
+
+Query: 149 LVLCVLATTDRRRRDLGGSAPLAIGLSVALGHLLAIDYTGCGINPARSFGSAVL 202
+ L++ V++ R +G A +A+G+++ L +A +G +NPARS G A++
+Sbjct: 13 LLMFVISGVATDDRAIGQVAGIAVGMTITLNVFVAGPISGASMNPARSIGPAIV 66
+
+ Score = 34 (15.8 bits), Expect = 1.2e-07, Sum P(2) = 1.2e-07
+ Identities = 8/18 (44%), Positives = 11/18 (61%)
+
+Query: 136 GQGLGIEIIGTLQLVLCV 153
+ GQ L IEII + L+ +
+Sbjct: 1 GQSLAIEIIISFLLMFVI 18
+
+
+>45606 p34.2 (1) BIB_DROME // NEUROGENIC PROTEIN BIG BRAIN.
+ Length = 119
+
+ Score = 80 (37.1 bits), Expect = 1.2e-05, Sum P(2) = 1.2e-05
+ Identities = 15/34 (44%), Positives = 24/34 (70%)
+
+Query: 1 MASEIKKKLFWRAVVAEFLAMTLFVFISIGSALG 34
+ M +EI+ FWR++++E LA ++VFI G+A G
+Sbjct: 55 MQAEIRTLEFWRSIISECLASFMYVFIVCGAAAG 88
+
+ Score = 39 (18.1 bits), Expect = 1.2e-05, Sum P(2) = 1.2e-05
+ Identities = 9/17 (52%), Positives = 12/17 (70%)
+
+Query: 53 SLAFGLSIATLAQSVGH 69
+ +LA GL++ATL Q H
+Sbjct: 103 ALASGLAMATLTQCFLH 119
+
+
+>2027 p34.2 (15) GLPF(9) AQP3(2) // PROTEIN FACILITATOR GLYCEROL UPTAKE
+ AQUAPORIN DIFFUSION UPTAKE/EFFLUX PEPX 5'REGION ORF1
+ Length = 55
+
+ Score = 60 (27.8 bits), Expect = 3.4e-05, Sum P(2) = 3.4e-05
+ Identities = 17/46 (36%), Positives = 20/46 (43%)
+
+Query: 156 TTDRRRRDLGGSAPLAIGLSVALGHLLAIDYTGCGINPARSFGSAV 201
+ T D GG PL +G V + TG INPAR FG +
+Sbjct: 10 TDDGNNVPSGGLHPLMVGFLVMGIGMSLGGTTGYAINPARDFGPRI 55
+
+ Score = 37 (17.2 bits), Expect = 3.4e-05, Sum P(2) = 3.4e-05
+ Identities = 7/10 (70%), Positives = 8/10 (80%)
+
+Query: 149 LVLCVLATTD 158
+ L+ CVLA TD
+Sbjct: 2 LIACVLALTD 11
+
+
+>45615 p34.2 (1) GLPF_STRPN // GLYCEROL UPTAKE FACILITATOR PROTEIN.
+ Length = 26
+
+ Score = 63 (29.2 bits), Expect = 0.025, P = 0.024
+ Identities = 13/23 (56%), Positives = 18/23 (78%)
+
+Query: 205 NFSNHWIFWVGPFIGSALAVLIY 227
+ ++S WI VGP IG+ALAVL++
+Sbjct: 1 DWSYAWIPVVGPVIGAALAVLVF 23
+
+
+>45638 p34.2 (1) AQP5_HUMAN // AQUAPORIN 5.
+ Length = 27
+
+ Score = 61 (28.3 bits), Expect = 0.045, P = 0.044
+ Identities = 11/19 (57%), Positives = 18/19 (94%)
+
+Query: 50 VKVSLAFGLSIATLAQSVG 68
+ ++++LAFGL+I TLAQ++G
+Sbjct: 8 LQIALAFGLAIGTLAQALG 26
+
+
+Parameters:
+ E=0.1
+ B=500
+
+ V=500
+ -ctxfactor=1.00
+
+ Query ----- As Used ----- ----- Computed ----
+ Frame MatID Matrix name Lambda K H Lambda K H
+ +0 0 BLOSUM62 0.322 0.138 0.394 same same same
+
+ Query
+ Frame MatID Length Eff.Length E S W T X E2 S2
+ +0 0 269 269 0.10 69 3 11 22 0.22 33
+
+
+Statistics:
+ Query Expected Observed HSPs HSPs
+ Frame MatID High Score High Score Reportable Reported
+ +0 0 59 (27.4 bits) 270 (125.3 bits) 14 14
+
+ Query Neighborhd Word Excluded Failed Successful Overlaps
+ Frame MatID Words Hits Hits Extensions Extensions Excluded
+ +0 0 5349 3124825 609708 2510548 4569 2
+
+ Database: /home/phd/ut/prodom/prodom_34_2
+ Release date: unknown
+ Posted date: 12:24 PM MET DST May 06, 1998
+ # of letters in database: 6,740,067
+ # of sequences in database: 53,597
+ # of database sequences satisfying E: 9
+ No. of states in DFA: 564 (111 KB)
+ Total size of DFA: 226 KB (256 KB)
+ Time to generate neighborhood: 0.03u 0.00s 0.03t Real: 00:00:00
+ Time to search database: 9.80u 0.03s 9.83t Real: 00:00:10
+ Total cpu time: 9.90u 0.06s 9.96t Real: 00:00:10
+--- END of BLASTP output
+--- ------------------------------------------------------------
+---
+--- Again: these results were obtained based on the domain data-
+--- base collected by Daniel Kahn and his coworkers in Toulouse.
+---
+--- PLEASE quote:
+--- F Corpet, J Gouzy, D Kahn (1998). The ProDom database
+--- of protein domain families. Nucleic Ac Res 26:323-326.
+---
+--- The general WWW page is on:
+---- ---------------------------------------
+--- http://www.toulouse.inra.fr/prodom.html
+---- ---------------------------------------
+---
+--- For WWW graphic interfaces to PRODOM, in particular for your
+--- protein family, follow the following links (each line is ONE
+--- single link for your protein!!):
+---
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=390 ==> multiple alignment, consensus, PDB and PROSITE links of domain 390
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=390 ==> graphical output of all proteins having domain 390
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45663 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45663
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45663 ==> graphical output of all proteins having domain 45663
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45611 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45611
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45611 ==> graphical output of all proteins having domain 45611
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=304 ==> multiple alignment, consensus, PDB and PROSITE links of domain 304
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=304 ==> graphical output of all proteins having domain 304
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45607 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45607
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45607 ==> graphical output of all proteins having domain 45607
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45606 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45606
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45606 ==> graphical output of all proteins having domain 45606
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=2027 ==> multiple alignment, consensus, PDB and PROSITE links of domain 2027
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=2027 ==> graphical output of all proteins having domain 2027
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45615 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45615
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45615 ==> graphical output of all proteins having domain 45615
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom1=45638 ==> multiple alignment, consensus, PDB and PROSITE links of domain 45638
+http://www.toulouse.inra.fr/prodom/cgi-bin/ReqProdomII.pl?id_dom2=45638 ==> graphical output of all proteins having domain 45638
+---
+--- NOTE: if you want to use the link, make sure the entire line
+--- is pasted as URL into your browser!
+---
+--- END of PRODOM
+--- ------------------------------------------------------------
+
+________________________________________________________________________________
+
+
+--- Database used for sequence comparison:
+--- SEQBASE RELEASE 34.0 OF EMBL/SWISS-PROT WITH 59021 SEQUENCES
+
+
+
+
+The alignment that has been used as input to the network is:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+________________________________________________________________________________
+
+--- ------------------------------------------------------------
+--- MAXHOM multiple sequence alignment
+--- ------------------------------------------------------------
+---
+--- MAXHOM ALIGNMENT HEADER: ABBREVIATIONS FOR SUMMARY
+--- ID : identifier of aligned (homologous) protein
+--- STRID : PDB identifier (only for known structures)
+--- PIDE : percentage of pairwise sequence identity
+--- WSIM : percentage of weighted similarity
+--- LALI : number of residues aligned
+--- NGAP : number of insertions and deletions (indels)
+--- LGAP : number of residues in all indels
+--- LSEQ2 : length of aligned sequence
+--- ACCNUM : SwissProt accession number
+--- NAME : one-line description of aligned protein
+---
+--- MAXHOM ALIGNMENT HEADER: SUMMARY
+ID STRID IDE WSIM LALI NGAP LGAP LEN2 ACCNUM NAME
+aqp1_rat 100 100 269 0 0 269 P29975 PROXIMAL TUBULE) (AQUAPOR
+aqp1_mouse 98 99 269 0 0 269 Q02013 PROXIMAL TUBULE) (AQUAPOR
+aqp1_human 93 97 269 0 0 269 P29972 PROXIMAL TUBULE) (AQUAPOR
+aqp1_bovin 90 95 269 1 2 271 P47865 PROXIMAL TUBULE) (AQUAPOR
+aqp1_sheep 90 94 269 2 3 272 P56401 PROXIMAL TUBULE) (AQUAPOR
+aqpa_ranes 78 89 268 2 5 272 P50501 AQUAPORIN FA-CHIP.
+aqp2_dasno 49 73 109 1 7 109 P79164 PROTEIN) (WCH-CD) (FRAGME
+aqp2_bovin 49 73 109 1 7 109 P79099 PROTEIN) (WCH-CD) (FRAGME
+aqp2_canfa 48 72 109 1 7 109 P79144 PROTEIN) (WCH-CD) (FRAGME
+aqp2_rabit 48 73 109 1 7 109 P79213 PROTEIN) (WCH-CD) (FRAGME
+aqp2_elema 47 72 109 1 7 109 P79168 PROTEIN) (WCH-CD) (FRAGME
+aqp2_horse 47 72 109 1 7 109 P79165 PROTEIN) (WCH-CD) (FRAGME
+aqp2_proha 47 73 109 1 7 109 P79229 PROTEIN) (WCH-CD) (FRAGME
+mip_rat 46 73 259 1 7 261 P09011 LENS FIBER MAJOR INTRINSI
+aqp2_oryaf 46 72 109 1 7 109 P79200 PROTEIN) (WCH-CD) (FRAGME
+mip_mouse 46 73 261 1 7 263 P51180 LENS FIBER MAJOR INTRINSI
+mip_ranpi 45 73 261 1 7 263 Q06019 LENS FIBER MAJOR INTRINSI
+mip_bovin 45 73 261 1 7 263 P06624 LENS FIBER MAJOR INTRINSI
+mip_human 45 73 261 1 7 263 P30301 LENS FIBER MAJOR INTRINSI
+mip_chick 45 72 110 1 1 112 P28238 LENS FIBER MAJOR INTRINSI
+aqp5_rat 44 71 262 2 8 265 P47864 AQUAPORIN 5.
+aqp5_human 44 71 262 2 8 265 P55064 AQUAPORIN 5.
+aqp2_human 44 72 261 2 8 271 P41181 PROTEIN) (WCH-CD).
+aqp4_human 43 70 266 2 5 323 P55087 AQUAPORIN 4 (WCH4) (MERCU
+aqp4_rat 43 70 266 2 5 323 P47863 AQUAPORIN 4 (WCH4) (MERCU
+aqp4_mouse 43 69 265 3 6 322 P55088 AQUAPORIN 4 (WCH4) (MERCU
+aqp2_rat 42 71 261 2 8 271 P34080 PROTEIN) (WCH-CD).
+aqp2_mouse 42 71 261 2 8 271 P56402 PROTEIN) (WCH-CD).
+wc2a_arath 42 67 248 4 12 287 P43286 PLASMA MEMBRANE INTRINSIC
+aqp6_human 42 68 260 2 9 282 Q13520 AQUAPORIN 6 (AQUAPORIN-2
+wc2c_arath 41 66 248 4 12 285 P30302 INTRINSIC PROTEIN) (WSI-T
+wc2b_arath 41 66 248 4 12 285 P43287 PLASMA MEMBRANE INTRINSIC
+wc1c_arath 41 65 238 4 10 286 Q08733 (TMP-B).
+wc1b_arath 41 65 238 4 10 286 Q06611 (TMP-A).
+tipw_lyces 40 65 237 4 10 286 Q08451 (RIPENING-ASSOCIATED MEMB
+wc1a_arath 40 64 238 4 10 286 P43285 PLASMA MEMBRANE INTRINSIC
+tipw_pea 40 64 237 4 11 289 P25794 RESPONSIVE PROTEIN 7A).
+tipa_arath 38 64 250 3 9 268 P26587 TONOPLAST INTRINSIC PROTE
+aqua_atrca 38 64 246 4 10 282 P42767 AQUAPORIN.
+dip_antma 38 65 242 2 4 250 P33560 PROBABLE TONOPLAST INTRIN
+aqpz_ecoli 37 59 220 4 17 231 P48838 AQUAPORIN Z (BACTERIAL NO
+tip2_tobac 37 64 242 2 4 250 P24422 TONOPLAST INTRINSIC PROTE
+tip1_tobac 37 64 242 2 4 250 P21653 TONOPLAST INTRINSIC PROTE
+tipg_arath 33 62 241 2 4 251 P25818 TONOPLAST INTRINSIC PROTE
+bib_drome 33 60 260 4 10 700 P23645 NEUROGENIC PROTEIN BIG BR
+tipr_arath 33 62 243 2 4 253 P21652 TONOPLAST INTRINSIC PROTE
+tipa_phavu 33 62 246 2 4 256 P23958 TONOPLAST INTRINSIC PROTE
+tipg_orysa 32 62 240 2 5 250 P50156 TONOPLAST INTRINSIC PROTE
+---
+--- MAXHOM ALIGNMENT: IN MSF FORMAT
+MSF of: /home/phd/server/work/predict_h25873-22040.hssp from: 1 to: 269
+ /home/phd/server/work/predict_h25873-22040.msfRet MSF: 269 Type: P 24-Nov-98 17:44:5 Check: 3448 ..
+
+
+ Name: predict_h258 Len: 269 Check: 8331 Weight: 1.00
+ Name: aqp1_rat Len: 269 Check: 8331 Weight: 1.00
+ Name: aqp1_mouse Len: 269 Check: 7552 Weight: 1.00
+ Name: aqp1_human Len: 269 Check: 6501 Weight: 1.00
+ Name: aqp1_bovin Len: 269 Check: 7067 Weight: 1.00
+ Name: aqp1_sheep Len: 269 Check: 7582 Weight: 1.00
+ Name: aqpa_ranes Len: 269 Check: 4844 Weight: 1.00
+ Name: aqp2_dasno Len: 269 Check: 8933 Weight: 1.00
+ Name: aqp2_bovin Len: 269 Check: 9649 Weight: 1.00
+ Name: aqp2_canfa Len: 269 Check: 8990 Weight: 1.00
+ Name: aqp2_rabit Len: 269 Check: 8787 Weight: 1.00
+ Name: aqp2_elema Len: 269 Check: 9381 Weight: 1.00
+ Name: aqp2_horse Len: 269 Check: 8993 Weight: 1.00
+ Name: aqp2_proha Len: 269 Check: 8855 Weight: 1.00
+ Name: mip_rat Len: 269 Check: 9773 Weight: 1.00
+ Name: aqp2_oryaf Len: 269 Check: 8554 Weight: 1.00
+ Name: mip_mouse Len: 269 Check: 9723 Weight: 1.00
+ Name: mip_ranpi Len: 269 Check: 5937 Weight: 1.00
+ Name: mip_bovin Len: 269 Check: 1430 Weight: 1.00
+ Name: mip_human Len: 269 Check: 372 Weight: 1.00
+ Name: mip_chick Len: 269 Check: 4658 Weight: 1.00
+ Name: aqp5_rat Len: 269 Check: 9033 Weight: 1.00
+ Name: aqp5_human Len: 269 Check: 6547 Weight: 1.00
+ Name: aqp2_human Len: 269 Check: 6209 Weight: 1.00
+ Name: aqp4_human Len: 269 Check: 2589 Weight: 1.00
+ Name: aqp4_rat Len: 269 Check: 4412 Weight: 1.00
+ Name: aqp4_mouse Len: 269 Check: 2845 Weight: 1.00
+ Name: aqp2_rat Len: 269 Check: 5748 Weight: 1.00
+ Name: aqp2_mouse Len: 269 Check: 6526 Weight: 1.00
+ Name: wc2a_arath Len: 269 Check: 4866 Weight: 1.00
+ Name: aqp6_human Len: 269 Check: 9404 Weight: 1.00
+ Name: wc2c_arath Len: 269 Check: 6187 Weight: 1.00
+ Name: wc2b_arath Len: 269 Check: 7328 Weight: 1.00
+ Name: wc1c_arath Len: 269 Check: 8575 Weight: 1.00
+ Name: wc1b_arath Len: 269 Check: 9544 Weight: 1.00
+ Name: tipw_lyces Len: 269 Check: 9283 Weight: 1.00
+ Name: wc1a_arath Len: 269 Check: 598 Weight: 1.00
+ Name: tipw_pea Len: 269 Check: 9253 Weight: 1.00
+ Name: tipa_arath Len: 269 Check: 6544 Weight: 1.00
+ Name: aqua_atrca Len: 269 Check: 2848 Weight: 1.00
+ Name: dip_antma Len: 269 Check: 9619 Weight: 1.00
+ Name: aqpz_ecoli Len: 269 Check: 5641 Weight: 1.00
+ Name: tip2_tobac Len: 269 Check: 490 Weight: 1.00
+ Name: tip1_tobac Len: 269 Check: 622 Weight: 1.00
+ Name: tipg_arath Len: 269 Check: 3231 Weight: 1.00
+ Name: bib_drome Len: 269 Check: 7687 Weight: 1.00
+ Name: tipr_arath Len: 269 Check: 4476 Weight: 1.00
+ Name: tipa_phavu Len: 269 Check: 5563 Weight: 1.00
+ Name: tipg_orysa Len: 269 Check: 3537 Weight: 1.00
+
+//
+
+
+ 1 50
+predict_h258 MASEIKKKLF WRAVVAEFLA MTLFVFISIG SALGFNYPLE RNQTLVQDNV
+aqp1_rat MASEIKKKLF WRAVVAEFLA MTLFVFISIG SALGFNYPLE RNQTLVQDNV
+aqp1_mouse MASEIKKKLF WRAVVAEFLA MTLFVFISIG SALGFNYPLE RNQTLVQDNV
+aqp1_human MASEFKKKLF WRAVVAEFLA TTLFVFISIG SALGFKYPVG NNQTAVQDNV
+aqp1_bovin MASEFKKKLF WRAVVAEFLA MILFIFISIG SALGFHYPIK SNQTtvQDNV
+aqp1_sheep MASEFKKKLF WRAVVAEFLA MILFIFISIG SALGFHYPIK SNQTtvQDNV
+aqpa_ranes MASEFKKKAF WRAVIAEFLA MILFVFISIG AALGFNFPIE EKANQtqDIV
+aqp2_dasno ......SVAF SRAVLAEFLA TLIFVFFGLG SALSWPQALP S.......VL
+aqp2_bovin ......SIAF SRAVLAEFLA TLLFVFFGLG SALNWPQALP S.......VL
+aqp2_canfa ......SVAF SRAVFAEFLA TLLFVFFGLG SALNWPQALP S.......VL
+aqp2_rabit ......SIAF SRAVFAEFLA TLLFVFFGLG SALNWPSALP S.......TL
+aqp2_elema ......SIAF SRAVFSEFLA TLLFVFFGLG SALNWPQALP S.......VL
+aqp2_horse ......SIAF SRAVLAEFLA TLLFVFFGLG SALNWPQAMP S.......VL
+aqp2_proha ......SIAF SRAVLSEFLA TLLFVFFGLG SALNWPQALP S.......VL
+mip_rat ...ELRSASF WRAIFAEFFA TLFYVFFGLG SSLRWA.... ...PGPLHVL
+aqp2_oryaf ......SIAF SKAVFSEFLA TLLFVFFGLG SALNWPQALP S.......GL
+mip_mouse .MWELRSASF WRAIFAEFFA TLFYVFFGLG ASLRWA.... ...PGPLHVL
+mip_ranpi .MWEFRSFSF WRAVFAEFFG TMFYVFFGLG ASLKWAAGPA .......NVL
+mip_bovin .MWELRSASF WRAICAEFFA SLFYVFFGLG ASLRWA.... ...PGPLHVL
+mip_human .MWELRSASF WRAIFAEFFA TLFYVFFGLG SSLRWA.... ...PGPLHVL
+mip_chick .......... .......... .......... .......... ..........
+aqp5_rat MKKEVCSLAF FKAVFAEFLA TLIFVFFGLG SALKWPSALP T.......IL
+aqp5_human MKKEVCSVAF LKAVFAEFLA TLIFVFFGLG SALKWPSALP T.......IL
+aqp2_human .MWELRSIAF SRAVFAEFLA TLLFVFFGLG SALNWPQALP S.......VL
+aqp4_human AFKGVWTQAF WKAVTAEFLA MLIFVLLSLG STINWG...G TEKPLPVDMV
+aqp4_rat AFKGVWTQAF WKAVTAEFLA MLIFVLLSVG STINWG...G SENPLPVDMV
+aqp4_mouse AFKGVWTQAF WKAVSAEFLA TLIFVL.GVG STINWG...G SENPLPVDMV
+aqp2_rat .MWELRSIAF SRAVLAEFLA TLLFVFFGLG SALQWASSPP S.......VL
+aqp2_mouse .MWELRSIAY CRAVLAEFLA TLLFVFFGLG SALQWASSPP S.......VL
+wc2a_arath DGAELKKWSF YRAVIAEFVA TLLFLYITVL TVIGYKIQSD TDAGGVdgIL
+aqp6_human MLACRLWKAI SRALFAEFLA TGLYVFFGVG SVMRWPTALP S.......VL
+wc2c_arath DAEELTKWSL YRAVIAEFVA TLLFLYVTVL TVIGYKIQSD TKAGGVdgIL
+wc2b_arath DADELTKWSL YRAVIAEFVA TLLFLYITVL TVIGYKIQSD TKAGGVdgIL
+wc1c_arath EPGELSSWSF YRAGIAEFIA TFLFLYITVL TVMGVKRA.. PNMCASVGIQ
+wc1b_arath EPGELASWSF WRAGIAEFIA TFLFLYITVL TVMGVKR..S PNMCASVGIQ
+tipw_lyces EPGELSSWSF YRAGIAEFMA TFLFLYITIL TVMGLKRSDS LCSSV..GIQ
+wc1a_arath EPGELSSWSF WRAGIAEFIA TFLFLYITVL TVMGVKR..S PNMCASVGIQ
+tipw_pea EPSELTSWSF YRAGIAEFIA TFLFLYITVL TVMGVVRESS KCKTV..GIQ
+tipa_arath RADEATHPDS IRATLAEFLS TFVFVFAAEG SILSLDKLYW EHAAHAGTni
+aqua_atrca DMGELKLWSF WRAAIAEFIA TLLFLYITVA TVIGYKKETD PCASVGL..L
+dip_antma SIGDSFSVAS IKAYVAEFIA TLLFVFAGVG SAIAYNKLTS DAALDPAGLV
+aqpz_ecoli .........M FRKLAAECFG TFWLVFGGCG SAVLAAGFPE ....LGIGFA
+tip2_tobac SIGDSFSVGS LKAYVAEFIA TLLFVFAGVG SAIAYNKLTA DAALDPAGLV
+tip1_tobac SIGDSFSVGS LKAYVAEFIA TLLFVFAGVG SAIAYNKLTA DAALDPAGLV
+tipg_arath RPDEATRPDA LKAALAEFIS TLIFVVAGSG SGMAFNKLTE NGATTPSGLV
+bib_drome MQAEIRTLEF WRSIISECLA SFMYVFIVCG AAAGVGVGAS VSSVL....L
+tipr_arath RPDEATRPDA LKAALAEFIS TLIFVVAGSG SGMAFNKLTE NGATTPSGLV
+tipa_phavu RTDEATHPDS MRASLAEFAS TFIFVFAGEG SGLALVKIYQ DSAFSAGELL
+tipg_orysa SHQEVYHPGA LKAALAEFIS TLIFVFAGQG SGMAFSKLTG GGATTPAGLI
+
+ 51 100
+predict_h258 KVSLAFGLSI ATLAQSVGHI SGAHSNPAVT LGLLLSCQIS ILRAVMYIIA
+aqp1_rat KVSLAFGLSI ATLAQSVGHI SGAHSNPAVT LGLLLSCQIS ILRAVMYIIA
+aqp1_mouse KVSLAFGLSI ATLAQSVGHI SGAHLNPAVT LGLLLSCQIS ILRAVMYIIA
+aqp1_human KVSLAFGLSI ATLAQSVGHI SGAHLNPAVT LGLLLSCQIS IFRALMYIIA
+aqp1_bovin KVSLAFGLSI ATLAQSVGHI SGAHLNPAVT LGLLLSCQIS VLRAIMYIIA
+aqp1_sheep KVSLAFGLSI ATLAQSVGHI SGAHLNPAVT LGLLLSCQIS ILRAIMYIIA
+aqpa_ranes KVSLAFGISI ATMAQSVGHV SGAHLNPAVT LGCLLSCQIS ILKAVMYIIA
+aqp2_dasno QIALAFGLAI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+aqp2_bovin QIAMAFGLAI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAVFYVAA
+aqp2_canfa QIAMAFGLGI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+aqp2_rabit QIAMAFGLGI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+aqp2_elema QIAMAFGLAI GTLVQTLGHI SGAHINPAVT VACLVGCHVS FLRATFYLAA
+aqp2_horse QIAMAFGLAI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+aqp2_proha QIAMAFGLAI GTLVQTLGHI SGAHINPAVT IACLVGCHVS FLRALFYLAA
+mip_rat QVALAFGLAL ATLVQTVGHI SGAHVNPAVT FAFLVGSQMS LLRAFCYIAA
+aqp2_oryaf QIAMAFGLAI GTLVQTLGHI SGAHINPAVT VACLVGCHVS FLRAIFYVAA
+mip_mouse QVALAFGLAL ATLVQTVGHI SGAHVNPAVT FAFLVGSQMS LLRAFCYIAA
+mip_ranpi VIALAFGLVL ATMVQSIGHV SGAHINPAVT FAFLIGSQMS LFRAIFYIAA
+mip_bovin QVALAFGLAL ATLVQAVGHI SGAHVNPAVT FAFLVGSQMS LLRAICYMVA
+mip_human QVAMAFGLAL ATLVQSVGHI SGAHVNPAVT FAFLVGSQMS LLRAFCYMAA
+mip_chick .......... .......... .......... .......... ..........
+aqp5_rat QISIAFGLAI GTLAQALGPV SGGHINPAIT LALLIGNQIS LLRAVFYVAA
+aqp5_human QIALAFGLAI GTLAQALGPV SGGHINPAIT LALLVGNQIS LLRAFFYVAA
+aqp2_human QIAMAFGLGI GTLVQALGHI SGAHINPAVT VACLVGCHVS VLRAAFYVAA
+aqp4_human LISLCFGLSI ATMVQCFGHI SGGHINPAVT VAMVCTRKIS IAKSVFYIAA
+aqp4_rat LISLCFGLSI ATMVQCFGHI SGGHINPAVT VAMVCTRKIS IAKSVFYITA
+aqp4_mouse LISLCFGLSI ATMVQCLGHI SGGHINPAVT VAMVCTRKIS IAKSVFYIIA
+aqp2_rat QIAVAFGLGI GILVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+aqp2_mouse QIAVAFGLGI GTLVQALGHV SGAHINPAVT VACLVGCHVS FLRAAFYVAA
+wc2a_arath GIAWAFGGMI FILVYCTAGI SGGHINPAVT FGLFLARKVS LPRALLYIIA
+aqp6_human QIAITFNLVT AMAVQVTWKT SGAHANPAVT LAFLVGSHIS LPRAVAYVAA
+wc2c_arath GIAWAFGGMI FILVYCTAGI SGGHINPAVT FGLFLARKVS LIRAVLYMVA
+wc2b_arath GIAWAFGGMI FILVYCTAGI SGGHINPAVT FGLFLARKVS LIRAVLYMVA
+wc1c_arath GIAWAFGGMI FALVYCTAGI SGGHINPAVT FGLFLARKLS LTRAVFYIVM
+wc1b_arath GIAWAFGGMI FALVYCTAGI SGGHINPAVT FGLFLARKLS LTRAVYYIVM
+tipw_lyces GVAWAFGGMI FALVYCTAGI SGGHINPAVT FGLFLARKLS LTRAVFYMVM
+wc1a_arath GIAWAFGGMI FALVYCTAGI SGGHINPAVT FGLFLARKLS LTRALYYIVM
+tipw_pea GIAWAFGGMI FALVYCTAGI SGGHINPAVT FGLFLARKLS LTRAIFYMVM
+tipa_arath LVALAHAFAL FAAVSAAINV SGGHVNPAVT FGALVGGRVT AIRAIYYWIA
+aqua_atrca GIAWSFGGMI FVLVYCTAGI SGGHINPAVT FGLFLARKVS LLRALVYMIA
+dip_antma AVAVAHAFAL FVGVSMAANV SGGHLNPAVT LGLAVGGNIT ILTGLFYWIA
+aqpz_ecoli GVALAFGLTV LTMAFAVGHI SGGHFNPAVT IGLWAGGRFP AKEVVGYVIA
+tip2_tobac AVAVAHAFAL FVGVSIAANI SGGHLNPAVT LGLAVGGNIT ILTGFFYWIA
+tip1_tobac AVAVAHAFAL FVGVSIAANI SGGHLNPAVT LGLAVGGNIT ILTGFFYWIA
+tipg_arath AAAVAHAFGL FVAVSVGANI SGGHVNPAVT FGAFIGGNIT LLRGILYWIA
+bib_drome ATALASGLAM ATLTQCFLHI SGAHINPAVT LALCVVRSIS PIRAAMYITA
+tipr_arath AAAVAHAFGL FVAVSVGANI SGGHVNPAVT FGAFIGGNIT LLRGILYWIA
+tipa_phavu ALALAHAFAL FAAVSASMHV SGGHVNPAVS FGALIGGRIS VIRAVYYWIA
+tipg_orysa AAAVAHAFAL FVAVSVGANI SGGHVNPAVT FGAFVGGNIT LFRGLLYWIA
+
+ 101 150
+predict_h258 QCVGAIVASA ILSGITSSLL ENSLGRNDLA RGVNSGQGLG IEIIGTLQLV
+aqp1_rat QCVGAIVASA ILSGITSSLL ENSLGRNDLA RGVNSGQGLG IEIIGTLQLV
+aqp1_mouse QCVGAIVATA ILSGITSSLV DNSLGRNDLA HGVNSGQGLG IEIIGTLQLV
+aqp1_human QCVGAIVATA ILSGITSSLT GNSLGRNDLA DGVNSGQGLG IEIIGTLQLV
+aqp1_bovin QCVGAIVATA ILSGITSSLP DNSLGLNALA PGVNSGQGLG IEIIGTLQLV
+aqp1_sheep QCVGAIVATV ILSGITSSLP DNSLGLNALA PGVNSGQGLG IEIIGTLQLV
+aqpa_ranes QCLGAVVATA ILSGITSGLE NNSLGLNGLS PGVSAGQGLG VEILVTFQLV
+aqp2_dasno QLLGAVAGAA ILHEITPPDV RG........ .......... ..........
+aqp2_bovin QLLGAVAGAA LLHEITPPAI RG........ .......... ..........
+aqp2_canfa QLLGAVAGAA LLHEITPPHV RG........ .......... ..........
+aqp2_rabit QLLGAVAGAA LLHEITPAEV RG........ .......... ..........
+aqp2_elema QLLGAVAGAA LLHELTPPDI RG........ .......... ..........
+aqp2_horse QLLGAVAGAA LLHEITPPDI RR........ .......... ..........
+aqp2_proha QLLGAVAGAA LLHELTPPDI RG........ .......... ..........
+mip_rat QLLGAVAGAA VLYSVTPPAV RGNLALNTLH AGVSVGQATT VEIFLTLQFV
+aqp2_oryaf QLLGAVAGAA LLHELTPPDI RG........ .......... ..........
+mip_mouse QLLGAVAGAA VLYSVTPPAV RGNLALNTLH TGVSVGQATT VEIFLTLQFV
+mip_ranpi QLLGAVAGAA VLYGVTPAAI RGNLALNTLH PGVSLGQATT VEIFLTLQFV
+mip_bovin QLLGAVAGAA VLYSVTPPAV RGNLALNTLH PGVSVGQATI VEIFLTLQFV
+mip_human QLLGAVAGAA VLYSVTPPAV RGNLALNTLH PAVSVGQATT VEIFLTLQFV
+mip_chick .......... .......... .......... .......... ..........
+aqp5_rat QLVGAIAGAG ILYWLAPLNA RGNLAVNALN NNTTPGKAMV VELILTFQLA
+aqp5_human QLVGAIAGAG ILYGVAPLNA RGNLAVNALN NNTTQGQAMV VELILTFQLA
+aqp2_human QLLGAVAGAA LLHEITPADI RGDLAVNALS NSTTAGQAVT VELFLTLQLV
+aqp4_human QCLGAIIGAG ILYLVTPPSV VGGLGVTMVH GNLTAGHGLL VELIITFQLV
+aqp4_rat QCLGAIIGAG ILYLVTPPSV VGGLGVTTVH GNLTAGHGLL VELIITFQLV
+aqp4_mouse QCLGAIIGAG ILYLVTPPSV VGGLGVTTVH GNLTAGHGLL VELIITFQLV
+aqp2_rat QLLGAVAGAA ILHEITPVEI RGDLAVNALH NNATAGQAVT VELFLTMQLV
+aqp2_mouse QLLGAVAGAA ILHEITPVEI RGDLAVNALH NNATAGQAVT VELFLTMQLV
+wc2a_arath QCLGAICGVG FVKAFQSSYY TRYGGgnSLA DGYSTGTGLA AEIIGTFVLV
+aqp6_human QLVGATVGAA LLYGVMPGDI RETLGINVVR NSVSTGQAVA VELLLTLQLV
+wc2c_arath QCLGAICGVG FVKAFQSSHY VNYGGgnFLA DGYNTGTGLA AEIIGTFVLV
+wc2b_arath QCLGAICGVG FRQSFQSSYY DRYGGgnSLA DGYNTGTGLA AEIIGTFVLV
+wc1c_arath QCLGAICGAG VVKGFQPNPY QtgGGANTVA HGYTKGSGLG AEIIGTFVLV
+wc1b_arath QCLGAICGAG VVKGFQPKQY QagGGANTIA HGYTKGSGLG AEIIGTFVLV
+tipw_lyces QCLGAICGAG VVKGFMVGPY QrgGGANVVN PGYTKGDGLG AEIIGTFVLV
+wc1a_arath QCLGAICGAG VVKGFQPKQY QagGGANTVA HGYTKGSGLG AEIIGTFVLV
+tipw_pea QVLGAICGAG VVKGFEGKQR FGDLNgnFVA PGYTKGDGLG AEIVGTFILV
+tipa_arath QLLGAILACL LLRLTTNGMR PVGFR...LA SGVGAVNGLV LEIILTFGLV
+aqua_atrca QCAGAICGVG LVKAFMKGPY NqgGGANSVA LGYNKGTAFG AELIGTFVLV
+dip_antma QCLGSTVACL LLKFVTNGL. ..SVPTHGVA AGMDAIQGVV MEIIITFALV
+aqpz_ecoli QVVGGIVAAA LLYLIASGKT GFDAAASGFA sgYSMLSALV VELVLSAGFL
+tip2_tobac QLLGSTVACL LLKYVTNGL. ..AVPTHGVA AGLNGFQGVV MEIIITFALV
+tip1_tobac QLLGSTVACL LLKYVTNGL. ..AVPTHGVA AGLNGLQGVV MEIIITFALV
+tipg_arath QLLGSVVACL ILKFATGGLA VPAFG...LS AGVGVLNAFV FEIVMTFGLV
+bib_drome QCGGGIAGAA LLYGVTVPGY QGNLQAasHS AALAAWERFG VEFILTSLVV
+tipr_arath QLLGSVVACL ILKFATGGLA VPPFG...LS AGVGVLNAFV FEIVMTFGLV
+tipa_phavu QLLGSIVAAL VLRLVTNNMR PSGF...HVS PGVGVGHMFI LEVVMTFGLM
+tipg_orysa QLLGSTVACF LLRFSTGGLA TGTFGL.... TGVSVWEALV LEIVMTFGLV
+
+ 151 200
+predict_h258 LCVLATTDRR RRDLGGSAPL AIGLSVALGH LLAIDYTGCG INPARSFGSA
+aqp1_rat LCVLATTDRR RRDLGGSAPL AIGLSVALGH LLAIDYTGCG INPARSFGSA
+aqp1_mouse LCVLATTDRR RRDLGGSAPL AIGLSVALGH LLAIDYTGCG INPARSFGSA
+aqp1_human LCVLATTDRR RRDLGGSAPL AIGLSVALGH LLAIDYTGCG INPARSFGSA
+aqp1_bovin LCVLATTDRR RRDLGGSGPL AIGFSVALGH LLAIDYTGCG INPARSFGSS
+aqp1_sheep LCVLATTDRR RrdLGDSGPL AIGFSVALGH LLAIDYTGCG INPARSFGSS
+aqpa_ranes LCVVAVTDRR RHDVSGSVPL AIGLSVALGH LIAIDYTGCG MNPARSFGSA
+aqp2_dasno .......... .......... .......... .......... ..........
+aqp2_bovin .......... .......... .......... .......... ..........
+aqp2_canfa .......... .......... .......... .......... ..........
+aqp2_rabit .......... .......... .......... .......... ..........
+aqp2_elema .......... .......... .......... .......... ..........
+aqp2_horse .......... .......... .......... .......... ..........
+aqp2_proha .......... .......... .......... .......... ..........
+mip_rat LCIFATYDER RNGRMGSVAL AVGFSLTLGH LFGMYYTGAG MNPARSFAPA
+aqp2_oryaf .......... .......... .......... .......... ..........
+mip_mouse LCIFATYDER RNGRMGSVAL AVGFSLTLGH LFGMYYTGAG MNPARSFAPA
+mip_ranpi LCIFATYDER RNGRLGSVSL AIGFSLTLGH LFGLYYTGAS MNPARSFAPA
+mip_bovin LCIFATYDER RNGRLGSVAL AVGFSLTLGH LFGMYYTGAG MNPARSFAPA
+mip_human LCIFATYDER RNGQLGSVAL AVGFSLALGH LFGMYYTGAG MNPARSFAPA
+mip_chick ........DR HDGRPGSAAL PVGFSLALGH LFGIPFTGAG MNPARSFAPA
+aqp5_rat LCIFSSTDSR RTSPVGSPAL SIGLSVTLGH LVGIYFTGCS MNPARSFGPA
+aqp5_human LCIFASTDSR RTSPVGSPAL SIGLSVTLGH LVGIYFTGCS MNPARSFGPA
+aqp2_human LCIFASTDER RGENPGTPAL SIGFSVALGH LLGIHYTGCS MNPARSLAPA
+aqp4_human FTIFASCDSK RTDVTGSIAL AIGFSVAIGH LFAINYTGAS MNPARSFGPA
+aqp4_rat FTIFASCDSK RTDVTGSVAL AIGFSVAIGH LFAINYTGAS MNPARSFGPA
+aqp4_mouse FTVFASCDSK RTDVTGSIAL AIGFSVAIGH LFAINYTGAS MNPARSFGPA
+aqp2_rat LCIFASTDER RGDNLGSPAL SIGFSVTLGH LLGIYFTGCS MNPARSLAPA
+aqp2_mouse LCIFASTDER RSDNLGSPAL SIGFSVTLGH LLGIYFTGCS MNPARSLAPA
+wc2a_arath YTVFSATDPK RSavPVLAPL PIGFAVFMVH LATIPITGTG INPARSFGAA
+aqp6_human LCVFASTDSR QTS..GSPAT MIGISWALGH LIGILFTGCS MNPARSFGPA
+wc2c_arath YTVFSATDPK RNavPVLAPL PIGFAVFMVH LATIPITGTG INPARSFGAA
+wc2b_arath YTVFSATDPK RNavPVLAPL PIGFAVFMVH LATIPITGTG INPARSFGAS
+wc1c_arath YTVFSATDAK RSavPILAPL PIGFAVFLVH LATIPITGTG INPARSLGAA
+wc1b_arath YTVFSATDAK RNavPILAPL PIGFAVFLVH LATIPITGTG INPARSLGAA
+tipw_lyces YTVFSATDAK RNavPILAPL PIGFAVFLVH LATIPITGTG INPARSLGAA
+wc1a_arath YTVFSATDAK RNavPILAPL PIGFAVFLVH LATIPITATG INPARSLGAA
+tipw_pea YTVFSATDAK RSavPILAPL PIGFAVFLVH LATIPITGTG INPARSLGAA
+tipa_arath YVVYStiDPK RGSLGIIAPL AIGLIVGANI LVGGPFSGAS MNPARAFGPA
+aqua_atrca YTVFSATDPK RSavPILAPL PIGFAVFMVH LATIPITGTG INPARSFGAA
+dip_antma YTVYAtaDPK KGSLGVIAPI AIGFIVGANI LAAGPFSGGS MNPARSFGPA
+aqpz_ecoli LVIHGATDKF APA..GFAPI AIGLALTLIH LISIPVTNTS VNPARSTAVA
+tip2_tobac YTVYAtaDPK KGSLGTIAPI AIGFIVGANI LAAGPFSGGS MNPARSFGPA
+tip1_tobac YTVYAtaDPK KGSLGTIAPI AIGFIVGANI LAAGPFSGGS MNPARSFGPA
+tipg_arath YTVYAtiDPK NGSLGTIAPI AIGFIVGANI LAGGAFSGAS MNPAVAFGPA
+bib_drome LCYFVSTDPM KKFMGNS.AA SIGCAYSACC FVSMPYLN.. ..PARSLGPS
+tipr_arath YTVYAtiDPK NGSLGTIAPI AIGFIVGANI LAGGAFSGAS MNPAVAFGPA
+tipa_phavu YTVYGtiDPK RGAVSYIAPL AIGLIVGANI LVGGPFDGAC MNPALAFGPS
+tipg_orysa YTVYAtvDPK KGSLGTIAPI AIGFIVGANI LVGGAFDGAS MNPAVSFGPA
+
+ 201 250
+predict_h258 VLTRNFSNHW IFWVGPFIGS ALAVLIYDFI LAPRSSDFTD RMKVWTSGQV
+aqp1_rat VLTRNFSNHW IFWVGPFIGS ALAVLIYDFI LAPRSSDFTD RMKVWTSGQV
+aqp1_mouse VLTRNFSNHW IFWVGPFIGG ALAVLIYDFI LAPRSSDFTD RMKVWTSGQV
+aqp1_human VITHNFSNHW IFWVGPFIGG ALAVLIYDFI LAPRSSDLTD RVKVWTSGQV
+aqp1_bovin VITHNFQDHW IFWVGPFIGA ALAVLIYDFI LAPRSSDLTD RVKVWTSGQV
+aqp1_sheep VITHNFQDHW IFWVGPFIGA ALAVLIYDFI LAPRSSDLTD RVKVWTSGQV
+aqpa_ranes VLTKNFTYHW IFWVGPMIGG AAAAIIYDFI LAPRTSDLTD RMKVWTNGQV
+aqp2_dasno .......... .......... .......... .......... ..........
+aqp2_bovin .......... .......... .......... .......... ..........
+aqp2_canfa .......... .......... .......... .......... ..........
+aqp2_rabit .......... .......... .......... .......... ..........
+aqp2_elema .......... .......... .......... .......... ..........
+aqp2_horse .......... .......... .......... .......... ..........
+aqp2_proha .......... .......... .......... .......... ..........
+mip_rat ILTRNFSNHW VYWVGPIIGG GLGSLLYDFL LFPRLKSVSE RLSILKGARP
+aqp2_oryaf .......... .......... .......... .......... ..........
+mip_mouse ILTRNFSNHW VYWVGPIIGG GLGSLLYDFL LFPRLKSVSE RLSILKGARP
+mip_ranpi VLTRNFTNHW VYWVGPIIGG ALGGLVYDFI LFPRMRGLSE RLSILKGARP
+mip_bovin ILTRNFTNHW VYWVGPVIGA GLGSLLYDFL LFPRLKSVSE RLSILKGSRP
+mip_human ILTGNFTNHW VYWVGPIIGG GLGSLLYDFL LFPRLKSISE RLSVLKGAKP
+mip_chick VITRNFTNHW VFWAGPLLGA ALAALLYELA LCPRARSMAE RLAV.LRGEP
+aqp5_rat VVMNRFssHW VFWVGPIVGA MLAAILYFYL LFPSSLSLHD RVAVVKGTYE
+aqp5_human VVMNRFsaHW VFWVGPIVGA VLAAILYFYL LFPNSLSLSE RVAIIKGTYE
+aqp2_human VVTGKFDDHW VFWIGPLVGA ILGSLLYNYV LFPPAKSLSE RLAVLKGLEp
+aqp4_human VIMGNWENHW IYWVGPIIGA VLAGGLYEYV FCPDVEFKRR FKEAFSKaqT
+aqp4_rat VIMGNWENHW IYWVGPIIGA VLAGALYEYV FCPDVELKRR LKEAFSKaqT
+aqp4_mouse VIMGNWANHW IYWVGPIMGA VLAGALYEYV FCPDVELKRR LKEAFSKaqT
+aqp2_rat VVTGKFDDHW VFWIGPLVGA IIGSLLYNYL LFPSAKSLQE RLAVLKGLEp
+aqp2_mouse VVTGKFDDHW VFWIGPLVGA IIGSLLYNYL LFPSTKSLQE RLAVLKGLEp
+wc2a_arath VIYnpWDDHW IFWVGPFIGA AIAAFYHQFV LRASGSKSLG SFRSAANV..
+aqp6_human IIIGKFTVHW VFWVGPLMGA LLASLIYNFV LFPDTKTLAQ RLAILTGTVE
+wc2c_arath VIFnpWDDHW IFWVGPFIGA TIAAFYHQFV LRASGSKSLG SFRSAANV..
+wc2b_arath VIYnpWDDHW IFWVGPFIGA AIAAFYHQFV LRASGSKSLG SFRSAANV..
+wc1c_arath IIYnaWDDHW IFWVGPFIGA ALAALYHQLV IRAIPFKSRS ..........
+wc1b_arath IIFnaWDDHW VFWVGPFIGA ALAALYHVIV IRAIPFKSRS ..........
+tipw_lyces IIYnaWNDHW IFWVGPMIGA ALAAIYHQII IRAMPFHRS. ..........
+wc1a_arath IIYnsWDDHW VFWVGPFIGA ALAALYHVVV IRAIPFKSRS ..........
+tipw_pea IVFngWNDHW IFWVGPFIGA ALAALYHQVV IRAIPFKSK. ..........
+tipa_arath LVGWRWHDHW IYWVGPFIGS ALAALIYEYM VIPTEPPTHH AHGVHQPLAP
+aqua_atrca VIyrVWDDHW IFWVGPFVGA LAAAAYHQYV LRAAAIKALG SFRSNPTN..
+dip_antma VASGDFSQNW IYWAGPLIGG ALAGFIYGDV FITAHAPLPT SEDYA.....
+aqpz_ecoli IFQgaLEQLW FFWVVPIVGG IIGGLIYRTL LEKRD..... ..........
+tip2_tobac VVAGDFSQNW IYWAGPLIGG GLAGFIYGDV FIGCHTPLPT SEDYA.....
+tip1_tobac VVAGDFSQNW IYWAGPLIGG GLAGFIYGDV FIGCHTPLPT SEDYA.....
+tipg_arath VVSWTWTNHW VYWAGPLVGG GIAGLIYEVF FINTTHEQLP TTDY......
+bib_drome FVLNKWDSHW VYWFGPLVGG MASGLVYEYI FNSRNRNLRH NKGSIDNDSS
+tipr_arath VVSWTWTNHW VYWAGPLVGG GIAGLIYEVF FINTTHTSSS NHRLLN....
+tipa_phavu LVGWQWHQHW IFWVGPLLGA ALAALVYEYA VIPIEPPPHH HQPLATEDY.
+tipg_orysa LVSWSWESQW VYWVGPLIGG GLAGVIYEVL FISHTHEQLP TTDY......
+
+ 251 269
+predict_h258 EEYDLDADDI NSRVEMKPK
+aqp1_rat EEYDLDADDI NSRVEMKPK
+aqp1_mouse EEYDLDADDI NSRVEMKPK
+aqp1_human EEYDLDADDI NSRVEMKPK
+aqp1_bovin EEYDLDADDI NSRVEMKPK
+aqp1_sheep EEYDLDADDI NSRVEMKPK
+aqpa_ranes EEYELDGDD. NTRVEMKPK
+aqp2_dasno .......... .........
+aqp2_bovin .......... .........
+aqp2_canfa .......... .........
+aqp2_rabit .......... .........
+aqp2_elema .......... .........
+aqp2_horse .......... .........
+aqp2_proha .......... .........
+mip_rat SDSNGQPEGT GEPVELKTQ
+aqp2_oryaf .......... .........
+mip_mouse SDSNGQPEGT GEPVELKTQ
+mip_ranpi AEPEGQQEAT GEPIELKTQ
+mip_bovin SESNGQPEVT GEPVELKTQ
+mip_human DVSNGQPEVT GEPVELNTQ
+mip_chick PAAAPPPEPP AEPLELKTQ
+aqp5_rat PEEDWEDHRE ERKKTIELT
+aqp5_human PDEDWEEQRE ERKKTMELT
+aqp2_human tDWEEREVRR RQSVELHSP
+aqp4_human KGSYMEVEDN RSQVETDDL
+aqp4_rat KGSYMEVEDN RSQVETEDL
+aqp4_mouse KGSYMEVEDN RSQVETEDL
+aqp2_rat tDWEEREVRR RQSVELHSP
+aqp2_mouse tDWEEREVRR RQSVELHSP
+wc2a_arath .......... .........
+aqp6_human VGTGARAGAE PLKKESQPG
+wc2c_arath .......... .........
+wc2b_arath .......... .........
+wc1c_arath .......... .........
+wc1b_arath .......... .........
+tipw_lyces .......... .........
+wc1a_arath .......... .........
+tipw_pea .......... .........
+tipa_arath EDY....... .........
+aqua_atrca .......... .........
+dip_antma .......... .........
+aqpz_ecoli .......... .........
+tip2_tobac .......... .........
+tip1_tobac .......... .........
+tipg_arath .......... .........
+bib_drome SIHSEDELNY DMDMEKPNK
+tipr_arath .......... .........
+tipa_phavu .......... .........
+tipg_orysa .......... .........
+
+
+________________________________________________________________________________
+
+
+
+
+ Prediction of:
+
+ - secondary structure, by PHDsec
+ - solvent accessibility, by PHDacc
+ - and helical transmembrane regions, by PHDhtm
+
+ PHD: Profile fed neural network systems from HeiDelberg
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Author: Burkhard Rost
+ EMBL, Heidelberg, FRG
+ Meyerhofstrasse 1, 69 117 Heidelberg
+ Internet: Predict-Help@EMBL-Heidelberg.DE
+
+ All rights reserved.
+
+
+
+
+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Secondary structure prediction by PHDsec:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Author: Burkhard Rost
+ EMBL, Heidelberg, FRG
+ Meyerhofstrasse 1, 69 117 Heidelberg
+ Internet: Rost@EMBL-Heidelberg.DE
+
+ All rights reserved.
+
+
+
+
+About the network method
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The network procedure is described in detail in:
+1) Rost, Burkhard; Sander, Chris:
+ Prediction of protein structure at better than 70% accuracy.
+ J. Mol. Biol., 1993, 232, 584-599.
+
+A brief description is given in:
+ Rost, Burkhard; Sander, Chris:
+ Improved prediction of protein secondary structure by use of se-
+ quence profiles and neural networks.
+ Proc. Natl. Acad. Sci. U.S.A., 1993, 90, 7558-7562.
+
+The PHD mail server is described in:
+2) Rost, Burkhard; Sander, Chris; Schneider, Reinhard:
+ PHD - an automatic mail server for protein secondary structure
+ prediction.
+ CABIOS, 1994, 10, 53-60.
+
+The latest improvement steps (up to 72%) are explained in:
+3) Rost, Burkhard; Sander, Chris:
+ Combining evolutionary information and neural networks to predict
+ protein secondary structure.
+ Proteins, 1994, 19, 55-72.
+
+To be quoted for publications of PHD output:
+ Papers 1-3 for the prediction of secondary structure and the pre-
+ diction server.
+
+
+
+About the input to the network
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The prediction is performed by a system of neural networks.
+The input is a multiple sequence alignment. It is taken from an HSSP
+file (produced by the program MaxHom:
+ Sander, Chris & Schneider, Reinhard: Database of Homology-Derived
+ Structures and the Structural Meaning of Sequence Alignment.
+ Proteins, 1991, 9, 56-68.
+
+For optimal results the alignment should contain sequences with varying
+degrees of sequence similarity relative to the input protein.
+The following is an ideal situation:
+
++-----------------+----------------------+
+| sequence: | sequence identity |
++-----------------+----------------------+
+| target sequence | 100 % |
+| aligned seq. 1 | 90 % |
+| aligned seq. 2 | 80 % |
+| ... | ... |
+| aligned seq. 7 | 30 % |
++-----------------+----------------------+
+
+
+
+Estimated Accuracy of Prediction
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A careful cross validation test on some 250 protein chains (in total
+about 55,000 residues) with less than 25% pairwise sequence identity
+gave the following results:
+
+++================++-----------------------------------------+
+|| Qtotal = 72.1% || ("overall three state accuracy") |
+++================++-----------------------------------------+
+
++----------------------------+-----------------------------+
+| Qhelix (% of observed)=70% | Qhelix (% of predicted)=77% |
+| Qstrand(% of observed)=62% | Qstrand(% of predicted)=64% |
+| Qloop (% of observed)=79% | Qloop (% of predicted)=72% |
++----------------------------+-----------------------------+
+..........................................................................
+
+These percentages are defined by:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+| number of correctly predicted residues
+|Qtotal = --------------------------------------- (*100)
+| number of all residues
+|
+| no of res correctly predicted to be in helix
+|Qhelix (% of obs) = -------------------------------------------- (*100)
+| no of all res observed to be in helix
+|
+|
+| no of res correctly predicted to be in helix
+|Qhelix (% of pred)= -------------------------------------------- (*100)
+| no of all residues predicted to be in helix
+
+..........................................................................
+
+Averaging over single chains
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The most reasonable way to compute the overall accuracies is the above
+quoted percentage of correctly predicted residues. However, since the
+user is mainly interested in the expected performance of the prediction
+for a particular protein, the mean value when averaging over protein
+chains might be of help as well. Computing first the three state
+accuracy for each protein chain, and then averaging over 250 chains
+yields the following average:
+
++-------------------------------====--+
+| Qtotal/averaged over chains = 72.2% |
++-------------------------------====--+
+| standard deviation = 9.3% |
++-------------------------------------+
+
+..........................................................................
+
+Further measures of performance
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Matthews correlation coefficient:
+
++---------------------------------------------+
+| Chelix = 0.63, Cstrand = 0.53, Cloop = 0.52 |
++---------------------------------------------+
+..........................................................................
+
+Average length of predicted secondary structure segments:
+
+. +------------+----------+
+. | predicted | observed |
++-----------+------------+----------+
+| Lhelix = | 10.3 | 9.3 |
+| Lstrand = | 5.0 | 5.3 |
+| Lloop = | 7.2 | 5.9 |
++-----------+------------+----------+
+..........................................................................
+
+The accuracy matrix in detail:
+
++---------------------------------------+
+| number of residues with H, E, L |
++---------+------+------+------+--------+
+| |net H |net E |net L |sum obs |
++---------+------+------+------+--------+
+| obs H |12447 | 1255 | 3990 | 17692 |
+| obs E | 949 | 7493 | 3750 | 12192 |
+| obs L | 2604 | 2875 |19962 | 25441 |
++---------+------+------+------+--------+
+| sum Net |16000 |11623 |27702 | 55325 |
++---------+------+------+------+--------+
+
+Note: This table is to be read in the following manner:
+ 12447 of all residues predicted to be in helix, were observed to
+ be in helix, 949 however belong to observed strands, 2604 to
+ observed loop regions. The term "observed" refers to the DSSP
+ assignment of secondary structure calculated from 3D coordinates
+ of experimentally determined structures (Dictionary of Secondary
+ Structure of Proteins: Kabsch & Sander (1983) Biopolymers, 22,
+ 2577-2637).
+
+
+
+Position-specific reliability index
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The network predicts the three secondary structure types using real
+numbers from the output units. The prediction is assigned by choosing
+the maximal unit ("winner takes all"). However, the real numbers
+contain additional information.
+E.g. the difference between the maximal and the second largest output
+unit can be used to derive a "reliability index". This index is given
+for each residue along with the prediction. The index is scaled to
+have values between 0 (lowest reliability), and 9 (highest).
+The accuracies (Qtot) to be expected for residues with values above a
+particular value of the index are given below as well as the fraction
+of such residues (%res).:
+
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| index| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
+| %res |100.0| 99.2| 90.4| 80.9| 71.6| 62.5| 52.8| 42.3| 29.8| 14.1|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| | | | | | | | | | | |
+| Qtot | 72.1| 72.3| 74.8| 77.7| 80.3| 82.9| 85.7| 88.5| 91.1| 94.2|
+| | | | | | | | | | | |
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| H%obs| 70.4| 70.6| 73.7| 77.1| 80.1| 83.1| 86.0| 89.3| 92.5| 96.4|
+| E%obs| 61.5| 61.7| 63.7| 66.6| 69.1| 71.7| 74.6| 77.0| 77.8| 68.1|
+| | | | | | | | | | | |
+| H%prd| 77.8| 78.0| 80.0| 82.6| 84.7| 86.9| 89.2| 91.3| 93.1| 95.4|
+| E%prd| 64.5| 64.7| 67.8| 71.0| 74.2| 77.6| 81.4| 85.1| 89.8| 93.5|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+
+The above table gives the cumulative results, e.g. 62.5% of all
+residues have a reliability of at least 5. The overall three-state
+accuracy for this subset of almost two thirds of all residues is 82.9%.
+For this subset, e.g., 83.1% of the observed helices are correctly
+predicted, and 86.9% of all residues predicted to be in helix are
+correct.
+
+..........................................................................
+
+The following table gives the non-cumulative quantities, i.e. the
+values per reliability index range. These numbers answer the question:
+how reliable is the prediction for all residues labeled with the
+particular index i.
+
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| index| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
+| %res | 8.8| 9.5| 9.3| 9.1| 9.7| 10.5| 12.5| 15.7| 14.1|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| | | | | | | | | | |
+| Qtot | 46.6| 50.6| 57.7| 62.6| 67.9| 74.2| 82.2| 88.3| 94.2|
+| | | | | | | | | | |
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| H%obs| 36.8| 42.3| 49.5| 55.2| 61.7| 69.9| 78.8| 87.4| 96.4|
+| E%obs| 44.7| 44.5| 52.1| 55.4| 60.9| 68.0| 75.9| 81.0| 68.1|
+| | | | | | | | | | |
+| H%prd| 49.9| 52.5| 60.3| 64.2| 69.2| 77.5| 85.4| 89.9| 95.4|
+| E%prd| 41.7| 47.1| 53.6| 57.0| 64.0| 71.6| 78.8| 88.8| 93.5|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+
+For example, for residues with Relindex = 5 64% of all predicted betha-
+strand residues are correctly identified.
+
+
+
+
+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Solvent accessibility prediction by PHDacc:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Author: Burkhard Rost
+ EMBL, Heidelberg, FRG
+ Meyerhofstrasse 1, 69 117 Heidelberg
+ Internet: Rost@EMBL-Heidelberg.DE
+
+ All rights reserved.
+
+
+
+
+About the network method
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The network for prediction of secondary structure is described in
+detail in:
+ Rost, Burkhard; Sander, Chris:
+ Prediction of protein structure at better than 70% accuracy.
+ J. Mol. Biol., 1993, 232, 584-599.
+
+The analysis of the prediction of solvent exposure is given in:
+ Rost, Burkhard; Sander, Chris:
+ Conservation and prediction of solvent accessibility in protein
+ families. Proteins, 1994, 20, 216-226.
+
+To be quoted for publications of PHD exposure prediction:
+ Both papers quoted above.
+
+
+
+Definition of accessibility
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For training the residue solvent accessibility the DSSP (Dictionary of
+Secondary Structure of Proteins; Kabsch & Sander (1983) Biopolymers, 22,
+2577-2637) values of accessible surface area have been used. The
+prediction provides values for the relative solvent accessibility. The
+normalisation is the following:
+
+| ACCESSIBILITY (from DSSP in Angstrom)
+|RELATIVE_ACCESSIBILITY = ------------------------------------- * 100
+| MAXIMAL_ACC (amino acid type i)
+
+where MAXIMAL_ACC (i) is the maximal accessibility of amino acid type i.
+The maximal values are:
+
++----+----+----+----+----+----+----+----+----+----+----+----+
+| A | B | C | D | E | F | G | H | I | K | L | M |
+| 106| 160| 135| 163| 194| 197| 84| 184| 169| 205| 164| 188|
++----+----+----+----+----+----+----+----+----+----+----+----+
+| N | P | Q | R | S | T | V | W | X | Y | Z |
+| 157| 136| 198| 248| 130| 142| 142| 227| 180| 222| 196|
++----+----+----+----+----+----+----+----+----+----+----+
+
+Notation: one letter code for amino acid, B stands for D or N; Z stands
+ for E or Q; and X stands for undetermined.
+
+The relative solvent accessibility can be used to estimate the number
+of water molecules (W) in contact with the residue:
+
+W = ACCESSIBILITY /10
+
+The prediction is given in 10 states for relative accessibility, with
+
+RELATIVE_ACCESSIBILITY = (PREDICTED_ACC * PREDICTED_ACC)
+
+where PREDICTED_ACC = 0 - 9.
+
+
+
+Estimated Accuracy of Prediction
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A careful cross validation test on some 238 protein chains (in total
+about 62,000 residues) with less than 25% pairwise sequence identity
+gave the following results:
+
+
+Correlation
+...........
+
+The correlation between observed and predicted solvent accessibility
+is:
+
+-----------
+corr = 0.53
+-----------
+
+This value ought to be compared to the worst and best case prediction
+scenario: random prediction (corr = 0.0) and homology modelling
+(corr = 0.66). (Note: homology modelling yields a relative accurate
+prediction in 3D if, and only if, a significantly identical sequence
+has a known 3D structure.)
+
+
+3-state accuracy
+................
+
+Often the relative accessibility is projected onto, e.g., 3 states:
+ b = buried (here defined as < 9% relative accessibility),
+ i = intermediate ( 9% <= rel. acc. < 36% ),
+ e = exposed ( rel. acc. >= 36% ).
+
+A projection onto 3 states or 2 states (buried/exposed) enables the
+compilation of a 3- and 2-state prediction accuracy. PHD reaches an
+overall 3-state accuracy of:
+ Q3 = 57.5%
+(compared to 35% for random prediction and 70% for homology modelling).
+
+In detail:
+
++-----------------------------------+-------------------------+
+| Qburied (% of observed)=77% | Qb (% of predicted)=60% |
+| Qintermediate (% of observed)= 9% | Qi (% of predicted)=44% |
+| Qexposed (% of observed)=78% | Qe (% of predicted)=56% |
++-----------------------------------+-------------------------+
+
+
+10-state accuracy
+.................
+
+The network predicts relative solvent accessibility in 10 states, with
+state i (i = 0-9) corresponding to a relative solvent accessibility of
+i*i %. The 10-state accuracy of the network is:
+
+ Q10 = 24.5%
+
+..........................................................................
+
+These percentages are defined by:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+| number of correctly predicted residues
+|Q3 = --------------------------------------- (*100)
+| number of all residues
+|
+| no of res. correctly predicted to be buried
+|Qburied (% of obs) = ------------------------------------------- (*100)
+| no of all res. observed to be buried
+|
+|
+| no of res. correctly predicted to be buried
+|Qburied (% of pred)= ------------------------------------------- (*100)
+| no of all residues predicted to be buried
+
+..........................................................................
+
+Averaging over single chains
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The most reasonable way to compute the overall accuracies is the above
+quoted percentage of correctly predicted residues. However, since the
+user is mainly interested in the expected performance of the prediction
+for a particular protein, the mean value when averaging over protein
+chains might be of help as well. Computing first the correlation
+between observed and predicted accessibility for each protein chan, and
+then averaging over all 238 chains yields the following average:
+
++-------------------------------====--+
+| corr/averaged over chains = 0.53 |
++-------------------------------====--+
+| standard deviation = 0.11 |
++-------------------------------------+
+
+..........................................................................
+
+Further details of performance accuracy
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The accuracy matrix in detail:
+..............................
+
+-------+----------------------------------------------------+-----------
+\ PHD | 0 1 2 3 4 5 6 7 8 9 | SUM %obs
+-------+----------------------------------------------------+-----------
+OBS 0 | 8611 140 8 44 82 169 772 334 27 0 | 10187 16.6
+OBS 1 | 4367 164 0 50 106 231 738 346 44 3 | 6049 9.8
+OBS 2 | 3194 168 1 68 125 303 951 513 42 7 | 5372 8.7
+OBS 3 | 2760 159 8 80 136 327 1246 746 58 19 | 5539 9.0
+OBS 4 | 2312 144 2 72 166 396 1615 1245 124 19 | 6095 9.9
+OBS 5 | 1873 96 3 84 138 425 1979 1834 187 27 | 6646 10.8
+OBS 6 | 1387 67 1 60 80 278 2237 2627 231 51 | 7019 11.4
+OBS 7 | 1082 35 0 32 56 225 1871 3107 302 60 | 6770 11.0
+OBS 8 | 660 25 0 27 43 136 1206 2374 325 87 | 4883 7.9
+OBS 9 | 325 20 2 27 29 74 648 1159 366 214 | 2864 4.7
+-------+----------------------------------------------------+-----------
+SUM |26571 1018 25 544 961 2564 13263 14285 1706 487 |
+%pred | 43.3 1.7 0.0 0.9 1.6 4.2 21.6 23.3 2.8 0.8 |
+-------+----------------------------------------------------+-----------
+
+Note: This table is to be read in the following manner:
+ 8611 of all residues predicted to be in exposed by 0%, were
+ observed with 0% relative accessibility. However, 325 of all
+ residues predicted to have 0% are observed as completely exposed
+ (obs = 9 -> rel. acc. >= 81%). The term "observed" refers to the
+ DSSP compilation of area of solvent accessibility calculated from
+ 3D coordinates of experimentally determined structures (Diction-
+ ary of Secondary Structure of Proteins: Kabsch & Sander (1983)
+ Biopolymers, 22, 2577-2637).
+
+
+Accuracy for each amino acid:
+.............................
+
++---+------------------------------+-----+-------+------+
+|AA | Q3 b%o b%p i%o i%p e%o e%p | Q10 | corr | N |
++---+------------------------------+-----+-------+------+
+| A | 59.0 87 60 2 38 66 57 | 31 | 0.530 | 5054 |
+| C | 62.0 91 67 5 39 25 21 | 34 | 0.244 | 893 |
+| D | 56.5 21 45 6 49 94 57 | 20 | 0.321 | 3536 |
+| E | 60.8 9 40 3 41 98 61 | 21 | 0.347 | 3743 |
+| F | 63.3 94 67 9 46 29 37 | 27 | 0.366 | 2436 |
+| G | 52.1 75 51 1 31 67 53 | 22 | 0.405 | 4787 |
+| H | 50.9 63 53 23 45 71 50 | 18 | 0.442 | 1366 |
+| I | 64.9 95 68 6 41 30 38 | 34 | 0.360 | 3437 |
+| K | 66.6 2 11 2 37 98 67 | 23 | 0.267 | 3652 |
+| L | 61.6 93 65 8 44 31 40 | 31 | 0.368 | 5016 |
+| M | 60.1 92 64 5 39 45 44 | 29 | 0.452 | 1371 |
+| N | 55.5 45 45 8 38 87 59 | 17 | 0.410 | 2923 |
+| P | 53.0 48 48 9 39 83 56 | 18 | 0.364 | 2920 |
+| Q | 54.3 27 44 7 44 92 56 | 20 | 0.344 | 2225 |
+| R | 49.9 15 47 36 47 76 51 | 18 | 0.372 | 2765 |
+| S | 55.6 69 53 3 51 81 56 | 22 | 0.464 | 3981 |
+| T | 51.8 61 51 8 38 78 53 | 21 | 0.432 | 3740 |
+| V | 61.1 93 65 5 40 39 42 | 34 | 0.418 | 4156 |
+| W | 56.2 85 62 20 49 29 27 | 21 | 0.318 | 891 |
+| Y | 49.7 73 52 33 49 36 38 | 19 | 0.359 | 2301 |
++---+------------------------------+-----+-------+------+
+
+Abbreviations:
+
+AA: amino acid in one-letter code
+b%o, i%o, e%o: = Qburied, Qintermediate, Qexposed (% of observed),
+ i.e. percentage of correct prediction in each state, see above
+b%p, i%p, e%p: = Qburied, Qintermediate, Qexposed (% of predicted),
+ i.e. probability of correct prediction in each state, see above
+b%o: = Qburied (% of observed), see above
+Q10: percentage of correctly predicted residues in each of the 10
+ states of predicted relative accessibility.
+corr: correlation between predicted and observed rel. acc.
+N: number of residues in data set
+
+
+Accuracy for different secondary structure:
+...........................................
+
++--------+------------------------------+----+-------+-------+
+| type | Q3 b%o b%p i%o i%p e%o e%p |Q10 | corr | N |
++--------+------------------------------+----+-------+-------+
+| helix | 59.5 79 64 8 44 80 56 | 27 | 0.574 | 20100 |
+| strand | 61.3 84 73 9 46 69 37 | 35 | 0.524 | 13356 |
+| loop | 54.4 64 43 11 44 78 61 | 18 | 0.442 | 27968 |
++--------+------------------------------+----+-------+-------+
+
+Abbreviations as before.
+
+
+
+Position-specific reliability index
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The network predicts the 10 states for relative accessibility using real
+numbers from the output units. The prediction is assigned by choosing
+the maximal unit ("winner takes all"). However, the real numbers
+contain additional information.
+E.g. the difference between the maximal and the second largest output
+unit (with the constraint that the second largest output is compiled
+among all units at least 2 positions off the maximal unit) can be used
+to derive a "reliability index". This index is given for each residue
+along with the prediction. The index is scaled to have values between
+0 (lowest reliability), and 9 (highest).
+The accuracies (Q3, corr, asf.) to be expected for residues with values
+above a particular value of the index are given below as well as the
+fraction of such residues (%res).:
+
++---+------------------------------+----+-------+-------+
+|RI | Q3 b%o b%p i%o i%p e%o e%p |Q10 | corr | %res |
++---+------------------------------+----+-------+-------+
+| 0 | 57.5 77 60 9 44 78 56 | 24 | 0.535 | 100.0 |
+| 1 | 59.1 76 63 9 45 82 57 | 25 | 0.560 | 91.2 |
+| 2 | 61.7 79 66 4 47 87 58 | 27 | 0.594 | 77.1 |
+| 3 | 66.6 87 70 1 51 89 63 | 30 | 0.650 | 57.1 |
+| 4 | 70.0 89 72 0 83 91 67 | 32 | 0.686 | 45.8 |
+| 5 | 72.9 92 75 0 0 93 70 | 34 | 0.722 | 35.6 |
+| 6 | 76.3 95 77 0 0 93 75 | 36 | 0.769 | 24.7 |
+| 7 | 79.0 97 79 0 0 93 78 | 39 | 0.803 | 16.0 |
+| 8 | 80.9 98 80 0 0 91 81 | 43 | 0.824 | 9.6 |
+| 9 | 81.2 99 80 0 0 88 83 | 45 | 0.828 | 5.9 |
++---+------------------------------+----+-------+-------+
+
+Abbreviations as before.
+
+The above table gives the cumulative results, e.g. 45.8% of all
+residues have a reliability of at least 4. The correlation for this
+most reliably predicted half of the residues is 0.686, i.e. a value
+comparable to what could be expected if homology modelling were
+possible. For this subset of 45.8% of all residues, 89% of the buried
+residues are correctly predicted, and 72% of all residues predicted to
+be buried are correct.
+
+..........................................................................
+
+The following table gives the non-cumulative quantities, i.e. the
+values per reliability index range. These numbers answer the question:
+how reliable is the prediction for all residues labeled with the
+particular index i.
+
++---+------------------------------+----+-------+-------+
+|RI | Q3 b%o b%p i%o i%p e%o e%p |Q10 | corr | %res |
++---+------------------------------+----+-------+-------+
+| 0 | 40.9 79 40 16 41 21 40 | 14 | 0.175 | 8.8 |
+| 1 | 45.4 61 46 28 44 48 44 | 17 | 0.278 | 14.1 |
+| 2 | 47.4 53 52 10 46 80 44 | 19 | 0.343 | 19.9 |
+| 3 | 52.9 75 59 4 50 77 47 | 23 | 0.439 | 11.4 |
+| 4 | 60.0 81 63 0 83 84 56 | 25 | 0.547 | 10.1 |
+| 5 | 65.2 82 70 0 0 93 62 | 28 | 0.607 | 10.9 |
+| 6 | 71.3 90 72 0 0 94 70 | 31 | 0.692 | 8.8 |
+| 7 | 76.0 94 76 0 0 95 75 | 34 | 0.762 | 6.3 |
+| 8 | 80.5 97 81 0 0 94 79 | 39 | 0.808 | 3.8 |
+| 9 | 81.2 99 80 0 0 88 83 | 45 | 0.828 | 5.9 |
++---+------------------------------+----+-------+-------+
+
+For example, for residues with RI = 4 83% of all predicted intermediate
+residues are correctly predicted as such.
+
+
+
+
+
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Prediction of helical transmembrane segments by PHDhtm:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Author: Burkhard Rost
+ EMBL, Heidelberg, FRG
+ Meyerhofstrasse 1, 69 117 Heidelberg
+ Internet: Rost@EMBL-Heidelberg.DE
+
+ All rights reserved.
+
+
+
+
+About the network method
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The PHD mail server is described in:
+ Rost, Burkhard; Sander, Chris; Schneider, Reinhard:
+ PHD - an automatic mail server for protein secondary structure
+ prediction.
+ CABIOS, 1994, 10, 53-60.
+
+To be quoted for publications of PHDhtm output:
+ Rost, Burkhard; Casadio, Rita; Fariselli, Piero; Sander, Chris:
+ Prediction of helical transmembrane segments at 95% accuracy.
+ Protein Science, 1995, 4, 521-533.
+
+
+
+Estimated Accuracy of Prediction
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A cross validation test on 69 helical trans-membrane proteins (in total
+about 30,000 residues) with less than 25% pairwise sequence identity
+gave the following results:
+
+++================++-----------------------------------------+
+|| Qtotal = 94.7% || ("overall two state accuracy") |
+++================++-----------------------------------------+
+
++----------------------------+-----------------------------+
+| Qhelix (% of observed)=92% | Qhelix (% of predicted)=83% |
+| Qloop (% of observed)=96% | Qloop (% of predicted)=97% |
++----------------------------+-----------------------------+
+
+..........................................................................
+
+These percentages are defined by:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+| number of correctly predicted residues
+|Qtotal = --------------------------------------- (*100)
+| number of all residues
+|
+| no of res correctly predicted to be in helix
+|Qhelix (% of obs) = -------------------------------------------- (*100)
+| no of all res observed to be in helix
+|
+|
+| no of res correctly predicted to be in helix
+|Qhelix (% of pred)= -------------------------------------------- (*100)
+| no of all residues predicted to be in helix
+
+..........................................................................
+
+Further measures of performance
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Matthews correlation coefficient:
+
++---------------------------------------------+
+| Chelix = 0.84, Cloop = 0.84 |
++---------------------------------------------+
+..........................................................................
+
+Average length of predicted secondary structure segments:
+
+| +------------+----------+
+| | predicted | observed |
++-----------+------------+----------+
+| Lhelix = | 24.6 | 22.2 |
++-----------+------------+----------+
+..........................................................................
+
+The accuracy matrix in detail:
+
++---------------------------------+
+| number of residues with H, L |
++---------+------+-------+--------+
+| |net H | net L |sum obs |
++---------+------+-------+--------+
+| obs H | 5214 | 492 | 5706 |
+| obs L | 1050 | 22423 | 23473 |
++---------+------+-------+--------+
+| sum Net | 6264 | 22915 | 29179 |
++---------+------+-------+--------+
+
+Note: This table is to be read in the following manner:
+ 5214 of all residues predicted to be in a helical trans-membrane
+ region, were observed to be in the lipid bilayer, 1050 however
+ were observed either inside or outside of the protein, i.e. in
+ loop (or non-membrane) regions. The term "observed" refers to DSSP
+ assignment of secondary structure calculated from 3D coordinates
+ of experimentally determined structures (Dictionary of Secondary
+ Structure of Proteins: Kabsch & Sander (1983) Biopolymers, 22,
+ 2577-2637) where these were available. For all other proteins,
+ the assignment of trans-membrane segments has been taken from the
+ Swissprot data bank (Bairoch, A.; Boeckmann, B.: The SWISS-PROT
+ protein sequence data bank. Nucl. Acids Res. 20: 2019-2022, 1992).
+
+..........................................................................
+
+Overlap between predicted and observed segments:
+
++-----------------+---------------+----------------+
+| segment overlap | % of observed | % of predicted |
+| Sov helix | 95.6% | 95.5% |
+| Sov loop | 83.6% | 97.2% |
++-----------------+---------------+----------------+
+| Sov total | 86.0% | 96.8% |
++-----------------+---------------+----------------+
+
+ Definition of Sov in: Rost et al., JMB, 1994, 235, 13-26.
+
+ As helical trans-membrane segments are longer than globular heli-
+ ces, correctly predicted segments can easily be made out. PHDhtm
+ misses 5 out of 258 observed segments, predicts 6 where non is
+ observed and 3 times the predicted helical segment overlaps two
+ observed regions. Thus, in total more than 95% of all segments
+ are correctly predicted.
+
+..........................................................................
+
+Entropy of prediction (information measure):
+
++-----------------+
+| I = 0.64 |
++-----------------+
+
+ (For comparison: homology modelling of globular proteins in three
+ states: I=0.62.)
+ Definition of Sov in: Rost et al., JMB, 1994, 235, 13-26.
+
+
+
+Position-specific reliability index
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The network predicts two states: helical trans-membrane region and rest
+using two output units. The prediction is assigned by choosing the ma-
+ximal unit ("winner takes all"). However, the real numbers of the out-
+put units contain additional information.
+E.g. the difference between the two output units can be used to derive
+a "reliability index". This index is given for each residue along with
+the prediction. The index is scaled to have values between 0 (lowest
+reliability), and 9 (highest).
+The accuracies (Qtot) to be expected for residues with values above a
+particular value of the index are given below as well as the fraction
+of such residues (%res).:
+
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| index| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
+| %res |100.0| 98.8| 97.3| 95.9| 94.1| 92.3| 89.9| 86.2| 75.0| 66.8|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| | | | | | | | | | | |
+| Qtot | 94.7| 95.2| 95.6| 96.2| 96.7| 97.2| 97.7| 98.4| 99.4| 99.8|
+| | | | | | | | | | | |
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+| H%obs| 91.8| 92.9| 93.8| 94.4| 95.0| 95.7| 96.2| 96.8| 95.5| 78.7|
+| L%obs| 95.3| 95.7| 96.1| 96.6| 97.0| 97.5| 98.1| 98.8| 99.7|100.0|
+| | | | | | | | | | | |
+| H%prd| 82.7| 83.8| 85.0| 86.7| 88.1| 89.7| 91.4| 93.8| 96.3| 97.1|
+| L%prd| 97.9| 98.3| 98.5| 98.7| 98.8| 99.0| 99.2| 99.4| 99.7| 99.9|
++------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+
+
+The above table gives the cumulative results, e.g. 92.3% of all
+residues have a reliability of at least 5. The overall two-state
+accuracy for this subset is 97.2%. For this subset, e.g., 95.7% of
+the observed helical trans-membrane residues are correctly predicted,
+and 89.7% of all residues predicted to be in helical trans-membrane
+segment are correct.
+
+
+
+
+
+
+
+The resulting network (PHD) prediction is:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+________________________________________________________________________________
+
+
+
+ PHD: Profile fed neural network systems from HeiDelberg
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Prediction of:
+ secondary structure, by PHDsec
+ solvent accessibility, by PHDacc
+ and helical transmembrane regions, by PHDhtm
+
+ Author:
+ Burkhard Rost
+ EMBL, 69012 Heidelberg, Germany
+ Internet: Rost@EMBL-Heidelberg.DE
+
+ All rights reserved.
+
+
+
+ The network systems are described in:
+
+ PHDsec: B Rost & C Sander: JMB, 1993, 232, 584-599.
+ B Rost & C Sander: Proteins, 1994, 19, 55-72.
+ PHDacc: B Rost & C Sander: Proteins, 1994, 20, 216-226.
+ PHDhtm: B Rost et al.: Prot. Science, 1995, 4, 521-533.
+
+
+
+ Some statistics
+ ~~~~~~~~~~~~~~~
+
+ Percentage of amino acids:
+ +--------------+--------+--------+--------+--------+--------+
+ | AA: | L | A | S | G | I |
+ | % of AA: | 13.0 | 10.0 | 9.7 | 8.9 | 8.6 |
+ +--------------+--------+--------+--------+--------+--------+
+ | AA: | V | R | T | F | D |
+ | % of AA: | 7.8 | 5.2 | 4.5 | 4.5 | 4.5 |
+ +--------------+--------+--------+--------+--------+--------+
+ | AA: | N | Q | E | P | K |
+ | % of AA: | 4.1 | 3.0 | 3.0 | 2.6 | 2.6 |
+ +--------------+--------+--------+--------+--------+--------+
+ | AA: | Y | M | W | H | C |
+ | % of AA: | 1.9 | 1.9 | 1.5 | 1.5 | 1.5 |
+ +--------------+--------+--------+--------+--------+--------+
+
+ Percentage of secondary structure predicted:
+ +--------------+--------+--------+--------+
+ | SecStr: | H | E | L |
+ | % Predicted: | 43.9 | 16.7 | 39.4 |
+ +--------------+--------+--------+--------+
+
+ According to the following classes:
+ all-alpha: %H>45 and %E< 5; all-beta : %H<5 and %E>45
+ alpha-beta : %H>30 and %E>20; mixed: rest,
+ this means that the predicted class is: mixed class
+
+
+
+ PHD output for your protein
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Tue Nov 24 17:44:57 1998
+ Jury on: 10 different architectures (version 5.94_317 ).
+ Note: differently trained architectures, i.e., different versions can
+ result in different predictions.
+
+
+
+ About the protein
+ ~~~~~~~~~~~~~~~~~
+
+ HEADER /home/phd/server/work/predict_h25873-220
+ COMPND
+ SOURCE
+ AUTHOR
+ SEQLENGTH 269
+ NCHAIN 1 chain(s) in predict_h25873-22040 data set
+ NALIGN 48
+ (=number of aligned sequences in HSSP file)
+
+
+
+ Abbreviations: PHDsec
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ sequence:
+ AA : amino acid sequence
+ secondary structure:
+ HEL: H=helix, E=extended (sheet), blank=other (loop)
+ PHD: Profile network prediction HeiDelberg
+ Rel: Reliability index of prediction (0-9)
+ detail:
+ prH: 'probability' for assigning helix
+ prE: 'probability' for assigning strand
+ prL: 'probability' for assigning loop
+ note: the 'probabilites' are scaled to the interval 0-9, e.g.,
+ prH=5 means, that the first output node is 0.5-0.6
+ subset:
+ SUB: a subset of the prediction, for all residues with an expected
+ average accuracy > 82% (tables in header)
+ note: for this subset the following symbols are used:
+ L: is loop (for which above " " is used)
+ ".": means that no prediction is made for this residue, as the
+ reliability is: Rel < 5
+
+ Abbreviations: PHDacc
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ SS : secondary structure
+ HEL: H=helix, E=extended (sheet), blank=other (loop)
+ solvent accessibility:
+ 3st: relative solvent accessibility (acc) in 3 states:
+ b = 0-9%, i = 9-36%, e = 36-100%.
+ PHD: Profile network prediction HeiDelberg
+ Rel: Reliability index of prediction (0-9)
+ O_3: observed relative acc. in 3 states: B, I, E
+ note: for convenience a blank is used intermediate (i).
+ P_3: predicted relative accessibility in 3 states
+ 10st:relative accessibility in 10 states:
+ = n corresponds to a relative acc. of n*n %
+ subset:
+ SUB: a subset of the prediction, for all residues with an expected
+ average correlation > 0.69 (tables in header)
+ note: for this subset the following symbols are used:
+ "I": is intermediate (for which above " " is used)
+ ".": means that no prediction is made for this residue, as the
+ reliability is: Rel < 4
+
+
+ Abbreviations: PHDhtm
+ ~~~~~~~~~~~~~~~~~~~~~
+
+ secondary structure:
+ HL: T=helical transmembrane region, blank=other (loop)
+ PHD: Profile network prediction HeiDelberg
+ PHDF:filtered prediction, i.e., too long transmembrane segments
+ are split, too short ones are deleted
+ Rel: Reliability index of prediction (0-9)
+ detail:
+ prH: 'probability' for assigning helical transmembrane region
+ prL: 'probability' for assigning loop
+ note: the 'probabilites' are scaled to the interval 0-9, e.g.,
+ prH=5 means, that the first output node is 0.5-0.6
+ subset:
+ SUB: a subset of the prediction, for all residues with an expected
+ average accuracy > 82% (tables in header)
+ note: for this subset the following symbols are used:
+ L: is loop (for which above " " is used)
+ ".": means that no prediction is made for this residue, as the
+ reliability is: Rel < 5
+
+
+
+ protein: predict length 269
+
+ ....,....1....,....2....,....3....,....4....,....5....,....6
+ AA |MASEIKKKLFWRAVVAEFLAMTLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSI|
+ PHD sec | HHHHHHHHHHHHHHHHHHHHHHHHHHEE HHHHHHHHHHHHH|
+ Rel sec |998443148899999999999998997676530312469989998623353579999999|
+ detail:
+ prH sec |001223468899999999999998888777653112210000000145566788999999|
+ prE sec |000011000000000000000001001111233542100000000000323211000000|
+ prL sec |998665420100000000000000000011112244578988998753100000000000|
+ subset: SUB sec |LLL.....HHHHHHHHHHHHHHHHHHHHHHH......LLLLLLLLL...H.HHHHHHHHH|
+
+ ACCESSIBILITY
+ 3st: P_3 acc |eeeebee bbb bbbbbbbbbbbbbbbbbbbbbebeee eeeeeeeeebbbbbbbbbbbb|
+ 10st: PHD acc |997706650005000000000000000000000607775779776677000000000000|
+ Rel acc |735421110541467608662789996343122133420454330023453975664547|
+ subset: SUB acc |e.ee.....bb.bbbb.bbb.bbbbbb.b.......e..eee......bb.bbbbbbbbb|
+ ....,....7....,....8....,....9....,....10...,....11...,....12
+ AA |ATLAQSVGHISGAHSNPAVTLGLLLSCQISILRAVMYIIAQCVGAIVASAILSGITSSLL|
+ PHD sec |HHHHHHHHHE HHHHEHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH |
+ Rel sec |999996412122653167703135552356779999999999999999999998467213|
+ detail:
+ prH sec |998986544334223477843456665567779999999999999999999998611343|
+ prE sec |001001123420010000145432101221110000000000000000000000000000|
+ prL sec |000001232245765521000000123210000000000000000000000000278555|
+ subset: SUB sec |HHHHHH......LL..HHH....HHH..HHHHHHHHHHHHHHHHHHHHHHHHHH.LL...|
+
+ ACCESSIBILITY
+ 3st: P_3 acc |bbbbebbbebbbbbb bbbbbbbbbbbebbbbbbbbbbbbbbbbbbbbbbbbeebbeeeb|
+ 10st: PHD acc |000060006000000500000000000600000000000000000000000067006760|
+ Rel acc |456515321655013144869663400154551757478936465465467713401400|
+ subset: SUB acc |bbbb.b...bbb....bbbbbbb.b...bbbb.bbbbbbb.bbbbbbbbbbb..b..e..|
+ ....,....13...,....14...,....15...,....16...,....17...,....18
+ AA |ENSLGRNDLARGVNSGQGLGIEIIGTLQLVLCVLATTDRRRRDLGGSAPLAIGLSVALGH|
+ PHD sec | HHH EEEEEEEEEEEEEEEEEEE E E HHHHHH|
+ Rel sec |359985212134223651899898866789799875436658889963211351457756|
+ detail:
+ prH sec |320002345432332111000000000000100000221120000000001113567767|
+ prE sec |100000000000011014899888877789789886100000000013544222221111|
+ prL sec |568986543466545763100000011100000112567768889975454564210111|
+ subset: SUB sec |.LLLLL.........LL.EEEEEEEEEEEEEEEEEE..LLLLLLLLL.....L..HHHHH|
+
+ ACCESSIBILITY
+ 3st: P_3 acc |eeebbbebbbeebeebeebbbbbbbbbbbbbbbbbbbeeeeeeeebbbbbbbbbbbbbbb|
+ 10st: PHD acc |677000600077076077000000000000000000077767767000000000000000|
+ Rel acc |133100124043040233247198656399879530035414413123255869586654|
+ subset: SUB acc |........b.e..e.....bb.bbbbb.bbbbbb....ee.ee......bbbbbbbbbbb|
+ ....,....19...,....20...,....21...,....22...,....23...,....24
+ AA |LLAIDYTGCGINPARSFGSAVLTRNFSNHWIFWVGPFIGSALAVLIYDFILAPRSSDFTD|
+ PHD sec |HEEEE E HHHEEEE EEEEEE HHHHHHHHHHHHHEEEEE |
+ Rel sec |321341126989622145152653534229996251699999999973147525556642|
+ detail:
+ prH sec |521100000000145432463121122000000114789999999875421111121124|
+ prE sec |244564431000000000015765121358997510000000000013467642110000|
+ prL sec |233234457889754567411012655530002364200000000010010136667765|
+ subset: SUB sec |........LLLLL....H.H.EE.L....EEEE.L.HHHHHHHHHHH...EE.LLLLL..|
+
+ ACCESSIBILITY
+ 3st: P_3 acc |bbbbebbbbbbebb bbbbbbbbeebeebbbbbbbbbbbbbbbbbbbbbbbbeeeee ee|
+ 10st: PHD acc |000060000006005000000007606600000000000000000000000076777577|
+ Rel acc |754424240102242141047612131118967874356346635751777031345044|
+ subset: SUB acc |bbbb.b.b.....b..b..bbb.......bbbbbbb.bb.bbb.bbb.bbb....ee.ee|
+ ....,....25...,....26...,....27...,....28...,....29...,....30
+ AA |RMKVWTSGQVEEYDLDADDINSRVEMKPK|
+ PHD sec |HHHHHH |
+ Rel sec |66775259975467555457776422699|
+ detail:
+ prH sec |77887520012221222221111100000|
+ prE sec |00000000000000000000001233200|
+ prL sec |11112379987678777678887655799|
+ subset: SUB sec |HHHHH.LLLLL.LLLLL.LLLLL...LLL|
+
+ ACCESSIBILITY
+ 3st: P_3 acc |ebebbeeeeeeeeeeeeeeeeeebeeeee|
+ 10st: PHD acc |60700787677777677777767067789|
+ Rel acc |10411563134335144444514212559|
+ subset: SUB acc |..e..ee...e..e.eeeeee.e...eee|
+
+
+ PHDhtm Helical transmembrane prediction
+ note: PHDacc and PHDsec are reliable for water-
+ soluble globular proteins, only. Thus,
+ please take the predictions above with
+ particular caution wherever transmembrane
+ helices are predicted by PHDhtm!
+
+
+ PHDhtm
+---
+--- PhdTopology REFINEMENT AND TOPOLOGY PREDICTION: SYMBOLS
+--- AA : amino acid in one-letter code
+--- PHD htm : HTM's predicted by the PHD neural network
+--- system (T=HTM, ' '=not HTM)
+--- Rel htm : Reliability index of prediction (0-9, 0 is low)
+--- detail : Neural network output in detail
+--- prH htm : 'Probability' for assigning a helical trans-
+--- membrane region (HTM)
+--- prL htm : 'Probability' for assigning a non-HTM region
+--- note: 'Probabilites' are scaled to the interval
+--- 0-9, e.g., prH=5 means, that the first
+--- output node is 0.5-0.6
+--- subset : Subset of more reliable predictions
+--- SUB htm : All residues for which the expected average
+--- accuracy is > 82% (tables in header).
+--- note: for this subset the following symbols are used:
+--- L: is loop (for which above ' ' is used)
+--- '.': means that no prediction is made for this,
+--- residue as the reliability is: Rel < 5
+--- other : predictions derived based on PHDhtm
+--- PHDFhtm : filtered prediction, i.e., too long HTM's are
+--- split, too short ones are deleted
+--- PHDRhtm : refinement of neural network output
+--- PHDThtm : topology prediction based on refined model
+--- symbols used:
+--- i: intra-cytoplasmic
+--- T: transmembrane region
+--- o: extra-cytoplasmic
+---
+--- PhdTopology REFINEMENT AND TOPOLOGY PREDICTION
+ ....,....1....,....2....,....3....,....4....,....5....,....6
+ AA |MASEIKKKLFWRAVVAEFLAMTLFVFISIGSALGFNYPLERNQTLVQDNVKVSLAFGLSI|
+ PHD htm | TTTTTTTTTTTTTTTTTTT TTTTTTTTTTTT|
+ detail: | |
+ prH htm |000000000001136788999999999988875321110000000123678889999988|
+ prL htm |999999999998863211000000000011124678889999999876321110000011|
+ other: | |
+ PHDFhtm | TTTTTTTTTTTTTTTTTTT TTTTTTTTTTT|
+ PHDRhtm | TTTTTTTTTTTTTTTTTT TTTTTTTTTTT|
+ PHDThtm |iiiiiiiiiiiiiiTTTTTTTTTTTTTTTTTToooooooooooooooooTTTTTTTTTTT|
+ subset: | |
+ SUB htm |............................................................|
+ ....,....7....,....8....,....9....,....10...,....11...,....12
+ AA |ATLAQSVGHISGAHSNPAVTLGLLLSCQISILRAVMYIIAQCVGAIVASAILSGITSSLL|
+ PHD htm |TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT |
+ detail: | |
+ prH htm |888888877777666677788888888888888888888888888888888876543211|
+ prL htm |111111122222333322211111111111111111111111111111111123456788|
+ other: | |
+ PHDFhtm |TTTTTTTTTTTTTTTT TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT |
+ PHDRhtm |TTTTTTTT TTTTTTTTTTTTTTTTTTTTTTTTT |
+ PHDThtm |TTTTTTTTiiiiiiiiiiiiiTTTTTTTTTTTTTTTTTTTTTTTTToooooooooooooo|
+ subset: | |
+ SUB htm |............................................................|
+ ....,....13...,....14...,....15...,....16...,....17...,....18
+ AA |ENSLGRNDLARGVNSGQGLGIEIIGTLQLVLCVLATTDRRRRDLGGSAPLAIGLSVALGH|
+ PHD htm | TTTTTTTTTTTTTTTTTTT TTTTTTTTTTTTT|
+ detail: | |
+ prH htm |000000000001234567788888999988887643211111111235788899998888|
+ prL htm |999999999998765432211111000011112356788888888764211100001111|
+ other: | |
+ PHDFhtm | TTTTTTTTTTTTTTTTTTT TTTTTTTTTTTTT|
+ PHDRhtm | TTTTTTTTTTTTTTTTTT TTTTTTTTTTTT|
+ PHDThtm |ooooooooooooooooTTTTTTTTTTTTTTTTTTiiiiiiiiiiiiiiTTTTTTTTTTTT|
+ subset: | |
+ SUB htm |............................................................|
+ ....,....19...,....20...,....21...,....22...,....23...,....24
+ AA |LLAIDYTGCGINPARSFGSAVLTRNFSNHWIFWVGPFIGSALAVLIYDFILAPRSSDFTD|
+ PHD htm |TTTTTTTTT TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT |
+ detail: | |
+ prH htm |888887765443432233334566777777788888888888888888887542100000|
+ prL htm |111112234556567766665433222222211111111111111111112457899999|
+ other: | |
+ PHDFhtm |TTTTTTTTT TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT |
+ PHDRhtm |TTTTTT TTTTTTTTTTTTTTTTTTT |
+ PHDThtm |TTTTTToooooooooooooooooooooooooTTTTTTTTTTTTTTTTTTTiiiiiiiiii|
+ subset: | |
+ SUB htm |............................................................|
+ ....,....25...,....26...,....27...,....28...,....29...,....30
+ AA |RMKVWTSGQVEEYDLDADDINSRVEMKPK|
+ PHD htm | |
+ detail: | |
+ prH htm |00000000000000000000000000000|
+ prL htm |99999999999999999999999999999|
+ other: | |
+ PHDFhtm | |
+ PHDRhtm | |
+ PHDThtm |iiiiiiiiiiiiiiiiiiiiiiiiiiiii|
+ subset: | |
+ SUB htm |.............................|
+---
+--- PhdTopology REFINEMENT AND TOPOLOGY PREDICTION END
+---
+
+________________________________________________________________________________
+
+
+
+________________________________________________________________________________
+
+
+-----------------------------------------------------------------------------
+--- PredictProtein: NEWS from January, 1997 ---
+--- ---
+--- Dear user, ---
+--- ---
+--- as of January 1, 1997, EMBL has effectively decided to not ---
+--- support the PredictProtein service by personal resources. I do ---
+--- maintain the program, so to speak, in my private time. However, ---
+--- my contract obliges me to do science, instead. Unfortunately, ---
+--- the computer environment at EMBL is at the same time starting ---
+--- to become increasingly unstable. Consequence of these two re- ---
+--- cent developments is that the PredictProtein service is not as ---
+--- stable as it was. ---
+--- ---
+--- I apologise for the problems this may cause. In particular, ---
+--- I apologise for my inability to reply to the 20-30 daily, per- ---
+--- sonal mails, and suggest to re-submit requests after 24 hours! ---
+--- ---
+--- Hoping that I shall find a more convenient solution for the ---
+--- future of the PredictProtein I remain with my best regards, ---
+--- ---
+--- Burkhard Rost ---
+-----------------------------------------------------------------------------
+--- PredictProtein: NEWS from April, 1998 ---
+--- ---
+-------------------------------- ---
+--- MOVING PredictProtein ---
+--- There appears to be light on the horizon! PP will may be having ---
+--- many hickups over the next months (as I shall leave EMBL). How- ---
+--- ever, the server seems to have a fair chance of survival thanks ---
+--- to a major support that is being raised by Columbia University, ---
+--- New York, U.S.A.). I hope that this will settle the issue for ---
+--- the years to come ... ---
+-------------------------------- ---
+--- WARNING ---
+--- After a major rewriting of most of the PP code over the last, ---
+--- I am afraid that not all errors have been traced by me, yet. ---
+--- Thus, please have mercy and report any bug you'll encounter! ---
+--- THANKS, Burkhard Rost ---
+-------------------------------- ---
+--- NEW PREDICTION DEFAULTS ---
+--- * Coiled-coil regions: now by default the program COILS written by ---
+--- Andrei Lupas is run on your sequence. An output is returned if a ---
+--- coiled-coil region has been detected. ---
+--- * Functional sequence motifs: now by default the PROSITE database ---
+--- written by Amos Bairoch, Philip Bucher and Kay Hofmann is scanned ---
+--- for sequence motifs. An output is returned if any motif has been ---
+--- detected. ---
+-------------------------------- ---
+--- see http://www.embl-heidelberg.de/predictprotein/ppNews.html ---
+--- for a description of the following new options. ---
+--- NEW INPUT OPTION ---
+--- * Your input sequence(s) in FASTA-list format ("# FASTA list ") ---
+--- NEW OUTPUT OPTIONS ---
+--- * Return also BLASTP output ("return blast") ---
+--- * Return prediction additionally in RDB format ("return phd rdb") ---
+--- * Return topits hssp ("return topits hssp") ---
+--- * Return topits strip ("return topits strip") ---
+--- * Return topits own ("return topits own") ---
+--- * Return no coils ("return no coils") ---
+--- * Return no prosite ("return no prosite") ---
+-----------------------------------------------------------------------------
+%</AQP1PHD>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQPHMMsgl>
+>HP: 269 AQP1 IN 6 14 33 54 73 94 112 139 156 165 184 211 230
+>HP: 271 AQP2 IN 6 17 35 44 65 86 104 131 148 157 176 203 224
+>HP: 285 AQP3 IN 6 22 41 50 72 103 122 153 172 185 207 238 260
+>HP: 323 AQP4 IN 6 37 57 70 92 123 147 160 177 186 205 232 254
+>HP: 265 AQP5 IN 6 13 32 59 78 87 110 131 149 158 177 204 228
+%</AQPHMMsgl>
+% \end{macrocode}
+% \begin{macrocode}
+%<*AQPHMMext>
+Protein: AQP1
+Length: 269
+N-terminus: IN
+Number of transmembrane helices: 6
+Transmembrane helices: 14-33 54-73 94-112 139-156 165-184 211-230
+
+Total entropy of the model: 17.0025
+Entropy of the best path: 17.0049
+
+The best path:
+
+ seq MASEIKKKLF WRAVVAEFLA MTLFVFISIG SALGFNYPLE RNQTLVQDNV 50
+ pred IIIIiiiiii iiiHHHHHHH HHHHHHHHHH HHHooooooo oooooooooo
+
+ seq KVSLAFGLSI ATLAQSVGHI SGAHSNPAVT LGLLLSCQIS ILRAVMYIIA 100
+ pred oooHHHHHHH HHHHHHHHHH HHHiiiiiii iiiiiiiiii iiiHHHHHHH
+
+ seq QCVGAIVASA ILSGITSSLL ENSLGRNDLA RGVNSGQGLG IEIIGTLQLV 150
+ pred HHHHHHHHHH HHoooooooo oooooooooo ooooooooHH HHHHHHHHHH
+
+ seq LCVLATTDRR RRDLGGSAPL AIGLSVALGH LLAIDYTGCG INPARSFGSA 200
+ pred HHHHHHiiii iiiiHHHHHH HHHHHHHHHH HHHHoooooo oooooooooo
+
+ seq VLTRNFSNHW IFWVGPFIGS ALAVLIYDFI LAPRSSDFTD RMKVWTSGQV 250
+ pred oooooooooo HHHHHHHHHH HHHHHHHHHH iiiiiiiiii iiiiiIIIII
+
+ seq EEYDLDADDI NSRVEMKPK 269
+ pred IIIIIIIIII IIIIIIIII
+
+Protein: AQP2
+Length: 271
+N-terminus: IN
+Number of transmembrane helices: 6
+Transmembrane helices: 17-35 44-65 86-104 131-148 157-176 203-224
+
+Total entropy of the model: 17.0017
+Entropy of the best path: 17.0046
+
+The best path:
+
+ seq MWELRSIAFS RAVLAEFLAT LLFVFFGLGS ALQWASSPPS VLQIAVAFGL 50
+ pred IIIIIIiiii iiiiiiHHHH HHHHHHHHHH HHHHHooooo oooHHHHHHH
+
+ seq GIGILVQALG HVSGAHINPA VTVACLVGCH VSFLRAAFYV AAQLLGAVAG 100
+ pred HHHHHHHHHH HHHHHiiiii iiiiiiiiii iiiiiHHHHH HHHHHHHHHH
+
+ seq AAILHEITPV EIRGDLAVNA LHNNATAGQA VTVELFLTMQ LVLCIFASTD 150
+ pred HHHHoooooo oooooooooo oooooooooo HHHHHHHHHH HHHHHHHHii
+
+ seq ERRGDNLGSP ALSIGFSVTL GHLLGIYFTG CSMNPARSLA PAVVTGKFDD 200
+ pred iiiiiiHHHH HHHHHHHHHH HHHHHHoooo oooooooooo oooooooooo
+
+ seq HWVFWIGPLV GAIIGSLLYN YLLFPSAKSL QERLAVLKGL EPDTDWEERE 250
+ pred ooHHHHHHHH HHHHHHHHHH HHHHiiiiii iiiiiiiiiI IIIIIIIIII
+
+ seq VRRRQSVELH SPQSLPRGSK A 271
+ pred IIIIIIIIII IIIIIIIIII I
+
+Protein: AQP3
+Length: 285
+N-terminus: IN
+Number of transmembrane helices: 6
+Transmembrane helices: 22-41 50-72 103-122 153-172 185-207 238-260
+
+Total entropy of the model: 17.0059
+Entropy of the best path: 17.0075
+
+The best path:
+
+ seq MNRCGEMLHI RYRLLRQALA ECLGTLILVM FGCGSVAQVV LSRGTHGGFL 50
+ pred IIIIIIiiii iiiiiiiiii iHHHHHHHHH HHHHHHHHHH HooooooooH
+
+ seq TINLAFGFAV TLAILVAGQV SGAHLNPAVT FAMCFLAREP WIKLPIYTLA 100
+ pred HHHHHHHHHH HHHHHHHHHH HHiiiiiiii iiiiiiiiii iiiiiiiiii
+
+ seq QTLGAFLGAG IVFGLYYDAI WAFAGNELVV SGPNGTAGIF ATYPSGHLDM 150
+ pred iiHHHHHHHH HHHHHHHHHH HHoooooooo oooooooooo oooooooooo
+
+ seq VNGFFDQFIG TAALIVCVLA IVDPYNNPVP RGLEAFTVGL VVLVIGTSMG 200
+ pred ooHHHHHHHH HHHHHHHHHH HHiiiiiiii iiiiHHHHHH HHHHHHHHHH
+
+ seq FNSGYAVNPA RDFGPRLFTA LAGWGSEVFT TGQNWWWVPI VSPLLGSIGG 250
+ pred HHHHHHHooo oooooooooo oooooooooo oooooooHHH HHHHHHHHHH
+
+ seq VFVYQLMIGC HLEQPPPSTE AENVKLAHMK HKEQI 285
+ pred HHHHHHHHHH iiiiiiiiii iiiiiIIIII IIIII
+
+Protein: AQP4
+Length: 323
+N-terminus: IN
+Number of transmembrane helices: 6
+Transmembrane helices: 37-57 70-92 123-147 160-177 186-205 232-254
+
+Total entropy of the model: 17.0058
+Entropy of the best path: 17.0091
+
+The best path:
+
+ seq MSDGAAARRW GKCGPPCSRE SIMVAFKGVW TQAFWKAVTA EFLAMLIFVL 50
+ pred IIIIIIIIII IIIIIIIIII Iiiiiiiiii iiiiiiHHHH HHHHHHHHHH
+
+ seq LSVGSTINWG GSENPLPVDM VLISLCFGLS IATMVQCFGH ISGGHINPAV 100
+ pred HHHHHHHooo oooooooooH HHHHHHHHHH HHHHHHHHHH HHiiiiiiii
+
+ seq TVAMVCTRKI SIAKSVFYIT AQCLGAIIGA GILYLVTPPS VVGGLGVTTV 150
+ pred iiiiiiiiii iiiiiiiiii iiHHHHHHHH HHHHHHHHHH HHHHHHHooo
+
+ seq HGNLTAGHGL LVELIITFQL VFTIFASCDS KRTDVTGSVA LAIGFSVAIG 200
+ pred oooooooooH HHHHHHHHHH HHHHHHHiii iiiiiHHHHH HHHHHHHHHH
+
+ seq HLFAINYTGA SMNPARSFGP AVIMGNWENH WIYWVGPIIG AVLAGALYEY 250
+ pred HHHHHooooo oooooooooo oooooooooo oHHHHHHHHH HHHHHHHHHH
+
+ seq VFCPDVELKR RLKEAFSKAA QQTKGSYMEV EDNRSQVETE DLILKPGVVH 300
+ pred HHHHiiiiii iiiiiiiiiI IIIIIIIIII IIIIIIIIII IIIIIIIIII
+
+ seq VIDIDRGDEK KGKDSSGEVL SSV 323
+ pred IIIIIIIIII IIIIIIIIII III
+
+Protein: AQP5
+Length: 265
+N-terminus: IN
+Number of transmembrane helices: 6
+Transmembrane helices: 13-32 59-78 87-110 131-149 158-177 204-228
+
+Total entropy of the model: 17.0020
+Entropy of the best path: 17.0052
+
+The best path:
+
+ seq MKKEVCSLAF FKAVFAEFLA TLIFVFFGLG SALKWPSALP TILQISIAFG 50
+ pred IIIIIIIIii iiHHHHHHHH HHHHHHHHHH HHoooooooo oooooooooo
+
+ seq LAIGTLAQAL GPVSGGHINP AITLALLIGN QISLLRAVFY VAAQLVGAIA 100
+ pred ooooooooHH HHHHHHHHHH HHHHHHHHii iiiiiiHHHH HHHHHHHHHH
+
+ seq GAGILYWLAP LNARGNLAVN ALNNNTTPGK AMVVELILTF QLALCIFSST 150
+ pred HHHHHHHHHH oooooooooo oooooooooo HHHHHHHHHH HHHHHHHHHi
+
+ seq DSRRTSPVGS PALSIGLSVT LGHLVGIYFT GCSMNPARSF GPAVVMNRFS 200
+ pred iiiiiiiHHH HHHHHHHHHH HHHHHHHooo oooooooooo oooooooooo
+
+ seq PSHWVFWVGP IVGAMLAAIL YFYLLFPSSL SLHDRVAVVK GTYEPEEDWE 250
+ pred oooHHHHHHH HHHHHHHHHH HHHHHHHHii iiiiiiiiii iiiIIIIIII
+
+ seq DHREERKKTI ELTAH 265
+ pred IIIIIIIIII IIIII
+%</AQPHMMext>
+% \end{macrocode}
+% \begin{macrocode}
+%<*Standard>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% Standard genetic code definitions %%%%%
+%%%%% %%%%%
+%%%%% (The last codon of each list is used for backtranslations %%%%%
+%%%%% from protein to DNA sequences---therefore the wobbles) %%%%%
+%%%%% %%%%%
+%%%%% These definitions are default in TeXshade. %%%%%
+%%%%% There is no need to load them. This is an example file only. %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\codon{A}{GCA,GCG,GCC,GCT,GCU,GCN}
+\codon{C}{TGC,TGT,UGC,UGU,TGY}
+\codon{D}{GAC,GAT,GAU,GAY}
+\codon{E}{GAA,GAG,GAR}
+\codon{F}{TTC,TTT,UUC,UUU,TTY}
+\codon{G}{GGA,GGG,GGC,GGT,GGU,GGN}
+\codon{H}{CAC,CAT,CAY}
+\codon{I}{ATA,ATC,ATT,AUA,AUC,AUU,ATH}
+\codon{K}{AAA,AAG,AAG,AAR}
+\codon{L}{CTA,CTG,CTC,CTT,TTA,TTG,CUG,CUG,CUC,CUU,UUA,UUG,YTN}
+\codon{M}{ATG,AUG,ATG}
+\codon{N}{AAC,AAT,AAU,AAY}
+\codon{P}{CCA,CCG,CCC,CCT,CCU,CCN}
+\codon{Q}{CAA,CAG,CAR}
+\codon{R}{AGA,AGG,CGA,CGG,CGC,CGT,CGU,MGN}
+\codon{S}{TCT,TCC,TCG,TCA,AGT,AGC,UCU,UCC,UCG,UCA,AGU,WSN}
+\codon{T}{ACT,ACC,ACG,ACA,ACU,ACN}
+\codon{V}{GTA,GTG,GTC,GTT,GUA,GUG,GUC,GUU,GTN}
+\codon{W}{TGG,UGG,TGG}
+\codon{Y}{TAC,TAT,UAC,UAU,TAY}
+\codon{.}{TAA,TAG,TGA,UAA,UAG,UGA,TRR}
+%</Standard>
+% \end{macrocode}
+% \begin{macrocode}
+%<*Ciliate>
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%% %%%%%
+%%%%% Ciliate macronuclear genetic code definitions %%%%%
+%%%%% %%%%%
+%%%%% Only exchanges compared to the standard code must be defined. %%%%%
+%%%%% %%%%%
+%%%%% (The last codon of the list is used for backtranslations %%%%%
+%%%%% from protein to DNA sequences---therefore the wobbles) %%%%%
+%%%%% %%%%%
+%%%%% %%%%%
+%%%%% Activate these definitions for your alignment by the following %%%%%
+%%%%% command in the texshade environment: %%%%%
+%%%%% %%%%%
+%%%%% \geneticcode{ciliate} %%%%%
+%%%%% %%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\codon{Q}{TAA,TAG,UAA,UAG,YAR}
+%</Ciliate>
+% \end{macrocode}
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/latex/texshade/texshade.ins b/Master/texmf-dist/source/latex/texshade/texshade.ins
new file mode 100644
index 00000000000..14679e1c3ff
--- /dev/null
+++ b/Master/texmf-dist/source/latex/texshade/texshade.ins
@@ -0,0 +1,72 @@
+%%
+%% docstrip install file for texshade.sty
+%%
+%% Copyright 1999-2005 Eric Beitz
+%%
+\def\batchfile{texshade.ins}
+
+\input docstrip
+
+\askforoverwritefalse
+\keepsilent
+
+\declarepreamble\texshade
+
+LaTeX package for typesetting nucleotide and peptide alignments
+
+Copyright (C) 1999-2005 Eric Beitz
+See the file texshade.txt
+
+\endpreamble
+
+\generate{\usepreamble\texshade%
+ \file{texshade.sty}{\from{texshade.dtx}{texshade}}}
+
+\generate{\usepreamble\empty \usepostamble\empty%
+ \file{texshade.def}{\from{texshade.dtx}{definitions}}
+ \file{AQPDNA.MSF}{\from{texshade.dtx}{AQPDNA}}
+ \file{AQPpro.MSF}{\from{texshade.dtx}{AQPpro}}
+ \file{AQP2spec.ALN}{\from{texshade.dtx}{AQP2spec}}
+ \file{AQP1.top}{\from{texshade.dtx}{AQP1topo}}
+ \file{AQP1.phd}{\from{texshade.dtx}{AQP1PHD}}
+ \file{AQP_HMM.sgl}{\from{texshade.dtx}{AQPHMMsgl}}
+ \file{AQP_HMM.ext}{\from{texshade.dtx}{AQPHMMext}}
+ \file{standard.cod}{\from{texshade.dtx}{Standard}}
+ \file{ciliate.cod}{\from{texshade.dtx}{Ciliate}}}
+
+\Msg{**************************************************************}
+\Msg{*}
+\Msg{* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
+\Msg{* !!! Have you used a docstrip version 2.4 or later?}
+\Msg{* !!!}
+\Msg{* !!! IF NOT GO AND GET A RECENT VERSION!}
+\Msg{* !!!}
+\Msg{* !!! The documentation will not run through TeX with}
+\Msg{* !!! your files extracted by an old docstrip version!}
+\Msg{* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}
+\Msg{*}
+\Msg{* To finish the installation you have to move the following}
+\Msg{* files into a directory searched by LaTeX:}
+\Msg{*}
+\Msg{* \space\space texshade.sty}
+\Msg{* \space\space texshade.def}
+\Msg{* \space\space standard.cod}
+\Msg{* \space\space ciliate.cod}
+\Msg{*}
+\Msg{* To produce the documentation run the following file twice}
+\Msg{* through LaTeX:}
+\Msg{*}
+\Msg{* \space\space texshade.dtx}
+\Msg{*}
+\Msg{* Make sure that the following files are present in the same}
+\Msg{* directory as texshade.dtx (needed for texing the doc):}
+\Msg{*}
+\Msg{* \space\space AQPDNA.MSF}
+\Msg{* \space\space AQPpro.MSF}
+\Msg{* \space\space APQ2spec.ALN}
+\Msg{* \space\space AQP1.top}
+\Msg{* \space\space APQ1.phd}
+\Msg{*}
+\Msg{* Happy TeXing!}
+\Msg{*}
+\Msg{**************************************************************}
diff --git a/Master/texmf-dist/source/latex/timesht/timesht.dtx b/Master/texmf-dist/source/latex/timesht/timesht.dtx
new file mode 100644
index 00000000000..fb01c22756a
--- /dev/null
+++ b/Master/texmf-dist/source/latex/timesht/timesht.dtx
@@ -0,0 +1,410 @@
+% \iffalse
+%
+% File timesht.dtx
+% Copyright (C) 1996 by Frank Bennett. All rights reserved.
+%
+% IMPORTANT NOTICE:
+%
+% You are not allowed to change this file. You may however copy
+% this file to a file with a different name and then change the
+% copy if (a) you do not charge for the modified code, (b) you
+% acknowledge the author in the new file, if it
+% is distributed to others, and (c) you attach these same
+% conditions to the new file.
+%
+% You are not allowed to distribute this file alone. You are not
+% allowed to take money for the distribution or use of this file
+% (or a changed version) except for a nominal charge for copying
+% etc.
+%
+% You are allowed to distribute this file under the condition that
+% it is distributed with all of its contents, intact.
+%
+% For error reports, or offers to help make Calendar a more powerful,
+% friendlier, and altogether more thrilling package, please contact me on
+% fb@soas.ac.uk
+%
+%<*dtx>
+ \ProvidesFile{timesht.dtx}
+%</dtx>
+%<style>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<style>\ProvidesPackage{timesht}
+%<style> [1996/11/09 v0.03 Timesheet generator (Frank Bennett)]
+% \fi
+%
+% \def\fileversion{v0.03}
+% \def\filedate{1996/11/27}
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\begin{document}
+%\OnlyDescription % comment out for implementation details
+\DocInput{timesht.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{v0.01}{1996/11/10}{Initial Version}
+% \changes{v0.02}{1996/11/11}{Minor bug fixes. Initial release.}
+% \changes{v0.03}{1996/11/27}{Minor alterations to make the
+% class work with the updated calendar package.}
+%
+%
+% \title{User's Guide to the Timesheet package\thanks{This file is version number
+% \fileversion{}. It was last revised on
+% \filedate.}}
+%
+% \author{Frank G. Bennett, Jr.\thanks{The page-formatting code contained in this
+% file is for the most part copied from the \texttt{ltnews.cls}
+% class file version 0.11 by Alan Jeffrey, which forms part of the
+% \LaTeXe{} distribution. The rest is my own creation. Enjoy.}}
+%
+% \maketitle
+%
+% \DoNotIndex{\@,\@@par,\@beginparpenalty,\@empty}
+% \DoNotIndex{\@flushglue,\@gobble,\@input}
+% \DoNotIndex{\@makefnmark,\@makeother,\@maketitle}
+% \DoNotIndex{\@namedef,\@ne,\@spaces,\@tempa}
+% \DoNotIndex{\@tempb,\@tempswafalse,\@tempswatrue}
+% \DoNotIndex{\@thanks,\@thefnmark,\@topnum}
+% \DoNotIndex{\@@,\@elt,\@forloop,\@fortmp,\@gtempa,\@totalleftmargin}
+% \DoNotIndex{\",\/,\@ifundefined,\@nil,\@verbatim,\@vobeyspaces}
+% \DoNotIndex{\|,\~,\ ,\active,\advance,\aftergroup,\begingroup,\bgroup}
+% \DoNotIndex{\cal,\csname,\def,\documentstyle,\dospecials,\edef}
+% \DoNotIndex{\egroup}
+% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\endtrivlist}
+% \DoNotIndex{\expandafter,\fi,\fnsymbol,\futurelet,\gdef,\global}
+% \DoNotIndex{\hbox,\hss,\if,\if@inlabel,\if@tempswa,\if@twocolumn}
+% \DoNotIndex{\ifcase}
+% \DoNotIndex{\ifcat,\iffalse,\ifx,\ignorespaces,\index,\input,\item}
+% \DoNotIndex{\jobname,\kern,\leavevmode,\leftskip,\let,\llap,\lower}
+% \DoNotIndex{\m@ne,\next,\newpage,\nobreak,\noexpand,\nonfrenchspacing}
+% \DoNotIndex{\obeylines,\or,\protect,\raggedleft,\rightskip,\rm,\sc}
+% \DoNotIndex{\setbox,\setcounter,\small,\space,\string,\strut}
+% \DoNotIndex{\strutbox}
+% \DoNotIndex{\thefootnote,\thispagestyle,\topmargin,\trivlist,\tt}
+% \DoNotIndex{\twocolumn,\typeout,\vss,\vtop,\xdef,\z@}
+% \DoNotIndex{\,,\@bsphack,\@esphack,\@noligs,\@vobeyspaces,\@xverbatim}
+% \DoNotIndex{\`,\catcode,\end,\escapechar,\frenchspacing,\glossary}
+% \DoNotIndex{\hangindent,\hfil,\hfill,\hskip,\hspace,\ht,\it,\langle}
+% \DoNotIndex{\leaders,\long,\makelabel,\marginpar,\markboth,\mathcode}
+% \DoNotIndex{\mathsurround,\mbox,\newcount,\newdimen,\newskip}
+% \DoNotIndex{\nopagebreak}
+% \DoNotIndex{\parfillskip,\parindent,\parskip,\penalty,\raise,\rangle}
+% \DoNotIndex{\section,\setlength,\TeX,\topsep,\underline,\unskip,\verb}
+% \DoNotIndex{\vskip,\vspace,\widetilde,\\,\%,\@date,\@defpar}
+% \DoNotIndex{\[,\{,\},\]}
+% \DoNotIndex{\count@,\ifnum,\loop,\today,\uppercase,\uccode}
+% \DoNotIndex{\baselineskip,\begin,\tw@}
+% \DoNotIndex{\a,\b,\c,\d,\e,\f,\g,\h,\i,\j,\k,\l,\m,\n,\o,\p,\q}
+% \DoNotIndex{\r,\s,\t,\u,\v,\w,\x,\y,\z,\A,\B,\C,\D,\E,\F,\G,\H}
+% \DoNotIndex{\I,\J,\K,\L,\M,\N,\O,\P,\Q,\R,\S,\T,\U,\V,\W,\X,\Y,\Z}
+% \DoNotIndex{\1,\2,\3,\4,\5,\6,\7,\8,\9,\0}
+% \DoNotIndex{\!,\#,\$,\&,\',\(,\),\+,\.,\:,\;,\<,\=,\>,\?,\_}
+% \DoNotIndex{\discretionary,\immediate,\makeatletter,\makeatother}
+% \DoNotIndex{\meaning,\newenvironment,\par,\relax,\renewenvironment}
+% \DoNotIndex{\repeat,\scriptsize,\selectfont,\the,\undefined}
+% \DoNotIndex{\arabic,\do,\makeindex,\null,\number,\show,\write,\@ehc}
+% \DoNotIndex{\@author,\@ehc,\@ifstar,\@sanitize,\@title,\everypar}
+% \DoNotIndex{\if@minipage,\if@restonecol,\ifeof,\ifmmode}
+% \DoNotIndex{\lccode,\newtoks,\onecolumn,\openin,\p@,\SelfDocumenting}
+% \DoNotIndex{\settowidth,\@resetonecoltrue,\@resetonecolfalse,\bf}
+% \DoNotIndex{\clearpage,\closein,\lowercase,\@inlabelfalse}
+% \DoNotIndex{\selectfont,\mathcode,\newmathalphabet,\rmdefault}
+% \DoNotIndex{\bfdefault}
+% \setcounter{StandardModuleDepth}{1}
+% \DeleteShortVerb{\|}
+% \MakeShortVerb{\"}
+%
+% \begin{abstract}
+% \noindent This package provides a style that can be used to
+% create timesheets, to monitor the amount of time
+% you spend fussing with \LaTeXe.
+% \end{abstract}
+%
+% \changes{v0.01}{1996/11/10}
+% {Created "docstrip" version.}
+% \changes{v0.02}{1996/11/11}
+% {Fixed missing 30-40 line, and a few other minor adjustments.}
+% \changes{v0.02}{1996/11/11}
+% {Added sample document to distribution.}
+%
+% \CheckSum{236}
+%
+% \section{Introduction}
+%
+% This packages creates a style, "timesheet", and a macro called
+% "\timesheets" which
+% accepts two arguments. Both arguments are dates of the form
+% \verb+YYYY/MM/DD+. This will generate a two-page timesheet
+% for all dates within the range specified in the arguments,
+% inclusive. To use this package you will also need the
+% "calendar" package, which is also available from CTAN.
+%
+%
+%\StopEventually{\PrintIndex}
+%
+% \section{The Macros}
+% Let's start by switching off some of the article options.
+% \begin{macrocode}
+%<*style>
+\DeclareOption{a4paper}{\OptionNotUsed}
+\DeclareOption{a5paper}{\OptionNotUsed}
+\DeclareOption{b5paper}{\OptionNotUsed}
+\DeclareOption{letterpaper}{\OptionNotUsed}
+\DeclareOption{legalpaper}{\OptionNotUsed}
+\DeclareOption{executivepaper}{\OptionNotUsed}
+\DeclareOption{landscape}{\OptionNotUsed}
+\DeclareOption{twoside}{\OptionNotUsed}
+\DeclareOption{titlepage}{\OptionNotUsed}
+\DeclareOption{onecolumn}{\OptionNotUsed}
+% \end{macrocode}
+% Sizing options should be passed to the article class.
+% \begin{macrocode}
+\DeclareOption{10pt}{\PassOptionsToPackage{\CurrentOption}{article}}
+\DeclareOption{11pt}{\PassOptionsToPackage{\CurrentOption}{article}}
+\DeclareOption{12pt}{\PassOptionsToPackage{\CurrentOption}{article}}
+% \end{macrocode}
+% The default action for any option is to pass it to the calendar package.
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{calendar}}
+% \end{macrocode}
+% Execute the options.
+% \begin{macrocode}
+\ProcessOptions
+% \end{macrocode}
+% Load the article class.
+% \begin{macrocode}
+\LoadClass[oneside]{article}
+% \end{macrocode}
+% Specify the page style.
+% \begin{macrocode}
+\pagestyle{empty}
+\setlength{\parindent}{1em}
+\setlength{\rightskip}{0pt plus \textwidth}
+\setlength{\@rightskip}{\rightskip}
+\setlength{\parfillskip}{0pt plus 2\textwidth}
+\setlength{\columnsep}{2em}
+% \end{macrocode}
+% Specify the text size. This spec tries to work with both A4 and letter paper
+% sizes.
+% \begin{macrocode}
+\setlength{\textheight}{230mm}
+\setlength{\topmargin}{-10mm}
+\setlength{\linewidth}{\textwidth}
+ \setlength{\textwidth}{180mm}
+\setlength{\oddsidemargin}{-10mm}
+% \end{macrocode}
+% Declare some lengths and counters.
+% \begin{macrocode}
+\newcounter{timecount}
+\newcounter{timecountlimit}
+\newlength{\timesheetleft}
+\newlength{\timesheetright}
+% \end{macrocode}
+% Declare a toggle for turning hash marks on and off.
+% \begin{macrocode}
+\newif\if@makehash
+% \end{macrocode}
+% Figure out how much space is chewed up by the times and lines
+% and stuff. The remainder will be empty space for handwritten notes.
+% \begin{macrocode}
+\settowidth{\timesheetleft}{00:00\ --\ 00:00}
+\addtolength{\timesheetleft}{5\arrayrulewidth}
+\addtolength{\timesheetleft}{6\tabcolsep}
+\addtolength{\timesheetleft}{\doublerulesep}
+\setlength{\timesheetright}{\textwidth}
+\addtolength{\timesheetright}{-\timesheetleft}
+% \end{macrocode}
+% Create a macro that will put down a one one-hour chunk of times
+% for use in a tabular environment. Because we can't have
+% anything after the last "\\" (not even a "\relax") if the table
+% is not to over-run, we have to start the table off ``by hand''
+% in the lead-off macro, defined below, and leave the last "\\"
+% out of the definition here, so it can be supplied when the
+% iteration dies.
+% \begin{macrocode}
+\def\@@maketimes#1{\xdef\timearg{\the\c@timecount}
+\addtocounter{timecount}{1}%
+\\\hline
+\@makehashtrue
+\timearg &00& \timearg &10&&\\
+\timearg &10& \timearg &20&&\\
+\timearg &20& \timearg &30&&\\
+\timearg &30& \timearg &40&&\\
+\timearg &40& \timearg &50&&\\
+\timearg &50&\arabic{timecount}&00&&%
+\@makehashfalse}
+% \end{macrocode}
+% This performs the iteration.
+% \begin{macrocode}
+\def\@maketimes{\@@maketimes{\arabic{timecount}}%
+ \ifnum\c@timecount>\c@timecountlimit%
+ \let\next\\\else\let\next\@maketimes\fi%
+ \next}
+% \end{macrocode}
+% This is the lead-off macro used as an interface to the above
+% material. It accepts a range of integers corresponding to
+% hours in the day.
+% \begin{macrocode}
+\def\maketimes#1#2{%
+ \setcounter{timecount}{#1}%
+ \setcounter{timecountlimit}{#2}%
+\addtocounter{timecount}{1}%
+\@makehashtrue
+#1 &00& #1 &10&&\\
+#1 &10& #1 &20&&\\
+#1 &20& #1 &30&&\\
+#1 &30& #1 &40&&\\
+#1 &40& #1 &50&&\\
+#1 &50&\arabic{timecount}&00&&
+\@makehashfalse
+\@maketimes}
+% \end{macrocode}
+% We need to have a bunch of tools loaded for all of this to
+% work.
+% \begin{macrocode}
+\RequirePackage{longtable}[1996/05/24]
+\RequirePackage{array}[1996/06/14]
+\RequirePackage{calendar}
+% \end{macrocode}
+% A little flash is nice. The "mygoth" package is my personal hackery.
+% Send a message to "fb@soas.ac.uk" if you'd like a copy.
+% \begin{macrocode}
+\IfFileExists{mygoth.sty}{\RequirePackage{mygoth}}{\let\textgoth\relax}
+% \end{macrocode}
+% We also need to quelch the left and right margin offsets, so that the
+% table can fill the whole page.
+% \begin{macrocode}
+\setlength\LTleft{0pt}
+\setlength\LTright{0pt}
+% \end{macrocode}
+% Define a new environment, which is essentially just a
+% particular instance of the "longtable" environment.
+% \begin{macrocode}
+\newenvironment{timesheet}
+ {\begin{longtable}{%
+ |r%
+ @{:}%
+ l%
+ @{\ --\ }%
+ r%
+ @{:}%
+ l%
+ |p{0.33\timesheetright}%
+ ||p{0.67\timesheetright}|%
+}%
+ \multicolumn{4}{l}{}&%
+ \multicolumn{2}{l}{\large\bf\theweekday\hfill%
+ {\Huge\textgoth{Timesheet}}\hfill%
+ \theday{} %
+ \themonth{} %
+ \theyear}\\
+ \multicolumn{6}{l}{}\\
+ \multicolumn{4}{c}{\small Time}&%
+ \multicolumn{1}{c}{\small Plan}&%
+ \multicolumn{1}{c}{\small Action}\\
+ \hline
+ \endhead
+ \hline
+ \endfoot}
+ {\end{longtable}}
+% \end{macrocode}
+% Define a high-level macro that invokes the above environment,
+% making things very clean and straightforward in the document.
+% \begin{macrocode}
+\def\timesheets#1#2{%
+ \everyday
+ {#1}
+ {#2}
+ {\begin{timesheet}\maketimes{7}{22}\end{timesheet}}
+}
+%</style>
+% \end{macrocode}
+% \section{A Demonstration Document}
+% The following document will produce a single
+% timesheet. Adjust dates to taste.
+% \begin{macrocode}
+%<*demo>
+\documentclass[10pt]{timesht}
+\begin{document}
+\timesheets{1996/11/24}{1996/11/24}
+\end{document}
+%</demo>
+% \end{macrocode}
+% \section{The Installation File}
+% \begin{macrocode}
+%<*installer>
+\def\batchfile{timesht.ins}
+\input docstrip.tex
+
+\keepsilent
+
+\preamble
+
+This file is part of the Timesheet package.
+Copyright (C) 1996 Frank Bennett, Jr.
+All rights reserved.
+------------------------------------------
+This is a generated file.
+
+IMPORTANT NOTICE:
+
+You are not allowed to change this file. You may however copy
+this file to a file with a different name and then change the
+copy if (a) you do not charge for the modified code, (b) you
+acknowledge the author(s) in the new file, if it
+is distributed to others, and (c) you attach these same
+conditions to the new file.
+
+You are not allowed to distribute this file alone. You are not
+allowed to take money for the distribution or use of this file
+(or a changed version) except for a nominal charge for copying
+etc.
+
+You are allowed to distribute this file under the condition that
+it is distributed with all of its contents, intact.
+
+For error reports, or offers to help make Timesheet a more powerful,
+friendlier, and better package, please contact me on
+`fb' at soas.ac.uk
+
+\endpreamble
+
+\generateFile{timesht.cls} {n}{\from{timesht.dtx}{style}}
+
+\preamble
+
+This file is part of the Timesheet package.
+Copyright (C) 1996 Frank Bennett, Jr.
+All rights reserved.
+------------------------------------------
+This is a generated file.
+
+You are welcome to modify this file in any way you wish.
+
+For error reports, or offers to help make Timesheet a more powerful,
+friendlier, and better package, please contact me on
+`fb' at soas.ac.uk
+
+\endpreamble
+
+\generateFile{timesheet.tex} {n}{\from{timesht.dtx}{demo}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space timesht.cls}
+\Msg{*}
+\Msg{***********************************************************}
+}
+%</installer>
+% \end{macrocode}
+% \Finale \PrintChanges
+
+
+
+
diff --git a/Master/texmf-dist/source/latex/timesht/timesht.ins b/Master/texmf-dist/source/latex/timesht/timesht.ins
new file mode 100644
index 00000000000..4460c9b4686
--- /dev/null
+++ b/Master/texmf-dist/source/latex/timesht/timesht.ins
@@ -0,0 +1,87 @@
+%%
+%% This is file `timesht.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% timesht.dtx (with options: `installer')
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file.
+%%
+%% You are *not* allowed to modify this file.
+%%
+%% You are *not* allowed to distribute this file.
+%% For distribution of the original source see
+%% the terms for copying and modification in the file timesht.dtx.
+%%
+\def\batchfile{timesht.ins}
+\input docstrip.tex
+
+\keepsilent
+
+\preamble
+
+This file is part of the Timesheet package.
+Copyright (C) 1996 Frank Bennett, Jr.
+All rights reserved.
+------------------------------------------
+This is a generated file.
+
+IMPORTANT NOTICE:
+
+You are not allowed to change this file. You may however copy
+this file to a file with a different name and then change the
+copy if (a) you do not charge for the modified code, (b) you
+acknowledge the author(s) in the new file, if it
+is distributed to others, and (c) you attach these same
+conditions to the new file.
+
+You are not allowed to distribute this file alone. You are not
+allowed to take money for the distribution or use of this file
+(or a changed version) except for a nominal charge for copying
+etc.
+
+You are allowed to distribute this file under the condition that
+it is distributed with all of its contents, intact.
+
+For error reports, or offers to help make Timesheet a more powerful,
+friendlier, and better package, please contact me on
+`fb' at soas.ac.uk
+
+\endpreamble
+
+\generateFile{timesht.cls} {n}{\from{timesht.dtx}{style}}
+
+\preamble
+
+This file is part of the Timesheet package.
+Copyright (C) 1996 Frank Bennett, Jr.
+All rights reserved.
+------------------------------------------
+This is a generated file.
+
+You are welcome to modify this file in any way you wish.
+
+For error reports, or offers to help make Timesheet a more powerful,
+friendlier, and better package, please contact me on
+`fb' at soas.ac.uk
+
+\endpreamble
+
+\generateFile{timesheet.tex} {n}{\from{timesht.dtx}{demo}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation, you have to move the following}
+\Msg{* file into a directory searched by TeX:}
+\Msg{*}
+\Msg{* \space\space timesht.cls}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endinput
+%%
+%% End of file `timesht.ins'.
diff --git a/Master/texmf-dist/source/latex/tugboat/tugboat.dtx b/Master/texmf-dist/source/latex/tugboat/tugboat.dtx
new file mode 100644
index 00000000000..a0d6f5540ba
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tugboat/tugboat.dtx
@@ -0,0 +1,3774 @@
+%^^A This (the production version of the macros) started life as xpt3
+%^^A and no need has arisen to perform other experiments...
+%
+% \iffalse (this is a meta-comment (so they say))
+% Copyright (C) 1995,1996,1997,1998,2000,2004 TeX Users Group.
+% Copying of this file is authorized only if either:
+% (1) you make absolutely no changes to your copy, OR
+% (2) if you do make changes, you first rename it to some other name.
+% \fi
+%
+% \section{Document preambles}
+%
+% \begin{macrocode}
+%<ltugboatcls|ltugproccls|ltugcomn>\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+%<*dtx>
+\ProvidesFile {tugboat.dtx}
+%</dtx>
+%<ltugboatcls>\ProvidesClass {ltugboat}
+%<ltugproccls>\ProvidesClass {ltugproc}
+%<ltugboatsty>\ProvidesPackage{ltugboat}
+%<ltugprocsty>\ProvidesPackage{ltugproc}
+%<ltugcomn> \ProvidesPackage{ltugcomn}
+ [2004/07/06 v1.6
+%<ltugboatcls> TUGboat journal class%
+%<ltugproccls> TUG conference proceedings class%
+%<ltugboatsty|ltugprocsty> TUG compatibility package%
+%<ltugcomn> TUGboat `common macros' package%
+%<*dtx>
+ TUG macros source file%
+%</dtx>
+ ]
+% \end{macrocode}
+%
+% ^^A behold, a horrible hack...
+% \begin{macrocode}
+%<*dtx>
+\newif\ifoldlongtable
+%</dtx>
+% \end{macrocode}
+%
+% \iffalse
+%
+% RCS identification of this file (lest I fail to update the above ;-)
+%
+% $Id: tugboat.dtx,v 1.42 2004/05/30 13:21:40 rf Exp rf $
+%
+% Note that the RCS version relates to the number of times the file
+% has been checked-in, which relates to a development process taking
+% place on several machines, rather than the incidence of significant
+% change; the definitive version number is that in the \Provides*
+% things, while the RCS Id may provide a clue as to the latest date
+% the documentation was worked on
+%
+% Code to compile the thing using LaTeX2e
+%
+% \begin{macrocode}
+%<*driver>
+\documentclass{ltxdoc}
+%
+\usepackage{ltugcomn} % generated using the .ins file
+%
+\usepackage{array,longtable}
+%
+% if longtable.sty is the most recent, then it doesn't need
+% \cs{setlongtables}, so we avoid the setlong.tab game
+\GetFileInfo{longtable.sty}
+\def\extractdate#1/#2/#3\relax{\def\fileyear{#1}%
+ \def\filemonth{#2}%
+ \def\fileday{#3}}
+\expandafter\extractdate\filedate\relax
+\expandafter\ifnum\fileyear>1996\relax
+ \oldlongtablefalse
+\else
+ \oldlongtabletrue
+ \expandafter\ifnum\fileyear=1996\relax
+ \expandafter\ifnum\filemonth>5\relax
+ \oldlongtablefalse
+ \else
+ \expandafter\ifnum\filemonth=5\relax
+ \expandafter\ifnum\fileday>23\relax
+ \oldlongtablefalse
+ \fi
+ \fi
+ \fi
+ \fi
+\fi
+\ifoldlongtable
+ \InputIfFileExists{setlong.tab}{}% if this file exists, it should
+% % contain (only) \setlongtables
+ {\typeout{*** create a file `setlong.tab' containing only}
+ \typeout{***\space\space\space\string\setlongtables}
+ \typeout{*** to get the tables of commands, etc., lined up}}
+\fi
+%
+\begin{document}
+ \GetFileInfo{tugboat.dtx}
+ \title{The \textsf{tugboat} package\thanks{This file
+ has version number \fileversion, last
+ revised \filedate}}
+ \author{Robin Fairbairns\\\small\texttt{robin.fairbairns@cl.cam.ac.uk}}
+ \date{\filedate}
+ \maketitle
+ \tableofcontents
+ \DocInput{tugboat.dtx}
+\end{document}
+%</driver>
+% \end{macrocode}
+%
+% \fi
+% \CheckSum{4637}
+%
+% \section{Introduction}
+%
+% This file contains all the macros for typesetting \TUB{} with
+% both plain \TeX\ and \LaTeXe.
+% \subsection{Summary of control sequences}
+%
+% Abbreviations. Just a listing with indications of expansion where
+% that may not be obvious. For full definitions, see real code below
+% (Section~\ref{abbr-logo}).
+%
+% \begin{longtable}{lp{3in}}
+% |\AllTeX|& (\La)\TeX\\
+% |\AMS|& American Mathematical Society\\
+% |\AmSTeX|&\\
+% |\aw|& \aw\ (abbreviation for Addison-Wesley)\\
+% |\AW|& Addison-Wesley\\
+% |\BibTeX|&\\
+% |\CandT|& Computers \& Typesetting\\
+% |\ConTeXt|& \ConTeXt\\
+% |\Cplusplus|& C++\\
+% |\DTD|&\\
+% |\DVItoVDU|& DVItoVDU\\
+% |\eTeX|& \eTeX\\
+% |\Ghostscript|&\\
+% |\Hawaii|& \Hawaii\\
+% |\HTML|&\\
+% |\ISBN|& ISBN\\
+% |\ISSN|& ISSN\\
+% |\JTeX|&\\
+% |\JoT|& The Joy of \TeX\\
+% |\LaTeX|&\\
+% |\MacOSX|& Mac OS X\\
+% |\MathML|&\\
+% |\Mc|& M with raised c\\
+% |\MF|& \MF\\
+% |\mf|& \textsc{Metafont}\\
+% |\MFB|& The Metafont book\\
+% |\MP|& \MP\\
+% |\mp|& MetaPost (in text only: remains `\ensuremath{\mp}'
+% in maths)\\
+% |\OMEGA|& Omega `logo' (\ensuremath{\Omega})\\
+% |\OCP|& Omega compiled process\\
+% |\OTP|& Omega translation process\\
+% |\mtex|& multilingual \TeX\\
+% |\NTS|& New Typesetting System\\
+% |\pcMF|& pcMF\\
+% |\PCTeX|&\\
+% |\pcTeX|&\\
+% |\Pas|& Pascal\\
+% |\PiCTeX|&\\
+% |\plain|& plain (in typewriter font)\\
+% |\POBox|& P. O. Box\\
+% |\PS|& PostScript (with hyphenation)\\
+% |\SC|& Steering Committee\\
+% |\SGML|& SGML\\
+% |\SliTeX|&\\
+% |\slMF|& Metafont (slanted)\Dash deprecated: use
+% \cs{textsl} instead \\
+% |\stTeX|& \TeX{} for the Atari ST\\
+% |\TANGLE|&\\
+% |\TB|& The \TeX book\\
+% |\TeX|& (Although nearly every package defines this,
+% most\Dash including plain\Dash are missing the
+% spacefactor adjustment)\\
+% |\TeXhax|&\\
+% |\TeXMaG|& (defunct)\\
+% |\TeXtures|&\\
+% |\TeXXeT|&\\
+% |\Thanh|&\\
+% |\TUB|& \TUB\\
+% |\TUG|& \TeX{} Users Group\\
+% |\UNIX|&\\
+% |\VAX|&\\
+% |\VorTeX|&\\
+% |\XeT|&\\
+% |\XML|&\\
+% |\WEB|&\\
+% |\WEAVE|&\\
+% \end{longtable}
+%
+% Macros for things that are slightly more significant.
+%
+% \begin{longtable}{lp{.6\textwidth}}
+% |\NoBlackBoxes|& turns off marginal rules marking overfull boxes\\
+% |\BlackBoxes|& turns them back on\\
+% |\newline|& horizontal glue plus a break\\
+% |\ifundefined#1|& checks argument with |\csname| against |\relax|\\
+% |\topsmash|& smashes above baseline (from AMSTeX)\\
+% |\botsmash|& smashes below baseline (from AMSTeX)\\
+% |\smash|& smashes both (from plain)\\
+% |\ulap|& lap upwards\\
+% |\dlap|& lap downwards\\
+% |\xlap|& reference point at center horizontally; 0 width\\
+% |\ylap|& reference point at center vertically; 0 height, depth\\
+% |\zlap|& combination |\xlap| and |\ylap|\\
+% |\basezero|& to avoid insertion of baselineskip and lineskip glue\\
+% |\nullhrule|& empty |\hrule|\\
+% |\nullvrule|& empty |\vrule|\\
+% |\makestrut[#1;#2]|& ad hoc struts; |#1|=height, |#2|=depth\\
+% |\today|& today's date\\
+% |\SetTime|& converts |\time| to hours, minutes\\
+% |\now|& displays time in hours and minutes\\
+% |\Now|& shows current date and time\\
+% |\ifPrelimDraft|& flag to indicate status as preliminary draft\\
+% |\rtitlex|& \TUB{} volume and number info for running head\\
+% |\midrtitle|& information for center of running head\\
+% |\HorzR@gisterRule|& pieces of registration marks (`trimmarks')\\
+% |\DownShortR@gisterRule|&\\
+% |\UpShortR@gisterRule|&\\
+% |\ttopregister|& top registration line with `T' in center\\
+% |\tbotregister|& bottom registration line with inverted `T' in center\\
+% |\topregister|& register actually used\\
+% |\botregister|&\\
+% |\raggedskip|& parameters used for ragged settings\\
+% |\raggedstretch|&\\
+% |\raggedparfill|&\\
+% |\raggedspaces|&\\
+% |\raggedright|&\\
+% |\raggedleft|&\\
+% |\raggedcenter|&\\
+% |\normalspaces|&\\
+% |\raggedbottom|&\\
+% |\bull|& square bullet\\
+% |\cents|& `cents' sign\\
+% |\Dag|& superscripted dagger\\
+% |\careof|& c/o\\
+% |\sfrac|& slashed fraction (arguments optionally\\
+% & separated by a slash)\\
+% |\cs|& control seqence name\\
+% & |\cs{name}|$\rightarrow$\cs{name}\\
+% |\env|& environment name \\
+% & |\env{name}|$\rightarrow$\env{name}\\
+% |\meta|& meta-argument name\\
+% & |\meta{name}|$\rightarrow$\meta{name}\\
+% |\dash|& en-dash surrounded by thinspaces; only breakable AFTER\\
+% |\Dash|& em-dash, as above\\
+% |\hyph|& permit automatic hyphenation after an actual hyphen\\
+% |\slash|& `breakable' slash\\
+% |\nth|& for obtaining `1\textsuperscript{st}',
+% `2\textsuperscript{nd}', 3\textsuperscript{rd},
+% etc.\\
+% |\tubissue|& gets |\TUB| followed by volume and issue numbers\\
+% |\xEdNote|& Editor's Note:\\
+% |\Review:|& Review: (for title of book review article)\\
+% |\reviewitem|& begin data for item being reviewed\\
+% |\revauth|& with one argument, author(s) of item being reviewed\\
+% |\revtitle|& with one argument, title of \ldots \\
+% |\revpubinfo|& with one argument, other info pertaining to \ldots \\
+% |\endreviewitem|& end data for item being reviewed\\
+% |\booktitle|& with one argument, format book title in text\\
+% |\Input|& |\input| with some other bookkeeping for
+% case where multiple articles are put together\\
+% |\TBremark|& reminder to \TUB{} editorial staff\\
+% |\TBEnableRemarks|& enable \cs{TBremark}s (normally suppressed)\\
+% |\pagexref|& used to write out page numbers to screen and\\
+% |\pagexrefON|& external files\\
+% |\pagexrefOFF|&\\
+% |\xrefto|& used for symbolic cross-reference to other pages\\
+% |\xreftoON|& in \TUB{}\\
+% |\xreftoOFF|&\\
+% |\TBdriver|& marks code which only takes effect when articles
+% are run together in a driver file\\
+% \iffalse % these two were defined but never used! -- remove them
+% % from the documentation, at least (further research needed)
+% |\signatureat|& \\
+% |\signaturepercent|&\\
+% \fi
+% |\signaturemark|& items for signatures\\
+% |\signaturewidth|&\\
+% \end{longtable}
+%
+% \StopEventually{}
+%
+% \section{\LaTeXe{} \TUB{} class file}
+%
+% \subsection{Setup and options}
+%
+% Check for reloading. Hmmm\dots Does this happen with \LaTeXe
+% classes? Probably, in fact, as well that it doesn't, since the
+% \cs{tugstyinit} referenced here doesn't exist; however, it's
+% possible that we might need a similar mechanism in the future, so we
+% retain its skeleton, without fleshing out the \cs{tugstyinit} bones.
+%
+% \begin{macrocode}
+%<*ltugboatcls>
+\csname tugstyloaded@\endcsname
+\def\tugstyloaded@{\tugstyinit\endinput}
+% \end{macrocode}
+%
+% Acquire a name for this class if we don't already have one (by
+% virtue of having been loaded by |tugproc.cls|). This name will be
+% used in error messages and the like.
+%
+% \begin{macrocode}
+\providecommand{\@tugclass}{ltugboat}
+% \end{macrocode}
+%
+% Warnings/error messages/information messages~--- if we're using
+% \LaTeXe{} we can use the \cs{Class*} commands:
+%
+% \begin{macrocode}
+%<*latex2e>
+\def\TBInfo{\ClassInfo{\@tugclass}}
+\def\TBError{\ClassError{\@tugclass}}
+\def\TBWarning{\ClassWarning{\@tugclass}}
+\def\TBWarningNL{\ClassWarningNoLine{\@tugclass}}
+%</latex2e>
+% \end{macrocode}
+%
+% Some trivial options, just flicking switches, etc.
+%
+% \begin{macrocode}
+\newif\ifpreprint
+\def\preprint{\preprinttrue}
+\DeclareOption{draft}{%
+ \AtEndOfClass{%
+ \setcounter{page}{1001}%
+ \BlackBoxes
+ \def\MakeRegistrationMarks{}%
+ \PrelimDrafttrue
+ }%
+}
+\DeclareOption{preprint}{%
+ \preprinttrue
+}
+\DeclareOption{final}{%
+ \AtEndOfClass{%
+ \NoBlackBoxes
+ \PrelimDraftfalse
+ }%
+}
+% \end{macrocode}
+%
+% The rules dictate that the output should be set using a 10pt base
+% font.
+%
+% \begin{macrocode}
+\DeclareOption{11pt}{%
+ \TBWarning{The \@tugclass\space class only supports 10pt fonts:
+ \MessageBreak option \CurrentOption\space ignored}%
+}
+\DeclareOption{12pt}{\csname ds@11pt\endcsname}
+% \end{macrocode}
+%
+% Similarly, ignore one/two-side/column
+%
+% \begin{macrocode}
+\DeclareOption{oneside}{\TBWarning{Option \CurrentOption\space ignored}}
+\DeclareOption{twoside}{\ds@oneside}
+\DeclareOption{onecolumn}{\ds@oneside}
+\DeclareOption{twocolumn}{\ds@oneside}
+% \end{macrocode}
+%
+% There are these people who seem to think |tugproc| is an option rather
+% than a class\dots{} (Note that it's already been filtered out if we
+% were calling from |ltugproc|.)
+%
+% \begin{macrocode}
+\DeclareOption{tugproc}{%
+ \TBWarning{Option \CurrentOption\space ignored: use class ltugproc
+ instead of \@tugclass}%
+}
+% \end{macrocode}
+%
+% Option |rawcite| (the default) specifies the default citation
+% mechanism (as built-in to \LaTeX); option |harvardcite| specifies
+% the author-date citation mechanism defined in
+% section~\ref{sec:citations} below.
+%
+% \begin{macrocode}
+\DeclareOption{rawcite}{\let\if@Harvardcite\iffalse}
+\DeclareOption{harvardcite}{\let\if@Harvardcite\iftrue}
+% \end{macrocode}
+%
+% Option |extralabel| (the default) specifies that the publication
+% years of two successive references with otherwise identical labels
+% will be tagged with distinguishing letters; option |noextralabel|
+% causes those letters to be suppressed. Note that (a) no two
+% references will in any case have the same labels in the default
+% (plain) |rawcite| setup, and that (b) the distinguishing letters
+% appear in the labels themselves~--- the even remotely intelligent
+% reader should be able to work out the correspondence one with the
+% other\dots
+%
+% \begin{macrocode}
+\DeclareOption{extralabel}{\let\UseExtraLabel\@firstofone}
+\DeclareOption{noextralabel}{\let\UseExtraLabel\@gobble}
+% \end{macrocode}
+%
+% The section-numbering style, so that we can allow the same heading
+% layout as in the plain macros.
+% \changes{v1.4a}{1996/09/14}{Added nonumber and numbersec (default)
+% options}
+%
+% \begin{macrocode}
+\DeclareOption{numbersec}{\let\if@numbersec\iftrue}
+\DeclareOption{nonumber}{\let\if@numbersec\iffalse}
+% \end{macrocode}
+%
+% Any other options, we pass on to |article.cls| before we load it:
+%
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+% \end{macrocode}
+%
+% Request default options (draft mode, standard citation, double-sided
+% printing), process all options, and then get the base document class
+% on top of which we reside.
+%
+% \begin{macrocode}
+\ExecuteOptions{draft,extralabel,numbersec,rawcite}
+\ProcessOptions
+\LoadClass[twoside]{article}
+% \end{macrocode}
+%
+% Various fonts used throughout. Some effort has been made to
+% suppress these things with explicit sizes in the macro name
+% (\cs{tensl} is an example below), but keeping in step with the
+% documentation is one thing that restricts such a move.
+%
+% \begin{macrocode}
+\def\sectitlefont{\fontfamily\sfdefault\fontseries{bx}\fontshape{n}%
+ \fontsize\@xviipt\stbaselineskip\selectfont}
+\def\tensl{\fontseries{m}\fontshape{sl}\fontsize\@xpt\@xiipt
+ \selectfont}
+% \end{macrocode}
+%
+% This font selection command is used \emph{only} for the `Editor's
+% Note' introduction to notes; sadly it makes explicit reference to
+% \textsc{cmr}, and Barbara Beeton has agreed that the reference may be
+% constructed to use the current family such that, if no upright
+% italic is defined, ordinary italics are used. A project for
+% later\dots
+%
+% \begin{macrocode}
+\def\EdNoteFont{\fontfamily{cmr}\fontseries{m}\fontshape{ui}%
+ \selectfont}
+%</ltugboatcls>
+% \end{macrocode}
+%
+%
+% If Ulrik Vieth's |mflogo.sty| is around, we'll use it. Otherwise
+% (pro tem, at least) we'll warn the user and define the absolute
+% minimum of machinery that \TUB{} requires (that which was used
+% prior to the invention of \LaTeXe).
+% \begin{macrocode}
+%<*common>
+\IfFileExists{mflogo.sty}%
+ {\RequirePackage{mflogo}}%
+%<!ltugcomn> {\TBWarning
+%<ltugcomn> {\PackageWarning{ltugcomn}
+ {Package mflogo.sty not available --\MessageBreak
+ Proceeding to emulate mflogo.sty}
+ \DeclareRobustCommand\logofamily{%
+ \not@math@alphabet\logofamily\relax
+ \fontencoding{U}\fontfamily{logo}\selectfont}
+ \DeclareTextFontCommand{\textlogo}{\logofamily}
+ \def\MF{\textlogo{META}\-\textlogo{FONT}\@}
+ \def\MP{\textlogo{META}\-\textlogo{POST}\@}
+ \DeclareFontFamily{U}{logo}{}
+ \DeclareFontShape{U}{logo}{m}{n}{%
+ <8><9>gen*logo%
+ <10><10.95><12><14.4><17.28><20.74><24.88>logo10%
+ }{}
+ \DeclareFontShape{U}{logo}{m}{sl}{%
+ <8><9>gen*logosl%
+ <10><10.95><12><14.4><17.28><20.74><24.88>logosl10%
+ }{}
+ \DeclareFontShape{U}{logo}{m}{it}{%
+ <->ssub*logo/m/sl%
+ }{}%
+ }
+% \end{macrocode}
+%
+% \subsection{Resetting at start of paper}
+%
+% \begin{macro}{\ResetCommands}
+% \begin{macro}{\AddToResetCommands}
+% \begin{macro}{\StartNewPaper}
+% We store a set of commands that should be executed at the start of
+% each paper, before any paper-specific customisation. These commands
+% (stored in the token register \cs{ResetCommands}) include things
+% suc as resetting section and footnote numbers, re-establishing
+% default settings of typesetting parameters, and so on. The user (or
+% more typically, editor) may execute the commands by using the
+% command \cs{StartNewPaper}. Things I've not yet thought of may be
+% added to the list of commands, by
+% \begin{macrocode}
+\newtoks\ResetCommands
+\ResetCommands{%
+ \setcounter{part}{0}%
+ \setcounter{section}{0}%
+ \setcounter{footnote}{0}%
+ \authornumber\z@
+}
+\newcommand{\AddToResetCommands}[1]{%
+ \AddToResetCommands\expandafter{\AddToResetCommands#1}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Helpful shorthand (common code with Plain styles)}
+%
+% \cs{makeescape}, \dots, \cs{makecomment} allow users to change the
+% category code of a single character a little more easily. These
+% require that the character be addressed as a control sequence:
+% e.g., |\makeescape\/| will make `|/|' an escape character.
+%
+% \begin{macrocode}
+%<*!latex>
+\def\makeescape#1{\catcode`#1=0 }
+\def\makebgroup#1{\catcode`#1=1 }
+\def\makeegroup#1{\catcode`#1=2 }
+\def\makemath #1{\catcode`#1=3 }
+%</!latex>
+%<*latex>
+\def\makeescape#1{\catcode`#1=\z@}
+\def\makebgroup#1{\catcode`#1=\@ne}
+\def\makeegroup#1{\catcode`#1=\tw@}
+\def\makemath #1{\catcode`#1=\thr@@}
+%</latex>
+\def\makealign #1{\catcode`#1=4 }
+\def\makeeol #1{\catcode`#1=5 }
+\def\makeparm #1{\catcode`#1=6 }
+\def\makesup #1{\catcode`#1=7 }
+\def\makesub #1{\catcode`#1=8 }
+\def\makeignore#1{\catcode`#1=9 }
+\def\makespace #1{\catcode`#1=10 }
+\def\makeletter#1{\catcode`#1=11 }
+\chardef\other=12
+%<*!latex>
+\def\makeother #1{\catcode`#1=\other}
+%</!latex>
+%<*latex>
+\let\makeother\@makeother
+%</latex>
+\def\makeactive#1{\catcode`#1=13 }
+\def\makecomment#1{\catcode`#1=14 }
+%<*!latex>
+\def\makeatletter{\makeletter\@}
+\def\makeatother {\makeother\@}
+%</!latex>
+% \end{macrocode}
+% |\savecat#1| and |\restorecat#1| will save and restore the category
+% of a given character. These are useful in cases where one doesn't
+% wish to localize the settings and therefore be required to globally
+% define or set things.
+% \begin{macrocode}
+\def\savecat#1{%
+ \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
+\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}
+%<!latex>\savecat\@
+%<!latex>\makeletter\@
+% \end{macrocode}
+%
+% |\SaveCS#1| and |\RestoreCS#1| save and restore `meanings' of control
+% sequences. Again this is useful in cases where one doesn't want to
+% localize or where global definitions clobber a control sequence which
+% is needed later with its `old' definition.
+%
+% \begin{macrocode}
+\def\SaveCS#1{\expandafter\let\csname saved@@#1\expandafter\endcsname
+ \csname#1\endcsname}
+\def\RestoreCS#1{\expandafter\let\csname#1\expandafter\endcsname
+ \csname saved@@#1\endcsname}
+% \end{macrocode}
+% To distinguish between macro files loaded
+% \begin{macrocode}
+\def\plaintubstyle{plain}
+\def\latextubstyle{latex}
+% \end{macrocode}
+%
+% Control sequences that were first defined in \LaTeXe{} of
+% 1995/06/01 (or later), but which we merrily use. Only define if
+% necessary:
+%
+% \begin{macrocode}
+%<*latex2e>
+\providecommand\hb@xt@{\hbox to}
+\providecommand\textsuperscript[1]{\ensuremath{\m@th
+ ^{\mbox{\fontsize\sf@size\z@
+ \selectfont #1}}}}
+%</latex2e>
+%<!latex2e>\def\hb@xt@{\hbox to}
+% \end{macrocode}
+% (Note that that definition of \cs{textsuperscript} isn't robust, but
+% probably doesn't need to be\dots What's more, it doesn't appear in
+% the mythical 2.09 version of the package.)
+%
+% \subsection{Abbreviations and logos}
+% \label{abbr-logo}
+%
+% Font used for the METAFONT logo, etc.
+% \begin{macrocode}
+%<!latex2e>\font\manual=logo10
+\def\AllTeX{(\La\kern-.075em)\kern-.075em\TeX}
+\def\AMS{American Mathematical Society}
+%<!latex2e>\def\AmS{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox
+%<!latex2e> {\the\textfont2 M}\kern-.125em{\the\textfont2 S}}
+%<latex2e>\def\AmS{$\mathcal{A}$\kern-.1667em\lower.5ex\hbox
+%<latex2e> {$\mathcal{M}$}\kern-.125em$\mathcal{S}$}
+\def\AmSLaTeX{\AmS-\LaTeX}
+\def\AmSTeX{\AmS-\TeX}
+\def\aw{A\kern.1em-W}
+\def\AW{Addison\kern.1em-\penalty\z@\hskip\z@skip Wesley}
+%<!latex2e>\def\BibTeX{{\rm B\kern-.05em{\smc i\kern-.025emb}\kern-.08em\TeX}}
+%<latex2e>\def\BibTeX{\textsc{Bib}\kern-.08em\TeX}
+%<!latex2e>\def\CandT{{\sl Computers \& Typesetting}}
+%<latex2e>\def\CandT{\textsl{Computers \& Typesetting}}
+% \end{macrocode}
+% We place our \cs{kern} after \cs{-} so that it disappears if the
+% hyphenation is taken:
+% \begin{macrocode}
+\newcommand\ConTeXt{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
+\newcommand\Cplusplus{C\raisebox{.7ex}{$_{++}$}}
+\def\CTAN{\acro{CTAN}}
+\def\DTD{\acro{DTD}}
+\def\DVItoVDU{DVIto\kern-.12em VDU}
+%<latex2e>\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
+%<!latex2e>\def\eTeX{{$\varepsilon$}-\kern-.125em\TeX}
+\def\Ghostscript{Ghost\-script}
+\def\Hawaii{Hawai`i}
+\def\HTML{\acro{HTML}}
+\def\ISBN{\acro{ISBN}}
+\def\ISSN{\acro{ISSN}}
+\def\JTeX{\leavevmode\hbox{\lower.5ex\hbox{J}\kern-.18em\TeX}}
+%<!latex2e>\def\JoT{{\sl The Joy of \TeX}}
+%<latex2e>\def\JoT{\textsl{The Joy of \TeX}}
+%<*!latex2e>
+\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em\the\scriptfont2 A}%
+ \kern-.2em\lower.376ex\hbox{\the\textfont2 M}\kern-.125em
+ {\the\textfont2 S}-\TeX}
+%</!latex2e>
+%<*latex2e>
+\def\LAMSTeX{L\raise.42ex\hbox{\kern-.3em
+ $\m@th$\fontsize\sf@size\z@\selectfont
+ $\m@th\mathcal{A}$}%
+ \kern-.2em\lower.376ex\hbox{$\m@th\mathcal{M}$}\kern-.125em
+ {$\m@th\mathcal{S}$}-\TeX}
+%</latex2e>
+%<!latex2e>\def\La{\TestCount=\the\fam \leavevmode L\raise.42ex
+%<!latex2e> \hbox{$\fam\TestCount\scriptstyle\kern-.3em A$}}
+% \end{macrocode}
+%
+% With the facilities of \LaTeXe, we can do rather better. This code
+% is hacked from its definition of \cs{LaTeX}; it allows slants (for
+% example) to propagate into the raised (small) `A':
+% \begin{macrocode}
+%<*latex2e>
+\newcommand{\La}%
+ {L\kern-.36em
+ {\setbox0\hbox{T}%
+ \vbox to\ht0{\hbox{$\m@th$%
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }}
+%</latex2e>
+% \end{macrocode}
+%
+% We started with the intention that we wouldn't redefine \cs{LaTeX}
+% when we're running under it, so as not to trample on an existing
+% definition. However, this proves less than satisfactory; a single
+% logo may be OK for the run of documents, but for \TUB{}, we find
+% that something noticeably better is necessary; see section
+% \ref{sec:latex-logo}.
+%
+% \begin{macrocode}
+%<!latex>\def\LaTeX{\La\kern-.15em\TeX}
+\def\MathML{Math\acro{ML}}
+\def\MacOSX{Mac\,\acro{OS\,X}}
+\def\Mc{\setbox\TestBox=\hbox{M}M\vbox
+ to\ht\TestBox{\hbox{c}\vfil}} % for Robert McGaffey
+% \end{macrocode}
+%
+% If we're running under \LaTeXe, we're using (at least pro tem) Ulrik
+% Vieth's |mflogo.sty| if it's present. Otherwise, we're using a
+% short extract of Vieth's stuff. Either way, we don't need to
+% specify \cs{MF} or \cs{MP}
+% \begin{macrocode}
+%<!latex2e>\def\MF{{\manual META}\-{\manual FONT}\@}
+%<!latex2e>\def\mf{{\smc Metafont}}
+%<latex2e>\def\mf{\textsc{Metafont}}
+%<!latex2e>\def\MFB{{\sl The \slMF book}}
+%<latex2e>\def\MFB{\textsl{The \MF book}}
+%<!latex2e>\def\MP{{\manual META}\-{\manual POST}\@}
+%<*latex2e>
+\let\TB@@mp\mp
+\DeclareRobustCommand\mp{\ifmmode\TB@@mp\else MetaPost\fi}
+%</latex2e>
+% \end{macrocode}
+%
+% In order that the \cs{OMEGA} command will switch to using the TS1
+% variant of the capital Omega character if \texttt{textcomp.sty} is
+% loaded, we define it in terms of the \cs{textohm} command. Note
+% that this requires us to interpose a level of indirection, rather
+% than to use \cs{let}\dots
+%
+% \begin{macrocode}
+%<*latex2e>
+\DeclareTextSymbol{\textohm}{OT1}{'012}
+\DeclareTextSymbolDefault{\textohm}{OT1}
+\newcommand\OMEGA{\textohm}
+\DeclareRobustCommand{\OCP}{\OMEGA\acro{CP}}
+\DeclareRobustCommand{\OTP}{\OMEGA\acro{TP}}
+%</latex2e>
+\def\mtex{T\kern-.1667em\lower.424ex\hbox{\^E}\kern-.125emX\@}
+% \end{macrocode}
+% Revised definition of \cs{NTS} based on that used by Phil Taylor.
+% \begin{macrocode}
+\DeclareRobustCommand\NTS{\ensuremath{\mathcal{N}\mkern-4mu
+ \raisebox{-0.5ex}{$\mathcal{T}$}\mkern-2mu \mathcal{S}}}
+\def\pcMF{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}MF\@}
+\def\PCTeX{PC\thinspace\TeX}
+\def\pcTeX{\leavevmode\raise.5ex\hbox{p\kern-.3\p@ c}\TeX}
+\def\Pas{Pascal}
+\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\@}
+\def\PiCTeX{\PiC\kern-.11em\TeX}
+%<!latex2e>\def\plain{{\tt plain}}
+%<latex2e>\def\plain{\texttt{plain}}
+\def\POBox{P.\thinspace O.~Box }
+\def\PS{{Post\-Script}}
+\def\SC{Steering Committee}
+\def\SGML{\acro{SGML}}
+%<!latex2e>\def\SliTeX{{\rm S\kern-.06em{\smc l\kern-.035emi}\kern-.06em\TeX}}
+%<latex2e>\def\SliTeX{\textrm{S\kern-.06em\textsc{l\kern-.035emi}%
+%<latex2e> \kern-.06em\TeX}}
+%<!latex2e>\def\slMF{\MF}
+%<latex2e> \def\slMF{\textsl{\MF}} % should never be used
+%<!latex2e>\def\stTeX{{\smc st\rm\kern-0.13em\TeX}}
+%<latex2e> \def\stTeX{\textsc{st}\kern-0.13em\TeX}
+%<!latex2e>\def\TANGLE{{\tt TANGLE}\@}
+%<latex2e>\def\TANGLE{\texttt{TANGLE}\@}
+%<!latex2e>\def\TB{{\sl The \TeX book}}
+%<latex2e>\def\TB{\textsl{The \TeX book}}
+%<!latex2e>\def\TP{{\sl \TeX\/}: {\sl The Program\/}}
+%<latex2e>\def\TP{\textsl{\TeX}: \textsl{The Program}}
+%<!latex2e>\def\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}
+%<*latex2e>
+\DeclareRobustCommand\TeX{T\kern-.1667em\lower.424ex\hbox{E}\kern-.125emX\@}
+%</latex2e>
+\def\TeXhax{\TeX hax}
+\def\TeXMaG{\TeX M\kern-.1667em\lower.5ex\hbox{A}%
+ \kern-.2267emG\@}
+%<!latex2e>\def\TeXtures{{\it Textures}}
+%<latex2e>\def\TeXtures{\textit{Textures}}
+\let\Textures=\TeXtures
+\def\TeXXeT{\TeX-{}-\XeT}
+\def\Thanh{H\`an~Th\^e\llap{\raise 0.5ex\hbox{\'{}}}~Th\`anh}
+%<!latex2e>\def\ttn{{\sl TTN}\@}
+%<latex2e>\def\ttn{\textsl{TTN}\@}
+%<!latex2e>\def\TTN{{\sl \TeX{} and TUG News}}
+%<latex2e>\def\TTN{\textsl{\TeX{} and TUG News}}
+%<!latex2e>\def\tubfont{\sl} % redefined in other situations
+%<!latex2e>\def\TUB{{\tubfont TUGboat\/}}
+%<latex2e>\let\texttub\textsl % redefined in other situations
+%<latex2e>\def\TUB{\texttub{TUGboat}}
+\def\TUG{\TeX\ \UG}
+\def\tug{\acro{TUG}}
+\def\UG{Users Group}
+\def\UNIX{\acro{UNIX}}
+\def\VAX{V\kern-.12em A\kern-.1em X\@}
+\def\VorTeX{V\kern-2.7\p@\lower.5ex\hbox{O\kern-1.4\p@ R}\kern-2.6\p@\TeX}
+\def\XeT{X\kern-.125em\lower.424ex\hbox{E}\kern-.1667emT\@}
+\def\XML{\acro{XML}}
+%<!latex2e>\def\WEB{{\tt WEB}\@}
+%<latex2e>\def\WEB{\texttt{WEB}\@}
+%<!latex2e>\def\WEAVE{{\tt WEAVE}\@}
+%<latex2e>\def\WEAVE{\texttt{WEAVE}\@}
+% \end{macrocode}
+%
+% \subsection{General typesetting rules}
+%
+% \begin{macrocode}
+\newlinechar=`\^^J
+\normallineskiplimit=\p@
+\clubpenalty=10000
+\widowpenalty=10000
+\def\NoParIndent{\parindent=\z@}
+\newdimen\normalparindent
+\normalparindent=20\p@
+\def\NormalParIndent{\global\parindent=\normalparindent}
+\NormalParIndent
+\def\BlackBoxes{\overfullrule=5\p@}
+\def\NoBlackBoxes{\overfullrule=\z@}
+\def\newline{\hskip\z@\@plus\pagewd\break}
+% \end{macrocode}
+%
+% Hyphen control: first, we save the hyphenpenalties in
+% \cs{allowhyphens}. This allows us to permit hyphens temporarily in
+% things like \cs{netaddress}es, which typically occur when
+% \cs{raggedright} is set, but which need to be allowed to break at
+% their artificial discretionaries.
+%
+% \begin{macrocode}
+\edef\allowhyphens{\noexpand\hyphenpenalty\the\hyphenpenalty\relax
+ \noexpand\exhyphenpenalty\the\exhyphenpenalty\relax}
+\def\nohyphens{\hyphenpenalty\@M\exhyphenpenalty\@M}
+% \end{macrocode}
+%
+% \subsection{Utility registers and definitions}
+%
+% We define a few scratch registers (and the like) for transient use;
+% they're all paired: an internal one (\cs{T@st*}) and an external one
+% (\cs{Test*}).
+%
+% \begin{description}
+% \item[\emph{Comment:}] Exercise for an idle day: find whether all
+% these are necessary, or whether we can use the \LaTeX{} temporaries
+% for some (or all) of the \cs{T@st*} ones.
+% \item[\emph{Comment:}] (bb) All these registers are used in the
+% plain version, |tugboat.sty|.
+% \end{description}
+%
+% \begin{macrocode}
+\newbox\T@stBox \newbox\TestBox
+\newcount\T@stCount \newcount\TestCount
+\newdimen\T@stDimen \newdimen\TestDimen
+\newif\ifT@stIf \newif\ifTestIf
+% \end{macrocode}
+%
+% Control sequence existence test, stolen from \TeX book exercise 7.7
+% (note that this provides functionality that in some sense duplicates
+% something within \LaTeX).
+%
+% \begin{macrocode}
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
+% \end{macrocode}
+%
+% \LaTeX\ conventions which are also useful here.
+%
+% \begin{macrocode}
+%<*!latex>
+ \let\@@input\input
+ \def\iinput#1{\@@input#1 }
+ \def\@inputcheck{\if\@nextchar\bgroup
+ \expandafter\iinput\else\expandafter\@@input\fi}
+ \def\input{\futurelet\@nextchar\@inputcheck}
+%</!latex>
+% \end{macrocode}
+%
+% Smashes repeated from AMS-\TeX; plain \TeX{} implements only full
+% |\smash|.
+%
+% \begin{macrocode}
+\newif\iftop@ \newif\ifbot@
+\def\topsmash{\top@true\bot@false\smash@}
+\def\botsmash{\top@false\bot@true\smash@}
+\def\smash{\top@true\bot@true\smash@}
+\def\smash@{\relax\ifmmode\def\next{\mathpalette\mathsm@sh}%
+ \else\let\next\makesm@sh\fi \next }
+\def\finsm@sh{\iftop@\ht\z@\z@\fi\ifbot@\dp\z@\z@\fi\box\z@}
+% \end{macrocode}
+%
+% Vertical `laps'; cf.\ |\llap| and |\rlap|
+%
+% \begin{macrocode}
+\long\def\ulap#1{\vbox to \z@{\vss#1}}
+\long\def\dlap#1{\vbox to \z@{#1\vss}}
+% \end{macrocode}
+% And centered horizontal and vertical `laps'
+% \begin{macrocode}
+\def\xlap#1{\hb@xt@\z@{\hss#1\hss}}
+\long\def\ylap#1{\vbox to \z@{\vss#1\vss}}
+\long\def\zlap#1{\ylap{\xlap{#1}}}
+% \end{macrocode}
+% Avoid unwanted vertical glue when making up pages.
+% \begin{macrocode}
+\def\basezero{\baselineskip\z@skip \lineskip\z@skip}
+% \end{macrocode}
+% Empty rules for special occasions
+% \begin{macrocode}
+\def\nullhrule{\hrule \@height\z@ \@depth\z@ \@width\z@ }
+\def\nullvrule{\vrule \@height\z@ \@depth\z@ \@width\z@ }
+% \end{macrocode}
+% Support ad-hoc strut construction.
+% \begin{macrocode}
+\def\makestrut[#1;#2]{\vrule \@height#1 \@depth#2 \@width\z@ }
+% \end{macrocode}
+% Construct box for figure pasteup, etc.;
+% height = \#1, width = \#2, rule thickness = \#3
+% \begin{macrocode}
+\def\drawoutlinebox[#1;#2;#3]{\T@stDimen=#3
+ \vbox to#1{\hrule \@height\T@stDimen \@depth\z@
+ \vss\hb@xt@#2{\vrule \@width\T@stDimen
+ \hfil\makestrut[#1;\z@]%
+ \vrule \@width\T@stDimen}\vss
+ \hrule \@height\T@stDimen \@depth\z@}}
+% \end{macrocode}
+% Today's date, to be printed on drafts. Based on \TeX book, p.406.
+% \begin{macrocode}
+%<*!latex>
+\def\today{\number\day\space \ifcase\month\or
+ Jan \or Feb \or Mar \or Apr \or May \or Jun \or
+ Jul \or Aug \or Sep \or Oct \or Nov \or Dec \fi
+ \number\year}
+%</!latex>
+% \end{macrocode}
+% Current time; this may be system dependent!
+% \begin{macrocode}
+\newcount\hours
+\newcount\minutes
+\def\SetTime{\hours=\time
+ \global\divide\hours by 60
+ \minutes=\hours
+ \multiply\minutes by 60
+ \advance\minutes by-\time
+ \global\multiply\minutes by-1 }
+\SetTime
+\def\now{\number\hours:\ifnum\minutes<10 0\fi\number\minutes}
+\def\Now{\today\ \now}
+\newif\ifPrelimDraft
+%<!latex2e>\def\midrtitle{\ifPrelimDraft {{\tensl preliminary draft, \Now}}\fi}
+%<latex2e>\def\midrtitle{\ifPrelimDraft {\textsl{preliminary draft, \Now}}\fi}
+% \end{macrocode}
+%
+% \subsection{Ragged right and friends}
+%
+% \begin{macro}{\raggedskip}
+% \begin{macro}{\raggedstretch}
+% \begin{macro}{\raggedparfill}
+% \begin{macro}{\raggedspaces}
+% Plain \TeX{}'s definition of |\raggedright| doesn't permit any
+% stretch, and results in too many overfull boxes. We also turn off
+% hyphenation. This code lies somewhere between that of Plain \TeX{}
+% and of \LaTeX{}.
+% \begin{macrocode}
+\newdimen\raggedskip \raggedskip=\z@
+\newdimen\raggedstretch \raggedstretch=5em % ems of font set now (10pt)
+\newskip\raggedparfill \raggedparfill=\z@\@plus 1fil
+\def\raggedspaces{\spaceskip=.3333em \relax \xspaceskip=.5em \relax }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\raggedright}
+% \begin{macro}{\raggedleft}
+% \begin{macro}{\raggedcenter}
+% \begin{macro}{\normalspaces}
+% Some applications may have to add stretch, in order to avoid
+% all overfull boxes. We define the following uses of the above
+% skips, etc.
+% \begin{macrocode}
+\def\raggedright{%
+ \nohyphens
+ \rightskip=\raggedskip\@plus\raggedstretch \raggedspaces
+ \parfillskip=\raggedparfill
+}
+\def\raggedleft{%
+ \nohyphens
+ \leftskip=\raggedskip\@plus\raggedstretch \raggedspaces
+ \parfillskip=\z@skip
+}
+\def\raggedcenter{%
+ \nohyphens
+ \leftskip=\raggedskip\@plus\raggedstretch
+ \rightskip=\leftskip \raggedspaces
+ \parindent=\z@ \parfillskip=\z@skip
+}
+\def\normalspaces{\spaceskip\z@skip \xspaceskip\z@skip}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% Miscellaneous useful stuff. Note that \LaTeXe{} defines a robust
+% \cs{,}, but that we provide a new definition of |~| by redefining
+% its robust underpinnings\footnote{\cs{DeclareRobustCommand} doesn't
+% mind redefinition, fortunately} (based on the version in
+% AMS-\TeX~--- the \LaTeXe{} version has \cs{leavevmode} and doesn't
+% care about surrounding space).
+% \begin{macrocode}
+%<*!latex2e>
+\def\,{\relax\ifmmode\mskip\thinmuskip\else\thinspace\fi}
+\def~{\unskip\nobreak\ \ignorespaces}
+%</!latex2e>
+%<*latex2e>
+\DeclareRobustCommand{\nobreakspace}{%
+ \unskip\nobreak\ \ignorespaces}
+%</latex2e>
+% \end{macrocode}
+%
+% Plain \TeX{} defines \cs{newbox} as \cs{outer}. We solemnly
+% preserve the following, which removes the \cs{outer}ness; of course,
+% we carefully exclude it from what we generate\dots{} (\cs{outer}ness is a
+% spawn of the devil, is it not? Barbara Beeton responded to the
+% previous sentence ``\cs{outer}ness has its place: it avoids register
+% buildup, hence running out of memory''. In another context, David
+% Carlisle remarked that an error control mechanism that causes more
+% confusing errors than it prevents is rather a poor one. This is
+% perhaps not the place to conduct a serious debate\dots)
+%
+% \begin{macrocode}
+%<!latex>\def\newbox{\alloc@4\box\chardef\insc@unt}
+\def\boxcs#1{\box\csname#1\endcsname}
+\def\setboxcs#1{\setbox\csname#1\endcsname}
+\def\newboxcs#1{\expandafter\newbox\csname#1\endcsname}
+%<!latex>\def\gobble#1{}
+%<latex>\let\gobble\@gobble
+\def\vellipsis{%
+ \leavevmode\kern0.5em
+ \raise\p@\vbox{\baselineskip6\p@\vskip7\p@\hbox{.}\hbox{.}\hbox{.}}
+ }
+\def\bull{\vrule \@height 1ex \@width .8ex \@depth -.2ex }
+\def\cents{{\rm\raise.2ex\rlap{\kern.05em$\scriptstyle/$}c}}
+\def\Dag{\raise .6ex\hbox{$\scriptstyle\dagger$}}
+\def\careof{\leavevmode\hbox{\raise.75ex\hbox{c}\kern-.15em
+ /\kern-.125em\smash{\lower.3ex\hbox{o}}} \ignorespaces}
+%<*!latex2e>
+\def\sfrac#1/#2{\leavevmode\kern.1em
+ \raise.5ex\hbox{\the\scriptfont\z@ #1}\kern-.1em
+ /\kern-.15em\lower.25ex\hbox{\the\scriptfont\z@ #2}}
+%</!latex2e>
+%<*latex2e>
+\DeclareRobustCommand\sfrac[1]{\@ifnextchar/{\@sfrac{#1}}%
+ {\@sfrac{#1}/}}
+\def\@sfrac#1/#2{\leavevmode\kern.1em\raise.5ex
+ \hbox{$\m@th\mbox{\fontsize\sf@size\z@
+ \selectfont#1}$}\kern-.1em
+ /\kern-.15em\lower.25ex
+ \hbox{$\m@th\mbox{\fontsize\sf@size\z@
+ \selectfont#2}$}}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+\DeclareRobustCommand\meta[1]{%
+ \ensuremath{\langle}\emph{#1}\ensuremath{\rangle}}
+\DeclareRobustCommand\env[1]{%
+ \cs{begin}\texttt{\char`\{#1\char`\}}}
+%</latex2e>
+\def\thinskip{\hskip 0.16667em\relax}
+% \end{macrocode}
+%
+% We play a merry game with dashes, providing all conceivable options
+% of breakability before and after.
+%
+% \begin{macrocode}
+\def\endash{--}
+\def\emdash{\endash-}
+\def\d@sh#1#2{\unskip#1\thinskip#2\thinskip\ignorespaces}
+\def\dash{\d@sh\nobreak\endash}
+\def\Dash{\d@sh\nobreak\emdash}
+\def\ldash{\d@sh\empty{\hbox{\endash}\nobreak}}
+\def\rdash{\d@sh\nobreak\endash}
+\def\Ldash{\d@sh\empty{\hbox{\emdash}\nobreak}}
+\def\Rdash{\d@sh\nobreak\emdash}
+% \end{macrocode}
+%
+% Hacks to permit automatic hyphenation after an actual hyphen, or
+% after a slash.
+%
+% \begin{macrocode}
+\def\hyph{-\penalty\z@\hskip\z@skip }
+\def\slash{/\penalty\z@\hskip\z@skip }
+% \end{macrocode}
+%
+% Adapted from |comp.text.tex| posting by Donald Arseneau, 26 May 93.
+% \LaTeXe-isation added by Robin Fairbairns. Destroys both the
+% |TestCount|s.
+%
+% \begin{macrocode}
+\def\nth#1{%
+ \def\reserved@a##1##2\@nil{\ifcat##1n%
+ 0%
+%<latex2e> \let\reserved@b\ensuremath
+ \else##1##2%
+%<latex2e> \let\reserved@b\relax
+ \fi}%
+ \TestCount=\reserved@a#1\@nil\relax
+ \ifnum\TestCount <0 \multiply\TestCount by\m@ne \fi % subdue negatives
+ \T@stCount=\TestCount
+ \divide\T@stCount by 100 \multiply\T@stCount by 100
+ \advance\TestCount by-\T@stCount % n mod 100
+ \ifnum\TestCount >20 \T@stCount=\TestCount
+ \divide\T@stCount by 10 \multiply\T@stCount by 10
+ \advance\TestCount by-\T@stCount % n mod 10
+ \fi
+%<*!latex2e>
+ \T@stCount=\the\fam\relax
+ $\fam\T@stCount#1^{\fam\T@stCount
+ \ifcase\TestCount th% 0th
+ \or st% 1st
+ \or nd% 2nd
+ \or rd% 3rd
+ \else th% nth
+ \fi
+ }$%
+%</!latex2e>
+%<*latex2e>
+ \reserved@b{#1}%
+ \textsuperscript{\ifcase\TestCount th% 0th
+ \or st% 1st
+ \or nd% 2nd
+ \or rd% 3rd
+ \else th% nth
+ \fi}%
+%</latex2e>
+ }
+% \end{macrocode}
+%
+% \subsection{Reviews}
+%
+% Format information on reviewed items for book review articles.
+% \begin{macrocode}
+%<*!latex2e>
+\def\Review:#1{\ifx[#1\@Rev[%
+ \else Book review:\enspace\sl #1%
+ \fi
+ }
+\def\@Rev[#1]{\ignorespaces#1\unskip:\enspace\ignorespaces\sl}
+%</!latex2e>
+% \end{macrocode}
+%
+% For the \LaTeXe{} version, we follow Fairbairns' maxim, and define
+% something that can even look like a \LaTeX{} macro\dots
+%
+% \begin{macrocode}
+%<*latex2e>
+\def\Review{\@ifnextchar:{\@Review}{\@Review:}}
+\def\@Review:{\@ifnextchar[%]
+ {\@Rev}%
+ {\@Rev[Book review]}}
+\def\@Rev[#1]#2{{\ignorespaces#1\unskip:\enspace\ignorespaces
+ \slshape\mdseries#2}}
+%</latex2e>
+%<!latex2e>\def\reviewitem{%
+%<latex2e>\def\reviewitem{\addvspace{\BelowTitleSkip}%
+ \def\revauth##1{\def\therevauth{##1, }\ignorespaces}%
+%<!latex2e> \def\revtitle##1{\def\therevtitle{{\sl##1}. }\ignorespaces}%
+%<latex2e> \def\revtitle##1{\def\therevtitle{{\slshape##1}. }\ignorespaces}%
+ \def\revpubinfo##1{\def\therevpubinfo{##1.}\ignorespaces}%
+ }
+\def\endreviewitem{{\noindent\interlinepenalty=10000
+ \therevauth\therevtitle\therevpubinfo\endgraf}%
+ \vskip\medskipamount
+%<!latex>\DeleteOptionalSpacesandPars{\noindent\ignorespaces}%
+ }
+%<!latex2e>\def\booktitle#1{{\sl #1\/}}
+%<latex2e>\def\booktitle#1{{\slshape#1\/}}
+% \end{macrocode}
+%
+% \subsection{Dates, volume and issue numbers, etc.}
+%
+% Dates and other items which identify the volume and issue.
+% \cs{issueseqno} is a sequential issue number starting from the
+% first issue published; volume 15,4 has \cs{issueseqno=45}.
+%
+% To use: \begin{tabular}{l}
+% |\vol 19, 1.|\\
+% |\issdate March 1998.|\\
+% |\issueseqno=58|\\
+% \end{tabular}
+%
+% Starting with volume 23 (nominal 2002), we have \cs{issyear} instead
+% of \cs{issdate}, because issues don't have months any more.
+%
+% For production, these are set in a separate file,
+% |tugboat.dates|, which is issue-specific.
+%
+% \begin{description}
+% \item[\emph{Comment:}] I would like to make the code read a file
+% |tugboat.dates| in the current directory or its parent.
+% This is easy except under `odd' operating systems ({\small VMS} is
+% an example that springs to mind, {\small RISC}os may be even
+% worse) whose syntax is out of the ordinary.
+% \end{description}
+%
+% \begin{macrocode}
+\newcount\issueseqno \issueseqno=-1
+\def\v@lx{\gdef\volx{Volume~\volno~(\volyr), No.~\issno}}
+\def\volyr{}
+\def\volno{}
+\def\vol #1,#2.{\gdef\volno{#1\unskip}%
+ \gdef\issno{\ignorespaces#2\unskip}%
+ \setbox\TestBox=\hbox{\volyr}%
+ \ifdim \wd\TestBox > .2em \v@lx \fi }
+\def\issyear #1.{\gdef\issdt{#1}\gdef\volyr{#1}%
+ \gdef\bigissdt{#1}%
+ \setbox\TestBox=\hbox{\volno}%
+ \ifdim \wd\TestBox > .2em \v@lx \fi }
+\def\issdate #1#2 #3.{\gdef\issdt{#1#2 #3}\gdef\volyr{#3}%
+ \gdef\bigissdt{#1{\smc\uppercase{#2}} #3}%
+ \setbox\TestBox=\hbox{\volno}%
+ \ifdim \wd\TestBox > .2em \v@lx \fi }
+\vol 0, 0.
+\issdate Thermidor, 2060.
+% \end{macrocode}
+%
+% (The curious should know that \emph{Thermidor} was one of the French
+% revolutionary month names\dots)
+%
+% For \LaTeX{} use, define a version of the issue declaration that can
+% take or leave the old plain syntax
+%
+% \begin{macrocode}
+%<!latex>\def\tubissue#1(#2)%
+%<*latex>
+\def\tubissue#1{\@ifnextchar(%)
+ {\@tubissue@b{#1}}
+ {\@tubissue@a{#1}}}
+\def\@tubissue@b#1(#2){\@tubissue@a{#1}{#2}}
+\def\@tubissue@a#1#2%
+%</latex>
+ {\TUB~#1, no.~#2}
+% \end{macrocode}
+%
+% \TUB{} conventions include the sequential issue number in the file name.
+% Permit this to be incorporated into file names automatically.
+% If \(\mbox{issue number} = 11\), \cs{Input filnam} will read
+% |tb11filnam.tex|
+%
+% \begin{macrocode}
+\def\infil@{\jobname}
+\def\Input #1 {\ifnum\issueseqno<0
+ \def\infil@{#1}%
+ \else
+ \def\infil@{tb\number\issueseqno#1}
+ \fi
+ \edef\jobname{\infil@}\@readFLN
+ \@@input \infil@\relax
+ \if@RMKopen
+ \immediate\closeout\@TBremarkfile\@RMKopenfalse
+ \fi
+}
+% \end{macrocode}
+%
+% \cs{TBremark}s are things that need to be drawn to the attention of
+% the editors; the conscientious author will include such things in
+% the article file. By default, remarks are suppressed, but their
+% appearance may be enabled by the \cs{TBEnableRemarks} command, which
+% can be included in the configuration file |ltugboat.cfg| (or
+% |ltugproc.cfg|, if that's what we're at).
+%
+% \begin{macrocode}
+\newif\if@RMKopen \@RMKopenfalse
+\newwrite\@TBremarkfile
+\def\@TBremark#1{%
+ \if@RMKopen
+ \else
+ \@RMKopentrue\immediate\openout\@TBremarkfile=\infil@.rmk
+ \fi
+ \toks@={#1}%
+ \immediate\write\@TBremarkfile{^^J\the\toks@}%
+ \immediate\write16{^^JTBremark:: \the\toks@^^J}%
+}
+% \end{macrocode}
+%
+% We initialise \cs{TBremark} to ignore its argument (this used to
+% involve a \cs{TBremarkOFF} which was cunningly defined exactly the
+% same as \cs{gobble})
+%
+% \begin{macrocode}
+\let\TBremark=\gobble
+% \end{macrocode}
+%
+% \cs{TBEnableRemarks} simply involves setting \cs{TBremark} to use
+% the functional \cs{@TBremark} defined above.
+%
+% \begin{macrocode}
+\def\TBEnableRemarks{\let\TBremark\@TBremark}
+% \end{macrocode}
+%
+% For marking locations in articles that pertain to remarks
+% in another file of editorial comments
+%
+% \begin{macrocode}
+\def\TUBedit#1{}
+% \end{macrocode}
+%
+% For using different filenames in the production process than those
+% supplied by authors
+%
+% \begin{macrocode}
+\def\TUBfilename#1#2{\expandafter\def\csname file@@#1\endcsname{#2}}
+%<*!latex2e>
+\newread\@altfilenames
+\def\@readFLN{\immediate\openin\@altfilenames=\jobname.fln
+ \ifeof\@altfilenames\let\@result\relax\else
+ \def\@result{\@@input\jobname.fln }\fi
+ \immediate\closein\@altfilenames
+ \@result}
+\@readFLN
+\everyjob=\expandafter{\the\everyjob\@readFLN}
+%</!latex2e>
+%<latex2e>\InputIfFileExists{\jobname.fln}%
+%<latex2e> {\TBInfo{Reading alternative file file \jobname.fln}}{}
+% \end{macrocode}
+%
+% The following needs to work entirely in \TeX's mouth
+% \begin{macrocode}
+\def\@tubfilename#1{\expandafter\ifx\csname file@@#1\endcsname\relax
+ #1\else\csname file@@#1\endcsname\fi}
+\def\fileinput#1{\@@input\@tubfilename{#1} }
+% \end{macrocode}
+%
+% Write out (both to a file and to the log) the starting page number
+% of an article, to be used for cross references and in contents.
+% |\pagexref| is used for articles fully processed in the \TUB{}
+% run. |\PageXref| is used for `extra' pages, where an item is
+% submitted as camera copy, and only running heads (at most) are run.
+%
+% \begin{macrocode}
+%<*!latex>
+\def\pagexrefON#1{%
+ \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
+ \write\ppoutfile{%
+ \def\expandafter\noexpand\csname#1\endcsname{\number\pageno}}%
+ }
+\def\PageXrefON#1{%
+ \immediate\write-1{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\pageno}}%
+ \immediate\write\ppoutfile{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\pageno}}}
+%</!latex>
+%<*latex>
+\def\pagexrefON#1{%
+ \write-1{\def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
+ \write\ppoutfile{%
+ \def\expandafter\noexpand\csname#1\endcsname{\number\c@page}}%
+ }
+\def\PageXrefON#1{%
+ \immediate\write-1{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\c@page}}%
+ \immediate\write\ppoutfile{\def\expandafter
+ \noexpand\csname#1\endcsname{\number\c@page}}}
+%</latex>
+\def\pagexrefOFF#1{}
+\let\pagexref=\pagexrefOFF
+\def\PageXrefOFF#1{}
+\let\PageXref=\PageXrefOFF
+\def\xreftoON#1{%
+ \ifundefined{#1}%
+ ???\TBremark{Need cross reference for #1.}%
+ \else\csname#1\endcsname\fi}
+\def\xreftoOFF#1{???}
+\let\xrefto=\xreftoOFF
+% \end{macrocode}
+%
+% \cs{TBdriver} `marks code for use when articles are run together in
+% a driver file'. Since we don't yet have a definition of that
+% arrangement, we don't have a definition of \cs{TBdriver}. Its
+% argument (which one presumes was intended as the code for this
+% unusual state) is just gobbled.
+%
+% \begin{macrocode}
+\let\TBdriver\gobble
+% \end{macrocode}
+%
+% Some hyphenation exceptions:
+%
+% \begin{macrocode}
+\hyphenation{Dijk-stra Eijk-hout Hara-lam-bous
+ Doc-Book Flor-i-da Ghost-script Ghost-view Open-Type Pfa-Edit
+ Post-Script True-Type
+ ap-pen-dix
+ bit-map bit-mapped bit-maps bool-ean
+ col-umns
+ data-base data-bases
+ fall-ing
+ half-way
+ long-est
+ ma-gyar man-u-script man-u-scripts
+ over-view
+ par-a-digm par-a-digm-atic par-a-digms
+ se-vere-ly spell-ing spell-ings stand-alone strong-est
+ time-stamp time-stamped
+ which-ever white-space white-spaces wide-spread wrap-around
+}
+%<!latex>\restorecat\@
+%</common>
+%<*classtail>
+\PrelimDrafttrue
+% \end{macrocode}
+% \subsection{Page dimensions, glue, penalties etc}
+% \begin{macrocode}
+\textheight 54pc
+\textwidth 39pc
+\columnsep 1.5pc
+\columnwidth 18.75pc
+\parindent \normalparindent
+\parskip \z@ % \@plus\p@
+\leftmargini 2em
+\leftmarginv .5em
+\leftmarginvi .5em
+\oddsidemargin \z@
+\evensidemargin \z@
+\topmargin -2.5pc
+\headheight 12\p@
+\headsep 20\p@
+\marginparwidth 48\p@
+\marginparsep 10\p@
+\partopsep=\z@
+\topsep=3\p@\@plus\p@\@minus\p@
+\parsep=3\p@\@plus\p@\@minus\p@
+\itemsep=\parsep
+\twocolumn
+\newdimen\pagewd \pagewd=39pc
+\newdimen\trimwd \trimwd=\pagewd
+\newdimen\trimlgt \trimlgt=11in
+\newdimen\headmargin \headmargin=3.5pc
+% \end{macrocode}
+%
+% If we're in \LaTeXe, |twoside| option is forced on when
+% |article.cls| is loaded.
+%
+% \begin{macrocode}
+%<!latex2e>\@twosidetrue
+% \end{macrocode}
+%
+% \subsection{Messing about with the \LaTeX{} logo}
+% \label{sec:latex-logo}
+%
+% Barbara Beeton's pleas for \LaTeX{} logos that look right in any
+% font shape provoked me to generate the following stuff that is
+% configurable.
+%
+% Here's the command for the user to define hir own new version. The
+% arguments are font family, series and shape, and then the two kern
+% values used in placing the raised `A' of \LaTeX.
+%
+% \begin{macrocode}
+\newcommand\DeclareLaTeXLogo[5]{\expandafter\def
+ \csname @LaTeX@#1/#2/#3\endcsname{{#4}{#5}}}
+% \end{macrocode}
+%
+% The default values are as used in the source of \LaTeX{} itself:
+%
+% \begin{macrocode}
+\def\@LaTeX@default{{.36}{.15}}
+% \end{macrocode}
+%
+% Three more defined in the initial version, for bold CM sans (which is
+% used as \cs{SecTitleFont}), and CM italic medium and bold:
+%
+% \begin{macrocode}
+\DeclareLaTeXLogo{cmss}{bx}n{.3}{.15}
+\DeclareLaTeXLogo{cmr}m{it}{.3}{.27}
+\DeclareLaTeXLogo{cmr}{bx}{it}{.3}{.27}
+% \end{macrocode}
+%
+% Redefine \cs{LaTeX} to choose the parameters for the current font,
+% or to use the default value otherwise:
+%
+% \begin{macrocode}
+\DeclareRobustCommand\LaTeX{\expandafter\let\expandafter\reserved@a
+ \csname @LaTeX@\f@family/\f@series/\f@shape\endcsname
+ \ifx\reserved@a\relax\let\reserved@a\@LaTeX@default\fi
+ \expandafter\@LaTeX\reserved@a}
+% \end{macrocode}
+%
+% Here's the body of what was originally \cs{LaTeX}, pulled out with its
+% roots dripping onto the smoking ruin of original \LaTeX, and then
+% bits stuck in on the side.
+%
+% \cs{@LaTeX@default} provides parameters as one finds in the
+% original; other versions are added as needed.
+%
+% \begin{macrocode}
+\newcommand\@LaTeX[2]{L\kern-#1em
+ {\sbox\z@ T%
+ \vbox to\ht0{\hbox{$\m@th$%
+ \csname S@\f@size\endcsname
+ \fontsize\sf@size\z@
+ \math@fontsfalse\selectfont
+ A}%
+ \vss}%
+ }%
+ \kern-#2em%
+ \TeX}
+% \end{macrocode}
+%
+% \subsection{Authors, contributors, addresses, signatures}
+%
+% Each article may have several authors (of course), so we permit an
+% \cs{author} command for each of them. The names are then stored in
+% a set of \cs{csname}s called \cs{author1}, \cs{author2}, \dots
+% Similarly, there are several \cs{address<n>} and \cs{netaddress<n>}
+% and \cs{PersonalURL<n>} commands set up for each article.
+%
+% \begin{description}
+% \item[\emph{Comment:}] I would like to make provision for several
+% authors at the same address, but (short of preempting the |*|
+% marker, which it would be nice to retain so as to preserve
+% compatibility with the |plain| style) I'm not sure how one would
+% signal it.
+% \end{description}
+% \begin{macrocode}
+\def\theauthor#1{\csname theauthor#1\endcsname}
+\def\theaddress#1{\csname theaddress#1\endcsname}
+\def\thenetaddress#1{\csname thenetaddress#1\endcsname}
+\def\thePersonalURL#1{\csname thePersonalURL#1\endcsname}
+% \end{macrocode}
+%
+% The standard way of listing authors is to iterate from 1 to
+% \cs{count@} and to pick the author names as we go.
+%
+% \begin{macrocode}
+%<!latex>\newcount\@tempcnta
+\def\@defaultauthorlist{%
+ \@getauthorlist\@firstofone
+}
+% \end{macrocode}
+%
+% \cs{@getauthorlist} processes the author list, passing every bit of
+% stuff that needs to be typeset to its argument.
+% \begin{macrocode}
+\def\@getauthorlist#1{%
+ \count@\authornumber
+ \advance\count@ by -2
+ \@tempcnta0
+% \end{macrocode}
+%
+% Loop to output the first \ensuremath{n-2} of the \ensuremath{n}
+% authors (the loop does nothing if there are two or fewer authors)
+%
+% \begin{macrocode}
+ \loop
+ \ifnum\count@>0
+ \advance\@tempcnta by \@ne
+ #1{\ignorespaces\theauthor{\number\@tempcnta}\unskip, }%
+ \advance\count@ by \m@ne
+ \repeat
+ \count@\authornumber
+ \advance\count@ by -\@tempcnta
+ \ifnum\authornumber>0
+% \end{macrocode}
+%
+% If there are two or more authors, we output the penultimate author's
+% name here, followed by `and'
+%
+% \begin{macrocode}
+ \ifnum\count@>1
+ \count@\authornumber
+ \advance\count@ by \m@ne
+ #1{\ignorespaces\theauthor{\number\count@}\unskip\ and }%
+ \fi
+% \end{macrocode}
+%
+% Finally (if there were any authors at all) output the last author's
+% name:
+%
+% \begin{macrocode}
+ #1{\ignorespaces\theauthor{\number\authornumber}\unskip}
+ \fi
+}
+% \end{macrocode}
+%
+% Signature blocks. The author can (in principle) define a different
+% sort of signature block using \cs{signature}, though this could well
+% cause the editorial group to have collective kittens (unless it had
+% been discussed in advance\dots)
+%
+% \begin{macrocode}
+\def\signature#1{\def\@signature{#1}}
+\def\@signature{\@defaultsignature}
+% \end{macrocode}
+%
+% \cs{@defaultsignature} loops through all the authors, outputting the
+% details we have about that author, or (if we're in a sub-article)
+% outputs the contributor's name and closes the group opened by
+% \cs{contributor}. It is (as its name implies) the default body for
+% \cs{makesignature}
+%
+% \begin{macrocode}
+\def\@defaultsignature{{%
+ \let\thanks\@gobble
+ \ifnum\authornumber<0
+% \end{macrocode}
+% if \cs{authornumber}$<0$, we are in a contributor's section
+% \begin{macrocode}
+ \medskip
+ \signaturemark
+ \theauthor{\number\authornumber}\\
+ \theaddress{\number\authornumber}\\
+ \allowhyphens
+ \thenetaddress{\number\authornumber}\\
+ \thePersonalURL{\number\authornumber}\\
+ \else
+% \end{macrocode}
+% \cs{authornumber}$\ge0$, so we are in the body of an ordinary
+% article
+% \begin{macrocode}
+ \count@=0
+ \loop
+ \ifnum\count@<\authornumber
+ \medskip
+ \advance\count@ by \@ne
+ \signaturemark
+ \theauthor{\number\count@}\\
+ \theaddress{\number\count@}\\
+ {%
+ \allowhyphens
+ \thenetaddress{\number\count@}\\
+ \thePersonalURL{\number\count@}\\
+ }%
+ \repeat
+ \fi
+ }%
+}
+\newdimen\signaturewidth \signaturewidth=12pc
+% \end{macrocode}
+% The optional argument to \cs{makesignature} is useful in some
+% circumstances (e.g., multi-contributor articles)
+% \begin{macrocode}
+\newcommand\makesignature[1][\medskipamount]{%
+% \end{macrocode}
+%
+% check the value the user has put in \cs{signaturewidth}: it may be
+% at most \verb|1.5pc| short of \cs{columnwidth}
+% \begin{macrocode}
+ \@tempdima\signaturewidth
+ \advance\@tempdima 1.5pc
+ \ifdim \@tempdima>\columnwidth
+ \signaturewidth \columnwidth
+ \advance\signaturewidth -1.5pc
+ \fi
+ \par
+ \penalty9000
+ \vspace{#1}%
+ \rightline{%
+ \vbox{\hsize\signaturewidth \ninepoint \raggedright
+ \parindent \z@ \everypar={\hangindent 1pc }
+ \parskip \z@skip
+ \def\|{\unskip\hfil\break}%
+ \def\\{\endgraf}%
+ \def\phone{\rm Phone: }
+ \rm\@signature}%
+ }%
+ \ifnum\authornumber<0 \endgroup\fi
+}
+\def\signaturemark{\leavevmode\llap{$\diamond$\enspace}}
+% \end{macrocode}
+%
+% The code used to define the following:
+%
+% {\small\begin{verbatim}
+% {\makeactive\@
+% \gdef\signatureat{\makeactive\@\def@{\char"40\discretionary{}{}{}}}
+% \makeactive\%
+% \gdef\signaturepercent{\makeactive\%\def%{\char"25\discretionary{}{}{}}}
+% }
+% \end{verbatim}}
+%
+% However, they were never used within the class (or within
+% |ltugproc.cls|). They have therefore been deleted; the identically
+% defined \cs{netaddrat} and \cs{netaddrpercent} may be used in the
+% unlikely event that they're needed elsewhere.
+%
+% Now all the awful machinery of author definitions.
+% \cs{authornumber} records the number of authors we have recorded to
+% date.
+%
+% \begin{macrocode}
+\newcount\authornumber
+\authornumber=0
+% \end{macrocode}
+%
+% \cs{author} `allocates' another author name (by bumping
+% \cs{authornumber}) and also sets up the address and netaddress for
+% this author to produce a warning and to prevent oddities if they're
+% invoked. This last assumes that invocation will be in the context
+% of \cs{signature} (|ltugboat.cls|) or \cs{maketitle}
+% (|ltugproc.cls|); in both cases, invocation is followed by a line
+% break (tabular line break |\\| in |ltugproc|, \cs{endgraf} in
+% \cs{makesignature} in |ltugboat|).
+%
+% \begin{macrocode}
+\def\author{%
+ \global\advance\authornumber\@ne
+ \TB@author
+}
+% \end{macrocode}
+% \cs{contributor} is for a small part of a multiple-part article; it
+% begins a group that will be ended in \cs{makesignature}
+% \begin{macrocode}
+\def\contributor{%
+ \begingroup
+ \authornumber\m@ne
+ \TB@author
+}
+% \end{macrocode}
+%
+% Both `types' of author fall through here to set up the author name
+% and to initialise author-related things. \cs{EDITORno*} commands
+% allow the editor to record that there's good reason for an
+% \emph{address} or \emph{netaddress} not to be there (the
+% \emph{personalURL} is optional anyway).
+% \begin{macrocode}
+\def\TB@author#1{%
+ \expandafter\def\csname theauthor\number\authornumber\endcsname
+ {\ignorespaces#1\unskip}%
+ \expandafter\def\csname theaddress\number\authornumber\endcsname
+ {\TBWarningNL{Address for #1\space missing}\@gobble}%
+ \expandafter\def\csname thenetaddress\number\authornumber\endcsname
+ {\TBWarningNL{Net address for #1\space missing}\@gobble}%
+ \expandafter\let\csname thePersonalURL\number\authornumber\endcsname
+ \@gobble
+ }
+\def\EDITORnoaddress{%
+ \expandafter\let\csname theaddress\number\authornumber\endcsname
+ \@gobble
+}
+\def\EDITORnonetaddress{%
+ \expandafter\let\csname thenetaddress\number\authornumber\endcsname
+ \@gobble
+}
+% \end{macrocode}
+%
+% \cs{address} simply copies its argument into the \cs{theaddress<n>}
+% for this author.
+%
+% \begin{macrocode}
+\def\address#1{%
+ \expandafter\def\csname theaddress\number\authornumber\endcsname
+ {\leavevmode\ignorespaces#1\unskip}}
+% \end{macrocode}
+%
+% \cs{network} is for use within the optional argument of
+% \cs{netaddress}; it defines the \emph{name} of the network the user
+% is on.
+%
+% \begin{description}
+% \item[\emph{Comment:}] I think this is a fantasy, since everyone (in
+% practice, nowadays) quotes an internet address. In principle, there
+% are people who will quote |X.400| addresses (but they're few and far
+% between) and I have (during 1995!) seen an address with an |UUCP|
+% bang-path component on |comp.text.tex|, but \emph{really}!
+% \end{description}
+%
+% \begin{macrocode}
+\def\network#1{\def\@network{#1: }}
+% \end{macrocode}
+%
+% \cs{netaddress} begins a group, executes an optional argument (which
+% should not, presumably, contain global commands) and then relays to
+% \cs{@relay@netaddress} with both |@| and |%| made active (so that
+% they can be discretionary points in the address). If we're using
+% \LaTeXe, we use the default-argument form of \cs{newcommand};
+% otherwise we write it out in all its horribleness.
+%
+% \begin{macrocode}
+%<*latex2e>
+\newcommand\netaddress[1][\relax]{%
+ \begingroup
+ \def\@network{}%
+%</latex2e>
+%<*!latex2e>
+\def\netaddress{%
+ \begingroup
+ \def\@network{}%
+ \@ifnextchar[{\@netaddress}{\@netaddress[]}%]
+ }
+\def\@netaddress[#1]{%}
+%</!latex2e>
+% \end{macrocode}
+%
+% Unfortunately, because of the catcode hackery, we have still to do
+% one stage of relaying within our own code, even if we're using
+% \LaTeXe.
+%
+% \begin{macrocode}
+ #1\@sanitize\makespace\ \makeactive\@
+ \makeactive\.\makeactive\%\@relay@netaddress}%
+% \end{macrocode}
+%
+% \cs{@relay@netaddress} finishes the job. It sets \cs{thenetaddress}
+% for this author to contain the network name followed by the address.
+% As a result of our kerfuffle above, |@| and |%| are active at the
+% point we're entered. We ensure they're active when
+% \cs{thenetaddress} gets expanded, too. (\textbf{\emph{WOT}?!})
+%
+% \begin{macrocode}
+\def\@relay@netaddress#1{%
+ \ProtectNetChars
+%<*!latex2e>
+ \expandafter\xdef\csname thenetaddress\number\authornumber\endcsname
+ {\leavevmode{\noexpand\rm\@network}%
+ {\noexpand\NetAddrChars\noexpand\net
+ \ignorespaces#1\unskip}}%
+%</!latex2e>
+%<*latex2e>
+ \expandafter\protected@xdef
+ \csname thenetaddress\number\authornumber\endcsname
+ {\protect\leavevmode\textrm{\@network}%
+ {\protect\NetAddrChars\net
+ \ignorespaces#1\unskip}}%
+%</latex2e>
+ \endgroup
+ }
+% \end{macrocode}
+%
+% \cs{personalURL} is in essence the same as \cs{netaddress}, apart
+% from (1) the lack of the eccentric optional argument, and (2) the
+% activation of `|/|'.
+%
+% We could imagine needing an \cs{URL} command in general. If so, we
+% must remember that the code here would naturally permit a break
+% between the last two characters of |http://|, and some sort of
+% special action must be taken to ensure that it doesn't happen.
+%
+% \begin{macrocode}
+\def\personalURL{\begingroup
+ \@sanitize\makespace\ \makeactive\@
+ \makeactive\.\makeactive\%\makeactive\/\@personalURL}%
+\def\@personalURL#1{%
+ \ProtectNetChars
+%<*!latex2e>
+ \expandafter\xdef\csname thePersonalURL\number\authornumber\endcsname
+ {\noexpand\URLchars\noexpand\net
+ \ignorespaces#1\unskip}}%
+%</!latex2e>
+%<*latex2e>
+ \expandafter\protected@xdef
+ \csname thePersonalURL\number\authornumber\endcsname{%
+ \protect\leavevmode
+ {%
+ \protect\URLchars\net
+ \ignorespaces#1\unskip
+ }%
+ }%
+%</latex2e>
+ \endgroup
+ }
+% \end{macrocode}
+%
+% Define the activation mechanism for `|@|', `|%|', `|.|' and `|/|', for use
+% in the above. Note that, since the code has `|%|' active, we have
+% `|*|' as a comment character, which has a tendency to make things
+% look peculiar\dots
+%
+% \begin{macrocode}
+{%
+ \makecomment\*
+ \makeactive\@
+ \gdef\netaddrat{\makeactive\@*
+ \def@{\discretionary{\char"40}{}{\char"40}}}
+ \makeactive\%
+ \gdef\netaddrpercent{\makeactive\%*
+ \def%{\discretionary{\char"25}{}{\char"25}}}
+ \makeactive\.
+ \gdef\netaddrdot{\makeactive\.*
+ \def.{\discretionary{\char"2E}{}{\char"2E}}}
+% \end{macrocode}
+%
+% \cs{NetAddrChars} is what \emph{we} use (we're constrained to retain
+% the old interface to this stuff, but it \emph{is} clunky\dots).
+% Since {\small URL}s are a new idea, we are at liberty not to define
+% a separate \cs{netaddrslash} command, and we only have
+% \cs{URLchars}.
+%
+% \begin{macrocode}
+ \gdef\NetAddrChars{\netaddrat \netaddrpercent \netaddrdot}
+ \makeactive\/
+ \gdef\URLchars{*
+ \NetAddrChars
+ \makeactive\/*
+ \def/{\discretionary{\char"2F}{}{\char"2F}}}
+% \end{macrocode}
+%
+% \cs{ProtectNetChars} includes protecting `|/|', since this does no
+% harm in the case of net addresses (where it's not going to be
+% active) and we thereby gain by not having yet another csname.
+%
+% \begin{macrocode}
+ \gdef\ProtectNetChars{*
+%<*!latex2e>
+ \def@{\noexpand@}*
+ \def%{\noexpand%}*
+ \def.{\noexpand.}*
+ \def/{\noexpand/}*
+%</!latex2e>
+%<*latex2e>
+ \def@{\protect@}*
+ \def%{\protect%}*
+ \def.{\protect.}*
+ \def/{\protect/}*
+%</latex2e>
+ }
+}
+% \end{macrocode}
+%
+% In \LaTeX2.09, there's no inhibition against simply saying the
+% following:
+%
+% \begin{macrocode}
+%<!latex2e>\def\net{\tt}
+% \end{macrocode}
+%
+% \LaTeXe{}, on the other hand (in its wisdom), suppresses
+% \cs{DeclareOldFontCommand} when in compatibility mode, so that in
+% that circumstance we need to use a declaration copied from
+% |latex209.def| rather than the way we would normally do the thing
+% (using the command \LaTeXe{} defines for the job).
+%
+% \begin{macrocode}
+%<*latex2e>
+\if@compatibility
+ \DeclareRobustCommand\net{\normalfont\ttfamily\mathgroup\symtypewriter}
+\else
+ \DeclareOldFontCommand{\net}{\ttfamily\upshape\mdseries}{\mathtt}
+\fi
+%</latex2e>
+\def\authorlist#1{\def\@author{#1}}
+\def\@author{\@defaultauthorlist}
+% \end{macrocode}
+%
+% \begin{macro}{\if@articletitle}
+% \begin{macro}{\maketitle}
+% \begin{macro}{\@r@maketitle}
+% \cs{maketitle} takes an optional ``*''; if present, the operation is
+% not defining the title of a paper, merely that of a ``business''
+% section (such as the participants at a meeting) that has no credited
+% author or other title. In this case, the command flushes out the
+% latest \cs{sectitle} (or whatever) but does nothing else.
+%
+% Provide machinery to skip extra space, even one or more full columns,
+% above the top of an article to leave space to paste up a previous
+% article that has finished on the same page. This is a fall back to
+% accommodate the fact that multiple articles cannot yet be run together
+% easily with \LaTeXe.
+% \begin{macrocode}
+\newif\if@articletitle
+\def\maketitle{\@ifstar
+ {\@articletitlefalse\@r@maketitle}%
+ {\@articletitletrue\@r@maketitle}%
+}
+\def\@r@maketitle{\par
+ \ifdim\PreTitleDrop > \z@
+ \loop
+ \ifdim \PreTitleDrop > \textheight
+ \vbox{}\vfil\eject
+ \advance\PreTitleDrop by -\textheight
+ \repeat
+ \vbox to \PreTitleDrop{}
+ \global\PreTitleDrop=\z@
+ \fi
+ \begingroup
+ \setcounter{footnote}{0}
+ \def\thefootnote{\fnsymbol{footnote}}
+ \@maketitle
+ \@thanks
+ \endgroup
+ \setcounter{footnote}{0}
+ \gdef\@thanks{}
+ }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Section titles}
+%
+% The following macros are used to set the large \TUB{} section heads
+% (e.g.\ ``General Delivery'', ``Fonts'', etc.)
+%
+% Define the distance between articles which are run together:
+%
+% \begin{macrocode}
+\def\secsep{\vskip 5\baselineskip}
+% \end{macrocode}
+%
+% Note that \cs{stbaselineskip} is used in the definition of
+% \cs{sectitlefont}, in \LaTeXe, so that it has (at least) to be
+% defined before \cs{sectitlefont} is used (we do the whole job).
+%
+% \begin{macrocode}
+\newdimen\stbaselineskip \stbaselineskip=18\p@
+\newdimen\stfontheight
+%<*!latex2e>
+\setbox\T@stBox=\hbox{\sectitlefont O}
+\stfontheight=\ht\T@stBox
+%</!latex2e>
+%<latex2e> \settoheight{\stfontheight}{\sectitlefont O}
+% \end{macrocode}
+%
+% Declaring section titles; the conditional \cs{ifSecTitle} records
+% the occurence of a \cs{sectitle} command. If (when) a subsequent
+% \cs{maketitle} occurs, the section title box will get flushed out;
+% as a result of this, one could in principle have a set of
+% \cs{sectitle} commands in a semi-fixed steering file, and inclusions
+% of files inserted only as and when papers have appeared. Only the
+% last \cs{sectitle} will actually be executed.
+%
+% \begin{macrocode}
+\newif\ifSecTitle
+\SecTitlefalse
+\newif\ifWideSecTitle
+\newcommand\sectitle{%
+ \SecTitletrue
+ \@ifstar
+ {\WideSecTitletrue\def\s@ctitle}%
+ {\WideSecTitlefalse\def\s@ctitle}%
+}
+% \end{macrocode}
+%
+% \cs{PreTitleDrop} records the amount of column-space we need to
+% eject before we start any given paper. It gets zeroed after that
+% ejection has happened.
+%
+% \begin{macrocode}
+\newdimen\PreTitleDrop \PreTitleDrop=\z@
+% \end{macrocode}
+%
+% The other parameters used in \cs{@sectitle}; I don't think there's
+% the slightest requirement for them to be registers (since they're
+% constant values, AFAIK), but converting them to macros would remove
+% the essentially useless functionality of being able to change them
+% using assignment, which I'm not about to struggle with just now...
+%
+% \cs{AboveTitleSkip} and \cs{BelowTitleSkip} are what you'ld expect;
+% \cs{strulethickness} is the value to use for \cs{fboxrule} when
+% setting the title.
+%
+% \begin{macrocode}
+\newskip\AboveTitleSkip \AboveTitleSkip=12\p@
+\newskip\BelowTitleSkip \BelowTitleSkip=8\p@
+\newdimen\strulethickness \strulethickness=.6\p@
+% \end{macrocode}
+%
+% \cs{@sectitle} actually generates the section title (in a rather
+% generous box). It gets called from \cs{maketitle} under conditional
+% \cs{ifSecTitle}; by the time \cs{@sectitle} takes control, we
+% already have \cs{SecTitlefalse}. This implementation uses \LaTeX's
+% \cs{framebox} command, on the grounds that one doesn't keep a dog
+% and bark for oneself\dots
+%
+% \begin{macrocode}
+\def\@sectitle #1{%
+ \par
+ \penalty-1000
+% \end{macrocode}
+%
+% If we're setting a wide title, the stuff will be at the top of a
+% page (let alone a column) but inside a box, so that the separator
+% won't be discardable: so don't create the separator in this case.
+%
+% \begin{macrocode}
+ \ifWideSecTitle\else\secsep\fi
+ {%
+ \fboxrule\strulethickness
+ \fboxsep\z@
+ \noindent\framebox[\hsize]{%
+ \vbox{%
+ \raggedcenter
+ \let\\\@sectitle@newline
+ \sectitlefont
+ \makestrut[2\stfontheight;\z@]%
+ #1%
+ \makestrut[\z@;\stfontheight]\endgraf
+ }%
+ }%
+ }%
+ \nobreak
+ \vskip\baselineskip
+}
+% \end{macrocode}
+%
+% \begin{macro}{\@sectitle@newline}
+% For use inside \cs{sectitle} as |\\|. Works similarly to |\\| in
+% the ``real world''~--- uses an optional argument
+% \begin{macrocode}
+\newcommand{\@sectitle@newline}[1][\z@]{%
+ \ifdim#1>\z@
+ \makestrut[\z@;#1]%
+ \fi
+ \unskip\break
+}
+% \end{macrocode}
+% \end{macro}
+%
+% We need to trigger the making of a section title in some cases where
+% we don't have a section title proper (for example, in material taken
+% over from
+%^^A \acro
+% {TTN}).
+% \begin{macrocode}
+\def\@makesectitle{\ifSecTitle
+ \global\SecTitlefalse
+ \ifWideSecTitle
+ \twocolumn[\@sectitle{\s@ctitle}]%
+ \global\WideSecTitlefalse
+ \else
+ \@sectitle{\s@ctitle}%
+ \fi
+ \else
+ \vskip\AboveTitleSkip
+ \kern\topskip
+ \hrule \@height\z@ \@depth\z@ \@width 10\p@
+ \kern-\topskip
+ \kern-\strulethickness
+ \hrule \@height\strulethickness \@depth\z@
+ \kern\medskipamount
+ \nobreak
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\@maketitle}
+% Finally, the body of \cs{maketitle} itself.
+% \begin{macrocode}
+\def\@maketitle{%
+ \@makesectitle
+ \if@articletitle{%
+ \nohyphens \interlinepenalty\@M
+ \setbox0=\hbox{%
+ \let\thanks\@gobble
+ \let\\=\quad
+ \let\and=\quad
+ \ignorespaces\@author}%
+ {%
+ \noindent\bf\raggedright\ignorespaces\@title\endgraf
+ }%
+ \ifdim \wd0 < 5\p@ % omit if author is null
+ \else
+% \end{macrocode}
+% Since we have \(\mathtt{\cs{BelowTitleSkip}} + \mathtt{4pt} =
+% \mathtt{\cs{baselineskip}}\), we say:
+% \begin{macrocode}
+ \nobreak \vskip 4\p@
+ {%
+ \leftskip=\normalparindent
+ \raggedright
+ \def\and{\unskip\\}%
+ \noindent\@author\endgraf
+ }%
+ \fi
+ \nobreak
+ \vskip\BelowTitleSkip
+ }\fi%
+ \global\@afterindentfalse
+ \aftergroup\@afterheading
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Dedications are ragged right, in italics.
+%
+% \begin{macrocode}
+%<*!latex2e>
+\def\dedication{\bgroup\raggedright\let\MF=\slMF
+ \noindent\it\ignorespaces}
+\def\enddedication{\endgraf\egroup\medskip}
+%</!latex2e>
+%<*latex2e>
+\newenvironment{dedication}%
+ {\raggedright\noindent\itshape\ignorespaces}%
+ {\endgraf\medskip}
+%</latex2e>
+% \end{macrocode}
+%
+% The |abstract| and |longabstract| environments both use
+% \cs{section*}.
+% ^^A [the following is no longer true]
+% ^^A They therefore hack at our subversion of
+% ^^A \cs{@startsection}, to avoid a confusing warning.
+%
+% \begin{macrocode}
+%<*!latex2e>
+\def\abstract{
+\section*{Abstract}
+}
+\def\endabstract{}
+%</!latex2e>
+%<*latex2e>
+\renewenvironment{abstract}%
+ {%
+ \begin{SafeSection}%
+ \section*{Abstract}%
+ }%
+ {\end{SafeSection}}
+%</latex2e>
+%<*!latex2e>
+\def\longabstract{
+ \section*{Abstract}
+ \bgroup\small}
+\def\endlongabstract{\endgraf\egroup
+%</!latex2e>
+%<*latex2e>
+\newenvironment{longabstract}%
+ {%
+ \begin{SafeSection}%
+ \section*{Abstract}%
+ \bgroup\small
+ }%
+ {%
+ \endgraf\egroup
+ \end{SafeSection}%
+%</latex2e>
+ \vspace{.25\baselineskip}
+ \begin{center}
+ {$--*--$}
+ \end{center}
+ \vspace{.5\baselineskip}}
+% \end{macrocode}
+%
+% \subsection{Headings}
+%
+% Redefine style of section headings to match \TUB{}'s defined styles.
+% |\vskip 8pt| \penalty0|\vskip\parskip| before; |\vskip 4pt| after.
+% Negative beforeskip suppresses following parindent.
+%
+% These macros are called \cs{*head} in the plain styles.
+%
+% Relaying via \cs{TB@startsection} detects inappropriate use of
+% \cs{section*}. Of course, if (when) \emph{we} use it, we need to
+% avoid that relaying; this can be done by \cs{let}ting
+% \cs{TB@startsection} to \cs{TB@safe@startsection}, within a group.
+%
+% First the version for use in the default case, when class option
+% \textsc{numbersec} is in effect.
+%
+% \begin{macrocode}
+\if@numbersec
+ \def\section{\TB@startsection{{section}%
+ 1%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsection{\TB@startsection{{subsection}%
+ 2%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsubsection{\TB@startsection{{subsubsection}%
+ 3%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\paragraph{\TB@startsection{{paragraph}%
+ 4%
+ \z@
+ {2.5ex\@plus 1ex}%
+ {-1em}%
+ {\normalsize\bf}}}
+% \end{macrocode}
+%
+% Now the version if class option \textsc{nonumber} is in effect,
+% i.e., if \cs{if@numbersec} is false.
+%
+% \begin{macrocode}
+\else
+ \setcounter{secnumdepth}{0}
+ \def\section{\TB@nolimelabel
+ \TB@startsection{{section}%
+ 1%
+ \z@
+ {-8\p@}%
+ {4\p@}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsection{\TB@nolimelabel
+ \TB@startsection{{subsection}%
+ 2%
+ \z@
+ {-8\p@}%
+ {-0.5em\@plus-\fontdimen3\font}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+ \def\subsubsection{\TB@nolimelabel
+ \TB@startsection{{subsubsection}%
+ 3%
+ \parindent
+ {-8\p@}%
+ {-0.5em\@plus-\fontdimen3\font}%
+ {\normalsize\bf\raggedright\hyphenpenalty=\@M}}}
+\fi
+% \end{macrocode}
+%
+% \cs{TB@startsection} traps \verb"*" versions of sectioning
+% commands. Its argument is the complete set of \cs{@startsection}
+% arguments.
+%
+% \begin{macrocode}
+\def\TB@startsection#1{\@ifstar
+ {\TBWarning{*-form of \expandafter\string\csname\@firstofsix#1%
+ \endcsname\space inappropriate}%
+ \@startsection#1}%
+ {\@startsection#1}}
+\def\@firstofsix#1#2#3#4#5#6{#1}
+% \end{macrocode}
+%
+% \cs{TB@safe@startsection} is to be used where \cs{section*} (etc.)\
+% appear in places where the request is OK (because it's built in to
+% some macro we don't fiddle with).
+%
+% \begin{macrocode}
+\def\TB@safe@startsection#1{\@startsection#1}
+% \end{macrocode}
+%
+% The \texttt{SafeSection} environment allows use of \texttt{*}-forms
+% of sectioning environments. It's not documented for the general
+% public: it's intended as an editor's facility.
+%
+% \begin{macrocode}
+\newenvironment{SafeSection}%
+ {\let\TB@startsection\TB@safe@startsection}%
+ {}
+% \end{macrocode}
+%
+% And now for the exciting sectioning commands that \LaTeX{} defines
+% but we don't have a definition for (whatever else, we don't want
+% Lamport's originals, which come out `like the blare of a bugle in a
+% lullaby'\footnote{Thurber, \emph{The Wonderful O}}).
+%
+% The three inappropriate ones are subparagraph (indistinguishable
+% from paragraph), and chapter and part. The last seemed almost to be
+% defined in an early version of these macros, since there was a
+% definition of \cs{l@part}. I've not got down to where that came
+% from (or why). If class option \textsc{nonumber} is in effect, we
+% also suppress \cs{paragraph}, since it has no parallel in the plain
+% style.
+%
+% \begin{macrocode}
+\if@numbersec
+ \def\subparagraph{\TB@nosection\subparagraph\paragraph}
+\else
+ \def\paragraph{\TB@nosection\paragraph\subsubsection}
+ \def\subparagraph{\TB@nosection\subparagraph\subsubsection}
+\fi
+\def\chapter{\TB@nosection\chapter\section}
+\def\part{\TB@nosection\part\section}
+\def\TB@nosection#1#2{\TBWarning{class does not support \string#1,
+ \string#2\space used instead}#2}
+% \end{macrocode}
+%
+% \cs{l@<sectioning-name>} is for table of contents (of an article).
+% Don't ask me (RF) why \cs{l@part} is there; I commented it out
+% because I couldn't understand why it had been left there for me. To
+% be finally deleted in a future release of these macros\dots
+% \begin{macrocode}
+%\def\l@part#1#2{\addpenalty{\@secpenalty}%
+% \addvspace{2.25em\@plus\p@}%
+% \begingroup
+% \@tempdima 3em \parindent\z@ \rightskip\z@ \parfillskip\z@
+% {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
+% \nobreak
+% \endgroup}
+\def\l@section#1#2{\addpenalty{\@secpenalty}%
+ \addvspace{1.0em\@plus\p@}%
+ \@tempdima 1.5em
+ \begingroup
+ \parindent\z@ \rightskip\z@ % article style makes \rightskip > 0
+ \parfillskip\z@
+ \bf\leavevmode\advance\leftskip\@tempdima\hskip-\leftskip#1\nobreak\hfil
+ \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \endgroup}
+% \end{macrocode}
+%
+% \subsection{Appendices}
+%
+% Appendices (which are really just another sort of section heading)
+% raise a problem: if the sections are unnumbered, we plainly need to
+% restore the section numbering, which in turn allows labelling of
+% section numbers again (\cs{TBnolimelabel} happens before the
+% \cs{refstepcounter}, so its effects get lost \dots~what a clever
+% piece of design that was). So here we go:
+%
+% \begin{macrocode}
+\renewcommand\appendix{\par
+ \renewcommand\thesection{\@Alph\c@section}%
+ \setcounter{section}{0}%
+ \if@numbersec
+ \else
+ \setcounter{secnumdepth}{1}%
+ \fi
+% \end{macrocode}
+%
+% Now: is this the start of an appendix environment? This can be
+% detected by looking at \cs{@currenvir}; if we are, we need to relay
+% to \cs{@appendix@env} to pick up the optional argument.
+%
+% \begin{macrocode}
+ \def\@tempa{appendix}
+ \ifx\@tempa\@currenvir
+ \expandafter\@appendix@env
+ \fi
+}
+% \end{macrocode}
+%
+% Here we deal with \cs{begin}|{appendix}|\oarg{app-name}
+%
+% \begin{macrocode}
+\newcommand\app@prefix@section{}
+\newcommand\@appendix@env[1][Appendix]{%
+ \renewcommand\@seccntformat[1]{\csname app@prefix@##1\endcsname
+ \csname the##1\endcsname\quad}%
+ \renewcommand\app@prefix@section{#1 }%
+}
+% \end{macrocode}
+%
+% Ending an appendix environment is pretty trivial\dots
+%
+% \begin{macrocode}
+\let\endappendix\relax
+% \end{macrocode}
+%
+%
+% \subsection{References}
+%
+% If the sections aren't numbered, the natural tendency of the
+% author to cross-reference (which, after all, is one of the things
+% \LaTeX{} is for ever being advertised as being good at) can cause
+% headaches for the editor. (Yes it can; believe me~\dots\ there's
+% always one.)
+%
+% The following command is used by each of the sectioning commands to
+% make a following \cs{ref} command bloop at the author. Even if the
+% author then ignores the complaint, the poor old editor may find the
+% offending \cs{label} rather more easily.
+%
+% (Note that macro name is to be read as ``\emph{noli me} label'' (I
+% don't know the medi\ae val Latin for `label').
+%
+% \begin{description}
+% \item[\emph{Comment}] To come (perhaps): detection of the act of
+% labelling, and an analogue of \cs{ifG@refundefined} for this sort of
+% label
+% \end{description}
+%
+% \begin{macrocode}
+\def\TB@nolimelabel{%
+ \def\@currentlabel{%
+ \protect\TBWarning{%
+ Invalid reference to numbered label on page \thepage
+ \MessageBreak made%
+ }%
+ \textbf{?!?}%
+ }%
+}
+% \end{macrocode}
+%
+% \subsection{Title references}
+%
+% This is a first cut at a mecahnism for referencing by the title of a
+% section; it employs the delightfully simple idea Sebastian Rahtz has
+% in the \texttt{nameref} package (which is part of
+% \texttt{hyperref}). As it stands, it lacks some of the bells and
+% whistles of the original, but they could be added; this is merely
+% proof-of-concept.
+%
+% The name label comes from the moveable bit of the section argument;
+% we subvert the \cs{@sect} and \cs{@ssect} commands (the latter
+% deals with starred section commands) to grab the relevant argument.
+% \begin{macrocode}
+\let\TB@@sect\@sect
+\let\TB@@ssect\@ssect
+\def\@sect#1#2#3#4#5#6[#7]#8{%
+ \def\@currentlabelname{#7}%
+ \TB@@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
+}
+\def\@ssect#1#2#3#4#5{%
+ \def\@currentlabelname{#5}%
+ \TB@@ssect{#1}{#2}{#3}{#4}{#5}%
+}
+% \end{macrocode}
+%
+% The \cs{newlabel} command that gets written to the \texttt{.aux}
+% file needs to be redefined to have three components to its argument:
+% \begin{macrocode}
+\def\label#1{{%
+ \@bsphack
+ \let\label\@gobble
+ \let\index\@gobble
+ \if@filesw
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{%
+ {\@currentlabel}{\thepage}{\@currentlabelname}}%
+ }%
+ \fi
+ \@esphack
+ }%
+}
+% \end{macrocode}
+%
+% Of course, in the case of a sufficiently mad author, there will be
+% no sectioning commands, so we need to
+% \begin{macrocode}
+\let\@currentlabelname\@empty
+% \end{macrocode}
+%
+% References are pretty straightforward, but need three extra utility
+% commands (analagous to the \cs{@firstof...}, etc., defined in the
+% kernel).
+% \begin{macrocode}
+\DeclareRobustCommand\ref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@firstofthree{#1}}
+\DeclareRobustCommand\pageref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@secondofthree{#1}}
+\DeclareRobustCommand\nameref[1]{\expandafter\@setref
+ \csname r@#1\endcsname\@thirdofthree{#1}}
+\long\def\@firstofthree#1#2#3{#1}
+\long\def\@secondofthree#1#2#3{#2}
+\long\def\@thirdofthree#1#2#3{#3}
+% \end{macrocode}
+%
+% \subsection{Float captions}
+%
+% By analogy with what we've just done to section titles and the like,
+% we now do our best to discourage hyphenation within captions.
+%
+% \begin{macrocode}
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{#1: #2}%
+ \ifdim \wd\@tempboxa >\hsize
+ \raggedright\hyphenpenalty=\@M
+ #1: #2\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+% \end{macrocode}
+%
+% \subsection{Size changing commands}
+%
+% Apart from their `normal' effects, these commands are
+% \begin{macrocode}
+\renewcommand\normalsize{%
+ \@setfontsize\normalsize\@xpt\@xiipt
+ \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 3\p@
+ \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
+}
+
+\renewcommand\small{%
+ \@setfontsize\small\@ixpt{11}%
+ \abovedisplayskip=2.5\p@\@plus 2.5\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 2\p@
+ \belowdisplayshortskip=\p@\@plus 2\p@\@minus\p@
+}
+\renewcommand\footnotesize{%
+ \@setfontsize\footnotesize\@viiipt{9.5}%
+ \abovedisplayskip=3\p@\@plus 3\p@\@minus\p@
+ \belowdisplayskip=\abovedisplayskip
+ \abovedisplayshortskip=\z@\@plus 3\p@
+ \belowdisplayshortskip=\p@\@plus 3\p@\@minus\p@
+}
+% \end{macrocode}
+%
+% \subsection{Lists and other text inclusions}
+%
+% \begin{macrocode}
+\def\@listi{%
+ \leftmargin\leftmargini\parsep=\p@\@plus\p@\@minus\p@
+ \itemsep=\parsep
+ \listparindent=1em
+ }
+
+\def\@listii{%
+ \leftmargin\leftmarginii
+ \labelwidth=\leftmarginii \advance\labelwidth-\labelsep
+ \topsep=2\p@\@plus\p@\@minus\p@
+ \parsep=\p@\@plus\p@\@minus\p@
+ \itemsep=\parsep
+ \listparindent=1em
+ }
+
+\def\@listiii{%
+ \leftmargin=\leftmarginiii
+ \labelwidth=\leftmarginiii \advance\labelwidth-\labelsep
+ \topsep=\p@\@plus\p@\@minus\p@
+ \parsep=\z@
+ \itemsep=\topsep
+ \listparindent=1em
+ }
+\def\quote{\list{}{\rightmargin.5\leftmargin}\item[]}
+% \end{macrocode}
+% From Dominik Wujastyk's font article. First paragraph of a quotation
+% will not be indented, and right margin is decreased for narrow columns.
+% \begin{macrocode}
+\renewcommand{\quotation}{\list{}{\listparindent 1.5em
+ \rightmargin.5\leftmargin\parsep \z@\@plus\p@}\item[]}
+% \end{macrocode}
+%
+% \subsection{Some fun with \texttt{verbatim}}
+%
+% The |plain| \TUB{} style allows \verb|[optional]| arguments to its
+% \cs{verbatim} command. This will allow the author (or editor) to
+% specify a range of exciting features; we would definitely like the
+% numbered verbatim style for code (that facility is reserved for a
+% future version of this package), and the present little bit of code
+% imposes the \cs{ruled} option on the built-in \textsf{verbatim}
+% environment. (Note that we don't yet deal with
+% \textsf{verbatim}$*$, which is in itself an option to the |plain|
+% original.)
+%
+% We start by saving various bits and bobs whose operation we're going
+% to subvert.
+%
+% \begin{macrocode}
+%\let\@TB@verbatim\@verbatim
+\let\@TBverbatim\verbatim
+\let\@TBendverbatim\endverbatim
+% \end{macrocode}
+%
+% Impose an optional argument on the environment.
+%
+% (\cs{obeylines} added to prevent the \cs{futurelet} from propagating
+% into the body of the verbatim, thus causing lines that start with
+% odd characters (like |#| or even |\|) to behave peculiarly.)
+% \begin{macrocode}
+\def\verbatim{\obeylines
+ \futurelet\reserved@a\@switch@sqbverbatim}
+\def\@switch@sqbverbatim{\ifx\reserved@a[%]
+ \expandafter\@sqbverbatim\else
+ \def\reserved@b{\@sqbverbatim[]}\expandafter\reserved@b\fi}
+\def\@sqbverbatim[#1]{%
+% \end{macrocode}
+%
+% The optional argument consists entirely of functions that modify the
+% appearance of the environment. Following the |plain| style, we
+% define the functions we can execute in the optional argument here.
+%
+% The command \cs{ruled} tells us that there should be rules above and
+% below the verbatim block.
+%
+% \begin{macrocode}
+ \def\ruled{\let\if@ruled\iftrue}%
+% \end{macrocode}
+%
+% Then we just execute the ones we've got, and relay to a (hacked)
+% copy of the built-in environment.
+%
+% \begin{macrocode}
+ #1\@TBverbatim}
+% \end{macrocode}
+%
+% The built-in environment itself relays to \cs{@verbatim}, which
+% we've subverted to impose our views on appearance.
+%
+% \begin{macrocode}
+\def\@verbatim{%
+% \end{macrocode}
+%
+% First, we deal with \cs{ruled}:
+%
+% \begin{macrocode}
+ \if@ruled\trivlist\item\hrule\kern5\p@\nobreak\fi
+% \end{macrocode}
+%
+% Now, the code out of the original \textsf{verbatim} environment:
+%
+% \begin{macrocode}
+ \trivlist \item\relax
+ \if@minipage\else\vskip\parskip\fi
+ \leftskip\@totalleftmargin\rightskip\z@skip
+ \parindent\z@\parfillskip\@flushglue\parskip\z@skip
+ \@@par
+ \@tempswafalse
+ \def\par{%
+ \if@tempswa
+ \leavevmode \null \@@par\penalty\interlinepenalty
+ \else
+ \@tempswatrue
+ \ifhmode\@@par\penalty\interlinepenalty\fi
+ \fi}%
+ \obeylines \verbatim@font \@noligs
+ \let\do\@makeother \dospecials
+ \everypar \expandafter{\the\everypar \unpenalty}%
+}%
+% \end{macrocode}
+%
+% To end the environment, we do everything in reverse order: relay via
+% the copy we made of \cs{endveratim}, and then finish off the option
+% changes (again \cs{ruled} only, so far).
+%
+% \begin{macrocode}
+\def\endverbatim{\@TBendverbatim
+ \if@ruled\kern5\p@\hrule\endtrivlist\fi}
+% \end{macrocode}
+%
+% \cs{enablemetacode} simply typesets\footnote{Or will simply typeset,
+% when we get around to implementation proper} something that looks
+% (verbatim) like:
+%
+% \verb| <meta-text>|
+%
+% \noindent as:
+%
+% \verb| |\ensuremath{\langle}\textit{meta-text}\ensuremath{\rangle}
+%
+% \begin{macrocode}
+{\makeactive<
+ \gdef<#1>{{\reset@font\ensuremath{\langle}%
+ \textit{#1}%
+ \ensuremath{\rangle}}}
+}
+% \end{macrocode}
+%
+% Finally, we define the \cs{if} used by the \cs{ruled} option
+%
+% \begin{macrocode}
+\let\if@ruled\iffalse
+% \end{macrocode}
+%
+% \subsection{Bibliography}
+% \label{sec:citations}
+% This is more or less copied verbatim from Glenn Paulley's
+% \emph{chicago.sty} (\texttt{gnpaulle@\penalty0 bluebox.\penalty0
+% uwaterloo.\penalty0 ca}).
+% It produces an author-year citation style bibliography, using
+% output from the \BibTeX\ style file based on that by
+% Patrick Daly. It needs extra macros beyond those in standard
+% \LaTeX\ to function properly.
+% The form of the bibitem entries is:
+% \begin{verbatim}
+% \bibitem[\protect\citeauthoryear{Jones, Baker, and Smith}
+% {Jones et al.}{1990}{key}...
+% \end{verbatim}
+% The available citation commands are:
+%
+% \begin{tabular}{ll}
+% \verb|\cite{key}| & $\rightarrow$ (Jones, Baker, and Smith 1990)\\
+% \verb|\citeA{key}| & $\rightarrow$ (Jones, Baker, and Smith)\\
+% \verb|\citeNP{key}| & $\rightarrow$ Jones, Baker, and Smith 1990\\
+% \verb|\citeANP{key}| & $\rightarrow$ Jones, Baker, and Smith\\
+% \verb|\citeN{key}| & $\rightarrow$ Jones, Baker, and Smith (1990)\\
+% \verb|\shortcite| & $\rightarrow$ (Jones et al.~1990)\\
+% \verb|\citeyear| & $\rightarrow$ (1990)\\
+% \verb|\citeyearNP| & $\rightarrow$ 1990\\
+% \end{tabular}
+%
+% First of all (after checking that we're to use Harvard citation at
+% all), make a copy of \LaTeX's default citation mechanism.
+%
+% \begin{macrocode}
+\if@Harvardcite
+\let\@internalcite\cite
+% \end{macrocode}
+% Normal forms.
+% \begin{macrocode}
+\def\cite{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
+\def\citeNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
+\def\citeN{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
+ \def\citeauthoryear##1##2##3{##1 (##3}\@citedata}
+\def\citeA{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##1}\@internalcite}
+\def\citeANP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##1}\@internalcite}
+% \end{macrocode}
+% Abbreviated forms (using \emph{et al.})
+% \begin{macrocode}
+\def\shortcite{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
+\def\shortciteNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
+\def\shortciteN{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2)\else{)}\fi}%
+ \def\citeauthoryear##1##2##3{##2 (##3}\@citedata}
+\def\shortciteA{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
+\def\shortciteANP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
+% \end{macrocode}
+% When just the year is needed:
+% \begin{macrocode}
+\def\citeyear{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
+ \def\citeauthoryear##1##2##3{##3}\@citedata}
+\def\citeyearNP{\def\@citeseppen{-1000}%
+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
+ \def\citeauthoryear##1##2##3{##3}\@citedata}
+% \end{macrocode}
+% Place commas in-between citations in the same |\citeyear|, |\citeyearNP|,
+% |\citeN|, or |\shortciteN| command.
+% Use something like |\citeN{ref1,ref2,ref3}| and |\citeN{ref4}| for a list.
+%
+% \begin{macrocode}
+\def\@citedata{%
+ \@ifnextchar [{\@tempswatrue\@citedatax}%
+ {\@tempswafalse\@citedatax[]}%
+}
+
+\def\@citedatax[#1]#2{%
+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
+ {\@citea\def\@citea{, }\@ifundefined% by Young
+ {b@\@citeb}{{\bf ?}%
+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
+{\csname b@\@citeb\endcsname}}}{#1}}%
+% \end{macrocode}
+% Don't box citations, separate with ; and a space;
+% Make the penalty between citations negative: a good place to break.
+% \begin{macrocode}
+\def\@citex[#1]#2{%
+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
+ {\@citea\def\@citea{; }\@ifundefined% by Young
+ {b@\@citeb}{{\bf ?}%
+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
+{\csname b@\@citeb\endcsname}}}{#1}}%
+% \end{macrocode}
+% No labels in the bibliography.
+% \begin{macrocode}
+\def\@biblabel#1{}
+% \end{macrocode}
+% Set length of hanging indentation for bibliography entries.
+% \begin{macrocode}
+\newlength{\bibhang}
+\setlength{\bibhang}{2em}
+% \end{macrocode}
+% Indent second and subsequent lines of bibliographic entries. Stolen
+% from openbib.sty: |\newblock| is set to |{}|.
+% \begin{macrocode}
+\newdimen\bibindent
+\bibindent=1.5em
+\@ifundefined{refname}%
+ {\newcommand{\refname}{References}}%
+ {}%
+% \end{macrocode}
+%
+% For safety's sake, suppress the \cs{TB@startsection} warnings
+% here\dots
+%
+% \begin{macrocode}
+\def\thebibliography#1{%
+ \let\TB@startsection\TB@safe@startsection
+ \section*{\refname
+ \@mkboth{\uppercase{\refname}}{\uppercase{\refname}}}%
+ \list{[\arabic{enumi}]}{%
+ \labelwidth\z@ \labelsep\z@
+ \leftmargin\bibindent
+ \itemindent -\bibindent
+ \listparindent \itemindent
+ \parsep \z@
+ \usecounter{enumi}}
+ \def\newblock{}
+ \BibJustification
+ \sfcode`\.=1000\relax
+}
+% \end{macrocode}
+%
+% \begin{macro}{etal}
+% \begin{macro}{\bibentry}
+% Other bibliography odds and ends.
+% \begin{macrocode}
+\def\etal{et\,al.\@}
+\def\bibentry{%
+ \smallskip
+ \hangindent=\parindent
+ \hangafter=1
+ \noindent
+ \sloppy
+ \clubpenalty500 \widowpenalty500
+ \frenchspacing
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\bibliography}
+% \begin{macro}{\bibliographystyle}
+% Changes made to accommodate TUB file naming conventions
+% \begin{macrocode}
+\def\bibliography#1{%
+ \if@filesw
+ \immediate\write\@auxout{\string\bibdata{\@tubfilename{#1}}}%
+ \fi
+ \@input{\jobname.bbl}%
+}
+\def\bibliographystyle#1{%
+ \if@filesw
+ \immediate\write\@auxout{\string\bibstyle{\@tubfilename{#1}}}%
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\thebibliography}
+% \begin{macro}{\TB@@thebibliography}
+% If the user's asked to use \LaTeX's default citation mechanism
+% (using the |rawcite| option), we still need to play with
+% \cs{TB@startsection}: this is a boring fact of life\dots
+%
+% We also patch \cs{sloppy} in case there's a need for alternative
+% justification of the body of the bibliography.
+% \begin{macrocode}
+\else
+\let\TB@@thebibliography\thebibliography
+\def\thebibliography{%
+ \let\TB@startsection\TB@safe@startsection
+ \let\sloppy\BibJustification
+ \TB@@thebibliography}
+\fi
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\BibJustification}
+% \begin{macro}{\SetBibJustification}
+% \begin{macro}{\TB@@sloppy}
+% \cs{BibJustification} defines how the bibliography is to be
+% justified. The Lamport default is simply ``\cs{sloppy}'', but we
+% regularly find some sort of ragged right setting is appropriate.
+% (\cs{BibJustification} is nevertheless reset to its default value at
+% the start of a paper.)
+% \begin{macrocode}
+\let\TB@@sloppy\sloppy
+\let\BibJustification\TB@@sloppy
+\newcommand{\SetBibJustification}[1]{%
+ \renewcommand{\BibJustification}{#1}%
+}
+\ResetCommands\expandafter{\the\ResetCommands
+ \let\BibJustification\TB@@sloppy
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Registration marks}
+%
+% \begin{macrocode}
+\def\HorzR@gisterRule{\vrule \@height 0.2\p@ \@depth\z@ \@width 0.5in }
+\def\DownShortR@gisterRule{\vrule \@height 0.2\p@ \@depth 1pc \@width 0.2\p@ }
+\def\UpShortR@gisterRule{\vrule \@height 1pc \@depth\z@ \@width 0.2\p@ }
+% \end{macrocode}
+%
+% ``T'' marks centered on top and bottom edges of paper
+%
+% \begin{macrocode}
+\def\ttopregister{\dlap{%
+ \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
+ \HorzR@gisterRule \hfil \HorzR@gisterRule}%
+ \hb@xt@\trimwd{\hfil \DownShortR@gisterRule \hfil}}}
+\def\tbotregister{\ulap{%
+ \hb@xt@\trimwd{\hfil \UpShortR@gisterRule \hfil}%
+ \hb@xt@\trimwd{\HorzR@gisterRule \hfil \HorzR@gisterRule
+ \HorzR@gisterRule \hfil \HorzR@gisterRule}}}
+\def\topregister{\ttopregister}
+\def\botregister{\tbotregister}
+% \end{macrocode}
+%
+% \subsection{Running heads}
+%
+% \begin{macrocode}
+%<!latex2e>\def \rtitlex{\def\tubfont{\normalsize\rm}\TUB, \volx }
+%<latex2e>\def \rtitlex{\def\texttub##1{{\normalsize\textrm{##1}}}\TUB, \volx }
+
+\def\PrelimDraftfooter{%
+ \dlap{\kern\textheight\kern3pc
+ \rlap{\hb@xt@\pagewd{\midrtitle\hfil\midrtitle}}
+ }}
+
+% \end{macrocode}
+% registration marks; these are temporarily inserted in the running head
+% \begin{macrocode}
+\def\MakeRegistrationMarks{}
+\def\UseTrimMarks{%
+ \def\MakeRegistrationMarks{%
+ \ulap{\rlap{%
+ \vbox{\dlap{\vbox to\trimlgt{\vfil\botregister}}%
+ \topregister\vskip \headmargin \vskip 10\p@}}}}%
+ }
+
+\def\@oddhead{\MakeRegistrationMarks\PrelimDraftfooter
+ \normalsize\csname normalshape\endcsname\rm
+ \rtitlex\qquad\midrtitle \hfil \thepage}
+\def\@evenhead{\MakeRegistrationMarks\PrelimDraftfooter
+ \normalsize\csname normalshape\endcsname\rm
+ \thepage\hfil\midrtitle\qquad\rtitlex}
+\def\@oddfoot{}
+\def\@evenfoot{}
+\def\ps@headings{}
+\pagestyle{headings}
+% \end{macrocode}
+% \subsection{Output routine}
+% Modified to alter |\brokenpenalty| across columns
+%
+% \begin{description}
+% \item[\emph{Comment}] We're playing with fire here: for example,
+% \cs{@outputdblcol} has changed in \LaTeXe{} for 1995/06/01 (with the
+% use of \cs{hb@xt@}). \emph{This} time there's no semantic change,
+% but\dots
+% \end{description}
+% \begin{macrocode}
+\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
+ \global\setbox\@leftcolumn\box\@outputbox
+ \global\brokenpenalty10000
+ \else \global\@firstcolumntrue
+ \global\brokenpenalty100
+ \setbox\@outputbox\vbox{\hb@xt@\textwidth{\hb@xt@\columnwidth
+ {\box\@leftcolumn \hss}\hfil \vrule \@width\columnseprule\hfil
+ \hb@xt@\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
+ \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
+ \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
+ \fi}
+% \end{macrocode}
+%
+% \subsection{Font-related definitions and machinery}
+% These are mostly for compatibility with plain |tugboat.sty|
+% \begin{macrocode}
+\newif\ifFirstPar \FirstParfalse
+\def\smc{\sc}
+\def\ninepoint{\small}
+% \end{macrocode}
+%
+% \cs{SMC} \emph{isn't} small caps~--- Barbara Beeton says she thinks
+% of it as ``big small caps''. She says (modulo capitalisation of
+% things\dots):
+% \begin{quote}
+% For the things it's used for, regular small caps are not
+% appropriate~--- they're too small. Real small caps are
+% appropriate for author names (and are so used in continental
+% bibliographies), section headings, running heads, and, on
+% occasion, words to which some emphasis is to be given. \cs{SMC}
+% was designed to be used for acronyms and all-caps abbreviations,
+% which look terrible in small caps, but nearly as bad in all caps
+% in the regular text size. The principle of using ``one size
+% smaller'' than the text size is similar to the design of caps in
+% German~--- where they are smaller relative to lowercase than are
+% caps in fonts intended for English, to improve the appearance of
+% regular text in which caps are used at the heads of all nouns, not
+% just at the beginnings of sentences.
+% \end{quote}
+%
+% We define this in terms of the memory of the size currently selected
+% that's maintained in \cs{@currsize}: if the user does something
+% silly re.~selecting fonts, we'll get the wrong results. The
+% following code is adapted from |relsize.sty| by Donald Arseneau and
+% Matt Swift, from a 2.09 original by Bernie Cosell. (Note that the
+% order of examination of \cs{@currsize} is to get the commonest cases
+% out of the way first.)
+% \begin{macrocode}
+%<!latex2e>\def\SMC{\small}
+%<*latex>
+%<*latex2e>
+\DeclareRobustCommand\SMC{%
+ \ifx\@currsize\normalsize\small\else
+ \ifx\@currsize\small\footnotesize\else
+ \ifx\@currsize\footnotesize\scriptsize\else
+ \ifx\@currsize\large\normalsize\else
+ \ifx\@currsize\Large\large\else
+ \ifx\@currsize\LARGE\Large\else
+ \ifx\@currsize\scriptsize\tiny\else
+ \ifx\@currsize\tiny\tiny\else
+ \ifx\@currsize\huge\LARGE\else
+ \ifx\@currsize\Huge\huge\else
+ \small\SMC@unknown@warning
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+}
+\newcommand\SMC@unknown@warning{\TBWarning{\string\SMC: unrecognised
+ text font size command -- using \string\small}}
+\newcommand\textSMC[1]{{\SMC #1}}
+% \end{macrocode}
+%
+% The \cs{acro} command uses \cs{SMC} as it was originally intended.
+% Note that, since most of these things are uppercase-only names, it
+% fiddles with the spacefactor after inserting its text.
+%
+% \begin{macrocode}
+\newcommand\acro[1]{\textSMC{#1}\@}
+%</latex2e>
+%<!latex2e>\def\acro#1{{\SMC #1}\@}
+%</latex>
+%<!latex>\def\acro#1{{\SMC #1}\spacefactor\@m}
+% \end{macrocode}
+%
+% \subsection{Miscellaneous definitions}
+%
+% \cs{EdNote} allows the editor to enter notes in the text of a paper.
+% If the command is given something that appears like an optional
+% argument, the entire text of the note is placed in square brackets.
+% (Yes, it really is!)
+%
+% \begin{macrocode}
+\def\xEdNote{{\EdNoteFont Editor's note:\enspace }}
+\def \EdNote{\@ifnextchar[%]
+ {%
+ \ifvmode
+ \smallskip\noindent\let\@EdNote@\@EdNote@v
+ \else
+ \unskip\quad\def\@EdNote@{\unskip\quad}%
+ \fi
+ \@EdNote
+ }%
+ \xEdNote
+}
+\long\def\@EdNote[#1]{%
+ [\thinspace\xEdNote\ignorespaces
+ #1%
+ \unskip\thinspace]%
+ \@EdNote@
+}
+\def\@EdNote@v{\par\smallskip}
+% \end{macrocode}
+% Macros for Mittelbach's self-documenting style
+% \begin{macrocode}
+\def\SelfDocumenting{%
+ \setlength\textwidth{31pc}
+ \onecolumn
+ \parindent \z@
+ \parskip 2\p@\@plus\p@\@minus\p@
+ \oddsidemargin 8pc
+ \evensidemargin 8pc
+ \marginparwidth 8pc
+ \toks@\expandafter{\@oddhead}%
+ \xdef\@oddhead{\hss\hb@xt@\pagewd{\the\toks@}}%
+ \toks@\expandafter{\@evenhead}%
+ \xdef\@evenhead{\hss\hb@xt@\pagewd{\the\toks@}}%
+ \def\ps@titlepage{}%
+}
+\def\ps@titlepage{}
+
+\long\def\@makefntext#1{\parindent 1em\noindent\hb@xt@2em{}%
+ \llap{\@makefnmark}\null$\mskip5mu$#1}
+
+%% \long\def\@makefntext#1{\parindent 1em
+%% \noindent
+%% \hb@xt@2em{\hss\@makefnmark}%
+%% \hskip0.27778\fontdimen6\textfont\z@\relax
+%% #1%
+%% }
+
+
+\def\fnum@figure{{\bf Figure \thefigure}}
+% \end{macrocode}
+%
+% \subsection{Initialization}
+%
+% If we're going to use Harvard-style bibliographies, we set up the
+% bibliography style: the user doesn't get any choice.
+%
+% \begin{macrocode}
+\if@Harvardcite
+ \AtBeginDocument{%
+ \bibliographystyle{ltugbib}%
+ }
+\fi
+\authornumber\z@
+\let\@signature\@defaultsignature
+\InputIfFileExists{ltugboat.cfg}{\TBInfo{Loading ltugboat
+ configuration information}}{}
+%</classtail>
+% \end{macrocode}
+%
+% \section{\protect\LaTeXe\ Proceedings class}
+%
+% \begin{macro}{\@tugclass}
+% Make the code of |ltugboat.cls| (when we load it) say it's really
+% us:
+%
+% \begin{macrocode}
+%<*ltugproccls>
+\def\@tugclass{ltugproc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@proctw@column}
+% For the case where we're preparing the preprints, we may not have
+% been able to prepare submissions for typesetting in two columns. In
+% this case, therefore, we may need the option |onecolumn|, that will
+% suppress the use of twocolumn setting within the article.
+%
+% \begin{macrocode}
+\newif\if@proctw@column \@proctw@columntrue
+\DeclareOption{onecolumn}{\@proctw@columnfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\if@proc@sober}
+% \begin{macro}{\if@proc@numerable}
+% ^^A\acro
+% {TUG}'96 proceedings switched to more sober headings still; so
+% the \textsf{tug95} option establishes the original state. In the
+% absence of any other guidance, we use the '96 for
+% ^^A\acro
+% {TUG}'97 proceedings, but also allow numbering of sections.
+%
+% \begin{macrocode}
+\newif\if@proc@sober
+\newif\if@proc@numerable
+\DeclareOption{tug95}{%
+ \@proc@soberfalse
+ \@proc@numerablefalse
+}
+\DeclareOption{tug96}{%
+ \@proc@sobertrue
+ \@proc@numerablefalse
+}
+\DeclareOption{tug97}{%
+ \@proc@sobertrue
+ \@proc@numerabletrue
+}
+\DeclareOption{tug2002}{%
+ \@proc@sobertrue
+ \@proc@numerabletrue
+ \let\if@proc@numbersec\iftrue
+ \PassOptionsToClass{numbersec}{ltugboat}%
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if@proc@numbersec}
+% If we're in a class that allows section numbering (the actual check
+% occurs after \cs{ProcessOptions}, we can have the
+% following:
+% \begin{macrocode}
+\DeclareOption{numbersec}{\let\if@proc@numbersec\iftrue
+ \PassOptionsToClass{numbersec}{ltugboat}%
+}
+\DeclareOption{nonumber}{\let\if@proc@numbersec\iffalse
+ \PassOptionsToClass{nonumber}{ltugboat}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifTB@title}
+% If we have a paper for which we want to create a detached title,
+% with an editor's note, and then set the paper separately, we use
+% option notitle.
+% \begin{macrocode}
+\newif\ifTB@title
+\DeclareOption{title}{\TB@titletrue}
+\DeclareOption{notitle}{\TB@titlefalse
+ \AtBeginDocument{\stepcounter{page}}}
+% \end{macrocode}
+% \end{macro}
+%
+% There are these people who seem to think |tugproc| is an option as
+% well as a class\dots
+%
+% \begin{macrocode}
+\DeclareOption{tugproc}{%
+ \ClassWarning{\@tugclass}{Option \CurrentOption\space ignored}%
+}
+% \end{macrocode}
+%
+% All other options are simply passed to |ltugboat|\dots
+%
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{ltugboat}}
+% \end{macrocode}
+%
+% If there's a \textsf{tugproc} defaults file, input it now: it may
+% tell us which year we're to perform for\dots (Note: this code
+% \emph{is} millenium-proof. It's not terribly classy for years
+% beyond 2069, but then I'm not going to be around then---this will be
+% an interesting task for a future \TeX{}ie\dots)
+%
+% \begin{macrocode}
+\InputIfFileExists{\@tugclass.cfg}{\ClassInfo{ltugproc}%
+ {Loading ltugproc configuration information}}{}
+\@ifundefined{TUGprocExtraOptions}%
+ {\let\TUGprocExtraOptions\@empty}%
+ {\edef\TUGprocExtraOptions{,\TUGprocExtraOptions}}
+% \end{macrocode}
+%
+% \begin{macro}{\tugProcYear}
+% Now work out what year it is
+% \begin{macrocode}
+\@tempcnta\year
+\ifnum\@tempcnta<2000
+ \divide\@tempcnta by100
+ \multiply\@tempcnta by100
+ \advance\@tempcnta-\year
+ \@tempcnta-\@tempcnta
+\fi
+% \end{macrocode}
+%
+% And use that for calculating a year for us to use.
+%
+% \begin{macrocode}
+\edef\@tempa{\noexpand\providecommand\noexpand\tugProcYear
+ {\ifnum10>\@tempcnta0\fi\the\@tempcnta}}
+\@tempa
+\ClassInfo{ltugproc}{Class believes year is
+ \expandafter\ifnum\tugProcYear<2000 19\fi\tugProcYear
+ \@gobble}
+% \end{macrocode}
+%
+% Check that this is a ``sensible year'' (one for which we have a
+% class option defined). If not, make it the `most recent year we
+% know about'.
+% \begin{macrocode}
+\expandafter\ifx\csname ds@tug\tugProcYear\endcsname\relax
+ \def\tugProcYear{2002}\fi
+% \end{macrocode}
+% \end{macro}
+%
+% Now execute the default `year' option, and the default
+% \textsf{nonumber} option and get on with processing. Note that this
+% command gets ignored if the configuration file specifies a silly year.
+%
+% \begin{macrocode}
+\ExecuteOptions{nonumber,tug\tugProcYear,title\TUGprocExtraOptions}
+\ProcessOptions
+\if@proc@numbersec
+ \if@proc@numerable
+ \else
+ \ClassWarning{\@tugclass}{This year's proceedings may not have
+ numbered sections}%
+ \fi
+\fi
+% \end{macrocode}
+%
+% Call \textsf{ltugboat}, adding whichever section numbering option is
+% appropriate
+% \begin{macrocode}
+\LoadClass[\if@proc@numbersec numbersec\else nonumber\fi]{ltugboat}
+% \end{macrocode}
+%
+% \subsection{Proceedings titles}
+%
+% \begin{macro}{\maketitle}
+% \begin{macro}{\ifTB@madetitle}
+% There's no provision for `section titles' in proceedings issues, as
+% there are in \TUB{} proper. Note the tedious \LaTeX{} bug-avoidance
+% in the \cs{@TB@test@document} macro
+%
+% \begin{macrocode}
+\def\maketitle{%
+ \begingroup
+% \end{macrocode}
+%
+% first, a bit of flim-flam to generate an initial value for
+% \cs{rhAuthor} (unless the user's already given one with a
+% \cs{shortAuthor} comand).
+% \begin{macrocode}
+ \ifshortAuthor\else
+ \global\let\rhAuthor\@empty
+ \def\g@addto@rhAuthor##1{%
+ \begingroup
+ \toks@\expandafter{\rhAuthor}%
+ \let\thanks\@gobble
+ \protected@xdef\rhAuthor{\the\toks@##1}%
+ \endgroup
+ }%
+ \@getauthorlist\g@addto@rhAuthor
+ \fi
+% \end{macrocode}
+%
+% now, the real business of setting the title
+% \begin{macrocode}
+ \ifTB@title
+ \setcounter{footnote}{0}%
+ \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+ \if@proctw@column
+ \twocolumn[\@maketitle]%
+ \else
+ \onecolumn
+ \global\@topnum\z@
+ \@maketitle
+ \fi
+ \@thanks
+ \thispagestyle{TBproctitle}
+ \fi
+ \endgroup
+ \TB@madetitletrue
+}
+\newif\ifTB@madetitle \TB@madetitlefalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@TB@test@document}
+% \cs{@TB@test@document} checks to see, at entry to \cs{maketitle}, if
+% we've had \verb:\begin{document}:. See \LaTeX{} bug report latex/2212,
+% submitted by Robin Fairbairns, for details.
+%
+% \begin{macrocode}
+\def\@TB@test@document{%
+ \edef\@tempa{\the\everypar}
+ \def \@tempb{\@nodocument}
+ \ifx \@tempa\@tempb
+ \@nodocument
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AUTHORfont}
+% \begin{macro}{\TITLEfont}
+% \begin{macro}{\addressfont}
+% \begin{macro}{\netaddrfont}
+% Define the fonts for titles and things
+%
+% \begin{macrocode}
+\def\AUTHORfont {\large\rmfamily\mdseries\upshape}
+\def\TITLEfont {\Large\rmfamily\mdseries\upshape}
+\def\addressfont{\small\rmfamily\mdseries\upshape}
+\def\netaddrfont{\small\ttfamily\mdseries\upshape}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@maketitle}
+% The body of \cs{maketitle}
+%
+% \begin{macrocode}
+\def\@maketitle{%
+ {\parskip\z@
+ \TITLEfont\raggedright\noindent\@title\par
+ \count@=0
+ \loop
+ \ifnum\count@<\authornumber
+ \vskip20\p@
+ \advance\count@\@ne
+ {\AUTHORfont\theauthor{\number\count@}\endgraf}%
+ \addressfont\theaddress{\number\count@}\endgraf
+ {%
+ \allowhyphens
+ \hangindent1.5pc
+ \netaddrfont\thenetaddress{\number\count@}\endgraf
+ \hangindent1.5pc
+ \thePersonalURL{\number\count@}\endgraf
+ }%
+ \repeat
+ \vskip20\p@}%
+ \if@abstract
+ \centerline{\bfseries Abstract}%
+ \vskip.5\baselineskip\rmfamily
+ \list{}{\listparindent20\p@
+ \itemindent\z@ \leftmargin4.875pc
+ \rightmargin\leftmargin \parsep \z@}\item[]\ignorespaces
+ \the\abstract@toks
+ \endlist\global\@ignoretrue
+ \fi
+ \vskip1pc
+ \global\@afterindentfalse\aftergroup\@afterheading
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{description}
+% \item[\emph{Comment}] This is all very weird\dots why we (of all
+% people) don't allow \cs{thanks} currently escapes me.
+% \end{description}
+%
+% This restriction simply removed 1998/01/09
+%
+% \begin{macrocode}
+%\def\thanks#1{\@bsphack\TBWarning{\string\thanks\space
+% is not supported}\@esphack}
+% \end{macrocode}
+%
+% \begin{environment}{abstract}
+% \begin{macro}{\if@abstract}
+% \begin{macro}{\abstract@toks}
+% Save the contents of the abstract environment in the token register
+% \cs{abstract@toks}. We need to do this, as otherwise it may get
+% `typeset' (previously, it got put in a box) before
+% |\begin{document}|, and experiments prove that this means our shiny
+% new \cs{SMC} doesn't work in this situation.
+%
+% If you need to understand the ins and outs of this code, look at the
+% place I lifted it from: |tabularx.dtx| (in the tools
+% bundle). The whole thing pivots on having stored the name of the
+% `abstract' environment in \cs{@abstract@}
+%
+% \begin{macrocode}
+\newtoks\abstract@toks \abstract@toks{}
+\let\if@abstract\iffalse
+\def\abstract{%
+% \end{macrocode}
+%
+% we now warn unsuspecting users who provide an \texttt{abstract}
+% environment \emph{after} the \cs{maketitle} that would typeset it\dots
+% \begin{macrocode}
+ \ifTB@madetitle
+ \TBWarning{abstract environment after \string\maketitle}
+ \fi
+ \def\@abstract@{abstract}%
+ \ifx\@currenvir\@abstract@
+ \else
+ \TBError{\string\abstract\space is illegal:%
+ \MessageBreak
+ use \string\begin{\@abstract@} instead}%
+ {\@abstract@\space may only be used as an environment}
+ \fi
+ \global\let\if@abstract\iftrue
+ {\ifnum0=`}\fi
+ \@abstract@getbody}
+\let\endabstract\relax
+% \end{macrocode}
+%
+% \cs{@abstract@getbody} gets chunks of the body (up to the next
+% occurrence of \cs{end}) and appends them to \cs{abstract@toks}. It
+% then uses \cs{@abstract@findend} to detect whether this \cs{end} is
+% followed by \verb|{abstract}|
+%
+% \begin{macrocode}
+\long\def\@abstract@getbody#1\end{%
+ \global\abstract@toks\expandafter{\the\abstract@toks#1}%
+ \@abstract@findend}
+% \end{macrocode}
+%
+% Here we've got to \cs{end} in the body of the abstract.
+% \cs{@abstract@findend} takes the `argument' of the \cs{end} do its
+% argument.
+%
+% \begin{macrocode}
+\def\@abstract@findend#1{%
+ \def\@tempa{#1}%
+% \end{macrocode}
+%
+% If we've found an `end' to match the `begin' that we started with,
+% we're done with gathering the abstract up; otherwise we stuff the
+% end itself into the token register and carry on.
+%
+% \begin{macrocode}
+ \ifx\@tempa\@abstract@
+ \expandafter\@abstract@end
+ \else
+% \end{macrocode}
+%
+% It's not \cs{end}|{abstract}| --- check that it's not
+% \cs{end}|{document}| either (which signifies that the author's
+% forgotten about ending the abstract)
+% \begin{macrocode}
+ \def\@tempb{document}%
+ \ifx\@tempa\@tempb
+ \TBError{\string\begin{\@abstract@}
+ ended by \string\end{\@tempb}}%
+ {You've forgotten \string\end{\@abstract@}}
+ \else
+ \global\abstract@toks\expandafter{\the\abstract@toks\end{#1}}%
+ \expandafter\expandafter\expandafter\@abstract@getbody
+ \fi
+ \fi}
+% \end{macrocode}
+%
+% In our case, the action at the `proper' \cs{end} is a lot simpler
+% than what appears in |tabularx.dtx| \dots{} don't be surprised!
+%
+% \begin{macrocode}
+\def\@abstract@end{\ifnum0=`{\fi}%
+ \expandafter\end\expandafter{\@abstract@}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{environment}
+%
+% \begin{macro}{\makesignature}
+% \cs{makesignature} is improper in proceedings, so we replace it with a
+% warning (and a no-op otherwise)
+% \begin{macrocode}
+\renewcommand{\makesignature}{\TBWarning
+ {\string\makesignature\space is invalid in proceedings issues}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\title}
+% \begin{macro}{\TB@title}
+% We redefine the \cs{title} command, so as to set the \cs{rhTitle}
+% command at the same time. While we're at it, we redefine it to have
+% optional arguments for use as `short' versions, thus obviating the
+% need for users to use the \cs{shortTitle} command.
+% \begin{macrocode}
+\renewcommand\title{\@dblarg\TB@title}
+\def\TB@title[#1]#2{\gdef\@title{#2}%
+ \bgroup
+ \let\thanks\@gobble
+ \let\\\ %
+ \protected@xdef\rhTitle{#1}%
+ \egroup
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\shortTitle}
+% \begin{macro}{\ifshortAuthor}
+% \begin{macro}{\shortAuthor}
+% The \cs{rh*} commands are versions to be used in the running head of
+% the article. Normally, they are the same things as the author and
+% title of the article, but in the case that there are confusions
+% therein, the text should provide substitutes, using the \cs{short*}
+% commands.
+% \begin{macrocode}
+\def\shortTitle #1{\def\rhTitle{#1}}
+\newif\ifshortAuthor
+\def\shortAuthor #1{\def\rhAuthor{#1}\shortAuthortrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ps@TBproctitle}
+% \begin{macro}{\ps@TBproc}
+% \begin{macro}{\dopagecommands}
+% \begin{macro}{\setpagecommands}
+% \begin{macro}{\TB@definefeet}
+% \begin{macro}{\pfoottext}
+% \begin{macro}{\rfoottext}
+% Now we define the running heads in terms of the \cs{rh*} commands.
+% \begin{macrocode}
+\def\ps@TBproctitle{\let\@oddhead\MakeRegistrationMarks
+ \let\@evenhead\MakeRegistrationMarks
+ \TB@definefeet
+}
+\def\ps@TBproc{%
+ \def\@oddhead{\MakeRegistrationMarks
+ {%
+ \hfil
+ \def\\{\unskip\ \ignorespaces}%
+ \rmfamily\rhTitle
+ }%
+ }%
+ \def\@evenhead{\MakeRegistrationMarks
+ {%
+ \def\\{\unskip\ \ignorespaces}%
+ \rmfamily\rhAuthor
+ \hfil
+ }%
+ }%
+ \TB@definefeet
+}
+
+\advance\footskip8\p@ % for deeper running feet
+
+\def\dopagecommands{\csname @@pagecommands\number\c@page\endcsname}
+\def\setpagecommands#1#2{\expandafter\def\csname @@pagecommands#1\endcsname
+ {#2}}
+\def\TB@definefeet{%
+ \def\@oddfoot{\ifpreprint\pfoottext\hfil\Now\hfil\thepage
+ \else\rfoottext\hfil\thepage\fi\dopagecommands}%
+ \def\@evenfoot{\ifpreprint\thepage\hfil\Now\hfil\pfoottext
+ \else\thepage\hfil\rfoottext\fi\dopagecommands}%
+}
+
+\def\pfoottext{{\smc Preprint}: Proceedings of the \volyr{} Annual Meeting}
+\def\rfoottext{\normalfont\TUB, \volx\Dash
+ {Proceedings of the \volyr{} Annual Meeting}}
+
+\pagestyle{TBproc}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Section divisions}
+%
+% Neither sections nor subsections are numbered in the proceedings
+% style: note that this puts a degree of stress on authors' natural
+% tendency to reference sections, which is a matter that needs
+% attention.
+%
+% \begin{macrocode}
+\if@proc@numbersec
+\else
+ \setcounter{secnumdepth}{0}
+\fi
+% \end{macrocode}
+%
+% Otherwise, the \cs{section} command is pretty straightforward.
+% However, the \cs{subsection} and \cs{subsubsection} are run-in, and
+% we have to remember to have negative stretch (and shrink if we
+% should in future choose to have one) on the \meta{afterskip}
+% parameter of \cs{@startsection}, since the whole skip is going to
+% end up getting negated. We use \cs{TB@startsection} to detect
+% inappropriate forms.
+%
+% \begin{macrocode}
+\if@proc@numbersec
+\else
+ \if@proc@sober
+ \def\section
+ {\TB@nolimelabel
+ \TB@startsection{{section}%
+ 1%
+ \z@%
+ {-8\p@\@plus-2\p@\@minus-2\p@}%
+ {6\p@}%
+ {\normalsize\bfseries\raggedright}}}
+ \else
+ \def\section
+ {\TB@nolimelabel
+ \TB@startsection{{section}%
+ 1%
+ \z@%
+ {-8\p@\@plus-2\p@\@minus-2\p@}%
+ {6\p@}%
+ {\large\bfseries\raggedright}}}
+ \fi
+ \def\subsection
+ {\TB@nolimelabel
+ \TB@startsection{{subsection}%
+ 2%
+ \z@%
+ {6\p@\@plus 2\p@\@minus2\p@}%
+ {-5\p@\@plus -\fontdimen3\the\font}%
+ {\normalsize\bfseries}}}
+ \def\subsubsection
+ {\TB@nolimelabel
+ \TB@startsection{{subsubsection}%
+ 3%
+ \parindent%
+ \z@%
+ {-5\p@\@plus -\fontdimen3\the\font}%
+ {\normalsize\bfseries}}}
+\fi
+%</ltugproccls>
+% \end{macrocode}
+%
+% \section{Plain \TeX\ styles}
+% \begin{macrocode}
+%<*tugboatsty>
+% err...
+%</tugboatsty>
+%<*tugprocsty>
+% err...
+%</tugprocsty>
+% \end{macrocode}
+% \section{The \LaTeXe\ compatibility-mode style files}
+% \begin{macrocode}
+%<*ltugboatsty>
+\@obsoletefile{ltugboat.cls}{ltugboat.sty}
+\LoadClass{ltugboat}
+%</ltugboatsty>
+%<*ltugprocsty>
+\@obsoletefile{ltugproc.cls}{ltugproc.sty}
+\LoadClass{ltugproc}
+%</ltugprocsty>
+% \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/latex/tugboat/tugboat.ins b/Master/texmf-dist/source/latex/tugboat/tugboat.ins
new file mode 100644
index 00000000000..579ca46d4b2
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tugboat/tugboat.ins
@@ -0,0 +1,60 @@
+\def\batchfile{tugboat.ins}
+\input docstrip.tex
+%\errorcontextlines999
+
+\keepsilent
+
+\preamble
+
+Copyright (C) 1994,1995,1996,2001 TeX Users Group
+All rights reserved.
+
+This file is part of the tugboat package.
+-----------------------------------------
+
+This is a generated file. 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
+\askforoverwritefalse
+\generate{\file{ltugboat.cls}{%
+ \from{tugboat.dtx}{latex,classtop,common,classtail,latex2e,ltugboatcls}}
+ \file{ltugproc.cls}{%
+ \from{tugboat.dtx}{ltugproccls}}
+ \file{ltugboat.sty}{%
+ \from{tugboat.dtx}{ltugboatsty}}
+ \file{ltugproc.sty}{%
+ \from{tugboat.dtx}{ltugprocsty}}
+ \file{ltugcomn.sty}{%
+ \from{tugboat.dtx}{common,latex,latex2e,ltugcomn}}}
+
+%\generateFile{tugboat.sty}{f}{
+% \from{tugboat.dtx}{tugboatsty}}
+%
+%\generateFile{tugproc.sty}{f}{
+% \from{tugboat.dtx}{tugprocsty}}
+%
+
+\keepsilent
+
+\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 *.sty and all *.cls}
+\Msg{*}
+\Msg{* Then move ltugbib.bst to a directory searched by BibTeX}
+\Msg{*}
+\Msg{* Preferred TDS locations:}
+\Msg{* tex/latex/tugboat (for *.sty, *.cls)}
+\Msg{* bibtex/bst/misc (for ltugbib.bst)}
+\Msg{*}
+\Msg{***********************************************************}
+}
+
+\endinput
diff --git a/Master/texmf-dist/source/latex/typogrid/Makefile b/Master/texmf-dist/source/latex/typogrid/Makefile
new file mode 100644
index 00000000000..6f6cfa0a53d
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/Makefile
@@ -0,0 +1,69 @@
+
+SRCDIR=typogrid
+INSTALLDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/tex/latex/typogrid
+DOCDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/doc/latex/typogrid
+VERSION=`grep '^\\\\def\\\\fileversion' typogrid.dtx | sed 's/^\\\\def\\\\fileversion{\\(.*\\)\\.\\(.*\\)}/\\1_\\2/'`
+
+
+.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf
+
+.ins.sty:
+ latex $<
+
+.dtx.dvi:
+ latex $<
+ latex $<
+ makeindex -s gind.ist $(*D)/$(*F)
+ makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo
+ latex $<
+
+.dvi.ps:
+ dvips -o $(*D)/$(*F).ps $(*D)/$(*F)
+
+
+all: typogrid.sty typogrid.dvi
+
+
+clean:
+ @-rm -f typogrid.glo typogrid.gls typogrid.idx typogrid.ilg
+ @-rm -f typogrid.ind typogrid.aux typogrid.log typogrid.toc
+ @-rm -f testtypogrid.aux testtypogrid.log
+ @-rm -f *~
+
+distclean: clean
+ @-rm -f typogrid.sty typogrid.dvi
+ @-rm -f testtypogrid.dvi
+
+tar: all clean
+ echo Lege typogrid-$(VERSION).tar.gz an
+ -rm -f typogrid-$(VERSION).tar.gz
+ tar czCf .. typogrid-$(VERSION).tar.gz \
+ $(SRCDIR)/README \
+ $(SRCDIR)/Makefile \
+ $(SRCDIR)/typogrid.dtx \
+ $(SRCDIR)/typogrid.ins \
+ $(SRCDIR)/typogrid.dvi \
+ $(SRCDIR)/testtypogrid.tex
+
+zip: all clean
+ -@rm -f typogrid-$(VERSION).zip
+ mkdirhier tex/latex/typogrid
+ mkdirhier doc/latex/typogrid
+ mkdirhier source/latex/typogrid
+ mv typogrid.sty tex/latex/typogrid
+ cp typogrid.dtx typogrid.ins typogrid.xml source/latex/typogrid
+ cp Makefile source/latex/typogrid
+ cp README typogrid.dvi testtypogrid.tex doc/latex/typogrid
+ zip -r typogrid-$(VERSION).zip tex doc source
+ rm -r tex/ doc/ source/
+
+install: all
+ if [ ! -d $(INSTALLDIR) ]; then mkdirhier $(INSTALLDIR); fi
+ if [ ! -d $(DOCDIR) ]; then mkdirhier $(DOCDIR); fi
+ install -m644 typogrid.sty $(INSTALLDIR)
+ install -m644 typogrid.dvi $(DOCDIR)
+ texhash
+
+
+typogrid.sty: typogrid.ins typogrid.dtx
+
diff --git a/Master/texmf-dist/source/latex/typogrid/typogrid.dtx b/Master/texmf-dist/source/latex/typogrid/typogrid.dtx
new file mode 100644
index 00000000000..4fb0af5ed09
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/typogrid.dtx
@@ -0,0 +1,214 @@
+% \iffalse meta comment
+% File: typogrid.dtx Copyright (C) 2003 Harald Harders
+% \fi
+%
+% \iffalse
+%
+%<*package>
+\def\fileversion{0.10}
+\def\filedate{2003/10/30}
+\def\docdate{2003/10/30}
+%</package>
+%<*driver>
+\listfiles
+\documentclass[a4paper]{ltxdoc}
+\title{The \texttt{typogrid} package\thanks{This file has version
+ \fileversion\ last revised \filedate, documentation dated
+ \docdate.}}
+\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
+\date{File Date \filedate, Printed \today}
+\usepackage[T1]{fontenc}
+%\def\meta@font@select{\normalfont\itshape}
+\makeatother
+%%
+\EnableCrossrefs
+\CodelineIndex
+\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter}
+\DoNotIndex{\setcounter,\space,\if,\else,\fi,\empty,\@empty,\ifx,\fi}
+\DoNotIndex{\ifnum,\fi,\expandafter,\csname,\endcsname,\the}
+\DoNotIndex{\MessageBreak,\message,\newlength,\newif,\xdef,\newcount}
+\DoNotIndex{\begingroup,\endgroup,\,,\@tempcnta,\@tempdima,\advance}
+\DoNotIndex{\ensuremath,\filedate,\fileversion,\docdate}
+\DoNotIndex{\mathit,\mathrm,\mathsf,\nprt@tmp,\nprt@tmpnum,\relax}
+\DoNotIndex{\protect,\renewcommand,\setlength,\settowidth,\stepcounter}
+\DoNotIndex{\string}
+\CodelineNumbered
+\RecordChanges
+\CheckSum{111}
+\begin{document}
+ \DocInput{typogrid.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \changes{0.10}{2003/10/30}{First version}%
+%
+% \maketitle
+% \begin{abstract}
+% \noindent
+% This package produces a typographic grid on every page of the
+% document.
+% That grid consists of vertical lines that devide the text block into
+% columns.
+% This may be useful to get the horizontal measures (distances etc.)
+% into good values.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section*{Copyright}
+% Copyright 2003 Harald Harders.
+%
+% 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.
+%
+% \section{Usage}
+%
+% Load the package using the
+% \begin{quote}
+% \cs{usepackage}\oarg{options}|{typogrid}|
+% \end{quote}
+% command.
+% Valid options are |final|, |draft|, and
+% |columns=|\meta{value}.
+% The options |final| and |draft| may be given explicitely or
+% implicitely from the document-class options.
+%
+% When |draft| is given the typographic grid is switched on; if
+% |final| or none of the above is given it is switched off.
+%
+% The |columns| option determines the number of columns printed.
+% If it is not given, a default of 12 is used.
+%
+% \DescribeMacro{\typogridsetup}
+% There is a second possibility to change the number of columns.
+% You may use the \cs{typogridsetup} command that takes a keyval list
+% as argument.
+% This version suports only |columns=|\meta{value}, e.g.,
+% \begin{quote}
+% |\typogridsetup{columns=4}|
+% \end{quote}
+% You may also change the number of columns within the text.
+%
+% \StopEventually{\PrintChanges \PrintIndex}
+%
+% \section{The implementation}
+% \iffalse
+%<*package>
+% \fi
+% Heading of the package:
+% \begin{macrocode}
+\ProvidesPackage{typogrid}[2003/10/29 v\fileversion\space Typographic grid]
+\RequirePackage{eso-pic}[2002/11/16]
+\RequirePackage{calc}
+\RequirePackage{keyval}
+% \end{macrocode}
+% Introduce the used lengths.
+% \begin{macrocode}
+\newlength{\tpg@left}%
+\newlength{\tpg@top}%
+\newlength{\tpg@bottom}%
+\newlength{\tpg@gridwidth}%
+% \end{macrocode}
+% Introduce the used counters and set the default number of columns.
+% \begin{macrocode}
+\newcounter{tpg@bloecke}%
+\setcounter{tpg@bloecke}{12}%
+% \end{macrocode}
+% \begin{macro}{\typogridsetup}
+% Declare a command that can be used to change the appearence of the
+% typographic grid.
+% The argument takes a list of keyval options.
+% \begin{macrocode}
+\newcommand*\typogridsetup[1]{%
+ \expandafter\setkeys\expandafter{typogrid}{#1}}
+% \end{macrocode}
+% \end{macro}
+% Define the key |columns| that takes the number of columns.
+% \begin{macrocode}
+\define@key{typogrid}{columns}{%
+ \setcounter{tpg@bloecke}{#1}%
+ \ifnum\arabic{tpg@bloecke}<1
+ \PackageError{typogrid}{Less than 1 column given}{You have to
+ declare at least 1 column.}%
+ \setcounter{tpg@bloecke}{1}%
+ \fi
+}
+% \end{macrocode}
+% Package options:
+% \begin{macrocode}
+\newif\iftpg@draft
+\DeclareOption{draft}{\tpg@drafttrue}
+\DeclareOption{final}{\tpg@draftfalse}
+\DeclareOption*{\expandafter\typogridsetup\expandafter{\CurrentOption}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ExecuteOptions{final}
+\ProcessOptions\relax
+% \end{macrocode}
+% Start the grid with the first page (should not be necessary).
+% \begin{macrocode}
+\AtBeginDocument{%
+% \end{macrocode}
+% Print the grid on any page.
+% \begin{macrocode}
+ \iftpg@draft
+ \typeout{Typographic grid switched on}%
+ \AddToShipoutPicture{%
+% \end{macrocode}
+% Set the unit length each time because the use may have changed it.
+% Do everything inside a group to prevent the changes to be seen
+% outside.
+% \begin{macrocode}
+ \begingroup
+ \normalcolor
+ \setlength{\unitlength}{1pt}%
+ \thinlines
+% \end{macrocode}
+% Calculate the distance of the text block from the page corner.
+% \begin{macrocode}
+ \setlength{\tpg@top}{\paperheight-1in-\topmargin-\headheight-\headsep}%
+ \setlength{\tpg@bottom}{\tpg@top-\textheight}%
+ \setlength{\tpg@gridwidth}{\textwidth/\thetpg@bloecke}%
+% \end{macrocode}
+% Calculate the number of vertical lines to be printed.
+% \begin{macrocode}
+ \@tempcnta=\thetpg@bloecke
+ \advance\@tempcnta by 1
+% \end{macrocode}
+% The left distance varies between odd and even pages.
+% \begin{macrocode}
+ \ifodd\arabic{page}%
+ \setlength{\tpg@left}{\oddsidemargin+1in}%
+ \else
+ \setlength{\tpg@left}{\evensidemargin+1in}%
+ \fi
+% \end{macrocode}
+% Print horizontal lines.
+% \begin{macrocode}
+ \put(\strip@pt\tpg@left,\strip@pt\tpg@top){%
+ \line(1,0){\strip@pt\textwidth}}%
+ \put(\strip@pt\tpg@left,\strip@pt\tpg@bottom){%
+ \line(1,0){\strip@pt\textwidth}}%
+% \end{macrocode}
+% Print equidistant vertical lines.
+% \begin{macrocode}
+ \multiput(\strip@pt\tpg@left,\strip@pt\tpg@bottom)%
+ (\strip@pt\tpg@gridwidth,0){\the\@tempcnta}{%
+ \line(0,1){\strip@pt\textheight}}%
+ \endgroup
+ }%
+ \else
+ \typeout{Typographic grid switched off}%
+ \fi
+}
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+% \Finale
+
diff --git a/Master/texmf-dist/source/latex/typogrid/typogrid.ins b/Master/texmf-dist/source/latex/typogrid/typogrid.ins
new file mode 100644
index 00000000000..1e19f6e146e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/typogrid/typogrid.ins
@@ -0,0 +1,25 @@
+\input docstrip.tex
+\preamble
+
+ typogrid package
+
+ Copyright 2003 Harald Harders
+
+ 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.
+
+ h.harders@tu-bs.de
+
+\endpreamble
+
+\askforoverwritefalse
+
+% Files
+%%%%%%%%%%%%%%%%%%%%%%
+\generate{%
+ \file{typogrid.sty}{\from{typogrid.dtx}{package}}%
+}%
+
+\endbatchfile
diff --git a/Master/texmf-dist/source/metapost/mpattern/mpp b/Master/texmf-dist/source/metapost/mpattern/mpp
new file mode 100644
index 00000000000..d5d81c5be59
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/mpattern/mpp
@@ -0,0 +1,55 @@
+#!/usr/bin/perl -i
+###########################################################################
+# This file is part of the MPATTERN package
+#
+# mpp: Postprocessing MetaPost output files in which patterns were used
+#
+# Author: Piotr Bolek
+# version: 0.2 (Sep 25, 1998)
+#
+# $Id: mpp,v 1.3 1998/09/25 10:49:30 piotrek Exp $
+###########################################################################
+
+$file=shift;
+($logfile = $file . ".log") =~ s/\.mp\.log/.log/;
+$file =~ s/\.mp$//;
+
+system("mpost $file");
+
+open LOG, $logfile;
+while(<LOG>) {
+ if (/Pattern:(\d+)/) {
+ push @pictures, $1;
+ }
+}
+
+print STDERR "Postprocessing patterns";
+
+for $i (@pictures) {
+ $newfile="$file.$i"; print STDERR ".";
+ $oldfile="$file.p!!";
+ rename($newfile,$oldfile);
+
+ open IN, $oldfile;
+ open OUT, ">$newfile";
+ $output = $fonts = "";
+ LINE:
+ while(<IN>){
+ if((/^%%EndProlog\s*$/../^%%EOF\s*$/) && /%*Font:/) {
+ $fonts .= $_;
+ next LINE;
+ }
+ if(/^% Pattern:(0\.[0-9]+):(.*)/) {
+ $pattern{$1}=$2;
+# print STDERR "\$pattern{$1}=$2\n";
+ }
+ if(/^ (0\.[0-9]+) setgray/ && (defined $pattern{$1})) {
+ s"^ (0\.[0-9]+).*"%$&\n$pattern{$1} setpattern";
+ }
+ $output .= $_;
+ }
+ $output =~ s/%%EndProlog/$fonts$&/;
+ print OUT $output;
+ unlink $oldfile;
+}
+print STDERR "\n";
diff --git a/Master/texmf-dist/source/psizzl/base/aaaread.me b/Master/texmf-dist/source/psizzl/base/aaaread.me
new file mode 100644
index 00000000000..b5e53769fb0
--- /dev/null
+++ b/Master/texmf-dist/source/psizzl/base/aaaread.me
@@ -0,0 +1,10 @@
+ PSIZZL - A TeX Format for Physics Papers
+
+
+ PSIZZL is a TeX format for physics papers written at SLAC and used at
+seveal other places. It uses too many fonts to work with the version of TeX on
+the VAX Cluster, so the sans serif and small caps fonts have been removed, and
+the control sequences for these have been redefined to give Roman type. Both
+the modified source code and a .FMT file are contained in this directory.
+
+ Please report any problems to F. Paige at X3836.
diff --git a/Master/texmf-dist/source/startex/base/INSTALL b/Master/texmf-dist/source/startex/base/INSTALL
new file mode 100644
index 00000000000..97dce6e8dbe
--- /dev/null
+++ b/Master/texmf-dist/source/startex/base/INSTALL
@@ -0,0 +1,75 @@
+Installing StarTeX
+==================
+
+To install StarTeX on your system, you must do the following:
+
+1) Extract the various source files from the distribution file:
+
+ tex startex.ins
+
+(This command reads the file startex.dtx and extracts startex.tex,
+startex.lan, article.stx, a4-article.stx, ifi-article.stx and
+ifi-artikkel.stx. It assumes you have the file docstrip.tex available;
+this file is part of the standard LaTeX distribution.)
+
+2) Modify startex.lan to load the hyphenation patterns for the
+languages you intend to use. (The standard patterns are American
+English and Norwegian which may not be your ideal choice.) American
+English should always be present as language no 0. You add language
+patterns by adding lines like
+
+ \DefLang{1}{norsk}{nohyph2.tex}%
+
+The three parameters are: (1) a unique number in the range 1-255,
+(2) the name of the language, and (3) the file from which the
+hyphenation patterns can be read.
+
+3) Make a StarTeX format:
+
+ initex plain '\input startex' '<make-new-format>'
+ mv plain.fmt startex.fmt
+
+This produces the format file plain.fmt which is then renamed to
+startex.fmt. (The commands given here are for Unix; your system might
+use a different notation.)
+
+4) Place the format file where `virtex' can find it, for instance in
+/usr/local/texmf/ini.
+
+ cp startex.fmt /usr/local/texmf/ini
+
+5) Define the command `startex' as a link to `virtex':
+
+ cd /usr/local/texmf/bin
+ ln -s virtex startex
+
+(Again: this is Unix notation; your system might differ.)
+
+6) Put the .stx files where `virtex' can find them, for instance in
+/usr/local/texmf/tex/startex:
+
+ cp *.stx /usr/local/texmf/tex/startex
+
+And that should be it.
+
+
+Documentation
+-------------
+
+If you want a commented listing of the StarTeX source code, you can
+make that from the startex.dtx source file. That requires three passes
+by LaTeX and use of `bibtex' and `makeindex':
+
+ latex startex.dtx
+ bibtex startex
+ latex startex.dtx
+ makeindex -s stxind.ist startex.idx
+ makeindex -s stxglo.ist -o startex.gls startex.glo
+ latex startex.dtx
+
+
+Note
+----
+
+Some operating systems have a limit of 8+3 characters in file names.
+Users of such systems may have to make some small modifications.
diff --git a/Master/texmf-dist/source/startex/base/README b/Master/texmf-dist/source/startex/base/README
new file mode 100644
index 00000000000..ee7cd68c818
--- /dev/null
+++ b/Master/texmf-dist/source/startex/base/README
@@ -0,0 +1,54 @@
+StarTeX
+-------
+
+This is the StarTeX package, a TeX format designed to help students
+write short reports and essays. It provides the user with a suitable
+set of commands for such a task. It is also more robust than plain TeX
+and LaTeX.
+
+For more information, see the documentation files mentioned below.
+
+
+Files
+-----
+
+The following files are included in the package:
+
+README This file
+
+INSTALL How to install StarTeX
+
+startex.bib The bibliography necessary for typesetting startex.dtx
+
+startex.dtx The StarTeX source file
+
+startex.ins The StarTeX installation file (see INSTALL)
+
+startex.pdf The typeset source code of StarTeX
+
+stxglo.ist Glossary definition used by `makeindex' (see INSTALL)
+stxind.ist Index definition used by `makeindex' (see INSTALL)
+
+guide.pdf A beginner's guide to StarTeX
+
+ideas.pdf StarTeX -- a TeX for beginners
+ The talk at TUG'96 describing the ideas behind StarTeX
+
+
+Copyright
+---------
+
+These files are in the public domain. This means that you can do what
+you like with them, but I ask that if you redistribute modified files,
+you clearly indicate the alterations made.
+
+These files are provided in the hope that they will be useful, but no
+guarantee is made. I will, however, strive to correct any errors
+reported.
+
+
+Oslo, 11th March 1999
+Dag Langmyhr
+Dept of Informatics
+University of Oslo
+dag@ifi.uio.no
diff --git a/Master/texmf-dist/source/startex/base/startex.bib b/Master/texmf-dist/source/startex/base/startex.bib
new file mode 100644
index 00000000000..48593d20c05
--- /dev/null
+++ b/Master/texmf-dist/source/startex/base/startex.bib
@@ -0,0 +1,70 @@
+@string{AW=Addison-Wesley}
+
+@unpublished{varioref,
+ author = "Frank Mittelbach",
+ title = "The \texttt{varioref} package",
+ note = "Part of the \LaTeXe{} distribution.",
+ month = may,
+ year = 1995}
+
+@unpublished{taylor,
+ author = "Philip Taylor",
+ title = "{\TeX}: an unsuitable language for document markup?",
+ note = "Talk given at the Euro\TeX{} 1995 conference; does not
+ appear in the proceedings.",
+ date = sep,
+ year = 1995}
+
+
+
+@InProceedings{etex,
+ author = {Philip Taylor},
+ title = {{\(\varepsilon\)-\TeX}:
+ a 100\%-compatible successor to {\TeX}},
+ booktitle = {Euro\TeX'95},
+ year = 1995,
+ month = sep,
+ pages = {359-370}
+}
+
+@Unpublished{fontname,
+ author = {Karl Berry},
+ title = {Fontname},
+ note = {Available from \textsc{ctan} in \textsf{info/fontname}},
+ year = 1998,
+ month = jul
+}
+
+@unpublished{auc,
+ author = "Kresten Krab Thorup",
+ title = "{AUC} \TeX",
+ note = "An Emacs mode for editing \AllTeX{} code; available from
+ \textsf{http: //www.iesd.auc.dk/\textasciitilde{}amanda/auctex/}.",
+ year = 1996}
+
+@book{latex,
+ author = "Leslie Lamport",
+ title = "\LaTeX{} user's guide and reference manual",
+ publisher = AW,
+ year = 1994}
+
+@book{joy,
+ author = "Michael Spivak",
+ title = "The joy of \TeX",
+ publisher = "\AMS",
+ year = 1986,
+ note = "The guide to \AmSTeX."}
+
+@unpublished{html30,
+ title = "HyperText markup language specification version 3.0 draft",
+ author = "Dave Raggett",
+ note = "Available at
+ \textsf{http: //www.w3.org/pub/WWW/MarkUp/html3/}.",
+ year = 1995,
+ month = mar}
+
+@book{texbook,
+ author = "Donald E. Knuth",
+ title = "The \TeX{}book",
+ publisher = AW,
+ year = 1991}
diff --git a/Master/texmf-dist/source/startex/base/startex.dtx b/Master/texmf-dist/source/startex/base/startex.dtx
new file mode 100644
index 00000000000..7b1181d9261
--- /dev/null
+++ b/Master/texmf-dist/source/startex/base/startex.dtx
@@ -0,0 +1,2734 @@
+\def \CodeVersion {1.04}
+\def \CodeDate {11th March 1999}
+%
+% \iffalse ^^A Comment out driver code, so LaTeX can read this file as it is.
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{varioref,amssymbols}
+\EnableCrossrefs
+\RecordChanges
+\CodelineIndex
+\renewcommand{\levelchar}{?}
+
+\title{The \starTeX{} source code}
+\author{Dag Langmyhr\\ Department of Informatics\\
+ University of Oslo\\[3mm]
+ \textsf{dag@ifi.uio.no}}%
+\date{Version \CodeVersion, \CodeDate}
+
+\newcommand{\hex}[1]{\texttt{``#1}}
+\newcommand{\stcs}[1]{\texttt{<#1>}}
+\newcommand{\stenv}[1]{\stcs{#1}\dots\hspace{0.1pt}\stcs{/#1}}
+\newcommand{\ParX}{\texttt{\textit{x}}}
+\newcommand{\ps}{\textsc{Post\-Script}}
+\newcommand{\starTeX}{Star\TeX}
+\newcommand{\xx}{\textit{x}}
+
+\newfont{\StdECR}{ecrm1000}
+\newfont{\CompECR}{tcrm1000}
+
+\begin{document}
+\maketitle
+
+\DoNotIndex{\#,\$,\&,\\,\{,\},\^,\_,\~}
+\DoNotIndex{\active,\advance,\alpha}
+\DoNotIndex{\begingroup,\beta,\bgroup}
+\DoNotIndex{\catcode,\Cdef,\chi,\csname}
+\DoNotIndex{\day,\def,\Delta,\delta,\Df,\dots,\dump}
+\DoNotIndex{\edef,\egroup,\endcsname,\endgraf,\endgroup,\epsilon,\eta}
+\DoNotIndex{\Gamma,\gamma,\gdef,\global}
+\DoNotIndex{\halign,\hangafter,\hangindent,\hbadness,\hbox,\hfil,\hfuzz}
+\DoNotIndex{\hoffset,\hrule,\hsize}
+\DoNotIndex{\iota,\input,\inputlineno}
+\DoNotIndex{\kappa,\kern}
+\DoNotIndex{\Lambda,\lambda,\language,\LaTeX,\leavevmode,\leftskip,\let,\llap}
+\DoNotIndex{\magstep,\magstephalf,\mathcode,\message,\month,\mu}
+\DoNotIndex{\newbox,\newcount,\newdimen,\newif,\newlinechar,\newread}
+\DoNotIndex{\newskip,\newwrite,\next,\Next,\noalign,\nu}
+\DoNotIndex{\obeylines,\obeyspaces,\offinterlineskip,\Omega,\omega}
+\DoNotIndex{\openin,\openout,\over}
+\DoNotIndex{\pageno,\par,\parindent,\parskip,\penalty,\Phi,\phi,\pm,\Pr}
+\DoNotIndex{\Pi,\pi,\Psi,\psi}
+\DoNotIndex{\raggedright,\Re,\relax,\rightskip,\rho,\rlap}
+\DoNotIndex{\setbox,\Sigma,\sigma,\space,\string,\strut,\supereject}
+\DoNotIndex{\tau,\TeX,\the,\Theta,\theta,\time,\times,\TmpA,\TmpB,\tolerance}
+\DoNotIndex{\topinsert}
+\DoNotIndex{\tracingcommands,\tracingmacros,\tracingoutput,\tracingrestores}
+\DoNotIndex{\uccode,\unskip,\Uparrow,\Updownarrow,\uppercase,\Upsilon,\upsilon}
+\DoNotIndex{\varepsilon,\varphi,\varpi,\varrho,\varsigma,\vartheta}
+\DoNotIndex{\vbox,\vdots,\vfill,\voffset,\vrule,\vsize,\vskip}
+\DoNotIndex{\wd}
+\DoNotIndex{\Xi,\xi}
+\DoNotIndex{\year}
+\DoNotIndex{\zeta}
+
+\DeleteShortVerb{\|}\MakeShortVerb{\"}
+\DocInput{startex.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \CheckSum{2563}
+%% \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 \~}
+%
+% \tableofcontents
+%
+% \RecordChanges
+% \StopEventually{\PrintIndex\PrintChanges}
+%
+% \section{The \starTeX{} format}
+% \begin{macrocode}
+%<*code>
+% \end{macrocode}
+% This file contains the documented source code of \starTeX{}, a
+% simplified and more robust \TeX{} format intended for students
+% writing their first report or essay. For more information on
+% \starTeX{}, see the other files accompanying this.
+%
+% The main guidelines for this implementation are:
+% \begin{itemize}
+% \item \starTeX{} is implemented on top of plain \TeX{}.
+%
+% \item All names defined in the \starTeX{} implementation contain
+% at least one uppercase letter, like \cs{Cdef} or \cs{NewEnvir}.
+% This makes it easier to distinguish
+% them from \TeX's internal names and the names defined in plain
+% \TeX{}, nearly all of which consist of lowercase letters only.
+%
+% \item Most \TeX{} macro packages tend to use a rather terse
+% programming style, like
+% \begin{quote}
+% \verb*:\advance\var\@ne:
+% \end{quote}
+% This improves processing speed and reduces storage, but make the
+% code more difficult to read. Since this is a package which aims to
+% be easily understandable and adaptable, I will use a more verbose style:
+% \begin{quote}
+% \verb*:\advance \var by 1:
+% \end{quote}
+% \end{itemize}
+% To avoid possible confusion, \starTeX{} commands will be called
+% \emph{commands} in this document, while \TeX{} commands will be
+% called \emph{macros}.
+%
+% \subsection{States}
+% \begin{macro}{\State}
+% To avoid improper nesting, such as use of \stcs{psfig} within a
+% \stcs{table}, we introduce a global state variable. Its values are
+% given in table~\ref{tab:states}.
+% \begin{table}
+% \begin{center}
+% \begin{tabular}{|c|l|}
+% \hline
+% \textbf{Value}& \textbf{State}\\
+% \hline\hline
+% \texttt{x}& Ordinary body text\\
+% \texttt{p}& Inside a \stcs{psfig} caption\\
+% \texttt{t}& Inside a \stcs{table} caption\\
+% \texttt{r}& Inside a \stcs{table} row\\
+% \hline
+% \end{tabular}
+% \end{center}
+% \caption{The possible values of \cs{State}}\label{tab:states}
+% \end{table}
+% The initial state is body text:
+% \begin{macrocode}
+\let \State = x
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Command handling}
+% \begin{macro}{\Command}
+% \starTeX{} uses the syntax \stcs{\xx} for its commands rather than
+% the usual \cs{\xx}. This is easily implemented by making "<" an
+% active character calling the macro \cs{Command}. The command name is
+% the text between the "<" and a subsequent ">".
+%
+% \cs{Command} first checks whether the command immediately
+% follows a "<define>" in which case it is being defined;
+% \cs{DefineCmd} handles that. Otherwise, \cs{Command} converts the
+% command name into lowercase and
+% checks whether it has been defined. If so, it is called;
+% otherwise an error message is produced and the command is ignored.
+% \begin{macrocode}
+\def \Command #1>{\ifDefining
+ \def \Next {\lowercase{\DefineCmd{#1}}}%
+ \else
+ \lowercase{\expandafter\ifx \csname >#1\endcsname}\relax
+ \Error{Unknown command <#1> ignored.}{}%
+ \let \Next = \relax
+ \else
+ \def \Next {\lowercase{\csname >#1\endcsname}}%
+ \fi
+ \fi \Next }
+% \end{macrocode}
+% \end{macro}
+% The "<" character must be bound to \cs{Command}:
+% \begin{macrocode}
+{\catcode `\< = \active \global\let < = \Command }
+% \end{macrocode}
+%
+% \subsubsection{Internal form of command names}
+% All \starTeX{} commands are represented by a \TeX{} macro whose name
+% is constructed by \cs{csname}. To avoid confusion with predefined
+% \TeX{} macros, an initial ">"\footnote{The character \texttt{>} was
+% chosen as it cannot possibly occur in a command name.}
+% is inserted; for example, the name of \stcs{h1} is
+% represented by "\csname >h1\endcsname".
+%
+% \begin{macro}{\Cdef}
+% To simplify the declaration of \starTeX{} commands, the macro
+% \cs{Cdef} is defined. It takes two parameters: "#1" is the command name
+% (with no uppercase letters and no angle brackets), and
+% "#2" is the command definition.
+% \begin{macrocode}
+\def \Cdef #1#2{\expandafter\gdef \csname >#1\endcsname{#2}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Ccall}
+% In case we need to call \starTeX{} commands from \TeX{} code, a
+% \cs{Ccall} macro is introduced.
+% \begin{macrocode}
+\def \Ccall #1{\csname >#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{User-defined commands}
+% \begin{macro}{<define>}
+% \begin{macro}{\ifDefining}
+% The implementation of \stcs{define} is a little sneaky; it just sets
+% a flag \cs{ifDefining}. When the following command name is
+% found, the \cs{Command} routine checks the state of the flag and
+% calls \cs{DefineCmd} when the flag is raised.\footnote{This means that
+% the user can insert text between the \stcs{define} and the command
+% name, and this will be typeset as normal text. There is a
+% slight chance that this might confuse some users, but I prefer this
+% solution to using much more complicated code.}
+% \begin{macrocode}
+\newif \ifDefining
+\Cdef {define}{\Definingtrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\DefineCmd}
+% The command \cs{DefineCmd} is used to define a new user command;
+% "#1" is the new command name (already translated into lowercase) and
+% "#2" is the definition.
+% The main job of \cs{DefineCmd} is to check whether the definition is
+% legal. There are two reasons why it may not be legal:
+% \begin{itemize}
+% \item The definition may be nested, as in
+% \begin{quote}
+% "<define><comm-1>...<define><comm-2>..."
+% \end{quote}
+% This is checked using a counter \cs{CallLevel} which is
+% incremented whenever a user-defined command is called, and
+% decremented on return; see the definition of \cs{Call} and
+% \cs{Return} below.
+%
+% \item The command may already be defined.
+% \end{itemize}
+% If the definition is legal, \cs{FetchDef} is called to perform the
+% actual defining.
+% \begin{macrocode}
+\def \DefineCmd #1{\Definingfalse
+ \ifnum \CallLevel>0
+ \Error{Nested definitions are not allowed;}%
+ {the definition of <#1> is ignored.}\let \Next = \relax
+ \else
+ \expandafter\ifx \csname>#1\endcsname\relax
+ \def \Next {\begingroup \catcode`\^^M = 12 \FetchDef{#1}}%
+ \else
+ \Error{Command <#1> already defined;}{this definition ignored.}%
+ \def \Next {\begingroup \catcode`\^^M = 12 \IgnoreDef{#1}}%
+ \fi
+ \fi \Next }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FetchDef}
+% \cs{FetchDef} defines the macro by using everything up to the
+% end-of-line mark as the definition. This implies modifying the
+% \cs{catcode} of the end-of-line character ("^^M"). Also note
+% that calls on \cs{Call} and \cs{Return} are inserted into the
+% definition.
+% \begin{macrocode}
+\begingroup \catcode`\^^M = 12
+ \gdef \FetchDef #1#2^^M{\expandafter%
+ \gdef\csname>#1\endcsname {\Call #2\Return }\endgroup }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IgnoreDef}
+% I also define \cs{IgnoreDef} which is quite similar to
+% \cs{FetchDef}, but no command is
+% defined. It is used to ignore the rest of the line in case
+% the user tries an illegal definition.
+% \begin{macrocode}
+ \gdef \IgnoreDef #1#2^^M{\endgroup }%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CallLevel}
+% Finally, we must declare the user command level counter
+% \cs{CallLevel}:
+% \begin{macrocode}
+\newcount \CallLevel
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Call}
+% \begin{macro}{\Return}
+% We must also define the two commands used for incrementing and
+% decrementing the counter:
+% \begin{macrocode}
+\def \Call {\global\advance \CallLevel by 1 }
+\def \Return {\global\advance \CallLevel by -1 }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Catcode modifications}
+% \starTeX{} uses only one special character: "<", which must be
+% active. All the other special characters of \TeX{} and \LaTeX{} are
+% assigned suitable \cs{catcode}s turning them into ordinary
+% characters.
+%
+% \begin{macro}{\SpecialCatCodes}
+% \cs{SpecialCatCodes} sets the \cs{catcode}s to the \starTeX{}
+% values:
+% \begin{macrocode}
+\def \SpecialCatCodes {%
+ \catcode `\\ = 12 \catcode `\{ = 12 \catcode `\} = 12
+ \catcode `\$ = 12 \catcode `\& = 12 \catcode `\# = 12
+ \catcode `\^ = 12 \catcode `\_ = 12 \catcode `\~ = 12
+ \catcode `\% = 12 \catcode `\< = \active }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\StandardCatCodes}
+% \cs{StandardCatCodes} restores the \cs{catcode}s to their normal
+% values. This is necessary when reading for instance style files.
+% \begin{macrocode}
+\def \StandardCatCodes {%
+ \catcode `\\ = 0 \catcode `\{ = 1 \catcode `\} = 2
+ \catcode `\$ = 3 \catcode `\& = 4 \catcode `\# = 6
+ \catcode `\^ = 7 \catcode `\_ = 8 \catcode `\~ = \active
+ \catcode `\% = 14 \catcode `\< = 12 }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Environments}
+% A \starTeX{} environment is a piece of text enclosed in a
+% \stcs{\xx}\dots\stcs{/\xx} pair.
+%
+% \begin{macro}{\NewEnvir}
+% \cs{NewEnvir} is used to start a new environment. It has three
+% parameters: "#1" is the name of the environment, "#2" is
+% the \TeX{} commands used to start the new environment (usually just
+% a \cs{begingroup}), and "#3" is
+% the \TeX{} commands used to terminate the environment (usually just
+% a \cs{endgroup}).
+%
+% \begin{macro}{\PrevEnv}
+% \begin{macro}{\PrevEnvLine}
+% \begin{macro}{\CurEnv}
+% \begin{macro}{\CurEnvExit}
+% \begin{macro}{\CurEnvLine}
+% \cs{NewEnvir} saves information about the current environment's name
+% (in \cs{CurEnv}), the line on which it starts (in \cs{CurEnvLine}) and
+% which command is used to exit it (in \cs{CurEnvExit}). It also keeps
+% tracks of the outer environment's name (in \cs{PrevEnv}) and start line
+% (in \cs{PrevEnvLine}) for better error reporting and error recovery.
+% \begin{macrocode}
+\def \NewEnvir #1#2#3{#2\relax
+ \let \PrevEnv = \CurEnv \PrevEnvLine = \CurEnvLine
+ \def \CurEnv {#1}\def \CurEnvExit {#3}\CurEnvLine = \inputlineno }
+% \end{macrocode}
+% We need default definitions of \cs{CurEnv} and \cs{CurEnvExit}:
+% \begin{macrocode}
+\def \CurEnv {}\def \CurEnvExit {\relax}
+% \end{macrocode}
+% We also need to declare the two line counters:
+% \begin{macrocode}
+\newcount \CurEnvLine \newcount \PrevEnvLine
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\EndEnvir}
+% \cs{EndEnvir} is used to terminate an environment. It check that the
+% correct environment is terminated, and tries to correct user
+% mistakes. It checks for the following situations:
+% \begin{itemize}
+% \item If the name of the environment to be terminated is the same as
+% that of the current environment, everything is OK, and we can safely
+% leave the current environment.
+%
+% \item If the name of the terminated environment is not the name of
+% the current one, but matches the name of the outer environment,
+% we assume that the user has forgotten a \stcs{/\xx} command.
+% An error message is given, and both the current environment and the
+% outer one are terminated.
+%
+% \item If the name of the terminated environment matches neither the
+% current nor the outer environment, we assume that the user has just
+% misspelled the command. The best thing we can do in this case is to
+% give an error message and ignore the command. If the user had
+% intended to terminate the current environment, we get erroneous
+% processing of the following text, but the situation will normalize
+% when the outer environment is terminated.
+% \end{itemize}
+% \begin{macrocode}
+\def \EndEnvir #1{%
+ \ifTextEqual{#1}{\CurEnv}\let \Next = \CurEnvExit
+ \else \EnvirError{#1}\fi
+ \Next }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EnvirError}
+% \cs{EnvirError} is an auxiliary command giving a proper error
+% message and placing---in \cs{Next}---the best command to recover
+% from the error.
+% \begin{macrocode}
+\def \EnvirError #1{\ifTextEqual{#1}{\PrevEnv}%
+ \Error{<\CurEnv> on line \the\CurEnvLine\space terminated by
+ </#1>.}{An extra </\CurEnv> has been inserted.}%
+ \def \Next {\CurEnvExit \CurEnvExit }%
+ \else
+ \Error{<\CurEnv> on line \the\CurEnvLine\space terminated by
+ </#1>.}{The </#1> will be ignored.}%
+ \let \Next = \relax
+ \fi }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Document styles}
+% \begin{macro}{<style>}
+% The command \stcs{style} is called to read a document style. It
+% calls \cs{ReadStyle} to do the actual work.
+% \begin{macrocode}
+\Cdef {style}{\IfNextChar{[}{\ReadStyle}%
+ {\Error{No style name given;}{the syntax is: <style>[style name].}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReadStyle}
+% \begin{macro}{\StyleLine}
+% \cs{ReadStyle} reads the style file (with extension
+% \texttt{.stx}) using the standard \TeX{} \cs{catcode}s. Afterwards, the
+% \stcs{style} command is redefined, since \stcs{style} should be
+% called once only. Also, the current line number is saved (in
+% \cs{StyleLine}) in case it is needed later in an error message.
+% \begin{macrocode}
+\def \ReadStyle [#1]{\IfFileExists{#1.stx}%
+ {\edef \StyleLine {\the\inputlineno}%
+ \Cdef {style}{\Error{Command <style> already used on line
+ \StyleLine;}{this use of <style> is ignored.}}%
+ \StandardCatCodes \input #1.stx
+ \SpecialCatCodes }%
+ {\Error{Style file `#1.stx' could not be found;}%
+ {style definition ignored.}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Fonts}
+% \starTeX{} allows the user a limited amount of font selection:
+% \begin{itemize}
+% \item use of \textbf{bold text} using \stcs{b}\dots\stcs{/b},
+%
+% \item use of \textit{italic text} using \stcs{i}\dots\stcs{/i}, and
+%
+% \item use of \texttt{typewriter text} using \stcs{tt}\dots\stcs{/tt}.
+% \end{itemize}
+% All other font changes, including font size changes, are done by the
+% document style.
+%
+% Since the font change commands mentioned above may be combined,
+% \starTeX{} uses an internal font naming scheme in which a font name
+% consists of five parts, as shown in table\vref{tab:fontname}. For
+% example, the font ``Standard bold roman italic normal-size'' is
+% represented internally as "F-RSBIN".
+%
+% \begin{table}
+% \begin{center}
+% \begin{tabular}{|l|l|l|l|l|}
+% \hline
+% \textbf{Kind}& \textbf{Alternate}& \textbf{Bold}&
+% \textbf{Italic}& \textbf{Size}\\
+% \hline\hline
+% "R" (Roman)& "S" (Standard)& "M" (Medium)& "U" (Upright)&
+% "X" (Extra large)\\
+% "T" (Teletype)& "A" (Alternate)& "B" (Bold)& "I" (Italic)&
+% "L" (Large)\\
+% &&&& "N" (Normal)\\
+% &&&& "S" (Small)\\
+% \hline
+% \end{tabular}
+% \end{center}
+% \caption{The five parts of the internal \starTeX{} text font name}
+% \label{tab:fontname}
+% \end{table}
+%
+% \begin{table}
+% \begin{center}
+% \begin{tabular}{|l|l|l|}
+% \hline
+% \textbf{Size}& \textbf{Position}& \textbf{Family}\\
+% \hline\hline
+% "X" (Extra large)& "N" (Normal)& "0" (Roman math)\\
+% "L" (Large)& "S" (Script)& "1" (Italic math)\\
+% "N" (Normal)& "X" (Scriptscript)& "2" (Math symbols)\\
+% "S" (Small)& & "3" (Large math symbols)\\
+% & & "4" (Bold math)\\
+% & & "5" (Extended italic math)\\
+% & & "6" (AMS symbols B)\\
+% \hline
+% \end{tabular}
+% \end{center}
+% \caption{The three parts of the internal \starTeX{} math font
+% name}\label{tab:mathfont}
+% \end{table}
+%
+% \subsubsection{Font definitions}
+% \begin{macro}{\FontDef}
+% The macro \cs{FontDef} is used to define a \starTeX{} font pair. To be
+% more precise, it defines which \TeX{} font specifications to use for
+% each internal \starTeX{} font name. "#1" gives the font kind, "#2"
+% the boldness, "#3" whether the font is italic or not, and "#4" the font
+% size. Two fonts are defined for each
+% internal \starTeX{} name: the standard Cork encoded font (in "#5")
+% and the additional companion font (in "#6").
+% \begin{macrocode}
+\def \FontDef #1#2#3#4#5#6{%
+ \expandafter\def \csname F-#1S#2#3#4\endcsname {#5}%
+ \expandafter\def \csname F-#1A#2#3#4\endcsname {#6}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\MathFontDef}
+% Similarly, \cs{MathFontDef} is used to define a math font. "#1" is
+% the size, "#2" is the family, and "#3"--"#5" are the three fonts to
+% be used as math text font, script font and scriptscript font.
+% \begin{macrocode}
+\def \MathFontDef #1#2#3#4#5{%
+ \expandafter\def \csname M-#1N#2\endcsname {#3}%
+ \expandafter\def \csname M-#1S#2\endcsname {#4}%
+ \expandafter\def \csname M-#1X#2\endcsname {#5}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Predefined fonts}
+% The following fonts are predefined, which means that they are the
+% fonts the user will get unless the document style dictates
+% otherwise.
+%
+% The fonts used are the so-called \emph{EC fonts}.
+% Since there are no bold typewriter characters in this set,
+% ordinary typewriter characters are used instead.
+%
+% Also defined are various size dependant values:
+% \begin{description}
+% \item[\cs{LineSkip}\ParX{}] line skip, and
+%
+% \item[\cs{CodeSkip}\ParX{}] line skip in code listings.
+% \end{description}
+%
+% \paragraph{Normal size fonts}
+% An 11 point (actually 10.95 pt) font is the standard text font.
+% \changes{1.02}{1998/01/12}{Changed from `dc' to `ec' fonts.}
+% \begin{macrocode}
+\def \XIpt { at 10.95pt}
+\FontDef{R}{M}{U}{N}{ecrm1095}{tcrm1095}
+\FontDef{R}{M}{I}{N}{ecti1095}{tcti1095}
+\FontDef{R}{B}{U}{N}{ecbx1095}{tcbx1095}
+\FontDef{R}{B}{I}{N}{ecbi1095}{tcbi1095}
+\FontDef{T}{M}{U}{N}{ectt1095}{tctt1095}
+\FontDef{T}{M}{I}{N}{ecit1095}{tcit1095}
+\FontDef{T}{B}{U}{N}{ectt1095}{tctt1095}
+\FontDef{T}{B}{I}{N}{ecit1095}{tcit1095}
+\MathFontDef{N}{0}{cmr10\XIpt}{cmr8}{cmr6}
+\MathFontDef{N}{1}{cmmi10\XIpt}{cmmi8}{cmmi6}
+\MathFontDef{N}{2}{cmsy10\XIpt}{cmsy8}{cmsy6}
+\MathFontDef{N}{3}{cmex10\XIpt}{cmex10\XIpt}{cmex10\XIpt}
+\MathFontDef{N}{4}{cmbx10\XIpt}{cmbx8}{cmbx6}
+\MathFontDef{N}{5}{ecti1095}{ecti0800}{ecti0600}
+\MathFontDef{N}{6}{msbm10\XIpt}{msbm8}{msbm6}
+\def \LineSkipN {12pt} \def \CodeSkipN {11pt plus 0.0pt minus 0.1pt}
+% \end{macrocode}
+%
+% \paragraph{Large fonts}
+% The slightly larger characters are 14.4 pt.
+% \begin{macrocode}
+\def \XIVpt { at 14.4pt}
+\FontDef{R}{M}{U}{L}{ecrm1440}{tcrm1440}
+\FontDef{R}{M}{I}{L}{ecti1440}{tcti1440}
+\FontDef{R}{B}{U}{L}{ecbx1440}{tcbx1440}
+\FontDef{R}{B}{I}{L}{ecbi1440}{tcbi1440}
+\FontDef{T}{M}{U}{L}{ectt1440}{tctt1440}
+\FontDef{T}{M}{I}{L}{ecit1440}{tcit1440}
+\FontDef{T}{B}{U}{L}{ectt1440}{tctt1440}
+\FontDef{T}{B}{I}{L}{ecit1440}{tcit1440}
+\MathFontDef{L}{0}{cmr12\XIVpt}{cmr10}{cmr8}
+\MathFontDef{L}{1}{cmmi12\XIVpt}{cmmi10}{cmmi8}
+\MathFontDef{L}{2}{cmsy10\XIVpt}{cmsy10}{cmsy8}
+\MathFontDef{L}{3}{cmex10\XIVpt}{cmex10\XIVpt}{cmex10\XIVpt}
+\MathFontDef{L}{4}{cmbx12\XIVpt}{cmbx10}{cmbx8}
+\MathFontDef{L}{5}{ecti1440}{ecti1000}{ecti0800}
+\MathFontDef{L}{6}{msbm10\XIVpt}{msbm10}{msbm8}
+\def \LineSkipL {15pt}
+% \end{macrocode}
+%
+% \paragraph{The extra large fonts}
+% The largest fonts are 17.28~pt.
+% \begin{macrocode}
+\def \XVIIpt { at 17.28pt}
+\FontDef{R}{M}{U}{X}{ecrm1728}{tcrm1728}
+\FontDef{R}{M}{I}{X}{ecti1728}{tcti1728}
+\FontDef{R}{B}{U}{X}{ecbx1728}{tcbx1728}
+\FontDef{R}{B}{I}{X}{ecbi1728}{tcbi1728}
+\FontDef{T}{M}{U}{X}{ectt1728}{tctt1728}
+\FontDef{T}{M}{I}{X}{ecit1728}{tcit1728}
+\FontDef{T}{B}{U}{X}{ectt1728}{tctt1728}
+\FontDef{T}{B}{I}{X}{ecit1728}{tcit1728}
+\MathFontDef{X}{0}{cmr17}{cmr12\XIVpt}{cmr9}
+\MathFontDef{X}{1}{cmmi12\XVIIpt}{cmmi12}{cmmi9}
+\MathFontDef{X}{2}{cmsy10\XVIIpt}{cmsy10 at 12pt}{cmsy9}
+\MathFontDef{X}{3}{cmex10\XVIIpt}{cmex10\XVIIpt}{cmex10\XVIIpt}
+\MathFontDef{X}{4}{cmbx12\XVIIpt}{cmbx12}{cmbx9}
+\MathFontDef{X}{5}{ecti1728}{ecti1200}{ecti0900}
+\MathFontDef{X}{6}{msbm10\XVIIpt}{msbm10 at 12pt}{msbm9}
+\def \LineSkipX {17pt}
+% \end{macrocode}
+%
+% \paragraph{Small fonts}
+% A smaller font for footnotes and other special text is 10~pt.
+% \begin{macrocode}
+\FontDef{R}{M}{U}{S}{ecrm1000}{tcrm1000}
+\FontDef{R}{M}{I}{S}{ecti1000}{tcti1000}
+\FontDef{R}{B}{U}{S}{ecbx1000}{tcbx1000}
+\FontDef{R}{B}{I}{S}{ecbi1000}{tcbi1000}
+\FontDef{T}{M}{U}{S}{ectt1000}{tctt1000}
+\FontDef{T}{M}{I}{S}{ecit1000}{tcit1000}
+\FontDef{T}{B}{U}{S}{ectt1000}{tctt1000}
+\FontDef{T}{B}{I}{S}{ecit1000}{tcit1000}
+\MathFontDef{S}{0}{cmr10}{cmr7}{cmr5}
+\MathFontDef{S}{1}{cmmi10}{cmmi7}{cmmi5}
+\MathFontDef{S}{2}{cmsy10}{cmsy7}{cmsy5}
+\MathFontDef{S}{3}{cmex10}{cmex10}{cmex10}
+\MathFontDef{S}{4}{cmbx10}{cmbx7}{cmbx5}
+\MathFontDef{S}{5}{ecti1000}{ecti0700}{ecti0500}
+\MathFontDef{S}{6}{msbm10}{msbm7}{msbm5}
+\def \LineSkipS {11pt}
+% \end{macrocode}
+%
+% \subsubsection{Font selection}
+% \begin{macro}{\FontAlt}
+% \begin{macro}{\FontBold}
+% \begin{macro}{\FontItal}
+% \begin{macro}{\FontKind}
+% \begin{macro}{\FontSize}
+% Selecting a \starTeX{} font is a two-step procedure:
+% \begin{enumerate}
+% \item Define \cs{FontKind}, \cs{FontAlt}, \cs{FontBold},
+% \cs{FontItal} and
+% \cs{FontSize} to contain the correct letters, as shown in
+% table\vref{tab:fontname}.
+%
+% \item Call \cs{SelectFont}.
+% \end{enumerate}
+% (The reason for this procedure is to avoid loading unused fonts.)
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\SelectFont}
+% As mentioned, "\SelectFont" selects a font according to the
+% specifications given.
+% \begin{macrocode}
+\def \SelectFont {%
+ \edef \ThisFont {F-\FontKind\FontAlt\FontBold\FontItal\FontSize}%
+ \font \CurFont = \csname\ThisFont\endcsname \CurFont }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ResetFont}
+% \cs{ResetFont} provides standard settings for the various \starTeX{}
+% font parameters.
+% \begin{macrocode}
+\def \ResetFont {%
+ \def \FontKind{R}\def \FontAlt{S}\def \FontBold{M}%
+ \def \FontItal{U}\def \FontSize{N}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CheckItCorr}
+% \cs{CheckItCorr} is called after every group of italic text. Unless
+% the following character is a low character like `\texttt{.}' or
+% `\texttt{,}', an italic correction command \cs{/} is inserted.
+% \begin{macrocode}
+\def \CheckItCorr {%
+ \IfNextCharTwo{.}{,}{}{\/}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Font size selection}
+% \begin{macro}{\SetSize}
+% \cs{SetSize} is used to set various parameters connected with a size
+% change. It also contains a call on \cs{SelectFont}.
+% \begin{macrocode}
+\def \SetSize #1{\def \FontSize{#1}\SelectFont
+ \baselineskip = \csname LineSkip#1\endcsname
+ \ParIndent = \StdParIndent }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{\starTeX{} commands for font changes}
+% \begin{macro}{<b>}
+% \begin{macro}{</b>}
+% \begin{macro}{<i>}
+% \begin{macro}{</i>}
+% \begin{macro}{<tt>}
+% \begin{macro}{</tt>}
+% The following commands are used to indicate bold, italic, or
+% typewriter text.
+% \begin{macrocode}
+\Cdef {b}{\NewEnvir{b}{\begingroup}{\endgroup}%
+ \def\FontBold{B}\SelectFont}
+\Cdef {/b}{\EndEnvir{b}}
+\Cdef {i}{\NewEnvir{i}{\begingroup}{\endgroup\CheckItCorr}%
+ \def\FontItal{I}\SelectFont}
+\Cdef {/i}{\EndEnvir{i}}
+\Cdef {tt}{\NewEnvir{tt}{\begingroup}{\endgroup}%
+ \def\FontKind{T}\SelectFont}
+\Cdef {/tt}{\EndEnvir{tt}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+
+% \subsection{Body text}
+% A \starTeX{} file is enclosed in a \stenv{body} environment. The main
+% reason for this is to be able to detect the end of the document and
+% terminate properly.\footnote{An \cs{everyeof}
+% command---had it existed---would have made the \stenv{body} environment
+% superfluous, thus removing yet another possible error source.
+% ($\varepsilon$-\TeX\cite{etex} does provide such a primitive, but
+% I have chosen not to apply it as use of $\varepsilon$-\TeX{} is not
+% yet very widespread.)} It is also used to print an introductory
+% message.
+%
+% \begin{macro}{<body>}
+% \stcs{body} just redefines itself to produce an error message if
+% used a second time; this is to ensure that it is only used once.
+% \begin{macrocode}
+\Cdef {body}{\NewEnvir{body}{\begingroup}{\endgroup}%
+ \message{^^JThis is StarTeX, version \CodeVersion^^J}%
+ \global\everypar = {\NewPar }%
+ \xdef \BodyLine {\the\inputlineno}%
+ \Cdef {body}{\Error{Command <body> already used on line \BodyLine;}%
+ {this use of <body> was ignored.}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\BodyError}
+% If the user has forgotten the \stenv{body} environment, the first
+% text paragraph will trigger the \cs{BodyError} macro.
+% \begin{macrocode}
+\def \BodyError {\message{^^JThis is StarTeX, version \CodeVersion^^J}%
+ \Error{A <body>...</body> environment should surround
+ the whole document.}{A missing <body> was inserted.}%
+ \global\everypar = {\NewPar }}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{</body>}
+% \stcs{/body} is used to terminate the document. This involves two things:
+% \begin{enumerate}
+% \item the current page must be terminated, and
+%
+% \item the \texttt{.aux} file must be check to determine whether any
+% references have changed.
+% The \texttt{.aux} file must be checked if both
+% \begin{itemize}
+% \item an \texttt{.aux} file has been read (\cs{ifAuxRead} is true),
+% and
+%
+% \item a new \texttt{.aux} file has been created (\cs{ifAuxOpen} is
+% true).
+% \end{itemize}
+% If we already know that a rerun is necessary (because \cs{ifRerun}
+% is true), there is no need to check the \texttt{.aux} file.
+% \end{enumerate}
+% \begin{macrocode}
+\Cdef {/body}{\EndEnvir{body}\endgraf\vfill\supereject
+ \let \Next = \CheckAux
+ \ifRerun \let \Next = \relax \fi
+ \ifAuxRead \else \let \Next = \relax \fi
+ \ifAuxOpen \else \let \Next = \relax \fi
+ \Next
+% \end{macrocode}
+% Give a warning if rerunning \starTeX{} is necessary.
+% \begin{macrocode}
+ \ifRerun \Warning{Cross-references are not correct;}%
+ {please run StarTeX again.}\fi
+% \end{macrocode}
+% And now, we can finally terminate the run.
+% \begin{macrocode}
+ \end}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Paragraph breaking}
+% \begin{macro}{<p>}
+% The \starTeX{} command \stcs{p} is used to separate paragraphs:
+% \begin{macrocode}
+\Cdef {p}{\endgraf}
+% \end{macrocode}
+% \end{macro}
+% Blank lines are just ignored:
+% \begin{macrocode}
+\def \par {}
+% \end{macrocode}
+% \starTeX{} uses parameters which allow rather sloppy paragraph
+% setting:
+% \begin{macrocode}
+\pretolerance = 2500 \tolerance = 9999 \hbadness = 10000
+\emergencystretch = 3cm
+% \end{macrocode}
+% The reasons for this are:
+% \begin{itemize}
+% \item If a good set of breaks is possible, \TeX{} will still choose
+% that.
+%
+% \item If no good breaks are possible, it is better to have a sloppily
+% set paragraph than problem lines sticking into the margin. The
+% potential users of \starTeX{} tend to just ignore messages about
+% overfull boxes.
+% \end{itemize}
+% Note, however, that \cs{hfuzz} has not been increased, as such a
+% change is immediately visible and gives a poor impression.
+%
+% \subsubsection{Paragraph indentation}
+% The paragraph handling mechanism must be able to let some paragraphs
+% be indented and others not; for instance, the first paragraph
+% following a title should not be indented, while the subsequent
+% ones should be.
+%
+% In \starTeX{} this is solved by disabling the original
+% \cs{parindent} and instead insert a call on \cs{NewPar} at
+% the start of every paragraph. However, \cs{everypar} is initialized
+% to \cs{BodyError} to detect a missing \stenv{body} environment; the
+% \stcs{body} command will set \cs{everypar} correctly.
+% \begin{macrocode}
+\parindent = 0pt \everypar = {\BodyError }
+% \end{macrocode}
+% \begin{macro}{\NewPar}
+% This \cs{NewPar} inserts an indentation \cs{ParIndent} wide if
+% \cs{ifIndent} is true.\footnote{We cannot use the standard
+% \cs{parindent} to this, as that is inserted when the
+% paragraph is started, in other words before \cs{NewPar} is
+% called.} It also sets \cs{ifIndent} to true, ensuring the
+% indentation of subsequent paragraphs. \cs{NewPar} sets \cs{parskip}
+% to its standard current value \cs{CurParSkip}.
+% \begin{macrocode}
+\def \NewPar {\ifIndent \kern \ParIndent \fi \Indenttrue
+ \global\parskip = \CurParSkip }
+% \end{macrocode}
+% \end{macro}
+% (In some environments, like \stenv{list}, no paragraphs are
+% indented. By setting \cs{ParIndent} to 0~pt, the whole paragraph
+% indentation mechanism is disabled.)
+%
+% \begin{macro}{\ParIndent}
+% \begin{macro}{\ifIndent}
+% \begin{macro}{\StdParIndent}
+% We must declare \cs{ParIndent} and \cs{ifIndent}, and also
+% \cs{StdParIndent} which holds the value to which \cs{ParIndent} is
+% set when it is not 0:
+% \begin{macrocode}
+\newskip \ParIndent \def \StdParIndent {1em}
+\newif \ifIndent
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Paragraph separation}
+% Sometimes it is necessary to omit the paragraph
+% separation (the vertical space inserted between every paragraph),
+% for instance after having inserted some special vertical space. This
+% is done by setting \cs{parskip} to 0~pt. The following paragraph
+% will reset this to \cs{CurParSkip} so that subsequent paragraphs
+% will have the standard separation; see the definition of \cs{NewPar}
+% above.
+%
+% \begin{macro}{\CurParSkip}
+% \cs{CurParSkip} must be defined:
+% \begin{macrocode}
+\newskip \CurParSkip
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\AddVspace}
+% Several insertions of vertical space (with \cs{vskip}) should not
+% just accumulate; this will lead to excessive vertical spacing.
+% Instead, \cs{AddVspace} should be used; it inserts the maximum of
+% the last space (if any) and the current one, and it also sets
+% \cs{parskip} to 0~pt so that the automatic paragraph separation will
+% not interfere.
+% \begin{macrocode}
+\def \AddVspace #1{\ifvmode \else \endgraf \fi
+ \skip1 = #1\relax
+ \ifdim \lastskip < \skip1 \relax
+ \ifdim \lastskip > 0pt \vskip -\lastskip \fi
+ \vskip \skip1
+ \fi \parskip = 0pt \relax }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{The document head}
+% This section implements the various commands used at the start of
+% the document.
+%
+% \begin{macro}{<title>}
+% \begin{macro}{</title>}
+% \stenv{title} is used to set the document title. It is centered, and
+% uses the biggest fonts available.
+% \begin{macrocode}
+\Cdef {title}{\AddVspace{30pt plus 10pt}
+ \NewEnvir{title}{\begingroup}{\endgraf\endgroup}
+ \leftskip = 2cm plus 1fill \rightskip = \leftskip
+ \ParIndent = 0pt \CurParSkip = 0pt
+ \ResetFont \SetSize{X}}
+\Cdef {/title}{\EndEnvir{title}%
+ \AddVspace{20pt plus 4pt}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<author>}
+% \begin{macro}{</author>}
+% \stenv{author} is used for the author's name. It is set like
+% \stenv{title}, but uses a smaller font.
+% \begin{macrocode}
+\Cdef {author}{\AddVspace{10pt plus 3pt}
+ \NewEnvir{author}{\begingroup}{\endgraf\endgroup}
+ \leftskip = 2cm plus 1fill \rightskip = \leftskip
+ \ParIndent = 0pt \CurParSkip = 0pt
+ \ResetFont \SetSize{L}}
+\Cdef {/author}{\EndEnvir{author}%
+ \AddVspace{20pt plus 4pt}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<info>}
+% \begin{macro}{</info>}
+% \stenv{info} is used for additional information, like the date. It
+% is centered, but uses the normal text font.
+% \begin{macrocode}
+\Cdef {info}{\AddVspace{10pt plus 3pt}
+ \NewEnvir{info}{\begingroup}{\endgraf\endgroup}
+ \leftskip = 2cm plus 1fill \rightskip = \leftskip
+ \ParIndent = 0pt \CurParSkip = 0pt
+ \ResetFont \SetSize{N}}
+\Cdef {/info}{\EndEnvir{info}%
+ \AddVspace{20pt plus 4pt}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<abstract>}
+% \begin{macro}{</abstract>}
+% \stenv{abstract} is used for the short abstract usually given with
+% each document. It is set with indented margins, and the type is
+% smaller than the text type. The word `Abstract' is set in boldface.
+% \begin{macrocode}
+\Cdef {abstract}{\AddVspace{10pt plus 3pt}
+ \NewEnvir{abstract}{\begingroup}{\endgraf\endgroup}
+ \ResetFont \def \FontBold{B} \SetSize{S} \CurParSkip = 0pt
+ \leftskip = 2cm \rightskip = \leftskip \Indentfalse
+ \centerline{\AbstractName}
+ \ResetFont \SetSize{S}\Indentfalse }
+\Cdef {/abstract}{\EndEnvir{abstract}%
+ \AddVspace{10pt plus 2pt}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Sectioning commands}
+% To keep track of the section numbers, we need four counters:
+% \begin{macrocode}
+\newcount \SectI \newcount \SectII
+\newcount \SectIII \newcount \SectIV
+% \end{macrocode}
+% \begin{macro}{\Heading}
+% Since most of the work of a sectioning command is the same
+% irrespective of its level, the common code has been place in
+% \cs{Heading} which has four parameters: "#1" is the vertical space
+% before the section, "#2" is the font size (\texttt{N}, \texttt{L} or
+% \texttt{X}), "#3" tells whether to use bold type or not (\texttt{B}
+% or \texttt{M}), and "#4" is the \TeX{} command to produce the
+% section number.
+% \begin{macrocode}
+\def \Heading #1#2#3#4{\AddVspace{#1}
+ \def \FontBold {#3} \SetSize{#2}
+ \setbox0 = \hbox{#4\kern 0.5\baselineskip}
+ \hangindent = \wd0 \hangafter = 1 \raggedright
+ \ParIndent = 0pt \CurParSkip = 0pt \leavevmode \box0 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{<h1>}
+% \stcs{H1} must update the counters and add vertical space. The rest
+% of the work is done by \cs{Heading}.
+% \begin{macrocode}
+\Cdef {h1}{\endgraf
+ \global\advance \SectI by 1
+ \global\SectII = 0 \global\SectIII = 0 \global\SectIV = 0
+ \edef \CurDef {\SectIim}
+ \NewEnvir{h1}{\begingroup}{\endgroup}
+ \Heading{24pt plus 12pt minus 3pt}{X}{B}{\SectIim}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{</h1>}
+% \stcs{/H1} terminates the heading. It adds some vertical space
+% (protcted with a top \cs{penalty} so that a page break will never
+% occur) and sets \cs{Indentfalse} to prevent indentation of the
+% following line.
+% \begin{macrocode}
+\Cdef {/h1}{\endgraf
+ \nobreak\vskip 6pt plus 1.5pt
+ \EndEnvir{h1} \Indentfalse }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{<h2>}
+% \begin{macro}{</h2>}
+% \stcs{H2} and \stcs{/h2} work more or less like \stcs{h1} and
+% \stcs{/h1}:
+% \begin{macrocode}
+\Cdef {h2}{\endgraf
+ \global\advance \SectII by 1
+ \global\SectIII = 0 \global\SectIV = 0
+ \edef \CurDef {\SectIIim}
+ \NewEnvir{h2}{\begingroup}{\endgroup}
+ \Heading{14pt plus 7pt minus 2pt}{L}{B}{\SectIIim}}
+\Cdef {/h2}{\endgraf
+ \nobreak\vskip 4pt plus 1pt
+ \EndEnvir{h2}\Indentfalse }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<h3>}
+% \begin{macro}{</h3>}
+% \stcs{H3} and \stcs{/h3} work more or less like the two preceding
+% ones:
+% \begin{macrocode}
+\Cdef {h3}{\endgraf
+ \global\advance \SectIII by 1 \global\SectIV = 0
+ \edef \CurDef {\SectIIIim}
+ \NewEnvir{h3}{\begingroup}{\endgroup}
+ \Heading{10pt plus 5pt minus 1pt}{N}{B}{\SectIIIim}}
+\Cdef {/h3}{\endgraf
+ \nobreak\vskip 2pt plus 1pt
+ \EndEnvir{h3}\Indentfalse }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<h4>}
+% \begin{macro}{</h4>}
+% \stcs{H4} and \stcs{/h4} are slightly different from the previous
+% ones in that they use a run-in title (the text continues on the same
+% line as the title):
+% \begin{macrocode}
+\Cdef {h4}{\AddVspace{8pt plus 4pt minus 1pt}
+ \global\advance \SectIV by 1
+ \edef \CurDef {\SectIVim}
+ \NewEnvir{h4}{\begingroup}{\endgroup}
+ \def \FontBold{B}\SelectFont \Indentfalse \SectIVim }
+\Cdef {/h4}{\kern 0.5\baselineskip
+ \EndEnvir{h4}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Lists}
+% \begin{macro}{<list>}
+% \begin{macro}{</list>}
+% The \stenv{list} environment increases the left margin and sets the
+% item counter to 0; everything
+% else is handled by the various kinds of \cs{item}.
+% \begin{macrocode}
+\Cdef {list}{\AddVspace{\ListSkip}
+ \NewEnvir{list}{\begingroup}{\endgroup}
+ \advance \leftskip by \ListIndent
+ \Indentfalse \CurParSkip = \ListSkip \ParIndent = 0pt
+ \ItemCount = 0 }
+\Cdef {/list}{\endgraf
+ \EndEnvir{list} \Indentfalse }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{<item>}
+% \stcs{item} inserts a bulleted item.
+% \begin{macrocode}
+\Cdef {item}{\endgraf \Indentfalse
+ \leavevmode\llap{\BulletItemFormat}\ignorespaces }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{<numitem>}
+% \stcs{numitem} gives a numbered item.
+% \begin{macrocode}
+\Cdef {numitem}{\endgraf
+ \advance \ItemCount by 1 \edef \CurDef {\the\ItemCount}
+ \Indentfalse
+ \leavevmode\llap{\NumItemFormat{\ItemCount}}\ignorespaces }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ItemCount}
+% The item counter \cs{ItemCount} must also be declared:
+% \begin{macrocode}
+\newcount \ItemCount
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{<textitem>}
+% \begin{macro}{</textitem>}
+% The \stenv{textitem} environment starts another item with a bold
+% text.
+% \begin{macrocode}
+\Cdef {textitem}{\endgraf
+ \NewEnvir{textitem}{\begingroup}{\endgroup}
+ \def \FontBold {B}\SelectFont \leavevmode \kern -\ListIndent
+ \ignorespaces }
+\Cdef {/textitem}{\unskip
+ \EndEnvir{textitem}%
+ \hskip 1em \ignorespaces }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Displays}
+% \begin{macro}{<display>}
+% \begin{macro}{</display>}
+% A \stenv{display} environment is implemented by increasing both
+% margins.
+% \begin{macrocode}
+\Cdef {display}{\AddVspace{\DisplayPreSkip}
+ \NewEnvir{display}{\begingroup}{\endgroup}%
+ \advance \leftskip by \DisplayIndent
+ \advance \rightskip by \DisplayIndent
+ \CurParSkip = \DisplayParSkip \ParIndent = 0pt \relax }
+\Cdef {/display}{\AddVspace{\DisplayPostSkip}
+ \EndEnvir{display}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Code}
+% Handling code like computer programs is quite easy. It involves
+% \begin{itemize}
+% \item changing "<"'s \cs{catcode} into that of an ordinary
+% character,
+%
+% \item making space and end-of-lines into active characters with a
+% suitable definition, and
+%
+% \item selecting a fixed-width font and a suitable leading.
+% \end{itemize}
+% It is necessary to remember whether the code followed a "<p>".
+% If so, some vertical space will be added before and after the code.
+% \begin{macrocode}
+\newif \ifCodePar
+% \end{macrocode}
+% \begin{macro}{\CodeSetup}
+% All the initialization is handled by the \cs{CodeSetup} macro:
+% \begin{macrocode}
+\def \CodeSetup {\ifvmode \CodePartrue \AddVspace{\DisplayPreSkip}
+ \else \CodeParfalse \fi
+ \def\FontKind{T}\SelectFont
+ \baselineskip = \CodeSkipN \CurParSkip = 0pt \ParIndent = 0pt
+ \catcode`\< = 12 \frenchspacing \obeylines \obeyspaces }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\obeylines}
+% Plain \TeX's definition of \cs{obeylines} must be redefined since
+% \cs{par} has been changed:
+% \begin{macrocode}
+\begingroup
+ \catcode`\^^M = \active %
+ \gdef\obeylines{\catcode`\^^M=\active \def^^M{\endgraf\leavevmode}}%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\obeyspaces}
+% The appearance of a space when \cs{obeyspaces} is
+% in effect must also be modified. By inserting a \cs{leavevmode}, we
+% will not lose spaces at the beginning of a line.
+% \begin{macrocode}
+\begingroup
+ \obeyspaces\gdef {\leavevmode\space}%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CodeFinish}
+% After the code, \cs{CodeFinish} is called to terminate the mode.
+% It adds the needed vertical space.
+% \begin{macrocode}
+\def \CodeFinish {\ifCodePar
+ \def \Next {\endgraf \vskip -\baselineskip \vskip \DisplayPostSkip
+ \global\Indentfalse }%
+ \else
+ \let \Next = \relax
+ \fi \Next }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{<code>}
+% Time has come to write the user interface. The \stenv{code}
+% environment reads the code as parameter to the command \cs{ReadCode}.
+% \begin{macrocode}
+\Cdef {code}{\NewEnvir{code}{\begingroup}{\endgroup}%
+ \CodeSetup \ReadCode }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReadCode}
+% \begin{macro}{</code>}
+% \cs{ReadCode} just inserts the code (which is parameter "#1")
+% and terminates the environment.
+% \begin{macrocode}
+\begingroup
+ \catcode `\< = 12
+ \gdef \ReadCode #1</code>{#1\CodeFinish\EndEnvir{code}}%
+\endgroup
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<codefile>}
+% \stcs{codefile} checks for correct syntax. If the file name is given
+% properly, \cs{ReadCodeFile} is called to perform the actual reading.
+% \begin{macrocode}
+\Cdef {codefile}{\IfNextChar{[}%
+ {\ReadCodeFile}%
+ {\Error{No code file name given;}%
+ {the syntax is <codefile>[file name].}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\ReadCodeFile}
+% \cs{ReadCodeFile} just reads the specified file
+% \begin{macrocode}
+\def \ReadCodeFile [#1]{\endgraf \begingroup
+ \CodeSetup
+ \IfFileExists{#1}{\input #1}%
+ {\Error{Code file `#1' cound not be found.}{}}
+ \CodeFinish \endgroup }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Footnotes}
+% \begin{macro}{<footnote>}
+% \begin{macro}{</footnote>}
+% Implementing footnotes is easy, as the mechanism is ready in plain
+% \TeX\@.
+% \begin{macrocode}
+\Cdef {footnote}{\NewEnvir{footnote}%
+ {\global\advance \FootnoteCnt by 1
+ \footnote{\FootnoteIm{\FootnoteCnt}}\bgroup
+ \edef \CurDef {\the\FootnoteCnt}}%
+ {\egroup}%
+ \ResetFont \SetSize{S}}
+\Cdef {/footnote}{\EndEnvir{footnote}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\FootnoteCnt}
+% We must remember to declare the footnote counter:
+% \begin{macrocode}
+\newcount \FootnoteCnt
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Page headers and footers}
+% By default, \starTeX{} has the same headers and footer as \TeX\@.
+% The footer must, however, be redefined so that it always uses the
+% same font as the body text.
+% \begin{macrocode}
+\footline = {\ResetFont\SelectFont \hfil \folio \hfil}
+% \end{macrocode}
+%
+% \subsection{Customization}
+% This section contains definitions that are likely to be changed in
+% local adaptions.
+%
+% \subsubsection{Sizes}
+% \begin{macro}{\DisplayIndent}
+% \begin{macro}{\DisplayParSkip}
+% \begin{macro}{\DisplayPostSkip}
+% \begin{macro}{\DisplayPreskip}
+% The following four sizes determine the appearance of displays.
+% \begin{macrocode}
+\def \DisplayIndent {\ListIndent}
+\def \DisplayParSkip {\ListParSkip}
+\def \DisplayPostSkip {5pt plus 2pt minus 1pt\relax}
+\def \DisplayPreSkip {5pt plus 2pt minus 1pt\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\ListIndent}
+% \begin{macro}{\ListParSkip}
+% \begin{macro}{\ListSkip}
+% The next three are used when setting lists.
+% \begin{macrocode}
+\def \ListIndent {25pt\relax}
+\def \ListParSkip {\ListSkip}
+\def \ListSkip {10pt plus 2pt minus 1pt\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Formats}
+% \begin{macro}{\SectIim}
+% \begin{macro}{\SectIIim}
+% \begin{macro}{\SectIIIim}
+% \begin{macro}{\SectIVim}
+% \cs{SetcIim}, \cs{SectIIim}, \cs{SectIIIim} and \cs{SectIVim} define
+% what the section number at various levels should look
+% like.
+% \begin{macrocode}
+\def \SectIim {\the\SectI}
+\def \SectIIim {\SectIim.\the\SectII}
+\def \SectIIIim {\SectIIim.\the\SectIII}
+\def \SectIVim {\SectIIIim.\the\SectIV}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\FootnoteIm}
+% \cs{FootnoteIm} defines the appearance of the footnote mark; "#1" is
+% the footnote number.
+% \begin{macrocode}
+\def \FootnoteIm #1{$^{\the #1}$}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\FigIm}
+% \begin{macro}{\TabIm}
+% \cs{FigIm} and \cs{TabIm} define the appearance of the figure and
+% table counters, respectively.
+% \begin{macrocode}
+\def \FigIm {\the\FigCnt}
+\def \TabIm {\the\TabCnt}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\BulletItemFormat}
+% \begin{macro}{\NumItemFormat}
+% The two commands \cs{BulletItemFormat} and \cs{NumItemFormat} define
+% the appearance of the marks used by \stcs{item} and \stcs{numitem},
+% respectively.
+% \begin{macrocode}
+\def \BulletItemFormat {$\bullet$\kern 6pt\relax}
+\def \NumItemFormat #1{\the#1.\kern 4pt\relax}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Character set}
+% This version of \starTeX{} uses \textsc{iso}~8859-1 as its standard
+% character set. (Users of other character sets will have to modify
+% this.)
+%
+% \begin{macro}{\E}
+% \cs{E} is used to redefine the encoding of a character; this is
+% done by making the character active. "#1" is the character's number,
+% and "#2" is the \TeX{} code to which it is to be defined.
+% The implementation of \cs{E} uses the standard technique of
+% defining a \cs{uccode} and then calling \cs{uppercase} to
+% insert the correct character where it is defined.)
+% \begin{macrocode}
+\def \E #1#2{\catcode#1 = \active
+ \begingroup \uccode`\~ = #1\uppercase{\endgroup \def ~{#2}}}
+% \end{macrocode}
+% \end{macro}
+% There are five different kinds of reencoding:
+% \begin{itemize}
+% \item Some characters are reencoded to a different character in the
+% same font using the \cs{char} primitive; examples are
+% 161~({\StdECR \symbol{189}}) and 163~({\StdECR \symbol{191}}).
+% \end{itemize}
+% \begin{macrocode}
+\E{161}{\char189 } \E{163}{\char191 } \E{167}{\char159 }
+\E{171}{\char19 } \E{184}{\char11 } \E{187}{\char20 }
+\E{191}{\char190 } \E{223}{\char255 } \E{255}{\char184 }
+% \end{macrocode}
+%
+% \begin{macro}{\CC}
+% \begin{itemize}
+% \item Other characters can be found in the \emph{Companion font},
+% known to \starTeX{} as the Alternate font. The macro \cs{CC} is
+% used for this; its parameter "#1" is the character's position in the
+% companion font. Examples are 162~({\CompECR \symbol{162}}) and
+% 164~({\CompECR \symbol{164}}).
+% \end{itemize}
+% \begin{macrocode}
+\def \CC #1{{\def\FontAlt{A}\SelectFont \char#1}}
+\E{162}{\CC{162}} \E{164}{\CC{164}} \E{165}{\CC{165}}
+\E{166}{\CC{166}} \E{168}{\CC{168}} \E{169}{\CC{169}}
+\E{170}{\CC{170}} \E{172}{\CC{172}} \E{174}{\CC{174}}
+\E{175}{\CC{175}} \E{176}{\CC{176}} \E{180}{\CC{180}}
+\E{182}{\CC{182}} \E{186}{\CC{186}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MC}
+% \begin{itemize}
+% \item A few characters are math characters, like 185~({\CompECR
+% \symbol{185}}) and 246~({\CompECR \symbol{246}}). They are defined using
+% the macro \cs{MC} which has two parameters: "#1" is the character's
+% position in the companion font to be used in text mode, and
+% "#2" is some \TeX{} code to be used in math mode.
+% \end{itemize}
+% \begin{macrocode}
+\def \MC #1#2{\ifmmode #2 \else \CC{#1}\fi }
+\E{177}{\MC{177}{\pm}} \E{178}{\MC{178}{^2{}}}
+\E{179}{\MC{179}{^3{}}} \E{181}{\MC{181}{\mu}}
+\E{183}{\MC{183}{\cdot}} \E{185}{\MC{185}{^1{}}}
+\E{188}{\MC{188}{{1\over4}}} \E{189}{\MC{189}{{1\over2}}}
+\E{190}{\MC{190}{{3\over4}}} \E{215}{\MC{214}{\times}}
+\E{247}{\MC{246}{\div}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{itemize}
+% \item Character 160 is a ``non-break space'' which is treated just
+% like a \textasciitilde{} in \TeX.
+% \end{itemize}
+% \begin{macrocode}
+\E{160}{\nobreak\ }
+% \end{macrocode}
+%
+% \begin{itemize}
+% \item Character 173 is a ``soft hyphen'' which is treated like "\-"
+% in \TeX.
+% \end{itemize}
+% \begin{macrocode}
+\E{173}{\-}
+% \end{macrocode}
+%
+% \subsubsection{Language-specific definitions}
+% \begin{macro}{\Abstractname}
+% \begin{macro}{\Figurename}
+% \begin{macro}{\Tablename}
+% These three names vary from one language to another.
+% \begin{macrocode}
+\def \AbstractName {Abstract}
+\def \FigureName {Figure}
+\def \TableName {Table}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\TimeSep}
+% Not all languages use a ``\texttt{:}'' to separate the hours,
+% minutes, and seconds.
+% \begin{macrocode}
+\def \TimeSep {:}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{<today>}
+% \begin{macro}{\Month}
+% \begin{macro}{\Th}
+% The \stcs{today} command should be redefined for each language.
+% To simplify the code, two auxiliary macros are defined: \cs{Month}
+% gives the name of the month, and \cs{Th} gives the correct suffix
+% for the day of the month.
+% \begin{macrocode}
+\Cdef {today}{\the\day\Th{\day} \Month\space\the\year}
+\def \Month {\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 \Th #1{%
+ \ifnum #1=1 st\else\ifnum #1=21 st\else\ifnum #1=31 st\else
+ \ifnum #1=2 nd\else\ifnum #1=22 nd\else
+ \ifnum #1=3 rd\else\ifnum #1=23 rd\else th\fi\fi\fi\fi\fi\fi\fi }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<now>}
+% The \stcs{now} command will quite probably remain unchanged for most
+% languages (except for the \cs{TimeSep}; see above), but is given
+% here just the same.
+% \begin{macrocode}
+\Cdef {now}{\Minutes = \time \Hours = \Minutes
+ \divide \Hours by 60 \Htemp = \Hours \multiply \Htemp by -60
+ \advance \Minutes by \Htemp
+ \the\Hours \TimeSep \ifnum \Minutes > 9 \else 0\fi \the\Minutes }
+% \end{macrocode}
+% The three counters used by \stcs{now} must be defined.
+% \begin{macrocode}
+\newcount \Minutes \newcount \Hours \newcount \Htemp
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Math mode}
+% A few modifications to the \TeX{} math mode are necessary.
+%
+% The "<" character must be active also in math mode.
+% \begin{macrocode}
+\mathcode`< = "8000
+% \end{macrocode}
+% \begin{macro}{<math>}
+% \begin{macro}{</math>}
+% The inline math mode "$"\dots"$" is called \stenv{math} in \starTeX.
+% \begin{macrocode}
+\Cdef {math}{\MathFonts \NewEnvir{math}{$}{$}}
+\Cdef {/math}{\EndEnvir{math}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{<displaymath>}
+% \begin{macro}{</displaymath>}
+% The display math environment "$$"\dots"$$" is also available in
+% \starTeX{} using the notation \stenv{displaymath}.
+% \begin{macrocode}
+\Cdef {displaymath}{\endgraf \MathFonts \NewEnvir{displaymath}{$$}{$$}}
+\Cdef {/displaymath}{\EndEnvir{displaymath}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Math fonts}
+% \begin{macro}{\MSetFont}
+% The \cs{MSetFont} macro is used to simplify the definition of math
+% fonts. It takes two parameters: "#1" is the math font element being
+% defined (i.e., \cs{textfont0}), and "#2" is the font name.
+% \begin{macrocode}
+\def \MSetFont #1#2{\font \NewMFont = \csname #2\endcsname
+ #1 = \NewMFont }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\MathFonts}
+% The \cs{MathFonts} macro is called whenever math mode is entered. It
+% will define all the required math fonts. To avoid unnecessary work,
+% new fonts will only be assigned if the font size has changed since
+% the last time.
+% \begin{macrocode}
+\def \MathFonts {\if \FontSize \LastMathSize \else
+ \MSetFont{\textfont0}{M-\FontSize N0}%
+ \MSetFont{\scriptfont0}{M-\FontSize S0}%
+ \MSetFont{\scriptscriptfont0}{M-\FontSize X0}%
+ \MSetFont{\textfont1}{M-\FontSize N1}%
+ \MSetFont{\scriptfont1}{M-\FontSize S1}%
+ \MSetFont{\scriptscriptfont1}{M-\FontSize X1}%
+ \MSetFont{\textfont2}{M-\FontSize N2}%
+ \MSetFont{\scriptfont2}{M-\FontSize S2}%
+ \MSetFont{\scriptscriptfont2}{M-\FontSize X2}%
+ \MSetFont{\textfont3}{M-\FontSize N3}%
+ \MSetFont{\scriptfont3}{M-\FontSize S3}%
+ \MSetFont{\scriptscriptfont3}{M-\FontSize X3}%
+ \MSetFont{\textfont4}{M-\FontSize N4}%
+ \MSetFont{\scriptfont4}{M-\FontSize S4}%
+ \MSetFont{\scriptscriptfont4}{M-\FontSize X4}%
+ \MSetFont{\textfont5}{M-\FontSize N5}%
+ \MSetFont{\scriptfont5}{M-\FontSize S5}%
+ \MSetFont{\scriptscriptfont5}{M-\FontSize X5}%
+ \MSetFont{\textfont6}{M-\FontSize N6}%
+ \MSetFont{\scriptfont6}{M-\FontSize S6}%
+ \MSetFont{\scriptscriptfont6}{M-\FontSize X6}%
+ \let \LastMathSize = \FontSize
+ \fi }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LastMathSize}
+% \cs{LastMathSize} contains the last math size used. It
+% must be initialized to an unused value so that the math fonts are
+% always loaded the first time math mode is entered.
+% \begin{macrocode}
+\def \LastMathSize {?}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Letters}
+% The standard 26 letters are already defined, but we must define the
+% others, like `\'e' and `\AA'. These are taken from the \textsc{ecti}
+% font (number~5 in \starTeX).
+% \begin{macrocode}
+\def \Df #1{\mathcode"#1 = "05#1 \relax }
+\Df{C0}\Df{C1}\Df{C2}\Df{C3}\Df{C4}\Df{C5}\Df{C6}\Df{C7}
+\Df{C8}\Df{C9}\Df{CA}\Df{CB}\Df{CC}\Df{CD}\Df{CE}\Df{CF}
+\Df{D0}\Df{D1}\Df{D2}\Df{D3}\Df{D4}\Df{D5}\Df{D6}
+\Df{D8}\Df{D9}\Df{DA}\Df{DB}\Df{DC}\Df{DD}\Df{DE}\Df{DF}
+\Df{E0}\Df{E1}\Df{E2}\Df{E3}\Df{E4}\Df{E5}\Df{E6}\Df{E7}
+\Df{E8}\Df{E9}\Df{EA}\Df{EB}\Df{EC}\Df{ED}\Df{EE}\Df{EF}
+\Df{F0}\Df{F1}\Df{F2}\Df{F3}\Df{F4}\Df{F5}\Df{F6}
+\Df{F8}\Df{F9}\Df{FA}\Df{FB}\Df{FC}\Df{FD}\Df{FE}\Df{FF}
+% \end{macrocode}
+%
+% \subsubsection{Bold letters}
+% \begin{macro}{<bolda>}
+% \begin{macro}{<bolducA>}
+% The bold letters \stcs{bolda}\dots\stcs{boldz} and
+% \stcs{bolducA}\dots\stcs{bolducZ} are intended for use i math mode.
+% They are found on the \textsc{cmbx} font (number~4 in \starTeX).
+% \changes{1.04}{1999/03/10}{Added \stcs{bolda}, \stcs{bolducA}, and
+% related commands.}
+% \begin{macrocode}
+\def \Df #1#2#3{\Cdef{bold#1}{\MSy{\mathchar"04#2}}%
+ \Cdef{bolduc#1}{\MSy{\mathchar"04#3}}}
+\Df{a}{61}{41}\Df{b}{62}{42}\Df{c}{63}{43}\Df{d}{64}{44}
+\Df{e}{65}{45}\Df{f}{66}{46}\Df{g}{67}{47}\Df{h}{68}{48}
+\Df{i}{69}{49}\Df{j}{6A}{4A}\Df{k}{6B}{4B}\Df{l}{6C}{4C}
+\Df{m}{6D}{4D}\Df{n}{6E}{4E}\Df{o}{6F}{4F}\Df{p}{70}{50}
+\Df{q}{71}{51}\Df{r}{72}{52}\Df{s}{73}{53}\Df{t}{74}{54}
+\Df{u}{75}{55}\Df{v}{76}{56}\Df{w}{77}{57}\Df{x}{78}{58}
+\Df{y}{79}{59}\Df{z}{7A}{5A}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Operators}
+% \begin{macro}{\MSy}
+% \cs{MSy} is used to insert a mathematical symbol. It will expand to
+% "#1", and insert a math mode environment ("$"\dots"$") if required.
+% \begin{macrocode}
+\def \MSy #1{\ifmmode #1\else $#1$\fi }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\MOp}
+% \cs{MOp} is also used to insert the mathematical symbol "#2", but
+% gives an error message if not in a math environment. Parameter "#1"
+% is the \starTeX{} command name, which is used in the error message.
+% \begin{macrocode}
+\def \MOp #1#2{\ifmmode \def \MNext {#2}\else
+ \Error{Command <#1> is only allowed in math mode;}%
+ {command ignored.}\let \MNext = \relax \fi
+ \MNext }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Mdef}
+% \cs{Mdef} is used to define a \starTeX{} mathematical symbol
+% command whenever the \starTeX{} command is
+% identical to the name of the
+% corresponding \TeX{} macro; parameter "#1" is the name of both.
+% \begin{macrocode}
+\def \Mdef #1{\Cdef{#1}{\MSy{\csname #1\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Odef}
+% \cs{Odef} is similar to \cs{Mdef} but is for definitions based on
+% \cs{MOp} rather than \cs{MSy}.
+% \begin{macrocode}
+\def \Odef #1{\Cdef{#1}{\MOp{#1}{\csname #1\endcsname}}}
+% \end{macrocode}
+% \end{macro}
+% These commands are now used to define all the standard unary and
+% binary operators.
+% \begin{macrocode}
+\Mdef{amalg} \Mdef{bigcirc} \Mdef{bigtriangleup}
+\Mdef{bigtriangledown} \Mdef{bullet} \Mdef{cap} \Mdef{circ}
+\Mdef{cup} \Mdef{dagger} \Mdef{ddagger} \Mdef{diamond} \Mdef{mp}
+\Mdef{odot} \Mdef{ominus} \Mdef{oplus} \Mdef{oslash} \Mdef{otimes}
+\Mdef{setminus} \Mdef{sqcap} \Mdef{sqcup} \Mdef{star}
+\Mdef{triangleleft} \Mdef{triangleright} \Mdef{uplus} \Mdef{vee}
+\Mdef{wedge} \Mdef{wr}
+% \end{macrocode}
+%
+% \subsubsection{Relations}
+% These are the various relations available.
+% \changes{1.01}{1996/11/29}{Added forgotten operator \stcs{propto}.}
+% \begin{macrocode}
+\Mdef{approx} \Mdef{asymp} \Mdef{bowtie} \Mdef{cong} \Mdef{doteq}
+\Mdef{dashv} \Mdef{equiv} \Mdef{frown} \Mdef{geq} \Mdef{gg} \Mdef{in}
+\Mdef{leq} \Mdef{ll} \Mdef{mid} \Mdef{models} \Mdef{neq} \Mdef{ni}
+\Mdef{notin} \Mdef{parallel} \Mdef{perp} \Mdef{prec} \Mdef{preceq}
+\Mdef{propto} \Mdef{sim} \Mdef{simeq} \Mdef{smile} \Mdef{sqsubseteq}
+\Mdef{sqsupseteq} \Mdef{subset} \Mdef{subseteq} \Mdef{supset}
+\Mdef{supseteq} \Mdef{succ} \Mdef{succeq} \Mdef{vdash}
+% \end{macrocode}
+% \begin{macro}{<gt>}
+% \begin{macro}{<lt>}
+% The two symbols \stcs{gt} and \stcs{lt} must be defined; the former
+% is not really necessary, but is included for symmetry reasons. Note
+% also that the definition of \stcs{lt} is slightly tricky since "<"
+% is an active symbol in math mode.
+% \begin{macrocode}
+ \Cdef{gt}{>}
+ \Cdef{lt}{\ifmmode \mathchar"313C \else <\fi}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Delimitiers}
+% In addition to (), [], $\{\}$ and $\vert$, the following delimiters
+% are defined:
+% \begin{macrocode}
+\Mdef{langle} \Mdef{lceil} \Mdef{lfloor} \Mdef{rangle}
+\Mdef{rceil} \Mdef{rfloor}
+% \end{macrocode}
+%
+% \subsubsection{Arrows}
+% All the standard arrows are included.
+% \begin{macrocode}
+\Mdef{leftarrow} \Mdef{rightarrow} \Mdef{leftrightarrow}
+\Mdef{longleftarrow} \Mdef{longrightarrow} \Mdef{longleftrightarrow}
+\Mdef{uparrow} \Mdef{downarrow}
+\Mdef{updownarrow} \Mdef{nearrow} \Mdef{nwarrow} \Mdef{searrow}
+\Mdef{swarrow} \Mdef{mapsto} \Mdef{longmapsto} \Mdef{hookleftarrow}
+\Mdef{hookrightarrow} \Mdef{leftharpoonup} \Mdef{rightharpoonup}
+\Mdef{leftharpoondown} \Mdef{rightharpoondown} \Mdef{rightleftharpoons}
+% \end{macrocode}
+% In \TeX, some arrows use uppercase letters to indicate double
+% arrows. I use the prefix "double" instead.
+% \begin{macrocode}
+\Cdef{doubleleftarrow}{\MSy{\Leftarrow}}
+\Cdef{doublerightarrow}{\MSy{\Rightarrow}}
+\Cdef{doubleleftrightarrow}{\MSy{\Leftrightarrow}}
+\Cdef{doublelongleftarrow}{\MSy{\Longleftarrow}}
+\Cdef{doublelongrightarrow}{\MSy{\Longrightarrow}}
+\Cdef{doublelongleftrightarrow}{\MSy{\Longleftrightarrow}}
+\Cdef{doubleuparrow}{\MSy{\Uparrow}}
+\Cdef{doubledownarrow}{\MSy{\Downarrow}}
+\Cdef{doubleupdownarrow}{\MSy{\Updownarrow}}
+% \end{macrocode}
+%
+% \subsubsection{Big symbols}
+% These are the big symbols.
+% \begin{macrocode}
+\Odef{bigcap} \Odef{bigcup} \Odef{bigodot} \Odef{bigoplus}
+\Odef{bigotimes} \Odef{bigsqcup} \Odef{biguplus} \Odef{bigvee}
+\Odef{bigwedge} \Odef{int} \Odef{oint} \Odef{prod} \Odef{sum}
+% \end{macrocode}
+%
+% \subsubsection{Function names}
+% Some names are defined as commands to ensure that they will be
+% printed in the correct font.
+% \changes{1.01}{1996/11/29}{Name of \cs{sup} operator changed to
+% \stcs{sup-op} because of name clash with the \stcs{sup} command used
+% for indices. (Detected by Marco Paggi,
+% \textsf{aampaggi@input.lognet.it}.)}
+% \begin{macrocode}
+\Mdef{arccos} \Mdef{arcsin} \Mdef{arctan} \Mdef{arg} \Mdef{cos}
+\Mdef{cosh} \Mdef{cot} \Mdef{coth} \Mdef{csc} \Mdef{deg} \Mdef{det}
+\Mdef{dim} \Mdef{exp} \Mdef{gcd} \Mdef{hom} \Mdef{inf} \Mdef{ker}
+\Mdef{lg} \Mdef{lim} \Mdef{liminf} \Mdef{limsup} \Mdef{ln}
+\Mdef{log} \Mdef{max} \Mdef{min} \Mdef{sec} \Mdef{sin} \Mdef{sinh}
+\Cdef{sup-op}{\MSy{\sup}} \Mdef{tan} \Mdef{tanh}
+% \end{macrocode}
+% \stcs{pr} must be given a special definition as its name in plain \TeX{}
+% has an uppercase letter.
+% \begin{macrocode}
+\Cdef{pr}{\MSy{\Pr}}
+% \end{macrocode}
+%
+% \subsubsection{Greek letters}
+% The lowercase Greek letters can be found just using the plain \TeX{}
+% name.
+% \begin{macrocode}
+\Mdef{alpha} \Mdef{beta} \Mdef{gamma} \Mdef{delta} \Mdef{epsilon}
+\Mdef{varepsilon} \Mdef{zeta} \Mdef{eta} \Mdef{theta} \Mdef{vartheta}
+\Mdef{iota} \Mdef{kappa} \Mdef{lambda} \Mdef{mu} \Mdef{nu} \Mdef{xi}
+\Cdef {omicron}{\MSy{o}} \Mdef{pi} \Mdef{varpi} \Mdef{rho} \Mdef{varrho}
+\Mdef{sigma} \Mdef{varsigma} \Mdef{tau} \Mdef{upsilon} \Mdef{phi}
+\Mdef{varphi} \Mdef{chi} \Mdef{psi} \Mdef{omega}
+% \end{macrocode}
+% The uppercase Greek letters can be found in the \textsc{cmr}
+% font, which is font no 0 in \starTeX.
+% Those that also exist in the Latin alphabet, can be found in their
+% normal position, while the special Greek letters are placed at the
+% beginning of the font table.
+% \begin{macrocode}
+\def \Df #1#2{\Cdef{#1}{\MSy{\mathchar"#2}}}
+\Df{ucalpha}{0041} \Df{ucbeta}{0042} \Df{ucgamma}{0000}
+\Df{ucdelta}{0001} \Df{ucepsilon}{0045} \Df{uczeta}{005A}
+\Df{uceta}{0048} \Df{uctheta}{0002} \Df{uciota}{0049}
+\Df{uckappa}{004B} \Df{uclambda}{0003} \Df{ucmu}{004D}
+\Df{ucnu}{004E} \Df{ucxi}{0004} \Df{ucomicron}{004F}
+\Df{ucpi}{0005} \Df{ucrho}{0050} \Df{ucsigma}{0006}
+\Df{uctau}{0054} \Df{ucupsilon}{0007} \Df{ucphi}{0008}
+\Df{ucchi}{0058} \Df{ucpsi}{0009} \Df{ucomega}{000a}
+% \end{macrocode}
+%
+% \subsubsection{Blackboard set letters}
+% The socalled ``blackboard bold'' letters $\Bbb{C}$, $\Bbb{N}$,
+% $\Bbb{R}$ and $\Bbb{Z}$ are used to denote the standard sets.
+% \changes{1.03}{1998/04/30}{Added the various set names. (Suggested
+% by Christian Sommerfeldt \O{}ien, \textsf{christso@ifi.uio.no}.)}
+% \begin{macrocode}
+\def \Df #1#2{\Cdef{#1}{\MSy{\mathchar"06#2}}}
+\Df{cset}{43} \Df{nset}{4E} \Df{rset}{52} \Df{zset}{5A}
+% \end{macrocode}
+%
+% \subsubsection{Calligraphic letters}
+% \begin{macro}{cala}
+% The calligraphic letters can be found in font~2.
+% \changes{1.04}{1999/03/10}{Fixed a bug in the \stcs{calA} and
+% related commands.}
+% \begin{macrocode}
+\def \Df #1#2{\Cdef{cal#1}{\MSy{\mathchar"02#2}}}
+\Df{a}{41} \Df{b}{42} \Df{c}{43} \Df{d}{44} \Df{e}{45}
+\Df{f}{46} \Df{g}{47} \Df{h}{48} \Df{i}{49} \Df{j}{4A}
+\Df{k}{4B} \Df{l}{4C} \Df{m}{4D} \Df{n}{4E} \Df{o}{4F}
+\Df{p}{50} \Df{q}{51} \Df{r}{52} \Df{s}{53} \Df{t}{54}
+\Df{u}{55} \Df{v}{56} \Df{w}{57} \Df{x}{58} \Df{y}{59}
+\Df{z}{5A}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Other symbols}
+% A few symbols are left.
+% \begin{macrocode}
+\Mdef{aleph} \Mdef{angle} \Mdef{bot} \Mdef{ell} \Mdef{emptyset}
+\Mdef{exists} \Mdef{forall} \Mdef{hbar} \Mdef{nabla} \Mdef{neg}
+\Odef{not} \Mdef{partial} \Mdef{surd} \Mdef{top} \Mdef{wp}
+\Cdef{infinity}{\MSy{\infty}} \Cdef{im}{\MSy{\Im}} \Cdef{re}{\MSy{\Re}}
+\Cdef{,}{{,}}
+\Cdef{:}{\MSy{\vdots}}
+\Cdef{:::}{\MSy{\cdots}}
+% \end{macrocode}
+% \begin{macro}{<...>}
+% The definition of \stcs{...} has a minute space to allow \starTeX{}
+% to split the line.
+% \begin{macrocode}
+\Cdef{...}{\MSy{\ldots}\hskip 0.001pt \relax }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Subscripts and superscripts}
+% \begin{macro}{<sub>}
+% \begin{macro}{</sub>}
+% \begin{macro}{<sup>}
+% \begin{macro}{</sup>}
+% The sub- and superscripts in equations are accessible through
+% \stenv{sub} and \stenv{sup}.
+% \begin{macrocode}
+\Cdef {sub}{\MOp{sub}{\NewEnvir{sub}{_\bgroup}{\egroup}}}
+\Cdef {/sub}{\MOp{/sub}{\EndEnvir{sub}}}
+\Cdef {sup}{\MOp{sup}{\NewEnvir{sup}{^\bgroup}{\egroup}}}
+\Cdef {/sup}{\MOp{/sup}{\EndEnvir{sup}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Fractions}
+% \begin{macro}{<frac>}
+% \begin{macro}{<over>}
+% \begin{macro}{</frac>}
+% Fractions are set with in a
+% \stcs{frac}\dots\stcs{over}\dots\stcs{/frac} environment.
+% \begin{macrocode}
+\Cdef {frac}{\MOp{frac}{\NewEnvir{frac}{\bgroup}{\egroup}%
+ \NOver = 0\relax}}
+\Cdef {over}{\MOp{over}{\FracOver}}
+\Cdef {/frac}{\MOp{/frac}{\ifnum \NOver = 0
+ \Error{No <over> in the <frac>...<over>...</frac> environment.}{}\fi
+ \EndEnvir{frac}}}
+\def \FracOver {\ifTextEqual{\CurEnv}{frac}%
+ \ifnum \NOver = 0 \over
+ \else \Error{Only one <over> may occur in each <frac>...</frac>
+ environment.}{}%
+ \fi \advance \NOver by 1
+ \else \Error{<over> only allowed in a
+ <frac>...<over>...</frac> environment.}{}%
+ \fi }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% To check for legal use of \stcs{over}, a counter named \cs{NOver} is
+% used.
+% \begin{macrocode}
+\newcount \NOver
+% \end{macrocode}
+%
+% \subsubsection{Roots}
+% \begin{macro}{<sqrt>}
+% \begin{macro}{</sqrt>}
+% The \stenv{sqrt} environment is just an interface to the \cs{sqrt}
+% macro in plain \TeX.
+% \begin{macrocode}
+\Cdef {sqrt}{\MOp{sqrt}{\NewEnvir{sqrt}{\sqrt\bgroup}{\egroup}}}
+\Cdef {/sqrt}{\MOp{/sqrt}{\EndEnvir{sqrt}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{PostScript figures}
+% \begin{macro}{<psfig>}
+% \begin{macro}{</psfig>}
+% \starTeX{} allows the inclusion of \ps{} figures through the
+% \stenv{psfig} environment. It checks if the command is allowed in the
+% current state, and, if it is, \cs{PSfig} is called; if not,
+% \cs{PSfigError} is called instead.
+% \begin{macrocode}
+\Cdef {psfig}{\if \State x \let \Next = \PSfig \else
+ \let \Next = \PSfigError \fi
+ \Next }
+\Cdef {/psfig}{\AddVspace{6pt plus 1pt}
+ \ifx \PSfile \relax \else
+ \centerline{\epsfbox{\PSfile}}%
+ \AddVspace{10pt plus 2pt minus 1pt}
+ \fi
+ \EndEnvir{psfig}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% The actual inclusion of the \ps{} file in handled by \cs{epsfbox}
+% from the file \texttt{epsf.tex} which is provided with the
+% \textsc{dvips} program.
+% \begin{macrocode}
+\input epsf.tex
+% \end{macrocode}
+% \begin{macro}{\PSfig}
+% \cs{PSfig} checks whether the user has remembered to provide the
+% file name; if so, \cs{PSfetch} is called to check the \ps{} file.
+% \begin{macrocode}
+\def \PSfig{\NewEnvir{psfig}{\topinsert}{\endinsert}
+ \let \PSfile = \relax \let \State = p
+ \IfNextChar{[}%
+ {\PSfetch}%
+ {\Error{No file name for PostScript figure;}%
+ {the syntax is: <psfig>[file name]caption text</psfig>.}%
+ \PScaption}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PSfigError}
+% \cs{PSfigError} gives an error message and starts a dummy
+% environment.
+% \begin{macrocode}
+\def \PSfigError {\endgraf
+ \Error{Calls on <psfig> not allowed inside <psfig> or <table>;}%
+ {the command was ignored.}%
+ \NewEnvir{psfig}{\begingroup}{\endgroup}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PSfetch}
+% \cs{PSfetch} checks that the \ps{} exists, and notes its name in
+% \cs{PSfile}.
+% \begin{macrocode}
+\def \PSfetch [#1]{\IfFileExists{#1}%
+ {\gdef \PSfile {#1}}%
+ {\Error{PostScript file `#1' could not be found.}{}}%
+ \PScaption }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\epsfsize}
+% \cs{epsfsize} is used by \cs{epsfbox} to scale the \ps{} figure.
+% We want figures to fill either 80\% of the text width or 40\% of the
+% text height. This is done by comparing
+% $\frac{0.8\mbox{\cs{hsize}}}{\mathtt{\#1}}$ and
+% $\frac{0.4\mbox{\cs{vsize}}}{\mathtt{\#2}}$, where "#1" and "#2"
+% are the horizontal and vertical original sizes of the the figure.
+% \begin{macrocode}
+\def \epsfsize #1#2{0pt \dimen1 = 0.8\hsize \dimen2 = 0.4\vsize
+ \floatdiv{\dimen2}{#1}{#2}%
+ \ifdim \dimen1 < \divres \epsfxsize = 0.8\hsize
+ \else \epsfysize = 0.4\vsize \fi }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PScaption}
+% The formatting of the caption is done by \cs{PScaption}:
+% \begin{macrocode}
+\def \PScaption {\global\advance \FigCnt by 1
+ \edef \CurDef {\the\FigCnt}
+ \leftskip = 0.1\hsize \rightskip = \leftskip
+ \ResetFont \SetSize{S}\Indentfalse
+ \FigureName~\FigIm: \ignorespaces }
+% \end{macrocode}
+% \end{macro}
+% \cs{PScaption} needs a counter to count the figures:
+% \begin{macrocode}
+\newcount \FigCnt
+% \end{macrocode}
+%
+% \subsection{Tables}
+% \begin{macro}{<table>}
+% \begin{macro}{</table>}
+% Tables are created with the \stenv{table} environment. It checks whether
+% the command is allowed in the current state and calls
+% \cs{Table} if it is; otherwise it calls \cs{TableError}.
+% \begin{macrocode}
+\Cdef {table}{\if \State x\let \Next = \Table \else
+ \let \Next = \TableError \fi
+ \Next }
+\Cdef {/table}{\EndEnvir{table}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% The table is temporarily placed in a box so that it may be centered
+% when output.
+% \begin{macrocode}
+\newbox \TableBox
+% \end{macrocode}
+% \begin{macro}{\Table}
+% \cs{Table} starts the table environment.
+% \begin{macrocode}
+\def \Table{\topinsert
+ \NewEnvir{table}{\TableCaption}{\LastRow\endinsert}%
+ \let \State = t}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TableCaption}
+% The formatting of the table caption is done by \cs{TableCaption}:
+% \begin{macrocode}
+\def \TableCaption {\global\advance \TabCnt by 1
+ \edef \CurDef {\the\TabCnt}
+ \leftskip = 0.1\hsize \rightskip = \leftskip
+ \ResetFont \SetSize{S}\Indentfalse
+ \TableName~\TabIm: \ignorespaces }
+% \end{macrocode}
+% \end{macro}
+% \cs{TableCaption} needs a counter to count the tables:
+% \begin{macrocode}
+\newcount \TabCnt
+% \end{macrocode}
+% \begin{macro}{\TableError}
+% \cs{TableError} gives an error message and starts a dummy
+% environment.
+% \begin{macrocode}
+\def \TableError {\endgraf
+ \Error{Calls on <table> not allowed inside <psfig>
+ or <table>;}{the command was ignored.}%
+ \NewEnvir{table}{\begingroup}{\endgroup}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Table rows}
+% \begin{macro}{<row>}
+% \begin{macro}{\Row}
+% The command \stcs{row} is the interface to \cs{Row} which is used to
+% start another table row. Its actions depend on the current state.
+% \begin{macrocode}
+\Cdef {row}{\Row}
+\def \Row {\if \State t\FirstRow\NewRow \else
+ \if \State r\EndRow\NewRow \else
+ \Error{The <row> command is only allowed inside a
+ <table>.}{The command was ignored.}\fi\fi }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\FirstRow}
+% \cs{FirstRow} is called prior to the first table row.
+% \begin{macrocode}
+\def \FirstRow {\endgraf \ResetFont \SelectFont \let \State = r%
+ \setbox\TableBox = \hbox\bgroup \vbox\bgroup \offinterlineskip
+ \halign\bgroup \vrule ##\strut&&
+ \kern 6pt \hfil ##\unskip \hfil \kern 6pt \vrule \cr
+ \noalign{\hrule}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\NewRow}
+% \cs{NewRow} is used to start another table row.
+% \begin{macrocode}
+\def \NewRow {&}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\EndRow}
+% The command \cs{EndRow} is used to terminate the current table row.
+% \begin{macrocode}
+\def \EndRow {\cr \noalign{\hrule}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LastRow}
+% The command \cs{LastRow} is used to terminate the last table row.
+% \begin{macrocode}
+\def \LastRow {\if \State r\EndRow\PrintTable\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\PrintTable}
+% \cs{PrintTable} is the final command used when processing a table.
+% It terminates the table structure and outputs it.
+% \begin{macrocode}
+\def \PrintTable {\egroup\egroup\egroup
+ \AddVspace{6pt plus 2pt minus 1pt}
+ \centerline{\box\TableBox}%
+ \AddVspace{10pt plus 4pt minus 2pt}}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Table columns}
+% \begin{macro}{<col>}
+% \stcs{col} is used to start another table column.
+% \begin{macrocode}
+\Cdef {col}{\if \State r&\else
+ \Error{The <col> command is only allowed after a <row>
+ inside a <table>.}{The command was ignored.}\fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Cross-references}
+% This section describes the various commands used for
+% cross-referencing.
+%
+% The basic idea is the same as the one used in \LaTeX: an extra file (with
+% extension \texttt{.aux}) contains all the labels defined in the
+% document. There are two reasons for this:
+% \begin{itemize}
+% \item Using a separate file makes it possible to have forward
+% references.
+% \item When processing a document, the page number of each label is
+% not known until the page is actually written to the \textsc{dvi}
+% file. The \cs{write} command is, consequently, delayed until that stage
+% of the processing, so using a file will always give us the
+% correct page number.
+% \end{itemize}
+% \begin{macro}{\ifAuxOpen}
+% The \texttt{.aux} file is only created when there are \stcs{label}
+% commands in the document. The first \stcs{label} creates the file,
+% and the flag \cs{ifAuxOpen} indicates whether this has been done.
+% \begin{macrocode}
+\newif \ifAuxOpen
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Defining labels}
+% \begin{macro}{<label>}
+% \stcs{label} is used to define another cross-reference label. The
+% value of the label is the current value of \cs{CurDef} which is set
+% by \stcs{h1}, \stcs{table}, etc.
+%
+% \stcs{label} first checks the syntax, and then alters the
+% \cs{catcode} of "<" in case there are any "<"s in the label.
+% Finally, it calls \cs{NewLabel} to perform the actual definition.
+% \begin{macrocode}
+\Cdef {label}{\IfNextChar{[}%
+ {\begingroup \catcode`\< = 12 \NewLabel}%
+ {\Error{No label given;}%
+ {the syntax is <label>[your label].}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\NewLabel}
+% \cs{NewLabel} first reads the old ".aux" file (unless it has already
+% been read) and opens a new ".aux" file (unless that has been done).
+% \begin{macrocode}
+\def \NewLabel [#1]{\endgroup
+ \ifAuxRead \else \ReadAuxFile \fi
+ \ifAuxOpen \else
+ \immediate\openout \NewAuxFile = \jobname.aux
+ \global\AuxOpentrue \fi
+% \end{macrocode}
+% Then, it checks whether the label has been previously defined, and
+% prints an error message if it has been. Otherwise, it notes the
+% definition and writes the necessary data to the ".aux"
+% file.\footnote{Note the trick of redefining \cs{the} so that
+% \cs{pageno} is not expanded until the page is completed. This was
+% found in \cite[Exercise~21.10]{texbook}.}
+% \begin{macrocode}
+ \expandafter\ifx \csname L]#1\endcsname \relax
+ \expandafter\edef \csname L]#1\endcsname{\the\inputlineno}%
+ {\let \the = 0\relax
+ \edef \WriteCurDef {\write \NewAuxFile
+ {\string\LabelDef
+ ]#1]\the\pageno]\CurDef E-o-LabelDef\string\relax}}%
+ \WriteCurDef }%
+ \else
+ \Error{Label `#1' already defined on line \csname L]#1\endcsname;}%
+ {this definition is ignored.}%
+ \fi }
+% \end{macrocode}
+% \end{macro}
+% Note that when a label \emph{\texttt{xxx}} is defined, a macro named
+% \cs{L]\emph{xxx}} is defined, and its definition is the line number.
+% This is used to give a better error message in case there are
+% multiple definitions of that label.
+%
+% The new ".aux" file must be declared.
+% \begin{macrocode}
+\newwrite \NewAuxFile
+% \end{macrocode}
+% We must also define an initial value for \cs{CurDef} in case the
+% user calls \stcs{label} prior to the first \stcs{h\emph{x}}.
+% \begin{macrocode}
+\edef \CurDef {0}
+% \end{macrocode}
+%
+% \subsubsection{Reading the cross-reference label file}
+% When the user first references a label (using a \stcs{ref} command),
+% the \texttt{.aux} file is read to find all the labels that were
+% defined during the previous run. Each label will be represented by
+% to macros:
+% \begin{description}
+% \item[\texttt{R]\emph{xxx}}] gives the reference, i.e.~``2.1'' if
+% the label was defined in Section~2.1 of the document.
+% \item[\texttt{P]\emph{xxx}}] gives the page number where the label
+% was placed.
+% \end{description}
+% \begin{macro}{\ReadAuxFile}
+% \cs{ReadAuxFile} reads the ".aux" file produced by the previous run.
+% It redefines the \cs{catcode} of "<" in case that characters occurs
+% in a label.
+% \begin{macrocode}
+\def \ReadAuxFile {\IfFileExists{\jobname.aux}%
+ {\begingroup
+ \def \LabelDef {\begingroup
+ \catcode `\\ = 12\relax \FetchLabel }%
+ \catcode `\< = 12 \catcode `\\ = 0\relax
+ \input \jobname.aux
+ \global\AuxReadtrue
+ \endgroup }%
+ {\global\Reruntrue}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\LabelDef}
+% A \starTeX{} ".aux" file consists of a sequence of calls on
+% \cs{LabelDef}. \cs{LabelDef} just alters the \cs{catcode} of "\" (in
+% case there are "\"s in the label), and calls \cs{FetchLabel} to do
+% the actual definition.
+% \begin{macrocode}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\FetchLabel}
+% \cs{FetchLabel} has three parameters.
+% The label is parameter "#1"; it is enclosed by a set
+% of "]"s.\footnote{We can be certain that no \texttt{]} occurs in the
+% label.} Parameter "#2" is the referenced page number; it is also
+% terminated by a "]". The label reference is parameter "#3"; it is
+% terminated by the text ``\texttt{E-o-LabelDef}''.
+% \begin{macrocode}
+\def \FetchLabel ]#1]#2]#3E-o-LabelDef{%
+ \expandafter\gdef \csname R]#1\endcsname {#3}%
+ \expandafter\gdef \csname P]#1\endcsname {#2}%
+ \endgroup }
+% \end{macrocode}
+% \end{macro}
+% The flag \cs{ifAuxRead} tells whether the ".aux" file from the
+% previous run has been read.
+% \begin{macrocode}
+\newif \ifAuxRead
+% \end{macrocode}
+% The flag \cs{ifRerun} is set whenever it is detected that a new
+% label has been defined or the definition of a label has been
+% modified. This implies that it is necessary to run \starTeX{}
+% again.\footnote{It would be nice to be able to
+% do this automatically, but that is not possible with the present
+% \TeX.}
+% \begin{macrocode}
+\newif \ifRerun
+% \end{macrocode}
+%
+% \subsubsection{Checking the \texttt{.aux} file}
+% \begin{macro}{\CheckAux}
+% At the end of each run, the \texttt{.aux} file is checked by
+% \cs{CheckAux} to see if
+% any label were modified during the run. If so, the flag \cs{ifRerun}
+% is set.
+% \begin{macrocode}
+\def \CheckAux {\immediate\closeout \NewAuxFile
+ \begingroup
+ \def \LabelDef {\begingroup
+ \catcode `\\ = 12 \relax \CheckLabel }%
+ \catcode `\< = 12 \catcode `\\ = 0\relax
+ \input \jobname.aux
+ \endgroup }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\CheckLabel}
+% \cs{CheckLabel} does the actual checking by comparing the new
+% definition with the old one.
+% \begin{macrocode}
+\def \CheckLabel ]#1]#2]#3E-o-LabelDef{%
+ \ifTextEqual{#2++#3}%
+ {\csname P]#1\endcsname++\csname R]#1\endcsname}%
+ \else
+ \global\Reruntrue
+ \fi \endgroup }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Referencing labels}
+% \begin{macro}{<ref>}
+% \stcs{ref} is used to reference a label. It checks the syntax, and
+% calls \cs{GiveRef} to produce the actual reference.
+% \begin{macrocode}
+\Cdef {ref}{\IfNextChar{[}%
+ {\begingroup \catcode `\< = 12 \relax \GiveRef }%
+ {\Error{No label referenced;}{the syntax is <ref>[your label].}}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\GiveRef}
+% \cs{GiveRef} checks whether the reference has been defined, and, if
+% it is defined, typesets the reference in the format specified by
+% \cs{RefFormat}.
+% \begin{macrocode}
+\def \GiveRef [#1]{\ifAuxRead \else \ReadAuxFile \fi
+ \expandafter\ifx \csname R]#1\endcsname \relax
+ [label #1]%
+ \Error{Label `#1' not defined.}{}\global\Reruntrue
+ \else
+ \RefFormat{\csname R]#1\endcsname}{\csname P]#1\endcsname}%
+ \fi \endgroup }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\RefFormat}
+% The macro \cs{RefFormat} gives the appearance of the reference. The
+% default is a number followed by ``on page
+% \emph{x}'' unless the reference is to the same page.\footnote{The
+% page test used will not always give the correct result; if the
+% reference is very near the top or the bottom of a page,
+% \cs{pageno} will sometimes be 1 off. This is not a serious problem,
+% as the referenced object in that case will be very close to the
+% reference.
+%
+% This problem was solved in the \texttt{varioref}\cite{varioref} package in
+% \LaTeX, but the solution is somewhat complicated,
+% so I have chosen to stick with the simple solution even if it is
+% not optimal.}
+% \begin{macrocode}
+\def \RefFormat #1#2{#1\ifTextEqual{#2}{\the\pageno}\else
+ \space on page~#2\fi }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Miscellaneous other commands}
+%
+% \subsubsection{Symbols and logos}
+% \begin{macro}{<>}
+% \begin{macro}{<->}
+% \begin{macro}{<-->}
+% \begin{macro}{<--->}
+% \begin{macro}{<``>}
+% \begin{macro}{<''>}
+% \begin{macro}{<tex>}
+% \begin{macro}{<latex>}
+% \begin{macro}{<startex>}
+% Here is the definition of some symbols that the user needs for
+% quality typesetting.
+% \begin{macrocode}
+{\catcode`\~ = 12 \Cdef {~}{\nobreak\ }}
+\Cdef {}{\null}
+\Cdef {-}{\-} \Cdef {--}{--} \Cdef {---}{---}
+\Cdef {``}{``} \Cdef {''}{''}
+\Cdef {tex}{\TeX} \Cdef {latex}{La\TeX} \Cdef {startex}{Star\TeX}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Error handling}
+% \begin{macro}{\Error}
+% This macro gives an error message with one or two lines of text.
+% (The second line is omitted if it is empty.)
+% \begin{macrocode}
+\def \Error #1#2{%
+ \message{^^J** StarTeX error detected on line \the\inputlineno:^^J}%
+ \message{\space\space\space #1^^J}%
+ \ifTextEqual{#2}{}\else \message{\space\space\space #2^^J}\fi}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Warning}
+% This macro gives a warning with one or two lines of text.
+% (The second line is omitted if it is empty.)
+% \begin{macrocode}
+\def \Warning #1#2{%
+ \message{^^J** StarTeX warning:^^J}%
+ \message{\space\space\space #1^^J}%
+ \ifTextEqual{#2}{}\else \message{\space\space\space #2^^J}\fi}
+% \end{macrocode}
+% \end{macro}
+% We need to modify the \cs{newlinechar} in order to produce a line
+% feed when we want it. The \textsc{lf} character (\textsc{ascii} code
+% 10 = \texttt{\symbol{94}\symbol{94}J}) seems a good choice.
+% \begin{macrocode}
+\newlinechar = `^^J
+% \end{macrocode}
+%
+% \subsubsection{Comments}
+% \begin{macro}{<comment>}
+% \begin{macro}{</comment>}
+% The environment \stenv{comment} is defined to make it possible for
+% the user to add comments to his or her \starTeX{} code. It uses
+% \cs{SkipComment} to fetch the comment text.
+% \begin{macrocode}
+\Cdef {comment}{\NewEnvir{comment}{\begingroup}{\endgroup}%
+ \catcode `\< = 12 \SkipComment }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\SkipComment}
+% \cs{SkipComment} works just like \cs{ReadCode} for a \stenv{code}
+% environment, except that the code is simply ignored.
+% \begin{macrocode}
+{\catcode `\< = 12
+ \gdef \SkipComment #1</comment>{\EndEnvir{comment}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Text handling}
+% There is very little text handling in \starTeX, but a few
+% macros are necessary.
+%
+% \begin{macro}{\ifTextEqual}
+% The macro \cs{ifTextEqual}\footnote{The name \cs{ifTextEqual} starts
+% with a lowercase \cs{if}- to show its relationship to the various
+% \cs{if}\dots{} macros of primitive \TeX\@. \cs{ifTextEqual} is
+% used just like these, which means that it must have a corresponding
+% \cs{fi}. It may also have an \cs{else} part. Note, however, that
+% calls on \cs{ifTextEqual} may not occur inside other \cs{if}s.}
+% tests if the two texts "#1" and "#2" are equal.
+% This is achieved by letting the \TeX{} primitive \cs{ifx} do the
+% job.
+% \begin{macrocode}
+\def \ifTextEqual #1#2{\edef \TmpA {#1}\edef \TmpB {#2}%
+ \ifx \TmpA\TmpB }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\IfNextChar}
+% Sometimes we need to check the next input character, for instance to
+% see if it is a "[". The macro \cs{IfNextChar} expands into "#2" if
+% the next input character is "#1"; otherwise it expands into "#3".
+%
+% The \TeX{} primitive \cs{futurelet} is used to implement
+% \cs{IfNextChar}; it was designed just for this.
+% Note that the call on \cs{IfNextChar} must be at the very end of the
+% macro in which it occurs.
+% \begin{macrocode}
+\def \IfNextChar #1#2#3{\def \TestChar {#1}%
+ \def \AltA {#2}\def \AltB {#3}%
+ \futurelet \NextChar \TestNextChar }
+\def \TestNextChar {%
+ \if \NextChar \TestChar \let\Next=\AltA \else \let\Next=\AltB \fi
+ \Next }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\IfNextCharTwo}
+% A similar macro testing whether the following character is one of
+% two possible alternatives, is also necessary. It takes four
+% parameters: "#1" and "#2" are the two characters to check for, and
+% the result of \cs{IfNextCharTwo} is "#3" if the next character is
+% either of the two alternatives, or else "#4".
+% \begin{macrocode}
+\def \IfNextCharTwo #1#2#3#4{\def \TestChar {#1}\def \TestCharX {#2}%
+ \def \AltA {#3}\def \AltB {#4}%
+ \futurelet \NextChar \TestNextCharTwo }
+\def \TestNextCharTwo {%
+ \if \NextChar \TestChar \let \Next = \AltA \else
+ \if \NextChar \TestCharX \let \Next = \AltA \else
+ \let \Next = \AltB
+ \fi \fi
+ \Next }
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Numerical operations}
+% \begin{macro}{\floatdiv}
+% \TeX{} has no floating-point division, so a routine like
+% \cs{floatdiv} is necessary. It computes
+% $\frac{\mbox{\texttt{\scriptsize \#1}}\times
+% \mbox{\texttt{\scriptsize \#2}}}
+% {\mbox{\texttt{\scriptsize \#3}}}$ and places the result in
+% \cs{divres}.\footnote{The algorithm used is taken from the code in
+% \texttt{epsf.tex}.} All parameters must be \cs{dimen} registers.
+% \begin{macrocode}
+\def \floatdiv #1#2#3{\divtemp = #1\divide \divtemp by #3%
+ \divres = #2\multiply \divres by \divtemp
+ \multiply \divtemp by #3%
+ \divrem = #1\advance \divrem by -\divtemp
+ \divtemp = #2%
+ \loop
+ \multiply \divrem by 2 \divide \divtemp by 2
+ \ifnum \divtemp > 0
+ \ifnum \divrem < #3\else
+ \advance \divrem by -#3\advance \divres by \divtemp
+ \fi
+ \repeat }
+% \end{macrocode}
+% \end{macro}
+% The necessary registers must be declared:
+% \begin{macrocode}
+\newdimen \divrem \newdimen \divres \newdimen \divtemp
+% \end{macrocode}
+%
+% \subsubsection{File operations}
+% \begin{macro}{\ifFileExists}
+% To provide better error messages, \starTeX{} tests whether a file
+% exists before any attempt is made to read it. \cs{ifFileExists}
+% first checks if file "#1" exists;\footnote{This checking is done by
+% using \cs{ifeof} which means that empty files will be regarded as
+% non-existant; this should not really be a problem.} if it does, the
+% file is closed and "#2" is executed, otherwise "#3" is executed.
+% \begin{macrocode}
+\def \IfFileExists #1#2#3{\openin\TestFile = #1
+ \ifeof\TestFile \def \Next {#3}\else
+ \closein\TestFile \def \Next {#2}\fi
+ \Next }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TestFile}
+% We must also define the input file we use for testing.
+% \begin{macrocode}
+\newread \TestFile
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Format creation}
+% \begin{macro}{<make-new-format>}
+% \stcs{make-new-format} is used by the system to make a new format; it
+% is not intended to be called by the user.
+% \begin{macrocode}
+\Cdef {make-new-format}{\dump}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{<trace-on>}
+% \begin{macro}{<trace-off>}
+% \stcs{trace-on} is used during debugging to trace the
+% expansion of commands, and \stcs{trace-off} turns this tracing off.
+% Using tracing requires insight into both the inner
+% mechanisms of \starTeX{} as well as \TeX{} itself.
+% \begin{macrocode}
+\Cdef {trace-on}{\tracingcommands = 1 \tracingmacros = 1
+ \tracingrestores = 1 \tracingoutput = 1 \relax }
+\Cdef {trace-off}{\tracingcommands = 0 \tracingmacros = 0
+ \tracingrestores = 0 \tracingoutput = 0 \relax }
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Final initialization}
+% In the final initialization, we need to load the hyphenation
+% patterns defined at this site:
+% \begin{macrocode}
+\input startex.lan
+% \end{macrocode}
+% We select the default text font:
+% \begin{macrocode}
+\ResetFont \SetSize{N}
+% \end{macrocode}
+% Our very last initialization is to modify the \cs{catcode}s:
+% \begin{macrocode}
+\endinput \SpecialCatCodes
+%</code>
+% \end{macrocode}
+%
+% \section{Language definitions}
+% This section describes the file "startex.lan" that defines which
+% hyphenation patterns are known to \starTeX\@. It should be adapted
+% to the needs of each local installation.
+% \begin{macrocode}
+%<*languages>
+% \end{macrocode}
+%
+% \begin{macro}{\DefLang}
+% The macro \cs{DefLang} is used to defined a new language. It has
+% three parameters: "#1" is the internal number of the language, "#2"
+% is the internal name of the language, and "#3" is the name of the
+% file from which to read hyphenation patterns for the language.
+% \begin{macrocode}
+\def \DefLang #1#2#3{\expandafter\def \csname L-#2\endcsname {#1}%
+ \language = #1 \input #3}%
+% \end{macrocode}
+% \end{macro}
+% Only one language (Norwegian) is predefined here, as this file will
+% have to be adapted to local needs anyhow.
+% \begin{macrocode}
+\DefLang{1}{norsk}{nohyph2.tex}%
+% \end{macrocode}
+% \texttt{american} (American English)
+% has already been defined as language~0 by plain \TeX.
+% \begin{macrocode}
+\expandafter\def \csname L-american\endcsname {0}%
+% \end{macrocode}
+% We want American English as our default:
+% \begin{macrocode}
+\language = 0
+%</languages>
+% \end{macrocode}
+%
+% \section{Sample document styles}
+% Included are also four document styles:
+% \begin{description}
+% \item[article] is used for ordinary articles. As this
+% is the default definition of \starTeX, this style is empty.
+%
+% \item[a4-article] is just an adaption of \emph{article} to fit
+% A4~paper.
+%
+% \item[ifi-article] is the style used for articles at Ifi
+% (``Institutt for informatikk'', the Department of Informatics at the
+% Univeristy of Oslo). It uses Concorde as the main text font,
+% Palatino for its math, and A4 paper. (If you want to use this style,
+% you must have access to a Concorde font; the Palatino Math is
+% available at \textsc{ctan}.)
+%
+% \item[ifi-artikkel] is \emph{ifi-article} adapted to Norwegian text.
+% \end{description}
+% Each style file contains the necessary redefinitions.
+%
+% \subsection{Paper size}
+% Every style except \emph{article} uses A4 paper. The margins are set
+% to 2.5~cm.
+% \begin{macrocode}
+%<*a4-article|ifi-article|ifi-artikkel>
+\hoffset = -1in \advance \hoffset by 2.5cm \hsize = 16cm
+\voffset = -1in \advance \voffset by 2.5cm \vsize = 24.7cm
+%</a4-article|ifi-article|ifi-artikkel>
+% \end{macrocode}
+% \subsection{Language adaption}
+% The \emph{ifi-artikkel} is for text in Norwegian. We must select the
+% correct language and adjust \cs{lefthyphenmin} and
+% \cs{righthyphenmin}.
+% \begin{macrocode}
+%<*ifi-artikkel>
+\language = \csname L-norsk\endcsname
+\lefthyphenmin = 1 \righthyphenmin = 2
+% \end{macrocode}
+% \begin{macro}{\AbstractName}
+% \begin{macro}{\FigureName}
+% \begin{macro}{\TableName}
+% \begin{macro}{\TimeSep}
+% Some names must also be redefined.
+% \begin{macrocode}
+\def \AbstractName {Sammendrag}%
+\def \FigureName {Figur}%
+\def \TableName {Tabell}%
+\def \TimeSep {.}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\RefFormat}
+% The format for references must be translated into Norwegian.
+% \begin{macrocode}
+\def \RefFormat #1#2{#1\ifTextEqual{#2}{\the\pageno}\else
+ \space p\aa{} side~#2\fi }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{<today>}
+% \begin{macro}{\Month}
+% Finally, the date command \stcs{today} must be redefined.
+% \begin{macrocode}
+\Cdef {today}{\the\day.\space \Month\space \the\year }%
+\def \Month {\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 }%
+%</ifi-artikkel>
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Text font}
+% The two \emph{ifi-} styles use Concorde\footnote{In the Karl Berry
+% font name scheme \cite{fontname}, Concorde is known as \emph{poc-}.} as
+% the main body text
+% font; it is the official font of the University of Oslo. Since
+% Concorde is a wider font than \textsc{ecr}, and because it has a
+% larger x-height, a smaller font size is used. The EC
+% Companion font is kept for the special symbols.
+% \begin{macrocode}
+%<*ifi-article|ifi-artikkel>
+\FontDef{R}{M}{U}{N}{pocr8t at 9.8pt}{tcrm1095}%
+\FontDef{R}{M}{I}{N}{pocri8t at 9.8pt}{tcti1095}%
+\FontDef{R}{B}{U}{N}{pocb8t at 9.8pt}{tcbx1095}%
+\FontDef{R}{B}{I}{N}{pocbi8t at 9.8pt}{tcbi1095}%
+\FontDef{T}{M}{U}{N}{pcrr8t at 9.8pt}{tctt1095}%
+\FontDef{T}{M}{I}{N}{pcrro8t at 9.8pt}{tcit1095}%
+\FontDef{T}{B}{U}{N}{pcrb8t at 9.8pt}{tctt1095}%
+\FontDef{T}{B}{I}{N}{pcrbo8t at 9.8pt}{tcit1095}%
+\FontDef{R}{M}{U}{L}{pocr8t at 12.9pt}{tcrm1440}%
+\FontDef{R}{M}{I}{L}{pocri8t at 12.9pt}{tcti1440}%
+\FontDef{R}{B}{U}{L}{pocb8t at 12.9pt}{tcbx1440}%
+\FontDef{R}{B}{I}{L}{pocbi8t at 12.9pt}{tcbi1440}%
+\FontDef{T}{M}{U}{L}{pcrr8t at 12.9pt}{tctt1440}%
+\FontDef{T}{M}{I}{L}{pcrro8t at 12.9pt}{tcit1440}%
+\FontDef{T}{B}{U}{L}{pcrb8t at 12.9pt}{tctt1440}%
+\FontDef{T}{B}{I}{L}{pcrbo8t at 12.9pt}{tcit1440}%
+\FontDef{R}{M}{U}{X}{pocr8t at 15.5pt}{tcrm1728}%
+\FontDef{R}{M}{I}{X}{pocri8t at 15.5pt}{tcti1728}%
+\FontDef{R}{B}{U}{X}{pocb8t at 15.5pt}{tcbx1728}%
+\FontDef{R}{B}{I}{X}{pocbi8t at 15.5pt}{tcbi1728}%
+\FontDef{T}{M}{U}{X}{pcrr8t at 15.5pt}{tctt1728}%
+\FontDef{T}{M}{I}{X}{pcrro8t at 15.5pt}{tcit1728}%
+\FontDef{T}{B}{U}{X}{pcrb8t at 15.5pt}{tctt1728}%
+\FontDef{T}{B}{I}{X}{pcrro8t at 15.5pt}{tcit1728}%
+\FontDef{R}{M}{U}{S}{pocr8t at 8.9pt}{tcrm1000}%
+\FontDef{R}{M}{I}{S}{pocri8t at 8.9pt}{tcti1000}%
+\FontDef{R}{B}{U}{S}{pocb8t at 8.9pt}{tcbx1000}%
+\FontDef{R}{B}{I}{S}{pocbi8t at 8.9pt}{tcbi1000}%
+\FontDef{T}{M}{U}{S}{pcrr8t at 8.9pt}{tctt1000}%
+\FontDef{T}{M}{I}{S}{pcrro8t at 8.9pt}{tcit1000}%
+\FontDef{T}{B}{U}{S}{pcrb8t at 8.9pt}{tctt1000}%
+\FontDef{T}{B}{I}{S}{pcrbo8t at 8.9pt}{tcit1000}%
+% \end{macrocode}
+% The ``Math Palatino'' font is used for math.
+% \changes{1.04}{1999/02/25}{Changed math font to ``Palatino Math''
+% for the Ifi document styles.}
+% \begin{macrocode}
+\def \XIIpt { at 12pt}
+\def \Xpt { at 10pt}
+\def \IXpt { at 9pt}
+\def \VIIIpt { at 8pt}
+\def \VIIpt { at 7pt}
+\def \VIpt { at 6pt}
+\def \Vpt { at 5pt}
+\MathFontDef{N}{0}{zppler7t\XIpt}{zppler7t\VIIIpt}{zppler7t\VIpt}
+\MathFontDef{N}{1}{zppler7m\XIpt}{zppler7m\VIIIpt}{zppler7m\VIpt}
+\MathFontDef{N}{2}{zppler7y\XIpt}{zppler7y\VIIIpt}{zppler7y\VIpt}
+\MathFontDef{N}{3}{zppler7v\XIpt}{zppler7v\XIpt}{zppler7v\XIpt}
+\MathFontDef{N}{4}{zppleb7t\XIpt}{zppleb7t\VIIIpt}{zppleb7t\VIpt}
+\MathFontDef{N}{5}{pplri8t\XIpt}{pplri8t\VIIIpt}{pplri8t\VIpt}
+\MathFontDef{L}{0}{zppler7t\XIVpt}{zppler7t\Xpt}{zppler7t\VIIIpt}
+\MathFontDef{L}{1}{zppler7m\XIVpt}{zppler7m\Xpt}{zppler7m\VIIIpt}
+\MathFontDef{L}{2}{zppler7y\XIVpt}{zppler7y\Xpt}{zppler7y\VIIIpt}
+\MathFontDef{L}{3}{zppler7v\XIVpt}{zppler7v\XIVpt}{zppler7v\XIVpt}
+\MathFontDef{L}{4}{zppleb7t\XIVpt}{zppleb7t\Xpt}{zppleb7t\VIIIpt}
+\MathFontDef{L}{5}{pplri8t\XIVpt}{pplri8t\Xpt}{pplri8t\VIIIpt}
+\MathFontDef{X}{0}{zppler7t\XVIIpt}{zppler7t\XIIpt}{zppler7t\IXpt}
+\MathFontDef{X}{1}{zppler7m\XVIIpt}{zppler7m\XIIpt}{zppler7m\IXpt}
+\MathFontDef{X}{2}{zppler7y\XVIIpt}{zppler7y\XIIpt}{zppler7y\IXpt}
+\MathFontDef{X}{3}{zppler7v\XVIIpt}{zppler7v\XVIIpt}{zppler7v\XVIIpt}
+\MathFontDef{X}{4}{zppleb7t\XVIIpt}{zppleb7t\XIIpt}{zppleb7t\IXpt}
+\MathFontDef{X}{5}{pplri8t\XVIIpt}{pplri8t\XIIpt}{pplri8t\IXpt}
+\MathFontDef{S}{0}{zppler7t\Xpt}{zppler7t\VIIpt}{zppler7t\Vpt}
+\MathFontDef{S}{1}{zppler7m\Xpt}{zppler7m\VIIpt}{zppler7m\Vpt}
+\MathFontDef{S}{2}{zppler7y\Xpt}{zppler7y\VIIpt}{zppler7y\Vpt}
+\MathFontDef{S}{3}{zppler7v\Xpt}{zppler7v\Xpt}{zppler7v\Xpt}
+\MathFontDef{S}{4}{zppleb7t\Xpt}{zppleb7t\VIIpt}{zppleb7t\Vpt}
+\MathFontDef{S}{5}{pplri8t\Xpt}{pplri8t\VIIpt}{pplri8t\Vpt}
+% \end{macrocode}
+% We must select the newly selected standard font.
+% \begin{macrocode}
+\SelectFont
+%</ifi-article|ifi-artikkel>
+% \end{macrocode}
+%
+% \bibliography{startex}
+% \bibliographystyle{plain}
+%
+% \clearpage
+% \Finale
+\endinput
diff --git a/Master/texmf-dist/source/startex/base/startex.ins b/Master/texmf-dist/source/startex/base/startex.ins
new file mode 100644
index 00000000000..f42cd4e5169
--- /dev/null
+++ b/Master/texmf-dist/source/startex/base/startex.ins
@@ -0,0 +1,13 @@
+\def \filedate {1998/2/23}
+\def \batchfile {startex.ins}
+
+\input docstrip.tex
+
+\askforoverwritefalse
+\keepsilent
+\generate{\file{startex.tex}{\from{startex.dtx}{code}}
+ \file{startex.lan}{\from{startex.dtx}{languages}}
+ \file{article.stx}{\from{startex.dtx}{article}}
+ \file{a4-article.stx}{\from{startex.dtx}{a4-article}}
+ \file{ifi-article.stx}{\from{startex.dtx}{ifi-article}}
+ \file{ifi-artikkel.stx}{\from{startex.dtx}{ifi-artikkel}}}