[Tex/LaTex] centered hrule (plain tex)

horizontal alignmentplain-texrules

As my nick suggests, I am just starting out with tex. Using plain tex, I am trying to create a document where certain paragraphs are separated by a centered horizontal line. I would like the separating line to be slighty larger than \hsize. I tried the following:

\parindent 0pt
\hsize 5in
{\hsize 6in \hrule}
\bigskip
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
%The "x x x ... x" above is the text of a dummy paragraph.
\bigskip
{\hsize 6in \hrule}
\vfill
\eject
\end

but it didn't work. The hrule width came out the same as the text width.

I would appreciate any advice as to how I can achieve the desired effect.

Best Answer

\hrule draws a rule as wide as the vertical box enclosing it; since we're in the main vertical list and there's a paragraph, the width is the same as the \hsize used for the paragraph, so 5 inches.

You perhaps want \hrule width 6in:

\input plipsum

\parindent 0pt
\hsize 5in

\hrule width 6in
\bigskip
\lipsum{1}
\bigskip
\hrule width 6in

\bye

enter image description here

If you want the rule to stick half an inch at the left, some more work is needed

\input plipsum

\parindent 0pt
\hsize 5in

\moveleft.5in\vbox{\hrule width 6in}
\nointerlineskip
\bigskip
\lipsum{1}
\bigskip
\nointerlineskip
\moveleft.5in\vbox{\hrule width 6in}

\bye

enter image description here

Related Question