TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


share|improve this question
$\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
up vote 10 down vote accepted

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$

enter image description here

Also, for future reference, you should have a look at How to look up a math symbol?.

share|improve this answer
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


Here is a comparison between \overline, \bar and \accentset via the newly defined macro


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:

Accent comparison

\usepackage{calc}% http://ctan.org/pkg/calc
\usepackage{accents}% http://ctan.org/pkg/accents
$\overline{x} \quad \bar{x} \quad \negbool{x} \quad \negbool[1pt]{x}$
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.