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 in article titles isn't properly rendered on home page nor article page #1382

Open
cthoyt opened this issue Oct 29, 2024 · 1 comment

Comments

@cthoyt
Copy link
Contributor

cthoyt commented Oct 29, 2024

I was just looking at recent articles on the homepage (https://joss.theoj.org/) and saw that PyXAB - A Python Library for $\mathcal{X}$-Armed Bandit and Online Blackbox Optimization Algorithms did not get rendered correctly. There's some LaTeX / TeX / MathTeX in between the dollar sign $ delimiters that should get rendered beautifully on the homepage.

Screenshot 2024-10-29 at 13 22 23

The same thing happens when navigating to its page https://joss.theoj.org/papers/10.21105/joss.06507

Screenshot 2024-10-29 at 13 24 11

A silver lining is that it seems to be rendered beautifully in the article title in the PDF!

I'm on Firefox v131 on Mac OS 14. I also checked this was happening on Safari v17.6 on the same machine

@sneakers-the-rat
Copy link
Contributor

sneakers-the-rat commented Oct 30, 2024

oh joy do we have to do a mathjax thing...

edit: oh wait looks like there's a serverside latex math renderer, that sounds better than bundling 1MB of js https://katex.org/docs/api

edit2: ok i checked this out - all the serverside rendering for latex math in ruby just uses katex or some other older js rendering engine. the gems are at least 2 years unmaintained, but they are literally just wrappers around the execjs gem and katex, so we could borrow that code (with attribution) and vendor our own katex so we can update it periodically? then we add a note in the docs saying any latex in titles needs to have the $'s touching the first and last characters with whitespace on either side like $x = y$ so we can write regex that matches it but not if someone is using a dollar sign as a currency symbol (which always has whitespace before it).

OR

we can repurpose some of mathstodon's code that we borrowed at neuromatchstodon to replace common latex commands with unicode symbols

but at that point we might as well say "no latex in titles" which is no fun

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