目录中的章节号仅取消加粗

目录中的章节号仅取消加粗

我已经创建了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}

相关内容