General ⇒ how to fix anchor problem for a landscape long table
how to fix anchor problem for a landscape long table
Hi,
I use \caption for my long table and also use \landscape to rotate the table. The \label command is right after \caption command. Whenever I click on that table hyperlink in pdf file, it will jump to the last page of that table instead of the top of that table. The same commands work well for non-rotated long table, is anyone know how to fix this anchor problem?
Thanks for your help.
I use \caption for my long table and also use \landscape to rotate the table. The \label command is right after \caption command. Whenever I click on that table hyperlink in pdf file, it will jump to the last page of that table instead of the top of that table. The same commands work well for non-rotated long table, is anyone know how to fix this anchor problem?
Thanks for your help.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to fix anchor problem for a landscape long table
There is a workaround by using the hypcap package (part of the oberdiek bundle).
The current version of caption and hyperref should make this superflous.
Best regards
Thorsten¹
Code: Select all
\usepackage[all]{hypcap}
Best regards
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
further question: fix anchor problem in landscape long table
Dear Thorsten,
Thanks for your reply, however it fixes all except the table with the following format:
\usepackage{times}
\usepackage{color}
\usepackage{longtable}
\setlongtables
\usepackage{rotating}
\usepackage{lscape}
\usepackage[hyperindex, pdfmark]{hyperref}
\usepackage[all]{hypcap}
\begin{landscape}
\begin{document}
\begin{longtable}{|c|c|c|c|c|c|c|l|}
\caption{Resonances}
\label{resonances}\\
\hline
$E_{\rm res}$ (MeV${}\pm{}$keV)
& $\Gamma_{\rm lab}$ (keV)
& $\Gamma_{\rm n}$ (keV)
& $\Gamma_{\rm p}$ (keV)
& $\Gamma_{\alpha}$ (keV)
& $J^{\pi}$
& \nuc{15}{N}* (MeV)
& \multicolumn{1}{|c|}{Refs.}\\
\hline
\endfirsthead
\caption{Resonances (continued)} \\
\hline
$E_{\rm res}$ (MeV${}\pm{}$keV)
& $\Gamma_{\rm lab}$ (keV)
& $\Gamma_{\rm n}$ (keV)
& $\Gamma_{\rm p}$ (keV)
& $\Gamma_{\alpha}$ (keV)
& $J^{\pi}$
& \nuc{15}{N}* (MeV)
&\multicolumn{1}{|c|}{Refs.}\\
\hline
\endhead
\hline
\endlastfoot
.........
\end{longtable}
\end{document}
\end{landscape}
Do you see any mistakes?
Thanks again!
Grace
Thanks for your reply, however it fixes all except the table with the following format:
\usepackage{times}
\usepackage{color}
\usepackage{longtable}
\setlongtables
\usepackage{rotating}
\usepackage{lscape}
\usepackage[hyperindex, pdfmark]{hyperref}
\usepackage[all]{hypcap}
\begin{landscape}
\begin{document}
\begin{longtable}{|c|c|c|c|c|c|c|l|}
\caption{Resonances}
\label{resonances}\\
\hline
$E_{\rm res}$ (MeV${}\pm{}$keV)
& $\Gamma_{\rm lab}$ (keV)
& $\Gamma_{\rm n}$ (keV)
& $\Gamma_{\rm p}$ (keV)
& $\Gamma_{\alpha}$ (keV)
& $J^{\pi}$
& \nuc{15}{N}* (MeV)
& \multicolumn{1}{|c|}{Refs.}\\
\hline
\endfirsthead
\caption{Resonances (continued)} \\
\hline
$E_{\rm res}$ (MeV${}\pm{}$keV)
& $\Gamma_{\rm lab}$ (keV)
& $\Gamma_{\rm n}$ (keV)
& $\Gamma_{\rm p}$ (keV)
& $\Gamma_{\alpha}$ (keV)
& $J^{\pi}$
& \nuc{15}{N}* (MeV)
&\multicolumn{1}{|c|}{Refs.}\\
\hline
\endhead
\hline
\endlastfoot
.........
\end{longtable}
\end{document}
\end{landscape}
Do you see any mistakes?
Thanks again!
Grace
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to fix anchor problem for a landscape long table
Your code gives me many errors hence I can give no hints for solving the problem. Please provide a minimal working example (MWE). Follow the instructions on the linked page to make that MWE compilable for everybody.
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
how to fix anchor problem for a landscape long table
Dear Thorsten and the community,
Thanks for your reply.
If I run the following file 15.tex by using my style file, Datacomp.sty (see below for files) by using the commands: latex 15.tex dvips -z 15.dvi -Ppdf -o 15.ps
ps2pdf 15.ps 15.pdf ( I need to create ps file first for personal reason.)
Then, I click the blue link 15.1 in 15.pdf, it will be anchored to the second page of the table instead of the top of the table.
Can you see why?
Thanks again for your patience to answer my question.
Thanks for your reply.
If I run the following file 15.tex by using my style file, Datacomp.sty (see below for files) by using the commands: latex 15.tex dvips -z 15.dvi -Ppdf -o 15.ps
ps2pdf 15.ps 15.pdf ( I need to create ps file first for personal reason.)
Then, I click the blue link 15.1 in 15.pdf, it will be anchored to the second page of the table instead of the top of the table.
Can you see why?
Thanks again for your patience to answer my question.
- Attachments
-
- datacomp.sty
- (4.12 KiB) Downloaded 154 times
-
- 15.tex
- (4.34 KiB) Downloaded 179 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to fix anchor problem for a landscape long table
Your example is not compilable. The datacomp.sty file requires a file called BoxedEPS.tex, which is not available on my system. Hence the compiling process is interrupted. Please put this file as attachment to your next post.
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: how to fix anchor problem for a landscape long table
Hi,
Here is the BoxedEPS.tex.
Thanks.
Here is the BoxedEPS.tex.
Thanks.
- Attachments
-
- BoxedEPS.tex
- (25 KiB) Downloaded 184 times