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

Stacking images


We can also stack images on top of each other, such as for a fancy photo collage. This can be combined with the previous recipes to do things like rotating and framing. Let's take a look at pure stacking.

How to do it...

The stackengine package allows the placement of things above each other. It can handle text and math as well as images. Let's try it with the latter, using sample images. Follow these steps:

  1. In your document preamble, load the mwe package. It provides dummy images and automatically loads the graphicx package, which we would otherwise load ourselves, as before:

    \usepackage{mwe}
  2. Load the stackengine package:

    \usepackage{stackengine}
  3. In the document body, use the command \stackinset. It takes six arguments. This sounds complicated, but it allows flexible positioning. The syntax is as follows:

    \stackinset{horizontal alignment}
        {horizontal offset}
        {vertical aligment}
        {vertical offset}
        {image above}{image below}

    In our recipe, we use right and top alignment...