I have the following situation: In my document the caption of a figure appears normal like "Figure 1: example". BUT in the List of Figures the caption appears like "1 example". Is there a way to have "Figure 1 example" in List of Figures too?
I am using XeLaTeX as a compiler and the code is the following:
\documentclass[twoside, a4paper, 11pt]{article}
\usepackage{caption}
\captionsetup[figure]{name=Figure}
\usepackage{subcaption}
\usepackage{float}
\usepackage{chngcntr}
\counterwithin{figure}{section}
\usepackage{graphicx}
\graphicspath{ {./Images/} }
\begin{document}
\tableofcontents
\renewcommand{\listfigurename}{List of Figures}
\addcontentsline{toc}{subsection}{List of Figures} %Πρόσθεση στα περιεχόμενα (table of contents)
\listoffigures
\begin{figure}[htb]
\centering
\includegraphics[width=1\textwidth]{example.png}
\caption[Example for List of Figures]{Different example for caption under the figure.}
\label{Fig:exmpl}
\end{figure}
\end{document}
I found out that I can use this code:
\usepackage[titles]{tocloft}
\newlength{\mylen}
\renewcommand{\cftfigpresnum}{\figurename\enspace}
\renewcommand{\cftfigaftersnum}{:}
\settowidth{\mylen}{\cftfigpresnum\cftfigaftersnum}
\addtolength{\cftfignumwidth}{\mylen}
BUT this messed up seriously the structrure of my document. Do I have to change something to my code or only add the above? I did not understand clearly. It really messed up my document...It messes my document to this:



tocloftis missing up the structure of your document. Without detailt we have no idea what exactly you are doing. – daleif Dec 06 '23 at 11:54tocloftanswer. Also if you don't tell us why this "messes up" your document, why do you assume that any answer you might get here, won't mess it up as well? – samcarter_is_at_topanswers.xyz Dec 06 '23 at 11:59\addcontentslinecommand is too early. If a page break happens just before the list of figures, the\addcontentslinecommand will still show the page number of the last page of the table of contents. Better use a package, that supports adding the entry to the table of contents. – cabohah Dec 06 '23 at 13:00