-
Notifications
You must be signed in to change notification settings - Fork 134
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
Adapt ForceEquations
for Sphinx 8.2
#822
base: master
Are you sure you want to change the base?
Conversation
Thanks for this PR! This works in most cases, but sadly not in all. The problem is that there are multiple situations where math/LaTeX stuff can appear:
All three are handled separately and it's quite fiddly. I tested it in #824 and this shows the problem with Markdown block math: https://nbsphinx--824.org.readthedocs.build/en/824/a-markdown-file-block.html I don't know yet why that happens (I've actually expected problems with Markdown inline math, but that seems to work fine), and I have limited time to investigate ... |
The new behaviour includes MathJax if a A |
Alternatively, you could call A |
It turns out that the block math (that doesn't work correctly) ends up in custom nbsphinx/src/nbsphinx/__init__.py Lines 648 to 650 in 215bf0d
How can I make those be recognized as math?
OK, thanks, I think I can use this as work-around (slightly worse than the current work-around) in case we don't find a better solution. |
env = self.document.settings.env | ||
if env.config.nbsphinx_assume_equations: | ||
env.get_domain('math').data['has_equations'][env.docname] = True | ||
if sphinx.version_info[:2] >= (8, 2): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity: Why are you putting [:2]
there?
Shouldn't it behave identically when you drop it?
cc @mgeier xref sphinx-doc/sphinx#13346
A