平均能量损失
\documentclass{book}
\usepackage{lipsum}
\usepackage{titletoc}
\usepackage{appendix}
\renewcommand{\chaptername}{\textit{Division}}
\renewcommand{\appendixname}{\textit{Addition}}
\titlecontents{chapter}% <section-type>
[0pt]% <left>
{\addvspace{1em}}% <above-code>
{\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>
% Does not work VVVVV
\titlecontents{appendix}% <section-type>
[0pt]% <left>
{\addvspace{1em}}% <above-code>
{\bfseries\appendixname\ \thecontentslabel\quad}% <numbered-entry-format>
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}% <filler-page-format>
% Does not work ΛΛΛΛΛ
\begin{document}
\tableofcontents
\chapter{Thesis Statement}\lipsum[1-5]
\chapter{Introduction}\lipsum[1-5]
\chapter{Another chapter}\lipsum[1-5]
\begin{appendices}
\chapter{Final chapter}\lipsum[1-5]
\end{appendices}
\end{document}
我在下面添加了一张图片,我想要的是分配来写添加。
答案1
您可以修补appendices
环境以更改目录中附录条目的章节前缀。
一种可能性是:
\documentclass{book}
\usepackage{lipsum}
\usepackage{titletoc}
\usepackage{appendix}
\renewcommand{\chaptername}{\textit{Division}}
\renewcommand{\appendixname}{\textit{Addition}}
\titlecontents{chapter}
[0pt]
{\addvspace{1em}}
{\bfseries\chapapp\ \thecontentslabel\quad}% <- changed
{}% <numberless-entry-format>
{\bfseries\hfill\contentspage}
\newcommand*\chapapp{\chaptername}% <- added
\usepackage{etoolbox}% <- added
\AtBeginEnvironment{appendices}
{\addtocontents{toc}{\protect\def\protect\chapapp{\protect\appendixname}}}% <- added
\AtEndEnvironment{appendices}
{\addtocontents{toc}{\protect\def\protect\chapapp{\protect\chaptername}}}% <- added
\begin{document}
\tableofcontents
\chapter{Thesis Statement}\lipsum[1-5]
\chapter{Introduction}\lipsum[1-5]
\chapter{Another chapter}\lipsum[1-5]
\begin{appendices}
\chapter{Final chapter}\lipsum[1-5]
\end{appendices}
\end{document}
结果: