Page Layout ⇒ How to add chapter headings to LOT / LOF
-
greybadger
- Posts: 13
- Joined: Fri Aug 21, 2009 2:36 pm
How to add chapter headings to LOT / LOF
I'd like my LoT and LoF layout to be similar to the ToC, such that I get a boldfaced line, with the chapter number and title (I'd rather not have the page number there) displayed before the relevant entries.
Is this possible? I'm already using the toclof package to fix some layout issues, but I can't see anything in the documentation to do that...
Cheers!
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
- Stefan Kottwitz
- Site Admin
- Posts: 10397
- Joined: Mon Mar 10, 2008 9:44 pm
How to add chapter headings to LOT / LOF
perhaps post a minimal working example showing how you are generating the toc now, using tocloft etc.
Stefan
-
greybadger
- Posts: 13
- Joined: Fri Aug 21, 2009 2:36 pm
How to add chapter headings to LOT / LOF
Code: Select all
\documentclass[a4paper,11pt,twoside,openright]{report}
\usepackage{fancyhdr}
\usepackage[a4paper,top=3.1cm,bottom=2.5cm,inner=4.0cm,outer=2cm]{geometry}
\usepackage{titlesec}
\usepackage[font=small,labelfont=bf]{caption}
% Set TOC / LOT / LOF number spacing
\usepackage{tocloft}
\setlength{\cftsecnumwidth}{2.5em}
\setlength{\cftsubsecnumwidth}{2.8em}
\setlength{\cftfignumwidth}{2.6em}
\setlength{\cfttabnumwidth}{2.6em}
% Set chapter title format
\titleformat{\chapter}{\bf\huge}{\thechapter .}{1em}{}
% Set page header / footer style
\pagestyle{fancy}
\headheight 13.59999pt
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\fancyfoot[C]{\thepage}
\fancypagestyle{plain}{
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
}
\begin{document}
\tableofcontents
\cleardoublepage
\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage
\chapter{A chapter}
\section{First section}
\subsection{The figure}
This is a chapter with one figure and a table.
\begin{figure}[htbp]
FIGURE HERE
\caption{First figure}
\end{figure}
\begin{table}[htbp]
TABLE HERE
\caption{First table}
\end{table}
\chapter{Another chapter}
\section{First section}
\subsection{The table}
This is a chapter with one table and a figure.
\begin{table}[htbp]
TABLE HERE
\caption{First table}
\end{table}
\begin{figure}[htbp]
FIGURE HERE
\caption{First figure}
\end{figure}
\end{document}
So what I'd like is for the LoT / LoF to follow the same format as the ToC. Looking at it, it would be best if the chapter headings did have page numbers in the LoT / LoF too.
Thanks in advance.
How to add chapter headings to LOT / LOF
use some \addcontentsline commands; in your example:
Code: Select all
...
\chapter{A chapter}
\addcontentsline{lof}{chapter}{A chapter}
\addcontentsline{lot}{chapter}{A chapter}
(chapter contents)
...
\chapter{Another chapter}
\addcontentsline{lof}{chapter}{Another chapter}
\addcontentsline{lot}{chapter}{Another chapter}
(chapter contents)
....-
greybadger
- Posts: 13
- Joined: Fri Aug 21, 2009 2:36 pm
Re: How to add chapter headings to LOT / LOF
Thanks.
How to add chapter headings to LOT / LOF
Code: Select all
\newcommand\addloflot[1]{%
\addcontentsline{lof}{chapter}{\protect\makebox[1.4em][l]{\thechapter}#1}
\addcontentsline{lot}{chapter}{\protect\makebox[1.4em][l]{\thechapter}#1}}Code: Select all
...
\chapter{A chapter}
\addloflot{A chapter}
(chapter contents)
...
\chapter{Another chapter}
\addloflot{Another chapter}
(chapter contents)
...