===========
Mathematics
===========
Writing mathematics
===================
You have two modes for writing mathematics: inline and block (also called
"display"). Inline math is the small formulas you include in a sentence, inside
the flow of text. Blocks are optentially bigger formulas that break the flow of
text.
In order to write inline math, enclose it between ``$``. For instance: ``The
irrational $\sqrt 2$ is the positive number that equals $2$ when squared.``
In order to write display math, either enclose it between ``$$``, or put it inside a ``math`` code block
.. code-block:: markdown
The formula $$\sum \vec F = m\vec a$$ is from Newton. When applied to free fall, we get:
``` math
m\vec g = m\vec a
```
The syntax for mathematics is the same as the one for LaTeX math mode.
The math renderer: MathJax
==========================
Slipshow uses a third-party renderer to render mathematics. The rendering
happens currently when you load your presentation (as opposed to when you
compile it). The renderer is `MathJax `_, version
3.2.2. It is included in the html file, as soon as you are using mathematics, so
the html file is still completely standalone, and you don't need anything
installed locally to have it work.
Configure your renderer
=======================
You can add configure the renderer simply by setting a value anywhere in your
document. This allows, for instance, to define macros, or decide which
extensions are loaded.
.. code-block::
whose default value is:
.. code-block::
window.Katex = {
delimiters: [
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
throwOnError : false,
strict: false,
trust:true
};
In order to give a class or an id, use ``htmlClass{class}{math}`` and
``htmlId{id}{math}``. However, from personal but shallow testing, KaTeX does not
always preserve the order of elements from source to math, so the ``pause``
action might work less well. Other actions, such that ``reveal``, should work
well.