Fine-tuning math formulas

Though LaTeX's typesetting of formulas is usually excellent, there are situations when the layout can require improvement. This recipe shows quick fixes.

Getting ready

Let's have a look at misalignment and spacing, issues with subscript and superscript that can easily occur:

  1. Open the following sample document with your LaTeX editor. You can take it from the code archive provided with the book or copy and paste from the e-book:
    \documentclass{article}
    \usepackage{dsfont}
    \begin{document}
    \[
      \lim_{n\to\infty} \sup_{x\in\mathds{R}} f_n(x^2)
        < n \Big(\sum_{x\in\mathds{R}, n\in\mathds{N}}
        \big| f_n(x^2) \big| \Big)
    \]
    \end{document}
  2. Compile, and take a look at the formula:

Although the LaTeX code is fine, you will notice that several ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.