[Tex/LaTex] Hyperref link placement: alignment to left page border and top of page

hyperreflinkspositioning

(a) Is is possible to have certain hyperref-hyperlinks (such as those to sections and also (when using memoir) to the table of contents, lists of figures and tables, and bibliography) point to the very left border of the page, not to the interior? Note that I have already tried the hypcap package, which positions figure and table links to the left edge of the text (just where the left margin ends) but not to the left page border. (For reading text, it is good if the text starts not exactly at the edge of one's viewing window but a tad into the window's border.) Also, hypcap doesn't deal with the table of contents, the lists of figures/tables, and the bibliography.

(b) If, in addition, one could make hyperlinks point not only to the left page border but also to the top left corner of the respective page, that would be a useful option. Is that possible?

If people would like starter code for this, here is some I've slightly adapted for another, related question:

\documentclass{memoir}
  % using the memoir class here is necessary
  % for all the desired hyperlinks to be created
\usepackage{hyperref}
\usepackage[all]{hypcap} % hypcap doesn't help here

\begin{document}

\tableofcontents

\section{A section}
This is the only section.

\listoftables
\listoffigures

\begin{thebibliography}{9}
\end{thebibliography}

\end{document}

Note: I am aware of the hypcap package but not sure whether/how it can be used to address this.

Best Answer

user14996 wrote:

(a) Is is possible to have certain hyperref-hyperlinks [...] point to the very left border of the page, not to the interior?

and

(b) If, in addition, one could make hyperlinks point not only to the left page border but also to the top left corner of the respective page, that would be a useful option. [...]

First I agree with the remark of canaaerus:

Just imagine the user has chosen a high zoom level and you force a jump to the top-left of the page. That point might be very far from the referenced position and the user wont be able to see it.

An alternative answer to the questions: The PDF format also supports other "view" settings for destinations. The default in hyperref is XYZ, X and Y means the anchor position and Z the zoom level (with default null meaning unchanged zoom level). If you want to get the left page border and do not mind also getting the right page border, then you can use

\hyperref{pdfview=FitH}% or FitBH that removes some white space

(Drivers hpdftex and other calculate the Y position from the current position of the anchor.)

You get the whole page with

\hyperref{pdfview=Fit}

But be aware that the user might be annoyed by having to switch the zoom level, if he cannot read the text because of a small window/screen.