Example 2 — Adding new structure to your document

If we wanted to add an auto-generated paragraph number as a sidenote to the first line of each <para> element, we could add the following to its Pre content box:

<AutoNum/>

The AutoNum custom marker would be in turn have the following in its Pre content:

<set var="Num" value="{Num}+1"/>
<AutoNote>[{Num}]</AutoNote>

Finally the AutoNote marker would scan and suppress its content, and assign to a sidenote.

Two markers are required because there are two separate steps: the first to increment the number, the second to create the sidenote. Since a note can only be assigned from a marker’s entire content, we use AutoNum (which has no content) to increment the variable, add the surrounding brackets, and pass the assembled text as content to AutoNote.