Skip to content

Commit

Permalink
fix compatibility issue with hyperref and unicode-math (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed May 1, 2019
1 parent c62c1e2 commit ce808b2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ustcthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ustcthesis}
[2019/03/21 v3.1.04 USTC thesis template]
[2019/05/01 v3.1.06 USTC thesis template]
\RequirePackage{ifxetex}
\ifxetex\else
\ClassError{ustcthesis}{XeLaTeX is required to compile the document}{}
Expand Down Expand Up @@ -1074,6 +1074,8 @@
bookmarksopen = true,
bookmarksopenlevel = 1,
linktoc = all,
unicode = true,
psdextra = true,
}
\ifustc@pdf
\hypersetup{
Expand Down Expand Up @@ -1106,6 +1108,9 @@
\let\\\@empty
\let\hspace\@gobble
}
\@ifpackagelater{hyperref}{2019/04/27}{}{%
\g@addto@macro\psdmapshortnames{\let\mu\textmugreek}%
}
\ifustc@chinese
\def\equationautorefname~#1\null{公式~(#1)\null}
\def\footnoteautorefname{脚注}
Expand Down
16 changes: 15 additions & 1 deletion ustcthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ version 2005/12/01 or later.
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ustcthesis}
%<*class>
[2019/04/21 v3.1.05 USTC thesis template]
[2019/05/01 v3.1.06 USTC thesis template]
%</class>
%
%<*driver>
Expand Down Expand Up @@ -2486,13 +2486,17 @@ version 2005/12/01 or later.
% \subsubsection{\pkg{hyperref} 宏包}
%
% \changes{v3.1.02}{2018/10/30}{取消依赖 \pkg{hyperref}}
% \changes{v3.1.06}{2019/05/01}{处理 \pkg{hyperref} 与 \pkg{unicode-math}
% 的兼容性问题}
% \begin{macrocode}
\ustc@atendpackage{hyperref}{
\hypersetup{
bookmarksnumbered = true,
bookmarksopen = true,
bookmarksopenlevel = 1,
linktoc = all,
unicode = true,
psdextra = true,
}
% \end{macrocode}
%
Expand Down Expand Up @@ -2544,6 +2548,16 @@ version 2005/12/01 or later.
}
% \end{macrocode}
%
% \pkg{hyperref} 与 \pkg{unicode-math} 存在一些兼容性问题,见
% \href{https://github.com/ustctug/ustcthesis/issues/223}{
% ustctug/ustcthesis\#223} 和
% \href{https://github.com/ho-tex/hyperref/pull/90}{ho-tex/hyperref\#90}。
% \begin{macrocode}
\@ifpackagelater{hyperref}{2019/04/27}{}{%
\g@addto@macro\psdmapshortnames{\let\mu\textmugreek}%
}
% \end{macrocode}
%
% 设置中文的 \cs{autoref}。
% \footnote{\url{https://tex.stackexchange.com/a/66150/82731}}
% \begin{macrocode}
Expand Down

0 comments on commit ce808b2

Please sign in to comment.