From 040829303aa7146f700f28c6cf94d8678c7ac79c Mon Sep 17 00:00:00 2001 From: 3geek14 Date: Mon, 20 Sep 2021 13:01:19 -0400 Subject: [PATCH] Hadn't realized the `codeexample` environment only allowed a single `\tikz` command. Now using a `tikzpicture`. --- doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex b/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex index 7772f72b2..f12173698 100644 --- a/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex +++ b/doc/generic/pgf/text-en/pgfmanual-en-tutorial.tex @@ -1104,10 +1104,12 @@ \subsection{Repeating Things: For-Loops} rounding errors: % \begin{codeexample}[] -\tikz \foreach \x in {-1,-0.5,...,1} - \draw (\x cm,-1pt) -- (\x cm,1pt); -\tikz \foreach \x in {-1,-0.8,...,1} - \draw (\x cm,-7pt) -- (\x cm,-5pt); +\begin{tikzpicture} + \foreach \x in {-1,-0.5,...,1} + \draw (\x cm,-1pt) -- (\x cm,1pt); + \foreach \x in {-1,-0.8,...,1} + \draw (\x cm,-7pt) -- (\x cm,-5pt); +\end{tikzpicture} \end{codeexample} We can also nest loops to create interesting effects: