KaTeX Configuration
-
Create or extend
_includes/head_custom.htmlwith:{% assign math = page.math | default: layout.math | default: site.math %} {% case math %} {% when "katex" %} {% include katex.html %} {% endcase %} -
Copy the following files to your website source repo:
-
To make KaTeX available on all your web pages, add to
_config.yml:math: katexTo restrict KaTeX to pages that use it, add to the front matter either:
math: katexor:
layout: katexYou can add a preamble of KaTeX definitions of new commands and environments to
_layouts/katex.html. It extends thedefaultlayout.
KaTeX options
The following options are already set in _includes/katex.html and
in assets/js/mathtex-script-type.js:
globalGroup: true,
trust: true,
strict: false,
throwOnError: false,
You can customise KaTeX by adding further options.