| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 19 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 20 |
|
| 21 |
<head> |
| 22 |
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> |
| 23 |
<title>Mom -- Document processing, tables of contents</title> |
| 24 |
<link rel="stylesheet" type="text/css" href="stylesheet.css" /> |
| 25 |
</head> |
| 26 |
|
| 27 |
<body style="background-color: #f5faff;"> |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
<div id="top" class="page"> |
| 32 |
|
| 33 |
|
| 34 |
<table style="width: 100%;"> |
| 35 |
<tr> |
| 36 |
<td><a href="toc.html">Back to Table of Contents</a></td> |
| 37 |
<td style="text-align: right;"><a href="refer.html#top">Next: Bibliographies and references</a></td> |
| 38 |
</tr> |
| 39 |
</table> |
| 40 |
|
| 41 |
<h1 class="docs">Tables of contents</h1> |
| 42 |
|
| 43 |
<div style="width: 68%; margin: auto;"> |
| 44 |
<ul class="no-enumerator"> |
| 45 |
<li><a href="#toc-intro">Introduction to tables of contents</a></li> |
| 46 |
<li><a href="#toc-appearance">Tables of contents appearance and behaviour</a></li> |
| 47 |
<li><a href="#pdf-output">PDF output</a> |
| 48 |
<ul style="margin-left: -.5em; list-style-type: disc;"> |
| 49 |
<li><a href="#positioning">Positioning the table of contents</a></li> |
| 50 |
<li><a href="#auto-relocate-toc">AUTO_RELOCATE_TOC</a></li> |
| 51 |
<li><a href="#psselect"><kbd>psselect</kbd></a></li> |
| 52 |
</ul></li> |
| 53 |
<li><a href="#toc">The TOC macro</a> |
| 54 |
<ul style="margin-left: -.5em; list-style-type: disc;"> |
| 55 |
<li><a href="#toc-heading">TOC_HEADING</a></li> |
| 56 |
</ul></li> |
| 57 |
<li><a href="#toc-control-top">Control macros for tables of contents</a> |
| 58 |
<ul style="margin-left: -.5em; list-style-type: disc;"> |
| 59 |
<li><a href="#index-toc-control">Table of contents control macros</a></li> |
| 60 |
</ul></li> |
| 61 |
</ul> |
| 62 |
</div> |
| 63 |
|
| 64 |
<div class="rule-medium"><hr/></div> |
| 65 |
|
| 66 |
<h2 id="toc-intro" class="docs">Introduction to tables of contents</h2> |
| 67 |
|
| 68 |
<p> |
| 69 |
Want a table of contents for your document? Easy. Just enter |
| 70 |
<br/> |
| 71 |
<span class="pre-in-pp"> |
| 72 |
.TOC |
| 73 |
</span> |
| 74 |
as the very last macro of your input file. Mom will have picked |
| 75 |
up all document titles (in |
| 76 |
<a href="rectoverso.html#collate">collated</a> |
| 77 |
documents) and headings, as well as the endnotes section and |
| 78 |
bibliography, if they exist, and assigned them the appropriate page |
| 79 |
number. Talk about a no-brainer! |
| 80 |
</p> |
| 81 |
|
| 82 |
<p> |
| 83 |
That said, tables of contents have even more control macros than |
| 84 |
endnotes. As always, the reason for so many control macros is so |
| 85 |
that if you want to change just about any aspect of the table of |
| 86 |
contents’ typographic appearance, you can. |
| 87 |
</p> |
| 88 |
|
| 89 |
<h2 id="toc-appearance" class="docs">Tables of contents appearance and behaviour</h2> |
| 90 |
|
| 91 |
<p> |
| 92 |
When you output a table of contents (with |
| 93 |
<kbd><a href="#toc">.TOC</a></kbd>), |
| 94 |
mom finishes processing the last page of your document then breaks |
| 95 |
to a new page for printing the table of contents. |
| 96 |
</p> |
| 97 |
|
| 98 |
<p> |
| 99 |
Mom follows standard typesetting conventions for tables of contents. |
| 100 |
To this end, if |
| 101 |
<a href="headfootpage.html#headers">HEADERS</a> |
| 102 |
are enabled for the document, the first page of the table of |
| 103 |
contents has no page header, but does have a first page number |
| 104 |
(roman numeral), always “i”, in the bottom margin. If |
| 105 |
<a href="headfootpage.html#footers">FOOTERS</a> |
| 106 |
are enabled for the document, the first page has neither a footer, |
| 107 |
nor a page number in the top margin. (If you absolutely must have |
| 108 |
a page footer on the first page of the table of contents, simply |
| 109 |
invoke |
| 110 |
<a href="headfootpage.html#footer-on-first-page"><kbd>.FOOTER_ON_FIRST_PAGE</kbd></a> |
| 111 |
immediately before <kbd>.TOC</kbd>.) Subsequent table of contents |
| 112 |
pages have both page headers or footers and a page number. |
| 113 |
</p> |
| 114 |
|
| 115 |
<p> |
| 116 |
Entries in a table of contents are hierarchically indented, as you |
| 117 |
would expect, and if headings are numbered in the body of the document, |
| 118 |
you can instruct mom to number them in the table of contents as |
| 119 |
well (see |
| 120 |
<a href="#toc-entry-numbers">TOC_ENTRY_NUMBERS</a>). |
| 121 |
</p> |
| 122 |
|
| 123 |
<p> |
| 124 |
Tables of contents are never set in columns, regardless of whether |
| 125 |
the rest of the document is. Lastly, if |
| 126 |
<a href="rectoverso.html#recto-verso">recto/verso</a> |
| 127 |
printing is enabled, the table of contents respects it. This |
| 128 |
sometimes leads to tables of contents that begin with the wrong |
| 129 |
margins, but the margins can be corrected either by outputting a |
| 130 |
<a href="headfootpage.html#blank-pages">BLANKPAGE</a> |
| 131 |
or by using the control macro |
| 132 |
<a href="#toc-rv-switch">TOC_RV_SWITCH</a>. |
| 133 |
</p> |
| 134 |
|
| 135 |
<p> |
| 136 |
The overall table of contents |
| 137 |
<a href="definitions.html#family">family</a>, |
| 138 |
<a href="definitions.html#ps">point size</a> |
| 139 |
and |
| 140 |
<a href="definitions.html#leading">lead</a> |
| 141 |
can be altered with |
| 142 |
<a href="definitions.html#controlmacro">control macros</a>, |
| 143 |
as can the family, |
| 144 |
<a href="definitions.html#font">font</a>, |
| 145 |
point size and indent of each level of entry. Furthermore, the page |
| 146 |
numbering style can be changed, as can the amount of visual space |
| 147 |
reserved for entry page numbers. |
| 148 |
</p> |
| 149 |
|
| 150 |
<h2 id="pdf-output" class="docs">PDF output</h2> |
| 151 |
|
| 152 |
<p> |
| 153 |
When files containing a table of contents are processed with |
| 154 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a>, |
| 155 |
entries in the table of contents are clickable links when the |
| 156 |
document is viewed at the screen. The colour of the links is the |
| 157 |
last <kbd>.PDF_LINK_COLOR</kbd> in effect, so if you wish another |
| 158 |
colour, it should be set just before issuing <kbd>.TOC</kbd>. |
| 159 |
</p> |
| 160 |
|
| 161 |
<p> |
| 162 |
When preparing files for printing, coloured links in both the table |
| 163 |
of contents and elsewhere in the document may not be desirable. |
| 164 |
You can disable the colour by passing |
| 165 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 166 |
the <kbd>-c</kbd> option, like this: <br/> |
| 167 |
<span class="pre-in-pp"> |
| 168 |
pdfmom -c doc.mom > doc.pdf |
| 169 |
</span> |
| 170 |
</p> |
| 171 |
|
| 172 |
<h3 id="positioning" class="docs">Positioning the Table of Contents</h3> |
| 173 |
|
| 174 |
<p> |
| 175 |
Because a table of contents can’t be generated until the |
| 176 |
end of a document (hence the last macro in the file), it is also |
| 177 |
the last page of the document. While this is desirable for some |
| 178 |
language conventions—French, for example—it is not |
| 179 |
desirable for others. |
| 180 |
</p> |
| 181 |
|
| 182 |
<h4 id="auto-relocate-toc" class="docs">Automatic PDF relocation of the Table of Contents</h4> |
| 183 |
|
| 184 |
<p> |
| 185 |
When |
| 186 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 187 |
is used to process files with a table of contents, the macro |
| 188 |
<kbd>.AUTO_RELOCATE_TOC</kbd> can be used to reposition the table |
| 189 |
of contents to the top of the output document, with the presence |
| 190 |
of a cover and/or title page sensibly taken into account. Full |
| 191 |
AUTO_RELOCATE_TOC usage is described in the manual, |
| 192 |
<a href="https://www.schaffter.ca/mom/pdf/mom-pdf.pdf"><span class="book-title">Producing PDFs with groff and mom</span></a>. |
| 193 |
</p> |
| 194 |
|
| 195 |
<p> |
| 196 |
In order to take advantage of automatic table of contents |
| 197 |
repositioning, you must use |
| 198 |
<a href="using.html#pdfmom" style="font-weight: bold">pdfmom</a> |
| 199 |
with groff’s native PDF driver (i.e. without the |
| 200 |
<strong>-Tps</strong> flag). Files that need to be processed with |
| 201 |
the <strong>-Tps</strong> flag require you to reposition the table |
| 202 |
of contents yourself with <strong>psselect</strong>, described |
| 203 |
below. |
| 204 |
</p> |
| 205 |
|
| 206 |
<div class="box-tip"> |
| 207 |
<p class="tip"> |
| 208 |
<span class="note">Note:</span> |
| 209 |
<kbd>AUTO_RELOCATE_TOC</kbd> must come before |
| 210 |
<a href="docprocessing.html#start">START</a>. |
| 211 |
</p> |
| 212 |
</div> |
| 213 |
|
| 214 |
<h4 id="psselect" class="docs"><span style="text-transform: none">Using psselect to relocate the Table of Contents in PostScript documents</span></h4> |
| 215 |
|
| 216 |
<p> |
| 217 |
To change the location of the table of contents in files |
| 218 |
processed with <kbd>pdfmom -Tps</kbd>, you have two choices: |
| 219 |
rearrange the pages by hand (okay for one or two hard copies), |
| 220 |
or use the <strong>psselect</strong> programme provided by the |
| 221 |
<strong>psutils</strong> suite of tools (which you may have to |
| 222 |
install as a package from your distribution if it is not already on |
| 223 |
your system). |
| 224 |
</p> |
| 225 |
|
| 226 |
<p> |
| 227 |
The procedure for using <strong>psselect</strong> to put the |
| 228 |
table of contents near the beginning of a document begins by |
| 229 |
you determining how many pages it contains. You can do this by |
| 230 |
previewing the document with the document viewer of your choice |
| 231 |
(gv, Okular, Evince, etc). |
| 232 |
</p> |
| 233 |
|
| 234 |
<p> |
| 235 |
Once you know the number of pages in the table of contents, you use |
| 236 |
<strong>psselect</strong> to place them where you want. |
| 237 |
</p> |
| 238 |
|
| 239 |
<p> |
| 240 |
Say, for example, the table of contents runs to just one page. The |
| 241 |
command to place a one-page table of contents at the start of a |
| 242 |
document is: |
| 243 |
<br/> |
| 244 |
<span class="pre-in-pp"> |
| 245 |
psselect -p _1,1-_2 |
| 246 |
</span> |
| 247 |
The <kbd>-p</kbd> option instructs <kbd>psselect</kbd> that what |
| 248 |
follows is a comma-separated list of the order in which you want |
| 249 |
pages of a document rearranged. The underscore character means |
| 250 |
"counting backwards from the end of the document". Thus, the above |
| 251 |
says: "Put the last page first (i.e. the table of contents), followed |
| 252 |
by all pages from the original first page up to the second to last |
| 253 |
(i.e. the last page before the table of contents)." |
| 254 |
</p> |
| 255 |
|
| 256 |
<p> |
| 257 |
If your table of contents runs to two pages, the option to |
| 258 |
<kbd>psselect</kbd> would look like this: |
| 259 |
<br/> |
| 260 |
<span class="pre-in-pp"> |
| 261 |
psselect -p _1-_2,1-_3 |
| 262 |
</span> |
| 263 |
If your table of contents runs to two pages and you have a cover |
| 264 |
page, the command would look like this: |
| 265 |
<br/> |
| 266 |
<span class="pre-in-pp"> |
| 267 |
psselect -p 1,_1-_2,2-_3 |
| 268 |
</span> |
| 269 |
</p> |
| 270 |
|
| 271 |
<div class="box-tip"> |
| 272 |
<p class="tip"> |
| 273 |
<span class="note">Note:</span> |
| 274 |
<kbd>psselect</kbd> outputs to stdout, so you have to redirect the |
| 275 |
output to a new file. |
| 276 |
<br/> |
| 277 |
<span class="pre-in-pp" style="margin-bottom: -1em"> |
| 278 |
psselect -p <page list> <file>.ps > <new-file>.ps |
| 279 |
</span> |
| 280 |
</p> |
| 281 |
</div> |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
<div class="macro-id-overline"> |
| 286 |
<h3 id="toc" class="macro-id">The TOC macro</h3> |
| 287 |
</div> |
| 288 |
|
| 289 |
<div class="box-macro-args"> |
| 290 |
Macro: <b>TOC</b> <kbd class="macro-args">[ INCLUDE_TITLE ]</kbd> |
| 291 |
</div> |
| 292 |
|
| 293 |
<p> |
| 294 |
If you want a table of contents, just place <kbd>.TOC</kbd> at the |
| 295 |
very end of your document. Mom takes care of the rest. |
| 296 |
</p> |
| 297 |
|
| 298 |
<p> |
| 299 |
The optional argument, <kbd>INCLUDE_TITLE</kbd>, is needed only |
| 300 |
if your document is standalone, i.e. is not collated, for example |
| 301 |
an essay. By default, mom does not include the title (and page |
| 302 |
number) of standalone documents in the Table of Contents since it |
| 303 |
is largely redundant. If you would like her to include the title, |
| 304 |
invoke <kbd>.TOC</kbd> with <kbd>INCLUDE_TITLE</kbd>. |
| 305 |
</p> |
| 306 |
|
| 307 |
<div class="box-tip"> |
| 308 |
<p class="tip"> |
| 309 |
<span class="note">Note:</span> |
| 310 |
If the last line of text in a document, before <kbd>.TOC</kbd>, |
| 311 |
falls too close to the bottom margin, or if the line is followed |
| 312 |
by a macro likely to cause a linebreak (e.g. <kbd>.LIST OFF</kbd> or |
| 313 |
<kbd>.IQ</kbd>), mom may output a superfluous blank page before the |
| 314 |
Table of Contents. |
| 315 |
</p> |
| 316 |
|
| 317 |
<p class="tip-bottom" style="margin-top: -1em"> |
| 318 |
In order to avoid this, insert |
| 319 |
<a href="typesetting.html#el"><kbd>.EL</kbd></a> |
| 320 |
after the last line of text, before <kbd>.TOC</kbd> and/or any |
| 321 |
concluding macros. For example, |
| 322 |
<br/> |
| 323 |
<span class="pre-in-pp"> |
| 324 |
some concluding text. |
| 325 |
.EL |
| 326 |
.TOC |
| 327 |
</span> |
| 328 |
or |
| 329 |
<br/> |
| 330 |
<span class="pre-in-pp"> |
| 331 |
some concluding text. |
| 332 |
.EL |
| 333 |
.LIST OFF |
| 334 |
.TOC |
| 335 |
</span> |
| 336 |
</p> |
| 337 |
</div> |
| 338 |
|
| 339 |
<div class="macro-id-overline"> |
| 340 |
<h3 class="macro-id">TOC heading</h3> |
| 341 |
</div> |
| 342 |
|
| 343 |
<div id="toc-heading" class="box-macro-args"> |
| 344 |
Macro: <b>TOC_HEADING</b> <kbd class="macro-args">"<single line TOC heading>"</kbd> |
| 345 |
</div> |
| 346 |
<p class="requires"> |
| 347 |
• Argument must be enclosed in double-quotes |
| 348 |
</p> |
| 349 |
|
| 350 |
<p> |
| 351 |
You may sometimes want to insert a line of text into the table of |
| 352 |
contents without it referring to a page number, for example to |
| 353 |
identify a “Part I” and a “Part II”. |
| 354 |
</p> |
| 355 |
|
| 356 |
<p> |
| 357 |
Placed before any instance of the |
| 358 |
<a href="docprocessing.html#start">START</a> |
| 359 |
macro, TOC_HEADING inserts its text into the table of contents |
| 360 |
before the next section title or heading. A modest amount of |
| 361 |
whitespace is introduced above and beneath to distinguish it easily |
| 362 |
from table of contents entries. |
| 363 |
</p> |
| 364 |
|
| 365 |
<p> |
| 366 |
The appearance of the heading may be controlled with |
| 367 |
the macro |
| 368 |
<a href="docprocessing.html#toc-heading-style">TOC_HEADING_STYLE</a>. |
| 369 |
</p> |
| 370 |
|
| 371 |
|
| 372 |
<div class="rule-short"><hr/></div> |
| 373 |
|
| 374 |
<h2 id="toc-control-top" class="macro-group">Control macros for tables of contents</h2> |
| 375 |
|
| 376 |
<p> |
| 377 |
Aside from allowing you to set the style of table of contents |
| 378 |
entries on a per-level basis, the control macros let you design |
| 379 |
the table of contents as if they were a complete document unto |
| 380 |
themselves (overall family, headers/footers, pagination, etc). |
| 381 |
</p> |
| 382 |
|
| 383 |
<div class="defaults-container" style="background-color: #ded4bd; border: none;"> |
| 384 |
<h3 id="index-toc-control" class="docs defaults">Table of contents control macros</h3> |
| 385 |
|
| 386 |
<ol style="margin-top: .5em; padding-bottom: .5em;"> |
| 387 |
<li><a href="#toc-general">General table of contents style control</a> |
| 388 |
<ul style="margin-left: -.5em;"> |
| 389 |
<li><a href="#toc-margins">TOC_MARGINS</a> – left and right margins for tables of contents</li> |
| 390 |
<li><a href="#toc-family">TOC_FAMILY</a> – base family for tables of contents</li> |
| 391 |
<li><a href="#toc-pt-size">TOC_PT_SIZE</a> – base point size for tables of contents</li> |
| 392 |
<li><a href="#toc-lead">TOC_LEAD</a> – leading of tables of contents</li> |
| 393 |
</ul></li> |
| 394 |
<li><a href="#toc-pagenumbering">Page numbering</a> |
| 395 |
<ul style="margin-left: -.5em;"> |
| 396 |
<li><a href="#paginate-toc">PAGINATE_TOC</a> – turn table of contents pagination on or off</li> |
| 397 |
<li><a href="#toc-pagenum-style">TOC_PAGENUM_STYLE</a> – table of contents page numbering style</li> |
| 398 |
</ul></li> |
| 399 |
<li><a href="#toc-header">Header string (e.g. “Contents”) and style</a> |
| 400 |
<ul style="margin-left: -.5em;"> |
| 401 |
<li><a href="#toc-header-string">Changing the header string</a></li> |
| 402 |
<li><a href="#toc-header-v-pos">Header string vertical placement</a></li> |
| 403 |
<li><a href="#toc-header-style">Header string control macros and defaults</a></li> |
| 404 |
</ul></li> |
| 405 |
<li><a href="#toc-style">Entries and reference page number style</a> |
| 406 |
<ul style="margin-left: -.5em;"> |
| 407 |
<li><a href="#toc-pn">Reference page numbers style control</a></li> |
| 408 |
<li><a href="#toc-title-style">Title entry style control</a></li> |
| 409 |
<li><a href="#toc-entry-style">Heading entry style control</a></li> |
| 410 |
<li>Numbering table of contents items |
| 411 |
<ul style="margin-left: -.75em; list-style: disc"> |
| 412 |
<li><a href="#toc-prefix-ch-number">Prefix chapter/section numbers</a> |
| 413 |
<ul style="margin-left: -.75em;"> |
| 414 |
<li><a href="#toc-pad-ch-numbers">Pad chapter/section numbers</a></li> |
| 415 |
</ul></li> |
| 416 |
<li><a href="#toc-entry-numbers">Numbering heading entries</a></li> |
| 417 |
</ul></li> |
| 418 |
</ul></li> |
| 419 |
<li><a href="#toc-additional">Additional table of contents control macros</a> |
| 420 |
<ul style="margin-left: -.5em;"> |
| 421 |
<li><a href="#toc-appends-author">Append author(s) to table of contents title entries</a></li> |
| 422 |
<li><a href="#toc-title-entry">Alter the wording of a table of contents title entry</a></li> |
| 423 |
<li><a href="#space-toc-items">Space table of contents entries pleasingly</a></li> |
| 424 |
<li><a href="#toc-padding">Establish the number of placeholders to leave for page reference numbers</a></li> |
| 425 |
<li><a href="#toc-rv-switch">Switch tables of contents page margins</a></li> |
| 426 |
</ul></li> |
| 427 |
<li><a href="#toc-more">I still need more!</a></li> |
| 428 |
</ol> |
| 429 |
</div> |
| 430 |
|
| 431 |
<h4 id="toc-general" class="docs" style="margin-top: -1.5em; margin-bottom: .5em;">1. General tables of contents style control</h4> |
| 432 |
|
| 433 |
|
| 434 |
|
| 435 |
<div id="toc-margins" class="box-macro-args"> |
| 436 |
Macro: <b>TOC_MARGINS</b> <kbd class="macro-args"><toc left margin> <toc right margin></kbd> |
| 437 |
</div> |
| 438 |
<p class="requires"> |
| 439 |
• Requires a <a href="definitions.html#unitofmeasure">unit of measure</a> |
| 440 |
</p> |
| 441 |
|
| 442 |
<p> |
| 443 |
By default, mom applies the left and right margins active at the |
| 444 |
first instance of |
| 445 |
<a href="docprocessing.html#start">START</a> |
| 446 |
to the table of contents. In cases where this is not desirable, |
| 447 |
TOC_MARGINS allows you to set the table of contents' margins |
| 448 |
explicitly. Values must be given for both arguments. |
| 449 |
</p> |
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
<div id="toc-family" class="box-macro-args"> |
| 454 |
Macro: <b>TOC_FAMILY</b> <kbd class="macro-args"><family></kbd> |
| 455 |
</div> |
| 456 |
|
| 457 |
<p> |
| 458 |
TOC_FAMILY establishes the default family for every page element in |
| 459 |
a table of contents, including the table of contents’ header |
| 460 |
string (by default, “Contents”) and the page |
| 461 |
number in the top or bottom margin. The default is the prevailing |
| 462 |
document family. |
| 463 |
</p> |
| 464 |
|
| 465 |
<p> |
| 466 |
All page elements in the table of contents also have their own |
| 467 |
_FAMILY control macros, which can be used on a case-by-case basis to |
| 468 |
override the default family set with TOC_FAMILY. |
| 469 |
</p> |
| 470 |
|
| 471 |
|
| 472 |
|
| 473 |
<div id="toc-pt-size" class="box-macro-args"> |
| 474 |
Macro: <b>TOC_PT_SIZE</b> <kbd class="macro-args"><base type size of the toc></kbd> |
| 475 |
</div> |
| 476 |
|
| 477 |
<p class="requires"> |
| 478 |
• Does not require a <a href="definitions.html#unitofmeasure">unit of measure</a>; points is assumed |
| 479 |
</p> |
| 480 |
|
| 481 |
<p> |
| 482 |
Unlike most other control macros that deal with size of document |
| 483 |
elements, TOC_PT_SIZE takes as its argument an absolute value, |
| 484 |
relative to nothing. (Compare this with the |
| 485 |
<a href="docelement.html#point-size">_SIZE</a> |
| 486 |
control macros.) The argument represents the base point size |
| 487 |
of tables of contents from which the size of all other table of |
| 488 |
contents elements are calculated. |
| 489 |
</p> |
| 490 |
|
| 491 |
<p> |
| 492 |
The default for |
| 493 |
<a href="docprocessing.html#printstyle">PRINTSTYLE <kbd>TYPESET</kbd></a> |
| 494 |
is 12.5 points (the same default size used in the body of the |
| 495 |
document). |
| 496 |
</p> |
| 497 |
|
| 498 |
|
| 499 |
|
| 500 |
<div id="toc-lead" class="box-macro-args"> |
| 501 |
Macro: <b>TOC_LEAD</b> <kbd class="macro-args"><leading of the toc> [ ADJUST ]</kbd> |
| 502 |
</div> |
| 503 |
|
| 504 |
<p class="requires"> |
| 505 |
• Does not require a <a href="definitions.html#unitofmeasure">unit of measure</a>; points is assumed |
| 506 |
</p> |
| 507 |
|
| 508 |
<p> |
| 509 |
Unlike most other control macros that deal with leading of document |
| 510 |
elements, TOC_LEAD takes as its argument an absolute value, relative |
| 511 |
to nothing. Therefore, the argument represents the |
| 512 |
<a href="definitions.html#leading">leading</a> |
| 513 |
of tables of contents in |
| 514 |
<a href="definitions.html#picaspoints">points</a> |
| 515 |
unless you append an alternative |
| 516 |
<a href="definitions.html#unitofmeasure">unit of measure</a>. |
| 517 |
For example, |
| 518 |
<br/> |
| 519 |
<span class="pre-in-pp"> |
| 520 |
.TOC_LEAD 14 |
| 521 |
</span> |
| 522 |
sets the base leading of tables of contents to 14 points, whereas |
| 523 |
<br/> |
| 524 |
<span class="pre-in-pp"> |
| 525 |
.TOC_LEAD .5i |
| 526 |
</span> |
| 527 |
sets the base leading of tables of contents to 1/2 inch. |
| 528 |
</p> |
| 529 |
|
| 530 |
<p> |
| 531 |
If you want the leading of tables of contents adjusted to fill the |
| 532 |
page, pass TOC_LEAD the optional argument <kbd>ADJUST</kbd>. (See |
| 533 |
<a href="docprocessing.html#doc-lead-adjust">DOC_LEAD_ADJUST</a> |
| 534 |
for an explanation of leading adjustment.) |
| 535 |
</p> |
| 536 |
|
| 537 |
<p> |
| 538 |
The default for |
| 539 |
<a href="docprocessing.html#printstyle">PRINTSTYLE TYPESET</a> |
| 540 |
is the prevailing document lead (16 by default), adjusted. |
| 541 |
</p> |
| 542 |
|
| 543 |
<div class="box-tip"> |
| 544 |
<p class="tip"> |
| 545 |
<span class="note">Note:</span> |
| 546 |
Even if you give mom a <kbd>.DOC_LEAD_ADJUST OFF</kbd> command, |
| 547 |
she will still, by default, adjust the leading of the table of |
| 548 |
contents. You <i>must</i> enter |
| 549 |
<kbd>TOC_LEAD <lead></kbd> with no <kbd>ADJUST</kbd> |
| 550 |
argument to disable this default behaviour. |
| 551 |
</p> |
| 552 |
|
| 553 |
<p class="tip-bottom"> |
| 554 |
<span class="additional-note">Additional note:</span> |
| 555 |
Tables of contents are always double-spaced in |
| 556 |
<a href="docprocessing.html#printstyle">PRINTSTYLE <kbd>TYPEWRITE</kbd></a>, |
| 557 |
regardless of whether the body of the document is single-spaced. |
| 558 |
</p> |
| 559 |
</div> |
| 560 |
|
| 561 |
<h4 id="toc-pagenumbering" class="docs">2. Page numbering</h4> |
| 562 |
|
| 563 |
<p> |
| 564 |
The pagination style of tables of contents is controlled by the same |
| 565 |
macros that control |
| 566 |
<a href="headfootpage.html#pagination-intro">document page numbering</a>, |
| 567 |
except |
| 568 |
<a href="headfootpage.html#pagenum">PAGENUM</a> |
| 569 |
(tables of contents always start on page 1). The defaults are the |
| 570 |
same as for the rest of the document, with the exception that tables |
| 571 |
of contents, by default, have roman numeral page numbers. |
| 572 |
</p> |
| 573 |
|
| 574 |
<p> |
| 575 |
Therefore, if you wish to change some aspect of table of contents |
| 576 |
pagination style, use the |
| 577 |
<a href="headfootpage.html#index-pagination-control">document pagination control macros</a> |
| 578 |
immediately prior to <kbd>.TOC</kbd>. |
| 579 |
</p> |
| 580 |
|
| 581 |
<p> |
| 582 |
A special macro, |
| 583 |
<a href="#toc-pagenum-style">TOC_PAGENUM_STYLE</a>, |
| 584 |
controls the style of table of contents pagination (i.e. the actual |
| 585 |
table of contents pages’ numbers, not the page number |
| 586 |
references of entries). |
| 587 |
</p> |
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
<div id="paginate-toc" class="box-macro-args"> |
| 592 |
Macro: <b>PAGINATE_TOC</b> <kbd class="macro-args"><toggle></kbd> |
| 593 |
</div> |
| 594 |
|
| 595 |
<p> |
| 596 |
By default, mom paginates tables of contents. If you’d like |
| 597 |
her not to, do |
| 598 |
<br/> |
| 599 |
<span class="pre-in-pp"> |
| 600 |
.PAGINATE_TOC OFF |
| 601 |
</span> |
| 602 |
(or <kbd>NO, X,</kbd> etc). |
| 603 |
</p> |
| 604 |
|
| 605 |
<div class="box-tip"> |
| 606 |
<p class="tip"> |
| 607 |
<span class="note">Note:</span> |
| 608 |
Simply invoking |
| 609 |
<kbd>.PAGINATION OFF</kbd> |
| 610 |
or |
| 611 |
<kbd>.PAGINATE OFF</kbd> |
| 612 |
disables table of contents pagination <i>for the first |
| 613 |
page of the table of contents only.</i> You must use |
| 614 |
<kbd>.PAGINATE_TOC OFF</kbd> to disable table of contents |
| 615 |
pagination completely, even if pagination is turned off elsewhere in |
| 616 |
your document. |
| 617 |
</p> |
| 618 |
</div> |
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
<div id="toc-pagenum-style" class="box-macro-args"> |
| 623 |
Macro: <b>TOC_PAGENUM_STYLE</b> <kbd class="macro-args"><DIGIT | ROMAN | roman | ALPHA | alpha></kbd> |
| 624 |
</div> |
| 625 |
<p class="requires"> |
| 626 |
See |
| 627 |
<a href="headfootpage.html#pagenum-style"><span style="font-style: normal;">PAGENUM_STYLE</span></a> |
| 628 |
for an explanation of the arguments. |
| 629 |
</p> |
| 630 |
|
| 631 |
<p> |
| 632 |
By default, mom uses roman numerals to number table of contents |
| 633 |
pages. Use TOC_PAGENUM_STYLE if you’d prefer something else. |
| 634 |
For example, to have standard digits instead of roman numerals, do |
| 635 |
the following: |
| 636 |
<br/> |
| 637 |
<span class="pre-in-pp"> |
| 638 |
.TOC_PAGENUM_STYLE DIGIT |
| 639 |
</span> |
| 640 |
</p> |
| 641 |
|
| 642 |
<h4 id="toc-header" class="docs" style="margin-top: -.5em;">3. Header string and style</h4> |
| 643 |
|
| 644 |
<p> |
| 645 |
The table of contents header string is the title that appears at the top of the |
| 646 |
table of contents. By default, it’s “Contents”.</p> |
| 647 |
|
| 648 |
<div id="toc-header-string" class="box-macro-args"> |
| 649 |
Macro: <b>TOC_HEADER_STRING</b> <kbd class="macro-args"><string></kbd> |
| 650 |
</div> |
| 651 |
|
| 652 |
<p> |
| 653 |
If you’d like the title of the table of contents to read |
| 654 |
something other than “Contents”, do, for |
| 655 |
example |
| 656 |
<br/> |
| 657 |
<span class="pre-in-pp"> |
| 658 |
.TOC_HEADER_STRING "Table of Contents" |
| 659 |
</span> |
| 660 |
</p> |
| 661 |
|
| 662 |
<h5 id="toc-header-v-pos" class="docs" style="margin-top: 1em; text-transform: none;">Header string vertical placement</h5> |
| 663 |
|
| 664 |
<div id="toc-header-v-pos1" class="box-macro-args" style="margin-top: 1em"> |
| 665 |
Macro: <b>TOC_HEADER_V_POS</b> <kbd class="macro-args"><distance from top of page></kbd> |
| 666 |
</div> |
| 667 |
<p class="requires"> |
| 668 |
• Requires a <a href="definitions.html#unitofmeasure">unit of measure</a> |
| 669 |
</p> |
| 670 |
|
| 671 |
<p> |
| 672 |
Normally, the TOC header string falls at the same vertical position |
| 673 |
as the |
| 674 |
<a href="definitions.html#docheader">docheader</a>. |
| 675 |
If you’d like it to fall at a different position, say 2 inches, use |
| 676 |
<br/> |
| 677 |
<span class="pre-in-pp"> |
| 678 |
.TOC_HEADER_V_POS 2i |
| 679 |
</span> |
| 680 |
</p> |
| 681 |
|
| 682 |
<h5 id="toc-header-style" class="docs" style="margin-top: -.5em; text-transform: none;">Header string control macros and defaults</h5> |
| 683 |
|
| 684 |
<div class="defaults-container" style="margin-top: 1em; padding-bottom: 8px;"> |
| 685 |
<p class="defaults" style="padding-top: 6px;"> |
| 686 |
See |
| 687 |
<a href="docelement.html#control-macro-args">Arguments to the control macros</a>. |
| 688 |
<br/> |
| 689 |
The following TOC_HEADER control macros may also be |
| 690 |
<a href="#grouping">grouped</a> |
| 691 |
using TOC_HEADER_STYLE. |
| 692 |
</p> |
| 693 |
<span class="pre defaults"> |
| 694 |
.TOC_HEADER_FAMILY default = prevailing doc family |
| 695 |
.TOC_HEADER_FONT default = bold |
| 696 |
.TOC_HEADER_SIZE default = +4 |
| 697 |
.TOC_HEADER_QUAD default = left |
| 698 |
.TOC_HEADER_COLOR default = black |
| 699 |
.TOC_HEADER_CAPS default = no |
| 700 |
.TOC_HEADER_SMALLCAPS default = no |
| 701 |
.TOC_HEADER_UNDERSCORE default = none |
| 702 |
</span> |
| 703 |
</div> |
| 704 |
|
| 705 |
<h4 id="toc-style" class="docs" style="margin-top: -.5em;">4. Entries and reference page numbers style</h4> |
| 706 |
|
| 707 |
<p> |
| 708 |
“Entries” refers to the hierarchical arrangement of |
| 709 |
section titles (in |
| 710 |
<a href="rectoverso.html#collate-intro">collated</a> |
| 711 |
documents) and headings as they appear in the table of contents: |
| 712 |
<span class="pre-in-pp"> |
| 713 |
Section title |
| 714 |
Head level 1 |
| 715 |
Head level 2 |
| 716 |
Head level 3 |
| 717 |
... |
| 718 |
</span> |
| 719 |
The style for title entries (e.g. chapter numbers or titles) and |
| 720 |
heading levels is controlled by |
| 721 |
<a href="#toc-title-style">TOC_TITLE_STYLE </a> |
| 722 |
and |
| 723 |
<a href="#toc-entry-style">TOC_ENTRY_STYLE</a> |
| 724 |
respectively. |
| 725 |
</p> |
| 726 |
|
| 727 |
<p id="toc-pn"> |
| 728 |
“Reference page numbers” means the page numbers |
| 729 |
associated with entries. Macros to control their style take the |
| 730 |
form <kbd>.TOC_PN_<SPEC></kbd>, and the defaults are listed |
| 731 |
here. |
| 732 |
</p> |
| 733 |
|
| 734 |
<div class="defaults-container" style="margin-top: 1em; padding-bottom: 8px;"> |
| 735 |
<p class="defaults" style="padding-top: 6px;"> |
| 736 |
See |
| 737 |
<a href="docelement.html#control-macro-args">Arguments to the control macros</a>. |
| 738 |
|
| 739 |
<span class="pre defaults"> |
| 740 |
.TOC_PN_FAMILY default = prevailing doc family |
| 741 |
.TOC_PN_FONT default = roman |
| 742 |
.TOC_PN_SIZE default = 0 |
| 743 |
</span> |
| 744 |
</p> |
| 745 |
</div> |
| 746 |
|
| 747 |
|
| 748 |
|
| 749 |
<div id="toc-title-style" class="box-macro-args"> |
| 750 |
Macro: <b>TOC_TITLE_STYLE</b> <kbd class="macro-args"><see below for args></kbd> |
| 751 |
</div> |
| 752 |
|
| 753 |
<p> |
| 754 |
TOC_TITLE_STYLE allows you to set all the style parameters for |
| 755 |
title entries in the tables of contents with one macro. The |
| 756 |
number of arguments can run long, so you may want to break them into |
| 757 |
several lines with the backslash character (<kbd>\</kbd>). The |
| 758 |
arguments are: |
| 759 |
<br/> |
| 760 |
<span class="pre-in-pp"> |
| 761 |
FAMILY <family> |
| 762 |
FONT <font> |
| 763 |
SIZE +|-<n> |
| 764 |
COLOR <color> |
| 765 |
INDENT <amount> |
| 766 |
CAPS | NO_CAPS |
| 767 |
</span> |
| 768 |
The arguments may be entered in any order. |
| 769 |
</p> |
| 770 |
|
| 771 |
<p> |
| 772 |
The family, font, size, and color arguments behave identically |
| 773 |
to the individual control macros that govern other tags, therefore see |
| 774 |
<a href="docelement.html#control-macro-args">Arguments to the control macros</a> |
| 775 |
for usage. Their defaults are the same as for paragraphs in |
| 776 |
<a href="definitions.html#running">running text</a>. |
| 777 |
</p> |
| 778 |
|
| 779 |
<p> |
| 780 |
<kbd>INDENT</kbd> lets you indent title entries by the amount specified, and |
| 781 |
requires a |
| 782 |
<a href="definitions.html#unitofmeasure">unit of measure</a>. |
| 783 |
The default is zero. |
| 784 |
</p> |
| 785 |
|
| 786 |
<p> |
| 787 |
<kbd>CAPS</kbd> instructs mom to capitalize title entries. |
| 788 |
Capitalization may be enabled or disabled on a per-entry-level |
| 789 |
basis. |
| 790 |
</p> |
| 791 |
|
| 792 |
<p> |
| 793 |
As an example, if you want title entries bold, slightly larger than other |
| 794 |
entries and capitalized, you could do either |
| 795 |
<br/> |
| 796 |
<span class="pre-in-pp"> |
| 797 |
.TOC_TITLE_ENTRY FONT B SIZE +.5 CAPS |
| 798 |
</span> |
| 799 |
or |
| 800 |
<br/> |
| 801 |
<span class="pre-in-pp"> |
| 802 |
.TOC_TITLE_ENTRY \ |
| 803 |
FONT B \ |
| 804 |
SIZE +.5 \ |
| 805 |
CAPS |
| 806 |
</span> |
| 807 |
</p> |
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
<div id="toc-entry-style" class="box-macro-args"> |
| 812 |
Macro: <b>TOC_ENTRY_STYLE</b> <kbd class="macro-args"><level> <see below for remaining args></kbd> |
| 813 |
</div> |
| 814 |
|
| 815 |
<p> |
| 816 |
TOC_ENTRY_STYLE allows you to set individually all the style |
| 817 |
parameters for any level of entry (beneath titles) in the tables |
| 818 |
of contents. The number of arguments can run long, so you may |
| 819 |
want to break them into several lines with the backslash character |
| 820 |
(<kbd>\</kbd>). |
| 821 |
</p> |
| 822 |
|
| 823 |
<p> |
| 824 |
<kbd><level></kbd> corresponds to a |
| 825 |
<a href="docelement.html#heading">HEADING</a> |
| 826 |
level assigned in the body of the document. The remaining arguments |
| 827 |
are as follows. |
| 828 |
<br/> |
| 829 |
<span class="pre-in-pp"> |
| 830 |
FAMILY <family> |
| 831 |
FONT <font> |
| 832 |
SIZE +|-<n> |
| 833 |
COLOR <color> |
| 834 |
INDENT <amount> |
| 835 |
CAPS | NO_CAPS |
| 836 |
</span> |
| 837 |
The arguments may be entered in any order. |
| 838 |
</p> |
| 839 |
|
| 840 |
<p> |
| 841 |
The family, font, size, and color arguments behave identically |
| 842 |
to the individual control macros that govern other tags, therefore see |
| 843 |
<a href="docelement.html#control-macro-args">Arguments to the control macros</a> |
| 844 |
for usage. Their defaults are the same as for paragraphs in |
| 845 |
<a href="definitions.html#running">running text</a>. |
| 846 |
</p> |
| 847 |
|
| 848 |
<p> |
| 849 |
<kbd>INDENT</kbd> lets you indent entries by the amount specified, and |
| 850 |
requires a |
| 851 |
<a href="definitions.html#unitofmeasure">unit of measure</a>. |
| 852 |
Mom sensibly indents and aligns all levels of entry. If you change |
| 853 |
the indent for any level, all levels beneath it are still indented |
| 854 |
according to mom’s normal arrangement, but with the indent |
| 855 |
assigned to <kbd>level</kbd> taken into account. When you use |
| 856 |
<kbd>INDENT</kbd>, the indent is measured from the left edge of |
| 857 |
the text of the previous level, including numbering, if any. |
| 858 |
</p> |
| 859 |
|
| 860 |
<p> |
| 861 |
<kbd>CAPS</kbd> instructs mom to capitalize title entries. |
| 862 |
Capitalization may be enabled or disabled on a per-title basis. |
| 863 |
</p> |
| 864 |
|
| 865 |
<p> |
| 866 |
As an example, if you want a particular entry level, say |
| 867 |
“2”, to be in Helvetica, italics, and slightly larger |
| 868 |
than other entries, you could do either |
| 869 |
<br/> |
| 870 |
<span class="pre-in-pp"> |
| 871 |
.TOC_ENTRY_STYLE 2 FAMILY H FONT I SIZE +.25 |
| 872 |
</span> |
| 873 |
or |
| 874 |
<br/> |
| 875 |
<span class="pre-in-pp"> |
| 876 |
.TOC_ENTRY_STYLE 2 \ |
| 877 |
FAMILY H |
| 878 |
FONT I \ |
| 879 |
SIZE +.25 |
| 880 |
</span> |
| 881 |
</p> |
| 882 |
|
| 883 |
|
| 884 |
|
| 885 |
<div id="toc-prefix-ch-number" class="box-macro-args"> |
| 886 |
Macro: <b>TOC_PREFIX_CHAPTER_NUMBER</b> <kbd class="macro-args"><none> <anything></kbd> |
| 887 |
</div> |
| 888 |
<p class="alias" style="margin-bottom: 0;"> |
| 889 |
<i>Alias:</i> <b>TOC_PREFIX_SECTION_NUMBER</b> |
| 890 |
</p> |
| 891 |
|
| 892 |
<p> |
| 893 |
By default, mom does not prefix a chapter number to chapters or |
| 894 |
section titles in the table of contents. If you would like her to |
| 895 |
do so, invoke <kbd>.TOC_PREFIX_CHAPTER_NUMBER</kbd> without an |
| 896 |
argument before |
| 897 |
<a href="docprocessing.html#start">START</a>. |
| 898 |
</p> |
| 899 |
|
| 900 |
<p> |
| 901 |
You may subsequently disable the prefixing of chapter numbers |
| 902 |
by supplying the macro with any argument (<kbd>OFF</kbd>, |
| 903 |
<kbd>QUIT</kbd>, <kbd>Q</kbd>, <kbd>X</kbd>...) prior to the |
| 904 |
<kbd>.START</kbd> that comes after |
| 905 |
<a href="rectoverso.html#collate"><kbd>.COLLATE</kbd></a>. |
| 906 |
</p> |
| 907 |
|
| 908 |
<p> |
| 909 |
This macro is useful you want chapters numbered in the table of |
| 910 |
contents but the chapters themselves are identified by title only. |
| 911 |
It can be used with both |
| 912 |
<a href="docprocessing.html#doctype">DOCTYPE CHAPTER</a> |
| 913 |
and |
| 914 |
<a href="docprocessing.html#doctype">DOCTYPE DEFAULT</a>. |
| 915 |
The alias <b>TOC_PREFIX_SECTION_NUMBER</b> may be preferable |
| 916 |
in the latter case. |
| 917 |
</p> |
| 918 |
|
| 919 |
|
| 920 |
|
| 921 |
<div id="toc-pad-ch-numbers" class="box-macro-args"> |
| 922 |
Macro: <b>PAD_TOC_CHAPTER_NUMBERS</b> <kbd class="macro-args"><number of chapters></kbd> |
| 923 |
</div> |
| 924 |
<p class="alias" style="margin-bottom: 0;"> |
| 925 |
<i>Alias:</i> <b>PAD_TOC_SECTION_NUMBERS</b> |
| 926 |
</p> |
| 927 |
|
| 928 |
<p> |
| 929 |
If the number of chapters or major sections exceeds 9, you can have |
| 930 |
mom pad the numbers so the rightmost numerals of the chapter numbers |
| 931 |
align. Simply invoke <kbd>PAD_TOC_CHAPTER_NUMBERS</kbd> with the |
| 932 |
number of chapters in the document. |
| 933 |
</p> |
| 934 |
|
| 935 |
<p> |
| 936 |
Without padding: |
| 937 |
<br/> |
| 938 |
<span class="pre-in-pp"> |
| 939 |
9. Chapter Title.....................100 |
| 940 |
10. Chapter Title....................123 |
| 941 |
</span> |
| 942 |
With padding: |
| 943 |
<br/> |
| 944 |
<span class="pre-in-pp"> |
| 945 |
9. Chapter Title....................100 |
| 946 |
10. Chapter Title....................123 |
| 947 |
</span> |
| 948 |
</p> |
| 949 |
|
| 950 |
|
| 951 |
|
| 952 |
|
| 953 |
<div id="toc-pad-ch-numbers" class="box-macro-args"> |
| 954 |
Macro: <b>PAD_TOC_HEAD_NUMBERS</b> <kbd class="macro-args"><number of first-level headings></kbd> |
| 955 |
</div> |
| 956 |
|
| 957 |
<p> |
| 958 |
If the number of first-level headings in a chapter or major section |
| 959 |
exceeds 9 and you have head numbering enabled (see |
| 960 |
<a href="docelement.html#heading-control">Heading Control and Defaults)</a>, |
| 961 |
you can have mom pad the numbers in the Table of Contents so the |
| 962 |
rightmost numerals of first-level headings align. Simply invoke |
| 963 |
<kbd>PAD_TOC_HEAD_NUMBERS</kbd> with the number of first-level |
| 964 |
headings in the document. |
| 965 |
</p> |
| 966 |
|
| 967 |
<p> |
| 968 |
Without padding: |
| 969 |
<br/> |
| 970 |
<span class="pre-in-pp"> |
| 971 |
9. First-level heading.....................100 |
| 972 |
10. First-level heading....................123 |
| 973 |
</span> |
| 974 |
With padding: |
| 975 |
<br/> |
| 976 |
<span class="pre-in-pp"> |
| 977 |
9. First-level heading....................100 |
| 978 |
10. First-level heading....................123 |
| 979 |
</span> |
| 980 |
</p> |
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
<div id="toc-entry-numbers" class="box-macro-args"> |
| 985 |
Macro: <b>TOC_ENTRY_NUMBERS</b> <kbd class="macro-args"><FULL> <TRUNCATE> <NONE></kbd> |
| 986 |
</div> |
| 987 |
|
| 988 |
<p> |
| 989 |
If numbering is enabled for any level of |
| 990 |
<a href="docelement.html#heading">HEADING</a>, |
| 991 |
mom, by default, includes the numbering in that level’s |
| 992 |
entries in table of contents. If you would prefer that |
| 993 |
numbering not be included in the table of contents, |
| 994 |
issue <kbd>.TOC_ENTRY_NUMBERS NONE</kbd>. If |
| 995 |
you’d like to include numbering, but not the full, |
| 996 |
concatenated numbering used in the body of the document, issue |
| 997 |
<kbd>.TOC_ENTRY_NUMBERS TRUNCATE</kbd>. |
| 998 |
</p> |
| 999 |
|
| 1000 |
<p> |
| 1001 |
Assuming numbering is enabled for HEADINGs 1, 2, and 3, |
| 1002 |
<kbd>.TOC_ENTRY_NUMBERS FULL</kbd> (mom’s default), would |
| 1003 |
result in |
| 1004 |
<br/> |
| 1005 |
<span class="pre-in-pp"> |
| 1006 |
1. Level-1 entry |
| 1007 |
1.1. Level-2 entry |
| 1008 |
1.1.1. Level-3 entry |
| 1009 |
2. Level-1 entry |
| 1010 |
2.1. Level-2 entry |
| 1011 |
2.1.1. Level-3 entry |
| 1012 |
</span> |
| 1013 |
whereas <kbd>.TOC_ENTRY_NUMBERS TRUNCATE</kbd> would produce |
| 1014 |
<br/> |
| 1015 |
<span class="pre-in-pp"> |
| 1016 |
1. Level-1 entry |
| 1017 |
1. Level-2 entry |
| 1018 |
1. Level-3 entry |
| 1019 |
2. Level-1 entry |
| 1020 |
1. Level-2 entry |
| 1021 |
1. Level-3 entry |
| 1022 |
</span> |
| 1023 |
and <kbd>.TOC_ENTRY_NUMBERS NONE</kbd> would remove numbering |
| 1024 |
completely. |
| 1025 |
<br/> |
| 1026 |
<span class="pre-in-pp"> |
| 1027 |
Level-1 entry |
| 1028 |
Level-2 entry |
| 1029 |
Level-3 entry |
| 1030 |
Level-1 entry |
| 1031 |
Level-2 entry |
| 1032 |
Level-3 entry |
| 1033 |
</span> |
| 1034 |
</p> |
| 1035 |
|
| 1036 |
<div class="box-tip"> |
| 1037 |
<p class="tip"> |
| 1038 |
<span class="note">Note:</span> |
| 1039 |
<kbd>.TOC_ENTRY_NUMBERS TRUNCATE</kbd> removes the numbering |
| 1040 |
associated with table of contents chapter or section titles |
| 1041 |
when |
| 1042 |
<a href="docelement.html#prefix-chapter-number">PREFIX_CHAPTER_NUMBER</a> |
| 1043 |
is enabled. To enable the numbering of chapter or section titles |
| 1044 |
in this circumstance, use |
| 1045 |
<a href="#toc-prefix-ch-number">TOC_PREFIX_CHAPTER_NUMBER</a>. |
| 1046 |
</p> |
| 1047 |
</div> |
| 1048 |
|
| 1049 |
<h4 id="toc-additional" class="docs" style="margin-top: -1em;">5. Additional table of contents control macros</h4> |
| 1050 |
|
| 1051 |
<p> |
| 1052 |
The following five macros allow you to |
| 1053 |
</p> |
| 1054 |
<ul style="margin-top: -.5em; margin-left: -.5em;"> |
| 1055 |
<li>instruct mom to <a href="#toc-appends-author">append author(s) to</a> <a href="docprocessing.html#title">TITLE</a> <a href="toc-appends-author">entries</a></li> |
| 1056 |
<li><a href="#toc-title-entry">alter the wording of</a> <a href="docprocessing.html#title">TITLE</a> <a href="#toc-title-entry">entries</a></li> |
| 1057 |
<li>instruct mom to <a href="#space-toc-items">space table of contents entries</a> pleasingly</li> |
| 1058 |
<li>establish <a href="#toc-padding">how many placeholders to leave for page number references</a></li> |
| 1059 |
<li><a href="#toc-rv-switch">switch table of contents page margins</a> should they be incorrect for recto/verso printing</li> |
| 1060 |
</ul> |
| 1061 |
|
| 1062 |
|
| 1063 |
|
| 1064 |
<div id="toc-appends-author" class="box-macro-args"> |
| 1065 |
Macro: <b>TOC_APPENDS_AUTHOR</b> <kbd class="macro-args"><none> | "<name(s) of authors>"</kbd> |
| 1066 |
</div> |
| 1067 |
|
| 1068 |
<p> |
| 1069 |
In certain kinds of collated documents, different authors are |
| 1070 |
responsible for the articles or stories contained within them. In |
| 1071 |
such documents, you may wish to have the author or authors appended |
| 1072 |
to the table of contents’ title entry for each story or |
| 1073 |
article. |
| 1074 |
</p> |
| 1075 |
|
| 1076 |
<p> |
| 1077 |
If you invoke <kbd>.TOC_APPENDS_AUTHOR</kbd> <i>without</i> an |
| 1078 |
argument, mom appends the first argument you passed to |
| 1079 |
<a href="docprocessing.html#author">AUTHOR</a> |
| 1080 |
to table of contents title entries, separated by a front-slash. |
| 1081 |
</p> |
| 1082 |
|
| 1083 |
<p> |
| 1084 |
If you invoke <kbd>.TOC_APPENDS_AUTHOR</kbd> <i>with</i> an argument |
| 1085 |
(surrounded by double-quotes), mom will append it to the table of |
| 1086 |
contents title entries instead. This is useful if you have multiple |
| 1087 |
authors you wish to identify by last name only. For example, if |
| 1088 |
three authors—Joe Blough, Jane Doe, and John Deere—are |
| 1089 |
responsible for a single article |
| 1090 |
<br/> |
| 1091 |
<span class="pre-in-pp"> |
| 1092 |
.TOC_APPENDS_AUTHOR "Blough et al." |
| 1093 |
</span> |
| 1094 |
would be a good way to identify them in the table of contents. |
| 1095 |
</p> |
| 1096 |
|
| 1097 |
|
| 1098 |
|
| 1099 |
<div id="toc-title-entry" class="box-macro-args"> |
| 1100 |
Macro: <b>TOC_TITLE_ENTRY</b> <kbd class="macro-args">"<alternate wording for a title entry in the toc>"</kbd> |
| 1101 |
</div> |
| 1102 |
|
| 1103 |
<p> |
| 1104 |
In |
| 1105 |
<a href="rectoverso.html#collate">collated</a> |
| 1106 |
documents, the title of each chapter appears in the table of |
| 1107 |
contents. It may sometimes happen that you don’t want the |
| 1108 |
title as it appears in the table of contents to be the same as what |
| 1109 |
appears in the |
| 1110 |
<a href="definitions.html#docheader">docheader</a>. |
| 1111 |
You might, for example, want to shorten it. Or, in the case of |
| 1112 |
chapters where the docheader contains both a chapter number and a |
| 1113 |
chapter title, like this |
| 1114 |
<br/> |
| 1115 |
<span class="pre-in-pp"> |
| 1116 |
Chapter 6 |
| 1117 |
Burning Bush — Maybe God Was Right |
| 1118 |
</span> |
| 1119 |
you might want only the chapter title, not the chapter number, to |
| 1120 |
show up in the table of contents. (By default, <kbd>.TOC</kbd> |
| 1121 |
generates both.) |
| 1122 |
</p> |
| 1123 |
|
| 1124 |
<p> |
| 1125 |
If you want to change the wording of a title entry in the table of |
| 1126 |
contents, simply invoke |
| 1127 |
<br/> |
| 1128 |
<span class="pre-in-pp"> |
| 1129 |
.TOC_TITLE_ENTRY |
| 1130 |
</span> |
| 1131 |
with the desired wording, enclosed in double-quotes. Using the |
| 1132 |
example, above, |
| 1133 |
<br/> |
| 1134 |
<span class="pre-in-pp"> |
| 1135 |
.CHAPTER 6 |
| 1136 |
.CHAPTER_TITLE "Burning Bush — Maybe God Was Right" |
| 1137 |
.TOC_TITLE_ENTRY "Burning Bush" |
| 1138 |
.DOCTYPE CHAPTER |
| 1139 |
</span> |
| 1140 |
|
| 1141 |
would identify chapter 6 in the table of contents simply as |
| 1142 |
“Burning Bush”. |
| 1143 |
</p> |
| 1144 |
|
| 1145 |
|
| 1146 |
|
| 1147 |
<div id="space-toc-items" class="box-macro-args"> |
| 1148 |
Macro: <b>SPACE_TOC_ITEMS</b> |
| 1149 |
</div> |
| 1150 |
|
| 1151 |
<p> |
| 1152 |
If you’d like mom to add a small amount of space between table |
| 1153 |
of contents entry levels, use <kbd>.SPACE_TOC_ITEMS</kbd>. Mom will |
| 1154 |
visually group entry levels in a way that’s pleasing to the |
| 1155 |
eye. The only catch to this macro is that the bottom margins of |
| 1156 |
table of contents pages may not align perfectly. |
| 1157 |
</p> |
| 1158 |
|
| 1159 |
<p> |
| 1160 |
Please note that |
| 1161 |
<kbd>SPACE_TOC_ITEMS</kbd> is only available with |
| 1162 |
<a href="docprocessing.html#printstyle">PRINTSTYLE TYPESET</a>. |
| 1163 |
</p> |
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
|
| 1168 |
<div id="toc-padding" class="box-macro-args"> |
| 1169 |
Macro: <b>TOC_PADDING</b> <kbd class="macro-args"><number of placeholders to allow for page number listings></kbd> |
| 1170 |
</div> |
| 1171 |
|
| 1172 |
<p> |
| 1173 |
By default, mom allows room for 3 digits in the page number |
| 1174 |
references of table of contents entries. If you’d like some |
| 1175 |
other number of placeholders, say 2 (if your document runs to less |
| 1176 |
than 100 pages), do |
| 1177 |
<br/> |
| 1178 |
<span class="pre-in-pp"> |
| 1179 |
.TOC_PADDING 2 |
| 1180 |
</span> |
| 1181 |
</p> |
| 1182 |
|
| 1183 |
|
| 1184 |
|
| 1185 |
<div id="toc-rv-switch" class="box-macro-args"> |
| 1186 |
Macro: <b>TOC_RV_SWITCH</b> |
| 1187 |
</div> |
| 1188 |
|
| 1189 |
<p> |
| 1190 |
TOC_RV_SWITCH doesn’t take an argument. It simply instructs |
| 1191 |
mom to switch the left and right margins of the first table of |
| 1192 |
contents page in |
| 1193 |
<a href="rectoverso.html#recto-verso">recto/verso</a> |
| 1194 |
documents should the table of contents happen to begin on an even |
| 1195 |
page when you want an odd, or vice versa. |
| 1196 |
</p> |
| 1197 |
|
| 1198 |
<p> |
| 1199 |
The same result can be accomplished by outputting a |
| 1200 |
<a href="headfootpage.html#blank-pages">BLANKPAGE</a>. |
| 1201 |
</p> |
| 1202 |
|
| 1203 |
<h4 id="toc-more" class="docs" style="margin-top: -.5em;">6. I still need more!</h4> |
| 1204 |
|
| 1205 |
<p> |
| 1206 |
If there is some aspect of Table of Contents formatting for which |
| 1207 |
no TOC control macros are provided, mom has a special |
| 1208 |
<a href="definitions.html#toggle">toggle macro</a> |
| 1209 |
to help out: TOC_PAGE_SETTINGS. |
| 1210 |
</p> |
| 1211 |
|
| 1212 |
<p> |
| 1213 |
TOC_PAGE_SETTINGS allows you to enter extra formatting changes for |
| 1214 |
the Table of Contents as if it were simply another collated section |
| 1215 |
or chapter of a document. Because it’s a toggle macro, |
| 1216 |
invoking it by itself begins collecting your formatting directives, |
| 1217 |
and invoking it with any argument (<kbd>OFF</kbd>, <kbd>QUIT</kbd>, |
| 1218 |
<kbd>END</kbd>...) stops the collection. |
| 1219 |
</p> |
| 1220 |
|
| 1221 |
<p> |
| 1222 |
TOC_PAGE_SETTINGS is special in that the formatting commands |
| 1223 |
contained within it must be preceded by <kbd>\!</kbd> (that’s |
| 1224 |
backslash-exclamation point). |
| 1225 |
</p> |
| 1226 |
|
| 1227 |
<p id="toc-page-settings-example"> |
| 1228 |
For example, say you want to redesign the default page headers for |
| 1229 |
the Tables of Contents so that it only contains the document title |
| 1230 |
on the left and “Contents” in italics on the right, and |
| 1231 |
furthermore adjust the footer margin and footer gap, this is how |
| 1232 |
you’d do it: |
| 1233 |
<br/> |
| 1234 |
<span class="pre-in-pp"> |
| 1235 |
.TOC_PAGE_SETTINGS |
| 1236 |
\!.HEADER_RECTO L "^\E*[$TITLE]#\*[IT]Contents\*[PREV]^" |
| 1237 |
\!.FOOTER_MARGIN 3P |
| 1238 |
\!.B_MARGIN 6P+3p |
| 1239 |
.TOC_PAGE_SETTINGS END |
| 1240 |
</span> |
| 1241 |
(For an explanation of why the example uses <kbd>.B_MARGIN</kbd> to |
| 1242 |
set/change the footer gap, see |
| 1243 |
<a href="headfootpage.html#gap-note">here</a>.) |
| 1244 |
</p> |
| 1245 |
|
| 1246 |
<p> |
| 1247 |
TOC_PAGE_SETTINGS can be put in the stylesheet section of a document |
| 1248 |
(i.e. after |
| 1249 |
<a href="docprocessing.html#printstyle">PRINTSTYLE</a> |
| 1250 |
and before |
| 1251 |
<a href="docprocessing.html#start">START</a>) |
| 1252 |
or invoked just before |
| 1253 |
<a href="#toc">TOC</a>. |
| 1254 |
</p> |
| 1255 |
|
| 1256 |
<div class="rule-long"><hr/></div> |
| 1257 |
|
| 1258 |
|
| 1259 |
<table style="width: 100%; margin-top: 12px;"> |
| 1260 |
<tr> |
| 1261 |
<td style="width: 33%;"><a href="toc.html">Back to Table of Contents</a></td> |
| 1262 |
<td style="width: 24%; text-align: center;"><a href="#top">Top</a></td> |
| 1263 |
<td style="width: 42%; text-align: right;"><a href="refer.html">Next: Bibliographies and references</a></td> |
| 1264 |
</tr> |
| 1265 |
</table> |
| 1266 |
|
| 1267 |
</div> |
| 1268 |
|
| 1269 |
<div class="bottom-spacer"><br/></div> |
| 1270 |
|
| 1271 |
</body> |
| 1272 |
</html> |