> 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/07-extra-alignment-tab-has-been-changed-to-cr.md).

# تم تغيير لسان المحاذاة الإضافي إلى \cr

يحدث هذا الخطأ عندما يقوم LaTeX بصفّ جدول ويكتشف رمز محاذاة (`&`) حيث لم يتوقع وجود واحد. يستخدم LaTeX رموز المحاذاة لفصل أعمدة الجدول، وسيقوم [سيعترض](#a-short-note-on-the-cr-command) إذا حاول جدول استخدام أعمدة أكثر من المتوقع.

## خطأ ناتج عن بيئة tabular

تُعدّ بيئة tabular مصدرًا شائعًا لهذا الخطأ، كما يوضحه المثال التالي. هنا، كتبنا `{c|c|c}` لتحديد جدولٍ بثلاثة أعمدة (متمركزة)، أي أن كل صف في الجدول يجب أن يحتوي على ثلاث خلايا.

```latex
\begin{tabular}{c|c|c} % تحديد 3 أعمدة متمركزة
   1 & 2 & 3 & 4\\ % خطأ: يستخدم 4 أعمدة، لا 3
   5 & 6 & 7\\
\end{tabular}
```

[افتح هذا **المولِّد للخطأ** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Example+of+a+tabular+with+too+many+alignment+characters\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Btabular%7D%7Bc%7Cc%7Cc%7D+%25+Specify+3+centered+columns%0A+++1+%26+2+%26+3+%26+4%5C%5C+%25+ERROR%3A+Uses+4+columns%2C+not+3%0A+++5+%26+6+%26+7%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bdocument%7D)

يُنتج مثالنا رسالة الخطأ التالية:

![عرض خطأ جدول LaTeX "تبويب محاذاة إضافي تم تغييره إلى \cr"](/files/2cc5cdba996ed6ca87f40f7a767e2fa68e18a4d1)

ويُصفّ هذا الجدول:

![](/files/4f139c58552eac0e7ea32fb6d101967ffe377288)

### شرح الخطأ

أول `&` في صفّ الجدول يدل على بداية *ثاني* العمود؛ وبالتالي، بالنسبة لجدولٍ من ثلاثة أعمدة يتوقع LaTeX أن يرى *عنصرين* رموز المحاذاة قبل كل فاصل سطر (`\\`). ومع ذلك، يستخدم الصف الأول من جدولنا *ثلاثة* رموز محاذاة، مما يربك LaTeX، فيجعله يغيّر رمز المحاذاة غير المتوقع إلى [`\cr` الأمر](#a-short-note-on-the-cr-command)—محاولة لتقليل عدد الأعمدة إلى ثلاثة. لاحظ أن استخدام *ثلاثة* رموز المحاذاة يتطلب *أربعة* الأعمدة.

### كيفية إصلاح الخطأ

لحل هذا الخطأ وإصلاح جدولنا، يمكننا إما:

* إزالة العمود الإضافي بحذف الإدخال
* إضافة عمود إضافي إلى خيارات بيئة tabular (مثل كتابة `{c|c|c|c}`)
* إنشاء سطر جديد (صف جدول جديد)

إليك مثال يوضح كلًّا من هذه الحلول:

```latex
\section*{إزالة إدخال العمود الإضافي}

\begin{center}
\begin{tabular}{c|c|c}
   1 & 2 & 3\\
   5 & 6 & 7\\
\end{tabular}
\end{center}

\section*{إضافة عمود إضافي إلى tabular}

\begin{center}
\begin{tabular}{c|c|c|c}
   1 & 2 & 3 & 4\\
   5 & 6 & 7\\
\end{tabular}
\end{center}

\section*{إنشاء سطر جديد (صف جدول جديد)}

\begin{center}
\begin{tabular}{c|c|c}
   1 & 2 & 3 \\
   4 &   &   \\
   5 & 6 & 7 \\
\end{tabular}
\end{center}
```

[افتح هذا المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Options+for+correcting+a+tablular+error\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5Csection%2A%7BRemoving+the+extra+column+entry%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Bc%7Cc%7Cc%7D%0A+++1+%26+2+%26+3%5C%5C%0A+++5+%26+6+%26+7%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Csection%2A%7BAdding+an+extra+column+to+the+tabular%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Bc%7Cc%7Cc%7Cc%7D%0A+++1+%26+2+%26+3+%26+4%5C%5C%0A+++5+%26+6+%26+7%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Csection%2A%7BCreating+a+new+line+%28new+table+row%29%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Bc%7Cc%7Cc%7D%0A+++1+%26+2+%26+3+%5C%5C%0A+++4+%26+++%26+++%5C%5C%0A+++5+%26+6+%26+7+%5C%5C%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%5Cend%7Bdocument%7D)

ينتج هذا المثال المخرجات التالية:

![إصلاح أخطاء tabular](/files/8a32629e6944f5f0d3b88063fe2431fd8f815739)

## أخطاء ناتجة عن بيئات الرياضيات

غالبًا ما يتطلب التنضيد الرياضي محاذاة العناصر الرياضية، ويتم ذلك باستخدام بيئات مثل `array`, `المصفوفة`، وغيرها الكثير. يمكن لبعض بيئات الرياضيات أن تؤدي إلى خطأ تبويب المحاذاة الإضافي لأنها تستخدم جدولًا لإجراء المحاذاة، كما هو موضح في الأمثلة التالية.

### بيئة array

سيُنتج LaTeX خطأً إذا تجاوز عدد علامات المحاذاة المستخدمة في صفّ array عدد أعمدة array. إليك مثالًا يستخدم مصفوفة بثلاثة أعمدة، لكن الصف الأول يحاول استخدام أربعة أعمدة:

```latex
\[
\begin{array}{lcl}
g(x) & = & (x+2)^2 & = (x+2)(x+2)\\ % هذا الصف يُحدث الخطأ
& = & x^2+4x+4\\
\end{array}
\]
```

[افتح هذا **المولِّد للخطأ** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=An+array+with+too+many+alignment+characters\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5B%0A%5Cbegin%7Barray%7D%7Blcl%7D%0Ag%28x%29+%26+%3D+%26+%28x%2B2%29%5E2+%26+%3D+%28x%2B2%29%28x%2B2%29%5C%5C+%25+This+row+triggers+the+error%0A%26+%3D+%26+x%5E2%2B4x%2B4%5C%5C%0A%5Cend%7Barray%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

ينتج هذا المثال رسالة الخطأ التالية:

![صورة تُظهر خطأ في مصفوفة LaTeX بسبب كثرة علامات الجدولة](/files/6cd2caf00d7db718b4ccb640f101853a44a6c0af)

ويُصفّ هذه المصفوفة:

$$\begin{array}{lcl} g(x) & = & (x+2)^2 \ =(x+2)(x+2) \ & = & x^2+4x+4\ \end{array}$$

لإصلاح هذا الخطأ، أعد كتابة المصفوفة كما يلي:

```latex
\[
\begin{array}{lcl}
g(x) & = & (x+2)^2 \\
& = & (x+2)(x+2) \\
& = & x^2+4x+4\\
\end{array}
\]
```

[افتح هذا **مصحح** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Corrected+version+of+the+array+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5B%0A%5Cbegin%7Barray%7D%7Blcl%7D%0Ag%28x%29+%26+%3D+%26+%28x%2B2%29%5E2+%5C%5C%0A%26+%3D+%26+%28x%2B2%29%28x%2B2%29+%5C%5C%0A%26+%3D+%26+x%5E2%2B4x%2B4%5C%5C%0A%5Cend%7Barray%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

تُنتج المصفوفة المصححة ما يلي:

$$\begin{array}{lcl} g(x) & = & (x+2)^2 \ & = & (x+2)(x+2) \ & = & x^2+4x+4\ \end{array}$$

### بيئات المصفوفات في amsmath

ال `amsmath` توفّر الحزمة العديد من البيئات لتنسيق المصفوفات، بما في ذلك `المصفوفة`, `pmatrix`, `bmatrix`, `Bmatrix`, `vmatrix`، و `Vmatrix`.

المثال التالي `pmatrix` يحاول استخدام 12 عمودًا لكنه ينتج خطأً لأن `amsmath` تحدد حدًا أقصى افتراضيًا يبلغ 10 أعمدة في المصفوفات المنسقة.

```latex
\documentclass{article}
\usepackage{amsmath} % للوصول إلى بيئة المصفوفة
\begin{document}
\[
\begin{pmatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} & a_{1,6} & a_{1,7} & a_{1,8} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} \\
\end{pmatrix}
\]
\end{document}
```

[افتح هذا **المولِّد للخطأ** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=A+pmatrix+with+too+many+columns\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D+%25+To+access+the+matrix+environment%0A%5Cbegin%7Bdocument%7D%0A%5C%5B%0A%5Cbegin%7Bpmatrix%7D%0Aa_%7B1%2C1%7D+%26+a_%7B1%2C2%7D+%26+a_%7B1%2C3%7D+%26+a_%7B1%2C4%7D+%26+a_%7B1%2C5%7D+%26+a_%7B1%2C6%7D+%26+a_%7B1%2C7%7D+%26+a_%7B1%2C8%7D+%26+a_%7B1%2C9%7D+%26+a_%7B1%2C10%7D+%26+a_%7B1%2C11%7D+%26+a_%7B1%2C12%7D+%5C%5C%0A%5Cend%7Bpmatrix%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

لإصلاح الخطأ، غيّر الحد الأقصى للأعمدة إلى 12 بكتابة `\setcounter{MaxMatrixCols}{12}`، أو أي قيمة تختارها.

```latex
\documentclass{article}
\usepackage{amsmath} % للوصول إلى بيئة pmatrix
\setcounter{MaxMatrixCols}{12}
\begin{document}
\[
\begin{pmatrix}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4} & a_{1,5} & a_{1,6} & a_{1,7} & a_{1,8} & a_{1,9} & a_{1,10} & a_{1,11} & a_{1,12} \\
\end{pmatrix}
\]
\end{document}
```

[افتح هذا **مصحح** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=A+pmatrix+with+12+columns\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D+%25+To+access+the+pmatrix+environment%0A%5Csetcounter%7BMaxMatrixCols%7D%7B12%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5B%0A%5Cbegin%7Bpmatrix%7D%0Aa_%7B1%2C1%7D+%26+a_%7B1%2C2%7D+%26+a_%7B1%2C3%7D+%26+a_%7B1%2C4%7D+%26+a_%7B1%2C5%7D+%26+a_%7B1%2C6%7D+%26+a_%7B1%2C7%7D+%26+a_%7B1%2C8%7D+%26+a_%7B1%2C9%7D+%26+a_%7B1%2C10%7D+%26+a_%7B1%2C11%7D+%26+a_%7B1%2C12%7D+%5C%5C%0A%5Cend%7Bpmatrix%7D%0A%5C%5D%0A%5Cend%7Bdocument%7D)

يُنتج المثال المصحح المصفوفة التالية:

$$\begin{pmatrix} a\_{1,1} & a\_{1,2} & a\_{1,3} & a\_{1,4} & a\_{1,5} & a\_{1,6} & a\_{1,7} & a\_{1,8} & a\_{1,9} & a\_{1,10} & a\_{1,11} & a\_{1,12} \ \end{pmatrix}$$

## ملاحظة قصيرة حول الأمر \cr

يعالج LaTeX مشكلة رمز المحاذاة غير المتوقع باستبداله بأمر أساسي معروف باسم `\cr`، وهو جزء لا يتجزأ من الآلية الداخلية في LaTeX لإنهاء صف الجدول. وعلى الرغم من أن المستخدمين يستخدمون الماكرو في LaTeX `\\` للإشارة إلى نهاية صف الجدول، فإنه في الواقع `\cr` الأمر الذي يُنفَّذ في الخلفية لإنهاء الصف عندما تتم معالجة الماكرو `\\` .


---

# 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/07-extra-alignment-tab-has-been-changed-to-cr.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.
