Book Image

LaTeX Cookbook

By : Stefan Kottwitz
Book Image

LaTeX Cookbook

By: Stefan Kottwitz

Overview of this book

LaTeX is a high-quality typesetting software and is very popular, especially among scientists. Its programming language gives you full control over every aspect of your documents, no matter how complex they are. LaTeX's huge amount of customizable templates and supporting packages cover most aspects of writing with embedded typographic expertise. With this book you will learn to leverage the capabilities of the latest document classes and explore the functionalities of the newest packages. The book starts with examples of common document types. It provides you with samples for tuning text design, using fonts, embedding images, and creating legible tables. Common document parts such as the bibliography, glossary, and index are covered, with LaTeX's modern approach.You will learn how to create excellent graphics directly within LaTeX, including diagrams and plots quickly and easily. Finally, you will discover how to use the new engines XeTeX and LuaTeX for advanced programming and calculating with LaTeX. The example-driven approach of this book is sure to increase your productivity.
Table of Contents (19 chapters)
LaTeX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 points should be improved:

  • The subscripts below the operators on the left-hand side of the equation are vertically misaligned

  • The wide space around the sum symbol doesn't look good

  • The exponent 2 is a bit higher than the parentheses...