1

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

\addtocounter{section}{1}

\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

\addtocounter{page}{-2}

\addtocounter{section}{1}

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

% Location B

\addtocounter{page}{2}

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

1
  • Welcome to TeX.SX! You don't really want to show your email address to every spammer around. – egreg Sep 21 '18 at 21:20
1

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
\addtocounter{section}{1}
\addtocontents{toc}{\string\contentsline{section}{\string\numberline{\thesection}my Table name}{\the\value{page}}}

\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}

enter image description here

1
  • 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. – G Wojnar Sep 22 '18 at 21:14

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.