summaryrefslogtreecommitdiff
path: root/macros/latex-dev/base/source2edoc.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex-dev/base/source2edoc.cls')
-rw-r--r--macros/latex-dev/base/source2edoc.cls87
1 files changed, 6 insertions, 81 deletions
diff --git a/macros/latex-dev/base/source2edoc.cls b/macros/latex-dev/base/source2edoc.cls
index 5f731af7ae..48ae49b29a 100644
--- a/macros/latex-dev/base/source2edoc.cls
+++ b/macros/latex-dev/base/source2edoc.cls
@@ -2,12 +2,12 @@
% This class is buggy and needs fixing
\ProvidesClass{source2edoc}
- [2022/04/03 v0.2c Quick hack to typeset source2.tex
+ [2024/02/14 v0.2e Quick hack to typeset source2.tex
(not usable for anything else and buggy -- will vanish again)!]
-\LoadClass{l3doc}
+\LoadClass[kernel]{l3doc}
\RemoveFromHook{begindocument}[l3doc] % drop the standard setting making " a shortverb
\AddToHook{begindocument}{\MakeShortVerb \|} % but readd | as one
@@ -50,84 +50,6 @@
}
-
-% some l3doc's def are buggy (already fixed there but not distributed yet)
-
-\RenewDocumentCommand \DocInclude { m }
- {
- \relax\clearpage
- \docincludeaux
- \IfFileExists{#1.fdd}
- { \cs_set:Npn \currentfile{#1.fdd} }
- { \cs_set:Npn \currentfile{#1.dtx} }
- \int_compare:nNnTF \@auxout = \@partaux
- { \@latexerr{\string\include\space cannot~be~nested}\@eha }
- { \@docinclude {#1} } % <--- braces needed!
- \int_compare:nNnF { \tex_currentgrouplevel:D } = { 0 }
- {
- \int_compare:nNnT { \tex_interactionmode:D } = { 0 }
- { \int_set:Nn \tex_interactionmode:D { 1 } }
- \msg_fatal:nnn { source2edoc } { missing-endgroup } {#1}
- }
- }
-\msg_new:nnn { source2edoc } { missing-endgroup }
- {
- \str_if_eq:VnTF \@currenvir { document }
- {
- There~are~\int_use:N \tex_currentgrouplevel:D
- \c_space_tl unclosed~groups~in~#1.dtx.
- }
- {
- The~\@currenvir \c_space_tl environment~on~line~\@currenvline
- \c_space_tl doesn't~have~a~matching~\iow_char:N\\end{\@currenvir}.
- }
- }
-\cs_gset:Npn \@docinclude #1
- {
- \clearpage
- \immediate\write\@mainaux{\string\@input{#1.aux}}
- \@tempswatrue
- \if@partsw
- \@tempswafalse
- \cs_set:Npx \@tempb {#1}
- \clist_map_inline:Nn \@partlist
- {
- \if_meaning:w \@tempa \@tempb
- \@tempswatrue
- \fi:
- }
- \fi
- \if@tempswa
- \cs_set_eq:NN \@auxout \@partaux
- \immediate\openout\@partaux #1.aux
- \immediate\write\@partaux{\relax}
- \cs_set_eq:NN \@ltxdoc@PrintIndex \PrintIndex
- \cs_set_eq:NN \PrintIndex \relax
- \cs_set_eq:NN \@ltxdoc@PrintChanges \PrintChanges
- \cs_set_eq:NN \PrintChanges \relax
- \cs_set_eq:NN \@ltxdoc@theglossary \theglossary
- \cs_set_eq:NN \@ltxdoc@endtheglossary \endtheglossary
- \part{\currentfile}
- {
- \cs_set_eq:NN \ttfamily\relax
- \cs_gset:Npx \filekey
- { \filekey,~ \thepart = { \ttfamily \currentfile } } % <-- mising spaces considered harmful
- }
- \DocInput{\currentfile}
- \cs_set_eq:NN \PrintIndex \@ltxdoc@PrintIndex
- \cs_set_eq:NN \PrintChanges \@ltxdoc@PrintChanges
- \cs_set_eq:NN \theglossary \@ltxdoc@theglossary
- \cs_set_eq:NN \endtheglossary \@ltxdoc@endtheglossary
- \clearpage
- \@writeckpt{#1}
- \immediate \closeout \@partaux
- \else
- \@nameuse{cp@#1}
- \fi
- \cs_set_eq:NN \@auxout \@mainaux
- }
-
-
% change the setup here: we have a lot of long names so better run raggeded
\cs_set_protected:Npn \__codedoc_macro_end_style:n #1
@@ -176,7 +98,7 @@
dd%
\else\@ctrerr\fi}
\def\docincludeaux{%
- \def\thepart{\aalph{part}}\def\filesep{\thepart-}%
+ \def\thepart{\ifnum\value{part}<10 0\fi\arabic{part}}\def\filesep{\thepart-}%
\let\filekey\@gobble
\g@addto@macro\index@prologue{%
\gdef\@oddfoot{\parbox[t]{\textwidth}{\strut\footnotesize
@@ -303,6 +225,9 @@ Bug reports can be opened (category \texttt{#1}) at\\%
\AddToHook{cmd/tableofcontents/after}{\global\let\tableofcontents\relax}
+% pages > 1000
+\renewcommand\@pnumwidth{2em}
+
\InputIfFileExists{ltxdoc.cfg}
{\typeout{*************************************^^J%
* Local config file ltxdoc.cfg used^^J%