Solving the LaTeX hyperref error: "\pdfendlink ended up in different nesting level than \pdfstartlink"
The following error message is due to a hyperlink breaking across two pages[1].
pdfTeX error (ext4): \pdfendlink ended up in different nesting level than \pdfstartlink.
\AtBegShi@Output ...ipout \box \AtBeginShipoutBox
Since pdflatex
cannot deal with it, a suggested method is to identify the breaking hyperlink and edit the document to avoid it. In the meantime, to continue working on your document without error messages, you can configure hyperref
in the preamble:
\hypersetup
However this will also disable hyperlinks. The best solution I found[2][3][4] is to add this code in your preamble:
\makeatletter
\patchcmd\@combinedblfloats%
\makeatother
If this still didn’t solve the problem, you can have a look at the references at the bottom of this page.
References
Overleaf: What does “\pdfendlink ended up in different nesting level than \pdfstartlink” mean? ↩︎
Github: top float in two column mode leads to nesting error for links ↩︎
StackExchange: \pdfendlink ended up in different nesting level than \pdfstartlink ↩︎
StackExchange: ‘\pdfendlink ended up in different nesting level than \pdfstartlink’ error with current version of hyperref ↩︎