[Tex/LaTex] footnote in a tcolorbox environment

footnotestcolorbox

How can I get a footnotemark defined in an tcolorbox environment that appears in two or three pages, but the respective footnotetext printed out in the footer of the first page?

The image shows three pages and one big tcolorbox with a \footnotemark inside the environment, and the respective \footnotetext located at the footer.
enter image description here
[footnote within tccolorbox ]

Best Answer

If I understand your question correctly, you want to refer to the same footnote from multiple colorboxes. The footnote should furthermore appear at the bottom of a page, not in a colorbox.

The code below provides the answer. Apparently, all you need is footnote labeling because footnotes in tcolorboxes make use of different counters and use letters, which turns out to be very convenient.

\documentclass{article}
\usepackage[paperheight=3in,paperwidth=5in]{geometry}
\usepackage{tcolorbox}

\begin{document}

% The footnote is placed on the page where you place this:
My global footnote is defined here\footnote{\label{name}This is my global footnote.}
% The label is required to refer to the footnote.


\begin{tcolorbox}
 % Refer to the same footnote as follows:
 Second reference to global footnote\footnotemark[\ref{name}]
  \begin{tcolorbox}
    % It's still possible to use local footnotes, which by default (and rather conveniently) uses letters in the tcolorbox environment and has its own counter:
  A local footnote\footnote{This is a local footnote}

  Third reference to global footnote\footnotemark[\ref{name}]

  % Another local footnote, not disturbed by the counter of the global footnote:
  A local footnote\footnote{This is my second local footnote}
 \end{tcolorbox}
\end{tcolorbox}

\end{document}

result

If you do not want the reference to the global footnote to appear where it's defined, then replace \footnote{\label{... for \addtocounter{footnote}{1}\footnotetext{\label{....