I use a lot of "Lists of" in my document, some of them are generated by \listoftheorems
. To include these lists in my PDF-bookmarks, I use this answer.
But actually this crashes, when too many bookmarks are produced.
\documentclass{article}
\usepackage{thmtools}
\usepackage{xpatch}
\xpatchcmd{\listoftheorems}{\@fileswfalse}{}{\typeout{yes}}{\typeout{no}}
\declaretheorem{theorem}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
\tableofcontents
%\tableofcontents %causes crash
\listoftheorems
text
\end{document}