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

Drawing over an image


If you need to add text, arrows, or other annotations to an image, it's preferable to do so within LaTeX. Compared to using external graphics software, there are a few advantages:

  • You can use the same fonts as in the LaTeX document

  • Your annotations would be scalable in perfect quality, even if you would draw over a bitmap image

  • You can use macros from your preamble or packages

  • The style would be consistent with your other drawings and diagrams

  • You can change it at any time, and document-wide adjustments also have their desired effects on this annotated image

How to do it…

We will draw with TikZ. The key is using the onimage package. If this is not available in your TeX distribution or on CTAN, you can download it from Launchpad at http://bazaar.launchpad.net/~tex-sx/tex-sx/development/view/head:/onimage.dtx.

Follow these steps:

  1. Within the LaTeX document preamble, load the onimage package:

    \usepackage{onimage}
  2. Define TikZ styles for your annotations:

    \tikzset{annotations/.style...