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

Getting the sans serif mathematics font


There are situations where the sans-serif font is required for documents. It can be, for example, a requirement by the university or institute. It may even be a design decision, for example, presentation slides often use sans serif. It's the default behavior of the LaTeX beamer class.

You can switch to sans serif for the default text font family using this command:

\renewcommand{\familydefault}{\sfdefault}

In such a case, it's desirable to print math formulas in sans serif as well to get a consistent design. The beamer class already does this.

In this recipe, we will do that for an arbitrary class. We will change all math formulas to have a sans serif font.

How to do it...

We will use the sfmath package. Follow these steps to get sans serif math formulae:

  1. Load the sfmath package. Do it after loading the font packages or commands that change the \sfdefault command:

    \usepackage{sfmath}
  2. If you use the default font, that is, Computer Modern, additionally load sansmathaccent...