0

For my report I create a cover on illustrator with figures and I would like add line in list of figure to show source of that :

    \documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
 \usepackage{tikz}
\begin{document}

\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}

\listoffigures
   \addtocontents{lof}{{}{\emph{Hannibalszug 6}, Alfred Rethel, 1842}}~\hfill{couverture}
\end{document}

but when i want to add a second line i have a problem :

\addtocontents{lof}{{}{\emph{Hannibalszug 6}, Alfred Rethel, 1842}}~\hfill{couverture}
   \addtocontents{lof}{{}{\emph{Hannibal crossing the Alps}, \emph{Comic History of Rome}, John Leech, 1850}}~\hfill{couverture}

What is the problem in my code ? And a last question, how can i put lines at the top of the list?

Thanks a lot, and sorry for my rough English

1

Is this what you were looking for? Note: the last line doesn't fit inside \textwidth.

lof

\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[T1]{fontenc}
 \usepackage{tikz}
\begin{document}

\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}

\listoffigures
  \addtocontents{lof}{\hbox to \textwidth{{\emph{Hannibalszug 6}, Alfred Rethel, 1842}~\hfill{couverture}}}
  \addtocontents{lof}{\hbox to \textwidth{{\emph{Hannibal crossing the Alps}, \emph{Comic History of Rome}, John Leech, 1850}~\hfill{couverture}}}
\end{document}
|improve this answer|||||
  • thanks a lot ! it's ok, but how can I put this line before the first figure in the list ? – Axelito May 27 '15 at 5:53
  • 1
    The easiest way is to put the \addtocontents inside the figure in front of the caption. It's first come, first served. – John Kormylo May 27 '15 at 13:50

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.