summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-10-19 21:12:08 +0000
committerKarl Berry <karl@freefriends.org>2020-10-19 21:12:08 +0000
commit7739a3e6e0ed5a2798a9d43a732cd87d29b6c079 (patch)
treeb5dd64be717e640180eca699afed7d489c36de45 /Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
parent491012922a13d8238adcfe81ceefe4d9852a6a2a (diff)
xecjk (19oct20)
git-svn-id: svn://tug.org/texlive/trunk@56711 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty72
1 files changed, 44 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
index 6bb521e33d4..25623ab698d 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 6405ee1 2020-08-23 21:58:40 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx f475abb 2020-10-19 20:24:03 +0800 Qing Lee <sobenlee@gmail.com> $
{Typesetting CJK scripts with XeLaTeX}
\ProvidesExplPackage{\ExplFileName}
- {\ExplFileDate}{3.8.5}{\ExplFileDescription}
+ {\ExplFileDate}{3.8.6}{\ExplFileDescription}
\msg_new:nnn { xeCJK } { Require-XeTeX }
{
The~xeCJK~package~requires~XeTeX~to~function.\\\\
@@ -1614,7 +1614,13 @@
\int_compare:nNnTF \tex_lastnodetype:D = { 11 }
{ \__xeCJK_if_last_punct_glue:TF { \use_i:nn } }
{ \use:n }
- { \tex_penalty:D \l__xeCJK_last_penalty_int \use_ii:nn }
+ { \__xeCJK_last_punct_penalty_false:nn }
+ }
+\cs_new_protected:Npn \__xeCJK_last_punct_penalty_false:nn #1#2
+ {
+ \bool_set_false:N \l__xeCJK_last_penalty_bool
+ \tex_penalty:D \l__xeCJK_last_penalty_int
+ #2
}
\cs_new_protected:Npn \__xeCJK_if_last_punct_auxi:TF
{
@@ -4626,39 +4632,49 @@
\__xeCJK_math_robust:N \endmath
}
\__xeCJK_math_robust:N \ensuremath
-\cs_if_exist:NTF \@rmfamilyhook
+\@ifl@t@r \fmtversion { 2020/10/01 }
{
\cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:x
- \g@addto@macro \@rmfamilyhook { \xeCJK@family { \CJKrmdefault } }
- \g@addto@macro \@sffamilyhook { \xeCJK@family { \CJKsfdefault } }
- \g@addto@macro \@ttfamilyhook { \xeCJK@family { \CJKttdefault } }
- \exp_args:Nc \g@addto@macro
- {
- \cs_if_exist:NTF \@defaultfamilyhook
- { @defaultfamilyhook } { normalfont ~ }
- }
- { \xeCJK@family { \CJKfamilydefault } }
+ \AddToHook { rmfamily } { \xeCJK@family { \CJKrmdefault } }
+ \AddToHook { sffamily } { \xeCJK@family { \CJKsfdefault } }
+ \AddToHook { ttfamily } { \xeCJK@family { \CJKttdefault } }
+ \AddToHook { normalfont } { \xeCJK@family { \CJKfamilydefault } }
}
{
- \RenewDocumentCommand \fontfamily { m }
- {
- \tl_set:Nx \f@family {#1}
- \xeCJK@fontfamily {#1}
- }
- \cs_new_protected:Npn \xeCJK@fontfamily #1
+ \cs_if_exist:NTF \@rmfamilyhook
{
- \str_if_eq:nnTF {#1} { \familydefault }
- { \xeCJK_switch_family:x { \CJKfamilydefault } }
- { \__xeCJK_update_family_aux: }
+ \cs_set_eq:NN \xeCJK@family \xeCJK_switch_family:x
+ \g@addto@macro \@rmfamilyhook { \xeCJK@family { \CJKrmdefault } }
+ \g@addto@macro \@sffamilyhook { \xeCJK@family { \CJKsfdefault } }
+ \g@addto@macro \@ttfamilyhook { \xeCJK@family { \CJKttdefault } }
+ \exp_args:Nc \g@addto@macro
+ {
+ \cs_if_exist:NTF \@defaultfamilyhook
+ { @defaultfamilyhook } { normalfont ~ }
+ }
+ { \xeCJK@family { \CJKfamilydefault } }
}
- \cs_new_protected:Npn \__xeCJK_update_family_aux:
{
- \str_case_e:nn { \f@family }
+ \RenewDocumentCommand \fontfamily { m }
+ {
+ \tl_set:Nx \f@family {#1}
+ \xeCJK@fontfamily {#1}
+ }
+ \cs_new_protected:Npn \xeCJK@fontfamily #1
+ {
+ \str_if_eq:nnTF {#1} { \familydefault }
+ { \xeCJK_switch_family:x { \CJKfamilydefault } }
+ { \__xeCJK_update_family_aux: }
+ }
+ \cs_new_protected:Npn \__xeCJK_update_family_aux:
{
- { \rmdefault } { \xeCJK_switch_family:x { \CJKrmdefault } }
- { \sfdefault } { \xeCJK_switch_family:x { \CJKsfdefault } }
- { \ttdefault } { \xeCJK_switch_family:x { \CJKttdefault } }
- { \familydefault } { \xeCJK_switch_family:x { \CJKfamilydefault } }
+ \str_case_e:nn { \f@family }
+ {
+ { \rmdefault } { \xeCJK_switch_family:x { \CJKrmdefault } }
+ { \sfdefault } { \xeCJK_switch_family:x { \CJKsfdefault } }
+ { \ttdefault } { \xeCJK_switch_family:x { \CJKttdefault } }
+ { \familydefault } { \xeCJK_switch_family:x { \CJKfamilydefault } }
+ }
}
}
}