问题:
使用Latex的\tableofcontents生成两页目录,只有第一页页码为空,第二页目录还有带页码
解决:
\usepackage{fancyhdr} %导入包
\begin{document}
\thispagestyle{empty} %Multi-page directories are valid
\newpage
\pagestyle{empty}
\begin{center} %标题目录两个字居中
\tableofcontents
\end{center}
\newpage
\pagestyle{fancy}
\fancyhf{}
\newpage
\pagestyle{plain}
\setcounter{page}{1}
%正文开始
参考:https://www.zhihu.com/question/28067948#:~:text=%E7%9C%8B%E4%BA%86%E4%BD%A0%E5%9C%A8%E8%BF%99%E4%B8%AA%E9%97%AE%E9%A2%98%E4%B8%8B%E7%9A%84%E5%9B%9E%E7%AD%94%EF%BC%8C%E6%88%91%E4%B9%8B%E5%89%8D%E4%B9%9F%E9%81%87%E5%88%B0%E8%BF%87%E7%9B%AE%E5%BD%95%E5%8D%A0%E4%B8%A4%E9%A1%B5%EF%BC%8C%E7%AC%AC%E4%BA%8C%E9%A1%B5%E6%98%BE%E7%A4%BA%E9%A1%B5%E7%A0%81%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E5%90%8E%E6%9D%A5%E6%98%AF%E8%BF%99%E4%B9%88%E8%A7%A3%E5%86%B3%E7%9A%84%EF%BC%9A%20begin%20%7Bdocument%7D%20setcounter,%7Bpage%7D%20%7B0%7D%20thispagestyle%20%7Bempty%7D