From 9751df8fcab071b412e307ff1aa3f27504179cbb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 28 Nov 2020 21:42:55 +0000 Subject: bxjaholiday (28nov20) git-svn-id: svn://tug.org/texlive/trunk@57025 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/bxjaholiday/bxjaholiday.sty | 60 ++++++++++++++-------- 1 file changed, 40 insertions(+), 20 deletions(-) (limited to 'Master/texmf-dist/tex/latex/bxjaholiday') 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) { } { } +%% \__bxjh_int_compare_and:nn(TF) { } { } %% ( { } ) ( { } ) \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 } + } } } } -- cgit v1.2.3