使用尾注时向图表添加脚注

使用尾注时向图表添加脚注

考虑一下代码

\documentclass{article}
\usepackage{xcolor,graphicx}
\usepackage{lipsum}
\usepackage{endnotes}
\let\footnote=\endnote

\usepackage{caption}


\makeatletter
\define@key{Gin}{color}{\def\Gin@color{#1}}

\setlength{\fboxsep}{0pt}% Remove \fbox separation
\let\oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{%
  \ifnum\pdfstrcmp{#2}{example-image}=0%
    \begingroup
      \setkeys{Gin}{color=red,#1}% Default color is red
      \colorbox{\Gin@color}{\phantom{\oldincludegraphics[#1]{#2}}}%
    \endgroup
  \else
    \oldincludegraphics[#1]{#2}%
  \fi
}
\makeatother


\begin{document}
\thispagestyle{empty}

\lipsum[13]\footnote{First endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
     \caption{\textbf{\scshape{\large Red Figure}}}
\end{figure}
\vskip 15pt
\lipsum[13]\footnote{Second endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em,color=purple]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption{\textbf{\scshape{\large Purple Figure}}}
\end{figure}
\vskip 15pt
\lipsum[13]\footnote{Third endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em,color=blue]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption{\textbf{\scshape{\large Blue Figure}}}\footnote{a footnote, not an endnote---I want to display this with an asterisk, and in the usual fashion at the bottom of the first page (NOT IN THE NOTES).}
\end{figure}


\newpage
\theendnotes
\end{document}

产生输出

在此处输入图片描述

在此处输入图片描述

问题:我想将 (尾注) 4 标记为 (脚注) *,将星号置于标题“蓝色图”的右侧;并将脚注显示在靠近第 1 页底部的脚注线下的通常位置——同时将其从注释部分中删除。如何实现这一点?

谢谢。

答案1

\footnotetext请注意,如果图形飘走,您可能必须移动到另一页。另一方面,它现在忽略footnote计数器(\endnote使用计数器endnote)。

\documentclass{article}
\usepackage{xcolor,graphicx}
\usepackage{lipsum}
\usepackage{endnotes}
\let\footnote=\endnote
\def\thefootnote{*}

\usepackage{caption}


\makeatletter
\define@key{Gin}{color}{\def\Gin@color{#1}}

\setlength{\fboxsep}{0pt}% Remove \fbox separation
\let\oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{%
  \ifnum\pdfstrcmp{#2}{example-image}=0%
    \begingroup
      \setkeys{Gin}{color=red,#1}% Default color is red
      \colorbox{\Gin@color}{\phantom{\oldincludegraphics[#1]{#2}}}%
    \endgroup
  \else
    \oldincludegraphics[#1]{#2}%
  \fi
}
\makeatother


\begin{document}
\thispagestyle{empty}

\lipsum[13]\footnote{First endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
     \caption{\textbf{\scshape{\large Red Figure}}}
\end{figure}
\vskip 15pt
\lipsum[13]\footnote{Second endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em,color=purple]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption{\textbf{\scshape{\large Purple Figure}}}
\end{figure}
\vskip 15pt
\lipsum[13]\footnote{Third endnote.}
\begin{figure}[!htb]
\centering
  \includegraphics[width=3em,height=3em,color=blue]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption[]{\textbf{\scshape{\large Blue Figure}}\footnotemark}
\end{figure}
\footnotetext{a footnote, not an endnote---I want to display this with an asterisk, and in the usual fashion at the bottom of the first page (NOT IN THE NOTES).}

\newpage
\theendnotes
\end{document}

相关内容