Drawing with TikZ · الرسم باستخدام TikZ
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · تحتاج هذه الصفحة إلى متصفح حديث (يدعم 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:
\draw (0,0) -- (2,1);draws a line from one point to another. Every command ends with;.
العربية
الرسم داخل LaTeX
- يمكنك رسم مخططات بالأكواد باستخدام حزمة TikZ — لا حاجة لملفات صور.
- حمّله مرة واحدة، ثم ارسم داخل
tikzpicture:
\usepackage{tikz}
...
\begin{tikzpicture}
\draw (0,0) -- (2,1);
\end{tikzpicture}
- يرسم
\draw (0,0) -- (2,1);خطاً من نقطة إلى أخرى. ينتهي كل أمر بـ;.
English
Shapes and paths
- Chain points with
--to make any shape;cyclereturns to the start:
العربية
الأشكال والمسارات
- اربط النقاط بـ
--لصنع أي شكل؛ يُعيدcycleإلى البداية:
\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
- Every
\drawcommand ends with a semicolon;. - Wrap the drawing in a
tikzpictureenvironment.
العربية
أخطاء شائعة
- ينتهي كل أمر
\drawبنقطة منقوطة;. - غلف الرسم في بيئة
tikzpicture.
Inside the tikzpicture, \draw a triangle: connect the points (0,0), (3,0) and (1.5,2) and close it with cycle. The tikz package is loaded for you. · داخل tikzpicture، ارسم \draw مثلثاً: وصل النقاط (0,0)، (3,0) و(1.5,2) وأغلقه بـ cycle. حزمة tikz محملة مسبقاً لك.
Click Run to compile and preview the PDF. · اضغط تشغيل لتركيب وعرض ملف PDF.
Draw two shapes this time. Add a circle of radius 1 with \draw (0,0) circle (1); and a rectangle with \draw (2,-1) rectangle (4,1);. · ارسم شكلاًين هذه المرة. أضف دائرة نصف قطرها 1 باستخدام \draw (0,0) circle (1); ومستطيل باستخدام \draw (2,-1) rectangle (4,1);.
Click Run to compile and preview the PDF. · اضغط تشغيل لتركيب وعرض ملف PDF.