diff options
author | Karl Berry <karl@freefriends.org> | 2020-11-28 21:42:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-11-28 21:42:55 +0000 |
commit | 9751df8fcab071b412e307ff1aa3f27504179cbb (patch) | |
tree | c7d48fc91a726156ff12c3815bd09380a8cda36c /Master/texmf-dist/tex | |
parent | 02c994fa16d8c5e6b90a0e0c9405ceec13e7a0b4 (diff) |
bxjaholiday (28nov20)
git-svn-id: svn://tug.org/texlive/trunk@57025 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/bxjaholiday/bxjaholiday.sty | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/bxjaholiday/bxjaholiday.sty b/Master/texmf-dist/tex/latex/bxjaholiday/bxjaholiday.sty index ce47457367b..cb80232ee18 100644 --- a/Master/texmf-dist/tex/latex/bxjaholiday/bxjaholiday.sty +++ b/Master/texmf-dist/tex/latex/bxjaholiday/bxjaholiday.sty @@ -1,7 +1,7 @@ %% %% This is file 'bxjaholiday.sty'. %% -%% Copyright 2018 Takuto ASAKURA (wtsnjp) +%% Copyright 2018-2020 Takuto ASAKURA (wtsnjp) %% GitHub: https://github.com/wtsnjp %% Twitter: @wtsnjp %% @@ -13,7 +13,7 @@ % -------------------------------------------------- declarations \RequirePackage{expl3} -\ProvidesExplPackage {bxjaholiday} {2019/02/03} {1.0.0} +\ProvidesExplPackage {bxjaholiday} {2020/11/28} {1.1.0} {Support for Japanese holidays} % -------------------------------------------------- utilities @@ -23,7 +23,7 @@ \cs_new_eq:Nc \__bxjh_only_preamble:N { @onlypreamble } % short hands -%% \__bxjh_int_compare_and:nn(TF) { <intexpr1> } { <intexpr2> } +%% \__bxjh_int_compare_and:nn(TF) { <integer relation1> } { <integer relation2> } %% ( { <true code> } ) ( { <false code> } ) \prg_new_conditional:Npnn \__bxjh_int_compare_and:nn #1#2 { T, TF } { @@ -111,8 +111,8 @@ { \cs_new:Npn \__bxjh_add_jchar_dec:nnn #1#2#3 { - \ptex_kansujichar:D \c_one_int = \ptex_jis:D "#3 \scan_stop: - \__bxjh_next:n { \ptex_kansuji:D \c_one_int } + \tex_kansujichar:D \c_one_int = \tex_jis:D "#3 \scan_stop: + \__bxjh_next:n { \tex_kansuji:D \c_one_int } } } @@ -120,8 +120,8 @@ { \cs_new:Npn \__bxjh_add_jchar_dec:nnn #1#2#3 { - \ptex_kansujichar:D \c_one_int = \ptex_jis:D "#3 \scan_stop: - \__bxjh_next:n { \ptex_kansuji:D \c_one_int } + \tex_kansujichar:D \c_one_int = \tex_jis:D "#3 \scan_stop: + \__bxjh_next:n { \tex_kansuji:D \c_one_int } } } @@ -636,7 +636,7 @@ { \g_bxjh_kenkoku_tl } { \__bxjh_int_compare_and:nnTF { #3 = 23 } { #1 > 2019 } - { \g_bxjh_tennou_tl } % the "next" era (2020-) + { \g_bxjh_tennou_tl } % the Reiwa period { \__bxjh_date_compare:nnnNnnnT { #1 } { #2 } { #3 } = { 1989 } { 2 } { 24 } @@ -736,7 +736,7 @@ { 7 } % July { - \int_compare:nNnTF { #1 } > { 2020 } + \int_compare:nNnTF { #1 } > { 2021 } { \__bxjh_int_compare_and:nnT % third Monday { \int_div_truncate:nn { #3 - 1 } { 7 } = 2 } @@ -758,19 +758,31 @@ } } { - \int_compare:nNnTF { #1 } > { 2002 } + \int_compare:nNnTF { #1 } = { 2021 } { - \__bxjh_int_compare_and:nnT % third Monday - { \int_div_truncate:nn { #3 - 1 } { 7 } = 2 } + % 2021 Tokyo Olympic year: special case + \int_compare:nNnTF { #3 } = { 22 } + { \g_bxjh_umi_tl } { - \bxjh_day_of_week:nnn { #1 } { #2 } { #3 } - = \c_bxjh_monday_int + \int_compare:nNnT { #3 } = { 23 } + { \g_bxjh_sports_tl } } - { \g_bxjh_umi_tl } } { - \__bxjh_int_compare_and:nnT { #1 > 1995 } { #3 = 20 } - { \g_bxjh_umi_tl } + \int_compare:nNnTF { #1 } > { 2002 } + { + \__bxjh_int_compare_and:nnT % third Monday + { \int_div_truncate:nn { #3 - 1 } { 7 } = 2 } + { + \bxjh_day_of_week:nnn { #1 } { #2 } { #3 } + = \c_bxjh_monday_int + } + { \g_bxjh_umi_tl } + } + { + \__bxjh_int_compare_and:nnT { #1 > 1995 } { #3 = 20 } + { \g_bxjh_umi_tl } + } } } } @@ -778,7 +790,7 @@ { 8 } % August { - \int_compare:nNnTF { #1 } > { 2020 } + \int_compare:nNnTF { #1 } > { 2021 } { \int_compare:nNnT { #3 } = { 11 } { \g_bxjh_yama_tl } @@ -791,8 +803,16 @@ { \g_bxjh_yama_tl } } { - \__bxjh_int_compare_and:nnT { #1 > 2015 } { #3 = 11 } - { \g_bxjh_yama_tl } + \int_compare:nNnTF { #1 } = { 2021 } + { + % 2021 Tokyo Olympic year: special case + \int_compare:nNnT { #3 } = { 8 } + { \g_bxjh_yama_tl } + } + { + \__bxjh_int_compare_and:nnT { #1 > 2015 } { #3 = 11 } + { \g_bxjh_yama_tl } + } } } } |