Text FormattingFigures won't show in List of Figures

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Boeri4451
Posts: 5
Joined: Tue Apr 14, 2020 11:35 pm

Figures won't show in List of Figures

Post by Boeri4451 »

Hi everyone,

I have a problem concerning the list of figures and list of tables. When I place \listoffigures and \listoftables after the \tableofcontents the tables and figures won't appear. Nevertheless, when I place the \listoffigures and \listoftables first, the figures and tables appear. Is there anyway to solve this? Here is my code:

Code: Select all

\documentclass[11pt,a4paper,oneside,notitlepage]{book}
\usepackage[english]{babel}
\usepackage{gensymb}
\usepackage{amsmath}
\usepackage{tabto}
\newenvironment{Arial}{\fontfamily{phv}\selectfont}{\par}
\usepackage{xr}
\usepackage{titlesec}

\makeatletter
\newcommand*{\addFileDependency}[1]{% argument=file name and extension
  \typeout{(#1)}
  \@addtofilelist{#1}
  \IfFileExists{#1}{}{\typeout{No file #1.}}
}
\makeatother

\newcommand*{\myexternaldocument}[1]{%
    \externaldocument{#1}%
    \addFileDependency{#1.tex}%
    \addFileDependency{#1.aux}%
}


\usepackage{subfiles}

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{graphicx,caption}
\usepackage[colorlinks]{hyperref}
\hypersetup{citecolor = black}
\graphicspath{{Images/}}
\usepackage{gensymb}
\usepackage{subcaption}


\usepackage[
backend=biber,
style=apa,
citestyle=authoryear
]{biblatex}

%for the references at the end
\usepackage{csquotes}
\addbibresource{referenties.bib}

\usepackage[toc,page]{appendix}




\titlespacing{\section}{0pt}{2.5em}{2em}
\titlespacing{\subsection}{0pt}{2em}{1.5em}

\begin{document}




\pagestyle{empty}

\subfile{begin/overzicht}

\frontmatter

\tableofcontents

\newpage

  \addcontentsline{toc}{chapter}{\listfigurename}
  \listoffigures 
\addcontentsline{toc}{chapter}{\listtablename}
  \listoftables
\newpage


\pagestyle{plain}
\mainmatter
\subfile{sections/chapter1}

\subfile{sections/chapter2}

\subfile{sections/chapter3}

\subfile{sections/chapter4}

\subfile{sections/chapter5}

\subfile{sections/chapter6}

\subfile{sections/Appendix}

\printbibliography
\backmatter

\null\newpage

\end{document}
Last edited by cgnieder on Tue May 05, 2020 8:25 am, edited 9 times in total.

Recommended reading 2024:

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

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

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Figures won't show in List of Figures

Post by Bartman »

Please use the BBCode to highlight your source code.

If you can somehow turn your example into a Infominimal working example, you improve your chance of getting help.

I don't see a solution for this problem right now, but i have solutions for another problem:

You get the wrong page number when you enter the list of figures in the table of contents. You must at least insert the \clearpage command after \tableofcontents in your one-sided document so that the page number is correct.

The tocbibind package can add the list of figures and tables to the table of contents without the \clearpage and \addcontentsline commands.
Boeri4451
Posts: 5
Joined: Tue Apr 14, 2020 11:35 pm

Figures won't show in List of Figures

Post by Boeri4451 »

Hi, thanks for the advice, I will make the adjustments.

Right now I have no idea how why the list of figures and tables only shows the title if placed after the tables of contents. The strange thing is that it does show the figures and tables if placed in front of the table of contents.

Thanks for the advice!
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Figures won't show in List of Figures

Post by rais »

that sounds like you're putting \setcounter{tocdepth}{0} or smaller into the TOC.
Try adding \setcounter{tocdepth}{2} between TOC and LOF/LOT.

KR
Rainer
Boeri4451
Posts: 5
Joined: Tue Apr 14, 2020 11:35 pm

Figures won't show in List of Figures

Post by Boeri4451 »

Thank you so much, it worked!
dhara
Posts: 3
Joined: Fri Sep 02, 2022 1:36 am

Figures won't show in List of Figures

Post by dhara »

Boeri4451 wrote:Thank you so much, it worked!
Hi, Can you guide me how you solve this problem? I tried multiple ways, but couldn't able to solve.
dhara
Posts: 3
Joined: Fri Sep 02, 2022 1:36 am

Figures won't show in List of Figures

Post by dhara »

Can anyone solve this problem?
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

Figures won't show in List of Figures

Post by MjK »

If rais' suggestion isn't a solution for you, please show a Infominimal working example, that can be used to reproduce your problem. And please tag your minimal working example correctly as code (not as mwe!). Otherwise, it would be hard to give you a proper answer.

Disclaimer: This is non of my favorite topics. Therefore, please do not expect any further replies from me. However, others will probably also need the mentioned information to be able to give reasonable answers.
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
dhara
Posts: 3
Joined: Fri Sep 02, 2022 1:36 am

Figures won't show in List of Figures

Post by dhara »

rais' suggestion work. Thanks ;)
rais wrote:that sounds like you're putting \setcounter{tocdepth}{0} or smaller into the TOC.
Try adding \setcounter{tocdepth}{2} between TOC and LOF/LOT.

KR
Rainer
Post Reply