0

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}
  • 1
    See Can I get a normal footnote in a minipage environment in LaTeX? How? Not an exact duplicate but the solution using \footnotemark/\footnotetext is the same. – campa Dec 11 '19 at 12:45
  • Unrelated: \f{z} and $f(z)$ differ by one keystroke, and yet I believe the second one is much more clear. (Very personal opinion, of course.) – campa Dec 11 '19 at 12:49
  • @campa Yes, but it prevents me from keep pressing dollar sign for inline formulas. In that case it's much quicker when you write math. – 147875 Dec 11 '19 at 12:54
  • 2
    It might be faster to type, but now your missing the clear separation between text and math in your code. So I agree with campa, not recommendable. – daleif Dec 11 '19 at 17:39
  • Thank you @daleif, I'll make sure I won't repeat again. Is there any package or tips that would help me in faster typing the manuscript? – 147875 Dec 12 '19 at 9:53
3

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

|improve this answer|||||
  • 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? – Schrödinger's cat 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.