1

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}[/$]

Bad spacing

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.

gernot
  • 49,614
somehume
  • 237

1 Answers1

4

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}
\def\quad{\hskip1em\relax}
\def\qquad{\hskip2em\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:

enter image description here

\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:

enter image description here

\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):

enter image description here

Werner
  • 603,163