3

My footnote disappear in shaded environment as shown in the following example. How to fix this, please? Thank you!

\documentclass[english]{scrartcl}

\usepackage{graphics}
\usepackage{environ}
\usepackage[round]{natbib}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\setkomafont{disposition}{\normalfont\bfseries}
\usepackage[printwatermark]{xwatermark}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{framed}

\colorlet{shadecolor}{gray!40}

\begin{document}

\title{}
\maketitle

\begin{shaded}
\begin{enumerate}
\item I love my mother.\footnote{Of course.} 
\end{enumerate}
\end{shaded}

\end{document}

Picture

8

From the framed manual:

The contents of the framed regions are restricted: Floats, footnotes, margin-pars and head-line entries will be lost.

So, simply use \footnotemark inside the shaded environment and \footnotetext{Of course.} just after it.

MWE:

\documentclass[english]{scrartcl}

\usepackage{graphics}
\usepackage{environ}
\usepackage[round]{natbib}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\setkomafont{disposition}{\normalfont\bfseries}
\usepackage[printwatermark]{xwatermark}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{framed}

\colorlet{shadecolor}{gray!40}

\begin{document}

\title{}
\maketitle

\begin{shaded}
\begin{enumerate}
\item I love my mother.\footnotemark
\end{enumerate}
\end{shaded}
\footnotetext{Of course.}

\end{document} 

Output

enter image description here


EDIT

If you have more than one footnote inside the shaded environment, then number your \footnotetexts, as in the following example:

\documentclass[english]{scrartcl}

\usepackage{graphics}
\usepackage{environ}
\usepackage[round]{natbib}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\setkomafont{disposition}{\normalfont\bfseries}
\usepackage[printwatermark]{xwatermark}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage{framed}

\colorlet{shadecolor}{gray!40}

\begin{document}

\title{}
\maketitle

\begin{shaded}
\begin{enumerate}
\item I love my mother.\footnotemark
\item And my father,too.\footnotemark
\end{enumerate}
\end{shaded}
\footnotetext[1]{Of course.}
\footnotetext[2]{Of course, again.}

And some text outside\footnote{A footnote}
\end{document}

Output:

enter image description here

  • Thank you. I forgot to ask what if I have more than one footnote? – LaTeXFan Jan 20 '15 at 14:26
  • @LaTeXfan See the edit – karlkoeller Jan 20 '15 at 16:35

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.