Chapter 1 – Getting started with TikZ

Here are the Code examples of this chapter. You can compile them online right on this web page by pressing the Typeset / Compile button. You can also edit them for testing, and compile again.

For a better view with the online compiler, I use \documentclass[border=10pt]{standalone} instead of \documentclass{article}. Instead of having a big letter/A4 page, the standalone class crops the paper to see just the visible text without an empty rest of a page.

Any question about a code example? Post it on, I will answer. As forum admin I read every single question there. (profile link).

Classic picture mode example


First TikZ drawing

\draw circle (0.5);
\draw (-0.5,0) to ["text"] (0.5,0);