> 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/12-latex-error-verb-ended-by-end-of-line.md).

# خطأ LaTeX: انتهى \verb بنهاية السطر

يظهر هذا الخطأ عندما تكون قد استخدمتَ **`verbatim`** أمرًا بشكلٍ غير صحيح. إذا فعلتَ ذلك، فستُنشئ الخطأ أدناه:

main.tex، السطر 5

خطأ LaTeX: انتهى \verb بنهاية السطر.

راجع دليل LaTeX أو LaTeX Companion للحصول على شرح. اكتب H للحصول على مساعدة فورية. ... l.7 \unbrace{\verb+\error+} حاول الكتابة للمتابعة. إذا لم ينجح ذلك، فاكتب X للخروج.

لحل هذا الخطأ، من الأفضل استخدام **`verbatim`** البيئة بدلًا من ذلك كما هو موضح أدناه:

```latex
\begin{verbatim}
يجب أن تدرج النص الحرفي هنا.
\end{verbatim}
```

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

**تضمين فاصل سطر داخل أمر \verb:**

أحد الأسباب الشائعة لحدوث هذا الخطأ هو إذا كنت قد استخدمتَ **`\verb`** أمرًا، ولكنك أدرجتَ فاصل سطر، كما هو موضح أدناه:

```latex
يمكننا كتابة أنماط خطوط مختلفة في \LaTeX على النحو التالي
\verb{
\textbf{عريض}
\textit{مائل}
\textsf{بدون زوائد}
}
```

سيؤدي هذا إلى إنشاء خطأ، لأن فواصل الأسطر غير مسموح بها داخل **`\verb`** الأمر. والطريقة الصحيحة لكتابة هذا هي استخدام **`verbatim`** البيئة كما هو موضح أدناه:

```latex
% في المقدمة الخاصة بك

\usepackage{verbatim}

% في المتن الرئيسي لمستندك

يمكننا كتابة أنماط خطوط مختلفة في \LaTeX على النحو التالي
\begin{verbatim}
\textbf{عريض}
\textit{مائل}
\textsf{بدون زوائد}
\end{verbatim}
```

![Verbatim.PNG](/files/37b5d64e6049e1cabababcb6440398eb2164aa08)

**حذف حرف الإنهاء في أمر \verb:**

يجب استخدام أمر verb كما هو موضح أدناه:

```latex
\verb!\frac{1}{2}!
```

لاحظ أن الفواصل هنا ليست فريدة، ويمكن استخدام أي حرف. والسبب في أننا استخدمنا **`!`** كفاصل لنا هنا هو أنه لا توجد **`!`** مكتوبة بـ **`\frac{1}{2}`**. لو كنا قد اخترنا أن نكتب **`\verb{\frac{1}{2}}`**، فسنحصل على الناتج أدناه، وهو غير صحيح.

```latex
\verb{\frac{1}{2}}
```

![Delimiters.PNG](/files/5bb58e85dbb09e672b33d5c9bb4069b8fda21379)

قد يؤدي هذا إلى مشكلات، إذ سيتم إنشاء خطأ إذا كان بداية ونهاية **`\verb`** ليسا الحرف نفسه. ولهذا السبب، ستؤدي جميع الأوامر أدناه إلى إنشاء خطأ:

```latex
\verb \frac{1}{2}
```

```latex
{\verb \frac{1}{2}}
```

```latex
\verb!\frac{1}{2}
```

مرة أخرى، يُوصى ببساطة باستخدام **`verbatim`** البيئة لكتابة ذلك كما هو موضح أدناه

```latex
\begin{verbatim}
\frac{1}{2}
\end{verbatim}
```

**استخدام أمر \verb داخل أمر آخر:**

طريقة أخرى قد يظهر بها هذا الخطأ هي إذا تم استخدام **`\verb`** أمر داخل أمر آخر كما هو موضح أدناه

```latex
\section{\verb!\frac{1}{2}!}
```

هذا غير مسموح به في LaTeX، وهو أحد الحالات القليلة التي لا تنفع فيها **`verbatim`** البيئة. ولحل هذا الخطأ، يجب عليك تحميل حزمة **`cprotect`** كما هو موضح أدناه:

```latex
% في المقدمة الخاصة بك

\usepackage{cprotect}

% في المتن الرئيسي لمستندك

\cprotect\section{هذا عنوان قسم يحتوي على نص حرفي \verb!\frac{1}{2}!}
هذا بعض النص
```

![Cprotect.PNG](/files/95d1ba6cfe008866becdeacf9fcaa38f64c5f3ed)


---

# 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/12-latex-error-verb-ended-by-end-of-line.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.
