diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx index e34e9043a54..7c4eca5178a 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3text-case.dtx @@ -43,7 +43,7 @@ % }^^A % } % -% \date{Released 2023-10-23} +% \date{Released 2023-11-01} % % \maketitle % @@ -192,8 +192,12 @@ % \begin{macro}[EXP]{\@@_change_case_lower_sigma:nnnnn} % \begin{macro}[EXP]{\@@_change_case_lower_sigma:nnnnw} % \begin{macro}[EXP]{\@@_change_case_lower_sigma:nnnnN} +% \begin{macro}[EXP] +% { +% \@@_change_case_codepoint_title_auxi:nnnn , +% \@@_change_case_codepoint_title_auxii:nnnn +% } % \begin{macro}[EXP]{\@@_change_case_codepoint_title:nnn} -% \begin{macro}[EXP]{\@@_change_case_codepoint_title:nnnnn} % \begin{macro}[EXP]{\@@_change_case_codepoint:nnnnn} % \begin{macro}[EXP]{\@@_change_case_codepoint:nn} % \begin{macro}[EXP] @@ -695,40 +699,39 @@ \@@_change_case_loop:nnnw {#2} {#3} {#4} #5 } % \end{macrocode} -% For titlecasing, we need to fully expand the new character to see if it -% is a letter (or active). +% For titlecasing, we need to obtain the general category of the current +% codepoint. % \begin{macrocode} \cs_new:Npn \@@_change_case_codepoint_title:nnnn #1#2#3#4 { \bool_if:NTF \l_text_titlecase_check_letter_bool { - \tl_if_single:nTF {#4} + \exp_args:Ne \@@_change_case_codepoint_title_auxi:nnnn { - \bool_lazy_or:nnTF - { \token_if_letter_p:N #4 } - { - \bool_lazy_and_p:nn - { \token_if_active_p:N #4 } - { ! \int_compare_p:nNn {`#4} < { "80 } } - } - { \@@_change_case_codepoint_title:nnn } - { \@@_change_case_codepoint_title:nnnnn { title } {#1} } + \codepoint_to_category:n + { \@@_codepoint_from_chars:Nw #4 } } - { \@@_change_case_codepoint_title:nnn } } { \@@_change_case_codepoint_title:nnn } {#2} {#3} {#4} } +\cs_new:Npn \@@_change_case_codepoint_title_auxi:nnnn #1#2#3#4 + { + \tl_if_head_eq_charcode:nNTF {#1} { L } + { \@@_change_case_codepoint_title:nnn } + { \@@_change_case_codepoint_title_auxii:nnnn { title } } + {#2} {#3} {#4} + } \cs_new:Npn \@@_change_case_codepoint_title:nnn #1#2#3 - { \@@_change_case_codepoint_title:nnnnn { title } { end } {#1} {#2} {#3} } -\cs_new:Npn \@@_change_case_codepoint_title:nnnnn #1#2#3#4#5 + { \@@_change_case_codepoint_title_auxii:nnnn { end } {#1} {#2} {#3} } +\cs_new:Npn \@@_change_case_codepoint_title_auxii:nnnn #1#2#3#4 { - \cs_if_exist_use:cF { @@_change_case_title_ #4 :nnnnn } + \cs_if_exist_use:cF { @@_change_case_title_ #3 :nnnnn } { - \cs_if_exist_use:cF { @@_change_case_upper_ #4 :nnnnn } + \cs_if_exist_use:cF { @@_change_case_upper_ #3 :nnnnn } { \@@_change_case_codepoint:nnnnn } } - {#1} {#2} {#3} {#4} {#5} + { title } {#1} {#2} {#3} {#4} } \cs_new:Npn \@@_change_case_codepoint:nnnnn #1#2#3#4#5 { |