Chapter 08 – Listing Contents and References

Customizing the TOC

\documentclass{book}
\setcounter{tocdepth}{3}
\begin{document}
\tableofcontents
\part{First Part}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{First main chapter}
\section{A section}
\section{Another section}
\subsection{A smaller section}
\subsubsection[Deeper level]{This section has an even deeper
level}
\chapter{Second main chapter}
\part{Second part}
\chapter{Third main chapter}
\appendix
\cleardoublepage
\addtocontents{toc}{\bigskip}
\addcontentsline{toc}{part}{Appendix}
\chapter{Glossary}
\chapter{Symbols}
\end{document}

Creating and customizing lists of figures

\documentclass{book}
\setcounter{tocdepth}{3}
\renewcommand{\figurename}{Diagram}
\renewcommand{\listfigurename}{List of Diagrams}
\begin{document}
\tableofcontents
\listoffigures
\part{First Part}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{First main chapter}
\section{A section}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{Enterprize Organizational Chart}
\end{figure}
\section{Another section}
\subsection{A smaller section}
\subsubsection[Deeper level]{This section has an even deeper
level}
\chapter{Second main chapter}
\part{Second part}
\chapter{Third main chapter}
\addtocontents{lof}{Network Diagrams:}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{Network overview}
\end{figure}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{WLAN Design}
\end{figure}
\appendix
\cleardoublepage
\addtocontents{toc}{\bigskip}
\addcontentsline{toc}{part}{Appendix}
\chapter{Glossary}
\chapter{Symbols}
\end{document}

Generating an index

% !TEX makeindex document
\documentclass{book}
\usepackage{index}
\makeindex
\setcounter{tocdepth}{3}
\renewcommand{\figurename}{Diagram}
\renewcommand{\listfigurename}{List of Diagrams}
\begin{document}
\tableofcontents
\listoffigures
\part{First Part}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{First main chapter}
\section{A section}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{\index{enterprise}Enterprise Organizational Chart}
\end{figure}
\section{Another section}
\subsection{A smaller section}
\subsubsection[Deeper level]{This section has an even deeper
level}
\chapter{Second main chapter}
\part{Second part}
\chapter{Third main chapter}
\addtocontents{lof}{Network Diagrams:}
\index{network}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{Network overview}
\end{figure}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{WLAN Design}
\end{figure}
\appendix
\cleardoublepage
\addtocontents{toc}{\bigskip}
\addcontentsline{toc}{part}{Appendix}
\chapter{Glossary}
\chapter{Symbols}
\clearpage
\addcontentsline{toc}{chapter}{Index}
\printindex
\end{document}

Extending the index:

% !TEX makeindex document
\documentclass{book}
\usepackage{index}
\makeindex
\setcounter{tocdepth}{3}
\renewcommand{\figurename}{Diagram}
\renewcommand{\listfigurename}{List of Diagrams}
\newcommand{\group}{\TeX\ Users Group}
\begin{document}
\tableofcontents
\listoffigures
\part{First Part}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{First main chapter}
\section{A section}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{\index{enterprise}Enterprise Organizational Chart}
\end{figure}
\index{enterprise!organization}
\index{enterprise!organization!sales}
\index{enterprise!organization!controlling}
\index{enterprise!organization!operation}
\section{Another section}
\subsection{A smaller section}
\subsubsection[Deeper level]{This section has an even deeper
level}
\chapter{Second main chapter}
\part{Second part}
\chapter{Third main chapter}
\index{network|(}
\addtocontents{lof}{Network Diagrams:}
\index{network}
\index{network!overview}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{Network overview}
\end{figure}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{WLAN Design}
\end{figure}
\clearpage
% index commands for testing
\index{wireless|see{WLAN}}
\index{WLAN|emph}
\index{Gamma@$\Gamma$}
\index{\group\ sorted wrong}
\index{TeX@\group\ sorted correctly}
\index{schon@sch\"{o}n}
\index{exclamation ("!)!loud}
End of network chapter.
\index{network|)}
\appendix
\cleardoublepage
\addtocontents{toc}{\bigskip}
\addcontentsline{toc}{part}{Appendix}
\chapter{Glossary}
\chapter{Symbols}
\clearpage
\addcontentsline{toc}{chapter}{Index}
\printindex
\end{document}

Changing to ISO style:

% !TEX makeindex -s iso document
\documentclass{book}
\usepackage{index}
\makeindex
\setcounter{tocdepth}{3}
\renewcommand{\figurename}{Diagram}
\renewcommand{\listfigurename}{List of Diagrams}
\newcommand{\group}{\TeX\ Users Group}
\begin{document}
\tableofcontents
\listoffigures
\part{First Part}
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\chapter{First main chapter}
\section{A section}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{\index{enterprise}Enterprise Organizational Chart}
\end{figure}
\index{enterprise!organization}
\index{enterprise!organization!sales}
\index{enterprise!organization!controlling}
\index{enterprise!organization!operation}
\section{Another section}
\subsection{A smaller section}
\subsubsection[Deeper level]{This section has an even deeper
level}
\chapter{Second main chapter}
\part{Second part}
\chapter{Third main chapter}
\index{network|(}
\addtocontents{lof}{Network Diagrams:}
\index{network}
\index{network!overview}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{Network overview}
\end{figure}
\begin{figure}
\centering
\fbox{Diagram placeholder}
\caption{WLAN Design}
\end{figure}
\clearpage
% index commands for testing
\index{wireless|see{WLAN}}
\index{WLAN|emph}
\index{Gamma@$\Gamma$}
\index{\group\ sorted wrong}
\index{TeX@\group\ sorted correctly}
\index{schon@sch\"{o}n}
\index{exclamation ("!)!loud}
End of network chapter.
\index{network|)}
\appendix
\cleardoublepage
\addtocontents{toc}{\bigskip}
\addcontentsline{toc}{part}{Appendix}
\chapter{Glossary}
\chapter{Symbols}
\clearpage
\addcontentsline{toc}{chapter}{Index}
\printindex
\end{document}

Creating a bibliography

\documentclass{article}
\begin{document}
\section*{Recommended texts}
To study \TeX\ in depth, see \cite{DK86}. For writing math texts,
see \cite{DK89}.
\begin{thebibliography}{8}
\bibitem{DK86} D.E. Knuth, \emph{The {\TeX}book}, 1986
\bibitem{DK89} D.E. Knuth, \emph{Typesetting Concrete
Mathematics}, 1989
\end{thebibliography}
\end{document}

Using labels:

\documentclass{article}
\begin{document}
\section*{Recommended texts}
To study \TeX\ in depth, see \cite{DK86}. For writing math texts,
see \cite{DK89}.
\begin{thebibliography}{Knuth89}
\bibitem[Knuth86]{DK86} D.E. Knuth, \emph{The {\TeX}book}, 1986
\bibitem[Knuth89]{DK89} D.E. Knuth, \emph{Typesetting Concrete
Mathematics}, 1989
\end{thebibliography}
\end{document}

Using a bibliography database – here we use the filecontents environment to generate it:

\documentclass{article}
\begin{filecontents}[force]{example.bib}
@book{DK86,
author = "D.E. Knuth",
title = "The {\TeX}book",
publisher = "Addison Wesley",
year = 1986
}
@article{DK89,
author = "D.E. Knuth",
title = "Typesetting Concrete Mathematics",
journal = "TUGboat",
volume = 10,
number = 1,
pages = "31--36",
month = apr,
year = 1989
}
\end{filecontents}
\begin{document}
\section*{Recommended texts}
To study \TeX\ in depth, see \cite{DK86}. For writing math texts,
see \cite{DK89}.
\bibliographystyle{alpha}
\bibliography{example}
\end{document}