Skip to content

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Sep 15, 2025

Purely a PoC, only tested/demonstrated at the jury clarification pages. I assume it works for the team pages but that's only because of the shared code.

I didn't test for MathML yet, and the other options for the MathJax object. We would need a couple of example clarifications to test with and do some visual inspection on the result.

I think the fonts can also be version controlled, but GitHub doesn't have a release in the MathJax organization which seems to ship those.

This is to render Math statements like LaTeX in clarifications
The fonts are missing from the release so we need to manually keep those in sync, we can't use the normal asset function as we get the version string added which is interpret as an option by MathJax and gives unharmful console log entries.
@meisterT
Copy link
Member

I assume it works for the team pages but that's only because of the shared code.

Weirdly enough not for the modal:

image

Also it takes a few seconds to render correctly.

I think the fonts can also be version controlled, but GitHub doesn't have a release in the MathJax organization which seems to ship those.

Yeah would be nice if would also come from packagist.

@meisterT
Copy link
Member

I tested a lot of things with the help of Gemini, the cross product is the only thing that didn't work:

    $$\vec{a} \times \vec{b} = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_x & a_y & a_z \\ b_x & b_y & b_z \end{vmatrix}$$
image

Should look like this:
image

I also tested in a mathjax playground that this works in general. Not sure why it doesn't work here and whether it is important to fix.

@meisterT
Copy link
Member

Or rather like this:

image

@vmcj
Copy link
Member Author

vmcj commented Sep 15, 2025

I assume it works for the team pages but that's only because of the shared code.

Weirdly enough not for the modal:
image

I think I need to apply the MathJax code to the new element from the modal, I assume those elements don't exist in the DOM when MathJax is loaded. Similar to what we need for clarifications previews.

Also it takes a few seconds to render correctly.

I think that's because of the rendering being done on clientside. It might be possible to do this serverside if we use nodejs but I don't think MathJax has a PHP equivalent.

Yeah would be nice if would also come from packagist.

I'll keep on looking, but might be for a future PR if this works before the weekend.

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