\binom{}{} rendering

145 views
Skip to first unread message

elim

unread,
Jan 21, 2011, 11:08:46 AM1/21/11
to MathJax Users
This only happens in in-line math like this

$\binom{n}{0}+\binom{n}{1}$

where \binom{n}{0} appears much bigger than \binom{n}{1}

If 0 is replaced by others, the problem will be gone: why 0 will make
the size of binom bigger?


Davide P. Cervone

unread,
Jan 21, 2011, 12:02:50 PM1/21/11
to mathja...@googlegroups.com
The size of the parentheses is chosen dynamically to be sure to
enclose the content, and there are only a fixed number of sizes of
parentheses, so the difference between one and another can be quite
apparent. In this case, it turns out that the 0 character has a tiny
bit of depth, while the 1 doesn't, and that accounts for the \binom{n}
{0} getting larger parens, as it appears that this is right at the
breaking point between the two paren sizes. The reason for the depth
is that the fonts were created in an automated fashion from bitmaps of
the TeX CM fonts, and that process is not perfect. The curve at the
bottom of the 0 (and the 5, 6, 8, etc) all extend slightly below the
baseline, while the straight line at the bottom of 1, 2, etc, don't.

One hack that can get you the result you want is

$\binom{n}{\smash 0}+\binom{n}{1}$

which will eliminate the height and depth of the 0. It is ugly, but
works.

Davide

elim

unread,
Jan 24, 2011, 4:35:22 AM1/24/11
to MathJax Users
Thanks Davide for the solution and the explain.

Is there a solution for \overarc{ab} ?

Thanks agin

Davide P. Cervone

unread,
Jan 24, 2011, 9:58:36 AM1/24/11
to mathja...@googlegroups.com
The web-based fonts do not include characters for the \overarc, so
there is no direct way to do this. The best I could come up with is a
real hack:

\mathord{\buildrel \frown \over {ab}}

The arc is a but high. It's position can be adjusted as follows:

\mathord{\buildrel \smash{\lower{1pt}{\frown}} \over {ab}}

for example. Horrible, I know, but it is one way to approach it.

Davide

elim

unread,
Jan 24, 2011, 1:10:17 PM1/24/11
to MathJax Users
Thanks Davide. My guess is that since \widehat{} is working, in
principle, the later version of MathJax should include \overarc
without troubles.... how \mathord{\buildrel \frown \over {ab}} can
control the width?

Davide P. Cervone

unread,
Jan 24, 2011, 3:01:26 PM1/24/11
to mathja...@googlegroups.com
The \widehat{} macro uses five or six separate characters (each one a
bit larger than the last) to make it work. If there were
corresponding arc characters in the MathJax fonts, then \overarc could
be made to work using the same approach. The problem is that there
are no such characters, so the \widehat approach won't work. Indeed,
it turns out that the LaTeX \overarc works essentially like the
approach I told you, using the \frown character rather than a sequence
of characters like
\widehat.

In any case, you can change the size of the \frown using the sizing
macros. There are ten, which I list from smallest to largest:

\tiny, \Tiny, \scriptsize, \small, \normalsize, \large, \Large,
\LARGE, \huge, \Huge

You can use them as in

\mathord{\buildrel \Tiny\frown \over {a}}

to get a smaller arc over the a.

Davide

Reply all
Reply to author
Forward
0 new messages