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

3
  • Maybe this is a good startingpoint tex.stackexchange.com/questions/193062/…
    – Sango
    Commented Sep 13, 2019 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
    Commented Sep 13, 2019 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
    Commented Sep 13, 2019 at 15:35

1 Answer 1

12
+50

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

4
  • 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
    Commented Sep 16, 2019 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 ... Commented Sep 16, 2019 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
    Commented Sep 16, 2019 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. Commented Sep 16, 2019 at 14:05

You must log in to answer this question.

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