tuna / thuthesis

LaTeX Thesis Template for Tsinghua University
https://www.ctan.org/pkg/thuthesis
LaTeX Project Public License v1.3c
4.61k stars 1.08k forks source link

hyperref fails to run if title contains greek letter #941

Closed YijunYuan closed 7 months ago

YijunYuan commented 8 months ago

提交前检查

系统

Ubuntu 23.10 on Windows 10 x86_64, 5.15.146.1-microsoft-standard-WSL2

TeX 发行版

TeXLive 2023

TeX 编译器

XeLaTeX

版本

7.5.0

学位类型

doctor

问题描述

以下MWE编译失败。将标题中的\varphi改成x或者去除hyperref宏包则可成功编译。

复现代码

\documentclass{thuthesis}
\thusetup{
  title  = {$\varphi$}
}
\usepackage{hyperref}
\begin{document}
\maketitle
\frontmatter
\mainmatter
\backmatter
\end{document}

编译日志

......
Package hyperref Warning: Rerun to get /PageLabels entry.

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `math shift' on input line 6.

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `\varphi' on input line 6.

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `math shift' on input line 6.

(/usr/share/texlive/texmf-dist/tex/generic/stringenc/se-ascii-print.def)

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `math shift' on input line 8.

Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref)                removing `math shift' on input line 8.

! Improper alphabetic constant.
<to be read again> 
                   \mitvarphi 
l.8 \frontmatter

其他信息

No response

YijunYuan commented 8 months ago

参考 https://github.com/mohuangrui/ucasthesis/issues/154#issuecomment-531618081 ,在导言区添加

\makeatletter
\g@addto@macro\psdmapshortnames{\let\mitvarphi\textphi}
\makeatother

后解决。

不得不说unicode-math真的一定要加吗?

Harry-Chen commented 7 months ago

参考 mohuangrui/ucasthesis#154 (comment) ,在导言区添加

\makeatletter
\g@addto@macro\psdmapshortnames{\let\mitvarphi\textphi}
\makeatother

后解决。

这是比较常见的问题,请见 https://tex.stackexchange.com/questions/360607/unicode-math-but-ordinary-blackboard-bold

不得不说unicode-math真的一定要加吗?

unicode-math 是现代的数学排版方案,并不仅仅用于在文中书写 unicode 码位的数学符号。

YijunYuan commented 7 months ago

这是比较常见的问题,请见 tex.stackexchange.com/questions/360607/unicode-math-but-ordinary-blackboard-bold

我想您引用了错误的链接。Anyway,这确实是常见问题。