// MarkPlus default article template — Typst source
// Generated by markplus_render • edit to customise
#set document(
title: "{% if meta and meta.title %}{{ meta.title }}{% else %}Document{% endif %}",
{% if meta and meta.author %}author: "{{ meta.author }}",{% endif %}
)
#set page(
paper: "a4",
margin: (top: 2.5cm, bottom: 2.5cm, left: 2.5cm, right: 2.5cm),
)
#set text(
font: "Liberation Serif",
size: 11pt,
lang: "en",
)
#set heading(numbering: "1.")
#set par(leading: 0.75em, justify: true)
#show heading.where(level: 1): it => [
#v(0.5em)
#text(font: "Liberation Sans", size: 18pt, weight: "bold")[#it.body]
#v(0.3em)
#line(length: 100%, stroke: 0.5pt + gray)
#v(0.3em)
]
#show heading.where(level: 2): it => [
#v(0.4em)
#text(font: "Liberation Sans", size: 14pt, weight: "bold")[#it.body]
#v(0.2em)
]
#show heading.where(level: 3): it => [
#v(0.3em)
#text(font: "Liberation Sans", size: 12pt, weight: "bold")[#it.body]
#v(0.1em)
]
#show raw: it => [
#box(fill: luma(245), radius: 3pt, inset: (x: 6pt, y: 4pt))[
#text(font: "Liberation Mono", size: 9pt)[#it]
]
]
{% if meta %}
// ── Title block ────────────────────────────────────────────────────────────
#align(center)[
{% if meta.title %}
#text(font: "Liberation Sans", size: 22pt, weight: "bold")[{{ meta.title }}]
{% endif %}
{% if meta.date %}
#v(0.3em)
#text(size: 10pt, fill: gray)[{{ meta.date | date_fmt }}]
{% endif %}
{% if meta.author %}
#v(0.2em)
#text(size: 11pt)[{{ meta.author }}]
{% endif %}
{% if meta.tags %}
#v(0.3em)
#text(size: 9pt, fill: rgb("#3f51b5"))[\[{% for tag in meta.tags %}{{ tag }}{% if not loop.last %}, {% endif %}{% endfor %}\]]
{% endif %}
]
#v(1em)
{% endif %}
{% if toc | length > 1 %}
// ── Table of contents ──────────────────────────────────────────────────────
#outline(title: "Contents", depth: 3, indent: 1em)
#pagebreak()
{% endif %}
// ── Body ───────────────────────────────────────────────────────────────────
{% for node in body %}
{% if node.t == "heading" %}
{% if node.level == 1 %}= {% elif node.level == 2 %}== {% elif node.level == 3 %}=== {% elif node.level == 4 %}==== {% elif node.level == 5 %}===== {% else %}====== {% endif %}{% for child in node.children %}{{ child.text | default(value="") }}{% endfor %}
{% elif node.t == "paragraph" %}
{% for child in node.children %}{% if child.t == "text" %}{{ child.text }}{% elif child.t == "strong" %}*{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}*{% elif child.t == "em" %}_{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}_{% elif child.t == "code" %}`{{ child.text }}`{% elif child.t == "link" %}#link("{{ child.href }}")[{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}]{% elif child.t == "math_inline" %}${{ child.src }}${% elif child.t == "del" %}#strike[{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}]{% elif child.t == "hard_break" %}\ {% elif child.t == "soft_break" %} {% elif child.t == "sup" %}#super[{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}]{% elif child.t == "sub" %}#sub[{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}]{% endif %}{% endfor %}
{% elif node.t == "fenced" %}
```{{ node.name }}
{{ node.raw }}
```
{% elif node.t == "math_block" %}
$ {{ node.src }} $
{% elif node.t == "blockquote" %}
#quote(block: true)[
{% for child in node.children %}{% if child.t == "paragraph" %}{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}{% endif %}
{% endfor %}
]
{% elif node.t == "list" %}
{% for li in node.items %}
{% if node.ordered %}+ {% else %}- {% endif %}{% for child in li.children %}{% if child.t == "paragraph" %}{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}{% elif child.t == "text" %}{{ child.text | default(value="") }}{% elif child.t == "strong" %}*{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}*{% elif child.t == "em" %}_{% for c in child.children %}{{ c.text | default(value="") }}{% endfor %}_{% elif child.t == "code" %}`{{ child.text | default(value="") }}`{% endif %}{% endfor %}
{% endfor %}
{% elif node.t == "table" %}
#figure(
table(
columns: {{ node.headers | length }},
stroke: 0.5pt,
{% if node.headers %}
// header row
{% for cell in node.headers %}table.header[*{% for c in cell.children %}{{ c.text | default(value="") }}{% endfor %}*],{% endfor %}
{% endif %}
{% for row in node.rows %}{% for cell in row %}[{% for c in cell.children %}{{ c.text | default(value="") }}{% endfor %}],{% endfor %}{% endfor %}
)
)
{% elif node.t == "hr" %}
#line(length: 100%, stroke: 0.3pt + gray)
{% endif %}
{% endfor %}