Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KaTeX JS not included by default #6

Open
darsnack opened this issue Dec 25, 2020 · 6 comments
Open

KaTeX JS not included by default #6

darsnack opened this issue Dec 25, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@darsnack
Copy link
Contributor

None of the math blocks are rendered using KaTeX in my deployed page (see below). Is the JS loaded by default, or is there something required on my part? I see the resulting HTML is wrapped in <div class="math">.

Screen Shot 2020-12-24 at 6 46 51 PM

@MichaelHatherly
Copy link
Owner

There's no included math rendering lib in the HTML output at the moment. I'm happy to have one included by default, KaTeX is probably the best default to use.

@MichaelHatherly MichaelHatherly added the enhancement New feature or request label Dec 25, 2020
@darsnack
Copy link
Contributor Author

It seems like KaTeX expects the class "katex", but the markdown generates the classes "math" and "display-math".

@darsnack
Copy link
Contributor Author

Never mind, it seems as though that is irrelevant for rendering.

@MichaelHatherly
Copy link
Owner

It seems like KaTeX expects the class "katex", but the markdown generates the classes "math" and "display-math".

Yup, the markdown->html rendering is meant to be reasonably agnostic with respect to the libraries you end up using in the final document, so you have to point katex to the specific nodes with classes math and display-math.

Currently there's some implementation code in https://github.com/MichaelHatherly/PublishThemes/blob/master/themes/default/html_doc.mustache which is used for the (currently) undocumented self-contained html_doc output format. I just need to port over that katex stuff to the main html theme as well.

@darsnack
Copy link
Contributor Author

Yeah using the event listener is the approach I ended up using too.

@kapple19
Copy link

kapple19 commented Oct 11, 2023

Hi all, can someone ELI5 how to activate the KaTeX rendering for HTML output using Publish@0.10.0? Passing html_doc to serve throws an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants