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'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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted
\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

share|improve this answer
    
Perfect, thanks a lot. –  Jan Mar 19 '12 at 12:31

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.