[latex3-commits] [git/LaTeX3-latex3-latex3] l3doc: Make l3doc (package) work with different classes (ae01382c5)

Phelype Oleinik phe.h.o1 at gmail.com
Thu Oct 10 00:53:45 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : l3doc
Link       : https://github.com/latex3/latex3/commit/ae01382c528c112a5cf263b31745c01d2d8f5547

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

commit ae01382c528c112a5cf263b31745c01d2d8f5547
Author: Phelype Oleinik <phe.h.o1 at gmail.com>
Date:   Wed Oct 9 19:53:45 2019 -0300

    Make l3doc (package) work with different classes
    
    Currently working out-of-the-box with amsart, amsbook, article, book (and supposedly with all LaTeX base classes), ctxdoc, extarticle (and supposedly with other extclasses), jltxdoc, l3doc, ltubgoat, ltxdoc, scrartcl, scrbook. Also works, after some small hacks, with memoir, scrdoc, and ydoc.


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

ae01382c528c112a5cf263b31745c01d2d8f5547
 l3kernel/l3doc-pkg.dtx | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/l3kernel/l3doc-pkg.dtx b/l3kernel/l3doc-pkg.dtx
index db0449736..4f715213a 100644
--- a/l3kernel/l3doc-pkg.dtx
+++ b/l3kernel/l3doc-pkg.dtx
@@ -1405,8 +1405,22 @@
 %
 % \subsection{Class and package loading}
 %
-%    \begin{macrocode}
+% The \pkg{doc} package redefines \cs{maketitle} so that it can be used
+% more than once to produce a single document with multiple titles. This
+% redefinition relies on the existence of \cs{@maketitle}, which often
+% is the case, but in a few circumstances the class defines a
+% self-contained \cs{maketitle}, and then \pkg{doc}'s redefinition
+% breaks. Here we nullify \pkg{doc}'s redefinition to maintain the
+% class' definition of \cs{maketitle}. However this doesn't respect
+% \pkg{doc}'s changes to \cs{maketitle}\dots{} This probably will
+% require a case-by-case patching of \cs{maketitle}.
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_saved_maketitle: \maketitle
 \RequirePackage{doc}
+\cs_gset_eq:NN \maketitle \@@_saved_maketitle:
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 \RequirePackage
   {
     array,% Okay
@@ -2528,7 +2542,7 @@
     \small\ttfamily
     \HD at savedestfalse
     \HD at target
-    \Hy at MakeCurrentHref { HD. \int_use:N \c at HD@hypercount }
+    % \Hy at MakeCurrentHref { HD. \int_use:N \c at HD@hypercount }
     \begin{tabular} [t] { @{} l @{} >{\hspace{\tabcolsep}} r @{} }
       \toprule
       \@@_function_extra_labels:
@@ -3546,7 +3560,7 @@
 %   file.
 %
 %    \begin{macrocode}
-\NewDocumentCommand \DocInclude { m }
+\DeclareDocumentCommand \DocInclude { m }
   {
     \relax\clearpage
     \docincludeaux





More information about the latex3-commits mailing list