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!

  • 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. Apr 3, 2013 at 11:05

2 Answers 2


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}



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}

You must log in to answer this question.

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