# How can I correct spacing issues?

When using the following code I get unsightly spaces (following the opening parentheses, after the = and between the x' and y'):

[$](\quad \overline{x+y})=\quad \overline{x}\quad \overline{y}[/$]


What am I doing wrong?

If it helps, I am using Anki with its default header and footer settings:

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

\end{document}


Also, please forgive me if I am unclear or have duplicated a question; I am new to TeX and unfamiliar with the terminology.

-
That did the trick. I assumed that it was a requisite prefix to \overline. Cheers! – somehume Oct 23 '11 at 6:28
In the previous example, this was included merely to separate the difference instances of negation. – Werner Oct 23 '11 at 6:46
That made sense to me as soon as I read your comment to remove them, thank you! – somehume Oct 23 '11 at 6:49

LaTeX provides a number of ways to print skips (blanks, or whitespace):

\def\thinspace{\kern .16667em }
\def\negthinspace{\kern-.16667em }
\def\enspace{\kern.5em }
\def\enskip{\hskip.5em\relax}


The above are in addition to using \hspace{<len>} that you can use to print whitespace of length <len>. In your specific example, \quad skips "forward" by exactly 1em, which leaves the blank spaces you witness. Removing them leaves the correct typesetting:

\documentclass{article}
\begin{document}
$(\overline{x+y})=\overline{x}\overline{y}$
\end{document}


With the introduction of some of these spaces, you can also improve the presentation by inserting (say) a \thinspace between the x and y:

\documentclass{article}
\begin{document}
$(\overline{x+y})=\overline{x}\thinspace\overline{y}$
\end{document}


For completeness, here's a table from Herbert Voss' mathmode document that illustrates some of the well-known spacing techniques/commands (Section 11.2 Additional horizontal spacing, Table 7, p 29):

-