Document Classesmodify the word "Contents" in the toc

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
abd_bela
Posts: 2
Joined: Sat Oct 16, 2010 9:44 pm

modify the word "Contents" in the toc

Post by abd_bela »

Hi,
I would to replace the word "Contents" by its equivalent in "arabic". The lines
\documentclass[ 12pt,a4paper]{article}
\usepackage[ utf8 ]{inputenc}
\usepackage[ arabic ,english]{babel}

create correct lines in tableofcontents ( in arabic language), but the first word is "Contents" which I want to replace by the appropriete word in arabic.

While in french for example there is no problem I got
"Table des matières". I looked for the words "Table des matières" in all files in directories /usr/share/texmf-texlive/tex in order to compare and change, but no such words??!!
Where is processed the changes??


I tried \renewcommand\contentsname{الفهرس} too, but nothing changes, I tried directly in the
/usr/share/texmf-texlive/tex/latex/base/article.cls file , nothing is modifyed??
I am using debian .


thanks for help

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10334
Joined: Mon Mar 10, 2008 9:44 pm

modify the word "Contents" in the toc

Post by Stefan Kottwitz »

Hi abd_bela,

use the \addto command of babel. It's described here with an example for redefining \contentsname: What is the right way to redefine macros defined by babel.

Another way would be to use

Code: Select all

\renewcommand*{\contentsname}{الفهرس}
after \begin{document}, that means after babel made its settings.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

modify the word "Contents" in the toc

Post by localghost »

Appropriate solutions are also available here in the forum.

Best regards and welcome to the board
Thorsten
Post Reply