summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/memoir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-01-28 00:54:45 +0000
committerKarl Berry <karl@freefriends.org>2009-01-28 00:54:45 +0000
commit1cf91a6aa1a270f53850002b99132287886165ae (patch)
treeb1913fe01842dd9ecb401b734e9e7462f2271af1 /Master/texmf-dist/source/latex/memoir
parent7d2fbdd12223e7c4c050a70e544874f6f8111ab4 (diff)
memoir update (27jan09)
git-svn-id: svn://tug.org/texlive/trunk@11997 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/memoir')
-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
3 files changed, 736 insertions, 116 deletions
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.
%