3

I am using package thmbox to write theorems. If I include footnote or marginpar within the body of a theorem, the following problems arise: the text of the footnote is simply missing, while the marginpar produces the error Float(s) lost., and then the text of the marginpar is also missing. The same occurs with package thmtools with optin thmbox. It seems that the first problem can be solved following the answers in this question. Is there a better solution? What about the second problem? An example follows.

\documentclass{article}

% LaTeX original ==> OK
%\newtheorem{theorem}{Theorem}

% package thmbox ==> wrong
\usepackage{thmbox}
\newtheorem{theorem}{Theorem}

% package thmtools with option thmbox ==> wrong
%\usepackage{thmtools}
%\declaretheorem[thmbox=M]{theorem}

\begin{document}

\begin{theorem}
     Marginpar\marginpar{marginpar.}
     Footnote\footnote{footnote.}
\end{theorem}

\end{document}
2

You can "abuse" the tablefootnote package with adding a \spewnotes command (a detailed explanation of \spewnotes is given at https://tex.stackexchange.com/a/39500/6865).

\documentclass{article}

\usepackage{thmbox}
\newtheorem{theorem}{Theorem}
\usepackage{marginnote}

\usepackage{hyperref}

\usepackage{tablefootnote}

\makeatletter
\newcommand{\spewnotes}{%
\tfn@tablefootnoteprintout%
\global\let\tfn@tablefootnoteprintout\relax%
\gdef\tfn@fnt{0}%
}
\makeatother

\begin{document}

\begin{theorem}
     Marginpar\marginnote{marginpar.}
     Footnote\tablefootnote{footnote.}
     Footnote\tablefootnote{another footnote.}
\end{theorem}
\spewnotes

Footnotes below.

\end{document}

The explanation why footnotes in a theorem do not work was already given by egreg in his answer, thus I do not repeat it here.

4

thmbox includes the statement of theorems inside boxes and footnotes can't appear there; try

\mbox{a footnote\footnote{Missing}}

The same happens for \marginpar, because it uses the same mechanism of \footnote.

You can use \footnotemark and \footnotetext, as explained in the LaTeX guides. For \marginpar there is \marginnote of the marginnote package:

\documentclass{article}

\usepackage{thmbox}
\newtheorem{theorem}{Theorem}
\usepackage{marginnote}

\begin{document}

\begin{theorem}
     Marginpar\marginnote{marginpar.}
     Footnote\footnotemark
\end{theorem}
\footnotetext{footnote.}

\end{document}
  • Nice. What if I would like to hyperref two footnotes in the same theorem? – ASdeL Jan 14 '12 at 19:50
  • @ASdeL: To use hyperef just see my answer. The explanation of egreg is still correct, and he informed about the marginnote package, therefore +1 to his answer also from me. – Stephen Jan 15 '12 at 17:58

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.