2
$\begingroup$

I am composing a question involving piecewise polynomial equations, but the preview formatting isn't coming out how I expect. Is this a bug or am I doing something wrong?

The notation I'm using:

j(t) = s_{max}\,×\,\begin{cases}
0 & : -∞ < t < 0 \\
f_{01}(0) × (t - T_{01}) + f_{01}(1) & : 0 ≤ t < T_{01} \\
f_{02}(0) × (t - T_{02}) + f_{02}(1) & : T_{01} ≤ t < T_{02} \\
f_{03}(0) × (t - T_{03}) + f_{03}(1) & : T_{02} ≤ t < T_{03} \\
f_{04}(0) × (t - T_{04}) + f_{04}(1) & : T_{03} ≤ t < T_{04} \\
f_{05}(0) × (t - T_{05}) + f_{05}(1) & : T_{04} ≤ t < T_{05} \\
f_{06}(0) × (t - T_{06}) + f_{06}(1) & : T_{05} ≤ t < T_{06} \\
f_{07}(0) × (t - T_{07}) + f_{07}(1) & : T_{06} ≤ t < T_{07} \\
f_{08}(0) × (t - T_{08}) + f_{08}(1) & : T_{07} ≤ t < T_{08} \\
f_{09}(0) × (t - T_{09}) + f_{09}(1) & : T_{08} ≤ t < T_{09} \\
f_{10}(0) × (t - T_{10}) + f_{10}(1) & : T_{09} ≤ t < T_{10} \\
f_{11}(0) × (t - T_{11}) + f_{11}(1) & : T_{10} ≤ t < T_{11} \\
f_{12}(0) × (t - T_{12}) + f_{12}(1) & : T_{11} ≤ t < T_{12} \\
f_{13}(0) × (t - T_{13}) + f_{13}(1) & : T_{12} ≤ t < T_{13} \\
f_{14}(0) × (t - T_{14}) + f_{14}(1) & : T_{13} ≤ t < T_{14} \\
f_{15}(0) × (t - T_{end}) + f_{15}(1) & : T_{14} ≤ t < T_{end} \\
0 & : T_{end} ≤ t < ∞ \\
\end{cases}

What I want it to look like (composed in LaTeX in an external program):

Piecewise equation displaying properly

What I'm getting in the Mathematics Stack Exchange question-editor preview:

Piecewise equation displaying incorrectly

And finally, the MathJax directly in this question:

$$ j(t) = s_{max}\,×\,\begin{cases} 0 & : -∞ < t < 0 \\ f_{01}(0) × (t - T_{01}) + f_{01}(1) & : 0 ≤ t < T_{01} \\ f_{02}(0) × (t - T_{02}) + f_{02}(1) & : T_{01} ≤ t < T_{02} \\ f_{03}(0) × (t - T_{03}) + f_{03}(1) & : T_{02} ≤ t < T_{03} \\ f_{04}(0) × (t - T_{04}) + f_{04}(1) & : T_{03} ≤ t < T_{04} \\ f_{05}(0) × (t - T_{05}) + f_{05}(1) & : T_{04} ≤ t < T_{05} \\ f_{06}(0) × (t - T_{06}) + f_{06}(1) & : T_{05} ≤ t < T_{06} \\ f_{07}(0) × (t - T_{07}) + f_{07}(1) & : T_{06} ≤ t < T_{07} \\ f_{08}(0) × (t - T_{08}) + f_{08}(1) & : T_{07} ≤ t < T_{08} \\ f_{09}(0) × (t - T_{09}) + f_{09}(1) & : T_{08} ≤ t < T_{09} \\ f_{10}(0) × (t - T_{10}) + f_{10}(1) & : T_{09} ≤ t < T_{10} \\ f_{11}(0) × (t - T_{11}) + f_{11}(1) & : T_{10} ≤ t < T_{11} \\ f_{12}(0) × (t - T_{12}) + f_{12}(1) & : T_{11} ≤ t < T_{12} \\ f_{13}(0) × (t - T_{13}) + f_{13}(1) & : T_{12} ≤ t < T_{13} \\ f_{14}(0) × (t - T_{14}) + f_{14}(1) & : T_{13} ≤ t < T_{14} \\ f_{15}(0) × (t - T_{end}) + f_{15}(1) & : T_{14} ≤ t < T_{end} \\ 0 & : T_{end} ≤ t < ∞ \end{cases} $$

There are no line breaks between the individual condition statements, and the notation \, isn't being converted into a space character.

I know that piecewise notation works on the Mathematics Stack Exchange in at least some situations, as I've used it before successfully. Here's an example from one of my previous questions:

f_X(x; 3) = \begin{cases}
\frac{x²}{2} & : 0 ≤ x ≤ 1 \\
\frac{−2 x² + 6x − 3}{2} & : 1 < x ≤ 2 \\
\frac{(−x + 3)²}{2} & :  2 < x ≤ 3 \\
0 & : \text{otherwise}
\end{cases}

Piecewise equation displaying properly in a previous question

Weirdly, when I copy the MathJax directly from that question and paste it in here with no changes, which I did to get an example of MathJax working correctly, it ALSO doesn't display properly in the preview here, despite displaying correctly in the edit preview on that earlier question:

$$f_X(x; 3) = \begin{cases} \frac{x²}{2} & : 0 ≤ x ≤ 1 \\ \frac{−2 x² + 6x − 3}{2} & : 1 < x ≤ 2 \\ \frac{(−x + 3)²}{2} & : 2 < x ≤ 3 \\ 0 & : \text{otherwise} \end{cases}$$

EDIT: After posting this question, I saw that the MathJax is actually displaying correctly in the posted version despite not displaying correctly in the new-question-composing preview. In writing this edit, the MathJax is also displaying correctly in the existing-question-editing preview. So it seems like the problem is a bug in the new-question-composing preview, not a problem with my notation.

EDIT 2: I am on Windows 10 Pro 21H2, Firefox 111.0.1 (64-bit), MathJax Math Renderer HTML-CSS with nothing changed from default values.

$\endgroup$
6
  • $\begingroup$ You gotta tell us more about your environment - OS, browser, MathJax rendering options. Check previous MathJax/LaTeX questions for details on how to find the latter. $\endgroup$
    – JonathanZ
    Mar 30 at 15:28
  • 1
    $\begingroup$ \, is never a "non-breaking-space". That codes for a "thin space", and it is not non-breaking in regular LaTeX either. $\endgroup$ Mar 30 at 17:22
  • $\begingroup$ @ArturoMagidin tex.stackexchange.com/questions/76132/… states that \, is non-breaking, and my experience using it is that it is indeed non-breaking. $\endgroup$
    – Lawton
    Mar 30 at 20:23
  • $\begingroup$ @Lawton: In text mode, \, is a kern, so it is unbreakable, as described there. However, in math mode, \, is defined to be \def\,{\mskip\thinmuskip} (page 357 of the $\TeX$-book); \thinmuskip is a unit defined in terms of the mu (mathematical unit of space), and \mskip is a mathematical horizontal skip, which introduces glue; glue is stretchable/breakable. $\endgroup$ Mar 30 at 20:40
  • $\begingroup$ @ArturoMagidin In that case there may be a bug in MathJax, or in Stack Exchange's implementation of it. When I use a regular space character a line break gets inserted there because the expression is so wide, but when I use \, no line break is inserted. $\endgroup$
    – Lawton
    Mar 31 at 13:26
  • $\begingroup$ MathJax is does not (nor is it required to) faithfully reproduce $\TeX$s behaviour. $\endgroup$ Mar 31 at 13:50

0

You must log in to answer this question.

Browse other questions tagged .