The title in \addcontentsline
is also used in the bookmarks. There, the text should be expandable. \emph
cannot be used for this reason. Also fonts cannot be changed inside bookmarks strings. Package hyperref
redefines \emph
inside the bookmarks. But it does not see \emph
anymore, when \term
is defined via \let
.
The easiest solution is using \newcommand
as in the question, a little optimized:
\newcommand{\term}{\emph}
Otherwise, \term
needs to be redefined inside bookmarks:
\usepackage{hyperref}
\pdfstringdefDisableCommands{\let\term\relax}
manpreet
Best Answer
2 years ago
In the following sample from my custom syllabus class, I am getting a new error since updating my TeXLive 2015 distribution to the most recent release today. The error is
TeX capacity exceeded
.As far as I can tell the error is the result of an interaction between the
\let
, the\addcontentsline
command, and thehyperref
package. If I define\term
as a regular\newcommand
, or if I omit the\addcontentsline
, then it works with hyperref.Why can't I use a
\let
command inside\addcontentsline
withhyperref
?