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

docs: update integration of KaTeX instructions #6823

Closed
wants to merge 1 commit into from
Closed

docs: update integration of KaTeX instructions #6823

wants to merge 1 commit into from

Conversation

sinaatalay
Copy link

@sinaatalay sinaatalay commented Feb 24, 2024

I am using KaTeX in my mkdocs-material documentation. I had a problem: KaTeX never loads the first time; you need to refresh the page to make it load.

I found the solution, rather than using this (which is given by the official documentation of material-mkdocs):

document$.subscribe(({ body }) => { 
  renderMathInElement(body, {
    delimiters: [
      { left: "$$",  right: "$$",  display: true },
      { left: "$",   right: "$",   display: false },
      { left: "\\(", right: "\\)", display: false },
      { left: "\\[", right: "\\]", display: true }
    ],
  })
})

I used this:

document$.subscribe(() => { 
  renderMathInElement(document.body, {
    delimiters: [
      { left: "$$",  right: "$$",  display: true },
      { left: "$",   right: "$",   display: false },
      { left: "\\(", right: "\\)", display: false },
      { left: "\\[", right: "\\]", display: true }
    ],
  })
})

It solved the problem. I don't know JavaScipt, so I don't know how it solved it, but it worked.

This pull request updates the documentation's instructions on KaTeX integration and fixes this issue for possible KaTeX users.

@squidfunk
Copy link
Owner

Thanks for the PR! I'm not a user of KaTeX, so I need to rely on the community to tell whether this change makes sense. @adhadse did the original KaTeX integration – can you confirm that this is a better solution?

@squidfunk
Copy link
Owner

It turned out to be a regression of 9.5.5. Fixed in de46c41. Thus, this PR can be closed.

@squidfunk squidfunk closed this Feb 29, 2024
Burhan-Q added a commit to Burhan-Q/ultralytics that referenced this pull request Feb 29, 2024
@squidfunk
Copy link
Owner

Released as part of 9.5.12.

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

Successfully merging this pull request may close these issues.

2 participants