4

I'm using LyX. I have a 2 page table of contents, and Id like the header ("Contents") to appear on both pages I tried this:

Table of Contents with headings on every page

by putting the code in the preamble - and by wrapping the "Table Of contents" list with ERT that contains \AtBeginShipout{\tocheader} and \AtBeginShipoutClear after the "Table Of contents".

Nothing worked! I'm using the article class.

1 Answer 1

4

Load the package afterpage

\usepackage{afterpage}

and add these two lines after your \tableofcontents

\addtocontents{toc}{\protect\afterpage{\hspace*{-1.5em}\bfseries\Large \contentsname}}
\addtocontents{toc}{\protect\afterpage{\vspace*{10pt}}}

MWE:

\documentclass{article}

\usepackage{afterpage}

\usepackage{lipsum} % only for the example

\begin{document}

\tableofcontents

\addtocontents{toc}{\protect\afterpage{\hspace*{-1.5em}\bfseries\Large \contentsname}}
\addtocontents{toc}{\protect\afterpage{\vspace*{10pt}}}

\newpage

\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]
\section{test}
\lipsum[1]

\end{document} 

Output:

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .