summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-02-05 23:18:29 +0000
committerKarl Berry <karl@freefriends.org>2017-02-05 23:18:29 +0000
commitb19f23929a106d899701663e30149fa6c02b1061 (patch)
treec95f1432eed759102c913ad7a505f40f8e0fb3f0 /Master/texmf-dist
parent2628a70d98f12b364a8164b3ccaae5a882a2a4dc (diff)
babel-japanese (5feb17)
git-svn-id: svn://tug.org/texlive/trunk@43145 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/generic/babel-japanese/README.md13
-rw-r--r--Master/texmf-dist/doc/generic/babel-japanese/japanese.pdfbin122991 -> 131202 bytes
-rw-r--r--Master/texmf-dist/source/generic/babel-japanese/japanese.dtx106
-rw-r--r--Master/texmf-dist/tex/generic/babel-japanese/japanese.ldf88
4 files changed, 177 insertions, 30 deletions
diff --git a/Master/texmf-dist/doc/generic/babel-japanese/README.md b/Master/texmf-dist/doc/generic/babel-japanese/README.md
index 5a7f41e9b7d..c46a824863b 100644
--- a/Master/texmf-dist/doc/generic/babel-japanese/README.md
+++ b/Master/texmf-dist/doc/generic/babel-japanese/README.md
@@ -35,7 +35,14 @@ document for pLaTeX).
2) Process documentation, japanese.dtx and japanese-sample.tex, as you wish.
japanese.dtx can be processed with pLaTeX, upLaTeX or LuaLaTeX.
-japanese-sample.tex is written for pLaTeX.
+japanese-sample.tex is written for pLaTeX or LuaLaTeX.
+
+If you use lualatex:
+
+ lualatex japanese.dtx
+ lualatex japanese-sample.tex
+
+If you use platex:
platex -kanji=utf8 japanese.dtx
dvipdfmx japanese.dvi
@@ -68,11 +75,11 @@ Copyright (C) 1999-2007 by ING (Toru Inagaki)
Copyright (C) 2016- by Japanese TeX Development Community
This package is free software that can be redistributed and/or
-modified under the terms of the LaTeX Project Public License.
+modified under the terms of the LaTeX Project Public License 1.3.
## Release Date
-2016-12-16
+2017-02-05
Japanese TeX Development Community
diff --git a/Master/texmf-dist/doc/generic/babel-japanese/japanese.pdf b/Master/texmf-dist/doc/generic/babel-japanese/japanese.pdf
index 8768b68fb97..02b512e3c94 100644
--- a/Master/texmf-dist/doc/generic/babel-japanese/japanese.pdf
+++ b/Master/texmf-dist/doc/generic/babel-japanese/japanese.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/generic/babel-japanese/japanese.dtx b/Master/texmf-dist/source/generic/babel-japanese/japanese.dtx
index cd25a3f0f8e..45d1b5784ae 100644
--- a/Master/texmf-dist/source/generic/babel-japanese/japanese.dtx
+++ b/Master/texmf-dist/source/generic/babel-japanese/japanese.dtx
@@ -45,7 +45,7 @@
%<code>\ProvidesLanguage{japanese}
%<*!sample>
%\ProvidesFile{japanese.dtx}
- [2016/12/16 v2.0 Japanese support for babel (texjporg)]
+ [2017/02/05 v2.1 Japanese support for babel (texjporg)]
%</!sample>
%\fi
%
@@ -117,11 +117,13 @@
%
% \begin{macrocode}
%<*code>
-\ifx\kanjiskip\@undefined\ifx\XeTeXversion\@undefined\ifx\directlua\@undefined
- \@latex@error{babel-japanese supports one of the followings:\MessageBreak
+\ifx\kanjiskip\@undefined\ifx\directlua\@undefined
+\ifx\XeTeXversion\@undefined
+ \@latex@error{Option '\CurrentOption' requires one of the followings:\MessageBreak
pTeX, upTeX, XeTeX, LuaTeX\MessageBreak
It seems you are running unsupported engine!}\@ehc
-\fi\fi\fi
+\fi
+\fi\fi
% \end{macrocode}
%
% \begin{macrocode}
@@ -310,10 +312,19 @@
%
% Unicodeな\TeX{}エンジン(Xe\TeX{},Lua\TeX{})の場合は,
% UTF-8エンコーディングで直接和文文字を記述します。
+% Xe\TeX{}の場合は |\bbl@jpn@Tate...| の2つは実際には使いません。
% \begin{macrocode}
\ifx\kanjiskip\@undefined
\def\西暦{\bbl@jpn@Seirekitrue}%
\def\和暦{\bbl@jpn@Seirekifalse}%
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
+ \def\bbl@jpn@TateWarekiToday{%
+ 平成\bbl@jpn@maybekansuji\the@heisei 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
\def\bbl@jpn@SeirekiToday{%
\number\year 年%
\number\month 月%
@@ -340,27 +351,94 @@
\kansujichar3=\jis"467C\relax % 日
\kansujichar4=\jis"4A3F\relax % 平
\kansujichar5=\jis"402E\relax % 成
- \xdef\bbl@jpn@SeirekiToday{%
- \number\year\kansuji1 %
- \number\month\kansuji2 %
- \number\day\kansuji3 }
- \xdef\bbl@jpn@WarekiToday{%
- \kansuji45 \the@heisei\kansuji1 %
- \number\month\kansuji2 %
- \number\day\kansuji3 }
+ \xdef\bbl@jpn@kanjinen{\kansuji1}%
+ \xdef\bbl@jpn@kanjigatsu{\kansuji2}%
+ \xdef\bbl@jpn@kanjinichi{\kansuji3}%
+ \xdef\bbl@jpn@kanjiheisei{\kansuji45}%
\endgroup
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@TateWarekiToday{%
+ \bbl@jpn@kanjiheisei\bbl@jpn@maybekansuji\the@heisei\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@SeirekiToday{%
+ \number\year\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@WarekiToday{%
+ \bbl@jpn@kanjiheisei\the@heisei\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+\fi
+% \end{macrocode}
+%
+% (u)p\LaTeXe{}とLua\TeX-jaで組方向判定方法が異なるため,|\catcode| のトリックで
+% 別々のコードを使い分けます。Xe\LaTeX{}の場合,およびLua\LaTeX{}でLua\TeX-ja不使用の
+% 場合は,縦組をサポートしません。
+% \begin{macrocode}
+\chardef\bbl@jpn@l@catcode=\catcode`\L\relax
+\chardef\bbl@jpn@p@catcode=\catcode`\P\relax
+\chardef\bbl@jpn@x@catcode=\catcode`\X\relax
+\ifx\directlua\@undefined
+ \ifx\XeTeXversion\@undefined % ptex/uptex
+ \catcode`\L=14\relax
+ \catcode`\P=9\relax
+ \catcode`\X=9\relax
+ \else % xetex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \fi
+\else
+ \ifx\luatexjaLoaded\@undefined % luatex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \else % luatex + luatexja
+ \catcode`\L=9\relax
+ \catcode`\P=14\relax
+ \catcode`\X=9\relax
+ \fi
\fi
% \end{macrocode}
%
-% 実際に使用する命令。
+% 実際に使用する命令にコピーします。
% \begin{macrocode}
\@namedef{date\CurrentOption}{%
\def\today{%
+P \iftdir
+L \ifnum\ltjgetparameter{direction}=3
+X \ifbbl@jpn@Seireki
+X \bbl@jpn@TateSeirekiToday
+X \else
+X \bbl@jpn@TateWarekiToday
+X \fi
+X \else
\ifbbl@jpn@Seireki
\bbl@jpn@SeirekiToday
\else
\bbl@jpn@WarekiToday
- \fi}}
+ \fi
+X \fi
+ }%
+}
+% \end{macrocode}
+%
+% [2017-02-05] 新機能:|\languageattribute{japanese}{kansujitoday}|を指定すると,
+% 縦書きでは |\today| の表記が漢数字(例:二〇一六年一二月二八日)になります。
+% \begin{macrocode}
+\let\bbl@jpn@maybekansuji\number
+\bbl@declare@ttribute{japanese}{kansujitoday}{\let\bbl@jpn@maybekansuji\kansuji}
+% \end{macrocode}
+%
+% トリックに使用した文字の |\catcode| を元に戻します。
+% \begin{macrocode}
+\catcode`\L=\bbl@jpn@l@catcode\relax
+\catcode`\P=\bbl@jpn@p@catcode\relax
+\catcode`\X=\bbl@jpn@x@catcode\relax
% \end{macrocode}
%
% \begin{macrocode}
diff --git a/Master/texmf-dist/tex/generic/babel-japanese/japanese.ldf b/Master/texmf-dist/tex/generic/babel-japanese/japanese.ldf
index f15dcb1d9ba..ab1f9d91ad8 100644
--- a/Master/texmf-dist/tex/generic/babel-japanese/japanese.ldf
+++ b/Master/texmf-dist/tex/generic/babel-japanese/japanese.ldf
@@ -28,12 +28,14 @@
\epTeXinputencoding utf8
\fi
\ProvidesLanguage{japanese}
- [2016/12/16 v2.0 Japanese support for babel (texjporg)]
-\ifx\kanjiskip\@undefined\ifx\XeTeXversion\@undefined\ifx\directlua\@undefined
- \@latex@error{babel-japanese supports one of the followings:\MessageBreak
+ [2017/02/05 v2.1 Japanese support for babel (texjporg)]
+\ifx\kanjiskip\@undefined\ifx\directlua\@undefined
+\ifx\XeTeXversion\@undefined
+ \@latex@error{Option '\CurrentOption' requires one of the followings:\MessageBreak
pTeX, upTeX, XeTeX, LuaTeX\MessageBreak
It seems you are running unsupported engine!}\@ehc
-\fi\fi\fi
+\fi
+\fi\fi
\LdfInit\CurrentOption{captions\CurrentOption}
\ifx\l@japanese\@undefined
\PackageInfo{babel}{%
@@ -153,6 +155,14 @@
\ifx\kanjiskip\@undefined
\def\西暦{\bbl@jpn@Seirekitrue}%
\def\和暦{\bbl@jpn@Seirekifalse}%
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
+ \def\bbl@jpn@TateWarekiToday{%
+ 平成\bbl@jpn@maybekansuji\the@heisei 年%
+ \bbl@jpn@maybekansuji\month 月%
+ \bbl@jpn@maybekansuji\day 日}
\def\bbl@jpn@SeirekiToday{%
\number\year 年%
\number\month 月%
@@ -175,23 +185,75 @@
\kansujichar3=\jis"467C\relax % 日
\kansujichar4=\jis"4A3F\relax % 平
\kansujichar5=\jis"402E\relax % 成
- \xdef\bbl@jpn@SeirekiToday{%
- \number\year\kansuji1 %
- \number\month\kansuji2 %
- \number\day\kansuji3 }
- \xdef\bbl@jpn@WarekiToday{%
- \kansuji45 \the@heisei\kansuji1 %
- \number\month\kansuji2 %
- \number\day\kansuji3 }
+ \xdef\bbl@jpn@kanjinen{\kansuji1}%
+ \xdef\bbl@jpn@kanjigatsu{\kansuji2}%
+ \xdef\bbl@jpn@kanjinichi{\kansuji3}%
+ \xdef\bbl@jpn@kanjiheisei{\kansuji45}%
\endgroup
+ \def\bbl@jpn@TateSeirekiToday{%
+ \bbl@jpn@maybekansuji\year\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@TateWarekiToday{%
+ \bbl@jpn@kanjiheisei\bbl@jpn@maybekansuji\the@heisei\bbl@jpn@kanjinen
+ \bbl@jpn@maybekansuji\month\bbl@jpn@kanjigatsu
+ \bbl@jpn@maybekansuji\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@SeirekiToday{%
+ \number\year\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+ \def\bbl@jpn@WarekiToday{%
+ \bbl@jpn@kanjiheisei\the@heisei\bbl@jpn@kanjinen
+ \number\month\bbl@jpn@kanjigatsu
+ \number\day\bbl@jpn@kanjinichi}
+\fi
+\chardef\bbl@jpn@l@catcode=\catcode`\L\relax
+\chardef\bbl@jpn@p@catcode=\catcode`\P\relax
+\chardef\bbl@jpn@x@catcode=\catcode`\X\relax
+\ifx\directlua\@undefined
+ \ifx\XeTeXversion\@undefined % ptex/uptex
+ \catcode`\L=14\relax
+ \catcode`\P=9\relax
+ \catcode`\X=9\relax
+ \else % xetex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \fi
+\else
+ \ifx\luatexjaLoaded\@undefined % luatex
+ \catcode`\L=14\relax
+ \catcode`\P=14\relax
+ \catcode`\X=14\relax
+ \else % luatex + luatexja
+ \catcode`\L=9\relax
+ \catcode`\P=14\relax
+ \catcode`\X=9\relax
+ \fi
\fi
\@namedef{date\CurrentOption}{%
\def\today{%
+P \iftdir
+L \ifnum\ltjgetparameter{direction}=3
+X \ifbbl@jpn@Seireki
+X \bbl@jpn@TateSeirekiToday
+X \else
+X \bbl@jpn@TateWarekiToday
+X \fi
+X \else
\ifbbl@jpn@Seireki
\bbl@jpn@SeirekiToday
\else
\bbl@jpn@WarekiToday
- \fi}}
+ \fi
+X \fi
+ }%
+}
+\let\bbl@jpn@maybekansuji\number
+\bbl@declare@ttribute{japanese}{kansujitoday}{\let\bbl@jpn@maybekansuji\kansuji}
+\catcode`\L=\bbl@jpn@l@catcode\relax
+\catcode`\P=\bbl@jpn@p@catcode\relax
+\catcode`\X=\bbl@jpn@x@catcode\relax
\@namedef{extras\CurrentOption}{}
\@namedef{noextras\CurrentOption}{}
\ldf@finish\CurrentOption