summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/memoir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-05-22 23:12:17 +0000
committerKarl Berry <karl@freefriends.org>2013-05-22 23:12:17 +0000
commit8720829c9cba68ab04a8d8e4f0e6e0fd31cabed7 (patch)
treec052f47a41e7ba8b85bba0b2ddcbfe5d5a97402c /Master/texmf-dist/source/latex/memoir
parentdd62e466f5d1dbca765bf38bbaeb50611345fa6a (diff)
memoir (22may13)
git-svn-id: svn://tug.org/texlive/trunk@30639 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/memoir')
-rw-r--r--Master/texmf-dist/source/latex/memoir/memoir.dtx1203
-rw-r--r--Master/texmf-dist/source/latex/memoir/memoir.ins14
-rw-r--r--Master/texmf-dist/source/latex/memoir/mempatch.dtx107
-rw-r--r--Master/texmf-dist/source/latex/memoir/mempatch.ins14
4 files changed, 1090 insertions, 248 deletions
diff --git a/Master/texmf-dist/source/latex/memoir/memoir.dtx b/Master/texmf-dist/source/latex/memoir/memoir.dtx
index 1eee2800c4e..037a064042d 100644
--- a/Master/texmf-dist/source/latex/memoir/memoir.dtx
+++ b/Master/texmf-dist/source/latex/memoir/memoir.dtx
@@ -1,9 +1,10 @@
% \iffalse meta-comment
%
-% memoir.dtx
-% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-% Maintainer: Lars Madsen (daleif+memoir at imf dot au dot dk)
+% memoir.dtx
+% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
+% Maintainer: Lars Madsen (daleif at imf dot au dot dk)
% Copyright 2001--2010 Peter R. Wilson
+% Copyright 2011--2013 Lars Madsen
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -19,7 +20,7 @@
% This work consists of the files listed in the README file.
%
% \fi
-% \CheckSum{30174}
+% \CheckSum{30566}
%
% \changes{v0.1}{2001/05/20}{First public alpha release}
% \changes{v0.2}{2001/06/03}{First beta release}
@@ -106,6 +107,8 @@
% \changes{v3.6h}{2011/02/13}{Various things}
% \changes{v3.6i}{2011/02/18}{Two bug fixes}
% \changes{v3.6j}{2011/03/06}{Bug fixes}
+% \changes{v3.6k}{2013/05/17}{Various fixes and long overdue maintenance}
+% \changes{v3.7}{2013/05/22}{Bumped version}
%
% \def\dtxfile{memoir.dtx}
%
@@ -153,15 +156,17 @@
% \def\fileversion{v3.6h} \def\filedate{2011/02/13}
% \def\fileversion{v3.6i} \def\filedate{2011/02/18}
% \def\fileversion{v3.6j} \def\filedate{2011/03/06}
+% \def\fileversion{v3.6k} \def\filedate{2013/05/17}
+% \def\fileversion{v3.7} \def\filedate{2013/05/22}
% \title{The LaTeX \Lpack{memoir} class for configurable book
% typesetting: Source code\thanks{This
% file (\texttt{\dtxfile}) has version number \fileversion, last revised
% \filedate.}}
%
% \author{%
-% Peter Wilson\thanks{\texttt{herries dot press at earthlink dot net}}\\
+% Peter Wilson\\ ^^A\thanks{\texttt{herries dot press at earthlink dot net}}\\
% Herries Press \\
-% (with the assistance of Lars Madsen)}
+% (maintained by Lars Madsen\thanks{\texttt{daleif at imf dot au dot dk}}\ )}
% \date{\filedate}
% \maketitle
%
@@ -309,7 +314,7 @@
\DeleteShortVerb{\|}
\raggedbottom
\raggedright
-\DocInput{memoir.dtx}
+\DocInput{\jobname.dtx}
\PrintIndex
%% \PrintChanges
\end{document}
@@ -382,7 +387,11 @@
% Announce the name, option files and version for LaTeX2e files:
% \begin{macrocode}
%<class>\ProvidesClass{memoir}%
-%<class> [2011/03/06 v3.6j configurable book, report, article document class]
+%<class> [2013/05/22 v3.7 configurable book, report, article document class]
+% \end{macrocode}
+% In the manual it is useful to know the current version.
+% \begin{macrocode}
+%<class>\newcommand\memversion{v3.7, 2013/05/22}
%<9pt>\ProvidesFile{mem9.clo}%
%<9pt> [2008/01/30 v0.4 memoir class 9pt size option]
%<10pt>\ProvidesFile{mem10.clo}%
@@ -731,6 +740,45 @@
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \changes{v3.6k}{2013/05/14}{Added macro used macros}
+% \begin{macro}{\memsetmacroused}
+% \begin{macro}{\memsetmacrounused}
+% \begin{macro}{\memifmacroused}
+% We may want to make auto adjustment to the layout unless the user
+% has used certain macros (in which case the user is responsible for
+% their own actions). To make this macro test easier, we provide a
+% few utility macros. Their use should be self explanatory. Though
+% note that the macro being marked as used, is given in full, i.e.,
+% \begin{verbatim}
+% \memsetmacroused\setlrmargins
+% \end{verbatim}
+% \begin{macrocode}
+\newcommand\memsetmacroused[1]{%
+ \@namedef{mem@macro@used@\expandafter\@gobble\string#1}{00}}
+\newcommand\memsetmacrounused[1]{%
+ \@namedef{mem@macro@used@\expandafter\@gobble\string#1}{01}}
+\newcommand\memifmacroused[1]{%
+ \if\@nameuse{mem@macro@used@\expandafter\@gobble\string#1}%
+ \expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
+
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\memsetlengthmin}
+% \begin{macro}{\memsetlengthmax}
+% Returns the min or max of two lengths. Note we may alter this in
+% the future to use \cs{dimexpr}.
+% \begin{macrocode}
+\newcommand\memsetlengthmin[3]{\ifdim#2<#3\setlength{#1}{#2}\else\setlength{#1}{#3}\fi}
+\newcommand\memsetlengthmax[3]{\ifdim#2>#3\setlength{#1}{#2}\else\setlength{#1}{#3}\fi}
+
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
%
% \subsection{Classes, Packages and Files}
%
@@ -1617,11 +1665,13 @@
% headers, i.e. the `left' part of the header is typeset as the
% `right' part.
% \changes{v3.6h}{2010/10/22}{Added \cs{mem@RTLmainraggedX} macros}
+% \changes{v3.6k}{2011/06/24}{the \cs{mem@RTLvX} macros should point
+% at \cs{vX} not \cs{X}}
% \begin{macrocode}
\newcommand*{\memRTLleftskip}{\leftskip}
\newcommand*{\memRTLrightskip}{\rightskip}
-\newcommand*{\memRTLvleftskip}{\leftskip}
-\newcommand*{\memRTLvrightskip}{\rightskip}
+\newcommand*{\memRTLvleftskip}{\vleftskip}
+\newcommand*{\memRTLvrightskip}{\vrightskip}
\newcommand*{\memRTLraggedright}{\raggedright}
\newcommand*{\memRTLraggedleft}{\raggedleft}
\newcommand*{\memRTLmainraggedright}{\raggedright}
@@ -4243,8 +4293,10 @@
% \cs{settypeblocksize}\marg{height}\marg{width}\marg{ratio}
% calulates the \cs{textheight} and \cs{textwidth} from two out of the
% three arguments.
+% \changes{v3.6k}{2013/05/14}{Marked \cs{settypeblocksize} as being used}
% \begin{macrocode}
\newcommand{\settypeblocksize}[3]{%
+ \memsetmacroused\settypeblocksize%
\setrectanglesize{#1}{#2}{#3}%
\setlength{\textheight}{\@tempdima}%
\setlength{\textwidth}{\@tempdimb}}
@@ -4273,10 +4325,12 @@
% \cs{setlrmargins}\marg{L}\marg{R}\marg{r} sets the Left (spine)
% and Right (fore edge) margins with constant typeblock.
% \changes{v1.6180339c}{2008/12/29}{Added binding to \cs{setlrmargins}}
+% \changes{v3.6k}{2013/05/14}{Marked \cs{setlrmargins} as being used}
% \begin{macrocode}
\newlength{\spinemargin}
\newlength{\foremargin}
\newcommand{\setlrmargins}[3]{%
+ \memsetmacroused\setlrmargins%
\advance\paperwidth -\binding
\setfillsize{\paperwidth}{\textwidth}{#1}{#2}{#3}%
\setlength{\textwidth}{\@tempdimc}%
@@ -4312,10 +4366,12 @@
% \begin{macro}{\setulmargins}
% \cs{setulmargins}\marg{L}\marg{R}\marg{r} sets the Left (upper)
% and Right (lower) margins with constant typeblock.
+% \changes{v3.6k}{2013/05/14}{Marked \cs{setulmargins} as being used}
% \begin{macrocode}
\newlength{\uppermargin}
\newlength{\lowermargin}
\newcommand{\setulmargins}[3]{%
+ \memsetmacroused\setulmargins%
\setfillsize{\paperheight}{\textheight}{#1}{#2}{#3}%
\setlength{\textheight}{\@tempdimc}%
\setlength{\uppermargin}{\@tempdima}%
@@ -4382,8 +4438,10 @@
% \begin{macro}{\setmarginnotes}
% \cs{setmarginnotes}\marg{sep}\marg{width}\marg{push}
% sets the marginpar parameters.
+% \changes{v3.6k}{2013/05/14}{Marked \cs{setmarginnotes} as being used}
% \begin{macrocode}
\newcommand{\setmarginnotes}[3]{%
+ \memsetmacroused\setmarginnotes%
\setlength{\marginparsep}{#1}%
\setlength{\marginparwidth}{#2}%
\setlength{\marginparpush}{#3}}
@@ -4642,6 +4700,59 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\mem@autoadjust@marginparwidth}
+% This macro implements an algorithm, to automatically adjust
+% \cs{marginparwidth} to the current values of \cs{spinemargin} and
+% \cs{foremargin} (i.e., the inner and outer margins). It may be used
+% within \cs{fixthelayout} in case the user has not changed
+% \cs{marginparwidth} using \cs{setmarginnotes}.
+% \begin{macrocode}
+\newcommand\mem@autoadjust@marginparwidth{%
+ \if@twocolumn
+ \memsetlengthmin\marginparwidth\spinemargin\foremargin
+ \else
+ \if@twoside
+ \ifcase\m@mmpar@margin\relax% 0 - left
+ \memsetlengthmin\marginparwidth\spinemargin\foremargin
+ \or% 1 - right
+ \memsetlengthmin\marginparwidth\spinemargin\foremargin
+ \or% 2 - outer
+ \setlength\marginparwidth{\foremargin}
+ \or% 3 - inner
+ \setlength\marginparwidth{\spinemargin}
+ \fi
+ \else % oneside
+ \ifnum\m@mmpar@margin=0% left
+ \setlength\marginparwidth{\spinemargin}
+ \else% right
+ \setlength\marginparwidth{\foremargin}
+ \fi
+ \fi
+ \fi
+ \addtolength\marginparwidth{-2\marginparsep}
+ \ifdim\marginparwidth<1pt\setlength\marginparwidth{1pt}\fi%
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mem@reset@used@macros}
+% This macro is used to unset used macros. It is a manually
+% maintained macro. A better version would have been to let
+% \cs{memsetmacroused} record its use in a list, and then loop over
+% this list. Maybe some other time.
+% \begin{macrocode}
+\newcommand\mem@reset@used@macros{%
+ \memsetmacrounused\setmarginnotes
+ \memsetmacrounused\settypeblocksize
+ \memsetmacrounused\setulmargins
+ \memsetmacrounused\setlrmargins
+}
+
+% \end{macrocode}
+%
+% \end{macro}
+%
% \begin{macro}{\checkthelayout}
% \cs{checkthelayout}\oarg{text} is the user level macro for
% checking the layout. The \meta{text} argument controls which
@@ -4829,7 +4940,16 @@
% Fix standard page layouts after possible change of \cs{textwidth}.
% \changes{v1.6180339f}{2009/03/16}{Added \cs{fixheaderwidths} to \cs{fixthelayout}}
% \begin{macrocode}
- \fixheaderwidths}
+ \fixheaderwidths
+% \end{macrocode}
+% Autoadjust \cs{marginparwidth} unless the user have used
+% \cs{setmarginnotes}. Plus add a reset of the recordedmacros, just in
+% case \cs{fixthelayout} is being used several times.
+% \changes{v3.6k}{2013/05/15}{Added autoadjust}
+% \begin{macrocode}
+ \memifmacroused\setmarginnotes{}{\mem@autoadjust@marginparwidth}
+ \mem@reset@used@macros
+}
% \end{macrocode}
% \end{macro}
@@ -5676,13 +5796,13 @@
% \begin{macrocode}
\nametest{flushleft}{#2}
\ifsamename
- \@namedef{#1evenhpl}{\relax} \@namedef{#1evenhpr}{\hss}
+ \@namedef{#1evenheadpl}{\relax} \@namedef{#1evenheadpr}{\hss}
\else
\nametest{flushright}{#2}
\ifsamename
- \@namedef{#1evenhpl}{\hss} \@namedef{#1evenhpr}{\relax}
+ \@namedef{#1evenheadpl}{\hss} \@namedef{#1evenheadpr}{\relax}
\else
- \@namedef{#1evenhpl}{\hss} \@namedef{#1evenhpr}{\hss}
+ \@namedef{#1evenheadpl}{\hss} \@namedef{#1evenheadpr}{\hss}
\fi
\fi
% \end{macrocode}
@@ -5690,35 +5810,35 @@
% \begin{macrocode}
\nametest{flushleft}{#3}
\ifsamename
- \@namedef{#1oddhpl}{\relax} \@namedef{#1oddhpr}{\hss}
+ \@namedef{#1oddheadpl}{\relax} \@namedef{#1oddheadpr}{\hss}
\else
\nametest{flushright}{#3}
\ifsamename
- \@namedef{#1oddhpl}{\hss} \@namedef{#1oddhpr}{\relax}
+ \@namedef{#1oddheadpl}{\hss} \@namedef{#1oddheadpr}{\relax}
\else
- \@namedef{#1oddhpl}{\hss} \@namedef{#1oddhpr}{\hss}
+ \@namedef{#1oddheadpl}{\hss} \@namedef{#1oddheadpr}{\hss}
\fi
\fi
\nametest{flushleft}{#4}
\ifsamename
- \@namedef{#1evenfpl}{\relax} \@namedef{#1evenfpr}{\hss}
+ \@namedef{#1evenfootpl}{\relax} \@namedef{#1evenfootpr}{\hss}
\else
\nametest{flushright}{#4}
\ifsamename
- \@namedef{#1evenfpl}{\hss} \@namedef{#1evenfpr}{\relax}
+ \@namedef{#1evenfootpl}{\hss} \@namedef{#1evenfootpr}{\relax}
\else
- \@namedef{#1evenfpl}{\hss} \@namedef{#1evenfpr}{\hss}
+ \@namedef{#1evenfootpl}{\hss} \@namedef{#1evenfootpr}{\hss}
\fi
\fi
\nametest{flushleft}{#5}
\ifsamename
- \@namedef{#1oddfpl}{\relax} \@namedef{#1oddfpr}{\hss}
+ \@namedef{#1oddfootpl}{\relax} \@namedef{#1oddfootpr}{\hss}
\else
\nametest{flushright}{#5}
\ifsamename
- \@namedef{#1oddfpl}{\hss} \@namedef{#1oddfpr}{\relax}
+ \@namedef{#1oddfootpl}{\hss} \@namedef{#1oddfootpr}{\relax}
\else
- \@namedef{#1oddfpl}{\hss} \@namedef{#1oddfpr}{\hss}
+ \@namedef{#1oddfootpl}{\hss} \@namedef{#1oddfootpr}{\hss}
\fi
\fi}
@@ -5870,13 +5990,16 @@
%
% \end{macro}
% \begin{macro}{\mem@ps@HLH}
-% \changes{v3.6d}{201010/06/24}{Factored \cs{makepagestyle}}
+% \changes{v3.6d}{2010/10/06/24}{Factored \cs{makepagestyle}}
% The entries in the header used in \cs{makepagestyle} (below) are
% more or less the same. It depends on \emph{head/foot},
% \emph{odd/even} and a shorter \emph{o/e}. So to make the code more
% maintainable we factor this out into a generator macro. The
% explanation for the code being used is kept below (see
% \cs{makepagestyle}).
+% \changes{v3.6k}{2012/05/31}{Forgot to separate head/foot position into the
+% factorization, propblem reported by Wybo Dekker on
+% http://tex.stackexchange.com/q/56141/3929}
% \begin{macrocode}
\newcommand\mem@ps@HLH[4]{%
% #1 ps name
@@ -5884,7 +6007,7 @@
% #3 odd/even
% #4 odd/even short (o,e)
\@namedef{#1@#3#2}{%
- \@nameuse{#1#3hpl}\hb@xt@\@nameuse{#1#2runwidth}{\m@mhe@dreset%
+ \@nameuse{#1#3#2pl}\hb@xt@\@nameuse{#1#2runwidth}{\m@mhe@dreset%
% \end{macrocode}
% In footers the line goes before the text, so we test and add the
% footline if \texttt{\#2} equals \texttt{foot}.
@@ -5917,9 +6040,11 @@
% \end{macrocode}
% In the header the line goes under the text, so we test and add the
% headline if \texttt{\#2} equals \texttt{head}.
+% \changes{v3.6k}{2012/05/31}{Forgot to separate head/foot position into the
+% factorization}
% \begin{macrocode}
\nametest{#2}{head}\ifsamename\@nameuse{#1#2rule}\fi%
- }}\@nameuse{#1#3hpr}}%
+ }}\@nameuse{#1#3#2pr}}%
% \end{macrocode}
% And end by letting the LaTeX head/foot use our version
% \begin{macrocode}
@@ -6140,11 +6265,12 @@
\makerunningwidth{#1}[\@nameuse{#2footrunwidth}]{\@nameuse{#2headrunwidth}}%
% \end{macrocode}
% Specify the \cs{headposition}.
+% \changes{v3.6k}{2012/05/31}{some macro renaming}
% \begin{macrocode}
- \@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
- \@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
- \@namedef{#1evenhpr}{\@nameuse{#2evenhpr}}%
- \@namedef{#1oddhpr}{\@nameuse{#2oddhpr}}%
+ \@namedef{#1evenheadpl}{\@nameuse{#2evenheadpl}}%
+ \@namedef{#1oddheadpl}{\@nameuse{#2oddheadpl}}%
+ \@namedef{#1evenheadpr}{\@nameuse{#2evenheadpr}}%
+ \@namedef{#1oddheadpr}{\@nameuse{#2oddheadpr}}%
% \end{macrocode}
% Also vertically
% \changes{v1.6180339c}{2008/01/13}{Also copy the vertical positions}
@@ -6154,11 +6280,12 @@
\makeheadfootvposition{#1}{\@nameuse{#2headvplacement}}{\@nameuse{#2footvplacement}}%
% \end{macrocode}
% Specify the feet
+% \changes{v3.6k}{2012/05/31}{some macro renaming}
% \begin{macrocode}
- \@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
- \@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
- \@namedef{#1evenfpr}{\@nameuse{#2evenfpr}}%
- \@namedef{#1oddfpr}{\@nameuse{#2oddfpr}}%
+ \@namedef{#1evenfootpl}{\@nameuse{#2evenfootpl}}%
+ \@namedef{#1oddfootpl}{\@nameuse{#2oddfootpl}}%
+ \@namedef{#1evenfootpr}{\@nameuse{#2evenfootpr}}%
+ \@namedef{#1oddfootpr}{\@nameuse{#2oddfootpr}}%
% \end{macrocode}
% Specify the head and foot rules and the prefixes.
% \changes{v3.6h}{2011/01/25}{Added the \cs{makeheadfootruleprefix}}
@@ -6285,12 +6412,16 @@
% \begin{macro}{\uppercaseheads}
% \begin{macro}{\memUChead}
% Spurred by Lars Madsen's \Lpack{memexsupp} v0.5 package here is a
-% way of switching uppercasing in the headings pagestyle.
+% way of switching uppercasing in the headings pagestyle.
% \changes{v1.61803}{2008/01/30}{Added \cs{(no)uppercaseheads} and
% \cs{memUChead} (mempatch v4.9)}
+% \changes{v3.6k}{2011/05/20}{Making \cs{memUChead} equal to
+% \cs{relax} can cause problems when users want to \cs{provide} it in
+% other applications. It is now redefined into the empty string.}
+% \changes{v3.6k}{2012/09/13}{Default upper case now \cs{MakeTextUppercase}}
% \begin{macrocode}
-\newcommand*{\nouppercaseheads}{\let\memUChead\relax}
-\newcommand*{\uppercaseheads}{\let\memUChead\MakeUppercase}
+\newcommand*{\nouppercaseheads}{\def\memUChead{}}
+\newcommand*{\uppercaseheads}{\def\memUChead{\MakeTextUppercase}}
\uppercaseheads
% \end{macrocode}
@@ -6809,15 +6940,29 @@
% \end{macro}
% \end{macro}
% \end{macro}
-%
+% \begin{macro}{\framepichook}
+% \changes{v3.6k}{2013/05/08}{Added \cs{framepichook}}
+% The two macros \cs{framepichead} and \cs{framepictextfoot} are used
+% to make up the \texttt{showlocs} page style. They are both zero
+% width \texttt{picture} environments. The very first thing in these
+% \texttt{picture} environments, is a call to \cs{framepichook}
+% (empty by default), which could be used to change the color of the
+% frame.
+% \begin{macrocode}
+\newcommand\framepichook{}
+% \end{macrocode}
+%
+% \end{macro}
% \begin{macro}{\framepichead}
% For producing a zero-sized picture of a line at the base of the header.
% It is meant to be used as the left part of the header for a pagestyle.
% \changes{v1.6180339c}{2008/12/28}{Added \cs{framepichead}}
+% \changes{v3.6k}{2013/05/08}{Added \cs{framepichook}}
% \begin{macrocode}
\newcommand*{\framepichead}{%
\ifshowheadfootloc
\begin{picture}(0,0)
+ \framepichook
\unitlength 1pt
\put(0,0){\line(1,0){\strip@pt\textwidth}}
\end{picture}%
@@ -6831,9 +6976,11 @@
% and a frame around the text block. It is meant to be used as the left
% part of a footer for a pagestyle.
% \changes{v1.6180339c}{2008/12/28}{Added \cs{framepictextfoot}}
+% \changes{v3.6k}{2013/05/08}{Added \cs{framepichook}}
% \begin{macrocode}
\newcommand*{\framepictextfoot}{%
\begin{picture}(0,0)
+ \framepichook
\unitlength 1pt
\ifshowheadfootloc
\put(0,0){\line(1,0){\strip@pt\textwidth}}
@@ -7687,13 +7834,17 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{environment}{mem@titlingpage}
% \begin{environment}{titlingpage}
+% \begin{environment}{titlingpage*}
% The \Lenv{titlingpage} environment sets the pagestyle to be \pstyle{titlingpage},
% disables the footnote rule and ensures that the page is single
% column. At the end it switches back to twocolumn if neccessary,
-% and then starts a new page as number 1.
+% and then starts a new page as number 1. On the other hand
+% \Lenv{titlingpage*}, does \emph{not} reset the page counter.
+% \changes{v3.6k}{2012/12/24}{Added \Lenv{titlingpage*} env}
% \begin{macrocode}
-\newenvironment{titlingpage}%
+\newenvironment{mem@titlingpage}%
{\let\footnoterule\relax
\let\footnotesize\small
\if@twocolumn
@@ -7702,16 +7853,26 @@
\@restonecolfalse
\fi
\thispagestyle{titlingpage}%
- \setcounter{page}{\@ne}%
+ \if\mem@titlpg@reset\setcounter{page}{\@ne}\fi%
}{%
\thispagestyle{titlingpage}%
\if@restonecol \twocolumn \fi
\if@twoside \cleardoublepage \else \clearpage \fi
- \setcounter{page}{\@ne}}
+ \if\mem@titlpg@reset\setcounter{page}{\@ne}\fi}
+\newenvironment{titlingpage}{%
+ \def\mem@titlpg@reset{00}%
+ \begin{mem@titlingpage}}{%
+ \end{mem@titlingpage}}
+\newenvironment{titlingpage*}{%
+ \def\mem@titlpg@reset{01}%
+ \begin{mem@titlingpage}}{%
+ \end{mem@titlingpage}}
\aliaspagestyle{titlingpage}{empty}
% \end{macrocode}
% \end{environment}
+% \end{environment}
+% \end{environment}
%
% \begin{macro}{\emptythanks}
% This macro discards all prior \cs{thanks} texts.
@@ -7735,6 +7896,8 @@
% \begin{macro}{\@bsmtitlempty}
% \cs{@bsmtitlempty} is a helper macro to save some macro space.
% It empties some elements of \cs{maketitle}.
+% \changes{v3.6k}{2012/07/01}{Removed \cs{thanksfootextra}, seems to
+% have been forgotten back in 2003.}
% \begin{macrocode}
\newcommand{\@bsmtitlempty}{%
\global\let\maketitle\relax
@@ -7743,7 +7906,6 @@
\global\let\author\relax
\global\let\date\relax
\global\let\thanksmarkseries\relax
- \global\let\thanksheadextra\relax
\global\let\thanksfootextra\relax
\global\let\thanksmark\relax
\global\let\thanksgap\relax}
@@ -7910,7 +8072,7 @@
% To get a normal paragraphed title you can do: \\
% \verb?\renewcommand{\@hangfrom}[1]{#1}? \\
% or as a block paragraph: \\
-% \verb?\renewcommand{\@hangfrom}[1]{\noindent #1}}? \\
+% \verb?\renewcommand{\@hangfrom}[1]{\noindent #1}? \\
%
% \DescribeMacro{\@seccntformat}
% The \cs{@startsection} macro also uses \verb?\@seccntformat{NUM}? to format
@@ -8189,7 +8351,7 @@
% \end{macro}
%
% \begin{macro}{\@memmain@floats}
-% \changes{v1.6180339f}{Added \cs{@memmain@floats}}
+% \changes{v1.6180339f}{}{Added \cs{@memmain@floats}}
% Factoring out the float counter domination, in case someone wants
% something added or changed
% \begin{macrocode}
@@ -8402,16 +8564,27 @@
% \begin{macrocode}
\long\def\@book[#1]#2{%
\M@gettitle{#1}%
+% \end{macrocode}
+% For continuity we store the toc entry in \verb?\f@rtoc? before
+% writing it to the \verb?.toc? file. We also provide a hook to be
+% able to transform it.
+% \changes{v3.6k}{2012/09/18}{Provided \cs{f@rtoc} and hook}
+% \changes{v3.6k}{2013/04/24}{Added \cs{mempreaddbooktotochook} and \cs{mempostaddbooktotochook}}
+% \begin{macrocode}
+ \def\f@rtoc{#1}%
+ \@nameuse{book@f@rtoc@before@write@hook}%
\phantomsection
+ \mempreaddbooktotochook
\ifnum \c@secnumdepth >-3\relax
\refstepcounter{book}%
\addcontentsline{toc}{book}%
- {\protect\booknumberline{\thebook}#1}%
- \membookinfo{\thebook}{#1}{#2}%
+ {\protect\booknumberline{\thebook}\f@rtoc}%
+ \membookinfo{\thebook}{\f@rtoc}{#2}%
\else
- \addcontentsline{toc}{book}{#1}%
- \membookinfo{}{#1}{#2}%
+ \addcontentsline{toc}{book}{\f@rtoc}%
+ \membookinfo{}{\f@rtoc}{#2}%
\fi
+ \mempostaddbooktotochook
% \end{macrocode}
% Empty the marks, center the title on the page, and set the normal font.
% \changes{v3.6j}{2011/03/03}{Set \cs{parskip} to zero, such that a
@@ -8436,6 +8609,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\mempreaddbooktotochook}
+% \begin{macro}{\mempostaddbooktotochook}
+% Hooks executed just before and just after \cs{book} adds something
+% to the ToC. Does nothing by default
+% \begin{macrocode}
+\newcommand\mempreaddbooktotochook{}
+\newcommand\mempostaddbooktotochook{}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@sbook}
% \cs{@sbook}\marg{long} formats the title of a \cs{book*} book. It is
% simpler than \cs{@book} because there is no number to print.
@@ -8625,16 +8810,27 @@
% \begin{macrocode}
\long\def\@part[#1]#2{%
\M@gettitle{#1}%
+% \end{macrocode}
+% For continuity we store the toc entry in \verb?\f@rtoc? before
+% writing it to the \verb?.toc? file. We also provide a hook to be
+% able to transform it.
+% \changes{v3.6k}{2012/09/18}{Provided \cs{f@rtoc} and hook}
+% \changes{v3.6k}{2013/04/24}{Added \cs{mempreaddparttotochook} and \cs{mempostaddparttotochook}}
+% \begin{macrocode}
+ \def\f@rtoc{#1}%
+ \@nameuse{part@f@rtoc@before@write@hook}%
\phantomsection
+ \mempreaddparttotochook
\ifnum \c@secnumdepth >-2\relax
\refstepcounter{part}%
\addcontentsline{toc}{part}%
- {\protect\partnumberline{\thepart}#1}%
- \mempartinfo{\thepart}{#1}{#2}%
+ {\protect\partnumberline{\thepart}\f@rtoc}%
+ \mempartinfo{\thepart}{\f@rtoc}{#2}%
\else
- \addcontentsline{toc}{part}{#1}%
- \mempartinfo{}{#1}{#2}%
+ \addcontentsline{toc}{part}{\f@rtoc}%
+ \mempartinfo{}{\f@rtoc}{#2}%
\fi
+ \mempostaddparttotochook
% \end{macrocode}
% Empty the marks, center the title on the page, and set the normal font.
% \changes{v3.6j}{2011/03/03}{Set \cs{parskip} to zero inside the
@@ -8660,6 +8856,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\mempreaddparttotochook}
+% \begin{macro}{\mempostaddparttotochook}
+% Hooks executed just before and just after \cs{part} adds something
+% to the ToC. Does nothing by default
+% \begin{macrocode}
+\newcommand\mempreaddparttotochook{}
+\newcommand\mempostaddparttotochook{}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@spart}
% \cs{@spart}\marg{long} formats the title of a \cs{part*} part. It is
% simpler than \cs{@part} because there is no number to print.
@@ -8848,7 +9056,7 @@
% \begin{macro}{\ifm@mpn@new@schap}
% \begin{macro}{\m@mpn@new@schapfalse}
% \begin{macro}{\m@mpn@new@schaptrue}
-% These are for supporting the [age/end notes, flagging that a
+% These are for supporting the page/end notes, flagging that a
% \verb?\chapter(*)? has been called.
% \changes{v1.61803}{2008/01/30}{Added \cs{ifm@mpn@new@chap} and
% \cs{ifm@mpn@new@chap} (mempatch v4.5)}
@@ -8931,11 +9139,21 @@
\@afterheading
\fi
% \end{macrocode}
+% When working with \Lpack{hyperref} it is not possible to add, say,
+% upper casing to ToC entries via \cs{cftchapterfont}. We provide a
+% hook, such that users can transform \cs{f@rtoc} before it is
+% actually written to the \texttt{.toc} file.
+% \changes{v3.6k}{2012/09/18}{Added}
+% \begin{macrocode}
+ \@nameuse{chapter@f@rtoc@before@write@hook}%
+% \end{macrocode}
% Vittorio De Martino (\texttt{demartino.vittoria@grtn.it}) on
% 31 March 2003 reported that for articled chapters, which do not do
% any \cs{clearpage}, \cs{addcontents} had to come after the title.
% \changes{v1.4}{2003/11/16}{Changed \cs{@chapter} to match patches v1.n}
+% \changes{v3.6k}{2013/04/24}{Added pretoc and posttoc hooks}
% \begin{macrocode}
+ \mempreaddchaptertotochook%
\ifm@m@And
\ifanappendix
\addcontentsline{toc}{appendix}{%
@@ -8954,18 +9172,61 @@
\memchapinfo{}{\f@rtoc}{\f@rhdr}{#2}%
\fi
\fi
+ \mempostaddchaptertotochook%
% \end{macrocode}
% Add hook for title referencing.
% \changes{v1.4}{2003/11/16}{Added \cs{M@gettitle} to \cs{@chapter}}
+% \changes{v3.6k}{2013/04/24}{Added \cs{memendofchapterhook}}.
+% The hook at the very end can be used to automatically add a new page
+% right after \cs{chapter}.
% \begin{macrocode}
- \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{\f@rtoc}\fi}
+ \ifheadnameref\M@gettitle{\f@rhdr}\else\M@gettitle{\f@rtoc}\fi%
+ \memendofchapterhook%
+}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \begin{macro}{\mempreaddchaptertotochook}
+% \begin{macro}{\mempostaddchaptertotochook}
+% \begin{macro}{\memendofchapterhook}
+% These two hooks are executed before \cs{chapter} adds anything to
+% the TOC and after it does so. It can be used to add hooks into the
+% TOC such that parts can be switched on and off. By default they do nothing.
+% \begin{macrocode}
+\newcommand\mempreaddchaptertotochook{}
+\newcommand\mempostaddchaptertotochook{}
+\newcommand\memendofchapterhook{}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
%
+% \begin{macro}{\settocpreprocessor}
+% \changes{v3.6k}{2012/09/18}{Added}
+% This can be used to set a hook which users can fill in in order to
+% get the toc material preprocessed before writing it to the
+% \verb?.toc? file. The primary use for this is as a workaround when
+% \Lpack{hyperref} is used, and one want to have, say, upper cased toc
+% entries. Example of use
+% \begin{verbatim}
+% \makeatletter
+% \settocpreprocessor{chapter}{%
+% \let\temp@f@rtoc\f@rtoc
+% \def\f@rtoc{\texorpdfstring{\MakeTextUppercase{\temp@f@rtoc}}{\temp@f@rtoc}}
+% }
+% \makeatother
+% \end{verbatim}
+% The idea comes from \url{http://tex.stackexchange.com/q/11892/3929}
+% eliminating the need for patching.
+% \begin{macrocode}
+\newcommand\settocpreprocessor[2]{%
+ \@namedef{#1@f@rtoc@before@write@hook}{#2}}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\@makechapterhead}
% This \emph{really} typesets a \cs{chapter}. Leave some whitespace and prepare to
@@ -9187,20 +9448,20 @@
% \changes{v1.61803}{2008/01/30}{Simplified specification of the default chapterstyle}
% \begin{macrocode}
\makechapterstyle{default}{}%
-%% \setlength{\beforechapskip}{50pt}
-%% \def\chapterheadstart{\vspace*{\beforechapskip}}
-%% \def\chapnamefont{\normalfont\huge\bfseries}
-%% \def\printchaptername{\chapnamefont \@chapapp}
-%% \def\chapternamenum{\space}
-%% \def\chapnumfont{\normalfont\huge\bfseries}
-%% \def\printchapternum{\chapnumfont \thechapter}
-%% \setlength{\midchapskip}{20pt}
-%% \def\afterchapternum{\par\nobreak\vskip \midchapskip}
-%% \def\printchapternonum{}
-%% \def\chaptitlefont{\normalfont\Huge\bfseries}
-%% \def\printchaptertitle##1{\chaptitlefont ##1}
-%% \setlength{\afterchapskip}{40pt}
-%% \def\afterchaptertitle{\par\nobreak\vskip \afterchapskip}}
+ %% \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}
% \end{macrocode}
@@ -9371,6 +9632,7 @@
% \begin{macro}{\chs@bringhurst}
% My bringhurst style.
% \changes{v1.61803398}{2009/07/17}{Added bidi support to bringhurst chapterstyle}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeLowercase} $\to$ \cs{MakeTextLowercase}}
% \begin{macrocode}
\makechapterstyle{bringhurst}{%
\chapterstyle{default}
@@ -9380,8 +9642,8 @@
\renewcommand*{\printchapternum}{}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchaptertitle}[1]{%
-%%% \raggedright\Large\scshape\MakeLowercase{##1}}
- \memRTLraggedright\Large\scshape\MakeLowercase{##1}}
+ %%% \raggedright\Large\scshape\MakeLowercase{##1}}
+ \memRTLraggedright\Large\scshape\MakeTextLowercase{##1}}
\renewcommand*{\afterchaptertitle}{%
\vskip\onelineskip \hrule\vskip\onelineskip}}
@@ -9684,7 +9946,10 @@
% \begin{macro}{\chs@thatcher}
% Original posted to CTT on 2006/01/18 by Scott Thatcher,
% \textit{memoir: chapter headings capitalize math symbols}. I have modified
-% it to cater for multiline titles, appendices, and unnumbered chapters.
+% it to cater for multiline titles, appendices, and unnumbered
+% chapters.
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeLowercase} $\to$ \cs{MakeTextLowercase}}
% \begin{macrocode}
\makechapterstyle{thatcher}{%
\chapterstyle{default}
@@ -9692,7 +9957,7 @@
\renewcommand*{\printchaptername}{%
\centerline{\chapnumfont{\@chapapp\ \thechapter}}}
\renewcommand*{\chapternamenum}{}
- \renewcommand*{\chapnumfont}{\normalfont\scshape\MakeLowercase}
+ \renewcommand*{\chapnumfont}{\normalfont\scshape\MakeTextLowercase}
\renewcommand*{\printchapternum}{}
\renewcommand*{\afterchapternum}{%
\par\centerline{\parbox{0.5in}{\hrulefill}}\par}
@@ -9701,7 +9966,7 @@
\parbox{0.5in}{}\par}
\renewcommand*{\chaptitlefont}{\normalfont\large}
\renewcommand*{\printchaptertitle}[1]{%
- \centering \chaptitlefont\MakeUppercase{##1}}}
+ \centering \chaptitlefont\MakeTextUppercase{##1}}}
% \end{macrocode}
% \end{macro}
@@ -9713,6 +9978,7 @@
% It well suits trimmed documents.
% We are scaling the chapter number, which most DVI viewers
% will not display accurately. It requires the graphicx package.
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
% \begin{macrocode}
\makechapterstyle{veelo}{%
% \chapterstyle{default}
@@ -9723,7 +9989,7 @@
\renewcommand*{\chapnumfont}{\normalfont\HUGE}
\renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\flushright}
\renewcommand*{\printchaptername}{%
- \chapnamefont\MakeUppercase{\@chapapp}}
+ \chapnamefont\MakeTextUppercase{\@chapapp}}
\renewcommand*{\chapternamenum}{}
% \setlength{\numberheight}{18mm}
% \setlength{\barlength}{\paperwidth}
@@ -9899,15 +10165,19 @@
% \begin{macro}{\raggedbottomsectionfalse}
% \begin{macro}{\raggedbottomsection}
% \begin{macro}{\normalbottomsection}
+% \begin{macro}{\bottomsectionpenalty}
% \cs{raggedbottomsectiontrue} for ragged short pages.
% \changes{v1.3}{2002/11/14}{Added \cs{ifraggedbottomsection}}
% \changes{v1.61803}{2008/01/30}{Added \cs{raggedbottomsection} and
% \cs{normalbottomsection}}
+% \changes{v3.6k}{2012/07/22}{Made the \cs{raggedbottomsection}
+% penalty configurable}
% \begin{macrocode}
\newif\ifraggedbottomsection
\raggedbottomsectionfalse
\newcommand*{\raggedbottomsection}{\raggedbottomsectiontrue}
\newcommand*{\normalbottomsection}{\raggedbottomsectionfalse}
+\newcommand*{\bottomsectionpenalty}{\z@}
% \end{macrocode}
% \end{macro}
@@ -9915,6 +10185,7 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\bottomsectionskip}
% Decreasing this length increases short page bottom flushness.
@@ -10003,10 +10274,12 @@
\@nameuse{#1block}%
% \end{macrocode}
% Do raggedbottom stuff.
+% \changes{v3.6k}{2012/07/22}{Made the \cs{raggedbottomsection}
+% penalty configurable}
% \begin{macrocode}
\ifraggedbottomsection\if@nobreak\else
\vskip\z@\@plus\bottomsectionskip
- \penalty\z@
+ \penalty\bottomsectionpenalty
\vskip\z@\@plus -\bottomsectionskip
\fi\fi
% \end{macrocode}
@@ -10954,6 +11227,7 @@
% \begin{macro}{\hds@bringhurst}
% Head styles based on Bringhurst's book
% \changes{v1.61803398}{2009/07/17}{Added bidi support to bringhurst headstyles}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeLowercase} $\to$ \cs{MakeTextLowercase}}
% \begin{macrocode}
\makeheadstyles{bringhurst}{%
% chapter
@@ -10963,7 +11237,7 @@
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
%%% \setsecheadstyle{\normalfont\raggedright\scshape\MakeLowercase}%
- \setsecheadstyle{\normalfont\memRTLraggedright\scshape\MakeLowercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\scshape\MakeTextLowercase}%
% subsection
\setbeforesubsecskip{-1.0\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
@@ -10974,7 +11248,7 @@
\setbeforesubsubsecskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setaftersubsubsecskip{-1em}%
- \setsubsubsecheadstyle{\normalfont\normalsize\scshape\MakeLowercase}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\scshape\MakeTextLowercase}%
% paragraph
\setbeforeparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
@@ -10992,6 +11266,7 @@
%
% \begin{macro}{\hds@crosshead}
% Head styles based on one of Bringhurst's suggestions.
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
% \begin{macrocode}
\makeheadstyles{crosshead}{%
\chapterstyle{crosshead}
@@ -10999,7 +11274,7 @@
\setbeforesecskip{-1.25\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{0.75\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\centering\MakeUppercase}%
+ \setsecheadstyle{\normalfont\centering\MakeTextUppercase}%
% subsection
\setbeforesubsecskip{-1.25\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
@@ -11009,7 +11284,7 @@
\setbeforesubsubsecskip{-.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsubsecskip{.333\onelineskip \@plus 0.1\onelineskip}%
- \setsubsubsecheadstyle{\normalfont\normalsize\centering\scshape\MakeLowercase}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\centering\scshape\MakeTextLowercase}%
% paragraph
\setbeforeparaskip{-.667\onelineskip
\@plus -02.5\onelineskip \@minus -0.25\onelineskip}%
@@ -11020,13 +11295,15 @@
\setbeforesubparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
\setaftersubparaskip{-1em}%
- \setsubparaheadstyle{\normalfont\normalsize\scshape\MakeLowercase}}
+ \setsubparaheadstyle{\normalfont\normalsize\scshape\MakeTextLowercase}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\hds@dowding}
% Head styles based on Dowding's \textit{Finer Points}.
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeLowercase} $\to$ \cs{MakeTextLowercase}}
% \begin{macrocode}
\makeheadstyles{dowding}{%
% chapter
@@ -11035,12 +11312,12 @@
\setbeforesecskip{-2\onelineskip
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
- \setsecheadstyle{\normalfont\centering\MakeUppercase}%
+ \setsecheadstyle{\normalfont\centering\MakeTextUppercase}%
% subsection
\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}%
+ \setsubsecheadstyle{\normalfont\scshape\centering\MakeTextLowercase}%
% subsubsection
\setbeforesubsubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
@@ -11102,12 +11379,13 @@
%
% \begin{macro}{\hds@ntglike}
% Head styles based on the NTG classes (\texttt{boek.cls}).
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
% \begin{macrocode}
\makeheadstyles{ntglike}{%
% part
- \renewcommand*{\partnamefont}{\Large\bfseries\MakeUppercase}%
+ \renewcommand*{\partnamefont}{\Large\bfseries\MakeTextUppercase}%
\renewcommand*{\partnumfont}{\Large\bfseries}%
- \renewcommand*{\parttitlefont}{\Large\MakeUppercase}%
+ \renewcommand*{\parttitlefont}{\Large\MakeTextUppercase}%
% chapter
\chapterstyle{ntglike}
% section
@@ -11141,6 +11419,7 @@
% \begin{macro}{\hds@tandh}
% Head styles based on Thames \& Hudson \textit{Typography}.
% \changes{v1.61803398}{2009/07/17}{Added bidi support to tandh headstyles}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
% \begin{macrocode}
\makeheadstyles{tandh}{%
% chapter
@@ -11150,7 +11429,7 @@
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{1\onelineskip \@plus 0.1\onelineskip}%
%%% \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
- \setsecheadstyle{\normalfont\memRTLraggedright\MakeUppercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\MakeTextUppercase}%
% subsection
\setbeforesubsecskip{-1.2\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
@@ -11181,6 +11460,7 @@
% \begin{macro}{\hds@wilsondob}
% Head styles based on Adrian Wilson's \textit{The Design of Books}.
% \changes{v1.61803398}{2009/07/17}{Added bidi support to wilsondob headstyles}
+% \changes{c3.6k}{2012/09/18}{\cs{MakeUppercase} $\to$ \cs{MakeTextUppercase}}
% \begin{macrocode}
\makeheadstyles{wilsondob}{%
% chapter
@@ -11190,7 +11470,7 @@
\@plus -0.5\onelineskip \@minus -.5\onelineskip}%
\setaftersecskip{0.667\onelineskip \@plus 0.1\onelineskip}%
%%% \setsecheadstyle{\normalfont\raggedright\MakeUppercase}%
- \setsecheadstyle{\normalfont\memRTLraggedright\MakeUppercase}%
+ \setsecheadstyle{\normalfont\memRTLraggedright\MakeTextUppercase}%
% subsection
\setbeforesubsecskip{-0.667\onelineskip
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
@@ -11202,7 +11482,7 @@
\@plus -0.25\onelineskip \@minus -0.25\onelineskip}%
\setaftersubsubsecskip{0.333\onelineskip \@plus 0.1\onelineskip}%
%%% \setsubsubsecheadstyle{\normalfont\normalsize\raggedright\scshape\MakeLowercase}%
- \setsubsubsecheadstyle{\normalfont\normalsize\memRTLraggedright\scshape\MakeLowercase}%
+ \setsubsubsecheadstyle{\normalfont\normalsize\memRTLraggedright\scshape\MakeTextLowercase}%
% paragraph
\setbeforeparaskip{1.0\onelineskip
\@plus 0.5\onelineskip \@minus 0.2\onelineskip}%
@@ -11280,10 +11560,13 @@
%
% \begin{macro}{\@apppage}
% \cs{@apppage} typesets an appendix page and makes an entry in the ToC.
+% \changes{v3.6k}{2013/04/25}{Added \cs{mempre/postaddchaptertotochook}}
% \begin{macrocode}
\def\@apppage{%
\@setuppart
+ \mempreaddapppagetotochook
\addappheadtotoc
+ \mempostaddapppagetotochook
\partmark{\appendixpagename}%
\memapppageinfo{\appendixpagename}%
{\centering
@@ -11293,7 +11576,18 @@
\@endpart}
% \end{macrocode}
% \end{macro}
-%
+% \begin{macro}{\mempreaddapppagetotochook}
+% \begin{macro}{\mempostaddapppagetotochook}
+% Hooks before and after adding something to the ToC. Does nothing
+% by default.
+% \begin{macrocode}
+\newcommand\mempreaddapppagetotochook{}
+\newcommand\mempostaddapppagetotochook{}
+
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\@sapppage}
% \cs{@sapppage} typesets an appendix page and does not make an entry in the ToC.
@@ -11460,12 +11754,13 @@
% \begin{macro}{\@formatsecmark@pp}
% Formats the page header for a redefined \cs{sectionmark}.
% \begin{macrocode}
-\newcommand{\@formatsecmark@pp}[1]{%
- \MakeUppercase{\appendixname\space
- \ifnum \c@secnumdepth >\z@
- \thesection\quad
- \fi
- #1}}
+% unused?
+% \newcommand{\@formatsecmark@pp}[1]{%
+% \MakeUppercase{\appendixname\space
+% \ifnum \c@secnumdepth >\z@
+% \thesection\quad
+% \fi
+% #1}}
% \end{macrocode}
% \end{macro}
%
@@ -14596,7 +14891,7 @@
% insignificant here for most classes.
% \begin{macrocode}
\z@ \@chclass
- \if\@nextchar |\@ne \else
+ \if\@nextchar |\@ne \else%| emacs
\if \@nextchar !6 \else
\if \@nextchar @7 \else
\if \@nextchar <8 \else
@@ -15850,7 +16145,7 @@
% the list \cs{NC@list}.
% \begin{macrocode}
\@ifundefined{NC@find@\NC@char}%
- {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@char
+ {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@char%|emacs
\@memwarn{Redefining primitive column \NC@char}\fi}%
\NC@list\expandafter{\the\NC@list\NC@do#1}}%
{\@memwarn{Column \NC@char\space is already defined}}%
@@ -18437,27 +18732,34 @@
%
% \begin{macro}{\@float}
% \begin{macro}{\@dbfloat}
-% The kernel \cs{@float} and \cs{@dblfloat} macros are redefined to set
-% \cs{ifdonemaincaption} to FALSE, and also to zero the subfloat
-% counter, if it is defined.
-% Ignasi Furi\`{o} reported\footnote{Private email from
-% \texttt{ignasi.furio@uib.es}, 2003/10/17} that floats embedded in text
-% created an extra space. This was caused by a missing \verb?%?.
-% \changes{v1.4}{2003/11/22}{Deleted spaces from \cs{@float} and
-% \cs{@dblfloat} (from patch v1.9)}
+% \begin{macro}{\@memresetsubcounter}
+% The kernel \cs{@float} and \cs{@dblfloat} macros are redefined to
+% set \cs{ifdonemaincaption} to FALSE, and also to zero the subfloat
+% counter, if it is defined. Ignasi Furi\`{o}
+% reported\footnote{Private email from \texttt{ignasi.furio@uib.es},
+% 2003/10/17} that floats embedded in text created an extra
+% space. This was caused by a missing \verb?%?.
+% \changes{v1.4}{2003/11/22}{Deleted spaces from \cs{@float} and
+% \cs{@dblfloat} (from patch v1.9)}
+% Axel Sommerfeldt\footnote{Private email, from axel.sommerfeldt@f-m.fm,
+% 2013/05/10} asked for the subcounter reset to be factored out into
+% a macro and provided the code.
% \begin{macrocode}
\let\@memoldfloat\@float
\renewcommand{\@float}[1]{\donemaincaptionfalse
- \@ifundefined{c@sub#1}{}{\csname c@sub#1\endcsname = 0\relax}%
+ \@memresetsubcounter{#1}%
\@memoldfloat{#1}}
\let\@memolddblfloat\@dblfloat
\renewcommand{\@dblfloat}[1]{\donemaincaptionfalse
- \@ifundefined{c@sub#1}{}{\csname c@sub#1\endcsname = 0\relax}%
+ \@memresetsubcounter{#1}%
\@memolddblfloat{#1}}
+\newcommand{\@memresetsubcounter}[1]{%
+ \@ifundefined{c@sub#1}{}{\csname c@sub#1\endcsname = 0\relax}}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\end@float}
% \begin{macro}{\end@dblfloat}
@@ -18663,7 +18965,7 @@
%
% \begin{macro}{\captiondelim}
% \begin{macro}{\@contdelim}
-% For the caption delimeter.
+% For the caption delimiter.
% \begin{macrocode}
\newcommand{\captiondelim}[1]{\def\@contdelim{#1}}
\captiondelim{: }
@@ -18879,11 +19181,35 @@
% (from patch v1.5)}
% \changes{v1.61803}{2008/01/30}{Added \cs{@contfinal} to \cs{@makecaption}
% (mempatch v4.4)}
+%
+% Axel Sommerfelt\footnote{Private email discussion} suggested to
+% split \cs{@makecaption} into two macros, such that the caption
+% formatting and the space above and below are separate. This enables
+% us to use the formatting macro (\cs{@@makecaption}) to format, say,
+% \Lpack{longtable} captions.
+% \changes{v3.6k}{2013/05/13}{Split \cs{@makecaption} into
+% \cs{@makecaption} and \cs{@@makecaption}}
% \begin{macrocode}
\long\def\@makecaption#1#2{\let\@memtempa\relax
\ifdim\prevdepth>-99\p@ \vskip\abovecaptionskip
\else \def\@memtempa{\vbox to\topskip{}}\fi
% \end{macrocode}
+% Inserting \cs{@@makecaption} to format the actual caption.
+% \begin{macrocode}
+ \@@makecaption{#1}{#2}%
+% \end{macrocode}
+% Then add the below caption spacing.
+% \begin{macrocode}
+ \vskip\belowcaptionskip}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@@makecaption}
+% Next the rest of the caption code as \cs{@@makecaption}.
+% \begin{macrocode}
+\long\def\@@makecaption#1#2{%
+% \end{macrocode}
% \begin{macro}{\@contfnote}
% \begin{macro}{\@contfmark}
% The caption title will be typeset twice, firstly to measure its width
@@ -18900,8 +19226,9 @@
% \end{macro}
% Now measure the width of the total caption, not forgetting to take account
% of the font specifications, and then restore the footnoting.
+% \changes{v3.6k}{2013/05/13}{Font grouping, suggested by Axel Sommerfelt}
% \begin{macrocode}
- \sbox\@tempboxa{\@contnfont #1\@contdelim \@conttfont #2\@contfinal}
+ \sbox\@tempboxa{{\@contnfont #1\@contdelim}\@conttfont #2\@contfinal}
\let\footnote\@contfnote
\let\footnotemark\@contfmark
\let\pagenote\@contpnote
@@ -18971,13 +19298,14 @@
% Finish off the typesetting by processing the post-text, and if not using
% the normal width then close off the \cs{parbox}, and lastly put in some
% vertical space.
+% \changes{v3.6k}{2013/05/13}{Removed the below vertical skip}
% \begin{macrocode}
\@contpost
\if@contcw
\par
} % end of the \parbox
\fi
- \vskip\belowcaptionskip}
+ }
% \end{macrocode}
% \end{macro}
@@ -19657,8 +19985,9 @@
% This is a modified version of the \Lpack{subfigure} \cs{@subfloat}
% command Essentially the \verb?\csname if#1topcap\endcsname? constructs are
% replaced by \cs{if@contbotsub}.
+% \changes{v3.6k}{2011/05/16}{This ought to be long}
% \begin{macrocode}
-\def\@memsubfloat#1[#2][#3]#4{%
+\long\def\@memsubfloat#1[#2][#3]#4{%
\@tempcnta=\@ne
\if@tightsubcap
\if@minipage
@@ -19753,11 +20082,13 @@
%
% \begin{macro}{\@makesubfloatcaption}
% This is a copy of \cs{@makesubfigurecaption}.
+% \changes{v3.6k}{2011/07/21}{Added a \cs{unskip} to remove a space if
+% the text is empty}
% \begin{macrocode}
\newcommand{\@makesubfloatcaption}[2]{%
\setbox\@tempboxa\hbox{%
\@subcapsize
- {\@subcaplabelfont #1}{\@subcapfont\ignorespaces #2}}%
+ {\@subcaplabelfont #1}{\@subcapfont\ignorespaces #2}\unskip}%
\@tempdimb=-\subfloatcapmargin
\multiply\@tempdimb\tw@
\advance\@tempdimb\@tempdima
@@ -19779,6 +20110,8 @@
%
% \begin{macro}{\memsubfig@caption}
% This is a copy of \cs{subfig@caption}.
+% \changes{v3.6k}{2011/07/21}{Added a \cs{unskip} to remove a space if
+% the text is empty}
% \begin{macrocode}
\newcommand{\memsubfig@caption}[2]{%
\if@hangsubcap
@@ -19786,10 +20119,10 @@
\addtolength{\@tempdimb}{-\wd\@tempboxa}%
\usebox{\@tempboxa}%
\memsubfig@captionpar{\@tempdimb}{%
- {\@subcapfont\ignorespaces #2}}%
+ {\@subcapfont\ignorespaces #2}\unskip}%
\else
\memsubfig@captionpar{\@tempdimb}{{\@subcaplabelfont #1}%
- {\@subcapfont\ignorespaces #2}}%
+ {\@subcapfont\ignorespaces #2}\unskip}%
\fi}
% \end{macrocode}
@@ -20219,6 +20552,11 @@
\refstepcounter\@captype
\m@mscaplabel
% \end{macrocode}
+% \changes{v3.6k}{2012/08/19}{We need to move \cs{m@mscapcheckside}
+% here or the \cs{sidecapstyle} inside the box, will never work correctly.}
+% \begin{macrocode}
+ \m@mscapcheckside %<--- added 2012/08/19
+% \end{macrocode}
% Set the caption inside a minipage, saving it in box \cs{m@mscap@capbox}.
% \begin{macrocode}
\begin{lrbox}{\m@mscap@capbox}%
@@ -20244,8 +20582,10 @@
% Set the float (from box \cs{m@mscap@fbox}) then the caption (from
% box \cs{m@mscap@capbox}) kerning it to the left or right as
% appropriate.
+% \changes{v3.6k}{2012/08/19}{Moved \cs{m@mscapcheckside} into
+% \cs{endsidecaption}, otherwise \cs{sidecapstyle} never see the side check}
% \begin{macrocode}
- \usebox{\m@mscap@fbox}\m@mscapcheckside
+ \usebox{\m@mscap@fbox}%\m@mscapcheckside
\ifscapmargleft%
\rlap{\kern-\m@mscaplkern
\raisebox{\m@mscapraise}{\usebox{\m@mscap@capbox}}}%
@@ -20532,8 +20872,44 @@
% \end{macrocode}
% \end{macro}
%
-%
-%
+% \changes{v3.6k}{2013/015/13}{Added \Lpack{longtable} caption
+% support}
+%
+% \subsubsection{Handling \Lpack{longtable} captions}
+%
+% In \Lpack{longtable} the caption ends up as a special row in the
+% table. In order to use our caption formatting we need to redefine
+% \cs{LT@makecaption} to use our formatting macro plus
+% \cs{belowcaptionskip}. It needs to be
+% done after \Lpack{longtable} is loaded, and \emph{not} if the
+% \Lpack{ltcaption} package is loaded. The later is used by the
+% \Lpack{caption} package to aid caption formatting i
+% \Lpack{longtable}. Special thanks to Axel Sommerfelt.
+% \begin{macro}{\LT@makecaption}
+% \begin{macrocode}
+\AtBeginDocument{
+ \@ifpackageloaded{longtable}{
+ \@ifpackageloaded{ltcaption}{}{%
+ \def\LT@makecaption#1#2#3{%
+ \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{%
+ \let\@memtempa\relax%
+ % starred form -> #1 = \@gobble
+ \ifx#1\@gobble%
+ \let\@contnfont\@empty%
+ \let\@contdelim\@empty%
+ \@@makecaption{}{#3}%
+ \else%
+ \@@makecaption{#2}{#3}%
+ \fi%
+ \endgraf\vskip\belowcaptionskip}%
+ \hss}}}
+ }
+ }{}
+}
+% \end{macrocode}
+% At a later point, we will supplement with a \cs{legend} for
+% \Lpack{longtable} as well.
+% \end{macro}
%
% \section{Epigraphs}
%
@@ -21768,6 +22144,33 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\mem@cft@hb@xt@}
+% \begin{macro}{\numberlinebox}
+% \begin{macro}{\partnumberlinebox}
+% \begin{macro}{\chapternumberlinebox}
+% \begin{macro}{\booknumberlinebox}
+% \changes{v3.6k}{2012/07/22}{Added four \cs{Xnumberlinebox} macros}
+% Each of the four \cs{Xnumberline} macros (part, chapter, book and
+% regular) typeset their contents inside a box of a certain width. In
+% order to make this a little more flexible we provide a default box
+% macro. Note that the box left aligned by default. The default
+% \cs{Xnumberlinebox} macros are then let equal to this default.
+% \begin{macrocode}
+\newcommand\mem@cft@hb@xt@[2]{\hb@xt@#1{#2\hfil}}
+\let\numberlinebox\mem@cft@hb@xt@
+\let\partnumberlinebox\mem@cft@hb@xt@
+\let\chapternumberlinebox\mem@cft@hb@xt@
+\let\booknumberlinebox\mem@cft@hb@xt@
+
+% \end{macrocode}
+%
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
% \begin{macro}{\numberline}
% \begin{macro}{\numberlinehook}
% The purpose of the \cs{numberline}\marg{secnum} command is to typeset
@@ -21778,12 +22181,17 @@
% definition).
% \changes{v1.61803398d}{2010/02/13}{added \cs{numberlinehook}}
% We also add a hook, that initially does nothing, but
-% might be redefined to record say withs of \meta{secnum}s.
+% might be redefined to record say withs of \meta{secnum}s. In order
+% to tell the owner of the \cs{numberline}'s apart, check the value of
+% \cs{cftwhatismyname}.
+% \changes{v3.6k}{2012/07/22}{Factored out the box part into a
+% separate macro}
% \begin{macrocode}
\newcommand*\numberlinehook[1]{}
\renewcommand*{\numberline}[1]{%
\numberlinehook{#1}%
- \hb@xt@\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
+ %\hb@xt@\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}
+ \numberlinebox\@tempdima{\@cftn@me\@cftbsnum #1\@cftasnum}\@cftasnumb}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -21895,8 +22303,11 @@
% is in \cs{@tempdima}, and that the three macros \cs{@cftbsnum},
% \cs{@cftaqsnum}, and \cs{@cftasnumb} are defined. We set all these to
% the values for this entry.
+% \changes{v3.6k}{2012/07/30}{Added brace pair around
+% \cs{nameuse\{cft#2name\}}, then
+% \cs{cftXfont} can end with say \cs{MakeUppercase}}
% \begin{macrocode}
- \settowidth{\@tempdima}{\@nameuse{cft#2font}\@nameuse{cft#2name}}%
+ \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
@@ -21911,8 +22322,10 @@
\advance\memRTLleftskip\@tempdima \null\nobreak\hskip -\memRTLleftskip
% \end{macrocode}
% Print the (number and) title, prohibiting any breaking.
+% \changes{v3.6k}{2012/07/29}{Added brace pair around \#\#1, then
+% \cs{cftXfont} can end with say \cs{MakeUppercase}}
% \begin{macrocode}
- {\@nameuse{cft#2font}##1}\nobreak
+ {\@nameuse{cft#2font}{##1}}\nobreak
% \end{macrocode}
% Print the leader and the page number, and then close the group.
% \begin{macrocode}
@@ -22068,6 +22481,7 @@
% (per Lars Henrik Gam Madsen mempatch v5.1)}
% \changes{v1.61803398}{2009/07/18}{Added bidi support to \cs{l@book}}
% \changes{v1.61803398d}{2010/02/13}{added hook into the book numberline}
+% \changes{v3.6k}{2012/07/22}{Factored the general box out of \cs{booknumberline}}
% \begin{macrocode}
\newcommand*{\cftbookbreak}{\addpenalty{-\@highpenalty}%
\addvspace{\cftbeforebookskip}}
@@ -22091,7 +22505,11 @@
\let\@cftasnumb \cftbookaftersnumb
%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
\advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
- {\cftbookfont #1}%
+% \end{macrocode}
+% \changes{v3.6k}{2012/07/29}{Added brace pair around \#1, then
+% \cs{cftbookfont} can end with say \cs{MakeUppercase}}
+% \begin{macrocode}
+ {\cftbookfont {#1}}%
\cftbookfillnum{#2}}
\nobreak
\global\@nobreaktrue
@@ -22101,8 +22519,10 @@
\newcommand*\booknumberlinehook[1]{}
\newcommand{\booknumberline}[1]{%
\booknumberlinehook{#1}%
- \hb@xt@\@tempdima{%
- \cftbookname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
+ % \hb@xt@\@tempdima{%
+ % \cftbookname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
+ \booknumberlinebox\@tempdima{%
+ \cftbookname\@cftbsnum #1\@cftasnum}\@cftasnumb}%%\space}
% \end{macrocode}
% \end{macro}
@@ -22209,7 +22629,11 @@
\let\@cftasnumb \cftpartaftersnumb
%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
\advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
- {\cftpartfont #1}%
+% \end{macrocode}
+% \changes{v3.6k}{2012/07/29}{Added brace pair around \#1, then
+% \cs{cftpartkfont} can end with say \cs{MakeUppercase}}
+% \begin{macrocode}
+ {\cftpartfont {#1}}%
\cftpartfillnum{#2}}
\nobreak
\global\@nobreaktrue
@@ -22238,12 +22662,16 @@
% \changes{v1.61803}{2008/01/30}{Added a space after the number in
% \cs{partnumberline} (mempatch v4.4)}
% \changes{v1.61803398d}{2010/02/13}{added hook into part numberline}
+% \changes{v3.6k}{2012/07/22}{Factored out the box command}
% \begin{macrocode}
\newcommand*\partnumberlinehook[1]{}
\newcommand{\partnumberline}[1]{%
\partnumberlinehook{#1}%
- \hb@xt@\@tempdima{%
- \cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
+ % \hb@xt@\@tempdima{%
+ % \cftpartname\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb}%%\space}
+ \partnumberlinebox\@tempdima{%
+ \cftpartname\@cftbsnum #1\@cftasnum}\@cftasnumb}%%\space}
+
% \end{macrocode}
% \end{macro}
@@ -22351,7 +22779,11 @@
\addtolength{\@tempdima}{\cftchapternumwidth}%
%%% \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
\advance\memRTLleftskip \@tempdima \null\nobreak\hskip -\memRTLleftskip
- {\cftchapterfont #1}\nobreak
+% \end{macrocode}
+% \changes{v3.6k}{2012/07/29}{Added brace pair around \#1, then
+% \cs{cftchapterfont} can end with say \cs{MakeUppercase}}
+% \begin{macrocode}
+ {\cftchapterfont {#1}}\nobreak
\cftchapterfillnum{#2}}
\fi}
@@ -22415,11 +22847,14 @@
% \changes{v1.3}{2002/11/14}{Added \cs{chapternumberline}}
% \changes{v1.618}{2005/09/03}{Added \cs{@chapapp@head} to \cs{chapternumberline} (mempatch v3.12)}
% \changes{v1.61803398d}{2010/02/13}{added hook into chapter numberline}
+% changes{v3.6k}{2012/07/22}{Factored out the box command}
% \begin{macrocode}
\newcommand*\chapternumberlinehook[1]{}
\newcommand{\chapternumberline}[1]{%
\chapternumberlinehook{#1}%
- \hb@xt@\@tempdima{\@chapapp@head\@cftbsnum #1\@cftasnum\hfil}%
+ % \hb@xt@\@tempdima{\@chapapp@head\@cftbsnum #1\@cftasnum\hfil}%
+ % \@cftasnumb}
+ \chapternumberlinebox\@tempdima{\@chapapp@head\@cftbsnum #1\@cftasnum}%
\@cftasnumb}
% \end{macrocode}
@@ -22652,7 +23087,14 @@
\newcommand{\prechapterprecis}{%
\vspace*{\prechapterprecisshift}%
\begin{quote}\precisfont}
-\newcommand*{\postchapterprecis}{\end{quote}}
+% \end{macrocode}
+% \changes{v3.6k}{2013/04/24}{We are missing the after heading
+% stuff. Otherwise text will indent after \cs{chapterprecis}}
+% \begin{macrocode}
+\newcommand*{\postchapterprecis}{%
+ \end{quote}%
+ \par\m@mindentafterchapter%
+ \@afterheading}
% \end{macrocode}
% \end{macro}
@@ -24086,7 +24528,7 @@
\@namedef{memglsact#1}{@}% actual
\@namedef{memglsnx#1}{}% no ref
\@namedef{memglsn#1}{\thepage}% num by page
- \@namedef{memglsnf#1}{|memjustarg}% no special number format
+ \@namedef{memglsnf#1}{|memjustarg}% no special number format | emacs
\if@filesw \expandafter\newwrite\csname #1memglofile\endcsname
\expandafter\immediate\openout \csname #1memglofile\endcsname #1.glo\relax
\typeout{Writing glossary file #1.glo }%
@@ -24566,6 +25008,19 @@
\setmpbools}
% \end{macrocode}
+% \changes{v3.6k}{2013/05/14}{Added default \cs{m@mmpar@margin}}
+% \begin{macrocode}
+\if@twocolumn\else
+ \if@twoside
+ \def\m@mmpar@margin{2}
+ \else
+ \def\m@mmpar@margin{1}
+ \fi
+\fi
+
+% \end{macrocode}
+%
+%
% \end{macro}
% \end{macro}
%
@@ -25394,9 +25849,12 @@
% To prevent the rule from colliding with the footnote we first add
% a little negative vertical skip, then we put the rule and make
% sure we end up at the same point where we begun this operation.
+% \changes{v3.6k}{2013/05/08}{Added \cs{normalcolor}, this seems to
+% fix a color leak into paragraph footnotes.}
% \begin{macrocode}
\renewcommand{\footnoterule}{%
\kern-3\p@
+ \normalcolor% added 2013/05/08
\hrule width .4\columnwidth
\kern 2.6\p@}
% \end{macrocode}
@@ -25526,19 +25984,21 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\mem@multiple@marker}
-% \changes{v3.6h}{2010/12/07}{We copy the code above into a utility
-% macro to be used else where} This code is rather handy, so we
-% make an internal macro to reuse it later (for page notes).
+% \begin{macro}{\mem@pn@multiple@marker}
+% This controls the multiple marker handling for successive page
+% notes, i.e., adding a comma between them.
+% \changes{v3.6k}{2013/05/16}{Added hooks, they are not intended for users}
% \begin{macrocode}
-\newcommand{\mem@multiple@marker}[1]{%
+\newcommand{\mem@pn@multiple@marker}[1]{%
\leavevmode
\ifhmode
\edef\@x@sf{\the\spacefactor}%
\m@mmf@check
\nobreak
\fi
+ \@nameuse{mem@pnmm@start@hook}%
#1%
+ \@nameuse{mem@pnmm@end@hook}%
\m@mmf@prepare
\ifhmode\spacefactor\@x@sf\fi
\relax}
@@ -25798,9 +26258,12 @@
% To force footnotes to the bottom after a \cs{raggedbottom} use \\
% \verb?\setfootnoterule[\vfill]{3pt}{0.4\columnwidth}{\normalrulethickness}?
% \changes{v1.61803}{2008/01/30}{Added \cs{setfootnoterule} (memptatch v4.6)}
+% \changes{v3.6k}{2013/05/08}{Added \cs{normalcolor}, this seems to
+% fix a color leak into paragraph footnotes.}
% \begin{macrocode}
\newcommand*{\setfootnoterule}[4][]{%
\def\footnoterule{\kern -#2\relax #1\relax
+ \normalcolor% added 2013/05/08
\hrule width #3\relax
\kern #2\kern-#4}}
\setfootnoterule{3pt}{0.4\columnwidth}{\normalrulethickness}
@@ -28088,9 +28551,12 @@
% Make sure that this has a useful definition.
% \changes{v3.6h}{2011/01/19}{Made \cs{pagenote} robust}
% \changes{v3.6j}{2011/03/01}{Removed \cs{@sanitize}}
+% \changes{v3.6k}{2011/03/08}{Actually need \cs{@sanitize} for the
+% optional argument. But we need to remove spaces from this}
% \begin{macrocode}
\DeclareRobustCommand\pagenote{\@bsphack\begingroup
- % \@sanitize
+ \rem@special{\ }% <--- added
+ \@sanitize
\m@m@wrpnote}%
% \end{macrocode}
% \end{macro}
@@ -28101,9 +28567,12 @@
% internally be used when the user ask for foot notes to be turned
% into page notes.
% \changes{v3.6j}{2011/03/01}{Removed \cs{@sanitize}}
+% \changes{v3.6k}{2011/03/08}{Actually need \cs{@sanitize} for the
+% optional argument. But we need to remove spaces from this}
% \begin{macrocode}
\DeclareRobustCommand\mem@footto@pagenote{\@bsphack\begingroup
- % \@sanitize
+ \rem@special{\ }% <--- added
+ \@sanitize
\def\mem@pn@step{01}%
\m@m@wrpnote}%
% \end{macrocode}
@@ -28133,15 +28602,23 @@
% \end{macro}
%
% \begin{macro}{\m@m@pnwrite}
+% \begin{macro}{\m@m@pnwrited}
% In the old implementation we used \cs{immediate@protected@write}
% unless the user asked for page numbers in the notes, the new
% implementation use the same writing method for all cases, for easy
-% of notation we collect it in a macro.
+% of notation we collect it in a macro. Seems UTF8 is an interesting
+% beast, \cs{immediate@protected@write} can write it to disk, but
+% \cs{m@m@pnwrite} cannot. To get past this we also include a version
+% that has an embedded \cs{detokenize} (thanks to Heiko Oberdiek for
+% that hint).
+% \changes{v3.6k}{2011/04/06}{Added the version with \cs{detokenize}}
% \begin{macrocode}
\newcommand{\m@m@pnwrite}[3]{\immediate\write#1{#3}}
+\newcommand{\m@m@pnwrited}[3]{\immediate\write#1{\detokenize{#3}}}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\pnchap}
% \begin{macro}{\pnschap}
@@ -28165,7 +28642,7 @@
\newcommand\mem@pn@step{00} % i.e. true
\newlength\mem@pn@lastkern
% \end{macrocode}
-%
+%
% \end{macro}
% \end{macro}
% \end{macro}
@@ -28176,10 +28653,34 @@
% note counter and calls \cs{notenumintext} to handle its appearance in
% the body text. We write an entry of the following design
% \begin{verbatim}
-% \startnoteentry{notenumber}{id}{auto label key}
+% \startnoteentry{notenumber}{id}{auto label key}{hyperref}
% macro:->text
% \endnoteentry
% \end{verbatim}
+%
+% \begin{macro}{\m@m@pnwrite@fourtharg}
+% \begin{macro}{\m@m@pnwrite@fourtharg@hyperref}
+% In order for us to add \Lpack{hyperref} support we will need to
+% record the hyperref anchor label into the page note data. We do this
+% though \verb|\m@m@pnwrite@fourtharg|, which by default just adds
+% \verb|{}| to the page note data. \Lpack{memhfixc} makes it point
+% toward \verb|\m@m@pnwrite@fourtharg@hyperref| instead. We make sure
+% to pass it the optional argument from \verb?\pagenote?, if this is
+% precent a hyper anchor is not passed on.
+% \changes{v3.6k}{2013/05/17}{Macro needs to test an argument}
+% \begin{macrocode}
+\newcommand\m@m@pnwrite@fourtharg[1]{\m@m@pnwrited\@notefile{}{{}}}
+\newcommand\m@m@pnwrite@fourtharg@hyperref[1]{%
+ \@ifmtarg{#1}{%
+ \m@m@pnwrite\@notefile{}{{\Hy@pagenote@currentHref}}%
+ }{%
+ \m@m@pnwrited\@notefile{}{{}}%
+ }}
+
+% \end{macrocode}
+% \end{macro}
+% % \end{macro}
+%
% \changes{v1.61803}{2008/05/25}{Made \cs{m@m@wrpnote} match the effect
% described in memman regarding the optional argument.}
% \changes{v3.6h}{2011/01/19}{Changed the internal implementation}
@@ -28215,7 +28716,7 @@
\ifdim\mem@pn@lastkern=\multiplefootnotemarker%
\m@mmf@prepare% rerun
\fi%
- \mem@multiple@marker{\notenumintext{\thepagenote}}%
+ \mem@pn@multiple@marker{\notenumintext{\thepagenote}}%
}{}%
\fi%
% \end{macrocode}
@@ -28223,42 +28724,52 @@
% in the file.
% \changes{v3.6h}{2011/01/25}{Added \cs{pagenotesubheadstarred}}
% \begin{macrocode}
- \ifm@mpn@new@chap
- \global\m@mpn@new@chapfalse
+ \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
+ \fi%
+ \ifm@mpn@new@schap%
+ \global\m@mpn@new@schapfalse%
\addtonotes{\string\pagenotesubheadstarred{\@chapapp}{}{\pnschap}}%
- \fi
+ \fi%
% \end{macrocode}
% Next we write to the notes file. Instead of writing everything as a
% macro with arguments, we will use three writes. One to start a new
% entry with a few (non-text) arguments, then the text itself, and
-% finally an end of entry marker macro.
+% finally an end of entry marker macro. There is a slight complication
+% here. The \verb|#1| may be UTF8 so it has to be written unexpanded
+% to disk, but macros like \verb|\thepagenote| need to be
+% expanded. Luckily \TeX\ eats up spaces when reading arguments, so we
+% simply writte several lines using two different writing methods.
+% \changes{v3.6k}{2011/04/06}{Rewritten to use a different writing method}
% \begin{macrocode}
\m@m@pnwrite\@notefile{}%
- {\string\startnoteentry{\thepagenote}{#1}%
- {pagenote\thepagenoteshadow-\thesheetsequence}}%
+ {\string\startnoteentry{\thepagenote}}%
+ \m@m@pnwrited\@notefile{}{{#1}}%
+ \m@m@pnwrite\@notefile{}%
+ {{pagenote\thepagenoteshadow-\thesheetsequence}}%
% \end{macrocode}
-% Store the text in a temp macro, change the endline char to force a
-% line break at any space in the text, this also helps with line
-% length limits on inputs. Getting the newline stuff to work require
+% Add the fourth argument.
+% \changes{v3.6k}{2013/05/16}{Added fourth argument for the note data}
+% \changes{v3.6k}{2013/05/17}{Fourth arg, should depend on \#1}
+% \begin{macrocode}
+ \m@m@pnwrite@fourtharg{#1}%
+% \end{macrocode}
+% Getting the newline stuff to work require
% \verb|\immediate\write| which we defined earlier. We then write the
-% text `verbatimly' using the trick that \Lpack{endnotes} makes use
-% of: \cs{meaning}, works quite nicely.
+% text `verbatimly' using the detokenized macro.
+% \changes{v3.6k}{2011/04/06}{No longer any need for the \cs{meaning} construction.}
% \begin{macrocode}
- \def\next{#2}%
\begingroup%
\newlinechar='40%
- \m@m@pnwrite\@notefile{}{\meaning\next}%
+ \m@m@pnwrited\@notefile{}{#2}%
\endgroup%
% \end{macrocode}
% Remember to also write a marker that ends the entry.
% \begin{macrocode}
\m@m@pnwrite\@notefile{}%
{\string\endnoteentry}%
- \endgroup
+ \endgroup%
\@esphack}
% \end{macrocode}
@@ -28329,9 +28840,15 @@
% \begin{macrocode}
\newcommand*{\foottopagenote}{%
\let\memsavefootnote\footnote
- % now also \footnotemark work
+% \end{macrocode}
+% \changes{v3.6k}{2013/05/02}{Remember to remove footnote counter from
+% chapter reset}
+% Since we alias the footnote counter to the pagenote counter, we need
+% to rewmove the footnote counter from the chapter reset, otherwise
+% \cs{continuousnotenums} will be wrong.
+% \begin{macrocode}
+ \counterwithout{footnote}{chapter}
\letcountercounter{footnote}{pagenote}
- % and this takes care of \footnotetext
\renewcommand\footnotetext[2][]{\mem@footto@pagenote{##2}}
\renewcommand{\footnote}[2][]{\pagenote{##2}}
}
@@ -28492,55 +29009,59 @@
%
% \begin{macro}{\startnoteentrystart}
% \begin{macro}{\endnoteentryend}
-% Two utility macros making it easier for the user to change the order.
-% \begin{macrocode}
-\newcommand\startnoteentrystart[3]{%
+% \begin{macro}{\pagenoteanchor}
+% \begin{macro}{\pagenotebyanchor}
+% Utility macros to handle page note formating and hyperlinks.
+% \changes{v3.6k}{2013/05/16}{altered to use four arguments instead of three}
+% \changes{v3.6k}{2013/05/16}{Added page note anchor}
+% \changes{v3.6k}{2013/05/17}{Forgot about labels in the note text.}
+% \begin{macrocode}
+\newcommand\startnoteentrystart[4]{%
\prenoteinnotes%
\noteidinnotes{#1}{#2}%
+ \@ifmtarg{#2}{\def\@currentlabel{#1}}{}%
+ \pagenoteanchor{#4}%
\pageinnotes{#3}%
\prenotetext%
}
\def\endnoteentryend{\postnotetext\postnoteinnotes}
+\let\pagenoteanchor\@gobble
% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\mem@make@gt@safe}
-% Macro copied from \Lpack{endnotes}, in the notes file, the text
-% begins with \verb|macro:->|, but some languages make \verb|>|
-% active. For more information see the \Lpack{endnotes}
-% implementation.
+% The page note hyper anchor should of course only be added when there
+% is an anchor.
+% \changes{v3.6k}{2013/05/17}{Forgot to test the argument}
% \begin{macrocode}
-\newcommand\mem@make@gt@safe{%
- \edef\@tempa{`\string >}%
- \ifnum\catcode\@tempa=12%
- \let\@ResetGT\relax%
- \else%
- \edef\@ResetGT{\noexpand\catcode\@tempa=\the\catcode\@tempa}%
- \@makeother\>%
- \fi%
-}
+\newcommand\pagenotehyperanchor[1]{%
+ \expandafter\@ifmtarg\expandafter{#1}{}{%
+ \Hy@raisedlink{\hyper@@anchor{#1}{\relax}}}}%
+
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\mem@printpagenotes}
% \begin{macro}{\startnoteentry}
% \begin{macro}{\ednoteentry}
% The internal macro for printing the list of page notes. The two
% macros \cs{startnoteentry} and \cs{endnoteentry} are also defined here.
+% \changes{v3.6k}{2011/03/09}{Start and end entry better be long}
+% \changes{v3.6k}{2011/04/06}{We no longer use \cs{meaning} when
+% writing the data to disk, so no need to remove \texttt{>} any
+% more. Also removed the safe GT stuff}
% \begin{macrocode}
+% \changes{v3.6k}{2013/05/16}{\cs{startnoteentry} should expect four args}
\newcommand\mem@printpagenotes[1]{%
\ifmempagenotes
\notedivision
\IfFileExists{\jobname.ent}{%
\begingroup
- \mem@make@gt@safe%
- \def\startnoteentry####1####2####3####4>{%
+ \long\def\startnoteentry####1####2####3####4{%
\begingroup
- \@ResetGT
- \startnoteentrystart{####1}{####2}{####3}%
+ \startnoteentrystart{####1}{####2}{####3}{####4}%
}
- \def\endnoteentry{\endnoteentryend\endgroup}
+ \long\def\endnoteentry{\endnoteentryend\endgroup}
\immediate\closeout\@notefile
\input{\jobname.ent}%
\if#1\immediate\openout\@notefile=\jobname.ent\fi%
@@ -34159,6 +34680,185 @@
% \end{macrocode}
%
+% \subsection{Text case}
+% \changes{v3.6k}{2012/09/13}{Included a copy of the \texttt{textcase}
+% package.}
+%
+% Since, say, \cs{MakeUppercase} does too much, i.e.\ also upper case
+% math and arguments to, say, \cs{ref}, we provide a version that does
+% not. David Carlisle wrote the simple package ---
+% \Lpack{textcase}~\cite{TEXTCASE} which we simply present as a carbon
+% copy including Davids explanations. We do \emph{not} mark this
+% package as have been emulated. Loading \texttt{textcase} just
+% overwrites the macros if they exist.
+%
+% \MakeShortVerb{\|}
+% \begin{macrocode}
+%%%% Nearly a carbon copy from textcase.dtx by David Carlisle
+% \end{macrocode}
+% \begin{macro}{\@uclcnotmath}
+% This is the main macro from \texttt{textcase}. It is basically
+% a copy of |\MakeUppercase| and |\MakeLowercase|
+% from the \LaTeX\ kernel, modified slightly so that they
+% can share code (that modification could be done to the
+% standard versions as well) and then further changed to
+% skip certain features like math mode and |\label| arguments.
+%
+% The arguments are:\\
+% |#1|: Extra commands to apply for case changing.
+% Used to locally redefine |\i| and |\j| for uppercasing.\\
+% |#2|: Either |##1##2| or |##2##1| to control the order
+% in which |\let| is applied to the pairs of control
+% sequences in |\@uclclist|.\\
+% |#3|: |\uppercase| or |\lowercase|.\\
+% |#4|: The text to be upper (or lower) cased.
+% \begin{macrocode}
+\def\@uclcnotmath#1#2#3#4{\begingroup
+% \end{macrocode}
+% Run extra commands (currently just to redefine |\i| and |\j|).
+% \begin{macrocode}
+ #1%
+% \end{macrocode}
+%
+% Locally set |\( \)| to be just |$ $|, so that the math skipping
+% code can be simplified, just to look for |$|.
+% \begin{macrocode}
+ \def\({$}\let\)\(% $ for emacs :-)
+% \end{macrocode}
+%
+% Set up the `non-math' things that also have to be skipped.
+% \begin{macrocode}
+ \def\NoCaseChange##1{\noexpand\NoCaseChange{\noexpand##1}}%
+ \@nonchangecase\label
+ \@nonchangecase\ref
+ \@nonchangecase\ensuremath
+% \end{macrocode}
+%
+% |\cite| a bit trickier, as we want to uppercase any optional argument.
+% This will fail if the optional argument contains a brace group, but
+% should catch most cases.
+%
+% |text \cite[page 1]{foo} more text| ends up as
+%\begin{verbatim}
+% \uppercase{text \toks@{\cite[page1]}%
+% \the\toks@{foo}%
+% \uppercase{ more text}
+%\end{verbatim}
+% \begin{macrocode}
+ \def\cite##1##{\toks@{\noexpand\cite##1}\@citex}%
+ \def\@citex##1{\NoCaseChange{\the\toks@{##1}}}%
+% \end{macrocode}
+% (|\@citex| is a scratch macro here, not a redefinition of the existing
+% |\@citex|.)
+%
+% The following is essentially taken from |\MakeUppercase|.
+% Recursively execute |\reserved@a| to |\let| the pairs in |\@uclclist|.
+% The strange construction with |\@gobble| at the end just gobbles the
+% final recursive call.
+%
+% Incidentally, packages should not use the |\reserved@|\ldots\ scratch
+% macros, which are `reserved' for use within the \LaTeX\ kernel, but
+% (a) this code is essentially a copy from the kernel, and
+% (b) I'm allowed to break the rules, so there.
+% \begin{macrocode}
+ \def\reserved@a##1##2{\let#2\reserved@a}%
+ \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}%
+% \end{macrocode}
+%
+% Expand everything first so that the `skipping' code can see what to
+% skip and so that tokens are revealed to |\uppercase|.
+% This makes the argument `moving'.
+% The |$\valign$| is just a fake math expression used to terminate
+% the parsing done by |\@skipmath|.
+% \begin{macrocode}
+ \protected@edef\reserved@a{\endgroup
+ \noexpand\@skipmath#3#4$\valign$}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \reserved@a}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@nonchangecase}
+% \begin{macrocode}
+\def\@nonchangecase#1{\def#1##1{\NoCaseChange{#1{##1}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\NoCaseChange}
+% For hiding arbitrary text from |\uppercase|. This innocuous
+% definition is used for any occurrence of |\NoCaseChange|
+% in text that is not passed to |\MakeTextUppercase|. For example a
+% section heading may be uppercased, but the toc entry may not.
+% It is also used for nested definitions of |\cite| etc, where the
+% |\NoCaseChange| is inserted by expansion, but not removed as it is
+% hidden by the brace group.
+% \begin{macrocode}
+\let\NoCaseChange\@firstofone
+% \end{macrocode}
+% \end{macro}
+%
+%\begin{macro}{\@skipmath}
+% |#1|: operation |\uppercase| / |\lowercase|\\
+% |#2|: text up to first (next) |$|\\
+% |#3|: first math mode material (or |\valign| sentinel)
+% \begin{macrocode}
+\def\@skipmath#1#2$#3${%
+ \@skip@nonchangecase#1#2\NoCaseChange\valign
+ \ifx\valign#3%
+ \else
+ $#3$%
+ \expandafter\@skipmath\expandafter#1%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+%\begin{macro}{\@skip@nonchangecase}
+% |#1|: |\uppercase| or |\lowercase|\\
+% |#2|: Text up to the first command (such as |\cite|) made `safe'.
+% or the first use of |\NoCaseChange|.
+% \begin{macrocode}
+\def\@skip@nonchangecase#1#2\NoCaseChange#3{%
+ #1{#2}%
+ \ifx\valign#3%
+ \else
+ #3%
+ \expandafter\@skip@nonchangecase\expandafter#1%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTextUppercase}
+% Put it all together. Arrange for \i\ and \j\ to uppercase, and
+% to read the pairs in the ucase list `forwards'.
+% \begin{macrocode}
+\DeclareRobustCommand\MakeTextUppercase{%
+ \@uclcnotmath{\def\i{I}\def\j{J}}{##1##2}\uppercase}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\protected@edef\MakeTextUppercase#1{\MakeTextUppercase{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\MakeTextLowercase}
+% Use |\lowercase| and read the pairs in the uppercase list `backwards'.
+% \begin{macrocode}
+\DeclareRobustCommand\MakeTextLowercase{%
+ \@uclcnotmath{}{##2##1}\lowercase}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\protected@edef\MakeTextLowercase#1{\MakeTextLowercase{#1}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+%%%% End copy from textcase.dtx
+% \end{macrocode}
+% \DeleteShortVerb{\|}
+%
+%
% \section{Initialization} \label{sec:init}
%
% \subsection{Words and phrases}
@@ -34561,7 +35261,12 @@
% \begin{macrocode}
\EmulatedPackage{abstract}[2008/07/23]
\EmulatedPackage{appendix}[2008/07/23]
-\EmulatedPackage{array}[2008/07/23]
+% \end{macrocode}
+% \changes{v3.6k}{2012/07/19}{Changed the enumated date for the
+% \Lpack{array} package. Apparently the only thing changed between
+% v2.4b (2005) and c (2008) are some copyright years.}
+% \begin{macrocode}
+\EmulatedPackage{array}[2008/09/09]
\EmulatedPackage{booktabs}[2008/07/23]
\EmulatedPackage{ccaption}[2008/07/23]
\EmulatedPackage{changepage}[2008/07/23]
@@ -34604,66 +35309,87 @@
%
% \subsection{Interaction with the \Lpack{caption} package}
%
-% Although the author of the \Lpack{caption} package has, over the years,
-% made it work
-% with many other classes he has not extended it to either recognise
-% or work with the memoir
-% class. Some authors want to use the \Lpack{caption} package, hence\ldots
+% Although the author of the \Lpack{caption} package has, over the
+% years, made it work with many other classes he has not extended it
+% to either recognise or work with the memoir class. Some authors want
+% to use the \Lpack{caption} package, hence\ldots
%
-% Kill changes to the caption macros when the \Lpack{caption} package is used.
-% The \Lpack{caption} package checks the definitions of the \cs{@makecaption},
-% \cs{caption} and \cs{@caption} macros. These need to be identical to the
-% definitions in the standard classes for the package to disbelieve that
-% the \Lpack{memoir} class is being used.
+% The easiest manner in which to make the \Lpack{caption} package to
+% work with the class, is to restore the kernel defaults for the main
+% captioning macros.
+%
+% Kill changes to the caption macros when the \Lpack{caption} package
+% is used. The \Lpack{caption} package checks the definitions of the
+% \cs{@makecaption}, \cs{caption} and \cs{@caption} macros. These need
+% to be identical to the definitions in the standard classes for the
+% package to disbelieve that the \Lpack{memoir} class is being used.
%
% \begin{macro}{\@makecaption}
% \begin{macro}{\caption}
% \begin{macro}{\@caption}
% \changes{v1.61803}{2008/01/30}{Killed memoir's captioning when the caption
% package is used (mempatch v4.9).}
+% \changes{v3.6k}{2012/05/04}{Changed the warning text to be more informative.}
% \begin{macrocode}
%%% revert changes to captioning macros if the caption package is used.
\AtBeginPackage{caption}{
-\ClassWarningNoLine{memoir}{%
- You are using the caption package with the memoir \MessageBreak
- class. This may cause unexpected or inconsistent \MessageBreak
- results if you use 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}
+ \ClassWarningNoLine{memoir}{%
+ You are using the caption package with the memoir class.
+ To prepare we will now reset all captioning macros and
+ configurations to kernel defaults, and then let the
+ caption package take over. Please remember to use the
+ caption package interfaces in order to configure
+ your captions.
+ }
-\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\@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}
-\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
+ \def\caption{%
+ \ifx\@captype\@undefined
+ \@latex@error{\noexpand\caption outside float}\@ehd
+ \expandafter\@gobble
+ \else
+ \refstepcounter\@captype
+ \expandafter\@firstofone
\fi
- \normalsize
- \@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##3}\par
- \endgroup}
-}
+ {\@dblarg{\@caption\@captype}}%
+ }
+
+ \long\def\@caption##1[##2]##3{%
+ \par
+ \addcontentsline{\csname ext@##1\endcsname}{##1}%
+ {\protect\numberline{\csname the##1\endcsname}{\ignorespaces ##2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \normalsize
+ \@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##3}\par
+ \endgroup}
+
+% \end{macrocode}
+% By request of the \Lpack{caption} package author (Axel Sommerfeldt),
+% we also restore the caption skips to the kernel defaults. The class
+% sets both to be 0.5\cs{onelineskip}, which may cause confusion when
+% using certain features in the \Lpack{caption} package.
+% \changes{v3.6k}{2012/05/04}{Added \cs{captionXskip} reset to default
+% values.}
+% \begin{macrocode}
+
+ \setlength\abovecaptionskip{10\p@}
+ \setlength\belowcaptionskip{0\p@}
+
+} % end \AtBeginPackage
% \end{macrocode}
% \end{macro}
@@ -34809,10 +35535,17 @@ keyword "\\glossaryentry"
% \bibitem[Car01]{DCOLUMN}
% David Carlisle.
% \newblock \emph{The \Lpack{dcolumn} package}.
-% \newblock May 2001.
+% \newblock May, 2001.
% \newblock (Available from CTAN in
% \texttt{/macros/latex/required/tools})
%
+% \bibitem[Car04]{TEXTCASE}
+% David Carlisle.
+% \newblock \emph{The \Lpack{textcase} package}.
+% \newblock October, 2004.
+% \newblock (Available from CTAN in
+% \texttt{/macros/latex/contrib/textcase})
+%
% \bibitem[Coc02]{SUBFIGURE}
% Steven Douglas Cochran.
% \newblock \emph{The subfigure package}.
diff --git a/Master/texmf-dist/source/latex/memoir/memoir.ins b/Master/texmf-dist/source/latex/memoir/memoir.ins
index 52ffc1fbb83..9cc64652e55 100644
--- a/Master/texmf-dist/source/latex/memoir/memoir.ins
+++ b/Master/texmf-dist/source/latex/memoir/memoir.ins
@@ -1,6 +1,8 @@
%% memoir.ins
%% Author: Peter Wilson (herries dot press at earthlink dot net)
-%% Copyright 2001--2009 Peter R. Wilson
+%% Copyright 2001--2011 Peter R. Wilson
+%% Copyright 2011--2013 Lars Madsen
+%% Maintainer: Lars Madsen (daleif at imf dot au dot dk)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -11,7 +13,7 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2003/06/01 or later.
%%
-%% This work has the LPPL maintenance status "author-maintained".
+%% This work has the LPPL maintenance status "maintained".
%% (Note: Lars Madsen is gradually taking over maintenance)
%%
%% This work consists of the files listed in the README file.
@@ -28,8 +30,11 @@
Author: Peter Wilson (herries dot press at earthlink dot net)
Herries Press
- Copyright 2001--2009 Peter R. Wilson
+ Copyright 2001--2011 Peter R. Wilson
+ Copyright 2011--2013 Lars Madsen
+ Maintainer: Lars Madsen (daleif at imf dot au dot dk)
+
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3 of this license or (at your option) any
@@ -39,8 +44,7 @@
and version 1.3 or later is part of all distributions of
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 has the LPPL maintenance status "maintained".
This work consists of the files listed in the README file.
diff --git a/Master/texmf-dist/source/latex/memoir/mempatch.dtx b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
index 8888e87e972..9af83830b3e 100644
--- a/Master/texmf-dist/source/latex/memoir/mempatch.dtx
+++ b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
@@ -2,7 +2,7 @@
%
% mempatch.dtx
% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-% Maintainer: Lars Madsen (daleif+memoir at imf dot au dot dk)
+% Maintainer: Lars Madsen (daleif at imf dot au dot dk)
% Copyright 2001 --- 2010 Peter R. Wilson
%
% This work may be distributed and/or modified under the
@@ -20,7 +20,7 @@
%
%
% \fi
-% \CheckSum{514}
+% \CheckSum{612}
%
% \def\dtxfile{\texttt{mempatch.dtx}}
% \def\fileversion{v1.0} \def\filedate{2003/10/04}
@@ -309,6 +309,7 @@
%% With thanks to Heiko Oberdiek, if you use hyperref dated 2006/11/15
%% or later, memhfixc will be automatically loaded after hyperref.
%%
+%% Version 1.16 2013/05/16
%% Version 1.15 2010/08/17
%% Version 1.14 2010/06/10
%% Version 1.13 2010/04/19
@@ -330,7 +331,7 @@
%
%
% \begin{macrocode}
-\ProvidesPackage{memhfixc}[2010/08/17 v1.15 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2013/05/16 v1.16 nameref/hyperref package fixes for memoir class]
% \end{macrocode}
%
% \begin{macro}{\M@hfixcfinish}
@@ -798,6 +799,106 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@footnotemark}
+% \changes{v1.16}{2013/05/08}{Slight change to hyperfootnotes redefinition of \cs{@footnotemark}}
+% When \Lpack{hyperref} is loaded with the \texttt{hyperfootnotes}
+% options, then \cs{@footnotemark} is overwritten, and our added
+% feature which automatically separate multiple footnotes with
+% commas is lost. It is however very easy to resurrect.
+% \begin{macrocode}
+\ifHy@hyperfootnotes
+ \def\@footnotemark{%
+ \leavevmode
+ \ifhmode\edef\@x@sf{\the\spacefactor}%
+ \m@mmf@check% <--- added
+ \nobreak\fi
+ \stepcounter{Hfootnote}%
+ \global\let\Hy@saved@currentHref\@currentHref
+ \hyper@makecurrent{Hfootnote}%
+ \global\let\Hy@footnote@currentHref\@currentHref
+ \global\let\@currentHref\Hy@saved@currentHref
+ \hyper@linkstart{link}{\Hy@footnote@currentHref}%
+ \@makefnmark
+ \hyper@linkend
+ \m@mmf@prepare% <--- added
+ \ifhmode\spacefactor\@x@sf\fi
+ \relax
+ }%
+\fi
+
+% \end{macrocode}
+%
+% \end{macro}
+%
+% \changes{v1.16}{2013/05/14}{Added fix for \cs{@starttoc}}
+% \begin{macro}{\@starttoc}
+% In memoir we altered \cs{@starttoc} such that \cs{tableofcontents}
+% could be used multiple times. \Lpack{hyperref} resets this. So here
+% is our reset of that reset.
+% \begin{macrocode}
+\Hy@AtBeginDocument{%
+ \ifx\hyper@last\@undefined
+ \def\@starttoc#1{%
+ \begingroup\makeatletter
+ \IfFileExists{\jobname.#1}{%
+ \Hy@WarningNoLine{%
+ old #1 file detected, not used; run LaTeX again%
+ }%
+ }{}%
+ \if@filesw
+% \end{macrocode}
+% We rewrite this part to match our definition. The rest is a copy
+% from \texttt{hyperref.sty}.
+% \begin{macrocode}
+ \AtEndDocument{%
+ \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
+ \endgroup
+ }%
+ \fi
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \changes{v3.6k}{2013/05/16}{Added hyperref support for page notes}
+% In order to enable hyperlinks for page notes, we need a few extra
+% things. First of all we only enable hyperlinked page noted if hyper
+% footnotes are enabled, seems a good choice.
+% \begin{macrocode}
+\ifHy@hyperfootnotes
+% \end{macrocode}
+% Record the current hyperref anchor in the page note data.
+% \begin{macrocode}
+ \let\m@m@pnwrite@fourtharg\m@m@pnwrite@fourtharg@hyperref
+% \end{macrocode}
+% Make the note typesetter use the anchor data.
+% \begin{macrocode}
+ \let\pagenoteanchor\pagenotehyperanchor
+% \end{macrocode}
+% Fill in two hook responsable for turning the note marker in the text
+% into a hyperlink. The code is more or less copied from
+% \Lpack{hyperref}'s footnote handling.
+% \begin{macrocode}
+ \newcounter{Hpagenote}
+ \@namedef{mem@pnmm@start@hook}{%
+ \stepcounter{Hpagenote}%
+ \global\let\Hy@saved@currentHref\@currentHref
+ \hyper@makecurrent{Hpagenote}%
+ \global\let\Hy@pagenote@currentHref\@currentHref
+ \global\let\@currentHref\Hy@saved@currentHref
+ \hyper@linkstart{link}{\Hy@pagenote@currentHref}%
+ }
+ \@namedef{mem@pnmm@end@hook}{\hyper@linkend}
+\fi
+
+% \end{macrocode}
+%
% The end of the \Lpack{hyperref} related patches.
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/source/latex/memoir/mempatch.ins b/Master/texmf-dist/source/latex/memoir/mempatch.ins
index 593655ba2b8..36a3aed7d63 100644
--- a/Master/texmf-dist/source/latex/memoir/mempatch.ins
+++ b/Master/texmf-dist/source/latex/memoir/mempatch.ins
@@ -1,6 +1,8 @@
%% mempatch.ins
%% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-%% Copyright 2001 --- 2008 Peter R. Wilson
+%% Copyright 2001 --- 2010 Peter R. Wilson
+%% Copyright 2011 --- 2013 Lars Madsen
+%% Maintainer: Lars Madsen (daleif at imf dot au dot dk)
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -11,7 +13,7 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2003/06/01 or later.
%%
-%% This work has the LPPL maintenance status "author-maintained".
+%% This work has the LPPL maintenance status "maintained".
%%
%% This work consists of the files listed in the README file.
%%
@@ -28,8 +30,10 @@
\preamble
Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
- Copyright 2001 --- 2008 Peter R. Wilson
-
+ Copyright 2001 --- 2010 Peter R. Wilson
+ Copyright 2011 --- 2013 Peter R. Wilson
+ Maintainer: Lars Madsen (daleif at imf dot au dot dk)
+
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3 of this license or (at your option) any
@@ -39,7 +43,7 @@
and version 1.3 or later is part of all distributions of
LaTeX version 2003/06/01 or later.
- This work has the LPPL maintenance status "author-maintained".
+ This work has the LPPL maintenance status "maintained".
This work consists of the files listed in the README file.