In my previous question I implemented thumbs.sty, a package that allows the creation of Thumbnails of other frames in beamer (if you want to read that one, you'd beter brew some fresh coffee :) ).
However, I still have one bug: if the thumbnails spill across several frames, in some cases hyperref attempts to create a link in the first frame, but the content gets pushed (entirely, it's a single tikzpicture) to the second frame, so the link spans across two "pages", and pdftex crashes with the message (source : this old nabble message):
! pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pdfstartlink.
\@EveryShipout@Output ...@Org@Shipout \box \@cclv
l.20 \end{frame}
! ==> Fatal error occurred, no output PDF file produced!
The MWE:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}[allowframebreaks]
\pgfmathsetmacro\thumbwidth{0.2*\linewidth}
\pgfmathsetmacro\thumbheight{\thumbwidth/\paperwidth*\paperheight}
\begin{center}
\foreach \thid in {1,...,30} {%
\hyperlink{page.1}{% Comment this line
\begin{tikzpicture}[baseline={([yshift={-\ht\strutbox}]current bounding box.north)}]
\node[draw, inner sep=0pt] (thumb) {
\begin{minipage}[t][\thumbheight pt]{\thumbwidth pt}\vfill Thumbnail\vfill\end{minipage}
};
\node[anchor=north, font=\tiny, inner xsep=0pt, inner ysep=0.1cm, yshift=-0.05cm, text width=\thumbwidth pt, align=center] at (thumb.south) {Frame \thid};
\end{tikzpicture} % space here
}% Comment this line
}
\end{center}
\end{frame}
\end{document}
If one comments out the two lines marked by % Comment this line, no hyperlink is created, and everything works. The same goes if the \foreach maximum value is changed from 30 to 10.
I think this might be solved by using some tikz overlay hackery, or somehow adding the hyperlinks at the end of the physical frame (using a hook like \setbeamertemplate{background}{Add hyperlinks here for thumbnails that got into the current frame}), or somehow forcing the layout to be fixed before hyperref kicks in.
I'm reclutant to adopt a fixed layout, and change frames manually, since the height and width of the thumbnails is (will be) configurable, and I might use some more complex (non-grid) layouts later (like a table of contents intermixed with thumbnails).
It's 6 AM here, so I post this in the hope that someone more awake than me can find a solution :) and I think this issue ought to be documented on TeX.SX.