# Spacing/sizing issues in "cases" environment #485

Closed
opened this issue May 28, 2013 · 12 comments

Projects
None yet
3 participants
Member

### pkra commented May 28, 2013

 The following doesn't seem to render correctly. LaTeX itself shrinks the fraction. $$f(x)= \begin{cases} \frac{1}{n} & \mbox{if } x>0 \\ 0 & \mbox{else} \end{cases}$$

Member

### dpvc commented May 29, 2013

 The issue485 branch of my fork of MathJax includes a fix for this.
Contributor

### fred-wang commented May 30, 2013

 It looks like you've left some debug logging in the source.
Contributor

### fred-wang commented May 30, 2013

 Adding QA unit test wanted, just to remember that I must update LaTeXToMathML tests that rely on the cases construction (around 25).
Contributor

### fred-wang commented Jun 12, 2013

 => Ready For Release IIRC, this changes the reference of a lot of tests that use "cases" directly but also those that use it indirectly (like other environments based on cases). I hope this is what we want. If so, I'll update the references.
Member

### dpvc commented Jun 12, 2013

 None of the other environments currently use cases, so I think it will be OK. This makes cases conform to the TeX usage, so I do think it is what we want. We might want to check the other array environments to see if similar changes are needed there. Thanks for fixing the debugging call.
Contributor

### fred-wang commented Jun 12, 2013

 When I executed the LaTeXToMathML tests on 2013-05-30 with that branch, I got failure with subarray, substack, binom due to a change of displaystyle. However, they do not seem to use case so I'm not sure what happened. I'll try to run the tests again.

Contributor

### fred-wang commented Oct 9, 2013

 Most failing LaTeXToMathML tests still have a useless explicit displaystyle="false".
Contributor

### fred-wang commented Oct 10, 2013

 We'll have to analyze more precisely why these explicit displaystyle="false" attribute now show up. But otherwise, I can just update the references.
Contributor

### fred-wang commented Oct 10, 2013

 So if I understand correctly, we added else if (style) {array.arraydef.displaystyle = false} in the Array function of the input TeX. This is used for all Array environments, not just cases. Then in the native MathML output, NativeMMLattributes does not seem to compare with the default value but just to skip attributes that are "null". This means that displaystyle="false" will be generated. Is this intended? Should we fix that in MathJax? Or should I update the test references?
Contributor

### fred-wang commented Oct 11, 2013

 @dpvc any idea?
Member

### dpvc commented Oct 11, 2013

 My recollection is that this is as intended. The environments where inheriting the displaystyle from setting outside the environment, and that is not what it supposed to happen. (The environment is supposed to typeset the same regardless of the style outside.) At the time the macro runs, the MathML is not yet completely available, and you can't tell for sure what displaystyle is in effect, so it seemed best to set it explicitly. I suppose it could be filtered out later, but I don't really see the need.
Contributor

### fred-wang commented Oct 11, 2013

 OK, thanks. I'll just update the references.