Build a table of contents
build-list
![](/img/syntax/pragmas/pragma.png)
The "build-list" pragma is used to instruct the BLUE PROCESSOR to build a Table of Contents or List of Figures from manuscript listmarks.
Syntax
The syntax for the build-list
pragma consists of:
- An exclamation point !
- The keyword build-list
- A
coalescer
(optional), specified using a full-stop . followed by a listmark coalescer. - An
order
attribute, (sequential
,alpha
,numeric
) to identify how the list entries should be ordered. - A
junctors
attribute, (yes
orno
), to specify whether or not hyperlinks should be created from the section headers in the body-matter back to the entries in the built Table of Contents.
!build-list .coalescer *order=sequential|alpha|numeric *junctors=yes|no
build-list
pragma syntaxIf a coalescer is specified, the builder will only include listmarks which specify that coalescer.
The default value for the junctors
attribute is yes
, which instructs the builder to create backlinks from the section headers in the body-matter back to the entries in the built Table of Contents. But regardless of the junctors
setting, each listmark occurance in the front-matter will always be hyperlinked to the corresponding header section in the body-matter of the final document.
Examples
Here is what a build-list
pragma looks like within the body of a manuscript.
div {
h1 Table of Contents
!build-list .toc *order=sequential *junctors=yes
}
. . .
h1 ((.toc '1: Physics' "Physics"))
h2 ((.toc '1.1 Motion' "-- Motion"))
h1 ((.toc '2: Chemistry' "Chemistry"))
h2 ((.toc '2.1 Covalence' "-- Covalence"))
build-list
pragmaAnd here is the output created by the builder:
<div>
<h1> Table of Contents</h1>
<ol class='toc'>
<li id=lm24 class='h1'><a href='#lm20'>Physics</a></li>
<li id=lm25 class='h2'><a href='#lm21'>-- Motion</a></li>
<li id=lm26 class='h1'><a href='#lm22'>Chemistry</a></li>
<li id=lm27 class='h2'><a href='#lm23'>-- Covalence</a></li>
</ol>
</div>
. . .
<h1><mark id=lm20 class='toc'><a href='#lm24'>1: Physics</a></mark></h1>
<h2><mark id=lm21 class='toc'><a href='#lm25'>1.1 Motion</a></mark></h2>
<h1><mark id=lm22 class='toc'><a href='#lm26'>2: Chemistry</a></mark></h1>
<h2><mark id=lm23 class='toc'><a href='#lm27'>2.1 Covalence</a></mark></h2>
build-list
output