0

I'm in conflict with how mdframed handles footnotes inside environments that span multiple pages. Consider this MWE

\documentclass{article}

\usepackage{lipsum}

\usepackage[framemethod=tikz]{mdframed}
\newmdenv[%
    hidealllines=true,
    backgroundcolor=blue!10,
]{bluebox}

\begin{document}
\begin{bluebox}
\lipsum[1]
Here comes a footnote.\footnote{Footnote 1.}
\lipsum[2]
Here comes another footnote.\footnotemark
\lipsum[3-5]
\end{bluebox}
\footnotetext{Footnote 2.}
\end{document}

which outputs enter image description here enter image description here

My preferred behavior would be for footnotes to appear inside the blue box, but with the same counting scheme (1, 2, 3, ...) as outside the environment and on the same page as the reference in the text. Any ideas how to implement this?

2
  • that isn't really default behaviour, it must be specific footnote code in mdframed package, I assume. Mar 14, 2016 at 8:58
  • @DavidCarlisle Changed my wording.
    – Janosh
    Mar 14, 2016 at 9:07

1 Answer 1

1

The problem as I understand is to have the output as shown in this picture: footnotes in bluebox with alphabetic numbering

To produce this with a arabic numbering as seen here:

desired outcome

adjust the counter

\thempfootnote

as shown in the code for the desired outcome:

\documentclass{article}

\usepackage{lipsum}
\usepackage[framemethod=tikz]{mdframed}
\newmdenv[%
hidealllines=true,
backgroundcolor=blue!10,
]{bluebox}

\renewcommand{\thempfootnote}{\arabic{mpfootnote}}% <-- This changes to arabic numbers.
\begin{document}

    \begin{bluebox}
        \lipsum[1]
        Here comes a footnote.\footnote{Footnote 1.}
        \lipsum[2]
        Here comes another footnote.\footnote{Footnote 2.}
        \lipsum[3-5]
    \end{bluebox}

\end{document}

see also Gonzalo's or Leo's answers regarding footnotes on which I based the above code.

EDIT: A rather crude, but working way would be:

\enlargethispage{3cm}
\begin{bluebox}
    \lipsum[1]
    Here comes a footnote.\footnote{Footnote 1.}
    \lipsum[2]
    Here comes another footnote.\footnote{Footnote 2.}
    \lipsum[3-5]
\end{bluebox}
\clearpage
2
  • Yes, but the footnotes should also move up a page to appear at the bottom of the blue box on the first page since that is the page they are referenced on.
    – Janosh
    Mar 14, 2016 at 10:03
  • @Casimir: well, I tried to pack everything inside a minipage, but that only messed up the pagination.
    – naphaneal
    Mar 14, 2016 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .