17

The longtable environment can create a note at the bottom of the part of a table that notifies the reader that the rows are “continued on the next page” Is there a way to do that with a list environment?

\documentclass{article}
\begin{document}
\begin{itemize}
(Notification code goes here.)
   \item A
   \item B% Getting close to the bottom of the current page
   \item C
   \item D
\end{itemize}
\end{document}

This should produce something like

• A

• B

(list continued on next page)

(Next page here)

• C

• D

epR8GaYuh
  • 2,432
Tom Price
  • 374
  • Maybe this is a good startingpoint https://tex.stackexchange.com/questions/193062/show-continued-for-nested-description-list-item-on-page-break?rq=1 – Sango Sep 13 '19 at 14:35
  • 2
    Alternatively, you could do a longtable and disguise it as a list.... But maybe there is a good other way. – Sango Sep 13 '19 at 14:44
  • 1
    I am using a description list where the parameters of the items vary considerably in length. Using a table would build unwanted white space between some of the list items and their descriptions. – Tom Price Sep 13 '19 at 15:35

1 Answers1

12

You could try to use the footer. E.g.:

\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum,expl3}
\makeatletter
\pagestyle{fancy}
\ExplSyntaxOn
\rfoot
  {
    \tl_if_in:NnT \@currenvir {itemize}
      {
        \raisebox{1.5\baselineskip}[0pt][0pt]{\footnotesize\itshape\@currenvir\c_space_tl continued~on~next~page}
      }
  }
\ExplSyntaxOff

\begin{document}
\begin{itemize}
   \item A
   \item B% Getting close to the bottom of the current page
   \item C \lipsum
   \item D
\end{itemize}

\lipsum
\end{document}

As lists ends with a \par this should be relatively safe even with asynchronous page breaking.

enter image description here

Ulrike Fischer
  • 327,261
  • TeX processes the \rfoot at the end of the page, while still being inside the itemize environment? So your condition, if the current environment is itemize, only is true, if the environment does not end before the page ends. Not much code, but I'm impressed. Again. – Keks Dose Sep 16 '19 at 13:18
  • 2
    @KeksDose but as I wrote it relies a bit on the fact that there are enough \par commands to trigger the output routine. And I won't accept a bet that it can't fail ... – Ulrike Fischer Sep 16 '19 at 13:26
  • Well, it wouldn't it fail as soon as there is a nested other environment, let's say enumerate inside the itemize? (And the pagebrake occurs within the nested env!) – Keks Dose Sep 16 '19 at 13:39
  • 1
    @KeksDose Yes. But you can extend the test condition and write "enumerate continued on next page", or ensure that the environments store such info so that latex can retrieve it a shipout. In more complicated settings you can use labels to record the state. – Ulrike Fischer Sep 16 '19 at 14:05