Graphics, Figures & TablesLoF and LoT missing in ToC

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

LoF and LoT missing in ToC

Post by marie2011 »

Dear forum members,

I was wondering if you could help me with the problem I have just encountered.

The List of Tables (LoT) and List of Figures (LoT) do not appear at the beginning of the Table of Contents (ToC). I do not know why. I am adding the whole document with all packages since I do not know if the problem has to do with a particular package.

Code: Select all

\documentclass[
12pt,%
%  draft,%
  twoside,%
  BCOR10mm,%
%  bibtotocnumbered,% <= obsolete
  bib=totoc,        % <= recommended
toc=listof,
toc=bibliography,
numbers=noenddot
]{scrreprt}

\usepackage{tocloft}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,ngerman,catalan,english]{babel}
\usepackage{color}
\usepackage{natbib}
\usepackage{etex}
\usepackage{booktabs}
\usepackage{url}
\usepackage{paralist}
\usepackage{mystyle}
\usepackage{acronym}
\usepackage{graphicx}
\usepackage{appendix}
\usepackage{longtable}
\usepackage{color}
\usepackage{rotating}
\usepackage{tabularx}
\usepackage{enumitem}
\usepackage{caption}
\usepackage{pgfplots}
\usepackage{tabu}
\usepackage{lscape}
\usepackage{textcomp}
\usepackage{pdflscape}
\usepackage{geometry}
\usepackage{soul}
\usepackage{hyperref}
\usepackage{nameref}
%\usepackage{emptypage}
\usepackage{tablefootnote}
\usepackage{afterpage}
\usepackage{ltxtable}
\usepackage{enumitem}
\usepackage{indentfirst}
\cftpagenumbersoff{part}
\captionsetup[table]{labelsep=quad} 
\captionsetup[figure]{labelsep=quad}





\addto\captionsspanish{%
\renewcommand{\listfigurename}{Índice de Figuras}
\renewcommand{\listtablename}{Índice de Tablas}
\renewcommand{\figurename}{Figura}
\renewcommand{\tablename}{Tabla}
\renewcommand{\bibname}{Referencias bibliográficas}
\renewcommand{\appendixname}{Apéndices}
\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\partpagestyle}{empty}
\renewcommand{\appendixpagename}{Apéndices}}



\raggedbottom

\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}







\begin{document}

\selectlanguage{spanish}

%%% Verzeichnisse 

\include{nuevo-2}


\pagenumbering{roman}
 \ifpdf
  \tableofcontents
% \fi


{\listoftables
\let\cleardoublepage\relax
\let\clearpage\relax
\listoffigures
\let\cleardoublepage\relax
\let\clearpage\relax
}


%\listofgraficos

%%%%%%%%%%%%%%%%%%%en espanol:
\include{abreviaturas}
\addtocontents{toc}{\protect\cftpagenumbersoff{chapter}}




%%% Hauptteil
\pagenumbering{arabic}

\include{introduccion}


%%% Bibliographie
\addtocontents{toc}{\cftpagenumberson{chapter}}
\bibliographystyle{miapalike}
\ifpdf
\bibliography{mybibliography}
\else
\fi


%%%%\cleardoublepage%%%(if each chapter starts on an odd-numbered page, please make your appendices do so as well)

\clearpage
\pagenumbering{arabic}
%%%%%%%%%%%%%%apendices en español
\include{aa-apendice}
\end{document}
Many, many thanks in advance.

Regards,

Marie

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

LoF and LoT missing in ToC

Post by cgnieder »

It would be really nice if you'd posted minimal examples! No one of us has the files you're including and about 90% of the packages you're loading are in no way relatd to the problem! If you had tried to minimize the above example you'd probably found out by yourself that the »tocloft« package interferes with KOMA-Script's mechanism:

Code: Select all

\documentclass[
  toc=listof,
]{scrreprt}

\usepackage{tocloft}

\begin{document}

\tableofcontents

\listoftables
\listoffigures

\begin{figure}
 \caption{A figure}
\end{figure}
\begin{table}
 \caption{A table}
\end{table}

\end{document}
Regards
site moderator & package author
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Re: LoF and LoT missing in ToC

Post by marie2011 »

Hello Clemens,

Many thanks for your answer.

How can I delete all KOMA-Script commands?

Regards,

Marie
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

LoF and LoT missing in ToC

Post by cgnieder »

marie2011 wrote:How can I delete all KOMA-Script commands?
I don't understand? Why do you want to do that? You rather need to add the entries manually if you want to keep using »tocloft«:

Code: Select all

\documentclass[
  toc=listof,
]{scrreprt}

\usepackage{tocloft}

\begin{document}

\tableofcontents

\addcontentsline{toc}{chapter}{List of Tables}
\listoftables

\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

\newpage
\begin{figure}
 \caption{A figure}
\end{figure}
\begin{table}
 \caption{A table}
\end{table}

\end{document}
Please make the example minimal next time.

Regards
site moderator & package author
marie2011
Posts: 138
Joined: Mon Feb 06, 2012 4:58 pm

Re: LoF and LoT missing in ToC

Post by marie2011 »

Hello Clemens,

My apologies for not including a minimal example.

Your suggestion worked. My problem now is that the English word (Contents) appears at the beginning, but I should have the word in Spanish.

Do you know how I can change this?

Many thanks in advance.

Regards,

Marie
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

LoF and LoT missing in ToC

Post by cgnieder »

Didn't you include babel in your original example? With

Code: Select all

\usepackage[spanish]{babel}
the name should be in Spanish automatically.

Regards
site moderator & package author
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LoF and LoT missing in ToC

Post by localghost »

cgnieder wrote:Didn't you include babel in your original example? […]
She did. But seemingly she didn't take into account that the last language option in the option list for babel sets the default language for the document, thus the language of the identifiers.
Post Reply