9

This is exercise 23.3:

Explain how to change the output routine of plain TeX so that it will produce twice as many pages. The material that would ordinarily go on pages 1, 2, 3, etc., should go onto pages 1, 3, 5, ...; and the even-numbered pages should be entirely blank except for the headline and footline. ...

In plain.tex \output is {\plainoutput}, with \plainoutput being:

\def\plainoutput{\shipout\vbox{\makeheadline\pagebody\makefootline}%
  \advancepageno
  \ifnum\outputpenalty>-20000 \else\dosupereject\fi}

In answer to exercise 23.3 \output is {\plainoutput\blankpageoutput}, with \blankpageoutput being:

\def\blankpageoutput{\shipout\vbox{\makeheadline
  \vbox to\vsize{}\makefootline}\advancepageno}

In contrast to \output from plain.tex, this output routine does not end with \ifnum\outputpenalty>-20000 \else\dosupereject\fi.

What is this last "if" for and should \blankpageoutput also have this "if"?

  • 5
    The last \ifnum check whether the penalty for inserts on the current page is larger than -20000, i.e. if there are too many inserts held back, and does a supereject, i.e. places all inserts on a suceeding page if this is the case. \blankpageoutput cannot produce any inserts (as the page is completely blank) and can therefore not contribute to the penalty. – Henri Menke Aug 30 '15 at 8:29
  • 1
    In other words, \blankpageoutput doesn't need this "if" because \plainoutput is taking care of it (and it won't create new work to be done). But if you write your own output routine, it's something you'll have to think about—if you want to use inserts. – Daniel Lyons Sep 1 '15 at 5:53
  • Do you guys mind to turn your comments into an answer, to put this item out of the unanswered list? – erreka Oct 31 '15 at 21:38
3

This is the combined answer from the comments below the question:

The last \ifnum checks whether the penalty for inserts on the current page is larger than -20000, i.e., if there are too many inserts held back, and does a supereject, i.e., places all inserts on a suceeding page if this is the case. \blankpageoutput cannot produce any inserts (as the page is completely blank) and can therefore not contribute to the penalty.

In other words, \blankpageoutput doesn't need this \ifnum because \plainoutput is taking care of it (and it won't create new work to be done). But if you write your own output routine, it's something you'll have to think about — if you want to use inserts.

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.