summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx')
-rw-r--r--Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx158
1 files changed, 80 insertions, 78 deletions
diff --git a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
index 6a6e16387e3..5d2008047f3 100644
--- a/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
+++ b/Master/texmf-dist/source/xelatex/xecjk/xeCJK.dtx
@@ -194,7 +194,7 @@ Copyright and Licence
%<*package|config|fntef|listings|xunicode|xunextra>
%<!(config|xunextra)>\NeedsTeXFormat{LaTeX2e}
%<!(config|xunextra)>\RequirePackage{expl3}
-%<+!driver>\GetIdInfo$Id: xeCJK.dtx 18af4a5 2017-05-15 20:12:35 +0800 Qing Lee <sobenlee@gmail.com> $
+%<+!driver>\GetIdInfo$Id: xeCJK.dtx 8b5e450 2017-08-07 17:02:18 +0800 Qing Lee <sobenlee@gmail.com> $
%<package> {Typesetting CJK scripts with XeLaTeX}
%<config> {Configuration file for xeCJK package}
%<fntef> {xeCJK font effect}
@@ -207,7 +207,7 @@ Copyright and Licence
%<listings>\ProvidesExplPackage{xeCJK-listings}
%<xunicode>\ProvidesExplPackage{xunicode-addon}
%<xunextra>\ProvidesExplFile{xunicode-extra.def}
-%<!driver> {\ExplFileDate}{3.4.8}{\ExplFileDescription}
+%<!driver> {\ExplFileDate}{3.5.0}{\ExplFileDescription}
%</package|config|fntef|listings|xunicode|xunextra>
%<*driver>
\documentclass{ctxdoc}
@@ -274,8 +274,11 @@ Copyright and Licence
% \changes{v3.2.6}{2013/07/29}{\texttt{case} 类函数的用法与 \hologo{LaTeX3} 同步。}
% \changes{v3.3.2}{2015/05/15}{随 Unicode 7.0.0 更新简繁汉字映射。}
% \changes{v3.3.3}{2015/09/25}{更新 \hologo{LaTeX3} 代码。}
+% \changes{v3.5.0}{2017/07/19}{常数 \cs{c_minus_one} 已过时。}
+% \changes{v3.5.0}{2017/07/22}{使用 \texttt{lazy} 函数对 Boolean 表达式
+% 进行最小化运算(\hologo{LaTeX3} 2017/07/19)。}
%
-% \CheckSum{10169}
+% \CheckSum{10170}
% \GetFileId{xeCJK.sty}
%
% \title{\bfseries\pkg{xeCJK} 宏包}
@@ -519,6 +522,7 @@ Copyright and Licence
% \end{syntax}
% 全局设定当没有声明对应的斜体时,是否使用\textit{\CJKfontspec[AutoFakeSlant]{Adobe Song Std}伪斜体};
% 当输入的是数字时,将使用伪斜体,并将使用输入的数字作为伪斜体的默认倾斜程度。
+% 倾斜程度的取值范围是 $[-0.999, 0.999]$。
% \end{function}
%
% \begin{function}[rEXP]{EmboldenFactor}
@@ -532,7 +536,7 @@ Copyright and Licence
% \begin{syntax}
% SlantFactor = \Arg{数字|(0.167)}
% \end{syntax}
-% 设置伪斜体的倾斜程度,范围是 $-0.999 \sim 0.999$。
+% 设置伪斜体的倾斜程度,范围是 $[-0.999, 0.999]$。
% \end{function}
%
% \begin{function}[updated=2012-11-10]{PunctStyle}
@@ -1241,7 +1245,7 @@ Copyright and Licence
% kerning-margin-minimum = 0.1 em
% }
% \end{ctexexam}
-% 就定义了一个名为 |mine| 的标点处理格式。可以在导演区通过
+% 就定义了一个名为 |mine| 的标点处理格式。可以在导言区通过
% \begin{frameverb}
% \xeCJKsetup{PunctStyle=mine}
% \end{frameverb}
@@ -1592,7 +1596,7 @@ Copyright and Licence
using~your~TeX~package~manager~or~from~CTAN.\\
\str_if_eq:nnT {#1} { expl3 } { Loading~xeCJK~will~abort! }
}
-\@ifpackagelater { expl3 } { 2015/09/24 } { }
+\@ifpackagelater { expl3 } { 2017/07/19 } { }
{ \msg_critical:nnn { xeCJK } { l3-too-old } { expl3 } }
% \end{macrocode}
%
@@ -1779,7 +1783,9 @@ Copyright and Licence
}
\cs_new:Npn \@@_tl_remove_outer_braces:w #1 \s__stop
{
- \bool_if:nTF { \tl_if_single_p:n {#1} && ! ( \tl_if_head_is_N_type_p:n {#1} ) }
+ \bool_lazy_and:nnTF
+ { \tl_if_single_p:n {#1} }
+ { ! ( \tl_if_head_is_N_type_p:n {#1} ) }
{ \xeCJK_tl_remove_outer_braces:n {#1} }
{ \tl_trim_spaces:n {#1} }
}
@@ -2413,6 +2419,7 @@ Copyright and Licence
%
% \changes{v3.3.3}{2015/06/25}{补充 Ext-E。}
% \changes{v3.4.1}{2016/08/18}{补充 Unicode 9.0.0 的西夏文。}
+% \changes{v3.5.0}{2017/07/22}{补充 Ext-F。}
%
% \begin{macro}[var,internal]{\c_@@_CJK_chars_clist}
% CJK 字符类,包括文字和标点符号。
@@ -2551,7 +2558,11 @@ Copyright and Licence
% \end{macrocode}
% \item CJK Unified Ideographs Extension-E (中日韩统一表意文字扩展 E)
% \begin{macrocode}
- "2B820 -> "2CEA1 ,
+ "2B820 -> "2CEAF ,
+% \end{macrocode}
+% \item CJK Unified Ideographs Extension-F (中日韩统一表意文字扩展 F)
+% \begin{macrocode}
+ "2CEB0 -> "2EBEF ,
% \end{macrocode}
% \item CJK Compatibility Ideographs Supplement (中日韩兼容表意文字增补)
% \begin{macrocode}
@@ -2685,7 +2696,9 @@ Copyright and Licence
% \begin{macrocode}
\cs_new_protected_nopar:Npn \@@_check_num_range:nnNN #1#2#3#4
{
- \bool_if:nTF { \xeCJK_if_blank_x_p:n {#1} || \xeCJK_if_blank_x_p:n {#2} }
+ \bool_lazy_or:nnTF
+ { \xeCJK_if_blank_x_p:n {#1} }
+ { \xeCJK_if_blank_x_p:n {#2} }
{
\int_set:Nn #3 { \xeCJK_if_blank_x:nTF {#1} {#2} {#1} }
\int_set_eq:NN #3 #4
@@ -3117,11 +3130,9 @@ Copyright and Licence
}
\cs_new_protected_nopar:Npn \@@_check_for_ecglue:
{
- \bool_if:nTF
- {
- \xeCJK_if_last_node_p:n { CJK } ||
- \xeCJK_if_last_node_p:n { CJK-widow }
- }
+ \bool_lazy_or:nnTF
+ { \xeCJK_if_last_node_p:n { CJK } }
+ { \xeCJK_if_last_node_p:n { CJK-widow } }
{ \xeCJK_remove_node: \CJKecglue }
{
\xeCJK_if_last_node:nT { CJK-space }
@@ -3242,18 +3253,17 @@ Copyright and Licence
% \begin{macrocode}
\cs_new_protected_nopar:Npn \xeCJK_check_for_glue:
{
- \bool_if:nTF
- { \xeCJK_if_last_node_p:n { CJK } || \xeCJK_if_last_node_p:n { CJK-space } }
+ \bool_lazy_or:nnTF
+ { \xeCJK_if_last_node_p:n { CJK } }
+ { \xeCJK_if_last_node_p:n { CJK-space } }
{ \xeCJK_remove_node: \CJKglue }
{
\xeCJK_if_last_node:nTF { CJK-widow }
{ \xeCJK_remove_node: \xeCJK_widow_penalty: \CJKglue }
{
- \bool_if:nTF
- {
- \xeCJK_if_last_node_p:n { default } ||
- \int_compare_p:nNn \etex_lastnodetype:D = \c_ten
- }
+ \bool_lazy_or:nnTF
+ { \xeCJK_if_last_node_p:n { default } }
+ { \int_compare_p:nNn \etex_lastnodetype:D = \c_ten }
{ \xeCJK_remove_node: \CJKecglue }
{ \xeCJK_check_for_xglue: }
}
@@ -3824,32 +3834,26 @@ Copyright and Licence
{ \c_one }
{
\box_set_to_last:N \l_@@_tmp_box
- \bool_if:nTF
- {
- \int_compare_p:nNn \etex_lastnodetype:D = \c_minus_one &&
- \dim_compare_p:nNn { \box_wd:N \l_@@_tmp_box } = \tex_parindent:D
- }
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \etex_lastnodetype:D = { -1 } }
+ { \dim_compare_p:nNn { \box_wd:N \l_@@_tmp_box } = \tex_parindent:D }
{ \box_use_clear:N \l_@@_tmp_box \use_none:n }
{ \box_use_clear:N \l_@@_tmp_box \use:n }
}
- { \c_minus_one } { \@@_zero_glue: \use_none:n }
+ { -1 } { \@@_zero_glue: \use_none:n }
{ \c_eleven }
{
- \bool_if:nTF
- {
- ! ( \skip_if_finite_p:n { \tex_lastskip:D } ) ||
- \skip_if_eq_p:nn { \tex_lastskip:D } { 1 sp }
- }
+ \bool_lazy_or:nnTF
+ { ! ( \skip_if_finite_p:n { \tex_lastskip:D } ) }
+ { \skip_if_eq_p:nn { \tex_lastskip:D } { 1 sp } }
{ \@@_zero_glue: \use_none:n }
{
\skip_if_eq:nnTF { \tex_lastskip:D } { \labelsep }
{
\tex_unskip:D
- \bool_if:nTF
- {
- \int_compare_p:nNn \etex_lastnodetype:D = \c_thirteen &&
- \int_compare_p:nNn \tex_lastpenalty:D = \c_zero
- }
+ \bool_lazy_and:nnTF
+ { \int_compare_p:nNn \etex_lastnodetype:D = \c_thirteen }
+ { \int_compare_p:nNn \tex_lastpenalty:D = \c_zero }
{ \skip_horizontal:n { \labelsep } \use_none:n }
{ \skip_horizontal:n { \labelsep } \use:n }
}
@@ -6390,7 +6394,9 @@ Copyright and Licence
}
{ \@@_warning:nx { SubBlock-undefined } {##1} }
}
- \bool_if:nT { #1 && \seq_if_empty_p:N \l_@@_sub_key_seq }
+ \bool_lazy_and:nnT
+ {#1}
+ { \seq_if_empty_p:N \l_@@_sub_key_seq }
{
\seq_map_function:NN
\g_@@_sub_key_seq \@@_add_sub_class_features:n
@@ -6398,8 +6404,9 @@ Copyright and Licence
\prop_get:NVNT \g_@@_family_font_options_prop
\l_xeCJK_family_tl \l_@@_font_options_clist
{
- \bool_if:nT
- { \seq_if_empty_p:N \l_@@_sub_key_seq || #1 }
+ \bool_lazy_or:nnT
+ { \seq_if_empty_p:N \l_@@_sub_key_seq }
+ {#1}
{
\clist_concat:NNN \l_@@_font_options_clist
\l_@@_font_options_clist \l_@@_add_font_features_clist
@@ -7475,7 +7482,9 @@ Copyright and Licence
}
\@@_after_end_preamble:n
{
- \bool_if:nT { \g_@@_math_bool && \cs_if_exist_p:N \Url@MathSetup }
+ \bool_lazy_and:nnT
+ { \g_@@_math_bool }
+ { \cs_if_exist_p:N \Url@MathSetup }
{ \tl_put_right:Nn \Url@MathSetup { \xeCJK@update@fam } }
}
% \end{macrocode}
@@ -7495,11 +7504,9 @@ Copyright and Licence
\exp_not:o
{
\fontspec_setup_maths:
- \bool_if:nT
- {
- \tl_if_empty_p:N \g__fontspec_bfmathrm_tl ||
- \tl_if_empty_p:N \g_fontspec_bfmathrm_tl
- }
+ \bool_lazy_or:nnT
+ { \tl_if_empty_p:N \g__fontspec_bfmathrm_tl }
+ { \tl_if_empty_p:N \g_fontspec_bfmathrm_tl }
{ \DeclareSymbolFontAlphabet \mathrm { operators } }
}
}
@@ -7966,8 +7973,9 @@ Copyright and Licence
% \begin{macrocode}
\@@_after_end_preamble:n
{
- \bool_if:nT
- { \xeCJK_if_package_loaded_p:n { cprotect } && \cs_if_exist_p:N \icprotect }
+ \bool_lazy_and:nnT
+ { \xeCJK_if_package_loaded_p:n { cprotect } }
+ { \cs_if_exist_p:N \icprotect }
{ \exp_after:wN \tex_let:D \cs:w cprotect \cs_end: \icprotect }
}
% \end{macrocode}
@@ -9022,7 +9030,7 @@ Copyright and Licence
% \begin{macrocode}
\cs_new_protected:Npn \xeCJK_fntef_boot:nnNNNn #1#2#3#4#5#6
{
- \bool_if:nT { #3 || #5 }
+ \bool_lazy_or:nnT {#3} {#5}
{ \bool_set_false:c { l_@@_#2_skip_bool } }
\IfBooleanT #4
{ \bool_set_true:c { l_@@_#2_subtract_bool } }
@@ -9035,7 +9043,7 @@ Copyright and Licence
}
\cs_new_protected:Npn \xeCJK_ulem_boot:NNNn #1#2#3#4
{
- \bool_if:nT { #1 || #3 }
+ \bool_lazy_or:nnT {#1} {#3}
{ \bool_set_false:N \l_@@_ulem_skip_bool }
\IfBooleanT #2
{ \bool_set_true:N \l_@@_ulem_subtract_bool }
@@ -9669,6 +9677,7 @@ Copyright and Licence
}
\@@_listings_append:nN
}
+\bool_new:N \l_@@_listings_letter_bool
\cs_new_protected_nopar:Npn \@@_listings_process_other:nN #1#2
{
\lst@whitespacefalse
@@ -9714,11 +9723,12 @@ Copyright and Licence
\lst@whitespacefalse
\bool_if:NTF \l_@@_listings_letter_bool
{
- \bool_if:nF
+ \bool_lazy_or:nnF
+ { \int_compare_p:nNn \l_@@_listings_flag_int = \c_two }
{
- \int_compare_p:nNn \l_@@_listings_flag_int = \c_two ||
- ( \int_compare_p:nNn \l_@@_listings_flag_int = \c_three &&
- ! \l_@@_punct_breakable_bool )
+ \bool_lazy_and_p:nn
+ { \int_compare_p:nNn \l_@@_listings_flag_int = \c_three }
+ { ! \l_@@_punct_breakable_bool }
}
{ \lst@Output }
\lst@lettertrue
@@ -9735,11 +9745,9 @@ Copyright and Licence
\lst@whitespacefalse
\bool_if:NTF \l_@@_listings_letter_bool
{
- \bool_if:nT
- {
- \int_compare_p:nNn \l_@@_listings_flag_int < \c_two &&
- \@@_punct_if_long_p:N #2
- }
+ \bool_lazy_and:nnT
+ { \int_compare_p:nNn \l_@@_listings_flag_int < \c_two }
+ { \@@_punct_if_long_p:N #2 }
{ \lst@Output }
\lst@lettertrue
}
@@ -9935,11 +9943,9 @@ Copyright and Licence
% 些符号命令的默认设置。
%
% \begin{macrocode}
-\bool_if:nF
- {
- \sys_if_engine_xetex_p: ||
- \sys_if_engine_luatex_p:
- }
+\bool_lazy_or:nnF
+ { \sys_if_engine_xetex_p: }
+ { \sys_if_engine_luatex_p: }
{
\msg_new:nnnn { xunicode-addon } { xetex-luatex }
{ This~package~requires~either~XeTeX~or~LuaTeX~to~function.}
@@ -10252,11 +10258,9 @@ Copyright and Licence
% \begin{macrocode}
\cs_new_protected:Npn \@@_provide_text_command_default:N #1
{
- \bool_if:nF
- {
- \cs_if_exist_p:c { ? \token_to_str:N #1 } ||
- \cs_if_free_p:c { ? - \token_to_str:N #1 }
- }
+ \bool_lazy_or:nnF
+ { \cs_if_exist_p:c { ? \token_to_str:N #1 } }
+ { \cs_if_free_p:c { ? - \token_to_str:N #1 } }
{ \exp_args:NNv \ProvideTextCommandDefault #1 { ? - \token_to_str:N #1 } }
}
% \end{macrocode}
@@ -10568,11 +10572,9 @@ Copyright and Licence
\tl_if_blank:nTF {#1}
{ \cs_if_exist_use:cTF { ? #2 } { {#1} } {#1} }
{
- \bool_if:nTF
- {
- \@@_glyph_if_exist_p:n { `#3 } &&
- \@@_glyph_if_exist_p:n { `#4 }
- }
+ \bool_lazy_and:nnTF
+ { \@@_glyph_if_exist_p:n { `#3 } }
+ { \@@_glyph_if_exist_p:n { `#4 } }
{ #1#3#4 }
{ \cs_if_exist_use:cTF { ? #2 } { {#1} } { #1#3#4 } }
}
@@ -10701,11 +10703,11 @@ Copyright and Licence
}
\cs_new_protected:Npn \@@_add_double_symbol_aux:NnN #1#2#3
{
- \bool_if:nTF
+ \bool_lazy_any:nTF
{
- \token_if_letter_p:N #1 ||
- \token_if_other_p:N #1 ||
- \token_if_chardef_p:N #1
+ { \token_if_letter_p:N #1 }
+ { \token_if_other_p:N #1 }
+ { \token_if_chardef_p:N #1 }
}
{ #1#3#2 }
{ #1#2#3 }