使用子标题对齐图形

使用子标题对齐图形

我正在尝试使用副标题包裹。

我当前的代码是:

\documentclass[11pt,twocolumn]{article}

\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{caption}

\begin{document}

    \begin{figure}[htpb]
        \subcaptionbox{}
            {\includegraphics[width=0.48\columnwidth]{figs/Fig_a}} \hspace{.5em}
        {\includegraphics[width=0.2\columnwidth]{figs/legend} phantomsubcaption}
        \subcaptionbox{}
            {\includegraphics[width=0.48\columnwidth]{figs/Fig_b}} \hfill
        \subcaptionbox{}
            {\includegraphics[width=0.48\columnwidth]{figs/Fig_c}} 
        \caption{}
    \end{figure}

\end{document}

其结果为:

在此处输入图片描述

但是,我希望第一张图片保持对齐。我尝试使用这个:

\usepackage[export]{adjust box}
\captionsetup{justification=raggedright, singlelinecheck=false}

\begin{figure}[htpb]
    \subcaptionbox{}
        {\includegraphics[width=0.48\columnwidth, left]{figs/Fig_a}} \hspace{.5em}
    {\includegraphics[width=0.2\columnwidth]{figs/legend} phantomsubcaption}
    \subcaptionbox{}
        {\includegraphics[width=0.48\columnwidth]{figs/Fig_b}} \hfill
    \subcaptionbox{}
        {\includegraphics[width=0.48\columnwidth]{figs/Fig_c}} 
    \caption{}
\end{figure}

没有成功:

在此处输入图片描述

此外,\phantomsubcaption与图 (a) 的高度不同,我希望它垂直居中对齐,而不是底部或顶部对齐,即与图 (a) 的中心对齐。这可能吗?

谢谢。

答案1

这是你想要的吗?只需将窄图形放在第一个即可\subcaptionbox

\documentclass[11pt,twocolumn]{article}

\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{caption}

\begin{document}

\begin{figure}[htpb]
\centering
\subcaptionbox{}{%
  \includegraphics[width=0.48\columnwidth]{figs/Fig_a}%
  \hspace{0.04\columnwidth}%
  \includegraphics[width=0.2\columnwidth]{figs/legend}}\hspace*{\fill}

\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_b}}\hfill
\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_c}}

\caption{Some caption or this wouldn't make much sense}

\end{figure}

\end{document}

在此处输入图片描述

如果您希望(a)相对于宽图像居中,则可以将窄图像插入零宽度框中:

\documentclass[11pt,twocolumn]{article}

\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{caption}

\begin{document}

\begin{figure}[htpb]
\centering
\subcaptionbox{}{%
  \includegraphics[width=0.48\columnwidth]{figs/Fig_a}%
  \makebox[0pt][l]{%
    \hspace{0.04\columnwidth}%
    \includegraphics[width=0.2\columnwidth]{figs/legend}%
  }%
}\hspace*{\fill}

\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_b}}\hfill
\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_c}} 

\caption{Some caption or this wouldn't make much sense}

\end{figure}

\end{document}

在此处输入图片描述

如果您想要左对齐的子标题,请告诉caption

\documentclass[11pt,twocolumn]{article}

\usepackage[demo]{graphicx}
\usepackage{subcaption}
\usepackage{caption}

\begin{document}

\begin{figure}[htpb]
\captionsetup[subfigure]{singlelinecheck=false}
\centering
\subcaptionbox{}{%
  \includegraphics[width=0.48\columnwidth]{figs/Fig_a}%
    \hspace{0.04\columnwidth}%
    \includegraphics[width=0.2\columnwidth]{figs/legend}%
}\hspace*{\fill}

\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_b}}\hfill
\subcaptionbox{}{\includegraphics[width=0.48\columnwidth]{figs/Fig_c}} 

\caption{Some caption or this wouldn't make much sense}

\end{figure}

\end{document}

也可以\captionsetup[subfigure]{singlelinecheck=false}放在序言中,因此它会影响所有子标题。

在此处输入图片描述

相关内容