2

Consider the code

\documentclass{article}
\usepackage{xcolor,graphicx}
\usepackage{caption}

\makeatletter
\define@key{Gin}{color}{\def\Gin@color{#1}}

\setlength{\fboxsep}{0pt}% Remove \fbox separation
\let\oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[2][]{%
  \ifnum\pdfstrcmp{#2}{example-image}=0%
    \begingroup
      \setkeys{Gin}{color=red,#1}% Default color is red
      \colorbox{\Gin@color}{\phantom{\oldincludegraphics[#1]{#2}}}%
    \endgroup
  \else
    \oldincludegraphics[#1]{#2}%
  \fi
}
\makeatother

\begin{document}
\begin{figure}[!htb]
\centering
  \includegraphics[width=20em,height=30em]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
     \caption{\textbf{\scshape{\large Red Figure}}}
  %\label{fig:Purple figure}
\end{figure}

\newpage

\begin{figure}[!htb]
\centering
  \includegraphics[width=20em,height=30em,color=purple]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption{\textbf{\scshape{\large Purple Figure}}}
  %\label{fig:Red figure}
\end{figure}

\newpage

\begin{figure}[!htb]
\centering
  \includegraphics[width=20em,height=30em,color=blue]{example-image}
  \captionsetup{labelformat=empty} \vskip 8pt
       \caption{\textbf{\scshape{\large Blue Figure}}}
  %\label{fig:Blue figure}
\end{figure}


\newpage
\renewcommand{\listfigurename}{LIST OF FIGURES} % Names the List of Figures.
\listoffigures

\end{document}

which produces the List of Figures:

enter image description here

QUESTION I would like to center the title "LIST OF FIGURES" as well as increase the amount of space separating the title from the listing of entries. How may this be done?

Thank you.

0

2 Answers 2

4

For example \renewcommand{\listfigurename}{\centering LIST OF FIGURES \vspace*{5ex}} does the job.

x

1
  • Many thanks @Simon Dispa. Jan 24 at 18:26
3

A generally useful way of controlling the layout of the LOF (and TOC and LOT) is to use the tocloft package (beware I wrote it).

The following code in your preamble does what you want and even more.

\usepackage{tocloft}

%%% change the LOF layout
\renewcommand{\listfigurename}{LIST OF FIGURES}
%% next two center the title, set its font, adds vertical space afterwards
%% and typeset Page above the page numbers
\renewcommand{\cftloftitlefont}{\hfill\Large\bfseries}
\renewcommand{\cftafterloftitle}{%
  \hfill \vspace*\baselineskip\par \mbox{}\hfill{\normalfont Page}}
\setlength{\cftbeforefigskip}{1em} % more space between entries

It changes the title of the LOF, sets the font for the title and centers it. It adds vertical space after the title, typesets the word "page" above the page numbers, and adds additional space between the figure caption entries.

enter image description here

For more information read the manual via texdoc tocloft.

2
  • Thank you for posting this answer. I hope to look into this tocloft package further. Say, can it handle the question posed in tex.stackexchange.com/questions/631292/…? Thanks again for this very helpful answer. Jan 24 at 19:16
  • @mlchristians No it does not. tocloft is basically concerned with the typesetting of the ToC entries but you are responsible for putting the entries into the ToC. Take a good look at your code and figure out what it does and does not do. Jan 25 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.