# Centering the sentence in the table of figures?

I have a problem when adding the word "Figure" at the beginning of table of content. However there is a conflict here.

I want it to appear like this;

I used following codes here;

I replaced

\listoffigures


with

{%
\let\oldnumberline\numberline%

\renewcommand{\numberline}{\figurename~\oldnumberline}%

\listoffigures%

}


Besides, the codes of my figures were in the following form.

\begin{figure}[htpb]

\begin{center}

\includegraphics[width=0.8\columnwidth]{driscoll.png}

\end{center}

\caption{Three algebraic habits of mind}

\label{fig:driscoll.png}

\end{figure}


Ok, I tried to adopt tocloft package, but I could not understand how to change code of my figures?

My codes seems like this;

\documentclass[a4paper,onesided,12pt]{report}

\usepackage{styles/fbe_tez}

\usepackage[utf8x]{inputenc} % To use Unicode (e.g. Turkish) characters

\renewcommand{\labelenumi}{(\roman{enumi})}

\usepackage{amsmath, amsthm, amssymb}

% Some extra symbols

\usepackage[bottom]{footmisc}

\usepackage{cite}

\usepackage{graphicx}

\usepackage{longtable}

\graphicspath{{figures/}} % Graphics will be here

\usepackage{multirow}

\usepackage{subfigure}

\usepackage{algorithm}

\usepackage{algorithmic}

%\pagestyle{empty}

%\includeonly{introduction} % To only process the given file

\usepackage{array}

\usepackage{caption}

\captionsetup[table]{skip=10pt}

\usepackage{enumitem}

\usepackage{slashbox}

\usepackage{graphics}

\usepackage[labelsep=period]{caption}

\usepackage{float}

\usepackage{wrapfig}

\usepackage{lscape}

\usepackage{rotating}

\usepackage[utf8x]{inputenc}

\usepackage{longtable}

\usepackage{multirow}

\usepackage{array}

\usepackage{calc}

\usepackage{booktabs}

\usepackage{array,longtable}

\usepackage{graphicx}

\usepackage{afterpage}

\begin{document}

\tableofcontents

\listoffigures

\listoftables

\begin{figure}[htpb]

\begin{center}

\includegraphics[width=0.8\columnwidth]{driscoll.png}

\end{center}

\caption{Three algebraic habits of mind}

\label{fig:driscoll.png}

\end{figure}

But, I need to change it to;

\begin{figure}[!ht]

\centering

\rule{2cm}{2cm}

\caption{test figure one}

\label{fig:test1}

\end{figure}

\end{document}


How is it possible to change my codes into this one?

• Why not use the tocloft package as shown in this answer? tex.stackexchange.com/a/12869/134144 – leandriis Jun 20 '18 at 11:19
• I could not manage to adopt the codes into my article. But if you strongly suggested it, i will give a try. – Zeynep P Jun 20 '18 at 11:40
• why don't you use short tags in the LoF, e.g. \caption[bird in the sky]{a very nice figure, that shows a bird in the sky} leading to List of Figure: 1.1 Bird in the Sky....9 – naphaneal Jun 20 '18 at 12:50
• Can you please make a minimal working example (MWE)? – user36296 Jun 20 '18 at 13:03
• Can you please add the document class and all packages and settings regarding the List of Figures? – esdd Jun 21 '18 at 10:46

Here are two suggestions assuming that there are no settings regarding the TOC, LOF or LOT in the fbe_tez.sty (we do not have this package). Note that I have removed all packages which are not related to the issue.

With package tocbasic:

\documentclass[a4paper,12pt]{report}
\usepackage{graphicx}

\usepackage{tocbasic}
\DeclareTOCStyleEntry[
entrynumberformat=\entrynumberwithprefix{\figurename},
dynnumwidth,
numsep=1em
]{tocline}{figure}
\DeclareTOCStyleEntry[
entrynumberformat=\entrynumberwithprefix{\tablename},
dynnumwidth,
numsep=1em
]{tocline}{table}
\newcommand\entrynumberwithprefix[2]{#1\enspace#2:\hfill}

\usepackage{blindtext}% only for dummy text

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{A chapter}
\begin{figure}[htpb]
\centering
\includegraphics[width=.8\columnwidth]{example-image}
\caption{Three algebraic habits of mind}
\label{fig:driscoll.png}
\end{figure}

But, I need to change it to;

\begin{figure}[htbp]
\centering
\includegraphics[width=.8\columnwidth]{example-image}
\caption{\blindtext}
\label{fig:test1}
\end{figure}

\Blinddocument
\end{document}


Run three times to get:

Or with package tocloft as already suggested here:

\documentclass[a4paper,12pt]{report}
\usepackage{graphicx}

\usepackage[titles]{tocloft}
\newlength{\mylen}

\renewcommand{\cftfigpresnum}{\figurename\enspace}
\renewcommand{\cftfigaftersnum}{:}
\settowidth{\mylen}{\cftfigpresnum\cftfigaftersnum}

\renewcommand{\cfttabpresnum}{\tablename\enspace}
\renewcommand{\cfttabaftersnum}{:}
\settowidth{\mylen}{\cfttabpresnum\cfttabaftersnum}

\usepackage{blindtext}% only for dummy text

\begin{document}

\tableofcontents
\listoffigures
\listoftables

\chapter{A chapter}
\begin{figure}[htpb]
\centering
\includegraphics[width=.8\columnwidth]{example-image}
\caption{Three algebraic habits of mind}
\label{fig:driscoll.png}
\end{figure}

But, I need to change it to;

\begin{figure}[!ht]
\centering
\includegraphics[width=.8\columnwidth]{example-image}
\caption{\blindtext}
\label{fig:test1}
\end{figure}

\Blinddocument
\end{document}


Result:

There is no class option onesided. Maybe you want oneside, but this is default for report.
Do not load packages twice, eg. graphicx, array, longtable, inputenc. If you load graphicx then graphics is not needed.
Do not use center environment inside a float. Use the switch \centering instead.