Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I get the list of figures as a section in an article document, so it will be listed in the table of contents? At the moment it's listed in the ToC, but without number.

share|improve this question
    
Welcome to Tex! Why don't you try something like \section{List of Figures}\lofwithouttitle\addcontentsline{toc}{section}{List o Figures} –  Thanos Nov 11 '12 at 16:22
1  
@Thanos: You would also need \makeatletter\newcommand{\lofwithouttitle}{\@starttoc{lof}}\makeatother. –  Werner Nov 11 '12 at 16:34
    
@Werner:Yeas you are right...I forgot to copy it...Thank's and sorry for the inconvinience... –  Thanos Nov 11 '12 at 16:36

2 Answers 2

up vote 7 down vote accepted

In the default article document class \listoffigures is set as \section*, thereby removing it from being displayed in the ToC:

\newcommand\listoffigures{%
    \section*{\listfigurename}%
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lof}%
    }

Modifying this to actually use \section instead inserts the appropriate numbering:

enter image description here

\documentclass{article}
\newcommand{\insertfigure}{\begin{figure}\caption{A figure caption}\end{figure}}
\makeatletter
\renewcommand\listoffigures{%
    \section{\listfigurename}% Used to be \section*{\listfigurename}
      \@mkboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}%
    \@starttoc{lof}%
    }
\makeatother
\begin{document}
\tableofcontents
\listoffigures
\section{A section}\insertfigure\insertfigure\insertfigure
\section{A section}\insertfigure\insertfigure\insertfigure
\section{A section}\insertfigure\insertfigure\insertfigure
\section{A section}\insertfigure\insertfigure\insertfigure
\section{A section}\insertfigure\insertfigure\insertfigure
\section{A section}\insertfigure\insertfigure\insertfigure
\end{document}
share|improve this answer
    
thanks a lot :) –  heysamhey Nov 11 '12 at 16:42

With the KOMA-Script classes, simply use the class option listof=totocnumbered.

\documentclass[listof=totocnumbered]{scrartcl}

\begin{document}

\tableofcontents

\listoffigures

\section{foo}

\begin{figure}[h]
\centering
\rule{1cm}{1cm}
\caption{A figure}
\end{figure}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.