![目录中未加粗的子节(包括数学表达式或方程式),但子节标题上的子节加粗](https://linux22.com/image/426562/%E7%9B%AE%E5%BD%95%E4%B8%AD%E6%9C%AA%E5%8A%A0%E7%B2%97%E7%9A%84%E5%AD%90%E8%8A%82%EF%BC%88%E5%8C%85%E6%8B%AC%E6%95%B0%E5%AD%A6%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%88%96%E6%96%B9%E7%A8%8B%E5%BC%8F%EF%BC%89%EF%BC%8C%E4%BD%86%E5%AD%90%E8%8A%82%E6%A0%87%E9%A2%98%E4%B8%8A%E7%9A%84%E5%AD%90%E8%8A%82%E5%8A%A0%E7%B2%97.png)
我有与此完全相同的问题在数学中将小节标题加粗,但在目录中不加粗。但我不能使用,\ce
因为我需要 mathbf 的实际用途,即积分和微分或具有平方根的函数。我试过了,但无法将子部分加粗。所以,我真的需要,\mathbf
或者也许有另一种方法来实现这一点?正如我在标题上所建议的那样,目录中的子部分必须取消加粗,包括数学表达式。希望你能帮助我。谢谢。
这是我的 MWE:
\documentclass[a4paper,12pt,oneside,openany
%,draft
]{book}
%\usepackage{pgf, tikz}
\usepackage[a4paper, inner=4cm, outer=3cm, top=4cm, bottom=3cm]{geometry}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{setspace}
\usepackage[titles]{tocloft}
\usepackage{tocbibind}
\usepackage{indentfirst}
\usepackage{etoolbox}
\usepackage[none]{hyphenat}
\sloppy
\usepackage[version=4]{mhchem}
\usepackage{times}
\usepackage{enumitem}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{array}
\usepackage[column=O]{cellspace}
\usepackage{caption}
\usepackage{afterpage}
\usepackage{mathtools}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{ragged2e}
\usepackage{natbib}
\setcitestyle{notesep={:},round,aysep={, },citesep={;}}
\usepackage[depth=2]{bookmark}
\usepackage{hyperref}
\usepackage{multirow}
\hypersetup{hidelinks}
\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{cals} %====> multipage table
%\usepackage{maplestd2e} %\
\usepackage{xcolor} % ===> maple code
\usepackage{graphicx} %/
\showboxbreadth=100
\showboxdepth=100
%%%%%%%%%%%%%%%%%%%%5 BAD BOXES %%%%%%%%%%%%%%%%%%%%%%%%%
\hfuzz=60pt
\hbadness=10000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newlist{ColEnum}{enumerate}{1}
\setlist[ColEnum,1]{label = \arabic*), left = 0pt, nosep,
before= {\begin{minipage}[t]{\hsize}\RaggedRight},
after = {\end{minipage}}}
\newcolumntype{P}[1]{>{\endgraf\vspace*{-\baselineskip}}p{#1}}
\newlist{tabitem}{itemize}{1}
\setlist[tabitem]{label=\textbullet, noitemsep,leftmargin=*,topsep=0pt,partopsep=0pt, nosep, before=\begin{minipage}[t]{\hsize}, after=\end{minipage}}
\DeclareMathOperator{\Res}{Res}
\numberwithin{equation}{section}
\setlength{\cellspacetoplimit}{5pt}
\setlength{\cellspacebottomlimit}{4pt}
\setlength\bibhang{25pt}
\setlength{\headheight}{14.5pt}
\theoremstyle{plain}
\newtheorem{thm}{Teorema}[section]
\newtheorem{cl}{Corollary}[section]
\newtheorem{lm}{Lemma}[section]
\theoremstyle{definition}
\newtheorem{defn}{Definisi}[section]
\newtheorem{exmp}{Contoh}
\renewcommand{\proofname}{\rm\bf{Bukti}}
\renewcommand\tablename{Tabel}
\renewcommand\figurename{Gambar}
\patchcmd{\section}{\bfseries}{\bfseries\boldmath}{}{}
%\patchcmd{\tableofcontents}{\contentsname}{\texorpdfstring{\MakeUppercase\contentsname}{\contentsname}}{}{}
%\patchcmd{\listoffigures}{\listfigurename}{\texorpdfstring{\MakeUppercase\listfigurename}{\listfigurename}}{}{}
%\patchcmd{\listoftables}{\listtablename}{\texorpdfstring{\MakeUppercase\listtablename}{\listtablename}}{}{}
\setlength{\cftbeforesecskip}{10pt}
\setlength{\cftbeforesubsecskip}{10pt}
\fancyhf{}
\cfoot{\thepage}
\linespread{1.5}
\pagestyle{plain}
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\renewcommand{\cftdotsep}{1}
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand{\cftchapfont}{\bfseries}
\renewcommand{\cftsecfont}{\bfseries}
\renewcommand{\cftchappagefont}{}
\titleformat{\chapter}[block]
{\normalfont\bfseries\centering}
{}{0pt}{}
\titleformat{\section}
{\normalfont\bfseries}
{\thesection}{1em}{}
\titleformat{\subsection}
{\normalfont\bfseries}
{\thesubsection}{1em}{}
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
\titlespacing*{\section}{0pt}{0pt}{0pt}
\titlespacing*{\subsection}{0pt}{0pt}{0pt}
\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\listtablename}{DAFTAR TABEL}
\renewcommand{\listfigurename}{DAFTAR GAMBAR}
\newcommand\dd{\mathop{}\!\mathrm{d}}
%\addtocontents{toc}{\protect\null\protect\hfill{Halaman}\protect\par}
\setlength\parindent{1.25cm}
\addtocontents{toc}{~\hfill{Halaman}\par}
%\addtocontents{toc}{\protect\afterpage{~\hfill{Halaman}\par\medskip}}
\addtocontents{lot}{~\hfill{Halaman}\par}
\addtocontents{lof}{~\hfill{Halaman}\par}
\addtocontents{app}{~\hfill{Halaman}\par}
\makeatletter
\def\ttl@mkchap@i#1#2#3#4#5#6#7{%
\ttl@assign\@tempskipa#3\relax\beforetitleunit
\vspace{\@tempskipa}%<<<<<< REMOVE THE * AFTER \vspace
\global\@afterindenttrue
\ifcase#5 \global\@afterindentfalse\fi
\ttl@assign\@tempskipb#4\relax\aftertitleunit
\ttl@topmode{\@tempskipb}{%
\ttl@select{#6}{#1}{#2}{#7}}%
\ttl@finmarks % Outside the box!
\@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}}
\makeatother
%DAFTAR LAMPIRAN (APPENDIX)
\newcommand{\listappendixname}{DAFTAR LAMPIRAN}
\newlistof{appendix}{app}{\listappendixname}
\setcounter{appdepth}{2}
\renewcommand{\theappendix}{Lampiran\space\arabic{appendix}}
\renewcommand{\cftappendixpresnum}{}
\setlength{\cftbeforeappendixskip}{0pt}
\setlength{\cftappendixnumwidth}{.9in}
\newlistentry[appendix]{subappendix}{app}{1}
\renewcommand{\thesubappendix}{\theappendix.\arabic{subappendix}}
\renewcommand{\cftsubappendixpresnum}{Appendix\space}
\setlength{\cftsubappendixnumwidth}{1in}
\setlength{\cftsubappendixindent}{0em}
\renewcommand{\listofappendix}{\begingroup
\tocfile{\listappendixname}{app}
\endgroup}
%\addcontentsline{toc}{app}
\newcommand{\myappendix}[1]{%
\refstepcounter{appendix}%
\section*{\theappendix\space #1}%
\addcontentsline{app}{appendix}{\protect\numberline{\theappendix}#1}%
\par
}
\newcommand{\subappendix}[1]{%
\refstepcounter{subappendix}%
\subsection*{\thesubappendix\space #1}%
\addcontentsline{app}{subappendix}{\protect\numberline{\thesubappendix}#1}%
}
\begin{document}
\clearpage
\thispagestyle{empty}
\frontmatter %
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\bibname}{DAFTAR PUSTAKA}
\begin{spacing}{0.1}
\tableofcontents
\end{spacing}
\begin{spacing}{1.5}
\listoffigures
\listoftables
\listofappendix
% \addcontentsline{toc}{chapter}{\listappendixname}
\end{spacing}
\mainmatter
\pagestyle{fancyplain}
\fancyhf{}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\chapter{Chapter 1}
\section{Section 1}
\subsection{Proof of \ce{$\int f(s)$} is \ce{$0$}}
\backmatter
\bibliography{dafpus}
\bibliographystyle{unejstyle}
\nocite{*}
\end{document}