summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memoir/memoir.cls
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/tex/latex/memoir/memoir.cls
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/tex/latex/memoir/memoir.cls')
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memoir.cls4927
1 files changed, 3618 insertions, 1309 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls
index a39967ed2be..f1c5e71d68a 100644
--- a/Master/texmf-dist/tex/latex/memoir/memoir.cls
+++ b/Master/texmf-dist/tex/latex/memoir/memoir.cls
@@ -8,7 +8,7 @@
%%
%% Author: Peter Wilson (herries dot press at earthlink dot net)
%% Herries Press
-%% Copyright 2001--2005 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
@@ -25,12 +25,14 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{memoir}%
- [2005/09/25 v1.618 configurable document class]
-\newcommand{\@ptsize}{}
+ [2008/05/26 v1.61803 configurable book, report, article document class]
+\newcommand*{\@ptsize}{}
+\newcommand*{\@memptsize}{}
\newlength{\onelineskip}
\newlength{\lxvchars}
\newlength{\xlvchars}
\newcount\@memcnta
+\newcounter{@memmarkcntra}
\newif\if@restonecol
\newif\if@openright
\@openrighttrue
@@ -44,6 +46,9 @@
\newif\if@memoldfont
\@memoldfontfalse
+\newif\ifextrafontsizes
+ \extrafontsizesfalse
+
\newcommand*{\@memerror}{\ClassError{memoir}}
\newcommand*{\@memwarn}{\ClassWarning{memoir}}
@@ -76,6 +81,8 @@
\expandafter\let\csname #1\endcsname}
\newcommand{\@namelongdef}[1]{%
\long\expandafter\def\csname #1\endcsname}
+\newcommand{\@nameedef}[1]{%
+ \expandafter\protected@edef\csname #1\endcsname}
\newcommand{\memjustarg}[1]{#1}
\newcommand{\memgobble}[1]{}
@@ -105,6 +112,92 @@
\@onlypreamble\EmulatedPackageWithOptions
\@onlypreamble\@emulated@package
+\newcommand*{\DisemulatePackage}[1]{%
+ \@namelet{ver@#1.\pkgextension}\relax}
+\@onlypreamble\DisemulatePackage
+
+\renewcommand{\InputIfFileExists}[2]{%
+ \IfFileExists{#1}%
+ {#2\@addtofilelist{#1}\m@matbeginf{#1}%
+ \@@input \@filef@und
+ \m@matendf{#1}%
+ \killm@matf{#1}}}
+
+\newcommand{\m@matbeginf}[1]{\@ifundefined{#1-m@mfb}{}%
+ {\@nameuse{#1-m@mfb}}}
+\newcommand{\m@matendf}[1]{\@ifundefined{#1-m@mfe}{}%
+ {\@nameuse{#1-m@mfe}}}
+
+\newcommand*{\killm@matf}[1]{%
+ \@namelet{#1-m@mfb}\relax
+ \@namelet{#1-m@mfe}\relax}
+
+\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}}}
+
+\newcommand{\AtBeginPackage}[2]{%
+ \AtBeginFile{#1.\@pkgextension}{#2}}
+\newcommand{\AtEndPackage}[2]{%
+ \AtEndFile{#1.\@pkgextension}{#2}}
+\newcommand{\RequireAtEndPackage}[2]{%
+ \@ifpackageloaded{#1}{#2}%
+ {\AtEndFile{#1.\@pkgextension}{#2}}}
+
+\newcommand{\AtBeginClass}[2]{%
+ \AtBeginFile{#1.\@clsextension}{#2}}
+\newcommand{\AtEndClass}[2]{%
+ \AtEndFile{#1.\@clsextension}{#2}}
+\newcommand{\RequireAtEndClass}[2]{%
+ \@ifclassloaded{#1}{#2}%
+ {\AtEndFile{#1.\@clsextension}{#2}}}
+
+\newcommand{\phantomsection}{}
+
+ \renewcommand*{\nofiles}{%
+ \@fileswfalse% flag for suppressing \immediate \writes
+ \typeout{No auxiliary output files.^^J}%
+ \long\def\protected@write##1##2##3%
+ {\write\m@ne{}\if@nobreak\ifvmode\nobreak\fi\fi}%
+ }
+
+\newcommand*{\memsetcounter}[2]{\setcounter{#1}{#2}}
+\AtBeginDocument{\immediate\write\@mainaux{%
+ \string\providecommand*{\string\memsetcounter}[2]{}}}
+
+\def\bs{\texttt{\char`\\}}
+\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}
+
+\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`\)}}
+\DeclareRobustCommand{\cs}[1]{\texttt{\char`\\#1}}
+\newcommand{\cmdprint}[1]{\texttt{\string#1}}
+\newcommand{\cmd}[1]{\cmdprint{#1}%
+ \index{\expandafter\@gobble\string#1?\string\cmdprint{\string#1}}}
+
\newif\ifpdf
\ifx\pdfoutput\undefined
\else
@@ -116,16 +209,33 @@
\fi
\fi
\fi
-%%\@memfakeusepackage{ifpdf}
-\newcommand{\phantomsection}{}
+\newif\ifetex
+ \etexfalse
+\ifx\eTeXversion\@undefined\else
+ \ifx\eTeXversion\relax\else
+ \ifnum\eTeXversion>0\relax
+ \etextrue
+ \fi
+ \fi
+\fi
- \renewcommand*{\nofiles}{%
- \@fileswfalse% flag for suppressing \immediate \writes
- \typeout{No auxiliary output files.^^J}%
- \long\def\protected@write##1##2##3%
- {\write\m@ne{}\if@nobreak\ifvmode\nobreak\fi\fi}%
- }
+\newif\ifxetex
+\@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue}
+\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}
+
+\newif\ifluatex
+ \luatexfalse
+\ifx\luatexversion\@undefined\else
+ \ifx\luatexversion\relax
+ \luatextrue
+ \fi
+\fi
\edef\wo@dmacro{%
\string m\string a\string c\string r\string o\string :%
@@ -267,54 +377,148 @@
\newlength{\trimtop}
\newlength{\trimedge}
-\DeclareOption{a3paper}
- {\setlength\stockheight {420mm}%
- \setlength\stockwidth {297mm}}
-\DeclareOption{a4paper}
- {\setlength\stockheight {297mm}%
- \setlength\stockwidth {210mm}}
-\DeclareOption{a5paper}
- {\setlength\stockheight {210mm}%
- \setlength\stockwidth {148mm}}
-\DeclareOption{a6paper}
- {\setlength\stockheight {148mm}%
- \setlength\stockwidth {105mm}}
-\DeclareOption{b3paper}
- {\setlength\stockheight {500mm}%
- \setlength\stockwidth {353mm}}
-\DeclareOption{b4paper}
- {\setlength\stockheight {353mm}%
- \setlength\stockwidth {250mm}}
-\DeclareOption{b5paper}
- {\setlength\stockheight {250mm}%
- \setlength\stockwidth {176mm}}
-\DeclareOption{b6paper}
- {\setlength\stockheight {176mm}%
- \setlength\stockwidth {125mm}}
-\DeclareOption{letterpaper}
- {\setlength\stockheight {11in}%
- \setlength\stockwidth {8.5in}}
-\DeclareOption{legalpaper}
- {\setlength\stockheight {14in}%
- \setlength\stockwidth {8.5in}}
-\DeclareOption{executivepaper}
- {\setlength\stockheight {10.5in}%
- \setlength\stockwidth {7.25in}}
+\newcommand*{\stockdbill} {\stockheight=7in \stockwidth=3in}
+\newcommand*{\stockstatement} {\stockheight=8.5in \stockwidth=5.5in}
+\newcommand*{\stockexecutive} {\stockheight=10.5in \stockwidth=7.25in}
+\newcommand*{\stockletter} {\stockheight=11in \stockwidth=8.5in}
+\newcommand*{\stockold} {\stockheight=12in \stockwidth=9in}
+\newcommand*{\stocklegal} {\stockheight=14in \stockwidth=8.5in}
+\newcommand*{\stockledger} {\stockheight=17in \stockwidth=11in}
+\newcommand*{\stockbroadsheet}{\stockheight=22in \stockwidth=17in}
+
+\newcommand*{\stockpottvo} {\stockheight=6.25in \stockwidth=4in}
+\newcommand*{\stockfoolscapvo} {\stockheight=6.75in \stockwidth=4.25in}
+\newcommand*{\stockcrownvo} {\stockheight=7.5in \stockwidth=5in}
+\newcommand*{\stockpostvo} {\stockheight=8in \stockwidth=5in}
+\newcommand*{\stocklargecrownvo}{\stockheight=8in \stockwidth=5.25in}
+\newcommand*{\stocklargepostvo} {\stockheight=8.25in \stockwidth=5.25in}
+\newcommand*{\stocksmalldemyvo} {\stockheight=8.5in \stockwidth=5.675in}
+\newcommand*{\stockdemyvo} {\stockheight=8.75in \stockwidth=5.675in}
+\newcommand*{\stockmediumvo} {\stockheight=9in \stockwidth=5.75in}
+\newcommand*{\stocksmallroyalvo}{\stockheight=9.25in \stockwidth=6.175in}
+\newcommand*{\stockroyalvo} {\stockheight=10in \stockwidth=6.25in}
+\newcommand*{\stocksuperroyalvo}{\stockheight=10.25in \stockwidth=6.75in}
+\newcommand*{\stockimperialvo} {\stockheight=11in \stockwidth=7.5in}
+
+\newcommand*{\stockmcrownvo} {\stockheight=186mm \stockwidth=123mm}
+\newcommand*{\stockmlargecrownvo} {\stockheight=198mm \stockwidth=129mm}
+\newcommand*{\stockmdemyvo} {\stockheight=216mm \stockwidth=138mm}
+\newcommand*{\stockmsmallroyalvo} {\stockheight=234mm \stockwidth=156mm}
+
+\newcommand*{\stockaiii}{\stockheight=420mm \stockwidth=297mm}
+\newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm}
+\newcommand*{\stockav} {\stockheight=210mm \stockwidth=148mm}
+\newcommand*{\stockavi} {\stockheight=148mm \stockwidth=105mm}
+
+\newcommand*{\stockbiii}{\stockheight=500mm \stockwidth=353mm}
+\newcommand*{\stockbiv} {\stockheight=353mm \stockwidth=250mm}
+\newcommand*{\stockbv} {\stockheight=250mm \stockwidth=176mm}
+\newcommand*{\stockbvi} {\stockheight=176mm \stockwidth=125mm}
+
+\newcommand*{\pagedbill} {\pageheight=7in \pagewidth=3in}
+\newcommand*{\pagestatement} {\pageheight=8.5in \pagewidth=5.5in}
+\newcommand*{\pageexecutive} {\pageheight=10.5in \pagewidth=7.25in}
+\newcommand*{\pageletter} {\pageheight=11in \pagewidth=8.5in}
+\newcommand*{\pageold} {\pageheight=12in \pagewidth=9in}
+\newcommand*{\pagelegal} {\pageheight=14in \pagewidth=8.5in}
+\newcommand*{\pageledger} {\pageheight=17in \pagewidth=11in}
+\newcommand*{\pagebroadsheet}{\pageheight=22in \pagewidth=17in}
+
+\newcommand*{\pagepottvo} {\pageheight=6.25in \pagewidth=4in}
+\newcommand*{\pagefoolscapvo} {\pageheight=6.75in \pagewidth=4.25in}
+\newcommand*{\pagecrownvo} {\pageheight=7.5in \pagewidth=5in}
+\newcommand*{\pagepostvo} {\pageheight=8in \pagewidth=5in}
+\newcommand*{\pagelargecrownvo}{\pageheight=8in \pagewidth=5.25in}
+\newcommand*{\pagelargepostvo} {\pageheight=8.25in \pagewidth=5.25in}
+\newcommand*{\pagesmalldemyvo} {\pageheight=8.5in \pagewidth=5.675in}
+\newcommand*{\pagedemyvo} {\pageheight=8.75in \pagewidth=5.675in}
+\newcommand*{\pagemediumvo} {\pageheight=9in \pagewidth=5.75in}
+\newcommand*{\pagesmallroyalvo}{\pageheight=9.25in \pagewidth=6.175in}
+\newcommand*{\pageroyalvo} {\pageheight=10in \pagewidth=6.25in}
+\newcommand*{\pagesuperroyalvo}{\pageheight=10.25in \pagewidth=6.75in}
+\newcommand*{\pageimperialvo} {\pageheight=11in \pagewidth=7.5in}
+
+\newcommand*{\pagemcrownvo} {\pageheight=186mm \pagewidth=123mm}
+\newcommand*{\pagemlargecrownvo} {\pageheight=198mm \pagewidth=129mm}
+\newcommand*{\pagemdemyvo} {\pageheight=216mm \pagewidth=138mm}
+\newcommand*{\pagemsmallroyalvo} {\pageheight=234mm \pagewidth=156mm}
+
+\newcommand*{\pageaiii}{\pageheight=420mm \pagewidth=297mm}
+\newcommand*{\pageaiv} {\pageheight=297mm \pagewidth=210mm}
+\newcommand*{\pageav} {\pageheight=210mm \pagewidth=148mm}
+\newcommand*{\pageavi} {\pageheight=148mm \pagewidth=105mm}
+
+\newcommand*{\pagebiii}{\pageheight=500mm \pagewidth=353mm}
+\newcommand*{\pagebiv} {\pageheight=353mm \pagewidth=250mm}
+\newcommand*{\pagebv} {\pageheight=250mm \pagewidth=176mm}
+\newcommand*{\pagebvi} {\pageheight=176mm \pagewidth=125mm}
+
+\DeclareOption{a3paper}{\stockaiii}
+\DeclareOption{a4paper}{\stockaiv}
+\DeclareOption{a5paper}{\stockav}
+\DeclareOption{a6paper}{\stockavi}
+\DeclareOption{b3paper}{\stockbiii}
+\DeclareOption{b4paper}{\stockbiv}
+\DeclareOption{b5paper}{\stockbv}
+\DeclareOption{b6paper}{\stockbvi}
+\DeclareOption{mcrownvopaper}{\stockmcrownvo}
+\DeclareOption{mlargecrownvopaper}{\stockmlargecrownvo}
+\DeclareOption{mdemyvopaper}{\stockmdemyvo}
+\DeclareOption{msmallroyalvopaper}{\stockmsmallroyalvo}
+
+\DeclareOption{dbillpaper}{\stockdbill}
+\DeclareOption{statementpaper}{\stockstatement}
+\DeclareOption{executivepaper}{\stockexecutive}
+\DeclareOption{letterpaper}{\stockletter}
+\DeclareOption{oldpaper}{\stockold}
+\DeclareOption{legalpaper}{\stocklegal}
+\DeclareOption{ledgerpaper}{\stockledger}
+\DeclareOption{broadsheetpaper}{\stockbroadsheet}
+
+\DeclareOption{pottvopaper}{\stockpottvo}
+\DeclareOption{foolscapvopaper}{\stockfoolscapvo}
+\DeclareOption{crownvopaper}{\stockcrownvo}
+\DeclareOption{postvopaper}{\stockpostvo}
+\DeclareOption{largecrownvopaper}{\stocklargecrownvo}
+\DeclareOption{largepostvopaper}{\stocklargepostvo}
+\DeclareOption{smalldemyvopaper}{\stocksmalldemyvo}
+\DeclareOption{demyvopaper}{\stockdemyvo}
+\DeclareOption{mediumvopaper}{\stockmediumvo}
+\DeclareOption{smallroyalvopaper}{\stocksmallroyalvo}
+\DeclareOption{royalvopaper}{\stockroyalvo}
+\DeclareOption{superroyalvopaper}{\stocksuperroyalvo}
+\DeclareOption{imperialvopaper}{\stockimperialvo}
+
\DeclareOption{ebook}
{\setlength\stockheight {9in}%
\setlength\stockwidth {6in}}
+
\DeclareOption{landscape}
{\setlength\@tempdima {\stockheight}
\setlength\stockheight{\stockwidth}
\setlength\stockwidth {\@tempdima}}
-\renewcommand{\@ptsize}{0}
-\DeclareOption{9pt}{\renewcommand{\@ptsize}{9}}
-\DeclareOption{10pt}{\renewcommand{\@ptsize}{0}}
-\DeclareOption{11pt}{\renewcommand{\@ptsize}{1}}
-\DeclareOption{12pt}{\renewcommand{\@ptsize}{2}}
-\DeclareOption{14pt}{\renewcommand{\@ptsize}{4}}
-\DeclareOption{17pt}{\renewcommand{\@ptsize}{7}}
+\renewcommand*{\@ptsize}{0}
+\renewcommand*{\@memptsize}{10}
+\DeclareOption{9pt}{\renewcommand*{\@ptsize}{9}\renewcommand*{\@memptsize}{9}}
+\DeclareOption{10pt}{\renewcommand*{\@ptsize}{0}\renewcommand*{\@memptsize}{10}}
+\DeclareOption{11pt}{\renewcommand*{\@ptsize}{1}\renewcommand*{\@memptsize}{11}}
+\DeclareOption{12pt}{\renewcommand*{\@ptsize}{2}\renewcommand*{\@memptsize}{12}}
+\DeclareOption{14pt}{\renewcommand*{\@ptsize}{4}\renewcommand*{\@memptsize}{14}}
+\DeclareOption{17pt}{\renewcommand*{\@ptsize}{7}\renewcommand*{\@memptsize}{17}}
+\DeclareOption{20pt}{\renewcommand*{\@ptsize}{20}\renewcommand*{\@memptsize}{20}}
+\DeclareOption{25pt}{\renewcommand*{\@ptsize}{25}\renewcommand*{\@memptsize}{25}}
+\DeclareOption{30pt}{\renewcommand*{\@ptsize}{30}\renewcommand*{\@memptsize}{30}}
+\DeclareOption{36pt}{\renewcommand*{\@ptsize}{36}\renewcommand*{\@memptsize}{36}}
+\DeclareOption{48pt}{\renewcommand*{\@ptsize}{48}\renewcommand*{\@memptsize}{48}}
+\DeclareOption{60pt}{\renewcommand*{\@ptsize}{60}\renewcommand*{\@memptsize}{60}}
+
+\newif\if@nyptsizeopt
+ \@nyptsizeoptfalse
+\providecommand*{\anyptfilebase}{mem}
+\providecommand*{\anyptsize}{10}
+\DeclareOption{*pt}{\@nyptsizeopttrue}
+
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\DeclareOption{onecolumn}{\@twocolumnfalse}
@@ -343,9 +547,6 @@
\artoptfalse
\DeclareOption{article}{\artopttrue}
-\DeclareOption{subfigure}{%
- \ClassWarningNoLine{memoir}{The subfigure option is not required}}
-
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}
\DeclareOption{openleft}{\@openlefttrue}
@@ -366,11 +567,10 @@
\listparindent \itemindent
\parsep \z@
}%
- \renewcommand\newblock{\par}}%
-}
+ \renewcommand\newblock{\par}}}
-\DeclareOption{oldfontcommands}{%
- \@memoldfonttrue}
+\DeclareOption{oldfontcommands}{\@memoldfonttrue}
+\DeclareOption{extrafontsizes}{\extrafontsizestrue}
\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside}
\ProcessOptions
@@ -394,11 +594,56 @@
\fi
\fi
-\ifnum\@ptsize = 9\relax
- \input{mem\@ptsize.clo}
+\newcommand*{\@ivpt}{4}
+\newcommand*{\@xxxpt}{30}
+\newcommand*{\@xxxvipt}{36}
+\newcommand*{\@xlviiipt}{48}
+\newcommand*{\@lxpt}{60}
+\newcommand*{\@lxxiipt}{72}
+\newcommand*{\@lxxxivpt}{84}
+\newcommand*{\@xcvipt}{96}
+\newcommand*{\@cviiipt}{108}
+\newcommand*{\@cxxpt}{120}
+\newcommand*{\@cxxxiipt}{132}
+
+\providecommand*{\memfontfamily}{lmr}
+\providecommand*{\memfontenc}{T1}
+\providecommand*{\memfontpack}{lmodern}
+
+\if@nyptsizeopt
+ \newcommand*{\@nyptclofile}{\anyptfilebase\anyptsize.clo}
+ \IfFileExists{\@nyptclofile}{\def\@memptsize{\anyptsize}}{%
+ \@memerror{You have used the `*pt' option but \MessageBreak
+ file \@nyptclofile\space can't be found}%
+ {I'll use mem10.clo instead}
+ \renewcommand*{\@nyptclofile}{mem10.clo}%
+ \def\@memptsize{10}%
+ }
+ \renewcommand*{\@ptsize}{\@memptsize}
+ \usefont{\memfontenc}{\memfontfamily}{m}{n}
+ \input{\@nyptclofile}
+ \usepackage{\memfontpack}\usepackage[\memfontenc]{fontenc}
\else
- \input{mem1\@ptsize.clo}
+ \ifextrafontsizes
+ \usefont{\memfontenc}{\memfontfamily}{m}{n}
+ \input{mem\@memptsize.clo}
+ \usepackage{\memfontpack}\usepackage[\memfontenc]{fontenc}
+ \else
+ \ifnum\@memptsize > 17\relax
+ \@memerror{The `extrafontsizes' option is required to use \MessageBreak
+ the `\@memptsize pt' option}%
+ {The 17pt option will be used instead}
+ \input{mem17.clo}
+ \else
+ \ifnum\@ptsize = 9\relax
+ \input{mem\@ptsize.clo}
+ \else
+ \input{mem1\@ptsize.clo}
+ \fi
+ \fi
+ \fi
\fi
+
\newcommand{\captionsize}{\normalsize}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
@@ -409,14 +654,14 @@
\@highpenalty 301
\clubpenalty 1000
\widowpenalty 1000
-\newcommand{\setlxvchars}[1][\normalfont]{\begingroup
+\newcommand*{\setlxvchars}[1][\normalfont]{\begingroup
#1
\settowidth{\lxvchars}{abcdefghijklmnopqrstuvwxyz}%
\setlength{\lxvchars}{2.042\lxvchars}%
\addtolength{\lxvchars}{33.41pt}%
\global\lxvchars=\lxvchars
\endgroup}
-\newcommand{\setxlvchars}[1][\normalfont]{\begingroup
+\newcommand*{\setxlvchars}[1][\normalfont]{\begingroup
#1
\settowidth{\xlvchars}{abcdefghijklmnopqrstuvwxyz}%
\setlength{\xlvchars}{1.415\xlvchars}%
@@ -424,24 +669,24 @@
\global\xlvchars=\xlvchars
\endgroup}
-\newcommand{\setrectanglesize}[3]{%
+\newcommand*{\setrectanglesize}[3]{%
\nametest{#1}{*}%
\ifsamename % H = *
\nametest{#2}{*}%
\ifsamename % W = *
\@memerror{%
The combination of argument values is ambiguous.\MessageBreak
- The lengths will be set to zero}{\@ehd}
- \@tempdima = \z@
- \@tempdimb = \z@
+ The lengths will be set to zero}{\@ehd}%
+ \setlength{\@tempdima}{0pt}%
+ \setlength{\@tempdimb}{0pt}%
\else % W
\nametest{#3}{*}%
\ifsamename % r = *
- \@tempdimb = #2\relax
- \@tempdima = \@tempdimb
+ \setlength{\@tempdimb}{#2}%
+ \setlength{\@tempdima}{\@tempdimb}%
\else % r
- \@tempdimb = #2\relax
- \@tempdima = #3\@tempdimb
+ \setlength{\@tempdimb}{#2}%
+ \setlength{\@tempdima}{#3\@tempdimb}%
\fi
\fi
\else % H
@@ -449,20 +694,19 @@
\ifsamename % W = *
\nametest{#3}{*}%
\ifsamename % r = *
- \@tempdima = #1\relax
- \@tempdimb = \@tempdima
+ \setlength{\@tempdima}{#1}%
+ \setlength{\@tempdimb}{\@tempdima}%
\else % r
- \@tempdima = #1\relax
- \@tempdimb = #3\@tempdima
+ \setlength{\@tempdima}{#1}%
+ \setlength{\@tempdimb}{#3\@tempdima}%
\fi
\else % W
- \@tempdima = #1\relax
- \@tempdimb = #2\relax
+ \setlength{\@tempdima}{#1}%
+ \setlength{\@tempdimb}{#2}%
\fi
- \fi
-}
+ \fi}
-\newcommand{\setfillsize}[5]{%
+\newcommand*{\setfillsize}[5]{%
\nametest{#2}{*}%
\ifsamename % C = *
\nametest{#3}{*}%
@@ -472,21 +716,21 @@
\@memerror{%
The combination of argument values is ambiguous.\MessageBreak
The lengths will be set to zero}{\@ehd}
- \@tempdima = \z@
- \@tempdimb = \z@
- \@tempdimc = \z@
+ \setlength{\@tempdima}{0pt}%
+ \setlength{\@tempdimb}{0pt}%
+ \setlength{\@tempdimc}{0pt}%
\else % R
\nametest{#5}{*}%
\ifsamename % r = *
- \@tempdimb = #4\relax
- \@tempdima = \@tempdimb
- \@tempdimc = #1\relax
+ \setlength{\@tempdimb}{#4}%
+ \setlength{\@tempdima}{\@tempdimb}%
+ \setlength{\@tempdimc}{#1}%
\advance\@tempdimc -\@tempdima
\advance\@tempdimc -\@tempdimb
\else % r
- \@tempdimb = #4\relax
- \@tempdima = #5\@tempdimb
- \@tempdimc = #1\relax
+ \setlength{\@tempdimb}{#4}%
+ \setlength{\@tempdima}{#5\@tempdimb}%
+ \setlength{\@tempdimc}{#1}%
\advance\@tempdimc -\@tempdima
\advance\@tempdimc -\@tempdimb
\fi
@@ -496,22 +740,22 @@
\ifsamename % R = *
\nametest{#5}{*}%
\ifsamename % r = *
- \@tempdima = #3\relax
- \@tempdimb = \@tempdima
- \@tempdimc = #1\relax
+ \setlength{\@tempdima}{#3}%
+ \setlength{\@tempdimb}{\@tempdima}
+ \setlength{\@tempdimc}{#1}%
\advance\@tempdimc -\@tempdima
\advance\@tempdimc -\@tempdimb
\else % r
- \@tempdima = #3\relax
- \@tempdimb = #5\@tempdima
- \@tempdimc = #1\relax
+ \setlength{\@tempdima}{#3}%
+ \setlength{\@tempdimb}{#5\@tempdima}
+ \setlength{\@tempdimc}{#1}%
\advance\@tempdimc -\@tempdima
\advance\@tempdimc -\@tempdimb
\fi
\else % R
- \@tempdima = #3\relax
- \@tempdimb = #4\relax
- \@tempdimc = #1\relax
+ \setlength{\@tempdima}{#3}%
+ \setlength{\@tempdimb}{#4}%
+ \setlength{\@tempdimc}{#1}%
\advance\@tempdimc -\@tempdima
\advance\@tempdimc -\@tempdimb
\fi
@@ -523,17 +767,17 @@
\ifsamename % R = *
\nametest{#5}{*}%
\ifsamename % r = *
- \@tempdimc = #2\relax
- \@tempdima = #1\relax
+ \setlength{\@tempdimc}{#2}%
+ \setlength{\@tempdima}{#1}%
\advance\@tempdima -\@tempdimc
\@tempdima = 0.5\@tempdima
\@tempdimb = \@tempdima
\else % r (CODE PERHAPS FIXED)
- \@tempdimc = #2\relax % C
- \@tempdimb = #1\relax % T
+ \setlength{\@tempdimc}{#2} % C
+ \setlength{\@tempdimb}{#1} % T
\advance\@tempdimb -\@tempdimc % T - C
\@tempdima = 1000sp
- \@tempdima = #5\@tempdima % 1000r sp
+ \setlength{\@tempdima}{#5\@tempdima} % 1000r sp
\advance\@tempdima by 1000sp % 1000(1+r)sp
\@tempcnta = \@tempdima % 1000(1+r)
\@tempdima = \@tempdimb % T - C
@@ -542,31 +786,30 @@
\advance\@tempdimb by -\@tempdima % = R
\fi
\else % R
- \@tempdimc = #2\relax
- \@tempdimb = #4\relax
- \@tempdima = #1\relax
+ \setlength{\@tempdimc}{#2}%
+ \setlength{\@tempdimb}{#4}%
+ \setlength{\@tempdima}{#1}%
\advance\@tempdima -\@tempdimc
\advance\@tempdima -\@tempdimb
\fi
\else % L
\nametest{#4}{*}%
\ifsamename % R = *
- \@tempdimc = #2\relax
- \@tempdima = #3\relax
- \@tempdimb = #1\relax
+ \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}%
- \@tempdima = \z@
- \@tempdimb = \z@
- \@tempdimc = #2\relax
+ \setlength{\@tempdima}{0pt}%
+ \setlength{\@tempdimb}{0pt}%
+ \setlength{\@tempdimc}{#2}%
\fi
\fi
- \fi
-}
+ \fi}
\newcommand{\setstocksize}[2]{%
\setlength{\stockheight}{#1}%
@@ -716,30 +959,78 @@
\@memerror{\protect#1\space is negative}{\@ehd}%
\fi}
-\newcommand{\checkthelayout}{%
+\newcommand*{\m@mclassicht}{%
+ \setlength{\@tempdima}{\textheight}%
+ \divide\@tempdima \baselineskip
+ \@tempcnta=\@tempdima
+ \setlength{\textheight}{\@tempcnta\baselineskip}%
+ \addtolength{\textheight}{\topskip}}
+
+\newcommand*{\m@mlinesht}{%
+ \setlength{\@tempdima}{\textheight}%
+ \advance\@tempdima -\baselineskip
+ \divide\@tempdima \baselineskip
+ \@tempcnta=\@tempdima
+ \setlength{\textheight}{\@tempcnta\baselineskip}%
+ \addtolength{\textheight}{\topskip}}
+
+\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}}
+
+\newcommand*{\checkthelayout}[1][classic]{%
\@memnegtest{\trimedge}
\@memnegtest{\trimtop}
\@memznegtest{\stockwidth}
\@memznegtest{\paperwidth}
\@memznegtest{\textwidth}
- \@memznegtest{\spinemargin}
- \@memznegtest{\foremargin}
+%%% \@memznegtest{\spinemargin}
+ \@memnegtest{\spinemargin}
+%%% \@memznegtest{\foremargin}
+ \@memnegtest{\foremargin}
\@memznegtest{\marginparsep}
\@memznegtest{\marginparwidth}
\@memznegtest{\stockheight}
\@memznegtest{\paperheight}
\@memznegtest{\textheight}
- \@memznegtest{\uppermargin}
- \@memznegtest{\lowermargin}
- \@memznegtest{\headheight}
- \@memznegtest{\headsep}
- \@memznegtest{\footskip}
-
- \@tempdima = \textheight
- \divide\@tempdima \baselineskip
- \@tempcnta=\@tempdima
- \setlength{\textheight}{\@tempcnta\baselineskip}
- \addtolength{\textheight}{\topskip}
+%%% \@memznegtest{\uppermargin}
+ \@memnegtest{\uppermargin}
+%%% \@memznegtest{\lowermargin}
+ \@memnegtest{\lowermargin}
+%%% \@memznegtest{\headheight}
+ \@memnegtest{\headheight}
+%%% \@memznegtest{\headsep}
+ \@memnegtest{\headsep}
+%%% \@memznegtest{\footskip}
+ \@memnegtest{\footskip}
+ \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}{*}{*}
\@tempdimb = -1pt
\@tempdima=\stockwidth
@@ -809,9 +1100,9 @@
is too large for \protect\lowermargin\space
by \the\@tempdima}%
{\@ehd}
- \fi
-}
-\newcommand{\fixthelayout}{%
+ \fi}
+
+\newcommand*{\fixthelayout}{%
\topmargin = \trimtop
\advance\topmargin \uppermargin
\advance\topmargin -\headsep
@@ -827,10 +1118,9 @@
\advance\evensidemargin -1in\relax
\@settopoint\textwidth
\@settopoint\oddsidemargin
- \@settopoint\evensidemargin
-}
+ \@settopoint\evensidemargin}
-\newcommand{\typeoutlayout}{%
+\newcommand*{\typeoutlayout}{%
\typeout{}
\typeout{******************************************************}
\typeout{Stock height and width:
@@ -853,12 +1143,19 @@
\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{}
-}
+ \typeout{}}
-\newcommand{\checkandfixthelayout}{%
- \checkthelayout
+\newcommand*{\checkandfixthelayout}[1][classic]{%
+ \checkthelayout[#1]%
\fixthelayout
\typeoutlayout}
@@ -902,6 +1199,44 @@
\typeout{}
}
+%%%% s = w/#1, t = 1.5s, e = 2s, f = 3s
+\newcommand*{\medievalpage}[1][9]{%
+ \spinemargin=\paperwidth
+ \divide\spinemargin #1\relax
+ \uppermargin = 1.5\spinemargin
+ \setlrmarginsandblock{\spinemargin}{*}{2}
+ \setulmarginsandblock{\uppermargin}{*}{2}}
+
+\newcommand*{\isopage}[1][9]{%
+ \spinemargin=\paperwidth
+ \divide\spinemargin #1\relax
+ \uppermargin=\paperheight
+ \divide\uppermargin #1\relax
+ \setlrmarginsandblock{\spinemargin}{*}{2}
+ \setulmarginsandblock{\uppermargin}{*}{2}}
+
+%%% s = w/#1, t = s, e = 2s, f = e
+\newcommand*{\semiisopage}[1][9]{%
+ \spinemargin=\paperwidth
+ \divide\spinemargin #1\relax
+ \uppermargin=\spinemargin
+ \setlrmarginsandblock{\spinemargin}{*}{2}
+ \setulmarginsandblock{\uppermargin}{*}{2}}
+
+\newcommand*{\setpagebl}[3]{%
+ \settrimmedsize{#1}{#2}{#3}
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth}
+\newcommand*{\setpageml}[3]{%
+ \settrimmedsize{#1}{#2}{#3}
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \advance\trimtop -0.5\trimtop
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth}
+\newcommand*{\setpagetl}[3]{%
+ \settrimmedsize{#1}{#2}{#3}
+ \trimtop=0pt
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth}
+
\setcounter{topnumber}{3}
\renewcommand{\topfraction}{.85}
\setcounter{bottomnumber}{2}
@@ -941,13 +1276,11 @@
\newcommand{\footruleskip}{0.3\normalbaselineskip}
\newcommand{\makeheadrule}[3]{%
\@namedef{#1headrule}{%
- \hrule\@width #2\@height #3 \vskip-#3}
-}
+ \hrule\@width #2\@height #3 \vskip-#3}}
\newcommand{\makefootrule}[4]{%
\@namedef{#1footrule}{%
\vskip-#4\vskip-#3
- \hrule\@width #2\@height #3 \vskip #4}
-}
+ \hrule\@width #2\@height #3 \vskip #4}}
\newcommand{\makeheadposition}[5]{%
\nametest{flushleft}{#2}
@@ -993,14 +1326,9 @@
\else
\@namedef{#1oddfpl}{\hss} \@namedef{#1oddfpr}{\hss}
\fi
- \fi
-}
+ \fi}
\newcommand{\makepsmarks}[2]{\@namedef{#1pshook}{#2}}
-%%%% \newcommand{\makepshook}[2]{%
-%%%% \@memwarn{\protect\makepshook\space is deprecated.\MessageBreak
-%%%% Use \protect\makepsmarks\space instead}
-%%%% \@namedef{#1pshook}{#2}}
\newcommand*{\m@mhe@dreset}{\def\baselinestretch{1}\normalsize}
@@ -1015,7 +1343,7 @@
\centering\@nameuse{#1eheadc}\strut}\hfill
\llap{\parbox[b]{\@nameuse{#1runwidth}}{%
\raggedleft\@nameuse{#1eheadr}\strut}}}%
- \@nameuse{#1headrule}}}\@nameuse{#1evenhpr}}
+ \@nameuse{#1headrule}}}\@nameuse{#1evenhpr}}%
\@namedef{#1@oddhead}{%
\@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
\vbox{\hbox{%
@@ -1025,7 +1353,7 @@
\centering\@nameuse{#1oheadc}\strut}\hfill
\llap{\parbox[b]{\@nameuse{#1runwidth}}{%
\raggedleft\@nameuse{#1oheadr}\strut}}}%
- \@nameuse{#1headrule}}}\@nameuse{#1oddhpr}}
+ \@nameuse{#1headrule}}}\@nameuse{#1oddhpr}}%
\@namedef{#1@evenfoot}{%
\@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
@@ -1035,7 +1363,7 @@
\centering\@nameuse{#1efootc}\strut}\hfill
\llap{\parbox[b]{\@nameuse{#1runwidth}}{%
\raggedleft\@nameuse{#1efootr}\strut}}}%
- }}\@nameuse{#1evenfpr}}
+ }}\@nameuse{#1evenfpr}}%
\@namedef{#1@oddfoot}{%
\@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
@@ -1045,23 +1373,21 @@
\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}{}
-}
+ }}\@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}{}}
\newcommand{\aliaspagestyle}[2]{%
\@namedef{ps@#1}{\@nameuse{ps@#2}}}
@@ -1079,84 +1405,202 @@
\makerunningwidth{#1}{\@nameuse{#2runwidth}}%
\@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
\@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
+ \@namedef{#1evenhpr}{\@nameuse{#2evenhpr}}%
+ \@namedef{#1oddhpr}{\@nameuse{#2oddhpr}}%
\@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
\@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
+ \@namedef{#1evenfpr}{\@nameuse{#2evenfpr}}%
+ \@namedef{#1oddfpr}{\@nameuse{#2oddfpr}}%
\@namedef{#1headrule}{\@nameuse{#2headrule}}%
\@namedef{#1footrule}{\@nameuse{#2footrule}}%
- \makepsmarks{#1}{\@nameuse{#2pshook}}%
-}
+ \makepsmarks{#1}{\@nameuse{#2pshook}}}
\newcommand{\ifonlyfloats}[2]{\if@fcolmade #1\else #2\fi}
\newcommand{\mergepagefloatstyle}[3]{%
- \@nameuse{ps@#3} \@nameuse{ps@#2}
- \@namedef{ps@#1}{
+ \@nameuse{ps@#3}\@nameuse{ps@#2}%
+ \@namedef{ps@#1}{%
\def\@evenhead{\ifonlyfloats{\@nameuse{#3@evenhead}}%
- {\@nameuse{#2@evenhead}}}
+ {\@nameuse{#2@evenhead}}}%
\def\@oddhead{\ifonlyfloats{\@nameuse{#3@oddhead}}%
- {\@nameuse{#2@oddhead}}}
+ {\@nameuse{#2@oddhead}}}%
\def\@evenfoot{\ifonlyfloats{\@nameuse{#3@evenfoot}}%
- {\@nameuse{#2@evenfoot}}}
+ {\@nameuse{#2@evenfoot}}}%
\def\@oddfoot{\ifonlyfloats{\@nameuse{#3@oddfoot}}%
- {\@nameuse{#2@oddfoot}}}
- \@namedef{#1pshook}{\@nameuse{#2pshook}}
+ {\@nameuse{#2@oddfoot}}}%
+ \@namedef{#1pshook}{\@nameuse{#2pshook}}%
}}
+
\makepagestyle{empty}
\makepagestyle{plain}
\makeevenfoot{plain}{}{\thepage}{}
\makeoddfoot{plain}{}{\thepage}{}
+\newcommand*{\nouppercaseheads}{\let\memUChead\relax}
+\newcommand*{\uppercaseheads}{\let\memUChead\MakeUppercase}
+\uppercaseheads
+
+\newcommand*{\createplainmark}[3]{%
+ \nametest{#2}{left}%
+ \ifsamename
+ \@namedef{#1mark}{\markboth{\memUChead{#3}}{}}%
+ \else
+ \nametest{#2}{right}%
+ \ifsamename
+ \@namedef{#1mark}{\markright{\memUChead{#3}}}%
+ \else
+ \nametest{#2}{both}%
+ \ifsamename\else
+ \@memerror{%
+ Unknown mark setting type `#2' for #1mark}{%
+ I expected `left', `both' or `right'. \MessageBreak
+ I will assume you meant `both'}%
+ \fi
+ \@namedef{#1mark}{\markboth{\memUChead{#3}}{\memUChead{#3}}}%
+ \fi
+ \fi}
+
+\newcommand\createmark[5]{%
+ \def\@tempa{00}
+ \nametest{#3}{nonumber}%
+ \ifsamename
+ \def\@tempa{01}%
+ \else
+ \nametest{#3}{shownumber}
+ \ifsamename\else
+ \@memerror{Unknown numbering value `#3' for #1mark}%
+ {I expected `shownumber' or `nonumber'.\MessageBreak
+ I will assume you meant `shownumber'}%
+ \fi
+ \fi
+ \expandafter\if\@tempa% compares the two \@tempa digits
+ \@namedef{#1marksn}##1{##1}%
+ \else
+ \@namedef{#1marksn}{\@gobble}%
+ \fi
+ \nametest{#2}{left}%
+ \ifsamename
+ \@namedef{#1mark}##1{%
+ \@setclcnt{#1}{@memmarkcntra}%
+ \advance\c@@memmarkcntra\m@ne
+ \markboth{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \c@@memmarkcntra
+ \if@mainmatter
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi
+ \fi
+ ##1}}{}}%
+ \else
+ \nametest{#2}{right}
+ \ifsamename
+ \@namedef{#1mark}##1{%
+ \@setclcnt{#1}{@memmarkcntra}
+ \advance\c@@memmarkcntra\m@ne
+ \markright{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \c@@memmarkcntra
+ \if@mainmatter%
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi%
+ \fi%
+ ##1}}}%
+ \else
+ \nametest{#2}{both}%
+ \ifsamename\else
+ \@memerror{%
+ Unknown mark setting type `#2' for #1mark}{%
+ I expected `left', `both' or `right'. \MessageBreak
+ I will assume you meant `both'}%
+ \fi
+ \@namedef{#1mark}##1{%
+ \@setclcnt{#1}{@memmarkcntra}
+ \advance\c@@memmarkcntra\m@ne
+ \markboth{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \c@@memmarkcntra
+ \if@mainmatter
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi
+ \fi
+ ##1}}{%
+ \memUChead{%
+ \ifnum \c@secnumdepth > \c@@memmarkcntra
+ \if@mainmatter
+ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}%
+ \fi
+ \fi
+ ##1}}}%
+ \fi
+ \fi}
+
+\newcommand\addtopsmarks[3]{%
+ \expandafter\addtodef\expandafter{\csname #1pshook\endcsname}{#2}{#3}}
\if@twoside
\makepagestyle{headings}
\makepsmarks{headings}{%
- \let\@mkboth\markboth
\def\chaptermark##1{%
- \markboth{\MakeUppercase{%
+ \markboth{\memUChead{%
\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\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{\MakeUppercase{%
+ \markright{\memUChead{%
\ifnum \c@secnumdepth > \z@
\thesection. \ %
\fi
- ##1}}}%
+ ##1}}}}
+ \makepsmarks{headings}{%
+ \createmark{chapter}{left}{shownumber}{\@chapapp\ }{. \ }
+ \createmark{section}{right}{shownumber}{}{. \ }
+ \createplainmark{toc}{both}{\contentsname}
+ \createplainmark{lof}{both}{\listfigurename}
+ \createplainmark{lot}{both}{\listtablename}
+ \createplainmark{bib}{both}{\bibname}
+ \createplainmark{index}{both}{\indexname}
+ \createplainmark{glossary}{both}{\glossaryname}
}
\makeevenhead{headings}{\thepage}{}{\slshape\leftmark}
\makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
\else
\makepagestyle{headings}
\makepsmarks{headings}{%
- \let\@mkboth\markboth
\def\chaptermark##1{%
- \markright{\MakeUppercase{%
+ \markright{\memUChead{%
\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}}}%
+ \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}}}}
+ \makepsmarks{headings}{%
+ \createmark{chapter}{right}{shownumber}{\@chapapp\ }{. \ }
+ \createplainmark{toc}{right}{\contentsname}
+ \createplainmark{lof}{right}{\listfigurename}
+ \createplainmark{lot}{right}{\listtablename}
+ \createplainmark{bib}{right}{\bibname}
+ \createplainmark{index}{right}{\indexname}
+ \createplainmark{glossary}{right}{\glossaryname}
}
\makeoddhead{headings}{\slshape\rightmark}{}{\thepage}
\fi
\makepagestyle{myheadings}
\makepsmarks{myheadings}{%
- \let\@mkboth\@gobbletwo
\let\chaptermark\@gobble
\let\sectionmark\@gobble
\def\tocmark{}%
@@ -1164,7 +1608,7 @@
\def\lotmark{}%
\def\bibmark{}%
\def\indexmark{}%
- }
+ \def\glossarymark{}}
\makeevenhead{myheadings}{\thepage}{}{\slshape\leftmark}
\makeoddhead{myheadings}{\slshape\rightmark}{}{\thepage}
@@ -1181,7 +1625,6 @@
\makeoddfoot{ruled}{}{}{\thepage}
\makeheadrule{ruled}{\textwidth}{\normalrulethickness}
\newcommand{\@ruledmarks}{%
- \let\@mkboth\markboth
\def\chaptermark##1{%
\markboth{%
\ifnum \c@secnumdepth >\m@ne
@@ -1196,7 +1639,18 @@
\def\lotmark{\markboth{\listtablename}{}}
\def\bibmark{\markboth{\bibname}{}}
\def\indexmark{\markboth{\indexname}{}}
-}
+ \def\glossarymark{\markboth{\glossaryname}{}}
+}
+\renewcommand*{\@ruledmarks}{%
+ \nouppercaseheads
+ \createmark{chapter}{left}{shownumber}{}{. \space}
+ \createmark{section}{right}{shownumber}{}{. \space}
+ \createplainmark{toc}{both}{\contentsname}
+ \createplainmark{lof}{both}{\listfigurename}
+ \createplainmark{lot}{both}{\listtablename}
+ \createplainmark{bib}{both}{\bibname}
+ \createplainmark{index}{both}{\indexname}
+ \createplainmark{glossary}{both}{\glossaryname}}
\makepsmarks{ruled}{\@ruledmarks}
\makeevenhead{ruled}{\scshape\leftmark}{}{}
\makeoddhead{ruled}{}{}{\rightmark}
@@ -1221,7 +1675,6 @@
\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@
@@ -1232,8 +1685,17 @@
\def\lofmark{\markboth{\listfigurename}{\listfigurename}}
\def\lotmark{\markboth{\listtablename}{\listtablename}}
\def\bibmark{\markboth{\bibname}{\bibname}}
- \def\indexmark{\markboth{\indexname}{\indexname}}
-}
+ \def\indexmark{\markboth{\indexname}{\indexname}}}
+\makepsmarks{companion}{%
+ \nouppercaseheads
+ \createmark{chapter}{both}{nonumber}{}{}
+ \createmark{section}{right}{shownumber}{}{. \space}
+ \createplainmark{toc}{both}{\contentsname}
+ \createplainmark{lof}{both}{\listfigurename}
+ \createplainmark{lot}{both}{\listtablename}
+ \createplainmark{bib}{both}{\bibname}
+ \createplainmark{index}{both}{\indexname}
+ \createplainmark{glossary}{both}{\glossaryname}}
\makeevenhead{companion}{\normalfont\bfseries\thepage}{}%
{\normalfont\bfseries\leftmark}
\makeoddhead{companion}{\normalfont\bfseries\rightmark}{}%
@@ -1251,6 +1713,155 @@
\newcommand{\savepagenumber}{\global\c@storedpagenumber \c@page}
\newcommand{\restorepagenumber}{\global\c@page \c@storedpagenumber}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand*{\setSpacing}[1]{%
+ \def\baselinestretch{#1}%
+ \@currsize}
+
+\newcommand*{\setSingleSpace}[1]{%
+ \def\m@m@singlespace{#1}}
+\setSingleSpace{1}
+
+\newcommand*{\SingleSpacing}{%
+ \setSpacing{\m@m@singlespace}%
+ \vskip\baselineskip% correction for coming into single spacing
+}
+\SingleSpacing
+
+\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}%
+ \else% the extended sizes
+ \setSpacing{1.16}%
+ \fi}
+
+\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}%
+ \else% larger sizes
+ \setSpacing{1.5}%
+ \fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% check what this does!!!!!!!!
+\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}
+
+\newenvironment{SingleSpace}{%
+ \vskip\baselineskip
+ \setSpacing{\m@m@singlespace}%
+ \vskip -\baselineskip
+}{\par}
+
+\newenvironment{SingleSpace*}{%
+%% \vskip\baselineskip
+ \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}
+
+\newenvironment{Spacing}[1]{%
+ \par
+ \begingroup
+ \setSpacing{#1}}{\m@mrestore@spacing}
+
+\newenvironment{OnehalfSpace}{%
+ \begingroup
+ \OnehalfSpacing}{\m@mrestore@spacing}
+
+\newenvironment{DoubleSpace}{%
+ \begingroup
+ \DoubleSpacing}{\m@mrestore@spacing}
+
+\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
+\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]}}
+\newif\ifm@mnzpskip
+\newcommand*{\traditionalparskip}{%
+ \parskip \z@
+ \m@mnzpskipfalse}
+\newskip\m@mabparskip
+\newcommand*{\abnormalparskip}[1]{%
+ \setlength{\parskip}{#1}\m@mabparskip=#1\relax
+ \m@mnzpskiptrue}
+\newcommand*{\nonzeroparskip}{\abnormalparskip{%
+ 0.5\baselineskip
+ \@plus .1\baselineskip \@minus .1\baselineskip% NTG
+%% 0.5/baselineskip \@plus 2pt% RF
+}}
+\traditionalparskip
+
\newcommand{\pretitle}[1]{\def\@bspretitle{#1}}
\newcommand{\posttitle}[1]{\def\@bsposttitle{#1}}
\newcommand{\preauthor}[1]{\def\@bspreauthor{#1}}
@@ -1281,12 +1892,6 @@
\newcommand{\thanksheadextra}[2]{%
\def\@bsthanksheadpre{#1}%
\def\@bsthanksheadpost{#2}}
-%%%% \newcommand{\thanksfootextra}[2]{%
-%%%% \@memwarn{Use \protect\thanksmarkstyle\space instead of
-%%%% \protect\thanksfootextra}%
-%%%% \def\thanksfootpre{#1}%
-%%%% \def\thanksfootpost{#2}
-
\DeclareRobustCommand{\thanksmark}[1]{\footnotemark[#1]}
\newcommand{\thanksgap}[1]{\hspace{#1}}
\newcommand{\tamark}{\@thefnmark}
@@ -1414,8 +2019,7 @@
\global\let\thanksheadextra\relax
\global\let\thanksfootextra\relax
\global\let\thanksmark\relax
- \global\let\thanksgap\relax
-}
+ \global\let\thanksgap\relax}
\newcommand{\keepthetitle}{%
\@bsmtitlempty
@@ -1425,15 +2029,13 @@
\global\let\@thanks\@empty
\global\let\@title\@empty
\global\let\@author\@empty
- \global\let\@date\@empty
-}
+ \global\let\@date\@empty}
\newcommand{\killtitle}{%
\keepthetitle
\global\let\thetitle\relax
\global\let\theauthor\relax
- \global\let\thedate\relax
-}
+ \global\let\thedate\relax}
\addtoiargdef{\title}{%
\begingroup\let\footnote\@gobble}{%
@@ -1462,105 +2064,7 @@
\protected@xdef\thedate{#1}
\endgroup\endgroup}
-\newif\if@bsonecol
- \@bsonecoltrue
-\newif\ifadd@bstotoc
- \add@bstotocfalse
-\newif\ifnumber@bs
- \number@bsfalse
-\newif\if@bsrunin
- \@bsruninfalse
-
-\newcommand{\abstractcol}{\@bsonecolfalse}
-\newcommand{\abstractintoc}{\add@bstotoctrue}
-\newcommand{\abstractnum}{\number@bstrue\@bsruninfalse}
-\newcommand{\abstractrunin}{\@bsrunintrue\number@bsfalse}
-
-\newcommand{\abstractnamefont}{\normalfont\small\bfseries}
-\newcommand{\abstracttextfont}{\normalfont\small}
-
-\newcommand{\absnamepos}{center}
-\newlength{\abstitleskip} \setlength{\abstitleskip}{-0.5em}
-\newlength{\absleftindent}
-\newdimen\abs@leftindent
- \abs@leftindent=\leftmargin
-\newlength{\absrightindent}
-\newlength{\absparindent}
-\newlength{\absparsep}
-
-\newcommand{\abslabeldelim}[1]{\def\@bslabeldelim{#1}}
-\abslabeldelim{}
-\newcommand{\@bsrunintitle}{%
- \hspace*{\abstitleskip}{\abstractnamefont\abstractname\@bslabeldelim}}
-
-\newcommand{\setup@bstract}{%
- \if@twocolumn
- \if@bsonecol
- \abs@leftindent=\absleftindent
- \else
- \abs@leftindent=\z@
- \renewcommand{\abstractnamefont}{\normalfont\Large\bfseries}
- \renewcommand{\abstracttextfont}{\normalfont}
- \renewcommand{\absnamepos}{flushleft}
- \setlength{\abstitleskip}{-2ex}
- \fi
- \else
- \abs@leftindent=\absleftindent
- \fi
- \setlength{\absrightindent}{\absleftindent}
-}
-
-\AtBeginDocument{\setlength{\absparindent}{\parindent}
- \setlength{\absparsep}{\parskip}}
-
-\newenvironment{@bstr@ctlist}{%
- \list{}{%
- %%\topsep \z@
- \partopsep \z@
- \listparindent \absparindent
- \itemindent \listparindent
- \leftmargin \abs@leftindent
- \rightmargin \absrightindent
- \parsep \absparsep}%
- \item\relax}
- {\endlist}
-
-\newcommand{\put@bsintoc}{%
- \ifadd@bstotoc
- \ifnumber@bs\else
- \phantomsection
- \addcontentsline{toc}{chapter}{\abstractname}
- \fi
- \fi}
-
-\newcommand{\num@bs}{\chapter{\abstractname}}
-
-\newenvironment{abstract}{%
- \setup@bstract
- \if@bsrunin\else
- \ifnumber@bs \num@bs \else
- \begin{\absnamepos}\abstractnamefont\abstractname\end\absnamepos%
- \vspace{\abstitleskip}%
- \fi
- \fi
- \put@bsintoc%
- \begin{@bstr@ctlist}\if@bsrunin\@bsrunintitle\fi\abstracttextfont}%
- {\par\end{@bstr@ctlist}}
-
-\newenvironment{onecolabstract}{%
- \begin{@twocolumnfalse}\begin{abstract}}{%
- \end{abstract}\end{@twocolumnfalse}}
-
-\addtoiargdef{\thanks}{}{%
- \protected@xdef\@bs@thanks{\@bs@thanks
- \protect\footnotetext[\the\c@footnote]{#1}}%
-}
-\let\@bs@thanks\@empty
-
-\newcommand{\saythanks}{\begingroup
- \renewcommand{\thefootnote}{\fnsymbol{footnote}}\@bs@thanks
- \endgroup\global\let\@bs@thanks\@empty}
-
+\newcommand*{\bookpagemark}[1]{}
\newcommand*{\partmark}[1]{}
\newcommand*{\chaptermark}[1]{}
@@ -1569,23 +2073,25 @@
\newcommand*{\glossarymark}{}
\setcounter{secnumdepth}{2}
-\newcounter{part}
-\newcounter{chapter}
+\newcounter{book} \setcounter{book}{0}
+\newcounter{part} \setcounter{part}{0}
+\newcounter{chapter} \setcounter{chapter}{0}
\newcounter{section}[chapter]
\newcounter{subsection}[section]
\newcounter{subsubsection}[subsection]
\newcounter{paragraph}[subsubsection]
\newcounter{subparagraph}[paragraph]
-\renewcommand{\thepart}{\@Roman\c@part}
-\renewcommand{\thechapter}{\@arabic\c@chapter}
-\renewcommand{\thesection}{\thechapter.\@arabic\c@section}
-\renewcommand{\thesubsection}{%
+\renewcommand*{\thebook}{\@Roman\c@book}
+\renewcommand*{\thepart}{\@Roman\c@part}
+\renewcommand*{\thechapter}{\@arabic\c@chapter}
+\renewcommand*{\thesection}{\thechapter.\@arabic\c@section}
+\renewcommand*{\thesubsection}{%
\thesection.\@arabic\c@subsection}
-\renewcommand{\thesubsubsection}{%
+\renewcommand*{\thesubsubsection}{%
\thesubsection.\@arabic\c@subsubsection}
-\renewcommand{\theparagraph}{%
+\renewcommand*{\theparagraph}{%
\thesubsubsection.\@arabic\c@paragraph}
-\renewcommand{\thesubparagraph}{%
+\renewcommand*{\thesubparagraph}{%
\theparagraph.\@arabic\c@subparagraph}
\newcommand{\@chapapp}{\chaptername}
@@ -1603,11 +2109,15 @@
\newcommand{\mainmatter}{%
\@ifstar{\@smemmain}{\@memmain}}
-\newcommand{\@smemmain}{
+\newcommand*{\@smemmain}{%
\@mainmattertrue
\setcounter{secnumdepth}{\value{maxsecnumdepth}}
\ifartopt
- \clearpage
+ \if@twoside
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
\else
\cleardoublepage
\counterwithin{figure}{chapter}
@@ -1635,11 +2145,104 @@
\setcounter{table}{0}
\fi}
+\newcommand*{\theHbook}{\arabic{book}}
+\newcommand*{\toclevel@book}{-2}
+
+\newcommand*{\book}{%
+ \@setupbook
+ \secdef\@book\@sbook}
+\newcommand*{\beforebookskip}{\null\vfil}
+\newcommand*{\midbookskip}{\par\vskip 2\onelineskip}
+\newcommand*{\afterbookskip}{\vfil\newpage}
+
+\newcommand{\@setupbook}{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \thispagestyle{book}%
+ \if@twocolumn
+ \onecolumn
+ \@tempswatrue
+ \else
+ \@tempswafalse
+ \fi
+ \beforebookskip}
+
+\newcommand*{\booknamefont}{\normalfont\huge\bfseries}
+\newcommand*{\booknumfont}{\normalfont\huge\bfseries}
+\newcommand*{\booktitlefont}{\normalfont\Huge\bfseries}
+
+\newcommand*{\printbookname}{\booknamefont \bookname}
+\newcommand*{\booknamenum}{\space}
+\newcommand*{\printbooknum}{\booknumfont \thebook}
+\newcommand*{\printbooktitle}[1]{\booktitlefont #1}
+
+\newcommand{\membookinfo}[3]{}
+\newcommand{\membookstarinfo}[1]{}
+
+\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
+ \bookpagemark{#1}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-3\relax
+ \printbookname \booknamenum \printbooknum
+ \midbookskip
+ \fi
+ \printbooktitle{#2}\par}%
+ \@endbook}
+
+\long\def\@sbook#1{%
+ \M@gettitle{#1}%
+ \phantomsection
+ \membookstarinfo{#1}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \printbooktitle{#1}\par}%
+ \@endbook}
+
+\newif\ifm@mnobooknewpage
+ \m@mnobooknewpagefalse
+\newcommand*{\bookblankpage}{\m@mnobooknewpagefalse}
+\newcommand*{\nobookblankpage}{\m@mnobooknewpagetrue}
+
+\def\@endbook{\afterbookskip
+ \ifm@mnobooknewpage
+ \else
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{afterbook}%
+ \newpage
+ \fi
+ \fi
+ \fi
+ \if@tempswa
+ \twocolumn
+ \fi}
+
+\aliaspagestyle{book}{empty}
+\aliaspagestyle{afterbook}{empty}
+
\newcommand{\part}{%
\@setuppart
\secdef\@part\@spart}
\newcommand{\beforepartskip}{\null\vfil}
-\newcommand{\midpartskip}{\par\vskip 20pt}
+\newcommand{\midpartskip}{\par\vskip 2\onelineskip}
\newcommand{\afterpartskip}{\vfil\newpage}
\newcommand{\@setuppart}{%
@@ -1666,11 +2269,12 @@
\newcommand{\printpartnum}{\partnumfont \thepart}
\newcommand{\printparttitle}[1]{\parttitlefont #1}
-\newcommand*{\mempartinfo}[3]{}
-\newcommand*{\mempartstarinfo}[1]{}
+\newcommand{\mempartinfo}[3]{}
+\newcommand{\mempartstarinfo}[1]{}
\long\def\@part[#1]#2{%
\M@gettitle{#1}%
+ \phantomsection
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}%
@@ -1691,8 +2295,9 @@
\printparttitle{#2}\par}%
\@endpart}
-\def\@spart#1{%
+\long\def\@spart#1{%
\M@gettitle{#1}%
+ \phantomsection
\mempartstarinfo{#1}%
{\centering
\interlinepenalty \@M
@@ -1700,18 +2305,28 @@
\printparttitle{#1}\par}%
\@endpart}
+\newif\ifm@mnopartnewpage
+ \m@mnopartnewpagefalse
+\newcommand*{\partblankpage}{\m@mnopartnewpagefalse}
+\newcommand*{\nopartblankpage}{\m@mnopartnewpagetrue}
+
\def\@endpart{\afterpartskip
- \if@twoside
- \if@openright
- \null
- \thispagestyle{empty}%
- \newpage
+ \ifm@mnopartnewpage
+ \else
+ \if@twoside
+ \if@openright
+ \null
+ \thispagestyle{afterpart}%
+ \newpage
+ \fi
\fi
\fi
\if@tempswa
\twocolumn
\fi}
+\aliaspagestyle{afterpart}{empty}
+
\newcommand\chapter{%
\ifartopt\par\else
\clearforchapter
@@ -1727,12 +2342,19 @@
}
\def\m@m@empty{\@empty}
-\newcommand*{\memchapinfo}[4]{}
-\newcommand*{\memchapstarinfo}[2]{}
-\newcommand*{\memappchapinfo}[4]{}
-\newcommand*{\memappchapstarinfo}[2]{}
+\newcommand{\memchapinfo}[4]{}
+\newcommand{\memchapstarinfo}[2]{}
+\newcommand{\memappchapinfo}[4]{}
+\newcommand{\memappchapstarinfo}[2]{}
+
+\newif\ifm@mpn@new@chap
+ \m@mpn@new@chapfalse
+\newif\ifm@mpn@new@schap
+ \m@mpn@new@schapfalse
\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}%
@@ -1753,11 +2375,12 @@
\ifm@m@And
\refstepcounter{chapter}%
\fi
- \chaptermark{\f@rhdr}
\ifartopt
\@makechapterhead{#2}%
\@afterheading
+ \chaptermark{\f@rhdr}%
\else
+ \chaptermark{\f@rhdr}
\insertchapterspace
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]%
@@ -1784,8 +2407,7 @@
\memchapinfo{}{\f@rtoc}{\f@rhdr}{#2}%
\fi
\fi
- \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{\f@rtoc}\fi
-}
+ \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{\f@rtoc}\fi}
\def\@makechapterhead#1{%
\chapterheadstart% \vspace*{50\p@}%
@@ -1801,34 +2423,35 @@
\afterchaptertitle % \par\nobreak \vskip 40\p@
}}
-\newcommand{\insertchapterspace}{%
+\newcommand*{\insertchapterspace}{%
\addtocontents{lof}{\protect\addvspace{10pt}}%
- \addtocontents{lot}{\protect\addvspace{10pt}}%
-}
+ \addtocontents{lot}{\protect\addvspace{10pt}}}
-\newcommand{\@chs@def@ult}{%
- \def\chapterheadstart{\vspace*{\beforechapskip}}
- \def\printchaptername{\chapnamefont \@chapapp}
- \def\chapternamenum{\space}
- \def\printchapternum{\chapnumfont \thechapter}
- \def\afterchapternum{\par\nobreak\vskip \midchapskip}
- \def\printchapternonum{}
- \def\printchaptertitle##1{\chaptitlefont ##1}
- \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}
-}
-
-\newcommand{\chapnamefont}{\normalfont\huge\bfseries}
-\newcommand{\chapnumfont}{\normalfont\huge\bfseries}
-\newcommand{\chaptitlefont}{\normalfont\Huge\bfseries}
\newlength{\beforechapskip}\setlength{\beforechapskip}{50pt}
\newlength{\midchapskip}\setlength{\midchapskip}{20pt}
\newlength{\afterchapskip}\setlength{\afterchapskip}{40pt}
+\newcommand{\@chs@def@ult}{%
+ \def\chapterheadstart{\vspace*{\beforechapskip}}%
+ \def\printchaptername{\chapnamefont \@chapapp}%
+ \def\chapternamenum{\space}%
+ \def\printchapternum{\chapnumfont \thechapter}%
+ \def\afterchapternum{\par\nobreak\vskip \midchapskip}%
+ \def\printchapternonum{}%
+ \def\printchaptertitle##1{\chaptitlefont ##1}%
+ \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}%
+ \def\chapnamefont{\normalfont\huge\bfseries}%
+ \def\chapnumfont{\normalfont\huge\bfseries}%
+ \def\chaptitlefont{\normalfont\Huge\bfseries}%
+ \setlength{\beforechapskip}{50pt}%
+ \setlength{\midchapskip}{20pt}%
+ \setlength{\afterchapskip}{40pt}}
+
\newcommand{\@m@mschapter}[2][\@empty]{%
\@schapter{#2}%
\ifx \@empty#1
\def\f@rhdr{#2}%
- \else % opt arg
+ \else% opt arg
\def\f@rhdr{#1}%
\setcounter{secnumdepth}{-10}%
\chaptermark{#1}%
@@ -1838,101 +2461,465 @@
\memappchapstarinfo{\f@rhdr}{#2}%
\else
\memchapstarinfo{\f@rhdr}{#2}%
- \fi}
+ \fi
+ \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{#2}\fi}
\newcommand{\@schapter}[1]{%
+ \m@mpn@new@schaptrue
+ \def\f@rbdy{#1}%
\ifartopt
\@makeschapterhead{#1}%
- \@afterheading
\else
\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}%
\fi
- \@afterheading
\fi
- \M@gettitle{#1}}
+ \@afterheading}
\def\@makeschapterhead#1{%
\chapterheadstart
{\parindent \z@ \raggedright \normalfont
\printchapternonum
\interlinepenalty\@M
- \printchaptertitle{#1}
- \afterchaptertitle
- }
+ \printchaptertitle{#1}%
+ \afterchaptertitle}%
}
\newcommand{\makechapterstyle}[2]{\@namedef{chs@#1}{\@chs@def@ult #2}}
\newcommand{\chapterstyle}[1]{\@nameuse{chs@#1}}
-\makechapterstyle{default}{%
- \renewcommand{\chapnamefont}{\normalfont\huge\bfseries}
- \renewcommand{\chapnumfont}{\normalfont\huge\bfseries}
- \renewcommand{\chaptitlefont}{\normalfont\Huge\bfseries}
- \setlength{\beforechapskip}{50pt}
- \setlength{\midchapskip}{20pt}
- \setlength{\afterchapskip}{40pt}
-}
+\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}}
\chapterstyle{default}
\makechapterstyle{section}{%
+ \chapterstyle{default}
\renewcommand{\printchaptername}{}
\renewcommand{\chapternamenum}{}
\renewcommand{\chapnumfont}{\normalfont\Huge\bfseries}
\renewcommand{\printchapternum}{\chapnumfont \thechapter\space}
- \renewcommand{\afterchapternum}{}
-}
+ \renewcommand{\afterchapternum}{}}
\makechapterstyle{article}{%
- \renewcommand{\chapterheadstart}{\vspace{\beforechapskip}}
+ \chapterstyle{default}
\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}{\normalfont\Large\bfseries}
+ \renewcommand{\chapnumfont}{\chaptitlefont}
\renewcommand{\printchapternum}{\chapnumfont \thechapter\quad}
- \renewcommand{\afterchapternum}{}
-}
+ \renewcommand{\afterchapternum}{}}
+
+\makechapterstyle{reparticle}{%
+ \chapterstyle{default}
+ \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}{}}
+
+\newcommand*{\reparticle}{%
+ \chapterstyle{reparticle}
+ \setsecheadstyle{\normalfont\large\bfseries\raggedright}
+ \setsubsecheadstyle{\normalfont\bfseries\raggedright}}
\makechapterstyle{hangnum}{%
- \renewcommand{\chapnumfont}{\chaptitlefont}
+ \chapterstyle{default}
+ \renewcommand*{\chapnumfont}{\chaptitlefont}
\settowidth{\chapindent}{\chapnumfont 999}
- \renewcommand{\printchaptername}{}
- \renewcommand{\chapternamenum}{}
- \renewcommand{\printchapternum}{%
+ \renewcommand*{\printchaptername}{}
+ \renewcommand*{\chapternamenum}{}
+ \renewcommand*{\printchapternum}{%
\noindent\llap{\makebox[\chapindent][l]{\chapnumfont \thechapter}}}
- \renewcommand{\afterchapternum}{}
-}
+ \renewcommand*{\afterchapternum}{}}
\newlength{\chapindent}
\makechapterstyle{companion}{%
- \renewcommand{\chapnamefont}{\normalfont\LARGE\scshape}
- \renewcommand{\printchaptername}{\raggedleft\chapnamefont \@chapapp}
- \renewcommand{\chapnumfont}{\normalfont\Huge}
+ \chapterstyle{default}
+ \renewcommand*{\chapnamefont}{\normalfont\LARGE\scshape}
+ \renewcommand*{\printchaptername}{\raggedleft\chapnamefont \@chapapp}
+ \renewcommand*{\chapnumfont}{\normalfont\Huge}
\setlength{\chapindent}{\marginparsep}
\addtolength{\chapindent}{\marginparwidth}
- \renewcommand{\printchaptertitle}[1]{%
+ \renewcommand*{\printchaptertitle}[1]{%
\begin{adjustwidth}{}{-\chapindent}
\raggedleft \chaptitlefont ##1\par\nobreak
- \end{adjustwidth}}
-}
-
-\makechapterstyle{demo}{
- \renewcommand{\printchaptername}{\centering}
- \renewcommand{\printchapternum}{\chapnumfont \numtoName{\c@chapter}}
- \renewcommand{\chaptitlefont}{\normalfont\Huge\sffamily}
- \renewcommand{\printchaptertitle}[1]{%
+ \end{adjustwidth}}}
+
+\makechapterstyle{demo}{%
+ \chapterstyle{default}
+ \renewcommand*{\printchaptername}{\centering}
+ \renewcommand*{\printchapternum}{\chapnumfont \numtoName{\c@chapter}}
+ \renewcommand*{\chaptitlefont}{\normalfont\Huge\sffamily}
+ \renewcommand*{\printchaptertitle}[1]{%
\hrule\vskip\onelineskip \raggedleft \chaptitlefont ##1}
- \renewcommand{\afterchaptertitle}%
- {\vskip\onelineskip \hrule\vskip \afterchapskip}
-}
+ \renewcommand*{\afterchaptertitle}%
+ {\vskip\onelineskip \hrule\vskip \afterchapskip}}
+
+\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}}
+
+\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}}
+
+\makechapterstyle{brotherton}{%
+ \chapterstyle{default}
+ \renewcommand*{\printchapternum}{\chapnumfont
+ \ifanappendix \thechapter \else \numtoName{\c@chapter}\fi}}
+
+\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}}
+
+\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
+
+\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}}
+
+\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}}
+
+\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}}
+
+\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}}
+
+\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}}}
+
+\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}}
+
+\makechapterstyle{madsen}{% requires graphicx package
+ \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}}
+
+\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}}
+
+%% 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}}
+
+\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}}}
+
+\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}{%
+ % \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}}
+
+\makechapterstyle{crosshead}{%
+ \setlength{\beforechapskip}{2\onelineskip}%
+ \renewcommand*{\chapterheadstart}{\vspace{\beforechapskip}}%
+ \setlength{\afterchapskip}{2\onelineskip \@plus .2\onelineskip
+ \@minus 0.2\onelineskip}%
+ \renewcommand*{\printchaptername}{}%
+ \renewcommand*{\chapternamenum}{}%
+ \renewcommand*{\chapnumfont}{\normalfont\LARGE\bfseries}%
+ \renewcommand*{\chaptitlefont}{\chapnumfont}%
+ \renewcommand*{\printchapternum}{%
+ \centering\chapnumfont \thechapter\quad}%
+ \renewcommand{\afterchapternum}{}%
+ \renewcommand*{\printchapternonum}{\centering}}
+
+\makechapterstyle{dowding}{%
+ \setlength{\beforechapskip}{2\onelineskip}%
+ \setlength{\afterchapskip}{1.5\onelineskip \@plus .1\onelineskip
+ \@minus 0.167\onelineskip}%
+ \renewcommand*{\chapnamefont}{\normalfont}%
+ \renewcommand*{\chapnumfont}{\chapnamefont}%
+ \renewcommand*{\printchapternum}{\centering\chapnumfont \ifanappendix \thechapter
+ \else \numtoName{\c@chapter}\fi}%
+ \renewcommand*{\chaptitlefont}{\normalfont\itshape\huge\centering}%
+ \renewcommand*{\printchapternonum}{%
+ \vphantom{\printchaptername}\vskip\midchapskip}}
+
+\makechapterstyle{komalike}{%
+ \setlength{\beforechapskip}{2\onelineskip}%
+ \setlength{\afterchapskip}{1.5\onelineskip \@plus .1\onelineskip
+ \@minus 0.167\onelineskip}%
+ \renewcommand*{\printchaptername}{}%
+ \renewcommand*{\chapternamenum}{}%
+ \renewcommand*{\chapnumfont}{\normalfont\LARGE\sffamily\bfseries}%
+ \renewcommand*{\printchapternum}{\chapnumfont \thechapter\space}%
+ \renewcommand*{\afterchapternum}{}%
+ \renewcommand*{\chaptitlefont}{\normalfont\LARGE\sffamily\bfseries}}
+
+\makechapterstyle{ntglike}{%
+ \setlength{\beforechapskip}{50pt \@plus 20pt}%
+ \renewcommand*{\chapnamefont}{\normalfont\Large\bfseries}%
+ \renewcommand*{\chapnumfont}{\normalfont\Large\bfseries}%
+ \renewcommand*{\chaptitlefont}{\normalfont\Large\bfseries}}
+
+\makechapterstyle{tandh}{%
+ \setlength{\beforechapskip}{1\onelineskip}%
+ \setlength{\afterchapskip}{2\onelineskip \@plus .1\onelineskip
+ \@minus 0.167\onelineskip}%
+ \renewcommand*{\printchaptername}{}%
+ \renewcommand*{\chapternamenum}{}%
+ \renewcommand*{\chapnumfont}{\normalfont\huge\bfseries}%
+ \renewcommand*{\printchapternum}{\chapnumfont \thechapter\quad}%
+ \renewcommand*{\afterchapternum}{}%
+ \renewcommand*{\chaptitlefont}{\chapnumfont\raggedright}}
+
+\makechapterstyle{wilsondob}{%
+ \setlength{\beforechapskip}{2\onelineskip}%
+ \setlength{\afterchapskip}{4\onelineskip \@plus .1\onelineskip
+ \@minus 0.167\onelineskip}%
+ \renewcommand*{\printchaptername}{}%
+ \renewcommand*{\chapternamenum}{}%
+ \renewcommand*{\chapnumfont}{\normalfont\Huge\itshape}%
+ \renewcommand*{\printchapternum}{\raggedleft\chapnumfont \thechapter\quad}%
+ \renewcommand*{\afterchapternum}{}%
+ \renewcommand*{\chaptitlefont}{\chapnumfont}%
+ \renewcommand*{\printchapternonum}{\raggedleft}}
\newif\ifraggedbottomsection
\raggedbottomsectionfalse
+\newcommand*{\raggedbottomsection}{\raggedbottomsectiontrue}
+\newcommand*{\normalbottomsection}{\raggedbottomsectionfalse}
+
\newlength{\bottomsectionskip}
\setlength{\bottomsectionskip}{10mm}
@@ -1948,8 +2935,8 @@
\@ifnextchar[{#1[{#2}]}%
{#1[{#2}][{#2}]}}
-\newcommand*{\memsecinfo}[5]{}
-\newcommand*{\memsecstarinfo}[2]{}
+\newcommand{\memsecinfo}[5]{}
+\newcommand{\memsecstarinfo}[2]{}
\renewcommand{\@startsection}[6]{%
\ifraggedbottomsection\if@nobreak\else
@@ -2013,7 +3000,7 @@
\let\@mem@old@ssect\@ssect
\def\@ssect#1#2#3#4#5{%
\M@gettitle{#5}%
- \memsecstarinfo{#1}{\m@msecn@me}{#5}%
+ \memsecstarinfo{\m@msecn@me}{#5}%
\@mem@old@ssect{#1}{#2}{#3}{#4}{#5}}
\newcommand{\section}{%
@@ -2160,15 +3147,17 @@
\newcommand{\fancybreak}{\@ifstar{\@sfbreak}{\@fbreak}}
\newcommand{\@fbreak}[1]{\par
\penalty -100
- \noindent\parbox{\linewidth}{\centering #1}\null
- \penalty -20
+ \noindent\parbox{\linewidth}{\centering #1}%%\null
+ \par
+%% \penalty -20
%% \vskip -\onelineskip
\@afterindentfalse
\@afterheading}
\newcommand{\@sfbreak}[1]{\par
\penalty -100
- \noindent\parbox{\linewidth}{\centering #1}\null
- \penalty -20
+ \noindent\parbox{\linewidth}{\centering #1}%%\null
+ \par
+%% \penalty -20
%% \vskip -\onelineskip
\@afterindenttrue
\@afterheading}
@@ -2255,6 +3244,261 @@
\newcommand*{\noprelistbreak}{\@nobreaktrue\nopagebreak}
+\newcommand{\makeheadstyles}[2]{%
+ \@namedef{hds@#1}{\@hds@def@ult #2}}
+\newcommand*{\headstyles}[1]{\@nameuse{hds@#1}}
+\newcommand*{\@hds@def@ult}{%
+ \renewcommand*{\beforebookskip}{\null\vfil}%
+ \renewcommand*{\midbookskip}{\par\vskip 20pt}%
+ \renewcommand*{\afterbookskip}{\vfil\newpage}%
+ \renewcommand*{\booknamefont}{\normalfont\huge\bfseries}%
+ \renewcommand*{\booknumfont}{\normalfont\huge\bfseries}%
+ \renewcommand*{\booktitlefont}{\normalfont\Huge\bfseries}%
+ \renewcommand*{\printbookname}{\booknamefont \bookname}%
+ \renewcommand*{\booknamenum}{\space}%
+ \renewcommand*{\printbooknum}{\booknumfont \thebook}%
+ \renewcommand*{\printbooktitle}[1]{\booktitlefont{##1}}%
+ \renewcommand*{\beforepartskip}{\null\vfil}%
+ \renewcommand*{\midpartskip}{\par\vskip 20pt}%
+ \renewcommand*{\afterpartskip}{\vfil\newpage}%
+ \renewcommand*{\partnamefont}{\normalfont\huge\bfseries}%
+ \renewcommand*{\partnumfont}{\normalfont\huge\bfseries}%
+ \renewcommand*{\parttitlefont}{\normalfont\Huge\bfseries}%
+ \renewcommand*{\printpartname}{\partnamefont \partname}%
+ \renewcommand*{\partnamenum}{\space}%
+ \renewcommand*{\printpartnum}{\partnumfont \thepart}%
+ \renewcommand*{\printparttitle}[1]{\parttitlefont{##1}}%
+ \@chs@def@ult% default chapterstyle
+ \setsechook{}
+ \setsecindent{\z@}%
+ \setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}%
+ \setaftersecskip{2.3ex \@plus .2ex}%
+ \setsecheadstyle{\Large\bfseries\raggedright}%
+ \setsubsechook{}%
+ \setsubsecindent{\z@}%
+ \setbeforesubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
+ \setaftersubsecskip{1.5ex \@plus .2ex}%
+ \setsubsecheadstyle{\large\bfseries\raggedright}%
+ \setsubsubsechook{}%
+ \setsubsubsecindent{\z@}%
+ \setbeforesubsubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
+ \setaftersubsubsecskip{1.5ex \@plus .2ex}%
+ \setsubsubsecheadstyle{\normalsize\bfseries\raggedright}%
+ \setparahook{}%
+ \setparaindent{\z@}%
+ \setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalsize\bfseries}%
+ \setsubparahook{}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalsize\bfseries}}
+
+\makeheadstyles{default}{}
+\headstyles{default}
+
+\newcommand*{\addperiod}[1]{#1.}
+
+\makeheadstyles{memman}{%
+ \renewcommand*{\booknamefont}{\normalfont\huge\sffamily}
+ \renewcommand*{\booknumfont}{\normalfont\huge\sffamily}
+ \renewcommand*{\booktitlefont}{\normalfont\Huge\sffamily}
+ \renewcommand*{\midbookskip}{\par\vskip 2\onelineskip}%
+ \renewcommand*{\partnamefont}{\normalfont\huge\sffamily}
+ \renewcommand*{\partnumfont}{\normalfont\huge\sffamily}
+ \renewcommand*{\parttitlefont}{\normalfont\Huge\sffamily}
+ \renewcommand*{\midpartskip}{\par\vskip 2\onelineskip}%
+ \chapterstyle{demo3}
+ \setbeforesecskip{-1.333\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{0.667\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\scshape\raggedright}%
+ \setbeforesubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\normalfont\bfseries\raggedright}%
+ \setbeforesubsubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\itshape\raggedright}%
+ \setbeforeparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\itshape\addperiod}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\itshape\addperiod}}
+
+\makeheadstyles{bringhurst}{%
+\chapterstyle{bringhurst}
+ \setbeforesecskip{-1\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\raggedright\scshape\MakeLowercase}%
+ \setbeforesubsecskip{-1.0\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{1.0\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\sethangfrom{\noindent ####1}\normalfont\itshape\raggedright}%
+ \setbeforesubsubsecskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubsubsecskip{-1em}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\scshape\MakeLowercase}%
+ \setbeforeparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\itshape\addperiod}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\itshape\addperiod}}
+
+\makeheadstyles{crosshead}{%
+ \chapterstyle{crosshead}
+ \setbeforesecskip{-1.25\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{0.75\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\centering\MakeUppercase}%
+ \setbeforesubsecskip{-1.25\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{0.75\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\normalfont\centering\bfseries}%
+ \setbeforesubsubsecskip{-.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsubsecskip{.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\centering\scshape\MakeLowercase}%
+ \setbeforeparaskip{-.667\onelineskip
+ \@plus -02.5\onelineskip \@minus -0.25\onelineskip}%
+ \setafterparaskip{.333\onelineskip \@plus 0.1\onelineskip}%
+ \setparaheadstyle{\normalfont\normalsize\centering\itshape}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\scshape\MakeLowercase}}
+
+\makeheadstyles{dowding}{%
+ \chapterstyle{dowding}
+ \setbeforesecskip{-2\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\centering\MakeUppercase}%
+ \setbeforesubsecskip{-1.2\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{0.8\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\normalfont\scshape\centering\MakeLowercase}%
+ \setbeforesubsubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\centering\itshape}%
+ \setbeforeparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\itshape\addperiod}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\itshape\addperiod}}
+
+\makeheadstyles{komalike}{%
+ \renewcommand*{\partnamefont}{\huge\sffamily\bfseries}%
+ \renewcommand*{\partnumfont}{\huge\sffamily\bfseries}%
+ \renewcommand*{\parttitlefont}{\huge\sffamily\bfseries}%
+ \chapterstyle{komalike}
+ \setbeforesecskip{-3.5ex \@plus -1ex \@minus -.2ex}%
+ \setaftersecskip{2.3ex \@plus .2ex}%
+ \setsecheadstyle{\normalfont\Large\sffamily\bfseries\raggedright}%
+ \setbeforesubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
+ \setaftersubsecskip{1.5ex \@plus .2ex}%
+ \setsubsecheadstyle{\normalfont\large\sffamily\bfseries\raggedright}%
+ \setbeforesubsubsecskip{-3.25ex \@plus -1ex \@minus -.2ex}%
+ \setaftersubsubsecskip{1.5ex \@plus .2ex}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\sffamily\bfseries\raggedright}%
+ \setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\sffamily\bfseries}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\sffamily\bfseries}}
+
+\makeheadstyles{ntglike}{%
+ \renewcommand*{\partnamefont}{\Large\bfseries\MakeUppercase}%
+ \renewcommand*{\partnumfont}{\Large\bfseries}%
+ \renewcommand*{\parttitlefont}{\Large\MakeUppercase}%
+ \chapterstyle{ntglike}
+ \setbeforesecskip{-2\onelineskip
+ \@plus -1\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{0.5\onelineskip}%
+ \setsecheadstyle{\normalfont\large\bfseries}%
+ \setbeforesubsecskip{-1\onelineskip
+ \@plus -.5\onelineskip \@minus -.25\onelineskip}%
+ \setaftersubsecskip{0.01\onelineskip}%
+ \setsubsecheadstyle{\normalfont\normalsize\bfseries}%
+ \setbeforesubsubsecskip{-1\onelineskip
+ \@plus -.5\onelineskip \@minus -.25\onelineskip}%
+ \setaftersubsubsecskip{0.01\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\slshape}%
+ \setbeforeparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\slshape}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{3.25ex \@plus 1ex \@minus .2ex}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\slshape}}
+
+\makeheadstyles{tandh}{%
+ \chapterstyle{tandh}
+ \setbeforesecskip{-2\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+ \setbeforesubsecskip{-1.2\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{0.8\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+ \setbeforesubsubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\bfseries\raggedright}%
+ \setbeforeparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\itshape\addperiod}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\itshape\addperiod}}
+
+\makeheadstyles{wilsondob}{%
+ \chapterstyle{wilsondob}
+ \setbeforesecskip{-1.333\onelineskip
+ \@plus -0.5\onelineskip \@minus -.5\onelineskip}%
+ \setaftersecskip{0.667\onelineskip \@plus 0.1\onelineskip}%
+ \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
+ \setbeforesubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsecheadstyle{\normalfont\Large\itshape\raggedright}%
+ \setbeforesubsubsecskip{-0.667\onelineskip
+ \@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
+ \setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\raggedright\scshape\MakeLowercase}%
+ \setbeforeparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setafterparaskip{-1em}%
+ \setparaheadstyle{\normalfont\normalsize\itshape\addperiod}%
+ \setsubparaindent{\parindent}%
+ \setbeforesubparaskip{1.0\onelineskip
+ \@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
+ \setaftersubparaskip{-1em}%
+ \setsubparaheadstyle{\normalfont\normalsize\itshape\addperiod}}
+
\newif\ifanappendix
\anappendixfalse
\newcommand{\appendix}{\par
@@ -2266,8 +3510,8 @@
\newcommand{\appendixpage}{%
\@ifstar{\@sapppage}{\@apppage}}
-\newcommand*{\memapppageinfo}[1]{}
-\newcommand*{\memapppagestarinfo}[1]{}
+\newcommand{\memapppageinfo}[1]{}
+\newcommand{\memapppagestarinfo}[1]{}
\def\@apppage{%
\@setuppart
@@ -2289,7 +3533,8 @@
\printparttitle{\appendixpagename}\par}%
\@endpart}
-\def\addappheadtotoc{\addcontentsline{toc}{chapter}{\appendixtocname}}
+\def\addappheadtotoc{%
+ \phantomsection\addcontentsline{toc}{chapter}{\appendixtocname}}
\newcounter{@ppsavesec}
\newcounter{@ppsaveapp}
\setcounter{@ppsaveapp}{0}
@@ -2326,6 +3571,8 @@
\newif\ifnamesubappendix
\namesubappendixfalse
+\newcommand*{\namedsubappendices}{\namesubappendixtrue}
+\newcommand*{\unnamedsubappendices}{\namesubappendixfalse}
\newenvironment{subappendices}{%
\@resets@ppsub
@@ -2430,6 +3677,32 @@
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\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}
+
\newlength{\parsepi}
\newlength{\topsepi}
\newlength{\itemsepi}
@@ -2437,71 +3710,114 @@
\newlength{\topsepii}
\newlength{\topsepiii}
-\newcommand{\defaultlists}{% %% initialise for 10pt
- \setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
- \parsepi= 4\p@ \@plus2\p@ \@minus\p@
- \topsepi= 8\p@ \@plus2\p@ \@minus4\p@
- \itemsepi= 4\p@ \@plus2\p@ \@minus\p@
- \parsepii= 2\p@ \@plus\p@ \@minus\p@
- \topsepii= 4\p@ \@plus2\p@ \@minus\p@
- \topsepiii= 2\p@ \@plus\p@ \@minus\p@
-\ifcase\@ptsize % 0 = 10pt
-\or % 1 = 11pt
- \setlength\partopsep{3\p@ \@plus 1\p@ \@minus 1\p@}
- \parsepi= 4.5\p@ \@plus2\p@ \@minus\p@
- \topsepi= 9\p@ \@plus3\p@ \@minus5\p@
- \itemsepi= 4.5\p@ \@plus2\p@ \@minus\p@
- \parsepii= 2\p@ \@plus\p@ \@minus\p@
- \topsepii= 4.5\p@ \@plus2\p@ \@minus\p@
- \topsepiii= 2\p@ \@plus\p@ \@minus\p@
-\or % 2 = 12pt
- \setlength\partopsep{3\p@ \@plus 2\p@ \@minus 2\p@}
- \parsepi= 5\p@ \@plus2.5\p@ \@minus\p@
- \topsepi= 10\p@ \@plus4\p@ \@minus6\p@
- \itemsepi= 5\p@ \@plus2.5\p@ \@minus\p@
- \parsepii= 2.5\p@ \@plus\p@ \@minus\p@
- \topsepii= 5\p@ \@plus2.5\p@ \@minus\p@
- \topsepiii= 2.5\p@ \@plus\p@ \@minus\p@
-\or % 3 = 13pt %% not available
-\or % 4 = 14pt
- \setlength\partopsep{4\p@ \@plus 2\p@ \@minus 2\p@}
- \parsepi= 6\p@ \@plus2.5\p@ \@minus\p@
- \topsepi= 12\p@ \@plus4\p@ \@minus6\p@
- \itemsepi= 6\p@ \@plus2.5\p@ \@minus\p@
- \parsepii= 3\p@ \@plus\p@ \@minus\p@
- \topsepii= 6\p@ \@plus2.5\p@ \@minus\p@
- \topsepiii= 3\p@ \@plus\p@ \@minus\p@
-\or % 5 = 15pt %% not available
-\or % 6 = 16pt %% not available
-\or % 7 = 17pt
- \setlength\partopsep{5\p@ \@plus 2\p@ \@minus 2\p@}
- \parsepi= 7\p@ \@plus3\p@ \@minus\p@
- \topsepi= 14\p@ \@plus6\p@ \@minus8\p@
- \itemsepi= 7\p@ \@plus3\p@ \@minus\p@
- \parsepii= 3\p@ \@plus\p@ \@minus\p@
- \topsepii= 7\p@ \@plus3\p@ \@minus\p@
- \topsepiii= 3.5\p@ \@plus\p@ \@minus\p@
-\or % 8 = 18pt %% not available
-\or % 9 = 9pt
- \setlength\partopsep{2\p@ \@plus 1\p@ \@minus 1\p@}
- \parsepi= 3.5\p@ \@plus2\p@ \@minus\p@
- \topsepi= 7\p@ \@plus3\p@ \@minus5\p@
- \itemsepi= 3.5\p@ \@plus2\p@ \@minus\p@
- \parsepii= 2\p@ \@plus\p@ \@minus\p@
- \topsepii= 4\p@ \@plus2\p@ \@minus\p@
- \topsepiii= 2\p@ \@plus\p@ \@minus\p@
-\fi
-}
+\newlength{\itemsepii}
+\newlength{\itemsepiii}
+\newlength{\partopsepii}
+\newlength{\partopsepiii}
+\newcommand*{\setnzplist}{%
+ \partopsep \p@ \@plus\z@ \@minus\p@
+ \topsepi\z@
+ \parsepi\parskip
+ \itemsepi\z@
+ \topsepii\z@
+ \parsepii\parskip
+ \itemsepii\z@
+ \topsepiii\z@
+%% \parsepiii\parskip
+ \itemsepiii\z@}
+
+\newcommand*{\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
+ \itemsepii\parsepii
+ \itemsepiii\topsepiii
+ \partopsepiii \p@ \@plus\z@ \@minus\p@
+ \ifm@mnzpskip
+ \setnzplist
+ \fi}
+\defaultlists
-\newcommand{\tightlists}{%
- \setlength\partopsep{0.5\onelineskip \@plus 0\p@ \@minus 0\p@}
- \parsepi= \parskip
- \itemsepi = \p@ \@plus\p@ \@minus\p@
- \topsepi = 0.5\parskip
- \parsepii = \parskip
- \topsepii = 0.5\parskip
- \topsepiii = 0.5\parskip
-}
+\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}
+
+\newcommand*{\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
+ \ifm@mnzpskip
+ \setnzplist
+ \partopsepiii\partopsep
+ \fi}
+
+\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
+ \ifm@mnzpskip
+ \setnzplist
+ \partopsepiii\partopsep
+ \fi}
+
+\newcommand{\firmlist}{%
+ \setlength{\itemsep}{0.5\itemsep}\setlength{\parskip}{0.5\parskip}}
+\newcommand{\tightlist}{%
+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
+\newskip\m@msavetopsep
+\newskip\m@msavepartopsep
+\newcommand*{\savetrivseps}{%
+ \m@msavetopsep\topsep
+ \m@msavepartopsep\partopsep}
+\newcommand*{\restoretrivseps}{%
+ \topsep\m@msavetopsep
+ \partopsep\m@msavepartopsep}
+\savetrivseps
+
+\newcommand*{\zerotrivseps}{%
+ \topsep\z@
+ \partopsep\z@}
\def\@listi{\leftmargin\leftmargini
\parsep\parsepi
@@ -2516,15 +3832,17 @@
\advance\labelwidth-\labelsep
\topsep\topsepii
\parsep\parsepii
- \itemsep\parsep}
+ \itemsep\parsepii}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii
\advance\labelwidth-\labelsep
\topsep\topsepiii
\parsep\z@
- \partopsep \p@ \@plus\z@ \@minus\p@
- \itemsep\topsep}
+%%% \itemsep\topsep
+%%% \partopsep \p@ \@plus\z@ \@minus\p@
+ \itemsep\itemsepiii
+ \partopsep\partopsepiii}
\def\@listiv{\leftmargin\leftmarginiv
\labelwidth\leftmarginiv
@@ -2538,25 +3856,6 @@
\labelwidth\leftmarginvi
\advance\labelwidth-\labelsep}
-\newcommand{\firmlist}{%
- \setlength{\itemsep}{0.5\itemsep}\setlength{\parskip}{0.5\parskip}}
-\newcommand{\tightlist}{%
- \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
-
-\newskip\m@msavetopsep
-\newskip\m@msavepartopsep
-\newcommand*{\savetrivseps}{%
- \m@msavetopsep\topsep
- \m@msavepartopsep\partopsep}
-\newcommand*{\restoretrivseps}{%
- \topsep\m@msavetopsep
- \partopsep\m@msavepartopsep}
-\savetrivseps
-
-\newcommand*{\zerotrivseps}{%
- \topsep\z@
- \partopsep\z@}
-
\renewcommand{\theenumi}{\@arabic\c@enumi}
\renewcommand{\theenumii}{\@alph\c@enumii}
\renewcommand{\theenumiii}{\@roman\c@enumiii}
@@ -2662,14 +3961,157 @@
\let\makelabel\symbollabel}}%
{\endlist}
\newcommand{\symboldef}[2]{\item[#1] #2}
+\newif\if@bsonecol
+ \@bsonecoltrue
+\newif\ifadd@bstotoc
+ \add@bstotocfalse
+\newif\ifnumber@bs
+ \number@bsfalse
+\newif\if@bsrunin
+ \@bsruninfalse
+
+\newcommand{\abstractcol}{\@bsonecolfalse}
+\newcommand{\abstractintoc}{\add@bstotoctrue}
+\newcommand{\abstractnum}{\number@bstrue\@bsruninfalse}
+\newcommand{\abstractrunin}{\@bsrunintrue\number@bsfalse}
+
+\newcommand{\abstractnamefont}{\normalfont\small\bfseries}
+\newcommand{\abstracttextfont}{\normalfont\small}
+\newcommand{\abscolnamefont}{\normalfont\Large\bfseries}
+\newcommand{\abscoltextfont}{\normalfont}
+
+\newcommand{\absnamepos}{center}
+\newlength{\abstitleskip} \setlength{\abstitleskip}{-0.5em}
+\newlength{\absleftindent}
+ \absleftindent=\leftmargin
+\newdimen\abs@leftindent
+ \abs@leftindent=\leftmargin
+\newlength{\absrightindent}
+ \absrightindent=\leftmargin
+\newlength{\absparindent}
+\newlength{\absparsep}
+
+\newcommand{\abslabeldelim}[1]{\def\@bslabeldelim{#1}}
+\abslabeldelim{}
+\newcommand{\@bsrunintitle}{%
+ \hspace*{\abstitleskip}{\abstractnamefont\abstractname\@bslabeldelim}}
+
+\newcommand{\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}
+
+\AtBeginDocument{\setlength{\absparindent}{\parindent}
+ \setlength{\absparsep}{\parskip}}
+
+\newenvironment{@bstr@ctlist}{%
+ \list{}{%
+ %%\topsep \z@
+ \partopsep \z@
+ \listparindent \absparindent
+ \itemindent \listparindent
+ \leftmargin \abs@leftindent
+ \rightmargin \absrightindent
+ \parsep \absparsep}%
+ \item\relax}
+ {\endlist}
+
+\newcommand{\put@bsintoc}{%
+ \ifadd@bstotoc
+ \ifnumber@bs\else
+ \phantomsection
+ \addcontentsline{toc}{chapter}{\abstractname}
+ \fi
+ \fi}
+
+\newcommand{\num@bs}{\chapter{\abstractname}}
+
+\newenvironment{abstract}{%
+ \setup@bstract
+ \if@bsrunin\else
+ \ifnumber@bs \num@bs \else
+ \begin{\absnamepos}\abstractnamefont\abstractname\end\absnamepos%
+ \vspace{\abstitleskip}%
+ \fi
+ \fi
+ \put@bsintoc%
+ \begin{@bstr@ctlist}\if@bsrunin\@bsrunintitle\fi\abstracttextfont}%
+ {\par\end{@bstr@ctlist}}
+
+\newenvironment{onecolabstract}{%
+ \begin{@twocolumnfalse}\begin{abstract}}{%
+ \end{abstract}\end{@twocolumnfalse}}
+
+\addtoiargdef{\thanks}{}{%
+ \protected@xdef\@bs@thanks{\@bs@thanks
+ \protect\footnotetext[\the\c@footnote]{#1}}%
+}
+\let\@bs@thanks\@empty
+
+\newcommand{\saythanks}{\begingroup
+ \renewcommand{\thefootnote}{\fnsymbol{footnote}}\@bs@thanks
+ \endgroup\global\let\@bs@thanks\@empty}
+
\newcounter{vslineno}
\newcounter{poemline}
\newcounter{modulo@vs}
+\newcounter{memfvsline}
-\newcommand{\poemlines}[1]{\linenumberfrequency{#1}%
- \@memwarn{Use \string\linenumberfrequency\space
- instead of \string\poemlines}%
-}
+%%%\newcommand{\poemlines}[1]{\linenumberfrequency{#1}%
+%%% \@memwarn{Use \string\linenumberfrequency\space
+%%% instead of \string\poemlines}}
+
+\newcommand{\linenumberfont}[1]{\def\vlvnumfont{#1}}
+%%% \linenumberfont{\small\rmfamily}
+
+\newif\ifbvcountlines% TRUE to print line numbers of (boxed) verbatim lines
+ \bvcountlinesfalse
+
+\newcommand{\linenumberfrequency}[1]{%
+ \ifnum #1< \@ne
+ \def\linemodnum{0\relax}
+ \bvcountlinesfalse
+ \else
+ \def\linemodnum{#1\relax}
+ \bvcountlinestrue
+ \fi}
+
+%%%%\linenumberfrequency{0}
+
+\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}
+
+\newcommand{\getthelinenumber}[2]{%
+ \ifnum\@ne>\linemodnum% no line numbers
+ \else
+ \ifnum\@ne=\linemodnum% every line numbered
+ \@nameuse{the#1}%
+ \else
+ \@tempcnta=\@nameuse{c@#1}%
+ \advance\@tempcnta -\@nameuse{c@#2}%
+ \divide\@tempcnta \linemodnum
+ \multiply\@tempcnta \linemodnum
+ \advance\@tempcnta \@nameuse{c@#2}%
+ \ifnum\@tempcnta=\@nameuse{c@#1}\@nameuse{the#1}\fi
+ \fi
+ \fi}
\newif\ifaltindent
\altindentfalse
@@ -2698,7 +4140,7 @@
\newdimen\vleftmargin
\vleftmargin=\leftmargini
-\newcommand{\verselinebreak}[1][\z@]{\newline\hspace*{#1}}
+\newcommand{\verselinebreak}[1][\z@]{\newline\hspace*{#1}\ignorespaces}
\newcommand{\incr@vsline}{%
\refstepcounter{poemline}%
@@ -2707,14 +4149,23 @@
\newcommand{\@vsifbang}[1]{\@ifnextchar !{\@firstoftwo{#1}}}
\newcommand{\@vsifgt}[1]{\@ifnextchar >{\@firstoftwo{#1}}}
+\newcommand*{\verselinenumbersright}{\def\@vstypelinenum{\@vslnumright}}
+\newcommand*{\verselinenumbersleft}{\def\@vstypelinenum{\@vslnumleft}}
+\verselinenumbersright
+
+\newcommand*{\@vslnumright}{%
+ \hfill\rlap{\kern\vrightskip\kern\rightmargin%
+ \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
+\newcommand*{\@vslnumleft}{%
+ \hfill\rlap{\kern-\textwidth\kern-\vrightskip%
+ \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
\newcommand{\@vscentercr}{%
\ifhmode \unskip\else \@nolnerr\fi
- \hfill\rlap{\kern\vrightskip\kern\rightmargin%
- \vlvnumfont\getthelinenumber{poemline}}%
+ \@vstypelinenum%
\@vsifgt{\verselinebreak}{%
- \incr@vsline
- \par\@ifstar{\nobreak\@vsxcentercr}{%
- \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}}}}
+ \incr@vsline
+ \par\@ifstar{\nobreak\@vsxcentercr}{%
+ \@vsifbang{\@ifnextchar[ {\@vsicentercr}{}}{\@vsxcentercr}}}}
\newcommand{\@vsxcentercr}{\addvspace{-\parskip}%
\@ifnextchar[ {\@vsicentercr}{\start@vsline}}
\def\@vsicentercr[#1]{\vskip #1\ignorespaces \start@vsline}
@@ -2759,9 +4210,6 @@
\setcounter{vslineno}{1}}%
{\altindentfalse}
-\newcommand{\@nameedef}[1]{
- \expandafter\protected@edef\csname #1\endcsname}
-
\newif\ifbounderror
\bounderrorfalse
\newif\ifinteger
@@ -2773,8 +4221,7 @@
\@nameedef{#1-high}{#3}%
\ifnum #3<#2
\@memerror{Limits for array #1 are in reverse order}{\@ehc}%
- \fi
-}
+ \fi}
\newcommand{\stringtoarray}[2]{%
\def\@vsarrayname{#1}%
@@ -2786,8 +4233,7 @@
}{%
\c@chrsinstr \@ne
\expandafter\@vsstringtoarray \the@vsstring\@vsend
- }
-}
+ }}
\def\@vsstringtoarray #1#2\@vsend{%
\@namedef{\@vsarrayname-\the\c@chrsinstr}{#1}
@@ -2800,18 +4246,14 @@
\@vsstringtoarray #2\@vsend%
}%
}
- \@vsinext
-}
+ \@vsinext}
\newcommand{\setarrayelement}[3]{%
\checkarrayindex{#1}{#2}%
- \@nameedef{#1-#2}{#3}%
-}
-
+ \@nameedef{#1-#2}{#3}}
\newcommand{\getarrayelement}[3]{%
\checkarrayindex{#1}{#2}%
- \protected@edef#3{\@nameuse{#1-#2}}%
-}
+ \protected@edef#3{\@nameuse{#1-#2}}}
\newcommand{\checkarrayindex}[2]{%
\bounderrorfalse
@@ -2832,22 +4274,19 @@
\@memerror{Index #2 outside limits for array #1}{\@ehc}%
\fi
\bounderrortrue
- \fi
-}
+ \fi}
\newcommand{\arraytostring}[2]{%
\def#2{}%
\c@chrsinstr = \@nameuse{#1-low}%
- \@vsarraytostring{#1}{#2}%
-}
+ \@vsarraytostring{#1}{#2}}
\newcommand{\@vsarraytostring}[2]{%
\ifnum\c@chrsinstr>\@nameuse{#1-high}\else
\protected@edef#2{#2\@nameuse{#1-\thechrsinstr}}%
\advance\c@chrsinstr\@ne%
\@vsarraytostring{#1}{#2}%
- \fi%
-}
+ \fi}
\newcommand{\checkifinteger}[1]{%
\protected@edef\@vsa{#1}%
@@ -2855,13 +4294,11 @@
\integertrue%
\else
\integerfalse%
- \fi%
-}
+ \fi}
\newcommand{\gobm}[1]{#1}
\newcommand{\indentpattern}[1]{%
\stringtoarray{Array@vs}{#1}}
-
\newcommand{\get@vsindent}{%
\getarrayelement{Array@vs}{\number\value{vslineno}}{\@vspat}%
\ifbounderror
@@ -2904,8 +4341,8 @@
\secdef\@vsptitle\@vssptitle}
\newcommand{\poemtoc}{section}
-\newcommand*{\mempoeminfo}[1]{}
-\newcommand*{\mempoemstarinfo}[1]{}
+\newcommand{\mempoeminfo}[1]{}
+\newcommand{\mempoemstarinfo}[1]{}
\long\def\@vsptitle[#1]#2{%
\phantomsection
@@ -2959,8 +4396,8 @@
\@ifnextchar[{\@PoemTitle}{\@PoemTitle[]}%
}
-\newcommand*{\memPoemTitleinfo}[4]{}
-\newcommand*{\memPoemTitlestarinfo}[2]{}
+\newcommand{\memPoemTitleinfo}[4]{}
+\newcommand{\memPoemTitlestarinfo}[2]{}
\def\@PoemTitle[#1]#2{%
\phantomsection
@@ -2996,8 +4433,7 @@
\addcontentsline{toc}{\poemtoc}{\poemf@rtoc}%
\memPoemTitleinfo{}{\poemf@rtoc}{\poemf@rhdr}{#2}%
\fi
- \ifheadnameref\M@gettitle{\poemf@rhdr}\else\M@gettitle{\poemf@rtoc}\fi
-}
+ \ifheadnameref\M@gettitle{\poemf@rhdr}\else\M@gettitle{\poemf@rtoc}\fi}
\def\@makePoemTitlehead#1{{%
\PoemTitleheadstart
@@ -3010,8 +4446,7 @@
\fi
\interlinepenalty\@M
\printPoemTitletitle{#1}%
- \afterPoemTitle
- }}
+ \afterPoemTitle}}
\newcommand{\@PTchs@def@ult}{%
\def\PoemTitleheadstart{\vspace{\beforePoemTitleskip}}
@@ -3019,8 +4454,7 @@
\def\afterPoemTitlenum{\par\nobreak\vskip \midPoemTitleskip}
\def\printPoemTitlenonum{}
\def\printPoemTitletitle##1{\PoemTitlefont ##1}
- \def\afterPoemTitle{\par\nobreak\vskip \afterPoemTitleskip}
-}
+ \def\afterPoemTitle{\par\nobreak\vskip \afterPoemTitleskip}}
\@PTchs@def@ult
\newcommand*{\PoemTitlenumfont}{\normalfont\large\centering}
@@ -3041,8 +4475,7 @@
\fi
\poemtitlestarmark{\poemf@rhdr}%
\poemtitlestarpstyle
- \memPoemTitlestarinfo{\poemf@rhdr}{#2}%
-}
+ \memPoemTitlestarinfo{\poemf@rhdr}{#2}}
\newcommand{\@sPoemTitle}[1]{%
\@makesPoemTitlehead{#1}%
@@ -3063,6 +4496,11 @@
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
+\newcommand{\@minipagerestore}{%
+ \let\@verbfootnotetext\@verbmpfootnotetext
+ \m@mdoextrafeetmini
+ \ifm@mnzpskip \parskip=\m@mabparskip\fi}
+
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
@@ -3170,8 +4608,8 @@
\d@llarend \hfil \or
\hskip1sp\d@llarbegin \insert@column \d@llarend \hfil \or
\hfil\hskip1sp\d@llarbegin \insert@column \d@llarend \or
- $\vcenter
- \@startpbox{\@nextchar}\insert@column \@endpbox $\or
+ $\vcenter%$
+ \@startpbox{\@nextchar}\insert@column \@endpbox $\or%$
\vtop \@startpbox{\@nextchar}\insert@column \@endpbox \or
\vbox \@startpbox{\@nextchar}\insert@column \@endpbox
\fi}\prepnext@tok}
@@ -3262,7 +4700,7 @@
\let\d@llarbegin\begingroup
\let\d@llarend\endgroup
\def\array{\col@sep\arraycolsep
- \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%
+ \def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%$
\@tabarray}
\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
\let\@@array\@array
@@ -3272,13 +4710,13 @@
\xdef\@halignto{to\the\dimen@}\@tabular}
\def\@tabular{%
\leavevmode
- \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup
+ \hbox \bgroup $\col@sep\tabcolsep \let\d@llarbegin\begingroup%$
\let\d@llarend\endgroup
\@tabarray}
\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
\let\@arrayleft\@empty
\let\@arrayright\@empty
-\def\endtabular{\endarray $\egroup}
+\def\endtabular{\endarray $\egroup}%$
\expandafter\let\csname endtabular*\endcsname=\endtabular
\let\@ampacol=\relax \let\@expast=\relax
\let\@arrayclassiv=\relax \let\@arrayclassz=\relax
@@ -3382,10 +4820,10 @@
{#2}{#3}{#1}}
\def\DC@centre#1#2#3{%
\let\DC@end\DC@endcentre
- \uppercase{\def~}{$\egroup\setbox\tw@=\hbox\bgroup${#2}}%
+ \uppercase{\def~}{$\egroup\setbox\tw@=\hbox\bgroup${#2}}%$
\setbox\tw@=\hbox{${\phantom{{#2}}}$}%
- \setbox\z@=\hbox\bgroup$\mathcode`#1="8000 }
-\def\DC@endcentre{$\egroup
+ \setbox\z@=\hbox\bgroup$\mathcode`#1="8000 }%$
+\def\DC@endcentre{$\egroup%$
\ifdim \wd\z@>\wd\tw@
\setbox\tw@=\hbox to\wd\z@{\unhbox\tw@\hfill}%
\else
@@ -3405,8 +4843,8 @@
\dimen@\count@\dimen@ii
\setbox\z@\hbox{${#2}$}\advance\dimen@\wd\z@
\setbox\tw@\hbox to\dimen@{}%
- \setbox\z@\hbox\DC@rl$\mathcode`#1="8000 }
-\def\DC@endright{$\hfil\egroup\box\z@\box\tw@}
+ \setbox\z@\hbox\DC@rl$\mathcode`#1="8000 }%$
+\def\DC@endright{$\hfil\egroup\box\z@\box\tw@}%$
\newcolumntype{D}[3]{>{\DC@{#1}{#2}{#3}}c<{\DC@end}}
%%%%%%%%%% end Dcolumn package code %%%%%%%%%%%%%%%%%%%%%
@@ -3761,6 +5199,21 @@
%%\@memfakeusepackage{booktabs}
+\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
+
\newskip\ctableftskip \ctableftskip=\fill
\newskip\ctabrightskip \ctabrightskip=\fill
@@ -3858,8 +5311,7 @@
\def\ctabsetlines{%
\let\hline\m@mhline
- \let\@BTnormal\m@m@BTnormal
-}
+ \let\@BTnormal\m@m@BTnormal}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcount\abovecolumnspenalty
@@ -3918,8 +5370,7 @@
\the\crtok
\else
&\global\advance\@cellstogo\m@ne
- \fi
- }
+ \fi}%
\ifdim #1 > \z@
\TX@col@width=#1
\divide\TX@col@width \TX@cols
@@ -3927,8 +5378,8 @@
\TX@col@width=\@mincolumnwidth
\fi
\penalty\abovecolumnspenalty
- \noindent % usually not a paragraph
- \def\@preamble{}
+ \noindent% usually not a paragraph
+ \def\@preamble{}%
\begingroup
\let\@sharp\relax
\ifnum\@cellsincolumn>\@ne
@@ -3952,8 +5403,7 @@
\tabskip\ctabrightskip\cr
\@for\@tempa:=#5\do{
\@tempa\unskip\space\@endcolumnactions}%
- \the\crtok \egroup \par \endgroup
-}
+ \the\crtok \egroup \par \endgroup}
\newcommand*{\linespercol}{%
\@cellsincolumn=\@linestogo
@@ -3965,8 +5415,7 @@
\ifnum \@tempcnta>\z@
\advance\@cellsincolumn \@ne
\fi
- \global\@cellstogo=\@cellsincolumn
-}
+ \global\@cellstogo=\@cellsincolumn}
\newcommand{\autorows}[5][0pt]{\par\begingroup
\ctabsetlines
@@ -4021,7 +5470,7 @@
\penalty\abovecolumnspenalty
\noindent % usually not a paragraph
\vskip -\z@ % don't know why we need this, but looks bad without it
- \def\@preamble{}
+ \def\@preamble{}%
\begingroup
\let\@sharp\relax
\ifnum\TX@cols>\@ne
@@ -4056,15 +5505,16 @@
\@for\@tempa:=#5\do{%
\@tempa\unskip\space\@endcolumnactions}%
%% \the\crtok \postautotab \the\crtok \egroup \endgroup \par
- \the\crtok \egroup \endgroup \par
-}
+ \the\crtok \egroup \endgroup \par}
\newcounter{newflo@tctr}
\setcounter{newflo@tctr}{1}
\newcommand{\newfloat}[4][\@empty]{%
- \@namedef{ftype@#2}{\value{newflo@tctr}}
- \addtocounter{newflo@tctr}{\value{newflo@tctr}}
+%%% \@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
\@ifundefined{c@#2}{% counter is not defined
\ifx \@empty#1\relax
\newcounter{#2}
@@ -4075,7 +5525,7 @@
\fi}{}
\setcounter{#2}{0}
- \@namedef{ext@#2}{#3} % file extension
+ \@namedef{ext@#2}{#3}% file extension
\@ifundefined{c@#3depth}{\newcounter{#3depth}}{}
\setcounter{#3depth}{1}
@@ -4088,6 +5538,8 @@
\newenvironment{#2*}{\@dblfloat{#2}}{\end@dblfloat}
} % end \newfloat
+\newcommand*{\setfloatlocations}[2]{\@namedef{fps@#1}{#2}}
+
\newcommand{\newsubfloat}[1]{%
\newlistentry[#1]{sub#1}{\@nameuse{ext@#1}}{1}
\@namedef{ext@sub#1}{\csname ext@#1\endcsname}
@@ -4096,8 +5548,7 @@
\if@tightsubcap\hskip\subfloatlabelskip\else\space\fi}
\@namedef{@@thesub#1}{\@nameuse{thesub#1}}
\@namedef{p@sub#1}{\csname the#1\endcsname}
- \@namedef{toclevel@sub#1}{1}
-}
+ \@namedef{toclevel@sub#1}{1}}
\newif\ifdonemaincaption
\donemaincaptionfalse
@@ -4145,15 +5596,15 @@
\newcommand{\captiontitlefont}[1]{\def\@conttfont{#1}}
\captiontitlefont{}
-\newcommand{\flushleftright}{%
+\newcommand*{\flushleftright}{%
\leftskip\z@ \rightskip\z@
- \parfillskip=\z@ plus 1fil}
-\newcommand{\centerlastline}{%
- \leftskip=\z@ plus 1fil
+ \parfillskip\@flushglue}
+\newcommand*{\centerlastline}{%
+ \parfillskip=\z@ plus 2fil
\rightskip=\z@ plus -1fil
- \parfillskip=\z@ plus 2fil}
+ \leftskip\@flushglue}
-\newcommand{\captionstyle}[1]{\def\@contcstyle{#1}}
+\newcommand*{\captionstyle}[1]{\def\@contcstyle{#1}}
\captionstyle{}
\renewcommand{\captionstyle}{%
@@ -4187,6 +5638,9 @@
\newcommand{\midbicaption}[1]{\def\@contmidbi{#1}}
\midbicaption{}
+\newcommand*{\captiontitlefinal}[1]{\def\@contfinal{#1}}
+ \captiontitlefinal{}
+
\newlength{\abovecaptionskip}
\setlength{\abovecaptionskip}{0.5\onelineskip}
\newlength{\belowcaptionskip}
@@ -4195,7 +5649,7 @@
\let\@memoldcaption\caption
\def\caption{\donemaincaptiontrue\@memoldcaption}
-\newcommand*{\memcaptioninfo}[4]{}
+\newcommand{\memcaptioninfo}[4]{}
\let\@memold@caption\@caption
\long\def\@caption#1[#2]#3{%
@@ -4208,7 +5662,7 @@
\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}
+ \sbox\@tempboxa{\@contnfont #1\@contdelim \@conttfont #2\@contfinal}
\let\footnote\@contfnote
\let\footnotemark\@contfmark
\ifdim\wd\@tempboxa<\linewidth \centering \fi
@@ -4221,19 +5675,19 @@
\sbox\@tempboxa{\@contnfont #1\@contdelim}
\@contpre%
{\@contcstyle\hangindent=\wd\@tempboxa
- \noindent\box\@tempboxa\@memtempa \@conttfont #2\par}
+ \noindent\box\@tempboxa\@memtempa \@conttfont #2\@contfinal\par}
\else
\if@contindent
\@contpre%
{\@contnfont #1\@contdelim}\@memtempa
{\@contcstyle\hangindent=\@contindw
- \hangafter=\@ne\@conttfont #2\par}% <- v1.4
+ \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\par}
+ \@conttfont #2\@contfinal\par}
\fi
\fi
\@contpost
@@ -4267,7 +5721,7 @@
\@memlistsubcaptions{#1}%
\fi}
-\newcommand*{\memlegendinfo}[1]{}
+\newcommand{\memlegendinfo}[1]{}
\newcommand{\legend}[1]{%
\M@gettitle{#1}%
\memlegendinfo{#1}%
@@ -4283,7 +5737,7 @@
\endgroup}
\newcommand{\namedlegend}{\@dblarg{\@legend\@captype}}
-\newcommand*{\memnamedlegendinfo}[3]{}
+\newcommand{\memnamedlegendinfo}[3]{}
\long\def\@legend#1[#2]#3{%
\M@gettitle{#2}%
@@ -4306,9 +5760,9 @@
\newcommand{\providefixedcaption}[3][\caption]{%
\providecommand{#2}{\def\@captype{#3}#1}}
-\newcommand*{\membitwonumcaptioninfo}[7]{}
-\newcommand*{\membionenumcaptioninfo}[7]{}
-\newcommand*{\membicaptioninfo}[6]{}
+\newcommand{\membitwonumcaptioninfo}[7]{}
+\newcommand{\membionenumcaptioninfo}[7]{}
+\newcommand{\membicaptioninfo}[6]{}
\newcommand{\bitwonumcaption}[6][\@empty]{%
\begingroup
@@ -4328,8 +5782,7 @@
{\def\m@mscapii{#5}\caption[#5]{#6}}%
\membitwonumcaptioninfo{\@captype}{\@nameuse{the\@captype}}%
{\m@mscapi}{#3}{#4}{\m@mscapii}{#6}%
- \endgroup
-}
+ \endgroup}
\newcommand{\bionenumcaption}[6][\@empty]{%
\begingroup
@@ -4354,8 +5807,7 @@
{\protect\numberline{}{\ignorespaces #5}}}%
\membionenumcaptioninfo{\@captype}{\@nameuse{the\@captype}}%
{\m@mscapi}{#3}{#4}{\m@mscapii}{#6}%
- \endgroup
-}
+ \endgroup}
\newcommand{\bicaption}[5][\@empty]{%
\begingroup
@@ -4373,8 +5825,7 @@
\contcaption{#5}%
\membicaptioninfo{\@captype}{\@nameuse{the\@captype}}%
{\m@mscapi}{#3}{#4}{#5}%
- \endgroup
-}
+ \endgroup}
\newcommand{\bicontcaption}[3]{%
\begingroup
@@ -4385,8 +5836,7 @@
\expandafter\renewcommand\csname \@captype name\endcsname{\@memtempc}%
\@contmidbi
\contcaption{#3}%
- \endgroup
-}
+ \endgroup}
\newcommand{\subcaptionstyle}[1]{\def\@contsubcstyle{#1}}
\subcaptionstyle{}
@@ -4692,6 +6142,282 @@
\newcommand*{\ssc@ref}[1]{\ref{sub@#1}}
\newcommand*{\sc@ref}[1]{{\@subcaplabelfont\ref{sub@#1}}}
+\newsavebox{\m@mscap@capbox}
+\newsavebox{\m@mscap@fbox}
+
+\newdimen\sidecapsep
+ \sidecapsep=\marginparsep
+\newdimen\sidecapwidth
+ \sidecapwidth=\marginparwidth
+\newcommand*{\setsidecaps}[2]{%
+ \setlength{\sidecapsep}{#1}\@memznegtest{\sidecapsep}%
+ \setlength{\sidecapwidth}{#2}\@memznegtest{\sidecapwidth}}
+
+\newdimen\m@m@tempdima
+\newdimen\m@mscapraise
+\newdimen\sidecapraise
+ \sidecapraise \z@
+
+\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}
+
+\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}
+
+\newif\ifscapmargleft
+
+\def\sidecapfloatwidth{\linewidth}
+\newdimen\m@mscapmainwidth
+
+\newdimen\m@mscaplkern
+\newcommand*{\setm@mscaplkern}{%
+ \m@mscaplkern=\sidecapwidth
+ \advance\m@mscaplkern \sidecapsep
+ \advance\m@mscaplkern \m@mscapmainwidth}
+
+\newcommand*{\sidecapstyle}{%
+%%% \captionnamefont{\bfseries}%
+ \ifscapmargleft
+ \captionstyle{\raggedleft}%
+ \else
+ \captionstyle{\raggedright}%
+ \fi}
+
+\newcommand*{\sidecaption}{%
+ \@ifnextchar [{\@sidecaption}{\@sidecaption[]}}
+\def\@sidecaption[#1]#2{%
+ \@ifnextchar [{\@@sidecaption{#1}{#2}}{\@@sidecaption{#1}{#2}[]}}
+\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
+ \m@mscapstart@fbox}
+
+\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}}
+
+\def\endsidecaption{%
+ \m@mscapend@fbox
+ \refstepcounter\@captype
+ \m@mscaplabel
+ \begin{lrbox}{\m@mscap@capbox}%
+ \begin{minipage}[c]{\sidecapwidth}%
+ \sidecapstyle
+ \@caption\@captype[\m@mscap@fortoc]{\m@mscap@forcap}
+ \end{minipage}%
+ \end{lrbox}%
+ \m@mscapopboxes}
+\newcommand*{\m@mscapopboxes}{%
+ \m@mcalcscapraise
+ \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
+ \gdef\m@mscapthisside{}}
+
+\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}
+
+\newcommand*{\m@mscapcheckside}{%
+ \if@twocolumn
+ \ifdim\hsize=\textwidth% float*
+ \m@mscapcheckregside
+ \else
+ \if@firstcolumn
+ \scapmarglefttrue
+ \else
+ \scapmargleftfalse
+ \fi
+ \fi
+ \else
+ \m@mscapcheckregside
+ \fi
+ \m@mscapthisside}
+\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}
+
+\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}{}
+
+\newcommand*{\sidecontcaption}{%
+ \@sidecontcaption}
+\def\@sidecontcaption#1{%
+ \@ifnextchar [{\@@sidecontcaption{#1}}{\@@sidecontcaption{#1}[]}}
+\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}
+
+\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}
+
+\newcommand*{\sidenamedlegend}{%
+ \@ifnextchar [{\@sidenamedlegend}{\@sidenamedlegend[]}}
+\def\@sidenamedlegend[#1]#2{%
+ \@@sidenamedlegend{#1}{#2}}
+\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}
+
+\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}
+
+\newcommand*{\sidelegend}{%
+ \@@sidelegend}
+\def\@@sidelegend#1{%
+ \def\m@mscap@forcap{#1}%
+ \m@mscapstart@fbox}
+
+\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}
+
\newlength{\beforeepigraphskip}
\setlength{\beforeepigraphskip}{.5\baselineskip}
\newlength{\afterepigraphskip}
@@ -4711,13 +6437,14 @@
\newcommand{\@epirule}{\rule[.5ex]{\epigraphwidth}{\epigraphrule}}
\newcommand{\@epitext}[1]{%
- \begin{minipage}{\epigraphwidth}\begin{\textflush} #1\\
+ \begin{minipage}{\epigraphwidth}\begin{\textflush} #1\par
\ifdim\epigraphrule>\z@ \@epirule \else \vspace*{1ex} \fi
\end{\textflush}\end{minipage}}
\newcommand{\@episource}[1]{%
\begin{minipage}{\epigraphwidth}
- \begin{\sourceflush} #1\end{\sourceflush}
- \end{minipage}}
+ \begin{\sourceflush} #1\par
+ \end{\sourceflush}\end{minipage}}
+
\newcommand{\epigraph}[2]{\vspace{\beforeepigraphskip}
{\epigraphsize\begin{\epigraphflush}\begin{minipage}{\epigraphwidth}
\@epitext{#1}\\ \@episource{#2}
@@ -4902,16 +6629,19 @@
\providecommand{\eminnershape}{\upshape}
\DeclareTextFontCommand{\emph}{\em}
-\newcommand{\fref}[1]{\figurerefname~\ref{#1}}
-\newcommand{\tref}[1]{\tablerefname~\ref{#1}}
-\newcommand{\pref}[1]{\pagerefname~\pageref{#1}}
-\newcommand{\Pref}[1]{\partrefname\ref{#1}}
-\newcommand{\Cref}[1]{\chapterrefname\ref{#1}}
-\newcommand{\Sref}[1]{\sectionrefname\ref{#1}}
+\newcommand*{\fref}[1]{\figurerefname~\ref{#1}}
+\newcommand*{\tref}[1]{\tablerefname~\ref{#1}}
+\newcommand*{\pref}[1]{\pagerefname~\pageref{#1}}
+\newcommand*{\Aref}[1]{\appendixrefname\ref{#1}}
+\newcommand*{\Bref}[1]{\bookrefname\ref{#1}}
+\newcommand*{\Pref}[1]{\partrefname\ref{#1}}
+\newcommand*{\Cref}[1]{\chapterrefname\ref{#1}}
+\newcommand*{\Sref}[1]{\sectionrefname\ref{#1}}
\newif\ifheadnameref
- \headnamereffalse
-
+\newcommand*{\headnameref}{\headnamereftrue}
+\newcommand*{\tocnameref}{\headnamereffalse}
+ \tocnameref
\newcommand{\theTitleReference}[2]{#2}
\let\@mem@old@label\label
@@ -4945,25 +6675,6 @@
\newcommand*{\namerefon}{\let\M@gettitle\@mem@@gettitle}
\newcommand*{\namerefoff}{\let\M@gettitle\@gobble}
\namerefon
-\let\M@old@caption\@caption
-\long\def\@caption#1[#2]#3{\M@gettitle{#2}\M@old@caption{#1}[{#2}]{#3}}
-
-\let\M@oldlegend\legend
-\long\def\legend#1{\M@gettitle{#1}\M@oldlegend{#1}}
-\let\M@old@legend\@legend
-\long\def\@legend#1[#2]#3{\M@gettitle{#2}\M@old@legend{#1}[{#2}]{#3}}
-
-\let\M@old@vsptitle\@vsptitle
-\long\def\@vsptitle[#1]#2{\M@gettitle{#1}\M@old@vsptitle[{#1}]{#2}}
-\let\M@old@vssptitle\@vssptitle
-\long\def\@vssptitle#1{\M@gettitle{#1}\M@old@vssptitle{#1}}
-
-%%%\let\M@old@spart\@spart
-%%%\def\@spart#1{\M@gettitle{#1}\M@old@spart{#1}}
-%%%\let\M@old@part\@part
-%%%\def\@part[#1]{\M@gettitle{#1}\M@old@part[{#1}]}
-
-
\newcommand{\@pnumwidth}{1.55em}
\newcommand{\@tocrmarg} {2.55em}
\newcommand{\@dotsep}{4.5}
@@ -5005,12 +6716,14 @@
\@nameuse{@#2maketitle}
\phantomsection
\addcontentsline{toc}{chapter}{#3}
+\parskip\cftparskip
\@starttoc{#2}%
\endgroup
\restorefromonecol}
\@namedef{@#2maketitle}{%
\@nameuse{#2headstart}
- {\parindent\z@ \parskip\cftparskip
+ {\parindent\z@
+%%%% \parskip\cftparskip
\interlinepenalty\@M
\@nameuse{print#2nonum}%
\@nameuse{print#2title}{#3}%
@@ -5038,16 +6751,18 @@
\endgroup}
\newlistof{tableofcontents}{toc}{\contentsname}
-\newcommand{\setpnumwidth}[1]{\renewcommand{\@pnumwidth}{#1}}
-\newcommand{\setrmarg}[1]{\renewcommand{\@tocrmarg}{#1}}
+\newcommand*{\setpnumwidth}[1]{\renewcommand{\@pnumwidth}{#1}}
+\newcommand*{\setrmarg}[1]{\renewcommand{\@tocrmarg}{#1}}
\providecommand{\cftdot}{.}
\providecommand{\cftdotfill}[1]{%
\leaders\hbox{$\m@th\mkern #1 mu\hbox{\cftdot}\mkern #1 mu$}\hfill}
\providecommand{\cftdotsep}{4.5}
\newcommand{\cftnodots}{2000}
-\newcommand{\cftparfillskip}{\parfillskip=0pt plus1fil}
-\renewcommand{\numberline}[1]{%
- \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
+\newcommand*{\cftparfillskip}{\parfillskip=0pt plus1fil}
+\newcommand*{\@cftn@me}{}
+
+\renewcommand*{\numberline}[1]{%
+ \hb@xt@\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
\newcommand{\@cftbsnum}{}
\newcommand{\@cftasnum}{}
\newcommand{\@cftasnumb}{}
@@ -5061,7 +6776,6 @@
\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}
@@ -5071,10 +6785,12 @@
\parindent \@nameuse{cft#2indent}\relax\@afterindenttrue
\interlinepenalty\@M
\leavevmode
- \@tempdima \@nameuse{cft#2numwidth}\relax
+ \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}}
@@ -5102,6 +6818,7 @@
\setlength{\@nameuse{cft#2numwidth}}{6.0em}
\fi
\@namedef{cft#2font}{\normalfont}
+ \@namedef{cft#2name}{}
\@namedef{cft#2presnum}{}
\@namedef{cft#2aftersnum}{}
\@namedef{cft#2aftersnumb}{}
@@ -5110,23 +6827,85 @@
\@namedef{cft#2pagefont}{\normalfont}
\@namedef{cft#2afterpnum}{}
\@namedef{toclevel@#2}{#4}
+ \@namedef{cft#2formatpnum}##1{%
+ \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#2pagefont}##1}}
\@namedef{cft#2fillnum}##1{%
{\@nameuse{cft#2leader}}\nobreak
- \hb@xt@\@pnumwidth{%
- \hfil\@nameuse{cft#2pagefont}##1}\@nameuse{cft#2afterpnum}\par}
+%%% \hb@xt@\@pnumwidth{%
+%%% \hfil\@nameuse{cft#2pagefont}##1}
+ \@nameuse{cft#2formatpnum}{##1}%
+ \@nameuse{cft#2afterpnum}\par}
} % end \newlistentry
-\newcommand{\cftsetindents}[3]{%
+\newcommand*{\cftsetindents}[3]{%
\setlength{\@nameuse{cft#1indent}}{#2}
- \setlength{\@nameuse{cft#1numwidth}}{#3}
-}
+ \setlength{\@nameuse{cft#1numwidth}}{#3}}
+
+\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}
+
+\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}}}
\newcommand*{\cftpartname}{}
+\newcommand*{\cftpartbreak}{\addpenalty{-\@highpenalty}%
+ \addvspace{\cftbeforepartskip}}
\newcommand*{\l@part}[2]{%
\ifnum \c@tocdepth >-2\relax
- \addpenalty{-\@highpenalty}%
- \addvspace{\cftbeforepartskip}%
+%%% \addpenalty{-\@highpenalty}%
+%%% \addvspace{\cftbeforepartskip}%
+ \cftpartbreak
\begingroup
{\leftskip \cftpartindent\relax
\rightskip \@tocrmarg
@@ -5148,9 +6927,11 @@
\endgroup
\fi}
+\newcommand*{\toclevel@part}{-1}
+
\newcommand{\partnumberline}[1]{%
\hb@xt@\@tempdima{%
- \cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
+ \cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb\space}
\newlength{\cftbeforepartskip}
\setlength{\cftbeforepartskip}{2.25em \@plus\p@}
@@ -5167,9 +6948,11 @@
\newcommand{\cftpartdotsep}{\cftnodots}
\newcommand{\cftpartpagefont}{\large\bfseries}
\newcommand{\cftpartafterpnum}{}
+ \newcommand*{\cftpartformatpnum}[1]{%
+ \hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}
\newcommand{\cftpartfillnum}[1]{%
{\cftpartleader}%
- {\hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}%
+ {\cftpartformatpnum{#1}}%
\cftpartafterpnum\par}
\newcommand*{\cftchaptername}{}
@@ -5199,6 +6982,8 @@
\newcommand*{\l@chapter}[2]{%
\l@chapapp{#1}{#2}{\cftchaptername}}
+\newcommand*{\toclevel@chapter}{0}
+
\newcommand*{\cftappendixname}{}
\newcommand*{\l@appendix}[2]{%
@@ -5224,9 +7009,11 @@
\newcommand{\cftchapterdotsep}{\cftnodots}
\newcommand{\cftchapterpagefont}{\bfseries}
\newcommand{\cftchapterafterpnum}{}
- \newcommand{\cftchapterfillnum}[1]{
+ \newcommand*{\cftchapterformatpnum}[1]{%
+ \hb@xt@\@pnumwidth{\hfil\cftchapterpagefont #1}}
+ \newcommand*{\cftchapterfillnum}[1]{
{\cftchapterleader}\nobreak
- \hb@xt@\@pnumwidth{\hfil\cftchapterpagefont #1}%
+ \cftchapterformatpnum{#1}%
\cftchapterafterpnum\par}
\newcommand{\cftchapterbreak}{\addpenalty{-\@highpenalty}}
@@ -5241,12 +7028,12 @@
\newlistentry[paragraph]{subparagraph}{toc}{4}
\cftsetindents{subparagraph}{12.0em}{6.0em}
-\newcommand{\@cftl@subfigtab}{
+\newcommand*{\@cftl@subfigtab}{
\newlistentry[figure]{subfigure}{lof}{1}
\cftsetindents{subfigure}{2.3em}{2.5em}
\newlistentry[table]{subtable}{lot}{1}
- \cftsetindents{subtable}{2.3em}{2.5em}
-}
+ \cftsetindents{subtable}{2.3em}{2.5em}}
+\renewcommand*{\@cftl@subfigtab}{}
\AtBeginDocument{\@ifpackageloaded{subfigure}{\@cftl@subfigtab}{}}
@@ -5256,19 +7043,26 @@
\DeclareRobustCommand{\cftpagenumberson}[1]{%
\@namedef{cft#1fillnum}##1{%
- {\@nameuse{cft#1leader}}\nobreak
- \hb@xt@\@pnumwidth{%
- \hfil\@nameuse{cft#1pagefont}##1}\@nameuse{cft#1afterpnum}\par}}
+ \@nameuse{cft#1leader}\nobreak
+ \@nameuse{cft#1formatpnum}{##1}%
+ \@nameuse{cft#1afterpnum}\par}}
\newcommand{\chapterprecis}[1]{%
\chapterprecishere{#1}
\chapterprecistoc{#1}}
\newcommand{\chapterprecishere}[1]{%
\prechapterprecis #1\postchapterprecis}
+\newdimen\prechapterprecisshift
+\ifartopt
+ \prechapterprecisshift=0pt
+\else
+ \prechapterprecisshift=-2\baselineskip
+\fi
+\newcommand*{\precisfont}{\normalfont\itshape}
\newcommand{\prechapterprecis}{%
- \vspace*{-2\baselineskip}%
- \begin{quote}\normalfont\itshape}
-\newcommand{\postchapterprecis}{\end{quote}}
+ \vspace*{\prechapterprecisshift}%
+ \begin{quote}\precisfont}
+\newcommand*{\postchapterprecis}{\end{quote}}
\newcommand{\precistocfont}{\normalfont\itshape}
\newcommand{\chapterprecistoc}[1]{%
@@ -5286,127 +7080,159 @@
\addtocontents{#1}%
{\protect\contentsline{#2}{\protect\numberline{#3}%
{\protect\ignorespaces #4}}{#5}}}
-\newcommand{\@setclcnt}[2]{
+\newcommand*{\cftinsert}[1]{\@nameuse{cftinsert#1}}
+\newcommand{\cftinsertcode}[2]{\@namedef{cftinsert#1}{#2}}
+\newcommand*{\cftinserthook}[2]{%
+ \addtocontents{#1}{\protect\cftinsert\protect{#2\protect}}}
+
+\newcommand*{\@setclcnt}[2]{%
\@tempswafalse
- \nametest{#1}{none}
+ \nametest{#1}{none}%
+ \ifsamename
+ \setcounter{#2}{-10}%
+ \@tempswatrue
+ \fi
+ \nametest{#1}{book}%
\ifsamename
- \setcounter{#2}{-10}
+ \setcounter{#2}{-2}%
\@tempswatrue
\fi
- \nametest{#1}{part}
+ \nametest{#1}{part}%
\ifsamename
- \setcounter{#2}{-1}
+ \setcounter{#2}{-1}%
\@tempswatrue
\fi
- \nametest{#1}{chapter}
+ \nametest{#1}{chapter}%
\ifsamename
- \setcounter{#2}{0}
+ \setcounter{#2}{0}%
\@tempswatrue
\fi
- \nametest{#1}{section}
+ \nametest{#1}{section}%
\ifsamename
- \setcounter{#2}{1}
+ \setcounter{#2}{1}%
\@tempswatrue
\fi
- \nametest{#1}{subsection}
+ \nametest{#1}{subsection}%
\ifsamename
- \setcounter{#2}{2}
+ \setcounter{#2}{2}%
\@tempswatrue
\fi
- \nametest{#1}{subsubsection}
+ \nametest{#1}{subsubsection}%
\ifsamename
- \setcounter{#2}{3}
+ \setcounter{#2}{3}%
\@tempswatrue
\fi
- \nametest{#1}{paragraph}
+ \nametest{#1}{paragraph}%
\ifsamename
- \setcounter{#2}{4}
+ \setcounter{#2}{4}%
\@tempswatrue
\fi
- \nametest{#1}{subparagraph}
+ \nametest{#1}{subparagraph}%
\ifsamename
- \setcounter{#2}{5}
+ \setcounter{#2}{5}%
\@tempswatrue
\fi
- \nametest{#1}{all}
+ \nametest{#1}{all}%
\ifsamename
- \setcounter{#2}{50}
+ \setcounter{#2}{50}%
\@tempswatrue
\fi
- \if@tempswa\else
+ \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
-}
-\newcommand{\settocdepth}[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}
+
+\newcommand*{\settocdepth}[1]{%
\@tempswafalse
- \nametest{#1}{none}
+ \nametest{#1}{none}%
+ \ifsamename
+ \addtocontents{toc}{\changetocdepth{-10}}%
+ \@tempswatrue
+ \fi
+ \nametest{#1}{book}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{-10}}
+ \addtocontents{toc}{\changetocdepth{-2}}%
\@tempswatrue
\fi
- \nametest{#1}{part}
+ \nametest{#1}{part}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{-1}}
+ \addtocontents{toc}{\changetocdepth{-1}}%
\@tempswatrue
\fi
- \nametest{#1}{chapter}
+ \nametest{#1}{chapter}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{0}}
+ \addtocontents{toc}{\changetocdepth{0}}%
\@tempswatrue
\fi
- \nametest{#1}{section}
+ \nametest{#1}{section}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{1}}
+ \addtocontents{toc}{\changetocdepth{1}}%
\@tempswatrue
\fi
- \nametest{#1}{subsection}
+ \nametest{#1}{subsection}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{2}}
+ \addtocontents{toc}{\changetocdepth{2}}%
\@tempswatrue
\fi
- \nametest{#1}{subsubsection}
+ \nametest{#1}{subsubsection}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{3}}
+ \addtocontents{toc}{\changetocdepth{3}}%
\@tempswatrue
\fi
- \nametest{#1}{paragraph}
+ \nametest{#1}{paragraph}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{4}}
+ \addtocontents{toc}{\changetocdepth{4}}%
\@tempswatrue
\fi
- \nametest{#1}{subparagraph}
+ \nametest{#1}{subparagraph}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{5}}
+ \addtocontents{toc}{\changetocdepth{5}}%
\@tempswatrue
\fi
- \nametest{#1}{all}
+ \nametest{#1}{all}%
\ifsamename
- \addtocontents{toc}{\changetocdepth{50}}
+ \addtocontents{toc}{\changetocdepth{50}}%
\@tempswatrue
\fi
- \if@tempswa\else
+ \if@tempswa
+ \@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
-}
+ I'll ignore it.
+ Type \space <return> and I'll continue.}%
+ \fi}
+
+\newcommand*{\toclevel@none}{-10}
+\newcommand*{\toclevel@all}{50}
+
\DeclareRobustCommand{\changetocdepth}[1]{\setcounter{tocdepth}{#1}}
\newcommand{\maxtocdepth}[1]{%
\@setclcnt{#1}{tocdepth}}
-\newcommand{\setsecnumdepth}[1]{%\leavevmode%
- \@setclcnt{#1}{secnumdepth}}
\newcounter{maxsecnumdepth}
\newcommand{\maxsecnumdepth}[1]{%
\@setclcnt{#1}{secnumdepth}\@setclcnt{#1}{maxsecnumdepth}}
+\newcommand{\setsecnumdepth}[1]{%
+ \ifx\@nodocument\relax% after the preamble
+ \@setclcnt{#1}{secnumdepth}%
+ \else
+ \@setclcnt{#1}{secnumdepth}%
+ \@setclcnt{#1}{maxsecnumdepth}%
+ \fi}
+\setsecnumdepth{section}
+
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newlength{\bibitemsep}
@@ -5475,7 +7301,11 @@
\newif\ifonecolindex
\onecolindexfalse
+\newcommand*{\onecolindex}{\onecolindextrue}
+\newcommand*{\twocolindex}{\onecolindexfalse}
+
\newenvironment{theindex}{%
+ \clearforchapter
\if@twocolumn
\@restonecolfalse
\else
@@ -5496,11 +7326,13 @@
\phantomsection
\addcontentsline{toc}{chapter}{\indexname}%
\fi
- \thispagestyle{chapter}\parindent\z@
+ \thispagestyle{indextitlepagestyle}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem}%
{\if@restonecol\onecolumn\else\twocolumn\fi}
+\aliaspagestyle{indextitlepagestyle}{chapter}
+
\newif\ifnoindexintoc
\newcommand*{\indexintoc}{\noindexintocfalse}
\newcommand*{\noindexintoc}{\noindexintoctrue}
@@ -5535,9 +7367,13 @@
\newcommand{\printindex}[1][\jobname]{\@input@{#1.ind}}
\newif\ifreportnoidxfile
- \reportnoidxfilefalse
+\newcommand*{\reportnoidxfile}{\reportnoidxfiletrue}
+\newcommand*{\ignorenoidxfile}{\reportnoidxfilefalse}
+ \ignorenoidxfile
\newif\ifshowindexmark
- \showindexmarkfalse
+\newcommand*{\showindexmarks}{\showindexmarktrue}
+\newcommand*{\hideindexmarks}{\showindexmarkfalse}
+ \hideindexmarks
\def\@index[#1]{%
\@ifundefined{#1@idxfile}%
@@ -5630,6 +7466,32 @@
\newif\ifmemhyperindex
\memhyperindextrue
+\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}
+
\AtBeginDocument{%
\@ifpackageloaded{hyperref}{}{\memhyperindexfalse}%
\ifmemhyperindex\else
@@ -5682,8 +7544,7 @@
#1\relax
\vrule \@height \z@ \@depth .3\normalbaselineskip \@width \z@\relax
}%
- \ifhmode\penalty\@M \hskip\z@skip\fi
-}
+ \ifhmode\penalty\@M \hskip\z@skip\fi}
\newcommand{\@leftidx}{\hskip-\marginparsep \hskip-\marginparwidth}
\newcommand{\@rightidx}{\hskip\columnwidth \hskip\marginparsep}
@@ -5701,8 +7562,7 @@
\fi
\box\@indexbox
}%
- \vss
-}}
+ \vss}}
\renewcommand{\raggedbottom}{%
\def\@textbottom{\vskip\z@ plus.0001fil}%
@@ -5712,8 +7572,15 @@
\let\@texttop\@mkidx}
\let\@texttop\@mkidx
+\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}}
+
\newif\ifonecolglossary
\onecolglossarytrue
+\newcommand*{\onecolglossary}{\onecolglossarytrue}
+\newcommand*{\twocolglossary}{\onecolglossaryfalse}
\newenvironment{theglossary}{%
\if@twocolumn
@@ -5875,17 +7742,17 @@
\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent}
-\newlength{\sideparvshift}
- \setlength{\sideparvshift}{-2.08ex}% seems to work for all font sizes
-
\newif\ifreversesidepar
\reversesidepartrue
\newif\ifsideparswitch
\sideparswitchfalse
\if@twoside \sideparswitchtrue \fi
+\newlength{\sideparvshift}
+%%%% \setlength{\sideparvshift}{-2.08ex}% seems to work for all font sizes
+
\newcommand{\sidepar}{\@dblarg{\@sidepar}}
-\long\def\@sidepar[#1]#2{\@bsphack\leavevmode\vadjust{% %
+\long\def\@sidepar[#1]#2{\@bsphack\strut\vadjust{%
\checkoddpage
\ifsideparswitch
\ifreversesidepar
@@ -5899,41 +7766,79 @@
\oddpagetrue
\ifreversesidepar
\oddpagefalse
- \fi
+ \fi
\fi
\rlap{\kern-\parindent
\if@twocolumn
- \if@firstcolumn % put at left
- \kern -\marginparsep \kern -\marginparwidth % at left
- \else % put at right
- \kern \columnwidth \kern \marginparsep % at right
+ \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 % at right
- \else % put at left
- \kern -\marginparsep \kern -\marginparwidth % at left
+ \ifoddpage% put at right
+ \kern \textwidth \kern \marginparsep
+ \else% put at left
+ \kern -\marginparsep \kern -\marginparwidth
\fi
\fi
- \vbox to 0pt{%
- \kern \sideparvshift% % vertical shift to align top text lines
- \begin{minipage}{\marginparwidth}%
- \ifoddpage #2\else #1\fi%
+ \setbox0=\vtop to 0pt{%
+ \begin{minipage}[t]{\marginparwidth}%
+ \normalfont\normalsize
+ \ifoddpage #2\else #1\fi%
\end{minipage}%
- \vss}}}\@esphack}
+ \vss}%
+ \vtop to 0pt{\kern\sideparvshift% default should be 0pt
+ \kern-\dp\strutbox
+ \kern-\ht0
+ \box0 \vss}}}%
+ \@esphack}
+\setlength{\sideparvshift}{0pt}
\newinsert\sideins
\skip\sideins=0pt
\count\sideins=0
-\newcommand{\setsidebarheight}[1]{\dimen\sideins= #1}
- \setsidebarheight{20\onelineskip}
-
-\newlength{\sidebarhsep} \setlength{\sidebarhsep}{\marginparsep}
-\newlength{\sidebarvsep} \setlength{\sidebarvsep}{2\onelineskip}
-\newlength{\sidebarwidth} \setlength{\sidebarwidth}{\marginparwidth}
+\newlength{\sidebartopsep}
+ \setlength{\sidebartopsep}{0pt}
+\newcommand{\setsidebarheight}[1]{%
+ \setlength{\dimen\sideins}{#1}%
+ \advance\dimen\sideins-\topskip
+ \advance\dimen\sideins\ht\strutbox}
+
+\newlength{\sidebarhsep}
+\newlength{\sidebarvsep}
+\newlength{\sidebarwidth}
+\newcommand{\sidebarfont}{}
+\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
-\newcommand{\sidebarfont}{\normalfont}
\newcommand{\sidebarform}{\rightskip=\z@ \@plus 2em}
\newif\ifsidebaroneside
@@ -5964,168 +7869,74 @@
\fi}
%%%% default outer
\gdef\m@msidebar@margin{2}
-\newcommand{\sidecontents}{{%
+\newcommand*{\m@sideb@left}{%
+ \@tempdimc \sidebarwidth
+ \advance\@tempdimc\sidebarhsep
+ \kern-\@tempdimc}
+\newcommand*{\m@sideb@right}{%
+ \@tempdimc \columnwidth% or \hsize
+ \advance\@tempdimc\sidebarhsep
+ \kern\@tempdimc}
+
+\newcommand{\sidecontents}{\hbox to \z@{%
\if@twocolumn% %% put outside nearest column
\if@firstcolumn% %% move to left
- \setlength{\@tempdimc}{\sidebarwidth}%
- \advance\@tempdimc\sidebarhsep
- \moveleft\@tempdimc
+ \m@sideb@left
\else% %% move to right
- \setlength{\@tempdimc}{\columnwidth}%
- \advance\@tempdimc\sidebarhsep
- \moveright\@tempdimc
+ \m@sideb@right
\fi
\else% %% put into foremargin?
\ifsidebaroneside% %% put into right hand margin
- \setlength{\@tempdimc}{\hsize}%
- \advance\@tempdimc\sidebarhsep
- \moveright\@tempdimc
- \else% %% ???
+ \m@sideb@right
+ \else% %% pick the margin
\ifcase\m@msidebar@margin% 0 to left
- \setlength{\@tempdimc}{\sidebarwidth}%
- \advance\@tempdimc\sidebarhsep
- \moveleft\@tempdimc
+ \m@sideb@left
\or% 1 to right
- \setlength{\@tempdimc}{\hsize}%
- \advance\@tempdimc\sidebarhsep
- \moveright\@tempdimc
+ \m@sideb@right
\or% 2 to outer
\ifodd\c@page% %% move to right
- \setlength{\@tempdimc}{\hsize}%
- \advance\@tempdimc\sidebarhsep
- \moveright\@tempdimc
+ \m@sideb@right
\else% %% move to left
- \setlength{\@tempdimc}{\sidebarwidth}%
- \advance\@tempdimc\sidebarhsep
- \moveleft\@tempdimc
+ \m@sideb@left
\fi
\or% 3 to inner
\ifodd\c@page% %% move to left
- \setlength{\@tempdimc}{\sidebarwidth}%
- \advance\@tempdimc\sidebarhsep
- \moveleft\@tempdimc
+ \m@sideb@left
\else% %% move to right
- \setlength{\@tempdimc}{\hsize}%
- \advance\@tempdimc\sidebarhsep
- \moveright\@tempdimc
+ \m@sideb@right
\fi
\fi
\fi
\fi
\vtop to0pt{%
- \vskip\onelineskip
+ \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}}
\newcommand{\sidebar}[1]{%
\insert\sideins{%
- \splittopskip\sidebarvsep\relax
- \hsize \sidebarwidth
- \@parboxrestore % <- added in v1.4
- \sidebarform \sidebarfont
- \noindent\vbox to \sidebarvsep{}\ignorespaces #1%
- \ifhmode\unskip\strut\fi\par}}
-
-\let\memold@makecol\@makecol
-\gdef\mem@makecol{%
- \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
- \ifvoid\sideins\else %%% start of change
- \setbox\@outputbox \vbox{%
- \sidecontents
- \unvbox\@outputbox
- }
- \fi %%% end of change
- \xdef\@freelist{\@freelist\@midlist}%
- \global\let\@midlist\@empty
- \@combinefloats
- \ifvbox\@kludgeins
- \@makespecialcolbox
- \else
- \setbox\@outputbox \vbox to\@colht{%
- \boxmaxdepth \maxdepth
- \@texttop
- \dimen@ \dp\@outputbox
- \unvbox \@outputbox
- \vskip -\dimen@
- \@textbottom
- }%
- \fi
- \global \maxdepth \@maxdepth
-}
-
-\newif\if@mem@nofoot
-\newcommand*{\@mem@testifnofoot}{%
- \@mem@nofoottrue
- \ifvoid\footins\else\@mem@nofootfalse\fi
- \ifvoid\footinsv@r\else\@mem@nofootfalse\fi
- \ifvoid\sideins\else\@mem@nofootfalse\fi
- \@mem@extranofeet}
-\newcommand*{\@mem@extranofeet}{}
-
-\let\memold@doclearpage\@doclearpage
-\newcommand{\mem@doclearpage}{%
-%%%% \typeout{Redefining @doclearpage}
- \@mem@testifnofoot
- \if@mem@nofoot
- \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
- \setbox\@tempboxa\box\@cclv
- \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
- \global\let\@toplist\@empty
- \global\let\@botlist\@empty
- \global\@colroom\@colht
- \ifx \@currlist\@empty
- \else
- \@latexerr{Float(s) lost}\@ehb
- \global\let\@currlist\@empty
- \fi
- \@makefcolumn\@deferlist
- \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
- \if@twocolumn
- \if@firstcolumn
- \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
- \global\let\@dbltoplist\@empty
- \global\@colht\textheight
- \begingroup
- \@dblfloatplacement
- \@makefcolumn\@dbldeferlist
- \@whilesw\if@fcolmade \fi{\@outputpage
- \@makefcolumn\@dbldeferlist}%
- \endgroup
- \else
- \vbox{}\clearpage
- \fi
+ \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
- \else
- \setbox\@cclv\vbox{\box\@cclv\vfil}%
- \@makecol\@opcol
- \clearpage
- \fi
-}
-
-\let\memold@reinserts\@reinserts
-\gdef\mem@reinserts{%
- \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
- \ifvbox\@kludgeins\insert\@kludegins{\unvbox\@kludgeins}\fi
- \ifvoid\sideins\else\sidecontents\fi
-}
-
-\gdef\@makecol{\mem@makecol}
-\gdef\@doclearpage{\mem@doclearpage}
+ \vskip\sidebarvsep}}
\renewcommand{\footnoterule}{%
\kern-3\p@
@@ -6146,9 +7957,20 @@
\spacefactor\@x@sf\relax
\fi}
+\renewcommand{\@footnotetext}[1]{\insert\footins{%
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font% <- v1.6180 addition
+ \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}
\let\m@mold@footnotetext\@footnotetext
-\renewcommand{\@footnotetext}[1]{%
- \rest@font\m@mold@footnotetext{#1}\m@mmf@prepare}
\renewcommand*{\@footnotemark}{%
\leavevmode
\ifhmode
@@ -6232,6 +8054,7 @@
\def\@foot{%
\strut\egroup
%%%% \color@endgroup
+ \m@mmf@prepare
}
\long\def\@verbmpfootnotetext{%
@@ -6248,84 +8071,13 @@
\futurelet\next\fo@t
}
-\def\@minipagerestore{\let\@verbfootnotetext\@verbmpfootnotetext}
-
%%%%%%%%%%%%%% major extension to footnoting
-\newcommand{\m@m@makecolfloats}{%
- \xdef\@freelist{\@freelist\@midlist}%
- \global\let\@midlist\@empty
- \@combinefloats}
-\newcommand{\m@m@makecoltext}{%
- \ifvbox\@kludgeins
- \@makespecialcolbox
- \else
- \setbox\@outputbox \vbox to\@colht{%
- \@texttop
- \dimen@ \dp\@outputbox
- \unvbox \@outputbox
- \vskip -\dimen@
- \@textbottom}%
- \fi}
-
-\newcommand{\m@m@makecolintro}{}
-
-\gdef\mem@makecol{%
- \m@m@makecolintro
- \ifvoid\footins
- \setbox\@outputbox \box\@cclv
- \else
- \setbox\@outputbox \vbox{%
- \boxmaxdepth\@maxdepth
- \@tempdima\dp\@cclv
- \unvbox\@cclv
- \vskip \skip\footins
- \color@begingroup
- \normalcolor
- \footnoterule
- \unvbox \footins
- \color@endgroup
- }%
- \fi
- \m@mdoextrafeet
- \ifvoid\sideins\else
- \setbox\@outputbox \vbox{%
- \sidecontents
- \unvbox\@outputbox}%
- \fi
- \m@m@makecolfloats
- \m@m@makecoltext
- \global \maxdepth \@maxdepth}
-
-\gdef\mem@makecolbf{%
- \m@m@makecolintro
- \setbox\@outputbox \box\@cclv
- \m@m@makecolfloats
- \ifvoid\footins
- \else
- \setbox\@outputbox \vbox{%
- \boxmaxdepth\@maxdepth
- \unvbox\@outputbox
- \vskip \skip\footins
- \color@begingroup
- \normalcolor
- \footnoterule
- \unvbox \footins
- \color@endgroup
- }%
- \fi
- \m@mdoextrafeet
- \ifvoid\sideins\else
- \setbox\@outputbox \vbox{%
- \sidecontents
- \unvbox\@outputbox}%
- \fi
- \m@m@makecoltext
- \global \maxdepth \@maxdepth}
-
-\newcommand{\feetabovefloat}{\gdef\@makecol{\mem@makecol}}
-\newcommand{\feetbelowfloat}{\gdef\@makecol{\mem@makecolbf}}
-\feetabovefloat
+\newcommand*{\setfootnoterule}[4][]{%
+ \def\footnoterule{\kern -#2\relax #1\relax
+ \hrule width #3\relax
+ \kern #2\kern-#4}}
+\setfootnoterule{3pt}{0.4\columnwidth}{\normalrulethickness}
\newcommand{\m@mdoextrafeet}{\extrafeetins}
\newcommand*{\extrafeetins}{%
@@ -6336,11 +8088,6 @@
\extrafeetinshook}}
\newcommand{\extrafeetinshook}{}
-\gdef \@reinserts{%
- \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
- \m@mdodoreinextrafeet
- \ifvoid\sideins\else\sidecontents\fi
- \ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi}
\newcommand{\m@mdodoreinextrafeet}{%
\ifvoid\footinsv@r\else\insert\footinsv@r{\unvbox\footinsv@r}\fi
\extrafeetreinshook}
@@ -6356,35 +8103,26 @@
\splitmaxdepth=\dp\strutbox
\@parboxrestore}
-\renewcommand{\@footnotetext}[1]{\insert\footins{%
- \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}% <- v1.61803 addition
\foottextfont \hsize\columnwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@mpfootnote\endcsname\@thefnmark}%
\color@begingroup
+ \reset@font% <- v1.6180 addition
\@makefntext{%
- \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+ \rule\z@\footnotesep\ignorespaces{\foottextfont #1}%
+ \@finalstrut\strutbox}%
\color@endgroup}}
-\let\m@mold@footnotetext\@footnotetext
\let\m@mold@mpfootnotetext\@mpfootnotetext
\newcommand{\m@mdoextrafeetmini}{%
\extrafeetminihook}
\newcommand{\extrafeetminihook}{}
-\renewcommand{\@minipagerestore}{\m@mdoextrafeetmini}
+%%%%\renewcommand{\@minipagerestore}{\m@mdoextrafeetmini}
\newcommand{\extrafeetendmini}{%
\ifvoid\@mpfootinsv@r\else
@@ -6488,14 +8226,16 @@
\newcommand{\m@make@footnotetext}[1]{%
\@namelongdef{@footnotetext#1}##1{%
\insert\@nameuse{footins#1}{%
- \@nameuse{foottextfont#1}%
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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##1\@finalstrut\strutbox}%
+ \rule\z@\footnotesep\ignorespaces{\@nameuse{foottextfont#1} ##1}%
+ \@finalstrut\strutbox}%
\color@endgroup}%
\m@mmf@prepare}}
@@ -6503,12 +8243,15 @@
\@namelongdef{@mpfootnotetext#1}##1{%
\global\setbox\@nameuse{@mpfootins#1}\vbox{%
\unvbox\@nameuse{@mpfootins#1}%
- \@nameuse{foottextfont#1} \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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##1\@finalstrut\strutbox}%
+ \rule\z@\footnotesep\ignorespaces{\@nameuse{foottextfont#1} ##1}%
+ \@finalstrut\strutbox}%
\color@endgroup}%
\m@mmf@prepare}}
@@ -6659,7 +8402,8 @@
\let\mp@footgroupv@r\@mptwocol@footgroupv@r}
\newcommand{\@twocolfootnotetext}[1]{\insert\footinsv@r{%
- \foottextfont
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\foottextfont
\@preamfntext
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark}%
@@ -6682,7 +8426,9 @@
\newcommand{\@mptwocolfootnotetext}[1]{%
\global\setbox\@mpfootinsv@r\vbox{%
\unvbox\@mpfootinsv@r
- \foottextfont \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\foottextfont
+ \hsize\columnwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@mpfootnote\endcsname\@thefnmark}%
\color@begingroup
@@ -6708,8 +8454,9 @@
\newcommand{\m@make@twocolfootnotetext}[1]{%
\@namelongdef{@twocolfootnotetext#1}##1{%
- \insert\@nameuse{footins#1}{
- \@nameuse{foottextfont#1}%
+ \insert\@nameuse{footins#1}{%
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\@nameuse{foottextfont#1}%
\@preamfntext
\protected@edef\@currentlabel{%
\csname p@footnote#1\endcsname \@nameuse{@thefnmark#1}}%
@@ -6722,13 +8469,14 @@
\@namelongdef{@mptwocolfootnotetext#1}##1{%
\global\setbox\@nameuse{@mpfootins#1}\vbox{%
\unvbox\@nameuse{@mpfootins#1}
- \@nameuse{foottextfont#1} \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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}}
+ \color@endgroup}\m@mmf@prepare}}
\newcommand{\m@make@twocolfootfmt}[1]{%
\@namedef{@twocolfootfmt#1}##1{%
@@ -6758,14 +8506,14 @@
\let\mp@footgroupv@r\@mpthreecol@footgroupv@r}
\newcommand{\@threecolfootnotetext}[1]{\insert\footinsv@r{%
- \foottextfont
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\foottextfont
\@preamfntext
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark}%
\color@begingroup
\@threecolfootfmt{#1}%
- \color@endgroup}%
- \m@mmf@prepare}
+ \color@endgroup}\m@mmf@prepare}
\newcommand{\@preamthreefmt}{%
\hsize .3\hsize
@@ -6781,13 +8529,14 @@
\newcommand{\@mpthreecolfootnotetext}[1]{%
\global\setbox\@mpfootinsv@r\vbox{%
\unvbox\@mpfootinsv@r
- \foottextfont \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\foottextfont
+ \hsize\columnwidth \@parboxrestore
\protected@edef\@currentlabel{%
\csname p@mpfootnote\endcsname\@thefnmark}%
\color@begingroup
\@threecolfootfmt{#1}%
- \color@endgroup}%
- \m@mmf@prepare}
+ \color@endgroup}\m@mmf@prepare}
\newcommand{\threecolumnfootstyle}[1]{%
\m@make@threecolfootnotetext{#1}%
@@ -6807,27 +8556,28 @@
\newcommand{\m@make@threecolfootnotetext}[1]{%
\@namelongdef{@threecolfootnotetext#1}##1{%
- \insert\@nameuse{footins#1}{
- \@nameuse{foottextfont#1}%
+ \insert\@nameuse{footins#1}{%
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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}}
+ \color@endgroup}\m@mmf@prepare}}
\newcommand{\m@make@mpthreecolfootnotetext}[1]{%
\@namelongdef{@mpthreecolfootnotetext#1}##1{%
\global\setbox\@nameuse{@mpfootins#1}\vbox{%
\unvbox\@nameuse{@mpfootins#1}
- \@nameuse{foottextfont#1} \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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}}
+ \color@endgroup}\m@mmf@prepare}}
\newcommand{\m@make@threecolfootfmt}[1]{%
\@namelongdef{@threecolfootfmt#1}##1{%
@@ -6896,7 +8646,8 @@
\xdef\footfudgefactor{\expandafter\strip@pt\dimen0 }}}
\newcommand{\@parafootnotetext}[1]{\insert\footinsv@r{
- \foottextfont
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\foottextfont
\@preamfntext
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark}%
@@ -6904,8 +8655,7 @@
\color@begingroup
\noindent \@parafootfmt{#1}%
\color@endgroup}%
- \m@mungebox}%
- \m@mmf@prepare}
+ \m@mungebox}\m@mmf@prepare}
\newcommand{\@parafootfmt}[1]{%
\parindent=\z@
@@ -6915,15 +8665,16 @@
\newcommand{\@mpparafootnotetext}[1]{%
\global\setbox\@mpfootinsv@r\vbox{%
\unvbox\@mpfootinsv@r
- \foottextfont \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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}
+ \m@mungebox}\m@mmf@prepare}
\newcommand{\paragraphfootstyle}[1]{%
\m@make@parafootnotetext{#1}%
@@ -6950,7 +8701,8 @@
\newcommand{\m@make@parafootnotetext}[1]{%
\@namelongdef{@parafootnotetext#1}##1{%
\insert\@nameuse{footins#1}{
- \@nameuse{foottextfont#1}%
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \reset@font\@nameuse{foottextfont#1}%
\@preamfntext
\protected@edef\@currentlabel{%
\csname p@footnote#1\endcsname \@nameuse{@thefnmark#1}}%
@@ -6958,22 +8710,22 @@
\color@begingroup
\noindent \@nameuse{@parafootfmt#1}{##1}%
\color@endgroup}%
- \m@mungebox}%
- \m@mmf@prepare}}
+ \m@mungebox}\m@mmf@prepare}}
\newcommand{\m@make@mpparafootnotetext}[1]{%
\@namelongdef{@mpparafootnotetext#1}##1{%
\global\setbox\@nameuse{@mpfootins#1}\vbox{%
\unvbox\@nameuse{@mpfootins#1}
- \@nameuse{foottextfont#1} \hsize\columnwidth \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}% <- v1.61803 addition
+ \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}}
+ \m@mungebox}\m@mmf@prepare}}
\newcommand{\m@make@parafootfmt}[1]{%
\@namelongdef{@parafootfmt#1}##1{%
@@ -7007,7 +8759,276 @@
\vskip\skip\@nameuse{footins#1}%
\footnoterule}}
+\newif\if@mem@nofoot
+\newcommand*{\@mem@testifnofoot}{%
+ \@mem@nofoottrue
+ \ifvoid\footins\else\@mem@nofootfalse\fi
+ \ifvoid\footinsv@r\else\@mem@nofootfalse\fi
+ \ifvoid\sideins\else\@mem@nofootfalse\fi
+ \@mem@extranofeet}
+\newcommand*{\@mem@extranofeet}{}
+
+\let\memold@doclearpage\@doclearpage
+\newcommand{\mem@doclearpage}{%
+ \@mem@testifnofoot
+ \if@mem@nofoot
+ \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa
+ \setbox\@tempboxa\box\@cclv
+ \xdef\@deferlist{\@toplist\@botlist\@deferlist}%
+ \global\let\@toplist\@empty
+ \global\let\@botlist\@empty
+ \global\@colroom\@colht
+ \ifx \@currlist\@empty
+ \else
+ \@latexerr{Float(s) lost}\@ehb
+ \global\let\@currlist\@empty
+ \fi
+ \@makefcolumn\@deferlist
+ \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}%
+ \if@twocolumn
+ \if@firstcolumn
+ \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}%
+ \global\let\@dbltoplist\@empty
+ \global\@colht\textheight
+ \begingroup
+ \@dblfloatplacement
+ \@makefcolumn\@dbldeferlist
+ \@whilesw\if@fcolmade \fi{\@outputpage
+ \@makefcolumn\@dbldeferlist}%
+ \endgroup
+ \else
+ \vbox{}\clearpage
+ \fi
+ \fi
+ \else
+ \setbox\@cclv\vbox{\box\@cclv\vfil}%
+ \@makecol\@opcol
+ \clearpage
+ \fi}
+\gdef\@doclearpage{\mem@doclearpage}
+
+\newcommand*{\m@m@makecolfloats}{%
+ \xdef\@freelist{\@freelist\@midlist}%
+ \global\let\@midlist\@empty
+ \@combinefloats}
+\newcommand*{\m@m@makecoltext}{%
+ \ifvbox\@kludgeins
+ \@makespecialcolbox
+ \else
+ \setbox\@outputbox \vbox to\@colht{%
+ \@texttop
+ \dimen@ \dp\@outputbox
+ \unvbox \@outputbox
+ \vskip -\dimen@
+ \@textbottom}%
+ \fi}
+
+\newcommand*{\m@m@makecolintro}{}
+
+\newcommand*{\m@mopfootnote}{\setbox\@outputbox \vbox{%
+ \boxmaxdepth\@maxdepth
+ \@tempdima\dp\@cclv
+ \unvbox\@cclv
+ \vskip-\@tempdima
+ \vskip \skip\footins
+ \color@begingroup
+ \normalcolor
+ \footnoterule
+ \unvbox \footins
+ \color@endgroup}}
+
+\newcommand*{\m@mopsidebar}{%
+ \ifvoid\sideins\else
+ \setbox\@outputbox \vbox{%
+ \sidecontents
+ \unvbox\@outputbox}
+ \fi}
+
+\gdef\mem@makecol{%
+ \m@m@makecolintro
+ \ifvoid\footins
+ \setbox\@outputbox \box\@cclv
+ \else
+ \m@mopfootnote
+ \fi
+ \m@mdoextrafeet
+ \m@m@makecolfloats
+ \m@mopsidebar
+ \m@m@makecoltext
+ \global \maxdepth \@maxdepth}
+
+\gdef\mem@makecolbf{%
+ \m@m@makecolintro
+ \setbox\@outputbox \box\@cclv
+ \m@m@makecolfloats
+ \ifvoid\footins
+ \else
+ \m@mopfootnote
+ \fi
+ \m@mdoextrafeet
+ \m@mopsidebar
+ \m@m@makecoltext
+ \global \maxdepth \@maxdepth}
+
+\gdef\mem@makecoldblf{%
+ \m@m@makecolintro
+ \setbox\@outputbox \box\@cclv
+ \m@m@makecolfloats
+ \m@mopsidebar% <- added
+ \ifvoid\footins
+ \else
+ \m@mopfootnote
+ \fi
+ \m@mdoextrafeet
+ \m@m@makecoltext
+ \global \maxdepth \@maxdepth}
+
+\newcommand{\feetabovefloat}{\gdef\@makecol{\mem@makecol}}
+\newcommand{\feetbelowfloat}{\gdef\@makecol{\mem@makecolbf}}
+\feetabovefloat
+
+\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}
+
+\newif\ifm@mpnpageopt
+ \m@mpnpageoptfalse
+\newif\ifm@mpncontopt
+ \m@mpncontoptfalse
+\newcounter{pagenote}[chapter]
+\renewcommand{\thepagenote}{\arabic{pagenote}}
+\setcounter{pagenote}{0}
+
+\newcommand*{\notepageref}{\m@mpnpageopttrue}
+\@onlypreamble\notepageref
+\newcommand*{\continuousnotenums}{%
+ \counterwithout{pagenote}{chapter}
+ \renewcommand{\thepagenote}{\arabic{pagenote}}}
+\@onlypreamble\continuousnotenums
+
+\newif\ifmempagenotes
+ \mempagenotesfalse
+
+\newcommand*{\makepagenote}{%
+ \newwrite\@notefile
+ \immediate\openout\@notefile=\jobname.ent
+ \mempagenotestrue
+ \def\pagenote{\@bsphack\begingroup
+ \@sanitize
+ \m@m@wrpnote}%
+ \typeout{Writing note file \jobname.ent}%
+ \let\makepagenote\@empty}
+
+\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}
+
+\let\m@m@pnwrite\immediate@protected@write
+\AtBeginDocument{%
+ \ifm@mpnpageopt
+ \let\m@m@pnwrite\protected@write
+ \fi}
+
+\newcommand*{\pnchap}{\f@rtoc}
+\newcommand*{\pnschap}{\f@rbdy}
+
+\newcommand{\m@m@wrpnote}[2][]{%
+ \@ifmtarg{#1}{\refstepcounter{pagenote}%
+ \notenumintext{\thepagenote}}{}%
+ \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
+ \m@m@pnwrite\@notefile{}
+ {\string\noteentry{\thepagenote}{#1}{#2}{\thepage}}%
+ \endgroup
+ \@esphack}
+
+\def\pagenote{\@bsphack\begingroup \@sanitize\m@m@pagenote}
+\newcommand{\m@m@pagenote}[2][]{\endgroup\@esphack}
+
+\newcommand*{\pagetofootnote}{%
+ \let\memsavepagenote\pagenote
+ \renewcommand{\pagenote}[2][]{\footnote{##2}}}
+\newcommand*{\foottopagenote}{%
+ \let\memsavefootnote\footnote
+ \renewcommand*{\footnote}[2][]{\pagenote{##2}}}
+
+\newcommand{\addtonotes}[1]{\ifmempagenotes
+ \IfFileExists{\jobname.ent}{\m@m@pnwrite\@notefile{}{#1}}{\mempnofilewarn}%
+\fi}
+
+\newcommand{\notenumintext}[1]{%
+ \textsuperscript{#1}}
+\newcommand{\notenuminnotes}[1]{%
+ {\normalfont #1.}\space}
+\newcommand{\noteentry}[4]{%
+ \prenoteinnotes
+ \noteidinnotes{#1}{#2}\pageinnotes{#4}\noteinnotes{#3}%
+ \postnoteinnotes}
+
+\newcommand{\idtextinnotes}[1]{%
+ [#1]\space}
+\newcommand{\noteidinnotes}[2]{%
+ \@ifmtarg{#2}{%
+ \notenuminnotes{#1}}{\idtextinnotes{#2}}}
+\newcommand{\pageinnotes}[1]{%
+ \ifm@mpnpageopt \printpageinnotes{#1}\fi}
+\newcommand*{\printpageinnotes}[1]{%
+ (\pagerefname\ #1)\space}
+\newcommand{\noteinnotes}[1]{#1}
+
+\newcommand{\prenoteinnotes}{\par\noindent}
+\newcommand{\postnoteinnotes}{\par}
+
+\providecommand*{\notesname}{Notes}
+\newcommand*{\notedivision}{\chapter{\notesname}}
+
+\newcommand*{\printpagenotes}{\@ifstar{\@sprintpagenotes}{\@printpagenotes}}
+\newcommand*{\mempnofilewarn}{%
+ \ClassWarning{memoir}{There is no .ent file}}
+
+\newcommand*{\@sprintpagenotes}{%
+ \ifmempagenotes
+ \notedivision
+\IfFileExists{\jobname.ent}{%
+ \immediate\closeout\@notefile
+ \input{\jobname.ent}%
+ \immediate\openout\@notefile=\jobname.ent%
+ }{%
+ \mempnofilewarn
+}%
+\fi}
+
+\newcommand*{\@printpagenotes}{%
+ \ifmempagenotes
+ \notedivision
+ \IfFileExists{\jobname.ent}{%
+ \immediate\closeout\@notefile
+ \input{\jobname.ent}%
+ }{%
+ \mempnofilewarn
+ }
+ \fi}
+
+\newcommand*{\pagenotesubhead}[3]{%
+ \section*{#1 #2 #3}}
+
\newif\ifchangemarks\changemarksfalse
+\newcommand*{\changemarks}{\changemarkstrue}
+\newcommand*{\nochangemarks}{\changemarksfalse}
+
\newcommand{\v@rid}[2]{%
\@bsphack
\ifchangemarks
@@ -7035,6 +9056,9 @@
\fi
\@esphack}
+\newcommand*{\showtrimsoff}{\showtrimsfalse}
+\newcommand*{\showtrimson}{\showtrimstrue}
+
\newcommand*{\trimmark}{%
\begin{picture}(0,0)
\unitlength 1cm
@@ -7093,20 +9117,17 @@
\let\tmarktl\trimmark
\let\tmarktr\trimmark
\let\tmarkbl\trimmark
- \let\tmarkbr\trimmark
-}
+ \let\tmarkbr\trimmark}
\newcommand*{\trimLmarks}{%
\let\tmarktl\Ltrimpictl
\let\tmarktr\Ltrimpictr
\let\tmarkbl\Ltrimpicbl
- \let\tmarkbr\Ltrimpicbr
-}
+ \let\tmarkbr\Ltrimpicbr}
\newcommand*{\trimFrame}{%
\let\tmarktl\null
\let\tmarktr\null
\let\tmarkbl\Ftrimpicbl
- \let\tmarkbr\null
-}
+ \let\tmarkbr\null}
\newcommand*{\trimNone}{%
\let\tmarktl\relax
\let\tmarktr\relax
@@ -7115,8 +9136,7 @@
\let\tmarktm\relax
\let\tmarkml\relax
\let\tmarkmr\relax
- \let\tmarkbm\relax
-}
+ \let\tmarkbm\relax}
\newcommand*{\trimmarks}{%
\vbox to \z@{\vskip-1in \vskip\trimtop % top of logical page
@@ -7140,30 +9160,86 @@
\hss}%
\vss}}
-\newcounter{sheetsequence}
- \setcounter{sheetsequence}{1}
- \renewcommand{\thesheetsequence}{\@arabic\c@sheetsequence}
-\g@addto@macro{\@outputpage}{\stepcounter{sheetsequence}}
-
-\newcounter{lastsheet}
- \setcounter{lastsheet}{0}
-\newcounter{lastpage}
- \setcounter{lastpage}{0}
-\newcommand{\dol@stsheet}{%
- \if@filesw
- \addtocounter{sheetsequence}{-1}%
- \immediate\write\@auxout%
- {\string\setcounter{lastsheet}{\the\c@sheetsequence}}%
- \stepcounter{sheetsequence}%
- \fi}
-\newcommand{\dol@stpage}{%
- \if@filesw
- \addtocounter{page}{-1}%
- \immediate\write\@auxout%
- {\string\setcounter{lastpage}{\the\c@page}}%
- \stepcounter{page}%
- \fi}
-\AtBeginDocument{\AtEndDocument{\clearpage\dol@stsheet\dol@stpage}}
+\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}}%
+}}
\let\mem@oldshipout\shipout
\newcommand*{\mem@shipi}{%
@@ -7172,13 +9248,16 @@
\ifvoid\@cclv
\mem@oldshipout\box\@cclv
\else
- \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
+ \ifshowtrims
+ \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
\fi}
\ifshowtrims
\renewcommand*{\shipout}{\afterassignment\mem@shipi\setbox\@cclv=}
\fi
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newtoks\every@verbatim
\every@verbatim={}
\newtoks\afterevery@verbatim
@@ -7431,15 +9510,18 @@
{\kern\verbatimindent}{}}%
}
-\newcommand{\wrappingon}{%
+\newcommand*{\raggedwrap}{%
+ \@rightskip\@flushglue
+ \rightskip\@rightskip
+ \leftskip\@totalleftmargin
+ \parindent\ragrparindent}
+\newcommand*{\wrappingon}{%
\def\@xobeysp{~\discretionary{\verbatimbreakchar}%
{\kern\verbatimindent}{}}%
- \def\wrapright{\raggedright}%
-}
-\newcommand{\wrappingoff}{%
+ \def\wrapright{\raggedwrap}}
+\newcommand*{\wrappingoff}{%
\def\@xobeysp{\leavevmode\penalty\@M\ }%
- \def\wrapright{}%
-}
+ \def\wrapright{}}
\wrappingoff
\newwrite \verbatim@out
@@ -7502,7 +9584,7 @@
\csname ac\string#1\endcsname}%
\endgroup \fi \fi}
\def\@shortvrbinfo#1#2{%
- \PackageInfo{shortvrb}{%
+ \ClassInfo{memoir}{%
#1\expandafter\@gobble\string#2 a short reference
for \string\verb}}
\def\add@special#1{%
@@ -7520,32 +9602,6 @@
\ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}%
\xdef\@sanitize{\@sanitize}%
\endgroup}
-\newcommand{\linenumberfont}[1]{\def\vlvnumfont{#1}}
-%%% \linenumberfont{\small\rmfamily}
-
-\newcommand{\linenumberfrequency}[1]{%
- \ifnum #1< \@ne
- \def\linemodnum{0\relax}
- \bvcountlinesfalse
- \else
- \def\linemodnum{#1\relax}
- \bvcountlinestrue
- \fi
-}
-%%%%\linenumberfrequency{0}
-
-\newcommand{\getthelinenumber}[1]{%
- \ifnum\@ne=\linemodnum
- \@nameuse{the#1}
- \else
- \ifnum\@ne<\linemodnum
- \@tempcnta=\@nameuse{c@#1}
- \divide\@tempcnta\linemodnum \multiply\@tempcnta\linemodnum
- \ifnum\@tempcnta=\@nameuse{c@#1}\@nameuse{the#1}\fi
- \fi
- \fi
-}
-
\def\boxverbflag{14 }
\newlength{\bvboxsep} % user can change this
\setlength{\bvboxsep}{1em}
@@ -7554,16 +9610,25 @@
\bvperpagetrue
\newcommand{\bvtopofpage}[1]{%
- \long\def\b@vtop{#1}
-}
+ \long\def\b@vtop{#1}}
\def\b@vtop{} % used in \boxverb@split for heading
+\newcounter{memfbvline}
+ \c@memfbvline=\z@
\newcounter{bvlinectr}
-\def\theb@vlinenumber{\getthelinenumber{bvlinectr}}
-\newcommand{\resetbvlinenumber}{\setcounter{bvlinectr}{0}}
+\newcommand*{\setbvlinenums}[2]{%
+ \c@bvlinectr #1\relax \advance\c@bvlinectr \m@ne
+ \ifnum\z@<\linemodnum% we are printing line numbers
+ \@tempcnta #2\relax
+ \divide\@tempcnta\linemodnum
+ \multiply\@tempcnta\linemodnum
+ \c@memfbvline #2\relax
+ \advance\c@memfbvline-\@tempcnta
+ \fi}
+
+\def\theb@vlinenumber{\getthelinenumber{bvlinectr}{memfbvline}}
+\newcommand*{\resetbvlinenumber}{\setcounter{bvlinectr}{0}}
-\newif\ifbvcountlines % TRUE to print line numbers of verbatim lines
- \bvcountlinesfalse
\def\b@vdocount{\ifbvcountlines\stepcounter{bvlinectr}\fi}
\newlength{\bvnumlength}
%% \settowidth{\bvnumlength}{\vlvnumfont 9999}
@@ -7571,8 +9636,8 @@
\newif\ifbvcountinside % TRUE if line numbers inside box
\bvcountinsidetrue
-\newcommand{\bvnumbersinside}{\bvcountinsidetrue}
-\newcommand{\bvnumbersoutside}{\bvcountinsidefalse}
+\newcommand*{\bvnumbersinside}{\bvcountinsidetrue}
+\newcommand*{\bvnumbersoutside}{\bvcountinsidefalse}
\def\b@vdoinside{%
\ifbvcountlines\ifbvcountinside%
@@ -7586,6 +9651,8 @@
\vlvnumfont \theb@vlinenumber\space}}%
\fi\fi}
+\newcommand*{\@@m@mline}{\hb@xt@\linewidth}
+
\newcommand{\setupboxverb@line}{%
\par
\ifbvperpage
@@ -7593,7 +9660,8 @@
\fi
\def\verbatim@processline{\leavevmode
\b@vdocount%
- \bvleftsidehook\vbox{\advance\hsize-.8\p@ \@@line
+ \bvleftsidehook\vbox{\advance% \hsize-.8\p@ \@@line % changed to \linewidth
+ \linewidth-.8\p@ \@@line
{\b@vdooutside\strut\kern\bvboxsep%
\b@vdoinside%
\ift@bs
@@ -7602,8 +9670,7 @@
\the\verbatim@line
\fi
\hss}%
- \kern\bvboxsep}\bvrightsidehook\par}%
-}
+ \kern\bvboxsep}\bvrightsidehook\par}}
\newcommand{\setupbox@verb}{%
\leftskip\z@skip \rightskip\z@skip
@@ -7611,17 +9678,15 @@
\parfillskip\z@ plus\p@ minus\p@
\lineskip-\bvboxsep \baselineskip\z@skip
\frenchspacing\@vobeyspaces\@maybeobeytabs
- \boxverb@toprule
-}
+ \boxverb@toprule}
\def\boxedverbatim{\begingroup
+ \let\@@line\@@m@mline% new from mempatch v4.9
\setupboxverb@line
\@verbatim
\setupbox@verb
- \verbatim@start
-}
+ \verbatim@start}
\def\endboxedverbatim{\bvendrulehook\endtrivlist\endgroup\@doendpe}
-
\@namedef{boxedverbatim*}{\let\frenchspacing\@gobble \boxedverbatim}
\@namelet{endboxedverbatim*}\endboxverbatim
@@ -7630,7 +9695,8 @@
\newcommand*{\bvendofpage}[1]{%
\def\boxverb@botpage{#1}}
-\bvendofpage{\hrule\kern-.4pt}
+%%%%\bvendofpage{\hrule\kern-.4pt}
+\bvendofpage{\hrule width\linewidth\kern-.4pt}
\def\boxverb@split{\ifnum\outputpenalty=\boxverbflag
\ifdim\dp\@cclv=\z@
@@ -7640,8 +9706,8 @@
\fi
\fi}
-\def\bvtoprulehook{\hrule \nobreak \vskip-.1\p@}
-\def\bvendrulehook{\hrule}
+\def\bvtoprulehook{\hrule width\linewidth \nobreak\vskip-.1\p@}
+\def\bvendrulehook{\hrule width\linewidth}
\def\bvleftsidehook{\vrule}
\def\bvrightsidehook{\vrule}
\def\bvtopmidhook{\rule{0\p@}{2\bvboxsep} \hss}
@@ -7664,82 +9730,38 @@
\renewcommand{\bvtoprulehook}{\hrule \nobreak \vskip-.1\p@}%
\renewcommand{\bvleftsidehook}{\vrule}%
\renewcommand{\bvrightsidehook}{\vrule}%
- \renewcommand{\bvendrulehook}{\hrule}%
-}
+ \renewcommand{\bvendrulehook}{\hrule}}
\newcommand{\nobvbox}{%
\bvperpagefalse%
\renewcommand{\bvtoprulehook}{}%
\renewcommand{\bvleftsidehook}{}%
\renewcommand{\bvrightsidehook}{}%
- \renewcommand{\bvendrulehook}{}%
-}
+ \renewcommand{\bvendrulehook}{}}
\newcommand{\bvtopandtail}{%
\bvperpagefalse%
\renewcommand{\bvtoprulehook}{\hrule \nobreak \vskip-.1\p@}%
\renewcommand{\bvleftsidehook}{}%
\renewcommand{\bvrightsidehook}{}%
- \renewcommand{\bvendrulehook}{\hrule}%
-}
+ \renewcommand{\bvendrulehook}{\hrule}}
\newcommand{\bvsides}{%
\bvperpagefalse%
\renewcommand{\bvtoprulehook}{\vskip 3ex}%
\renewcommand{\bvleftsidehook}{\vrule}%
\renewcommand{\bvrightsidehook}{\vrule}%
- \renewcommand{\bvendrulehook}{}%
-}
+ \renewcommand{\bvendrulehook}{}}
\let\framed\relax \let\endframed\relax
\let\shaded\relax \let\endshaded\relax
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%% BEGIN FRAMED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%% PW -- can't have \ProvidesPpackage
-%%\ProvidesPackage{framed}[2003/07/21 v 0.8a:
-%% framed or shaded text with page breaks]
-
-%% PW added \ifframeasnormal % TRUE normal paras, FALSE minipage paras
-%% PW default is (FALSE to match DA v0.5, or TRUE to match DA v0.6)
-\newif\ifframeasnormal
- \frameasnormaltrue
-
-%% PW Define some things AtBeginDocument if they have not already
-%% been defined via someone using the framed package.
-\AtBeginDocument{\@ifundefined{framed}{%
-\def\endMakeFramed{\par
- \kern\z@ \penalty-100 % put depth into height
- \egroup
- \begingroup \put@frame \endgroup}
-
-\newenvironment{framed}% using default \FrameCommand
- {\MakeFramed {\advance\hsize-\width \FrameRestore}}%
- {\endMakeFramed}
-
-\newenvironment{shaded}{%
- \def\FrameCommand{\colorbox{shadecolor}}%
- \MakeFramed {\FrameRestore}}%
- {\endMakeFramed}
-
-\newenvironment{leftbar}{%
- \def\FrameCommand{\vrule width 3pt \hspace{10pt}}%
- \MakeFramed {\advance\hsize-\width \FrameRestore}}%
- {\endMakeFramed}
+\chardef\FrameRestore=\catcode`\| % for debug
+\catcode`\|=\catcode`\% % (debug: insert space after backslash)
-}{}} % end of AtBeginDocument
-
-%% \def\MakeFramed#1{\par %% PW change to \newcommand
-\newcommand{\MakeFramed}[1]{\par
- % measure added width and height; call result \width and \height
- \setbox\z@\vbox{\vskip-1in \hbox{\hskip-1in
- \FrameCommand{\hbox{\vrule \@height .7in \@depth.3in \@width 1in}}}%
- \vskip\z@skip}%
- \def\width{\wd\z@}\def\height{\ht\z@}%
- \edef\fb@frw{\the\width}\edef\fb@frh{\the\height}%
- % insert pre-penalties and skips
+\def\MakeFramed#1{\par
+ \fb@sizeofframe\FrameCommand
+ \let\width\fb@frw \let\height\fb@frh
\begingroup
\skip@\lastskip
\if@nobreak\else
@@ -7750,11 +9772,6 @@
\else \vskip-\skip@ \penalty-30 \vskip\skip@
\fi\fi\fi
\penalty\z@
- % Give a stretchy breakpoint that will always be taken in preference
- % to the \penalty 9999 used to update page parameters. The cube root
- % of 10000/100 indicates a multiplier of 0.21545, but the maximum
- % calculated badness is really 8192, not 10000, so the multiplier
- % is 0.2301.
\advance\skip@ \z@ plus-.5\baselineskip
\advance\skip@ \z@ plus-.231\height
\advance\skip@ \z@ plus-.231\skip@
@@ -7763,89 +9780,151 @@
\fi
\addvspace{\topsep}%
\endgroup
- % clear out pending page break
\penalty\@M \vskip 2\baselineskip \vskip\height
\penalty9999 \vskip -2\baselineskip \vskip-\height
\penalty9999 % updates \pagetotal
+|\message{After clearout, \pagetotal=\the\pagetotal,
+| \pagegoal=\the\pagegoal. }%
\fb@adjheight
\setbox\@tempboxa\vbox\bgroup
#1% Modifications to \hsize (can use \width and \height)
- \textwidth\hsize \columnwidth\hsize
-}
+ \textwidth\hsize \columnwidth\hsize}
+
+\def\endMakeFramed{\par
+ \kern\z@
+ \hrule\@width\hsize\@height\z@
+ \penalty-100 % put depth into height
+ \egroup
+ % {\showoutput\showbox\@tempboxa}%
+ \begingroup
+ \fb@put@frame\FrameCommand\FirstFrameCommand
+ \endgroup}
-\def\put@frame{\relax
+\def\fb@put@frame#1#2{\relax
\ifdim\pagegoal=\maxdimen \pagegoal\vsize \fi
- \ifinner \else
- \dimen@\pagegoal \advance\dimen@-\pagetotal % space left on page
- \ifdim\dimen@<2\baselineskip
- \eject \fb@adjheight \put@frame
+ \ifinner
+ \fb@putboxa#1%
+ \fb@afterframe
+ \else
+ \dimen@\pagegoal \advance\dimen@-\pagetotal % natural space left on page
+ \ifdim\dimen@<2\baselineskip % Too little room on page
+| \message{Page has only \the\dimen@\space room left; eject. }%
+ \eject \fb@adjheight \fb@put@frame#1#2%
\else % there's appreciable room left on the page
- \begingroup % temporarily set \dimen@ to be...
- \advance\dimen@.8\pageshrink % maximum space available on page
- \advance\dimen@-\fb@frh\relax % space for frame's contents
- \expandafter\endgroup
- % restore \dimen@ to real room left on page
- \ifdim\dimen@>\ht\@tempboxa % whole box does fit
- \else % box must be split
- \setbox\@tempboxa\vbox{% simulate frame and flexiblity of page:
- \vskip \fb@frh \@plus\pagestretch \@minus.8\pageshrink
- \kern137sp\kern-137sp\penalty-30
- \unvbox\@tempboxa}%
- \edef\fb@resto@set{\boxmaxdepth\the\boxmaxdepth
- \splittopskip\the\splittopskip}% % v0.8a
- \boxmaxdepth\z@ \splittopskip\z@
- \setbox\tw@\vsplit\@tempboxa to\dimen@
- \setbox\tw@\vbox{\unvbox\tw@}% natural-sized
- % If the split-to size > (\vsize-\topskip),
- % then set box to full size
- \begingroup
+ \fb@sizeofframe#1%
+| \message{\string\pagetotal=\the\pagetotal,
+| \string\pagegoal=\the\pagegoal,
+| \string\pagestretch=\the\pagestretch,
+| \string\pageshrink=\the\pageshrink,
+| \string\fb@frh=\fb@frh. \space}
+| \message{Box of size \the\ht\@tempboxa\space + \fb@frh}%
+ \begingroup % temporarily set \dimen@ to be...
+ \advance\dimen@.8\pageshrink % maximum space available on page
+ \advance\dimen@-\fb@frh\relax % space available for frame's contents
+ \expandafter\endgroup
+ \ifdim\dimen@>\ht\@tempboxa % whole box does fit
+| \message{fits in \the\dimen@. }%
+ \fb@putboxa#1%
+ \fb@afterframe
+ \else % box must be split
+| \message{must be split to fit in \the\dimen@. }%
+ \fb@sizeofframe#2%
+ \setbox\@tempboxa\vbox{% simulate frame and flexiblity of the page:
+ \vskip \fb@frh \@plus\pagestretch \@minus.8\pageshrink
+ \kern137sp\kern-137sp\penalty-30
+ \unvbox\@tempboxa}%
+ \edef\fb@resto@set{\boxmaxdepth\the\boxmaxdepth
+ \splittopskip\the\splittopskip}%
+ \boxmaxdepth\z@ \splittopskip\z@
+| \message{Padded box of size \the\ht\@tempboxa\space split
+| to \the\dimen@}%
+ \setbox\tw@\vsplit\@tempboxa to\dimen@
+| \toks99\expandafter{\splitfirstmark}%
+| \toks98\expandafter{\splitbotmark}%
+| \message{Marks are: \the\toks99, \the\toks98. }%
+ \setbox\tw@\vbox{\unvbox\tw@}% natural-sized
+| \message{Natural height of split box is \the\ht\tw@, leaving
+| \the\ht\@tempboxa\space remainder. }%
+ \begingroup
\advance\dimen@\topskip
\expandafter\endgroup
- \ifdim\dimen@>\pagegoal
- \dimen@ii\pagegoal
- \advance\dimen@ii -\topskip
- \advance\dimen@ii \FrameHeightAdjust\relax
- \else % suspect this is wrong:
- % If the split-to size > feasible room_on_page,
- % rebox it smaller.
- \advance\dimen@.8\pageshrink
- \ifdim\ht\tw@>\dimen@
- \dimen@ii\dimen@
- \else % use natural size
- \dimen@ii\ht\tw@
+ \ifdim\dimen@>\pagegoal
+| \message{Frame is big -- Use up the full column. }%
+ \dimen@ii\pagegoal
+ \advance\dimen@ii -\topskip
+ \advance\dimen@ii \FrameHeightAdjust\relax
+ \else % suspect this is wrong:
+ \advance\dimen@.8\pageshrink
+ \ifdim\ht\tw@>\dimen@
+| \message{Box too tall; rebox it to \the\dimen@. }%
+ \dimen@ii\dimen@
+ \else % use natural size
+ \dimen@ii\ht\tw@
+ \fi
\fi
- \fi
- % Re-box contents to desired size \dimen@ii
- \advance\dimen@ii -\fb@frh
- \setbox\tw@\vbox to\dimen@ii \bgroup
- % remove simulated frame and page flexibility:
- \vskip -\fb@frh \@plus-\pagestretch \@minus-.8\pageshrink
- \unvbox\tw@ \unpenalty\unpenalty
- \ifdim\lastkern=-137sp % whole box went to next page
- \egroup \fb@resto@set \eject
-%%% % (\vskip for frame size was discarded) % v 0.8a
- \fb@adjheight
- \else %
- \egroup \fb@resto@set % v0.8a
- \ifvoid\@tempboxa % it all fit after all
- \setbox\@tempboxa\box\tw@
- \else % it really did split
- \ifdim\wd\tw@>\z@
- \centerline{\FrameCommand{\box\tw@}}% ? \centerline bad idea
- \else
- \box\tw@
- \fi
- \hrule \@height\z@
- \eject
+ \advance\dimen@ii -\fb@frh
+ \setbox\tw@\vbox to\dimen@ii \bgroup
+ \vskip -\fb@frh \@plus-\pagestretch \@minus-.8\pageshrink
+ \unvbox\tw@ \unpenalty\unpenalty
+ \ifdim\lastkern=-137sp % whole box went to next page
+| \message{box split at beginning! }%
+ % need work here???
+ \egroup \fb@resto@set \eject % (\vskip for frame size was discarded)
\fb@adjheight
- \put@frame
- \fi\fi\fi\fi\fi
- \ifvoid\@tempboxa\else
- \centerline{\FrameCommand{\box\@tempboxa}}%
- \nointerlineskip \null %{\showoutput \showlists}
- \penalty-30 \vskip\topsep
+ \fb@put@frame#1#2% INSERTED ???
+ \else % Got material split off at the head
+ \egroup \fb@resto@set
+ \ifvoid\@tempboxa % it all fit after all
+| \message{box split at end! }%
+ \setbox\@tempboxa\box\tw@
+ \fb@putboxa#1%
+ \fb@afterframe
+ \else % it really did split
+| \message{box split as expected. Its reboxed height
+| is \the\ht\tw@. }%
+ \ifdim\wd\tw@>\z@
+ \wd\tw@\wd\@tempboxa
+ \memfblineboxtwo{#2{\box\tw@}}% ??? \centerline bad idea? \\
+ \else
+| \message{Zero width means likely blank.
+| Don't frame it (guess)}%
+ \box\tw@
+ \fi
+ \hrule \@height\z@ \@width\hsize
+ \eject
+ \fb@adjheight
+ \fb@put@frame\LastFrameCommand\MidFrameCommand
+ \fi\fi\fi\fi\fi}
+
+\newcommand{\memfblineboxtwo}[1]{\centerline{#1}}
+\newcommand{\memfblineboxa}[1]{\centerline{#1}}
+
+\def\fb@putboxa#1{%
+ \ifvoid\@tempboxa
+%%%% PackageWarning{framed}{Boxa is void -- discard it. }%
+ \@memwarn{Boxa is void -- discard it. }%
+ \else
+| \message{Frame and place boxa. }%
+| %{\showoutput\showbox\@tempboxa}%
+%%%%%%% \centerline{#1{\box\@tempboxa}}%
+ \memfblineboxa{#1{\box\@tempboxa}}%
\fi}
+\def\fb@afterframe{%
+ \nointerlineskip \null %{\showoutput \showlists}
+ \penalty-30 \vskip\topsep \relax}
+
+\newdimen\fb@frw
+\newdimen\fb@frh
+\def\fb@sizeofframe#1{\begingroup
+ \setbox\z@\vbox{\vskip-5in \hbox{\hskip-5in
+ #1{\hbox{\vrule \@height 4.7in \@depth.3in \@width 5in}}}%
+ \vskip\z@skip}%
+| \message{Measuring frame addition for \string#1 in \@currenvir\space
+| gives ht \the\ht\z@\space and wd \the\wd\z@. }%
+ \global\fb@frw\wd\z@ \global\fb@frh\ht\z@
+ \endgroup}
+
\def\fb@adjheight{%
\vbox to\FrameHeightAdjust{}% get proper baseline skip from above.
\penalty\@M \nointerlineskip
@@ -7854,43 +9933,100 @@
\edef\zero@glue{\the\z@skip}
-%% Define configuration commands:
-\def\FrameCommand{\fboxrule=\FrameRule \fboxsep=\FrameSep \fbox}
-\newdimen\FrameRule \FrameRule= \fboxrule
-\newdimen\FrameSep \FrameSep = 3\fboxsep
-
-%% Height of frame above first baseline when frame starts a page:
-%%\def\FrameHeightAdjust{6pt} % PW changed the value
-\def\FrameHeightAdjust{0.6em}
-
-%% PW: I have added my \ifframeasnormal to the original \FrameRestore
-%% The commented out lines are commented out by DA in the
-%% framed package
-
-\newcommand{\FrameRestore}{%
- \let\if@nobreak\iffalse
- \let\if@noskipsec\iffalse
- \let\-\@dischyph
- \let\'\@acci\let\`\@accii\let\=\@acciii
- \linewidth\hsize
- \sloppy
-\ifframeasnormal\else
- \let\par\@@par
- \parindent\z@ \parskip\z@skip
- \everypar{}%
- \@totalleftmargin\z@
- \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip
- \parfillskip\@flushglue \lineskip\normallineskip
- \baselineskip\normalbaselineskip
- \let\\\@normalcr
-\fi
-}
+\catcode`\|=\FrameRestore
+
+\providecommand\FrameCommand{%
+ \setlength\fboxrule{\FrameRule}\setlength\fboxsep{\FrameSep}%
+ \fbox}
+\@ifundefined{FrameRule}{\newdimen\FrameRule \FrameRule=\fboxrule}{}
+\@ifundefined{FrameSep} {\newdimen\FrameSep \FrameSep =3\fboxsep}{}
+\providecommand\FirstFrameCommand{\FrameCommand}
+\providecommand\MidFrameCommand{\FrameCommand}
+\providecommand\LastFrameCommand{\FrameCommand}
+\providecommand\FrameHeightAdjust{6pt}
+
+\def\FrameRestore{%
+ \let\if@nobreak\iffalse
+ \let\if@noskipsec\iffalse
+ \let\-\@dischyph
+ \let\'\@acci\let\`\@accii\let\=\@acciii
+ % \message{FrameRestore:
+ % \@totalleftmargin=\the \@totalleftmargin,
+ % \rightmargin=\the\rightmargin,
+ % \@listdepth=\the\@listdepth. }%
+ \ifnum \ifdim\@totalleftmargin>\z@ 1\fi
+ \ifdim\rightmargin>\z@ 1\fi
+ \ifnum\@listdepth>0 1\fi 0>\z@
+ % \message{In a list: \linewidth=\the\linewidth,
+ % \@totalleftmargin=\the\@totalleftmargin,
+ % \parshape=\the\parshape, \columnwidth=\the\columnwidth,
+ % \hsize=\the\hsize,
+ % \labelwidth=\the\labelwidth. }%
+%%% \@setminipage % snug fit around the item
+%%% \advance\linewidth-\columnwidth \advance\linewidth\hsize
+%%% \parshape\@ne \@totalleftmargin \linewidth
+ \memfblistfixparams
+ \else % Not in list
+ \linewidth=\hsize
+ %\message{No list, set \string\linewidth=\the\hsize. }%
+ \fi
+ \sloppy}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%\let\fram@d=\MakeFramed \let\endfram@d=\endMakeFramed
+\newcommand*{\memfblistfixparams}{%
+ \@setminipage % snug fit around the item
+ \advance\linewidth-\columnwidth \advance\linewidth\hsize
+ \parshape\@ne \@totalleftmargin \linewidth}
+
+\newenvironment{framed}% using default \FrameCommand
+ {\MakeFramed {\advance\hsize-\width \FrameRestore}}%
+ {\endMakeFramed}
-%%%%%%%%%%%% END FRAMED %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newenvironment{shaded}{%
+ \def\FrameCommand{\fboxsep=\FrameSep \colorbox{shadecolor}}%
+ \MakeFramed {\FrameRestore}}%
+ {\endMakeFramed}
-\newcommand{\newoutputstream}[1]{%
+\newenvironment{leftbar}{%
+ \def\FrameCommand{\vrule width 3pt \hspace{10pt}}%
+ \MakeFramed {\advance\hsize-\width \FrameRestore}}%
+ {\endMakeFramed}
+
+\newenvironment{snugshade}{%
+ \def\FrameCommand{\colorbox{shadecolor}}%
+ \MakeFramed {\FrameRestore\@setminipage}}%
+ {\par\unskip\endMakeFramed}
+
+\AtBeginPackage{framed}{%
+ \let\framed\relax \let\endframed\relax
+ \let\shaded\relax \let\endshaded\relax
+ \let\leftbar\relax \let\endleftbar\relax
+ \let\snugshade\relax \let\endsnugshade\relax}
+
+\newenvironment{qframe}{%
+ \def\FrameCommand##1{\fboxrule=\FrameRule\fboxsep=\FrameSep
+ \hskip\@totalleftmargin\fbox{##1}% There is no \@totalrightmargin, so...
+ \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
+ \MakeFramed{\advance\hsize-\width
+ \advance\hsize \FrameSep
+ \@totalleftmargin\z@ \linewidth=\hsize}}%
+ {\endMakeFramed}
+
+\newenvironment{qshade}{%
+ \def\FrameCommand##1{\fboxsep=\FrameSep
+ \hskip\@totalleftmargin
+ \hskip -1\FrameSep
+ \colorbox{shadecolor}{##1}%
+ \hskip-\linewidth \hskip-\@totalleftmargin
+ \hskip -1\FrameSep
+ \hskip\columnwidth}%
+ \MakeFramed{\advance\hsize-\width
+ \advance\hsize 3\FrameSep
+ \@totalleftmargin\z@ \linewidth=\hsize}}%
+ {\endMakeFramed}
+
+\newcommand*{\newoutputstream}[1]{%
\@ifundefined{#1outstre@m}%
{\expandafter\newwrite\csname #1outstre@m\endcsname
\csname newif\expandafter\endcsname
@@ -7905,7 +10041,7 @@
}%
{\@memwarn{Output stream #1\space is already defined}}}
-\newcommand{\newinputstream}[1]{%
+\newcommand*{\newinputstream}[1]{%
\@ifundefined{#1instre@m}%
{\expandafter\newread\csname #1instre@m\endcsname
\csname newif\expandafter\endcsname
@@ -7946,23 +10082,20 @@
{\IfStreamOpen{#1}{%
\@memwarn{Output stream #1\space is open}}{#2}}}
-\newcommand{\openoutputfile}[2]{%
+\newcommand*{\openoutputfile}[2]{%
\outstre@mandclosed{#2}{%
\global\@namedef{#1@filename}{#1}%
\if@filesw
\immediate\openout\@nameuse{#2outstre@m}=\@nameuse{#1@filename}%
\fi
\global\csname stre@m#2opentrue\endcsname%
- \@nameuse{atstreamopen#2}%
- }%
-}
+ \@nameuse{atstreamopen#2}}}
-\newcommand{\closeoutputstream}[1]{%
+\newcommand*{\closeoutputstream}[1]{%
\outstre@mandopen{#1}{%
\@nameuse{atstreamclose#1}%
\immediate\closeout\@nameuse{#1outstre@m}%
- \global\csname stre@m#1openfalse\endcsname}%
-}
+ \global\csname stre@m#1openfalse\endcsname}}
\newcommand{\openinputfile}[2]{%
\IfFileExists{#1}{% file exists
@@ -7974,15 +10107,13 @@
\@nameuse{atstreamopen#2}}}%
{% file not found
\typeout{No file #1.}
- }%
-}
+ }}
\newcommand{\closeinputstream}[1]{%
\instre@mandopen{#1}{%
\@nameuse{atstreamclose#1}%
\immediate\closein\@nameuse{#1instre@m}%
- \global\csname stre@m#1openfalse\endcsname}%
-}
+ \global\csname stre@m#1openfalse\endcsname}}
\def\writeverbatim#1{%
\@bsphack
@@ -7999,8 +10130,7 @@
{\let\protect\string
\immediate\write\@nameuse{#1outstre@m}{#2}%
}}%
- \@esphack
-}
+ \@esphack}
\newif\ifstre@mnoteof
\newcommand{\checkstre@meof}[1]{%
@@ -8012,8 +10142,7 @@
\read\@nameuse{#1instre@m} to\temptokstre@m
\temptokstre@m
\repeat
- }%
-}
+ }}
\def\readaline#1{
\instre@mandopen{#1}{%
@@ -8022,9 +10151,7 @@
\else
\read\@nameuse{#1instre@m} to\temptokstre@m
\temptokstre@m
- \fi
- }%
-}
+ \fi}}
\def\readverbatim{\begingroup
\ift@bs
@@ -8038,16 +10165,14 @@
{\@verbatim #1\relax
\def\@verbinstre@m{\@nameuse{#2instre@m}}
\verb@readstre@m\endtrivlist\endgroup\@doendpe}%
- {\@memwarn{Stream #2\space is not open}\endgroup}%
-}
+ {\@memwarn{Stream #2\space is not open}\endgroup}}
\newcommand{\verb@readstre@m}{%
\verbatim@startline
\expandafter\endlinechar\expandafter\m@ne
\expandafter\verbatim@read@stre@m
\expandafter\endlinechar\the\endlinechar\relax
- \verbatim@finish
-}
+ \verbatim@finish}
\newcommand{\verbatim@read@stre@m}{%
\read\@verbinstre@m to\next
@@ -8057,8 +10182,7 @@
\verbatim@processline
\verbatim@startline
\expandafter\verbatim@read@stre@m
- \fi
-}
+ \fi}
\newcommand{\readboxedverbatim}{\begingroup
\@ifstar{\stre@mbvin\relax}%
@@ -8071,8 +10195,7 @@
\def\@verbinstre@m{\@nameuse{#2instre@m}}%
\setupbox@verb
\verb@readstre@m\bvendrulehook\endtrivlist\endgroup\@doendpe}%
- {\@memwarn{Stream #2\space is not open}\endgroup}%
-}
+ {\@memwarn{Stream #2\space is not open}\endgroup}}
\newcommand{\provideenvironment}{\@star@or@long\m@mprovenv}
\newcommand{\m@mprovenv}[1]{\@ifundefined{#1}%
@@ -8088,8 +10211,8 @@
\@ifundefined{c@#1}%
{\newcounter{#1}}%
{\@memwarn{Counter `#1' already defined}%
- \@ifnextchar[{\m@mgobbleopt}{}}%
-}
+ \@ifnextchar[{\m@mgobbleopt}{}}}
+
\def\m@mgobbleopt[#1]{}
\newcommand*{\providelength}[1]{%
@@ -8098,8 +10221,7 @@
\endgroup
\expandafter\@ifundefined\@gtempa
{\newlength{#1}}%
- {\@memwarn{Length #1 already defined}}%
-}
+ {\@memwarn{Length #1 already defined}}}
\newcommand*{\newloglike}{\@ifstar{\m@mnewlogs}{\m@mnewlog}}
\newcommand*{\m@mnewlogs}[2]{%
@@ -8149,6 +10271,9 @@
\newif\ifoddpage
\newif\ifstrictpagecheck
\strictpagecheckfalse
+\newcommand*{\strictpagecheck}{\strictpagechecktrue}
+\newcommand*{\easypagecheck}{\strictpagecheckfalse}
+
\newcounter{cp@cntr}
\newcommand{\cplabel}{^_}
\DeclareRobustCommand{\checkoddpage}{%
@@ -8200,8 +10325,7 @@
\@firstcolumntrue%
\fi%
\setlength{\hsize}{\columnwidth}%
- \setlength{\linewidth}{\hsize}%
-}
+ \setlength{\linewidth}{\hsize}}
\DeclareRobustCommand{\changetext}[5]{%
\@ifmtarg{#1}{}{\addtolength{\textheight}{#1}}%
@@ -8209,8 +10333,19 @@
\@ifmtarg{#3}{}{\addtolength{\evensidemargin}{#3}}%
\@ifmtarg{#4}{}{\addtolength{\oddsidemargin}{#4}}%
\@ifmtarg{#5}{}{\addtolength{\columnsep}{#5}}%
- \ch@ngetext%
-}
+ \ch@ngetext}
+
+\DeclareRobustCommand{\changepage}[9]{%
+ \@ifmtarg{#1}{}{\addtolength{\textheight}{#1}}%
+ \@ifmtarg{#2}{}{\addtolength{\textwidth}{#2}}%
+ \@ifmtarg{#3}{}{\addtolength{\evensidemargin}{#3}}%
+ \@ifmtarg{#4}{}{\addtolength{\oddsidemargin}{#4}}%
+ \@ifmtarg{#5}{}{\addtolength{\columnsep}{#5}}%
+ \ch@ngetext
+ \@ifmtarg{#6}{}{\addtolength{\topmargin}{#6}}%
+ \@ifmtarg{#7}{}{\addtolength{\headheight}{#7}}%
+ \@ifmtarg{#8}{}{\addtolength{\headsep}{#8}}%
+ \@ifmtarg{#9}{}{\addtolength{\footskip}{#9}}}
\newenvironment{adjustwidth}[2]{%
\begin{list}{}{%
@@ -8248,8 +10383,13 @@
#1 = \paperwidth
\advance #1 by -\textwidth
\divide #1 by \tw@
- \advance #1 by -\spinemargin
-}
+ \advance #1 by -\spinemargin}
+
+\newenvironment{vplace}[1][1]{%
+ \par\vspace{\stretch{#1}}%
+}{%
+ \vspace*{\stretch{1}}%
+ \par}
\newcommand{\cleartoevenpage}[1][\@empty]{%
\clearpage%
@@ -8288,6 +10428,14 @@
\break
\fi\endgroup}
+\newcommand*{\midsloppy}{%
+ \tolerance 5000%
+ \hbadness 4000%
+ \emergencystretch 1.5em%
+ \hfuzz .1\p@
+ \vfuzz\hfuzz}
+\newenvironment{midsloppypar}{\par\midsloppy}{\par}
+
\newcommand{\medspace}{\kern .22222em }
\DeclareRobustCommand{\:}{%
\relax\ifmmode\mskip\medmuskip\else\medspace\fi}
@@ -8428,8 +10576,7 @@
\divide \c@workm@mctr by \m@mten
\multiply \c@workm@mctr by \m@mten
\advance \c@bsm@mctr by -\c@workm@mctr
- \fi
-}
+ \fi}
\newcommand*{\form@tnumber}[1]{%
\numdigits{#1}%
@@ -8503,8 +10650,7 @@
\thexsm@mctr
\fi
\fi
- \theism@mctr % units
-}
+ \theism@mctr} % units
\newcommand*{\cardinal}[1]{%
\begingroup
@@ -8822,40 +10968,39 @@
\fi
\fi
\fi % end ifmakeordinal
-\endgroup
-}
+\endgroup}
-\newcommand*{\numtoname}[1]{%
+\DeclareRobustCommand{\numtoname}[1]{%
\makeordinalfalse
\notnumtonameallcapstrue%
\lowernumtonametrue%
\n@me@number{#1}}
-\newcommand*{\numtoName}[1]{%
+\DeclareRobustCommand{\numtoName}[1]{%
\makeordinalfalse
\notnumtonameallcapstrue%
\lowernumtonamefalse%
\n@me@number{#1}}
-\newcommand*{\NumToName}[1]{%
+\DeclareRobustCommand{\NumToName}[1]{%
\makeordinalfalse
\notnumtonameallcapsfalse%
\lowernumtonamefalse%
\n@me@number{#1}}
-\newcommand*{\ordinaltoname}[1]{%
+\DeclareRobustCommand{\ordinaltoname}[1]{%
\makeordinaltrue
\notnumtonameallcapstrue%
\lowernumtonametrue%
\n@me@number{#1}}
-\newcommand*{\ordinaltoName}[1]{%
+\DeclareRobustCommand{\ordinaltoName}[1]{%
\makeordinaltrue
\notnumtonameallcapstrue%
\lowernumtonamefalse%
\n@me@number{#1}}
-\newcommand*{\OrdinalToName}[1]{%
+\DeclareRobustCommand{\OrdinalToName}[1]{%
\makeordinaltrue
\notnumtonameallcapsfalse%
\lowernumtonamefalse%
@@ -8909,13 +11054,124 @@
\global \vsize \@colht
\global \@colroom \@colht
\@floatplacement
+ \fi}
+
+\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
+
+\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}
+
+\newcounter{sheetsequence}
+ \setcounter{sheetsequence}{1}
+ \renewcommand{\thesheetsequence}{\@arabic\c@sheetsequence}
+\g@addto@macro{\@outputpage}{\stepcounter{sheetsequence}}
+
+\newcounter{lastsheet}
+ \setcounter{lastsheet}{0}
+\newcounter{lastpage}
+ \setcounter{lastpage}{0}
+
+\newcommand{\dol@stsheet}{%
+ \if@filesw
+ \addtocounter{sheetsequence}{-1}%
+ \immediate\write\@auxout%
+ {\string\memsetcounter{lastsheet}{\the\c@sheetsequence}}%
+ \stepcounter{sheetsequence}%
+ \fi}
+\newcommand{\dol@stpage}{%
+ \if@filesw
+ \addtocounter{page}{-1}%
+ \immediate\write\@auxout%
+ {\string\memsetcounter{lastpage}{\the\c@page}}%
+ \stepcounter{page}%
+ \fi}
+\AtBeginDocument{\AtEndDocument{\clearpage\dol@stsheet\dol@stpage}}
+
+\newif\ifcntrmod
+\newif\ifnotcntrmod
+\newcommand*{\iscntrmod}[2]{
+ \@tempcnta=\@nameuse{c@#1}%
+ \@tempcntb=\@tempcnta
+ \divide\@tempcnta #2\relax
+ \multiply\@tempcnta #2\relax
+ \advance\@tempcntb-\@tempcnta
+ \ifnum\@tempcntb=0\relax
+ \cntrmodtrue
+ \notcntrmodfalse
+ \else
+ \cntrmodfalse
+ \notcntrmodtrue
+ \fi}
+
+\newcommand*{\@memensuresigpages}{%
+ \ifnum\@mempagespersig<\@ne
+ \else
+ \iscntrmod{sheetsequence}{\@mempagespersig}
+ \ifcntrmod
+ \else
+ \clearpage
+ \pagestyle{empty}
+ \mbox{}
+ \loop
+ \iscntrmod{sheetsequence}{\@mempagespersig}
+ \ifnotcntrmod
+ \clearpage
+ \pagestyle{empty}
+ \mbox{}
+ \repeat
+ \fi
+ \fi}
+
+\newcommand*{\leavespergathering}[1]{\@memcnta=#1\relax
+ \ifnum\@memcnta<\tw@
+ \def\@mempagespersig{-1}%
+ \else
+ \multiply\@memcnta \tw@
+ \edef\@mempagespersig{\@memcnta}%
+ \fi}
+\leavespergathering{0}
+
+\AtEndDocument{\@memensuresigpages}
\newcommand*{\abstractname}{Abstract}
\newcommand*{\contentsname}{Contents}
\newcommand*{\listfigurename}{List of Figures}
\newcommand*{\listtablename}{List of Tables}
+\newcommand*{\bookname}{Book}
\newcommand*{\partname}{Part}
\newcommand*{\chaptername}{Chapter}
\newcommand*{\appendixname}{Appendix}
@@ -8930,9 +11186,12 @@
\newcommand*{\tablerefname}{Table}
\newcommand*{\pagename}{page}
\newcommand*{\pagerefname}{page}
+\newcommand*{\bookrefname}{Book~}
\newcommand*{\partrefname}{Part~}
\newcommand*{\chapterrefname}{Chapter~}
\newcommand*{\sectionrefname}{\S}
+\newcommand*{\appendixrefname}{Appendix~}
+
\newcommand{\today}{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
@@ -8965,31 +11224,30 @@
\fi
\newfloat[chapter]{figure}{lof}{\figurename}
- \kill@lastcounter{lofdepth}
+%%% \kill@lastcounter{lofdepth}
\renewcommand{\thefigure}{\thechapter.\@arabic\c@figure}
\newlistof{listoffigures}{lof}{\listfigurename}
- \kill@lastcounter{lofdepth}
+%%% \kill@lastcounter{lofdepth}
\newlistentry[chapter]{figure}{lof}{0}
\cftsetindents{figure}{0em}{2.3em}
%% \kill@lastcounter{lofdepth}
\newfloat[chapter]{table}{lot}{\tablename}
- \kill@lastcounter{lotdepth}
+%%% \kill@lastcounter{lotdepth}
\renewcommand{\thetable}{\thechapter.\@arabic\c@table}
\newlistof{listoftables}{lot}{\listtablename}
- \kill@lastcounter{lotdepth}
+%%% \kill@lastcounter{lotdepth}
\newlistentry[chapter]{table}{lot}{0}
\cftsetindents{table}{0em}{2.3em}
%% \kill@lastcounter{lotdepth}
-\AtBeginDocument{%
- \@ifundefined{c@lofdepth}%
- {\newcounter{lofdepth}\setcounter{lofdepth}{1}}{}
- \@ifundefined{c@lotdepth}%
- {\newcounter{lotdepth}\setcounter{lotdepth}{1}}{}
-}
+%%%\AtBeginDocument{%
+%%% \@ifundefined{c@lofdepth}%
+%%% {\newcounter{lofdepth}\setcounter{lofdepth}{1}}{}
+%%% \@ifundefined{c@lotdepth}%
+%%% {\newcounter{lotdepth}\setcounter{lotdepth}{1}}{}}
\ifartopt
\chapterstyle{article}
@@ -9032,6 +11290,7 @@
\EmulatedPackage{array}
\EmulatedPackage{booktabs}
\EmulatedPackage{ccaption}
+\EmulatedPackage{changepage}
\EmulatedPackage{chngcntr}
\EmulatedPackage{chngpage}
\EmulatedPackage{crop}
@@ -9039,16 +11298,21 @@
\EmulatedPackage{delarray}
\EmulatedPackage{enumerate}
\EmulatedPackage{epigraph}
-\EmulatedPackage{framed}
+%%%%%\EmulatedPackage{framed}
\EmulatedPackage{ifmtarg}
\EmulatedPackage{ifpdf}
+\EmulatedPackage{ifxetex}
\EmulatedPackage{index}
\EmulatedPackage{makeidx}
\EmulatedPackage{moreverb}
+\EmulatedPackage{mparhack}
\EmulatedPackage{needspace}
\EmulatedPackage{newfile}
\EmulatedPackage{nextpage}
+\EmulatedPackage{pagenote}
+\EmulatedPackage{parskip}
\EmulatedPackage{patchcmd}
+\EmulatedPackage{setspace}
\EmulatedPackage{shortvrb}
\EmulatedPackage{showidx}
\EmulatedPackage{tabularx}
@@ -9059,6 +11323,51 @@
\EmulatedPackage{verbatim}
\EmulatedPackage{verse}
+%%% 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 any of 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}
+}
+
+\AtBeginPackage{float}{\let\newfloat\relax}
+
\InputIfFileExists{mempatch.sty} % should be this
\endinput