3
$\begingroup$

Is it possible to elegantly eliminate side whitespace around the base under the overset, which is longer than the base?

E.g. if we wanted to talk about the 123456789th carbon atom of a huge poly(methylene) (or polyethylene, if you want) molecule, and mark the discussed carbon atom locant, like:

\ce{CH3-[CH2]_x-\overset{123456789}{C}H2-[CH2]_y-CH3} …

we get

$$\ce{CH3-[CH2]_x-\overset{123456789}{C}H2-[CH2]_y-CH3} ~~~ (x=123456789-2, \; x \le y)$$

resulting rendering image follows, for convenience

formula rendering image 1

We could fix it with some negative spaces (\!)

… \overset{\!\!\!\!\!\!\!\!\!\!\!123456789\!\!\!\!\!\!\!\!\!\!\!}{C}H2 …

$$\ce{CH3-[CH2]_x-\overset{\!\!\!\!\!\!\!\!\!\!\!123456789\!\!\!\!\!\!\!\!\!\!\!}{C}H2-[CH2]_y-CH3} ~~~ (x=123456789-2, \; x \le y)$$

which is inexact (and, for me, works in Cr but not in FF browser).

formula rendering image 2

Is it possible to fix the spacing problem a better way?

$\endgroup$
5
$\begingroup$

Probably not, at least probably not in the way you would like it. As far as I see there is no centering zero-width box implemented in MathJax (in LaTeX one could use makebox with \makebox[width][pos]{text}), there are right/left overlapping boxes though. I guess the following is a (mediocre) workaround, but it's the best I could come up with.

$$\ce{CH3-[CH2]_x-\overset{123456789}{C}H2-[CH2]_y-CH3}$$
$$\ce{CH3-[CH2]_x-\overset{\rlap{_\swarrow123456789}}{C}H2-[CH2]_y-CH3}$$
$$\ce{CH3-[CH2]_x-\overset{\llap{123456789_\searrow}}{C}H2-[CH2]_y-CH3}$$

$$\ce{CH3-[CH2]_x-\overset{123456789}{C}H2-[CH2]_y-CH3}$$ $$\ce{CH3-[CH2]_x-\overset{\rlap{_\swarrow123456789}}{C}H2-[CH2]_y-CH3}$$ $$\ce{CH3-[CH2]_x-\overset{\llap{123456789_\searrow}}{C}H2-[CH2]_y-CH3}$$

With MathJax there are limited options; it is not LaTeX. I don't know why you need this, but it might be better to just completely avoid such constructs.
MathJax tends to be slow, too, so better avoid anything too complicated. $\odot\!\frown\!\odot$

If you want to know which (La)TeX commands are supported, head on over to Dr. Carol JVF Burns overview.

$\endgroup$

You must log in to answer this question.

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