% txi-ja.tex -- Japanese translations and font definitions for texinfo.tex.
%
% Copyright 1999, 2007, 2008, 2016, 2020 Free Software Foundation, Inc.
% 
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 3 of the license, or (at
% your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
% Written by Masamichi Hosoda, 22 Apr 2020, <trueroad@trueroad.jp>

\txisetlanguage{USenglish}{2}{3}

\plainnonfrenchspacing

\gdef\putwordAppendix{付録}
\gdef\putwordChapter{章}
\gdef\putworderror{エラー}
\gdef\putwordfile{ファイル}
\gdef\putwordin{の}
\gdef\putwordIndexIsEmpty{（インデックスが空です）}
\gdef\putwordIndexNonexistent{（インデックスがありません）}
\gdef\putwordInfo{Info}
\gdef\putwordInstanceVariableof{Instance Variable of}
\gdef\putwordMethodon{Method on}
\gdef\putwordNoTitle{無題}
\gdef\putwordof{of}
\gdef\putwordon{on}
\gdef\putwordpage{ページ}
\gdef\putwordsection{節}
\gdef\putwordSection{節}
\gdef\putwordsee{を参照}
\gdef\putwordSee{を参照してください}
\gdef\putwordShortTOC{簡単な目次}
\gdef\putwordTOC{目次}
%
\gdef\putwordMJan{1月}
\gdef\putwordMFeb{2月}
\gdef\putwordMMar{3月}
\gdef\putwordMApr{4月}
\gdef\putwordMMay{5月}
\gdef\putwordMJun{6月}
\gdef\putwordMJul{7月}
\gdef\putwordMAug{8月}
\gdef\putwordMSep{9月}
\gdef\putwordMOct{10月}
\gdef\putwordMNov{11月}
\gdef\putwordMDec{12月}
%
\gdef\putwordDefmac{マクロ}
\gdef\putwordDefspec{特殊フォーム}
\gdef\putwordDefvar{変数}
\gdef\putwordDefopt{ユーザオプション}
\gdef\putwordDeffunc{関数}

% Produces Year Month Day style of output.
\def\today{%
  \number\year 年\space
  \ifcase\month
  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  \fi
  \space\number\day 日}


%
% Japanese font definitions
%

\ifx\txijapackage\thisisundefined
  \errmessage{Required CJK package is not found.
  Use `texinfo-ja.tex' instead of `texinfo.tex'}
\else

  %
  % For LuaTeX
  %
  \ifx\luatexversion\thisisundefined
  \else
    % Definitions for a main text size of 11pt.  (The default in Texinfo.)
    % Japanese font size is muliplied by 0.962216.
    \let\definealphabetictextfontsizexi\definetextfontsizexi
    \gdef\definetextfontsizexi{%
      % Search Japanese Mincho (serif) font
      \ifx\txijamcfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (11.2pt, magstep1).
        \jfont\textmc{file:HaranoAjiMincho-Regular.otf:jfm=ujis} at 10.78pt
        \suppressfontnotfounderror=0 % workaround for LuaTeX < 1.10
        \ifx\textmc\nullfont
          \suppressfontnotfounderror=1
          % Text font (11.2pt, magstep1).
          \jfont\textmc{file:ipaexm.ttf:jfm=ujis} at 10.78pt
          \suppressfontnotfounderror=0
          \ifx\textmc\nullfont
            \errmessage{Could not find Japanese Mincho (serif) font}
          \else
            \gdef\txijamcfont{file:ipaexm.ttf:jfm=ujis}
          \fi
        \else
          \gdef\txijamcfont{file:HaranoAjiMincho-Regular.otf:jfm=ujis}
        \fi
      \else
        % Text font (11.2pt, magstep1).
        \jfont\textmc{\txijamcfont} at 10.78pt
      \fi

      % Search Japanese Gothic (sans-serif) font
      \ifx\txijagtfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (11.2pt, magstep1).
        \jfont\textgt{file:HaranoAjiGothic-Medium.otf:jfm=ujis} at 10.78pt
        \suppressfontnotfounderror=0 % workaround for LuaTeX < 1.10
        \ifx\textgt\nullfont
          \suppressfontnotfounderror=1
          % Text font (11.2pt, magstep1).
          \jfont\textgt{file:ipaexg.ttf:jfm=ujis} at 10.78pt
          \suppressfontnotfounderror=0
          \ifx\textgt\nullfont
            \errmessage{Could not find Japanese Gothic (sans-serif) font}
          \else
            \gdef\txijagtfont{file:ipaexg.ttf:jfm=ujis}
          \fi
        \else
          \gdef\txijagtfont{file:HaranoAjiGothic-Medium.otf:jfm=ujis}
        \fi
      \else
        % Text font (11.2pt, magstep1).
        \jfont\textgt{\txijagtfont} at 10.78pt
      \fi

      % Fonts for indices, footnotes, small examples (9pt).
      \jfont\smallmc{\txijamcfont} at 8.66pt
      \jfont\smallgt{\txijagtfont} at 8.66pt

      % Fonts for small examples (8pt).
      \jfont\smallermc{\txijamcfont} at 7.70pt
      \jfont\smallergt{\txijagtfont} at 7.70pt

      % Fonts for title page (20.4pt):
      \jfont\titlemc{\txijamcfont} at 19.63pt
      \jfont\titlegt{\txijagtfont} at 19.63pt

      % Chapter (and unnumbered) fonts (17.28pt).
      \jfont\chapmc{\txijamcfont} at 16.63pt
      \jfont\chapgt{\txijagtfont} at 16.63pt

      % Section fonts (14.4pt).
      \jfont\secmc{\txijamcfont} at 13.86pt
      \jfont\secgt{\txijagtfont} at 13.86pt

      % Subsection fonts (13.15pt).
      \jfont\ssecmc{\txijamcfont} at 12.65pt
      \jfont\ssecgt{\txijagtfont} at 12.65pt

      % Reduced fonts for @acronym in text (10pt).
      \jfont\reducedmc{\txijamcfont} at 9.62pt
      \jfont\reducedgt{\txijagtfont} at 9.62pt

      % Fonts for short table of contents.
      \jfont\shortcontmc{\txijamcfont} at 11.55pt
      \jfont\shortcontgt{\txijagtfont} at 11.55pt

      \definealphabetictextfontsizexi
    }

    % Definitions for a main text size of 10pt.
    % Japanese font size is muliplied by 0.962216.
    \let\definealphabetictextfontsizex\definetextfontsizex
    \gdef\definetextfontsizex{%
      % Search Japanese Mincho (serif) font
      \ifx\txijamcfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (10pt).
        \jfont\textmc{file:HaranoAjiMincho-Regular.otf:jfm=ujis} at 9.62pt
        \suppressfontnotfounderror=0 % workaround for LuaTeX < 1.10
        \ifx\textmc\nullfont
          \suppressfontnotfounderror=1
          % Text font (10pt).
          \jfont\textmc{file:ipaexm.ttf:jfm=ujis} at 9.62pt
          \suppressfontnotfounderror=0
          \ifx\textmc\nullfont
            \errmessage{Could not find Japanese Mincho (serif) font}
          \else
            \gdef\txijamcfont{file:ipaexm.ttf:jfm=ujis}
          \fi
        \else
          \gdef\txijamcfont{file:HaranoAjiMincho-Regular.otf:jfm=ujis}
        \fi
      \else
        % Text font (10pt).
        \jfont\textmc{\txijamcfont} at 9.62pt
      \fi

      % Search Japanese Gothic (sans-serif) font
      \ifx\txijagtfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (10pt).
        \jfont\textgt{file:HaranoAjiGothic-Medium.otf:jfm=ujis} at 9.62pt
        \suppressfontnotfounderror=0 % workaround for LuaTeX < 1.10
        \ifx\textgt\nullfont
          \suppressfontnotfounderror=1
          % Text font (10pt).
          \jfont\textgt{file:ipaexg.ttf:jfm=ujis} at 9.62pt
          \suppressfontnotfounderror=0
          \ifx\textgt\nullfont
            \errmessage{Could not find Japanese Gothic (sans-serif) font}
          \else
            \gdef\txijagtfont{file:ipaexg.ttf:jfm=ujis}
          \fi
        \else
          \gdef\txijagtfont{file:HaranoAjiGothic-Medium.otf:jfm=ujis}
        \fi
      \else
        % Text font (10pt).
        \jfont\textgt{\txijagtfont} at 9.62pt
      \fi

      % Fonts for indices, footnotes, small examples (9pt).
      \jfont\smallmc{\txijamcfont} at 8.66pt
      \jfont\smallgt{\txijagtfont} at 8.66pt

      % Fonts for small examples (8pt).
      \jfont\smallermc{\txijamcfont} at 7.70pt
      \jfont\smallergt{\txijagtfont} at 7.70pt

      % Fonts for title page (20.4pt):
      \jfont\titlemc{\txijamcfont} at 19.63pt
      \jfont\titlegt{\txijagtfont} at 19.63pt

      % Chapter fonts (14.4pt).
      \jfont\chapmc{\txijamcfont} at 13.86pt
      \jfont\chapgt{\txijagtfont} at 13.86pt

      % Section fonts (12pt).
      \jfont\secmc{\txijamcfont} at 11.55pt
      \jfont\secgt{\txijagtfont} at 11.55pt

      % Subsection fonts (10pt).
      \jfont\ssecmc{\txijamcfont} at 9.62pt
      \jfont\ssecgt{\txijagtfont} at 9.62pt

      % Reduced fonts for @acronym in text (9pt).
      \jfont\reducedmc{\txijamcfont} at 8.66pt
      \jfont\reducedgt{\txijagtfont} at 8.66pt

      % Fonts for short table of contents.
      \jfont\shortcontmc{\txijamcfont} at 11.55pt
      \jfont\shortcontgt{\txijagtfont} at 11.55pt

      \definealphabetictextfontsizex
    }

    % Ignore LuaTeX-ja added line end comment
    % https://osdn.jp/ticket/browse.php?group_id=5593&tid=36096
    %
    % Re-define texinfo.tex's \parseargusing
    \def\parseargusing#1#2{%
      \def\argtorun{#2}%
      \begingroup
        \ifx\ltjlineendcomment\thisisundefined
          % Ignore U+FFFFF for LuaTeX-ja <= 20160208.0
          \catcode"FFFFF=9
        \else
          % Ignore the character \ltjlineendcomment for LuaTeX-ja > 20160208.0
          \catcode\ltjlineendcomment=9
        \fi
        \obeylines
        \spaceisspace
        #1%
        \parseargline\empty% Insert the \empty token, see \finishparsearg below.
    }
    % Re-define texinfo.tex's \c
    \def\c{\begingroup \catcode`\^^M=\active%
      \ifx\ltjlineendcomment\thisisundefined
        % Ignore U+FFFFF for LuaTeX-ja <= 20160208.0
        \catcode"FFFFF=9%
      \else
        % Ignore the character \ltjlineendcomment for LuaTeX-ja > 20160208.0
        \catcode\ltjlineendcomment=9%
      \fi
    \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
    \cxxx}
    % Re-let \c related macro
    \let\comment=\c
    % Re-let \comment related macros
    \let\setfilename=\comment
    \let\dircategory=\comment
    \let\definfoenclose=\comment
    \let\footnotestyle=\comment
  \fi % LuaTeX

  %
  % For XeTeX
  %
  \ifx\XeTeXrevision\thisisundefined
  \else
    % Fix some Japanese character class
    % (unicode-letters.tex is wrong.)
    \def\do#1{\XeTeXcharclass"#1=1 }
    \do{3041}\do{3043}\do{3045}\do{3047}\do{3049}\do{3063}
    \do{3083}\do{3085}\do{3087}\do{308E}\do{3095}\do{3096}
    \do{30A1}\do{30A3}\do{30A5}\do{30A7}\do{30A9}\do{30C3}
    \do{30E3}\do{30E5}\do{30E7}\do{30EE}\do{30F5}\do{30F6}
    \do{30FC}\do{31F0}\do{31F1}\do{31F2}\do{31F3}\do{31F4}
    \do{31F5}\do{31F6}\do{31F7}\do{31F8}\do{31F9}\do{31FA}
    \do{31FB}\do{31FC}\do{31FD}\do{31FE}\do{31FF}

    % Add some character class
    \do{2015}\do{2016}\do{2025}\do{2030}\do{2032}\do{2033}
    \do{203B}\do{2103}\do{212B}

    \do{2500}\do{2501}\do{2502}\do{2503}\do{250C}\do{250F}
    \do{2510}\do{2513}\do{2514}\do{2517}\do{2518}\do{251B}
    \do{251C}\do{251D}\do{2520}\do{2523}\do{2524}\do{2525}
    \do{2528}\do{252B}\do{252C}\do{252F}\do{2530}\do{2533}
    \do{2534}\do{2537}\do{2538}\do{253B}\do{253C}\do{253F}
    \do{2542}\do{254B}

    \do{25A0}\do{25A1}\do{25B2}\do{25B3}\do{25BC}\do{25BD}
    \do{25C6}\do{25C7}\do{25CB}\do{25CE}\do{25CF}\do{25EF}
    \do{2605}\do{2606}\do{2640}\do{2642}

    \do{3000}

    % Setting Japanese font instead of Chinese font
    \def\setjafont#1{%
      \let\zhfont#1\let\zhpunctfont#1%
      \let\zhextafont#1\let\zhextbfont#1%
    }

    % Definitions for a main text size of 11pt.  (The default in Texinfo.)
    % Japanese font size is muliplied by 0.962216.
    \let\definealphabetictextfontsizexi\definetextfontsizexi
    \gdef\definetextfontsizexi{%
      % Search Japanese Mincho (serif) font
      \ifx\txijamcfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (11.2pt, magstep1).
        \font\textmczzz"[HaranoAjiMincho-Regular.otf]:mapping=tex-text"
          at 10.78pt
        \ifx\textmczzz\nullfont
          % Text font (11.2pt, magstep1).
          \font\textmczzz"[ipaexm.ttf]:mapping=tex-text" at 10.78pt
          \ifx\textmczzz\nullfont
            \errmessage{Could not find Japanese Mincho (serif) font}
          \else
            \gdef\txijamcfont{[ipaexm.ttf]:mapping=tex-text}
          \fi
        \else
          \gdef\txijamcfont{[HaranoAjiMincho-Regular.otf]:mapping=tex-text}
        \fi
        \suppressfontnotfounderror=0
      \else
        % Text font (11.2pt, magstep1).
        \font\textmczzz"\txijamcfont" at 10.78pt
      \fi

      % Search Japanese Gothic (sans-serif) font
      \ifx\txijagtfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (11.2pt, magstep1).
        \font\textgtzzz"[HaranoAjiGothic-Medium.otf]:mapping=tex-text"
          at 10.78pt
        \ifx\textgtzzz\nullfont
          % Text font (11.2pt, magstep1).
          \font\textgtzzz"[ipaexg.ttf]:mapping=tex-text" at 10.78pt
          \ifx\textgtzzz\nullfont
            \errmessage{Could not find Japanese Gothic (sans-serif) font}
          \else
            \gdef\txijagtfont{[ipaexg.ttf]:mapping=tex-text}
          \fi
        \else
          \gdef\txijagtfont{[HaranoAjiGothic-Medium.otf]:mapping=tex-text}
        \fi
        \suppressfontnotfounderror=0
      \else
        % Text font (11.2pt, magstep1).
        \font\textgtzzz"\txijagtfont" at 10.78pt
      \fi

      % Text fonts (11.2pt, magstep1).
      \def\textmc{\setjafont\textmczzz}
      \def\textgt{\setjafont\textgtzzz}

      % Fonts for indices, footnotes, small examples (9pt).
      \font\smallmczzz"\txijamcfont" at 8.66pt
      \font\smallgtzzz"\txijagtfont" at 8.66pt
      \def\smallmc{\setjafont\smallmczzz}
      \def\smallgt{\setjafont\smallgtzzz}

      % Fonts for small examples (8pt).
      \font\smallermczzz"\txijamcfont" at 7.70pt
      \font\smallergtzzz"\txijagtfont" at 7.70pt
      \def\smallermc{\setjafont\smallermczzz}
      \def\smallergt{\setjafont\smallergtzzz}

      % Fonts for title page (20.4pt):
      \font\titlemczzz"\txijamcfont" at 19.63pt
      \font\titlegtzzz"\txijagtfont" at 19.63pt
      \def\titlemc{\setjafont\titlemczzz}
      \def\titlegt{\setjafont\titlegtzzz}

      % Chapter (and unnumbered) fonts (17.28pt).
      \font\chapmczzz"\txijamcfont" at 16.63pt
      \font\chapgtzzz"\txijagtfont" at 16.63pt
      \def\chapmc{\setjafont\chapmczzz}
      \def\chapgt{\setjafont\chapgtzzz}

      % Section fonts (14.4pt).
      \font\secmczzz"\txijamcfont" at 13.86pt
      \font\secgtzzz"\txijagtfont" at 13.86pt
      \def\secmc{\setjafont\secmczzz}
      \def\secgt{\setjafont\secgtzzz}

      % Subsection fonts (13.15pt).
      \font\ssecmczzz"\txijamcfont" at 12.65pt
      \font\ssecgtzzz"\txijagtfont" at 12.65pt
      \def\ssecmc{\setjafont\ssecmczzz}
      \def\ssecgt{\setjafont\ssecgtzzz}

      % Reduced fonts for @acronym in text (10pt).
      \font\reducedmczzz"\txijamcfont" at 9.62pt
      \font\reducedgtzzz"\txijagtfont" at 9.62pt
      \def\reducedmc{\setjafont\reducedmczzz}
      \def\reducedgt{\setjafont\reducedgtzzz}

      % Fonts for short table of contents.
      \font\shortcontmczzz"\txijamcfont" at 11.55pt
      \font\shortcontgtzzz"\txijagtfont" at 11.55pt
      \def\shortcontmc{\setjafont\shortcontmczzz}
      \def\shortcontgt{\setjafont\shortcontgtzzz}

      \definealphabetictextfontsizexi
    }

    % Definitions for a main text size of 10pt.
    % Japanese font size is muliplied by 0.962216.
    \let\definealphabetictextfontsizex\definetextfontsizex
    \gdef\definetextfontsizex{%
      % Search Japanese Mincho (serif) font
      \ifx\txijamcfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (10pt).
        \font\textmczzz"[HaranoAjiMincho-Regular.otf]:mapping=tex-text"
          at 9.62pt
        \ifx\textmczzz\nullfont
          % Text font (10pt).
          \font\textmczzz"[ipaexm.ttf]:mapping=tex-text" at 9.62pt
          \ifx\textmczzz\nullfont
            \errmessage{Could not find Japanese Mincho (serif) font}
          \else
            \gdef\txijamcffont{[ipaexm.ttf]:mapping=tex-text}
          \fi
        \else
          \gdef\txijamcfont{[HaranoAjiMincho-Regular.otf]:mapping=tex-text}
        \fi
        \suppressfontnotfounderror=0
      \else
        % Text font (10pt).
        \font\textmczzz"\txijamcfont" at 9.62pt
      \fi

      % Search Japanese Gothic (sans-serif) font
      \ifx\txijagtfont\thisisundefined
        \suppressfontnotfounderror=1
        % Text font (10pt).
        \font\textgtzzz"[HaranoAjiGothic-Medium.otf]:mapping=tex-text"
          at 9.62pt
        \ifx\textgtzzz\nullfont
          % Text font (10pt).
          \font\textgtzzz"[ipaexg.ttf]:mapping=tex-text" at 9.62pt
          \ifx\textgtzzz\nullfont
            \errmessage{Could not find Japanese Gothic (sans-serif) font}
          \else
            \gdef\txijagtffont{[ipaexg.ttf]:mapping=tex-text}
          \fi
        \else
          \gdef\txijagtfont{[HaranoAjiGothic-Medium.otf]:mapping=tex-text}
        \fi
        \suppressfontnotfounderror=0
      \else
        % Text font (10pt).
        \font\textgtzzz"\txijagtfont" at 9.62pt
      \fi

      % Text fonts (10pt).
      \def\textmc{\setjafont\textmczzz}
      \def\textgt{\setjafont\textgtzzz}

      % Fonts for indices, footnotes, small examples (9pt).
      \font\smallmczzz"\txijamcfont" at 8.66pt
      \font\smallgtzzz"\txijagtfont" at 8.66pt
      \def\smallmc{\setjafont\smallmczzz}
      \def\smallgt{\setjafont\smallgtzzz}

      % Fonts for small examples (8pt).
      \font\smallermczzz"\txijamcfont" at 7.70pt
      \font\smallergtzzz"\txijagtfont" at 7.70pt
      \def\smallermc{\setjafont\smallermczzz}
      \def\smallergt{\setjafont\smallergtzzz}

      % Fonts for title page (20.4pt):
      \font\titlemczzz"\txijamcfont" at 19.63pt
      \font\titlegtzzz"\txijagtfont" at 19.63pt
      \def\titlemc{\setjafont\titlemczzz}
      \def\titlegt{\setjafont\titlegtzzz}

      % Chapter fonts (14.4pt).
      \font\chapmczzz"\txijamcfont" at 13.86pt
      \font\chapgtzzz"\txijagtfont" at 13.86pt
      \def\chapmc{\setjafont\chapmczzz}
      \def\chapgt{\setjafont\chapgtzzz}

      % Section fonts (12pt).
      \font\secmczzz"\txijamcfont" at 11.55pt
      \font\secgtzzz"\txijagtfont" at 11.55pt
      \def\secmc{\setjafont\secmczzz}
      \def\secgt{\setjafont\secgtzzz}

      % Subsection fonts (10pt).
      \font\ssecmczzz"\txijamcfont" at 9.62pt
      \font\ssecgtzzz"\txijagtfont" at 9.62pt
      \def\ssecmc{\setjafont\ssecmczzz}
      \def\ssecgt{\setjafont\ssecgtzzz}

      % Reduced fonts for @acronym in text (9pt).
      \font\reducedmczzz"\txijamcfont" at 8.66pt
      \font\reducedgtzzz"\txijagtfont" at 8.66pt
      \def\reducedmc{\setjafont\reducedmczzz}
      \def\reducedgt{\setjafont\reducedgtzzz}

      % Fonts for short table of contents.
      \font\shortcontmczzz"\txijamcfont" at 11.55pt
      \font\shortcontgtzzz"\txijagtfont" at 11.55pt
      \def\shortcontmc{\setjafont\shortcontmczzz}
      \def\shortcontgt{\setjafont\shortcontgtzzz}

      \definealphabetictextfontsizex
    }

    % Japanese line break settings
    \XeTeXlinebreaklocale "ja_JP"
    \XeTeXlinebreakskip=0em plus 0.1em minus 0.01em
    \XeTeXlinebreakpenalty=0

    % For copy & paste Unicode characters (XeTeX 0.99995 - 0.99998)
    \ifx\XeTeXgenerateactualtext\thisisundefined
    \else
      % XeTeX 0.99999+ doesn't need this workaround.
      \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99999}<0
        \XeTeXgenerateactualtext=1
      \fi
    \fi

  \fi % XeTeX

  \iftxinativeunicodecapable

    % Sync fonts

    \let\alphabeticrm\rm
    \gdef\rm{\alphabeticrm\tenmc}

    \let\alphabeticit\it
    \gdef\it{\alphabeticit\tenmc}

    \let\alphabeticsl\sl
    \gdef\sl{\alphabeticsl\tengt}

    \let\alphabeticbf\bf
    \gdef\bf{\alphabeticbf\tengt}

    \let\alphabetictt\tt
    \gdef\tt{\alphabetictt\tengt}

    % Add fonts

    \let\alphabetictextfonts\textfonts
    \gdef\textfonts{%
      \alphabetictextfonts
      \let\tenmc\textmc
      \let\tengt\textgt
    }

    \let\alphabetictitlefonts\titlefonts
    \gdef\titlefonts{%
      \alphabetictitlefonts
      \let\tenmc\titlemc
      \let\tengt\titlegt
    }

    \let\alphabeticchapfonts\chapfonts
    \gdef\chapfonts{%
      \alphabeticchapfonts
      \let\tenmc\chapmc
      \let\tengt\chapgt
    }

    \let\alphabeticsecfonts\secfonts
    \gdef\secfonts{%
      \alphabeticsecfonts
      \let\tenmc\secmc
      \let\tengt\secgt
    }

    \let\alphabeticsubsecfonts\subsecfonts
    \gdef\subsecfonts{%
      \alphabeticsubsecfonts
      \let\tenmc\ssecmc
      \let\tengt\ssecgt
    }

    \global\let\subsubsecfonts\subsecfonts

    \let\alphabeticreducedfonts\reducedfonts
    \gdef\reducedfonts{%
      \alphabeticreducedfonts
      \let\tenmc\reducedmc
      \let\tengt\reducedgt
    }

    \let\alphabeticsmallfonts\smallfonts
    \gdef\smallfonts{%
      \alphabeticsmallfonts
      \let\tenmc\smallmc
      \let\tengt\smallgt
    }

    \let\alphabeticsmallerfonts\smallerfonts
    \gdef\smallerfonts{%
      \alphabeticsmallerfonts
      \let\tenmc\smallermc
      \let\tengt\smallergt
    }

    \let\smallexamplefonts\smallfonts

    % Reset fonts

    \globaldefs = 1
    \definetextfontsizexi
    \globaldefs = 0

  \fi % \iftxinativeunicodecapable

\fi % \ifx\txijapackage\thisisundefined


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 日本語表記の改善
%  1. ヘッドの章の表記
%  2. See 訳語に合わせて動詞の後置
%  3. クロスレファレンスの表記
%  4. @dfn の表記

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  1. ヘッドの章の表記
\gdef\Ynumbered{%
  \ifnum\secno=0
    第\the\chapno\putwordChapter%
  \else \ifnum\subsecno=0
    \the\chapno.\the\secno\putwordSection%
  \else \ifnum\subsubsecno=0
    \the\chapno.\the\secno.\the\subsecno\putwordSection%
  \else
    \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno\putwordSection%
  \fi\fi\fi
}

\gdef\Yappendix{%
  \ifnum\secno=0
     \putwordAppendix@tie @char\the\appendixno{}%
  \else \ifnum\subsecno=0
     @char\the\appendixno.\the\secno\putwordSection%
  \else \ifnum\subsubsecno=0
     @char\the\appendixno.\the\secno.\the\subsecno\putwordSection%
  \else
     @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno\putwordSection%
  \fi\fi\fi
}

\gdef\chapmacro#1#2#3{%
  \expandafter\ifx\thisenv\titlepage\else
    \checkenv{}% chapters, etc., should not start inside an environment.
  \fi
  % Insert the first mark before the heading break (see notes for \domark).
  \let\prevchapterdefs=\currentchapterdefs
  \let\prevsectiondefs=\currentsectiondefs
  \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                        \gdef\thissection{}}%
  %
  \def\temptype{#2}%
  \ifx\temptype\Ynothingkeyword
    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                          \gdef\thischapter{\thischaptername}}%
  \else\ifx\temptype\Yomitfromtockeyword
    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                          \gdef\thischapter{}}%
  \else\ifx\temptype\Yappendixkeyword
    \toks0={#1}%
    \xdef\currentchapterdefs{%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischapternum{\appendixletter}%
      % \noexpand\putwordAppendix avoids expanding indigestible
      % commands in some of the translations.
      \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
                                 \noexpand\thischapternum:
                                 \noexpand\thischaptername}%
    }%
  \else
    \toks0={#1}%
    \xdef\currentchapterdefs{%
      \gdef\noexpand\thischaptername{\the\toks0}%
      \gdef\noexpand\thischapternum{\the\chapno}%
      % \noexpand\putwordChapter avoids expanding indigestible
      % commands in some of the translations.
      \gdef\noexpand\thischapter{第\noexpand\thischapternum%
                                 \noexpand\putwordChapter{}\space%
 				 \noexpand\thischaptername}%
    }%
  \fi\fi\fi
  %
  % Output the mark.  Pass it through \safewhatsit, to take care of
  % the preceding space.
  \safewhatsit\domark
  %
  % Insert the chapter heading break.
  \pchapsepmacro
  %
  % Now the second mark, after the heading break.  No break points
  % between here and the heading.
  \let\prevchapterdefs=\currentchapterdefs
  \let\prevsectiondefs=\currentsectiondefs
  \domark
  %
  {%
    \chapfonts \rm
    \let\footnote=\errfootnoteheading % give better error message
    %
    % Have to define \currentsection before calling \donoderef, because the
    % xref code eventually uses it.  On the other hand, it has to be called
    % after \pchapsepmacro, or the headline will change too soon.
    \gdef\currentsection{#1}%
    %
    % Only insert the separating space if we have a chapter/appendix
    % number, and don't print the unnumbered ``number''.
    \ifx\temptype\Ynothingkeyword
      \setbox0 = \hbox{}%
      \def\toctype{unnchap}%
    \else\ifx\temptype\Yomitfromtockeyword
      \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
      \def\toctype{omit}%
    \else\ifx\temptype\Yappendixkeyword
      \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
      \def\toctype{app}%
    \else
      \setbox0 = \hbox{#3\enspace}%
      \def\toctype{numchap}%
    \fi\fi\fi
    %
    % Write the toc entry for this chapter.  Must come before the
    % \donoderef, because we include the current node name in the toc
    % entry, and \donoderef resets it to empty.
    \writetocentry{\toctype}{#1}{#3}%
    %
    % For pdftex, we have to write out the node definition (aka, make
    % the pdfdest) after any page break, but before the actual text has
    % been typeset.  If the destination for the pdf outline is after the
    % text, then jumping from the outline may wind up with the text not
    % being visible, for instance under high magnification.
    \donoderef{#2}%
    %
    % Typeset the actual heading.
    \nobreak % Avoid page breaks at the interline glue.
    \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
          \unhbox0 #1\par}%
  }%
  \nobreak\bigskip % no page break after a chapter title
  \nobreak
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  2. See 訳語に合わせて動詞の後置

\global\def\inforefzzz #1,#2,#3,#4**{\putwordInfo{}\putwordfile{} \file{\ignorespaces #3{}},  ノード\samp{\ignorespaces#1{}}\putwordSee{}}

\gdef\pxref#1{\xrefXX{#1}\putwordsee{}}
\gdef\xref#1{\xrefXX{#1}\putwordSee{}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  3. クロスレファレンスの表記

\gdef\xrefprintnodename#1#2#3{「#1」}
\gdef\crossmanualxref#1{%
  \setbox\toprefbox = \hbox{Top\kern7sp}%
  \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  #1%
  \ifdim \wd2 > 7sp  % nonempty?
    \ifdim \wd2 = \wd\toprefbox \else  % same as Top?
      \space\putwordin\space ``\printedrefname'' \putwordSection{}\space
    \fi%
  \fi%
}
\gdef\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  \unsepspaces
  %
  % Get args without leading/trailing spaces.
  \def\printedrefname{\ignorespaces #3}%
  \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  %
  \def\infofilename{\ignorespaces #4}%
  \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  %
  \def\printedmanual{\ignorespaces #5}%
  \setbox\printedmanualbox  = \hbox{\printedmanual\unskip}%
  %
  % If the printed reference name (arg #3) was not explicitly given in
  % the @xref, figure out what we want to use.
  \ifdim \wd\printedrefnamebox = 0pt
    % No printed node name was explicitly given.
    \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
      % Not auto section-title: use node name inside the square brackets.
      \def\printedrefname{\ignorespaces #1}%
    \else
      % Auto section-title: use chapter/section title inside
      % the square brackets if we have it.
      \ifdim \wd\printedmanualbox > 0pt
        % It is in another manual, so we don't have it; use node name.
        \def\printedrefname{\ignorespaces #1}%
      \else
        \ifhavexrefs
          % We (should) know the real title if we have the xref values.
          \def\printedrefname{\refx{#1-title}{}}%
        \else
          % Otherwise just copy the Info node name.
          \def\printedrefname{\ignorespaces #1}%
        \fi%
      \fi
    \fi
  \fi
  %
  % Make link in pdf output.
  \ifpdf
    {\indexnofonts
     \turnoffactive
     \makevalueexpandable
     % This expands tokens, so do it after making catcode changes, so _
     % etc. don't get their TeX definitions.  This ignores all spaces in
     % #4, including (wrongly) those in the middle of the filename.
     \getfilename{#4}%
     %
     % This (wrongly) does not take account of leading or trailing
     % spaces in #1, which should be ignored.
     \edef\pdfxrefdest{#1}%
     \ifx\pdfxrefdest\empty
       \def\pdfxrefdest{Top}% no empty targets
     \else
       \txiescapepdf\pdfxrefdest  % escape PDF special chars
     \fi
     %
     \leavevmode
     \startlink attr{/Border [0 0 0]}%
     \ifnum\filenamelength>0
       goto file{\the\filename.pdf} name{\pdfxrefdest}%
     \else
       goto name{\pdfmkpgn{\pdfxrefdest}}%
     \fi
    }%
    \setcolor{\linkcolor}%
  \fi
  {%
    % Have to otherify everything special to allow the \csname to
    % include an _ in the xref name, etc.
    \indexnofonts
    \turnoffactive
    \expandafter\global\expandafter\let\expandafter\Xthisreftitle
      \csname XR#1-title\endcsname
  }%
  %
  % Float references are printed completely differently: "Figure 1.2"
  % instead of "[somenode], p.3".  \iffloat distinguishes them by
  % \Xthisreftitle being set to a magic string.
  \iffloat\Xthisreftitle
    %
    % If the user also gave the printed manual name (fifth arg), append
    % "in MANUALNAME".
    \ifdim \wd\printedmanualbox > 0pt
      \cite{\printedmanual} \space \putwordin{}%
    \fi
    % If the user specified the print name (third arg) to the ref,
    % print it instead of our usual "Figure 1.2".
    \ifdim\wd\printedrefnamebox = 0pt
      \refx{#1-snt}{}%
    \else
      \printedrefname
    \fi
  \else
    % node/anchor (non-float) references.
    % 
    % If we use \unhbox to print the node names, TeX does not insert
    % empty discretionaries after hyphens, which means that it will not
    % find a line break at a hyphen in a node names.  Since some manuals
    % are best written with fairly long node names, containing hyphens,
    % this is a loss.  Therefore, we give the text of the node name
    % again, so it is as if TeX is seeing it for the first time.
    % 
    \ifdim \wd\printedmanualbox > 0pt
      % Cross-manual reference with a printed manual name.
      % 
      \crossmanualxref{\cite{\printedmanual\unskip}}%
    %
    \else\ifdim \wd\infofilenamebox > 0pt
      % Cross-manual reference with only an info filename (arg 4), no
      % printed manual name (arg 5).  This is essentially the same as
      % the case above; we output the filename, since we have nothing else.
      % 
      \crossmanualxref{\code{\infofilename\unskip}}%
    %
    \else
      % Reference within this manual.
      %
      % _ (for example) has to be the character _ for the purposes of the
      % control sequence corresponding to the node, but it has to expand
      % into the usual \leavevmode...\vrule stuff for purposes of
      % printing. So we \turnoffactive for the \refx-snt, back on for the
      % printing, back off for the \refx-pg.
      {\turnoffactive
       % Only output a following space if the -snt ref is nonempty; for
       % @unnumbered and @anchor, it won't be.
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
      }%
      % output the `[mynode]' via the macro below so it can be overridden.
      \xrefprintnodename\printedrefname
      %
      % But we always want a comma and a space:
      ,\space
      %
      % output the `page 3'.
      \turnoffactive (\refx{#1-pg}{}\tie\putwordpage)%
      % Add a , if xref followed by a space
      \if\space\noexpand\tokenafterxref ,%
      \else\ifx\	\tokenafterxref ,% @TAB
      \else\ifx\*\tokenafterxref ,%   @*
      \else\ifx\ \tokenafterxref ,%   @SPACE
      \else\ifx\
                \tokenafterxref ,%    @NL
      \else\ifx\tie\tokenafterxref ,% @tie
      \fi\fi\fi\fi\fi\fi
    \fi\fi
  \fi
  \endlink
\endgroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  4. @dfn の表記

\gdef\doublebracket#1{『#1』}
\global\let\dfn=\doublebracket
