使用 endfloat 包时图片列表中标题的对齐方式

使用 endfloat 包时图片列表中标题的对齐方式

我正在使用 endfloat 包将浮点数放在文档末尾的单独页面上,并使用 caption 包来控制标题格式,但我无法弄清楚如何更改使用 endfloat 创建的图表列表中标题的对齐方式。我已将标题对齐方式设置为 raggedright,但这不会改变 LoF 中的对齐方式。有没有简单的解决方案来改变 LoF 中的格式?

我在序言中这样调用这些包:

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

最后一个声明用于隐藏浮动页面上的标题。可以使用 tocloft 包解决这个问题吗?

答案1

您不必使用该tocloft包,但您可以在手册的第 5 页找到问题的解决方案tocloft\renewcommand{\@tocrmarg}{2.55em plus1fil}在您的序言中使用来设置 ToC/LoF 条目。

\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}

在此处输入图片描述

相关内容