4

I'm defining a boolean algebra in latex and I need to overline a whitespace to introduce the NOT operator.

This is the latex code I used

$$\mathcal{A} = (\mathcal{B},+,\cdot, \overline{ })$$

The problem is that instead of showing an overlined whitespace it shows nothing, as if there was no overline.

EDIT: I've just tried replacing \overline{} with \overline{\ } and an overlined has appeared, but it is not at the right height. It seams more like an underscore than an overscore.

This is the result:

enter image description here

1 Answers1

3

With \overline{<text>} you get an overline adjusted both for the width and the height of the <text>. So \overline{} yields nothing, but \overline{\ } puts the overline over an item that has no height.

Using \overline{\phantom{x}} you overcome both problems.

A comparison:

\documentclass{article}

\begin{document}

\begin{tabular}{lc}
\verb|\overline{}| & $x\overline{}x$ \\
\verb|\overline{\ }| & $x\overline{\ }x$ \\
\verb|\overline{\phantom{x}}| & $x\overline{\phantom{x}}x$ \\
\end{tabular}

\end{document}

enter image description here

Of course, it's better if you define a command, for instance

\newcommand{\overblank}{\overline{\phantom{x}}}
egreg
  • 1,121,712