General ⇒ PDFpages and Hyperref
PDFpages and Hyperref
I am importing from PDF files using PDFpages using code that looks like this:
\includepdf[pagecommand={\thispagestyle{plain}}, pages=1,
fitpaper=true, addtolist={1, map, Area of fieldwork activities
and place names mentioned in the text,
carte_mentionnes}]{figs/carte_mentionnes}
This works very well and addtolist= creates the proper line on the TOC.
However, the link back to the imported page does not work. Instead, the TOC link takes my to the first page of my document. I have tried link=true but cannot get this to work.
Could some one please tell me how to make hyperref and PDFpages work together so that the TOC links work back to the included page.
Thanks!
\includepdf[pagecommand={\thispagestyle{plain}}, pages=1,
fitpaper=true, addtolist={1, map, Area of fieldwork activities
and place names mentioned in the text,
carte_mentionnes}]{figs/carte_mentionnes}
This works very well and addtolist= creates the proper line on the TOC.
However, the link back to the imported page does not work. Instead, the TOC link takes my to the first page of my document. I have tried link=true but cannot get this to work.
Could some one please tell me how to make hyperref and PDFpages work together so that the TOC links work back to the included page.
Thanks!
NEW: TikZ book now 40% off at Amazon.com for a short time.

- countbela666
- Posts: 64
- Joined: Thu Apr 26, 2007 2:44 pm
PDFpages and Hyperref
Could you provide a minimum example reproducing the error you're confronted with? The code you posted above works if I use it in the following way:
Regards
Marcel
Code: Select all
Code, edit and compile here:
\documentclass[demo,english,all]{article}\usepackage{babel,blindtext,pdfpages,hyperref,hypcap}\def\demofig{\begin{figure}\centering\includegraphics{foo}\caption{I'm figure \thefigure}\end{figure}}\begin{document}\listoffigures\Blindtext\demofig\demofig\includepdf[%pagecommand={\thispagestyle{plain}},pages=1,fitpaper=true,addtolist={1,figure,{Some interesting title},fig:pdf}]%{foo}\Blindtext\demofig\demofig\end{document}
Marcel
Listen to me children of the night, beyond the doors of darkness you will find
a thousand worlds for you to see here, take my hand and follow me...
a thousand worlds for you to see here, take my hand and follow me...
Re: PDFpages and Hyperref
I'm having the same problem....here's a MWE:
\documentclass{article}
\usepackage{pdfpages}
\usepackage{amsmath,amssymb,amsthm,paralist}
\usepackage{graphicx}
\begin{document}
\listoffigures
blah blah blah~\ref{sBib}
\includepdf[pages={1-5},
addtolist={5, table, Literature references for annotated genes, \pageref{sBib}}, label={sBib}]
{Image}
\label{sBib}
\end{document}
How do I get the label so that I can refer to this pdf figure elsewhere in my document?
\documentclass{article}
\usepackage{pdfpages}
\usepackage{amsmath,amssymb,amsthm,paralist}
\usepackage{graphicx}
\begin{document}
\listoffigures
blah blah blah~\ref{sBib}
\includepdf[pages={1-5},
addtolist={5, table, Literature references for annotated genes, \pageref{sBib}}, label={sBib}]
{Image}
\label{sBib}
\end{document}
How do I get the label so that I can refer to this pdf figure elsewhere in my document?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
PDFpages and Hyperref
From your code I assume that you want to insert an image in PDF format. If so, just use the \includegraphics command from the graphicx package.
Thorsten
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: PDFpages and Hyperref
Sorry for the confusion. I'm actually trying to add a 'supplementary bibliography' which is 5 pages long and contains references for certain figures. I know, bibtex makes bibliographies...but my boss is difficult and insisted this bibliography be prepared in word. Rather than having to convert to bibtex, I'd like to just insert the pages as pdf print-out. Does this help clear things up?
PDFpages and Hyperref
I think you probably want something like:
For addtolist, the first number gives how many pages into the included pdf you want the list to link to -- presumably you want this to go to the first page, not the last one, if you're inserted five pages.
You'd want a list of tables not a list of figures if you're adding this as a table. (Do you really want it as a table though?)
The last thing is the actual name of the label you want if you want to refer to this elsewhere. It's not a place to refer to the label.
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{pdfpages}\usepackage{amsmath,amssymb,amsthm,paralist}\usepackage{graphicx}\begin{document}\listoftablesblah blah blah~\ref{sBib}\includepdf[pages={1-5},addtolist={1, table, {Literature references for annotated genes}, sBib}]{sbib.pdf}\end{document}
You'd want a list of tables not a list of figures if you're adding this as a table. (Do you really want it as a table though?)
The last thing is the actual name of the label you want if you want to refer to this elsewhere. It's not a place to refer to the label.
PDFpages and Hyperref
For myself, the package only seems to work to the extend of placing my figure into the list of figures. But when I attempt to use or to refer to the figure, it produced a compiler error - Reference undefined.
Any help into what the problem can be is greatly appreciated. I have followed the instructions on this forum as thus far.
Code: Select all
\ref
Code: Select all
\pageref
Any help into what the problem can be is greatly appreciated. I have followed the instructions on this forum as thus far.