Platen uses special notation for rendering mathematical and scientific formulas in your content by writing KaTeX markup as the alt text for an image link.
By default, when your KaTeX markup is rendered with an image link, it’s rendered as a
<span>
element without any additional styling.
To write longer KaTeX formulas with more control, use the katex
codeblock instead.
Syntax #
Inline Syntaxes #
Basic Inline Syntax #
![katex:formula](source)
Reference Link Inline Syntax #
![katex:formula][<ReferenceID>]
[<ReferenceID>]: source
Examples #
1. KaTeX In a Paragraph #
Inputs #
This section describes how the normal markdown input for images works with the button render hook.
Images use this syntax for their inputs:
![alt_text](source)
alt_text
(as formula
)
#
Specifies the KaTeX formula to render inline.
This value must start with the prefix katex:
, math:
, or chem:
. For example, with the image
link ![math:x=y^{2}]()
, text
’s value would be x=y^{2}
. The math
and chem
prefixes are
included for readability and convenience. All three prefixes work the same way.
Platen inserts the formula in a <span>
element with the formula wrapped in parentheses
preceded by a backslash. The wrapping parentheses tell the KaTeX libraries to render the text inside
them.
You can use any valid KaTeX functions and Platen will render them. If you use the \ce{...}
expression for chemistry equations in a codeblock or give a codeblock the chem
language ID, Platen
loads the mhchem library for you.
Required: true
Type: KaTeX
source
#
This value is ignored by Platen.