diff options
author | Karl Berry <karl@freefriends.org> | 2019-02-03 22:47:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-02-03 22:47:00 +0000 |
commit | 94ca4d6eda3232fcca41b1f37bf34d12908406b3 (patch) | |
tree | 4fdb506244f0efaa914c9198c0359f3422611fb1 /Master/texmf-dist/doc | |
parent | c5d84d1a3ab85b1f314ff62717a7af3c6b75c7af (diff) |
bxjaholiday (3feb19)
git-svn-id: svn://tug.org/texlive/trunk@49924 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjaholiday/LICENSE | 21 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjaholiday/README.md | 62 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.pdf | bin | 0 -> 87495 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.tex | 279 |
4 files changed, 362 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/bxjaholiday/LICENSE b/Master/texmf-dist/doc/latex/bxjaholiday/LICENSE new file mode 100644 index 00000000000..488617373db --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjaholiday/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright 2018 Takuto ASAKURA (wtsnjp) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Master/texmf-dist/doc/latex/bxjaholiday/README.md b/Master/texmf-dist/doc/latex/bxjaholiday/README.md new file mode 100644 index 00000000000..86ee29a75e5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjaholiday/README.md @@ -0,0 +1,62 @@ +# BXjaholiday Package + +LaTeX: Support for Japanese holidays + +## System requirements + +* TeX format: LaTeX +* TeX engine: pdfTeX, XeTeX, LuaTeX, pTeX, and upTeX (The e-TeX extension is **required**) + +## Usage + +This package provides following LaTeX2e commands: + +```tex +\jaholidayname{<year>}{<month>}{<day>} +\jadayofweek{<year>}{<month>}{<day>} +\IfJaHoliday(TF){<year>}{<month>}{<day>}{<true code>}{<false code>} +``` + +Further functions are provided for expl3. See the manual (`bxjaholiday.pdf`) for the details. + +## Building + +You can easily build this package with [l3build](https://github.com/latex3/l3build). + +* Installing the package to TEXMFHOME + +``` +$ ./build.lua install --full +``` + +* Typesetting documentation + +``` +$ ./build.lua doc +``` + +* Running tests + +``` +$ ./build.lua check +``` + +## License + +This package is distributed under [the MIT license](./LICENSE). + +## Revision History + +* Version 1.0.0 ‹2019/02/03› + * Add documentation + * Rename `\g_bxjh_sport_tl` -> `\g_bxjh_sports_tl` +* Version 0.2.0 ‹2019/01/27› + * Support special holidays in 2019 + * Add new expl3 interface `\bxjh_apply_(next|prev)_day:Nnnn` + * Fix a potential bug +* Version 0.1.0 ‹2018/12/03› + * The first public version + +--- + +Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp)) diff --git a/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.pdf b/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.pdf Binary files differnew file mode 100644 index 00000000000..a67a5cdb655 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.pdf diff --git a/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.tex b/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.tex new file mode 100644 index 00000000000..7980e7a8d16 --- /dev/null +++ b/Master/texmf-dist/doc/latex/bxjaholiday/bxjaholiday.tex @@ -0,0 +1,279 @@ +%#!xelatex +\RequirePackage{fontspec} +\documentclass{l3doc} + +% packages +\usepackage{bxjaholiday} +\usepackage{caption} + +% fonts +\newfontfamily{\fIpaex}{IPAexMincho}[Scale=0.95] +\newcommand*{\Ja}[1]{{\fIpaex#1}} + +% logos +\usepackage{bxtexlogo} +\bxtexlogoimport{*} + +% syntax +\newenvironment{code}{\quote\small}{\endquote} + +% cross-refs +\usepackage{wtref} +\newref{tab,sec} + +% macros +\newcommand{\PkgName}{\pkg{bxjaholiday}} +\newcommand{\Ie}{i.\,e.} +\newcommand{\Eg}{e.\,g.} + +\ExplSyntaxOn +\cs_set_eq:NN \_ \c_underscore_str +\cs_new:Npn \__bxjh_doc_holiday_line:nn #1#2 + { + % first column: holiday + #1 & + % second column: variable + \cs { g_bxjh_#2_tl } & + % third column: Name in Japanese + \Ja { \tl_use:c { g_bxjh_#2_tl } } \\ + } +\cs_new:Npn \__bxjh_doc_week_of_day:nn #1#2 + { + % first column: holiday + #1 & + % second column: int variable + \cs { c_bxjh_ \tl_lower_case:n{ #1 } _int } & + % third column: int value + \int_use:c { c_bxjh_ \tl_lower_case:n{ #1 } _int } & + % fourth column: tl variable + \cs { g_bxjh_#2_tl } & + % fifth column: tl value + \Ja { \tl_use:c { g_bxjh_#2_tl } } \\ + } +\cs_new_eq:NN \HolidayLine \__bxjh_doc_holiday_line:nn +\cs_new_eq:NN \WeekofdayLine \__bxjh_doc_week_of_day:nn +\ExplSyntaxOff + +% metadata +\GetFileInfo{\jobname.sty} +\title{The {\PkgName} package} +\author{Takuto ASAKURA (wtsnjp)} +\date{\fileversion \quad [\filedate]} + +\begin{document} + +\maketitle + +\begin{abstract} +This package provides a command to convert dates to names of Japanese holidays +(\emph{shukujitsu}; \Ja{祝日}). For internal use, I need to implement a +function to judge the day of week (\emph{youbi}; \Ja{曜日}), so a command +converting dates to \emph{youbi} in the same manner is also available as a free +gift. The equivalent functions and further (lower-level) APIs are provided for +expl3. +%All {\LaTeXe} and expl3 interfaces are (first-)fully expandable, so +%those could be used almost anywhere in your documents. +\end{abstract} + +%\tableofcontents + +\begin{documentation} + +%\section{Introduction} + +\section{System requirements} + +As one of the BX series\footnote{BX series is a collection of {\LaTeX} packages +mainly developed by Takayuki YATO (a.k.a.~ZR.) ``BX'' stands for +``\underline{b}abel e\underline{x}tensions'' and packages in this series are +normally support various {\TeX} engines not only Japanese-specific ones +({\pTeX}, {\upTeX}, and so on.)} packages, {\PkgName} supports all {\TeX} +engines which supported by expl3 (\Ie, the {\eTeX} extension is required.) +Specifically, following {\TeX} systems are supported: +% +\begin{itemize} +\item {\TeX} format: {\LaTeXe}. +\item {\TeX} engine: {\pdfTeX}, {\XeTeX}, {\LuaTeX},\footnote{Note that if you +want to print Japanese characters with {\TeX} engines which is not specifically +designed for Japanese, you need to setup proper fonts and other things.} +{\pTeX}, and {\upTeX}. +\end{itemize} + +\section{Loading the package} + +The package should be loaded in the usual {\LaTeXe} way. No package option is +available. +% +\begin{code} +|\usepackage{bxjaholiday}| +\end{code} + +\section{{\LaTeXe} interfaces} + +\begin{function}[EXP]{\jaholidayname} +\begin{syntax} +|\jaholidayname|\marg{year}\marg{month}\marg{day} +\end{syntax} +% +This command is expanded to the name of Japanese holiday corresponding to the +specified date, if it is a holiday. For a date which is not a holiday, it will +be expanded to nothing (an empty token.) See Table~\tabref{holidays} for all +possible results. + +For \meta{year}, \meta{month}, and \meta{day}, you can explicitly write +numbers, or use counters, \Eg, |\year|, |\month|, and |\day|. To be exact, +those could be any \meta{integer expression}. +\end{function} + +\begin{function}[EXP]{\jadayofweek} +\begin{syntax} +|\jadayofweek|\marg{year}\marg{month}\marg{day} +\end{syntax} +% +This command converts from a date to the name of week, \Ie, one of \Ja{月, 火, +水, 木, 金, 土, 日}. You can specify the arguments in exactly the same way as +|\jaholidayname|. +\end{function} + +\begin{function}[EXP]{\IfJaHolidayTF,\IfJaHolidayT,\IfJaHolidayF} +\begin{syntax} +|\IfJaHolidayTF|\marg{year}\marg{month}\marg{day}\marg{true code}\marg{false code} +|\IfJaHolidayT|\marg{year}\marg{month}\marg{day}\marg{true code} +|\IfJaHolidayF|\marg{year}\marg{month}\marg{day}\marg{false code} +\end{syntax} +% +The |\IfJaHoliday(TF)| tests are used to check if a date is a Japanese holiday +or not. Note that substitute holidays (\Ja{振替休日}) are also judged as a +holiday in this test. +\end{function} + +\section{expl3 interfaces} + +All expl3 interfaces provided by {\PkgName} belong to the \texttt{bxjh} module. + +\subsection{Functions} + +\begin{function}[EXP]{\bxjh_holiday_name:nnn} +\begin{syntax} +|\bxjh_holiday_name:nnn| \marg{year} \marg{month} \marg{day} +\end{syntax} +% +This is expl3 version of |\jaholidayname|. It converts dates into Japanese +holiday names. +\end{function} + +\begin{function}[EXP]{\bxjh_day_of_week_name:nnn,\bxjh_day_of_week:nnn} +\begin{syntax} +|\bxjh_day_of_week_name:nnn| \marg{year} \marg{month} \marg{day} +|\bxjh_day_of_week:nnn| \marg{year} \marg{month} \marg{day} +\end{syntax} +% +|\bxjh_day_of_week_name:nnn| is an expl3 version of |\jadayofweek|. It converts +a date into day of week in Japanese. To use that information in expl3, \Eg, for +branching, |\bxjh_day_of_week:nnn| is more suitable. It returns an internal +\texttt{int} value, so you can compare those results with the constants provided +by this package. See Section~\secref{variables}. +\end{function} + +\begin{function}[EXP,TF]{\bxjh_if_holiday:nnn} +\begin{syntax} +|\bxjh_if_holiday:nnnTF| \marg{year} \marg{month} \marg{day} \marg{true code} \marg{false code} +\end{syntax} +% +This test is expl3 version of |\IfJaHoliday(TF)|. +\end{function} + +\begin{function}[EXP]{\bxjh_apply_prev_day:Nnnn,\bxjh_apply_next_day:Nnnn} +\begin{syntax} +|\bxjh_apply_prev_day:Nnnn| \meta{function} \marg{year} \marg{month} \marg{day} +|\bxjh_apply_next_day:Nnnn| \meta{function} \marg{year} \marg{month} \marg{day} +\end{syntax} +% +These functions get previous/next day of the specified date, and apply it to +the specified \meta{function}. The \meta{function} must take three arguments in +the order. For example, +% +\begin{code} +|\bxjh_apply_next_day:Nnnn \bxjh_holiday_name:nnn { 2019 } { 12 } { 31 }| +\end{code} +% +produces the result of: +% +\begin{code} +|\bxjh_holiday_name:nnn { 2020 } { 1 } { 1 }| +\end{code} +\end{function} + +\subsection{Variables and constants}\seclabel{variables} + +\paragraph{Names of Japanese holidays} + +All of them are provided as global \texttt{tl} variables. See +Table~\tabref{holidays}. +% +\begin{table}[p] +\centering\small +\caption{Japanese holidays} +\tablabel{holidays} +\begin{tabular}{lll} +\hline +Holiday & Variable & Name in Japanese \\ \hline +\HolidayLine{New Year's Day}{ganjitsu} +\HolidayLine{Coming of Age Day}{seijin} +\HolidayLine{National Foundation Day}{kenkoku} +\HolidayLine{The Emperor's Birthday}{tennou} +\HolidayLine{Vernal Equinox Day}{shunbun} +\HolidayLine{Showa Day}{showa} +\HolidayLine{Greenery Day}{midori} +\HolidayLine{Constitution Memorial Day}{kenpou} +\HolidayLine{National Holiday}{kokumin} +\HolidayLine{Children's Day}{kodomo} +\HolidayLine{(substitute holiday)}{furikae} +\HolidayLine{Marine Day}{umi} +\HolidayLine{Mountain Day}{yama} +\HolidayLine{Autumnal Equinox Day}{shunbun} +\HolidayLine{Respect for the Aged Day}{keirou} +\HolidayLine{Sports Day}{sports} +\HolidayLine{Health and Sports Day}{taiiku} +\HolidayLine{Culture Day}{bunka} +\HolidayLine{Labor Thanksgiving Day}{kinrou} +\HolidayLine{National Mourning of Showa}{showa\_taisou} +\HolidayLine{National Wedding of Akihito}{akihito\_kekkon} +\HolidayLine{National Wedding of Naruhito}{naruhito\_kekkon} +\HolidayLine{Core Enthronement Ceremony}{sokuirei} +\HolidayLine{Coronation Day}{sokui} +\hline +\end{tabular} +\end{table} + +\paragraph{Day of week} + +Internally, {\PkgName} uses integers to represent day of week, and corresponding +\texttt{int} constants are defined. In addition to that, Japanese names of those +are also provided as global \texttt{tl} variables. See +Table~\tabref{dayofweek}. +% +\begin{table}[p] +\centering\small +\caption{Day of week} +\tablabel{dayofweek} +\begin{tabular}{l|lr|ll} +\hline +Day of week & Constant (\texttt{int}) & & Variable (\texttt{tl}) & \\ \hline +\WeekofdayLine{Monday}{getsu} +\WeekofdayLine{Tuesday}{ka} +\WeekofdayLine{Wednesday}{sui} +\WeekofdayLine{Thursday}{moku} +\WeekofdayLine{Friday}{kin} +\WeekofdayLine{Saturday}{do} +\WeekofdayLine{Sunday}{nichi} +\hline +\end{tabular} +\end{table} + +\end{documentation} + +%\PrintChanges + +\end{document} +% vim: spell: |