1

Is there a way to change the caption delimiter of floats?

For example, I have "Figure 1: Big figure" and want to obtain "Figure 1 - Big figure" both in text and list of figure.

Using this code I get change in text, but don't in list of figure.

\documentclass{book}

\usepackage[labelsep=endash]{caption}
\usepackage{graphicx}
\usepackage{tocloft}

\renewcommand{\cftfigfont}{Figura~ }

\begin{document}

  \listoffigures

  \begin{figure}[ht]
    \centering
    \includegraphics[scale=1.0]{fig.png}
    \caption{Big figure}
    \label{fig:puc.png}
   \end{figure}

\end{document}

How can I decrease spacing between Figure and number in list of figure? From "Figure 1 Big figure" to "Figure 1 - Big figure".

  • See \DeclareCaptionLabelSeparator (page 25), but that should only change the caption itself. There are packages to change the LOF format, but I prefer to modify \l@figure directly (see https://tex.stackexchange.com/questions/387021/conditional-formatting-for-spaces-in-the-list-of-figures/387065?s=1|14.0909#387065 and https://tex.stackexchange.com/questions/329172/manipulating-list-of-figures/329212?s=8|7.2746#329212 ) – John Kormylo Apr 24 '18 at 03:40

1 Answers1

1

You can use

\renewcommand\cftfignumwidth{5.5em}
\renewcommand{\cftfigpresnum}{Figura\hfill}
\renewcommand{\cftfigaftersnum}{~--~}

Example:

\documentclass{book}
\usepackage[labelsep=endash]{caption}
\usepackage{graphicx}
\usepackage{tocloft}

\renewcommand\cftfignumwidth{5.5em}
\renewcommand{\cftfigpresnum}{Figura\hfill}
\renewcommand{\cftfigaftersnum}{~--~}

\begin{document}
\listoffigures
\begin{figure}[ht]
  \centering
  \includegraphics{example-image}
  \caption{Big figure}
  \label{fig:puc.png}
\end{figure}
\setcounter{figure}{9}
\begin{figure}[ht]
  \centering
  \includegraphics{example-image}
  \caption{Another big figure}
\end{figure}
\end{document}

enter image description here

esdd
  • 85,675