XML technologies / Markdown in publishing / Footnotes and mathematics

Many requirements of scientific and technical publications lie outside the CommonMark core but can be implemented with Pandoc extensions. Footnotes, bibliographic references and formulas should not be combined into a single category of "special characters". They have different structures and processing paths.

Notes are treated as linked content. Citations require bibliographic records and a citation style. Formulas use a mathematical language within the Markdown text. The package provides original sources, rendering results and structural checks for all three areas. S12, S13, S14

Example 39: Named, multi-paragraph and direct footnotes

Pandoc Markdown

A reference such as [^review] links a text passage to a note definition. The identifier is internal; the visible number is assigned during output. Four leading spaces assign the second paragraph to the same note. Pandoc's direct syntax ^[...] saves a separate definition, but is not suitable for multi-paragraph notes.

SOURCE

The source has been checked.[^review]
A second note is written inline.^[Approved by the editor.]

[^review]: The reviewer checked the references.

    The second paragraph belongs to the same note.

RENDERED RESULT

HTML output of the named, multi-paragraph and direct footnotes

In the HTML preview, the notes are at the end and have backlinks. The DOCX contains real Word footnotes. "Footnote" or "endnote" is therefore not solely a question of the Markdown marker: positioning and note type also depend on the writer and the template. The formal GFM specification text does not define this syntax; GitHub's website offers features beyond that.

Example 40: Note reference within a table

Pandoc Markdown

A note reference can be placed in a table cell. The associated note definition is written here outside the table. In the HTML output, it ends up in the general notes area, not automatically directly below this table.

SOURCE

| Edition | Copies |
|:--------|-------:|
| Print   | 250[^estimate] |

[^estimate]: Estimated distribution, not confirmed sales.

RENDERED RESULT

HTML output of the note reference within a table

A publisher, on the other hand, may require table-specific notes with letters, separate counters, or repeated references. This specific example does not meet such requirements. In the print edition, page breaks and the placement of the note must also be checked. A preserved superscript character alone does not prove that the entire note relationship was converted correctly.

Example 41: Citations with locator and bibliography

Pandoc Markdown + citeproc / CSL

[@morgan2024] refers to a record in the separate BibTeX file. The locator follows after a comma. Without outer square brackets, the author name can become part of the sentence. A minus sign before the @ suppresses the author within the parenthetical citation. Multiple entries are separated by semicolons.

SOURCE

A structured workflow needs an explicit profile [@morgan2024, p. 12].

@lee2025 discusses editorial testing.

Morgan provides an example [-@morgan2024, p. 18].

Related reading [see @morgan2024; @lee2025].

RENDERED RESULT

HTML output of the citations with reference location and literature reference

The build uses --citeproc, the included bibliography and a small CSL style contained in the package. All literature data in this syntax example is fictitious and serves only for testing. It is not the sources of the technical article. Without citation processing and bibliographic data, a recognized citation marker does not yet produce a correct bibliography.

Example 42: Inline mathematics and displayed formula

Pandoc Markdown

A pair of dollar signs delimits inline mathematics, two pairs of dollar signs delimit a displayed formula. Within the delimiters, TeX-Mathematics written. The examples contain inequality, overline, fraction, sum, index, exponent and integral. A visible dollar amount is, if necessary, preceded by \$ protected.

SOURCE

For $n \geq 1$, the mean is $\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i$.

$$
\int_0^1 x^2\,dx = \frac{1}{3}
$$

RENDERED RESULT

HTML output of the inline mathematics and the display formula

The build generates for the browser preview MathML. Therefore, the formulas shown work without a subsequently loaded MathJax script. DOCX uses Office Math structures. An alternative HTML output with MathJax is possible, but has different runtime dependencies. The TeX notation is neither part of the CommonMark core nor in itself a guarantee of mathematical accessibility.

Example 43: Matrices, roots and case distinctions

Pandoc Markdown

The environments pmatrix and cases structure multi-line mathematical expressions. Within these environments, & separates columns; two backslashes separate lines. These characters act here within the TeX mathematics, not as Markdown table syntax.

SOURCE

$$
A=\begin{pmatrix}1 & 2\\3 & 4\end{pmatrix},
\qquad \lVert v\rVert=\sqrt{v_1^2+v_2^2}
$$

$$
f(x)=\begin{cases}x^2 & x\geq 0\\-x & x<0\end{cases}
$$

RENDERED RESULT

HTML output of the matrices, roots and case distinctions

The HTML preview is an actual rendering result. Nevertheless, for demanding formulas it must be checked whether every TeX command used is supported by the chosen converter. TeX macro packages of a complete LaTeX installation are not automatically available in a MathML converter. Alignment, bracket sizes and readability are also separate quality criteria.

A literature data record sensibly remains outside the running text. The first fictitious test entry from examples/references.bib shows the required fields:

@book{morgan2024,
  author = {Morgan, Alex},
  title = {Structured Publishing Handbook},
  year = {2024},
  publisher = {Northlight Publishing}
}

The visible punctuation and order of the bibliographic information are determined by the CSL style. Formatting a link as a citation does not replace a structured data record. Likewise, a note position in the HTML does not have to correspond to the position in the printed book. Such differences are expected characteristics of the production path and should be described in the profile.

back to top