Drawing with TikZ
تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
English
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:
\usepackage{tikz}
...
\begin{tikzpicture}
\draw (0,0) -- (2,1);
\end{tikzpicture}
\draw (0,0) -- (2,1);draws a line from one point to another. End a drawing path with;.

English
Shapes and paths
- Chain points with
--to make any shape;cyclereturns to the start:
\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
English
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.
English
Common mistakes
- A
\drawwithout its;. TikZ gives! Package tikz Error: Giving up on this path. Did you forget a semicolon?. - Forgetting
\usepackage{tikz}. LaTeX stops with! LaTeX Error: Environment tikzpicture undefined. - Mixing up
(x,y)order. The first number is across, the second is up:(3,1)is 3 right and 1 up.
الصعوبة 3/5 · 200 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Inside the tikzpicture, \draw a triangle: connect the points (0,0), (3,0) و (1.5,2) and close it with cycle. The tikz package is loaded for you.
اضغط تشغيل لتركيب وعرض ملف PDF.
الصعوبة 3/5 · 200 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Draw two shapes this time. Add a دائرة of radius 1 with \draw (0,0) circle (1); and a rectangle with \draw (2,-1) rectangle (4,1);.
اضغط تشغيل لتركيب وعرض ملف PDF.
الصعوبة 3/5 · 200 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Draw an x-axis with an arrow and a label: \draw[->] (0,0) -- (4,0) node[right] {$x$};. The [->] option adds the arrowhead, and node writes text at the end.
اضغط تشغيل لتركيب وعرض ملف PDF.