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}
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}
| improve this answer | |

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.