I'm using the article
document class (as a base) and the caption
package. I essentially need to change my LoF format from the default
List of Figures
1 Multiline caption multiline caption multiline caption multiline caption multiline caption
multiline caption multiline caption
2 Multiline caption multiline caption multiline caption multiline caption multiline caption
multiline caption multiline caption
to the following:
List of Figures
Figure 1. Multiline caption multiline caption multiline caption multiline caption multiline
caption multiline caption multiline caption
Figure 2. Multiline caption multiline caption multiline caption multiline caption multiline
caption multiline caption multiline caption
I also need to do the same for my LoT format.
By label I mean the numbers indicating the index of the figure/table.
I'm assuming it's not possible to get the desired output while still using the labels, so how would I move the labels into their captions, remove the labels themselves, and remove the indent? (If it is possible to "inline" the label with its caption then that's all I need.)
If it's not possible to modify \listoffigures
and \listoftables
to do so, how would I create the needed environments to do so?
Edit: My revised version of the Peter Wilson's answer using tocloft
:
\renewcommand{\@tocrmarg}{2.5pc plus1fil} % Set ToC/LoF/LoT entries to ragged-right
% Set formatting for the LoF ande LoT (fig/tab numbers >999 will clip caption)
\newlength{\mylen}
% Set formatting for LoF
\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
\renewcommand{\cftfigaftersnumb}{\hspace{\mylen}} % add space after the zero-spaced number
\cftsetindents{figure}{0pc}{0pc} % Remove caption indent, and flush entries with title
\setlength{\cftbeforefigskip}{0.5pc} % Add small gap between LoF entries
% Set formatting for LoT
\renewcommand{\cfttabpresnum}{Table }
\renewcommand{\cfttabaftersnum}{.}
\settowidth{\mylen}{\cfttabpresnum}
\addtolength{\mylen}{\cfttabnumwidth}
\renewcommand{\cfttabaftersnumb}{\hspace{\mylen}}
\cftsetindents{table}{0pc}{0pc}
\setlength{\cftbeforetabskip}{0.5pc}
Edit2: How do I move the label or flush the caption left with tocbasic
instead of tocloft
? MWE:
\documentclass{article}
%\documentclass[listof=totoc,listof=leveldown]{scrartcl}
\usepackage{lipsum}
\usepackage{hyperref}% Used in actual project, provides \phantomsection
\usepackage[justification=raggedright,singlelinecheck=false]{caption}
\usepackage{float}
\usepackage{pgffor}
\usepackage{tocbasic}
%\tocbasicautomode % What does this do?
\newcommand*{\addfigdot}[1]{\figurename\ #1\unskip.\hfil}
\newcommand*{\addtabdot}[1]{\tablename\ #1\unskip.\hfil}
\DeclareTOCStyleEntries[
%breakafternumber,% Somehow manages to flush at least the first line left?
beforeskip=.5pc,% Add space between entries
indent=0pc,% Remove basic indent
entrynumberformat=\addfigdot,% Reformat prefix to "Figure <num>. "
raggedentrytext,% Disable caption justification in LoF
dynnumwidth% Needed to properly align caption with prefix
]{tocline}{figure,table}
\DeclareTOCStyleEntry[entrynumberformat=\addtabdot]{tocline}{table}
\begin{document}
\tableofcontents
\section{Figures and Tables}
\foreach\n in {1,...,3}{\begin{figure}[H]\caption{\lipsum[\n][1-3]}\end{figure}}
\foreach\n in {1,...,3}{\begin{table}[H]\caption{\lipsum[\n][1-3]}\end{table}}
% Print LoF and LoT, and add them to ToC
\cleardoublepage
\phantomsection\addcontentsline{toc}{section}{\listfigurename}
\listoffigures
\cleardoublepage
\phantomsection\addcontentsline{toc}{section}{\listtablename}
\listoftables
\end{document}
Figure
but that seems completely unrelated to processing of\label
tocloft
makes no changes to the ToC. It only makes changes to the ToC, LoF, or LoT that you tell it to. Please show your code.