7

I want to N squared inside overline. The superscript in $\overline{N^2}$ is too low. How to raise superscript higher? Thanks

Adam Liter
  • 12,567

2 Answers2

7

This is done on purpose, in order to avoid excessive height when not really needed. Inside \overline, the current math style changes into the “cramped” variant. You can revert to the uncramped one by explicitly selecting it or using a command that does it for you.

\documentclass{article}

\newcommand{\roverline}[1]{\mathpalette\doroverline{#1}}
\newcommand{\doroverline}[2]{\overline{#1#2}}

\begin{document}
\begin{tabular}{lll}
display:      & $\displaystyle\overline{N^2}N^2$      & $\displaystyle\roverline{N^2}N^2$\\
text:         & $\textstyle\overline{N^2}N^2$         & $\textstyle\roverline{N^2}N^2$ \\
script:       & $\scriptstyle\overline{N^2}N^2$       & $\scriptstyle\roverline{N^2}N^2$ \\
scriptscript: & $\scriptscriptstyle\overline{N^2}N^2$ & $\scriptscriptstyle\roverline{N^2}N^2$\\
\end{tabular}
\end{document}

The center column has \overline, the right column has \roverline.

enter image description here

egreg
  • 1,121,712
2

Is this what you are looking for?

enter image description here

The example you gave does what it says, it puts a line over N^2. If you tell it to square \overline{N}, you get the result I think you want.

\documentclass[border=2pt]{standalone}

\begin{document}
$\overline{N}^2$
\end{document}

If you actually want the 2 to appear above the line, you'd want to use a custom command:

enter image description here

This goes beyond my skill level so this is just a mockup, I used TikZ for it only because I don't know the proper way to do this using LaTeX/TeX, it's not the best tool for this.

Purely for illustrative purposes, no warranty expressed or implied, probably guaranteed to mess up spacing and alignment:

\documentclass[border=2pt]{standalone}
\usepackage{tikz}

\newcommand{\supersuperscript}{
    \hspace{-6.6pt}
    \begin{tikzpicture}
        \draw (0,0) (0,11.8pt) node {\scriptsize 2};
    \end{tikzpicture}
    }

\begin{document}
$\overline{N\ }\supersuperscript$
\end{document}

(It would be cool if someone came along and actually showed how the custom superscript should be done...)

Ryan
  • 2,914