2

I tried to add a footnote in a tcolorbox based theorem environment, which is showing right inside the theorem box. How to position footnote at the bottom of the page?

enter image description here

\documentclass[a4paper]{article}

% ------------------------------------------------------------------------------------------
%                                   Packages Required
% ------------------------------------------------------------------------------------------

\usepackage{amsthm}
\usepackage{tcolorbox}

% ------------------------------------------------------------------------------------------
%                           tcolorbox and theorem Environment
% ------------------------------------------------------------------------------------------

\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {theorem}% name
  {Theorem}% title
  {%
    colback=green!5,
    colframe=green!35!black,
    fonttitle=\bfseries,
  }% options
  {thm}% prefix

\makeatletter
% ------------------------------------------------------------------------------------------
%                                   User defined Commands
% ------------------------------------------------------------------------------------------

\newcommand{\reals}{\mathbb{R}}
\renewcommand{\qedsymbol}{$\blacksquare$}
\newcommand{\f}[1]{$f(#1)$}
\newcommand{\tcb@cnt@theoremautorefname}{Theorem}
\makeatother

% ------------------------------------------------------------------------------------------

\begin{document}

\begin{theorem}{Cauchy's Theorem}{}
Let C be a simple\footnote{A simple curve is one which does not cross itself.}. closed curve with continously turning tangents except possibly at a finite number of of points (otherwise curve must be smooth). If \f{z} is analytic on and inside C, then 
\begin{equation}
\oint_{C} f(z) \, dz = 0
\end{equation}
\end{theorem}

\end{document}
147875
  • 135

1 Answers1

6

You can obtain what you want with etoolbox and the footnote package (from the mdwtools bundle):

\documentclass[a4paper]{article}

% ------------------------------------------------------------------------------------------
% Packages Required
% ------------------------------------------------------------------------------------------

\usepackage{amsthm}
\usepackage{tcolorbox}
% ------------------------------------------------------------------------------------------
% tcolorbox and theorem Environment
% ------------------------------------------------------------------------------------------

\tcbuselibrary{theorems}
\newtcbtheorem
  []% init options
  {theorem}% name
  {Theorem}% title
  {%
    colback=green!5,
    colframe=green!35!black,
    fonttitle=\bfseries,
  }% options
  {thm}% prefix

\makeatletter
% ------------------------------------------------------------------------------------------
% User defined Commands
% ------------------------------------------------------------------------------------------

\newcommand{\reals}{\mathbb{R}}
\renewcommand{\qedsymbol}{$\blacksquare$}
\newcommand{\f}[1]{$f(#1)$}
\newcommand{\tcb@cnt@theoremautorefname}{Theorem}
\makeatother

% ------------------------------------------------------------------------------------------

\usepackage{footnote}
\usepackage{etoolbox}
\BeforeBeginEnvironment{theorem}{\savenotes}
\AfterEndEnvironment{theorem}{\spewnotes}

\begin{document}

\vspace*{13cm}

\begin{theorem}{Cauchy's Theorem}{}
Let C be a simple\footnote{A simple curve is one which does not cross itself.}. closed curve with continously turning tangents except possibly at a finite number of of points (otherwise curve must be smooth). If \f{z} is analytic on and inside C, then
\begin{equation}
\oint_{C} f(z) \, dz = 0
\end{equation}
\end{theorem}

\end{document} 

enter image description here

Bernard
  • 271,350
  • What is the purpose of using instead of \oint, Let C be instead of Let $C$ be , and inside C, instead of and inside $C$, and f(z) \, dz instead of f(z) \, \mathrm{d}z? –  Dec 11 '19 at 15:51
  • @Schrödinger'scat: For the first point, sorry, I didn't pay attention to what my editor was displaying. It is configured to do some ‘pretty display’, i.e. when it reads \oint, it displays (but saves the code as \oint). For the other points, I simply copied the code in the O.P., and didn't check whether this code corresponded to the image. – Bernard Dec 11 '19 at 16:46
  • @Schrödinger'scat: What's is the difference between $dz$ and $\mathdrm{d}z$, since I don't find much difference between them. Please enlighten me, so that I can write better syntax. Any source for math-texing is fine. – 147875 Dec 12 '19 at 10:06
  • 3
    @Bernard your solution work great for short tcolorbox environments. But with breakable environments the footnote shows up after the box has been break. If the footnote call is at the beginning of the box, the footnote appears in the wrong page. Do you know how to fix this? – TeXtnik Nov 20 '20 at 15:34
  • 2
    And the footnote mark is not in sync with general footnotes – TeXtnik Nov 20 '20 at 15:44