![设置报告类中的目录、章节标题和文本的字体](https://linux22.com/image/386826/%E8%AE%BE%E7%BD%AE%E6%8A%A5%E5%91%8A%E7%B1%BB%E4%B8%AD%E7%9A%84%E7%9B%AE%E5%BD%95%E3%80%81%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E5%92%8C%E6%96%87%E6%9C%AC%E7%9A%84%E5%AD%97%E4%BD%93.png)
我正在使用report
class 进行论文写作。是否可以为目录、章节标题和普通文本定义三种字体?例如,我想为目录定义“B Zar”字体,为章节和节标题定义“B Lotus”字体,并采用适当的比例。
\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}