texlive[63296] Master/texmf-dist: crefthe (14may22)

commits+karl at tug.org commits+karl at tug.org
Sat May 14 22:31:34 CEST 2022


Revision: 63296
          http://tug.org/svn/texlive?view=revision&revision=63296
Author:   karl
Date:     2022-05-14 22:31:33 +0200 (Sat, 14 May 2022)
Log Message:
-----------
crefthe (14may22)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.pdf
    trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.tex
    trunk/Master/texmf-dist/tex/latex/crefthe/crefthe.sty

Modified: trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.tex	2022-05-14 20:31:21 UTC (rev 63295)
+++ trunk/Master/texmf-dist/doc/latex/crefthe/crefthe-doc.tex	2022-05-14 20:31:33 UTC (rev 63296)
@@ -111,7 +111,7 @@
 
 \begin{document}
 
-\def\PackageVersion{2022/04/24}
+\def\PackageVersion{2022/05/13}
 
 \title{\crefthepackage{}\\\smallskip\itshape Cross referencing with proper definite articles}
 \author{Jinwen XU}
@@ -255,7 +255,7 @@
 
 \section{The relationship with \textsf{cleveref}}
 
-\crefthepackage{} loads \textsf{cleveref} automatically and pass all the options to it. All its commands, used without optional arguments, degenerate to those in \textsf{cleveref}. For example, \lstinline|\crefthe{...}| is the same as \lstinline|\cref{...}|, and \lstinline|\crefthename| is the same as \lstinline|\crefname| if the definite articles are not specified. That said, you can safely use the command \lstinline|\crefthe| everywhere in your document without causing extra trouble.
+\crefthepackage{} loads \textsf{cleveref} automatically and pass related options to it. All its commands, used without optional arguments, degenerate to those in \textsf{cleveref}. For example, \lstinline|\crefthe{...}| is the same as \lstinline|\cref{...}|, and \lstinline|\crefthename| is the same as \lstinline|\crefname| if the definite articles are not specified. That said, you can safely use the command \lstinline|\crefthe| everywhere in your document without causing extra trouble.
 
 With the package option \packageoption{overwrite}, user commands in \textsf{cleveref} will be replaced by those offered here, thus you can simply write \lstinline|\cref| for \lstinline|\crefthe| -- and similarly with \lstinline|\Cref|, \lstinline|\crefname| and \lstinline|\Crefname|.
 

Modified: trunk/Master/texmf-dist/tex/latex/crefthe/crefthe.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/crefthe/crefthe.sty	2022-05-14 20:31:21 UTC (rev 63295)
+++ trunk/Master/texmf-dist/tex/latex/crefthe/crefthe.sty	2022-05-14 20:31:33 UTC (rev 63296)
@@ -13,18 +13,25 @@
 \RequirePackage{l3keys2e}
 \ProvidesExplPackage
   {crefthe}
-  {2022/04/24} {}
+  {2022/05/13} {}
   {Cross referencing with proper definite articles}
 
 \keys_define:nn { crefthe }
   {
-    , overwrite .bool_set:N = \l__crefthe_overwrite_bool
-    , overwrite .initial:n  = { false }
-    , unknown .code:n       =
-      { \PassOptionsToPackage { \CurrentOption } { cleveref } }
+    , overwrite  .bool_set:N = \l__crefthe_overwrite_bool
+    , overwrite  .initial:n  = { false }
+    , nameinlink .bool_set:N = \l__crefthe_nameinlink_bool
+    , nameinlink .initial:n  = { false }
+    , unknown    .code:n     =
+        { \PassOptionsToPackage { \CurrentOption } { cleveref } }
   }
 \ProcessKeysOptions { crefthe }
 
+\bool_if:NT \l__crefthe_nameinlink_bool
+  {
+    \PassOptionsToPackage { nameinlink } { cleveref }
+  }
+
 \RequirePackage { cleveref }
 \RequirePackage { regexpatch }
 
@@ -124,12 +131,15 @@
 \cs_new_protected:Nn \__crefthe_name_general_do:nnnnnn
   {
     \use:c { crefthe_#6refname_original:w } { #1 } { #2 #3 } { #4 #5 }
-    \hook_gput_code:nnn { begindocument } { crefthe }
+    \bool_if:NT \l__crefthe_nameinlink_bool
       {
-        \crefthe_patch_format:nnnn { #6ref@#1 at format } { #6ref@#1 at name } { #2 } { #3 }
-        \crefthe_patch_format:nnnn { #6ref@#1 at format@first } { #6ref@#1 at name@plural } { #4 } { #5 }
-        \crefthe_patch_format:nnnn { #6refrange@#1 at format } { #6ref@#1 at name@plural } { #4 } { #5 }
-        \crefthe_patch_format:nnnn { #6refrange@#1 at format@first } { #6ref@#1 at name@plural } { #4 } { #5 }
+        \hook_gput_code:nnn { begindocument } { crefthe }
+          {
+            \crefthe_patch_format:nnnn { #6ref@#1 at format } { #6ref@#1 at name } { #2 } { #3 }
+            \crefthe_patch_format:nnnn { #6ref@#1 at format@first } { #6ref@#1 at name@plural } { #4 } { #5 }
+            \crefthe_patch_format:nnnn { #6refrange@#1 at format } { #6ref@#1 at name@plural } { #4 } { #5 }
+            \crefthe_patch_format:nnnn { #6refrange@#1 at format@first } { #6ref@#1 at name@plural } { #4 } { #5 }
+          }
       }
   }
 
@@ -149,12 +159,15 @@
         \exp_args:Nc \regexpatchcmd { #1 }
           { (\cP\# .) \c{ #2 } }
           { \u{l_tmpa_tl} \1 \u{l_tmpb_tl} }
-          { } { \PatchFailed }
+          { } { \msg_warning:nnn { crefthe } { format-patch-failed } { #1 } }
         \makeatother
         \seq_gput_right:Nn \g__crefthe_already_patched_seq { #1 - #2 }
       }
   }
 
+\msg_new:nnn { crefthe }
+  { format-patch-failed }
+  { Failed~to~patch~the~format~"\iow_char:N \\#1"! }
 
 \cs_generate_variant:Nn \text_lowercase:n { V }
 \NewDocumentCommand \crefthemark { m }



More information about the tex-live-commits mailing list.