LaTeX forum ⇒ Text FormattingFigures won't show in List of Figures Topic is solved

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

Figures won't show in List of Figures

Postby Boeri4451 » Tue Apr 14, 2020 11:42 pm

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] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass[11pt,a4paper,oneside,notitlepage]{book}
  2. \usepackage[english]{babel}
  3. \usepackage{gensymb}
  4. \usepackage{amsmath}
  5. \usepackage{tabto}
  6. \newenvironment{Arial}{\fontfamily{phv}\selectfont}{\par}
  7. \usepackage{xr}
  8. \usepackage{titlesec}
  9.  
  10. \makeatletter
  11. \newcommand*{\addFileDependency}[1]{% argument=file name and extension
  12. \typeout{(#1)}
  13. \@addtofilelist{#1}
  14. \IfFileExists{#1}{}{\typeout{No file #1.}}
  15. }
  16. \makeatother
  17.  
  18. \newcommand*{\myexternaldocument}[1]{%
  19. \externaldocument{#1}%
  20. \addFileDependency{#1.tex}%
  21. \addFileDependency{#1.aux}%
  22. }
  23.  
  24.  
  25. \usepackage{subfiles}
  26.  
  27. \usepackage{fancyhdr}
  28. \usepackage{graphicx}
  29. \usepackage{graphicx,caption}
  30. \usepackage[colorlinks]{hyperref}
  31. \hypersetup{citecolor = black}
  32. \graphicspath{{Images/}}
  33. \usepackage{gensymb}
  34. \usepackage{subcaption}
  35.  
  36.  
  37. \usepackage[
  38. backend=biber,
  39. style=apa,
  40. citestyle=authoryear
  41. ]{biblatex}
  42.  
  43. %for the references at the end
  44. \usepackage{csquotes}
  45. \addbibresource{referenties.bib}
  46.  
  47. \usepackage[toc,page]{appendix}
  48.  
  49.  
  50.  
  51.  
  52. \titlespacing{\section}{0pt}{2.5em}{2em}
  53. \titlespacing{\subsection}{0pt}{2em}{1.5em}
  54.  
  55. \begin{document}
  56.  
  57.  
  58.  
  59.  
  60. \pagestyle{empty}
  61.  
  62. \subfile{begin/overzicht}
  63.  
  64. \frontmatter
  65.  
  66. \tableofcontents
  67.  
  68. \newpage
  69.  
  70. \addcontentsline{toc}{chapter}{\listfigurename}
  71. \listoffigures
  72. \addcontentsline{toc}{chapter}{\listtablename}
  73. \listoftables
  74. \newpage
  75.  
  76.  
  77. \pagestyle{plain}
  78. \mainmatter
  79. \subfile{sections/chapter1}
  80.  
  81. \subfile{sections/chapter2}
  82.  
  83. \subfile{sections/chapter3}
  84.  
  85. \subfile{sections/chapter4}
  86.  
  87. \subfile{sections/chapter5}
  88.  
  89. \subfile{sections/chapter6}
  90.  
  91. \subfile{sections/Appendix}
  92.  
  93. \printbibliography
  94. \backmatter
  95.  
  96. \null\newpage
  97.  
  98. \end{document}
Last edited by cgnieder on Tue May 05, 2020 8:25 am, edited 9 times in total.
Reason: added inline code formatting

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

Postby Bartman » Wed Apr 15, 2020 12:46 am

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

Postby Boeri4451 » Tue May 05, 2020 12:44 am

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: 263
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Tue May 05, 2020 2:24 pm

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

Postby Boeri4451 » Tue May 19, 2020 4:15 pm

Thank you so much, it worked!


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests