iwase/itoniki0 の履歴(No.3) - PukiWiki

version 0.2 とほぼ同じだけれど、book.cls からコピーしないタイプも作ってみた。 これは「第1章」が「章丿1」とかになる。

% Original version was written by Toru Inagaki for babel.sty
% Modified for polyglossia by Norio Iwase with some additional features
% Version 0.2n
\ProvidesFile{gloss-japanese.ldf}[polyglossia: module for japanese]
\makeatletter
\def\japanese@font{%
 \@ifundefined{japanesefont}{%
   \font\zf@basefont="\csname zf@family@fontdef\f@family\endcsname" at \f@size pt}{\japanesefont}}

\def\selectnormalfontjapanese{%
  \let\normalfont=\japanese@font%
  \let\rmfamily=\japanese@font%
  \let\sffamily=\japanese@font%
  \let\ttfamily=\japanese@font%
  \def\reset@font{\normalfont}}

\ifx\l@japanese\@undefined
  \xpg@nopatterns{Japanese}
  \adddialect\l@japanese0
\fi

\def\captionsjapanese{%
  \def\refname{\textjapanese{出典}}%
  \def\abstractname{\textjapanese{概要}}%
  \def\bibname{\textjapanese{参考文献}}%
  \def\prefacename{\textjapanese{序文}}%
  \def\chaptername{\textjapanese{章 ノ}}%
  \def\appendixname{\textjapanese{付録}}%
  \def\contentsname{\textjapanese{目次}}%
  \def\listfigurename{\textjapanese{図目次}}%
  \def\listtablename{\textjapanese{表目次}}%
  \def\indexname{\textjapanese{索引}}%
  \def\figurename{\textjapanese{図}}%
  \def\tablename{\textjapanese{表}}%
  %\def\thepart{\textjapanese{}}%
  \def\partname{\textjapanese{部 ノ}}%
  \def\pagename{\textjapanese{頁}}%
  \def\seename{\textjapanese{参照}}%
  \def\alsoname{\textjapanese{参照}}%
  \def\enclname{\textjapanese{添付}}%
  \def\ccname{\textjapanese{同報}}%
  \def\headtoname{\textjapanese{宛先}}%
  \def\proofname{\textjapanese{証明}}%
  \def\glossaryname{\textjapanese{用語集}}%
  }

  \newif\if@WameiReki \@WameiRekifalse%
  \newif\if@WameiTosi \@WameiTosifalse%
  \newif\if@WameiTuki \@WameiTukifalse%
  \newif\if@WameiHi \@WameiHifalse%
  \newif\if@IzumoTuki \@IzumoTukifalse%
  \newcount\WameiTosi@Tens
  \newcount\WameiTosi@Ones
  \XeTeXlinebreaklocale "ja"%
  \XeTeXlinebreakskip = 0em plus 0.1em minus 0.01em%
  \XeTeXlinebreakpenalty = 0

\def\datejapanese{{%
  \ifnum\year<1868 \xdef\the@WarekiCur{}%
  \else\ifnum\year<1912 \xdef\the@WarekiCur{明治} \advance\year-1867\relax%
  \else\ifnum\year<1926 \xdef\the@WarekiCur{大正} \advance\year-1911\relax%
  \else\ifnum\year<1989 \xdef\the@WarekiCur{昭和} \advance\year-1925\relax%
  \else\xdef\the@WarekiCur{平成} \advance\year-1988\relax\fi\fi\fi\fi%
  \xdef\the@WameiTosi{\the\year}%
  \WameiTosi@Ones=\the@WameiTosi \WameiTosi@Tens=\the@WameiTosi%
  \divide\WameiTosi@Tens by 10\relax%
  \multiply\WameiTosi@Tens by 10\relax%
  \advance\WameiTosi@Ones by -\WameiTosi@Tens\relax%
  \divide\WameiTosi@Tens by 10\relax%
  \xdef\the@WameiTositens{\number\WameiTosi@Tens}%
  \xdef\the@WameiTosiones{\number\WameiTosi@Ones}%
  }
  \def\西暦{\@WameiRekifalse \@WameiTukifalse \@WameiHifalse}%
  \def\和暦{\@WameiRekitrue \@WameiTosifalse \@WameiTukifalse \@WameiHifalse}%
  \def\和名暦{\@WameiTositrue \@WameiTukitrue \@WameiHitrue}%
  \def\数字暦{\@WameiTosifalse \@WameiTukifalse \@WameiHifalse}%
  \def\出雲月{\@IzumoTukitrue}%
  \def\大和月{\@IzumoTukifalse}%
  \def\today{\textjapanese{\hspace{-.67em}%
\if@WameiReki\number\year\,\else\the@WarekiCur\if@WameiTosi\ifcase\the@WameiTositens\or 十\or 廿\or 卅\or 四十\or 五十\or 六十\or 七十\or 八十\or 九十\fi\ifcase\the@WameiTosiones\or 一\or 二\or 三\or 四\or 五\or 六\or 七\or 八\or 九\fi\else\,\the@WameiTosi\fi\fi{年}\,%
\if@WameiTuki\ifcase\month\or 睦月\or 如月\or 弥生\or 卯月\or 皐月\or 水無月\or 文月\or 葉月\or 長月\or \if@IzumoTuki 神在月\else 神無月\fi \or 霜月\or 師走\fi\else \number\month\,{月}\fi\,%
\if@WameiHi\ifcase\day\or 一\or 二\or 三\or 四\or 五\or 六\or 七\or 八\or 九\or 十\or 十一\or 十二\or 十三\or 十四\or 十五\or 十六\or 十七\or 十八\or 十九\or 廿\or 廿一\or 廿二\or 廿三\or 廿四\or 廿五\or 廿六\or 廿七\or 廿八\or 廿九\or 卅 \or 卅一\fi\else\number\day\,\fi{日}}}%
  }

\def\japanese@language{\protect\language=\l@japanese}

\setlocalhyphenmins{japanese}{2}{2}%

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS