I recently came across this answer, which involved some pretty precise calculations. Here's how it rendered in my browser*:

Screenshot of answer 798551

Two questions arise:

  • What is the desired technical behavior? Should the MathJax there really cut off the sidebar?
  • What is the desired community behavior? Should users post MathJax this long?

For what it's worth, adding overflow-x: hidden to the div.post-text truncates the output as expected.

* Google Chrome 33.0.1750.149 on Linux Mint 16 Cinnamon ×64

  • 1
    $\begingroup$ Ideally I would have like to have put latex inside of scrollbars, does anyone know how to do that? $\endgroup$
    – DanielV
    May 18, 2014 at 0:50
  • 1
    $\begingroup$ @DanielV I tried, and gave up. I actually stopped short of throwing the kitchen sink at it, so maybe there is still a way, but I am not so hopeful anymore. $\endgroup$ May 18, 2014 at 2:18
  • $\begingroup$ @J.W.Perry Thanks for looking, if you ever find a way, feel free to edit my post (or any post of mine you think you can improve, it is welcome). $\endgroup$
    – DanielV
    May 18, 2014 at 4:36
  • 2
    $\begingroup$ @WChagrin In hindsight, now I realize I missed the obvious, since the denominator is a power of 10 the decimal would have been exact...oh well~ $\endgroup$
    – DanielV
    May 18, 2014 at 4:38
  • $\begingroup$ MathJax is able to do automatic line-breaking. This is not active by default. The community could ask stackexchange to modify their MathJax configuration. $\endgroup$ May 23, 2014 at 12:57
  • $\begingroup$ @DanielV: This inside a stylish script produces the desired behaviour, I believe: .MathJax_Display{overflow: scroll;} $\endgroup$
    – chaosflaws
    May 29, 2014 at 20:34
  • $\begingroup$ @chaosflaws How do you use it? Can put you an example into an answer so I can see it? $\endgroup$
    – DanielV
    May 29, 2014 at 22:54
  • $\begingroup$ @DanielV That would be something the StackExchange developers would have to add; it goes in the CSS stylesheet. $\endgroup$
    – wchargin
    May 29, 2014 at 23:08
  • $\begingroup$ Awww, but maybe we could make a meta thread recommending this. $\endgroup$
    – DanielV
    May 29, 2014 at 23:09
  • $\begingroup$ @DanielV You can try it yourself by right-clicking, pressing "Inspect Element," going into the <head>, and adding the relevant <style>. $\endgroup$
    – wchargin
    May 29, 2014 at 23:10
  • $\begingroup$ See my answer to use it locally. $\endgroup$
    – chaosflaws
    May 30, 2014 at 7:46

2 Answers 2


For now (until a built-in approach comes along), one can apply the fix that Goos just made by using \atop for fractions. That is, wrap the text as long as the intent is clear from context.

Example of \atop $$\frac{{ 14545454540916238222253308031039403263876427137099 \atop 728738149747953197899302063661139633020606426446001 }}{10^{101}}$$ Code:

$$\frac{{ 14545454540916238222253308031039403263876427137099 \atop 728738149747953197899302063661139633020606426446001 }}{10^{101}}$$

  • 1
    $\begingroup$ Does anyone know if there is a way of getting the line break to be automatic? I thought a minipage would work, but alas they seem not to work in mathmode. $\endgroup$
    – user1729
    May 22, 2014 at 8:27

Temporarily, a solution that creates sidebars is the following. Use an extension for your browser that allows to use user-defined stylesheets (for Firefox, Opera and Chrome this would e. g. be Stylish). Then, add the following code:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain("stackexchange.com") {
.MathJax_Display {
    overflow-x: scroll;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .