超引用和对齐

超引用和对齐

我正在进行一个冗长的证明,通过归纳法证明 (i) - (vi) 成立。

在证明过程中,我多次提到(i),...,(iv),并希望它们成为超链接,以便当读者点击例如(i)时,PDF 会跳转到(i) - (vi)的概述。

在此处输入图片描述

\documentclass[a4paper,fontsize=13pt]{scrartcl}

\usepackage[english, main=ngerman]{babel}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{xfrac}
\usepackage{enumitem}
\usepackage{aligned-overset}
\usepackage{hyperref}



\begin{document}

We show by induction that for all $k \in \mathbb{N}_{0}$ it holds that
%
\begin{align*} 
    &\text{(i)}  &   x^{2 k}&=(\beta_{1} \beta_{2})^{k} x^{0} \,,  \quad&   &\text{(iii)} & \Delta_{2 k}&=(\beta_{1} \beta_{2})^{k} \Delta_{0}\,, \quad& & \text{(v)}& \rho_{2 k} &\equiv \theta \, ,\\
    &\text{(ii)} &   x^{2 k+1}&=x^{2 k} \,,                           \quad&   &\text{(iv)}  & \Delta_{2 k+1}&=\beta_{1}\left(\beta_{1} \beta_{2}\right)^{k} \Delta_{0}\,, \quad& & \text{(vi)}& \rho_{2 k+1} &\equiv 1 \, .
\end{align*}

%...
%several pages later
%...

Because of (i) and (ii) we have that ...


\end{document}

答案1

重做

\documentclass[a4paper,fontsize=12pt]{scrartcl}
\usepackage[english, main=ngerman]{babel}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}

\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{aligned-overset}
\usepackage{hyperref}

\makeatletter
\newcommand{\hit}[2]{%
  \ifmeasuring@
  \else
    \phantomsection
    \expandafter\gdef\csname hit@#1\endcsname{#2}%
    \ltx@label{#1}%
  \fi
  \textup{(#2)}%
}
\newcommand{\hir}[1]{%
  \hyperref[#1]{%
    \ifcsname hit@#1\endcsname
      \textup{(\csname hit@#1\endcsname)}%
    \else
      ??%
    \fi
  }%
}
\makeatother

\begin{document}

We show by induction that for all $k \in \mathbb{N}_{0}$ it holds that
%
\begin{alignat*}{6}
         & \hit{h1}{i}\   & x^{2 k}&=(\beta_{1} \beta_{2})^{k} x^{0} \,,
  &\qquad& \hit{h3}{iii}\ & \Delta_{2 k}&=(\beta_{1} \beta_{2})^{k} \Delta_{0}\,,
  &\qquad& \hit{h5}{v}\   & \rho_{2 k} &\equiv \theta \,,
\\
         & \hit{h2}{ii}\  & x^{2 k+1}&=x^{2 k} \,,
  &\qquad& \hit{h4}{iv}\  & \Delta_{2 k+1}&=\beta_{1}(\beta_{1} \beta_{2})^{k} \Delta_{0}\,,
  &\qquad& \hit{h6}{vi}\  & \rho_{2 k+1} &\equiv 1 \, .
\end{alignat*}

%...
%several pages later
%...

Because of \hir{h1} and \hir{h2} we have that ...

\end{document}

在此处输入图片描述

旧答案

一种简单的方法是使用\hypertarget\hyperlink;麻烦的是需要使用两个参数,但也许可以设计出更好的方法。

\documentclass[a4paper,fontsize=12pt]{scrartcl}
\usepackage[english, main=ngerman]{babel}
\usepackage[a4paper,left=3cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}

\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{aligned-overset}
\usepackage{hyperref}

\newcommand{\hit}[2]{\raisebox{\fontcharht\font`T}{\hypertarget{#1}{}}{\textup{(#2)}}}
\newcommand{\hir}[2]{\hyperlink{#1}{\textup{(#2)}}}

\begin{document}

We show by induction that for all $k \in \mathbb{N}_{0}$ it holds that
%
\begin{align*} 
   &\hit{h1}{i}   & x^{2 k}&=(\beta_{1} \beta_{2})^{k} x^{0} \,,
  &&\hit{h3}{iii} & \Delta_{2 k}&=(\beta_{1} \beta_{2})^{k} \Delta_{0}\,,
  &&\hit{h5}{v}   & \rho_{2 k} &\equiv \theta \,,
\\
   &\hit{h2}{ii}  & x^{2 k+1}&=x^{2 k} \,,
  &&\hit{h4}{iv}  & \Delta_{2 k+1}&=\beta_{1}(\beta_{1} \beta_{2})^{k} \Delta_{0}\,,
  &&\hit{h6}{vi}  & \rho_{2 k+1} &\equiv 1 \, .
\end{align*}

%...
%several pages later
%...

\newpage

Because of \hir{h1}{i} and \hir{h2}{ii} we have that ...


\end{document}

答案2

除非在某种设置中显示这六个标准是绝对必要的align,否则我会使用内联enumerate列表。

在此处输入图片描述

\documentclass[a4paper,fontsize=13pt]{scrartcl}

\usepackage[english, main=ngerman]{babel}
\usepackage[a4paper,hmargin=3cm]{geometry}
\usepackage[inline]{enumitem}
\usepackage{aligned-overset}

\usepackage{amssymb}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[noabbrev,nameinlink]{cleveref}

\begin{document}

We show by induction that for all $k \in \mathbb{N}_{0}$ it holds that
\begin{enumerate*}[label=(\roman*)] 
\item $x^{2 k}=(\beta_{1} \beta_{2})^{k} x^{0}$\label{item:1}, 
\item $x^{2 k+1}=x^{2 k}$\label{item:2},
\item $\Delta_{2 k}=(\beta_{1} \beta_{2})^{k} \Delta_{0}$, 
\item $\Delta_{2 k+1}=\beta_{1}(\beta_{1} \beta_{2})^{k} \Delta_{0}$,
\item $\rho_{2 k} \equiv \theta$, and
\item $\rho_{2 k+1} \equiv 1$.
\end{enumerate*}

Because of \labelcref{item:1,item:2} we have \dots
\end{document}

相关内容