| 1 |
% \iffalse |
| 2 |
%% File: underlin.dtx Copyright (C) 1987-1997 Rainer Sch"opf |
| 3 |
% |
| 4 |
% It may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either version 1.3c |
| 6 |
% of this license or (at your option) any later version. |
| 7 |
% The latest version of this license is in |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 10 |
% version 2005/12/01 or later. |
| 11 |
% |
| 12 |
%<package>\NeedsTeXFormat{LaTeX2e} |
| 13 |
%<package>\ProvidesPackage{underlin} |
| 14 |
%<package> [1997/02/16 v1.01 underlined running head (RmS)] |
| 15 |
% |
| 16 |
%<*driver> |
| 17 |
\documentclass{ltxdoc} |
| 18 |
\usepackage{underlin} |
| 19 |
\pagestyle{underline} |
| 20 |
\GetFileInfo{underlin.sty} |
| 21 |
\begin{document} |
| 22 |
\title{Two {\sf pagestyles} for underlining headers\thanks{This file |
| 23 |
has version number \fileversion, last revised \filedate.}} |
| 24 |
\author{Rainer Sch\"opf} |
| 25 |
\date{\filedate} |
| 26 |
\maketitle |
| 27 |
\DocInput{underlin.dtx} |
| 28 |
\end{document} |
| 29 |
%</driver> |
| 30 |
% \fi |
| 31 |
% |
| 32 |
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 33 |
% |
| 34 |
% \CheckSum{47} |
| 35 |
% |
| 36 |
% \changes{1.01}{1997/02/16}{Version 1.0a converted to \LaTeXe |
| 37 |
% documentation format.} |
| 38 |
% |
| 39 |
% \begin{abstract} |
| 40 |
% This package implements two new {\sf pagestyles} |
| 41 |
% {\tt underline} and {\tt myunderline} that are similar |
| 42 |
% to the standard {\tt headings} and {\tt myheadings} |
| 43 |
% {\sf pagestyles} but provide a horizontal line just below |
| 44 |
% the head line. |
| 45 |
% \end{abstract} |
| 46 |
% |
| 47 |
% The purpose of this package file is to provide a way to |
| 48 |
% underline a running head. |
| 49 |
% This is done by redefining the \verb+\@evenhead+ and \verb+\@oddhead+ |
| 50 |
% macros. |
| 51 |
% To understand this you must know that whenever a given pagestyle |
| 52 |
% (say `xxx') is selected by a \verb+\pagestyle{xxx}+ command the |
| 53 |
% macro \verb+\ps@xxx+ is executed. |
| 54 |
% Therefore we define a macro \verb+\ps@underline+ which is called |
| 55 |
% when you say \verb+\pagestyle{underline}+. |
| 56 |
% To provide for a rule with user-defined headings we also define |
| 57 |
% the pagestyle `myunderline' , i.e.\ the macro \verb+\ps@myunderline+. |
| 58 |
% |
| 59 |
% \StopEventually{} |
| 60 |
% |
| 61 |
% \section{Implementation} |
| 62 |
% |
| 63 |
% \begin{macrocode} |
| 64 |
%<*package> |
| 65 |
% \end{macrocode} |
| 66 |
% |
| 67 |
% \begin{macro}{\ps@underline} |
| 68 |
% The first thing the macro \verb+\ps@underline+ |
| 69 |
% does is to call |
| 70 |
% \verb+\ps@headings+ to set up everything like the `headings' |
| 71 |
% pagestyle does. |
| 72 |
% Here we do not need to distinguish onesided and twosided |
| 73 |
% printing since this is already done correctly by |
| 74 |
% \verb+\ps@headings+. |
| 75 |
% \begin{macrocode} |
| 76 |
\def\ps@underline{\ps@headings |
| 77 |
% \end{macrocode} |
| 78 |
% Then we redefine \verb+\@evenhead+. The first part is a copy of |
| 79 |
% the definition in \verb+\ps@headings+. |
| 80 |
% This has the advantage that this style option works with |
| 81 |
% document styles `article', `report', and `book'. |
| 82 |
% \begin{macrocode} |
| 83 |
\def\@evenhead{\thepage\hfil\slshape\leftmark\null |
| 84 |
% \end{macrocode} |
| 85 |
% \verb|\null| is defined to be \verb|\hbox{}| in the \LaTeX{} |
| 86 |
% kernel file \texttt{ltplain.dtx}. |
| 87 |
% Additionally we include a \verb+\vadjust+ primitive. The effect of |
| 88 |
% this primitive is to add its argument after the current |
| 89 |
% \verb+\hbox+ to the enclosing vertical list. |
| 90 |
% \begin{macrocode} |
| 91 |
\vadjust{\vskip .3ex\hrule}}% |
| 92 |
% \end{macrocode} |
| 93 |
% The \verb+\@oddhead+ macro is constructed |
| 94 |
% analogously. |
| 95 |
% \begin{macrocode} |
| 96 |
\def\@oddhead{\null{\slshape \rightmark}\hfil\thepage |
| 97 |
\vadjust{\vskip .3ex\hrule}}} |
| 98 |
% \end{macrocode} |
| 99 |
% \end{macro} |
| 100 |
% |
| 101 |
% \begin{macro}{\ps@myunderline} |
| 102 |
% The macro \verb+\ps@myunderline+ for underlining user defined |
| 103 |
% running heads is constructed analogously. |
| 104 |
% \begin{macrocode} |
| 105 |
\def\ps@myunderline{\ps@myheadings |
| 106 |
\def\@oddhead{\null{\slshape\rightmark}\hfil |
| 107 |
\rm\thepage\vadjust{\vskip .3ex\hrule}}% |
| 108 |
\def\@evenhead{\thepage\hfil\slshape \leftmark \null |
| 109 |
\vadjust{\vskip .3ex\hrule}}} |
| 110 |
% \end{macrocode} |
| 111 |
% \end{macro} |
| 112 |
% |
| 113 |
% |
| 114 |
% Well, that's all. Use it and enjoy. |
| 115 |
% |
| 116 |
% \Finale |
| 117 |
% |
| 118 |
\endinput |