summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xcjk2uni
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-02-03 22:59:37 +0000
committerKarl Berry <karl@freefriends.org>2016-02-03 22:59:37 +0000
commite5ef88072190f4f0e310c900fd626db1dd7dc096 (patch)
treecc33fffc8a4c7e38f9330a4f4e8bf3fa1ae78b2d /Master/texmf-dist/source/latex/xcjk2uni
parent7a4beb3037a1defa6f02c59006ba12df37394201 (diff)
xcjk2uni (3feb16)
git-svn-id: svn://tug.org/texlive/trunk@39558 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xcjk2uni')
-rw-r--r--Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx230
-rw-r--r--Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.ins44
2 files changed, 210 insertions, 64 deletions
diff --git a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
index db5f14cf178..c10baf7ad03 100644
--- a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
+++ b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.dtx
@@ -63,7 +63,7 @@ Email: sobenlee@gmail.com
If you are interested in the process of development you may observe
- http://code.google.com/p/ctex-kit/
+ https://github.com/CTeX-org/ctex-kit
Installation
------------
@@ -85,20 +85,58 @@ and some specific Chinese Simplified fonts.
%<*internal>
\fi
\begingroup
- \edef\tempa{\fmtname}
- \edef\tempb{plain}
-\expandafter\endgroup
-\ifx\tempa\tempb
+ \def\temp{LaTeX2e}
+\expandafter\endgroup\ifx\temp\fmtname\else
\csname fi\endcsname
%</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
+
+\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 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
@@ -198,11 +236,15 @@ and some specific Chinese Simplified fonts.
\RequirePackage{expl3}
%</!(make|def)>
%<make>\input expl3-generic %
-\GetIdInfo$Id: xCJK2uni.dtx 691 2014-06-20 09:20:07Z sobenlee $
- {Convert CJK character to Unicode.}
+%<.!driver>\csname xCJK2uniPutVersion\endcsname
%<*driver>
+\InputIfFileExists{xCJK2uni.ver}{}{
+ \expandafter\def\csname xCJK2uniGetVersionInfo\endcsname{\GetIdInfo$Id$}}
+\csname xCJK2uniGetVersionInfo\endcsname
+ {xCJK2uni source file}
\ProvidesExplFile{\ExplFileName.\ExplFileExtension}
%</driver>
+%<!driver> {Convert CJK character to Unicode.}
%<package>\ProvidesExplPackage{\ExplFileName}
%<make>\ExplSyntaxOn
%<make>\cs_if_exist:NF \ProvidesExplFile
@@ -219,14 +261,13 @@ and some specific Chinese Simplified fonts.
%<GBK>\ProvidesExplFile{xCJK2uni-UGBK.def}
%<JIS>\ProvidesExplFile{xCJK2uni-UJIS.def}
%<KS>\ProvidesExplFile{xCJK2uni-UKS.def}
- {\ExplFileDate}{0.4}{\ExplFileDescription}
-%<*driver>
-\ExplSyntaxOff
-%</driver>
+ {\ExplFileDate}{0.5}{\ExplFileDescription}
%</driver|package|make|def>
-%
%<*driver>
-\documentclass[full,a4paper]{l3doc}
+\ExplSyntaxOff
+\let\ctexrevnum\ExplFileVersion
+\expandafter\let\csname ver@thumbpdf.sty\endcsname\fmtversion
+\documentclass[numbered,full,a4paper]{l3doc}
\usepackage{xeCJK}
\usepackage{indentfirst}
\usepackage{geometry}
@@ -242,22 +283,69 @@ and some specific Chinese Simplified fonts.
\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 }
{
- \href
+ \exp_args:Nx \href
{
- http://mirrors.ctan.org/help/Catalogue/entries/
- \IfNoValueTF {#1} { \tl_expandable_lowercase:n {#2} } {#1} .html
+ 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\orvar{\textup{\textbar}}
+\def\orbar{\textup{\textbar}}
\def\indexname{代码索引}
\IndexPrologue{%
\section*{\indexname}
@@ -272,12 +360,12 @@ and some specific Chinese Simplified fonts.
%</driver>
% \fi
%
-% \CheckSum{615}
+% \CheckSum{612}
% \GetFileInfo{\jobname.dtx}
%
% \title{\bfseries\pkg{xCJK2uni} 宏包}
% \author{李清\\ \path{sobenlee@gmail.com}}
-% \date{\filedate\qquad\fileversion}
+% \date{\filedate\qquad\fileversion\thanks{\ctexkitrev{\ctexrevnum}.}}
% \maketitle
%
% \begin{documentation}
@@ -300,7 +388,7 @@ and some specific Chinese Simplified fonts.
%
% \begin{function}{\useCJKencmap}
% \begin{syntax}
-% \cs{useCJKencmap} \Arg{Bg5\orvar{}Bg5+\orvar{}GB\orvar{}GBK\orvar{}JIS\orvar{}KS}
+% \cs{useCJKencmap} \Arg{Bg5|Bg5+|GB|GBK|JIS|KS}
% \end{syntax}
% 设置当前的编码环境。以上是 \pkg{xCJK2uni} 支持的文字编码,缺省使用 GBK。
% \pkg{xCJK2uni} 会在 \env{CJK} 环境内自动更新支持的编码。
@@ -318,7 +406,7 @@ and some specific Chinese Simplified fonts.
% \begin{syntax}
% \cs{CJKsfdtouni} \Arg{plane} \Arg{slot}
% \end{syntax}
-% \meta{plane} 表示由 \texttt{.sfd} 文件定义的子字体的编号,\meta{slot} 表示在
+% \meta{plane} 表示由 \file{.sfd} 文件定义的子字体的编号,\meta{slot} 表示在
% 子字体中的位置,这个命令将得到该坐标位置的 Unicode。将它展开两次就可以得到结果。
% 如果在当前编码下,该坐标位置不合法,将展开为空。
% \end{function}
@@ -339,7 +427,19 @@ and some specific Chinese Simplified fonts.
% \end{macrocode}
%
% \begin{macrocode}
-\pdftex_if_engine:F
+\msg_new:nnn { xCJK2uni } { l3-too-old }
+ {
+ Support~package~'expl3'~too~old. \\\\
+ Please~update~an~up~to~date~version~of~the~bundles\\\\
+ 'l3kernel'~and~'l3packages'\\\\
+ using~your~TeX~package~manager~or~from~CTAN.
+ }
+\@ifpackagelater { expl3 } { 2015/09/24 } { }
+ { \msg_error:nn { xCJK2uni } { l3-too-old } }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\sys_if_engine_pdftex:F
{
\msg_new:nnn { xCJK2uni } { pdflatex }
{ The~xCJK2uni~package~is~only~supported~in~pdfTeX. }
@@ -445,18 +545,22 @@ and some specific Chinese Simplified fonts.
% \begin{macrocode}
\cs_new_nopar:Npn \@@_sfd_to_unicode:nn #1#2
{
- \tex_romannumeral:D -`0 \exp_last_unbraced:Nf
- \@@_get_unicode:w \CJKtu_sfd_map:nn {#1} {#2} \s__stop
+ \exp:w \exp_last_unbraced:Nf
+ \@@_get_unicode:w \CJKtu_sfd_map:nn {#1} {#2} \exp_end:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[internal]{\@@_get_unicode:w}
% \begin{macrocode}
-\cs_new_nopar:Npn \@@_get_unicode:w #1 \s__stop
- { \tl_if_empty:nF {#1} { \@@_get_unicode_aux:w #1 \q_stop } }
+\cs_new_nopar:Npn \@@_get_unicode:w #1 \exp_end:
+ {
+ \tl_if_empty:nTF {#1}
+ { \exp_end: }
+ { \@@_get_unicode_aux:w #1 \q_stop }
+ }
\cs_new_nopar:Npn \@@_get_unicode_aux:w #1 \or: #2 \q_stop
- { \or: #2 \exp_stop_f: #1 }
+ { \or: #2 \exp_end: #1 }
% \end{macrocode}
% \end{macro}
%
@@ -466,7 +570,7 @@ and some specific Chinese Simplified fonts.
\char_set_catcode_active:n { "7F }
\cs_new_nopar:Npn \@@_char_to_unicode:n #1
{
- \tex_romannumeral:D -`0
+ \exp:w
\int_compare:nNnTF { \tl_count:n {#1} } = \c_two
{ \CJKtu_byte:NN #1 }
{
@@ -530,7 +634,12 @@ and some specific Chinese Simplified fonts.
{ \@@_encoding_error: }
}
\cs_new_nopar:Npn \@@_encoding_error:
- { \exp_stop_f: \__msg_expandable_error:n { Wrong~encoding~scheme. } }
+ {
+ \msg_expandable_error:nn { xCJK2uni } { encoding-error }
+ \exp_end:
+ }
+\msg_new:nnn { xCJK2uni } { encoding-error }
+ { Wrong~encoding~scheme. }
% \end{macrocode}
% \end{macro}
%
@@ -569,7 +678,7 @@ and some specific Chinese Simplified fonts.
% \begin{macro}[internal]{\@@_get_unicode:n}
% \begin{macrocode}
\cs_new_nopar:Npn \@@_get_unicode:n #1
- { \exp_last_unbraced:Nf \@@_get_unicode:w #1 \s__stop }
+ { \exp_last_unbraced:Nf \@@_get_unicode:w #1 \exp_end: }
% \end{macrocode}
% \end{macro}
%
@@ -657,12 +766,12 @@ and some specific Chinese Simplified fonts.
%
% \begin{macrocode}
\ior_new:N \g_@@_sfd_ior
-\tl_new:N \g_@@_path_str
-\luatex_if_engine:TF
+\str_new:N \g_@@_path_str
+\sys_if_engine_luatex:TF
{
- \tl_gset:Nx \g_@@_path_str
+ \str_gset:Nx \g_@@_path_str
{
- \luatex_directlua:D
+ \lua_now_x:n
{
kpse.set_program_name("luatex") ~
local ~ sfd = kpse.find_file("UGBK.sfd", "subfont~definition~files") ~
@@ -688,16 +797,12 @@ and some specific Chinese Simplified fonts.
{
\seq_set_split:NnV \l_tmpa_seq { / } \g_@@_path_str
\seq_pop_right:NN \l_tmpa_seq \g_@@_path_str
- \tl_gset:Nx \g_@@_path_str { \seq_use:Nn \l_tmpa_seq { / } }
+ \str_gset:Nx \g_@@_path_str { \seq_use:Nn \l_tmpa_seq { / } }
}
% \end{macrocode}
%
% \begin{macrocode}
-\tl_const:Nx \c_@@_hash_str { \iow_char:N \# }
-\tl_const:Nx \c_@@_lbrace_str { \iow_char:N \{ }
-\tl_const:Nx \c_@@_rbrace_str { \iow_char:N \} }
-\tl_const:Nx \c_@@_backslash_str { \iow_char:N \\ }
-\tl_const:Nx \c_@@_indent_str
+\str_const:Nx \c_@@_indent_str
{ \c_catcode_other_space_tl \c_catcode_other_space_tl }
\iow_new:N \g_@@_sfd_map_iow
\iow_new:N \g_@@_sfd_cmap_iow
@@ -760,19 +865,20 @@ and some specific Chinese Simplified fonts.
%
% \begin{macro}[internal]{\@@_read_sfd_line:n,\@@_read_sfd_line:nn}
% \begin{macrocode}
-\group_begin:
-\char_set_lccode:nn { \c_zero } { `\\ }
-\char_set_lccode:nn { \c_one } { `\x }
-\char_set_catcode_other:n { \c_zero }
-\char_set_catcode_other:n { \c_one }
-\tl_to_lowercase:n
+\cs_new_protected_nopar:Npx \@@_read_sfd_line:nnn #1#2#3
{
- \group_end:
- \cs_new_protected_nopar:Npn \@@_read_sfd_line:nnn #1#2#3
- { \@@_read_sfd_line:nwnn #1 ^^00 \q_nil \q_stop {#2} {#3} }
- \cs_new_protected_nopar:Npn \@@_read_sfd_line:nwnn
- #1 0^^01 #2 ^^00 #3 \q_stop #4#5
- { \@@_read_sfd_line:nnnnn {#1} { 0^^01 } {#2} {#4} {#5} }
+ \exp_not:N \@@_read_sfd_line:nwnn #1
+ \c_backslash_str \exp_not:N \q_nil \exp_not:N \q_stop {#2} {#3}
+ }
+\use:x
+ {
+ \cs_new_protected_nopar:Npn \exp_not:N \@@_read_sfd_line:nwnn
+ ##1 0 \token_to_str:N x ##2 \c_backslash_str ##3 \exp_not:N \q_stop
+ ##4##5
+ {
+ \exp_not:N \@@_read_sfd_line:nnnnn
+ {##1} { 0 \token_to_str:N x } {##2} {##4} {##5}
+ }
}
% \end{macrocode}
% \end{macro}
@@ -789,7 +895,7 @@ and some specific Chinese Simplified fonts.
{
\c_@@_indent_str \c_@@_indent_str
\token_to_str:N \fi: \iow_newline:
- \c_@@_indent_str \c_@@_rbrace_str
+ \c_@@_indent_str \c_right_brace_str
}
\@@_write_cmap_file:n {#5}
}
@@ -816,11 +922,11 @@ and some specific Chinese Simplified fonts.
\iow_now:Nx \g_@@_sfd_map_iow
{
\cs_new_nopar:cpn { ~ @@_ #2 _sfd_map_ \int_eval:n {#1} :n ~ } ~
- \c_@@_hash_str 1 \iow_newline:
- \c_@@_indent_str \c_@@_lbrace_str \iow_newline:
+ \c_hash_str 1 \iow_newline:
+ \c_@@_indent_str \c_left_brace_str \iow_newline:
\c_@@_indent_str \c_@@_indent_str
\exp_not:N \if_case:w \etex_numexpr:D
- \c_@@_hash_str 1 ~ \token_to_str:N \scan_stop:
+ \c_hash_str 1 ~ \token_to_str:N \scan_stop:
}
}
% \end{macrocode}
@@ -904,15 +1010,15 @@ and some specific Chinese Simplified fonts.
\iow_now:Nx \g_@@_sfd_map_iow
{
%<*#1> \iow_newline:
- \cs_new_nopar:cpn { ~ CJKtu_#1_sfd_map:nn ~ } ~ \c_@@_hash_str 1
- \iow_newline: \c_@@_indent_str \c_@@_lbrace_str \iow_newline:
+ \cs_new_nopar:cpn { ~ CJKtu_#1_sfd_map:nn ~ } ~ \c_hash_str 1
+ \iow_newline: \c_@@_indent_str \c_left_brace_str \iow_newline:
\c_@@_indent_str \c_@@_indent_str
\token_to_str:N \cs_if_exist_use:cF
\iow_newline: \c_@@_indent_str \c_@@_indent_str \c_@@_indent_str
- { ~ @@_#1_sfd_map_ ~ \exp_not:N \int_eval:n { \c_@@_hash_str 1 } ~ :n ~}
+ { ~ @@_#1_sfd_map_ ~ \exp_not:N \int_eval:n { \c_hash_str 1 } ~ :n ~}
\iow_newline: \c_@@_indent_str \c_@@_indent_str \c_@@_indent_str
{ ~ \exp_not:N \use_none:n } \iow_newline:
- \c_@@_indent_str \c_@@_rbrace_str
+ \c_@@_indent_str \c_right_brace_str
}
}
% \end{macrocode}
@@ -926,7 +1032,7 @@ and some specific Chinese Simplified fonts.
{
\c_@@_indent_str \c_@@_indent_str
\token_to_str:N \fi: \iow_newline:
- \c_@@_indent_str \c_@@_rbrace_str \iow_newline:
+ \c_@@_indent_str \c_right_brace_str \iow_newline:
%</#1>
}
}
diff --git a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.ins b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.ins
index 4aadea83f18..61d6ac170e8 100644
--- a/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.ins
+++ b/Master/texmf-dist/source/latex/xcjk2uni/xCJK2uni.ins
@@ -6,7 +6,7 @@
%%
%% xCJK2uni.dtx (with options: `install')
%%
-%% Copyright (C) 2013-2014 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
@@ -20,12 +20,52 @@
%% The Current Maintainer of this work is Qing Lee.
%%
+\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
+
+\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 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