MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

[SVG][mathtools] multlined in aligned rendering poorly

Open pkra opened this issue 3 years ago • 3 comments

Here's a rather involved real world use case:

\begin{equation}
 \begin{aligned}
[t] T_{{\mathbf{u}}, x} {\mathcal{V}}&= \begin{multlined}[t][.7\linewidth] \left\{ (\dot{{\mathbf{u}}}, \dot{x}) \in T_{\mathbf{u}}{\mathcal{U}}\times T_x {\mathbb{P}}^n\mathbin{|}\right. \\
 \left. \forall i, f_i \left( (\mathbf{1}_{\mathcal{U}}+ t \dot{u}_i + o(t))^{-1} (x+t \dot{x} + o(t)) \right) = o(t) \text{ as } t\to 0 \right\} \end{multlined}\\
 &= \left\{ (\dot{{\mathbf{u}}}, \dot{x}) \in T_{\mathbf{u}}{\mathcal{U}}\times T_x {\mathbb{P}}^n\mathbin{|}\forall i, f_i\left(x + t( \dot{x} - \dot{u}_i x) \right) = o(t) \text{  as } t\to 0 \right\}\\
 &= \left\{ (\dot{{\mathbf{u}}}, \dot{x}) \in T_{\mathbf{u}}{\mathcal{U}}\times T_x {\mathbb{P}}^n\mathbin{|}\forall i, \mathrm{d}_x f_i (\dot{x}) = \mathrm{d}_x f_i( \dot{u}_i x) \right\}. \end{aligned} \tag{17}\cssId{texmlid43}{}
\end{equation}

On https://www.mathjax.org/#demo, the SVG output renders poorly:

image

For comparison, the CSS output is:

image

pkra avatar Oct 17 '22 10:10 pkra

It's particularly bad since the SVG paints outside its box.

(This was not a huge issue on our end, we simply changed the source to something cleaner.)

pkra avatar Oct 17 '22 10:10 pkra

The problem is the .7\linewidth as the width for the multlined environment. MathJax doesn't have \linewidth, and it doesn't do computations in the width in any case, so that ends up being considered as a width of 0, I think. Version 4 has a warning about this, but version 3 doesn't. It does seem that the output is not consistent between the two renderers when the width is too short for the content.

dpvc avatar Oct 17 '22 10:10 dpvc

Thanks for clarifying!

pkra avatar Oct 17 '22 10:10 pkra