# footnote in a tcolorbox environment

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. [footnote within tccolorbox ]

• Welcome to TeX.SX! Could you please make your question a bit clearer? – egreg Aug 28 '15 at 21:25
• See the answer here too: tex.stackexchange.com/a/503492/120578 Footnote is redefined to be a global footnote even if it is inside the tcolorbox or outside of it. – koleygr Aug 9 '19 at 8:16
• Hello @koleygr , I'm afraid that my cuestion was not perfectly done. If you repeat your first example in [link]tex.stackexchange.com/a/503492/120578[link]  \begin{testexample}[Latin Text] \lipsum[1]\footnote{my first footnote} \\ \lipsum[1] \lipsum[1] \lipsum[1] \lipsum[1] \lipsum[2]\footnote{Another Footnote} \end{testexample} you will see the first footnote text in page 2, while the footnote mark is in page 1. And I wanted the footnote text in the first page (in the page where the footnote mark lies). Thank you – JOM Aug 14 '19 at 15:12
• @JOM ... I just print the footnote text there just after the environment and haven't take care about starting the environment in other page than finishing... I could do it some time. – koleygr Aug 14 '19 at 15:34
• It's okay @koleygr , seems to be an issue to me. I just want that every footnotemark in an especific page to be paired with its respective footnotetext in the same page. thanks! – JOM Aug 15 '19 at 20:04

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}


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{....

• Forgive me for my english. It is only one (actual) \footmark in a tcolorbox environment that spreads on three pages. I want the \footmark printed inside de tcolorbox, and I wish to choose that the \footnotetext appears in the first footer – JOM Aug 29 '15 at 12:29
• OK @JJMDriessen. I tried your code and it works (the global footnote has not to be the first one). Thanks The problem now is when I use my macros. LaTeX says ! Missing number, treated as zero. <to be read again> \protect l.20 ...e inside tcolorbox\footnotemark[\ref{name}] – JOM Aug 29 '15 at 13:17