我使用子标题来描述彼此相邻的多个图表。对于较长的子标题,我遇到的问题是文本没有很好地对齐,第二行滑到了 (a) 和 (b) 标签下方。有没有办法将第二行的开头与行号 1 中的子标题文本的开头对齐?
非常感谢你的帮助!
附件是一个例子:
\documentclass[authoryear, review]{elsarticle}
\usepackage{graphicx}
\usepackage[font = footnotesize, labelfont=bf]{subcaption}
\usepackage[font = footnotesize, labelfont=bf]{caption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{Sails}
\caption{This is a rather long sub-caption for this nice picture of sails}
\end{subfigure}
~
\begin{subfigure}[b]{0.44\textwidth}
\includegraphics[width=\textwidth]{Sails}
\caption{This is a rather long sub-caption for this nice picture of sails}
\end{subfigure}
\caption{\textbf{This is the overall caption for this group of sailing pictures}}
\end{figure}
\end{document}
答案1
您可以使用此设置:
\captionsetup[figure]{% use subfigure to confine changes to subcaptions
justification = RaggedRight, % Or justified
format=hang}
完整的例子如下:
\documentclass[authoryear, review]{elsarticle}
\usepackage{graphicx}
\usepackage[font = footnotesize, labelfont=bf]{subcaption}
\usepackage[font = footnotesize, labelfont=bf]{caption}
\captionsetup[figure]{%
justification = RaggedRight, % Or justified
format=hang}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[b]{0.45\textwidth}
\includegraphics[width=\textwidth]{example-image-A}
\caption{This is a rather long sub-caption for this nice picture of sails}
\end{subfigure}
~
\begin{subfigure}[b]{0.44\textwidth}
\includegraphics[width=\textwidth]{example-image-B}
\caption{This is a rather long sub-caption for this nice picture of sails}
\end{subfigure}
\caption{\textbf{This is the overall caption for this group of sailing pictures}}
\end{figure}
\end{document}