From 8c82df0007c957004cc2268b49ccf3ceca914f58 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 14 Nov 2017 21:07:53 +0000 Subject: l3 (14nov17) git-svn-id: svn://tug.org/texlive/trunk@45802 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/l3kernel/expl3-code.tex | 192 +++++++++++++++++++-- .../tex/latex/l3kernel/expl3-generic.tex | 2 +- Master/texmf-dist/tex/latex/l3kernel/expl3.lua | 2 +- Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 2 +- Master/texmf-dist/tex/latex/l3kernel/l3doc.cls | 4 +- .../texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def | 37 +++- Master/texmf-dist/tex/latex/l3kernel/l3dvips.def | 37 +++- Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def | 37 +++- Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def | 61 ++++--- .../texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def | 37 +++- 10 files changed, 346 insertions(+), 65 deletions(-) (limited to 'Master/texmf-dist/tex/latex/l3kernel') diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index 4e9108fafe9..a4bfbf009c9 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -62,7 +62,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx Copyright (C) 1990-2017 The LaTeX3 Project -\def\ExplFileDate{2017/09/18}% +\def\ExplFileDate{2017/11/14}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -1247,6 +1247,36 @@ \tex_let:D \tex_input:D \@@input \tex_let:D \tex_italiccorrection:D \@@italiccorr \tex_let:D \tex_underline:D \@@underline + \etex_ifdefined:D \@@shipout + \tex_let:D \tex_shipout:D \@@shipout + \tex_fi:D + \tex_begingroup:D + \tex_edef:D \l_tmpa_tl { \tex_string:D \shipout } + \tex_edef:D \l_tmpb_tl { \tex_meaning:D \shipout } + \tex_ifx:D \l_tmpa_tl \l_tmpb_tl + \tex_else:D + \tex_expandafter:D \@tfor \tex_expandafter:D \@tempa \tex_string:D := + \CROP@shipout + \dup@shipout + \GPTorg@shipout + \LL@shipout + \mem@oldshipout + \opem@shipout + \pgfpages@originalshipout + \pr@shipout + \Shipout + \verso@orig@shipout + \do + { + \tex_edef:D \l_tmpb_tl + { \tex_expandafter:D \tex_meaning:D \@tempa } + \tex_ifx:D \l_tmpa_tl \l_tmpb_tl + \tex_global:D \tex_expandafter:D \tex_let:D + \tex_expandafter:D \tex_shipout:D \@tempa + \tex_fi:D + } + \tex_fi:D + \tex_endgroup:D \tex_let:D \pdftex_tracingfonts:D \tex_undefined:D \etex_ifdefined:D \pdftracingfonts \tex_let:D \pdftex_tracingfonts:D \pdftracingfonts @@ -2800,6 +2830,15 @@ \prg_new_eq_conditional:NNn \tl_if_exist:N \cs_if_exist:N { TF , T , F , p } \prg_new_eq_conditional:NNn \tl_if_exist:c \cs_if_exist:c { TF , T , F , p } \tl_const:Nn \c_empty_tl { } +\group_begin: +\tex_lccode:D `A = `- +\tex_lccode:D `N = `N +\tex_lccode:D `V = `V +\tex_lowercase:D + { + \group_end: + \tl_const:Nn \c_novalue_tl { ANoValue- } + } \tl_const:Nn \c_space_tl { ~ } \__debug_patch:nnNNpn { \__debug_chk_var_exist:N #1 } { } \cs_new_protected:Npn \tl_set:Nn #1#2 @@ -3164,6 +3203,23 @@ \cs_generate_variant:Nn \tl_if_in:nnT { V , o , no } \cs_generate_variant:Nn \tl_if_in:nnF { V , o , no } \cs_generate_variant:Nn \tl_if_in:nnTF { V , o , no } +\use:x + { + \prg_new_conditional:Npnn \exp_not:N \tl_if_novalue:n ##1 + { T , F , TF } + { + \exp_not:N \str_if_eq:onTF + { + \exp_not:N \__tl_if_novalue:w ? ##1 { } + \c_novalue_tl + } + { ? { } \c_novalue_tl } + { \exp_not:N \prg_return_true: } + { \exp_not:N \prg_return_false: } + } + \cs_new:Npn \exp_not:N \__tl_if_novalue:w ##1 \c_novalue_tl + {##1} + } \cs_new:Npn \tl_if_single_p:N { \exp_args:No \tl_if_single_p:n } \cs_new:Npn \tl_if_single:NT { \exp_args:No \tl_if_single:nT } \cs_new:Npn \tl_if_single:NF { \exp_args:No \tl_if_single:nF } @@ -3303,6 +3359,7 @@ { \exp_not:o { \use_none:nn #2 } } \cs_new:Npn \tl_trim_spaces:n #1 { \__tl_trim_spaces:nn { \q_mark #1 } \exp_not:o } +\cs_generate_variant:Nn \tl_trim_spaces:n { o } \cs_new_protected:Npn \tl_trim_spaces:N #1 { \tl_set:Nx #1 { \exp_args:No \tl_trim_spaces:n {#1} } } \cs_new_protected:Npn \tl_gtrim_spaces:N #1 @@ -3633,6 +3690,10 @@ \cs_new_eq:NN \str_gset_eq:NN \tl_gset_eq:NN \cs_generate_variant:Nn \str_set_eq:NN { c , Nc , cc } \cs_generate_variant:Nn \str_gset_eq:NN { c , Nc , cc } +\cs_new_eq:NN \str_concat:NNN \tl_concat:NNN +\cs_new_eq:NN \str_gconcat:NNN \tl_gconcat:NNN +\cs_generate_variant:Nn \str_concat:NNN { ccc } +\cs_generate_variant:Nn \str_gconcat:NNN { ccc } \group_begin: \cs_set_protected:Npn \__str_tmp:n #1 { @@ -3654,6 +3715,58 @@ { gput_right } { } \group_end: +\cs_new_protected:Npn \str_replace_once:Nnn + { \__str_replace:NNNnn \prg_do_nothing: \tl_set:Nx } +\cs_new_protected:Npn \str_greplace_once:Nnn + { \__str_replace:NNNnn \prg_do_nothing: \tl_gset:Nx } +\cs_new_protected:Npn \str_replace_all:Nnn + { \__str_replace:NNNnn \__str_replace_next:w \tl_set:Nx } +\cs_new_protected:Npn \str_greplace_all:Nnn + { \__str_replace:NNNnn \__str_replace_next:w \tl_gset:Nx } +\cs_generate_variant:Nn \str_replace_once:Nnn { c } +\cs_generate_variant:Nn \str_greplace_once:Nnn { c } +\cs_generate_variant:Nn \str_replace_all:Nnn { c } +\cs_generate_variant:Nn \str_greplace_all:Nnn { c } +\cs_new_protected:Npn \__str_replace:NNNnn #1#2#3#4#5 + { + \tl_if_empty:nTF {#4} + { + \__msg_kernel_error:nnx { kernel } { empty-search-pattern } {#5} + } + { + \use:x + { + \exp_not:n { \__str_replace_aux:NNNnnn #1 #2 #3 } + { \tl_to_str:N #3 } + { \tl_to_str:n {#4} } { \tl_to_str:n {#5} } + } + } + } +\cs_new_protected:Npn \__str_replace_aux:NNNnnn #1#2#3#4#5#6 + { + \cs_set:Npn \__str_replace_next:w ##1 #5 { ##1 #6 #1 } + #2 #3 + { + \__str_replace_next:w + #4 + \use_none_delimit_by_q_stop:w + #5 + \q_stop + } + } +\cs_new_eq:NN \__str_replace_next:w ? +\cs_new_protected:Npn \str_remove_once:Nn #1#2 + { \str_replace_once:Nnn #1 {#2} { } } +\cs_new_protected:Npn \str_gremove_once:Nn #1#2 + { \str_greplace_once:Nnn #1 {#2} { } } +\cs_generate_variant:Nn \str_remove_once:Nn { c } +\cs_generate_variant:Nn \str_gremove_once:Nn { c } +\cs_new_protected:Npn \str_remove_all:Nn #1#2 + { \str_replace_all:Nnn #1 {#2} { } } +\cs_new_protected:Npn \str_gremove_all:Nn #1#2 + { \str_greplace_all:Nnn #1 {#2} { } } +\cs_generate_variant:Nn \str_remove_all:Nn { c } +\cs_generate_variant:Nn \str_gremove_all:Nn { c } \prg_new_eq_conditional:NNn \str_if_exist:N \tl_if_exist:N { p , T , F , TF } \prg_new_eq_conditional:NNn \str_if_exist:c \tl_if_exist:c { p , T , F , TF } \prg_new_eq_conditional:NNn \str_if_empty:N \tl_if_empty:N { p , T , F , TF } @@ -3717,6 +3830,21 @@ \cs_generate_variant:Nn \str_if_eq:NNF { c , Nc , cc } \cs_generate_variant:Nn \str_if_eq:NNTF { c , Nc , cc } \cs_generate_variant:Nn \str_if_eq_p:NN { c , Nc , cc } +\prg_new_protected_conditional:Npnn \str_if_in:Nn #1#2 { T , F , TF } + { + \use:x + { \tl_if_in:nnTF { \tl_to_str:N #1 } { \tl_to_str:n {#2} } } + { \prg_return_true: } { \prg_return_false: } + } +\cs_generate_variant:Nn \str_if_in:NnT { c } +\cs_generate_variant:Nn \str_if_in:NnF { c } +\cs_generate_variant:Nn \str_if_in:NnTF { c } +\prg_new_protected_conditional:Npnn \str_if_in:nn #1#2 { T , F , TF } + { + \use:x + { \tl_if_in:nnTF { \tl_to_str:n {#1} } { \tl_to_str:n {#2} } } + { \prg_return_true: } { \prg_return_false: } + } \cs_new:Npn \str_case:nn #1#2 { \exp:w @@ -3778,6 +3906,54 @@ { \__str_case_x:nw {#1} } } \cs_new_eq:NN \__str_case_end:nw \__prg_case_end:nw +\cs_new:Npn \str_map_function:nN #1#2 + { + \exp_after:wN \__str_map_function:Nn \exp_after:wN #2 + \etex_detokenize:n {#1} + \q_recursion_tail + \__prg_break_point:Nn \str_map_break: { } + } +\cs_new:Npn \str_map_function:NN + { \exp_args:No \str_map_function:nN } +\cs_new:Npn \__str_map_function:Nn #1#2 + { + \__quark_if_recursion_tail_break:nN {#2} \str_map_break: + #1 {#2} \__str_map_function:Nn #1 + } +\cs_generate_variant:Nn \str_map_function:NN { c } +\cs_new_protected:Npn \str_map_inline:nn #1#2 + { + \int_gincr:N \g__prg_map_int + \cs_gset_protected:cpn + { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2} + \exp_args:Nc \__str_map_function:Nn + { __prg_map_ \int_use:N \g__prg_map_int :w } + #1 \q_recursion_tail + \__prg_break_point:Nn \str_map_break: { \int_gdecr:N \g__prg_map_int } + } +\cs_new_protected:Npn \str_map_inline:Nn + { \exp_args:No \str_map_inline:nn } +\cs_generate_variant:Nn \str_map_inline:Nn { c } +\cs_new_protected:Npn \str_map_variable:nNn #1#2#3 + { + \__str_map_variable:Nnn #2 {#3} #1 + \q_recursion_tail + \__prg_break_point:Nn \str_map_break: { } + } +\cs_new_protected:Npn \str_map_variable:NNn + { \exp_args:No \str_map_variable:nNn } +\cs_new_protected:Npn \__str_map_variable:Nnn #1#2#3 + { + \str_set:Nn #1 {#3} + \__quark_if_recursion_tail_break:NN #1 \str_map_break: + \use:n {#2} + \__str_map_variable:Nnn #1 {#2} + } +\cs_generate_variant:Nn \str_map_variable:NNn { c } +\cs_new:Npn \str_map_break: + { \__prg_map_break:Nn \str_map_break: { } } +\cs_new:Npn \str_map_break:n + { \__prg_map_break:Nn \str_map_break: } \cs_new:Npn \__str_to_other:n #1 { \exp_after:wN \__str_to_other_loop:w @@ -3785,7 +3961,7 @@ } \group_begin: \tex_lccode:D `\* = `\ % -\tex_lccode:D `\A = `\A +\tex_lccode:D `\A = `\A % \tex_lowercase:D { \group_end: @@ -3808,7 +3984,7 @@ } \group_begin: \tex_lccode:D `\* = `\ % -\tex_lccode:D `\A = `\A +\tex_lccode:D `\A = `\A % \tex_lowercase:D { \group_end: @@ -10691,12 +10867,7 @@ } } \cs_new:Npn \__keys_remove_spaces:n #1 - { - \exp_after:wN \__keys_remove_spaces:w \tl_to_str:n {#1} - \use_none:nn ? ~ - } -\cs_new:Npn \__keys_remove_spaces:w #1 ~ - { #1 \__keys_remove_spaces:w } + { \tl_trim_spaces:o { \tl_to_str:n {#1} } } \prg_new_conditional:Npnn \keys_if_exist:nn #1#2 { p , T , F , TF } { \cs_if_exist:cTF @@ -21659,7 +21830,8 @@ } \cs_new_protected:Npn \color_ensure_current: { - \__driver_color_ensure_current: + \__driver_color_pickup:N \l__color_current_tl + \__driver_color_select:V \l__color_current_tl \group_insert_after:N \__driver_color_reset: } \tl_new:N \l__color_current_tl diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex index a84caf1da12..7c8e09b787a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx Copyright (C) 1990-2017 The LaTeX3 Project -\def\ExplFileDate{2017/09/18}% +\def\ExplFileDate{2017/11/14}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \def\tempa{LaTeX2e}% diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.lua b/Master/texmf-dist/tex/latex/l3kernel/expl3.lua index ca496b495c9..c9b04b10d65 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.lua +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.lua @@ -57,7 +57,7 @@ l3kernel.charcat = charcat local function filemdfivesum(name) local file = kpse_find(name, "tex", true) if file then - local f = open(file, "r") + local f = open(file, "rb") if f then local data = f:read("*a") escapehex(md5_sum(data)) diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 86cc90262ad..ca4498c864a 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty @@ -19,7 +19,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx Copyright (C) 1990-2017 The LaTeX3 Project -\def\ExplFileDate{2017/09/18}% +\def\ExplFileDate{2017/11/14}% \let\ExplLoaderFileDate\ExplFileDate \ProvidesPackage{expl3} [% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls index 9040af56ff9..3b94767ca26 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls +++ b/Master/texmf-dist/tex/latex/l3kernel/l3doc.cls @@ -20,7 +20,7 @@ %% %% File: l3doc.dtx Copyright (C) 1990-2017 The LaTeX3 project \RequirePackage{expl3,xparse,calc} -\ProvidesExplClass{l3doc}{2017/09/18}{} +\ProvidesExplClass{l3doc}{2017/11/14}{} {L3 Experimental documentation class} \clist_new:N \g_docinput_clist \seq_new:N \g_doc_functions_seq @@ -678,7 +678,7 @@ { \l__codedoc_index_key_tl } { \l__codedoc_index_macro_tl } { \l__codedoc_index_module_tl } - { } + { usage } \l__codedoc_index_internal_bool } } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def index 5bfce1cc6ed..ab0a0fbc664 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def @@ -22,20 +22,45 @@ \ProvidesExplFile {l3dvidpfmx.def}{2017/03/18}{} {L3 Experimental driver: dvipdfmx} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: - { \tl_set:Nx \l__color_current_tl { \current@color } } + \cs_set_protected:Npn \__driver_color_pickup:N #1 + { + \exp_args:NV \tl_if_head_is_space:nTF \current@color + { + \tl_set:Nx #1 + { + spot ~ + \exp_after:wN \use:n \current@color \c_space_tl 1 + } + } + { \exp_after:wN \__driver_color_pickup_aux:w \current@color \q_stop #1 } + } + \cs_new_protected:Npn \__driver_color_pickup_aux:w #1 ~ #2 \q_stop #3 + { \tl_set:Nn #3 { #1 ~ #2 } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } -\cs_new_protected:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_select:n #1 { - \__driver_color_pickup: - \tex_special:D { color~push~\l__color_current_tl } + \tex_special:D + { + color~push~ + \cs_if_exist_use:cF + { __driver_color_convert_ \__driver_convert_model:w #1 \q_stop :n } + { \use:n } + {#1} + } } +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_convert_model:w #1 ~ #2 \q_stop {#1} +\cs_new:Npn \__driver_color_convert_spot:n #1 + { \__driver_color_convert_spot:w #1 \q_stop } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop + { \c_space_tl #2 } \cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } \cs_new_protected:Npn \__driver_literal:n #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def index eed9fcf2658..046edf1d5a7 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def @@ -22,20 +22,45 @@ \ProvidesExplFile {l3dvips.def}{2017/03/18}{} {L3 Experimental driver: dvips} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: - { \tl_set:Nx \l__color_current_tl { \current@color } } + \cs_set_protected:Npn \__driver_color_pickup:N #1 + { + \exp_args:NV \tl_if_head_is_space:nTF \current@color + { + \tl_set:Nx #1 + { + spot ~ + \exp_after:wN \use:n \current@color \c_space_tl 1 + } + } + { \exp_after:wN \__driver_color_pickup_aux:w \current@color \q_stop #1 } + } + \cs_new_protected:Npn \__driver_color_pickup_aux:w #1 ~ #2 \q_stop #3 + { \tl_set:Nn #3 { #1 ~ #2 } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } -\cs_new_protected:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_select:n #1 { - \__driver_color_pickup: - \tex_special:D { color~push~\l__color_current_tl } + \tex_special:D + { + color~push~ + \cs_if_exist_use:cF + { __driver_color_convert_ \__driver_convert_model:w #1 \q_stop :n } + { \use:n } + {#1} + } } +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_convert_model:w #1 ~ #2 \q_stop {#1} +\cs_new:Npn \__driver_color_convert_spot:n #1 + { \__driver_color_convert_spot:w #1 \q_stop } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop + { \c_space_tl #2 } \cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } \cs_new_protected:Npn \__driver_literal:n #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def index df5c3f262fb..c3a180544da 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def @@ -22,20 +22,45 @@ \ProvidesExplFile {l3dvisvgm.def}{2017/03/18}{} {L3 Experimental driver: dvisvgm} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: - { \tl_set:Nx \l__color_current_tl { \current@color } } + \cs_set_protected:Npn \__driver_color_pickup:N #1 + { + \exp_args:NV \tl_if_head_is_space:nTF \current@color + { + \tl_set:Nx #1 + { + spot ~ + \exp_after:wN \use:n \current@color \c_space_tl 1 + } + } + { \exp_after:wN \__driver_color_pickup_aux:w \current@color \q_stop #1 } + } + \cs_new_protected:Npn \__driver_color_pickup_aux:w #1 ~ #2 \q_stop #3 + { \tl_set:Nn #3 { #1 ~ #2 } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } -\cs_new_protected:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_select:n #1 { - \__driver_color_pickup: - \tex_special:D { color~push~\l__color_current_tl } + \tex_special:D + { + color~push~ + \cs_if_exist_use:cF + { __driver_color_convert_ \__driver_convert_model:w #1 \q_stop :n } + { \use:n } + {#1} + } } +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_convert_model:w #1 ~ #2 \q_stop {#1} +\cs_new:Npn \__driver_color_convert_spot:n #1 + { \__driver_color_convert_spot:w #1 \q_stop } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop + { \c_space_tl #2 } \cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } \cs_new_protected:Npn \__driver_literal:n #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def index 8590bc67530..981badea00d 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def @@ -22,59 +22,68 @@ \ProvidesExplFile {l3pdfmode.def}{2017/03/18}{} {L3 Experimental driver: PDF mode} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: + \cs_set_protected:Npn \__driver_color_pickup:N #1 { \exp_last_unbraced:Nx \__driver_color_pickup_aux:w - { \current@color } ~ 0 ~ 0 ~ 0 \q_stop + { \current@color } ~ 0 ~ 0 ~ 0 \q_stop #1 } - \cs_new:Npn \__driver_color_pickup_aux:w #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \q_stop + \cs_new_protected:Npn \__driver_color_pickup_aux:w + #1 ~ #2 ~ #3 ~ #4 ~ #5 ~ #6 \q_stop #7 { - \tl_set:Nx \l__color_current_tl + \str_if_eq:nnTF {#2} { g } + { \tl_set:Nn #7 { gray ~ #1 } } { - \str_if_eq:nnTF {#2} { g } - { gray ~ #1 } + \str_if_eq:nnTF {#4} { rg } + { \tl_set:Nn #7 { rgb ~ #1 ~ #2 ~ #3 } } { - \str_if_eq:nnTF {#4} { rg } - { rgb ~ #1 ~ #2 ~ #3 } - { - \str_if_eq:nnTF {#5} { k } - { cmyk ~ #1 ~ #2 ~ #3 ~ #4 } - { gray ~ #1 } - } + \str_if_eq:nnTF {#5} { k } + { \tl_set:Nn #7 { cmyk ~ #1 ~ #2 ~ #3 ~ #4 } } + { + \str_if_eq:nnTF {#2} { cs } + { + \tl_set:Nx #7 { spot ~ \use_none:n #1 ~ #5 } + } + { + \tl_set:Nn #7 { gray ~ 0 } + } + } } } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } \int_new:N \l__driver_color_stack_int -\cs_new_protected:Npx \__driver_color_ensure_current: +\cs_new_protected:Npx \__driver_color_select:n #1 { - \exp_not:N \__driver_color_pickup: \cs_if_exist:NTF \luatex_pdfextension:D { \luatex_pdfextension:D colorstack } { \pdftex_pdfcolorstack:D } \exp_not:N \l__driver_color_stack_int push { - \exp_not:N \exp_after:wN \exp_not:N \__driver_color_convert:w - \exp_not:N \l__color_current_tl - \c_space_tl 0 ~ 0 ~ 0 + #1 \exp_not:N \q_stop } } -\cs_new:Npn \__driver_color_convert:w #1 ~ - { \use:c { __driver_color_convert_ #1 :w } } -\cs_new:Npn \__driver_color_convert_gray:w #1 ~ #2 \q_stop +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_color_convert:w #1 ~ #2 \q_stop + { \use:c { __driver_color_convert_ #1 :w } #2 \q_stop } +\cs_new:Npn \__driver_color_convert_gray:w #1 \q_stop { #1 ~ g ~ #1 ~ G } -\cs_new:Npn \__driver_color_convert_cmyk:w #1 ~ #2 ~ #3 ~ #4 ~#5 \q_stop - { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } -\cs_new:Npn \__driver_color_convert_rgb:w #1 ~ #2 ~ #3 ~ #4 \q_stop - { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } +\cs_new:Npn \__driver_color_convert_cmyk:w #1 \q_stop + { #1 ~ k ~ #1 ~ K } +\cs_new:Npn \__driver_color_convert_rgb:w #1 \q_stop + { #1 ~ rg ~ #1 ~ RG } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 \q_stop + { + /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC + } \cs_new_protected:Npx \__driver_color_reset: { \cs_if_exist:NTF \luatex_pdfextension:D diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def index 31bd085b8b1..228038f2c43 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def @@ -22,20 +22,45 @@ \ProvidesExplFile {l3xdvidpfmx.def}{2017/03/18}{} {L3 Experimental driver: xdvipdfmx} +\cs_new_protected:Npn \__driver_color_pickup:N #1 { } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_new_protected:Npn \__driver_color_pickup: - { \tl_set:Nx \l__color_current_tl { \current@color } } + \cs_set_protected:Npn \__driver_color_pickup:N #1 + { + \exp_args:NV \tl_if_head_is_space:nTF \current@color + { + \tl_set:Nx #1 + { + spot ~ + \exp_after:wN \use:n \current@color \c_space_tl 1 + } + } + { \exp_after:wN \__driver_color_pickup_aux:w \current@color \q_stop #1 } + } + \cs_new_protected:Npn \__driver_color_pickup_aux:w #1 ~ #2 \q_stop #3 + { \tl_set:Nn #3 { #1 ~ #2 } } } - { \cs_new_protected:Npn \__driver_color_pickup: { } } + { } } -\cs_new_protected:Npn \__driver_color_ensure_current: +\cs_new_protected:Npn \__driver_color_select:n #1 { - \__driver_color_pickup: - \tex_special:D { color~push~\l__color_current_tl } + \tex_special:D + { + color~push~ + \cs_if_exist_use:cF + { __driver_color_convert_ \__driver_convert_model:w #1 \q_stop :n } + { \use:n } + {#1} + } } +\cs_generate_variant:Nn \__driver_color_select:n { V } +\cs_new:Npn \__driver_convert_model:w #1 ~ #2 \q_stop {#1} +\cs_new:Npn \__driver_color_convert_spot:n #1 + { \__driver_color_convert_spot:w #1 \q_stop } +\cs_new:Npn \__driver_color_convert_spot:w #1 ~ #2 ~ #3 \q_stop + { \c_space_tl #2 } \cs_new_protected:Npn \__driver_color_reset: { \tex_special:D { color~pop } } \cs_new_protected:Npn \__driver_literal:n #1 -- cgit v1.2.3