Text formatting

Strikethrough and small caps

The following formatting macros are used for strikethrough and small caps text:

[strike]#strike through text#
[smallcap]#small caps text#

which renders:

Illustration of strikethrough and small caps text in Metanorma
Figure 1. Illustration of strikethrough and small caps text in Metanorma.

Metanorma also supports underline macros [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.7.2]:

[underline]#underline text#

Paragraph alignment

Paragraph alignment is defined as an attribute for paragraphs:

This paragraph is aligned left

This paragraph is aligned center

This paragraph is aligned right

This paragraph is justified, which is the default

which renders

Illustration of possible paragraph alignments in Metanorma
Figure 2. Illustration of possible paragraph alignments in Metanorma.

If you have line-breaks in a paragraph, and the default alignment in the stylesheet is justified (as is often the case in Word output), you will need to set [align=left] to make the paragraph look as normally expected:

Vache Equipment +
Fictitious +
World +

which renders

Illustration of left-alignment for multiple line-breaks in Metanorma
Figure 3. Illustration of left-alignment for multiple line-breaks in Metanorma.

Page breaks

Page breaks can be given a page orientation, which applies from that point forward until the next page break with a page orientation [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.17].

Page orientation only appears in paged output, such as in Word.

To set content to landscape mode, the syntax is:


To set content to portrait mode, the syntax is:


If no orientation option is given, the text after the page break remains in the same orientation as that before. In Word, page breaks changing orientation are realised as distinct sections.

In Metanorma, documents are split into three sections by default:

  • a cover page,

  • a preface, and

  • the main document body (including annexes and bibliography)

  • (some documents also have a colophon)

The page orientation is reset at the start of the main document body to portrait.


// Content following this directive will be shown in landscape mode


// Content following this directive will return to portrait mode


Avoiding page breaks

The “keep with next” feature is useful if you want to indicate that a document element must belong on the same page with another element. Kind of like the opposite of a “page break”.

Most blocks support the boolean attributes keep-with-next and keep-lines-together [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.4.1].

The following syntax indicates that these two paragraphs will always be presented on the same page, even if the textual layout allows them to be split into two pages.

This is a paragraph.

This is a paragraph that will be on the same page as the
immediately previous one.

Block quotes

As in normal AsciiDoc, block quotes are preceded with an author and a citation; but the citation is expected to be in the same format as all other citations, a cross-reference optionally followed by text, which may include the bibliographic sections referenced:

[quote, ISO, "ISO7301,section=1"]
This International Standard gives the minimum specifications for rice (_Oryza sativa_ L.)
which is subject to international trade. It is applicable to the following types: husked rice
and milled rice, parboiled or not, intended for direct human consumption. It is neither
applicable to other products derived from rice, nor to waxy rice (glutinous rice).

renders as

Illustration of a block quote in Metanorma
Figure 4. Illustration of a block quote in Metanorma.


Notes that are not at the end of a clause are folded into the preceding block, if that block is not delimited (so that the user could not choose to include or exclude a note). That is, notes are folded into a preceding list, formula, or figure.

To prevent that behaviour, add the attribute keep-separate to the note [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.29].

* A
* B
* C

Note not folded into its preceding block

Without the keep-separate=true markup, the note would be attached to the list, and numbered accordingly.

This note will be folded in the preceding block.

NOTE: This one too.

Notes may be given a type through the attribute type [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.4.1].

Bibliographic note


Table and figure footnotes are treated differently from all other footnotes: they are rendered at the bottom of the table or figure, and they are numbered separately.

When the text of a footnote is repeated in two different places, default behaviour in Metanorma, both for HTML and for DOC, is to use the same footnote number in both places, rather than treat the repetition as a new footnote.

Footnotes on document titles are recognised [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.6.1], but by default they are not rendered, because of how document title pages are processed separately in Metanorma via Liquid templates. Document title footnotes are moved into /bibdata/note[@type = "title-footnote"], and are treated as document metadata, as are document titles themselves. The location of the footnote within the title is not preserved.

Multi-paragraph footnotes can be entered using the macro footnoteblock:[id] [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.6.4], where id is the identifier of a note containing the contents of the footnote:

This is a paragraph.footnoteblock:[id1] This continues the paragraph.

This is

a multi-paragraph

Multi-paragraph footnotes are a Metanorma AsciiDoc feature and not supported in typical AsciiDoc.

Index terms


Metanorma supports index entries with primary, secondary and tertiary index terms. [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.10].

Primary index terms are listed under the first-level index, the secondary index terms are listed under the primary index terms' sub-index, and the tertiary index terms are listed under the secondary index term’s sub-index.

Illustration of an index in Metanorma with primary and secondary indexes are shown
Figure 5. Illustration of an index in Metanorma with primary and secondary indexes are shown.

Index term links are only rendered in certain flavours, and do not appear otherwise in DOC, PDF or HTML output.

Currently, only Metanorma IETF XML RFC and Metanorma BIPM outputs render index terms.

Rendered index term syntax

Metanorma index entries are entered through two different syntaxes. [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.10].

Rendered index term: ((Term))

  • Produces the output “Term”; and

  • Links to the primary index term of the same name, “Term”.

Hidden index term: (((IndexTerm1))), (((IndexTerm1, IndexTerm2))) or (((IndexTerm1, IndexTerm2, IndexTerm3)))

  • Produces no output; and

  • Links to the primary index term IndexTerm1. And if provided, links to the secondary nesting, IndexTerm2 and the tertiary nesting IndexTerm3.


The Lady of the Lake, her arm clad in the purest shimmering samite,
held aloft Excalibur from the bosom of the water,
signifying by divine providence that I, ((Arthur)),
was to carry Excalibur (((Sword, Broadsword, Excalibur))).

Rich-text formatting

Rich-text formatting in index terms is supported [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.7.0].

signifying by divine providence that I, ((*Arthur*)),
was to carry Excalibur (((Sword~E~, stem:[sqrt(E)], Excalibur))).
Formatting of index terms is ignored in IETF rendering.

Entry ranges

Metanorma supports index entries that involve ranges [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.7.0], using the command index-range:to[…​].

The command itself accepts an AsciiDoc index entry, such as ((...)) or (((...))).

The index entry range starts at the location of the index-range command, in the same way as the index command it contains; the end of the range is the element with the anchor to, and that is expected to be provided as a bookmark.

signifying by divine providence that I, index-range:end-range-1[((*Arthur*))],
was to carry Excalibur index-range:end-range-2[(((Sword~A~, stem:[sqrt(2)], Excalibur)))].


and so forth.[[end-range-1]]


_Sic explicit fabula._[[end-range-2]]

The preceding example has a visible index entry for Arthur, ranging from the location of *Arthur* up to end-range-1, and a hidden index entry for SwordA, ranging from the location of Sword~A~ up to end-range-2.


Metanorma also supports “see” and “see also” cross-references between index terms [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.6.5], using the index command.

The command takes at least two parameters:

  • the primary index term to be cross-referenced;

  • the target of the cross-reference;

  • optionally, the secondary and tertiary index term to be cross-referenced.

index:see[Satchmo,Louis Armstrong]
index:see[James Brown,influences,Hank Ballard and the Midnighters]
index:also[guitar,electric,technique,Jimi Hendrix]

Rendered as:

  • Satchmo, see Louis Armstrong

  • James Brown

    • influences, see Hank Ballard and the Midnighters

  • guitar

    • electric

      • technique, see also Jimi Hendrix


Ordered lists

Ordered list labels conform to rules specified in ISO/IEC DIR 2:

  • level 1: a), b), c) (alphabetic),

  • level 2: 1), 2), 3) (arabic),

  • level 3: i), ii), iii) (roman),

  • level 4: A), B), C) (alphabetic_upper),

  • level 5: I), II), III) (roman_upper).

This labeling applies to all output formats, including PDF, HTML and Word.

The type attribute, with acceptable values listed in the list above, can be used to allow specifying labels of an ordered list [added in https://github.com/metanorma/isodoc/releases/tag/v1.3.0].


. First as "A"
. Second as "B"
In Word rendering the type attribute is always ignored in favor of ISO/IEC DIR 2 compliant labelling.

The start attribute for ordered lists is only allowed by certain Metanorma flavors, such as BIPM.

List items with more than one paragraph

Metanorma XML and HTML support multiple paragraphs within a single list item (see list continuation).

In HTML output, all the paragraphs within a list item will be aligned.
Microsoft Word caveats
  • For list items containing multiple paragraphs, Metanorma attempts to format them appropriately by using custom list continuation styles (ListContLevel1 etc.) applied to groups of paragraphs; however, you should check the output document and may need to manually intervene.

  • In Microsoft Word, each list entry must be a single paragraph. Metanorma is employing a workaround through list continuation styles, and results may be unexpected if the list is edited.

Definition lists

Definition lists are rendered by default horizontally, with the definition in the same line as the term. In Word, definition lists are rendered as true tables, and the width of the term column is determined by the Word auto-width algorithm; if you need to ensure that terms are rendered in a single line in Word, you may need to use non-breaking spaces and non-breaking hyphens (which can be entered in AsciiDoc as HTML escapes: &nbsp; or &#xa0;, and &#x2011;, respectively; e.g. This&nbsp;is&nbsp;a&nbsp;non&#x2011;breaking&nbsp;term instead of This is a non-breaking term.)


Metanorma AsciiDoc tables are required to handle the full range of complexity of standardization documents, and is therefore significantly more powerful than typical AsciiDoc tables, even when typical AsciiDoc already handles tables very well for a non-XML markup language.

Metanorma AsciiDoc already supports cells spanning multiple rows and columns, horizontal alignment, and [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.5.3] vertical alignment.

Metanorma AsciiDoc adds the option of multiple header rows via attribute headerrows to deal with the complexity of standardization documents' tables requiring labels, variables, and units to lining up in the header.

Tables can also have alternate text as a title, alt, and summary text, summary, both of which are to be rendered as a summary of the table for accessibility.

Tables can be set with a width attribute, which could be either a percentage (e.g. 70%) or a pixel count (e.g. 500px). [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.21].

The width attribute value aligns with HTML CSS and HTML 4 behavior.
[headerrows=2,alt=Table of maximum mass fraction of defects in husked rice,summary=Table enumerating the permissible mass fraction of defects in husked and various classes of milled rice,width=70%]
.2+|Defect 4+^| Maximum permissible mass fraction of defects in husked rice +
| in husked rice | in milled rice (non-glutinous) | in husked parboiled rice | in milled parboiled rice

| Extraneous matter: organic footnote:[Organic extraneous matter includes foreign seeds, husks, bran, parts of straw, etc.] | 1,0 | 0,5 | 1,0 | 0,5

which renders:

Illustration of a table in Metanorma (DOC output). Configuration: 70% of width
Figure 6. Illustration of a table in Metanorma (DOC output). Configuration: 70% of width, two header rows, one normal row, one footnote.

In Metanorma AsciiDoc:

  • table cell footnotes are rendered inside the table;

  • notes following the table are rendered inside the table footer.

Typical AsciiDoc renders table cell footnotes inside the cell, and notes trailing the table outside the table.

Table 1 in the Metanorma ISO Rice example document illustrates a large range of table formatting options.

Table columns can also have their widths set [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.5.3]. Table column widths must be enumerated explicitly per column to generate column widths.


The following syntax will be processed as generating equal width columns.

In typical AsciiDoc, [cols="3"] is considered a shorthand to [cols="1,1,1"], but this is not supported in Metanorma AsciiDoc.

Mathematical expressions


Metanorma AsciiDoc accepts mathematical input in these formats:

  • AsciiMath

  • LaTeX math

  • MathML

Math can be entered using one of the following mechanisms:

  • the stem:[…​], asciimath:[…​] and the latexmath:[…​] commands; and

  • the [stem], [asciimath], [latexmath] blocks delimited with ++++

The math syntax used by stem:[…​] and [stem] blocks depends on the value of the document attribute :stem:. It can be set to:

:stem: latexmath

any markup within stem is interpreted as LaTeX math

:stem: asciimath

any markup within stem is interpreted as AsciiMath


(default) when left empty, AsciiMath is selected

stem:[…​] and [stem] markup that contains MathML markup (as detected by an initial <math …​ >) is interpreted as MathML.

MathML is used as the internal representation of STEM expressions in Metanorma.

Using AsciiMath

AsciiMath can be entered using the asciimath:[…​] command and the [asciimath] block delimited with ++++. The stem:[] and [stem] blocks can also be used if the document attribute :stem: asciimath has been specified in the document.

AsciiMath is converted into MathML using the asciimath gem.

The syntax of AsciiMath recognised by the asciimath gem is more strict than the common MathJax processor of AsciiMath. For example, asciimath insists on numerators being bracketed.


(IEV 103-01-03)

The derivative of a distribution stem:[D] is another distribution
stem:[D'] defined for any function stem:[f](stem:[x]) by
stem:[D^( ' ) ( f ) = - D ( d f // d x )].

(ISO 10303-55, Clause 2)

f -= lambda x (a * x + b)
Some math expressions are NOT supported by AsciiMath — in that case it is necessary to use LaTeX math or MathML input.

Using LaTeX math

LaTeX math can be entered using the latexmath:[…​] command and the [latexmath] block delimited with ++++. The stem:[] and [stem] blocks can also be used if the document attribute :stem: latexmath has been specified in the document.

LaTeX math is converted into MathML using the latexmath gem, which generates output compliant with the deterministic output of the NIST LaTeXML suite.

LaTeX math parsing of the LaTeXML’s latexmlmath command is deterministically accurate. The latexmath gem was created to generate identical output to the latexmlmath command.

Unicode characters in the LaTeX source are translated into LaTeX escapes through the unicode2latex gem.


(ISO 10303-110, Clause 4)

The only change from the above example would be the
nondimensionalization of viscosity, which would become,
latexmath:[\tilde{\tilde{\mu}} = mu / (rho_infty c_infty L)].

(ISO 10303-110, Clause 4)

  \tilde{x} = x/L, \tilde{u} = u/c_\infty, \tilde{\rho} = \rho/\rho_\infty,
  \tilde{y} = y/L, \tilde{v} = v/c_\infty, \tilde{p} = p/(\rho_\infty c_\infty^2),
  \tilde{z} = z/L, \tilde{w} = w/c_\infty, \tilde{\mu} = \mu/\mu_\infty,

The LaTeX math eqnarray environment is not supported in Metanorma as it is not supported by LaTeXML and the latexmath gem. It is also not recommended by the general LaTeX community due to inconsistencies in vertical alignment and other aspects (see Madsen).

The proper LaTeX math syntax used to replace existing eqnarray equations is to place the equations in separate blocks concatenated with +.


These equations using the eqnarray environment:

  \bf{z^\prime} & = & \bf{\zeta} \\
  \bf{x^\prime} & = & \langle \bf{\eta} \times \bf{\zeta} \rangle

should be re-arranged as:

\bf{z^\prime} = \bf{\zeta}
\bf{x^\prime} = \langle \bf{\eta} \times \bf{\zeta} \rangle


Formulae are marked up as [stem] blocks. Any explanation of symbols in the formula is given in a definition list, either preceded by a “where” paragraph (in English), or [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.6.3] marked up with [%key].

For example:

w = (m_D) / (m_s)


stem:[w]:: is the mass fraction of grains with a particular defect in the test sample;
stem:[m_D]:: is the mass, in grams, of grains with that defect;
stem:[m_S]:: is the mass, in grams, of the test sample.
w = (m_D) / (m_s)

stem:[w]:: is the mass fraction of grains with a particular defect in the test sample;
stem:[m_D]:: is the mass, in grams, of grains with that defect;
stem:[m_S]:: is the mass, in grams, of the test sample.

which renders

Example of a block stem equation in Metanorma
Figure 7. Example of a block stem equation in Metanorma.

Inequalities are indicated through the option attribute %inequality:

A < B

which renders

Example of a block stem inequality in Metanorma
Figure 8. Example of a block stem inequality in Metanorma.

In most flavours, equations and inequalities are both referenced in the same way, as “Formula”.

In some flavours (e.g. ITU), they are referenced differently as “Equations” and “Inequalities”.


Like formulae, figures can be followed by a definition list for the variables used in the figure; the definition list is either preceded by the paragraph *Key* (in English), or [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.6.3] is marked up with [%key]. For example:

.Typical gelatinization curve
image::rice_images/rice_image2.png[alt text]
footnote:[The time stem:[t_90] was estimated to be 18,2 min for this example.]


stem:[w]:: mass fraction of gelatinized kernels, expressed in per cent
stem:[t]:: cooking time, expressed in minutes
stem:[t_90]:: time required to gelatinize 90 % of the kernels
P:: point of the curve corresponding to a cooking time of stem:[t_90]

NOTE: These results are based on a study carried out on three different types of kernel.
.Typical gelatinization curve
image::rice_images/rice_image2.png[alt text]
footnote:[The time stem:[t_90] was estimated to be 18,2 min for this example.]

stem:[w]:: mass fraction of gelatinized kernels, expressed in per cent
stem:[t]:: cooking time, expressed in minutes
stem:[t_90]:: time required to gelatinize 90 % of the kernels
P:: point of the curve corresponding to a cooking time of stem:[t_90]

NOTE: These results are based on a study carried out on three different types of kernel.

As an extension to AsciiDoc syntax, Metanorma allows Data URLs as the URL for an image:

image::data:image/png;base64,ivBO[alt text]


Subfigures (which appear in ISO formats, for example) are entered by including images in AsciiDoc examples.

.Stages of gelatinization
.Initial stages: No grains are fully gelatinized (ungelatinized starch granules are visible inside the kernels)

.Intermediate stages: Some fully gelatinized kernels are visible

.Final stages: All kernels are fully gelatinized


Image size

The value auto is accepted for image width and height attributes. It is only passed on to HTML output; if the output is to Word, both the width and height attributes are stripped from the image.


Captions and titles

As elsewhere in Metanorma, the caption of an image (of the figure containing the image) is set with a line prefixed with dot above the image.

Similar to Asciidoctor AsciiDoc, the title attribute is treated as identical to the dot-prefixed caption.

Metanorma supports a title attribute on images for accessibility, which is distinct from the figure caption. This is entered in Metanorma as the titleattr attribute:

[titleattr=Title Attribute]


image::logo.jpg[titleattr=Title Attribute]

Both captions and titles could be used together.

.Rice husk separation in rice farm at Breton near Dinan
image::logo.jpg[titleattr=Photo of rice husks being separated]
The titleattr attribute does not get rendered in Word output due to Word limitations. Word only supports a single image “Alt Text”, which would be set by the caption. Word’s description of “Alt Text” is: “How would you describe this object and its context to someone who is blind?”.

Preformatted blocks

Figures can include preformatted blocks, as well as images.

For accessibility, preformatted blocks can be provided with an alt text attribute [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.10].

   /    | \__/\
    \   /  ^ ^|
   / \_/   0  0_
  /             \
 /     ___     0 |
/      /  \___ _/

Passthrough to Metanorma XML and target formats

Passthrough text, such as XML tags, intended to be rendered in a target format unaltered, can be entered as a passthrough block [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.27].

This functionality enables automated processing, custom tagging, hacking into intermediary formats and experimental development of Metanorma output.

A broken Metanorma XML file will cause rendering of target formats to also break. Use with caution.

Passthrough intended to be rendered in Metanorma XML (such as Metanorma XML tags), generated from Metanorma AsciiDoc input, can be entered as a passthrough block [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.4.1], with no format indication:

Passthrough text may break the structure of the output format — it is the user’s responsibility to ensure the integrity of the resulting structure (e.g. XML) is retained.

Passthrough intended to be rendered in a target format must be specified with a format indication corresponding to one or more of the existing output formats of Metanorma in a comma delimited manner (not limited to: html, doc, pdf, rfc, sts).


Source code


Source code is marked up as elsewhere in AsciiDoc, as a pre-formatted source snippet to be rendered in monospace font, and with spaces preserved:

def increment(x)
  x + 1

Source code highlighting can be used automatically to highlight keywords specific to the nominated computer language.

Markup in source code blocks

In a few cases, it is desirable to introduce markup into source code; for example, hyperlinking words in source code to external definitions, or else introducing formatting in lieu of automated highlighting.

In order to achieve this, Metanorma allows inline AsciiDoc markup to be introduced into source code, isolating it from the rest of the source code through delimiters. [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.7.4]

By default, the delimiters are {{{ and }}}; these can be overridden (in case {{{ and }}} are already used in the document) through the document attributes :sourcecode-markup-start: and sourcecode-markup-end:.

{{{*def*}}} method1(x)
  {{{<<method2-definition,method2>>}}}(x) + 3


Pseudocode is a mix between formal math with code like properties commonly used in computer science and related fields.

Unlike source code, pseudocode is typically in a proportional font, but it still needs to be indented to reflect code structure. Moreover, pseudocode typically requires source code highlighting such as boldface; but unlike well-defined computer languages, there is no guaranteed way of automating such highlighting.

Pseudocode is supported in Metanorma as a special class of example, marked up with a pseudocode block macro with these differences:

  • text within a pseudocode block is treated as normal text, including respect for inline formatting;

  • lines do not need to be separated by line breaks, although two carriage returns in a row are still interpreted as a new paragraph. [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.10]

  • indentation spaces at the start of each line are preserved, by converting them into non-breaking spaces; initial tabs are converted into four non-breaking spaces.

*do in-parallel*

[smallcap]#ExclusiveAccess# stem:[-=]
  *if* _ag.mode_ = _exclusive_ stem:[^^ AA t in] [smallcap]#Token# : _t.available_ *then*
    *do forall* _t_ : stem:[in]  [smallcap]#_Token_#
      _t.owner_ := _ag_

Filenames for extraction

Images, source code, and requirements can all be extracted out of the generated Metanorma XML downstream, by the metanorma -e command.

By default, the filename for each extracted snippet is automatically generated. (Extraction only applies to data-uri encoded images, which no longer preserve their filename.)

The attribute filename on images, source code, and requirements gives the filename that any inline-encoded images, source code, and requirements should be exported to, if that is requested by downstream tools.


In this instance, the image is read in from logo.gif, but is converted in the XML output to a data-uri encoding. The encoding will have the filename attribute of image1.gif; that instructs any downstream processing that extracts images out of the file (such as metanorma -e) to extract this image to the file image1.gif, instead of using an automatically generated filename.



The following document elements (“elements”) are auto-numbered by Metanorma, so users do not need to specify any numbering in their source documents:

  • figures

  • tables

  • examples

  • formulas

  • sourcecode, pseudocode

  • permissions, recommendations and requirements.

The conventions for numbering vary by Metanorma flavour, but the default is to number all elements consecutively in the main body of a document, and separately in each Annex/Appendix, prefixed bt the Annex/Appendix number.

Multi-level numbering

Metanorma’s auto-numbering functionality assigns numbers to elements consecutively. Sometimes, more than one level of numbering is required for a sequence of elements; for instance, 17a, 17b.

To indicate that, all elements in the subsequence are assigned the same subsequence attribute:






Gets rendered as:

A (1a)

B (1b)

C (2a)

D (2b)

E (3)

Unnumbered elements

Sometimes a document element needs to be excluded from auto-numbering. This is achieved by giving it the option attribute %unnumbered:

.Typical gelatinization curve

Sourcecode and pseudocode snippets are by default numbered as figures [added in https://github.com/metanorma/isodoc/releases/tag/v1.0.10]. If they are not to be numbered, they need to be given the %unnumbered option attribute.

for (i = 0; i < n; i++) { bounce(v[i], wall) }

// This is also unnumbered
stem:[forall v_{i}] *bounce* stem:[v_{i}] off the wall

Prevention of double-numbering

If a document element is included in a block type that is already subject to numbering, it will be excluded from auto-numbering.

This means that tables, sourcecode and pseudocode, and figures are excluded from auto-numbering within examples, requirements, recommendations, permissions, tables, figures, sourcecode and pseudocode. [added in https://github.com/metanorma/isodoc/releases/tag/v1.0.11]

Override numbering

There are circumstances when auto-numbering of elements needs to be overriden; for instance, numbering out of sequence in updated documents.

In these cases, elements can be given an optional number attribute [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.4.1], assigning a required document element number to override auto-numbering.

Elements subsequent to that element will be auto-numbered so as to follow the previous element, so long as the supplied number belongs to the same sequence.

For subsequences, number shall have only subsequence scope.

for (i = 0; i < n; i++) { bounce(v[i], wall) }



Cross-references are realized in Metanorma AsciiDoc by assigning an anchor to the block to be referenced, and writing a cross-reference containing that anchor ID:

== Target clause

The requirements are...

== Reference clause

As seen in <<anchor-id>>...
See Anchor ID syntax for allowed characters in anchor IDs.
Cross-reference text in Metanorma adheres to guidance given in ISO/IEC DIR 2 for internal cross-references, in order to guarantee unambiguous referencing.

In particular, if a formula, example, figure, list, list item or table is cross-referenced outside its (sub)clause, the clause containing the item is always given in the cross-reference, unless the item is being referenced in the same clause.

In the case of notes, the containing clause is extended to containing example, figure or table.

For example, in the Metanorma ISO Rice model sample document formula B.1 is defined in Annex B.6, and is referenced in B.6 and B.7.

In the Rice model document published by ISO, both instances are cited as “Formula (B.1)”. However, Metanorma follows ISO/IEC DIR 2 in citing the former as “Formula (B.1)”, but the latter as “B.6, Formula (B.1)”.

In this sense, Metanorma is “more royalist than the king” in applying formatting rules and validation—which is what you would want of a computer-based tool.

The label of the item cross-referenced, the use of brackets, and the containing reference are all taken care of by Metanorma; the document author needs only give the item identifier in the AsciiDoc source (e.g. \<<formulaB-1>> generates either “Formula (B.1)” or “B.6, Formula (B.1)”, depending on where in the document it occurs.)

If the cross-reference is given with droploc% as its text, then the label and prefix are dropped: the cross-reference value is given in isolation [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.5.4].

This can be done for example for ranges:

Clauses <<context,droploc%>> to <<improvement,droploc%>>

to be rendered as e.g.

Clauses 7 to 9

Anchor ID syntax

Anchor IDs of any type (cross-references, items, bibliographies, etc.) are directly converted into XML, and therefore must not contain the following:

  • colons

  • whitespaces or;

  • words starting with numbers.

These cases are not supported in XML; permitted characters are specified by the NCName attribute for Namesapece Declaration.

Colons in cross-references are used for indirect cross-references between files in the same collection, to delimit namespaces and containers from anchor IDs [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.7.4].


Normally in AsciiDoc, any text in a cross-reference that follows a comma constitutes custom text for the cross-reference.

So a cross-reference <<ISO7301,the foregoing reference>> would be rendered as “the foregoing reference”, and hyperlinked to the ISO7301 reference.

In Metanorma AsciiDoc cross-references, bibliographic localities (e.g. page numbers, clause numbers) can be added directly after the comma, as part of the cross-reference text.

This differs from the normal AsciiDoc treatment of custom text.

EXAMPLE: “ISO 7301, Clause 2, Table 1a, pp. 7-9” would be expressed as:


List items

List items can be cross-referenced by inserting a bookmark at the very start of the list item:

. Ordered list
.. [[id1]] This is the first list item
... [[id2]] This is a list sub-item

Hyperlinks to URIs can have alt text, which is used in accessibility (corresponding to the HTML a@title attribute). This is specified by appending ,title=…​ after the text in the URL macro in AsciiDoc:

http://www.example.com[text to go into the hyperlink]

http://www.example2.com[text to go into the second hyperlink,title=This is a tooltip for the link]

Cross-references to external documents

In localities and locality values, anchor can be integrated in citations of documents via references; for example:


will generate a hyperlink to the element with ID xyz in document ISO7301. This convention is necessary for cross-references between documents in a Metanorma document collection.

Outside of that, Metanorma will process cross-references to anchors within external documents just like typical AsciiDoc.



will be processed as a link to anchor #b in document document1.adoc.

If the reference uses the .adoc suffix, as in the example above, it is stripped in Metanorma XML and substituted with the extension of the current document type during document generation.

The above example is rendered in Metanorma XML as <xref target="document1#b">, in HTML as <a href="document1.html#b">, and in PDF as <a href="document1.pdf#b">.


Admonitions (“NOTE”, “IMPORTANT”, “WARNING”, “CAUTION” etc.) in the document body (i.e. within a main body clause) can be stated to apply to the entire document by moving them to the start of the document body, before the main sequence of clauses.

This can be done by giving them the attribute beforeclauses=true [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.3.30].

== Scope

This important notice applies to the entire document.

My scope text...

Admonitions in the document prefaces (including in the Foreword) can be stated to apply to the entire preface by moving them to the start of the preface, before the Foreword. This can be done by giving them the same attribute beforeclauses=true [added in https://github.com/metanorma/metanorma-standoc/releases/tag/v1.5.2].

= Document title
:document-attribute: XXXX

This important notice applies to the entire document.

My foreword text...