使用 tcolorbox 添加脚注

使用 tcolorbox 添加脚注

我想知道如何在 tcolorbox 之外放置脚注。下面是我使用常用​​脚注命令得到的一个简单示例:

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}

\begin{document}
\begin{tcolorbox}
this is text\footnote{and a footnote inside the box} but I would like to have this footnote at the end of the page
\end{tcolorbox}
\end{document}

答案1

在此处输入图片描述

\documentclass[10pt,a4paper]{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}

\usepackage{tcolorbox}
\usepackage{footnote}
\BeforeBeginEnvironment{tcolorbox}{\savenotes}
\AfterEndEnvironment{tcolorbox}{\spewnotes}
\begin{document}
    \begin{tcolorbox}
        this is text\footnote{and a footnote inside the box} but I would like to have this footnote at the end of the page
    \end{tcolorbox}
\end{document}

相关内容