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 a Venn diagram


A Venn diagram displays several sets with their relationships. Commonly, these are overlapping circles. Such sets can stand for certain properties. If an element has two such properties, it will belong to an overlapping area-the intersection of the two relevant sets.

In this recipe, we will draw a Venn diagram of three sets.

How to do it...

We will draw colored circles and apply blending to their intersections. Go through these steps:

  1. Choose a document class:

    \documentclass{article}
  2. Load the tikz package:

    \usepackage{tikz}
  3. Begin the document:

    \begin{document}
  4. Begin a TikZ picture environment:

    \begin{tikzpicture}
  5. Use a scope environment to apply a style to a part of the drawing. Here, we apply color blending:

      \begin{scope}[blend group=soft light]
  6. Draw the diagram parts, which in our case are simply filled circles:

        \fill[red!30!white]   ( 90:1.2) circle (2);
        \fill[green!30!white] (210:1.2) circle (2);
        \fill[blue!30!white]  (330:1.2) circle (2);
  7. End the scope environment...