以下は私が直面している問題に対する 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 を使用するとコンパイルは問題なく実行されます (ただし、ブックマーク内の数式に関する hyperref の不満は別で、これは他の方法で修正できます)。
それで、xelatex で何か間違っているのでしょうか?
答え1
Ulrike の回答の更新。
unicode
hyperref 2012/08/13 v6.83a では、オプション(またはpdfencoding=auto
) をオプション と一緒に使用できますpsdextra
。
\usepackage[unicode,psdextra]{hyperref}[2012/08/13]
すると、多くの数学記号が\times
認識されます。
答え2
\texorpdfstring
ブックマークに別のテキストを使用するように hyperref に指示するには、次のようにします。
\documentclass{article}
\usepackage{hyperref}
\usepackage{unicode-math}
\setmathfont{Asana Math}
\begin{document}
\section{\texorpdfstring{$2\times 2$}{2\texttimes2}}
$2 \times 2$
\end{document}