> 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/alaselh-walajwbh/15-how-can-i-get-my-table-or-figure-to-stay-where-they-are-instead-of-going-to-the-next-page.md).

# كيف أجعل الجدول أو الشكل يبقيان في مكانهما بدلًا من الانتقال إلى الصفحة التالية؟

عادةً مع `\begin{figure}` أو `\begin{table}` أي. *العناصر العائمة*، فإن معرّف الموضع الافتراضي هو `[btp]`، مما يعني أن LaTeX مسموح له بوضع الشكل في \*\*`b`\*\*أسفل الصفحة/العمود؛ \*\*`t`\*\*أعلى الصفحة/العمود؛ أو إذا كان العنصر العائم طويلًا جدًا (بما في ذلك التسمية التوضيحية)، منفردًا على صفحة \*\*`ص`\*\*فحة بدون أي نص. وهذا يتبع أعراف التنضيد والنشر الاحترافيين (أي الغرض الذي صُمِّم TeX من أجله)، حيث لا يُسمح بـ"المواد العائمة" مثل الأشكال والجداول إلا في تلك المواقع: إذ يُعد أنها تعطل انسياب القراءة إذا وُضعت في منتصف الصفحة.

ومع ذلك، لا يزال بإمكاننا التأثير في المكان الذي نرغب أن يظهر فيه الشكل. إذا أضفت `[hbt!]` بعد `\begin{figure}`، مثل هذا:

```latex
\begin{figure}[hbt!]
```

فهذا يخبر LaTeX بوضع الصورة هنا مباشرةً (أقرب ما يمكن إلى الموضع في الشيفرة المصدرية)؛ أو إذا لم يكن ذلك ممكنًا (مثلًا إذا كانت كبيرة جدًا بحيث لا تتسع في الصفحة الحالية) ففي أعلى الصفحة التالية، أو أسفل الصفحة التالية. وعلامة التعجب **`!`** مهمة: فهي تخبر LaTeX «من فضلك احترم اختياراتي هنا حقًا».

ومع ذلك، إذا كان الشكل طويلًا جدًا ولم توجد مساحة كافية في الصفحة الحالية (مثلًا إذا كان بالفعل قريبًا من نهاية الصفحة الحالية)، فسيُنقَل الشكل مع ذلك إلى أعلى الصفحة التالية. في هذه الحالة قد تحاول نقل `\begin{figure}[hbt!]...\end{figure}` الكود بضع فقرات إلى موضع أبكر في الشيفرة، حيث تكون هناك مساحة متاحة أكبر في الصفحة الحالية عند تلك النقطة.

إذا لم ينجح ذلك أيضًا، وأصبحت أشكالك/جداولك قد طفت إلى الأمام لتظهر بعد `\section` العنوان، فقد تفضّل أن تظهر في نهاية القسم الحالي. عندها يمكنك إصدار `\clearpage` قبل `\section` لإدراج فاصل صفحة، والذي سيُخرج أيضًا جميع العناصر العائمة الموجودة في الطابور، قبل `\section` طباعة العنوان التالي في صفحة جديدة.

بدلًا من ذلك، ألقِ نظرة على [`placeins` الحزمة](http://texdoc.net/pkg/placeins)، حيث يمكنك إضافة `\FloatBarrier` قبل `\section`—أو أتمتة ذلك باستخدام `section` خيار الحزمة، أي اكتب `\usepackage[section]{placeins}` في المقدمة.


---

# 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/alaselh-walajwbh/15-how-can-i-get-my-table-or-figure-to-stay-where-they-are-instead-of-going-to-the-next-page.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.
