[comp.text] Help with \headline macro in TeX

cotner@brahms.berkeley.edu (Carl Cotner) (11/10/88)

Recently, I posted the following message:
------------------------------------------------------------
>
> I'm working on a document in TeX, and I've run into a problem which
> I hope some of you out there can help me with.  It's a problem
> dealing with the \headline macro in TeX. For even-numbered pages, I
> would like to have a \headline which includes
> 		[Section Number of document]\hfil[title of section]
> and right below that, I would also like to draw a \hrule across
> the top and then leave a little vertical space.
> 
> An example would be soem thing like this:
> 
> 		Section 2.3				Rites of Passage
>    --> 	--------------------------------------------------------
>   |		^
> a \hrule	|a little vertical space to separate header from
> 		|document (that is, a little more than what TeX 
> 		v 	    usually provides)
> 
> Does anyone have a solution as to what to put in the \headline
> to format it this way?
> 
------------------------------------------------------------

A couple of people have answered my note, and tried to help me out.
I realized that I did not explain myself very clearly before, and 
clouded my query with inconsequential details.

The problem I'm having is not with setting up section titles
macros, or testing for page even or page odd, but with the drawing
of the hrule in the \headline macro.

I.e. I've tried various combinations of

	\evenheadline={\vbox{
			\hbox{\sectionnumber\hfil\sectiontitle}
			\hrule
			}
		      }
(I already have my own \section macros and I do test for even or odd page
page elsewhere; something like \headline={\ifodd\odddheadline\else 
\evenheadline\fi}), 

but I get an overfull \hbox{} above.
Another attempt,
	\evenheadline={\vbox{
			\hbox{\sectionnumber\hfil\sectiontitle}
			\hbox to\hsize{\hrule}
			}
		      }
resulted in a TeX error.

Help anyone?

carl
cotner@brahms.berkeley.edu

P.S.  Some people have suggested that I use LaTeX (I guess for the 
\section macros---which I already have).  I played around with LaTeX, 
but prefer TeX primarily because the math mode feels more natural
in TeX than LaTeX (stuff like breaking alignment in TeX's \equalign 
with a \noalign is not obvious to me in LaTeX's \eqnarray environment). 
Anyway, anyone tell me how to set up the \headline in LaTeX, as well?

ucbvax!brahms!cotner	           Carl Cotner/UCB Math Dept/Berkeley CA 94720