Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using my school's latex cls file. Unfortunately, since this package was last updated, we are now required to add the word 'Page' above the topmost page number on each page of the Table of Contents. This cls file includes the following bit of code, which puts 'Page' at the top of the first page, but not any subsequent pages (see attached)

\newcommand\chapteruaf{
\if@arabic\relax\else\if@chapterone\setcounter{page}{1}\else\relax\fi\fi
\@chapteronefalse
                    \if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{myheadings}%                                                                               
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapteruaf}
\def\@schapteruaf#1{\if@twocolumn
                   \@topnewpage[\@makeschapterheaduaf{#1}]%                                                                   
                 \else
                   \@makeschapterheaduaf{#1}%                                                                                 
                   \@afterheading
                 \fi}
\def\@makeschapterheaduaf#1{%                                                                                                 
  {\parindent \z@ \centering
    \reset@font
    \normalsize \bfseries  #1\par                                                                                             
    \vspace{-18.3pt}\hspace{143mm} Page                                                                                       
    \nobreak
  }}

First page of the TOC: alt text

second page of the TOC: alt text

Any thoughts here? I have played with this a bit, and can't get it to work. Thanks.

share|improve this question

3 Answers 3

up vote 6 down vote accepted

A table of contents is often less than 3 pages so you can simply insert the command into the toc file. With the package afterpage you do not have to know where the pagebreak will happen:

\documentclass[a5paper]{article}
\usepackage{afterpage}
\begin{document}

\tableofcontents

\addtocontents{toc}{~\hfill\textbf{Page}\par}
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\addtocontents{toc}{\protect\afterpage{~\hfill\textbf{Page}\par\medskip}}
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage
\section{foo}bar\clearpage

\end{document}
share|improve this answer
    
Perfect, worked like a charm! Thanks! –  mrdillon Jan 5 '11 at 17:09

You can use the tocloft package to customize the layout of the table of contents, list of figures, list of tables, etc.

\documentclass{article}
\usepackage{tocloft}
\renewcommand\contentsname{Table of Contents}
\renewcommand\cfttoctitlefont{\hfill\normalsize\bfseries}
% On the same line
%\renewcommand\cftaftertoctitle{\hfill\llap{\bfseries Page}}
% On the next line
\renewcommand\cftaftertoctitle{\hfill\null\\\null\hfill\textbf{Page}}
\begin{document}
\tableofcontents
\section{asdf}
\section{qwer}
\section{zxcv}
\end{document}

The commented out line should be used if you want the Page to appear on the same line as Table of Contents and the uncommented line should be used if you want it to be on the next line.

You can also add the dot leaders to sections (or chapters, if you're using chapters) with

\renewcommand\cftsecdotsep{\cftdotsep}

or

\renewcommand\cftchapdotsep{\cftdotsep}
share|improve this answer
    
Hmm, when I \usepackage{tocloft}: ! LaTeX Error: Command \c@lofdepth already defined. Or name \end... illegal, see p.192 of the manual. I am guessing this comes down to something from the cls file... –  mrdillon Jan 5 '11 at 14:36
    
per this thread: mail-archive.com/lyx-users@lists.lyx.org/msg16706.html, if \usepackage[subfigure]{tocloft} is called, things work fine. Unfortunately, this solution seems to still only place 'Page' on the first page of the TOC, and nothing else. Also for some reason it is killing the pagebreak between the TOC and LOF and is altering the fonts and layout of the front matter significantly. –  mrdillon Jan 5 '11 at 14:52
    
@mrdillon: Ah, I misunderstood. I thought you only wanted it at the top. Herbert's approach seems like a good approach. tocloft allows a fair bit of customization, so it doesn't surprise me that it changes the layout, but it gives you a uniform way to change the layout. –  TH. Jan 5 '11 at 20:38
    
@mrdillon: You should be using the subfig package instead of the older subfigure. Then there's no need to use the subfigure option to tocloft. –  TH. Jan 5 '11 at 20:47

Hey, as it turns out we go to the same school, and are dealing with the same uafthesis bugs! I've been fixing mine on github at http://github.com/jesusabdullah/uafthesis.

Fwiw, I read the handbook, and it says we only need "page" above the first page, from what I can tell.

share|improve this answer
    
From the 09/10 Handbook: 4.10 Table of Contents The title block “Table of Contents” must appear at the upper margin of the first page and be centered. The title block is not repeated on any subsequent pages. Dotted leaders are preferred between headings and page numbers. The word “Page” should be typed above the listing of the page numbers on each page of the Table of Contents. –  mrdillon May 11 '11 at 4:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.