# How to center the higher glyph(s) in a \stackrel or stretch the lower glyph?

I currently am using a relation

\newcommand{\Lsense}{\stackrel{\mathbb{L}^1}{=}}

but unfortunately, the \mathbb{L}^1 is not nicely centred over the = symbol.

I read some other answers that involve shifting the upper glyph to make it appeared centred, but in this case I think the \mathbb{L}^1 is wider than the =, so maybe I have to "stretch" the =?

Alternatively, if someone could explain the code a bit from answers such as from here, that would be great as I reckon I can just use that instead.

Some fine tuning is necessary.

First, we have to remove the small space that TeX adds after superscripts, which is \scriptspace. Second, we can compensate the hole due to the conflicting shapes by doing \mathbb{L}^{\!1}. Finally, a thin space before the “L” helps in centering. The whole thing is set in \mathclap, so it won't count for the width of the big symbol.

\documentclass{article}
\usepackage{amsmath,mathtools,amssymb}

\newcommand{\Lsense}{%
\overset{\mathclap{\,\mathbb{L}^{\!1}\kern-\scriptspace}}{=}%
}

\begin{document}

$A\Lsense B$

$A=B$

\end{document}


The distance from the left side of the “L” to the left side of “=” is not the same as the distance from the right side of the “1” to the right side of the “=”, but it's not of a concern, visually, because the exponent is set quite high. You may want to use \mspace{2mu} (or less) instead of \, (which would be \mspace{3mu}).

Here's a “boxed” version that shows the horizontal size is the same.

• I chose this as the answer because it compensates for the superscript and the left-alignment of the L. :) Thanks for your help! Sep 13, 2016 at 6:10

\documentclass{article}
\usepackage{amsmath,amssymb}

\begin{document}

\newcommand{\Lsense}{\stackrel{\mathbb{L}^{\mkern-5mu 1}}{=}} %precise value up to you

$A\Lsense B$

\end{document}


Certainly, \mkern can be also in other places, e.g.,

\newcommand{\Lsense}{\stackrel{\mkern2mu\mathbb{L}^{\mkern-5mu 1}}{=}}

• How does mkern work? It moves the following character XXmu left/right? Is it part of amssymb? Sep 12, 2016 at 5:38
• It definitely looks better than what I had in any case! :) Sep 12, 2016 at 5:41
• @jamesh625 It is TeX primitive, so it doesn't need any packages. And it adds an unshrinkable space (kern). In math mode small length units called mu are suggested. Sep 12, 2016 at 5:44

\usepackage{mathtools,amssymb}

You can remove \scripscriptstyle if you think it's to small. The \mathrlap is key here, because makes the superscript take zero space.