diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def index 1d82e05b622..b6b009ba8fe 100644 --- a/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def +++ b/Master/texmf-dist/tex/latex/ctex/engine/ctex-engine-luatex.def @@ -26,10 +26,10 @@ %% %% ------------------------------------------------------------------------------ %% -\GetIdInfo$Id: ctex.dtx 575f038 2016-10-25 17:56:58 +0800 Qing Lee <sobenlee@gmail.com> $ +\GetIdInfo$Id: ctex.dtx 88a59e5 2016-11-22 17:09:10 +0800 Qing Lee <sobenlee@gmail.com> $ {LuaLaTeX adapter (CTEX)} \ProvidesExplFile{ctex-engine-luatex.def} - {\ExplFileDate}{2.4.5}{\ExplFileDescription} + {\ExplFileDate}{2.4.6}{\ExplFileDescription} \msg_new:nnn { ctex } { luatexja-loaded } { Package~`luatexja'~can~not~be~loaded~before~`ctex'.\\ @@ -353,8 +353,6 @@ } \group_end: } -\cs_new_protected:Npn \ctex_ltj_set_family:xxx #1#2#3 - { \use:x { \ctex_ltj_set_family:nnn {#1} {#2} {#3} } } \tl_new:N \l__ctex_ltj_base_CJKfamily_tl \clist_new:N \l__ctex_ltj_font_options_clist \cs_new_protected_nopar:Npn \__ctex_ltj_use_global_options:N #1 @@ -538,20 +536,41 @@ \token_to_str:N \addCJKfontfeature (s)~ignored.\\ It~cannot~be~used~with~a~font~that~wasn't~selected~by~ctex. } -\NewDocumentCommand \setCJKfamilyfont { m O { } m } - { \ctex_ltj_set_family:xxx {#1} {#2} {#3} } -\NewDocumentCommand \newCJKfontfamily { o m O { } m } +\cs_new_protected:Npn \__ctex_ltj_pass_args:nnnn #1#2#3#4 + { + \IfNoValueTF {#2} + { \__ctex_ltj_post_arg:w {#1} {#3} {#4} } + { + \use:x { #1 {#2} {#3} } + #4 + } + } +\NewDocumentCommand \__ctex_ltj_post_arg:w { m m m O { } } + { + \use:x { #1 {#4} {#2} } + #3 + } +\NewDocumentCommand \setCJKfamilyfont { m o m } + { + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn {#1} } {#2} {#3} + { } + } +\NewDocumentCommand \newCJKfontfamily { o m o m } { \tl_set:Nx \l__ctex_ltj_tmp_tl { \IfNoValueTF {#1} { \cs_to_str:N #2 } {#1} } \cs_new_protected_nopar:Npx #2 { \ctex_ltj_switch_family:n { \l__ctex_ltj_tmp_tl } } - \ctex_ltj_set_family:xxx { \l__ctex_ltj_tmp_tl } {#3} {#4} + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn { \l__ctex_ltj_tmp_tl } } {#3} {#4} + { } } -\NewDocumentCommand \CJKfontspec { O { } m } +\NewDocumentCommand \CJKfontspec { o m } { - \ctex_ltj_fontspec:xx {#1} {#2} - \tex_ignorespaces:D + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_fontspec:nn } {#1} {#2} + { \tex_ignorespaces:D } } \NewDocumentCommand \addCJKfontfeatures { m } { @@ -559,24 +578,31 @@ \tex_ignorespaces:D } \cs_new_eq:NN \addCJKfontfeature \addCJKfontfeatures -\NewDocumentCommand \setCJKmainfont { O { } m } +\NewDocumentCommand \setCJKmainfont { o m } { - \ctex_ltj_set_family:xxx { \CJKrmdefault } {#1} {#2} - \normalfont + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn { \CJKrmdefault } } {#1} {#2} + { \normalfont } } \cs_new_eq:NN \setCJKromanfont \setCJKmainfont -\NewDocumentCommand \setCJKsansfont { O { } m } +\NewDocumentCommand \setCJKsansfont { o m } { - \ctex_ltj_set_family:xxx { \CJKsfdefault } {#1} {#2} - \normalfont + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn { \CJKsfdefault } } {#1} {#2} + { \normalfont } } -\NewDocumentCommand \setCJKmonofont { O { } m } +\NewDocumentCommand \setCJKmonofont { o m } { - \ctex_ltj_set_family:xxx { \CJKttdefault } {#1} {#2} - \normalfont + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn { \CJKttdefault } } {#1} {#2} + { \normalfont } + } +\NewDocumentCommand \setCJKmathfont { o m } + { + \__ctex_ltj_pass_args:nnnn + { \ctex_ltj_set_family:nnn { \c__ctex_ltj_math_tl } } {#1} {#2} + { } } -\NewDocumentCommand \setCJKmathfont { O { } m } - { \ctex_ltj_set_family:xxx { \c__ctex_ltj_math_tl } {#1} {#2} } \NewDocumentCommand \defaultCJKfontfeatures { m } { \clist_gset:Nn \g__ctex_ltj_default_features_clist {#1} } \clist_new:N \g__ctex_ltj_default_features_clist |