Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to give a survey on several techniques within a figure. It turned out, that there are many techniques, so I employed subcaption with subref to describe the matter. However, as there are too many labels, I found it convenient to put each description in a single line by employing \\\hspace{textwidth} as linebreak workaround. I do not want to put the info in subcaption below the image, as I don't like it and it would break the format of the whole document, where ever I have subcaptions I will refer to its label (with \subref) within the figure caption. As subref labels, consume different width, the left side of the caption looks quite jaggy, angular. 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}

which renders to (the redline, highlights the problem):

jaggy left margin

I know, if I would not linebreak the caption text, everything would be ok. But I would argue, that the reader might find it easier to select description from the column, then by searching the label item within the text. Thanks for any suggestions.

share|improve this question
    
Did you consider using beside captions containing the description (possibly as a short paragraph), organised in rows. The floatrow package can do that, is comptible with lists of figures. –  Bernard Mar 20 at 10:13
    
Thanks for this suggestion. I am not sure what you mean with 'beside captions'. SCfigure and friends, but realized with floatrow? Unfortunately, the images have a significant height, and I want to put them all on a single page. Hence I cannot put each in a single row. I will give an update to my MWE. –  math Mar 20 at 16:20
    
I updated, the MWE, but the subref descriptions are really almost a line long. So I believe I can't put the captions at beside the images. Last but not least, this would break the whole figure concept in the document, wher subcaptions are only used for labeling the images. I know tex.stackexchange.com/questions/128844/… is able to place labels inside figures, but I want to have the images original and do not modify them. –  math Mar 20 at 16:44
    
BTW: has someone and advise which one to accept? Both answers seem to elegantly solve the problem. –  math Mar 20 at 16:46
    
Just as a hint: read the documentation of KOMA-Script. There are already quite enhanced features for captions, also side captions as mentioned by Bernard. And without looking I think there are remarks in caption documentation regarding work with KOMA-Script. –  Speravir Mar 20 at 22:45

2 Answers 2

up vote 9 down vote accepted

I hope you won't have to print a List of Figures in your document with such captions... In such a case, remember to use the optional argument of \caption:

\caption[short caption]{long caption}

Here are three alternatives.

First alternative:

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

enter image description here

Second alternative:

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

enter image description here

Third alternative:

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

enter image description here

share|improve this answer
    
Ahh, you right. I certaintly have do this (writing a list of figure). And then this will look ugly. Can't I have a figure-list version and a real version? The first alternative would break the margin, but the second is very nice too. Thanks –  math Mar 20 at 9:02
    
@math Yes, use the optional argument of \caption, e.g. \caption[short caption]{long caption} –  karlkoeller Mar 20 at 9:04
    
You are a livesafer! –  math Mar 20 at 9:08

Use a tabular:

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

enter image description here

share|improve this answer
    
The smallskip is very neat here, this way the caption text looks more uniformly. –  math Mar 20 at 12:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.