The Forester markup language [007N]
- August 16, 2023
- Jon Sterling
A tree in Forester is a single file written in a markup language designed specifically for scientific writing with bottom-up hierarchy via transclusion. A tree has two components: the frontmatter and the mainmatter.
Forester markup: frontmatter [007P]
- August 16, 2023
- Jon Sterling
The frontmatter of a Forester tree is a sequence of declarations that we summarize below.
| Declaration | Meaning |
|---|---|
\title{...}
|
sets the title of the tree; can contain mainmatter markup |
\author{name}
|
sets the author of the tree to be the biographical tree at address name
|
\date{YYYY-MM-DD}
|
sets the creation date of the tree; full ISO 8601 date-times are supported. |
\taxon{Taxon}
|
sets the taxon of the tree; example taxa include lemma, theorem, person, reference; the latter two taxa are treated specially by Forester for tracking biographical and bibliographical trees respectively |
\def\ident[x][y]{body}
|
defines and exports from the current tree a function named \ident with two arguments; subsequently, the expression \ident{u}{v} would expand to body with the values of u,v substituted for \x,\y
|
\import{address}
|
brings the functions exported by the tree address into scope
|
\export{address}
|
brings the functions exported by the tree address into scope, and exports them from the current tree
|
Forester markup: mainmatter [007O]
- August 16, 2023
- Jon Sterling
Below we summarize the concrete syntax of the mainmatter in a Forester tree.
| Function | Meaning |
|---|---|
\p{...}
|
creates a paragraph containing ...; unlike Markdown, it is mandatory to annotate paragraphs explicitly |
\em{...}
|
typesets the content in italics |
\strong{...}
|
typesets the content in boldface |
\ol{...}
|
creates an ordered list |
\ul{...}
|
creates an unordered list |
\li{...}
|
creates a list item |
#{...}
|
typesets the content in (inline) math mode using \KaTeX ; note that math mode is idempotent in Forester |
##{...}
|
typesets the content in (display) math mode using \KaTeX |
\transclude{address}
|
transcludes the tree at address address as a subsection |
[title](address)
|
formats the text title as a hyperlink to address address; if address is the address of a tree, the link will point to that tree, and otherwise it is treated as a URL
|
\let\ident[x][y]{body}
|
defines a local function named \ident with two arguments; subsequently, the expression \ident{u}{v} would expand to body with the values of u,v substituted for \x,\y.
|
\code{...}
|
typesets the content in monospace |
\tex{preamble}{body}
|
typesets the body externally using \LaTeX using preamble as preamble code (e.g. to set up tikz packages, etc.). It can be useful to wrap this in your own macro in order to insert your preamble code automatically. |
Example An complete worked example tree in Forester [007Q]
- August 16, 2023
- Jon Sterling
An example of a complete tree in the Forester markup language can be seen below.
\title{Creation of (co)limits}
\date{2023-02-11}
\taxon{Definition}
\author{jonmsterling}
\def\CCat{#{\mathcal{C}}}
\def\DCat{#{\mathcal{D}}}
\def\ICat{#{\mathcal{I}}}
\def\Mor[arg1][arg2][arg3]{#{{\arg2}\xrightarrow{\arg1}{\arg3}}}
\p{Let \Mor{U}{\CCat}{\DCat} be a functor and let \ICat be a category. The functor #{U} is said to \em{create (co)limits of #{\ICat}-figures} when for any diagram \Mor{C_\bullet}{\ICat}{\CCat} such that #{\ICat\xrightarrow{C_\bullet}\CCat\xrightarrow{F}\DCat} has a (co)limit, then #{C_\bullet} has a (co)limit that is both preserved and reflected by #{F}.}The code above results in the following tree:
Definition. Creation of (co)limits [001H]
- February 11, 2023
- Jon Sterling
Let {\mathcal {C}}\xrightarrow {U}{\mathcal {D}} be a functor and let \mathcal {I} be a category. The functor U is said to create (co)limits of \mathcal {I}-figures when for any diagram {\mathcal {I}}\xrightarrow {C_\bullet }{\mathcal {C}} such that \mathcal {I}\xrightarrow {C_\bullet }\mathcal {C}\xrightarrow {F}\mathcal {D} has a (co)limit, then C_\bullet has a (co)limit that is both preserved and reflected by F.