2

Is it possible to reprint the last line(s) of a page on a new page? I think this could be helpful for speeches...

\documentclass[paper=a5]{article}       
\usepackage{blindtext}
\begin{document}
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\end{document}  
C.-P.
  • 119

2 Answers2

4

The main drawback with this approach is that it puts the entire speech into a BF buffer. The showframe is just to check alignment.

I played around with fancyhdr and \pagestyule{myheadings) but finally went with \afterpage.

\documentclass[paper=a5]{article}       
\usepackage{blindtext}
\usepackage{afterpage}
\usepackage{showframe}

\newsavebox{\BFbuffer}
\newsavebox{\headbox}

\newenvironment{drone}{\global\setbox\headbox=\hbox{Test}%
  \setbox\BFbuffer=\vbox\bgroup}%
{\egroup\newpage
 \loop\ifdim\ht\BFbuffer>0pt
   \setbox0=\vsplit\BFbuffer to \textheight
   \ifdim\ht\BFbuffer>0pt
     \setbox1=\copy0
     \setbox2=\vsplit1 to \dimexpr \ht1-\baselineskip\relax
     \global\setbox\headbox=\hbox{\usebox1}%
     \afterpage{\rlap{\raisebox{\dimexpr \topskip+\headsep}[0pt]{\usebox\headbox}}\vskip-\baselineskip}%
   \fi
   \unvbox0\pagebreak
 \repeat}

\begin{document}
\begin{drone}
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\end{drone}
\end{document}  
John Kormylo
  • 79,712
  • 3
  • 50
  • 120
2

I think that you might find the fwlw package useful here (> texdoc fwlw) which gives you the first and last words on a page together with the first word on the next page. The author, Donald Arseneau (asnd@triumf.ca) has hinted that he will consider extending fwlw to cater for the first/last lines. You might wish to contact him.

Peter Wilson
  • 28,066