% \changes{v1.1}{28 Jan 96}{First release} % \CheckSum{135} % % \iffalse meta-comment % % File: handout.dtx % Options: % Written by Nick Urbanik, 28 Jan 96 % An example of its use: % %\documentclass{handout} % % To use this template: % search for the following: % FILENAME, ACTION, EXAMPLE, 28 Jan 96, 28 January 96, 1996/01/28, % PURPOSE, FIRSTOPTION, BASE, DEFAULTOPTIONS, % $Header$ % % $Log$ % % \fi % % \begin{abstract} % % \end{abstract} % % \tableofcontents % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \section{How to use this class} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % The best way to see how to use this is by example. See the file % EXAMPLE.tex for a complete example. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Options available} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % %\StopEventually{} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \section{The implementation} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Producing the documentation} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Here is a short driver program that can be extracted with the \LaTeXe % \textsf{docstrip} program. It is not necessary to create a separate % driver file from this, however; you can just run \emph{this} % file, \file{handout.dtx} through \LaTeXe. % % \begin{macrocode} %<*driver> \ProvidesFile{handout.drv} \documentclass[a4paper,twoside]{ltxdoc} \usepackage{a4,fancyheadings} % \end{macrocode} % I have had problems with getting the correct |\filedate| and |\fileversion| % from this file. I keep getting them from the file \file{a4.sty}. % I believe the next line is supposed to fix such a problem, but it % leaves them undefined. % \begin{macrocode} % \GetFileInfo{handout.dtx} % \end{macrocode} % This is definitely the wrong place to put |\fileversion|, % |\fileversion| and |\docdate|, since it is hard % to find them here, but at the moment it's the only place where I can get % them to work! % \begin{macrocode} \def\fileversion{2.0f} \def\filedate{28 January 96} \def\docdate{28 January 96} % \end{macrocode} % These depend on the package |fancyheadings|. If you don't have it, you % may want to comment out these lines. You may prefer to comment out the % line |\thispagestyle{empty}| further down. % \begin{macrocode} \pagestyle{fancy} \lhead[\textbf{\upshape The file \texttt{handout.dtx}, a class to make simple handouts with \LaTeXe}]{\textbf{\thepage}} \rhead[\textbf{\thepage}]{\textbf{\upshape The file \texttt{handout.dtx}, a class to make simple handouts with \LaTeXe}} \cfoot{} % \end{macrocode} % \begin{macrocode} \EnableCrossrefs % Make a full index. %\DisableCrossrefs % Make no index. \CodelineIndex % Index by line numbers rather than by page. %\PageIndex % index commands using page numbers. \DoNotIndex{\textbf,\texttt,bfseries,\renewcommand,\providescommand} \DoNotIndex{\filedate,\filename,\fileversion} \DoNotIndex{\DoNotIndex,\arabic} \DoNotIndex{\NeedsTeXFormat} \RecordChanges % Show change history. %\OnlyDescription % uncomment this to not format the code. \title{The file \texttt{handout.dtx}, a class to make simple handouts with \LaTeXe.\thanks{This file has version number \fileversion, dated \filedate.}\\[2pt] It contains the code for \texttt{handout.cls}} \author{Nick Urbanik} \date{\filedate} \begin{document} \thispagestyle{empty} \maketitle \providecommand{\Lenv}[1]{\textsf{#1}} \providecommand{\pkg}[1]{\texttt{#1}} \providecommand{\file}[1]{\texttt{#1}} \DocInput{handout.dtx} \PrintIndex \PrintChanges % \end{macrocode} % Now tell the people what they need to do next to get the index and % change list: % \begin{macrocode} \typeout{Next, to make the index and changes list for this documentation:} \typeout{2. makeindx -s gind.ist handout} \typeout{3. makeindx -s gglo.ist -o handout.gls handout.glo} \typeout{Finally, run this file through LaTeX once more.} % \end{macrocode} % % \begin{macrocode} \end{document} % % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Identification part} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \begin{macrocode} %<*class> \NeedsTeXFormat{LaTeX2e} \ProvidesClass{handout}% [1996/01/28 A class to make simple handouts] % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Declaration of options} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % There are no options for this class yet. % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% \subsubsection{The \texttt{FIRSTOPTION} option} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsubsection{Pass all other options unchanged to \texttt{article.cls}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \begin{macrocode} \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Execution of options} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % SHOULD WE USE |\ExecuteOption{..}| instrad or as well as this? % If see |classes.dtx|. |\ExecuteOptions| provides defaults that can % be overridden. % % \begin{macrocode} \ProcessOptions % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Special class file commands} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Do we pass the default options here? Or in |\PassOptionsToClass|? % \begin{macrocode} \LoadClass[a5paper,twoside]{article} % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \subsection{Package loading} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \begin{macrocode} \RequirePackage{% vmargin,% fancyheadings,% %array,% nick,% varioref,% %ifthen,% %verbatim,% rcs,% %slidesec,% %fancybox,% %version,% %alltt% } % \end{macrocode} % \begin{macrocode} %\PassOptionsToClass{twoside}{article} % \end{macrocode} % Now here I've changed the page setup to be similar to that for my % assembly language primer, except that the left and right margins are % exchanged, since here the odd-numbered pages are on the left, while % in a book, the odd-numebred pages are on the right. % % This is what the documentation for the \pkg{vmargin} package has to say: % \begin{quote} % Two sided printing is supported, meaning that if on odd pages the left % margin is, say, 30\,mm and the right margin is 20\,mm, it will be vice % versa on even pages. This gives equal margins on the outer and the % inner edge of the paper, as expected e.g. for a book. % \end{quote} % Here we are making an A5 handout, obtainded by folding A4 paper in half: % \begin{macrocode} \setpapersize{A5}% \setmarginsrb{20mm}% left For a book, the inner. For oddleft, outer. {9mm}% top {10mm}% right For a book, the outer. For odd left, inner. {10.5mm}% bottom {12pt}% headheight---increase to stop fancyhead warn {4mm}% headsep {0pt}% footheight {8mm}% footskip % \end{macrocode} % Later note: it seems that the 8mm footskip is not a problem with the new % footers; still, will check after examining the output. % \begin{verbatim} % {13mm}% footskip % \end{verbatim} % \begin{macro}{\headwidth} % \begin{macrocode} \renewcommand{\headwidth}{\textwidth}% % \end{macrocode} % \end{macro} % % All changes to |\textwidth| to happen before here (I can't remember % whether this commandment comes from the documentation for % \pkg{fancyheadings} or elsewhere). % % News flash! It seems that it is critical to put this before % redefining the |\sectionmark| and |\subsectionmark|, otherwise the % new definitions are ignored! % \begin{macrocode} \pagestyle{fancyplain} % \end{macrocode} % Hey: this seems to work! A simple adaptation from my assembly % language primer page setup. Note that it is \emph{essential} to put % the |\pagestyle| first, otherwise these are ignored! % \begin{macrocode} \renewcommand*{\sectionmark}[1]% {\markboth{\thesection\ \ #1}{\thesection\ \ #1}} \renewcommand*{\subsectionmark}[1]{\markright{\thesubsection\ \ #1}} % \end{macrocode} % % This is the format of the |\lhead| and |\rhead| commands, % for reference. % \begin{verbatim} % \lhead[\fancyplain{plain LH-even}{normal LH-even}] % {\fancyplain{plain LH-odd }{normal LH-odd}} % \rhead[\fancyplain{plain RH-even}{normal RH-even}]% % {\fancyplain{plain RH-odd }{normal RH-odd}} % \end{verbatim} % We want the subsection number on the right hand page: that's an even % number in this arrangement. % \begin{macrocode} \lhead[% \fancyplain{}% {% \bfseries\rightmark% }% ]% {% \fancyplain{}% {% \rmfamily\bfseries \thepage% }% } % \end{macrocode} % \begin{macrocode} \rhead[% \fancyplain{}% {% \rmfamily\bfseries \thepage% }% ]% {% \fancyplain{}% {% \bfseries\leftmark% }% }% % \end{macrocode} % We want the subsection number on the right hand page: that's an even % number in this arrangement. % \begin{macrocode} \lfoot[% \fancyplain{}% {% \tiny\revision% }% ]% {% \fancyplain{\tiny\revision}% {% }% } % \end{macrocode} % We want the section number on the left hand page: that's an % odd-numbered page in this arrangement. % \begin{macrocode} \rfoot[% \fancyplain{}% {% }% ]% {% \fancyplain{}% {% \tiny\revision% }% } % \end{macrocode} % \begin{macrocode} \cfoot{} % \end{macrocode} % \begin{macrocode} \typeout{^^JMaking an A5 10pt handout, two pages per A4 sheet^^J} % % \end{macrocode} % \begin{macrocode} \endinput % \end{macrocode} % %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z %% Digits \0\1\2\3\4\5\6\7\8\9 %% Exclamation \! Double quote \" Hash (number) \# %% Dollar \$ Percent \% Ampersand \& %% Acute accent \' Left paren \( Right paren \) %% Asterisk \* Plus \+ Comma \, %% Minus \- Point \. Solidus \/ %% Colon \: Semicolon \; Less than \< %% Equals \= Greater than \> Question mark \? %% Commercial at \@ Left bracket \[ Backslash \\ %% Right bracket \] Circumflex \^ Underscore \_ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} %% % \Finale