Closed GongSiqiu closed 3 years ago
不好意思,我以为MWE是在示例文档中修改的,现在再给一个完整的例子。注意比较注释前后生成文档的区别。 main.pdf
% !TeX encoding = UTF-8
% !TeX program = xelatex
% !TeX spellcheck = en_US
\documentclass[degree=bachelor]{ustcthesis}
\input{ustcsetup.tex}
\begin{document}
\maketitle
\frontmatter
\tableofcontents
\mainmatter
\chapter{title}
\section{title}
\iffalse
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\fi
\end{document}
嗯,我能复现了,目录以及正文的页码没问题,但是 PDF 书签的页码会坏掉。
这似乎是 hyperref 的 bug,只在 xelatex 编译时会出现。我去请教大佬们了,见 https://tex.stackexchange.com/q/593820/82731。
MWE:
\documentclass{book}
\usepackage{notoccite}
\usepackage{hyperref}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\newcommand\test{%
\chapter{Title}%
\section{Title}%
\subsection{Title}%
\subsection{Title}%
\subsection{Title}%
\section{Title}%
\subsection{Title}%
\subsection{Title}%
\subsection{Title}%
\section{Title}%
\subsection{Title}%
\subsection{Title}%
\subsection{Title}%
}
% Make sure the TOC has more than one page
\test
\test
\test
\end{document}
临时解决方案是去掉 \maketitle
中的 \pagenumbering{Alph}
。
临时解决方案是去掉
\maketitle
中的\pagenumbering{Alph}
。
更正:去掉 \maketitle
和 \frontmatter
中的 \pagenumbering
可以改为阿拉伯数字,但是页码数还是错的。所以还是去掉 notoccite
宏包好了。
参考 Ulrike Fischer 的回答 https://tex.stackexchange.com/a/593839/82731 。
检查
ustcthesis.pdf
编译环境
描述问题
当章节过多时本科毕业论文模板pdf从目录开始页码全为罗马数字
截图:
复现上述问题的代码: