You can do this by writing your own tagged template literal function, or import the one shown here:
(Though a downside of the texmd approach is you can’t take advantage of single backslashes for LaTeX, since they are embedded within the Markdown template literal.)
Oh, somehow I missed that one entirely (and it looks like @kelleyvanevert might have missed it as well before making her notebook with a workaround?). Maybe add another example down where discussing equations as well?
I recommend also adding the keyword “LaTeX” somewhere in there for people searching in the page, as most people have no idea what KaTeX is.
For what it’s worth, for me personally, that method is plenty ergonomic, and I don’t imagine typically needing anything more streamlined.
When we first launched, the md, html and svg literals didn’t allow embedding of arbitrary DOM in expressions. This feature was added later, as described here:
One more note. Not sure where to put this, but it doesn’t seem worth making a new issue.
I started adding <style> .katex { font-size: 1.08em; } </style> to my title cells. This makes the size of inline LaTeX match the surrounding content much more closely. The current default size is like 1.25em or something very dramatically large.
See my fork for a version that fixes one major problem that I ran into, namely that you couldn’t use a ${} substitution inside texmd`` if that substitution returned a DOM node instead of plain text