0

I have a figure in LaTeX with a caption that doesn't fit into one line, e.g.

\begin{figure}
 \includegraphics{}
\caption{This is a very long caption that does not fit into one line}
\end{figure}

The resulting PDF looks as follows in list of figure:

Figure 1: This is a very long caption that does not fit
into one line

I would like the second line of the caption be either aligned with the start of the caption (not the text "Figure 1") to make it look like

Figure 1: This is a very long caption that does not fit
          into one line

How can I do this?

1

2 Answers 2

4

You need to use adequate caption settings. For example:

    \documentclass{book}
\usepackage{graphicx}% <-- for more options, read caption manual
\usepackage[hang]{caption}% <-- for more options, read caption manual

\setlength\textwidth{77mm}

%\usepackage[active,floats,tightpage]{preview}% just for see figure
%\setlength\PreviewBorder{1em}

\listoffigures

\begin{document}
\begin{figure}
    \includegraphics[width=\hsize]{example-image}
\caption{This is a very long caption that does not fit into one line}
\end{figure}
\end{document}

Edit (1): I added a figure below. For It generation I added graphicx package and use preview package for better seeing the picture.

enter image description here

Is this what you looking for?

Edit (2): Now I see, that you like format list of figures. In document class book this is default features (but without of names Figure before figure numbers). And, as told in comment, provide MWE, which show your problem.

3
  • but it don't work for me . i also use hyperrefpackage. i think it make problem. May 12, 2015 at 9:19
  • Then provide your MWE. I haven't Crystal ball. Given MWE work for me.
    – Zarko
    May 12, 2015 at 10:41
  • i want do this for list of figure not for caption of figure. May 12, 2015 at 15:41
3

You can achieve this e.g. with titletoc:

\documentclass[a4paper,10pt]{article}
\usepackage{titletoc,geometry}
\geometry{textwidth=10cm,showframe}

\contentsmargin{0.5cm}
\titlecontents{figure}
  [1.7cm]
  {}
  {\makebox[0pt][r]{%
      \makebox[1.7cm][l]{Figure~\thecontentslabel:}%
    }%
  }
  {\hspace{-1.7cm}}
  {\titlerule*[6pt]{.}\contentspage}

\begin{document}

\listoffigures

\begin{figure}
 \centering\rule{4cm}{1.5cm}
 \caption{This is a very long caption that does not fit into one line}
\end{figure}

\begin{figure}
 \centering\rule{4cm}{1.5cm}
 \caption{This is the next very long caption that does not fit into
   one line}
\end{figure}

\end{document}

enter image description here

3
  • This should probably be the accepted answer. Nov 8, 2018 at 17:31
  • @RomanLuštrik - You should ping the OP ;-) Nov 9, 2018 at 21:19
  • My hypothesis is that OP is not responsive. He has been contacted before, alas... Nov 10, 2018 at 22:08

You must log in to answer this question.

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