texinfo-ja.tex 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. % texinfo-ja.tex -- Japanese texinfo.tex loader
  2. % Some CJK packages are necessary to load before texinfo.tex.
  3. %
  4. % Copyright 2016, 2017 Free Software Foundation, Inc.
  5. %
  6. % This program is free software; you can redistribute it and/or modify
  7. % it under the terms of the GNU General Public License as published by
  8. % the Free Software Foundation; either version 3 of the license, or (at
  9. % your option) any later version.
  10. %
  11. % This program is distributed in the hope that it will be useful,
  12. % but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. % GNU General Public License for more details.
  15. %
  16. % You should have received a copy of the GNU General Public License
  17. % along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. %
  19. % Written by Masamichi Hosoda, 6 May 2016, <trueroad@trueroad.jp>
  20. %
  21. % For LuaTeX
  22. %
  23. \ifx\luatexversion\thisisundefined
  24. \else
  25. % LuaTeX 0.95+ is required.
  26. \ifnum\luatexversion<95
  27. \errmessage{LuaTeX 0.95+ is required}
  28. \fi
  29. % LuaTeX-ja: Typeset Japanese with Lua(La)TeX
  30. % http://www.ctan.org/tex-archive/macros/luatex/generic/luatexja
  31. \openin 1 luatexja.sty \ifeof 1
  32. \errmessage{LuaTeX-ja is not found.
  33. It is required for Japanese Texinfo files with LuaTeX.
  34. http://www.ctan.org/tex-archive/macros/luatex/generic/luatexja
  35. It might be contained in texlive-lang-japanese package}
  36. \else
  37. \input luatexja.sty
  38. \def\txijapackage{LaTeX-ja}
  39. \fi
  40. \fi
  41. %
  42. % For XeTeX
  43. %
  44. \ifx\XeTeXrevision\thisisundefined
  45. \else
  46. % XeTeX 0.9998+ is required.
  47. \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.9998}<0
  48. \errmessage{XeTeX 0.9998+ is required}
  49. \fi
  50. % zhspacing: Spacing for mixed CJK-English documents in XeTeX
  51. % http://www.ctan.org/tex-archive/macros/xetex/generic/zhspacing
  52. %
  53. % This package is originally for Chinese,
  54. % but can also used in Japanese.
  55. %
  56. \openin 1 zhspacing.sty \ifeof 1
  57. \errmessage{zhspacing is not found.
  58. It is required for Japanese Texinfo files with XeTeX.
  59. http://www.ctan.org/tex-archive/macros/xetex/generic/zhspacing
  60. It might be contained in texlive-lang-chinese.
  61. (This package is for Chinese, but can also used in Japanese)}
  62. \else
  63. \def\zhfont{dummy} % Cancel the request of SimSun font
  64. \def\zhpunctfont{dummy} % Cancel the request of SimSun font
  65. \input zhspacing.sty
  66. \zhspacing
  67. \def\txijapackage{zhspacing}
  68. \fi
  69. \fi
  70. %
  71. % For others
  72. %
  73. \ifx\luatexversion\thisisundefined
  74. \ifx\XeTeXrevision\thisisundefined
  75. \errmessage{The TeX engine is not LuaTeX / XeTeX.
  76. LuaTeX / XeTeX is required for Japanese Texinfo files}
  77. \fi
  78. \fi
  79. % Original texinfo.tex
  80. \input texinfo.tex