3

I want to change the appearance of the list of figures to roughly what I have under "New List of Figures" in the example below: Between the header for the lof and the entries I want a line with two subheadings in small caps, "figure" and "caption". Then, after some vertical space, the figure number, horizontal space, the caption, then no dotted line but only a small space, and then the page number. I understand that latex doesn't handle lof, toc etc. as tables but as lists, I formatted it as a table only for the example.

\documentclass{memoir}
\usepackage{float}
% \usepackage{tocloft} % Actually I haven't used it yet.
\usepackage{ltablex}

\renewcommand\printloftitle[1]{\section*{#1}}
\renewcommand\afterloftitle{}

\begin{document}

\listoffigures


\section*{New List of Figures}
\vspace{-\baselineskip}
\begin{tabularx}{\linewidth}{@{}lX}
\textsc{figure} & \textsc{caption}\\
\\
0.1 & myfigureA \quad 1\\
0.2 & myfigureB \quad 1\\
0.3 & myfigureC has a longer caption, longer than a line. Still a little bit longer. \quad 1\\
\end{tabularx}


\begin{figure}[H]
\centering
AAA\\
AAA\\
AAA\\
\caption{myfigureA}
\end{figure}
\begin{figure}[H]
\centering
BBB\\
BBB\\
BBB\\
\caption{myfigureB}
\end{figure}
\begin{figure}[H]
\centering
CCC\\
CCC\\
CCC\\
\caption{myfigureC has a longer caption, longer than a line. Still a little bit longer.} 
\end{figure}

\end{document}

example

EDIT: Mike Renfro's answer almost works for me, but there's one problem with the long caption, namely its last word and the number get printed at the end of the line:

changed example

\documentclass{memoir}
\usepackage{calc}

\renewcommand\printloftitle[1]{\section*{#1}}
\renewcommand\afterloftitle{\vspace{\baselineskip}\textsc{Figure\quad Caption}\\}

\setlength{\cftfigurenumwidth}{\widthof{\textsc{Figure\quad}}}
\renewcommand{\cftfigureleader}{}

\begin{document}

\listoffigures

\begin{figure}
\caption{myfigureA}
\end{figure}
\begin{figure}
\caption{myfigureB}
\end{figure}
\begin{figure}
\caption{myfigureC has a longer caption, longer than a line. Still a little bit longer.} 
\end{figure}

\end{document}
  • 1
    Memoir includes most of all of tocloft's functionality. Start reading chapter 9 of the memoir manual (Contents Lists), especially section 9.2 (The Class ToC Methods) while I see if there's a simple answer. – Mike Renfro Jul 11 '15 at 13:21
  • 1
    Adding \textsc or \quad appears to be the root cause of your current problem. Don't have a good fix for it yet. – Mike Renfro Jul 11 '15 at 15:19
  • @MikeRenfro I am now experimenting with your answer in my "real file", with quite a few entries, with simple \renewcommand\afterloftitle{Figure Caption} and \renewcommand\afterloftitle{Figure Caption}, no \quad, \textsc, \vspace{\baselineskip} or `\`. The problem remains, so as far as I can see it doesn't lie in any of these. – muk.li Jul 11 '15 at 15:37
  • @MikeRenfro As far as I can see your answer works when an entry in the lof is only one line, or the last line of the caption contains only one word. Try adding a few more words to figure 3 and you'll see. – muk.li Jul 11 '15 at 15:52
  • 1
    Ragged right entries ensure now. – Mike Renfro Jul 11 '15 at 16:09
3

This answer doesn't include the float or ltablex packages, since they don't appear to affect things one way or the other. If you want a small caps heading above the LoF, just adjust the \afterloftitle and \widthof commands accordingly.

\documentclass{memoir}
\usepackage{calc} % for calculating width of LoF headings

\renewcommand\printloftitle[1]{\section*{#1}}
\renewcommand\afterloftitle{Figure Caption}
% adds a line of text after the LoF title
\setlength{\cftfigurenumwidth}{\widthof{Figure }}
% instead of "Figure " including the space, you can use whatever precedes the
% "Caption" header above
\renewcommand{\cftfigureleader}{}
% removes the dot leader between the figure title and the page number
\renewcommand{\cftfigureafterpnum}{\cftparfillskip}
% Ensure ragged right overall (http://tex.stackexchange.com/questions/53057/)

\begin{document}
{\raggedright
\listoffigures
}
\begin{figure}
\caption{myfigureA}
\end{figure}
\begin{figure}
\caption{myfigureB}
\end{figure}
\begin{figure}
\caption{myfigureC has a longer caption, longer than a line. Maybe a good bit longer. Or even longer still.} 
\end{figure}

\end{document}

enter image description here

  • Almost there, but one problem remains, see my edit above. – muk.li Jul 11 '15 at 14:57
  • If in your example I want to change the Heading to be formatted like a chapter heading via \renewcommand\printloftitle[1]{\chapter*{#1}} I get two blank pages inserted at the beginning of the file. Any idea why that is so and how I can turn it off? Or, assuming that I could just comment out that line because per default the LoF title is printed like a chapter title, "Figure Caption" surprisingly appears in the same line, so that that's also not so easily possible. – muk.li Jul 23 '15 at 9:08
  • See also tex.stackexchange.com/questions/256636/… – muk.li Jul 23 '15 at 10:39

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.