stackrel/overset 中帶有 hyperref 的方程中的多個腳註

stackrel/overset 中帶有 hyperref 的方程中的多個腳註

我試圖在align*環境中的等號上放置多個腳註。只需一個腳印,就很容易:

\begin{align*}
x\overset{\footnotemark}{=}y
\end{align*}
\footnotetext{Comment1}

沒關係。所以,我認為當我添加更多腳註時,latex會自動理解我:

\begin{align*}
x\overset{\footnotemark}{=}y\overset{\footnotemark}{=}z
\end{align*}
\footnotetext{Comment1}
\footnotetext{Comment2}

但當然沒有。過了一段時間我修改了一下:

\begin{align*}
x\overset{\footnotemark[1]}{=}y\overset{\footnotemark[2]}{=}z
\end{align*}
\footnotetext[1]{Comment1}
\footnotetext[2]{Comment2}

它成功了!有點......首先,我使用的是 hyperref,這些腳註沒有連結。其次,當我嘗試建立新腳註時:

\begin{align*}
x\overset{\footnotemark[1]}{=}y\overset{\footnotemark[2]}{=}z
\end{align*}
\footnotetext[1]{Comment1}
\footnotetext[2]{Comment2}

And now for something completely different\footnote{Python, M.}.

它搞亂了編號。

此外,手動插入腳註不會列印它們:

\begin{align*}
x\overset{\footnote{Comment1}}{=}y\overset{\footnote{Comment2}}{=}z
\end{align*}

(有鏈接,但沒有腳註)。

有什麼巧妙的方法來做我想做的事嗎?

答案1

如果不需要 hyperref 鏈接,那麼使用以下命令stackengine就足夠了:

\documentclass{article}
\usepackage{stackengine}
\usepackage{hyperref}
\textheight 1.5in
\stackMath
\begin{document}
\[
y \stackon[1.5pt]{=}{\setstackgap{S}{0.5pt}%
  \Shortstack{\footnotemark[1] \footnotemark[2] \footnotemark[3]}} x
\footnotetext[1]{Comment 1}
\footnotetext[2]{Comment 2}
\footnotetext[3]{Comment 3}
\]
\end{document}

在此輸入影像描述

至於 hyperref 鏈接,我可以編譯以下程式碼:

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\usepackage{hyperref}
\textheight 1.5in
\stackMath
\begin{document}
\[
y \stackon[1.5pt]{=}{\Shortstack{\footnote{Comment 1}\\\footnote{Comment 2}}} x
\]
\end{document}

雖然超連結出現在等號上方,但它們的編號錯誤,並且沒有指向頁面底部的任何有意義的文字。

相關內容