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

Maths rendering #4

Open
phockett opened this issue Nov 18, 2022 · 7 comments
Open

Maths rendering #4

phockett opened this issue Nov 18, 2022 · 7 comments

Comments

@phockett
Copy link
Owner

phockett commented Nov 18, 2022

Some inconsistencies in default builds...

  • \bm not rendering in Firefox, Github builds? (e.g. https://phockett.github.io/Quantum-Metrology-with-Photoelectrons-Vol3/part1/theory_101122.html)
  • \boldsymbol not rendering in IceDragon, local builds (either default MathJax, or v3).
  • Both seem OK in Firefox, with v3, but \boldsymbol not working in default case. UPDATE: NOW NOT WORKING in either case after more test builds... weird...
  • Both seem OK in PDF output (pdflatex) in either case.
  • Run with v3 for now and hope for the best... (note all display OK in JupyterLab, except \bm).

For forcing version in _config.py, see https://jupyterbook.org/en/stable/content/math.html#math-and-equations

TODO: clean test page, currently testing in main Theory notebook, might be other issues...?

UPDATE: may actually be issue with source and/or Pandoc conversion, currently failing to case with $\boldsymbol{\mathbf{E}}$, but $\mathbf{E}$ or $\bm{E}$ may be equivalent...?

UPDATE2: things seem OK in maths test page for \boldsymbol (even nested), but not for \bm. May have issue related to jupyter-book/jupyter-book#1528 with Plotly? (See also https://jupyterbook.org/en/stable/interactive/interactive.html#plotly) Maybe also issue with extensions or macros, https://docs.mathjax.org/en/latest/input/tex/extensions/boldsymbol.html?

Ignore for now and use standard methods - but should fix!

UPDATE3 21/11/22:

@phockett
Copy link
Owner Author

See also adding tex macros to Sphinx build at https://jupyterbook.org/en/stable/advanced/sphinx.html#defining-tex-macros

@phockett
Copy link
Owner Author

For notes on \label support: executablebooks/MyST-Parser#202

@phockett
Copy link
Owner Author

phockett commented Jan 30, 2023

Some specific issues (see QM3/doc-source/tests/formatting_syntax_tests_081122.ipynb for more details):

  • $\bar{\varUpsilon}$ fails but $\bar{\varUpsilon_{}}$ is OK
  • $\boldsymbol{\rho}^{\zeta\zeta'}$ fails in HTML builds? UPDATE: may be intermittent, or browser issue?

@phockett
Copy link
Owner Author

\boldsymbol rendering broken in current builds for Photoionization Theory page (Firefox), possibly since adding computational example with symmetry?

Rendering OK in Ice Dragon however. Sigh.

@jangenoe
Copy link

jangenoe commented Aug 1, 2023

I noticed the Maths rendering issue in the TOC, which also occurs in my text-books [currently not yet released].
I used your public example to report this rendering bug

@phockett
Copy link
Owner Author

phockett commented Oct 26, 2023

I (eventually) managed to fix the TOC bug, since I realised it only affected pages which had no maths on - in this case it seems like the Mathjax script wasn't automatically injected. (This was for builds from the .md files, I didn't test builds from .ipynb source.)

There's likely an elegant way to force this via Sphinx config, but my quick and dirty fix was just to add a cell directly to my Markdown documents duplicating the script tags in the working HTML pages - my patch is in https://github.com/phockett/Quantum-Metrology-with-Photoelectrons-Vol3/blob/main/scripts/mathjax_patch.txt (and my in my main build script I just run cat mathjax_patch.txt >> page.md for each page I need to add the script to).

Hope your book is going well @jangenoe :)

@jangenoe
Copy link

I will also use your patch... Thanks

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

2 participants