Wiki source code of Numbered Headings
Last modified by superadmin on 2026/08/30 19:43
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Every heading of an exported page becomes a LaTeX sectioning command — ##\section##, ##\subsection## and so on down the levels — and LaTeX numbers those, so the headings of an exported document are numbered by default. | ||
| 2 | |||
| 3 | == Unnumbered Headings == | ||
| 4 | |||
| 5 | Set the ##data-xwiki-rendering-protected## parameter on a heading and that heading is left out of the numbering: | ||
| 6 | |||
| 7 | {{code language="none"}} | ||
| 8 | (% data-xwiki-rendering-protected='true' %) | ||
| 9 | = heading A = | ||
| 10 | {{/code}} | ||
| 11 | |||
| 12 | Set it on a group instead and every heading the group holds is left out: | ||
| 13 | |||
| 14 | {{code language="none"}} | ||
| 15 | (% data-xwiki-rendering-protected = 'true' %)((( | ||
| 16 | = heading A = | ||
| 17 | ))) | ||
| 18 | {{/code}} | ||
| 19 | |||
| 20 | Either way the export writes the starred form of the sectioning command, which LaTeX leaves unnumbered and keeps out of the table of contents: | ||
| 21 | |||
| 22 | {{code language="tex"}} | ||
| 23 | \heading[*]{1}{heading A} | ||
| 24 | \label{HheadingA} | ||
| 25 | {{/code}} | ||
| 26 | |||
| 27 | The heading keeps its ##\label##, so a link or a cross-reference pointing at it still resolves. | ||
| 28 | |||
| 29 | ##\heading## is a command of the exported document's own preamble, so a wiki that wants its headings typeset differently redefines it rather than changing every heading — see [[Override a Template>>doc:documentation.extensions.dev.latex.override-template.WebHome]]. |