> 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/qaadh-almarfh/029-code-check.md).

# فحص الشفرة

يتضمن محرر Overleaf أداة للتحقق من الصياغة (المعروفة باسم "Code Check") والتي تبرز الأخطاء الشائعة أثناء الكتابة.

الأخطاء التي يمكن أن يعثر عليها Code Check هي:

* غير متطابقة `\begin` و `\end` الأوامر
* فواصل مجموعات LaTeX غير المتطابقة `{ }`
* غير متطابقة `\left` و `\right` الفواصل
* فواصل وضع الرياضيات غير المتطابقة `$..$` و `$$..$$`
* أوامر الرياضيات المستخدمة خارج وضع الرياضيات
* أوامر النص المستخدمة داخل وضع الرياضيات

يستخدم Code Check الاستدلالات ويَفترض أن المستند هو LaTeX نموذجي، ويستخدم الأوامر القياسية فقط، على سبيل المثال كل `\begin{}` له مقابل `\end{}`.

## قيود Code Check

إذا كان مشروعك يستخدم ماكروات LaTeX أو TeX الخاصة بك، أو حزمًا تغيّر السلوك القياسي لـ LaTeX، فقد تجد أن Code Check يحتاج إلى إيقافه -- ويمكنك فعل ذلك على مستوى عام، أو لملف واحد، أو لجزء من ملف.

على وجه الخصوص، إذا كنت تستخدم ماكروات كاختصارات لبيئات LaTeX القياسية (مثل `\newcommand{\beq}{\begin{equation}}`) فلن يتم توسيعها ويجب عليك تعطيل Code Check.

## تعطيل Code Check على مستوى عام

إذا لم تكن تريد استخدام Code Check إطلاقًا، يمكنك إيقافه في القائمة اليسرى: انقر فوق أيقونة قائمة Overleaf أعلى لوحة قائمة الملفات، ثم ابحث عن "الإعدادات - Code Check".

## تعطيل Code Check لملف واحد

لإيقاف Code Check لملف واحد، ضع التعليق `%%novalidate` في أعلى الملف. (ملاحظة: لتجنب التعارضات نستخدم محرف تعليق مزدوج).

```latex
%%novalidate

% تعريفات ماكرو معقدة أو أشكال Tikz
% ...
```

## تعطيل Code Check لجزء من ملف

يمكنك أيضًا إيقاف Code Check لجزء من ملف

```latex
يتم التحقق من هذا الجزء من الملف بواسطة Code Check

%%begin novalidate
هذا الجزء لا يتم التحقق منه
%%end novalidate

سيتم أيضًا التحقق من هذا الجزء بواسطة Code Check
```

## المشكلات المعروفة

* الأوامر Url وverbatim والأوامر الأخرى التي يكون فيها `%` حرفًا حرفيًا يمكن أن تسبب أخطاءً كاذبة عندما يكون هناك كود LaTeX لاحق في السطر نفسه الذي يوجد فيه الأمر. والحل البديل هو بدء سطر جديد بعد أي `\url{}` أو أوامر أخرى تحتوي على حرف `%` حرفية.
* الأوامر التي تستخدم صياغة LaTeX3 مع شرطات سفلية في أسماء الماكرو.
* تعريفات الأوامر المخصصة التي تفصل `\begin{...}` من `\end{...}` التصريحات


---

# 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/qaadh-almarfh/029-code-check.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.
