I want to click on the link and open an attached PDF in a specific page.
Asked
Active
Viewed 1,245 times
1
1 Answers
1
If you are creating the document, you can either use \hypertarget to create the anchor name, or use \label and look in the aux file to find the corresponding anchor name. If you have no control over the document, you can read the PDF file with an ASCII editor and search for the list of names (if any).
Target document (named test4):
\documentclass{article}
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage{lipsum}% genertic text
\begin{document}
\lipsum[1-5]
\hypertarget{eq1}{\begin{equation}
x=a
\end{equation}}
\lipsum[6-10]
\end{document}
Main document:
\documentclass{article}
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage{lipsum}% genertic text
\begin{document}
As shown in \href[pdfnewwindow]{test4.pdf\#eq1}{(1)} we know that $x=a$.
You can find this equation on \href[pdfnewwindow]{test4.pdf\#page.2}{page 2}.
\end{document}
The page.2 anchor was generated by hyperref automatically. The is no guarantee it will work for all documents.
John Kormylo
- 79,712
- 3
- 50
- 120
-
1You can address absolute page numbers with
\href[pdfnewwindow,page=2]{test4.pdf}{page 2}that doesn't depend on named destinations in the target pdf. – Ulrike Fischer Feb 11 '22 at 09:57 -
Follow-up question: Expansion to create a link to open attached PDF in a specfic page. – Peter Grill Mar 07 '22 at 20:37
http://texdoc.net/texmf-dist/doc/latex/listings/listings.pdf#page=20or evenhttp://texdoc.net/texmf-dist/doc/latex/listings/listings.pdf#subsection.4.2– Henri Menke Jul 21 '16 at 22:46