# How can I overscore a character?

I am using Anki to create flash cards for Boolean identities. I prefer to use an overscore as opposed to a prime for negated variables. Can this be accomplished with LaTeX?

EDIT: The header and footer are as follows:

\documentclass[12pt]{article}
\special{papersize=3in,5in}
\usepackage[utf8]{inputenc}
\usepackage{amssymb,amsmath}
\pagestyle{empty}
\setlength{\parindent}{0in}
\begin{document}

\end{document}

-
$\overline{x}$? – egreg Oct 22 '11 at 23:05
Welcome to TeX.SE. Even though it may seem trivial, it is always best to compose a MWE that illustrates the problem including the \documentclass so that those trying to help don't have to recreate it. – Peter Grill Oct 22 '11 at 23:05
@PeterGrill, You've just highlighted how much I do not know about LaTeX. – somehume Oct 23 '11 at 0:18
I only started this journey earlier this year, so give it time... As a tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). I took the liberty to format you post a little. See this link for more details on available formatting. – Peter Grill Oct 23 '11 at 0:41

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 math symbol?.

-
Not ~\!\!, but {\sim} that makes {\sim} into an ordinary symbol (it's a relation symbol, by itself) – egreg Oct 23 '11 at 8:17
@egreg: Thanks for pointing that out. I have updated the solution to reflect this. – Peter Grill Oct 23 '11 at 15:55

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}

-