Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Horizontal Spacing in LaTeX

📅 2010-Mar-21 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ latex, spacing, tex ⬩ 📚 Archive

LaTeX does spacing nicely most of the time. But, sometimes it becomes necessary to insert a little bit more of horizontal spacing. This might be between words of text, between math formulas or even between figures placed horizontally beside each other.

 

The following 3 TeX horizontal spacing macros can be used for this purpose:

  1. \enskip: Inserts 0.5 em of horizontal space.

  2. \quad: Inserts 1.0 em of horizontal space.

  3. \qquad: Inserts 2.0 em of horizontal space.

Inside TeX, the above are defined as:

  1. \def\enskip{\hskip.5em\relax}

  2. \def\quad{\hskip1em\relax}

  3. \def\qquad{\hskip2em\relax}

Note that em is a horizontal measurement unit and its value is dependent on the font being used. That is, it is a measurement unit that ships with a font. It is typically the width of the letter M of the font.

Reference: Pages 60 and 352 of The TeXBook by Donald E. Knuth


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧