47

I would like to typeset catchwords. That is, I would like to put a “preview” of the next page’s first word at the bottom of every page.

An example taken from the Wikipedia page linked above:
catchword

The next page begins with the word (actually word fragment in this particular case) “dos”, and so that word is typeset flush right just below the text-block.

(How) can this be done with TeX?

8
  • try with "\looseness=-1" after the last word ?
    – madit
    Oct 3 '12 at 18:26
  • 6
    Are you asking about en.wikipedia.org/wiki/Catchword? “A catchword is a word placed at the foot of a handwritten or printed page that … anticipates the first word of the following page.” Oct 3 '12 at 18:43
  • @J.C.Salomon Yes, exactly!
    – Erasm
    Oct 3 '12 at 18:46
  • 1
    @Erasm I don't think this is possible in (La)TeX, but maybe some LuaTeX trickery can help.
    – egreg
    Oct 3 '12 at 19:28
  • 4
    This is surely possible in LuaTeX: use the post_linebreak_filter to analyze the paragraphs and then atbegshi to find the last line on the page and add the information you've got from step one. Easy ;-))
    – topskip
    Oct 3 '12 at 19:45
48

You can use the fwlw ("First Word, Last Word") package; a little example using a footer defined with the fancyhdr package:

\documentclass{article}
\usepackage[latin]{babel}
\usepackage[a6paper,footskip=0pt]{geometry}
\usepackage{fwlw}
\usepackage{fancyhdr}
\usepackage[veryoldstyle]{kpfonts}
\usepackage{lipsum}
\fancyhf{}
\fancyfoot[R]{\usebox\NextWordBox}
\renewcommand\headrulewidth{0pt}
\pagestyle{fancy}

\begin{document}

\lipsum[4-60]

\end{document}

An image of the first four pages:

enter image description here

The package gives access to the first word on the current page (\FirstWordBox), the first word on the next page (\NextWordBox), and the last word on the current page (\LastWordBox).

The package also offers a predefined page style NextWordFoot to read ahead to the first word on the next page:

\documentclass{article}
\usepackage[latin]{babel}
\usepackage[a6paper,footskip=0pt]{geometry}
\usepackage{fwlw}
\usepackage[veryoldstyle]{kpfonts}
\usepackage{lipsum}

\pagestyle{NextWordFoot}

\begin{document}

\lipsum[4-60]

\end{document}

enter image description here

8
  • 8
    Who could imagine there's a package for this? :)
    – henrique
    Oct 4 '12 at 1:25
  • Is there another way of doing it without wasting the footer?
    – NVaughan
    Oct 4 '12 at 1:49
  • 5
    @NVaughan sure; in many ways. You can use, for example, the background package: \documentclass{article} \usepackage[latin]{babel} \usepackage[a6paper,footskip=0pt]{geometry} \usepackage{fwlw} \usepackage{fancyhdr} \usepackage[veryoldstyle]{kpfonts} \usepackage{lipsum} \usepackage[bottom]{background} \backgroundsetup{ scale=1, color=black, opacity=1, vshift=64pt, contents={\makebox[\textwidth][r]{\usebox\NextWordBox}}, } \begin{document} \lipsum[4-60] \end{document} Oct 4 '12 at 2:02
  • @GonzaloMedina, cheers!
    – NVaughan
    Oct 4 '12 at 2:10
  • 2
    @GonzaloMedina Great find!
    – egreg
    Oct 4 '12 at 6:29

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.