1

Yesteday I was Searching in this site some help to construct my dissertation, my trouble was modify the style of the list of figures in LaTeX, more specificaly, add the word "Figure 1" before each entry in list of figures, then this answer helpS, look: enter link description here

But, moreover I need iserting a little dash between the word figure and the entry of the list. I need something like this:

Figure 1 - Entry of the list

For now, I don't have that little dash, someone can help with this, I'd be thankful!

I have this:

\documentclass{report}
\usepackage{chngcntr}  
\usepackage{tocloft}
\usepackage{hyperref}

\counterwithout{figure}{chapter}
\counterwithout{table}{chapter}

\renewcommand{\cftfigpresnum}{Figure\ }
\renewcommand{\cfttabpresnum}{Table\ }

\newlength{\mylenf}
\settowidth{\mylenf}{\cftfigpresnum}
\setlength{\cftfignumwidth}{\dimexpr\mylenf+1.5em}
\setlength{\cfttabnumwidth}{\dimexpr\mylenf+1.5em}


\makeatletter
\newcommand\listoftablesandfigures{%
    \chapter*{List of Tables and Figures}%
    \phantomsection
\@starttoc{lof}%
\bigskip
\@starttoc{lot}}
\makeatother

\begin{document}
\listoftablesandfigures

\chapter{Test one}
\section{Test one one}

\begin{table}
  \caption{Test table one}
\end{table}

\begin{figure}
  \caption{Test figure one}
\end{figure}

\chapter{Test two}
\section{Test two two}

\begin{table}
  \caption{Test table two}
\end{table}

\begin{figure}
  \caption{Test figure two}
\end{figure}

\end{document}

The result is this

enter image description here

How can I add a little dash between the words "Figure 1" and "Test of figure one"?

DiegoMath
  • 113

2 Answers2

2

This might do the trick

\setlength{\cftfignumwidth}{\dimexpr\mylenf+2em}
\setlength{\cfttabnumwidth}{\dimexpr\mylenf+2em}
\renewcommand\cftfigaftersnum{\enspace--\enspace}
\renewcommand\cfttabaftersnum{\enspace--\enspace}

Since Table is shorter than Figure is does not quite line up. The main problem here is that the material (the number and the title) is handed over to the typesetting macro as a single construction. Similar to

\numberline{number}Title

Where the \numberline is giving the box of a certain width.

daleif
  • 54,450
1

Add something like

\renewcommand{\cftfigaftersnum}{ -- }
\renewcommand{\cfttabaftersnum}{ -- }

in the preamble. So you get enter image description here

skpblack
  • 8,904
  • 3
  • 31
  • 42