代码

代码

我有三个子图,如下面的 MWE 所示,我想将子图对齐c到上面两个图下方的中心,该怎么做?

\documentclass{scrartcl}
\usepackage{caption}
\usepackage{floatrow}   
\usepackage{subcaption}
\usepackage{graphicx,xcolor} 
\usepackage[framemethod=tikz]{mdframed}

\newcommand{\fakeimage}{{\fboxsep=-\fboxrule\fbox{\rule{0pt}{3cm}\hspace{4cm}}}}

\begin{document}
\begin{figure}
\begin{mdframed}[
  align=center,
  linecolor=black,
  fontcolor=black,
  backgroundcolor=white,
  userdefinedwidth=0.9\textwidth,
  roundcorner=5pt,
  skipabove=0pt,
  skipbelow=0pt,
  leftmargin=0pt,
  innerleftmargin=20pt,
  innerrightmargin=0pt,
  innertopmargin=5pt,
  innerbottommargin=5pt, 
  innerlinewidth=0pt,
  middlelinewidth=0pt,
  outerlinewidth=1pt]
\floatsetup[subfigure]{captionskip=10pt}
%===================== the two upper subfigures ================
\begin{minipage}{.44\textwidth}
    \begin{subfigure}{\linewidth}
    \centering
    \fakeimage
    \caption{Image}\label{fig:image1}
    \end{subfigure}\\[0ex] %
    \qquad
\end{minipage}
\begin{minipage}{.44\textwidth}
    \begin{subfigure}{\linewidth}
    \centering
    \fakeimage
    \caption{Image}\label{fig:image12}
   \end{subfigure}
\end{minipage}%
\vfill
%===================== the one below subfigure ================
\begin{minipage}[c]{.94\textwidth}
  \centering
  \begin{subfigure}{\linewidth}
  \fakeimage
  \caption{Image}\label{fig:image3}
  \end{subfigure} 
\end{minipage}%
\end{mdframed}
\RawCaption{\caption{General caption}
\label{fig:images}}
\end{figure}
\end{document}

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

答案1

minipage我根本不会用;只要subfigure够用就行。

代码

\documentclass{scrartcl}
\usepackage{caption}
\usepackage{floatrow}   
\usepackage{subcaption}
\usepackage{graphicx,xcolor} 
\usepackage[framemethod=tikz]{mdframed}

\newcommand{\fakeimage}{{\fboxsep=-\fboxrule\fbox{\rule{0pt}{3cm}\hspace{4cm}}}}

\begin{document}
\begin{figure}
\begin{mdframed}[
  align=center,
  linecolor=black,
  fontcolor=black,
  backgroundcolor=white,
  userdefinedwidth=0.9\textwidth,
  roundcorner=5pt,
  skipabove=0pt,
  skipbelow=0pt,
  leftmargin=0pt,
  innerleftmargin=20pt,
  innerrightmargin=0pt,
  innertopmargin=5pt,
  innerbottommargin=5pt, 
  innerlinewidth=0pt,
  middlelinewidth=0pt,
  outerlinewidth=1pt]
\floatsetup[subfigure]{captionskip=10pt}
%===================== the two upper subfigures ================
% \begin{minipage}{.44\textwidth}
    \begin{subfigure}{.44\linewidth}
    \centering
    \fakeimage
    \caption{Image}\label{fig:image1}
    \end{subfigure} %
    \qquad
% \end{minipage}
% \begin{minipage}{.44\textwidth}
    \begin{subfigure}{.44\linewidth}
    \centering
    \fakeimage
    \caption{Image}\label{fig:image12}
   \end{subfigure}
% \end{minipage}%
% \vfill
\\[2ex]
%===================== the one below subfigure ================
% \begin{minipage}[c]{.94\textwidth}
% \centering
  \begin{subfigure}{\linewidth}
  \centering
  \fakeimage
  \caption{Image}\label{fig:image3}
  \end{subfigure} 
% \end{minipage}%
\end{mdframed}
\RawCaption{\caption{General caption}
\label{fig:images}}
\end{figure}
\end{document}

输出

在此处输入图片描述

答案2

你可能已经想到了这一点,但我还是会使用 tikzeditor?在那里画东西超级容易,而且你可以按照你想要的任何方式对齐所有内容。

相关内容