> 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/05-double-superscript.md).

# رمز علوي مزدوج

## مقدمة

حسب الاصطلاح، يستخدم LaTeX حرف القبعة (`^`) لكتابة نص علوي، مثل `$a^b$` الذي ينتج $$a^b$$. إذا كتبت `$a^bcde$`، يكون الحرف الأول فقط، `b`، هو نص علوي، كما في $$a^bcde$$، لأن LaTeX لا *يفترض* تريد جعل مجموعة الأحرف كاملة نصًا علويًا `bcde`. ولتنضيد عدة عناصر (رموز) كنصوص علوية، عليك أن تخبر LaTeX بذلك بوضعها داخل مجموعة `{...}`، مثل هذا: `$a^{bcde}$`، والذي ينتج $$a^{bcde}$$.

## خطأ النص العلوي المزدوج

ينشأ خطأ النص العلوي المزدوج عندما يُطلب من LaTeX إضافة نص علوي إلى جزء من الصياغة الرياضية الذي *يحتوي بالفعل على* يوجد به نص علوي بالفعل. وعادةً ما يُحل هذا الخطأ باستخدام الأقواس المعقوفة `{...}`، والتي تُنشئ، داخل وضع الرياضيات، ما يُسمّى *صيغة فرعية*—وهو مصطلح يُستخدم لوصف جزء من التعبير الرياضي الذي تحاول تنسيقه.

على سبيل المثال، عند كتابة `$a^b^c$` يؤدي إلى ظهور خطأ النص العلوي المزدوج التالي:

![خطأ نص علوي مزدوج ظاهر في Overleaf](/files/2e6b03403fb0f270e394672ace8aff3c932dd9e8)

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

* `$a^{b^c}$` يُنسّق $$a^{b^c}$$
* `${a^b}^c$` يُنسّق $${a^b}^c$$
* `$a^{bc}$` يُنسّق $$a^{bc}$$

### خطأ النص العلوي المزدوج: حالات خاصة

#### النصوص العلوية واللكنات

سؤال على `tex.stackexchange` يحتوي على [مثال مفاجئ على الـ *الرمز السفلي* خطأ](https://tex.stackexchange.com/questions/253080/why-am-i-getting-a-double-subscript-error) والتي ينطبق سببها الجذري، وحلها، أيضًا على النصوص العلوية المزدوجة. المثال التالي يفشل في التجميع، رغم استخدام الأقواس المعقوفة:

```latex
\documentclass{article}
\begin{document}
\({\vec a^b}^c\)
\end{document}
```

[افتح هذا ***المسبّب للخطأ*** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%28%7B%5Cvec+a%5Eb%7D%5Ec%5C%29%0A%5Cend%7Bdocument%7D)

وكما هو الحال مع [خطأ الرمز السفلي المزدوج](/latex/ar/akhtaa-latex/04-double-subscript.md)، فإن إحدى طرق إصلاح المشكلة هي إضافة [`حزمة accents` الحزمة](https://ctan.org/pkg/accents?lang=en) (كما هو مقترح [هنا](https://tex.stackexchange.com/a/253094)):

```latex
\documentclass{article}
\usepackage{accents}
\begin{document}
\({\vec a^b}^c\)
\end{document}
```

[افتح هذا ***مصحح*** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Baccents%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%28%7B%5Cvec+a%5Eb%7D%5Ec%5C%29%0A%5Cend%7Bdocument%7D)

#### استخدام العلامة الأولية مع النصوص العلوية

سببٌ شائع آخر لهذا الخطأ هو استخدام العلامة الأولية مع النصوص العلوية، وهو أمر مزعج بشكل خاص في ترميز الموترات—كما هو موضح أدناه:

```latex
\documentclass{article}
\begin{document}
\[T'_{\nu_{1}\nu_{2}\ldots\nu_{p}}^{\mu_{1}\mu_{2}\ldots\mu_{q}}\]
\end{document}
```

[افتح هذا ***المسبّب للخطأ*** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5BT%27_%7B%5Cnu_%7B1%7D%5Cnu_%7B2%7D%5Cldots%5Cnu_%7Bp%7D%7D%5E%7B%5Cmu_%7B1%7D%5Cmu_%7B2%7D%5Cldots%5Cmu_%7Bq%7D%7D%5C%5D%0A%5Cend%7Bdocument%7D)

يؤدي هذا المثال إلى ظهور الخطأ التالي:

![خطأ النص العلوي المزدوج الناتج عن العلامات الأولية في وضع الرياضيات](/files/de2a429fb5164a01a1a97e7e35a92d3329144110)

في وضع الرياضيات، سيفسّر LaTeX الرمز المرفق بعلامة أولية `T'` as `T^{\prime}`—أي إنه يضيف نصًا علويًا إلى `T`. `^`وعندما يُدخِل LaTeX لاحقًا حرف القبعة، `^{\mu_{1}\mu_{2}\ldots\mu_{q}}`، يكتشف محاولة لإضافة *نص علوي ثانٍ* إلى `T`، وهذا يؤدي إلى حدوث الخطأ.

تُبيَّن الطريقة الصحيحة لكتابة التعبير أعلاه في المثال التالي:

```latex
\documentclass{article}
\begin{document}
\[T_{\nu_{1}\nu_{2}\ldots\nu_{p}}^{\prime\mu_{1}\mu_{2}\ldots\mu_{q}}\]
\end{document}
```

[افتح هذا ***مصحح*** المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=accents+package+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cbegin%7Bdocument%7D%0A%5C%5BT_%7B%5Cnu_%7B1%7D%5Cnu_%7B2%7D%5Cldots%5Cnu_%7Bp%7D%7D%5E%7B%5Cprime%5Cmu_%7B1%7D%5Cmu_%7B2%7D%5Cldots%5Cmu_%7Bq%7D%7D%5C%5D%0A%5Cend%7Bdocument%7D)

ينتج هذا المثال المخرجات التالية (مكبّرة للتوضيح):

![مثال على تنضيد النصوص العلوية والعلامات الأولية على Overleaf](/files/b3ecb88056c89956b2520cc2c238c4859aeb66a2)

## المزيد عن النصوص العلوية

يمكن تنضيد مستويات إضافية من النصوص العلوية بكتابة LaTeX مثل `a^{b^{c^{d^e}}}` والذي يُنسّق $$a^{b^{c^{d^e}}}$$. تُنضَّد جميع النصوص العلوية في المستوى الثاني أو أعلى باستخدام حجم الخط نفسه (بالنقاط)، بينما تستخدم النصوص العلوية من المستوى الأول خطًا أكبر قليلًا (بحجم النقطة). لمعرفة المزيد عن النصوص العلوية، تفضل بزيارة صفحة Overleaf الخاصة بـ [صفحة المساعدة المخصصة لهذا الموضوع](/latex/ar/alryadhyat/02-subscripts-and-superscripts.md).


---

# 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/05-double-superscript.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.
