![如何在章节名称中添加前缀并在目录中创建空间](https://linux22.com/image/331264/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%AB%A0%E8%8A%82%E5%90%8D%E7%A7%B0%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%89%8D%E7%BC%80%E5%B9%B6%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%E5%88%9B%E5%BB%BA%E7%A9%BA%E9%97%B4.png)
我想在附录部分中添加前缀“附录”,以便它出现在目录中。但是,每当我使用命令添加此前缀时\renewcommand
,目录都会与前缀和部分名称重叠。例如:
\documentclass[11pt,openright,oneside,letterpaper,onecolumn]{report}
\usepackage[toc,page]{appendix}
\begin{document}
\setcounter{tocdepth}{2}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents
\cleardoublepage
\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage
\clearpage
\chapter{Section 1}
XYZ
\begin{subappendices}
\renewcommand{\thesection}{Appendix 1.\arabic{section}}
\section{Part 1}
XYZ
\section{Part 2}
XYZ
\end{subappendices}
\end{document}
关于如何添加此功能但产生适当间距,您有什么想法吗?谢谢。
答案是:
\documentclass[11pt,openright,oneside,letterpaper,onecolumn]{report}
\usepackage[titletoc, toc,page]{appendix}
\begin{document}
\setcounter{tocdepth}{2}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents
\cleardoublepage
\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage
\clearpage
\chapter{Section 1}
XYZ
\begin{subappendices}
\renewcommand{\thesection}{Appendix 1.\arabic{section}}
\section{Part 1}
XYZ
\section{Part 2}
XYZ
\end{subappendices}
\end{document}