I would like to create a framed boxes containing arbitrary text, captioned tables and captioned figures. But mdframed
does not allow floats inside. How does one achieve this? Something like this does not work because you cannot insert a float inside mdframed
:
\begin{mdframed}
\lipsum[4-6]
\begin{figure}\centering{\includegraphics[width=8cm,height=5cm]{exampleimg}\caption{exampleimg}}\end{figure}
\lipsum[1-3]
\end{mdframed}
\begin{mdframed}
\lipsum[4-6]
\begin{threeparttable}
\caption{\label{milk-consumption-india}Asdkj sdlkj sldkjf lskjd flograms per capita per annum}
\begin{center}
\begin{tabulary}{\textwidth}{lrrr}
Year & Rural & Urban & All\\
\hline
1983 & 38.7 & 55.6 & 44.7\\
1993–1994 & 50.3 & 66.4 & 54.3\\
2004–2005 & 50.2 & 69.3 & 55\\
2009–2010 & 51.7 & 71.6 & 57.1\\
\end{tabulary}
\end{center}
\begin{tablenotes}
\item[] \footnotesize Source: \citet{anjani2014}
\end{tablenotes}
\end{threeparttable}
\lipsum[1-3]
\end{mdframed}
How to insert a table or a figure inside mdframed
box without making it float?