Chapter 1 – Getting started with TikZ

Here are the Code examples of this chapter. These pages will be updated over time (sectioning, adding pictures, captions, and possibly further examples). I will synchronize the content with GitHub. Finally, the chapter pages and Code examples will be moved to a dedicated website TikZ.org.

Classic picture mode example

\documentclass[border=10pt]{standalone}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(1,1)
  \put(0,0){\circle{1}}
  \put(-0.5,0){\line(1,0){1}}
  \put(-0.3,0.06){text}
\end{picture}
\end{document}

First TikZ drawing

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{quotes}
\begin{document}
\begin{tikzpicture}
\draw circle (0.5);
\draw (-0.5,0) to ["text"] (0.5,0);
\end{tikzpicture}
\end{document}