Discussion:
\overline outside mathmode?
(too old to reply)
Robert Voogdgeert
2004-02-11 12:07:51 UTC
Permalink
Dear TeX-users,

Can any of you tell me whether is it possible to use the overline
command outside mathmode?


Greetings,
Robert.
Danie
2004-02-11 18:37:05 UTC
Permalink
Post by Robert Voogdgeert
Dear TeX-users,
Can any of you tell me whether is it possible to use the overline
command outside mathmode?
\usepackage{amstext}
\newcommand{\toverline}[1]{\ensuremath{\overline{\text{#1}}}}

This will follow the surrounding text font

Danie Els: dnjels at sun dot ac dot za
Hartmut Henkel
2004-02-11 19:40:18 UTC
Permalink
Post by Robert Voogdgeert
Can any of you tell me whether is it possible to use the overline
command outside mathmode?
You could modify the strikeout macro \sout in ulem.sty, e. g.:

\documentclass{article}
\usepackage{ulem}
\def\oline{\bgroup \ULdepth=-1.9ex \ULset}
\begin{document}
\oline{AsdFl KsdFl sdLk KslD klFsd kls}
\end{document}

Regards, Hartmut
--
H. Henkel, Oftersheim
Cameron, Charles B.
2004-02-11 12:32:38 UTC
Permalink
Post by Robert Voogdgeert
Dear TeX-users,
Can any of you tell me whether is it possible to use the overline
command outside mathmode?
Greetings,
Robert.
This macro may help:

\newcommand{\OL}[1]{\mbox{$\overline{\textrm{#1}}$}}

Usage:

\OL{symbol}

However, it actually does use math mode internally. As written it will always put the argument in Roman stle.

It doesn't work well if you give it several words in succession. Although the words all will have an overline, the result can easily extend into the right margin because the lines will not break properly. However, if you just want an overline over a single word, it should suffice.

It doesn't work if you use it inside a math formula, either. Doubtless there is a more general way to solve this problem.

Charles B. Cameron

Loading...