Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当章节过多时本科毕业论文模板pdf从目录开始页码全为罗马数字 #293

Closed
4 tasks done
GongSiqiu opened this issue Apr 18, 2021 · 7 comments
Closed
4 tasks done

Comments

@GongSiqiu
Copy link

检查

  • 已经阅读《研究生学位论文撰写手册》或《关于本科毕业论文(设计)格式和统一封面的通知》
  • 已经将模板升级到了最新版
  • 已经阅读使用说明文档 ustcthesis.pdf
  • 已经阅读 常见问题

编译环境

  • 编译的系统:debian 10
  • TeX 发行版:TeX Live 2021
  • 模板类型: bachelor

描述问题

当章节过多时本科毕业论文模板pdf从目录开始页码全为罗马数字

截图:

图片

复现上述问题的代码:

\documentclass[degree=bachelor]{ustcthesis}
\begin{document}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\section{title}
\subsection{title}
\subsection{title}
\chapter{title}
\section{title}
\subsection{title}
\subsection{title}
\section{title}
\subsection{title}
\subsection{title}
\end{document}
@zepinglee
Copy link
Member

zepinglee commented Apr 18, 2021

我在本地 macOS 的 TeX Live 2021 无法复现,编译的结果:

main.pdf

@GongSiqiu
Copy link
Author

GongSiqiu commented Apr 18, 2021

不好意思,我以为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}

@zepinglee
Copy link
Member

嗯,我能复现了,目录以及正文的页码没问题,但是 PDF 书签的页码会坏掉。

@zepinglee
Copy link
Member

zepinglee commented Apr 21, 2021

这似乎是 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}

@zepinglee
Copy link
Member

临时解决方案是去掉 \maketitle 中的 \pagenumbering{Alph}

@zepinglee
Copy link
Member

zepinglee commented Apr 21, 2021

临时解决方案是去掉 \maketitle 中的 \pagenumbering{Alph}

更正:去掉 \maketitle\frontmatter 中的 \pagenumbering 可以改为阿拉伯数字,但是页码数还是错的。所以还是去掉 notoccite 宏包好了。

@zepinglee
Copy link
Member

参考 Ulrike Fischer 的回答 https://tex.stackexchange.com/a/593839/82731

zepinglee added a commit that referenced this issue Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants