[latex3-commits] [git/LaTeX3-latex3-latex2e] doc-v3beta: provide nocfg option for ltxdoc.cls provide ltxdoc.cfg (as used for the kernel documentation) (d5b82ae0)

Frank Mittelbach frank.mittelbach at latex-project.org
Sun Feb 7 21:38:43 CET 2021


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

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

commit d5b82ae01a7bf53139d70a6dcb6682b695ed7292
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Sun Feb 7 21:38:43 2021 +0100

    provide nocfg option for ltxdoc.cls
    provide ltxdoc.cfg (as used for the kernel documentation)


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

d5b82ae01a7bf53139d70a6dcb6682b695ed7292
 base/docstrip.ins  |  1 +
 base/ltxdoc.dtx    | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 build-config.lua   |  2 +-
 support/ltxdoc.cfg | 41 ---------------------------------
 4 files changed, 66 insertions(+), 44 deletions(-)

diff --git a/base/docstrip.ins b/base/docstrip.ins
index e34281fc..c0fff065 100644
--- a/base/docstrip.ins
+++ b/base/docstrip.ins
@@ -98,6 +98,7 @@ extension .ins) which are part of the distribution.
 
 
 \generate{\file{ltxdoc.cls}{\from{ltxdoc.dtx}{class}}
+          \file{ltxdoc.cfg}{\from{ltxdoc.dtx}{cfg}}
          }
 
 \generate{\file{doc.sty}{\from{doc.dtx}{package}}
diff --git a/base/ltxdoc.dtx b/base/ltxdoc.dtx
index 6eaa0173..3cce576e 100644
--- a/base/ltxdoc.dtx
+++ b/base/ltxdoc.dtx
@@ -30,7 +30,7 @@
 %
 %<class>\NeedsTeXFormat{LaTeX2e}
 %<class>\ProvidesClass{ltxdoc}
-%<class>         [2020/12/05 v2.1b Standard LaTeX documentation class]
+%<class>         [2021/02/07 v2.1c Standard LaTeX documentation class]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -163,9 +163,17 @@
 %
 %    \begin{macrocode}
 %<*class>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \DeclareOption{a5paper}{\@latexerr{Option not supported}%
    {}}
 %    \end{macrocode}
+%    Prevent loading of a config file.
+%    \begin{macrocode}
+\newif\ifltxdoc at load@cfg@ \ltxdoc at load@cfg at true
+\DeclareOption{nocfg}{\ltxdoc at load@cfg at false}
+%    \end{macrocode}
 %
 %    \begin{macrocode}
 \DeclareOption*{%
@@ -175,11 +183,13 @@
 % \section{Configuration}
 % Input a local configuration file, if it exists.
 %    \begin{macrocode}
+\ifltxdoc at load@cfg@
 \InputIfFileExists{ltxdoc.cfg}
            {\typeout{*************************************^^J%
                      * Local config file ltxdoc.cfg used^^J%
                      *************************************}}
            {}
+\fi
 %    \end{macrocode}
 %
 %
@@ -196,7 +206,7 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-\RequirePackage{doc-v3beta}
+\RequirePackage{doc}
 %    \end{macrocode}
 %
 % Make \verb+|+ be a `short verb' character, but not in the document
@@ -602,5 +612,57 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 \def\task#1#2{}
 %</class>
 %    \end{macrocode}
+%
+% \section{Configuration file}
+%
+% We now use a \texttt{.cfg} file to run our own documentation with the beta of the new \pkg{doc} package.
+%
+%
+%    \begin{macrocode}
+%<*cfg>
+%
+% This is the ltxdoc configuration file we use to format the LaTeX
+% kernel sources.
+%
+%
+% Copyright 2006, 2007, 2011 Heiko Oberdiek
+% Copyright 2014-2021 The LaTeX Project
+% 
+
+\ProvidesFile{ltxdoc.cfg}%
+  [2021/02/07 v2.0b ltxdoc.cls configuration (LaTeX Project)]
+\PassOptionsToClass{a4paper}{article}
+\AtEndOfClass{%
+  \RequirePackage{hypdoc}%
+  \RequirePackage{pdftexcmds}\relax
+  \ifnum\pdf at strcmp{\jobname}{inputenc}=0 %
+    \hypersetup{pdfencoding=auto}%
+    \pdfstringdefDisableCommands{%
+      \def\meta#1{% inputenc.dtx
+        \9060\010#1\9060\011%
+      }%
+    }%
+  \else
+  \fi
+  \pdfstringdefDisableCommands{%
+    \let\env\relax % longtable.dtx
+    \let\mytt\relax % tabularx.dtx
+  }%
+}
+
+% The setting below will replace the current version of the doc
+% package with the V3-beta version.  This should work well for
+% documentation of packages outside the LaTeX kernel, but if not, you
+% can prevent the loading with the option "nocfg", i.e.,
+%
+%   \documentclass[nocfg]{ltxdoc]
+%
+% or by providing your own config file
+
+\declare at file@substitution{doc.sty}{doc-v3beta.sty}
+
+\endinput
+%</cfg>
+%    \end{macrocode}
 % \Finale
 %
diff --git a/build-config.lua b/build-config.lua
index 49e666ea..5934a109 100644
--- a/build-config.lua
+++ b/build-config.lua
@@ -42,7 +42,7 @@ checksuppfiles = checksuppfiles     or
 stdengine      = stdengine          or "etex"
 tagfiles       = tagfiles or {"*.dtx","*.ins","*.tex","README.md"}
 typesetsuppfiles = typesetsuppfiles or
-  {"color.cfg", "graphics.cfg", "ltxdoc.cfg", "ltxguide.cfg"}
+  {"color.cfg", "graphics.cfg", "ltxguide.cfg"}
 
 -- Ensure the local format file is used
 function tex(file,dir,mode)
diff --git a/support/ltxdoc.cfg b/support/ltxdoc.cfg
deleted file mode 100644
index 32791f88..00000000
--- a/support/ltxdoc.cfg
+++ /dev/null
@@ -1,41 +0,0 @@
-% \iffalse meta-comment
-%
-% Copyright 2006, 2007, 2011 Heiko Oberdiek
-% Copyright 2014 The LaTeX3 Project
-% 
-% This file is part 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
-%    http://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".
-%
-% \fi
-
-\ProvidesFile{ltxdoc.cfg}%
-  [2014/06/30 v2.0 ltxdoc.cls configuration (LaTeX3 Project)]
-\PassOptionsToClass{a4paper}{article}
-\AtEndOfClass{%
-  \RequirePackage{hypdoc}%
-  \RequirePackage{pdftexcmds}\relax
-  \ifnum\pdf at strcmp{\jobname}{inputenc}=0 %
-    \hypersetup{pdfencoding=auto}%
-    \pdfstringdefDisableCommands{%
-      \def\meta#1{% inputenc.dtx
-        \9060\010#1\9060\011%
-      }%
-    }%
-  \else
-  \fi
-  \pdfstringdefDisableCommands{%
-    \let\env\relax % longtable.dtx
-    \let\mytt\relax % tabularx.dtx
-  }%
-}
-\endinput





More information about the latex3-commits mailing list.