KaTeX Instructions Incomplete/Broken #8010
-
ContextNo response Bug descriptionI originally opened a discussion on this error here: mkdocs/mkdocs#3928 =Having followed the guide here, I still only get equations of this type:
to render as:
Related links
ReproductionI have created a MWE in this public repo: mkdocs_debugging Steps to reproducerun BrowserChrome Before submitting
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for reporting! Although it was mentioned that this is an issue with Material for MkDocs, it isn't. We have instructions for KaTeX on our documentation, and they work, as has been reported by other users. However, KaTeX itself does not need an integration with Material for MkDocs, we only mention it in our documentation for the sake of completeness. Please understand that we, as maintainers, can't offer support for troubleshooting, but our community is likely able to help I'm converting this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Hello @michaelweinold, document$.subscribe(({ body }) => {
renderMathInElement(body, {
// ... the mkdocs-material/src/templates/assets/javascripts/bundle.ts Lines 308 to 318 in 396c493 If you run this JavaScript with any other theme you get an error in the Browser Web Tools: For general usage docs go here: Instead of the EDIT: document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, {
// customised options
// • auto-render specific keys, e.g.:
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false},
{left: '\\(', right: '\\)', display: false},
{left: '\\[', right: '\\]', display: true}
],
// • rendering keys, e.g.:
throwOnError : false
});
}); |
Beta Was this translation helpful? Give feedback.
Hello @michaelweinold,
the instructions for setting up KaTeX in the docs are given for this theme specifically:
the
document$
observable object is exposed only in thematerial
theme:mkdocs-material/src/templates/assets/javascripts/bundle.ts
Lines 308 to 318 in 396c493