summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/memoir/memoir.cls
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/memoir/memoir.cls')
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memoir.cls134
1 files changed, 100 insertions, 34 deletions
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls
index 645a0457903..2451f8919e0 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--2008 Peter R. Wilson
+%% Copyright 2001--2009 Peter R. Wilson
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -20,12 +20,13 @@
%% LaTeX version 2003/06/01 or later.
%%
%% This work has the LPPL maintenance status "author-maintained".
+%% (Note: Lars Madsen is gradually taking over maintenance)
%%
%% This work consists of the files listed in the README file.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{memoir}%
- [2009/02/06 v1.6180339e configurable book, report, article document class]
+ [2009/07/12 v1.6180339f configurable book, report, article document class]
\newcommand*{\@ptsize}{}
\newcommand*{\@memptsize}{}
\newlength{\onelineskip}
@@ -81,6 +82,9 @@
\expandafter\let\csname #1\endcsname}
\newcommand{\@namelongdef}[1]{%
\long\expandafter\def\csname #1\endcsname}
+\newcommand*{\memletcmdtxt}[2]{\expandafter\let\expandafter#1\csname#2\endcsname}
+\newcommand*{\memlettxttxt}[1]{\expandafter\memletcmdtxt\csname#1\endcsname}
+\newcommand*{\memlettxtcmd}[2]{\expandafter\let\csname#1\endcsname#2}
\newcommand{\@nameedef}[1]{%
\expandafter\protected@edef\csname #1\endcsname}
@@ -640,6 +644,9 @@
\DeclareOption{oldfontcommands}{\@memoldfonttrue}
\DeclareOption{extrafontsizes}{\extrafontsizestrue}
+\newif\ifmem@noetex
+\DeclareOption{noetex}{\mem@noetextrue}
+
\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside,
portrait}
\ProcessOptions*
@@ -649,6 +656,9 @@
\setlength\stockwidth {\@tempdima}
\fi
+\ifmem@noetex\relax\else
+ \IfFileExists{etex.sty}{\RequirePackage{etex}}{}
+\fi
\providecommand*{\memoirpostopthook}{}
\memoirpostopthook
@@ -1208,7 +1218,8 @@
\advance\evensidemargin -1in\relax
\@settopoint\textwidth
\@settopoint\oddsidemargin
- \@settopoint\evensidemargin}
+ \@settopoint\evensidemargin
+ \fixheaderwidths}
\newcommand*{\typeoutlayout}{%
\typeout{}
@@ -1876,6 +1887,16 @@
\makeevenfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
\makeoddfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
+\newcommand*{\fixheaderwidths}{%
+ % companion pagestyle
+ \setlength{\headwidth}{\textwidth}
+ \addtolength{\headwidth}{\marginparsep}
+ \addtolength{\headwidth}{\marginparwidth}
+ \makerunningwidth{companion}{\headwidth}
+ \makeheadrule{companion}{\headwidth}{\normalrulethickness}
+ \makefootrule{companion}{\textwidth}{\footruleheight}{\footruleskip}
+}
+
\renewcommand{\pagenumbering}{%
\@ifstar{\@smempnum}{\@mempnum}}
\newcommand{\@smempnum}[1]{%
@@ -2272,18 +2293,25 @@
\newcommand{\frontmatter}{%
\@ifstar{\@smemfront}{\@memfront}}
+\newcommand\@memfront@floats{%
+ \counterwithout{figure}{chapter}
+ \counterwithout{table}{chapter}
+}
\newcommand{\@smemfront}{%
\cleardoublepage
\@mainmatterfalse
\setcounter{secnumdepth}{-10}
- \counterwithout{figure}{chapter}
- \counterwithout{table}{chapter}
+ \@memfront@floats
}
\newcommand{\@memfront}{%
\@smemfront\pagenumbering{roman}}
\newcommand{\mainmatter}{%
\@ifstar{\@smemmain}{\@memmain}}
+\newcommand\@memmain@floats{%
+ \counterwithin{figure}{chapter}
+ \counterwithin{table}{chapter}
+}
\newcommand*{\@smemmain}{%
\@mainmattertrue
\setcounter{secnumdepth}{\value{maxsecnumdepth}}
@@ -2295,12 +2323,17 @@
\fi
\else
\cleardoublepage
- \counterwithin{figure}{chapter}
- \counterwithin{table}{chapter}
+ \@memmain@floats
\fi}
\newcommand{\@memmain}{%
\@smemmain\pagenumbering{arabic}}
+\newcommand\@memback@floats{%
+ \counterwithout{figure}{chapter}
+ \counterwithout{table}{chapter}
+ \setcounter{figure}{0}
+ \setcounter{table}{0}
+}
\newcommand{\backmatter}{%
\ifartopt
\clearpage
@@ -2314,10 +2347,7 @@
\@mainmatterfalse
\setcounter{secnumdepth}{-10}
\ifartopt\else
- \counterwithout{figure}{chapter}
- \counterwithout{table}{chapter}
- \setcounter{figure}{0}
- \setcounter{table}{0}
+ \@memback@floats
\fi}
\newcommand*{\theHbook}{\arabic{book}}
@@ -4204,6 +4234,25 @@
{\endlist}
\newcommand*{\blockdescriptionlabel}[1]{%%% \hspace\labelsep
\normalfont\bfseries #1}
+\newenvironment{labelled}[1]%
+ {\list{}{\labelwidth\z@ \itemindent-\leftmargin
+ \def\m@malabel{\@nameuse{#1}} \let\makelabel\m@malabel}}%
+ {\endlist}
+
+\newenvironment{flexlabelled}[6]%
+ {\list{}{\nametest{#2}{*}%
+ \ifsamename\else \labelwidth #2 \fi
+ \nametest{#3}{*}%
+ \ifsamename\else \labelsep #3 \fi
+ \nametest{#4}{*}%
+ \ifsamename\else \itemindent #4 \fi
+ \nametest{#5}{*}%
+ \ifsamename\else \leftmargin #5 \fi
+ \nametest{#6}{*}%
+ \ifsamename\else \rightmargin #6 \fi
+ \def\m@malabel{\@nameuse{#1}} \let\makelabel\m@malabel}}%
+ {\endlist}
+
\newenvironment{quotation}%
{\list{}{\listparindent 1.5em%
\itemindent \listparindent
@@ -5924,23 +5973,27 @@
\parbox{\@contcwidth}{%
\ifdim\wd\@tempboxa<\@contcwidth \centering \fi
\fi
- \if@conthang
- \sbox\@tempboxa{\@contnfont #1\@contdelim}
- \@contpre%
- {\@contcstyle\hangindent=\wd\@tempboxa
- \noindent\box\@tempboxa\@memtempa \@conttfont #2\@contfinal\par}
+ \ifdim\wd\@tempboxa<\linewidth
+ \@contpre
+ {\@contnfont #1\@contdelim}\@memtempa
+ {\@contcshortstyle \@conttfont #2\@contfinal\par}
\else
- \if@contindent
+ \if@conthang
+ \sbox\@tempboxa{\@contnfont #1\@contdelim}
\@contpre%
- {\@contnfont #1\@contdelim}\@memtempa
- {\@contcstyle\hangindent=\@contindw
- \hangafter=\@ne\@conttfont #2\@contfinal\par}% <- v1.4
+ {\@contcstyle\hangindent=\wd\@tempboxa
+ \noindent\box\@tempboxa\@memtempa \@conttfont #2\@contfinal\par}
\else
- \@contpre%
- {\@contnfont #1\@contdelim}\@memtempa
- {\ifdim\wd\@tempboxa<\linewidth
- \@contcshortstyle\else \@contcstyle\fi% <- v1.4
- \@conttfont #2\@contfinal\par}
+ \if@contindent
+ \@contpre%
+ {\@contnfont #1\@contdelim}\@memtempa
+ {\@contcstyle\hangindent=\@contindw
+ \hangafter=\@ne\@conttfont #2\@contfinal\par}% <- v1.4
+ \else
+ \@contpre%
+ {\@contnfont #1\@contdelim}\@memtempa
+ {\@contcstyle \@conttfont #2\@contfinal\par}
+ \fi
\fi
\fi
\@contpost
@@ -6947,13 +7000,26 @@
\newlength{\tocbaseline} \setlength{\tocbaseline}{20pt}
\newcommand{\tocskip}[1]{%
\addtocontents{toc}{\protect\vspace{#1}}}
-\newcommand*{\ensureonecol}{%
- \if@twocolumn
- \@restonecoltrue\onecolumn
- \else
- \@restonecolfalse
- \fi}
-\newcommand*{\restorefromonecol}{\if@restonecol\twocolumn\fi}
+\newcommand*{\onecoltocetc}{%
+ \def\ensureonecol{%
+ \if@twocolumn
+ \@restonecoltrue\onecolumn
+ \else
+ \@restonecolfalse
+ \fi}%
+ \def\restorefromonecol{\if@restonecol\twocolumn\fi}}
+\newcommand*{\twocoltocetc}{%
+ \def\ensureonecol{%
+ \if@twocolumn
+ \@restonecoltrue
+ \else
+ \@restonecolfalse\twocolumn
+ \fi}%
+ \def\restorefromonecol{\if@restonecol\else\onecolumn\fi}}
+\newcommand*{\doccoltocetc}{%
+ \let\ensureonecol\relax
+ \let\restorefromonecol\relax}
+\onecoltocetc
\newlength{\cftparskip}
\setlength{\cftparskip}{0pt}
@@ -7277,7 +7343,7 @@
\newcommand{\cftchapterafterpnum}{}
\newcommand*{\cftchapterformatpnum}[1]{%
\hb@xt@\@pnumwidth{\hfil\cftchapterpagefont #1}}
- \newcommand*{\cftchapterfillnum}[1]{
+ \newcommand*{\cftchapterfillnum}[1]{%
{\cftchapterleader}\nobreak
\cftchapterformatpnum{#1}%
\cftchapterafterpnum\par}
@@ -9527,7 +9593,7 @@
\mem@oldshipout\box\@cclv
\else
\ifshowtrims
- \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
+ \mem@oldshipout\vbox{\trimmarks \ifvbox \@cclv \unvbox \else \box \fi \@cclv}%
\else
\mem@oldshipout\box\@cclv
\fi