TikZ graphics in LaTeX

Contents
First picture
Nodes and edges
Plots with pgfplots
Styles keep it consistent
Externalize slow pictures

First picture

TikZ draws vector graphics from code, so diagrams match the document fonts automatically. Load the package and open a picture:

\usepackage{tikz} \begin{tikzpicture} \draw (0,0) -- (2,1) -- (0,2) -- cycle; \end{tikzpicture}

Nodes and edges

Most diagrams are boxes with arrows. Nodes place the boxes, edges connect them, and the arrows library supplies the tips:

\usetikzlibrary{arrows.meta} \node (a) at (0,0) {Start}; \node (b) at (3,0) {End}; \draw[-{Stealth}] (a) -- (b);

Plots with pgfplots

For function plots and data charts use pgfplots on top of TikZ: axes, legends and grid come free, and the plot inherits the document style instead of looking pasted from a spreadsheet.

Styles keep it consistent

Define node and edge styles once in the preamble and reference them everywhere: ten diagrams stay visually identical, and a rebrand means editing three lines instead of thirty pictures. Name styles by meaning (process, decision, data), never by appearance (bluebox), or the names lie after the first redesign.

Externalize slow pictures

Complex pictures recompile on every run and eventually dominate build time. The external library compiles each tikzpicture once into a PDF and reuses it until the source changes — minutes back on every draft cycle for one preamble line.

Related articles
LaTeX
TikZ graphics
Beamer presentations
All LaTeX symbols
Banner image

Search this site

Channel @aofeed Chat @aofeedchat

Contacts and cooperation:
I recommend our hosting beget.ru
Write to info@urn.su, info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: