LaTeX forum ⇒ Graphics, Figures & TablesCan we add a title to each caption in scrbook class ? Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
User avatar
Posts: 816
Joined: Sat Apr 02, 2011 4:06 pm

Can we add a title to each caption in scrbook class ?

Postby Cham » Wed Dec 06, 2017 6:48 pm

I'm wondering if it's possible to add a bold title to each figure and table caption, in the scrbook class.

Because of the command \setcapindent*{0pt} in the preamble, the caption text is placed below the caption number, with a useless space after the number (where a single-line title could stand). If I use\setcapindent{0pt} instead, there is no wasted space.

So is there a way to use the useless space after the number to add a title to the caption?

Here's a MWE to try :
  1. \RequirePackage[l2tabu,orthodox]{nag}
  2. \documentclass[11pt,twoside,letterpaper,headsepline,footsepline,cleardoublepage=plain,]{scrbook}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[french]{babel}
  5. \usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry}
  6. \usepackage{graphicx}
  7. \usepackage{subfig}
  8. \setcapindent*{0pt}
  10. \begin{document}
  12. \begin{figure}
  13. \centering
  14. \includegraphics[height=4cm]{example-image-a}
  15. \quad
  16. \includegraphics[height=4cm]{example-image-b}
  17. \\[12pt]
  18. \includegraphics[height=4cm]{example-image-c}
  19. \quad
  20. \includegraphics[height=4cm]{example-image}
  21. \caption{Some long description text, to show what would happen when a caption is long, long and very long. Hey, what a boring text to write ! Maybe I should use a verbatim or another random text package instead of writing this annoying text. Oh well, such is life anyway. We never know in advance what would happen next. Why do I remember the past, and not the future instead, or maybe we already do, so that the future is actually the past?}
  22. \end{figure}
  24. \end{document}

PS. The autocompletion mechanism of my browser is annoying : always changing "scrbook" to "scrapbook" ! :evil:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8529
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany

Postby Stefan Kottwitz » Wed Dec 06, 2017 8:07 pm

You could use \setcapindent without a star *, and add a title that way, using the title also for the list of figures:

  1. \setcapindent{0pt}
  2. ...
  3. \caption[Figure title]{\textbf{Figure title}\\Some long description text, ...}

figure.png (41.3 KiB) Viewed 41 times

Site admin

Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 8 guests