Graphics, Figures & TablesBlank List of Figures?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
td287
Posts: 3
Joined: Mon May 02, 2011 6:06 pm

Blank List of Figures?

Post by td287 »

I have a weird problem. When I place my list of figures before my table of contents, it will provide the list perfectly. If I place it after my table of contents (where I want it), it provides an empty page with a `List of Figures' header. Any ideas? Thanks in advance.

Code: Select all

\documentclass[a4paper, 11pt, oneside]{book}
\usepackage{fullpage}
\usepackage[parfill]{parskip}
\usepackage{setspace} 
\usepackage{subfigure} 
\usepackage[round]{natbib}
\usepackage{graphicx}
\usepackage{morefloats}
\usepackage{makeidx} 
\citeindextrue
\usepackage{pdfpages}
\usepackage{appendix}
\usepackage{epigraph}
\usepackage{enumerate}
\usepackage{multirow}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
 \usepackage{hyperref}
 \hypersetup{colorlinks=false}
\makeindex
\usepackage{multicol}
\makeatletter
\renewenvironment{theindex}
  {\if@twocolumn
      \@restonecolfalse
   \else
      \@restonecoltrue
   \fi
   \setlength{\columnseprule}{0pt}
   \setlength{\columnsep}{25pt}
   \begin{multicols}{2}[\section*{\indexname}]
   \markboth{\MakeUppercase\indexname}%
            {\MakeUppercase\indexname}%
   \thispagestyle{plain}
   \setlength{\parindent}{0pt}
   \setlength{\parskip}{0pt plus 0.3pt}
   \relax
   \let\item\@idxitem}%
  {\end{multicols}\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother

\begin{document}

\tableofcontents

\listoffigures

\begin{spacing}{1.5}

\newpage

\mainmatter
      
\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/Introduction.tex}

\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/LitReview.tex}

\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/ResDesign.tex}

\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/DescriptiveCases.tex}

\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/InterpretiveFramework.tex}

\input{/Users/tylerdenmead/Documents/Cambridge/PhD/Dissertation/chapters/Discussion.tex}

\newpage

\backmatter

\addcontentsline{toc}{chapter}{References}
\newpage 
\bibliographystyle{apa}
\renewcommand\bibname{References}
\bibliography{/Users/tylerdenmead/Documents/Cambridge/Bibliographies/Main.Library.bib}

\end{spacing}

\appendix
\cleardoublepage
\addcontentsline{toc}{chapter}{Appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}

\end{document}
Last edited by Stefan Kottwitz on Mon May 02, 2011 8:05 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Blank List of Figures?

Post by Stefan Kottwitz »

Hi,

welcome to the board!

This forum provides a code environment for more readability. Just click the Code button above the edit text field to format text as code. I did this for you, so you can see how it looks.

It would be even better if you reduce the code in a meaningful way. For example, all these \input lines take a lot of space here but they just tell us nothing about the problem. Just a tip.

Regarding your problem, I think it's caused by that line in the appendix:

Code: Select all

\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
You could keep such changes in the TOC local by \begingroup and \endgroup of by curly braces:

Code: Select all

{\tableofcontents}
Stefan
LaTeX.org admin
td287
Posts: 3
Joined: Mon May 02, 2011 6:06 pm

Re: Blank List of Figures?

Post by td287 »

Cheers... I really appreciate it. I'll keep post formatting in mind next time.

And, thanks for identifying the problem. I have taken out that line of code to solve the problem.

I tried what I think you meant --- but I couldn't get it to work...

I was trying to suppress the list of my appendices in my table of contents. But I'm fine with them if it means I get my list of figures!

Best wishes.
td287
Posts: 3
Joined: Mon May 02, 2011 6:06 pm

Re: Blank List of Figures?

Post by td287 »

On second thought, would you mind clarifying your use of begingroup and endgroup and curly braces? I cannot seem to get it to work.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Blank List of Figures?

Post by Stefan Kottwitz »

Hi,
td287 wrote:would you mind clarifying your use of begingroup and endgroup and curly braces?
I meant, instead of just \tableofcontents, write

Code: Select all

{\tableofcontents}

Code: Select all

\begingroup
\tableofcontents
\endgroup
or, after \tableofcontents, use again

Code: Select all

\setcounter{tocdepth}{2}}
or use another desired value.

Stefan
LaTeX.org admin
Post Reply