1

I am typesetting a book, and I don’t want to have figure numbers in my captions; thus I am using labelformat=empty in the captions package. Similarly, I want to suppress numbers in my list of figures, so my preamble looks like this:

\usepackage[listformat=empty,labelformat=empty,]{caption}

Let’s assume this image in my text:

\begin{figure}[ht]
    \centering
    \includegraphics{example-image-a}
    \caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}

When I print my \listoffigures I get an indentation. Is there any way to get rid of this?

MWE (this is an edit link, feel free to play around):

\documentclass{scrbook}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage[belowskip=-11pt,listformat=empty,labelsep=none,labelformat=empty]{caption}
\begin{document}

\begin{figure}[ht]
    \centering
    \includegraphics{example-image-a}
    \caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}

\listoffigures

\end{document}

enter image description here

6
  • 1
    Please -- as usual here -- make your code snippet be compilable, then we do not have to guess what you are doing ...
    – Mensch
    Oct 3, 2021 at 18:50
  • Sorry you are right. I added a link
    – Kalaschnik
    Oct 3, 2021 at 21:23
  • See tex.stackexchange.com/questions/612537/…. Actually, the indentation is in \l@figure. Oct 4, 2021 at 0:51
  • Sorry, this is nothing in this with \l@figure, what does it mean the indentation is in \l@figure — how do I get rid of it?
    – Kalaschnik
    Oct 4, 2021 at 6:28
  • 1
    don't put the example in a external link. Such links will be dead at some time. Add it to your question. Oct 7, 2021 at 21:51

1 Answer 1

2
+50

Based on https://tex.stackexchange.com/a/186844/56823, here is the solution:

\documentclass{scrbook}
\usepackage[utf8]{inputenc}

\usepackage{graphicx}
\usepackage[belowskip=-11pt,listformat=empty,labelformat=empty]{caption}
\makeatletter
\renewcommand*\l@figure{\@dottedtocline{1}{0em}{0em}}
\makeatother

\begin{document}

\begin{figure}[ht]
    \centering
    \includegraphics{example-image-a}
    \caption[\textit{Title of the Work, which can also be a bit longer}, \textsc{Author of the work}, 2010, No Copyright]{Title of the work} \label{fig:some-label}
\end{figure}

\listoffigures

\end{document}
2
  • That’s it! Thank you so much. Is there any way to get a hanging indentation (first line no indented, following lines indented)? I know that this is a different question 😬 ...
    – Kalaschnik
    Oct 8, 2021 at 10:30
  • Likely, but this is way harder since normally what you can control is the indentation w.r.t. the “Figure 1” label, which is a separated object. Here you want to indent two lines that are stored together, so it requires patching the code displaying them more deeply, and I haven’t found a simple way even using tocloft. As you said, you should ask this in a new question.
    – Archange
    Oct 8, 2021 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .