2

Is it possible to calculate the height of a tabular cell to be reused as a value for vertical offset of the bounding box, similarly to how Hy@raisedlink takes you one line above of where the actual hypertarget is declared?

\documentclass{article} 
\usepackage{marginnote}
\usepackage{pgfplots}
\usepackage{pbox}
\usepackage[heightrounded]{geometry}
\usepackage[toc,titletoc,page]{appendix}

% User-defined colors
\definecolor{dgreen}{RGB}{0,100,0}
\definecolor{violet}{RGB}{238,130,238}

% Cross-references
\usepackage[pageanchor]{hyperref}
\hypersetup{colorlinks=true,
        linkcolor=red,
        hypertexnames=false,
        pdfhighlight=/N,
        pdfstartview={XYZ null null 1.00}
        }%
\makeatletter
\newcommand{\target}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}
\makeatother % Fancier cross-referencing to text

\begin{document}

\subsection{I can see the sun}

\subsubsection{Many large aircraft}

\marginnote{\linebreak\linebreak\linebreak\hyperlink{hist}{Appendix \texttt{hist()} $\rightarrow$}}[-.5cm]

xxxxxxxxxxxx

\subsubsection{Computations}

\newpage
\begin{appendices}

\section{\textbf{\textcolor{blue}{R}abooF}}

\noindent Fooba\textcolor{blue}{\textbf{R}}.

\noindent \begin{tabular}[h]{l l l c c} 
\\
\textcolor{blue}{\textbf{R}} code & Syntax & xatnyS & Vecto\textbf{\textcolor{blue}{R}} & xxxxxxxxxxx\\
\\
\hline
\\
\texttt{hist()} & \pbox{20cm}{\vspace*{1.5ex} \texttt{\textcolor{blue}{hist(}\textcolor{cyan}{<z>},} \\ \vspace{1.25ex} \\  \texttt{\textcolor{dgreen}{breaks=}\textcolor{red}{<y>},} \\ \\ \vspace{3.5ex} \\ \texttt{\textcolor{violet}{freq=}\textcolor{purple}{<x>}\textcolor{blue}{)}} \\ \\} & \pbox{3.5cm}{Positronic tales \\ \hypertarget{appendix.rcommand.breaks}{}\vspace{0ex} \\ My reckoning \\ \\ \texttt{\textcolor{purple}{TRUE}}: truly a wondrous appearance \texttt{\textcolor{purple}{FALSE}}: connect to your inner self\target{hist}} & & $\leftarrow$ \\
\end{tabular}
\end{appendices}
\newpage

xxxxxxxxxxxx

\end{document}
2
  • Wouldn't it be easier just to make the entire tabular the target? Commented May 5, 2014 at 3:38
  • Not if there are several different targets to different cell-heights.
    – 1010011010
    Commented May 5, 2014 at 18:12

1 Answer 1

2
  • \target{hist} is set after "inner self", at the right side of the text. Depending on the view settings, the PDF viewer will jump to the location of the target and you will just see the empty space at the right side.

  • pdfTeX supports the additional keyword pre for \vadjust. This helps to put a target just above the current box at the left side of the surrounding vertical box. Then \target could be implemented the following way:

    \newcommand*{\target}[1]{%
      \vadjust pre{\hypertarget{#1}{}}%
    }
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .