Skip to content

Update mathjax_config to mathjax3_config - #815

Merged
romanlutz merged 2 commits into
fairlearn:mainfrom
iofall:Issue-810-mathjax-bug
May 21, 2021
Merged

romanlutz merged 2 commits into
fairlearn:mainfrom
iofall:Issue-810-mathjax-bug

Conversation

@iofall

@iofall iofall commented May 20, 2021

Copy link
Copy Markdown
Contributor

Fixes #810

Upon investigation, there is a newer, completely rewritten version of MathJax which is being used by Sphinx MathJax as well, the MathJax version 3. Thus it gave us src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" the latest version of the library in our HTML.

To accommodate this:

  • Sphinx requires us to use mathjax3_config variable instead of matjax_config to set the configuration.
  • Also there are some small changes in the config in terms of the syntax which were made using the MathJax Configuration Converter to write the config in the new format.

Results

Before

image

After

image

@romanlutz romanlutz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Great find! Thanks a ton @iofall !

@hildeweerts

Copy link
Copy Markdown
Contributor

@romanlutz There's this Reason: UndefinedError("'meta' is undefined") error again, but now in CircleCI... did we figure out where that came from? @bthng I think you came across this error before as well, right?

Theme error:
An error happened in rendering the page py-modindex.
Reason: UndefinedError("'meta' is undefined")
Traceback (most recent call last):
  File "/usr/local/bin/sphinx-multiversion", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/sphinx_multiversion/main.py", line 352, in main
    subprocess.check_call(cmd, cwd=current_cwd, env=env)
  File "/usr/local/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('/usr/local/bin/python', '-R', '-m', 'sphinx', '-D', 'smv_metadata_path=/tmp/tmppn4b0nn6/versions.json', '-D', 'smv_current_version=main', '-c', '/home/circleci/tmp-fairlearn/docs', '/tmp/tmppn4b0nn6/a3d2516f2646f1bdfdd6ad5982c7e0f083435a68/docs', '/home/circleci/tmp-fairlearn/docs/_build/html/main')' returned non-zero exit status 2.
Traceback (most recent call last):
  File "scripts/build_documentation.py", line 83, in <module>
    main(sys.argv[1:])
  File "scripts/build_documentation.py", line 75, in main
    args.output_path])
  File "/home/circleci/tmp-fairlearn/scripts/_utils.py", line 30, in __exit__
    raise value
  File "scripts/build_documentation.py", line 75, in main
    args.output_path])
  File "/usr/local/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sphinx-multiversion', 'docs', 'docs/_build/html']' returned non-zero exit status 1.

Exited with code exit status 1

@romanlutz

Copy link
Copy Markdown
Member

I reproduced this locally. Seems to be caused by a Jinja2 update (they released a new version). The best fix is to upgrade our theme, though, and fix the associated line I fixed in @bthng's PR. I did that here so this can be considered the doc fix PR, and after that @bthng can pull in the latest main changes. Hopefully the gates pass this time. Are you okay with the changes @hildeweerts ?

@romanlutz
romanlutz merged commit 8e67977 into fairlearn:main May 21, 2021
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.

Math doesn't render properly anymore on webpage

3 participants