summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memoir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-12-18 01:42:25 +0000
committerKarl Berry <karl@freefriends.org>2006-12-18 01:42:25 +0000
commit7fc8fcceed56744d8819f2f6d4b161e4c0ab0c8c (patch)
tree167eddad6b8d916f73a9062aab831e13a463ea4e /Master/texmf-dist/tex/latex/memoir
parentccf854d76f6934910055d7aef79003558819348b (diff)
memoir update 15dec06
git-svn-id: svn://tug.org/texlive/trunk@2773 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memoir')
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memhfixc.sty10
-rw-r--r--Master/texmf-dist/tex/latex/memoir/mempatch.sty1359
2 files changed, 1365 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memhfixc.sty b/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
index 15502dd75fe..a5a7f719e4f 100644
--- a/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
+++ b/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
@@ -35,6 +35,10 @@
%% \usepackage[...]{hyperref}
%% \usepackage{memhfixc}
%%
+%% With thanks to Heiko Oberdiek, if you use hyperref dated 2006/11/15
+%% or later, memhfixc will be automatically loaded after hyperref.
+%%
+%% Version 1.9 2006/11/22
%% Version 1.8 2006/01/21
%% Version 1.7 2005/11/15
%% Version 1.6 2004/05/13
@@ -45,7 +49,7 @@
%% Version 1.1 2003/01/22
%% Version 1.0 2002/10/22
%%
-\ProvidesPackage{memhfixc}[2006/01/21 v1.8 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2006/11/22 v1.9 nameref/hyperref package fixes for memoir class]
\let\M@hfixcfinish\relax
\@ifclassloaded{memoir}{}%
{\let\M@hfixcfinish\endinput
@@ -132,6 +136,8 @@
\providecommand{\bookautorefname}{Book}
+\@ifpackagelater{hyperref}{2006/11/15}{%
+}{%
\def\@@writetorep#1#2#3#4#5{%
\begingroup
\def\Hy@tempa{#5}%
@@ -185,7 +191,7 @@
{\Hy@tempa}{\Hy@tempb}%
}%
\fi
- \endgroup
+ \endgroup}
}
\@ifundefined{H@old@sectm@m}{% haven't fiddled with \M@sect
diff --git a/Master/texmf-dist/tex/latex/memoir/mempatch.sty b/Master/texmf-dist/tex/latex/memoir/mempatch.sty
index b2dc44a17d8..0f8ff85a628 100644
--- a/Master/texmf-dist/tex/latex/memoir/mempatch.sty
+++ b/Master/texmf-dist/tex/latex/memoir/mempatch.sty
@@ -22,7 +22,7 @@
%%
%% This work consists of the files listed in the README file.
%%
-\ProvidesFile{mempatch.sty}[2006/08/08 v4.5 Patches for memoir class v1.618]
+\ProvidesFile{mempatch.sty}[2006/12/11 v4.6 Patches for memoir class v1.618]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Version 4.0 was released simultaneously with version 1.618 of memoir.
@@ -40,6 +40,11 @@
%%% 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.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -501,7 +506,8 @@
\phantomsection
\addcontentsline{toc}{chapter}{\indexname}
\fi
- \thispagestyle{chapter}\parindent\z@
+%%% \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}
@@ -846,6 +852,9 @@
Type \space <return> and I'll continue.}%
\fi}
+\newcommand*{\toclevel@none}{-10}
+\newcommand*{\toclevel@all}{50}
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Version 4.5 (2006/02/11 and later)
@@ -1665,6 +1674,1352 @@
\topsepiii = \parsepii
\everylistparindent\parindent}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%% Version 4.6 (2006/11/22 and later)
+
+\EmulatedPackage{setspace}
+
+\newcommand{\setSpacing}[1]{%
+ \def\baselinestretch{#1}%
+ \@currsize}
+
+\newcommand*{\setSingleSpace}[1]{%
+ \def\m@m@singlespace{#1}}
+\setSingleSpace{1}
+
+%%% start single spacing
+\newcommand*{\SingleSpacing}{%
+ \setSpacing{\m@m@singlespace}%
+ \vskip\baselineskip% correction for coming into single spacing
+}
+\SingleSpacing
+
+%%% 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}
+
+%%% 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}
+
+\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}
+
+%%% Environment form of \SingleSpacing.
+\newenvironment{SingleSpace}{%
+ \vskip\baselineskip
+ \setSpacing{\m@m@singlespace}%
+ \vskip -\baselineskip
+}{\par}
+
+\newenvironment{SingleSpace*}{%
+ \setSpacing{\m@m@singlespace}%
+ \vskip 0.5\baselineskip
+}{\vskip -0.5\baselineskip}
+
+\newcommand*{\m@mrestore@spacing}{%
+ \par
+ \vskip \parskip
+ \vskip \baselineskip
+ \endgroup
+ \vskip -\parskip
+ \vskip -\baselineskip}
+
+%%% \begin{Spacing}{num} baselineskip is increased to num*baselineskip.
+\newenvironment{Spacing}[1]{%
+ \par
+ \begingroup
+ \setSpacing{#1}}{\m@mrestore@spacing}
+
+%%% Environment form of \OnehalfSpacing
+\newenvironment{OnehalfSpace}{%
+ \begingroup
+ \OnehalfSpacing}{\m@mrestore@spacing}
+
+%%% Environment form of \DoubleSpacing
+\newenvironment{DoubleSpace}{%
+ \begingroup
+ \DoubleSpacing}{\m@mrestore@spacing}
+
+%%% \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}}
+
+\newcommand*{\memdskips}{%
+ \advance\abovedisplayskip \memdskipstretch\abovedisplayskip
+ \advance\belowdisplayskip \memdskipstretch\belowdisplayskip
+ \advance\abovedisplayshortskip \memdskipstretch\abovedisplayshortskip
+ \advance\belowdisplayshortskip \memdskipstretch\belowdisplayshortskip
+}
+
+\everydisplay\expandafter{%
+ \the\everydisplay
+ \memdskips}
+
+\let\m@m@xfloat\@xfloat
+\def\@xfloat #1[#2]{%
+ \m@m@xfloat #1[#2]%
+ \def\baselinestretch{\m@m@singlespace}%
+ \normalsize}
+
+\newdimen\memPD
+%%% 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@}}
+
+ \def\@ivminipage[#1]{%
+ \@ifnextchar[%]
+ {\@iiminipage{t}}{\@iiiminipage{t}\relax[s]}}
+%%% 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
+
+\renewcommand{\plainfootnotes}{%
+ \let\@footnotetext\m@mold@footnotetext
+ \let\@mpfootnotetext\m@mold@mpfootnotetext}
+
+\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}}
+
+\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}
+
+\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}}
+
+\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}
+
+\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}}
+
+\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}
+
+\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}}
+
+\EmulatedPackage{parskip}
+
+\newif\ifm@mnzpskip
+%%% \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
+
+%%% 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
+
+\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}
+
+\providecommand*{\verbatim}{%
+ \topsep=-0.5\parskip
+ \@verbatim
+ \frenchspacing\@vobeyspaces \@xverbatim}
+
+\providecommand*{\@minipagerestore}{%
+ \parskip=.5\baselineskip \@plus .1\baselineskip \@minus .1\baselineskip}
+\renewcommand*{\@minipagerestore}{%
+ \let\@verbfootnotetext\@verbmpfootnotetext% for \verbfootnotein a minipage
+ \m@mdoextrafeetmini% footnotes in minipages
+ \ifm@mnzpskip \parskip=\m@mabparskip\fi}
+
+%%% \setsidecaps{<sep>}{<width>} sets sidecaption lengths
+\newcommand*{\setsidecaps}[2]{%
+ \setlength{\sidecapsep}{#1}\@memznegtest{\sidecapsep}%
+ \setlength{\sidecapwidth}{#2}\@memznegtest{\sidecapwidth}}
+
+\newcommand*{\m@sideb@left}{%
+ \@tempdimc \sidebarwidth
+ \advance\@tempdimc\sidebarhsep
+ \kern-\@tempdimc}
+\newcommand*{\m@sideb@right}{%
+ \@tempdimc \columnwidth% or \hsize
+ \advance\@tempdimc\sidebarhsep
+ \kern\@tempdimc}
+
+\newlength{\sidebartopsep}
+ \setlength{\sidebartopsep}{0pt}
+\renewcommand*{\sidebarfont}{}
+\renewcommand*{\setsidebarheight}[1]{%
+ \setlength{\dimen\sideins}{#1}%
+ \advance\dimen\sideins-\topskip
+ \advance\dimen\sideins\ht\strutbox}
+
+%%% \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
+
+\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
+ \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
+}}
+
+\renewcommand{\sidebar}[1]{%
+ \insert\sideins{%
+ \hsize\sidebarwidth
+ \@parboxrestore
+ \sidebarform \normalsize\normalfont\sidebarfont
+ \splittopskip=\ht\strutbox
+ \splitmaxdepth=\dp\strutbox % doesn't do anything useful
+ \allowbreak
+ \prevdepth=\dp\strutbox % supersedes a "top-strut"
+ \vskip-\parskip
+ #1%
+ \ifvmode\else
+ \unskip\@finalstrut\strutbox
+ \fi\par
+ \ifdim\prevdepth>\dp\strutbox \prevdepth=\dp\strutbox \fi
+ \ifdim\prevdepth>99\p@
+ \nobreak
+ \vskip-\prevdepth
+ \allowbreak
+ \vskip\dp\strutbox
+ \fi
+ \vskip\sidebarvsep}}
+
+\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{}}
+
+%%% 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}
+
+%%% \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}}
+
+%%% \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}
+%%% punctuation, am and pm for \printtime
+\newcommand*{\hmpunct}{:}% hours minutes separator
+\newcommand*{\amname}{am}% ante meridiem
+\newcommand*{\pmname}{pm}% post meridiem
+
+%%% \printtime prints time per 24 hour clock
+%%% \printtime* prints time per 12 hour clock
+\newcommand*{\printtime}{%
+ \@ifstar{\m@msprtime}{\m@mprtime}}
+\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}
+
+%%% \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}}%
+}}
+
+%%% Remove extraneous spaces from pagestyle code
+%%%
+\renewcommand*{\makepagestyle}[1]{%
+ \@namedef{ps@#1}{%
+ \@namedef{#1@evenhead}{%
+ \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \vbox{\hbox{%
+ \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \raggedright\@nameuse{#1eheadl}\strut}}\hfill
+ \parbox[b]{\@nameuse{#1runwidth}}{%
+ \centering\@nameuse{#1eheadc}\strut}\hfill
+ \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \raggedleft\@nameuse{#1eheadr}\strut}}}%
+ \@nameuse{#1headrule}}}\@nameuse{#1evenhpr}}%
+ \@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}}%
+ \@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}}%
+ \@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}}%
+ \def\@evenhead{\@nameuse{#1@evenhead}}%
+ \def\@oddhead{\@nameuse{#1@oddhead}}%
+ \def\@evenfoot{\@nameuse{#1@evenfoot}}%
+ \def\@oddfoot{\@nameuse{#1@oddfoot}}%
+ \@nameuse{#1pshook}%
+ }%
+ \makeevenhead{#1}{}{}{}%
+ \makeoddhead{#1}{}{}{}%
+ \makeevenfoot{#1}{}{}{}%
+ \makeoddfoot{#1}{}{}{}%
+ \makerunningwidth{#1}{\textwidth}%
+ \makeheadposition{#1}{}{}{}{}%
+ \makeheadrule{#1}{\textwidth}{0pt}%
+ \makefootrule{#1}{\textwidth}{\footruleheight}{\footruleskip}%
+ \makepsmarks{#1}{}%
+}
+
+\renewcommand*{\aliaspagestyle}[2]{%
+ \@namedef{ps@#1}{\@nameuse{ps@#2}}}
+
+\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}}%
+ \@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
+ \@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
+ \@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
+ \@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
+ \@namedef{#1headrule}{\@nameuse{#2headrule}}%
+ \@namedef{#1footrule}{\@nameuse{#2footrule}}%
+ \makepsmarks{#1}{\@nameuse{#2pshook}}%
+}
+
+\renewcommand*{\ifonlyfloats}[2]{\if@fcolmade #1\else #2\fi}
+
+\renewcommand*{\mergepagefloatstyle}[3]{%
+ \@nameuse{ps@#3}\@nameuse{ps@#2}%
+ \@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}}}%
+ \@namedef{#1pshook}{\@nameuse{#2pshook}}%
+}}
+\makepagestyle{empty}
+
+\makepagestyle{plain}
+ \makeevenfoot{plain}{}{\thepage}{}
+ \makeoddfoot{plain}{}{\thepage}{}
+
+\if@twoside
+ \makepagestyle{headings}
+ \makepsmarks{headings}{%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \@chapapp\ \thechapter. \ %
+ \fi
+ \fi
+ ##1}}{}}%
+ \def\tocmark{\markboth{\MakeUppercase{\contentsname}}{}}%
+ \def\lofmark{\markboth{\MakeUppercase{\listfigurename}}{}}%
+ \def\lotmark{\markboth{\MakeUppercase{\listtablename}}{}}%
+ \def\bibmark{\markboth{\MakeUppercase{\bibname}}{}}%
+ \def\indexmark{\markboth{\MakeUppercase{\indexname}}{}}%
+ \def\sectionmark##1{%
+ \markright{\MakeUppercase{%
+ \ifnum \c@secnumdepth > \z@
+ \thesection. \ %
+ \fi
+ ##1}}}%
+ }%
+ \makeevenhead{headings}{\thepage}{}{\slshape\leftmark}
+ \makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
+\else
+ \makepagestyle{headings}
+ \makepsmarks{headings}{%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markright{\MakeUppercase{%
+ \ifnum \c@secnumdepth >\m@ne
+ \if@mainmatter
+ \@chapapp\ \thechapter. \ %
+ \fi
+ \fi
+ ##1}}}%
+ \def\tocmark{\markright{\MakeUppercase{\contentsname}}}%
+ \def\lofmark{\markright{\MakeUppercase{\listfigurename}}}%
+ \def\lotmark{\markright{\MakeUppercase{\listtablename}}}%
+ \def\bibmark{\markright{\MakeUppercase{\bibname}}}%
+ \def\indexmark{\markright{\MakeUppercase{\indexname}}}%
+ }
+ \makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
+\fi
+
+\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}
+
+\aliaspagestyle{chapter}{plain}
+\aliaspagestyle{part}{plain}
+\aliaspagestyle{cleared}{empty}
+
+\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
+ \hbox{}\thispagestyle{cleared}%
+ \newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
+
+\makepagestyle{ruled}
+\makeevenfoot{ruled}{\thepage}{}{}
+\makeoddfoot{ruled}{}{}{\thepage}
+\makeheadrule{ruled}{\textwidth}{\normalrulethickness}
+\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}
+\makeevenhead{ruled}{\scshape\leftmark}{}{}
+\makeoddhead{ruled}{}{}{\rightmark}
+
+\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}
+
+%%%%\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}
+
+%% \subsection{Theindex}
+\aliaspagestyle{indextitlepagestyle}{chapter}
+
+%%%%%%% Fix for inconsistent chapter styles and ToC, etc style.
+\renewcommand*{\newlistof}[3]{%
+ \@namedef{ext@#2}{#2}
+ \@ifundefined{c@#2depth}{\newcounter{#2depth}}{}
+ \setcounter{#2depth}{1}
+ \@namedef{#2mark}{\markboth{#3}{#3}}
+ \@namedef{#1}{\@ifstar{\@nameuse{@star#2}}{\@nameuse{@plain#2}}}
+ \@namedef{@star#2}{%
+ \ensureonecol
+ \par
+ \begingroup
+%%%%%%% \parindent\z@ \parskip\cftparskip
+ \@nameuse{@#2maketitle}
+ \@starttoc{#2}%
+ \endgroup
+ \restorefromonecol}
+ \@namedef{@plain#2}{%
+ \ensureonecol
+ \par
+ \begingroup
+%%%%%%% \parindent\z@ \parskip\cftparskip
+ \@nameuse{@#2maketitle}
+ \phantomsection
+ \addcontentsline{toc}{chapter}{#3}
+\parskip\cftparskip
+ \@starttoc{#2}%
+ \endgroup
+ \restorefromonecol}
+ \@namedef{@#2maketitle}{%
+ \@nameuse{#2headstart}
+ {\parindent\z@
+%%%%%%%% \parskip\cftparskip
+ \interlinepenalty\@M
+ \@nameuse{print#2nonum}%
+ \@nameuse{print#2title}{#3}%
+ \@nameuse{#2mark}%
+ \thispagestyle{chapter}%
+ \@nameuse{after#2title}
+ }
+ \@afterheading}
+ \@namedef{#2headstart}{\chapterheadstart}
+ \@namedef{after#2title}{\afterchaptertitle}
+ \@namedef{print#2nonum}{\printchapternonum}
+ \@namedef{print#2title}##1{\printchaptertitle{##1}}
+} % end \newlistof
+
+\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}
+
+\newlistof{tableofcontents}{toc}{\contentsname}
+\newlistof{listoffigures}{lof}{\listfigurename}
+\newlistof{listofables}{lot}{\listtablename}
+%%% remove subfigure support
+\renewcommand*{\@cftl@subfigtab}{}
+
+\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}}
+
+%% Stefano Bianchi, ctt 2003/12/09 `New chapter style: chapter vs chapter*'
+\makechapterstyle{bianchi}{%
+ \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}}
+
+\makechapterstyle{bringhurst}{%
+ \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}}
+
+\makechapterstyle{brotherton}{%
+ \renewcommand*{\printchapternum}{\chapnumfont
+ \ifanappendix \thechapter \else \numtoName{\c@chapter}\fi}}
+
+\makechapterstyle{chappell}{%
+ \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}}
+
+\makechapterstyle{culver}{%
+ \chapterstyle{article}%
+%%% \renewcommand*{\thechapter}{\Roman{chapter}}
+ \renewcommand*{\printchapternum}{% center number/title
+ \centering\chapnumfont \thechapter\space}%
+ \renewcommand*{\printchapternonum}{\centering}
+ \renewcommand*{\clearforchapter}{}% no new page
+ \aliaspagestyle{chapter}{headings}% no special pagestyle
+}
+
+\makechapterstyle{dash}{%
+ \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}}
+
+\makechapterstyle{demo2}{%
+ \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}}
+
+\makechapterstyle{ell}{%
+ \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}}
+
+%% Gerardo Garcia, ctt 2002/04/12, `Fancy Headings, Chapter Headings
+\makechapterstyle{Ger}{%
+ \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}}}
+
+\makechapterstyle{lyhne}{% needs graphicx package
+ \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}}
+
+%% posted to ctt, December 2003
+%%%% \usepackage{graphicx}
+\makechapterstyle{madsen}{%
+ \renewcommand*{\chapnamefont}{%
+ \normalfont\Large\scshape\raggedleft}
+ \renewcommand*{\chaptitlefont}{%
+ \normalfont\Huge\bfseries\sffamily}
+ \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}}
+
+\newcommand*{\colorchapnum}{}
+\newcommand*{\colorchaptitle}{}
+\makechapterstyle{pedersen}{%
+ \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}
+}
+
+%% Thomas Dye's southall chapter style
+\makechapterstyle{southall}{%
+ \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}}
+
+\makechapterstyle{thatcher}{%
+ \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}}}
+
+%% 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}{%
+ \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{\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}}
+
+\makechapterstyle{verville}{%
+ \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}}
+
\endinput
%%
%% End of file `mempatch.sty'.