summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/crefthe/crefthe.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/crefthe/crefthe.sty')
-rw-r--r--Master/texmf-dist/tex/latex/crefthe/crefthe.sty44
1 files changed, 35 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/crefthe/crefthe.sty b/Master/texmf-dist/tex/latex/crefthe/crefthe.sty
index 286a5dac86d..f993302d76b 100644
--- a/Master/texmf-dist/tex/latex/crefthe/crefthe.sty
+++ b/Master/texmf-dist/tex/latex/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