reST Cheat Sheet

Conf.py

conf.py used in examples on this page
  1from datetime import datetime
  2import os
  3import sys
  4
  5# -- Project information -----------------------------------------------------
  6
  7copyright = f"2025–{datetime.now().year}, Theo Langstraat"
  8project = 'Document server'
  9
 10# -- General configuration ---------------------------------------------------
 11
 12extensions = [
 13    'myst_parser',
 14    'sphinx_copybutton',
 15    'sphinx_design',
 16    'notfound.extension',
 17    'sphinxcontrib.mermaid',
 18    'sphinx_tabs.tabs',
 19    'sphinxcontrib.bibtex',
 20]
 21
 22# Geef het BibTeX-bestand op (bijvoorbeeld refs.bib in dezelfde map)
 23bibtex_bibfiles = ['refs.bib']
 24
 25# -- sphinx_design - Default dropdown ----------------------------------------
 26
 27sd_custom_directives = {
 28    "dropdown-source-code": {
 29        "inherit": "dropdown",
 30        "argument": "**Source code**",
 31        "options": {
 32            #"open": "",             # Open the dropdown by default.
 33            "color": "secondary",    # Set the color of the dropdown header (background and font). 
 34                                     # One of the semantic color names:
 35                                     # primary, secondary, success, danger, warning, info, light, dark, muted.
 36            "icon": "code",          # Set an octicon icon to prefix the dropdown header.
 37            #"chevron": "",          # The open-close direction of the chevron. One of: right-down, down-up.
 38            #"animate": "",          # Animate the dropdown opening (fade-in or fade-in-slide-down).
 39            "margin": "3 3 0 0",     # Outer margin of grid. 
 40                                     # One (all) or 
 41                                     # four (top bottom left right) values from: 0, 1, 2, 3, 4, 5, auto.
 42            #"name": "",             # Set a reference-able name for the dropdown container.
 43            #"class-container": "",  # Additional CSS classes for the container element.
 44            #"class-title": "",      # Additional CSS classes for the title element.
 45            #"class-body": "",       # Additional CSS classes for the body element.
 46        },
 47    }
 48}
 49
 50myst_enable_extensions = ["colon_fence"]
 51
 52templates_path = ['_templates']
 53exclude_patterns = []
 54
 55# -- Options for HTML output -------------------------------------------------
 56
 57html_theme = 'sphinx_rtd_theme'
 58
 59html_theme_options = {
 60    "collapse_navigation": False,
 61    "sticky_navigation": True,
 62    "navigation_depth": 6,
 63    "titles_only": False,
 64    "logo_only": True,
 65}
 66
 67html_static_path = ['_static']
 68html_favicon = 'images/favicon.png'
 69html_logo = 'images/logo - blauw transparent.png'
 70html_show_sphinx = False
 71html_show_sourcelink = False
 72html_permalinks = False
 73
 74html_css_files = [
 75    'css/custom-fonts.css', 'css/custom.css',
 76    'css/fontawesome/css/all.min.css',
 77]
 78
 79html_js_files = ['js/init.js']
 80
 81# -- Python path adjustments -------------------------------------------------
 82
 83sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
 84
 85# -- Release info ------------------------------------------------------------
 86
 87from releases import (
 88    author,
 89    release,
 90    release_dv_typo3,
 91    release_dv_nc,
 92    release_phiki_typo3,
 93)
 94
 95rst_epilog = """
 96.. |author| replace:: {author}
 97.. |release| replace:: {release}
 98.. |release_dv_typo3| replace:: {release_dv_typo3}
 99.. |release_dv_nc| replace:: {release_dv_nc}
100.. |release_phiki_typo3| replace:: {release_phiki_typo3}
101""".format(
102    author=author,
103    release=release,
104    release_dv_typo3=release_dv_typo3,
105    release_dv_nc=release_dv_nc,
106    release_phiki_typo3=release_phiki_typo3
107)

Chart.js

Source code
1.. raw:: html
2
3   <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
4   <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels"></script>
5   <script src="https://cdn.jsdelivr.net/npm/luxon"></script>
6   <script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon"></script>
7   <script src="https://cdn.jsdelivr.net/npm/hammerjs"></script>
8   <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-zoom"></script>

Weer

Source code
1.. raw:: html
2
3   <!-- weer grafiek -->
4   <script src="/_static/js/linegraph.js"></script>
5   <h4>Weer Historie Rotterdam</h4>
6   <div><canvas id="canvastemp" height="400"></canvas></div>
7   <small><a  href="http://www.buienradar.nl" target="_blank">buienradar.nl</a>
8   <p><small>Inzoomen = scrollen met het muiswiel, Pannen = houd shift ingedrukt en klik met de muis</small></P>

Weer Historie Rotterdam

buienradar.nl

Inzoomen = scrollen met het muiswiel, Pannen = houd shift ingedrukt en klik met de muis

Kwadratische vergelijking

2 4 -50
Berekening actuele waarden
Source code
 1.. raw:: html
 2
 3   <!-- kwadratische vergelijkings grafiek -->
 4   <canvas id="myChart"></canvas>
 5   <div class="input-graph">
 6      <label for="a">a: </label>
 7      <span id="a-value">2</span>
 8      <input id="a" type="range" min="-5" max="5" step="0.1" value="2">
 9      <label for="b">b: </label>
10      <span id="b-value">4</span>
11      <input id="b" type="range" min="-20" max="20" step="0.1" value="4">
12      <label for="c">c: </label>
13      <span id="c-value">-50</span>
14      <input id="c" type="range" min="-100" max="100" step="1" value="-50">
15   </div>
16   <script src="/_static/js/dynamicGraph.js"></script>
/_static/js/dynamicGraph.js
  1$(function() {
  2    $(document).ready(function() {
  3
  4        // Plugin om dikke nul-assen te tekenen
  5        const zeroAxesPlugin = {
  6        id: 'zeroAxes',
  7        afterDraw(chart) {
  8            const {ctx, chartArea: {left, right, top, bottom}, scales: {x, y}} = chart;
  9
 10            ctx.save();
 11            ctx.strokeStyle = '#666';
 12            ctx.lineWidth = 1;
 13
 14            // Horizontale nul-as (y = 0)
 15            const yZero = y.getPixelForValue(0);
 16            ctx.beginPath();
 17            ctx.moveTo(left, yZero);
 18            ctx.lineTo(right, yZero);
 19            ctx.stroke();
 20
 21            // Verticale nul-as (x = 0)
 22            const xZero = x.getPixelForValue(0);
 23            ctx.beginPath();
 24            ctx.moveTo(xZero, top);
 25            ctx.lineTo(xZero, bottom);
 26            ctx.stroke();
 27
 28            ctx.restore();
 29        }
 30    };
 31
 32    chart = new Chart(document.getElementById('myChart'), {
 33        type: 'line',
 34        data: {
 35            datasets: [{
 36                label: 'f(x)',
 37                type: 'line',
 38                fill: false,
 39                borderWidth: 2,
 40                backgroundColor: "#c96500",
 41                borderColor: "#c96500",
 42                pointHoverBackgroundColor: "rgba(59, 89, 152, 1)",
 43                pointHoverBorderColor: "rgba(59, 89, 152, 1)",
 44                pointStyle: 'line',
 45                pointRadius: 0,
 46                cubicInterpolationMode: 'monotone',
 47                data: [],
 48            }]
 49        },
 50        options: {
 51            //parsing: false,
 52            responsive: true,
 53            scales: {
 54                x: {
 55                    min: -20,
 56                    max: 20,
 57                    grid: { color: '#eee' },
 58                    type: 'linear',
 59                    position: 'bottom'
 60                },
 61                y: {
 62                    min: -100,
 63                    max: 200,
 64                    grid: { color: '#eee' }
 65                }
 66            },
 67            plugins: {
 68                legend: { display: false }
 69            }
 70        },
 71        plugins: [zeroAxesPlugin] // plugin activeren
 72    });
 73
 74    const params = new URLSearchParams({
 75        a: 2,
 76        b: 4,
 77        c: -50
 78    });
 79
 80    fetch(`/_static/php/kwadratische_functie.php?${params}`)
 81        .then(response => response.json())
 82        .then(data => {
 83            chart.data.datasets[0].data = data;
 84            chart.update();
 85        });
 86        updateChart();
 87    });
 88});
 89
 90function debounce(func, delay) {
 91    let timeoutId;
 92
 93    return function (...args) {
 94        clearTimeout(timeoutId);
 95        timeoutId = setTimeout(() => func.apply(this, args), delay);
 96    };
 97}
 98
 99const debouncedUpdateChart = debounce(updateChart, 250);
100const mathElement = document.getElementById('math');
101      mathElement.style.visibility = 'hidden';
102
103function updateInfo(a, b, c) {
104    const D = b * b - 4 * a * c;
105    const discriminant = fmt(D, 2);
106    const x1 = fmt((-b + Math.sqrt(D)) / (2 * a), 1);
107    const x2 = fmt((-b - Math.sqrt(D)) / (2 * a), 1);
108    const xT = -b / (2 * a);
109    const xTop = fmt(xT, 1);
110    const yTop = fmt(a * xT * xT + b * xT + c, 1);
111
112    const formulas =
113        `\\[
114        \\begin{aligned}
115            f(x) & = ax^2 + bx + c = ${a}x^2 ${b >= 0 ? '+' : '-'} ${Math.abs(b)}x ${c >= 0 ? '+' : '-'} ${Math.abs(c)} \\\\[8pt]
116            
117            x_1, x_2 & = \\frac{-b\\pm\\sqrt{b^2 - 4ac}}{2a} \\\\[8pt]
118
119            D & = b^2 - 4ac = ${b}^2 - 4 \\cdot ${a} \\cdot ${c} = ${discriminant} \\\\[8pt]
120
121            x_1 & = \\frac{-b + \\sqrt{D}}{2\\cdot a} = \\frac{-(${b}) + \\sqrt{${discriminant}}}{2\\cdot${a}} =
122                ${x1} \\\\
123            x_2 & = \\frac{-b - \\sqrt{D}}{2\\cdot a} = \\frac{-(${b}) - \\sqrt{${discriminant}}}{2\\cdot${a}} =
124                ${x2} \\\\[8pt]
125
126            x_{\\text{top}} & = \\frac{-b}{2a} = ${xTop} \\\\[4pt]
127            y_{\\text{top}} &= ${yTop} \\\\[8pt]
128        \\end{aligned}
129        \\]`;
130        
131    mathElement.innerHTML = formulas;
132
133    document.getElementById('a-value').innerHTML = a;
134    document.getElementById('b-value').innerHTML = b;
135    document.getElementById('c-value').innerHTML = c;
136
137    if (window.MathJax) {
138        MathJax.typesetPromise([mathElement]).then(() => {
139        });
140    }
141}
142
143async function updateChart() {
144    const a = Number(document.getElementById('a').value);
145    const b = Number(document.getElementById('b').value);
146    const c = Number(document.getElementById('c').value);
147
148    const response = await fetch(
149        `/_static/php/kwadratische_functie.php?a=${a}&b=${b}&c=${c}`
150    );
151
152    chart.data.datasets[0].data = await response.json();
153    chart.update();
154    updateInfo(a, b, c);
155}
156
157document.querySelectorAll('input').forEach(input => {
158    input.addEventListener('input', debouncedUpdateChart);
159});
160
161const formatters = {};
162
163function fmt(n, decimals = 1) {
164    if (!formatters[decimals]) {
165        formatters[decimals] = new Intl.NumberFormat(navigator.language, {
166            minimumFractionDigits: 0,
167            maximumFractionDigits: decimals,
168            useGrouping: false
169        });
170    }
171
172    return formatters[decimals].format(n);
173}
174
175MathJax.startup.promise.then(() => {
176    //init();
177            mathElement.style.visibility = 'visible';
178
179});
1.. card::  Berekening actuele waarden
2   :margin: 2 2 0 0
3   :shadow: none
4
5      .. raw:: html
6
7         <div class="math-container"">
8            <div id="math" class="math-hidden"></div>
9         </div>

Admonition

Source code
 1.. attention::
 2   Information that requires the reader’s attention. The content of the directive should be written in complete sentences and include all appropriate punctuation.
 3
 4.. caution::
 5   Information with regard to which the reader should exercise care. The content of the directive should be written in complete sentences and include all appropriate punctuation.
 6
 7.. danger::
 8   Information which may lead to near and present danger if not heeded. The content of the directive should be written in complete sentences and include all appropriate punctuation.
 9
10.. error::
11   Information relating to failure modes of some description. The content of the directive should be written in complete sentences and include all appropriate punctuation.
12
13.. hint::
14   Information that is helpful to the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation.
15
16.. important::
17   Information that is of paramount importance and which the reader must not ignore. The content of the directive should be written in complete sentences and include all appropriate punctuation.
18
19.. note::
20   An especially important bit of information that the reader should know. The content of the directive should be written in complete sentences and include all appropriate punctuation.
21
22.. tip::
23   Some useful tidbit of information for the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation.
24
25.. warning::
26   An important bit of information that the reader should be very aware of. The content of the directive should be written in complete sentences and include all appropriate punctuation.
27
28.. admonition:: Belangrijk
29
30   Dit is een aangepaste admonition.
31   Je kunt hier elke tekst, lijst of codeblok in plaatsen.
32
33.. seealso::
34   Many sections include a list of references to module documentation or external documents. These lists are created using the seealso directive.

Attention

Information that requires the reader’s attention. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Caution

Information with regard to which the reader should exercise care. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Danger

Information which may lead to near and present danger if not heeded. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Error

Information relating to failure modes of some description. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Hint

Information that is helpful to the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Important

Information that is of paramount importance and which the reader must not ignore. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Note

An especially important bit of information that the reader should know. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Tip

Some useful tidbit of information for the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Warning

An important bit of information that the reader should be very aware of. The content of the directive should be written in complete sentences and include all appropriate punctuation.

Belangrijk!

Dit is een aangepaste admonition. Je kunt hier elke tekst, lijst of codeblok in plaatsen.

See also

Many sections include a list of references to module documentation or external documents. These lists are created using the seealso directive.

Source code
 1.. version-added:: 7.0
 2   The date/time types datetime and timespan have been superseded
 3   by the SQL92-defined types timestamp and interval. Although
 4   there has been some effort to ease the transition by allowing
 5   PostgreSQL to recognize the deprecated type names and translate
 6   them to the new type names, this mechanism cannot be completely
 7   transparent to your existing application.
 8
 9.. version-changed:: 1.3
10   Here’s a version changed message.
11
12.. version-deprecated:: 2.5
13   Here’s a deprecation message.
14
15.. version-removed:: 2.5
16   Here’s a removed message.

Added in version 7.0: The date/time types datetime and timespan have been superseded by the SQL92-defined types timestamp and interval. Although there has been some effort to ease the transition by allowing PostgreSQL to recognize the deprecated type names and translate them to the new type names, this mechanism cannot be completely transparent to your existing application.

Changed in version 1.3: Here’s a version changed message.

Deprecated since version 2.5: Here’s a deprecation message.

Removed in version 2.5: Here’s a removed message.

Card

Source code
 1.. card:: Rspamd installatie
 2
 3   Installeer eerst de repository.
 4
 5   - :doc:`/github/index`
 6   - :doc:`/typo3/index`
 7   - :doc:`Custom title </typo3/index>`
 8
 9.. grid:: 2
10
11   .. grid-item-card::  Title 1
12
13         Header
14         ^^^
15         Card content
16         +++
17         Footer
18
19   .. grid-item-card::  Title 2
20
21      B
Rspamd installatie

Installeer eerst de repository.

Source code
 1.. grid:: 2
 2
 3   .. grid-item-card::  Title 1
 4
 5         Header
 6         ^^^
 7         Card content
 8         +++
 9         Footer
10
11   .. grid-item-card::  Title 2
12
13      B
14
15.. grid:: 2 3 3 4
16
17   .. grid-item::
18
19      .. card:: Title
20            :img-background: /images/logo_blauw_inverted.jpg
21            :class-card: sd-text-black
22            :img-alt: my text
23
24            Text
25
26   .. grid-item-card:: Title
27      :img-top: /images/logo_blauw_inverted.jpg
28      :img-alt:
29
30      Header
31      ^^^
32      Content
33      +++
34      Footer
35
36   .. grid-item-card:: Title
37      :img-bottom: /images/logo_blauw_inverted.jpg
38
39      Header
40      ^^^
41      Content
42      +++
43      Footer

Header

Title 1

Card content

Title 2

B

my text
Title

Text

Header

Title

Content

Header

Title

Content

Code

Source code
1This is a normal text paragraph. The next paragraph is a code sample::
2
3   It is not processed in any way, except
4   that the indentation is removed.
5
6   It can span multiple lines.
7
8This is a normal text paragraph again.

This is a normal text paragraph. The next paragraph is a code sample:

1It is not processed in any way, except
2that the indentation is removed.
3
4It can span multiple lines.

This is a normal text paragraph again.

>>> 1 + 1
2

Code-block

Source code
 1.. code-block:: bash
 2
 3   #!/bin/bash
 4   #
 5   # Weekly maintenance print voor Canon Pro 300
 6   # Met foutdetectie, queue-checks en logging voor cron
 7   #
 8
 9   set -euo pipefail
10
11   # Log alles naar stdout/stderr zodat cron het mailt
12   echo "=== Weekly print gestart: $(date) ==="
 1#!/bin/bash
 2#
 3# Weekly maintenance print voor Canon Pro 300
 4# Met foutdetectie, queue-checks en logging voor cron
 5#
 6
 7set -euo pipefail
 8
 9# Log alles naar stdout/stderr zodat cron het mailt
10echo "=== Weekly print gestart: $(date) ==="
Source code
1.. rubric:: Footnotes
2
3.. [#f1] Text of the first footnote.
4.. [#f2] Text of the second footnote.

Footnotes

Fontawesome

Source code
 1:fa:`laptop`
 2:fa:`house-laptop`
 3:fa:`laptop-medical`
 4:fa:`laptop-file`
 5:fa:`laptop-code`
 6
 7----
 8
 9:fa:`windows fa-2x`
10:fa:`trash-can fa-6x`
11:fa:`linux fa-4x`
12:fa:`debian fa-6x`
13
14----
15
16:fa:`windows fa-3x fa-fade fa-2x`
17:fa:`linux fa-4x fa-spin fa-4x`
18:fa:`debian fa-2x fa-beat fa-6x`
19
20----
21
22:fa:`check fa-lg`
23:fa:`triangle-exclamation fa-lg`
24:fa:`circle-info fa-lg`
25
26----
27
28:fa:`linux fa-4x fa-rotate-90`
29:fa:`linux fa-4x fa-flip-horizontal`
30:fa:`linux fa-4x`
31
32----
33
34:fa:`camera fa-4x`
35:fa:`photo-film fa-4x`
36:fa:`video fa-4x`
37:far:`image fa-4x`
38:fas:`image fa-4x`
39
40----
41
42:fa:`cloud fa-4x`
43:fa:`nextcloud fa-4x`
44:fa:`cloud-sun-rain fa-4x`
45:fa:`cloud-rain fa-4x`
46:fa:`cloud-showers-heavy fa-4x`
47
48:fa:`nextcloud fa-10x sd-text-primary`
49
50:fa:`nextcloud fa-10x sd-text-info`
51
52:fa:`nextcloud fa-10x text-blue`
53
54
55.. raw:: html
56
57   <i class="fa-solid fa-thumbs-up" aria-hidden="true"></i>
58   <i class="fa fa-car" aria-hidden="true"></i><br><br>
59
60.. raw:: html
61
62   <!-- solid style icon -->
63   <i class="fa-solid fa-angle-double-down"></i>
64   <i class="fa-solid fa-angle-left"></i>
65   <i class="fa-solid fa-angle-right"></i>
66   <i class="fa-solid fa-angle-up"></i>
67
68----
69
70.. raw:: html
71
72   <!-- solid style icon -->
73   <i class="fa-solid fa-user"></i>
74   <i class="fa-regular fa-user"></i>
75   <i class="fa-solid fa-heart"></i>
76   <i class="fa-regular fa-heart"></i>
77
78
79   <!-- brand icon -->
80   <i class="fa-brands fa-github-square"></i>
81   <br>
82
83----
84
85:fas:`angle-double-down`
86:fas:`angle-left`
87:fas:`angle-right`
88:fas:`angle-up`
89:fa:`heart`
90:fa:`check`
91:fa:`check lg`
92:fa:`github`
93
94An icon :fab:`github`, some more text
95
96----












An icon , some more text


Footnotes

Source code
1Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_

Lorem ipsum [1] dolor sit amet … [2]

Headings

  1. Use # to underline 1st level headers.

  2. Use * to underline 2nd level headers.

  3. Use = to underline 3rd level headers.

  4. Use - to underline 4th level headers.

  5. Use ^ to underline 5th level headers.

  6. Use “ to underline 6th level headers.

Inline markup

Source code
 1The standard reStructuredText inline markup is quite simple: use
 2
 3one asterisk: *text* for emphasis (italics),
 4
 5two asterisks: **text** for strong emphasis (boldface), and
 6
 7backquotes: ``text`` for code samples.
 8
 9If text is indented, it is treated as a block quotation:
10
11   Should array indices start at 0 or 1?
12   My suggested compromise of 0.5 was rejected without, I thought, proper consideration
13   -- Stan Kelly-Bootle

The standard reStructuredText inline markup is quite simple: use

one asterisk: text for emphasis (italics),

two asterisks: text for strong emphasis (boldface), and

backquotes: text for code samples.

If text is indented, it is treated as a block quotation:

Should array indices start at 0 or 1? My suggested compromise of 0.5 was rejected without, I thought, proper consideration – Stan Kelly-Bootle

Lists

Source code
1* This is a bulleted list.
2* It has two items, the second
3item uses two lines.
4
51. This is a numbered list.
62. It has two items too.
7
8#. This is a numbered list.
9#. It has two items too.
  • This is a bulleted list.

  • It has two items, the second item uses two lines.

  1. This is a numbered list.

  2. It has two items too.

  3. This is a numbered list.

  4. It has two items too.

Math

Source code
  1.. math::
  2   :name: Fourier transform
  3
  4   (\mathcal{F}f)(y) & =
  5      \frac{1}{\sqrt{2\pi}^{\ n}}
  6      \int_{\mathbb{R}^n}
  7      f(x)\, e^{-\mathrm{i} y \cdot x} \,\mathrm{d} x. \\
  8   \\
  9   f(x) & = x^2 + 2xy + y^2
 10
 11----
 12
 13.. math::
 14   :name: Pythagoras
 15
 16      a^2 + b^2 & = c^2 \\
 17      \\
 18      f(x) & = x^2 + 2xy + y^2
 19
 20----
 21
 22.. math::
 23
 24      f(y) & = ax^2 + bx + c \\
 25      \\
 26      x_1, x_2 & = \frac{-b\pm\sqrt{b^2 - 4ac}}{2a} \\
 27      \\
 28      x_{\text{top}} & = \frac{-b}{2a}
 29
 30----
 31
 32.. math::
 33
 34   x^2 + 2\frac{b}{2a}x + \left(\frac{b}{2a}\right)^2 &= \left(\frac{b}{2a}\right)^2 - \frac{c}{a}
 35
 36   x + \left(\frac{b}{2a}\right)^2 &= \left(\frac{b}{2a}\right) - \frac{c}{a}
 37
 38----
 39
 40.. math::
 41
 42   \sqrt{1+\sqrt{1+\sqrt{1+
 43            \sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}} = x \tag4
 44
 45The ``:name:`` option puts a label on the equation that can be linked to
 46by hyperlink references. In this case, you could link back to the previous
 47math equation using the `Fourier transform`_ hyperlink reference.
 48
 49`Pythagoras`_
 50
 51----
 52
 53.. math::
 54
 55   &a\cr &b
 56   \\
 57
 58----
 59
 60.. math::
 61
 62
 63   A=\left\{\matrix{& x & , & if x\ge0;\cr
 64                  &-x & , & otherwise.\cr}\right.
 65
 66----
 67
 68.. math::
 69
 70   A=\left(\matrix{x-\lambda&1&0\cr
 71                  0&x-\lambda&1\cr
 72                  0&0&x-\lambda\cr}\right)
 73
 74----
 75
 76.. math::
 77
 78   \left\{
 79   \begin{array}{rl}
 80      \alpha&=f(z)\\ \beta&=f(z^2)\\ \gamma&=f(z^3)
 81   \end{array}
 82   \right\}\qquad\left\{
 83   \begin{array}{rl}
 84      x&=\alpha^2-\beta\\ y&=2\gamma
 85   \end{array}
 86   \right\}.
 87
 88----
 89
 90.. math::
 91
 92(x+y)(x-y)&=x^2-xy+xy-y^2 \\
 93            &=x^2-y^2 \\
 94(x+y)^2   &=x^2+2xy+y^2
 95
 96----
 97
 98.. math::
 99
100   &\kappa = \begin{cases}
101   0, & \text{if censored} \\
102   1, & \text{if not censored} \\
103   2, & \text{if censored} \\
104   3, & \text{if not censored} \\
105   4, & \text{if censored} \\
106   5, & \text{if not censored} \\
107   6, & \text{bla bla bla}
108   \end{cases}
109   \\
110   \\
111   &M=
112   \left[ {\begin{array}{cc}
113   1 & 2 \\
114   3 & 4 \\
115   \end{array} } \right]
116
117----
(1)\[\begin{split}(\mathcal{F}f)(y) & = \frac{1}{\sqrt{2\pi}^{\ n}} \int_{\mathbb{R}^n} f(x)\, e^{-\mathrm{i} y \cdot x} \,\mathrm{d} x. \\ \\ f(x) & = x^2 + 2xy + y^2\end{split}\]

(2)\[\begin{split} a^2 + b^2 & = c^2 \\ \\ f(x) & = x^2 + 2xy + y^2\end{split}\]

\[\begin{split}f(y) & = ax^2 + bx + c \\ \\ x_1, x_2 & = \frac{-b\pm\sqrt{b^2 - 4ac}}{2a} \\ \\ x_{\text{top}} & = \frac{-b}{2a}\end{split}\]

\[ \begin{align}\begin{aligned}x^2 + 2\frac{b}{2a}x + \left(\frac{b}{2a}\right)^2 &= \left(\frac{b}{2a}\right)^2 - \frac{c}{a}\\x + \left(\frac{b}{2a}\right)^2 &= \left(\frac{b}{2a}\right) - \frac{c}{a}\end{aligned}\end{align} \]

\[\sqrt{1+\sqrt{1+\sqrt{1+ \sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}}}} = x \tag4\]

The :name: option puts a label on the equation that can be linked to by hyperlink references. In this case, you could link back to the previous math equation using the Fourier transform hyperlink reference.

Pythagoras


\[\begin{split}&a\cr &b \\\end{split}\]

\[A=\left\{\matrix{& x & , & if x\ge0;\cr &-x & , & otherwise.\cr}\right.\]

\[A=\left(\matrix{x-\lambda&1&0\cr 0&x-\lambda&1\cr 0&0&x-\lambda\cr}\right)\]

\[\begin{split}\left\{ \begin{array}{rl} \alpha&=f(z)\\ \beta&=f(z^2)\\ \gamma&=f(z^3) \end{array} \right\}\qquad\left\{ \begin{array}{rl} x&=\alpha^2-\beta\\ y&=2\gamma \end{array} \right\}.\end{split}\]

\[\begin{split}(x+y)(x-y)&=x^2-xy+xy-y^2 \\ &=x^2-y^2 \\ (x+y)^2 &=x^2+2xy+y^2\end{split}\]

\[\begin{split}&\kappa = \begin{cases} 0, & \text{if censored} \\ 1, & \text{if not censored} \\ 2, & \text{if censored} \\ 3, & \text{if not censored} \\ 4, & \text{if censored} \\ 5, & \text{if not censored} \\ 6, & \text{bla bla bla} \end{cases} \\ \\ &M= \left[ {\begin{array}{cc} 1 & 2 \\ 3 & 4 \\ \end{array} } \right]\end{split}\]

Mermaid

chart

Source code
1.. mermaid::
2
3   xychart-beta
4      title "Monthly sales"
5      x-axis [Jan, Feb, Mar, Apr]
6      y-axis "Sales" 0 --> 100
7      bar [20, 35, 60, 85]
        xychart-beta
    title "Monthly sales"
    x-axis [Jan, Feb, Mar, Apr]
    y-axis "Sales" 0 --> 100
    bar [20, 35, 60, 85]
    
        xychart-beta
    title "Omzet per Maand"
    x-axis [jan, feb, mar, apr, mei, jun]
    y-axis "Omzet (in €)" 0 --> 12000
    bar [5000, 6000, 7500, 8200, 9500, 10500]
    line [5000, 6000, 7500, 8200, 9500, 10500]
    

flowchart

Source code
1.. mermaid::
2
3   flowchart TD
4      A[Christmas] -->|Get money| B(Go shopping)
5      B --> C{Let me think}
6      C -->|One| D[Laptop]
7      C -->|Two| E[iPhone]
8      C -->|Three| F[fa:fa-car Car]
        ---
config:
   theme: 'base'
   themeVariables:
      primaryColor: '#DBE2EF80'
      primaryTextColor: '#000'
      primaryBorderColor: '#3F72AF80'
      lineColor: '#3F72AF80'
      secondaryColor: '#fff'
      tertiaryColor: '#ffff80'
---

flowchart TD
   A[Christmas] -->|Get money| B(Go shopping)
   B --> C{Let me think}
   C -->|One| D[fa:fa-laptop Laptop]
   C -->|Two| E[fa:fa-phone-square iPhone]
   C -->|Three| F[fa:fa-car Car]
    

Gannt

Source code
 1.. mermaid::
 2
 3   gantt
 4   title Product Launch Plan
 5   dateFormat YYYY-MM-DD
 6   section Planning
 7      Market research      :done, research, 2024-03-01, 10d
 8      Define requirements  :done, reqs, after research, 7d
 9   section Build
10      Design prototype     :active, proto, after reqs, 14d
11      User testing         :testing, after proto, 7d
12   section Launch
13      Marketing campaign   :marketing, after proto, 14d
14      Release day          :milestone, after testing, 0d
        ---
config:
   theme: 'base'
   themeVariables:
      primaryColor: '#DBE2EF80'
      primaryTextColor: '#000'
      primaryBorderColor: '#3F72AF80'
      lineColor: '#3F72AF80'
      secondaryColor: '#fff'
      tertiaryColor: '#ffff80'
---

gantt
 title Product Launch Plan
 dateFormat YYYY-MM-DD
 section Planning
     Market research      :done, research, 2024-03-01, 10d
     Define requirements  :done, reqs, after research, 7d
 section Build
     Design prototype     :active, proto, after reqs, 14d
     User testing         :testing, after proto, 7d
 section Launch
     Marketing campaign   :marketing, after proto, 14d
     Release day          :milestone, after testing, 0d
 section Planning
     Market research      :done, research, 2024-03-01, 10d
     Define requirements  :done, reqs, after research, 7d
 section Build
     Design prototype     :active, proto, after reqs, 14d
     User testing         :testing, after proto, 7d
 section Launch
     Marketing campaign   :marketing, after proto, 14d
     Release day          :milestone, after testing, 0d
    

sequenceDiagram

Source code
 1.. mermaid::
 2
 3   sequenceDiagram
 4      participant Alice
 5      participant Bob
 6      Alice->>John: Hello John, how are you?
 7      loop HealthCheck
 8         John->>John: Fight against hypochondria
 9      end
10      Note right of John: Rational thoughts <br/>prevail!
11      John-->>Alice: Great!
12      John->>Bob: How about you?
13      Bob-->>John: Jolly good!
        ---
config:
   theme: 'base'
   themeVariables:
      primaryColor: '#DBE2EF80'
      primaryTextColor: '#000'
      primaryBorderColor: '#3F72AF80'
      lineColor: '#3F72AF80'
      secondaryColor: '#fff'
      tertiaryColor: '#ffff80'
---

sequenceDiagram
   participant Alice
   participant Bob
   Alice->>John: Hello John, how are you?
   loop HealthCheck
      John->>John: Fight against hypochondria
   end
   Note right of John: Rational thoughts <br/>prevail!
   John-->>Alice: Great!
   John->>Bob: How about you?
   Bob-->>John: Jolly good!
    

stateDiagram

Source code
 1.. mermaid::
 2
 3   ---
 4   title: PackML State Diagram to IEC 61131-3
 5   config:
 6      theme: 'base'
 7      themeVariables:
 8         primaryColor: '#DBE2EF80'
 9         primaryTextColor: '#000'
10         primaryBorderColor: '#3F72AF80'
11         lineColor: '#3F72AF80'
12         secondaryColor: '#fff'
13         tertiaryColor: '#ffff80'
14   ---
15
16   stateDiagram-v2
17      direction LR
18      classDef waitState fill:#3F72AF80,color:white,font-weight:bold
19      class waitingState, Idle, Held, Suspended, Complete, Stopped, Aborted waitState
20
21      state Operating {
22
23      Idle --> Starting : Start
24
25      Starting --> Execute : SC
26
27      Execute --> Holding : Hold
28      Holding --> Held : SC
29      Held --> UnHolding : UnHold
30      UnHolding --> Execute : SC
31
32      Execute --> Suspending : Suspend
33      Suspending --> Suspended : SC
34      Suspended --> UnSuspending : UnSuspend
35      UnSuspending --> Execute : SC
36
37      Execute --> Completing : SC
38      Completing --> Complete : SC
39      Complete --> Resetting : Reset
40      Resetting --> Idle : SC
41
42      }
43
44      Operating --> Stopping : Stop
45      Stopping --> Stopped : SC
46
47      Operating --> Aborting : Abort
48      Aborting --> Aborted : SC
49      Aborted --> Clearing : Clear
50      Clearing --> Stopped : SC
51
52      Stopped --> Resetting : Reset
53
54      Note left of Aborting: SC = State Complete
55      activeState : Active State
56      waitingState : Waiting State
        ---
title: PackML State Diagram to IEC 61131-3
config:
   theme: 'base'
   themeVariables:
      primaryColor: '#DBE2EF80'
      primaryTextColor: '#000'
      primaryBorderColor: '#3F72AF80'
      lineColor: '#3F72AF80'
      secondaryColor: '#fff'
      tertiaryColor: '#ffff80'
---

stateDiagram-v2
   direction LR
   classDef waitState fill:#3F72AF80,color:white,font-weight:bold
   class waitingState, Idle, Held, Suspended, Complete, Stopped, Aborted waitState

   state Operating {

   Idle --> Starting : Start

   Starting --> Execute : SC

   Execute --> Holding : Hold
   Holding --> Held : SC
   Held --> UnHolding : UnHold
   UnHolding --> Execute : SC

   Execute --> Suspending : Suspend
   Suspending --> Suspended : SC
   Suspended --> UnSuspending : UnSuspend
   UnSuspending --> Execute : SC

   Execute --> Completing : SC
   Completing --> Complete : SC
   Complete --> Resetting : Reset
   Resetting --> Idle : SC

   }

   Operating --> Stopping : Stop
   Stopping --> Stopped : SC

   Operating --> Aborting : Abort
   Aborting --> Aborted : SC
   Aborted --> Clearing : Clear
   Clearing --> Stopped : SC

   Stopped --> Resetting : Reset

   Note left of Aborting: SC = State Complete
   activeState : Active State
   waitingState : Waiting State
    

Nested lists

Source code
11. fruits
2
3* apple
4* banana
5
62. vegetables
7
8* carrot
9* broccoli
  1. fruits

  • apple

  • banana

  1. vegetables

  • carrot

  • broccoli

References

Source code
1See :cite:t:`1906:langstraat` for an introduction to non-standard analysis.
2Non-standard analysis is fun :cite:p:`1906:langstraat`.
3
4See :cite:t:`1987:nelson` for an introduction to non-standard analysis.
5Non-standard analysis is fun :cite:p:`1987:nelson`.
6
7See :cite:t:`2006:xlangstraat` for an introduction to non-standard analysis.
8Non-standard analysis is fun :cite:p:`2006:xlangstraat`.
refs.bib
 1// refs.bib
 2
 3@Book{1987:nelson,
 4   author = {Edward Nelson},
 5   title = {Radically Elementary Probability Theory},
 6   publisher = {Princeton University Press},
 7   year = {1987}
 8}
 9
10@Book{2006:xlangstraat,
11   author = {Theo Langstraat and Edward Nelson},
12   title = {Getting started with sphinxcontrib-bibtex},
13   publisher = {Langstraat Online},
14   year = {2006}
15}
16
17@article{1906:langstraat,
18   author  = {Einstein, A. and Podolsky, B. and Rosen, N.},
19   title   = {Can Quantum-Mechanical Description of Physical Reality Be Considered Complete?},
20   journal = {Physical Review},
21   year    = {1906},
22   volume  = {47},
23   number  = {10},
24   pages   = {777--780},
25   doi     = {10.1103/PhysRev.47.777}
26}

See Einstein et al. [EPR06] for an introduction to non-standard analysis. Non-standard analysis is fun [EPR06].

See Nelson [Nel87] for an introduction to non-standard analysis. Non-standard analysis is fun [Nel87].

See Langstraat and Nelson [LN06] for an introduction to non-standard analysis. Non-standard analysis is fun [LN06].

Role

Source code
1.. role:: python(code)
2   :language: python
3
4In Python, :python:`1 + 2` is equal to :python:`3`.

In Python, 1 + 2 is equal to 3.

Tables

Source code
 1+------------------------+------------+----------+----------+
 2| Header row, column 1   | Header 2   | Header 3 | Header 4 |
 3| (header rows optional) |            |          |          |
 4+========================+============+==========+==========+
 5| body row 1, column 1   | column 2   | column 3 | column 4 |
 6+------------------------+------------+----------+----------+
 7| body row 2             | ...        | ...      |          |
 8+------------------------+------------+----------+----------+
 9
10=====  =====  =======
11A      B      A and B
12=====  =====  =======
13False  False  False
14True   False  False
15False  True   False
16True   True   True
17=====  =====  =======
18
19.. list-table:: Available languages and bible translations
20   :class: longtable
21   :header-rows: 1
22   :widths: 15 50
23
24   *  - Language
25      - Bible translation
26   *  - English
27      -  | - English Standard Version
28         | - King James Version
29         | - New American Standard Bible 2020
30         | - New Catholic Bible
31         | - New International Version
32         | - New King James Version
33         | - New Living Translation
34         | - New Revised Standard Version
35         | - World English Bible
36   *  - Spanish (Español)
37      -  | - La Biblia de las Américas
38         | - Nueva Versión Internacional
39         | - ReinaValera 1960
40         | - ReinaValera 1995
41   *  - Portuguese (Português)
42      -  | - Almeida Revista e Atualizada
43         | - Almeida Revista e Corrigida
44         | - Nova Versão Internacional

Header row, column 1 (header rows optional)

Header 2

Header 3

Header 4

body row 1, column 1

column 2

column 3

column 4

body row 2

…

…

A

B

A and B

False

False

False

True

False

False

False

True

False

True

True

True

Available languages and bible translations

Language

Bible translation

English

- English Standard Version
- King James Version
- New American Standard Bible 2020
- New Catholic Bible
- New International Version
- New King James Version
- New Living Translation
- New Revised Standard Version
- World English Bible

Spanish (Español)

- La Biblia de las Américas
- Nueva Versión Internacional
- ReinaValera 1960
- ReinaValera 1995

Portuguese (Português)

- Almeida Revista e Atualizada
- Almeida Revista e Corrigida
- Nova Versão Internacional

Tabs

Source code
1.. tab-set::
2
3   .. tab-item:: Debian
4
5      apt install rspamd
6
7   .. tab-item:: Ubuntu
8
9      apt install rspamd # ubuntu

apt install rspamd

apt install rspamd # ubuntu

Terms

Source code
1term (up to a line of text)
2   Definition of the term, which must be indented
3
4   and can even consist of multiple paragraphs
5
6next term
7   Description.
term (up to a line of text)

Definition of the term, which must be indented

and can even consist of multiple paragraphs

next term

Description.

Footnotes