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

Updating to 207 broke math on my site #705

Closed
ajakaja opened this issue Aug 8, 2020 · 3 comments
Closed

Updating to 207 broke math on my site #705

ajakaja opened this issue Aug 8, 2020 · 3 comments

Comments

@ajakaja
Copy link

ajakaja commented Aug 8, 2020

Before submitting an issue, please be sure to

This issue affects

  • [*] The site generated by GitHub Pages
  • [] Building sites locally

The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting seeking support in other forums.

What did you do (e.g., steps to reproduce)

Ran bundle update.
Math output is now rendered in \[ \] tags. Before updating, it was rendered in something like <script type='math/tex; mode=display'>. I'm probably using some old logic to parse these tags with KaTeX and it began failing today.

Not saying this is wrong -- those old tags look really janky and unnecessary. But it was a surprise, as there was nothing about changing math support mentioned in #704 (although there is a unit test asserting the new behavior). A FAQ entry on how to update this somewhere might be helpful. I am going to try to switch to using https://katex.org/docs/autorender.html.

What did you expect to happen?

What happened instead?

Additional information

  • Link to the live site (if applicable):
  • Link to the source repo (if applicable):
@parkr
Copy link
Contributor

parkr commented Aug 8, 2020

@ajakaja We're very sorry about this! It was my understanding that MathJax JavaScript supported both.

Where do you think an FAQ entry would go?

I added a comment here: #704 (comment)

@ajakaja
Copy link
Author

ajakaja commented Aug 8, 2020

I think it does, but I'm using KateX which works differently and I installed it a long time ago so was running it by hand -- taking the output and just invoking katex.renderToString directly on it. It was working but it wasn't necessarily maintainable.

Ideally there would be mentioned somewhere around https://docs.github.com/en/github/working-with-github-pages/about-github-pages-and-jekyll -- that's the documentation I went to for debugging.

I'm having trouble finding the documentation for the kramdown math_engine_opts configurations -- it seems like it should be possible to configure kramdown to emit whatever I want. Haven't figured it out yet.

@ajakaja
Copy link
Author

ajakaja commented Aug 8, 2020

Okay, Katex's autorender plugin worked fine: ajakaja/ajakaja.github.io@37663a0

I downloaded the script from https://katex.org/docs/autorender.html into my repo and loaded it on my page, then replaced my hand-rolled script with something like this:

document.addEventListener("DOMContentLoaded", function() {
  renderMathInElement(document.body, { ... options ... });
});

and got back where I was with little difficulty.

@ajakaja ajakaja closed this as completed Aug 8, 2020
dato added a commit to dato/algo2-web that referenced this issue Aug 14, 2020
Github Pages v207 rompe nuestro rendering de math con KaTeX
(github/pages-gem#705), porque la nueva versión de Kramdown
cambia la sintaxis MathJax que emite (gettalong/kramdown#626).

El fix es usar directamente al auto-render.js de KaTeX, en lugar
del script anterior que usábamos (mathtex-script-type.js).

De paso, actualizar a KaTeX 0.12.
dato added a commit to algoritmos-rw/algoritmos that referenced this issue Aug 14, 2020
Github Pages v207 rompe nuestro rendering de math con KaTeX
(github/pages-gem#705), porque la nueva versión de Kramdown
cambia la sintaxis MathJax que emite (gettalong/kramdown#626).

El fix es usar directamente al auto-render.js de KaTeX, en lugar
del script anterior que usábamos (mathtex-script-type.js).

De paso, actualizar a KaTeX 0.12.
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