Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
6  
$\overline{x}$? –  egreg Oct 22 '11 at 23:05
1  
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
add comment

2 Answers 2

up vote 9 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
add comment

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:

Accent comparison

\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}
share|improve this answer
add comment

Your Answer

 
discard

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.