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.

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:

If
    (page number) == ( [some number that is evenly dividable with 16] + 1 )
then
    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

2 Answers 2

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
\pdfpageheight\dimexpr6\baselineskip+2in\relax
\pdfpagewidth\dimexpr\hsize+2in\relax

\footline={
\hss\tenrm
[original plain footer: \folio]
\ifnum\numexpr ((\pageno-1)/16)*16\relax=\numexpr\pageno-1\relax
{\fiverm
[The title 
(page \the\pageno)
signature \the\numexpr ((\pageno-1)/16)+1\relax]
}\fi
\hss
}

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


\d\d

\bye 
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
\setupfooter[style=small]

% Determine footnote content based on lua code
\setupfootertexts[\luasetup{footer}]

% 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)
  end
\stopluasetups

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

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.