Syntax guide#
This guide covers the complete RSM syntax. For a quick introduction, see Readable Science Markup. For practical examples, see Recipes.
Base language#
The double colon is referred to as Halmos. The base language contains one
special character (the colon :), three types of tags, and only a handful of syntax
rules.
Syntax rules#
Tags can be one of two main types: blocks or inlines. They are differentiated by the syntax used to introduce them:
:tag: {
:key: val
...
}
<content>
::
:tag: {:key: val, ...} <content> ::
Here the ellipsis denote an arbitrary number of additional key-value pairs. In general, blocks introduce a part of the manuscript that should be regarded as completely separate from all other parts, while inlines denote a region of text that is part of the enclosing block.
The third type of tag is meta tags. They are the tags used above to modify their
parent tags via key-value pairs. Meta tags appear inside braces {} and provide
metadata about the enclosing tag. For example:
:theorem: {
:title: Pythagorean Theorem
:label: pythag
}
For a right triangle, $a^2 + b^2 = c^2$.
::
Here :title: and :label: are meta tags that modify the :theorem: block tag.
The :title: meta tag determines what title is displayed, while :label: provides
an identifier for cross-referencing. Some meta tags like :label: and :nonum:
work with many different tags, while others like :path: (for figures) are specific
to certain tags.