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 doesn't render on first load for some katas #1435

Closed
billti opened this issue Apr 26, 2024 · 6 comments
Closed

LaTeX doesn't render on first load for some katas #1435

billti opened this issue Apr 26, 2024 · 6 comments
Labels
bug Something isn't working needs triage

Comments

@billti
Copy link
Member

billti commented Apr 26, 2024

I spent hours debugging this thinking it was changes I made before realizing this is now broken on the site too :-/ , but if you go to the playground https://microsoft.github.io/qsharp/ and immediately go to the 'Single-qubit gates' or 'Multi-qubit gates' then you'll see the LaTeX fails to render on first load.

I tracked it down to the use of \color{red], which was introduced extensively today in #1424, and a little further back in #1369, both by @WWhitedogi .

On subsequent renders it loads fine, probably as that is part of an extension that loads on first use (still seems to be a MathJax bug). Easiest fix is just to remove the \color{red} usage. Is it required?

CC @tcNickolas

@billti billti added bug Something isn't working needs triage labels Apr 26, 2024
@billti
Copy link
Member Author

billti commented Apr 26, 2024

Additional info at https://docs.mathjax.org/en/latest/input/tex/extensions/colorv2.html#colorv2. Looks like the usage introduced is "non-standard" and would need to be explicitly enabled. We could do that, or switch to standard usage, or my preference to not use \color if not absolutely necessary.

@billti
Copy link
Member Author

billti commented Apr 26, 2024

I accidentally just push a fix for this directly to main. Ooops. Feel free to go check out 587b8b0 if interested.

I'd still suggest not using \colors though. (Or else make sure QCOM also pre-loads the package to avoid issues).

@billti
Copy link
Member Author

billti commented Apr 26, 2024

Note that the PR at #1438 updates some of the files containing this new LaTeX. Might want to review that before any major changes to avoid painful merge conflicts.

@billti
Copy link
Member Author

billti commented Apr 26, 2024

FYI: Started a wiki page at https://github.com/microsoft/qsharp/wiki/Markdown-and-LaTeX-guidelines . With your input @tcNickolas and @WWhitedogi (and other major content contributors), I'd like to flesh out some guidelines here that we try to adhere to. Sound reasonable?

@tcNickolas
Copy link
Member

I accidentally just push a fix for this directly to main. Ooops.

Should we take a look at the branch protections for our main? I think there is a setting to limit pushes from administrators, something along the lines of "Do not allow bypassing the above settings"

On the topic, I think we can replace \color with \textbf - I need some way to highlight specific parts of the formulas, and colors are the easiest ones, but bold should also work.

@billti
Copy link
Member Author

billti commented May 3, 2024

Resolved with the push to main referenced above.

@billti billti closed this as completed May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants