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 ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.