Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have put the title of my text in mdframed, however the title has a footnote. After I LaTeX the file, the footnote appears inside the frame rather than in its usual place, i.e. at the bottom of the page. I wonder how this problem can be fixed.

share|improve this question
    
Is the problem in the fact that the framed text splits across pages, leaving the footnote mark on one page and the footnote text on the following? –  egreg Dec 28 '12 at 22:53
add comment

1 Answer

up vote 4 down vote accepted

Using a separate \footnotemark-\footnotetext combination should work, as in the following minimal working example. The former inside and the latter outside the mdframed environment:

enter image description here

\documentclass{article} 
\usepackage{mdframed}% http://ctan.org/pkg/mdframed
\usepackage[paperheight=15\baselineskip]{geometry}% http://ctan.org/pkg/geometry
\begin{document}
\begin{mdframed}
  Some text\footnote{A footnote}.
\end{mdframed}
\bigskip
\begin{mdframed}
  Some text\footnotemark.
\end{mdframed}
\footnotetext{Another footnote.}
\end{document}

geometry was used just for this example.


For page-breaking related placement of footnotes, the following is a possibility, however hackish. Using the above approach, \footnotetext will only place the footnote at the end of the mdframed, possibly on an incorrect page. Manual adjustment of the footnote counter could help:

enter image description here

\documentclass{article} 
\usepackage{lipsum,mdframed}% http://ctan.org/pkg/{lipsum,mdframed}
\usepackage[paperheight=15\baselineskip]{geometry}% http://ctan.org/pkg/geometry
\begin{document}
\begin{mdframed}
  Some text\footnote{A footnote}.
\end{mdframed}
\bigskip
\stepcounter{footnote}
\footnotetext{Another footnote.}
\addtocounter{footnote}{-1}
\begin{mdframed}
  Some text\footnotemark. \par
  \lipsum[1]
\end{mdframed}
\end{document}

Using \footnotetext[\the\numexpr\value{footnote}+1\relax]{Another footnote.} could also work, assuming an \arabic setting for a footnote.

share|improve this answer
    
Thank you for your reply. It is working. –  Reza Dec 28 '12 at 23:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.