General ⇒ PDFpages and Hyperref
PDFpages and Hyperref
\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.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- countbela666
- Posts: 64
- Joined: Thu Apr 26, 2007 2:44 pm
PDFpages and Hyperref
Code: Select all
\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
a thousand worlds for you to see here, take my hand and follow me...
Re: PDFpages and Hyperref
\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
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: PDFpages and Hyperref
PDFpages and Hyperref
Code: Select all
\documentclass{article}
\usepackage{pdfpages}
\usepackage{amsmath,amssymb,amsthm,paralist}
\usepackage{graphicx}
\begin{document}
\listoftables
blah 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
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.