% \begin{macrocode}
\RequirePackage{fancyhdr}
% \end{macrocode}
-% Setup the standard |fancy| format. |\leftmark| is the higher level
-% mark, see |\chaptermark| below. |\rightmark| is the lower level
-% mark, see |\sectionmark| below.
+% Setup the standard |fancy| format.
% \begin{macrocode}
\pagestyle{fancy}
\fancyhf{}
-\fancyhead[LE,RO]{\slshape\rightmark}
-\fancyhead[LO,RE]{\thepage}
+\renewcommand{\headrulewidth}{0pt}
% \end{macrocode}
-% Override the |plain| format (for chapter pages, etc.).
+% 0.4 pt is \pkg{fancyhdr}'s default |\headrulewidth|, so we'll
+% recycle the value.
+% \begin{macrocode}
+\renewcommand{\footrulewidth}{0.4pt}
+% \end{macrocode}
+% |\leftmark| is the higher level mark, see |\chaptermark| below.
+% |\rightmark| is the lower level mark, see |\sectionmark| below.
+% We put the lower level mark to the outside because it changes more
+% often. Page numbers also go on the outside.
+% \begin{macrocode}
+\fancyfoot[RE,LO]{\slshape\leftmark}
+\fancyfoot[LE,RO]{\slshape\rightmark}
+\fancyhead[LE,RO]{\thepage}
+% \end{macrocode}
+% Override the |plain| format (for part pages, etc.).
% \begin{macrocode}
\fancypagestyle{plain}{
\fancyhf{}
- \renewcommand{\headrulewidth}{0pt}
- \fancyfoot[LE,RO]{\thepage}
+ \renewcommand{\footrulewidth}{0pt}
+ \fancyhead[LE,RO]{\thepage}
+}
+% \end{macrocode}
+% Keep the |empty| format at its default.
+% \begin{macrocode}
+\fancypagestyle{empty}{
+ \fancyhf{}
+ \renewcommand{\footrulewidth}{0pt}
}
% \end{macrocode}
%
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\chaptermark}
+% \begin{macro}{\schaptermark}
+% Setup unnumbered chapter marks for \pkg{fancyhdr}.
+% \begin{macrocode}
+\newcommand\schaptermark[1]{\markboth{\MakeUppercase{#1}}{}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sectionmark}
% Setup space rather than period separated section marks.
% (\file{classes.dtx}, L2054)
% \begin{macrocode}
% \end{macro}
%
% \begin{macro}{\@schapter}
-% We don't have to worry about |\@schapter|, since it is very simple.
-% In onecolumn mode it's just
+% This macro is called when we have an unnumbered chapter. We drop
+% \file{classes.dtx}'s \Lopt{twocolumn} code and set marks for
+% \pkg{fancyhdr}.
% (\file{classes.dtx}, L2582).
% \begin{macrocode}
-%\def\@schapter#1{\@makeschapterhead{#1}%
-% \@afterheading}
+\def\@schapter#1{\schaptermark{#1}%
+ \@makeschapterhead{#1}%
+ \@afterheading}
% \end{macrocode}
% \end{macro}
%