summaryrefslogtreecommitdiffstats
path: root/contrib/groff/doc
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
committerru <ru@FreeBSD.org>2000-12-05 18:49:44 +0000
commita812d8b090bc4edc23150bff257717b24f282e41 (patch)
tree19d4540966cb92612af25d5154efcc062eefb5c5 /contrib/groff/doc
parent2e2c9047c3a8b5b6fdcdcd4585d5b114f31cd386 (diff)
downloadFreeBSD-src-a812d8b090bc4edc23150bff257717b24f282e41.zip
FreeBSD-src-a812d8b090bc4edc23150bff257717b24f282e41.tar.gz
Virgin import of FSF groff v1.16.1
Diffstat (limited to 'contrib/groff/doc')
-rw-r--r--contrib/groff/doc/Makefile98
-rw-r--r--contrib/groff/doc/grnexmpl.g3250
-rw-r--r--contrib/groff/doc/grnexmpl.me86
-rw-r--r--contrib/groff/doc/groff.texinfo7960
-rw-r--r--contrib/groff/doc/homepage.ms162
-rw-r--r--contrib/groff/doc/meref.me10
-rw-r--r--contrib/groff/doc/pic.ms2
-rw-r--r--contrib/groff/doc/texinfo.tex5999
8 files changed, 15064 insertions, 2503 deletions
diff --git a/contrib/groff/doc/Makefile b/contrib/groff/doc/Makefile
index cccc52c..042bbe0 100644
--- a/contrib/groff/doc/Makefile
+++ b/contrib/groff/doc/Makefile
@@ -1,62 +1,80 @@
-#Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
-# Written by James Clark (jjc@jclark.com)
-#
-#This file is part of groff.
-#
-#groff 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, or (at your option) any later
-#version.
-#
-#groff 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 groff; see the file COPYING. If not, write to the Free Software
-#Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-FFLAG=-F..
-TROFF=../troff/troff -M../tmac $(FFLAG)
-GROPS=../grops/grops $(FFLAG)
-DOCS=meref.ps meintro.ps pic.ps
-MEMACROS=../macros/tmac.e
-SOELIM=../soelim/soelim
+# Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
+# Written by James Clark (jjc@jclark.com)
+#
+# This file is part of groff.
+#
+# groff 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, or (at your option) any later
+# version.
+#
+# groff 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 groff; see the file COPYING. If not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+FFLAG=-F../font
+TROFF=../src/roff/troff/troff -M../tmac $(FFLAG)
+GROFF=../src/roff/groff/groff -p -e -t
+GROPS=../src/devices/grops/grops $(FFLAG)
+DOCS=meref.ps meintro.ps pic.ps pic.html homepage.html
+MEMACROS=../tmac/tmac.e
+SOELIM=../src/preproc/soelim/soelim
+
+version=`cat ../VERSION`
+# No additional number for the groff archive if revision is zero
+revision=`sed -e 's/^0$$//' -e 's/^[1-9].*$$/.&/' ../REVISION`
all: $(DOCS)
-.SUFFIXES: .tr .me .ms .ps .dit
+.SUFFIXES: .tr .me .ms .ps .dit .html .ascii .texinfo .dvi
.dit.ps:
$(GROPS) $< >$@
.me.dit:
$(SOELIM) $< \
- | sed -e "s;@VERSION@;`cat ../VERSION`;" \
- | $(TROFF) -Tps $(FFLAG) -me >$@
+ | sed -e "s;@VERSION@;$(version)$(revision);" \
+ | $(TROFF) -Tps $(FFLAG) -me >$@
.tr.dit:
$(TROFF) -Tps $< >$@
-meref.ps: meref.dit
-meintro.ps: meintro.dit
+.ms.html:
+ GROFF_TMAC_PATH=../tmac; \
+ export GROFF_TMAC_PATH; \
+ sed -e "s;@VERSION@;$(version)$(revision);" $< \
+ | $(GROFF) -Thtml $(FFLAG) -U -ms >$@
+
+.ms.ascii:
+ GROFF_TMAC_PATH=../tmac; \
+ export GROFF_TMAC_PATH; \
+ sed -e "s;@VERSION@;$(version)$(revision);" $< \
+ | $(GROFF) -Tascii $(FFLAG) -U -ms -markup >$@
+
+.ms.ps:
+ GROFF_TMAC_PATH=../tmac; \
+ export GROFF_TMAC_PATH; \
+ sed -e "s;@VERSION@;$(version)$(revision);" $< \
+ | $(GROFF) -Tps $(FFLAG) -U -ms -markup >$@
-# This production must use -p -e -t so pic/eqn processing is done
-pic.ps: pic.ms
- sed -e "s;@VERSION@;`cat ../VERSION`;" $< \
- | ../groff/groff -p -e -t -Tps $(FFLAG) -ms >$@
+.texinfo.dvi:
+ texi2dvi -e $<
-pic.html: pic.ms
- sed -e "s;@VERSION@;`cat ../VERSION`;" $< \
- | ../groff/groff -p -e -t -Thtml $(FFLAG) -ms -mhtml >$@
+groff: groff.texinfo
+ makeinfo groff.texinfo
install:
clean:
- -rm -f *.ps *.html *.png *.gif *.dit core
- -rm -f *.aux *.cp *.cps *.cv *.cn *.dvi *.fn *.fns *.ky *.kys \
- *.log *.op *.pg *.pgs *.ps *.toc *.tp *.tps *.tr *.vr *.vrs
+ -rm -f *.ps *.html *.ascii *.png *.gif *.dit core
+ -rm -f *.aux *.dvi *.log *.toc texput.log
+ -rm -f *.cp *.cps *.cv *.cn *.fn *.fns *.gl *.gls *.ky *.kys \
+ *.ma *.mas *.op *.ops *.pg *.pgs *.tp *.tps *.tr *.vr *.vrs
distclean: clean
diff --git a/contrib/groff/doc/grnexmpl.g b/contrib/groff/doc/grnexmpl.g
new file mode 100644
index 0000000..ba1a1b8
--- /dev/null
+++ b/contrib/groff/doc/grnexmpl.g
@@ -0,0 +1,3250 @@
+sungremlinfile
+0 320.00 240.00
+ARC
+320.00 240.00
+320.00 416.00
+320.00 416.00
+320.00 64.00
+496.00 240.00
+144.00 240.00
+*
+4 0
+0
+CURVE BSPLINE
+764.00 288.00
+776.00 304.00
+764.00 320.00
+*
+3 0
+0
+CURVE BSPLINE
+768.00 288.00
+780.00 304.00
+768.00 320.00
+*
+3 0
+0
+CURVE BSPLINE
+768.00 320.00
+788.00 320.00
+800.00 304.00
+*
+3 0
+0
+CURVE BSPLINE
+768.00 288.00
+788.00 288.00
+800.00 304.00
+*
+3 0
+0
+ARC
+192.00 268.00
+192.00 267.00
+192.00 269.00
+192.00 267.00
+193.00 268.00
+191.00 268.00
+*
+3 0
+0
+ARC
+192.00 212.00
+192.00 211.00
+192.00 213.00
+192.00 211.00
+193.00 212.00
+191.00 212.00
+*
+3 0
+0
+CENTRIGHT
+476.00 32.00
+430.00 28.00
+453.00 28.00
+476.00 28.00
+*
+1 1
+10 $DP sub 2$
+CENTRIGHT
+476.00 224.00
+430.00 220.00
+453.00 220.00
+476.00 220.00
+*
+1 1
+10 $DP sub 2$
+CENTRIGHT
+476.00 256.00
+430.00 252.00
+453.00 252.00
+476.00 252.00
+*
+1 1
+10 $DP sub 2$
+CENTRIGHT
+476.00 448.00
+430.00 444.00
+453.00 444.00
+476.00 444.00
+*
+1 1
+10 $DP sub 2$
+VECTOR
+604.00 344.00
+612.00 344.00
+612.00 364.00
+620.00 364.00
+*
+6 0
+0
+ARC
+416.00 320.00
+416.00 319.00
+416.00 321.00
+416.00 319.00
+417.00 320.00
+415.00 320.00
+*
+3 0
+0
+CENTLEFT
+596.00 336.00
+596.00 332.00
+604.00 332.00
+613.00 332.00
+*
+1 1
+3 $-$
+CENTLEFT
+596.00 368.00
+596.00 364.00
+604.00 364.00
+612.00 364.00
+*
+1 1
+3 $+$
+POLYGON
+592.00 320.00
+592.00 384.00
+656.00 352.00
+592.00 320.00
+*
+3 1
+0
+ARC
+392.00 390.00
+392.00 392.00
+392.00 392.00
+392.00 388.00
+390.00 390.00
+394.00 390.00
+*
+3 0
+0
+VECTOR
+396.00 388.00
+384.00 384.00
+*
+3 0
+0
+ARC
+392.00 378.00
+392.00 380.00
+392.00 380.00
+392.00 376.00
+390.00 378.00
+394.00 378.00
+*
+3 0
+0
+ARC
+312.00 326.00
+312.00 328.00
+312.00 328.00
+312.00 324.00
+314.00 326.00
+310.00 326.00
+*
+3 0
+0
+CENTRIGHT
+276.00 352.00
+243.00 348.00
+259.00 348.00
+276.00 348.00
+*
+1 1
+7 $vv B2$
+POLYGON
+280.00 356.00
+280.00 348.00
+284.00 348.00
+288.00 352.00
+284.00 356.00
+*
+3 21
+0
+VECTOR
+308.00 324.00
+320.00 320.00
+*
+3 0
+0
+ARC
+312.00 314.00
+312.00 316.00
+312.00 316.00
+312.00 312.00
+314.00 314.00
+310.00 314.00
+*
+3 0
+0
+CENTLEFT
+292.00 212.00
+292.00 208.00
+300.00 208.00
+308.00 208.00
+*
+1 1
+3 $+$
+CENTLEFT
+292.00 268.00
+292.00 264.00
+300.00 264.00
+309.00 264.00
+*
+1 1
+3 $-$
+POLYGON
+288.00 192.00
+288.00 288.00
+384.00 240.00
+288.00 192.00
+*
+3 1
+0
+ARC
+256.00 268.00
+256.00 267.00
+256.00 269.00
+256.00 267.00
+257.00 268.00
+255.00 268.00
+*
+3 0
+0
+VECTOR
+328.00 268.00
+416.00 268.00
+416.00 320.00
+356.00 320.00
+*
+6 0
+0
+VECTOR
+356.00 328.00
+356.00 312.00
+*
+3 0
+0
+VECTOR
+352.00 328.00
+352.00 312.00
+*
+6 0
+0
+VECTOR
+320.00 320.00
+352.00 320.00
+*
+6 0
+0
+VECTOR
+312.00 312.00
+256.00 312.00
+256.00 268.00
+288.00 268.00
+*
+6 0
+0
+VECTOR
+224.00 276.00
+224.00 260.00
+*
+3 0
+0
+VECTOR
+228.00 276.00
+228.00 260.00
+*
+6 0
+0
+VECTOR
+228.00 268.00
+256.00 268.00
+*
+6 0
+0
+VECTOR
+224.00 268.00
+192.00 268.00
+192.00 384.00
+316.00 384.00
+*
+6 0
+0
+VECTOR
+320.00 392.00
+320.00 376.00
+*
+3 0
+0
+VECTOR
+316.00 392.00
+316.00 376.00
+*
+6 0
+0
+VECTOR
+312.00 328.00
+312.00 352.00
+288.00 352.00
+*
+6 0
+0
+VECTOR
+392.00 392.00
+416.00 392.00
+416.00 320.00
+*
+6 0
+0
+VECTOR
+320.00 384.00
+384.00 384.00
+*
+6 0
+0
+VECTOR
+192.00 256.00
+192.00 268.00
+160.00 268.00
+*
+6 0
+0
+ARC
+160.00 266.00
+160.00 268.00
+160.00 268.00
+160.00 264.00
+158.00 266.00
+162.00 266.00
+*
+3 0
+0
+VECTOR
+164.00 256.00
+152.00 260.00
+*
+3 0
+0
+ARC
+160.00 254.00
+160.00 256.00
+160.00 256.00
+160.00 252.00
+158.00 254.00
+162.00 254.00
+*
+3 0
+0
+ARC
+194.00 256.00
+196.00 256.00
+196.00 256.00
+192.00 256.00
+194.00 254.00
+194.00 258.00
+*
+3 0
+0
+VECTOR
+204.00 260.00
+200.00 248.00
+*
+3 0
+0
+VECTOR
+200.00 248.00
+200.00 232.00
+*
+6 0
+0
+VECTOR
+152.00 260.00
+128.00 260.00
+*
+6 0
+0
+ARC
+96.00 266.00
+96.00 268.00
+96.00 268.00
+96.00 264.00
+98.00 266.00
+94.00 266.00
+*
+3 0
+0
+VECTOR
+92.00 256.00
+104.00 260.00
+*
+3 0
+0
+ARC
+96.00 254.00
+96.00 256.00
+96.00 256.00
+96.00 252.00
+98.00 254.00
+94.00 254.00
+*
+3 0
+0
+VECTOR
+124.00 268.00
+124.00 252.00
+*
+3 0
+0
+VECTOR
+128.00 268.00
+128.00 252.00
+*
+6 0
+0
+VECTOR
+104.00 260.00
+124.00 260.00
+*
+6 0
+0
+VECTOR
+96.00 268.00
+96.00 320.00
+40.00 320.00
+*
+6 0
+0
+ARC
+28.00 338.00
+28.00 340.00
+28.00 340.00
+28.00 336.00
+30.00 338.00
+26.00 338.00
+*
+3 0
+0
+VECTOR
+24.00 336.00
+40.00 320.00
+*
+3 0
+0
+ARC
+28.00 302.00
+28.00 304.00
+28.00 304.00
+28.00 300.00
+30.00 302.00
+26.00 302.00
+*
+3 0
+0
+ARC
+14.00 320.00
+12.00 320.00
+12.00 320.00
+16.00 320.00
+14.00 322.00
+14.00 318.00
+*
+3 0
+0
+VECTOR
+96.00 252.00
+76.00 252.00
+*
+6 0
+0
+ARC
+68.00 258.00
+68.00 260.00
+68.00 260.00
+68.00 256.00
+70.00 258.00
+66.00 258.00
+*
+3 0
+0
+VECTOR
+64.00 248.00
+76.00 252.00
+*
+3 0
+0
+ARC
+68.00 246.00
+68.00 248.00
+68.00 248.00
+68.00 244.00
+70.00 246.00
+66.00 246.00
+*
+3 0
+0
+VECTOR
+352.00 384.00
+352.00 416.00
+512.00 416.00
+*
+6 0
+0
+VECTOR
+512.00 424.00
+512.00 408.00
+*
+3 0
+0
+VECTOR
+516.00 424.00
+516.00 408.00
+*
+6 0
+0
+VECTOR
+516.00 416.00
+564.00 416.00
+564.00 368.00
+592.00 368.00
+*
+6 0
+0
+VECTOR
+564.00 416.00
+564.00 448.00
+516.00 448.00
+*
+6 0
+0
+ARC
+480.00 454.00
+480.00 456.00
+480.00 456.00
+480.00 452.00
+482.00 454.00
+478.00 454.00
+*
+3 0
+0
+VECTOR
+476.00 444.00
+488.00 448.00
+*
+3 0
+0
+ARC
+480.00 442.00
+480.00 444.00
+480.00 444.00
+480.00 440.00
+482.00 442.00
+478.00 442.00
+*
+3 0
+0
+VECTOR
+512.00 456.00
+512.00 440.00
+*
+3 0
+0
+VECTOR
+516.00 456.00
+516.00 440.00
+*
+6 0
+0
+VECTOR
+488.00 448.00
+512.00 448.00
+*
+6 0
+0
+VECTOR
+480.00 440.00
+480.00 416.00
+*
+6 0
+0
+ARC
+352.00 384.00
+352.00 383.00
+352.00 385.00
+352.00 383.00
+353.00 384.00
+351.00 384.00
+*
+3 0
+0
+ARC
+480.00 416.00
+480.00 415.00
+480.00 417.00
+480.00 415.00
+481.00 416.00
+479.00 416.00
+*
+3 0
+0
+ARC
+564.00 416.00
+564.00 415.00
+564.00 417.00
+564.00 415.00
+565.00 416.00
+563.00 416.00
+*
+3 0
+0
+VECTOR
+480.00 456.00
+480.00 472.00
+*
+6 0
+0
+BOTCENT
+480.00 488.00
+452.00 488.00
+480.00 488.00
+509.00 488.00
+*
+1 1
+12 $- ^ vv REF$
+POLYGON
+484.00 480.00
+476.00 480.00
+476.00 476.00
+480.00 472.00
+484.00 476.00
+*
+3 21
+0
+ARC
+550.00 396.00
+548.00 396.00
+548.00 396.00
+552.00 396.00
+550.00 394.00
+550.00 398.00
+*
+3 0
+0
+VECTOR
+540.00 400.00
+544.00 388.00
+*
+3 0
+0
+VECTOR
+544.00 388.00
+544.00 316.00
+*
+6 0
+0
+VECTOR
+552.00 396.00
+552.00 416.00
+*
+6 0
+0
+ARC
+552.00 416.00
+552.00 415.00
+552.00 417.00
+552.00 415.00
+553.00 416.00
+551.00 416.00
+*
+3 0
+0
+CENTRIGHT
+516.00 352.00
+483.00 348.00
+499.00 348.00
+516.00 348.00
+*
+1 1
+7 $vv B1$
+POLYGON
+520.00 356.00
+520.00 348.00
+524.00 348.00
+528.00 352.00
+524.00 356.00
+*
+3 21
+0
+VECTOR
+512.00 280.00
+512.00 296.00
+*
+3 0
+0
+VECTOR
+516.00 280.00
+516.00 296.00
+*
+6 0
+0
+VECTOR
+564.00 288.00
+564.00 256.00
+516.00 256.00
+*
+6 0
+0
+ARC
+480.00 250.00
+480.00 248.00
+480.00 248.00
+480.00 252.00
+482.00 250.00
+478.00 250.00
+*
+3 0
+0
+VECTOR
+476.00 260.00
+488.00 256.00
+*
+3 0
+0
+ARC
+480.00 262.00
+480.00 260.00
+480.00 260.00
+480.00 264.00
+482.00 262.00
+478.00 262.00
+*
+3 0
+0
+VECTOR
+512.00 248.00
+512.00 264.00
+*
+3 0
+0
+VECTOR
+516.00 248.00
+516.00 264.00
+*
+6 0
+0
+VECTOR
+488.00 256.00
+512.00 256.00
+*
+6 0
+0
+VECTOR
+480.00 264.00
+480.00 288.00
+*
+6 0
+0
+ARC
+480.00 288.00
+480.00 289.00
+480.00 287.00
+480.00 289.00
+481.00 288.00
+479.00 288.00
+*
+3 0
+0
+ARC
+564.00 288.00
+564.00 289.00
+564.00 287.00
+564.00 289.00
+565.00 288.00
+563.00 288.00
+*
+3 0
+0
+VECTOR
+480.00 248.00
+480.00 232.00
+*
+6 0
+0
+ARC
+550.00 308.00
+548.00 308.00
+548.00 308.00
+552.00 308.00
+550.00 310.00
+550.00 306.00
+*
+3 0
+0
+VECTOR
+540.00 304.00
+544.00 316.00
+*
+3 0
+0
+VECTOR
+552.00 308.00
+552.00 288.00
+*
+6 0
+0
+ARC
+552.00 288.00
+552.00 289.00
+552.00 287.00
+552.00 289.00
+553.00 288.00
+551.00 288.00
+*
+3 0
+0
+VECTOR
+528.00 352.00
+544.00 352.00
+*
+6 0
+0
+ARC
+544.00 352.00
+544.00 351.00
+544.00 353.00
+544.00 351.00
+545.00 352.00
+543.00 352.00
+*
+3 0
+0
+VECTOR
+516.00 288.00
+564.00 288.00
+564.00 336.00
+592.00 336.00
+*
+6 0
+0
+VECTOR
+512.00 288.00
+448.00 288.00
+448.00 64.00
+*
+6 0
+0
+VECTOR
+352.00 416.00
+352.00 448.00
+*
+6 0
+0
+ARC
+352.00 416.00
+352.00 415.00
+352.00 417.00
+352.00 415.00
+353.00 416.00
+351.00 416.00
+*
+3 0
+0
+BOTCENT
+352.00 460.00
+343.00 460.00
+352.00 460.00
+361.00 460.00
+*
+1 1
+3 $A$
+POLYGON
+356.00 448.00
+348.00 448.00
+348.00 452.00
+352.00 456.00
+356.00 452.00
+*
+3 21
+0
+BOTCENT
+320.00 396.00
+307.00 396.00
+320.00 396.00
+333.00 396.00
+*
+1 1
+6 $cc F$
+BOTRIGHT
+348.00 328.00
+321.00 328.00
+334.00 328.00
+348.00 328.00
+*
+1 1
+6 $cc O$
+BOTCENT
+228.00 280.00
+215.00 280.00
+228.00 280.00
+242.00 280.00
+*
+1 1
+6 $cc C$
+BOTCENT
+128.00 272.00
+116.00 272.00
+128.00 272.00
+141.00 272.00
+*
+1 1
+6 $cc S$
+CENTLEFT
+204.00 256.00
+204.00 252.00
+227.00 252.00
+250.00 252.00
+*
+1 1
+10 $DP sub 2$
+BOTCENT
+68.00 264.00
+56.00 264.00
+68.00 264.00
+80.00 264.00
+*
+1 1
+4 $PN$
+TOPRIGHT
+388.00 380.00
+342.00 371.00
+365.00 371.00
+388.00 371.00
+*
+1 1
+10 $DP sub 2$
+TOPCENT
+392.00 348.00
+372.00 339.00
+392.00 339.00
+412.00 339.00
+*
+1 1
+6 $AGND$
+POLYGON
+396.00 352.00
+388.00 352.00
+388.00 356.00
+392.00 360.00
+396.00 356.00
+*
+3 21
+0
+VECTOR
+392.00 360.00
+392.00 376.00
+*
+6 0
+0
+TOPRIGHT
+540.00 396.00
+494.00 387.00
+517.00 387.00
+540.00 387.00
+*
+1 1
+10 $DP sub 1$
+CENTRIGHT
+508.00 440.00
+476.00 436.00
+492.00 436.00
+508.00 436.00
+*
+1 1
+7 $cc D1$
+CENTRIGHT
+508.00 408.00
+476.00 404.00
+492.00 404.00
+508.00 404.00
+*
+1 1
+7 $cc D2$
+BOTRIGHT
+508.00 268.00
+476.00 268.00
+492.00 268.00
+508.00 268.00
+*
+1 1
+7 $cc D1$
+BOTRIGHT
+508.00 300.00
+476.00 300.00
+492.00 300.00
+508.00 300.00
+*
+1 1
+7 $cc D2$
+VECTOR
+672.00 392.00
+672.00 344.00
+720.00 344.00
+720.00 392.00
+672.00 392.00
+*
+3 0
+0
+ARC
+696.00 396.00
+696.00 392.00
+696.00 400.00
+696.00 392.00
+700.00 396.00
+692.00 396.00
+*
+3 0
+0
+TOPCENT
+696.00 392.00
+688.00 383.00
+696.00 383.00
+705.00 383.00
+*
+1 1
+3 $R$
+ARC
+668.00 368.00
+668.00 364.00
+668.00 372.00
+668.00 364.00
+672.00 368.00
+664.00 368.00
+*
+3 0
+0
+CENTLEFT
+676.00 368.00
+676.00 364.00
+688.00 364.00
+700.00 364.00
+*
+1 1
+4 $CK$
+ARC
+724.00 368.00
+724.00 364.00
+724.00 372.00
+724.00 364.00
+720.00 368.00
+728.00 368.00
+*
+3 0
+0
+CENTRIGHT
+720.00 368.00
+688.00 364.00
+704.00 364.00
+720.00 364.00
+*
+1 1
+7 $O bar$
+CENTLEFT
+676.00 352.00
+676.00 348.00
+684.00 348.00
+693.00 348.00
+*
+1 1
+3 $D$
+CENTRIGHT
+720.00 352.00
+703.00 348.00
+711.00 348.00
+720.00 348.00
+*
+1 1
+3 $O$
+VECTOR
+656.00 352.00
+672.00 352.00
+*
+6 0
+0
+VECTOR
+720.00 352.00
+736.00 352.00
+736.00 176.00
+768.00 176.00
+*
+6 0
+0
+VECTOR
+728.00 368.00
+800.00 368.00
+*
+6 0
+0
+BOTRIGHT
+804.00 376.00
+762.00 376.00
+783.00 376.00
+804.00 376.00
+*
+1 1
+6 $DOWN$
+POLYGON
+800.00 372.00
+800.00 364.00
+804.00 364.00
+808.00 368.00
+804.00 372.00
+*
+3 21
+0
+VECTOR
+516.00 192.00
+564.00 192.00
+564.00 144.00
+592.00 144.00
+*
+6 0
+0
+VECTOR
+512.00 192.00
+432.00 192.00
+432.00 416.00
+*
+6 0
+0
+VECTOR
+512.00 200.00
+512.00 184.00
+*
+3 0
+0
+VECTOR
+516.00 200.00
+516.00 184.00
+*
+6 0
+0
+VECTOR
+564.00 192.00
+564.00 224.00
+516.00 224.00
+*
+6 0
+0
+ARC
+480.00 230.00
+480.00 232.00
+480.00 232.00
+480.00 228.00
+482.00 230.00
+478.00 230.00
+*
+3 0
+0
+VECTOR
+476.00 220.00
+488.00 224.00
+*
+3 0
+0
+ARC
+480.00 218.00
+480.00 220.00
+480.00 220.00
+480.00 216.00
+482.00 218.00
+478.00 218.00
+*
+3 0
+0
+VECTOR
+512.00 232.00
+512.00 216.00
+*
+3 0
+0
+VECTOR
+516.00 232.00
+516.00 216.00
+*
+6 0
+0
+VECTOR
+488.00 224.00
+512.00 224.00
+*
+6 0
+0
+VECTOR
+480.00 216.00
+480.00 192.00
+*
+6 0
+0
+ARC
+480.00 192.00
+480.00 191.00
+480.00 193.00
+480.00 191.00
+481.00 192.00
+479.00 192.00
+*
+3 0
+0
+ARC
+564.00 192.00
+564.00 191.00
+564.00 193.00
+564.00 191.00
+565.00 192.00
+563.00 192.00
+*
+3 0
+0
+VECTOR
+480.00 232.00
+480.00 248.00
+*
+6 0
+0
+VECTOR
+552.00 172.00
+552.00 192.00
+*
+6 0
+0
+ARC
+552.00 192.00
+552.00 191.00
+552.00 193.00
+552.00 191.00
+553.00 192.00
+551.00 192.00
+*
+3 0
+0
+TOPRIGHT
+508.00 220.00
+476.00 211.00
+492.00 211.00
+508.00 211.00
+*
+1 1
+7 $cc D1$
+TOPRIGHT
+508.00 188.00
+476.00 179.00
+492.00 179.00
+508.00 179.00
+*
+1 1
+7 $cc D2$
+VECTOR
+224.00 212.00
+192.00 212.00
+192.00 96.00
+316.00 96.00
+*
+6 0
+0
+VECTOR
+312.00 168.00
+256.00 168.00
+256.00 212.00
+288.00 212.00
+*
+6 0
+0
+VECTOR
+328.00 212.00
+416.00 212.00
+416.00 160.00
+356.00 160.00
+*
+6 0
+0
+VECTOR
+604.00 136.00
+612.00 136.00
+612.00 116.00
+620.00 116.00
+*
+6 0
+0
+ARC
+416.00 160.00
+416.00 161.00
+416.00 159.00
+416.00 161.00
+417.00 160.00
+415.00 160.00
+*
+3 0
+0
+CENTLEFT
+596.00 112.00
+596.00 108.00
+604.00 108.00
+613.00 108.00
+*
+1 1
+3 $-$
+CENTLEFT
+596.00 144.00
+596.00 140.00
+604.00 140.00
+612.00 140.00
+*
+1 1
+3 $+$
+POLYGON
+592.00 160.00
+592.00 96.00
+656.00 128.00
+592.00 160.00
+*
+3 1
+0
+ARC
+392.00 90.00
+392.00 88.00
+392.00 88.00
+392.00 92.00
+390.00 90.00
+394.00 90.00
+*
+3 0
+0
+VECTOR
+396.00 92.00
+384.00 96.00
+*
+3 0
+0
+ARC
+392.00 102.00
+392.00 100.00
+392.00 100.00
+392.00 104.00
+390.00 102.00
+394.00 102.00
+*
+3 0
+0
+ARC
+312.00 154.00
+312.00 152.00
+312.00 152.00
+312.00 156.00
+314.00 154.00
+310.00 154.00
+*
+3 0
+0
+CENTRIGHT
+276.00 128.00
+243.00 124.00
+259.00 124.00
+276.00 124.00
+*
+1 1
+7 $vv B2$
+POLYGON
+280.00 124.00
+280.00 132.00
+284.00 132.00
+288.00 128.00
+284.00 124.00
+*
+3 21
+0
+VECTOR
+308.00 156.00
+320.00 160.00
+*
+3 0
+0
+ARC
+312.00 166.00
+312.00 164.00
+312.00 164.00
+312.00 168.00
+314.00 166.00
+310.00 166.00
+*
+3 0
+0
+VECTOR
+356.00 152.00
+356.00 168.00
+*
+3 0
+0
+VECTOR
+352.00 152.00
+352.00 168.00
+*
+6 0
+0
+VECTOR
+320.00 160.00
+352.00 160.00
+*
+6 0
+0
+VECTOR
+320.00 88.00
+320.00 104.00
+*
+3 0
+0
+VECTOR
+316.00 88.00
+316.00 104.00
+*
+6 0
+0
+VECTOR
+312.00 152.00
+312.00 128.00
+288.00 128.00
+*
+6 0
+0
+VECTOR
+392.00 88.00
+416.00 88.00
+416.00 160.00
+*
+6 0
+0
+VECTOR
+320.00 96.00
+384.00 96.00
+*
+6 0
+0
+VECTOR
+352.00 96.00
+352.00 64.00
+512.00 64.00
+*
+6 0
+0
+VECTOR
+512.00 56.00
+512.00 72.00
+*
+3 0
+0
+VECTOR
+516.00 56.00
+516.00 72.00
+*
+6 0
+0
+VECTOR
+516.00 64.00
+564.00 64.00
+564.00 112.00
+592.00 112.00
+*
+6 0
+0
+VECTOR
+564.00 64.00
+564.00 32.00
+516.00 32.00
+*
+6 0
+0
+ARC
+480.00 26.00
+480.00 24.00
+480.00 24.00
+480.00 28.00
+482.00 26.00
+478.00 26.00
+*
+3 0
+0
+VECTOR
+476.00 36.00
+488.00 32.00
+*
+3 0
+0
+ARC
+480.00 38.00
+480.00 36.00
+480.00 36.00
+480.00 40.00
+482.00 38.00
+478.00 38.00
+*
+3 0
+0
+VECTOR
+512.00 24.00
+512.00 40.00
+*
+3 0
+0
+VECTOR
+516.00 24.00
+516.00 40.00
+*
+6 0
+0
+VECTOR
+488.00 32.00
+512.00 32.00
+*
+6 0
+0
+VECTOR
+480.00 40.00
+480.00 64.00
+*
+6 0
+0
+ARC
+352.00 96.00
+352.00 97.00
+352.00 95.00
+352.00 97.00
+353.00 96.00
+351.00 96.00
+*
+3 0
+0
+ARC
+480.00 64.00
+480.00 65.00
+480.00 63.00
+480.00 65.00
+481.00 64.00
+479.00 64.00
+*
+3 0
+0
+ARC
+564.00 64.00
+564.00 65.00
+564.00 63.00
+564.00 65.00
+565.00 64.00
+563.00 64.00
+*
+3 0
+0
+VECTOR
+480.00 24.00
+480.00 8.00
+*
+6 0
+0
+TOPCENT
+480.00 -4.00
+452.00 -13.00
+480.00 -13.00
+509.00 -13.00
+*
+1 1
+12 $- ^ vv REF$
+POLYGON
+484.00 0.00
+476.00 0.00
+476.00 4.00
+480.00 8.00
+484.00 4.00
+*
+3 21
+0
+ARC
+550.00 84.00
+548.00 84.00
+548.00 84.00
+552.00 84.00
+550.00 86.00
+550.00 82.00
+*
+3 0
+0
+VECTOR
+540.00 80.00
+544.00 92.00
+*
+3 0
+0
+VECTOR
+544.00 92.00
+544.00 164.00
+*
+6 0
+0
+VECTOR
+552.00 84.00
+552.00 64.00
+*
+6 0
+0
+ARC
+552.00 64.00
+552.00 65.00
+552.00 63.00
+552.00 65.00
+553.00 64.00
+551.00 64.00
+*
+3 0
+0
+CENTRIGHT
+516.00 128.00
+483.00 124.00
+499.00 124.00
+516.00 124.00
+*
+1 1
+7 $vv B1$
+POLYGON
+520.00 124.00
+520.00 132.00
+524.00 132.00
+528.00 128.00
+524.00 124.00
+*
+3 21
+0
+ARC
+550.00 172.00
+548.00 172.00
+548.00 172.00
+552.00 172.00
+550.00 170.00
+550.00 174.00
+*
+3 0
+0
+VECTOR
+540.00 176.00
+544.00 164.00
+*
+3 0
+0
+VECTOR
+528.00 128.00
+544.00 128.00
+*
+6 0
+0
+ARC
+544.00 128.00
+544.00 129.00
+544.00 127.00
+544.00 129.00
+545.00 128.00
+543.00 128.00
+*
+3 0
+0
+VECTOR
+352.00 64.00
+352.00 32.00
+*
+6 0
+0
+ARC
+352.00 64.00
+352.00 65.00
+352.00 63.00
+352.00 65.00
+353.00 64.00
+351.00 64.00
+*
+3 0
+0
+CENTCENT
+352.00 16.00
+344.00 12.00
+352.00 12.00
+360.00 12.00
+*
+1 1
+3 $B$
+POLYGON
+356.00 32.00
+348.00 32.00
+348.00 28.00
+352.00 24.00
+356.00 28.00
+*
+3 21
+0
+TOPCENT
+320.00 84.00
+307.00 75.00
+320.00 75.00
+333.00 75.00
+*
+1 1
+6 $cc F$
+TOPRIGHT
+348.00 160.00
+321.00 151.00
+334.00 151.00
+348.00 151.00
+*
+1 1
+6 $cc O$
+BOTRIGHT
+388.00 100.00
+342.00 100.00
+365.00 100.00
+388.00 100.00
+*
+1 1
+10 $DP sub 2$
+BOTCENT
+392.00 132.00
+372.00 132.00
+392.00 132.00
+412.00 132.00
+*
+1 1
+6 $AGND$
+POLYGON
+396.00 128.00
+388.00 128.00
+388.00 124.00
+392.00 120.00
+396.00 124.00
+*
+3 21
+0
+VECTOR
+392.00 120.00
+392.00 104.00
+*
+6 0
+0
+BOTRIGHT
+540.00 84.00
+494.00 84.00
+517.00 84.00
+540.00 84.00
+*
+1 1
+10 $DP sub 1$
+BOTRIGHT
+508.00 44.00
+476.00 44.00
+492.00 44.00
+508.00 44.00
+*
+1 1
+7 $cc D1$
+BOTRIGHT
+508.00 76.00
+476.00 76.00
+492.00 76.00
+508.00 76.00
+*
+1 1
+7 $cc D2$
+VECTOR
+672.00 88.00
+672.00 136.00
+720.00 136.00
+720.00 88.00
+672.00 88.00
+*
+3 0
+0
+ARC
+696.00 84.00
+696.00 88.00
+696.00 80.00
+696.00 88.00
+700.00 84.00
+692.00 84.00
+*
+3 0
+0
+BOTCENT
+696.00 88.00
+688.00 88.00
+696.00 88.00
+705.00 88.00
+*
+1 1
+3 $R$
+ARC
+668.00 112.00
+668.00 116.00
+668.00 108.00
+668.00 116.00
+672.00 112.00
+664.00 112.00
+*
+3 0
+0
+CENTLEFT
+676.00 112.00
+676.00 108.00
+688.00 108.00
+700.00 108.00
+*
+1 1
+4 $CK$
+ARC
+724.00 112.00
+724.00 116.00
+724.00 108.00
+724.00 116.00
+720.00 112.00
+728.00 112.00
+*
+3 0
+0
+CENTRIGHT
+720.00 112.00
+688.00 108.00
+704.00 108.00
+720.00 108.00
+*
+1 1
+7 $O bar$
+CENTLEFT
+676.00 128.00
+676.00 124.00
+684.00 124.00
+693.00 124.00
+*
+1 1
+3 $D$
+CENTRIGHT
+720.00 128.00
+703.00 124.00
+711.00 124.00
+720.00 124.00
+*
+1 1
+3 $O$
+VECTOR
+656.00 128.00
+672.00 128.00
+*
+6 0
+0
+VECTOR
+720.00 128.00
+800.00 128.00
+*
+6 0
+0
+CENTRIGHT
+804.00 120.00
+780.00 116.00
+792.00 116.00
+804.00 116.00
+*
+1 1
+4 $UP$
+POLYGON
+800.00 124.00
+800.00 132.00
+804.00 132.00
+808.00 128.00
+804.00 124.00
+*
+3 21
+0
+ARC
+256.00 212.00
+256.00 213.00
+256.00 211.00
+256.00 213.00
+257.00 212.00
+255.00 212.00
+*
+3 0
+0
+VECTOR
+224.00 204.00
+224.00 220.00
+*
+3 0
+0
+VECTOR
+228.00 204.00
+228.00 220.00
+*
+6 0
+0
+VECTOR
+228.00 212.00
+256.00 212.00
+*
+6 0
+0
+VECTOR
+192.00 224.00
+192.00 212.00
+160.00 212.00
+*
+6 0
+0
+ARC
+160.00 214.00
+160.00 212.00
+160.00 212.00
+160.00 216.00
+158.00 214.00
+162.00 214.00
+*
+3 0
+0
+VECTOR
+164.00 224.00
+152.00 220.00
+*
+3 0
+0
+ARC
+160.00 226.00
+160.00 224.00
+160.00 224.00
+160.00 228.00
+158.00 226.00
+162.00 226.00
+*
+3 0
+0
+ARC
+194.00 224.00
+196.00 224.00
+196.00 224.00
+192.00 224.00
+194.00 226.00
+194.00 222.00
+*
+3 0
+0
+VECTOR
+204.00 220.00
+200.00 232.00
+*
+3 0
+0
+VECTOR
+152.00 220.00
+128.00 220.00
+*
+6 0
+0
+ARC
+96.00 214.00
+96.00 212.00
+96.00 212.00
+96.00 216.00
+98.00 214.00
+94.00 214.00
+*
+3 0
+0
+VECTOR
+92.00 224.00
+104.00 220.00
+*
+3 0
+0
+ARC
+96.00 226.00
+96.00 224.00
+96.00 224.00
+96.00 228.00
+98.00 226.00
+94.00 226.00
+*
+3 0
+0
+VECTOR
+124.00 212.00
+124.00 228.00
+*
+3 0
+0
+VECTOR
+128.00 212.00
+128.00 228.00
+*
+6 0
+0
+VECTOR
+104.00 220.00
+124.00 220.00
+*
+6 0
+0
+VECTOR
+96.00 212.00
+96.00 160.00
+40.00 160.00
+*
+6 0
+0
+VECTOR
+96.00 228.00
+76.00 228.00
+*
+6 0
+0
+ARC
+68.00 222.00
+68.00 220.00
+68.00 220.00
+68.00 224.00
+70.00 222.00
+66.00 222.00
+*
+3 0
+0
+VECTOR
+64.00 232.00
+76.00 228.00
+*
+3 0
+0
+ARC
+68.00 234.00
+68.00 232.00
+68.00 232.00
+68.00 236.00
+70.00 234.00
+66.00 234.00
+*
+3 0
+0
+TOPCENT
+228.00 200.00
+215.00 191.00
+228.00 191.00
+242.00 191.00
+*
+1 1
+6 $cc C$
+TOPCENT
+128.00 208.00
+116.00 199.00
+128.00 199.00
+141.00 199.00
+*
+1 1
+6 $cc S$
+CENTLEFT
+204.00 224.00
+204.00 220.00
+227.00 220.00
+250.00 220.00
+*
+1 1
+10 $DP sub 2$
+CENTRIGHT
+154.00 240.00
+129.00 236.00
+141.00 236.00
+154.00 236.00
+*
+1 1
+5 $ITS$
+CENTCENT
+94.00 240.00
+84.00 236.00
+94.00 236.00
+105.00 236.00
+*
+1 1
+4 $SP$
+TOPCENT
+68.00 216.00
+56.00 207.00
+68.00 207.00
+80.00 207.00
+*
+1 1
+4 $PN$
+ARC
+432.00 416.00
+432.00 415.00
+432.00 417.00
+432.00 415.00
+433.00 416.00
+431.00 416.00
+*
+3 0
+0
+ARC
+448.00 64.00
+448.00 63.00
+448.00 65.00
+448.00 63.00
+449.00 64.00
+447.00 64.00
+*
+3 0
+0
+VECTOR
+480.00 248.00
+480.00 232.00
+*
+6 0
+0
+CENTRIGHT
+452.00 240.00
+396.00 236.00
+424.00 236.00
+452.00 236.00
+*
+1 1
+12 $+ ^ vv REF$
+POLYGON
+452.00 244.00
+452.00 236.00
+456.00 236.00
+460.00 240.00
+456.00 244.00
+*
+3 21
+0
+VECTOR
+460.00 240.00
+480.00 240.00
+*
+6 0
+0
+ARC
+480.00 240.00
+480.00 241.00
+480.00 239.00
+480.00 241.00
+481.00 240.00
+479.00 240.00
+*
+3 0
+0
+VECTOR
+160.00 252.00
+160.00 228.00
+*
+6 0
+0
+VECTOR
+160.00 240.00
+224.00 240.00
+*
+6 0
+0
+ARC
+160.00 240.00
+160.00 239.00
+160.00 241.00
+160.00 239.00
+161.00 240.00
+159.00 240.00
+*
+3 0
+0
+ARC
+200.00 240.00
+200.00 239.00
+200.00 241.00
+200.00 239.00
+201.00 240.00
+199.00 240.00
+*
+3 0
+0
+CENTLEFT
+236.00 240.00
+236.00 236.00
+252.00 236.00
+268.00 236.00
+*
+1 1
+5 $GND$
+POLYGON
+232.00 244.00
+232.00 236.00
+228.00 236.00
+224.00 240.00
+228.00 244.00
+*
+3 21
+0
+TOPRIGHT
+540.00 172.00
+494.00 163.00
+517.00 163.00
+540.00 163.00
+*
+1 1
+10 $DP sub 1$
+BOTRIGHT
+540.00 308.00
+494.00 308.00
+517.00 308.00
+540.00 308.00
+*
+1 1
+10 $DP sub 1$
+VECTOR
+340.00 260.00
+340.00 220.00
+300.00 240.00
+340.00 260.00
+*
+3 0
+0
+VECTOR
+340.00 232.00
+384.00 232.00
+384.00 224.00
+*
+6 0
+0
+POLYGON
+380.00 224.00
+392.00 224.00
+384.00 216.00
+376.00 224.00
+*
+6 21
+0
+VECTOR
+340.00 248.00
+392.00 248.00
+*
+6 0
+0
+BOTLEFT
+396.00 256.00
+396.00 256.00
+416.00 256.00
+437.00 256.00
+*
+1 1
+8 $vv INC$
+POLYGON
+400.00 252.00
+400.00 244.00
+396.00 244.00
+392.00 248.00
+396.00 252.00
+*
+3 21
+0
+CENTRIGHT
+336.00 248.00
+319.00 244.00
+327.00 244.00
+336.00 244.00
+*
+1 1
+3 $-$
+CENTRIGHT
+336.00 232.00
+320.00 228.00
+328.00 228.00
+336.00 228.00
+*
+1 1
+3 $+$
+VECTOR
+784.00 192.00
+768.00 192.00
+768.00 160.00
+784.00 160.00
+*
+3 0
+0
+ARC
+784.00 176.00
+784.00 160.00
+784.00 192.00
+*
+3 180
+0
+VECTOR
+784.00 256.00
+768.00 256.00
+768.00 224.00
+784.00 224.00
+*
+3 0
+0
+ARC
+784.00 240.00
+784.00 224.00
+784.00 256.00
+*
+3 180
+0
+ARC
+832.00 312.00
+832.00 296.00
+832.00 328.00
+*
+3 180
+0
+VECTOR
+832.00 328.00
+816.00 328.00
+816.00 296.00
+832.00 296.00
+*
+3 0
+0
+VECTOR
+744.00 368.00
+744.00 312.00
+772.00 312.00
+*
+6 0
+0
+VECTOR
+744.00 312.00
+744.00 240.00
+768.00 240.00
+*
+6 0
+0
+VECTOR
+728.00 112.00
+744.00 112.00
+744.00 232.00
+768.00 232.00
+*
+6 0
+0
+VECTOR
+800.00 304.00
+816.00 304.00
+*
+6 0
+0
+VECTOR
+816.00 320.00
+800.00 320.00
+800.00 332.00
+720.00 332.00
+*
+6 0
+0
+CENTRIGHT
+708.00 332.00
+683.00 328.00
+695.00 328.00
+708.00 328.00
+*
+1 1
+5 $ITS$
+POLYGON
+712.00 336.00
+712.00 328.00
+716.00 328.00
+720.00 332.00
+716.00 336.00
+*
+3 21
+0
+VECTOR
+760.00 332.00
+760.00 184.00
+768.00 184.00
+*
+6 0
+0
+VECTOR
+760.00 248.00
+768.00 248.00
+*
+6 0
+0
+VECTOR
+752.00 128.00
+752.00 168.00
+768.00 168.00
+*
+6 0
+0
+CENTLEFT
+828.00 240.00
+828.00 236.00
+843.00 236.00
+858.00 236.00
+*
+1 1
+5 $ABP$
+POLYGON
+816.00 244.00
+816.00 236.00
+820.00 236.00
+824.00 240.00
+820.00 244.00
+*
+3 21
+0
+VECTOR
+800.00 240.00
+816.00 240.00
+*
+6 0
+0
+CENTLEFT
+828.00 176.00
+828.00 172.00
+844.00 172.00
+860.00 172.00
+*
+1 1
+5 $ABN$
+POLYGON
+816.00 180.00
+816.00 172.00
+820.00 172.00
+824.00 176.00
+820.00 180.00
+*
+3 21
+0
+VECTOR
+800.00 176.00
+816.00 176.00
+*
+6 0
+0
+VECTOR
+848.00 312.00
+864.00 312.00
+*
+6 0
+0
+POLYGON
+864.00 316.00
+864.00 308.00
+868.00 308.00
+872.00 312.00
+868.00 316.00
+*
+3 21
+0
+CENTLEFT
+876.00 312.00
+876.00 308.00
+891.00 308.00
+907.00 308.00
+*
+1 1
+5 $ABC$
+ARC
+760.00 332.00
+760.00 331.00
+760.00 333.00
+760.00 331.00
+761.00 332.00
+759.00 332.00
+*
+3 0
+0
+ARC
+744.00 368.00
+744.00 367.00
+744.00 369.00
+744.00 367.00
+745.00 368.00
+743.00 368.00
+*
+3 0
+0
+ARC
+744.00 312.00
+744.00 311.00
+744.00 313.00
+744.00 311.00
+745.00 312.00
+743.00 312.00
+*
+3 0
+0
+ARC
+760.00 248.00
+760.00 247.00
+760.00 249.00
+760.00 247.00
+761.00 248.00
+759.00 248.00
+*
+3 0
+0
+VECTOR
+752.00 168.00
+752.00 296.00
+772.00 296.00
+*
+6 0
+0
+ARC
+752.00 128.00
+752.00 127.00
+752.00 129.00
+752.00 127.00
+753.00 128.00
+751.00 128.00
+*
+3 0
+0
+ARC
+752.00 168.00
+752.00 167.00
+752.00 169.00
+752.00 167.00
+753.00 168.00
+751.00 168.00
+*
+3 0
+0
+ARC
+28.00 178.00
+28.00 180.00
+28.00 180.00
+28.00 176.00
+30.00 178.00
+26.00 178.00
+*
+3 0
+0
+VECTOR
+24.00 176.00
+40.00 160.00
+*
+3 0
+0
+ARC
+28.00 142.00
+28.00 144.00
+28.00 144.00
+28.00 140.00
+30.00 142.00
+26.00 142.00
+*
+3 0
+0
+ARC
+14.00 160.00
+12.00 160.00
+12.00 160.00
+16.00 160.00
+14.00 162.00
+14.00 158.00
+*
+3 0
+0
+VECTOR
+28.00 300.00
+0.00 300.00
+0.00 180.00
+28.00 180.00
+*
+6 0
+0
+VECTOR
+12.00 320.00
+-16.00 320.00
+-16.00 160.00
+12.00 160.00
+*
+6 0
+0
+VECTOR
+28.00 140.00
+-32.00 140.00
+-32.00 340.00
+28.00 340.00
+*
+6 0
+0
+CENTRIGHT
+-60.00 268.00
+-116.00 264.00
+-88.00 264.00
+-60.00 264.00
+*
+1 1
+12 $+ ^ vv REF$
+POLYGON
+-56.00 272.00
+-56.00 264.00
+-52.00 264.00
+-48.00 268.00
+-52.00 272.00
+*
+3 21
+0
+VECTOR
+-48.00 268.00
+-32.00 268.00
+*
+6 0
+0
+ARC
+-32.00 268.00
+-32.00 267.00
+-32.00 269.00
+-32.00 267.00
+-31.00 268.00
+-33.00 268.00
+*
+3 0
+0
+ARC
+-16.00 240.00
+-16.00 239.00
+-16.00 241.00
+-16.00 239.00
+-15.00 240.00
+-17.00 240.00
+*
+3 0
+0
+VECTOR
+-48.00 240.00
+-16.00 240.00
+*
+6 0
+0
+POLYGON
+-56.00 244.00
+-56.00 236.00
+-52.00 236.00
+-48.00 240.00
+-52.00 244.00
+*
+3 21
+0
+CENTRIGHT
+-60.00 240.00
+-100.00 236.00
+-80.00 236.00
+-60.00 236.00
+*
+1 1
+6 $AGND$
+CENTRIGHT
+-60.00 212.00
+-117.00 208.00
+-89.00 208.00
+-60.00 208.00
+*
+1 1
+12 $- ^ vv REF$
+POLYGON
+-56.00 216.00
+-56.00 208.00
+-52.00 208.00
+-48.00 212.00
+-52.00 216.00
+*
+3 21
+0
+VECTOR
+-48.00 212.00
+0.00 212.00
+*
+6 0
+0
+ARC
+0.00 212.00
+0.00 211.00
+0.00 213.00
+0.00 211.00
+1.00 212.00
+-1.00 212.00
+*
+3 0
+0
+BOTRIGHT
+24.00 344.00
+-6.00 344.00
+9.00 344.00
+24.00 344.00
+*
+1 1
+5 $ABP$
+BOTRIGHT
+12.00 324.00
+-19.00 324.00
+-4.00 324.00
+12.00 324.00
+*
+1 1
+5 $ABC$
+BOTRIGHT
+24.00 304.00
+-8.00 304.00
+8.00 304.00
+24.00 304.00
+*
+1 1
+5 $ABN$
+BOTRIGHT
+24.00 184.00
+-6.00 184.00
+9.00 184.00
+24.00 184.00
+*
+1 1
+5 $ABP$
+BOTRIGHT
+12.00 164.00
+-19.00 164.00
+-4.00 164.00
+12.00 164.00
+*
+1 1
+5 $ABC$
+BOTRIGHT
+24.00 144.00
+-8.00 144.00
+8.00 144.00
+24.00 144.00
+*
+1 1
+5 $ABN$
+VECTOR
+68.00 260.00
+52.00 260.00
+52.00 220.00
+68.00 220.00
+*
+6 0
+0
+VECTOR
+68.00 244.00
+68.00 236.00
+*
+6 0
+0
+VECTOR
+68.00 240.00
+40.00 240.00
+*
+6 0
+0
+VECTOR
+52.00 260.00
+40.00 260.00
+*
+6 0
+0
+CENTRIGHT
+32.00 260.00
+-21.00 256.00
+5.00 256.00
+32.00 256.00
+*
+1 1
+12 $+ ^ vv SIG$
+POLYGON
+32.00 264.00
+32.00 256.00
+36.00 256.00
+40.00 260.00
+36.00 264.00
+*
+3 21
+0
+POLYGON
+32.00 244.00
+32.00 236.00
+36.00 236.00
+40.00 240.00
+36.00 244.00
+*
+3 21
+0
+CENTRIGHT
+32.00 240.00
+-22.00 236.00
+5.00 236.00
+32.00 236.00
+*
+1 1
+12 $- ^ vv SIG$
+ARC
+52.00 260.00
+52.00 259.00
+52.00 261.00
+52.00 259.00
+53.00 260.00
+51.00 260.00
+*
+3 0
+0
+ARC
+68.00 240.00
+68.00 239.00
+68.00 241.00
+68.00 239.00
+69.00 240.00
+67.00 240.00
+*
+3 0
+0
+VECTOR
+64.00 112.00
+96.00 112.00
+96.00 96.00
+*
+6 0
+0
+VECTOR
+88.00 96.00
+104.00 96.00
+*
+3 0
+0
+VECTOR
+88.00 92.00
+104.00 92.00
+*
+6 0
+0
+VECTOR
+96.00 92.00
+96.00 76.00
+*
+6 0
+0
+ARC
+90.00 68.00
+88.00 68.00
+88.00 68.00
+92.00 68.00
+90.00 70.00
+90.00 66.00
+*
+3 0
+0
+VECTOR
+92.00 64.00
+96.00 76.00
+*
+3 0
+0
+ARC
+102.00 68.00
+100.00 68.00
+100.00 68.00
+104.00 68.00
+102.00 70.00
+102.00 66.00
+*
+3 0
+0
+VECTOR
+128.00 92.00
+128.00 4.00
+*
+6 0
+0
+VECTOR
+120.00 96.00
+136.00 96.00
+*
+3 0
+0
+VECTOR
+120.00 92.00
+136.00 92.00
+*
+6 0
+0
+BOTCENT
+128.00 124.00
+119.00 124.00
+128.00 124.00
+137.00 124.00
+*
+1 1
+3 $A$
+POLYGON
+132.00 120.00
+124.00 120.00
+124.00 116.00
+128.00 112.00
+132.00 116.00
+*
+3 21
+0
+VECTOR
+128.00 112.00
+128.00 96.00
+*
+6 0
+0
+VECTOR
+88.00 68.00
+76.00 68.00
+76.00 28.00
+88.00 28.00
+*
+6 0
+0
+VECTOR
+104.00 68.00
+116.00 68.00
+116.00 28.00
+104.00 28.00
+*
+6 0
+0
+BOTLEFT
+100.00 100.00
+100.00 100.00
+114.00 100.00
+128.00 100.00
+*
+1 1
+6 $cc Y$
+BOTLEFT
+132.00 100.00
+132.00 100.00
+145.00 100.00
+158.00 100.00
+*
+1 1
+6 $cc Z$
+BOTRIGHT
+92.00 72.00
+46.00 72.00
+69.00 72.00
+92.00 72.00
+*
+1 1
+10 $DP sub 1$
+CENTRIGHT
+52.00 112.00
+8.00 108.00
+30.00 108.00
+52.00 108.00
+*
+1 1
+10 $+ ^ vv O$
+POLYGON
+56.00 116.00
+56.00 108.00
+60.00 108.00
+64.00 112.00
+60.00 116.00
+*
+3 21
+0
+BOTCENT
+384.00 300.00
+362.00 300.00
+384.00 300.00
+406.00 300.00
+*
+1 1
+10 $+ ^ vv O$
+POLYGON
+388.00 288.00
+380.00 288.00
+380.00 292.00
+384.00 296.00
+388.00 292.00
+*
+3 21
+0
+VECTOR
+384.00 288.00
+384.00 268.00
+*
+6 0
+0
+ARC
+384.00 268.00
+384.00 267.00
+384.00 269.00
+384.00 267.00
+385.00 268.00
+383.00 268.00
+*
+3 0
+0
+TOPCENT
+384.00 180.00
+362.00 171.00
+384.00 171.00
+407.00 171.00
+*
+1 1
+10 $- ^ vv O$
+POLYGON
+388.00 192.00
+380.00 192.00
+380.00 188.00
+384.00 184.00
+388.00 188.00
+*
+3 21
+0
+VECTOR
+384.00 192.00
+384.00 212.00
+*
+6 0
+0
+ARC
+384.00 212.00
+384.00 213.00
+384.00 211.00
+384.00 213.00
+385.00 212.00
+383.00 212.00
+*
+3 0
+0
+TOPLEFT
+132.00 -4.00
+132.00 -13.00
+145.00 -13.00
+158.00 -13.00
+*
+1 1
+6 $cc Z$
+VECTOR
+64.00 -16.00
+96.00 -16.00
+96.00 0.00
+*
+6 0
+0
+VECTOR
+88.00 0.00
+104.00 0.00
+*
+3 0
+0
+VECTOR
+88.00 4.00
+104.00 4.00
+*
+6 0
+0
+VECTOR
+96.00 4.00
+96.00 20.00
+*
+6 0
+0
+ARC
+90.00 28.00
+88.00 28.00
+88.00 28.00
+92.00 28.00
+90.00 26.00
+90.00 30.00
+*
+3 0
+0
+VECTOR
+92.00 32.00
+96.00 20.00
+*
+3 0
+0
+ARC
+102.00 28.00
+100.00 28.00
+100.00 28.00
+104.00 28.00
+102.00 26.00
+102.00 30.00
+*
+3 0
+0
+VECTOR
+120.00 0.00
+136.00 0.00
+*
+3 0
+0
+VECTOR
+120.00 4.00
+136.00 4.00
+*
+6 0
+0
+TOPCENT
+128.00 -28.00
+120.00 -37.00
+128.00 -37.00
+136.00 -37.00
+*
+1 1
+3 $B$
+POLYGON
+132.00 -24.00
+124.00 -24.00
+124.00 -20.00
+128.00 -16.00
+132.00 -20.00
+*
+3 21
+0
+VECTOR
+128.00 -16.00
+128.00 0.00
+*
+6 0
+0
+TOPLEFT
+100.00 -4.00
+100.00 -13.00
+114.00 -13.00
+128.00 -13.00
+*
+1 1
+6 $cc Y$
+CENTRIGHT
+92.00 24.00
+46.00 20.00
+69.00 20.00
+92.00 20.00
+*
+1 1
+10 $DP sub 1$
+CENTRIGHT
+52.00 -16.00
+8.00 -20.00
+30.00 -20.00
+52.00 -20.00
+*
+1 1
+10 $+ ^ vv O$
+POLYGON
+56.00 -20.00
+56.00 -12.00
+60.00 -12.00
+64.00 -16.00
+60.00 -20.00
+*
+3 21
+0
+VECTOR
+116.00 48.00
+152.00 48.00
+*
+6 0
+0
+CENTLEFT
+164.00 48.00
+164.00 44.00
+184.00 44.00
+205.00 44.00
+*
+1 1
+8 $vv INC$
+POLYGON
+152.00 44.00
+152.00 52.00
+156.00 52.00
+160.00 48.00
+156.00 44.00
+*
+3 21
+0
+ARC
+116.00 48.00
+116.00 49.00
+116.00 47.00
+116.00 49.00
+117.00 48.00
+115.00 48.00
+*
+3 0
+0
+ARC
+128.00 48.00
+128.00 49.00
+128.00 47.00
+128.00 49.00
+129.00 48.00
+127.00 48.00
+*
+3 0
+0
+ARC
+76.00 48.00
+76.00 49.00
+76.00 47.00
+76.00 49.00
+77.00 48.00
+75.00 48.00
+*
+3 0
+0
+VECTOR
+56.00 48.00
+76.00 48.00
+*
+6 0
+0
+POLYGON
+48.00 52.00
+48.00 44.00
+52.00 44.00
+56.00 48.00
+52.00 52.00
+*
+3 21
+0
+CENTRIGHT
+48.00 48.00
+15.00 44.00
+31.00 44.00
+48.00 44.00
+*
+1 1
+7 $vv B1$
+-1
diff --git a/contrib/groff/doc/grnexmpl.me b/contrib/groff/doc/grnexmpl.me
new file mode 100644
index 0000000..f7f684c
--- /dev/null
+++ b/contrib/groff/doc/grnexmpl.me
@@ -0,0 +1,86 @@
+.sc
+.nr pp 12
+.nr tp 12
+.nr sp 12
+.nr fi 0
+.st ug
+.ls 1
+.po 1i
+.pl 11i
+.EQ
+gsize 12
+delim $$
+define // 'over down 10'
+define sw 'phi sub'
+define aa 'A sub'
+define vv 'V sub'
+define mm 'M sub'
+define nn 'N sub'
+define cc 'C sub'
+define ll 'L sub'
+define rr 'R sub'
+define ss 'S sub'
+define gg 'g sub'
+define ff 'F sub'
+define qq 'Q sub'
+define qqq '{C prime} sub'
+define pp 'P sub'
+define tt 'T sub'
+define zz 'Z sub'
+define kk 'K sub'
+define ii 'I sub'
+define iis 'IC sub'
+define e2 '2 sup'
+define sunc '{ sin x } / x'
+define vddm1V 'vv DD - 1 ^ roman V'
+define vssp1V 'vv SS + 1 ^ roman V'
+.EN
+.pp
+The following slide shows the complete schematics of the
+fully-differential RIC. The operation includes a
+correlated-double-sampling phase that occurs once every 256
+clock periods, also called the
+.i "spreading ratio" .
+This reset phase is controlled by clocks $ DP sub 1 $ and $ DP
+sub 2 $ in which the integrator is initialized by totally
+removing the charge from $ cc F $ and storing the low-frequency
+noise of the op amp in $ cc C $. At the same time the comparison
+thresholds are set.
+.fl
+.po -0.2i
+.sp 2
+.lp
+.(b
+.EQ
+gsize -4
+.EN
+.GS
+roman 1
+italics 2
+bold 3
+special 4
+narrow 1
+medium 3
+thick 5
+width 5.5
+l mg
+file grnexmpl.g
+.GE
+.EQ
+gsize +4
+.EN
+.)b
+.fl
+.po +0.2i
+.pp
+The faster clocks are $ PN $, $ ITS $ and $ SP $. The sampling
+capacitor $ cc S $ performs the delayed subtraction of a sample
+of the input signal $ +- ^ vv SIG $ and a choice of $ - ^ vv REF
+$, $ AGND $ or $ + ^ vv REF $ according to the operations
+performed by the logic partially depicted operating on past
+results of the comparisons. The synchronous comparators are
+reset at this fast rates, thus performing one comparison for
+every fast clock cycle. The dynamic common-mode feedback
+arrangement operates synchronously with the reset time slot and
+its configuration is equivalent to that in the differential
+feedback path.
diff --git a/contrib/groff/doc/groff.texinfo b/contrib/groff/doc/groff.texinfo
index 85d92c6..ca13abb 100644
--- a/contrib/groff/doc/groff.texinfo
+++ b/contrib/groff/doc/groff.texinfo
@@ -1,4 +1,11 @@
\input texinfo @c -*-texinfo-*-
+
+@c
+@c If you use texinfo.tex 1999-09-25.10 or earlier please convert this
+@c manual with `texi2dvi -e groff.texinfo' due to a bug in expanding
+@c user-defined macros.
+@c
+
@c %**start of header (This is for running Texinfo on a region.)
@setfilename groff
@settitle The GNU Troff Manual
@@ -7,9 +14,65 @@
@c %**end of header (This is for running Texinfo on a region.)
+@c We use the following indices:
+@c
+@c cindex: concepts
+@c findex: requests, escapes, and functions
+@c vindex: registers
+@c kindex: commands in font files
+@c pindex: programs and files
+@c tindex: environment variables
+@c maindex: macros and strings
+@c glindex: glyph names
+@c opindex: operators
+@c
+@c tindex and cindex are merged.
+
+@defcodeindex ma
+@defcodeindex gl
+@defcodeindex op
+@syncodeindex tp cp
+
+
+@macro Deffn{category, name, arg}
+@deffn \category\ @t{\name\} \arg\
+@end macro
+
+@macro end_Deffn
+@end deffn
+@end macro
+
+@macro Deffnx{category, name, arg}
+@deffnx \category\ @t{\name\} \arg\
+@end macro
+
+@macro end_Deffnx
+@end deffnx
+@end macro
+
+@macro Defmac{name, arg}
+@defmac @t{\name\} \arg\
+@end macro
+
+@macro end_Defmac
+@end defmac
+@end macro
+
+@macro Defmacx{name, arg}
+@defmacx @t{\name\} \arg\
+@end macro
+
+@macro end_Defmacx
+@end defmacx
+@end macro
+
+
+@c XXX comment all examples
+
+
@dircategory Miscellaneous
@direntry
-* Groff: (groff). The GNU troff document formatting system.
+* Groff: (groff). The GNU troff document formatting system.
@end direntry
@@ -22,13 +85,13 @@
@ifinfo
-This Info file documents GNU troff version 1.12.
+This Info file documents GNU troff version 1.16.
Published by the Free Software Foundation
59 Temple Place, Suite 330
Boston, MA 02111-1307 USA
-Copyright (C) 1994, 1999 Free Software Foundation, Inc.
+Copyright (C) 1994-2000 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
@@ -68,22 +131,21 @@ instead of in the original English.
@titlepage
@title groff
-@subtitle The GNU implementation of @code{groff}
-@subtitle Edition 1.12
-@subtitle October 1999
+@subtitle The GNU implementation of @code{troff}
+@subtitle Edition 1.16
+@subtitle Spring 2000
@author by Trent A.@w{ }Fisher
-@author and the maintainer of groff
+@author and Werner Lemberg
@c Include the Distribution inside the titlepage environment so
@c that headings are turned off. Headings on and off do not work.
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1994, 1999 Free Software Foundation, Inc.
-
+Copyright @copyright@w{ }1994-2000 Free Software Foundation,@w{ }Inc.
@sp 2
-Version 1.13 of @code{groff}, @*
-October 1999
+Version 1.16 of @code{groff}, @*
+Spring 2000
@sp 2
Published by the Free Software Foundation @*
59 Temple Place, Suite 330 @*
@@ -96,10 +158,10 @@ preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
-section entitled ``GNU General Public License'' is included
-exactly as in the original, and provided that the entire resulting
-derived work is distributed under the terms of a permission notice
-identical to this one.
+section entitled ``GNU General Public License'' is included exactly as
+in the original, and provided that the entire resulting derived work is
+distributed under the terms of a permission notice identical to this
+one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
@@ -116,7 +178,7 @@ Cover art by Etienne Suvasa.
@node Top, Copying, (dir), (dir)
@ifinfo
-This Info file documents groff version 1.13, the GNU implementation of
+This Info file documents groff version 1.16, the GNU implementation of
the troff typesetting system.
This is an in-progress document; contributions, comments, or
@@ -128,25 +190,19 @@ contributions are welcome. Send them to bug-groff@@gnu.org.
* Introduction::
* Invoking groff::
* Tutorial for Macro Users::
-* -man::
-* -ms::
-* -me::
-* -mm::
+* Macro Packages::
* Programming Tutorial::
-* geqn::
-* gtbl::
-* gpic::
-* grap::
-* grefer::
-* gsoelim::
-* Devices::
+* Preprocessors::
+* Output Devices::
* File formats::
* Installation::
-* Request Index::
+* Request and Escape Index::
+* Operator Index::
* Register Index::
-* String Index::
-* Macro Index::
-* Program Index::
+* Macro and String Index::
+* Glyph Name Index::
+* Font File Keyword Index::
+* Program and File Index::
* Concept Index::
@end menu
@@ -158,8 +214,8 @@ contributions are welcome. Send them to bug-groff@@gnu.org.
@center Version 2, June 1991
@display
-Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111, USA
+Copyright @copyright{}@w{ }1989, 1991 Free Software Foundation, Inc.
+59@w{ }Temple Place, Suite@w{ }330, Boston, MA@w{ }02111, USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
@@ -303,27 +359,29 @@ scope of this License.
@item
You may copy and distribute the Program (or a work based on it, under
Section@w{ }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:
+Sections@w{ }1 and@w{ }2 above provided that you also do one of the
+following:
@enumerate a
@item
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,
+code, which must be distributed under the terms of Sections@w{ }1 and@w{
+}2 above on a medium customarily used for software interchange; or,
@item
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,
+corresponding source code, to be distributed under the terms of
+Sections@w{ }1 and@w{ }2 above on a medium customarily used for software
+interchange; or,
@item
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.)
+Subsection@w{ }b above.)
@end enumerate
The source code for a work means the preferred form of the work for
@@ -490,19 +548,19 @@ the exclusion of warranty; and each file should have at least the
@var{one line to give the program's name and an idea of what it does.}
Copyright (C) 19@var{yy} @var{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 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, USA.
+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, USA.
@end smallexample
Also add information on how to contact you by electronic and paper mail.
@@ -513,15 +571,15 @@ when it starts in an interactive mode:
@smallexample
Gnomovision version 69, Copyright (C) 19@var{yy} @var{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.
+`show w'. This is free software, and you are welcome to redistribute
+it under certain conditions; type `show c' for details.
@end smallexample
-The hypothetical commands @samp{show w} and @samp{show c} should show
-the appropriate parts of the General Public License. Of course, the
-commands you use may be called something other than @samp{show w} and
-@samp{show c}; they could even be mouse-clicks or menu items---whatever
-suits your program.
+The hypothetical commands @samp{show@w{ }w} and @samp{show@w{ }c} should
+show the appropriate parts of the General Public License. Of course,
+the commands you use may be called something other than @samp{show@w{
+}w} and @samp{show@w{ }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
@@ -529,10 +587,9 @@ necessary. Here is a sample; alter the names:
@smallexample
@group
-Yoyodyne, Inc., hereby disclaims all copyright
-interest in the program `Gnomovision'
-(which makes passes at compilers) written
-by James Hacker.
+Yoyodyne, Inc., hereby disclaims all copyright interest
+in the program `Gnomovision' (which makes passes at compilers)
+written by James Hacker.
@var{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
@@ -547,6 +604,9 @@ General Public License instead of this License.
+@c =====================================================================
+@c =====================================================================
+
@node Introduction, Invoking groff, Copying, Top
@chapter Introduction
@cindex introduction
@@ -554,54 +614,59 @@ General Public License instead of this License.
GNU @code{troff} (or @code{groff}) is a system for typesetting
documents. @code{troff} is very flexible and has been in existence (and
use) for about 3@w{ }decades. It is quite widespread and firmly
-entrenched in the @sc{Unix} community.
-
-
+entrenched in the @acronym{UNIX} community.
@menu
* What Is groff?::
* History::
* groff Capabilities::
-* Macro Packages::
-* Preprocessors::
-* Postprocessors::
+* Macro Package Intro::
+* Preprocessor Intro::
+* Output device intro::
* Credits::
@end menu
+
+@c =====================================================================
+
@node What Is groff?, History, Introduction, Introduction
@section What Is @code{groff}?
@cindex what is @code{groff}?
@cindex @code{groff} -- what is it?
-
-@code{groff} is of an older generation of document preparation systems,
-which operate more like compilers than the more recent interactive
-WYSIWYG @footnote{What You See Is What You Get} systems. @code{groff}
-and its contemporary counterpart, @TeX{}, both work using a @dfn{batch}
-paradigm: The input (or @dfn{source}) files are normal text files with
-embedded formatting commands. These files can then be processed by
-@code{groff} to produce a typeset document on a variety of devices.
+@code{groff} belongs to an older generation of document preparation
+systems, which operate more like compilers than the more recent
+interactive @acronym{WYSIWYG}@footnote{What You See Is What You Get}
+systems. @code{groff} and its contemporary counterpart, @TeX{}, both
+work using a @dfn{batch} paradigm: The input (or @dfn{source}) files are
+normal text files with embedded formatting commands. These files can
+then be processed by @code{groff} to produce a typeset document on a
+variety of devices.
Likewise, @code{groff} should not be confused with a @dfn{word
processor}, since that term connotes an integrated system which includes
an editor and a text formatter. Also, many word processors follow the
-WYSIWYG paradigm which was discussed earlier.
+@acronym{WYSIWYG} paradigm which was discussed earlier.
-Although WYSIWYG systems may be easier to use, they have a number of
-disadvantages compared to @code{troff}:
+Although @acronym{WYSIWYG} systems may be easier to use, they have a
+number of disadvantages compared to @code{troff}:
-@itemize @bullet{}
+@itemize @bullet
@item
-They must be used on a bitmapped display to do any operations on your
+They must be used on a graphics display to do any operations on a
document.
+
@item
-Most of the WYSIWYG systems are either non-free or are not very
-portable.
+Most of the @acronym{WYSIWYG} systems are either non-free or are not
+very portable.
+
@item
-@code{troff} is firmly entrenched in all @sc{Unix} systems.
+@code{troff} is firmly entrenched in all @acronym{UNIX} systems.
+
@item
It is difficult to have a wide range of capabilities available within
the confines of a GUI/window system.
+
@item
It is more difficult to make global changes to a document.
@end itemize
@@ -613,44 +678,54 @@ impossible to accomplish complex actions.'' --Doug Gwyn (22/Jun/91 in
@end quotation
+@c =====================================================================
@node History, groff Capabilities, What Is groff?, Introduction
@section History
@cindex history
+@cindex @code{runoff}
+@cindex @code{rf}
@code{troff} can trace its origins back to a formatting program called
-@code{runoff} which ran on MIT's CTSS system. This name came from the
-common phrase of the time ``I'll run off a document.''
-
-The first version of @sc{Unix} was developed on a PDP-7 which was
+@code{runoff}, written by J.@w{ }E.@w{ }Saltzer, which ran on MIT's CTSS
+operating system in the mid-sixties. This name came from the common
+phrase of the time ``I'll run off a document.'' Bob Morris ported it to
+the 635 architecture and called the program @code{roff} (an abbreviation
+of @code{runoff}). It has then been rewritten as @code{rf} for the
+PDP-7 (before having @acronym{UNIX}), and at the same time (1969), Doug
+McIllroy rewrote an extended and simplified version of @code{roff} in
+the @acronym{BCPL} programming language.
+
+@cindex @code{roff}
+The first version of @acronym{UNIX} was developed on a PDP-7 which was
sitting around Bell Labs. In 1971 the developers wanted to get a PDP-11
for further work on the operating system. In order to justify the cost
for this system, they proposed that they would implement a document
formatting system for the AT&T patents division. This first formatting
-program was a reimplementation of @code{runoff}. In accordance with
-@sc{Unix}'s penchant for abreviations, it was named @code{roff} (an
-abreviation of @code{runoff}).
+program was a reimplementation of McIllroy's @code{roff}, written by
+J.@w{ }F.@w{ }Ossanna.
+@cindex @code{nroff}
When they needed a more flexible language, a new version of @code{roff}
-called @code{nroff} (Newer @code{roff}) was written. It had a much more
-complicated syntax, but provided the basis for all future versions.
-When they got a Graphic Systems CAT Phototypesetter, J.@w{ }F.@w{
-}Ossanna wrote a version of @code{nroff} which would drive it. It was
-dubbed @code{troff} for typesetter @code{roff}, although many people
-have speculated that it actually means Times @code{roff} because of
-@code{troff}'s use of the Times font family by default. As such, the
-name @code{troff} is pronounced t-roff rather than trough.
+called @code{nroff} (``Newer @code{roff}'') was written. It had a much
+more complicated syntax, but provided the basis for all future versions.
+When they got a Graphic Systems CAT Phototypesetter, Ossanna wrote a
+version of @code{nroff} which would drive it. It was dubbed
+@code{troff}, for ``typesetter @code{roff}'', although many people have
+speculated that it actually means ``Times @code{roff}'' because of the
+use of the Times font family in @code{troff} by default. As such, the
+name @code{troff} is pronounced `@w{t-roff}' rather than `trough'.
With @code{troff} came @code{nroff} (they were actually the same program
-except for some @samp{#ifdefs}), which was for producing output for line
-printers and ascii terminals. It understood everything @code{troff}
-did, and ignored the commands which were not aplicable (i.e.@: font
+except for some @samp{#ifdef}s), which was for producing output for line
+printers and character terminals. It understood everything @code{troff}
+did, and ignored the commands which were not applicable (e.g.@: font
changes).
Since there are several things which cannot be done easily in
@code{troff}, work on several preprocessors began. These programs would
transform certain parts of a document into @code{troff}, which made a
-very natural use of pipes in @sc{Unix}.
+very natural use of pipes in @acronym{UNIX}.
The @code{eqn} preprocessor allowed mathematical formul@ae{} to be
specified in a much simpler and more intuitive manner. @code{tbl} is a
@@ -663,16 +738,17 @@ language and produced output specifically for the CAT phototypesetter.
He rewrote it in C, although it was now 7000@w{ }lines of uncommented
code and still dependent on the CAT. As the CAT became less common, and
was no longer supported by the manufacturer, the need to make it support
-other devices became a priority. However, before this could be done, he
-was killed in an auto accident.
+other devices became a priority. However, before this could be done,
+Ossanna was killed in an auto accident.
@pindex ditroff
+@cindex @code{ditroff}
So, Brian Kernighan took on the task of rewriting @code{troff}. The
newly rewritten version produced a device independent code which was
very easy for postprocessors to read and translate to the appropriate
printer codes. Also, this new version of @code{troff} (called
-@code{ditroff}) had several extentions, which included drawing
-functions.
+@code{ditroff} for ``device independent @code{troff}'') had several
+extensions, which included drawing functions.
Due to the additional abilities of the new version of @code{troff},
several new preprocessors appeared. The @code{pic} preprocessor
@@ -683,21 +759,24 @@ other preprocessors, produced @code{pic} code.
James Clark began work on a GNU implementation of @code{ditroff} in
early@w{ }1989. The first version, @code{groff}@w{ }0.3.1, was released
-June@w{ }1990. @code{groff} included
+June@w{ }1990. @code{groff} included:
-@itemize @bullet{}
+@itemize @bullet
@item
-A replacement for @code{ditroff} with many extentions.
+A replacement for @code{ditroff} with many extensions.
+
@item
The @code{soelim}, @code{pic}, @code{tbl}, and @code{eqn} preprocessors.
+
@item
-Postprocessors for ascii devices, PostScript, @TeX{} DVI, and X@w{
-}windows. GNU @code{troff} also eliminated the need for a separate
-@code{nroff} program with a postprocessor which would produce ascii
-output.
+Postprocessors for character devices, @acronym{PostScript}, @TeX{} DVI,
+and X@w{ }windows. GNU @code{troff} also eliminated the need for a
+separate @code{nroff} program with a postprocessor which would produce
+@acronym{ASCII} output.
+
@item
-A version of the @code{-me} macros and an implementation of the
-@code{-man} macros.
+A version of the @file{me} macros and an implementation of the
+@file{man} macros.
@end itemize
Also, a front-end was included which could construct the, sometimes
@@ -705,223 +784,288 @@ painfully long, pipelines required for all the post- and preprocessors.
Development of GNU @code{troff} progressed rapidly, and saw the
additions of a replacement for @code{refer}, an implementation of the
-@code{-ms} and @code{-mm} macros, and a program to deduce how to format
-a document (@code{grog}).
+@file{ms} and @file{mm} macros, and a program to deduce how to format a
+document (@code{grog}).
-It was declared a stable (i.e.@: non beta) package with the release of
+It was declared a stable (i.e.@: non-beta) package with the release of
version@w{ }1.04 around November@w{ }1991.
+Beginning in@w{ }1999, @code{groff} has new maintainers (the package was
+an orphan for a few years). As a result, new features and programs like
+@code{grn}, a preprocessor for gremlin images, and @code{grohtml}, an
+output device to produce @acronym{HTML} output, have been added.
-@node groff Capabilities, Macro Packages, History, Introduction
+@c =====================================================================
+
+@node groff Capabilities, Macro Package Intro, History, Introduction
@section @code{groff} Capabilities
@cindex @code{groff} capabilities
@cindex capabilities of @code{groff}
So what exactly is @code{groff} capable of doing? @code{groff} provides
-a wide range of low-level text formatting operations. Using these, you
-can perform a wide range of formatting tasks, such as footnotes, table
-of contents, multiple columns, etc.
+a wide range of low-level text formatting operations. Using these, it
+is possible to perform a wide range of formatting tasks, such as
+footnotes, table of contents, multiple columns, etc. Here's a list of
+the most important operations supported by @code{groff}:
-@itemize @bullet{}
+@itemize @bullet
@item
-Text filling, adjusting, and centering
+text filling, adjusting, and centering
+
@item
-Hyphenation
+hyphenation
+
@item
-Page control
+page control
+
@item
-Font and character size control
+font and character size control
+
@item
-Vertical spacing (i.e.@: double spacing)
+vertical spacing (i.e.@: double spacing)
+
@item
-Line length and indenting
+line length and indenting
+
@item
-Macros, strings, diversions, and traps
+macros, strings, diversions, and traps
+
@item
-Number registers
+number registers
+
@item
-Tabs, leaders, and fields
+tabs, leaders, and fields
+
@item
-Input and output conventions and character translation
+input and output conventions and character translation
+
@item
-Overstrike, bracket, line drawing, and zero-width functions
+overstrike, bracket, line drawing, and zero-width functions
+
@item
-Local horizontal and vertical motions and the width function
+local horizontal and vertical motions and the width function
+
@item
-Three-part titles
+three-part titles
+
@item
-Output line numbering
+output line numbering
+
@item
-Conditional acceptance of input
+conditional acceptance of input
+
@item
-Environment switching
+environment switching
+
@item
-Insertions from the standard input
+insertions from the standard input
+
@item
-Input/output file switching
+input/output file switching
+
@item
-Output and error messages
+output and error messages
@end itemize
-@node Macro Packages, Preprocessors, groff Capabilities, Introduction
+@c =====================================================================
+
+@node Macro Package Intro, Preprocessor Intro, groff Capabilities, Introduction
@section Macro Packages
@cindex macro packages
-Since @code{groff} provides such low level facilities, it can be quite
+Since @code{groff} provides such low-level facilities, it can be quite
difficult to use by itself. However, @code{groff} provides a
-@dfn{macro} facility which allows you to specify how certain routine
-operations (e.g.@w{ }starting paragraphs, printing headers and footers,
-etc.)@: should be done. These macros can be collected together into a
-@dfn{macro package}. There are a number of macro packages available;
-the most common (and the ones described in this manual) are @code{-man},
-@code{-me}, @code{-ms}, and @code{-mm}.
+@dfn{macro} facility to specify how certain routine operations (e.g.@w{
+}starting paragraphs, printing headers and footers, etc.)@: should be
+done. These macros can be collected together into a @dfn{macro
+package}. There are a number of macro packages available; the most
+common (and the ones described in this manual) are @file{man},
+@file{mdoc}, @file{me}, @file{ms}, and @file{mm}.
+
+@c =====================================================================
-@node Preprocessors, Postprocessors, Macro Packages, Introduction
+@node Preprocessor Intro, Output device intro, Macro Package Intro, Introduction
@section Preprocessors
@cindex preprocessors
Although @code{groff} provides most functions needed to format a
-document, some operations would be unwieldy (i.e.@: drawing pictures).
+document, some operations would be unwieldy (e.g.@: to draw pictures).
Therefore, programs called preprocessors were written which understand
-their own language and produce the necessary groff operations. These
-preprocessors are able to differentiate their own input from the rest of
-the document via markers.
-
-To use a preprocessor, @sc{Unix} pipes are used to feed the output from
-the preprocessor into @code{groff}. Any number of preprocessors may be
-used on a given document; in this case, the preprocessors are linked
-together into one pipeline. However, in @code{groff}, the user does not
-need to construct the pipe, but only tell @code{groff} what
+their own language and produce the necessary @code{groff} operations.
+These preprocessors are able to differentiate their own input from the
+rest of the document via markers.
+
+To use a preprocessor, @acronym{UNIX} pipes are used to feed the output
+from the preprocessor into @code{groff}. Any number of preprocessors
+may be used on a given document; in this case, the preprocessors are
+linked together into one pipeline. However, in @code{groff}, the user
+does not need to construct the pipe, but only tell @code{groff} what
preprocessors to use.
@code{groff} currently has preprocessors for producing tables
(@code{tbl}), typesetting equations (@code{eqn}), drawing pictures
-(@code{pic}), and for processing bibliographies (@code{refer}). An
-associated program which is useful when dealing with preprocessors is
-@code{soelim}.
+(@code{pic} and @code{grn}), and for processing bibliographies
+(@code{refer}). An associated program which is useful when dealing with
+preprocessors is @code{soelim}.
-There are other preprocessors in existence, but there are,
-unfortunately, no free implementations available. They are for drawing
-pictures (@code{ideal} and @code{gremlin}), for drawing graphs
-(@code{grap}), and chemical structures (@code{chem}).
+A free implementation of @code{grap}, a preprocessor for drawing graphs,
+can be obtained as an extra package; @code{groff} can use @code{grap}
+also.
+There are other preprocessors in existence, but, unfortunately, no free
+implementations are available. Among them are preprocessors for drawing
+mathematical pictures (@code{ideal}) and chemical structures
+(@code{chem}).
-@node Postprocessors, Credits, Preprocessors, Introduction
-@section Postprocessors
+
+@c =====================================================================
+
+@node Output device intro, Credits, Preprocessor Intro, Introduction
+@section Output Devices
@cindex postprocessors
+@cindex output devices
+@cindex devices for output
@code{groff} actually produces device independent code which may be fed
into a postprocessor which will produce output for a particular device.
-Currently, @code{groff} has postprocessors for PostScript, ascii
-terminals, X@w{ }windows (for previewing), @TeX{} DVI format, and HTML.
+Currently, @code{groff} has postprocessors for @acronym{PostScript}
+devices, character terminals, X@w{ }Windows (for previewing), @TeX{} DVI
+format, HP LaserJet@w{ }4 and Canon LBP printers (which use
+@acronym{CAPSL}), and @acronym{HTML}.
+
+@c =====================================================================
-@node Credits, , Postprocessors, Introduction
+@node Credits, , Output device intro, Introduction
@section Credits
@cindex credits
-
Large portions of this manual were taken from existing documents, most
notably, the manual pages for the @code{groff} package by James Clark,
-and Eric Allman's papers on the @code{-me} macro package.
+and Eric Allman's papers on the @file{me} macro package.
+
+The section on the @file{man} macro package is partly based on Susan@w{
+}G.@: Kleinmann's @file{groff_man} manual page written for the Debian
+GNU/Linux system.
+
+@c =====================================================================
+@c =====================================================================
@node Invoking groff, Tutorial for Macro Users, Introduction, Top
@chapter Invoking @code{groff}
@cindex invoking @code{groff}
@cindex @code{groff} invocation
-
-@pindex groff
-@pindex gtroff
This section focuses on how to invoke the @code{groff} front end. This
front end takes care of the details of constructing the pipeline among
the preprocessors, @code{gtroff} and the postprocessor.
-It has become a tradition that GNU programs get the prefix @dfn{g} to
-distinguish it from its original counterparts provided by the host
-(@pxref{Environment}, for more details). Thus, for example, @code{geqn}
-is GNU @code{eqn}. On operating systems like Linux or the Hurd, which
-don't contain proprietary software, this prefix is omitted since GNU
-@code{troff} is the only used incarnation of @code{troff}. Exception:
-@code{groff} is never replaced by `roff'.
-
+It has become a tradition that GNU programs get the prefix @samp{g} to
+distinguish it from its original counterparts provided by the host (see
+@ref{Environment}, for more details). Thus, for example, @code{geqn} is
+GNU @code{eqn}. On operating systems like Linux or the Hurd, which
+don't contain proprietary software, and on MS-DOS/MS-Windows, where
+@code{troff} and associated programs are not available at all, this
+prefix is omitted since GNU @code{troff} is the only used incarnation of
+@code{troff}. Exception: @code{groff} is never replaced by @code{roff}.
@menu
-* Options::
+* Groff Options::
* Environment::
* Invocation Examples::
@end menu
-@node Options, Environment, Invoking groff, Invoking groff
+
+@c =====================================================================
+
+@node Groff Options, Environment, Invoking groff, Invoking groff
@section Options
@cindex options
-
@pindex groff
@pindex gtroff
@pindex gpic
@pindex geqn
+@pindex ggrn
+@pindex grap
@pindex gtbl
@pindex grefer
@pindex gsoelim
-@code{groff} is a front-end to the groff document formatting system.
-Normally it runs the @code{gtroff} program and a postprocessor
-appropriate for the selected device. The default device is @samp{ps}.
-It can optionally preprocess with any of @code{gpic}, @code{geqn},
-@code{gtbl}, @code{grefer}, or @code{gsoelim}.
+@code{groff} normally runs the @code{gtroff} program and a postprocessor
+appropriate for the selected device. The default device is @samp{ps}
+(but it can be changed when @code{groff} is configured and built). It
+can optionally preprocess with any of @code{gpic}, @code{geqn},
+@code{gtbl}, @code{ggrn}, @code{grap}, @code{grefer}, or @code{gsoelim}.
This section only documents options to the @code{groff} front end. Many
of the arguments to @code{groff} are passed on to @code{gtroff},
therefore those are also included. Arguments to pre- or postprocessors
can be found in @ref{Invoking gpic}, @ref{Invoking geqn}, @ref{Invoking
-gtbl}, @ref{Invoking grefer}, @ref{Invoking gsoelim}, @ref{Invoking
-grotty}, @ref{Invoking grops}, @ref{Invoking grohtml}, @ref{Invoking
-grodvi}, and @ref{Invoking gxditview}
+gtbl}, @ref{Invoking ggrn}, @ref{Invoking grefer}, @ref{Invoking
+gsoelim}, @ref{Invoking grotty}, @ref{Invoking grops}, @ref{Invoking
+grohtml}, @ref{Invoking grodvi}, @ref{Invoking grolj4}, @ref{Invoking
+grolbp}, and @ref{Invoking gxditview}.
The command line format for @code{groff} is:
@example
-groff [ -abehilpstvzCENRSVXZ ] [ -F@var{dir} ] [ -m@var{name} ]
+groff [ -abeghilpstvzCEGNRSUVXZ ] [ -F@var{dir} ] [ -m@var{name} ]
[ -T@var{def} ] [ -f@var{fam} ] [ -w@var{name} ] [ -W@var{name} ]
[ -M@var{dir} ] [ -d@var{cs} ] [ -r@var{cn} ] [ -n@var{num} ]
- [ -o@var{list} ] [ -P@var{arg} ] [ -L@var{arg} ]
+ [ -o@var{list} ] [ -P@var{arg} ] [ -L@var{arg} ] [ -I@var{dir} ]
[ @var{files}@dots{} ]
@end example
-The command line format for @code{gtroff} is as follows. As you can
-see, many of the options to @code{groff} are actually passed on to
-@code{gtroff}.
+The command line format for @code{gtroff} is as follows.
@example
-gtroff [ -abivzCER ] [ -w@var{name} ] [ -W@var{name} ] [ -d@var{cs} ]
+gtroff [ -abivzCERU ] [ -w@var{name} ] [ -W@var{name} ] [ -d@var{cs} ]
[ -f@var{fam} ] [ -m@var{name} ] [ -n@var{num} ]
[ -o@var{list} ] [ -r@var{cn} ] [ -T@var{name} ]
[ -F@var{dir} ] [ -M@var{dir} ] [ @var{files}@dots{} ]
@end example
-Options without an argument can be grouped behind a single @samp{-}. A
-filename of @samp{-} denotes the standard input.
+@noindent
+Obviously, many of the options to @code{groff} are actually passed
+on to @code{gtroff}.
+
+Options without an argument can be grouped behind a single @option{-}.
+A filename of @file{-} denotes the standard input. It is possible to
+have whitespace between an option and its parameter.
-@pindex grog
The @code{grog} command can be used to guess the correct @code{groff}
-command to use to format a file.
+command to format a file.
+
+Here's the description of the command-line options:
+@cindex command-line options
@table @samp
@item -h
Print a help message.
+
@item -e
Preprocess with @code{geqn}.
+
@item -t
Preprocess with @code{gtbl}.
+
+@item -g
+Preprocess with @code{ggrn}.
+
+@item -G
+Preprocess with @code{grap}.
+
@item -p
Preprocess with @code{gpic}.
+
@item -s
Preprocess with @code{gsoelim}.
+
@item -R
Preprocess with @code{grefer}. No mechanism is provided for passing
arguments to @code{grefer} because most @code{grefer} options have
@@ -929,224 +1073,390 @@ equivalent commands which can be included in the file. @xref{grefer},
for more details.
@pindex troffrc
-Note that @code{gtroff} also accepts a @samp{-R} option, which is not
+@pindex troffrc-end
+Note that @code{gtroff} also accepts a @option{-R} option, which is not
accessible via @code{groff}. This option prevents the loading of the
-@file{troffrc} file.
+@file{troffrc} and @file{troffrc-end} files.
+
@item -v
Make programs run by @code{groff} print out their version number.
+
@item -V
Print the pipeline on stdout instead of executing it.
+
@item -z
-Suppress output from @code{gtroff}. Only error messages will be printed.
+Suppress output from @code{gtroff}. Only error messages will be
+printed.
+
@item -Z
Do not postprocess the output of @code{gtroff}. Normally @code{groff}
will automatically run the appropriate postprocessor.
+
@item -P@var{arg}
Pass @var{arg} to the postprocessor. Each argument should be passed
-with a separate @samp{-P} option. Note that groff does not prepend
-@samp{-} to @var{arg} before passing it to the postprocessor.
+with a separate @option{-P} option. Note that @code{groff} does not
+prepend @samp{-} to @var{arg} before passing it to the postprocessor.
+
@item -l
Send the output to a printer. The command used for this is specified by
the print command in the device description file.
+
@item -L@var{arg}
Pass @var{arg} to the spooler. Each argument should be passed with a
-separate @samp{-L} option. Note that @code{groff} does not prepend a
+separate @option{-L} option. Note that @code{groff} does not prepend a
@samp{-} to @var{arg} before passing it to the postprocessor.
+
@item -T@var{dev}
-Prepare output for device @var{dev}. The default device is @samp{ps}.
-The following are the output devices currently available:
-@table @samp
+Prepare output for device @var{dev}. The default device is @samp{ps},
+unless changed when @code{groff} was configured and built. The
+following are the output devices currently available:
+
+@table @code
@item ps
-For PostScript printers and previewers.
+For @acronym{PostScript} printers and previewers.
+
@item dvi
-For TeX dvi format.
+For @TeX{} DVI format.
+
@item X75
-For a 75 dpi X11 previewer.
+For a 75@dmn{dpi} X11 previewer.
+
@item X100
-For a 100dpi X11 previewer.
+For a 100@dmn{dpi} X11 previewer.
+
@item ascii
For typewriter-like devices.
+
@item latin1
-For typewriter-like devices using the ISO Latin-1 character set.
+For typewriter-like devices that support the @w{Latin-1} (@w{ISO 8859-1})
+character set.
+
+@item utf8
+For typewriter-like devices which use the Unicode (@w{ISO 10646})
+character set with @w{UTF-8} encoding.
+
+@item cp1047
+@cindex @acronym{EBCDIC} encoding
+@cindex cp1047
+@cindex IBM cp1047
+For typewriter-like devices which use the @acronym{EBCDIC} encoding IBM
+cp1047.
+
@item lj4
For an HP LaserJet4-compatible (or other PCL5-compatible) printer.
+
+@item lbp
+For Canon @acronym{CAPSL} printers (@w{LBP-4} and @w{LBP-8} series laser
+printers).
+
@item html
-To produce HTML output.
+To produce @acronym{HTML} output.
@end table
+@vindex .T
+@maindex \*(.T
+The predefined @code{gtroff} string register @code{.T} contains the
+current output device; the read-only number register @code{.T} is set
+to@w{ }1 if this option is used (which is always true if @code{groff} is
+used to call @code{gtroff}). @xref{Built-in Registers}.
+
The postprocessor to be used for a device is specified by the
@code{postpro} command in the device description file. (@xref{Font
-Files}, for more info.) This can be overridden with the @samp{-X}
+Files}, for more info.) This can be overridden with the @option{-X}
option.
+
@item -X
Preview with @code{gxditview} instead of using the usual postprocessor.
-This is unlikely to produce good results except with @samp{-Tps}.
+This is unlikely to produce good results except with @option{-Tps}.
+
+Note that this is not the same as using @option{-TX75} or
+@option{-TX100} to view a document with @code{gxditview}: The former
+will use the metrics of the specified device, whereas the latter will
+use X-specific fonts and metrics.
+
@item -N
Don't allow newlines with @code{eqn} delimiters. This is the same as
-the @samp{-N} option in @code{geqn}.
+the @option{-N} option in @code{geqn}.
+
@item -S
-Safer mode. Pass the @samp{-S} option to @code{gpic} and use the
-@samp{-msafer} macros with @code{gtroff}.
+Safer mode. Pass the @option{-S} option to @code{gpic} and use the
+@option{-msafer} macros with @code{gtroff} (enabled by default).
+
+@item -U
+Unsafe mode. Reverts to the old unsafe behaviour.
+
@item -a
-Generate an ASCII approximation of the typeset output.
+@vindex .A
+Generate an @acronym{ASCII} approximation of the typeset output. The
+read-only register @code{.A} is then set to@w{ }1. @xref{Built-in
+Registers}.
+
@item -b
Print a backtrace with each warning or error message. This backtrace
should help track down the cause of the error. The line numbers given
-in the backtrace may not always be correct: @code{troff}'s idea of line
-numbers gets confused by @code{as} or @code{am} requests.
+in the backtrace may not always be correct: @code{gtroff} can get
+confused by @code{as} or @code{am} requests while counting line numbers.
+
@item -i
Read the standard input after all the named input files have been
processed.
+
@item -w@var{name}
Enable warning @var{name}. Available warnings are described in
-@ref{Debugging}. Multiple @samp{-w} options are allowed.
+@ref{Debugging}. Multiple @option{-w} options are allowed.
+
@item -W@var{name}
-Inhibit warning @var{name}. Multiple @samp{-W} options are allowed.
+Inhibit warning @var{name}. Multiple @option{-W} options are allowed.
+
@item -E
Inhibit all error messages.
+
@item -C
-Enable compatibility mode.
+Enable compatibility mode. @xref{Implementation Differences}, for the
+list of incompatibilites between @code{groff} and traditional Unix
+@code{troff}.
+
@item -d@var{cs}
@itemx -d@var{name}=s
-Define @var{c} or @var{name} to be a string @var{s}; @var{c} must be a
-one-letter @var{name}.
+Define @var{c} or @var{name} to be a string @var{s}. @var{c} must be a
+one-letter name; @var{name} can be of arbitrary length.
+
@item -f@var{fam}
Use @var{fam} as the default font family.
+
@item -m@var{name}
Read in the file @file{tmac.@var{name}}. Normally this will be searched
-for in @code{groff}'s lib directory.
+for in the library directory of @code{groff}.
+
@item -n@var{num}
Number the first page @var{num}.
+
@item -o@var{list}
+@vindex .P
Output only pages in @var{list}, which is a comma-separated list of page
-ranges; @var{n} means print page @var{n}, @samp{@var{m}-@var{n}} means
-print every page between @var{m} and @var{n}, @samp{-@var{n}} means
-print every page up to @var{n}, @samp{@var{n}-} means print every page
-from @var{n}. @code{troff} will exit after printing the last page in
-the list.
+ranges; @samp{@var{n}} means print page @var{n}, @samp{@var{m}-@var{n}}
+means print every page between @var{m} and @var{n}, @samp{-@var{n}}
+means print every page up to @var{n}, @samp{@var{n}-} means print every
+page beginning with @var{n}. @code{gtroff} will exit after printing the
+last page in the list. All the ranges are inclusive on both ends.
+
+Within @code{gtroff}, this information can be extracted with the
+@samp{.P} register. @xref{Built-in Registers}.
+
@item -r@var{cn}
@itemx -r@var{name}=@var{n}
-Set number register @var{c} or @var{name} to @var{n}; @var{c} must be a
-one-letter @var{name}; @var{n} can be any troff numeric expression.
+Set number register @var{c} or @var{name} to the value @var{n}. @var{c}
+must be a one-letter name; @var{name} can be of arbitrary length.
+@var{n} can be any @code{gtroff} numeric expression.
+
@item -F@var{dir}
-Search @var{dir} for subdirectories dev@var{name} (@var{name} is the
-name of the device) for the @file{DESC} file and font files before the
-normal directory.
+Search @file{@var{dir}} for subdirectories @file{dev@var{name}}
+(@var{name} is the name of the device), for the @file{DESC} file, and
+for font files before looking in the standard directory.
+
@item -M@var{dir}
-Search directory @var{dir} for macro files before the normal directory.
+Search directory @file{@var{dir}} for macro files before the standard
+directory.
+
+@item -I@var{dir}
+This option is as described in @ref{gsoelim}. It implies the
+@option{-s} option.
@end table
+@c =====================================================================
-@node Environment, Invocation Examples, Options, Invoking groff
+@node Environment, Invocation Examples, Groff Options, Invoking groff
@section Environment
-@cindex environment
+@cindex environment variables
+@cindex variables in environment
-
-There are also several environment variables which can modify groff's
-behavior.
+There are also several environment variables (of the operating system,
+not within @code{gtroff}) which can modify the behavior of @code{groff}.
@table @code
@item GROFF_COMMAND_PREFIX
+@tindex GROFF_COMMAND_PREFIX, environment variable
If this is set to @var{X}, then @code{groff} will run
-@var{X}@code{troff} instead of @code{gtroff}. This also applies to
-@code{tbl}, @code{pic}, @code{eqn}, @code{refer}, and @code{soelim}. It
-does not apply to @code{grops}, @code{grodvi}, @code{grotty},
-@code{grohtml}, @code{grolj4}, and @code{gxditview}.
+@code{@var{X}troff} instead of @code{gtroff}. This also applies to
+@code{tbl}, @code{pic}, @code{eqn}, @code{grn}, @code{refer}, and
+@code{soelim}. It does not apply to @code{grops}, @code{grodvi},
+@code{grotty}, @code{grohtml}, @code{grolj4}, and @code{gxditview}.
+
@item GROFF_TMAC_PATH
-A colon separated list of directories in which to search for macro
+@tindex GROFF_TMAC_PATH, environment variable
+A colon-separated list of directories in which to search for macro
files.
+
@item GROFF_TYPESETTER
-Default device.
+@tindex GROFF_TYPESETTER, environment variable
+The default output device.
+
@item GROFF_FONT_PATH
-A colon separated list of directories in which to search for the
+@tindex GROFF_FONT_PATH, environment variable
+A colon-separated list of directories in which to search for the
@code{dev}@var{name} directory.
+
@item PATH
-The search path for commands executed by groff.
+@tindex PATH, environment variable
+The search path for commands executed by @code{groff}.
+
@item GROFF_TMPDIR
+@tindex GROFF_TMPDIR, environment variable
+@tindex TMPDIR, environment variable
The directory in which temporary files will be created. If this is not
-set and @code{TMPDIR} is set, temporary files will be created in that
-directory. Otherwise temporary files will be created in @code{/tmp}.
-The @code{grops} and @code{grefer} commands can create temporary files.
+set and @env{TMPDIR} is set, temporary files will be created in that
+directory. Otherwise temporary files will be created in a
+system-dependent default directory (on Unix and GNU/Linux systems, this
+is usually @file{/tmp}). The @code{grops} and @code{grefer} commands
+can create temporary files in this directory.
@end table
+Note that MS-DOS and MS-Windows ports of @code{groff} use semi-colons,
+rather than colons, to separate the directories in the lists described
+above.
+
+
+@c =====================================================================
@node Invocation Examples, , Environment, Invoking groff
@section Invocation Examples
@cindex invocation examples
@cindex examples of invocation
-
This section will list several common uses of @code{groff} and the
command line which will accomplish it.
@example
groff file
-groff -X -me file
-groff -mm -rD1 -z file
-groff -tps -me file | lpr -Plw2
-... any more?? ...
@end example
-@subsection @code{grog}
+@noindent
+This command processes @file{file} without a macro package or a
+preprocessor. The output device is the default, @samp{ps}, and the
+output is sent to stdout.
+
+@example
+groff -t -mandoc -Tascii file | less
+@end example
+
+@noindent
+This is basically what a call to the @code{man} program does. The
+manual page @file{file} is processed with the @file{mandoc} macros
+(which in turn either calls the @file{man} or the @file{mdoc} macro
+package), using the @code{tbl} preprocessor and the @acronym{ASCII}
+output device. Finally, the result is displayed with the @code{less}
+pager.
+
+@example
+groff -X -m me file
+@end example
+
+@noindent
+Preview @file{file} with @code{gxditview}, using the @file{me} macro
+package. Since no @option{-T} option is specified, use the default
+device (@samp{ps}). Note that you can either say @w{@samp{-m me}} or
+@w{@samp{-me}}; the latter is an anachronism from the early days of
+@acronym{UNIX}.@footnote{The same is true for the other main macro
+packages that come with @code{groff}: @file{man}, @file{mdoc},
+@file{ms}, @file{mm}, and @file{mandoc}. This won't work in general;
+for example, to load @file{tmac.safer}, either @samp{-msafer} or
+@w{@samp{-m safer}} must be used.}
+
+@example
+groff -man -rD1 -z file
+@end example
-@code{grog} reads files and guesses which of the @code{groff}
-preprocessors and/or macro packages are are required for formatting
-them, and prints the @code{groff} command including those options on the
-standard output. The options generated are one of @samp{-e},
-@samp{-man}, @samp{-me}, @samp{-mm}, @samp{-ms}, @samp{-p}, @samp{-s},
-and @samp{-t}.
+@noindent
+Check @file{file} with the @file{man} macro package, forcing
+double-sided printing -- don't produce any output.
+
+@c ---------------------------------------------------------------------
+
+@menu
+* grog::
+@end menu
-A filename of @samp{-} is taken to refer to the standard input. If no
-files are specified the standard input will be read. Any specified
-options will be included in the printed command. No space is allowed
-between options and their arguments. For example,
+@node grog, , Invocation Examples, Invocation Examples
+@subsection @code{grog}
+
+@pindex grog
+@code{grog} reads files, guesses which of the @code{groff} preprocessors
+and/or macro packages are required for formatting them, and prints the
+@code{groff} command including those options on the standard output.
+The options generated are one of @option{-e}, @option{-man},
+@option{-me}, @option{-mm}, @option{-ms}, @option{-p}, @option{-R},
+@option{-g}, @option{-G}, @option{-s}, and @option{-t}.
+
+A special file name @file{-} is taken to refer to the standard input.
+If no files are specified the standard input will be read. Any
+specified options will be included in the printed command. No space is
+allowed between options and their arguments. For example,
@example
grog -Tdvi paper.ms
@end example
-will guess the approriate command to print @file{paper.ms} and then run
-it after adding the @samp{-Tdvi} option.
+@noindent
+will guess the appropriate command to print @file{paper.ms} and then
+print it to the command line after adding the @option{-Tdvi} option.
+For direct execution, enclose the call to @code{grog} in backquotes at
+the @acronym{UNIX} shell prompt:
+@example
+`grog -Tdvi paper.ms` > paper.dvi
+@end example
-@node Tutorial for Macro Users, -man, Invoking groff, Top
+@noindent
+As seen in the example, it is still necessary to redirect the output to
+something meaningful (i.e.@: either a file or a pager program like
+@code{less}).
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Tutorial for Macro Users, Macro Packages, Invoking groff, Top
@chapter Tutorial for Macro Users
@cindex tutorial for macro users
-@cindex macro tutorial for users
+@cindex macros, tutorial for users
@cindex user's tutorial for macros
@cindex user's macro tutorial
Most users tend to use a macro package to format their papers. This
-means that the whole breadth of @code{groff} is not neccessary for most
+means that the whole breadth of @code{groff} is not necessary for most
people. This chapter covers the material needed to efficiently use a
macro package.
-
@menu
* Basics::
* Common Features::
@end menu
+
+@c =====================================================================
+
@node Basics, Common Features, Tutorial for Macro Users, Tutorial for Macro Users
@section Basics
-@cindex basics
-
+@cindex basics of macros
+@cindex macro basics
-This section covers some of the basic concepts you will need to
-understand to use a macro package.@footnote{This section is derived from
-@cite{Writing Papers with nroff using -me} by Eric P.@w{ }Allman}
+This section covers some of the basic concepts necessary to understand
+how to use a macro package.@footnote{This section is derived from
+@cite{Writing Papers with nroff using -me} by Eric P.@w{ }Allman.}
References are made throughout to more detailed information, if desired.
-@code{groff} reads an input file prepared by the user and outputs a
-formatted paper suitable for publication or framing. The input consists
-of text, or words to be printed, and embedded commands (@dfn{requests}
-and @dfn{escapes}), which tell @code{groff} how to format the printed
-copy. For more detail on this @pxref{Embedded Commands}.
+@code{gtroff} reads an input file prepared by the user and outputs a
+formatted document suitable for publication or framing. The input
+consists of text, or words to be printed, and embedded commands
+(@dfn{requests} and @dfn{escapes}), which tell @code{gtroff} how to
+format the output. For more detail on this, see @ref{Embedded
+Commands}.
-The word @dfn{argument} is used in this manual to mean a word or number
-which appears on the same line as a request which modifies the meaning
-of that request. For example, the request
+The word @dfn{argument} is used in this chapter to mean a word or number
+which appears on the same line as a request, and which modifies the
+meaning of that request. For example, the request
@example
.sp
@@ -1165,8 +1475,8 @@ request which says to space four lines instead of one. Arguments are
separated from the request and from each other by spaces. More details
on this can be found in @ref{Request Arguments}.
-The primary function of @code{groff} is to collect words from input
-lines, fill output lines with those words, justify the right hand margin
+The primary function of @code{gtroff} is to collect words from input
+lines, fill output lines with those words, justify the right-hand margin
by inserting extra spaces in the line, and output the result. For
example, the input:
@@ -1189,56 +1499,54 @@ Four score and seven years ago,...
@cindex break
@cindex line break
-Sometimes you may want to start a new output line even though the line
-you are on is not yet full; for example, at the end of a paragraph. To
-do this you can cause a @dfn{break}, which starts a new output line.
-Some requests cause a break automatically, as do blank input lines and
-input lines beginning with a space.
+Sometimes a new output line should be started even though the current
+line is not yet full; for example, at the end of a paragraph. To do
+this it is possible to cause a @dfn{break}, which starts a new output
+line. Some requests cause a break automatically, as do blank input
+lines and input lines beginning with a space.
Not all input lines are text to be formatted. Some of the input lines
are requests which describe how to format the text. Requests always
-have a period or an apostrophe (@samp{'}) as the first character of the
-input line.
+have a period (@samp{.}) or an apostrophe (@samp{'}) as the first
+character of the input line.
The text formatter also does more complex things, such as automatically
-numbering pages, skipping over page boundaries putting footnotes in the
+numbering pages, skipping over page boundaries, putting footnotes in the
correct place, and so forth.
-Here a few hints for preparing text for input to @code{groff}. First,
-keep the input lines short. Short input lines are easier to edit, and
-@code{groff} will pack words onto longer lines for you anyhow. In
+Here are a few hints for preparing text for input to @code{gtroff}.
+First, keep the input lines short. Short input lines are easier to
+edit, and @code{gtroff} will pack words onto longer lines anyhow. In
keeping with this, it is helpful to begin a new line after every period,
comma, or phrase, since common corrections are to add or delete
sentences or phrases. Secondly, do not hyphenate words at the end of
-lines -- @code{groff} is smart enough to hyphenate words for you as
-needed, but is not smart enough to take hyphens out and join a word back
-together. Also, words such as ``mother-in-law'' should not be broken
-over a line, since then you will get a space where not wanted, such as
-``mother- in-law''.
+lines -- @code{gtroff} is smart enough to hyphenate words for the user
+as needed, but is not smart enough to take hyphens out and join a word
+back together. Also, words such as ``mother-in-law'' should not be
+broken over a line, since then a space can occur where not wanted, such
+as ``@w{mother- in}-law''.
@findex ls
@cindex double spacing
@cindex spacing
-Groff will double space output text automatically if you use the request
-@samp{.ls 2}. You can revert to single spaced mode by typing @samp{.ls
-1}.
+@code{gtroff} will double space output text automatically if you use the
+request @w{@samp{.ls 2}}. Single spaced mode can be reactivated by
+typing @w{@samp{.ls 1}}.
-A number of requests allow you to change the way the printed copy looks,
-sometimes called the @dfn{layout} of the output page. Most of these
-requests adjust the placing of @dfn{white space} (blank lines or
-spaces).
+A number of requests allow to change the way the output looks, sometimes
+called the @dfn{layout} of the output page. Most of these requests
+adjust the placing of @dfn{white space} (blank lines or spaces).
-@findex bp
@cindex new page
-The @samp{.bp} request starts a new page.
+The @samp{.bp} request starts a new page, causing a line break.
-@findex sp
@cindex blank lines
@cindex empty lines
-The request @samp{.sp @var{N}} leaves @var{N} lines of blank space.
-@var{N} can be omitted (meaning skip a single line) or can be of the
-form @var{N}i (for @var{N} inches) or @var{N}c (for @var{N}
-centimeters). For example, the input:
+@cindex lines, empty
+The request @w{@samp{.sp @var{N}}} leaves @var{N}@w{ }lines of blank
+space. @var{N}@w{ }can be omitted (meaning skip a single line) or can
+be of the form @var{N}i (for @var{N}@w{ }inches) or @var{N}c (for
+@var{N}@w{ }centimeters). For example, the input:
@example
.sp 1.5i
@@ -1252,11 +1560,12 @@ thoughts on the subject'', followed by a single blank line.
@findex ce
@cindex centering lines
-Text lines can be centered by using the @samp{.ce} request. The line
-after @samp{.ce} is centered (horizontally) on the page. To center more
-than one line, use @samp{.ce @var{N}} (where @var{N} is the number of
-lines to center), followed by the @var{N} lines. If you want to center
-many lines but don't want to count them, type:
+@cindex lines, centering
+Text lines can be centered by using the @code{ce} request. The line
+after @code{ce} is centered (horizontally) on the page. To center more
+than one line, use @w{@samp{.ce @var{N}}} (where @var{N} is the number
+of lines to center), followed by the @var{N}@w{ }lines. To center many
+lines without counting them, type:
@example
.ce 1000
@@ -1265,40 +1574,61 @@ lines to center
@end example
@noindent
-The @samp{.ce 0} request tells @code{groff} to center zero more lines,
-in other words, stop centering.
+The @w{@samp{.ce 0}} request tells @code{groff} to center zero more
+lines, in other words, stop centering.
@findex br
@cindex line break
@cindex break
All of these requests cause a break; that is, they always start a new
-line. If you want to start a new line without performing any other
-action, use @samp{.br}.
+line. To start a new line without performing any other action, use
+@code{br}.
+
+@c =====================================================================
@node Common Features, , Basics, Tutorial for Macro Users
@section Common Features
@cindex common features
@cindex features, common
+@code{gtroff} provides very low level operations for formatting a
+document. There are many common routine operations which are done in
+all documents. These common operations are written into @dfn{macros}
+and collected into a @dfn{macro package}.
+
+All macro packages provide certain common capabilities which fall into
+the following categories.
-Groff provides very low level operations for formatting a document.
-There are many common routine operations which are done in all documents.
-These common operations are written into @dfn{macros} and collected into a
-@dfn{macro package}.
+@c ---------------------------------------------------------------------
-All macro packages provide certain common capabilities which fall
-into the following categories.
+@menu
+* Paragraphs::
+* Sections and Chapters::
+* Headers and Footers::
+* Page Layout Adjustment::
+* Displays::
+* Footnotes and Annotations::
+* Table of Contents::
+* Indices::
+* Paper Formats::
+* Multiple Columns::
+* Font and Size Changes::
+* Predefined Strings::
+* Preprocessor Support::
+* Configuration and Customization::
+@end menu
+@node Paragraphs, Sections and Chapters, Common Features, Common Features
@subsection Paragraphs
@cindex paragraphs
-One of the most common and most used capability is starting a
-paragraph. There are a number of different types of paragraphs,
-any of which can be initiated with macros supplied by the macro
-package. Normally paragraphs start with a blank line and the first
-line indented, like the text in this manual. There are also block
-style paragraphs, which omit the indentation:
+One of the most common and most used capability is starting a paragraph.
+There are a number of different types of paragraphs, any of which can be
+initiated with macros supplied by the macro package. Normally,
+paragraphs start with a blank line and the first line indented, like the
+text in this manual. There are also block style paragraphs, which omit
+the indentation:
@example
Some men look at constitutions with sanctimonious
@@ -1306,6 +1636,7 @@ reverence, and deem them like the ark of the covenant, too
sacred to be touched.
@end example
+@noindent
And there are also indented paragraphs which begin with a tag or label
at the margin and the remaining text indented.
@@ -1320,167 +1651,628 @@ longlabel
although they will line up with each other.
@end example
-A variation of this is a bulleted list....
+A variation of this is a bulleted list.
+@c XXX description
+
+@c ---------------------------------------------------------------------
+
+@node Sections and Chapters, Headers and Footers, Paragraphs, Common Features
@subsection Sections and Chapters
-Most macro packages supply some form of section headers.
-The simplest kind is simply the heading on a line by itself in bold
-type. Others supply automatically numbered section heading or
-different heading styles at different levels.
-Some, more sophisticated, macro packages supply macros for starting
-chapters and appendicies.
+Most macro packages supply some form of section headers. The simplest
+kind is simply the heading on a line by itself in bold type. Others
+supply automatically numbered section heading or different heading
+styles at different levels. Some, more sophisticated, macro packages
+supply macros for starting chapters and appendices.
+
+@c ---------------------------------------------------------------------
+@node Headers and Footers, Page Layout Adjustment, Sections and Chapters, Common Features
@subsection Headers and Footers
-Every macro packages gives you some way to manipulate the headers and
-footers (or @dfn{titles} on each page. Some packages will allow you
-to have different ones on the even and odd pages (for material
-printed in a book form).
+Every macro package gives some way to manipulate the headers and
+footers (or @dfn{titles}) on each page. Some packages will allow for
+different ones on the even and odd pages (for material printed in a book
+form).
+
The titles are called three-part titles, that is, there is a
-left-justified part, a centered part, and a right-justified part.
-An automatically generated page number may be put in any of these
-fields with the @samp{%} character.
+left-justified part, a centered part, and a right-justified part. An
+automatically generated page number may be put in any of these fields
+with the @samp{%} character (see @ref{Page Layout}, for more details).
+
+@c ---------------------------------------------------------------------
+@node Page Layout Adjustment, Displays, Headers and Footers, Common Features
@subsection Page Layout
-Most macro packages let you specify top and bottom margins and other
-details about the appearance of the printed pages.
+Most macro packages let the user specify top and bottom margins and
+other details about the appearance of the printed pages.
+@c ---------------------------------------------------------------------
+
+@node Displays, Footnotes and Annotations, Page Layout Adjustment, Common Features
@subsection Displays
@cindex displays
-Displays are sections of text to be set off from the body
-of the paper. Major quotes, tables, and figures are types of
-displays, as are all the examples used in this document.
+Displays are sections of text to be set off from the body of the paper.
+Major quotes, tables, and figures are types of displays, as are all the
+examples used in this document.
@cindex quotes, major
@cindex major quotes
-Major quotes are quotes which are several lines long,
-and hence are set in from the rest of the text without
-quote marks around them.
+@dfn{Major quotes} are quotes which are several lines long, and hence
+are set in from the rest of the text without quote marks around them.
@cindex list
-A list is an indented, single spaced, unfilled display. Lists should
-be used when the material to be printed
-should not be filled and justified like normal text, such
-as columns of figures or the examples used in this paper.
+A @dfn{list} is an indented, single spaced, unfilled display. Lists
+should be used when the material to be printed should not be filled and
+justified like normal text, such as columns of figures or the examples
+used in this paper.
@cindex keep
-A keep is a display of lines which are kept on a single page if
-possible. An example of where you would use a
-keep might be a diagram. Keeps differ from lists in that
-lists may be broken over a page boundary whereas keeps will
-not.
+A @dfn{keep} is a display of lines which are kept on a single page if
+possible. An example for a keep might be a diagram. Keeps differ from
+lists in that lists may be broken over a page boundary whereas keeps
+will not.
@cindex keep, floating
@cindex floating keep
-Floating keeps move relative to the text. Hence, they
-are good for things which will be referred to by name, such
-as ``See figure 3''. A floating keep will appear at the bottom of the
-current page if it will fit; otherwise, it will
-appear at the top of the next page. Meanwhile, the surrounding text
-will `flow' around the keep, thus leaving now blank areas.
-
-@subsection Footnotes and annotations
+Floating keeps move relative to the text. Hence, they are good for
+things which will be referred to by name, such as ``See figure@w{ }3''.
+A floating keep will appear at the bottom of the current page if it will
+fit; otherwise, it will appear at the top of the next page. Meanwhile,
+the surrounding text will `flow' around the keep, thus leaving now blank
+areas.
+
+@c ---------------------------------------------------------------------
+
+@node Footnotes and Annotations, Table of Contents, Displays, Common Features
+@subsection Footnotes and Annotations
@cindex footnotes
@cindex annotations
-There are a number of requests to save text for later
-printing. Footnotes are printed at the bottom of the current
-page. Delayed text is intended to be a variant form of foot-
-note; the text is printed only when explicitly called for,
-such as at the end of each chapter.
+There are a number of requests to save text for later printing.
-Delayed text is very similar to a footnote except that
-it is printed when called for explicitly. This allows a
-list of references to appear (for example) at the end of
-each chapter, as is the convention in some disciplines.
+@dfn{Footnotes} are printed at the bottom of the current page.
-Most macro packages which supply this functionality also supply a
-means of automatically numbering either type of annotation.
+@cindex delayed text
+@dfn{Delayed text} is very similar to a footnote except that it is
+printed when called for explicitly. This allows a list of references to
+appear (for example) at the end of each chapter, as is the convention in
+some disciplines.
+Most macro packages which supply this functionality also supply a means
+of automatically numbering either type of annotation.
+
+@c ---------------------------------------------------------------------
+
+@node Table of Contents, Indices, Footnotes and Annotations, Common Features
@subsection Table of Contents
+@cindex table of contents
+@cindex contents, table of
+
+@dfn{Tables of contents} are a type of delayed text having a tag
+(usually the page number) attached to each entry after a row of dots.
+The table accumulates throughout the paper until printed, usually after
+the paper has ended. Many macro packages will provide the ability to
+have several tables of contents (i.e.@: one standard one, one for
+tables, etc).
+
+@c ---------------------------------------------------------------------
-Tables of contents are a type of
-delayed text having a tag (usually the page number) attached
-to each entry after a row of dots. The table accumulates
-throughought the paper until printed, usually after the paper has
-ended. Many macro packages will provide the abilitly to have several
-tables of contents (i.e. one standard one, one for tables, &c.)
+@node Indices, Paper Formats, Table of Contents, Common Features
+@subsection Indices
+@cindex index, in macro package
-@subsection Indexes
+While some macro packages will use the term @dfn{index}, none actually
+provide that functionality. The facilities they call indices are
+actually more appropriate for tables of contents.
-While some macro packages will use the term @dfn{index}, none
-actually provide that functionality. The facilities they call
-indexes are actually more appropriate for tables of contents.
+@c ---------------------------------------------------------------------
-@subsection Paper formats
+@node Paper Formats, Multiple Columns, Indices, Common Features
+@subsection Paper Formats
+@cindex paper formats
Some macro packages provide stock formats for various kinds of
documents. Many of them provide a common format for the title and
-opening pages of a technical paper. The -mm macros in particular
-provide formats for letters and memorandums.
+opening pages of a technical paper. The @file{mm} macros in particular
+provide formats for letters and memoranda.
+@c ---------------------------------------------------------------------
+
+@node Multiple Columns, Font and Size Changes, Paper Formats, Common Features
@subsection Multiple Columns
-Some macro packages (except -man) provide the ability to have two or
-more columns on a page.
+Some macro packages (but not @file{man}) provide the ability to have two
+or more columns on a page.
+
+@c ---------------------------------------------------------------------
-@subsection Font and Size changes
+@node Font and Size Changes, Predefined Strings, Multiple Columns, Common Features
+@subsection Font and Size Changes
-The builtin font and size functions are not always intuitive, so all
+The built-in font and size functions are not always intuitive, so all
macro packages provide macros to make these operations simpler.
+@c ---------------------------------------------------------------------
+
+@node Predefined Strings, Preprocessor Support, Font and Size Changes, Common Features
@subsection Predefined Strings
-Most macro packages provide various predefined strings for a variety
-of uses, examples are sub- and super-scripts, printable dates, quotes
-and various special characters.
+Most macro packages provide various predefined strings for a variety of
+uses; examples are sub- and superscripts, printable dates, quotes and
+various special characters.
+
+@c ---------------------------------------------------------------------
+@node Preprocessor Support, Configuration and Customization, Predefined Strings, Common Features
@subsection Preprocessor Support
All macro packages provide support for the various preprocessors.
+@c ---------------------------------------------------------------------
+
+@node Configuration and Customization, , Preprocessor Support, Common Features
@subsection Configuration and Customization
-Some macro packages provide means of customizing many of details of
-how the package behaves. This ranges from setting the default type
-size to changing the appearance of section headers.
+Some macro packages provide means of customizing many of the details of how
+the package behaves. This ranges from setting the default type size to
+changing the appearance of section headers.
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Macro Packages, Programming Tutorial, Tutorial for Macro Users, Top
+@chapter Macro Packages
+@cindex macro packages
+@cindex packages, macros
+
+This chapter documents the main macro packages that come with
+@code{groff}.
+
+@menu
+* man::
+* mdoc::
+* ms::
+* me::
+* mm::
+@end menu
+
+
+@c =====================================================================
+
+@node man, mdoc, Macro Packages, Macro Packages
+@section @file{man}
+@cindex @file{man}
+@cindex manual pages
+@pindex tmac.an
+@pindex tmac.man
+
+This is the most popular and probably the most important macro package
+of @code{groff}. It is easy to use, and a vast majority of manual pages
+are based on it.
+
+@menu
+* Man options::
+* Man usage::
+* Man font macros::
+* Miscellaneous man stuff::
+@end menu
+
+@c ---------------------------------------------------------------------
+
+@node Man options, Man usage, man, man
+@subsection Options
+
+The command line format for using the @file{man} macros with
+@code{groff} is:
+
+@c XXX document @TMAC_AN_PREFIX@
+
+@example
+groff -m man [ -rC1 ] [ -rD1 ] [ -rP@var{nnn} ] [ -rS@var{xx} ]
+ [ -rX@var{nnn} ] [ @var{files}@dots{} ]
+@end example
+
+It is possible to use @samp{-man} instead of @w{@samp{-m man}}.
+
+@table @code
+@item -rC1
+If more than one manual page is given on the command line, number the
+pages continuously, rather than starting each at@w{ }1.
+
+@item -rD1
+Double-sided printing. Footers for even and odd pages are formatted
+differently.
+
+@item -rP@var{nnn}
+Enumeration of pages will start with @var{nnn} rather than with@w{ }1.
+
+@item -rS@var{xx}
+Use @var{xx} (which can be 10, 11, or@w{ }12@dmn{pt}) as the base
+document font size instead of the default value of@w{ }10@dmn{pt}.
+
+@item -rX@var{nnn}
+After page @var{nnn}, number pages as @var{nnn}a, @var{nnn}b,
+@var{nnn}c, etc. For example, the option @option{-rX2} will produce the
+following page numbers: 1, 2, 2a, 2b, 2c, etc.
+@end table
+
+@c ---------------------------------------------------------------------
+
+@node Man usage, Man font macros, Man options, man
+@subsection Usage
+@cindex @code{man} macros
+@cindex macros for manual pages
+
+@pindex man.local
+This section describes the available macros for manual pages. For
+further customization, put additional macros and requests into the file
+@file{man.local} which will be loaded immediately after @file{tmac.an}.
+
+@maindex TH
+@Defmac{TH, title section [@var{extra1}] [@var{extra2}] [@var{extra3}]}
+Sets the title of the man page to @var{title} and the section to
+@var{section}, which must have a value between 1 and@w{ }8. The value
+of @var{section} may also have a string appended, e.g.@: @samp{.pm}, to
+indicate a specific subsection of the man pages.
+
+Both @var{title} and @var{section} are positioned at the left and right
+in the header line (with @var{section} in parentheses immediately
+appended to @var{title}. @var{extra1} will be positioned in the middle
+of the footer line. @var{extra2} will be positioned at the left in the
+footer line (resp.@: at the left on even pages and at the right on odd
+pages if double-sided printing is active). @var{extra3} is centered in
+the header line.
+
+For @acronym{HTML} output, headers and footers are completely suppressed.
+
+Additionally, this macro starts a new page; the new line number is@w{ }1
+again (except if the @option{-rC1} option is given on the command line)
+-- this feature is intended only for formatting multiple man pages; a
+single man page should contain exactly one @code{TH} macro at the
+beginning of the file.
+@end_Defmac
+
+@maindex SH
+@Defmac{SH, [@var{heading}]}
+Sets up an unnumbered section heading sticking out to the left. Prints
+out all the text following @code{SH} up to the end of the line (resp.@:
+the text in the next line if there is no argument to @code{SH}) in bold
+face, one size larger than the base document size. Additionally, the
+left margin for the following text is reset to its default value.
+@end_Defmac
+
+@maindex SS
+@Defmac{SS, [@var{heading}]}
+Sets up an unnumbered section heading. Prints out all the text
+following @code{SS} up to the end of the line (resp.@: the text in the
+next line if there is no argument to @code{SS}) in bold face, at the
+same size as the base document size. Additionally, the left margin for
+the following text is reset to its default value.
+@end_Defmac
+
+@maindex TP
+@Defmac{TP, [@var{nnn}]}
+Sets up an indented paragraph with label. The indentation is set to
+@var{nnn} if that argument is supplied (the default unit is @samp{n} if
+omitted), otherwise it is set to the default indentation value.
+
+The first line of text following this macro is interpreted as a string
+to be printed flush-left, as it is appropriate for a label. It is not
+interpreted as part of a paragraph, so there is no attempt to fill the
+first line with text from the following input lines. Nevertheless, if
+the label is not as wide as the indentation, then the paragraph starts
+at the same line (but indented), continuing on the following lines. If
+the label is wider than the indentation, then the descriptive part of
+the paragraph begins on the line following the label, entirely indented.
+Note that neither font shape nor font size of the label is set to a
+default value; on the other hand, the rest of the text will have default
+font settings.
+@end_Defmac
+
+@maindex LP
+@maindex PP
+@maindex P
+@Defmac{LP}
+@Defmacx{PP}
+@Defmacx{P}
+These macros are mutual aliases. Any of them causes a line break at the
+current position, followed by a vertical space downwards by the amount
+specified by the @code{PD} macro. The font size and shape are reset to
+the default value (10@dmn{pt} resp.@: Roman). Finally, the current left
+margin is restored.
+@end_Defmac
+
+@maindex IP
+@Defmac{IP, [@var{designator}] [@var{nnn}]}
+Sets up an indented paragraph, using @var{designator} as a tag to mark
+its beginning. The indentation is set to @var{nnn} if that argument is
+supplied (default unit is @samp{n}), otherwise the default indentation
+value is used. Font size and face of the paragraph (but not the
+designator) are reset to their default values. To start an indented
+paragraph with a particular indentation but without a designator, use
+@samp{""} (two double quotes) as the first argument of @code{IP}.
+
+For example, to start a paragraph with bullets as the designator and
+4@dmn{en} indentation, write
+
+@example
+.IP \(bu 4
+@end example
+@end_Defmac
+
+@maindex HP
+@cindex hanging indentation, in manual pages
+@Defmac{HP, [@var{nnn}]}
+Sets up a paragraph with hanging left indentation. The indentation is
+set to @var{nnn} if that argument is supplied (default unit is
+@samp{n}), otherwise the default indentation value is used. Font size
+and face are reset to their default values.
+@end_Defmac
+
+@maindex RS
+@cindex left margin, how to move, in manual pages
+@Defmac{RS, [@var{nnn}]}
+This macro moves the left margin to the right by the value @var{nnn} if
+specified (default unit is @samp{n}); otherwise the default indentation
+value is used. Calls to the @code{RS} macro can be nested.
+@end_Defmac
+
+@maindex RE
+@Defmac{RE, [@var{nnn}]}
+This macro moves the left margin back to level @var{nnn}; if no argument
+is given, it moves one level back. The first level (i.e., no call to
+@code{RS} yet) has number@w{ }1, and each call to @code{RS} increases
+the level by@w{ }1.
+@end_Defmac
+
+@maindex SH
+@maindex SS
+@maindex TP
+@maindex LP
+@maindex PP
+@maindex P
+@maindex IP
+@maindex HP
+To summarize, the following macros cause a line break with the insertion
+of vertical space (which amount can be changed with the @code{PD}
+macro): @code{SH}, @code{SS}, @code{TP}, @code{LP} (@code{PP},
+@code{P}), @code{IP}, and @code{HP}.
+
+@maindex RS
+@maindex RE
+The macros @code{RS} and @code{RE} also cause a break but do not insert
+vertical space.
+
+@c ---------------------------------------------------------------------
+
+@node Man font macros, Miscellaneous man stuff, Man usage, man
+@subsection Macros to set fonts
+@cindex fonts in manual pages
+@cindex @code{man}, how to set fonts
+
+The standard font is Roman; the default text size is 10@w{ }point.
+
+@maindex SM
+@Defmac{SM, [@var{text}]}
+Causes the text on the same line or the text on the next line to appear
+in a font that is one point size smaller than the default font.
+@end_Defmac
+
+@maindex SB
+@cindex boldface, in manual pages
+@Defmac{SB, [@var{text}]}
+Causes the text on the same line or the text on the next line to appear
+in boldface font, one point size smaller than the default font.
+@end_Defmac
+
+@maindex BI
+@Defmac{BI, text}
+Causes text on the same line to appear alternately in bold face and
+italic. The text must be on the same line as the macro call. Thus,
+
+@example
+.BI this "word and" that
+@end example
+
+@noindent
+would cause ``this'' and ``that'' to appear in bold face, while ``word
+and'' appears in italics.
+@end_Defmac
+
+@maindex IB
+@Defmac{IB, text}
+Causes text to appear alternately in italic and bold face. The text
+must be on the same line as the macro call.
+@end_Defmac
+
+@maindex RI
+@Defmac{RI, text}
+Causes text on the same line to appear alternately in roman and italic.
+The text must be on the same line as the macro call.
+@end_Defmac
+
+@maindex IR
+@Defmac{IR, text}
+Causes text on the same line to appear alternately in italic and roman.
+The text must be on the same line as the macro call.
+@end_Defmac
+
+@maindex BR
+@Defmac{BR, text}
+Causes text on the same line to appear alternately in bold face and
+roman. The text must be on the same line as the macro call.
+@end_Defmac
+
+@maindex RB
+@Defmac{RB, text}
+Causes text on the same line to appear alternately in roman and bold
+face. The text must be on the same line as the macro call.
+@end_Defmac
+
+@maindex R
+@Defmac{R, [@var{text}]}
+Causes @var{text} to appear in roman font. If no text is present on the
+line where the macro is called, then the text of the next line appears
+in roman. This is the default font to which text is returned at the end
+of processing of the other macros.
+@end_Defmac
+
+@maindex B
+@Defmac{B, [@var{text}]}
+Causes @var{text} to appear in bold face. If no text is present on the
+line where the macro is called, then the text of the next line appears
+in bold face.
+@end_Defmac
+
+@maindex I
+@cindex italic, in manual pages
+@Defmac{I, [@var{text}]}
+Causes @var{text} to appear in italic. If no text is present on the
+line where the macro is called, then the text of the next line appears
+in italic.
+@end_Defmac
+
+@c ---------------------------------------------------------------------
+
+@node Miscellaneous man stuff, , Man font macros, man
+@subsection Miscellaneous
+
+@pindex grohtml
+@cindex @file{man}, default indentation
+@cindex default indentation, @file{man}
+The default indentation is 7.2@dmn{n} for all output devices except for
+@code{grohtml} which uses 1.2@dmn{i} instead.
+
+@maindex DT
+@maindex TH
+@cindex tab stops, in manual pages
+@Defmac{DT}
+Sets tabs every 0.5@w{ }inches. Since this macro is always called
+during a @code{TH} request, it makes sense to call it only if the tab
+positions have been changed.
+@end_Defmac
+
+@maindex PD
+@cindex empty space before a paragraph, in manual pages
+@Defmac{PD, [@var{nnn}]}
+Adjusts the empty space before a new paragraph (resp.@: section). The
+optional argument gives the amount of space (default units are
+@samp{v}); without parameter, the value is reset to its default value
+(1@w{ }line for tty devices, 0.4@dmn{v}@w{ }otherwise).
+@end_Defmac
+
+@maindex SH
+@maindex SS
+@maindex TP
+@maindex LP
+@maindex PP
+@maindex P
+@maindex IP
+@maindex HP
+This affects the macros @code{SH}, @code{SS}, @code{TP}, @code{LP}
+(resp.@: @code{PP} and @code{P}), @code{IP}, and @code{HP}.
+
+The following strings are defined:
+
+@maindex \*S
+@Defmac{\\*S}
+Switch back to the default font size.
+@end_Defmac
+
+@maindex \*R
+@Defmac{\\*R}
+The `registered' sign.
+@end_Defmac
+
+@maindex \*(Tm
+@Defmac{\\*(Tm}
+The `trademark' sign.
+@end_Defmac
+
+@maindex \*(lq
+@maindex \*(rq
+@glindex lq
+@glindex rq
+@Defmac{\\*(lq}
+@Defmacx{\\*(rq}
+Left and right quote.
+This is equal to @code{\(lq} and @code{\(rq}, respectively.
+@end_Defmac
+
+@cindex preprocessor, calling convention
+@cindex calling convention of preprocessors
+If a preprocessor like @code{gtbl} or @code{geqn} is needed, it has
+become common usage to make the first line of the man page look like
+this:
+
+@example
+.\" @var{word}
+@end example
+
+@pindex geqn@r{, invocation in manual pages}
+@pindex grefer@r{, invocation in manual pages}
+@pindex gtbl@r{, invocation in manual pages}
+@pindex man@r{, invocation of preprocessors}
+Note the single space character after the double quote. @var{word}
+consists of letters for the needed preprocessors: @samp{e} for
+@code{geqn}, @samp{r} for @code{grefer}, @samp{t} for @code{gtbl}.
+Modern implementations of the @code{man} program read this first line
+and automatically call the right preprocessor(s).
+
+
+@c =====================================================================
+
+@node mdoc, ms, man, Macro Packages
+@section @file{mdoc}
+@cindex @file{mdoc}
+@c XXX documentation
-@node -man, -ms, Tutorial for Macro Users, Top
-@chapter -man
-@cindex @code{-man}
+@c =====================================================================
+@node ms, me, mdoc, Macro Packages
+@section @file{ms}
+@cindex @file{ms}
-@node -ms, -me, -man, Top
-@chapter -ms
-@cindex @code{-ms}
+@c XXX documentation
+@c =====================================================================
-@node -me, -mm, -ms, Top
-@chapter -me
-@cindex @code{-me}
+@node me, mm, ms, Macro Packages
+@section @file{me}
+@cindex @file{me}
+@c XXX documentation
-@node -mm, Programming Tutorial, -me, Top
-@chapter -mm
-@cindex @code{-mm}
+@c =====================================================================
+@node mm, , me, Macro Packages
+@section @file{mm}
+@cindex @file{mm}
+@c XXX documentation
-@node Programming Tutorial, geqn, -mm, Top
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Programming Tutorial, Preprocessors, Macro Packages, Top
@chapter Programming Tutorial
@cindex programming tutorial
@cindex tutorial for programming
-This chapter covers @strong{all} of the facilities of groff.
-If you are intending to use a macro package, you probably do not want
-to read this chapter.
+This chapter covers @strong{all} of the facilities of @code{gtroff}.
+Users of macro packages may skip it if not interested in details.
@menu
@@ -1496,6 +2288,7 @@ to read this chapter.
* Manipulating Spacing::
* Tabs and Fields::
* Character Translations::
+* Troff and Nroff Mode::
* Line Layout::
* Page Layout::
* Page Control::
@@ -1505,31 +2298,30 @@ to read this chapter.
* Conditionals and Loops::
* Writing Macros::
* Page Motions::
-* Drawing Functions::
+* Drawing Requests::
* Traps::
* Diversions::
* Environments::
* I/O::
* Postprocessor Access::
-* Miscellany::
+* Miscellaneous::
* Debugging::
* Implementation Differences::
* Summary::
@end menu
+
+@c =====================================================================
+
@node Text, Input Conventions, Programming Tutorial, Programming Tutorial
@section Text
-@cindex text
-
-@code{groff} input files contain text with control commands
-interspersed throughout. But, even without control codes,
-@code{groff} will still do several things with your text:
-filling and adjusting,
-adding additional space after sentences,
-hyphenating
-and
-inserting implicit line breaks.
+@cindex text, @code{gtroff} processing
+@code{gtroff} input files contain text with control commands
+interspersed throughout. But, even without control codes, @code{gtroff}
+will still do several things with the input text: filling and adjusting,
+adding additional space after sentences, hyphenating and inserting
+implicit line breaks.
@menu
* Filling and Adjusting::
@@ -1539,320 +2331,498 @@ inserting implicit line breaks.
* Implicit Line Breaks::
@end menu
+@c ---------------------------------------------------------------------
+
@node Filling and Adjusting, Hyphenation, Text, Text
@subsection Filling and Adjusting
-@cindex filling and adjusting
-@cindex adjusting and filling
+@cindex filling
+@cindex adjusting
-
-When troff reads in text it collects words from input and fits as many
-of them together on one output line as it can. This is known as
+When @code{gtroff} reads in text it collects words from input and fits
+as many of them together on one output line as it can. This is known as
@dfn{filling}.
-Once troff has a @dfn{filled} line it will try to @dfn{adjust} it.
-which means it will widen the spacing between words until
-the text reaches the right margin (in the default adjustment mode).
-Extra spaces between words are preserved, but
-spaces at the end of lines are ignored.
-Spaces at the front of a line will cause a @dfn{break}
-(breaks will be explained in @ref{Implicit Line Breaks})
+@cindex leading spaces
+@cindex spaces, leading and trailing
+@cindex extra spaces
+@cindex trailing spaces
+Once @code{gtroff} has a @dfn{filled} line it will try to @dfn{adjust}
+it. This means it will widen the spacing between words until the text
+reaches the right margin (in the default adjustment mode). Extra spaces
+between words are preserved, but spaces at the end of lines are ignored.
+Spaces at the front of a line will cause a @dfn{break} (breaks will be
+explained in @ref{Implicit Line Breaks})
+
+@xref{Manipulating Filling and Adjusting}.
-@c distribute these through the text
-@xref{Manipulating Filling and Adjusting}
+@c ---------------------------------------------------------------------
@node Hyphenation, Sentences, Filling and Adjusting, Text
@subsection Hyphenation
@cindex hyphenation
+Since the odds are not great for finding a set of words, for every
+output line, which will fit nicely on a line without inserting excessive
+amounts of space between words, @code{gtroff} will hyphenate words so
+that lines can be justified without there being too much space between
+words. It uses an internal hyphenation algorithm (a simplified version
+of the algorithm used within @TeX{}) to indicate which words can be
+hyphenated and how to do so. When a word is hyphenated the first part
+of the word will be added to the current filled line being output (with
+an attached hyphen), and the other portion will be added to the next
+line to be filled.
-Since the odds of finding a set of words, for every output line,
-which will fit nicely on a
-line without inserting excessive amounts of space between words
-is not great,
-troff will hyphenate words so that lines can be justified
-without there being too much space between words.
-It uses an internal hyphenation algorithm, to indicate which words can
-be hyphenated and how to do so.
-When a word is hyphenated the first part of the word will be added
-to the current filled line being output (with an attached hyphen),
-and the other portion will be added to the next line to be filled.
+@xref{Manipulating Hyphenation}.
-@c distribute these through the text
-@xref{Manipulating Hyphenation}
+@c ---------------------------------------------------------------------
@node Sentences, Tab Stops, Hyphenation, Text
@subsection Sentences
@cindex sentences
+Although it is often debated, some typesetting rules say there should be
+different amounts of space after various punctuation marks. For
+example, the @cite{Chicago typsetting manual} says that a period at the
+end of a sentence should have twice as much space following it as would
+a comma or a period as part of an abbreviation.
+
+@c XXX exact citation of Chicago manual
+
+@cindex sentence space
+@cindex space between sentences
+@cindex french-spacing
+@code{gtroff} does this by flagging certain characters (normally
+@samp{!}, @samp{?} and @samp{.}) as @dfn{end of sentence} characters.
+When @code{gtroff} encounters one of these characters at the end of a
+line it will append two @dfn{sentence spaces} in the formatted output.
+(This justifies one of the conventions mentioned in @ref{Input
+Conventions}.)
+
+@cindex transparent characters
+@cindex character, transparent
+@glindex dg
+@glindex rq
+@cindex "
+@cindex '
+@cindex )
+@cindex ]
+@cindex *
+In addition, the following characters resp.@: glyphs are treated
+transparently while handling end of sentence characters: @samp{"},
+@samp{'}, @samp{)}, @samp{]}, @samp{*}, @code{dg}, and @code{rq}.
+
+See the @code{cflags} request in @ref{Using Symbols}, for more details.
-Although it is often debated,
-some typesetting rules say there should be different amounts of space
-after various puctuation marks.
-For example, a period at the end of a sentence
-should have twice as much space following it
-as would a comma or a period as part of an abbreviation.
-
-@cindex sentence spaces
-@cindex spaces between sentences
-Troff does this by flagging certain characters (normally
-@samp{!}, @samp{?} and @samp{.})
-as @dfn{end of sentence} characters.
-When troff encounters one of these characters at the end of a line it
-will append two @dfn{sentence spaces} in the formatted output.
-(thus, one of the conventions mentioned in @ref{Input Conventions}).
-
-@c also describe how characters like ) are treated here -jjc
-@c gotta do some research on this -trent
-
+@findex \&
+To prevent the insertion of extra space after an end of sentence
+character (at the end of a line), append @code{\&}.
+@c ---------------------------------------------------------------------
@node Tab Stops, Implicit Line Breaks, Sentences, Text
@subsection Tab Stops
@cindex tab stops
@cindex stops, tabulator
-
-
-Groff translates tabs in the input into movements to the next tab
-stop. These tab stops are initially located every half inch across
-the page.
-Using this you can make simple tables. However, this can often be
-deceptive as the appearance (and width) of your text on a terminal and
-the results from groff can vary greatly.
+@cindex tab character
+@cindex character, tabulator
+
+@cindex @acronym{EBCDIC} encoding
+@code{gtroff} translates @dfn{tabulator characters}, also called
+@dfn{tabs} (normally code point @acronym{ASCII} @code{0x09} resp.@:
+@acronym{EBCDIC} @code{0x05}), in the input into movements to the next
+tabulator stop. These tab stops are initially located every half inch
+across the page. Using this, simple tables can easily be made.
+However, it can often be deceptive as the appearance (and width) of the
+text on a terminal and the results from @code{gtroff} can vary greatly.
Also, a possible sticking point is that lines beginning with tab
characters will still be filled, again producing unexpected results.
For example, the following input
-@example
- 1 2 3
- 4 5
-@end example
+@multitable {12345678} {12345678} {12345678} {12345678}
+@item
+@tab 1 @tab 2 @tab 3
+@item
+@tab @tab 4 @tab 5
+@end multitable
@noindent
will produce
-@example
- 1 2 3 4 5
-@end example
-
-@c Tab stops are with respect to the input line. -jjc
-@c did that last section address that?? -trent
-
+@multitable {12345678} {12345678} {12345678} {12345678} {12345678} {12345678} {12345678}
+@item
+@tab 1 @tab 2 @tab 3 @tab @tab 4 @tab 5
+@end multitable
+@xref{Tabs and Fields}.
-@c distribute these through the text
-@xref{Tabs and Fields}
+@c ---------------------------------------------------------------------
@node Implicit Line Breaks, , Tab Stops, Text
@subsection Implicit Line Breaks
@cindex implicit line breaks
@cindex implicit breaks of lines
@cindex line, implicit breaks
-@cindex break
@cindex break, implicit
@cindex line break
-An important concept in troff is the @dfn{break}. When a @dfn{break}
-occurs, troff will output the partially filled line (unadjusted),
-and resume collecting and filling text on the next output line.
+An important concept in @code{gtroff} is the @dfn{break}. When a break
+occurs, @code{gtroff} will output the partially filled line
+(unjustified), and resume collecting and filling text on the next output
+line.
@cindex blank line
@cindex empty line
@cindex line, blank
-There are several ways to cause a break in troff.
-A blank line will not only cause a break, but it will also cause a
-one line vertical space (effectively a blank line) to be output.
+There are several ways to cause a break in @code{gtroff}. A blank line
+will not only cause a break, but it will also cause a one line vertical
+space (effectively a blank line) to be output.
-A line which begins with a space will cause a break and the space
-will be output at the beginning of the next line.
-Note that this space isn't adjusted, even in fill mode.
+@cindex fill mode
+@cindex mode, fill
+A line which begins with a space will cause a break and the space will
+be output at the beginning of the next line. Note that this space isn't
+adjusted, even in fill mode.
-The end of file will also cause a break (otherwise the last line of
-your document may vanish!)
+The end of file will also cause a break -- otherwise the last line of
+the document may vanish!
-Certain @dfn{requests} also cause breaks, implicitly or explicity.
-This will be discussed later.
+Certain requests also cause breaks, implicitly or explicitly. This will
+be discussed in @ref{Manipulating Filling and Adjusting}.
-@c distribute these through the text
-@xref{Manipulating Filling and Adjusting}
+
+@c =====================================================================
@node Input Conventions, Measurements, Text, Programming Tutorial
@section Input Conventions
@cindex input conventions
@cindex conventions for input
+Since @code{gtroff} does filling automatically, it is traditional in
+@code{groff} not to try and type things in as nicely formatted
+paragraphs. These are some conventions commonly used when typing
+@code{gtroff} text:
-Since groff does filling automatically, it is traditional in groff not
-to try and type things in as nicely formatted paragraphs. These are
-some conventions commonly used when typing groff text:
-
-@itemize @bullet{}
+@itemize @bullet
@item
-Break lines after punctuation, particularily at the ends of
-sentences, and in other logical places. Keep separate phrases on
-lines by themselves, as entire phrases are often added or deleted
-when editing.
+Break lines after punctuation, particularly at the end of a sentence,
+and in other logical places. Keep separate phrases on lines by
+themselves, as entire phrases are often added or deleted when editing.
+
@item
-Try to keep lines less than 40-60 characters,
-to allow space for inserting more text.
+Try to keep lines less than 40-60@w{ }characters, to allow space for
+inserting more text.
+
@item
-Do not try to do any formatting in a WYSIWYG manner (i.e. don't
-try and use spaces to get proper indentation).
+Do not try to do any formatting in a @acronym{WYSIWYG} manner (i.e.,
+don't try and use spaces to get proper indentation).
@end itemize
+@c =====================================================================
+
@node Measurements, Expressions, Input Conventions, Programming Tutorial
@section Measurements
@cindex measurements
-
@cindex units of measurement
@cindex basic units
@cindex machine units
-Troff (like any other programs) requires numeric parameters to
-specify various measurements. Most numeric parameters
-@footnote{those that specify vertical or horizontal motion or a type
-size} may have a measurement unit attached.
-These units are specified as a single
-character which immediately follows the number or expression.
-Each of these units are understood, by troff, to be a multiple of its
+@cindex measurement units
+@cindex @code{u} unit
+@cindex unit, @code{u}
+@code{gtroff} (like any other programs) requires numeric parameters to
+specify various measurements. Most numeric parameters@footnote{those
+that specify vertical or horizontal motion or a type size} may have a
+@dfn{measurement unit} attached. These units are specified as a single
+character which immediately follows the number or expression. Each of
+these units are understood, by @code{gtroff}, to be a multiple of its
@dfn{basic unit}. So, whenever a different measurement unit is
-specified troff converts this into its basic units.
-This basic unit, represented by a @samp{u} is a
-device dependent measurement which is quite small, ranging from
-1/75th to 1/72000th of an inch.
+specified @code{gtroff} converts this into its @dfn{basic units}. This
+basic unit, represented by a @samp{u}, is a device dependent measurement
+which is quite small, ranging from 1/75th to 1/72000th of an inch. The
+values may be given as fractional numbers; however, fractional basic
+units are always rounded to integers.
-Some of the measurement units are compleatly independent of any of
-the current settings (e.g. type size) of groff.
+Some of the measurement units are completely independent of any of the
+current settings (e.g.@: type size) of @code{gtroff}.
-@table @samp
+@table @code
@item i
@cindex inch
+@cindex @code{i} unit
+@cindex unit, @code{i}
Inches. An antiquated measurement unit still in use in certain
-backwards countries.
+backwards countries. One inch is equal to@w{ }2.54@dmn{cm}.
+
@item c
@cindex centimeter
-Centimeters.
+@cindex @code{c} unit
+@cindex unit, @code{c}
+Centimeters. One centimeter is equal to@w{ }0.3937@dmn{in}.
+
@item p
@cindex points
+@cindex @code{p} unit
+@cindex unit, @code{p}
Points. This is a typesetter's measurement used for measure type size.
-It is 72 points to an inch.
+It is 72@w{ }points to an inch.
+
@item P
@cindex pica
-Pica. Another typesetting measurement. 6 Picas to an inch.
+@cindex @code{P} unit
+@cindex unit, @code{P}
+Pica. Another typesetting measurement. 6@w{ }Picas to an inch (and
+12@w{ }points to a pica).
+
@item s
-@item z
+@itemx z
+@cindex @code{s} unit
+@cindex unit, @code{s}
+@cindex @code{z} unit
+@cindex unit, @code{z}
+@xref{Fractional Type Sizes}, for a discussion of these units.
@end table
-The other measurements understood by troff are dependent on settings
-currently in effect in troff. These are very useful for specifying
-measurements which should look proper with any size of text.
+The other measurements understood by @code{gtroff} are dependent on
+settings currently in effect in @code{gtroff}. These are very useful
+for specifying measurements which should look proper with any size of
+text.
-@table @samp
+@table @code
@item m
-@cindex em
-Ems. This unit is equal to the current font size in points.
-So called because it is @emph{approximately} the width of the letter
-@samp{m} in the current font.
+@cindex em unit
+@cindex @code{m} unit
+@cindex unit, @code{m}
+Ems. This unit is equal to the current font size in points. So called
+because it is @emph{approximately} the width of the letter@w{ }@samp{m}
+in the current font.
+
@item n
-@cindex en
+@cindex en unit
+@cindex @code{n} unit
+@cindex unit, @code{n}
Ens. This is half of an em.
+
@item v
@cindex vertical space
@cindex space, vertical
+@cindex @code{v} unit
+@cindex unit, @code{v}
Vertical space. This is equivalent to the current line spacing.
@xref{Sizes}, for more information about this.
+
@item M
+@cindex @code{M} unit
+@cindex unit, @code{M}
100ths of an em.
@end table
-@c distribute these through the text
-@xref{Fractional Type Sizes}
-
@menu
* Default Units::
@end menu
+@c ---------------------------------------------------------------------
+
@node Default Units, , Measurements, Measurements
@subsection Default Units
@cindex default units
@cindex units, default
-
-Many requests take a default unit. While this can be helpful at
-times, it can cause strange errors in some expressions.
-For example, the line length request expects em's.
-Here are several attempts to get 3.5 inches and the results:
+Many requests take a default unit. While this can be helpful at times,
+it can cause strange errors in some expressions. For example, the line
+length request expects em units. Here are several attempts to get a
+line length of 3.5@w{ }inches and their results:
@example
3.5i @result{} 3.5i
7/2 @result{} 0i
7/2i @result{} 0i
-7i/2 @result{} .1i
+7i/2 @result{} 0.1i
7i/2u @result{} 3.5i
@end example
-As you can see, the safest way to specify measurements is to always
-attach a scaling indicator.
+@noindent
+Everything will be converted to basic units first. In the above example
+it is assumed that 1@dmn{i} equals@w{ }240@dmn{u}, and 1@dmn{m}
+equals@w{ }10@dmn{p} (thus 1@dmn{m} equals@w{ }33@dmn{u}). The value
+7i/2 will be first handled as 7i/2m, then converted to 1680u/66u which
+is 25@dmn{u}, and this is approximately 0.1@dmn{i}.
+
+@cindex measurements, specifying safely
+As a conclusion, the safest way to specify measurements is to always
+attach a scaling indicator. If you want to multiply or divide by a
+certain scalar value, use @samp{u} as the unit for that value.
+
+
+@c =====================================================================
@node Expressions, Identifiers, Measurements, Programming Tutorial
@section Expressions
@cindex expressions
+@code{gtroff} has most of operators common to other languages:
-Troff has most of operators common to other languages:
+@c XXX more details; examples
@itemize @bullet
@item
-Arithmetic: +, -, /, *, %
+@cindex arithmetic operators
+@cindex operators, arithmetic
+@opindex +
+@opindex -
+@opindex /
+@opindex *
+@opindex %
+Arithmetic: @samp{+} (addition), @samp{-} (subtraction), @samp{/}
+(division), @samp{*} (multiplication), @samp{%} (modulo).
+
+@code{gtroff} only provides integer arithmetic. The internal type used
+for computing results is @samp{int}, which is usually a 32@dmn{bit}
+signed integer.
+
@item
-Comparison: <, >, >=, <=, =, == (the last two are the same)
+@cindex comparison operators
+@cindex operators, comparison
+@opindex <
+@opindex >
+@opindex >=
+@opindex <=
+@opindex =
+@opindex ==
+Comparison: @samp{<} (less than), @samp{>} (greater than), @samp{<=}
+(less than or equal), @samp{>=} (greater than or equal), @samp{=}
+(equal), @samp{==} (the same as @samp{=}).
+
@item
-Logical: &, :
+@cindex logical operators
+@cindex operators, logical
+@opindex &
+@opindex :
+Logical: @samp{&} (logical and), @samp{:} (logical or).
+
@item
-Unary operators: -, +, ! (if/while only??)
+@cindex unary operators
+@cindex operators, unary
+@opindex -
+@opindex +
+@opindex !
+@findex if@r{, and the @samp{!} operator}
+@findex while@r{, and the @samp{!} operator}
+Unary operators: @samp{-} (negating, i.e.@: changing the sign), @samp{+}
+(just for completeness; does nothing in expressions), @samp{!} (logical
+not; this works only within @code{if} and @code{while} requests). See
+below for the use of unary operators in motion requests.
+
@item
-Maximum and minimum: >?, <?
+@cindex extremum operators
+@cindex operators, extremum
+@opindex >?
+@opindex <?
+Extrema: @samp{>?} (maximum), @samp{<?} (minimum). For example,
+@samp{5>?3} yields@w{ }@samp{5}.
+
+@c XXX add examples
+
@item
-Scaling: (@var{c};@var{e})
-Evaluate @var{e} using @var{c} as the default scaling indicator.
-If @var{c} is missing, ignore scaling indicators in the
-evaluation of @var{e}.
+@cindex scaling operator
+@cindex operator, scaling
+Scaling: @code{(@var{c};@var{e})}. Evaluate @var{e} using @var{c} as
+the default scaling indicator. If @var{c} is missing, ignore scaling
+indicators in the evaluation of @var{e}.
@end itemize
-Parenthesis may be used as in any other language.
-However, in groff they are necessary to ensure order of evaluation.
-Groff has no operator precedence,
-expressions are evaluated left to right.
-This means that @samp{3+5*4} is evaluated as if it were parenthesized
-like @samp{(3+5)*4}, not as @samp{3+(5*4)}, like you may expect.
+@cindex parentheses
+@cindex order of evaluation in expressions
+@cindex expression, order of evaluation
+@opindex (
+@opindex )
+Parentheses may be used as in any other language. However, in
+@code{gtroff} they are necessary to ensure order of evaluation.
+@code{gtroff} has no operator precedence; expressions are evaluated left
+to right. This means that @samp{3+5*4} is evaluated as if it were
+parenthesized like @samp{(3+5)*4}, not as @samp{3+(5*4)}, as might be
+expected.
+
+@opindex +@r{, and page motion}
+@opindex -@r{, and page motion}
+@opindex |@r{, and page motion}
+@cindex motion operators
+@cindex operators, motion
+For many requests which cause a motion on the page, the unary operators
+work differently. The @samp{+} and @samp{-} operators then indicate a
+motion relative to the current position (down or up, respectively), and
+the @samp{|} operator indicates an absolute position on the page or
+input line.
+@c XXX xref
+@samp{+} and @samp{-} are also treated differently by the following
+requests and escapes: @code{bp}, @code{in}, @code{ll}, @code{lt},
+@code{nm}, @code{nr}, @code{pl}, @code{pn}, @code{po}, @code{ps},
+@code{rt}, @code{ti}, @code{\R}, and @code{\s}. Here the plus and minus
+signs indicate increments resp.@: decrements.
+
+@c XXX add more xref
+@xref{Setting Registers}.
+
+@cindex space characters in expressions
+@cindex expressions and space characters
+Due to the way arguments are parsed, spaces are not allowed in
+expressions, unless the entire expression is surrounded by parentheses.
-For many requests which cause a motion on the page, the unary
-operators work differently.
-The @samp{+} and @samp{-} operators indicate a motion relative to the
-current position (down or up, respectively). The @samp{|} operator
-indicates an absolute position on the page or input line. (????)
-@code{+} and @code{-} are also treated differently by @code{nr} (?)
+@xref{Request Arguments}, and @ref{Conditionals and Loops}.
-Due to the way arguments are parsed, spaces are not allowed in
-expressions, unless the entire expression is surrounded by parenthesis.
-@c distribute these through the text
-@xref{Request Arguments}
-@c distribute these through the text
-@xref{Conditionals and Loops}
+@c =====================================================================
@node Identifiers, Embedded Commands, Expressions, Programming Tutorial
@section Identifiers
@cindex identifiers
-Like any other language troff, has rules for properly formed
-identifiers.
-In troff an identifier can be made up of most any printable
-character.
-The only exception is characters which are interpreted by troff
-(backslash, square bracket and ?). So, for example, any of the following
-are valid.
+Like any other language, @code{gtroff} has rules for properly formed
+@dfn{identifiers}. In @code{gtroff}, an identifier can be made up of
+almost any printable character, with the exception of the following
+characters:
+
+@itemize @bullet
+@item
+@cindex whitespace characters
+@cindex newline character
+@cindex character, whitespace
+Whitespace characters (space, tabs, and newlines).
+
+@item
+@cindex character, backspace
+@cindex backspace character
+@cindex @acronym{EBCDIC} encoding of backspace
+Backspace (@acronym{ASCII}@w{ }@code{0x08} resp.@: @acronym{EBCDIC}@w{
+}@code{0x16}) and character code @code{0x01}.
+
+@item
+@cindex invalid input characters
+@cindex input characters, invalid
+@cindex characters, invalid input
+@cindex unicode
+The following input characters are invalid and will be ignored if
+@code{groff} runs on a machine based on @acronym{ASCII}, causing a
+warning message of type @samp{input} (see @ref{Debugging}, for more
+details): @code{0x00}, @code{0x0B}, @code{0x0D}-@code{0x1F},
+@code{0x80}-@code{0x9F}.
+
+And here are the invalid input characters if @code{groff} runs on an
+@acronym{EBCDIC} host: @code{0x00}, @code{0x08}, @code{0x09},
+@code{0x0B}, @code{0x0D}-@code{0x14}, @code{0x17}-@code{0x1F},
+@code{0x30}-@code{0x3F}.
+
+Currently, some of these reserved codepoints are used internally, thus
+making it non-trivial to extend @code{gtroff} to cover Unicode or other
+character sets resp.@: encodings which use characters of these ranges.
+
+Note that invalid characters will be removed before parsing; an
+identifier @code{foo}, followed by an invalid character, followed by
+@code{bar} will be treated as @code{foobar}.
+@end itemize
+
+For example, any of the following is valid.
@example
br
@@ -1862,59 +2832,83 @@ end-list
@@_
@end example
-You can test whether an identifier is valid in groff with the
-@code{\A} escape. It expands to 1 or 0 according whether its argument
-(given in quotes) is or is not acceptable as the name of a string,
-macro, diversion, number register, environment or font. It will return
-0 if no argument is given. This is useful if you want to lookup user
-input in some sort of associative table.
+@findex ]
+Note that identifiers longer than two characters with a closing bracket
+(@samp{]}) in its name can't be accessed with escape sequences which
+expect an identifier as a parameter. For example, @samp{\[foo]]} will
+access the glyph @samp{foo}, followed by @samp{]}, whereas
+@samp{\C'foo]'} really asks for glyph @samp{foo]}.
-Identifiers in groff can be any length, but, in some contexts,
-groff needs to told
-where identifiers end and text begins (and in different ways
-depending on their length)
+@c XXX xref
-@itemize @bullet{}
+@Deffn{Escape, \\A, ident}
+Whether an identifier @var{ident} is valid in @code{gtroff} can be
+tested with the @code{\A} escape. It expands to the character@w{ }1
+or@w{ }0 according to whether its argument (usually delimited by quotes)
+is or is not acceptable as the name of a string, macro, diversion,
+number register, environment, or font. It will return@w{ }0 if no
+argument is given. This is useful for looking up user input in some
+sort of associative table.
+
+@example
+\A'end-list'
+ @result{} 1
+@end example
+@end_Deffn
+
+@xref{Escapes}, for details on parameter delimiting characters.
+
+@c XXX add xrefs above
+
+Identifiers in @code{gtroff} can be any length, but, in some contexts,
+@code{gtroff} needs to be told where identifiers end and text begins
+(and in different ways depending on their length):
+
+@findex (
+@findex [
+@findex ]
+@itemize @bullet
@item
-Single character
+Single character.
+
@item
-Two characters
-Must be prefixed with @samp{(} in some situations.
+Two characters. Must be prefixed with @samp{(} in some situations.
+
@item
-Arbitrary length (groff only)
-Must be bracketed with @samp{[}, @samp{]} in some situations.
-Any length identifier can be put in brackets.
+Arbitrary length (@code{gtroff} only). Must be bracketed with @samp{[}
+and@w{ }@samp{]} in some situations. Any length identifier can be put
+in brackets.
@end itemize
+@cindex undefined identifiers
+@cindex indentifiers, undefined
Unlike many other programming languages, undefined identifiers are
silently ignored or expanded to nothing.
+@c XXX add info about -ww command line option.
+
+@xref{Interpolating Registers}, and @ref{Strings}.
-@c distribute these through the text
-@xref{Interpolating Registers}
-@c distribute these through the text
-@xref{Strings}
+
+@c =====================================================================
@node Embedded Commands, Registers, Identifiers, Programming Tutorial
@section Embedded Commands
@cindex embedded commands
@cindex commands, embedded
-
-With most documents you need more funtionality beyond filling,
-adjusting and implicit line breaking.
-In order to gain further functionality, groff allows commands to be
-embeded into your text, in two ways.
+Most documents need more functionality beyond filling, adjusting and
+implicit line breaking. In order to gain further functionality,
+@code{gtroff} allows commands to be embedded into the text, in two ways.
The first is a @dfn{request} which takes up an entire line, and does
-some large scale operation (e.g. break lines, start new pages).
-
-The other is an @dfn{escape} which can be embedded anywhere
-in your text, or even as an argument to a request. (Not always?)
-Escapes generally do more minor operations like sub- and super-
-scripts, print a symbol, &c.
-
+some large scale operation (e.g.@: break lines, start new pages).
+The other is an @dfn{escape} which can be embedded anywhere in the text,
+or even as an argument to a request.
+@c XXX (Not always?)
+Escapes generally do more minor operations like sub- and superscripts,
+print a symbol, etc.
@menu
* Requests::
@@ -1922,30 +2916,39 @@ scripts, print a symbol, &c.
* Escapes::
@end menu
+@c ---------------------------------------------------------------------
+
@node Requests, Macros, Embedded Commands, Embedded Commands
@subsection Requests
@cindex requests
-
@cindex control character
@cindex character, control
-A request line begins with a control character,
-which is either a single quote (@samp{'}) or a period (@samp{.}).
-These can be changed @pxref{Character Translations}, for details.
-After this there may be optional tabs or spaces followed by an
-identifier which is the name of the request.
-This may be followed by any number of space separated arguments.
+@cindex no-break control character
+@cindex character, no-break control
+@cindex control character, no-break
+@findex '
+@findex .
+A request line begins with a control character, which is either a single
+quote (@samp{'}, the @dfn{no-break control character}) or a period
+(@samp{.}, the normal @dfn{control character}). These can be changed;
+see @ref{Character Translations}, for details. After this there may be
+optional tabs or spaces followed by an identifier which is the name of
+the request. This may be followed by any number of space-separated
+arguments.
-@findex \&
-If you want to begin a line with a control character without it being
-interpreted, precede it with a @code{\&}. This represents a zero
-width space, which means it will not affect you output.
+@cindex zero width space character
+@cindex character, zero width space
+@cindex space character, zero width
+@findex \&@r{, escaping control characters}
+To begin a line with a control character without it being interpreted,
+precede it with @code{\&}. This represents a zero width space, which
+means it will not affect the output.
-In most cases you will use the period as a control character.
-Several requests will cause a break, using the single quote control
+In most cases the period is used as a control character. Several
+requests will cause a break implicitly; using the single quote control
character will prevent this.
-
@menu
* Request Arguments::
@end menu
@@ -1955,14 +2958,12 @@ character will prevent this.
@cindex request arguments
@cindex arguments to requests
+Arguments to requests (and macros) are processed much like the shell:
+The line is split into arguments according to spaces. An argument which
+is intended to contain spaces can either be enclosed in quotes (single
+or double), or have the spaces @dfn{escaped} with backslashes.
-Argument to requests (and macros) are processed much like the shell:
-The line is split into arguments according to spaces.
-An argument which is intended to contain spaces can either be enclosed
-in quotes (single or double), or have the spaces @dfn{escaped} with
-backslashes.
-
-So, for example:
+Here are a few examples:
@example
.uh The Mouse Problem
@@ -1970,55 +2971,68 @@ So, for example:
.uh The\ Mouse\ Problem
@end example
-The first line is the @code{.uh} macro being called with 3 arguments,
-@samp{The}, @samp{Mouse}, and @samp{Problem}.
-The latter two have the same effect or calling the @code{.uh} macro
-with one argument @samp{The Mouse Problem}.
+@findex \~
+@findex \@key{SP}
+@noindent
+The first line is the @code{uh} macro being called with 3 arguments,
+@samp{The}, @samp{Mouse}, and @samp{Problem}. The latter two have the
+same effect or calling the @code{uh} macro with one argument, @samp{The
+Mouse Problem}.@footnote{The last solution, i.e., using escaped spaces,
+is ``classical'' in the sense that it can be found in most @code{troff}
+documents. Nevertheless, it is not optimal in all situations, since
+@w{@samp{\ }} inserts a fixed-width, non-breaking space character which
+can't stretch. @code{gtroff} provides a different command @code{\~} to
+insert a stretchable, non-breaking space.}
-Note, however, that the @code{.ds} request works differently.
+@findex ds
+Note, however, that the @code{ds} request works differently.
+@xref{Strings}, for more details.
-@c distribute these through the text
-@xref{Strings}
+@c ---------------------------------------------------------------------
@node Macros, Escapes, Requests, Embedded Commands
@subsection Macros
@cindex macros
+@code{gtroff} has a @dfn{macro} facility for defining a series of lines
+which can be invoked by name. They are called in the same manner as
+requests -- arguments also may be passed in the same manner.
-Troff has a @dfn{macro} facility for defining a series of lines which
-can be invoked by name.
-They are called in the same manner as requests
-and arguments may be passed in the same manner.
-
+@xref{Writing Macros}, and @ref{Request Arguments}.
-@c distribute these through the text
-@xref{Writing Macros}
-@c distribute these through the text
-@xref{Request Arguments}
+@c ---------------------------------------------------------------------
@node Escapes, , Macros, Embedded Commands
@subsection Escapes
@cindex escapes
+Escapes may occur anywhere in the input to @code{gtroff}. They usually
+begin with a backslash and are followed by a single character which
+indicates the function to be performed. The escape character can be
+changed; see @ref{Character Translations}.
-@findex \e
-@findex \\
-Escapes may occur anywhere in the input to groff.
-They begin with a backslash and are followed by a single character
-which indicates the function to be performed.
-If you want to have a backslash appear in your document, you should
-use the escape sequence @code{\e}. Merely escaping the backslash
-with another backslash will work in @emph{some} curcumstances.
-
-Many escapes have no parameters, those that do, do so in one of two
-ways. For escapes which require an identifier there must be a way for
-groff to tell where the identifier ends and the text begins.
-It assumes that the next single character is the identifier, but if
-that character is an open parenthesis, it takes the next two
-characters as the identifier; and if the next character is an open
-bracket, all characters until a close bracket are taken as the
-identifier. Note that in the second case there is no closing
-parenthesis. For example:
+@findex (
+@findex [
+@findex ]
+Escape sequences which require an identifier as a parameter accept three
+possible syntax forms.
+
+@itemize @bullet
+@item
+The next single character is the identifier.
+
+@item
+If this single character is an opening parenthesis, take the following
+two characters as the identifier. Note that there is no closing
+parenthesis after the identifier.
+
+@item
+If this single character is an opening bracket, take all characters
+until a closing bracket as the identifier.
+@end itemize
+
+@noindent
+Examples:
@example
\fB
@@ -2026,28 +3040,163 @@ parenthesis. For example:
\*[TeX]
@end example
-Other escapes may require several arguments and/or some special
-format. In these cases the @dfn{argument} is enclosed in single
-quotes (not required??) and the enclosing text is decoded according
-to what that escape expects.
+@findex '
+@cindex argument delimiting characters
+@cindex characters, argument delimiting
+@cindex delimiting characters for arguments
+Other escapes may require several arguments and/or some special format.
+In such cases the argument is traditionally enclosed in single quotes
+(and quotes are always used in this manual for the definitions of escape
+sequences). The enclosed text is then processed according to what that
+escape expects. Example:
@example
\l'1.5i\(bu'
@end example
+@findex \o
+@findex \b
+@findex \X
+Note that the quote character can be replaced with any other character
+which does not occur in the argument (even a newline or a space
+character) in the following escapes: @code{\o}, @code{\b}, and
+@code{\X}. This makes e.g.
+
+@example
+A caf
+\o
+e\'
+
+
+in Paris
+ @result{} A caf@'e in Paris
+@end example
+
+@noindent
+possible, but it is better not to use this feature to avoid confusion.
+
+@findex \%
+@findex \@key{SP}
+@findex \|
+@findex \^
+@findex \@{
+@findex \@}
+@findex \'
+@findex \`
+@findex \-
+@findex \_
+@findex \!
+@findex \?
+@findex \@@
+@findex \)
+@findex \/
+@findex \,
+@findex \&
+@findex \~
+@findex \0
+@findex \a
+@findex \c
+@findex \d
+@findex \e
+@findex \E
+@findex \p
+@findex \r
+@findex \t
+@findex \u
+The following escapes sequences (which are handled similarly to
+characters since they don't take a parameter) are also allowed as
+delimiters: @code{\%}, @w{@samp{\ }}, @code{\|}, @code{\^}, @code{\@{},
+@code{\@}}, @code{\'}, @code{\`}, @code{\-}, @code{\_}, @code{\!},
+@code{\?}, @code{\@@}, @code{\)}, @code{\/}, @code{\,}, @code{\&},
+@code{\~}, @code{\0}, @code{\a}, @code{\c}, @code{\d}, @code{\e},
+@code{\E}, @code{\p}, @code{\r}, @code{\t}, and @code{\u}. Again, don't
+use these if possible.
+
+@findex \A
+@findex \Z
+@findex \C
+@findex \w
+No newline characters as delimiters are allowed in the following
+escapes: @code{\A}, @code{\Z}, @code{\C}, and @code{\w}.
+
+@findex \D
+@findex \h
+@findex \H
+@findex \l
+@findex \L
+@findex \N
+@findex \R
+@findex \s
+@findex \S
+@findex \v
+@findex \x
+Finally, the escapes @code{\D}, @code{\h}, @code{\H}, @code{\l},
+@code{\L}, @code{\N}, @code{\R}, @code{\s}, @code{\S}, @code{\v}, and
+@code{\x} can't use the following characters as delimiters:
+
+@itemize @bullet
+@item
+@cindex numbers
+@cindex digits
+The digits @code{0}-@code{9}.
+
+@item
+@cindex operators
+@opindex +
+@opindex -
+@opindex /
+@opindex *
+@opindex %
+@opindex <
+@opindex >
+@opindex =
+@opindex &
+@opindex :
+@opindex (
+@opindex )
+@opindex .
+The (single-character) operators @samp{+-/*%<>=&:().}.
+
+@item
+@cindex space character
+@cindex character, space
+@cindex tab character
+@cindex character, tab
+@cindex newline character
+@cindex character, newline
+The space, tab, and newline characters.
+
+@item
+@findex \%
+@findex \@{
+@findex \@}
+@findex \'
+@findex \`
+@findex \-
+@findex \_
+@findex \!
+@findex \@@
+@findex \/
+@findex \c
+@findex \e
+@findex \p
+All escape sequences except @code{\%}, @code{\@{}, @code{\@}},
+@code{\'}, @code{\`}, @code{\-}, @code{\_}, @code{\!}, @code{\@@},
+@code{\/}, @code{\c}, @code{\e}, and @code{\p}.
+@end itemize
+
@findex \\
@findex \e
@findex \E
-If you want to have a backslash appear in your output, you can use several
-escapes: @code{\\}, @code{\e} or @code{\E}.
+To have a backslash (resp.@: the current escape character) appear in the
+output several escapes are defined: @code{\\}, @code{\e} or @code{\E}.
These are very similar, and only differ with respect to being used in
-macros or diversions (@xref{Copy-in Mode}, and @ref{Diversions}, for
-more information)
+macros or diversions. @xref{Copy-in Mode}, and @ref{Diversions}, for
+more information.
+@c XXX explanation of \E
-
-@c distribute these through the text
-@xref{Identifiers}
+@xref{Identifiers}, and @ref{Character Translations}.
@menu
* Comments::
@@ -2057,196 +3206,337 @@ more information)
@subsubsection Comments
@cindex comments
-
-@findex \"
Probably one of the most@footnote{Unfortunately, this is a lie. But
-hopefully future troff hackers will believe it :-)}
+hopefully future @code{gtroff} hackers will believe it @code{:-)}}
common forms of escapes is the comment.
-They begin with the @code{\"} escape and end at the end of the input
-line.
+
+@Deffn{Escape, \\"}
+Start a comment. Everything to the end of the input line is ignored.
This may sound simple, but it can be tricky to keep the comments from
-interfering with the apperarance of your final outupt.
+interfering with the appearance of the final output.
-If the escape is to the right of some text or a request, that portion
-of the line will be ignored, but the space leading up to it will be
-noticed by groff. This only affects the @code{.ds} request (any
-others?).
+@findex ds
+If the escape is to the right of some text or a request, that portion of
+the line will be ignored, but the space leading up to it will be noticed
+by @code{gtroff}. This only affects the @code{.ds} request.
+@c XXX (any others?)
+
+@cindex tabs before comments
+@cindex comments, lining up with tabs
+One possibly irritating idiosyncracy is that tabs must not be used to
+line up comments. Tabs are not treated as white space between the
+request and macro arguments.
+
+@cindex undefined request
+@cindex request, undefined
+A comment on a line by itself will be treated as a blank line, because
+after eliminating the comment, that is all that remains:
-One possibly irritating idiosyncracy is that you mustn't use tabs to
-line up your comments.
-Tabs are not treated as white space between request and macro
-arguments.
+@example
+Test
+\" comment
+Test
+@end example
-If you have a comment on a line by itself, it will be treated as a
-blank line, because after eliminating the comment, that is all that
-remains. So, it is common to start the line with @code{.\"} which
-will cause the line to be treated as an undefined request.
+@noindent
+will produce
+
+@example
+Test
+
+Test
+@end example
+As a consequence, it is common to start the line with @code{.\"} which
+will cause the line to be treated as an undefined request and thus
+ignored completely.
+
+@findex '
Another commenting scheme seen sometimes is three consecutive single
-quotes (@code{'''}) at the begining of a line. This works, but groff
-will give a warning about an undefined macro, which is harmless, but
-irritating.
+quotes (@code{'''}) at the beginning of a line. This works, but
+@code{gtroff} will give a warning about an undefined macro (namely
+@code{''}), which is harmless, but irritating.
+@end_Deffn
+
+@Deffn{Escape, \\#}
+To avoid all this, @code{gtroff} has a new comment mechanism using
+the @code{\#} escape. This escape works the same as @code{\"} except
+that the newline is also ignored:
+
+@example
+Test
+\# comment
+Test
+@end example
-@findex \#
-Now to avoid all this groff has a new comment mechanism using the
-@code{\#} escape. This escape works the same as @code{\"} except
-that the newline is also ignored.
+@noindent
+will produce
+
+@example
+Test Test
+@end example
+
+@noindent
+as expected.
+@end_Deffn
@findex ig
-For large blocks of text, the @code{ig} request may be useful.
-@c distribute these through the text
-@xref{Strings}
+For commenting away large blocks of text, the @code{ig} request may be
+useful.
+
+@c XXX definition of .ig
+
+@xref{Strings}.
+
+
+@c =====================================================================
@node Registers, Manipulating Filling and Adjusting, Embedded Commands, Programming Tutorial
@section Registers
@cindex registers
+Numeric variables in @code{gtroff} are called @dfn{registers}. There
+are a number of built-in registers, supplying anything from the date to
+details of formatting parameters.
-Registers are groff's numeric variables. groff has a number of
-builtin registers, supplying anything from the date to details of
-formatting parameters.
-
-@c distribute these through the text
-@xref{Identifiers}
+@xref{Identifiers}, for details on register identifiers.
@menu
* Setting Registers::
* Interpolating Registers::
* Auto-increment::
* Assigning Formats::
-* Builtin Registers::
+* Built-in Registers::
@end menu
+@c ---------------------------------------------------------------------
+
@node Setting Registers, Interpolating Registers, Registers, Registers
@subsection Setting Registers
@cindex setting registers
@cindex registers, setting
+Registers are defined resp.@: set via the @code{nr} request or the
+@code{\R} escape.
-@findex nr
-@findex \R
-Registers are defined/set via the @code{nr}
-request or the @code{\R} escape, for example, the following two lines
-are equivalent:
+@Deffn{Request, nr, ident value}
+@Deffnx{Escape, \\R, ident value}
+Set number register @var{ident} to @var{value}. If @var{ident} doesn't
+exist, it will be created.
+
+The argument to @code{\R} has to be enclosed in quotes usually.
+@xref{Escapes}, for details on parameter delimiting characters.
+@end_Deffn
+
+For example, the following two lines are equivalent:
@example
.nr a 1
\R'a 1'
@end example
-@findex rr
-The @code{rr} request will
-remove the register specified by the argument.
+Both @code{nr} and @code{\R} have two additional special forms to
+increment resp.@: decrement a register.
+
+@Deffn{Request, nr, ident +value}
+@Deffnx{Request, nr, ident -value}
+@Deffnx{Escape, \\R, ident +value}
+@Deffnx{Escape, \\R, ident -value}
+Increment (decrement) register @var{ident} by @var{value}.
+
+@example
+.nr a 1
+.nr a +1
+\na
+ @result{} 2
+@end example
+
+@cindex negating register values
+To assign the negated value of a register to another register, some care
+must be taken to get the desired result:
+
+@example
+.nr a 7
+.nr b 3
+.nr a -\nb
+\na
+ @result{} 4
+.nr a (-\nb)
+\na
+ @result{} -3
+@end example
+
+@noindent
+The surrounding parentheses prevent the interpretation of the minus sign
+as a decrementing operator. An alternative is to start the assignment
+with a @samp{0}:
+
+@example
+.nr a 7
+.nr b -3
+.nr a \nb
+\na
+ @result{} 4
+.nr a 0\nb
+\na
+ @result{} -3
+@end example
+@end_Deffn
+
+@Deffn{Request, rr, ident}
+Remove number register @var{ident}. If @var{ident} doesn't exist, the
+request is ignored.
+@end_Deffn
-@findex rnn
-The @code{rnn} request will rename a number register.
-The format is @samp{.rnn @var{x} @var{y}}, which will
-rename number register @var{x} to @var{y}.
+@Deffn{Request, rnn, ident1 ident2}
+Rename number register @var{ident1} to @var{ident2}. If either
+@var{ident1} or @var{ident2} doesn't exist, the request is ignored.
+@end_Deffn
-@findex aln
-Aliases can be created for a number register. The format is
-@samp{.aln @var{xx} @var{yy}}, which will create an alias @var{xx} for
-number register object named @var{yy}. The new name and the old name
-will be exactly equivalent. If @var{yy} is undefined, a warning of
-type @samp{reg} will be generated, and the request will be ignored.
-@xref{Debugging}, for information about warnings.
+@Deffn{Request, aln, ident1 ident2}
+This request creates an alias @var{ident1} for a number register
+@var{ident2}. The new name and the old name will be exactly equivalent.
+If @var{ident1} is undefined, a warning of type @samp{reg} will be
+generated, and the request will be ignored. @xref{Debugging}, for
+information about warnings.
+@end_Deffn
+@c ---------------------------------------------------------------------
@node Interpolating Registers, Auto-increment, Setting Registers, Registers
@subsection Interpolating Registers
@cindex interpolating registers
@cindex registers, interpolating
+Numeric registers can be accessed via the @code{\n} escape.
-@findex \n
-Numeric registers are @dfn{interpolated} via the @code{\n} escape.
-@c the following is wrong. Should I say any more than the above??
-@c This means that the value of the number register in expanded in-place
-@c on the input line before any other actions, i.e. before requests and
-@c escapes are interpreted.
+@Deffn{Escape, \\n, ident}
+@c XXX is the following correct?
+Interpolate number register @var{ident}. This means that the value of
+the register is expanded in-place while @code{gtroff} is parsing the
+input line.
@example
+.nr a 5
.nr as \na+\na
\n(as
+ @result{} 10
@end example
+@end_Deffn
+@c ---------------------------------------------------------------------
@node Auto-increment, Assigning Formats, Interpolating Registers, Registers
@subsection Auto-increment
@cindex auto-increment
@cindex increment, automatic
-Number registers can also be auto incremented/decremented. You can
-specify the increment/decrement factor with third argument to the
-@code{nr} request. The default value is 0. For example:
+Number registers can also be auto-incremented and auto-decremented. The
+increment resp.@: decrement factor can be specified with a third
+argument to the @code{nr} request or @code{\R} escape.
+
+@findex \R
+@Deffn{Request, nr, ident value incr}
+Set number register @var{ident} to @var{value}; the increment for
+auto-incrementing is set to @var{incr}. Note that the @code{\R} escape
+doesn't support this notation.
+@end_Deffn
+
+To activate auto-incrementing, the escape @code{\n} has a special syntax
+form.
+
+@Deffn{Escape, \\n, +ident}
+@Deffnx{Escape, \\n, -ident}
+Before interpolating, increment resp.@: decrement @var{ident} by the
+auto-increment value as specified with the @code{nr} request (or the
+@code{\R} escape). If no auto-increment value has been specified, both
+syntax forms are identical to @code{\n}.
+@end_Deffn
+
+For example,
@example
.nr a 0 1
.nr xx 0 5
+.nr foo 0 -2
\n+a, \n+a, \n+a, \n+a, \n+a
.br
-\n+(xx, \n+(xx, \n+(xx, \n+(xx, \n+(xx
+\n-(xx, \n-(xx, \n-(xx, \n-(xx, \n-(xx
+.br
+\n+[foo], \n+[foo], \n+[foo], \n+[foo], \n+[foo]
@end example
-Produces:
+@noindent
+produces
@example
1, 2, 3, 4, 5
-5, 10, 15, 20, 25
+-5, -10, -15, -20, -25
+-2, -4, -6, -8, -10
@end example
-If you want to change the increment factor without changing the value
-of a register, the following can be used.
+@cindex increment value without changing the register
+To change the increment value without changing the value of a register,
+the following can be used:
@example
.nr a \na 10
@end example
+@c ---------------------------------------------------------------------
-@node Assigning Formats, Builtin Registers, Auto-increment, Registers
+@node Assigning Formats, Built-in Registers, Auto-increment, Registers
@subsection Assigning Formats
@cindex assigning formats
@cindex formats, assigning
+When a register is used in the text of an input file (as opposed to part
+of an expression), it is textually replaced (or interpolated) with a
+representation of that number. This output format can be changed to a
+variety of formats (numbers, Roman numerals, etc.). This is done using
+the @code{af} request.
-@findex af
-When a register is used in the text of an input file
-(as opposed to part of an expression)
-it is textually replaced (or interpolated) with a representation of
-that number.
-This output format can be changed to a variety of formats
-(numbers, roman numerals, etc)
-This is done using the @code{af} request.
-The first argument to @code{af} is the name of the number register to
-be changed,
-and the second argument is the output format.
-The following output formats are available:
+@Deffn{Request, af, ident format}
+Change the output format of a number register. The first argument
+@var{ident} is the name of the number register to be changed, and the
+second argument @var{format} is the output format. The following output
+formats are available:
-@table @samp
+@table @code
@item 1
-This is the default format, decimal numbers:
-1, 2, 3, @dots{}
-@item 001
-Decimal numbers with as many leading zeros as specified.
-So, @samp{001} would result in 001, 002, 003, @dots{}
+Decimal arabic numbers. This is the default format: 1, 2, 3,@w{
+}@enddots{}
+
+@item 0@dots{}0
+Decimal numbers with as many digits as specified. So, @samp{00} would
+result in printing numbers as 01, 02, 03,@w{ }@enddots{}
+
+In fact, any digit instead of zero will do; @code{gtroff} only counts
+how many digits are specified. As a consequence, @code{af}'s default
+format @samp{1} could be specified as @samp{0} also (and exactly this is
+returned by the @code{\g} escape, see below).
+
@item I
@cindex roman numerals
-@cindex numerals, roman
-Upper-case roman numerals:
-0, I, II, III, IV, @dots{}
+@cindex numerals, Roman
+Upper-case Roman numerals: 0, I, II, III, IV,@w{ }@enddots{}
+
@item i
-Lower-case roman numerals:
-0, i, ii, iii, iv, @dots{}
+Lower-case Roman numerals: 0, i, ii, iii, iv,@w{ }@enddots{}
+
@item A
-Upper-case letters:
-A, B, C, @dots{}, Z, AA, AB, @dots{}
+Upper-case letters: A, B, C, @dots{},@w{ }Z, AA, AB,@w{ }@enddots{}
+
@item a
-Lower-case letters:
-a, b, c, @dots{}, z, aa, ab, @dots{}
+Lower-case letters: a, b, c, @dots{},@w{ }z, aa, ab,@w{ }@enddots{}
@end table
-The following example will produce @samp{10, X, j, 010}.
+Omitting the number register format will cause a warning of type
+@samp{missing}. @xref{Debugging}, for more details. Specifying a
+nonexistent format causes an error.
+
+The following example will produce @samp{10, X, j, 010}:
@example
.nr a 10
@@ -2260,137 +3550,288 @@ The following example will produce @samp{10, X, j, 010}.
\na
@end example
-@findex \g
-The @code{\g} escape returns the current format of the specified
-register. For example, @samp{\ga} after the following example would
-produce @samp{001}.
-
-
-
-@node Builtin Registers, , Assigning Formats, Registers
-@subsection Builtin Registers
-@cindex builtin registers
-@cindex registers, builtin
-
-
-The following are some builtin registers, which are not listed
-elsewhere in this manual. Any registers which begin with a @samp{.}
-are read-only. A compleat listing of all builtin registers can be
-found in @ref{Register Index}.
+@cindex roman numerals, maximum and minimum
+@cindex maximum values of Roman numerals
+@cindex minimum values of Roman numerals
+The largest number representable for the @samp{i} and @samp{I} formats
+is 39999 (resp.@: -39999); @acronym{UNIX} @code{troff} uses @samp{z} and
+@samp{w} to represent 10000 and 5000 in Roman numerals, and so does
+@code{gtroff}. Currently, the correct glyphs of Roman numeral five
+thousand and Roman numeral ten thousand (Unicode code points
+@code{U+2182} and @code{U+2181}, respectively) are not available.
+
+If @var{ident} doesn't exist, it will be created.
+
+@cindex read-only register, changing format
+@cindex changing format, read-only register
+Changing the output format of a read-only register causes an error. It
+is necessary to first copy the register's value to a writeable register,
+then apply the @code{af} request to this other register.
+@end_Deffn
+
+@cindex format of register
+@cindex register, format
+@Deffn{Escape, \\g, ident}
+Return the current format of the specified register @var{ident}. For
+example, @samp{\ga} after the previous example would produce the string
+@samp{000}. If the register hasn't been defined yet, nothing is
+returned.
+@end_Deffn
+
+@c ---------------------------------------------------------------------
+
+@node Built-in Registers, , Assigning Formats, Registers
+@subsection Built-in Registers
+@cindex built-in registers
+@cindex registers, built-in
+
+The following lists some built-in registers which are not described
+elsewhere in this manual. Any register which begins with a @samp{.} is
+read-only. A complete listing of all built-in registers can be found in
+@ref{Register Index}.
@table @code
@item .H
+@cindex horizontal resolution register
+@cindex resolution, horizontal, register
@vindex .H
Horizontal resolution in basic units.
+
@item .V
+@cindex vertical resolution register
+@cindex resolution, vertical, register
@vindex .V
Vertical resolution in basic units.
+
@item dw
+@cindex day of the week register
+@cindex date, day of the week register
@vindex dw
Day of the week (1-7).
+
@item dy
+@cindex day of the month register
+@cindex date, day of the month register
@vindex dy
-Day of the year (1-31).
+Day of the month (1-31).
+
@item mo
+@cindex month of the year register
+@cindex date, month of the year register
@vindex mo
Current month (1-12).
+
+@item year
+@cindex date, year register
+@cindex year, current, register
+@vindex year
+The current year.
+
@item yr
@vindex yr
-Last two digits of the current year (see you in 7 years :-)
+The current year minus@w{ }1900. Unfortunately, the documentation of
+@acronym{UNIX} Version@w{ }7's @code{troff} had a year@w{ }2000 bug: It
+incorrectly claimed that @code{yr} contains the last two digits of the
+year. That claim has never been true of either traditional @code{troff}
+or GNU @code{troff}. Old @code{troff} input that looks like this:
+
+@example
+'\" The following line stopped working after 1999
+This document was formatted in 19\n(yr.
+@end example
+
+@noindent
+can be corrected as follows:
+
+@example
+This document was formatted in \n[year].
+@end example
+
+@noindent
+or, to be portable to older @code{troff} versions, as follows:
+
+@example
+.nr y4 1900+\n(yr
+This document was formatted in \n(y4.
+@end example
+
@item .c
@vindex .c
@itemx c.
@vindex c.
-The current @emph{input} line number.
+@cindex input line number register
+@cindex line number, input, register
+The current @emph{input} line number. Register @samp{.c} is read-only,
+whereas @samp{c.} (a @code{gtroff} extension) is writable also,
+affecting both @samp{.c} and @samp{c.}.
+
@item ln
@vindex ln
-The current @emph{output} line number.
+@findex nm
+@cindex output line number register
+@cindex line number, output, register
+The current @emph{output} line number after a call to the @code{nm}
+request to activate line numbering.
+
+@c XXX xref nm request
+
@item .x
@vindex .x
-The major version number. For example, if the version number is 1.03
-then @code{.x} will contain 1.
+@cindex major version number register
+@cindex version number, major, register
+The major version number. For example, if the version number is@w{
+}1.03 then @code{.x} will contain@w{ }@samp{1}.
+
@item .y
@vindex .y
-The minor version number. For example, if the version number is 1.03
-then @code{.y} will contain 03.
+@cindex minor version number register
+@cindex version number, minor, register
+The minor version number. For example, if the version number is@w{
+}1.03 then @code{.y} will contain@w{ }@samp{03}.
+
+@item .Y
+@vindex .Y
+@cindex revision number register
+The revision number of @code{groff}.
+
@item .g
@vindex .g
-Always 1.
-Macros should use this to determine whether they are running
-under GNU troff.
+@cindex @code{gtroff} identification register
+@cindex GNU-specific register
+Always@w{ }1. Macros should use this to determine whether they are
+running under GNU @code{troff}.
+
@item .A
@vindex .A
-If the current output device is ascii, this is set to 1,
-zero otherwise.
+@cindex @acronym{ASCII} approximation output register
+If the command line option @option{-a} is used to produce an
+@acronym{ASCII} approximation of the output, this is set to@w{ }1, zero
+otherwise. @xref{Groff Options}.
+
@item .P
@vindex .P
-This register indicates whether the current page is actualy being
-printed, i.e. if the @samp{-o} option is being used to only print
-selected pages.
-@xref{Options}, for more information.
+This register is set to@w{ }1 (and to@w{ }0 otherwise) if the current
+page is actually being printed, i.e., if the @option{-o} option is being
+used to only print selected pages. @xref{Groff Options}, for more
+information.
+
+@item .T
+@vindex .T
+If @code{gtroff} is called with the @option{-T} command line option, the
+number register @code{.T} is set to@w{ }1, and zero otherwise.
+@xref{Groff Options}.
+
+@maindex \*(.T
+@cindex output device register
+Additionally, @code{gtroff} predefines a single (read/write) string
+register @code{.T} which contains the current output device (for
+example, @samp{latin1} or @samp{ps}).
@end table
+
+@c =====================================================================
+
@node Manipulating Filling and Adjusting, Manipulating Hyphenation, Registers, Programming Tutorial
@section Manipulating Filling and Adjusting
@cindex manipulating filling and adjusting
@cindex filling and adjusting, manipulating
@cindex adjusting and filling, manipulating
+@cindex justifying text
+@cindex text, justifying
-
-@findex br
@cindex break
@cindex line break
-Several ways of causing @dfn{breaks} were given in
-@ref{Implicit Line Breaks}.
-The @code{br} request will likewise cause a break.
-Several other requests will also cause breaks, implicitly.
-They are
-@code{bp},
-@code{ce},
-@code{fi},
-@code{fl},
-@code{in},
-@code{nf},
-@code{sp} and
-@code{ti}.
-
-@findex nf
+@findex bp
+@findex ce
+@findex cf
@findex fi
+@findex fl
+@findex in
+@findex nf
+@findex rj
+@findex sp
+@findex ti
+@findex trf
+Various ways of causing @dfn{breaks} were given in @ref{Implicit Line
+Breaks}. The @code{br} request will likewise cause a break. Several
+other requests will also cause breaks, but implicitly. These are
+@code{bp}, @code{ce}, @code{cf}, @code{fi}, @code{fl}, @code{in},
+@code{nf}, @code{rj}, @code{sp}, @code{ti}, and @code{trf}.
+
+@Deffn{Request, br, }
+Break the current line, i.e., the input collected so far will be emitted
+without adjustment.
+
+If the no-break control character is used, no break will happen:
+
+@example
+a
+'br
+b
+ @result{} a b
+@end example
+@end_Deffn
+
+Initially, @code{gtroff} will fill and adjust text to both margins.
+Filling can be disabled via the @code{nf} request and re-enabled with
+the @code{fi} request.
+
+@cindex fill mode
+@cindex mode, fill
@vindex .u
-Initially, groff will fill and ajust text to both margins.
-Filling can be disabled via the @code{nf} request
-and re-enabled with the @code{fi} request.
-These implicitly disable and re-enable adjusting.
-Both of these will cause break in text currently being filled.
-The number register @code{.u} is equal to 1 in fill mode and 0 in
-no-fill mode.
+@Deffn{Request, fi, }
+Activate fill mode (which is the default). This request implicitly
+enables adjusting; it will also cause a break in the text currently
+being filled. The number register @code{.u} is set to@w{ }1.
-@findex ad
-@findex na
-@vindex .j
-Adjusting can be disabled with the @code{ad} request and re-enabled
-with the @code{na} request.
-The @code{ad} request takes a single argument to indicate how to
-adjust text.
-The current adjustment mode is available in the number register
-@code{.j}.
+The fill mode status is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
-@table @samp
+@cindex no-fill mode
+@cindex mode, no-fill
+@Deffn{Request, nf, }
+Activate no-fill mode. Input lines are output as-is, retaining line
+breaks. The current line length will be ignored. This command
+implicitly disables adjusting; it also causes a break. The number
+register @code{.u} will be set to@w{ }0.
+
+The fill mode status is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@Deffn{Request, ad, [@var{mode}]}
+Set adjusting mode.
+
+Activation and deactivation of adjusting will be implicitly done with
+calls to the @code{fi} resp.@: @code{nf} requests.
+
+@var{mode} can have one of the following values:
+
+@table @code
@item l
@cindex ragged-right
Adjust text to the left margin. This produces what is traditionally
called ragged-right text.
+
@item r
-Adjust text to the right margin.
+@cindex ragged-left
+Adjust text to the right margin, producing ragged-left text.
+
@item c
-Center filled text.
+@cindex centered text
+@findex ce
+Center filled text. This is different to the @code{ce} request which
+only centers text without filling.
+
@item b
@itemx n
-Justify to both margins. This is groff's default.
+Justify to both margins. This is the default used by @code{gtroff}.
@end table
-With no argument to @code{ad}, troff will adjust lines the same way
-it was the last time it was filling. For example:
+With no argument, @code{gtroff} will adjust lines in the same way it did
+before adjusting has been deactivated (with a call to @code{na}, for
+example).
@example
text
@@ -2404,52 +3845,108 @@ text
text
@end example
-@findex \p
-The escape @code{\p} will cause a break and cause the remaining text
-to be adjusted.
-
-@findex ss
-The @code{ss} request allows you to change the minimum size of a
-space between filled words.
-This request takes it's units as one twelfth of the
-spacewidth parameter for the current font. Initially both the word
-space size and the sentence space size are 12.
-
-When two arguments are given to the @code{ss} request, the second argument
-gives the sentence space size. If the second argument is not given, the
-sentence space size will be the same as the word space size.
-The sentence space size
-is used in two circumstances: if the end of a sentence occurs at the end
-of a line in fill mode, then both an inter-word space and a sentence
-space will be added; if two spaces follow the end of a sentence in the
-middle of a line, then the second space will be a sentence space. Note
-that the behaviour of @sc{Unix} troff will be exactly that exhibited by GNU
-troff if a second argument is never given to the @code{ss} request. In GNU
-troff, as in @sc{Unix} troff, you should always follow a sentence with either
-a newline or two spaces.
+@vindex .j
+@cindex current adjustment mode register
+The current adjustment mode is available in the number register
+@code{.j}; it can be stored and subsequently used to set adjustment.
+
+The adjustment mode status is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@Deffn{Request, na, }
+Disable adjusting. This request won't change the current adjustment
+mode: A call to @code{ad} afterwards will use the previous adjustment
+setting.
+
+The adjustment mode status is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@Deffn{Escape, \\p, }
+Adjust the current line and cause a break.
+
+In most cases this will produce very ugly results, since @code{gtroff}
+doesn't have a sophisticated paragraph building algorithm (as @TeX{}
+does, for example); instead, @code{gtroff} fills and adjusts a paragraph
+line by line:
+
+@example
+ This is an uninteresting sentence.
+ This is an uninteresting sentence.\p
+ This is an uninteresting sentence.
+@end example
+
+is formatted as
+
+@example
+ This is an uninteresting sentence. This is an
+ uninteresting sentence.
+ This is an uninteresting sentence.
+@end example
+@end_Deffn
+
+@cindex word space size
+@cindex size of word space
+@cindex space between words
+@cindex sentence space size
+@cindex size of sentence space
+@cindex space between sentences
+@Deffn{Request, ss, word_space_size [@var{sentence_space_size}]}
+Change the minimum size of a space between filled words. It takes its
+units as one twelfth of the space width parameter for the current font.
+Initially both the @var{word_space_size} and @var{sentence_space_size}
+are@w{ }12.
+
+@cindex fill mode
+@cindex mode, fill
+If two arguments are given to the @code{ss} request, the second argument
+sets the sentence space size. If the second argument is not given,
+sentence space size will be set to @var{word_space_size}. The sentence
+space size is used in two circumstances: if the end of a sentence occurs
+at the end of a line in fill mode, then both an inter-word space and a
+sentence space will be added; if two spaces follow the end of a sentence
+in the middle of a line, then the second space will be a sentence space.
+Note that the behaviour of @acronym{UNIX} @code{troff} will be exactly
+that exhibited by GNU @code{troff} if a second argument is never given
+to the @code{ss} request. In GNU @code{troff}, as in @acronym{UNIX}
+@code{troff}, a sentence should always be followed by either a newline
+or two spaces.
@vindex .ss
@vindex .sss
-The number registers @code{.ss} and @code{.sss} are
-the values of the parameters set by the first and second
-arguments of the @code{ss} request.
+The number registers @code{.ss} and @code{.sss} hold the values of the
+parameters set by the first and second arguments of the @code{ss}
+request.
-@findex ce
-The @code{ce} request will center text.
-While the @samp{ad c} request will also center text, it has the side
-effect of filling the text. The @code{.ce} request will not fill the
-text it affects.
-This request causes a break.
+The word space and sentence space values are associated with the current
+environment (@pxref{Environments}).
+
+This request is ignored in nroff mode; it is also ignored if there is no
+parameter.
+@end_Deffn
-With no arguments, @code{ce} will fill the next line of text.
-The single argument @code{ce} takes is a number indicating the
-number of lines to be centered. With no argument centering is
-disabled.
+@cindex centering lines
+@cindex lines, centering
+@Deffn{Request, ce, [@var{nnn}]}
+Center text. While the @w{@samp{.ad c}} request will also center text,
+it has the side effect of filling the text. @code{ce} will not fill the
+text it affects. This request causes a break.
+
+With no arguments, @code{ce} will center the next line of text.
+@var{nnn} specifies the number of lines to be centered. If
+the argument is zero or negative, centering is disabled.
+
+@findex ll
+@findex in
+@findex ti
+The basic length for centering text is the line length (as set with the
+@code{ll} request) minus the indentation (as set with the @code{in}
+request). Temporary indentation is ignored.
-A common idiom is to turn on centering for a large number of lines,
-and then turn off centering when you are done with the centered text.
-This is useful for any request which takes a number of lines as an
-argument.
+A common idiom is to turn on centering for a large number of lines, and
+to turn off centering after text to be centered. This is useful for any
+request which takes a number of lines as an argument.
@example
.ce 1000
@@ -2462,362 +3959,831 @@ more interesting
@end example
@vindex .ce
-The @code{.ce} number register contains the number of lines remaining
-to be centered, as set by the @code{ce} request.
+The @code{.ce} number register contains the number of lines remaining to
+be centered, as set by the @code{ce} request.
+@end_Deffn
-
-@findex rj
+@cindex justifying text
+@cindex text, justifying
+@cindex right-justifying
@vindex .rj
-A similar request is @code{rj} request which will justify unfilled
-text to the right margin. Its arguments are identical to the
-@code{ce} request.
-The @code{.rj} number register is
-the number of lines to be right-justified as set by the @code{rj}
-request.
+@Deffn{Request, rj, [@var{nnn}]}
+Justify unfilled text to the right margin. Arguments are identical to
+the @code{ce} request. The @code{.rj} number register is the number of
+lines to be right-justified as set by the @code{rj} request. This
+request causes a line break.
+@end_Deffn
+@c =====================================================================
@node Manipulating Hyphenation, Manipulating Spacing, Manipulating Filling and Adjusting, Programming Tutorial
@section Manipulating Hyphenation
@cindex manipulating hyphenation
@cindex hyphenation, manipulating
+As discussed in @ref{Hyphenation}, @code{gtroff} will hyphenate words.
+There are a number of ways to influence hyphenation.
-As discussed in @ref{Hyphenation}, groff will hyphenate words.
-There are a number of ways to modify the how hyphenation is done.
+@Deffn{Request, hy, [@var{mode}]}
+Enable hyphenation. The request has an optional numeric argument,
+@var{mode}, to restrict hyphenation if necessary:
-@findex nh
-@findex hy
-@vindex .hy
-This hyphenation can be turned off with the @code{nh} request, and
-turned back on with the @code{hy} request. However, troff's
-hyphenation facilities are far more flexible than this. The @code{hy}
-request can be used to tell troff to restrict hypenation to certain
-cases. The request takes a single numeric argument.
-The current hyphenation restrictions can be found in the number
-register @code{.hy}
-
-@table @samp
+@table @code
@item 1
-The default argument, which
-indicates to hyphenate without restrictions.
+The default argument if @var{mode} is omitted. Hyphenate without
+restrictions. This is also the start-up value of @code{gtroff}.
+
@item 2
Do not hyphenate the last word on a page or column.
+
@item 4
Do not hyphenate the last two characters of a word.
+
@item 8
Do not hyphenate the first two characters of a word.
@end table
-@findex hlm
+Values in the previous table are additive. For example, the value@w{
+}12 causes @code{gtroff} to neither hyphenate the last two nor the first
+two characters of a word.
+
+@vindex .hy
+@cindex hyphenation restrictions register
+The current hyphenation restrictions can be found in the number register
+@samp{.hy}.
+
+The hyphenation mode is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@Deffn{Request, nh, }
+Disable hyphenation (i.e., set the hyphenation mode to zero). Note that
+the hyphenation mode of the last call to @code{hy} is not remembered.
+
+The hyphenation mode is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
@vindex .hlc
@vindex .hlm
-The @code{hlm} request will
-set the maximum number of consecutive hyphenated lines to the value
-given as the first argument.
-If this number is
-negative, there is no maximum. The default value is -1.
-This value is
-associated with the current environment. Only lines output from an
+@findex \%
+@cindex explicit hyphens
+@cindex hyphen, explicit
+@cindex consecutive hyphenated lines
+@cindex lines, consecutive hyphenated
+@cindex hyphenated lines, consecutive
+@Deffn{Request, hlm, [@var{nnn}]}
+Set the maximum number of consecutive hyphenated lines to @var{nnn}. If
+this number is negative, there is no maximum. The default value is@w{
+}-1 if @var{nnn} is omitted. This value is associated with the current
+environment (@pxref{Environments}). Only lines output from a given
environment count towards the maximum associated with that environment.
Hyphens resulting from @code{\%} are counted; explicit hyphens are not.
-The current setting of this is available in the @code{.hlm} request.
-Also the number of immediately preceding consecutive hyphenated lines
-are available in the number register @code{.hlc}.
-@findex hw
-The @code{hw} request allows you to specify how a specific word is
-to be hyphenated. It takes only one argument which is the word with
-hyphens at the hyphenation points. For example:
-@samp{.hw in-sa-lub-rious}.
-@c In old versions of troff there was a
-@c limited amount of space to store such information, fortunately,
-@c with groff, this is no longer a restriction.
+The current setting of @code{hlm} is available in the @code{.hlm}
+register. Also the number of immediately preceding consecutive
+hyphenated lines are available in the number register @samp{.hlc}.
+@end_Deffn
-@findex \%
-@cindex hyphenation character
-@cindex character, hyphenation
-You can also tell troff how to hyphenate words on the fly with the
-use of the @code{\%} escape, also known as the @dfn{hyphenation
-character}. Preceding a word with this character will prevent it
-from being hyphenated, putting it in a word will indicate to troff
-that the word may be hyphenated at that point. Note that this
-mechanism will only affect one word, if you want to change the
-hyphenation of a word for the entire document, use the @code{hw}
-request.
+@Deffn{Request, hw, word1 word2 @dots{}}
+Define how @var{word1}, @var{word2}, etc.@: are to be hyphenated. The
+words must be given with hyphens at the hyphenation points. For
+example:
-@findex hc
-The @code{hc} request allows you to change the hyphenation character.
-The character specified as an argument will then work the same as the
-@code{\%} escape, and, thus, no longer appear in the output. Without
-an argument it will return the hyphenation character to @code{\%}.
+@example
+.hw in-sa-lub-rious
+@end example
-@findex hpf
-To further customize hyphenation the @code{hpf} request will read in
-a file of hyphenation patterns.
-This file will be searched for in the
-same way that @file{tmac.@var{name}} is searched for when the
-@samp{-m@var{name}} option is specified.
-
-It should have the same format as the argument to the
-\patterns primitive in @TeX{}; the letters appearing in this file are
-interpreted as hyphenation codes.
-A @samp{%} character in the patterns file
-introduces a comment that continues to the end of the line.
+@noindent
+Besides the space character, any character whose hyphenation code value
+is zero can be used to separate the arguments of @code{hw} (see the
+documentation for the @code{hcode} request below for more information).
+In addition, this request can be used more than once.
+
+Hyphenation exceptions specified with the @code{hw} request are
+associated with the current hyphenation language; it will cause an error
+if there is no current hyphenation language.
+
+This request is ignored if there is no parameter.
+
+In old versions of @code{troff} there was a limited amount of space to
+store such information; fortunately, with @code{gtroff}, this is no
+longer a restriction.
+@end_Deffn
+
+@cindex hyphenation character
+@cindex character, hyphenation
+@cindex disabling hyphenation
+@cindex hyphenation, disabling
+@Deffn{Escape, \\%, }
+To tell @code{gtroff} how to hyphenate words on the fly, the @code{\%}
+escape, also known as the @dfn{hyphenation character}, can be used.
+Preceding a word with this character will prevent it from being
+hyphenated, putting it in a word will indicate to @code{gtroff} that the
+word may be hyphenated at that point. Note that this mechanism will
+only affect that one occurrence of the word; to change the hyphenation
+of a word for the entire document, use the @code{hw} request.
+@end_Deffn
+
+@Deffn{Request, hc, [@var{char}]}
+Change the hyphenation character to @var{char}. This character will
+then work the same as the @code{\%} escape, and thus, no longer appear
+in the output. Without an argument, @code{hc} will reset the
+hyphenation character to be @code{\%} (the default) only.
+
+The hyphenation character is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@cindex hyphenation patterns
+@cindex patterns for hyphenation
+@Deffn{Request, hpf, pattern_file}
+Read in a file of hyphenation patterns. This file will be searched for
+in the same way as @file{tmac.@var{name}} is searched for if the
+@option{-m@var{name}} option is specified.
+
+It should have the same format as the argument to the @code{\patterns}
+primitive in @TeX{} (without using @TeX{}'s macro expansion); the
+letters appearing in this file are interpreted as hyphenation codes. A
+@samp{%} character in the patterns file introduces a comment that
+continues to the end of the line.
+
+If no @code{hpf} request is specified (either in the document or in a
+macro package), @code{gtroff} won't hyphenate at all.
@findex hla
-@findex hpf
@pindex troffrc
-The set of
-hyphenation patterns is associated with the current language set by the
-@code{hla} request. The @code{hpf} request is usually invoked by the
-@file{troffrc} file.
+@pindex troffrc-end
+@pindex hyphen.us
+The set of hyphenation patterns is associated with the current language
+set by the @code{hla} request. The @code{hpf} request is usually
+invoked by the @file{troffrc} or @file{troffrc-end} file; by default,
+@file{troffrc} loads hyphenation patterns for American English (in file
+@file{hyphen.us}).
+
+@code{hpf} will cause an error if there is no current hyphenation
+language.
+@end_Deffn
+
+@cindex hyphenation code
+@cindex code, hyphenation
+@Deffn{Request, hcode, c1 code1 c2 code2 @dots{}}
+Sets the hyphenation code of character @var{c1} to @var{code1}, that of
+@var{c2} to @var{code2}, etc. A hyphenation code must be a single input
+character (not a special character) other than a digit or a space.
+Initially each lower-case letter (@samp{a}-@samp{z}) has its hyphenation
+set to itself, and each upper-case letter (@samp{A}-@samp{Z}) has a
+hyphenation code which is the lower-case version of itself.
+
+This request will be ignored if it has no parameter.
+@end_Deffn
+
+@cindex hyphenation margin
+@cindex margin for hyphenation
+@findex ad
+@Deffn{Request, hym, [@var{length}]}
+Set the (right) hyphenation margin to @var{length}. If the current
+adjustment mode is not@w{ }@samp{b}, the line will not be hyphenated if
+it is shorter than @var{length}. Without argument, the hyphenation
+margin will be reset to its default value, which is@w{ }0. The default
+scaling indicator for this request is@w{ }@code{m}. The hyphenation
+margin is associated with the current environment
+(@pxref{Environments}).
+
+A negative argument will reset the hyphenation margin to zero, emitting
+a warning of type @samp{range}.
-@findex hcode
-@code{.hcode @var{c1 code1 c2 code2...}}
-Set the hyphenation code of character @var{c1} to code1 and that of
-@var{c2} to @var{code2}.
-A hyphenation code must be a single input character (not a
-special character) other than a digit or a space. Initially each
-lower-case letter has a hyphenation code, which is itself, and each
-upper-case letter has a hyphenation code which is the lower case
-version of itself.
-
-@findex hym
@vindex .hym
-The @code{hym} request will set the hyphenation margin to the value
-given as the first argument: when the current adjustment mode is not
-@samp{b}, the line will not be hyphenated if the line is no more than
-that amount short.
-The default hyphenation margin is 0. The default scaling
-indicator for this request is m. The hyphenation margin is associated
-with the current environment. The current hyphenation margin is
-available in the @code{.hym} register.
-
-@findex hys
+@cindex current hyphenation margin register
+The current hyphenation margin is available in the @code{.hym} register.
+@end_Deffn
+
+@cindex hyphenation space
+@findex ad
+@Deffn{Request, hys, [@var{hyphenation_space}]}
+Set the hyphenation space to @var{hyphenation_space}. If the current
+adjustment mode is@w{ }@samp{b}, don't hyphenate the line if it
+can be justified by adding no more than @var{hyphenation_space} extra
+space to each word space. Without argument, the hyphenation space is
+set to its default value, which is@w{ }0. The default scaling indicator
+for this request is@w{ }@code{m}. The hyphenation space is associated
+with the current environment (@pxref{Environments}).
+
+A negative argument will reset the hyphenation space to zero, emitting a
+warning of type @samp{range}.
+
@vindex .hys
-The @code{hys} request set the hyphenation space to the value given as
-the first argument: when the current adjustment mode is b, don't
-hyphenate the line if the line can be justified by adding no more than
-that amount of extra space to each word space. The default
-hyphenation space is 0. The default scaling indicator for this
-request is m. The hyphenation space is associated with the current
-environment. The current hyphenation space is available in the
-@code{.hys} register.
+@cindex current hyphenation space register
+The current hyphenation space is available in the @code{.hys} register.
+@end_Deffn
-@findex shc
-The @code{shc} request will set the soft hyphen character to the
-argument given as an argument. If the argument is omitted, the soft
-hyphen character will be set to the default @code{\(hy}. The soft
-hyphen character is the character which will be inserted when a word
-is hyphenated at a line break. If the soft hyphen character does not
-exist in the font of the character immediately preceding a potential
+@cindex soft hyphen character
+@cindex character, soft hyphen
+@glindex hy
+@findex char
+@findex tr
+@Deffn{Request, shc, [@var{char}]}
+Set the soft hyphen character to @var{char}. If the argument is
+omitted, the soft hyphen character will be set to the default character
+@code{\(hy} (this is the start-up value of @code{gtroff} also). The
+soft hyphen character is the character which will be inserted when a
+word is hyphenated at a line break. If the soft hyphen character does
+not exist in the font of the character immediately preceding a potential
break point, then the line will not be broken at that point. Neither
definitions (specified with the @code{char} request) nor translations
-(specified with the @code{tr} request) are considered when finding the soft
-hyphen character.
+(specified with the @code{tr} request) are considered when finding the
+soft hyphen character.
+@end_Deffn
-@findex hla
-@vindex .hla
+@findex hpf
+@findex hw
@pindex troffrc
-The @code{hla} request will set the current hyphenation language to
-that given by the first argument. Hyphenation exceptions specified
-with the @code{hw} request and hyphenation patterns specified with the
-@code{hpf} request are both associated with the current hyphenation
-language. The @code{hla} request is usually invoked by the
-@file{troffrc} file. The current hyphenation language is available
-in the number register @code{.hla}.
+@pindex troffrc-end
+@Deffn{Request, hla, language}
+Set the current hyphenation language to the string @var{language}.
+Hyphenation exceptions specified with the @code{hw} request and
+hyphenation patterns specified with the @code{hpf} request are both
+associated with the current hyphenation language. The @code{hla}
+request is usually invoked by the @file{troffrc} or the
+@file{troffrc-end} files; @file{troffrc} sets the default language to
+@samp{us}.
+
+@vindex .hla
+@cindex current hyphenation language register
+The current hyphenation language is available as a string in the
+read-only number register @samp{.hla}.
+
+@example
+.ds curr_language \n[.hla]
+\*[curr_language]
+ @result{} us
+@end example
+@end_Deffn
+@c =====================================================================
@node Manipulating Spacing, Tabs and Fields, Manipulating Hyphenation, Programming Tutorial
@section Manipulating Spacing
@cindex manipulating spacing
@cindex spacing, manipulating
+@Deffn{Request, sp, [@var{distance}]}
+Space downwards @var{distance}. With no argument it will advance 1@w{
+}line. A negative argument will cause @code{gtroff} to move up the page
+the specified distance. If the argument is preceded by a @samp{|}
+@code{gtroff} will move that distance from the top of the page. This
+request causes a line break. The default scaling indicator is@w{
+}@code{v}.
+@end_Deffn
+
+@cindex double-spacing
+@Deffn{Request, ls, [@var{nnn}]}
+Output @w{@var{nnn}-1} blank lines after each line of text. With no
+argument @code{gtroff} will use the previous value before the last
+@code{ls} call.
-@findex sp
-The @code{sp} request will cause troff to space downwards the
-distance specified as the first argument. With no argument it will
-advance 1 line.
-A negative argument will cause troff to move up the page the
-specified distance.
-If the argument is preceded by a @samp{|} troff will move that
-distance from the top of the page.
+@example
+.ls 2 \" This causes double-spaced output
+.ls 3 \" This causes triple-spaced output
+.ls \" Again double spaced
+@end example
+
+The line spacing is associated with the current environment
+(@pxref{Environments}).
-@findex ls
@vindex .L
-Often you may want your output to be double or triple spaced.
-The @code{ls} request will cause troff to output @var{n}-1 blank
-lines after each line of text, where @var{n} is the argument given to
-the @code{ls} request. With no argument troff will go back to single
-spacing. The number register @code{.L} contains the current line
-spacing setting.
+@cindex current line spacing register
+The number register @code{.L} contains the current line spacing setting.
+@end_Deffn
+
+@Deffn{Escape, \\x, spacing}
+Sometimes, extra vertical spacing is only needed occasionally, e.g.@: to
+allow space for a tall construct (like an equation). The @code{\x}
+escape will do this. The escape is given a numerical argument, usually
+enclosed in quotes (like @samp{\x'3p'}); the default scaling indicator
+is@w{ }@code{v}. If this number is positive extra vertical space will
+be inserted below the current line. A negative number will add space
+above. If this escape is used multiple times on the same line, the
+maximum of the values is used.
+
+@xref{Escapes}, for details on parameter delimiting characters.
-@findex \x
@vindex .a
-Sometimes, extra vertical spacing is only needed occasionaly,
-i.e. to allow space for a tall construct (like an equation).
-The @code{\x} escape will do this.
-The escape is given a numerical argument (like @samp{\x'3p'}).
-If this number is positive extra vertical space will be inserted
-below the current line. A negative number will add space above.
-If this escape is used multiple times on the same line, the maximum
-values are used.
-The @code{.a} number register contains the most recent
-extra vertical @strong{emph} line space.
+@cindex extra vertical line space register
+The @code{.a} number register contains the most recent (nonnegative)
+extra vertical line space.
+@c XXX
+@ignore
@example
... example of inline equation ...
@end example
+@end ignore
+@end_Deffn
-@findex ns
-@findex rs
+@findex sp
@cindex no-space mode
@cindex mode, no-space
-Spacing (via either @code{sp} or via blank lines) can be disabled
-with the @code{ns} request. This will enable @dfn{no-space mode}.
-This mode will end when actual text is output or the @code{rs}
-request is encountered. No-space mode will also prevent requests to
-advance to the next page unless they are accompanied by a page number
-(@pxref{Page Control}, for more information.)
+@cindex blank lines, disabling
+@cindex lines, blank, disabling
+@Deffn{Request, ns, }
+Enable @dfn{no-space mode}. In this mode, spacing (either via @code{sp}
+or via blank lines) is disabled. The @code{bp} request to advance to
+the next page is also disabled, except if it is accompanied by a page
+number (see @ref{Page Control}, for more information). This mode will
+end when actual text is output or the @code{rs} request is encountered.
+
+This request is useful for macros which want to avoid that subsequent
+macros inadvertently insert some vertical space before the text starts
+(for example, to set up the first paragraph after a section header). It
+is associated with the current diversion level.
+
+@c XXX xref
+@end_Deffn
+@Deffn{Request, rs, }
+Disable no-space mode. This request is associated with the current
+diversion level.
+
+@c XXX xref
+@end_Deffn
+
+
+@c =====================================================================
@node Tabs and Fields, Character Translations, Manipulating Spacing, Programming Tutorial
@section Tabs and Fields
@cindex tabs and fields
@cindex fields and tabs
+@cindex @acronym{EBCDIC} encoding of a tab
+A tab character (@acronym{ASCII} char@w{ }9, @acronym{EBCDIC} char@w{
+}5) causes a horizontal movement to the next tab stop (much
+like it did on a typewriter).
-@findex \t
-Tab stops are much like those on a typewriter: a tab character (or the
-@code{\t} escape) on input will cause horizontal motion to the next
-tab stop.
+@Deffn{Escape, \\t, }
+This escape is a non-interpreted tab character. In copy mode
+(@pxref{Copy-in Mode}), @code{\t} is the same as a real tab character.
+@end_Deffn
+
+@Deffn{Request, ta, [@var{n1} @var{n2} @dots{} @var{nn} @t{T} @var{r1} @var{r2} @dots{} @var{rn}]}
+Change tab stop positions. This request takes a series of tab
+specifiers as arguments (optionally divided into two groups with the
+letter @samp{T}) which indicate where each tab stop is to be (overriding
+any previous settings).
-@findex ta
-Tab stops can be changed with the @code{ta} request.
-This request takes a series of numbers as arguments which indicate
-where each tab stop is to be (overriding any previous settings).
-These can be specified absolutely,
-i.e. as the distance from the left margin.
-For example, the following wil set tab stops every one inch.
+Tab stops can be specified absolutely, i.e., as the distance from the
+left margin. For example, the following will set 6@w{ }tab stops every
+one inch.
@example
.ta 1i 2i 3i 4i 5i 6i
@end example
Tab stops can also be specified relatively (using a leading @samp{+})
-which means that the specified tab stop will be set that distance
-from the previous tab stop. For example the following is equivalent
-to the previous example.
+which means that the specified tab stop will be set that distance from
+the previous tab stop. For example, the following is equivalent to the
+previous example.
@example
.ta 1i +1i +1i +1i +1i +1i
@end example
-After the specified tab stops repeat values may be set for tabs beyond
-the last one specified. This is most commonly used to specify tabs
-set at equal intervals. The compleat syntax for setting tabs is
-@code{ta @var{n1} @var{n2} @dots{} @var{nn} T @var{r1} @var{r2}
-@dots{} @var{rn}} This will set tabs at positions @var{n1}, @var{n2},
-@dots{}, @var{nn} and then set tabs at @var{nn}+@var{r1},
-@var{nn}+@var{r2}, @dots{}, @var{nn}+@var{rn} and then at
-@var{nn}+@var{rn}+@var{r1}, @var{nn}+@var{rn}+@var{r2}, @dots{},
-@var{nn}+@var{rn}+@var{rn}, and so on. For example the following is,
-yet again, the same as the previous examples.
+@code{gtroff} supports an extended syntax to specify repeat values after
+the @samp{T} mark (these values are always taken as relative) -- this is
+the usual way to specify tabs set at equal intervals. The following is,
+yet again, the same as the previous examples. It does even more since
+it defines an infinite number of tab stops separated by one inch.
@example
.ta T 1i
@end example
-The material in each tab column may be justified to the right or left
-or centered in the column. This is specified by appending an
-@samp{R}, @samp{L} or @samp{C} to the number specifying that tab stop.
-The default justification is @samp{L}.
+Now we are ready to interpret the full syntax given at the beginning:
+Set tabs at positions @var{n1}, @var{n2}, @dots{}, @var{nn} and then set
+tabs at @var{nn}+@var{r1}, @var{nn}+@var{r2}, @dots{}, @var{nn}+@var{rn}
+and then at @var{nn}+@var{rn}+@var{r1}, @var{nn}+@var{rn}+@var{r2},
+@dots{}, @var{nn}+@var{rn}+@var{rn}, and so on.
+
+Example: @samp{4c +6c T 3c 5c 2c} is equivalent to @samp{4c 10c 13c 18c
+20c 23c 28c 30c @dots{}}.
+
+The material in each tab column (i.e., the column between two tab stops)
+may be justified to the right or left or centered in the column. This
+is specified by appending @samp{R}, @samp{L}, or @samp{C} to the tab
+specifier. The default justification is @samp{L}. Example:
@example
.ta 1i 2iC 2iR
@end example
+Some notes:
+
+@itemize @bullet
+@item
+The default unit of the @code{ta} request is @samp{m}.
+
+@item
+A tab stop is converted into a non-breakable horizontal movement which
+can be neither stretched nor squeezed. For example,
+
+@example
+.ds foo a\tb\tc
+.ta T 5i
+\*[foo]
+@end example
+
+@noindent
+creates a single line which is a bit longer than 10@w{ }inches (a string
+is used to show exactly where the tab characters are). Now consider the
+following:
+
+@example
+.ds bar a\tb b\tc
+.ta T 5i
+\*[bar]
+@end example
+
+@noindent
+@code{gtroff} first converts the tab stops of the line into unbreakable
+horizontal movements, then splits the line after the second @samp{b}
+(assuming a sufficiently short line length). Usually, this isn't what
+the user wants.
+
+@item
+Superfluous tabs (i.e., tab characters which do not correspond to a tab
+stop) are ignored except the first one which delimits the characters
+belonging to the last tab stop for right-justifying resp.@: centering.
+Consider the following example
+
+@example
+.ds Z foo\tbar\tfoo
+.ds ZZ foo\tbar\tfoobar
+.ds ZZZ foo\tbar\tfoo\tbar
+.ta 2i 4iR
+\*[Z]
+.br
+\*[ZZ]
+.br
+\*[ZZZ]
+.br
+@end example
+
+@noindent
+which produces the following output:
+
+@example
+foo bar foo
+foo bar foobar
+foo bar foobar
+@end example
+
+@noindent
+The first line right-justifies the second `foo' relative to the tab
+stop. The second line right-justifies `foobar'. The third line finally
+right-justifies only `foo' because of the additional tab character which
+marks the end of the string belonging to the last defined tab stop.
+
+@item
+Tab stops are associated with the current environment
+(@pxref{Environments}).
+
+@item
+Calling @code{ta} without an argument will unset all tab stops.
+
+@item
+@cindex tab stops, in nroff mode
+The start-up value of @code{gtroff} is @w{@samp{T 0.5i}}. This value is
+used even in nroff mode (contrary to @acronym{UNIX} @code{nroff} which
+has tab stops preset every 0.8@dmn{i}).
+@end itemize
+
@vindex .tabs
-The number register @code{.tabs} contains
-a string representation of the current tab settings suitable for use as
-an argument to the @code{ta} request.
+@cindex current tab settings register
+The number register @code{.tabs} contains a string representation of the
+current tab settings suitable for use as an argument to the @code{ta}
+request.
-@findex tc
-Normally troff will fill the space to the next tab stop with spaces.
-In some cases you may wish to change this. The @code{tc} request
-will do this. With no argument troff will revert to using spaces.
+@example
+.ds tab-string \n[.tabs]
+\*[tab-string]
+ @result{} T120u
+@end example
+@end_Deffn
+
+@cindex tab repitition character
+@cindex character, tab repitition
+@Deffn{Request, tc, [@var{fill-char}]}
+Normally @code{gtroff} will fill the space to the next tab stop with
+space. This can be changed with the @code{tc} request. With no
+argument @code{gtroff} will revert to using space, which is the default.
+The value of this @dfn{tab repitition} character is associated with the
+current environment (@pxref{Environments}).
+@end_Deffn
-@subsection Leaders
-@cindex leaders
+@menu
+* Leaders::
+* Fields::
+@end menu
-@findex lc
-Sometimes you may wish to use the @code{tc} request to fill a tab
-stop with a given character, but also, you want to use normal tab
-stops on the rest of the line. For this groff provides an alternate
-tab mechanism, called @dfn{leaders} which will do just that.
-They are used exclusively to produce a repeated run of characters to
-the next tab stop.
+@c ---------------------------------------------------------------------
-You can declare what character will be repeated with the @code{lc}
-request. If you do not give it an argument, the leaders will act the
-same as tabs.
+@node Leaders, Fields, Tabs and Fields, Tabs and Fields
+@subsection Leaders
+@cindex leaders
-@findex \a
-The difference is that a leader is invoked by using the @code{\a}
-escape.
+Sometimes it may may be desirable to use the @code{tc} request to fill a
+particular tab stop with a given character (for example dots in a table
+of contents), but also normal tab stops on the rest of the line. For
+this @code{gtroff} provides an alternate tab mechanism, called
+@dfn{leaders} which will do just that.
+
+@cindex leader character
+A leader character (character code@w{ }1) behaves similarly to a tab
+character: It moves to the next tab stop. The only difference is that
+for this movement, the fill character defaults to a period character and
+not to space.
+
+@Deffn{Escape, \\a, }
+This escape is a non-interpreted leader character. In copy mode
+(@pxref{Copy-in Mode}), @code{\a} is the same as a real leader
+character.
+@end_Deffn
+
+@cindex leader repitition character
+@cindex character, leader repitition
+@Deffn{Request, lc, [@var{fill-char}]}
+The character that will be repeated can be declared with the @code{lc}
+request. Without an argument, leaders will act the same as tabs (i.e.,
+using space for filling). @code{gtroff}'s start-up value is @samp{.}.
+The value of this @dfn{leader repitition} character is associated with
+the current environment (@pxref{Environments}).
+@end_Deffn
@cindex table of contents
@cindex contents, table of
-So for a table of contents you may want to have tab stops defined so
+For a table of contents, to name an example, tab stops may be defined so
that the section number is one tab stop, the title is the second with
-the remaining space being filled with a line of dots and then the
-page number slightly separated from the dots.
+the remaining space being filled with a line of dots, and then the page
+number slightly separated from the dots.
@example
+.ds entry 1.1\tFoo\a\t12
.lc .
-.ta .5iR 5i +.25i
-1.1\tFoo\a\t12
+.ta 1i 5i +.25i
+\*[entry]
@end example
+@noindent
+This produces
+
+@example
+1.1 Foo.......................................... 12
+@end example
+
+@c ---------------------------------------------------------------------
+
+@node Fields, , Leaders, Tabs and Fields
@subsection Fields
@cindex fields
-@findex fc
-Fields are a more general way of laying out tabular data.
-@code{fc}
+@cindex field delimiting character
+@cindex delimiting character for fields
+@cindex character, field delimiting
+@cindex field padding character
+@cindex padding character for fields
+@cindex character, field padding
+@dfn{Fields} are a more general way of laying out tabular data. A field
+is defined as the data between a pair of @dfn{delimiting characters}.
+It contains substrings which are separated by @dfn{padding characters}.
+The width of a field is the distance on the @emph{input} line from the
+position where the field starts to the next tab stop. A padding
+character inserts stretchable space similar to @TeX{}'s @code{\hss}
+command (thus it can even be negative) to make the sum of all substring
+lengths plus the stretchable space equal to the field width. If more
+than one padding character is inserted, the available space is evenly
+distributed among them.
+
+@Deffn{Request, fc, [@var{delim-char} [@var{padding-char}]]}
+Define a delimiting and a padding character for fields. If the latter
+is missing, the padding character defaults to a space character. If
+there is no argument at all, the field mechanism is disabled (which is
+the default). Note that contrary to e.g.@: the tab repitition
+character, delimiting and padding characters are not associated to the
+current environment (@pxref{Environments}).
+
+Example:
+
+@example
+.fc # ^
+.ta T 3i
+#foo^bar^smurf#
+.br
+#foo^^bar^smurf#
+@end example
+
+@noindent
+and here the result:
+
+@example
+foo bar smurf
+foo bar smurf
+@end example
+@end_Deffn
+
+
+@c =====================================================================
-@node Character Translations, Line Layout, Tabs and Fields, Programming Tutorial
+@node Character Translations, Troff and Nroff Mode, Tabs and Fields, Programming Tutorial
@section Character Translations
@cindex character translations
@cindex translations of characters
-
-@findex cc
-@findex c2
+@findex .
+@findex '
+@cindex control character
+@cindex character, control
+@cindex no-break control character
+@cindex character, no-break control
+@cindex control character, no-break
The control character (@samp{.}) and the no-break control character
(@samp{'}) can be changed with the @code{cc} and @code{c2} requests,
respectively.
-The single argument is the new character to be used, with no argument
-the normal control character is restored.
-@findex ec
-@findex eo
-The @code{eo} request will compleatly disable the escape mechanism.
-The @code{ec} request can be used to change the escape character from
-the default @samp{\} to what is specified as an argument.
+@Deffn{Request, cc, [@var{c}]}
+Set the control character to @var{c}. With no argument the default
+control character @samp{.} is restored. The value of the control
+character is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
-@findex tr
-The @code{tr} request will translate characters.
+@Deffn{Request, c2, [@var{c}]}
+Set the no-break control character to @var{c}. With no argument the
+default control character @samp{'} is restored. The value of the
+no-break control character is associated with the current environment
+(@pxref{Environments}).
+@end_Deffn
+
+@findex \
+@Deffn{Request, eo, }
+Disable the escape mechanism completely. After executing this request,
+the backslash character @samp{\} no longer starts an escape sequence.
+
+This request can be very helpful in writing macros since it is not
+necessary then to double the escape character. Here an example:
+
+@example
+.\" This is a simplified version of the
+.\" .BR request from the man macro package
+.eo
+.de BR
+. ds result \&
+. while (\n[.$] >= 2) \@{\
+. as result \fB\$1\fR\$2
+. shift 2
+. \@}
+. if \n[.$] .as result \fB\$1
+\*[result]
+. ft R
+..
+.ec
+@end example
+@end_Deffn
+
+@cindex escape character
+@cindex character, escape
+@Deffn{Request, ec, [@var{c}]}
+Set the escape character to @var{c}. With no argument the default
+escape character @samp{\} is restored. It can be also used to re-enable
+the escape mechanism after an @code{eo} request.
+
+Note that changing the escape character globally will likely break macro
+packages since @code{gtroff} has no mechanism (like @TeX{}) to `intern'
+macros, i.e., to convert a macro definition into an internal form which
+is independent of its representation. If a macro is called, it will be
+executed literally.
+@end_Deffn
+
+@Deffn{Escape, \\e, }
+This escape sequence prints the current escape character (which is the
+backslash character @samp{\} by default).
+@end_Deffn
+
+A @dfn{translation} is a mapping of an input character to an output
+character. The default mappings are given in the font definition files
+for the specific output device (@pxref{Font Files}); all mappings (both
+with @code{tr} and in the font definition files) occur at output time,
+i.e., the input character gets assigned the metric information of the
+mapped output character.
+
+@Deffn{Request, tr, @var{a}@var{b}@var{c}@var{d}@dots{}}
+Translate character @var{a} to @var{b}, character @var{c} to @var{d},
+etc. If there is an odd number of arguments, the last one will be
+translated to the space character.
+
+Some notes:
+
+@itemize @bullet
+@item
+@findex \(
+@findex \[
+@findex \'
+@findex \`
+@findex \-
+@findex \_
+@findex \C
+@findex \N
+@findex char
+@cindex special character
+@cindex character, special
+@cindex numbered character
+@cindex character, numbered
+Special characters (@code{\(@var{xx}}, @code{\[@var{xxx}]},
+@code{\C'@var{xxx}'}, @code{\'}, @code{\`}, @code{\-}, @code{\_}),
+characters defined with the @code{char} request, and numbered characters
+(@code{\N'@var{xxx}'}) can be translated also.
+
+@item
+@findex \e
+The @code{\e} escape can be translated also.
+
+@item
+@findex \%
+Characters can be mapped onto the @code{\%} escape (but @code{\%} can't
+be mapped onto another character).
+
+@item
+@cindex backspace character
+@cindex character, backspace
+@cindex leader character
+@cindex character, leader
+@cindex newline character
+@cindex character, newline
+@cindex tab character
+@cindex character, tab
+@findex \a
+@findex \t
+The following characters can't be translated: space (with one exception,
+see below), backspace, newline, leader (and @code{\a}), tab (and
+@code{\t}).
+
+@item
+@findex shc
+Translations are not considered for finding the soft hyphen character
+set with the @code{shc} request.
+
+@item
+@findex \&
+The character pair @samp{@var{c}\&} (this is an arbitrary character@w{
+}@var{c} followed by the zero width space character) will map this
+character to nothing.
+
+@example
+.tr a\&
+foo bar
+ @result{} foo br
+@end example
+
+@noindent
+It is even possible to map the space character to nothing:
+
+@example
+.tr aa \&
+foo bar
+ @result{} foobar
+@end example
+
+@noindent
+As shown in the example, the space character can't be the first
+character pair as an argument of @code{tr}. Additionally, it is not
+possible to map the space character to any other character; requests
+like @w{@samp{.tr aa x}} will undo @w{@samp{.tr aa \&}} instead.
+
+If justification is active, lines will be justified inspite of the
+`empty' space character (but there is no minimal distance, i.e.@: the
+space character, between words).
+
+@item
+After an output character has been constructed (this happens at the
+moment immediately before the character is appended to an output
+character list, either by direct output, in a macro, diversion, or
+string), it is no longer affected by @code{tr}.
+
+@c XXX xref
+
+@item
+Without an argument, the @code{tr} request is ignored.
+@end itemize
+@end_Deffn
+
+@findex \!@r{, and @code{trnt}}
+@Deffn{Request, trnt, @var{a}@var{b}@var{c}@var{d}@dots{}}
+@code{trnt} is the same as the @code{tr} request except that the
+translations do not apply to text that is transparently throughput into
+a diversion with @code{\!}. @xref{Diversions}, for more information.
-@findex trnt
-@findex \!
-@code{trnt}
-This is the same as the @code{tr} request except that the
-translations do not
-apply to text that is transparently throughput into a diversion with
-@code{\!}. @xref{Diversions}, for more information.
For example,
@example
@@ -2828,153 +4794,340 @@ For example,
.x
@end example
-will print @samp{b}; if @code{trnt} is used instead of @code{tr} it
-will print @samp{a}.
+@noindent
+will print @samp{b}; if @code{trnt} is used instead of @code{tr} it will
+print @samp{a}.
+@end_Deffn
+
+
+@c =====================================================================
+
+@node Troff and Nroff Mode, Line Layout, Character Translations, Programming Tutorial
+@section Troff and Nroff Mode
+@cindex troff mode
+@cindex mode, troff
+@cindex nroff mode
+@cindex mode, nroff
+
+Originally, @code{nroff} and @code{troff} were two separate programs,
+the former for tty output, the latter for everything else. With GNU
+@code{troff}, both programs are merged into one executable.
+Usually, a macro package can be used with both @code{nroff} and
+@code{troff}. Nevertheless, it is sometimes necessary to make a
+distinction between the two programs (resp.@: modes), and @code{gtroff}
+provides two built-in conditions @samp{n} and @samp{t} for the
+@code{if}, @code{ie}, and @code{while} requests to decide whether
+@code{gtroff} shall behave like @code{nroff} or like @code{troff}.
-@node Line Layout, Page Layout, Character Translations, Programming Tutorial
+@pindex troffrc
+@pindex troffrc-end
+@Deffn{Request, troff, }
+Make the @samp{t} built-in condition true (and the @samp{n} built-in
+condition false) for @code{if}, @code{ie}, and @code{while} conditional
+requests. This is the default if @code{gtroff} (@emph{not}
+@code{groff}) is started with the @option{-R} switch to avoid loading of
+the start-up files @file{troffrc} and @file{troffrc-end}. Without
+@option{-R}, @code{gtroff} stays in troff mode if the output device is
+not a tty (e.g.@: `ps').
+@end_Deffn
+
+@pindex tmac.tty
+@Deffn{Request, nroff, }
+Make the @samp{n} built-in condition true (and the @samp{t} built-in
+condition false) for @code{if}, @code{ie}, and @code{while} conditional
+requests. This is the default if @code{gtroff} uses a tty output
+device; the code for switching to nroff mode is in the file
+@file{tmac.tty} which will be loaded by the start-up file
+@code{troffrc}.
+@end_Deffn
+
+@xref{Conditionals and Loops}, for more details on built-in conditions.
+
+
+@c =====================================================================
+
+@node Line Layout, Page Layout, Troff and Nroff Mode, Programming Tutorial
@section Line Layout
@cindex line layout
@cindex layout, line
-
@cindex dimensions, line
@cindex line dimensions
-The following drawing shows the dimensions which troff uses for
+The following drawing shows the dimensions which @code{gtroff} uses for
placing a line of output onto the page. They are labeled with the
-request which manipulates that dimension.
+request which manipulates each dimension.
@example
@group
- | -->| in |<-- |
- -->| po |<-----------ll------------>|
+ -->| in |<--
+ |<-----------ll------------>|
+----+----+----------------------+----+
| : : : |
+----+----+----------------------+----+
+ -->| po |<--
+ |<--------paper width---------------->|
@end group
@end example
+@noindent
These dimensions are:
@ftable @code
@item po
-@vindex .o
-@dfn{Page offset}--This is the leftmost postition of text on the final
-output. This can be adjusted with the @code{po} request, and the
-current setting can be found in the builtin number register @code{.o}
-Note, that this request does not cause a break, so changing the page
-offset in the middle of text being filled may not do what you expect.
+@cindex left margin
+@cindex margin, left
+@cindex page offset
+@cindex offset, page
+@dfn{Page offset} -- this is the leftmost position of text on the final
+output, defining the @dfn{left margin}.
+
@item in
-@vindex .i
-@dfn{Indentation}--This is the distance from the left margin where text
-will be printed. This can be adjusted with the @code{in} request, and
-the current setting can be found in the builtin number register.
-@code{.i}
-This request causes a break.
+@cindex indentation
+@cindex line indentation
+@dfn{Indentation} -- this is the distance from the left margin where
+text will be printed.
-@findex ti
-@findex .in
-There is also the request @code{ti} which will cause one output line
-to be indented, after which the indentation returns to 0.
-This request causes a break.
-The number register @code{.in} is the indent that applies to the
-current output line.
@item ll
-@findex .l
-@findex .ll
-@dfn{Line length}--This is the distance from the left margin to right
-margin. This can be adjusted with the @code{.ll} request, and the
-current setting can be found in the builtin number register @code{.l}
-Note, as the figure implies, line length is not affected by the current
-indentation.
-The number register @code{.ll} is
-the line length that applies to the current output line.
+@cindex line length
+@cindex length of line
+@dfn{Line length} -- this is the distance from the left margin to right
+margin.
@end ftable
+@c XXX improve example
+
@example
.in +.5i
.ll -.5i
A bunch of really boring text which should
be indented from both margins.
-replace me with a better (and more) example!
+Replace me with a better (and more) example!
.in -.5i
.ll +.5i
@end example
+@cindex troff mode
+@cindex mode, troff
+@cindex nroff mode
+@cindex mode, nroff
+@Deffn{Request, po, [@var{offset}]}
+@Deffnx{Request, po, +offset}
+@Deffnx{Request, po, -offset}
+Set horizontal page offset to @var{offset} (resp.@: increment or
+decrement the current value by @var{offset}). Note that this request
+does not cause a break, so changing the page offset in the middle of
+text being filled may not yield the expected result. The initial value
+is 1@dmn{i} if in troff mode, and 0 if in nroff mode (@pxref{Troff and
+Nroff Mode}); the default scaling indicator is@w{ }@code{m} (and not@w{
+}@code{v} as incorrectly documented in the original @acronym{UNIX} troff
+manual).
+
+@vindex .o
+The current page offset can be found in the built-in number register
+@samp{.o}.
+
+If @code{po} is called without an argument, the page offset is reset to
+the previous value before the last call to @code{po}.
+
+@example
+.po 3i
+\n[.o]
+ @result{} 720
+.po -1i
+\n[.o]
+ @result{} 480
+.po
+\n[.o]
+ @result{} 720
+@end example
+@end_Deffn
+
+@Deffn{Request, in, [@var{indent}]}
+@Deffnx{Request, in, +indent}
+@Deffnx{Request, in, -indent}
+Set indentation to @var{indent} (resp.@: increment or decrement the
+current value by @var{indent}). This request causes a break.
+Initially, there is no indentation.
+
+If @code{in} is called without an argument, the indentation is reset to
+the previous value before the last call to @code{in}. The default
+scaling indicator is@w{ }@code{m}.
+
+The indentation is associated with the current environment.
+
+If a negative indentation value is specified (which is not allowed),
+@code{gtroff} emits a warning of type @samp{range} and sets the
+indentation to zero.
+
+The effect of @code{in} is delayed until a partially collected line (if
+it exists) is output.
+
+@vindex .i
+The current indentation (as set by @code{in}) can be found in the
+built-in number register @samp{.i}.
+@end_Deffn
+
+@Deffn{Request, ti, offset}
+@Deffnx{Request, ti, +offset}
+@Deffnx{Request, ti, -offset}
+Temporarily indent the next output line by @var{offset}. If an
+increment or decrement value is specified, adjust the temporary
+indentation relative to the value set by the @code{in} request.
+
+This request causes a break; its value is associated with the current
+environment. The default scaling indicator is@w{ }@code{m}. A call of
+@code{ti} without an argument is ignored.
+
+If the total indentation value is negative (which is not allowed),
+@code{gtroff} emits a warning of type @samp{range} and sets the
+temporary indentation to zero. `Total indentation' is either
+@var{offset} if specified as an absolute value, or the temporary plus
+normal indentation, if @var{offset} is given as a relative value.
+
+The effect of @code{ti} is delayed until a partially collected line (if
+it exists) is output.
+
+@vindex .in
+The number register @code{.in} is the indentation that applies to the
+current output line.
+
+The difference between @code{.i} and @code{.in} is that the latter takes
+into account whether a partially collected line still uses the old
+indentation value resp.@: a temporary indentation value is active.
+@end_Deffn
+
+@Deffn{Request, ll, [@var{length}]}
+@Deffnx{Request, ll, +length}
+@Deffnx{Request, ll, -length}
+Set the line length to @var{length} (resp.@: increment or decrement the
+current value by @var{length}). Initially, the line length is set to
+6.5@dmn{i}. The effect of @code{ll} is delayed until a partially
+collected line (if it exists) is output. The default scaling indicator
+is@w{ }@code{m}.
+
+If @code{ll} is called without an argument, the line length is reset to
+the previous value before the last call to @code{ll}. If a negative
+line length is specified (which is not allowed), @code{gtroff} emits a
+warning of type @samp{range} and sets the line length to zero.
+
+The line length is associated with the current environment.
+
+@vindex .l
+@vindex .ll
+@cindex current line length register
+The current line length (as set by @code{ll}) can be found in the
+built-in number register @code{.l}. The number register @code{.ll} is
+the line length that applies to the current output line.
+
+Similar to @code{.i} and @code{.in}, the difference between @code{.l}
+and @code{.ll} is that the latter takes into account whether a partially
+collected line still uses the old line length value.
+@end_Deffn
+
+
+@c =====================================================================
@node Page Layout, Page Control, Line Layout, Programming Tutorial
@section Page Layout
@cindex page layout
@cindex layout, page
+@code{gtroff} provides some very primitive operations for controlling
+page layout.
-Troff provides some very primitive operations for controlling page
-layout.
+@cindex page length
+@cindex length of page
+@Deffn{Request, pl, [@var{length}]}
+@Deffnx{Request, pl, +length}
+@Deffnx{Request, pl, -length}
+Set the @dfn{page length} to @var{length} (resp.@: increment or
+decrement the current value by @var{length}). This is the length of the
+physical output page. The default scaling indicator is@w{ }@code{v}.
-@findex pl
@vindex .p
-Troff lets you specify the @dfn{page length} via the @code{pl} request.
-This is the length of the physical output page.
-The current setting can
-be found in the builtin number register @code{.p}. Note that this only
-specifies the size of the page, not the not the top and bottom margins.
-Those are not done by groff directly, @xref{Traps}, for further
-information on how to do this.
+@cindex current page length register
+The current setting can be found in the built-in number register
+@samp{.p}.
+
+@cindex top margin
+@cindex margin, top
+@cindex bottom margin
+@cindex margin, bottom
+Note that this only specifies the size of the page, not the top and
+bottom margins. Those are not set by groff directly. @xref{Traps}, for
+further information on how to do this.
+
+Negative @code{pl} values are possible also, but not very useful: No
+trap is sprung, and each line is output on a single page (thus
+suppressing all vertical spacing).
+@end_Deffn
@cindex headers
@cindex footers
@cindex titles
-Troff provides several operations which help in setting up top and
-bottom titles (or headers and footers)
+@code{gtroff} provides several operations which help in setting up top
+and bottom titles (or headers and footers).
+@cindex title line
+@cindex three-part title
@findex tl
-The @code{tl} request will print a @dfn{title line}, which consists
-of three parts: a left justified portion, a centered portion and a
-right justified portion. The argument to @code{tl} is specified as
-@code{'@var{left}'@var{center}'@var{right}'}
-The @samp{%} character is replaced with the current page number.
-
+@vindex %
+The @code{tl} request will print a @dfn{title line}, which consists of
+three parts: a left justified portion, a centered portion and a right
+justified portion. The argument to @code{tl} is specified as
+@code{'@var{left}'@var{center}'@var{right}'}. The @samp{%} character is
+replaced with the current page number. This character can be changed
+with the @code{pc} request (see below).
+
+@cindex length of title line
+@cindex title line, length
@findex lt
@vindex .lt
-The title line is printed using its own line length, which is
-specified with the @code{lt} request. The current setting of this is
-available in the @code{.lt} number register.
+@cindex current title line length register
+The title line is printed using its own line length, which is specified
+with the @code{lt} request. The current setting of this is available in
+the @code{.lt} number register.
+@cindex page number
+@cindex number, page
@findex pn
The @code{pn} request will change the page number of the @emph{next}
page. The only argument is the page number.
@vindex %
@vindex .pn
-The current page number is stored in the number register @code{%}.
-The number register @code{.pn} contains the
-number of the next page:
-either the value set by a @code{pn} request, or
-the number of the current page plus 1.
-
+@cindex current page number register
+The current page number is stored in the number register @code{%}. The
+number register @code{.pn} contains the number of the next page: either
+the value set by a @code{pn} request, or the number of the current page
+plus@w{ }1.
+
+@cindex changing the page number character
+@cindex page number character, changing
@findex pc
-The @code{pc} request will change the page number character (used by
-the @code{tl} request) to a different character. With no argument,
-this mechanism is disabled.
+The @code{pc} request will change the page number character (used by the
+@code{tl} request) to a different character. With no argument, this
+mechanism is disabled.
+
+@xref{Traps}.
-@c distribute these through the text
-@xref{Traps}
+@c =====================================================================
@node Page Control, Fonts, Page Layout, Programming Tutorial
@section Page Control
@cindex page control
@cindex control, page
-
@findex bp
-To stop processing the current page, and move to the next page, you
-can invoke the @code{bp} request. This request will also cause a
-break. This request can also take an argument of what the next page
-should be numbered.
-The only difference
-between @code{bp} and @code{pn} is that @code{pn} does not cause a
-break or actually eject a page.
+@findex pn
+@cindex new page
+To stop processing the current page, and move to the next page, invoke
+the @code{bp} request. This request will also cause a break. It can
+also take an argument of what the next page should be numbered. The
+only difference between @code{bp} and @code{pn} is that @code{pn} does
+not cause a break or actually eject a page.
@example
.de newpage
@@ -2987,17 +5140,16 @@ break or actually eject a page.
@cindex orphan
@findex ne
-Often you may want to make sure that you have a certain amount of
-space before a new page occurs. This is most useful to make sure
-that there is not a single @dfn{orphan} line left at the bottom of a
-page. The @code{ne} request will ensure that there is a certain
-distance, specified by the first argument, before the next page is
-triggered (@pxref{Traps}, for further information).
-The default unit for @code{ne} is v's and the default argument
-is 1v.
+It is often necessary to force a certain amount of space before a new
+page occurs. This is most useful to make sure that there is not a
+single @dfn{orphan} line left at the bottom of a page. The @code{ne}
+request will ensure that there is a certain distance, specified by the
+first argument, before the next page is triggered (see @ref{Traps}, for
+further information). The default unit for @code{ne} is @code{v} and
+the default argument is@w{ }1@dmn{v}.
-For example, to make sure that no fewer than 2 lines get orphaned,
-you can do the following before each paragraph.
+For example, to make sure that no fewer than 2@w{ }lines get orphaned,
+do the following before each paragraph:
@example
.ne 2
@@ -3007,35 +5159,36 @@ text
@findex sv
@findex os
-The @code{sv} is similar to the @code{ne} request, it reserves the
-specified amount of vertical space. If the desired amount of space
-exists before the next trap (bottom page boundary), the space will be
-output immediately. If there is not enough space, it is stored for
-later output via the @code{os} request.
-The default argument is 1v and the default units are v's.
+@findex ne
+@code{sv} is similar to the @code{ne} request; it reserves the specified
+amount of vertical space. If the desired amount of space exists before
+the next trap (bottom page boundary), the space will be output
+immediately. If there is not enough space, it is stored for later
+output via the @code{os} request. The default argument is@w{ }1@dmn{v}
+and the default unit is @code{v}.
+
+@c =====================================================================
@node Fonts, Sizes, Page Control, Programming Tutorial
@section Fonts
@cindex fonts
-
@findex ft
@findex \f
-Groff gives you the ability to switch fonts at any point in your
-text. There are two ways to do this, via the @code{ft} request and
-the @code{\f} escape.
+@code{gtroff} has the ability to switch fonts at any point in the text.
+There are two ways to do this, via the @code{ft} request and the
+@code{\f} escape.
-Fonts are generaly specified as uppercase strings, which are usually
-1 to 4 characters representing an abreviation of acronym of the font
+Fonts are generally specified as upper-case strings, which are usually
+1@w{ }to 4 characters representing an abbreviation or acronym of the font
name.
-The basic set of fonts are R, I, B, and BI. These are Times Roman,
-Italic, Bold, and Bold Italic. There is also at least one symbol
-font which contains various special symbols (greek, mathematics).
-These latter fonts cannot be used directly, but should be used via an
-escape.
-
+The basic set of fonts are @samp{R}, @samp{I}, @samp{B}, and @samp{BI}.
+These are Times Roman, Italic, Bold, and Bold Italic. There is also at
+least one symbol font which contains various special symbols (Greek,
+mathematics). Such symbols fonts cannot be used directly, but should be
+used via an escape.
@menu
* Changing Fonts::
@@ -3046,16 +5199,19 @@ escape.
* Ligatures and Kerning::
@end menu
+@c ---------------------------------------------------------------------
+
@node Changing Fonts, Font Families, Fonts, Fonts
@subsection Changing Fonts
@cindex changing fonts
@cindex fonts, changing
-
@findex ft
-You can change fonts with both the @code{ft} request.
-With no arguments it
-will switch to the previous font (also known as P).
+@cindex previous font
+@cindex font, previous
+Font changes can be done either with the @code{ft} request or the
+@code{\f} request. With no arguments, it will switch to the previous
+font (also known as @samp{P}).
@example
eggs, bacon,
@@ -3066,78 +5222,102 @@ and sausage.
@end example
@findex \f
-The @code{\f} escape is useful for changing fonts in the middle of words
+The @code{\f} escape is useful for changing fonts in the middle of
+words:
@example
eggs, bacon, \fBspam\fP and sausage.
@end example
-Both of the above examples will produce the same output.
+@noindent
+Both of the above examples will produce the same output. Note the usage
+of @samp{P} to indicate the previous font -- using @code{\f} it is not
+possible to omit this parameter.
-Sometimes when putting letters of different fonts, you need more or
-less space at such boundaries. There are two escapes to help with
-this.
+Sometimes, when putting letters of different fonts, more or less space at
+such boundaries are needed. There are two escapes to help with this.
@findex \/
-The @code{\/} escape
-increases the width of the preceding character so that the spacing
-between that character and the following character will be correct if
-the following character is a roman character. For example, if an italic
-f is immediately followed by a roman right parenthesis, then in many
-fonts the top right portion of the f will overlap the top left of the
-right parenthesis.
-It is a good idea to use this escape sequence
-whenever an italic character is immediately followed by a roman
-character without any intervening space.
-
-@c producing @i{f}), which is ugly. Inserting \/ produces f) and avoids this problem.
+@cindex italic correction
+@cindex correction, italic
+The @code{\/} escape increases the width of the preceding character so
+that the spacing between that character and the following character will
+be correct if the following character is a Roman character. For
+example, if an italic@w{ }f is immediately followed by a Roman right
+parenthesis, then in many fonts the top right portion of the f will
+overlap the top left of the right parenthesis. It is a good idea to use
+this escape sequence whenever an italic character is immediately
+followed by a Roman character without any intervening space. This small
+amount of space is also called @dfn{italic correction}.
+
+@c XXX example
+@c producing @i{f}), which is ugly. Inserting \/ produces f) and avoids
+@c this problem.
@findex \,
-The @code{\,} escape
-modifies the spacing of the following character so that the spacing
-between that character and the preceding character will correct if the
-preceding character is a roman character.
-It is a good idea
-to use this escape sequence whenever a roman character is immediately
-followed by an italic character without any intervening space.
-
-@c For example, inserting \, between the parenthesis and the f changes (f to (f.
+@cindex left italic correction
+@cindex correction, left italic
+The @code{\,} escape modifies the spacing of the following character so
+that the spacing between that character and the preceding character will
+be correct if the preceding character is a Roman character. It is a
+good idea to use this escape sequence whenever a Roman character is
+immediately followed by an italic character without any intervening
+space. In analogy to above, this space could be called @dfn{left italic
+correction}, but this term isn't used widely.
+
+@c XXX example
+@c For example, inserting \, between the parenthesis and the f changes
+@c (f to (f.
@findex ftr
-The @code{ftr} request will translate fonts, it is called as
-@samp{.ftr @var{F G}}, which
-Translate font @var{F} to @var{G}.
-Whenever a font named @var{F} is referred to in @code{\f}
-escape sequence,
-or in the @code{ft}, @var{ul}, @var{bd}, @var{cs}, @var{tkf},
-@var{special}, @var{fspecial}, @var{fp},
-or @var{sty} requests, font @var{G} will be used. If @var{G} is
-missing, or equal to @var{F} then font @var{F} will not be translated.
+@findex ft
+@findex ul
+@findex bd
+@findex \f
+@findex cs
+@findex tkf
+@findex special
+@findex fspecial
+@findex fp
+@findex code
+The @code{ftr} request will translate fonts; its syntax is
+
+@example
+.ftr @var{F} @var{G}
+@end example
+@noindent
+which translates font@w{ }@var{F} to font@w{ }@var{G}. Whenever a font
+named @var{F} is referred to in a @code{\f} escape sequence, or in the
+@code{ft}, @code{ul}, @code{bd}, @code{cs}, @code{tkf}, @code{special},
+@code{fspecial}, @code{fp}, or @code{code} requests, font@w{ }@var{G}
+will be used. If @var{G} is missing, or equal to @var{F} then font@w{
+}@var{F} will not be translated.
+
+@c ---------------------------------------------------------------------
@node Font Families, Font Positions, Changing Fonts, Fonts
@subsection Font Families
@cindex font families
@cindex families, font
-
-Due to the variety of fonts available, groff has added the concept of
-font families. Each of these families has four styles (R, I, B and BI),
+Due to the variety of fonts available, @code{gtroff} has added the
+concept of font families. Each of these families has four styles
+(@samp{R}, @samp{I}, @samp{B} and @samp{BI}).
The fonts are specified as the concatenation of the font family and
-style. Specifying a font without the family part will cause groff to
-use that style of the current family.
-By default, groff uses the Times family.
+style. Specifying a font without the family part will cause
+@code{gtroff} to use that style of the current family. By default,
+@code{gtroff} uses the Times family.
-This way, you can just use the basic four fonts and select a
+This way, it is possible to use the basic four fonts and to select a
different font family on the command line.
@findex fam
@vindex .fam
-You can also switch font families with the @code{fam} request
-The current font family is available in the number register
-@code{.fam}.
-This is a string-valued register.
+Font families can be switched with the @code{fam} request. The current
+font family is available in the number register @code{.fam}. This is a
+string-valued register.
@example
spam,
@@ -3153,23 +5333,22 @@ baked beans,
and spam.
@end example
-
+@c ---------------------------------------------------------------------
@node Font Positions, Using Symbols, Font Families, Fonts
@subsection Font Positions
@cindex font positions
@cindex positions, font
-
-For the sake of old phototypesetters and compatability with old
-versions of troff, groff has the concept of font
-@dfn{positions}, on which various fonts are mounted.
-The last one or two are reserved for the symbol font(s).
+For the sake of old phototypesetters and compatability with old versions
+of @code{troff}, @code{gtroff} has the concept of font @dfn{positions},
+on which various fonts are mounted. The last one or two are reserved
+for the symbol font(s).
@findex fp
-New fonts can be mounted with the @code{fp} request.
-These numeric positions can then be referred to with font changing commands.
-When groff starts it is using font number one.
+New fonts can be mounted with the @code{fp} request. These numeric
+positions can then be referred to with font changing commands. When
+@code{gtroff} starts it is using font number one.
@example
.fp 1 H
@@ -3184,12 +5363,15 @@ say no more!
.ft
@end example
-(note that after these font changes have taken place the original
-font is restored.)
+@noindent
+Note that after these font changes have taken place, the original font
+is restored.
@vindex .f
-The current font in use, as a font position.
-This can be useful to remember the current font, for later recall.
+@cindex current font position register
+The current font in use, as a font position, is available in number
+register @code{.f}. This can be useful to remember the current font,
+for later recall.
@example
.nr save-font \n(.f
@@ -3198,6 +5380,7 @@ This can be useful to remember the current font, for later recall.
@end example
@vindex .fp
+@cindex next free font position register
The number of the next free font position is available in the number
register @code{.fp}. This is useful when mounting a new font, like so:
@@ -3205,249 +5388,342 @@ register @code{.fp}. This is useful when mounting a new font, like so:
.fp \n[.fp] NEATOFONT
@end example
-@pindex DESC
+@pindex DESC@r{, and font mounting}
Fonts not listed in the @file{DESC} file are automatically mounted on
-the next available font position when they are referenced.
-If a font is to be
-mountfed explicitly with the @code{fp} request on an unused font position, it
-should be mounted on the first unused font position, which can be found
-in the @code{.fp} register; although troff does not enforce this strictly,
-it will not allow a font to be mounted at a position whose number is
-much greater than that of any currently used position.
-
-The @code{fp} request has an optional third argument.
-This argument gives the
-external name of the font, which is used for finding the font
-description file. The second argument gives the internal name of the
-font which is used to refer to the font in troff after it has been
-mounted. If there is no third argument then the internal name will be
-used as the external name. This feature allows you to use fonts with
-long names in compatibility mode.
+the next available font position when they are referenced. If a font is
+to be mounted explicitly with the @code{fp} request on an unused font
+position, it should be mounted on the first unused font position, which
+can be found in the @code{.fp} register. Although @code{gtroff} does
+not enforce this strictly, it will not allow a font to be mounted at a
+position whose number is much greater than that of any currently used
+position.
+@findex fp
+The @code{fp} request has an optional third argument. This argument
+gives the external name of the font, which is used for finding the font
+description file. The second argument gives the internal name of the
+font which is used to refer to the font in @code{gtroff} after it has
+been mounted. If there is no third argument then the internal name will
+be used as the external name. This feature make it possible to use
+fonts with long names in compatibility mode.
+@c ---------------------------------------------------------------------
@node Using Symbols, Artificial Fonts, Font Positions, Fonts
@subsection Using Symbols
@cindex using symbols
@cindex symbols, using
-
@findex \(
@findex \[
-Symbols can be inserted by using a special escape sequence.
-This escape is simply the escape character (a backslash) followed by
-an identifier. The symbol identifiers have to be two or more
-characters, since single characters conflict with all the other
-escapes. The identifier can be either preceded by a parenthesis if
-it is two character, or surrounded by square brackets.
-So, the symbol for pi can be produced either by @code{\(*p} or
-@code{\[*p]}.
+Symbols can be inserted by using a special escape sequence. This escape
+is simply the escape character (usually a backslash) followed by an
+identifier. The symbol identifiers have to be two or more characters,
+since single characters conflict with all the other escapes. The
+identifier can be either preceded by a parenthesis if it is two
+characters long, or surrounded by square brackets. So, the symbol for
+the mathematical Greek letter `pi' can be produced either by @code{\(*p}
+or @code{\[*p]}.
@example
area = \(*p\fIr\fP\u2\d
@end example
@findex \C
-The escape @code{\C'@var{xxx}'} will typeset character named
+The escape @code{\C'@var{xxx}'} will typeset the character named
@var{xxx}. Normally it is more convenient to use @code{\[@var{xxx}]}.
But @code{\C} has the advantage that it is compatible with recent
-versions of ditroff and is available in compatibility mode.
+versions of @code{ditroff} and is available in compatibility mode.
@findex \N
-The escape @code{\N'@var{n}'} will typeset the character with code
-@var{n} in the current font. @var{n} can be any integer. Most devices only
-have characters with codes between 0 and 255. If the current font
-does not contain a character with that code, special fonts will not be
-searched. The @code{\N} escape sequence can be conveniently used on
-conjunction with the @code{char} request:
+@findex char
+The escape @code{\N'@var{n}'} will typeset the character with code@w{
+}@var{n} in the current font. @var{n} can be any integer. Most devices
+only have characters with codes between 0 and@w{ }255. If the current
+font does not contain a character with that code, special fonts will
+@emph{not} be searched. The @code{\N} escape sequence can be
+conveniently used on conjunction with the @code{char} request:
@example
.char \[phone] \f(ZD\N'37'
@end example
+@noindent
+@pindex DESC
+@cindex unnamed characters
+@cindex characters, unnamed
The code of each character is given in the fourth column in the font
description file after the charset command. It is possible to include
unnamed characters in the font description file by using a name of
@samp{---}; the @code{\N} escape sequence is the only way to use these.
+@c XXX should be `glyph', not `character'
+
@findex cflags
-Each character has certain properties associated with it.
-These properties can be modified with the @code{cflags} request.
-The first argument is the the sum of the desired flags and the
-remaining arguments are the characters to have those properties.
+@cindex character properties
+@cindex properties of characters
+Each character has certain properties associated with it. These
+properties can be modified with the @code{cflags} request. The first
+argument is the the sum of the desired flags and the remaining arguments
+are the characters to have those properties.
+
@table @code
@item 1
+@cindex end of sentence characters
+@cindex characters, end of sentence
the character ends sentences (initially characters @samp{.?!} have this
-property);
+property)
+
@item 2
+@cindex hyphenating characters
+@cindex characters, hyphenation
lines can be broken before the character (initially no characters have
-this property);
+this property)
+
@item 4
-lines can be broken after the character (initially characters
-@samp{-\(hy\(em} have this property);
+@glindex hy
+@glindex em
+lines can be broken after the character (initially the characters
+@samp{-\(hy\(em} have this property)
+
@item 8
-the character overlaps horizontally (initially characters
-@samp{\(ul\(rn\(ru} have this property);
+@cindex overlapping characters
+@cindex characters, overlapping
+@glindex ul
+@glindex rn
+@glindex ru
+the character overlaps horizontally (initially the characters
+@samp{\(ul\(rn\(ru} have this property)
+
@item 16
+@glindex br
the character overlaps vertically (initially character @samp{\(br} has
-this property);
+this property)
+
@item 32
+@cindex transparent characters
+@cindex character, transparent
+@cindex '
+@cindex "
+@cindex ]
+@cindex )
+@cindex *
+@glindex dg
+@glindex rq
an end of sentence character followed by any number of characters with
this property will be treated as the end of a sentence if followed by a
-newline or two spaces; in other words the character is transparent for
-the purposes of end of sentence recognition; this is the same as having
-a zero space factor in @TeX{} (initially characters
+newline or two spaces; in other words the character is @dfn{transparent}
+for the purposes of end of sentence recognition -- this is the same as
+having a zero space factor in @TeX{} (initially characters
@samp{"')]*\(dg\(rq} have this property).
@end table
@findex char
-You can create new characters with the @code{char} request. It is
-called as @samp{.char @var{c} @var{string}} Define character @var{c}
-to be @var{string}. Every time character @var{c} needs to be printed,
-@var{string} will be processed in a temporary environment and the
-result will be wrapped up into a single object. Compatibility mode
-will be turned off and the escape character will be set to \ while
-@var{string} is being processed. Any emboldening, constant spacing or
-track kerning will be applied to this object rather than to individual
-characters in @var{string}. A character defined by this request can
-be used just like a normal character provided by the output device.
-In particular other characters can be translated to it with the
-@code{tr} request; it can be made the leader character by the
-@code{lc} request; repeated patterns can be drawn with the character
-using the @code{\l} and @code{\L} escape sequences; words containing
-the character can be hyphenated correctly, if the @code{hcode} request
-is used to give the character a hyphenation code. There is a special
-anti-recursion feature: use of character within the character's
-definition will be handled like normal characters not defined with
-@code{char}.
+@cindex defining characters
+@cindex characters, defining
+@cindex creating new characters
+New characters can be created with the @code{char} request. It is
+called as
+
+@example
+.char @var{c} @var{string}
+@end example
+
+@findex tr
+@findex lc
+@findex \l
+@findex \L
+@findex hcode
+@noindent
+This defines character@w{ }@var{c} to be @var{string}. Every time
+character@w{ }@var{c} needs to be printed, @var{string} will be
+processed in a temporary environment and the result will be wrapped up
+into a single object. Compatibility mode will be turned off and the
+escape character will be set to @samp{\} while @var{string} is being
+processed. Any emboldening, constant spacing or track kerning will be
+applied to this object rather than to individual characters in
+@var{string}. A character defined by this request can be used just like
+a normal character provided by the output device. In particular other
+characters can be translated to it with the @code{tr} request; it can be
+made the leader character by the @code{lc} request; repeated patterns
+can be drawn with the character using the @code{\l} and @code{\L} escape
+sequences; words containing the character can be hyphenated correctly,
+if the @code{hcode} request is used to give the character a hyphenation
+code. There is a special anti-recursion feature: use of character
+within the character's definition will be handled like normal characters
+not defined with @code{char}.
@findex rchar
-A character definition can be removed with the @code{rchar} request. Its
-arguments are the characters to be removed. This undoes the effect of
-a @code{char} request.
+@cindex removing character definition
+@cindex character, removing definition
+A character definition can be removed with the @code{rchar} request.
+Its arguments are the characters to be removed. This undoes the effect
+of a @code{char} request.
+
+@xref{Special Characters}.
-@c distribute these through the text
-@xref{Special Characters}
+@c ---------------------------------------------------------------------
@node Artificial Fonts, Ligatures and Kerning, Using Symbols, Fonts
@subsection Artificial Fonts
@cindex artificial fonts
@cindex fonts, artificial
-
-There are a number of requests for artificially creating fonts.
-These are largely vestigal remains from the days when output devices
-did not have a wide variety of fonts, and when nroff and troff were
-separate programs.
-These are no longer necessary in GNU Troff.
+There are a number of requests for artificially creating fonts. These
+are largely vestigial remains from the days when output devices did not
+have a wide variety of fonts, and when @code{nroff} and @code{troff}
+were separate programs. These are no longer necessary in GNU
+@code{troff}.
@findex ul
-The @code{ul} request will print subsequent lines in italics on a
-device capable of it, or underline the text on an ascii output device.
-The single argument is the number of lines to be ``underlined,''
-with no argument, the next line will be underlined.
+@cindex underlining
+The @code{ul} request will print subsequent lines in italics on a device
+capable of it, or underline the text on a character output device. The
+single argument is the number of lines to be ``underlined,'' with no
+argument, the next line will be underlined.
@findex cu
+@cindex continuous underlining
+@cindex underlining, continuous
The @code{cu} request is similar to @code{ul} ...
+@c XXX more info
+
@findex uf
-The @code{uf} request will set the underline font used by @code{ul}
-and @code{cu}.
+@cindex underline font
+@cindex font for underlining
+The @code{uf} request will set the underline font used by @code{ul} and
+@code{cu}.
@findex bd
-The @code{bd} request artificially creates a bold font by printing
-each character twice, slightly offset.
-The first argument specifies the font to embolden, and the second is
-the number of basic units, minus one, by which the two characters
-will be offset. If the second argument is missing, emboldening will
-be turned off.
+@cindex imitating bold face
+@cindex bold face, imitating
+The @code{bd} request artificially creates a bold font by printing each
+character twice, slightly offset. The first argument specifies the font
+to embolden, and the second is the number of basic units, minus one, by
+which the two characters will be offset. If the second argument is
+missing, emboldening will be turned off.
+@c ---------------------------------------------------------------------
@node Ligatures and Kerning, , Artificial Fonts, Fonts
@subsection Ligatures and Kerning
@cindex ligatures and kerning
@cindex kerning and ligatures
+@c XXX What are ligatures?
+
+@c XXX more info
@findex lg
@vindex .lg
-@code{lg}
-@code{.lg}
-The current ligature mode.
+@cindex ligatures enabled register
+The ligature mechanism can be switched on or off with the @code{lg}
+request; if the parameter is non-zero or missing, ligatures are enabled,
+otherwise disabled. Default is on. The current ligature mode can be
+found in the number register @code{.lg} (set to@w{ }1 if ligatures are
+enabled, 0@w{ }otherwise).
+
+@c XXX What is kerning?
-What is kerning??
+@c XXX more info
+@cindex zero width space character
+@cindex character, zero width space
+@cindex space character, zero width
If the font description file contains pairwise kerning information,
characters from that font will be kerned. Kerning between two
-characters can be inhibited by placing a @code{\&} between them.
+characters can be inhibited by placing @code{\&} between them.
@findex kern
@vindex .kern
-@code{kern}
-If n is non-zero or missing, enable pairwise kerning, otherwise disable
-it.
-@code{.kern}
-1 if pairwise kerning is enabled, 0 otherwise.
+@cindex kerning enabled register
+Kerning can be activated with the @code{kern} request. If the parameter
+is non-zero or missing, enable pairwise kerning, otherwise disable it.
+The number register @code{.kern} is set to@w{ }1 if pairwise kerning is
+enabled, 0@w{ }otherwise.
@findex tkf
-.tkf f s1 n1 s2 n2
-Enable track kerning for font f. When the current font is f the width
-of every character will be increased by an amount between n1 and n2;
-when the current point size is less than or equal to s1 the width will
-be increased by n1; when it is greater than or equal to s2 the width
-will be increased by n2; when the point size is greater than or equal to
-s1 and less than or equal to s2 the increase in width is a linear
+@cindex track kerning
+@cindex kerning, track
+
+@c XXX What is track kerning?
+
+@c XXX more info
+
+Track kerning must be used with great care since it is usually
+considered bad typography if the reader notices the effect. The syntax
+of the @code{tkf} request is like this:
+
+@example
+.tkf @var{f} @var{s1} @var{n1} @var{s2} @var{n2}
+@end example
+
+@noindent
+Enable track kerning for font@w{ }@var{f}. If the current font is@w{
+}@var{f} the width of every character will be increased by an amount
+between @var{n1} and @var{n2}; if the current point size is less than or
+equal to @var{s1} the width will be increased by @var{n1}; if it is
+greater than or equal to @var{s2} the width will be increased by
+@var{n2}; if the point size is greater than or equal to @var{s1} and
+less than or equal to @var{s2} the increase in width is a linear
function of the point size.
+@c =====================================================================
+
@node Sizes, Strings, Fonts, Programming Tutorial
@section Sizes
@cindex sizes
-
@cindex baseline
-Groff uses two dimensions with each line of text, type size and
-vertical spacing. The type size is the height from the text
-@dfn{baseline} to the top of the tallest character (decenders may drop
-below this baseline). Vertical spacing is the amount of space groff
-allows for a line of text, normally, this is about 20% larger than the
-current type size. Ratios smaller than this can result in
-hard-to-read text, larger that this, it will spread your text out more
-vertically (useful for term papers). By default, troff uses 10 point
-type on 12 point spacing.
+@cindex type size
+@cindex size of type
+@cindex vertical spacing
+@cindex spacing, vertical
+@code{gtroff} uses two dimensions with each line of text, type size and
+vertical spacing. The @dfn{type size} is the height from the text
+@dfn{baseline} to the top of the tallest character (descenders may drop
+below this baseline). @dfn{Vertical spacing} is the amount of space
+@code{gtroff} allows for a line of text; normally, this is about 20%@w{
+}larger than the current type size. Ratios smaller than this can result
+in hard-to-read text; larger that this, it will spread the text out more
+vertically (useful for term papers). By default, @code{gtroff} uses
+10@w{ }point type on 12@w{ }point spacing.
@cindex leading
The difference between type size and vertical spacing is known, by
typesetters, as @dfn{leading}.
-
@menu
* Changing Type Sizes::
* Fractional Type Sizes::
@end menu
+@c ---------------------------------------------------------------------
+
@node Changing Type Sizes, Fractional Type Sizes, Sizes, Sizes
@subsection Changing Type Sizes
@cindex changing type sizes
@cindex type sizes, changing
-
@findex ps
@findex vs
@findex \s
@vindex .s
@vindex .v
-Using the @code{ps} request and the @code{\s} escape you can change
-the type size. The @code{vs} request will change the vertical
-spacing. The default unit for the @code{ps} and @code{vs} requests are
-points.
-The number registers @code{.s} and @code{.v} contain the current
-type size and vertical spacing.
-
-These requests take parameters in units of points. You can specify
-sizes as an absolute size, or as a relative change from the current
-size. The size 0 means go back to the previous size. With no
-argument it will revert to the previous size.
+@cindex current type size register
+@cindex current vertical spacing register
+Using the @code{ps} request and the @code{\s} escape the type size can
+be changed. The @code{vs} request will change the vertical spacing.
+The default unit for the @code{ps} and @code{vs} requests are points.
+The number registers @code{.s} and @code{.v} contain the current type
+size and vertical spacing.
+
+These requests take parameters in units of points. It is possible to
+specify sizes as an absolute size, or as a relative change from the
+current size. The size@w{ }0 means go back to the previous size. With
+no argument it will also revert to the previous size.
@example
snap, snap,
@@ -3458,140 +5734,183 @@ wink, wink, \s+2nudge, nudge,\s+8 say no more!
.ps 10
@end example
-The @code{\s} escape may be called in a variety of ways.
-Much like other escapes there must be a way to determine where the
-argument ends and the text begins.
-Any of the following forms are valid:
-@code{\s@var{n}},
-@code{\s+@var{n}},
-@code{\s-@var{n}},
-@code{\s(@var{nn}},
-@code{\s+(@var{nn}},
-@code{\s-(@var{nn}},
-@code{\s[+@var{nnn}]},
-@code{\s[-@var{nnn}]},
-@code{\s+[@var{nnn}]},
-@code{\s-[@var{nnn}]}.
+The @code{\s} escape may be called in a variety of ways. Much like
+other escapes there must be a way to determine where the argument ends
+and the text begins. Any of the following forms are valid:
+
+@table @code
+@item \s@var{n}
+Set the point size to @var{n}@w{ }points. @var{n}@w{ }must be either 0
+or in the range 4 to@w{ }39.
+
+@item \s+@var{n}
+@itemx \s-@var{n}
+Increase resp.@: decrease the point size by @var{n}@w{ }points.
+@var{n}@w{ }must be exactly one digit.
+
+@item \s(@var{nn}
+Set the point size to @var{nn}@w{ }points. @var{nn} must be exactly two
+digits.
+
+@item \s+(@var{nn}
+@itemx \s-(@var{nn}
+@itemx \s(+@var{nn}
+@itemx \s(-@var{nn}
+Increase resp.@: decrease the point size by @var{nn}@w{ }points.
+@var{nn} must be exactly two digits.
+@end table
+
+@xref{Fractional Type Sizes}, for yet another syntactical form of using
+the @code{\s} escape.
Some devices may only have certain permissible sizes, in which case
-groff will round to the nearest permissible size.
+@code{gtroff} will round to the nearest permissible size.
+@c XXX example
+
+@ignore
@example
... .sz macro example?? ...
@end example
+@end ignore
+
+@c ---------------------------------------------------------------------
@node Fractional Type Sizes, , Changing Type Sizes, Sizes
@subsection Fractional Type Sizes
@cindex fractional type sizes
@cindex type sizes, fractional
-
+@cindex @code{s} unit
+@cindex unit, @code{s}
+@cindex @code{z} unit
+@cindex unit, @code{z}
+@findex ps
+@findex cs
+@findex tkf
+@findex \H
+@findex \s
A @dfn{scaled point} is equal to 1/@var{sizescale} points, where
-@var{sizescale} is specified in the @file{DESC} file (1 by default.)
+@var{sizescale} is specified in the @file{DESC} file (1@w{ }by default.)
There is a new scale indicator @samp{z} which has the effect of
multiplying by @var{sizescale}. Requests and escape sequences in
-troff interpret arguments that represent a pointsize as being in units
-of scaled points, but they evaluate each such argument using a default
-scale indicator of @samp{z}. Arguments treated in this way are the
-argument to the @code{ps} request, the third argument to the @code{cs}
-request, the second and fourth arguments to the @code{tkf} request,
-the argument to the @code{\H} escape sequence, and those variants of
-the @code{\s} escape sequence that take a numeric expression as their
-argument.
-
-For example, suppose @var{sizescale} is 1000; then a scaled point will be
-equivalent to a millipoint; the request @samp{.ps 10.25} is equivalent to
-@samp{.ps 10.25z} and so sets the pointsize to 10250 scaled points, which is
-equal to 10.25 points.
-
-The number register @code{\n(.s} returns the pointsize in points as
-decimal fraction. There is also a new number register @code{\n[.ps]}
-that returns the pointsize in scaled points.
-
-It would make no sense to use the @samp{z} scale indicator in a
-numeric expression whose default scale indicator was neither @samp{u}
-nor @samp{z}, and so troff disallows this. Similarily it would make
+@code{gtroff} interpret arguments that represent a point size as being
+in units of scaled points, but they evaluate each such argument using a
+default scale indicator of @samp{z}. Arguments treated in this way are
+the argument to the @code{ps} request, the third argument to the
+@code{cs} request, the second and fourth arguments to the @code{tkf}
+request, the argument to the @code{\H} escape sequence, and those
+variants of the @code{\s} escape sequence that take a numeric expression
+as their argument (see below).
+
+For example, suppose @var{sizescale} is@w{ }1000; then a scaled point
+will be equivalent to a millipoint; the request @w{@samp{.ps 10.25}} is
+equivalent to @w{@samp{.ps 10.25z}} and thus sets the point size to
+10250@w{ }scaled points, which is equal to 10.25@w{ }points.
+
+It would make no sense to use the @samp{z} scale indicator in a numeric
+expression whose default scale indicator was neither @samp{u} nor
+@samp{z}, and so @code{gtroff} disallows this. Similarly it would make
no sense to use a scaling indicator other than @samp{z} or @samp{u} in a
numeric expression whose default scale indicator was @samp{z}, and so
-troff disallows this as well.
+@code{gtroff} disallows this as well.
There is also new scale indicator @samp{s} which multiplies by the
-number of units in a scaled point. So, for example, @samp{\n[.ps]s}
-is equal to 1m. Be sure not to confuse the @samp{s} and @samp{z}
+number of units in a scaled point. So, for example, @samp{\n[.ps]s} is
+equal to @samp{1m}. Be sure not to confuse the @samp{s} and @samp{z}
scale indicators.
-@code{\s'+@var{n}'}
-@code{\s'-@var{n}'}
-@code{\s+'@var{n}'}
-@code{\s-'@var{n}'}
-Set the point size to @var{n} scaled points; @var{n} is a numeric
-expression with a default scale indicator of @samp{z}.
+@vindex .s
+@vindex .ps
+The number register @code{.s} returns the point size in points as decimal
+fraction. There is also a new number register @code{.ps} that returns
+the point size in scaled points.
+
+@vindex .psr
+@vindex .sr
+@cindex last-requested point size register
+The last-requested point size in scaled points is contained in the
+@code{.psr} number register. The last requested point size in points as
+a decimal fraction can be found in @code{.sr}. This is a string-valued
+register.
-@code{\n[.ps]}
-The current pointsize in scaled points.
+@table @code
+@item \s[@var{n}]
+@itemx \s'@var{n}'
+Set the point size to @var{n} scaled points; @var{n}@w{ }is a numeric
+expression with a default scale indicator of @samp{z}.
-@code{\n[.psr]}
-The last-requested pointsize in scaled points.
+@item \s[+@var{n}]
+@itemx \s[-@var{n}]
+@itemx \s+[@var{n}]
+@itemx \s-[@var{n}]
+@itemx \s'+@var{n}'
+@itemx \s'-@var{n}'
+@itemx \s+'@var{n}'
+@itemx \s-'@var{n}'
+Increase or resp.@: decrease the point size by @var{n} scaled points;
+@var{n} is a numeric expression with a default scale indicator of
+@samp{z}.
+@end table
-@code{\n[.sr]}
-The last requested pointsize in points as a decimal fraction. This is a
-string-valued register.
+@xref{Font Files}.
-@c distribute these through the text
-@xref{Font Files}
+@c =====================================================================
@node Strings, Conditionals and Loops, Sizes, Programming Tutorial
@section Strings
@cindex strings
-
@findex ds
-Groff has string variables, which are entirely for user convenience
-(i.e. there are no builtin strings) They are defined via the
-@code{ds} request.
+@code{gtroff} has string variables, which are entirely for user
+convenience (i.e.@: there are no built-in strings). They are defined
+via the @code{ds} request.
@example
.ds UX \s-1UNIX\s0\u\s-3tm\s0\d
@end example
@findex \*
-The are interpolated, or expanded in-place, via the @code{\*} escape:
+@cindex string interpolation
+@cindex string expansion
+@cindex interpolation of strings
+@cindex expansion of strings
+They are interpolated, or expanded in-place, via the @code{\*} escape:
@example
The \*(UX Operating System
@end example
-Will produce:
-
-@example
-The UNIXtm Operating System
-@end example
-
-If the string named by the @code{\*} does not exist, the escape will
-be replaced by nothing.
+If the string named by the @code{\*} does not exist, the escape will be
+replaced by nothing.
@cindex comments, with @code{ds}
-NOTE: Unlike other requests the third argument takes up the entire
-line including trailing spaces. This means that comments on a line
-with such a request can introduce unwanted space into a string.
+@strong{Caution:} Unlike other requests, the second argument to the
+@code{ds} request takes up the entire line including trailing spaces.
+This means that comments on a line with such a request can introduce
+unwanted space into a string.
@example
-.ds UX \s-1UNIX\s0\u\s-3tm\s0\d \" trademark of you-know-who
+.ds UX \s-1UNIX\s0\u\s-3tm\s0\d \" UNIX trademark
@end example
-Instead you should either put the comment on another line or
-have the comment escape adjacent with the end of the string.
+@noindent
+Instead the comment should be put on another line or have the comment
+escape adjacent with the end of the string.
@example
-.ds UX \s-1UNIX\s0\u\s-3tm\s0\d\" trademark of you-know-who
+.ds UX \s-1UNIX\s0\u\s-3tm\s0\d\" UNIX trademark
@end example
-If you need leading space you can start the string with a double
-quote. No trailing quote is needed, in fact any trailing quote is
-included in your string.
+@cindex trailing quotes
+@cindex quotes, trailing
+@cindex leading spaces with @code{ds}
+@cindex spaces with @code{ds}
+To produce leading space the string can be started with a double quote.
+No trailing quote is needed; in fact, any trailing quote is included in
+your string.
-@cindex canibalism
@example
.ds sign " Yours in a white wine sauce,
@end example
@@ -3599,18 +5918,22 @@ included in your string.
@findex as
@cindex appending to strings
@cindex strings, appending
-You can also append onto a string with the @code{as} request.
-It works the same as the @code{ds} request except that it appends the
-second argument onto the string named by the first argument.
+The @code{as} request will append a string to another string. It works
+similar to the @code{ds} request except that it appends the second
+argument onto the string named by the first argument.
@example
.as sign " with shallots, onions and garlic,
@end example
-@findex \@key{ret}
-Strings are not limited to a sigle line of text. A string can span
-several lines by escaping the newlines with a backslash. The
-resulting string will be stored @emph{without} the newlines.
+@findex \@key{RET}
+@cindex multi-line strings
+@cindex strings, multi-line
+@cindex newline character in strings, escaping
+@cindex escaping newline characters in strings
+Strings are not limited to a single line of text. A string can span
+several lines by escaping the newlines with a backslash. The resulting
+string will be stored @emph{without} the newlines.
@example
.ds foo lots and lots \
@@ -3618,94 +5941,150 @@ of text are on these \
next several lines
@end example
+@findex substring
+@cindex substrings
+Rudimentary string manipulation routines are given with the
+@code{substring} and @code{length} requests. The former has the
+following syntax:
+
+@example
+.substring @var{xx} @var{n1} [@var{n2}]
+@end example
+
+@noindent
+It replaces the string in register@w{ }@var{xx} with the substring
+defined by the indices @var{n1} and@w{ }@var{n2}. The first character
+in the string has index one. If @var{n2} is omitted, it is taken to be
+equal to the string's length. If the index value @var{n1} or @var{n2}
+is negative or zero, it will be counted from the end of the string,
+going backwards: The last character has index@w{ }0, the character
+before the last character has index@w{ }-1, etc.
+
+@findex length
+@cindex length of a string
+@cindex string, length of
+Here the syntax of the @code{length} request:
+
+@example
+.length @var{xx} @var{string}
+@end example
+
+@noindent
+It computes the length of @var{string} and returns it in the number
+register@w{ }@var{xx} (which is not necessarily defined before).
+
+@ignore
@findex rn
@code{rn}
+@c XXX
+
@findex rm
@code{rm}
+@c XXX
+
@findex als
@code{als}
+@c XXX
+
@findex chop
@code{chop}
-@c distribute these through the text
-@xref{Identifiers}
-@c distribute these through the text
-@xref{Comments}
+@c XXX
+@end ignore
+
+
+@xref{Identifiers}, and @ref{Comments}.
+
+
+@c =====================================================================
@node Conditionals and Loops, Writing Macros, Strings, Programming Tutorial
@section Conditionals and Loops
@cindex conditionals and loops
@cindex loops and conditionals
-
-@findex if
-@findex while
+@findex if@r{, operators to use with it}
+@findex while@r{, operators to use with it}
In @code{if} and @code{while} requests, there are several more operators
available:
@table @code
@item e
@itemx o
-True if the current page is even or odd numbered (respectively)
+True if the current page is even or odd numbered (respectively).
+
@item n
-@itemx t
-True if the document is being processed by
-nroff (or an ascii device) or troff.
+@findex nroff
+True if the document is being processed in nroff mode.
+
+@item t
+@findex troff
+True if the document is being processed in troff mode.
+
@item '@var{xxx}'@var{yyy}'
-True if the string @var{xxx} is equal to the string @var{yyy}.
-Other characters can be used in place of the single quotes.
-(Which?)
-The strings are `formatted' before being compared. (?)
+True if the string @var{xxx} is equal to the string @var{yyy}. Other
+characters can be used in place of the single quotes.
+@c XXX (Which?)
+The strings are ``formatted'' before being compared.
+@c XXX (?)
+
@item r@var{xxx}
True if there is a number register named @var{xxx}.
+
@item d@var{xxx}
True if there is a string, macro, diversion, or request named @var{xxx}.
+
@item c@var{ch}
-True if there is a character @var{ch} available; @var{ch} is
-either an ASCII character or a special character @code{\(@var{ch}} or
-@code{\[@var{ch}]}; the condition will also be true if @var{ch} has been
-defined by the @code{char} request.
+@findex char
+True if there is a character @var{ch} available; @var{ch} is either an
+@acronym{ASCII} character or a special character (@code{\(@var{ch}} or
+@code{\[@var{ch}]}); the condition will also be true if @var{ch} has
+been defined by the @code{char} request.
@end table
-
@menu
* if-else::
* while::
@end menu
+@c ---------------------------------------------------------------------
+
@node if-else, while, Conditionals and Loops, Conditionals and Loops
@subsection if-else
@cindex if-else
-
-Troff has if-then-else constructs like other languages, although
+@code{gtroff} has if-then-else constructs like other languages, although
the formatting can be painful.
@findex if
-The @code{if} request is troff's if statement, it is called as
-@samp{.if @var{expr} @var{anything}}, where @var{expr} is the
-expression to be evaluated,
-and @var{anything} (the remainder of the line)
-which will be executed if
-the @var{expr} evaluates to non-zero (true).
-@var{anything} will be interpreted as though it was on a line by
-itself.
-@xref{Expressions}, for more info.
+The @code{if} request has the following syntax:
+
+@example
+.if @var{expr} @var{anything}
+@end example
+
+@noindent
+where @var{expr} is the expression to be evaluated; @var{anything} (the
+remainder of the line) will be executed if @var{expr} evaluates to
+non-zero (true). @var{anything} will be interpreted as though it was on
+a line by itself. @xref{Expressions}, for more info.
Here are some examples:
@example
.if t .ls 2 \" double spacing in troff
-.if 0 .ab how'd this happen??
+.if 0 .ab how'd this happen?
@end example
@findex ie
@findex el
-An if-then-else is written using two requests @code{ie} and @code{el}
-the first request is the if part and the latter is the else part.
+An if-then-else is written using two requests @code{ie} and @code{el}.
+The first request is the `if' part and the latter is the `else' part.
+
+@c XXX example
@example
.ie
@@ -3714,10 +6093,10 @@ the first request is the if part and the latter is the else part.
@findex \@{
@findex \@}
-In many cases you will want more than one request to be executed as a
-result of any of these requests, this can be done using the \@{ and
-\@} escapes.
-The following example shows the possible ways to use these escapes.
+In many cases more than one request is to be executed as a result of any
+of these requests. This can be done using the @code{\@{} and @code{\@}}
+escapes. The following example shows the possible ways to use these
+escapes (note the position of the opening and closing braces).
@example
.ie t \@{\
@@ -3731,21 +6110,20 @@ The following example shows the possible ways to use these escapes.
.ds qq "
@end example
+@xref{Expressions}.
-@c distribute these through the text
-@xref{Expressions}
+@c ---------------------------------------------------------------------
@node while, , if-else, Conditionals and Loops
@subsection while
@cindex while
-
@findex while
-Groff provides a looping construct using the @code{while} request,
-which is used much like the @code{if} (and related) requests.
-The first argument is an expression which will be evaluated.
-The @code{while} request will interpret the remainder of the line
-until the expression evaluates to 0 or false.
+@code{gtroff} provides a looping construct using the @code{while}
+request, which is used much like the @code{if} (and related) requests.
+The first argument is an expression which will be evaluated. The
+@code{while} request will interpret the remainder of the line until the
+expression evaluates to 0 or false.
@example
.nr a 0 1
@@ -3753,41 +6131,49 @@ until the expression evaluates to 0 or false.
\&\n+a
@end example
+@noindent
The preceding example produces:
@example
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
@end example
-@findex break
-@findex continue
-The @code{break} request will
-@dfn{break} out of a while loop.
-Be sure not to confuse this with the @code{.br} request.
-The @code{continue} request will
-finish the current iteration of a while loop.
+@cindex zero width space character
+@cindex character, zero width space
+@cindex space character, zero width
+@findex \&
+@noindent
+Note the usage of the @code{\&} escape to avoid a control character at
+the beginning of a line.
-@c distribute these through the text
-@xref{Expressions}
+@findex break@r{, in a @code{while} loop}
+@findex continue@r{, in a @code{while} loop}
+The @code{break} request will @dfn{break} out of a while loop. Be sure
+not to confuse this with the @code{br} request (causing a line break).
+The @code{continue} request will finish the current iteration of a while
+loop, immediately restarting the next iteration.
+
+@xref{Expressions}.
+
+
+@c =====================================================================
@node Writing Macros, Page Motions, Conditionals and Loops, Programming Tutorial
@section Writing Macros
@cindex writing macros
@cindex macros, writing
-
@findex de
-A macro is a collection of text and embedded commands which can be
+A @dfn{macro} is a collection of text and embedded commands which can be
invoked multiple times. Macros are used for defining common operations.
-Macros are defined using the @code{de} request. This request takes
-a name for the macro as the first argument. Subsequent lines are
-copied into an internal buffer until the line @code{..} is
-encountered. The optional second argument to @code{de} can change
-this ending token.
+Macros are defined using the @code{de} request. This request takes a
+name for the macro as the first argument. Subsequent lines are copied
+into an internal buffer until the line @code{..} is encountered. The
+optional second argument to @code{de} can change this ending token.
-For example, suppose at the beginning of each paragraph, you want
-cause a break, move down a partial line and indent the first line.
-Such a macro could be defined as follows:
+Here a small example macro called @samp{P} which will cause a break and
+the insertion of some vertical space. It could be used to separate
+paragraphs.
@example
.de P
@@ -3797,10 +6183,12 @@ Such a macro could be defined as follows:
@end example
@findex am
-The @code{am} request works similarily to @code{de} except it appends
-onto the macro named by the first argument. So, if we decide we want
-our previously @code{P} macro to actually do indented instead of
-block paragraphs we can add the necessary code to our existing macro.
+@cindex appending, to a macro
+The @code{am} request works similarly to @code{de} except it appends
+onto the macro named by the first argument. So, to make the previously
+defined @samp{P} macro actually do indented instead of block paragraphs,
+is is possible to add the necessary code to the existing macro like
+this:
@example
.am P
@@ -3813,45 +6201,40 @@ block paragraphs we can add the necessary code to our existing macro.
@cindex macro aliases
Macros can be aliased with the @code{als} request.
-@findex rn
-@code{rn}
-
-@findex rm
-@code{rm}
-
-@findex chop
-@code{chop}
-
+@c XXX example
@menu
* Copy-in Mode::
* Parameters::
@end menu
+@c ---------------------------------------------------------------------
+
@node Copy-in Mode, Parameters, Writing Macros, Writing Macros
@subsection Copy-in Mode
@cindex copy-in mode
@cindex mode, copy-in
-
-@findex \n
-@findex \$
-@findex \*
-@findex \\
-@findex \@key{RET}
-When troff reads in the test for a macro or diversion it copies the
-text (including request lines) into an internal buffer, except for
-escapes. Escapes will be converted into an internal form, except for
-@code{\n}, @code{\$}, @code{\*}, @code{\\} and @code{\@key{RET}} which
-are evaluated and inserted into the text where the escape was located.
-This is known as @dfn{copy-in} mode.
+@findex \n@r{, when reading test for a macro}
+@findex \$@r{, when reading test for a macro}
+@findex \*@r{, when reading test for a macro}
+@findex \\@r{, when reading test for a macro}
+@findex \@key{RET}@r{, when reading test for a macro}
+When @code{gtroff} reads in the text for a macro or diversion it copies
+the text (including request lines, but excluding escapes) into an
+internal buffer. Escapes will be converted into an internal form,
+except for @code{\n}, @code{\$}, @code{\*}, @code{\\} and
+@code{\@key{RET}} which are evaluated and inserted into the text where
+the escape was located. This is known as @dfn{copy-in} mode or
+@dfn{copy} mode.
What this means is that you can specify when these escapes are to be
-evaluated (copy-in time or time of use) by insulating the escapes
-with an extra backslash.
+evaluated (either at copy-in time or at the time of use) by insulating
+the escapes with an extra backslash. Compare this to the @code{\def}
+and @code{\edef} commands in @TeX{}.
-For example, the following will result in the numbers 20 and 10 being
-printed.
+For example, the following will result in the numbers 20 and@c{ }10
+being printed:
@example
.nr x 20
@@ -3863,13 +6246,12 @@ printed.
.y
@end example
-
+@c ---------------------------------------------------------------------
@node Parameters, , Copy-in Mode, Writing Macros
@subsection Parameters
@cindex parameters
-
@findex \$
@vindex .$
The arguments to a macro can be examined using a variety of escapes.
@@ -3877,38 +6259,37 @@ The number of arguments is available in the @code{.$} number register.
Any individual argument can be retrieved with one of the following
escapes:
-The escapes @code{\$@var{n}}, @code{\$(@var{nn}}
-and @code{\$[@var{nnn}]}
-will result in the @var{n}th, @var{nn}th or @var{nnn}th
-argument. Macros can have a unlimited number of arguments.
-Note that due to copy-in mode, you will want to have two backslashes
-on these in actual use, since you do not want them interpolated until
-the macro is actually invoked.
+@cindex copy-in mode, and macro arguments
+The escapes @code{\$@var{n}}, @code{\$(@var{nn}} and
+@code{\$[@var{nnn}]} will result in the @var{n}th, @var{nn}th or
+@var{nnn}th argument. As usual, the first form only accepts a single
+number (larger than zero), the second only a two-digit number (larger or
+equal to@w{ }10), and the third any positive integer value (larger than
+zero). Macros can have an unlimited number of arguments. Note that due
+to copy-in mode, two backslashes should be used on these in actual use
+to prevent interpolation until the macro is actually invoked.
@findex shift
-The request @code{shift} will shift the arguments 1 position, or as
-many positions as specified by the first argument.
-After executing this request, argument
-@var{i} will become argument @var{i}-@var{n}; arguments 1 to @var{n}
-will no longer be available.
-Shifting by negative amounts is currently undefined.
+The request @code{shift} will shift the arguments 1@w{ }position, or as
+many positions as specified by its argument. After executing this
+request, argument@w{ }@var{i} will become argument @var{i}-@var{n};
+arguments 1 to@w{ }@var{n} will no longer be available. Shifting by
+negative amounts is currently undefined.
@findex \$*
@findex \$@@
-In some cases you will want to just use all of the arguments at once.
-For example if you pass the arguments along to another macro.
-The @code{\$*} escape is
-the concatenation of all the arguments separated by spaces.
-A similar escape is @code{\$@@},
-which is
-the concatenation of all the arguments with each surrounded
-by double quotes, and separated by spaces.
+In some cases it is convenient to use all of the arguments at once (for
+example, to pass the arguments along to another macro). The @code{\$*}
+escape is the concatenation of all the arguments separated by spaces. A
+similar escape is @code{\$@@}, which is the concatenation of all the
+arguments with each surrounded by double quotes, and separated by
+spaces.
@findex \$0
-@findex als
-The @code{\$0} escape is
-the name by which the current macro was invoked. The @code{als}
-request can make a macro have more than one name.
+@findex als@r{, use with @code{\$0}}
+The @code{\$0} escape is the name by which the current macro was
+invoked. The @code{als} request can make a macro have more than one
+name.
@example
.de vl
@@ -3920,185 +6301,241 @@ request can make a macro have more than one name.
This would be called as
@example
-.vl $Id: groff.texinfo,v 1.5 1999/12/09 09:42:29 wlemb Exp $
+.vl $Id: groff.texinfo,v 1.40 2000/06/18 10:13:51 wlemb Exp $
@end example
+@xref{Request Arguments}.
+
-@c distribute these through the text
-@xref{Request Arguments}
+@c =====================================================================
-@node Page Motions, Drawing Functions, Writing Macros, Programming Tutorial
+@node Page Motions, Drawing Requests, Writing Macros, Programming Tutorial
@section Page Motions
@cindex page motions
@cindex motions, page
-
-@findex sp
+@findex sp@r{, as vertical page motion}
Motions up and down the page can be done with the @code{sp} request.
-However, this causes a break so that the actual effect is to move to
-the left margin and then to the specified location.
+However, this causes a break so that the actual effect is to move to the
+left margin and then to the specified location.
@findex mk
@findex rt
The request @code{mk} can be used to mark a location on a page, for
-movement to later. This request takes a register name as an
-argument in which to store the current page location, with no
-argument it will store the location in an internal register.
-The results of this can be used later by the @code{rt} or the
-@code{sp} request. The @code{rt} request will return
-@strong{upwards} to the location given in the register name given as
-an argument, with no argument it will return to the location marked
-with the @code{mk} request
-
+movement to later. This request takes a register name as an argument in
+which to store the current page location. With no argument it will
+store the location in an internal register. The results of this can be
+used later by the @code{rt} or the @code{sp} request. The @code{rt}
+request will return @emph{upwards} to the location given in the register
+name given as an argument, with no argument it will return to the
+location marked with the @code{mk} request
+
+@c XXX example
+@ignore
@example
... dual column example ...
@end example
+@end ignore
-There are escapes which will give you much finer control of movements
-about the page.
+The following escapes give fine control of movements about the page.
@findex \v
-The @code{\v'@var{e}'} will let you do arbitrary vertical motion from
-the current location on the page. The argument @var{e} specifies the
-distance to move, positive is downwards and negative upwards. The
+@cindex vertical motion
+@cindex motion, vertical
+The @code{\v'@var{e}'} enables arbitrary vertical motion from the
+current location on the page. The argument@w{ }@var{e} specifies the
+distance to move; positive is downwards and negative upwards. The
default unit for this escape is vertical spaces, @code{v}'s. Beware,
-however, that troff will leave text processing to continue wherever
-the motion ends, so if you don't want to interfere with text
-processing, make sure your motions are balanced.
+however, that @code{gtroff} will leave text processing to continue
+wherever the motion ends, so to avoid interference with text processing,
+motions should be balanced.
There are some special case escapes for vertical motion.
@ftable @code
@item \r
-move upwards 1v.
+move upwards@w{ }1@dmn{v}.
+
@item \u
-move upwards .5v.
+move upwards@w{ }.5@dmn{v}.
+
@item \d
-move down .5v.
+move down@w{ }.5@dmn{v}.
@end ftable
@findex \h
-Horizontal motions can be done via the @code{\h'@var{e}'} escape.
-The expression @var{e} indicates how far to move: positive is
-rightwards and negative leftwards.
+@cindex inserting horizontal space
+@cindex horizontal space
+@cindex space, horizontal
+Horizontal motions can be done via the @code{\h'@var{e}'} escape. The
+expression@w{ }@var{e} indicates how far to move: positive is rightwards
+and negative leftwards.
There are a number of special case escapes for horizontal motion:
@ftable @code
@item \@key{SP}
-An unbreakable and unpadable (i.e. not expanded during filling) space.
-(Note: it is a backslash followed by a space.)
+an unbreakable and unpaddable (i.e.@: not expanded during filling)
+space. (Note: This is a backslash followed by a space.)
+
@item \~
-This produces an unbreakable space that stretches like a normal
-interword space when a line is adjusted.
+an unbreakable space that stretches like a normal inter-word space when
+a line is adjusted.
+
@item \|
a 1/6th em space.
+
@item \^
a 1/12th em space.
+
@item \0
a space the size of a digit.
+
@item \&
+@cindex zero width space character
+@cindex character, zero width space
+@cindex space character, zero width
A zero width space.
+
@item \)
-Like @code{\&} except that it behaves like a character declared with
-the @code{cflags} request to be transparent for the purposes of end
-of sentence recognition.
+Like @code{\&} except that it behaves like a character declared with the
+@code{cflags} request to be transparent for the purposes of end of
+sentence recognition.
@end ftable
+@c XXX example
+
+@ignore
@example
... tex logo example ...
@end example
+@end ignore
@findex \w
@cindex width escape
@cindex escape, width
-Often you will want to do horizontal movement based on the width of
-some arbitrary text (e.g. given as an argument to a macro).
-For that, there is the escape @code{\w'@var{text}'} which will
-interpolate to the width of the given @var{text} in basic units.
+A frequent need is to do horizontal movement based on the width of some
+arbitrary text (e.g.@: given as an argument to a macro). For that,
+there is the escape @code{\w'@var{text}'} which will interpolate to the
+width of the given @var{text} in basic units.
+@c XXX example
+
+@ignore
@example
... strlen example ...
@end example
+@end ignore
-Font changes may occur in @var{text} and not affect current settings.
+Font changes may occur in @var{text} which don't affect current
+settings.
-Also after use, @code{\w} sets several registers:
+After use, @code{\w} sets several registers:
@table @code
@item st
-@vindex st
@itemx sb
+@vindex st
@vindex sb
The highest and lowest point, respectively, in @var{text}.
+
@item rst
-@vindex rst
@itemx rsb
+@vindex rst
@vindex rsb
Like the @code{st} and @code{sb} registers, but takes account of the
heights and depths of characters.
+
@item ct
@vindex ct
-is set according to what kinds of characters occur in @var{text}.
+is set according to what kinds of characters occur in @var{text}:
+
@table @asis
@item 0
-all short characters, no decenders or tall characters.
+only short characters, no descenders or tall characters.
+
@item 1
-decender
+descender.
+
@item 2
-tall character
+tall character.
+
@item 3
-both a decender and a tall character
+both a descender and a tall character.
@end table
+
@item ssc
@vindex ssc
-The amount of horizontal space (possibly negative) that should be
-added to the last character before a subscript.
+The amount of horizontal space (possibly negative) that should be added
+to the last character before a subscript.
+
@item skw
@vindex skw
How far to right of the center of the last character in the @code{\w}
-argument, the center of an accent from a roman font should be
-placed over that character.
+argument, the center of an accent from a Roman font should be placed
+over that character.
@end table
@findex \k
@vindex .k
@code{\k}
+
@code{.k}
-@node Drawing Functions, Traps, Page Motions, Programming Tutorial
-@section Drawing Functions
-@cindex drawing functions
-@cindex functions for drawing
+@c XXX documentation
+
+@c =====================================================================
-Groff provides a number of ways to draw lines, and other figures on
-the page. Used in combination with the page motion commands
-(@pxref{Page Motions}, for more info) you can draw a wide variety of
-figures. However, for complex drawings these operations can be quite
-cumbersome, and it may be wise to use the pic preprocessor.
-@xref{gpic}, for more information.
+@node Drawing Requests, Traps, Page Motions, Programming Tutorial
+@section Drawing Requests
+@cindex drawing requests
+@cindex requests for drawing
+
+@code{gtroff} provides a number of ways to draw lines and other figures
+on the page. Used in combination with the page motion commands (see
+@ref{Page Motions}, for more info), a wide variety of figures can be
+drawn. However, for complex drawings these operations can be quite
+cumbersome, and it may be wise to use graphic preprocessors like
+@code{gpic} or @code{ggrn}. @xref{gpic}, and @ref{ggrn}, for more
+information.
All drawing is done via escapes.
@findex \l
-The @code{\l} will draw a line rightwards from the current location.
-The full syntax for this escape is @samp{\l'@var{l}@var{c}'}, where
-@var{l} is the length of the line to be drawn, starting at the
-current location, positive numbers will draw to the right, and
-negative will draw towards the left. This can also be specified
-absolutely (i.e. with a leading |) which will draw back to the
-begining of the line.
+@cindex drawing horizontal lines
+@cindex horizontal line, drawing
+@cindex line, horizontal, drawing
+The @code{\l} escape will draw a line rightwards from the current
+location. The full syntax for this escape is like this:
+
+@example
+\l'@var{l}@var{c}'
+@end example
+@noindent
+where @var{l} is the length of the line to be drawn, starting at the
+current location; positive numbers will draw to the right, and negative
+will draw towards the left. This can also be specified absolutely
+(i.e.@: with a leading @samp{|}) which will draw back to the beginning
+of the line.
+
+@cindex underscore character
+@cindex character, underscore
+@cindex line drawing character
+@cindex character for line drawing
The optional second parameter @var{c} is a character to draw the line
-with. If this second argument is not specified, troff will use the
-underscore character.
+with. If this second argument is not specified, @code{gtroff} will use
+the underscore character.
-If you need to separate the two arguments (to prevent troff from
-interpreting a drawing character as a scaling indicator), you can
-separate them with @code{\&}.
+@cindex zero width space character
+@cindex character, zero width space
+@cindex space character, zero width
+@findex \&
+To separate the two arguments (to prevent @code{gtroff} from
+interpreting a drawing character as a scaling indicator) use @code{\&}.
-And now, for a useful example:
+Here a small useful example:
@example
.de box
@@ -4106,114 +6543,155 @@ And now, for a useful example:
..
@end example
-Note that this works by outputing a box rule (a vertical line), then
-the text given as an argument and then another box rule.
-Then the line drawing escapes both draw from the current location to
-the beginning of the @emph{input} line.
+@noindent
+@opindex |
+Note that this works by outputting a box rule (a vertical line), then
+the text given as an argument and then another box rule. Then the line
+drawing escapes both draw from the current location to the beginning of
+the @emph{input} line.
@findex \L
-Vertical lines are drawn using the @code{\L} escape. It's parameters
-are specified the same as the @code{\l} escape. If the length is
-positive, the movement will be downwards, and upwards for negative.
-The default character is the box rule character.
-As with the vertical motion escapes, text processing will blindly
-continue where the line ends.
+@cindex drawing vertical lines
+@cindex vertical line drawing
+@cindex line, vertical, drawing
+@cindex line drawing character
+@cindex character for line drawing
+@cindex box rule character
+@cindex character, box rule
+Vertical lines are drawn using the @code{\L} escape. Its parameters are
+specified similar to the @code{\l} escape. If the length is positive,
+the movement will be downwards, and upwards for negative values. The
+default character is the box rule character. As with the vertical
+motion escapes, text processing will blindly continue where the line
+ends.
+
+@c XXX example
+@ignore
@example
...box macro...
@end example
+@end ignore
@findex \D
-More flexible drawing functions are available via the @code{\D}
-escape. While the previous escapes will work on an ascii device,
-these escapes will not.
+More flexible drawing functions are available via the @code{\D} escape.
+While the previous escapes will work on a character device, these
+escapes will not.
@table @code
-@item \D'l @var{x} @var{y}'
-Draw a line from the current location to the relative point specified
-by @var{x}, @var{y}.
+@item \D'l @var{dx} @var{dy}'
+Draw a line from the current location to the relative point specified by
+(@var{dx},@var{dy}).
+@c XXX example
+
+@ignore
@example
...revised box macro...
@end example
+@end ignore
@item \D'c @var{d}'
-Draw a circle with a diameter of @var{d} with the leftmost point at
-the current position.
+@cindex circle drawing
+@cindex drawing a circle
+Draw a circle with a diameter of @var{d} with the leftmost point at the
+current position.
+
@item \D'C @var{d}'
Draw a solid circle with the same parameters as an outlined circle.
+
@item \D'e @var{dx} @var{dy}'
+@cindex drawing an ellipse
+@cindex ellipse drawing
Draw an ellipse with a horizontal diameter of @var{dx} and a vertical
diameter of @var{dy} with the leftmost point at the current position.
+
@item \D'E @var{dx} @var{dy}'
-Draw a solid elipse with the same parameters as an outlined elipse.
+Draw a solid ellipse with the same parameters as an outlined ellipse.
+
@item \D'a @var{dx1} @var{dy1} @var{dx2} @var{dy2}'
+@cindex arc drawing
+@cindex drawing an arc
Draw an arc clockwise from the current location through the two
-specified locations.
+specified locations (@var{dx1},@var{dy1}) and (@var{dx2},@var{dy2}).
+
@item \D'~ @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...'
-Draw a spline from the current location to
-@var{dx1}, @var{dy1} and then to @var{dx2}, @var{dy2}, and so on.
+@cindex drawing a spline
+@cindex spline drawing
+Draw a spline from the current location to (@var{dx1},@var{dy1}) and
+then to (@var{dx2},@var{dy2}), and so on.
+
@item \D'f @var{n}'
-Set the shade of gray to be used for filling solid objects to @var{n};
-@var{n} must be an integer between 0 and 1000, where 0 corresponds
-solid white and 1000 to solid black, and values in between correspond
-to intermediate shades of gray. This applies only to solid circles,
-solid ellipses and solid polygons. By default, a level of 1000 will
-be used.
-@item \D'p @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...'
-Draw a polygon from the current location to @var{dx1}, @var{dy1}
-and then to @var{dx2}, @var{dy2} and so on. When the specified data
-points are exhausted, a line is drawn back to the starting point.
+@cindex gray shading
+@cindex shading
+@cindex shades for filling objects
+Set the shade of gray to be used for filling solid objects to@w{
+}@var{n}; @var{n}@w{ }must be an integer between 0 and@w{ }1000, where 0
+corresponds solid white and 1000 to solid black, and values in between
+correspond to intermediate shades of gray. This applies only to solid
+circles, solid ellipses and solid polygons. By default, a level of@w{
+}1000 will be used.
+
+@item \D'p @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...'
+@cindex drawing a polygon
+@cindex polygon drawing
+Draw a polygon from the current location to (@var{dx1},@var{dy1}) and
+then to (@var{dx2},@var{dy2}) and so on. When the specified data points
+are exhausted, a line is drawn back to the starting point.
+
+@c XXX example
+@ignore
@example
... box example (yes, again)...
@end example
+@end ignore
-@itemx \D'P @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...'
+@item \D'P @var{dx1} @var{dy1} @var{dx2} @var{dy2} ...'
Draw a solid polygon with the same parameters as an outlined polygon.
+@c XXX example
+
+@ignore
@example
... shaded box example ...
@end example
+@end ignore
@item \D't @var{n}'
-Set the current line thickness to @var{n} machine units.
-A value of zero selects the smallest available line thickness.
-
+@cindex line thickness
+@cindex thickness of lines
+Set the current line thickness to @var{n} machine units. A value of
+zero selects the smallest available line thickness. A negative value
+makes the line thickness proportional to the current point size (this is
+the default behaviour of @code{ditroff}).
@end table
-Current position
-
@findex \b
@cindex pile, character
@cindex character pile
The @code{\b} escape will @dfn{pile} a sequence of characters
-vertically, and center it vertically on the current line.
-This can be used to build large brackets and braces.
+vertically, and center it vertically on the current line. This can be
+used to build large brackets and braces.
@example
\b'\(lt\(bv\(lk\(bv\(lb'
@end example
+@xref{Drawing Functions}.
+@c =====================================================================
-@node Traps, Diversions, Drawing Functions, Programming Tutorial
+@node Traps, Diversions, Drawing Requests, Programming Tutorial
@section Traps
@cindex traps
-
-Traps are locations, which, when reached, will call a specified macro.
-These traps can occur at a given location on the page, at a given
-location in the current diversion, after a certain number of input
+@dfn{Traps} are locations, which, when reached, will call a specified
+macro. These traps can occur at a given location on the page, at a
+given location in the current diversion, after a certain number of input
lines or at the end of input.
-@findex ch
-Any of these traps can be changed after they have been set with the
-@code{ch} request. The first arguemnt is the name of the trap or
-macro, and the second is the new value for that trap.
-
-
@menu
* Page Location Traps::
* Diversion Traps::
@@ -4221,105 +6699,124 @@ macro, and the second is the new value for that trap.
* End-of-input Traps::
@end menu
+@c ---------------------------------------------------------------------
+
@node Page Location Traps, Diversion Traps, Traps, Traps
@subsection Page Location Traps
@cindex page location traps
@cindex traps, page location
+@c XXX definition of wh request
-Page location traps are frequently used for page headers and
-footers. The following is a simple example of this.
+@cindex page headers
+@cindex page footers
+@cindex headers
+@cindex footers
+Page location traps are frequently used for page headers and footers.
+The following is a simple example of this.
@example
-.de hd \" Page header
+.de hd \" Page header
'sp .5i
.tl 'Title''date'
'sp .3i
..
-.de fo \" Page footer
+.de fo \" Page footer
'sp 1v
.tl ''%''
'bp
..
-.wh 0 hd \" top of the page
-.wh -1i fo \" one inch from bottom
+.wh 0 hd \" trap at top of the page
+.wh -1i fo \" trap one inch from bottom
@end example
@vindex .t
+@cindex distance to next trap
+@cindex trap, distance
The number register @code{.t} is the distance to the next trap.
@findex ch
+@cindex changing trap location
+@cindex trap, changing location
The location of a trap can be changed later on with the @code{ch}
-request.
-The first argument is the name of the macro to be invoked at the trap
-and the second argument is the new location for the trap.
-This is useful when you are building up footnotes in a diversion, and
-you need to allow more space at the bottom of the page for them.
+request. The first argument is the name of the macro to be invoked at
+the trap, and the second argument is the new location for the trap.
+This is useful for building up footnotes in a diversion to allow more
+space at the bottom of the page for them.
+
+@c XXX
+@ignore
@example
... (simplified) footnote example ...
@end example
+@end ignore
@findex vpt
@findex wh
-@findex dt
@vindex .vpt
-The @code{vpt} request will enable vertical position traps if the argment is
-non-zero, disable them otherwise. Vertical position traps are traps
-set by the @code{wh} or @code{dt} requests. Traps set by the
+@cindex vertical position trap enable register
+The @code{vpt} request will enable vertical position traps if the
+argument is non-zero, disable them otherwise. Vertical position traps
+are traps set by the @code{wh} or @code{dt} requests. Traps set by the
@code{it} request are not vertical position traps. The parameter that
controls whether vertical position traps are enabled is global.
Initially vertical position traps are enabled. The current setting of
this is available in the number register @code{.vpt}.
@vindex .trunc
-@findex ne
-The number register @code{.trunc} contains
-the amount of vertical space truncated by the most recently
-sprung vertical position trap, or, if the trap was sprung by a
-@code{ne} request, minus the amount of vertical motion produced by
-the @code{ne} request. In other words, at the point a trap is
-sprung, it represents the difference of what the vertical position
-would have been but for the trap, and what the vertical position
-actually is.
+@findex ne@r{, and the @code{.trunc} register}
+The number register @code{.trunc} contains the amount of vertical space
+truncated by the most recently sprung vertical position trap, or, if the
+trap was sprung by a @code{ne} request, minus the amount of vertical
+motion produced by the @code{ne} request. In other words, at the point
+a trap is sprung, it represents the difference of what the vertical
+position would have been but for the trap, and what the vertical
+position actually is.
@vindex .ne
-The number register @code{.ne} contains
-the amount of space that was needed in the last @code{ne} request that caused
-a trap to be sprung. Useful in conjunction with the @code{.trunc}
-register. @xref{Page Control}, for more information.
-
+The number register @code{.ne} contains the amount of space that was
+needed in the last @code{ne} request that caused a trap to be sprung.
+Useful in conjunction with the @code{.trunc} register. @xref{Page
+Control}, for more information.
+@c ---------------------------------------------------------------------
@node Diversion Traps, Input Line Traps, Page Location Traps, Traps
@subsection Diversion Traps
@cindex diversion traps
@cindex traps, diversion
-
@findex dt
-@vindex .t
+@vindex .t@r{, and diversions}
Traps can also be set @emph{within} a diversion using the @code{dt}
-request. Like @code{wh} the first argument is the location of the
-trap and the second argument is the name of the macro to be invoked.
-The number register @code{.t} will still work within diversions.
+request. Like @code{wh} the first argument is the location of the trap
+and the second argument is the name of the macro to be invoked. The
+number register @code{.t} will still work within diversions.
@xref{Diversions}, for more information.
+@c ---------------------------------------------------------------------
+
@node Input Line Traps, End-of-input Traps, Diversion Traps, Traps
@subsection Input Line Traps
@cindex input line traps
@cindex traps, input line
-
@findex it
The @code{it} request will set an input line trap. The format for
-calling this is @samp{.it @var{n} @var{name}}, where @var{n} is the
-number of lines of input which may be read before @dfn{springing} the
-trap, @var{name} is the macro to be invoked. Request lines are not
-counted as input lines.
+calling this is
+
+@example
+.it @var{n} @var{name}
+@end example
+
+@noindent
+where @var{n} is the number of lines of input which may be read before
+@dfn{springing} the trap, @var{name} is the macro to be invoked.
+Request lines are not counted as input lines.
For example, one possible use is to have a macro which will print the
-next @var{n} lines in a bold font.
+next @var{n}@w{ }lines in a bold font.
@example
.de B
@@ -4331,20 +6828,21 @@ next @var{n} lines in a bold font.
..
@end example
+@c ---------------------------------------------------------------------
+
@node End-of-input Traps, , Input Line Traps, Traps
@subsection End-of-input Traps
@cindex end-of-input traps
@cindex traps, end-of-input
-
@findex em
-The @code{em} request will set a trap at the end of input.
-The macro specified as an arguement will be executed after the last
-line of the input file has been processed.
+The @code{em} request will set a trap at the end of input. The macro
+specified as an argument will be executed after the last line of the
+input file has been processed.
-For example, if your document had to have a section at the bottom of
-the last page for someone to approve you document, you could set it
-up with @code{em}.
+For example, if the document had to have a section at the bottom of the
+last page for someone to approve it, the @code{em} request could be
+used.
@example
.de approval
@@ -4361,41 +6859,52 @@ Date:\t\t\a
@end example
+@c =====================================================================
+
@node Diversions, Environments, Traps, Programming Tutorial
@section Diversions
@cindex diversions
-
-In Troff you can divert text into a named storage area, due to the
-similarity to defining macros it is sometimes said to be stored in a
-macro. This is used for saving text for output at a later time,
-which is useful for keeping blocks of text on the same page,
-footnotes, tables of contents and indexes.
+In @code{gtroff} it is possible to @dfn{divert} text into a named
+storage area. Due to the similarity to defining macros it is sometimes
+said to be stored in a macro. This is used for saving text for output
+at a later time, which is useful for keeping blocks of text on the same
+page, footnotes, tables of contents and indices.
@findex di
@findex da
-Diversion is initiated by the @code{di} request, like the @code{de}
-request it takes an argument of a macro name to divert subsequent
-text to into. The @code{da} macro will append to an existing diversion.
+A diversion is initiated by the @code{di} request. Like the @code{de}
+request, it takes an argument of a macro name to divert subsequent text
+into. The @code{da} macro will append to an existing diversion.
+
+@code{di} (resp.@: @code{da}) without an argument ends the diversion.
+
+@c XXX example
+@ignore
@example
... end-note example ...
@end example
+@end ignore
@vindex .z
@vindex .d
@vindex nl
@vindex .h
-Diversions may be nested.
-The number register @code{.z} contains the name of the current diversion.
-The number register @code{.d} contains the current vertical place in
-the diversion. If not in a diversion it is the same as the register
-@code{nl}.
+@cindex nested diversions
+@cindex diversion, nested
+Diversions may be nested. The number register @code{.z} contains the
+name of the current diversion. The number register @code{.d} contains
+the current vertical place in the diversion. If not in a diversion it
+is the same as the register @code{nl}.
+
+@c XXX more info
+
@code{.h}
@vindex dn
@vindex dl
-After compleating a diversion, the builtin number registers @code{dn}
+After completing a diversion, the built-in number registers @code{dn}
and @code{dl} contain the vertical and horizontal size of the diversion.
@example
@@ -4423,25 +6932,31 @@ and @code{dl} contain the vertical and horizontal size of the diversion.
@end example
@findex \!
-Requests, macros and escapes are interpreted when read into a
-diversion.
-There are two ways to prevent this, either way will take the given
-text and @dfn{transparently} embed it into the diversion.
-The first method is to prefix the line with @code{\!}. This will
-cause the entire line to be transparently inserted into the diversion.
-This is useful for macros you do not want invoked until the diverted
-text is actually output.
+@cindex transparent output
+@cindex output, transparent
+Requests, macros and escapes are interpreted when read into a diversion.
+There are two ways to prevent this; either way will take the given text
+and @dfn{transparently} embed it into the diversion. The first method
+is to prefix the line with @code{\!}. This will cause the entire line
+to be transparently inserted into the diversion. This is useful for
+macros which shouldn't be invoked until the diverted text is actually
+output.
-@c anything is read in copy mode. (what about \! ??)
+@c XXX anything is read in copy mode. (what about \! ??)
@findex \?
The other way is to surround the text by the @code{\?} escape, i.e.
-@samp{\?@var{anything}\?}.
-@var{anything} may not contain
-newlines; use @code{\!} if you want to embed newlines in a diversion. The
-escape sequence @code{\?} is also recognised in copy mode and turned into a
-single internal code; it is this code that terminates anything. Thus
-the followin example will print 4.
+
+@example
+\?@var{anything}\?
+@end example
+
+@noindent
+@var{anything} may not contain newlines; use @code{\!} to embed
+newlines in a diversion. The escape sequence @code{\?} is also
+recognized in copy mode and turned into a single internal code; it is
+this code that terminates anything. Thus the following example will
+print@w{ }4.
@example
.nr x 1
@@ -4461,89 +6976,97 @@ the followin example will print 4.
.f
@end example
-@findex rn
-@code{rn}
-
-@findex rm
-@code{rm}
-
-@findex als
-@code{als}
-
-@findex chop
-@code{chop}
-
@findex asciify
-@code{asciify}
-This request only exists in order to make it possible to make certain
-gross hacks work with GNU troff. It @dfn{unformats} the diversion
-specified as an argument in
-such a way that ASCII characters that were formatted and diverted
-will be treated like ordinary input characters when the diversion is
-reread. For example, the following will set register @code{n} to 1.
-
-@example
-.tr @@.
-.di x
-@@nr\ n\ 1
+@cindex unformatting diversions
+@cindex diversion, unformatting
+The @code{asciify} request only exists in order to make certain gross
+hacks work with GNU @code{troff}. It @dfn{unformats} the diversion
+specified as an argument in such a way that @acronym{ASCII} characters
+that were formatted and diverted will be treated like ordinary input
+characters when the diversion is reread. For example, the following
+will set register @code{n} to@w{ }1.
+
+@example
+.tr @@.
+.di x
+@@nr\ n\ 1
.br
.di
-.tr @@@@
-.asciify x
+.tr @@@@
+.asciify x
.x
@end example
+@xref{Copy-in Mode}.
-@c distribute these through the text
-@xref{Copy-in Mode}
+
+@c =====================================================================
@node Environments, I/O, Diversions, Programming Tutorial
@section Environments
@cindex environments
+It happens frequently that some text should be printed in a certain
+format regardless of what may be in effect at the time, for example, in
+a trap invoked macro to print headers and footers. To solve this
+@code{gtroff} has @dfn{environments} in which text is processed. An
+environment contains most of the parameters that control text
+processing. It is possible to switch amongst these environments; by
+default @code{gtroff} processes text in environment@w{ }0. The
+following is the information kept in an environment.
-Often you will need to print some text in a certain format regardless
-of what may be in effect at the time, for example, in a trap invoked
-macro to print headers and footers.
-To solve this groff has @dfn{environments} in which text is processed.
-An environment contains most of the parameters that control
-text processing. You can switch amongst these environments, by
-default groff processes text in environment 0.
-The following is the information kept in an environment.
-
-@itemize @bullet{}
-@item
-Type size
+@itemize @bullet
@item
-Font (family and style)
+font parameters (size, family, style, character height and slant, space
+and sentence space size)
+
@item
-Page parameters
+page parameters (line length, title length, vertical spacing,
+line spacing, indentation, line numbering, hyphenation data)
+
@item
-Fill/adjust mode
+fill and adjust mode
+
@item
-Tab stops
+tab stops, tab and leader characters, escape character, no-break and
+hyphen indicators, margin character data
+
@item
-Partially collected lines
+partially collected lines
@end itemize
-These environments may be given arbitrary names
-(@pxref{Identifiers}, for more info.)
-Old versions of troff only had environments named 0, 1 and 2.
+These environments may be given arbitrary names (see @ref{Identifiers},
+for more info). Old versions of @code{troff} only had environments
+named @samp{0}, @samp{1} and@w{ }@samp{2}.
@findex ev
@vindex .ev
-The @code{ev} request will switch among these environments.
-The single argument is the name of the environment to switch to, with
-no argument groff will switch back to the previous enviroment.
-There is no limit on the number of named environments;
-they will be created the first time that they are referenced.
-The @code{.ev} number register contains
+@cindex switch environments
+@cindex current environment number/name register
+The @code{ev} request will switch to another environment. The single
+argument is the name of the environment to switch to. With no argument
+@code{gtroff} will switch back to the previous environment. There is no
+limit on the number of named environments; they will be created the
+first time that they are referenced. The @code{.ev} register contains
the name or number of the current environment. This is a string-valued
register.
+Note that a call to @code{ev} (with argument) will push the previously
+active environment onto a stack. If, say, environments @samp{foo},
+@samp{bar}, and @samp{zap} are called (in that order), the first
+@code{ev} request without parameter will switch back to environment
+@samp{bar} (which will be popped off the stack), and a second call will
+switch back to environment @samp{foo}.
+
+@c XXX example
+
+@ignore
@example
... page break macro, revised ...
@end example
+@end ignore
+
+Here is another example:
@example
.ev footnote-env
@@ -4558,35 +7081,44 @@ register.
.ev
@end example
+@findex evc
+@cindex copy environment
+To copy an environment into the current one, use the @code{evc} request,
+which takes the name of the environment to copy from as an argument.
+@c =====================================================================
@node I/O, Postprocessor Access, Environments, Programming Tutorial
@section I/O
@cindex i/o
-
+@cindex input and output requests
+@cindex requests for input and output
+@cindex output and input requests
@findex so
+@cindex including a file
+@cindex file inclusion
The @code{so} request will read in the file given as an argument and
-include it in place of the @code{so} request. This is quite useful
-for large documents, i.e. keeping each chapter in a separate file.
+include it in place of the @code{so} request. This is quite useful for
+large documents, i.e.@: keeping each chapter in a separate file.
@xref{gsoelim}, for more information.
@findex mso
-The @code{mso} request is
-the same as the @code{so} request except that file is searched for in
-the same way that @file{tmac.@var{name}} is searched for when the
-@samp{-m@var{name}} option is specified.
+The @code{mso} request is the same as the @code{so} request except that
+the file is searched for in the same directories as
+@file{tmac.@var{name}} is searched for when the @option{-m@var{name}}
+option is specified.
@findex cf
-@findex trf
-The @code{cf} and @code{trf} requests are to include a file.
-It will transparently output the contents of file filename. Each
-line is output
-as it would be were it preceded by @code{\!}; however, the lines are not
-subject to copy-mode interpretation. If the file does not end with a
-newline, then a newline will be added. For example, you can define a
-macro @code{x} containing the contents of file @file{f}, using
+@cindex transparent output
+@cindex output, transparent
+The @code{cf} and @code{trf} requests are to include a file. It will
+transparently output the contents of file filename. Each line is output
+as it were preceded by @code{\!}; however, the lines are not subject to
+copy mode interpretation. If the file does not end with a newline, then
+a newline will be added. For example, to define a macro@w{ }@code{x}
+containing the contents of file@w{ }@file{f}, use
@example
.di x
@@ -4594,31 +7126,32 @@ macro @code{x} containing the contents of file @file{f}, using
.di
@end example
-.cf filename
-When used in a diversion, this will embed in the diversion an object
-which, when reread, will cause the contents of filename to be
-transparently copied through to the output. In @sc{Unix} troff, the contents
-of filename is immediately copied through to the output regardless of
-whether there is a current diversion; this behaviour is so anomalous
-that it must be considered a bug.
-
+The request @w{@code{.cf @var{filename}}}, when used in a diversion,
+will embed in the diversion an object which, when reread, will cause the
+contents of @var{filename} to be transparently copied through to the
+output. In @acronym{UNIX} @code{troff}, the contents of @var{filename}
+is immediately copied through to the output regardless of whether there
+is a current diversion; this behaviour is so anomalous that it must be
+considered a bug. This request causes a line break.
+@findex trf
With @code{trf}, unlike @code{cf}, the file cannot contain characters
-such as NUL that are not legal troff input characters.
+such as NUL that are not valid @code{gtroff} input characters
+(@pxref{Identifiers}). This request causes a line break.
@findex nx
-The @code{nx} request will force groff to continue processing of the
-file specified as an argument.
+The @code{nx} request will force @code{gtroff} to continue processing of
+the file specified as an argument.
@findex rd
-The @code{rd} request will read from standard input, and include what
-is read as though it were part of the input file. Text is read until
-a blank line is encountered.
+The @code{rd} request will read from standard input, and include what is
+read as though it were part of the input file. Text is read until a
+blank line is encountered.
@cindex form letters
@cindex letters, form
-Using these two requests you can set up form letters.
-The form letter template is constructed like this:
+Using these two requests it is easy to set up form letters. The form
+letter template is constructed like this:
@example
.ce
@@ -4635,13 +7168,13 @@ Body of letter.
@end example
@findex ex
-When this is run, the following file should be redirected in.
-Note that requests included in this file are executed as though they
-were part of the form letter. The last block of input is the
-@code{ex} requests which tells groff to stop processing. If this was
-not there, groff would not know when to stop.
+@noindent
+When this is run, the following file should be redirected in. Note that
+requests included in this file are executed as though they were part of
+the form letter. The last block of input is the @code{ex} requests
+which tells groff to stop processing. If this was not there, groff
+would not know when to stop.
-@cindex Beagle Brothers
@example
Trent A. Fisher
708 NW 19th Av., #202
@@ -4661,15 +7194,20 @@ Dear Mr. Adollar,
@findex pi
@code{pi}
+@c XXX documentation
+
@findex sy
The @code{sy} request will allow arbitrary system commands to be
-executed from within a groff document. The output is not saved
-anyplace, so it is up to you to do so.
+executed from within a @code{gtroff} document. The output is not saved
+anyplace, so it is up to the user to do so.
+
+@c XXX add info about safer and unsafe mode
For example, the following example will introduce the current time
-into your document:
+into a document:
-@cindex time
+@cindex time, current
+@cindex current time
@pindex perl
@example
.sy perl -e 'printf ".nr H %d\\n.nr M %d\\n.nr S %d\\n",\
@@ -4679,170 +7217,192 @@ into your document:
\nH:\nM:\nS
@end example
-Note that this works by having the perl script (run by @code{sy})
+@noindent
+Note that this works by having the @code{perl} script (run by @code{sy})
print out the @code{nr} requests which will set the number registers
-@samp{H}, @samp{M} and @samp{S}, and then reads those commands in
-with the @code{so} request.
+@samp{H}, @samp{M} and @samp{S}, and then reads those commands in with
+the @code{so} request.
@vindex systat
-The @code{systat} number register contains
-The return value of the @code{system()} function executed by the last
-@code{sy} request.
+@cindex @code{system()} return value register
+The @code{systat} number register contains the return value of the
+@code{system()} function executed by the last @code{sy} request.
@findex open
-The @code{open} request will open
-a file (specified as the second argument) for writing and associate
-the stream (specified as the first argument) with it.
+The @code{open} request will open a file (specified as the second
+argument) for writing and associate the stream (specified as the first
+argument) with it.
@findex opena
-The @code{opena} is
-like open, but if filename exists, append to it instead of truncating
-it.
+The @code{opena} is like @code{open}, but if the file exists, append to
+it instead of truncating it.
@findex write
-@findex ds
-@cindex copy-in mode
-@cindex mode, copy-in
+@cindex copy-in mode, and @code{write} requests
+@cindex mode, copy-in, and @code{write} requests
The @code{write} request will write to the file associated with the
-stream specified by the first argument. The stream must previously
-have been the subject of an open request. The remainder of the line
-in interpreted as the @code{ds} request reads its second argument: a
-leading @code{"} will be stripped, and it will be read in copy-in mode.
+stream specified by the first argument. The stream must previously have
+been the subject of an open request. The remainder of the line is
+interpreted as the @code{ds} request reads its second argument: A
+leading @samp{"} will be stripped, and it will be read in copy-in mode.
@findex close
-The @code{close} request will
-close the stream specified by the first argument; stream will no
-longer be an acceptable argument to the @code{write} request.
+The @code{close} request will close the stream specified by the first
+argument; stream will no longer be an acceptable argument to the
+@code{write} request.
+
+@c XXX example
+@ignore
@example
... example of open write &c...
@end example
+@end ignore
-@findex \v
-The @code{\V} escape will
-interpolate the contents of the specified environment variable, as returned
-by getenv(3).
-The argument to @code{\V} is specified as an identifier, i.e.
-@samp{\V@var{x}}, @samp{\V(@var{xx}} or @samp{\V[@var{xxx}]}.
-@code{\V} is interpreted in copy-in mode.
+@findex \V
+The @code{\V} escape will interpolate the contents of the specified
+environment variable, as returned by the function @code{getenv}. The
+argument to @code{\V} is specified as an identifier, i.e.@:
+@samp{\V@var{x}}, @samp{\V(@var{xx}} or @samp{\V[@var{xxx}]}. @code{\V}
+is interpreted in copy-in mode.
-@node Postprocessor Access, Miscellany, I/O, Programming Tutorial
+@c =====================================================================
+
+@node Postprocessor Access, Miscellaneous, I/O, Programming Tutorial
@section Postprocessor Access
@cindex postprocessor access
@cindex access of postprocessor
-
-There are two escapes which will allow you to give information
-directly to the postprocessor. This is particularly useful for
-embedding PostScript into your final document.
+There are two escapes which will allow information to be directly given
+to the postprocessor. This is particularly useful for embedding
+@sc{PostScript} into the final document.
@findex \X
-The @code{\X} escape will embed its argument into the gtroff output
-preceded with @samp{x X}.
+The @code{\X} escape will embed its argument into the @code{gtroff}
+output preceded with @w{@samp{x X}}.
@findex \Y
-The @code{\Y} escape is called with an identifier (i.e.
-@code{\Y@var{x}},
-@code{\Y(@var{xx}} or
-@code{\Y[@var{xxx}]}).
-This is approximately equivalent to @samp{\X'\*[@var{xxx}]'}.
-However the contents
-of the string or macro @var{xxx} are not interpreted; also it is
-permitted for
-@var{xxx} to have been defined as a macro and thus contain newlines
-(it is not permitted for the argument to @code{\X} to contain newlines).
-The inclusion of
-newlines requires an extetension to the @sc{Unix} troff output format, and will
-confuse drivers that do not know about this extension.
-
-
-@c distribute these through the text
-@xref{Devices}
-
-@node Miscellany, Debugging, Postprocessor Access, Programming Tutorial
-@section Miscellany
-@cindex miscellany
-
-
-This section contains parts of troff which cannot (yet) be
+The @code{\Y} escape is called with an identifier (i.e.@:
+@code{\Y@var{x}}, @code{\Y(@var{xx}} or @code{\Y[@var{xxx}]}). This is
+approximately equivalent to @samp{\X'\*[@var{xxx}]'}. However, the
+contents of the string or macro @var{xxx} are not interpreted; also it
+is permitted for @var{xxx} to have been defined as a macro and thus
+contain newlines (it is not permitted for the argument to @code{\X} to
+contain newlines). The inclusion of newlines requires an extension to
+the @acronym{UNIX} @code{troff} output format, and will confuse drivers
+that do not know about this extension.
+
+@xref{Output Devices}.
+
+
+@c =====================================================================
+
+@node Miscellaneous, Debugging, Postprocessor Access, Programming Tutorial
+@section Miscellaneous
+@cindex miscellaneous
+
+This section documents parts of @code{gtroff} which cannot (yet) be
categorized elsewhere in this manual.
@findex nm
-Line numbers can be printed in the left margin
-using the @code{nm} request.
-The first argument is the line number of the @emph{next} output line,
-this defaults to 1.
-The second argument indicates on which lines numbers will be printed,
-i.e. 5 means put line numbers on every 5 lines, this defaults to 1.
-The third argument is the space to be left between the number and
-your text, this defaults to 1.
-The fourth argument is the indentation of the line numbers.
+@cindex line numbers
+@cindex numbers, line
+Line numbers can be printed in the left margin using the @code{nm}
+request. The first argument is the line number of the @emph{next}
+output line; this defaults to@w{ }1. The second argument indicates on
+which lines numbers will be printed, i.e.@: 5 means put line numbers on
+every 5@w{ }lines; this defaults to@w{ }1. The third argument is the
+space to be left between the number and the text; this defaults to@w{
+}1. The fourth argument is the indentation of the line numbers.
Without arguments, line numbers are turned off.
+@c XXX xref ln register
+
@findex nn
-The @code{nn} request will temporarily turn off line numbering.
-The first argument is the number of lines not to be numbered,
-this defaults to 1. (does this disable incrementing or display?)
+The @code{nn} request will temporarily turn off line numbering. The
+first argument is the number of lines not to be numbered; this defaults
+to@w{ }1.
+@c XXX (does this disable incrementing or display?)
+
+@c XXX example
+
+@ignore
@example
... line numbering example ...
@end example
+@end ignore
@findex mc
-margin characters can be automatically printed to the right of your
-text with the @code{mc} request.
-The first argument is the character to be printed and the second
-argument is the distance away from your text.
-With no arguments the margin characters are turned off.
-If this occurs before a break, no margin character will be printed.
-
-This is quite useful for indicating text that has changed, and, in
-fact, there are programs available for doing this (they are called
+@cindex margin characters
+@cindex characters for margins
+Margin characters can be automatically printed to the right of the text
+with the @code{mc} request. The first argument is the character to be
+printed, and the second argument is the distance away from the main body
+text. With no arguments the margin characters are turned off. If this
+occurs before a break, no margin character will be printed.
+
+@pindex nrchbar
+@pindex changebar
+This is quite useful for indicating text that has changed, and, in fact,
+there are programs available for doing this (they are called
@code{nrchbar} and @code{changebar} and can be found in any
@samp{comp.sources.unix} archive.
+@c XXX example
+
+@ignore
@example
... margin char example ...
@end example
+@end ignore
@findex lf
@pindex soelim
-The @code{lf} primary reason for existence is to make debugging
-documents which are split into many files, which are then put
-together with @code{soelim} and other preprocessors.
-The first argument is the name of the file and the second argument is
-the input line number in that file.
-This way troff can produce error messages which are intelligible to
-the user.
+@cindex multi-file documents
+@cindex documents, multi-file
+The primary reason for the existence of @code{lf} is to make debugging
+documents which are split into many files, which are then put together
+with @code{soelim} and other preprocessors. The first argument is the
+name of the file and the second argument is the input line number in
+that file. This way @code{gtroff} can produce error messages which are
+intelligible to the user.
+
+@c XXX example
+@ignore
@example
... example of soelim'ed doc ...
@end example
+@end ignore
+
-@node Debugging, Implementation Differences, Miscellany, Programming Tutorial
+@c =====================================================================
+
+@node Debugging, Implementation Differences, Miscellaneous, Programming Tutorial
@section Debugging
@cindex debugging
+@code{gtroff} is not easy to debug, but there are some useful features
+and strategies for debugging.
-Troff is not easy to debug, but there are some useful features and
-strategies for debugging.
-
-@itemize @bullet{}
+@itemize @bullet
@item
@findex tm
-The @code{tm} request will send output to stderr, this is very useful for
-printing debugging output.
+The @code{tm} request will send output to the standard error stream;
+this is very useful for printing debugging output.
+
@item
When doing something involved it is useful to leave the debugging
-statements in the code and have them turned on by a command line
-flag.
+statements in the code and have them turned on by a command line flag.
@example
.if \n(DB .tm debugging output
@end example
-Then you can activate these statements with:
+@noindent
+To activate these statements say
@example
groff -rDB=1 file
@@ -4850,227 +7410,309 @@ groff -rDB=1 file
@item
@findex ab
-The @code{ab} request is similar to the @code{tm} request,
-except that it will cause groff to stop processing.
-With no argument it will print @samp{User Abort}.
+@cindex aborting
+The @code{ab} request is similar to the @code{tm} request, except that
+it will cause @code{gtroff} to stop processing. With no argument it
+will print @samp{User Abort}.
+
@item
-@findex ex
-The @code{ex} request will also cause groff to stop processing.
+@findex ex@r{, use in debugging}
+@cindex exiting
+The @code{ex} request will also cause @code{gtroff} to stop processing
+if encountered at the topmost level; see also @ref{I/O}.
+
@item
-If you know you are going to get many errors and no useful output,
-you can tell groff to suppress formatted output with the @samp{-z}
-flag.
+If it is known in advance that there will be many errors and no useful
+output, @code{gtroff} can be forced to suppress formatted output with
+the @option{-z} flag.
+
@item
@findex pm
+@cindex dumping symbol table
+@cindex symbol table, dumping
The @code{pm} request will dump out the entire symbol table.
+
@item
@findex pnr
+@cindex dumping number registers
+@cindex number registers, dumping
The @code{pnr} request will print the names and contents of all
currently defined number registers on stderr.
+
@item
@findex ptr
-The @code{ptr} request will
-print the names and positions of all traps (not including input line
-traps and diversion traps) on stderr. Empty slots in the page trap list
-are printed as well, because they can affect the priority of
-subsequently planted traps.
+@cindex dumping traps
+@cindex traps, dumping
+The @code{ptr} request will print the names and positions of all traps
+(not including input line traps and diversion traps) on stderr. Empty
+slots in the page trap list are printed as well, because they can affect
+the priority of subsequently planted traps.
+
@item
@findex fl
-The @code{fl} request instructs groff to flush its output immediately.
-The intention is that this be used when using troff interactively.
-There is little other use for it.
+@cindex flush output
+@cindex output, flush
+@cindex interactive use of @code{gtroff}
+@cindex @code{gtroff}, interactive use
+The @code{fl} request instructs @code{gtroff} to flush its output
+immediately. The intention is that this be used when using
+@code{gtroff} interactively. There is little other use for it. This
+request causes a line break.
+
@item
@findex backtrace
-The @code{backtrace} request will
-print a backtrace of the input stack on stderr.
+@cindex backtrace of input stack
+@cindex input stack, backtrace
+The @code{backtrace} request will print a backtrace of the input stack
+to the standard error stream.
+
@item
-Groff has command line options for printing out more warnings
-(@samp{-w}) and for printing backtraces (@samp{-b}) when a warning or
-an error occurs. The most verbose level of warnings is @samp{-ww}.
+@cindex warnings
+@code{gtroff} has command line options for printing out more warnings
+(@option{-w}) and for printing backtraces (@option{-b}) when a warning
+or an error occurs. The most verbose level of warnings is @option{-ww}.
+
@item
@findex warn
@vindex .warn
-The @code{warn} request controls the level of warnings checked for.
-The one argument is the sum of the numbers associated with each
-warning that is to be enabled; all other warnings will be disabled.
-The number associated with each warning is listed below.
-For example, @code{.warn 0} will disable all warnings, and
-@code{.warn 1} will disable
-all warnings except that about missing characters. If an argument
-is not given, all warnings will be enabled.
-The number register @code{.warn} contains the current warning level.
+@cindex level of warnings
+@cindex warnings, level
+The @code{warn} request controls the level of warnings checked for. The
+only argument is the sum of the numbers associated with each warning
+that is to be enabled; all other warnings will be disabled. The number
+associated with each warning is listed below. For example,
+@w{@code{.warn 0}} will disable all warnings, and @w{@code{.warn 1}}
+will disable all warnings except that about missing characters. If an
+argument is not given, all warnings will be enabled. The number
+register @code{.warn} contains the current warning level.
@end itemize
+@c ---------------------------------------------------------------------
+
+@menu
+* Warnings::
+@end menu
+
+@node Warnings, , Debugging, Debugging
@subsection Warnings
@cindex warnings
-The warnings that can be given by troff are divided into the
-following categories. The name associated with each warning is used
-by the @samp{-w} and @samp{-W} options; the number is used by the
-@code{warn} request, and by the @code{.warn} register.
+The warnings that can be given to @code{gtroff} are divided into the
+following categories. The name associated with each warning is used by
+the @option{-w} and @option{-W} options; the number is used by the
+@code{warn} request and by the @code{.warn} register.
@table @samp
-@item char
+@item char
@itemx 1
Non-existent characters. This is enabled by default.
-@item number
+
+@item number
@itemx 2
Invalid numeric expressions. This is enabled by default.
-@item break
+@xref{Expressions}.
+
+@item break
@itemx 4
-In fill mode, lines which could not be broken so that
-their length was less than the line length. This is
-enabled by default.
-@item delim
+@cindex fill mode
+@cindex mode, fill
+In fill mode, lines which could not be broken so that their length was
+less than the line length. This is enabled by default.
+
+@item delim
@itemx 8
Missing or mismatched closing delimiters.
-@item el
+
+@item el
@itemx 16
+@findex ie
+@findex el
Use of the @code{el} request with no matching @code{ie} request.
-@xref{if-else}, for more information.
-@item scale
+@xref{if-else}.
+
+@item scale
@itemx 32
Meaningless scaling indicators.
-@item range
+
+@item range
@itemx 64
Out of range arguments.
-@item syntax
+
+@item syntax
@itemx 128
Dubious syntax in numeric expressions.
-@item di
+
+@item di
@itemx 256
-@findex di
-@findex da
+@findex di@r{, debugging}
+@findex da@r{, debugging}
Use of @code{di} or @code{da} without an argument when there is no
current diversion.
-@item mac
+
+@item mac
@itemx 512
-Use of undefined strings, macros and diversions.
-When an undefined string, macro or diversion is used,
-that string is automatically defined as empty. So,
-in most cases, at most one warning will be given for
-each name.
+@findex de
+@c XXX more findex entries
+Use of undefined strings, macros and diversions. When an undefined
+string, macro or diversion is used, that string is automatically defined
+as empty. So, in most cases, at most one warning will be given for each
+name.
+
@item reg
@itemx 1024
-Use of undefined number registers. When an undefined
-number register is used, that register is
-automatically defined to have a value of 0. a
-definition is automatically made with a value of 0.
-So, in most cases, at most one warning will be given
-for use of a particular name.
+@findex nr
+@c XXX more findex entries
+Use of undefined number registers. When an undefined number register is
+used, that register is automatically defined to have a value of@w{ }0.
+A definition is automatically made with a value of@w{ }0. So, in most
+cases, at most one warning will be given for use of a particular name.
+
@item tab
@itemx 2048
Use of a tab character where a number was expected.
+
@item right-brace
@itemx 4096
-@findex \@}
+@findex \@}@r{, debugging}
Use of @code{\@}} where a number was expected.
+
@item missing
@itemx 8192
Requests that are missing non-optional arguments.
+
@item input
@itemx 16384
Illegal input characters.
+
@item escape
@itemx 32768
-Unrecognized escape sequences. When an unrecognized
-escape sequence is encountered, the escape character
-is ignored.
+Unrecognized escape sequences. When an unrecognized escape sequence is
+encountered, the escape character is ignored.
+
@item space
@itemx 65536
-Missing space between a request or macro and its
-argument. This warning will be given when an
-undefined name longer than two characters is
-encountered, and the first two characters of the name
-make a defined name. The request or macro will not
-be invoked. When this warning is given, no macro is
-automatically defined. This is enabled by default.
+@cindex compatibility mode
+Missing space between a request or macro and its argument. This warning
+will be given when an undefined name longer than two characters is
+encountered, and the first two characters of the name make a defined
+name. The request or macro will not be invoked. When this warning is
+given, no macro is automatically defined. This is enabled by default.
This warning will never occur in compatibility mode.
+
@item font
@itemx 131072
-Non-existent fonts. This is enabled by default.
+Non-existent fonts. This is enabled by default.
+
@item all
-All warnings except @samp{di}, @samp{mac} and @samp{reg}. It is
-intended that this covers
-all warnings that are useful with traditional macro packages.
+All warnings except @samp{di}, @samp{mac} and @samp{reg}. It is
+intended that this covers all warnings that are useful with traditional
+macro packages.
+
@item w
All warnings.
@end table
+@c =====================================================================
+
@node Implementation Differences, Summary, Debugging, Programming Tutorial
@section Implementation Differences
@cindex implementation differences
@cindex differences in implementation
+@cindex incompatibilities with Unix @code{troff}
+@cindex compatibility mode
+@cindex mode, compatibility
+GNU @code{troff} has a number of features which cause incompatibilities
+with documents written with old versions of @code{troff}.
-GNU troff has a number of features which cause incompatibilites with
-documents written with old versions of troff.
-
-Long names cause some incompatibilities. @sc{Unix} troff will interpret
+@cindex long names
+@cindex names, long
+Long names cause some incompatibilities. @acronym{UNIX} @code{troff}
+will interpret
@example
.dsabcd
@end example
-@findex \*
-@findex \n
+@findex \*@r{, incompatibilities with Unix @code{troff}}
+@findex \n@r{, incompatibilities with Unix @code{troff}}
@findex cp
@vindex .C
-as defining a string @samp{ab} with contents @samp{cd}.
-Normally, GNU troff will interpret this as a call of a macro named
-@code{dsabcd}. Also @sc{Unix} troff will interpret @code{\*[} or
-@code{\n[} as references to a string or number register called
-@samp{[}. In GNU troff, however, this will normally be interpreted as the
-start of a long name. In compatibility mode GNU troff will interpret
-these things in the traditional way. In compatibility mode, however,
-long names are not recognised. Compatibility mode can be turned on with
-the @samp{-C} command line option, and turned on or off with the
-@code{cp} request.
-The number register @code{.C} is 1 if compatibility mode is on, 0 otherwise.
+@noindent
+as defining a string @samp{ab} with contents @samp{cd}. Normally, GNU
+@code{troff} will interpret this as a call of a macro named
+@code{dsabcd}. Also @acronym{UNIX} @code{troff} will interpret
+@code{\*[} or @code{\n[} as references to a string or number register
+called @samp{[}. In GNU @code{troff}, however, this will normally be
+interpreted as the start of a long name. In compatibility mode GNU
+@code{troff} will interpret these things in the traditional way. In
+compatibility mode, however, long names are not recognized.
+Compatibility mode can be turned on with the @option{-C} command line
+option, and turned on or off with the @code{cp} request. The number
+register @code{.C} is@w{ }1 if compatibility mode is on, 0@w{
+}otherwise.
@findex \A
-GNU troff does not allow the use of the escape sequences
-@samp{\| \^ \& \@} \@{ \@key{SP} \' \` \- \_ \! \% \c} in names of
-strings, macros,
-diversions, number registers, fonts or environments; @sc{Unix} troff does.
-The @code{\A} escape sequence may be helpful in avoiding use of these escape
-sequences in names.
+@findex \|
+@findex \^
+@findex \&
+@findex \@}
+@findex \@{
+@findex \@key{SP}
+@findex \'
+@findex \`
+@findex \-
+@findex \_
+@findex \!
+@findex \%
+@findex \c
+GNU @code{troff} does not allow the use of the escape sequences
+@code{\|}, @code{\^}, @code{\&}, @code{\@}}, @code{\@{},
+@code{\@key{SP}}, @code{\'}, @code{\`}, @code{\-}, @code{\_}, @code{\!},
+@code{\%}, and @code{\c} in names of strings, macros, diversions, number
+registers, fonts or environments; @acronym{UNIX} @code{troff} does. The
+@code{\A} escape sequence (@pxref{Identifiers}) may be helpful in
+avoiding use of these escape sequences in names.
@cindex fractional point sizes
@cindex point sizes, fractional
-@findex ps
-Fractional pointsizes cause one noteworthy incompatibility. In @sc{Unix}
-troff the @code{ps} request ignores scale indicators and so
+@findex ps@r{, incompatibilities with Unix @code{troff}}
+Fractional point sizes cause one noteworthy incompatibility. In
+@acronym{UNIX} @code{troff} the @code{ps} request ignores scale
+indicators and thus
@example
.ps 10u
@end example
-will set the pointsize to 10 points, whereas in GNU troff it will set
-the pointsize to 10 scaled points.
-@xref{Fractional Type Sizes}, for more information.
-
-@findex bd
-@findex cs
-@findex tkf
-@findex tr
-@findex fp
-In GNU troff there is a fundamental difference between unformatted,
-input characters, and formatted, output characters. Everything that
-affects how an output character will be output is stored with the
-character; once an output character has been constructed it is
+@noindent
+will set the point size to 10@w{ }points, whereas in GNU @code{troff} it
+will set the point size to 10@w{ }scaled points. @xref{Fractional Type
+Sizes}, for more information.
+
+@findex bd@r{, incompatibilities with Unix @code{troff}}
+@findex cs@r{, incompatibilities with Unix @code{troff}}
+@findex tkf@r{, incompatibilities with Unix @code{troff}}
+@findex tr@r{, incompatibilities with Unix @code{troff}}
+@findex fp@r{, incompatibilities with Unix @code{troff}}
+@cindex input and output characters, compatibility with Unix
+@cindex output characters, compatibility with Unix
+@cindex characters, input and output, compatibility with Unix
+In GNU @code{troff} there is a fundamental difference between
+unformatted, input characters, and formatted, output characters.
+Everything that affects how an output character will be output is stored
+with the character; once an output character has been constructed it is
unaffected by any subsequent requests that are executed, including
-@code{bd}, @code{cs}, @code{tkf}, @code{tr}, or @code{fp}
-requests. Normally output characters are constructed
-from input characters at the moment immediately before the character is
-added to the current output line. Macros, diversions and strings are
-all, in fact, the same type of object; they contain lists of input
-characters and output characters in any combination. An output
-character does not behave like an input character for the purposes of
-macro processing; it does not inherit any of the special properties that
-the input character from which it was constructed might have had. For
-example,
+@code{bd}, @code{cs}, @code{tkf}, @code{tr}, or @code{fp} requests.
+Normally output characters are constructed from input characters at the
+moment immediately before the character is added to the current output
+line. Macros, diversions and strings are all, in fact, the same type of
+object; they contain lists of input characters and output characters in
+any combination. An output character does not behave like an input
+character for the purposes of macro processing; it does not inherit any
+of the special properties that the input character from which it was
+constructed might have had. For example,
@example
.di x
@@ -5080,127 +7722,222 @@ example,
.x
@end example
-@findex \e
-@findex \!
-@findex \?
-will print @samp{\\} in GNU troff; each pair of input backslashes is
-turned into one
-output backslash and the resulting output backslashes are not
-interpreted as escape
-characters when they are reread. @sc{Unix} troff would interpret them as
-escape characters when they were reread and would end up printing one
-@samp{\}.
-The correct way to obtain a printable backslash is to use the
-@code{\e} escape
-sequence: this will always print a single instance of the current escape
-character, regardless of whether or not it is used in a diversion; it
-will also work in both GNU troff and @sc{Unix} troff. If you wish for some
-reason to store in a diversion an escape sequence that will be
-interpreted when the diversion is reread, you can either use the
-traditional @code{\!} transparent output facility, or, if this is unsuitable,
-the new @code{\?} escape sequence. @xref{Diversions}, for more information.
+@findex \e@r{, incompatibilities with Unix @code{troff}}
+@findex \!@r{, incompatibilities with Unix @code{troff}}
+@findex \?@r{, incompatibilities with Unix @code{troff}}
+@cindex transparent output, incompatibilities with Unix @code{troff}
+@cindex output, transparent, incompatibilities with Unix @code{troff}
+@noindent
+will print @samp{\\} in GNU @code{troff}; each pair of input backslashes
+is turned into one output backslash and the resulting output backslashes
+are not interpreted as escape characters when they are reread.
+@acronym{UNIX} @code{troff} would interpret them as escape characters
+when they were reread and would end up printing one @samp{\}. The
+correct way to obtain a printable backslash is to use the @code{\e}
+escape sequence: This will always print a single instance of the current
+escape character, regardless of whether or not it is used in a
+diversion; it will also work in both GNU @code{troff} and @acronym{UNIX}
+@code{troff}. To store, for some reason, an escape sequence in a
+diversion that will be interpreted when the diversion is reread, either
+use the traditional @code{\!} transparent output facility, or, if this
+is unsuitable, the new @code{\?} escape sequence.
+
+@xref{Diversions}, for more information.
+@c =====================================================================
+
@node Summary, , Implementation Differences, Programming Tutorial
@section Summary
@cindex summary
+@c XXX documentation
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Preprocessors, Output Devices, Programming Tutorial, Top
+@chapter Preprocessors
+@cindex preprocessors
+
+This chapter describes all preprocessors that come with @code{groff} or
+which are freely available.
+
+@menu
+* geqn::
+* gtbl::
+* gpic::
+* ggrn::
+* grap::
+* grefer::
+* gsoelim::
+@end menu
+
-@node geqn, gtbl, Programming Tutorial, Top
-@chapter @code{geqn}
+@c =====================================================================
+
+@node geqn, gtbl, Preprocessors, Preprocessors
+@section @code{geqn}
@cindex @code{eqn}
@cindex @code{geqn}
+@c XXX
@menu
* Invoking geqn::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking geqn, , geqn, geqn
-@section Invoking @code{geqn}
+@subsection Invoking @code{geqn}
@cindex invoking @code{geqn}
@cindex @code{geqn}, invoking
+@c XXX
+
+@c =====================================================================
-@node gtbl, gpic, geqn, Top
-@chapter @code{gtbl}
+@node gtbl, gpic, geqn, Preprocessors
+@section @code{gtbl}
@cindex @code{tbl}
@cindex @code{gtbl}
+@c XXX
@menu
* Invoking gtbl::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking gtbl, , gtbl, gtbl
-@section Invoking @code{gtbl}
+@subsection Invoking @code{gtbl}
@cindex invoking @code{gtbl}
@cindex @code{gtbl}, invoking
+@c XXX
+
-@node gpic, grap, gtbl, Top
-@chapter @code{gpic}
+@c =====================================================================
+
+@node gpic, ggrn, gtbl, Preprocessors
+@section @code{gpic}
@cindex @code{pic}
@cindex @code{gpic}
+@c XXX
@menu
* Invoking gpic::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking gpic, , gpic, gpic
-@section Invoking @code{gpic}
+@subsection Invoking @code{gpic}
@cindex invoking @code{gpic}
@cindex @code{gpic}, invoking
+@c XXX
+
+
+@c =====================================================================
+
+@node ggrn, grap, gpic, Preprocessors
+@section @code{ggrn}
+@cindex @code{grn}
+@cindex @code{ggrn}
+
+@c XXX
+
+@menu
+* Invoking ggrn::
+@end menu
+
+@c ---------------------------------------------------------------------
+
+@node Invoking ggrn, , ggrn, ggrn
+@subsection Invoking @code{ggrn}
+@cindex invoking @code{ggrn}
+@cindex @code{ggrn}, invoking
+@c XXX
-@node grap, grefer, gpic, Top
-@chapter @code{grap}
+
+@c =====================================================================
+
+@node grap, grefer, ggrn, Preprocessors
+@section @code{grap}
@cindex @code{grap}
+A free implementation of @code{grap}, written by Ted Faber,
+is available as an extra package from the following address:
+
+@display
+@url{http://www.lunabase.org/~faber/Vault/software/grap/}
+@end display
+
+@c =====================================================================
-@node grefer, gsoelim, grap, Top
-@chapter @code{grefer}
+@node grefer, gsoelim, grap, Preprocessors
+@section @code{grefer}
@cindex @code{refer}
@cindex @code{grefer}
+@c XXX
@menu
* Invoking grefer::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grefer, , grefer, grefer
-@section Invoking @code{grefer}
+@subsection Invoking @code{grefer}
@cindex invoking @code{grefer}
@cindex @code{grefer}, invoking
+@c XXX
+
+@c =====================================================================
-@node gsoelim, Devices, grefer, Top
-@chapter @code{gsoelim}
+@node gsoelim, , grefer, Preprocessors
+@section @code{gsoelim}
@cindex @code{soelim}
@cindex @code{gsoelim}
+@c XXX
@menu
* Invoking gsoelim::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking gsoelim, , gsoelim, gsoelim
-@section Invoking @code{gsoelim}
+@subsection Invoking @code{gsoelim}
@cindex invoking @code{gsoelim}
@cindex @code{gsoelim}, invoking
+@c XXX
-@node Devices, File formats, gsoelim, Top
-@chapter Devices
-@cindex devices
+@c =====================================================================
+@c =====================================================================
+@node Output Devices, File formats, Preprocessors, Top
+@chapter Output Devices
+@cindex output devices
+@cindex devices for output
+
+@c XXX
@menu
* Special Characters::
@@ -5208,222 +7945,343 @@ the new @code{\?} escape sequence. @xref{Diversions}, for more information.
* grops::
* grodvi::
* grolj4::
+* grolbp::
* grohtml::
* gxditview::
@end menu
-@node Special Characters, grotty, Devices, Devices
+
+@c =====================================================================
+
+@node Special Characters, grotty, Output Devices, Output Devices
@section Special Characters
@cindex special characters
@cindex characters, special
+@c XXX
+
+@xref{Font Files}.
+
-@c distribute these through the text
-@xref{Font Files}
+@c =====================================================================
-@node grotty, grops, Special Characters, Devices
+@node grotty, grops, Special Characters, Output Devices
@section @code{grotty}
@cindex @code{grotty}
-
+@c XXX
@menu
* Invoking grotty::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grotty, , grotty, grotty
@subsection Invoking @code{grotty}
@cindex invoking @code{grotty}
@cindex @code{grotty}, invoking
+@c XXX
+
+@c =====================================================================
-@node grops, grodvi, grotty, Devices
+@node grops, grodvi, grotty, Output Devices
@section @code{grops}
@cindex @code{grops}
-
+@c XXX
@menu
* Invoking grops::
* Embedding PostScript::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grops, Embedding PostScript, grops, grops
@subsection Invoking @code{grops}
@cindex invoking @code{grops}
@cindex @code{grops}, invoking
+@c XXX
+@c ---------------------------------------------------------------------
@node Embedding PostScript, , Invoking grops, grops
-@subsection Embedding PostScript
+@subsection Embedding @sc{PostScript}
@cindex embedding postscript
@cindex postscript, embedding
+@c XXX
+
+@c =====================================================================
-@node grodvi, grolj4, grops, Devices
+@node grodvi, grolj4, grops, Output Devices
@section @code{grodvi}
@cindex @code{grodvi}
-
+@c XXX
@menu
* Invoking grodvi::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grodvi, , grodvi, grodvi
@subsection Invoking @code{grodvi}
@cindex invoking @code{grodvi}
@cindex @code{grodvi}, invoking
+@c XXX
-@node grolj4, grohtml, grodvi, Devices
+@c =====================================================================
+
+@node grolj4, grolbp, grodvi, Output Devices
@section @code{grolj4}
@cindex @code{grolj4}
-
+@c XXX
@menu
* Invoking grolj4::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grolj4, , grolj4, grolj4
@subsection Invoking @code{grolj4}
@cindex invoking @code{grolj4}
@cindex @code{grolj4}, invoking
+@c XXX
+
+
+@c =====================================================================
+
+@node grolbp, grohtml, grolj4, Output Devices
+@section @code{grolbp}
+@cindex @code{grolbp}
+
+@c XXX
+
+@menu
+* Invoking grolbp::
+@end menu
+
+@c ---------------------------------------------------------------------
+@node Invoking grolbp, , grolbp, grolbp
+@subsection Invoking @code{grolbp}
+@cindex invoking @code{grolbp}
+@cindex @code{grolbp}, invoking
-@node grohtml, gxditview, grolj4, Devices
+@c XXX
+
+
+@c =====================================================================
+
+@node grohtml, gxditview, grolbp, Output Devices
@section @code{grohtml}
@cindex @code{grohtml}
-
+@c XXX
@menu
* Invoking grohtml::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking grohtml, , grohtml, grohtml
@subsection Invoking @code{grohtml}
@cindex invoking @code{grohtml}
@cindex @code{grohtml}, invoking
+@c XXX
+
+@c =====================================================================
-@node gxditview, , grohtml, Devices
+@node gxditview, , grohtml, Output Devices
@section @code{gxditview}
@cindex @code{gxditview}
-
+@c XXX
@menu
* Invoking gxditview::
@end menu
+@c ---------------------------------------------------------------------
+
@node Invoking gxditview, , gxditview, gxditview
@subsection Invoking @code{gxditview}
@cindex invoking @code{gxditview}
@cindex @code{gxditview}, invoking
+@c XXX
+@c X11's xditview
+
-@node File formats, Installation, Devices, Top
+@c =====================================================================
+@c =====================================================================
+
+@node File formats, Installation, Output Devices, Top
@chapter File formats
@cindex file formats
@cindex formats, file
-
+@c XXX
@menu
* gtroff Output::
* Font Files::
@end menu
+
+@c =====================================================================
+
@node gtroff Output, Font Files, File formats, File formats
@section @code{gtroff} Output
@cindex @code{gtroff} output
@cindex output, @code{gtroff}
+This section describes the format output of GNU @code{troff}. The
+output format used by GNU @code{troff} is very similar to that used by
+@acronym{UNIX} device-independent @code{troff} (@code{ditroff}).
+
+@menu
+* Output Format::
+* Device Control::
+* Drawing Functions::
+* Line Continuation::
+@end menu
-This section describes the format output by GNU troff. The output
-format used by GNU troff is very similar to that used by @sc{Unix}
-device-independent troff.
+@c ---------------------------------------------------------------------
-The output format is ascii based, as opposed to a binary format (like
-@TeX{} dvi).
-The output format is 8 bit clean, thus single characters can have the
-eighth bit set, as can the names of fonts and special characters.
+@node Output Format, Device Control, gtroff Output, gtroff Output
+@subsection Output Format
+@cindex output format
+@cindex format of output
+
+@cindex 8-bit input
+@cindex input, 8-bit
+The output format is text based, as opposed to a binary format (like
+@TeX{} DVI). The output format is @w{8-bit} clean, thus single
+characters can have the eighth bit set, as can the names of fonts and
+special characters.
The output format consists of single command characters with attached
-parameters which are separated from subsequent text by whitespace, or
-a newline.
+parameters which are separated from subsequent text by whitespace or a
+newline.
-The names of characters and fonts an be of arbitrary length; drivers
+The names of characters and fonts can be of arbitrary length; drivers
should not assume that they will be only two characters long (as
-device-independent troff did).
+@code{ditroff} does).
When a character is to be printed, that character will always be in the
-current font.
-Unlike device-independent troff, it is not necessary for
-drivers to search special fonts to find a character.
+current font. Unlike @code{ditroff}, it is not necessary for drivers to
+search special fonts to find a character.
@table @code
@item H@var{n}
+@c XXX
+
@item V@var{n}
+@c XXX
+
@item h@var{n}
+@c XXX
+
@item v@var{n}
+@c XXX
+
@item c@var{n}
+@c XXX
+
@item C@var{n}
+@c XXX
+
@item @var{nn}@var{c}
+@c XXX
+
@item t@var{xxx}
@var{xxx} is any sequence of characters terminated by a space or a
-newline; the first character should be printed at the current
-position, the the current horizontal position should be increased by
-the width of the first character, and so on for each character.
-The width of the character is that given in the font file,
-appropriately scaled for the current point size,
-and rounded so that it is a multiple of the horizontal resolution.
-Special characters cannot be printed using this command.
-
-This command is only allowed if the @samp{tcommand} line is present
-in the @file{DESC} file.
+newline; the first character should be printed at the current position,
+the the current horizontal position should be increased by the width of
+the first character, and so on for each character. The width of the
+character is that given in the font file, appropriately scaled for the
+current point size, and rounded so that it is a multiple of the
+horizontal resolution. Special characters cannot be printed using this
+command.
+
+@kindex tcommand
+@pindex DESC@r{, and @code{tcommand}}
+This command is only allowed if the @samp{tcommand} line is present in
+the @file{DESC} file.
+
@item u@var{n} @var{xxx}
-@pindex DESC
-This is same as the @code{t} command except that after printing each
+This is same as the @samp{t} command except that after printing each
character, the current horizontal position is increased by the sum of
-the width of that character and @code{n}.
+the width of that character and@w{ }@var{n}.
+
+This command is only allowed if the @samp{tcommand} line is present in
+the @file{DESC} file.
-This command is only allowed if the @samp{tcommand} line is present
-in the @file{DESC} file.
@item n@var{a}@var{b}
+@c XXX
+
@item p@var{n}
+@c XXX
+
@item s@var{n}
-The argument to the s command is in scaled points (units of points/n,
-where n is the argument to the sizescale command in the DESC file.)
+@kindex sizescale
+@pindex DESC@r{, and @code{sizescale}}
+The argument to the @samp{s} command is in scaled points (units of
+points/@var{n}, where @var{n} is the argument to the @samp{sizescale}
+command in the @file{DESC} file).
+
@item f@var{n}
@item x @dots{} \n
Device control.
+@c XXX more info
+
@item D@var{c} @var{x}@dots{}\n
+@c XXX
@end table
+@c ---------------------------------------------------------------------
+
+@node Device Control, Drawing Functions, Output Format, gtroff Output
@subsection Device Control
+@cindex device control
+@cindex control of devices
-The @code{x} command is normally followed by a letter or word
-indicating the function to perform, followed by white space separated
-arguments.
+The @samp{x} command is normally followed by a letter or word indicating
+the function to perform, followed by white space separated arguments.
-The first argument can be abreviated to the first letter.
+The first argument can be abbreviated to the first letter.
@table @code
@item x init
+@c XXX
+
@item x T
+@c XXX
+
@item x res @var{n} @var{h} @var{v}
+@c XXX
+
@item x H
-The argument to the x Height command is also in scaled points.
+@c XXX more info
+The argument to the @w{@samp{x Height}} command is also in scaled
+points.
@end table
The first three output commands are guaranteed to be:
@@ -5434,263 +8292,377 @@ x res n h v
x init
@end example
-For example, the input @samp{crunchy \fH\s+2frog\s0\fP!?} will produce:
+@noindent
+For example, the input
+
+@example
+crunchy \fH\s+2frog\s0\fP!?
+@end example
+
+@noindent
+will produce
+
+@c XXX example
+@ignore
@example
... sample output here ...
@end example
+@end ignore
+
+@c ---------------------------------------------------------------------
+@node Drawing Functions, Line Continuation, Device Control, gtroff Output
@subsection Drawing Functions
+@cindex drawing functions
+@cindex functions for drawing
-The D drawing command has been extended. These extensions will only be
-used by GNU pic if the -x option is given.
+@pindex gpic
+The @samp{D} drawing command has been extended. These extensions will
+only be used by GNU @code{pic} if the @option{-x} option is given.
+
+@xref{Drawing Requests}.
@table @code
-...
-@item Df n\n
-Set the shade of gray to be used for filling solid objects to n; n must
-be an integer between 0 and 1000, where 0 corresponds solid white and
-1000 to solid black, and values in between correspond to intermediate
-shades of gray. This applies only to solid circles, solid ellipses and
-solid polygons. By default, a level of 1000 will be used. Whatever
-color a solid object has, it should completely obscure everything
-beneath it. A value greater than 1000 or less than 0 can also be used:
-this means fill with the shade of gray that is currently being used for
-lines and text. Normally this will be black, but some drivers may
-provide a way of changing this.
-@item DC d\n
-Draw a solid circle with a diameter of d with the leftmost point at the
-current position.
-@item DE dx dy\n
-Draw a solid ellipse with a horizontal diameter of dx and a vertical
-diameter of dy with the leftmost point at the current position.
-@item Dp $dx sub 1$ $dy sub 1$ $dx sub 2$ $dy sub 2$ $...$ $dx sub n$ $dy sub
-n$\n
-Draw a polygon with, for $i = 1 ,..., n+1$, the i-th vertex at the
-current position $+ sum from j=1 to i-1 ( dx sub j , dy sub j )$. At
-the moment, GNU pic only uses this command to generate triangles and
-rectangles.
-@item DP $dx sub 1$ $dy sub 1$ $dx sub 2$ $dy sub 2$ $...$ $dx sub n$ $dy sub
-n$\n
-Like Dp but draw a solid rather than outlined polygon.
-@item Dt n\n
-Set the current line thickness to n machine units. Traditionally @sc{Unix}
-troff drivers use a line thickness proportional to the current point
-size; drivers should continue to do this if no Dt command has been
-given, or if a Dt command has been given with a negative value of n. A
-zero value of n selects the smallest available line thickness.
+@c XXX ...
+@item Df @var{n}
+Set the shade of gray to be used for filling solid objects to@w{
+}@var{n}; @var{n}@w{ }must be an integer between 0 and@w{ }1000, where 0
+corresponds solid white and 1000 to solid black, and values in between
+correspond to intermediate shades of gray. This applies only to solid
+circles, solid ellipses and solid polygons. By default, a level of@w{
+}1000 will be used. Whatever color a solid object has, it should
+completely obscure everything beneath it. A value greater than@w{ }1000
+or less than@w{ }0 can also be used: this means fill with the shade of
+gray that is currently being used for lines and text. Normally this
+will be black, but some drivers may provide a way of changing this.
+
+@item DC @var{d}
+Draw a solid circle with a diameter of@w{ }@var{d} with the leftmost
+point at the current position.
+
+@item DE @var{dx} @var{dy}
+Draw a solid ellipse with a horizontal diameter of@w{ }@var{dx} and a
+vertical diameter of@w{ }@var{dy} with the leftmost point at the current
+position.
+
+@item Dp @var{dx1} @var{dy1} @var{dx2} @var{dy2} @dots{} @var{dxn} @var{dyn}
+Draw a polygon with. The first vertex is at the current position, the
+second vertex at an offset (@var{dx1},@var{dy1}) from the current
+position, the second vertex at an offset (@var{dx2},@var{dy2}) from the
+first vertex, and so on up to the @var{n}-th vertex. At the moment, GNU
+@code{pic} only uses this command to generate triangles and rectangles.
+
+@item DP @var{dx1} @var{dy1} @var{dx2} @var{dy2} @dots{} @var{dxn} @var{dyn}
+Like @code{Dp} but draw a solid rather than outlined polygon.
+
+@item Dt @var{n}
+@cindex line thickness
+@cindex thickness of lines
+Set the current line thickness to @var{n}@w{ }machine units.
+Traditionally, @acronym{UNIX} @code{troff} drivers use a line thickness
+proportional to the current point size; drivers should continue to do
+this if no @code{Dt} command has been given, or if a @code{Dt} command
+has been given with a negative value of@w{ }@var{n}. A zero value of@w{
+}@var{n} selects the smallest available line thickness.
@end table
+@findex \D
A difficulty arises in how the current position should be changed after
-the execution of these commands. This is not of great importance since
-the code generated by GNU pic does not depend on this. Given a drawing
-command of the form
+the execution of these commands. This is not of great importance since
+the code generated by GNU @code{pic} does not depend on this. Given a
+drawing command of the form
-\D'c $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ $x sub n$ $y sub n$'
+@example
+\D'@var{c} @var{x1} @var{y1} @var{x2} @var{y2} @dots{} @var{xn} @var{yn}'
+@end example
+
+@findex \w
+@vindex st
+@findex sb
+@noindent
+where @var{c} is not one of @samp{c}, @samp{e}, @samp{l}, @samp{a} or
+@samp{~}, @acronym{UNIX} @code{troff} will treat each of the x@w{ }value
+as a horizontal quantity, and each of the y@w{ }values as a vertical
+quantity and will assume that the width of the drawn object is sum if
+all x@w{ }values, and that the height is the sum of all y@w{ }values.
+(The assumption about the height can be seen by examining the @code{st}
+and @code{sb} registers after using such a @code{D}@w{ }command in a
+@code{\w} escape sequence.) This rule also holds for all the original
+drawing commands with the exception of @code{De}. For the sake of
+compatibility GNU @code{troff} also follows this rule, even though it
+produces an ugly result in the case of the @code{Df}, @code{Dt}, and, to
+a lesser extent, @code{DE}@w{ }commands. Thus after executing a
+@code{D}@w{ }command of the form
-where c is not one of c, e, l, a or ~, @sc{Unix} troff will treat each of the
-$x sub i$ as a horizontal quantity, and each of the $y sub i$ as a
-vertical quantity and will assume that the width of the drawn object is
-$sum from i=1 to n x sub i$, and that the height is $sum from i=1 to n y
-sub i$. (The assumption about the height can be seen by examining the
-st and sb registers after using such a D command in a \w escape
-sequence.) This rule also holds for all the original drawing commands
-with the exception of De. For the sake of compatibility GNU troff also
-follows this rule, even though it produces an ugly result in the case of
-the Df, Dt, and, to a lesser extent, DE commands. Thus after executing
-a D command of the form
+@example
+D@var{c} @var{x1} @var{y1} @var{x2} @var{y2} @dots{} @var{xn} @var{yn}
+@end example
-Dc $x sub 1$ $y sub 1$ $x sub 2$ $y sub 2$ $...$ $x sub n$ $y sub n$\n
+@noindent
+the current position should be increased horizontally by the sum of all
+x@w{ }values and vertically by the sum of all y@w{ }values.
-the current position should be increased by $( sum from i=1 to n x sub i
-, sum from i=1 to n y sub i )$.
+@c ---------------------------------------------------------------------
+@node Line Continuation, , Drawing Functions, gtroff Output
@subsection Line Continuation
+@cindex line continuation in output commands
+@cindex output commands, line continuation
-There is a continuation convention which permits the argument to the x X
-command to contain newlines: when outputting the argument to the x X
-command, GNU troff will follow each newline in the argument with a +
-character (as usual, it will terminate the entire argument with a
-newline); thus if the line after the line containing the x X command
-starts with +, then the newline ending the line containing the x X
-command should be treated as part of the argument to the x X command,
-the + should be ignored, and the part of the line following the + should
-be treated like the part of the line following the x X command.
-
+There is a continuation convention which permits the argument to the
+@w{@samp{x X}} command to contain newlines: When outputting the argument
+to the @w{@samp{x X}} command, GNU @code{troff} will follow each newline
+in the argument with a @samp{+} character (as usual, it will terminate
+the entire argument with a newline); thus if the line after the line
+containing the @w{@samp{x X}} command starts with @samp{+}, then the
+newline ending the line containing the @w{@samp{x X}} command should be
+treated as part of the argument to the @w{@samp{x X}} command, the
+@samp{+} should be ignored, and the part of the line following the
+@samp{+} should be treated like the part of the line following the
+@w{@samp{x X}} command.
+@c =====================================================================
@node Font Files, , gtroff Output, File formats
@section Font Files
@cindex font files
@cindex files, font
+The @code{gtroff} font format is roughly a superset of the
+@code{ditroff} font format. Unlike the @code{ditroff} font format,
+there is no associated binary format; all files are text files. The
+font files for device @var{name} are stored in a directory
+@file{dev@var{name}}. There are two types of file: a device description
+file called @file{DESC} and for each font@w{ }@var{f} a font file
+called@w{ }@file{@var{f}}.
-The groff font format is roughly a superset of the ditroff font
-format. Unlike the ditroff font format, there is no associated binary
-format. The font files for device name are stored in a directory
-@file{dev@var{name}}. There are two types of file: a device
-description file called @file{DESC} and for each font @samp{F} a font
-file called @file{F}. These are text files; there is no associated
-binary format.
+@menu
+* DESC file format::
+* Font file format::
+@end menu
+@c ---------------------------------------------------------------------
+
+@node DESC file format, Font file format, Font Files, Font Files
@subsection @file{DESC} file format
-@pindex DESC
+@cindex @file{DESC} file format
+@cindex font description file format
+@cindex format of font description file
+@pindex DESC@r{ file format}
The @file{DESC} file can contain the following types of line:
@table @code
@item res @var{n}
+@kindex res
There are @var{n} machine units per inch.
+
@item hor @var{n}
+@kindex hor
The horizontal resolution is @var{n} machine units.
+
@item vert @var{n}
+@kindex vert
The vertical resolution is @var{n} machine units.
+
@item sizescale @var{n}
-The scale factor for pointsizes. By default this has a value of 1. One
-scaled point is equal to one point/@var{n}. The arguments to the
+@kindex sizescale
+The scale factor for point sizes. By default this has a value of@w{ }1.
+One scaled point is equal to one point/@var{n}. The arguments to the
@code{unitwidth} and @code{sizes} commands are given in scaled points.
@xref{Fractional Type Sizes}, for more information.
+
@item unitwidth @var{n}
-Quantities in the font files are given in machine units for fonts whose
-point size is @var{n} scaled points.
+@kindex unitwidth
+Quantities in the font files are given in machine units for fonts whose
+point size is @var{n}@w{ }scaled points.
+
@item tcommand
-This means that the postprocessor can handle the @code{t} and
-@code{u} output commands.
-@item sizes @var{s1} @var{s2}@dots{}@var{sn} 0
-This means that the device has fonts at @var{s1}, @var{s2},
-@dots{}@var{sn} scaled points. The list of sizes must be terminated
-by a 0. Each @var{si} can also be a range of
-sizes @var{m}-@var{n}. The list can extend over more than one line.
-@item styles @var{S1 S2@dots{}Sm}
-The first @var{m} font positions will be associated with styles
-@var{S1}@dots{}@var{Sm}.
-@item fonts @var{n} @var{F1 F2 F3@dots{}Fn}
-Fonts @var{F1@dots{}Fn} will be mounted in the font positions
-@var{m}+1, @dots{}, @var{m}+@var{n} where @var{m}
-is the number of styles. This command may extend over more than one
-line. A font name of 0 will cause no font to be mounted on the
-corresponding font position.
+@kindex tcommand
+This means that the postprocessor can handle the @samp{t} and @samp{u}
+output commands.
+
+@item sizes @var{s1} @var{s2} @dots{} @var{sn} 0
+@kindex sizes
+This means that the device has fonts at @var{s1}, @var{s2}, @dots{}
+@var{sn} scaled points. The list of sizes must be terminated by a@w{
+}0. Each @var{si} can also be a range of sizes @var{m}-@var{n}. The
+list can extend over more than one line.
+
+@item styles @var{S1} @var{S2} @dots{} @var{Sm}
+@kindex styles
+The first @var{m}@w{ }font positions will be associated with styles
+@var{S1} @dots{} @var{Sm}.
+
+@item fonts @var{n} @var{F1} @var{F2} @var{F3} @dots{} @var{Fn}
+@kindex fonts
+Fonts @var{F1} @dots{} @var{Fn} will be mounted in the font positions
+@var{m}+1, @dots{}, @var{m}+@var{n} where @var{m} is the number of
+styles. This command may extend over more than one line. A font name
+of@var{ }0 will cause no font to be mounted on the corresponding font
+position.
+
@item family @var{fam}
+@kindex family
The default font family is @var{fam}.
+
@item charset
+@kindex charset
This line and everything following in the file are ignored. It is
allowed for the sake of backwards compatibility.
@end table
The @code{res}, @code{unitwidth}, @code{fonts} and @code{sizes} lines
-are compulsory. Other commands are ignored by troff but may be used
-by postprocessors to store arbitrary information about the device in
-the @file{DESC} file.
+are mandatory. Other commands are ignored by @code{gtroff} but may be
+used by postprocessors to store arbitrary information about the device
+in the @file{DESC} file.
+@c XXX add other commands resp. xrefs to output devices
+@c XXX add obsolete commands
+@c ---------------------------------------------------------------------
+
+@node Font file format, , DESC file format, Font Files
@subsection Font file format
+@cindex font file format
+@cindex format of font files
A font file has two sections. The first section is a sequence of lines
each containing a sequence of blank delimited words; the first word in
the line is a key, and subsequent words give a value for that key.
@table @code
-@item name @var{F}
-The name of the font is @var{F}.
+@item name @var{f}
+@kindex name
+The name of the font is@w{ }@var{f}.
+
@item spacewidth @var{n}
-The normal width of a space is @var{n}.
+@kindex spacewidth
+The normal width of a space is@w{ }@var{n}.
+
@item slant @var{n}
-The characters of the font have a slant of @var{n} degrees.
+@kindex slant
+The characters of the font have a slant of @var{n}@w{ }degrees.
(Positive means forward.)
-@item ligatures @var{lig1} @var{lig2}@dots{}@var{lign} [0]
+
+@item ligatures @var{lig1} @var{lig2} @dots{} @var{lign} [0]
+@kindex ligatures
Characters @var{lig1}, @var{lig2}, @dots{}, @var{lign} are ligatures;
-possible ligatures are ff, fi, fl and ffl. For backwards
-compatibiliy, the list of ligatures may be terminated with a 0. The
-list of ligatures may not extend over more than one line.
+possible ligatures are @samp{ff}, @samp{fi}, @samp{fl}, @samp{ffi} and
+@samp{ffl}. For backwards compatibility, the list of ligatures may be
+terminated with a@w{ }0. The list of ligatures may not extend over more
+than one line.
+
@item special
+@kindex special
The font is special; this means that when a character is requested that
is not present in the current font, it will be searched for in any
special fonts that are mounted.
@end table
-Other commands are ignored by troff but may be used by postprocessors to
-store arbitrary information about the font in the font file.
+Other commands are ignored by @code{gtroff} but may be used by
+postprocessors to store arbitrary information about the font in the font
+file.
-The first section can contain comments which start with the # character
-and extend to the end of a line.
+@cindex comments in font files
+@cindex font files, comments
+@kindex #
+The first section can contain comments which start with the @samp{#}
+character and extend to the end of a line.
The second section contains one or two subsections. It must contain a
@code{charset} subsection and it may also contain a @code{kernpairs}
subsection. These subsections can appear in any order. Each
subsection starts with a word on a line by itself.
-The word @code{charset} starts the @code{charset} subsection. The
-@code{charset} line is followed by a sequence of lines. Each line
-gives information for one character. A line comprises a number of
-fields separated by blanks or tabs. The format is
+@kindex charset
+The word @code{charset} starts the character set subsection. The
+@code{charset} line is followed by a sequence of lines. Each line gives
+information for one character. A line comprises a number of fields
+separated by blanks or tabs. The format is
-@display
+@c XXX fix it for new HTML additions
+
+@example
@var{name} @var{metrics} @var{type} @var{code} @var{comment}
-@end display
+@end example
-@var{name} identifies the character: if @var{name} is a single
-character @var{c} then it corresponds to the groff input character
-@var{c}; if it is of the form @samp{\@var{c}} where @var{c} is a
-single character, then it corresponds to the groff input character
-@samp{\@var{c}}; otherwise it corresponds to the groff input character
-@samp{\[@var{name}]} (if it is exactly two characters @var{xx} it can
-be entered as @samp{\(@var{xx}}.) Groff supports eight bit characters;
-however some utilities has difficulties with eight bit characters.
-For this reason, there is a convention that the @var{name}
-@samp{char@var{n}} is equivalent to the single character whose code is
-@var{n}. For example, @samp{char163} would be equivalent to the
-character with @var{code} 163 which is the pounds sterling sign in ISO
-Latin-1 character set. The name @samp{---} is special and indicates
-that the character is unnamed; such characters can only be used by
-means of the @code{\N} escape sequence in troff.
+@cindex 8-bit input
+@cindex input, 8-bit
+@findex \N
+@kindex ---
+@noindent
+@var{name} identifies the character: If @var{name} is a single
+character@w{ }@var{c} then it corresponds to the @code{gtroff} input
+character @var{c}; if it is of the form @samp{\@var{c}} where @var{c} is
+a single character, then it corresponds to the @code{gtroff} input
+character@w{ }\@var{c}; otherwise it corresponds to the groff input
+character @samp{\[@var{name}]}. (If it is exactly two characters
+@var{xx} it can be entered as @samp{\(@var{xx}}.) @code{gtroff}
+supports 8-bit characters; however some utilities have difficulties with
+eight-bit characters. For this reason, there is a convention that the
+name @samp{char@var{n}} is equivalent to the single character whose code
+is@w{ }@var{n}. For example, @samp{char163} would be equivalent to the
+character with code@w{ }163 which is the pounds sterling sign in @w{ISO
+Latin-1} character set. The name @samp{---} is special and indicates
+that the character is unnamed; such characters can only be used by means
+of the @code{\N} escape sequence in @code{gtroff}.
+
+@c XXX input encodings vs. output encodings
The @var{type} field gives the character type:
@table @code
@item 1
-means the character has an descender, for example, p;
+the character has an descender, for example, `p';
+
@item 2
-means the character has an ascender, for example, b;
+the character has an ascender, for example, `b';
+
@item 3
-means the character has both an ascender and a descender, for example,
-@samp{(}.
+the character has both an ascender and a descender, for example, `('.
@end table
The @var{code} field gives the code which the postprocessor uses to
-print the character. The character can also be input to groff using
-this code by means of the @code{\N} escape sequence. The code can be any
-integer. If it starts with a 0 it will be interpreted as octal; if it
-starts with 0x or 0X it will be intepreted as hexdecimal.
+print the character. The character can also be input to @code{gtroff}
+using this code by means of the @code{\N} escape sequence. The code can
+be any integer. If it starts with @samp{0} it will be interpreted as
+octal; if it starts with @samp{0x} or @samp{0X} it will be interpreted as
+hexadecimal.
Anything on the line after the @var{code} field will be ignored.
The @var{metrics} field has the form:
-@smallexample
-@var{width[,height[,depth[,italic_correction[,left_italic_correction[,subscript_correction]]]]]}
-@end smallexample
+@example
+@var{width}[,@var{height}[,@var{depth}[,@var{italic_correction}
+ [,@var{left_italic_correction}[,@var{subscript_correction}]]]]]
+@end example
-There must not be any spaces between these subfields. Missing
-subfields are assumed to be 0. The subfields are all decimal
-integers. Since there is no associated binary format, these values
-are not required to fit into a variable of type @samp{char} as they
-are in ditroff. The @var{width} subfields gives the width of the
-character. The @var{height} subfield gives the height of the
-character (upwards is positive); if a character does not extend above
-the baseline, it should be given a zero height, rather than a negative
-height. The @var{depth} subfield gives the depth of the character,
-that is, the distance below the lowest point below the baseline to
-which the character extends (downwards is positive); if a character
-does not extend below above the baseline, it should be given a zero
-depth, rather than a negative depth. The @var{italic_correction}
-subfield gives the amount of space that should be added after the
-character when it is immediately to be followed by a character from a
-roman font. The @var{left_italic_correction} subfield gives the
-amount of space that should be added before the character when it is
-immediately to be preceded by a character from a roman font. The
+@noindent
+There must not be any spaces between these subfields (it has been split
+here into two lines for better legibility only). Missing subfields are
+assumed to be@w{ }0. The subfields are all decimal integers. Since
+there is no associated binary format, these values are not required to
+fit into a variable of type @samp{char} as they are in @code{ditroff}.
+The @var{width} subfield gives the width of the character. The
+@var{height} subfield gives the height of the character (upwards is
+positive); if a character does not extend above the baseline, it should
+be given a zero height, rather than a negative height. The @var{depth}
+subfield gives the depth of the character, that is, the distance below
+the lowest point below the baseline to which the character extends
+(downwards is positive); if a character does not extend below above the
+baseline, it should be given a zero depth, rather than a negative depth.
+The @var{italic_correction} subfield gives the amount of space that
+should be added after the character when it is immediately to be
+followed by a character from a Roman font. The
+@var{left_italic_correction} subfield gives the amount of space that
+should be added before the character when it is immediately to be
+preceded by a character from a Roman font. The
@var{subscript_correction} gives the amount of space that should be
-added after a character before adding a subscript. This should be less
+added after a character before adding a subscript. This should be less
than the italic correction.
A line in the @code{charset} section can also have the format
@@ -5699,58 +8671,122 @@ A line in the @code{charset} section can also have the format
@var{name} "
@end example
+@noindent
This indicates that @var{name} is just another name for the character
mentioned in the preceding line.
+@kindex kernpairs
The word @code{kernpairs} starts the kernpairs section. This contains a
sequence of lines of the form:
-@display
-@var{c1 c2 n}
-@end display
+@example
+@var{c1} @var{c2} @var{n}
+@end example
This means that when character @var{c1} appears next to character
-@var{c2} the space between them should be increased by @var{n}. Most
-entries in kernpairs section will have a negative value for @var{n}.
+@var{c2} the space between them should be increased by@w{ }@var{n}.
+Most entries in kernpairs section will have a negative value for@w{
+}@var{n}.
+
+@c =====================================================================
+@c =====================================================================
-@node Installation, Request Index, File formats, Top
+@node Installation, Request and Escape Index, File formats, Top
@chapter Installation
@cindex installation
+@c XXX
+
+
+@c =====================================================================
+@c =====================================================================
-@node Request Index, Register Index, Installation, Top
-@chapter Request Index
+@node Request and Escape Index, Operator Index, Installation, Top
+@chapter Request and Escape Index
+
+In this index, escapes are listed with a leading backslash (@samp{\}) to
+distinguish them from requests which appear without the leading control
+character (normally either @samp{.} or @samp{'}).
@printindex fn
-@node Register Index, String Index, Request Index, Top
+
+@c =====================================================================
+@c =====================================================================
+
+@node Operator Index, Register Index, Request and Escape Index, Top
+@chapter Operator Index
+
+@printindex op
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Register Index, Macro and String Index, Operator Index, Top
@chapter Register Index
@printindex vr
-@node String Index, Macro Index, Register Index, Top
-@chapter String Index
+@c =====================================================================
+@c =====================================================================
+
+@node Macro and String Index, Glyph Name Index, Register Index, Top
+@chapter Macro and String Index
+
+In this index, strings are listed with the calling escape sequence
+(@samp{\*}) to distinguish them from macros which appear without the
+leading control character (normally either @samp{.} or @samp{'}).
+
+@printindex ma
-@node Macro Index, Program Index, String Index, Top
-@chapter Macro Index
+@c =====================================================================
+@c =====================================================================
+@node Glyph Name Index, Font File Keyword Index, Macro and String Index, Top
+@chapter Glyph Name Index
-@node Program Index, Concept Index, Macro Index, Top
-@chapter Program Index
+A glyph name @code{xx} consisting of exactly two characters can be
+accessed as @samp{\(xx}. Glyph names @code{xxx} of any length can be
+accessed as @samp{\[xxx]}.
+
+@printindex gl
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Font File Keyword Index, Program and File Index, Glyph Name Index, Top
+@chapter Font File Keyword Index
+
+@printindex ky
+
+
+
+@c =====================================================================
+@c =====================================================================
+
+@node Program and File Index, Concept Index, Font File Keyword Index, Top
+@chapter Program and File Index
@printindex pg
-@node Concept Index, , Program Index, Top
+@c =====================================================================
+@c =====================================================================
+
+@node Concept Index, , Program and File Index, Top
@chapter Concept Index
@printindex cp
diff --git a/contrib/groff/doc/homepage.ms b/contrib/groff/doc/homepage.ms
new file mode 100644
index 0000000..b542d73
--- /dev/null
+++ b/contrib/groff/doc/homepage.ms
@@ -0,0 +1,162 @@
+.\" This file gives a small example how a web page could look like if created
+.\" with groff.
+.\"
+.\"
+.\" To make it work with other output devices also, we include tmac.arkup
+.\" directly.
+.mso tmac.arkup
+.\"
+.LP
+.\"
+.\" set a longer line than the default as we have some long ftp addresses
+.\" which groff cannot split
+.nr LL 7i
+.TL
+Home of Groff (GNU Troff).
+.sp 1i
+.LP
+GNU Troff
+.URL (Groff) http://groff.ffii.org/
+\(em a
+.URL GNU http://www.gnu.org/
+project.
+Hosted by
+.URL FFII http://ffii.org/ .
+.br
+.LINE
+.LP
+Groff (GNU Troff) is a document processor which reads plain text mixed with
+formatting commands and produces formatted output.
+.LP
+Groff now supports HTML for the Web.
+Please see
+.URL "Groff Web Tips" "#Web Tips" .
+.sp
+.SH
+Download
+.LP
+.URL Germany "ftp://groff.ffii.org/pub/groff/"
+|
+.URL USA "ftp://ftp.gnu.org/gnu/groff/"
+.LP
+.URL License http://www.gnu.org/copyleft/gpl.html
+|
+.URL "Mailing list" http://ffii.org/mailman/listinfo/groff/
+|
+.URL "Groff for Windows" "http://www.cs.vu.nl/~tmgil/misc/wingroff.html"
+.sp
+User issues lead:
+.MAILTO Ted.Harding@nessie.mcc.ac.uk "Ted Harding"
+.br
+Technical issues lead:
+.MAILTO wl@gnu.org "Werner Lemberg"
+.SH
+README
+.LP
+This is the GNU groff document formatting system.
+The version number is given in the file VERSION.
+.LP
+Included in this release are implementations of troff, pic, eqn, tbl, refer,
+the -man macros and the -ms macros, and drivers for PostScript, TeX dvi
+format, HP LaserJet 4 printers, HTML format (still alpha), and
+typewriter-like devices.
+Also included is a modified version of the Berkeley -me macros, an enhanced
+version of the X11 xditview previewer, and an implementation of the -mm
+macros contributed by
+.MAILTO jh@axis.se "J\(:orgen H\(:agg" .
+.LP
+See the file INSTALL for installation instructions.
+You will require a C++ compiler.
+.LP
+The file NEWS describes recent user-visible changes to groff.
+.LP
+Groff is free software.
+See the file COPYING for copying permission.
+.LP
+The file PROBLEMS describes various problems that have been encountered in
+compiling, installing, and running groff.
+.LP
+For the moment, the documentation assumes that you are already familiar with
+the Unix versions of troff, -man, -ms and the preprocessors.
+.LP
+The most recent released version of groff is always available by anonymous
+ftp from ftp.gnu.org in the directory pub/gnu/groff.
+.LP
+A CVS repository is now available, containing the current development
+version of groff.
+You can access it with the commands:
+.sp
+.RS
+.nf
+\fC
+export CVSROOT=:pserver:anoncvs@anoncvs.ffii.org:/var/cvs
+cvs login
+cvs -z9 co groff
+\fR
+.fi
+.RE
+.sp
+.LP
+(if the prompt for the password appears, just press the enter key).
+After a successful login you no longer need the first two commands; an
+update of a checked out repository should be done with:
+.sp
+.RS
+\fC
+cvs -z9 update -dP
+\fR
+.RE
+.sp
+.LP
+Please read the info pages of cvs for further details.
+.LP
+Alternatively, you can download snapshots (which are updated twice a day)
+from
+.URL here ftp://ftp.ffii.org/pub/groff/devel/groff-current.tar.gz
+or a diff file relative to the latest official groff release as:
+.sp
+.RS
+\fC
+ftp://ftp.ffii.org/pub/groff/devel/groff-[version]-current.diff.gz
+\fR
+.RE
+.sp
+.LP
+Please report bugs using the form in the file BUG-REPORT; the idea of this
+is to make sure that FSF has all the information it needs to fix the bug.
+At the very least, read the BUG-REPORT form and make sure that you supply
+all the information that it asks for.
+Even if you are not sure that something is a bug, report it using
+BUG-REPORT: this will enable us to determine whether it really is a bug or
+not.
+.LP
+Three mailing lists are available:
+.sp
+.RS
+.nf
+\fC
+bug-groff@gnu.org for reporting bugs
+groff@gnu.org for general discussion of groff
+groff-commit@ffii.org a read-only list showing logs of
+ commitments to the CVS repository
+\fR
+.fi
+.RE
+.sp
+.LP
+Note that groff@gnu.org is an alias for groff@ffii.org; you must be
+subscribed to the `groff' and `groff-commit' lists to send mails.
+.LP
+To subscribe, send e-mail to [list]-request@[domain] (example:
+groff-request@ffii.org) with the word `subscribe' in either the
+subject or body of the e-mail (don't include the quotes).
+.LP
+GNU groff was written by
+.MAILTO jjc@jclark.com "James Clark" .
+It is now maintained by
+.MAILTO Ted.Harding@nessie.mcc.ac.uk "Ted Harding"
+and
+.MAILTO wl@gnu.org "Werner Lemberg" .
+.LINE
+.
+.\" EOF
diff --git a/contrib/groff/doc/meref.me b/contrib/groff/doc/meref.me
index 5a62ae1..445fcd7 100644
--- a/contrib/groff/doc/meref.me
+++ b/contrib/groff/doc/meref.me
@@ -1508,10 +1508,20 @@ End
picture (alternate form).
.TL
.b .GS
+.i x
.DE
Begin
.i gremlin
picture.
+.i X
+can be either
+.b C ,
+.b L ,
+or
+.b R
+to center, left, or right justify the
+whole picture.
+Default is centering the image.
.TL
.b .GE
.DE
diff --git a/contrib/groff/doc/pic.ms b/contrib/groff/doc/pic.ms
index 948617c..8553953 100644
--- a/contrib/groff/doc/pic.ms
+++ b/contrib/groff/doc/pic.ms
@@ -10,7 +10,7 @@
.\" This document was written for free use and redistribution by
.\" Eric S. Raymond <esr@thyrsus.com> in August 1995.
.\"
-.\" $Id: pic.ms,v 1.2 1999/12/04 08:57:07 wlemb Exp $
+.\" $Id: pic.ms,v 1.1.1.1 2000/02/06 09:39:20 wlemb Exp $
.\"
.\" Set a proper TeX
.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
diff --git a/contrib/groff/doc/texinfo.tex b/contrib/groff/doc/texinfo.tex
new file mode 100644
index 0000000..faad86b
--- /dev/null
+++ b/contrib/groff/doc/texinfo.tex
@@ -0,0 +1,5999 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2000-05-28.15}
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file 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, or (at
+% your option) any later version.
+%
+% This texinfo.tex 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. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.gnu.org/gnu/texinfo.tex
+% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
+% ftp://texinfo.org/tex/texinfo.tex
+% ftp://us.ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% The texinfo.tex in any given Texinfo distribution could well be out
+% of date, so if that's what you're using, please check.
+% Texinfo has a small home page at http://texinfo.org/.
+%
+% Send bug reports to bug-texinfo@gnu.org. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
+% The extra runs of TeX get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages. You can get
+% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+% Save some parts of plain tex whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexi=\i
+\let\ptexlbrace=\{
+\let\ptexrbrace=\}
+\let\ptexstar=\*
+\let\ptext=\t
+
+% We never want plain's outer \+ definition in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+\message{Basics,}
+\chardef\other=12
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+\hyphenation{ap-pen-dix}
+\hyphenation{mini-buf-fer mini-buf-fers}
+\hyphenation{eshell}
+\hyphenation{white-space}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen \bindingoffset
+\newdimen \normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% 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}%
+\ifx\eTeXversion\undefined
+\def\loggingall{\tracingcommands2 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\else
+\def\loggingall{\tracingcommands3 \tracingstats2
+ \tracingpages1 \tracingoutput1 \tracinglostchars1
+ \tracingmacros2 \tracingparagraphs1 \tracingrestores1
+ \tracingscantokens1 \tracingassigns1 \tracingifs1
+ \tracinggroups1 \tracingnesting2
+ \showboxbreadth\maxdimen\showboxdepth\maxdimen
+}%
+\fi
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \escapechar = `\\ % use backslash in output files.
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingxxx.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 2\baselineskip
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \turnoffactive
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, juha@viisa.uucp (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg#1{%
+ \let\next = #1%
+ \begingroup
+ \obeylines
+ \futurelet\temp\parseargx
+}
+
+% If the next token is an obeyed space (from an @example environment or
+% the like), remove it and recurse. Otherwise, we're done.
+\def\parseargx{%
+ % \obeyedspace is defined far below, after the definition of \sepspaces.
+ \ifx\obeyedspace\temp
+ \expandafter\parseargdiscardspace
+ \else
+ \expandafter\parseargline
+ \fi
+}
+
+% Remove a single space (as the delimiter token to the macro call).
+{\obeyspaces %
+ \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ %
+ % First remove any @c comment, then any @comment.
+ % Result of each macro is put in \toks0.
+ \argremovec #1\c\relax %
+ \expandafter\argremovecomment \the\toks0 \comment\relax %
+ %
+ % Call the caller's macro, saved as \next in \parsearg.
+ \expandafter\next\expandafter{\the\toks0}%
+ }%
+}
+
+% Since all \c{,omment} does is throw away the argument, we can let TeX
+% do that for us. The \relax here is matched by the \relax in the call
+% in \parseargline; it could be more or less anything, its purpose is
+% just to delimit the argument to the \c.
+\def\argremovec#1\c#2\relax{\toks0 = {#1}}
+\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
+
+% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% @end itemize @c foo
+% will have two active spaces as part of the argument with the
+% `itemize'. Here we remove all active spaces from #1, and assign the
+% result to \toks0.
+%
+% This loses if there are any *other* active characters besides spaces
+% in the argument -- _ ^ +, for example -- since they get expanded.
+% Fortunately, Texinfo does not define any such commands. (If it ever
+% does, the catcode of the characters in questionwill have to be changed
+% here.) But this means we cannot call \removeactivespaces as part of
+% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
+% that \parsearg gets might well have any character at all in it.
+%
+\def\removeactivespaces#1{%
+ \begingroup
+ \ignoreactivespaces
+ \edef\temp{#1}%
+ \global\toks0 = \expandafter{\temp}%
+ \endgroup
+}
+
+% Change the active space to expand to nothing.
+%
+\begingroup
+ \obeyspaces
+ \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
+\endgroup
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+%% These are used to keep @begin/@end levels from running away
+%% Call \inENV within environments (after a \begingroup)
+\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
+\def\ENVcheck{%
+\ifENV\errmessage{Still within an environment; press RETURN to continue}
+\endgroup\fi} % This is not perfect, but it should reduce lossage
+
+% @begin foo is the same as @foo, for now.
+\newhelp\EMsimple{Press RETURN to continue.}
+
+\outer\def\begin{\parsearg\beginxxx}
+
+\def\beginxxx #1{%
+\expandafter\ifx\csname #1\endcsname\relax
+{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
+\csname #1\endcsname\fi}
+
+% @end foo executes the definition of \Efoo.
+%
+\def\end{\parsearg\endxxx}
+\def\endxxx #1{%
+ \removeactivespaces{#1}%
+ \edef\endthing{\the\toks0}%
+ %
+ \expandafter\ifx\csname E\endthing\endcsname\relax
+ \expandafter\ifx\csname \endthing\endcsname\relax
+ % There's no \foo, i.e., no ``environment'' foo.
+ \errhelp = \EMsimple
+ \errmessage{Undefined command `@end \endthing'}%
+ \else
+ \unmatchedenderror\endthing
+ \fi
+ \else
+ % Everything's ok; the right environment has been started.
+ \csname E\endthing\endcsname
+ \fi
+}
+
+% There is an environment #1, but it hasn't been started. Give an error.
+%
+\def\unmatchedenderror#1{%
+ \errhelp = \EMsimple
+ \errmessage{This `@end #1' doesn't have a matching `@#1'}%
+}
+
+% Define the control sequence \E#1 to give an unmatched @end error.
+%
+\def\defineunmatchedend#1{%
+ \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
+}
+
+
+% Single-spacing is done by various environments (specifically, in
+% \nonfillstart and \quotations).
+\newskip\singlespaceskip \singlespaceskip = 12.5pt
+\def\singlespace{%
+ % Why was this kern here? It messes up equalizing space above and below
+ % environments. --karl, 6may93
+ %{\advance \baselineskip by -\singlespaceskip
+ %\kern \baselineskip}%
+ \setleading \singlespaceskip
+}
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce actual \{ & \} command in an index.
+ \catcode`\{ = 12 \catcode`\} = 12
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\@ = 0 \catcode`\\ = 12
+ @gdef@lbracecmd[\{]%
+ @gdef@rbracecmd[\}]%
+@endgroup
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown
+% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=3000 }
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=3000 }
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=3000 }
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+\def\group{\begingroup
+ \ifnum\catcode13=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ %
+ % The \vtop we start below produces a box with normal height and large
+ % depth; thus, TeX puts \baselineskip glue before it, and (when the
+ % next line of text is done) \lineskip glue after it. (See p.82 of
+ % the TeXbook.) Thus, space below is not quite equal to space
+ % above. But it's pretty close.
+ \def\Egroup{%
+ \egroup % End the \vtop.
+ \endgroup % End the \group.
+ }%
+ %
+ \vtop\bgroup
+ % We have to put a strut on the last line in case the @group is in
+ % the midst of an example, rather than completely enclosing it.
+ % Otherwise, the interline space between the last line of the group
+ % and the first line afterwards is too small. But we can't put the
+ % strut in \Egroup, since there it would be on a line by itself.
+ % Hence this just inserts a strut at the beginning of each line.
+ \everypar = {\strut}%
+ %
+ % Since we have a strut on every line, we don't need any of TeX's
+ % normal interline spacing.
+ \offinterlineskip
+ %
+ % OK, but now we have to do something about blank
+ % lines in the input in @example-like environments, which normally
+ % just turn into \lisppar, which will insert no space now that we've
+ % turned off the interline space. Simplest is to make them be an
+ % empty paragraph.
+ \ifx\par\lisppar
+ \edef\par{\leavevmode \par}%
+ %
+ % Reset ^^M's definition to new definition of \par.
+ \obeylines
+ \fi
+ %
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+\def\need{\parsearg\needx}
+
+% Old definition--didn't work.
+%\def\needx #1{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\def\needx#1{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break
+
+\let\br = \par
+
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{%
+ \leavevmode
+ \hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \leavevmode
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
+
+
+% @page forces the start of a new page
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\def\exdent{\parsearg\exdentyyy}
+\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
+
+% This defn is used inside nofill environments such as @example.
+\def\nofillexdent{\parsearg\nofillexdentyyy}
+\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
+\leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
+
+\def\inmargin#1{%
+\strut\vadjust{\nobreak\kern-\strutdepth
+ \vtop to \strutdepth{\baselineskip\strutdepth\vss
+ \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+
+%\hbox{{\rm#1}}\hfil\break}}
+
+% @include file insert text of that file as input.
+% Allow normal characters that we make active in the argument (a file name).
+\def\include{\begingroup
+ \catcode`\\=12
+ \catcode`~=12
+ \catcode`^=12
+ \catcode`_=12
+ \catcode`|=12
+ \catcode`<=12
+ \catcode`>=12
+ \catcode`+=12
+ \parsearg\includezzz}
+% Restore active chars for included file.
+\def\includezzz#1{\endgroup\begingroup
+ % Read the included file in a group so nested @include's work.
+ \def\thisfile{#1}%
+ \input\thisfile
+\endgroup}
+
+\def\thisfile{}
+
+% @center line outputs that line, centered
+
+\def\center{\parsearg\centerzzz}
+\def\centerzzz #1{{\advance\hsize by -\leftskip
+\advance\hsize by -\rightskip
+\centerline{#1}}}
+
+% @sp n outputs n lines of vertical space
+
+\def\sp{\parsearg\spxxx}
+\def\spxxx #1{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% We cannot implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\def\paragraphindent{\parsearg\doparagraphindent}
+\def\doparagraphindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\def\exampleindent{\parsearg\doexampleindent}
+\def\doexampleindent#1{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math means output in math mode.
+% We don't use $'s directly in the definition of \math because control
+% sequences like \math are expanded when the toc file is written. Then,
+% we read the toc file back, the $'s will be normal characters (as they
+% should be, according to the definition of Texinfo). So we must use a
+% control sequence to switch into and out of math mode.
+%
+% This isn't quite enough for @math to work properly in indices, but it
+% seems unlikely it will ever be needed there.
+%
+\let\implicitmath = $
+\def\math#1{\implicitmath #1\implicitmath}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{\implicitmath\ptexbullet\implicitmath}
+\def\minus{\implicitmath-\implicitmath}
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \iflinks
+ \readauxfile
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ % Just to be on the safe side, close the input stream before the \input.
+ \openin 1 texinfo.cnf
+ \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
+ \closein1
+ \temp
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+\ifx\pdfoutput\undefined
+ \pdffalse
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\else
+ \pdftrue
+ \pdfoutput = 1
+ \input pdfcolor
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}%
+ \def\imageheight{#3}%
+ \ifnum\pdftexversion < 14
+ \pdfimage
+ \else
+ \pdfximage
+ \fi
+ \ifx\empty\imagewidth\else width \imagewidth \fi
+ \ifx\empty\imageheight\else height \imageheight \fi
+ {#1.pdf}%
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
+ \def\pdfmkpgn#1{#1@}
+ \let\linkcolor = \Blue % was Cyan, but that seems light?
+ \def\endlink{\Black\pdfendlink}
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ \def\pdfmakeoutlines{{%
+ \openin 1 \jobname.toc
+ \ifeof 1\else\bgroup
+ \closein 1
+ \indexnofonts
+ \def\tt{}
+ \let\_ = \normalunderscore
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ \def\chapentry ##1##2##3{}
+ \def\unnumbchapentry ##1##2{}
+ \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \input \jobname.toc
+ \def\chapentry ##1##2##3{%
+ \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
+ \def\unnumbchapentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\secentry ##1##2##3##4{%
+ \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
+ \def\unnumbsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsecentry ##1##2##3##4##5{%
+ \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
+ \def\unnumbsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \def\subsubsecentry ##1##2##3##4##5##6{%
+ \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
+ \def\unnumbsubsubsecentry ##1##2{%
+ \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
+ \input \jobname.toc
+ \egroup\fi
+ }}
+ \def\makelinks #1,{%
+ \def\params{#1}\def\E{END}%
+ \ifx\params\E
+ \let\nextmakelinks=\relax
+ \else
+ \let\nextmakelinks=\makelinks
+ \ifnum\lnkcount>0,\fi
+ \picknum{#1}%
+ \startlink attr{/Border [0 0 0]}
+ goto name{\pdfmkpgn{\the\pgn}}%
+ \linkcolor #1%
+ \advance\lnkcount by 1%
+ \endlink
+ \fi
+ \nextmakelinks
+ }
+ \def\picknum#1{\expandafter\pn#1}
+ \def\pn#1{%
+ \def\p{#1}%
+ \ifx\p\lbrace
+ \let\nextpn=\ppn
+ \else
+ \let\nextpn=\ppnn
+ \def\first{#1}
+ \fi
+ \nextpn
+ }
+ \def\ppn#1{\pgn=#1\gobble}
+ \def\ppnn{\pgn=\first}
+ \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ \def\pdfurl#1{%
+ \begingroup
+ \normalturnoffactive\def\@{@}%
+ \leavevmode\Red
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ % #1
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\mkpgn#1{#1@}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+% Font-change commands.
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf analogous to plain's \rm, etc.
+\newfam\sffam
+\def\sf{\fam=\sffam \tensf}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this one.
+\def\ttsl{\tenttsl}
+
+% Use Computer Modern fonts at \magstephalf (11pt).
+\newcount\mainmagstep
+\mainmagstep=\magstephalf
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor
+\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+\ifx\bigger\relax
+\let\mainmagstep=\magstep1
+\setfont\textrm\rmshape{12}{1000}
+\setfont\texttt\ttshape{12}{1000}
+\else
+\setfont\textrm\rmshape{10}{\mainmagstep}
+\setfont\texttt\ttshape{10}{\mainmagstep}
+\fi
+% Instead of cmb10, you many want to use cmbx10.
+% cmbx10 is a prettier font on its own, but cmb10
+% looks better when embedded in a line with cmr10.
+\setfont\textbf\bfshape{10}{\mainmagstep}
+\setfont\textit\itshape{10}{\mainmagstep}
+\setfont\textsl\slshape{10}{\mainmagstep}
+\setfont\textsf\sfshape{10}{\mainmagstep}
+\setfont\textsc\scshape{10}{\mainmagstep}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun, etc.
+\setfont\defbf\bxshape{10}{\magstep1} %was 1314
+\setfont\deftt\ttshape{10}{\magstep1}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\setfont\smallrm\rmshape{9}{1000}
+\setfont\smalltt\ttshape{9}{1000}
+\setfont\smallbf\bfshape{10}{900}
+\setfont\smallit\itshape{9}{1000}
+\setfont\smallsl\slshape{9}{1000}
+\setfont\smallsf\sfshape{9}{1000}
+\setfont\smallsc\scshape{10}{900}
+\setfont\smallttsl\ttslshape{10}{900}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for title page:
+\setfont\titlerm\rmbshape{12}{\magstep3}
+\setfont\titleit\itbshape{10}{\magstep4}
+\setfont\titlesl\slbshape{10}{\magstep4}
+\setfont\titlett\ttbshape{12}{\magstep3}
+\setfont\titlettsl\ttslshape{10}{\magstep4}
+\setfont\titlesf\sfbshape{17}{\magstep1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\setfont\chaprm\rmbshape{12}{\magstep2}
+\setfont\chapit\itbshape{10}{\magstep3}
+\setfont\chapsl\slbshape{10}{\magstep3}
+\setfont\chaptt\ttbshape{12}{\magstep2}
+\setfont\chapttsl\ttslshape{10}{\magstep3}
+\setfont\chapsf\sfbshape{17}{1000}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\setfont\secrm\rmbshape{12}{\magstep1}
+\setfont\secit\itbshape{10}{\magstep2}
+\setfont\secsl\slbshape{10}{\magstep2}
+\setfont\sectt\ttbshape{12}{\magstep1}
+\setfont\secttsl\ttslshape{10}{\magstep2}
+\setfont\secsf\sfbshape{12}{\magstep1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
+% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
+% \setfont\ssecsl\slshape{10}{\magstep1}
+% \setfont\ssectt\ttshape{10}{\magstep1}
+% \setfont\ssecsf\sfshape{10}{\magstep1}
+
+%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
+%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
+%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
+%\setfont\ssectt\ttshape{10}{1315}
+%\setfont\ssecsf\sfshape{10}{1315}
+
+%\let\ssecbf=\ssecrm
+
+% Subsection fonts (13.15pt).
+\setfont\ssecrm\rmbshape{12}{\magstephalf}
+\setfont\ssecit\itbshape{10}{1315}
+\setfont\ssecsl\slbshape{10}{1315}
+\setfont\ssectt\ttbshape{12}{\magstephalf}
+\setfont\ssecttsl\ttslshape{10}{1315}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{\magstep1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
+% but that is not a standard magnification.
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts, we
+% don't bother to reset \scriptfont and \scriptscriptfont (which would
+% also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
+ \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
+ \textfont\ttfam = \tentt \textfont\sffam = \tensf
+}
+
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this so that font changes will continue to work
+% in math mode, where it is the current \fam that is relevant in most
+% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
+% \tenbf}, for example. By redefining \tenbf, we obviate the need to
+% redefine \bf itself.
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
+ \resetmathfonts}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \resetmathfonts \setleading{11pt}}
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\textfonts
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}
+\setfont\shortcontbf\bxshape{12}{1000}
+\setfont\shortcontsl\slshape{12}{1000}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
+\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+\let\cite=\smartslanted
+
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+\def\t#1{%
+ {\tt \rawbackslash \frenchspacing #1}%
+ \null
+}
+\let\ttfont=\t
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \frenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in \code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active
+ \catcode`\_=\active
+ %
+ \global\def\code{\begingroup
+ \catcode`\-=\active \let-\codedash
+ \catcode`\_=\active \let_\codeunder
+ \codex
+ }
+ %
+ % If we end up with any active - characters when handling the index,
+ % just treat them as a normal -.
+ \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
+\def\codex #1{\tclose{#1}\endgroup}
+
+%\let\exp=\tclose %Was temporary
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
+\def\kbdinputstylexxx#1{%
+ \def\arg{#1}%
+ \ifx\arg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\arg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\arg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is kbdinputdistinct. (Too much of a hassle to call the macro,
+% the catcodes are wrong for parsearg to work.)
+\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @url, @env, @command quotes seem unnecessary, so use \code.
+\let\url=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym downcases the argument and prints in smallcaps.
+\def\acronym#1{{\smallcaps \lowercase{#1}}}
+
+% @pounds{} is a sterling sign.
+\def\pounds{{\it\$}}
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\def\shorttitlepage{\parsearg\shorttitlepagezzz}
+\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\def\titlepage{\begingroup \parindent=0pt \textfonts
+ \let\subtitlerm=\tenrm
+ \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
+ %
+ \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
+ %
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ %
+ % Now you can print the title using @title.
+ \def\title{\parsearg\titlezzz}%
+ \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Now you can put text using @subtitle.
+ \def\subtitle{\parsearg\subtitlezzz}%
+ \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
+ %
+ % @author should come last, but may come many times.
+ \def\author{\parsearg\authorzzz}%
+ \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
+ {\authorfont \leftline{##1}}}%
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \oldpage
+ \let\page = \oldpage
+ \hbox{}}%
+% \def\page{\oldpage \hbox{}}
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+ %
+ \ifpdf \pdfmakepagedesttrue \fi
+ %
+ \HEADINGSon
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make Tex use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\everyheading{\parsearg\everyheadingxxx}
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\everyfooting{\parsearg\everyfootingxxx}
+
+{\catcode`\@=0 %
+
+\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
+\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
+\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
+\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
+\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -\baselineskip
+ \global\advance\vsize by -\baselineskip
+}
+
+\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+%
+}% unbind the catcode of @.
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg\settitlezzz}
+\def\settitlezzz #1{\gdef\thistitle{#1}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
+\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
+
+\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
+\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
+
+\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
+ \itemzzz {#1}}
+
+\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
+ \itemzzz {#1}}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemfont{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. Unfortunately
+ % we can't prevent a possible page break at the following
+ % \baselineskip glue.
+ \nobreak
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a table}}
+\def\itemx{\errmessage{@itemx while not in a table}}
+\def\kitem{\errmessage{@kitem while not in a table}}
+\def\kitemx{\errmessage{@kitemx while not in a table}}
+\def\xitem{\errmessage{@xitem while not in a table}}
+\def\xitemx{\errmessage{@xitemx while not in a table}}
+
+% Contains a kludge to get @end[description] to work.
+\def\description{\tablez{\dontindex}{1}{}{}{}{}}
+
+% @table, @ftable, @vtable.
+\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
+{\obeylines\obeyspaces%
+\gdef\tablex #1^^M{%
+\tabley\dontindex#1 \endtabley}}
+
+\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
+{\obeylines\obeyspaces%
+\gdef\ftablex #1^^M{%
+\tabley\fnitemindex#1 \endtabley
+\def\Eftable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
+{\obeylines\obeyspaces%
+\gdef\vtablex #1^^M{%
+\tabley\vritemindex#1 \endtabley
+\def\Evtable{\endgraf\afterenvbreak\endgroup}%
+\let\Etable=\relax}}
+
+\def\dontindex #1{}
+\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
+\def\vritemindex #1{\doind {vr}{\code{#1}}}%
+
+{\obeyspaces %
+\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+
+\def\tablez #1#2#3#4#5#6{%
+\aboveenvbreak %
+\begingroup %
+\def\Edescription{\Etable}% Necessary kludge.
+\let\itemindex=#1%
+\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
+\ifnum 0#4>0 \tableindent=#4\mil \fi %
+\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
+\def\itemfont{#2}%
+\itemmax=\tableindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \tableindent %
+\exdentamount=\tableindent
+\parindent = 0pt
+\parskip = \smallskipamount
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def\Etable{\endgraf\afterenvbreak\endgroup}%
+\let\item = \internalBitem %
+\let\itemx = \internalBitemx %
+\let\kitem = \internalBkitem %
+\let\kitemx = \internalBkitemx %
+\let\xitem = \internalBxitem %
+\let\xitemx = \internalBxitemx %
+}
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\def\itemize{\parsearg\itemizezzz}
+
+\def\itemizezzz #1{%
+ \begingroup % ended by the @end itemize
+ \itemizey {#1}{\Eitemize}
+}
+
+\def\itemizey #1#2{%
+\aboveenvbreak %
+\itemmax=\itemindent %
+\advance \itemmax by -\itemmargin %
+\advance \leftskip by \itemindent %
+\exdentamount=\itemindent
+\parindent = 0pt %
+\parskip = \smallskipamount %
+\ifdim \parskip=0pt \parskip=2pt \fi%
+\def#2{\endgraf\afterenvbreak\endgroup}%
+\def\itemcontents{#1}%
+\let\item=\itemizeitem}
+
+% Set sfcode to normal for the chars that usually have another value.
+% These are `.?!:;,'
+\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
+ \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\def\enumerate{\parsearg\enumeratezzz}
+\def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ \begingroup % ended by the @end enumerate
+ %
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call itemizey, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \itemizey{#1.}\Eenumerate\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+% Definition of @item while inside @itemize.
+
+\def\itemizeitem{%
+\advance\itemno by 1
+{\let\par=\endgraf \smallbreak}%
+\ifhmode \errmessage{In hmode at itemizeitem}\fi
+{\parskip=0in \hskip 0pt
+\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
+\vadjust{\penalty 1200}}%
+\flushcr}
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+%
+% For those who want to use more than one line's worth of words in
+% the preamble, break the line within one argument and it
+% will parse correctly, i.e.,
+%
+% @multitable {Column 1 template} {Column 2 template} {Column 3
+% template}
+% Not:
+% @multitable {Column 1 template} {Column 2 template}
+% {Column 3 template}
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab, @multitable or @end multitable do not need to be on their
+% own lines, but it will not hurt if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the part of the @columnfraction before the decimal point, which
+% is presumably either 0 or the empty string (but we don't check, we
+% just throw it away). #2 is the decimal part, which we use as the
+% percent of \hsize for this column.
+\def\pickupwholefraction#1.#2 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
+ % typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% This used to have \hskip1sp. But then the space in a template line is
+% not enough. That is bad. So let's go back to just & until we
+% encounter the problem it was intended to solve again.
+% --karl, nathan@acm.org, 20apr99.
+\def\tab{&}
+
+% @multitable ... @end multitable definitions:
+%
+\def\multitable{\parsearg\dotable}
+\def\dotable#1{\bgroup
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
+}
+
+\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
+% If so, do nothing. If not, give it an appropriate dimension based on
+% current baselineskip.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+%% strut to put in table in case some entry doesn't have descenders,
+%% to keep lines equally spaced
+\let\multistrut = \strut
+\else
+%% FIXME: what is \box0 supposed to be?
+\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
+width0pt\relax} \fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+% Prevent errors for section commands.
+% Used in @ignore and in failing conditionals.
+\def\ignoresections{%
+ \let\chapter=\relax
+ \let\unnumbered=\relax
+ \let\top=\relax
+ \let\unnumberedsec=\relax
+ \let\unnumberedsection=\relax
+ \let\unnumberedsubsec=\relax
+ \let\unnumberedsubsection=\relax
+ \let\unnumberedsubsubsec=\relax
+ \let\unnumberedsubsubsection=\relax
+ \let\section=\relax
+ \let\subsec=\relax
+ \let\subsubsec=\relax
+ \let\subsection=\relax
+ \let\subsubsection=\relax
+ \let\appendix=\relax
+ \let\appendixsec=\relax
+ \let\appendixsection=\relax
+ \let\appendixsubsec=\relax
+ \let\appendixsubsection=\relax
+ \let\appendixsubsubsec=\relax
+ \let\appendixsubsubsection=\relax
+ \let\contents=\relax
+ \let\smallbook=\relax
+ \let\titlepage=\relax
+}
+
+% Used in nested conditionals, where we have to parse the Texinfo source
+% and so want to turn off most commands, in case they are used
+% incorrectly.
+%
+\def\ignoremorecommands{%
+ \let\defcodeindex = \relax
+ \let\defcv = \relax
+ \let\deffn = \relax
+ \let\deffnx = \relax
+ \let\defindex = \relax
+ \let\defivar = \relax
+ \let\defmac = \relax
+ \let\defmethod = \relax
+ \let\defop = \relax
+ \let\defopt = \relax
+ \let\defspec = \relax
+ \let\deftp = \relax
+ \let\deftypefn = \relax
+ \let\deftypefun = \relax
+ \let\deftypeivar = \relax
+ \let\deftypeop = \relax
+ \let\deftypevar = \relax
+ \let\deftypevr = \relax
+ \let\defun = \relax
+ \let\defvar = \relax
+ \let\defvr = \relax
+ \let\ref = \relax
+ \let\xref = \relax
+ \let\printindex = \relax
+ \let\pxref = \relax
+ \let\settitle = \relax
+ \let\setchapternewpage = \relax
+ \let\setchapterstyle = \relax
+ \let\everyheading = \relax
+ \let\evenheading = \relax
+ \let\oddheading = \relax
+ \let\everyfooting = \relax
+ \let\evenfooting = \relax
+ \let\oddfooting = \relax
+ \let\headings = \relax
+ \let\include = \relax
+ \let\lowersections = \relax
+ \let\down = \relax
+ \let\raisesections = \relax
+ \let\up = \relax
+ \let\set = \relax
+ \let\clear = \relax
+ \let\item = \relax
+}
+
+% Ignore @ignore ... @end ignore.
+%
+\def\ignore{\doignore{ignore}}
+
+% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
+%
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\html{\doignore{html}}
+\def\menu{\doignore{menu}}
+\def\direntry{\doignore{direntry}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory = \comment
+
+% Ignore text until a line `@end #1'.
+%
+\def\doignore#1{\begingroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define a command to swallow text until we reach `@end #1'.
+ % This @ is a catcode 12 token (that is the normal catcode of @ in
+ % this texinfo.tex file). We change the catcode of @ below to match.
+ \long\def\doignoretext##1@end #1{\enddoignore}%
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \catcode32 = 10
+ %
+ % Ignore braces, too, so mismatched braces don't cause trouble.
+ \catcode`\{ = 9
+ \catcode`\} = 9
+ %
+ % We must not have @c interpreted as a control sequence.
+ \catcode`\@ = 12
+ %
+ % Make the letter c a comment character so that the rest of the line
+ % will be ignored. This way, the document can have (for example)
+ % @c @end ifinfo
+ % and the @end ifinfo will be properly ignored.
+ % (We've just changed @ to catcode 12.)
+ \catcode`\c = 14
+ %
+ % And now expand that command.
+ \doignoretext
+}
+
+% What we do to finish off ignored text.
+%
+\def\enddoignore{\endgroup\ignorespaces}%
+
+\newif\ifwarnedobs\warnedobsfalse
+\def\obstexwarn{%
+ \ifwarnedobs\relax\else
+ % We need to warn folks that they may have trouble with TeX 3.0.
+ % This uses \immediate\write16 rather than \message to get newlines.
+ \immediate\write16{}
+ \immediate\write16{WARNING: for users of Unix TeX 3.0!}
+ \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
+ \immediate\write16{If you are running another version of TeX, relax.}
+ \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
+ \immediate\write16{ Then upgrade your TeX installation if you can.}
+ \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
+ \immediate\write16{If you are stuck with version 3.0, run the}
+ \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
+ \immediate\write16{ to use a workaround.}
+ \immediate\write16{}
+ \global\warnedobstrue
+ \fi
+}
+
+% **In TeX 3.0, setting text in \nullfont hangs tex. For a
+% workaround (which requires the file ``dummy.tfm'' to be installed),
+% uncomment the following line:
+%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
+
+% Ignore text, except that we keep track of conditional commands for
+% purposes of nesting, up to an `@end #1' command.
+%
+\def\nestedignore#1{%
+ \obstexwarn
+ % We must actually expand the ignored text to look for the @end
+ % command, so that nested ignore constructs work. Thus, we put the
+ % text into a \vbox and then do nothing with the result. To minimize
+ % the change of memory overflow, we follow the approach outlined on
+ % page 401 of the TeXbook: make the current font be a dummy font.
+ %
+ \setbox0 = \vbox\bgroup
+ % Don't complain about control sequences we have declared \outer.
+ \ignoresections
+ %
+ % Define `@end #1' to end the box, which will in turn undefine the
+ % @end command again.
+ \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
+ %
+ % We are going to be parsing Texinfo commands. Most cause no
+ % trouble when they are used incorrectly, but some commands do
+ % complicated argument parsing or otherwise get confused, so we
+ % undefine them.
+ %
+ % We can't do anything about stray @-signs, unfortunately;
+ % they'll produce `undefined control sequence' errors.
+ \ignoremorecommands
+ %
+ % Set the current font to be \nullfont, a TeX primitive, and define
+ % all the font commands to also use \nullfont. We don't use
+ % dummy.tfm, as suggested in the TeXbook, because not all sites
+ % might have that installed. Therefore, math mode will still
+ % produce output, but that should be an extremely small amount of
+ % stuff compared to the main input.
+ %
+ \nullfont
+ \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
+ \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
+ \let\tensf=\nullfont
+ % Similarly for index fonts (mostly for their use in smallexample).
+ \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
+ \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
+ \let\smallsf=\nullfont
+ %
+ % Don't complain when characters are missing from the fonts.
+ \tracinglostchars = 0
+ %
+ % Don't bother to do space factor calculations.
+ \frenchspacing
+ %
+ % Don't report underfull hboxes.
+ \hbadness = 10000
+ %
+ % Do minimal line-breaking.
+ \pretolerance = 10000
+ %
+ % Do not execute instructions in @tex
+ \def\tex{\doignore{tex}}%
+ % Do not execute macro definitions.
+ % `c' is a comment character, so the word `macro' will get cut off.
+ \def\macro{\doignore{ma}}%
+}
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it. Make sure the catcode of space is correct to avoid
+% losing inside @example, for instance.
+%
+\def\set{\begingroup\catcode` =10
+ \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
+ \parsearg\setxxx}
+\def\setxxx#1{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ \def\temp{#2}%
+ \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
+ \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
+ \fi
+ \endgroup
+}
+% Can't use \xdef to pre-expand #2 and save some time, since \temp or
+% \next or other control sequences that we've defined might get us into
+% an infinite loop. Consider `@set foo @cite{bar}'.
+\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\def\clear{\parsearg\clearxxx}
+\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
+
+% @value{foo} gets the text saved in variable foo.
+{
+ \catcode`\_ = \active
+ %
+ % We might end up with active _ or - characters in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}. So \let any
+ % such active characters to their normal equivalents.
+ \gdef\value{\begingroup
+ \catcode`\-=12 \catcode`\_=12
+ \indexbreaks \let_\normalunderscore
+ \valuexxx}
+}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we \let\value to this in \indexdummies). Ones
+% whose names contain - or _ still won't work, but we can't do anything
+% about that. The command has to be fully expandable, since the result
+% winds up in the index file. This means that if the variable's value
+% contains other Texinfo commands, it's almost certain it will fail
+% (although perhaps we could fix that with sufficient work to do a
+% one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+\def\ifset{\parsearg\ifsetxxx}
+\def\ifsetxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifsetfail
+ \else
+ \expandafter\ifsetsucceed
+ \fi
+}
+\def\ifsetsucceed{\conditionalsucceed{ifset}}
+\def\ifsetfail{\nestedignore{ifset}}
+\defineunmatchedend{ifset}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+\def\ifclear{\parsearg\ifclearxxx}
+\def\ifclearxxx #1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ \expandafter\ifclearsucceed
+ \else
+ \expandafter\ifclearfail
+ \fi
+}
+\def\ifclearsucceed{\conditionalsucceed{ifclear}}
+\def\ifclearfail{\nestedignore{ifclear}}
+\defineunmatchedend{ifclear}
+
+% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
+% following, through the first @end iftex (etc.). Make `@end iftex'
+% (etc.) valid only after an @iftex.
+%
+\def\iftex{\conditionalsucceed{iftex}}
+\def\ifnothtml{\conditionalsucceed{ifnothtml}}
+\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
+\defineunmatchedend{iftex}
+\defineunmatchedend{ifnothtml}
+\defineunmatchedend{ifnotinfo}
+
+% We can't just want to start a group at @iftex (for example) and end it
+% at @end iftex, since then @set commands inside the conditional have no
+% effect (they'd get reverted at the end of the group). So we must
+% define \Eiftex to redefine itself to be its previous value. (We can't
+% just define it to fail again with an ``unmatched end'' error, since
+% the @ifset might be nested.)
+%
+\def\conditionalsucceed#1{%
+ \edef\temp{%
+ % Remember the current value of \E#1.
+ \let\nece{prevE#1} = \nece{E#1}%
+ %
+ % At the `@end #1', redefine \E#1 to be its previous value.
+ \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
+ }%
+ \temp
+}
+
+% We need to expand lots of \csname's, but we don't want to expand the
+% control sequences after we've constructed them.
+%
+\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within \newindex.
+{\catcode`\@=11
+\gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}
+}
+
+\def\defcodeindex{\parsearg\newcodeindex}
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+% The \closeout helps reduce unnecessary open files; the limit on the
+% Acorn RISC OS is a mere 16 files.
+\def\synindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\doindex{#2}}%
+}
+
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+\def\syncodeindex#1 #2 {%
+ \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
+ \expandafter\closeout\csname#1indfile\endcsname
+ \expandafter\let\csname#1indfile\endcsname=\synindexfoo
+ \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
+ \noexpand\docodeindex{#2}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+\def\indexdummies{%
+\def\ { }%
+% Take care of the plain tex accent commands.
+\def\"{\realbackslash "}%
+\def\`{\realbackslash `}%
+\def\'{\realbackslash '}%
+\def\^{\realbackslash ^}%
+\def\~{\realbackslash ~}%
+\def\={\realbackslash =}%
+\def\b{\realbackslash b}%
+\def\c{\realbackslash c}%
+\def\d{\realbackslash d}%
+\def\u{\realbackslash u}%
+\def\v{\realbackslash v}%
+\def\H{\realbackslash H}%
+% Take care of the plain tex special European modified letters.
+\def\oe{\realbackslash oe}%
+\def\ae{\realbackslash ae}%
+\def\aa{\realbackslash aa}%
+\def\OE{\realbackslash OE}%
+\def\AE{\realbackslash AE}%
+\def\AA{\realbackslash AA}%
+\def\o{\realbackslash o}%
+\def\O{\realbackslash O}%
+\def\l{\realbackslash l}%
+\def\L{\realbackslash L}%
+\def\ss{\realbackslash ss}%
+% Take care of texinfo commands likely to appear in an index entry.
+% (Must be a way to avoid doing expansion at all, and thus not have to
+% laboriously list every single command here.)
+\def\@{@}% will be @@ when we switch to @ as escape char.
+% Need these in case \tex is in effect and \{ is a \delimiter again.
+% But can't use \lbracecmd and \rbracecmd because texindex assumes
+% braces and backslashes are used only as delimiters.
+\let\{ = \mylbrace
+\let\} = \myrbrace
+\def\_{{\realbackslash _}}%
+\def\w{\realbackslash w }%
+\def\bf{\realbackslash bf }%
+%\def\rm{\realbackslash rm }%
+\def\sl{\realbackslash sl }%
+\def\sf{\realbackslash sf}%
+\def\tt{\realbackslash tt}%
+\def\gtr{\realbackslash gtr}%
+\def\less{\realbackslash less}%
+\def\hat{\realbackslash hat}%
+\def\TeX{\realbackslash TeX}%
+\def\dots{\realbackslash dots }%
+\def\result{\realbackslash result}%
+\def\equiv{\realbackslash equiv}%
+\def\expansion{\realbackslash expansion}%
+\def\print{\realbackslash print}%
+\def\error{\realbackslash error}%
+\def\point{\realbackslash point}%
+\def\copyright{\realbackslash copyright}%
+\def\tclose##1{\realbackslash tclose {##1}}%
+\def\code##1{\realbackslash code {##1}}%
+\def\uref##1{\realbackslash uref {##1}}%
+\def\url##1{\realbackslash url {##1}}%
+\def\env##1{\realbackslash env {##1}}%
+\def\command##1{\realbackslash command {##1}}%
+\def\option##1{\realbackslash option {##1}}%
+\def\dotless##1{\realbackslash dotless {##1}}%
+\def\samp##1{\realbackslash samp {##1}}%
+\def\,##1{\realbackslash ,{##1}}%
+\def\t##1{\realbackslash t {##1}}%
+\def\r##1{\realbackslash r {##1}}%
+\def\i##1{\realbackslash i {##1}}%
+\def\b##1{\realbackslash b {##1}}%
+\def\sc##1{\realbackslash sc {##1}}%
+\def\cite##1{\realbackslash cite {##1}}%
+\def\key##1{\realbackslash key {##1}}%
+\def\file##1{\realbackslash file {##1}}%
+\def\var##1{\realbackslash var {##1}}%
+\def\kbd##1{\realbackslash kbd {##1}}%
+\def\dfn##1{\realbackslash dfn {##1}}%
+\def\emph##1{\realbackslash emph {##1}}%
+\def\acronym##1{\realbackslash acronym {##1}}%
+%
+% Handle some cases of @value -- where the variable name does not
+% contain - or _, and the value does not contain any
+% (non-fully-expandable) commands.
+\let\value = \expandablevalue
+%
+\unsepspaces
+% Turn off macro expansion
+\turnoffmacros
+}
+
+% If an index command is used in an @example environment, any spaces
+% therein should become regular spaces in the raw index file, not the
+% expansion of \tie (\\leavevmode \penalty \@M \ ).
+{\obeyspaces
+ \gdef\unsepspaces{\obeyspaces\let =\space}}
+
+% \indexnofonts no-ops all font-change commands.
+% This is used when outputting the strings to sort the index by.
+\def\indexdummyfont#1{#1}
+\def\indexdummytex{TeX}
+\def\indexdummydots{...}
+
+\def\indexnofonts{%
+% Just ignore accents.
+\let\,=\indexdummyfont
+\let\"=\indexdummyfont
+\let\`=\indexdummyfont
+\let\'=\indexdummyfont
+\let\^=\indexdummyfont
+\let\~=\indexdummyfont
+\let\==\indexdummyfont
+\let\b=\indexdummyfont
+\let\c=\indexdummyfont
+\let\d=\indexdummyfont
+\let\u=\indexdummyfont
+\let\v=\indexdummyfont
+\let\H=\indexdummyfont
+\let\dotless=\indexdummyfont
+% Take care of the plain tex special European modified letters.
+\def\oe{oe}%
+\def\ae{ae}%
+\def\aa{aa}%
+\def\OE{OE}%
+\def\AE{AE}%
+\def\AA{AA}%
+\def\o{o}%
+\def\O{O}%
+\def\l{l}%
+\def\L{L}%
+\def\ss{ss}%
+\let\w=\indexdummyfont
+\let\t=\indexdummyfont
+\let\r=\indexdummyfont
+\let\i=\indexdummyfont
+\let\b=\indexdummyfont
+\let\emph=\indexdummyfont
+\let\strong=\indexdummyfont
+\let\cite=\indexdummyfont
+\let\sc=\indexdummyfont
+%Don't no-op \tt, since it isn't a user-level command
+% and is used in the definitions of the active chars like <, >, |...
+%\let\tt=\indexdummyfont
+\let\tclose=\indexdummyfont
+\let\code=\indexdummyfont
+\let\url=\indexdummyfont
+\let\uref=\indexdummyfont
+\let\env=\indexdummyfont
+\let\acronym=\indexdummyfont
+\let\command=\indexdummyfont
+\let\option=\indexdummyfont
+\let\file=\indexdummyfont
+\let\samp=\indexdummyfont
+\let\kbd=\indexdummyfont
+\let\key=\indexdummyfont
+\let\var=\indexdummyfont
+\let\TeX=\indexdummytex
+\let\dots=\indexdummydots
+\def\@{@}%
+}
+
+% To define \realbackslash, we must make \ not be an escape.
+% We must first make another character (@) an escape
+% so we do not become unable to do a definition.
+
+{\catcode`\@=0 \catcode`\\=\other
+ @gdef@realbackslash{\}}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% For \ifx comparisons.
+\def\emptymacro{\empty}
+
+% Most index entries go through here, but \dosubind is the general case.
+%
+\def\doind#1#2{\dosubind{#1}{#2}\empty}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% \empty if called from \doind, as we usually are. The main exception
+% is with defuns, which call us directly.
+%
+\def\dosubind#1#2#3{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
+ \fi
+ {%
+ \count255=\lastpenalty
+ {%
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \escapechar=`\\
+ {%
+ \let\folio = 0% We will expand all macros now EXCEPT \folio.
+ \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ \def\thirdarg{#3}%
+ %
+ % If third arg is present, precede it with space in sort key.
+ \ifx\thirdarg\emptymacro
+ \let\subentry = \empty
+ \else
+ \def\subentry{ #3}%
+ \fi
+ %
+ % First process the index entry with all font commands turned
+ % off to get the string to sort by.
+ {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
+ %
+ % Now the real index entry with the fonts.
+ \toks0 = {#2}%
+ %
+ % If third (subentry) arg is present, add it to the index
+ % string. And include a space.
+ \ifx\thirdarg\emptymacro \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ % Set up the complete index entry, with both the sort key
+ % and the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file, texindex reduces to
+ % two when writing the .??s sorted result.
+ \edef\temp{%
+ \write\csname#1indfile\endcsname{%
+ \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
+ }%
+ %
+ % If a skip is the last thing on the list now, preserve it
+ % by backing up by \lastskip, doing the \write, then inserting
+ % the skip again. Otherwise, the whatsit generated by the
+ % \write will make \lastskip zero. The result is that sequences
+ % like this:
+ % @end defun
+ % @tindex whatever
+ % @defun ...
+ % will have extra space inserted, because the \medbreak in the
+ % start of the @defun won't see the skip inserted by the @end of
+ % the previous defun.
+ %
+ % But don't do any of this if we're not in vertical mode. We
+ % don't want to do a \vskip and prematurely end a paragraph.
+ %
+ % Avoid page breaks due to these extra skips, too.
+ %
+ \iflinks
+ \ifvmode
+ \skip0 = \lastskip
+ \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
+ \fi
+ %
+ \temp % do the write
+ %
+ %
+ \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
+ \fi
+ }%
+ }%
+ \penalty\count255
+ }%
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\def\printindex{\parsearg\doprintindex}
+\def\doprintindex#1{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \indexbreaks
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\rawbackslashxx}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \penalty -300
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ \vskip .33\baselineskip plus .1\baselineskip
+ %
+ % Do our best not to break after the initial.
+ \nobreak
+}}
+
+% This typesets a paragraph consisting of #1, dot leaders, and then #2
+% flush to the right margin. It is used for index and table of contents
+% entries. The paragraph is indented by \leftskip.
+%
+\def\entry#1#2{\begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing columns.
+ \vskip 0pt plus1pt
+ %
+ % Start a ``paragraph'' for the index entry so the line breaking
+ % parameters we've set above will have an effect.
+ \noindent
+ %
+ % Insert the text of the index entry. TeX will do line-breaking on it.
+ #1%
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#2}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd\ \else%
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ \ #2% The page number ends the paragraph.
+ \fi
+ \fi%
+ \par
+\endgroup}
+
+% Like \dotfill except takes at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+
+\def\secondary #1#2{
+{\parfillskip=0in \parskip=0in
+\hangindent =1in \hangafter=1
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \advance\vsize by -\ht\partialpage
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+\def\pagesofar{%
+ % Re-output the contents of the output page -- any previous material,
+ % followed by the two boxes we just split, in box0 and box2.
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+\def\enddoublecolumns{%
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+\def\balancecolumns{%
+ % Called at the end of the double column material.
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+% \def\appendixletter{\char\the\appendixno}
+% We do the following for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \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}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raise/lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% Choose a numbered-heading macro
+% #1 is heading level if unmodified by @raisesections or @lowersections
+% #2 is text for heading
+\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \chapterzzz{#2}
+\or
+ \seczzz{#2}
+\or
+ \numberedsubseczzz{#2}
+\or
+ \numberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \chapterzzz{#2}
+ \else
+ \numberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses appendix heading levels
+\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \appendixzzz{#2}
+\or
+ \appendixsectionzzz{#2}
+\or
+ \appendixsubseczzz{#2}
+\or
+ \appendixsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \appendixzzz{#2}
+ \else
+ \appendixsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% like \numhead, but chooses numberless heading levels
+\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
+\ifcase\absseclevel
+ \unnumberedzzz{#2}
+\or
+ \unnumberedseczzz{#2}
+\or
+ \unnumberedsubseczzz{#2}
+\or
+ \unnumberedsubsubseczzz{#2}
+\else
+ \ifnum \absseclevel<0
+ \unnumberedzzz{#2}
+ \else
+ \unnumberedsubsubseczzz{#2}
+ \fi
+\fi
+}
+
+% @chapter, @appendix, @unnumbered.
+\def\thischaptername{No Chapter Title}
+\outer\def\chapter{\parsearg\chapteryyy}
+\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
+\chapmacro {#1}{\the\chapno}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+% We don't substitute the actual chapter name into \thischapter
+% because we don't want its macros evaluated now.
+\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\the\chapno}}}%
+\temp
+\donoderef
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\def\appendix{\parsearg\appendixyyy}
+\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+\global\advance \appendixno by 1
+\message{\putwordAppendix\space \appendixletter}%
+\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
+\gdef\thissection{#1}%
+\gdef\thischaptername{#1}%
+\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
+ {\putwordAppendix{} \appendixletter}}}%
+\temp
+\appendixnoderef
+\global\let\section = \appendixsec
+\global\let\subsection = \appendixsubsec
+\global\let\subsubsection = \appendixsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\def\centerchap{\parsearg\centerchapyyy}
+\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
+
+% @top is like @unnumbered.
+\outer\def\top{\parsearg\unnumberedyyy}
+
+\outer\def\unnumbered{\parsearg\unnumberedyyy}
+\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz #1{%
+\secno=0 \subsecno=0 \subsubsecno=0
+%
+% This used to be simply \message{#1}, but TeX fully expands the
+% argument to \message. Therefore, if #1 contained @-commands, TeX
+% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+% expanded @cite (which turns out to cause errors because \cite is meant
+% to be executed, not expanded).
+%
+% Anyway, we don't want the fully-expanded definition of @cite to appear
+% as a result of the \message, we just want `@cite' itself. We use
+% \the<toks register> to achieve this: TeX expands \the<toks> only once,
+% simply yielding the contents of <toks register>. (We also do this for
+% the toc entries.)
+\toks0 = {#1}\message{(\the\toks0)}%
+%
+\unnumbchapmacro {#1}%
+\gdef\thischapter{#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\global\let\section = \unnumberedsec
+\global\let\subsection = \unnumberedsubsec
+\global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% Sections.
+\outer\def\numberedsec{\parsearg\secyyy}
+\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
+\def\seczzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\the\chapno}{\the\secno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsection{\parsearg\appendixsecyyy}
+\outer\def\appendixsec{\parsearg\appendixsecyyy}
+\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz #1{%
+\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
+ {\appendixletter}{\the\secno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
+\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz #1{%
+\plainsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsections.
+\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
+\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
+\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz #1{%
+\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
+\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
+\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz #1{%
+\plainsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% Subsubsections.
+\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
+\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\donoderef
+\nobreak
+}
+
+\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
+\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz #1{%
+\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
+\subsubsecheading {#1}
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
+ {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
+\temp
+\appendixnoderef
+\nobreak
+}
+
+\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
+\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz #1{%
+\plainsubsubsecheading {#1}\gdef\thissection{#1}%
+\toks0 = {#1}%
+\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
+ {\the\toks0}}}%
+\temp
+\unnumbnoderef
+\nobreak
+}
+
+% These are variants which are not "outer", so they can appear in @ifinfo.
+% Actually, they should now be obsolete; ordinary section commands should work.
+\def\infotop{\parsearg\unnumberedzzz}
+\def\infounnumbered{\parsearg\unnumberedzzz}
+\def\infounnumberedsec{\parsearg\unnumberedseczzz}
+\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
+\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
+
+\def\infoappendix{\parsearg\appendixzzz}
+\def\infoappendixsec{\parsearg\appendixseczzz}
+\def\infoappendixsubsec{\parsearg\appendixsubseczzz}
+\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
+
+\def\infochapter{\parsearg\chapterzzz}
+\def\infosection{\parsearg\sectionzzz}
+\def\infosubsection{\parsearg\subsectionzzz}
+\def\infosubsubsection{\parsearg\subsubsectionzzz}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\global\let\section = \numberedsec
+\global\let\subsection = \numberedsubsec
+\global\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{\parsearg\majorheadingzzz}
+\def\majorheadingzzz #1{%
+{\advance\chapheadingskip by 10pt \chapbreak }%
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+\def\chapheading{\parsearg\chapheadingzzz}
+\def\chapheadingzzz #1{\chapbreak %
+{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\penalty 200}
+
+% @heading, @subheading, @subsubheading.
+\def\heading{\parsearg\plainsecheading}
+\def\subheading{\parsearg\plainsubsecheading}
+\def\subsubheading{\parsearg\plainsubsubsecheading}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+\def\CHAPFplain{
+\global\let\chapmacro=\chfplain
+\global\let\unnumbchapmacro=\unnchfplain
+\global\let\centerchapmacro=\centerchfplain}
+
+% Plain chapter opening.
+% #1 is the text, #2 the chapter number or empty if unnumbered.
+\def\chfplain#1#2{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ \def\chapnum{#2}%
+ \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% Plain opening for unnumbered.
+\def\unnchfplain#1{\chfplain{#1}{}}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerchfplain#1{{%
+ \def\centerparametersmaybe{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+ }%
+ \chfplain{#1}{}%
+}}
+
+\CHAPFplain % The default
+
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+
+\def\CHAPFopen{
+\global\let\chapmacro=\chfopen
+\global\let\unnumbchapmacro=\unnchfopen
+\global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles.
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
+\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
+\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
+
+% Subsection titles.
+\newskip \subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
+\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
+\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
+
+% Subsubsection titles.
+\let\subsubsecheadingskip = \subsecheadingskip
+\let\subsubsecheadingbreak = \subsecheadingbreak
+\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
+\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
+
+
+% Print any size section title.
+%
+% #1 is the section type (sec/subsec/subsubsec), #2 is the section
+% number (maybe empty), #3 the text.
+\def\sectionheading#1#2#3{%
+ {%
+ \expandafter\advance\csname #1headingskip\endcsname by \parskip
+ \csname #1headingbreak\endcsname
+ }%
+ {%
+ % Switch to the right set of fonts.
+ \csname #1fonts\endcsname \rm
+ %
+ % Only insert the separating space if we have a section number.
+ \def\secnum{#2}%
+ \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
+ %
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent = \wd0 % zero if no section number
+ \unhbox0 #3}%
+ }%
+ \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc. We supply {\folio} at the end of the
+% argument, which will end up as the last argument to the \...entry macro.
+%
+% We open the .toc file here instead of at @setfilename or any other
+% given time so that @contents can be put in the document anywhere.
+%
+\newif\iftocfileopened
+\def\writetocentry#1{%
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ \iflinks \write\tocfile{#1{\folio}}\fi
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <tege@matematik.su.se>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \unnumbchapmacro{#1}\def\thischapter{}%
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
+ % We can't do this, because then an actual ^ in a section
+ % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
+ %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \pdfmakeoutlines
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\chapentry = \shortchapentry
+ \let\unnumbchapentry = \shortunnumberedentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\secentry ##1##2##3##4{}
+ \def\unnumbsecentry ##1##2{}
+ \def\subsecentry ##1##2##3##4##5{}
+ \def\unnumbsubsecentry ##1##2{}
+ \def\subsubsecentry ##1##2##3##4##5##6{}
+ \def\unnumbsubsubsecentry ##1##2{}
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.toc
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+\ifpdf
+ \pdfcatalog{/PageMode /UseOutlines}%
+\fi
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapter-level things, for both the long and short contents.
+\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
+
+% See comments in \dochapentry re vbox and related settings
+\def\shortchapentry#1#2#3{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
+}
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
+% We could simplify the code here by writing out an \appendixentry
+% command in the toc file for appendices, instead of using \chapentry
+% for both, but it doesn't seem worth it.
+%
+\newdimen\shortappendixwidth
+%
+\def\shortchaplabel#1{%
+ % Compute width of word "Appendix", may change with language.
+ \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
+ \shortappendixwidth = \wd0
+ %
+ % We typeset #1 in a box of constant width, regardless of the text of
+ % #1, so the chapter titles will come out aligned.
+ \setbox0 = \hbox{#1}%
+ \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
+ %
+ % This space should be plenty, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ \advance\dimen0 by 1.1em
+ \hbox to \dimen0{#1\hfil}%
+}
+
+\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
+\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
+
+% Sections.
+\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
+\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
+
+% Subsections.
+\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
+\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
+
+% And subsubsections.
+\def\subsubsecentry#1#2#3#4#5#6{%
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
+\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
+
+% This parameter controls the indentation of the various levels.
+\newdimen\tocindent \tocindent = 3pc
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% Final typesetting of a toc entry; we use the same \entry macro as for
+% the index entries, but we want to suppress hyphenation here. (We
+% can't do that in the \entry macro, since index entries might consist
+% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
+\def\tocentry#1#2{\begingroup
+ \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
+\endgroup}
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\let\subsecentryfonts = \textfonts
+\let\subsubsecentryfonts = \textfonts
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+% Furthermore, these definitions must come after we define our fonts.
+\newbox\dblarrowbox \newbox\longdblarrowbox
+\newbox\pushcharbox \newbox\bullbox
+\newbox\equivbox \newbox\errorbox
+
+%{\tentt
+%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
+%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
+%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
+%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
+% Adapted from the manmac format (p.420 of TeXbook)
+%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
+% depth .1ex\hfil}
+%}
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% Adapted from the TeXbook's \boxit.
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
+
+\global\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+
+% The @error{} command.
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\def\tex{\begingroup
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+\let\Etex=\endgroup}
+
+% Define @lisp ... @endlisp.
+% @lisp does a \begingroup so it can rebind things,
+% including the definition of @endlisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% Make each space character in the input produce a normal interword
+% space in the output. Don't allow a line break at this space, as this
+% is used only in environments like @example, where each line of input
+% should produce a line of output anyway.
+%
+{\obeyspaces %
+\gdef\sepspaces{\obeyspaces\let =\tie}}
+
+% Define \obeyedspace to be our active space, whatever it is. This is
+% for use in \parsearg.
+{\sepspaces%
+\global\let\obeyedspace= }
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip
+%
+\def\aboveenvbreak{{\advance\envskipamount by \parskip
+\endgraf \ifdim\lastskip<\envskipamount
+\removelastskip \penalty-50 \vskip\envskipamount \fi}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\long\def\cartouche{%
+\begingroup
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt %we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+% side, and for 6pt waste from
+% each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing=\comment
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \hsize=\cartinner
+ \kern3pt
+ \begingroup
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+\def\Ecartouche{%
+ \endgroup
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+\endgroup
+}}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \inENV % This group ends at the end of the body
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \singlespace
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ % @cartouche defines \nonarrowing to inhibit narrowing
+ % at next level down.
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \let\exdent=\nofillexdent
+ \let\nonarrowing=\relax
+ \fi
+}
+
+% Define the \E... control sequence only if we are inside the particular
+% environment, so the error checking in \end will work.
+%
+% To end an @example-like environment, we first end the paragraph (via
+% \afterenvbreak's vertical glue), and then the group. That way we keep
+% the zero \parskip that the environments set -- \parskip glue will be
+% inserted at the beginning of the next paragraph in the document, after
+% the environment.
+%
+\def\nonfillfinish{\afterenvbreak\endgroup}
+
+% @lisp: indented, narrowed, typewriter font.
+\def\lisp{\begingroup
+ \nonfillstart
+ \let\Elisp = \nonfillfinish
+ \tt
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+
+% @example: Same as @lisp.
+\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
+
+% @small... is usually equivalent to the non-small (@smallbook
+% redefines). We must call \example (or whatever) last in the
+% definition, since it reads the return following the @example (or
+% whatever) command.
+%
+% This actually allows (for example) @end display inside an
+% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
+%
+\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
+\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
+\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
+\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
+
+% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
+% Originally contributed by Pavel@xerox.
+\def\smalllispx{\begingroup
+ \def\Esmalllisp{\nonfillfinish\endgroup}%
+ \def\Esmallexample{\nonfillfinish\endgroup}%
+ \smallfonts
+ \lisp
+}
+
+% @display: same as @lisp except keep current font.
+%
+\def\display{\begingroup
+ \nonfillstart
+ \let\Edisplay = \nonfillfinish
+ \gobble
+}
+
+% @smalldisplay (when @smallbook): @display plus smaller fonts.
+%
+\def\smalldisplayx{\begingroup
+ \def\Esmalldisplay{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \display
+}
+
+% @format: same as @display except don't narrow margins.
+%
+\def\format{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eformat = \nonfillfinish
+ \gobble
+}
+
+% @smallformat (when @smallbook): @format plus smaller fonts.
+%
+\def\smallformatx{\begingroup
+ \def\Esmallformat{\nonfillfinish\endgroup}%
+ \smallfonts \rm
+ \format
+}
+
+% @flushleft (same as @format).
+%
+\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
+
+% @flushright.
+%
+\def\flushright{\begingroup
+ \let\nonarrowing = t
+ \nonfillstart
+ \let\Eflushright = \nonfillfinish
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins.
+%
+\def\quotation{%
+ \begingroup\inENV %This group ends at the end of the @quotation body
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \singlespace
+ \parindent=0pt
+ % We have retained a nonzero parskip for the environment, since we're
+ % doing normal filling. So to avoid extra space below the environment...
+ \def\Equotation{\parskip = 0pt \nonfillfinish}%
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \let\nonarrowing = \relax
+ \fi
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+% Allow user to change definition object font (\df) internally
+\def\setdeffont #1 {\csname DEF#1\endcsname}
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deftypemargin \deftypemargin=12pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+
+\newcount\parencount
+% define \functionparens, which makes ( and ) and & do special things.
+% \functionparens affects the group it is contained in.
+\def\activeparens{%
+\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
+\catcode`\[=\active \catcode`\]=\active}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+{\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+\global\let(=\lparen \global\let)=\rparen
+\global\let[=\lbrack \global\let]=\rbrack
+
+\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
+\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+% This is used to turn on special parens
+% but make & act ordinary (given that it's active).
+\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
+
+% Definitions of (, ) and & used in args for functions.
+% This is the definition of ( outside of all parentheses.
+\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
+ \global\advance\parencount by 1
+}
+%
+% This is the definition of ( when already inside a level of parens.
+\gdef\opnested{\char`\(\global\advance\parencount by 1 }
+%
+\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
+ % also in that case restore the outer-level definition of (.
+ \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
+ \global\advance \parencount by -1 }
+% If we encounter &foo, then turn on ()-hacking afterwards
+\gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
+%
+\gdef\normalparens{\boldbrax\let&=\ampnr}
+} % End of definition inside \activeparens
+%% These parens (in \boldbrax) actually are a little bolder than the
+%% contained text. This is especially needed for [ and ]
+\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
+\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
+\let\ampnr = \&
+\def\lbrb{{\bf\char`\[}}
+\def\rbrb{{\bf\char`\]}}
+
+% Active &'s sneak into the index arguments, so make sure it's defined.
+{
+ \catcode`& = 13
+ \global\let& = \ampnr
+}
+
+% First, defname, which formats the header line itself.
+% #1 should be the function name.
+% #2 should be the type of definition, such as "Function".
+
+\def\defname #1#2{%
+% Get the values of \leftskip and \rightskip as they were
+% outside the @def...
+\dimen2=\leftskip
+\advance\dimen2 by -\defbodyindent
+\noindent
+\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
+\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
+\parshape 2 0in \dimen0 \defargsindent \dimen1
+% Now output arg 2 ("Function" or some such)
+% ending at \deftypemargin from the right margin,
+% but stuck inside a box of width 0 so it does not interfere with linebreaking
+{% Adjust \hsize to exclude the ambient margins,
+% so that \rightline will obey them.
+\advance \hsize by -\dimen2
+\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
+% Make all lines underfull and no complaints:
+\tolerance=10000 \hbadness=10000
+\advance\leftskip by -\defbodyindent
+\exdentamount=\defbodyindent
+{\df #1}\enskip % Generate function name
+}
+
+% Actually process the body of a definition
+% #1 should be the terminating control sequence, such as \Edefun.
+% #2 should be the "another name" control sequence, such as \defunx.
+% #3 should be the control sequence that actually processes the header,
+% such as \defunheader.
+
+\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active % 61 is `='
+\obeylines\activeparens\spacesplit#3}
+
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by the space, is the class name.
+%
+\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
+
+% Used for @deftypemethod and @deftypeivar.
+% #1 is the \E... control sequence to end the definition (which we define).
+% #2 is the \...x control sequence for consecutive fns (which we define).
+% #3 is the control sequence to call to resume processing.
+% #4, delimited by a space, is the class name.
+% #5 is the method's return type.
+%
+\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
+
+% Used for @deftypeop. The change from \deftypemethparsebody is an
+% extra argument at the beginning which is the `category', instead of it
+% being the hardwired string `Method' or `Instance Variable'. We have
+% to account for this both in the \...x definition and in parsing the
+% input at hand. Thus also need a control sequence (passed as #5) for
+% the \E... definition to assign the category name to.
+%
+\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
+ \medbreak
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 ##2 ##3 {%
+ \def#4{##1}%
+ \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
+
+\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
+
+% These parsing functions are similar to the preceding ones
+% except that they do not make parens into active characters.
+% These are used for "variables" since they have no arguments.
+
+\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2{\begingroup\obeylines\spacesplit#3}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup %
+\catcode 61=\active %
+\obeylines\spacesplit#3}
+
+% This is used for \def{tp,vr}parsebody. It could probably be used for
+% some of the others, too, with some judicious conditionals.
+%
+\def\parsebodycommon#1#2#3{%
+ \begingroup\inENV %
+ \medbreak %
+ % Define the end token that this defining construct specifies
+ % so that it will exit this group.
+ \def#1{\endgraf\endgroup\medbreak}%
+ \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+ \begingroup\obeylines
+}
+
+\def\defvrparsebody#1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{#3{#4}}%
+}
+
+% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
+% type is just `struct', because we lose the braces in `{struct
+% termios}' when \spacesplit reads its undelimited argument. Sigh.
+% \let\deftpparsebody=\defvrparsebody
+%
+% So, to get around this, we put \empty in with the type name. That
+% way, TeX won't find exactly `{...}' as an undelimited argument, and
+% won't strip off the braces.
+%
+\def\deftpparsebody #1#2#3#4 {%
+ \parsebodycommon{#1}{#2}{#3}%
+ \spacesplit{\parsetpheaderline{#3{#4}}}\empty
+}
+
+% Fine, but then we have to eventually remove the \empty *and* the
+% braces (if any). That's what this does.
+%
+\def\removeemptybraces\empty#1\relax{#1}
+
+% After \spacesplit has done its work, this is called -- #1 is the final
+% thing to call, #2 the type name (which starts with \empty), and #3
+% (which might be empty) the arguments.
+%
+\def\parsetpheaderline#1#2#3{%
+ #1{\removeemptybraces#2\relax}{#3}%
+}%
+
+\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
+\medbreak %
+% Define the end token that this defining construct specifies
+% so that it will exit this group.
+\def#1{\endgraf\endgroup\medbreak}%
+\def#2##1 ##2 {\def#4{##1}%
+\begingroup\obeylines\spacesplit{#3{##2}}}%
+\parindent=0in
+\advance\leftskip by \defbodyindent
+\exdentamount=\defbodyindent
+\begingroup\obeylines\spacesplit{#3{#5}}}
+
+% Split up #2 at the first space token.
+% call #1 with two arguments:
+% the first is all of #2 before the space token,
+% the second is all of #2 after that space token.
+% If #2 contains no space token, all of it is passed as the first arg
+% and the second is passed as empty.
+
+{\obeylines
+\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
+\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
+\ifx\relax #3%
+#1{#2}{}\else #1{#2}{#3#4}\fi}}
+
+% So much for the things common to all kinds of definitions.
+
+% Define @defun.
+
+% First, define the processing that is wanted for arguments of \defun
+% Use this to expand the args and terminate the paragraph they make up
+
+\def\defunargs#1{\functionparens \sl
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Set the font temporarily and use \font in case \setfont made \tensl a macro.
+{\tensl\hyphenchar\font=0}%
+#1%
+{\tensl\hyphenchar\font=45}%
+\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+\def\deftypefunargs #1{%
+% Expand, preventing hyphenation at `-' chars.
+% Note that groups don't affect changes in \hyphenchar.
+% Use \boldbraxnoamp, not \functionparens, so that & is not special.
+\boldbraxnoamp
+\tclose{#1}% avoid \code because of side effects on active chars
+\interlinepenalty=10000
+\advance\rightskip by 0pt plus 1fil
+\endgraf\nobreak\vskip -\parskip\nobreak
+}
+
+% Do complete processing of one @defun or @defunx line already parsed.
+
+% @deffn Command forward-char nchars
+
+\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
+
+\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defun == @deffn Function
+
+\def\defun{\defparsebody\Edefun\defunx\defunheader}
+
+\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDeffunc}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefun int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
+
+% #1 is the data type. #2 is the name and args.
+\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
+% #1 is the data type, #2 the name, #3 the args.
+\def\deftypefunheaderx #1#2 #3\relax{%
+\doind {fn}{\code{#2}}% Make entry in function index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
+\deftypefunargs {#3}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
+
+\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
+
+% \defheaderxcond#1\relax$$$
+% puts #1 in @code, followed by a space, but does nothing if #1 is null.
+\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
+
+% #1 is the classification. #2 is the data type. #3 is the name and args.
+\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
+% #1 is the classification, #2 the data type, #3 the name, #4 the args.
+\def\deftypefnheaderx #1#2#3 #4\relax{%
+\doind {fn}{\code{#3}}% Make entry in function index
+\begingroup
+\normalparens % notably, turn off `&' magic, which prevents
+% at least some C++ text from working
+\defname {\defheaderxcond#2\relax$$$#3}{#1}%
+\deftypefunargs {#4}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defmac == @deffn Macro
+
+\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
+
+\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefmac}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defspec == @deffn Special Form
+
+\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
+
+\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
+\begingroup\defname {#1}{\putwordDefspec}%
+\defunargs {#2}\endgroup %
+\catcode 61=\other % Turn off change made in \defparsebody
+}
+
+% @defop CATEGORY CLASS OPERATION ARG...
+%
+\def\defop #1 {\def\defoptype{#1}%
+\defopparsebody\Edefop\defopx\defopheader\defoptype}
+%
+\def\defopheader#1#2#3{%
+\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
+\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
+\defunargs {#3}\endgroup %
+}
+
+% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
+%
+\def\deftypeop #1 {\def\deftypeopcategory{#1}%
+ \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
+ \deftypeopcategory}
+%
+% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
+\def\deftypeopheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\deftypeopcategory\ \putwordon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypemethod CLASS TYPE METHOD ARG...
+%
+\def\deftypemethod{%
+ \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
+%
+% #1 is the class name, #2 the data type, #3 the method name, #4 the args.
+\def\deftypemethodheader#1#2#3#4{%
+ \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
+ \deftypefunargs{#4}%
+ \endgroup
+}
+
+% @deftypeivar CLASS TYPE VARNAME
+%
+\def\deftypeivar{%
+ \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
+%
+% #1 is the class name, #2 the data type, #3 the variable name.
+\def\deftypeivarheader#1#2#3{%
+ \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
+ \begingroup
+ \defname{\defheaderxcond#2\relax$$$#3}
+ {\putwordInstanceVariableof\ \code{#1}}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defmethod == @defop Method
+%
+\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
+%
+% #1 is the class name, #2 the method name, #3 the args.
+\def\defmethodheader#1#2#3{%
+ \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
+ \begingroup
+ \defname{#2}{\putwordMethodon\ \code{#1}}%
+ \defunargs{#3}%
+ \endgroup
+}
+
+% @defcv {Class Option} foo-class foo-flag
+
+\def\defcv #1 {\def\defcvtype{#1}%
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
+
+\def\defcvarheader #1#2#3{%
+\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
+\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
+\defvarargs {#3}\endgroup %
+}
+
+% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
+%
+\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
+%
+\def\defivarheader#1#2#3{%
+ \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
+ \begingroup
+ \defname{#2}{\putwordInstanceVariableof\ #1}%
+ \defvarargs{#3}%
+ \endgroup
+}
+
+% @defvar
+% First, define the processing that is wanted for arguments of @defvar.
+% This is actually simple: just print them in roman.
+% This must expand the args and terminate the paragraph they make up
+\def\defvarargs #1{\normalparens #1%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak}
+
+% @defvr Counter foo-count
+
+\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
+
+\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
+\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
+
+% @defvar == @defvr Variable
+
+\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
+
+\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefvar}%
+\defvarargs {#2}\endgroup %
+}
+
+% @defopt == @defvr {User Option}
+
+\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
+
+\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
+\begingroup\defname {#1}{\putwordDefopt}%
+\defvarargs {#2}\endgroup %
+}
+
+% @deftypevar int foobar
+
+\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
+
+% #1 is the data type. #2 is the name, perhaps followed by text that
+% is actually part of the data type, which should not be put into the index.
+\def\deftypevarheader #1#2{%
+\dovarind#2 \relax% Make entry in variables index
+\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
+
+% @deftypevr {Global Flag} int enable
+
+\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
+
+\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
+\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
+\interlinepenalty=10000
+\endgraf\nobreak\vskip -\parskip\nobreak
+\endgroup}
+
+% Now define @deftp
+% Args are printed in bold, a slight difference from @defvar.
+
+\def\deftpargs #1{\bf \defvarargs{#1}}
+
+% @deftp Class window height width ...
+
+\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
+
+\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
+\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
+
+% These definitions are used if you use @defunx (etc.)
+% anywhere other than immediately after a @defun or @defunx.
+%
+\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
+\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
+\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
+\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
+\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
+\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
+\def\defopx#1 {\errmessage{@defopx in invalid context}}
+\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
+\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
+\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
+\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
+\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
+\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
+\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
+\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
+\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
+\def\defunx#1 {\errmessage{@defunx in invalid context}}
+\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
+\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scanmacro#1{%
+ \begingroup \newlinechar`\^^M
+ % Undo catcode changes of \startcontents and \doprintindex
+ \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ \toks0={#1\endinput}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \let\xeatspaces\eatspaces
+ \input \jobname.tmp
+ \endgroup
+}
+\else
+\def\scanmacro#1{%
+\begingroup \newlinechar`\^^M
+% Undo catcode changes of \startcontents and \doprintindex
+\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
+\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
+\fi
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+\def\macrolist{} % List of all defined macros in the form
+ % \do\macro1\do\macro2...
+
+% Utility routines.
+% Thisdoes \let #1 = #2, except with \csnames.
+\def\cslet#1#2{%
+\expandafter\expandafter
+\expandafter\let
+\expandafter\expandafter
+\csname#1\endcsname
+\csname#2\endcsname}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=12\catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\macrobodyctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\{=12
+ \catcode`\}=12
+ \catcode`\@=12
+ \catcode`\^^M=12
+ \usembodybackslash}
+
+\def\macroargctxt{%
+ \catcode`\~=12
+ \catcode`\^=12
+ \catcode`\_=12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \catcode`\+=12
+ \catcode`\@=12
+ \catcode`\\=12}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{The name \the\macname\space is reserved}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ % Add the macroname to \macrolist
+ \toks0 = \expandafter{\macrolist\do}%
+ \xdef\macrolist{\the\toks0
+ \expandafter\noexpand\csname\the\macname\endcsname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\def\unmacro{\parsearg\unmacroxxx}
+\def\unmacroxxx#1{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist
+ \begingroup
+ \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
+ \def\do##1{%
+ \def\tempb{##1}%
+ \ifx\tempa\tempb
+ % remove this
+ \else
+ \toks0 = \expandafter{\newmacrolist\do}%
+ \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
+ \fi}%
+ \def\newmacrolist{}%
+ % Execute macro list to define \newmacrolist
+ \macrolist
+ \global\let\macrolist\newmacrolist
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \next}
+
+% We mant to disable all macros during \shipout so that they are not
+% expanded by \write.
+\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
+ \edef\next{\macrolist}\expandafter\endgroup\next}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{\ignoreactivespaces
+\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
+ \expandafter\noexpand\csname#2\endcsname}%
+\expandafter\endgroup\next}
+
+
+\message{cross references,}
+% @xref etc.
+
+\newwrite\auxfile
+
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's job is to define \lastnode.
+\def\node{\ENVcheck\parsearg\nodezzz}
+\def\nodezzz#1{\nodexxx [#1,]}
+\def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
+\let\nwnode=\node
+\let\lastnode=\relax
+
+% The sectioning commands (@chapter, etc.) call these.
+\def\donoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Ysectionnumberandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\unnumbnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
+ \global\let\lastnode=\relax
+ \fi
+}
+\def\appendixnoderef{%
+ \ifx\lastnode\relax\else
+ \expandafter\expandafter\expandafter\setref{\lastnode}%
+ {Yappendixletterandtype}%
+ \global\let\lastnode=\relax
+ \fi
+}
+
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
+% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
+% to set \indexdummies so commands such as @code in a section title
+% aren't expanded. It would be nicer not to expand the titles in the
+% first place, but there's so many layers that that is hard to do.
+%
+\def\setref#1#2{{%
+ \indexdummies
+ \pdfmkdest{#1}%
+ \dosetq{#1-title}{Ytitle}%
+ \dosetq{#1-pg}{Ypagenumber}%
+ \dosetq{#1-snt}{#2}%
+}}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printednodename{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual}%
+ \setbox0=\hbox{\printednodename}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printednodename{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printednodename{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printednodename{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{#1@}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{#1@}%
+ \fi
+ \linkcolor
+ \fi
+ %
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\normalturnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % [mynode],
+ [\printednodename],\space
+ % page 3
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \endlink
+\endgroup}
+
+% \dosetq is the interface for calls from other macros
+
+% Use \normalturnoffactive so that punctuation chars such as underscore
+% and backslash work in node names. (\turnoffactive doesn't do \.)
+\def\dosetq#1#2{%
+ {\let\folio=0%
+ \normalturnoffactive
+ \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
+ \iflinks
+ \next
+ \fi
+ }%
+}
+
+% \internalsetq {foo}{page} expands into
+% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
+% When the aux file is read, ' is the escape character
+
+\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
+
+% Things to be expanded by \internalsetq
+
+\def\Ypagenumber{\folio}
+
+\def\Ytitle{\thissection}
+
+\def\Ynothing{}
+
+\def\Ysectionnumberandtype{%
+\ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
+\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\def\Yappendixletterandtype{%
+\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
+\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
+\else \ifnum \subsubsecno=0 %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
+\else %
+\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
+\fi \fi \fi }
+
+\gdef\xreftie{'tie}
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Non-3.0.
+\else
+ \def\linenumber{\the\inputlineno:\space}
+\fi
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+
+\def\refx#1#2{%
+ \expandafter\ifx\csname X#1\endcsname\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \csname X#1\endcsname
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file.
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+\def\readauxfile{\begingroup
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ % It was suggested to define this as 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ % Make the characters 128-255 be printing characters
+ {%
+ \count 1=128
+ \def\loop{%
+ \catcode\count 1=\other
+ \advance\count 1 by 1
+ \ifnum \count 1<256 \loop \fi
+ }%
+ }%
+ % The aux file uses ' as the escape (for now).
+ % Turn off \ as an escape so we do not lose on
+ % entries which were dumped with control sequences in their names.
+ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
+ % Reference to such entries still does not work the way one would wish,
+ % but at least they do not bomb out when the aux file is read in.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\%=\other
+ \catcode`\'=0
+ \catcode`\\=\other
+ %
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \closein 1
+ \input \jobname.aux
+ \global\havexrefstrue
+ \global\warnedobstrue
+ \fi
+ % Open the new aux file. TeX will close it automatically at exit.
+ \openout\auxfile=\jobname.aux
+\endgroup}
+
+
+% Footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+\let\ptexfootnote=\footnote
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \footnotezzz
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset and anything else that uses
+% \parseargline fail inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\long\gdef\footnotezzz{\insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Hang the footnote text off the number.
+ \hang
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
+ \else\let\next\f@t\fi \next}
+\def\f@@t{\bgroup\aftergroup\@foot\let\next}
+\def\f@t#1{#1\@foot}
+\def\@foot{\strut\par\egroup}
+
+}%end \catcode `\@=11
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ \closein 1
+ % Do not bother showing banner with post-v2.7 epsf.tex (available in
+ % doc/epsf.tex until it shows up on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is just the usual extra ignored arg for parsing this stuff.
+\def\imagexxx#1,#2,#3,#4\finish{%
+ \ifpdf
+ \centerline{\dopdfimage{#1}{#2}{#3}}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ % If the image is by itself, center it.
+ \ifvmode
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \centerline{\epsfbox{#1.eps}}%
+ \bigbreak
+ \else
+ % In the middle of a paragraph, no extra space.
+ \epsfbox{#1.eps}%
+ \fi
+ \endgroup
+ \fi
+}
+
+
+\message{localization,}
+% and i18n.
+
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\def\documentlanguage{\parsearg\dodocumentlanguage}
+\def\dodocumentlanguage#1{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \let\temp = \relax
+ \else
+ \def\temp{\input txi-#1.tex }%
+ \fi
+ \temp
+ \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
+
+% @documentencoding should change something in TeX eventually, most
+% likely, but for now just recognize it.
+\let\documentencoding = \comment
+
+
+% Page size parameters.
+%
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
+% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
+% set \parskip and call \setleading for \baselineskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.5 (or so) format.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \setleading{12pt}%
+ %
+ \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \deftypemargin = 0pt
+ \defbodyindent = .5cm
+ %
+ \let\smalldisplay = \smalldisplayx
+ \let\smallexample = \smalllispx
+ \let\smallformat = \smallformatx
+ \let\smalllisp = \smalllispx
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \setleading{12pt}%
+ \parskip = 3pt plus 2pt minus 1pt
+ %
+ \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
+% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
+\def\afourlatex{{\globaldefs = 1
+ \setleading{13.6pt}%
+ %
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
+ %
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on European A4 paper in wide format.
+\def\afourwide{%
+ \afourpaper
+ \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
+ %
+ \globaldefs = 0
+}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\def\pagesizes{\parsearg\pagesizesxxx}
+\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{13.2pt}%
+ %
+ \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}
+
+% This macro is used to make a character print one way in ttfont
+% where it can probably just be output, and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}
+%\catcode 27=\active
+%\def^^[{$\diamondsuit$}
+
+% Set up an active definition for =, but don't enable it most of the time.
+{\catcode`\==\active
+\global\def={{\tt \char 61}}}
+
+\catcode`+=\active
+\catcode`\_=\active
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+\catcode`\@=0
+
+% \rawbackslashxx output one backslash character in current font
+\global\chardef\rawbackslashxx=`\\
+%{\catcode`\\=\other
+%@gdef@rawbackslashxx{\}}
+
+% \rawbackslash redefines \ as input to do \rawbackslashxx.
+{\catcode`\\=\active
+@gdef@rawbackslash{@let\=@rawbackslashxx }}
+
+% \normalbackslash outputs one backslash in fixed width font.
+\def\normalbackslash{{\tt\rawbackslashxx}}
+
+% \catcode 17=0 % Define control-q
+\catcode`\\=\active
+
+% Used sometimes to turn off (effectively) the active characters
+% even after parsing them.
+@def@turnoffactive{@let"=@normaldoublequote
+@let\=@realbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+@def@normalturnoffactive{@let"=@normaldoublequote
+@let\=@normalbackslash
+@let~=@normaltilde
+@let^=@normalcaret
+@let_=@normalunderscore
+@let|=@normalverticalbar
+@let<=@normalless
+@let>=@normalgreater
+@let+=@normalplus
+@let$=@normaldollar}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\{ in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also back turn on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+@c Set initial fonts.
+@textfonts
+@rm
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
OpenPOWER on IntegriCloud