Skip to content

Instantly share code, notes, and snippets.

@wtsnjp
Last active August 8, 2020 03:41
Show Gist options
  • Save wtsnjp/d6d7debedbfca60042e6df859ba18aac to your computer and use it in GitHub Desktop.
Save wtsnjp/d6d7debedbfca60042e6df859ba18aac to your computer and use it in GitHub Desktop.
%%
%% This is file 'scbxjaholiday.sty'.
%%
%% Copyright 2020 Takuto ASAKURA (wtsnjp)
%% GitHub: https://github.com/wtsnjp
%% Twitter: @wtsnjp
%%
%% This package is distributed under the MIT License.
%%
% Note: This file is encoded entirely in us-ascii.
% -------------------------------------------------- declarations
\RequirePackage{bxjaholiday}
\ProvidesExplPackage {scbxjaholiday} {2020/08/08} {0.8.8}
{Support for Japanese holidays + Snowman's day}
% -------------------------------------------------- the hack
\cs_new_eq:NN \__scbxjh_original_holiday_name:nnn \bxjh_holiday_name:nnn
\cs_set:Npn \bxjh_holiday_name:nnn #1#2#3
{
\__bxjh_int_compare_and:nnTF { #2 = 8 } { #3 = 8 }
{ \g_scbxjh_snowman_tl }
{ \__scbxjh_original_holiday_name:nnn {#1} {#2} {#3} }
}
% -------------------------------------------------- the essential day
\tl_new:N \g_scbxjh_snowman_tl
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{82}{86} } { 3086 } { 2466 }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{81}{8D} } { 304D } { 242D }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{81}{A0} } { 3060 } { 2440 }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{82}{8B} } { 308B } { 246B }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{81}{BE} } { 307E } { 245E }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E3}{81}{AE} } { 306E } { 244E }
\__bxjh_add_jchar:Nnnn \g_scbxjh_snowman_tl { {E6}{97}{A5} } { 65E5 } { 467C }
% -------------------------------------------------- LaTeX2e interface
\cs_set_eq:NN \jaholidayname \bxjh_holiday_name:nnn
% vim: ft=expl3 nospell:
%% EOF
%#!uplatex
\documentclass[uplatex,dvipdfmx]{jsarticle}
\usepackage{scbxjaholiday}
\begin{document}
本日は\jaholidayname{2020}{8}{8}!
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment