texlive[47305] Master/texmf-dist: memoir (5apr18)

commits+karl at tug.org commits+karl at tug.org
Thu Apr 5 23:10:28 CEST 2018


Revision: 47305
          http://tug.org/svn/texlive?view=revision&revision=47305
Author:   karl
Date:     2018-04-05 23:10:27 +0200 (Thu, 05 Apr 2018)
Log Message:
-----------
memoir (5apr18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/memoir/README
    trunk/Master/texmf-dist/doc/latex/memoir/memman.pdf
    trunk/Master/texmf-dist/doc/latex/memoir/memman.tex
    trunk/Master/texmf-dist/doc/latex/memoir/memsty.sty
    trunk/Master/texmf-dist/makeindex/memoir/basic.gst
    trunk/Master/texmf-dist/source/latex/memoir/memoir.dtx
    trunk/Master/texmf-dist/source/latex/memoir/memoir.ins
    trunk/Master/texmf-dist/source/latex/memoir/mempatch.dtx
    trunk/Master/texmf-dist/source/latex/memoir/mempatch.ins
    trunk/Master/texmf-dist/tex/latex/memoir/mem10.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem11.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem12.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem14.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem17.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem20.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem25.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem30.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem36.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem48.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem60.clo
    trunk/Master/texmf-dist/tex/latex/memoir/mem9.clo
    trunk/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
    trunk/Master/texmf-dist/tex/latex/memoir/memoir.cls

Removed Paths:
-------------
    trunk/Master/texmf-dist/tex/latex/memoir/mempatch.sty

Modified: trunk/Master/texmf-dist/doc/latex/memoir/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/memoir/README	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/doc/latex/memoir/README	2018-04-05 21:10:27 UTC (rev 47305)
@@ -36,6 +36,62 @@
     Bibliography, indexes                               ~  50 pages
 
 
+Changed (2018/04/04)
+
+o memoir v3.7g
+
+-- is now using colorlinks hyperref option in the manual. We switched
+   it off year ago because some users were printing the
+   manual. Nowadays most is reading the manual online, and thus
+   colorlinks brings a better reading experience.
+-- under hyperref \index{... |)} now also adds `|)hyperpage` to the
+   idx file. This is needed for xindy to process the idx
+   file. Makeindex does not seem to mind. Reported via private email.
+-- added examples of the nine much overlooked \setpageXX macros, these can
+   be used instead of \settrimmedsize and \settrims to place a trimmed
+   page on the stock in nine often used configurations.
+-- the way the class writes the pagesize to the output have been
+   rewritten and should now work with lualatex. Therefore we no longer
+   auto load the luatex85 package. We have also canceled \fixpdflayout
+   and \fixdvipslayout (they now just emit a warning)
+-- the class will truncate certain layout lengths to a whole number of
+   point (e.g. \textwidth). This can now be disabled using the
+   fullptlayout class option, reported via
+   https://tex.stackexchange.com/q/372381/3929 
+-- in as of the release of TeXLive 2018 \counterwithin/out will be
+   added to the LaTeX kernel, we changed our version to use
+   \providecommand accordingly 
+-- removed loading the mempatch.sty package, it has been empty for
+   many years
+-- now requiring ifpdf, ifetex, ifxetex and ifluatex packages to exist.
+   Earlier we attempted to emulate them if missing, this does not make
+   sense any more
+-- started adding "Recommended alternative" blocks to the
+   manual. These are just mentioning more modern alternatives to what
+   ever is mentioned in the manual. Fx using tcolorbox instead of the
+   buildin framed env. Suggestions are welcome (by email)
+-- added \titlingpageend{}{} which can be used to set the clearing
+   code at the end of the titlingpage env.
+-- clearified the interaction between 14pt and extrafontsizes options
+-- updating the embedded array and tabularx copies fixes
+   https://tex.stackexchange.com/q/411862/3929 (an issue with bidi)
+-- dumped the emulated date for delarray to 2014/10/28 (the code,
+   after the array update) is the same
+-- fixed a bad interaction in \subbottom when the showkeys and
+   hyperref is loaded. Reported via
+   https://tex.stackexchange.com/q/374301/3929 
+-- removed unnecessary \phansomsection from the thebiblipgraphy
+   setup. Reported via https://tex.stackexchange.com/a/396303/3929
+-- added \nobreak to \@vslnumleft and @vslnumright (internal to
+   verse), reported via https://tex.stackexchange.com/a/415939/3929
+-- added \phansomsection to \startnoteentrystart, otherwise \label in
+   \pagenote does not work correctly.   
+-- fixed a typo in \@listii where \itemsep is not pointing towards
+   \itemsepii, similar to the other \@listK macros. 
+-- fixed problem with \setfloatadjustment, font size changes did not
+   come through
+
+
 Changed (2016/05/16)
 
 o memoir v3.7f
@@ -343,7 +399,6 @@
 mem36.clo
 mem48.clo
 mem60.clo
-mempatch.sty
 memhfixc.sty
 basic.gst.
 ------------------------------------------------------------------- 
@@ -353,7 +408,6 @@
 README           (this file)
 memoir.(dtx|ins)   Class source and installation files
 mempatch.(dtx|ins) Source and installation for patch files
-mempatch.sty       Patch file for memoir class
 memhfixc.sty       Patch file for hyperref package
 memman.tex         LaTeX source for the user manual
                     (requires the memoir class and the alltt,
@@ -381,8 +435,8 @@
 o Move memoir.cls, the mem*.clo files and any mem*.sty file to locations 
   where LaTeX will find them (typically in a local texmf tree at 
   /tex/latex/memoir) and refresh the file database. 
-  See the FAQ on CTAN at help/uk-tex-faq
-  or http://www.tug.ac.uk/faq for more information on this.
+  See the FAQ on CTAN at help
+  or http://www.tex.ac.uk/ for more information on this.
 
 However, it is alway recommended that you update your LaTeX
 installation, instead of attempting to manually install a Package or

Modified: trunk/Master/texmf-dist/doc/latex/memoir/memman.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/memoir/memman.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/memoir/memman.tex	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/doc/latex/memoir/memman.tex	2018-04-05 21:10:27 UTC (rev 47305)
@@ -2167,9 +2167,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2015-08-21 12:00:47 +0200 (Fri, 21 Aug 2015) $}
-{$LastChangedRevision: 544 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-03-09 13:41:30 +0100 (Fri, 09 Mar 2018) $}
+{$LastChangedRevision: 587 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 \chapter{Starting off} \label{chap:starting}
 
@@ -2433,8 +2433,10 @@
 \glossary(12ptco)%
   {\Popt{12pt}}%
   {Class option for a 12pt body font.}
-\item[\Lopt{14pt}] for 14pt as the normal type size
-\glossary(14ptco)%
+\item[\Lopt{14pt}] for 14pt as the normal type size\footnote{Note that
+    for \Lopt{14pt}, \cs{huge}, \cs{Huge} and \cs{HUGE} will be the
+    same as \cs{LARGE}, unless the \Lopt{extrafontsizes} option is
+    also is activated.}  \glossary(14ptco)%
   {\Popt{14pt}}%
   {Class option for a 14pt body font.}
 \item[\Lopt{17pt}] for 17pt as the normal type size
@@ -2469,7 +2471,14 @@
 \glossary(*ptco)%
   {\Popt{*pt}}%
   {Class option for an author-defined size for the body font.}
-\item[\Lopt{extrafontsizes}] Using scalable fonts that can exceed 25pt.
+\item[\Lopt{extrafontsizes}] Using scalable fonts that can exceed
+  25pt.
+
+  \emph{Note that this includes \cs{huge}, \cs{Huge} and \cs{HUGE}
+  under \Lopt{14pt}. For \Lopt{17pt} and up, an error is thrown if
+  used withput \Lopt{extrafontsizes}, no error is given for
+  \Lopt{14pt}, there sizes above \cs{LARGE} will just be unavailable
+  unless \Lopt{extrafontsizes} is used.}
 \glossary(extrafontsizes)%
   {\Popt{extrafontsizes}}%
   {Class option for using scalable fonts that can exceed 25pt.}
@@ -2652,7 +2661,7 @@
   {Class option for printing trimming marks.}
 
 \end{itemize}
-
+%
     The defaults among the printing options\index{default!printing options} 
 are \Lopt{twoside}, \Lopt{onecolumn}, \Lopt{openright}, and \Lopt{final}.
 
@@ -2687,7 +2696,8 @@
 
 \item[\Lopt{article}]\index{class options!article} 
   typesetting \emph{simulates} the \Lclass{article} class,
-  but the \cmd{\chapter} command is not disabled.
+  but the \cmd{\chapter} command is not disabled, basically
+  \cmd{\chapter} will behave as if it was \cmd{\section}.
   Chapters\index{chapter} do not start a new page and chapter
   headings\index{heading!chapter} are typeset 
   like a section heading\index{heading!sections}. The numbering of 
@@ -2706,10 +2716,18 @@
   {\Popt{oldfontcommands}}%
   {Class option for permitting obsolete, deprecated font commands.}
 
+
+\item[\Lopt{fullptlayout}]\index{class options!layout truncation} 
+  disable point trunction of certain layout lengths, for example
+  \cmd{\textwidth}. The default is to round these of to a whole number
+  of points, this option disables this feature.
+  \glossary(fullptlayout)%
+  {\Popt{fullptlayout}}%
+  {Class option to disable point truncation of certain layout lengths.}
 \end{itemize}
+%
+None of these options are defaulted.
 
-    None of these options are defaulted.
-
 \section{Remarks}
 
    Calling the class with no options is equivalent to:
@@ -2777,8 +2795,8 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2015-11-23 09:32:30 +0100 (Mon, 23 Nov 2015) $}
-{$LastChangedRevision: 547 $}
+{$LastChangedDate: 2018-03-12 11:00:16 +0100 (Mon, 12 Mar 2018) $}
+{$LastChangedRevision: 589 $}
 {$LastChangedBy: daleif at math.au.dk $}
 
 \chapter{Laying out the page} \label{chap:layingpage}
@@ -3112,7 +3130,7 @@
 is 90\% of the stock size it's easy to get \ltx\ to do the calculation:
 \begin{lcode}
 \setlength{\trimtop}{\stockheight}    % \trimtop = \stockheight
-\addtolengh{\trimtop}{-\paperheight}  %          - \paperheight
+\addtolength{\trimtop}{-\paperheight}  %          - \paperheight
 \setlength{\trimedge}{\stockwidth}    % \trimedge = \stockwidth
 \addtolength{\trimedge}{-\paperwidth} %           - \paperwidth
 \end{lcode}
@@ -4235,60 +4253,72 @@
 ...
 \end{lcode}
 
-\section{Printing and viewing}
-  
-    When \pdfltx\ is used to generate a \pixpdf\ version of a \Pclass{memoir}
-document some special setup must be done.
-\begin{syntax}
-\cmd{\fixpdflayout} \\
-\end{syntax}
-\glossary(fixpdflayout)%
-  {\cs{fixpdflayout}}%
-  {Sets up page size information for \pdfltx.}
-The macro \cmd{\fixpdflayout}\index{page layout!PDF} is automatically called after the preamble when
-\pdfltx{} is used to generate \pixpdf. The default definition is effectively:
-\begin{lcode}
-\newcommand*{\fixpdflayout}{
-  \pdfpageheight=\the\stockheight
-  \pdfpagewidth=\the\stockwidth
-  \ifxetex\else
-  \ifdim\pdforigin=0pt\pdforigin=1in\fi
-  \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
-  \fi}
-\end{lcode}
-The first settings (\verb?\pdfpage...?) ensure that \pdfltx{} knows
-the size of the physical sheet\indextwo{stock}{size} for printing. 
-The \verb?\...origin? settings
-set the \pdf{} origin per the \tx\ origin, provided that their values are
-0pt. If you have set the origin values yourself, either in a \pdfltx{} 
-configuration\index{configuration file} file or earlier in the preamble, 
-the \cmd{\fixpdflayout}
-macro will not alter them (if you need an origin value to be 0 then
-set it to 1sp, which is visually indistinguishable from 0pt).
+%\section{Printing and viewing}
 
-\begin{syntax}
-\cmd{\fixdvipslayout} \\
-\end{syntax}
-\glossary(fixdvipslayout)%
-  {\cs{fixdvipslayout}}%
-  {Sets up page size information for dvi processors.}
+\section{Emitting the page size}
+\label{sec:emitting-page-size}
 
-The macro \cmd{\fixdvipslayout}\index{page layout!dvips} is automatically 
-called after the preamble 
-when \pixpdf{} output is not being produced. It provides the \Lprog{dvips} 
-processor
-with information about the stock\indextwo{stock}{size} size, 
-which a viewer or printer may use.
+At the start of the document the class will automatically emit the
+chosen stocksize to the output format (DVI or PDF).\footnote{In
+  earlier versions we had macros \cs{fixpdflayout} and
+  \cs{fixdvipslayout} that held some of the code needed to emit this
+  data. With the newer engines like LuaLaTeX, this became unfeasible
+  thus they we discontinued (their use now emit a warning).}
 
-The macros \cmd{\fixpdflayout} and \cmd{\fixdvipslayout} are
-automatically executed at the start of the document, in combinations
-that make the most sense (i.e., \cmd{\fixpdflayout} when using XeLaTeX
-or \pdfltx{} and \cmd{fixdvipslayout} for the rest.
 
+%     When \pdfltx\ is used to generate a \pixpdf\ version of a \Pclass{memoir}
+% document some special setup must be done.
+% \begin{syntax}
+% \cmd{\fixpdflayout} \\
+% \end{syntax}
+% \glossary(fixpdflayout)%
+%   {\cs{fixpdflayout}}%
+%   {Sets up page size information for \pdfltx.}
+% The macro \cmd{\fixpdflayout}\index{page layout!PDF} is
+% \emph{automatically}\footnote{That is you do not need to.} called after the preamble when
+% \pdfltx{} is used to generate \pixpdf. The default definition is effectively:
+% \begin{lcode}
+% \newcommand*{\fixpdflayout}{
+%   \pdfpageheight=\the\stockheight
+%   \pdfpagewidth=\the\stockwidth
+%   \ifxetex\else
+%   \ifdim\pdforigin=0pt\pdforigin=1in\fi
+%   \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
+%   \fi}
+% \end{lcode}
+% The first settings (\verb?\pdfpage...?) ensure that \pdfltx{} knows
+% the size of the physical sheet\indextwo{stock}{size} for printing. 
+% The \verb?\...origin? settings
+% set the \pdf{} origin per the \tx\ origin, provided that their values are
+% 0pt. If you have set the origin values yourself, either in a \pdfltx{} 
+% configuration\index{configuration file} file or earlier in the preamble, 
+% the \cmd{\fixpdflayout}
+% macro will not alter them (if you need an origin value to be 0 then
+% set it to 1sp, which is visually indistinguishable from 0pt).
 
-\LMnote{2015/02/23}{Next lines outcommented as I do not feel that this
-  kind of examples below in a manual like this}
+% \begin{syntax}
+% \cmd{\fixdvipslayout} \\
+% \end{syntax}
+% \glossary(fixdvipslayout)%
+%   {\cs{fixdvipslayout}}%
+%   {Sets up page size information for dvi processors.}
 
+% The macro \cmd{\fixdvipslayout}\index{page layout!dvips} is automatically 
+% called after the preamble 
+% when \pixpdf{} output is not being produced. It provides the \Lprog{dvips} 
+% processor
+% with information about the stock\indextwo{stock}{size} size, 
+% which a viewer or printer may use.
+
+% The macros \cmd{\fixpdflayout} and \cmd{\fixdvipslayout} are
+% automatically executed at the start of the document, in combinations
+% that make the most sense (i.e., \cmd{\fixpdflayout} when using XeLaTeX
+% or \pdfltx{} and \cmd{fixdvipslayout} for the rest.
+
+
+% \LMnote{2015/02/23}{Next lines outcommented as I do not feel that this
+%   kind of examples belong in a manual like this}
+
 %     With a \Lopt{landscape} document and using the processing route
 % \verb?latex -> dvips? the resulting \file{ps} \pscript{} file may appear 
 % upside-down when viewed with, say, \Lprog{ghostview} 
@@ -4684,7 +4714,72 @@
 have to call \cmd{\checkandfixthelayout} for all the changes to take
 effect.
 
+\fancybreak{}
 
+In Figure~\ref{fig:setpage} we show the effect of the nine
+\cmd{\setpageXX}. The code used for the examples is similar to the
+code below, and then the result is scaled down.
+
+\begin{lcode}
+\documentclass[showtrims]{memoir}
+\trimLmarks
+\setstocksize{18cm}{15cm}
+\makeatletter
+\setpagebl{16cm}{12cm}{*}
+\makeatother
+\setlrmarginsandblock{15mm}{15mm}{*}
+\setulmarginsandblock{15mm}{15mm}{*}
+\setheadfoot{5mm}{5mm}
+\checkandfixthelayout[fixed]
+\pagestyle{empty}
+\AtBeginDocument{\LARGE}
+\begin{document}
+\begin{vplace}
+  \centering
+  \cs{setpagebl}\marg{height}\marg{width}\marg{ratio}
+\end{vplace}
+\end{document}
+\end{lcode}
+
+
+
+
+\begin{figure}[htbp]
+  \centering
+  \fboxsep=0pt
+  \fbox{\includegraphics[page=1,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=2,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=3,scale=0.3]{setpage-example.pdf}}
+
+  \medskip
+  
+  \fbox{\includegraphics[page=4,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=5,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=6,scale=0.3]{setpage-example.pdf}}
+
+  \medskip
+
+  
+  \fbox{\includegraphics[page=7,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=8,scale=0.3]{setpage-example.pdf}}
+  \hfill
+  \fbox{\includegraphics[page=9,scale=0.3]{setpage-example.pdf}}
+
+  \caption{Example of the nine \cs{setpageXX} macros for placing
+    a trimmed page on the stock. These are all odd pages, under
+    \Lopt{twoside}, even pages will have the left/right trims reversed.}
+  \label{fig:setpage}
+\end{figure}
+
+
+
+
+
 %#% extend
 %#% extstart include text-and-fonts.tex
 
@@ -6004,9 +6099,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2013-04-24 17:14:15 +0200 (Wed, 24 Apr 2013) $}
-{$LastChangedRevision: 442 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-03-06 15:58:01 +0100 (Tue, 06 Mar 2018) $}
+{$LastChangedRevision: 584 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 
 \chapter{Titles}
@@ -6339,7 +6434,8 @@
 
 \begin{syntax}
 \senv{titlingpage} text \eenv{titlingpage} \\
-\senv{titlingpage*} text \eenv{titlingpage*} 
+\senv{titlingpage*} text \eenv{titlingpage*}\\
+\cmd{\titlingpageend}\marg{twoside code}\marg{oneside code} 
 \end{syntax}
 \glossary(titlingpage)%
   {\senv{titlingpage}}%
@@ -6346,8 +6442,13 @@
   {Environment for a title page, resets the page counter to 1 after it}
 \glossary(titlingpage*)%
   {\senv{titlingpage*}}%
-  {Like \senv{titlingpage}, but does not reset the page counter.}
-   When one of the standard classes is used with the \Lopt{titlepage}
+  {Like \senv{titlingpage}, but does not reset the page counter.}%
+\glossary(titlingpageend)%
+  {\cs{titlingpageend}}%
+  {Can be used to set what kind of page clearing is issued at the end
+    of a titling page. The default for the two args are
+    \cs{cleardoublepage} and \cs{clearpage}.}
+When one of the standard classes is used with the \Lopt{titlepage}
 option, \cmd{\maketitle} puts the title elements on an unnumbered page
 and then starts a new page numbered page 1. 
 The standard classes also provide
@@ -6368,6 +6469,19 @@
 The \pstyle{titlingpage} pagestyle is initially defined to be the same
 as the \pstyle{empty} pagestyle.
 
+At the end of a \Ie{titlingpage} clearing code is issued, which can
+send you to the next page or the next right handed page. Using
+\cmd{\titlingpageend}\marg{twoside code}\marg{oneside code}, you can
+specify what this clearing code should be. The default is
+\cs{cleardoublepage} and \cs{clearpage} respectively.\footnote{Thus
+  this refactorization will not change existing documents, LM, 2018/03/06.} However a
+better choice might be to just let it follow \cs{clearforchapter}:
+\begin{lcode}
+  \titlingpageend{\clearforchapter}{\clearforchapter}
+\end{lcode}
+-- using this value, \Ie{titlingpage} will work as expected with \Lopt{openany}.
+
+
    For example, to put both the title and an abstract\index{abstract} 
 on a title page,
 with a \pstyle{plain} pagestyle:
@@ -11262,9 +11376,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2015-07-20 13:55:32 +0200 (Mon, 20 Jul 2015) $}
-{$LastChangedRevision: 542 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-03-09 13:41:30 +0100 (Fri, 09 Mar 2018) $}
+{$LastChangedRevision: 587 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -12215,8 +12329,9 @@
 
 
 \LMnote{2013/05/16}{Added hint about enumitem}
-\begin{hint}
-  \theclass\ does not provide high level interfaces to configure the
+\LMnote{2018/03/09}{Changed hint to be a recommended section}
+\begin{recommended}
+    \theclass\ does not provide high level interfaces to configure the
   appearance. We provide some simple tools to adjust vertical spacing,
   see below.
 
@@ -12232,16 +12347,29 @@
   \end{lcode}
   syntax will work out of the box.
 
-  One difference though: In \theclass\ \verb?\ref{item:tst}? will give you
+  One key difference: In \theclass\ \verb?\ref{item:tst}? will give you
   `i', whereas, if \Lpack{enumitem} is loaded the full formatting is
   returned from the cross reference, i.e., `i)'. This is fully
   configurable in \Lpack{enumitem}.
-\end{hint}
 
+  Note that, \cmd{\tightlists}, \cmd{\defaultlists}, \cmd{\firmlists},
+  \cmd{\firmlists*} presented below, are not supported by
+  \Lpack{enumitem}, it provides a highlevel key based interface
+  instead.
 
+  Another feature from \Lpack{enumitem} that I (LM) uses a lot is to
+  combine the \cmd{\setlist} with \cmd{\AtBeginEnvironment} from the
+  \Lpack{etoolbox} package to specifically adjust enumerate used
+  inside certain theorem constructions. That wway we can control the
+  apparence of the lists from the preamble and does not need to use
+  say
+  \begin{lcode}
+    \begin{enumerate}[(a)]
+  \end{lcode}
+  every single time.
+\end{recommended}
 
 
-
 \index{list!tight|(} %|
 
 
@@ -23181,9 +23309,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2013-04-24 17:14:15 +0200 (Wed, 24 Apr 2013) $}
-{$LastChangedRevision: 442 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-03-06 15:58:01 +0100 (Tue, 06 Mar 2018) $}
+{$LastChangedRevision: 584 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %%%%%% membook
@@ -23317,6 +23445,18 @@
 In the \Ie{snugshaded} environment the box clings more closely to its
 contents than it does in the \Ie{shaded} environment.
 
+\begin{recommended}
+  Since the class was originally written, much have happened in the
+  gfx generating capabilities in LaTeX, especially the popularity of
+  TikZ has provided many more extensive box and graphics generating
+  packages.
+
+  As of 2018 one of the most impressive packages for all sorts of
+  boxes is the \Lpack{tcolorbox} package by Thomas~F.~Sturm.
+\end{recommended}
+
+
+
 %%    Following the declaration \cmd{\frameasnomaltrue}, which is the
 %default, normal paragraphing is used for the framed text. On the
 %%other hand, following the declaration \cmd{\frameasnormalfalse}
@@ -23323,10 +23463,10 @@
 %the paragraphing follows the \Ie{minipage} style layout (i.e.,
 %%no indentation of the first line).
 
-    Be aware that these boxes are somewhat delicate; they do not work
-in all circumstances. For example they will not work with the
-\Lpack{multicol} package~\cite{MULTICOL}, and any floats or footnotes
-in the boxes will disappear.
+Be aware that the boxes we present in this manual are somewhat
+delicate; they do not work in all circumstances. For example they will
+not work with the \Lpack{multicol} package~\cite{MULTICOL}, and any
+floats or footnotes in the boxes will disappear.
 
 \begin{syntax}
 \lnc{\FrameRule} \lnc{\FrameSep} \lnc{\FrameHeightAdjust} \\
@@ -24143,6 +24283,11 @@
     Verbatim tabbing, but not wrapping, applies to the \Ie{boxedverbatim}
 environment.
 
+\begin{recommended}
+  Again the \Lpack{tcolorbox} package offers boxes vs verbatim text.
+\end{recommended}
+
+
 \subsection{New verbatims}
 
 \index{verbatim!new|(}
@@ -27376,9 +27521,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2014-03-31 11:34:44 +0200 (Mon, 31 Mar 2014) $}
-{$LastChangedRevision: 480 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-04-05 11:07:48 +0200 (Thu, 05 Apr 2018) $}
+{$LastChangedRevision: 596 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %\clearpage
@@ -27928,6 +28073,17 @@
 commands. If you want to change the value use \cmd{\setcounter}, and to change
 the typesetting style use \cmd{\renewcommand} on \cs{thectr}.
 
+
+\begin{caveat}
+  As of 2018 \cmd{\counterwithout} and \cmd{\counterwithin} will be
+  provided by the \LaTeX-kernel, thus we only provide it if it does
+  not already exist.
+\end{caveat}
+
+
+
+
+
 \LMnote{2010/01/30}{Added \cs{letcountercounter}}
 \begin{syntax}
   \cmd{\letcountercounter}\marg{counterA}\marg{counterB}\\
@@ -28787,7 +28943,8 @@
 \begin{syntax}
 \piif{ifpdf} ... \verb?\fi? \\
 \end{syntax}
-The class provides \piif{ifpdf} which is \ptrue\ when the document is
+The class provides \piif{ifpdf} (by autoloading the \Lpack{ifpdf}
+package) which is \ptrue\ when the document is
 being processed by \pixpdfltx\ and \pfalse\ otherwise. You can use it like this:
 \begin{lcode}
 \ifpdf
@@ -28802,17 +28959,19 @@
 
     Modern \ltx\ distributions use \pixetx, which is an extended version
 of \tx, as the underlying engine. \pixetx\ provides some more primitives
-than \tx, which may be useful, but not everybody has \pixetx\ available.
+than \tx, which may be useful, but not everybody has \pixetx\
+available (Though, as of 2018, this is \emph{very} rare).
 
 \begin{syntax}
 \piif{ifetex} \\
 \end{syntax}
 \glossary(ifetex)%
-  {\cs{ifetex}}%
-  {\ptrue\ if \etx\ is the underlying engine, otherwise \pfalse.}
-\piif{ifetex} can be used to determine if \pixetx\ is being used as the
-underlying engine; it is analagous to \piif{ifpdf} which tests for
-\pixpdfltx. For example:
+{\cs{ifetex}}%
+{\ptrue\ if \etx\ is the underlying engine, otherwise \pfalse.}
+\piif{ifetex} can be used to determine if \pixetx\ is being used as
+the underlying engine; it is analagous to \piif{ifpdf} which tests for
+\pixpdfltx\ (provided by autoloading the \Lpack{ifetex} package). For
+example:
 \begin{lcode}
 \ifetex
   %%% code only processible by etex
@@ -28835,18 +28994,33 @@
   {\ptrue\ if \xetx\ is being used to process the document.}
 
 In a similar manner you can use \piif{ifxetex} to check if the document
-is being processed by \pixxetx.
+is being processed by \pixxetx\ (provided by autoloading the
+\Lpack{ifxetex} package).
 
 \begin{syntax}
 \cmd{\RequireXeTeX} \\
 \end{syntax}
 \glossary(RequireXeTeX)%
-  {\cs{RequireXeTeX}}%
-  {Generates an error if the document is not being processed by \xetx.}
-The class also provides \cmd{\RequireXeTeX}, which generates an error if
-\pixxetx\ is not being used to process the document.
+{\cs{RequireXeTeX}}%
+{Generates an error if the document is not being processed by \xetx.}
+The \Lpack{ifxetex} package also provides \cmd{\RequireXeTeX}, which
+generates an error if \pixxetx\ is not being used to process the
+document. This can be useful if you make your own class building upon
+\Lclass{memoir}.
 
+\subsection{Checking for LuaTeX}
+\label{sec:checking-lualatex}
 
+Similarly you can use 
+\begin{syntax}
+\piif{ifluatex} \\
+\end{syntax}
+\glossary(ifluatex)%
+  {\cs{ifluatex}}%
+  {\ptrue\ if \luatx\ is being used to process the document.}
+to check if the doc is being process by  \luatx.
+
+
 \section{Leading}
 
     LaTeX automatically uses different leading\index{leading} for different
@@ -37770,9 +37944,9 @@
 
 \svnidlong
 {$Ignore: $}
-{$LastChangedDate: 2013-05-15 17:07:24 +0200 (Wed, 15 May 2013) $}
-{$LastChangedRevision: 463 $}
-{$LastChangedBy: daleif $}
+{$LastChangedDate: 2018-04-05 11:07:48 +0200 (Thu, 05 Apr 2018) $}
+{$LastChangedRevision: 596 $}
+{$LastChangedBy: daleif at math.au.dk $}
 
 \chapter{Comments}
 \label{cha:comments}
@@ -37784,7 +37958,8 @@
 algorithms for some of the macros in the class. The information may be
 useful to some.
 
-\subsection{Autoadjusting \cs{marginparwidth}}
+\subsection{Autoadjusting
+  \texorpdfstring{\cs{marginparwidth}}{\textbackslash marginparwidth}}
 \label{sec:auto-csmarg}
 
 This algorithm is used within \cmd{\fixthelayout} unless the user have
@@ -39206,7 +39381,26 @@
 \onecolindex
 \renewcommand*{\preindexhook}{}
 \renewcommand*{\indexname}{Index of first lines}
-%%%\indexintoc
+%%% \indexintoc
+
+
+\makeatletter
+\renewcommand{\doidxbookmark}[1]{{\def\@tempa{Symbols}\def\@tempb{#1}%
+  \centering\bfseries \ifx\@tempa\@tempb %
+  Analphabetics 
+%  \phantomsection%
+%  \pdfbookmark[0]{Analphabetics}{Analphabetics-idx}%
+%  \label{AnalphabeticsAnalphabeticsAnalphabetics-idx}%
+  \else 
+  #1%
+%  \phantomsection%
+%  \pdfbookmark[0]{#1}{#1-idx}%
+%  \label{#1#1#1-idx}%
+  \fi%
+  \vskip\onelineskip\par}}
+\makeatother
+
+
 \printindex[lines]
 
 \cleardoublepage
@@ -39228,8 +39422,13 @@
 
 \end{center}
 
+
 \end{adjustwidth}
 
+
+
+
+
 \vfil
 
 %#% extend

Modified: trunk/Master/texmf-dist/doc/latex/memoir/memsty.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/memoir/memsty.sty	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/doc/latex/memoir/memsty.sty	2018-04-05 21:10:27 UTC (rev 47305)
@@ -161,7 +161,7 @@
               pdfpagelabels,
 %%%  hyperfootnotes=false,
               bookmarksnumbered,
-%              colorlinks,
+              colorlinks,
 %              ocgcolorlinks, % this only works for pdflatex
              ]{hyperref} 
   \DeclareGraphicsRule{*}{mps}{*}{}
@@ -190,7 +190,7 @@
   % \definecolor{filecolor}{rgb}{0,0.2,0.6}
   \definecolor{urlcolour} {rgb}{0.8,0,0.8}
 }{%
-  typeout{Asked for black links, so that is what you are going to get}
+  \typeout{Asked for black links, so that is what you are going to get}
   \definecolor{linkcolour}{rgb}{0,0,0}
   \definecolor{citecolour}{rgb}{0,0,0}
   % \definecolor{filecolor}{rgb}{0,0,0}
@@ -199,7 +199,7 @@
 }
 \hypersetup{
     pdftitle={The memoir class},
-    pdfauthor={Peter Wilson},
+    pdfauthor={Peter Wilson, maintained by Lars Madsen},
     linkcolor=linkcolour,citecolor=citecolour,
     filecolor=urlcolour,urlcolor=urlcolour,
   }
@@ -218,6 +218,8 @@
 \providecommand*{\ixetx}{\index{etex?\etx}}
 \providecommand*{\pixetx}{\etx\ixetx}            % print & index etex
 \providecommand*{\xetx}{Xe\tx}
+\providecommand*{\luatx}{Lua\tx}
+
 \providecommand*{\ixxetx}{\index{XeTeX?\xetx}}
 \providecommand*{\pixxetx}{\xetx\ixxetx}         % print & index XeTeX
 \providecommand*{\TeXUG}{\tx{} Users Group}
@@ -558,9 +560,9 @@
     \fi
     \c at chapter=\savechapcnt
     \advance\c at chapter\m at ne
-    \renewcommand{\theHchapter}{\thepage.\thechapter-\the\demochapcnt}
+    \renewcommand{\theHchapter}{\thepage.\thechapter-\the\demochapcnt.\thesheetsequence}
     \refstepcounter{chapter}%
-%%    \stepcounter{chapter}
+%    \stepcounter{chapter}
     \begin{center}
       \caption{The #2 chapterstyle}\label{dc#2}
     \end{center}
@@ -1065,7 +1067,7 @@
 \newcommand*\snipletref[1]{\snipletname~\ref{#1} on~\pref{#1}}
 \newenvironment{sniplet}[1][]{
   \refstepcounter{sniplet}
-  \edef\mem at e{\@ifnotmtarg{#1}{~(#1)}}
+  \edef\mem at e{\@ifnotmtarg{#1}{\space(#1)}}
   \section*{\snipletname~\thesniplet\mem at e}
   \phantomsection
   \addcontentsline{toc}{section}{\snipletname\ \thesniplet\mem at e}
@@ -1122,6 +1124,30 @@
 
 
 
+\newenvironment{recommended}{%
+  \@zeroseps%
+  \parskip\z@ \topsep\z@%
+  \definecolor{shadecolor}{gray}{0.9}%
+  \fboxsep0pt%
+  \shaded%
+  \list{}{%
+    \labelwidth\z@
+    \itemindent\z@
+    \addtolength\itemindent{\labelsep}
+    \parsep\z@
+    \listparindent1.5em
+    \leftmargin\z@
+    \rightmargin\leftmargin}
+    \item[\textbf{Recommended alternative}]\mbox{}\par\smallskip
+      \nobreak%\ignorespaces
+  \noindent\ignorespaces}%
+  { \endlist
+    \endshaded}
+
+
+
+
+
 \typeout{End memsty.sty}
 \endinput
 

Modified: trunk/Master/texmf-dist/makeindex/memoir/basic.gst
===================================================================
--- trunk/Master/texmf-dist/makeindex/memoir/basic.gst	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/makeindex/memoir/basic.gst	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/source/latex/memoir/memoir.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/memoir/memoir.dtx	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/source/latex/memoir/memoir.dtx	2018-04-05 21:10:27 UTC (rev 47305)
@@ -20,7 +20,7 @@
 % This work consists of the files listed in the README file.
 % 
 % \fi
-% \CheckSum{30773}
+% \CheckSum{31006}
 %
 % \changes{v0.1}{2001/05/20}{First public alpha release}
 % \changes{v0.2}{2001/06/03}{First beta release}
@@ -169,6 +169,7 @@
 % \def\fileversion{v3.7d}          \def\filedate{2015/04/23}
 % \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} ^^A remember to fix
 % \title{The LaTeX \Lpack{memoir} class for configurable book 
 %        typesetting: Source code\thanks{This
 %        file (\texttt{\dtxfile}) has version number \fileversion, last revised
@@ -275,7 +276,7 @@
 %<*driver>
 \documentclass[twoside]{ltxdoc}
 \usepackage[T1]{fontenc}
-\usepackage{url}
+\usepackage{url,array}
 %%\usepackage[draft=false,
 %%            plainpages=false,
 %%            pdfpagelabels,
@@ -315,6 +316,7 @@
 \newcommand*{\Lpack}[1]{\textsf {#1}}           % typeset a package
 \newcommand*{\ctt}{\textsc{ctt}}                % comp.text.tex
 \newenvironment{PW}{\em}{}
+\newenvironment{dlf}{\em}{}
 \newcommand*{\theTeXbook}{\textit{The \TeX book}}
 \let\oldllap\llap
 \def\llap#1{\oldllap{#1\quad}} % might be evil
@@ -398,11 +400,11 @@
 %    Announce the name, option files and version for LaTeX2e files:
 %    \begin{macrocode}
 %<class>\ProvidesClass{memoir}%
-%<class>  [2016/05/16 v3.7f configurable book, report, article document class]
+%<class>  [2018/04/04 v3.7g configurable book, report, article document class]
 %    \end{macrocode}
 %  In the manual it is useful to know the current version.
 %    \begin{macrocode}
-%<class>\newcommand\memversion{v3.7f, 2016/05/16}
+%<class>\newcommand\memversion{v3.7g, 2018/04/04}
 %<9pt>\ProvidesFile{mem9.clo}%
 %<9pt>             [2008/01/30 v0.4 memoir class 9pt size option]
 %<10pt>\ProvidesFile{mem10.clo}%
@@ -1141,27 +1143,28 @@
 % senseless for a class to attempt to take account of everything that might 
 % be used with it.
 %
-% Note (2016/05/16): Due to recent changes in Luatex, most notably the
-% removal of several \cs{pdf...} macro, several PDF tests fail with
-% LuaLaTeX. As a temporary measure the following is used to restore
-% the old functionality when a newer LuaLaTeX is used. Code courtesy
-% of David Carlisle. At some point we will include some of this into
-% the class.
+% ^^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}
-%    \begin{macrocode}
-\ifx\pdfextension\@undefined\else
-  \RequirePackage{luatex85}
-\fi    
-
-%    \end{macrocode}
+% \changes{v3.7g}{2018/03/09}{\Lpack{luatex85} removed again, now
+% relying on external \cs{if<engine>} packages and have rewritten the
+% macros that use \cs{pdf...}}
+% ^^A %    \begin{macrocode}
+% ^^A \ifx\pdfextension\@undefined\else
+% ^^A   \RequirePackage{luatex85}
+% ^^A \fi    
+% ^^A 
+% ^^A %    \end{macrocode}
 % 
 %
 % \begin{macro}{\ifpdf}
-% \begin{macro}{\pdftrue}
-% \begin{macro}{\pdffalse}
 % This can be used to check whether or not a document is being processed
-% by \LaTeX{} or pdf\LaTeX. 
+% 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}
@@ -1170,83 +1173,32 @@
 % 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}
-\newif\ifm at mifpdf
-  \m at mifpdffalse
-\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    Package `ifpdf' is not installed.\MessageBreak
-    The package is being emulated}%
-\m at mifpdftrue
-\expandafter\newif\csname ifpdf\endcsname
-  \pdffalse
-\ifx\pdfoutput\undefined
-\else
-  \ifx\pdfoutput\@undefined
-  \else
-    \ifx\pdfoutput\relax
-    \else
-      \ifnum\pdfoutput>0\relax
-        \pdftrue
-      \fi
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifpdf}[2008/07/23]
-}
-
+\RequirePackage{ifpdf}[2017/03/15] 
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\ifetex}
-% \begin{macro}{\etextrue}
-% \begin{macro}{\etexfalse}
-% Check if \texttt{etex} is being used. This is based on the check for 
-% \texttt{pdf(latex)}. Someone may have created a package for this, 
-% or perhaps not.
+% 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}
-\newif\ifm at mifetex
-  \m at mifetexfalse
-\IfFileExists{ifetex.sty}{\RequirePackage{ifetex}\relax}{%
-  \ClassInfo{memoir}{%
-    An `ifetex' package is being emulated}%
-\m at mifetextrue
-\newif\ifetex
-  \etexfalse
-\ifx\eTeXversion\undefined
-\else
-  \ifx\eTeXversion\@undefined
-  \else
-    \ifx\eTeXversion\relax
-    \else
-      \ifnum\eTeXversion>0\relax
-        \etextrue
-      \fi
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifetex}[2008/07/23]
-}
-
+\RequirePackage{ifetex}
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
-%
-%  Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used,
+% Having supplied an \cs{ifpdf} to check if pdfLaTeX is being used,
 % here's one for XeTeX.
 %
 % \begin{macro}{\ifxetex}
-% \begin{macro}{\xetextrue}
-% \begin{macro}{\xetexfalse}
-% \begin{macro}{\RequireXeTeX}
-% Checks if XeTeX is being used.
+% 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
@@ -1253,43 +1205,16 @@
 % 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}
-\newif\ifm at mifxetex
-  \m at mifxetexfalse
-\IfFileExists{ifxetex.sty}{\RequirePackage{ifxetex}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    The `ifxetex' package is not installed.\MessageBreak
-    The package is being emulated}%
-\expandafter\newif\csname ifxetex\endcsname
-\@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue}
-\m at mifxetextrue%
+\RequirePackage{ifxetex}[2010/09/12]
 %    \end{macrocode}
-% Check for XeTeX from the \Lpack{ifxetex} package.
-%    \begin{macrocode}
-%%\EmulatedPackage{ifxetex}[2008/07/23]
-}
-\ifm at mifxetex%
-% ifxetex package not found, emulate \RequireXeTeX
-\def\RequireXeTeX{%
-  \ifxetex\else
-  \@memerror{XeTeX is required to process this document}%
-            {Try again with xelatex, not (pdf)latex.\MessageBreak
-             Or try removing any XeTeX package(s).}
-  \fi}
-\fi
-
-%    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\ifluatex}
-% \begin{macro}{\luatextrue}
-% \begin{macro}{\luatexfalse}
-% Check if \texttt{luatex} is being used. This is based on the check for 
-% \texttt{pdf(latex)}. Someone may have created a package for this, or 
-% perhaps not.
+% 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
@@ -1298,33 +1223,14 @@
 % 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}
-\newif\ifm at mifluatex
-  \m at mifluatexfalse
-\IfFileExists{ifluatex.sty}{\RequirePackage{ifluatex}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    The `ifluatex' package is not installed.\MessageBreak
-    The package is being emulated}%
-\m at mifluatextrue
-\expandafter\newif\csname ifluatex\endcsname
-  \luatexfalse
-\ifx\luatexversion\@undefined
-\else
-  \ifx\luatexversion\undefined
-  \else
-    \ifx\luatexversion\relax
-    \else
-      \luatextrue
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifluatex}[2008/07/23]
-}
+\RequirePackage{ifluatex}[2016/05/16]
 
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
 %
 % \subsection{Extending an existing macro}
 %
@@ -2407,7 +2313,21 @@
 
 %    \end{macrocode}
 %
+% \subsection{The \Lopt{fullptlayout} option}
+% \changes{v3.7g}{2018/03/09}{Added the \Lopt{fullptlayout} option}
+% \begin{macro}{\mem at settopoint}
+% By default the class will truncate some layout lengths to a whole
+% number of points.\footnote{Presumably because it looks better when
+% the layout is written to the log.} This might not be desirable, so the
+% \Lopt{fullptlayout} class option disables this truncation.
+%    \begin{macrocode}
+\newcommand\mem at settopoint[1]{\@settopoint{#1}}
+\DeclareOption{fullptlayout}{\renewcommand\mem at settopoint{\@gobble}}
+
+%    \end{macrocode}
+% \end{macro}
 %
+%
 % \changes{v1.6180339f}{2009/07/12}{Added dead man switch for etex}
 % \subsection{ETeX}
 % 
@@ -4556,8 +4476,10 @@
 \fi
 %    \end{macrocode}
 % Adjust the width to be a whole number of points.
+% \changes{v3.7g}{2018/03/09}{Switch to private truncating macro so we
+% can disable truncation via class option}
 %    \begin{macrocode}
-\@settopoint\textwidth
+\mem at settopoint\textwidth
 
 %    \end{macrocode}
 % \end{macro}
@@ -4618,9 +4540,11 @@
 % geometry through \cs{setsidebars}.
 % \changes{v1.618033}{2008/06/02}{Ensured initial value of \cs{marginparwidth}
 %  was positive}
+% \changes{v3.7g}{2018/03/09}{Switch to private truncating macro so we
+% can disable truncation via class option}
 %    \begin{macrocode}
-\@settopoint\oddsidemargin
-\@settopoint\marginparwidth
+\mem at settopoint\oddsidemargin
+\mem at settopoint\marginparwidth
 \ifdim\marginparwidth<1pt \setlength\marginparwidth{1pt}\fi
 
 \setlength\evensidemargin  {\paperwidth}
@@ -4627,7 +4551,7 @@
 \addtolength\evensidemargin{-2in}
 \addtolength\evensidemargin{-\textwidth}
 \addtolength\evensidemargin{-\oddsidemargin}
-\@settopoint\evensidemargin
+\mem at settopoint\evensidemargin
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -4637,6 +4561,8 @@
 %    The \cs{topmargin} is the distance below the top of the printable
 % area (1in below the top of the paper) and the top of the box
 % containing the running head.
+% \changes{v3.7g}{2018/03/09}{Switch to private truncating macro so we
+% can disable truncation via class option}
 %    \begin{macrocode}
 \setlength\topmargin  {\paperheight}
 \addtolength\topmargin{-2in}
@@ -4645,7 +4571,7 @@
 \addtolength\topmargin{-\textheight}
 \addtolength\topmargin{-\footskip}
 \addtolength\topmargin{-.5\topmargin}
-\@settopoint\topmargin
+\mem at settopoint\topmargin
 
 %    \end{macrocode}
 % \end{macro}
@@ -4995,10 +4921,12 @@
 %
 %
 %    Set the values to the nearest whole point.
+% \changes{v3.7g}{2018/03/09}{Switch to private truncating macro so we
+% can disable truncation via class option}
 %    \begin{macrocode}
-  \@settopoint\textwidth
-  \@settopoint\oddsidemargin
-  \@settopoint\evensidemargin
+  \mem at settopoint\textwidth
+  \mem at settopoint\oddsidemargin
+  \mem at settopoint\evensidemargin
 %    \end{macrocode}
 % Fix standard page layouts after possible change of \cs{textwidth}.
 % \changes{v1.6180339f}{2009/03/16}{Added \cs{fixheaderwidths} to \cs{fixthelayout}}
@@ -5180,7 +5108,6 @@
 % same optional argument as \cs{checkthelayout}.
 % \changes{v0.2}{2001/06/03}{Replaced \cs{fixpagelayout} by \cs{checkandfixthelayout}}
 % \changes{v1.0a}{2002/01/18}{Partitioned \cs{checkandfixthelayout}}
-%    \begin{macrocode}
 % \changes{v1.61803}{2008/01/30}{Changed \cs{checkandfixthelayout}
 %          for the extended \cs{checkthelayout} (mempatch v4.5)}
 %    \begin{macrocode}
@@ -5192,14 +5119,60 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% 
+% \begin{macro}{\mem at fixpagelayout}
+% \changes{v3.7g}{2018/03/09}{Changed to use this instead of
+% \cs{fixpdflayout} and \cs{fixdvipslayout}, then we no longer need \Lpack{luatex85}}
+% Outputting the size of the output document. This is a little tricky as
+% the various engines do not quite agree on which variables to use. As
+% of 2018 we will be using this: First of \cs{pdfpageheight/width} is
+% used by pdf(e)tex based enginges. We set them if they are
+% defined. Just incase someone need to be able to patch this, we make
+% it into a macro and just run it at the start of the cocument
+%    \begin{macrocode}
+\newcommand\mem at fixpagelayout{%
+  \@ifundefined{pdfpageheight}{}{\pdfpageheight=\the\stockheight}
+  \@ifundefined{pdfpagewidth}{}{\pdfpagewidth=\the\stockwidth}
+%    \end{macrocode}
+% Next comes the two macros that recent luaTeX versions use instead of
+% the \cs{pdf...} equivalents.
+%    \begin{macrocode}
+  \@ifundefined{pageheight}{}{\pageheight=\the\stockheight}
+  \@ifundefined{pagewidth}{}{\pagewidth=\the\stockwidth}
+%    \end{macrocode}
+% If is unclear why these were added to the class sources in the first
+% place, we'll just leave them.
+%    \begin{macrocode}
+  \@ifundefined{pdfvorigin}{}{\ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi}
+  \@ifundefined{pdfhorigin}{}{\ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi}
+%    \end{macrocode}
+% Lastly we need to output a special to the DVI, but other engines can
+% also understand specials, so to not end up getting those pesky
+% non-PDF special warnings, we need some engine tests before emiting
+% the data to the DVI.
+%    \begin{macrocode}
+  \ifluatex\else
+    \ifxetex\else
+      \ifpdf\else
+        \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}
+      \fi
+    \fi
+  \fi    
+}
+
+\AtBeginDocument{\mem at fixpagelayout}
+
+%    \end{macrocode}
+% \end{macro}
 %
 % \begin{macro}{\fixpdflayout}
 % \begin{macro}{\fixdvipslayout}
-% Page layout with pdf\LaTeX{} seems a bit iffy.
-% At the suggestion of Lars Madsen, help with 
-% setting viewer (e.g., ghostview)
-% window sizes for dvi/ps. \cs{fixdvipslayout} does for \file{dvi} output
-% as \cs{fixpdflayout} does for \file{pdf} output.
+% As of 2018 these are disabled
+% ^^A % Page layout with pdf\LaTeX{} seems a bit iffy.
+% ^^A % At the suggestion of Lars Madsen, help with 
+% ^^A % setting viewer (e.g., ghostview)
+% ^^A % window sizes for dvi/ps. \cs{fixdvipslayout} does for \file{dvi} output
+% ^^A % as \cs{fixpdflayout} does for \file{pdf} output.
 % \changes{v1.4}{2003/11/22}{Added \cs{fixpdflayout} (from patch v1.6)}
 % \changes{v1.4}{2003/12/01}{Added \cs{fixdvipslayout} }
 % \changes{v1.61803398}{2009/08/17}{on ctt dynamotwain suggested a
@@ -5207,51 +5180,55 @@
 % such that the \cs{special} is not outputtet when running xelatex}
 %    \begin{macrocode}
 \newcommand*{\fixpdflayout}{%
-  \pdfpageheight=\the\stockheight
-  \pdfpagewidth=\the\stockwidth
-  \ifxetex\else
-  \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
-  \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
-  \fi}
+  \ClassWarning{memoir}{As of 2018, \string\fixpdflayout\ is no longer used}
+ % \pdfpageheight=\the\stockheight
+ % \pdfpagewidth=\the\stockwidth
+ % \ifxetex\else
+ % \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
+ % \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
+ % \fi
+}
 \newcommand*{\fixdvipslayout}{%
-  \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}}
+  \ClassWarning{memoir}{As of 2018, \string\fixdvipslayout\ is no longer used}
+  %\AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}
+}
+%    \end{macrocode}
 
-\AtBeginDocument{%
-  \ifxetex
-    \fixpdflayout
-  \else
-    \ifpdf
-      \ifnum\pdfoutput<\@ne
-        \fixdvipslayout
-      \else
-        \fixpdflayout
-      \fi
-    \else
-      \fixdvipslayout
-    \fi
-  \fi}
+% ^^A % \AtBeginDocument{%
+% ^^A %   \ifxetex
+% ^^A %     \fixpdflayout
+% ^^A %   \else
+% ^^A %     \ifpdf
+% ^^A %       \ifnum\pdfoutput<\@ne
+% ^^A %         \fixdvipslayout
+% ^^A %       \else
+% ^^A %         \fixpdflayout
+% ^^A %       \fi
+% ^^A %     \else
+% ^^A %       \fixdvipslayout
+% ^^A %     \fi
+% ^^A %   \fi}
 
-%    \end{macrocode}
 %
-% With a landscape document when going \texttt{latex -> dvips} the 
-% resulting \file{.ps} file
-% may apear upside down in \texttt{ghostview}. If this happens, try putting
-% the following in the document preamble:
-% \begin{verbatim}
-% \addtodef{\fixdvipslayout}{}{%
-%   \special{!TeXDict begin /landplus90{true}store end }}
-% \end{verbatim}
-% See \texttt{http://www.radicaleye.com.dvips.html} (DVIPS Home Page) for
-% an explanation.
-%
-%  Some other potential specials for PostScript printing may be 
-% (at least for an HP 5SiMx LaserJet duplex printer):
-% \begin{verbatim}
-% \special{!TeXDict begin <</Duplex true>> 
-%                         setpagedevice end} % duplex
-% \special{!TeXDict begin <</Tumble true>> 
-%                         setpagedevice end} % short side binding
-% \end{verbatim}
+% ^^A % With a landscape document when going \texttt{latex -> dvips} the 
+% ^^A % resulting \file{.ps} file
+% ^^A % may apear upside down in \texttt{ghostview}. If this happens, try putting
+% ^^A % the following in the document preamble:
+% ^^A % \begin{verbatim}
+% ^^A % \addtodef{\fixdvipslayout}{}{%
+% ^^A %   \special{!TeXDict begin /landplus90{true}store end }}
+% ^^A % \end{verbatim}
+% ^^A % See \texttt{http://www.radicaleye.com.dvips.html} (DVIPS Home Page) for
+% ^^A % an explanation.
+% ^^A %
+% ^^A %  Some other potential specials for PostScript printing may be 
+% ^^A % (at least for an HP 5SiMx LaserJet duplex printer):
+% ^^A % \begin{verbatim}
+% ^^A % \special{!TeXDict begin <</Duplex true>> 
+% ^^A %                         setpagedevice end} % duplex
+% ^^A % \special{!TeXDict begin <</Tumble true>> 
+% ^^A %                         setpagedevice end} % short side binding
+% ^^A % \end{verbatim}
 % \end{macro}
 % \end{macro}
 %
@@ -7456,6 +7433,8 @@
 %   addition.
 %   \changes{v3.7d}{2014/07/28}{Delayed addition to
 %   \cs{@xfloat}. Reported by Ulrike Fischer}.
+%   \changes{v3.7g}{2017/05/08}{Delayed the addition of the adjustment
+%   to the float until after \cs{normalsize}. Reported at \protect\url{https://tex.stackexchange.com/q/368422/3929}}
 %    \begin{macrocode}
 \AtBeginDocument{
   \let\m at m@xfloat\@xfloat
@@ -7462,7 +7441,9 @@
   \def\@xfloat #1[#2]{%
     \m at m@xfloat #1[#2]%
     \def\baselinestretch{\m at m@float at spacing}%
-    \normalsize}
+    \normalsize%
+    \@nameuse{#1adjustment}%
+  }
 }
 
 %    \end{macrocode}
@@ -7926,13 +7907,30 @@
 % \begin{environment}{mem at titlingpage}
 % \begin{environment}{titlingpage}
 % \begin{environment}{titlingpage*}
-%  The \Lenv{titlingpage} environment sets the pagestyle to be \pstyle{titlingpage},
+% \begin{macro}{\titlingpageend}
+%   The \Lenv{titlingpage} environment sets the pagestyle to be \pstyle{titlingpage},
 % disables the footnote rule and ensures that the page is single
 % column. At the end it switches back to twocolumn if neccessary,
 % and then starts a new page as number 1. On the other hand
 % \Lenv{titlingpage*}, does \emph{not} reset the page counter.
+%
+% At the end of the titlingpage we clear the page to let the next data
+% start on a new page. However there is a slight complication
+% here. Should we clear to next page or to next righthand page. One
+% could argue that under \Lopt{twoside} going to next right hand page
+% would be best, but then there is also \Lopt{openany}. In order to
+% make this configurable we will factor this out in a configurable
+% macro, and leave the defaults as they are so not to mess with
+% existing documents.
 % \changes{v3.6k}{2012/12/24}{Added \Lenv{titlingpage*} env}
+% \changes{v3.7g}{2018/03/06}{Added \cs{titlingpageend}}
 %    \begin{macrocode}
+\newcommand\titlingpageend[2]{%
+  \def\mem at titlingpage@clear at for@twoside{#1}%
+  \def\mem at titlingpage@clear at for@oneside{#2}%
+}
+ % default
+\titlingpageend{\cleardoublepage}{\clearpage}
 \newenvironment{mem at titlingpage}%
   {\let\footnoterule\relax
    \let\footnotesize\small
@@ -7946,7 +7944,8 @@
   }{%
    \thispagestyle{titlingpage}%
    \if at restonecol \twocolumn \fi
-   \if at twoside \cleardoublepage \else \clearpage \fi
+   % \if at twoside \cleardoublepage \else \clearpage \fi
+   \if at twoside \mem at titlingpage@clear at for@twoside \else \mem at titlingpage@clear at for@oneside \fi
    \if\mem at titlpg@reset\setcounter{page}{\@ne}\fi}
 \newenvironment{titlingpage}{%
   \def\mem at titlpg@reset{00}%
@@ -7959,6 +7958,7 @@
 \aliaspagestyle{titlingpage}{empty}
 
 %    \end{macrocode}
+% \end{macro}
 % \end{environment}
 % \end{environment}
 % \end{environment}
@@ -12709,7 +12709,11 @@
              \advance\labelwidth-\labelsep
              \topsep\topsepii
              \parsep\parsepii
-             \itemsep\parsepii}
+%    \end{macrocode}
+% \changes{v3.7g}{2016/11/22}{Typo: \cs{itemsep} should here point at
+% \cs{itemsepii}, reported by Thomas Koeppe, private email}
+%    \begin{macrocode}
+             \itemsep\itemsepii}
 
 \def\@listiii{\leftmargin\leftmarginiii
               \labelwidth\leftmarginiii
@@ -13844,13 +13848,19 @@
 % \begin{macro}{\@vslnumleft}
 % Internal code for right/left line numbers.
 % \changes{v1.61803398}{2009/07/17}{Added bidi support to \cs{@vslnumright}
-%          and \cs{@vslnumleft}}
+% and \cs{@vslnumleft}}
+% \changes{v3.7g}{2018/02/28}{Added \cs{nobreak} to both
+% \cs{@vslnumright} and \cs{@vslnumleft}, reported on
+% \protect\url{https://tex.stackexchange.com/a/415939/3929}, to avoid strange
+% double line breaks}
 %    \begin{macrocode}
 \newcommand*{\@vslnumright}{%
+  \nobreak%
   \hfill\rlap{%\kern\vrightskip\kern\rightmargin%
               \kern\memRTLvrightskip\kern\rightmargin%
               \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
 \newcommand*{\@vslnumleft}{%
+  \nobreak%
   \hfill\rlap{%\kern-\textwidth\kern-\vrightskip%
               \kern-\textwidth\kern-\memRTLvrightskip%
               \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
@@ -14818,57 +14828,68 @@
 %%%%%%%%%% With acknowledgements to %%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%% Frank Mittelbach & David Carlisle %%%%%%%%%%%%%%%%%%%%%
 
+%%%%%%%%%% Copy corresponds to array.sty 2016/10/06 v2.4d %%%%%%%%% 
 %    \end{macrocode}
+% \changes{v3.7g}{2018/03/05}{Updated the embedded copy of the
+% \Lpack{array} package to version 2.4d, 2016/10/06}
+% \begin{dlf}
+%  dlf: The \Lpack{array} package has redundant code (caused by a
+%  quick mashing of and earlier \Lpack{array} version and the
+%  \Lpack{newaray} package). In thus update (2018/03/05) this
+%  redundant code is \emph{not} removed as it makes it very hard to
+%  see where there are class changes to the \Lpack{array} code, and
+%  when stuff is simply removed. We'll leave it up to the LaTeXteam to
+%  clean up the \Lpack{array} code at some point.
 %
+% The following is a carbon copy of the DTX code from
+% \verb|array.dtx|, package specific \cs{changes} lines have been
+% removed, and we have made any error/warning messages class specific,
+% instead of package specific.
+% \end{dlf}
 %
+
 % \subsubsection{The construction of the preamble}
 %
-% \begin{PW}
-% PW: The original \Lpack{array} package has redundant code (caused by a quick 
-% mashing of an early \Lpack{array} and the \Lpack{newarray} packages). I
-% have tried to remove the redundancies and overlaps.
-% \end{PW}
-%
 % It is obvious that those environments will consist mainly of an
-% \cs{halign}, because \TeX\ typesets tables using this primitive.
+% \verb=\halign=, because \TeX\ typesets tables using this primitive.
 % That is why we will now take a look at the algorithm which determines
-% a preamble for a \cs{halign} starting with a given user preamble
+% a preamble for a \verb=\halign= starting with a given user preamble
 % using the options mentioned above.
 %
 % The most interesting macros of this implementation are without doubt
 % those which are responsible for the construction of the preamble for
-% the \cs{halign}. The underlying algorithm was developed by
+% the \verb=\halign=. The underlying algorithm was developed by
 % \textsc{Lamport} (resp.\ \textsc{Knuth}, see texhax V87\#??), and it
 % has been extended and improved.
 %
 % The user preamble will be read \textsf{token} by \textsf{token}.  A
 % \textsf{token} is a single character like \texttt{c} or a block
-% enclosed in \verb?{...}?. For example the preamble of
-% \verb?\begin{tabular}?\linebreak[0]\verb?{lc||c@{\hspace{1cm}}}? consists of
-% the \textsf{token} \texttt{l}, \texttt{c}, \verb?|?, \verb?|?,
-% \texttt{@} and \verb?\hspace{1cm}?.
+% enclosed in \verb={...}=. For example the preamble of
+% \verb=\begin{tabular}=\linebreak[0]\verb={lc||c@{\hspace{1cm}}}= consists of
+% the \textsf{token} \texttt{l}, \texttt{c}, \texttt{|}, \texttt{|},
+% \texttt{@} and \verb=\hspace{1cm}=.
 %
 % The currently used \textsf{token} and the one, used before, are needed
 % to decide on how the construction of the preamble has to be
 % continued.
 % In the example mentioned above the \texttt{l} causes the preamble
-% to begin with \verb?\hskip\tabcolsep?. Furthermore
-% \verb?# \hfil? would be appended to define a flush left column.
+% to begin with \verb=\hskip\tabcolsep=. Furthermore
+% \verb=# \hfil= would be appended to define a flush left column.
 % The next \textsf{token} is a \texttt{c}. Because it was preceded by an
 % \texttt{l} it generates a new column. This is done with
-% \verb?\hskip \tabcolsep & \hskip \tabcolsep?. The column which is to
-% be centered will be appended with \verb?\hfil # \hfil?.
-% The \textsf{token} \verb?|? would then add a space of
-% \verb?\hskip \tabcolsep?
+% \verb=\hskip \tabcolsep & \hskip \tabcolsep=. The column which is to
+% be centered will be appended with \verb=\hfil # \hfil=.
+% The \textsf{token} \texttt{|} would then add a space of
+% \verb=\hskip \tabcolsep=
 % and a vertical line because the last
 % \textsf{tokens} was a \texttt{c}.
-% The following \textsf{token} \verb?|? would only add a space
-% \verb?\hskip \doublerulesep? because it was preceded by the
-% \textsf{token} \verb?|?. We will not discuss our example further but
+% The following \textsf{token} \texttt{|} would only add a space
+% \verb=\hskip \doublerulesep= because it was preceded by the
+% \textsf{token} \texttt{|}. We will not discuss our example further but
 %  rather take a look at the general case of constructing preambles.
 %
 % The example shows that the desired preamble for the
-% \cs{halign} can be constructed as soon as the action of all
+% \verb=\halign= can be constructed as soon as the action of all
 % combinations
 % of the preamble \textsf{tokens} are specified. There are 18 such
 % \textsf{tokens}
@@ -14882,10 +14903,9 @@
 % Table~\ref{tab:Klassen} lists all \textsf{token} classes and
 % their corresponding numbers.
 % \begin{table}[ht]
-% \begin{center} \ttfamily
-% ^^A   \begin{tabular}[t]{>{\ttfamily}ccc}
-%    \begin{tabular}[t]{ccc}
-%       \textsf{token} & \cs{@chclass} & \cs{@chnum} \\[2mm]
+% \begin{center}
+%       \begin{tabular}[t]{>{\ttfamily}ccc}
+%       \textsf{token} & \verb=\@chclass= & \verb=\@chnum= \\[2mm]
 %       c   & 0  & 0 \\
 %       l   & 0  & 1 \\
 %       r   & 0  & 2 \\
@@ -14892,15 +14912,14 @@
 %       p-arg    & 0  & 3 \\
 %       t-arg    & 0  & 4 \\
 %       b-arg    & 0  & 5 \\
-%       \verb?|?   & 1  & 0 \\
+%       |   & 1  & 0 \\
 %       !-arg    & 1  & 1 \\
 %       <-arg    & 2  & --- \\
 %       >-arg    & 3  & ---
 %    \end{tabular}
 %    \kern3mm \vrule \kern3mm%
-% ^^A   \begin{tabular}[t]{>{\ttfamily}ccc}
-%    \begin{tabular}[t]{ccc}
-%       \textsf{token} & \cs{@chclass} & \cs{@chnum} \\[2mm]
+%    \begin{tabular}[t]{>{\ttfamily}ccc}
+%       \textsf{token} & \verb=\@chclass= & \verb=\@chnum= \\[2mm]
 %       Start    & 4  & --- \\
 %       @-arg    & 5  & --- \\
 %       !   & 6  & --- \\
@@ -14922,16 +14941,16 @@
 % \begin{macro}{\@lastchclass}
 %    The class and the number of the current \textsf{token} are saved in
 %    the
-%    \textsf{count} registers \cs{@chclass}
-%    and \cs{@chnum}, while the class of the previous
+%    \textsf{count} registers \verb=\@chclass=
+%    and \verb=\@chnum=, while the class of the previous
 %    \textsf{token} is stored in the
-%    \textsf{count} register \cs{lastchclass}.
+%    \textsf{count} register \verb=\@lastchclass=.
 %    All of the mentioned registers are already allocated in
 %    \texttt{latex.tex},
 %    which is the reason why the following three lines of code are
 %    commented out.
-%    Later throughout the text I will not mention it again explicitely
-%    whenever I use a \verb?%? sign. These parts are already defined in
+%    Later throughout the text I will not mention it again explicitly
+%    whenever I use a \verb=%= sign. These parts are already defined in
 %    \texttt{latex.tex}.
 %    \begin{macrocode}
 % \newcount \@chclass
@@ -14946,10 +14965,10 @@
 %
 % \begin{macro}{\@addtopreamble}
 %    We will save the already constructed preamble for
-%    the \cs{halign}
-%    in the global macro \cs{@preamble}. This will then be
+%    the \verb=\halign=
+%    in the global macro \verb=\@preamble=. This will then be
 %     enlarged with
-%    the command \cs{@addtopreamble}.
+%    the command \verb=\@addtopreamble=.
 %    \begin{macrocode}
 \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}}
 %    \end{macrocode}
@@ -14956,18 +14975,23 @@
 % \end{macro}
 %
 %
+%
+%
+%
+% \subsubsection{The character class of a \textsf{token}}
+%
 % \begin{macro}{\@testpach}
-%    With the help of \cs{@lastchclass} we can now define a macro
+%    With the help of \verb=\@lastchclass= we can now define a macro
 %    which determines the class and the number of a given preamble
 %    \textsf{token}
 %    and assigns them to the registers
-%    \cs{@chclass} and \cs{@chnum}.
+%    \verb=\@chclass= and \verb=\@chnum=.
 %    \begin{macrocode}
 \def\@testpach{\@chclass
 %    \end{macrocode}
 %    First we deal with the cases in which the \textsf{token}
-%    (\verb?#1?) is the argument of \texttt{!}, \texttt{@}, \texttt{<} or
-%    \texttt{>}. We can see this from the value of \cs{@lastchclass}:
+%    (\verb=#1=) is the argument of \texttt{!}, \texttt{@}, \texttt{<} or
+%    \texttt{>}. We can see this from the value of \verb=\@lastchclass=:
 %    \begin{macrocode}
  \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
   \ifnum \@lastchclass=7 5 \else
@@ -14975,28 +14999,28 @@
     \ifnum \@lastchclass=9 \thr@@
 %    \end{macrocode}
 %    Otherwise we will assume that the \textsf{token} belongs to the
-%    class 0
-%    and assign the corresponding number to \cs{@chnum} if our
+%    class $0$
+%    and assign the corresponding number to \verb=\@chnum= if our
 %    assumption is correct.
 %    \begin{macrocode}
    \else \z@
 %    \end{macrocode}
 %    If the last \textsf{token} was a \texttt{p}, \texttt{m} or a
-%    \texttt{b}, \cs{@chnum} already has the right value. This is the
+%    \texttt{b}, \verb=\@chnum= already has the right value. This is the
 %    reason for the somewhat curious choice of the \textsf{token}
-%    numbers in class 10.
+%    numbers in class $10$.
 %    \begin{macrocode}
    \ifnum \@lastchclass = 10 \else
 %    \end{macrocode}
-%    Otherwise we will check if \cs{@nextchar} is either a \texttt{c},
+%    Otherwise we will check if \verb=\@nextchar= is either a \texttt{c},
 %    \texttt{l} or an \texttt{r}.  Some applications change the
 %    catcodes of certain characters like ``\texttt{@}'' in
 %    \texttt{amstex.sty}. As a result the tests below would fail since
 %    they assume non-active character tokens. Therefore we evaluate
-%    \cs{@nextchar} once thereby turning the first token of its
+%    \verb=\@nextchar= once thereby turning the first token of its
 %    replacement text into a char. At this point here this should have
-%    been the only char present in \cs{@nextchar} which put into via a
-%    \cs{def}.
+%    been the only char present in \verb=\@nextchar= which put into via a
+%    \verb=\def=.
 %    \begin{macrocode}
    \edef\@nextchar{\expandafter\string\@nextchar}%
    \@chnum
@@ -15005,13 +15029,13 @@
      \if \@nextchar r\tw@ \else
 %    \end{macrocode}
 %    If it is a different \textsf{token}, we know that the class was
-%    not 0. We assign the value 0 to \cs{@chnum} because this value
-%    is needed for the \verb?|?--\textsf{token}. Now we must check
-%    the remaining classes.  Note that the value of \cs{@chnum} is
+%    not $0$. We assign the value $0$ to \verb=\@chnum= because this value
+%    is needed for the \texttt{|}--\textsf{token}. Now we must check
+%    the remaining classes.  Note that the value of \verb=\@chnum= is
 %    insignificant here for most classes.
 %    \begin{macrocode}
    \z@ \@chclass
-   \if\@nextchar |\@ne \else%| emacs
+   \if\@nextchar |\@ne \else
     \if \@nextchar !6 \else
      \if \@nextchar @7 \else
       \if \@nextchar <8 \else
@@ -15018,7 +15042,7 @@
        \if \@nextchar >9 \else
 %    \end{macrocode}
 %    The remaining permitted \textsf{tokens} are \texttt{p},
-%    \texttt{m} and \texttt{b} (class 10).
+%    \texttt{m} and \texttt{b} (class $10$).
 %    \begin{macrocode}
   10
   \@chnum
@@ -15027,8 +15051,8 @@
     \if \@nextchar b5 \else
 %    \end{macrocode}
 %    Now the only remaining possibility is a forbidden \textsf{token},
-%    so we choose class 0 and number 0 and give an error message.
-%    Then we finish the macro by closing all \cs{if}'s.
+%    so we choose class $0$ and number $0$ and give an error message.
+%    Then we finish the macro by closing all \verb=\if='s.
 %    \begin{macrocode}
    \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
    \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
@@ -15035,10 +15059,121 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% The preamble will be enlarged with the help of \cs{xdef}, but the
+%
+%
+%
+%
+% \subsubsection{Multiple columns ($*$--form)}
+%
+% \begin{macro}{\@xexpast}
+% \begin{macro}{\the at toks}
+% \begin{macro}{\the at toksz}
+%    \label{@xexpast} Now we discuss the macro that deletes all forms
+%    of type \verb=*{=\textit{N\/}\verb=}{=\textit{String\/}\verb=}= from a user
+%    preamble and replaces them with \textit{N} copies of
+%    \textit{String}.  Nested $*$--expressions are dealt with
+%    correctly, that means $*$--expressions are not substituted if
+%    they are in explicit braces, as in \verb=@{*}=.
+%
+%    This macro is called via
+%    \verb=\@xexpast=\meta{preamble}\verb=*0x\@@=.
+%    The $*$--expression \verb=*0x= is being used to terminate the
+%    recursion,
+%    as we shall see later, and \verb=\@@= serves as an argument
+%    delimiter. \verb=\@xexpast= has four arguments. The first
+%    one is the part of the
+%    user preamble before the first $*$--expression while the second
+%    and third ones are the arguments of the first $*$--expression
+%    (that is \textit{N} and \textit{String} in the notation mentioned
+%    above).
+%    The fourth argument is the rest of the preamble.
+%    \begin{macrocode}
+\def\@xexpast#1*#2#3#4\@@{%
+%    \end{macrocode}
+%    The number of copies of \textit{String} (\verb=#2=) that are to be
+%    produced will be saved in a \textsf{count} register.
+%    \begin{macrocode}
+   \@tempcnta #2
+%    \end{macrocode}
+%    We save the part of the preamble which does not
+%    contain a $*$--form (\verb=#1=)
+%    in a \PlainTeX\ \textsf{token} register.
+%    We also save \textit{String} (\verb=#3=) using a \LaTeX\
+%    \textsf{token} register.
+%    \begin{macrocode}
+   \toks@={#1}\@temptokena={#3}%
+%    \end{macrocode}
+%    Now we have to use a little trick to produce \textit{N} copies of
+%    \textit{String}.
+%    We could try \verb=\def\@tempa{#1}= and then
+%    \textit{N} times \verb=\edef\@tempa{\@tempa#3}=. This would have the
+%    undesired effect that all macros within \verb=#1= and \verb=#3=
+%    would be expanded, although, for example, constructions like
+%    \verb=@{..}= are not supposed to be changed.
+%    That is why we \verb=\let= two control sequences to
+%    be equivalent to \verb=\relax=.
+%    \begin{macrocode}
+   \let\the at toksz\relax \let\the at toks\relax
+%    \end{macrocode}
+%    Then we ensure that \verb=\@tempa= contains
+%    \verb={\the at toksz\the at toks...\the at toks}= (the macro
+%    \verb=\the at toks= exactly \textit{N\/} times) as substitution text.
+%    \begin{macrocode}
+   \def\@tempa{\the at toksz}%
+   \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
+     {\edef\@tempa{\@tempa\the at toks}\advance \@tempcnta \m at ne}%
+%    \end{macrocode}
+%    If \textit{N\/} was greater than zero we prepare for another call
+%    of \verb=\@xexpast=. Otherwise we assume we have reached the end of
+%    the user preamble, because we had appended \verb=*0x\@@= when we first
+%    called \verb=\@xexpast=.  In other words: if the user inserts
+%    \verb=*{0}{..}= in his preamble, \LaTeX\ ignores the rest of it.
+%    \begin{macrocode}
+       \let \@tempb \@xexpast \else
+       \let \@tempb \@xexnoop \fi
+%    \end{macrocode}
+%    Now we will make sure that the part of the user preamble, which
+%    was already dealt with, will be saved again in \verb=\@tempa=.
+%    \begin{macrocode}
+   \def\the at toksz{\the\toks@}\def\the at toks{\the\@temptokena}%
+   \edef\@tempa{\@tempa}%
+%    \end{macrocode}
+%    We have now evaluated the first $*$--expression, and the user
+%    preamble up to this point
+%    is saved in \verb=\@tempa=. We will put the contents of
+%    \verb=\@tempa= and the rest of the user preamble together and work
+%    on the result with \verb=\@tempb=. This macro either corresponds
+%    to \verb=\@xexpast=, so that the next
+%    $*$--expression is handled, or to the macro \verb=\@xexnoop=,
+%    which only ends the recursion by deleting its argument.
+%    \begin{macrocode}
+   \expandafter \@tempb \@tempa #4\@@}
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\@xexnoop}
+%    So the first big problem is solved. Now it is easy to
+%    specify \verb=\@xexnoop=.
+%    Its argument is delimited by \verb=\@@= and it simply expands to
+%    nothing.
+%    \begin{macrocode}
+%  \def\@xexnoop#1\@@{}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+%
+%
+% \subsubsection{The insertion of declarations
+%           (\texttt{>}, \texttt{<}, \texttt{!}, \texttt{@})}
+%
+%
+% The preamble will be enlarged with the help of \verb=\xdef=, but the
 % arguments of \texttt{>}, \texttt{<},~\texttt{!}\ and \texttt{@} are
 % not supposed to be expanded during the construction (we want an
-% implementation that doesn't need a \cs{protect}). So we have to find a
+% implementation that doesn't need a \verb=\protect=). So we have to find a
 % way to inhibit the expansion of those arguments.
 %
 % We will solve this problem with \textsf{token} registers. We need
@@ -15048,19 +15183,26 @@
 % there are only 256 \textsf{token} registers. But then, who needs
 % tables with more than 100 columns?
 %
-% So how do we proceed? Let us assume that we had \verb?!{foo}? in the
+% One could also find a solution which only needs two or three
+% \textsf{token} registers by proceeding similarly as in the macro
+% \verb=\@xexpast= (see page \pageref{@xexpast}). The advantage of our
+% approach is the fact that we avoid some of the problems that arise
+% with the other method\footnote{Maybe there are also historical
+%  reasons.}.
+%
+% So how do we proceed? Let us assume that we had \verb=!{foo}= in the
 % user preamble and say we saved \texttt{foo} in
-% \textsf{token} register 5. Then we call
-% \verb?\@addtopreamble{\the at toks5}? where
-% \cs{the at toks} is defined in a way that it does not expand
-% (for example it could be equivalent to \cs{relax}). Every
+% \textsf{token} register $5$. Then we call
+% \verb=\@addtopreamble{\the at toks5}= where
+% \verb=\the at toks= is defined in a way that it does not expand
+% (for example it could be equivalent to \verb=\relax=). Every
 % following call
-% of \cs{@addtopreamble} leaves \cs{the at toks5} unchanged in
-% \cs{@preamble}. If the construction of the preamble is completed
-% we change the definition of \cs{the at toks} to
-% \verb?\the\toks? and expand \cs{@preamble} for the last time.
+% of \verb=\@addtopreamble= leaves \verb=\the at toks5= unchanged in
+% \verb=\@preamble=. If the construction of the preamble is completed
+% we change the definition of \verb=\the at toks= to
+% \verb=\the\toks= and expand \verb=\@preamble= for the last time.
 % During this process all parts of the form
-%    \cs{the at toks}\meta{Number}
+%    \verb=\the at toks=\meta{Number}
 % will be substituted by the contents of the respective \textsf{token}
 % registers.
 %
@@ -15067,7 +15209,7 @@
 % As we can see from this informal discussion the construction of the
 % preamble has to take place within a group, so that the
 % \textsf{token} registers we use will be freed later on. For that
-% reason we keep all assignments to \cs{@preamble} global; therefore the
+% reason we keep all assignments to \verb=\@preamble= global; therefore the
 % replacement text of this macro will remain the same after we leave
 % the group.
 %
@@ -15074,18 +15216,18 @@
 % \begin{macro}{\count@}
 %    We further need a \textsf{count} register to remember which
 %    \textsf{token} register is to be used next. This will be
-%    initialized with -1 if we want to begin with the \textsf{token}
-%    register 0. We use the \PlainTeX\ scratch register \cs{count@}
+%    initialized with $-1$ if we want to begin with the \textsf{token}
+%    register $0$. We use the \PlainTeX\ scratch register \verb=\count@=
 %    because everything takes place locally. All we have to do is
-%    insert \cs{the at toks} \cs{the} \cs{count@} into the preamble.
-%    \cs{the at toks} will remain unchanged and \verb?\the\count@? expands into
+%    insert \verb=\the at toks= \verb=\the= \verb=\count@= into the preamble.
+%    \verb=\the at toks= will remain unchanged and \verb=\the\count@= expands into
 %    the saved number.
 % \end{macro}
 %
 % \begin{macro}{\prepnext at tok}
-%    The macro \cs{prepnext at tok} is in charge of preparing the next
+%    The macro \verb=\prepnext at tok= is in charge of preparing the next
 %    \textsf{token} register. For that purpose we increase
-%    \cs{count@} by 1:
+%    \verb=\count@= by $1$:
 %    \begin{macrocode}
 \def\prepnext at tok{\advance \count@ \@ne
 %    \end{macrocode}
@@ -15093,69 +15235,80 @@
 %    \textsf{token} register might have.
 %    \begin{macrocode}
    \toks\count@{}}
-
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\save at decl}
 %    During the construction of the preamble the current
-%    \textsf{token} is always saved in the macro \cs{@nextchar} (see the
-%    definition of \cs{@mkpream}). The macro
-%    \cs{save at decl} saves it into the next free \textsf{token} register,
-%    i.e.\ in \verb?\toks\count@?.
-% We do not assume that the token register is free, we add the new
-% declarations to the front of the register. This is to allow user
-% preambles of the form, \verb?>{foo}>{bar}..?. Users are not encouraged to
-% enter such expressions directly, but they may result from the
-% rewriting of \cs{newcolumntype}'s.
+%    \textsf{token} is always saved in the macro \verb=\@nextchar= (see the
+%    definition of \verb=\@mkpream= on page \pageref{@mkpream}). The macro
+%    \verb=\save at decl= saves it into the next free \textsf{token} register,
+%    i.e.\ in \verb=\toks\count@=.
 %    \begin{macrocode}
-\def\save at decl{\toks \count@ = \expandafter\expandafter\expandafter
-                  {\expandafter\@nextchar\the\toks\count@}}
-
+\def\save at decl{\toks\count@ \expandafter{\@nextchar}}
 %    \end{macrocode}
+%    The reason for the  use of \verb=\relax= is the following
+%    hypothetical situation in the preamble:
+%    \quad \verb=..\the\toks1\the\toks2..= \quad \TeX\ expands
+%    \verb=\the\toks2= first in order to find out if the digit \verb=1=
+%    is followed by other digits. E.g.\ a \verb=5= saved in the
+%    \textsf{token} register $2$ would lead \TeX\ to insert the contents
+%    of \textsf{token} register $15$ instead of $1$ later on.
+%
+% The example above referred to an older version of \verb=\save at decl= which
+% inserted a \verb=\relex= inside the token register. This is now moved to
+% the places where the actual token registers are inserted (look for
+% \verb=\the at toks=) because the old version would still make= @=
+% expressions to moving arguments since after expanding the second
+% register while looking for the end of the number the contents of the
+% token register is added so that later on the whole register will be
+% expanded.  This serious bug was found after nearly two years
+% international use of this package  by Johannes Braams.
 % \end{macro}
 %
+%
+%
 % How does the situation look like, if we want to add another column
 % to the preamble, i.e.\ if we have found a \texttt{c}, \texttt{l},
 % \texttt{r}, \texttt{p}, \texttt{m} or \texttt{b} in the user
 % preamble?  In this case we have the problem of the \textsf{token}
-% register from \verb?>{..}? and \verb?<{..}? having to be inserted at this
-% moment because formating instructions like \cs{hfil} have to be set
-% around them. On the other hand it is not known yet, if any \verb?<{..}?
+% register from \verb=>{..}= and \verb=<{..}= having to be inserted at this
+% moment because formatting instructions like \verb=\hfil= have to be set
+% around them. On the other hand it is not known yet, if any \verb=<{..}=
 % instruction will appear in the user preamble at all.
 %
 % We solve this problem by adding two \textsf{token} registers at a
 % time.  This explains, why we have freed the \textsf{token} registers
-% in \cs{prepnext at tok}.
+% in \verb=\prepnext at tok=.
 %
 % \begin{macro}{\insert at column}
 % \begin{macro}{\@sharp}
-%    We now define the macro \cs{insert at column} which will do
+%    We now define the macro \verb=\insert at column= which will do
 %    this work for us.
 %    \begin{macrocode}
 \def\insert at column{%
 %    \end{macrocode}
 %    Here, we assume that the \textsf{count} register
-%    \cs{@tempcnta} has saved the value \verb?\count@?-1.
+%    \verb=\@tempcnta= has saved the value $\verb=\count@= - 1$.
 %    \begin{macrocode}
    \the at toks \the \@tempcnta
 %    \end{macrocode}
-%    Next follows the \verb?#? sign which specifies the place
+%    Next follows the \verb=#= sign which specifies the place
 %    where the text of the column shall be inserted. To avoid
 %    errors during the expansions in
-%    \cs{@addtopreamble} we hide this sign in the command
-%    \cs{@sharp} which is temporarily occupied with
-%    \cs{relax} during the build-up of the preamble.
+%    \verb=\@addtopreamble= we hide this sign in the command
+%    \verb=\@sharp= which is temporarily occupied with
+%    \verb=\relax= during the build-up of the preamble.
 %    To remove unwanted spaces before and after the column text, we set
-%    an \cs{ignorespaces}  in front and a \cs{unskip} afterwards.
+%    an \verb=\ignorespaces=  in front and a \verb=\unskip= afterwards.
 %    \begin{macrocode}
    \ignorespaces \@sharp \unskip
 %    \end{macrocode}
 %    Then the second \textsf{token} register follows whose number should
-%    be saved in \cs{count@}.
+%    be saved in \verb=\count@=.
 %    We make sure that there will be no further expansion after reading
-%    the number, by finishing with \cs{relax}. The case above is not
-%    critical since it is ended by \cs{ignorespaces}.
+%    the number, by finishing with \verb=\relax=. The case above is not
+%    critical since it is ended by \verb=\ignorespaces=.
 %    \begin{macrocode}
    \the at toks \the \count@ \relax}
 %    \end{macrocode}
@@ -15163,44 +15316,23 @@
 % \end{macro}
 %
 %
-% \begin{macro}{\m at mold@addamp}
-% \begin{macro}{\m at m@addamp}
-% \begin{macro}{\@addamp}
 %
-%    In the preamble a \verb?&? has to be inserted between any two columns;
-%    before the first column there should not be a \verb?&?. As the user
-%    preamble may start with a \verb?|? we have to remember somehow
-%    if we have already inserted a \verb?#? (i.e.\ a column). This is done
-%    with the boolean variable \cs{if at firstamp} that we test in
-%    \cs{@addamp}, the macro that inserts the \verb?&?.
 %
-% \begin{PW}
-%    PW: Later on, for horizontal lines in `continuous' tabulars,
-% I need to know how many columns there are in a tabular. I need a modified
-% kernel's \cs{@addamp} to do this and use the kernel's \cs{@curtab}
-% (a counter used in tabbing) to store the number of columns.
+% \subsubsection{The separation of columns}
 %
-% \cs{m at mold@addamp} stores the kernel's definition of \cs{@addamp}, and
-% \cs{m at m@addamp} is the revised definition.
-% \end{PW}
-%
+% \begin{macro}{\@addamp}
+%    In the preamble a \verb=&= has to be inserted between any two columns;
+%    before the first column there should not be a \verb=&=. As the user
+%    preamble may start with a \texttt{|} we have to remember somehow
+%    if we have already inserted a \verb=#= (i.e.\ a column). This is done
+%    with the boolean variable \verb=\if at firstamp= that we test in
+%    \verb=\@addamp=, the macro that inserts the \verb=&=.
 %    \begin{macrocode}
 %    \newif \@iffirstamp
-\let\m at mold@addamp\@addamp
-\newcommand*{\m at m@addamp}{%
-  \if at firstamp 
-    \@firstampfalse
-    \global\@curtab\@ne
-  \else
-    \@addtopreamble{&}
-    \global\advance\@curtab\@ne  
-  \fi}
-\let\@addamp\m at m@addamp
-
+%    \def\@addamp{\if at firstamp \@firstampfalse
+%                 \else \@addtopreamble &\fi}
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\@acol}
 % \begin{macro}{\@acolampacol}
@@ -15207,9 +15339,9 @@
 % \begin{macro}{\col at sep}
 %    We will now define some abbreviations for the extensions,
 %    appearing most often in the preamble build-up.
-%    Here \cs{col at sep} is a \textsf{dimen} register which is set
-%    equivalent to \cs{arraycolsep} in an \textsf{array}--environment,
-%    otherwise it is set equivalent to \cs{tabcolsep}.
+%    Here \verb=\col at sep= is a \textsf{dimen} register which is set
+%    equivalent to \verb=\arraycolsep= in an \textsf{array}--environment,
+%    otherwise it is set equivalent to \verb=\tabcolsep=.
 %    \begin{macrocode}
 \newdimen\col at sep
 \def\@acol{\@addtopreamble{\hskip\col at sep}}
@@ -15219,99 +15351,93 @@
 % \end{macro}
 % \end{macro}
 %
+%
+% \subsubsection{The macro \texttt{\textbackslash @mkpream}}
+%
 % \begin{macro}{\@mkpream}
 % \begin{macro}{\the at toks}
+%    \label{@mkpream}
 %    Now we can define the macro which builds up the preamble for the
-%    \cs{halign}.
-%    First we initialize \cs{@preamble}, \cs{@lastchclass}
-%    and the boolean variable \cs{if at firstamp}.
+%    \verb=\halign=.
+%    First we initialize \verb=\@preamble=, \verb=\@lastchclass=
+%    and the boolean variable \verb=\if at firstamp=.
 %    \begin{macrocode}
 \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
 %    \end{macrocode}
 %    During the build-up of the preamble we cannot directly use the
-%    \verb?#? sign; this would lead to an error message in the next
-%    \cs{@addtopreamble} call.
-%    Instead, we use the command \cs{@sharp} at places where later
-%    a \verb?#? will be.
-%    This command is at first given the meaning \cs{relax};
+%    \verb=#= sign; this would lead to an error message in the next
+%    \verb=\@addtopreamble= call.
+%    Instead, we use the command \verb=\@sharp= at places where later
+%    a \verb=#= will be.
+%    This command is at first given the meaning \verb=\relax=;
 %    therefore it will not be expanded when the preamble
 %    is extended.
-%    In the macro \cs{@array}, shortly before the \cs{halign}
-%    is carried out, \cs{@sharp} is given its final meaning.
+%    In the macro \verb=\@array=, shortly before the \verb=\halign=
+%    is carried out, \verb=\@sharp= is given its final meaning.
 %
 %    In a similar way,
-%    we deal with the commands \cs{@startpbox} and
-%    \cs{@endpbox}, although the reason is different here: these
+%    we deal with the commands \verb=\@startpbox= and
+%    \verb=\@endpbox=, although the reason is different here: these
 %    macros expand in many \textsf{tokens} which would delay the
 %    build-up of the preamble.
 %    \begin{macrocode}
    \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
 %    \end{macrocode}
-%    Now we remove possible  \verb?*?-forms and user-defined column
-%    specifiers in the user preamble by repeatedly executing the list
-%    \cs{NC at list} until the re-writes have no more effect. The
-%    expanded preamble will then be in the token register
-%    \cs{@temptokena}. Actually we need to know at this point that
-%    this is not \cs{toks0}.
+%    Now we remove possible  $*$-forms in the user preamble with the
+%    command \verb=\@xexpast=.  As we already know, this command saves
+%    its result in the macro \verb=\@tempa=.
 %    \begin{macrocode}
-   \@temptokena{#1}\@tempswatrue
-   \@whilesw\if at tempswa\fi{\@tempswafalse\the\NC at list}%
+   \@xexpast #1*0x\@@
 %    \end{macrocode}
 %    Afterwards we initialize all registers and macros, that we need
 %    for the build-up of the preamble.
-%    Since we want to start with the \textsf{token} register 0,
-%    \cs{count@} has to contain the value -1.
+%    Since we want to start with the \textsf{token} register $0$,
+%    \verb=\count@= has to contain the value $-1$.
 %    \begin{macrocode}
    \count@\m at ne
    \let\the at toks\relax
 %    \end{macrocode}
-%    Then we call up \cs{prepnext at tok} in order to prepare the
-%    \textsf{token} register 0 for use.
+%    Then we call up \verb=\prepnext at tok= in order to prepare the
+%    \textsf{token} register $0$ for use.
 %    \begin{macrocode}
    \prepnext at tok
 %    \end{macrocode}
-% Having expanded all tokens defined using \cs{newcolumntype} (including
-% \verb?*?), we evaluate the remaining tokens, which are saved in
-% \cs{@temptokena}.  We use the \LaTeX--macro \cs{@tfor} to inspect each
-% token in turn.
-%    The strange appearing construction with \cs{expandafter} is
+%    To evaluate the user preamble (without stars) saved in
+%    \verb=\@tempa= we use the \LaTeX--macro \verb=\@tfor=.
+%    The strange appearing construction with \verb=\expandafter= is
 %    based on the fact that we have to put the replacement text of
-%    \cs{@tempa} and not the macro \cs{@tempa} to this
+%    \verb=\@tempa= and not the macro \verb=\@tempa= to this
 %    \LaTeX--macro.
 %    \begin{macrocode}
    \expandafter \@tfor \expandafter \@nextchar
-    \expandafter :\expandafter =\the\@temptokena \do
+    \expandafter :\expandafter =\@tempa \do
 %    \end{macrocode}
-%    The body of this loop (the group after the \cs{do})
+%    The body of this loop (the group after the \verb=\do=)
 %    is executed for one \textsf{token} at a time, whereas
-%    the current \textsf{token} is saved in \cs{@nextchar}.
+%    the current \textsf{token} is saved in \verb=\@nextchar=.
 %    At first we evaluate the current \textsf{token} with the already
-%    defined macro \cs{@testpach}, i.e.\ we assign to
-%    \cs{@chclass} the character class and to \cs{@chnum}
+%    defined macro \verb=\@testpach=, i.e.\ we assign to
+%    \verb=\@chclass= the character class and to \verb=\@chnum=
 %    the character number of this \textsf{token}.
 %    \begin{macrocode}
    {\@testpach
 %    \end{macrocode}
-%    Then we branch out depending on the value of \cs{@chclass} into
+%    Then we branch out depending on the value of \verb=\@chclass= into
 %    different macros that extend the preamble respectively.
 %    \begin{macrocode}
    \ifcase \@chclass \@classz \or \@classi \or \@classii
      \or \save at decl \or \or \@classv \or \@classvi
-     \or \@classvii \or \@classviii
-%    \end{macrocode}
-%    Class 9 is equivalent to class 10.
-%    \begin{macrocode}
-     \or \@classx
+     \or \@classvii \or \@classviii  \or \@classix
      \or \@classx \fi
 %    \end{macrocode}
 %    Two cases deserve our special attention: Since the current
-%    \textsf{token} cannot have the character class 4 (start) we
-%    have skipped this possibility. If the character class is 3,
-%    only the content of \cs{@nextchar} has to be saved into the current
-%    \textsf{token} register; therefore we call up \cs{save at decl}
+%    \textsf{token} cannot have the character class $4$ (start) we
+%    have skipped this possibility. If the character class is $3$,
+%    only the content of \verb=\@nextchar= has to be saved into the current
+%    \textsf{token} register; therefore we call up \verb=\save at decl=
 %    directly and save a macro name.  After the preamble has been
-%    extended we assign the value of \cs{@chclass} to the counter
-%    \cs{@lastchclass} to assure that this information will be available
+%    extended we assign the value of \verb=\@chclass= to the counter
+%    \verb=\@lastchclass= to assure that this information will be available
 %    during the next run of the loop.
 %    \begin{macrocode}
    \@lastchclass\@chclass}%
@@ -15318,46 +15444,46 @@
 %    \end{macrocode}
 %    After the loop has been finished space must still be added to
 %    the created preamble, depending on the last \textsf{token}.
-%    Depending on the value of \cs{@lastchclass} we perform
+%    Depending on the value of \verb=\@lastchclass= we perform
 %    the necessary operations.
 %    \begin{macrocode}
    \ifcase\@lastchclass
 %    \end{macrocode}
-%    If the last class equals 0 we add a
-%    \verb?\hskip \col at sep?.
+%    If the last class equals $0$ we add a
+%    \verb=\hskip \col at sep=.
 %    \begin{macrocode}
    \@acol \or
 %    \end{macrocode}
-%    If it equals 1 we do not add any additional space so that the
+%    If it equals $1$ we do not add any additional space so that the
 %    horizontal lines do not exceed the vertical ones.
 %    \begin{macrocode}
    \or
 %    \end{macrocode}
-%    Class 2 is treated like class 0 because a \verb?<{...}?  can
-%    only directly follow after class 0.
+%    Class $2$ is treated like class $0$ because a \verb=<{...}=  can
+%    only directly follow after class $0$.
 %    \begin{macrocode}
    \@acol \or
 %    \end{macrocode}
 %    Most of the other possibilities can only appear if the user
-%    preamble was defective. Class 3 is not allowed since after a
-%    \verb?>{..}? there must always follow a \texttt{c}, \texttt{l},
+%    preamble was defective. Class $3$ is not allowed since after a
+%    \verb=>{..}= there must always follow a \texttt{c}, \texttt{l},
 %    \texttt{r}, \texttt{p},\texttt{m} or \texttt{b}. We report an
-%    error and ignore the declaration given by \verb?{..}?.
+%    error and ignore the declaration given by \verb={..}=.
 %    \begin{macrocode}
    \@preamerr \thr@@ \or
 %    \end{macrocode}
-%    If \cs{@lastchclass} is 4 the user preamble has been empty.
-%    To continue, we insert a \verb?#? in the preamble.
+%    If \verb=\@lastchclass= is $4$ the user preamble has been empty.
+%    To continue, we insert a \verb=#= in the preamble.
 %    \begin{macrocode}
    \@preamerr \tw@ \@addtopreamble\@sharp \or
 %    \end{macrocode}
-%    Class 5 is allowed again. In this case
-%    (the user preamble ends with \verb?@{..}?) we need not
+%    Class $5$ is allowed again. In this case
+%    (the user preamble ends with \verb=@{..}=) we need not
 %    do anything.
 %    \begin{macrocode}
    \or
 %    \end{macrocode}
-%    Any other case means that the arguments to \verb?@?, \texttt{!},
+%    Any other case means that the arguments to \verb=@=, \texttt{!},
 %    \texttt{<}, \texttt{>}, \texttt{p}, \texttt{m} or \texttt{b} have
 %    been forgotten. So we report an error and ignore the last
 %    \textsf{token}.
@@ -15366,7 +15492,7 @@
 %    \end{macrocode}
 %    Now that the build-up of the preamble is almost finished we can
 %    insert the \textsf{token} registers and therefore redefine
-%    \cs{the at toks}. The actual insertion, though, is performed
+%    \verb=\the at toks=. The actual insertion, though, is performed
 %    later.
 %    \begin{macrocode}
    \def\the at toks{\the\toks}}
@@ -15374,12 +15500,17 @@
 % \end{macro}
 % \end{macro}
 %
-% The preamble is extended by the macros \cs{@classz} to
-% \cs{@classx} which are called by \cs{@mkpream}
-%  depending on \cs{@lastchclass}
+%
+%
+%  \subsubsection{The macros \texttt{\textbackslash @classz}
+%           to \texttt{\textbackslash @classx}}
+%
+% The preamble is extended by the macros \verb=\@classz= to
+% \verb=\@classx= which are called by \verb=\@mkpream=
+%  depending on \verb=\@lastchclass=
 % (i.e. the character class of the last \textsf{token}).
 % \begin{macro}{\@classx}
-%    First we define \cs{@classx} because of its important r\^ole.
+%    First we define =\@classx= because of its important r\^ole.
 %    When it is called we find that the current
 %    \textsf{token} is \texttt{p}, \texttt{m} or \texttt{b}.
 %    That means that a new column has to start.
@@ -15386,54 +15517,54 @@
 %    \begin{macrocode}
 \def\@classx{%
 %    \end{macrocode}
-%    Depending on the value of \cs{@lastchclass} different actions
+%    Depending on the value of \verb=\@lastchclass= different actions
 %    must take place:
 %    \begin{macrocode}
   \ifcase \@lastchclass
 %    \end{macrocode}
-%    If the last character class was 0 we separate the columns by
-%    \verb?\hskip\col at sep? followed by \verb?&? and another
-%    \verb?\hskip\col at sep?.
+%    If the last character class was $0$ we separate the columns by
+%    \verb=\hskip\col at sep= followed by \verb=&= and another
+%    \verb=\hskip\col at sep=.
 %    \begin{macrocode}
   \@acolampacol \or
 %    \end{macrocode}
-%    If the last class was class 1 --- that means that a vertical
+%    If the last class was class $1$ --- that means that a vertical
 %    line was
-%    drawn, --- before this line a \verb?\hskip\col at sep? was inserted.
-%    Therefore there has to be only a \verb?&? followed by
-%    \verb?\hskip\col at sep?. But this \verb?&? may be inserted only
+%    drawn, --- before this line a \verb=\hskip\col at sep= was inserted.
+%    Therefore there has to be only a \verb=&= followed by
+%    \verb=\hskip\col at sep=. But this \verb=&= may be inserted only
 %    if this is not the first column. This process is controlled
-%    by \cs{if at firstamp} in the macro \cs{addamp}.
+%    by \verb=\if at firstamp= in the macro \verb=\addamp=.
 %    \begin{macrocode}
   \@addamp \@acol \or
 %    \end{macrocode}
-%    Class 2 is treated like class 0 because \verb?<{...}? can only
-%    follow after class 0.
+%    Class $2$ is treated like class $0$ because \verb=<{...}= can only
+%    follow after class $0$.
 %    \begin{macrocode}
   \@acolampacol \or
 %    \end{macrocode}
-%    Class 3 requires no actions because all things necessary have
+%    Class $3$ requires no actions because all things necessary have
 %    been done by the preamble \textsf{token} \texttt{>}.
 %    \begin{macrocode}
   \or
 %    \end{macrocode}
-%    Class 4 means that we are at the beginning of the preamble.
-%    Therefore we start the preamble with \verb?\hskip\col at sep? and
-%    then call \cs{@firstampfalse}. This makes sure that a later
-%    \cs{@addamp} inserts the character
-%    \verb?&? into the preamble.
+%    Class $4$ means that we are at the beginning of the preamble.
+%    Therefore we start the preamble with \verb=\hskip\col at sep= and
+%    then call \verb=\@firstampfalse=. This makes sure that a later
+%    \verb=\@addamp= inserts the character
+%    \verb=&= into the preamble.
 %    \begin{macrocode}
   \@acol \@firstampfalse \or
 %    \end{macrocode}
-%    For class 5 \textsf{tokens} only the character \verb?&? is inserted
-%    as a column separator. Therefore we call \cs{@addamp}.
+%    For class $5$ \textsf{tokens} only the character \verb=&= is inserted
+%    as a column separator. Therefore we call \verb=\@addamp=.
 %    \begin{macrocode}
   \@addamp
 %    \end{macrocode}
 %    Other cases are impossible. For an example
-%    \verb?\@lastchclass = 6? ---a s it might appear in a
-%    preamble of the form \verb?...!p...? --- \texttt{p} would have
-%    been taken as an  argument of \texttt{!} by \cs{@testpach}.
+%    $\verb=\@lastchclass= = 6$---as it might appear in a
+%    preamble of the form \verb=...!p...=---\texttt{p} would have
+%    been taken as an  argument of \texttt{!}\ by \verb=\@testpach=.
 %    \begin{macrocode}
   \fi}
 %    \end{macrocode}
@@ -15441,44 +15572,44 @@
 %
 %
 % \begin{macro}{\@classz}
-%    If the character class of the last \textsf{token} is 0 we have
+%    If the character class of the last \textsf{token} is $0$ we have
 %    \texttt{c}, \texttt{l}, \texttt{r} or an argument of \texttt{m},
 %    \texttt{b} or\ \texttt{p}. In the first three cases the preamble
-%    must be extended the same way as if we had class 10. The
+%    must be extended the same way as if we had class $10$. The
 %    remaining two cases do not require any action because the space
 %    needed was generated by the last \textsf{token} (i.e.\
-%    \texttt{m}, \texttt{b} or \texttt{p}). Since \cs{@lastchclass} has
-%    the value 10 at this point nothing happens when \cs{@classx} is
-%    called. So the macro \cs{@chlassz} may start like this:
+%    \texttt{m}, \texttt{b} or \texttt{p}). Since \verb=\@lastchclass= has
+%    the value $10$ at this point nothing happens when \verb=\@classx= is
+%    called. So the macro \verb=\@chlassz= may start like this:
 %    \begin{macrocode}
 \def\@classz{\@classx
 %    \end{macrocode}
-%    According to the definition of \cs{insert at column} we must store
+%    According to the definition of \verb=\insert at column= we must store
 %    the number of the \textsf{token} register in which a preceding
-%    \verb?>{..}? might have stored its argument into
-%    \cs{@tempcnta}.
+%    \verb=>{..}= might have stored its argument into
+%    \verb=\@tempcnta=.
 %    \begin{macrocode}
    \@tempcnta \count@
 %    \end{macrocode}
-%    To have \verb?\count@ = \@tmpcnta + 1? we prepare
+%    To have $\verb=\count@= = \verb=\@tmpcnta= + 1$ we prepare
 %    the next \textsf{token} register.
 %    \begin{macrocode}
    \prepnext at tok
 %    \end{macrocode}
 %    Now the preamble must be extended with the column whose format
-%    can be determinated by \cs{@chnum}.
+%    can be determined by \verb=\@chnum=.
 %    \begin{macrocode}
    \@addtopreamble{\ifcase \@chnum
 %    \end{macrocode}
-%    If \cs{@chnum} has the value 0 a centered column has to be
+%    If \verb=\@chnum= has the value $0$ a centered column has to be
 %    generated.
 %    So we begin with stretchable space.
 %    \begin{macrocode}
       \hfil
 %    \end{macrocode}
-%    The command \cs{d at llarbegin} follows expanding into \cs{begingroup}
-%    (in the \textsf{tabular}--environment) or into \verb?$?.  Doing this
-%    (provided an appropriate setting of \cs{d at llarbegin}) we achieve
+%    The command \verb=\d at llarbegin= follows expanding into \verb=\begingroup=
+%    (in the \textsf{tabular}--environment) or into \verb=$=.  Doing this
+%    (provided an appropriate setting of \verb=\d at llarbegin=) we achieve
 %    that the contents of the columns of an \textsf{array}--environment
 %    are set in math mode while those of a \textsf{tabular}--environment
 %    are set in LR mode.
@@ -15487,24 +15618,24 @@
 %    \end{macrocode}
 %    Now we insert the contents of the two \textsf{token} registers
 %    and the symbol
-%    for the column entry (i.e.\ \verb?#? or
-%    more precise \cs{@sharp}) using \cs{insert at column}.
+%    for the column entry (i.e.\ \verb=#= or
+%    more precise \verb=\@sharp=) using \verb=\insert at column=.
 %    \begin{macrocode}
       \insert at column
 %    \end{macrocode}
-%    We end this case with \cs{d at llarend} and \cs{hfil} where \cs{d at llarend}
-%    again is either \verb?$? or \cs{endgroup}.
+%    We end this case with \verb=\d at llarend= and \verb=\hfil= where \verb=\d at llarend=
+%    again is either \verb=$= or \verb=\endgroup=.
 %    \begin{macrocode}
       \d at llarend \hfil \or
 %    \end{macrocode}
-%    The templates for \texttt{l} and \texttt{r} (i.e.\ \cs{@chnum} 1
-%    or 2) are generated the same way. Since one  \cs{hfil} is
+%    The templates for \texttt{l} and \texttt{r} (i.e.\ \verb=\@chnum= $1$
+%    or $2$) are generated the same way. Since one  \verb=\hfil= is
 %    missing the text is moved to the relevant side.
-%    The \verb?\kern\z@? is needed in case of an empty column
+%    The \verb=\kern\z@= is needed in case of an empty column
 %    entry. Otherwise
-%    the \cs{unskip} in \cs{insert at column} removes the
-%    \cs{hfil}. Changed to \verb?\hskip1sp? so that it interacts better with
-%    \cs{@bsphack}.
+%    the \verb=\unskip= in \verb=\insert at column= removes the
+%    \verb=\hfil=. Changed to \verb=\hskip1sp= so that it interacts better with
+%    \verb=\@bsphack=.
 %    \begin{macrocode}
       \hskip1sp\d at llarbegin \insert at column \d at llarend \hfil \or
       \hfil\hskip1sp\d at llarbegin \insert at column \d at llarend \or
@@ -15511,70 +15642,79 @@
 %    \end{macrocode}
 %    The templates for \texttt{p}, \texttt{m} and \texttt{b} mainly
 %    consist of a \textsf{box}. In case of \texttt{m} it is generated
-%    by \cs{vcenter}.  This command is allowed only in math
-%    mode. Therefore we start with a~\verb?$?.
+%    by \verb=\vcenter=.  This command is allowed only in math
+%    mode. Therefore we start with a~\verb=$=.
 %    \begin{macrocode}
-   $\vcenter%$
+   $\vcenter%$ emacs
 %    \end{macrocode}
 %    The part of the templates which is the same in all three cases
 %    (\texttt{p}, \texttt{m} and \texttt{b})
-%    is built by the macros \cs{@startpbox} and
-%    \cs{@endpbox}. \cs{@startpbox} has an argument:
+%    is built by the macros \verb=\@startpbox= and
+%    \verb=\@endpbox=. \verb=\@startpbox= has an argument:
 %    the width of the column which is stored in the current
-%    \textsf{token} (i.e.\ \cs{@nextchar}).
+%    \textsf{token} (i.e.\ \verb=\@nextchar=).
 %    Between these two macros we find the well known
-%    \cs{insert at column}.
+%    \verb=\insert at column=.
 %    \begin{macrocode}
-   \@startpbox{\@nextchar}\insert at column \@endpbox $\or%$
+   \@startpbox{\@nextchar}\insert at column \@endpbox $\or%$ emacs
 %    \end{macrocode}
 %    The templates for \texttt{p} and \texttt{b} are generated in the
-%    same way though we do not need the \verb?$? characters because we use
-%    \cs{vtop} or \cs{vbox}.
+%    same way though we do not need the \verb=$= characters because we use
+%    \verb=\vtop= or \verb=\vbox=.
 %    \begin{macrocode}
    \vtop \@startpbox{\@nextchar}\insert at column \@endpbox \or
    \vbox \@startpbox{\@nextchar}\insert at column \@endpbox
 %    \end{macrocode}
-%    Other values for \cs{@chnum} are impossible. Therefore we
-%    end the arguments to \cs{@addtopreamble} and \cs{ifcase}.
-%    Before we come to the end of \cs{@classz} we have to
+%    Other values for \verb=\@chnum= are impossible. Therefore we
+%    end the arguments to \verb=\@addtopreamble= and \verb=\ifcase=.
+%    Before we come to the end of \verb=\@classz= we have to
 %    prepare the next \textsf{token} register.
 %    \begin{macrocode}
   \fi}\prepnext at tok}
-
 %    \end{macrocode}
 % \end{macro}
 %
+%
 % \begin{macro}{\@classix}
-%    Class 9 (\texttt{>}--\textsf{token}) prevented repeated
-% \verb?>? declarations for the same column. This restriction has been eased,
-% making class 9 equivalent to class 10. 
-% \changes{v1.618}{2005/09/03}{Let \cs{@classix} to \cs{relax} (mempatch v3.10)}
+%    In case of class $9$ (\texttt{>}--\textsf{token}) we first check
+%    if the character class of the last
+%    \textsf{token} was $3$. In this case we have a
+%    user preamble of the form \verb=..>{...}>{...}..= which
+%    is not allowed. We only give an error message and continue.
+%    So the declarations defined by the first  \verb=>{...}=
+%    are ignored.
 %    \begin{macrocode}
-\let\@classix\relax
-
+\def\@classix{\ifnum \@lastchclass = \thr@@
+       \@preamerr \thr@@ \fi
 %    \end{macrocode}
+%    Furthermore, we call up \verb=\@class10= because afterwards always a
+%    new column is started by \texttt{c}, \texttt{l}, \texttt{r},
+%    \texttt{p}, \texttt{m} or \texttt{b}.
+%    \begin{macrocode}
+       \@classx}
+%    \end{macrocode}
 % \end{macro}
 %
+%
+%
 % \begin{macro}{\@classviii}
 %    If the current \textsf{token} is a \texttt{<} the last character
-%    class must be 0, or 2 (as repeated \verb?<? expressions are allowed). 
-%    In this case it is not necessary to extend the
-%    preamble. Otherwise we output an error message, set \cs{@chclass}
-%    to 6 and call \cs{@classvi}.  By doing this we achieve that
+%    class must be $0$. In this case it is not necessary to extend the
+%    preamble. Otherwise we output an error message, set \verb=\@chclass=
+%    to $6$ and call \verb=\@classvi=.  By doing this we achieve that
 %    \texttt{<} is treated like \texttt{!}.
 %    \begin{macrocode}
-\def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
-      \@preamerr 4\@chclass 6 \@classvi \fi\fi}
-
+\def\@classviii{\ifnum \@lastchclass >\z@
+      \@preamerr 4\@chclass 6 \@classvi \fi}
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@arrayrule}
 %    There is only one incompatibility with the original definition:
-%    the definition of \cs{@arrayrule}. In the original a line without
-%    width (e.g., the space between \verb?cc? and \verb?c|c?
-%    is equal)  is created by multiple insertions of 
-% \verb?\hskip .5\arrayrulewidth?.  
+%    the definition of \verb=\@arrayrule=. In the original a line without
+%    width\footnote{So the space between \texttt{cc} and \texttt{c|c}
+%    is equal.}  is created by multiple insertions of
+% \verb=\hskip .5\arrayrulewidth=.
 %    We only insert a vertical line into the
 %    preamble.  This is done to prevent problems with \TeX's main
 %    memory when generating tables with many vertical lines in them
@@ -15581,16 +15721,15 @@
 %    (especially in the case of \textsf{floats}).
 %    \begin{macrocode}
 \def\@arrayrule{\@addtopreamble \vline}
-
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@classvii}
-%    As a consequence it follows that in case of class 7
-%    (\verb?@? \textsf{token})  the preamble need not to be extended.
-%    In the original definition \verb?\@lastchclass = 1?
-%    is treated by inserting \verb?\hskip .5\arrayrulewidth?.
-%    We only check if the last \textsf{token} was of class 3 which is
+%    As a consequence it follows that in case of class $7$
+%    (\verb=@= \textsf{token})  the preamble need not to be extended.
+%    In the original definition $\verb=\@lastchclass= = 1$
+%    is treated by inserting \verb=\hskip .5\arrayrulewidth=.
+%    We only check if the last \textsf{token} was of class $3$ which is
 %    forbidden.
 %    \begin{macrocode}
 \def\@classvii{\ifnum \@lastchclass = \thr@@
@@ -15597,11 +15736,10 @@
 %    \end{macrocode}
 %    If this is true we output an error message and
 %    ignore the declarations stored
-%    by the last  \verb?>{...}?, because these are overwritten
+%    by the last  \verb=>{...}=, because these are overwritten
 %    by the argument of \texttt{@}.
 %    \begin{macrocode}
    \@preamerr \thr@@ \fi}
-
 %    \end{macrocode}
 % \end{macro}
 %
@@ -15608,11 +15746,11 @@
 %
 % \begin{macro}{\@classvi}
 %    If the current \textsf{token} is a regular \texttt{!}\ and the
-%    last class was 0 or 2 we extend the preamble with
-%    \verb?\hskip\col at sep?.  If the last \textsf{token} was of class 1
-%    (for instance \verb?|?) we extend with \verb?\hskip \doublerulesep?
-%    because the construction \verb?!{...}? has to be treated like
-%    \verb?|?.
+%    last class was $0$ or $2$ we extend the preamble with
+%    \verb=\hskip\col at sep=.  If the last \textsf{token} was of class $1$
+%    (for instance \texttt{|}) we extend with \verb=\hskip \doublerulesep=
+%    because the construction \verb=!{...}= has to be treated like
+%    \texttt{|}.
 %    \begin{macrocode}
 \def\@classvi{\ifcase \@lastchclass
       \@acol \or
@@ -15619,97 +15757,90 @@
       \@addtopreamble{\hskip \doublerulesep}\or
       \@acol \or
 %    \end{macrocode}
-%    Now \verb?\@preamerr...? should follow because a
-%    user preamble of the form \verb?..>{..}!.? is not allowed.
-%    To save memory we call \cs{@classvii} instead which also
+%    Now \verb=\@preamerr...= should follow because a
+%    user preamble of the form \verb=..>{..}!.= is not allowed.
+%    To save memory we call \verb=\@classvii= instead which also
 %    does what we want.
 %    \begin{macrocode}
       \@classvii
 %    \end{macrocode}
-%    If \cs{@lastchclass} is 4 or 5 nothing has to be done.
-%    Class 6 to 10 are not possible.
+%    If \verb=\@lastchclass= is $4$ or $5$ nothing has to be done.
+%    Class $6$ to $10$ are not possible.
 %    So we finish the macro.
 %    \begin{macrocode}
       \fi}
-
 %    \end{macrocode}
 % \end{macro}
 %
 % \begin{macro}{\@classii}
 % \begin{macro}{\@classiii}
-%    In the case of character classes 2 and 3 (i.e.\ the argument
+%    In the case of character classes $2$ and $3$ (i.e.\ the argument
 %    of \texttt{<} or \texttt{>}) we only have to store the current
-%    \textsf{token} (\cs{@nextchar}) into the corresponding
+%    \textsf{token} (\verb=\@nextchar=) into the corresponding
 %    \textsf{token} register since the preparation and
 %    insertion of these registers
-%    are done by the macro \cs{@classz}.
-%    This is equivalent to calling \cs{save at decl} in the case of
-%    class 3. To save command identifiers we do this call up
-%     in the macro \cs{@mkpream}.
+%    are done by the macro \verb=\@classz=.
+%    This is equivalent to calling \verb=\save at decl= in the case of
+%    class $3$. To save command identifiers we do this call up
+%     in the macro \verb=\@mkpream=.
 %
-%    Class 2 exhibits a more complicated situation: the
+%    Class $2$ exhibits a more complicated situation: the
 %    \textsf{token} registers have already been inserted by
-%    \cs{@classz}. So the value of \cs{count@} is too high
-%    by one. Therefore we decrease \cs{count@} by 1.
+%    \verb=\@classz=. So the value of \verb=\count@= is too high
+%    by one. Therefore we decrease \verb=\count@= by $1$.
 %    \begin{macrocode}
 \def\@classii{\advance \count@ \m at ne
 %    \end{macrocode}
-%    Next we store the current \textsf{token} into the correct 
-%    \textsf{token} register by calling \cs{save at decl} and then
-%    increase the value of \cs{count@} again. At this point we
+%    Next we store the current \textsf{token} into the correct
+%    \textsf{token} register by calling \verb=\save at decl= and then
+%    increase the value of \verb=\count@= again. At this point we
 %    can save memory once more (at the cost of time) if we use the
-%     macro \cs{prepnext at tok}.
+%     macro \verb=\prepnext at tok=.
 %    \begin{macrocode}
    \save at decl\prepnext at tok}
-
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
+%
 % \begin{macro}{\@classv}
-% Class 5 is \texttt{@}-expressions (and is also called by class 1)
-% We do not expand the
-% \verb?@?-expression, but instead explicitly replace an
-% \cs{extracolsep} command by an assignment to \cs{tabskip} by a
-% method similar to the \cs{newcolumntype} system described later.
+%    If the current \textsf{token} is of class $5$ then it is an
+%    argument of a \texttt{@} \textsf{token}. It must be stored into a
+%    \textsf{token} register.
 %    \begin{macrocode}
 \def\@classv{\save at decl
-   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@
+%    \end{macrocode}
+%    We extend the preamble with a command which inserts this
+%    \textsf{token} register into the preamble when its construction
+%    is finished. The user expects that this argument is worked out in
+%    math mode if it was used in an
+%    \textsf{array}--environment. Therefore we surround it with
+%    \verb=\d at llar...='s.
+%    \begin{macrocode}
    \@addtopreamble{\d at llarbegin\the at toks\the\count@\relax\d at llarend}%
-   \prepnext at tok}
 %    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\NC at ecs}
-% Rewrite the first occurrence of \verb?\extracolsep{1in}? to
-% \verb?\tabskip1in\relax?. As a side effect discard any tokens after a
-% second \cs{extracolsep}, there is no point in the user entering two of
-% these commands anyway, so this is not really a restriction.
+%    Finally we must prepare the next \textsf{token} register.
 %    \begin{macrocode}
-\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
-  \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
-
+   \prepnext at tok}
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\@classi}
-%    In the case of class 0 we were able to generate the necessary
-%    space between columns by using the macro \cs{@classx}.
-%    Analogously the macro \cs{@classvi} can be used for class 1.
+%    In the case of class $0$ we were able to generate the necessary
+%    space between columns by using the macro \verb=\@classx=.
+%    Analogously the macro \verb=\@classvi= can be used for class $1$.
 %    \begin{macrocode}
 \def\@classi{\@classvi
 %    \end{macrocode}
-%    Depending on \cs{@chnum} a vertical line
+%    Depending on \verb=\@chnum= a vertical line
 %    \begin{macrocode}
    \ifcase \@chnum \@arrayrule \or
 %    \end{macrocode}
-%    or (in case of \verb?!{...}?) the current \textsf{token} --- stored
-%    in \cs{@nextchar} --- has to be inserted into the preamble.
-%    This corresponds to calling \cs{@classv}.
+%    or (in case of \verb=!{...}=) the current \textsf{token} --- stored
+%    in \verb=\@nextchar= --- has to be inserted into the preamble.
+%    This corresponds to calling \verb=\@classv=.
 %    \begin{macrocode}
       \@classv \fi}
-
 %    \end{macrocode}
 % \end{macro}
 %
@@ -15716,16 +15847,16 @@
 %
 %
 % \begin{macro}{\@startpbox}
-%    In \cs{@classz}  the macro \cs{@startpbox} is used.
+%    In \verb=\@classz=  the macro \verb=\@startpbox= is used.
 %    The width of the \textsf{parbox} is passed as an argument.
-%    \cs{vcenter}, \cs{vtop} or \cs{vbox} are already in the
+%    \verb=\vcenter=, \verb=\vtop= or \verb=\vbox= are already in the
 %    preamble. So we start with the braces for the wanted box.
 %    \begin{macrocode}
 \def\@startpbox#1{\bgroup
 %    \end{macrocode}
 %    The argument is the width of the box. This information has to be
-%    assigned to \cs{hsize}.
-%    Then we assain default values to several parameters used in a
+%    assigned to \verb=\hsize=.
+%    Then we assign default values to several parameters used in a
 %    \textsf{parbox}.
 %    \begin{macrocode}
   \setlength\hsize{#1}\@arrayparboxrestore
@@ -15733,21 +15864,21 @@
 %    Our main problem is to obtain the same distance between succeeding
 %    lines of the \textsf{parbox}.
 %    We have to remember that the distance between two \textsf{parboxes}
-%    should be defined by \cs{@arstrut}. That means that it can be
+%    should be defined by \verb=\@arstrut=. That means that it can be
 %    greater than the distance in a \textsf{parbox}.
-%    Therefore it is not enough to set a \cs{@arstrut} at the
+%    Therefore it is not enough to set a \verb=\@arstrut= at the
 %    beginning and at the end of the \textsf{parbox}. This would
 %    dimension the distance
 %    between first and second line and the distance between the two
 %    last lines of the \textsf{parbox} wrongly.
 %    To prevent this we set an invisible rule of height
-%    \cs{@arstrutbox}
+%    \verb=\@arstrutbox=
 %    at the beginning of the \textsf{parbox}. This has no effect on the
 %    depth of the first line. At the end of the \textsf{parbox} we set
 %    analogously another invisible rule which only affects the depth
 %    of the last line. It is necessary to wait inserting this strut
 %    until the paragraph actually starts to allow for things like
-%    \cs{parindent} changes via \verb?>{...}?.
+%    \verb=\parindent= changes via \verb=>{...}=.
 %    \begin{macrocode}
    \everypar{%
       \vrule \@height \ht\@arstrutbox \@width \z@
@@ -15757,13 +15888,13 @@
 % \end{macro}
 %
 % \begin{macro}{\@endpbox}
-%    If there are any declarations defined by \verb?>{...}?
-%    and \verb?<{...}?
-%    they now follow in the macro \cs{@classz} --- the contents
+%    If there are any declarations defined by \verb=>{...}=
+%    and \verb=<{...}=
+%    they now follow in the macro \verb=\@classz= --- the contents
 %    of the column in between.
-%    So the macro \cs{@endpbox} must insert the \textsf{specialstrut}
+%    So the macro \verb=\@endpbox= must insert the \textsf{specialstrut}
 %    mentioned earlier and then close the group opened by
-%    \cs{@startpbox}.
+%    \verb=\@startpbox=.
 %    \begin{macrocode}
 \def\@endpbox{\@finalstrut\@arstrutbox \egroup\hfil}
 %    \end{macrocode}
@@ -15774,24 +15905,24 @@
 %
 % \begin{macro}{\@array}
 %    After we have discussed the macros needed for the evaluation
-%    of the user preamble we can define the macro \cs{@array}
-%    which uses these macros to create a \cs{halign}.
+%    of the user preamble we can define the macro \verb=\@array=
+%    which uses these macros to create a \verb=\halign=.
 %    It has two arguments. The first one is a position argument
 %    which can be \texttt{t}, \texttt{b} or \texttt{c}; the
 %    second one describes the wanted preamble,
-%    e.g.\ it has the form \verb?|c|c|c|?.
+%    e.g.\ it has the form \verb=|c|c|c|=.
 %    \begin{macrocode}
 \def\@array[#1]#2{%
 %    \end{macrocode}
 %    First we define a \textsf{strut} whose size basically corresponds
 %     to a normal \textsf{strut} multiplied by the factor
-%    \cs{arraystretch}.
+%    \verb=\arraystretch=.
 %    This \textsf{strut} is then  inserted into every row and enforces
 %     a minimal distance between two rows.
 %    Nevertheless, when using horizontal lines, large letters
 %    (like accented capital letters) still collide with such lines.
 %    Therefore at first we add to the height of a normal \textsf{strut}
-%    the value of the parameter \cs{extrarowheight}.
+%    the value of the parameter \verb=\extrarowheight=.
 %    \begin{macrocode}
   \@tempdima \ht \strutbox
   \advance \@tempdima by\extrarowheight
@@ -15801,33 +15932,33 @@
              \@width \z@}%
 %    \end{macrocode}
 %    Then we open a group, in which the user preamble is evaluated by
-%    the macro \cs{@mkpream}. As we know this must happen locally.
-%    This macro creates a preamble for a \cs{halign} and saves
-%    its result globally in the control sequence \cs{@preamble}.
+%    the macro \verb=\@mkpream=. As we know this must happen locally.
+%    This macro creates a preamble for a \verb=\halign= and saves
+%    its result globally in the control sequence \verb=\@preamble=.
 %    \begin{macrocode}
   \begingroup
   \@mkpream{#2}%
 %    \end{macrocode}
-%    We again redefine \cs{@preamble} so that a call up of \cs{@preamble}
-%    now starts the \cs{halign}. Thus also the arguments of \texttt{>},
+%    We again redefine \verb=\@preamble= so that a call up of \verb=\@preamble=
+%    now starts the \verb=\halign=. Thus also the arguments of \texttt{>},
 %    \texttt{<}, \texttt{@} and \texttt{!}, saved in the
 %    \textsf{token} registers are inserted into the preamble.  The
-%    \cs{tabskip} at the beginning and end of the preamble is set to
-%    \textsf{0pt} (in the beginning by the use of \cs{ialign}). Also the
-%    command \cs{@arstrut} is build in, which inserts the
-%    \cs{@arstrutbox}, defined above. Of course, the opening brace after
-%    \cs{ialign} has to be implicit as it will be closed in \cs{endarray}
+%    \verb=\tabskip= at the beginning and end of the preamble is set to
+%    \textsf{0pt} (in the beginning by the use of \verb=\ialign=). Also the
+%    command \verb=\@arstrut= is build in, which inserts the
+%    \verb=\@arstrutbox=, defined above. Of course, the opening brace after
+%    \verb=\ialign= has to be implicit as it will be closed in \verb=\endarray=
 %    or another macro.
 %
-%    The \cs{noexpand} in front of \cs{ialign} does no harm in standard \LaTeX{}
+%    The \verb=\noexpand= in front of \verb=\ialign= does no harm in standard \LaTeX{}
 %    and was added since some experimental support for using text glyphs in math
-%    redefines \cs{halign} with the result that is becomes expandable with
-%    disastrous results in cases like this. 
+%    redefines \verb=\halign= with the result that is becomes expandable with
+%    disastrous results in cases like this.
 %    In the kernel definition for this macro the problem does
-%    not surface because there \cs{protect} is set (which is not necessary in this 
+%    not surface because there \verb=\protect= is set (which is not necessary in this
 %    implementation as there is no arbitrary user input that can get expanded) and
 %    the experimental code made the redefinition robust. Whether this is the right
-%    approach is open to question; consider the \cs{noexpand} a curtesy to allow an
+%    approach is open to question; consider the \verb=\noexpand= a courtesy to allow an
 %    unsupported redefinition of a \TeX{} primitive for the moment (as people rely
 %    on that experimental code).
 %    \begin{macrocode}
@@ -15835,22 +15966,22 @@
                   \bgroup \@arstrut \@preamble
                           \tabskip \z@ \cr}%
 %    \end{macrocode}
-%    What we have not explained yet is the macro \cs{@halignto}
+%    What we have not explained yet is the macro \verb=\@halignto=
 %    that was just used. Depending on its replacement text the
-%    \cs{halign} becomes a \cs{halign} \texttt{to} \meta{dimen}.
+%    \verb=\halign= becomes a \verb=\halign= \texttt{to} \meta{dimen}.
 %    Now we close the group again. Thus
-%    \cs{@startpbox} and \cs{@endpbox} as well as all
+%    \verb=\@startpbox= and \verb=\@endpbox= as well as all
 %    \textsf{token} registers get their former meaning back.
 %    \begin{macrocode}
   \endgroup
 %    \end{macrocode}
-%     To support other packages  we include a hook
+%     To support the \texttt{delarray.sty} package  we include a hook
 %     into this part of the code which is a no-op in the main package.
 %    \begin{macrocode}
   \@arrayleft
 %    \end{macrocode}
 %    Now we decide depending on the position argument in which
-%    \textsf{box} the \cs{halign} is to be put. (\cs{vcenter} may be used
+%    \textsf{box} the \verb=\halign= is to be put. (\verb=\vcenter= may be used
 %    because we are in math mode.)
 %    \begin{macrocode}
   \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi \fi
@@ -15857,9 +15988,10 @@
 %    \end{macrocode}
 %    Now another implicit opening brace appears; then definitions
 %    which shall stay local follow. While constructing the
-%    \cs{@preamble} in \cs{@mkpream} the \verb?#? sign must be
-%    hidden in the macro \cs{@sharp} which is \cs{let} to
-%    \cs{relax} at that moment (see definition of \cs{@mkpream}).
+%    \verb=\@preamble= in \verb=\@mkpream= the \verb=#= sign must be
+%    hidden in the macro \verb=\@sharp= which is \verb=\let= to
+%    \verb=\relax= at that moment (see definition of \verb=\@mkpream=
+%    on page~\pageref{@mkpream}).
 %    All these now get their actual meaning.
 %    \begin{macrocode}
   \bgroup
@@ -15866,13 +15998,13 @@
   \let \@sharp ##\let \protect \relax
 %    \end{macrocode}
 %    With the above defined \textsf{struts} we fix down the distance
-%    between rows by setting \cs{lineskip} and \cs{baselineskip}
-%    to \textsf{0pt}. Since there have to be set \verb?$?'s
+%    between rows by setting \verb=\lineskip= and \verb=\baselineskip=
+%    to \textsf{0pt}. Since there have to be set \verb=$='s
 %    around every column in the \textsf{array}--environment
-%     the parameter \cs{mathsurround} should
+%     the parameter \verb=\mathsurround= should
 %    also be set to \textsf{0pt}. This prevents additional space between
 %    the rows. The
-%    \PlainTeX--macro \cs{m at th} does this.
+%    \PlainTeX--macro \verb=\m at th= does this.
 %    \begin{macrocode}
   \lineskip \z@
   \baselineskip \z@
@@ -15879,17 +16011,24 @@
   \m at th
 %    \end{macrocode}
 %    Beside, we have to assign a special meaning (which we still have
-%    to specify) to the line separator \verb?\\?. We also have to
-%    redefine the command \cs{par} in such a way that empty lines in
-%    \cs{halign} cannot do any damage. We succeed in doing  so
+%    to specify) to the line separator \verb=\\=. We also have to
+%    redefine the command \verb=\par= in such a way that empty lines in
+%    \verb=\halign= cannot do any damage. We succeed in doing  so
 %    by choosing something that will disappear when expanding.
-%    After that we only have to call up \cs{@preamble} to
-%    start the wanted \cs{halign}.
+%    After that we only have to call up \verb=\@preamble= to
+%    start the wanted \verb=\halign=.
 %    \begin{macrocode}
   \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble}
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\arraybackslash}
+% Restore \verb=\\= for use in array and tabular environment (after
+% \verb=\raggedright= etc.).
+%    \begin{macrocode}
+\def\arraybackslash{\let\\\tabularnewline}
+%    \end{macrocode}
+% \end{macro}
 %
 % \begin{macro}{\extrarowheight}
 %    The \textsf{dimen} parameter used above also needs to be
@@ -15902,9 +16041,9 @@
 % \end{macro}
 %
 % \begin{macro}{\@arstrut}
-%    Now the insertion of \cs{@arstrutbox} through \cs{@arstut}
+%    Now the insertion of \verb=\@arstrutbox= through \verb=\@arstut=
 %    is easy since we know exactly in which mode \TeX\ is while working
-%    on the \cs{halign} preamble.
+%    on the \verb=\halign= preamble.
 %    \begin{macrocode}
 \def\@arstrut{\unhcopy\@arstrutbox}
 %    \end{macrocode}
@@ -15914,22 +16053,22 @@
 % \subsubsection{The line separator \texttt{\textbackslash\textbackslash}}
 %
 % \begin{macro}{\@arraycr}
-%    In the macro \cs{@array} the line separator \verb?\\? is
-%    \cs{let} to the command \cs{@arraycr}.
+%    In the macro \verb=\@array= the line separator \verb=\\= is
+%    \verb=\let= to the command \verb=\@arraycr=.
 %    Its definition starts with a special brace which I have directly
 %    copied from the original definition. It is
-%    necessary, because the \cs{futurlet} in \cs{@ifnextchar}
+%    necessary, because the \verb=\futurlet= in \verb=\@ifnextchar=
 %    might
-%    expand a  following \verb?&? \textsf{token} in a construction like
-%    \verb?\\ &?. This would otherwise end the alignment template at a
+%    expand a  following \verb=&= \textsf{token} in a construction like
+%    \verb=\\ &=. This would otherwise end the alignment template at a
 %    wrong time. On the other hand we have to be careful to avoid
-%    producing a real group, i.e., \verb?{}?, because the command will also
-%    be used for the array environment, i.e., in math mode. In that
-%    case an extra \verb?{}? would produce an ord atom which could mess up
+%    producing a real group, i.e.\ \verb={}=, because the command will also
+%    be used for the array environment, i.e.\ in math mode. In that
+%    case an extra \verb={}= would produce an ord atom which could mess up
 %    the spacing. For this reason we use a combination that does not
 %    really produce a group at all but modifies the master counter so
-%    that a \verb?&? will not be considered belonging to the current
-%    \cs{halign} while we are looking for a \verb?*? or \verb?[?.
+%    that a \verb=&= will not be considered belonging to the current
+%    \verb=\halign= while we are looking for a \verb=*= or \verb=[=.
 %    For further information see
 %    \cite[Appendix D]{bk:knuth}.
 %    \begin{macrocode}
@@ -15944,14 +16083,14 @@
 % \end{macro}
 %
 % \begin{macro}{\@xarraycr}
-%    In the command \cs{@xarraycr} we test if an optional argument
+%    In the command \verb=\@xarraycr= we test if an optional argument
 %    exists.
 %    \begin{macrocode}
 \def\@xarraycr{\@ifnextchar [%
 %    \end{macrocode}
-%    If it does, we branch out into the macro \cs{@argarraycr} if
+%    If it does, we branch out into the macro \verb=\@argarraycr= if
 %    not we close the special brace (mentioned above) and end the row
-%    of the \cs{halign} with a \cs{cr}.
+%    of the \verb=\halign= with a \verb=\cr=.
 %    \begin{macrocode}
   \@argarraycr {\ifnum 0=`{}\fi\cr}}
 %    \end{macrocode}
@@ -15960,30 +16099,30 @@
 %
 % \begin{macro}{\@argarraycr}
 %    If additional space is requested by the user this case is treated
-%    in the macro \cs{@argarraycr}. First we close the special brace
+%    in the macro \verb=\@argarraycr=. First we close the special brace
 %    and then we test if the additional space is positive.
 %    \begin{macrocode}
 \def\@argarraycr[#1]{\ifnum0=`{}\fi\ifdim #1>\z@
 %    \end{macrocode}
 %    If this is the case we create an invisible vertical rule with
-%    depth \verb?\dp\@arstutbox?${}+{}$\meta{wanted\ space}.
+%    depth \verb=\dp\@arstutbox=${}+{}$\meta{wanted\ space}.
 %    Thus we achieve that all vertical lines specified
-%    in the user preamble by a \verb?|? are now
+%    in the user preamble by a \texttt{|} are now
 %    generally drawn.
-%    Then the row ends with a \cs{cr}.
+%    Then the row ends with a \verb=\cr=.
 %
-%    If the space is negative we end the row at once with a \cs{cr}
-%    and move back up with a \cs{vskip}.
+%    If the space is negative we end the row at once with a \verb=\cr=
+%    and move back up with a \verb=\vskip=.
 %
 %    While testing these macros I found out that the
-%    \cs{endtemplate}
-%    created by \cs{cr} and \verb?&? is something like an
-%    \cs{outer} primitive and therefore it should not appear in
-%    incomplete \cs{if} statements. Thus the following solution was
-%    chosen which hides the \cs{cr} in other macros when \TeX\
+%    \verb=\endtemplate=
+%    created by \verb=\cr= and \verb=&= is something like an
+%    \verb=\outer= primitive and therefore it should not appear in
+%    incomplete \verb=\if= statements. Thus the following solution was
+%    chosen which hides the \verb=\cr= in other macros when \TeX\
 %    is skipping conditional text.
 %    \begin{macrocode}
-  \expandafter\@xargarraycr\else 
+  \expandafter\@xargarraycr\else
   \expandafter\@yargarraycr\fi{#1}}
 %    \end{macrocode}
 % \end{macro}
@@ -16007,7 +16146,7 @@
 %
 % \begin{macro}{\multicolumn}
 %    If several columns should be held together with a special format
-%    the command \cs{multicolumn} must be used. It has three
+%    the command \verb=\multicolumn= must be used. It has three
 %    arguments: the number of columns to be covered; the format for
 %    the result column and the actual column entry.
 %    \begin{macrocode}
@@ -16019,45 +16158,45 @@
 %    \begin{macrocode}
    \multispan{#1}\begingroup
 %    \end{macrocode}
-%    Since a \cs{multicolumn} should only describe the format of a
-%    result column, we redefine \cs{@addamp} in such a way that one gets
+%    Since a \verb=\multicolumn= should only describe the format of a
+%    result column, we redefine \verb=\@addamp= in such a way that one gets
 %    an error message if one uses more than one \texttt{c},
 %    \texttt{l}, \texttt{r}, \texttt{p}, \texttt{m} or \texttt{b} in
 %    the second argument. One should consider that this definition is
 %    local to the build-up of the preamble; an \textsf{array}-- or
 %    \textsf{tabular}--environment in the third argument of the
-%    \cs{multicolumn} is therefore worked through correctly as well.
+%    \verb=\multicolumn= is therefore worked through correctly as well.
 %    \begin{macrocode}
    \def\@addamp{\if at firstamp \@firstampfalse \else
                 \@preamerr 5\fi}%
 %    \end{macrocode}
 %    Then we evaluate the second argument with the help of
-%    \cs{@mkpream}.
+%    \verb=\@mkpream=.
 %    Now we still have to insert the contents of the \textsf{token}
-%    register into the \cs{@preamble}, i.e.\ we have to say
-%    \verb?\xdef\@preamble{\@preamble}?. This is achieved shorter by
+%    register into the \verb=\@preamble=, i.e.\ we have to say
+%    \verb=\xdef\@preamble{\@preamble}=. This is achieved shorter by
 %    writing:
 %    \begin{macrocode}
    \@mkpream{#2}\@addtopreamble\@empty
 %    \end{macrocode}
-%    After the \cs{@preamble} is created we forget all local
+%    After the \verb=\@preamble= is created we forget all local
 %    definitions and occupations of the \textsf{token} registers.
-%    \begin{macrocode}
+%    \begin{macrocode} 
    \endgroup
 %    \end{macrocode}
-%    In the special situation of  \cs{multicolumn} \cs{@preamble}
-%    is not needed as preamble for a \cs{halign} but it is directly
-%    inserted into our table. Thus instead of \cs{sharp}
-%    there has to be the column entry (\verb?#3?) wanted by the user.
+%    In the special situation of  \verb=\multicolumn= \verb=\@preamble=
+%    is not needed as preamble for a \verb=\halign= but it is directly
+%    inserted into our table. Thus instead of \verb=\sharp=
+%    there has to be the column entry (\verb=#3=) wanted by the user.
 %    \begin{macrocode}
    \def\@sharp{#3}%
 %    \end{macrocode}
-%    Now we can pass the \cs{@preamble} to \TeX\ . For safety
-%    we start with an \cs{@arstrut}. This should usually be in the
+%    Now we can pass the \verb=\@preamble= to \TeX\ . For safety
+%    we start with an \verb=\@arstrut=. This should usually be in the
 %    template for the first column however we do not know if this
-%    template was overwritten by our \cs{multicolumn}.
-%    We also add a \cs{null} at the right end to prevent any following
-%    \cs{unskip} (for example from \verb?\\[..]?) to remove the \cs{tabcolsep}.
+%    template was overwritten by our \verb=\multicolumn=.
+%    We also add a \verb=\null= at the right end to prevent any following
+%    \verb=\unskip= (for example from \verb=\\[..]=) to remove the \verb=\tabcolsep=.
 %    \begin{macrocode}
    \@arstrut \@preamble
    \null
@@ -16067,27 +16206,31 @@
 %
 %
 %
-%   \subsubsection{The environment definitions}
+%   \subsubsection{The Environment Definitions}
 %
 % After these preparations we are able to define the environments. They
-% only differ in the initialisations of \cs{d at llar...}, \cs{col at sep}
-%  and \cs{@halignto}.
+% only differ in the initialisations of \verb=\d at llar...=, \verb=\col at sep=
+%  and \verb=\@halignto=.
 %
 % \begin{macro}{\@halignto}
 % \begin{macro}{\d at llarbegin}
 % \begin{macro}{\d at llarend}
-%    In order to relieve the \textsf{save stack} we assign the
-%    replacement texts for \cs{@halignto} globally. \cs{d at llar} has to be
-%    local since otherwise nested \textsf{tabular} and \textsf{array}
-%    environments (via \cs{multicolumn}) are impossible.
-%    When the new font selection scheme is in force we have to 
-%    we surround all \cs{halign} entries 
+%    \verb=\d at llar= has to be
+%    locally asigned since otherwise nested \textsf{tabular} and \textsf{array}
+%    environments (via \verb=\multicolumn=) are impossible.
+%    For 25 years or so \verb=\@halignto= was set globally (to save space on the
+%    save stack, but that was a mistake: if there is a tabular in the
+%    output routine (e.g., in the running header) then that tabular is 
+%    able overwrite the \verb=\@halignto=
+%    setting of a tabular in the main text resulting in a very weird error.
+%    When the new font selection scheme is in force we have to
+%    we surround all \verb=\halign= entries
 %    with braces. See remarks in TUGboat 10\#2. Actually we are going
-%    to use \cs{begingroup} and \cs{endgroup}. However, this is only
+%    to use \verb=\begingroup= and \verb=\endgroup=. However, this is only
 %    necessary when we are in text mode. In math the surrounding
 %    dollar signs will already serve as the necessary extra grouping
-%    level. Therefore we switch the settings of \cs{d at llarbegin} and
-%    \cs{d at llarend} between groups and dollar signs.
+%    level. Therefore we switch the settings of \verb=\d at llarbegin= and
+%    \verb=\d at llarend= between groups and dollar signs.
 %    \begin{macrocode}
 \let\d at llarbegin\begingroup
 \let\d at llarend\endgroup
@@ -16098,10 +16241,10 @@
 %
 %
 % \begin{macro}{\array}
-%    Our new definition of \cs{array} then reads:
+%    Our new definition of \verb=\array= then reads:
 %    \begin{macrocode}
 \def\array{\col at sep\arraycolsep
-  \def\d at llarbegin{$}\let\d at llarend\d at llarbegin\gdef\@halignto{}%$
+  \def\d at llarbegin{$}\let\d at llarend\d at llarbegin\def\@halignto{}%$ emacs
 %    \end{macrocode}
 %    Since there might be an optional argument we call another
 %    macro which is also used by the other environments.
@@ -16110,45 +16253,36 @@
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\@tabarray}
-%    This macro tests for an optional bracket and then calls up
-%    \cs{@@array} or \verb?\@@array[c]? (as default).
+%    This macro tests for a optional bracket and then calls up
+%    \verb=\@array= or \verb=\@array[c]= (as default).
 %    \begin{macrocode}
-\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
+\def\@tabarray{\@ifnextchar[{\@array}{\@array[c]}}
 %    \end{macrocode}
 % \end{macro}
-% \begin{macro}{\@@array}
-%    This macro could then test an optional delimiter before the
-%    left brace of the main preamble argument. At this point 
-%    it simply is let to be \cs{@array}.
-%    \begin{macrocode}
-\let\@@array\@array
-%    \end{macrocode}
-% \end{macro}
 %
 %
 % \begin{macro}{\tabular}
 % \begin{macro}{\tabular*}
-%    The environments \textsf{tabular} and \textsf{tabular*} differ
-%    only in the initialisation of the command \cs{@halignto}. Therefore
+%    The environments \textsf{tabular} and \textsf{tabular$*$} differ
+%    only in the initialisation of the command \verb=\@halignto=. Therefore
 %    we define
 %    \begin{macrocode}
-\def\tabular{\gdef\@halignto{}\@tabular}
+\def\tabular{\def\@halignto{}\@tabular}
 %    \end{macrocode}
-%     and analoguesly for the star form. We evalute the argument first 
-%     using \cs{setlength} so that users of the \texttt{calc} package can
-%     write code like\\ \verb?\begin{tabular*}{(\columnwidth-1cm)/2}...?
+%     and analogously for the star form. We evaluate the argument first
+%     using =\setlength= so that users of the \texttt{calc} package can
+%     write code like\\ \verb=\begin{tabular*}{(\columnwidth-1cm)/2}...=
 %     \begin{macrocode}
 \expandafter\def\csname tabular*\endcsname#1{%
        \setlength\dimen@{#1}%
-       \xdef\@halignto{to\the\dimen@}\@tabular}
+       \edef\@halignto{to\the\dimen@}\@tabular}
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
 % \begin{macro}{\@tabular}
-%    The rest of the job is carried out by the \cs{@tabular} macro:
+%    The rest of the job is carried out by the \verb=\@tabular= macro:
 %    \begin{macrocode}
 \def\@tabular{%
 %    \end{macrocode}
@@ -16158,57 +16292,52 @@
 %    \begin{macrocode}
   \leavevmode
 %    \end{macrocode}
-%    It should be taken into consideration that the macro \cs{@array}
+%    It should be taken into consideration that the macro \verb=\@array=
 %    must be called in math mode. Therefore we open a \textsf{box},
-%    insert a \verb?$? and then assign the correct values to \cs{col at sep} and
-%    \cs{d at llar...}.
+%    insert a \verb=$= and then assign the correct values to \verb=\col at sep= and
+%    \verb=\d at llar...=.
 %    \begin{macrocode}
-  \hbox \bgroup $\col at sep\tabcolsep \let\d at llarbegin\begingroup%$
+  \hbox \bgroup $\col at sep\tabcolsep \let\d at llarbegin\begingroup% $ emacs
                                     \let\d at llarend\endgroup
 %    \end{macrocode}
 %    Now everything \textsf{tabular} specific is done and we are able to
-%    call the \cs{@tabarray} macro.
+%    call the \verb=\@tabarray= macro.
 %    \begin{macrocode}
   \@tabarray}
 %    \end{macrocode}
 % \end{macro}
 %
-%
 % \begin{macro}{\endarray}
-% \begin{macro}{\@arrayleft}
-% \begin{macro}{\@arrayright}
 %    When the processing of \textsf{array} is finished we have to
-%    close the \cs{halign}
+%    close the \verb=\halign=
 %    and afterwards the surrounding \textsf{box} selected by
-%    \cs{@array}. To save \textsf{token} space we then redefine
-%    \cs{@preamble}
+%    \verb=\@array=. To save \textsf{token} space we then redefine
+%    \verb=\@preamble=
 %    because its replacement text isn't longer needed.
-%    We have to declare the hook, \cs{@arrayleft}, we put into \cs{@array} above.
-%    A similar hook `\cs{@arrayright}' is inserted into the
-%    \cs{endarray} to gain control. Both defaults to empty.
 %    \begin{macrocode}
-\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
-\let\@arrayleft\@empty
-\let\@arrayright\@empty
+\def\endarray{\crcr \egroup \egroup \gdef\@preamble{}}
 %    \end{macrocode}
 % \end{macro}
-% \end{macro}
-% \end{macro}
 %
 % \begin{macro}{\endtabular}
 % \begin{macro}{\endtabular*}
-%    To end a \textsf{tabular} or \textsf{tabular*} environment we
-%    call up \cs{endarray}, close the math mode and then the surrounding
-%    \cs{hbox}.
+%    To end a \textsf{tabular} or \textsf{tabular$*$} environment we
+%    call up \verb=\endarray=, close the math mode and then the surrounding
+%    \verb=\hbox=.
 %    \begin{macrocode}
-\def\endtabular{\endarray $\egroup}%$
+\def\endtabular{\endarray $\egroup}%$ emacs
 \expandafter\let\csname endtabular*\endcsname=\endtabular
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 %
-% We should \cs{let} all macros
-% to \cs{relax} that were used in the kernel but are no longer
+%
+%
+%   \subsubsection{Last minute definitions}
+%
+%
+% If this file is used as a package file we should \verb=\let= all macros
+% to \verb=\relax= that were used in the original but are no longer
 %  necessary.
 %    \begin{macrocode}
 \let\@ampacol=\relax        \let\@expast=\relax
@@ -16220,13 +16349,14 @@
 %    \end{macrocode}
 %
 % \begin{macro}{\@preamerr}
-%    We also have to redefine the error routine \cs{@preamerr} since
+%    We also have to redefine the error routine \verb=\@preamerr= since
 %    new kind of errors are possible.
 %    The code for this macro is not perfect yet;
 %    it still needs too much memory.
 %    \begin{macrocode}
 \def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
-   \ClassError{memoir}{%
+   %\PackageError{array}{%
+   \ClassError{memoir}{% changed in menoir
    \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
     Missing arg: token ignored\or                           %1
     Empty preamble: `l' used\or                             %2
@@ -16233,45 +16363,62 @@
     >\@tempd token ignored\or                               %3
     <\@tempd changed to !{..}\or                            %4
     Only one column-spec. allowed.\fi}\@ehc}                %5
-
 %    \end{macrocode}
 % \end{macro}
 %
 %
 %
-% \subsubsection{Defining your own column specifiers}
+% \subsubsection
+%   [Defining your own column specifiers]
+%   {Defining your own column specifiers\footnotemark}
 %
+% \footnotetext{The code and the documentation in this section was
+%   written by David. So far only the code from newarray was plugged
+%   into array so that some parts of the documentation still claim
+%   that this is newarray and even worse, some parts of the code are
+%   unnecessarily doubled. This will go away in a future release. For
+%   the moment we thought it would be more important to bring both
+%   packages together.}
 %
+%  \begin{macro}{\newcolumn}
+%    In \texttt{newarray.sty} the macro for specifying new columns was
+%    named \verb"\newcolumn". When the functionality was added to
+%    \texttt{array.sty} the command was renamed \verb"\newcolumntype".
+%    Initially both names were supported, but now (In versions of this
+%    package distributed for \LaTeXe) the old name is not defined.
+%  \end{macro}
+%
 % \begin{macro}{\newcolumntype}
-%    In \texttt{newarray.sty} the macro for specifying new columns was
-%    named \cs{newcolumn}. When the functionality was added to
-%    \texttt{array.sty} the command was renamed \cs{newcolumntype}.
-% The \cs{newcolumntype} macro gives users the chance
+%  As
+% described above, the \verb"\newcolumntype" macro gives users the chance
 % to define letters, to be used in the same way as the primitive
 % column specifiers, `c' `p' etc.
 %    \begin{macrocode}
 \def\newcolumntype#1{%
 %    \end{macrocode}
-% \cs{NC at char} is so that active characters, like \verb?@? in
-% AMS\LaTeX\ may be used. Note that we need to use the possibly active token,
-% \verb?#1?, in several places, as that is the token that actually
+% \verb"\NC at char" was added in V2.01 so that active characters, like "@" in
+% AMS\LaTeX\ may be used. This trick was stolen from \texttt{array.sty}
+% 2.0h. Note that we need to use the possibly active token,
+% \verb"#1", in several places, as that is the token that actually
 % appears in the preamble argument.
 %    \begin{macrocode}
   \edef\NC at char{\string#1}%
 %    \end{macrocode}
 % First we check whether there is already a definition for this column.
-% Unlike \cs{newcommand} we give a warning rather than an error if it is
-% defined. If it is a new column, add \cs{NC at do} \meta{column} to
-% the list \cs{NC at list}.
+% Unlike \verb"\newcommand" we give a warning rather than an error if it is
+% defined. If it is a new column, add \verb"\NC at do" \meta{column} to
+% the list \verb"\NC at list".
 %    \begin{macrocode}
   \@ifundefined{NC at find@\NC at char}%
-    {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC at char%|emacs
-        \@memwarn{Redefining primitive column \NC at char}\fi}%
+    {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC at char
+        %\PackageWarning{array}%
+          \@memwarn{Redefining primitive column \NC at char}\fi}% memoir change
      \NC at list\expandafter{\the\NC at list\NC at do#1}}%
-    {\@memwarn{Column \NC at char\space is already defined}}%
+   {%\PackageWarning{array}
+      \@memwarn{Column \NC at char\space is already defined}}% memoir change
 %    \end{macrocode}
 % Now we define a macro with an argument delimited by the new column
-% specifier, this is used to find occurences of this specifier in the
+% specifier, this is used to find occurrences of this specifier in the
 % user preamble.
 %    \begin{macrocode}
   \@namedef{NC at find@\NC at char}##1#1{\NC@{##1}}%
@@ -16283,14 +16430,14 @@
 % \end{macro}
 % \begin{macro}{\newcol@}
 % We can now define the macro which does the rewriting,
-% \cs{@reargdef} takes the same arguments as \cs{newcommand}, but
+% \verb"\@reargdef" takes the same arguments as \verb"\newcommand", but
 % does not check that the command is new. For a column, say `D' with
-% one argument, define a command \cs{NC at rewrite@D} with one
-% argument, which recursively calls \cs{NC at find} on the user preamble
+% one argument, define a command \verb"\NC at rewrite@D" with one
+% argument, which recursively calls \verb"\NC at find" on the user preamble
 % after replacing the first token or group with the replacement text
-% specified in the \cs{newcolumntype} command. \cs{NC at find} will find the
-% next occurrence of `D' as it will be \cs{let} equal to
-% \cs{NC at find@D} by \cs{NC at do}.
+% specified in the \verb"\newcolumntype" command. \verb"\NC at find" will find the
+% next occurrence of `D' as it will be \verb"\let" equal to
+% \verb"\NC at find@D" by \verb"\NC at do".
 %    \begin{macrocode}
 \def\newcol@#1[#2]#3{\expandafter\@reargdef
      \csname NC at rewrite@#1\endcsname[#2]{\NC at find#3}}
@@ -16297,10 +16444,10 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\NC@}
-% Having found an occurence of the new column, save the preamble
-% before the column in \cs{@temptokena}, then check to see if we
+% Having found an occurrence of the new column, save the preamble
+% before the column in \verb"\@temptokena", then check to see if we
 % are at the end of the preamble. (A dummy occurrence of the column
-% specifier will be placed at the end of the preamble by \cs{NC at do}).
+% specifier will be placed at the end of the preamble by \verb"\NC at do".
 %    \begin{macrocode}
 \def\NC@#1{%
   \@temptokena\expandafter{\the\@temptokena#1}\futurelet\next\NC at ifend}
@@ -16307,17 +16454,18 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\NC at ifend}
-% We can tell that we are at the end as \cs{NC at do} will place a \cs{relax}
+% We can tell that we are at the end as \verb"\NC at do" will place a \verb"\relax"
 % after the dummy column.
 %    \begin{macrocode}
 \def\NC at ifend{%
 %    \end{macrocode}
 % If we are at the end, do nothing. (The whole preamble will now be in
-% \cs{@temptokena}.)
+% \verb"\@temptokena".)
 %    \begin{macrocode}
   \ifx\next\relax
 %    \end{macrocode}
-% Otherwise set the flag \cs{if at tempswa}, and rewrite the column.
+% Otherwise set the flag \verb"\if at tempswa", and rewrite the column.
+% \verb"\expandafter" introduced 1n V2.01
 %    \begin{macrocode}
     \else\@tempswatrue\expandafter\NC at rewrite\fi}
 %    \end{macrocode}
@@ -16324,16 +16472,16 @@
 % \end{macro}
 % \begin{macro}{\NC at do}
 % If the user has specified `C' and `L' as new columns, the list of
-% rewrites (in the token register \cs{NC at list}) will look like
-% \verb?\NC at do *? \verb?\NC at do C? \verb?\NC at do L?.
-% So we need to define \cs{NC at do} as a one argument macro which
+% rewrites (in the token register \verb"\NC at list") will look like
+% \verb"\NC at do *" \verb"\NC at do C" \verb"\NC at do L".
+% So we need to define \verb"\NC at do" as a one argument macro which
 % initialises the rewriting of the specified column. Let us assume that
 % `C' is the argument.
 %    \begin{macrocode}
 \def\NC at do#1{%
 %    \end{macrocode}
-% First we let \cs{NC at rewrite} and \cs{NC at find} be
-% \cs{NC at rewrite@C} and \cs{NC at find@C} respectively.
+% First we let \verb"\NC at rewrite" and \verb"\NC at find" be
+% \verb"\NC at rewrite@C" and \verb"\NC at find@C" respectively.
 %    \begin{macrocode}
   \expandafter\let\expandafter\NC at rewrite
     \csname NC at rewrite@\string#1\endcsname
@@ -16340,9 +16488,9 @@
   \expandafter\let\expandafter\NC at find
     \csname NC at find@\string#1\endcsname
 %    \end{macrocode}
-% Clear the token register \cs{@temptokena} after putting the present
-% contents of the register in front of the token \cs{NC at find}. At the
-% end we place the tokens `\verb?C\relax?' which \cs{NC at ifend} will use
+% Clear the token register \verb"\@temptokena" after putting the present
+% contents of the register in front of the token \verb"\NC at find". At the
+% end we place the tokens `\verb"C\relax"' which \verb"\NC at ifend" will use
 % to detect the end of the user preamble.
 %    \begin{macrocode}
   \expandafter\@temptokena\expandafter{\expandafter}%
@@ -16351,14 +16499,14 @@
 % \end{macro}
 %
 % \begin{macro}{\showcols}
-% This macro is useful for debugging \cs{newcolumntype} specifications,
-% it is the equivalent of the primitive \cs{show} command for macro
-% definitions.  All we need to do is locally redefine \cs{NC at do} to take
-% its argument (say `C') and then \cs{show} the (slightly modified)
-% definition of \cs{NC at rewrite@C}. Actually as the the list always
-% starts off with \verb?\NC at do *? and we do not want to print the
-% definition of the *-form, define \cs{NC at do} to throw away the first
-% item in the list, and then redefine itsef to print the rest of the
+% This macro is useful for debugging \verb"\newcolumntype" specifications,
+% it is the equivalent of the primitive \verb"\show" command for macro
+% definitions.  All we need to do is locally redefine \verb"\NC at do" to take
+% its argument (say `C') and then \verb"\show" the (slightly modified)
+% definition of \verb"\NC at rewrite@C". Actually as the the list always
+% starts off with \verb"\NC at do *" and we do not want to print the
+% definition of the $*$-form, define \verb"\NC at do" to throw away the first
+% item in the list, and then redefine itself to print the rest of the
 % definitions.
 %    \begin{macrocode}
 \def\showcols{{\def\NC at do##1{\let\NC at do\NC at show}\the\NC at list}}
@@ -16366,11 +16514,11 @@
 % \end{macro}
 % \begin{macro}{\NC at show}
 % If the column `C' is defined as above, then
-% \verb?\show\NC at rewrite@C? would output\\
-% \verb?\long macro: ->\NC at find >{$}c<{$}?.
-% We want to strip the \verb?\long macro: ->? and the \cs{NC at find}. So first we
-% use \cs{meaning} and then apply the macro \cs{NC at strip} to the tokens so
-% produced and then \cs{typeout} the required string.
+% \verb"\show\NC at rewrite@C" would output\\
+% \verb"\long macro: ->\NC at find >{$}c<{$}".
+% We want to strip the \verb"long macro: ->" and the \verb"\NC at find". So first we
+% use \verb"\meaning" and then apply the macro \verb"\NC at strip" to the tokens so
+% produced and then \verb"\typeout" the required string.
 %    \begin{macrocode}
 \def\NC at show#1{%
   \typeout{Column #1\expandafter\expandafter\expandafter\NC at strip
@@ -16378,9 +16526,9 @@
 %    \end{macrocode}
 % \end{macro}
 % \begin{macro}{\NC at strip}
-% Delimit the arguments to \cs{NC at strip} with `\texttt{:}', `\texttt{->}',
-% a space, and \cs{@@} to pull out the required parts of the output from
-% \cs{meaning}.
+% Delimit the arguments to \verb"\NC at strip" with `\texttt{:}', `\texttt{->}',
+% a space, and \verb"\@@" to pull out the required parts of the output from
+% \verb"\meaning".
 %    \begin{macrocode}
 \def\NC at strip#1:#2->#3 #4\@@{#2 -> #4}
 %    \end{macrocode}
@@ -16392,9 +16540,9 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \subsubsection{The *--form}
-% We view the *-form as a slight generalisation of the system
-% described in the previous subsection. The idea is to define a *
+% \subsubsection{The $*$--form}
+% We view the $*$-form as a slight generalisation of the system
+% described in the previous subsection. The idea is to define a $*$
 % column by a command of the form:
 % \begin{verbatim}
 % \newcolumntype{*}[2]{%
@@ -16402,20 +16550,19 @@
 %       \advance\count@ by -1 #2*{\count@}{#2}\fi}
 % \end{verbatim}
 % \begin{macro}{\NC at rewrite@*}\label{NC at rewrite@*}
-% This does not work however as \cs{newcolumntype} takes great care not
-% to expand anything in the preamble, and so the \cs{if} is never
-% expanded. \cs{newcolumntype} sets up various other parts of the
+% This does not work however as \verb"\newcolumntype" takes great care not
+% to expand anything in the preamble, and so the \verb"\if" is never
+% expanded. \verb"\newcolumntype" sets up various other parts of the
 % rewrite correctly though so we can define:
 %    \begin{macrocode}
 \newcolumntype{*}[2]{}
 %    \end{macrocode}
-% Now we must correct the definition of \cs{NC at rewrite@*}. The
+% Now we must correct the definition of \verb"\NC at rewrite@*". The
 % following is probably more efficient than a direct translation of
-% the idea sketched above, we do not need to put a * in the preamble
-% and call the rewrite recursively, we can just put \verb?#1? copies of
-% \verb?#2? into \cs{@temptokena}. (Nested * forms will be expanded
-% when the whole rewrite list is expanded again, see \cs{@mkpream})
-% \changes{v1.618}{2005/09/03}{Fixed original bug in \cs{NC at rewrite@*} (mempatch v3.3)}
+% the idea sketched above, we do not need to put a $*$ in the preamble
+% and call the rewrite recursively, we can just put \verb"#1" copies of
+% \verb"#2" into \verb"\@temptokena". (Nested $*$ forms will be expanded
+% when the whole rewrite list is expanded again, see \verb"\@mkpream")
 %    \begin{macrocode}
 \long\@namedef{NC at rewrite@*}#1#2{%
 %    \end{macrocode}
@@ -16423,31 +16570,196 @@
 %    \begin{macrocode}
   \count@#1\relax
 %    \end{macrocode}
-% Put \verb?#1? copies of \verb?#2? in the token register.
+% Put \verb"#1" copies of \verb"#2" in the token register.
 %    \begin{macrocode}
   \loop
   \ifnum\count@>\z@
-    \advance\count@\m at ne
-    \@temptokena\expandafter{\the\@temptokena#2}%
+  \advance\count@\m at ne
+  \@temptokena\expandafter{\the\@temptokena#2}%
   \repeat
 %    \end{macrocode}
-% \cs{NC at do} will ensure that \cs{NC at find} is \cs{let} equal
-% to \cs{NC at find@*}.
+% \verb"\NC at do" will ensure that \verb"\NC at find" is \verb"\let" equal
+% to \verb"\NC at find@*".
 %    \begin{macrocode}
   \NC at find}
-
 %    \end{macrocode}
 % \end{macro}
 %
+% \subsubsection{Modifications to internal macros of \texttt{array.sty}}
 %
-% \subsection{Getting the spacing around rules right}
+% \begin{macro}{\@xexpast}
+% \begin{macro}{\@xexnoop}
+%    These macros are used to expand $*$-forms in
+%    \texttt{array.sty}. \verb"\let" them to \verb"\relax" to save space.
+%    \begin{macrocode}
+\let\@xexpast\relax
+\let\@xexnoop\relax
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
 %
+% \begin{macro}{\save at decl}
+% We do not assume that the token register is free, we add the new
+% declarations to the front of the register. This is to allow user
+% preambles of the form, \verb">{foo}>{bar}..". Users are not encouraged to
+% enter such expressions directly, but they may result from the
+% rewriting of \verb"\newcolumntype"'s.
+%    \begin{macrocode}
+\def\save at decl{\toks \count@ = \expandafter\expandafter\expandafter
+                  {\expandafter\@nextchar\the\toks\count@}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@mkpream}
+%    The main modification to \verb"\@mkpream" is to replace the call to
+%    \verb"\@xexpast" (which expanded $*$-forms) by a loop which expands
+%    all \verb"\newcolumntype" specifiers.
+%    \begin{macrocode}
+\def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
+   \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
+%    \end{macrocode}
+%    Now we remove possible  $*$-forms and user-defined column
+%    specifiers in the user preamble by repeatedly executing the list
+%    \verb"\NC at list" until the re-writes have no more effect. The
+%    expanded preamble will then be in the token register
+%    \verb"\@temptokena". Actually we need to know at this point that
+%    this is not \verb"\toks0".
+%    \begin{macrocode}
+   \@temptokena{#1}\@tempswatrue
+   \@whilesw\if at tempswa\fi{\@tempswafalse\the\NC at list}%
+%    \end{macrocode}
+%    Afterwards we initialize all registers and macros, that we need
+%    for the build-up of the preamble.
+%    \begin{macrocode}
+   \count@\m at ne
+   \let\the at toks\relax
+   \prepnext at tok
+%    \end{macrocode}
+% Having expanded all tokens defined using \verb"\newcolumntype" (including
+% \verb"*"), we evaluate the remaining tokens, which are saved in
+% \verb"\@temptokena".  We use the \LaTeX--macro \verb"\@tfor" to inspect each
+% token in turn.
+%    \begin{macrocode}
+   \expandafter \@tfor \expandafter \@nextchar
+    \expandafter :\expandafter =\the\@temptokena \do
+%    \end{macrocode}
+% \verb"\@testpatch" does not take an argument since \texttt{array.sty} 2.0h.
+%    \begin{macrocode}
+   {\@testpach
+   \ifcase \@chclass \@classz \or \@classi \or \@classii
+     \or \save at decl \or \or \@classv \or \@classvi
+     \or \@classvii \or \@classviii
+%    \end{macrocode}
+%    In \texttt{newarray.sty} class 9 is equivalent to class 10.
+%    \begin{macrocode}
+     \or \@classx
+     \or \@classx \fi
+   \@lastchclass\@chclass}%
+   \ifcase\@lastchclass
+   \@acol \or
+   \or
+   \@acol \or
+   \@preamerr \thr@@ \or
+   \@preamerr \tw@ \@addtopreamble\@sharp \or
+   \or
+   \else  \@preamerr \@ne \fi
+   \def\the at toks{\the\toks}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@classix}
+%    \texttt{array.sty} does not allow repeated \texttt{>}
+%    declarations for the same column. This is allowed in
+%    \texttt{newarray.sty} as documented in the introduction. Removing
+%    the test for this case makes class 9 equivalent to class 10, and
+%    so this macro is redundant. It is \verb"\let" to \verb"\relax" to save
+%    space.
+%    \begin{macrocode}
+\let\@classix\relax
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@classviii}
+%    In \texttt{newarray.sty} explicitly allow class 2, as repeated
+%    \texttt{<} expressions are accepted by this package.
+%    \begin{macrocode}
+\def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
+      \@preamerr 4\@chclass 6 \@classvi \fi\fi}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@classv}
+% Class 5 is \texttt{@}-expressions (and is also called by class 1)
+% This macro was incorrect in Version~1. Now we do not expand the
+% \verb"@"-expression, but instead explicitly replace an
+% \verb"\extracolsep" command by an assignment to \verb"\tabskip" by a
+% method similar to the \verb"\newcolumntype" system described above.
+% \verb"\d at llarbegin" \verb"\d at llarend" were introduced in V2.01 to match
+% \texttt{array.sty} 2.0h.
+%    \begin{macrocode}
+\def\@classv{\save at decl
+   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@
+   \@addtopreamble{\d at llarbegin\the at toks\the\count@\relax\d at llarend}%
+   \prepnext at tok}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\NC at ecs}
+% Rewrite the first occurrence of \verb"\extracolsep{1in}" to
+% \verb"\tabskip1in\relax". As a side effect discard any tokens after a
+% second \verb"\extracolsep", there is no point in the user entering two of
+% these commands anyway, so this is not really a restriction.
+%    \begin{macrocode}
+\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
+  \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
+%    \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{Support for the \texttt{delarray.sty}}
+%
+% The \texttt{delarray.sty} package  extends the array syntax by
+% supporting the notation of delimiters. To this end we extend the
+% array parsing mechanism to include a hook which can be used by this
+% (or another) package to do some additional parsing.
+%
+% \begin{macro}{\@tabarray}
+%    This macro tests for an optional bracket and then calls up
+%    \verb"\@@array" or \verb"\@@array[c]" (as default).
+%    \begin{macrocode}
+\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@@array}
+%    This macro tests could then test an optional delimiter before the
+%    left brace of the main preamble argument. Here in the main package
+%    it simply is let to be \verb"\@array".
+%    \begin{macrocode}
+\let\@@array\@array
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endarray}
+% \begin{macro}{\@arrayright}
+%    We have to declare the hook we put into \verb"\@array" above.
+%    A similar hook `\verb"\@arrayright"' will be inserted into the
+%    \verb"\endarray" to gain control. Both defaults to empty.
+%    \begin{macrocode}
+\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
+\let\@arrayleft\@empty
+\let\@arrayright\@empty
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Support for \texttt{\textbackslash firsthline} and
+%             \texttt{\textbackslash lasthline}}
+%
 % The Companion~\cite[p.137]{GOOSSENS94} suggests two additional
-% commands to control the allignments in case of tabulars with
+% commands to control the alignments in case of tabulars with
 % horizontal lines. They are now added to this package.
 %
 %  \begin{macro}{\extratabsurround}
-%    The extra space around a table when \cs{firsthline} or \cs{lasthline}
+%    The extra space around a table when \verb"\firsthline" or \verb"\lasthline"
 %    are used.
 %    \begin{macrocode}
 \newlength{\extratabsurround}
@@ -16456,8 +16768,8 @@
 %  \end{macro}
 %
 % \begin{macro}{\backup at length}
-%    This register will be used internally by \cs{firsthline} and
-%    \cs{lasthline}.
+%    This register will be used internally by \verb"\firsthline" and
+%    \verb"\lasthline".
 %    \begin{macrocode}
 \newlength{\backup at length}
 %    \end{macrocode}
@@ -16469,14 +16781,14 @@
 %
 %    We start by producing a single tabular row without any visible
 %    content that will produce the external reference point in case
-%    \verb?[t]? is used.
+%    \verb"[t]" is used.
 %    \begin{macrocode}
-\newcommand{\firsthline}{%
-  \multicolumn1c{%
+\newcommand{\firsthline}{%}} emacs
+  \multicolumn1c{% 
 %    \end{macrocode}
-%    Within this row we calculate \cs{backup at length} to be the height
+%    Within this row we calculate \verb"\backup at length" to be the height
 %    plus depth of a standard line. In addition we have to add the
-%    width of the \cs{hline}, something that was forgotten in the
+%    width of the \verb"\hline", something that was forgotten in the
 %    original definition.
 %    \begin{macrocode}
     \global\backup at length\ht\@arstrutbox
@@ -16485,12 +16797,12 @@
 %    \end{macrocode}
 %    Finally we do want to make the height of this first line be a bit
 %    larger than usual, for this we place the standard array strut
-%    into it but raised by \cs{extratabsurround}
+%    into it but raised by \verb"\extratabsurround"
 %    \begin{macrocode}
      \raise\extratabsurround\copy\@arstrutbox
 %    \end{macrocode}
 %    Having done all this we end the line and back up by the value of
-%    \cs{backup at length} and then finally place our \cs{hline}. This should
+%    \verb"\backup at length" and then finally place our \verb"\hline". This should
 %    place the line exactly at the right place but keep the reference
 %    point of the whole tabular at the baseline of the first row.
 %    \begin{macrocode}
@@ -16500,20 +16812,20 @@
 % \end{macro}
 %
 % \begin{macro}{\lasthline}
-%    For \cs{lasthline} the situation is even worse and I got it
+%    For \verb"\lasthline" the situation is even worse and I got it
 %    completely wrong initially.
 %
-%    The problem in this case is that if the optional argument \verb?[b]?
+%    The problem in this case is that if the optional argument \verb"[b]"
 %    is used we do want the reference point of the tabular be at the
 %    baseline of the last row but at the same time do want the the
-%    depth of this last line increased by \cs{extratabsurround} without
-%    changing the placement \cs{hline}.
+%    depth of this last line increased by \verb"\extratabsurround" without
+%    changing the placement \verb"\hline".
 %
 %    We start by placing the rule followed by an invisible row.
 %    \begin{macrocode}
-\newcommand{\lasthline}{\hline\multicolumn1c{%
+\newcommand{\lasthline}{\hline\multicolumn1c{%}} emacs
 %    \end{macrocode}
-%    We now calculate \cs{backup at length} to be the height and depth of
+%    We now calculate \verb"\backup at length" to be the height and depth of
 %    two lines plus the width of the rule.
 %    \begin{macrocode}
     \global\backup at length2\ht\@arstrutbox
@@ -16537,10 +16849,12 @@
 % \end{macro}
 %
 %
-%    Beside a larger functionality \file{array.sty} has one
+% \subsubsection{Getting the spacing around rules right}
+%
+%    Beside a larger functionality \texttt{array.sty} has one
 %    important difference to the standard \texttt{tabular} and
 %    \texttt{array} environments: horizontal and vertical rules make a
-%    table larger or wider, e.g., \cs{doublerulesep} really denotes
+%    table larger or wider, e.g., \verb=\doublerulesep= really denotes
 %    the space between two rules and isn't measured from the middle of
 %    the rules.
 %
@@ -16557,17 +16871,58 @@
                \vskip\doublerulesep
              \fi
       \ifnum0=`{\fi}}
+%    \end{macrocode}
+%  \end{macro}
+%
+%
+%    \begin{macrocode}
+%%%%%%%%%% end array.sty 2016/10/06 v2.4d %%%%%%%%% 
 
 %    \end{macrocode}
-% \end{macro}
 %
 %
+% \begin{macro}{\m at mold@addamp}
+% \begin{macro}{\m at m@addamp}
+% \begin{macro}{\@addamp}
 %
+%    In the preamble a \verb?&? has to be inserted between any two columns;
+%    before the first column there should not be a \verb?&?. As the user
+%    preamble may start with a \verb?|? we have to remember somehow
+%    if we have already inserted a \verb?#? (i.e.\ a column). This is done
+%    with the boolean variable \cs{if at firstamp} that we test in
+%    \cs{@addamp}, the macro that inserts the \verb?&?.
+%
+% \begin{PW}
+%    PW: Later on, for horizontal lines in `continuous' tabulars,
+% I need to know how many columns there are in a tabular. I need a modified
+% kernel's \cs{@addamp} to do this and use the kernel's \cs{@curtab}
+% (a counter used in tabbing) to store the number of columns.
+%
+% \cs{m at mold@addamp} stores the kernel's definition of \cs{@addamp}, and
+% \cs{m at m@addamp} is the revised definition.
+% \end{PW}
+%
 %    \begin{macrocode}
-%%%%%%%%%%% end Array package code %%%%%%%%%%%%%%%%%%%%%
+\newif \@iffirstamp
+\let\m at mold@addamp\@addamp
+\newcommand*{\m at m@addamp}{%
+  \if at firstamp 
+    \@firstampfalse
+    \global\@curtab\@ne
+  \else
+    \@addtopreamble{&}
+    \global\advance\@curtab\@ne  
+  \fi}
+\let\@addamp\m at m@addamp
 
 %    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
 %
+
+
+
 % \subsection{D column specifiers} \label{sec:dcolumns}
 %
 % The description and code are essentially copied from the 
@@ -16841,14 +17196,24 @@
 %%%%%%%%%% Tabularx package code %%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%% With acknowledgements to David Carlisle %%%%%%%%%%%%%%%%%%%%%
 
+%%% This is a carbon copy of the tabularx dtx sources for v2.11,
+%%% 2016/02/03 with two changes: error messages mention the class
+%%% instead of tabularx. 
+
+%%%%%%%%%% Tabularx package code v2.11 2016/02/03 %%%%%%%%%%%%%%%%%%%%%
+
 %    \end{macrocode}
 %
 %
+%
 % The \Lpack{tabularx} package~\cite{TABULARX} implements a version of the \texttt{tabular}
 % environment in which the widths of certain columns are calculated so
 % that the table is is a specified width. The columns that may stretch are
 % marked by an \texttt{X} in the preamble argument.
 %
+% What follows is a carbon copy of the contents of \texttt{tabularx.dtx} with small changes: (1) We make errors/warnings
+% mention the class instead of \texttt{tabularx}, (2) we strip \texttt{tabularx} related \cs{changes} macros, (3) we
+% remove loading the \Lpack{array} package, as we already come with a copy.
 %
 % First some registers etc.\ that we need.
 %    \begin{macrocode}
@@ -16861,24 +17226,25 @@
 \newif\ifTX@
 %    \end{macrocode}
 %
-% Now a trick to get the body of an environment into a token register,
-% without doing any expansion. This does not do any real checking of
-% nested environments, so if you should need to nest one {\ttfamily
-% tabularx} inside another, the inner one must be surrounded by \verb?{ }?.
+% Now a trick to get the body of an environment into a token register, without doing any expansion. This does not do any
+% real checking of nested environments, so if you should need to nest one {\ttfamily tabularx} inside another, the inner
+% one must be surrounded by \verb+{ }+.
 %
 % \begin{macro}{\tabularx}
-%  Just save
+% Prior to (\texttt{tabularx}) v1.06, this macro took two arguments, which were saved in
+% separate registers before the table body was saved by \verb+\TX at get@body+.
+% Unfortunately this disables the \verb|[t]| optional argument. Now just save
 % the width specification separately, then clear the token register
-% \cs{toks@}.
-% Finally call \cs{TX at get@body} to begin saving the body of the table.
-% The \verb?{\ifnum0=`}\fi? allows \verb?tabularx? to appear
-% inside a \cs{halign}.^^A
-% \setbox0=\hbox{\footnotesize\verb?\iffalse{\fi\ifnum0=`}\fi?}^^A
-% \setbox2=\hbox{\footnotesize\verb?\ifnum0=`{}\fi?}^^A
+% \verb|\toks@|.
+% Finally call \verb|\TX at get@body| to begin saving the body of the table.
+% The \verb|{\ifnum0=`}\fi| was added at (tabularx) v1.03, to allow \Lenv{tabularx} to appear
+% inside a \verb|\halign|.^^A
+% \setbox0=\hbox{\footnotesize"\iffalse{\fi\ifnum0=`}\fi"}^^A
+% \setbox2=\hbox{\footnotesize"\ifnum0=`{}\fi"}^^A
 % \footnote{This adds an extra level of grouping,
 % which is not really needed. Instead, I could use \box0\ here, and
 % \box2\ below, however the code here would then have to be moved after
-% the first line, because of the footnote to page 386 of \theTeXbook,
+% the first line, because of the footnote to page 386 of the \TeX{}Book,
 % and I do not think I should be writing code that is so obscure as to
 % be documented in a footnote in an appendix called ``Dirty Tricks''!}
 %
@@ -16888,28 +17254,31 @@
 %\begin{verbatim}
 %\newenvironment{foo}{\begin{tabularx}{XX}}{\end{tabularx}}
 %\end{verbatim}
-% as the code is looking for a literal string \verb?\end{tabularx}? to stop
-% scanning. One may avoid this problem by using
-% \cs{tabularx} and \cs{endtabularx} directly in the definition:
+% as the code is looking for a literal string \verb"\end{tabularx}" to stop
+% scanning. Since version (tabularx) 2.02, one may avoid this problem by using
+% \verb|\tabularx| and \verb|\endtabularx| directly in the definition:
 %\begin{verbatim}
 %\newenvironment{foo}{\tabularx{XX}}{\endtabularx}
 %\end{verbatim}
-% The scanner now looks for the end of the current environment (\verb?foo? in
+% The scanner now looks for the end of the current environment (\verb|foo| in
 % this example.) There are some restrictions on this usage, the
-% principal one being that \cs{endtabularx} is the \emph{first} token of
-% the `end code' of the environment.
+% principal one being that \verb|\endtabularx| must not be inside any \verb"{ }" pairs
+% ao that the code before \verb"\endtabularx"  may be extracted and added to the table body
+% (prior to version (tabularx) 2.09  \verb"\endtabularx" had to be
+% the \emph{first} token of the `end code' of the environment).
 %    \begin{macrocode}
 \def\tabularx#1{%
 %    \end{macrocode}
-% Allow \cs{tabularx} \cs{endtabularx} (but not \verb?\begin{tabularx}?
-% \verb?\end{tabularx}?) to be used in \cs{newenvironment} definitions.
+% Allow \verb"\tabularx" \verb"\endtabularx" (but not \verb"\begin{tabularx}"
+% \verb"\end{tabularx}") to be used in \verb"\newenvironment" definitions.
 %    \begin{macrocode}
 \edef\TX@{\@currenvir}%
   {\ifnum0=`}\fi
 %    \end{macrocode}
-% \cs{setlength} lets you
-% use the \Lpack{calc} package so you could use a width of, say \\
-%  \verb?(\textwidth-12pt)/2?.
+% \verb"\relax" added at v1.05 so that non-expandable length tokens, like
+% \verb"\textwidth" do not generate an extra space, and an overfull box.
+% \verb"\relax" removed again at v4.09 in favour of \verb"\setlength" so if you
+% use the calc package you can use a width of \verb"(\textwidth-12pt)/2".
 %    \begin{macrocode}
   \setlength\TX at target{#1}%
   \TX at typeout{Target width: #1 = \the\TX at target.}%
@@ -16926,8 +17295,8 @@
 %  \end{macro}
 %
 % \begin{macro}{\TX at get@body}
-% Place all tokens as far as the first \cs{end} into a token register.
-% Then call \cs{TX at find@end} to see if we are at \verb?\end{tabularx}?.
+% Place all tokens as far as the first \verb"\end" into a token register.
+% Then call \verb"\TX at find@end" to see if we are at \verb"\end{tabularx}".
 %    \begin{macrocode}
 \long\def\TX at get@body#1\end
   {\toks@\expandafter{\the\toks@#1}\TX at find@end}
@@ -16935,8 +17304,8 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at find@end}
-% If we are at \verb?\end{tabularx}?, call \cs{TX at endtabularx}, otherwise
-% add \verb?\end{...}? to the register, and call \cs{TX at get@body} again.
+% If we are at \verb"\end{tabularx}", call \verb"\TX at endtabularx", otherwise
+% add \verb"\end{...}" to the register, and call \verb"\TX at get@body" again.
 %    \begin{macrocode}
 \def\TX at find@end#1{%
   \def\@tempa{#1}%
@@ -16946,8 +17315,42 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\TX at find@endtabularxa}
+% split up the end code, and extract the part that lives in the table body.
+%    \begin{macrocode}
+\long\def\TX at find@endtabularxa
+       #1\endtabularx#2\endtabularx#3\TX at find@endtabularxa{%
+  \ifx\TX@#2\relax\else
+  \toks@\expandafter{\the\toks@#1}%
+  \fi}
+%    \end{macrocode}
+% \end{macro}
+% \begin{macro}{\TX at find@endtabularxb}
+% split up the end code, and extract the part that lives outside the table body.
+%    \begin{macrocode}
+\long\def\TX at find@endtabularxb
+       #1\endtabularx#2\endtabularx#3\TX at find@endtabularxb{%
+  \ifx\TX@#2%
+    \expandafter\@firstoftwo
+  \else
+     \expandafter\@secondoftwo
+  \fi
+  {#1}{#2}}
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\TX at find@endtabularxbb}
+% Helper to avoid needing 15 consecutive \verb"\expandafter"
+%    \begin{macrocode}
+\def\TX at find@endtabularxbb{%
+  \expandafter\expandafter\expandafter
+  \TX at find@endtabularxb
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\TX@}
-% The string \texttt{tabularx} as a macro for testing with \cs{ifx}.
+% The string {\ttfamily tabularx} as a macro for testing with \verb"\ifx".
 %    \begin{macrocode}
 \def\TX@{tabularx}
 %    \end{macrocode}
@@ -16957,48 +17360,53 @@
 % registers, we can begin the work of setting the table.
 %
 % The algorithm for finding the correct column widths is as follows.
-% Firstly set the table with each \texttt{X} column the width of the
-% final table. Assuming that there is at least one \texttt{X} column,
+% Firstly set the table with each {\ttfamily X} column the width of the
+% final table. Assuming that there is at least one {\ttfamily X} column,
 % this will produce a table that is too wide. Divide the excess width by
-% the number of \texttt{X} columns, and reduce the column width by
+% the number of {\ttfamily X} columns, and reduce the column width by
 % this amount. Reset the table. If the table is not now the correct
-% width, a \cs{multicolumn} entry must be `hiding' one of the {\ttfamily
-% X} columns, and so there is one less \texttt{X} column affecting
+% width, a \verb"\multicolumn" entry must be `hiding' one of the {\ttfamily
+% X} columns, and so there is one less {\ttfamily X} column affecting
 % the width of the table. So we reduce by 1 the number of X columns and
 % repeat the process.
 %
 % \begin{macro}{\TX at endtabularx}
-% Although I have tried to make \texttt{tabularx} look like an
+% Although I have tried to make {\ttfamily tabularx} look like an
 % environment, it is in fact a command, all the work is done by this
 % macro.
 %    \begin{macrocode}
 \def\TX at endtabularx{%
+   \expandafter\expandafter\expandafter
+     \TX at find@endtabularxa\csname end\TX@\endcsname
+     \endtabularx\TX@\endtabularx\TX at find@endtabularxa
 %    \end{macrocode}
-% Define the \texttt{X} column, with an internal version of the
-% \cs{newcolumntype} command. The \cs{expandafter} commands enable
-% \cs{NC at newcol}  to get the \emph{expansion} of\\
-% \verb?\tabularxcolumn{\TX at col@width}? as its
-% argument. This will be the definition of an \texttt{X} column.
+% Define the {\ttfamily X} column, with an internal version of the
+% \verb"\newcolumntype" command. The \verb"\expandafter" commands enable
+% \verb"\NC at newcol"  to get the {\em expansion} of\\
+% \verb"\tabularxcolumn{\TX at col@width}" as its
+% argument. This will be the definition of an {\ttfamily X} column, as
+% discussed in section 4.
 %    \begin{macrocode}
   \expandafter\TX at newcol\expandafter{\tabularxcolumn{\TX at col@width}}%
 %    \end{macrocode}
-% Initialise the column width, and the number of \texttt{X} columns.
-% The number of \texttt{X} columns is set to one, which means that
+% Initialise the column width, and the number of {\ttfamily X} columns.
+% The number of {\ttfamily X} columns is set to one, which means that
 % the initial count will be one too high, but this value is decremented
 % before it is used in the main loop.
 %
+% Since v1.02, switch the definition of \verb"\verb".
 %    \begin{macrocode}
   \let\verb\TX at verb
 %    \end{macrocode}
-% Save the values of all \LaTeX\ counters; the list
-% \cs{cl@@ckpt} contains the names of all the \LaTeX\ counters that have
-% been defined so far. We expand \cs{setcounter} at this point, as it
-% results in fewer tokens being stored in \cs{TX at ckpt}, but the actual
-% resetting of the counters occurs when \cs{TX at ckpt} is expanded after
+% Since v1.05, save the values of all \LaTeX\ counters, the list
+% \verb"\cl@@ckpt" contains the names of all the \LaTeX\ counters that have
+% been defined so far. We expand \verb"\setcounter" at this point, as it
+% results in fewer tokens being stored in \verb"\TX at ckpt", but the actual
+% resetting of the counters occurs when \verb"\TX at ckpt" is expanded after
 % each trial run.
-% Actually, use something equivalent to the expansion of the
-% original definition of \cs{setcounter}, so that \verb?tabularx? works in
-% conjunction with \file{calc.sty}.
+% Actually since v1.07, use something equivalent to the expansion of the
+% original definition of \verb"\setcounter", so that \verb"tabularx" works in
+% conjunction with \verb"calc.sty".
 %    \begin{macrocode}
   \def\@elt##1{\global\value{##1}\the\value{##1}\relax}%
   \edef\TX at ckpt{\cl@@ckpt}%
@@ -17012,7 +17420,7 @@
   \TX at typeout@
     {\@spaces Table Width\@spaces Column Width\@spaces X Columns}%
 %    \end{macrocode}%
-% First attempt. Modify the \texttt{X} definition to count {\ttfamily
+% First attempt. Modify the {\ttfamily X} definition to count {\ttfamily
 % X} columns.
 %    \begin{macrocode}
   \TX at trial{\def\NC at rewrite@X{%
@@ -17029,12 +17437,12 @@
   \repeat
 %    \end{macrocode}
 % One last time, with warnings back on (see appendix D)
-% use \texttt{tabular*} to put it in a box of the right size, in case
+% use {\ttfamily tabular*} to put it in a box of the right size, in case
 % the algorithm failed to find the correct size.
 %
-% Locally make \cs{footnotetext} save its argument in a token
+% Since v1.04, locally make \verb"\footnotetext" save its argument in a token
 % register.
-% \cs{toks@} contains the preamble specification,
+% Since v1.06, \verb"\toks@" contains the preamble specification,
 % and possible optional argument, as well as the table body.
 %    \begin{macrocode}
   {\let\@footnotetext\TX at ftntext\let\@xfootnotenext\TX at xftntext
@@ -17042,24 +17450,28 @@
       \the\toks@
     \csname endtabular*\endcsname}%
 %    \end{macrocode}
-% Now the alignment is finished, and the \verb?}? has restored the original
-% meaning of \cs{@footnotetext} expand the register \cs{TX at ftn} which will
+% Now the alignment is finished, and the \verb"}" has restored the original
+% meaning of \verb"\@footnotetext" expand the register \verb"\TX at ftn" which will
 % execute a series of\\
-% \verb?\footnotetext[<num>]{<note>}? \\
+% \verb"\footnotetext["\meta{num}\verb"]{"\meta{note}\verb"}"\\
 % commands. We need to be careful about clearing the register as we may
-% be inside a nested \texttt{tabularx}.
+% be inside a nested {\ttfamily tabularx}.
 %    \begin{macrocode}
   \global\TX at ftn\expandafter{\expandafter}\the\TX at ftn
 %    \end{macrocode}
-% Now finish off the \texttt{tabularx} environment. Note that we need
-% \verb?\end{tabularx}? here as the \verb?\end{tabularx}? in the user's
-% file is never expanded. Now use \cs{TX@} rather than \verb?tabularx?.
+% Now finish off the {\ttfamily tabularx} environment. Note that we need
+% \verb"\end{tabularx}" here as the \verb"\end{tabularx}" in the user's
+% file is never expanded. Now use \verb"\TX@" rather than \verb"tabularx".
 %
-% We also need to finish off the group started by \verb?{\ifnum0=`}\fi? in
-% the macro \cs{tabularx}.
+% We also need to finish off the group started by \verb"{\ifnum0=`}\fi" in
+% the macro \verb"\tabularx".
 %    \begin{macrocode}
   \ifnum0=`{\fi}%
-  \expandafter\end\expandafter{\TX@}}
+   \expandafter\expandafter\expandafter
+   \TX at find@endtabularxbb
+    \expandafter\end\expandafter{\TX@}%
+    \endtabularx\TX@\endtabularx\TX at find@endtabularxb
+}
 %    \end{macrocode}
 % \end{macro}
 %
@@ -17066,15 +17478,21 @@
 %
 % \begin{macro}{\TX at arith}
 % Calculate the column width for the next try, setting the flag
-% \cs{ifTX@} to false if the loop should be aborted.
+% \verb"\ifTX@" to false if the loop should be aborted.
 %    \begin{macrocode}
 \def\TX at arith{%
   \TX at false
+  \@tempdimb\maxdimen
+  \divide\@tempdimb\TX at cols
+  \ifdim\TX at col@width>\@tempdimb
+    \TX at typeout@{Don't exceed \maxdimen}%
+    \wd\@tempboxa\maxdimen
+  \fi
   \ifdim\TX at old@table=\wd\@tempboxa
 %    \end{macrocode}
 % If we have reduced the column width, but the table width has not
 % changed, we stop the loop, and output the table (which will cause an
-% over-full alignment) with the previous value of \cs{TX at col@width}.
+% over-full alignment) with the previous value of \verb"\TX at col@width".
 %    \begin{macrocode}
     \TX at col@width\TX at old@col
     \TX at typeout@{Reached minimum width, backing up.}%
@@ -17086,7 +17504,7 @@
     \advance\dimen@ -\TX at target
     \ifdim\dimen@<\TX at delta
 %    \end{macrocode}
-% If this amount is less than \cs{TX at delta}, stop. (\cs{TX at delta}
+% If this amount is less than \verb"\TX at delta", stop. (\verb"\TX at delta"
 % should be non-zero otherwise we may miss the target due to rounding
 % error.)
 %    \begin{macrocode}
@@ -17093,11 +17511,11 @@
       \TX at typeout@{Reached target.}%
     \else
 %    \end{macrocode}
-% Reduce the number of effective \texttt{X} columns by one. (Checking
+% Reduce the number of effective {\ttfamily X} columns by one. (Checking
 % that we do not get 0, as this would produce an error later.) Then
 % divide excess width by the number of effective columns, and calculate
-% the new column width. Temporarily store this value (times -1) in
-% \cs{dimen@}.
+% the new column width. Temporarily store this value (times $-1$) in
+% \verb"\dimen@".
 %    \begin{macrocode}
       \ifnum\TX at cols>\@ne
         \advance\TX at cols\m at ne
@@ -17109,12 +17527,16 @@
 % If the new width would be too narrow, abort the loop. At the moment
 % too narrow, means less than 0\,pt!
 %
-% If the loop was aborted here and the X columns were left
-% with the width of the previous run it may make the table far
-% too wide as initial guesses are always too big. Force to 
-% \cs{TX at error@width} which defaults to be 1em. 
+% Prior to v2.03, if the loop was aborted here, the X columns were left
+% with the width of the previous run, but this may make the table far
+% too wide as initial guesses are always too big. Now force to
+% \verb"\TX at error@width" which defaults to be 1em. If you want to
+% get the old behaviour stick\\
+%  \verb"\renewcommand\TX at error@width{\TX at col@width}"\\
+%  in a package file loaded after \textsf{tabularx}.
 %    \begin{macrocode}
-        \@memwarn{X Columns too narrow (table too wide)\MessageBreak}%
+        %\PackageWarning{tabularx}%
+         \@memwarn{X Columns too narrow (table too wide)\MessageBreak}% <-- change here
         \TX at col@width\TX at error@width\relax
       \else
 %    \end{macrocode}
@@ -17140,20 +17562,20 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at delta}
-% Accept a table that is within \cs{hfuzz} of the correct width.
+% Accept a table that is within \verb"\hfuzz" of the correct width.
 %    \begin{macrocode}
 \TX at delta\hfuzz
 %    \end{macrocode}
 % \end{macro}
 %
-% Initialise the \texttt{X} column. The definition can be empty here,
-% as it is set for each \texttt{tabularx} environment.
+% Initialise the {\ttfamily X} column. The definition can be empty here,
+% as it is set for each {\ttfamily tabularx} environment.
 %    \begin{macrocode}
 \newcolumntype{X}{}
 %    \end{macrocode}
 %
 % \begin{macro}{\tabularxcolumn}
-% The default definition of \texttt{X} is \verb?p{#1}?.
+% The default definition of {\ttfamily X} is \verb"p{#1}".
 %    \begin{macrocode}
 \def\tabularxcolumn#1{p{#1}}
 %    \end{macrocode}
@@ -17160,7 +17582,7 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at newcol}
-% A little macro just used to cut down the number of \cs{expandafter}
+% A little macro just used to cut down the number of \verb"\expandafter"
 % commands needed.
 %    \begin{macrocode}
 \def\TX at newcol{\newcol@{X}[0]}
@@ -17174,28 +17596,28 @@
   \setbox\@tempboxa\hbox{%
 %    \end{macrocode}
 % Any extra commands. This is used on the first run to count the number
-% of \texttt{X} columns.
+% of {\ttfamily X} columns.
 %    \begin{macrocode}
     #1\relax
 %    \end{macrocode}
-% Make \cs{footnotetext} gobble its arguments. Also locally
-% clear \cs{TX at vwarn} so that the warning is generated by the {\ttfamily
+% Since v1.04, make \verb"\footnotetext" gobble its arguments. Also locally
+% clear \verb"\TX at vwarn" so that the warning is generated by the {\ttfamily
 % final} run, and does not appear in the middle of the table if
-% \cs{tracingtabularx}.
+% \verb"\tracingtabularx".
 %    \begin{macrocode}
   \let\@footnotetext\TX at trial@ftn
   \let\TX at vwarn\@empty
 %    \end{macrocode}
-% Do not nest \texttt{tabularx} environments during trial runs. This
-% would waste time, and the global setting of \cs{TX at cols} would break the
+% Do not nest {\ttfamily tabularx} environments during trial runs. This
+% would waste time, and the global setting of \verb"\TX at cols" would break the
 % algorithm.
 %    \begin{macrocode}
    \expandafter\let\expandafter\tabularx\csname tabular*\endcsname
    \expandafter\let\expandafter\endtabularx\csname endtabular*\endcsname
 %    \end{macrocode}
-% Dissable \cs{write}s during a trial run. This trick is
-% from \theTeXbook.\footnote{Actually the trick does
-% not work correctly, so it has been changed.}
+% Added at v1.05: disable \verb"\write"s during a trial run. This trick is
+% from the \TeX{}Book.\footnote{Actually the \TeX{}Book trick does
+% not work correctly, so changed for v2.05.}
 %    \begin{macrocode}
    \def\write{\begingroup
      \def\let{\afterassignment\endgroup\toks@}%
@@ -17210,17 +17632,18 @@
     \let\hfuzz\@tempdima
 %    \end{macrocode}
 % Make the table, and finish the hbox.
-% \cs{toks@} contains the preamble specification,
+% Since v1.06, \verb"\toks@" contains the preamble specification,
 % and possible optional argument, as well as the table body.
 %    \begin{macrocode}
     \expandafter\tabular\the\toks@
     \endtabular}%
 %    \end{macrocode}
-% Reset all \LaTeX\ counters, by executing \cs{TX at ckpt}.
+% Since v1.05 reset all \LaTeX\ counters, by executing \verb"\TX at ckpt".
 %    \begin{macrocode}
   \TX at ckpt
 %    \end{macrocode}
 % Print some statistics.
+% Added \verb"\TX at align" in v1.05, to line up the columns.
 %    \begin{macrocode}
   \TX at typeout@{\@spaces
      \expandafter\TX at align
@@ -17232,7 +17655,7 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at align}
-% Macro to improve the printing of the tracing info.
+% Macro added at v1.05, to improve the printing of the tracing info.
 %    \begin{macrocode}
 \def\TX at align#1.#2#3#4#5#6#7#8#9\@@{%
   \ifnum#1<10 \space\fi
@@ -17244,9 +17667,11 @@
 % \end{macro}
 %
 % \begin{macro}{\arraybackslash}
-% \verb?\\? hack.
+% \verb"\\" hack.
 %    \begin{macrocode}
-\def\arraybackslash{\let\\\@arraycr}
+\ifx\arraybackslash\@undefined
+\def\arraybackslash{\let\\\tabularnewline}
+\fi
 %    \end{macrocode}
 % \end{macro}
 %
@@ -17254,7 +17679,8 @@
 % Print statistics on column and table widths.
 %    \begin{macrocode}
 \def\tracingtabularx{%
-  \def\TX at typeout{\ClassWarningNoLine{memoir}}%
+  %\def\TX at typeout{\PackageWarningNoLine{tabularx}}%
+  \def\TX at typeout{\ClassWarningNoLine{memoir}}% <--- changed
   \def\TX at typeout@##1{\typeout{(tabularx) ##1}}}
 %    \end{macrocode}
 % \end{macro}
@@ -17297,22 +17723,22 @@
 % \end{macro}
 %
 % This last section was added at Version 1.02. Previous versions
-% documentented the fact that \cs{verb} did not work inside {\ttfamily
+% documented the fact that \verb"\verb" did not work inside {\ttfamily
 % tabularx}, but that did not stop people using it! This usually put
 % \LaTeX\ into an irrecoverable error position, with error messages that
-% did not mention the cause of the error. The `poor man's \cs{verb}' (and
-% \cs{verb*}) defined here is based on page 382 of \theTeXbook. As
+% did not mention the cause of the error. The `poor man's \verb"\verb"' (and
+% \verb"\verb*") defined here is based on page 382 of the \TeX{}Book. As
 % explained there, doing verbatim this way means that spaces are not
-% treated correctly, and so \cs{verb*} may well be useless, however I
+% treated correctly, and so \verb"\verb*" may well be useless, however I
 % consider this section of code to be error-recovery, rather than a real
 % implementation of verbatim.
 %
 % The mechanism is quite general, and any macro which wants to allow a
-% form of \cs{verb} to be used within its argument may
-% \verb?\let\verb=\TX at verb?. (Making sure to restore the real definition
+% form of \verb"\verb" to be used within its argument may
+% \verb"\let\verb=\TX at verb". (Making sure to restore the real definition
 % later!)
 %
-% \cs{verb} and \cs{verb*} are subject to the following restictions:
+% \verb"\verb" and \verb"\verb*" are subject to the following restrictions:
 % \begin{enumerate}
 % \item Spaces in the argument are not read verbatim, but may be skipped
 %       according to \TeX's usual rules.
@@ -17321,23 +17747,23 @@
 % \item Unless the argument is a single space, any trailing space,
 %       whether in the original argument, or added as in (2),
 %       will be omitted.
-% \item The argument must not end with \verb?\?, so \verb?\verb|\|? is not
-%      allowed, however, because of (3), \verb?\verb|\ |? produces
-%      \verb?\?.
-% \item The argument must be balanced with respect to \verb?{? and \verb?}?. So
-%      \verb?\verb|{|? is not allowed.
-% \item A comment character like \verb?%? will not appear verbatim. It will
+% \item The argument must not end with \verb"\", so \verb"\verb|\|" is not
+%      allowed, however, because of (3), \verb"\verb|\ |" produces
+%      \verb"\".
+% \item The argument must be balanced with respect to \verb"{" and \verb"}". So
+%      \verb"\verb|{|" is not allowed.
+% \item A comment character like \verb"%" will not appear verbatim. It will
 %       act as usual, commenting out the rest of the input line!
-% \item The combinations \verb=?`= and \verb?!`? will appear as
-%       {\ttfamily?`} and {\ttfamily!`} if the \texttt{cmtt} font is
+% \item The combinations \verb"?`" and \verb"!`" will appear as
+%       {\ttfamily?`} and {\ttfamily!`} if the {\ttfamily cmtt} font is
 %       being used.
 % \end{enumerate}
 %
 % \begin{macro}{\TX at verb}
-% The internal definition of \cs{verb}. Spaces will be replaced by \verb?~?, so
-% for the star-form, \cs{let} \verb?~? be \verb?\verb*| |?, which we obtain as
-% \verb?\uppercase{*}?. Use \verb?{\ifnum0=`}\fi? rather than \cs{bgroup} to allow
-% \verb?&? to appear in the argument.
+% The internal definition of \verb"\verb". Spaces will be replaced by \verb"~", so
+% for the star-form, \verb"\let" \verb"~" be \verb*| |, which we obtain as
+% \verb"\uppercase{*}". Use \verb"{\ifnum0=`}\fi" rather than \verb"\bgroup" to allow
+% \verb"&" to appear in the argument.
 %    \begin{macrocode}
 {\uccode`\*=`\ %
 \uppercase{\gdef\TX at verb{%
@@ -17348,16 +17774,16 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at vb}
-% Get the `almost verbatim' text using \cs{meaning}. The `\verb?!?' is added to
+% Get the `almost verbatim' text using \verb"\meaning". The `\verb"!"' is added to
 % the front of the user supplied text, to ensure that the whole argument
-% does not consist of a single \verb?{ }? group. \TeX\ would strip the outer
-% braces from such a group. The `\verb?!?' will be removed later.
+% does not consist of a single \verb"{ }" group. \TeX\ would strip the outer
+% braces from such a group. The `\verb"!"' will be removed later.
 %
-% Originally I followed Knuth, and had \verb?\def\@tempa{##1}?, however this
-% did not allow \verb?#? to appear in the argument. So I changed
-% this to to use a token register, and \cs{edef}. This allows \verb?#? appear,
+% Originally I followed Knuth, and had \verb"\def\@tempa{##1}", however this
+% did not allow \verb"#" to appear in the argument. So in v1.04, I changed
+% this to to use a token register, and \verb"\edef". This allows \verb"#" appear,
 % but makes each one appear twice!, so later we loop through, replacing
-% \verb?##? by \verb?#?.
+% \verb"##" by \verb"#".
 %    \begin{macrocode}
 \def\TX at vb#1{\def\@tempa##1#1{\toks@{##1}\edef\@tempa{\the\toks@}%
     \expandafter\TX at v\meaning\@tempa\\ \\\ifnum0=`{\fi}}\@tempa!}
@@ -17365,7 +17791,7 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at v}
-% Strip the initial segment of the \cs{meaning}, including the `\verb?!?'
+% Strip the initial segment of the \verb"\meaning", including the `\verb"!"'
 % added earlier.
 %    \begin{macrocode}
 \def\TX at v#1!{\afterassignment\TX at vfirst\let\@tempa= }
@@ -17372,10 +17798,10 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% As explained above we are going to replace \verb?##? pairs by \verb?#?. To do
-% this we need non-special \verb?#? tokens.  Make \verb?*? into a parameter
+% As explained above we are going to replace \verb"##" pairs by \verb"#". To do
+% this we need non-special \verb"#" tokens.  Make \verb"*" into a parameter
 % token so that we can define macros with arguments. The normal meanings
-% will be restored by the \cs{endgroup} later.
+% will be restored by the \verb"\endgroup" later.
 %    \begin{macrocode}
 \begingroup
 \catcode`\*=\catcode`\#
@@ -17384,10 +17810,10 @@
 %
 % \begin{macro}{\TX at vfirst}
 % As a special case, prevent the first character from being dropped.
-% This makes \verb?\verb*| |? produce \verb*? ?. Then call \cs{TX at v@}.
-% This is slightly tricky as I have to ensure that an
-% actual \verb?#? rather than a command \cs{let} to \verb?#? is passed on if the
-% first character is \verb?#?.
+% This makes \verb"\verb*| |" produce \verb*| |. Then call \verb"\TX at v@".
+% This is slightly tricky since v1.04, as I have to ensure that an
+% actual \verb"#" rather than a command \verb"\let" to \verb"#" is passed on if the
+% first character is \verb"#".
 %    \begin{macrocode}
 \gdef\TX at vfirst{%
   \if\@tempa#%
@@ -17401,10 +17827,10 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at v@}
-% Loop through the \cs{meaning}, replacing all spaces by \verb?~?. If the last
-% character is a space it is dropped, so that \verb?\verb*|\LaTeX|? produces
-% \verb?\LaTeX? not \verb*?\LaTeX ?. The rewritten tokens are then further
-% processed to replace \verb?##? pairs.
+% Loop through the \verb"\meaning", replacing all spaces by \verb"~". If the last
+% character is a space it is dropped, so that \verb"\verb*|\LaTeX|" produces
+% \verb"\LaTeX" not \verb*|\LaTeX |. The rewritten tokens are then further
+% processed to replace \verb"##" pairs.
 %    \begin{macrocode}
 \gdef\TX at v@*1 *2{%
   \TX at v@hash*1##\relax\if*2\\\else~\expandafter\TX at v@\fi*2}
@@ -17412,30 +17838,32 @@
 % \end{macro}
 %
 % \begin{macro}{\TX at v@hash}
-% The inner loop, replacing \verb?##? by \verb?#?.
+% The inner loop, replacing \verb"##" by \verb"#".
 %    \begin{macrocode}
 \gdef\TX at v@hash*1##*2{*1\ifx*2\relax\else#\expandafter\TX at v@hash\fi*2}
 %    \end{macrocode}
 % \end{macro}
 %
-% As promised, we now restore the normal meanings of \verb?#? and \verb?*?.
+% As promised, we now restore the normal meanings of \verb"#" and \verb"*".
 %    \begin{macrocode}
 \endgroup
 %    \end{macrocode}
 %
 % \begin{macro}{\TX at vwarn}
-% Warn the user the first time this \cs{verb} is used.
+% Warn the user the first time this \verb"\verb" is used.
 %    \begin{macrocode}
 \def\TX at vwarn{%
   \@warning{\noexpand\verb may be unreliable inside tabularx}%
   \global\let\TX at vwarn\@empty}
-
 %    \end{macrocode}
 % \end{macro}
-%
 %    \begin{macrocode}
-%%%%%%%%%% end Tabularx package code %%%%%%%%%%%%%%%%%%%%%
 
+%%%%%%%%%% end Tabularx package code v2.11 %%%%%%%%%%%%%%%%%%%%%
+
+
+
+
 %    \end{macrocode}
 %
 %    At this point we had better stop anyone trying to load the several
@@ -18761,12 +19189,14 @@
 %
 % \changes{v3.6i}{2011/02/18}{Added this instead of inserting the
 % adjustment code directly into the environment definitions}
+% \changes{v3.7g}{2017/05/08}{Moved into delayed \cs{@xfloat} redef as
+% we need it to run after \cs{normalsize}}
 % \begin{macro}{\@xfloat}
 %   In order to inject adjustment code into the core of the floats we
 %   will need to patch the code float macros a little.
 %    \begin{macrocode}
-\let\mem at old@xfloat\@xfloat
-\def\@xfloat#1[#2]{\mem at old@xfloat{#1}[#2]\@nameuse{#1adjustment}}
+  %\let\mem at old@xfloat\@xfloat
+  %\def\@xfloat#1[#2]{\mem at old@xfloat{#1}[#2]\@nameuse{#1adjustment}}
 %    \end{macrocode}
 %   
 % \end{macro}
@@ -20324,7 +20754,16 @@
 % \begin{macro}{\sf@@memsub at label}
 % This is an expanded copy of \cs{sf@@sub at label} processed after any packages may
 % have been loaded.
+% An added complexity here is when \Lpack{showkeys} is used. It
+% redefines \cs{label} to write it in the margins. But the
+% \cs{sf@@memsub at label} writes the label to aux directly. So in order
+% to support \Lpack{showkeys}, we add a hook, and define this hook if
+% \Lpack{showkeys} is loaded.
+% \changes{v3.7g}{2018/02/28}{Added hook into \cs{sf@@memsub at label},
+% issue reported via \texttt{https://tex.stackexchange.com/q/374301/3929}}
 %    \begin{macrocode}
+\newcommand\sf@@memsub at label@hook[1]{}
+
 \AtBeginDocument{%
   \@ifpackageloaded{nameref}{%
 %    \end{macrocode}
@@ -20332,6 +20771,7 @@
 %    \begin{macrocode}
     \newcommand*{\sf@@memsub at label}[1]{%
       \@bsphack
+      \sf@@memsub at label@hook{#1}%
       \protected at write\@auxout{}{%
         \string\newlabel{#1}%
           {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
@@ -20345,42 +20785,56 @@
           {\mem at currentlabelname\relax}%
           {\@currentHref}{}}}%
   \@esphack}
-  }{\@ifpackageloaded{hyperref}{%
+  }{% no nameref
+    \@ifpackageloaded{hyperref}{%
 %    \end{macrocode}
 % The \Lpack{hyperref} package is loaded, but not \Lpack{nameref}.
 %    \begin{macrocode}
-    \newcommand*{\sf@@memsub at label}[1]{%
-      \@bsphack
-      \protected at write\@auxout{}{%
-        \string\newlabel{#1}%
-          {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
-          {\thepage}%
-          {\mem at currentlabelname\relax}%
-          {\@currentHref}{}}}%
-      \protected at write\@auxout{}{%
-        \string\newlabel{sub@#1}%
-          {{\@nameuse{@@thesub\@captype}}%
-          {\thepage}%
-          {\mem at currentlabelname\relax}%
-          {\@currentHref}{}}}%
-  \@esphack}
-  }{%
+      \newcommand*{\sf@@memsub at label}[1]{%
+        \@bsphack
+        \sf@@memsub at label@hook{#1}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{#1}%
+            {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
+            {\thepage}%
+            {\mem at currentlabelname\relax}%
+            {\@currentHref}{}}}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{sub@#1}%
+            {{\@nameuse{@@thesub\@captype}}%
+            {\thepage}%
+            {\mem at currentlabelname\relax}%
+            {\@currentHref}{}}}%
+    \@esphack}
+    }{% no hyperref
 %    \end{macrocode}
 % Neither the \Lpack{hyperref} nor the \Lpack{nameref}
 % package is loaded.
 %    \begin{macrocode}
-    \let\@memoldlabel\label
-    \newcommand*{\sf@@memsub at label}[1]{%
-      \@bsphack
-      \@memoldlabel{#1}%
-      \protected at write\@auxout{}{%
-        \string\newlabel{sub@#1}%
-          {{\@nameuse{@@thesub\@captype}}%
-          {\thepage}}}%
-  \@esphack}
-  }{}%
-  }
-}
+      \let\@memoldlabel\label
+      \newcommand*{\sf@@memsub at label}[1]{%
+        \@bsphack
+        \sf@@memsub at label@hook{#1}%
+        \@memoldlabel{#1}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{sub@#1}%
+            {{\@nameuse{@@thesub\@captype}}%
+            {\thepage}}}%
+    \@esphack}
+    }{}%
+  }% end no nameref
+%    \end{macrocode}
+% Next add the hook redefinition if \Lpack{showkeys} is loaded. Please
+% note that the placement of the \Lpack{showkeys} label, might be a
+% little strange.
+% \changes{v3.7g}{2018/02/28}{added}
+%    \begin{macrocode}
+  \@ifpackageloaded{showkeys}{%
+    \renewcommand\sf@@memsub at label@hook[1]{%
+      \SK@\SK@@label{#1}%
+    }
+  }{}
+} % end AtBeginDocument
 
 %    \end{macrocode}
 % \end{macro}
@@ -23754,12 +24208,16 @@
 % title. \cs{@memb at bsec} is the much simpler version for a \cs{section} title.
 % \changes{v1.4}{2003/02/27}{Added support code for implementing \cs{bibsection}
 %                            (patch 1.3)}
+% \changes{v3.7g}{2018/02/28}{Removeded \cs{phantomsection} before
+% \cs{addcontentsline} as it is no longer needed, and causes the
+% hyperlink target to the bibligraphy to be below the title, reported
+% via \texttt{https://tex.stackexchange.com/a/396303/3929}}
 %    \begin{macrocode}
 \newcommand{\@memb at bchap}{%
   \chapter*{\bibname}%
   \bibmark
   \ifnobibintoc\else
-    \phantomsection
+    % \phantomsection
     \addcontentsline{toc}{chapter}{\bibname}%
   \fi
   \prebibhook}
@@ -24176,8 +24634,20 @@
       \protected at write\@auxout{}%
         {\string\@@wrindexm at m{\@idxfile}{#1|#2hyperpage}{\thepage}}%
     \else
-      \protected at write\@auxout{}%
-        {\string\@@wrindexm at m{\@idxfile}{#1|#2}{\thepage}}%
+%    \end{macrocode}
+% Add a corresponding test on \verb+|)+ to add \verb|hyperpage|. This
+% is needed by the \verb|xindy| indexing programme. The standard
+% \verb|makeindex| programme does not seem to mind.
+% \changes{v3.7g}{2018/04/04}{Added test for \texttt{|)} and adding
+% \texttt{hyperpage} accordingly.}
+%    \begin{macrocode}
+      \ifx\Hy at temp@A\HyInd at ParenRight
+        \protected at write\@auxout{}%
+          {\string\@@wrindexm at m{\@idxfile}{#1|#2hyperpage}{\thepage}}%
+      \else
+        \protected at write\@auxout{}%
+          {\string\@@wrindexm at m{\@idxfile}{#1|#2}{\thepage}}%
+      \fi        
     \fi
   \fi
   \endgroup
@@ -29297,12 +29767,14 @@
 %   Utility macros to handle page note formating and hyperlinks.
 %   \changes{v3.6k}{2013/05/16}{altered to use four arguments instead of three}
 %   \changes{v3.6k}{2013/05/16}{Added page note anchor}
-% \changes{v3.6k}{2013/05/17}{Forgot about labels in the note text.}
+%   \changes{v3.6k}{2013/05/17}{Forgot about labels in the note text.}
+%   \changes{v3.7g}{2018/01/03}{Added \cs{phantomsection}, otherwise
+%   \cs{label} does not work correctly. Reported in \texttt{https://tex.stackexchange.com/q/408448/3929}}
 %    \begin{macrocode}
 \newcommand\startnoteentrystart[4]{%
   \prenoteinnotes%
   \noteidinnotes{#1}{#2}%
-  \@ifmtarg{#2}{\def\@currentlabel{#1}}{}%
+  \@ifmtarg{#2}{\phantomsection\def\@currentlabel{#1}}{}%
   \pagenoteanchor{#4}%
   \pageinnotes{#3}%
   \prenotetext%
@@ -33096,12 +33568,15 @@
 % it also redefines the \cs{thectr} command so that it typesets values
 % in the style \verb?\thewithin.\arabic{ctr}?. The starred version of the
 % command suppresses the redefinition of \cs{thectr}. 
-%
+% \changes{v3.7g}{2018/03/09}{As of TeXLive 2018 \cs{counterwithin}
+% and \cs{counterwithout} will be moved into the kernel. We therefore
+% change to using \cs{providecommand} instead of \cs{newcommand} to
+% avoid colisions}
 %    \begin{macrocode}
-\newcommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
-\newcommand{\@csinstar}[2]{%
+\providecommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
+\providecommand{\@csinstar}[2]{%
   \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}}}
-\newcommand{\@csin}[2]{%
+\providecommand{\@csin}[2]{%
   \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}%
                         \@namedef{the#1}{\@nameuse{the#2}.\arabic{#1}}}}
 
@@ -33122,11 +33597,15 @@
 % numeral. The starred version of the command suppresses the redefinition
 % of \cs{thectr}.
 % \changes{v1.618}{2005/09/03}{Deleted chngctr from \cs{@csoutstar} (mempatch v3.4)}
+% \changes{v3.7g}{2018/03/09}{As of TeXLive 2018 \cs{counterwithin}
+% and \cs{counterwithout} will be moved into the kernel. We therefore
+% change to using \cs{providecommand} instead of \cs{newcommand} to
+% avoid colisions}
 %    \begin{macrocode}
-\newcommand{\counterwithout}{\@ifstar{\@csoutstar}{\@csout}}
-\newcommand{\@csoutstar}[2]{%
+\providecommand{\counterwithout}{\@ifstar{\@csoutstar}{\@csout}}
+\providecommand{\@csoutstar}[2]{%
   \@ifbothcntrs{#1}{#2}{\@removefromreset{#1}{#2}}}
-\newcommand{\@csout}[2]{%
+\providecommand{\@csout}[2]{%
   \@ifbothcntrs{#1}{#2}{\@removefromreset{#1}{#2}%
                         \@namedef{the#1}{\arabic{#1}}}}
 
@@ -35579,8 +36058,10 @@
 % \changes{v3.6k}{2012/07/19}{Changed the enumated date for the
 % \Lpack{array} package. Apparently the only thing changed between
 % v2.4b (2005) and c (2008) are some copyright years.}
+% \changes{v3.7g}{2018/03/05}{Embedded the latest version of the
+% \Lpack{array} package}
 %    \begin{macrocode}
-\EmulatedPackage{array}[2008/09/09]
+\EmulatedPackage{array}[2016/10/06]
 \EmulatedPackage{booktabs}[2016/05/16]
 \EmulatedPackage{ccaption}[2008/07/23]
 \EmulatedPackage{changepage}[2008/07/23]
@@ -35588,15 +36069,22 @@
 \EmulatedPackage{chngpage}[2008/07/23]
 \EmulatedPackage{crop}
 \EmulatedPackage{dcolumn}[2008/07/23]
-\EmulatedPackage{delarray}[2008/07/23]
+%    \end{macrocode}
+% \changes{v3.7g}{2018/03/06}{Adjusted the date for \Lpack{delarray},
+% the code is the same}
+%    \begin{macrocode}
+\EmulatedPackage{delarray}[2014/10/28]
 \EmulatedPackage{enumerate}[2008/07/23]
 \EmulatedPackage{epigraph}[2008/07/23]
 %%%%%\EmulatedPackage{framed}[2008/07/23]
 \EmulatedPackage{ifmtarg}[2008/07/23]
-\ifm at mifetex\EmulatedPackage{ifetex}[2008/07/23]\fi
-\ifm at mifluatex\EmulatedPackage{ifluatex}[2008/07/23]\fi
-\ifm at mifpdf\EmulatedPackage{ifpdf}[2008/07/23]\fi
-\ifm at mifxetex\EmulatedPackage{ifxetex}[2008/07/23]\fi
+%    \end{macrocode}
+% \changes{v3.7g}{2018/03/08}{Removed if\meta{engine} emulation}
+%    \begin{macrocode}
+ %\ifm at mifetex\EmulatedPackage{ifetex}[2008/07/23]\fi
+ %\ifm at mifluatex\EmulatedPackage{ifluatex}[2008/07/23]\fi
+ %\ifm at mifpdf\EmulatedPackage{ifpdf}[2008/07/23]\fi
+ %\ifm at mifxetex\EmulatedPackage{ifxetex}[2008/07/23]\fi
 \EmulatedPackage{index}[2008/07/23]
 \EmulatedPackage{makeidx}[2008/07/23]
 \EmulatedPackage{moreverb}[2008/07/23]
@@ -35610,7 +36098,10 @@
 \EmulatedPackage{setspace}[2008/07/23]
 \EmulatedPackage{shortvrb}[2008/07/23]
 \EmulatedPackage{showidx}[2008/07/23]
-\EmulatedPackage{tabularx}[2008/07/23]
+%    \end{macrocode}
+% \changes{v3.7g}{2018/03/02}{Updated the embedded version of \Lpack{tabularx} to v2.11 2016/02/03}
+%    \begin{macrocode}
+\EmulatedPackage{tabularx}[2016/02/03]
 \EmulatedPackage{titleref}[2008/07/23]
 \EmulatedPackage{titling}[2008/07/23]
 \EmulatedPackage{tocbibind}[2008/07/23]
@@ -35720,23 +36211,25 @@
 
 %    \end{macrocode}
 %
-% \subsection{Patch file}
-%
-% At the suggestion of Danie Els (\texttt{DanieEls at sun.ac.za}), Dan Leucking
-% (\texttt{luecking at uark.edu}) and others, input a patch file, if one exists,
-% 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)}
-% \changes{v1.61803398}{2009/07/27}{PW: changed call to mempatch, which I think
-%          restores Lars' v1.6180339h change}
-%    \begin{macrocode}
-\IfFileExists{mempatch.sty}{%
-  \RequirePackage{mempatch}}{} 
-
-%    \end{macrocode}
-%
+% ^^A\subsection{Patch file}
+% ^^A
+% ^^A At the suggestion of Danie Els (\texttt{DanieEls at sun.ac.za}), Dan Leucking
+% ^^A (\texttt{luecking at uark.edu}) and others, input a patch file, if one exists,
+% ^^A as the final act. (This is preferable to my series of \file{memfixa.sty},
+% ^^A \file{memfixb.sty} packages, and so on, for each release of the class.)
+% ^^A \changes{v1.3}{2002/11/14}{Added input of mempatch.sty}
+% ^^A \changes{v1.6180339c}{2008/12/26}{Added the two missing arguments when inputting
+% ^^A  mempatch.sty (courtesy of Wilhelm Muller)}
+% ^^A \changes{v1.61803398}{2009/07/27}{PW: changed call to mempatch, which I think
+% ^^A          restores Lars' v1.6180339h change}
+% ^^A \changes{v3.7g}{2018/03/08}{mempatch have been empty for almost
+% ^^A 10years, we will no longer load it.}
+% ^^A    \begin{macrocode}
+% ^^A\IfFileExists{mempatch.sty}{%
+% ^^A  \RequirePackage{mempatch}}{} 
+% ^^A
+% ^^A    \end{macrocode}
+% ^^A
 %    The end of the class definitions.
 %    \begin{macrocode}
 %</class>
@@ -35841,7 +36334,7 @@
 %  \bibitem[Car99]{TABULARX}
 %  David Carlisle.
 %  \newblock \emph{The \Lpack{tabularx} package}.
-%  \newblock January 1999.
+%  \newblock February 2016.
 %  \newblock (Available from CTAN in
 %             \texttt{/macros/latex/required/tools})
 %
@@ -35948,7 +36441,7 @@
 %  Frank Mittelbach and David Carlisle.
 %  \newblock \emph{A new implementation of LaTeX's tabular and array 
 %                  environment}
-%  \newblock May 1998.
+%  \newblock April 2017.
 %  \newblock (Available from CTAN in
 %             \texttt{/macros/latex/required/tools})
 %

Modified: trunk/Master/texmf-dist/source/latex/memoir/memoir.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/memoir/memoir.ins	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/source/latex/memoir/memoir.ins	2018-04-05 21:10:27 UTC (rev 47305)
@@ -31,7 +31,7 @@
   Author: Peter Wilson  (herries dot press at earthlink dot net)
           Herries Press
   Copyright 2001--2011 Peter R. Wilson
-  Copyright 2011--     Lars Madsen
+  Copyright 2013--     Lars Madsen
   Maintainer: Lars Madsen (daleif at math dot au dot dk)
  
 

Modified: trunk/Master/texmf-dist/source/latex/memoir/mempatch.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/memoir/mempatch.dtx	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/source/latex/memoir/mempatch.dtx	2018-04-05 21:10:27 UTC (rev 47305)
@@ -920,6 +920,8 @@
 % At this date, 2008/07/23, with the simultaneous release of memoir v1.6180339 
 % and the patch file, by definition there are no patches.
 %
+% As of 2018, we no longer generate \Lpack{mempatch}.
+% 
 % \subsection{Identification} \label{sec:id}
 %
 % \changes{v2.0}{2004/01/31}{No code in mempatch.sty}

Modified: trunk/Master/texmf-dist/source/latex/memoir/mempatch.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/memoir/mempatch.ins	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/source/latex/memoir/mempatch.ins	2018-04-05 21:10:27 UTC (rev 47305)
@@ -32,6 +32,7 @@
   Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
   Copyright 2001 --- 2010 Peter R. Wilson
   Copyright 2011 --- 2013 Peter R. Wilson
+  Copyright 2013 ---      Lars Madsen
   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 
   This work may be distributed and/or modified under the
@@ -58,7 +59,7 @@
 \Msg{*** Generating the LaTeX2e package files ***}
 
 \generateFile{memhfixc.sty}{t}{\from{mempatch.dtx}{hyper}}
-\generateFile{mempatch.sty}{t}{\from{mempatch.dtx}{patch}}
+%\generateFile{mempatch.sty}{t}{\from{mempatch.dtx}{patch}}
 
 \Msg{***********************************************************}
 \Msg{*}
@@ -67,7 +68,7 @@
 \Msg{* CTAN at /help/uk-tex-faq for more on this.}
 \Msg{*}
 \Msg{* \space\space memhfixc.sty}
-\Msg{* \space\space mempatch.sty}
+%\Msg{* \space\space mempatch.sty}
 \Msg{*}
 \Msg{*}
 \Msg{* To produce the documented source run the files ending with}

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem10.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem10.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem10.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem11.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem11.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem11.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem12.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem12.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem12.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem14.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem14.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem14.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem17.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem17.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem17.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem20.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem20.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem20.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem25.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem25.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem25.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem30.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem30.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem30.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem36.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem36.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem36.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem48.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem48.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem48.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem60.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem60.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem60.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/mem9.clo
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mem9.clo	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mem9.clo	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 

Modified: trunk/Master/texmf-dist/tex/latex/memoir/memhfixc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/memhfixc.sty	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/memhfixc.sty	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,6 +9,7 @@
 %%   Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
 %%   Copyright 2001 --- 2010 Peter R. Wilson
 %%   Copyright 2011 --- 2013 Peter R. Wilson
+%%   Copyright 2013 ---      Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %%   This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/latex/memoir/memoir.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/memoir.cls	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/memoir.cls	2018-04-05 21:10:27 UTC (rev 47305)
@@ -9,7 +9,7 @@
 %%   Author: Peter Wilson  (herries dot press at earthlink dot net)
 %%           Herries Press
 %%   Copyright 2001--2011 Peter R. Wilson
-%%   Copyright 2011--     Lars Madsen
+%%   Copyright 2013--     Lars Madsen
 %%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
 %% 
 %% 
@@ -28,8 +28,8 @@
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{memoir}%
-  [2016/05/16 v3.7f configurable book, report, article document class]
-\newcommand\memversion{v3.7f, 2016/05/16}
+  [2018/04/04 v3.7g configurable book, report, article document class]
+\newcommand\memversion{v3.7g, 2018/04/04}
 \newcommand*{\@ptsize}{}
 \newcommand*{\@memptsize}{}
 \newlength{\onelineskip}
@@ -217,99 +217,11 @@
 \newcommand{\cmd}[1]{\cmdprint{#1}%
   \index{\expandafter\@gobble\string#1?\string\cmdprint{\string#1}}}
 
-\ifx\pdfextension\@undefined\else
-  \RequirePackage{luatex85}
-\fi
+\RequirePackage{ifpdf}[2017/03/15]
+\RequirePackage{ifetex}
+\RequirePackage{ifxetex}[2010/09/12]
+\RequirePackage{ifluatex}[2016/05/16]
 
-\newif\ifm at mifpdf
-  \m at mifpdffalse
-\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    Package `ifpdf' is not installed.\MessageBreak
-    The package is being emulated}%
-\m at mifpdftrue
-\expandafter\newif\csname ifpdf\endcsname
-  \pdffalse
-\ifx\pdfoutput\undefined
-\else
-  \ifx\pdfoutput\@undefined
-  \else
-    \ifx\pdfoutput\relax
-    \else
-      \ifnum\pdfoutput>0\relax
-        \pdftrue
-      \fi
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifpdf}[2008/07/23]
-}
-
-\newif\ifm at mifetex
-  \m at mifetexfalse
-\IfFileExists{ifetex.sty}{\RequirePackage{ifetex}\relax}{%
-  \ClassInfo{memoir}{%
-    An `ifetex' package is being emulated}%
-\m at mifetextrue
-\newif\ifetex
-  \etexfalse
-\ifx\eTeXversion\undefined
-\else
-  \ifx\eTeXversion\@undefined
-  \else
-    \ifx\eTeXversion\relax
-    \else
-      \ifnum\eTeXversion>0\relax
-        \etextrue
-      \fi
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifetex}[2008/07/23]
-}
-
-\newif\ifm at mifxetex
-  \m at mifxetexfalse
-\IfFileExists{ifxetex.sty}{\RequirePackage{ifxetex}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    The `ifxetex' package is not installed.\MessageBreak
-    The package is being emulated}%
-\expandafter\newif\csname ifxetex\endcsname
-\@ifundefined{XeTeXrevision}{\xetexfalse}{\xetextrue}
-\m at mifxetextrue%
-%%\EmulatedPackage{ifxetex}[2008/07/23]
-}
-\ifm at mifxetex%
-\def\RequireXeTeX{%
-  \ifxetex\else
-  \@memerror{XeTeX is required to process this document}%
-            {Try again with xelatex, not (pdf)latex.\MessageBreak
-             Or try removing any XeTeX package(s).}
-  \fi}
-\fi
-
-\newif\ifm at mifluatex
-  \m at mifluatexfalse
-\IfFileExists{ifluatex.sty}{\RequirePackage{ifluatex}\relax}{%
-  \ClassWarningNoLine{memoir}{%
-    The `ifluatex' package is not installed.\MessageBreak
-    The package is being emulated}%
-\m at mifluatextrue
-\expandafter\newif\csname ifluatex\endcsname
-  \luatexfalse
-\ifx\luatexversion\@undefined
-\else
-  \ifx\luatexversion\undefined
-  \else
-    \ifx\luatexversion\relax
-    \else
-      \luatextrue
-    \fi
-  \fi
-\fi
-%%\EmulatedPackage{ifluatex}[2008/07/23]
-}
-
 \edef\wo at dmacro{%
   \string m\string a\string c\string r\string o\string :%
 }
@@ -672,6 +584,9 @@
 \DeclareOption{oldfontcommands}{\@memoldfonttrue}
 \DeclareOption{extrafontsizes}{\extrafontsizestrue}
 
+\newcommand\mem at settopoint[1]{\@settopoint{#1}}
+\DeclareOption{fullptlayout}{\renewcommand\mem at settopoint{\@gobble}}
+
 \newif\ifmem at noetex
   \mem at noetexfalse
 \DeclareOption{noetex}{\mem at noetextrue}
@@ -1034,7 +949,7 @@
     \setlength\textwidth{\@tempdima}
   \fi
 \fi
-\@settopoint\textwidth
+\mem at settopoint\textwidth
 
 \setlength\@tempdima{\paperheight}
   \addtolength\@tempdima{-3.5in}
@@ -1063,8 +978,8 @@
 \ifdim\marginparwidth>2in
   \setlength\marginparwidth{2in}%
 \fi
-\@settopoint\oddsidemargin
-\@settopoint\marginparwidth
+\mem at settopoint\oddsidemargin
+\mem at settopoint\marginparwidth
 \ifdim\marginparwidth<1pt \setlength\marginparwidth{1pt}\fi
 
 \setlength\evensidemargin  {\paperwidth}
@@ -1071,7 +986,7 @@
 \addtolength\evensidemargin{-2in}
 \addtolength\evensidemargin{-\textwidth}
 \addtolength\evensidemargin{-\oddsidemargin}
-\@settopoint\evensidemargin
+\mem at settopoint\evensidemargin
 \setlength\topmargin  {\paperheight}
 \addtolength\topmargin{-2in}
 \addtolength\topmargin{-\headheight}
@@ -1079,7 +994,7 @@
 \addtolength\topmargin{-\textheight}
 \addtolength\topmargin{-\footskip}
 \addtolength\topmargin{-.5\topmargin}
-\@settopoint\topmargin
+\mem at settopoint\topmargin
 
 \setlength{\spinemargin}{\oddsidemargin}
 \addtolength{\spinemargin}{1in}
@@ -1292,9 +1207,9 @@
   \evensidemargin = \trimedge
     \advance\evensidemargin \foremargin
     \advance\evensidemargin -1in\relax
-  \@settopoint\textwidth
-  \@settopoint\oddsidemargin
-  \@settopoint\evensidemargin
+  \mem at settopoint\textwidth
+  \mem at settopoint\oddsidemargin
+  \mem at settopoint\evensidemargin
   \fixheaderwidths
   \memifmacroused\setmarginnotes{}{\mem at autoadjust@marginparwidth}
   \mem at reset@used at macros
@@ -1429,30 +1344,38 @@
   \fixthelayout
   \typeoutlayout}
 
+\newcommand\mem at fixpagelayout{%
+  \@ifundefined{pdfpageheight}{}{\pdfpageheight=\the\stockheight}
+  \@ifundefined{pdfpagewidth}{}{\pdfpagewidth=\the\stockwidth}
+  \@ifundefined{pageheight}{}{\pageheight=\the\stockheight}
+  \@ifundefined{pagewidth}{}{\pagewidth=\the\stockwidth}
+  \@ifundefined{pdfvorigin}{}{\ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi}
+  \@ifundefined{pdfhorigin}{}{\ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi}
+  \ifluatex\else
+    \ifxetex\else
+      \ifpdf\else
+        \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}
+      \fi
+    \fi
+  \fi
+}
+
+\AtBeginDocument{\mem at fixpagelayout}
+
 \newcommand*{\fixpdflayout}{%
-  \pdfpageheight=\the\stockheight
-  \pdfpagewidth=\the\stockwidth
-  \ifxetex\else
-  \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
-  \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
-  \fi}
+  \ClassWarning{memoir}{As of 2018, \string\fixpdflayout\ is no longer used}
+ % \pdfpageheight=\the\stockheight
+ % \pdfpagewidth=\the\stockwidth
+ % \ifxetex\else
+ % \ifdim\pdfvorigin=0pt\pdfvorigin=1in\fi
+ % \ifdim\pdfhorigin=0pt\pdfhorigin=1in\fi
+ % \fi
+}
 \newcommand*{\fixdvipslayout}{%
-  \AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}}
+  \ClassWarning{memoir}{As of 2018, \string\fixdvipslayout\ is no longer used}
+  %\AtBeginDvi{\special{papersize=\the\stockwidth,\the\stockheight}}
+}
 
-\AtBeginDocument{%
-  \ifxetex
-    \fixpdflayout
-  \else
-    \ifpdf
-      \ifnum\pdfoutput<\@ne
-        \fixdvipslayout
-      \else
-        \fixpdflayout
-      \fi
-    \else
-      \fixdvipslayout
-    \fi
-  \fi}
 
 \newcommand{\typeoutstandardlayout}{%
   \typeout{}
@@ -2382,7 +2305,9 @@
   \def\@xfloat #1[#2]{%
     \m at m@xfloat #1[#2]%
     \def\baselinestretch{\m at m@float at spacing}%
-    \normalsize}
+    \normalsize%
+    \@nameuse{#1adjustment}%
+  }
 }
 
 \newdimen\memPD
@@ -2545,6 +2470,12 @@
   \par
   \vskip 1.5em}
 
+\newcommand\titlingpageend[2]{%
+  \def\mem at titlingpage@clear at for@twoside{#1}%
+  \def\mem at titlingpage@clear at for@oneside{#2}%
+}
+ % default
+\titlingpageend{\cleardoublepage}{\clearpage}
 \newenvironment{mem at titlingpage}%
   {\let\footnoterule\relax
    \let\footnotesize\small
@@ -2558,7 +2489,8 @@
   }{%
    \thispagestyle{titlingpage}%
    \if at restonecol \twocolumn \fi
-   \if at twoside \cleardoublepage \else \clearpage \fi
+   % \if at twoside \cleardoublepage \else \clearpage \fi
+   \if at twoside \mem at titlingpage@clear at for@twoside \else \mem at titlingpage@clear at for@oneside \fi
    \if\mem at titlpg@reset\setcounter{page}{\@ne}\fi}
 \newenvironment{titlingpage}{%
   \def\mem at titlpg@reset{00}%
@@ -4624,7 +4556,7 @@
              \advance\labelwidth-\labelsep
              \topsep\topsepii
              \parsep\parsepii
-             \itemsep\parsepii}
+             \itemsep\itemsepii}
 
 \def\@listiii{\leftmargin\leftmarginiii
               \labelwidth\leftmarginiii
@@ -4966,10 +4898,12 @@
 \verselinenumbersright
 
 \newcommand*{\@vslnumright}{%
+  \nobreak%
   \hfill\rlap{%\kern\vrightskip\kern\rightmargin%
               \kern\memRTLvrightskip\kern\rightmargin%
               \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
 \newcommand*{\@vslnumleft}{%
+  \nobreak%
   \hfill\rlap{%\kern-\textwidth\kern-\vrightskip%
               \kern-\textwidth\kern-\memRTLvrightskip%
               \vlvnumfont\getthelinenumber{poemline}{memfvsline}}}
@@ -5329,6 +5263,8 @@
 %%%%%%%%%% With acknowledgements to %%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%% Frank Mittelbach & David Carlisle %%%%%%%%%%%%%%%%%%%%%
 
+%%%%%%%%%% Copy corresponds to array.sty 2016/10/06 v2.4d %%%%%%%%%
+
 \def\@addtopreamble#1{\xdef\@preamble{\@preamble #1}}
 \def\@testpach{\@chclass
  \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
@@ -5343,7 +5279,7 @@
     \if \@nextchar l\@ne \else
      \if \@nextchar r\tw@ \else
    \z@ \@chclass
-   \if\@nextchar |\@ne \else%| emacs
+   \if\@nextchar |\@ne \else
     \if \@nextchar !6 \else
      \if \@nextchar @7 \else
       \if \@nextchar <8 \else
@@ -5355,43 +5291,39 @@
     \if \@nextchar b5 \else
    \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
    \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
+\def\@xexpast#1*#2#3#4\@@{%
+   \@tempcnta #2
+   \toks@={#1}\@temptokena={#3}%
+   \let\the at toksz\relax \let\the at toks\relax
+   \def\@tempa{\the at toksz}%
+   \ifnum\@tempcnta >0 \@whilenum\@tempcnta >0\do
+     {\edef\@tempa{\@tempa\the at toks}\advance \@tempcnta \m at ne}%
+       \let \@tempb \@xexpast \else
+       \let \@tempb \@xexnoop \fi
+   \def\the at toksz{\the\toks@}\def\the at toks{\the\@temptokena}%
+   \edef\@tempa{\@tempa}%
+   \expandafter \@tempb \@tempa #4\@@}
 \def\prepnext at tok{\advance \count@ \@ne
    \toks\count@{}}
-
-\def\save at decl{\toks \count@ = \expandafter\expandafter\expandafter
-                  {\expandafter\@nextchar\the\toks\count@}}
-
+\def\save at decl{\toks\count@ \expandafter{\@nextchar}}
 \def\insert at column{%
    \the at toks \the \@tempcnta
    \ignorespaces \@sharp \unskip
    \the at toks \the \count@ \relax}
-\let\m at mold@addamp\@addamp
-\newcommand*{\m at m@addamp}{%
-  \if at firstamp
-    \@firstampfalse
-    \global\@curtab\@ne
-  \else
-    \@addtopreamble{&}
-    \global\advance\@curtab\@ne
-  \fi}
-\let\@addamp\m at m@addamp
-
 \newdimen\col at sep
 \def\@acol{\@addtopreamble{\hskip\col at sep}}
 \def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
    \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
-   \@temptokena{#1}\@tempswatrue
-   \@whilesw\if at tempswa\fi{\@tempswafalse\the\NC at list}%
+   \@xexpast #1*0x\@@
    \count@\m at ne
    \let\the at toks\relax
    \prepnext at tok
    \expandafter \@tfor \expandafter \@nextchar
-    \expandafter :\expandafter =\the\@temptokena \do
+    \expandafter :\expandafter =\@tempa \do
    {\@testpach
    \ifcase \@chclass \@classz \or \@classi \or \@classii
      \or \save at decl \or \or \@classv \or \@classvi
-     \or \@classvii \or \@classviii
-     \or \@classx
+     \or \@classvii \or \@classviii  \or \@classix
      \or \@classx \fi
    \@lastchclass\@chclass}%
    \ifcase\@lastchclass
@@ -5422,22 +5354,19 @@
       \d at llarend \hfil \or
       \hskip1sp\d at llarbegin \insert at column \d at llarend \hfil \or
       \hfil\hskip1sp\d at llarbegin \insert at column \d at llarend \or
-   $\vcenter%$
-   \@startpbox{\@nextchar}\insert at column \@endpbox $\or%$
+   $\vcenter%$ emacs
+   \@startpbox{\@nextchar}\insert at column \@endpbox $\or%$ emacs
    \vtop \@startpbox{\@nextchar}\insert at column \@endpbox \or
    \vbox \@startpbox{\@nextchar}\insert at column \@endpbox
   \fi}\prepnext at tok}
-
-\let\@classix\relax
-
-\def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
-      \@preamerr 4\@chclass 6 \@classvi \fi\fi}
-
+\def\@classix{\ifnum \@lastchclass = \thr@@
+       \@preamerr \thr@@ \fi
+       \@classx}
+\def\@classviii{\ifnum \@lastchclass >\z@
+      \@preamerr 4\@chclass 6 \@classvi \fi}
 \def\@arrayrule{\@addtopreamble \vline}
-
 \def\@classvii{\ifnum \@lastchclass = \thr@@
    \@preamerr \thr@@ \fi}
-
 \def\@classvi{\ifcase \@lastchclass
       \@acol \or
       \@addtopreamble{\hskip \doublerulesep}\or
@@ -5444,21 +5373,14 @@
       \@acol \or
       \@classvii
       \fi}
-
 \def\@classii{\advance \count@ \m at ne
    \save at decl\prepnext at tok}
-
 \def\@classv{\save at decl
-   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@
    \@addtopreamble{\d at llarbegin\the at toks\the\count@\relax\d at llarend}%
    \prepnext at tok}
-\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
-  \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
-
 \def\@classi{\@classvi
    \ifcase \@chnum \@arrayrule \or
       \@classv \fi}
-
 \def\@startpbox#1{\bgroup
   \setlength\hsize{#1}\@arrayparboxrestore
    \everypar{%
@@ -5487,6 +5409,7 @@
   \baselineskip \z@
   \m at th
   \let\\\@arraycr \let\tabularnewline\\\let\par\@empty \@preamble}
+\def\arraybackslash{\let\\\tabularnewline}
 \newdimen \extrarowheight
 \extrarowheight=0pt
 \def\@arstrut{\unhcopy\@arstrutbox}
@@ -5514,23 +5437,20 @@
 \let\d at llarbegin\begingroup
 \let\d at llarend\endgroup
 \def\array{\col at sep\arraycolsep
-  \def\d at llarbegin{$}\let\d at llarend\d at llarbegin\gdef\@halignto{}%$
+  \def\d at llarbegin{$}\let\d at llarend\d at llarbegin\def\@halignto{}%$ emacs
   \@tabarray}
-\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
-\let\@@array\@array
-\def\tabular{\gdef\@halignto{}\@tabular}
+\def\@tabarray{\@ifnextchar[{\@array}{\@array[c]}}
+\def\tabular{\def\@halignto{}\@tabular}
 \expandafter\def\csname tabular*\endcsname#1{%
        \setlength\dimen@{#1}%
-       \xdef\@halignto{to\the\dimen@}\@tabular}
+       \edef\@halignto{to\the\dimen@}\@tabular}
 \def\@tabular{%
   \leavevmode
-  \hbox \bgroup $\col at sep\tabcolsep \let\d at llarbegin\begingroup%$
+  \hbox \bgroup $\col at sep\tabcolsep \let\d at llarbegin\begingroup% $ emacs
                                     \let\d at llarend\endgroup
   \@tabarray}
-\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
-\let\@arrayleft\@empty
-\let\@arrayright\@empty
-\def\endtabular{\endarray $\egroup}%$
+\def\endarray{\crcr \egroup \egroup \gdef\@preamble{}}
+\def\endtabular{\endarray $\egroup}%$ emacs
 \expandafter\let\csname endtabular*\endcsname=\endtabular
 \let\@ampacol=\relax        \let\@expast=\relax
 \let\@arrayclassiv=\relax   \let\@arrayclassz=\relax
@@ -5539,7 +5459,8 @@
 \let\@tabularcr=\relax      \let\@@endpbox=\relax
 \let\@argtabularcr=\relax   \let\@xtabularcr=\relax
 \def\@preamerr#1{\def\@tempd{{..} at wrong position: }%
-   \ClassError{memoir}{%
+   %\PackageError{array}{%
+   \ClassError{memoir}{% changed in menoir
    \ifcase #1 Illegal pream-token (\@nextchar): `c' used\or %0
     Missing arg: token ignored\or                           %1
     Empty preamble: `l' used\or                             %2
@@ -5546,14 +5467,15 @@
     >\@tempd token ignored\or                               %3
     <\@tempd changed to !{..}\or                            %4
     Only one column-spec. allowed.\fi}\@ehc}                %5
-
 \def\newcolumntype#1{%
   \edef\NC at char{\string#1}%
   \@ifundefined{NC at find@\NC at char}%
-    {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC at char%|emacs
-        \@memwarn{Redefining primitive column \NC at char}\fi}%
+    {\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC at char
+        %\PackageWarning{array}%
+          \@memwarn{Redefining primitive column \NC at char}\fi}% memoir change
      \NC at list\expandafter{\the\NC at list\NC at do#1}}%
-    {\@memwarn{Column \NC at char\space is already defined}}%
+   {%\PackageWarning{array}
+      \@memwarn{Column \NC at char\space is already defined}}% memoir change
   \@namedef{NC at find@\NC at char}##1#1{\NC@{##1}}%
   \@ifnextchar[{\newcol@{\NC at char}}{\newcol@{\NC at char}[0]}}
 \def\newcol@#1[#2]#3{\expandafter\@reargdef
@@ -5581,15 +5503,57 @@
   \count@#1\relax
   \loop
   \ifnum\count@>\z@
-    \advance\count@\m at ne
-    \@temptokena\expandafter{\the\@temptokena#2}%
+  \advance\count@\m at ne
+  \@temptokena\expandafter{\the\@temptokena#2}%
   \repeat
   \NC at find}
-
+\let\@xexpast\relax
+\let\@xexnoop\relax
+\def\save at decl{\toks \count@ = \expandafter\expandafter\expandafter
+                  {\expandafter\@nextchar\the\toks\count@}}
+\def\@mkpream#1{\gdef\@preamble{}\@lastchclass 4 \@firstamptrue
+   \let\@sharp\relax \let\@startpbox\relax \let\@endpbox\relax
+   \@temptokena{#1}\@tempswatrue
+   \@whilesw\if at tempswa\fi{\@tempswafalse\the\NC at list}%
+   \count@\m at ne
+   \let\the at toks\relax
+   \prepnext at tok
+   \expandafter \@tfor \expandafter \@nextchar
+    \expandafter :\expandafter =\the\@temptokena \do
+   {\@testpach
+   \ifcase \@chclass \@classz \or \@classi \or \@classii
+     \or \save at decl \or \or \@classv \or \@classvi
+     \or \@classvii \or \@classviii
+     \or \@classx
+     \or \@classx \fi
+   \@lastchclass\@chclass}%
+   \ifcase\@lastchclass
+   \@acol \or
+   \or
+   \@acol \or
+   \@preamerr \thr@@ \or
+   \@preamerr \tw@ \@addtopreamble\@sharp \or
+   \or
+   \else  \@preamerr \@ne \fi
+   \def\the at toks{\the\toks}}
+\let\@classix\relax
+\def\@classviii{\ifnum \@lastchclass >\z@\ifnum\@lastchclass=\tw@\else
+      \@preamerr 4\@chclass 6 \@classvi \fi\fi}
+\def\@classv{\save at decl
+   \expandafter\NC at ecs\@nextchar\extracolsep{}\extracolsep\@@@
+   \@addtopreamble{\d at llarbegin\the at toks\the\count@\relax\d at llarend}%
+   \prepnext at tok}
+\def\NC at ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}%
+  \ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}
+\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
+\let\@@array\@array
+\def\endarray{\crcr \egroup \egroup \@arrayright \gdef\@preamble{}}
+\let\@arrayleft\@empty
+\let\@arrayright\@empty
 \newlength{\extratabsurround}
 \setlength{\extratabsurround}{2pt}
 \newlength{\backup at length}
-\newcommand{\firsthline}{%
+\newcommand{\firsthline}{%}} emacs
   \multicolumn1c{%
     \global\backup at length\ht\@arstrutbox
     \global\advance\backup at length\dp\@arstrutbox
@@ -5597,7 +5561,7 @@
      \raise\extratabsurround\copy\@arstrutbox
     }\\[-\backup at length]\hline
 }
-\newcommand{\lasthline}{\hline\multicolumn1c{%
+\newcommand{\lasthline}{\hline\multicolumn1c{%}} emacs
     \global\backup at length2\ht\@arstrutbox
     \global\advance\backup at length2\dp\@arstrutbox
     \global\advance\backup at length\arrayrulewidth
@@ -5615,9 +5579,21 @@
                \vskip\doublerulesep
              \fi
       \ifnum0=`{\fi}}
+%%%%%%%%%% end array.sty 2016/10/06 v2.4d %%%%%%%%%
 
-%%%%%%%%%%% end Array package code %%%%%%%%%%%%%%%%%%%%%
+\newif \@iffirstamp
+\let\m at mold@addamp\@addamp
+\newcommand*{\m at m@addamp}{%
+  \if at firstamp
+    \@firstampfalse
+    \global\@curtab\@ne
+  \else
+    \@addtopreamble{&}
+    \global\advance\@curtab\@ne
+  \fi}
+\let\@addamp\m at m@addamp
 
+
 %%%%%%%%%% Dcolumn package code %%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%% With acknowledgements to David Carlisle %%%%%%%%%%%%%%%%%%%%%
 
@@ -5686,6 +5662,12 @@
 %%%%%%%%%% Tabularx package code %%%%%%%%%%%%%%%%%%%%%
 %%%%%%%%%% With acknowledgements to David Carlisle %%%%%%%%%%%%%%%%%%%%%
 
+%%% This is a carbon copy of the tabularx dtx sources for v2.11,
+%%% 2016/02/03 with two changes: error messages mention the class
+%%% instead of tabularx.
+
+%%%%%%%%%% Tabularx package code v2.11 2016/02/03 %%%%%%%%%%%%%%%%%%%%%
+
 \newdimen\TX at col@width
 \newdimen\TX at old@table
 \newdimen\TX at old@col
@@ -5708,8 +5690,28 @@
   \ifx\@tempa\TX@\expandafter\TX at endtabularx
   \else\toks@\expandafter
     {\the\toks@\end{#1}}\expandafter\TX at get@body\fi}
+\long\def\TX at find@endtabularxa
+       #1\endtabularx#2\endtabularx#3\TX at find@endtabularxa{%
+  \ifx\TX@#2\relax\else
+  \toks@\expandafter{\the\toks@#1}%
+  \fi}
+\long\def\TX at find@endtabularxb
+       #1\endtabularx#2\endtabularx#3\TX at find@endtabularxb{%
+  \ifx\TX@#2%
+    \expandafter\@firstoftwo
+  \else
+     \expandafter\@secondoftwo
+  \fi
+  {#1}{#2}}
+\def\TX at find@endtabularxbb{%
+  \expandafter\expandafter\expandafter
+  \TX at find@endtabularxb
+}
 \def\TX@{tabularx}
 \def\TX at endtabularx{%
+   \expandafter\expandafter\expandafter
+     \TX at find@endtabularxa\csname end\TX@\endcsname
+     \endtabularx\TX@\endtabularx\TX at find@endtabularxa
   \expandafter\TX at newcol\expandafter{\tabularxcolumn{\TX at col@width}}%
   \let\verb\TX at verb
   \def\@elt##1{\global\value{##1}\the\value{##1}\relax}%
@@ -5733,9 +5735,19 @@
     \csname endtabular*\endcsname}%
   \global\TX at ftn\expandafter{\expandafter}\the\TX at ftn
   \ifnum0=`{\fi}%
-  \expandafter\end\expandafter{\TX@}}
+   \expandafter\expandafter\expandafter
+   \TX at find@endtabularxbb
+    \expandafter\end\expandafter{\TX@}%
+    \endtabularx\TX@\endtabularx\TX at find@endtabularxb
+}
 \def\TX at arith{%
   \TX at false
+  \@tempdimb\maxdimen
+  \divide\@tempdimb\TX at cols
+  \ifdim\TX at col@width>\@tempdimb
+    \TX at typeout@{Don't exceed \maxdimen}%
+    \wd\@tempboxa\maxdimen
+  \fi
   \ifdim\TX at old@table=\wd\@tempboxa
     \TX at col@width\TX at old@col
     \TX at typeout@{Reached minimum width, backing up.}%
@@ -5751,7 +5763,8 @@
       \divide\dimen@\TX at cols
       \advance\dimen@ -\TX at col@width
       \ifdim \dimen@ >\z@
-        \@memwarn{X Columns too narrow (table too wide)\MessageBreak}%
+        %\PackageWarning{tabularx}%
+         \@memwarn{X Columns too narrow (table too wide)\MessageBreak}% <-- change here
         \TX at col@width\TX at error@width\relax
       \else
         \TX at old@col\TX at col@width
@@ -5795,9 +5808,12 @@
   \ifnum#1<\@m\space\fi
   \ifnum#1<\@M\space\fi
   #1.#2#3#4#5#6#7#8\space\space}
-\def\arraybackslash{\let\\\@arraycr}
+\ifx\arraybackslash\@undefined
+\def\arraybackslash{\let\\\tabularnewline}
+\fi
 \def\tracingtabularx{%
-  \def\TX at typeout{\ClassWarningNoLine{memoir}}%
+  %\def\TX at typeout{\PackageWarningNoLine{tabularx}}%
+  \def\TX at typeout{\ClassWarningNoLine{memoir}}% <--- changed
   \def\TX at typeout@##1{\typeout{(tabularx) ##1}}}
 \let\TX at typeout\@gobble
 \let\TX at typeout@\@gobble
@@ -5836,7 +5852,7 @@
   \@warning{\noexpand\verb may be unreliable inside tabularx}%
   \global\let\TX at vwarn\@empty}
 
-%%%%%%%%%% end Tabularx package code %%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%% end Tabularx package code v2.11 %%%%%%%%%%%%%%%%%%%%%
 
 %%\@memfakeusepackage{array}
 %%\@memfakeusepackage{dcolumn}
@@ -6355,8 +6371,8 @@
   \newenvironment{#2*}{\@dblfloat{#2}}{\end at dblfloat}
 } % end \newfloat
 
-\let\mem at old@xfloat\@xfloat
-\def\@xfloat#1[#2]{\mem at old@xfloat{#1}[#2]\@nameuse{#1adjustment}}
+  %\let\mem at old@xfloat\@xfloat
+  %\def\@xfloat#1[#2]{\mem at old@xfloat{#1}[#2]\@nameuse{#1adjustment}}
 \newcommand*{\setfloatlocations}[2]{\@namedef{fps@#1}{#2}}
 
 \newcommand*\setfloatadjustment[2]{\@namedef{#1adjustment}{#2}}
@@ -6983,10 +6999,13 @@
   \protected at edef\mem at currentlabelname{#1}%
   \sf@@memsub at label{#2}}
 
+\newcommand\sf@@memsub at label@hook[1]{}
+
 \AtBeginDocument{%
   \@ifpackageloaded{nameref}{%
     \newcommand*{\sf@@memsub at label}[1]{%
       \@bsphack
+      \sf@@memsub at label@hook{#1}%
       \protected at write\@auxout{}{%
         \string\newlabel{#1}%
           {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
@@ -7000,35 +7019,43 @@
           {\mem at currentlabelname\relax}%
           {\@currentHref}{}}}%
   \@esphack}
-  }{\@ifpackageloaded{hyperref}{%
-    \newcommand*{\sf@@memsub at label}[1]{%
-      \@bsphack
-      \protected at write\@auxout{}{%
-        \string\newlabel{#1}%
-          {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
-          {\thepage}%
-          {\mem at currentlabelname\relax}%
-          {\@currentHref}{}}}%
-      \protected at write\@auxout{}{%
-        \string\newlabel{sub@#1}%
-          {{\@nameuse{@@thesub\@captype}}%
-          {\thepage}%
-          {\mem at currentlabelname\relax}%
-          {\@currentHref}{}}}%
-  \@esphack}
-  }{%
-    \let\@memoldlabel\label
-    \newcommand*{\sf@@memsub at label}[1]{%
-      \@bsphack
-      \@memoldlabel{#1}%
-      \protected at write\@auxout{}{%
-        \string\newlabel{sub@#1}%
-          {{\@nameuse{@@thesub\@captype}}%
-          {\thepage}}}%
-  \@esphack}
-  }{}%
-  }
-}
+  }{% no nameref
+    \@ifpackageloaded{hyperref}{%
+      \newcommand*{\sf@@memsub at label}[1]{%
+        \@bsphack
+        \sf@@memsub at label@hook{#1}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{#1}%
+            {{\@nameuse{p at sub\@captype}\@nameuse{@@thesub\@captype}}%
+            {\thepage}%
+            {\mem at currentlabelname\relax}%
+            {\@currentHref}{}}}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{sub@#1}%
+            {{\@nameuse{@@thesub\@captype}}%
+            {\thepage}%
+            {\mem at currentlabelname\relax}%
+            {\@currentHref}{}}}%
+    \@esphack}
+    }{% no hyperref
+      \let\@memoldlabel\label
+      \newcommand*{\sf@@memsub at label}[1]{%
+        \@bsphack
+        \sf@@memsub at label@hook{#1}%
+        \@memoldlabel{#1}%
+        \protected at write\@auxout{}{%
+          \string\newlabel{sub@#1}%
+            {{\@nameuse{@@thesub\@captype}}%
+            {\thepage}}}%
+    \@esphack}
+    }{}%
+  }% end no nameref
+  \@ifpackageloaded{showkeys}{%
+    \renewcommand\sf@@memsub at label@hook[1]{%
+      \SK@\SK@@label{#1}%
+    }
+  }{}
+} % end AtBeginDocument
 
 \DeclareRobustCommand{\subcaptionref}{%
   \@ifstar{\ssc at ref}{\sc at ref}}
@@ -8269,7 +8296,7 @@
   \chapter*{\bibname}%
   \bibmark
   \ifnobibintoc\else
-    \phantomsection
+    % \phantomsection
     \addcontentsline{toc}{chapter}{\bibname}%
   \fi
   \prebibhook}
@@ -8403,8 +8430,13 @@
       \protected at write\@auxout{}%
         {\string\@@wrindexm at m{\@idxfile}{#1|#2hyperpage}{\thepage}}%
     \else
-      \protected at write\@auxout{}%
-        {\string\@@wrindexm at m{\@idxfile}{#1|#2}{\thepage}}%
+      \ifx\Hy at temp@A\HyInd at ParenRight
+        \protected at write\@auxout{}%
+          {\string\@@wrindexm at m{\@idxfile}{#1|#2hyperpage}{\thepage}}%
+      \else
+        \protected at write\@auxout{}%
+          {\string\@@wrindexm at m{\@idxfile}{#1|#2}{\thepage}}%
+      \fi
     \fi
   \fi
   \endgroup
@@ -10560,7 +10592,7 @@
 \newcommand\startnoteentrystart[4]{%
   \prenoteinnotes%
   \noteidinnotes{#1}{#2}%
-  \@ifmtarg{#2}{\def\@currentlabel{#1}}{}%
+  \@ifmtarg{#2}{\phantomsection\def\@currentlabel{#1}}{}%
   \pagenoteanchor{#4}%
   \pageinnotes{#3}%
   \prenotetext%
@@ -11873,17 +11905,17 @@
     {% else both counter and within  are defined
      #3}}}
 
-\newcommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
-\newcommand{\@csinstar}[2]{%
+\providecommand{\counterwithin}{\@ifstar{\@csinstar}{\@csin}}
+\providecommand{\@csinstar}[2]{%
   \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}}}
-\newcommand{\@csin}[2]{%
+\providecommand{\@csin}[2]{%
   \@ifbothcntrs{#1}{#2}{\@addtoreset{#1}{#2}%
                         \@namedef{the#1}{\@nameuse{the#2}.\arabic{#1}}}}
 
-\newcommand{\counterwithout}{\@ifstar{\@csoutstar}{\@csout}}
-\newcommand{\@csoutstar}[2]{%
+\providecommand{\counterwithout}{\@ifstar{\@csoutstar}{\@csout}}
+\providecommand{\@csoutstar}[2]{%
   \@ifbothcntrs{#1}{#2}{\@removefromreset{#1}{#2}}}
-\newcommand{\@csout}[2]{%
+\providecommand{\@csout}[2]{%
   \@ifbothcntrs{#1}{#2}{\@removefromreset{#1}{#2}%
                         \@namedef{the#1}{\arabic{#1}}}}
 
@@ -12968,7 +13000,7 @@
 
 \EmulatedPackage{abstract}[2008/07/23]
 \EmulatedPackage{appendix}[2008/07/23]
-\EmulatedPackage{array}[2008/09/09]
+\EmulatedPackage{array}[2016/10/06]
 \EmulatedPackage{booktabs}[2016/05/16]
 \EmulatedPackage{ccaption}[2008/07/23]
 \EmulatedPackage{changepage}[2008/07/23]
@@ -12976,15 +13008,15 @@
 \EmulatedPackage{chngpage}[2008/07/23]
 \EmulatedPackage{crop}
 \EmulatedPackage{dcolumn}[2008/07/23]
-\EmulatedPackage{delarray}[2008/07/23]
+\EmulatedPackage{delarray}[2014/10/28]
 \EmulatedPackage{enumerate}[2008/07/23]
 \EmulatedPackage{epigraph}[2008/07/23]
 %%%%%\EmulatedPackage{framed}[2008/07/23]
 \EmulatedPackage{ifmtarg}[2008/07/23]
-\ifm at mifetex\EmulatedPackage{ifetex}[2008/07/23]\fi
-\ifm at mifluatex\EmulatedPackage{ifluatex}[2008/07/23]\fi
-\ifm at mifpdf\EmulatedPackage{ifpdf}[2008/07/23]\fi
-\ifm at mifxetex\EmulatedPackage{ifxetex}[2008/07/23]\fi
+ %\ifm at mifetex\EmulatedPackage{ifetex}[2008/07/23]\fi
+ %\ifm at mifluatex\EmulatedPackage{ifluatex}[2008/07/23]\fi
+ %\ifm at mifpdf\EmulatedPackage{ifpdf}[2008/07/23]\fi
+ %\ifm at mifxetex\EmulatedPackage{ifxetex}[2008/07/23]\fi
 \EmulatedPackage{index}[2008/07/23]
 \EmulatedPackage{makeidx}[2008/07/23]
 \EmulatedPackage{moreverb}[2008/07/23]
@@ -12998,7 +13030,7 @@
 \EmulatedPackage{setspace}[2008/07/23]
 \EmulatedPackage{shortvrb}[2008/07/23]
 \EmulatedPackage{showidx}[2008/07/23]
-\EmulatedPackage{tabularx}[2008/07/23]
+\EmulatedPackage{tabularx}[2016/02/03]
 \EmulatedPackage{titleref}[2008/07/23]
 \EmulatedPackage{titling}[2008/07/23]
 \EmulatedPackage{tocbibind}[2008/07/23]
@@ -13060,9 +13092,6 @@
 
 \AtBeginPackage{float}{\let\newfloat\relax}
 
-\IfFileExists{mempatch.sty}{%
-  \RequirePackage{mempatch}}{}
-
 \endinput
 %%
 %% End of file `memoir.cls'.

Deleted: trunk/Master/texmf-dist/tex/latex/memoir/mempatch.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/memoir/mempatch.sty	2018-04-05 21:10:09 UTC (rev 47304)
+++ trunk/Master/texmf-dist/tex/latex/memoir/mempatch.sty	2018-04-05 21:10:27 UTC (rev 47305)
@@ -1,38 +0,0 @@
-%%
-%% This is file `mempatch.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% mempatch.dtx  (with options: `patch')
-%% 
-%%   Author: Peter Wilson (Herries Press) herries dot press at earthlink dot net
-%%   Copyright 2001 --- 2010 Peter R. Wilson
-%%   Copyright 2011 --- 2013 Peter R. Wilson
-%%   Maintainer: Lars Madsen (daleif at math dot au dot dk)
-%% 
-%%   This work may be distributed and/or modified under the
-%%   conditions of the LaTeX Project Public License, either
-%%   version 1.3 of this license or (at your option) any
-%%   later version.
-%%   The latest version of the license is in
-%%      http://www.latex-project.org/lppl.txt
-%%   and version 1.3 or later is part of all distributions of
-%%   LaTeX version 2003/06/01 or later.
-%% 
-%%   This work has the LPPL maintenance status "maintained".
-%% 
-%%   This work consists of the files listed in the README file.
-%% 
-\ProvidesPackage{mempatch}[2009/07/24 v6.0f Patches for memoir class v1.6180339]
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%   Version 6.0 was released simultaneously with version 1.6180339
-%%% of memoir.
-%%% By definition there were no patches.
-%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-\endinput
-%%
-%% End of file `mempatch.sty'.



More information about the tex-live-commits mailing list