Drawing with TikZ · Desenhando com TikZ
Drawing inside LaTeX
- You can draw diagrams with code using the TikZ package — no image files needed.
- Load it once, then draw inside a
tikzpicture:
\draw (0,0) -- (2,1);draws a line from one point to another. Every command ends with;.
Desenhando dentro do LaTeX
- Você pode desenhar diagramas com código usando o pacote TikZ — nenhum arquivo de imagem necessário.
- Carregue-o uma vez, depois desenhe dentro de um
tikzpicture:
\usepackage{tikz}
...
\begin{tikzpicture}
\draw (0,0) -- (2,1);
\end{tikzpicture}
\draw (0,0) -- (2,1);desenha uma linha de um ponto a outro. Cada comando termina com;.
Shapes and paths
- Chain points with
--to make any shape;cyclereturns to the start:
Formas e caminhos
- Crie cadeias de pontos com
--para fazer qualquer forma;cycleretorna ao início:
\draw (0,0) -- (2,0) -- (1,1.5) -- cycle; % a triangle
\draw (0,0) circle (1); % a circle, radius 1
\draw (0,0) rectangle (3,2); % a box
Why code a drawing?
- It stays sharp at any size (it is vector graphics, not a photo).
- It is exact — perfect for geometry, graphs, and circuit diagrams.
- Now draw your own triangle in the task.
Por que codificar um desenho?
- Permanece nítido em qualquer tamanho (é vetorial, não uma foto).
- É exato — perfeito para geometria, gráficos e diagramas de circuitos.
- Agora desenhe seu próprio triângulo na tarefa.
Common mistakes
- Every
\drawcommand ends with a semicolon;. - Wrap the drawing in a
tikzpictureenvironment.
Erros comuns
- Todo comando
\drawtermina com ponto e vírgula;. - Envolva o desenho em um ambiente
tikzpicture.
Inside the tikzpicture, \draw a triangle: connect the points (0,0), (3,0) and · e (1.5,2) and close it with cycle. The tikz package is loaded for you. · Dentro de tikzpicture, \draw um triângulo: conecte os pontos (0,0), (3,0) e (1.5,2) e feche-o com cycle. O pacote tikz está carregado para você.
Draw two shapes this time. Add a circle · círculo of radius 1 with \draw (0,0) circle (1); and a rectangle with \draw (2,-1) rectangle (4,1);. · Desenhe duas formas desta vez. Adicione um círculo de raio 1 com \draw (0,0) circle (1); e um retângulo com \draw (2,-1) rectangle (4,1);.