Render LaTeX math parts in your markdown files when viewing them on GitHub/GitLab.
The extension crawls the site for any known Markdown HTML nodes and then tries to find all math blocks in them $...$
/$$...$$
which if found are being rendered by KaTeX.
Package extension by running:
./package_extension.sh
There are multiple ways to load the extension:
about:addons
and click the icon at the top right with the option Debug Add-ons
Load Temporary Add-on
and select the created ./dist/extension_firefox.zip
archiveThere are multiple ways to load the extension:
chrome://extensions/
and click the button at the top left that says Load unpacked
./dist/extension_chromium
directoryRun the download_katex_files.sh
script.
There is a problem with loading fonts because the CSP (content security policy) is blocking loading custom fonts (remote and local).
TODO: Test if by installing the fonts you can use them
Firefox supports native MathML rendering.
You can go to the add-on settings and enable Force MathML (without HTML) output
.
On Linux it could be that you then also need to install a modern math font because otherwise the MathML renderings have very big and not beautiful borders/spacing around everything.
Arch Linux/pacman
:
sudo pacman -S otf-latinmodern-math
Chromium/Chrome does not yet support native MathML rendering.
TODO: Add instructions on how to do it in Chromium