summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memoir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-02-17 01:03:49 +0000
committerKarl Berry <karl@freefriends.org>2010-02-17 01:03:49 +0000
commiteb531211a9347605eb2e38bd483e0698f2f3c30b (patch)
treec29125d024d27dd4e788de455c1221641b42cc9a /Master/texmf-dist/tex/latex/memoir
parent80f8b8d7c5431f27d221b670d2fbb51f37cdbdff (diff)
memoir v1.618033988 (16feb10)
git-svn-id: svn://tug.org/texlive/trunk@17061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/memoir')
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memoir.cls693
1 files changed, 590 insertions, 103 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls
index b1c222f7702..8611127a6e8 100644
--- a/Master/texmf-dist/tex/latex/memoir/memoir.cls
+++ b/Master/texmf-dist/tex/latex/memoir/memoir.cls
@@ -26,7 +26,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{memoir}%
- [2009/11/17 v1.61803398c configurable book, report, article document class]
+ [2010/02/16 v1.618033988 configurable book, report, article document class]
\newcommand*{\@ptsize}{}
\newcommand*{\@memptsize}{}
\newlength{\onelineskip}
@@ -55,14 +55,14 @@
\newif\ifsamename
\newcommand{\nametest}[2]{%
- \samenamefalse
- \begingroup
- \def\@memtempa{#1} \def\@memtempb{#2}
- \ifx \@memtempa\@memtempb
- \endgroup
- \samenametrue
- \else
- \endgroup
+ \samenamefalse%
+ \begingroup%
+ \def\@memtempa{#1}\def\@memtempb{#2}%
+ \ifx \@memtempa\@memtempb%
+ \endgroup%
+ \samenametrue%
+ \else%
+ \endgroup%
\fi}
\newif\ifm@m@And
@@ -210,7 +210,7 @@
Package `ifpdf' is not installed.\MessageBreak
The package is being emulated}%
\m@mifpdftrue
-\newif\ifpdf
+\expandafter\newif\csname ifpdf\endcsname
\pdffalse
\ifx\pdfoutput\undefined
\else
@@ -256,11 +256,12 @@
\ClassWarningNoLine{memoir}{%
The `ifxetex' package is not installed.\MessageBreak
The package is being emulated}%
-\newif\ifxetex
+\expandafter\newif\csname ifxetex\endcsname
\@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue}
+\m@mifxetextrue%
%%\EmulatedPackage{ifxetex}[2008/07/23]
}
-\ifm@mifxetex
+\ifm@mifxetex%
\def\RequireXeTeX{%
\ifxetex\else
\@memerror{XeTeX is required to process this document}%
@@ -276,7 +277,7 @@
The `ifluatex' package is not installed.\MessageBreak
The package is being emulated}%
\m@mifluatextrue
-\newif\ifluatex
+\expandafter\newif\csname ifluatex\endcsname
\luatexfalse
\ifx\luatexversion\@undefined
\else
@@ -1260,6 +1261,10 @@
\the\sidebarvsep\space and \the\sidebartopsep}
\typeout{Sidebarheight:
\the\dimen\sideins}
+ \typeout{Sidefoothsep and sidefootwidth:
+ \the\sidefoothsep\space and \the\sidefootwidth}
+ \typeout{Sidefootvsep and sidefootheight:
+ \the\sidefootvsep\space and \the\sidefootheight}
\typeout{******************************************************}
\typeout{}}
@@ -1392,28 +1397,52 @@
\setcounter{dbltopnumber}{3}
\renewcommand{\dbltopfraction}{.85}
\renewcommand{\dblfloatpagefraction}{.7}
+\newcommand\mem@set@ps@xtra@info[3]{%
+ \@namedef{ps@#1@aliasfor}{#2}%
+ \@namedef{ps@#1@isalias}{#3}}
+
+\newcommand\mem@ps@find@real[1]{%
+ \if\@nameuse{ps@#1@isalias}\relax
+ \mem@ps@find@real{\@nameuse{ps@#1@aliasfor}}
+ \else\def\@tempa{#1}\fi}
+
+\newcommand\mem@ps@safe@change[1]{%
+ \@ifundefined{ps@#1}{%
+ \@memerror{Undefined pagestyle '#1', so I cannot change it}{}}{}
+ \if\@nameuse{ps@#1@isalias}\relax \mem@ps@find@real{#1}
+ \@memerror{The pagestyle '#1' is marked as an alias page style.^^J
+ Modifying an alias page style may give unexpected results.^^J The
+ alias chain resolves to the real page style '\@tempa', so try
+ issuing^^J \string\copypagestyle{#1}{\@tempa}^^J before before
+ modifying '#1'}{} \fi }
+
\newcommand{\makeevenhead}[4]{%
+ \mem@ps@safe@change{#1}
\@namedef{#1eheadl}{#2}
\@namedef{#1eheadc}{#3}
\@namedef{#1eheadr}{#4}
}
\newcommand{\makeoddhead}[4]{%
+ \mem@ps@safe@change{#1}
\@namedef{#1oheadl}{#2}
\@namedef{#1oheadc}{#3}
\@namedef{#1oheadr}{#4}
}
\newcommand{\makeevenfoot}[4]{%
+ \mem@ps@safe@change{#1}
\@namedef{#1efootl}{#2}
\@namedef{#1efootc}{#3}
\@namedef{#1efootr}{#4}
}
\newcommand{\makeoddfoot}[4]{%
+ \mem@ps@safe@change{#1}
\@namedef{#1ofootl}{#2}
\@namedef{#1ofootc}{#3}
\@namedef{#1ofootr}{#4}
}
\newcommand*{\makerunningwidth}[1]{%
+ \mem@ps@safe@change{#1}%
\def\m@mhfstyle{#1}%
\m@mopthfwidth}
\newcommand*{\m@mopthfwidth}[2][\@mpty]{%
@@ -1424,9 +1453,11 @@
\@namedef{\m@mhfstyle footrunwidth}{#1}%
\fi}
\newcommand*{\makerunningheadwidth}[2]{%
+ \mem@ps@safe@change{#1}%
\@namedef{#1headrunwidth}{#2}%
}
\newcommand*{\makerunningfootwidth}[2]{%
+ \mem@ps@safe@change{#1}%
\@namedef{#1footrunwidth}{#2}%
}
@@ -1435,14 +1466,17 @@
\newcommand{\footruleheight}{0pt}
\newcommand{\footruleskip}{0.3\normalbaselineskip}
\newcommand{\makeheadrule}[3]{%
+ \mem@ps@safe@change{#1}%
\@namedef{#1headrule}{%
\hrule\@width #2\@height #3 \vskip-#3}}
\newcommand{\makefootrule}[4]{%
+ \mem@ps@safe@change{#1}%
\@namedef{#1footrule}{%
\vskip-#4\vskip-#3
\hrule\@width #2\@height #3 \vskip #4}}
\newcommand{\makeheadposition}[5]{%
+ \mem@ps@safe@change{#1}%
\nametest{flushleft}{#2}
\ifsamename
\@namedef{#1evenhpl}{\relax} \@namedef{#1evenhpr}{\hss}
@@ -1488,14 +1522,16 @@
\fi
\fi}
-\newcommand{\makepsmarks}[2]{\@namedef{#1pshook}{#2}}
+\newcommand{\makepsmarks}[2]{\mem@ps@safe@change{#1}\@namedef{#1pshook}{#2}}
\newcommand*{\m@mhe@dreset}{\def\baselinestretch{1}\normalsize}
\newcommand*\makeheadfootvposition[3]{%
- \@namedef{#1headvplacement}{#2}\@namedef{#1footvplacement}{#3}}
+ \mem@ps@safe@change{#1}%
+ \@namedef{#1headvplacement}{#2}\@namedef{#1footvplacement}{#3}}
\newcommand{\makepagestyle}[1]{%
+ \mem@set@ps@xtra@info{#1}{}{01}%
\@namedef{ps@#1}{%
\@namedef{#1@evenhead}{%
\@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1headrunwidth}{\m@mhe@dreset%
@@ -1554,6 +1590,7 @@
\makepsmarks{#1}{}}
\newcommand{\aliaspagestyle}[2]{%
+ \mem@set@ps@xtra@info{#1}{#2}{00}%
\@namedef{ps@#1}{\@nameuse{ps@#2}}}
\newcommand{\copypagestyle}[2]{%
@@ -1705,7 +1742,12 @@
\fi}
\newcommand\addtopsmarks[3]{%
+ \mem@ps@safe@change{#1}%
\expandafter\addtodef\expandafter{\csname #1pshook\endcsname}{#2}{#3}}
+\newcommand\clearplainmark[1]{%
+ \@namedef{#1mark}{}}
+\newcommand\clearmark[1]{%
+ \@namedef{#1mark}{\@gobble}}
\if@twoside
\makepagestyle{headings}
\makepsmarks{headings}{%
@@ -6513,7 +6555,7 @@
}
}
-\newcommand*{\subcaptionref}{%
+\DeclareRobustCommand{\subcaptionref}{%
\@ifstar{\ssc@ref}{\sc@ref}}
\newcommand*{\ssc@ref}[1]{\ref{sub@#1}}
\newcommand*{\sc@ref}[1]{{\@subcaplabelfont\ref{sub@#1}}}
@@ -7100,6 +7142,8 @@
\setcounter{#2depth}{1}
\@namedef{#2mark}{\markboth{#3}{#3}}
\@namedef{#1}{\@ifstar{\@nameuse{mem@#1}{01}}{\@nameuse{mem@#1}{00}}}
+ \@namedef{cft#2beforelisthook}{}%
+ \@namedef{cft#2afterlisthook}{}%
\@namedef{mem@#1}##1{%
\ensureonecol
\par
@@ -7112,7 +7156,9 @@
\fi
\fi
\parskip\cftparskip
+ \@nameuse{cft#2beforelisthook}%
\@starttoc{#2}%
+ \@nameuse{cft#2afterlisthook}%
\endgroup
\restorefromonecol}
\@namedef{@#2maketitle}{%
@@ -7140,8 +7186,10 @@
\@input{\jobname.#1}%
\if@filesw
\AtEndDocument{%
- \expandafter\newwrite\csname tf@#1\endcsname
- \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \expandafter\ifx\csname tf@#1\endcsname\relax
+ \expandafter\newwrite\csname tf@#1\endcsname
+ \immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
+ \fi
}%
\fi
\@nobreakfalse
@@ -7158,7 +7206,9 @@
\newcommand*{\cftparfillskip}{\parfillskip=0pt plus1fil}
\newcommand*{\@cftn@me}{}
+\newcommand*\numberlinehook[1]{}
\renewcommand*{\numberline}[1]{%
+ \numberlinehook{#1}%
\hb@xt@\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
\newcommand{\@cftbsnum}{}
\newcommand{\@cftasnum}{}
@@ -7177,6 +7227,7 @@
\ifnum \@nameuse{c@#3depth} > #4\relax
\vskip \@nameuse{cftbefore#2skip}
{%\leftskip \@nameuse{cft#2indent}\relax
+ \newcommand*\cftwhatismyname{#2}%
\memRTLleftskip \@nameuse{cft#2indent}\relax
%%% \rightskip \@tocrmarg
\memRTLrightskip \@tocrmarg
@@ -7228,7 +7279,9 @@
\@namedef{cft#2pagefont}{\normalfont}
\@namedef{cft#2afterpnum}{}
\@namedef{toclevel@#2}{#4}
+ \@namedef{cft#2formatpnumhook}##1{}
\@namedef{cft#2formatpnum}##1{%
+ \@nameuse{cft#2formatpnumhook}{##1}%
\hb@xt@\@pnumwidth{\hfil\@nameuse{cft#2pagefont}##1}}
\@namedef{cft#2fillnum}##1{%
{\@nameuse{cft#2leader}}\nobreak
@@ -7273,7 +7326,9 @@
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
+\newcommand*\booknumberlinehook[1]{}
\newcommand{\booknumberline}[1]{%
+ \booknumberlinehook{#1}%
\hb@xt@\@tempdima{%
\cftbookname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
@@ -7297,7 +7352,9 @@
%%%% {\hb@xt@\@pnumwidth{\hss {\cftbookpagefont #1}}}%
\cftbookformatpnum{#1}%
\cftbookafterpnum\par}
+\newcommand{\cftbookformatpnumhook}[1]{}
\newcommand{\cftbookformatpnum}[1]{%
+ \cftbookformatpnumhook{#1}%
\hb@xt@\@pnumwidth{\hss {\cftbookpagefont #1}}}
\newcommand*{\cftpartname}{}
@@ -7334,7 +7391,9 @@
\newcommand*{\toclevel@part}{-1}
+\newcommand*\partnumberlinehook[1]{}
\newcommand{\partnumberline}[1]{%
+ \partnumberlinehook{#1}%
\hb@xt@\@tempdima{%
\cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
@@ -7353,7 +7412,9 @@
\newcommand{\cftpartdotsep}{\cftnodots}
\newcommand{\cftpartpagefont}{\large\bfseries}
\newcommand{\cftpartafterpnum}{}
+ \newcommand{\cftpartformatpnumhook}[1]{}
\newcommand*{\cftpartformatpnum}[1]{%
+ \cftpartformatpnumhook{#1}%
\hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}
\newcommand{\cftpartfillnum}[1]{%
{\cftpartleader}%
@@ -7399,7 +7460,9 @@
\l@chapapp{#1}{#2}{\cftappendixname}}
\newcommand{\toclevel@appendix}{0}
+\newcommand*\chapternumberlinehook[1]{}
\newcommand{\chapternumberline}[1]{%
+ \chapternumberlinehook{#1}%
\hb@xt@\@tempdima{\@chapapp@head\@cftbsnum #1\@cftasnum\hfil}%
\@cftasnumb}
@@ -7418,7 +7481,9 @@
\newcommand{\cftchapterdotsep}{\cftnodots}
\newcommand{\cftchapterpagefont}{\bfseries}
\newcommand{\cftchapterafterpnum}{}
+ \newcommand{\cftchapterformatpnumhook}[1]{}
\newcommand*{\cftchapterformatpnum}[1]{%
+ \cftchapterformatpnumhook{#1}%
\hb@xt@\@pnumwidth{\hfil\cftchapterpagefont #1}}
\newcommand*{\cftchapterfillnum}[1]{%
{\cftchapterleader}\nobreak
@@ -8108,6 +8173,68 @@
\newcommand*{\printglossary}[1][\jobname]{\@input@{#1.gls}}
+\newcommand*{\m@msetm@argin}[1]{%
+ \def\@tempa{#1}\def\@tempb{left}%
+ \ifx\@tempa\@tempb
+ \def\m@mm@argin{0}%
+ \else
+ \def\@tempb{right}%
+ \ifx\@tempa\@tempb
+ \def\m@mm@argin{1}%
+ \else
+ \def\@tempb{outer}%
+ \ifx\@tempa\@tempb
+ \def\m@mm@argin{2}%
+ \else
+ \def\@tempb{inner}%
+ \ifx\@tempa\@tempb
+ \def\m@mm@argin{3}%
+ \else
+ \def\m@mm@argin{-1}%
+ \fi
+ \fi
+ \fi
+ \fi}
+
+\newif\ifmemtortm
+ \memtortmtrue
+\newcommand*{\m@mwhich@margin}[1]{%
+ \memtortmtrue
+ \if@twocolumn
+ \if@firstcolumn% left
+ \memtortmfalse
+ \else% right
+ \memtortmtrue
+ \fi
+ \else
+ \if@twoside
+ \checkoddpage
+ \ifcase #1\relax% 0 left
+ \memtortmfalse
+ \or% 1 right
+ \memtortmtrue
+ \or% 2 outer
+ \ifoddpage
+ \memtortmtrue
+ \else
+ \memtortmfalse
+ \fi
+ \or% 3 inner
+ \ifoddpage
+ \memtortmfalse
+ \else
+ \memtortmtrue
+ \fi
+ \fi% end ifcase
+ \else% oneside
+ \ifnum #1=\z@% 0 left, all else right
+ \memtortmfalse
+ \else
+ \memtortmtrue
+ \fi
+ \fi% end if@twoside
+ \fi}
+
\def\@addmarginpar{%
\checkoddpage
\@next\@marbox\@currlist{\@cons\@freelist\@marbox
@@ -8153,6 +8280,51 @@
\hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}%
}
+\newif\ifm@msetmp
+ \m@msetmpfalse
+\newcommand*{\marginparmargin}[1]{%
+ \m@msetmptrue
+ \m@msetm@argin{#1}%
+ \ifnum\m@mm@argin<\z@
+ \@memwarn{Bad \string\marginparmargin\space argument `#1'\MessageBreak
+ set to `outer'}%
+ \gdef\m@mmpar@margin{2}% set as outer
+ \else
+ \global\let\m@mmpar@margin\m@mm@argin
+ \fi
+ \setmpbools}
+
+\newcommand*{\setmpbools}{%
+ \if@twoside
+ \@mparswitchtrue
+ \else
+ \@mparswitchfalse
+ \fi
+ \ifcase\m@mmpar@margin\relax% 0 left
+ \@reversemargintrue% \sideparswitchfalse \reversesidepartrue
+ \or% 1 right
+ \@reversemarginfalse% \sideparswitchfalse \reversesideparfalse
+ \or% 2 outer
+ \@reversemarginfalse% \sideparswitchtrue \reversesideparfalse
+ \or% 3 inner
+ \@reversemargintrue% \sideparswitchtrue \reversesidepartrue
+ \fi}
+
+\newcommand*{\m@msetmpcodes}{%
+ \if@mparswitch% 2 sided
+ \if@reversemargin% inner
+ \def\m@mmpar@margin{3}%
+ \else% outer
+ \def\m@mmpar@margin{2}%
+ \fi
+ \else% 1 sided
+ \if@reversemargin% left
+ \def\m@mmpar@margin{0}%
+ \else% right
+ \def\m@mmpar@margin{1}%
+ \fi
+ \fi}
+
\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent
\parfillskip\@flushglue}
@@ -8162,52 +8334,88 @@
\sideparswitchfalse
\if@twoside \sideparswitchtrue \fi
-\newlength{\sideparvshift}
-%%%% \setlength{\sideparvshift}{-2.08ex}% seems to work for all font sizes
+%% true if \sideparmargin used
+\newif\ifm@msetsp
+ \m@msetspfalse
+\newcommand*{\sideparmargin}[1]{%
+ \m@msetsptrue
+ \m@msetm@argin{#1}%
+ \ifnum\m@mm@argin<\z@
+ \@memwarn{Bad \string\sideparmargin\space argument `#1'\MessageBreak
+ set to `outer'}%
+ \gdef\m@mspar@margin{2}% set as outer
+ \else
+ \global\let\m@mspar@margin\m@mm@argin
+ \fi}
-\newcommand{\sidepar}{\@dblarg{\@sidepar}}
-\long\def\@sidepar[#1]#2{\@bsphack\strut\vadjust{%
- \checkoddpage
+\newcommand*{\m@msidepar@left}{%
+ \@tempdimc\marginparwidth
+ \advance\@tempdimc\marginparsep
+ \kern-\@tempdimc}
+\newcommand*{\m@msidepar@right}{%
+ \@tempdimc\columnwidth
+ \advance\@tempdimc\marginparsep
+ \kern\@tempdimc}
+
+\newcommand*{\setspbools}{%
+ \ifcase\m@mspar@margin\relax% 0 left
+ \sideparswitchfalse \reversesidepartrue
+ \or% 1 right
+ \sideparswitchfalse \reversesideparfalse
+ \or% 2 outer
+ \sideparswitchtrue \reversesideparfalse
+ \or% 3 inner
+ \sideparswitchtrue \reversesidepartrue
+ \fi}
+
+\newcommand*{\setspcode}{%
\ifsideparswitch
\ifreversesidepar
- \ifoddpage
- \oddpagefalse
- \else
- \oddpagetrue
- \fi
+ \def\m@mspar@margin{3}% inner
+ \else
+ \def\m@mspar@margin{2}% outer
\fi
\else
- \oddpagetrue
\ifreversesidepar
- \oddpagefalse
- \fi
+ \def\m@mspar@margin{0}% left
+ \else
+ \def\m@mspar@margin{1}% right
+ \fi
+ \fi}
+
+\newcommand*{\sideparfont}{\normalfont\normalsize}
+\newcommand*{\sideparform}{\ifmemtortm\raggedright\else\raggedleft\fi}
+
+\newcommand{\sidepar}{\@dblarg{\@sidepar}}
+\long\def\@sidepar[#1]#2{\leavevmode\@bsphack\strut\vadjust{%
+ \checkoddpage
+ \ifm@msetsp% \sideparmargin used
+%%%% \setspbools
+ \else% \sideparmargin not used, set the \m@mspar@margin code
+ \setspcode
\fi
\rlap{\kern-\parindent
- \if@twocolumn
- \if@firstcolumn% put at left
- \kern -\marginparsep \kern -\marginparwidth
- \else% put at right
- \kern \columnwidth \kern \marginparsep
- \fi
+ \m@mwhich@margin{\m@mspar@margin}% set left or right margin
+ \ifmemtortm
+ \m@msidepar@right
\else
- \ifoddpage% put at right
- \kern \textwidth \kern \marginparsep
- \else% put at left
- \kern -\marginparsep \kern -\marginparwidth
- \fi
+ \m@msidepar@left
\fi
- \setbox0=\vtop to 0pt{%
- \begin{minipage}[t]{\marginparwidth}%
- \normalfont\normalsize
- \ifoddpage #2\else #1\fi%
- \end{minipage}%
- \vss}%
- \vtop to 0pt{\kern\sideparvshift% default should be 0pt
- \kern-\dp\strutbox
- \kern-\ht0
- \box0 \vss}}}%
+ \setbox0=\vtop to 0pt{%
+ \begin{minipage}[t]{\marginparwidth}%
+ \sideparform\sideparfont%
+ \ifmemtortm #2\else #1\fi
+ \end{minipage}%
+ \vss}%
+ \vtop to 0pt{\kern\sideparvshift% default should be 0pt
+ \kern-\dp\strutbox
+ \kern-\ht0
+ \box0 \vss}}}%
\@esphack}
+
+\newlength{\sideparvshift}
\setlength{\sideparvshift}{0pt}
+%%%% \setlength{\sideparvshift}{-2.08ex}% seems to work for all font sizes
\newinsert\sideins
\skip\sideins=0pt
@@ -8223,7 +8431,7 @@
\newlength{\sidebarhsep}
\newlength{\sidebarvsep}
\newlength{\sidebarwidth}
-\newcommand{\sidebarfont}{}
+\newcommand{\sidebarfont}{\normalfont\normalsize}
\newcommand*{\setsidebars}[6]{%
\nametest{#1}{*}\ifsamename\else
\setlength{\sidebarhsep}{#1}\@memznegtest{\sidebarhsep}%
@@ -8255,33 +8463,22 @@
{\textheight}% sidebarheight
\newcommand{\sidebarform}{%\rightskip=\z@ \@plus 2em}
- \memRTLrightskip=\z@ \@plus 2em}
+ %\memRTLrightskip=\z@ \@plus 2em
+ \ifmemtortm\raggedright\else\raggedleft\fi%
+ % \ifmemtortm\memRTLrightskip=\z@ \@plus 2em\else\memRTLleftskip=\z@ \@plus 2em\fi
+}
\newif\ifsidebaroneside
\if@twoside\sidebaronesidefalse\else\sidebaronesidetrue\fi
\newcommand*{\sidebarmargin}[1]{%
- \def\@tempa{#1}\def\@tempb{left}%
- \ifx\@tempa\@tempb
- \gdef\m@msidebar@margin{0}%
+ \m@msetm@argin{#1}%
+ \ifnum\m@mm@argin<\z@
+ \@memwarn{Bad \string\sidebarmargin\space argument `#1'\MessageBreak
+ set to `outer'}%
+ \gdef\m@msidebar@margin{2}% set as outer
\else
- \def\@tempb{right}%
- \ifx\@tempa\@tempb
- \gdef\m@msidebar@margin{1}%
- \else
- \def\@tempb{outer}%
- \ifx\@tempa\@tempb
- \gdef\m@msidebar@margin{2}%
- \else
- \def\@tempb{inner}%
- \ifx\@tempa\@tempb
- \gdef\m@msidebar@margin{3}%
- \else
- \@memwarn{Bad \string\sidebarmargin\space argument}%
- \gdef\m@msidebar@margin{1}%
- \fi
- \fi
- \fi
+ \global\let\m@msidebar@margin\m@mm@argin
\fi}
%%%% default outer
\gdef\m@msidebar@margin{2}
@@ -8295,34 +8492,11 @@
\kern\@tempdimc}
\newcommand{\sidecontents}{\hbox to \z@{%
- \if@twocolumn% %% put outside nearest column
- \if@firstcolumn% %% move to left
- \m@sideb@left
- \else% %% move to right
- \m@sideb@right
- \fi
- \else% %% put into foremargin?
- \ifsidebaroneside% %% put into right hand margin
- \m@sideb@right
- \else% %% pick the margin
- \ifcase\m@msidebar@margin% 0 to left
- \m@sideb@left
- \or% 1 to right
- \m@sideb@right
- \or% 2 to outer
- \ifodd\c@page% %% move to right
- \m@sideb@right
- \else% %% move to left
- \m@sideb@left
- \fi
- \or% 3 to inner
- \ifodd\c@page% %% move to left
- \m@sideb@left
- \else% %% move to right
- \m@sideb@right
- \fi
- \fi
- \fi
+ \m@mwhich@margin{\m@msidebar@margin}%
+ \ifmemtortm
+ \m@sideb@right
+ \else
+ \m@sideb@left
\fi
\vtop to0pt{%
\normalsize\normalfont\sidebarfont% select font so we know the strut size
@@ -8335,7 +8509,8 @@
\insert\sideins{%
\hsize\sidebarwidth
\@parboxrestore
- \sidebarform \normalsize\normalfont\sidebarfont
+ \m@mwhich@margin{\m@msidebar@margin}%
+ \sidebarform\sidebarfont
\splittopskip=\ht\strutbox
\splitmaxdepth=\dp\strutbox % doesn't do anything useful
\allowbreak
@@ -9319,6 +9494,308 @@
\ifvbox\@kludgeins\insert\@kludgeins{\unvbox\@kludgeins}\fi
\ifvoid\sideins\else\insert\sideins{\unvbox\sideins}\fi}
+\newif\ifm@mfnmargin
+\newcommand*{\footnotesatfoot}{\m@mfnmarginfalse}
+\newcommand*{\footnotesinmargin}{\m@mfnmargintrue}
+\footnotesatfoot
+
+\renewcommand{\@footnotetext}[1]{%
+ \ifm@mfnmargin% use marginpar
+ \marginpar{%
+ \def\baselinestretch{\m@m@singlespace}%
+ \reset@font
+ \foottextfont
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark}%
+ \color@begingroup
+ \@makefntext{\ignorespaces#1}%
+ \color@endgroup}%
+ \else% regular feet
+ \insert\footins{%
+ \def\baselinestretch{\m@m@singlespace}%
+ \reset@font
+ \foottextfont
+ \@preamfntext
+ \hsize\columnwidth
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark}%
+ \color@begingroup
+ \@makefntext{%
+ \rule\z@\footnotesep\ignorespaces{\foottextfont #1}%
+ \@finalstrut\strutbox}%
+ \color@endgroup}
+ \fi
+ \m@mmf@prepare}
+
+\newcommand*{\sidefootmargin}[1]{%
+ \m@msetm@argin{#1}%
+ \ifnum\m@mm@argin<\z@
+ \@memwarn{Bad \string\sidefootmargin\space argument `#1'\MessageBreak
+ set to `outer'}%
+ \gdef\m@msidefoot@margin{2}% set as outer
+ \else
+ \global\let\m@msidefoot@margin\m@mm@argin
+ \fi}
+\sidefootmargin{outer}
+
+\newinsert\sidefootins
+ \skip\sidefootins=0pt
+ \count\sidefootins=0\relax
+
+\newlength{\sidefootadjust}
+ \setlength{\sidefootadjust}{0pt}
+\newlength{\sidefootheight}
+\newcommand*{\setsidefootheight}[1]{%
+ \setlength{\dimen\sidefootins}{#1}%
+ \advance\dimen\sidefootins -\topskip
+ \advance\dimen\sidefootins \ht\strutbox
+ \setlength{\sidefootheight}{\dimen\sidefootins}}
+\setsidefootheight{\textheight}
+
+\newlength{\sidefoothsep}
+\newlength{\sidefootvsep}
+\newlength{\sidefootwidth}
+
+\newcommand*{\setsidefeet}[6]{%
+ \nametest{#1}{*}\ifsamename\else
+ \setlength{\sidefoothsep}{#1}\@memznegtest{\sidefoothsep}%
+ \fi
+ \nametest{#2}{*}\ifsamename\else
+ \setlength{\sidefootwidth}{#2}\@memznegtest{\sidefootwidth}%
+ \fi
+ \nametest{#3}{*}\ifsamename\else
+ \setlength{\sidefootvsep}{#3}\@memznegtest{\sidefootvsep}%
+ \fi
+ \nametest{#4}{*}\ifsamename\else
+ \setlength{\sidefootadjust}{#4}%
+ \fi
+ \nametest{#5}{*}\ifsamename\else
+ \def\sidefoottextfont{#5}%
+ \fi
+ \nametest{#6}{*}\ifsamename\else
+ \setsidefootheight{#6}%
+ \ifdim\dimen\sidefootins>\z@\else
+ \@memerror{\protect\sidefootheight\space is zero or negative}{\@ehd}%
+ \fi
+ \fi}
+\setsidefeet{\marginparsep}{\marginparwidth}%
+ {\onelineskip}{0pt}%
+ {\normalfont\footnotesize}{\textheight}%
+
+\newcommand*{\sidefootform}{\rightskip=\z@ \@plus 2em}
+
+\newcommand*{\m@sideft@left}{%
+ \@tempdimc \sidefootwidth
+ \advance\@tempdimc\sidefoothsep
+ \kern-\@tempdimc}
+\newcommand*{\m@sideft@right}{%
+ \@tempdimc \columnwidth% or \hsize
+ \advance\@tempdimc\sidefoothsep
+ \kern\@tempdimc}
+
+\newlength{\m@mdownsf}
+
+\newcommand*{\sidefootcontents}{\hbox to \z@{%
+ \m@mwhich@margin{\m@msidefoot@margin}%
+ \ifmemtortm
+ \m@sideft@right
+ \else
+ \m@sideft@left
+ \fi
+ \vtop to 0pt{% original
+ \normalsize\normalfont\sidefoottextfont
+ \vskip\topskip \vskip-\ht\strutbox
+ \vskip\sidefootadjust% use this for minor vertical adjustment
+ \m@mdownsf=\dimen\sidefootins
+ \advance\m@mdownsf-\ht\sidefootins
+ \advance\m@mdownsf-\dp\sidefootins
+ \ifdim\m@mdownsf>\sidefootvsep
+ \advance\m@mdownsf\sidefootvsep
+ \advance\m@mdownsf 0.5\ht\strutbox
+ \fi
+ \vskip\m@mdownsf% --- basically works
+ \unvbox\sidefootins%
+ \vss}%
+ \hss}}
+
+\newcommand*{\m@mopsidefoot}{%
+ \ifvoid\sidefootins\else
+ \setbox\@outputbox \vbox{%
+ \sidefootcontents
+ \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@mopsidefoot
+ \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@mopsidefoot
+ \m@m@makecoltext
+ \global \maxdepth \@maxdepth}
+
+\gdef\@reinserts{%
+ \ifvoid\footins\else\insert\footins{\unvbox\footins}\fi
+ \m@mdodoreinextrafeet
+ \ifvbox\@kludgeins\else\insert\@kludgeins{\unvbox\@kludgeins}\fi
+ \ifvoid\sideins\else\insert\sideins{\unvbox\sideins}\fi
+ \ifvoid\sidefootins\else\insert\sidefootins{\unvbox\sidefootins}\fi}
+
+\renewcommand*{\@mem@testifnofoot}{%
+ \@mem@nofoottrue
+ \ifvoid\footins\else\@mem@nofootfalse\fi
+ \ifvoid\footinsv@r\else\@mem@nofootfalse\fi
+ \ifvoid\sideins\else\@mem@nofootfalse\fi
+ \ifvoid\sidefootins\else\@mem@nofootfalse\fi
+ \@mem@extranofeet}
+
+\newcounter{sidefootnote}
+ \renewcommand{\thesidefootnote}{\@arabic\c@sidefootnote}
+\@addtoreset{sidefootnote}{chapter}
+
+
+\newcommand*{\@sidempfn}{sidefootnote}
+\newcommand*{\thesidempfn}{\thesidefootnote}
+
+\newcommand*{\@makesidefnmark}{\hbox{\@textsuperscript{%
+ \normalfont\@thesidefnmark}}}
+
+\newcommand{\@preamsidefntext}{%
+ \interlinepenalty\interfootnotelinepenalty
+ \floatingpenalty \@MM
+ \splittopskip=\footnotesep
+ \splitmaxdepth=\dp\strutbox
+ \@parboxrestore}
+
+\newcommand{\@sidefootnotetext}[1]{\insert\sidefootins{%
+ \hsize\sidefootwidth
+ \@parboxrestore
+ \def\baselinestretch{\m@m@singlespace}%
+ \sidefootform \normalsize\normalfont\sidefoottextfont
+ \splittopskip=\ht\strutbox
+ \splitmaxdepth=\dp\strutbox
+ \allowbreak
+ \prevdepth=\dp\strutbox
+ \vskip-\parskip
+ \protected@edef\@currentlabel{%
+ \csname p@sidefootnote\endcsname\@thesidefnmark}%
+\color@begingroup
+\@makesidefntext{{\sidefoottextfont #1}}%
+\color@endgroup
+ \ifvmode\else
+ \unskip\@finalstrut\strutbox
+ \fi
+ \par
+ \ifdim\prevdepth>\dp\strutbox \prevdepth=\dp\strutbox\fi
+ \ifdim\prevdepth>99\p@
+ \nobreak
+ \vskip-\prevdepth
+ \allowbreak
+ \vskip\dp\strutbox
+ \fi
+ \vskip\sidefootvsep}%
+ \m@mmf@prepare}
+
+\newcommand*{\@sidefootnotemark}{%
+ \leavevmode
+ \ifhmode
+ \edef\@x@sf{\the\spacefactor}%
+ \m@mmf@check
+ \nobreak
+ \fi
+ \@makesidefnmark
+ \m@mmf@prepare
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax}
+
+\newcommand*{\sidefootnote}{\@ifnextchar[
+ \@xsidefootnote{\stepcounter\@sidempfn
+ \protected@xdef\@thesidefnmark{\thesidempfn}%
+ \@sidefootnotemark\@sidefootnotetext}}
+\def\@xsidefootnote[#1]{%
+ \begingroup
+ \csname c@\@sidempfn\endcsname #1\relax
+ \unrestored@protected@xdef\@thesidefnmark{\thesidempfn}%
+ \endgroup
+ \@sidefootnotemark\@sidefootnotetext}
+
+\newcommand{\sidefootnotemark}{%
+ \@ifnextchar[
+ \@xsidefootnotemark
+ {\stepcounter{sidefootnote}%
+ \protected@xdef\@thesidefnmark{\thesidefootnote}%
+ \@sidefootnotemark}}
+\def\@xsidefootnotemark[#1]{%
+ \begingroup
+ \c@sidefootnote #1\relax
+ \unrestored@protected@xdef\@thesidefnmark{\thesidefootnote}%
+ \endgroup
+ \@sidefootnotemark}
+
+\newcommand*{\sidefootnotetext}{%
+ \@ifnextchar[
+ \@xsidefootnotetext
+ {\protected@xdef\@thesidefnmark{\thesidempfn}%
+ \@sidefootnotetext}}
+\def\@xsidefootnotetext[#1]{%
+ \begingroup
+ \csname c@\@sidempfn\endcsname #1\relax
+ \unrestored@protected@xdef\@thesidefnmark{\thesidempfn}%
+ \endgroup
+ \@sidefootnotetext}
+
+\newcommand*{\sidefootmarkstyle}[1]{\def\sidefootscript##1{#1}}
+\newcommand*{\makesidefootmarkhook}{}
+\newcommand*{\sidefootfootmark}{%
+ \ifdim\sidefootmarkwidth < \z@
+ \llap{\hb@xt@ -\sidefootmarkwidth{%
+ \hss\normalfont\sidefootscript{\@thesidefnmark}}%
+ \hspace*{-\sidefootmarkwidth}}%
+ \else
+ \ifdim\sidefootmarkwidth = \z@
+ {\normalfont\sidefootscript{\@thesidefnmark}}%
+ \else
+ \hb@xt@\sidefootmarkwidth{\hss\normalfont\sidefootscript{\@thesidefnmark}}%
+ \fi
+ \fi}
+
+\newcommand{\makesidefootmark}[1]{%
+ \leavevmode
+ \parindent \sidefootparindent\noindent
+ \leftskip\sidefootmarksep\relax
+ \advance\leftskip \sidefootmarkwidth \null\nobreak\hskip -\leftskip\relax
+ \makesidefootmarkhook\relax
+ \sidefootfootmark #1}
+
+\newcommand{\@makesidefntext}[1]{\makesidefootmark #1}
+
+\newlength{\sidefootmarkwidth}
+ \setlength{\sidefootmarkwidth}{0em}
+\newlength{\sidefootmarksep}
+ \setlength{\sidefootmarksep}{0em}
+\newlength{\sidefootparindent}
+ \setlength{\sidefootparindent}{1em}
+\sidefootmarkstyle{\textsuperscript{#1}}
+
\newif\ifm@mpnpageopt
\m@mpnpageoptfalse
\newif\ifm@mpncontopt
@@ -10720,6 +11197,15 @@
\@ifbothcntrs{#1}{#2}{\@removefromreset{#1}{#2}%
\@namedef{the#1}{\arabic{#1}}}}
+\newcommand*{\letcountercounter}[2]{%
+ \expandafter\let\csname c@m@morig@ctr#1\expandafter\endcsname%
+ \csname c@#1\endcsname
+ \expandafter\let\csname c@#1\expandafter\endcsname%
+ \csname c@#2\endcsname}
+\newcommand*{\unletcounter}[1]{%
+ \expandafter\let\csname c@#1\expandafter\endcsname%
+ \csname c@m@morig@ctr#1\endcsname}
+
\newif\ifoddpage
\newif\ifstrictpagecheck
\strictpagecheckfalse
@@ -11774,6 +12260,7 @@
\EmulatedPackage{titling}[2008/07/23]
\EmulatedPackage{tocbibind}[2008/07/23]
\EmulatedPackage{tocloft}[2008/07/23]
+\EmulatedPackage{tocvsec2}[2008/07/23]
\EmulatedPackage{verbatim}[2008/07/23]
\EmulatedPackage{verse}[2008/07/23]