0

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

I want it to appear like this;

enter image description here

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{adjustbox}

\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?

esdd
  • 85,675

1 Answers1

2

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:

enter image description here

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}
\addtolength{\cftfignumwidth}{\mylen}

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

\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:

enter image description here


Additional remarks:

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.

esdd
  • 85,675