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

Adding a contour


When a text is printed over a background, it is much more readable with a contour around in overprinting the background. This contour may be white. This way, there would be a nice clearance around the text.

Another utilization would be to improve the visibility of the text with very light color for better reading on a white background.

Let's see how to achieve that.

How to do it...

Our example will use yellow color for chapter headings in a book. This is hardly readable, so we will add a contour to improve it:

  1. We will use the scrbook class, so start your document with the following:

    \documentclass{scrbook}
  2. Load the contour package. Specify the thickness of the contour and a number that stands for text copies internally used for overprinting.

    \usepackage{contour}
    \contourlength{1.5pt}
    \contournumber{25}
  3. Define a macro for the new font style for our chapter:

    \newcommand{\chapterfont}[1]{%
    \contour{black}{\textcolor{yellow}{#1}}}
  4. Apply the style that we just selected:

    \setkomafont{chapter...