Article View: comp.text
Article #5651Re: Need to change table of contents page numbering in MM (Summary)
From: David Wolverton
Date: Tue, 10 Jan 1989 20:22
Date: Tue, 10 Jan 1989 20:22
76 lines
2333 bytes
2333 bytes
Many thanks to all who responded to my original plea, and especially
to Bill Stubblebine (HP) and Ron Crocker (AT&T) who pointed me to the
.)E and .)T internal macros of the MM macro package. I have included
below my final macros, for your edification and amusement. The .)E
macro redefinition is different from the original MM macro it replaces
only in the fifth argument to the .)T call.
.H 1 "Sample Program"
This sample file demonstrates the .aH macro.
Use .aH after all sections.
.de aH
.nr Hu 1 \" put headings in table of contents
.nr Hc 1 \" centered heading
.nr a +1
.af a A
.nr p 0 1 \" reset page counter to 1
.PH "''- \\na-\\\\\\\\n+p -''"
.SK
.HU "Appendix \\na: \\$1"
..
.\" MM-related macro to get appropriate TOC numbering
.de)E
.ds}3
.if\\n(:S .ds }3 \\n(H1
.am>C
.)T \\n(;1 \\$1 "\\*(}0" "\\$2" \\na-\\np \\*(}3
\\..
..
.aH "First Appendix"
appendix text for first appendix
.aH "Second Appendix"
appendix text for second appendix
.PH ""
.TC "" "" 3
The above file results in the following nroff output (whitespace has
been scrunched to make viewing easier; this is 4 pages of output):
- 1 -
1. Sample Program
This sample file demonstrates the .aH macro. Use .aH after
all sections.
- A-1 -
Appendix A: First Appendix
appendix text for first appendix
- B-1 -
Appendix B: Second Appendix
appendix text for second appendix
CONTENTS
1. Sample Program..................................... 1
Appendix A: First Appendix............................. A-1
Appendix B: Second Appendix............................ B-1
- i -
Dave Wolverton
att!houxs!daw
Technical Details
Message-ID:
<1110@houxs.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!umn-d-ub!rutgers!att!whuts!homxb!houxs!dawShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!umn-d-ub!rutgers!att!whuts!homxb!houxs!daw From: daw@houxs.ATT.COM (David Wolverton) Newsgroups: comp.text Subject: Re: Need to change table of contents page numbering in MM (Summary) Message-ID: <1110@houxs.ATT.COM> Date: 10 Jan 89 20:22:49 GMT Organization: AT&T Bell Labs, Holmdel, NJ Lines: 76