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

Fitting text to a shape


There are occasions when text is not strictly arranged in a rectangular box. For example, if you would like to print a label for a DVD or compact disc, the text should be arranged in a circle.

How to do it...

The shapepar package can typeset paragraphs in a specific shape, such as a circle, a hexagon, or a heart. The shape size will be adjusted so the given text fits in. We will now try it with a heart:

  1. Make a small document, load the packages blindtext (for dummy text) and the shapepar package:

    \documentclass{article}
    \usepackage{blindtext}
    \usepackage{shapepar}
  2. In the document, use the \shapepar command with the shape argument, and then text as follows:

    \begin{document}
    \shapepar{\heartshape}\blindtext[2]
    \end{document}
  3. Compile and have a look:

How it works...

We loaded the blindtext package, which provides filler text via the \blindtext command, which is great for testing. Then we loaded the shapepar package.

That package provides the command \shapepar, which is used as...