\box
also clears the box register. Use \copy
instead.
\line{\hss \copy0 \hss \copy0 \hss}
I would use \hfill
instead of \hss
. Then TeX will throw an overfull \hbox
warning, if the place is not sufficient.
A centered version can be achieved via \halign
:
\setbox0\vbox{\halign{\hfil#\hfil\cr M\cr a\cr t\cr t\cr e\cr o\cr}}
\line{\hfill \copy0 \hfill \copy0 \hfill}
\bye
Smaller space between letters
The following example uses different methods to reduce the space between the letters. The first boxes 0, 2, 4 (even numbered boxes smaller than ten are scratch boxes for local assignments) keep the distance between the baselines constant. Box 0 is the unmodified version. Box 2 shrinks the \baselineskip
according to egreg's comment. The extreme is in box 4,
where the maximum letter height is measured with the result that the two "t"s are in touch.
The boxes 6 and 8 keep the distance between the letters constant. Because of \baselineskip=0pt
, TeX switches to set \lineskip
instead. It's default value is 1pt
. Box 8 finally does not leave any space between the letters.
\def\test{\halign{\hfil##\hfil\cr M\cr a\cr t\cr t\cr e\cr o\cr}}
\setbox0\vbox{\test}
\setbox2\vbox{%
\advance\baselineskip-2pt\relax
\test
}
\setbox4\hbox{atteo}
\setbox4\vbox{%
\baselineskip=\ht4
\lineskiplimit=0pt
\test
}
\setbox6\vbox{%
\baselineskip=0pt
\test
}
\setbox8\vbox{%
\baselineskip=0pt
\lineskip=0pt
\test
}
\line{\hfill\copy0 \hfill\copy2 \hfill\copy4 \hfill\copy6 \hfill\copy8 \hfill}
\bye