Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
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.” –  J. C. Salomon 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
show 3 more comments

1 Answer 1

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

share|improve this answer
6  
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} –  Gonzalo Medina Oct 4 '12 at 2:02
    
@GonzaloMedina, cheers! –  NVaughan Oct 4 '12 at 2:10
1  
@GonzaloMedina Great find! –  egreg Oct 4 '12 at 6:29
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.