2

I am having an issue with \listoffigures and \listoftables. They are not generating.

Here is what I have so far:

\documentclass[12pt]{report} 
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subfig}
\linespread{1.6}
\graphicspath{{Images/}}
\usepackage[a4paper,left=1.5in,top=1in,bottom=1in, right=1in]{geometry}
\usepackage{gensymb}
\usepackage{float}
\usepackage{booktabs}
\usepackage[none]{hyphenat}
\usepackage{tocbibind} 
\usepackage{fancyhdr}
\usepackage[toc,page]{appendix}
\usepackage{array}


\begin{document}


\pagenumbering{roman}

\input{abstract}

\chapter*{Dedication}

\chapter*{Acknowledgment}


\tableofcontents 

\listoffigures

\listoftables

\chapter{Introduction}
\pagenumbering{arabic}
\setcounter{page}{1}
%\input{Chapters/Chapter1}

\end{document}

and this is how I do my figures:

\begin{figure}
\centering
\includegraphics[scale=0.4]{Images/P66614NCN2.jpg}
\caption[EAN sample]{EAN after some stuff.}
\label{fig:P66614NCN2}
\end{figure}

But for whatever reason, my list of figures and list of tables remains blank. Can't find anything about how to resolve this. Any help?

Here is my file long:

*File List*
report.cls    2014/09/29 v1.4h Standard LaTeX document class
size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
inputenc.sty    2015/03/17 v1.2c Input encoding file
utf8.def    2015/09/07 v1.1p UTF-8 support for inputenc
t1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
ot1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
omsenc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
subfig.sty    2005/06/28 ver: 1.3 subfig package
caption.sty    2016/02/21 v3.3-144 Customizing captions (AR)
caption3.sty    2016/05/22 v1.7-166 caption3 kernel (AR)
geometry.sty    2010/09/12 v5.6 Page Geometry
ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
float.sty    2001/11/08 v1.3d Float enhancements (AL)
booktabs.sty    2005/04/14 v1.61803 publication quality tables
hyphenat.sty    2009/09/02 v2.3c hyphenation utilities
tocbibind.sty    2010/10/13 v1.5k extra ToC listings
fancyhdr.sty    
appendix.sty    2009/09/02 v1.2b extra appendix facilities
array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
supp-pdf.mkii
 ***********
  • I guess technically I tried twice since I have ad issues with things not coming together after one compile. Will try now and report back. Thanks! ------ just checked and it did not work. – ZaraSou Sep 25 '16 at 22:09
  • 1
    Hm, your code works fine here. I removed \input{abstract} and the \includegraphics (as I don't have any of the files), but I get EAN sample in the list of figures, as expected. Silly question, but you're not by any chance somehow deleting/moving the auxiliary files (.lot,.lof) between compilation runs are you? – Torbjørn T. Sep 25 '16 at 22:20
  • No I am not deleting any files. That's so weird that you are getting it to work. Is it possible it is because I am inputting the files that contain my figures and that's why it isn't listing them? – ZaraSou Sep 25 '16 at 22:25
  • No, that shouldn't (doesn't) matter. Can you describe in more detail the steps you take to produce a PDF? – Torbjørn T. Sep 26 '16 at 7:57
2

Because we do not have your used image and the other files you \inputed I changed your given code snippets to a compilable MWE. With my current version of MiKTeX 2.9 I can compile the MWE without errors. After the third compile run one will see the table of contents, the list of figures (but not list of tables, because I did not add one).

With the command \listfiles I added you get an list of used packages and version numbers at the end of the log file. Please compare this list with mine.

MWE:

\listfiles
\documentclass[12pt]{report} 

\usepackage[utf8]{inputenc}
\usepackage[demo]{graphicx}
\usepackage{subfig}
\linespread{1.6}
%\graphicspath{{Images/}}
\usepackage[a4paper,left=1.5in,top=1in,bottom=1in, right=1in]{geometry}
%\usepackage{gensymb} % <========================= causes two warnings!
\usepackage{float}
\usepackage{booktabs}
\usepackage[none]{hyphenat} % <============================= Why?
\usepackage{tocbibind} 
\usepackage{fancyhdr}
\usepackage[toc,page]{appendix}
\usepackage{array}


\begin{document}

\pagenumbering{roman}

\chapter*{Dedication}
\chapter*{Acknowledgment}

\tableofcontents 
\listoffigures
\listoftables

\chapter{Introduction}
\pagenumbering{arabic}
\setcounter{page}{1}
\begin{figure}
  \centering
  \includegraphics[scale=0.4]{Images/P66614NCN2.jpg}
  \caption[EAN sample]{EAN after some stuff.}
  \label{fig:P66614NCN2}
\end{figure}

\end{document}

with the result:

enter image description here

and my list of used packages and version numbers:

 *File List*
  report.cls    2014/09/29 v1.4h Standard LaTeX document class
  size12.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2016/02/28 v1.1s UTF-8 support for inputenc
   t1enc.dfu    2016/02/28 v1.1s UTF-8 support for inputenc
  ot1enc.dfu    2016/02/28 v1.1s UTF-8 support for inputenc
  omsenc.dfu    2016/02/28 v1.1s UTF-8 support for inputenc
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2016/07/10 v1.0t Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
  pdftex.def    2016/07/10 v0.06j Graphics/color for pdfTeX
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
  subfig.sty    2005/06/28 ver: 1.3 subfig package
 caption.sty    2016/02/21 v3.3-144 Customizing captions (AR)
caption3.sty    2016/05/22 v1.7-166 caption3 kernel (AR)
geometry.sty    2010/09/12 v5.6 Page Geometry
   ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
  ifvtex.sty    2016/05/16 v1.6 Detect VTeX and its facilities (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
geometry.cfg
   float.sty    2001/11/08 v1.3d Float enhancements (AL)
booktabs.sty    2005/04/14 v1.61803 publication quality tables
hyphenat.sty    2009/09/02 v2.3c hyphenation utilities
tocbibind.sty    2010/10/13 v1.5k extra ToC listings
fancyhdr.sty    2016/09/06 3.8 Extensive control of page headers and footers
appendix.sty    2009/09/02 v1.2b extra appendix facilities
   array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
supp-pdf.mkii
pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
  grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
 ***********

 ) 
  • It seems like a few of my packages are an older version. You think that's enough to cause the issue? ... I also tried making a new latex document and copy and pasting the code with the graphix code and still nothing. – ZaraSou Sep 26 '16 at 12:59
  • I copied your code and it worked. I thought maybe it was the gensymb package that was causing the issue, but commenting that out of my main file didn't generate a list of figures. – ZaraSou Sep 26 '16 at 17:35
  • Also I use gensymb to allow me to use \degree to make a degree symbol – ZaraSou Sep 26 '16 at 17:42
  • 1
    Ok i finally figured out the one line that was messing everything up: \addtocontents{toc}{\protect\setcounter{tocdepth}{0}} As soon as I took that out things are working now. – ZaraSou Sep 27 '16 at 17:45

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.