LaTeX Graphics with TikZ

Book description

Unleash the power of LaTeX to create professional text, articles, diagrams, and charts using TikZ and its wide range of features for stunning 2D and 3D effects Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Achieve native construction of images and diagrams in your LaTex theses, articles, or books with enhanced quality
  • Discover comprehensive explanations and real-world use cases to apply in your own endavors
  • Explore customizations and tweaks to grasp the synergy of LaTeX and TikZ graphics

Book Description

In this first-of-its-kind TikZ book, you’ll embark on a journey to discover the fascinating realm of TikZ—what it’s about, the philosophy behind it, and what sets it apart from other graphics libraries. From installation procedures to the intricacies of its syntax, this comprehensive guide will help you use TikZ to create flawless graphics to captivate your audience in theses, articles, or books.

You’ll learn all the details starting with drawing nodes, edges, and arrows and arranging them with perfect alignment. As you explore advanced features, you’ll gain proficiency in using colors and transparency for filling and shading, and clipping image parts. You’ll learn to define TikZ styles and work with coordinate calculations and transformations.

That’s not all! You’ll work with layers, overlays, absolute positioning, and adding special decorations and take it a step further using add-on packages for drawing diagrams, charts, and plots.

By the end of this TikZ book, you’ll have mastered the finer details of image creation, enabling you to achieve visually stunning graphics with great precision.

What you will learn

  • Understand the TikZ language and how to use its libraries and packages
  • Draw geometric shapes with text and add arrows, labels, and decorations
  • Apply transformations and use transparency, shading, fading, and filling features
  • Define styles and program with loops to streamline your code
  • Build trees, graphs, and mind maps and draw easy curves with smooth transitions
  • Produce block diagrams and flow charts to visualize process steps
  • Generate line charts and bar charts to showcase your data
  • Plot data sets and mathematical functions in two and three dimensions

Who this book is for

This book is for LaTeX users, including students and academic authors, seeking to incorporate figures such as diagrams, plots, and graphics to their theses, articles, and books. If you’re familiar with LaTeX basics from beginner’s books or tutorials, you’ll be able to effortlessly explore the graphics topics in this book.

Table of contents

  1. LaTeX Graphics with TikZ
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share your thoughts
    9. Download a free PDF copy of this book
  6. Chapter 1: Getting Started with TikZ
    1. Technical requirements
    2. What is TikZ?
    3. Alternative graphics packages
      1. The LaTeX picture environment
      2. MetaPost
      3. Asymptote
      4. PSTricks
    4. Benefits of TikZ
    5. Installing TikZ
      1. With a vanilla TeX distribution
      2. With an operating system TeX installation
      3. Installing from sources
    6. Working with the TikZ documentation
    7. Creating our first TikZ figure
    8. Summary
    9. Further reading
  7. Chapter 2: Creating the First TikZ Images
    1. Technical requirements
    2. Using the tikzpicture environment
    3. Working with coordinates
      1. Cartesian coordinates
      2. Polar coordinates
      3. Three-dimensional coordinates
      4. Using relative coordinates
      5. Using units
    4. Drawing geometric shapes
    5. Using colors
    6. Summary
    7. Further reading
  8. Chapter 3: Drawing and Positioning Nodes
    1. Technical requirements
    2. Understanding nodes
    3. Using shapes and anchors
      1. A rectangle shape
      2. The circle and ellipse shapes
      3. The coordinate shape
      4. More shapes
    4. Spacing within and around nodes
    5. Positioning and aligning nodes
      1. Using anchors and relative positioning
      2. Placing nodes along a line
      3. Aligning nodes at the text baseline
      4. Aligning whole pictures at a node text baseline
    6. Adding labels and pins
    7. Putting images into nodes
    8. Summary
    9. Further reading
  9. Chapter 4: Drawing Edges and Arrows
    1. Technical requirements
    2. Connecting nodes by edges
    3. Adding text to edges
    4. Diving deeper into edge options
      1. Path options
      2. Connection options
    5. Drawing arrows
      1. Mathematical arrow tips
      2. Barbed arrow tips
      3. Geometric arrow tips
      4. Customizing arrow tips
    6. Using the to operation
    7. Summary
    8. Further reading
  10. Chapter 5: Using Styles and Pics
    1. Technical requirements
    2. Understanding styles
    3. Defining and using styles
    4. Inheriting styles
    5. Using styles globally and locally
    6. Giving arguments to styles
    7. Creating and using pics
    8. Summary
    9. Further reading
  11. Chapter 6: Drawing Trees and Graphs
    1. Technical requirements
    2. Drawing trees
    3. Creating mind maps
    4. Producing graphs
    5. Positioning in a matrix
    6. Summary
    7. Further reading
  12. Chapter 7: Filling, Clipping, and Shading
    1. Technical requirements
    2. Filling an area
    3. Understanding the path interior
      1. The nonzero rule
      2. The even odd rule
      3. Comparing the nonzero rule and the even odd rule
    4. Clipping a drawing
    5. Reverse clipping
    6. Shading an area
      1. Axis shading
      2. Radial shading
      3. Ball shading
      4. Bilinear interpolation
      5. Color wheel
    7. Summary
    8. Further reading
  13. Chapter 8: Decorating Paths
    1. Technical requirements
    2. Pre- and post-actions for using a path multiple times
    3. Understanding decorations
    4. Exploring the available decoration types
      1. Morphing paths
      2. Replacing paths with ticks
      3. Decorating paths with text
      4. Adding markings
    5. Adjusting decorations
    6. Summary
    7. Further reading
  14. Chapter 9: Using Layers, Overlays, and Transparency
    1. Technical requirements
    2. Using transparency
    3. Drawing on background and foreground layers
    4. Overlaying LaTeX content with TikZ drawings
    5. Positioning pictures on the background of a page
    6. Summary
    7. Further reading
  15. Chapter 10: Calculating with Coordinates and Paths
    1. Technical requirements
    2. Repeating in loops
    3. Calculating with coordinates
      1. Adding and subtracting coordinates
      2. Computing points between coordinates
      3. Projecting on a line
      4. Adding angles
    4. Evaluating loop variables
      1. Counting loop repetitions
      2. Evaluating the loop variable
      3. Remembering the loop variable
    5. Calculating intersections of paths
    6. Summary
    7. Further reading
  16. Chapter 11: Transforming Coordinates and Canvas
    1. Technical requirements
    2. Shifting nodes and coordinates
    3. Rotating, scaling, and slanting
    4. Transforming the canvas
    5. Summary
    6. Further reading
  17. Chapter 12: Drawing Smooth Curves
    1. Technical requirements
    2. Manually creating a smooth curve through chosen points
    3. Using a smooth plot to connect points
    4. Specifying cubic Bézier curves
    5. Using Bézier splines to connect given points
    6. Using the Hobby algorithm for smoothly connecting points
    7. Summary
    8. Further reading
  18. Chapter 13: Plotting in 2D and 3D
    1. Technical requirements
    2. Introducing plotting
    3. Creating and customizing Cartesian axes, ticks, and labels
      1. Understanding axis environments
      2. Customizing ticks and labels
    4. Using plotting commands and options
    5. Filling the area between plots
    6. Calculating plot intersections
    7. Adding a legend
    8. Using the polar coordinate system
    9. Parametric plotting
    10. Plotting in three dimensions
    11. Summary
    12. Further reading
  19. Chapter 14: Drawing Diagrams
    1. Technical requirements
    2. Creating flowcharts
      1. Linear flow diagrams
      2. Circular flow diagrams
    3. Building relationship diagrams
    4. Writing descriptive diagrams
    5. Producing quantitative diagrams
      1. Line charts
      2. Bar charts
      3. Pie charts
      4. Wheel charts
    6. Summary
    7. Further reading
  20. Chapter 15: Having Fun with TikZ
    1. Technical requirements
    2. Drawing cute creatures
      1. Playing with rubber ducks
      2. Meeting the TikZlings
      3. Building snowmen
      4. Playing with penguins
      5. Picturing people
    3. Playing and crafting
      1. Creating jigsaw puzzles
      2. Building with bricks
    4. Drawing world flags
  21. Index
    1. Why subscribe?
  22. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share your thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: LaTeX Graphics with TikZ
  • Author(s): Stefan Kottwitz
  • Release date: June 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804618233