texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: texinfo-zh.tex


From: Gavin D. Smith
Subject: branch master updated: texinfo-zh.tex
Date: Tue, 18 Oct 2022 13:07:41 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 304c41b64a texinfo-zh.tex
304c41b64a is described below

commit 304c41b64a040ef12439ffda87fd15355f8651af
Author: Wu XiangCheng <bobwxc@yeah.net>
AuthorDate: Tue Oct 18 18:07:20 2022 +0100

    texinfo-zh.tex
    
    * doc/texinfo-zh.tex, doc/txi-zh.tex: New files, partially
    based on doc/texinfo-ja.tex and txi-ja.tex.
    
    * doc/short-sample-zh.tex: New file.
    
    * NEWS: Mention.
---
 .gitignore               |   3 +-
 ChangeLog                |  11 ++
 NEWS                     |   3 +
 doc/short-sample-zh.texi |  65 ++++++++++
 doc/texinfo-zh.tex       |  55 ++++++++
 doc/txi-zh.tex           | 323 +++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 458 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0ff393dfb3..3161bb5b87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
 **/*~
 
-texinfo-*
+./texinfo-*
 build
 **/test
 **/diffs
@@ -116,7 +116,6 @@ doc/short-sample-ja.toc
 doc/stamp-1
 doc/stamp-vti
 doc/texinfo
-doc/texinfo-*
 doc/texinfo.??
 doc/texinfo.??s
 doc/texinfo.txicmd
diff --git a/ChangeLog b/ChangeLog
index 298dcfa583..0a467a2879 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-10-18  Wu XiangCheng  <bobwxc@yeah.net>
+
+       texinfo-zh.tex
+
+       * doc/texinfo-zh.tex, doc/txi-zh.tex: New files, partially
+       based on doc/texinfo-ja.tex and txi-ja.tex.
+
+       * doc/short-sample-zh.tex: New file.
+
+       * NEWS: Mention.
+
 2022-10-18  Gavin Smith  <gavinsmith0123@gmail.com>
 
        More efficient subnode dumping
diff --git a/NEWS b/NEWS
index 558cac24e9..78807c8946 100644
--- a/NEWS
+++ b/NEWS
@@ -85,6 +85,9 @@ See the manual for detailed information.
     "@clear txicodevaristt" to use slanted, variable-width roman font for
     @var everywhere.  flag is @set by default, but we plan to turn this
     off in the future.
+  . You can use a new file doc/texinfo-zh.tex for Texinfo documents in
+    Chinese.  doc/short-sample-ja.tex is a sample document.  New
+    support file doc/txi-ja.tex for Chinese..
 
 * info
   . better support for index entries containing parentheses
diff --git a/doc/short-sample-zh.texi b/doc/short-sample-zh.texi
new file mode 100644
index 0000000000..a349822d75
--- /dev/null
+++ b/doc/short-sample-zh.texi
@@ -0,0 +1,65 @@
+\input texinfo-zh
+
+@documentencoding UTF-8
+@documentlanguage zh
+
+@settitle texinfo中文样例文件
+
+@afivepaper
+@firstparagraphindent insert
+
+@copying
+版权所有 @copyright{} 2022 Free Software Foundation, Inc.
+@end copying
+
+@titlepage
+@title texinfo中文样例文件
+@author texinfo
+@page
+@insertcopying
+@end titlepage
+
+@contents
+
+@node 诗歌
+@chapter 诗歌
+
+@enumerate
+@item 《诗经》
+@item 《古诗十九首》
+@end enumerate
+
+@node 关雎
+@section 关雎
+
+关关雎鸠,在河之洲。
+
+窈窕淑女,君子好逑。
+
+@node 涉江采芙蓉
+@section 涉江采芙蓉
+
+涉江采芙蓉,兰泽多芳草。
+
+采之欲遗谁,所思在远道。
+
+还顾望旧乡,长路漫浩浩。
+
+同心而离居,忧伤以终老。
+
+@node 散文
+@chapter 散文
+
+这首诗(@xref{涉江采芙蓉})的意旨只是游子思家。诗中引用《楚辞》的地方很多,
+成辞也有,意境也有,但全诗并非思君之作。《十九首》是仿乐府的,乐府里没有思
+君的话,汉魏六朝的诗里也没有,本诗似乎不会是例外。“涉江”是《楚辞》的篇名,
+屈原所作的《九章》之一。本诗是借用这个成辞,一面也多少暗示着诗中主人的流离
+转徙,《涉江》篇所叙的正是屈原流离转徙的情形。采芳草送人,本是古代的风俗。
+《诗经·郑风·溱洧》篇道:“溱与洧,方涣涣兮,士与女,方秉蕳兮。”《毛传》:
+“蕳,兰也。”《诗》又道:“且往观乎,洧之外,洵訏且乐。维士与女,伊其相谑,
+赠之以勺药。”郑玄《笺》说士与女分别时,“送女以勺药,结恩情也。”《毛传》说
+勺药也是香草。《楚辞》也道:“采芳洲兮杜若,将以遗之下女”,“搴汀州兮杜若,
+将以遗之远者”;“被石兰兮带杜衡,折芳馨兮遗所思”;“折疏麻兮瑶华,将以遗兮离
+居”。可见采芳相赠,是结恩情的意思,男女都可,远近也都可。
+
+@bye
diff --git a/doc/texinfo-zh.tex b/doc/texinfo-zh.tex
new file mode 100644
index 0000000000..34465b29fa
--- /dev/null
+++ b/doc/texinfo-zh.tex
@@ -0,0 +1,55 @@
+% texinfo-zh.tex -- Chinese texinfo.tex loader
+% Some CJK packages are necessary to load before texinfo.tex.
+%
+% Copyright 2016-2022 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/>.
+%
+% Parts of file copied from texinfo-ja.tex in the same directory
+
+%
+% For XeTeX
+%
+\ifx\XeTeXrevision\thisisundefined
+\else
+  % XeTeX 0.9998+ is required.
+  \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.9998}<0
+    \errmessage{XeTeX 0.9998+ is required}
+  \fi
+  % zhspacing: Spacing for mixed CJK-English documents in XeTeX
+  % http://www.ctan.org/tex-archive/macros/xetex/generic/zhspacing
+  \openin 1 zhspacing.sty \ifeof 1
+    \errmessage{zhspacing is not found.
+    It is required for Chinese Texinfo files with XeTeX.
+    http://www.ctan.org/tex-archive/macros/xetex/generic/zhspacing
+    It might be contained in texlive-lang-chinese.}
+  \else
+    \def\zhfont{dummy} % Cancel the request of SimSun font
+    \def\zhpunctfont{dummy} % Cancel the request of SimSun font
+    \input zhspacing.sty
+    \zhspacing
+    \def\txizhpackage{zhspacing}
+  \fi
+\fi
+
+%
+% For others
+%
+\ifx\XeTeXrevision\thisisundefined
+    \errmessage{The TeX engine is not XeTeX.
+    XeTeX is required for Chinese Texinfo files}
+\fi
+
+% Load original texinfo.tex
+\input texinfo.tex
diff --git a/doc/txi-zh.tex b/doc/txi-zh.tex
new file mode 100644
index 0000000000..aecaf51254
--- /dev/null
+++ b/doc/txi-zh.tex
@@ -0,0 +1,323 @@
+% txi-zh.tex -- Chinese translations and font definitions for texinfo.tex.
+%
+% Copyright 1999-2022 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/>.
+%
+% Modified from txi-ja.tex by Wu XiangCheng
+
+\txisetlanguage{chinese}{2}{3}
+
+\plainnonfrenchspacing
+
+\gdef\putwordAppendix{附录}
+\gdef\putwordChapter{章}
+\gdef\putworderror{错误}
+\gdef\putwordfile{文件}
+\gdef\putwordin{在}
+\gdef\putwordIndexIsEmpty{(索引为空白)}
+\gdef\putwordIndexNonexistent{(索引不存在)}
+\gdef\putwordInfo{Info}
+\gdef\putwordInstanceVariableof{实例变量}
+\gdef\putwordMethodon{Method on}
+\gdef\putwordNoTitle{无题}
+\gdef\putwordof{之}
+\gdef\putwordon{在}
+\gdef\putwordpage{页}
+\gdef\putwordsection{节}
+\gdef\putwordSection{节}
+\gdef\putwordsee{见}
+\gdef\putwordSee{见}
+\gdef\putwordSeeAlso{也见}
+\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{函数}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% produce yyyy 年 mm 月 dd 日
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\today{%
+  \number\year 年
+  \ \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
+  \number\day 日}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Chinese font definitions
+% font choice: 1. Noto Serif CJK 思源宋体 NotoSerifCJK-Regular.ttc
+%              2. AR PL UKai     文鼎悠楷 ukai.ttc
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ifx\txizhpackage\thisisundefined
+  \errmessage{Required CJK package is not found.
+  Used `texinfo-zh.tex' instead of `texinfo.tex'}
+\else
+  %
+  % For XeTeX
+  %
+  \ifx\XeTeXrevision\thisisundefined
+  \else
+    % Setting Chinese font instead of Chinese font
+    \def\setzhfont#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.)
+    % Chinese font size is muliplied by 0.962216.
+    \let\definealphabetictextfontsizexi\definetextfontsizexi
+    \gdef\definetextfontsizexi{%
+      % Text fonts (11.2pt, magstep1).
+      \font\textmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 10.78pt
+      \font\textgtzzz"[ukai.ttc]:mapping=tex-text" at 10.78pt
+      \def\textmc{\setzhfont\textmczzz}
+      \def\textgt{\setzhfont\textgtzzz}
+
+      % Fonts for indices, footnotes, small examples (9pt).
+      \font\smallmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 8.66pt
+      \font\smallgtzzz"[ukai.ttc]:mapping=tex-text" at 8.66pt
+      \def\smallmc{\setzhfont\smallmczzz}
+      \def\smallgt{\setzhfont\smallgtzzz}
+
+      % Fonts for small examples (8pt).
+      \font\smallermczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
7.70pt
+      \font\smallergtzzz"[ukai.ttc]:mapping=tex-text" at 7.70pt
+      \def\smallermc{\setzhfont\smallermczzz}
+      \def\smallergt{\setzhfont\smallergtzzz}
+
+      % Fonts for title page (20.4pt):
+      \font\titlemczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
19.63pt
+      \font\titlegtzzz"[ukai.ttc]:mapping=tex-text" at 19.63pt
+      \def\titlemc{\setzhfont\titlemczzz}
+      \def\titlegt{\setzhfont\titlegtzzz}
+
+      % Chapter (and unnumbered) fonts (17.28pt).
+      \font\chapmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 16.63pt
+      \font\chapgtzzz"[ukai.ttc]:mapping=tex-text" at 16.63pt
+      \def\chapmc{\setzhfont\chapmczzz}
+      \def\chapgt{\setzhfont\chapgtzzz}
+
+      % Section fonts (14.4pt).
+      \font\secmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 13.86pt
+      \font\secgtzzz"[ukai.ttc]:mapping=tex-text" at 13.86pt
+      \def\secmc{\setzhfont\secmczzz}
+      \def\secgt{\setzhfont\secgtzzz}
+
+      % Subsection fonts (13.15pt).
+      \font\ssecmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 12.65pt
+      \font\ssecgtzzz"[ukai.ttc]:mapping=tex-text" at 12.65pt
+      \def\ssecmc{\setzhfont\ssecmczzz}
+      \def\ssecgt{\setzhfont\ssecgtzzz}
+
+      % Reduced fonts for @acro in text (10pt).
+      \font\reducedmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
9.62pt
+      \font\reducedgtzzz"[ukai.ttc]:mapping=tex-text" at 9.62pt
+      \def\reducedmc{\setzhfont\reducedmczzz}
+      \def\reducedgt{\setzhfont\reducedgtzzz}
+
+      % Fonts for short table of contents.
+      \font\shortcontmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
11.55pt
+      \font\shortcontgtzzz"[ukai.ttc]:mapping=tex-text" at 11.55pt
+      \def\shortcontmc{\setzhfont\shortcontmczzz}
+      \def\shortcontgt{\setzhfont\shortcontgtzzz}
+
+      \definealphabetictextfontsizexi
+    }
+
+    % Definitions for a main text size of 10pt.
+    % Chinese font size is muliplied by 0.962216.
+    \let\definealphabetictextfontsizex\definetextfontsizex
+    \gdef\definetextfontsizex{%
+      % Text fonts (10pt).
+      \font\textmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 9.62pt
+      \font\textgtzzz"[ukai.ttc]:mapping=tex-text" at 9.62pt
+      \def\textmc{\setzhfont\textmczzz}
+      \def\textgt{\setzhfont\textgtzzz}
+
+      % Fonts for indices, footnotes, small examples (9pt).
+      \font\smallmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 8.66pt
+      \font\smallgtzzz"[ukai.ttc]:mapping=tex-text" at 8.66pt
+      \def\smallmc{\setzhfont\smallmczzz}
+      \def\smallgt{\setzhfont\smallgtzzz}
+
+      % Fonts for small examples (8pt).
+      \font\smallermczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
7.70pt
+      \font\smallergtzzz"[ukai.ttc]:mapping=tex-text" at 7.70pt
+      \def\smallermc{\setzhfont\smallermczzz}
+      \def\smallergt{\setzhfont\smallergtzzz}
+
+      % Fonts for title page (20.4pt):
+      \font\titlemczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
19.63pt
+      \font\titlegtzzz"[ukai.ttc]:mapping=tex-text" at 19.63pt
+      \def\titlemc{\setzhfont\titlemczzz}
+      \def\titlegt{\setzhfont\titlegtzzz}
+
+      % Chapter fonts (14.4pt).
+      \font\chapmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 13.86pt
+      \font\chapgtzzz"[ukai.ttc]:mapping=tex-text" at 13.86pt
+      \def\chapmc{\setzhfont\chapmczzz}
+      \def\chapgt{\setzhfont\chapgtzzz}
+
+      % Section fonts (12pt).
+      \font\secmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 11.55pt
+      \font\secgtzzz"[ukai.ttc]:mapping=tex-text" at 11.55pt
+      \def\secmc{\setzhfont\secmczzz}
+      \def\secgt{\setzhfont\secgtzzz}
+
+      % Subsection fonts (10pt).
+      \font\ssecmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 9.62pt
+      \font\ssecgtzzz"[ukai.ttc]:mapping=tex-text" at 9.62pt
+      \def\ssecmc{\setzhfont\ssecmczzz}
+      \def\ssecgt{\setzhfont\ssecgtzzz}
+
+      % Reduced fonts for @acro in text (9pt).
+      \font\reducedmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
8.66pt
+      \font\reducedgtzzz"[ukai.ttc]:mapping=tex-text" at 8.66pt
+      \def\reducedmc{\setzhfont\reducedmczzz}
+      \def\reducedgt{\setzhfont\reducedgtzzz}
+
+      % Fonts for short table of contents.
+      \font\shortcontmczzz"[NotoSerifCJK-Regular.ttc:2]:mapping=tex-text" at 
11.55pt
+      \font\shortcontgtzzz"[ukai.ttc]:mapping=tex-text" at 11.55pt
+      \def\shortcontmc{\setzhfont\shortcontmczzz}
+      \def\shortcontgt{\setzhfont\shortcontgtzzz}
+
+      \definealphabetictextfontsizex
+    }
+
+    % Chinese line break settings
+    \XeTeXlinebreaklocale "zh_CN"
+    \XeTeXlinebreakskip=0em plus 0.1em minus 0.01em
+    \XeTeXlinebreakpenalty=0
+
+    % For copy & paste Unicode characters (XeTeX 0.99995+)
+    \ifx\XeTeXgenerateactualtext\thisisundefined
+    \else
+      \XeTeXgenerateactualtext=1
+    \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\txizhpackage\thisisundefined



reply via email to

[Prev in Thread] Current Thread [Next in Thread]