2

I tried to print labels with UTF-8 input. I have read, that this requires xetex. So I wrote the following example to write 1€ in the four corners of a 102mm x 152mm label:

\pdfpagewidth=102mm
\pdfpageheight=152mm

\hsize=\pdfpagewidth
\vsize=\pdfpageheight

\advance\hoffset by -1in
\advance\voffset by -1in

\parindent=0pt
\nopagenumbers

\font\cmuss="CMU Sans Serif" at 12pt
\cmuss

1€\hfill 1€
\vfill
1€\hfill 1€

\bye

But the \vfill does not work.

enter image description here

The second row is not at the bottom of the page but in the middle.

What did I wrong?

3

Just insert \eject before \bye. :-)

The explanation for what you saw is simply that \bye is defined this way in plain TeX (TeXbook p. 357):

\outer\def\bye{\par\vfill\supereject\end}

This is where the undesired \vfill comes from.

Side note

There is a special rule used when TeX encounters \end. I'm giving it here for reference, because this was the first thing that came to mind, but it is not involved here (it triggers only when \end is encountered and either stuff from the main vertical list hasn't been processed by an \output routine, or there has been less \shipout calls than invocations of the \output routine—not the case here, because \bye and the default \output routine from plain TeX do the right thing). This rule is given in the TeXbook p. 264:

When TeX sees an \end command, it terminates the job only if the main vertical list has been entirely output and if \deadcycles=0. Otherwise it inserts the equivalent of

\line{} \vfill \penalty-’10000000000

into the main vertical list, and prepares to read the \end token again. This has the effect of invoking the output routine repeatedly until everything has been shipped out. In particular, the last column of two-column format will not be lost.

  • 1
    So finishing with \supereject\end instead of \bye solves the problem, too. – ceving Apr 12 at 12:49
  • Yes, it seems correct as well. – frougon Apr 12 at 12:52
2

Invoking the dangerous filll of "the highest infinity" (see p.72 of the TeXbook)

\pdfpagewidth=102mm
\pdfpageheight=152mm

\hsize=\pdfpagewidth
\vsize=\pdfpageheight

\advance\hoffset by -1in
\advance\voffset by -1in

\parindent=0pt
\nopagenumbers

%\font\cmuss="CMU Sans Serif" at 12pt
%\cmuss

1€\hfill 1€
\vskip 0pt plus 1filll

1€\hfill 1€

\bye
  • 2
    This adds much pressure on the rest of the page. It collapses every other \vfill on the page. – ceving Apr 12 at 12:40
  • @ceving That is why it is so dangerous and that Knuth as a result did not provide the corresponding \vfilll macro in TeX. Too hot to handle! I thought it a curious oddity. – Steven B. Segletes Apr 12 at 12:43

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.