2

I'm trying to change the style of the captions below figures in the following MWE. How can I change the style so that Endfloat still picks up the figure environment and sends the figures to the end of the chapter?

    \documentclass[oneside,12pt]{book}
    \usepackage[tablesfirst,notablist]{endfloat}
    \usepackage{titletoc}
    \usepackage[demo]{graphicx}
    \renewcommand\theposttable{\arabic{chapter}.\arabic{posttbl}}
    \renewcommand\thepostfigure{\arabic{chapter}.\arabic{postfig}}

%This creates bold captions for the figures.%If you uncomment this, the figures don't go to the end of the chapter!!!!!
\makeatletter
\long\def\@maketblcaption#1#2{%
    \vskip\abovecaptionskip
    \begin{center}\normalsize\bf#1. \normalsize#2\end{center}
    \vskip\belowcaptionskip}
\renewcommand{\figure}{\let\@makecaption\@maketblcaption\@float{figure}}
\makeatother

    \begin{document}
    \chapter{Data}
    \startlist{lot}
\begin{figure}
                                \centering
                                \includegraphics{histoOne1}
                                \caption{My caption for this figure}
                                \label{fig:MyFigure}
\end{figure}

    \printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
    \processdelayedfloats

    \chapter{Learning}
    \startlist{lot}
\begin{figure}
                                \centering
                                \includegraphics{histoOne1}
                                \caption{My caption for this figure}
                                \label{fig:MyFigure}
\end{figure}
    \printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
    \processdelayedfloats

    \end{document}
user2146441
  • 1,226

1 Answers1

2

To customize the caption format, use the caption package; for example to have the figure captions in bold face font and centred, you would use

\captionsetup[figure]{font=bf,justification=centering}

A little example (the package offers many other possibilities for customization; please refer to the documentation):

\documentclass[oneside,12pt]{book}
\usepackage[tablesfirst,notablist]{endfloat}
\usepackage{titletoc}
\usepackage{caption}
\usepackage[demo]{graphicx}

\renewcommand\theposttable{\arabic{chapter}.\arabic{posttbl}}
\renewcommand\thepostfigure{\arabic{chapter}.\arabic{postfig}}

\captionsetup[figure]{font=bf,justification=centering}

\begin{document}

\chapter{Data}

\startlist{lot}
\begin{figure}
\centering
\includegraphics{histoOne1}
\caption{My caption for this figure}
\label{fig:MyFigure}
\end{figure}

\printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
\processdelayedfloats

\chapter{Learning}
\startlist{lot}
\begin{figure}
\centering
\includegraphics{histoOne1}
\caption{My caption for this figure}
\label{fig:MyFigure2}
\end{figure}

\printlist{lot}{}{\chapter*{List of tables in Chapter~\thechapter}}
\processdelayedfloats

\end{document}
Gonzalo Medina
  • 505,128