MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Support \intertext and \shortintertext in align*

Open ysulyma opened this issue 11 years ago • 8 comments

Support \intertext and \shortintertext in align* environment.

ysulyma avatar Feb 11 '14 19:02 ysulyma

MathJax's internal format is MathML, and there is no natural way to represent \intertext or \shortintertext in MathML. So it would be difficult to support these macros. Indeed, I can not think of a reasonable way to do it.

dpvc avatar Feb 11 '14 23:02 dpvc

Could this not be done by an <mtd columnspan="n"> or something similar?

ysulyma avatar Feb 12 '14 16:02 ysulyma

No, not in general, as the positioning would not be correct. For example, because the default for displayed math is to have it be centered, the inter-text would not start at the left margin, as it should. Also, the width of the inter-text would interfere with the width of the table, especially if it was longer text, like several lines. And if it were several lines, it would not wrap properly, or rewrap as text should if the window width is changed.

Also, MathJax HTML-CSS and SVG don't currently support columnspan, so even without the problems above, MathJax would not be able to use it.

dpvc avatar Feb 12 '14 16:02 dpvc

Remember, MathJax doesn't really handle text-mode material, only math-mode, so trying to get it to handle a sentence or paragraph in the middle of a math table is not going to be very effective.

dpvc avatar Feb 12 '14 16:02 dpvc

Couldn't mathjax simply parse:

\begin{align*}
\intertext{If}
   A &= \sigma_1+\sigma_2\\
   B &= \rho_1+\rho_2\\
\intertext{then}
  C(x) &= e^{Ax^2+\pi}+B
\end{align*}

as something like this:

If
\begin{align*}
   A &= \sigma_1+\sigma_2\\
   B &= \rho_1+\rho_2\\
\end{align*}
then
\begin{align*}
  C(x) &= e^{Ax^2+\pi}+B
\end{align*}

It is not perfect, but I think better than nothing. And it works allmost as expected on markdown+mathjax websites.

Would be even better if mathjax can handle it so that all the &= are aligned across the intertexts.

kasperpeulen avatar Oct 07 '14 11:10 kasperpeulen

@kasperpeulen the trouble is: what's insinde the intertext and how do you deal with it?

  • is it text-mode TeX?
  • is it HTML?
  • is it only "plain text"
  • should the output wrap it in p's or span's or div's?
  • in how far will the output be "valid" HTML? (for some value of "valid")
  • what do you do in SVG output?

But, yes, one could probably create an extension that turns \intertext into \end{xxx} TEXT \begin{xxx}. I'm just not sure that solves the problem.

pkra avatar Oct 07 '14 19:10 pkra

It's been 11 years and this still isn't implemented.

Gerald-Meyers avatar Nov 09 '25 01:11 Gerald-Meyers

t's been 11 years and this still isn't implemented.

That's correct. There are no plans to implement this currently,.

dpvc avatar Nov 09 '25 11:11 dpvc