TransWikia.com

Add spacing into list of figures for each section

TeX - LaTeX Asked by Lokesh Vakkalakula on November 28, 2020

I am writing my project report and in my list of figures I need space between each sections, but I am not getting space between each section. Any help is appreciated.

enter image description here

documentclass[12pt,a4paper]{article}
setcounter{tocdepth}{3}
setcounter{secnumdepth}{3}
%documentclass[10pt,a4paper]{Report}
%documentclass{article}
%documentclass{IEEEtran}
usepackage{graphicx}
usepackage{float}%%%
usepackage{wrapfig}%%%
usepackage{caption}
usepackage{subfigure}
usepackage{amsmath} 
usepackage{textgreek}
usepackage{gensymb}
usepackage{commath}
usepackage{chngcntr}
usepackage{microtype}
usepackage{titletoc}
usepackage[hidelinks]{hyperref}
counterwithin{figure}{section}
counterwithin{table}{section}
%usepackage{picins}
usepackage{array}
floatstyle{plaintop}
restylefloat{table}
newenvironment{bottompar}{parvspace*{fill}}{clearpage}
begin{document}
tableofcontents
%addcontentsline{toc}{section}{Contents}
cleardoublepage
%list of figures page****************************
%listoffigures
addcontentsline{toc}{section}{listfigurename}
listoffigures
%addcontentsline{toc}{section}{List of Figures}
%addcontentsline{toc}{chapter}{listfigurename}
cleardoublepage
listoftables
addcontentsline{toc}{section}{List of Tables}

2 Answers

After each section add addtocontents{lof}{protectaddvspace{10pt}}.

This will insert a vertical space of 10pt between each set of figure titles in the LoF.

If you got bored with that you could change the section command to include doing the addtocontents.

If you need similar spaces in your LoT include addtocontents{lot}{protectaddvspace{10pt}}

% lofprob.tex  SE 564815

documentclass[12pt,a4paper]{article}

begin{document}
tableofcontents

listoffigures

section{First}
addtocontents{lof}{protectaddvspace{10pt}}

begin{figure}
centering
ILLSTRATION
caption{First}
end{figure}

begin{figure}
centering
ILLSTRATION
caption{Second}
end{figure}

section{Second}
addtocontents{lof}{protectaddvspace{10pt}}

begin{figure}
centering
ILLSTRATION
caption{First}
end{figure}

begin{figure}
centering
ILLSTRATION
caption{Second}
end{figure}

end{document}

Answered by Peter Wilson on November 28, 2020

Wrong class? That is what a book-like class usually does by default with figures of different chapters (not of sections). If you do not like the usual chapter style in your document, then scrbook or memoir class are good alternatives to have section-like chapters without headaches, and if start the chapters in a new page is also a problem (it should not be a problem in documents of some entity), it is easily solvable too:

documentclass{scrbook}
begin{document}
listoffigures
{letclearpagerelax chapter{One}}
begin{figure}[h]caption{aaa}end{figure}
begin{figure}[h]caption{bbb}end{figure}
{letclearpagerelax chapter{Two}}
begin{figure}[h]caption{ccc}end{figure}
begin{figure}[h]caption{ddd}end{figure}
end{document}

Answered by Fran on November 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP