Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using arabxetex package. I need my TOP be all in Arabic script including page numbers. \addcontentsline works with Latin [English] text, but not with Arabic.

\phantomsection
\addcontentsline{toc}{section}{-- TEXT-- }

When I use something like this inside the TEXT brackets:

\begin{arab}[utf]
ببي
\end{arab}

It gives me error.

Need your help. As per request, here I am adding complete working minimal code:

\documentclass[a4paper]{article}
\usepackage{hyperref}
\usepackage{multicol}
\usepackage{fancyhdr}
\makeatletter
\makeatother
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
\usepackage[margin=0.08in, paperwidth=3.56in, paperheight=5.95in]{geometry}
\usepackage{arabxetex}
\usepackage{setspace}
    \renewcommand*\contentsname{}

\begin{document}
\tableofcontents
\newpage

\phantomsection
\addcontentsline{toc}{section}{AAA} % Instead of AAA, I need Arabic text ننن
\begin{arab}[utf]
نتنتنهه
\end{arab}

\newpage
\phantomsection
\addcontentsline{toc}{section}{BBB} % Instead of BBB, I need Arabic text ههه
\begin{arab}[utf]
منسة
\end{arab}

\end{document}
share|improve this question
    
Please, add a complete minimal example, with the class and the necessary packages. In any case, try preceding \begin and \end with \protect. –  egreg May 12 '12 at 9:26
    
I added complete minimal example. I have also tried \protect but it gives error. I want TOC be completely in Arabic language [RTL script]; both the section titles and page numbers. Thank you very much! –  Nina May 12 '12 at 13:53
    
Is you document entirely in Arabic? –  egreg May 12 '12 at 14:06
    
Yes, it is, except for the commands. –  Nina May 12 '12 at 14:14
    
The partial answer to my question is to use: \textarab[utf]. Now the question is : How can I to turn TOC page numbers into Arabic script? –  Nina May 12 '12 at 18:22

2 Answers 2

Are you sure you need arabxetex? The following typesets without glitches:

\documentclass[a4paper]{article}

\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}


\usepackage{fontspec}
\setmainfont{Scheherazade}

\usepackage{polyglossia}
\setmainlanguage{arabic}

\begin{document}

\tableofcontents

\section{ننن}

نتنتنهه

\section{ههه}

منسة

\end{document}

enter image description here

share|improve this answer
    
I am not sure, but since I am using different special Arabic font for each and every page, setting \newfontfamily\arabicfont[Script=Arabic, Scale=1.2]{Some Special Arabic Fonts} in your code does not compile. –  Nina May 12 '12 at 14:52
    
Hi egreg. I appreciate your help, but the code you provided with isn't compatible with multiple non-package special fonts. Can you extend your help please. –  Nina May 12 '12 at 17:03
    
@Nina Sorry, but I'm no expert in Arabic. And your example doesn't show anything of that kind. –  egreg May 12 '12 at 17:06
    
You don't have to. Just share your ingenious expertise in TEX how to implement \begin{arab}[utf]نتعه\end{arab} clause inside my arabxetex file to have TOC appear all in Arabic script. Waiting for your solution, please :) –  Nina May 12 '12 at 17:38
    
egreg, I found the solution i.e is to use \textarab[utf] inside the text bracket. However, page numbers still show in Latin, not in Arabic language. Need help. –  Nina May 12 '12 at 18:24

You said you're using "a different font for every page?" Or a different font for all pages? If you use fontspec, there's an option to use:

\usepackage{polyglossia}
\setmainlanguage[numerals=mashriq] {arabic}

But I'm not sure at all if it works, because the code without compiles just fine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.