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

The ignore class does not seem to be ignored #3312

Closed
cfjrb opened this issue Nov 29, 2024 · 3 comments
Closed

The ignore class does not seem to be ignored #3312

cfjrb opened this issue Nov 29, 2024 · 3 comments
Labels
Expected Behavior This is how MathJax works v3

Comments

@cfjrb
Copy link

cfjrb commented Nov 29, 2024

Here is the code for index5.html

<!DOCTYPE html>
<html>
<head>
  <title>MathJax Test</title>
<script src="mathjax-config.js" defer></script>
<script type="text/javascript" id="MathJax-script" defer
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js">
</script>
</head>
<body>
  <p class="no-mathjax">This should not render: \(E=mc^2\)</p>
<p >This should render: \(E=mc^2\)</p>
</body>
</html>

Here is the code for mathjax-config.js

window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']]
  },
  svg: {
    fontCache: 'global'
  },
  tex2jax: {
    ignoreClass: "no-mathjax"
  }
};

Here is the output

image

@dpvc
Copy link
Member

dpvc commented Nov 29, 2024

It looks like this has come from a v2 configuration. Version 3 does not have a tex2jax component, and the ignroeClass option is now in the document options section as ignoreHtmlClass. See the documentation for more details. So your configuration should be

window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']]
  },
  svg: {
    fontCache: 'global'
  },
  options: {
    ignoreHtmlClass: "no-mathjax"
  }
};

@dpvc dpvc transferred this issue from mathjax/MathJax-docs Nov 29, 2024
@dpvc dpvc added Expected Behavior This is how MathJax works v3 labels Nov 29, 2024
@cfjrb
Copy link
Author

cfjrb commented Nov 29, 2024

Thank you. I didn't realize that I was looking at the wrong documentation. OOps!!

@cfjrb cfjrb closed this as completed Nov 29, 2024
@dpvc
Copy link
Member

dpvc commented Nov 29, 2024

No problem. Glad it was an easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expected Behavior This is how MathJax works v3
Projects
None yet
Development

No branches or pull requests

2 participants