mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-12 01:04:51 -04:00
Update transform.ToMath
This commit is contained in:
parent
4d419a128e
commit
e5dee26513
@ -27,47 +27,47 @@ EXPRESSION
|
|||||||
: The math expression to render using KaTeX.
|
: The math expression to render using KaTeX.
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
: A map of zero or more [options].
|
: A map of zero or more options.
|
||||||
|
|
||||||
## Options
|
## Options
|
||||||
|
|
||||||
These are a sub set of the [KaTeX options].
|
These are a subset of the [KaTeX options].
|
||||||
|
|
||||||
output
|
output
|
||||||
: String. Default is `mathml`.\
|
: (`string`). Determines the markup language of the output. One of `html`, `mathml`, or `htmlAndMathml`. Default is `mathml`.
|
||||||
`html` Outputs HTML only.\
|
|
||||||
`mathml`: Outputs MathML only.\
|
<!-- Indent to prevent spliting the description list. -->
|
||||||
`htmlAndMathml`: Outputs HTML for visual rendering and MathML for accessibility.
|
|
||||||
|
With `html` and `htmlAndMathml` you must include KaTeX CSS within the `head` element of your base template. For example:
|
||||||
|
|
||||||
|
```html
|
||||||
|
<head>
|
||||||
|
...
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
|
||||||
|
...
|
||||||
|
</head>
|
||||||
|
```
|
||||||
|
|
||||||
displayMode
|
displayMode
|
||||||
: Boolean. Default is `false`.\
|
: (`bool`) If `true` render in display mode, else render in inline mode. Default is `false`.
|
||||||
If `true` the math will be rendered in display mode. If false the math will be rendered in `inline` mode.
|
|
||||||
|
|
||||||
leqno
|
leqno
|
||||||
: Boolean. Default is `false`.\
|
: (`bool`) If `true` render with the equation numbers on the left. Default is `false`.
|
||||||
If `true` the math will be rendered with the equation numbers on the left.
|
|
||||||
|
|
||||||
fleqn
|
fleqn
|
||||||
: Boolean. Default is `false`.\
|
: (`bool`) If `true` render flush left with a 2em left margin. Default is `false`.
|
||||||
If `true`, render flush left with a 2em left margin.
|
|
||||||
|
|
||||||
minRuleThickness
|
minRuleThickness
|
||||||
: Float. Default is `0.04`.\
|
: (`float`) The minimum thickness of the fraction lines in `em`. Default is `0.04`.
|
||||||
The minimum thickness of the fraction lines in `em`.
|
|
||||||
|
|
||||||
macros
|
macros
|
||||||
: Map. Default is `{}`.\
|
: (`map`) A map of macros to be used in the math expression. Default is `{}`.
|
||||||
A map of macros to be used in the math expression.
|
|
||||||
|
|
||||||
throwOnError
|
throwOnError
|
||||||
: Boolean. Default is `true`.\
|
: (`bool`) If `true` throw a `ParseError` when KaTeX encounters an unsupported command or invalid LaTex. See [error handling]. Default is `true`.
|
||||||
If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command or invalid LaTex. See [error handling].
|
|
||||||
|
|
||||||
errorColor
|
errorColor
|
||||||
: String. Default is `#cc0000`.\
|
: (`string`) The color of the error messages expressed as an RGB [hexadecimal color]. Default is `#cc0000`.
|
||||||
The color of the error messages.\
|
|
||||||
A color string given in the format "#XXX" or "#XXXXXX"
|
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
@ -107,8 +107,6 @@ There are 3 ways to handle errors from KaTeX:
|
|||||||
{{- /* chomp trailing newline */ -}}
|
{{- /* chomp trailing newline */ -}}
|
||||||
{{< /code >}}
|
{{< /code >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[options]: #options
|
|
||||||
[error handling]: #error-handling
|
[error handling]: #error-handling
|
||||||
[KaTeX options]: https://katex.org/docs/options.html
|
[KaTeX options]: https://katex.org/docs/options.html
|
||||||
|
[hexadecimal color]: https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color
|
||||||
|
Loading…
x
Reference in New Issue
Block a user