使用 threeparttable 围绕图形进行 mdframed

使用 threeparttable 围绕图形进行 mdframed

我正在尝试使用 threeparttable 在图形周围绘制边框(使用 mdframed)。但是,边框的大小调整不正确。如何调整边框以正确环绕图像?请参阅下面的 MWE:

\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}

结果是: 在此处输入图片描述

图片 abbildung_kopfschmerzen.png:。顺便说一句,我无法添加 threeparttable 作为标签。

答案1

\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}

在此处输入图片描述

相关内容