Text FormattingHow to link to specified page of an outer pdf document!

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
latexstudio
Posts: 2
Joined: Sat Dec 19, 2009 5:29 pm

How to link to specified page of an outer pdf document!

Post by latexstudio »

Recently,I made a beamer, and want to link a pdf I have made before,but I only link to the first page of pdf document using the command”\href{doc/mydoc.pdf}{thedoc}“.Someone said "use \href{doc/mydoc.pdf#page.5}{thedoc}or \href{doc/mydoc.pdf#page=5}{thedoc}"but it doesn't work.
Who knows?

Many thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

How to link to specified page of an outer pdf document!

Post by gmedina »

Hi,

perhaps the xr package could be useful for you.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
latexstudio
Posts: 2
Joined: Sat Dec 19, 2009 5:29 pm

How to link to specified page of an outer pdf document!

Post by latexstudio »

gmedina wrote:Hi,

perhaps the xr package could be useful for you.
Thank you
If I do not have the pdf's source file, it also doesn't work!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

How to link to specified page of an outer pdf document!

Post by frabjous »

All hyperref/pdflatex can do is insert a link of a certain form. It's up to the PDF viewer what to do with that link, and I don’t think there’s a standard link format for pages of external PDF files. Even if some viewers have implemented something for this, it wouldn’t be a robust solution.

My suggestion would be to actually include the linked-to PDF in the PDF you’re creating, and then you can use features of the pdfpages package to insert hyperlink targets for the included pages, and then you can use internal links. A quick example:

Code: Select all

\documentclass{article}
\usepackage{pdfpages}
\usepackage{hyperref}
\begin{document}
Here's a \hyperlink{included.pdf.2}{link to to page 2 of the included pdf}.
\includepdf[pages=1-5,link=true]{included.pdf}
\end{document}
I'm not sure how well this works with beamer, however, if at all.
Post Reply