Directory macros/latex/contrib/tcbpagefootnote
tcbpagefootnote Package
LaTeX: Page footnotes from inside tcolorbox
tcolorbox typesets the content of a box like a minipage: a \footnote inside the box is numbered with the mpfootnote counter (as a, b, c) and its text is put at the bottom of the box.
The tcbpagefootnote package adds the tcolorbox key page footnote. With it, the footnotes in the title, the upper part and the lower part of the box
- are numbered with the
footnotecounter and\thefootnote, along with the footnotes of the body text, and - are put at the bottom of the page where the box is: their texts are collected while the box is typeset and are put into the ordinary footnote insertion right after the box. If the box moves to the next page, its footnotes move with it.
\footnote[<number>], \footnotemark with \footnotetext, \tcbox, and boxes with page footnote inside each other work as usual. With hyperref, each footnote mark links to its own footnote text.
Breakable boxes. A breakable box that is broken across pages puts each footnote text on the page of its mark, like the body text does, and each part of the box leaves room for its footnotes. This is done in one run, in a way that depends on the engine. With LuaLaTeX, the footnote texts are real insertions at their marks; when tcolorbox splits the content of the box, each part keeps the insertions of its marks, and tcbpagefootnote moves them out of the part to its page (tcbpagefootnote.lua). With the other engines, each footnote text is typeset at its mark and kept in a box, and a TeX mark (\marks) at the footnote mark tells which part the footnote belongs to; the content is split again, from a copy, until the part and its footnotes fit. With every engine, what a part leaves for its footnotes is computed with the \count\footins and \skip\footins of the column of the part: a package may change them from column to column (e.g. ftnright in the two columns of LaTeX).
Breakable boxes inside breakable boxes. tcolorbox does not break a box inside another box. With the tcbnestbreak package it does: a breakable box inside a breakable box is broken together with the outer box. If both boxes have page footnote, the footnotes of the inner box are put on the pages of their marks as well.
Tagged PDF. With the new footnote code of LaTeX (loaded e.g. by \DocumentMetadata{tagging=on}), the footnote text is typeset where its mark is, as in a minipage, and the typeset text is put into the footnote insertion after the box. The text is typeset by the \@footnotetext of the page: if a package has put code around \@footnotetext, e.g. to set the footnotes in another width, it acts on the footnotes of a box as well. In the structure tree, the footnote (FENote) then directly follows its mark (Lbl), as for a footnote in the body text (latex3/tagging-project#1709).
Footnotes that are not split. The package works with the footnotenosplit package, which keeps TeX from splitting a footnote: a footnote of a box that TeX moves to the next page as a whole gets the space of \footnotetopkern above it, as a footnote of the body text does. In general, where the package typesets a footnote text in a box and puts it into the footnote insertion later, the insertion gets the parameters that the \@footnotetext of the page has set (\interlinepenalty, \splittopskip, \splitmaxdepth, \floatingpenalty).
Vertical writing. page footnote also works in tate, with the tate classes of pLaTeX and upLaTeX (e.g. tarticle and utarticle) and of LuaTeX-ja (e.g. ltjtarticle). With pLaTeX and upLaTeX, load the pxpgftate package as well: without it, TikZ/PGF, and so tcolorbox, draws the boxes sideways in tate. tcbpagefootnote does not load it itself.
\documentclass[dvipdfmx]{tarticle} \usepackage{tcbpagefootnote} \usepackage{pxpgftate}
- Supported formats/engines: pdfLaTeX, XeLaTeX, LuaLaTeX (with or without LuaTeX-ja), pLaTeX, upLaTeX (+ dvipdfmx); yoko and tate
Files
| File | Description |
|---|---|
tcbpagefootnote.sty |
The package |
tcbpagefootnote.lua |
Lua code for breakable boxes (LuaLaTeX) |
tcbpagefootnote.tex / .pdf |
Documentation |
test-*.tex |
Test suite (see below) |
Requirements
tcolorbox(thehookslibrary is loaded by the package)- Tested with TeX Live 2025 (frozen: LaTeX2ε 2025-11-01, tcolorbox 6.9.0) and TeX Live 2026 (LaTeX2ε 2026-11-01, tcolorbox 6.10.0); tagged PDF is tested with TeX Live 2026 only
- For tate with pLaTeX and upLaTeX:
pxpgftate(in TeX Live from 2026 on; with TeX Live 2025, install it from CTAN)
Installation
Copy tcbpagefootnote.sty and tcbpagefootnote.lua to your local TeX tree: $TEXMF/tex/latex/tcbpagefootnote/
Usage
\usepackage{tcbpagefootnote} \begin{tcolorbox}[title=Note, page footnote] Text\footnote{A page footnote.}. \end{tcolorbox} \newtcolorbox{note}[1][]{colback=blue!5, page footnote, #1} \tcbset{page footnote} % for every box
page footnote is the same as page footnote=true. page footnote=false takes the key back: the footnotes of the box are footnotes of the box, as without the package. It is given to a box, or with \tcbset for the boxes that follow.
\tcbset{page footnote} \begin{tcolorbox}[page footnote=false] Text\footnote{A footnote of the box.}. \end{tcolorbox}
From some boxes a footnote text cannot get to the page: a box with float, and a box in a float (figure, table), in a minipage, in a \parbox, or in a tcolorbox without the key. Such a box has its footnotes as with page footnote=false, so \tcbset{page footnote} can be given for a whole document.
Errors, warnings and limitations
page footnotedoes nothing for a box from which a footnote text cannot get to the page: a box withfloat, and a box that is typeset inside another box (in a float, in aminipage, in a\parbox, in a cell of atabular) or in a tcolorbox without the key. Its footnotes are footnotes of the box. A box in a cell of alongtableor atabularxkeeps the key, since these environments take the footnote texts to the page themselves. A\tcboxhas no footnotes of the box, so in such a place its footnote texts are lost, as with tcolorbox alone.page footnotetakestrueorfalse; another value is an error.- Keys that set a hook of the box as a whole (
before title,before upper,before lower,after,after skip,nobeforeafter) can come before or afterpage footnote: the hooks get the code of the key again when all the options of the box are set. Onlyforce nobeforeafter, which sets theaftercode at that time as well, removes the code that puts the footnotes when it comes afterpage footnote(error): give it before the key. - In a
multicolsenvironment, where the footnotes are below all the columns, abreakablebox that is broken puts the footnote texts of all its parts where the box ends, and the package warns. - With an engine other than LuaTeX, a footnote inside a box of the content of a broken box (e.g. a
\footnotetextin atabular) can be put on the page after that of its mark: TeX does not see the mark of such a footnote when the content is split. Also, the footnote text is typeset through\@footnotetextwith\insertredefined; a class or package whose\@footnotetextdoes not use\insert\footinsis not supported there. - With LuaLaTeX, the part of a broken box on a page that has no footnote before the box is up to
\skip\footins(the space above the footnotes) shorter than withoutpage footnote, when the part has no footnote but the rest of the box has one. - With pLaTeX and upLaTeX in tate, a
\footnotetextin vertical mode (e.g. right after a box) does not work with the new footnote code of LaTeX (\DocumentMetadata), with or without this package. Put it in a paragraph.
Testing
make test compiles every test with pdfLaTeX, XeLaTeX, LuaLaTeX, pLaTeX and upLaTeX (+ dvipdfmx), and checks the log. make test TEXBIN=<directory of the binaries> runs the tests with another TeX Live than the one in PATH; PXPGFTATE=<directory> (default: ../pxpgftate) and FNS=<directory> (default: ../footnotenosplit) are where pxpgftate and footnotenosplit are taken from if that TeX Live does not have them.
TPF-RESULT OK: every footnote text is typeset exactly once, with its own mark, on the expected page, as a page footnote or as a footnote of the box (recorded at shipout to the.auxfile and checked when it is read back at\end{document}; seetest-common.tex).test-hyperref,test-tagging-hyperref: no warning on a duplicate or missing destination in the log or in the output of the engine and (x)dvipdfmx.- No tcbpagefootnote warning in any test.
test-breakable-long: no overfull page and no split footnote (% splitof\tracingpages) in the log.test-twocolumn: no overfull page, no split footnote, and the parts of the boxes are in the expected columns (TPF-COLUMN, from the position on the page at shipout).test-width,test-breakable-long-width,test-tagging-width,test-tagging-breakable-long-width(pdflatex, lualatex):test-basic.texandtest-breakable-long.tex, without and with tagging, with code around\@footnotetextthat sets the footnotes of the page in another width (\TPFwidthoftest-common.tex); every page footnote has this width.test-tagging(pdflatex, xelatex, lualatex; only with TeX Live 2026 or later, skipped with an older one):test-tagging.luareads the structure tree withshow-pdf-tagsand finds everyFENoteright after itsLbl, except the two\footnotemarkwhose texts are given later by\footnotetext.test-tate: the same checks as fortest-basic,test-breakableandtest-breakable-long, in tate.test-nested(if tcbnestbreak is in../tcbnestbreak, or inTNB=<directory>): every footnote text is on the page of its mark, no overfull page and no split footnote; also with hyperref, with tagging and in tate.test-nosplitand the tests named*-nosplit(with footnotenosplit):TPF-RULE OK: no page has a footnote rule without a footnote, and the first footnote below the rule is as far from the rule on every page (from the positions on the page at shipout), also where it is a footnote that TeX has moved to the next page; no warning of footnotenosplit.- The tests named
*-global(pdflatex, lualatex, platex):test-breakable.tex,test-breakable-long.tex,test-twocolumn.tex,test-nosplit.texandtest-nested.texwith\TPFglobaloftest-common.tex: the boxes on the page have the key only from\tcbset{page footnote}; the same checks, also with tagging. test-errors: the expected error message.
| Test | Engines | What it covers |
|---|---|---|
test-basic.tex |
pdflatex, xelatex, lualatex (article, ltjsarticle), platex, uplatex | title/upper/lower, several footnotes, \footnote[9], \footnotemark/\footnotetext, nested boxes, an ordinary box, \tcbox, \newtcolorbox, \tcbset, a box moved to the next page |
test-hyperref.tex |
pdflatex, xelatex, lualatex, platex, uplatex | test-basic.tex with hyperref |
test-breakable.tex |
pdflatex, xelatex, lualatex, platex, uplatex | a box broken by \tcbbreak with footnotes in its title, upper and lower part (each footnote on the page of its mark), an unbroken breakable box, an unbreakable box after a broken one |
test-key.tex |
pdflatex, xelatex, lualatex, platex, uplatex; with hyperref, with tagging, in tate | the values of the key, with \tcbset{page footnote} for the whole document: a box that has the key only from \tcbset, also broken by \tcbbreak; page footnote=false for a box; page footnote=true; the key given again after false or after after skip; \tcbset{page footnote=false} in a group; before title, before upper, before lower, after and after skip after the key. Boxes with footnotes of the box although they have the key: with float and float*, in a figure, in a minipage, in a \parbox, in a box without the key. \tcbox and \newtcbox in a paragraph; reset; the key in a style; the key for every box (every box/.append style); hooks with a macro parameter; the app and pre keys of the hooks library; parbox=false; force nobeforeafter before the key |
test-key-libs.tex |
pdflatex, xelatex, lualatex, platex, uplatex; with tagging, in tate | boxes of the libraries of tcolorbox with \tcbset{page footnote}: the boxes of a tcbraster (the key from \tcbset, from raster every box and from the options of a box), a box of \newtcbtheorem, a boxed title, sidebyside, \tcbincludegraphics, tcblisting |
test-breakable-long.tex |
pdflatex, xelatex, lualatex (article, ltjsarticle), platex (jarticle, jsarticle), uplatex; with hyperref | boxes that TeX breaks across several pages: a box that starts in the middle of a page, footnotes of one and of several lines in every part, a footnote only in the last part, height fixed for, boxes inside a broken box |
test-twocolumn.tex |
pdflatex, xelatex, lualatex, platex, uplatex; with ftnright | boxes broken across the two columns of LaTeX (\twocolumn): a part that fills the right column and has footnotes, a box from the right column to the left column of the next page; with ftnright, \count\footins and \skip\footins differ from column to column |
test-nested.tex |
pdflatex, xelatex, lualatex (article, ltjsarticle), platex, uplatex; with hyperref, with tagging, in tate | with tcbnestbreak: breakable boxes with page footnote inside a breakable box, three levels deep, with footnotes in a title and in a lower part; an unbreakable box inside; a box without the key |
test-japanese.tex |
lualatex (ltjbook), platex (jbook), uplatex (ujbook) | a Japanese document |
test-tagging.tex |
pdflatex, xelatex, lualatex, platex, uplatex | test-basic.tex (and test-breakable.tex, test-breakable-long.tex, test-japanese.tex, with hyperref) with \DocumentMetadata{tagging=on}; pLaTeX and upLaTeX do not write a structure tree, so only the log is checked |
test-tate.tex |
platex (tarticle), uplatex (utarticle), lualatex (ltjtarticle) | test-basic.tex, test-breakable.tex and test-breakable-long.tex in tate, with pxpgftate for pLaTeX and upLaTeX |
test-nosplit.tex |
pdflatex, xelatex, lualatex (article, ltjsarticle), platex (jarticle, jsarticle), uplatex; with hyperref, with tagging | with footnotenosplit: footnotes that TeX moves to the next page as a whole, of the body text, of an unbreakable box and of a breakable box, also of boxes with a text color. test-basic.tex, test-hyperref.tex, test-breakable-long.tex and test-nested.tex are also run with footnotenosplit, also with tagging and in tate |
test-errors.tex |
pdflatex | the error messages (force nobeforeafter after the key, also with the key from \tcbset; a value that is not true or false; key already defined) |
test-common.tex holds the helpers shared by the tests, and test-tagging.lua the check of the structure tree.
Repository
- https://github.com/munepi/tcbpagefootnote
- Bug reports: https://github.com/munepi/tcbpagefootnote/issues
License
This package is licensed under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version.
Copyright (c) 2026 Munehiro Yamamoto
Download the contents of this package in one zip archive (236.5k).
Tcbpagefootnote – Page footnotes from inside tcolorbox
tcolorbox typesets the content of a box like a minipage: a \footnote inside the box is numbered with the mpfootnote counter and its text is put at the bottom of the box. This package adds the tcolorbox key page footnote, with which the footnotes in the title, upper and lower part of a box are numbered along with the footnotes of the body text and are put at the bottom of the page where the box is.
Nested boxes, \footnotemark/\footnotetext, \tcbox and hyperref (each footnote text keeps the anchor of its own mark) are supported. A breakable box broken across pages puts each footnote text on the page of its mark.
Supported formats/engines: pdflatex, XeLaTeX, LuaLaTeX, pLaTeX, upLaTeX (with dvipdfmx), in horizontal and vertical writing (with pLaTeX and upLaTeX in vertical writing, load the pxpgftate package as well).
| Package | Tcbpagefootnote |
| Bug tracker | |
| Repository | |
| Version | 1.8 2026-12-04 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2026 Munehiro Yamamoto |
| Maintainer | Munehiro Yamamoto |
| Contained in | TeX Live as tcbpagefootnote MiKTeX as tcbpagefootnote |
| Topics | Tagged PDF – fully compatible Boxing Footnote |