# Inserting toc entry, but wrong page number shows

I inserted two pages in landscape mode as ,pdf files (which are tables that take up the entire page), and I want to include them in the TOC, listed as a section.

Since the table takes up the space of an entire page, I did not want to use a \section{myTable} command, which would put the section name on a page all by itself. I tried:

... my p. 97 content

\pagebreak % Location A

\addcontentsline{toc}{section}{\thesection . \,\, my Table name}

% Location B

\begin{landscape}

\begin{figure}[t]
\scalebox{1}[0.85]{\includegraphics[width=1.7\textwidth, clip=true,trim= 0cm 0cm 0cm 0cm]{myTable_p1.pdf}}
\label{fig:myTablep1}
\end{figure}

\begin{figure}[t]
\includegraphics[width=1.7\textwidth, clip=true,trim= 0cm 4cm 0cm 4cm]{myTablep2.pdf}
\label{fig:myTablep2}
\end{figure}

\end{landscape}

\newpage

\section{myNextSection}\label{nextsect}


Table_p1 appears properly on page 98. Table_p2 appears properly on page 99. And myNextSection appears properly on page 100. But in the TOC, section myTable is listed on page 100, not on page 98. If I move the \pagebreak command from location A to location B, then in the TOC, section myTable is listed on page 97, not on page 98.

I also tried using \clearpage or \newpage instead of \pagebreak.

I also tried:

... my p. 97 content

\pagebreak % Location A

\addcontentsline{toc}{section}{\thesection . \,\, my Table name}

% Location B



and many other variations in placement of the two \addtocounter{page} commands, all to no avail.

This appears to do the job, but I am supposing you are not using hyperref.

\documentclass{article}
\usepackage{lscape}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}

\tableofcontents
\section{First section}
\lipsum

% Location B
\clearpage

\begin{landscape}

\begin{figure}[t]
\scalebox{1}[0.85]{\includegraphics[width=1.7\textwidth, clip=true,trim= 0cm 0cm 0cm 0cm]{example-image-a}}
\label{fig:myTablep1}
\end{figure}

\begin{figure}[t]
\includegraphics[width=1.7\textwidth, clip=true,trim= 0cm 4cm 0cm 4cm]{example-image-b}
\label{fig:myTablep2}
\end{figure}

\end{landscape}

\newpage

\section{myNextSection}\label{nextsect}

Some text
\end{document}


• Thanks jfbu. Two tweaks were needed. Instead of \numberline{\thesection}my Table name, I needed \numberline{\thesection.}\hspace{-0.5em}my Table name. I am not currently using hyperref but probably want to in the future. Also, I am using pdflscape package instead of lscape package. Sep 22, 2018 at 21:14