我想对图中的几种技术进行概述。结果发现,有很多技术,所以我使用了 subcaption 和 subref 来描述这个问题。但是,由于标签太多,我发现使用换行符将每个描述放在一行中很方便\\\hspace{textwidth}
。我不想将信息放在图像下方的 subcaption 中,因为我不喜欢这样,而且它会破坏整个文档的格式,无论哪里有 subcaption,我都会\subref
在图片标题中引用其标签(带有)。由于 subref 标签占用不同的宽度,标题的左侧看起来相当参差不齐,有棱角。A MWE:
\documentclass[oneside,DIV=17]{scrbook}
\usepackage[font={scriptsize,sf},labelfont={scriptsize,sf,bf}]{caption}
\usepackage[subrefformat=parens,labelfont={normalfont,scriptsize,sf},labelsep=space]{subcaption}
\setcapindent{0pt}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:a}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:b}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:c}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:d}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:e}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:f}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:g}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:h}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:i}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:j}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:k}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\hspace{0.3\textwidth}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum urna fringilla ultrices.\\\hspace{\textwidth}
\subref{fig:a} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:b} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:c} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:d} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:e} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:f} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:g} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:h} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:i} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:j} Short text fit in one line\\\hspace{\textwidth}
\subref{fig:k} Short text fit in one line
}
\end{figure}
\end{document}
渲染结果为(红线,突出显示问题):
我知道,如果我不换行标题文本,一切都会好起来。但我认为,读者可能会发现从列中选择描述比在文本中搜索标签项更容易。感谢您的任何建议。
答案1
我希望您不必在文档中打印带有此类标题的图表列表...在这种情况下,请记住使用可选参数\caption
:
\caption[short caption]{long caption}
以下是三种选择。
第一种选择:
\documentclass[oneside,DIV=17]{scrbook}
\usepackage[font={scriptsize,sf},labelfont={scriptsize,sf,bf}]{caption}
\usepackage[subrefformat=parens,labelfont={normalfont,scriptsize,sf},labelsep=space]{subcaption}
\setcapindent{0pt}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:a}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:b}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:c}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:d}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:e}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:f}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:g}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:h}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:i}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:j}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:k}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\hspace{0.3\textwidth}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum urna fringilla ultrices.\\
\llap{\subref{fig:a}} Short text fit in one line\\
\llap{\subref{fig:b}} Short text fit in one line\\
\llap{\subref{fig:c}} Short text fit in one line\\
\llap{\subref{fig:d}} Short text fit in one line\\
\llap{\subref{fig:e}} Short text fit in one line\\
\llap{\subref{fig:f}} Short text fit in one line\\
\llap{\subref{fig:g}} Short text fit in one line\\
\llap{\subref{fig:h}} Short text fit in one line\\
\llap{\subref{fig:i}} Short text fit in one line\\
\llap{\subref{fig:j}} Short text fit in one line\\
\llap{\subref{fig:k}} Short text fit in one line
}
\end{figure}
\end{document}
第二种选择:
\documentclass[oneside,DIV=17]{scrbook}
\usepackage[font={scriptsize,sf},labelfont={scriptsize,sf,bf}]{caption}
\usepackage[subrefformat=parens,labelfont={normalfont,scriptsize,sf},labelsep=space]{subcaption}
\setcapindent{0pt}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:a}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:b}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:c}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:d}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:e}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:f}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:g}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:h}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:i}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:j}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:k}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\hspace{0.3\textwidth}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum urna fringilla ultrices.\\
\protect\makebox[.5cm]{\subref{fig:a}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:b}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:c}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:d}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:e}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:f}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:g}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:h}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:i}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:j}} Short text fit in one line\\
\protect\makebox[.5cm]{\subref{fig:k}} Short text fit in one line
}
\end{figure}
\end{document}
第三种选择:
\documentclass[oneside,DIV=17]{scrbook}
\usepackage[font={scriptsize,sf},labelfont={scriptsize,sf,bf}]{caption}
\usepackage[subrefformat=parens,labelfont={normalfont,scriptsize,sf},labelsep=space]{subcaption}
\setcapindent{0pt}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:a}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:b}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:c}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:d}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:e}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:f}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:g}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:h}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:i}}{\rule{0.3\textwidth}{0.25\textwidth}}\par
\subcaptionbox{\label{fig:j}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\subcaptionbox{\label{fig:k}}{\rule{0.3\textwidth}{0.25\textwidth}}\hfill
\hspace{0.3\textwidth}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis.
Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus
sem. Nulla et lectus vestibulum urna fringilla ultrices.\\
\protect\makebox[.5cm][l]{\subref{fig:a}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:b}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:c}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:d}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:e}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:f}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:g}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:h}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:i}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:j}} Short text fit in one line\\
\protect\makebox[.5cm][l]{\subref{fig:k}} Short text fit in one line
}
\end{figure}
\end{document}
答案2
使用表格:
\documentclass{article}
\usepackage{lipsum}
\usepackage[font={scriptsize,sf},labelfont={scriptsize,sf,bf}]{caption}
\usepackage[subrefformat=parens,labelfont={normalfont,scriptsize,sf},labelsep=space]{subcaption}
\begin{document}
\begin{figure}
\subcaptionbox{\label{fig:a}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:b}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:c}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:d}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:e}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:f}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:g}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:h}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:i}}{}\hspace{1cm}~
\subcaptionbox{\label{fig:j}}{}
\caption{\protect\lipsum[1]\smallskip
\protect\tabular{@{}l @{~} l@{}}
\subref{fig:a} & Short text fit in one line\\
\subref{fig:b} & Short text fit in one line\\
\subref{fig:c} & Short text fit in one line\\
\subref{fig:d} & Short text fit in one line\\
\subref{fig:e} & Short text fit in one line\\
\subref{fig:f} & Short text fit in one line\\
\subref{fig:g} & Short text fit in one line\\
\subref{fig:h} & Short text fit in one line\\
\subref{fig:i} & Short text fit in one line\\
\subref{fig:j} & Short text fit in one line
\protect\endtabular
}
\end{figure}
\end{document}