Skip to content

Add Mathjax math rendering to pkgdown site #180

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

Merged
merged 2 commits into from
Jul 16, 2025

Conversation

ryanzomorrodi
Copy link
Contributor

@ryanzomorrodi ryanzomorrodi commented Jul 10, 2025

Currently, the pkgdown site does not render equations well because the default math rendering engine, mathml, does a pretty poor job of rendering.

See: https://pkgdown.r-lib.org/articles/customise.html#math-rendering

Example: https://r-spatial.github.io/spdep/reference/moran.html
image

With mathjax:
image

@ryanzomorrodi ryanzomorrodi changed the title H Add Mathjax math rendering to pkgdown site Jul 10, 2025
@rsbivand
Copy link
Member

@ryanzomorrodi Could you please motivate this PR with particular reference to how the change impacts platforms without Mathjax. Thanks for exploring this!

@ryanzomorrodi
Copy link
Contributor Author

Hi @rsbivand ! I'm not entirely sure what you mean. Mathjax is a javascript library which is bundled with the pkgdown site when its built with math-rendering set to mathjax. You can find it inside: the docs\deps\MathJax-3.2.2 folder. If the user has turned off javascript, the website returns back to its current state.

When you disable javascript:
image

@rsbivand rsbivand merged commit e3e6199 into r-spatial:main Jul 16, 2025
6 checks passed
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.

2 participants