1

I am using report class for my thesis. Is it possible to define three type of fonts for the table of contents, chapter titles and ordinary texts? For example I want to define "B Zar" font for table of contents and "B Lotus" for chapters and sections titres with appropriate scale.

‎\documentclass[12pt,a4paper,titlepage]{report}‎
‎\usepackage{amsthm,amssymb,amsmath,mathrsfs,tikz,fancyhdr,nccmath}‎ 
‎\usepackage[nottoc]{tocbibind}‎
\usepackage[titletoc,title]{appendix}‎‎‎

‎\usepackage{titlesec}‎
‎‎\usepackage[extrafootnotefeatures]{xepersian}‎
‎
‎\fancyfoot{}‎ 
‎\fancyfoot[C]{\thepage}‎
‎\renewcommand{\headrulewidth}{0.2pt}‎
‎\setdigitfont[Scale=0.85]{PGaramond}‎

‎\settextfont[Scale=0.95]{Zar}‎
‎\setlatintextfont[Scale=0.8]{Times New Roman}‎ 
‎\defpersianfont\titr[Scale=1]{Titr Bold}‎
‎\defpersianfont\davat[Scale=1]{B Davat}‎
‎\defpersianfont\nastaliq[Scale=1.5]{IranNastaliq}‎
‎\defpersianfont\nazanin[Scale=1]{B Nazanin}‎
‎\defpersianfont\mitra[Scale=1]{IRMitra}‎
‎\defpersianfont\lotus[Scale=1]{B Lotus}‎


‎\linespread{1.8}‎
‎\titleformat{\chapter}[display]{\lotus}{\chaptertitlename\ \tartibi{chapter}}{1em}{}‎

‎
‎\makeatletter \def\@makechapterhead#1{   \vspace*{50\p@}   {\parindent \z@  \raggedright\normalfont     \ifnum \c@secnumdepth >\m@ne       \if@mainmatter         \huge\bfseries \@chapapp\space  \thechapter         \par\nobreak         \vskip 20\p@       \fi     \fi     \interlinepenalty\@M     \Huge \bfseries #1\par\nobreak     \vskip 40\p@   }} \def\@makeschapterhead#1{   \vspace*{50\p@}  {\parindent \z@ \centering     \normalfont     \interlinepenalty\@M     \Huge \bfseries  #1\par\nobreak     \vskip 40\p@   }} \makeatother‎ 

‎‎
\makeatletter‎
‎\bidi@patchcmd{\@makechapterhead}{\thechapter}{\tartibi{chapter}}{}{}‎
‎\bidi@patchcmd{\chaptermark}{\thechapter}{\tartibi{chapter}}{}{}‎
‎\bidi@patchcmd{\Hy@org@chapter}{%‎
‎\addcontentsline{toc}{chapter}%‎
‎{\protect\numberline{\thechapter}#1}%‎
‎}{\addcontentsline{toc}{chapter}%‎
‎{\protect\numberline{\@chapapp\,\tartibi{chapter}}\qquad\quad#1}%‎
}{}{}
‎\makeatother‎


‎\begin{document}‎
‎\newpage‎ 
‎\tableofcontents‎
‎\addtocontents{toc}{\textbf{‏عنوان}~\hfill\textbf{صفحه}\par}‎‎
\chapter{برنامه}‎
متن متن متن متن متن متن متن متن متن متن متن متن متن 
‎\begin{appendices}‎
‎\chapter{الگوریتم}‎‎‎‎
متن متن متن متن متن متن متن متن متن متن متن متن متن 
 ‎\end{appendices}‎

‎
‎\end{document}‎
  • 5
    Yes, it should be easy with titlesec. Could you explain more what you want, and provide a minimal example code? – Bernard Nov 30 '18 at 22:02
  • @Bernard Thanks, I added some codes. The text is in Persian language. I hope the codes be significant for you. – Fahim B Dec 1 '18 at 20:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.