1

I would like to build a very simple list of figures (as required by Cambridge Journals). They should be ordered to have a progressive number, thus in order of appearance. First all the figures and then the tables.

The code I am actually using it trivial and repetitive (as again in the Journal example):

\documentclass[a4paper, 11pt]{article}
\addtolength{\textwidth}{3.6cm}
\addtolength{\hoffset}{-1.8cm}
\addtolength{\voffset}{-1.8cm}
\addtolength{\textheight}{1.8cm}
\usepackage[pdftex, demo]{graphicx}
\usepackage[utf8x]{inputenc}
\begin{document}
    % 
    \begin{figure}[ht]
        \centering
        \includegraphics[width=0.4\textwidth]{image1.pdf}
        \caption{Caption 1, some words}
        \label{FIG:1}
    \end{figure}
    % 
    % 
    \begin{figure}[ht]
        \centering
        \includegraphics[width=0.4\textwidth]{image2.pdf}
        \caption{Caption 2, some other words}
        \label{FIG:2}
    \end{figure}
    % 
    \newpage
    %
    \par\vspace{\baselineskip}\noindent
    \par\vspace{4mm}\noindent
    {\bf{List of figures and tables}}

    \noindent
    Fig. \ref{FIG:1}. Caption 1, some words

    \noindent
    Fig. \ref{FIG:2}. Caption 2, some other words
\end{document}

Page Example

Is there a way to repeat the caption written in the figure's caption (as: Caption 1, some words) without rewriting or by copy&paste?

Thinking to a different approach, is it possible to simply rewrite the \listoffigures to get the same layout?

5
  • Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Oct 22, 2014 at 12:07
  • I edited the example to make it self contained. I hope it is right now. Thanks! Oct 22, 2014 at 12:49
  • Up for using a KOMA class? It provides the option listof=entryprefix.
    – Johannes_B
    Oct 22, 2014 at 12:58
  • Is the order of figures and tables of importance, or is having all the figure captions first, then all the table captions ok?
    – Johannes_B
    Oct 22, 2014 at 13:14
  • They should be ordered to have a progressive number, thus in order of appearance. First all the figures and then the tables. Regarding the KOMA class, unfortunately I should use the class provided by the journal, so I suppose I can not switch. Oct 22, 2014 at 13:42

1 Answer 1

2

You could patch the caption command to do write out the type. But i think the journal might not be happy about hacks like this.

\documentclass{article}
\usepackage{etoolbox}
\usepackage{tocbasic}
\usepackage[tocindentauto]{tocstyle}
\makeatletter
\patchcmd{\@caption}{
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
}{
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{#1 \csname the#1\endcsname}{\ignorespaces #2}}%
}{}{}
\newcommand{\listofcaptions}{
    {\noindent\bfseries\Large List of captions}
    \vspace{1em}
    \@starttoc{lof}
    \@starttoc{lot}
}
\makeatother
\usepackage{capt-of}
\begin{document}

\captionof{figure}{some nice caption with a duck}
\captionof{figure}{some nice caption with a cat}
\captionof{table}{some nice caption with a horse}
\captionof{table}{some nice caption with a lion}
\captionof{figure}{some nice caption with an elephant}
\noindent\rule{\textwidth}{1pt}

\listofcaptions
\end{document}

After multiple runs you get the following:

enter image description here

1
  • First, thank you for your answer. Well, you are right, could be problematic to get it accepted when uploading. I think in the end I will have to do the list of figures (and tables) by hand (as done in the template). I even struggle to edit this hack to get the same layout as in the image I added, unfortunately I am not so expert. Thanks again! Oct 22, 2014 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .