> 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/bnyh-almstnd/02-table-of-contents.md).

# جدول المحتويات

في مستند LaTeX يمكن إنشاء جدول المحتويات تلقائيًا، وتعديله ليتناسب مع نمط محدد، وتشرح هذه المقالة كيفية ذلك

## مقدمة

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

```latex
\documentclass{article}
\usepackage{blindtext}
\usepackage{titlesec}
\title{الأقسام والفصول}
\author{Gubert Farnsworth}
\date{ }
\begin{document}

\maketitle

\tableofcontents

\section{Introduction}

هذا هو القسم الأول.

\blindtext

\addcontentsline{toc}{section}{قسم غير مرقم}
\section*{قسم غير مرقم}

\blindtext

\section{القسم الثاني}

\blindtext
\end{document}
```

[افتح هذا المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Table+of+contents+example\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bblindtext%7D%0A%5Cusepackage%7Btitlesec%7D%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BGubert+Farnsworth%7D%0A%5Cdate%7B+%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cmaketitle%0A%0A%5Ctableofcontents%0A%0A%5Csection%7BIntroduction%7D%0A%0AThis+is+the+first+section.%0A%0A%5Cblindtext%0A%0A%5Caddcontentsline%7Btoc%7D%7Bsection%7D%7BUnnumbered+Section%7D%0A%5Csection%2A%7BUnnumbered+Section%7D%0A%0A%5Cblindtext%0A%0A%5Csection%7BSecond+Section%7D%0A%0A%5Cblindtext%0A%5Cend%7Bdocument%7D)

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

![مثال على جدول محتويات مُنتَج في LaTeX](/files/0869ff099e444b645306ee723a156a40727b4aab)

## تغيير عنوان جدول المحتويات

العنوان الافتراضي لجدول المحتويات هو **المحتويات**؛ ويمكن تغييره إلى ما تحتاج إليه كما يوضح المثال التالي:

```latex
\documentclass{article}
\title{الأقسام والفصول}
\author{Gubert Farnsworth}
\date{ }
\renewcommand*\contentsname{Summary}
\begin{document}
\maketitle
\tableofcontents
\section{Introduction}

هذا هو القسم الأول.

لوريم إيبسوم دولار سيت أميت، كونسيكتيتور أديبيسنج
إليت.   إتيام  لوبورتيسفاسيليس سيم.  نولام نيك مي إت
نيكويه فاريترا سوليسيتودين.  بريسانت إمبيردييتمي نيك أنتِ.
دونِك أولامكوربر، فيليس نون سودالِس...

\addcontentsline{toc}{section}{قسم غير مرقم}
\section*{قسم غير مرقم}

لوريم إيبسوم دولور سيت أميت، كونسكتيتور أديبيسكنغ إليت.
إتيام لوبورتيس فاسيليسِسم.  نولام نيك مي إت نيكويه فاريترا
سوليسيتودين.  بريسانت إمبيردييت مي نيكانتي...

\section{القسم الثاني}

لوريم إيبسوم دولور سيت أميت، كونسكتيتور أديبيسكنغ إليت.
إتيام لوبورتيس فاسيليسِسم.  نولام نيك مي إت نيكويه فاريترا
سوليسيتودين.  بريسانت إمبيردييت مي نيكانتي...
\end{document}
```

[افتح هذا المثال في Overleaf](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=How+to+change+title+of+table+of+contents\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Ctitle%7BSections+and+Chapters%7D%0A%5Cauthor%7BGubert+Farnsworth%7D%0A%5Cdate%7B+%7D%0A%5Crenewcommand%2A%5Ccontentsname%7BSummary%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cmaketitle%0A%5Ctableofcontents%0A%5Csection%7BIntroduction%7D%0A+++%0AThis+is+the+first+section.%0A++++++%0ALorem++ipsum++dolor++sit++amet%2C++consectetuer++adipiscing++%0Aelit.+++Etiam++lobortisfacilisis+sem.++Nullam+nec+mi+et+%0Aneque+pharetra+sollicitudin.++Praesent+imperdietmi+nec+ante.+%0ADonec+ullamcorper%2C+felis+non+sodales...%0A+++++++%0A%5Caddcontentsline%7Btoc%7D%7Bsection%7D%7BUnnumbered+Section%7D%0A%5Csection%2A%7BUnnumbered+Section%7D%0A%0ALorem+ipsum+dolor+sit+amet%2C+consectetuer+adipiscing+elit.++%0AEtiam+lobortis+facilisissem.++Nullam+nec+mi+et+neque+pharetra+%0Asollicitudin.++Praesent+imperdiet+mi+necante...%0A%0A%5Csection%7BSecond+Section%7D%0A+++++++%0ALorem+ipsum+dolor+sit+amet%2C+consectetuer+adipiscing+elit.++%0AEtiam+lobortis+facilisissem.++Nullam+nec+mi+et+neque+pharetra+%0Asollicitudin.++Praesent+imperdiet+mi+necante...%0A%5Cend%7Bdocument%7D)

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

![تغيير اسم جدول المحتويات في LaTeX](/files/98c21118be0f621a2ac1795d09d6d990b93eb983)

السطر `\renewcommand*\contentsname{Summary}` سيكتب "Summary" بدلًا من القيمة الافتراضية. إذا كنت تستخدم الحزمة *babel* لـ [دعم اللغات الدولية](/latex/ar/allghat/03-international-language-support.md)، فيجب وضع الأمر المذكور أعلاه داخل الأقواس الخاصة بـ

```latex
\addto\captionsenglish{ }
```

بدلًا من الإنجليزية في `\captionenglish` اكتب اسم اللغة التي ضبطتها في babel.

## قراءة إضافية

لمزيد من المعلومات، انظر:

* [إنشاء مستند في LaTeX](/latex/ar/asasyat-latex/01-learn-latex-in-30-minutes.md)
* [الخط العريض والمائل والتحته خط](/latex/ar/asasyat-latex/03-bold-italics-and-underlining.md)
* [دعم اللغات الدولية](/latex/ar/allghat/03-international-language-support.md)
* [الإحالة المتبادلة بين الأقسام والمعادلات](/latex/ar/bnyh-almstnd/03-cross-referencing-sections-equations-and-floats.md)
* [الفهارس](/latex/ar/bnyh-almstnd/04-indices.md)
* [المسارد](/latex/ar/bnyh-almstnd/05-glossaries.md)
* [الإدارة في مشروع كبير](/latex/ar/bnyh-almstnd/07-management-in-a-large-project.md)
* [مشاريع LaTeX متعددة الملفات](/latex/ar/bnyh-almstnd/08-multi-file-latex-projects.md)
* [الروابط التشعبية](/latex/ar/bnyh-almstnd/09-hyperlinks.md)
* [ترقيم الصفحات](/latex/ar/altnsyq/03-page-numbering.md)
* [المستندات أحادية الوجه ومزدوجة الوجه](/latex/ar/altnsyq/08-single-sided-and-double-sided-documents.md)
* [أعمدة متعددة](/latex/ar/altnsyq/09-multiple-columns.md)
* [العدادات](/latex/ar/altnsyq/10-counters.md)
* [أحجام الخطوط، والعائلات، والأنماط](/latex/ar/alkhtwt/01-font-sizes-families-and-styles.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/bnyh-almstnd/02-table-of-contents.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.
