This extension adds to KaTeX the
\pu functions from the mhchem package.
This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's
<head>. Place it after the line that calls
<script src="https://firstname.lastname@example.org/dist/contrib/mhchem.min.js" integrity="sha384-oa0lfxCGjaU1LdYckhq8LZcP+JTf8cyJXe69O6VE6UrShzWveT6KiCElJrck/stm"></script>
See the mhchem Manual for a full explanation of the input syntax, with working examples. The manual also includes a demonstration box.
Note that old versions of
\cf for chemical formula and
\ce for chemical equations, but
\cf has been deprecated in place of
\ce. This extension supports only
\ce. You can define a macro mapping
\ce if needed.
This extension has been tested on Chrome, Firefox, Opera, and Edge.