![etoc 可以与 amsart 一起使用吗?](https://linux22.com/image/372919/etoc%20%E5%8F%AF%E4%BB%A5%E4%B8%8E%20amsart%20%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8%E5%90%97%EF%BC%9F.png)
A问题突然被删除,这让我开始调查 etoc 是否与 amsart 兼容。答案是它需要一点调整。
答案1
该etoc
软件包与 amsart 不兼容:
\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}
etoc 默认从文章类的代码来看似乎存在问题 ,此外,从 amsart 文档复制粘贴
In amsart.sty \@startsection, \@sect, and a couple of other things are rede- fined to fix a few hard-coded things that would interfere with the desired style. The most noteworthy difference is that all section headings will go into the table of contents (governed by secnumdepth as usual), EVEN WHEN THE * FORM IS USED. The only section heading not listed in the table of contents is the heading for the toc itself.
可以通过覆盖etoc
“toc 显示样式”的默认行为来处理这两件事,以避免\@mkboth
和避免使用,\section*
因为这会在 toc 文件中创建不需要的条目。因此,这个最小示例对我来说是有效的:
\documentclass{amsart}
\usepackage{etoc}
\etocsettocstyle{\noindent\textbf{\contentsname}\par}{}
\begin{document}
\tableofcontents
\section{FOO}
\etocsettocstyle{\noindent\textbf{Local table of contents}\par}{}
\localtableofcontents
\subsection{bar1}
\subsection{bar2}
\subsection{bar3}
\section{FOOII}
\end{document}