xelatex에서 unicode-math와 hyperref를 결합하면 이상한 오류가 발생합니다.

xelatex에서 unicode-math와 hyperref를 결합하면 이상한 오류가 발생합니다.

다음은 내가 직면한 문제에 대한 MWE입니다.

\documentclass{article}

\usepackage{hyperref}
\usepackage{unicode-math}
\setmathfont{Asana Math}
\begin{document}
\section{$2\times 2$}
$2 \times 2$
\end{document}

xelatex로 컴파일하면 다음과 같은 오류가 발생합니다.

! Improper alphabetic constant.
<to be read again> 
                   \times 
l.7 \section{$2\times 2$}

그러나 hyperref 패키지 포함을 제거하면 오류가 사라집니다.

이제 분명히 섹션 헤더에서 수학을 사용할 수 있기를 원하며 pdflatex를 사용하면 컴파일이 괜찮습니다(다른 방법으로 고칠 수 있는 북마크의 수학에 대해 불평하는 하이퍼참조를 제외하고).

그럼 내가 xelatex에 뭔가 잘못하고 있는 걸까요?

답변1

Ulrike의 답변이 업데이트되었습니다.

hyperref 2012/08/13 v6.83a를 사용하면 옵션과 함께 옵션 unicode(또는 )을 사용할 수 있습니다 .pdfencoding=autopsdextra

\usepackage[unicode,psdextra]{hyperref}[2012/08/13]

그러면 다음을 포함한 많은 수학적 기호가 \times인식됩니다.

답변2

\texorpdfstring책갈피에 다른 텍스트를 사용하도록 하이퍼참조에 지시하는 데 사용할 수 있습니다 .

\documentclass{article}

\usepackage{hyperref}
\usepackage{unicode-math}
\setmathfont{Asana Math}
\begin{document}
\section{\texorpdfstring{$2\times 2$}{2\texttimes2}}
$2 \times 2$
\end{document}

관련 정보