TransWikia.com

table of content in persian language(the number is right to left)

TeX - LaTeX Asked by Fatemeh on February 28, 2021

I use code

titleformat{chapter}[display]{ bfseries   filleftHuge}{ chaptername  arabic LTR{ thechapter} }{6pt}{bfseriesfilleft}

to write a table of content. in the table have

enter image description here

but I like to have

فصل 3

1.3

2.3

1.2.3

I use ubuntu and texlive 2019.
I read this question enter link description here

but not work.

One Answer

Use these codes:

documentclass{book} 
usepackage[pagebackref=false,colorlinks,linkcolor=blue,citecolor=magenta]{hyperref}
usepackage{xepersian}
settextfont{Yas}
makeatletter
renewcommand{thechapter}{arabic{chapter}}
renewcommand{thesection}{thechapter@SepMarkarabic{section}}
renewcommand{thesubsection}{thechapter@SepMarkarabic{section}@SepMarkarabic{subsection}}
renewcommand{theparagraph}{thesubsection@SepMarkarabic{paragraph}@SepMark}
makeatother
%SepMark{-}  
setcounter{secnumdepth}{4}
setcounter{tocdepth}{4}
begin{document}
tableofcontents
chapter{فصل}
section{بخش دوم}
section{بخش اول}
subsection{زیر بخش اول}
paragraph{پارگراف}
chapter{فصل}
section{بخش دوم}
subsection{زیر بخش دوم}
paragraph{پارگراف}
end{document}

output:

enter image description here

Good luck.

Answered by SH.Madadpour on February 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP