How can I overscore a character?
As egreg mentioned in the comments, \overline{x}
is a good solution. Here are various symbols that can be used for negation that I can think of:
$x' \quad x^\prime \quad \overline{x} \quad \bar{x} \quad \lnot x \quad {\sim} x$
Also, for future reference, you should have a look at How to look up a symbol or identify a math symbol or character?.
If you're feeling a little more adventurous, the accents
package allows you to stack <accent>
on <stuff>
using
\accentset{<accent>}{<stuff>}
Here is a comparison between \overline
, \bar
and \accentset
via the newly defined macro
\negbool[<thickness>]{<stuff>}
that puts a rule of thickness <thickness>
(defaults to 0.4pt
) on <stuff>
. It allows you a little more freedom and has a slightly better placement of the "overline" on it's slanted base:
\documentclass{article}
\usepackage{calc}% http://ctan.org/pkg/calc
\usepackage{accents}% http://ctan.org/pkg/accents
\newcommand*{\negbool}[2][0.4pt]{\ensuremath{\accentset{\rule{\widthof{#2}}{#1}}{#2}}}
\begin{document}
$\overline{x} \quad \bar{x} \quad \negbool{x} \quad \negbool[1pt]{x}$
\end{document}