More fully than the title: When does TikZ either require or forbid a semicolon at the end of a command?
Learning TikZ I naturally go on line and copy instructions for drawings like the ones I want to make. A lot of these examples have a semicolon after each command, which seems to be what the TikZ manual does.
But many other examples, with many command in them, use no semicolons, and still work fine for me. I tried adding a semicolon at the end of each command in one of these it still worked. But can adding a semicolon at the end of a command sometimes cause trouble?
What is the general rule?
As the comment requests here is a TikZ drawing that works for me, with no semicolons:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tkz-euclide}
\usetikzlibrary{calc,through,intersections}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\tkzDefPoint(2,2){A}
\tkzDefPoint(5,-2){B}
\tkzDefPoint(1,-2){C}
\tkzDefCircle[in](A,B,C)
\tkzGetPoint{I} \tkzGetLength{rIN}
\tkzDefCircle[circum](A,B,C)
\tkzGetPoint{K} \tkzGetLength{rCI}
\tkzDrawPoints(A,B,C,I,K)
\tkzDrawCircle[R,blue](I,\rIN pt)
\tkzDrawCircle[R,red](K,\rCI pt)
\tkzLabelPoints[below](B,C)
\tkzLabelPoints[above left](A,I,K)
\tkzDrawPolygon(A,B,C)
\end{tikzpicture}
\end{document}
tikz
commands. They aretkz
commands defined by thetkz-euclide
package. And as @cfr notes, you can define commands with semicolons inside them which therefore don't themseleves require semicolons, which is whattkz-euclide
does.tkz-euclide
defines those macros such that the definitions of the macros include the semicolons. Hence, you don't need to add them yourself. But TikZ is still dependent on the semicolons. They are just hidden behind thetkz
obfuscation.