% \iffalse meta-comment % % memoir.dtx % Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net % Copyright 2001--2008 Peter R. Wilson % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either % version 1.3 of this license or (at your option) any % later version. % The latest version of the license is in % http://www.latex-project.org/lppl.txt % and version 1.3 or later is part of all distributions of % LaTeX version 2003/06/01 or later. % % This work has the LPPL maintenance status "author-maintained". % % This work consists of the files listed in the README file. % % \fi % \CheckSum{27470} % % \changes{v0.1}{2001/05/20}{First public alpha release} % \changes{v0.2}{2001/06/03}{First beta release} % \changes{v0.3}{2001/07/09}{Bug fixing} % \changes{v0.31}{2001/07/09}{Bug fixing} % \changes{v0.32}{2001/08/03}{Fix for old versions of amsmath package} % \changes{v0.33}{2001/08/03}{Added controllable chapter/LoF spacing} % \changes{v0.33}{2001/08/03}{Fixed bug in \cs{appendixpage}} % \changes{v1.0}{2001/10/30}{First production release} % \changes{v1.0a}{2001/12/07}{Feature fixes} ^^A never released % \changes{v1.1}{2002/03/10}{More fixups} % \changes{v1.1}{2002/03/10}{Replaced all the subfigure code} % \changes{v1.1}{2002/03/28}{Added sidebars} % \changes{v1.1}{2002/03/28}{Upgraded verse typesetting} % \changes{v1.2}{2002/07/07}{Added 17pt option} % \changes{v1.2}{2002/07/07}{Added extra \cs{provide} commands} % \changes{v1.2}{2002/07/27}{Major verbatim, box and file additions} % \changes{v1.2}{2002/07/27}{Removed extraneous space from change marks} % \changes{v1.2}{2002/07/27}{Extra optarg in \cs{chapter} and \cs{chapter*}} % \changes{v1.2}{2002/07/27}{Twiddled font sizes a little} % \changes{v1.2}{2002/08/27}{Fixed 12pt bug} % \changes{v1.3}{2002/09/27}{Minor tweaks wrt v1.2} % \changes{v1.3}{2002/10/10}{Extra trimming styles} % \changes{v1.3}{2002/10/10}{Major extensions for indexing} % \changes{v1.3}{2002/11/14}{Automatically call a patch file} % \changes{v1.3a}{2002/11/22}{Fixed nasty figure/table bug} % \changes{v1.4}{2003/02/27}{Added patches v1.1} % \changes{v1.4}{2003/02/27}{Added patches v1.3} % \changes{v1.4}{2003/11/16}{Including current patches} % \changes{v1.4}{2003/11/16}{Added patches v1.2} % \changes{v1.4}{2003/11/22}{Added patches v1.4} % \changes{v1.4}{2003/11/22}{Added patches v1.5} % \changes{v1.4}{2003/11/22}{Added patches v1.6} % \changes{v1.4}{2003/11/22}{Added patches v1.7} % \changes{v1.4}{2003/11/30}{Added patches v1.8} % \changes{v1.4}{2003/11/30}{Added patches v1.9} % \changes{v1.6}{2004/01/31}{Decided to issue v1.4 as v1.6 on the way to % the golden section 1.6180339887...} % \changes{v1.61}{2004/03/14}{Changes to clo files, and footnotes} % \changes{v1.61}{2004/03/21}{Removed a potential problem with the % hangul package} % \changes{v1.618}{2005/09/02}{Folded in all v1.61 patches} % \changes{v1.618}{2005/09/15}{Some minor extensions} % \changes{v1.618}{2005/09/25}{Support for glossaries} % \changes{v1.6180}{2006/06/12}{Footnote font fix} % \changes{v1.61803}{2008/05/26}{Folded in all mempatch v4.9a patches} % \changes{v1.618033}{2008/06/02}{Fixed(?) page layout algorithms} % \changes{v1.6180339}{2008/07/23}{Unemulated if... packages} % \changes{v1.6180339}{2008/07/23}{Folded in all mempatch v5.1 patches} % % \def\dtxfile{memoir.dtx} % % \def\fileversion{v0.1} \def\filedate{2001/05/20} % \def\fileversion{v0.2} \def\filedate{2001/06/03} % \def\fileversion{v0.3} \def\filedate{2001/07/14} % \def\fileversion{v0.31} \def\filedate{2001/07/24} % \def\fileversion{v0.32} \def\filedate{2001/08/03} % \def\fileversion{v0.33} \def\filedate{2001/08/31} % \def\fileversion{v1.0} \def\filedate{2001/11/17} % \def\fileversion{v1.0a} \def\filedate{2001/12/07} % \def\fileversion{v1.1} \def\filedate{2002/03/28} % \def\fileversion{v1.1a} \def\filedate{2002/04/28} % \def\fileversion{v1.2} \def\filedate{2002/08/10} % \def\fileversion{v1.2} \def\filedate{2002/08/27} % \def\fileversion{v1.3} \def\filedate{2002/11/14} % \def\fileversion{v1.3a} \def\filedate{2002/11/22} % \def\fileversion{v1.4} \def\filedate{2003/12/18} % \def\fileversion{v1.6} \def\filedate{2004/01/31} % \def\fileversion{v1.61} \def\filedate{2004/04/04} % \def\fileversion{v1.618} \def\filedate{2005/09/27} % \def\fileversion{v1.6180} \def\filedate{2006/06/12} % \def\fileversion{v1.61803} \def\filedate{2008/05/26} % \def\fileversion{v1.618033} \def\filedate{2008/06/02} % \def\fileversion{v1.6180339} \def\filedate{2008/07/23} % \title{The LaTeX \Lpack{memoir} class for configurable book % typesetting: Source code\thanks{This % file (\texttt{\dtxfile}) has version number \fileversion, last revised % \filedate.}} % % \author{% % Peter Wilson\thanks{\texttt{herries dot press at earthlink dot net}}\\ % Herries Press} % \date{\filedate} % \maketitle % % \begin{abstract} % The \Lpack{memoir} class is designed for typesetting % general books such as novels, biographies, histories, % and so on, although as it supports all the functionality of the % standard \Lpack{book} class it can also be used for technical writing. % It provides more functions than the standard class as well as % presenting a more friendly interface for the book designer. % It can also simulate the typesetting style of the standard \Lpack{article} % class. % % The class was first released in mid 2001 and has been well used ever % since. % \end{abstract} % % \tableofcontents % \listoftables % % \StopEventually{} % % % % \section{Introduction} % % This document provides the commented source % for the LaTeX \Lpack{memoir} class, which is designed for typesetting % general books such as novels, biographies, histories, % and so on. It has all the functionality of the standard \Lpack{book} % class and, as well as providing some extra functions, also provides % a more friendly interface for the document designer. As it can encompass % everything that the \Lpack{book} class provides it may also be used % for technical writing. % % The default appearance of a document typeset with this class is % the same as if it had been typeset with the \Lpack{book} class and % it can be made to simulate the \Lpack{article} class.. % The class, though, includes extra facilities that make it easy to % change the appearance of such things as the page headers and footers, % the style of chapter and other sectional headings, and the style of % captions. It also makes it easy to both change the style of the % Table of Contents, List of Figures, etc., as well as creating new % kinds of `List of\ldots'. New types of floats, if needed, can be % created very simply. Epigraphs can be put into the document in a % variety of styles. % % The class provides a variety of page, chapter and captioning % styles that you can choose from if you don't want to create your own. % % Documents can be typeset in 9pt, 10pt, 11pt, 12pt, 14pt or 17pt font % sizes, and if you have scaleable fonts available they can be set at any size. % There is a reasonably intuitive means of setting the margins % and placement of the text on a page. There is an option to put % trim marks on the printed pages if the stock sheets need to be trimmed % down to the final page size. For those whose publishers like a % manuscript to look as though it was typewritten, there is an option % to do this (double spacing, ragged right, no hyphenation, % fixed width font). There is also an unsophisticated means of flagging any % revisions to the text. % % As this is a new class, by default it does not support the old % LaTeX v2.09 % font commands, namely the \cs{bf}, \cs{sl}, \cs{it} and \cs{sc} commands; % it warns about using the \cs{em} command but does support it. % % % I hope that apart from the font commands the class % is compatible with % `standard' LaTeX. % % Development of this class would never have been started without % the wonderful work done by Leslie Lamport and others~\cite{CLASSES} % from whom I have learned a great deal and borrowed much code. % % Sections~\ref{sec:docstrip} through~\ref{sec:ic} describe some % administrative elements and code for general use later in the % specification. % The macros forming the class file are defined in sections~\ref{sec:opt} % through~\ref{sec:init}. % % This manual is typeset according to the conventions of the % \LaTeX{} \textsc{docstrip} utility which enables the automatic % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}. % % % \section{A driver for this document} \label{sec:docstrip} % % The next series of code contains the documentation driver file for % \LaTeX, i.e., the file that will produce the documentation you are % currently reading. This will be extracted from this file by the % \textsc{docstrip} program. % % \begin{macrocode} %<*driver> \documentclass[twoside]{ltxdoc} \usepackage[T1]{fontenc} \usepackage{url} %%\usepackage[draft=false, %% plainpages=false, %% pdfpagelabels, %% bookmarksnumbered, %% hyperindex=true %% ]{hyperref} % Doesn't work with indexing of \DescribeMacro \providecommand{\phantomsection}{} % just in case hyperref not used % \end{macrocode} % % We do want an index, using linenumbers, but not update information. % \begin{macrocode} \EnableCrossrefs \CodelineIndex %% \RecordChanges % \end{macrocode} % We had better have page headings to aid navigation, but I don't % like Uppercased titles. % \begin{macrocode} \makeatletter \@mparswitchfalse \makeatother \renewcommand{\MakeUppercase}[1]{#1} \pagestyle{headings} % \end{macrocode} % We may use so many \file{docstrip} modules that we set the % \texttt{StandardModuleDepth} counter to 1. % \begin{macrocode} \setcounter{StandardModuleDepth}{1} % \end{macrocode} % Some commonly used abbreviations % \begin{macrocode} \newcommand*{\Lopt}[1]{\textsf {#1}} % typeset an option \newcommand*{\file}[1]{\texttt {#1}} % typeset a file \newcommand*{\Lcount}[1]{\textsl {\small#1}} % typeset a counter \newcommand*{\pstyle}[1]{\textsl {#1}} % typeset a pagestyle \newcommand*{\Lenv}[1]{\texttt {#1}} % typeset an environment \newcommand*{\Lpack}[1]{\textsf {#1}} % typeset a package \newcommand*{\ctt}{\textsc{ctt}} % comp.text.tex \newenvironment{PW}{\em}{} \newcommand*{\theTeXbook}{\textit{The \TeX book}} % \end{macrocode} % We want the full details printed. % \begin{macrocode} \begin{document} \DeleteShortVerb{\|} \raggedbottom \raggedright \DocInput{memoir.dtx} \PrintIndex %% \PrintChanges \end{document} % % \end{macrocode} % % % ^^A There are some elements we do not want to appear in the index. % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath} % \DoNotIndex{\@centercr,\@cite} % \DoNotIndex{\@dotsep,\@empty,\@gobble,\@gobbletwo,\@ignoretrue} % \DoNotIndex{\@input,\@ixpt,\@m} % \DoNotIndex{\@minus,\@ne,\@nil,\@nomath,\@plus,\@set@topoint} % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} % \DoNotIndex{\advance,\Alph,\alph} % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} % \DoNotIndex{\bullet} % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} % \DoNotIndex{\EnableCrossrefs,\end,\endgroup} % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} % \DoNotIndex{\fbox} % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} % \DoNotIndex{\global,\halign,\hbox,\hfil,\hfill,\hrule} % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} % \DoNotIndex{\input} % \DoNotIndex{\jobname,\kern,\leavevmode,\let} % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th} % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} % \DoNotIndex{\NeedsTeXFormat,\newdimen} % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} % \DoNotIndex{\par,\paragraph,\paragraphmark,\parfillskip} % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} % \DoNotIndex{\protect,\ProvidesClass} % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font} % \DoNotIndex{\rightskip,\rlap,\rmfamily,\roman} % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength} % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} % \DoNotIndex{\viipt,\vipt,\vskip,\vspace} % \DoNotIndex{\wd,\xiipt,\year,\z@} % \DoNotIndex{\@namedef,\@nameuse,\csname,\endcsname} % % % % \section{Identification} \label{sec:id} % % The \Lpack{memoir} document class can only be used with LaTeX2e, % so we make % sure that an appropriate message is displayed when another \TeX{} % format is used. % \begin{macrocode} %\NeedsTeXFormat{LaTeX2e} % \end{macrocode} % % ^^A Use the Golden Section as the version number (1.6180339887 4989484820 4586834365) % Announce the name, option files and version for LaTeX2e files: % \begin{macrocode} %\ProvidesClass{memoir}% % [2008/07/23 v1.6180339 configurable book, report, article document class] %<9pt>\ProvidesFile{mem9.clo}% %<9pt> [2008/01/30 v0.4 memoir class 9pt size option] %<10pt>\ProvidesFile{mem10.clo}% %<10pt> [2008/01/30 v0.3 memoir class 10pt size option] %<11pt>\ProvidesFile{mem11.clo}% %<11pt> [2008/01/30 v0.3 memoir class 11pt size option] %<12pt>\ProvidesFile{mem12.clo}% %<12pt> [2008/01/30 v0.4 memoir class 12pt size option] %<14pt>\ProvidesFile{mem14.clo}% %<14pt> [2008/01/30 v0.4 memoir class 14pt size option] %<17pt>\ProvidesFile{mem17.clo}% %<17pt> [2008/01/30 v0.3 memoir class 17pt size option] %<20pt>\ProvidesFile{mem20.clo}% %<20pt> [2008/01/31 v0.1 memoir class 20pt size option] %<25pt>\ProvidesFile{mem25.clo}% %<25pt> [2008/01/31 v0.1 memoir class 25pt size option] %<30pt>\ProvidesFile{mem30.clo}% %<30pt> [2008/01/31 v0.1 memoir class 30pt size option] %<36pt>\ProvidesFile{mem36.clo}% %<36pt> [2008/01/31 v0.1 memoir class 36pt size option] %<48pt>\ProvidesFile{mem48.clo}% %<48pt> [2008/01/31 v0.1 memoir class 48pt size option] %<60pt>\ProvidesFile{mem60.clo}% %<60pt> [2008/01/31 v0.1 memoir class 60pt size option] % \end{macrocode} % % % \section{Initial Code} \label{sec:ic} % % \begin{macrocode} %<*class> % \end{macrocode} % % Note (2001/08/03): Old versions of the \Lpack{amsmath} package did odd % things with \cs{@tempa}, \cs{@tempb} and \cs{@tempc}. I have now replaced % any use of these with \cs{@memtempa}, etc. % % In this part we define a few commands that are used later on. % % \begin{macro}{\@ptsize} % \begin{macro}{\@memptsize} % The \cs{@ptsize} control sequence is normally used to store the % second digit of the % pointsize we are typesetting in. So, normally, it's value is one % of 0, 1 or 2. % % \cs{@memptsize} stores the full pointsize. % \changes{v1.61803}{2008/01/30}{Added \cs{@memptsize}} % \begin{macrocode} \newcommand*{\@ptsize}{} \newcommand*{\@memptsize}{} % \end{macrocode} % \end{macro} % \end{macro} % % Any new lengths that depend on the point size option must be declared % before the options are executed. % \begin{macro}{\onelineskip} % \begin{macro}{\lxvchars} % \begin{macro}{\xlvchars} % The length \cs{onelineskip} is the vertical space taken % by a normal line of text. The lengths \cs{lxvchars} and \cs{xlvchars} are % the approximate lengths required for typesetting lines with either 65 or 45 % characters. % \begin{macrocode} \newlength{\onelineskip} \newlength{\lxvchars} \newlength{\xlvchars} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@memcnta} % \begin{macro}{\c@memmarkcntra} % We need a scratch count register and a scratch counter. % \changes{v1.61803}{2008/10/30}{Added @memmarkcntra scratch counter} % \begin{macrocode} \newcount\@memcnta \newcounter{@memmarkcntra} % \end{macrocode} % \end{macro} % \end{macro} % % \changes{v1.0a}{2001/11/28}{Deleted count register \cs{@memtempa}} % % \begin{macro}{\if@restonecol} % When the document has to be printed in two columns, we sometimes % have to temporarily switch to one column. This switch is used to % remember to switch back. % \begin{macrocode} \newif\if@restonecol % \end{macrocode} % \end{macro} % % \begin{macro}{\if@openright} % This is TRUE if chapters are to start on righthand (recto) pages; % this is the default. FALSE means chapters can start on any page. % \begin{macrocode} \newif\if@openright \@openrighttrue % \end{macrocode} % \end{macro} % % \begin{macro}{\if@openleft} % This is TRUE if chapters are to start on lefthand (verso) pages. % \begin{macrocode} \newif\if@openleft \@openleftfalse % \end{macrocode} % \end{macro} % % \begin{macro}{\if@mainmatter} % This is TRUE if the main part of the document is being currently procesed; % this is the default. % \begin{macrocode} \newif\if@mainmatter \@mainmattertrue % \end{macrocode} % \end{macro} % % \begin{macro}{\if@memoldfont} % This is TRUE if the \Lopt{oldfontcommands} option is used. % \changes{v1.0a}{2002/01/29}{Added \cs{if@memoldfont}} % \begin{macrocode} \newif\if@memoldfont \@memoldfontfalse % \end{macrocode} % \end{macro} % % \begin{macro}{\ifextrafontsizes} % This is TRUE if the \Lopt{extrafontsizes} option is used. % \changes{v1.61803}{2008/01/30}{Added \cs{ifextrafontsizes}} % \begin{macrocode} \newif\ifextrafontsizes \extrafontsizesfalse % \end{macrocode} % \end{macro} % % \begin{macro}{\@memerror} % \begin{macro}{\@memwarn} % Two macros to save some space when reporting errors or warnings. % The macros take the same arguments, ignoring the first in each case, % as \cs{ClassError} and \cs{ClassWarning}, e.g., \\ % \verb?\@memwarn{Message}? \\ % instead of \\ % \verb?\ClassWarning{memoir}{Message}?. % \changes{v1.4}{2003/02/27}{Added \cs{@memerror} and \cs{@memwarn}} % \begin{macrocode} \newcommand*{\@memerror}{\ClassError{memoir}} \newcommand*{\@memwarn}{\ClassWarning{memoir}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\ifsamename} % \begin{macro}{\nametest} % The macro \cs{nametest}\marg{name1}\marg{name2} tests whether the % characters forming the two arguments are the same or not. If they are the % same then \cs{ifsamename} is set TRUE, otherwise it is set FALSE. \meta{name1} % and \meta{name2} must both be either macro names (including the backslash) % or must both not be macro names. That is, you cannot do % \verb?\nametest{\cs}{cs}?. % \begin{macrocode} \newif\ifsamename \newcommand{\nametest}[2]{% \samenamefalse \begingroup \def\@memtempa{#1} \def\@memtempb{#2} \ifx \@memtempa\@memtempb \endgroup \samenametrue \else \endgroup \fi} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\ifm@m@And} % \begin{macro}{\m@m@Andtrue} % \begin{macro}{\m@m@Andfalse} % \begin{macro}{\ifm@m@Or} % \begin{macro}{\m@m@Ortrue} % \begin{macro}{\m@m@Orfalse} % \begin{macro}{\ifm@m@Xor} % \begin{macro}{\m@m@Xortrue} % \begin{macro}{\m@m@Xorfalse} % These are for `if A and B', `if A or B' and `if A xor B'. % % For A and B: % \begin{verbatim} % \m@m@Andfalse % \ifA % \ifB % \m@mAndtrue % \fi % \fi % \end{verbatim} % For A or B: % \begin{verbatim} % \m@m@Ortrue % \ifA % \else % \ifB % \else % \m@m@Orfalse % \fi % \fi % \end{verbatim} % For A xor B: % \begin{verbatim} % \m@m@Xortrue % \ifA % \ifB % \m@m@Xfalse % \fi % \else % \ifB % \else % \m@m@Xorfalse % \fi % \fi % \end{verbatim} % \changes{v1.618}{2005/09/09}{Added \cs{ifm@m@And}, \cs{ifm@m@Or} and \cs{ifm@m@Xor}} % \begin{macrocode} \newif\ifm@m@And \newif\ifm@m@Or \newif\ifm@m@Xor % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \changes{v0.3}{2001/07/09}{Deleted \cs{fillline} and \cs{makecommand} as % they were not used} % % % \begin{macro}{\kill@lastcounter} % \cs{kill@lastcounter}\marg{cntr}\footnote{With thanks to Stefan Ulrich % (\texttt{ulrich@cis.uni-muenchen.de}) who answered a question on this % on \ctt, 2001/07/09. (Also answered by Heiko Oberdiek, % \texttt{oberdiek@ruf.uni-freiburg.de}).} % kills the counter \meta{cntr}. This macro is an extension to the % suggestions as it also makes the last count register reusable. % \emph{The macro must only be used when the last allocated counter is to % be killed.} % For example with:\\ % \verb?\newcounter{fred} \kill@lastcounter{fred} \newcounter{fred}? \\ % there is no error with the second \cs{newcounter}. % \changes{v0.3}{2001/07/09}{Added \cs{kill@counter}} % \changes{v1.618}{2005/09/02}{Ensured \cs{kill@counter} zeroed the counter} % \begin{macrocode} \newcommand{\kill@lastcounter}[1]{% % \end{macrocode} % Deallocate the last counter register. From \theTeXbook, \verb?\count10? is % the number of the last register. The counter should be zeroed before being % deallocated otherwise an immediatally following \cs{newcount} may not % be zero when allocated\footnote{Discovered and fix provided by Robert % Schlicht on 2005/08/31.}. % \begin{macrocode} \count\count10 \z@ \advance\count10 \m@ne % \end{macrocode} % Set the internal counter definition to \cs{relax}. % \begin{macrocode} \expandafter\let\csname c@#1\endcsname\relax} % \end{macrocode} % \end{macro} % % \begin{macro}{\@name@p@xdf} % \begin{macro}{\@name@unresp@xdef} % \begin{macro}{\@namelet} % \begin{macro}{\@namelongdef} % Utility definition macros, along the lines of the kernel's \cs{@namedef}. % \changes{v1.4}{2003/11/22}{Added \cs{@namelet} and friends (from patch v1.8)} % \begin{macrocode} \newcommand{\@name@p@xdef}[1]{% \expandafter\protected@xdef\csname #1\endcsname} \newcommand{\@name@unresp@xdef}[1]{% \expandafter\unrestored@protected@xdef\csname #1\endcsname} \newcommand{\@namelet}[1]{% \expandafter\let\csname #1\endcsname} \newcommand{\@namelongdef}[1]{% \long\expandafter\def\csname #1\endcsname} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@nameedef} % A shorthand for using \cs{protected@edef}. % \begin{macrocode} \newcommand{\@nameedef}[1]{% \expandafter\protected@edef\csname #1\endcsname} % \end{macrocode} % \end{macro} % % % \begin{macro}{\memjustarg} % \begin{macro}{\memgobble} % Utility macros \emph{that are not to be changed by any user!} % \changes{v1.618}{2005/09/25}{Added \cs{memjustarg} and \cs{memgobble}} % \begin{macrocode} \newcommand{\memjustarg}[1]{#1} \newcommand{\memgobble}[1]{} % \end{macrocode} % \end{macro} % \end{macro} % % \subsection{Classes, Packages and Files} % % \begin{macro}{\@memfakeusepackage} % \cs{@memfakeusepackage}\marg{pack} fools \LaTeX{} into thinking % that the \meta{pack.sty} package has been loaded. % \changes{v1.4}{2003/11/22}{Added \cs{@memfakeusepackage} (from patch v1.9)} % \begin{macrocode} \newcommand*{\@memfakeusepackage}[1]{% \@namelet{ver@#1.sty}\@empty} % \end{macrocode} % \end{macro} % % \begin{macro}{\EmulatedPackage} % \begin{macro}{\EmulatedPackageWithOptions} % There was some discussion on CTT\footnote{\textit{Re: breakurl + pdfetex % for generating .dvi}, March 2005.} about how to prevent loading of % a package. My response was to use \cs{@memfakusepackage}. Donald Arseneau % came up with this comprehensive solution (there was a little discussion % about naming with my final suggestion as here). \\ % \cs{EmulatedPackage}\marg{package}\oarg{date} \\ % \cs{EmulatedPackageWithOptions}\marg{option-list}\marg{package}\oarg{date} \\ % % \changes{v1.618}{2005/09/04}{Added \cs{EmulatedPackage} and % \cs{EmulatedPackageWithOptions}} % \changes{v1.6180339}{2008/07/23}{Extended \cs{EmulatedPackage}} % \begin{macrocode} \providecommand*{\EmulatedPackage}{} \renewcommand*{\EmulatedPackage}[1]{% \@ifnextchar[{\@emulated@package{#1}}% {\@emulated@package{#1}[\@empty]}%] } \providecommand*{\EmulatedPackageWithOptions}{} \renewcommand*{\EmulatedPackageWithOptions}[2]{% \PassOptionsToPackage{#1}{#2}% \EmulatedPackage{#2}% } % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\@emulated@package} % The workhorse for the user commands. % \begin{macrocode} \def\@emulated@package#1[#2]{% \expandafter\xdef\csname ver@#1.\@pkgextension\endcsname{#2}% \@ifundefined{opt@#1.\@pkgextension}% {\@namedef{opt@#1.\@pkgextension}{}}{}% \wlog{Package #1 \ifx\@empty#2\else[#2] \fi \if,\csname opt@#1.\@pkgextension\endcsname,\else (with options \csname opt@#1.\@pkgextension\endcsname) \fi emulated by \@currname.}% } \@onlypreamble\EmulatedPackage \@onlypreamble\EmulatedPackageWithOptions \@onlypreamble\@emulated@package % \end{macrocode} % \end{macro} % % \begin{macro}{\DisemulatePackage} % \cs{DisemulatePackage}\marg{package} undoes a previous % \cs{EmulatedPackage...} % \changes{v1.61803}{2008/01/30}{Added \cs{DisemulatePackage} from memptach v4.5} % \changes{v1.6180339}{2008/07/23}{Fixed \cs{DisemulatePackage} from mempatch v5.1} % \begin{macrocode} \newcommand*{\DisemulatePackage}[1]{% \@namelet{ver@#1.\@pkgextension}\relax} \@onlypreamble\DisemulatePackage % \end{macrocode} % \end{macro} % % % Code, based on a hint from Morten H{\o}gholm\footnote{CTT posting % 2005/11/08, \textit{Re: Checking for packages froma class... % revisited}} that the \Lpack{scrlfile} package from % \Lpack{koma-script} includes commands such as \\ % \cs{AfterFile}\marg{file}\marg{code} \\ % plus before and after classes and packages. % \changes{v1.16803}{2008/01/30}{Added various \cs{AtBegin...} and % \cs{AtEnd...} macros (mempatch v4.2)} % % Extend the \cs{InputIfFileExists} macro to call hooks before and % the actual inputting. The kernel version (as of 2005/11/21) is: % \begin{verbatim} % \newcommand{\InputIfFileExists}[2]{% % \IfFileExists{#1}% % {\#2\@addtofilelist{#1}\@@input \@filef@und}} % \end{verbatim} % % \begin{macro}{\InputIfFileExists} % Effectively all file input is handled by this macro. Extend it % by adding pre- and post- input hooks. % \begin{macrocode} \renewcommand{\InputIfFileExists}[2]{% \IfFileExists{#1}% {#2\@addtofilelist{#1}\m@matbeginf{#1}% \@@input \@filef@und \m@matendf{#1}% \killm@matf{#1}}} % \end{macrocode} % \end{macro} % % \begin{macro}{\m@matbeginf} % \begin{macro}{\m@matendf} % \cs{m@matbeginf}\marg{file} calls macro \cs{file-m@mfb} if it % is defined. Similarly \cs{m@matendf}\marg{file} calls % \cs{file-m@mfe} if it is defined. % \begin{macrocode} \newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}% {\@nameuse{#1-m@mfb}}} \newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}% {\@nameuse{#1-m@mfe}}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\killm@matf} % \cs{killm@matf}\marg{file} undefines the \cs{file-m@mfb} and % \cs{file-m@mfe} macros. % \begin{macrocode} \newcommand*{\killm@matf}[1]{% \@namelet{#1-m@mfb}\relax \@namelet{#1-m@mfe}\relax} % \end{macrocode} % \end{macro} % % \begin{macro}{\AtBeginFile} % \begin{macro}{\AtEndFile} % \cs{AtBeginFile}\marg{file}\marg{code} inserts \meta{code} % just before \meta{file} is input. Similarly \cs{AtEndFile} inserts % just after input. % \begin{macrocode} \newcommand{\AtBeginFile}[2]{\@ifundefined{#1-m@mfb}% {\@namedef{#1-m@mfb}{#2}}% {\expandafter\addtodef\csname #1-m@mfb\endcsname{}{#2}}} \newcommand{\AtEndFile}[2]{\@ifundefined{#1-m@mfe}% {\@namedef{#1-m@mfe}{#2}}% {\expandafter\addtodef\csname #1-m@mfe\endcsname{}{#2}}} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\AtBeginPackage} % \begin{macro}{\AtEndPackage} % \begin{macro}{\RequireAtEndPackage} % \cs{AtBeginPackage}\marg{pack}\marg{code} inserts \meta{code} % just before the \meta{pack} package is input, and \cs{AtEndPackage} % is the equivalent for after input. \cs{RequireAtEndPackage} inserts % \meta{code} either at the end of \meta{pack}, or immediately if % \meta{pack} has already been input. % \begin{macrocode} \newcommand{\AtBeginPackage}[2]{% \AtBeginFile{#1.\@pkgextension}{#2}} \newcommand{\AtEndPackage}[2]{% \AtEndFile{#1.\@pkgextension}{#2}} \newcommand{\RequireAtEndPackage}[2]{% \@ifpackageloaded{#1}{#2}% {\AtEndFile{#1.\@pkgextension}{#2}}} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\AtBeginClass} % \begin{macro}{\AtEndClass} % \begin{macro}{\RequireAtEndClass} % \cs{AtBeginClass}\marg{class}\marg{code} and friends are the class % equivalents of \cs{AtBeginPackage} and friends. % \begin{macrocode} \newcommand{\AtBeginClass}[2]{% \AtBeginFile{#1.\@clsextension}{#2}} \newcommand{\AtEndClass}[2]{% \AtEndFile{#1.\@clsextension}{#2}} \newcommand{\RequireAtEndClass}[2]{% \@ifclassloaded{#1}{#2}% {\AtEndFile{#1.\@clsextension}{#2}}} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % % % \begin{macro}{\phantomsection} % A command needed if the \Lpack{hyperref} package is used, for putting % before certain \cs{addcontentsline} commands. % \begin{macrocode} \newcommand{\phantomsection}{} % \end{macrocode} % \end{macro} % % \begin{macro}{\nofiles} % The kernel's \cs{nofiles}, which surprisingly may be called \emph{before} % the class is loaded, lets \cs{makeindex} to \cs{relax}. This could % cause problems\footnote{As reported by Heiko Oberdiek on 2005/07/09.} % with my initial version of \cs{makeindex}. % Here's the kernel \cs{nofiles} definition: % \begin{verbatim} % \def\nofiles{% % \@fileswfalse% flag for suppressing \immediate \writes % \typeout{No auxiliary output files.^^J}% % \long\def\protected@write##1##2##3% % {\write\m@ne{}\if@nobreak\ifvmode\nobreak\fi\fi}% % \let\makeindex\relax % \let\makeglossary\relax} % \end{verbatim} % To get it to work for when \cs{makeindex}es optional argument is % used I let \cs{makeindex} itself deal with \cs{nofiles} (and % also \cs{makeglossary}). % \changes{v1.618}{2005/09/25}{Modified the kernel's \cs{nofiles}} % \begin{macrocode} \renewcommand*{\nofiles}{% \@fileswfalse% flag for suppressing \immediate \writes \typeout{No auxiliary output files.^^J}% \long\def\protected@write##1##2##3% {\write\m@ne{}\if@nobreak\ifvmode\nobreak\fi\fi}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\memsetcounter} % A wrapper round \cs{setcounter}. I want to use this in the \texttt{aux} file. % \changes{v1.61803}{2008/01/30}{Added \cs{memsetcounter}} % \begin{macrocode} \newcommand*{\memsetcounter}[2]{\setcounter{#1}{#2}} \AtBeginDocument{\immediate\write\@mainaux{% \string\providecommand*{\string\memsetcounter}[2]{}}} % \end{macrocode} % \end{macro} % % \subsection{For package documentation} % % Some macros that may be useful for documenting LaTeX code. These % have principally come from \texttt{doc.dtx}. % % \begin{macro}{\bs} % Prints \verb?\? % \begin{macrocode} \def\bs{\texttt{\char`\\}} % \end{macrocode} % \end{macro} % % \begin{macro}{\l@nohyphenation} % \begin{macro}{\meta} % \begin{macro}{\meta@font@select} % From \texttt{doc.dtx} \\ % \cs{meta}\marg{arg} prints \meta{arg}. % \begin{macrocode} \ifx\l@nohyphenation\undefined \newlanguage\l@nohyphenation \fi \DeclareRobustCommand{\meta}[1]{% \ensuremath\langle \ifmmode \expandafter \nfss@text \fi {% \meta@font@select \edef\meta@hyphen@restore {\hyphenchar\the\font\the\hyphenchar\font}% \hyphenchar\font\m@ne \language\l@nohyphenation #1\/% \meta@hyphen@restore }\ensuremath\rangle } \def\meta@font@select{\itshape} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\marg} % \begin{macro}{\oarg} % \begin{macro}{\parg} % Robust versions of the \texttt{doc.dtx} macros. \\ % \cs{marg}\marg{arg} prints \marg{arg} \\ % \cs{oarg}\marg{arg} prints \oarg{arg} \\ % \cs{parg}\marg{arg} prints \parg{arg} \\ % \begin{macrocode} \DeclareRobustCommand{\marg}[1]{% {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}} \DeclareRobustCommand{\oarg}[1]{% {\ttfamily\char`\[}\meta{#1}{\ttfamily\char`\]}} \DeclareRobustCommand{\parg}[1]{% {\ttfamily\char`\(}\meta{#1}{\ttfamily\char`\)}} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\cs} % \verb?\cs{arg}? prints \cs{arg}. % \begin{macrocode} \DeclareRobustCommand{\cs}[1]{\texttt{\char`\\#1}} % \end{macrocode} % \end{macro} % % % \begin{macro}{\cmdprint} % \begin{macro}{\cmd} % From Heiko Oberdiek CTT 2001/05/26 (print and index a command) \\ % \verb?\cmdprint{\fred}? prints \verb?\fred? \\ % \verb?\cmd{\fred}? prints and indexes \verb?\fred?. NOTE It assumes that % \verb!?! is the `actual' character for MakeIndex (it is normally \verb!@! % but that is not much use if a command includes \verb!@! as part of its name). % \begin{macrocode} \newcommand{\cmdprint}[1]{\texttt{\string#1}} \newcommand{\cmd}[1]{\cmdprint{#1}% \index{\expandafter\@gobble\string#1?\string\cmdprint{\string#1}}} % \end{macrocode} % \end{macro} % \end{macro} % % % % % \subsection{Checking the processor} % % Prior to 2008/07/22 the \Lpack{hyperref} package was modified in such a % way as to produce warnings about versions of the \Lpack{ifpdf} and % \Lpack{ifxetex} packages when \Lpack{hyperref} was used with versions % v1.618033, % v1.61803, or v1.618 mempatch v4.9 of the class. % \Lpack{hyperref}'s author refused to % make any changes to his package, insisting that emulating a package was % `ugly hacking'. He did, though, provide an example code that could be % added to memoir % to use a package if it was available. I have used it for the emulations % in this section. There will be no further changes to the class to accomodate % any further changes to \Lpack{hyperref} --- it's easy for a package to % determine what class is being used and make arrangements accordingly, % especially as there are not all that many classes. There are hundreds % of packages that might be used with a particular class and it would be % senseless for a class to attempt to take account of everything that might % be used with it. % % \begin{macro}{\ifpdf} % \begin{macro}{\pdftrue} % \begin{macro}{\pdffalse} % This can be used to check whether or not a document is being processed % by \LaTeX{} or pdf\LaTeX. % \changes{v1.0}{2001/09/21}{Made checking of \cs{pdfouput} more robust} % \changes{v1.618}{2005/09/03}{Prohibit loading the ifpdf package (mempatch v3.9)} % \changes{v1.618033}{2008/06/02}{Further improved pdf checking} % \changes{v1.6180339}{2008/07/23}{Use ifpdf package if available} % \begin{macrocode} \newif\ifm@mifpdf \m@mifpdffalse \IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\relax}{% \ClassWarningNoLine{memoir}{% Package `ifpdf' is not installed.\MessageBreak The package is being emulated}% \m@mifpdftrue \newif\ifpdf \pdffalse \ifx\pdfoutput\undefined \else \ifx\pdfoutput\@undefined \else \ifx\pdfoutput\relax \else \ifnum\pdfoutput>0\relax \pdftrue \fi \fi \fi \fi %%\EmulatedPackage{ifpdf}[2008/07/23] } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\ifetex} % \begin{macro}{\etextrue} % \begin{macro}{\etexfalse} % Check if \texttt{etex} is being used. This is based on the check for % \texttt{pdf(latex)}. Someone may have created a package for this, % or perhaps not. % \changes{v1.61803}{2008/01/30}{Added check for etex (mempatch v4.9)} % \changes{v1.618033}{2008/06/02}{Improved check for etex} % \changes{v1.6180339}{2008/07/23}{Use an ifetex package if available} % \begin{macrocode} \newif\ifm@mifetex \m@mifetexfalse \IfFileExists{ifetex.sty}{\RequirePackage{ifetex}\relax}{% \ClassWarningNoLine{memoir}{% If there is an `ifetex' package then it is not installed.\MessageBreak The package is being emulated}% \m@mifetextrue \newif\ifetex \etexfalse \ifx\eTeXversion\undefined \else \ifx\eTeXversion\@undefined \else \ifx\eTeXversion\relax \else \ifnum\eTeXversion>0\relax \etextrue \fi \fi \fi \fi %%\EmulatedPackage{ifetex}[2008/07/23] } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used, % here's one for XeTeX. % % \begin{macro}{\ifxetex} % \begin{macro}{\xetextrue} % \begin{macro}{\xetexfalse} % \begin{macro}{\RequireXeTeX} % Checks if XeTeX is being used. % \changes{v1.61803}{2008/01/30}{Added checks for XeTeX (mempatch v4.9)} % \changes{v1.6180339}{2008/07/23}{Use ifxetex package if available} % \begin{macrocode} \newif\ifm@mifxetex \m@mifxetexfalse \IfFileExists{ifxetex.sty}{\RequirePackage{ifxetex}\relax}{% \ClassWarningNoLine{memoir}{% The `ifxetex' package is not installed.\MessageBreak The package is being emulated}% \newif\ifxetex \@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue} % \end{macrocode} % Check for XeTeX from the \Lpack{ifxetex} package. % \begin{macrocode} %%\EmulatedPackage{ifxetex}[2008/07/23] } \ifm@mifxetex \def\RequireXeTeX{% \ifxetex\else \@memerror{XeTeX is required to process this document}% {Try again with xelatex, not (pdf)latex.\MessageBreak Or try removing any XeTeX package(s).} \fi} \fi % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\ifluatex} % \begin{macro}{\luatextrue} % \begin{macro}{\luatexfalse} % Check if \texttt{luatex} is being used. This is based on the check for % \texttt{pdf(latex)}. Someone may have created a package for this, or % perhaps not. % \changes{v1.61803}{2008/01/30}{Added check for luatex} % \changes{v1.6180339}{2008/07/23}{Use an ifluatex package if available} % \begin{macrocode} \newif\ifm@mifluatex \m@mifluatexfalse \IfFileExists{ifluatex.sty}{\RequirePackage{ifluatex}\relax}{% \ClassWarningNoLine{memoir}{% If there is an `ifluatex' package then it is not installed.\MessageBreak The package is being emulated}% \m@mifluatextrue \newif\ifluatex \luatexfalse \ifx\luatexversion\@undefined \else \ifx\luatexversion\undefined \else \ifx\luatexversion\relax \else \luatextrue \fi \fi \fi %%\EmulatedPackage{ifluatex}[2008/07/23] } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \subsection{Extending an existing macro} % % % My usual technique for modifying the code of an existing % macro was to use \cs{renewcommand}. However it slowly became apparent that % many of such modifications merely consisted of adding some code at % either the start or end of the existing definition. In June 2000 I % posed a question % on the \texttt{comp.text.tex} newsgroup about this, and % Michael Downes\footnote{\texttt{epsmjd@ams.org}} and % Heiko Oberdiek\footnote{\texttt{oberdiek@ruf.uni-freiburg.de}} % were kind enough to respond. % The responses arrived almost simultaneously, both % supplying methods for adding code at the end of a macro defined to take % one argument. Michael Downes' response included a remark about it probably % being too much effort to formulate a general way of doing this. % Heiko Oberdiek almost immediately replied with such a generalisation. % % The following code, which I have extracted from a package that I % wrote but which I did not submit to CTAN, incorporates the work of both % Michael and Heiko. I have added a bit. All errors are my responsibility. % Michael went on the write the \Lpack{patchcmd} package which is % a generalisation of the facilities below and so there was no need for % my more restricted package. % \changes{v0.33}{2001/08/31}{Replaced \cs{appendiarg} with \cs{addtodef} % and friends} % % \begin{macro}{\wo@dmacro} % Heiko Oberdiek suggested\footnote{Via email on 2000/07/12.} that % \meta{macro} should be tested for being the name of a macro, rather than % using the normal \LaTeX{} test against it being undefined. He supplied % the code for performing the macro name test. % % \cs{wo@dmacro} is a helper for handling the string `macro:'. % \begin{macrocode} \edef\wo@dmacro{% \string m\string a\string c\string r\string o\string :% } % \end{macrocode} % \end{macro} % % \begin{macro}{\wo@difmacro@begingroup} % This seems to take two arguments: % \cs{wo@difmacro@begingroup}\marg{macro}\marg{code}, where % \meta{macro} should be the name of a defined macro and \meta{code} % is code to be executed if and only if \meta{macro} \emph{is} a % defined macro. % \begin{macrocode} \def\wo@difmacro@begingroup#1{% % \end{macrocode} % Start a group. % \begin{macrocode} \begingroup % \end{macrocode} % Test if \verb?#1? is a defined macro; \cs{wo@dparsemacro} does most of the work. % \begin{macrocode} \edef\x{% \noexpand\wo@dparsemacro\meaning#1\wo@dmacro\string -% }% \x\@nil{#1}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\wo@dparsemacro} % This is called by \cs{wo@difmacro@begingroup}. If \meta{macro} is not % a defined macro it prints a warning and closes the group begun by % \cs{wo@difmacro@begingroup}. Otherwise it process the \meta{code} which % \emph{must} close the group. % \begin{macrocode} \begingroup \edef\x{\endgroup \def\noexpand\wo@dparsemacro##1\wo@dmacro##2\string -}% \x#3\@nil#4{% \ifx\\#3\\% \endgroup \@memwarn{\string `\string #4\string ' is not a macro}% \expandafter\@gobble \else \expandafter\@firstofone \fi } % \end{macrocode} % \end{macro} % % \begin{macro}{\addtodef} % \begin{macro}{\addtodef*} % \begin{macro}{\wo@daddtodef} % The command \cs{addtodef}\marg{macro}\marg{start-stuff}\marg{end-stuff} % adds stuff at the start and/or end of an argumentless macro. % Initially the code for appending was a reimplementation of the % kernel \cs{g@addto@macro} command (from \file{ltclass.dtx}). % Later, at Michael Downes' suggestion, I combined % appending and prepending stuff into a single command. % Actually, there is no real need to have both % \cs{addtodef} and \cs{addtodef*} as the body of the command % being amended has no argument, % but both versions are provided for consistency. % % The kernel \cs{@star@or@long} and \cs{l@ngrel@x} commands % (in \file{ltdefns.dtx}) are used to handle % the potential \verb?*? after the command name. % \begin{macrocode} \def\addtodef{\@star@or@long\wo@daddtodef} % \end{macrocode} % The \cs{@star@or@long} command dealt with a possible \verb?*? and now % \cs{wo@daddtodef} does the work. It picks up the three arguments % that the user thinks belong to \cs{addtodef}, namely \meta{macro}, % \meta{start-stuff} and \meta{end-stuff}. % \begin{macrocode} \long\def\wo@daddtodef#1#2#3{% % \end{macrocode} % Check if \meta{macro} has been defined. % \begin{macrocode} \wo@difmacro@begingroup{#1}{% % \end{macrocode} % If \meta{macro} is defined then store the tokens corresponding to the % body of \meta{macro} and the extra \meta{-stuff} in token registers. % \begin{macrocode} \@temptokena{#2}% \toks@\expandafter{#1#3}% % \end{macrocode} % Do an expanded definition for \cs{x}, so that calling \cs{x} % will \cs{def} a new version of \meta{macro}, whose body consists of the % saved tokens (i.e., the orginal body plus the extra stuff). % As Michael Downes noted, single letter control sequences do not take any of % \TeX's hash table space. % \cs{l@ngrel@x} % has been previously set to either \cs{long} or \cs{relax} by \cs{@star@or@long}, % and so may make the new definition of \meta{macro} to be \cs{long}. % \begin{macrocode} \edef\x{\endgroup \l@ngrel@x\def\noexpand#1{\the\@temptokena \the\toks@}}% % \end{macrocode} % Finally, call \cs{x} to perform the new definition. % \begin{macrocode} \x }% } % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\addtoiargdef} % \begin{macro}{\addtoiargdef*} % \begin{macro}{\wo@daddtoiargdef} % This adds stuff at the start and/or end of a macro that takes one argument. % It is a modification of Michael Downes' appending % code\footnote{Posted to \ctt{} on 15~June 2000,\\ % URL: \url{http://www.dejanews.com/getdoc.xp?AN=635057844}.} % which was: % \begin{small}\begin{verbatim} % \def\appendef#1#2{% % \begingroup % \toks@\expandafter{#1{##1}#2}% % \edef\x{\endgroup \def\noexpand#1####1{\the\toks@}}% % \x} % \end{verbatim} % \par\end{small} % % \begin{macrocode} \def\addtoiargdef{\@star@or@long\wo@daddtoiargdef} \long\def\wo@daddtoiargdef#1#2#3{% \wo@difmacro@begingroup{#1}{% \@temptokena{#2}% \toks@\expandafter{#1{##1}#3}% \edef\x{\endgroup \l@ngrel@x\def\noexpand#1####1{\the\@temptokena \the\toks@}}% \x }% } % \end{macrocode} % For the record, Heiko Oberdiek produced the following % version\footnote{Posted to \ctt{} on 16~June 2000,\\ % URL: \url{http://www.dejanews.com/getdoc.xp?AN=635095381}.} % which avoids the use of a token register. % \begin{small}\begin{verbatim} % \newcommand{\appendiargdef}[2]{% % \long\expandafter\def\expandafter#1\expandafter % ##\expandafter1\expandafter{#1{##1}#2}} % \end{verbatim} % \par\end{small} % % \end{macro} % \end{macro} % \end{macro} % % Continuing the saga, Michael came up with a pretty general solution for % modifying a macro with any number (up to 9) of arguments which he % sent to me on 2000/07/13; this became % the \Lpack{patchcmd} package which is on CTAN. I'm sure that Michael % would have given me permission to include it here if he had not tragically % passed away in 2003. I miss his encouragement, advice, and skills. % % \begin{macro}{\patchcmd} % \cs{patchcmd}\marg{macro}\marg{start-stuff}\marg{end-stuff} inserts % \meta{start-stuff} at the beginning of the definition of \meta{macro} % and \meta{end-stuff} at the end of the definition. \meta{macro} % can have 0--9 arguments and be defined by \cs{newcommand} (and associates) % or with \cs{DeclareRobustCommand}. For macros that use \cs{futurelet} % (e.g., those with starred forms or optional arguments) only prepending % works --- any non-empty \meta{end-stuff} will mess things up. \cs{patchcmd} % does not work with macros that have delimited arguments. % \changes{v1.618}{2005/09/05}{Added \cs{patchcmd}} % % \begin{macrocode} %%%%%%%%%%%%%%%% Michael Downes' patchcmd 2000/07/31 v1.03 %%%%%%%% \newcommand{\patchcommand}[1]{% \expandafter\patchcmd@a\meaning#1??->@\@nil#1% } % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmd@a} % \begin{macrocode} \long\def\patchcmd@a#1#2#3->#4#5\@nil#6{% \ifx @#4\relax \patchcmdError#6#1% \expandafter\@gobbletwo % discard the other two arguments \else \if l#2\toks@{\patchcmd@e{}#6}% l in this position means \long \else \toks@{\patchcmd@e*#6}% not \long \fi \patchcmd@b #3@#4#5 ? ? ? \@nil#6% \expandafter\the\expandafter\toks@ \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmd@b} % \begin{macrocode} \def\patchcmd@b#1:#2@#3#4 #5#6 #7 #8\@nil#9{% \if \ifx @#7@\expandafter \ifx\csname #6\endcsname#9T\else F\fi\else F\fi T% \toks@\expandafter{\expandafter\patchcommand\csname #6 \endcsname}% \else \ifx @#2@% No arguments \toks@\expandafter{\the\toks@ 0}% \else \patchcmd@c 0#2{\string##}0% \fi \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmd@c} % \begin{macrocode} \def\patchcmd@c#1#2#3{% \if\string###2% % yes it's a # token \ifodd 0#31 % and it's followed by a number \if 0#3\patchcmd@d#1\fi % number=0? then we're done \else \patchcmd@d D% # not a number: must be a delimited arg \fi \else \patchcmd@d D% not a # token: must be a delmited arg \fi \patchcmd@c#3} % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmd@d} % \begin{macrocode} \def\patchcmd@d#1{% \if D#1% %%% \PackageError{patchcmd}{Cannot change a macro that has %%% delimited arguments}\@ehd \@memerror{% Cannot change a macro that has delimited arguments}{\@ehd} \else \toks@\expandafter{\the\toks@ #1}% \fi \begingroup \aftergroup\@gobble \let\patchcmd@c\endgroup} % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmd@e} % \begin{macrocode} \def\patchcmd@e#1#2#3#4#5{% \begingroup \edef\@##1{% \@temptokena\noexpand\expandafter{% \noexpand#2% \ifnum#3>0 {####1}\ifnum#3>1 {####2}\ifnum#3>2 {####3}% \ifnum#3>3 {####4}\ifnum#3>4 {####5}\ifnum#3>5 {####6}% \ifnum#3>6 {####7}\ifnum#3>7 {####8}\ifnum#3>8 {####9}% \fi\fi\fi\fi\fi\fi\fi\fi\fi ##1% }% } \@{#5}% \edef\@##1{\endgroup \noexpand\renewcommand#1\noexpand#2\ifcase#3 \else [#3]\fi {##1\the\@temptokena}}% \@{#4}% } % \end{macrocode} % \end{macro} % % \begin{macro}{\patchcmdError} % \begin{macrocode} \long\def\patchcmdError#1#2{% \begingroup \toks@{Not redefinable}% \ifcat\relax\noexpand#1% Is it a control sequence? \begingroup \let#1=?\ifx ?\relax % Is it "\relax"? \endgroup % accept current value of \toks@ \else \endgroup \if\ifx\relax#1u\else #2\fi u% \toks@{Not defined}% \fi \fi \fi \edef\@{\endgroup %%% \noexpand\PackageError{patchcmd}{% %%% \the\toks@: \string#1}\noexpand\@ehd}% \noexpand\@memerror{% \the\toks@: \string#1}\noexpand\@ehd}% \@} %%%%%%%%%%%%%%%%%%%%% end of patchcmd code %%%%%%%%%%%%%%%%%%%%%%%%%%% % \end{macrocode} % \end{macro} % % Prevent later loading of the original \Lpack{patchcmd} package. % \begin{macrocode} %%\@memfakeusepackage{patchcmd} % \end{macrocode} % % % \section{Declaration of Options} \label{sec:opt} % % % \subsection{Setting Paper Sizes} % % The variables \cs{paperheight} and \cs{paperwidth} should reflect the % physical paper size after trimming. % % Option \Lopt{letterpaper} will be the default. % % \begin{macro}{\stockheight} % \begin{macro}{\stockwidth} % \begin{macro}{\trimtop} % \begin{macro}{\trimedge} % The lengths \cs{stockheight} and \cs{stockwidth} should be the height and % width of the stock sheet before trimming. For example, this is the % physical size % of a single sheet that might be laser-printed. The lengths \cs{trimtop} % and \cs{trimedge} are the amount that will be trimmed off the top and fore % edge of the physical sheet. % For desk printer output the size of the trimmed sheet is often the % same as the physical sheet. In other words the \cs{paper...} and \cs{stock...} % sizes are the same and the trims are zero. This class assumes that this % is the normal case. % \begin{macrocode} \newlength{\stockheight} \newlength{\stockwidth} \newlength{\trimtop} \newlength{\trimedge} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % The class provides an extended range of stock sizes. It may be useful at some % point to have macros for these. % % \begin{macro}{\stockdbill} % \begin{macro}{\stockstatement} % \begin{macro}{\stockexecutive} % \begin{macro}{\stockletter} % \begin{macro}{\stockold} % \begin{macro}{\stocklegal} % \begin{macro}{\stockledger} % \begin{macro}{\stockbroadsheet} % US stock sizes. % \changes{v1.61803}{2008/01/30}{Major expansion of stock size options} % \begin{macrocode} \newcommand*{\stockdbill} {\stockheight=7in \stockwidth=3in} \newcommand*{\stockstatement} {\stockheight=8.5in \stockwidth=5.5in} \newcommand*{\stockexecutive} {\stockheight=10.5in \stockwidth=7.25in} \newcommand*{\stockletter} {\stockheight=11in \stockwidth=8.5in} \newcommand*{\stockold} {\stockheight=12in \stockwidth=9in} \newcommand*{\stocklegal} {\stockheight=14in \stockwidth=8.5in} \newcommand*{\stockledger} {\stockheight=17in \stockwidth=11in} \newcommand*{\stockbroadsheet}{\stockheight=22in \stockwidth=17in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\stockpottvo} % \begin{macro}{\stockfoolscapvo} % \begin{macro}{\stockcrownvo} % \begin{macro}{\stockpostvo} % \begin{macro}{\stocklargecrownvo} % \begin{macro}{\stocklargepostvo} % \begin{macro}{\stocksmalldemyvo} % Traditional British octavo sizes. % \begin{macrocode} \newcommand*{\stockpottvo} {\stockheight=6.25in \stockwidth=4in} \newcommand*{\stockfoolscapvo} {\stockheight=6.75in \stockwidth=4.25in} \newcommand*{\stockcrownvo} {\stockheight=7.5in \stockwidth=5in} \newcommand*{\stockpostvo} {\stockheight=8in \stockwidth=5in} \newcommand*{\stocklargecrownvo}{\stockheight=8in \stockwidth=5.25in} \newcommand*{\stocklargepostvo} {\stockheight=8.25in \stockwidth=5.25in} \newcommand*{\stocksmalldemyvo} {\stockheight=8.5in \stockwidth=5.675in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\stockdemyvo} % \begin{macro}{\stockmediumvo} % \begin{macro}{\stocksmallroyalvo} % \begin{macro}{\stockroyalvo} % \begin{macro}{\stocksuperroyalvo} % \begin{macro}{\stockimperialvo} % \begin{macrocode} \newcommand*{\stockdemyvo} {\stockheight=8.75in \stockwidth=5.675in} \newcommand*{\stockmediumvo} {\stockheight=9in \stockwidth=5.75in} \newcommand*{\stocksmallroyalvo}{\stockheight=9.25in \stockwidth=6.175in} \newcommand*{\stockroyalvo} {\stockheight=10in \stockwidth=6.25in} \newcommand*{\stocksuperroyalvo}{\stockheight=10.25in \stockwidth=6.75in} \newcommand*{\stockimperialvo} {\stockheight=11in \stockwidth=7.5in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\stockmcrownvo} % \begin{macro}{\stockmlargecrownvo} % \begin{macro}{\stockmdemyvo} % \begin{macro}{\stockmsmallroyalvo} % Metric stock sizes. % \begin{macrocode} \newcommand*{\stockmcrownvo} {\stockheight=186mm \stockwidth=123mm} \newcommand*{\stockmlargecrownvo} {\stockheight=198mm \stockwidth=129mm} \newcommand*{\stockmdemyvo} {\stockheight=216mm \stockwidth=138mm} \newcommand*{\stockmsmallroyalvo} {\stockheight=234mm \stockwidth=156mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\stockaiii} % \begin{macro}{\stockaiv} % \begin{macro}{\stockav} % \begin{macro}{\stockavi} % The A series, A3 --- A6. % \begin{macrocode} \newcommand*{\stockaiii}{\stockheight=420mm \stockwidth=297mm} \newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm} \newcommand*{\stockav} {\stockheight=210mm \stockwidth=148mm} \newcommand*{\stockavi} {\stockheight=148mm \stockwidth=105mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\stockbiii} % \begin{macro}{\stockbiv} % \begin{macro}{\stockbv} % \begin{macro}{\stockbvi} % The B series, B3 --- B6. % \begin{macrocode} \newcommand*{\stockbiii}{\stockheight=500mm \stockwidth=353mm} \newcommand*{\stockbiv} {\stockheight=353mm \stockwidth=250mm} \newcommand*{\stockbv} {\stockheight=250mm \stockwidth=176mm} \newcommand*{\stockbvi} {\stockheight=176mm \stockwidth=125mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % It will be useful also to provide macros that set the page sizes. % % \begin{macro}{\pagedbill} % \begin{macro}{\pagestatement} % \begin{macro}{\pageexecutive} % \begin{macro}{\pageletter} % \begin{macro}{\pageold} % \begin{macro}{\pagelegal} % \begin{macro}{\pageledger} % \begin{macro}{\pagebroadsheet} % US page sizes. % \begin{macrocode} \newcommand*{\pagedbill} {\pageheight=7in \pagewidth=3in} \newcommand*{\pagestatement} {\pageheight=8.5in \pagewidth=5.5in} \newcommand*{\pageexecutive} {\pageheight=10.5in \pagewidth=7.25in} \newcommand*{\pageletter} {\pageheight=11in \pagewidth=8.5in} \newcommand*{\pageold} {\pageheight=12in \pagewidth=9in} \newcommand*{\pagelegal} {\pageheight=14in \pagewidth=8.5in} \newcommand*{\pageledger} {\pageheight=17in \pagewidth=11in} \newcommand*{\pagebroadsheet}{\pageheight=22in \pagewidth=17in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\pagepottvo} % \begin{macro}{\pagefoolscapvo} % \begin{macro}{\pagecrownvo} % \begin{macro}{\pagepostvo} % \begin{macro}{\pagelargecrownvo} % \begin{macro}{\pagelargepostvo} % \begin{macro}{\pagesmalldemyvo} % British traditional page sizes, octavo. % \begin{macrocode} \newcommand*{\pagepottvo} {\pageheight=6.25in \pagewidth=4in} \newcommand*{\pagefoolscapvo} {\pageheight=6.75in \pagewidth=4.25in} \newcommand*{\pagecrownvo} {\pageheight=7.5in \pagewidth=5in} \newcommand*{\pagepostvo} {\pageheight=8in \pagewidth=5in} \newcommand*{\pagelargecrownvo}{\pageheight=8in \pagewidth=5.25in} \newcommand*{\pagelargepostvo} {\pageheight=8.25in \pagewidth=5.25in} \newcommand*{\pagesmalldemyvo} {\pageheight=8.5in \pagewidth=5.675in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\pagedemyvo} % \begin{macro}{\pagemediumvo} % \begin{macro}{\pagesmallroyalvo} % \begin{macro}{\pageroyalvo} % \begin{macro}{\pagesuperroyalvo} % \begin{macro}{\pageimperialvo} % \begin{macrocode} \newcommand*{\pagedemyvo} {\pageheight=8.75in \pagewidth=5.675in} \newcommand*{\pagemediumvo} {\pageheight=9in \pagewidth=5.75in} \newcommand*{\pagesmallroyalvo}{\pageheight=9.25in \pagewidth=6.175in} \newcommand*{\pageroyalvo} {\pageheight=10in \pagewidth=6.25in} \newcommand*{\pagesuperroyalvo}{\pageheight=10.25in \pagewidth=6.75in} \newcommand*{\pageimperialvo} {\pageheight=11in \pagewidth=7.5in} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % % \begin{macro}{\pagemcrownvo} % \begin{macro}{\pagemlargecrownvo} % \begin{macro}{\pagemdemyvo} % \begin{macro}{\pagemsmallroyalvo} % Metric sizes. % \begin{macrocode} \newcommand*{\pagemcrownvo} {\pageheight=186mm \pagewidth=123mm} \newcommand*{\pagemlargecrownvo} {\pageheight=198mm \pagewidth=129mm} \newcommand*{\pagemdemyvo} {\pageheight=216mm \pagewidth=138mm} \newcommand*{\pagemsmallroyalvo} {\pageheight=234mm \pagewidth=156mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\pageaiii} % \begin{macro}{\pageaiv} % \begin{macro}{\pageav} % \begin{macro}{\pageavi} % The A series, A3 --- A6. % \begin{macrocode} \newcommand*{\pageaiii}{\pageheight=420mm \pagewidth=297mm} \newcommand*{\pageaiv} {\pageheight=297mm \pagewidth=210mm} \newcommand*{\pageav} {\pageheight=210mm \pagewidth=148mm} \newcommand*{\pageavi} {\pageheight=148mm \pagewidth=105mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\pagebiii} % \begin{macro}{\pagebiv} % \begin{macro}{\pagebv} % \begin{macro}{\pagebvi} % The B series, B3 --- B6. % \begin{macrocode} \newcommand*{\pagebiii}{\pageheight=500mm \pagewidth=353mm} \newcommand*{\pagebiv} {\pageheight=353mm \pagewidth=250mm} \newcommand*{\pagebv} {\pageheight=250mm \pagewidth=176mm} \newcommand*{\pagebvi} {\pageheight=176mm \pagewidth=125mm} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % Declare the stock size options. % % Metric paper stock sizes. % \begin{macrocode} \DeclareOption{a3paper}{\stockaiii} \DeclareOption{a4paper}{\stockaiv} \DeclareOption{a5paper}{\stockav} \DeclareOption{a6paper}{\stockavi} \DeclareOption{b3paper}{\stockbiii} \DeclareOption{b4paper}{\stockbiv} \DeclareOption{b5paper}{\stockbv} \DeclareOption{b6paper}{\stockbvi} \DeclareOption{mcrownvopaper}{\stockmcrownvo} \DeclareOption{mlargecrownvopaper}{\stockmlargecrownvo} \DeclareOption{mdemyvopaper}{\stockmdemyvo} \DeclareOption{msmallroyalvopaper}{\stockmsmallroyalvo} % \end{macrocode} % US paper stock sizes. % \begin{macrocode} \DeclareOption{dbillpaper}{\stockdbill} \DeclareOption{statementpaper}{\stockstatement} \DeclareOption{executivepaper}{\stockexecutive} \DeclareOption{letterpaper}{\stockletter} \DeclareOption{oldpaper}{\stockold} \DeclareOption{legalpaper}{\stocklegal} \DeclareOption{ledgerpaper}{\stockledger} \DeclareOption{broadsheetpaper}{\stockbroadsheet} % \end{macrocode} % British octavo stock paper sizes. % \begin{macrocode} \DeclareOption{pottvopaper}{\stockpottvo} \DeclareOption{foolscapvopaper}{\stockfoolscapvo} \DeclareOption{crownvopaper}{\stockcrownvo} \DeclareOption{postvopaper}{\stockpostvo} \DeclareOption{largecrownvopaper}{\stocklargecrownvo} \DeclareOption{largepostvopaper}{\stocklargepostvo} \DeclareOption{smalldemyvopaper}{\stocksmalldemyvo} \DeclareOption{demyvopaper}{\stockdemyvo} \DeclareOption{mediumvopaper}{\stockmediumvo} \DeclareOption{smallroyalvopaper}{\stocksmallroyalvo} \DeclareOption{royalvopaper}{\stockroyalvo} \DeclareOption{superroyalvopaper}{\stocksuperroyalvo} \DeclareOption{imperialvopaper}{\stockimperialvo} % \end{macrocode} % Ebook. % \begin{macrocode} \DeclareOption{ebook} {\setlength\stockheight {9in}% \setlength\stockwidth {6in}} % \end{macrocode} % % The \Lopt{landscape} option switches the values of the height and width, % assuming that the dimensions were originally given for portrait % orientation. % \begin{macrocode} \DeclareOption{landscape} {\setlength\@tempdima {\stockheight} \setlength\stockheight{\stockwidth} \setlength\stockwidth {\@tempdima}} % \end{macrocode} % % % \subsection{Choosing the type size} % % The type size options are handled by defining \cs{@ptsize} to contain % the last digit of the size in question and branching on \cs{ifcase} % statements. This is done for historical reasons to stay compatible % with other packages that use the \cs{@ptsize} variable to select % special actions. It makes the declarations of size options less % than 10pt or more than 20pt difficult. In this class \texttt{9} is used % for the \Lopt{9pt} option, assuming that the class will never define a % \Lopt{19pt} option. For larger options the full complement of digits % are used. % % In any event, \cs{@memptsize} holds the complete size. % % Option \Lopt{10pt} will be the default. % \changes{v1.2}{2002/07/07}{Added 17pt option} % \changes{v1.61803}{2008/01/30}{Added pt options 20 to 60.} % \changes{v1.61803}{2008/01/30}{Used \cs{@memptsize}} % \begin{macrocode} \renewcommand*{\@ptsize}{0} \renewcommand*{\@memptsize}{10} \DeclareOption{9pt}{\renewcommand*{\@ptsize}{9}\renewcommand*{\@memptsize}{9}} \DeclareOption{10pt}{\renewcommand*{\@ptsize}{0}\renewcommand*{\@memptsize}{10}} \DeclareOption{11pt}{\renewcommand*{\@ptsize}{1}\renewcommand*{\@memptsize}{11}} \DeclareOption{12pt}{\renewcommand*{\@ptsize}{2}\renewcommand*{\@memptsize}{12}} \DeclareOption{14pt}{\renewcommand*{\@ptsize}{4}\renewcommand*{\@memptsize}{14}} \DeclareOption{17pt}{\renewcommand*{\@ptsize}{7}\renewcommand*{\@memptsize}{17}} \DeclareOption{20pt}{\renewcommand*{\@ptsize}{20}\renewcommand*{\@memptsize}{20}} \DeclareOption{25pt}{\renewcommand*{\@ptsize}{25}\renewcommand*{\@memptsize}{25}} \DeclareOption{30pt}{\renewcommand*{\@ptsize}{30}\renewcommand*{\@memptsize}{30}} \DeclareOption{36pt}{\renewcommand*{\@ptsize}{36}\renewcommand*{\@memptsize}{36}} \DeclareOption{48pt}{\renewcommand*{\@ptsize}{48}\renewcommand*{\@memptsize}{48}} \DeclareOption{60pt}{\renewcommand*{\@ptsize}{60}\renewcommand*{\@memptsize}{60}} % \end{macrocode} % % \begin{macro}{\if@nyptsizeopt} % \begin{macro}{\@nyptsizeopttrue} % \begin{macro}{\@nyptsizeoptfalse} % \begin{macro}{\anyptfilebase} % \begin{macro}{\anyptsize} % For any point size: % \changes{v1.61803}{2008/02/29}{Added *pt option} % \begin{macrocode} \newif\if@nyptsizeopt \@nyptsizeoptfalse \providecommand*{\anyptfilebase}{mem} \providecommand*{\anyptsize}{10} \DeclareOption{*pt}{\@nyptsizeopttrue} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % % \subsection{Two-side or one-side printing} % % For two-sided printing we use the switch \cs{if@twoside}. In % addition we have to set the \cs{if@mparswitch} to get any margin % paragraphs into the outside margin. The default is \Lopt{twoside}. % \begin{macro}{\if@twoside} % \begin{macro}{\if@mparswitch} % \begin{macrocode} \DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue} \DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse} % \end{macrocode} % \end{macro} % \end{macro} % % % \subsection{Two column printing} % % Two-column and one-column printing is again realized via a switch % which is defined in the kernel. The default is single column printing. % % \begin{macro}{\if@twocolumn} % \begin{macrocode} \DeclareOption{onecolumn}{\@twocolumnfalse} \DeclareOption{twocolumn}{\@twocolumntrue} % \end{macrocode} % \end{macro} % % % \subsection{The \Lopt{draft} option} % % If the user requests \Lopt{draft} we show any overfull boxes, % marginal notes are allowed, and any copyright notices are not % printed. For symmetry, we also define a \Lopt{final} option % which is the default. % % The user can use the \cs{ifdraftdoc} flag to add additional effects: \\ % \verb?\ifdraftdoc \fi? % \begin{macro}{\ifdraftdoc} % \begin{macrocode} \newif\ifdraftdoc\draftdocfalse \setlength{\overfullrule}{\z@} \DeclareOption{final}{\setlength{\overfullrule}{\z@} \draftdocfalse \msdocfalse} \DeclareOption{draft}{\setlength\overfullrule{5pt}% \draftdoctrue \msdocfalse} % \end{macrocode} % \end{macro} % % \subsection{The \Lopt{ms} option} % % \begin{macro}{\ifmsdoc} % The \Lopt{ms} option makes the document look as though it was produced % on a typewriter. We use a flag for remembering this. The user may also % use the flag for specifying \Lopt{ms} effects. % \begin{macrocode} \newif\ifmsdoc \msdocfalse \DeclareOption{ms}{% \msdoctrue \draftdocfalse \setlength\overfullrule{\z@} } % \end{macrocode} % \end{macro} % % \subsection{The \Lopt{showtrims} option} % % The \Lopt{showtrims} option will display crosses at the corners % of the logical pages showing where the stock should be trimmed. % % \begin{macro}{\ifshowtrims} % \begin{macrocode} \newif\ifshowtrims \showtrimsfalse \DeclareOption{showtrims}{\showtrimstrue} % \end{macrocode} % \end{macro} % % \subsection{The \Lopt{article} option} % % The \Lopt{article} option typesets as a simulation of the % \Lpack{article} class. % \changes{v0.3}{2001/07/09}{Added article option} % \begin{macro}{\ifartopt} % \cs{ifartopt} is a flag (TRUE) if the \Lopt{article} option is called. % \begin{macrocode} \newif\ifartopt \artoptfalse \DeclareOption{article}{\artopttrue} % \end{macrocode} % \end{macro} % % \subsection{The \Lopt{subfigure} option} % % The \Lopt{subfigure} option has been made a no-op since version 1.1 % and finally removed in version 1.61803. It was: % \changes{v0.3}{2001/07/09}{Added subfigure option} % \changes{v1.1}{2002/03/10}{Effectively removed subfigure option} % \changes{v1.61803}{2008/01/30}{Removed subfigure option} % \begin{verbatim} % \DeclareOption{subfigure}{% % \ClassWarningNoLine{memoir}{The subfigure option is not required}} % \end{verbatim} % % \subsection{The openright, openleft and openany options} % % The \Lopt{openright} option specifies that Chapters must begin on % recto pages. The \Lopt{openleft} option specifies that Chapters % must begin on verso pages and the \Lopt{openany} option lets Chapters % start on any page. % \changes{v1.0}{2001/10/24}{Added the openleft option} % \begin{macrocode} \DeclareOption{openright}{\@openrighttrue} \DeclareOption{openany}{\@openrightfalse} \DeclareOption{openleft}{\@openlefttrue} % \end{macrocode} % % \begin{macro}{\openright} % \begin{macro}{\openany} % \begin{macro}{\openleft} % Commands that can be used to change the option in the middle of the % document\footnote{Openleft provided to meet a request by % Vladimir G.~Ivanovic (\texttt{vladimir@acm.org}) in September 2001.}. % \begin{macrocode} \newcommand{\openright}{\@openrighttrue\@openleftfalse% \gdef\clearforchapter{\cleartorecto}} \newcommand{\openany}{\@openrightfalse\@openleftfalse% \gdef\clearforchapter{\clearpage}} \newcommand{\openleft}{\@openlefttrue \gdef\clearforchapter{\cleartoverso}} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % \subsection{Equation numbering on the left} % % The \Lopt{leqno} option prints equation numbers on the left. This % is implemented via an external class option file. % \begin{macrocode} \DeclareOption{leqno}{\input{leqno.clo}} % \end{macrocode} % % \subsection{Flush left math displays} % % The \Lopt{fleqn} option redefines the displayed math environments % so that they are left adjusted with an indent of \cs{mathindent} % from the current left margin. This % is implemented via an external class option file. % \begin{macrocode} \DeclareOption{fleqn}{\input{fleqn.clo}} % \end{macrocode} % % \subsection{Open bibliography} % % The \Lopt{openbib} option redefines the \verb?thebibliography? so that each % block starts on a new line, and succeeding lines in a block are % indented by \cs{bibindent}. % \changes{v1.0a}{2001/11/28}{Replaced \cs{AtEndOfPackage} with \cs{AtEndOfClass}} % \begin{macrocode} \DeclareOption{openbib}{% \AtEndOfClass{% \renewcommand\@openbib@code{% \advance\leftmargin\bibindent \itemindent -\bibindent \listparindent \itemindent \parsep \z@ }% \renewcommand\newblock{\par}}} % \end{macrocode} % % \subsection{Old font commands} % % The \Lopt{oldfontcommands} option enables commands like \cs{bf} and friends. % \changes{v1.0a}{2002/01/29}{Added the oldfontcommands option} % \begin{macrocode} \DeclareOption{oldfontcommands}{\@memoldfonttrue} % \end{macrocode} % % \subsection{Extra font sizes} % % The \Lopt{extrafontsizes} options indicates that extended font sizes (above 25pt) % are available. % \changes{v1.61803}{2008/01/30}{Added extrafontsizes option.} % \begin{macrocode} \DeclareOption{extrafontsizes}{\extrafontsizestrue} % \end{macrocode} % % % \section{Executing Options} \label{sec:xopt} % % Here we execute the default options to initialize certain % variables. % \begin{macrocode} \ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside} % \end{macrocode} % % The \cs{ProcessOptions} command causes the execution of the code % for every option \Lopt{foo} % which is declared and for which the user typed % the \Lopt{foo} option in his % \cs{documentclass} command. For every option \Lopt{bar} he typed, % which is not declared, the option is assumed to be a global option. % All options will be passed as document options to any % \cs{usepackage} command in the document preamble. % \begin{macrocode} \ProcessOptions % \end{macrocode} % % \begin{macro}{\memoirpostopthook} % A user could define this \emph{before} the \cs{documentclass} command % to do something at this point. For example, to set up a new stock size: \\ % \verb?\def\memoirpostopthook{\stockheight=44in \stockwidth=34in}? % \changes{v1.618033}{2008/06/02}{Added \cs{memoirpostopthook}} % \begin{macrocode} \providecommand*{\memoirpostopthook}{} \memoirpostopthook % \end{macrocode} % \end{macro} % % \begin{macro}{\cleartorecto} % A repeat of \cs{cleardoublepage}; clears to a recto (odd-numbered) page. % \begin{macrocode} \def\cleartorecto{\clearpage\if@twoside \ifodd\c@page\else \hbox{}\thispagestyle{cleared}% \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\cleartoverso} % Clears to a verso (even-numbered) page. % \begin{macrocode} \def\cleartoverso{\clearpage\if@twoside \ifodd\c@page\hbox{}\thispagestyle{cleared}% \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi} % \end{macrocode} % \end{macro} % % Set \cs{clearforchapter} according to the options. % \begin{macrocode} \if@openleft \openleft \else \if@openright \openright \else \openany \fi \fi % \end{macrocode} % % \begin{macro}{\@ivpt} % \begin{macro}{\@xxxpt} % \begin{macro}{\@xxxvipt} % \begin{macro}{\@xlviiipt} % \begin{macro}{\@lxpt} % \begin{macro}{\@lxxiipt} % \begin{macro}{\@lxxxivpt} % \begin{macro}{\@xcvipt} % \begin{macro}{\@cviiipt} % \begin{macro}{\@cxxpt} % \begin{macro}{\@cxxxiipt} % \changes{v1.61803}{2008/01/30}{Added a bunch of \cs{@...pt} macros} % \begin{macrocode} \newcommand*{\@ivpt}{4} \newcommand*{\@xxxpt}{30} \newcommand*{\@xxxvipt}{36} \newcommand*{\@xlviiipt}{48} \newcommand*{\@lxpt}{60} \newcommand*{\@lxxiipt}{72} \newcommand*{\@lxxxivpt}{84} \newcommand*{\@xcvipt}{96} \newcommand*{\@cviiipt}{108} \newcommand*{\@cxxpt}{120} \newcommand*{\@cxxxiipt}{132} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % Now that all the options have been executed we can load the % chosen class option file that contains all size dependent code. The % larger sizes are only made available for the \Lopt{extrafontsizes} option. % % \begin{macro}{\memfontfamily} % \begin{macro}{\memfontenc} % \begin{macro}{\memfontpack} % The default font and coding as set by the kernel is \texttt{cmr} and % \texttt{OT1} respectively, giving Knuth's original Computer Modern Roman % font at a set of fixed sizes (maximum of 24.88pt). If we are to have % any size font we have to go to a scaleable font. As the Latin Modern font % is a scaleable version of Computer Modern, and all modern LaTeX distributions % include it, I am using this by default. % % By defining these three macros \emph{before} % the \cs{documentclass} any other font and package can be used. % \begin{macrocode} \providecommand*{\memfontfamily}{lmr} \providecommand*{\memfontenc}{T1} \providecommand*{\memfontpack}{lmodern} % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % Deal with the `anyptsize' (\Lopt{*pt}) option first. In this case the macros % \cs{anyptfilebase} and \cs{anyptsize} should have been defined by the % author \emph{before} the \cs{documentclass} command, and a file \\ % \verb?\anyptfilebase\anyptsize.clo? should exist (if not the file will % default to \verb?mem10.clo?). % \changes{v1.61803}{2008/01/30}{Extended the loading of \texttt{.clo} files.} % \begin{macrocode} \if@nyptsizeopt \newcommand*{\@nyptclofile}{\anyptfilebase\anyptsize.clo} \IfFileExists{\@nyptclofile}{\def\@memptsize{\anyptsize}}{% \@memerror{You have used the `*pt' option but \MessageBreak file \@nyptclofile\space can't be found}% {I'll use mem10.clo instead} \renewcommand*{\@nyptclofile}{mem10.clo}% \def\@memptsize{10}% } \renewcommand*{\@ptsize}{\@memptsize} \usefont{\memfontenc}{\memfontfamily}{m}{n} \input{\@nyptclofile} \usepackage{\memfontpack}\usepackage[\memfontenc]{fontenc} \else % \end{macrocode} % Now for the fixed pt size options. % \begin{macrocode} \ifextrafontsizes \usefont{\memfontenc}{\memfontfamily}{m}{n} \input{mem\@memptsize.clo} \usepackage{\memfontpack}\usepackage[\memfontenc]{fontenc} \else \ifnum\@memptsize > 17\relax \@memerror{The `extrafontsizes' option is required to use \MessageBreak the `\@memptsize pt' option}% {The 17pt option will be used instead} \input{mem17.clo} \else \ifnum\@ptsize = 9\relax \input{mem\@ptsize.clo} \else \input{mem1\@ptsize.clo} \fi \fi \fi \fi % % \end{macrocode} % % % \section{Fonts and spaces} \label{sec:docl} % \label{sec:maincode} % % In this section we deal with most of the aspects that are related % to font sizes, and spacing that is related to the size of the body font. % % \subsection{Fonts} % % \LaTeX\ offers the user commands to change the size of the font, % relative to the `main' size. Each relative size changing command % \cs{size} executes the command % \verb?\@setfontsize\size? \meta{font-size} \meta{baselineskip} where: % % \begin{description} % \item[\meta{font-size}] The absolute size of the font to use from % now on. % % \item[\meta{baselineskip}] The normal value of \cs{baselineskip} % for the size of the font selected. (The actual value will be % \cs{baselinestretch} * \meta{baselineskip}.) % \end{description} % % A number of commands, defined in the \LaTeX\ kernel, shorten the % following definitions and are used throughout. They are listed in % the first part of Table~\ref{tab:sh}. Those in the second part are introduced % by the class. % % \begin{table} % \centering % \caption{Shorthand font point size commands}\label{tab:sh} % \begin{tabular}{ll@{\qquad}ll@{\qquad}ll} \hline % & & & & \cs{@ivpt} & 4 \\ % \cs{@vpt} & 5 & \cs{@vipt} & 6 & \cs{@viipt} & 7 \\ % \cs{@viiipt} & 8 & \cs{@ixpt} & 9 & \cs{@xpt} & 10 \\ % \cs{@xipt} & 10.95 & \cs{@xiipt} & 12 & \cs{@xivpt} & 14.4\\ % \cs{@xviipt} & 17.28 & \cs{@xxpt} & 20.74 & \cs{@xxvpt} & 24.88\\ \hline % \cs{@xxxpt} & 30 & \cs{@xxxvipt} & 36 & \cs{@xlviiipt} & 48 \\ % \cs{@lxpt} & 60 & \cs{@lxxiipt} & 72 & \cs{@lxxxivpt} & 84 \\ % \cs{@xcvipt} & 96 & \cs{@cviiipt} & 108 & \cs{@cxxpt} & 120 \\ % \cs{@cxxxiipt} & 132 \\ \hline % \end{tabular} % \end{table} % % \begin{macro}{\normalsize} % \begin{macro}{\@normalsize} % % The user level command for the main size is \cs{normalsize}. % Internally \LaTeX\ uses \cs{@normalsize} when it refers to the % main size. \cs{@normalsize} will be defined to work like % \cs{normalsize} if the latter is redefined from its default % definition (that just issues an error message). Otherwise, in the standard % classes \cs{@normalsize} simply selects a 10pt/12pt size, but here % it selects among the wider range. % % The \cs{normalsize} macro also sets new values for\\ % \cs{abovedisplayskip}, \cs{abovedisplayshortskip} and % \cs{belowdisplayshortskip}. % % For the larger sizes I have set \cs{abovedisplayskip} to the font size % and \cs{belowdisplayshortskip} to 0.5\cs{onelineskip}. % % \begin{macrocode} %<*9pt|10pt|11pt|12pt|14pt|17pt|20pt|25pt|30pt|36pt|48pt|60pt> % \end{macrocode} % \changes{v0.11 (mem14.clo)}{2001/10/30}{Changed baseline skip from 17.28pt to 17.5pt} % \changes{v1.61803}{2008/01/30}{Added files mem20.clo through mem60.clo} % \changes{v1.61803}{2008/01/30}{Changed .clo files to accomodate \cs{extrafontsizes}} % \begin{macrocode} \renewcommand{\normalsize}{% %<*9pt> \@setfontsize\normalsize\@ixpt\@xpt \abovedisplayskip 9\p@ \@plus 2\p@ \@minus 4.5\p@ \abovedisplayshortskip \z@ \@plus 3\p@ \belowdisplayshortskip 5.5\p@ \@plus 2.5\p@ \@minus 3\p@ % %<*10pt> \@setfontsize\normalsize\@xpt\@xiipt \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ % %<*11pt> \@setfontsize\normalsize\@xipt{13.6}% \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ % %<*12pt> \@setfontsize\normalsize\@xiipt{14.5}% \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ % %<*14pt> \@setfontsize\normalsize\@xivpt{17.5}% \abovedisplayskip 14\p@ \@plus3\p@ \@minus8\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@ % %<*17pt> \@setfontsize\normalsize\@xviipt{22}% \abovedisplayskip 15\p@ \@plus4\p@ \@minus8\p@ \abovedisplayshortskip \z@ \@plus4\p@ \belowdisplayshortskip 8\p@ \@plus4\p@ \@minus3\p@ % %<*20pt> \@setfontsize\normalsize\@xxpt{25}% \abovedisplayskip 20\p@ \@plus5\p@ \@minus9\p@ \abovedisplayshortskip \z@ \@plus5\p@ \belowdisplayshortskip 12.5\p@ \@plus6\p@ \@minus3\p@ % %<*25pt> \@setfontsize\normalsize\@xxvpt{30}% \abovedisplayskip 25\p@ \@plus6\p@ \@minus10\p@ \abovedisplayshortskip \z@ \@plus6\p@ \belowdisplayshortskip 15\p@ \@plus7.5\p@ \@minus4\p@ % %<*30pt> \@setfontsize\normalsize\@xxxpt{37}% \abovedisplayskip 30\p@ \@plus7\p@ \@minus11\p@ \abovedisplayshortskip \z@ \@plus7\p@ \belowdisplayshortskip 18\p@ \@plus9\p@ \@minus4\p@ % %<*36pt> \@setfontsize\normalsize\@xxxvipt{45}% \abovedisplayskip 36\p@ \@plus8\p@ \@minus12\p@ \abovedisplayshortskip \z@ \@plus8\p@ \belowdisplayshortskip 22\p@ \@plus11\p@ \@minus5\p@ % %<*48pt> \@setfontsize\normalsize\@xlviiipt{60}% \abovedisplayskip 48\p@ \@plus9\p@ \@minus13\p@ \abovedisplayshortskip \z@ \@plus9\p@ \belowdisplayshortskip 30\p@ \@plus15\p@ \@minus7\p@ % %<*60pt> \@setfontsize\normalsize\@lxpt{72}% \abovedisplayskip 60\p@ \@plus10\p@ \@minus14\p@ \abovedisplayshortskip \z@ \@plus10\p@ \belowdisplayshortskip 36\p@ \@plus18\p@ \@minus9\p@ % % \end{macrocode} % The \cs{belowdisplayskip} is always equal to the % \cs{abovedisplayskip}. The parameters of the first level list are % always given by \cs{@listI}. % \begin{macrocode} \belowdisplayskip \abovedisplayskip \let\@listi\@listI} % \end{macrocode} % % We initially choose the normalsize font. % \begin{macrocode} \normalsize % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\small} % This code is similar to that for \cs{normalsize}. % (Robert Schlicht\footnote{\texttt{w.m.l@gmx.net}, via email on 2004/03/11.} % noted that in some cases \% signs were missing after \verb?\@setfontsize?). % % For the larger sizes I have set \cs{topsep} to 2/3\cs{onelineskip} % and \cs{parsep} to 1/2\cs{topsep}. % \changes{v1.61}{2004/03/12}{Added missing percent signs to some uses of % \cs{@setfontsize}} % \begin{macrocode} \newcommand{\small}{% %<*9pt> \@setfontsize\small\@viiipt{9.5}% \abovedisplayskip 6\p@ \@plus 2\p@ \@minus 4\p@ \abovedisplayshortskip \z@ \@plus 2\p@ \belowdisplayshortskip 4\p@ \@plus 2\p@ \@minus 2\p@ \def\@listi{\leftmargin\leftmargini \topsep 2\p@ \@plus 2\p@ \@minus 2\p@ \parsep 1\p@ \@plus\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*10pt> \@setfontsize\small\@ixpt{11}% \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus2\p@ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 4\p@ \@plus2\p@ \@minus2\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*11pt> \@setfontsize\small\@xpt\@xiipt \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 6\p@ \@plus2\p@ \@minus2\p@ \parsep 3\p@ \@plus2\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*12pt> \@setfontsize\small\@xipt{13.6}% \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 9\p@ \@plus3\p@ \@minus5\p@ \parsep 4.5\p@ \@plus2\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*14pt> \@setfontsize\small\@xiipt{14.5}% \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 11\p@ \@plus4\p@ \@minus6\p@ \parsep 6\p@ \@plus3\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*17pt> \@setfontsize\small\@xivpt{17}% \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 7\p@ \@plus4\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 11\p@ \@plus4\p@ \@minus6\p@ \parsep 6\p@ \@plus3\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*20pt> \@setfontsize\small\@xviipt{22}% \abovedisplayskip 17\p@ \@plus4\p@ \@minus8\p@ \abovedisplayshortskip \z@ \@plus4\p@ \belowdisplayshortskip 11\p@ \@plus4\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 14\p@ \@plus5\p@ \@minus7\p@ \parsep 7\p@ \@plus2\p@ \@minus3\p@ \itemsep \parsep}% % %<*25pt> \@setfontsize\small\@xxpt{25}% \abovedisplayskip 20\p@ \@plus5\p@ \@minus9\p@ \abovedisplayshortskip \z@ \@plus5\p@ \belowdisplayshortskip 12.5\p@ \@plus6\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 16\p@ \@plus5\p@ \@minus8\p@ \parsep 8\p@ \@plus3\p@ \@minus4\p@ \itemsep \parsep}% % %<*30pt> \@setfontsize\small\@xxvpt{30}% \abovedisplayskip 25\p@ \@plus6\p@ \@minus10\p@ \abovedisplayshortskip \z@ \@plus6\p@ \belowdisplayshortskip 15\p@ \@plus7.5\p@ \@minus4\p@ \def\@listi{\leftmargin\leftmargini \topsep 20\p@ \@plus7\p@ \@minus10\p@ \parsep 10\p@ \@plus4\p@ \@minus5\p@ \itemsep \parsep}% % %<*36pt> \@setfontsize\small\@xxxpt{37}% \abovedisplayskip 30\p@ \@plus7\p@ \@minus11\p@ \abovedisplayshortskip \z@ \@plus7\p@ \belowdisplayshortskip 18\p@ \@plus9\p@ \@minus4\p@ \def\@listi{\leftmargin\leftmargini \topsep 24\p@ \@plus8\p@ \@minus12\p@ \parsep 12\p@ \@plus4\p@ \@minus6\p@ \itemsep \parsep}% % %<*48pt> \@setfontsize\small\@xxxvipt{45}% \abovedisplayskip 36\p@ \@plus8\p@ \@minus12\p@ \abovedisplayshortskip \z@ \@plus8\p@ \belowdisplayshortskip 22\p@ \@plus11\p@ \@minus5\p@ \def\@listi{\leftmargin\leftmargini \topsep 30\p@ \@plus10\p@ \@minus15\p@ \parsep 15\p@ \@plus5\p@ \@minus7\p@ \itemsep \parsep}% % %<*60pt> \@setfontsize\small\@xlviiipt{60}% \abovedisplayskip 48\p@ \@plus9\p@ \@minus13\p@ \abovedisplayshortskip \z@ \@plus9\p@ \belowdisplayshortskip 30\p@ \@plus15\p@ \@minus7\p@ \def\@listi{\leftmargin\leftmargini \topsep 40\p@ \@plus13\p@ \@minus20\p@ \parsep 20\p@ \@plus6\p@ \@minus10\p@ \itemsep \parsep}% % \belowdisplayskip \abovedisplayskip } % \end{macrocode} % \end{macro} % % \begin{macro}{\footnotesize} % This code is similar to that for \cs{small}. % \begin{macrocode} \newcommand{\footnotesize}{% %<*9pt> \@setfontsize\footnotesize\@viipt{8}% \abovedisplayskip 6\p@ \@plus 2\p@ \@minus 4\p@ \abovedisplayshortskip \z@ \@plus 2\p@ \belowdisplayshortskip 4\p@ \@plus 2\p@ \@minus 2\p@ \def\@listi{\leftmargin\leftmargini \topsep 2\p@ \@plus 2\p@ \@minus 2\p@ \parsep 1\p@ \@plus\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*10pt> \@setfontsize\footnotesize\@viiipt{9.5}% \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus\p@ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 3\p@ \@plus\p@ \@minus\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*11pt> \@setfontsize\footnotesize\@ixpt{11}% \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@ \abovedisplayshortskip \z@ \@plus\p@ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ \def\@listi{\leftmargin\leftmargini \topsep 4\p@ \@plus2\p@ \@minus2\p@ \parsep 2\p@ \@plus\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*12pt> \@setfontsize\footnotesize\@xpt\@xiipt \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 6\p@ \@plus2\p@ \@minus2\p@ \parsep 3\p@ \@plus2\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*14pt> \@setfontsize\footnotesize\@xipt{13.6}% \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 6.5\p@ \@plus3.5\p@ \@minus3\p@ \parsep 4\p@ \@plus3\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*17pt> \@setfontsize\footnotesize\@xiipt{14}% \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 6.5\p@ \@plus3.5\p@ \@minus3\p@ \parsep 4\p@ \@plus3\p@ \@minus\p@ \itemsep \parsep %% \itemindent\z@ }% % %<*20pt> \@setfontsize\footnotesize\@xivpt{17.5}% \abovedisplayskip 14\p@ \@plus3\p@ \@minus8\p@ \abovedisplayshortskip \z@ \@plus3\p@ \belowdisplayshortskip 7\p@ \@plus3.5\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 12\p@ \@plus4\p@ \@minus6\p@ \parsep 6\p@ \@plus2\p@ \@minus3\p@ \itemsep \parsep}% % %<*25pt> \@setfontsize\footnotesize\@xviipt{22}% \abovedisplayskip 17\p@ \@plus4\p@ \@minus8\p@ \abovedisplayshortskip \z@ \@plus4\p@ \belowdisplayshortskip 11\p@ \@plus4\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 14\p@ \@plus5\p@ \@minus7\p@ \parsep 7\p@ \@plus2\p@ \@minus3\p@ \itemsep \parsep}% % %<*30pt> \@setfontsize\footnotesize\@xxpt{25}% \abovedisplayskip 20\p@ \@plus5\p@ \@minus9\p@ \abovedisplayshortskip \z@ \@plus5\p@ \belowdisplayshortskip 12.5\p@ \@plus6\p@ \@minus3\p@ \def\@listi{\leftmargin\leftmargini \topsep 16\p@ \@plus5\p@ \@minus8\p@ \parsep 8\p@ \@plus3\p@ \@minus4\p@ \itemsep \parsep}% % %<*36pt> \@setfontsize\footnotesize\@xxvpt{30}% \abovedisplayskip 25\p@ \@plus6\p@ \@minus10\p@ \abovedisplayshortskip \z@ \@plus6\p@ \belowdisplayshortskip 15\p@ \@plus7.5\p@ \@minus4\p@ \def\@listi{\leftmargin\leftmargini \topsep 20\p@ \@plus7\p@ \@minus10\p@ \parsep 10\p@ \@plus4\p@ \@minus5\p@ \itemsep \parsep}% % %<*48pt> \@setfontsize\footnotesize\@xxxpt{37}% \abovedisplayskip 30\p@ \@plus7\p@ \@minus11\p@ \abovedisplayshortskip \z@ \@plus7\p@ \belowdisplayshortskip 18\p@ \@plus9\p@ \@minus4\p@ \def\@listi{\leftmargin\leftmargini \topsep 24\p@ \@plus8\p@ \@minus12\p@ \parsep 12\p@ \@plus4\p@ \@minus6\p@ \itemsep \parsep}% % %<*60pt> \@setfontsize\footnotesize\@xxxvipt{45}% \abovedisplayskip 36\p@ \@plus8\p@ \@minus12\p@ \abovedisplayshortskip \z@ \@plus8\p@ \belowdisplayshortskip 22\p@ \@plus11\p@ \@minus5\p@ \def\@listi{\leftmargin\leftmargini \topsep 30\p@ \@plus10\p@ \@minus15\p@ \parsep 15\p@ \@plus5\p@ \@minus7\p@ \itemsep \parsep}% % \belowdisplayskip \abovedisplayskip } % \end{macrocode} % \end{macro} % % \begin{macro}{\miniscule} % \begin{macro}{\scriptsize} % \begin{macro}{\tiny} % \begin{macro}{\large} % \begin{macro}{\Large} % \begin{macro}{\LARGE} % \begin{macro}{\huge} % \begin{macro}{\Huge} % \begin{macro}{\HUGE} % These are all much simpler than the previous macros, they just % select a new fontsize, but leave the parameters for displays and % lists alone. The class provides two additional sizes, \cs{miniscule} % and \cs{HUGE}, with respect to the usual set. For the larger sizes (e.g., % 72pt and above) I have % made the \cs{baselineskip} approximately 20 precent larger than the pt size. % \changes{v1.2}{2002/07/27}{Added \cs{miniscule} and \cs{HUGE} font sizes} % \changes{v1.2}{2002/07/27}{Twiddled some font sizes to get regular steps} % \changes{v1.2a}{2002/08/27}{Fixed 12pt scriptsize bug} % \begin{macrocode} %<*9pt> \ifextrafontsizes \newcommand*{\miniscule}{\@setfontsize\miniscule\@ivpt{5}} \else \newcommand*{\miniscule}{\@setfontsize\miniscule\@vpt{6}} \fi \newcommand*{\tiny}{\@setfontsize\tiny\@vpt{6}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@vipt{7}} \newcommand*{\large}{\@setfontsize\large\@xpt{12}} \newcommand*{\Large}{\@setfontsize\Large\@xipt{13.6}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xiipt{14.5}} \newcommand*{\huge}{\@setfontsize\huge\@xivpt{18}} \newcommand*{\Huge}{\@setfontsize\Huge\@xviipt{22}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@xxpt{25}} % %<*10pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@vpt{6}} \newcommand*{\tiny}{\@setfontsize\tiny\@vipt{7}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@viipt{8}} \newcommand*{\large}{\@setfontsize\large\@xipt{13.6}} \newcommand*{\Large}{\@setfontsize\Large\@xiipt{14.5}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xivpt{18}} \newcommand*{\huge}{\@setfontsize\huge\@xviipt{22}} \newcommand*{\Huge}{\@setfontsize\Huge\@xxpt{25}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@xxvpt{30}} % %<*11pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@vipt{7}} \newcommand*{\tiny}{\@setfontsize\tiny\@viipt{8}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@viiipt{9.5}} \newcommand*{\large}{\@setfontsize\large\@xiipt{14.5}} \newcommand*{\Large}{\@setfontsize\Large\@xivpt{18}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xviipt{22}} \newcommand*{\huge}{\@setfontsize\huge\@xxpt{25}} \newcommand*{\Huge}{\@setfontsize\Huge\@xxvpt{30}} \ifextrafontsizes \newcommand*{\HUGE}{\@setfontsize\HUGE\@xxxpt{37}} \else \let\HUGE=\Huge \fi % %<*12pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@viipt{8}} \newcommand*{\tiny}{\@setfontsize\tiny\@viiipt{9.5}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@ixpt\@xpt} \newcommand*{\large}{\@setfontsize\large\@xivpt{18}} \newcommand*{\Large}{\@setfontsize\Large\@xviipt{22}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xxpt{25}} \newcommand*{\huge}{\@setfontsize\huge\@xxvpt{30}} \ifextrafontsizes \newcommand*{\Huge}{\@setfontsize\Huge\@xxxpt{37}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@xxxvipt{45}} \else \let\Huge=\huge \let\HUGE=\huge \fi % %<*14pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@viiipt{9.5}} \newcommand*{\tiny}{\@setfontsize\tiny\@ixpt{10}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xpt{12}} \newcommand*{\large}{\@setfontsize\large\@xviipt{22}} \newcommand*{\Large}{\@setfontsize\Large\@xxpt{25}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xxvpt{30}} \ifextrafontsizes \newcommand*{\huge}{\@setfontsize\Huge\@xxxpt{37}} \newcommand*{\Huge}{\@setfontsize\Huge\@xxxvipt{45}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@xlviiipt{60}} \else \let\huge=\LARGE \let\Huge=\LARGE \let\HUGE=\LARGE \fi % %<*17pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@ixpt{10}} \newcommand*{\tiny}{\@setfontsize\tiny\@xpt{12}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xipt{13.6}} \newcommand*{\large}{\@setfontsize\large\@xxpt{25}} \newcommand*{\Large}{\@setfontsize\Large\@xxvpt{30}} \ifextrafontsizes \newcommand*{\LARGE}{\@setfontsize\LARGE\@xxxpt{37}} \newcommand*{\huge}{\@setfontsize\huge\@xxxvipt{45}} \newcommand*{\Huge}{\@setfontsize\Huge\@xlviiipt{60}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@lxpt{72}} \else \let\LARGE=\Large \let\huge=\Large \let\Huge=\Large \let\HUGE=\Large \fi % %<*20pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xpt{12}} \newcommand*{\tiny}{\@setfontsize\tiny\@xipt{13.6}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xiipt{14.5}} \newcommand*{\large}{\@setfontsize\large\@xxvpt{30}} \newcommand*{\Large}{\@setfontsize\Large\@xxxpt{37}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xxxvipt{45}} \newcommand*{\huge}{\@setfontsize\huge\@xlviiipt{60}} \newcommand*{\Huge}{\@setfontsize\Huge\@lxpt{72}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@lxxiipt{86}} % %<*25pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xipt{13.6}} \newcommand*{\tiny}{\@setfontsize\tiny\@xiipt{14.5}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xivpt{17.5}} \newcommand*{\large}{\@setfontsize\large\@xxxpt{37}} \newcommand*{\Large}{\@setfontsize\Large\@xxxvipt{45}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xlviiipt{60}} \newcommand*{\huge}{\@setfontsize\huge\@lxpt{72}} \newcommand*{\Huge}{\@setfontsize\Huge\@lxxiipt{86}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@lxxxivpt{100}} % %<*30pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xiipt{14.5}} \newcommand*{\tiny}{\@setfontsize\tiny\@xivpt{17.5}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xviipt{22}} \newcommand*{\large}{\@setfontsize\large\@xxxvipt{45}} \newcommand*{\Large}{\@setfontsize\Large\@xlviiipt{60}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@lxpt{72}} \newcommand*{\huge}{\@setfontsize\huge\@lxxiipt{86}} \newcommand*{\Huge}{\@setfontsize\Huge\@lxxxivpt{100}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@xcvipt{116}} % %<*36pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xivpt{17.5}} \newcommand*{\tiny}{\@setfontsize\tiny\@xviipt{22}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xxpt{25}} \newcommand*{\large}{\@setfontsize\large\@xlviiipt{60}} \newcommand*{\Large}{\@setfontsize\Large\@lxpt{72}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@lxxiipt{86}} \newcommand*{\huge}{\@setfontsize\huge\@lxxxivpt{100}} \newcommand*{\Huge}{\@setfontsize\Huge\@xcvipt{116}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@cviiipt{132}} % %<*48pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xviipt{22}} \newcommand*{\tiny}{\@setfontsize\tiny\@xxpt{25}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xxvpt{30}} \newcommand*{\large}{\@setfontsize\large\@lxpt{72}} \newcommand*{\Large}{\@setfontsize\Large\@lxxiipt{86}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@lxxxivpt{100}} \newcommand*{\huge}{\@setfontsize\huge\@xcvipt{116}} \newcommand*{\Huge}{\@setfontsize\Huge\@cviiipt{132}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@cxxpt{144}} % %<*60pt> \newcommand*{\miniscule}{\@setfontsize\miniscule\@xxpt{25}} \newcommand*{\tiny}{\@setfontsize\tiny\@xxvpt{30}} \newcommand*{\scriptsize}{\@setfontsize\scriptsize\@xxxpt{37}} \newcommand*{\large}{\@setfontsize\large\@lxxiipt{86}} \newcommand*{\Large}{\@setfontsize\Large\@lxxxivpt{100}} \newcommand*{\LARGE}{\@setfontsize\LARGE\@xcvipt{116}} \newcommand*{\huge}{\@setfontsize\huge\@cviiipt{132}} \newcommand*{\Huge}{\@setfontsize\Huge\@cxxpt{144}} \newcommand*{\HUGE}{\@setfontsize\HUGE\@cxxxiipt{162}} % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % % \begin{macrocode} % %<*class> % \end{macrocode} % % \begin{macro}{\captionsize} % This internal command holds the font size for captions. % \begin{macrocode} \newcommand{\captionsize}{\normalsize} % \end{macrocode} % \end{macro} % % \subsection{Paragraphing} % % \begin{macro}{\lineskip} % \begin{macro}{\normallineskip} % These parameters control \TeX's behaviour when two lines tend to % come too close together. % \begin{macrocode} \setlength\lineskip{1\p@} \setlength\normallineskip{1\p@} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\baselinestretch} % This is used as a multiplier for \cs{baselineskip}. The default is % to \emph{not} stretch the baselines. % \begin{macrocode} \renewcommand{\baselinestretch}{} % \end{macrocode} % \end{macro} % % % \begin{macro}{\parskip} % \begin{macro}{\onelineskip} % % \cs{parskip} is additional vertical space between paragraphs; default % is zero. % % % \cs{onelineskip} is the default space between baselines. % \changes{v0.11 (mem14.clo)}{2001/10/30}{Changed \cs{onelineskip} from 17.28pt to 17.5pt} % \begin{macrocode} \setlength\parskip{0\p@ \@plus \p@} % %<*9pt|10pt|11pt|12pt|14pt|17pt|20pt|25pt|30pt|36pt|48pt|60pt> %<9pt>\setlength{\onelineskip}{\@xpt\p@} %<10pt>\setlength{\onelineskip}{\@xiipt\p@} %<11pt>\setlength{\onelineskip}{13.6\p@} %<12pt>\setlength{\onelineskip}{14.5\p@} %<14pt>\setlength{\onelineskip}{17.5\p@} %<17pt>\setlength{\onelineskip}{22\p@} %<20pt>\setlength{\onelineskip}{25\p@} %<25pt>\setlength{\onelineskip}{30\p@} %<30pt>\setlength{\onelineskip}{37\p@} %<36pt>\setlength{\onelineskip}{45\p@} %<48pt>\setlength{\onelineskip}{60\p@} %<60pt>\setlength{\onelineskip}{72\p@} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\parindent} % \cs{parskip} gives extra vertical space between paragraphs and % \cs{parindent} is the width of the paragraph indentation. % \begin{macrocode} \if@twocolumn \setlength\parindent{1em} \else %<9pt> \setlength\parindent{12\p@} %<10pt> \setlength\parindent{15\p@} %<11pt> \setlength\parindent{17\p@} %<12pt> \setlength\parindent{1.5em} %<14pt> \setlength\parindent{1.5em} %<17pt> \setlength\parindent{1.5em} %<20pt> \setlength\parindent{1.5em} %<25pt> \setlength\parindent{1.5em} %<30pt> \setlength\parindent{1.5em} %<36pt> \setlength\parindent{1.5em} %<48pt> \setlength\parindent{1.5em} %<60pt> \setlength\parindent{1.5em} \fi % % \end{macrocode} % \end{macro} % % \begin{macro}{\smallskipamount} % \begin{macro}{\medskipamount} % \begin{macro}{\bigskipamount} % The values for these three parameters are set in the LaTeX kernel. % Historically they have been size invariant, but I have changed them for % the larger sizes (\cs{smallskipamount} is 1/4 the fontsize, and the others % each double up on the next lower). % \changes{v1.61803}{2008/01/30}{(small/med/big)skips not invraiant for larger font sizes.} % \changes{v1.61803}{2008/01/30}{Changed (small/med/big)skips for 17pt} % \begin{macrocode} %<*9pt|10pt|11pt|12pt|14pt> \setlength\smallskipamount{3\p@ \@plus 1\p@ \@minus 1\p@} \setlength\medskipamount{6\p@ \@plus 2\p@ \@minus 2\p@} \setlength\bigskipamount{12\p@ \@plus 4\p@ \@minus 4\p@} % %<*17pt|20pt|25pt|30pt|36pt|48pt|60pt> %<*17pt> \setlength\smallskipamount{4\p@ \@plus1\p@ \@minus1\p@} \setlength\medskipamount{8\p@ \@plus2\p@ \@minus2\p@} \setlength\bigskipamount{17\p@ \@plus4\p@ \@minus4\p@} % %<*20pt> \setlength\smallskipamount{5\p@ \@plus1\p@ \@minus1\p@} \setlength\medskipamount{10\p@ \@plus2\p@ \@minus2\p@} \setlength\bigskipamount{20\p@ \@plus4\p@ \@minus4\p@} % %<*25pt> \setlength\smallskipamount{6\p@ \@plus1\p@ \@minus1\p@} \setlength\medskipamount{12\p@ \@plus2\p@ \@minus2\p@} \setlength\bigskipamount{24\p@ \@plus4\p@ \@minus4\p@} % %<*30pt> \setlength\smallskipamount{5\p@ \@plus1\p@ \@minus1\p@} \setlength\medskipamount{10\p@ \@plus2\p@ \@minus2\p@} \setlength\bigskipamount{20\p@ \@plus4\p@ \@minus4\p@} % %<*36pt> \setlength\smallskipamount{9\p@ \@plus2\p@ \@minus2\p@} \setlength\medskipamount{18\p@ \@plus4\p@ \@minus4\p@} \setlength\bigskipamount{36\p@ \@plus8\p@ \@minus8\p@} % %<*48pt> \setlength\smallskipamount{12\p@ \@plus3\p@ \@minus3\p@} \setlength\medskipamount{24\p@ \@plus6\p@ \@minus6\p@} \setlength\bigskipamount{48\p@ \@plus12\p@ \@minus12\p@} % %<*60pt> \setlength\smallskipamount{15\p@ \@plus4\p@ \@minus4\p@} \setlength\medskipamount{30\p@ \@plus8\p@ \@minus8\p@} \setlength\bigskipamount{60\p@ \@plus16\p@ \@minus16\p@} % % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % % \begin{macro}{\@lowpenalty} % \begin{macro}{\@medpenalty} % \begin{macro}{\@highpenalty}% % The commands \cs{nopagebreak} and \cs{nolinebreak} put in penalties % to discourage these breaks at the point they are put in. % They use \cs{@lowpenalty}, \cs{@medpenalty} or \cs{@highpenalty}, % dependent on their argument. % \begin{macrocode} %<*class> \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\clubpenalty} % \begin{macro}{\widowpenalty} % These penalties are used to discourage club and widow lines. % The default values are 150 each, but we want stronger discouragement. % \begin{macrocode} \clubpenalty 1000 \widowpenalty 1000 % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\displaywidowpenalty} % \begin{macro}{\predisplaypenalty} % \begin{macro}{\postdisplaypenalty} % Discourage, but do not prevent, widows in front of a math display % and forbid breaking directly in front of a display. Allow break % after a display without a penalty. The default values are % used, therefore we only show them here. % \begin{macrocode} % \displaywidowpenalty 50 % \predisplaypenalty 10000 % \postdisplaypenalty 0 % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\interlinepenalty} % Allow the breaking of a page in the middle of a paragraph. % \begin{macrocode} % \interlinepenalty 0 % \end{macrocode} % \end{macro} % % % \begin{macro}{\brokenpenalty} % We allow the breaking of a page after a hyphenated line. % \begin{macrocode} % \brokenpenalty 100 % \end{macrocode} % \end{macro} % % % % % \subsection{Vertical spacing} % % \begin{macro}{\headheight} % \begin{macro}{\headsep} % \begin{macro}{\topskip} % \begin{macro}{\footskip} % The \cs{headheight} is the height of the box that will contain the % running head. In this class it is point size dependent --- % \cs{onelineskip} (normally it is a constant 12pt). % % The \cs{headsep} is the distance between the bottom % of the running head and the top of the text. For the larger sizes % this is 1.8 times the fontsize. % % The \cs{topskip} is the \cs{baselineskip} for the first line on a page; % \LaTeX's output routine will not work properly if it has the % value 0pt, so do not do that! For the lareger sizes this is the font size. % % The distance from the baseline of the box which contains the % running footer to the baseline of last line of text is controlled % by the \cs{footskip}. For the larger sizes this is 2.5 times the % font size. % \changes{v0.11 (mem14.clo)}{2001/10/30}{Changed \cs{headheight} from 16pt to 17.5pt} % \changes{v0.11 (mem11.clo)}{2002/03/10}{Changed \cs{headheight} from 13pt to 13.6pt} % \begin{macrocode} % %<*9pt|10pt|11pt|12pt|14pt|17pt|20pt|25pt|30pt|36pt|48pt|60pt> %<*9pt> \setlength\headheight{11\p@} \setlength\headsep{.225in} \setlength\topskip{9\p@} \setlength\footskip{.33in} % %<*10pt> \setlength\headheight{12\p@} \setlength\headsep{.25in} \setlength\topskip{10\p@} \setlength\footskip{.35in} % %<*11pt> \setlength\headheight{13.6\p@} \setlength\headsep{.275in} \setlength\topskip{11\p@} \setlength\footskip{.38in} % %<*12pt> \setlength\headheight{14\p@} \setlength\headsep{.275in} \setlength\topskip{12\p@} \setlength\footskip{30\p@} % %<*14pt> \setlength\headheight{17.5\p@} \setlength\headsep{.30in} \setlength\topskip{14.4\p@} \setlength\footskip{.4in} % %<*17pt> \setlength\headheight{22\p@} \setlength\headsep{.30in} \setlength\topskip{14.4\p@} \setlength\footskip{.4in} % %<*20pt> \setlength\headheight{25\p@} \setlength\headsep{36\p@} \setlength\topskip{20\p@} \setlength\footskip{50\p@} % %<*25pt> \setlength\headheight{30\p@} \setlength\headsep{45\p@} \setlength\topskip{25\p@} \setlength\footskip{62\p@} % %<*30pt> \setlength\headheight{37\p@} \setlength\headsep{54\p@} \setlength\topskip{30\p@} \setlength\footskip{75\p@} % %<*36pt> \setlength\headheight{45\p@} \setlength\headsep{65\p@} \setlength\topskip{36\p@} \setlength\footskip{90\p@} % %<*48pt> \setlength\headheight{60\p@} \setlength\headsep{86\p@} \setlength\topskip{48\p@} \setlength\footskip{120\p@} % %<*60pt> \setlength\headheight{72\p@} \setlength\headsep{108\p@} \setlength\topskip{60\p@} \setlength\footskip{150\p@} % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\maxdepth} % \begin{macro}{\@maxdepth} % The \TeX\ primitive register \cs{maxdepth} has a function that is % similar to that of \cs{topskip}. The register \cs{@maxdepth} should % always contain a copy of \cs{maxdepth}. In both plain \TeX\ and % \LaTeX~2.09 \cs{maxdepth} had a fixed value of \texttt{4pt}; in % native \LaTeX 2e mode we let the value depend on the typesize. We % set it so that \cs{maxdepth} $+$ \cs{topskip} $=$ typesize $\times % 1.5$. As it happens, in these classes \cs{topskip} is equal to the % typesize, therefor we set \cs{maxdepth} to half the value of % \cs{topskip}. % \begin{macrocode} \setlength\maxdepth{.5\topskip} \setlength\@maxdepth\maxdepth % \end{macrocode} % \end{macro} % \end{macro} % % % % \subsection{Footnotes} % % \begin{macro}{\footnotesep} % \cs{footnotesep} is the height of the strut placed at the beginning % of every footnote. It equals the height of a normal \cs{footnotesize} % strut, so no extra space appears between footnotes. % \changes{v1.61803}{2007/01/30}{Changed nearly all \cs{footnotesep}} % \begin{macrocode} %<9pt>\setlength\footnotesep{5.6\p@} %<10pt>\setlength\footnotesep{6.65\p@} %<11pt>\setlength\footnotesep{7.7\p@} %<12pt>\setlength\footnotesep{8.4\p@} %<14pt>\setlength\footnotesep{9.5\p@} %<17pt>\setlength\footnotesep{10.15\p@} %<20pt>\setlength\footnotesep{12.6\p@} %<25pt>\setlength\footnotesep{15.4\p@} %<30pt>\setlength\footnotesep{17.5\p@} %<36pt>\setlength\footnotesep{21\p@} %<48pt>\setlength\footnotesep{25.9\p@} %<60pt>\setlength\footnotesep{31.5\p@} % \end{macrocode} % \end{macro} % % \begin{macro}{\footins} % \verb?\skip\footins? is the space between the last line of the main % text and the top of the first footnote. % \begin{macrocode} %<9pt>\setlength{\skip\footins}{8\p@ \@plus 2\p@ \@minus 2\p@} %<10pt>\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@} %<11pt>\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@} %<12pt>\setlength{\skip\footins}{10.8\p@ \@plus 4\p@ \@minus 2\p@} %<14pt>\setlength{\skip\footins}{13\p@ \@plus 4\p@ \@minus 2\p@} %<17pt>\setlength{\skip\footins}{16\p@ \@plus 5\p@ \@minus 3\p@} %<20pt>\setlength{\skip\footins}{19\p@ \@plus 7\p@ \@minus 3\p@} %<25pt>\setlength{\skip\footins}{24\p@ \@plus 8\p@ \@minus 4\p@} %<30pt>\setlength{\skip\footins}{29\p@ \@plus 10\p@ \@minus 5\p@} %<36pt>\setlength{\skip\footins}{35\p@ \@plus 12\p@ \@minus 6\p@} %<48pt>\setlength{\skip\footins}{47\p@ \@plus 16\p@ \@minus 8\p@} %<60pt>\setlength{\skip\footins}{59\p@ \@plus 20\p@ \@minus 10\p@} % \end{macrocode} % \end{macro} % % \subsection{Floats} % % \paragraph{Floats on a text page} % % \begin{macro}{\floatsep} % \begin{macro}{\textfloatsep} % \begin{macro}{\intextsep} % When a floating object is placed on a page with text, these % parameters control the separation between the float and the other % objects on the page. These parameters are used for both % one-column mode and single-column floats in two-column mode. % % \cs{floatsep} is the space between adjacent floats that are moved % to the top or bottom of the text page. For the larger sizes this is % \cs{bigskip}. % % \cs{textfloatsep} is the space between the main text and floats % at the top or bottom of the page. For the larger sizes this is % 1.45\cs{onelineskip}. % % \cs{intextsep} is the space between in-text floats and the text. % \begin{macrocode} %<*9pt> \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} % %<*10pt> \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} % %<*11pt> \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} \setlength\intextsep {12\p@ \@plus 2\p@ \@minus 2\p@} % %<*12pt> \setlength\floatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} \setlength\intextsep {14\p@ \@plus 4\p@ \@minus 4\p@} % %<*14pt> \setlength\floatsep {14\p@ \@plus 4\p@ \@minus 4\p@} \setlength\textfloatsep{20\p@ \@plus 4\p@ \@minus 4\p@} \setlength\intextsep {14\p@ \@plus 4\p@ \@minus 4\p@} % %<*17pt> \setlength\floatsep {15\p@ \@plus 4\p@ \@minus 4\p@} \setlength\textfloatsep{25\p@ \@plus 4\p@ \@minus 5\p@} \intextsep \floatsep % %<*20pt> \setlength\floatsep {20\p@ \@plus 4\p@ \@minus 4\p@} \setlength\textfloatsep{36\p@ \@plus 4\p@ \@minus 8\p@} \intextsep \floatsep % %<*25pt> \setlength\floatsep {24\p@ \@plus 4\p@ \@minus 4\p@} \setlength\textfloatsep{43\p@ \@plus 4\p@ \@minus 8\p@} \intextsep \floatsep % %<*30pt> \setlength\floatsep {30\p@ \@plus 6\p@ \@minus 6\p@} \setlength\textfloatsep{54\p@ \@plus 6\p@ \@minus 12\p@} \intextsep \floatsep % %<*36pt> \setlength\floatsep {36\p@ \@plus 8\p@ \@minus 8\p@} \setlength\textfloatsep{65\p@ \@plus 8\p@ \@minus 16\p@} \intextsep \floatsep % %<*48pt> \setlength\floatsep {48\p@ \@plus 12\p@ \@minus 12\p@} \setlength\textfloatsep{87\p@ \@plus 12\p@ \@minus 24\p@} \intextsep \floatsep % %<*60pt> \setlength\floatsep {60\p@ \@plus 16\p@ \@minus 16\p@} \setlength\textfloatsep{104\p@ \@plus 16\p@ \@minus 32\p@} \intextsep \floatsep % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\dblfloatsep} % \begin{macro}{\dbltextfloatsep} % When floating objects that span the whole \cs{textwidth} are placed % on a text page and \LaTeX{} is in twocolumn mode the separation % between the float and the text is controlled by \cs{dblfloatsep} % and \cs{dbltextfloatsep}. % % \cs{dblfloatsep} is the space between adjacent floats that are moved % to the top or bottom of the text page. % % \cs{dbltextfloatsep} is the space between the main text and floats % at the top or bottom of the page. % % \begin{macrocode} %<*9pt> \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % %<*10pt> \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % %<*11pt> \setlength\dblfloatsep {12\p@ \@plus 2\p@ \@minus 2\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % %<*12pt> \setlength\dblfloatsep {14\p@ \@plus 2\p@ \@minus 4\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % %<*14pt> \setlength\dblfloatsep {14\p@ \@plus 2\p@ \@minus 4\p@} \setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@} % %<*17pt> \setlength\dblfloatsep {15\p@ \@plus 4\p@ \@minus 4\p@} \setlength\dbltextfloatsep{25\p@ \@plus 5\p@ \@minus 5\p@} % %<*20pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % %<*25pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % %<*30pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % %<*36pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % %<*48pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % %<*60pt> \dblfloatsep \floatsep \dbltextfloatsep \textfloatsep % % \end{macrocode} % \end{macro} % \end{macro} % % \paragraph{Floats on their own page or column} % % \begin{macro}{\@fptop} % \begin{macro}{\@fpsep} % \begin{macro}{\@fpbot} % When floating objects are placed on separate pages the layout of % such pages is controlled by these parameters. At the top of the % page \cs{@fptop} amount of stretchable whitespace is inserted, at % the bottom of the page we get an \cs{@fpbot} amount of stretchable % whitespace. Between adjacent floats the \cs{@fpsep} is inserted. % For the larger sizes \cs{@fpsep} is .7\cs{onelineskip}. % % These parameters are used for the placement of floating objects % in one column mode, or in single column floats in two column % mode. % % Note that at least one of the two parameters \cs{@fptop} and % \cs{@fpbot} should contain a \verb?plus ...fil? to allow filling the % remaining empty space. % \begin{macrocode} %<*9pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{9\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*10pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{8\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*11pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{8\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*12pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{10\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*14pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{10\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*17pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{12\p@ \@plus 2fil} \setlength\@fpbot{0\p@ \@plus 1fil} % %<*20pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{17\p@ \@plus 2fil} \@fpbot \@fptop % %<*25pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{21\p@ \@plus 2fil} \@fpbot \@fptop % %<*30pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{26\p@ \@plus 2fil} \@fpbot \@fptop % %<*36pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{31\p@ \@plus 2fil} \@fpbot \@fptop % %<*48pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{42\p@ \@plus 2fil} \@fpbot \@fptop % %<*60pt> \setlength\@fptop{0\p@ \@plus 1fil} \setlength\@fpsep{50\p@ \@plus 2fil} \@fpbot \@fptop % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \begin{macro}{\@dblfptop} % \begin{macro}{\@dblfpsep} % \begin{macro}{\@dblfpbot} % Double column floats in two column mode are handled with similar % parameters. % \begin{macrocode} %<*9pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{7\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*10pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{8\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*11pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{8\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*12pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{10\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*14pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{12\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*17pt> \setlength\@dblfptop{0\p@ \@plus 1fil} \setlength\@dblfpsep{12\p@ \@plus 2fil} \setlength\@dblfpbot{0\p@ \@plus 1fil} % %<*20pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % %<*25pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % %<*30pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % %<*36pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % %<*48pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % %<*60pt> \@dblfptop \@fptop \@dblfpsep \@fpsep \@dblfpbot \@dblfptop % % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % % \subsection{The measure} % % The width of a line of text (and therefore the text block) is termed % the \emph{measure}. % % \begin{macro}{\lxvchars} % The length \cs{lxvchars} is the approximate length of a normal % text line containing 65 characters (a typesetters rule of thumb is % that there should be about 60--70 characters per line). % \begin{macrocode} %<9pt>\setlength\lxvchars{276\p@} % %<10pt>\setlength\lxvchars{300\p@} % standard 345pt %<11pt>\setlength\lxvchars{324\p@} % standard 360pt %<12pt>\setlength\lxvchars{336\p@} % standard 390pt %<14pt>\setlength\lxvchars{408\p@} % %<17pt>\setlength\lxvchars{444\p@} % %<20pt>\setlength\lxvchars{528\p@} % %<25pt>\setlength\lxvchars{626\p@} % %<30pt>\setlength\lxvchars{748\p@} % %<36pt>\setlength\lxvchars{891\p@} % %<48pt>\setlength\lxvchars{1177\p@} % %<60pt>\setlength\lxvchars{1463\p@} % % \end{macrocode} % \end{macro} % % \begin{macro}{\xlvchars} % The length \cs{xlvchars} is the approximate length of a normal % double column text line containing 45 characters % (a typesetters rule of thumb is % that there should be about 40--50 characters per column line). % \begin{macrocode} %<9pt>\setlength\xlvchars{192\p@} % %<10pt>\setlength\xlvchars{204\p@} % %<11pt>\setlength\xlvchars{216\p@} % %<12pt>\setlength\xlvchars{240\p@} % %<14pt>\setlength\xlvchars{288\p@} % %<17pt>\setlength\xlvchars{312\p@} % %<20pt>\setlength\xlvchars{365\p@} % %<25pt>\setlength\xlvchars{438\p@} % %<30pt>\setlength\xlvchars{518\p@} % %<36pt>\setlength\xlvchars{617\p@} % %<48pt>\setlength\xlvchars{815\p@} % %<60pt>\setlength\xlvchars{1014\p@} % % \end{macrocode} % \end{macro} % % \begin{macro}{\marginparsep} % \begin{macro}{\marginparpush} % \cs{marginparsep} is the horizontal space between the text block and % marginal notes, while \cs{marginparpush} is the minimum vertical % separation between the notes. % \begin{macrocode} \if@twocolumn %<*9pt|10pt|11pt|12pt|14pt> \setlength\marginparsep{10\p@} % %<*17pt|20pt|25pt|30pt|36pt|48pt|60pt> \setlength\marginparsep{1em} % \else %<*9pt|10pt|11pt|12pt|14pt> \setlength\marginparsep{7\p@} % %<*17pt|20pt|25pt|30pt|36pt|48pt|60pt> \setlength\marginparsep{0.7em} % \fi %<9pt|10pt|11pt>\setlength{\marginparpush}{5\p@} %<12pt|14pt>\setlength{\marginparpush}{7\p@} %<*17pt|20pt|25pt|30pt|36pt|48pt|60pt> \setlength\marginparpush{0.5em} % % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macrocode} % %<*class> % \end{macrocode} % % \section{Page Layout} % % % \subsection{The typeblock and margins} % % All margin dimensions are measured from a point one inch from the % top and lefthand side of the page. % % \begin{macro}{\setlxvchars} % \begin{macro}{\setxlvchars} % These were suggested and supplied by Morten H{\o}gholm (18 May 2003). % % \cs{setlxvchars}\oarg{fontspec} sets \cs{lxvchars} to the length of a line % containing 65 characters in the \meta{fontspec}. % % Similarly % \cs{setxlvchars}\oarg{fontspec} sets \cs{xlvchars} for 45 characters. % \changes{v1.4}{2003/11/22}{Added \cs{setlxvchars} and \cs{setxlvchars} % (from patch v1.6)} % \begin{macrocode} \newcommand*{\setlxvchars}[1][\normalfont]{\begingroup #1 \settowidth{\lxvchars}{abcdefghijklmnopqrstuvwxyz}% \setlength{\lxvchars}{2.042\lxvchars}% \addtolength{\lxvchars}{33.41pt}% \global\lxvchars=\lxvchars \endgroup} \newcommand*{\setxlvchars}[1][\normalfont]{\begingroup #1 \settowidth{\xlvchars}{abcdefghijklmnopqrstuvwxyz}% \setlength{\xlvchars}{1.415\xlvchars}% \addtolength{\xlvchars}{23.03pt}% \global\xlvchars=\xlvchars \endgroup} % \end{macrocode} % \end{macro} % \end{macro} % % \begin{macro}{\setrectanglesize} % The macro \cs{setrectanglesize}\marg{H}\marg{W}\marg{r} % calculates the height and width of a rectangle given any two out of % the three arguments. An unvalued argument is denoted by \verb?*?. % % Table~\ref{tab:setrect} shows the argument combinations and the result % for each combination. % \begin{table} % \centering % \caption{Arguments and results for \cs{setrectanglesize}}\label{tab:setrect} % \begin{tabular}{ccc|l} \hline % H & W & r & Result \\ \hline % * & W & r & $H = rW$ \\{} % * & W & * & $H = W$ \\{} % * & * & r & ambiguous \\{} % * & * & * & ambiguous \\{} % H & W & r & $H, W$ \\ % H & W & * & $H, W$ \\ % H & * & r & $W = rH$ \\ % H & * & * & $W = H$ \\ % \hline % \end{tabular} % \end{table} % % The % calculated height and width are stored in \cs{@tempdima} and \cs{@tempdimb} % respectively. Both lengths are set to zero if there is an error. % \changes{v1.61803}{2008/01/30}{Used \cs{setlength} instead of TeX syntax so that the calc package % can be used with page layout (Morten H{\o}gholm mempatch v4.5)} % \begin{macrocode} \newcommand*{\setrectanglesize}[3]{% \nametest{#1}{*}% \ifsamename % H = * \nametest{#2}{*}% \ifsamename % W = * \@memerror{% The combination of argument values is ambiguous.\MessageBreak The lengths will be set to zero}{\@ehd}% \setlength{\@tempdima}{0pt}% \setlength{\@tempdimb}{0pt}% \else % W \nametest{#3}{*}% \ifsamename % r = * \setlength{\@tempdimb}{#2}% \setlength{\@tempdima}{\@tempdimb}% \else % r \setlength{\@tempdimb}{#2}% \setlength{\@tempdima}{#3\@tempdimb}% \fi \fi \else % H \nametest{#2}{*}% \ifsamename % W = * \nametest{#3}{*}% \ifsamename % r = * \setlength{\@tempdima}{#1}% \setlength{\@tempdimb}{\@tempdima}% \else % r \setlength{\@tempdima}{#1}% \setlength{\@tempdimb}{#3\@tempdima}% \fi \else % W \setlength{\@tempdima}{#1}% \setlength{\@tempdimb}{#2}% \fi \fi} % \end{macrocode} % \end{macro} % % \begin{macro}{\setfillsize} % Consider a set of 4 lengths, $T$, $L$, $C$, and $R$, such that % $T = L + C + R$, where $T$ is a fixed size and normally $C$ is also fixed. % Also $L$ and $R$ may be specified independently of each other or as a % ratio (i.e., $L = rR$ or $R = rL$). % The macro % \cs{setfillsize}\marg{T}\marg{C}\marg{L}\marg{R}\marg{r} % maintains these constraints among the variables, where an unvalued % argument is denoted by \verb?*?. % % Table~\ref{tab:setfill} shows the argument combinations and the result % for each combination. % \begin{table} % \centering % \caption{Arguments and results for \cs{setfillsize}}\label{tab:setfill} % \begin{tabular}{cccc|ll} \hline % C & L & R & r & Result & \\ \hline % * & * & R & r & $L = rR$, & $C = T - L - R$ \\{} % * & * & R & * & $L = R$, & $C = T - L - R$ \\{} % * & * & * & r & ambigous & \\{} % * & * & * & * & ambiguous & \\{} % * & L & R & r & $L$, $R$, & $C = T - L - R$ \\{} % * & L & R & * & $L$, $R$, & $C = T - L - R$ \\{} % * & L & * & r & $R = rL$, & $C = T - L - R$ \\{} % * & L & * & * & $R = L$, & $C = T - L - R$ \\{} % C & * & R & r & $L = T - C - R$ & $C$ \\ % C & * & R & * & $L = T - C - R$, & $C$ \\ % C & * & * & r & $L + R = T - C$, $R = rL$, & $C$ \\ % C & * & * & * & $L + R = T - C$, $R = L$, & $C$ \\ % C & L & R & r & ambiguous & $C$ \\ % C & L & R & * & ambiguous & $C$ \\ % C & L & * & r & $R = T - C - L$, & $C$ \\ % C & L & * & * & $R = T - C - L$, & $C$ \\ % \hline % \end{tabular} % ^^A \MakeShortVerb{\|} % \end{table} % % % The % calculated values of \texttt{C}, \texttt{L} and \texttt{R} are stored % \cs{@tempdimc}, % \cs{@tempdima} and \cs{@tempdimb} respectively. If there is an error % the lengths are set to zero. % \begin{macrocode} \newcommand*{\setfillsize}[5]{% \nametest{#2}{*}% \ifsamename % C = * \nametest{#3}{*}% \ifsamename % L = * \nametest{#4}{*}% \ifsamename % R = * \@memerror{% The combination of argument values is ambiguous.\MessageBreak The lengths will be set to zero}{\@ehd} \setlength{\@tempdima}{0pt}% \setlength{\@tempdimb}{0pt}% \setlength{\@tempdimc}{0pt}% \else % R \nametest{#5}{*}% \ifsamename % r = * \setlength{\@tempdimb}{#4}% \setlength{\@tempdima}{\@tempdimb}% \setlength{\@tempdimc}{#1}% \advance\@tempdimc -\@tempdima \advance\@tempdimc -\@tempdimb \else % r \setlength{\@tempdimb}{#4}% \setlength{\@tempdima}{#5\@tempdimb}% \setlength{\@tempdimc}{#1}% \advance\@tempdimc -\@tempdima \advance\@tempdimc -\@tempdimb \fi \fi \else % L \nametest{#4}{*}% \ifsamename % R = *