Generalhow to fix anchor problem for a landscape long table

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

how to fix anchor problem for a landscape long table

Post by zhiwanxu »

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.

Recommended reading 2024:

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

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

Post by localghost »

There is a workaround by using the hypcap package (part of the oberdiek bundle).

Code: Select all

\usepackage[all]{hypcap}
The current version of caption and hyperref should make this superflous.


Best regards
Thorsten¹
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

further question: fix anchor problem in landscape long table

Post by zhiwanxu »

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
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how to fix anchor problem for a landscape long table

Post by localghost »

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.
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

how to fix anchor problem for a landscape long table

Post by zhiwanxu »

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.
Attachments
datacomp.sty
(4.12 KiB) Downloaded 154 times
15.tex
(4.34 KiB) Downloaded 179 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

how to fix anchor problem for a landscape long table

Post by localghost »

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.
zhiwanxu
Posts: 16
Joined: Thu Aug 07, 2008 5:14 pm

Re: how to fix anchor problem for a landscape long table

Post by zhiwanxu »

Hi,

Here is the BoxedEPS.tex.

Thanks.
Attachments
BoxedEPS.tex
(25 KiB) Downloaded 184 times
Post Reply