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

Formulas Not Displaying Properly in github.io version #67

Closed
alexander-ye opened this issue Sep 25, 2023 · 3 comments
Closed

Formulas Not Displaying Properly in github.io version #67

alexander-ye opened this issue Sep 25, 2023 · 3 comments

Comments

@alexander-ye
Copy link

Formulas in the github.io version of the book are not displaying properly—they are still in their raw LaTeX syntax.

Exmaple: https://allendowney.github.io/ThinkBayes2/chap02.html

@joac
Copy link

joac commented Sep 29, 2023

As a workaround I'm pasting on the page console

window.MathJax = {
  tex: {
    inlineMath: [['$', '$'], ['\\(', '\\)']]
  },
  svg: {
    fontCache: 'global'
  }
};

(function () {
  var script = document.createElement('script');
  script.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js';
  script.async = true;
  document.head.appendChild(script);
})();

To activate matjax Source

I didn't found the sphinx config. @AllenDowney If you can point me in the right direction I can provide a pr to fix it.

@Bearsetc
Copy link

Bearsetc commented Dec 23, 2023

@AllenDowney - The myst extension attrs_inline seems to be causing the conflict with dollarmath. Please try the update to _config.yml shown below. I have not checked if you use the attrs_inline feature in the book, but if you can live without it, hopefully this is a fix. Happy Holidays!

parse:
  # myst_extended_syntax: true  # instead enable individual features below
  myst_enable_extensions:  # https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html
    - amsmath
    # - attrs_inline  # causing the conflict with dollarmath
    - colon_fence
    - deflist
    - dollarmath
    - fieldlist
    - html_admonition
    - html_image
    - linkify
    - replacements
    - smartquotes
    - strikethrough
    - substitution
    - tasklist

@AllenDowney
Copy link
Owner

@Bearsetc That worked. Thank you so much!

AllenDowney added a commit that referenced this issue Dec 28, 2023
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

No branches or pull requests

4 participants