summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/memoir/mempatch.dtx
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-06-02 14:38:57 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2008-06-02 14:38:57 +0000
commit82d52884d37b1a23afa751837ee5df24e03a99a4 (patch)
tree48ee8859c29f8239296f846b3b26a8d249ea5576 /Master/texmf-dist/source/latex/memoir/mempatch.dtx
parent968c2c8410e2d768d324c6f06c6a92395b77cf16 (diff)
memoir v1.61803
git-svn-id: svn://tug.org/texlive/trunk@8483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/memoir/mempatch.dtx')
-rwxr-xr-xMaster/texmf-dist/source/latex/memoir/mempatch.dtx6808
1 files changed, 9 insertions, 6799 deletions
diff --git a/Master/texmf-dist/source/latex/memoir/mempatch.dtx b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
index 9dd60a743ca..6808ffc1070 100755
--- a/Master/texmf-dist/source/latex/memoir/mempatch.dtx
+++ b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
@@ -2,7 +2,7 @@
%
% mempatch.dtx
% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-% Copyright 2001 --- 2007 Peter R. Wilson
+% Copyright 2001 --- 2008 Peter R. Wilson
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -19,7 +19,7 @@
%
%
% \fi
-% \CheckSum{7349}
+% \CheckSum{482}
%
% \def\dtxfile{\texttt{mempatch.dtx}}
% \def\fileversion{v1.0} \def\filedate{2003/10/04}
@@ -58,6 +58,8 @@
% \def\fileversion{v4.8} \def\filedate{2007/01/22}
% \def\fileversion{v4.9} \def\filedate{2007/12/14}
% \def\fileversion{v4.9a} \def\filedate{2007/12/24}
+% \def\fileversion{v4.9a+} \def\filedate{2007/12/31}
+% \def\fileversion{v5.0} \def\filedate{2008/05/26}
%
% \title{The LaTeX \Lpack{memoir} class for configurable book
% typesetting: Code patches\thanks{This
@@ -726,11 +728,9 @@
%
% \section{Patches for the class code} \label{sec:class}
%
-% At this date, 2005/09/25, with the simultaneous release of memoir v1.618
+% At this date, 2008/05/26, with the simultaneous release of memoir v1.61803
% and the patch file, by definition there are no patches.
%
-% Subsequently code patches were found to be required.
-%
% \subsection{Identification} \label{sec:id}
%
% \changes{v2.0}{2004/01/31}{No code in mempatch.sty}
@@ -789,6808 +789,18 @@
% ^^A \ProvidesFile{mempatch.sty}[2007/01/22 v4.8 Patches for memoir class v1.618]
% ^^A \ProvidesFile{mempatch.sty}[2007/12/14 v4.9 Patches for memoir class v1.618]
%
+% ^^A \ProvidesFile{mempatch.sty}[2007/12/24 v4.9a Patches for memoir class v1.618]
+% ^^A \ProvidesFile{mempatch.sty}[2007/12/31 v4.9a+ Patches for memoir class v1.618]
% \begin{macrocode}
-\ProvidesFile{mempatch.sty}[2007/12/24 v4.9a Patches for memoir class v1.618]
+\ProvidesFile{mempatch.sty}[2008/05/26 v5.0 Patches for memoir class v1.61803]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%% Version 4.0 was released simultaneously with version 1.618 of memoir.
+%%% Version 5.0 was released simultaneously with version 1.61803 of memoir.
%%% By definition there were no patches.
-%%% Most of the subsequent additions are noted in the Addendum.
-%%%
-%%% Version 4.3 introduces the \reparticle macro which is not in the
-%%% Addendum.
-%%%
-%%% Version 4.4 introduces several additional commands, in particular
-%%% the \book command provides a document division above Part. See the
-%%% code (towards the end) for details of the new commands.
-%%%
-%%% Version 4.5 introduces commands for switching trim marks off and on
-%%% and a \DisemulatePackage macro to negate a prior \EmulatedPackage.
-%%% It also provides the functions of the pagenote package for end notes.
-%%% See the code (near the end) for details.
-%%%
-%%% Version 4.6 fixes all known bugs and provides means of increasing
-%%% the interlinear and interparagraph spacing, adds some minor new commands,
-%%% and provides about a dozen more built-in chapterstyles.
-%%% See the code (near the end) for details.
-%%%
-%%% Version 4.7 fixes tiny bugs introduced in version 4.6
-%%%
-%%% Version 4.8 fixes some more little bugs.
-%%%
-%%% Version 4.9 fixes yet more bugs. It also provides means of formatting
-%%% page numbers in the ToC, etc., and improved control over line numbering
-%%% for verses and boxed verbatims.
-%%%
-%%% Version 4.9a fixes the (few) bugs in version 4.9.
-%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-% \end{macrocode}
-%
-%
-% \section{Mempatch version 4.1}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.1 (2005/10/03 and later)
-
-% \end{macrocode}
-%
-% \begin{macro}{\@ssect}
-% Gabriel Guernik on 2005/10/03 discovered that I had made a boo-boo with \cs{memsecstarinfo}
-% in \cs{@ssect} by calling it with 3 arguments when it only has two.
-% \changes{v4.1}{2005/10/03}{Fixed problem with \cs{memsecstarinfo} in
-% \cs{@ssect}}
-% \begin{macrocode}
-%%%% Use correct number of arguments for \memsecstarinfo (2 not 3).
-\def\@ssect#1#2#3#4#5{%
- \M@gettitle{#5}%
- \memsecstarinfo{\m@msecn@mame}{#5}%
- \@mem@old@ssect{#1}{#2}{#3}{#4}{#5}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Side captions}
-% \changes{v4.1}{2005/10/03}{Added all the code for side captions}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%
-%%%%%%%%%%%% Side captions
-%%%%%%%%%%%%
-
-% \end{macrocode}
-%
-% \begin{macro}{\m@mscap@capbox}
-% \begin{macro}{\m@mscap@fbox}
-% We need two save boxes, one to hold the caption and the other
-% for the float material.
-% \begin{macrocode}
-\newsavebox{\m@mscap@capbox}
-\newsavebox{\m@mscap@fbox}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidecapsep}
-% \begin{macro}{\sidecapwidth}
-% \cs{sidecapsep} is the space between the text and the caption, which
-% is set in a box \cs{sidecapwidth} wide. These are initialized to
-% the \cs{marginpar...} values.
-% \begin{macrocode}
-\newdimen\sidecapsep
- \sidecapsep=\marginparsep
-\newdimen\sidecapwidth
- \sidecapwidth=\marginparwidth
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@m@tempdima}
-% \begin{macro}{\m@mscapraise}
-% Lengths for internal use. \cs{m@m@tempdima} is meant for general
-% temporary use.
-% \begin{macrocode}
-\newdimen\m@m@tempdima
-\newdimen\m@mscapraise
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidecapraise}
-% Length to make (small) adjustments to the position of the caption wrt the float.
-% \begin{macrocode}
-\newdimen\sidecapraise
- \sidecapraise \z@
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setsidecappos}
-% \begin{macro}{\m@mscappos}
-% \cs{setsidecappos}\marg{pos}, where \meta{pos} is one of \texttt{t},
-% \texttt{c}, or \texttt{b}, sets the vertical position of the caption
-% in relation to the float and the result is saved as \cs{m@mscappos}.
-% The default is \texttt{c}.
-% \begin{macrocode}
-\newcommand*{\setsidecappos}[1]{%
- \def\m@mscappos{#1}\def\@tempb{t}%
- \ifx\@tempb\m@mscappos
- \else
- \def\@tempb{b}%
- \ifx\@tempb\m@mscappos
- \else
- \def\@tempb{c}%
- \ifx\@tempb\m@mscappos
- \else
- \@memerror{Argument to \string\setsidecappos\space is not t or c or b.
- \MessageBreak Set to c}{\@ehc}%
- \def\m@mscappos{c}%
- \fi
- \fi
- \fi}
-\setsidecappos{c}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidecapmargin}
-% \begin{macro}{\m@mscapmarg}
-% \cs{sidecapmargin}\marg{margin}, where \meta{marg} is one of
-% \texttt{left}, \texttt{right}, \texttt{inner}, or \texttt{outer},
-% controls the margin where the caption will be put. The result
-% is saved as \cs{m@mscapmarg} as a number. The default
-% is \texttt{left}.
-% \begin{macrocode}
-\newcommand{\sidecapmargin}[1]{%
- \def\@tempa{#1}\def\@tempb{left}%
- \ifx\@tempb\@tempa
- \def\m@mscapmarg{0}% left
- \else
- \def\@tempb{right}%
- \ifx\@tempb\@tempa
- \def\m@mscapmarg{1}% right
- \else
- \def\@tempb{outer}%
- \ifx\@tempb\@tempa
- \def\m@mscapmarg{2}% outer
- \else
- \def\@tempb{inner}%
- \ifx\@tempb\@tempa
- \def\m@mscapmarg{3}% inner
- \else
- \@memerror{Unrecognized argument for \string\sidecapmargin}%
- {\@ehc}%
- \def\m@mscapmarg{-1}% error
- \fi
- \fi
- \fi
- \fi}
-\sidecapmargin{left}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\ifscapmargleft}
-% \begin{macro}{\scapmarglefttrue}
-% \begin{macro}{\scapmargleftfalse}
-% \cs{ifscapmargleft} is TRUE the caption should be in the left hand margin,
-% otherwise in the right hand margin.
-% \begin{macrocode}
-\newif\ifscapmargleft
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidecapfloatwidth}
-% \begin{macro}{\m@mscapmainwidth}
-% \cs{sidecapfloatwidth} is the width of the box holding the float.
-% Note that this is a macro,
-% not a length, so must be changed using \cs{renewcommand*}.
-% The default is \cs{linewidth}. Later, \cs{m@mscapmainwidth} will be set
-% to the current length specification from \cs{sidecapfloatwidth}.
-% \begin{macrocode}
-\def\sidecapfloatwidth{\linewidth}
-\newdimen\m@mscapmainwidth
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@mscaplkern}
-% \begin{macro}{\setm@mscaplkern}
-% \cs{setm@mscaplkern} is a utility macro to calculate the kern
-% (\cs{m@mscaplkern}) required when the caption is in the left margin.
-% \begin{macrocode}
-\newdimen\m@mscaplkern
-\newcommand*{\setm@mscaplkern}{%
- \m@mscaplkern=\sidecapwidth
- \advance\m@mscaplkern \sidecapsep
- \advance\m@mscaplkern \m@mscapmainwidth}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidecapstyle}
-% \cs{sidecapstyle} is called just before the caption is set. It can
-% be redefined to set different caption style parameters. The default
-% is raggedleft for left margin captions and raggedright for right
-% margin captions.
-% \begin{macrocode}
-\newcommand*{\sidecapstyle}{%
-%%% \captionnamefont{\bfseries}%
- \ifscapmargleft
- \captionstyle{\raggedleft}%
- \else
- \captionstyle{\raggedright}%
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sidecaption}
-% The whole shebang is in the \texttt{sidecaption} environment but
-% it is more convenient to specify this via macros rather than
-% directly as an environment.
-%
-% \cs{sidecaption}\oarg{fortoc}\marg{title}\oarg{label} is what it
-% looks like to the user, but internally further macros handle
-% all the arguments.
-% \begin{macrocode}
-\newcommand*{\sidecaption}{%
- \@ifnextchar [{\@sidecaption}{\@sidecaption[]}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@sidecaption}
-% \cs{@sidecaption}\oarg{fortoc}\marg{title} grabs the first
-% two arguments.
-% \begin{macrocode}
-\def\@sidecaption[#1]#2{%
- \@ifnextchar [{\@@sidecaption{#1}{#2}}{\@@sidecaption{#1}{#2}[]}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@sidecaption}
-% \cs{@@sidecaption}\marg{fortoc}\marg{title}\oarg{label} is the
-% last macro in the chain and handles all three arguments.
-% This does all the work for \verb?\begin{sidecaption}?
-% \begin{macro}{\m@mscap@fortoc}
-% \begin{macro}{\m@mscap@forcap}
-% \begin{macro}{\m@mscaplabel}
-% First, save all the arguments as macros.
-% \begin{macrocode}
-\def\@@sidecaption#1#2[#3]{%
- \ifx\@empty#1\@empty
- \def\m@mscap@fortoc{#2}%
- \else
- \def\m@mscap@fortoc{#1}%
- \fi
- \def\m@mscap@forcap{#2}%
- \ifx\@empty#3\@empty
- \def\m@mscaplabel{}%
- \else
- \def\m@mscaplabel{\@bsphack\label{#3}\@esphack}%
- \fi
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% Set the float width, calculate the left margin kern, and start
-% a \texttt{minipage} to hold the float, saving it in box
-% \cs{m@mscap@fbox}.
-% \begin{macrocode}
- \m@mscapstart@fbox}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mscapstart@fbox}
-% \begin{macro}{\m@mscapend@fbox}
-% \cs{m@mscapstart@fbox} is the macro that actually sets the float width,
-% calculates the left margin kern, and starts the float's \texttt{minipage}.
-% The macro \cs{m@mscapend@fbox} ends the box.
-% \begin{macrocode}
-\newcommand*{\m@mscapstart@fbox}{%
- \setlength{\m@mscapmainwidth}{\sidecapfloatwidth}%
- \setm@mscaplkern
- \begin{lrbox}{\m@mscap@fbox}%
- \begin{minipage}[c]{\m@mscapmainwidth}}
-\newcommand*{\m@mscapend@fbox}{%
- \end{minipage}%
- \end{lrbox}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\endsidecaption}
-% \cs{endsidecaption} does the work for \verb?\end{sidecaption}?.
-%
-% Finish the float minipage, then increment the caption counter and
-% call \cs{label} via \cs{m@mscaplabel}.
-% \begin{macrocode}
-\def\endsidecaption{%
- \m@mscapend@fbox
- \refstepcounter\@captype
- \m@mscaplabel
-% \end{macrocode}
-% Set the caption inside a minipage, saving it in box \cs{m@mscap@capbox}.
-% \begin{macrocode}
- \begin{lrbox}{\m@mscap@capbox}%
- \begin{minipage}[c]{\sidecapwidth}%
- \sidecapstyle
- \@caption\@captype[\m@mscap@fortoc]{\m@mscap@forcap}
- \end{minipage}%
- \end{lrbox}%
-% \end{macrocode}
-% Output the float and caption.
-% \begin{macrocode}
- \m@mscapopboxes}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mscapopboxes}
-% Having determined how high the caption box must be raised with
-% respect to the float box, output the boxes.
-% \begin{macrocode}
-\newcommand*{\m@mscapopboxes}{%
- \m@mcalcscapraise
-% \end{macrocode}
-% Set the float (from box \cs{m@mscap@fbox}) then the caption (from
-% box \cs{m@mscap@capbox}) kerning it to the left or right as
-% appropriate.
-% \begin{macrocode}
- \usebox{\m@mscap@fbox}\m@mscapcheckside
- \ifscapmargleft%
- \rlap{\kern-\m@mscaplkern
- \raisebox{\m@mscapraise}{\usebox{\m@mscap@capbox}}}%
- \else%
- \rlap{\kern\sidecapsep
- \raisebox{\m@mscapraise}{\usebox{\m@mscap@capbox}}}%
- \fi
-% \end{macrocode}
-% Finally, make \cs{m@mscapthisside} a no-op.
-% \begin{macrocode}
- \gdef\m@mscapthisside{}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mcalcscapraise}
-% Calculate the amount the caption might have to be raised wrt the
-% float. This depends on the position: \\
-% \texttt{t:} raise by the difference in heights \\
-% \texttt{c:} shouldn't have to do anything as the minipages are meant
-% to center aligned \\
-% \texttt{b:} lower by the difference in depths \\
-%
-% However, experiments showed that a little bit of tweaking might
-% help. The final adjustment, \cs{sidecapraise} is controlled by
-% the user.
-% \begin{macrocode}
-\newcommand*{\m@mcalcscapraise}{%
- \def\@tempb{t}%
- \ifx\m@mscappos\@tempb
- \settoheight{\m@m@tempdima}{\strut\usebox{\m@mscap@capbox}}%
- \settoheight{\m@mscapraise}{\usebox{\m@mscap@fbox}}%
- \advance\m@mscapraise -\m@m@tempdima
- \advance\m@mscapraise 0.5ex
- \else
- \def\@tempb{b}%
- \ifx\m@mscappos\@tempb
- \settodepth{\m@m@tempdima}{\usebox{\m@mscap@fbox}}%
- \settodepth{\m@mscapraise}{\strut\usebox{\m@mscap@capbox}}%
- \advance\m@mscapraise -\m@m@tempdima
- \else
- \m@mscapraise=\z@
- \advance\m@mscapraise 0.25ex
- \fi
- \fi
- \advance\m@mscapraise \sidecapraise}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mscapcheckside}
-% This macro determines whether the caption should be set in the
-% left or right margin. In twocolumn documents the caption for a single
-% column float is always set in the adjacent margin. Starred floats
-% are treated as regular floats as in a onecolumn document.
-% \begin{macrocode}
-\newcommand*{\m@mscapcheckside}{%
- \if@twocolumn
- \ifdim\hsize=\textwidth% float*
- \m@mscapcheckregside
- \else
- \if@firstcolumn
- \scapmarglefttrue
- \else
- \scapmargleftfalse
- \fi
- \fi
- \else
- \m@mscapcheckregside
- \fi
-% \end{macrocode}
-% Finally apply any user's override.
-% \begin{macrocode}
- \m@mscapthisside}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mscapcheckregside}
-% This performs the margin calculation for onecolumn documents.
-% \changes{v4.1}{2005/11/21}{Fixed missing t in \cs{marglefttrue}, courtesy Jorgen Larsen}
-% \begin{macrocode}
-\newcommand*{\m@mscapcheckregside}{%
- \if@twoside
- \checkoddpage
- \ifnum\m@mscapmarg<\@ne% % left
- \scapmarglefttrue
- \else
- \ifnum\m@mscapmarg=\@ne% % right
- \scapmargleftfalse
- \else
- \ifnum\m@mscapmarg=\tw@% % outer
- \scapmarglefttrue
- \ifoddpage
- \scapmargleftfalse
- \fi
- \else% % inner
- \scapmargleftfalse
- \ifoddpage
- \scapmarglefttrue
- \fi
- \fi
- \fi
- \fi
- \else% oneside
- \scapmarglefttrue
- \ifnum\m@mscapmarg>\@ne
- \ifnum\m@mscapmarg<\thr@@
- \scapmargleftfalse
- \fi
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\overridescapmargin}
-% \begin{macro}{\m@mscapthisside}
-% User macro to override the calculated caption margin. Call as either:\\
-% \verb?\overridescapmargin{left}? or \verb?\overridescapmargin{right}? \\
-% \begin{macrocode}
-\newcommand*{\overridescapmargin}[1]{%
- \def\@tempb{#1}\def\@tempa{left}%
- \ifx\@tempa\@tempb
- \def\m@mscapthisside{\scapmarglefttrue}%
- \else
- \def\@tempa{right}%
- \ifx\@tempa\@tempb
- \def\m@mscapthisside{\scapmargleftfalse}%
- \else
- \@memerror{Argument to \string\overridescapmargin\space neither
- left nor right}{\@ehc}%
- \def\m@mscapthisside{}%
- \fi
- \fi}
-\newcommand*{\m@mscapthisside}{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% Now for the other kinds of captions.
-%
-% \begin{macro}{\sidecontcaption}
-% \cs{sidecontcaption}\marg{title}\oarg{label} is for
-% a continuation sidecaption.
-% \begin{macrocode}
-\newcommand*{\sidecontcaption}{%
- \@sidecontcaption}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@sidecontcaption}
-% \cs{@sidecontcaption}\marg{title} grabs the first
-% argument.
-% \begin{macrocode}
-\def\@sidecontcaption#1{%
- \@ifnextchar [{\@@sidecontcaption{#1}}{\@@sidecontcaption{#1}[]}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@sidecontcaption}
-% \cs{@@sidecontcaption}\marg{title}\oarg{label} is the
-% last macro in the chain and handles all two arguments.
-% This does all the work for \verb?\begin{sidecontcaption}?
-% \begin{macrocode}
-\def\@@sidecontcaption#1[#2]{%
- \def\m@mscap@forcap{#1}%
- \ifx\@empty#2\@empty
- \def\m@mscaplabel{}%
- \else
- \def\m@mscaplabel{\@bsphack\label{#2}\@esphack}%
- \fi
- \m@mscapstart@fbox}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\endsidecontcaption}
-% \cs{endsidecontcaption} does the work for \verb?\end{sidecontcaption}?.
-%
-% \begin{macrocode}
-\def\endsidecontcaption{%
- \m@mscapend@fbox
- \addtocounter{\@captype}{\m@ne}\refstepcounter\@captype
- \m@mscaplabel
- \begin{lrbox}{\m@mscap@capbox}%
- \begin{minipage}[c]{\sidecapwidth}%
- \sidecapstyle
- \@contcaption\@captype{\m@mscap@forcap}
- \end{minipage}%
- \end{lrbox}%
- \m@mscapopboxes}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\sidenamedlegend}
-% \begin{macro}{\@sidenamedlegend}
-% \cs{sidenamedlegend}\oarg{fortoc}\marg{title} is for
-% a namedlegend sidecaption.
-% \begin{macrocode}
-\newcommand*{\sidenamedlegend}{%
- \@ifnextchar [{\@sidenamedlegend}{\@sidenamedlegend[]}}
-\def\@sidenamedlegend[#1]#2{%
- \@@sidenamedlegend{#1}{#2}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@@sidenamedlegend}
-% \cs{@@sidenamedlegend}\marg{fortoc}\marg{title} is the
-% last macro in the chain and handles all arguments.
-% This does all the work for \verb?\begin{sidenamedlegend}?
-% \begin{macrocode}
-\def\@@sidenamedlegend#1#2{%
- \ifx\@empty#1\@empty
- \def\m@mscap@fortoc{#2}%
- \else
- \def\m@mscap@fortoc{#1}%
- \fi
- \def\m@mscap@forcap{#2}%
- \def\m@mscaplabel{}%
- \m@mscapstart@fbox}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\endsidenamedlegend}
-% \cs{endsidenamedlegend} does the work for \verb?\end{sidenamedlegend}?.
-% \begin{macrocode}
-\def\endsidenamedlegend{%
- \m@mscapend@fbox
- \begin{lrbox}{\m@mscap@capbox}%
- \begin{minipage}[c]{\sidecapwidth}%
- \sidecapstyle
- \@legend\@captype[\m@mscap@fortoc]{\m@mscap@forcap}
- \end{minipage}%
- \end{lrbox}%
- \m@mscapopboxes}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\sidelegend}
-% \cs{sidelegend}\marg{title} is for
-% a legend sidecaption.
-% \begin{macrocode}
-\newcommand*{\sidelegend}{%
- \@@sidelegend}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@@sidelegend}
-% \cs{@@sidelegend}\marg{title} is the
-% last macro in the chain and handles all arguments.
-% This does all the work for \verb?\begin{sidelegend}?
-% \begin{macrocode}
-\def\@@sidelegend#1{%
- \def\m@mscap@forcap{#1}%
- \m@mscapstart@fbox}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\endsidelegend}
-% \cs{endsidelegend} does the work for \verb?\end{sidelegend}?.
-% \begin{macrocode}
-\def\endsidelegend{%
- \m@mscapend@fbox
- \begin{lrbox}{\m@mscap@capbox}%
- \begin{minipage}[c]{\sidecapwidth}%
- \sidecapstyle
- \legend{\m@mscap@forcap}
- \end{minipage}%
- \end{lrbox}%
- \m@mscapopboxes}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \section{Mempatch version 4.2}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.2 (2005/11/21 and later)
-
-% \end{macrocode}
-%
-% \subsection{AtBegin/End...}
-%
-% 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.
-%
-% \begin{macrocode}
-%%%%%%%%%%%%
-%%%%%%%%%%%% Extensions to \AtBeginDocument
-%%%%%%%%%%%%
-
-% \end{macrocode}
-%
-% 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}
-%
-% \section{Mempatch version 4.3}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.3 (2005/12/13 and later)
-
-% \end{macrocode}
-%
-% \subsection{reparticle chapter style}
-%
-% The \verb?reparticle? chapterstyle replicates the appearance
-% of a \cs{section} in an \Lpack{article} class.
-%
-% \begin{macrocode}
-%%% Replicate the appearance of a \section in the article class
-\makechapterstyle{reparticle}{%
- \setlength{\beforechapskip}{3.5ex \@plus 1ex \@minus .2ex}%
- \renewcommand*{\chapterheadstart}{\vspace{\beforechapskip}}%
- \setlength{\afterchapskip}{2.3ex \@plus .2ex}%
- \renewcommand*{\printchaptername}{}%
- \renewcommand*{\chapternamenum}{}%
- \renewcommand*{\chaptitlefont}{\normalfont\Large\bfseries}%
- \renewcommand*{\chapnumfont}{\chaptitlefont}%
- \renewcommand*{\printchapternum}{\@hangfrom{\chapnumfont \thechapter\quad}}%
- \renewcommand*{\afterchapternum}{}}
-
-% \end{macrocode}
-%
-% \begin{macro}{\reparticle}
-% Call this to get division heads to replicate the \Lpack{article} class.
-% For example: \\
-% \verb?\ifartopt \reparticle \fi?
-% \begin{macrocode}
-%%% \reparticle redefines the higher level division heads fonts and spacing
-%%% to replicate the article class (but \chapter must still be used).
-%%% Use, for example like: \ifartopt \reparticle \fi
-\newcommand*{\reparticle}{%
- \chapterstyle{reparticle}%
- \setsecheadstyle{\large\bfseries\raggedright}%
- \setsubsecheadstyle{\normalsize\bfseries\raggedright}%
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \section{Mempatch version 4.4}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.4 (2006/01/06 and later)
-
-% \end{macrocode}
-%
-% \subsection{Captiontitlefinal}
-%
-% \begin{macro}{\captiontitlefinal}
-% \begin{macro}{\@makecaption}
-% \cs{captiontitlefinal}\marg{stuff} puts \meta{stuff} immediately at the
-% end of the caption's title text, but it will not appear the the LoF/LoT/etc.
-% The code was supplied by Frederic
-% Connes\footnote{\texttt{frederic@connes.org}} in an email to me on
-% 2005/12/28.
-% \changes{v4.4a}{2006/01/23}{Fixed \cs{@tewmpboxa} typo in \cs{@makecaption}}
-% \begin{macrocode}
-%%% \captiontitlefinal{<stuff>} will put <stuff> immediately at the
-%%% end of a \caption's title text and it will not appear in the
-%%% LoF/LoT/etc. For example: \captiontitlefinal{.}
-%%% (Code supplied by Frederic Connes)
-\newcommand*{\captiontitlefinal}[1]{\def\@contfinal{#1}}
-\captiontitlefinal{}
-
-\renewcommand{\@makecaption}[2]{\let\@memtempa\relax
- \ifdim\prevdepth>-99\p@ \vskip\abovecaptionskip
- \else \def\@memtempa{\vbox to\topskip{}}\fi
- \let\@contfnote\footnote \renewcommand{\footnote}[2][]{}%
- \let\@contfmark\footnotemark \renewcommand{\footnotemark}[1][]{}%
- \sbox\@tempboxa{\@contnfont #1\@contdelim \@conttfont #2\@contfinal}%
- \let\footnote\@contfnote
- \let\footnotemark\@contfmark
- \ifdim\wd\@tempboxa<\linewidth \centering\fi
- \if@contcw
- \centering
- \parbox{\@contcwidth}{%
- \ifdim\wd\@tempboxa<\@contcwidth \centering\fi
- \fi
- \if@conthang
- \sbox\@tempboxa{\@contnfont #1\@contdelim}%
- \@contpre%
- {\@contcstyle\hangindent=\wd\@tempboxa
- \noindent\box\@tempboxa\@memtempa \@conttfont #2\@contfinal\par}%
- \else
- \if@contindent
- \@contpre%
- {\@contnfont #1\@contdelim}\@memtempa
- {\@contcstyle\hangindent=\@contindw
- \hangafter=\@ne\@conttfont #2\@contfinal\par}% <- v1.4
- \else
- \@contpre%
- {\@contnfont #1\@contdelim}\@memtempa
- {\ifdim\wd\@tempboxa<\linewidth
- \@contcshortstyle\else \@contcstyle\fi% <- v1.4
- \@conttfont #2\@contfinal\par}%
- \fi
- \fi
- \@contpost
- \if@contcw
- \par
- }% end of the parbox
- \fi
- \vskip\belowcaptionskip}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{xindy and theindex}
-%
-% \begin{macro}{\ifm@mxindy}
-% \begin{macro}{\m@mxindytrue}
-% \begin{macro}{\m@mxindyfalse}
-% \begin{macro}{\xindyindex}
-% \begin{macro}{\@@wrspindexhyp}
-% Use \cs{xindyindex} when you are going to use the xindy program rather
-% than makeindex. hyperrefed entries won't work with xindy.
-% The code was supplied by Frederic
-% Connes\footnote{\texttt{frederic@connes.org}} in an email to me on
-% 2006/01/08.
-% \begin{macrocode}
-%%% Use the declaration \xindyindex if you will be using the xindy program
-%%% instead of MakeIndex to process index entries. As yet, xindy will not
-%%% hyperref any entries.
-%%% (Code supplied by Frederic Connes)
-\newif\ifm@mxindy
-\m@mxindyfalse
-\newcommand*{\xindyindex}{\m@mxindytrue}
-\def\@@wrspindexhyp#1|#2|#3\\{%
- \ifshowindexmark\@showidx{#1}\fi
- \ifx\\#2\\%
- \protected@write\@auxout{}%
- {\string\@@wrindexm@m{\@idxfile}%
- \ifm@mxindy{#1}\else{#1|hyperspindexpage(\thepage)}\fi
- {\@nameuse{the\@sptheidx}}}%
- \else
- \def\Hy@temp@A{#2}%
- \ifx\Hy@temp@A\HyInd@ParenLeft
- \protected@write\@auxout{}%
- {\string\@@wrindexm@m{\@idxfile}%
- \ifm@mxindy{#1|#2}\else{#1|#2hyperspindexpage(\thepage)}\fi
- {\@nameuse{the\@sptheidx}}}%
- \else
- \protected@write\@auxout{}%
- {\string\@@wrindexm@m{\@idxfile}{#1|#2}%
- {\@nameuse{the\@sptheidx}}}%
- \fi
- \fi
- \endgroup
- \@esphack}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{environment}{theindex}
-% Problem noted by Erik Quaeghebeur\footnote{\texttt{equaeghe@nospammail.net}}
-% in a CTT posting \textit{memoir, openleft and \cs{clear*page} commands} on
-% 2006/01/04 that an index did not start on a verso page when the
-% \textsf{openleft} option is in effect.
-% On 2006/12/06 Lars Madsen asked for an `indexpagestyle'. It's easier
-% to add it here than under version 4.6.
-% \begin{macrocode}
-\renewenvironment{theindex}{%
- \clearforchapter% <- added
- \if@twocolumn
- \@restonecolfalse
- \else
- \@restonecoltrue
- \fi
- \ifonecolindex
- \onecolumn
- \chapter*{\indexname}
- \preindexhook
- \else
- \setlength{\columnseprule}{\indexrule}%
- \setlength{\columnsep}{\indexcolsep}%
- \twocolumn[\@makeschapterhead{\indexname}
- \preindexhook]%
- \fi
- \indexmark
- \ifnoindexintoc\else
- \phantomsection
- \addcontentsline{toc}{chapter}{\indexname}
- \fi
-%%% \thispagestyle{chapter}\parindent\z@ % <- changed in v4.6
- \thispagestyle{indextitlepagestyle}\parindent\z@
- \parskip\z@ \@plus .3\p@\relax
- \let\item\@idxitem}%
- {\if@restonecol\onecolumn\else\twocolumn\fi}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \subsection{Verse numbering}
-%
-% \begin{macro}{\verselinebreak}
-% Aaron Rendahl (\texttt{arendahl@stat.umn.edu}) provided the \cs{ignorespaces}
-% fix for an extra indent when using \verb?\\>[0pt]? to end a verse line.
-% \changes{v4.4}{2006/01/14}{Added \cs{ignorespaces} to \cs{verselinebreak}}
-% \begin{macrocode}
-%%% \ignorespaces fix by Aaron Rendahl to remove extraneous space
-%%% with \\>[0pt] ending a verse line
-\renewcommand*{\verselinebreak}[1][\z@]{\newline\hspace*{#1}\ignorespaces}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\verselinenumbersright}
-% \begin{macro}{\verselinenumbersleft}
-% \begin{macro}{\@vslnumright}
-% \begin{macro}{\@vslnumleft}
-% \begin{macro}{\@vscentercr}
-% New declarations for setting verse line numbers at the right (default)
-% or at the left.
-% \changes{v4.4}{2006/01/15}{Added code for switching verse line numbers left/right}
-% \begin{macrocode}
-%%% Use the \verselinenumbersleft declaration to set verse line numbers
-%%% at the left. To later return to the default of setting them at the right
-%%% use the \verselinenumbersright declaration.
-\newcommand*{\verselinenumbersright}{\def\@vstypelinenum{\@vslnumright}}
-\newcommand*{\verselinenumbersleft}{\def\@vstypelinenum{\@vslnumleft}}
-\verselinenumbersright
-
-\newcommand*{\@vslnumright}{%
- \hfill\rlap{\kern\rightskip\kern\rightmargin%
- \vlvnumfont\getthelinenumber{poemline}}}
-\newcommand*{\@vslnumleft}{%
- \hfill\rlap{\kern-\textwidth\kern-\rightskip%
- \vlvnumfont\getthelinenumber{poemline}}}
-\renewcommand*{\@vscentercr}{%
- \ifhmode \unskip\else \@nolnerr\fi
- \@vstypelinenum%
- \@vsifgt{\verselinebreak}{%
- \incr@vsline
- \par\@ifstar{\nobreak\@vsxcentercr}{%
- \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}}}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Wrapped verbatims}
-%
-% \begin{macro}{\raggedwrap}
-% \begin{macro}{\wrappingon}
-% Paul (\texttt{paulaugust2003@yahoo.com}) found that wrapped verbatims in
-% a list environment (e.g. \texttt{itemize}) were not indented although
-% regular verbatims were.
-%
-% \cs{raggedwrap} is a variation on \cs{raggedright} (\cs{leftskip} is set
-% to \cs{@totalleftmargin} instead of 0pt). Hopefully this fix will not
-% mess up any existing wrapped verbatims.
-% \changes{v4.4}{2006/01/16}{Fixed surprise in wrapped verbatims}
-% \begin{macrocode}
-%%% Fix for wrapped verbatims in list environments.
-\newcommand*{\raggedwrap}{%
- \@rightskip\@flushglue
- \rightskip\@rightskip
- \leftskip\@totalleftmargin
- \parindent\ragrparindent}
-\renewcommand*{\wrappingon}{%
- \def\@xobeysp{~\discretionary{\verbatimbreakchar}%
- {\kern\verbatimindent}{}}%
- \def\wrapright{\raggedwrap}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Page after a Part heading}
-%
-% \begin{macro}{\partblankpage}
-% \begin{macro}{\nopartblankpage}
-% \begin{macro}{\ifm@mnopartnewpage}
-% \begin{macro}{\m@mnopartnewpagetrue}
-% \begin{macro}{\m@mnopartnewpagefalse}
-% \begin{macro}{\@endpart}
-% Code to prevent a \cs{part} outputting a blank page. Provided by
-% Frederic Connes.
-% \changes{v4.4}{2006/01/15}{Added controls for \cs{part} blank pages}
-% \begin{macrocode}
-%%% Use the \nopartblankpage declaration if you don't want a blank
-%%% page after a Part title page. The default is set by \partblankpage.
-\newif\ifm@mnopartnewpage
-\newcommand*{\partblankpage}{\m@mnopartnewpagefalse}
-\newcommand*{\nopartblankpage}{\m@mnopartnewpagetrue}
-
-\renewcommand*{\@endpart}{\afterpartskip
- \ifm@mnopartnewpage
- \else
- \if@twoside
- \if@openright
- \null
- \thispagestyle{afterpart}%
- \newpage
- \fi
- \fi
- \fi
- \if@tempswa
- \twocolumn
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\partnumberline}
-% Let's make sure that there is a space between the part number and
-% title in the ToC.
-% \changes{v4.4}{2006/01/16}{Added space after part number in ToC}
-% \begin{macrocode}
-\renewcommand{\partnumberline}[1]{%
- \hb@xt@\@tempdima{%
- \cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb\space}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ps@afterpart}
-% \begin{macro}{\ps@book}
-% \begin{macro}{\ps@afterbook}
-% Some new page styles for the page after a Part page, and a Book and
-% its following page.
-% \begin{macrocode}
-\aliaspagestyle{afterpart}{empty}
-\aliaspagestyle{book}{empty}
-\aliaspagestyle{afterbook}{empty}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\midpartskip}
-% \changes{v4.9}{2007/11/30}{Changed space in \cs{midpartskip}.}
-% \begin{macrocode}
-\renewcommand{\midpartskip}{\par\vskip 2\onelineskip}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Book document division}
-%
-% Frederic Connes tells me that in French typography there is often
-% a sectional division above Part. He called this \cs{superpart} but
-% I think that \cs{book} more closely resembles the English usage.
-% He provided code for implementing his \cs{superpart}. (I have just
-% checked and the Chicago Manual of Style does have an example of
-% a Book, Part, Chapter, Subsection hierarchy).
-%
-% \begin{macro}{\book}
-% \begin{macro}{\book*}
-% Here we go with a \cs{book} division.
-% \changes{v4.4}{2006/01/15}{Added a \cs{book} division with all that that entails}
-% \begin{macrocode}
-%%% The \book (and \book*) document division is one level higher than
-%%% a \cs{part}. It has the same kind of controls over its appearance in
-%%% the body of the document and in the ToC as \part has.
-\newcommand*{\book}{%
- \@setupbook
- \secdef\@book\@sbook}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\bookmark}
-% \begin{macro}{\c@book}
-% \begin{macro}{\thebook}
-% \begin{macro}{\theHbook}
-% \begin{macro}{\toclevel@book}
-% Start of the setting up. \cs{theHbook} and \cs{toclevel@book} are for
-% \Lpack{hyperref}
-% \begin{macrocode}
-\newcommand*{\bookmark}[1]{}
-\newcounter{book} \setcounter{book}{0}
-\renewcommand*{\thebook}{\Roman{book}}
-\newcommand*{\theHbook}{\arabic{book}}
-\newcommand*{\toclevel@book}{-2}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\beforebookskip}
-% \begin{macro}{\midbookskip}
-% \begin{macro}{\afterbookskip}
-% \begin{macrocode}
-\newcommand*{\beforebookskip}{\null\vfil}
-\newcommand*{\midbookskip}{\par \vskip 2\onelineskip}
-\newcommand*{\afterbookskip}{\vfil\newpage}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@setupbook}
-% Start off the book page.
-% \begin{macrocode}
-\newcommand*{\@setupbook}{%
- \if@openright
- \cleardoublepage
- \else
- \clearpage
- \fi
- \thispagestyle{book}%
- \if@twocolumn
- \@tempswatrue
- \else
- \@tempswafalse
- \fi
- \beforebookskip}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\bookname}
-% \begin{macro}{\booknamefont}
-% \begin{macro}{\booknumfont}
-% \begin{macro}{\booktitlefont}
-% Specify the typesetting styles.
-% \begin{macrocode}
-\newcommand*{\bookname}{Book}
-\newcommand*{\booknamefont}{\normalfont\huge\bfseries}
-\newcommand*{\booknumfont}{\normalfont\huge\bfseries}
-\newcommand*{\booktitlefont}{\normalfont\Huge\bfseries}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\printbookname}
-% \begin{macro}{\booknamenum}
-% \begin{macro}{\printbooknum}
-% \begin{macro}{\printbooktitle}
-% \begin{macrocode}
-\newcommand*{\printbookname}{\booknamefont \bookname}
-\newcommand*{\booknamenum}{\space}
-\newcommand*{\printbooknum}{\booknumfont \thebook}
-\newcommand{\printbooktitle}[1]{\booktitlefont #1}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\membookinfo}
-% \begin{macro}{\membookstarinfo}
-% \changes{v4.9}{2007/08/26}{Made \cs{membookinfo} and \cs{membookstarinfo}
-% \cs{long}}
-% \begin{macrocode}
-\newcommand{\membookinfo}[3]{}
-\newcommand{\membookstarinfo}[1]{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@book}
-% \begin{macro}{\@sbook}
-% \begin{macrocode}
-\long\def\@book[#1]#2{%
- \M@gettitle{#1}%
- \phantomsection
- \ifnum\c@secnumdepth > -3\relax
- \refstepcounter{book}%
- \addcontentsline{toc}{book}%
- {\protect\booknumberline{\thebook}#1}%
- \membookinfo{\thebook}{#1}{#2}%
- \else
- \addcontentsline{toc}{book}{#1}%
- \membookinfo{}{#1}{#2}%
- \fi
- \bookmark{#1}%
- {\centering
- \interlinepenalty \@M
- \normalfont
- \ifnum \c@secnumdepth >-3\relax
- \printbookname \booknamenum \printbooknum
- \midbookskip
- \fi
- \printbooktitle{#2}\par}%
- \@endbook}
-
-\def\@sbook#1{%
- \M@gettitle{#1}%
- \phantomsection
- \membookstarinfo{#1}%
- {\centering
- \interlinepenalty \@M
- \normalfont
- \printbooktitle{#1}\par}%
- \@endbook}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\bookblankpage}
-% \begin{macro}{\nobookblankpage}
-% \begin{macro}{\ifm@mnobooknewpage}
-% \begin{macro}{\m@mnobooknewpagetrue}
-% \begin{macro}{\m@mnobooknewpagefalse}
-% \begin{macro}{\@endbook}
-% Code to prevent a \cs{book} outputting a blank page. Provided by
-% Frederic Connes.
-% \changes{v4.4}{2006/01/15}{Added controls for \cs{book} blank pages}
-% \begin{macrocode}
-%%% Use the \nobookblankpage declaration if you don't want a blank
-%%% page after a Book title page. The default is set by \bookblankpage.
-\newif\ifm@mnobooknewpage
-\newcommand*{\bookblankpage}{\m@mnobooknewpagefalse}
-\newcommand*{\nobookblankpage}{\m@mnobooknewpagetrue}
-
-\newcommand*{\@endbook}{\afterbookskip
- \ifm@mnobooknewpage
- \else
- \if@twoside
- \if@openright
- \null
- \thispagestyle{afterbook}%
- \newpage
- \fi
- \fi
- \fi
- \if@tempswa
- \twocolumn
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\cftbookname}
-% \begin{macro}{\cftbookbreak}
-% \begin{macro}{\l@book}
-% \begin{macro}{\booknumberline}
-% Now for the ToC entry.
-% \changes{v4.9a}{2007/12/24}{Added \cs{cftbookbreak}}
-% \begin{macrocode}
-\newcommand*{\cftbookname}{}
-\newcommand*{\cftbookbreak}{\addpenalty{-\@highpenalty}%
- \addvspace{\cftbeforebookskip}}
-\newcommand*{\l@book}[2]{%
- \ifnum\c@tocdepth >-3\relax
-%% \addpenalty{-\@highpenalty}%
- \cftbookbreak
-%% \addvspace{\cftbeforebookskip}%
- \begingroup
- {\leftskip \cftbookindent\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
- \parindent \cftbookindent\relax\@afterindenttrue
- \interlinepenalty\@M
- \leavevmode
- \settowidth{\@tempdima}{\cftbookfont\cftbookname}%
- \addtolength{\@tempdima}{\cftbooknumwidth}%
- \let\@cftbsnum \cftbookpresnum
- \let\@cftasnum \cftbookaftersnum
- \let\@cftasnumb \cftbookaftersnumb
- \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
- {\cftbookfont #1}%
- \cftbookfillnum{#2}}
- \nobreak
- \global\@nobreaktrue
- \everypar{\global\@nobreakfalse\everypar{}}%
- \endgroup
- \fi}
-\newcommand{\booknumberline}[1]{%
- \hb@xt@\@tempdima{%
- \cftbookname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb\space}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\cftbeforebookskip}
-% \begin{macro}{\cftbookindent}
-% \begin{macro}{\cftbooknumwidth}
-% \begin{macro}{\cftbookfont}
-% \begin{macro}{\cftbookpresnum}
-% \begin{macro}{\cftbookaftersnum}
-% \begin{macro}{\cftbookaftersnumb}
-% \begin{macro}{\cftbookleader}
-% \begin{macro}{\cftbookdotsep}
-% \begin{macro}{\cftbookpagefont}
-% \begin{macro}{\cftbookafterpnum}
-% \begin{macro}{\cftbookfillnum}
-% \begin{macro}{\cftbookformatpnum}
-% \changes{v4.9}{2007/08/20}{Added \cs{cftbookformatpnum}}
-% \begin{macrocode}
-% ToC layout parameters.
-\newlength{\cftbeforebookskip}
- \setlength{\cftbeforebookskip}{2.25em \@plus\p@}
-\newdimen\cftbookindent
- \setlength{\cftbookindent}{0em}
-\newdimen\cftbooknumwidth
- \setlength{\cftbooknumwidth}{1.5em}
-\newcommand*{\cftbookfont}{\large\bfseries}
-\newcommand*{\cftbookpresnum}{}
-\newcommand*{\cftbookaftersnum}{}
-\newcommand*{\cftbookaftersnumb}{}
-\newcommand*{\cftbookleader}{%
- \large\bfseries\cftdotfill{\cftbookdotsep}}
-\newcommand*{\cftbookdotsep}{\cftnodots}
-\newcommand*{\cftbookpagefont}{\large\bfseries}
-\newcommand{\cftbookafterpnum}{}
-\newcommand{\cftbookfillnum}[1]{%
- {\cftbookleader}%
-%%%% {\hb@xt@\@pnumwidth{\hss {\cftbookpagefont #1}}}%
- \cftbookformatpnum{#1}%
- \cftbookafterpnum\par}
-\newcommand{\cftbookformatpnum}[1]{%
- \hb@xt@\@pnumwidth{\hss {\cftbookpagefont #1}}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@setclcnt}
-% Add the book to \cs{@setclcnt}
-% \begin{macrocode}
-\renewcommand*{\@setclcnt}[2]{%
- \@tempswafalse
- \nametest{#1}{none}%
- \ifsamename
- \setcounter{#2}{-10}%
- \@tempswatrue
- \fi
- \nametest{#1}{book}%
- \ifsamename
- \setcounter{#2}{-2}%
- \@tempswatrue
- \fi
- \nametest{#1}{part}%
- \ifsamename
- \setcounter{#2}{-1}%
- \@tempswatrue
- \fi
- \nametest{#1}{chapter}%
- \ifsamename
- \setcounter{#2}{0}%
- \@tempswatrue
- \fi
- \nametest{#1}{section}%
- \ifsamename
- \setcounter{#2}{1}%
- \@tempswatrue
- \fi
- \nametest{#1}{subsection}%
- \ifsamename
- \setcounter{#2}{2}%
- \@tempswatrue
- \fi
- \nametest{#1}{subsubsection}%
- \ifsamename
- \setcounter{#2}{3}%
- \@tempswatrue
- \fi
- \nametest{#1}{paragraph}%
- \ifsamename
- \setcounter{#2}{4}%
- \@tempswatrue
- \fi
- \nametest{#1}{subparagraph}%
- \ifsamename
- \setcounter{#2}{5}%
- \@tempswatrue
- \fi
- \nametest{#1}{all}%
- \ifsamename
- \setcounter{#2}{50}%
- \@tempswatrue
- \fi
- \if@tempswa\else
- \@memerror{%
- Unknown document division name (#1)
- }{%
- I'll ignore it.
- Type \space <return> and I'll continue.\MessageBreak
- If you haven't mistyped the name then use
- \protect\setcounter\space instead.}%
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\settocdepth}
-% Add \cs{book} to ToC depth setting.
-% \begin{macrocode}
-\renewcommand*{\settocdepth}[1]{%
- \@tempswafalse
- \nametest{#1}{none}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{-10}}%
- \@tempswatrue
- \fi
- \nametest{#1}{book}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{-2}}%
- \@tempswatrue
- \fi
- \nametest{#1}{part}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{-1}}%
- \@tempswatrue
- \fi
- \nametest{#1}{chapter}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{0}}%
- \@tempswatrue
- \fi
- \nametest{#1}{section}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{1}}%
- \@tempswatrue
- \fi
- \nametest{#1}{subsection}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{2}}%
- \@tempswatrue
- \fi
- \nametest{#1}{subsubsection}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{3}}%
- \@tempswatrue
- \fi
- \nametest{#1}{paragraph}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{4}}%
- \@tempswatrue
- \fi
- \nametest{#1}{subparagraph}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{5}}%
- \@tempswatrue
- \fi
- \nametest{#1}{all}%
- \ifsamename
- \addtocontents{toc}{\changetocdepth{50}}%
- \@tempswatrue
- \fi
- \if@tempswa
-% \end{macrocode}
-% The next bit is from Heiko Oberdiek (CTT {\itshape Re: Memoir, \verb?\settocdepth?
-% and pdflatex \verb?=>? problem with PDF bookmarks}, 2006/07/21) as
-% \Lpack{hyperref} needs \verb?\tocdepth? set in the body not just in the ToC.
-% \begin{macrocode}
- \@ifundefined{toclevel@#1}{%
- \@memwarn{Unknown toclevel for #1}%
- }{%
- \setcounter{tocdepth}{\@nameuse{toclevel@#1}}%
- }
- \else
- \@memerror{%
- Unknown document division name (#1)
- }{%
- I'll ignore it.
- Type \space <return> and I'll continue.}%
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\toclevel@none}
-% \begin{macro}{\toclevel@all}
-% Couple of extras for hypperef to cater for \texttt{all} and \texttt{none}
-% as `division levels'.
-% \begin{macrocode}
-\newcommand*{\toclevel@none}{-10}
-\newcommand*{\toclevel@all}{50}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \section{Mempatch version 4.5}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.5 (2006/02/11 and later)
-
-% \end{macrocode}
-%
-% \subsection{Odds and ends}
-%
-% \begin{macro}{\DisemulatePackage}
-% Undoes an \cs{EmulatedPackage}
-% \begin{macrocode}
-%%% \DisemulatePackage{pack} undoes a previous \EmulatedPackage{pack}.
-%%% For example \DisemulatePackage{index} if you need to use the index package.
-\providecommand*{\DisemulatePackage}[1]{%
- \@namelet{ver@#1.\@pkgextension}\relax}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@nameedef}
-% Add a missing \verb?%? (noticed by Lars Madsen).
-% \begin{macrocode}
-\renewcommand{\@nameedef}[1]{%
- \expandafter\protected@edef\csname #1\endcsname}
-
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@smemmain}
-% Change the timing of \cs{clear[double]page}. Problem noted by David Wilson
-% \url{David.Wilson@murdoch.edu.au} in email dated 2006/01/29. It now matches
-% the other \cs{...matter} macros.
-% \begin{macrocode}
-%%% change timing of \@mainmattertrue in \@smemmain
-\renewcommand*{\@smemmain}{%
- \ifartopt
- \clearpage
- \else
- \cleardoublepage
- \counterwithin{figure}{chapter}%
- \counterwithin{table}{chapter}%
- \fi
- \@mainmattertrue
- \setcounter{secnumdepth}{\value{maxsecnumdepth}}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@footnotetext}
-% This was fixed in v1.618, except that I unfixed it later in the class file.
-% This really should be done in a new class release, but it's not time for
-% that yet.
-% \begin{macrocode}
-\renewcommand{\@footnotetext}[1]{%
- \reset@font\m@mold@footnotetext{#1}\m@mmf@prepare}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ifm@mpn@new@chap}
-% \begin{macro}{\m@mpn@new@chapfalse}
-% \begin{macro}{\m@mpn@new@chaptrue}
-% \begin{macro}{\ifm@mpn@new@schap}
-% \begin{macro}{\m@mpn@new@schapfalse}
-% \begin{macro}{\m@mpn@new@schaptrue}
-% These are for supporting the page/end notes, flagging that a
-% \verb?\chapter(*)? has been called.
-% \begin{macrocode}
-\newif\ifm@mpn@new@chap
- \m@mpn@new@chapfalse
-\newif\ifm@mpn@new@schap
- \m@mpn@new@schapfalse
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@chapter}
-% \begin{macro}{\f@rbdy}
-% Fix from Lars Madsen for mistiming \verb?\chaptermark? in articles.
-% Also adding \verb?\m@m@new@chap? flag, and setting \verb?\f@rbdy?
-% to the chapter title for the body of the text.
-% \begin{macrocode}
-%%% Fix for mistiming of \chaptermark with article option
-\def\@chapter[#1]#2{%
- \m@mpn@new@chaptrue
- \def\f@rbdy{#2}%
- \ifx\ch@pt@c\@empty % no optional args
- \def\f@rtoc{#2}%
- \def\f@rhdr{#2}%
- \else % at least one opt arg
- \let\f@rtoc\ch@pt@c
- \ifx\@empty#1\@empty
- \let\f@rhdr\ch@pt@c
- \else
- \def\f@rhdr{#1}%
- \fi
- \fi
- \m@m@Andfalse
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \m@m@Andtrue
- \fi
- \fi
- \ifm@m@And
- \refstepcounter{chapter}%
- \fi
- \ifartopt
- \@makechapterhead{#2}%
- \@afterheading
- \chaptermark{\f@rhdr}%
- \else
- \chaptermark{\f@rhdr}%
- \insertchapterspace
- \if@twocolumn
- \@topnewpage[\@makechapterhead{#2}]%
- \else
- \@makechapterhead{#2}%
- \fi
- \@afterheading
- \fi
- \ifm@m@And
- \ifanappendix
- \addcontentsline{toc}{appendix}{%
- \protect\chapternumberline{\thechapter}\f@rtoc}%
- \memappchapinfo{\thechapter}{\f@rtoc}{\f@rhdr}{#2}%
- \else
- \addcontentsline{toc}{chapter}{%
- \protect\chapternumberline{\thechapter}\f@rtoc}%
- \memchapinfo{\thechapter}{\f@rtoc}{\f@rhdr}{#2}%
- \fi
- \else
- \addcontentsline{toc}{chapter}{\f@rtoc}%
- \ifanappendix
- \memappchapinfo{}{\f@rtoc}{\f@rhdr}{#2}%
- \else
- \memchapinfo{}{\f@rtoc}{\f@rhdr}{#2}%
- \fi
- \fi
- \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{\f@rtoc}\fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@schapter}
-% \begin{macro}{\@m@mschapter}
-% Make the same page/end note extensions to \verb?\@schapter?.
-% \begin{macrocode}
-\renewcommand{\@schapter}[1]{%
- \m@mpn@new@schaptrue
- \def\f@rbdy{#1}%
- \ifartopt
- \@makeschapterhead{#1}%
- \else
- \if@twocolumn
- \@topnewpage[\@makeschapterhead{#1}]
- \else
- \@makeschapterhead{#1}%
- \fi
- \fi
- \@afterheading}
-\renewcommand{\@m@mschapter}[2][\@empty]{%
- \@schapter{#2}%
- \ifx \@empty#1
- \def\f@rhdr{#2}%
- \else
- \def\f@rhdr{#1}%
- \setcounter{secnumdepth}{-10}%
- \chaptermark{#1}%
- \setcounter{secnumdepth}{\value{maxsecnumdepth}}%
- \fi
- \ifanappendix
- \memappchapstarinfo{\f@rhdr}{#2}%
- \else
- \memchapstarinfo{\f@rhdr}{#2}%
- \fi
- \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{#2}\fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \subsection{Switch trims on/off}
-%
-% \begin{macro}{\showtrimson}
-% \begin{macro}{\showtrimsoff}
-% \begin{macro}{\mem@shipii}
-% Switch trimming marks off and on. Requested by a James Hunt on CTT,
-% \emph{Are crop marks needed on every page?}, February 2006.
-% \begin{macrocode}
-%%%% Use \showtrimsoff and \showtrimson to switch trim marks off and on.
-%%%% If the showtrims option has not been used, these do nothing.
-\newcommand*{\showtrimsoff}{\showtrimsfalse}
-\newcommand*{\showtrimson}{\showtrimstrue}
-\renewcommand*{\mem@shipii}{%
- \ifvoid\@cclv
- \mem@oldshipout\box\@cclv
- \else
- \ifshowtrims
- \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
- \else
- \mem@oldshipout\box\@cclv
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Sidepars}
-%
-% \begin{macro}{\@sidepar}
-% Sidepars have a nasty habit of moving up or down depending on whether
-% characters in the sidepar and the main text line have ascenders and/or
-% descenders. The length \verb?\sideparvshift? was provided to
-% enable adjustments. This code from Dan Luecking
-% (CTT \textit{Re: sidepars drift up a point}, 2006/04/11) does a much
-% better job,
-% and the default for \verb?\sideparvshift? is now 0pt.
-% \begin{macrocode}
-%%%% Fix to stop \sidepars moving up or down
-\long\def\@sidepar[#1]#2{\@bsphack\strut\vadjust{%
- \checkoddpage
- \ifsideparswitch
- \ifreversesidepar
- \ifoddpage
- \oddpagefalse
- \else
- \oddpagetrue
- \fi
- \fi
- \else
- \oddpagetrue
- \ifreversesidepar
- \oddpagefalse
- \fi
- \fi
- \rlap{\kern-\parindent
- \if@twocolumn
- \if@firstcolumn% put at left
- \kern -\marginparsep \kern -\marginparwidth
- \else% put at right
- \kern \columnwidth \kern \marginparsep
- \fi
- \else
- \ifoddpage% put at right
- \kern \textwidth \kern \marginparsep
- \else% put at left
- \kern -\marginparsep \kern -\marginparwidth
- \fi
- \fi
- \setbox0=\vtop to 0pt{%
- \begin{minipage}[t]{\marginparwidth}%
-% \end{macrocode}
-% Normalise the font (suggested by Lars Madsen).
-% \changes{v4.9}{2007/05/02}{Normalised font in \cs{@sidepar}}
-% \begin{macrocode}
- \normalfont\normalsize
- \ifoddpage #2\else #1\fi%
- \end{minipage}%
- \vss}%
- \vtop to 0pt{\kern\sideparvshift% default should be 0pt
- \kern-\dp\strutbox
- \kern-\ht0
- \box0 \vss}}}%
- \@esphack}
-\setlength{\sideparvshift}{0pt}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Anonymous divisions}
-%
-% \begin{macro}{\@fbreak}
-% \begin{macro}{\@sfbreak}
-% The \verb?\fancybreak? macros start a paragraph and so should end it as well,
-% as noted by Dan Luecking (CTT \textit{Re: Appendix Package - adding
-% semicolon ``:'' after appendix letter in ToC} 2006/04/20).
-%
-% \begin{macrocode}
-%%%% Ensure that fancybreaks close the paragraph they start
-\renewcommand{\@fbreak}[1]{\par
- \penalty -100
- \noindent\parbox{\linewidth}{\centering #1}%
- \par
-% \penalty -20
- \@afterindentfalse
- \@afterheading}
-\renewcommand{\@sfbreak}[1]{\par
- \penalty -100
- \noindent\parbox{\linewidth}{\centering #1}%
- \par
-% \penalty -20
- \@afterindenttrue
- \@afterheading}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Vertically center text}
-%
-% \begin{environment}{vplace}
-% An environment which centers its body vertically. This is more robust
-% than that proposed in the manual. The optional argument, which is a
-% (decimal) number, increases ($>1.0$) or decreases ($<1.0$) the space
-% above the body with respect to that below.
-% \begin{macrocode}
-%%%% \begin{vplace}[<num>] vertically centered stuff \end{vplace}
-%%%% <num> adjusts above space wrt to below space
-\newenvironment{vplace}[1][1]{%
- \par\vspace*{\stretch{#1}}%
-}{%
- \vspace*{\stretch{1}}%
- \par}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \subsection{End notes}
-%
-% This is from the \Lpack{pagenote} package, with minor amendments.
-%
-% \begin{macrocode}
-%%%%
-%%%% Include the functions of the pagenote package
-%%%%
-
-% \end{macrocode}
-%
-% \begin{macro}{\ifm@mpnpageopt}
-% \begin{macro}{\ifm@mpncontopt}
-% We need two flags for the options.
-% \begin{macrocode}
-\newif\ifm@mpnpageopt
- \m@mpnpageoptfalse
-\newif\ifm@mpncontopt
- \m@mpncontoptfalse
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\notepageref}
-% \begin{macro}{\continuousnotenums}
-% Let the user change the default options.
-% \begin{macrocode}
-\newcommand*{\notepageref}{\m@mpnpageopttrue}
-\newcommand*{\continuousnotenums}{%
- \counterwithout{pagenote}{chapter}
- \renewcommand{\thepagenote}{\arabic{pagenote}}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\c@pagenote}
-% \begin{macro}{\thepagenote}
-% We need a counter for the notes. Just how it is defined depends on the
-% \Lopt{continuous} option.
-% \begin{macrocode}
-%\ifm@mpncontopt
-% \newcounter{pagenote}
-%\else
- \newcounter{pagenote}[chapter]
-%\fi
-\renewcommand{\thepagenote}{\arabic{pagenote}}
-\setcounter{pagenote}{0}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\ifmempagenotes}
-% Need to check if notes are required.
-% \begin{macrocode}
-\newif\ifmempagenotes
- \mempagenotesfalse
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\makepagenote}
-% This sets up the note file. At the end it emasculates itself so it can only
-% be used once.
-% \begin{macrocode}
-\newcommand*{\makepagenote}{%
- \newwrite\@notefile
- \immediate\openout\@notefile=\jobname.ent
- \mempagenotestrue
-% \end{macrocode}
-% \begin{macro}{\pagenote}
-% Make sure that this has a useful definition.
-% \begin{macrocode}
- \def\pagenote{\@bsphack\begingroup
- \@sanitize
- \m@m@wrpnote}%
-% \end{macrocode}
-% \end{macro}
-% \begin{macrocode}
- \typeout{Writing note file \jobname.ent}%
- \let\makepagenote\@empty}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\immediate@protected@write}
-% We might have to do some immediate writes. This is an immediate
-% version of the kernel \verb?\protected@write?.
-% \begin{macrocode}
-\newcommand{\immediate@protected@write}[3]{%
- \begingroup
- #2%
- \let\protect\@unexpandable@protect
- \edef\reserved@a{\immediate\write#1{#3}}%
- \reserved@a
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@m@pnwrite}
-% If the \Lopt{page} option is used we cannot use an immediate write
-% because the page number is only known in the output routine.
-% \begin{macrocode}
-\ifm@mpnpageopt
- \let\m@m@pnwrite\protected@write
-\else
- \let\m@m@pnwrite\immediate@protected@write
-\fi
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\pnchap}
-% \begin{macro}{\pnschap}
-% Redefine these for different subheadings in the notes list.
-% \begin{macrocode}
-\newcommand*{\pnchap}{\f@rtoc}
-\newcommand*{\pnschap}{\f@rbdy}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@m@wrpnote}
-% This writes the note information to the note file. It first increments the
-% note counter and calls \verb?\notenumintext? to handle its appearance in
-% the body text.
-% \begin{macrocode}
-\newcommand{\m@m@wrpnote}[2][]{%
- \refstepcounter{pagenote}%
- \notenumintext{\thepagenote}%
-% \end{macrocode}
-% Check if this is the first note in a division, and if so indicate this
-% in the file.
-% \begin{macrocode}
- \ifm@mpn@new@chap
- \global\m@mpn@new@chapfalse
- \addtonotes{\string\pagenotesubhead{\@chapapp}{\thechapter}{\pnchap}}%
- \fi
- \ifm@mpn@new@schap
- \global\m@mpn@new@schapfalse
- \addtonotes{\string\pagenotesubhead{\@chapapp}{}{\pnschap}}%
- \fi
-% \end{macrocode}
-% Finally, write the entry.
-% \begin{macrocode}
- \m@m@pnwrite\@notefile{}
- {\string\noteentry{\thepagenote}{#1}{#2}{\thepage}}%
- \endgroup
- \@esphack}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\pagenote}
-% The user command to generate a note. It is given substance
-% by \verb?\makepagenote?.
-% \begin{macrocode}
-\def\pagenote{\@bsphack\begingroup \@sanitize\m@m@pagenote}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@m@pagenote}
-% \begin{macrocode}
-\newcommand{\m@m@pagenote}[2][]{\endgroup\@esphack}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\pagetofootnote}
-% \begin{macro}{\foottopagenote}
-% \begin{macro}{\memsavefootnote}
-% \begin{macro}{\memsavepagenote}
-% Let the user change pagenotes to footnotes, or vice-versa. In either
-% case the optional argument is ignored.
-% \begin{macrocode}
-\newcommand*{\pagetofootnote}{%
- \let\memsavepagenote\pagenote
- \renewcommand{\pagenote}[2][]{\footnote{##2}}}
-\newcommand*{\foottopagenote}{%
- \let\memsavefootnote\footnote
- \renewcommand*{\footnote}[2][]{\pagenote{##2}}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\addtonotes}
-% \verb?\addtonotes?\marg{text} puts \meta{text} into the notes file.
-% \begin{macrocode}
-\newcommand{\addtonotes}[1]{%
- \ifmempagenotes
- \IfFileExists{\jobname.ent}{\m@m@pnwrite\@notefile{}{#1}}{\mempnofilewarn}%
-\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\notenumintext}
-% \begin{macro}{\notenuminnotes}
-% \verb?\notenumintext?\marg{notenum} typesets \meta{notenum} (in the body text).
-% \begin{macrocode}
-\newcommand{\notenumintext}[1]{%
- \textsuperscript{#1}}
-% \end{macrocode}
-% \verb?\notenuminnotes?\marg{notenum} typesets \meta{notenum} (as part of the note).
-% \begin{macrocode}
-\newcommand{\notenuminnotes}[1]{%
- {\normalfont #1.}\space}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\noteentry}
-% \verb?\noteentry?\marg{notenum}\marg{id}\marg{pagenum}\marg{text}
-% typesets a note.
-% \begin{macrocode}
-\newcommand{\noteentry}[4]{%
- \prenoteinnotes
- \noteidinnotes{#1}{#2}\pageinnotes{#4}\noteinnotes{#3}%
- \postnoteinnotes}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\idtextinnotes}
-% \verb?\idtextinnotes?\marg{id text} typesets the note's \meta{id text}.
-% \begin{macrocode}
-\newcommand{\idtextinnotes}[1]{%
- [#1]\space}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\noteidinnotes}
-% \verb?\noteidinnotes?\marg{notenum}\marg{id} is used to typeset the note
-% identification (in the note listing). It is set so that it typesets the
-% \meta{id} if it is not empty, otherwise it sets the \meta{notenum}.
-% \begin{macrocode}
-\newcommand{\noteidinnotes}[2]{%
- \@ifmtarg{#2}{%
- \notenuminnotes{#1}}{\idtextinnotes{#2}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\pageinnotes}
-% \begin{macro}{\printpageinnotes}
-% \verb?\pageinnotes?\meta{pagenum} calls
-% \verb?\printpageinnotes?\marg{pagenum} to typeset the originating
-% page number (in the note), but only if the \verb?\notepageref? declaration
-% has been used (the page number is not trustworthy unless the
-% \verb?\notepageref? has been used).
-% \begin{macrocode}
-\newcommand{\pageinnotes}[1]{%
- \ifm@mpnpageopt \printpageinnotes{#1}\fi}
-\newcommand*{\printpageinnotes}[1]{%
- (\pagerefname\ #1)\space}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\noteinnotes}
-% \verb?\noteinnotes?\marg{text} is used to typeset the note's text
-% (in the note list).
-% \begin{macrocode}
-\newcommand{\noteinnotes}[1]{#1}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\prenoteinnotes}
-% \begin{macro}{\postnoteinnotes}
-% These are called immediately before and after the note information is
-% typeset.
-% \begin{macrocode}
-\newcommand{\prenoteinnotes}{\par\noindent}
-\newcommand{\postnoteinnotes}{\par}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\notesname}
-% \begin{macro}{\notedivision}
-% Heading for note list.
-% \begin{macrocode}
-\providecommand*{\notesname}{Notes}
-\newcommand*{\notedivision}{\chapter{\notesname}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\printnotes}
-% \begin{macro}{\printpagenotes*}
-% User commands to print the note file.
-% \begin{macrocode}
-\newcommand*{\printpagenotes}{\@ifstar{\@sprintpagenotes}{\@printpagenotes}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\mempnofilewarn}
-% Warning when the notes file does not exist.
-% \begin{macrocode}
-\newcommand*{\mempnofilewarn}{%
- \ClassWarning{memoir}{There is no .ent file}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@sprintpagenotes}
-% Macro implementing \verb?\printpagenotes*?.
-% \begin{macrocode}
-\newcommand*{\@sprintpagenotes}{%
- \ifmempagenotes
- \notedivision
-\IfFileExists{\jobname.ent}{%
- \immediate\closeout\@notefile
- \input{\jobname.ent}%
- \immediate\openout\@notefile=\jobname.ent%
- }{%
- \mempnofilewarn
-}%
-\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@printpagenotes}
-% Macro implementing \verb?\printpagenotes?.
-% \begin{macrocode}
-\newcommand*{\@printpagenotes}{%
- \ifmempagenotes
- \notedivision
- \IfFileExists{\jobname.ent}{%
- \immediate\closeout\@notefile
- \input{\jobname.ent}%
- }{%
- \mempnofilewarn
- }
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\pagenotesubhead}
-% The section heading before each set of notes. \\
-% \verb?\pagenotesubhead?\marg{chaptername}\marg{number}\marg{title}
-% \begin{macrocode}
-\newcommand*{\pagenotesubhead}[3]{%
- \section*{#1 #2 #3}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% Prevent loading of the \Lpack{pagenote} package.
-% \begin{macrocode}
-\EmulatedPackage{pagenote}
-
-% \end{macrocode}
-%
-% \subsection{ToC, LoF, etc lists}
-%
-% Lars Madsen suggested that macros like \verb?\cftfigurename? be added for use
-% in the LoF, and so on.
-%
-% \begin{macro}{\@cftn@me}
-% \begin{macro}{\numberline}
-% \begin{macrocode}
-\newcommand*{\@cftn@me}{}
-\renewcommand*{\numberline}[1]{%
- \hb@xt@\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\newlistentry}
-% Extend \cs{newlistentry} to add \cs{cftXname}.
-% \changes{v4.8}{2007/01/22}{Added missing backslash in \cs{newlistentry}}
-% \begin{macrocode}
-\renewcommand*{\newlistentry}[4][\@empty]{%
- \@ifundefined{c@#2}{% check & set the counter
- \ifx \@empty#1\relax
- \newcounter{#2}% % added the backslash 2007/01/22 per J{\o}rgen Larsen
- \else
- \newcounter{#2}[#1]%
- \expandafter\edef\csname the#2\endcsname{%
- \expandafter\noexpand\csname the#1\endcsname.\noexpand\arabic{#2}}%
- \fi}{}
- \setcounter{#2}{0}
- \@namedef{l@#2}##1##2{%
- \ifnum \@nameuse{c@#3depth} > #4\relax
- \vskip \@nameuse{cftbefore#2skip}%
- {\leftskip \@nameuse{cft#2indent}\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
- \parindent \@nameuse{cft#2indent}\relax\@afterindenttrue
- \interlinepenalty\@M
- \leavevmode
- \settowidth{\@tempdima}{\@nameuse{cft#2font}\@nameuse{cft#2name}}%
- \addtolength{\@tempdima}{\@nameuse{cft#2numwidth}}%
-\expandafter\let\expandafter\@cftbsnum\csname cft#2presnum\endcsname
-\expandafter\let\expandafter\@cftasnum\csname cft#2aftersnum\endcsname
-\expandafter\let\expandafter\@cftasnumb\csname cft#2aftersnumb\endcsname
-\expandafter\let\expandafter\@cftn@me\csname cft#2name\endcsname
- \advance\leftskip\@tempdima \null\nobreak\hskip -\leftskip
- {\@nameuse{cft#2font}##1}\nobreak
- \@nameuse{cft#2fillnum}{##2}}
- \fi
- }% end of \l@#2
- \expandafter\newlength\csname cftbefore#2skip\endcsname
- \setlength{\@nameuse{cftbefore#2skip}}{\z@ \@plus .2\p@}
- \expandafter\newlength\csname cft#2indent\endcsname
- \expandafter\newlength\csname cft#2numwidth\endcsname
- \ifcase #4\relax% 0 (level 1)
- \setlength{\@nameuse{cft#2indent}}{0em}
- \setlength{\@nameuse{cft#2numwidth}}{2.3em}
- \or% 1 (level 2)
- \setlength{\@nameuse{cft#2indent}}{2.3em}
- \setlength{\@nameuse{cft#2numwidth}}{3.2em}
- \or% 2 (level 3)
- \setlength{\@nameuse{cft#2indent}}{5.5em}
- \setlength{\@nameuse{cft#2numwidth}}{4.1em}
- \or% 3 (level 4)
- \setlength{\@nameuse{cft#2indent}}{8.5em}
- \setlength{\@nameuse{cft#2numwidth}}{5.0em}
- \else% anything else
- \setlength{\@nameuse{cft#2indent}}{10.5em}
- \setlength{\@nameuse{cft#2numwidth}}{6.0em}
- \fi
- \@namedef{cft#2font}{\normalfont}
- \@namedef{cft#2name}{}
- \@namedef{cft#2presnum}{}
- \@namedef{cft#2aftersnum}{}
- \@namedef{cft#2aftersnumb}{}
- \@namedef{cft#2dotsep}{\cftdotsep}
- \@namedef{cft#2leader}{\normalfont\cftdotfill{\@nameuse{cft#2dotsep}}}
- \@namedef{cft#2pagefont}{\normalfont}
- \@namedef{cft#2afterpnum}{}
- \@namedef{cft#2toclevel@#2}{#4}
- \@namedef{cft#2formatpnum}##1{%
- \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#2pagefont}##1}}
- \@namedef{cft#2fillnum}##1{%
- {\@nameuse{cft#2leader}}\nobreak
-% \end{macrocode}
-% Dan Luecking (\ctt{} \textit{Re: setting page numbers in toc in their
-% natural-width box}, 15 August 2007) suggested that there should be a macro
-% here instead of:
-% \begin{verbatim}
-% \hb@xt@\@pnumwidth{%
-% \hfil\@nameuse{cft#2pagefont}##1}
-% \end{verbatim}
-% \changes{v4.9}{2007/08/20}{Changed \cs{newlistentry} to accomodate \cs{cftXformatpnum}}
-% \begin{macrocode}
- \@nameuse{cft#2formatpnum}{##1}%
- \@nameuse{cft#2afterpnum}\par}
-}% end of \newlistentry
-
-% \end{macrocode}
-% \end{macro}
-%
-% Now redo the \cs{newlistentry}s to effect the above changes.
-% \begin{macrocode}
-\let\cftbeforesectionskip\relax
-\let\cftsectionindent\relax
-\let\cftsectionnumwidth\relax
-\newlistentry[chapter]{section}{toc}{0}
- \cftsetindents{section}{1.5em}{2.3em}
-\let\cftbeforesubsectionskip\relax
-\let\cftsubsectionindent\relax
-\let\cftsubsectionnumwidth\relax
-\newlistentry[section]{subsection}{toc}{1}
- \cftsetindents{subsection}{3.8em}{3.2em}
-\let\cftbeforesubsubsectionskip\relax
-\let\cftsubsubsectionindent\relax
-\let\cftsubsubsectionnumwidth\relax
-\newlistentry[subsection]{subsubsection}{toc}{2}
- \cftsetindents{subsubsection}{7.0em}{4.1em}
-\let\cftbeforeparagraphskip\relax
-\let\cftparagraphindent\relax
-\let\cftparagraphnumwidth\relax
-\newlistentry[subsubsection]{paragraph}{toc}{3}
- \cftsetindents{paragraph}{10.0em}{5.0em}
-\let\cftbeforesubparagraphskip\relax
-\let\cftsubparagraphindent\relax
-\let\cftsubparagraphnumwidth\relax
-\newlistentry[paragraph]{subparagraph}{toc}{4}
- \cftsetindents{subparagraph}{12.0em}{6.0em}
-
-% \end{macrocode}
-%
-% \begin{macrocode}
-\let\cftbeforefigureskip\relax
-\let\cftfigureindent\relax
-\let\cftfigurenumwidth\relax
-\newlistentry[chapter]{figure}{lof}{0}
- \cftsetindents{figure}{0em}{2.3em}
-\let\cftbeforetableskip\relax
-\let\cfttableindent\relax
-\let\cfttablenumwidth\relax
-\newlistentry[chapter]{table}{lot}{0}
- \cftsetindents{table}{0em}{2.3em}
-
-% \end{macrocode}
-%
-% \begin{macro}{\cftpartformatpnum}
-% \begin{macro}{\cftpartfillnum}
-% \begin{macro}{\cftchapterformatpnum}
-% \begin{macro}{\cftchapterfillnum}
-% \changes{v4.9}{2007/08/20}{Added \cs{cftpartformatpnum} and \cs{cftchapterformatpnum}}
-% But we also have to change the \cs{part} and \cs{chapter} entries in the
-% ToC for the new \cs{cftXformatpnum} macros.
-% \begin{macrocode}
-\newcommand{\cftpartformatpnum}[1]{%
- \hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}
-\renewcommand{\cftpartfillnum}[1]{%
- {\cftpartleader}{\cftpartformatpnum{#1}}%
- \cftpartafterpnum\par}
-\newcommand{\cftchapterformatpnum}[1]{%
- \hb@xt@\@pnumwidth{\hfil{\cftchapterpagefont #1}}}
-\renewcommand{\cftchapterfillnum}[1]{%
- {\cftchapterleader}\nobreak\cftchapterformatpnum{#1}%
- \cftchapterafterpnum\par}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\cftpagenumberson}
-% We also have to change \cs{cftpagenumberson} to accomodate
-% \cs{cftXformatpnum}.
-% \changes{v4.9}{2007/08/20}{Modified \cs{cftpagenumberson} for \cs{cftXformatpnum}.}
-% \begin{macrocode}
-\DeclareRobustCommand{\cftpagenumberson}[1]{%
- \@namedef{cft#1fillnum}##1{%
- \@nameuse{cft#1leader}\nobreak
- \@nameuse{cft#1formatpnum}{##1}%
- \@nameuse{cft#1afterpnum}\par}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cftpartbreak}
-% \begin{macro}{\l@part}
-% \changes{v4.9a}{2007/12/24}{Added \cs{cftpartbreak}}
-% \begin{macrocode}
-\newcommand*{\cftpartbreak}{\addpenalty{-\@highpenalty}%
- \addvspace{\cftbeforepartskip}}
-\renewcommand*{\l@part}[2]{%
- \ifnum\c@tocdepth >-2\relax
-%% \addpenalty{-\@highpenalty}%
- \cftpartbreak
-%% \addvspace{\cftbeforepartskip}%
- \begingroup
- {\leftskip \cftpartindent\relax
- \rightskip \@tocrmarg
- \parfillskip -\rightskip
- \parindent \cftpartindent\relax\@afterindenttrue
- \interlinepenalty\@M
- \leavevmode
- \settowidth{\@tempdima}{\cftpartfont\cftpartname}%
- \addtolength{\@tempdima}{\cftpartnumwidth}%
- \let\@cftbsnum \cftpartpresnum
- \let\@cftasnum \cftpartaftersnum
- \let\@cftasnumb \cftpartaftersnumb
- \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
- {\cftpartfont #1}%
- \cftpartfillnum{#2}}
- \nobreak
- \global\@nobreaktrue
- \everypar{\global\@nobreakfalse\everypar{}}%
- \endgroup
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Page layout}
-%
-% Morten H{\o}gholm suggested (2006/07/26) that instead of using TeX syntax I should use
-% \verb?\setlength? when setting up the page layout so that the \Lpack{calc}
-% package can be used, e.g. \\
-% \verb?\settypeblocksize{41\baselineskip+\topskip}{310pt}{*}?
-%
-%
-% \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 \texttt{*}.
-%
-% 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.
-% \begin{macrocode}
-\renewcommand*{\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 \texttt{*}.
-%
-% 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}
-% \end{table}
-%
-%
-% The
-% calculated values of \meta{C}, \meta{L} and \meta{R} are stored in
-% \cs{@tempdimc}, \cs{@tempdima} and \cs{@tempdimb} respectively.
-% If there is an error the lengths are set to zero.
-% \begin{macrocode}
-\renewcommand*{\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 = *
- \nametest{#5}{*}%
- \ifsamename % r = *
- \setlength{\@tempdima}{#3}%
- \setlength{\@tempdimb}{\@tempdima}%
- \setlength{\@tempdimc}{#1}%
- \advance\@tempdimc -\@tempdima
- \advance\@tempdimc -\@tempdimb
- \else % r
- \setlength{\@tempdima}{#3}%
- \setlength{\@tempdimb}{#5\@tempdima}%
- \setlength{\@tempdimc}{#1}%
- \advance\@tempdimc -\@tempdima
- \advance\@tempdimc -\@tempdimb
- \fi
- \else % R
- \setlength{\@tempdima}{#3}%
- \setlength{\@tempdimb}{#4}%
- \setlength{\@tempdimc}{#1}%
- \advance\@tempdimc -\@tempdima
- \advance\@tempdimc -\@tempdimb
- \fi
- \fi
- \else % C is valued
- \nametest{#3}{*}%
- \ifsamename % L = *
- \nametest{#4}{*}%
- \ifsamename % R = *
- \nametest{#5}{*}%
- \ifsamename % r = *
- \setlength{\@tempdimc}{#2}%
- \setlength{\@tempdima}{#1}%
- \advance\@tempdima -\@tempdimc
- \@tempdima = 0.5\@tempdima
- \@tempdimb = \@tempdima
- \else % r (CODE PERHAPS FIXED)
- \setlength{\@tempdimc}{#2}%
- \setlength{\@tempdimb}{#1}% % T
- \advance\@tempdimb -\@tempdimc % T - C
- \@tempdima = 1000sp
- \@tempdima = #5\@tempdima % 1000r sp
- \advance\@tempdima by 1000sp % 1000(1+r)sp
- \@tempcnta = \@tempdima % 1000(1+r)
- \@tempdima = \@tempdimb % T - C
- \divide\@tempdima by \@tempcnta % (T-C)/1000(1+r) pts
- \@tempdima = 1000\@tempdima % (T-C)/(1+r) pts = L
- \advance\@tempdimb by -\@tempdima % = R
- \fi
- \else % R
- \setlength{\@tempdimc}{#2}%
- \setlength{\@tempdimb}{#4}%
- \setlength{\@tempdima}{#1}%
- \advance\@tempdima -\@tempdimc
- \advance\@tempdima -\@tempdimb
- \fi
- \else % L
- \nametest{#4}{*}%
- \ifsamename % R = *
- \setlength{\@tempdimc}{#2}%
- \setlength{\@tempdima}{#3}%
- \setlength{\@tempdimb}{#1}%
- \advance\@tempdimb -\@tempdimc
- \advance\@tempdimb -\@tempdima
- \else % 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}{#2}%
- \fi
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mclassicht}
-% The classic adjustment of the \cs{textheight} to get an integral number
-% of lines (given an integral number of baselineskips returns a height
-% giving one more line in the block).
-% \begin{macrocode}
-\newcommand*{\m@mclassicht}{%
- \setlength{\@tempdima}{\textheight}%
- \divide\@tempdima \baselineskip
- \@tempcnta=\@tempdima
- \setlength{\textheight}{\@tempcnta\baselineskip}%
- \addtolength{\textheight}{\topskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mlinesht}
-% The adjustment of the \cs{textheight} to get an integral number
-% of lines (given an inegral number of baselineskips returns a height
-% giving that number of lines).
-% \begin{macrocode}
-\newcommand*{\m@mlinesht}{%
- \setlength{\@tempdima}{\textheight}%
- \advance\@tempdima -\baselineskip
- \divide\@tempdima \baselineskip
- \@tempcnta=\@tempdima
- \setlength{\textheight}{\@tempcnta\baselineskip}%
- \addtolength{\textheight}{\topskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@mnearestht}
-% The adjustment of the \cs{textheight} to get an integral number
-% of lines with the calculated height being as the closest to the given
-% height. Algorithm supplied by Lars Madsen and Morten H{\o}gholm on
-% 2006/07/27.
-% \begin{macrocode}
-\newcommand*{\m@mnearestht}{%
- \setlength{\@tempdima}{\textheight}%
- \advance\@tempdima -\topskip
- \advance\@tempdima 0.5\baselineskip
- \divide\@tempdima \baselineskip
- \@tempcnta=\@tempdima
- \setlength{\textheight}{\@tempcnta\baselineskip}%
- \addtolength{\textheight}{\topskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\checkthelayout}
-% \cs{checkthelayout}\oarg{text} is the user level macro for
-% checking the layout. The \meta{text} argument controls which
-% algorithm should be used to calculate the \cs{textheight}.
-% \changes{v4.9}{2007/11/14}{Changed some page layout tests to negative from zero or negative}
-% \begin{macrocode}
-\renewcommand*{\checkthelayout}[1][classic]{%
-% \end{macrocode}
-% First check the dimensions are not negative.
-% \begin{macrocode}
- \@memnegtest{\trimedge}
- \@memnegtest{\trimtop}
- \@memznegtest{\stockwidth}
- \@memznegtest{\paperwidth}
- \@memznegtest{\textwidth}
-%%% \@memznegtest{\spinemargin}
- \@memnegtest{\spinemargin}
-%%% \@memznegtest{\foremargin}
- \@memnegtest{\foremargin}
- \@memznegtest{\marginparsep}
- \@memznegtest{\marginparwidth}
- \@memznegtest{\stockheight}
- \@memznegtest{\paperheight}
- \@memznegtest{\textheight}
-%%% \@memznegtest{\uppermargin}
- \@memnegtest{\uppermargin}
-%%% \@memznegtest{\lowermargin}
- \@memnegtest{\lowermargin}
-%%% \@memznegtest{\headheight}
- \@memnegtest{\headheight}
-%%% \@memznegtest{\headsep}
- \@memnegtest{\headsep}
-%%% \@memznegtest{\footskip}
- \@memnegtest{\footskip}
-% \end{macrocode}
-%
-% Carry on regardless. We may need to adjust the \cs{textheight}
-% to get an integral number of lines.
-% \begin{macrocode}
- \nametest{#1}{classic}%
- \ifsamename
- \m@mclassicht
- \else
- \nametest{#1}{lines}%
- \ifsamename
- \m@mlinesht
- \else
- \nametest{#1}{nearest}%
- \ifsamename
- \m@mnearestht
- \else
- \nametest{#1}{fixed}
- \ifsamename
- \else% not classic, lines, nearest, or fixed
- \@memerror{Optional argument is not one of:\MessageBreak
- classic, fixed, lines, or nearest. \MessageBreak
- I will assume the default}%
- {\@ehc}%
- \fi
- \fi
- \fi
- \fi
- \setulmargins{\uppermargin}{*}{*}
-% \end{macrocode}
-%
-% Check that all the sums add up correctly, or
-% at least to within a small (\cs{@tempdimb}) error.
-% \begin{macrocode}
- \@tempdimb = -1pt
- \@tempdima=\stockwidth
- \advance\@tempdima -\trimedge
- \advance\@tempdima -\paperwidth
- \ifdim\@tempdima<\@tempdimb
- \@tempdima = -\@tempdima
- \@memerror{\protect\paperwidth\space and/or
- \protect\trimedge\space
- are too large for \protect\stockwidth\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
- \@tempdima = \paperwidth
- \advance\@tempdima -\foremargin
- \advance\@tempdima -\textwidth
- \advance\@tempdima -\spinemargin
- \ifdim\@tempdima<\@tempdimb
- \@tempdima = -\@tempdima
- \@memerror{\protect\spinemargin\space and/or
- \protect\textwidth\space and/or
- \protect\foremargin\space
- are too large for \protect\paperwidth\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
- \@tempdima = \stockheight
- \advance\@tempdima -\trimtop
- \advance\@tempdima -\paperheight
- \ifdim\@tempdima<\@tempdimb
- \@tempdima = -\@tempdima
- \@memerror{\protect\paperheight\space and/or
- \protect\trimtop\space
- are too large for \protect\stockheight\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
- \@tempdima = \paperheight
- \advance\@tempdima -\uppermargin
- \advance\@tempdima -\textheight
- \advance\@tempdima -\lowermargin
- \ifdim\@tempdima<\@tempdimb
- \@tempdima = -\@tempdima
- \@memerror{\protect\uppermargin\space and/or
- \protect\textheight\space and/or
- \protect\lowermargin\space
- are too large for \protect\paperheight\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
- \@tempdima = \uppermargin
- \advance\@tempdima -\headheight
- \advance\@tempdima -\headsep
- \ifdim\@tempdima<\@tempdimb
- \@tempdima = -\@tempdima
- \@memerror{\protect\headheight\space and/or
- \protect\headsep\space
- are too large for \protect\uppermargin\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
- \@tempdima = \lowermargin
- \advance\@tempdima -\footskip
- \ifdim\@tempdima<\z@
- \@tempdima = -\@tempdima
- \@memerror{\protect\footskip
- is too large for \protect\lowermargin\space
- by \the\@tempdima}%
- {\@ehd}
- \fi
-}
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\checkandfixthelayout}
-% This macro checks and fixes the layout, and reports the result. It takes the
-% same optional argument as \cs{checkthelayout}.
-% \begin{macrocode}
-\renewcommand*{\checkandfixthelayout}[1][classic]{%
- \checkthelayout[#1]%
- \fixthelayout
- \typeoutlayout}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Overlong lines}
-%
-% LaTeX provides \cs{fussy} and \cs{sloppy} to control the amount of slack
-% in a line while trying to make justified lines. Their definitions are:
-% \begin{verbatim}
-% \def\fussy{%
-% \emergencystretch\z@
-% \tolerance 200%
-% \hfuzz .1\p@
-% \vfuzz\hfuzz}
-% \def\sloppy{%
-% \tolerance 9999%
-% \emergencystretch 3em%
-% \hfuzz .5\p@
-% \vfuzz\hfuzz}
-% \end{verbatim}
-%
-% \begin{macro}{\midsloppy}
-% Somewhere between \cs{fussy} and \cs{sloppy}.
-% \begin{macrocode}
-\newcommand*{\midsloppy}{%
- \tolerance 5000%
- \hbadness 4000%
- \emergencystretch 1.5em%
- \hfuzz .1\p@
- \vfuzz\hfuzz}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{environment}{midsloppypar}
-% A paragraph form of \cs{midsloppy}; equivalent to \verb?\par \midsloppy ... \par}?
-% \begin{macrocode}
-\newenvironment{midsloppypar}{\par\midsloppy}{\par}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \subsection{Lists}
-%
-% \begin{macro}{\everylistparindent}
-% \begin{macro}{\list}
-% The kernel sets \cs{listparindent} to zero within a \cs{list}, where it
-% can be overridden in \cs{list}'s second argument. Here it is set to
-% \cs{everyparlistindent} by default, which in turn is 0pt.
-% \begin{macrocode}
-\newdimen\everylistparindent
- \everylistparindent \z@
-\renewcommand*{\list}[2]{%
- \ifnum \@listdepth >5\relax
- \@toodeep
- \else
- \global\advance\@listdepth\@ne
- \fi
- \rightmargin\z@
- \listparindent\everylistparindent
- \itemindent\z@
- \csname @list\romannumeral\the\@listdepth\endcsname
- \def\@itemlabel{#1}%
- \let\makelabel\@mklab
- \@nmbrlistfalse
- #2\relax
- \@trivlist
- \parskip\parsep
- \parindent\listparindent
- \advance\linewidth -\rightmargin
- \advance\linewidth -\leftmargin
- \advance\@totalleftmargin \leftmargin
- \parshape \@ne \@totalleftmargin \linewidth
- \ignorespaces}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\defaultlists}
-% This is a simplification of memoir's original, and will apply to any font
-% size.
-% \changes{v4.9}{2007/11/24}{Set \cs{everyparlistindent} to \cs{parindent} in
-% \cs{defaultlists} and \cs{firmlists}}
-% \begin{macrocode}
-\renewcommand*{\defaultlists}{%
- \setlength{\partopsep}{0.2\onelineskip \@plus 0.1\onelineskip
- \@minus 0.1\onelineskip}%
- \parsepi = 0.3333\onelineskip \@plus 0.1667\onelineskip \@minus \p@
- \itemsepi = \parsepi
- \topsepi = 0.6667\onelineskip \@plus 0.3333\onelineskip
- \@minus 0.2\onelineskip
- \parsepii = 0.1667\onelineskip \@plus \p@ \@minus \p@
- \topsepii = \parsepi
- \topsepiii = \parsepii
- \everylistparindent \listparindent}
-\defaultlists
-
-% \end{macrocode}
-% \end{macro}
-%
-% These are the original versions of \cs{firmlist} and \cs{tightlist}.
-% \begin{verbatim}
-% \newcommand*{\firmlist}{%
-% \setlength{\itemsep}{0.5\itemsep}\setlength{\parskip}{0.5\parskip}}
-%
-% \newcommand*{\tightlist}{%
-% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-% \end{verbatim}
-%
-% \begin{macro}{\firmlists}
-% \begin{macro}{\firmlists*}
-% \begin{macro}{\m@msfirmlists}
-% \begin{macro}{\m@mfirmlists}
-% These give approximately half the vertical spacing of the default lists,
-% with all spaces equal. The starred version allows slightly less space
-% before and after the list when it is preceded by a blank line.
-%
-% \begin{macrocode}
-\newcommand*{\firmlists}{%
- \@ifstar{\m@msfirmlists}{\m@mfirmlists}}
-
-\newcommand*{\m@msfirmlists}{
- \setlength{\partopsep}{\z@ \@plus \p@ \@minus \p@}%
- \parsepi = 0.1667\onelineskip \@plus 0.0833\onelineskip \@minus \p@
- \itemsepi = \parsepi
- \topsepi = \parsepi
- \parsepii = 0.0833\onelineskip \@plus \p@ \@minus \p@
- \topsepii = \parsepi
- \topsepiii = \parsepii
- \everylistparindent\listparindent}
-
-\newcommand*{\m@mfirmlists}{
- \setlength{\partopsep}{0.1\onelineskip \@plus 0.05\onelineskip
- \@minus 0.05\onelineskip}%
- \parsepi = 0.1667\onelineskip \@plus 0.0833\onelineskip \@minus \p@
- \itemsepi = \parsepi
- \topsepi = \parsepi
- \parsepii = 0.0833\onelineskip \@plus \p@ \@minus \p@
- \topsepii = \parsepi
- \topsepiii = \parsepii
- \everylistparindent\listparindent}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\tightlists}
-% \begin{macro}{\tightlists*}
-% \begin{macro}{\m@mstightlists}
-% \begin{macro}{\m@mtightlists}
-% These give zero vertical spacing of the default lists.
-% The starred version allows slightly no extra space
-% before and after the list when it is preceded by a blank line,
-% whereas the unstarred version puts half a \cs{onelineskip}
-% before and after.
-%
-% \begin{macrocode}
-\renewcommand*{\tightlists}{%
- \@ifstar{\m@mstightlists}{\m@mtightlists}}
-
-\newcommand*{\m@mstightlists}{%
- \setlength{\partopsep}{\z@ \@plus \p@ \@minus \p@}%
- \parsepi = \z@ \@plus \p@ \@minus \p@
- \itemsepi = \parsepi
- \topsepi = \z@ \@plus \p@ \@minus \p@
- \parsepii = \z@ \@plus \p@ \@minus \p@
- \topsepii = \parsepi
- \topsepiii = \parsepii
- \everylistparindent\parindent}
-
-\newcommand*{\m@mtightlists}{%
- \setlength{\partopsep}{0.5\onelineskip \@plus \p@ \@minus \p@}%
- \parsepi = \z@ \@plus \p@ \@minus \p@
- \itemsepi = \parsepi
- \topsepi = \z@ \@plus \p@ \@minus \p@
- \parsepii = \z@ \@plus \p@ \@minus \p@
- \topsepii = \parsepi
- \topsepiii = \parsepii
- \everylistparindent\parindent}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-%
-%
-% \section{Mempatch version 4.6}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.6 (2006/11/22 and later)
-
-% \end{macrocode}
-%
-%
-% \subsection{Double spacing}
-%
-% This is an embedding of the code from the \Lpack{setspace} package, with
-% names changed.
-%
-% \begin{macrocode}
-\EmulatedPackage{setspace}
-
-% \end{macrocode}
-%
-% \begin{macro}{\setSpacing}
-% \cs{setSpacing}\marg{num} effectively increases the \cs{baselineskip} to \meta{num}*\cs{baselineskip}
-% \begin{macrocode}
-\newcommand{\setSpacing}[1]{%
- \def\baselinestretch{#1}%
- \@currsize}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setSingleSpace}
-% \cs{setSingleSpace}\marg{num} effectively increases the \cs{baselineskip} for single
-% spacing to \meta{num}*\cs{baselineskip} (\meta{num} should be close to 1.0).
-% \begin{macrocode}
-\newcommand*{\setSingleSpace}[1]{%
- \def\m@m@singlespace{#1}}
-\setSingleSpace{1}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\SingleSpacing}
-% \cs{SingleSpacing} starts single spacing.
-% \begin{macrocode}
-%%% start single spacing
-\newcommand*{\SingleSpacing}{%
- \setSpacing{\m@m@singlespace}%
- \vskip\baselineskip% correction for coming into single spacing
-}
-\SingleSpacing
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\OnehalfSpacing}
-% \cs{OnehalfSpacing} starts `one and a half' spacing, which to most thesis nitpickers
-% will look like double spacing.
-% \begin{macrocode}
-%%% start `one and a half spacing', the elegant version of double spacing.
-\newcommand*{\OnehalfSpacing}{
- \setSpacing{1.25}% default (10pt)
- \ifcase \@ptsize \relax % 10pt
- \setSpacing{1.25}%
- \or% 11pt
- \setSpacing{1.213}%
- \or% 12pt
- \setSpacing{1.241}%
- \or\or% 14pt
- \setSpacing{1.20}%
- \or\or\or% 17pt
- \setSpacing{1.16}%
- \or\or% 9pt
- \setSpacing{1.35}%
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\DoubleSpacing}
-% \cs{DoubleSpacing} starts double spacing, which to most thesis nitpickers
-% will look far too spaced out.
-% \begin{macrocode}
-%%% start double spacing, which looks terrible.
-\newcommand*{\DoubleSpacing}{
- \setSpacing{1.667}% default (10pt)
- \ifcase \@ptsize \relax % 10pt
- \setSpacing{1.667}%
- \or% 11pt
- \setSpacing{1.618}%
- \or% 12pt
- \setSpacing{1.655}%
- \or\or% 14pt
- \setSpacing{1.60}%
- \or\or\or% 17pt
- \setSpacing{1.545}%
- \or\or% 9pt
- \setSpacing{1.8}%
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\@setsize}
-% Modify the kernel command.
-% \begin{macrocode}
-\renewcommand*{\@setsize}[4]{%
- \@nomath#1%
- \let\@currsize#1%
- \baselineskip #2%
- \baselineskip \baselinestretch\baselineskip
- \parskip \baselinestretch\parskip
- \setbox\strutbox \hbox{%
- \vrule height.7\baselineskip
- depth .3\baselineskip
- width \z@}%
- \skip\footins \baselinestretch\skip\footins
- \normalbaselineskip\baselineskip#3#4}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{environment}{SingleSpace}
-% Environment form of \cs{SingleSpacing}.
-% \begin{macrocode}
-%%% Environment form of \SingleSpacing.
-\newenvironment{SingleSpace}{%
- \vskip\baselineskip
- \setSpacing{\m@m@singlespace}%
- \vskip -\baselineskip
-}{\par}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{environment}{SingleSpace*}
-% Don't use this; it's only here to match the \Lpack{setspace} package.
-% \begin{macrocode}
-\newenvironment{SingleSpace*}{%
-% \vskip\baselineskip
- \setSpacing{\m@m@singlespace}%
- \vskip 0.5\baselineskip
-}{\vskip -0.5\baselineskip}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{macro}{\m@mrestore@spacing}
-% \begin{macrocode}
-\newcommand*{\m@mrestore@spacing}{%
- \par
- \vskip \parskip
- \vskip \baselineskip
- \endgroup
- \vskip -\parskip
- \vskip -\baselineskip}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{environment}{Spacing}
-% \begin{macrocode}
-%%% \begin{Spacing}{num} baselineskip is increased to num*baselineskip.
-\newenvironment{Spacing}[1]{%
- \par
- \begingroup
- \setSpacing{#1}}{\m@mrestore@spacing}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{environment}{OnehalfSpace}
-% \begin{macrocode}
-%%% Environment form of \OnehalfSpacing
-\newenvironment{OnehalfSpace}{%
- \begingroup
- \OnehalfSpacing}{\m@mrestore@spacing}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{environment}{DoubleSpace}
-% \begin{macrocode}
-%%% Environment form of \DoubleSpacing
-\newenvironment{DoubleSpace}{%
- \begingroup
- \DoubleSpacing}{\m@mrestore@spacing}
-
-% \end{macrocode}
-% \end{environment}
-%
-% Deal with spacing around displays.
-%
-% \begin{macro}{\memdskipstretch}
-% \begin{macro}{\setDisplayskipStretch}
-% \begin{macro}{\noDisplayskipStretch}
-% \begin{macrocode}
-%%% \setDisplayskipStretch{num} changes space around displays by the factor
-%%% (1+num).
-%%% \noDisplayskipStretch keeps the regular space around displays.
-\newcommand*{\memdskipstretch}{0.0}
-\newcommand*{\setDisplayskipStretch}[1]{%
- \renewcommand*{\memdskipstretch}{#1}}
-\newcommand*{\noDisplayskipStretch}{\setDisplayskipStretch{0.0}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\memdskips}
-% Macro added to \cs{everydisplay}, changing the settings of displayskips
-% \begin{macrocode}
-\newcommand*{\memdskips}{%
- \advance\abovedisplayskip \memdskipstretch\abovedisplayskip
- \advance\belowdisplayskip \memdskipstretch\belowdisplayskip
- \advance\abovedisplayshortskip \memdskipstretch\abovedisplayshortskip
- \advance\belowdisplayshortskip \memdskipstretch\belowdisplayshortskip
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\everydisplay}
-% \begin{macrocode}
-\everydisplay\expandafter{%
- \the\everydisplay
- \memdskips}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\@xfloat}
-% Reset \cs{baselinestretch} in floats.
-% \begin{macrocode}
-\let\m@m@xfloat\@xfloat
-\def\@xfloat #1[#2]{%
- \m@m@xfloat #1[#2]%
- \def\baselinestretch{\m@m@singlespace}%
- \normalsize}
-
-% \end{macrocode}
-% \end{macro}
-%
-% The extra spacing does not add space before and after a minipage.
-% The solution, hinted at by Donald Arseneau, is to create a new
-% environment. I came up with a solution which DA then much improved upon
-% (CTT \textit{setspace and minipages}, 2006/11/28).
-% This is like minipage from an author's view, except that it is
-% always top positioned and acts like a paragraph.
-% \begin{macro}{\memPD}
-% \begin{macrocode}
-\newdimen\memPD
-% \end{macrocode}
-% \end{macro}
-% \begin{environment}{vminipage}
-% The user view, just as for \texttt{minipage}, but ensures the \texttt{t}
-% position and as a new paragraph.
-% \begin{macrocode}
-%%% vminipage is like minipage but with better fore and aft spacing.
-\newenvironment{vminipage}{%
- \par
- \@ifnextchar[%]
- \@ivminipage
- {\@iiiminipage t\relax[s]}
-}{%
- \par\global\memPD=\prevdepth
- \endminipage
- \par
- \kern-\memPD% no pagebreak allowed here
- \hbox{\vrule depth \memPD width \z@}}
-
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{macro}{\@ivminipage}
-% Deal with first optional argument to \texttt{vminipage}.
-% \begin{macrocode}
- \def\@ivminipage[#1]{%
- \@ifnextchar[%]
- {\@iiminipage{t}}{\@iiiminipage{t}\relax[s]}}
-% \end{macrocode}
-% \end{macro}
-%
-%
-%
-% We want single spacing in footnotes. Memoir has redone much of the footnote
-% stuff, so we have to modify the modified versions.
-%
-% \begin{macro}{\@footnotetext}
-% \begin{macro}{\@mpfootnotetext}
-% \begin{macro}{\m@mold@footnotetext}
-% \begin{macro}{\m@mold@mpfootnotetext}
-% Single spacing in footnotes.
-% \begin{macrocode}
-%%% Ensure single spacing in footnotes
%%%
-
-\renewcommand{\@footnotetext}[1]{%
- \insert\footins{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \@preamfntext
- \hsize\columnwidth
- \protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@makefntext{%
- \rule\z@\footnotesep\ignorespaces{\foottextfont #1}%
- \@finalstrut\strutbox}%
- \color@endgroup}\m@mmf@prepare}
-
-\renewcommand{\@mpfootnotetext}[1]{%
- \global\setbox\@mpfootins\vbox{%
- \unvbox \@mpfootins
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@makefntext{%
- \rule\z@\footnotesep\ignorespaces{\foottextfont #1}
- \@finalstrut\strutbox}%
- \color@endgroup}\m@mmf@prepare}
-
-\let\m@mold@footnotetext\@footnotetext
-\let\m@mold@mpfootnotetext\@mpfootnotetext
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\plainfootnotes}
-% \begin{macrocode}
-\renewcommand{\plainfootnotes}{%
- \let\@footnotetext\m@mold@footnotetext
- \let\@mpfootnotetext\m@mold@mpfootnotetext}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\m@make@footnotetext}
-% \begin{macro}{\m@make@mpfootnotetext}
-% \begin{macrocode}
-\renewcommand{\m@make@footnotetext}[1]{%
- \@namelongdef{@footnotetext#1}##1{%
- \insert\@nameuse{footins#1}{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \@preamfntext
- \hsize\columnwidth
- \protected@edef\@currentlabel{%
- \csname p@footnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@makefntext#1}{%
- \rule\z@\footnotesep\ignorespaces{\@nameuse{foottextfont#1} ##1}%
- \@finalstrut\strutbox}%
- \color@endgroup}\m@mmf@prepare}}
-
-\renewcommand{\m@make@mpfootnotetext}[1]{%
- \@namelongdef{@mpfootnotetext#1}##1{%
- \global\setbox\@nameuse{@mpfootins#1}\vbox{%
- \unvbox \@nameuse{@mpfootins#1}%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@makefntext#1}{%
- \rule\z@\footnotesep\ignorespaces{\@nameuse{foottextfont#1} ##1}
- \@finalstrut\strutbox}%
- \color@endgroup}\m@mmf@prepare}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@twocolfootnotetext}
-% \begin{macro}{\@mptwocolfootnotetext}
-% \begin{macrocode}
-\renewcommand{\@twocolfootnotetext}[1]{%
- \insert\footinsv@r{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@twocolfootfmt{#1}%
- \color@endgroup}\m@mmf@prepare}
-
-\renewcommand{\@mptwocolfootnotetext}[1]{%
- \global\setbox\@mpfootinsv@r\vbox{%
- \unvbox \@mpfootinsv@r
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@twocolfootfmt{#1}%
- \color@endgroup}\m@mmf@prepare}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@maketwocolfootnotetext}
-% \begin{macro}{\m@make@mptwocolfootnotetext}
-% \begin{macrocode}
-\renewcommand{\m@make@twocolfootnotetext}[1]{%
- \@namelongdef{@twocolfootnotetext#1}##1{%
- \insert\@nameuse{footins#1}{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@twocolfootfmt#1}{##1}
- \color@endgroup}\m@mmf@prepare}}
-
-\renewcommand{\m@make@mptwocolfootnotetext}[1]{%
- \@namelongdef{@mptwocolfootnotetext#1}##1{%
- \global\setbox\@nameuse{@mpfootins#1}\vbox{%
- \unvbox \@nameuse{@mpfootins#1}%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@twocolfootfmt#1}{##1}%
- \color@endgroup}\m@mmf@prepare}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@threecolfootnotetext}
-% \begin{macro}{\@mpthreecolfootnotetext}
-% \begin{macrocode}
-\renewcommand{\@threecolfootnotetext}[1]{%
- \insert\footinsv@r{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@threecolfootfmt{#1}%
- \color@endgroup}\m@mmf@prepare}
-
-\renewcommand{\@mpthreecolfootnotetext}[1]{%
- \global\setbox\@mpfootinsv@r\vbox{%
- \unvbox \@mpfootinsv@r
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote\endcsname\@thefnmark
- }%
- \color@begingroup
- \@threecolfootfmt{#1}%
- \color@endgroup}\m@mmf@prepare}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@makethreecolfootnotetext}
-% \begin{macro}{\m@make@mpthreecolfootnotetext}
-% \begin{macrocode}
-\renewcommand{\m@make@threecolfootnotetext}[1]{%
- \@namelongdef{@threecolfootnotetext#1}##1{%
- \insert\@nameuse{footins#1}{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@threecolfootfmt#1}{##1}
- \color@endgroup}\m@mmf@prepare}}
-
-\renewcommand{\m@make@mpthreecolfootnotetext}[1]{%
- \@namelongdef{@mpthreecolfootnotetext#1}##1{%
- \global\setbox\@nameuse{@mpfootins#1}\vbox{%
- \unvbox \@nameuse{@mpfootins#1}%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \color@begingroup
- \@nameuse{@threecolfootfmt#1}{##1}%
- \color@endgroup}\m@mmf@prepare}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\@parafootnotetext}
-% \begin{macro}{\@mpparafootnotetext}
-% \begin{macrocode}
-\renewcommand{\@parafootnotetext}[1]{%
- \insert\footinsv@r{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote\endcsname\@thefnmark
- }%
- \setbox0=\vbox{\hsize=\maxdimen
- \color@begingroup
- \noindent \@parafootfmt{#1}%
- \color@endgroup}\m@mungebox}%
- \m@mmf@prepare}
-
-\renewcommand{\@mpparafootnotetext}[1]{%
- \global\setbox\@mpfootinsv@r\vbox{%
- \unvbox \@mpfootinsv@r
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\foottextfont
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote\endcsname\@thefnmark
- }%
- \setbox0=\vbox{\hsize=\maxdimen
- \color@begingroup
- \noindent \@parafootfmt{#1}%
- \color@endgroup}\m@mungebox}%
- \m@mmf@prepare}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@makeparafootnotetext}
-% \begin{macro}{\m@make@mpparafootnotetext}
-% \begin{macrocode}
-\renewcommand{\m@make@parafootnotetext}[1]{%
- \@namelongdef{@parafootnotetext#1}##1{%
- \insert\@nameuse{footins#1}{%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \@preamfntext
- \protected@edef\@currentlabel{%
- \csname p@footnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \setbox0=\vbox{\hsize=\maxdimen
- \color@begingroup
- \noindent \@nameuse{@parafootfmt#1}{##1}
- \color@endgroup}\m@mungebox}\m@mmf@prepare}}
-
-\renewcommand{\m@make@mpparafootnotetext}[1]{%
- \@namelongdef{@mpparafootnotetext#1}##1{%
- \global\setbox\@nameuse{@mpfootins#1}\vbox{%
- \unvbox \@nameuse{@mpfootins#1}%
- \def\baselinestretch{\m@m@singlespace}
- \reset@font\@nameuse{foottextfont#1}%
- \hsize\columnwidth
- \@parboxrestore
- \protected@edef\@currentlabel{%
- \csname p@mpfootnote#1\endcsname\@nameuse{@thefnmark#1}%
- }%
- \setbox0=\vbox{\hsize=\maxdimen
- \color@begingroup
- \noindent \@nameuse{@parafootfmt#1}{##1}%
- \color@endgroup}\m@mungebox}\m@mmf@prepare}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \subsection{Abnormal parskips}
-%
-% Non-zero, positive \cs{parskip}, which is not to be encouraged. Code
-% based on Robin Fairbairns \Lpack{parskip} package and the NTG classes.
-%
-% Prevent loading of the \Lpack{parskip} package.
-% \begin{macrocode}
-\EmulatedPackage{parskip}
-
-% \end{macrocode}
-%
-% \begin{macro}{\ifm@mnzpskip}
-% \begin{macro}{\m@mnzpskiptrue}
-% \begin{macro}{\m@mnzpskipfalse}
-% \cs{ifm@mnzpskip} is TRUE if \cs{parskip} set to antything but 0pt.
-% \begin{macrocode}
-\newif\ifm@mnzpskip
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\traditionalparskip}
-% \begin{macro}{\m@mabparskip}
-% \begin{macro}{\abnormalparskip}
-% \begin{macro}{\nonzeroparskip}
-% \begin{macrocode}
-%%% \traditionalparskip set \parskip to 0pt.
-\newcommand*{\traditionalparskip}{%
- \parskip \z@
- \m@mnzpskipfalse}
-\newskip\m@mabparskip
-%%% \abnormalparskip{length} sets \parskip to length.
-\newcommand*{\abnormalparskip}[1]{%
- \setlength{\parskip}{#1}\m@mabparskip=#1\relax
- \m@mnzpskiptrue}
-%%% \nonzeroparskip sets \parskip to a non-zero value that might be
-%%% not too bad (any non-zero \parskip is not good).
-\newcommand*{\nonzeroparskip}{\abnormalparskip{%
- 0.5\baselineskip
- \@plus .1\baselineskip \@minus .1\baselineskip% NTG
-%% 0.5/baselineskip \@plus 2pt% RF
-}}
-\traditionalparskip
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\defaultlists}
-% \begin{macro}{\tightlists}
-% Change these to cater for abnormal \cs{parskip}s
-% \begin{macrocode}
-%%% Change lists to cater for non-zero \parskip.
-\newlength{\itemsepii}
-\newlength{\itemsepiii}
-\newlength{\partopsepiii}
-%%%\newskip\parsepiii
-\let\m@mold@defaultlists\defaultlists
-\renewcommand*{\defaultlists}{%
- \m@mold@defaultlists
- \itemsepii\parsepii
- \itemsepiii\topsepiii
- \partopsepiii \p@ \@plus\z@ \@minus\p@
- \ifm@mnzpskip
- \partopsep \p@ \@plus\z@ \@minus\p@
- \topsepi\z@
- \parsepi\parskip
- \itemsepi\z@
- \topsepii\z@
- \parsepii\parskip
- \itemsepii\z@
- \topsepiii\z@
-%% \parsepiii\parskip
- \itemsepiii\z@
- \fi}
-
-\let\m@mold@tightlists\tightlists
-\renewcommand*{\tightlists}{%
- \m@mold@tightlists
- \ifm@mnzpskip
- \partopsep \p@ \@plus\z@ \@minus\p@
- \topsepi\z@
- \parsepi\parskip
- \itemsepi\z@
- \topsepii\z@
- \parsepii\parskip
- \itemsepii\z@
- \topsepiii\z@
-%% \parsepiii\parskip
- \itemsepiii\z@
- \partopsepiii\partopsep
- \fi}
-
-\let\@listI\@listi
-\defaultlists
-\@listi
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\@listii}
-% \begin{macro}{\@listiii}
-% \begin{macrocode}
-\renewcommand*{\@listii}{%
- \leftmargin\leftmarginii
- \labelwidth\leftmarginii
- \advance\labelwidth-\labelsep
- \topsep\topsepii
- \parsep\parsepii
- \itemsep\itemsepii}
-\renewcommand*{\@listiii}{%
- \leftmargin\leftmarginiii
- \labelwidth\leftmarginiii
- \advance\labelwidth-\labelsep
- \topsep\topsepiii
- \parsep\z@
- \itemsep\itemsepiii
- \partopsep\partopsepiii}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-%
-%
-% \begin{macro}{\verbatim}
-% From NTG, where it is a \cs{def}
-% \begin{macrocode}
-\providecommand*{\verbatim}{%
- \topsep=-0.5\parskip
- \@verbatim
- \frenchspacing\@vobeyspaces \@xverbatim}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\@minpagerestore}
-% From NTG
-% \begin{macrocode}
-\providecommand*{\@minipagerestore}{%
- \parskip=.5\baselineskip \@plus .1\baselineskip \@minus .1\baselineskip}
-% \end{macrocode}
-% But there are two conflicting earlier definitions which I'll now combine.
-% \begin{macrocode}
-\renewcommand*{\@minipagerestore}{%
- \let\@verbfootnotetext\@verbmpfootnotetext% for \verbfootnotein a minipage
- \m@mdoextrafeetmini% footnotes in minipages
- \ifm@mnzpskip \parskip=\m@mabparskip\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% Use zero \cs{parskip} in ToC listing. Already done in memoir.
-%
-%
-%
-%
-% \subsection{Side captions}
-%
-% \begin{macro}{\setsidecaps}
-% Ivars Finvers (\texttt{ifinvers@ucalgary.ca}) noted (2006/09/26)
-% that the settings for
-% \cs{sidecapwidth} and \cs{sidecapsep} didn't change if the marginal note
-% settings were changed via \cs{checkandfixthelayout}. These settings get
-% checked at setting time, not at \cs{checkand...}.
-% \begin{macrocode}
-%%% \setsidecaps{<sep>}{<width>} sets sidecaption lengths
-\newcommand*{\setsidecaps}[2]{%
- \setlength{\sidecapsep}{#1}\@memznegtest{\sidecapsep}%
- \setlength{\sidecapwidth}{#2}\@memznegtest{\sidecapwidth}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Sidebars}
-%
-% Donald Arseneau came up with some improvements to sidebars. The impetus
-% for this came from a CTT thread, \textit{whitespace after my command},
-% 2006/11/30 and earlier. In email to me on 2006/11/30 he said:
-% \begin{quotation}
-% For \Lclass{memoir} \cs{sidebar}, it seems the rules are expanding
-% to fill the space for the sidebar, so here is my suggested change
-% to \cs{sidecontents}.
-%
-% It occurs to me that a separate \cs{sidetsep} (or \cs{sidetopsep})
-% would be more valuable than having an explicit 1\cs{onelineskip}.
-%
-% I grouped common code into two macros, and altered \cs{sidebarform} too.
-% \end{quotation}
-%
-% Since then we have been going back and forth, with the result that
-% practically all the complex code is Donald's.
-%
-% \begin{macro}{\m@sideb@left}
-% \begin{macro}{\m@sideb@right}
-% Some common code for use later.
-% \begin{macrocode}
-\newcommand*{\m@sideb@left}{%
- \@tempdimc \sidebarwidth
- \advance\@tempdimc\sidebarhsep
- \kern-\@tempdimc}
-\newcommand*{\m@sideb@right}{%
- \@tempdimc \columnwidth% or \hsize
- \advance\@tempdimc\sidebarhsep
- \kern\@tempdimc}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\sidebartopsep}
-% New length for separation at the top of a sidebar.
-% \begin{macrocode}
-\newlength{\sidebartopsep}
- \setlength{\sidebartopsep}{0pt}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sidebarfont}
-% \begin{macrocode}
-\renewcommand*{\sidebarfont}{}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setsidebarheight}
-% The macro \cs{setsidebarheight}\marg{height} sets the total height
-% of sidebars on a page to \meta{height}. This is an interface for
-% controlling \verb?\dimen\sideins? properly, taking account of \cs{topskip}
-% and the sidebar font size (and therefore should be invoked \emph{after}
-% declaring \cs{sidebarfont}).
-%
-% Note that \cs{sidebartopsep} is \emph{not} included as part of the
-% allocated height.
-% \begin{macrocode}
-\renewcommand*{\setsidebarheight}[1]{%
- \setlength{\dimen\sideins}{#1}%
- \advance\dimen\sideins-\topskip
- \advance\dimen\sideins\ht\strutbox}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setsidebars}
-% Macro to set the main sidebar parameters.
-% \begin{macrocode}
-%%% \setsidebars{hsep}{width}{vsep}{topsep}{font}{height}
-%%% A * argument means leave the setting as is.
-\newcommand*{\setsidebars}[6]{%
- \nametest{#1}{*}\ifsamename\else
- \setlength{\sidebarhsep}{#1}\@memznegtest{\sidebarhsep}%
- \fi
- \nametest{#2}{*}\ifsamename\else
- \setlength{\sidebarwidth}{#2}\@memznegtest{\sidebarwidth}%
- \fi
- \nametest{#3}{*}\ifsamename\else
- \setlength{\sidebarvsep}{#3}\@memnegtest{\sidebarvsep}%
- \fi
- \nametest{#4}{*}\ifsamename\else
- \setlength{\sidebartopsep}{#4}%
- \fi
- \nametest{#5}{*}\ifsamename\else
- \def\sidebarfont{#5}%
- \fi
- \nametest{#6}{*}\ifsamename\else
- \setsidebarheight{#6}%
- \ifdim\dimen\sideins>\z@\else
- \@memerror{\protect\sidebarheight\space is zero or negative}{\@ehd}%
- \fi
- \fi}
- \setsidebars{\marginparsep}% sidebarhsep
- {\marginparwidth}% sidebarwidth
- {\onelineskip}% sidebarvsep
- {0pt}% sidebartopsep
- {\normalsize\normalfont}% sidebarfont
- {\textheight}% sidebarheight
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sidecontents}
-% \begin{macrocode}
-\renewcommand{\sidecontents}{\hbox to \z@{%
- \if@twocolumn% %% put outside nearest column
- \if@firstcolumn% %% move to left
- \m@sideb@left
- \else% %% move to right
- \m@sideb@right
- \fi
- \else% %% put into foremargin?
- \ifsidebaroneside% %% move to right
- \m@sideb@right
- \else% %% pick the margin
- \ifcase\m@msidebar@margin% 0 to left
- \m@sideb@left
- \or% 1 to right
- \m@sideb@right
- \or% 2 to outer
- \ifodd\c@page% %% move to right
- \m@sideb@right
- \else% %% move to left
- \m@sideb@left
- \fi
- \or% 3 to inner
- \ifodd\c@page% %% move to left
- \m@sideb@left
- \else %% move to right
- \m@sideb@right
- \fi
- \fi
- \fi
- \fi
-% \end{macrocode}
-% DA and I have gone to and fro on the next bit of code trying to get
-% the top alignment correct. DA has the last word.
-% \begin{verbatim}
-% \vtop to0pt{%
-% \vskip\sidebartopsep
-% \unvbox\sideins \vss}%
-% \end{verbatim}
-% \begin{macrocode}
-% \vbox to0pt{%
-% \vskip\onelineskip \vskip-\topskip
-% \vskip\sidebartopsep
-% \unvbox\sideins \vss}%
-% \end{verbatim}
-% \begin{macrocode}
- \vtop to0pt{%
- \normalsize\normalfont\sidebarfont % select font so we know the strut size
- \vskip\topskip \vskip-\ht\strutbox
- \vskip\sidebartopsep % extra vertical shift
- \unvbox\sideins \vss}%
- \hss
-}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\sidebar}
-% DA says that having stacked insertions position properly is difficult.
-% Here he uses the size of the strut to regulate both the height and the
-% depth of each insertion (much as for footnotes). The following is his
-% code and commentary.
-% \begin{macrocode}
-\renewcommand{\sidebar}[1]{%
- \insert\sideins{%
-% \end{macrocode}
-% Begin the insertion with settings. The height of the strut box
-% (dependant on the font) will determine the top alignment both initially
-% and after a page break. The setting for maximum depth does not control
-% anything; see the code further on instead.
-% \begin{macrocode}
- \hsize\sidebarwidth
- \@parboxrestore
- \sidebarform \normalsize\normalfont\sidebarfont
- \splittopskip=\ht\strutbox
- \splitmaxdepth=\dp\strutbox % doesn't do anything useful
-% \end{macrocode}
-% Allow a free split at the top (so this whole insertion moves
-% to the next page if it does not fit).
-% \begin{macrocode}
- \allowbreak
-% \end{macrocode}
-% Control the (vertical) positioning of non-split entries. Footnotes (and
-% previous versions of \cs{sidebar}) us a strut at the beginning of the text,
-% but we will allow a baseline-skip to perform the same function. This
-% method also introduces a \cs{parskip} when the paragraph begins, so we
-% counteract that. (The problem with an initial strut is that it messes'
-% up entries that begin with vertical space.)
-% \begin{macrocode}
- \prevdepth=\dp\strutbox % supersedes a "top-strut"
- \vskip-\parskip
-% \end{macrocode}
-% Now the user's sidebar entry:
-% \begin{macrocode}
- #1%
-% \end{macrocode}
-% If the entry ended still in a paragraph, take the chance to insert a
-% final strut; then end the paragraph.
-% \begin{macrocode}
- \ifvmode\else
- \unskip\@finalstrut\strutbox
- \fi\par
-% \end{macrocode}
-% Explicitly force the effect of \cs{maxdepth} (\cs{splitmaxdepth}),
-% but using the depth of the strut in the r\^{o}le of \cs{maxdepth}.
-% \begin{macrocode}
- \ifdim\prevdepth>\dp\strutbox \prevdepth=\dp\strutbox \fi
-% \end{macrocode}
-% Now control how adjacent entries abut (whether or not a final strut got
-% inserted) and how an entry fits at the bottom of the page. Use \cs{vskip}s
-% to move from the text bottom to where a strut would bottom out,
-% but insert an allowed breakpoint at the baseline position
-% (so that the entry baseline may match the page's baseline). Finally
-% insert the extra separation between entries.
-% \begin{macrocode}
- \ifdim\prevdepth>99\p@
- \nobreak
- \vskip-\prevdepth
- \allowbreak
- \vskip\dp\strutbox
- \fi
- \vskip\sidebarvsep}}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \subsection{Typeout the layout}
-%
-% Update this for sidecaptions and sidebars.
-%
-% \begin{macro}{\typeoutlayout}
-% Include the sidecap and sidebar settings.
-% \begin{macrocode}
-\renewcommand*{\typeoutlayout}{%
- \typeout{}
- \typeout{******************************************************}
- \typeout{Stock height and width:
- \the\stockheight\space by \the\stockwidth}
- \typeout{Top and edge trims:
- \the\trimtop\space and \the\trimedge}
- \typeout{Page height and width:
- \the\paperheight\space by \the\paperwidth}
- \typeout{Text height and width:
- \the\textheight\space by \the\textwidth}
- \typeout{Spine and edge margins:
- \the\spinemargin\space and \the\foremargin}
- \typeout{Upper and lower margins:
- \the\uppermargin\space and \the\lowermargin}
- \typeout{Headheight and headsep:
- \the\headheight\space and \the\headsep}
- \typeout{Footskip:
- \the\footskip}
- \typeout{Columnsep and columnseprule:
- \the\columnsep\space and \the\columnseprule}
- \typeout{Marginparsep and marginparwidth:
- \the\marginparsep\space and \the\marginparwidth}
- \typeout{Sidecapsep and sidecapwidth:
- \the\sidecapsep\space and \the\sidecapwidth}
- \typeout{Sidebarhsep and sidebarwidth:
- \the\sidebarhsep\space and \the\sidebarwidth}
- \typeout{Sidebarvsep and sidebartopsep:
- \the\sidebarvsep\space and \the\sidebartopsep}
- \typeout{Sidebarheight:
- \the\dimen\sideins}
- \typeout{******************************************************}
- \typeout{}}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \subsection{Footnotes}
-%
-% Per Starb\"{a}ck found (CTT \textit{feetbelowfloat in memoir}, 2006/11/24)
-% that this didn't effect anything in \cs{raggedbottom}, contrary to the
-% claim in the manual.
-%
-% \begin{macro}{\setfootnoterule}
-% \cs{setfootnoterule}\oarg{vfill}\marg{uplift}\marg{width}\marg{thickness}
-% defines the \cs{footnoterule}.
-% \begin{macrocode}
-%%% user command to set the \footnoterule
-%%% \setfootnoterule[<fill>]{<uplift>}{<width>}{<thickness>}
-\newcommand*{\setfootnoterule}[4][]{%
- \def\footnoterule{\kern -#2\relax #1\relax
- \hrule width #3\relax
- \kern #2\kern-#4}}
-%%%% memoir's default setting is:
-\setfootnoterule{3pt}{0.4\columnwidth}{\normalrulethickness}
-%%%% to force footnotes to the bottom after a \raggedbottom
-%%%% \setfootnoterule[\vfill]{3pt}{0.4\columnwidth}{\normalrulethickness}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Widows and sloppybottom}
-%
-% There was a discussion \textit{widow handling?} on CTT in
-% May 2006. \texttt{ivowel@gmail.com} wrote
-% \begin{quote}
-% in experimenting with raggedbottom, widowpenalty, and clubpenalty,
-% I think that I have not found a solution that strikes me as
-% particularly desirable. I think what I would really like is that
-% widows (i.e., left-over single lines that begin on the following
-% page) are resolved not by pushing one extra line from the same
-% paragraph also onto the next page, but by stretching the
-% \cs{textheight} to allow this one extra at the bottom of the
-% same page.
-% \end{quote}
-% Donald Arseneau, as he so often does, came up with a solution he
-% termed \cs{sloppybottom}. Here is a generalised version.
-%
-% \begin{macro}{\sloppybottom}
-% Allow an extra line on a page to save a widow.
-% \begin{macrocode}
-%%% \sloppybottom allows an extra line on a page to save a widow.
-%%% You must increase the \topskip (by 60\% is reasonable) and this
-%%% will push the text lower on the page. Run \checkandfixthelayout
-%%% after the change. For example:
-%%% \setlength{\topskip}{1.6\topskip}
-%%% \checkandfixthelayout
-%%% \sloppybottom
-%%% ...
-\newcommand*{\sloppybottom}{%
- \def\@textbottom{\vskip \z@ \@plus.0001fil \@minus .95\topskip}%
- \topskip=1\topskip \@plus 0.625\topskip \@minus .95\topskip
- \def\@texttop{\vskip \z@ \@plus -0.625\topskip \@minus -0.95\topskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Quark marks}
-%
-% William Adams (2006/08/28) supplied the following code to use trim marks
-% along the style of Quark Xpress. He also supplied a basis for
-% \cs{printime} but I have used one from \textit{TeX for the Impatient}
-% as it saves some counters.
-% \begin{macro}{\m@mcalchm}
-% Calculate the hours and minutes from \cs{time}.
-% \begin{macrocode}
-%%% \m@mcalchm calculates the time of day. (Code basis from TeX for the Impatient)
-\newcommand*{\m@mcalchm}{%
- \count0 = \time \divide \count0 by 60\relax
- \count2 = \count0\relax% the hour
- \count4 = \time \multiply\count0 by 60\relax
- \advance\count4 by -\count0\relax% the minute
- \ifnum\count4<10 \toks1 = {0}% make a leading zero
- \else \toks1 = {}%
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\hmpunct}
-% \begin{macro}{\amname}
-% \begin{macro}{\pmname}
-% User format controls for \cs{printtime}
-% \begin{macrocode}
-%%% punctuation, am and pm for \printtime
-\newcommand*{\hmpunct}{:}% hours minutes separator
-\newcommand*{\amname}{am}% ante meridiem
-\newcommand*{\pmname}{pm}% post meridiem
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\printtime}
-% \begin{macro}{\printtime*}
-% Print the time of day as 24 hour clock or 12 hour clock
-% \begin{macrocode}
-%%% \printtime prints time per 24 hour clock
-%%% \printtime* prints time per 12 hour clock
-\newcommand*{\printtime}{%
- \@ifstar{\m@msprtime}{\m@mprtime}}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\m@mprtime}
-% \begin{macro}{\m@msprtime}
-% These implement time printing: \cs{m@mprtime} as 24 hour clock and
-% \cs{m@msprtime} as 12 hour clock
-% \begin{macrocode}
-\newcommand*{\m@mprtime}{\begingroup
- \m@mcalchm
- \number\count2\hmpunct\the\toks1 \number\count4
- \endgroup}
-\newcommand*{\m@msprtime}{\begingroup
- \m@mcalchm
- \def\@mpm{\pmname}%
- \ifnum\count2<1\relax% early in the morning
- \count2=12\relax
- \ifnum\count4>0\relax% not midnight
- \def\@mpm{\amname}%
- \fi
- \else
- \ifnum\time<721\relax% noon or earlier
- \def\@mpm{\amname}%
- \else
- \ifnum\time>779\relax% 1300 hrs or later
- \advance\count2 by -12\relax
- \fi
- \fi
- \fi
- \number\count2\hmpunct\the\toks1 \number\count4\ \@mpm
- \endgroup}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\registrationColour}
-% \begin{macro}{\quarkmarks}
-% \begin{macrocode}
-%%% \quarkmarks generates trim marks in the style of Quark Xpress
-%%% (Code supplied by William Adams)
-%%%
-\newcommand*{\registrationColour}[1]{#1}
-\newcommand*{\quarkmarks}{%
-\renewcommand*{\tmarktl}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(-36,0){\line(1,0){24}}
- \put(0,12){\line(0,1){24}}
- \put(3,27){\ttfamily\fontsize{8bp}{10bp}\selectfont\jobname\ \
- \today\ \ \printtime\ \ Page \thepage}
- \end{picture}}}
-\renewcommand*{\tmarktm}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(-24,24){\line(1,0){48}}
- \put(0,12){\line(0,1){24}}
- \put(0,24){\oval(12,12)}
- \end{picture}}}
-\renewcommand*{\tmarktr}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(12,0){\line(1,0){24}}
- \put(0,12){\line(0,1){24}}
- \end{picture}}}
-\renewcommand*{\tmarkmr}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(12,0){\line(1,0){24}}
- \put(24,-24){\line(0,1){48}}
- \put(24,0){\oval(12,12)}
- \end{picture}}}
-\renewcommand*{\tmarkbr}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(12,0){\line(1,0){24}}
- \put(0,-36){\line(0,1){24}}
- \end{picture}}}
-\renewcommand*{\tmarkbm}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(-24,-24){\line(1,0){48}}
- \put(0,-36){\line(0,1){24}}
- \put(0,-24){\oval(12,12)}
- \end{picture}}}
-\renewcommand*{\tmarkbl}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(-36,0){\line(1,0){24}}
- \put(0,-36){\line(0,1){24}}
- \end{picture}}}
-\renewcommand*{\tmarkml}{\registrationColour{%
- \begin{picture}(0,0)
- \setlength{\unitlength}{1bp}\thicklines
- \put(-36,0){\line(1,0){24}}
- \put(-24,-24){\line(0,1){48}}
- \put(-24,0){\oval(12,12)}
- \end{picture}}}
-\renewcommand*{\trimmarks}{%
-%% \special{papersize=\the\stockwidth,\the\stockheight}
- {%
- \vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
- \hb@xt@\z@{\hskip-1in
- \ifodd\c@page
- \hskip\stockwidth \hskip-\trimedge \hskip-\paperwidth
- \else
- \if@twoside
- \hskip\trimedge % left of logical page
- \else
- \hskip\stockwidth \hsip-\trimedge \hskip-\paperwidth
- \fi
- \fi
- \vbox to \paperheight{%
- \let\protect\relax % <- v1.4 addition
- \hb@xt@\paperwidth{\tmarktl\hfil\tmarktm\hfil\tmarktr}%
- \vfil
- \hb@xt@\paperwidth{\tmarkml\hfil\tmarkmr}%
- \vfil
- \hb@xt@\paperwidth{\tmarkbl\hfil\tmarkbm\hfil\tmarkbr}}%
- \hss}%
- \vss}}%
-}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \subsection{Pagestyles}
-%
-% Lars Madsen (2006/11/03) noted that there were some missing \verb?%?
-% at the end of some lines in \cs{makepagestyle} that would cause
-% extraneous spaces in something like: \\
-% \verb?X\pagestyle{plain}X? \\
-% though I can't think that many would do this. In any case here is the
-% entire revised section from \texttt{memoir.dtx} \ldots
-%
-%
-% \begin{macro}{\makepagestyle}
-% At last we can put everything together for defining a new pagestyle,
-% via the macro \cs{makepagestyle}\marg{style} which initially sets up
-% a new pagestyle \meta{style} corresponding the the \LaTeX{} \texttt{empty}
-% pagestyle. The prior macros can then be used to make modifications
-% to the style.
-% \changes{v1.0}{2001/11/15}{Now 2 stage process for defining \cs{@evenhead}
-% and friends}
-% \changes{v1.61}{2004/03/14}{Added \cs{m@mhe@dreset} at several points in
-% \cs{makepagestyle} (from patch 2.1)}
-% \begin{macrocode}
-%%% Remove extraneous spaces from pagestyle code
-%%%
-\renewcommand*{\makepagestyle}[1]{%
-% \end{macrocode}
-% First define the macro \cs{ps@style}, which in turn defines the macros
-% \cs{@evenhead}, \cs{@oddhead}, \cs{@evenfoot} and \cs{@oddfoot}.
-% \begin{macrocode}
- \@namedef{ps@#1}{%
- \@namedef{#1@evenhead}{%
-% \end{macrocode}
-% The code for the definition of \cs{@evenhead} and friends is based on code
-% from Piet van Oostrum's \Lpack{fancyhdr} package. The three
-% parts of the header are put into parboxes, with fills between them, and
-% the whole lot is put into a box the width of the header. Fillers are put
-% before and after the main box which control the header position.
-%
-% First the left filler which is either \cs{relax} or \cs{hss}, and then
-% start the main box.
-% \begin{macrocode}
- \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
- \vbox{\hbox{%
-% \end{macrocode}
-% The left part of the header.
-% \begin{macrocode}
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedright\@nameuse{#1eheadl}\strut}}\hfill
-% \end{macrocode}
-% The center part of the header.
-% \begin{macrocode}
- \parbox[b]{\@nameuse{#1runwidth}}{%
- \centering\@nameuse{#1eheadc}\strut}\hfill
-% \end{macrocode}
-% The right part of the header.
-% \begin{macrocode}
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedleft\@nameuse{#1eheadr}\strut}}}%
-% \end{macrocode}
-% Finally, the header rule and finish with the right filler, which
-% is either \cs{relax} or \cs{hss}.
-% \begin{macrocode}
- \@nameuse{#1headrule}}}\@nameuse{#1evenhpr}}%
-% \end{macrocode}
-% The code for the \cs{@oddhead}, \cs{@evenfoot} and \cs{@oddfoot} follows
-% a similar pattern. Here is \cs{@oddhead}.
-% \begin{macrocode}
- \@namedef{#1@oddhead}{%
- \@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
- \vbox{\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedright\@nameuse{#1oheadl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
- \centering\@nameuse{#1oheadc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedleft\@nameuse{#1oheadr}\strut}}}%
- \@nameuse{#1headrule}}}\@nameuse{#1oddhpr}}%
-% \end{macrocode}
-% And \cs{@evenfoot}. For the footers the rules come \emph{before} any foot
-% entries.
-% \begin{macrocode}
- \@namedef{#1@evenfoot}{%
- \@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
- \vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedright\@nameuse{#1efootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
- \centering\@nameuse{#1efootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedleft\@nameuse{#1efootr}\strut}}}%
- }}\@nameuse{#1evenfpr}}%
-% \end{macrocode}
-% Lastly the \cs{@oddfoot}.
-% \begin{macrocode}
- \@namedef{#1@oddfoot}{%
- \@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
- \vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedright\@nameuse{#1ofootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
- \centering\@nameuse{#1ofootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
- \raggedleft\@nameuse{#1ofootr}\strut}}}%
- }}\@nameuse{#1oddfpr}}%
-% \end{macrocode}
-% Now we define \cs{@evenhead} etc., in terms of \verb?#1@evenhead?.
-% \begin{macrocode}
- \def\@evenhead{\@nameuse{#1@evenhead}}%
- \def\@oddhead{\@nameuse{#1@oddhead}}%
- \def\@evenfoot{\@nameuse{#1@evenfoot}}%
- \def\@oddfoot{\@nameuse{#1@oddfoot}}%
-% \end{macrocode}
-% To finish off the definition of \cs{ps@style}, add in a hook which can be
-% defined so that it adds additional code, if required.
-% \begin{macrocode}
- \@nameuse{#1pshook}%
- }%
-% \end{macrocode}
-% The final part of setting up the new pagestyle is defining all the macros
-% called by \cs{ps@style}, and giving them default values. Make the headers
-% and footers empty.
-% \begin{macrocode}
- \makeevenhead{#1}{}{}{}%
- \makeoddhead{#1}{}{}{}%
- \makeevenfoot{#1}{}{}{}%
- \makeoddfoot{#1}{}{}{}%
-% \end{macrocode}
-% Make the headers/footers the same width as the \cs{textwidth}, center
-% them, and ensure
-% that the rules have zero height so that they will be invisible.
-% \begin{macrocode}
- \makerunningwidth{#1}{\textwidth}%
- \makeheadposition{#1}{}{}{}{}%
- \makeheadrule{#1}{\textwidth}{0pt}%
- \makefootrule{#1}{\textwidth}{\footruleheight}{\footruleskip}%
-% \end{macrocode}
-% Finally, there is no addtional code needed, so make the hook empty, and
-% we are done.
-% \begin{macrocode}
- \makepsmarks{#1}{}%
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\aliaspagestyle}
-% The command \cs{aliaspagestyle}\marg{aliasl}\marg{original}
-% defines the \meta{alias} pagestyle to be an alias for the
-% \meta{original} pagestyle.
-% \begin{macrocode}
-\renewcommand*{\aliaspagestyle}[2]{%
- \@namedef{ps@#1}{\@nameuse{ps@#2}}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\copypagestyle}
-% The command \cs{copypagestyle}\marg{new}\marg{original}
-% defines the \meta{new} pagestyle to be a copy of the
-% \meta{original} pagestyle.
-%
-% It first makes the \meta{new} (empty) pagestyle then defines the internals
-% in terms of the \meta{original} internals.
-% \changes{v1.2}{2002/08/10}{Added \cs{copypagestyle}}
-% \begin{macrocode}
-\renewcommand*{\copypagestyle}[2]{%
- \makepagestyle{#1}%
-% \end{macrocode}
-% Do the headers and footers.
-% \begin{macrocode}
- \makeevenhead{#1}{\@nameuse{#2eheadl}}%
- {\@nameuse{#2eheadc}}{\@nameuse{#2eheadr}}%
- \makeoddhead{#1}{\@nameuse{#2oheadl}}%
- {\@nameuse{#2oheadc}}{\@nameuse{#2oheadr}}%
- \makeevenfoot{#1}{\@nameuse{#2efootl}}%
- {\@nameuse{#2efootc}}{\@nameuse{#2efootr}}%
- \makeoddfoot{#1}{\@nameuse{#2ofootl}}%
- {\@nameuse{#2ofootc}}{\@nameuse{#2ofootr}}%
-% \end{macrocode}
-% Set the width.
-% \begin{macrocode}
- \makerunningwidth{#1}{\@nameuse{#2runwidth}}%
-% \end{macrocode}
-% Specify the \cs{headposition}.
-% \begin{macrocode}
- \@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
- \@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
- \@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
- \@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
-% \end{macrocode}
-% Specify the head and foot rules.
-% \begin{macrocode}
- \@namedef{#1headrule}{\@nameuse{#2headrule}}%
- \@namedef{#1footrule}{\@nameuse{#2footrule}}%
-% \end{macrocode}
-% And pick up the hook.
-% \begin{macrocode}
- \makepsmarks{#1}{\@nameuse{#2pshook}}%
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\ifonlyfloats}
-% \cs{ifonlyfloats}\marg{yes}\marg{no} processes \meta{yes} if the macro is
-% called on a page consisting only of floats, otherwise \meta{no} is
-% processed. \cs{if@fcolmade} is specified in \file{ltoutput.dtx}.
-% \changes{v1.0}{2001/11/14}{Added \cs{ifonlyfloats}}
-% \begin{macrocode}
-\renewcommand*{\ifonlyfloats}[2]{\if@fcolmade #1\else #2\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\mergepagefloatstyle}
-% \cs{mergepagefloatstyle}\marg{style}\marg{textstyle}\marg{floatstyle}
-% makes a new page style \meta{style} that is \meta{textstyle} on normal
-% pages but uses \meta{floatstyle} on float-only pages. Both \meta{textstyle}
-% and \meta{floatstyle} must have been previously defined.
-% \changes{v1.0}{2001/11/15}{Added \cs{mergepagefloatstyle}}
-% \begin{macrocode}
-\renewcommand*{\mergepagefloatstyle}[3]{%
-% \end{macrocode}
-% Make sure that the two styles have been called, otherwise we get some
-% undefined errors.
-% \begin{macrocode}
- \@nameuse{ps@#3}\@nameuse{ps@#2}%
-% \end{macrocode}
-% Specify the pagestyle's headers and footers.
-% \begin{macrocode}
- \@namedef{ps@#1}{%
- \def\@evenhead{\ifonlyfloats{\@nameuse{#3@evenhead}}%
- {\@nameuse{#2@evenhead}}}%
- \def\@oddhead{\ifonlyfloats{\@nameuse{#3@oddhead}}%
- {\@nameuse{#2@oddhead}}}%
- \def\@evenfoot{\ifonlyfloats{\@nameuse{#3@evenfoot}}%
- {\@nameuse{#2@evenfoot}}}%
- \def\@oddfoot{\ifonlyfloats{\@nameuse{#3@oddfoot}}%
- {\@nameuse{#2@oddfoot}}}%
-% \end{macrocode}
-% Set the hook to the \meta{textstyle} on the assumption that that is
-% more complex that required for a float page.
-% \begin{macrocode}
- \@namedef{#1pshook}{\@nameuse{#2pshook}}%
-% \end{macrocode}
-% That's it.
-% \begin{macrocode}
-}}
-% \end{macrocode}
-% \end{macro}
-%
-% The pagestyles \pstyle{empty} and \pstyle{plain} are defined
-% in \file{latex.dtx}. However, I will redefine them here, just in
-% case someone takes a fancy to modifying them.
-%
-% \begin{macro}{\ps@empty}
-% The \pstyle{empty} pagestyle is simple, it's just what we get when
-% we call \cs{makepagestyle}.
-% \begin{macrocode}
-\makepagestyle{empty}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ps@plain}
-% The \pstyle{plain} pagestyle is also simple, it just puts the
-% page number at the bottom middle of the page.
-% We call \cs{makepagestyle{plain}} and then adjust as required.
-% \begin{macrocode}
-\makepagestyle{plain}
- \makeevenfoot{plain}{}{\thepage}{}
- \makeoddfoot{plain}{}{\thepage}{}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\nouppercaseheads}
-% \begin{macro}{\uppercaseheads}
-% \begin{macro}{\memUChead}
-% Spurred by Lars Madsen's \Lpack{memexsupp} v0.05 package here is
-% a way of switching uppercasing in the headings pagestyle.
-% \changes{v4.9}{2007/09/07}{Added uppercase switches for headings pagestyle}
-% \begin{macrocode}
-\newcommand*{\nouppercaseheads}{%
- \let\memUChead\relax}
-\newcommand*{\uppercaseheads}{%
- \let\memUChead\MakeUppercase}
-\uppercaseheads
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\ps@headings}
-% The \pstyle{headings} pagestyle behaves differently for
-% twosided and onesided printing. This is a rewrite of the
-% standard style.
-% \changes{v1.1}{2002/03/10}{Added \cs{tocmark} etc., to \cs{ps@headings}}
-% \changes{v4.9}{2007/09/07}{Removed \cs{@mkboth} as is never used}
-% \changes{v4.9}{2007/09/07}{Replaced \cs{MakeUppercase} by \cs{memUChead} in headings pagestyle}
-% \changes{v4.9}{2007/11/11}{For twosided docs set both marks for ToC, etc (suggested by Lars Madsen)}
-% \begin{macrocode}
-\if@twoside
-% \end{macrocode}
-% The footer is empty and the header contains the page number and
-% one of the marks.
-% \begin{macrocode}
- \makepagestyle{headings}
- \makepsmarks{headings}{%
-%%% \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markboth{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \@chapapp\ \thechapter. \ %
- \fi
- \fi
- ##1}}{}}%
- \def\tocmark{\markboth{\memUChead{\contentsname}}{\memUChead{\contentsname}}}%
- \def\lofmark{\markboth{\memUChead{\listfigurename}}{\memUChead{\listfigurename}}}%
- \def\lotmark{\markboth{\memUChead{\listtablename}}{\memUChead{\listtablename}}}%
- \def\bibmark{\markboth{\memUChead{\bibname}}{\memUChead{\bibname}}}%
- \def\indexmark{\markboth{\memUChead{\indexname}}{\memUChead{\indexname}}}%
- \def\sectionmark##1{%
- \markright{\memUChead{%
- \ifnum \c@secnumdepth > \z@
- \thesection. \ %
- \fi
- ##1}}}%
- }%
- \makeevenhead{headings}{\thepage}{}{\slshape\leftmark}
- \makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
-\else
-% \end{macrocode}
-% For one sided printing even and odd pages are treated the same,
-% so no need to bother with the evenhead, and
-% just the \cs{rightmark} is used.
-% \begin{macrocode}
- \makepagestyle{headings}
- \makepsmarks{headings}{%
-%%% \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markright{\memUChead{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \@chapapp\ \thechapter. \ %
- \fi
- \fi
- ##1}}}%
- \def\tocmark{\markright{\memUChead{\contentsname}}}%
- \def\lofmark{\markright{\memUChead{\listfigurename}}}%
- \def\lotmark{\markright{\memUChead{\listtablename}}}%
- \def\bibmark{\markright{\memUChead{\bibname}}}%
- \def\indexmark{\markright{\memUChead{\indexname}}}%
- }
- \makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
-\fi
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ps@myheadings}
-% The \pstyle{myheadings} page style is simpler because the user
-% has to specify the contents using \cs{markboth} and \cs{markright}
-% commands. This is the definition used in the standard classes.
-% \changes{v1.1}{2002/03/10}{Added \cs{tocmark} etc., to \cs{ps@myheadings}}
-% \begin{verbatim}}
-% \newcommand{\ps@myheadings}{%
-% \let\@oddfoot\@empty\let\@evenfoot\@empty
-% \def\@evenhead{\thepage\hfil{\slshape\leftmark}}%
-% \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
-% \let\@mkboth\@gobbletwo
-% \let\chaptermark\@gobble
-% \let\sectionmark\@gobble
-% }
-% \end{verbatim}
-% Translating that into our terms we get:
-% \changes{v1.0}{2001/11/15}{Changed the code for creating the myheadings pagestyle}
-% \changes{v1.4}{2003/11/22}{Further change to myheadings pagestyle code}
-% \begin{macrocode}
-\makepagestyle{myheadings}
- \makepsmarks{myheadings}{%
-%%% \let\@mkboth\@gobbletwo
- \let\chaptermark\@gobble
- \let\sectionmark\@gobble
- \def\tocmark{}%
- \def\lofmark{}%
- \def\lotmark{}%
- \def\bibmark{}%
- \def\indexmark{}%
- }
- \makeevenhead{myheadings}{\thepage}{}{\slshape\leftmark}
- \makeoddhead{myheadings}{\slshape\rightmark}{}{\thepage}
-
-% \end{macrocode}
-% (Kai von Fintel (\texttt{fintel@mit.edu}) emailed me on 2003/02/24
-% saying that the original \verb?\let\tocmark\@gobble? in the myheadings
-% pagestyle did nasty things
-% to the ToC, etc. Now using \verb?\def\tocmark{}?.)
-% \end{macro}
-%
-% \begin{macro}{\ps@chapter}
-% \begin{macro}{\ps@part}
-% \begin{macro}{\ps@cleared}
-% The standard classes use the \pstyle{plain} pagestyle for the first page
-% of a chapter. This class uses the \pstyle{chapter} instead, which is
-% aliased to \pstyle{plain}. Similarly for parts.
-% Further, \cs{cleardoublepage} uses whatever
-% pagestyle is in effect for the empty verso page. I find that this
-% looks odd if the header contains a chapter name. This class uses
-% the \pstyle{cleared} pagestyle in this case. I have aliased this
-% to \pstyle{empty}; the \pstyle{plain} would be another reasonable choice.
-% \begin{macrocode}
-\aliaspagestyle{chapter}{plain}
-\aliaspagestyle{part}{plain}
-\aliaspagestyle{cleared}{empty}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\cleardoublepage}
-% A slight adjustment to the kernel definition to set a pagestyle.
-% \begin{macrocode}
-\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
- \hbox{}\thispagestyle{cleared}%
- \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\ps@ruled}
-% Partly to show how it is done, the class provides a \pstyle{ruled} pagestyle.
-% In this style the headers and footers are the same width as the textblock,
-% there is a rule under the header, page numbers are set in the footers
-% at the outside of the page. Even page headers have the chapter number
-% and title at the left, and odd page headers have the section title
-% at the right.
-%
-% Start by making the (empty) \pstyle{ruled} pagestyle.
-% \begin{macrocode}
-\makepagestyle{ruled}
-% \end{macrocode}
-% There is no need to change the default width (which is the \cs{textwidth}),
-% nor the default positions (centered),
-% nor to make the footrule visible. We do, though, have to put the page
-% numbers into the footers.
-% \begin{macrocode}
-\makeevenfoot{ruled}{\thepage}{}{}
-\makeoddfoot{ruled}{}{}{\thepage}
-% \end{macrocode}
-% Make the header rule visible and equal to the \cs{textwidth}.
-% \begin{macrocode}
-\makeheadrule{ruled}{\textwidth}{\normalrulethickness}
-% \end{macrocode}
-%
-% \begin{macro}{\@ruledmarks}
-% We have to make sure that the \cs{chapter} and \cs{section} commands make
-% the appropriate marks for use in the headers. We use the hook for this.
-% Note that contrary to normal \LaTeX{} practice, the titles are not
-% automatically upper-cased. The marks for the tocbibinds also need adjusting.
-% \changes{v1.1}{2002/03/10}{Changed \cs{@ruledmarks} to cater for tocbibind}
-% \begin{macrocode}
-\renewcommand*{\@ruledmarks}{%
-%%% \let\@mkboth\markboth
- \def\chaptermark##1{%
- \markboth{%
- \ifnum \c@secnumdepth >\m@ne
- \if@mainmatter
- \thechapter. \ %
- \fi
- \fi
- ##1}{}}
- \def\sectionmark##1{\markright{##1}}%
- \def\tocmark{\markboth{\contentsname}{}}%
- \def\lofmark{\markboth{\listfigurename}{}}%
- \def\lotmark{\markboth{\listtablename}{}}%
- \def\bibmark{\markboth{\bibname}{}}%
- \def\indexmark{\markboth{\indexname}{}}%
-}
-\makepsmarks{ruled}{\@ruledmarks}
-% \end{macrocode}
-% \end{macro}
-%
-% We can now define the even page header which is to have the chapter title
-% at the left. As the chapter mark did no upper-casing we will print it
-% using small caps, but just use the normal font for section title on
-% the odd page header.
-% \begin{macrocode}
-\makeevenhead{ruled}{\scshape\leftmark}{}{}
-\makeoddhead{ruled}{}{}{\rightmark}
-
-% \end{macrocode}
-% \end{macro}
-% This is all that we need to do for the \pstyle{ruled} pagestyle.
-%
-% \begin{macro}{\ps@Ruled}
-% Also define a \pstyle{Ruled} pagestyle similar to \pstyle{ruled} except that the
-% headers and footers are 10\% wider than the textblock, sticking out
-% into the fore edge.
-% \begin{macrocode}
-\makepagestyle{Ruled}
-\makerunningwidth{Ruled}{1.1\textwidth}
-\makeheadposition{Ruled}{flushright}{flushleft}{flushright}{flushleft}
-\makeevenfoot{Ruled}{\thepage}{}{}
-\makeoddfoot{Ruled}{}{}{\thepage}
-\makeheadrule{Ruled}{1.1\textwidth}{\normalrulethickness}
-\makepsmarks{Ruled}{\@ruledmarks}
-\makeevenhead{Ruled}{\scshape\leftmark}{}{}
-\makeoddhead{Ruled}{}{}{\rightmark}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\headwidth}
-% \begin{macro}{\ps@companion}
-% A \pstyle{companion} pagestyle like the one in the
-% \textit{\LaTeX{} Companion} series.
-% We need the \cs{headwidth} length for this.
-% \changes{v1.1}{2002/03/10}{Added \cs{tocmark} etc., to \cs{ps@companion}}
-% \begin{macrocode}
-%%%%\newlength{\headwidth} % don't use in the patch file
-
-\makepagestyle{companion}
-\setlength{\headwidth}{\textwidth}
- \addtolength{\headwidth}{\marginparsep}
- \addtolength{\headwidth}{\marginparwidth}
-\makerunningwidth{companion}{\headwidth}
-\makeheadrule{companion}{\headwidth}{\normalrulethickness}
-\makeheadposition{companion}{flushright}{flushleft}{}{}
-\makepsmarks{companion}{%
-%%% \let\@mkboth\markboth
- \def\chaptermark##1{\markboth{##1}{##1}} % left mark & right marks
- \def\sectionmark##1{\markright{%
- \ifnum \c@secnumdepth>\z@
- \thesection. \ %
- \fi
- ##1}}
- \def\tocmark{\markboth{\contentsname}{\contentsname}}%
- \def\lofmark{\markboth{\listfigurename}{\listfigurename}}%
- \def\lotmark{\markboth{\listtablename}{\listtablename}}%
- \def\bibmark{\markboth{\bibname}{\bibname}}%
- \def\indexmark{\markboth{\indexname}{\indexname}}%
-}
-\makeevenhead{companion}{\normalfont\bfseries\thepage}{}%
- {\normalfont\bfseries\leftmark}
-\makeoddhead{companion}{\normalfont\bfseries\rightmark}{}%
- {\normalfont\bfseries\thepage}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%% \subsection{Theindex}
-%
-% On 2006/12/05 Lars Madsen asked for an `indextitlepagestyle' (he wanted
-% to put a hyperlink bar with links to each letter startpoint into the
-% header).
-% \begin{macro}{\ps@indextitlepagestyle}
-% Here is half of it, the other half is in the definition of \cs{theindex}.
-% \begin{macrocode}
-\aliaspagestyle{indextitlepagestyle}{chapter}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{New Listof...}
-%
-% Ignacio Fern\'{a}ndez Galv\'{a}n (aka Jellby) noted a problem with
-% changing chapter styles and the ToC heading
-% (ctt, \textit{Inconsistency in memoir}, 2006/11/04). Unfortunately the
-% fix involves repeating much prior code. Essentially, I got the
-% setting of \cs{parskip} equal to \cs{cftparskip} in the wrong place.
-% The following has been copied from \file{memoir.dtx} and appropriate
-% changes made.
-%
-% \begin{macro}{\newlistof}
-% \cs{newlistof}\marg{listofcmmd}\marg{ext}\marg{listofname}
-% creates the command \cs{listofcmmd} to typeset a new List of, where the
-% external file has the extension \file{.ext} and the heading title is
-% \meta{listofname}. The code for this is a heavily modified part
-% of the \Lpack{tocloft} package.
-%
-% \begin{macrocode}
-%%%%%%% Fix for inconsistent chapter styles and ToC, etc style.
-\renewcommand*{\newlistof}[3]{%
-% \end{macrocode}
-%
-% In the following, \verb?X? stands for the value of \meta{listofcmmd} and
-% \verb?Z? stands for the value of \meta{ext}.
-%
-% \begin{macro}{\ext@Z}
-% \begin{macro}{\Zdepth}
-% The file extension and listing depth, which is set to level~1.
-% \begin{macrocode}
- \@namedef{ext@#2}{#2}
- \@ifundefined{c@#2depth}{\newcounter{#2depth}}{}
- \setcounter{#2depth}{1}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\Zmark}
-% The heading marks for the listing.
-% \changes{v1.1}{2002/03/10}{Changed \cs{@mkboth} to \cs{markboth} in \cs{Zmark}}
-% \begin{macrocode}
- \@namedef{#2mark}{\markboth{#3}{#3}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\X}
-% Typeset the listing title and entries,
-% with both a normal and starred version.
-% \begin{macrocode}
- \@namedef{#1}{\@ifstar{\@nameuse{@star#2}}{\@nameuse{@plain#2}}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@starZ}
-% The starred listof version
-% \begin{macrocode}
- \@namedef{@star#2}{%
- \ensureonecol
- \par
- \begingroup
-%%%%%%% \parindent\z@ \parskip\cftparskip
- \@nameuse{@#2maketitle}
- \@starttoc{#2}%
- \endgroup
- \restorefromonecol}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@plainZ}
-% The unstarred listof version
-% \begin{macrocode}
- \@namedef{@plain#2}{%
- \ensureonecol
- \par
- \begingroup
-%%%%%%% \parindent\z@ \parskip\cftparskip
- \@nameuse{@#2maketitle}
- \phantomsection
- \addcontentsline{toc}{chapter}{#3}
-\parskip\cftparskip
- \@starttoc{#2}%
- \endgroup
- \restorefromonecol}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@Zmaketitle}
-% This macro typesets the title.
-% \changes{v1.3}{2002/10/10}{Added \cs{printZnonum} to \cs{@Zmaketitle}}
-% \begin{macrocode}
- \@namedef{@#2maketitle}{%
- \@nameuse{#2headstart}
- {\parindent\z@
-%%%%%%%% \parskip\cftparskip
- \interlinepenalty\@M
-% \end{macrocode}
-% \changes{v1.3}{2002/11/14}{Added printZnonum to \cs{newlistof}}
-% \begin{macrocode}
- \@nameuse{print#2nonum}%
- \@nameuse{print#2title}{#3}%
- \@nameuse{#2mark}%
- \thispagestyle{chapter}%
- \@nameuse{after#2title}
- }
- \@afterheading}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\Zheadstart}
-% \begin{macro}{\afterZtitle}
-% The macros \cs{Zheadstart} and \cs{afterZtitle}
-% control what goes before and after the title. They
-% default to the corresponding macros for chapters.
-% \begin{macrocode}
- \@namedef{#2headstart}{\chapterheadstart}
- \@namedef{after#2title}{\afterchaptertitle}
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\printZnonum}
-% This typesets something before the title and defaults
-% to \cs{printchapternonum}.
-% \changes{v1.3}{2002/10/10}{Added \cs{printZnonum} macro}
-% \begin{macrocode}
- \@namedef{print#2nonum}{\printchapternonum}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\printZtitle}
-% The title is typeset by the macro \cs{printZtitle}\marg{title}
-% which defaults to \cs{printchaptertitle}.
-% \begin{macrocode}
- \@namedef{print#2title}##1{\printchaptertitle{##1}}
-% \end{macrocode}
-% \end{macro}
-%
-% This is the end of the definition of \cs{newlistof}.
-% \begin{macrocode}
-} % end \newlistof
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@starttoc}
-% A list of macro calls \cs{@starttoc} to read the appropriate file. I have
-% changed the kernel definition to allow a file to be read multiple times
-% by delaying killing the file until the end of the document.
-% \changes{v1.3}{2002/11/14}{Changed \cs{@starttoc}}
-% \begin{macrocode}
-\renewcommand*{\@starttoc}[1]{%
- \begingroup\makeatletter
- \@input{\jobname.#1}%
- \if@filesw
- \AtEndDocument{%
- \expandafter\newwrite\csname tf@#1\endcsname
- \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
- }%
- \fi
- \@nobreakfalse
- \endgroup}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-\newlistof{tableofcontents}{toc}{\contentsname}
-\newlistof{listoffigures}{lof}{\listfigurename}
-\newlistof{listofables}{lot}{\listtablename}
-%%% remove subfigure support
-\renewcommand*{\@cftl@subfigtab}{}
-
-% \end{macrocode}
-%
-% \subsection{Chapter styles}
-%
-% I have added some further chapter styles. These have either been sent to me,
-% published on CTT or are my own invention.
-%
-% \begin{macro}{\chs@default}
-% A reimplementation of the default chapter style which sets everything.
-% \begin{macrocode}
-\makechapterstyle{default}{%
- \setlength{\beforechapskip}{50pt}
- \def\chapterheadstart{\vspace*{\beforechapskip}}
- \def\chapnamefont{\normalfont\huge\bfseries}
- \def\printchaptername{\chapnamefont \@chapapp}
- \def\chapternamenum{\space}
- \def\chapnumfont{\normalfont\huge\bfseries}
- \def\printchapternum{\chapnumfont \thechapter}
- \setlength{\midchapskip}{20pt}
- \def\afterchapternum{\par\nobreak\vskip \midchapskip}
- \def\printchapternonum{}
- \def\chaptitlefont{\normalfont\Huge\bfseries}
- \def\printchaptertitle##1{\chaptitlefont ##1}
- \setlength{\afterchapskip}{40pt}
- \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@bianchi}
-% Posted to CTT on 2003/12/09, \textit{New chapter style: chapter vs chapter*}
-% by Stefano Bianchi.
-% \begin{macrocode}
-%% Stefano Bianchi, ctt 2003/12/09 `New chapter style: chapter vs chapter*'
-\makechapterstyle{bianchi}{%
- \chapterstyle{default}
- \renewcommand*{\chapnamefont}{\normalfont\Large\sffamily\itshape}
- \renewcommand*{\chapnumfont}{\normalfont\huge}
- \renewcommand*{\printchaptername}{%
- \chapnamefont\centering\@chapapp}
- \renewcommand*{\printchapternum}{\chapnumfont \textit{\thechapter}}
- \renewcommand*{\chaptitlefont}{\normalfont\Huge\sffamily}
- \renewcommand*{\printchaptertitle}[1]{%
- \hrule\vskip\onelineskip \centering \chaptitlefont\textbf{##1}\par}
- \renewcommand*{\afterchaptertitle}{\vskip\onelineskip \hrule\vskip
- \afterchapskip}
- \renewcommand*{\printchapternonum}{%
- \vphantom{\chapnumfont \textit{9}}\afterchapternum}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@bringhurst}
-% My bringhurst style.
-% \begin{macrocode}
-\makechapterstyle{bringhurst}{%
- \chapterstyle{default}
- \renewcommand*{\chapterheadstart}{}
- \renewcommand*{\printchaptername}{}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\printchapternum}{}
- \renewcommand*{\afterchapternum}{}
- \renewcommand*{\printchaptertitle}[1]{%
- \raggedright\Large\scshape\MakeLowercase{##1}}
- \renewcommand*{\afterchaptertitle}{%
- \vskip\onelineskip \hrule\vskip\onelineskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@brotherton}
-% An extremely simple chapterstyle created by William Adams for Mike
-% Brotherton's science fiction novel \textit{Star Dragon}, posted to CTT
-% 2006/12/09, \textit{An example of a novel?}.
-% \begin{macrocode}
-\makechapterstyle{brotherton}{%
- \chapterstyle{default}
- \renewcommand*{\printchapternum}{\chapnumfont
- \ifanappendix \thechapter \else \numtoName{\c@chapter}\fi}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@chappell}
-% My Chappell style
-% \begin{macrocode}
-\makechapterstyle{chappell}{%
- \chapterstyle{default}
- \setlength{\beforechapskip}{0pt}
- \renewcommand*{\chapnamefont}{\large\centering}
- \renewcommand*{\chapnumfont}{\large}
- \renewcommand*{\printchapternonum}{%
- \vphantom{\printchaptername \chapnumfont 1}
- \afterchapternum
- \vskip \onelineskip \vskip -\topskip}
- \renewcommand*{\chaptitlefont}{\Large\itshape}
- \renewcommand*{\printchaptertitle}[1]{%
- \hrule\vskip\onelineskip \centering\chaptitlefont ##1}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@culver}
-% By me in an answer to Christopher Culver on CTT,
-% \textit{"Biblical" formatting, how?} on 2004/03/29,where I called it
-% the `biblical' style.
-% \changes{v4.9}{2007/11/14}{Changed culver chapterstyle to match description}
-% \begin{macrocode}
-\makechapterstyle{culver}{%
- \chapterstyle{default}
- \chapterstyle{article}%
- \renewcommand*{\thechapter}{\Roman{chapter}}
- \renewcommand*{\printchapternum}{% center number/title
- \centering\chapnumfont \thechapter\space\space}%
- \renewcommand*{\printchapternonum}{\centering}
- \renewcommand*{\clearforchapter}{}% no new page
- \aliaspagestyle{chapter}{headings}% no special pagestyle
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@dash}
-% A very simple style of mine but I couldn't think of a good name for it.
-% \begin{macrocode}
-\makechapterstyle{dash}{%
- \chapterstyle{default}
- \setlength{\beforechapskip}{5\onelineskip}
- \renewcommand*{\printchaptername}{}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\chapnumfont}{\normalfont\large}
- \settoheight{\midchapskip}{\chapnumfont 1}
- \renewcommand*{\printchapternum}{\centering \chapnumfont
- \rule[0.5\midchapskip]{1em}{0.4pt} \thechapter\
- \rule[0.5\midchapskip]{1em}{0.4pt}}
- \renewcommand*{\afterchapternum}{\par\nobreak\vskip 0.5\onelineskip}
- \renewcommand*{\printchapternonum}{\centering
- \vphantom{\chapnumfont 1}\afterchapternum}
- \renewcommand*{\chaptitlefont}{\normalfont\Large}
- \renewcommand*{\printchaptertitle}[1]{\centering \chaptitlefont ##1}
- \setlength{\afterchapskip}{2.5\onelineskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@demo2}
-% My second version of the demo chapterstyle.
-% \begin{macrocode}
-\makechapterstyle{demo2}{%
- \chapterstyle{default}
- \renewcommand*{\printchaptername}{\centering}
- \renewcommand*{\printchapternum}{\chapnumfont
- \ifanappendix \thechapter \else \numtoName{\c@chapter}\fi}
- \renewcommand*{\chaptitlefont}{\normalfont\Huge\sffamily}
- \renewcommand*{\printchaptertitle}[1]{%
- \hrule\vskip\onelineskip \raggedleft \chaptitlefont ##1}
- \renewcommand*{\afterchaptertitle}{%
- \vskip\onelineskip \hrule\vskip \afterchapskip}
- \setlength{\beforechapskip}{3\baselineskip}
- \renewcommand*{\printchapternonum}{%
- \vphantom{\chapnumfont One}
- \afterchapternum%
- \vskip\topskip}
- \setlength{\beforechapskip}{2\onelineskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@demo3}
-% My third version of the demo chapterstyle.
-% \changes{v4.9}{2007/11/14}{Added demo3 chapterstyle}
-% \begin{macrocode}
-\makechapterstyle{demo3}{%
- \chapterstyle{default}
- \renewcommand*{\printchaptername}{\centering}
- \renewcommand*{\chapnumfont}{\normalfont\HUGE\itshape}
- \renewcommand*{\printchapternum}{\chapnumfont
- \ifanappendix \thechapter \else \numtoName{\c@chapter}\fi}
- \renewcommand*{\chaptitlefont}{\normalfont\Huge\sffamily}
- \renewcommand*{\printchaptertitle}[1]{%
- \hrule\vskip\onelineskip \raggedleft \chaptitlefont ##1}
- \renewcommand*{\afterchaptertitle}{%
- \vskip\onelineskip \hrule\vskip \afterchapskip}
- \setlength{\beforechapskip}{0pt}
- \setlength{\midchapskip}{2\onelineskip}
- \setlength{\afterchapskip}{2\onelineskip}
- \renewcommand*{\printchapternonum}{%
- \vphantom{\chapnumfont One}
- \afterchapternum%
- \vskip\topskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@ell}
-% Another of my styles which I'll probably use for my next book.
-% \begin{macrocode}
-\makechapterstyle{ell}{%
- \chapterstyle{default}
- \renewcommand*{\chapnumfont}{\normalfont\HUGE\sffamily}
- \renewcommand*{\chaptitlefont}{\normalfont\huge\sffamily}
- \settowidth{\chapindent}{\chapnumfont 111}
- \renewcommand*{\chapterheadstart}{\begingroup
- \vspace*{\beforechapskip}%
- \begin{adjustwidth}{}{-\chapindent}%
- \hrulefill
- \smash{\rule{0.4pt}{15mm}}
- \end{adjustwidth}\endgroup}
- \renewcommand*{\printchaptername}{}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\printchapternum}{%
- \begin{adjustwidth}{}{-\chapindent}
- \hfill
- \raisebox{10mm}[0pt][0pt]{\chapnumfont \thechapter}%
- \hspace*{1em}
- \end{adjustwidth}\vspace*{-3.0\onelineskip}}
- \renewcommand*{\printchaptertitle}[1]{%
- \vskip\onelineskip
- \raggedleft {\chaptitlefont ##1}\par\nobreak}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@ger}
-% Posted to CTT on 2002/04/12 \textit{Fancy Headings, Chapter Headings} by Gerardo Garcia.
-% \changes{v4.7}{2006/12/23}{Renamed the `Ger' chapterstyle to `ger'}
-% \begin{macrocode}
-%% Gerardo Garcia, ctt 2002/04/12, `Fancy Headings, Chapter Headings
-\makechapterstyle{ger}{%
- \chapterstyle{default}
- \renewcommand*{\chapterheadstart}{\vspace*{\beforechapskip}
- \mbox{}\\\mbox{}\rule[0pt]{\textwidth}{0.4pt}\par}
- \setlength{\midchapskip}{20pt}
- \renewcommand*{\printchaptertitle}[1]{\chaptitlefont ##1
- \\\mbox{}\rule[5pt]{\textwidth}{0.4pt}}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@lyhne}
-% Posted to CTT 2006/02/09 \textit{Glossary}, by Anders Lyhne.
-% It requires the \Lpack{graphicx} package. I have modified it to remove the
-% new length and adjusted the unnumbered appearance.
-% \begin{macrocode}
-\makechapterstyle{lyhne}{% needs graphicx package
- \chapterstyle{default}
- \setlength{\beforechapskip}{1.5cm}
- \setlength{\afterchapskip}{1cm}
- \setlength{\midchapskip}{2cm}
- \renewcommand*{\chapnamefont}{\normalfont\normalsize\scshape\raggedleft}
- \renewcommand*{\chaptitlefont}{\normalfont\normalsize\bfseries\sffamily\raggedleft}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\printchapternum}{\makebox[0pt][l]{\hspace{0.2em}%
- \resizebox{!}{2ex}{\chapnamefont\bfseries\sffamily\thechapter}}}
- \renewcommand*{\afterchapternum}{\par\hspace{1.5cm}\hrule\vspace{0.2cm}}
- \renewcommand*{\printchapternonum}{\vphantom{\chapnamefont 1}\afterchapternum}
- \renewcommand*{\afterchaptertitle}{\vskip 0.2cm
- \hrule\vskip\afterchapskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \begin{macro}{\chs@madsen}
-% Posted to CTT on 2003/12/09, \textit{New chapter style: chapter vs chapter*}
-% by Lars Madsen.
-% This requires the \Lpack{graphicx} package,
-% \changes{v4.7}{2006/12/23}{Added \cs{raggedleft} to \cs{chaptitlefont} in the madsen chapterstyle}
-% \begin{macrocode}
-%% posted to ctt, December 2003
-%%%% \usepackage{graphicx}
-\makechapterstyle{madsen}{%
- \chapterstyle{default}
- \renewcommand*{\chapnamefont}{%
- \normalfont\Large\scshape\raggedleft}
- \renewcommand*{\chaptitlefont}{%
- \normalfont\Huge\bfseries\sffamily\raggedleft}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\printchapternum}{%
- \makebox[0pt][l]{\hspace{0.4em}
- \resizebox{!}{4ex}{%
- \chapnamefont\bfseries\sffamily\thechapter}
- }%
- }%
- \renewcommand*{\afterchapternum}{%
- \par\hspace{1.5cm}\hrule\vskip\midchapskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\colorchapnum}
-% \begin{macro}{\colorchaptitle}
-% \begin{macro}{\chs@pedersen}
-% Posted to CTT 2006/01/31, \textit{Chapter style}, by Troels Pedersen.
-% It requires the \Lpack{graphicx} package and possibly the \Lpack{color}
-% package. I have used a \cs{sidebar} instead of the original \cs{marginpar},
-% and eliminated a new length. The original color specification, the same for
-% the title and nunmber, can now be set via \cs{colorchapnum} and
-% \cs{colorchaptitle}.
-% \begin{macrocode}
-\newcommand*{\colorchapnum}{}
-\newcommand*{\colorchaptitle}{}
-\makechapterstyle{pedersen}{%
- \chapterstyle{default}
- \setlength{\beforechapskip}{-20pt}
- \setlength{\afterchapskip}{10pt}
- \renewcommand*{\chapnamefont}{\normalfont\LARGE\itshape}
- \renewcommand*{\chapnumfont}{\normalfont\HUGE\itshape\colorchapnum}
- \renewcommand*{\chaptitlefont}{\normalfont\huge\itshape\colorchaptitle}
- \renewcommand*{\afterchapternum}{}
- \renewcommand*{\printchaptername}{}
- \setlength{\midchapskip}{20mm}% was \numberheight
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\printchapternum}{%
- \sidebar{\raisebox{0pt}[0pt][0pt]{\makebox[0pt][l]{%
- \resizebox{!}{\midchapskip}{\chapnumfont\thechapter}}}}}
- \renewcommand*{\printchaptertitle}[1]{\chaptitlefont ##1}
-}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\chs@southall}
-% Style provided by Thomas Dye. I have modified the original to eliminate
-% the use of new lengths.
-% \begin{macrocode}
-%% Thomas Dye's southall chapter style
-\makechapterstyle{southall}{%
- \chapterstyle{default}
- \setlength{\afterchapskip}{5\baselineskip}
- \setlength{\beforechapskip}{36pt}% \headindent
- \setlength{\midchapskip}{\textwidth}% \rightblock
- \addtolength{\midchapskip}{-\beforechapskip}
- \renewcommand*{\chapterheadstart}{\vspace*{2\baselineskip}}
- \renewcommand*{\chaptitlefont}{\huge\rmfamily\raggedright}
- \renewcommand*{\chapnumfont}{\chaptitlefont}
- \renewcommand*{\printchaptername}{}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\afterchapternum}{}
- \renewcommand*{\printchapternum}{%
- \begin{minipage}[t][\baselineskip][b]{\beforechapskip}
- {\vspace{0pt}\chapnumfont%%%\figureversion{lining}
- \thechapter}
- \end{minipage}}
- \renewcommand*{\printchaptertitle}[1]{%
- \hfill\begin{minipage}[t]{\midchapskip}
- {\vspace{0pt}\chaptitlefont ##1\par}\end{minipage}}
- \renewcommand*{\afterchaptertitle}{%
- \par\vspace{\baselineskip}%
- \hrulefill \par\nobreak\noindent \vskip \afterchapskip}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@thatcher}
-% Original posted to CTT on 2006/01/18 by Scott Thatcher,
-% \textit{memoir: chapter headings capitalize math symbols}. I have modified
-% it to cater for multiline titles, appendices, and unnumbered chapters.
-% \begin{macrocode}
-\makechapterstyle{thatcher}{%
- \chapterstyle{default}
- \renewcommand*{\chapterheadstart}{}
- \renewcommand*{\printchaptername}{%
- \centerline{\chapnumfont{\@chapapp\ \thechapter}}}
- \renewcommand*{\chapternamenum}{}
- \renewcommand*{\chapnumfont}{\normalfont\scshape\MakeLowercase}
- \renewcommand*{\printchapternum}{}
- \renewcommand*{\afterchapternum}{%
- \par\centerline{\parbox{0.5in}{\hrulefill}}\par}
- \renewcommand*{\printchapternonum}{%
- \vphantom{\chapnumfont \@chapapp 1}\par
- \parbox{0.5in}{}\par}
- \renewcommand*{\chaptitlefont}{\normalfont\large}
- \renewcommand*{\printchaptertitle}[1]{%
- \centering \chaptitlefont\MakeUppercase{##1}}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@veelo}
-% This, from Baastian Veelo, has been noted in the documentation for
-% quite a time.
-% I have modified the original to eliminate the need for extra lengths.
-% \begin{macrocode}
-%% A new chapter style, that suits well for trimmed documents.
-%% We are scaling the chapter number, which most DVI viewers
-%% will not display accurately. It requires the graphicx package.
-%%%% \usepackage{graphicx}
-\makechapterstyle{veelo}{%
- \chapterstyle{default}
- \setlength{\afterchapskip}{40pt}
- \renewcommand*{\chapterheadstart}{\vspace*{40pt}}
- \renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
- \renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
- \renewcommand*{\chapnumfont}{\normalfont\HUGE}
- \renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\flushright}
- \renewcommand*{\printchaptername}{%
- \chapnamefont\MakeUppercase{\@chapapp}}
- \renewcommand*{\chapternamenum}{}
-% \setlength{\numberheight}{18mm}
-% \setlength{\barlength}{\paperwidth}
-% \addtolength{\barlength}{-\textwidth}
-% \addtolength{\barlength}{-\spinemargin}
- \setlength{\beforechapskip}{18mm}% \numberheight
- \setlength{\midchapskip}{\paperwidth}% \barlength
- \addtolength{\midchapskip}{-\textwidth}
- \addtolength{\midchapskip}{-\spinemargin}
- \renewcommand*{\printchapternum}{%
- \makebox[0pt][l]{%
- \hspace{.8em}%
- \resizebox{!}{\beforechapskip}{\chapnumfont \thechapter}%
- \hspace{.8em}%
- \rule{\midchapskip}{\beforechapskip}%
- }%
- }%
- \makeoddfoot{plain}{}{}{\thepage}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\chs@verville}
-% I posted the original to CTT on 2005/01/18, \textit{Headers and special
-% formatting of sections}, in answer to a question by
-% Guy Verville. This version caters for unnumbered chapters.
-% \begin{macrocode}
-\makechapterstyle{verville}{%
- \chapterstyle{default}
- \setlength{\beforechapskip}{0pt}
- \renewcommand*{\printchaptername}{}
- \renewcommand*{\printchapternum}{%
- \hrule \vskip 0.5\onelineskip
- \Huge \centering \thechapter.\ }
- \renewcommand*{\printchapternonum}{%
- \hrule \vskip 0.5\onelineskip
- \Huge \centering}
- \renewcommand*{\afterchapternum}{}
- \setlength{\midchapskip}{0pt}
- \renewcommand*{\printchaptertitle}[1]{%
- ##1 \par
- \vskip 0.5\onelineskip
- \hrule}}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \section{Mempatch version 4.7}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.7 (2006/12/23 and later)
-
-% \end{macrocode}
-%
-% \subsection{Epigraphs}
-%
-% Erik Quaeghebeur (CTT, 2006/12/21, \textit{[memoir:epigraph] dissapearing initial L/l
-% (minimal example)}) discovered that an initial `l' was deleted when
-% \texttt{flushleftright} was used for \cs{epigraphtextposition}. This was caused
-% by `fil' being the last token in the definition.
-%
-% \begin{macro}{flushleftright}
-% \changes{v4.7}{2006/12/23}{Changed \cs{flushleftright} and \cs{centerlastline}
-% so that `fil' was not the last token}
-% \begin{macrocode}
-\renewcommand*{\flushleftright}{%
- \leftskip\z@ \rightskip\z@
- \parfillskip\@flushglue}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{centerlastline}
-% \begin{macrocode}
-\renewcommand*{\centerlastline}{%
- \parfillskip=\z@ plus 2fil
- \rightskip=\z@ plus -1fil
- \leftskip\@flushglue}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{@epitext}
-% \changes{v4.7}{2006/12/23}{Added \cs{par} to \cs{@epitext} and \cs{@episource}}
-% \begin{macrocode}
-\renewcommand{\@epitext}[1]{%
- \begin{minipage}{\epigraphwidth}\begin{\textflush} #1\par
- \ifdim\epigraphrule>\z@ \@epirule \else \vspace*{1ex}\fi
- \end{\textflush}\end{minipage}}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{@episource}
-% \begin{macrocode}
-\renewcommand{\@episource}[1]{%
- \begin{minipage}{\epigraphwidth}\begin{\sourceflush} #1\par
- \end{\sourceflush}\end{minipage}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \section{Mempatch version 4.8}
-%
-% \begin{macrocode}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.8 (2007/01/22 and later)
-
-% \end{macrocode}
-%
-% \subsection{Abstracts}
-%
-% There are various problems with the code for abstracts, partly because
-% it was too early in the class file (it should have come \emph{after}
-% the code for lists).
-% \changes{v4.8}{2007/01/22}{Several changes to the code for abstracts}
-%
-% \begin{macro}{\abscolnamefont}
-% \begin{macro}{\abscoltextfont}
-% Fonts for an abstract in a two column document where the abstract
-% is part of a column. Also the default \cs{absrightmargin}.
-% \changes{v4.8}{2007/01/22}{Added \cs{abscolnamefont} and \cs{abscoltextfont}}
-% \begin{macrocode}
-%%%% \abscolnamefont and \abscoltextfont are the fonts when an abstract
-%%%% is like a section in a two column document.
-\newcommand*{\abscolnamefont}{\normalfont\Large\bfseries}
-\newcommand*{\abscoltextfont}{\normalfont}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\absleftindent}
-% \begin{macro}{\abs@leftindent}
-% \begin{macro}{\absrightindent}
-% Set these lengths \emph{after} \cs{leftmargin} and \cs{rightmargin} have
-% been set.
-% \begin{macrocode}
-\absleftindent=\leftmargin
-\abs@leftindent=\leftmargin
-\absrightindent=\leftmargin
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\setup@bstract}
-% The \cs{setup@bstract} macro set \cs{absrightindent} and it shouldn't
-% have done.
-% \changes{v4.8}{2007/01/22}{Deleted always setting \cs{absrightindent} in \cs{setup@bstract}}
-% \begin{macrocode}
-\renewcommand*{\setup@bstract}{%
- \abs@leftindent=\absleftindent
- \if@twocolumn
- \if@bsonecol
- \else
- \abs@leftindent=\z@
- \absrightindent=\z@
- \renewcommand*{\abstractnamefont}{\abscolnamefont}
- \renewcommand*{\abstracttextfont}{\abscoltextfont}
- \renewcommand*{\absnamepos}{flushleft}
- \setlength{\abstitleskip}{-2ex}
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-%
-% \section{Mempatch version 4.9}
-%
-% \begin{macrocode}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%% Version 4.9 (2007/05/02 and later)
-
-% \end{macrocode}
-%
-% \subsection{New floats}
-%
-% The original went badly wrong in assigning numbers to the different
-% float types. (This was discovered by Flavian Lambert).
-%
-% \begin{macro}{\newfloat}
-% \cs{newfloat}\oarg{within}\marg{fenv}\marg{ext}\marg{capname}
-% creates the commands for a new float environment, \meta{fenv} (aka texttt{X}),
-% using \meta{ext} (aka \texttt{Z}) as the
-% file extension and \meta{capname} for the caption name.
-% \changes{v4.9}{2007/05/02}{Changed setting of \cs{ftype@X} in \cs{newfloat}}
-% \begin{macrocode}
-\renewcommand{\newfloat}[4][\@empty]{%
-% \end{macrocode}
-% \begin{macro}{\ftype@X}
-% Define the float type, set it to the float counter, and double
-% the counter afterwards.
-% \begin{macrocode}
-%%%% \@namedef{ftype@#2}{\value{newflo@tctr}}
-%%%% \addtocounter{newflo@tctr}{\value{newflo@tctr}}
- \expandafter\edef\csname ftype@#2\endcsname{\the\c@newflo@tctr}
- \advance\c@newflo@tctr \c@newflo@tctr
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\c@X}
-% Create the counter for the caption, which must not have been previously
-% defined.
-% \begin{macrocode}
- \@ifundefined{c@#2}{% counter is not defined
- \ifx \@empty#1\relax
- \newcounter{#2}
- \else
- \newcounter{#2}[#1]
- \expandafter\edef\csname the#2\endcsname{%
- \expandafter\noexpand\csname the#1\endcsname.\noexpand\arabic{#2}}
- \fi}{}
- \setcounter{#2}{0}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\ext@X}
-% \begin{macro}{Zdepth}
-% Define \cs{ext@X} for the file extension and set the new \verb?Zdepth?
-% depth counter to 1.
-% \begin{macrocode}
- \@namedef{ext@#2}{#3} % file extension
- \@ifundefined{c@#3depth}{\newcounter{#3depth}}{}
- \setcounter{#3depth}{1}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% \begin{macro}{\fps@X}
-% \begin{macro}{\fnum@X}
-% \begin{macro}{\flegX}
-% \begin{macro}{\flegtocX}
-% \cs{fps@X} is the default float placement specification, \cs{fnum@X}
-% typesets the caption name and number, and \cs{flegX} and \cs{flegtocX}
-% are for named legends.
-% \begin{macrocode}
- \@namedef{fps@#2}{tbp} % position
- \@namedef{fnum@#2}{#4~\@nameuse{the#2}} % caption naming
- \@namedef{fleg#2}{#4} % legend naming
- \@namedef{flegtoc#2}##1{} % legend name in ToC
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{environment}{X}
-% \begin{environment}{X*}
-% Finally define the new float environment, in both normal and starred
-% forms.
-% \begin{macrocode}
- \newenvironment{#2}{\@float{#2}}{\end@float}
- \newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}
-% \end{macrocode}
-% \end{environment}
-% \end{environment}
-%
-% This ends the definition of \cs{newfloat}.
-% \begin{macrocode}
-} % end \newfloat
-
-% \end{macrocode}
-% \end{macro}
-%
-% Now correct the settings for figures and tables, and prepare for
-% user-defined floats.
-% \begin{macrocode}
-%%%% fix figure and table settings.
-\def\ftype@figure{1}
-\def\ftype@table{2}
-\setcounter{newflo@tctr}{4}
-
-% \end{macrocode}
-%
-% \subsection{Boxed verbatims}
-%
-% Per Starb\"{a}ck had problems with the adjustwidth and boxedverbatim
-% combination (see CTT \textit{Re: [memoir] adjustwidth + boxedverbatim}
-% 2007/02/10) in which Lars Madsen came up with a suggestion to use
-% \cs{linewidth}.
-%
-% \begin{macro}{\@@m@mline}
-% \cs{@@line} is \verb?\def\@@line{\hb@xt@\hsize}? but I need one
-% for \cs{linewidth}.
-% \changes{v4.9}{2007/09/08}{Added \cs{@@m@mline}}
-% \begin{macrocode}
-\newcommand*{\@@m@mline}{\hb@xt@\linewidth}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setupboxverb@line}
-% \begin{macro}{\boxedverbatim}
-% Use \cs{linewidth} instead of \cs{hsize} in these two macros.
-% \changes{v4.9}{2007/09/08}{Used \cs{linewidth} instead of \cs{hsize} in
-% \cs{setupboxverb@line} and \cs{boxedverbatim}}
-% \begin{macrocode}
-\renewcommand*{\setupboxverb@line}{%
- \par
- \ifbvperpage
- \output=\expandafter{\expandafter\boxverb@split \the\output}
- \fi
- \def\verbatim@processline{\leavevmode
- \b@vdocount%
- \bvleftsidehook\vbox{\advance% \hsize-.8\p@% changed to \linewidth
- \linewidth-.8\p@
- \@@line
- {\b@vdooutside\strut\kern\bvboxsep%
- \b@vdoinside%
- \ift@bs
- \tabverbatim@processline
- \else
- \the\verbatim@line
- \fi
- \hss}%
- \kern\bvboxsep}\bvrightsidehook\par}}
-\renewcommand*{\boxedverbatim}{\begingroup
- \let\@@line\@@m@mline%%% new in v4.9
- \setupboxverb@line
- \@verbatim
- \setupbox@verb
- \verbatim@start}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\bvtoprulehook}
-% \begin{macro}{\bvendrulehook}
-% \begin{macro}{\bvendofpage}
-% \changes{v4.9}{2007/05/02}{Added \cs{linewidth} to boxedverbatim lines}
-% \begin{macrocode}
-\renewcommand*{\bvtoprulehook}{\hrule width\linewidth \nobreak \vskip -0.1pt}
-\renewcommand*{\bvendrulehook}{\hrule width\linewidth}
-\renewcommand*{\bvendofpage}{\hrule width\linewidth\kern-0.4pt}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Chapter precis}
-%
-% Lars Madsen found that a chapter precis bumped into the chapter title
-% when the article option was used.
-% \changes{v4.9}{2007/08/18}{Changed chapter precis spacing}
-%
-% \begin{macro}{\prechapterprecisshift}
-% (Negative) Space between chapter title and a precis. Need a different value
-% for the article option.
-% \begin{macrocode}
-\newdimen\prechapterprecisshift
-\ifartopt
- \prechapterprecisshift=0pt
-\else
- \prechapterprecisshift=-2\baselineskip
-\fi
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\precisfont}
-% Font for precis typesetting.
-% \begin{macrocode}
-\newcommand*{\precisfont}{\normalfont\itshape}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\prechapterprecis}
-% Set up for typesetting the precis text (in a quote environment).
-% \begin{macrocode}
-\renewcommand*{\prechapterprecis}{%
- \vspace*{\prechapterprecisshift}%
- \begin{quote}\precisfont}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Sidebars}
-%
-% Another problem raised its head --- floats and sidebars didn't work well
-% together with the sidebar starting at odd vertical positions. As ever,
-% Donald Arseneau came to the rescue (email correspondence May 2007).
-% Even with the changes, there are still unsolved problems with full width
-% floats on top of double columns.
-% \changes{v4.9}{2007/08/18}{Another revamping of sidebar code}
-%
-% \begin{macro}{\m@mopsidebar}
-% This might be used more than once in the following code.
-% \begin{macrocode}
-\newcommand*{\m@mopsidebar}{%
- \ifvoid\sideins\else
- \setbox\@outputbox \vbox{%
- \sidecontents
- \unvbox\@outputbox}
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\mem@makecol}
-% In this version of \cs{mem@makecol} the sidebar insert is done
-% after the other inserts and floats.
-% \begin{macrocode}
-\gdef\mem@makecol{%
- \m@m@makecolintro
- \ifvoid\footins
- \setbox\@outputbox \box\@cclv
- \else
- \setbox\@outputbox \vbox{%
- \boxmaxdepth\@maxdepth
- \@tempdima\dp\@cclv
- \unvbox\@cclv
- \vskip-\@tempdima
- \vskip \skip\footins
- \color@begingroup
- \normalcolor
- \footnoterule
- \unvbox\footins
- \color@endgroup
- }
- \fi
- \m@mdoextrafeet
- \m@m@makecolfloats
- \m@mopsidebar
- \m@m@makecoltext
- \global\maxdepth \@maxdepth}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\mem@makecolbf}
-% This is a placeholder for attempts fo fix the doublefloat problem.
-% \begin{macrocode}
-\gdef\mem@makecolbf{%
- \m@m@makecolintro
- \setbox\@outputbox \box\@cclv
- \m@m@makecolfloats
- \m@mopsidebar
- \ifvoid\footins
- \else
- \setbox\@outputbox \vbox{%
- \boxmaxdepth\@maxdepth
- \unvbox\@outputbox
- \vskip \skip\footins
- \color@begingroup
- \normalcolor
- \footnoterule
- \unvbox\footins
- \color@endgroup
- }%
- \fi
- \m@m@makecoltext
- \global\maxdepth \@maxdepth}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\@reinserts}
-% A change here to use \cs{unvbox}\cs{sideins} instead of \cs{sidecontents}.
-% \begin{macrocode}
-\gdef\@reinserts{%
- \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
- \m@mdodoreinextrafeet
- \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi
- \ifvoid\sideins\else\insert\sideins{\unvbox\sideins}\fi
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Float placement}
-%
-% \begin{macro}{\setfloatlocations}
-% \cs{setfloatlocations}\marg{float}\marg{locs} sets the default
-% location for the \meta{float} class of floats (e.g., \texttt{figure})
-% to \meta{locs} (initially \texttt{tbp}). For tables might use: \\
-% \verb?\setfloatlocations{table}{htbp}?
-% \begin{macrocode}
-\newcommand*{\setfloatlocations}[2]{\@namedef{fps@#1}{#2}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Setting secnumdepth}
-%
-% The interplay between setting the \Lcount{secnumdepth} counter and
-% \Lcount{maxsecnumdepth} is not well understood. Perhaps this will help.
-%
-% \begin{macro}{\setsecnumdepth}
-% In the preamble \cs{setsecnumdepth}\marg{sec} sets both \Lcount{secnumdepth}
-% and \Lcount{maxsecnumdepth} to \meta{sec} while in the body it only sets
-% \Lcount{secnumdepth}.
-% \changes{v4.9}{2007/08/19}{Changed \cs{setsecnumdepth} to set both
-% \Lcount{secnumdepth} and \Lcount{maxsecnumdepth} counters}
-% \begin{macrocode}
-\renewcommand*{\setsecnumdepth}[1]{%
- \ifx\@nodocument\relax% after the preamble
- \@setclcnt{#1}{secnumdepth}%
- \else
- \@setclcnt{#1}{secnumdepth}%
- \@setclcnt{#1}{maxsecnumdepth}%
- \fi}
-\setsecnumdepth{section}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Appendices}
-%
-% \begin{macro}{\addappheadtotoc}
-% This needs a \cs{phantomsection} for when \Lpack{hyperref} is used.
-% \changes{v4.9}{2007/08/19}{Added \cs{phantomsection} to \cs{addappheadtotoc}}
-% \begin{macrocode}
-\renewcommand*{\addappheadtotoc}{%
- \phantomsection\addcontentsline{toc}{chapter}{\appendixtocname}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Formatting TOC page numbers}
-%
-% Dan Luecking (\ctt{} \textit{Re: setting page numbers in toc in their
-% natural-width box} 15 August 2007) suggested that a macro like
-% \cs{cftXformatpnum} should be used for controlling the typesetting
-% of page numbers in the ToC instead of the `hard coded': \\
-% \verb?\hbox to \@pnumwidth{\hfil\cftXpagefont #1}?
-% I have implemented this, but the code is scattered in earlier `patches'
-% as much of the code to be modified was given in pre 4.9 patches.
-%
-% \subsection{Heading hooks}
-%
-% At least one person thinks it a good idea to use multi-paragraph captions.
-% It therefore seems possible that others will want multi-paragraph sectional
-% headings.
-%
-% \begin{macro}{\memcaptioninfo}
-% \begin{macro}{\memlegendinfo}
-% \begin{macro}{\memnamedlegendinfo}
-% \begin{macro}{\membitwocaptioninfo}
-% \begin{macro}{\membionecaptioninfo}
-% \begin{macro}{\membicaptioninfo}
-% \changes{v4.9}{2007/08/26}{Made \cs{memcaptioninfo} and friends \cs{long}}
-% \begin{macrocode}
-\renewcommand{\memcaptioninfo}[4]{}
-\renewcommand{\memlegendinfo}[1]{}
-\renewcommand{\memnamedlegendinfo}[3]{}
-\renewcommand{\membitwonumcaptioninfo}[7]{}
-\renewcommand{\membionenumcaptioninfo}[7]{}
-\renewcommand{\membicaptioninfo}[6]{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\mempartinfo}
-% \begin{macro}{\mempartstarinfo}
-% \begin{macro}{\memchapinfo}
-% \begin{macro}{\memchapstarinfo}
-% \begin{macro}{\memappchapinfo}
-% \begin{macro}{\memappchapstarinfo}
-% \begin{macro}{\memsecinfo}
-% \begin{macro}{\memsecstarinfo}
-% \changes{v4.9}{2007/08/26}{Made \cs{mempartinfo} and friends \cs{long}}
-% \begin{macrocode}
-\renewcommand{\mempartinfo}[3]{}
-\renewcommand{\mempartstarinfo}[1]{}
-\renewcommand{\memchapinfo}[4]{}
-\renewcommand{\memchapstarinfo}[2]{}
-\renewcommand{\memappchapinfo}[4]{}
-\renewcommand{\memappchapstarinfo}[2]{}
-\renewcommand{\memsecinfo}[5]{}
-\renewcommand{\memsecstarinfo}[2]{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\mempoeminfo}
-% \begin{macro}{\mempoemstarinfo}
-% \begin{macro}{\memPoemTitleinfo}
-% \begin{macro}{\memPoemTitlestarinfo}
-% \changes{v4.9}{2007/08/26}{Made \cs{mempoeminfo} and friends \cs{long}}
-% \begin{macrocode}
-\renewcommand{\mempoeminfo}[1]{}
-\renewcommand{\mempoemstarinfo}[1]{}
-\renewcommand{\memPoemTitleinfo}[4]{}
-\renewcommand{\memPoemTitlestarinfo}[2]{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\memapppageinfo}
-% \begin{macro}{\memapppagestarinfo}
-% \begin{macro}{\memleadpageinfo}
-% \begin{macro}{\memleadpagestarinfo}
-% \changes{v4.9}{2007/08/26}{Made \cs{memapppageinfo} and friends \cs{long}}
-% \begin{macrocode}
-\renewcommand{\memapppageinfo}[1]{}
-\renewcommand{\memapppagestarinfo}[1]{}
-\renewcommand{\memleadpageinfo}[3]{}
-\renewcommand{\memleadpagestarinfo}[2]{}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Verse and Boxed Verbatims}
-%
-% Ignacio Fern\'{a}ndez Galv\'{a}n (email 2007/04/07) noticed that
-% \cs{vrightskip} had no effect on the verse line number positioning.
-%
-% \begin{macro}{\@vslnumright}
-% \begin{macro}{\@vslnumleft}
-% \changes{v4.9}{2007/05/02}{Replaced \cs{rightskip} by \cs{vrightskip}
-% in \cs{@vslnumright} and \cs{@vslnumleft}}
-% \begin{macrocode}
-\renewcommand*{\@vslnumright}{%
- \hfill\rlap{\kern\vrightskip\kern\rightmargin%
- \vlvnumfont\getthelinenumber{poemline}}}
-\renewcommand*{\@vslnumleft}{%
- \hfill\rlap{\kern-\textwidth\kern-\vrightskip%
- \vlvnumfont\getthelinenumber{poemline}}}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%
-% Somebody hiding behind the name and email address of
-% `Person \verb?facetious_nickname@hotmail.com?'
-% wanted to be able to set the first verse line number to other
-% than 1, and also start printing line numbers with that line (\ctt{}
-% \textit{verse package --- line numbering} 2 January 2007). I supplied
-% code for this, asking the requestor to tell me if it worked or not but (s)he
-% never replied. It makes you wonder whether it's worth
-% bothering to try and help folk.
-%
-% \begin{macro}{\c@memfvsline}
-% A new counter for adjustment to the starting line for printing verse
-% line numbers.
-% \begin{macrocode}
-\newcounter{memfvsline}
- \c@memfvsline=\z@
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setverselinenums}
-% \cs{setverselinenums}\marg{firstline}\marg{startnumsat} sets the first
-% verse line number to \meta{firstline} and the first line number to be
-% printed at
-% line \meta{startnumsat}. Use this within the \texttt{verse} environment
-% before the first verse. Note that this must hold: \\
-% \verb?firstline <= startnumsat < firstline+ poemlines?
-% \changes{v4.9}{2007/09/05}{Added \cs{setverselinenums} and modified
-% \cs{getthelinenumber} accordingly}
-% \begin{macrocode}
-\newcommand*{\setverselinenums}[2]{%
- \c@poemline #1\relax \advance\c@poemline \m@ne
- \refstepcounter{poemline}%
- \ifnum\z@<\linemodnum% we are printing line numbers
- \@tempcnta #2\relax
- \divide\@tempcnta\linemodnum
- \multiply\@tempcnta\linemodnum
- \c@memfvsline #2\relax
- \advance\c@memfvsline-\@tempcnta
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\getthelinenumber}
-% Revise this to cater for \cs{setverselinenums}.
-% \begin{macrocode}
-\renewcommand*{\getthelinenumber}[1]{
- \ifnum\@ne>\linemodnum% no line numbers
- \else
- \ifnum\@ne=\linemodnum% every line numbered
- \@nameuse{the#1}%
- \else
- \@tempcnta=\@nameuse{c@#1}%
- \advance\@tempcnta -\c@memfvsline
- \divide\@tempcnta \linemodnum
- \multiply\@tempcnta \linemodnum
- \advance\@tempcnta \c@memfvsline
- \ifnum\@tempcnta=\@nameuse{c@#1}\@nameuse{the#1}\fi
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% And while we're at it we might as well provide similar functionality
-% for \texttt{boxedverbatim}s. Unfortunately the calculations are slightly
-% different for the two cases, so we can't share the code.
-% \begin{macro}{\c@memfbvline}
-% A new counter for adjustment to the starting line for printing
-% \texttt{boxedverbatim} line numbers.
-% \begin{macrocode}
-\newcounter{memfbvline}
- \c@memfbvline=\z@
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\setbvlinenums}
-% \cs{setbvlinenums}\marg{firstline}\marg{startnumsat} sets the first
-% \texttt{boxedverbatim} line number to \meta{firstline} and the first
-% line number to be printed at line \meta{startnumsat}.
-% \changes{v4.9}{2007/09/05}{Added \cs{setbvlinenums} and \cs{getthebvlinenumber}}
-% \begin{macrocode}
-\newcommand*{\setbvlinenums}[2]{%
- \c@bvlinectr #1\relax \advance\c@bvlinectr \m@ne
- \ifnum\z@<\linemodnum% we are printing lines
- \@tempcnta #2\relax
- \divide\@tempcnta\linemodnum
- \multiply\@tempcnta\linemodnum
- \c@memfbvline #2\relax
- \advance\c@memfbvline-\@tempcnta
- \fi}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\getthebvlinenumber}
-% \begin{macrocode}
-\newcommand*{\getthebvlinenumber}[1]{%
- \ifnum\@ne>\linemodnum% no line numbers
- \else
- \ifnum\@ne=\linemodnum% every line numbered
- \@nameuse{the#1}%
- \else
- \@tempcnta=\@nameuse{c@#1}%
- \advance\@tempcnta-\c@memfbvline
- \divide\@tempcnta \linemodnum
- \multiply\@tempcnta \linemodnum
- \advance\@tempcnta \c@memfbvline
- \ifnum\@tempcnta=\@nameuse{c@#1}\@nameuse{the#1}\fi
- \fi
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\theb@vlinenumber}
-% \changes{v4.9}{2007/09/05}{Changed \cs{theb@vlinenumber} to use \cs{getthebvlinenumber}}
-% \begin{macrocode}
-\renewcommand*{\theb@vlinenumber}{\getthebvlinenumber{bvlinectr}}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Input files into tabulars, and etex}
-%
-% M.J. Williams (CTT \textit{\cs{noalign} problem with \cs{input} and
-% tabular in memoir class}, 28 Aug 2007) reported that using \cs{input} in a
-% tabular resulted in errors. His example was:
-% \begin{verbatim}
-% ...
-% \begin{tabular}{c|c} \hline
-% 1 & 2 \\ \hline
-% \input{data} \hline
-% 5 & 6 \\ \hline
-% \end{tabular}
-% \end{verbatim}
-% where \texttt{data.tex} contains the single line (and no newline) \\
-% \verb?3 & 4 \\?
-%
-% Morten H{\o}gholm noted that the problem
-% was caused by \Lpack{memoir}'s extension to \cs{input}
-% and gave a solution that depends on processing via
-% \texttt{etex} rather than \texttt{tex}.
-%
-% \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)}.
-% \begin{macrocode}
-%%% \ifetex is TRUE if etex is used instead of tex as the basis.
-\newif\ifetex
- \etexfalse
-\ifx\eTeXversion\@undefined\else
- \ifx\eTeXversion\relax\else
- \ifnum\eTeXversion>0\relax
- \etextrue
- \fi
- \fi
-\fi
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% Here's Morten's fix. Quoting, in part:
-% \begin{quotation}
-% \Lpack{memoir} extends the file loading mechanism by providing
-% \cs{AtBeginFile} and \cs{AtEndFile} whose arguments are executed as
-% the names indicate. \ldots after inputting a file the storage bins are
-% emptied. The problem [in your case] is that this emptying is an
-% assignment and so starts a new tabular cell and \cs{hline} is only
-% allowed after \verb?\\? or other \cs{hline}s.
-%
-% \ldots the tabular environment wraps each tabular cell in additional
-% groups so one can do an explicit test for which type of group we are in.
-% If tested to be in an align group \emph{and} in vertical mode it means
-% TeX hasn't found something to start a new cell and
-% then \cs{noalign} can be used.
-% \end{quotation}
-%
-% \begin{macrocode}
-\ifetex
- \renewcommand*{\killm@matf}[1]{%
- \ifnum 6=\currentgrouptype
- \ifvmode
- \expandafter\expandafter\expandafter\@firstoftwo
- \expandafter\expandafter\expandafter\noalign
- \fi
- \fi
- \@firstofone
- {\@namelet{#1-m@mfb}\relax
- \@namelet{#1-m@mfe}\relax
- }%
- }
-\fi
-
-% \end{macrocode}
-%
-% \subsection{Interaction with the \Lpack{float} package}
-%
-% The \Lpack{float} package also defines \cs{newfloat}.
-%
-% \begin{macro}{\newfloat}
-% Kill \cs{newfloat} if the \Lpack{float} package is loaded.
-% \changes{v4.9}{2007/09/14}{Kill \cs{newfloat} if float package is loaded}
-% \begin{macrocode}
-%%% kill \newfloat if the float package is used.
-\AtBeginPackage{float}{\let\newfloat\relax}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Interaction with the \Lpack{caption} package}
-%
-% Kill changes to the caption macros if the \Lpack{caption} package is used.
-% The \Lpack{caption} package checks the definitions of the \cs{@makecaption},
-% \cs{caption} and \cs{@caption} macros. These need to be identical to the
-% definitions in the standard classes for the package to disbelieve that
-% the \Lpack{memoir} class is being used.
-%
-% \begin{macro}{\@makecaption}
-% \begin{macro}{\caption}
-% \begin{macro}{\@caption}
-% \changes{v4.9}{2007/11/14}{Revert caption macros for the caption package}
-% \changes{v4.9a}{2007/12/18}{Added missing comment mark at end of \cs{caption}
-% for caption package checking}
-% \begin{macrocode}
-%%% revert changes to captioning macros if the caption package is used.
-\AtBeginPackage{caption}{
-\ClassWarningNoLine{memoir}{%
- You are using the caption package with the memoir \MessageBreak
- class. This may cause unexpected or inconsistent \MessageBreak
- results if you use memoir's captioning facilities}
-
-\long\def\@makecaption##1##2{%
- \vskip\abovecaptionskip
- \sbox\@tempboxa{##1: ##2}%
- \ifdim \wd\@tempboxa >\hsize
- ##1: ##2\par
- \else
- \global \@minipagefalse
- \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
- \fi
- \vskip\belowcaptionskip}
-
-\def\caption{%
- \ifx\@captype\@undefined
- \@latex@error{\noexpand\caption outside float}\@ehd
- \expandafter\@gobble
- \else
- \refstepcounter\@captype
- \expandafter\@firstofone
- \fi
- {\@dblarg{\@caption\@captype}}%
-}
-
-\long\def\@caption##1[##2]##3{%
- \par
- \addcontentsline{\csname ext@##1\endcsname}{##1}%
- {\protect\numberline{\csname the##1\endcsname}{\ignorespaces ##2}}%
- \begingroup
- \@parboxrestore
- \if@minipage
- \@setminipage
- \fi
- \normalsize
- \@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##3}\par
- \endgroup}
-}
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{XeTeX}
-%
-% Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used,
-% here's one for XeTeX.
-%
-% \begin{macro}{\ifxetex}
-% Checks if XeTeX is being used.
-% \changes{v4.9}{2007/11/14}{Added \cs{ifxetex}}
-% \changes{v4.9a}{2007/12/23}{Added more to \cs{ifxetex}}
-% \begin{macrocode}
-%%% Use this to check if XeTeX is being used.
-\newif\ifxetex
-\@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\RequireXeTeX}
-% Check for XeTeX from the \Lpack{ifxetex} package.
-% \changes{v4.9a}{2007/12/23}{Added \cs{RequireXeTeX}}
-% \begin{macrocode}
-\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}
-\EmulatedPackage{ifxetex}
-
-% \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}{\cmd}
-% \verb?\cmd{\fred}? prints \cmd{\fred}.
-% \begin{macrocode}
-%%%%\providecommand*{\cmd}[1]{\cs{\expandafter\cmd@to@cs\string#1}}
-%%%% \def\cmd@to@cs#1#2{\char\number`#2\relax}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cmdprint}
-% \begin{macro}{\cmdpx}
-% 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{Copying pagestyles}
-%
-% I missed some of the pagestyle elements in the original \cs{copypagestyle}.
-% (Problem discovered by Erik Quaeghebeur on 2007/11/27 CTT)
-%
-% \begin{macro}{\copypagestyle}
-% \changes{v4.9}{2007/11/28}{Added missing elements to \cs{copypagestyle}}
-% \begin{macrocode}
-\renewcommand*{\copypagestyle}[2]{%
- \makepagestyle{#1}%
- \makeevenhead{#1}{\@nameuse{#2eheadl}}%
- {\@nameuse{#2eheadc}}{\@nameuse{#2eheadr}}%
- \makeoddhead{#1}{\@nameuse{#2oheadl}}%
- {\@nameuse{#2oheadc}}{\@nameuse{#2oheadr}}%
- \makeevenfoot{#1}{\@nameuse{#2efootl}}%
- {\@nameuse{#2efootc}}{\@nameuse{#2efootr}}%
- \makeoddfoot{#1}{\@nameuse{#2ofootl}}%
- {\@nameuse{#2ofootc}}{\@nameuse{#2ofootr}}%
- \makerunningwidth{#1}{\@nameuse{#2runwidth}}%
-%%%% corrected these elements
- \@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
- \@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
- \@namedef{#1evenhpr}{\@nameuse{#2evenhpr}}%
- \@namedef{#1oddhpr}{\@nameuse{#2oddhpr}}%
-%%%% added these elements
- \@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
- \@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
- \@namedef{#1evenfpr}{\@nameuse{#2evenfpr}}%
- \@namedef{#1oddfpr}{\@nameuse{#2oddfpr}}%
-%%%% back to the original
- \@namedef{#1headrule}{\@nameuse{#2headrule}}%
- \@namedef{#1footrule}{\@nameuse{#2footrule}}%
- \makepsmarks{#1}{\@nameuse{#2pshook}}%
-}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{The extra font sizes}
-%
-% With Metafont fonts you can't effectively specify any font sizes other
-% than Knuth's, but with outline fonts you can as they can be scaled on the
-% fly. Here's and extension to enable these to be used.
-%
-% \begin{macro}{\@ivpt}
-% \begin{macro}{\@xxxvivpt}
-% \begin{macro}{\@xviiilpt}
-% \begin{macro}{\@lxpt}
-% \begin{macro}{\@lxxiipt}
-% Macros for font sizes --- extensions to the kernel ones.
-% \begin{macrocode}
-\newcommand*{\@ivpt}{4}
-\newcommand*{\@xxxvipt}{36}
-\newcommand*{\@xviiilpt}{48}
-\newcommand*{\@lxpt}{60}
-\newcommand*{\@lxxiipt}{72}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\extendedfontsizes}
-% \begin{macro}{\LARGE}
-% \begin{macro}{\huge}
-% \begin{macro}{\Huge}
-% \begin{macro}{\HUGE}
-% \begin{macro}{\miniscule}
-% Makes all font sizes, from \cs{miniscule} to \cs{HUGE} unique.
-% \begin{macrocode}
-\newcommand*{\extendedfontsizes}{%
-\ifcase\@ptsize % 0=10pt
- \or % 11pt
- \renewcommand*{\HUGE}{\@setfontsize\HUGE\@xxxvipt{48}}
- \or % 12pt
- \renewcommand*{\Huge}{\@setfontsize\Huge\@xxxvipt{48}}
- \renewcommand*{\HUGE}{\@setfontsize\HUGE\@xviiilpt{60}}
- \or \or % 14pt
- \renewcommand*{\huge}{\@setfontsize\huge\@xxxvipt{48}}
- \renewcommand*{\Huge}{\@setfontsize\Huge\@xviiilpt{60}}
- \renewcommand*{\HUGE}{\@setfontsize\HUGE\@lxpt{72}}
- \or \or \or % 17pt
- \renewcommand*{\LARGE}{\@setfontsize\LARGE\@xxxvipt{44}}
- \renewcommand*{\huge}{\@setfontsize\huge\@xviiilpt{60}}
- \renewcommand*{\Huge}{\@setfontsize\Huge\@lxpt{72}}
-% \renewcommand*{\HUGE}{\@setfontsize\HUGE\@lxxiipt{96}}
- \renewcommand*{\HUGE}{\@setfontsize\HUGE\@lxxiipt{90}}
- \or \or % 9pt
- \renewcommand*{\miniscule}{\@setfontsize\miniscule\@ivpt{5}}
-\fi}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Frontmatter amd mainmatter}
-%
-% If \cs{frontmatter} and \cs{mainmatter} are used with the article option,
-% then a page numbering / margin problem can occur if the frontmatter ends
-% on an odd page --- the first mainmatter next page is odd as well which throws
-% puts two odd-margined pages together.
-%
-% One fix from Morten is to always \cs{cleardoublepage} for twosided articles.
-%
-% One fix from me is for the ...matter macros to just switch on/off section
-% numbering.
-%
-% Morten's is simpler to implement.
-%
-% \begin{macro}{\@smemmain}
-% \changes{v4.9}{2007/12/07}{Changed clear pages in \cs{@smemmain}}
-% \begin{macrocode}
-\renewcommand*{\@smemmain}{%
- \@mainmattertrue
- \setcounter{secnumdepth}{\value{maxsecnumdepth}}
- \ifartopt
- \if@twoside
- \cleardoublepage
- \else
- \clearpage
- \fi
- \else
- \cleardoublepage
- \counterwithin{figure}{chapter}
- \counterwithin{table}{chapter}
- \fi}
-
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{ToC hooks}
-%
-% This is a generalisation of a suggestion by Lars Madsen (private email,
-% 2007/12/14).
-%
-% \begin{macro}{\cftinsert}
-% \begin{macro}{\cftinsertcode}
-% \begin{macro}{\cftinserthook}
-% \changes{v4.9}{2007/12/14}{Added \cs{cftinsert} and friends}
-% \changes{v4.9a}{2007/12/18}{Fixed argument bug in \cs{cftinserthook}}
-% \begin{macrocode}
-%%%
-%%% Following code suggested by Lars Madsen
-%%% Command inserted in a `List of' holding a hook for extra code
-\newcommand*{\cftinsert}[1]{\@nameuse{cftinsert#1}}
-%%% Create a hook to be executed in a `List of'. Since we use \@nameuse
-%%% it does not matter if the hook does not exist
-\newcommand{\cftinsertcode}[2]{\@namedef{cftinsert#1}{#2}}
-%%% Insert a hook into the `List of' file
-\newcommand*{\cftinserthook}[2]{%
- \addtocontents{#1}{\protect\cftinsert\protect{#2\protect}}}
-%%%
-%%% Use like this:
-%%% \cftinsertcode{A}{%
-%%% \renewcommand*{\cftchapterfont}{\normalfont\scshape}
-%%% ...
-%%% }
-%%% \cftinsertcode{F}{...}
-%%% \cftinsertcode{G}{...}
-%%% ...
-%%% \frontmatter
-%%% \tableofcontents
-%%% \cftinserthook{lof}{G}
-%%% \listoffigures
-%%% \chapter{...}
-%%% ...
-%%% \mainmatter
-%%% \cftinserthook{lof}{F}
-%%% \cftinserthook{toc}{A}
-%%% \chapter{...}
-%%%
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%
-% \subsection{Setting the ToC depth}
-%
-% \begin{macro}{\toclevel@part}
-% \begin{macro}{\toclevel@chapter}
-% Somehow I missed these out much earlier.
-% \changes{v4.9}{2007/12/14}{Added \cs{toclevel@part} and \cs{toclevel@chapter}}
-% \begin{macrocode}
-\newcommand*{\toclevel@part}{-1}
-\newcommand*{\toclevel@chapter}{0}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
%
% The end of the patch file.
%