summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/memoir/README120
-rw-r--r--Master/texmf-dist/source/latex/memoir/memoir.dtx836
-rw-r--r--Master/texmf-dist/source/latex/memoir/memoir.ins1
-rw-r--r--Master/texmf-dist/source/latex/memoir/mempatch.dtx15
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memhfixc.sty6
-rw-r--r--Master/texmf-dist/tex/latex/memoir/memoir.cls384
6 files changed, 1157 insertions, 205 deletions
diff --git a/Master/texmf-dist/doc/latex/memoir/README b/Master/texmf-dist/doc/latex/memoir/README
index 4ffba1fa0cf..c0164884cb8 100644
--- a/Master/texmf-dist/doc/latex/memoir/README
+++ b/Master/texmf-dist/doc/latex/memoir/README
@@ -7,7 +7,7 @@ you create your particular design. The class incorporates over 30 of the
more popular packages.
IF YOU HAVE ANY QUESTIONS PLEASE ASK THEM ON THE COMP.TEXT.TEX NEWSGROUP;
-YOU ARE LIKELY TO GET FASER AND BETTER ANSWERS THAN IF YOU EMAIL ME DIRECTLY
+YOU ARE LIKELY TO GET FASTER AND BETTER ANSWERS THAN IF YOU EMAIL ME DIRECTLY
AS I AM AWAY MORE OFTEN THAN NOT.
NOTE: In order to provide fixes for any problems that may arise
@@ -40,6 +40,120 @@ o Backmatter:
Command glossary ~ 40 pages
Bibliography, indexes ~ 50 pages
+Changes (2009/01/26)
+o Memoir v1.6180339c released with minor bug fixes that could
+ not be done via the patch file, plus some new functionality. The
+ manual has NOT been updated and the changes are noted below.
+
+-- New paper size options: `a0paper', `a1paper', `a2paper', `b0paper',
+ `b1paper', and `b2paper' for A0, A1, A2, B0,B1, and B2 size stock paper.
+
+-- Macro \memoirpostopthook{} which is called after the options are
+ processed but before anything else is done (like setting the page layout).
+ As an example, you may define it as (before the \documentclass}
+ command):
+ \newcommand*{\memoirpostopthook}{%
+ \setlength{\stockwidth}{<wid>}\setlength{\stockheight}{<ht>}}
+ \documentclass[...]{memoir}
+ to specify a stock paper size of <wid> by <ht> that is not provided by the
+ defined options.
+
+-- New `portrait' option (default, the opposite of `landscape').
+
+-- New command \setbinding{<length>} for a binding offset of <length>.
+
+-- New commands: \setpagetm, \setpagetr, \setpagemr, \setpagebr, \setpagebm,
+ \setpagecc to position a (smaller) page on a (larger) stock at the
+ top-middle, top-right, middle-right, bottom-right, bottom-middle, and
+ centered with respect to the stock.
+
+ The macros are to be used instead of \settrimmedsize taking the
+ same arguments.
+
+-- New optional parameter in \makeheadwidth{<style>}[<footerwidth>]{<headerwidth>}
+ to set the width of the <style>'s headers to <headerwidth> and the footers
+ to <headerwidth> or, if given, to <footerwidth>. The two widths can also
+ be set individually using \makerunningheadwidth{<style>}{<length>}
+ and similarly with \makerunningfootwidth. The lengths, if needed
+ are stored in \styleheadrunwidth and \stylefootrunwidth.
+
+-- New `showlocs' pagestyle, which is provided as an example of what can be
+ done to show the positions of headers, footers, and the textblock (lines
+ are drawn showing the header and footer vertical locations and a box is
+ drawn around the text block. It is implemented by two zero-sized pictures:
+ \framepichead which draws a line at the header location, and \framepictextfoot
+ which draws a frame around the textblock and a line at the footer location.
+ Following the declaration \showheadfootlocoff the header/footer lines
+ will not be drawn (\showheadfootlocon turns them on again), and following
+ the \showtextblocklocoff declaration the frame around the text block will
+ not be drawn (\showtextblocklocon turns it on again). If you want a box
+ around your text you could create your own pagestyle using \framepictextfoot
+ and with the showlocs code as a starting point.
+
+-- New command \centerfloat is a version of \centering which centers a wide
+ float or other known width element with respect to the textblock. E.g.,
+ \begin{table} \centerfloat \caption{A wide table} ... \end{table}
+
+-- New command \sourceatright[<length>]{<short text>}. Use at the end of a
+ paragraph to put <short text> flushright. If it is short enough it will
+ go at the end of the last line preceded by at least <length> (default 2em)
+ space, otherwise it is set (flushright) on the following line.
+
+-- New macro \leftspringright{<lfrac>}{<rfrac>}{<ltext>}{<rtext>} sets
+ <ltext> as a flushleft column, width <lfrac> of the textwidth, and <rtext>
+ as a flushright column, width <rfrac> of the textwidth, with
+ (1.0 - <lfrac> - <rfrac>) textwidth space between them. E.g.,
+ \spring{0.4}{0.5}{On the left}{Right stuff}
+
+-- Following the declaration \linenottooshort{<length>} paragraphs will be set:
+ As normal but the last line will not be shorter than <length> (default 4em)
+
+-- Using \russianpar instead of \par to end a paragraph causes it to be set
+ following Russian typographic rules
+
+-- Using \lastlinerulefill instead of \par to end a paragraph will be
+ cause any short line to be filled with a rule (\lastlineparrule) up to
+ the righthand margin.
+
+-- Following the declaration \leftcenterright paragraphs will be set:
+ First line raggedright, the last line raggedleft, and the remainder
+ centered. If you use this shape, set \everypar{} afterwards.
+
+-- Following the declaration \justlastraggedleft paragraphs will be set:
+ All lines normal except the last is raggedleft.
+
+-- Following the declaration \raggedrightthenleft paragraphs will be set:
+ First line raggedright and remainder raggedleft.
+
+-- If you use the above unusual paragraph shapes then using \\ to break
+ a line may give a surprising result. If so, you could try instead
+ \atcentercr (a memoir macro) or \break (a standard LaTeX macro) to see
+ if the result is any better for you. In addition, just in case, memoir
+ stores the original definitions of \\ and \par as \memorigdbs and
+ \memorigpar respectively.
+
+-- \titleref have been extended with a \titleref*, which under
+ hyperref will provide the title but no link. Without hyperref, it
+ is the same as \titleref
+
+-- added hooks around the internals used by sidecaption,
+ sidecontcaption, sidenamedlegend and sidelegend. They do nothing by
+ default but can be used for something like this
+
+ \makeatletter
+ \newenvironment{sidecaption*}{
+ \renewcommand\@mem@scap@beforehook{\checkoddpage\ifoddpage\else\raggedleft\fi}
+ \renewcommand\@mem@scap@afterhook{\par}
+ \begin{sidecaption}}
+ {\end{sidecaption}}
+ \makeatother
+
+ which, if the user has placed the sidecaption on the outside in an
+ twosided layout, then the figure will automatically be pushed
+ towards the spine margin.
+
+
+
Changes (2008/08/23)
o memhfixc v1.10 released to fix problem with tex4ht
o NO CHANGES TO ANYTHING ELSE
@@ -292,7 +406,7 @@ o First public experimental alpha release
-------------------------------------------------------------------
Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
- Copyright 2001--2005 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
@@ -383,6 +497,6 @@ o Print the manual
-2008/08/23
+2009/01/25
Peter Wilson
herries dot press at earthlink dot net
diff --git a/Master/texmf-dist/source/latex/memoir/memoir.dtx b/Master/texmf-dist/source/latex/memoir/memoir.dtx
index 930055df98f..c53f51c29ed 100644
--- a/Master/texmf-dist/source/latex/memoir/memoir.dtx
+++ b/Master/texmf-dist/source/latex/memoir/memoir.dtx
@@ -2,7 +2,7 @@
%
% memoir.dtx
% Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-% 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
@@ -18,7 +18,7 @@
% This work consists of the files listed in the README file.
%
% \fi
-% \CheckSum{27470}
+% \CheckSum{27993}
%
% \changes{v0.1}{2001/05/20}{First public alpha release}
% \changes{v0.2}{2001/06/03}{First beta release}
@@ -69,6 +69,8 @@
% \changes{v1.6180339}{2008/07/23}{Unemulated if... packages}
% \changes{v1.6180339}{2008/07/23}{Folded in all mempatch v5.1 patches}
% \changes{v1.6180339a}{2008/08/07}{Removed extra space in footnotes}
+% \changes{v1.6180339c}{2009/01/21}{Minor bug fixes and extensions}
+% \changes{v1.6180339c}{2009/01/25}{A few more}
%
% \def\dtxfile{memoir.dtx}
%
@@ -95,6 +97,8 @@
% \def\fileversion{v1.618033} \def\filedate{2008/06/02}
% \def\fileversion{v1.6180339} \def\filedate{2008/07/23}
% \def\fileversion{v1.6180339a} \def\filedate{2008/08/07}
+% \def\fileversion{v1.6180339c} \def\filedate{2009/01/21}
+% \def\fileversion{v1.6180339c} \def\filedate{2009/01/25}
% \title{The LaTeX \Lpack{memoir} class for configurable book
% typesetting: Source code\thanks{This
% file (\texttt{\dtxfile}) has version number \fileversion, last revised
@@ -315,7 +319,7 @@
% Announce the name, option files and version for LaTeX2e files:
% \begin{macrocode}
%<class>\ProvidesClass{memoir}%
-%<class> [2008/08/07 v1.6180339a configurable book, report, article document class]
+%<class> [2009/01/25 v1.6180339c configurable book, report, article document class]
%<9pt>\ProvidesFile{mem9.clo}%
%<9pt> [2008/01/30 v0.4 memoir class 9pt size option]
%<10pt>\ProvidesFile{mem10.clo}%
@@ -1041,13 +1045,13 @@
% \changes{v1.61803}{2008/01/30}{Added check for etex (mempatch v4.9)}
% \changes{v1.618033}{2008/06/02}{Improved check for etex}
% \changes{v1.6180339}{2008/07/23}{Use an ifetex package if available}
+% \changes{v1.6180339c}{2008/12/27}{Changed ifetex message from Warning to Info}
% \begin{macrocode}
\newif\ifm@mifetex
\m@mifetexfalse
\IfFileExists{ifetex.sty}{\RequirePackage{ifetex}\relax}{%
- \ClassWarningNoLine{memoir}{%
- If there is an `ifetex' package then it is not installed.\MessageBreak
- The package is being emulated}%
+ \ClassInfo{memoir}{%
+ An `ifetex' package is being emulated}%
\m@mifetextrue
\newif\ifetex
\etexfalse
@@ -1118,12 +1122,14 @@
% perhaps not.
% \changes{v1.61803}{2008/01/30}{Added check for luatex}
% \changes{v1.6180339}{2008/07/23}{Use an ifluatex package if available}
+% \changes{v1.6180339c}{2008/12/31}{It seems that Heiko Oberdiek has created an
+% ifluatex package.}
% \begin{macrocode}
\newif\ifm@mifluatex
\m@mifluatexfalse
\IfFileExists{ifluatex.sty}{\RequirePackage{ifluatex}\relax}{%
\ClassWarningNoLine{memoir}{%
- If there is an `ifluatex' package then it is not installed.\MessageBreak
+ The `ifluatex' package is not installed.\MessageBreak
The package is being emulated}%
\m@mifluatextrue
\newif\ifluatex
@@ -1617,12 +1623,20 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\stockao}
+% \begin{macro}{\stockai}
+% \begin{macro}{\stockaii}
% \begin{macro}{\stockaiii}
% \begin{macro}{\stockaiv}
% \begin{macro}{\stockav}
% \begin{macro}{\stockavi}
-% The A series, A3 --- A6.
+% The A series, A0 --- A6.
+% \changes{v1.6180339c}{2008/12/26}{Extended the A and B stock/paper size
+% seies with A/B0 through A/B2}
% \begin{macrocode}
+\newcommand*{\stockao} {\stockheight=1189mm \stockwidth=841mm}
+\newcommand*{\stockai} {\stockheight=841mm \stockwidth=594mm}
+\newcommand*{\stockaii} {\stockheight=594mm \stockwidth=420mm}
\newcommand*{\stockaiii}{\stockheight=420mm \stockwidth=297mm}
\newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm}
\newcommand*{\stockav} {\stockheight=210mm \stockwidth=148mm}
@@ -1633,13 +1647,22 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
+% \begin{macro}{\stockbo}
+% \begin{macro}{\stockbi}
+% \begin{macro}{\stockbii}
% \begin{macro}{\stockbiii}
% \begin{macro}{\stockbiv}
% \begin{macro}{\stockbv}
% \begin{macro}{\stockbvi}
-% The B series, B3 --- B6.
+% The B series, B0 --- B6.
% \begin{macrocode}
+\newcommand*{\stockbo} {\stockheight=1414mm \stockwidth=1000mm}
+\newcommand*{\stockbi} {\stockheight=1000mm \stockwidth=707mm}
+\newcommand*{\stockbii} {\stockheight=707mm \stockwidth=500mm}
\newcommand*{\stockbiii}{\stockheight=500mm \stockwidth=353mm}
\newcommand*{\stockbiv} {\stockheight=353mm \stockwidth=250mm}
\newcommand*{\stockbv} {\stockheight=250mm \stockwidth=176mm}
@@ -1650,6 +1673,9 @@
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% It will be useful also to provide macros that set the page sizes.
%
@@ -1661,16 +1687,19 @@
% \begin{macro}{\pagelegal}
% \begin{macro}{\pageledger}
% \begin{macro}{\pagebroadsheet}
+% \changes{v1.6180339c}{\cs{pageheight} and \cs{pagewidth} should be
+% \cs{paperheight} and \cs{paperwidth}
+% (courtesy Wilhelm Muller)}
% US page sizes.
% \begin{macrocode}
-\newcommand*{\pagedbill} {\pageheight=7in \pagewidth=3in}
-\newcommand*{\pagestatement} {\pageheight=8.5in \pagewidth=5.5in}
-\newcommand*{\pageexecutive} {\pageheight=10.5in \pagewidth=7.25in}
-\newcommand*{\pageletter} {\pageheight=11in \pagewidth=8.5in}
-\newcommand*{\pageold} {\pageheight=12in \pagewidth=9in}
-\newcommand*{\pagelegal} {\pageheight=14in \pagewidth=8.5in}
-\newcommand*{\pageledger} {\pageheight=17in \pagewidth=11in}
-\newcommand*{\pagebroadsheet}{\pageheight=22in \pagewidth=17in}
+\newcommand*{\pagedbill} {\paperheight=7in \paperwidth=3in}
+\newcommand*{\pagestatement} {\paperheight=8.5in \paperwidth=5.5in}
+\newcommand*{\pageexecutive} {\paperheight=10.5in \paperwidth=7.25in}
+\newcommand*{\pageletter} {\paperheight=11in \paperwidth=8.5in}
+\newcommand*{\pageold} {\paperheight=12in \paperwidth=9in}
+\newcommand*{\pagelegal} {\paperheight=14in \paperwidth=8.5in}
+\newcommand*{\pageledger} {\paperheight=17in \paperwidth=11in}
+\newcommand*{\pagebroadsheet}{\paperheight=22in \paperwidth=17in}
% \end{macrocode}
% \end{macro}
@@ -1691,13 +1720,13 @@
% \begin{macro}{\pagesmalldemyvo}
% British traditional page sizes, octavo.
% \begin{macrocode}
-\newcommand*{\pagepottvo} {\pageheight=6.25in \pagewidth=4in}
-\newcommand*{\pagefoolscapvo} {\pageheight=6.75in \pagewidth=4.25in}
-\newcommand*{\pagecrownvo} {\pageheight=7.5in \pagewidth=5in}
-\newcommand*{\pagepostvo} {\pageheight=8in \pagewidth=5in}
-\newcommand*{\pagelargecrownvo}{\pageheight=8in \pagewidth=5.25in}
-\newcommand*{\pagelargepostvo} {\pageheight=8.25in \pagewidth=5.25in}
-\newcommand*{\pagesmalldemyvo} {\pageheight=8.5in \pagewidth=5.675in}
+\newcommand*{\pagepottvo} {\paperheight=6.25in \paperwidth=4in}
+\newcommand*{\pagefoolscapvo} {\paperheight=6.75in \paperwidth=4.25in}
+\newcommand*{\pagecrownvo} {\paperheight=7.5in \paperwidth=5in}
+\newcommand*{\pagepostvo} {\paperheight=8in \paperwidth=5in}
+\newcommand*{\pagelargecrownvo}{\paperheight=8in \paperwidth=5.25in}
+\newcommand*{\pagelargepostvo} {\paperheight=8.25in \paperwidth=5.25in}
+\newcommand*{\pagesmalldemyvo} {\paperheight=8.5in \paperwidth=5.675in}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1714,12 +1743,12 @@
% \begin{macro}{\pagesuperroyalvo}
% \begin{macro}{\pageimperialvo}
% \begin{macrocode}
-\newcommand*{\pagedemyvo} {\pageheight=8.75in \pagewidth=5.675in}
-\newcommand*{\pagemediumvo} {\pageheight=9in \pagewidth=5.75in}
-\newcommand*{\pagesmallroyalvo}{\pageheight=9.25in \pagewidth=6.175in}
-\newcommand*{\pageroyalvo} {\pageheight=10in \pagewidth=6.25in}
-\newcommand*{\pagesuperroyalvo}{\pageheight=10.25in \pagewidth=6.75in}
-\newcommand*{\pageimperialvo} {\pageheight=11in \pagewidth=7.5in}
+\newcommand*{\pagedemyvo} {\paperheight=8.75in \paperwidth=5.675in}
+\newcommand*{\pagemediumvo} {\paperheight=9in \paperwidth=5.75in}
+\newcommand*{\pagesmallroyalvo}{\paperheight=9.25in \paperwidth=6.175in}
+\newcommand*{\pageroyalvo} {\paperheight=10in \paperwidth=6.25in}
+\newcommand*{\pagesuperroyalvo}{\paperheight=10.25in \paperwidth=6.75in}
+\newcommand*{\pageimperialvo} {\paperheight=11in \paperwidth=7.5in}
% \end{macrocode}
% \end{macro}
@@ -1736,10 +1765,10 @@
% \begin{macro}{\pagemsmallroyalvo}
% Metric sizes.
% \begin{macrocode}
-\newcommand*{\pagemcrownvo} {\pageheight=186mm \pagewidth=123mm}
-\newcommand*{\pagemlargecrownvo} {\pageheight=198mm \pagewidth=129mm}
-\newcommand*{\pagemdemyvo} {\pageheight=216mm \pagewidth=138mm}
-\newcommand*{\pagemsmallroyalvo} {\pageheight=234mm \pagewidth=156mm}
+\newcommand*{\pagemcrownvo} {\paperheight=186mm \paperwidth=123mm}
+\newcommand*{\pagemlargecrownvo} {\paperheight=198mm \paperwidth=129mm}
+\newcommand*{\pagemdemyvo} {\paperheight=216mm \paperwidth=138mm}
+\newcommand*{\pagemsmallroyalvo} {\paperheight=234mm \paperwidth=156mm}
% \end{macrocode}
% \end{macro}
@@ -1747,48 +1776,74 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\pageao}
+% \begin{macro}{\pageai}
+% \begin{macro}{\pageaii}
% \begin{macro}{\pageaiii}
% \begin{macro}{\pageaiv}
% \begin{macro}{\pageav}
% \begin{macro}{\pageavi}
-% The A series, A3 --- A6.
+% The A series, A0 --- A6.
% \begin{macrocode}
-\newcommand*{\pageaiii}{\pageheight=420mm \pagewidth=297mm}
-\newcommand*{\pageaiv} {\pageheight=297mm \pagewidth=210mm}
-\newcommand*{\pageav} {\pageheight=210mm \pagewidth=148mm}
-\newcommand*{\pageavi} {\pageheight=148mm \pagewidth=105mm}
+\newcommand*{\pageao} {\paperheight=1189mm \paperwidth=841mm}
+\newcommand*{\pageai} {\paperheight=841mm \paperwidth=594mm}
+\newcommand*{\pageaii} {\paperheight=594mm \paperwidth=420mm}
+\newcommand*{\pageaiii}{\paperheight=420mm \paperwidth=297mm}
+\newcommand*{\pageaiv} {\paperheight=297mm \paperwidth=210mm}
+\newcommand*{\pageav} {\paperheight=210mm \paperwidth=148mm}
+\newcommand*{\pageavi} {\paperheight=148mm \paperwidth=105mm}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
+% \begin{macro}{\pagebo}
+% \begin{macro}{\pagebi}
+% \begin{macro}{\pagebii}
% \begin{macro}{\pagebiii}
% \begin{macro}{\pagebiv}
% \begin{macro}{\pagebv}
% \begin{macro}{\pagebvi}
-% The B series, B3 --- B6.
+% The B series, B0 --- B6.
% \begin{macrocode}
-\newcommand*{\pagebiii}{\pageheight=500mm \pagewidth=353mm}
-\newcommand*{\pagebiv} {\pageheight=353mm \pagewidth=250mm}
-\newcommand*{\pagebv} {\pageheight=250mm \pagewidth=176mm}
-\newcommand*{\pagebvi} {\pageheight=176mm \pagewidth=125mm}
+\newcommand*{\pagebo} {\paperheight=1414mm \paperwidth=1000mm}
+\newcommand*{\pagebi} {\paperheight=1000mm \paperwidth=707mm}
+\newcommand*{\pagebii} {\paperheight=707mm \paperwidth=500mm}
+\newcommand*{\pagebiii}{\paperheight=500mm \paperwidth=353mm}
+\newcommand*{\pagebiv} {\paperheight=353mm \paperwidth=250mm}
+\newcommand*{\pagebv} {\paperheight=250mm \paperwidth=176mm}
+\newcommand*{\pagebvi} {\paperheight=176mm \paperwidth=125mm}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% Declare the stock size options.
%
% Metric paper stock sizes.
+% \changes{v1.6180339c}{2008/12/26}{Extended class options to include stock
+% sizes A0, A1, A2, B0, B1 and B2}
% \begin{macrocode}
+\DeclareOption{a0paper}{\stockao}
+\DeclareOption{a1paper}{\stockai}
+\DeclareOption{a2paper}{\stockaii}
\DeclareOption{a3paper}{\stockaiii}
\DeclareOption{a4paper}{\stockaiv}
\DeclareOption{a5paper}{\stockav}
\DeclareOption{a6paper}{\stockavi}
+\DeclareOption{b0paper}{\stockbo}
+\DeclareOption{b1paper}{\stockbi}
+\DeclareOption{b2paper}{\stockbii}
\DeclareOption{b3paper}{\stockbiii}
\DeclareOption{b4paper}{\stockbiv}
\DeclareOption{b5paper}{\stockbv}
@@ -1838,12 +1893,24 @@
%
% The \Lopt{landscape} option switches the values of the height and width,
% assuming that the dimensions were originally given for portrait
-% orientation.
+% orientation. (At the suggestion of Wilhelm M\"{u}ller made this independent
+% of the option sequence).
+% \changes{v1.6180339c}{2008/12/26}{`Stabilised' the landscape option and
+% added a portrait option}.
+% \begin{macro}{\ifmemlandscape}
+% \begin{macro}{\memlandscapetrue}
+% \begin{macro}{\memlandscapefalse}
% \begin{macrocode}
-\DeclareOption{landscape}
- {\setlength\@tempdima {\stockheight}
- \setlength\stockheight{\stockwidth}
- \setlength\stockwidth {\@tempdima}}
+\newif\ifmemlandscape
+ \memlandscapefalse
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macrocode}
+\DeclareOption{landscape}{\memlandscapetrue}
+\DeclareOption{portrait}{\memlandscapefalse}
% \end{macrocode}
%
@@ -2109,7 +2176,8 @@
% Here we execute the default options to initialize certain
% variables.
% \begin{macrocode}
-\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside}
+\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside,
+ portrait}
% \end{macrocode}
%
% The \cs{ProcessOptions} command causes the execution of the code
@@ -2120,8 +2188,19 @@
% which is not declared, the option is assumed to be a global option.
% All options will be passed as document options to any
% \cs{usepackage} command in the document preamble.
-% \begin{macrocode}
-\ProcessOptions
+%
+% \cs{ProcessOptions*} processes the options in the order they are given
+% in the \cs{documentclass} command, instead of the definition order.
+% \changes{v1.6180339c}{2008/12/26}{Change \cs{ProcessOptions} to
+% \cs{ProcessOptions*} and handle landscape/portrait
+% option after \cs{ProcessOptions*}}
+% \begin{macrocode}
+\ProcessOptions*
+ \ifmemlandscape
+ \setlength\@tempdima {\stockheight}
+ \setlength\stockheight{\stockwidth}
+ \setlength\stockwidth {\@tempdima}
+ \fi
% \end{macrocode}
%
@@ -3985,19 +4064,38 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\binding}
+% \begin{macro}{\setbinding}
+% The length \cs{binding} is an allowance on the spine margin for
+% binding. \cs{setbinding}\marg{length} sets the \cs{binding}.
+% \changes{v1.6180339c}{2008/12/29}{Added binding offset code to the
+% layout functions}
+% \begin{macrocode}
+\newlength{\binding}
+\newcommand*{\setbinding}[1]{\setlength{\binding}{#1}}
+ \setbinding{0pt}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\spinemargin}
% \begin{macro}{\foremargin}
% \begin{macro}{\setlrmargins}
% \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}}
% \begin{macrocode}
\newlength{\spinemargin}
\newlength{\foremargin}
\newcommand{\setlrmargins}[3]{%
+ \advance\paperwidth -\binding
\setfillsize{\paperwidth}{\textwidth}{#1}{#2}{#3}%
\setlength{\textwidth}{\@tempdimc}%
\setlength{\spinemargin}{\@tempdima}%
- \setlength{\foremargin}{\@tempdimb}}
+ \setlength{\foremargin}{\@tempdimb}%
+ \advance\paperwidth \binding
+ \advance\spinemargin \binding}
% \end{macrocode}
% \end{macro}
@@ -4007,12 +4105,16 @@
% \begin{macro}{\setlrmarginsandblock}
% \cs{setlrmarginsandblock}\marg{L}\marg{R}\marg{r} sets the Left (spine)
% and Right (fore edge) margins with variable typeblock.
+% \changes{v1.6180339c}{2008/12/29}{Added binding to \cs{setlrmarginsandblock}}
% \begin{macrocode}
\newcommand{\setlrmarginsandblock}[3]{%
+ \advance\paperwidth -\binding
\setfillsize{\paperwidth}{*}{#1}{#2}{#3}%
\setlength{\textwidth}{\@tempdimc}%
\setlength{\spinemargin}{\@tempdima}%
- \setlength{\foremargin}{\@tempdimb}}
+ \setlength{\foremargin}{\@tempdimb}%
+ \advance\paperwidth \binding
+ \advance\spinemargin \binding}
% \end{macrocode}
% \end{macro}
@@ -4757,18 +4859,20 @@
% \begin{macro}{\setpagebl}
% \begin{macro}{\setpageml}
% \begin{macro}{\setpagetl}
+% \begin{macro}{\setpagetm}
% \cs{setpagebl}\marg{height}\marg{width}\marg{ratio} sets a page smaller than
% the stock size at the bottom left of the stock. The arguments are the
% the same as for \cs{settrimmedsize};
% \meta{height}, \meta{width} and \meta{ratio} of height and width
% (choose any two) of the desired page size. The trims are adjusted to suit.
-% \cs{setpagetl} puts the page at the top left, and \cs{setpageml} at the
-% middle left.
+% \cs{setpagetl} puts the page at the top left, \cs{setpageml} at the
+% middle left, and \cs{setpagetm} at the top middle.
% \changes{v1.61803}{2008/01/30}{Added \cs{setpagebl}, \cs{setpageml}, and
% \cs{setpagetl}}
+% \changes{v1.6180339c}{2008/12/26}{Added \cs{setpagetm}}
% \begin{macrocode}
\newcommand*{\setpagebl}[3]{%
- \settrimmedsize{#1}{#2}{#3}
+ \settrimmedsize{#1}{#2}{#3}%
\trimtop=\stockheight \advance\trimtop -\paperheight
\trimedge=\stockwidth \advance\trimedge -\paperwidth}
\newcommand*{\setpageml}[3]{%
@@ -4780,11 +4884,60 @@
\settrimmedsize{#1}{#2}{#3}
\trimtop=0pt
\trimedge=\stockwidth \advance\trimedge -\paperwidth}
+\newcommand*{\setpagetm}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=0pt
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\setpagetr}
+% \begin{macro}{\setpagemr}
+% \begin{macro}{\setpagebr}
+% \begin{macro}{\setpagebm}
+% \begin{macro}{\setpagecc}
+% Similar to those above, these macros set the page on the stock
+% at the top right, middle right, bottom right, bottom middle, and centered.
+% \changes{v1.6180339c}{2008/12/26}{Added \cs{setpagetr}, \cs{setpagemr}, \cs{setpagebr},
+% \cs{setpagebm} and \cs{setpagecc}}
+% \begin{macrocode}
+\newcommand*{\setpagetr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=0pt
+ \trimedge=0pt}
+\newcommand*{\setpagemr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \advance\trimtop -0.5\trimtop
+ \trimedge=0pt}
+\newcommand*{\setpagebr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \trimedge=0pt}
+\newcommand*{\setpagebm}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
+\newcommand*{\setpagecc}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \advance\trimtop -0.5\trimtop
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
+%
%
%
% \subsection{Float placement parameters}
@@ -4969,7 +5122,7 @@
% The command
% \cs{makeevenhead}\marg{style}\marg{left}\marg{center}\marg{right}
% specifies that the left, center and right portions of the even header for
-% pagestyle \meta{style} are defined as the other thre arguments, respectiveley.
+% pagestyle \meta{style} are defined as the other three arguments, respectiveley.
% Internally it defines the commands \cs{styleeheadl}, \cs{styleeheadc} and
% \cs{styleeheadr} to be \meta{left}, \meta{center} and \meta{right} respectively.
% \begin{macrocode}
@@ -5009,13 +5162,57 @@
% \end{macro}
%
% \begin{macro}{\makerunningwidth}
-% The macro \cs{makerunningwidth}\marg{style}\marg{length} sets the
-% width of the headers and footers of pagestyle \meta{style} to be \meta{length}.
-% \begin{macrocode}
-\newcommand{\makerunningwidth}[2]{%
- \@namedef{#1runwidth}{#2}}
+% \begin{macro}{\makerunningheadwidth}
+% \begin{macro}{\makerunningfootwidth}
+% \begin{macro}{\m@mhfstyle}
+% \begin{macro}{\m@mopthfwidth}
+% The macro \cs{makerunningwidth}\marg{style}\oarg{ftlength}\marg{length}
+% sets the
+% width of the headers and footers of pagestyle \meta{style} to
+% be \meta{length}, but if \meta{ftlength} is present the footer
+% width is set to \meta{ftlength}. The lengths are stored as the
+% macros \cs{styleheadrunwidth} and \cs{stylefootrunwidth}. The two
+% widths can be set individually using
+% \cs{makerunningheadwidth}\marg{style}\marg{length} and
+% \cs{makerunningfootwidth}\marg{style}\marg{length}.
+% \changes{v1.6180339c}{2008/12/26}{Enabled the width of headers and footers
+% to be different
+% (requested by Wilhelm M\"{u}ller).}
+% \changes{v1.6180339c}{2009/01/13}{Added \cs{makerunningheadwidth}
+% and \cs{makerunningfootwidth}}.
+% \begin{macrocode}
+\newcommand*{\makerunningwidth}[1]{%
+ \def\m@mhfstyle{#1}%
+ \m@mopthfwidth}
+\newcommand*{\m@mopthfwidth}[2][\@mpty]{%
+ \setlength\@tempdima{#2}
+% \@namedef{\m@mhfstyle headrunwidth}{#2}%
+ \expandafter\edef\csname \m@mhfstyle headrunwidth\endcsname{\the\@tempdima}
+ \ifx\@mpty #1
+% \@namedef{\m@mhfstyle footrunwidth}{#2}%
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}
+ \else
+% \@namedef{\m@mhfstyle footrunwidth}{#1}%
+ \setlength\@tempdima{#1}
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}
+ \fi}
+\newcommand*{\makerunningheadwidth}[2]{%
+ \setlength\@tempdima{#2}%
+ \expandafter\edef\csname \m@mhfstyle headrunwidth\endcsname{\the\@tempdima}%
+% \@namedef{#1headrunwidth}{#2}
+}
+\newcommand*{\makerunningfootwidth}[2]{%
+ \setlength\@tempdima{#2}%
+% \@namedef{#1footrunwidth}{#2}
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}%
+}
+
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \begin{macro}{\normalrulethickness}
% \begin{macro}{\footruleheight}
@@ -5152,6 +5349,21 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\makeheadfootvposition}
+% The headers and footers are typeset inside \cs{parbox}'es, using
+% \cs{makeheadfootvposition}\marg{style}\marg{headvpos}\marg{footvpost}
+% users can specify whether the alignment should be b,t or c.The
+% detault is b.
+% \changes{v1.6180339c}{2009/01/13}{Added support for for
+% controlling the alignment of the headers and footers}
+% \begin{macrocode}
+\newcommand*\makeheadfootvposition[3]{%
+ \@namedef{#1headvplacement}{#2}\@namedef{#1footvplacement}{#3}}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
% \begin{macro}{\makepagestyle}
% At last we can put everything together for defining a new pagestyle,
% via the macro \cs{makepagestyle}\marg{style} which initially sets up
@@ -5181,23 +5393,27 @@
%
% First the left filler which is either \cs{relax} or \cs{hss}, and then
% start the main box.
+% \changes{v1.6180339c}{2008/12/26}{Replaced \cs{...runwidth} by \cs{...headrunwidth}
+% or \cs{...footrunwidth}, as appropriate for headers and footers.}
+% \changes{v1.6180339c}{2009/01/13}{Replaced \cs{parbox}\texttt[b]
+% with \cs{parbox}\texttt{[\cs{nameuse{#1headvplacement}}]} etc.}
% \begin{macrocode}
- \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1headrunwidth}{\m@mhe@dreset%
\vbox{\hbox{%
% \end{macrocode}
% The left part of the header.
% \begin{macrocode}
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedright\@nameuse{#1eheadl}\strut}}\hfill
% \end{macrocode}
% The center part of the header.
% \begin{macrocode}
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\centering\@nameuse{#1eheadc}\strut}\hfill
% \end{macrocode}
% The right part of the header.
% \begin{macrocode}
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedleft\@nameuse{#1eheadr}\strut}}}%
% \end{macrocode}
% Finally, the header rule and finish with the right filler, which
@@ -5209,13 +5425,13 @@
% a similar pattern. Here is \cs{@oddhead}.
% \begin{macrocode}
\@namedef{#1@oddhead}{%
- \@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1headrunwidth}{\m@mhe@dreset%
\vbox{\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedright\@nameuse{#1oheadl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\centering\@nameuse{#1oheadc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedleft\@nameuse{#1oheadr}\strut}}}%
\@nameuse{#1headrule}}}\@nameuse{#1oddhpr}}%
% \end{macrocode}
@@ -5223,26 +5439,26 @@
% entries.
% \begin{macrocode}
\@namedef{#1@evenfoot}{%
- \@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1footrunwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedright\@nameuse{#1efootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\centering\@nameuse{#1efootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedleft\@nameuse{#1efootr}\strut}}}%
}}\@nameuse{#1evenfpr}}%
% \end{macrocode}
% Lastly the \cs{@oddfoot}.
% \begin{macrocode}
\@namedef{#1@oddfoot}{%
- \@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1footrunwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedright\@nameuse{#1ofootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\centering\@nameuse{#1ofootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedleft\@nameuse{#1ofootr}\strut}}}%
}}\@nameuse{#1oddfpr}}%
% \end{macrocode}
@@ -5276,6 +5492,11 @@
\makeheadrule{#1}{\textwidth}{0pt}%
\makefootrule{#1}{\textwidth}{\footruleheight}{\footruleskip}%
% \end{macrocode}
+% Set the initial vertical header and footer positions.
+% \changes{v1.6180339c}{2009/01/13}{Added head/foot position initialisation}
+% \begin{macrocode}
+ \makeheadfootvposition{#1}{b}{b}%
+% \end{macrocode}
% Finally, there is no addtional code needed, so make the hook empty, and
% we are done.
% \begin{macrocode}
@@ -5322,7 +5543,7 @@
% \end{macrocode}
% Set the width.
% \begin{macrocode}
- \makerunningwidth{#1}{\@nameuse{#2runwidth}}%
+ \makerunningwidth{#1}[\@nameuse{#2footrunwidth}]{\@nameuse{#2headrunwidth}}%
% \end{macrocode}
% Specify the \cs{headposition}.
% \begin{macrocode}
@@ -5331,6 +5552,11 @@
\@namedef{#1evenhpr}{\@nameuse{#2evenhpr}}%
\@namedef{#1oddhpr}{\@nameuse{#2oddhpr}}%
% \end{macrocode}
+% Also vertically
+% \changes{v1.6180339c}{2008/01/13}{Also copy the vertical positions}
+% \begin{macrocode}
+ \makeheadfootvposition{#1}{\@namedef{#2headvplacement}}{\@namedef{#2footvplacement}}%
+% \end{macrocode}
% Specify the feet
% \begin{macrocode}
\@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
@@ -5476,7 +5702,7 @@
% \end{macro}
%
% \begin{macro}{\createmark}
-% \cs{createmark}\marg{division}\marg{marks}\mark{show}\marg{prefix}\marg{postfix}
+% \cs{createmark}\marg{division}\marg{marks}\marg{show}\marg{prefix}\marg{postfix}
% creates a \cs{divisionmark} with \meta{marks} (= \texttt{left}, \texttt{both}
% or \texttt{right}) controlling which marks are set,
% \meta{show} (= \texttt{shownumber} or \texttt{nonumber}) controls the
@@ -5890,6 +6116,101 @@
% \end{macro}
% \end{macro}
%
+% Another pagestyle called \pstyle{showlocs} can be used to show the
+% locations of the header, footer and textblock. I would expect that
+% this would be mainly used as an example for authors to create their
+% own similar styles.
+% \changes{v1.6180339c}{2008/12/28}{Added the showlocs pagestyle and supporting
+% macros}
+% \changes{v1.6180339c}{2009/01/25}{Added more supporting macros for the
+% showlocs pagestyle}
+%
+% \begin{macro}{\ifshowheadfootloc}
+% \begin{macro}{\showheadfootloctrue}
+% \begin{macro}{\showheadfootlocfalse}
+% \begin{macro}{\showheadfootlocon}
+% \begin{macro}{\showheadfootlocoff}
+% \begin{macro}{\ifshowtextblockloc}
+% \begin{macro}{\showtextblockloctrue}
+% \begin{macro}{\showtextblocklocfalse}
+% \begin{macro}{\showtextblocklocon}
+% \begin{macro}{\showtextblocklocoff}
+% Booleans controlling the appearance, or not, of the header/footer lines
+% and text frame in \pstyle{showlocs}.
+% \begin{macrocode}
+\newif\ifshowheadfootloc
+ \showheadfootloctrue
+\newcommand*{\showheadfootlocon}{\showheadfootloctrue}
+\newcommand*{\showheadfootlocoff}{\showheadfootlocfalse}
+\newif\ifshowtextblockloc
+ \showtextblockloctrue
+\newcommand*{\showtextblocklocon}{\showtextblockloctrue}
+\newcommand*{\showtextblocklocoff}{\showtextblocklocfalse}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \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}}
+% \begin{macrocode}
+\newcommand*{\framepichead}{%
+\ifshowheadfootloc
+ \begin{picture}(0,0)
+ \unitlength 1pt
+ \put(0,0){\line(1,0){\strip@pt\textwidth}}
+ \end{picture}%
+\fi}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\framepictextfoot}
+% For producing a zero-sized picture of a line at the base of the footer
+% 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}}
+% \begin{macrocode}
+\newcommand*{\framepictextfoot}{%
+ \begin{picture}(0,0)
+ \unitlength 1pt
+ \ifshowheadfootloc
+ \put(0,0){\line(1,0){\strip@pt\textwidth}}
+ \fi
+ \ifshowtextblockloc
+ \put(0,\strip@pt\footskip)%
+ {\framebox(\strip@pt\textwidth,\strip@pt\textheight){}}
+ \fi
+ \end{picture}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ps@showlocs}
+% The \pstyle{showlocs} pagestyle. This is more to show what can be done.
+% \changes{v1.6180339c}{2008/12/28}{Added the showlocs pagestyle}
+% \begin{macrocode}
+\makepagestyle{showlocs}
+\makeevenhead{showlocs}{\framepichead\thepage}{\thepage}{\thepage}
+\makeoddhead{showlocs}{\framepichead\thepage}{\thepage}{\thepage}
+\makeevenfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
+\makeoddfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
% \subsection{Page numbering}
%
% The kernel includes the \cs{pagenumbering} command for setting the
@@ -10312,6 +10633,168 @@
%
% \subsection{Paragraphs}
%
+% Much of the code in this section is taken from my \textit{Glisterings}
+% columns~\cite{GLISTER07,GLISTER08}.
+% \changes{v1.6180339c}{2009/01/09}{Added several new paragraph types}
+%
+% \begin{macro}{\memorigdbs}
+% \begin{macro}{\memorigpar}
+% \begin{macro}{\atcentercr}
+% \cs{memorigdbs} saves the original definition of \verb?\\? and
+% \cs{memorigpar} saves the original \cs{par}. The macro \cs{atcentercr}
+% provides a user call to \cs{@centercr}. These could come in handy for
+% odd paragraph shapes.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{memorigdbs} and
+% \cs{memorigpar} \cs{atcentercr}}
+% \begin{macrocode}
+\let\memorigdbs\\
+\let\memorigpar\par
+\let\atcentercr\@centercr
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Normal (block) paragraphs}
+%
+%
+% \begin{macro}{\flushleftright}
+% Sets the paragraphing to \LaTeX's normal form.
+% \changes{v1.61803}{2008/01/30}{Used \cs{@flushglue} in \cs{flushleftright} and
+% \cs{centerlastline} (mempatch v4.7)}
+% \changes{v1.6180339c}{2009/01/09}{Extended \cs{flushleftright} to set all
+% the regular paragraphing controls}
+% \begin{macrocode}
+\newcommand*{\flushleftright}{%
+ \let\\\memorigdbs
+ \leftskip\z@skip
+ \rightskip\leftskip
+ \parfillskip\@flushglue
+ \everypar{}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\linenottooshort}
+% This declaration \cs{linenottooshort}\oarg{length} specifies paragraphs
+% such that the last line is at least about \meta{length} long (the default
+% is 4em).
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{linenottooshort} paragraph}
+% \begin{macrocode}
+\newcommand*{\linenottooshort}[1][4em]{%
+ \@tempdima=\hsize
+ \advance\@tempdima -#1
+ \leftskip\z@skip
+ \rightskip\leftskip
+ \parfillskip=\@tempdima \@minus \@tempdima}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\russianpar}
+% Using \cs{russianpar} instead of \cs{par} to end a paragraph causes it
+% to be set according to Russian typography, where the last line of a
+% multiline paragraph must be either at least as
+% long as \cs{parindent} and have at least \cs{parindent} space at the
+% right, or it must be flushleft and flushright.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{russianpar} paragraph}
+% \begin{macrocode}
+\newcommand*{\russianpar}{\ifhmode\unskip
+ \strut\vadjust{}\nobreak
+ \discretionary{}%
+ {\hbox{\hskip2\parindent
+ \vrule depth 273sp width 0sp height \ht\strutbox}}%
+ {\hbox{\hskip\parindent}}%
+ \hskip-2\parindent \@minus 2\parindent
+ \hskip\hsize \@minus \hsize
+ \kern\z@ \parfillskip\z@
+ \memorigpar
+ \ifdim\prevdepth=273sp
+ \nobreak
+ \vskip-2\baselineskip
+ \hbox{\strut}%
+ \fi\fi}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lastlineparrule}
+% \begin{macro}{\lastlinerulefill}
+% Using \cs{lastlinerulefill} instead of \cs{par} to end a paragraph
+% causes all short lines to be filled at the right by a rule
+% (\cs{lastlineparrule}) extending to the righthand margin.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{lastlineparrule} and
+% \cs{lastlinerulefill} paragraph}
+% \begin{macrocode}
+\newcommand*{\lastlineparrule}{%
+ \hrule height 0.5ex depth \@tempdimb\relax}
+\newcommand*{\lastlinerulefill}{%
+ \let\\\@centercr
+ \@tempdimb=-0.5ex \advance\@tempdimb 0.4pt
+ \unskip\nobreak\space
+ \leaders\lastlineparrule\hskip\@flushglue
+ \vadjust{}{\parfillskip\z@\memorigpar}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{Centered lines}
+%
+% \begin{macro}{\centerlastline}
+% This declaration specifies normal paragraphs except that the last line of
+% each is centered.
+% \begin{macrocode}
+\newcommand*{\centerlastline}{%
+ \leftskip\@flushglue
+ \rightskip=\z@ plus -1fil
+ \parfillskip=\z@ plus 2fil}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\leftcenterright}
+% This declaration specifies paragraphs where the first line is flushleft
+% (raggedright), the
+% last is flushright (raggedleft) and all inbetween are centered.
+% Set \verb?\everypar{}? afterwards.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{leftcenterright} paragraph}
+% \begin{macrocode}
+\newcommand*{\leftcenterright}{%;
+ \let\\\break
+ \parindent\z@
+ \leftskip\@flushglue
+ \rightskip\leftskip
+ \parfillskip \z@ \@plus -1fil
+ \everypar={\hskip \z@ \@plus -1fil}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\centerfloat}
+% This is a version of \cs{centering} that can be used to center a wide
+% float with respect to the text block (normally the left of a wide float
+% is aligned with the left of the textblock). This can only be used for
+% centering something where LaTeX knows the width (e.g., a figure or a
+% table / tabular).
+%
+% This is a modified version of code by Robin Fairbairns
+% (CTT, \textit{Re: Centering a table: problem with rotating.sty, maybe
+% a strange document class?}, 3 Jan 2009).
+% \changes{v1.6180339c}{2009/01/11}{Added \cs{centerfloat}}
+% \begin{macrocode}
+\newcommand*{\centerfloat}{%
+ \parindent \z@
+ \leftskip \z@ \@plus 1fil \@minus \textwidth
+ \rightskip\leftskip
+ \parfillskip \z@skip}
+
+% \end{macrocode}
+% \end{macro}
+%
% \subsubsection{Ragged}
%
% The kernel code for raggedright (in \file{ltmiscen.dtx}):
@@ -10320,7 +10803,8 @@
% \let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip
% \leftskip\z@skip
% \parindent\z@}
-% %% \@flushglue = 0pt plus 1fil %% from ltalloc.dtx
+% %% \@flushglue = 0pt plus 1fil %% from ltalloc.dtx
+% %% \z@skip = 0pt plus 0pt minus 0pt %%
% \end{verbatim}
% produces very ragged text with no paragraph indent.
%
@@ -10340,6 +10824,39 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\justlastraggedleft}
+% This declaration specifies paragraphs where the lines are justified,
+% except for the last which is raggedleft (flushright)..
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{justlastraggedleft} paragraph}
+% \begin{macrocode}
+\newcommand*{\justlastraggedleft}{%
+ \leftskip\@flushglue
+ \rightskip-\leftskip
+ \parfillskip\leftskip
+ \parindent \z@}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\raggedrightthenleft}
+% This declaration specifies paragraphs where the first line is raggedright
+% (flushleft) and all the rest are raggedleft (flushright). Note that
+% this alters \cs{everpar}, which may need to be reset afterwards to
+% \verb?\everypar{}?.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{raggedrightthenleft} paragraph}
+% \begin{macrocode}
+\newcommand*{\raggedrightthenleft}{%
+ \parindent \z@
+ \leftskip \z@ \@plus 1fill
+ \rightskip\@flushglue
+ \parfillskip \z@
+ \everypar{\hskip \z@ \@plus -1fill}}
+
+% \end{macrocode}
+% \end{macro}
+%
+%
% \subsubsection{Hanging}
%
% \begin{macro}{\hangfrom}
@@ -10379,7 +10896,42 @@
% \end{macrocode}
% \end{environment}
%
+% \subsubsection{Miscellaneous}
%
+% \begin{macro}{\leftspringright}
+% \cs{leftspringright}\marg{leftfrac}\marg{rightfrac}\marg{lefttext}\marg{righttext}
+% sets the \meta{lefttext} flushleft (raggedright) in a column \meta{leftfrac}
+% of the current textwidth and the \meta{righttext} flushright (raggedleft)
+% in a column \meta{rightfrac} of the textwidth, with space
+% (1.0 - \meta{leftfrac} - \meta{rightfrac})
+% of the textwidth between them. Both \meta{leftfrac} and \meta{rightfrac}
+% must be given as decimal numbers (e.g., \texttt{0.25} not \texttt{1/4}).
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{leftspringright} paragraph}
+% \begin{macrocode}
+\newcommand{\leftspringright}[4]{%
+ \@tempdimb=\hsize
+ \par\noindent\hbox to\@tempdimb{%
+ \vtop{\hsize=#1\@tempdimb \flushleft#3\par}\hss
+ \vtop{\hsize=#2\@tempdimb \flushright#4\par}}}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\sourceatright}
+% Putting \cs{sourceatright}\oarg{length}\marg{text} at the end of a
+% paragraph will set \meta{text} flushright on the same line provided the line
+% is short enough to allow \meta{length} (default 2em) between the end of the
+% line and \meta{text}. If there is not enough space then \meta{text} is
+% set flushright on the following line.
+% \changes{v1.6180339c}{2009/01/09}{Added \cs{sourceatright} paragraph}
+% \begin{macrocode}
+\newcommand*{\sourceatright}[2][2em]{{%
+ \unskip\nobreak\hfil\penalty50
+ \hskip#1\hbox{}\nobreak\hfil{#2}
+ \parfillskip\z@\finalhyphendemerits=0\par}}
+
+% \end{macrocode}
+% \end{macro}
%
%
% \section{Lists}
@@ -16971,28 +17523,6 @@
% \end{macro}
%
%
-% \begin{macro}{\flushleftright}
-% \begin{macro}{\centerlastline}
-% These are in addition to the \cs{centering}, \cs{raggedleft} and \cs{raggedright}
-% declarations for paragraphing. \cs{flushleftright} sets the skips to \TeX's
-% normal (block) paragraphing values,
-% while \cs{centerlastline} sets the skips to give a centered last line in
-% a block paragraph.
-% \changes{v1.61803}{2008/01/30}{Used \cs{@flushglue} in \cs{flushleftright} and
-% \cs{centerlastline} (mempatch v4.7)}
-% \begin{macrocode}
-\newcommand*{\flushleftright}{%
- \leftskip\z@ \rightskip\z@
- \parfillskip\@flushglue}
-\newcommand*{\centerlastline}{%
- \parfillskip=\z@ plus 2fil
- \rightskip=\z@ plus -1fil
- \leftskip\@flushglue}
-
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
% \begin{macro}{\captionstyle}
% \begin{macro}{\@contcstyle}
% The paragraphing style for the caption.
@@ -18404,6 +18934,35 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@mem@scap@beforehook}
+% \begin{macro}{\@mem@scap@afterhook}
+% Two hooks into the 'scap' internals. By default they do nothing, but
+% can be used make say sidecaption align towards the spine in twosided
+% documents. This is done by redefining \emph{before} to
+% \verb+\checkoddpage\ifoddpage\else\raggedleft\fi+ and redefining
+% \emph{after} to \verb+\par+. Note that since 'sidecontcaption',
+% 'sidenamedlegend' and 'sidelegend' all share the same basic
+% internals redefining the two hooks will affect those as well. The
+% user might want to create their own special environment, say, like this:
+% \begin{verbatim}
+% \makeatletter
+% \newenvironment{sidecaption*}{
+% \renewcommand\@mem@scap@beforehook{\checkoddpage\ifoddpage\else\raggedleft\fi}
+% \renewcommand\@mem@scap@afterhook{\par}
+% \begin{sidecaption}}
+% {\end{sidecaption}}
+% \makeatother
+% \end{verbatim}
+% \changes{v1.6180339c}{2009/01/21}{Added 'before' and 'after' hooks
+% to shared sidecaption internals}
+% \begin{macrocode}
+\newcommand\@mem@scap@beforehook{}
+\newcommand\@mem@scap@afterhook{}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@@sidecaption}
% \cs{@@sidecaption}\marg{fortoc}\marg{title}\oarg{label} is the
% last macro in the chain and handles all three arguments.
@@ -18445,6 +19004,10 @@
% The macro \cs{m@mscapend@fbox} ends the box.
% \begin{macrocode}
\newcommand*{\m@mscapstart@fbox}{%
+% \end{macrocode}
+% \changes{v1.6180339c}{2009/01/21}{Added \cs{@mem@scap@beforehook}}
+% \begin{macrocode}
+ \@mem@scap@beforehook%
\setlength{\m@mscapmainwidth}{\sidecapfloatwidth}%
\setm@mscaplkern
\begin{lrbox}{\m@mscap@fbox}%
@@ -18505,7 +19068,12 @@
% \end{macrocode}
% Finally, make \cs{m@mscapthisside} a no-op.
% \begin{macrocode}
- \gdef\m@mscapthisside{}}
+ \gdef\m@mscapthisside{}%
+% \end{macrocode}
+% \changes{v1.6180339c}{2009/01/21}{Added \cs{@mem@scap@afterhook}}
+% \begin{macrocode}
+ \@mem@scap@afterhook%
+}
% \end{macrocode}
% \end{macro}
@@ -19468,18 +20036,34 @@
%
% \begin{macro}{\titleref}
% \begin{macro}{\currenttitle}
-% \cs{titleref}\marg{key} prints the title corresponding to \verb?\label{key}?.
-% \cs{currenttitle} prints the latest title.
-% \begin{macrocode}
-\DeclareRobustCommand{\titleref}[1]{\begingroup \let\numberline\@gobble
+% \begin{macro}{\@mem@titleref}
+% \begin{macro}{\@mem@titlerefnolink}
+% \cs{titleref}\marg{key} prints the title corresponding to
+% \verb?\label{key}?. \cs{currenttitle} prints the latest title.
+% \cs{titleref} extended to support a starred version that will not
+% provide hyperlinks when using \Lpack{hyperref}. The
+% \Lpack{hyperref} definition of \cs{@mem@titlerefnolink} is found
+% in \Lpack{memhfixc}.
+% \changes{v1.6180339c}{2009/01/18}{Extended \cs{titleref}, suggestion
+% on ctt by martin@helios.de}
+% \begin{macrocode}
+\newcommand*\@mem@titleref[1]{\begingroup
+ \let\numberline\@gobble
\let\M@TitleReference\@mem@theTR % interrupt recursion of \ref
\ref{#1}\endgroup}
-\DeclareRobustCommand{\currenttitle}{\begingroup \let\numberline\@gobble
+\let\@mem@titlerefnolink\@mem@titleref
+
+\DeclareRobustCommand\titleref{\@ifstar{\@mem@titlerefnolink}{\@mem@titleref}}
+
+\DeclareRobustCommand{\currenttitle}{\begingroup
+ \let\numberline\@gobble
\theTitleReference\@currentlabel\M@currentTitle\endgroup}
% \end{macrocode}
% \end{macro}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
%
% \begin{verbatim}
@@ -19676,6 +20260,7 @@
%
% \begin{macro}{\@starZ}
% The starred listof version
+% \changes{v1.6180339c}{2009/01/20}{Missing \cs{parskip} change}
% \begin{macrocode}
\@namedef{@star#2}{%
\ensureonecol
@@ -19683,6 +20268,7 @@
\begingroup
%%% \parindent\z@ \parskip\cftparskip
\@nameuse{@#2maketitle}
+\parskip\cftparskip
\@starttoc{#2}%
\endgroup
\restorefromonecol}
@@ -20224,7 +20810,6 @@
% \end{macro}
% \end{macro}
% \end{macro}
-% \end{macro}
%
% \begin{macro}{\cftbeforebookskip}
% \begin{macro}{\cftbookindent}
@@ -20765,8 +21350,10 @@
% \end{macrocode}
% Start a group to localize changes to the paragraphing. Set the
% left margin to the chapter indent plus the chapter number width.
+% \changes{v1.6180339c}{2009/01/20}{Added a \cs{nopagebreak}, though
+% this only disencourage a page break}
% \begin{macrocode}
- {\leftskip \cftchapterindent\relax
+ {\nopagebreak\leftskip \cftchapterindent\relax
\advance\leftskip \cftchapternumwidth\relax
% \end{macrocode}
% Set the right hand margin to \cs{@tocrmarg}.
@@ -22454,8 +23041,17 @@
% \begin{macro}{\parnopar}
% From \theTeXbook{} Exercise 14.15. It creates an `invisible' end/start paragraph,
% and may be used for getting \TeX{} to try a pagebreak.
+%
+% Roman Eisle (email 2008/09/05) found a problem with the original
+% definition as its effects continued on: \\
+% \verb?\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent}? \\
+% and he supplied the fix used below.
+%
+% \changes{v1.6180339c}{2008/12/24}{Changed \cs{parnopar} to limit its effect
+% to a single instance}
% \begin{macrocode}
-\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent}
+\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent
+ \parfillskip\@flushglue}
% \end{macrocode}
% \end{macro}
@@ -31380,8 +31976,10 @@
% as the final act. (This is preferable to my series of \file{memfixa.sty},
% \file{memfixb.sty} packages, and so on, for each release of the class.)
% \changes{v1.3}{2002/11/14}{Added input of mempatch.sty}
+% \changes{v1.6180339c}{2008/12/26}{Added the two missing arguments when inputting
+% mempatch.sty (courtesy of Wilhelm Muller)}
% \begin{macrocode}
-\InputIfFileExists{mempatch.sty} % should be this
+\InputIfFileExists{mempatch.sty}{}{} % should be this
% \end{macrocode}
%
@@ -31730,6 +32328,16 @@ keyword "\\glossaryentry"
% \newblock (Available from CTAN in
% \texttt{macros/latex/contrib/ledmac})
%
+% \bibitem[Wil07]{GLISTER07}
+% Peter Wilson.
+% \newblock `Glisterings' \emph{TUGboat}, 28(2):229--232,
+% \newblock 2007.
+%
+% \bibitem[Wil08]{GLISTER08}
+% Peter Wilson.
+% \newblock `Glisterings' \emph{TUGboat}, 29(2):324--327,
+% \newblock 2008.
+%
%
%
%
diff --git a/Master/texmf-dist/source/latex/memoir/memoir.ins b/Master/texmf-dist/source/latex/memoir/memoir.ins
index 6ad343c81c6..ecc94ebe73e 100644
--- a/Master/texmf-dist/source/latex/memoir/memoir.ins
+++ b/Master/texmf-dist/source/latex/memoir/memoir.ins
@@ -54,6 +54,7 @@
\generateFile{memoir.cls}{t}{\from{memoir.dtx}{class}}
+
\Msg{*** Generating the LaTeX2e document class option files ***}
\generateFile{mem9.clo}{t}{\from{memoir.dtx}{9pt}}
diff --git a/Master/texmf-dist/source/latex/memoir/mempatch.dtx b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
index 74779475cea..c2b79992fa8 100644
--- a/Master/texmf-dist/source/latex/memoir/mempatch.dtx
+++ b/Master/texmf-dist/source/latex/memoir/mempatch.dtx
@@ -64,6 +64,7 @@
% \def\fileversion{v5.1} \def\filedate{2008/07/11}
% \def\fileversion{v6.0} \def\filedate{2008/07/23}
% \def\fileversion{v6.0a} \def\filedate{2008/08/23}
+% \def\fileversion{v6.0b} \def\filedate{2009/01/18}
%
% \title{The LaTeX \Lpack{memoir} class for configurable book
% typesetting: Code patches\thanks{This
@@ -302,6 +303,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.11 2009/01/18
%% Version 1.10 2008/08/23
%% Version 1.9 2006/11/22
%% Version 1.8 2006/01/21
@@ -318,7 +320,7 @@
%
%
% \begin{macrocode}
-\ProvidesPackage{memhfixc}[2008/08/23 v1.10 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2009/01/18 v1.11 nameref/hyperref package fixes for memoir class]
% \end{macrocode}
%
% \begin{macro}{\M@hfixcfinish}
@@ -726,7 +728,16 @@
% \end{macro}
% \end{macro}
%
-%
+% \begin{macro}{\@mem@titlerefnolink}
+% \Lpack{hyperref} provide a \cs{ref*} command that does not give a
+% hyperlink under \Lpack{hyperref}, we extend \cs{titleref} to
+% support it.
+% \begin{macrocode}
+\def\@mem@titlerefnolink#1{\begingroup \let\numberline\@gobble
+ \let\M@TitleReference\@mem@theTR % interrupt recursion of \ref
+ \ref*{#1}\endgroup}
+% \end{macrocode}
+% \end{macro}
%
% The end of the \Lpack{hyperref} related patches.
%
diff --git a/Master/texmf-dist/tex/latex/memoir/memhfixc.sty b/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
index 1ee23cf5f29..6488626bfb1 100644
--- a/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
+++ b/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
@@ -38,6 +38,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.11 2009/01/18
%% Version 1.10 2008/08/23
%% Version 1.9 2006/11/22
%% Version 1.8 2006/01/21
@@ -50,7 +51,7 @@
%% Version 1.1 2003/01/22
%% Version 1.0 2002/10/22
%%
-\ProvidesPackage{memhfixc}[2008/08/23 v1.10 nameref/hyperref package fixes for memoir class]
+\ProvidesPackage{memhfixc}[2009/01/18 v1.11 nameref/hyperref package fixes for memoir class]
\let\M@hfixcfinish\relax
\@ifclassloaded{memoir}{}%
{\let\M@hfixcfinish\endinput
@@ -269,6 +270,9 @@
\end{lrbox}%
\m@mscapopboxes}
+\def\@mem@titlerefnolink#1{\begingroup \let\numberline\@gobble
+ \let\M@TitleReference\@mem@theTR % interrupt recursion of \ref
+ \ref*{#1}\endgroup}
\endinput
%%
%% End of file `memhfixc.sty'.
diff --git a/Master/texmf-dist/tex/latex/memoir/memoir.cls b/Master/texmf-dist/tex/latex/memoir/memoir.cls
index a421c26c08e..cdde4cba8d1 100644
--- a/Master/texmf-dist/tex/latex/memoir/memoir.cls
+++ b/Master/texmf-dist/tex/latex/memoir/memoir.cls
@@ -25,7 +25,7 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{memoir}%
- [2008/08/07 v1.6180339a configurable book, report, article document class]
+ [2009/01/25 v1.6180339c configurable book, report, article document class]
\newcommand*{\@ptsize}{}
\newcommand*{\@memptsize}{}
\newlength{\onelineskip}
@@ -226,9 +226,8 @@
\newif\ifm@mifetex
\m@mifetexfalse
\IfFileExists{ifetex.sty}{\RequirePackage{ifetex}\relax}{%
- \ClassWarningNoLine{memoir}{%
- If there is an `ifetex' package then it is not installed.\MessageBreak
- The package is being emulated}%
+ \ClassInfo{memoir}{%
+ An `ifetex' package is being emulated}%
\m@mifetextrue
\newif\ifetex
\etexfalse
@@ -270,7 +269,7 @@
\m@mifluatexfalse
\IfFileExists{ifluatex.sty}{\RequirePackage{ifluatex}\relax}{%
\ClassWarningNoLine{memoir}{%
- If there is an `ifluatex' package then it is not installed.\MessageBreak
+ The `ifluatex' package is not installed.\MessageBreak
The package is being emulated}%
\m@mifluatextrue
\newif\ifluatex
@@ -456,58 +455,76 @@
\newcommand*{\stockmdemyvo} {\stockheight=216mm \stockwidth=138mm}
\newcommand*{\stockmsmallroyalvo} {\stockheight=234mm \stockwidth=156mm}
+\newcommand*{\stockao} {\stockheight=1189mm \stockwidth=841mm}
+\newcommand*{\stockai} {\stockheight=841mm \stockwidth=594mm}
+\newcommand*{\stockaii} {\stockheight=594mm \stockwidth=420mm}
\newcommand*{\stockaiii}{\stockheight=420mm \stockwidth=297mm}
\newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm}
\newcommand*{\stockav} {\stockheight=210mm \stockwidth=148mm}
\newcommand*{\stockavi} {\stockheight=148mm \stockwidth=105mm}
+\newcommand*{\stockbo} {\stockheight=1414mm \stockwidth=1000mm}
+\newcommand*{\stockbi} {\stockheight=1000mm \stockwidth=707mm}
+\newcommand*{\stockbii} {\stockheight=707mm \stockwidth=500mm}
\newcommand*{\stockbiii}{\stockheight=500mm \stockwidth=353mm}
\newcommand*{\stockbiv} {\stockheight=353mm \stockwidth=250mm}
\newcommand*{\stockbv} {\stockheight=250mm \stockwidth=176mm}
\newcommand*{\stockbvi} {\stockheight=176mm \stockwidth=125mm}
-\newcommand*{\pagedbill} {\pageheight=7in \pagewidth=3in}
-\newcommand*{\pagestatement} {\pageheight=8.5in \pagewidth=5.5in}
-\newcommand*{\pageexecutive} {\pageheight=10.5in \pagewidth=7.25in}
-\newcommand*{\pageletter} {\pageheight=11in \pagewidth=8.5in}
-\newcommand*{\pageold} {\pageheight=12in \pagewidth=9in}
-\newcommand*{\pagelegal} {\pageheight=14in \pagewidth=8.5in}
-\newcommand*{\pageledger} {\pageheight=17in \pagewidth=11in}
-\newcommand*{\pagebroadsheet}{\pageheight=22in \pagewidth=17in}
-
-\newcommand*{\pagepottvo} {\pageheight=6.25in \pagewidth=4in}
-\newcommand*{\pagefoolscapvo} {\pageheight=6.75in \pagewidth=4.25in}
-\newcommand*{\pagecrownvo} {\pageheight=7.5in \pagewidth=5in}
-\newcommand*{\pagepostvo} {\pageheight=8in \pagewidth=5in}
-\newcommand*{\pagelargecrownvo}{\pageheight=8in \pagewidth=5.25in}
-\newcommand*{\pagelargepostvo} {\pageheight=8.25in \pagewidth=5.25in}
-\newcommand*{\pagesmalldemyvo} {\pageheight=8.5in \pagewidth=5.675in}
-\newcommand*{\pagedemyvo} {\pageheight=8.75in \pagewidth=5.675in}
-\newcommand*{\pagemediumvo} {\pageheight=9in \pagewidth=5.75in}
-\newcommand*{\pagesmallroyalvo}{\pageheight=9.25in \pagewidth=6.175in}
-\newcommand*{\pageroyalvo} {\pageheight=10in \pagewidth=6.25in}
-\newcommand*{\pagesuperroyalvo}{\pageheight=10.25in \pagewidth=6.75in}
-\newcommand*{\pageimperialvo} {\pageheight=11in \pagewidth=7.5in}
-
-\newcommand*{\pagemcrownvo} {\pageheight=186mm \pagewidth=123mm}
-\newcommand*{\pagemlargecrownvo} {\pageheight=198mm \pagewidth=129mm}
-\newcommand*{\pagemdemyvo} {\pageheight=216mm \pagewidth=138mm}
-\newcommand*{\pagemsmallroyalvo} {\pageheight=234mm \pagewidth=156mm}
-
-\newcommand*{\pageaiii}{\pageheight=420mm \pagewidth=297mm}
-\newcommand*{\pageaiv} {\pageheight=297mm \pagewidth=210mm}
-\newcommand*{\pageav} {\pageheight=210mm \pagewidth=148mm}
-\newcommand*{\pageavi} {\pageheight=148mm \pagewidth=105mm}
-
-\newcommand*{\pagebiii}{\pageheight=500mm \pagewidth=353mm}
-\newcommand*{\pagebiv} {\pageheight=353mm \pagewidth=250mm}
-\newcommand*{\pagebv} {\pageheight=250mm \pagewidth=176mm}
-\newcommand*{\pagebvi} {\pageheight=176mm \pagewidth=125mm}
-
+\newcommand*{\pagedbill} {\paperheight=7in \paperwidth=3in}
+\newcommand*{\pagestatement} {\paperheight=8.5in \paperwidth=5.5in}
+\newcommand*{\pageexecutive} {\paperheight=10.5in \paperwidth=7.25in}
+\newcommand*{\pageletter} {\paperheight=11in \paperwidth=8.5in}
+\newcommand*{\pageold} {\paperheight=12in \paperwidth=9in}
+\newcommand*{\pagelegal} {\paperheight=14in \paperwidth=8.5in}
+\newcommand*{\pageledger} {\paperheight=17in \paperwidth=11in}
+\newcommand*{\pagebroadsheet}{\paperheight=22in \paperwidth=17in}
+
+\newcommand*{\pagepottvo} {\paperheight=6.25in \paperwidth=4in}
+\newcommand*{\pagefoolscapvo} {\paperheight=6.75in \paperwidth=4.25in}
+\newcommand*{\pagecrownvo} {\paperheight=7.5in \paperwidth=5in}
+\newcommand*{\pagepostvo} {\paperheight=8in \paperwidth=5in}
+\newcommand*{\pagelargecrownvo}{\paperheight=8in \paperwidth=5.25in}
+\newcommand*{\pagelargepostvo} {\paperheight=8.25in \paperwidth=5.25in}
+\newcommand*{\pagesmalldemyvo} {\paperheight=8.5in \paperwidth=5.675in}
+\newcommand*{\pagedemyvo} {\paperheight=8.75in \paperwidth=5.675in}
+\newcommand*{\pagemediumvo} {\paperheight=9in \paperwidth=5.75in}
+\newcommand*{\pagesmallroyalvo}{\paperheight=9.25in \paperwidth=6.175in}
+\newcommand*{\pageroyalvo} {\paperheight=10in \paperwidth=6.25in}
+\newcommand*{\pagesuperroyalvo}{\paperheight=10.25in \paperwidth=6.75in}
+\newcommand*{\pageimperialvo} {\paperheight=11in \paperwidth=7.5in}
+
+\newcommand*{\pagemcrownvo} {\paperheight=186mm \paperwidth=123mm}
+\newcommand*{\pagemlargecrownvo} {\paperheight=198mm \paperwidth=129mm}
+\newcommand*{\pagemdemyvo} {\paperheight=216mm \paperwidth=138mm}
+\newcommand*{\pagemsmallroyalvo} {\paperheight=234mm \paperwidth=156mm}
+
+\newcommand*{\pageao} {\paperheight=1189mm \paperwidth=841mm}
+\newcommand*{\pageai} {\paperheight=841mm \paperwidth=594mm}
+\newcommand*{\pageaii} {\paperheight=594mm \paperwidth=420mm}
+\newcommand*{\pageaiii}{\paperheight=420mm \paperwidth=297mm}
+\newcommand*{\pageaiv} {\paperheight=297mm \paperwidth=210mm}
+\newcommand*{\pageav} {\paperheight=210mm \paperwidth=148mm}
+\newcommand*{\pageavi} {\paperheight=148mm \paperwidth=105mm}
+
+\newcommand*{\pagebo} {\paperheight=1414mm \paperwidth=1000mm}
+\newcommand*{\pagebi} {\paperheight=1000mm \paperwidth=707mm}
+\newcommand*{\pagebii} {\paperheight=707mm \paperwidth=500mm}
+\newcommand*{\pagebiii}{\paperheight=500mm \paperwidth=353mm}
+\newcommand*{\pagebiv} {\paperheight=353mm \paperwidth=250mm}
+\newcommand*{\pagebv} {\paperheight=250mm \paperwidth=176mm}
+\newcommand*{\pagebvi} {\paperheight=176mm \paperwidth=125mm}
+
+\DeclareOption{a0paper}{\stockao}
+\DeclareOption{a1paper}{\stockai}
+\DeclareOption{a2paper}{\stockaii}
\DeclareOption{a3paper}{\stockaiii}
\DeclareOption{a4paper}{\stockaiv}
\DeclareOption{a5paper}{\stockav}
\DeclareOption{a6paper}{\stockavi}
+\DeclareOption{b0paper}{\stockbo}
+\DeclareOption{b1paper}{\stockbi}
+\DeclareOption{b2paper}{\stockbii}
\DeclareOption{b3paper}{\stockbiii}
\DeclareOption{b4paper}{\stockbiv}
\DeclareOption{b5paper}{\stockbv}
@@ -544,10 +561,10 @@
{\setlength\stockheight {9in}%
\setlength\stockwidth {6in}}
-\DeclareOption{landscape}
- {\setlength\@tempdima {\stockheight}
- \setlength\stockheight{\stockwidth}
- \setlength\stockwidth {\@tempdima}}
+\newif\ifmemlandscape
+ \memlandscapefalse
+\DeclareOption{landscape}{\memlandscapetrue}
+\DeclareOption{portrait}{\memlandscapefalse}
\renewcommand*{\@ptsize}{0}
\renewcommand*{\@memptsize}{10}
@@ -623,8 +640,14 @@
\DeclareOption{oldfontcommands}{\@memoldfonttrue}
\DeclareOption{extrafontsizes}{\extrafontsizestrue}
-\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside}
-\ProcessOptions
+\ExecuteOptions{final,letterpaper,10pt,onecolumn,openright,twoside,
+ portrait}
+\ProcessOptions*
+ \ifmemlandscape
+ \setlength\@tempdima {\stockheight}
+ \setlength\stockheight{\stockwidth}
+ \setlength\stockwidth {\@tempdima}
+ \fi
\providecommand*{\memoirpostopthook}{}
\memoirpostopthook
@@ -881,19 +904,29 @@
\setlength{\textheight}{\@tempdima}%
\setlength{\textwidth}{\@tempdimb}}
+\newlength{\binding}
+\newcommand*{\setbinding}[1]{\setlength{\binding}{#1}}
+ \setbinding{0pt}
+
\newlength{\spinemargin}
\newlength{\foremargin}
\newcommand{\setlrmargins}[3]{%
+ \advance\paperwidth -\binding
\setfillsize{\paperwidth}{\textwidth}{#1}{#2}{#3}%
\setlength{\textwidth}{\@tempdimc}%
\setlength{\spinemargin}{\@tempdima}%
- \setlength{\foremargin}{\@tempdimb}}
+ \setlength{\foremargin}{\@tempdimb}%
+ \advance\paperwidth \binding
+ \advance\spinemargin \binding}
\newcommand{\setlrmarginsandblock}[3]{%
+ \advance\paperwidth -\binding
\setfillsize{\paperwidth}{*}{#1}{#2}{#3}%
\setlength{\textwidth}{\@tempdimc}%
\setlength{\spinemargin}{\@tempdima}%
- \setlength{\foremargin}{\@tempdimb}}
+ \setlength{\foremargin}{\@tempdimb}%
+ \advance\paperwidth \binding
+ \advance\spinemargin \binding}
\newlength{\uppermargin}
\newlength{\lowermargin}
@@ -1281,7 +1314,7 @@
\setulmarginsandblock{\uppermargin}{*}{2}}
\newcommand*{\setpagebl}[3]{%
- \settrimmedsize{#1}{#2}{#3}
+ \settrimmedsize{#1}{#2}{#3}%
\trimtop=\stockheight \advance\trimtop -\paperheight
\trimedge=\stockwidth \advance\trimedge -\paperwidth}
\newcommand*{\setpageml}[3]{%
@@ -1293,6 +1326,36 @@
\settrimmedsize{#1}{#2}{#3}
\trimtop=0pt
\trimedge=\stockwidth \advance\trimedge -\paperwidth}
+\newcommand*{\setpagetm}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=0pt
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
+
+\newcommand*{\setpagetr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=0pt
+ \trimedge=0pt}
+\newcommand*{\setpagemr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \advance\trimtop -0.5\trimtop
+ \trimedge=0pt}
+\newcommand*{\setpagebr}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \trimedge=0pt}
+\newcommand*{\setpagebm}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
+\newcommand*{\setpagecc}[3]{%
+ \settrimmedsize{#1}{#2}{#3}%
+ \trimtop=\stockheight \advance\trimtop -\paperheight
+ \advance\trimtop -0.5\trimtop
+ \trimedge=\stockwidth \advance\trimedge -\paperwidth
+ \advance\trimedge -0.5\trimedge}
\setcounter{topnumber}{3}
\renewcommand{\topfraction}{.85}
@@ -1325,8 +1388,27 @@
\@namedef{#1ofootr}{#4}
}
-\newcommand{\makerunningwidth}[2]{%
- \@namedef{#1runwidth}{#2}}
+\newcommand*{\makerunningwidth}[1]{%
+ \def\m@mhfstyle{#1}%
+ \m@mopthfwidth}
+\newcommand*{\m@mopthfwidth}[2][\@mpty]{%
+ \setlength\@tempdima{#2}
+ \expandafter\edef\csname \m@mhfstyle headrunwidth\endcsname{\the\@tempdima}
+ \ifx\@mpty #1
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}
+ \else
+ \setlength\@tempdima{#1}
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}
+ \fi}
+\newcommand*{\makerunningheadwidth}[2]{%
+ \setlength\@tempdima{#2}%
+ \expandafter\edef\csname \m@mhfstyle headrunwidth\endcsname{\the\@tempdima}%
+}
+\newcommand*{\makerunningfootwidth}[2]{%
+ \setlength\@tempdima{#2}%
+ \expandafter\edef\csname \m@mhfstyle footrunwidth\endcsname{\the\@tempdima}%
+}
+
\newlength{\normalrulethickness}
\setlength{\normalrulethickness}{0.4pt}
\newcommand{\footruleheight}{0pt}
@@ -1389,46 +1471,49 @@
\newcommand*{\m@mhe@dreset}{\def\baselinestretch{1}\normalsize}
+\newcommand*\makeheadfootvposition[3]{%
+ \@namedef{#1headvplacement}{#2}\@namedef{#1footvplacement}{#3}}
+
\newcommand{\makepagestyle}[1]{%
\@namedef{ps@#1}{%
\@namedef{#1@evenhead}{%
- \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1evenhpl}\hb@xt@\@nameuse{#1headrunwidth}{\m@mhe@dreset%
\vbox{\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedright\@nameuse{#1eheadl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\centering\@nameuse{#1eheadc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedleft\@nameuse{#1eheadr}\strut}}}%
\@nameuse{#1headrule}}}\@nameuse{#1evenhpr}}%
\@namedef{#1@oddhead}{%
- \@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1oddhpl}\hb@xt@\@nameuse{#1headrunwidth}{\m@mhe@dreset%
\vbox{\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedright\@nameuse{#1oheadl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\centering\@nameuse{#1oheadc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1headvplacement}]{\@nameuse{#1headrunwidth}}{%
\raggedleft\@nameuse{#1oheadr}\strut}}}%
\@nameuse{#1headrule}}}\@nameuse{#1oddhpr}}%
\@namedef{#1@evenfoot}{%
- \@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1evenfpl}\hb@xt@\@nameuse{#1footrunwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedright\@nameuse{#1efootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\centering\@nameuse{#1efootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedleft\@nameuse{#1efootr}\strut}}}%
}}\@nameuse{#1evenfpr}}%
\@namedef{#1@oddfoot}{%
- \@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1runwidth}{\m@mhe@dreset%
+ \@nameuse{#1oddfpl}\hb@xt@\@nameuse{#1footrunwidth}{\m@mhe@dreset%
\vbox{\@nameuse{#1footrule}\hbox{%
- \rlap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \rlap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedright\@nameuse{#1ofootl}\strut}}\hfill
- \parbox[b]{\@nameuse{#1runwidth}}{%
+ \parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\centering\@nameuse{#1ofootc}\strut}\hfill
- \llap{\parbox[b]{\@nameuse{#1runwidth}}{%
+ \llap{\parbox[\@nameuse{#1footvplacement}]{\@nameuse{#1footrunwidth}}{%
\raggedleft\@nameuse{#1ofootr}\strut}}}%
}}\@nameuse{#1oddfpr}}%
\def\@evenhead{\@nameuse{#1@evenhead}}%
@@ -1444,6 +1529,7 @@
\makeheadposition{#1}{}{}{}{}%
\makeheadrule{#1}{\textwidth}{0pt}%
\makefootrule{#1}{\textwidth}{\footruleheight}{\footruleskip}%
+ \makeheadfootvposition{#1}{b}{b}%
\makepsmarks{#1}{}}
\newcommand{\aliaspagestyle}[2]{%
@@ -1459,11 +1545,12 @@
{\@nameuse{#2efootc}}{\@nameuse{#2efootr}}%
\makeoddfoot{#1}{\@nameuse{#2ofootl}}%
{\@nameuse{#2ofootc}}{\@nameuse{#2ofootr}}%
- \makerunningwidth{#1}{\@nameuse{#2runwidth}}%
+ \makerunningwidth{#1}[\@nameuse{#2footrunwidth}]{\@nameuse{#2headrunwidth}}%
\@namedef{#1evenhpl}{\@nameuse{#2evenhpl}}%
\@namedef{#1oddhpl}{\@nameuse{#2oddhpl}}%
\@namedef{#1evenhpr}{\@nameuse{#2evenhpr}}%
\@namedef{#1oddhpr}{\@nameuse{#2oddhpr}}%
+ \makeheadfootvposition{#1}{\@namedef{#2headvplacement}}{\@namedef{#2footvplacement}}%
\@namedef{#1evenfpl}{\@nameuse{#2evenfpl}}%
\@namedef{#1oddfpl}{\@nameuse{#2oddfpl}}%
\@namedef{#1evenfpr}{\@nameuse{#2evenfpr}}%
@@ -1758,6 +1845,41 @@
\makeoddhead{companion}{\normalfont\bfseries\rightmark}{}%
{\normalfont\bfseries\thepage}
+\newif\ifshowheadfootloc
+ \showheadfootloctrue
+\newcommand*{\showheadfootlocon}{\showheadfootloctrue}
+\newcommand*{\showheadfootlocoff}{\showheadfootlocfalse}
+\newif\ifshowtextblockloc
+ \showtextblockloctrue
+\newcommand*{\showtextblocklocon}{\showtextblockloctrue}
+\newcommand*{\showtextblocklocoff}{\showtextblocklocfalse}
+
+\newcommand*{\framepichead}{%
+\ifshowheadfootloc
+ \begin{picture}(0,0)
+ \unitlength 1pt
+ \put(0,0){\line(1,0){\strip@pt\textwidth}}
+ \end{picture}%
+\fi}
+
+\newcommand*{\framepictextfoot}{%
+ \begin{picture}(0,0)
+ \unitlength 1pt
+ \ifshowheadfootloc
+ \put(0,0){\line(1,0){\strip@pt\textwidth}}
+ \fi
+ \ifshowtextblockloc
+ \put(0,\strip@pt\footskip)%
+ {\framebox(\strip@pt\textwidth,\strip@pt\textheight){}}
+ \fi
+ \end{picture}}
+
+\makepagestyle{showlocs}
+\makeevenhead{showlocs}{\framepichead\thepage}{\thepage}{\thepage}
+\makeoddhead{showlocs}{\framepichead\thepage}{\thepage}{\thepage}
+\makeevenfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
+\makeoddfoot{showlocs}{\framepictextfoot\thepage}{\thepage}{\thepage}
+
\renewcommand{\pagenumbering}{%
\@ifstar{\@smempnum}{\@mempnum}}
\newcommand{\@smempnum}[1]{%
@@ -3695,6 +3817,68 @@
\twocolumn
\fi}
+\let\memorigdbs\\
+\let\memorigpar\par
+\let\atcentercr\@centercr
+
+\newcommand*{\flushleftright}{%
+ \let\\\memorigdbs
+ \leftskip\z@skip
+ \rightskip\leftskip
+ \parfillskip\@flushglue
+ \everypar{}}
+
+\newcommand*{\linenottooshort}[1][4em]{%
+ \@tempdima=\hsize
+ \advance\@tempdima -#1
+ \leftskip\z@skip
+ \rightskip\leftskip
+ \parfillskip=\@tempdima \@minus \@tempdima}
+
+\newcommand*{\russianpar}{\ifhmode\unskip
+ \strut\vadjust{}\nobreak
+ \discretionary{}%
+ {\hbox{\hskip2\parindent
+ \vrule depth 273sp width 0sp height \ht\strutbox}}%
+ {\hbox{\hskip\parindent}}%
+ \hskip-2\parindent \@minus 2\parindent
+ \hskip\hsize \@minus \hsize
+ \kern\z@ \parfillskip\z@
+ \memorigpar
+ \ifdim\prevdepth=273sp
+ \nobreak
+ \vskip-2\baselineskip
+ \hbox{\strut}%
+ \fi\fi}
+
+\newcommand*{\lastlineparrule}{%
+ \hrule height 0.5ex depth \@tempdimb\relax}
+\newcommand*{\lastlinerulefill}{%
+ \let\\\@centercr
+ \@tempdimb=-0.5ex \advance\@tempdimb 0.4pt
+ \unskip\nobreak\space
+ \leaders\lastlineparrule\hskip\@flushglue
+ \vadjust{}{\parfillskip\z@\memorigpar}}
+
+\newcommand*{\centerlastline}{%
+ \leftskip\@flushglue
+ \rightskip=\z@ plus -1fil
+ \parfillskip=\z@ plus 2fil}
+
+\newcommand*{\leftcenterright}{%;
+ \let\\\break
+ \parindent\z@
+ \leftskip\@flushglue
+ \rightskip\leftskip
+ \parfillskip \z@ \@plus -1fil
+ \everypar={\hskip \z@ \@plus -1fil}}
+
+\newcommand*{\centerfloat}{%
+ \parindent \z@
+ \leftskip \z@ \@plus 1fil \@minus \textwidth
+ \rightskip\leftskip
+ \parfillskip \z@skip}
+
\newdimen\ragrparindent
\setlength{\ragrparindent}{\parindent}
\newcommand{\raggedyright}[1][2em]{%
@@ -3702,6 +3886,19 @@
\leftskip\z@skip
\parindent\ragrparindent}
+\newcommand*{\justlastraggedleft}{%
+ \leftskip\@flushglue
+ \rightskip-\leftskip
+ \parfillskip\leftskip
+ \parindent \z@}
+
+\newcommand*{\raggedrightthenleft}{%
+ \parindent \z@
+ \leftskip \z@ \@plus 1fill
+ \rightskip\@flushglue
+ \parfillskip \z@
+ \everypar{\hskip \z@ \@plus -1fill}}
+
\newcommand{\hangfrom}[1]{%
\setbox\@tempboxa\hbox{{#1}}%
\hangindent \wd\@tempboxa\noindent\box\@tempboxa}
@@ -3710,6 +3907,17 @@
\newenvironment{hangparas}[2]{\setlength{\parindent}{\z@}
\everypar={\hangpara{#1}{#2}}}{\par}
+\newcommand{\leftspringright}[4]{%
+ \@tempdimb=\hsize
+ \par\noindent\hbox to\@tempdimb{%
+ \vtop{\hsize=#1\@tempdimb \flushleft#3\par}\hss
+ \vtop{\hsize=#2\@tempdimb \flushright#4\par}}}
+
+\newcommand*{\sourceatright}[2][2em]{{%
+ \unskip\nobreak\hfil\penalty50
+ \hskip#1\hbox{}\nobreak\hfil{#2}
+ \parfillskip\z@\finalhyphendemerits=0\par}}
+
\if@twocolumn
\setlength{\leftmargini}{2em}
\else
@@ -5653,14 +5861,6 @@
\newcommand{\captiontitlefont}[1]{\def\@conttfont{#1}}
\captiontitlefont{}
-\newcommand*{\flushleftright}{%
- \leftskip\z@ \rightskip\z@
- \parfillskip\@flushglue}
-\newcommand*{\centerlastline}{%
- \parfillskip=\z@ plus 2fil
- \rightskip=\z@ plus -1fil
- \leftskip\@flushglue}
-
\newcommand*{\captionstyle}[1]{\def\@contcstyle{#1}}
\captionstyle{}
@@ -6282,6 +6482,9 @@
\@ifnextchar [{\@sidecaption}{\@sidecaption[]}}
\def\@sidecaption[#1]#2{%
\@ifnextchar [{\@@sidecaption{#1}{#2}}{\@@sidecaption{#1}{#2}[]}}
+\newcommand\@mem@scap@beforehook{}
+\newcommand\@mem@scap@afterhook{}
+
\def\@@sidecaption#1#2[#3]{%
\ifx\@empty#1\@empty
\def\m@mscap@fortoc{#2}%
@@ -6297,6 +6500,7 @@
\m@mscapstart@fbox}
\newcommand*{\m@mscapstart@fbox}{%
+ \@mem@scap@beforehook%
\setlength{\m@mscapmainwidth}{\sidecapfloatwidth}%
\setm@mscaplkern
\begin{lrbox}{\m@mscap@fbox}%
@@ -6326,7 +6530,9 @@
\rlap{\kern\sidecapsep
\raisebox{\m@mscapraise}{\usebox{\m@mscap@capbox}}}%
\fi
- \gdef\m@mscapthisside{}}
+ \gdef\m@mscapthisside{}%
+ \@mem@scap@afterhook%
+}
\newcommand*{\m@mcalcscapraise}{%
\def\@tempb{t}%
@@ -6719,10 +6925,16 @@
\let\@mem@nestwarn\@gobble
\let\M@TitleReference\@firstoftwo
-\DeclareRobustCommand{\titleref}[1]{\begingroup \let\numberline\@gobble
+\newcommand*\@mem@titleref[1]{\begingroup
+ \let\numberline\@gobble
\let\M@TitleReference\@mem@theTR % interrupt recursion of \ref
\ref{#1}\endgroup}
-\DeclareRobustCommand{\currenttitle}{\begingroup \let\numberline\@gobble
+\let\@mem@titlerefnolink\@mem@titleref
+
+\DeclareRobustCommand\titleref{\@ifstar{\@mem@titlerefnolink}{\@mem@titleref}}
+
+\DeclareRobustCommand{\currenttitle}{\begingroup
+ \let\numberline\@gobble
\theTitleReference\@currentlabel\M@currentTitle\endgroup}
\let\M@currentTitle\@empty
@@ -6762,6 +6974,7 @@
\begingroup
%%% \parindent\z@ \parskip\cftparskip
\@nameuse{@#2maketitle}
+\parskip\cftparskip
\@starttoc{#2}%
\endgroup
\restorefromonecol}
@@ -7125,7 +7338,7 @@
\newcommand{\chapterprecistoc}[1]{%
\addtocontents{toc}{\precistoctext{#1}}}
\DeclareRobustCommand{\precistoctext}[1]{%
- {\leftskip \cftchapterindent\relax
+ {\nopagebreak\leftskip \cftchapterindent\relax
\advance\leftskip \cftchapternumwidth\relax
\rightskip \@tocrmarg\relax
\precistocfont #1\par}}
@@ -7797,7 +8010,8 @@
\hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}%
}
-\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent}
+\newcommand{\parnopar}{\parfillskip=0pt\par\parskip=0pt\noindent
+ \parfillskip\@flushglue}
\newif\ifreversesidepar
\reversesidepartrue
@@ -11438,7 +11652,7 @@
\AtBeginPackage{float}{\let\newfloat\relax}
-\InputIfFileExists{mempatch.sty} % should be this
+\InputIfFileExists{mempatch.sty}{}{} % should be this
\endinput
%%