ConfigurationΒΆ
The behavior of sphinxcontrib.katex
can be changed by configuration
entries in conf.py
of your documentation project. In the following
all configuration entries are listed and their default values are shown.
katex_css_path = \
'https://cdn.jsdelivr.net/npm/katex@0.10/dist/katex.min.css'
katex_js_path = \
'https://cdn.jsdelivr.net/npm/katex@0.10/dist/katex.min.js'
katex_autorender_path = \
'https://cdn.jsdelivr.net/npm/katex@0.10/contrib/auto-render.min.js'
katex_inline = [r'\(', r'\)']
katex_display = [r'\[', r'\]']
katex_options = ''
The specific delimiters written to HTML when math mode is encountered are
controlled by the two lists katex_inline
and katex_display
.
The string variable katex_options
allows you to change all available
official KaTeX rendering options, e.g.
katex_options = r'''{
displayMode: true,
macros: {
"\\RR": "\\mathbb{R}"
}
}'''
You can also add KaTeX auto-rendering options to katex_options
, but be
aware that the delimiters
entry should contain the entries of
katex_inline
and katex_display
.