In this question on the Puzzling Stack Exchange, I wrote this answer with some Mathjax, but it formatted a little weirdly. Here is what I wrote:


Some unecessary information, blah blah blah

The following is another one less technical.

$$\underbrace{(2+0!)}_{3}\|\underbrace{(1+\sqrt{9})}_{4}=34\tag{$\|=\small\rm concatenation$}$$


Notice that the right underbrace is significantly larger than the left one. I presume the square root and the brackets are to explain why this is the case.

Is this a bug? If so, should the large underbrace be fixed for smaller size?

Here are some other examples:

$$\underbrace{1+1}_{2}\quad\underbrace{\sqrt{1}+1}_{2}\quad\underbrace{1+\sqrt{1}}_{2}\quad\underbrace{\sqrt{1}+\sqrt{1}}_{2}$$ $$\underbrace{(1+1)}_{2}\quad\underbrace{(\sqrt{1}+1)}_{2}\quad\underbrace{(1+\sqrt{1})}_{2}\quad\underbrace{(\sqrt{1}+\sqrt{1})}_{2}$$

The same applies to overbraces.

$$\overbrace{1+1}^{2}\quad\overbrace{\sqrt{1}+1}^{2}\quad\overbrace{1+\sqrt{1}}^{2}\quad\overbrace{\sqrt{1}+\sqrt{1}}^{2}$$ $$\overbrace{(1+1)}^{2}\quad\overbrace{(\sqrt{1}+1)}^{2}\quad\overbrace{(1+\sqrt{1})}^{2}\quad\overbrace{(\sqrt{1}+\sqrt{1})}^{2}$$


Original screenshot:

SCREENSHOT

The expressions are nearly all the same size, differing just slightly. But the braces (over and under) differ significantly. Apologies if the screenshot is blurry.


New & Improved Screenshot:

SCREENSHOT 2

Thanks heaps to @Martin Sleziak for this, particularly this Meta answer!!

  • 1
    I don't understand the question. Looks fine to me and expected that the size of the underbrace depends on the size on the expression. What behavior would you expect? – quid Sep 19 at 6:43
  • @quid the braces to be the same size. If it is not a problem, I can delete this post. The expressions are the same size, but not the braces. You say that the size of the brace depends on the size of the expression, but the expressions seem to be the same size with varying sizes of braces. I am just curious to know whether or not this is a bug, is all. – user477343 Sep 19 at 6:44
  • Post a screenshot; I suspect your browser is rendering things differently, and what you're seeing is different from what we're seeing. Also, it may help to add some markings to the screenshot to refer to what specifically you're referring to. – Hurkyl Sep 19 at 10:19
  • @Hurkyl okay. I am using Google Chrome as my internet browser, by the way. Edit: Okay, I posted a screenshot. – user477343 Sep 19 at 10:25
  • 1
    You are indeed seeing something different than what I see! I can't help with your issue, but hopefully now someone who can will know what the issue is. (incidentally, I use Chrome as well) – Hurkyl Sep 19 at 10:28
  • @Hurkyl I have tried using Safari as well, but that doesn't make any difference :\ – user477343 Sep 19 at 10:29
  • 1
    I guess that the output might depend not only on the browser, but also on the chosen Math Renderer for MathJax. (See the screenshots in this post to see the menu where it can be changed.) – Martin Sleziak Sep 19 at 10:50
  • @MartinSleziak thank you for that. I am trying it out now :P – user477343 Sep 19 at 10:54
  • @MartinSleziak YES IT WORKS! SVG IS LEGEND. Jeez, I'm overreacting. Thank you so so much! It looks so much better. I will include a screenshot of this, credit you, and you can post your comment as an answer if you like. Again, thank you very very much!! :D – user477343 Sep 19 at 10:56
  • @user477343 If you feel that this can be expanded to a sufficient answer for your question, feel free to post it yourself. (I am a bit hesitant to do so, for several reasons.) – Martin Sleziak Sep 19 at 10:57
  • @MartinSleziak can you tick your own answer?? What's the point in that? Why would you be hesitant? :) – user477343 Sep 19 at 10:59
  • @user477343: Some reasons to post your own answer and ticking it are (1) you let other people know you no longer need help, and (2) future people who have the same problem who come across this post will know there is an answer that works (or at least works for someone with a similar problem). – Hurkyl Sep 19 at 11:15
  • @Hurkyl okay, thank you for that thought. I originally considered ticking my own answer as somewhat a bit selfish, but you have changed my mind :) – user477343 Sep 19 at 11:18
up vote 4 down vote accepted

MathJax handles stretchy characters like the over-and under-braces as follows: for smaller versions, it has several sizes to choose from in its fonts (just as TeX does), and will use one of these single-character versions when possible. For larger versions, the stretchy character is made from several glyphs pieced together. In your case, the transition between the single-character versions and the multi-character versions seems to occur between your third and fourth expressions.

MathJax's HTML-CSS output renderer (the default used here on StackExchange) can use several different font families for its output, and it prefers to use one installed on your system rather than downloading them over the web. For example, if you have the STIX fonts (version 1) installed on your system, it will used then in preference to its own TeX-based fonts. In your case the fonts being used are the STIX fonts, so I assume you have those installed locally. Apple has included STIX fonts in their systems for somme years now, so if you are using MacOS, you have them automatically (and I think iOS does as well).

It turns out that the single-character over and underbraces in the STIX fonts are thinner than the braces made from the multi-character pieces provided in the font. That is the difference that you are seeing, here. Others who are not seeing that themselves are probably seeing the MathJax TeX fonts (since they don't have STIX fonts installed).

Switching to one of the other renderers (as indicated in the link you provide) will result in the MathJax TeX fonts being used (only HTML-CSS checked for the ones available on your local system).

In any case, this is not a bug, it is a feature (based on the font in use).

  • 2
    Based on your answer, I've marked this as by-design. – Asaf Karagila Sep 20 at 14:02
  • $(+1)$ I believe you deserve a $\color{green}{\checkmark}$ for this answer. Congratulations! :D – user477343 Oct 2 at 12:32

The braces are meant to suit the size of the expression you want them under. If you look at the code, you see the following:

\underbrace{blah blah blah}

which means that everything you have put from { to } will be on top of the brace. On the contrary, it would not make sense if they were all the same size, as otherwise some characters will not be included.

  • $(+1)$ I agree with you, but it in the examples I have provided, the braces are varying in size with same size characters and thus expressions, overall. There are minor differences, but they are very little. – user477343 Sep 19 at 6:51
  • 2
    @user477343 I think you've answered your own question by stating the presence of 'square roots and brackets'. The more you have of them, the more space it takes, thus the longer than brace will be. Am I misunderstanding your question? – TheSimpliFire Sep 19 at 6:53
  • No, I don't think you are. Take the following two expressions for example: $$\underbrace{1+1}_{2}\quad \underbrace{1+\sqrt{1}}_{2}$$ I have added a square root, but the height of the brace is not affected; just the length. This seems appropriate. But then I have something like this: $$\underbrace{\sqrt{1}+\sqrt{1}}_{2}$$ and now it is large. I was just wondering if this was a bug. – user477343 Sep 19 at 6:55
  • @user477343 If you look closely at the square root you see that it is slightly larger in height than $1$ vs $\sqrt{}$. – TheSimpliFire Sep 19 at 7:06
  • I know, but one square root does not seem to drastically affect the brace as opposed to two. When adding brackets, I can understand, but not with square roots that are just barely taller than $1$. Is it my eyes? – user477343 Sep 19 at 7:08
  • I have posted a screenshot :) – user477343 Sep 19 at 10:30

You must log in to answer this question.

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