1

Currently my LoT and LoF only shows numbers and short captions e.g

    2.1 Bathimety map.....1
    2.2 Other stuff ......2

But I would like to have them listed in the LoF and LoT as

    Figure 2.1 Bathimetry map......1
    Figure 2.2 Other stuff.........2
Table 1.1 Cool stuff...........3 

What do I need to change in my code (report class with chapters)?

\documentclass[hidelinks,12pt]{report}
\usepackage[paperheight=28cm,paperwidth=22cm,tmargin=25.4mm,bmargin=25mm,lmargin=38.1mm,rmargin=25.4mm,heightrounded]{geometry}
\usepackage{graphicx,siunitx,pdflscape}
\usepackage{hyperref,amsmath,amssymb,graphicx,wasysym,paralist,textcomp}
\usepackage[round]{natbib}
\usepackage[english]{babel}
\usepackage[babel]{csquotes}
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{setspace}
\usepackage{blindtext}
\usepackage{multirow}
\usepackage[table,xcdraw]{xcolor}
\usepackage{caption}
\usepackage{float}
\usepackage{etoolbox}
\usepackage{lineno}
\usepackage{indentfirst}
\usepackage[labelfont=bf]{caption}
%\renewcommand{\listoffigures}{\begingroup
%\tocsection
%\tocfile{\listfigurename}{lof}
%\endgroup}
%\renewcommand{\listoftables}{\begingroup
%\tocsection
%\tocfile{\listtablename}{lot}
%\endgroup}
\makeatletter
\patchcmd{\@caption}{\csname the#1\endcsname}{\csname fnum@#1\endcsname:}{}{}
\renewcommand*\l@figure{\@dottedtocline{1}{1.5em}{4.5em}}
\let\l@table\l@figure
\makeatother

\begin{document}

\pagenumbering{Roman} \tableofcontents \newpage \listoffigures \listoftables \clearpage

\newpage

\begin{figure}[!ht] \centering \makebox[\textwidth]{ \includegraphics[height=.5\textheight]{Map.png}} \captionsetup{format=hang} \caption[Bathymetry map ]{\textbf{Bathymetry}} \label{fig.B1} \end{figure} \end{document}

  • See https://tex.stackexchange.com/questions/12865/list-of-figures-how-to-add-caption-label – John Kormylo Nov 17 '23 at 18:27
  • Off-topic: Do get rid of (or comment out) the material between \makeatletter and \makeatother, do get rid of the statement \usepackage{caption}, and do change \usepackage[labelfont=bf]{caption} to \usepackage[font=bf]{caption}. Making these changes will let you change \caption[Bathymetry map ]{\textbf{Bathymetry map}} to \caption{Bathymetry map}. – Mico Nov 17 '23 at 19:32
  • @user133467 - Since you load the caption package, I can see no reason for basically ignoring its machinery in favor of some very low-level mucking around with \@caption. I'm also comfortable claiming that \caption{Bathymetry map} is a lot easier to maintain than \caption[Bathymetry map ]{\textbf{Bathymetry map}} is. Of course, you're entirely free to either increase or decrease the value of the third argument of the \cftsetindent directives. – Mico Nov 17 '23 at 20:51
  • Awesome, THANKS A LOT!!! This solved all my issues, I understand that your fix on the [labelfont=bf| vs [font=bf] lets me ignore all \textbf commands in each caption - significantly easier! – user133467 Nov 17 '23 at 20:54

1 Answers1

1

I suggest you add the following code to your preamble:

\usepackage[titles]{tocloft}
\renewcommand\cftfigpresnum{\figurename\ }
\renewcommand\cfttabpresnum{\tablename\ }
\cftsetindents{figure}{0em}{4.5em}
\cftsetindents{table}{0em}{4em}

Adding this code at the end of the preamble of the OP's test document and recompiling the test document twice yields the following result for the List of Figures page:

enter image description here

Mico
  • 506,678