答案1
尝试endnotes
(目前不适用于嵌套tcolorbox
环境):
\documentclass{article}
\usepackage{endnotes}
\usepackage{tcolorbox}
\makeatletter
\AtBeginEnvironment{tcolorbox}{%
\setcounter{endnote}{0}%
\renewcommand\theendnote{\alph{endnote}}%
% uncomment next line if you prefer \footnote than \endnote
% \let\footnote\endnote
}
\AfterEndEnvironment{tcolorbox}{%
\ifnum\c@endnote>0
\begingroup
\let\enoteheading=\@empty
\theendnotes
\endgroup
\fi
}
\makeatother
\begin{document}
\begin{tcolorbox}
content\endnote{note} content\endnote{another note}
\end{tcolorbox}
\begin{tcolorbox}
content
\end{tcolorbox}
\begin{tcolorbox}
content\endnote{note2} content\endnote{another note2}
\end{tcolorbox}
\begin{tcolorbox}
content\endnote{note3} content\endnote{another note3}
\begin{tcolorbox}
content\endnote{note31} content\endnote{another note31}
\end{tcolorbox}
\end{tcolorbox}
\end{document}
答案2
这是一种简单直接的纯 LaTeX 方法。也许可以更优雅地解决这个问题,但万一其他一切都失败了:
\documentclass{article}
\usepackage{tcolorbox}
\newenvironment{fnwrapper}{%
\noindent%
\begin{minipage}{\textwidth}%
\renewcommand{\thefootnote}{\alph{footnote}}%
\renewcommand{\footnoterule}{}%
}{%
\end{minipage}%
}
\begin{document}
Hello!\footnote{foo}
\bigskip
\begin{fnwrapper}
\begin{tcolorbox}
Boxed hello\footnotemark[1]
Another boxed hello\footnotemark[2]
\end{tcolorbox}
\footnotetext[1]{bar}
\footnotetext[2]{baz}
\end{fnwrapper}
\bigskip
Hello again\footnote{qux}
\end{document}