summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/crefthe/crefthe.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-07-24 03:04:00 +0000
committerNorbert Preining <norbert@preining.info>2023-07-24 03:04:00 +0000
commit19444d4440a66200b03e05b567996375d0404a46 (patch)
tree450f6790376fe84313c8b2840fe51307bcac2f9e /macros/latex/contrib/crefthe/crefthe.sty
parent8e64fc98a1773bc22a0f010f106d56a028e48597 (diff)
CTAN sync 202307240303
Diffstat (limited to 'macros/latex/contrib/crefthe/crefthe.sty')
-rw-r--r--macros/latex/contrib/crefthe/crefthe.sty64
1 files changed, 43 insertions, 21 deletions
diff --git a/macros/latex/contrib/crefthe/crefthe.sty b/macros/latex/contrib/crefthe/crefthe.sty
index e1ce211bb6..4097b0aefc 100644
--- a/macros/latex/contrib/crefthe/crefthe.sty
+++ b/macros/latex/contrib/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 }