goathunter@WKUVX1.BITNET ("Hunter Goatley, WKU") (03/16/91)
Regarding headers and footers and rules.... Below are some plain TeX macros that handle setting up headers and footers. They were based on some LaTeX macros I once had (but can no longer find, so I don't know the author). Hope you find them useful..... Hunter Goatley, WKU, goathunter@wkuvx1.bitnet, 502-745-5251 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Header & Footer Macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % These macros implement the headers and footers for the newsletter format. % The macros accept three parameters: text that is to appear flush-left on % the line, text that should be centered, and text that should be flush-right % on the line. Parameters can be omitted by specifying empty braces ({}). % % The following macros are defined for headers and footers: % % \evenpageheader{LEFT}{CENTER}{RIGHT} % \oddpageheader{LEFT}{CENTER}{RIGHT} % \evenpagefooter{LEFT}{CENTER}{RIGHT} % \oddpagefooter{LEFT}{CENTER}{RIGHT} % % If the headers/footers are the same for even & odd pages, the following % macros can be used instead of the four above: % % \pageheader{LEFT}{CENTER}{RIGHT} % \pagefooter{LEFT}{CENTER}{RIGHT} % % Additional header/footer definitions: % % \pageheaderlinetrue - A line should extend below header text % \pageheaderlinefalse - Header does NOT have a line % \pagefooterlinetrue - A line should extend above footer text % \pagefooterlinefalse - Footer does NOT have a line % \headfootrule=Xpt - Thickness of header/footer lines % \pageheaderskip=Xpt - \vskip between header and line % \pagefooterskip=Xpt - \vskip between footer and line % \headfont=\fontname - Font to use for header text % \footfont=\fontname - Font to use for footer text % % Example: % % \pageheader{}{My Newsletter}{} % \pagefooter{October 1989}{}{\pageno} % \catcode`@=11 % Use @ as a letter \newif\ifpageheaderline \pageheaderlinefalse % By default, no header line \newif\ifpagefooterline \pagefooterlinefalse % By default, no footer line \newdimen\headfootrule \headfootrule=0.50pt % Height of header/footer rule \newdimen\pageheaderskip \pageheaderskip=4pt % Space between header and rule \newdimen\pagefooterskip \pagefooterskip=4pt % Space between rule and footer \let\headfont=\twelverm \let\footfont=\twelverm % Assign fonts for head/foot \def\@pageheader#1#2#3{% \ifpageheaderline % If headerline \vbox{\hbox to\normalhsize{{\headfont\rlap{#1}\hss{#2}\hss\llap{#3}}}% \vskip\pageheaderskip\hrule height\headfootrule}% Do hbox and hrule \else {\headfont\rlap{#1}\hss{#2}\hss\llap{#3}} \fi } \def\@pagefooter#1#2#3{% \ifpagefooterline \vbox{\hrule height\headfootrule\vskip\pagefooterskip \hbox to\normalhsize{\footfont\rlap{#1}\hss{#2}\hss\llap{#3}}}% \else {\footfont\rlap{#1}\hss{#2}\hss\llap{#3}} \fi } % % Define default headers and footers - null lines of text % \def\@oddhead{\nullline} \def\@evenhead{\nullline} \def\@oddfoot{\nullline} \def\@evenfoot{\nullline} \def\@newhead{\headline{\ifodd\pageno\@oddhead\else\@evenhead\fi}} \def\@newfoot{\footline{\ifodd\pageno\@oddfoot\else\@evenfoot\fi}} \def\oddpageheader#1#2#3{\@newhead\def\@oddhead{\@pageheader{#1}{#2}{#3}}} \def\evenpageheader#1#2#3{\@newhead\def\@evenhead{\@pageheader{#1}{#2}{#3}}} \def\oddpagefooter#1#2#3{\@newfoot\def\@oddfoot{\@pagefooter{#1}{#2}{#3}}} \def\evenpagefooter#1#2#3{\@newfoot\def\@evenfoot{\@pagefooter{#1}{#2}{#3}}} % % If no difference between even and odd pages, just define both to be the same. % \def\pageheader#1#2#3{\evenpageheader{#1}{#2}{#3}\oddpageheader{#1}{#2}{#3}} \def\pagefooter#1#2#3{\evenpagefooter{#1}{#2}{#3}\oddpagefooter{#1}{#2}{#3}} % % Important - make "@" a valid alphanumeric character again % \catcode`\@=12 % Follow TeX's lead on variable names [End of message]