10

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}
gernot
  • 49,614
somehume
  • 237

2 Answers2

19

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 symbol or identify a math symbol or character?.

Peter Grill
  • 223,288
7

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}
Werner
  • 603,163