3

I'm trying to draw a border around a figure (using mdframed) with a threeparttable. However, the size of the border is not adjusted correctly. How can I adjust the border to correctly wrap around the image? See an MWE below:

\documentclass[oneside,ngerman,english]{scrbook}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\makeatletter
\usepackage{mdframed,threeparttable}
\makeatother
\usepackage{babel}
\begin{document}
\begin{figure}[h]
\begin{mdframed}
\caption{\textbf{Primary headaches}}
\centering
\begin{threeparttable}
\includegraphics[scale=0.6]{abbildung_kopfschmerzen.png}
\begin{tablenotes}[para]
\textbf{Erlaeuterungen:} TTH=Kopfschmerzen vom Spannungstyp (Tension Type Headache)
\end{tablenotes}
\end{threeparttable}
\end{mdframed}
\end{figure}
\end{document}

The result is: enter image description here

The picture abbildung_kopfschmerzen.png: . Btw, I couldn't add threeparttable as a tag.

3
\documentclass[oneside,ngerman,english]{scrbook}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
%\makeatletter % <---I think this is not needed
\usepackage{mdframed,threeparttable}
%\makeatother <---I think this is not needed
\usepackage{babel}
\begin{document}
\begin{figure}[h]
\begin{mdframed}{
\caption{\textbf{Primary headaches}}
\centering
\begin{threeparttable}
\includegraphics[width=1\textwidth]{mdframed-1.png} %--- change [scale=0.6] to [width=1\textwidth] and I have renamed your figure for my convenience. You can use your name itself.
\begin{tablenotes}[para]
\textbf{Erlaeuterungen:} TTH=Kopfschmerzen vom Spannungstyp (Tension Type Headache)
\end{tablenotes}
\end{threeparttable}}
\end{mdframed}
\end{figure}
\end{document}

enter image description here

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.