[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/ltxdoc: delay use of \providecommand in case somebody has defined \enquote etc in the preamble (2e8aa098)

Frank Mittelbach frank.mittelbach at latex-project.org
Tue Jun 14 19:56:19 CEST 2022


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/ltxdoc
Link       : https://github.com/latex3/latex2e/commit/2e8aa0989995cd5fcf4f63d482ac0b77a4c68098

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

commit 2e8aa0989995cd5fcf4f63d482ac0b77a4c68098
Author: Frank Mittelbach <frank.mittelbach at latex-project.org>
Date:   Tue Jun 14 19:56:19 2022 +0200

    delay use of \providecommand in case somebody has defined \enquote etc in the preamble


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

2e8aa0989995cd5fcf4f63d482ac0b77a4c68098
 base/changes.txt |  5 +++++
 base/ltxdoc.dtx  | 27 +++++++++++++++------------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index f880f43d..c68e1ac8 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -10,6 +10,11 @@ are not part of the distribution.
 All changes above are only part of the development branch for the next release.
 ================================================================================
 
+2022-06-14  Frank Mittelbach  <Frank.Mittelbach at latex-project.org>
+
+	* ltxdoc.dtx: Delay definitions of \enquote etc in case they get defined in
+	the preamble of existing documents.
+
 #########################
 # 2022-06-01 Release
 #########################
diff --git a/base/ltxdoc.dtx b/base/ltxdoc.dtx
index 4d854728..f68c45ee 100644
--- a/base/ltxdoc.dtx
+++ b/base/ltxdoc.dtx
@@ -30,7 +30,7 @@
 %
 %<class>\NeedsTeXFormat{LaTeX2e}
 %<class>\ProvidesClass{ltxdoc}
-%<class>         [2022/06/03 v2.1f Standard LaTeX documentation class]
+%<class>         [2022/06/14 v2.1g Standard LaTeX documentation class]
 %
 %<*driver>
 \documentclass{ltxdoc}
@@ -623,27 +623,30 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\url}
-%    \begin{macrocode}
-\providecommand\url{\texttt}
-%    \end{macrocode}
-% \end{macro}
 %
 %    \begin{macrocode}
 \def\task#1#2{}
 %    \end{macrocode}
+%
+%
 % \changes{v2.1f}{2022/06/03}{define \cs{pkg} and other commands}
 % \changes{v2.1f}{2022/06/03}{allow \_ in macro names}
 % Some feaures from l3doc.cls
+% \changes{v2.1g}{2022/06/14}{define \cs{pkg} but delay until begin document}
 %    \begin{macrocode}
-\providecommand\LuaTeX{Lua\TeX}
-\providecommand\cls{\textsf}
-\providecommand\pkg{\textsf}
-\providecommand\enquote[1]{``#1''}
 \DeclareRobustCommand\cs[1]{\texttt{\bslash\detokenize{#1}}}%
 \AtBeginDocument{%
   \renewcommand\PrintMacroName[1]{\MacroFont\detokenize{#1}}%
-  }
+%    \end{macrocode}
+%    We provide those delated in case somebody has loaded \texttt{csquotes}
+%    or makes some definitions in the preamble.
+%    \begin{macrocode}
+  \providecommand\LuaTeX{Lua\TeX}
+  \providecommand\cls{\textsf}
+  \providecommand\pkg{\textsf}
+  \providecommand\enquote[1]{``#1''}
+  \providecommand\url{\texttt}
+}
 %    \end{macrocode}
 %
 %    \begin{macrocode}
@@ -667,7 +670,7 @@ Bug reports can be opened (category \texttt{#1}) at\\%
 % 
 
 \ProvidesFile{ltxdoc.cfg}%
-  [2021/12/07 v2.0c ltxdoc.cls configuration (LaTeX Project)]
+  [2022/06/14 v2.0d ltxdoc.cls configuration (LaTeX Project)]
 \PassOptionsToClass{a4paper}{article}
 
 % hyperref and hypdoc are now loaded late (or by the user) so we have to wait





More information about the latex3-commits mailing list.