diff options
author | Karl Berry <karl@freefriends.org> | 2023-07-23 20:46:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-07-23 20:46:21 +0000 |
commit | ae1332fafcfb17b37645719d7ccac4fd6dbbe911 (patch) | |
tree | 097f74d9dac8553f80a813c2b83b8e05f60b7dcf /Master/texmf-dist/tex/latex | |
parent | 79e549ef80975d1df7e70ec9dd4721f70cb8e723 (diff) |
crefthe (23jul23)
git-svn-id: svn://tug.org/texlive/trunk@67713 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/crefthe/crefthe.sty | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/crefthe/crefthe.sty b/Master/texmf-dist/tex/latex/crefthe/crefthe.sty index e1ce211bb61..4097b0aefc1 100644 --- a/Master/texmf-dist/tex/latex/crefthe/crefthe.sty +++ b/Master/texmf-dist/tex/latex/crefthe/crefthe.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplPackage {crefthe} - {2023/07/22} {} + {2023/07/23} {} {Cross referencing with proper definite articles} \keys_define:nn { crefthe } @@ -21,6 +21,12 @@ , overwrite .initial:n = { false } , nameinlink .bool_set:N = \l__crefthe_nameinlink_bool , nameinlink .initial:n = { false } + + , disable-german-article-contractions .bool_set:N = \l__crefthe_disable_contractions_for_german_bool + , disable-german-article-contractions .initial:n = { false } + , disable~german~article~contractions .bool_set:N = \l__crefthe_disable_contractions_for_german_bool + , disable german article contractions .bool_set:N = \l__crefthe_disable_contractions_for_german_bool + , unknown .code:n = { \PassOptionsToPackage { \CurrentOption } { cleveref } } } @@ -89,6 +95,8 @@ \keys_define:nn { crefthe-setting } { + , noun .code:n = { \RenewDocumentCommand \crefthemark { m } {} } + , variant .tl_set:N = \l__crefthe_variant_tl % , nom .meta:n = { variant = Nominativ } @@ -125,6 +133,8 @@ % #5 = label % #6 = original command, such as \crefthe_cref_original:w or \crefthe_Cref_original:w { + \group_begin: + \tl_set:Nn \l__crefthe_variant_tl {} \bool_gset_false:N \g__crefthe_has_prep_bool \tl_set:Nn \l__crefthe_prep_tl {} @@ -137,6 +147,11 @@ \bool_set_false:N \l__crefthe_variant_matched_bool \str_if_in:nnF { ##1 } { = } {% for keys without values + \str_case:nnT { ##1 } + { + { abbr } { \tl_set:Nn \l__crefthe_variant_tl { abbr. } } + { abbr. } { \tl_set:Nn \l__crefthe_variant_tl { abbr. } } + } { \bool_set_true:N \l__crefthe_variant_matched_bool } \str_if_eq:VnT \languagename { ngerman } { \str_case:nnT { ##1 } @@ -182,12 +197,12 @@ } } } - \group_begin: \bool_if:NTF #1 { #6 * { #5 } } { #6 { #5 } } - \group_end: \tl_gclear:N \l__crefthe_prep_each_tl + + \group_end: } % \__crefthe_prep_mode: defines the default mode for supported languages @@ -493,25 +508,30 @@ { De~le } { Du } { De~les } { Des } } -\tl_const:Nn \c_crefthe_contraction_rule_ngerman_tl - { - { an~dem } { am } - { an~das } { ans } - { bei~dem } { beim } - { in~dem } { im } - { in~das } { ins } - { von~dem } { vom } - { zu~dem } { zum } - { zu~der } { zur } - { An~dem } { Am } - { An~das } { Ans } - { Bei~dem } { Beim } - { In~dem } { Im } - { In~das } { Ins } - { Von~dem } { Vom } - { Zu~dem } { Zum } - { Zu~der } { Zur } + +\bool_if:NF \l__crefthe_disable_contractions_for_german_bool + { + \tl_const:Nn \c_crefthe_contraction_rule_ngerman_tl + { + { an~dem } { am } + { an~das } { ans } + { bei~dem } { beim } + { in~dem } { im } + { in~das } { ins } + { von~dem } { vom } + { zu~dem } { zum } + { zu~der } { zur } + { An~dem } { Am } + { An~das } { Ans } + { Bei~dem } { Beim } + { In~dem } { Im } + { In~das } { Ins } + { Von~dem } { Vom } + { Zu~dem } { Zum } + { Zu~der } { Zur } + } } + \tl_const:Nn \c_crefthe_contraction_rule_italian_tl { { a~il } { al } @@ -585,6 +605,7 @@ { Su~gli } { Sugli } { Su~le } { Sulle } } + \tl_const:Nn \c_crefthe_contraction_rule_spanish_tl { { a~el } { al } @@ -592,6 +613,7 @@ { A~el } { Al } { De~el } { Del } } + \tl_const:Nn \c_crefthe_contraction_rule_portuguese_tl { { a~o } { ao } |