表格单元格和边界框的高度

表格单元格和边界框的高度

是否可以计算tabular单元格的高度并将其重新用作边界框垂直偏移的值,类似于如何将实际声明的Hy@raisedlink位置带到上面一行?hypertarget

\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}

答案1

  • \target{hist}设置在“inner self”之后,文本的右侧。根据视图设置,PDF 查看器将跳转到目标位置,您将只看到右侧的空白区域。

  • prepdfTeX支持附加关键字\vadjust。这有助于将目标放在当前框正上方,周围垂直框的左侧。然后\target可以按以下方式实现:

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

相关内容