
Я создал toc
и как сделать нежирным chapter number
в оглавлении. dotsep
Между названием главы и номером страницы также исчезло? Как сделать на dotsep
. Мой MWE:
\documentclass{book}
\usepackage{mathptmx}
\makeatletter
\renewcommand\@dotsep{2}
\newcommand*\l@fmchapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip0em% \@plus\p@
\setlength\@tempdima{2pc}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \fontsize{10}{13}\selectfont
\advance\leftskip\@tempdima
\hskip -33pt
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\fontsize{10}{13}\selectfont\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi\vskip1pt}
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 5pt \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss \normalfont #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\newcommand*\l@bmchapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip11pt% \@plus\p@
\setlength\@tempdima{2pc}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \fontsize{10}{13}
\advance\leftskip\@tempdima
\hskip -35.6pt
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\fontsize{10}{13}\selectfont\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi\vskip-11pt}
\makeatother
\begin{document}
\chapter*{Contents}
\contentsline {fmchapter}{\numberline {}About the Author}{ix}
\contentsline {fmchapter}{\numberline {}Acknowledgements}{xi}
\contentsline {chapter}{\numberline {1}Introduction}{1}
\contentsline {chapter}{\numberline {2}Sequential Assignment}{11}
\contentsline {chapter}{\numberline {3}Revenue Maximization}{41}
\contentsline {bmchapter}{\numberline {}Bibliography}{181}
\contentsline {bmchapter}{\numberline {}Index}{191}
\end{document}
решение1
Звоните normalfont
в течение numberline
.
Однако рекомендуется менее ручной подход с использованием tocstyle
или .tocloft
\documentclass{book}
\usepackage{mathptmx}
\makeatletter
\renewcommand\@dotsep{2}
\newcommand*\l@fmchapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip0em% \@plus\p@
\setlength\@tempdima{2pc}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \fontsize{10}{13}\selectfont
\advance\leftskip\@tempdima
\hskip -33pt
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\fontsize{10}{13}\selectfont\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi\vskip1pt}
\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip 5pt \@plus\p@
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss \normalfont #2}\par
\penalty\@highpenalty
\endgroup
\fi}
\newcommand*\l@bmchapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
\vskip11pt% \@plus\p@
\setlength\@tempdima{2pc}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \fontsize{10}{13}
\advance\leftskip\@tempdima
\hskip -35.6pt
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\fontsize{10}{13}\selectfont\hss #2}\par
\penalty\@highpenalty
\endgroup
\fi\vskip-11pt}
\makeatother
\begin{document}
\chapter*{Contents}
\contentsline {fmchapter}{\numberline {}About the Author}{ix}
\contentsline {fmchapter}{\numberline {}Acknowledgements}{xi}
\contentsline {chapter}{\numberline {\normalfont 1}Introduction}{1}
\contentsline {chapter}{\numberline {\normalfont 2}Sequential Assignment}{11}
\contentsline {chapter}{\numberline {\normalfont 3}Revenue Maximization}{41}
\contentsline {bmchapter}{\numberline {}Bibliography}{181}
\contentsline {bmchapter}{\numberline {}Index}{191}
\end{document}