# \overline outside of math mode

\end{document}


Your question was essentially answered by egreg but there wasn't much explanation and this is a little too long to put as a comment.

If you want to have line breaks in the text you can use the soul package:

\documentclass{article}
\usepackage{soul}

\newcommand\ol[1]{{\setul{-0.9em}{}\ul{#1}}}

\begin{document}
\ol{This is under a line.}

\Huge\ol{This is under a line.}
\end{document}


The disadvantage of this approach is that the line height does not depend on the height of the content (so capital letters with accents will be problematic). It does scale with font size though.

• A short hint: smaller numbers in \setul{} (e.g. \setul{-1.1em}) will increase the space between line and text. – Qaswed Feb 24 '18 at 8:46

Use \={o}, it works in text mode.

• Do you have a link to where you found that on TeX.SE? That would be useful to include in this answer. – Null Aug 2 '16 at 15:27
• Welcome to TeX.SX! This is for getting a bar accent over one character, not for overlining a bunch of them. – egreg Aug 2 '16 at 15:29
\documentclass{article}
\newsavebox\TBox
\def\textoverline#1{\savebox\TBox{#1}%
\makebox[0pt][l]{#1}\rule[1.1\ht\TBox]{\wd\TBox}{0.4pt}}
\begin{document}

\textoverline{foo}
\textoverline{\textit{foo\"A}}
\tiny\textoverline{bar}

\end{document}