2

As I was working on a document, I temporarily put some mathematical formulae with \mathscr in a section title. That didn't pose me any problem until the moment I tried to use both packages silence and hyperref, at which point compilation simply hung up. I've since found a way around the problem that fits my need, but I'm still curious as to why having silence or hyperref alone works fine, while having both interupts the compilation?

\documentclass{article}

\usepackage{mathrsfs}

%%%% this alone works
%\usepackage{silence}
%%%% this alone also works
%\usepackage{hyperref}

%%%% this hangs compilation
\usepackage{silence}
\usepackage{hyperref}

\begin{document} 
\section{Testing $\mathscr A$}
lorem

\end{document}

I'm currently using pdflatex to produce a PDF output.

Note: if anyone has a similar problem, I'm told you should avoid mathematical formulae in section titles, and if you really have to, try using \texorpdfstring{math}{replacement text}. EDIT: As Heiko Oberdiek commented, a better workaround is "to disable \mathscr when generating bookmark strings" with \pdfstringdefDisableCommands{\let\mathscr\relax}. That way, whenever \mathscr was used in a section title, it will be ignored, whereas \texorpdfstring{}{} requires you to specify replacement text every single time.

N.Bach
  • 131
  • Given that the purpose of the silence package is just to filter out some error messages by interfering with the messaging system, this can be considered a bug of silence. So I suggest to remove the silence package if it causes troubles. The trigger is a warning by the hyperref package that something about \mathscr will be ignored, basically harmless. – gernot Dec 15 '16 at 17:32
  • 1
    \mathscr can be ignored, when generating bookmark strings: \pdfstringdefDisableCommands{\let\mathscr\relax} – Heiko Oberdiek Dec 15 '16 at 17:51
  • 1
    Someone care to explain why this is a duplicate? The workaround is the same, but this other question doesn't really answer mine... – N.Bach Dec 17 '16 at 12:13

0 Answers0