Footnote marker mapping

By default, TopLeaf will render a numeric footnote marker for each footnote. To suppress or emit an alternative marker, declare a markermap custom marker handler for your footnotes. TopLeaf will call this mapping when each footnote reference marker and footnote label marker is processed. The footnote marker mapping is defined using the <note-properties/> command.

For example, suppose you need to identify each footnote reference with a special character, such as an asterisk or a dagger (U+2020). To do this, declare a footnote custom marker mapping:

<note-properties markermap="NoteIndex" />

Next, create a new custom marker mapping for %NoteIndex. As each footnote reference is processed, the marker map is called, and TopLeaf automatically defines the following attribute variables:

Attribute variable Value Meaning
{@type} column | page The footnote type.
{@index} Integer [1,...] The current footnote index.
{@id} Integer [1,...] A unique identifier for the footnote instance. The identifier is not guaranteed to be consecutive.

The custom content %NoteIndex can test the value of {@index} to select the required footnote symbol :

<set var="Index" value="({@index} - 1) % 6" />
<switch>
  <case var="Index" target="0" >*</case>
  <case var="Index" target="1" >&#x2020;</case>    <!-- dagger        -->
  <case var="Index" target="2" >&#x2021;</case>    <!-- double dagger -->
  <case var="Index" target="3" >&#x00A7;</case>    <!-- section       -->
  <case var="Index" target="4" >||</case>
  <case var="Index" target="5" >#</case>
</switch>

It is possible to generate different content for the footnote reference and footnote label by matching the value of the tag-context variable with one of the patterns */$colnote-reference or */$colnote-body. For example, the following customisation adds brackets around the reference content:

<if var="tag-context" test="matches" target="*/$colnote-reference">
  [{@index}]
</if>

Footnote identifiers

The footnote reference and footnote label for the same footnote share a unique footnote identifier. You can use the value of the marker mapping footnote id to pass information from the footnote reference mapping to the associated footnote label mapping.

For example, the following customisation uses the footnote id to assign the value of a variable declared when the footnote marker reference is mapped to a variable retrieved when mapping the associated footnote marker label:

<switch>
<case var="tag-context" test="matches" target="*/$pagenote-reference">
  <set var="Code.@id" string="{MyCode}" />
</case>
<case var="tag-context" test="matches" target="*/$pagenote-label">
  {Code.@id}
</case>
</switch>

The value of the footnote id is undefined if a footnote note merge is active.