通用模板问题

通用模板问题

我需要实现以下格式。可以吗?

目录

有人可以举个例子吗?

答案1

这取决于您使用的文档类,但大多数支持章节的类都有命令\frontmatter\mainmatter\backmatter它们自动支持此类操作。有关如何格式化目录列表本身的帮助,您应该查看tocloft包,或者检查标签可在网站上找到其使用的示例。

\documentclass{book}
\begin{document}
\frontmatter
\chapter{Disclaimer}
It's not my fault.
\chapter{Acknowledgements}
Thanks, Mom and Dad.
\chapter{Abstract}
A short summary
\tableofcontents
\mainmatter
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
Intro
\chapter*{Objectives}
\addcontentsline{toc}{chapter}{Objectives}
Objectives
\chapter{Background}
\section{History}
\end{document}

代码输出

相关内容