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

LaTeX support via MathJax #52

Merged
merged 4 commits into from
Jun 14, 2020
Merged

LaTeX support via MathJax #52

merged 4 commits into from
Jun 14, 2020

Conversation

seshrs
Copy link
Member

@seshrs seshrs commented Jun 14, 2020

I noticed that EECS 280's Project 5 uses inline images to explain Naive Bayes. However, this doesn't look great in dark mode because the images have a white background.

I found out that it's fairly easy to introduce LaTeX support in Jekyll sites. Kramdown (the MarkDown renderer that Jekyll uses) already supports converting LaTeX expressions to HTML-compatible TeX scripts. However, these TeX scripts need to be rendered on the page. This is where MathJax comes in — simply including it as a script on the page causes these TeX expressions to be rendered to "Common HTML".

Since this is an additional JS dependency that is not needed by most spec pages, I think it's better for pages to opt-in to rendering LaTeX. I've updated USAGE_ADVANCED.md with instructions on how pages can be "opted-in". I also updated the Spec demo at index.md with a couple of LaTeX expressions.

This PR is a "patch" because there are no visual changes to sites using Primer Spec v1.2, especially since the feature is opt-in.

@seshrs seshrs added enhancement New feature or request semver/patch Pull Request proposes "patch" change labels Jun 14, 2020
@seshrs seshrs merged commit 7d3f03a into develop Jun 14, 2020
@seshrs seshrs deleted the feature/latex branch June 14, 2020 15:40
@seshrs seshrs mentioned this pull request Jun 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semver/patch Pull Request proposes "patch" change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant