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.
silencepackage is just to filter out some error messages by interfering with the messaging system, this can be considered a bug ofsilence. So I suggest to remove thesilencepackage if it causes troubles. The trigger is a warning by the hyperref package that something about\mathscrwill be ignored, basically harmless. – gernot Dec 15 '16 at 17:32\mathscrcan be ignored, when generating bookmark strings:\pdfstringdefDisableCommands{\let\mathscr\relax}– Heiko Oberdiek Dec 15 '16 at 17:51