# includepdf addtolist label not working

When I include PDFs in the annex, the label gets not set correctly. In the list of tables the link appears correctly, but clicking it brings me to the first page of the document.

The link in the text via \ref does also not work, as the label does not seem to be recognized, although as far as I understand the packages' documentation, it should work this way (see code):

\documentclass[12pt,a4paper,twoside]{report}

\usepackage{float}
\usepackage{pdfpages}
\usepackage[plainpages=true,pdfpagelabels]{hyperref}

\begin{document}

\chapter{Introduction}

A page with reference to table \ref{tab_sup:test_table}.

\newpage
\phantomsection

\listoftables
\endgroup

\newpage
\phantomsection

\includepdf[pages={-}, addtolist={1, table, {Test table}, tab_sup:test_table}]{test.pdf}

\end{document}


I saw a posting with a very similar problem here: pdfpages + hyperref : hyperlinks in list of tables pointing wrongly to first page of document

And indeed, removing the float package seems to solve the problem. However, I need float. Is there any other solution or workaround?

• Is each pdf just one page? Why would/could you not use them directly as \includegraphics[page=1,width=.45\textwidth]{somemultipagepdf} with the usual table wrappers and labels? – Aubrey Blumsohn May 11 '15 at 11:50
• No, in my real document each PDF contains tens of pages. And I have to include altogether around 20 such PDFs. So including them as figures is not really an option, unfortunetaly, as the inclusion of figures in the annex works without any problems. – ecsi May 11 '15 at 14:21

This seems to be working

\usepackage{pdfpages}
\makeatletter

both before and after loading hyperref
I just looked into the code for addtolist in pdfpages
• Pass, I think you need to file a bug report on this. addtolist is marked experimental, but this ought to work. Not quite sure what is missing. – daleif May 11 '15 at 11:08
• Hmm, I think it is because addtolist locally nulls \@makecaption which hyperref messes with to add the anchor that in this case is missing. – daleif May 11 '15 at 11:13