# Producing several overlines of the same height throughout a formula

Above is an example produced by S\overline{n}=\overline{n+1}. The overlines are not aligned vertically, which is highly undesirable. Is there any way to produce overlines of the same height throughout a whole formula?

-
\overline{\strut...} –  David Carlisle Mar 15 '13 at 20:21
@DavidCarlisle Well, strut is too high... –  4ae1e1 Mar 15 '13 at 20:24
if you need it to be high enough for brackets and superscripts and things with all the overlines the same height then that's what you need, if you have it lower then more expressions will have a raised overline, but you can make a strut of any height \def\mystrut{\rule{0pt}{.6em}} experiment with whatever height you like. –  David Carlisle Mar 15 '13 at 20:28
You might be be interested in this post: Can I get a \widebar without using the mathabx package? –  Hendrik Vogt Mar 15 '13 at 21:40

If you want the same height, here's a way:

\documentclass{article}
\begin{document}
$S\overline{n\vphantom{+1}}=\overline{n+1}$
\end{document}


but the result is far from pretty. To be honest, I prefer the version you get.

-
Yeah, it is a little bit off expectation, but it looks okay in 10pt or 11pt. Better than the original one, I mean. –  4ae1e1 Mar 15 '13 at 20:39
Of course, the code becomes really annoying both to write and to read, even if shortcut is used. –  4ae1e1 Mar 15 '13 at 20:42
@KevinSayHi TeX is not clairvoyant, so small manual adjustments are sometimes needed when object with different characteristics need to be set next to each other. –  egreg Mar 15 '13 at 20:45