3

How can I have a page break manually inserted into the list of figures (\listoffigures)? I need a page break after a certain line/image-caption.

Consider MWE:

\documentclass[14pt, a4paper]{extreport}
\usepackage[left=3.5cm, right=2.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage[toc,page]{appendix}
\usepackage{caption}
\usepackage{graphicx}
\begin{document}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents{}
\addcontentsline{toc}{chapter}{Table of Contents}
\newpage
%%------------List of Figures----------------------
\listoffigures{}
\addcontentsline{toc}{chapter}{List of Figures}

\chapter{someCH}
\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{bb}
\end{figure}

\part*{Test}
\markboth{}{}
\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{name}
\end{figure}

\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{bbb}
\end{figure}
\addtocontents{lof}{\protect\pagebreak}
\appendix
\chapter{chapt}\label{a.b}
\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{name}
\end{figure}
\end{document}
Werner
  • 603,163
Jan
  • 133
  • Hello! Maybe this could serve as a starting point? But I didn’t try this on figures or tables yet https://tex.stackexchange.com/questions/6489/split-the-table-of-contents-in-two-pages – Jasper Habicht Sep 13 '17 at 20:31
  • 1
    \addtocontents{lof}{\protect\newpage} After the figure where the pagebrak shoul be –  Sep 13 '17 at 20:31
  • 1
    Do this when you're sure you won't make any other change and clearly mark the code in order to be able to find it: between two paragraphs before the figure you want in the next page add \addtocontents{lof}{\protect\pagebreak}. – egreg Sep 13 '17 at 20:32
  • So, now you got the same answer about three times ;) – Jasper Habicht Sep 13 '17 at 20:42
  • 1
    @JasperHabicht But \pagebreak is better than \newpage, actually, because if \flushbottom is in force LaTeX will fill the page rather than truncate it. – egreg Sep 13 '17 at 20:46
  • @egreg why all this preventions?... And it does not work as expected.. As it inserts a pagebreak few figures before I put the line – Jan Sep 13 '17 at 21:04
  • @Jan it will work if used at the correct place but you have given no indication of your code so it is hard to help by saying what is wrong with your input. – David Carlisle Sep 13 '17 at 21:13
  • see edit.. i want the appendix-figures on a new page... But maybe I will consider a seperate list of figures for the appendix (And will accept corresponding answers).. Nonetheless it would be good to know whats wrong there.. – Jan Sep 13 '17 at 21:19
  • see how much easier it is to answer given a test file:-) – David Carlisle Sep 13 '17 at 21:32

1 Answers1

2

you need to add the extra line with the page break after the pages on to which the other floats had floated (or add it within the float) placing it in the first appendix is simplest here

\documentclass[14pt, a4paper]{extreport}
\usepackage[left=3.5cm, right=2.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage[toc,page]{appendix}
\usepackage{caption}
\usepackage{graphicx}
\begin{document}
\renewcommand{\contentsname}{Table of Contents}
\tableofcontents{}
\addcontentsline{toc}{chapter}{Table of Contents}
\newpage
%%------------List of Figures----------------------
\listoffigures{}
\addcontentsline{toc}{chapter}{List of Figures}

\chapter{someCH}
\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{bb}
\end{figure}

\part*{Test}
\markboth{}{}
\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{name}
\end{figure}

\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{bbb}
\end{figure}



\appendix
\chapter{chapt}\label{a.b}
\addtocontents{lof}{\protect\pagebreak}

\begin{figure}[htbp]
   \centering
      \includegraphics[height=8cm]{example-image-b}
\caption{name}
\end{figure}
\end{document}
David Carlisle
  • 757,742