[Tex/LaTex] Justification of captions in List of Figures when using endfloat package

endfloathorizontal alignmenttable of contentstocloft

I am using the endfloat package to place floats on separate pages at the end of the document, and using the caption package for control of caption formatting, but I cannot figure out how to change the justification of captions within the List of Figures created created using endfloat. I have set the caption justification to raggedright, but this does not alter justification in the LoF. Any simple solutions to altering the format in the LoF?

I am calling the packages in the preamble with:

\usepackage[font=doublespacing,justification=raggedright]{caption}
\usepackage[nomarkers,tablesfirst]{endfloat}
\captionsetup{labelsep=none,textformat=empty}

The last declaration being used to suppress captions on the pages with the floats. Could this be solved using the package tocloft?

Best Answer

You don't have to use the tocloft package , but the solution to your problem can be found at page 5 of the tocloft manual: Use \renewcommand{\@tocrmarg}{2.55em plus1fil} in your preamble to set ToC/LoF enries raggedright.

\documentclass{article}

\usepackage{setspace}
\usepackage[font=doublespacing,justification=raggedright]{caption}
\usepackage[nomarkers,tablesfirst]{endfloat}
\captionsetup{labelsep=none,textformat=empty}

\makeatletter
\renewcommand{\@tocrmarg}{2.55em plus1fil}
\makeatother

\newcommand*{\sometext}{Lorem ipsum dolor sit amet, consectetuer
    adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
    adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
    libero, nonummy eget, consectetuer id, vulputate a, magna.}

\begin{document}

\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{\sometext}
\end{figure}

\end{document}

enter image description here

Related Question