Via KaTeX server side, oh yes!
Inline math is done with the dollar sign (
$
) insane macro shortcut:
My inline $\sqrt{1 + 1}$ is awesome.
which renders as:
and block math is done with two or more dollar signs (My inline is awesome.
$$
):
$$
\sqrt{1 + 1} \\
\sqrt{1 + 1}
$$
which renders as:
The sane version of inline math is a lower case
m
:
My inline \m[[\sqrt{1 + 1}]] is awesome.
which renders as:
and the sane version of block math is with an upper caseMy inline is awesome.
M
:
\M[[
\sqrt{1 + 1} \\
\sqrt{1 + 1}
]]
which renders as:
The capital vs lower case theme is also used in other elements, see: block vs inline macros.
In the sane syntax, as with any other argument, you have to either escape any closing square brackets
]
with a backslash \
:
My inline \m[1 - \[1 + 1\] = -1] is awesome.
which renders as:
or with the equivalent double open and close:My inline is awesome.
My inline \m[[1 - [1 + 1] = -1]] is awesome.
Equation IDs and titles and linking to equations works identically to images, see that section for full details. Here is one equation reference example that links to the following insane syntax equation: Equation 7. "My first insane equation":
$$
\sqrt{1 + 1}
$$
{title=My first insane equation}
which renders as:
and the sane equivalent Equation 8. "My first sane equation":Equation 7. My first insane equation
\M{title=My first sane equation}[[
\sqrt{1 + 1}
]]
which renders as:
Equation 8. My first sane equation
Here is a raw one just to test the formatting outside of a
ourbigbook_comment
: