Hello!
For context, I'm working on a computer algebra system, and I'm currently using MathJax to display equations in the browser. Since I need to display arbitrary expressions, I'm finding and using a composable subset of LaTeX. (Note that most amsmath environments are top-level-only and so cannot be nested to display arbitrary expressions).
A promising environment is just the "array" environment, since I can generate whatever kind of array I need for a given expression, and importantly this environment is composable - arrays can be inside arrays. However, I am running into at least two issues with this.
1. There may be a display issue in mathjax version 3.
Steps to reproduce: Using the mathjax@3 release version, typeset the equation:
$$\left \lbrace \begin{array}[t]{ll} & 3 \\+ & 4\end{array}\right \rbrace $$
To be very specific, here is some code in my application is the following that prints the above latex, and then typesets it:
console.log(str);
el.innerHTML = str;
MathJax.typeset([el]);
Expected behavior: See a brace-enclosed two-row array.
Actual behavior: The braces enclose additional empty space above the array:
Note: the [t] setting in the array latex is important to give each nested sub-expression the correct vertical alignment; otherwise they will be vertically centered, which is not the layout I would like.
I would like to know if this is a known issue, or if there are any workarounds.
2: Since I'm attempting to use the "array" environment for all kinds of equations and expressions (as amsmath environments such as "split" cannot be nested), I need to adjust the inner row and column spacing. I'm just wondering if the discussion here is still the best option, or if there's currently a simpler way
https://groups.google.com/g/mathjax-users/c/daApZrHGZik?pli=1
Thank you very much!
I would like to get MathJax to work, but if I cannot, my backup plan is to run Latex on the server, and send the rendered images to the clients.