> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ar/mzyd-mn-almwdhwaat/42-referencing-figures.md).

# الإشارة إلى الأشكال

في LaTeX، يمكننا *label* الكيانات التي تكون مرقمة (الأقسام، المعادلات، إلخ)، ثم نستخدم ذلك *label* إلى *الإشارة* إليها في موضع آخر، وتنطبق الأوامر نفسها أيضًا على بيئة الشكل (فهي مرقمة).

## أساسيات التسميات والإحالة المرجعية

```latex
\label{marker}
```

ال *العلامة* يمكن النظر إليه على أنه اسم نُعطيه للكائن الذي نريد الإشارة إليه. من المهم إضافة `\label` *بعد* عنصر مرقّم، مثلًا `\section`, `\subsection`, `\caption` إلخ، وإلا فلن "يلتصق" الوسم بالرقم أو العداد الصحيح.

```latex
\ref{marker}
```

يطبع هذا الرقم المخصص للكائن الذي تم وسمه بواسطة *العلامة*.

```latex
\pageref{marker}
```

يطبع هذا رقم الصفحة التي يظهر فيها الكائن الموسوم بواسطة *العلامة* يظهر.

## تجميع مستند LaTeX يحتوي على تسميات وإحالات مرجعية

ال *العلامة* لا يظهر النص المستخدم لوسم الكائنات في أي مكان في المستند، وتُستبدل الإشارات إليه بالأرقام المناسبة. إذا أشرنا إلى وسم غير موجود، فسيتم تجميع LaTeX بنجاح ولكن مع تحذير بشأن المراجع غير المعرّفة. ستُستبدل الإحالة إلى الوسم غير المعروف بـ *??*.

في المثال من Overleaf الوارد أعلاه، يمكنك أن ترى أننا استطعنا بنجاح إضافة إحالات إلى الأشكال المضمنة في المستند لاحقًا. ولجعل ذلك ممكنًا، يجب تشغيل LaTeX مرتين — التشغيل الأول يقوم بالتجميع ويحفظ جميع التسميات ومواضعها، وفي التشغيل الثاني تُستبدل جميع الإحالات بالأرقام المناسبة. لذلك، علينا تجميع مستندنا مرتين لرؤية الناتج الصحيح.

## استخدام أسماء ذات معنى للإشارة إلى الأشكال

بما أننا يمكن أن نستخدم أي سلسلة نصية كوسم، فمن الممارسات الشائعة إضافة بضعة أحرف إلى الوسم (كسابقة) للدلالة على ما يتم وسمه. ويصبح هذا مهمًا عندما تتم الإشارة إلى أنواع كثيرة ومختلفة من الكائنات في مستند، إذ قد يكون من المفيد تذكر نوع الكائن الذي يشير إليه الوسم. بالإضافة إلى ذلك، فإنه يجعل من الممكن أيضًا الإشارة إلى أنواع مختلفة من الكائنات باستخدام سلسلة نصية مشتركة.

على سبيل المثال، إذا كان المستند يحتوي على

* قسم عن تعداد سكان الدول،
* جدول يحتوي على أرقام السكان، و
* شكل يحتوي على مخطط أعمدة لأحجام السكان،

قد يكون من المناسب الإشارة إلى جميعها باستخدام صيغ مختلفة من *السكان*يمكن تحقيق ذلك باستخدام التسميات

* *sec:population* للقسم،
* *tab:population* للجدول، و
* *fig:population* للشكل.

فيما يلي مثال على الأشكال -

```latex
\begin{figure}[h!]
  \includegraphics[scale=1.7]{birds.jpg}
  \caption{الطيور}
  \label{fig:birds}
\end{figure}
```

مرة أخرى، لاحظ أن `\label` يُعطى *بعد* `\caption`.

&#x20;[افتح مثالًا في Overleaf](https://www.overleaf.com/project/new/template/26046?id=111048636\&templateName=Example+to+cross-reference+figures\&latexEngine=pdflatex\&texImage=texlive-full%3A2022.1\&mainFile=)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ar/mzyd-mn-almwdhwaat/42-referencing-figures.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
