summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx')
-rw-r--r--Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx330
1 files changed, 98 insertions, 232 deletions
diff --git a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
index c10baf7ad03..e2a3420984f 100644
--- a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
+++ b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
@@ -4,83 +4,77 @@
\iffalse
%</internal>
%<*readme>
-Introduction
-------------
+xCJK2uni
+========
+
The `xCJK2uni` package provides commands to convert CJK character to Unicode in
non-UTF-8 encoding. It provides hooks for `hyperref` to get the correct bookmarks.
-It also provides some /ToUnicode mapping file for CJK subfont. They can be used
+It also provides some `/ToUnicode` mapping file for CJK subfont. They can be used
with `cmap` package and make CJK character searchable and copyable in PDF files
generated by pdfLaTeX.
-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
+Basic Usage
+-----------
- http://www.latex-project.org/lppl.txt
+The package provides the following macros:
-and version 1.3 or later is part of all distributions of LaTeX version
-2005/12/01 or later.
+ \useCJKencmap{<encoding>}
-This work has the LPPL maintenance status "maintained".
-The Current Maintainer of this work is Qing Lee.
+Set the current encoding. The default encoding is GBK.
-This work consists of the file xCJK2uni.dtx,
- and the derived files xCJK2uni.pdf,
- xCJK2uni.sty,
- xCJK2uni.ins,
- xCJK2uni-make.tex,
- xCJK2uni-sfd.def,
- xCJK2uni-UBg5plus.def,
- xCJK2uni-UBig5.def,
- xCJK2uni-UGB.def,
- xCJK2uni-UGBK.def,
- xCJK2uni-UJIS.def,
- xCJK2uni-UKS.def,
- c****.cmap, and
- README (this file).
+ \CJKchartouni{<character>}
-Basic Usage
------------
-The package provides the following macros:
-
- \useCJKencmap{<encoding>}
- Set the current encoding. The default encoding is GBK.
+Convert a single CJK character to its Unicode.
+It requires two steps of expansion.
- \CJKchartouni{<character>}
- Convert a single CJK character to its Unicode.
- It requires two steps of expansion.
+ \CJKsfdtouni{<plane>}{<slot>}
- \CJKsfdtouni{<plane>}{<slot>}
- Convert the .sfd coordinate to its Unicode.
- It requires two steps of expansion.
+Convert the .sfd coordinate to its Unicode.
+It requires two steps of expansion.
You can read the package manual (in Chinese) for more detailed explanations.
-Author
-------
-Qing Lee
-Email: sobenlee@gmail.com
+Contributing
+------------
-If you are interested in the process of development you may observe
+This package is a part of the [ctex-kit](https://github.com/CTeX-org/ctex-kit) project.
- https://github.com/CTeX-org/ctex-kit
+Issues and pull requests are welcome.
-Installation
-------------
-The package is supplied in dtx format and as a pre-extracted zip file,
-xCJK2uni.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 xCJK2uni.dtx" will extract the package whereas
-"xelatex xCJK2uni.dtx" will typeset the documentation.
+Copyright and Licence
+---------------------
-The package requires LaTeX3 support as provided in the l3kernel.
-It is 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).
+ Copyright (C) 2013-2014, 2016 by Qing Lee <sobenlee@gmail.com>
+ ----------------------------------------------------------------------
-To compile the documentation without error, you will need the xeCJK package
-and some specific Chinese Simplified fonts.
+ 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.
+
+ This package consists of the file xCJK2uni.dtx,
+ and the derived files xCJK2uni.pdf,
+ xCJK2uni.sty,
+ xCJK2uni.ins,
+ xCJK2uni-make.tex,
+ xCJK2uni-sfd.def,
+ xCJK2uni-UBg5plus.def,
+ xCJK2uni-UBig5.def,
+ xCJK2uni-UGB.def,
+ xCJK2uni-UGBK.def,
+ xCJK2uni-UJIS.def,
+ xCJK2uni-UKS.def,
+ c****.cmap, and
+ README.md (this file).
%</readme>
%<*internal>
\fi
@@ -91,96 +85,62 @@ and some specific Chinese Simplified fonts.
%</internal>
%<*install>
-\newread\inputcheck
-\openin\inputcheck=xCJK2uni.ver
-\ifeof\inputcheck
- \expandafter\def\csname xCJK2uniPutVersion\endcsname{\string\GetIdInfo$Id$}
-\else
- \input xCJK2uni.ver
-\fi
-\closein\inputcheck
-
-\input l3docstrip.tex
+\input ctxdocstrip %
-\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 \catcode`\ =10
- \xdef\expandedLineStuff{\scantokens{#2\noexpand}}%
- \endgroup
- \def\do##1##2##3{%
- \if1\Expr{##2}\StreamPut##1{\expandedLineStuff}\fi
- }%
- \activefiles
-}
-
-\keepsilent
-\askforoverwritefalse
\preamble
- Copyright (C) 2013-2014, 2016 by Qing Lee <sobenlee@gmail.com>
+ Copyright (C) 2013-2014, 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 xCJK2uni.dtx,
- and the derived files xCJK2uni.pdf,
- xCJK2uni.sty,
- xCJK2uni.ins,
- xCJK2uni-make.tex,
- xCJK2uni-sfd.def,
- xCJK2uni-UBg5plus.def,
- xCJK2uni-UBig5.def,
- xCJK2uni-UGB.def,
- xCJK2uni-UGBK.def,
- xCJK2uni-UJIS.def,
- xCJK2uni-UKS.def,
- c****.cmap, and
- README.
-\endpostamble
-
-\declarepostamble\emptypostamble
+ This package consists of the file xCJK2uni.dtx,
+ and the derived files xCJK2uni.pdf,
+ xCJK2uni.sty,
+ xCJK2uni.ins,
+ xCJK2uni-make.tex,
+ xCJK2uni-sfd.def,
+ xCJK2uni-UBg5plus.def,
+ xCJK2uni-UBig5.def,
+ xCJK2uni-UGB.def,
+ xCJK2uni-UGBK.def,
+ xCJK2uni-UJIS.def,
+ xCJK2uni-UKS.def,
+ c****.cmap, and
+ README.md.
\endpostamble
\generate
{
+%</install>
+%<*internal>
\usedir{source/latex/xcjk2uni}
\file{xCJK2uni.ins} {\from{\jobname.dtx}{install}}
+%</internal>
+%<*install>
\usedir{tex/latex/xcjk2uni}
\file{xCJK2uni.sty} {\from{\jobname.dtx}{package}}
\file{xCJK2uni-make.tex} {\from{\jobname.dtx}{make}}
\nopreamble\nopostamble
\usedir{doc/latex/xcjk2uni}
- \file{README.txt} {\from{\jobname.dtx}{readme}}
+ \file{README.md} {\from{\jobname.dtx}{readme}}
}
\let\input\@@input
@@ -229,22 +189,14 @@ and some specific Chinese Simplified fonts.
%<*internal>
\fi
%</internal>
-%
-%<*driver|package|make|def>
-%<*!(make|def)>
-\NeedsTeXFormat{LaTeX2e}
-\RequirePackage{expl3}
-%</!(make|def)>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\RequirePackage{expl3}
%<make>\input expl3-generic %
-%<.!driver>\csname xCJK2uniPutVersion\endcsname
+%<+package|make|def>\GetIdInfo$Id$
+%<package|make|def> {Convert CJK character to Unicode.}
%<*driver>
-\InputIfFileExists{xCJK2uni.ver}{}{
- \expandafter\def\csname xCJK2uniGetVersionInfo\endcsname{\GetIdInfo$Id$}}
-\csname xCJK2uniGetVersionInfo\endcsname
- {xCJK2uni source file}
-\ProvidesExplFile{\ExplFileName.\ExplFileExtension}
+\def\ctxaux#1#2#3{\def\ctxversion{v#2}}\ctxaux
%</driver>
-%<!driver> {Convert CJK character to Unicode.}
%<package>\ProvidesExplPackage{\ExplFileName}
%<make>\ExplSyntaxOn
%<make>\cs_if_exist:NF \ProvidesExplFile
@@ -261,111 +213,25 @@ and some specific Chinese Simplified fonts.
%<GBK>\ProvidesExplFile{xCJK2uni-UGBK.def}
%<JIS>\ProvidesExplFile{xCJK2uni-UJIS.def}
%<KS>\ProvidesExplFile{xCJK2uni-UKS.def}
- {\ExplFileDate}{0.5}{\ExplFileDescription}
+%<*driver|package|make|def>
+ {\ExplFileDate}{0.6}{\ExplFileDescription}
%</driver|package|make|def>
%<*driver>
-\ExplSyntaxOff
-\let\ctexrevnum\ExplFileVersion
-\expandafter\let\csname ver@thumbpdf.sty\endcsname\fmtversion
-\documentclass[numbered,full,a4paper]{l3doc}
-\usepackage{xeCJK}
-\usepackage{indentfirst}
-\usepackage{geometry}
-\hypersetup{pdfstartview=FitH}
-\geometry{includemp,hmargin={0mm,15mm},vmargin=15mm,footskip=7mm}
-\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}
-\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 }
-\AtBeginEnvironment { syntax }
- { \char_set_active_eq:NN \| \orbar }
-\ExplSyntaxOff
-\makeatother
-\pdfstringdefDisableCommands{%
- \let\cs\bookmarkcstn
- \let\tn\bookmarkcstn
- \let\meta\bookmarkmeta
- \let\path\detokenize}
-\def\TeX{\hologo{TeX}}
-\def\LaTeX{\hologo{LaTeX}}
-\def\pdfTeX{\hologo{pdfTeX}}
-\def\pdfLaTeX{\hologo{pdfLaTeX}}
-\def\orbar{\textup{\textbar}}
-\def\indexname{代码索引}
-\IndexPrologue{%
- \section*{\indexname}
- \markboth{\indexname}{\indexname}
- 斜体的数字表示对应项说明所在的页码,下划线的数字表示定义所在的代码行号,而直立体的
- 数字表示对应项使用时所在的行号。}
+\documentclass{ctxdoc}
\begin{document}
\DocInput{\jobname.dtx}
- \newgeometry{margin=15mm,footskip=7mm}
+ \IndexLayout
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{612}
-% \GetFileInfo{\jobname.dtx}
+% \GetFileId{xCJK2uni.sty}
%
% \title{\bfseries\pkg{xCJK2uni} 宏包}
% \author{李清\\ \path{sobenlee@gmail.com}}
-% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}}
+% \date{\ExplFileDate\qquad\ctxversion\thanks{\ctexkitrev{\ExplFileVersion}.}}
% \maketitle
%
% \begin{documentation}