> 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/akhtaa-latex/26-missing-number-treated-as-zero.md).

# رقم مفقود، وتم التعامل معه على أنه صفر

يظهر هذا الخطأ عندما تكون قد كتبت شيئًا داخل إدخال count أو dimension أو skip ليس رقمًا. إذا فعلت ذلك، فستُنشئ رسالة الخطأ أدناه:

main.tex، السطر 5

رقم مفقود، ويُعامل على أنه صفر.

l t l.8 \vspace{this should be a number} كان يجب أن يوجد رقم هنا؛ لقد أدخلتُ \`0'. (إذا لم تستطع معرفة سبب حاجتي إلى رؤية رقم، فابحث عن \`weird error' في الفهرس إلى The TeXbook.)

## الأسباب الشائعة

**نسيان تضمين رقم حيثما يكون الرقم مطلوبًا:**

أبسط طريقة يمكن أن ينشأ بها هذا الخطأ هي أن تكون قد نسيت تضمين رقم في أمرٍ يتطلب رقمًا. يوضّح المثال أدناه ذلك.

```latex
نريد إدراج بعض المسافة العمودية بين هنا

\vspace{this should be a number}

وهنا.
```

هنا **`\vspace{...}`** يَتوقع الأمر رقمًا كوسيط له، ليحدد مقدار المسافة العمودية التي يجب تركها بين النص. وبما أنه لا يوجد رقم، يظهر خطأ. والطريقة الصحيحة لكتابته هي

```latex
نريد إدراج بعض المسافة العمودية بين هنا

\vspace{6em}

وهنا.
```

![Missingnumbervspace.PNG](/files/aca2ff83e6609d53ee50b2e95cf8c538ec8ec86c)

هناك العديد من الأوامر مثل **`\vspace{...}`** التي تتطلب أرقامًا كوسيط لها. وأكثرها شيوعًا هي

* أوامر التباعد مثل:
  * **`\vspace{...}`**
  * **`\vspace*{...}`**
  * **`\hspace{...}`**
  * **`\hspace*{...}`**
* أوامر التحجيم، مثل **`\includegraphics[scale = 0.7]{image}`**. سيؤدي هذا إلى تحجيم صورتك لتصبح **`0.7`** مرات حجمها الفعلي. والخيارات الأخرى المتاحة هنا التي تتطلب أرقامًا هي:
  * **`العرض`**
  * **`الارتفاع`**
  * **`page`**
  * **`الدقة`**
  * **`القص`**
  * **`زاوية`**.
* ال **`\linebreak[number]`** أمر، حيث يحدد الوسيط عدد الأسطر التي تريد تخطيها.
* أوامر العدادات مثل:
  * **`\addtocounter{mycounter}{number}`**
  * **`\setcounter{mycounter}{number}`**
* أوامر ضبط الطول مثل **`\setlenght{\lengthname}{number}`**. سيؤدي هذا إلى تغيير قيمة طول معيّن مثل **`\textwidth`** إلى القيمة **`number`** (مثل **`\setlength{\textwidth}{1in}`**).
* أوامر خيارات الجداول مثل **`\multicolumn{number}{c}{Table entry}`**.

**وجود فاصل سطر \\\ متبوعًا بأقواس مربعة:**

إذا كان أمر فاصل السطر **`\\`** يتبعه في أي وقت أقواس مربعة **`[...]`**، فسيُؤخذ على أنه وسيط اختياري، وبالتالي سيُتوقع وجود رقم داخل الأقواس المربعة. وهذا صحيح حتى لو وُجدت مسافات بيضاء وأسطر جديدة بين **`\\`** و **`[...]`** الأوامر. تظهر هذه المشكلة غالبًا في الجداول، كما هو موضح أدناه:

```latex
\begin{tabular}{c|c}
    [x] &  2\\
    [x]^2 & 4
\end{tabular}
```

سيولّد هذا خطأ، إذ في السطر الثالث لدينا فاصل سطر متبوع بأقواس مربعة. تتوقع LaTeX رقمًا داخل الأقواس المربعة، لكنها تجد بدلًا من ذلك **`x`**. والطريقة الصحيحة لكتابة الجدول أعلاه هي تضمين الأقواس المربعة داخل أقواس معقوفة **`{...}`** كما هو موضح أدناه:

```latex
\begin{tabular}{c|c}
    [x] &  2\\
    {[x]}^2 & 4
\end{tabular}
```

**استخدام حزمة subfigure:**

ال **`subfigure`** هي حزمة قديمة جدًا، وستولّد خطأ 'Missing number' عندما لا يكون هناك خطأ أصلًا. مثال على ذلك موضح أدناه:

```latex
% في المقدمة
\usepackage{subfigure}

% في متن المستند
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\textwidth}
        \includegraphics[scale=0.2]{image}
        \caption{A gull}
        \label{fig:gull}
    \end{subfigure}%
\end{figure}
```

سيولّد هذا خطأ، لأن حزمة subfigure لا تتعرّف على **`\textwidth`** بوصفه رقمًا، مع أنه في الواقع رقم (مكافئ للعرض الثابت لكتلة النص الكلية على الصفحة). وطريقة حل ذلك هي استخدام الحزمة الأحدث **`subcaption`** التي حلت محل **`subfigure`**. وكتابة الشيفرة نفسها أعلاه باستخدام **`\usepackage{subcaption}`** في المقدمة بدلًا من **`\usepackage{subfigure}`** ستعطي النتيجة المطلوبة من دون أي خطأ.


---

# 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/akhtaa-latex/26-missing-number-treated-as-zero.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.
