I was trying Asana Math
font on old file to see how it looks. I found lualatex
gives a compile error because the file was using
\usepackage[pdfencoding=auto]{hyperref}
Changing the above to
\usepackage[]{hyperref}
Removes the error. Also removing Asana Math
font and keeping pdfencoding
fixes the error. I have math fonts inside subsubsection
title.
Why is that? What Am I doing wrong and what is best way to correct this?
Here is one which shows the error
\documentclass[12pt]{article}%
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmathfont{Asana Math}
\usepackage[pdfencoding=auto]{hyperref}
\begin{document}
\subsubsection{Part 4 $\det\left( A^{T}\right) =\det A$}
test
\end{document}
And now lualatex foo.tex
gives
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
restricted system commands enabled.
(./foo.tex
LaTeX2e <2018-12-01>
....
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `\nmlimits@' on input line 13.
! Improper alphabetic constant.
<to be read again>
\math@bgroup
l.13 ...{Part 4 $\det\left( A^{T}\right) =\det A$}
?
But if I use this
\documentclass[12pt]{article}%
\usepackage{amsmath}
\usepackage[pdfencoding=auto]{hyperref}
\begin{document}
\subsubsection{Part 4 $\det\left( A^{T}\right) =\det A$}
test
\end{document}
No error. But I get same warnings from hyperref
Package hyperref Warning: Token not allowed in a PDF string (Unicode):
(hyperref) removing `math shift' on input line 10.
According to answer Math symbol in section heading it said
Option pdfencoding=auto or unicode enables bookmarks in Unicode with more symbols.
Using TL 2019