set of index entry macros for -me, with diversion fix

PAD Powell [Admin] padpowell at wateng.UUCP
Sat May 26 01:30:34 AEST 1984


The following little macro set can be used to add figure tables,
etc. to your thesis.  It also eliminates some problems with floating
keeps and index entries.


.de +x		\" *** single line, bombproof index entry
.\"	.+x <index> [p1 - p6]
.\"	Patrick Powell (padpowell at wateng), Jose Mussi (jmmussi at wateng)
.\"	University of Waterloo, VLSI Research Group
.\"	This macro is designed to be used inside anything
.\"	that might be involved with floating keeps, or diversions.
.\"	If that is the case, badly formatted index entries can
.\"	result, due to the interaction of the environments,
.\"	diversion expansions, and "unguarded text".  Anything that
.\"	is not a request which is processed by a diversion has
.\"	the current processing of that diversion performed;
.\"	since indents (.in) are INHERITED, you get progressively
.\"	indented text.
.\"
.\"	For example, if you had a figure, and put it in a floating
.\"	keep, like so:
.\"	.(z
.\"	.sp 2i	\" leave space for figure
.\"	.ce
.\"	Figure 1
.\"	.(x f
.\"	.sp 1v
.\"	Figure 1
.\"	.)x
.\"	.)z
.\"	You might find the following index entry formats, depending on
.\"	how far the float had to go, etc.
.\"	Figure 1 ...... 1
.\"	     Figure 1
.\"	 .............. 1
.\"		Figure 1
.\"	 .............. 1
.\"
.\"	Solution to this problem is the .+x macro, which is passed the
.\"	index, and the index entries
.\"	.+x f ".sp 1v" "Figure 1"
.\"
.\"	The way this is done is similar to the .(x macro, and has
.\"	been unabashedly been stolen.  If you want to use the other
.\"	.)x P A
.\"	options, define a similar set of macros, setting P if $2
.\"	is non-null, and A if $3 is non-null;  this is the +y
.\"	macro.
.if \\n@>4 .tm >> +x \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
.\" please note these cases MUST be in this order
.ie !"\\n(.z"" \
\{\
\!.+x "\\$1"  "\\$2"  "\\$3"  "\\$4"  "\\$5"  "\\$6"  "\\$7"
.\}
.el \
\{\
.	(x \\$1
.	if !""\\$2" \\$2
.	if !""\\$3" \\$3
.	if !""\\$4" \\$4
.	if !""\\$5" \\$5
.	if !""\\$6" \\$6
.	if !""\\$7" \\$7
.\"	NOTE: no tab before )x, .am will fail to close; see .(x macro, and
.\"	TROFF Reference Manual, .de request
.)x
.\}
..
.de +y	\" allow the setting of (x P A
.if \\n@>4 .tm >> +y \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
.\" please note these cases MUST be in this order
.ie !"\\n(.z"" \
\{\
\!.+y "\\$1"  "\\$2"  "\\$3"  "\\$4"  "\\$5"  "\\$6"  "\\$7"
.\}
.el \
\{\
.	(x \\$1
.	if !""\\$4" \\$4
.	if !""\\$5" \\$5
.	if !""\\$6" \\$6
.	if !""\\$7" \\$7
.\"	NOTE: no tab before )x, .am will fail to close; see .(x macro, and
.\"	TROFF Reference Manual, .de request
.)x \\$2 \\$3
.\}
..



More information about the Comp.unix mailing list