[latex3-commits] [git/LaTeX3-latex3-latex2e] doc-v3beta: add doc-v3beta (31aee947)

Frank Mittelbach frank.mittelbach at latex-project.org
Sun Feb 7 00:18:01 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : doc-v3beta
Link       : https://github.com/latex3/latex2e/commit/31aee947ed9b0444369e0e986fccca74dc7f11fc

>---------------------------------------------------------------

commit 31aee947ed9b0444369e0e986fccca74dc7f11fc
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sun Feb 7 00:18:01 2021 +0100

    add doc-v3beta


>---------------------------------------------------------------

31aee947ed9b0444369e0e986fccca74dc7f11fc
 base/build.lua       |    1 +
 base/doc-v3beta.sty  | 1238 ++++++++++++++++++++++++++++++++++++++++++++++++++
 base/ltxdoc.dtx      |    2 +-
 base/source2edoc.cls |    3 +
 4 files changed, 1243 insertions(+), 1 deletion(-)

diff --git a/base/build.lua b/base/build.lua
index 77e9dcde..f34cfc33 100644
--- a/base/build.lua
+++ b/base/build.lua
@@ -52,6 +52,7 @@ sourcefiles    =
     "sample2e.tex",
     "small2e.tex",
     "testpage.tex",
+    "doc-v3beta.sty",         -- temp
     "source2edoc.cls",        -- temp
      "*-????-??-??.sty"
   }
diff --git a/base/doc-v3beta.sty b/base/doc-v3beta.sty
new file mode 100644
index 00000000..2158fd0d
--- /dev/null
+++ b/base/doc-v3beta.sty
@@ -0,0 +1,1238 @@
+%%
+%% This is file `doc-v3beta.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% doc.dtx  (with options: `package,beta')
+%% 
+%% This is a generated file.
+%% 
+%% The source is maintained by the LaTeX Project team and bug
+%% reports for it can be opened at https://latex-project.org/bugs.html
+%% (but please observe conditions on bug reports sent to that address!)
+%% 
+%% 
+%% Copyright 1993-2018
+%% The LaTeX3 Project and any individual authors listed elsewhere
+%% in this file.
+%% 
+%% This file was generated from file(s) of the LaTeX base system.
+%% --------------------------------------------------------------
+%% 
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%    https://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%% 
+%% This file has the LPPL maintenance status "maintained".
+%% 
+%% This file may only be distributed together with a copy of the LaTeX
+%% base system. You may however distribute the LaTeX base system without
+%% such generated files.
+%% 
+%% The list of all files belonging to the LaTeX base distribution is
+%% given in the file `manifest.txt'. See also `legal.txt' for additional
+%% information.
+%% 
+%% The list of derived (unpacked) files belonging to the distribution
+%% and covered by LPPL is defined by the unpacking scripts (with
+%% extension .ins) which are part of the distribution.
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+
+\providecommand\DeclareRelease[3]{}
+\providecommand\DeclareCurrentRelease[2]{}
+
+\DeclareRelease{v2}{2016-02-15.sty}
+               {doc-2016-02-15.sty}
+\DeclareCurrentRelease{v3}{2018-04-16}
+
+\ProvidesPackage{doc-v3beta}
+  [2021/02/05 v3.0c
+   Standard LaTeX documentation package V3 (FMi)]
+%%
+%% Package `doc' to use with LaTeX 2e
+%% Copyright (C) 1989-2018 Frank Mittelbach, all rights reserved.
+
+
+
+
+
+\@ifundefined{macro at cnt}{}{\endinput}
+\catcode`\^^A=14
+\AtBeginDocument{\catcode`\^^A=14\relax}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{family=doc,prefix=doc@}
+\DeclareBoolOption{noprint}
+\DeclareBoolOption{noindex}
+\DeclareBoolOption[true]{hyperref}
+\DeclareBoolOption[true]{multicol}
+\DeclareBoolOption[false]{debugshow}
+\DeclareBoolOption[true]{toplevel}
+\DeclareComplementaryOption{notoplevel}{toplevel}
+\DeclareBoolOption{macrolike}
+\DeclareComplementaryOption{envlike}{macrolike}
+\DeclareStringOption{idxtype}
+\DeclareStringOption{idxgroup}
+\DeclareStringOption{printtype}
+\ProcessKeyvalOptions*
+\newif\ifscan at allowed    \scan at allowedtrue
+\def\SetupDoc#1{%
+  \setkeys{doc}{#1}%
+    \edef\doc at noprintdefault{\ifdoc at noprint true\else false\fi}%
+  \ifdoc at noindex
+    \def\doc at noindexdefault{true}%
+    \scan at allowedfalse
+  \else
+    \def\doc at noindexdefault{false}%
+  \fi
+}
+\SetupDoc{}              % just save the default values
+\def\macrocode{\macro at code
+   \frenchspacing \@vobeyspaces
+   \xmacro at code}
+\def\macro at code{%
+   \topsep \MacrocodeTopsep
+   \@beginparpenalty \predisplaypenalty
+   \if at inlabel\leavevmode\fi
+   \trivlist \parskip \z@ \item[]%
+   \macro at font
+   \leftskip\@totalleftmargin \advance\leftskip\MacroIndent
+   \rightskip\z@ \parindent\z@ \parfillskip\@flushglue
+   \blank at linefalse \def\par{\ifblank at line
+                             \leavevmode\fi
+                             \blank at linetrue\@@par
+                             \penalty\interlinepenalty}
+   \obeylines
+   \let\do\do at noligs \verbatim at nolig@list
+   \let\do\@makeother \dospecials
+   \global\@newlistfalse
+   \global\@minipagefalse
+   \ifcodeline at index
+     \everypar{\global\advance\c at CodelineNo\@ne
+               \llap{\theCodelineNo\ \hskip\@totalleftmargin}%
+               \check at module}%
+   \else \everypar{\check at module}%
+   \fi
+   \init at crossref}
+\newif\ifblank at line
+\def\endmacrocode{%
+                 \ifpm at module \endgroup \pm at modulefalse \fi
+                 \everypar{}%
+                 \global\@inlabelfalse
+                 \endtrivlist
+                 \close at crossref}
+\@ifundefined{MacroFont}{%
+  \if at compatibility
+    \def\MacroFont{\small
+                   \usefont\encodingdefault
+                           \ttdefault
+                           \mddefault
+                           \updefault
+                   }%
+  \else
+    \def\MacroFont{\fontencoding\encodingdefault
+                   \fontfamily\ttdefault
+                   \fontseries\mddefault
+                   \fontshape\updefault
+                   \small}%
+  \fi
+  }{}
+\@ifundefined{AltMacroFont}{%
+  \if at compatibility
+    \def\AltMacroFont{\small
+                      \usefont\encodingdefault
+                              \ttdefault
+                              \mddefault
+                              \sldefault
+                      }%
+  \else
+    \def\AltMacroFont{\fontencoding\encodingdefault
+                      \fontfamily\ttdefault
+                      \fontseries\mddefault
+                      \fontshape\sldefault
+                      \small
+                      }%
+ \fi
+  }{}
+\AtBeginDocument{\let\macro at font\MacroFont}
+\def\check at module{%
+  \ifcheck at modules
+    \ifpm at module \endgroup \pm at modulefalse \fi
+    \expandafter\futurelet\expandafter\next\expandafter\ch at percent
+  \fi}
+\newif\ifpm at module
+\def\DontCheckModules{\check at modulesfalse}
+\def\CheckModules{\check at modulestrue}
+\newif\ifcheck at modules  \check at modulestrue
+\def\ch at percent{%
+  \if \percentchar\next
+    \expandafter\check at angle
+  \fi}
+\def\check at angle#1{\futurelet\next\ch at angle}
+\begingroup
+\catcode`\<\active
+\gdef\ch at angle{\ifx<\next
+    \expandafter\ch at plus@etc
+  \else \percentchar \fi}
+\gdef\ch at plus@etc<{\futurelet\next\check at plus@etc}
+\gdef\check at plus@etc{%
+    \if +\next
+      \let\next\pm at module
+    \else\if -\next
+      \let\next\pm at module
+    \else\if *\next
+      \let\next\star at module
+    \else\if /\next
+      \let\next\slash at module
+    \else\ifx <\next
+      \percentchar
+    \else
+      \let\next\pm at module
+    \fi\fi\fi\fi\fi
+    \next}
+\endgroup
+\begingroup
+\catcode`\~=\active
+\lccode`\~=`\>
+\lowercase{\gdef\pm at module#1~}{\pm at moduletrue
+   \Module{#1}\begingroup
+     \advance\guard at level\@ne
+     \ifnum\guard at level>\c at StandardModuleDepth\AltMacroFont\fi
+}
+\lowercase{\gdef\star at module#1~}{%
+  \Module{#1}%
+  \global \advance \guard at level\@ne
+  \ifnum \guard at level>\c at StandardModuleDepth
+    \global\let\macro at font=\AltMacroFont \macro at font
+  \fi}
+\catcode`\>=\active
+\gdef\slash at module#1>{%
+  \Module{#1}%
+  \global \advance \guard at level\m at ne
+  \ifnum \guard at level=\c at StandardModuleDepth
+    \global\let\macro at font\MacroFont  \macro at font
+  \fi
+}
+\endgroup
+\newcounter{StandardModuleDepth}
+\newcount \guard at level
+
+\@ifundefined{Module}{%
+      \def\Module#1{\mod at math@codes$\langle\mathsf{#1}\rangle$}
+  }{}
+\def\mod at math@codes{\mathcode`\|="226A \mathcode`\&="2026
+                    \mathcode`\-="702D \mathcode`\+="702B
+                    \mathcode`\:="703A \mathcode`\=="703D }
+\newskip\MacrocodeTopsep \MacrocodeTopsep = 3pt plus 1.2pt minus 1pt
+\newdimen\MacroIndent
+\settowidth\MacroIndent{\rmfamily\scriptsize 00\ }
+\@namedef{macrocode*}{\macro at code\sxmacro at code}
+\expandafter\let\csname endmacrocode*\endcsname = \endmacrocode
+\catcode`\!=\catcode`\%   ^^A In this section there must not be
+                              ^^A any exclamation marks.
+                              ^^A
+\begingroup
+\catcode`\|=\z@ \catcode`\[=\@ne \catcode`\]=\tw@
+\catcode`\{=12 \catcode`\}=12
+\catcode`\%=12 \catcode`\ =\active \catcode`\\=\active
+!%    \end{macrocode*}
+!    Next follows the actual definition of  |\macro at code|;
+!    notice the
+!    use of the new escape character.  We manage to get the argument
+!    surrounded by the string |\end{macrocode}|, but at the end
+!    however, in spite of the actual characters used during the
+!    definition of
+!    this macro, |\end| with the argument |{macrocode}|
+!    will be executed, to ensure a balanced environment.
+!    \begin{macrocode*}
+|gdef|xmacro at code#1%    \end{macrocode}[#1|end[macrocode]]
+!%    \end{macrocode*}
+! \begin{macro}{\sxmacro at code}
+!    The definition of |\sxmacro at code| is completely analogous,
+!    only
+!    here a slightly different terminating string will be used.
+!    Note that the space is not active in this environment.
+!    \begin{macrocode}
+|catcode`| =12
+|gdef|sxmacro at code#1%    \end{macrocode*}[#1|end[macrocode*]]
+!%    \end{macrocode}
+!    because the |\catcode| changes have been made local by
+!    commencing a
+!    new group, there now follows the matching |\endgroup|
+!    in a rather
+!    unusual style of writing.
+!    \begin{macrocode}
+|endgroup
+!%    \end{macrocode}
+\catcode`\!=12
+
+\reversemarginpar
+\setlength\marginparpush{0pt}  \setlength\marginparwidth{8pc}
+\setlength\marginparsep{\labelsep}
+{\catcode`\|=\z@ \catcode`\\=12
+|gdef|bslash{\}}
+\def\verbatim{\@beginparpenalty \predisplaypenalty \@verbatim
+              \MacroFont \frenchspacing \@vobeyspaces \@xverbatim}
+\@namedef{verbatim*}{\@beginparpenalty \predisplaypenalty \@verbatim
+              \MacroFont \@sxverbatim}
+\def\@verbatim{\trivlist \item[]\if at minipage\else\vskip\parskip\fi
+      \leftskip\@totalleftmargin\rightskip\z@
+      \parindent\z@\parfillskip\@flushglue\parskip\z@
+      \@@par
+      \@tempswafalse
+ \def\par{\if at tempswa\hbox{}\fi\@tempswatrue\@@par
+          \penalty\interlinepenalty
+   \check at percent}%
+ \obeylines
+ \let\do\do at noligs \verbatim at nolig@list
+ \let\do\@makeother \dospecials}
+{\catcode`\%=12
+ \long\gdef\check at percent#1{\ifx #1%\let\next\@empty \else
+                                    \let\next=#1\fi \next}}
+\def\verb{\relax\ifmmode\hbox\else\leavevmode\null\fi
+  \bgroup \let\do\do at noligs \verbatim at nolig@list
+    \ttfamily \verb at eol@error \let\do\@makeother \dospecials
+    \@ifstar{\@sverb}{\@vobeyspaces \frenchspacing \@sverb}}
+\let\verb at balance@group\@empty
+
+\def\verb at egroup{\global\let\verb at balance@group\@empty\egroup}
+
+\begingroup
+  \obeylines%
+  \gdef\verb at eol@error{\obeylines%
+    \def^^M{\verb at egroup\@latex at error{%
+           Text for \noexpand\verb command ended by end of line}\@ehc}}%
+\endgroup
+\def\@sverb#1{%
+  \catcode`#1\active  \lccode`\~`#1%
+  \gdef\verb at balance@group{\verb at egroup
+     \@latex at error{Illegal use of \noexpand\verb command}\@ehc}%
+  \aftergroup\verb at balance@group
+  \lowercase{\let~\verb at egroup}}
+\def\verbatim at nolig@list{\do\`\do\<\do\>\do\,\do\'\do\-}
+\def\do at noligs#1{%
+  \catcode`#1\active
+  \begingroup
+     \lccode`\~=`#1\relax
+     \lowercase{\endgroup\def~{\leavevmode\kern\z@\char`#1}}}
+\newcount\macro at cnt \macro at cnt=0
+\newskip\MacroTopsep     \MacroTopsep = 7pt plus 2pt minus 2pt
+\begingroup
+\catcode`\~\active
+\gdef\SpecialEscapechar#1{%
+    \begingroup
+     \uccode`\~`#1%
+     \uppercase{\gdef\active at escape@char{~}}%
+     \escapechar\m at ne  \xdef\special at escape@char{\string#1}%
+   \endgroup}
+\endgroup
+\begingroup   \catcode`\|=\z@  \catcode`\\=\active
+|gdef|init at crossref{|catcode`|\|active   |let\|bslash
+    |MakePrivateLetters
+    |catcode|expandafter`|special at escape@char|active
+    |expandafter|let|active at escape@char|scan at macro}
+|endgroup
+\SpecialEscapechar{\\}
+\@ifundefined{MakePrivateLetters}
+    {\let\MakePrivateLetters\makeatletter}{}
+\def\close at crossref{\SpecialEscapechar\\}
+\def\scan at macro{%
+   \special at escape@char
+   \step at checksum
+   \ifscan at allowed
+      \let\macro at namepart\@empty
+      \def\next{\futurelet\next\macro at switch}%
+   \else \let\next\@empty \fi
+   \next}
+\def\DisableCrossrefs{\@bsphack\scan at allowedfalse\@esphack}
+\def\EnableCrossrefs{\@bsphack\scan at allowedtrue
+                     \def\DisableCrossrefs{\@bsphack\@esphack}\@esphack}
+\def\macro at switch{\ifcat\noexpand\next a%
+     \let\next\macro at name
+     \else \let\next\short at macro  \fi
+   \next}
+\begingroup
+\catcode`\&=12
+\gdef\short at macro#1{\begingroup
+   \uccode`\&=\expandafter`\string#1%
+   \uppercase{\def\x{\def\macro at namepart{&}}}%
+   \expandafter\endgroup\x
+     \maybe at index@short at macro\macro at namepart
+    \scan at allowedfalse#1%
+    \scan at allowedtrue }
+\endgroup
+\def\macro at name#1{\edef\macro at namepart{\macro at namepart#1}%
+     \futurelet\next\more at macroname}
+\def\more at macroname{\ifcat\noexpand\next a%
+     \let\next\macro at name
+     \else \let\next\macro at finish \fi
+     \next}
+\def\macro at finish{%
+  \macro at namepart
+  \maybe at index@macro \macro at namepart
+}
+
+\RequirePackage{expl3}
+\ExplSyntaxOn
+\seq_new:N  \l__doc_donotindex_seq
+\prop_new:N \g__doc_idxtype_prop
+\cs_new:Npn\__doc_trace:x {
+  \ifdoc at debugshow
+    \expandafter \iow_term:x
+  \else
+    \expandafter \use_none:n
+  \fi
+}
+\cs_new:Npn \doc_dont_index:n {
+  \group_begin:
+    \MakePrivateLetters
+    \__doc_dont_index:n
+}
+\cs_new:Npn \__doc_dont_index:n #1 {
+  \group_end:
+  \__doc_trace:x{Disable~ indexing~ for~ '\exp_not:n{#1}' }
+  \clist_map_function:nN {#1} \__doc_dont_index:N
+}
+\cs_new:Npn \__doc_dont_index:N #1 {
+  \seq_put_right:Nx \l__doc_donotindex_seq {\cs_to_str:N #1}
+}
+\cs_set_eq:NN \DoNotIndex \doc_dont_index:n
+\def \ShowIndexingState {
+  \__doc_trace:x{Show~ doc~ indexing~ state:}
+  \seq_show:N  \l__doc_donotindex_seq
+  \prop_show:N \g__doc_idxtype_prop
+}
+
+\cs_new:Npn \__doc_idxtype_put:Nn #1#2 {
+  \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2}
+  \protected at write\@auxout{}
+     {\string\RecordIndexTypeAux {\string#1 }{#2} }
+}
+\cs_new:Npn \RecordIndexTypeAux #1#2 {
+  \exp_args:Nx \__doc_idxtype_put:nn { \cs_to_str:N #1 }{#2}
+}
+\AtEndDocument{
+  \cs_set_eq:NN \RecordIndexTypeAux \use_none:nn
+}
+\cs_set_eq:NN \RecordIndexType \__doc_idxtype_put:Nn
+\cs_new:Npn \__doc_idxtype_put_scan:nn #1#2 {
+  \exp_args:Nf \__doc_idxtype_put:nn { \tl_to_str:n {#1} }{#2}
+  \protected at write\@auxout{}
+     {\string\RecordIndexTypeAux {\bslash #1 }{#2} }
+}
+\cs_generate_variant:Nn \__doc_idxtype_put_scan:nn {o}
+\cs_set_eq:NN \record at index@type at save \__doc_idxtype_put_scan:on
+\cs_new:Npn \__doc_idxtype_put:nn #1#2 {
+  \exp_args:NNf
+  \seq_if_in:NnTF \l__doc_donotindex_seq {\tl_to_str:n{#1}}
+     {
+       \__doc_trace:x{Not~ recording~ index~ type~ for~ '\bslash #1' }
+     }
+     {
+       \__doc_trace:x{Recording~ index~ type~ for~ '\bslash #1' ~ as~ #2 }
+       \prop_gput:Nnn \g__doc_idxtype_prop {#1}{#2}
+     }
+}
+\cs_new:Npn \exp_args:co #1#2
+   { \cs:w #1 \exp_after:wN \cs_end:\exp_after:wN {#2} }
+\cs_generate_variant:Nn \tl_to_str:n {o}
+
+\cs_new:Npn \__doc_maybe_index:o #1 {
+  \exp_args:Nf \__doc_maybe_index_aux:nN { \tl_to_str:o {#1} }
+                                         \SpecialIndex
+}
+\cs_set_eq:NN \maybe at index@macro \__doc_maybe_index:o
+\cs_new:Npn \__doc_maybe_index_short:o #1 {
+  \exp_args:Nf \__doc_maybe_index_aux:nN { \tl_to_str:o {#1} }
+                                         \SpecialShortIndex
+}
+\cs_set_eq:NN \maybe at index@short at macro \__doc_maybe_index_short:o
+\cs_new:Npn \__doc_maybe_index_aux:nN #1#2 {
+  \__doc_trace:x{Searching~ for~ '\bslash #1'}
+  \seq_if_in:NnTF \l__doc_donotindex_seq {#1}
+    {
+     \__doc_trace:x{Not~ indexing~ '\bslash #1' }
+    }
+    {
+     \prop_get:NnNTF \g__doc_idxtype_prop {#1} \l__doc_idxtype_tl
+       {
+        \exp_args:Ncno \__doc_maybe_index_aux:Nnn
+              { Code \tl_use:N \l__doc_idxtype_tl Index }
+              {code} {\bslash #1}
+        }
+        {
+          \__doc_trace:x{Indexing~ '\bslash #1'\space (\string #2)}
+          \exp_args:No #2 {\bslash #1}
+        }
+    }
+}
+\cs_new:Npn \SpecialShortIndex #1 {
+    \@SpecialIndexHelper@ #1\@nil
+  \@bsphack
+  \ifdoc at noindex \else
+    \str_case_e:nnF {\@gtempa }
+        {
+          {\cs_to_str:N \^^M } {\def\reserved at a{ \string \space \actualchar }
+                                \def\reserved at b { \space }
+                                \let\reserved at c \@empty                          }
+          { }                  {\def\reserved at a{ \string \space \actualchar }
+                                \def\reserved at b { \space }
+                                \let\reserved at c \@empty                          }
+          {\c_left_brace_str} { \def\reserved at a{ \bgroup \actualchar }
+                                \def\reserved at b { \c_left_brace_str }
+                                \def\reserved at c { \noexpand\iffalse
+                                                  \c_right_brace_str
+                                                  \noexpand\fi }                 }
+          {\c_right_brace_str} { \def\reserved at a{ \egroup \actualchar
+                                                  \noexpand\iffalse
+                                                    \c_left_brace_str
+                                                  \noexpand\fi }
+                                 \def\reserved at b { \c_right_brace_str }
+                                 \let\reserved at c \@empty                         }
+          {\verbatimchar}  { \def\reserved at a{ \quotechar\verbatimchar
+                                              \actualchar }
+                             \let\reserved at b \@empty
+                             \def\reserved at c
+                                 { \string\texttt{\string\string\verbatimchar} } }
+        }
+        { \def\reserved at a {\quotechar \@gtempa \actualchar }
+          \def\reserved at b {\quotechar \@gtempa  }
+          \let\reserved at c \@empty                             }
+    \special at index {
+    \reserved at a
+    \string\verb
+    \quotechar *\verbatimchar \quotechar \bslash
+    \reserved at b
+    \verbatimchar
+    \reserved at c
+    \encapchar code}
+  \fi
+  \@esphack
+}
+
+\cs_new:Npn \__doc_maybe_index_aux:Nnn #1#2#3 {
+    \cs_if_exist:NTF #1
+      {
+        \__doc_trace:x{Indexing~ '#3'\space as~
+                       \tl_use:N \l__doc_idxtype_tl }
+        #1{#2}{#3}
+      }
+      {
+        \PackageError{doc}{Doc~ element~
+           '\tl_use:N \l__doc_idxtype_tl'~ unknown}%
+
+          {When~ using~ '\string\RecordIndexType'~ the~ type~ must~
+           be~ known~\MessageBreak
+           to~ the~ system,~ i.e.,~ declared~ via~
+           '\string\NewDocElement'\MessageBreak
+           before~ it~ can~ be~ used~ in~ indexing.}
+     }
+}
+\ExplSyntaxOff
+\@ifundefined{actualchar}{\def\actualchar{=}}{}
+\@ifundefined{quotechar}{\def\quotechar{!}}{}
+\@ifundefined{levelchar}{\def\levelchar{>}}{}
+\@ifundefined{encapchar}{\def\encapchar{|}}{}
+\@ifundefined{verbatimchar}{\def\verbatimchar{+}}{}
+\begingroup
+ \catcode`\|=0
+ \catcode`\\=12
+ |gdef|@SpecialIndexHelper@#1#2|@nil{%
+   |if |noexpand#1\%
+     |gdef|@gtempa{#2}%
+   |else
+     |begingroup
+       |escapechar|m at ne
+       |expandafter|gdef|expandafter|@gtempa|expandafter{|string#1#2}%
+     |endgroup
+   |fi}
+|endgroup
+\def\SortIndex#1#2{%
+  \ifdoc at noindex\else
+    \index{#1\actualchar#2}%
+  \fi
+}
+\@ifundefined{LeftBraceIndex}{\def\LeftBraceIndex{%
+   \special at index{\bgroup\actualchar
+                  \string\verb% % to fool emacs highlighting
+                  \quotechar*\verbatimchar
+                  \quotechar\bslash{\verbatimchar\string\iffalse}\string\fi}}}{}
+
+\@ifundefined{RightBraceIndex}{\def\RightBraceIndex{%
+ \special at index{\egroup\actualchar\string\iffalse{\string\fi
+           \string\verb% % to fool emacs highlighting
+           \quotechar*\verbatimchar\quotechar\bslash}\verbatimchar}}}{}
+\@ifundefined{PercentIndex}
+  {\def\PercentIndex{\it at is@a\percentchar}}{}
+\def\OldMakeindex{\def\PercentIndex{%
+    \special at index{\quotechar\percentchar\actualchar
+           \string\verb% % to fool emacs highlighting
+           \quotechar*\verbatimchar\quotechar\bslash
+           \percentchar\percentchar\verbatimchar}}}
+{\catcode`\%=12 \gdef\percentchar{%}}
+\def\it at is@a#1{\special at index{\quotechar #1\actualchar
+                          \string\verb% % to fool emacs highlighting
+                          \quotechar*\verbatimchar
+                          \quotechar\bslash\quotechar#1\verbatimchar}}
+
+\newdimen\IndexMin         \IndexMin       = 80pt
+\newcount\c at IndexColumns   \c at IndexColumns = 3
+\ifdoc at multicol
+  \RequirePackage{multicol}
+  \renewenvironment{theindex}
+    {\begin{multicols}\c at IndexColumns[\index at prologue][\IndexMin]%
+      \IndexParms \let\item\@idxitem \ignorespaces}%
+    {\end{multicols}}
+\else
+  \def\theindex{\@restonecoltrue\if at twocolumn\@restonecolfalse\fi
+    \columnseprule \z@  \columnsep 35\p@
+    \twocolumn[\index at prologue]%
+    \IndexParms \let\item\@idxitem \ignorespaces}
+  \def\endtheindex{\if at restonecol\onecolumn\else\clearpage\fi}
+\fi
+\long\def\IndexPrologue#1{\@bsphack\def\index at prologue{#1}\@esphack}
+\@ifundefined{index at prologue}
+     {\def\index at prologue{\section*{Index}%
+                 \markboth{Index}{Index}%
+                 Numbers written in italic refer to the page
+                 where the corresponding entry is described;
+                 numbers underlined refer to the
+                 \ifcodeline at index
+                   code line of the
+                 \fi
+                 definition; numbers in roman refer to the
+                 \ifcodeline at index
+                   code lines
+                 \else
+                   pages
+                 \fi
+                 where the entry is used.
+                 }}{}
+\@ifundefined{IndexParms}
+    {\def\IndexParms{%
+       \parindent \z@
+       \columnsep 15pt
+       \parskip 0pt plus 1pt
+       \rightskip 15pt
+       \mathsurround \z@
+       \parfillskip=-15pt
+        \small
+       \def\@idxitem{\par\hangindent 30pt}%
+       \def\subitem{\@idxitem\hspace*{15pt}}%
+       \def\subsubitem{\@idxitem\hspace*{25pt}}%
+       \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}%
+      }}{}
+\def\efill{\hfill\nopagebreak}%
+\def\pfill{\unskip~%
+           \leaders\hbox to.6em{\hss .\hss}\hfill
+           \penalty500\strut\nobreak
+           \leaders\hbox to.6em{\hss .\hss}\hfil
+           ~\ignorespaces}%
+\def\*{\leavevmode\lower.8ex\hbox{$\,\widetilde{\ }\,$}}
+\@ifundefined{main}{\def\main#1{\underline{#1}}}{}
+\@ifundefined{usage}{\def\usage#1{\textit{#1}}}{}
+\@ifundefined{code}{\def\code#1{#1}}{}
+\def\PrintIndex{\@input@{\jobname.ind}%
+                \global\let\PrintIndex\@empty}
+\def\changes{\@bsphack\begingroup\@sanitize
+   \catcode`\\\z@ \catcode`\ 10 \MakePercentIgnore
+   \changes@}
+\def\changes@#1#2#3{%
+  \protected at edef\@tempa{\noexpand\glossary{#1\levelchar
+                   \ifx\saved at macroname\@empty
+                      \quotechar!%
+                      \actualchar
+                      \generalname
+                   \else
+                      \saved at indexname
+                      \actualchar
+                      \string\verb% % to fool emacs highlighting
+                      \quotechar*%
+                      \verbatimchar\saved at macroname
+                      \verbatimchar
+                   \fi
+                   :\levelchar #3}}%
+  \@tempa\endgroup\@esphack}
+\def\saved at macroname{}
+\def\saved at indexname{}
+\def\generalname{General}
+\let\RecordChanges\makeglossary
+\newdimen\GlossaryMin         \GlossaryMin       = 80pt
+\newcount\c at GlossaryColumns   \c at GlossaryColumns = 2
+\ifdoc at multicol
+  \newenvironment{theglossary}{%
+    \begin{multicols}\c at GlossaryColumns
+                     [\glossary at prologue][\GlossaryMin]%
+    \GlossaryParms \let\item\@idxitem \ignorespaces}%
+   {\end{multicols}}
+\else
+  \newenvironment{theglossary}{%
+      \@restonecoltrue\if at twocolumn\@restonecolfalse\fi
+      \columnseprule \z@  \columnsep 35\p@
+      \twocolumn[\glossary at prologue]%
+      \GlossaryParms \let\item\@idxitem \ignorespaces}
+    {\if at restonecol\onecolumn\else\clearpage\fi}
+\fi
+\long\def\GlossaryPrologue#1{\@bsphack
+                             \def\glossary at prologue{#1}%
+                             \@esphack}
+\@ifundefined{glossary at prologue}
+     {\def\glossary at prologue{\section*{{Change History}}%
+                 \markboth{{Change History}}{{Change History}}%
+                 }}{}
+\@ifundefined{GlossaryParms}{\let\GlossaryParms\IndexParms
+  \expandafter\def\expandafter\GlossaryParms\expandafter{\GlossaryParms
+     \rightskip 15pt plus 1fil
+     \parfillskip -15pt plus -1fil\relax}
+}{}
+\def\PrintChanges{\@input@{\jobname.gls}%
+                  \global\let\PrintChanges\@empty}
+\newcommand\AlsoImplementation{%
+   \long\def\MaybeStopHere##1{\@bsphack\gdef\Finale{##1%
+                  \check at checksum}%
+              \init at checksum
+              \@esphack}%
+         }
+\AlsoImplementation
+\def\OnlyDescription{\@bsphack\long\def\MaybeStopHere##1{%
+           ##1\endinput}\@esphack}
+\let\Finale\relax
+\def\StopEventually{\MaybeStopHere}
+\ifx\l at nohyphenation\undefined
+  \newlanguage\l at nohyphenation
+\fi
+\DeclareRobustCommand\meta[1]{%
+     \ensuremath\langle
+     \ifmmode \expandafter \nfss at text \fi
+     {%
+      \meta at font@select
+      \edef\meta at hyphen@restore
+        {\hyphenchar\the\font\the\hyphenchar\font}%
+      \hyphenchar\font\m at ne
+      \language\l at nohyphenation
+      #1\/%
+      \meta at hyphen@restore
+     }\ensuremath\rangle
+}
+\def\meta at font@select{\itshape}
+\def\IndexInput#1{%
+     \begingroup \macro at code
+   \frenchspacing \@vobeyspaces
+     \input{#1}\endmacrocode
+     \endgroup}
+\def\maketitle{\par
+      \begingroup \def \thefootnote {\fnsymbol {footnote}}%
+      \setcounter {footnote}\z@
+      \def\@makefnmark{\hbox to\z@{$\m at th^{\@thefnmark}$\hss}}%
+      \long\def\@makefntext##1{\parindent 1em\noindent
+            \hbox to1.8em{\hss$\m at th^{\@thefnmark}$}##1}%
+      \if at twocolumn \twocolumn [\@maketitle ]%
+      \else \newpage \global \@topnum \z@ \@maketitle \fi
+       \thispagestyle{titlepage}\@thanks \endgroup
+      \setcounter {footnote}\z@
+      \gdef\@date{\today}\gdef\@thanks{}%
+      \gdef\@author{}\gdef\@title{}}
+\@ifundefined{ps at titlepage}
+    {\let\ps at titlepage=\ps at plain}{}
+\def\MakeShortVerb{%
+  \@ifstar
+    {\def\@shortvrbdef{\verb*}\@MakeShortVerb}%
+    {\def\@shortvrbdef{\verb}\@MakeShortVerb}}
+\def\@MakeShortVerb#1{%
+  \expandafter\ifx\csname cc\string#1\endcsname\relax
+    \@shortvrbinfo{Made }{#1}\@shortvrbdef
+    \add at special{#1}%
+    \expandafter
+    \xdef\csname cc\string#1\endcsname{\the\catcode`#1}%
+    \begingroup
+      \catcode`\~\active  \lccode`\~`#1%
+      \lowercase{%
+      \global\expandafter\let
+         \csname ac\string#1\endcsname~%
+      \expandafter\gdef\expandafter~\expandafter{\@shortvrbdef~}}%
+    \endgroup
+    \global\catcode`#1\active
+  \else
+    \@shortvrbinfo\@empty{#1 already}%
+                         {\@empty\verb% % to fool emacs highlighting
+                          (*)}%
+  \fi}
+\def\DeleteShortVerb#1{%
+  \expandafter\ifx\csname cc\string#1\endcsname\relax
+    \@shortvrbinfo\@empty{#1 not}%
+                         {\@empty\verb% % to fool emacs highlighting
+                          (*)}%
+  \else
+    \@shortvrbinfo{Deleted }{#1 as}%
+                            {\@empty\verb% % to fool emacs
+                                           % highlighting
+                            (*)}%
+    \rem at special{#1}%
+    \global\catcode`#1\csname cc\string#1\endcsname
+    \global \expandafter\let \csname cc\string#1\endcsname \relax
+    \ifnum\catcode`#1=\active
+      \begingroup
+        \catcode`\~\active   \lccode`\~`#1%
+        \lowercase{%
+          \global\expandafter\let\expandafter~%
+          \csname ac\string#1\endcsname}%
+      \endgroup \fi \fi}
+\def\@shortvrbinfo#1#2#3{%
+  \PackageInfo{doc}{%
+     #1\expandafter\@gobble\string#2 a short reference
+                                          for \expandafter\string#3}}
+\def\add at special#1{%
+  \rem at special{#1}%
+  \expandafter\gdef\expandafter\dospecials\expandafter
+    {\dospecials \do #1}%
+  \expandafter\gdef\expandafter\@sanitize\expandafter
+    {\@sanitize \@makeother #1}}
+\def\rem at special#1{%
+  \def\do##1{%
+    \ifnum`#1=`##1 \else \noexpand\do\noexpand##1\fi}%
+  \xdef\dospecials{\dospecials}%
+  \begingroup
+    \def\@makeother##1{%
+      \ifnum`#1=`##1 \else \noexpand\@makeother\noexpand##1\fi}%
+    \xdef\@sanitize{\@sanitize}%
+  \endgroup}
+\def\init at checksum{\relax
+    \global\bslash at cnt\z@}
+\def\check at checksum{\relax
+  \ifnum\check at sum>\m at ne
+     \ifnum\check at sum=\z@
+       \typeout{**********************************}%
+       \typeout{* This macro file has no checksum!}%
+       \typeout{* The checksum should be \the\bslash at cnt!}%
+       \typeout{**********************************}%
+     \else
+       \ifnum\check at sum=\bslash at cnt
+         \typeout{*******************}%
+         \typeout{* Checksum passed *}%
+         \typeout{*******************}%
+       \else
+         \PackageError{doc}{Checksum not passed
+                    (\the\check at sum<>\the\bslash at cnt)}%
+          {The file currently documented seems to be wrong.^^J%
+           Try to get a correct version.}%
+       \fi
+     \fi
+  \fi
+  \global\check at sum\m at ne}
+\newcount\check at sum           \check at sum  = \m at ne
+\newcount\bslash at cnt          \bslash at cnt = \z@
+\def\CheckSum#1{\@bsphack\global\check at sum#1\relax\@esphack}
+\def\step at checksum{\global\advance\bslash at cnt\@ne}
+\def\CharacterTable{\begingroup \CharTableChanges \character at table}
+\begingroup
+  \catcode`\~=11
+  \gdef\character at table#1{\def\used~table{#1}%
+      \ifx\used~table\default~table
+           \typeout{***************************}%
+           \typeout{* Character table correct *}%
+           \typeout{***************************}%
+      \else
+         \PackageError{doc}{Character table corrupted}
+                           {\the\wrong at table}
+         \show\default~table
+         \show\used~table
+      \fi
+      \endgroup}
+  \global\let\CharTableChanges\@empty
+  \makeatother
+  \gdef\default~table
+     {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+      Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+      Digits        \0\1\2\3\4\5\6\7\8\9
+      Exclamation   \!     Double quote  \"     Hash (number) \#
+      Dollar        \$     Percent       \%     Ampersand     \&
+      Acute accent  \'     Left paren    \(     Right paren   \)
+      Asterisk      \*     Plus          \+     Comma         \,
+      Minus         \-     Point         \.     Solidus       \/
+      Colon         \:     Semicolon     \;     Less than     \<
+      Equals        \=     Greater than  \>     Question mark \?
+      Commercial at \@     Left bracket  \[     Backslash     \\
+      Right bracket \]     Circumflex    \^     Underscore    \_
+      Grave accent  \`     Left brace    \{     Vertical bar  \|
+      Right brace   \}     Tilde         \~}
+\endgroup
+  \newhelp\wrong at table{Some of the ASCII characters are corrupted.^^J
+            I now \string\show\space you both tables for comparison.}
+\newif\ifcodeline at index \codeline at indexfalse
+\let\CodelineNumbered\codeline at indextrue
+\def\codeline at wrindex#1{\if at filesw
+     \begingroup
+        \set at display@protect
+        \immediate\write\@indexfile
+            {\string\indexentry{#1}%
+             {\number\c at CodelineNo}}%
+      \endgroup
+    \fi}
+\let\special at index = \@gobble
+\def\CodelineIndex{\makeindex
+                   \codeline at indextrue
+                   \let\special at index\codeline at wrindex}
+\def\PageIndex{\makeindex
+               \codeline at indexfalse
+               \let\special at index\index}
+\newcount\c at CodelineNo  \c at CodelineNo\z@
+\@ifundefined{theCodelineNo}
+  {\ifx\selectfont\undefined
+     \def\theCodelineNo{\rmfamily\scriptsize\arabic{CodelineNo}}%
+   \else
+     \def\theCodelineNo{\reset at font\scriptsize\arabic{CodelineNo}}%
+   \fi}
+  {}
+       \tolerance=1000\relax
+{ \catcode`\"=12
+  \global\mathcode`\\="705C \global\mathcode`\@="7040 }
+\@ifundefined{DocstyleParms}{}{\DocstyleParms}
+ \let\DocstyleParms\relax
+\@ifundefined{AmSTeX}
+   {\def\AmSTeX{\leavevmode\hbox{$\mathcal A\kern-.2em\lower.376ex%
+        \hbox{$\mathcal M$}\kern-.2em\mathcal S$-\TeX}}}{}
+\@ifundefined{BibTeX}
+   {\def\BibTeX{{\rmfamily B\kern-.05em%
+    \textsc{i\kern-.025em b}\kern-.08em%
+    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}}{}
+\@ifundefined{SliTeX}
+   {\def\SliTeX{{\rmfamily S\kern-.06emL\kern-.18em\raise.32ex\hbox
+                {\scshape i}\kern -.03em\TeX}}}{}
+\@ifundefined{PlainTeX}{\def\PlainTeX{\textsc{Plain}\kern2pt\TeX}}{}
+\@ifundefined{Web}{\def\Web{\textsc{Web}}}{}
+\def\MakePercentIgnore{\catcode`\%9\relax}
+\def\MakePercentComment{\catcode`\%14\relax}
+\def\DocInput#1{\MakePercentIgnore\input{#1}\MakePercentComment}
+\def\GetFileInfo#1{%
+  \def\filename{#1}%
+  \def\@tempb##1 ##2 ##3\relax##4\relax{%
+    \def\filedate{##1}%
+    \def\fileversion{##2}%
+    \def\fileinfo{##3}}%
+  \edef\@tempa{\csname ver@#1\endcsname}%
+  \expandafter\@tempb\@tempa\relax? ? \relax\relax}
+
+\ifdoc at hyperref
+  \let\PrintDescribeMacro \@empty
+  \let\PrintDescribeEnv   \@empty
+  \let\PrintMacroName     \@empty
+  \let\PrintEnvName       \@empty
+  \let\SpecialUsageIndex  \@empty
+  \let\SpecialEnvIndex    \@empty
+  \expandafter\let\expandafter\doc at eoph@@k\csname doc.sty-h@@k\endcsname
+  \RequirePackage{hypdoc}
+  \expandafter\let\csname doc.sty-h@@k\endcsname\doc at eoph@@k
+  \let\PrintDescribeMacro \relax
+  \let\PrintDescribeEnv   \relax
+  \let\PrintMacroName     \relax
+  \let\PrintEnvName       \relax
+  \def\doc at providetarget{\HD at target}
+  \def\doc at handleencap#1{\encapchar hdclindex{\the\c at HD@hypercount}{#1}}
+\else
+  \let\doc at providetarget\@empty
+  \def\doc at handleencap#1{\encapchar #1}
+  \def\hdclindex#1#2{\ifx\@nil#2\@nil\else\csname #2\expandafter\endcsname\fi}
+  \def\hdpindex   #1{\ifx\@nil#1\@nil\else\csname #1\expandafter\endcsname\fi}
+\fi
+
+
+\ExplSyntaxOn
+
+\long\def\@doc at env#1#2#3{
+  \endgroup
+  \clist_map_inline:nn {#3} { \@doc at env@{#1}{#2}{##1} }
+}
+
+\ExplSyntaxOff
+
+\long\def\@doc at env@#1#2#3{%
+  \topsep\MacroTopsep
+  \trivlist
+    \edef\saved at macroname{\string#3}%
+    \if #1%
+      \edef\saved at indexname{\expandafter\@gobble\saved at macroname}%
+      \expandafter\ifx
+                  \csname Code#2Index\endcsname
+                  \CodeMacroIndex
+      \else
+        \record at index@type at save
+          {\saved at indexname}{#2}%
+      \fi
+    \else
+      \let\saved at indexname\saved at macroname
+    \fi
+    \def\makelabel##1{\llap{##1}}%
+    \if at inlabel
+      \let\@tempa\@empty
+      \count@\macro at cnt
+      \loop\ifnum\count@>\z@
+        \edef\@tempa{\@tempa\hbox{\strut}}\advance\count@\m at ne
+      \repeat
+      \edef\makelabel##1{\llap{\vtop to\baselineskip{\@tempa\hbox{##1}\vss}}}%
+      \advance\macro at cnt\@ne
+    \else
+      \macro at cnt\@ne
+    \fi
+    \ifdoc at noprint
+      \item
+    \else
+      \edef\@tempa{%
+        \noexpand\item[%
+        \noexpand\doc at providetarget
+        \noexpand\strut
+        \noexpand\@nameuse{Print#2Name}{\saved at macroname}]}%
+      \@tempa
+    \fi
+    \ifdoc at noindex\else
+      \global\advance\c at CodelineNo\@ne
+      \@nameuse{SpecialMain#2Index}{#3}\nobreak
+      \global\advance\c at CodelineNo\m at ne
+    \fi
+    \if#1\expandafter\DoNotIndex \csname \saved at indexname\endcsname \fi
+    \ignorespaces}
+
+\def\doc at env#1#2[#3]{%
+  \@nameuse{doc at noprint\doc at noprintdefault}%
+  \@nameuse{doc at noindex\doc at noindexdefault}%
+  \setkeys{doc}{#3}%
+  \begingroup
+    \catcode`\\12
+    \MakePrivateLetters
+    \@doc at env{#1}{#2}%
+}
+
+\def\@doc at describe#1#2{%
+    \ifdoc at noprint\else
+      \marginpar{\raggedleft
+                 \strut
+                 \doc at providetarget
+                 \@nameuse{PrintDescribe#1}{#2}}%
+    \fi
+    \ifdoc at noindex\else
+      \@nameuse{Special#1Index}{#2}%
+    \fi
+  \@esphack
+  \endgroup
+  \ignorespaces}
+\def\doc at describe#1[#2]{%
+  \leavevmode\@bsphack
+    \setkeys{doc}{#2}%
+      \@doc at describe{#1}}
+\@ifundefined{temptokenb}{\newtoks\@temptokenb}{}
+\def\doc at createspecialindexes#1#2#3{%
+  \@temptokena{\space (#2)}%
+  \@temptokenb{#3:}%
+  \@nameedef{SpecialMain#1Index}##1{%
+    \noexpand\@bsphack
+  \ifdoc at toplevel
+    \noexpand\special at index{##1\noexpand\actualchar
+    {\string\ttfamily\space##1}%
+    \ifx\@nil#2\@nil\else \the\@temptokena \fi
+    \noexpand\encapchar main}%
+  \fi
+  \ifx\@nil#3\@nil\else
+    \noexpand\special at index{\the\@temptokenb\noexpand\levelchar
+      ##1\noexpand\actualchar{\string\ttfamily\space##1}%
+      \noexpand\encapchar main}%
+  \fi
+    \noexpand\@esphack}%
+  \@nameedef{Special#1Index}##1{%
+    \noexpand\@bsphack
+  \ifdoc at toplevel
+    \noexpand\doc at providetarget
+    \noexpand\index{##1\noexpand\actualchar{\string\ttfamily\space##1}%
+    \ifx\@nil#2\@nil\else \the\@temptokena \fi
+           \noexpand\doc at handleencap{usage}}%
+  \fi
+  \ifx\@nil#3\@nil\else
+    \noexpand\index{\the\@temptokenb\noexpand\levelchar
+       ##1\noexpand\actualchar{\string\ttfamily\space##1}%
+           \noexpand\doc at handleencap{usage}}%
+  \fi
+    \noexpand\@esphack}}
+\def\doc at createspecialmacrolikeindexes#1#2#3{%
+  \@temptokena{\space (#2)}%
+  \@temptokenb{#3:}%
+  \@nameedef{Code#1Index}##1##2{%
+    \noexpand\@SpecialIndexHelper@##2\noexpand\@nil
+    \noexpand\@bsphack
+  \noexpand\ifdoc at noindex\noexpand\else
+    \ifdoc at toplevel
+      \noexpand\special at index{\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\ifx\@nil#2\@nil\else \the\@temptokena \fi
+\noexpand\encapchar ##1}%
+    \fi
+    \ifx\@nil#3\@nil\else
+      \noexpand\special at index{\the\@temptokenb\noexpand\levelchar
+\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\noexpand\encapchar ##1}%
+    \fi
+  \noexpand\fi
+    \noexpand\@esphack}%
+  \@nameedef{SpecialMain#1Index}##1{%
+    \expandafter\noexpand\csname Code#1Index\endcsname
+        {main}{##1}}%
+  \@nameedef{Special#1Index}##1{%
+    \noexpand\@SpecialIndexHelper@##1\noexpand\@nil
+    \noexpand\@bsphack
+  \noexpand\ifdoc at noindex\noexpand\else
+    \ifdoc at toplevel
+      \noexpand\doc at providetarget
+      \noexpand\index{\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\ifx\@nil#2\@nil\else \the\@temptokena \fi
+\noexpand\doc at handleencap{usage}}%
+    \fi
+    \ifx\@nil#3\@nil\else
+      \noexpand\index{\the\@temptokenb\noexpand\levelchar
+\noexpand\@gtempa\noexpand\actualchar
+\string\verb% % to fool emacs highlighting
+\noexpand\quotechar*\noexpand\verbatimchar
+\noexpand\bslash\noexpand\@gtempa\noexpand\verbatimchar
+\noexpand\doc at handleencap{usage}}%
+    \fi
+  \noexpand\fi
+    \noexpand\@esphack}}
+
+\def\doc at createdescribe#1{%
+  \@namedef{Describe#1}{%
+    \begingroup
+      \MakePrivateLetters
+      \@ifnextchar[%]
+      {\doc at describe{#1}}{\doc at describe{#1}[]}}}
+\def\doc at createenv#1#2#3{%
+  \@namedef{#3}{%
+    \@ifnextchar[%]
+    {\doc at env{#1}{#2}}{\doc at env{#1}{#2}[]}}%
+  \@namedef{end#3}{\endtrivlist}%
+}
+
+\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
+
+
+\def\doc at declareerror#1#2{%
+   \PackageError{doc}{Doc element '#1/#2' already defined?\@gobble}%
+      {There is already a definition for
+       '\string\Print#1Name',\MessageBreak
+       '\string\PrintDescribe#1'
+       or the environment '#2'.\MessageBreak
+       Maybe you are overwriting something by mistake!\MessageBreak
+       Otherwise use '\string\RenewDocElement' instead.}%
+}
+
+\def\doc at notdeclarederror#1#2{%
+   \PackageError{doc}{Doc element '#1/#2' unknown}%
+      {I expected an existing definition for
+       '\string\Print#1Name',\MessageBreak
+       '\string\PrintDescribe#1' and
+       the environment '#2' but\MessageBreak
+       not all of them are defined.\MessageBreak
+       Maybe you wanted to use
+       '\string\NewDocElement'?}%
+}
+\newcommand\NewDocElement[3][]{%
+  \@ifundefined{Print#2Name}%
+      {\@ifundefined{PrintDescribe#2}%
+           {\@ifundefined{#3}%
+               {\@ifundefined{end#3}%
+                    {\@NewDocElement{#1}}%
+                    \doc at declareerror
+               }\doc at declareerror
+           }\doc at declareerror
+      }\doc at declareerror
+  {#2}{#3}%
+}
+\newcommand\RenewDocElement[3][]{%
+  \@ifundefined{Print#2Name}\doc at notdeclarederror
+      {\@ifundefined{PrintDescribe#2}\doc at notdeclarederror
+           {\@ifundefined{#3}\doc at notdeclarederror
+               {\@ifundefined{end#3}\doc at notdeclarederror
+                    {\@NewDocElement{#1}}%
+               }%
+           }%
+      }%
+  {#2}{#3}%
+}
+\def\@NewDocElement#1#2#3{%
+  \doc at macrolikefalse
+  \doc at topleveltrue
+  \def\doc at idxtype{#3}%
+  \def\doc at idxgroup{#3s}%
+  \let\doc at printtype\@empty
+  \setkeys{doc}{#1}%
+  \ifx\doc at printtype\@empty
+    \@temptokena{}%
+  \else
+    \@temptokena\expandafter{\expandafter
+         \textnormal\expandafter{\expandafter
+         \space\expandafter
+         (\doc at printtype)}}%
+  \fi
+  \@nameedef{Print#2Name}##1{%
+     {\noexpand\MacroFont
+      \ifdoc at macrolike
+         \noexpand\string
+      \fi
+      ##1%
+      \the\@temptokena
+     }}%
+  \expandafter\let\csname PrintDescribe#2\expandafter\endcsname
+                  \csname Print#2Name\endcsname
+  \edef\doc at expr{%
+     \ifdoc at macrolike
+       \noexpand\doc at createspecialmacrolikeindexes
+     \else
+       \noexpand\doc at createspecialindexes
+     \fi
+     {#2}%
+    }%
+   \expandafter\expandafter\expandafter
+   \doc at expr
+   \expandafter\expandafter\expandafter
+     {\expandafter\doc at idxtype\expandafter}\expandafter
+     {\doc at idxgroup}%
+  \doc at createdescribe{#2}%
+    \ifdoc at macrolike
+      \doc at createenv{TT}{#2}{#3}%
+    \else
+      \doc at createenv{TF}{#2}{#3}%
+    \fi
+}
+
+
+\NewDocElement[macrolike = true ,
+                idxtype   = ,
+                idxgroup  = ,
+                printtype =
+               ]{Macro}{macro}
+
+\def\SpecialMainIndex{\SpecialMainMacroIndex}
+
+\def\SpecialUsageIndex{\SpecialMacroIndex}
+
+\def\SpecialIndex     {\CodeMacroIndex{code}}
+
+\NewDocElement[macrolike = false ,
+                idxtype   = env.  ,
+                idxgroup  = environments ,
+                printtype = \textit{env.}
+               ]{Env}{environment}
+
+
+\DeclareRobustCommand\cs[1]{\texttt{\bslash #1}}
+
+\endinput
+%%
+%% End of file `doc-v3beta.sty'.
diff --git a/base/ltxdoc.dtx b/base/ltxdoc.dtx
index 7a21f7d8..6eaa0173 100644
--- a/base/ltxdoc.dtx
+++ b/base/ltxdoc.dtx
@@ -196,7 +196,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\RequirePackage{doc}
+\RequirePackage{doc-v3beta}
 %    \end{macrocode}
 %
 % Make \verb+|+ be a `short verb' character, but not in the document
diff --git a/base/source2edoc.cls b/base/source2edoc.cls
index ba6acf9f..37521a7c 100644
--- a/base/source2edoc.cls
+++ b/base/source2edoc.cls
@@ -5,6 +5,9 @@
               [2021/01/14 v0.2b Quick hack to typeset source2.tex
                (not usable for anything else and buggy -- will vanish again)!]
 
+
+\declare at file@substitution{doc.sty}{doc-v3beta.sty}
+
 \LoadClass{l3doc}
 
 \RemoveFromHook{begindocument}[l3doc]          % drop the standard setting  making " a shortverb





More information about the latex3-commits mailing list.