[latex3-commits] [git/LaTeX3-latex3-hyperref] cleanup-patches: add tools to disable patches if needed (ff0c5d6)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Apr 30 18:51:59 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : cleanup-patches
Link       : https://github.com/latex3/hyperref/commit/ff0c5d6122a4938440804d5980ffc99615ae1638

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

commit ff0c5d6122a4938440804d5980ffc99615ae1638
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Apr 30 18:51:59 2022 +0200

    add tools to disable patches if needed


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

ff0c5d6122a4938440804d5980ffc99615ae1638
 ChangeLog.txt                        |   2 +
 nameref.dtx                          | 309 ++++++++++++++++++++++-------------
 testfiles/nameref-nopatch.etex.tlg   |  56 +++++++
 testfiles/nameref-nopatch.luatex.tlg |  60 +++++++
 testfiles/nameref-nopatch.lvt        |  27 +++
 testfiles/nameref-nopatch.tlg        |  54 ++++++
 6 files changed, 393 insertions(+), 115 deletions(-)

diff --git a/ChangeLog.txt b/ChangeLog.txt
index 014c629..f22969d 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,5 +1,7 @@
 XXXX-XX-XX Ulrike Fischer/David Carlisle
 
+    * various patches in nameref can now be disabled by package authors
+      by defining a command.
     * the experimental option localanchorname has been deprecated
     * LaTeX 2020-10-01 is required as hooks are used now.
     * \refstepcounter no longer tests for the slide counter as no reason could be found
diff --git a/nameref.dtx b/nameref.dtx
index 3c80fe3..b91386b 100644
--- a/nameref.dtx
+++ b/nameref.dtx
@@ -91,7 +91,9 @@
 % \textsf{nameref} patches a number of commands (mostly sectioning
 % commands) and environments so that they
 % store \cs{@currentlabelname}. A class or a package that want to provide native
-% support can suppress this patches by defining a command.
+% support instead can suppress this patches by defining commands described below.
+% The commands must be defined before the patch is made, in most cases before
+% \textsf{nameref} is loaded, sometimes only before begin document.
 %
 % \begin{description}
 % \item[sectioning commands] Redefined are
@@ -102,7 +104,8 @@
 %  \textsf{nameref} also stores the level number in a counter \texttt{section at level}
 %  (reason is unknown, only two packages, \textsf{e-french} and \textsf{pdfscreen}
 %  seem to use it), and  surrounds the text with \cs{Sectionformat} (only used by
-%  \textsf{acmart}, \textsf{memoir}, \textsf{pdfscreen}, \textsf{pdfslide}).
+%  \textsf{acmart}, \textsf{memoir}, \textsf{pdfscreen}, \textsf{pdfslide}), a
+%  command which takes two argument: the first the text, the second the level.
 %
 %  \item \cs{@ssect}: command to store the title added,
 %  \cs{Sectionformat} is added.
@@ -111,8 +114,63 @@
 %
 %  \item \cs{@part}, \cs{@spart}, \cs{@chapter}, \cs{@schapter}:
 %  command to store the title added
+%  \item \cs{ttl at sect@i} (from the \textsf{titlesec} package):
+%   command to store the title added
 %  \end{itemize}
 %
+% All the patches excepted the last are disabled if the command
+% \cs{NR at nopatch@sectioning} is defined (the actual definition is irrelevant, only
+% existence is tested. The titlesec patch is disabled if
+% \cs{NR at nopatch@titlesec} is defined.
+% This currently only suppress the actual patches, the counter,
+% \cs{Sectionformat} and also the internal copies \cs{NR at sect} etc are still
+% defined.
+%
+% \item[captions] The following commands are patched
+% \begin{itemize}
+% \item \cs{@caption}: command to store the title added. This is done at begin
+% document, but only if \textsf{hyperref} is not detected. With \textsf{hyperref}
+% the patch is done there (and must be disabled in \textsf{hyperref}).
+%
+% This patch can be disabled by defining \cs{NR at nopatch@caption}
+%
+% \item \cs{LT at c@ption} (from the \textsf{longtable} package):
+% command to store the title added.
+%
+% This patch can be disabled by defining \cs{NR at nopatch@longtable}
+%
+% \item \cs{lst at MakeCaption} (from the \textsf{listings} package)
+%
+% This patch can be disabled by defining \cs{NR at nopatch@listings}
+% \end{itemize}
+%
+% \item[lists] The following command is patched
+% \begin{itemize}
+% \item \cs{descriptionlabel}: command to store the label text added. To
+% reference this text the \cs{label} must be put \emph{inside} the label.
+% This is not compatible with the \textsf{enumitem} package as internal
+% formatting commands are written to the \texttt{.aux} file too.
+%
+% This patch can be disabled by defining \cs{NR at nopatch@lists}
+% \end{itemize}
+%
+% \item[theorems]
+%
+% \begin{itemize}
+% \item \cs{@opargbegintheorem}: command to store the title added.
+%
+% This patch can be disabled by defining \cs{NR at nopatch@theorem}
+%
+% \item \cs{@begintheorem} (if amsthm is loaded and if
+% the command has a tested meaning): command to store the title added.
+%
+% This patch can be disabled by defining \cs{NR at nopatch@amsthm}
+%
+% \end{itemize}
+% \item[beamer] In the \textsf{beamer} class the following commands are
+% patched: \cs{beamer at section}, \cs{beamer at subsection}, \cs{beamer at subsubsection},
+% \cs{beamer at descriptionitem} and the template \texttt{theorem begin}. If
+% \cs{NR at nopatch@beamer} is defined nothing is done.
 % \end{description}
 %
 % \section{History}
@@ -341,11 +399,12 @@
 %    \end{macrocode}
 %    \begin{macro}{\@sect}
 %    \begin{macrocode}
-\def\@sect#1#2#3#4#5#6[#7]#8{%
-  \setcounter{section at level}{#2}%
-  \NR at gettitle{#7}%
-  \NR at sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\Sectionformat{#8}{#2}}%
-}
+\@ifundefined{NR at nopatch@sectioning}
+ {\def\@sect#1#2#3#4#5#6[#7]#8{%
+   \setcounter{section at level}{#2}%
+   \NR at gettitle{#7}%
+   \NR at sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\Sectionformat{#8}{#2}}%
+ }}{}
 %    \end{macrocode}
 %    \end{macro}
 % and now the unnumbered ones
@@ -354,33 +413,35 @@
 \let\NR at ssect\@ssect
 %    \end{macrocode}
 %    \end{macro}
-%    \begin{macro}{\NR at ssect}
+%    \begin{macro}{\@ssect}
 %    \begin{macrocode}
-\def\@ssect#1#2#3#4#5{%
-  \NR at gettitle{#5}%
-  \NR at ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}%
-}
+\@ifundefined{NR at nopatch@sectioning}
+ {\def\@ssect#1#2#3#4#5{%
+   \NR at gettitle{#5}%
+   \NR at ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}%
+ }}{}
 %    \end{macrocode}
 %    \end{macro}
 %
 % Support for class memoir.
 %
 %    \begin{macrocode}
-\ltx at IfUndefined{ifheadnameref}{%
-}{%
-  \ltx at IfUndefined{M at sect}{%
+\@ifundefined{NR at nopatch@sectioning}
+ {\ltx at IfUndefined{ifheadnameref}{%
   }{%
-    \let\NRorg at M@sect\M at sect
-    \def\M at sect#1#2#3#4#5#6[#7][#8]{%
-      \ifheadnameref
-        \NR at gettitle{#8}%
-      \else
-        \NR at gettitle{#7}%
-      \fi
-      \NRorg at M@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}][{#8}]%
+    \ltx at IfUndefined{M at sect}{%
+    }{%
+      \let\NRorg at M@sect\M at sect
+      \def\M at sect#1#2#3#4#5#6[#7][#8]{%
+        \ifheadnameref
+          \NR at gettitle{#8}%
+        \else
+          \NR at gettitle{#7}%
+        \fi
+        \NRorg at M@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}][{#8}]%
+      }%
     }%
-  }%
-}
+  }}{}
 %    \end{macrocode}
 %
 % Parts and chapters are treated differently. sigh.
@@ -388,51 +449,53 @@
 %
 %    \begin{macrocode}
 \let\NR at part\@part
-\long\def\@part[#1]#2{%
-  \NR at gettitle{#1}%
-  \NR at part[{#1}]{#2}%
-}
 \let\NR at spart\@spart
-\long\def\@spart#1{%
-  \NR at gettitle{#1}%
-  \NR at spart{#1}%
-}
 \let\NR at chapter\@chapter
-\def\@chapter[#1]#2{%
-  \NR at gettitle{#1}%
-  \NR at chapter[{#1}]{#2}%
-}
-\@ifclassloaded{memoir}{%
-  \ltx at IfUndefined{ifheadnameref}{%
-  }{%
-    \def\@chapter[#1]#2{%
-      \ltx at IfUndefined{ch at pt@c}{%
-        \NR at gettitle{#1}%
-      }{%
-        \ifx\ch at pt@c\ltx at empty
-          \NR at gettitle{#2}%
-        \else
-          \def\NR at temp{#1}%
-          \ifx\NR at temp\ltx at empty
-            \expandafter\NR at gettitle\expandafter{\ch at pt@c}%
+\let\NR at schapter\@schapter
+\@ifundefined{NR at nopatch@sectioning}
+ {%
+  \long\def\@part[#1]#2{%
+    \NR at gettitle{#1}%
+    \NR at part[{#1}]{#2}%
+  }
+  \long\def\@spart#1{%
+    \NR at gettitle{#1}%
+    \NR at spart{#1}%
+  }
+  \def\@chapter[#1]#2{%
+    \NR at gettitle{#1}%
+    \NR at chapter[{#1}]{#2}%
+  }
+  \@ifclassloaded{memoir}{%
+    \ltx at IfUndefined{ifheadnameref}{%
+    }{%
+      \def\@chapter[#1]#2{%
+        \ltx at IfUndefined{ch at pt@c}{%
+          \NR at gettitle{#1}%
+        }{%
+          \ifx\ch at pt@c\ltx at empty
+            \NR at gettitle{#2}%
           \else
-            \ifheadnameref
-              \NR at gettitle{#1}%
-            \else
+            \def\NR at temp{#1}%
+            \ifx\NR at temp\ltx at empty
               \expandafter\NR at gettitle\expandafter{\ch at pt@c}%
+            \else
+              \ifheadnameref
+                \NR at gettitle{#1}%
+              \else
+                \expandafter\NR at gettitle\expandafter{\ch at pt@c}%
+              \fi
             \fi
           \fi
-        \fi
+        }%
+        \NR at chapter[{#1}]{#2}%
       }%
-      \NR at chapter[{#1}]{#2}%
     }%
-  }%
-}{}
-\let\NR at schapter\@schapter
-\def\@schapter#1{%
-  \NR at gettitle{#1}%
-  \NR at schapter{#1}%
-}
+  }{}
+  \def\@schapter#1{%
+    \NR at gettitle{#1}%
+    \NR at schapter{#1}%
+  }}{}
 %    \end{macrocode}
 %
 % Captions
@@ -441,25 +504,30 @@
 \AtBeginDocument{%
   \@ifpackageloaded{hyperref}{}
   {%
-    \let\NR@@caption\@caption
-    \long\def\@caption#1[#2]{%
+    \@ifundefined{NR at nopatch@caption}
+     {\let\NR@@caption\@caption
+      \long\def\@caption#1[#2]{%
       \NR at gettitle{#2}%
       \NR@@caption{#1}[{#2}]%
-    }%
+       }}%
+     {}%
   }%
 %    \end{macrocode}
 %
 %    \begin{macrocode}
   \@ifpackageloaded{longtable}{%
-    \let\NRorg at LT@c at ption\LT at c@ption
-    \def\LT at c@ption#1[#2]#3{%
-      \NRorg at LT@c at ption{#1}[{#2}]{#3}%
-      \def\@tempa{#2}%
-      \ifx\@tempa\@empty
-      \else
+   \@ifundefined{NR at nopatch@longtable}
+    {%
+      \let\NRorg at LT@c at ption\LT at c@ption
+      \def\LT at c@ption#1[#2]#3{%
+       \NRorg at LT@c at ption{#1}[{#2}]{#3}%
+       \def\@tempa{#2}%
+       \ifx\@tempa\@empty
+       \else
         \NR at gettitle{#2}%
-      \fi
-    }%
+       \fi
+      }%
+    }{}%
   }{}%
 %    \end{macrocode}
 %
@@ -467,11 +535,13 @@
 %    \begin{macrocode}
   \ltx at IfUndefined{descriptionlabel}{%
   }{%
-    \let\NRorg at descriptionlabel\descriptionlabel
-    \def\descriptionlabel#1{%
-      \NR at gettitle{#1}%
-      \NRorg at descriptionlabel{#1}%
-    }%
+    \@ifundefined{NR at nopatch@longtable}
+     {\let\NRorg at descriptionlabel\descriptionlabel
+      \def\descriptionlabel#1{%
+       \NR at gettitle{#1}%
+       \NRorg at descriptionlabel{#1}%
+       }%
+     }{}%
   }%
 }
 %    \end{macrocode}
@@ -481,10 +551,13 @@
 \AtBeginDocument{%
   \@ifpackageloaded{titlesec}{%
     \let\NRorg at ttl@sect at i\ttl at sect@i
-    \def\ttl at sect@i#1#2[#3]#4{%
-      \NR at gettitle{#4}%
-      \NRorg at ttl@sect at i{#1}{#2}[{#3}]{#4}%
-    }%
+    \@ifundefined{NR at nopatch@titlesec}
+     {%
+       \def\ttl at sect@i#1#2[#3]#4{%
+         \NR at gettitle{#4}%
+         \NRorg at ttl@sect at i{#1}{#2}[{#3}]{#4}%
+         }%
+      }{}%
   }{}%
 }
 %    \end{macrocode}
@@ -493,39 +566,42 @@
 %
 %    \begin{macrocode}
 \@ifclassloaded{beamer}{%
-  \def\NR at PatchBeamer#1{%
-    \expandafter\let\csname NRorg at beamer@#1\expandafter\endcsname
-                    \csname beamer@#1\endcsname
-    \begingroup
-      \edef\x{\endgroup
-        \long\def\expandafter\noexpand\csname beamer@#1\endcsname
-            [####1]{% hash-ok
-          \noexpand\NR at gettitle{####1}%
-          \expandafter\noexpand\csname NRorg at beamer@#1\endcsname
-          [{####1}]%
+  \@ifundefined{NR at nopatch@beamer}
+  {%
+    \def\NR at PatchBeamer#1{%
+      \expandafter\let\csname NRorg at beamer@#1\expandafter\endcsname
+                      \csname beamer@#1\endcsname
+      \begingroup
+        \edef\x{\endgroup
+          \long\def\expandafter\noexpand\csname beamer@#1\endcsname
+              [####1]{% hash-ok
+            \noexpand\NR at gettitle{####1}%
+            \expandafter\noexpand\csname NRorg at beamer@#1\endcsname
+            [{####1}]%
+          }%
         }%
-      }%
-    \x
-  }%
-  \NR at PatchBeamer{section}%
-  \NR at PatchBeamer{subsection}%
-  \NR at PatchBeamer{subsubsection}%
+      \x
+    }%
+    \NR at PatchBeamer{section}%
+    \NR at PatchBeamer{subsection}%
+    \NR at PatchBeamer{subsubsection}%
 %    \end{macrocode}
 %
 %    Theorem names.
 %    \begin{macrocode}
-  \addtobeamertemplate{theorem begin}{%
-    \expandafter\NR at gettitle\expandafter{\inserttheoremaddition}%
-  }{}%
+    \addtobeamertemplate{theorem begin}{%
+      \expandafter\NR at gettitle\expandafter{\inserttheoremaddition}%
+    }{}%
 %    \end{macrocode}
 %    \begin{macrocode}
-  \@ifdefinable{\NRorg at beamer@descriptionitem}{%
-    \let\NRorg at beamer@descriptionitem\beamer at descriptionitem
-    \renewcommand{\beamer at descriptionitem}[1]{%
-      \NR at gettitle{#1}%
-      \NRorg at beamer@descriptionitem{#1}%
+    \@ifdefinable{\NRorg at beamer@descriptionitem}{%
+      \let\NRorg at beamer@descriptionitem\beamer at descriptionitem
+      \renewcommand{\beamer at descriptionitem}[1]{%
+        \NR at gettitle{#1}%
+        \NRorg at beamer@descriptionitem{#1}%
+      }%
     }%
-  }%
+   }{}%
 }{}
 %    \end{macrocode}
 %
@@ -857,14 +933,17 @@
 %    \begin{macrocode}
 \AtBeginDocument{%
   \@ifpackageloaded{listings}{%
-    \let\NROrg at lst@MakeCaption\lst at MakeCaption
-    \def\lst at MakeCaption{%
-      \ifx\lst at label\@empty
-      \else
-        \let\@currentlabelname\lst@@caption
-      \fi
-      \NROrg at lst@MakeCaption
-    }%
+    \@ifundefined{NR at nopatch@listings}
+     {%
+       \let\NROrg at lst@MakeCaption\lst at MakeCaption
+       \def\lst at MakeCaption{%
+         \ifx\lst at label\@empty
+         \else
+           \let\@currentlabelname\lst@@caption
+         \fi
+         \NROrg at lst@MakeCaption
+       }%
+      }{}%
   }{}%
 }
 %    \end{macrocode}
diff --git a/testfiles/nameref-nopatch.etex.tlg b/testfiles/nameref-nopatch.etex.tlg
new file mode 100644
index 0000000..3ac4b34
--- /dev/null
+++ b/testfiles/nameref-nopatch.etex.tlg
@@ -0,0 +1,56 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \@ssect=macro:
+#1#2#3#4#5->\@tempskipa #3\relax \ifdim \@tempskipa >\z@ \begingroup #4{\@hangfrom {\hskip #1}\interlinepenalty \@M #5\@@par }\endgroup \else \def \@svsechd {#4{\hskip #1\relax #5}}\fi \@xsect {#3}.
+l. ...\show\@ssect
+> \@opargbegintheorem=macro:
+#1#2#3->\NR at gettitle {#3}\NRorg at opargbegintheorem {#1}{#2}{#3}.
+l. ...\show\@opargbegintheorem
+> \@chapter=undefined.
+l. ...\show\@chapter
+> \descriptionlabel=macro:
+#1->\NR at gettitle {#1}\NRorg at descriptionlabel {#1}.
+l. ...\show\descriptionlabel
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\hbox(0.0+0.0)x0.0
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 530.04063fil
+...\write-{}
+...\glue(\topskip) 0.00002
+...\hbox(9.99998+0.0)x345.0, glue set 296.17506fil
+....\hbox(9.27998+0.0)x24.29997
+.....\glue 0.0
+.....\OT1/cmr/bx/n/14.4 1
+.....\glue 16.19998
+....\OT1/cmr/bx/n/14.4 a
+....\OT1/cmr/bx/n/14.4 b
+....\kern0.45
+....\OT1/cmr/bx/n/14.4 c
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\write1{\@writefile{toc}{\protect \contentsline {section}{\protect \numberline \ETC.}
+...\penalty 10000
+...\glue 9.90276 plus 0.86108
+...\write1{\newlabel{abc}{{1}{\thepage }{}{}{}}}
+...\penalty 10000
+...\penalty 10000
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.55556
+..\hbox(6.44444+0.0)x345.0
+...\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+....\glue 0.0 plus 1.0fil
+....\OT1/cmr/m/n/10 1
+....\glue 0.0 plus 1.0fil
+.\kern 0.0
+(nameref-nopatch.aux)
diff --git a/testfiles/nameref-nopatch.luatex.tlg b/testfiles/nameref-nopatch.luatex.tlg
new file mode 100644
index 0000000..8b4a08d
--- /dev/null
+++ b/testfiles/nameref-nopatch.luatex.tlg
@@ -0,0 +1,60 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \@ssect=macro:
+#1#2#3#4#5->\@tempskipa #3\relax \ifdim \@tempskipa >\z@ \begingroup #4{\@hangfrom {\hskip #1}\interlinepenalty \@M #5\@@par }\endgroup \else \def \@svsechd {#4{\hskip #1\relax #5}}\fi \@xsect {#3}.
+l. ...\show\@ssect
+> \@opargbegintheorem=macro:
+#1#2#3->\NR at gettitle {#3}\NRorg at opargbegintheorem {#1}{#2}{#3}.
+l. ...\show\@opargbegintheorem
+> \@chapter=undefined.
+l. ...\show\@chapter
+> \descriptionlabel=macro:
+#1->\NR at gettitle {#1}\NRorg at descriptionlabel {#1}.
+l. ...\show\descriptionlabel
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0, direction TLT
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0, direction TLT
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0, direction TLT
+....\hbox(0.0+0.0)x345.0, direction TLT
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 530.0304fil, direction TLT
+...\write-{}
+...\glue(\topskip) 0.00641
+...\hbox(9.99359+0.0864)x345.0, glue set 297.9696fil, direction TLT
+....\localpar
+.....\localinterlinepenalty=0
+.....\localbrokenpenalty=0
+.....\localleftbox=null
+.....\localrightbox=null
+....\hbox(9.4464+0.0)x22.50719, direction TLT
+.....\glue 0.0
+.....\TU/lmr/bx/n/14.4 1
+.....\glue 14.4
+....\TU/lmr/bx/n/14.4 a
+....\TU/lmr/bx/n/14.4 b
+....\kern0.4464 (font)
+....\TU/lmr/bx/n/14.4 c
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\write1{\@writefile{toc}{\protect \contentsline {section}{\protect \numberline \ETC.}
+...\penalty 10000
+...\glue 9.913 plus 0.86198
+...\write1{\newlabel{abc}{{1}{\thepage }{}{}{}}}
+...\penalty 10000
+...\penalty 10000
+...\glue -0.0864
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.34
+..\hbox(6.66+0.0)x345.0, direction TLT
+...\hbox(6.66+0.0)x345.0, glue set 170.0fil, direction TLT
+....\glue 0.0 plus 1.0fil
+....\TU/lmr/m/n/10 1
+....\glue 0.0 plus 1.0fil
+(nameref-nopatch.aux)
diff --git a/testfiles/nameref-nopatch.lvt b/testfiles/nameref-nopatch.lvt
new file mode 100644
index 0000000..f0ca9a0
--- /dev/null
+++ b/testfiles/nameref-nopatch.lvt
@@ -0,0 +1,27 @@
+\documentclass{article}
+\input{regression-test}
+
+\makeatletter
+\def\NR at nopatch@sectioning{}
+\def\NR at nopatch@theorem{}
+\makeatother
+
+\usepackage{nameref}
+
+\begin{document}
+\START
+\showoutput
+\section{abc}\label{abc}
+
+\makeatletter
+
+\show\@ssect
+
+\show\@opargbegintheorem
+
+\show\@chapter
+
+\show\descriptionlabel
+
+
+\end{document}
\ No newline at end of file
diff --git a/testfiles/nameref-nopatch.tlg b/testfiles/nameref-nopatch.tlg
new file mode 100644
index 0000000..c567d4b
--- /dev/null
+++ b/testfiles/nameref-nopatch.tlg
@@ -0,0 +1,54 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+> \@ssect=macro:
+#1#2#3#4#5->\@tempskipa #3\relax \ifdim \@tempskipa >\z@ \begingroup #4{\@hangfrom {\hskip #1}\interlinepenalty \@M #5\@@par }\endgroup \else \def \@svsechd {#4{\hskip #1\relax #5}}\fi \@xsect {#3}.
+l. ...\show\@ssect
+> \@opargbegintheorem=macro:
+#1#2#3->\NR at gettitle {#3}\NRorg at opargbegintheorem {#1}{#2}{#3}.
+l. ...\show\@opargbegintheorem
+> \@chapter=undefined.
+l. ...\show\@chapter
+> \descriptionlabel=macro:
+#1->\NR at gettitle {#1}\NRorg at descriptionlabel {#1}.
+l. ...\show\descriptionlabel
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0
+....\hbox(0.0+0.0)x345.0
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 530.04063fil
+...\write-{}
+...\glue(\topskip) 0.00002
+...\hbox(9.99998+0.0)x345.0, glue set 296.17506fil
+....\hbox(9.27998+0.0)x24.29997
+.....\glue 0.0
+.....\OT1/cmr/bx/n/14.4 1
+.....\glue 16.19998
+....\OT1/cmr/bx/n/14.4 a
+....\OT1/cmr/bx/n/14.4 b
+....\kern0.45
+....\OT1/cmr/bx/n/14.4 c
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\write1{\@writefile{toc}{\protect \contentsline {section}{\protect \numberline \ETC.}
+...\penalty 10000
+...\glue 9.90276 plus 0.86108
+...\write1{\newlabel{abc}{{1}{\thepage }{}{}{}}}
+...\penalty 10000
+...\penalty 10000
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.55556
+..\hbox(6.44444+0.0)x345.0
+...\hbox(6.44444+0.0)x345.0, glue set 170.0fil
+....\glue 0.0 plus 1.0fil
+....\OT1/cmr/m/n/10 1
+....\glue 0.0 plus 1.0fil
+(nameref-nopatch.aux)





More information about the latex3-commits mailing list.