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

Add math support via mathjax #13

Closed
wants to merge 2 commits into from

Conversation

alanocallaghan
Copy link
Contributor

I'd like to add math support for a couple of lessons I'm going to be working on in some fashion or other. This is a simple-ish way to do it.

atm I'm stopping mathjax from being in every page by having a math: true|false field in _config.yml. If this is a decent solution I'll make a PR for the template to add a field. If the field isn't defined it defaults to old behaviour of not including it. Otherwise it could be a frontmatter for each page, rather than each site, or possibly both (ie, only if site.math && page.math)

Could switch this to doing something similar with katex if that's preferred, I'm just used to mathjax. I believe there's some way to get serverside rendering with katex, but this is probably tricky with github-pages

Example: https://alanocallaghan.github.io/latex-novice-typesetting/01-introduction/index.html
https://github.com/Alanocallaghan/latex-novice-typesetting/blob/gh-pages/_episodes/01-introduction.md

ezherman added a commit to carpentries-incubator/simple-linear-regression-public-health that referenced this pull request Apr 7, 2021
ezherman added a commit to carpentries-incubator/simple-linear-regression-public-health that referenced this pull request Apr 7, 2021
@fmichonneau
Copy link
Contributor

Thanks for this PR!

Could you please open it against https://github.com/carpentries/styles? (once it's merged there, we can bring it to the remote theme). We have an old issue about this here: carpentries/styles#154

Several people have mentioned that KaTeX was "better" than MathJax, so maybe go for that?

Given that we want to be able to support offline rendering of the lessons, we'd need to include the katex files in the repo.

I think that a per-page inclusion would make sense (with page.math).

@alanocallaghan
Copy link
Contributor Author

What is the styles repository, and what do you mean by remote theme

@fmichonneau
Copy link
Contributor

fmichonneau commented Apr 14, 2021 via email

@alanocallaghan
Copy link
Contributor Author

I am somehow failing to understand why you would maintain two parallel versions but that's outside the remit of this PR

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