# Incompatibility between the footnote and xcolor packages

The following code fails to build:

\documentclass{book}

\usepackage{footnote}
\usepackage{xcolor}

\begin{document}

\chapter{My first chapter}

\parbox{110mm}{
Here is a footnote\footnote{The footnote is here}.
Where is my footnote?
}

\end{document}


The error produced is:

! Extra }, or forgotten \endgroup.
<argument> ...@finalstrut \strutbox }\fn@endnote }

l.13 }


If I remove the footnote package, the footnote is not exported outside of the parbox, and I need the xcolor package to produce gray lettrines somewhere else in the document.

Is that a know bug? How can I circumvent it?

-

Load footnote after xcolor. footnote contains a \let\fn@endnote\color@endgroup, this give the wrong result if xcolor hasn't been loaded yet (xcolorredefines \color@endgroup).

-
This is it! Wonderful! – ℝaphink Apr 14 '11 at 15:27
footnote should do this better \AtBeginDocument instead. – Martin Scharrer Apr 14 '11 at 19:58

You could try to combination of \footnotemark and \footnotetext to avoid having the footnote inside the \parbox. This works for you example, but is actually some technique the footnote package tries to avoid.

\documentclass{book}

\usepackage{footnote}
\usepackage{xcolor}

\begin{document}

\chapter{My first chapter}

\parbox{110mm}{
Here is a footnote\footnotemark.
Where is my footnote?
}
\footnotetext{The footnote is here}.

\end{document}


See also this TeX FAQ which is more about footnotes in tables, but partially also applies here.

-
the footnote doesn't appear in the \parbox if I don't use the footnote package, it just doesn't appear at all. – ℝaphink Apr 14 '11 at 14:54
the \footnotemark+\footnotetext does the trick. However, I'd really like to understand why \footnote won't play nice with \xcolor... – ℝaphink Apr 14 '11 at 14:57

use a minipage instead of the parbox:

\begin{minipage}{110mm}
Here is a footnote\footnote{The footnote is here}.
Where is my footnote?
\end{minipage}

-
That works, too. But the result is very different from what I expect. Using a minipage, the footnote text is put right at the end of the minipage (which makes sense), instead of being at the end of the page (where I would like it). @Martin's solution, on the other hand, allows to play the footnote text at the end of the page. – ℝaphink Apr 14 '11 at 15:12