TransWikia.com

Aligning captions in List of Figures to the edge of the page (not to before the listed page number)

TeX - LaTeX Asked by user179166 on December 28, 2020

I have a LaTeX report file which includes several Figures, some with long captions which go to two lines in the List of Figures. I’ve used the tocloft package to customise a lot of things in the List of Figures, but one thing I still couldn’t figure out.

In the List of Figures, I need it to look like this:

Figure 1: xxxxxxxxxxxx…..34

Figure 2: yyyyyyyyyyyyyyyyy
yyyyy……………………………35

Currently it looks like this:

Figure 1: xxxxxxxxxxxx…..34

Figure 2: yyyyyyyyyyyyyy
yyyyy……………………………35

The first line of a multiline caption, in the List of Figures, should be aligned with the right margin (all the way to the end), not only to the point before the column of page numbers.

How can I do this? (I know the current version, second one above, actually looks better, but my university requires it to look like the first one above.)

Currently my commands for List of Figures formatting are as follows. What should I change?

% Set formatting for LoF
renewcommand{listfigurename}{begin{center} fontsize{16pt}{17pt} 
textbf{LIST OF FIGURES} end{center}}
renewcommand{cftbeforeloftitleskip}{-60pt}
renewcommand{cftafterloftitleskip}{18pt}
renewcommand{cftfigpresnum}{Figure } % goes before figure number
renewcommand{cftfigaftersnum}{:} % Goes after figure number
settowidth{mylen}{cftfigpresnum} % space required to print cftfigpresnum
addtolength{mylen}{cftfignumwidth} % plus space for the number
cftsetindents{figure}{0pt}{0pt} % Remove caption indent, and flush entries 
with title
renewcommand{cftfigaftersnumb}{hspace{mylen}} % add space after the zero-spaced number
%setlength{cftbeforefigskip}{0.23baselineskip} % Add small gap between LoF entries
renewcommand{cftbeforefigskip}{0em}

This question is related but asking about a different problem.

One Answer

I found the solution:

renewcommand@tocrmarg{0em} % versus 2.55em

This adjusts the right margin for the List of Figures (and/or Table of Contents) to width zero, instead of the default width that sets the text to the left of the list of page numbers.

I'm just posting this answer in case anyone else will have the same problem.

Answered by user179166 on December 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP