Unverified Commit 53ec7c71 authored by Toby Hodges's avatar Toby Hodges
Browse files

Document LaTeX mathematical expressions

parent 0a171bbe
Loading
Loading
Loading
Loading
+54 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ keypoints:
- "Code blocks can have the source, regular output, or error class."
- "Special sections are formatted as blockquotes that open with a level-2 header and close with a class identifier."
- "Special sections may be callouts or challenges; other styles are used by the template itself."
math: true
---

A lesson consists of one or more episodes,
@@ -433,4 +434,55 @@ You can add a drop shadow effect to images by applying the

[jekyll-link-tag]: https://jekyllrb.com/docs/liquid/tags/#link

## Adding Formatted Equations

The template supports rendering of equations via [KaTeX](https://katex.org/).
This option must be activated by adding `math: true` to the YAML front matter
of the Markdown file where you wish to use it.

Mathematical expressions can then be added to the page content using the LaTeX syntax.

Expressions can be written inline:

~~~
{% raw %}Inline expressions can be added between `$` symbols, e.g. $E = Mc^2$.{% endraw %}
~~~
{: .source}

with the result:

Inline expressions can be added between `$` symbols, e.g. $E = mc^2$.

Or as a block across multiple lines:

~~~
{% raw %}$$
    \lim_{x \rightarrow 0}
    \frac{
        \sin x
    } {
        x
    }
    = 1
$${% endraw %}
~~~
{: .source}

with the result:

$$
    \lim_{x \rightarrow 0}
    \frac{
        \sin x
    } {
        x
    }
    = 1
$$

The example above was taken from the chapter _Typesetting Mathematical Formulae_,
in [The Not So Short Introduction to LaTeX](https://tobi.oetiker.ch/lshort/lshort.pdf),
which provides a good reference guide for those wishing to add equations
and mathematical expressions to their lessons.

{% include links.md %}