TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To make my book easier to bind I'd like to automatically put the signature number with small type in the footer of the first page of each octavo signature (except the first one which is given since it has the title page).

So that means I want to do this:

    (page number) == ( [some number that is evenly dividable with 16] + 1 )
    write "Book title --- ( ( [page number]-1 ) / 16)"
    with small type in the footer of the page
  • How can this be achieved in Context?
  • How can this be achieved in Plain Tex?

Happy for any pointers or examples. Thanks!

share|improve this question
Actually the number printed should really be "( ( ( [page number]-1 ) / 16)+1 )" to print the correct signature number. The above example and below answers prints the number of the signature before ... But his is easily corrected by adding 1 to the calculated number before printing it. – PetaspeedBeaver Apr 3 '13 at 11:05
up vote 12 down vote accepted

Plain tex version (using e-tex arithmetic could be written in classic tex if needed)

enter image description here

\vsize 4\baselineskip
\hsize 5cm

[original plain footer: \folio]
\ifnum\numexpr ((\pageno-1)/16)*16\relax=\numexpr\pageno-1\relax
[The title 
(page \the\pageno)
signature \the\numexpr ((\pageno-1)/16)+1\relax]

\def\a{Red yellow blue green }
\def\c{One two three four \a\a\a five six seven\par}


share|improve this answer
@PetaspeedBeaver updated – David Carlisle Apr 2 '13 at 11:18

Here is one way to do this in ConTeXt:

% Set footnotes in small size

% Determine footnote content based on lua code

% Get the page number. If page % 16 == 1, typeset content
\startluasetups footer
  local counters = structures.counters

  local page = counters.value("userpage")
  local signature
  if page > 1 and page % 16 == 1 then
     signature = (page - 1)/16
     context("Book title (%s)", signature)

% Example
\dorecurse{60}{\input knuth \page}
share|improve this answer

Your Answer


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.