Graphics, Figures & Tablescaption, list of figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
sheenshahid
Posts: 20
Joined: Fri Jan 24, 2020 10:31 am

caption, list of figures

Post by sheenshahid »

I am writing my thesis in LaTex and the thesis formatting requires the word "Figure" to be present and bold in each line and left justified caption means caption should be aligned in next line

i.e.
Figure 2.1: Test Problem 1 Test Problem 1 Test Problem 1
Test Problem 1 ...................................... 34
Figure 2.2: Test Problem 2 Test Problem 1 Test Problem 2
Test Problem 2 ...................................... 34
Currently, I have
2.1 Test Problem 1 Test Problem 1 Test Problem 1
Test Problem 1 ...................................... 34
2.2 Test Problem 2 Test Problem 1 Test Problem 2
Test Problem 1 ...................................... 34

May i require to change the caption in each figure for the alignment or it can be settled in the list of figures ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

caption, list of figures

Post by Bartman »

Please provide a Infominimal working example. If you use a standard class, you can use the tocloft package to add and format the prefix in the list of figures.
sheenshahid
Posts: 20
Joined: Fri Jan 24, 2020 10:31 am

caption, list of figures

Post by sheenshahid »

Code: Select all

\documentclass[12pt,a4paper,openany]{report}
\usepackage{latexsym}
\usepackage{graphicx}
\usepackage{amsmath,amsthm}
\usepackage{amssymb}
\usepackage{epsfig}
\usepackage[T1]{fontenc}
\usepackage{palatino}
\usepackage{caption}
\textwidth  5.8in \textheight 8.5 in \topmargin 0.0in \oddsidemargin
0.0in \evensidemargin 0.0in \setlength{\parindent}{12pt}
\pagestyle{plain}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{ax}{Axiom}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\theoremstyle{remark}
\newtheorem{rem}{Remark}[section]
\newtheorem*{notation}{Notation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Contents}{}
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\listoftables
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\tablename~\oldnumberline}%
\listoftables%
}
\addcontentsline{toc}{section}{List of Tables}{}
%\renewcommand{\cftfignumwidth}{6em}
%\renewcommand{\cftfigpresnum}{Figure }

%\listoffigures
{%
\let\oldnumberline\numberline%
\renewcommand{\numberline}{\figurename~\oldnumberline}%
\listoffigures%
}
%\renewcommand{\cftfigpresnum}{Figure }
\addcontentsline{toc}{section}{List of Figures}{}
%\listoffigures
\newpage
\setcounter{page}{1}
\renewcommand{\thepage}{\arabic{page}}
 \include{Chap_1}
 \include{Chap_2}
 \include{Chap_3}
 \include{Chap_4}
 \include{Chap_5}
 \include{Chap_6}
% \include{Conclusions}
 \include{reference}
 \end{document}
sheenshahid
Posts: 20
Joined: Fri Jan 24, 2020 10:31 am

caption, list of figures

Post by sheenshahid »

Any one here to solve my problem
Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

caption, list of figures

Post by Bartman »

Maybe that helps:

Code: Select all

\documentclass[12pt,a4paper,openany]{report}
\usepackage{amsmath,amsthm}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}% replacement for deprecated palatino
\usepackage[english]{babel}% maybe useful
\usepackage{caption}
\usepackage{tocloft}% added
\usepackage[section]{tocbibind}% added

\textwidth 5.8in \textheight 8.5 in \topmargin 0.0in 
\oddsidemargin 0.0in \evensidemargin 0.0in 

\pagestyle{plain}
\setlength{\parindent}{12pt}
    
\renewcommand{\theequation}{\arabic{chapter}.\arabic{equation}}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{ax}{Axiom}
\theoremstyle{definition}
\newtheorem{defn}{Definition}[section]
\theoremstyle{remark}
\newtheorem{rem}{Remark}[section]
\newtheorem*{notation}{Notation}

\newlength{\mytablen}
\newlength{\myfiglen}

\renewcommand{\cfttabpresnum}{\tablename~} % goes before table number
\renewcommand{\cfttabaftersnum}{:} % Goes after table number
\settowidth{\mytablen}{\cfttabpresnum} % space required to print \cfttabpresnum
\addtolength{\mytablen}{\cfttabnumwidth} % plus space for the number
\cftsetindents{table}{0pt}{0pt} % Remove caption indent, and flush entries with title
\renewcommand{\cfttabaftersnumb}{\hspace{\mytablen}} % add space after the zero-spaced number
\setlength{\cftbeforetabskip}{0.23\baselineskip} % Add small gap between LoT entries
    
\renewcommand{\cftfigpresnum}{\figurename~} % goes before figure number
\renewcommand{\cftfigaftersnum}{:} % Goes after figure number
\settowidth{\myfiglen}{\cftfigpresnum} % space required to print \cftfigpresnum
\addtolength{\myfiglen}{\cftfignumwidth} % plus space for the number
\cftsetindents{figure}{0pt}{0pt} % Remove caption indent, and flush entries with title
\renewcommand{\cftfigaftersnumb}{\hspace{\myfiglen}} % add space after the zero-spaced number
\setlength{\cftbeforefigskip}{0.23\baselineskip} % Add small gap between LoF entries
    
\begin{document}
\tableofcontents
\clearpage
\listoftables
\clearpage
\listoffigures
\clearpage
\setcounter{page}{1}
% This is only necessary, if there was previously a roman numbering.
%\renewcommand{\thepage}{\arabic{page}}
\chapter{Chapter heading}
\captionof{table}{text text text text text text text text text text text text text 
text text text text text}
\captionof{table}{text text text text text text text text text text text text text 
text text text text text}
\captionof{figure}{text text text text text text text text text text text text text 
text text text text text}
\captionof{figure}{text text text text text text text text text text text text text 
text text text text text}
\end{document}
The tocloft-commands and comments come from TeX.SX.
Post Reply