From 7d63dc6943a9213ce3fb1d2dcdd45be5181ef1e3 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 12 Jul 2022 19:52:42 +0000 Subject: create-theorem (12jul22) git-svn-id: svn://tug.org/texlive/trunk@63879 c570f23f-e606-0410-a88d-b1316a301751 --- .../latex/create-theorem/create-theorem-doc.pdf | Bin 67703 -> 67715 bytes .../latex/create-theorem/create-theorem-doc.tex | 2 +- .../tex/latex/create-theorem/create-theorem.sty | 77 +++++++++++++++------ 3 files changed, 56 insertions(+), 23 deletions(-) diff --git a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf index cf67812782e..ff58a811b7c 100644 Binary files a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf and b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.pdf differ diff --git a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex index b281023f6d7..76807f91d31 100644 --- a/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex +++ b/Master/texmf-dist/doc/latex/create-theorem/create-theorem-doc.tex @@ -97,7 +97,7 @@ \begin{document} -\def\PackageVersion{2022/07/01} +\def\PackageVersion{2022/07/11} \title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support} \author{Jinwen XU} diff --git a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty index be073eddeda..fb9ecdc5510 100644 --- a/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty +++ b/Master/texmf-dist/tex/latex/create-theorem/create-theorem.sty @@ -12,7 +12,7 @@ \NeedsTeXFormat{LaTeX2e}[2022-06-01] \ProvidesExplPackage {create-theorem} - {2022/07/01} {} + {2022/07/11} {} {Initializing theorem-like environments with multilingual support} \keys_define:nn { create-theorem } @@ -214,10 +214,10 @@ % It is assumed that when #3 is empty, so is #5 \tl_if_blank:eTF { #3 } { - \tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } } - \tl_gset:cn { g_crthm_core_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } } - \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } } - \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } } + \tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { } + \tl_gset:cn { g_crthm_core_name_ #7 ref_article_plural_ #1 _ #2 _tl } { } + \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \nobreak \crefthemark { \skip_horizontal:n { -.75ex } } \nobreak } + \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \nobreak \crefthemark { \skip_horizontal:n { -.75ex } } \nobreak } } { \tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { #3 } @@ -231,8 +231,21 @@ \tl_new:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } } - \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #4 } } - \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #6 } } + \tl_if_blank:eTF { #4 } + { + \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \nobreak \skip_horizontal:n { -.25ex } \nobreak } + } + { + \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #4 } } + } + + \tl_if_blank:eTF { #6 } + { + \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \nobreak \skip_horizontal:n { -.25ex } \nobreak } + } + { + \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #6 } } + } \bool_if:NTF \l__crthm_regionalref_bool {% "regionalref" mode @@ -613,10 +626,10 @@ % Uncomment the lines below if you wish to use the definite article of the first environment % \bool_if:NT \l_tmpa_bool % { - \tl_gset:cn { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_singular_ ####1 _ ##1 _tl } } - \tl_gset:cn { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_plural_ ####1 _ ##1 _tl } } - \tl_gset:cn { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_singular_ ####1 _ ##1 _tl } } - \tl_gset:cn { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_plural_ ####1 _ ##1 _tl } } + \tl_gset_eq:cc { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { g_crthm_core_name_cref_article_singular_ ####1 _ ##1 _tl } + \tl_gset_eq:cc { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } { g_crthm_core_name_cref_article_plural_ ####1 _ ##1 _tl } + \tl_gset_eq:cc { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } { g_crthm_core_name_Cref_article_singular_ ####1 _ ##1 _tl } + \tl_gset_eq:cc { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } { g_crthm_core_name_Cref_article_plural_ ####1 _ ##1 _tl } % \bool_set_false:N \l_tmpa_bool % } \seq_gput_right:cn { g_crthm_name_heading_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_heading_ ####1 _ ##1 _tl } } @@ -625,25 +638,45 @@ \seq_gput_right:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_Cref_singular_ ####1 _ ##1 _tl } } \seq_gput_right:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_Cref_plural_ ####1 _ ##1 _tl } } % set the numbering style to be the same as the last environment - \tl_gset:cn { g_crthm_number_style_ #1 _tl } { \tl_use:c { g_crthm_number_style_ ####1 _tl } } + \tl_gset_eq:cc { g_crthm_number_style_ #1 _tl } { g_crthm_number_style_ ####1 _tl } } % set heading name for the combined environment \tl_gset:cn { g_crthm_name_heading_ #1 _ ##1 _tl } { \seq_use:cn { g_crthm_name_heading_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } % set crefname for the combined environment - \__crthm_set_name_crefname:nnn { #1 } { ##1 } + \tl_if_empty:cTF { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { - [ \tl_use:c { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } ] - { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } - [ \tl_use:c { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } ] - { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + \__crthm_set_name_crefname:nnn { #1 } { ##1 } + { + { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + } + } + { + \__crthm_set_name_crefname:nnn { #1 } { ##1 } + { + [ \tl_use:c { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } ] + { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + [ \tl_use:c { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } ] + { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + } } % set Crefname for the combined environment - \__crthm_set_name_Crefname:nnn { #1 } { ##1 } + \tl_if_empty:cTF { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } + { + \__crthm_set_name_Crefname:nnn { #1 } { ##1 } + { + { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + } + } { - [ \tl_use:c { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } ] - { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } - [ \tl_use:c { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } ] - { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + \__crthm_set_name_Crefname:nnn { #1 } { ##1 } + { + [ \tl_use:c { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } ] + { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + [ \tl_use:c { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } ] + { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } } + } } } } -- cgit v1.2.3