From 360c779f505ae5d8baf567f534861a7a9c7afcb2 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 1 Jul 2022 03:01:35 +0000
Subject: CTAN sync 202207010301

---
 macros/latex/contrib/crefthe/crefthe.sty | 44 +++++++++++++++++++++++++-------
 1 file changed, 35 insertions(+), 9 deletions(-)

(limited to 'macros/latex/contrib/crefthe/crefthe.sty')

diff --git a/macros/latex/contrib/crefthe/crefthe.sty b/macros/latex/contrib/crefthe/crefthe.sty
index 286a5dac86..f993302d76 100644
--- a/macros/latex/contrib/crefthe/crefthe.sty
+++ b/macros/latex/contrib/crefthe/crefthe.sty
@@ -9,11 +9,10 @@
 %%
 %%    http://www.latex-project.org/lppl.txt
 %%
-\NeedsTeXFormat{LaTeX2e}[2020-10-01]
-\RequirePackage{l3keys2e}
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
 \ProvidesExplPackage
   {crefthe}
-  {2022/05/13} {}
+  {2022/06/30} {}
   {Cross referencing with proper definite articles}
 
 \keys_define:nn { crefthe }
@@ -25,7 +24,7 @@
     , unknown    .code:n     =
         { \PassOptionsToPackage { \CurrentOption } { cleveref } }
   }
-\ProcessKeysOptions { crefthe }
+\ProcessKeyOptions [ crefthe ]
 
 \bool_if:NT \l__crefthe_nameinlink_bool
   {
@@ -116,18 +115,29 @@
     \__crefthe_name_general:nnnnnn { #1 } { #2 } { #3 } { #4 } { #5 } { C }
   }
 
-\cs_new_protected:Nn \__crefthe_name_general:nnnnnn
+\cs_new:Nn \crefthe_empty_adjust:n
   {
-    % #6 is c or C
-    \tl_if_blank:nTF { #2 }
+    \tl_if_blank:nTF { #1 }
       {
-        \__crefthe_name_general_do:nnnnnn { #1 } {} { #3 } {} { #5 } { #6 }
+        \skip_horizontal:n { -.75ex }
       }
       {
-        \__crefthe_name_general_do:nnnnnn { #1 } { \crefthemark { #2 } } { #3 } { \crefthemark { #4 } } { #5 } { #6 }
+        #1
       }
   }
 
+\cs_new_protected:Nn \__crefthe_name_general:nnnnnn
+  {
+    % #6 is c or C
+    \__crefthe_name_general_do:nnnnnn
+      { #1 }
+      { \crefthemark { \crefthe_empty_adjust:n { #2 } } }
+      { \crefthe_empty_adjust:n { #3 } }
+      { \crefthemark { \crefthe_empty_adjust:n { #4 } } }
+      { \crefthe_empty_adjust:n { #5 } }
+      { #6 }
+  }
+
 \cs_new_protected:Nn \__crefthe_name_general_do:nnnnnn
   {
     \use:c { crefthe_#6refname_original:w } { #1 } { #2 #3 } { #4 #5 }
@@ -215,6 +225,22 @@
         { #1 }
   }
 
+\NewDocumentCommand \crefthepatchname { m }
+  {
+    \clist_map_inline:nn { #1 }
+      {
+        \crefthe_patch_name:n { ##1 }
+      }
+  }
+
+\cs_new:Nn \crefthe_patch_name:n
+  {
+    \tl_gput_left:cn { cref@#1@name        } { \crefthemark { \crefthe_empty_adjust:n {} } }
+    \tl_gput_left:cn { cref@#1@name@plural } { \crefthemark { \crefthe_empty_adjust:n {} } }
+    \tl_gput_left:cn { Cref@#1@name        } { \crefthemark { \crefthe_empty_adjust:n {} } }
+    \tl_gput_left:cn { Cref@#1@name@plural } { \crefthemark { \crefthe_empty_adjust:n {} } }
+  }
+
 \hook_gput_code:nnn { begindocument/end } { crefthe }
   {
     \bool_if:NT \l__crefthe_overwrite_bool
-- 
cgit v1.2.3

