summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-14 22:03:45 +0000
committerKarl Berry <karl@freefriends.org>2016-05-14 22:03:45 +0000
commit8a897397d1ef31d60c60a663186a8a5c0be00aa2 (patch)
tree3889866d3312f23ce9832a19b517459ed31cbf00 /Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx
parentbffe659d9cfa6ef6a9adaa796cb1a9138e109735 (diff)
xpinyin (14may16)
git-svn-id: svn://tug.org/texlive/trunk@41122 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx')
-rw-r--r--Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx298
1 files changed, 76 insertions, 222 deletions
diff --git a/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx b/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx
index 4d15e103178..8c34e25c6aa 100644
--- a/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx
+++ b/Master/texmf-dist/source/latex/xpinyin/xpinyin.dtx
@@ -4,63 +4,54 @@
\iffalse
%</internal>
%<*readme>
-Introduction
-------------
-xpinyin is a LaTeX package written to simplify the input of Hanyu Pinyin.
+xpinyin
+=======
+
+`xpinyin` is a LaTeX package written to simplify the input of Hanyu Pinyin.
The package provides macros to automatically add pinyin to Chinese characters.
-It can only be used in conjunction with xeCJK or CJK/CJKutf8 package.
+It can only be used in conjunction with `xeCJK` or `CJK/CJKutf8` package.
-Given that the implementation of pinyin package of CJK bundle is not very
+Given that the implementation of pinyin package of `CJK` bundle is not very
well, it seems that xpinyin is a good replacement of it.
You can read the package manual (in Chinese) for more detailed explanations.
-It may be distributed and/or modified under the conditions of the
-LaTeX Project Public License (LPPL), either version 1.3c of this license or
-(at your option) any later version. The latest version of this license is in
-
- http://www.latex-project.org/lppl.txt
+Contributing
+------------
-and version 1.3 or later is part of all distributions of LaTeX version
-2005/12/01 or later.
+This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project.
-This work has the LPPL maintenance status "maintained".
-The Current Maintainer of this work is Qing Lee.
+Issues and pull requests are welcome.
-This package consists of the file xpinyin.dtx,
- and the derived files xpinyin.sty,
- xpinyin.pdf,
- xpinyin.ins,
- xpinyin.lua,
- xpinyin.db,
- xpinyin-database.def and
- README (this file).
+Copyright and Licence
+---------------------
-Author
-------
-Qing Lee
-Email: sobenlee@gmail.com
+ Copyright (C) 2012-2016 by Qing Lee <sobenlee@gmail.com>
+ ----------------------------------------------------------------------
-If you are interested in the process of development you may observe
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. This version of this license is in
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+ and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
- https://github.com/CTeX-org/ctex-kit
+ This work has the LPPL maintenance status `maintained'.
-Installation
-------------
-The package is supplied in dtx format and as a pre-extracted zip file,
-xpinyin.tds.zip. The later is most convenient for most users: simply
-unzip this in your local texmf directory and run texhash to update the
-database of file locations. If you want to unpack the dtx yourself,
-running "luatex xpinyin.ins" will extract the package whereas
-"xelatex xpinyin.dtx" will typeset the documentation.
+ The Current Maintainer of this work is Qing Lee.
-The package requires LaTeX3 support as provided in the l3kernel and l3packages
-bundles. Both of these are available on CTAN as ready-to-install zip files.
-Suitable versions are available in the latest version of MiKTeX and TeX Live
-(updating the relevant packages online may be necessary).
+ This package consists of the file xpinyin.dtx,
+ and the derived files xpinyin.sty,
+ xpinyin.pdf,
+ xpinyin.ins,
+ xpinyin.lua,
+ xpinyin.db,
+ xpinyin-database.def and
+ README.md (this file).
-To compile the documentation without error, you will need the xeCJK package
-and some specific Chinese Simplified fonts (TrueType or OpenType).
%</readme>
%<*internal>
\fi
@@ -84,78 +75,43 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%<install> \csname @@end\expandafter\endcsname\expandafter\end
%<install>\fi
-\newread\inputcheck
-\openin\inputcheck=xpinyin.ver
-\ifeof\inputcheck
- \def\xpinyinPutVersion{\string\GetIdInfo$Id$}
-\else
- \input xpinyin.ver
-\fi
-\closein\inputcheck
-
-\input l3docstrip.tex
-\def\checkOption<#1{%
- \ifcase
- \ifx*#10\else \ifx/#11\else
- \ifx+#12\else \ifx-#13\else
- \ifx<#14\else \ifx @#15\else
- \ifx.#16\else
- 7\fi\fi\fi\fi\fi\fi\fi\relax
- \expandafter\starOption\or
- \expandafter\slashOption\or
- \expandafter\plusOption\or
- \expandafter\minusOption\or
- \expandafter\verbOption\or
- \expandafter\moduleOption\or
- \expandafter\expOption\or
- \expandafter\doOption\fi
- #1%
-}
-\def\expOption .#1>#2\endLine{%
- \maybeMsg{<.#1 . >}%
- \Evaluate{#1}%
- \begingroup
- \catcode`\\=0 \catcode`\{=1 \catcode`\}=2
- \xdef\expandedLineStuff{\scantokens{#2\noexpand}}%
- \endgroup
- \def\do##1##2##3{%
- \if1\Expr{##2}\StreamPut##1{\expandedLineStuff}\fi
- }%
- \activefiles
-}
-
-\keepsilent
-\askforoverwritefalse
+\input ctxdocstrip %
\let\MetaPrefix\relax
\preamble
- Copyright (C) 2012-2016 by Qing Lee <sobenlee@gmail.com>
+ Copyright (C) 2012-2016 by Qing Lee <sobenlee@gmail.com>
--------------------------------------------------------------------------
- This work may be distributed and/or modified under the
- conditions of the LaTeX Project Public License, either version 1.3
- of this license or (at your option) any later version.
- The latest version of this license is in
- http://www.latex-project.org/lppl.txt
- and version 1.3 or later is part of all distributions of LaTeX
- version 2005/12/01 or later.
- This work has the LPPL maintenance status "maintained".
- The Current Maintainer of this work is Qing Lee.
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. This version of this license is in
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+ and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status `maintained'.
+
+ The Current Maintainer of this work is Qing Lee.
+
+--------------------------------------------------------------------------
\endpreamble
\postamble
- This package consists of the file xpinyin.dtx,
- and the derived files xpinyin.sty,
- xpinyin.pdf,
- xpinyin.ins,
- xpinyin.lua,
- xpinyin.db,
- xpinyin-database.def and
- README.
+ This package consists of the file xpinyin.dtx,
+ and the derived files xpinyin.sty,
+ xpinyin.pdf,
+ xpinyin.ins,
+ xpinyin.lua,
+ xpinyin.db,
+ xpinyin-database.def and
+ README.md.
\endpostamble
\declarepostamble\emptypostamble
@@ -191,13 +147,17 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
\generate
{
+%</install>
+%<*internal>
\usedir{source/latex/xpinyin}
\file{xpinyin.ins} {\from{\jobname.dtx}{install}}
+%</internal>
+%<*install>
\usedir{tex/latex/xpinyin}
\file{xpinyin.sty} {\from{\jobname.dtx}{package}}
\nopreamble\nopostamble
\usedir{doc/latex/xpinyin}
- \file{README.txt} {\from{\jobname.dtx}{readme}}
+ \file{README.md} {\from{\jobname.dtx}{readme}}
}
\endbatchfile
@@ -205,139 +165,33 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
%<*internal>
\fi
%</internal>
-%
-%<*driver|package>
-\NeedsTeXFormat{LaTeX2e}
-\RequirePackage{expl3}
-%<.!driver>\xpinyinPutVersion
-%<*driver>
-\InputIfFileExists{xpinyin.ver}{}{
- \def\xpinyinGetVersionInfo{\GetIdInfo$Id$}}
-\xpinyinGetVersionInfo
-%</driver>
- {Automatically add pinyin to Chinese characters}
-%<*driver>
-\ProvidesExplFile{\ExplFileName.\ExplFileExtension}
-%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\RequirePackage{expl3}
+%<+package>\GetIdInfo$Id$
+%<package> {Automatically add pinyin to Chinese characters}
%<package>\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{2.2}{\ExplFileDescription}
-%<*driver>
-\ExplSyntaxOff
-%</driver>
-%</driver|package>
+%<package> {\ExplFileDate}{2.3}{\ExplFileDescription}
%<database>\ProvidesFile{xpinyin-database.def}%
-%<database> [2015/02/02 v2.2 xpinyin database]
-%
+%<database> [2016/05/14 v2.3 xpinyin database]
%<*driver>
-\let\ctexrevnum\ExplFileVersion
-\expandafter\let\csname ver@thumbpdf.sty\endcsname\fmtversion
-\documentclass[numbered,full,a4paper]{l3doc}
-\usepackage{xeCJK}
-\usepackage{indentfirst}
+\documentclass{ctxdoc}
\usepackage{xpinyin}
-\usepackage{fvrb-ex}
-\usepackage{geometry}
-\hypersetup{pdfstartview=FitH}
-\geometry{includemp,hmargin={0mm,15mm},vmargin=15mm,footskip=7mm}
-\BeforeBeginEnvironment{SideBySideExample}{\vskip1ex\relax}
-\fvset{formatcom=\xeCJKVerbAddon}
-\linespread{1.1}
-\setmainfont{TeX Gyre Pagella}
-\setsansfont{CMU Sans Serif}
-\setmonofont[
- UprightFont=* Light, BoldFont=* Bold,
- SlantedFont=* Light Oblique]{CMU Typewriter Text}
-\setCJKmainfont[BoldFont=Adobe Heiti Std,ItalicFont=Adobe Kaiti Std]{Adobe Song Std}
-\setCJKmonofont{Adobe Kaiti Std}
-\xeCJKsetup{PunctStyle=kaiming}
\newfontfamily\PinYinFont{TeX Gyre Adventor}
\xpinyinsetup{font=\PinYinFont,multiple=\color{red}}
-\def\MacroFont{\linespread{1}\small\normalfont\ttfamily}
-\def\ctexkitrev#1{%
- \href{https://github.com/CTeX-org/ctex-kit/commit/#1}{\texttt{ctex-kit} rev. #1}}
-\makeatletter
-\ExplSyntaxOn
-\DeclareDocumentCommand \package { o m }
- {
- \exp_args:Nx \href
- {
- http \token_to_str:N : //www.ctan.org/pkg/
- \IfNoValueTF {#1} { \str_fold_case:n {#2} } {#1}
- }
- { \pkg {#2} }
- }
-\cs_set_protected:Npn \__codedoc_special_index_aux:nnnnn #1#2#3#4#5
- {
- \__codedoc_special_index_set:Nn \l__codedoc_index_escaped_macro_tl {#2}
- \str_if_eq:onTF { \@currenvir } { macrocode }
- { \codeline@wrindex }
- {
- \HD@target
- \index
- }
- {
- \tl_if_empty:nF { #3 #4 }
- { #3 \actualchar #4 \levelchar }
- #1
- \actualchar
- {
- \token_to_str:N \verbatim@font \c_space_tl
- \l__codedoc_index_escaped_macro_tl
- }
- \encapchar
- hdclindex{\the\c@HD@hypercount}{#5}
- }
- }
-\DeclareDocumentCommand \cs { O{} m }
- { \__codedoc_cmd_aux:no {#1} { \c__codedoc_backslash_tl #2 } }
-\DeclareDocumentCommand \tn { O{} m }
- {
- \__codedoc_cmd_aux:no
- { index = TeX , replace = false , #1 }
- { \c__codedoc_backslash_tl #2 }
- }
-\DeclareDocumentCommand \meta { +m }
- { \__codedoc_meta_aux:n {#1} }
-\DeclareExpandableDocumentCommand \bookmarkcstn { O{} m }
- { \tl_to_str:n {#2} }
-\cs_new:Npn \bookmarkmeta #1 { < \tl_to_str:n {#1} > }
-\cs_generate_variant:Nn \__codedoc_cmd_aux:nn { no }
-\ExplSyntaxOff
-\pdfstringdefDisableCommands{%
- \let\cs\bookmarkcstn
- \let\tn\bookmarkcstn
- \let\meta\bookmarkmeta
- \let\path\@firstofone
- \let\pkg\@firstofone}
-\def\LaTeX{\hologo{LaTeX}}
-\def\pdfLaTeX{\hologo{pdfLaTeX}}
-\def\XeLaTeX{\hologo{XeLaTeX}}
-\def\TF{true\orbar false}
-\def\TTF{\defaultval{true}\orbar false}
-\def\TFF{true\orbar\defaultval{false}}
-\def\defaultval#1{\textbf{\textup{#1}}}
-\def\orbar{\textup{\textbar}}
-\makeatother
-\def\indexname{代码索引}
-\IndexPrologue{%
- \section*{\indexname}
- \markboth{\indexname}{\indexname}
- 斜体的数字表示对应项说明所在的页码,下划线的数字表示定义所在的代码行号,而直立体的
- 数字表示对应项使用时所在的行号。}
\begin{document}
\DocInput{\jobname.dtx}
- \newgeometry{margin=15mm,footskip=7mm}
+ \IndexLayout
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{719}
-% \GetFileInfo{\jobname.dtx}
+% \GetFileId{xpinyin.sty}
%
% \title{\bfseries\pkg{xpinyin} 宏包}
% \author{李清\\ \path{sobenlee@gmail.com}}
-% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}}
+% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ExplFileVersion}.}}
% \maketitle
%
% \begin{documentation}
@@ -514,9 +368,9 @@ and some specific Chinese Simplified fonts (TrueType or OpenType).
% \end{syntax}
% 设置多音字拼音的其它格式,缺省值为空。可以通过这个选项来提醒校正多音字的拼音。例如
% 本文档设置多音字拼音的颜色是红色(需要载入 \pkg{color} 宏包):
-% \begin{verbatim}[frame=single,gobble=5]
-% \xpinyinsetup{multiple={\color{red}}}
-% \end{verbatim}
+% \begin{frameverb}
+% \xpinyinsetup{multiple={\color{red}}}
+% \end{frameverb}
% \end{function}
%
% \begin{function}[added=2014/01/12]{footnote}