3

This also applies to the table of contents and list of tables and is related to Add 'Page' above page numbers in Table of Contents, but when adding the words "Figure" and "Page" to the top of a List of Figures that spans more than one page, the additions are typset differently on the first page than on the second.

Here I use \addtocontents{lof}{{~\ul{Figure}}~\hfill{\ul{Page}}\par} following \listoffigures to make the addition to the first page, and \addtocontents{lof}{\protect\afterpage{{~\ul{Figure}}~\hfill{\ul{Page}}\par}} between figure 2.8 and 2.9 to make the addition to the top of the second page.

I rather like how the first page appears, the spacing looks right. I cannot understand why the second page appears differently. I also understand that \noindentin the place of ~ preceding the word "Figure" in my code may be more appropriate. The question is why the different behavior? How can I do this so that the text appears the same on each page. Any thoughts? Have spent quite a lot of time on this but can't reach a solution.

\documentclass[12pt,letterpaper,oneside]{book}
\usepackage{soul}
\usepackage{afterpage}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
\frontmatter
\listoffigures
\addtocontents{lof}{{~\ul{Figure}}~\hfill{\ul{Page}}\par}
\mainmatter
\chapter{one}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\chapter{one}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\addtocontents{lof}{\protect\afterpage{{~\ul{Figure}}~\hfill{\ul{Page}}\par}}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\end{document}
4

Replace the line

\addtocontents{lof}{\protect\afterpage{{~\ul{Figure}}~\hfill{\ul{Page}}\par}}

with

\makeatletter
\addtocontents{lof}{\protect\afterpage{\protect\hbox to \linewidth%
                    {{~\ul{Figure}}~\hfill{\ul{Page}}}\par%
                    \protect\addvspace{10\p@}}}
\makeatother

Note that, since you're using afterpage, you don't need to guess where to put these lines. You can put them just after

\addtocontents{lof}{{~\ul{Figure}}~\hfill{\ul{Page}}\par}

MWE:

\documentclass[12pt,letterpaper,oneside]{book}
\usepackage{soul}
\usepackage{afterpage}
\usepackage{mwe}
\usepackage{tikz}
\begin{document}
\frontmatter
\listoffigures
\addtocontents{lof}{{~\ul{Figure}}~\hfill{\ul{Page}}\par}
\makeatletter
\addtocontents{lof}{\protect\afterpage{\protect\hbox to \linewidth%
                    {{~\ul{Figure}}~\hfill{\ul{Page}}}\par%
                    \protect\addvspace{10\p@}}}
\makeatother
\mainmatter
\chapter{one}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\chapter{one}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\begin{figure}
\includegraphics[width=\linewidth]{example-image-a}
\caption{dummy figure}
\end{figure}
\end{document} 

Output:

enter image description here

  • Works great, thank you so much! Out of curiosity, why is it that the first page behaves differently than the later pages? – Geoarch Feb 11 '15 at 11:54
  • @Geoarch In the first page, the list has not started yet. In the second page, everything you insert, you insert it inside the list. Also, a skip of 10pt is inserted just before the list begins. Try to write \noindent{~\ul{Figure}}~\hfill{\ul{Page}} \begin{enumerate} \item[] {~\ul{Figure}}~\hfill{\ul{Page}} \end{enumerate} and you will see the same effect. – karlkoeller Feb 11 '15 at 13:44
  • @Geoarch You're welcome. :-) – karlkoeller Feb 12 '15 at 6:15

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.