# What does it mean: You can't use \hrule' here except with leaders

I have the following example, which draws a vertical line at the top of the paper:

\def\makeheadline{
\setbox0=\hbox to 0pt{\hskip-1in\hskip15cm \vrule depth 3cm \hss}
\ht0=0pt \dp0=0pt
\vbox to 0pt{\vskip-1in \box0 \vss}
\vbox to 0pt{\vskip-22.5pt
Hello World!
\bye


Now I want to add an additional horizontal line. I tried it this way:

\def\makeheadline{
\setbox0=\hbox to 0pt{\hskip-1in\hskip15cm \vrule depth 3cm \hss}
\ht0=0pt \dp0=0pt
\setbox0=\hbox to 0pt{\hskip-1in \hrule width 15cm \hss}
\ht0=0pt \dp0=0pt
\vbox to 0pt{\vskip-1in \box0 \vss}
\vbox to 0pt{\vskip-22.5pt
Hello World!
\bye


But this throws the error:

! You can't use \hrule' here except with leaders.


Can anybody explain what is wrong with the hrule?

• \vrule height 0.4pt width 15cm – egreg Feb 12 at 9:04

The primitive \hrule is a vertical command; when TeX encounters it, it switches to vertical mode, emitting \par if it is in (unrestricted) horizontal mode.
Because of this, it cannot appear inside \hbox.
To the contrary, \vrule is a horizontal command, so it triggers starting a paragraph if found in vertical mode.
In your case \vrule height 0.4pt width 15cm will do.
• @errekak If you want to realize a horizontal rule with leaders, you need \leaders\hrule\hskip<skip>. – egreg Feb 12 at 22:59