\footnote 交叉引用图片标题内

\footnote 交叉引用图片标题内

我想要将几张图片引用到同一个脚注中。

这是两张共享同一脚注的图片

\begin{figure}[!ht]
  \begin{center}
    \leavevmode
    \includegraphics[width=0.86\textwidth]{figures/bottleneck_resnet}
    \caption[Bottleneck Design of Residual Neural Networks]{Bottleneck Design of Residual Neural Networks\footnote{\label{fn:resnet}https://towardsdatascience.com/review-resnet-winner-of-ilsvrc-2015-image-classification-localization-detection-e39402bfa5d8}}
    \label{fig:bottleneck_arch}
  \end{center}
\end{figure}

\begin{figure}[!ht]
  \begin{center}
    \leavevmode
    \includegraphics[width=0.9\textwidth]{figures/resnet_archs}
    \caption[ResNet overall architecture for all network]{ResNet overall architecture for all network\footref{fn:resnet}}
    \label{fig:resnet_arch_table}
  \end{center}
\end{figure}

但是,使用这种方法时,我的图像没有被引用,我得到的是“??”。我也尝试\footnotemark在标题内使用 而\footnotetext不是footnote。第一个会引用前一个脚注,第二个也不会正确引用。我应该把我的 放在哪里\footnote{\label{fn:resnet}https://towardsdatascience.com/review-resnet-winner-of-ilsvrc-2015-image-classification-localization-detection-e39402bfa5d8}才能引用它?

问候

答案1

浮点数中既不能使用\footnote\footnotetext不能使用 ,但\footnotemark这样没问题。我不确定 hyperref 如何定位脚注而不是\footnotemark,但它确实定位了。

请注意,脚注可能不会与浮动在同一页上。但是,必须\footnotetext在之后不久\footnotemark(在任何其他脚注之前)调用才能使其起作用。也不能使用可选参数。

\documentclass{article}
\usepackage{graphicx}
\usepackage{footmisc}
\usepackage{hyperref}

\begin{document}
\begin{figure}[ht]
  \centering
    \includegraphics[width=0.86\textwidth]{example-image-a}
    \caption[Bottleneck Design of Residual Neural Networks]{Bottleneck Design of Residual Neural Networks\footnotemark}
    \label{fig:bottleneck_arch}
\end{figure}

\footnotetext{\label{fn:resnet}%
  https://towardsdatascience.com/review-resnet-winner-of-ilsvrc-2015-image-classification-localization-detection-e39402bfa5d8}

\begin{figure}[ht]
  \centering
    \includegraphics[width=0.9\textwidth]{example-image-b}
    \caption[ResNet overall architecture for all network]{ResNet overall architecture for all network\footref{fn:resnet}}
    \label{fig:resnet_arch_table}
\end{figure}
\end{document}

此解决方案\footnotemark通过使用可选参数并放置\refstepcounter在脚注内来绕过该过程。它更强大,因为 (A) 它可以处理每个浮动中的多个脚注,并且 (B) 它用于\afterpage将脚注与浮动放在同一页上(假设浮动有标题和标签)。

它不能做的一件事是将脚注放在与 [p] 浮点数相同的页面上。

\documentclass{article}
\usepackage{graphicx}
\usepackage{footmisc}
\usepackage{afterpage}
\usepackage{hyperref}

\newcommand{\footpage}[2]% #1 = label for \pageref, #2 = \footnote arg
 {\ifnum\value{page}<\getpagerefnumber{#1}\relax
    \afterpage{\footpage{#1}{#2}}%
  \else
    \stepcounter{footnote}% cannot put \refstepcounter into optional argument of \footnotetext
    \footnotetext[\thefootnote]{\addtocounter{footnote}{-1}\refstepcounter{footnote}#2}%
  \fi}

\begin{document}
\footpage{fig:bottleneck_arch}{\label{fn:resnet}%
  https://towardsdatascience.com/review-resnet-winner-of-ilsvrc-2015-image-classification-localization-detection-e39402bfa5d8}

\begin{figure}[ht]
  \centering
    \includegraphics[width=0.86\textwidth]{example-image-a}
    \caption[Bottleneck Design of Residual Neural Networks]{Bottleneck Design of Residual Neural Networks\footref{fn:resnet}}
    \label{fig:bottleneck_arch}
\end{figure}


\begin{figure}[ht]
  \centering
    \includegraphics[width=0.9\textwidth]{example-image-b}
    \caption[ResNet overall architecture for all network]{ResNet overall architecture for all network\footref{fn:resnet}}
    \label{fig:resnet_arch_table}
\end{figure}
\end{document} 

相关内容