From 7ebe75c756258ce417125e376f199df4fd5b47a9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 15 Nov 2019 21:40:34 +0000 Subject: memoir (15nov19) git-svn-id: svn://tug.org/texlive/trunk@52807 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/memoir/memoir.dtx | 587 ++++++++++++++++------- 1 file changed, 421 insertions(+), 166 deletions(-) (limited to 'Master/texmf-dist/source/latex/memoir/memoir.dtx') diff --git a/Master/texmf-dist/source/latex/memoir/memoir.dtx b/Master/texmf-dist/source/latex/memoir/memoir.dtx index 2fd0bb32a55..aefdd23d051 100644 --- a/Master/texmf-dist/source/latex/memoir/memoir.dtx +++ b/Master/texmf-dist/source/latex/memoir/memoir.dtx @@ -20,7 +20,7 @@ % This work consists of the files listed in the README file. % % \fi -% \CheckSum{31004} +% \CheckSum{31140} % % \changes{v0.1}{2001/05/20}{First public alpha release} % \changes{v0.2}{2001/06/03}{First beta release} @@ -117,6 +117,7 @@ % \changes{v3.7f}{2016/05/16}{Maintenance, luatex85 and booktabs update} % % \changes{v3.7h}{2018/12/12}{Maintenance, removing some emulated packages} +% \changes{v3.7i}{2019/11/15}{Maintenance, various edits} % % \def\dtxfile{memoir.dtx} % @@ -172,7 +173,8 @@ % \def\fileversion{v3.7e} \def\filedate{2015/07/08} % \def\fileversion{v3.7f} \def\filedate{2016/05/16} % \def\fileversion{v3.7g} \def\filedate{2018/04/04} -% \def\fileversion{v3.7h} \def\filedate{2018/12/12} ^^A remember to fix +% \def\fileversion{v3.7h} \def\filedate{2018/12/12} +% \def\fileversion{v3.7i} \def\filedate{2019/11/15} % \title{The LaTeX \Lpack{memoir} class for configurable book % typesetting: Source code\thanks{This % file (\texttt{\dtxfile}) has version number \fileversion, last revised @@ -403,11 +405,11 @@ % Announce the name, option files and version for LaTeX2e files: % \begin{macrocode} %\ProvidesClass{memoir}% -% [2018/12/12 v3.7h configurable book, report, article document class] +% [2019/11/15 v3.7i configurable book, report, article document class] % \end{macrocode} % In the manual it is useful to know the current version. % \begin{macrocode} -%\newcommand\memversion{v3.7h, 2018/12/12} +%\newcommand\memversion{v3.7i, 2019/11/15} %<9pt>\ProvidesFile{mem9.clo}% %<9pt> [2008/01/30 v0.4 memoir class 9pt size option] %<10pt>\ProvidesFile{mem10.clo}% @@ -887,17 +889,43 @@ % \IfFileExists{#1}% % {\#2\@addtofilelist{#1}\@@input \@filef@und}} % \end{verbatim} +% and as of 2019/10/01: +% \begin{verbatim} +% \DeclareRobustCommand \InputIfFileExists[2]{% +% \IfFileExists{#1}% +% {\expandafter\@swaptwoargs\expandafter +% {\@filef@und}{#2\@addtofilelist{#1}\@@input}}} +% \end{verbatim} +% Just to make sure we still work on formats prior and after +% 2019/10/01 we `redefine' both % % \begin{macro}{\InputIfFileExists} % Effectively all file input is handled by this macro. Extend it % by adding pre- and post- input hooks. -% \begin{macrocode} +% +% \changes{3.7i}{2019/10/22}{Added latest kernel changes, special +% thanks to Phelype Oleinik} +% \begin{macrocode} +\ifcsname InputIfFileExists \endcsname% looking for an explicit space + % here aka the robust version + \DeclareRobustCommand \InputIfFileExists[2]{% + \IfFileExists{#1}% + {% + \expandafter\@swaptwoargs\expandafter + {\@filef@und\m@matendf{#1}\killm@matf{#1}}{% + #2\@addtofilelist{#1}\m@matbeginf{#1}\@@input% + }% + }% + } +\else + % Old definition \renewcommand{\InputIfFileExists}[2]{% \IfFileExists{#1}% {#2\@addtofilelist{#1}\m@matbeginf{#1}% \@@input \@filef@und \m@matendf{#1}% \killm@matf{#1}}} +\fi % \end{macrocode} % \end{macro} @@ -1128,112 +1156,143 @@ % % \subsection{Checking the processor} % -% Prior to 2008/07/22 the \Lpack{hyperref} package was modified in such a -% way as to produce warnings about versions of the \Lpack{ifpdf} and -% \Lpack{ifxetex} packages when \Lpack{hyperref} was used with versions -% v1.618033, -% v1.61803, or v1.618 mempatch v4.9 of the class. -% \Lpack{hyperref}'s author refused to -% make any changes to his package, insisting that emulating a package was -% `ugly hacking'. He did, though, provide an example code that could be -% added to memoir -% to use a package if it was available. I have used it for the emulations -% in this section. There will be no further changes to the class to accomodate -% any further changes to \Lpack{hyperref} --- it's easy for a package to -% determine what class is being used and make arrangements accordingly, -% especially as there are not all that many classes. There are hundreds -% of packages that might be used with a particular class and it would be -% senseless for a class to attempt to take account of everything that might -% be used with it. -% +% As of November 2019, we load the \Lpack{iftex} package in order to +% the the various processor tests. The package was updated in 2019 to +% cover the functionality of the \Lpack{ifpdf}, \Lpack{ifetex}, +% \Lpack{ifxetex} and \Lpack{ifluatex} packages. You can find details +% about its use in \cite{IFTEX}. +% \changes{v3.7i}{2019/11/11}{Changed +% ifX package loading to just loading the new \Lpack{iftex} +% package. At the request of the LaTeX Project Team.} +% \begin{macrocode} +\RequirePackage{iftex}[2019/11/07] +% \end{macrocode} +% The \Lpack{iftex} provides the following tests +% (and several more): +% \begin{macro}{\ifpdf} +% True if the output mode is PDF. Useful if for example you are +% working in an environment where you need to provide explicit code +% for the LaTeX+dvips route. +% \end{macro} +% \begin{macro}{\ifxetex} +% True if the XeTeX engine is being used. +% \end{macro} +% \begin{macro}{\ifluatex} +% True if the LuaTeX engine is being used. Useful if you want to add +% code that only apply under the LuaTeX based engines. +% \end{macro} +% +% +% +% ^^A % Prior to 2008/07/22 the \Lpack{hyperref} package was modified in such a +% ^^A % way as to produce warnings about versions of the \Lpack{ifpdf} and +% ^^A % \Lpack{ifxetex} packages when \Lpack{hyperref} was used with versions +% ^^A % v1.618033, +% ^^A % v1.61803, or v1.618 mempatch v4.9 of the class. +% ^^A % \Lpack{hyperref}'s author refused to +% ^^A % make any changes to his package, insisting that emulating a package was +% ^^A % `ugly hacking'. He did, though, provide an example code that could be +% ^^A % added to memoir +% ^^A % to use a package if it was available. I have used it for the emulations +% ^^A % in this section. There will be no further changes to the class to accomodate +% ^^A % any further changes to \Lpack{hyperref} --- it's easy for a package to +% ^^A % determine what class is being used and make arrangements accordingly, +% ^^A % especially as there are not all that many classes. There are hundreds +% ^^A % of packages that might be used with a particular class and it would be +% ^^A % senseless for a class to attempt to take account of everything that might +% ^^A % be used with it. +% ^^A % % ^^A % Note (2016/05/16): Due to recent changes in Luatex, most notably the % ^^A % removal of several \cs{pdf...} macro, several PDF tests fail with % ^^A % LuaLaTeX. As a temporary measure the following is used to restore % ^^A % the old functionality when a newer LuaLaTeX is used. Code courtesy % ^^A % of David Carlisle. At some point we will include some of this into % ^^A % the class. -% \changes{v3.7f}{2016/05/16}{Temp measure to make the class work with -% updated luatex} -% \changes{v3.7g}{2018/03/09}{\Lpack{luatex85} removed again, now -% relying on external \cs{if} packages and have rewritten the -% macros that use \cs{pdf...}} +% ^^A % \changes{v3.7f}{2016/05/16}{Temp measure to make the class work with +% ^^A % updated luatex} +% ^^A % \changes{v3.7g}{2018/03/09}{\Lpack{luatex85} removed again, now +% ^^A % relying on external \cs{if} packages and have rewritten the +% ^^A % macros that use \cs{pdf...}} +% ^^A % ^^A % \begin{macrocode} +% ^^A % ^^A \ifx\pdfextension\@undefined\else +% ^^A % ^^A \RequirePackage{luatex85} +% ^^A % ^^A \fi +% ^^A % ^^A +% ^^A % ^^A % \end{macrocode} +% ^^A % +% ^^A % +% ^^A % \begin{macro}{\ifpdf} +% ^^A % This can be used to check whether or not a document is being processed +% ^^A % by \LaTeX{} or pdf\LaTeX. We will simply require the \Lpack{ifpdf} package. +% ^^A % \changes{v1.0}{2001/09/21}{Made checking of \cs{pdfouput} more robust} +% ^^A % \changes{v1.618}{2005/09/03}{Prohibit loading the ifpdf package (mempatch v3.9)} +% ^^A % \changes{v1.618033}{2008/06/02}{Further improved pdf checking} +% ^^A % \changes{v1.6180339}{2008/07/23}{Use ifpdf package if available} +% ^^A % \changes{v1.61803398d}{2009/12/01}{if \cs{ifpdf} is already +% ^^A % defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, +% ^^A % then using \cs{newif}\cs{ifpdf} will cause TeX to eat up a lot of +% ^^A % code. We fix this using a hint by Will Robertson.} +% ^^A % \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be +% ^^A % emulating \cs{if}\meta{engine} packages, you'll get an error if you +% ^^A % do not have them} % ^^A % \begin{macrocode} -% ^^A \ifx\pdfextension\@undefined\else -% ^^A \RequirePackage{luatex85} -% ^^A \fi -% ^^A +% ^^A % \RequirePackage{ifpdf}[2017/03/15] % ^^A % \end{macrocode} -% +% ^^A % \end{macro} +% ^^A % +% ^^A % \begin{macro}{\ifetex} +% ^^A % Check if \texttt{etex} is being used. We will simply require the \Lpack{ifetex} package. +% ^^A % \changes{v1.61803}{2008/01/30}{Added check for etex (mempatch v4.9)} +% ^^A % \changes{v1.618033}{2008/06/02}{Improved check for etex} +% ^^A % \changes{v1.6180339}{2008/07/23}{Use an ifetex package if available} +% ^^A % \changes{v1.6180339c}{2008/12/27}{Changed ifetex message from Warning to Info} +% ^^A % \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be +% ^^A % emulating \cs{if}\meta{engine} packages, you'll get an error if you +% ^^A % do not have them} +% ^^A % \begin{macrocode} +% ^^A % \RequirePackage{ifetex} +% ^^A % \end{macrocode} +% ^^A % \end{macro} +% ^^A % Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used, +% ^^A % here's one for XeTeX. +% ^^A % +% ^^A % \begin{macro}{\ifxetex} +% ^^A % Checks if XeTeX is being used. We will simply require the \Lpack{ifxetex} package. +% ^^A % \changes{v1.61803}{2008/01/30}{Added checks for XeTeX (mempatch v4.9)} +% ^^A % \changes{v1.6180339}{2008/07/23}{Use ifxetex package if available} +% ^^A % \changes{v1.61803398d}{2009/12/01}{if \cs{ifxetex} is already +% ^^A % defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, +% ^^A % then using \cs{newif}\cs{ifxetex} will cause TeX to eat up a lot of +% ^^A % code. We fix this using a hint by Will Robertson.} +% ^^A % \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be +% ^^A % emulating \cs{if}\meta{engine} packages, you'll get an error if you +% ^^A % do not have them} +% ^^A % \begin{macrocode} +% ^^A % \RequirePackage{ifxetex}[2010/09/12] +% ^^A % \end{macrocode} +% ^^A % \end{macro} +% ^^A % +% ^^A % \begin{macro}{\ifluatex} +% ^^A % Check if \texttt{luatex} is being used. We will simply require the \Lpack{ifluatex} package. +% ^^A % \changes{v1.61803}{2008/01/30}{Added check for luatex} +% ^^A % \changes{v1.6180339}{2008/07/23}{Use an ifluatex package if available} +% ^^A % \changes{v1.6180339c}{2008/12/31}{It seems that Heiko Oberdiek has created an +% ^^A % ifluatex package.} +% ^^A % \changes{v1.61803398d}{2009/12/01}{if \cs{ifluatex} is already +% ^^A % defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, +% ^^A % then using \cs{newif}\cs{ifluatex} will cause TeX to eat up a lot of +% ^^A % code. We fix this using a hint by Will Robertson.} +% ^^A % \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be +% ^^A % emulating \cs{if}\meta{engine} packages, you'll get an error if you +% ^^A % do not have them} +% ^^A % \begin{macrocode} +% ^^A % \RequirePackage{ifluatex}[2016/05/16] +% ^^A % +% ^^A % \end{macrocode} +% ^^A % \end{macro} +% ^^A % % -% \begin{macro}{\ifpdf} -% This can be used to check whether or not a document is being processed -% by \LaTeX{} or pdf\LaTeX. We will simply require the \Lpack{ifpdf} package. -% \changes{v1.0}{2001/09/21}{Made checking of \cs{pdfouput} more robust} -% \changes{v1.618}{2005/09/03}{Prohibit loading the ifpdf package (mempatch v3.9)} -% \changes{v1.618033}{2008/06/02}{Further improved pdf checking} -% \changes{v1.6180339}{2008/07/23}{Use ifpdf package if available} -% \changes{v1.61803398d}{2009/12/01}{if \cs{ifpdf} is already -% defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, -% then using \cs{newif}\cs{ifpdf} will cause TeX to eat up a lot of -% code. We fix this using a hint by Will Robertson.} -% \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be -% emulating \cs{if}\meta{engine} packages, you'll get an error if you -% do not have them} -% \begin{macrocode} -\RequirePackage{ifpdf}[2017/03/15] -% \end{macrocode} -% \end{macro} % -% \begin{macro}{\ifetex} -% Check if \texttt{etex} is being used. We will simply require the \Lpack{ifetex} package. -% \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} -% \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be -% emulating \cs{if}\meta{engine} packages, you'll get an error if you -% do not have them} -% \begin{macrocode} -\RequirePackage{ifetex} -% \end{macrocode} -% \end{macro} -% Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used, -% here's one for XeTeX. -% -% \begin{macro}{\ifxetex} -% Checks if XeTeX is being used. We will simply require the \Lpack{ifxetex} package. -% \changes{v1.61803}{2008/01/30}{Added checks for XeTeX (mempatch v4.9)} -% \changes{v1.6180339}{2008/07/23}{Use ifxetex package if available} -% \changes{v1.61803398d}{2009/12/01}{if \cs{ifxetex} is already -% defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, -% then using \cs{newif}\cs{ifxetex} will cause TeX to eat up a lot of -% code. We fix this using a hint by Will Robertson.} -% \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be -% emulating \cs{if}\meta{engine} packages, you'll get an error if you -% do not have them} -% \begin{macrocode} -\RequirePackage{ifxetex}[2010/09/12] -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\ifluatex} -% Check if \texttt{luatex} is being used. We will simply require the \Lpack{ifluatex} package. -% \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.} -% \changes{v1.61803398d}{2009/12/01}{if \cs{ifluatex} is already -% defined, e.g. using \cs{RequirePackage} before \cs{documentclass}, -% then using \cs{newif}\cs{ifluatex} will cause TeX to eat up a lot of -% code. We fix this using a hint by Will Robertson.} -% \changes{v3.7g}{2018/03/08}{As of 2018, we will no longer be -% emulating \cs{if}\meta{engine} packages, you'll get an error if you -% do not have them} -% \begin{macrocode} -\RequirePackage{ifluatex}[2016/05/16] - -% \end{macrocode} -% \end{macro} % % \subsection{Extending an existing macro} % @@ -1776,9 +1835,11 @@ % \begin{macro}{\stockaiv} % \begin{macro}{\stockav} % \begin{macro}{\stockavi} -% The A series, A0 --- A6. +% \begin{macro}{\stockavii} +% The A series, A0 --- A7. % \changes{v1.6180339c}{2008/12/26}{Extended the A and B stock/paper size -% seies with A/B0 through A/B2} +% seies with A/B0 through A/B6} +% \changes{v3.7i}{2019/11/04}{Added A7 stock} % \begin{macrocode} \newcommand*{\stockao} {\stockheight=1189mm \stockwidth=841mm} \newcommand*{\stockai} {\stockheight=841mm \stockwidth=594mm} @@ -1787,6 +1848,7 @@ \newcommand*{\stockaiv} {\stockheight=297mm \stockwidth=210mm} \newcommand*{\stockav} {\stockheight=210mm \stockwidth=148mm} \newcommand*{\stockavi} {\stockheight=148mm \stockwidth=105mm} +\newcommand*{\stockavii}{\stockheight=105mm \stockwidth=74mm} % \end{macrocode} % \end{macro} @@ -1796,6 +1858,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\stockbo} % \begin{macro}{\stockbi} @@ -1804,7 +1867,9 @@ % \begin{macro}{\stockbiv} % \begin{macro}{\stockbv} % \begin{macro}{\stockbvi} -% The B series, B0 --- B6. +% \begin{macro}{\stockbvii} +% The B series, B0 --- B7. +% \changes{v3.7i}{2019/11/04}{added B7 stock} % \begin{macrocode} \newcommand*{\stockbo} {\stockheight=1414mm \stockwidth=1000mm} \newcommand*{\stockbi} {\stockheight=1000mm \stockwidth=707mm} @@ -1813,6 +1878,7 @@ \newcommand*{\stockbiv} {\stockheight=353mm \stockwidth=250mm} \newcommand*{\stockbv} {\stockheight=250mm \stockwidth=176mm} \newcommand*{\stockbvi} {\stockheight=176mm \stockwidth=125mm} +\newcommand*{\stockbvii}{\stockheight=125mm \stockwidth=88mm} % \end{macrocode} % \end{macro} @@ -1822,6 +1888,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % It will be useful also to provide macros that set the page sizes. % @@ -1929,7 +1996,9 @@ % \begin{macro}{\pageaiv} % \begin{macro}{\pageav} % \begin{macro}{\pageavi} -% The A series, A0 --- A6. +% \begin{macro}{\pageavii} +% The A series, A0 --- A7. +% \changes{v3.7i}{2019/11/04}{added A7 paper} % \begin{macrocode} \newcommand*{\pageao} {\paperheight=1189mm \paperwidth=841mm} \newcommand*{\pageai} {\paperheight=841mm \paperwidth=594mm} @@ -1938,6 +2007,7 @@ \newcommand*{\pageaiv} {\paperheight=297mm \paperwidth=210mm} \newcommand*{\pageav} {\paperheight=210mm \paperwidth=148mm} \newcommand*{\pageavi} {\paperheight=148mm \paperwidth=105mm} +\newcommand*{\pageavii}{\paperheight=105mm \paperwidth=74mm} % \end{macrocode} % \end{macro} @@ -1947,6 +2017,7 @@ % \end{macro} % \end{macro} % \end{macro} +% \end{macro} % % \begin{macro}{\pagebo} % \begin{macro}{\pagebi} @@ -1955,7 +2026,9 @@ % \begin{macro}{\pagebiv} % \begin{macro}{\pagebv} % \begin{macro}{\pagebvi} -% The B series, B0 --- B6. +% \begin{macro}{\pagebvii} +% The B series, B0 --- B7. +% \changes{v3.7i}{2019/11/04}{Added B7 paper} % \begin{macrocode} \newcommand*{\pagebo} {\paperheight=1414mm \paperwidth=1000mm} \newcommand*{\pagebi} {\paperheight=1000mm \paperwidth=707mm} @@ -1964,6 +2037,7 @@ \newcommand*{\pagebiv} {\paperheight=353mm \paperwidth=250mm} \newcommand*{\pagebv} {\paperheight=250mm \paperwidth=176mm} \newcommand*{\pagebvi} {\paperheight=176mm \paperwidth=125mm} +\newcommand*{\pagebvii}{\paperheight=125mm \paperwidth=88mm} % \end{macrocode} % \end{macro} @@ -1973,12 +2047,14 @@ % \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} +% \changes{v3.7i}{2019/11/04}{Added a7paper and b7paper options} % \begin{macrocode} \DeclareOption{a0paper}{\stockao} \DeclareOption{a1paper}{\stockai} @@ -1987,6 +2063,7 @@ \DeclareOption{a4paper}{\stockaiv} \DeclareOption{a5paper}{\stockav} \DeclareOption{a6paper}{\stockavi} +\DeclareOption{a7paper}{\stockavii} \DeclareOption{b0paper}{\stockbo} \DeclareOption{b1paper}{\stockbi} \DeclareOption{b2paper}{\stockbii} @@ -1994,6 +2071,7 @@ \DeclareOption{b4paper}{\stockbiv} \DeclareOption{b5paper}{\stockbv} \DeclareOption{b6paper}{\stockbvi} +\DeclareOption{b7paper}{\stockbvii} \DeclareOption{mcrownvopaper}{\stockmcrownvo} \DeclareOption{mlargecrownvopaper}{\stockmlargecrownvo} \DeclareOption{mdemyvopaper}{\stockmdemyvo} @@ -6531,30 +6609,65 @@ % \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 +% \meta{show} (= \texttt{shownumber}, \texttt{nonumber} or \texttt{notitle}) controls the % display of the divison number in \cs{mainmatter}, \meta{prefix} is text % before the number and \meta{postfix} is text after the number. % \begin{macrocode} \newcommand\createmark[5]{% % \end{macrocode} -% Handle \texttt{(show/no)number}, fails to \texttt{shownumber}. +% Handle \texttt{(show/no)number/notitle}. +% \changes{v3.7i}{2019/11/07}{Added notitle show option and +% reimplemented its checking a bit} % \begin{macrocode} - \def\@tempa{00} + % \def\@tempa{00} + % \nametest{#3}{nonumber}% + % \ifsamename + % \def\@tempa{01}% + % \else + % \nametest{#3}{shownumber} + % \ifsamename\else + % \@memerror{Unknown numbering value `#3' for #1mark}% + % {I expected `shownumber' or `nonumber'.\MessageBreak + % I will assume you meant `shownumber'}% + % \fi + % \fi + % \expandafter\if\@tempa% compares the two \@tempa digits + % \@namedef{#1marksn}##1{##1}% + % \else + % \@namedef{#1marksn}{\@gobble}% + % \fi + \def\@tempa{1} \nametest{#3}{nonumber}% \ifsamename - \def\@tempa{01}% + \def\@tempa{0} \else \nametest{#3}{shownumber} - \ifsamename\else - \@memerror{Unknown numbering value `#3' for #1mark}% - {I expected `shownumber' or `nonumber'.\MessageBreak - I will assume you meant `shownumber'}% + \ifsamename + \def\@tempa{1} + \else + \nametest{#3}{notitle} + \ifsamename + \def\@tempa{2} + \else + \@memerror{Unknown numbering value `#3' for + #1mark,\MessageBreak + please use one of 'shownumber', 'nonumber' or 'notitle'}% + {I expected `shownumber', `nonumber' or 'notitle'.\MessageBreak + I will assume you meant `shownumber'}% + \fi \fi \fi - \expandafter\if\@tempa% compares the two \@tempa digits - \@namedef{#1marksn}##1{##1}% - \else + \@namedef{#1markst}##1{##1} + \ifcase\@tempa\relax + % nonumber \@namedef{#1marksn}{\@gobble}% + \or % 1 + % shownumber + \@namedef{#1marksn}##1{##1} + \or % 2, 2 implies shownumber + % shownumber + \@namedef{#1marksn}##1{##1} + \@namedef{#1markst}{\@gobble} \fi % \end{macrocode} % The three \meta{marks} cases, \texttt{left}, \texttt{both} and @@ -6573,7 +6686,14 @@ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}% \fi \fi - ##1}}{}}% +% \end{macrocode} +% \changes{v3.7i}{2019/11/07}{Added macro to get rid of the title if needed} +% \begin{macrocode} + \@nameuse{#1markst}{##1}% + }% + }% + {}% just left + }% \else \nametest{#2}{right} \ifsamename @@ -6587,7 +6707,13 @@ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}% \fi% \fi% - ##1}}}% +% \end{macrocode} +% \changes{v3.7i}{2019/11/07}{Added macro to get rid of the title if needed} +% \begin{macrocode} + \@nameuse{#1markst}{##1}% + }% + }% + }% \else \nametest{#2}{both}% \ifsamename\else @@ -6606,16 +6732,28 @@ \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}% \fi \fi - ##1}}{% +% \end{macrocode} +% \changes{v3.7i}{2019/11/07}{Added macro to get rid of the title if needed} +% \begin{macrocode} + \@nameuse{#1markst}{##1}% + }% + }{% \memUChead{% \ifnum \c@secnumdepth > \c@@memmarkcntra \if@mainmatter \@nameuse{#1marksn}{#4\@nameuse{the#1}#5}% \fi \fi - ##1}}}% +% \end{macrocode} +% \changes{v3.7i}{2019/11/07}{Added macro to get rid of the title if needed} +% \begin{macrocode} + \@nameuse{#1markst}{##1}% + }% + }% + }% \fi - \fi} + \fi +} % \end{macrocode} % \end{macro} @@ -18196,8 +18334,16 @@ \else\ifx\hline\LT@hline \let\@BTswitch\@BLTrule \else - \let\@BTswitch\@BTnormal - \fi\fi +% \end{macrocode} +% \changes{v3.7i}{2019/10/21}{Added this extra if construction to +% bring the class back into line with the latest booktabs changes, now +% matching booktabs v1.6180339} +% \begin{macrocode} + \ifx\xltabular\undefined + \let\@BTswitch\@BTnormal + \else + \let\@BTswitch\@BLTrule + \fi\fi\fi % \end{macrocode} % On with the code % \begin{macrocode} @@ -20480,8 +20626,12 @@ % \begin{macro}{\subcaption} % \cs{subcaption}\oarg{list-entry}\marg{caption} is a generic % subcaption. There is no \Lpack{subfigure} equivalent. +% +% \changes{v3.7i}{2019/10/24}{Added a \cs{par} to the start. This can +% get rid of sporadic spaces caused by hyperref changing \cs{refstepcounter}} % \begin{macrocode} \newcommand{\subcaption}{% + \par \bgroup \let\label=\memsub@label \ifdonemaincaption\else @@ -20562,7 +20712,15 @@ % \end{macrocode} % \end{environment} % -% +% \begin{macro}{\mem@step@subcounter} +% \changes{v3.7i}{2019/10/24}{Added} +% Utility macro to save some typing. +% \begin{macrocode} +\newcommand\mem@step@subcounter{% + \refstepcounter{sub\@captype}\@contkeep% +} +% \end{macrocode} +% \end{macro} % % \begin{macro}{\subbottom} % \begin{macro}{\@memsubbody} @@ -20580,7 +20738,14 @@ \ifdonemaincaption\else \advance\csname c@\@captype\endcsname\@ne \fi - \refstepcounter{sub\@captype}\@contkeep% +% \end{macrocode} +% To help with hyperref target placement (hyperref usually uses +% \cs{refstepcounter} to make the anchors) we move the counter +% business into \cs{@memsubfloat} instead. This way they come right at +% the top. +% \begin{macrocode} +% \changes{v3.7i}{2019/10/24}{Moved \cs{refstepcounter}} + % \refstepcounter{sub\@captype}\@contkeep% \leavevmode \@ifnextchar [% {\@memsubfig}% @@ -20602,7 +20767,13 @@ \bgroup \let\label=\memsub@label \@contset - \refstepcounter{sub\@captype}\@contkeep% +% To help with hyperref target placement (hyperref usually uses +% \cs{refstepcounter} to make the anchors) we move the counter +% business into \cs{@memsubfloat} instead. This way they come right at +% the top. +% \begin{macrocode} +% \changes{v3.7i}{2019/10/24}{Moved \cs{refstepcounter}} + % \refstepcounter{sub\@captype}\@contkeep% \leavevmode \@ifnextchar [% {\@memsubfig}% @@ -20671,7 +20842,15 @@ \fi \setbox\@tempboxa \hbox{#4}% \@tempdima=\wd\@tempboxa - \vtop\bgroup +% \end{macrocode} +% We move the refstep business here to help \Lpack{hyperref} get +% better anchors. +% \changes{v3.7i}{2019/10/24}{moved counter stepping, additionally +% changed \cs{vtop} to \cs{vbox}, otherwise we align the images at the +% top} +% \begin{macrocode} + \vbox\bgroup% + \mem@step@subcounter% \vbox\bgroup \ifcase\@tempcnta \@minipagefalse @@ -22573,8 +22752,13 @@ % and \cs{@plainZ}, to reduce code we now only use one, the argument % of it takes care of differentiating between the stuff that are % different. Two hooks is added just before and after importing the -% list file contents. +% list file contents. Additionally we have added a hook before the +% title is being executed, it comes after \cs{phantomsection} but +% before any \cs{addcontentsline} % \changes{v1.61803398d}{2010/02/14}{added the before and after hooks} +% \changes{v3.7i}{2019/10/25}{moved the @\#2maketitle until after the +% \cs{addcontentsline}, that way the hyperref anchor is above the +% title, not below it. } % \begin{macrocode} \@namedef{cft#2beforelisthook}{}% \@namedef{cft#2afterlisthook}{}% @@ -22582,13 +22766,13 @@ \ensureonecol \par \begingroup - \@nameuse{@#2maketitle} + \phantomsection \if##1 \ifmem@em@starred@listof\else - \phantomsection \addcontentsline{toc}{chapter}{#3} \fi \fi + \@nameuse{@#2maketitle} \parskip\cftparskip \@nameuse{cft#2beforelisthook}% \@starttoc{#2}% @@ -24762,12 +24946,14 @@ % \changes{v1.618}{2005/09/02}{Made \cs{@@@wrindexm@m} obey \cs{nofiles}} % \changes{v1.618}{2005/09/25}{\cs{@@@wrindexm@m} now reads the aux % file at the end of the document} +% \changes{v3.7i}{2019/11/15}{Changed the writing to protected} % \begin{macrocode} \newcommand{\@@@wrindexm@m}[2]{\endgroup} \AtBeginDocument{% \def\@@@wrindexm@m#1#2{% \if@filesw - \immediate\write \@idxfile{\string\indexentry{#1}{#2}}% + %\immediate\write \@idxfile{\string\indexentry{#1}{#2}}% + \immediate@protected@write\@idxfile{}{\string\indexentry{#1}{#2}}% \fi \endgroup}% } @@ -27206,7 +27392,11 @@ \m@makefootfootmark{#1}% -> \footfootmark#1 \m@makemakefootmark{#1}% -> \makefootmark#1 \m@makefootmarkstyle{#1}% -> \footmarkstyle#1 - \@namedef{@makefntext#1}##1{\@nameuse{makefootmark#1} ##1}% +% \end{macrocode} +% \changes{3.7i}{2019/05/24}{@makefntext\#1 should of course be +% long. Reported on TSE by meide, https://tex.stackexchange.com/q/491303/3929} +% \begin{macrocode} + \@namelongdef{@makefntext#1}##1{\@nameuse{makefootmark#1} ##1}% \m@make@footstart{#1}% -> \@footstart#1 \m@make@footgroup{#1}% -> \@footgroup#1 \expandafter\newinsert\csname @mpfootins#1\endcsname% -> \@mpfootins#1 @@ -29411,15 +29601,20 @@ % \begin{macro}{\immediate@protected@write} % We might have to do some immediate writes. This is an immediate % version of the kernel \cs{protected@write}. +% \changes{v3.7i}{2019/11/15}{changed to \cs{providecommand} and +% removed the \cs{if@nobreak} line, also removed the edef part, +% suggested by Davis Carlisle} % \begin{macrocode} -\newcommand{\immediate@protected@write}[3]{% +\providecommand{\immediate@protected@write}[3]{% \begingroup #2% \let\protect\@unexpandable@protect - \edef\reserved@a{\immediate\write#1{#3}}% - \reserved@a + %\edef\reserved@a{\immediate\write#1{#3}}% + %\reserved@a + \immediate\write#1{#3}% \endgroup - \if@nobreak\ifvmode\nobreak\fi\fi} + %\if@nobreak\ifvmode\nobreak\fi\fi% +} % \end{macrocode} % \end{macro} @@ -29433,11 +29628,16 @@ % beast, \cs{immediate@protected@write} can write it to disk, but % \cs{m@m@pnwrite} cannot. To get past this we also include a version % that has an embedded \cs{detokenize} (thanks to Heiko Oberdiek for -% that hint). +% that hint). We also add a \% at the end of the \cs{m@m@pnwrited} +% process (don't think \cs{m@m@pnwrite} needs it). This is handy in +% those cases where the user is using a design which rely on there not +% being any spaces after the note text. % \changes{v3.6k}{2011/04/06}{Added the version with \cs{detokenize}} % \begin{macrocode} +% \changes{v3.7i}{2019/06/07}{Added \cs{@percentchar} to +% \cs{m@m@pnwrited}} \newcommand{\m@m@pnwrite}[3]{\immediate\write#1{#3}} -\newcommand{\m@m@pnwrited}[3]{\immediate\write#1{\detokenize{#3}}} +\newcommand{\m@m@pnwrited}[3]{\immediate\write#1{\detokenize{#3}\@percentchar}} % \end{macrocode} % \end{macro} @@ -29540,7 +29740,12 @@ \m@mmf@prepare% rerun \fi% \mem@pn@multiple@marker{\notenumintext{\thepagenote}}% - }{}% +% \end{macrocode} +% \changes{3.7i}{2019/05/28}{Added the special kern also if the +% optional arg is empty. Otherwise the multiple marker might not work +% under hyperref. Reported in private email} +% \begin{macrocode} + }{\m@mmf@prepare}% \fi% % \end{macrocode} % Check if this is the first note in a division, and if so indicate this @@ -35522,7 +35727,9 @@ % % \subsection{Text case} % \changes{v3.6k}{2012/09/13}{Included a copy of the \texttt{textcase} -% package.} +% package.} +% +% \changes{3.7i}{2019/10/22}{Made textcase into a required package instead} % % Since, say, \cs{MakeUppercase} does too much, i.e.\ also upper case % math and arguments to, say, \cs{ref}, we provide a version that does @@ -35532,6 +35739,27 @@ % package as have been emulated. Loading \texttt{textcase} just % overwrites the macros if they exist. % +% As of October 2019, we will instead load the \texttt{textcase} +% package if found. If not we resort to the old version we had +% embedded. +% +% +% \begin{macrocode} +\expandafter\let\csname MemOrigMakeUppercase \expandafter\endcsname + \csname MakeUppercase \endcsname +\expandafter\let\csname MemOrigMakeLowercase \expandafter\endcsname + \csname MakeLowercase \endcsname +\def\MemRestoreOrigMakecase{ + \expandafter\let\csname MakeUppercase \expandafter\endcsname + \csname MemOrigMakeUppercase \endcsname + \expandafter\let\csname MakeLowercase \expandafter\endcsname + \csname MemOrigMakeLowercase \endcsname +} +\IfFileExists{textcase.sty}{ + \RequirePackage[overload]{textcase} + }{% resort to the +% \end{macrocode} +% % \MakeShortVerb{\|} % \begin{macrocode} %%%% Nearly a carbon copy from textcase.dtx by David Carlisle @@ -35698,6 +35926,9 @@ % \end{macrocode} % \DeleteShortVerb{\|} % +% \begin{macrocode} +} % end of \IfFileExists +% \end{macrocode} % % \section{Initialization} \label{sec:init} % @@ -35833,22 +36064,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{The page style and counters} -% We use the page style \pstyle{headings} by -% default and arabic page numbering. But if the \verb?article? -% class option is in effect, we will use the \pstyle{plain} style -% which is the default in the \verb?article? class. -% \changes{v3.6d}{2010/05/13}{When emulating the article class the -% plain page style should used instead of headings} -% \begin{macrocode} -\ifartopt -\pagestyle{plain} -\else -\pagestyle{headings} -\fi -\pagenumbering{arabic} - -% \end{macrocode} +% \subsection{Some counters} % We set the sectional counters to zero, the \verb?tocdepth? to % one (sections and above listed), the \verb?secnumdepth? to % two (sections and above numbered), and \cs{maxsecnumdepth} to @@ -36214,17 +36430,20 @@ % \begin{macro}{\@caption} % \changes{v1.61803}{2008/01/30}{Killed memoir's captioning when the caption % package is used (mempatch v4.9).} -% \changes{v3.6k}{2012/05/04}{Changed the warning text to be more informative.} +% \changes{v3.6k}{2012/05/04}{Changed the warning text to be more +% informative.} +% \changes{v3.7i}{2018/12/19}{Users still get spooked by the warning, +% tried to rewrite it in a better manner} % \begin{macrocode} %%% revert changes to captioning macros if the caption package is used. \AtBeginPackage{caption}{ \ClassWarningNoLine{memoir}{% - You are using the caption package with the memoir class. - To prepare we will now reset all captioning macros and - configurations to kernel defaults, and then let the - caption package take over. Please remember to use^^J - the caption package interfaces in order to^^J - configure your captions} + For the caption package to function properly with memoir, + we will now reset\string\caption\space and friends to + kernel defaults and then let the caption package take over. + Remember: all caption configuration now goves via the caption + package interface, not the interface from the memoir class. + } \long\def\@makecaption##1##2{% \vskip\abovecaptionskip @@ -36291,6 +36510,36 @@ % \end{macrocode} % +% +% +% +% \subsection{Default page style} +% We use the page style \pstyle{headings} by +% default and arabic page numbering. But if the \verb?article? +% class option is in effect, we will use the \pstyle{plain} style +% which is the default in the \verb?article? class. +% \changes{v3.6d}{2010/05/13}{When emulating the article class the +% plain page style should used instead of headings} +% \changes{v3.7i}{2019/01/07}{Moved here because +% \cs{newlistof}{...}{X}{...} also defines \cs{Xmark}, but using +% \cs{markboth}, and thus if \Lopt{oneside} is active \cs{lofmark} +% will still be using \cs{mathboth} and not \cs{markright} that the +% \pstyle{headings} style dictates} +% \begin{macrocode} +\ifartopt +\pagestyle{plain} +\else +\pagestyle{headings} +\fi +\pagenumbering{arabic} + +% \end{macrocode} + + + + + + % ^^A\subsection{Patch file} % ^^A % ^^A At the suggestion of Danie Els (\texttt{DanieEls@sun.ac.za}), Dan Leucking @@ -36425,10 +36674,10 @@ keyword "\\glossaryentry" % \newblock (Available from CTAN in % \texttt{/macros/latex/required/tools}) % -% \bibitem[Car04]{TEXTCASE} +% \bibitem[Car19]{TEXTCASE} % David Carlisle. % \newblock \emph{The \Lpack{textcase} package}. -% \newblock October, 2004. +% \newblock September, 2019. % \newblock (Available from CTAN in % \texttt{/macros/latex/contrib/textcase}) % @@ -36517,6 +36766,12 @@ keyword "\\glossaryentry" % \newblock (Available from CTAN as % \texttt{/macros/latex/base/classes.dtx}) % +% \bibitem[LPT19]{IFTEX} +% The \LaTeX{} Project Team. +% \newblock \emph{The iftex package}. +% \newblock November, 2019. +% \newblock (Available from CTAN in \texttt{/macros/latex/contrib/iftex}) +% % \bibitem[MC98]{ARRAY} % Frank Mittelbach and David Carlisle. % \newblock \emph{A new implementation of LaTeX's tabular and array -- cgit v1.2.3