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

Application in graph theory


In graph theory, models and drawings often consist mostly of vertices, edges, and labels. So, it may be possible to use a simpler language to generate a diagram of a graph.

How to do it...

The tkz-graph package offers a convenient interface. We will create a diagram with it as follows:

  1. Begin with any document class:

    \documentclass{standalone}
  2. Load the tkz-graph package:

    \usepackage{tkz-graph}
  3. Specify a basic style:

    \GraphInit[vstyle = Shade]
  4. Customize element styles as desired using standard TikZ syntax:

    \tikzset{
      LabelStyle/.style = { rectangle, rounded corners,
                            draw, minimum width = 2em,
                            fill = yellow!50,
                            text = red, font = \bfseries },
      VertexStyle/.append style = { inner sep=5pt,
                                    font = \Large\bfseries},
      EdgeStyle/.append style = {->, bend left} }
  5. Begin the document:

    \begin{document}
  6. Start a tikzpicture environment:

    \begin{tikzpicture}
  7. Set the distance between...