diff options
author | Karl Berry <karl@freefriends.org> | 2019-05-09 21:21:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-05-09 21:21:40 +0000 |
commit | 6b8660f398522ec8c9225f4743bf35d7ead3fdbb (patch) | |
tree | 2d739ca19f398762c708fde206952877d04b1d9f /Master/texmf-dist/tex | |
parent | 85d267d6035b359acbbc8620e9f215658e2ef473 (diff) |
l3kernel (9may19)
git-svn-id: svn://tug.org/texlive/trunk@51060 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex | 26 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/expl3.sty | 2 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def | 120 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvips.def | 30 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def | 33 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def | 98 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def | 177 |
8 files changed, 271 insertions, 217 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex index 0bd3c4c3f10..cd2f1013847 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex +++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex @@ -64,7 +64,7 @@ %% and all files in that bundle must be distributed together. %% %% File: expl3.dtx -\def\ExplFileDate{2019-05-07}% +\def\ExplFileDate{2019-05-09}% \begingroup \def\next{\endgroup}% \expandafter\ifx\csname PackageError\endcsname\relax @@ -11036,7 +11036,7 @@ \prg_return_false: } { - \exp_args:NV \file_parse_full_name:nNNN \l__file_full_name_tl + \file_parse_full_name:VNNN \l__file_full_name_tl \l__file_dir_str \l__file_name_str \l__file_ext_str \str_if_empty:NT \l__file_ext_str { @@ -11210,6 +11210,7 @@ \exp_after:wN \__file_parse_full_name_auxi:w \tl_to_str:n { #1 " #1 " } \q_stop #2#3#4 } +\cs_generate_variant:Nn \file_parse_full_name:nNNN { V } \cs_new_protected:Npn \__file_parse_full_name_auxi:w #1 " #2 " #3 \q_stop #4#5#6 { @@ -26453,6 +26454,27 @@ { \iow_shipout:Nn \c__sys_shell_stream_int {#1} } } \cs_generate_variant:Nn \sys_shell_shipout:n { x } +\cs_new_protected:Npn \ior_shell_open:Nn #1#2 + { + \sys_if_shell:TF + { \exp_args:No \__ior_shell_open:nN { \tl_to_str:n {#2} } #1 } + { \__kernel_msg_error:nn { kernel } { pipe-failed } } + } +\cs_new_protected:Npn \__ior_shell_open:nN #1#2 + { + \tl_if_in:nnTF {#1} { " } + { + \__kernel_msg_error:nnx + { kernel } { quote-in-shell } {#1} + } + { \__kernel_ior_open:Nn #2 { "|#1" } } + } +\__kernel_msg_new:nnnn { kernel } { pipe-failed } + { Cannot~run~piped~system~commands. } + { + LaTeX~tried~to~call~a~system~process~but~this~was~not~possible.\\ + Try~the~"--shell-escape"~(or~"--enable-pipes")~option. + } \cs_new:Npn \char_lower_case:N #1 { \__char_change_case:nNN { lower } \char_value_lccode:n #1 } \cs_new:Npn \char_upper_case:N #1 diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-generic.tex index a9a82d7acf7..6d8a56abcaa 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 -\def\ExplFileDate{2019-05-07}% +\def\ExplFileDate{2019-05-09}% \let\ExplLoaderFileDate\ExplFileDate \begingroup \def\tempa{LaTeX2e}% diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3.sty b/Master/texmf-dist/tex/latex/l3kernel/expl3.sty index 677f47de59d..b8aaca40a4c 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 -\def\ExplFileDate{2019-05-07}% +\def\ExplFileDate{2019-05-09}% \let\ExplLoaderFileDate\ExplFileDate \ProvidesPackage{expl3} [% diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def index bed26918ee0..3bdc8505acb 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def @@ -9,7 +9,7 @@ %% l3drivers-color.dtx (with options: `package,dvipdfmx') %% l3drivers-box.dtx (with options: `package,dvipdfmx') %% l3drivers-draw.dtx (with options: `package,dvipdfmx') -%% l3drivers-image.dtx (with options: `package,dvipdfmx') +%% l3drivers-graphics.dtx (with options: `package,dvipdfmx') %% l3drivers-pdf.dtx (with options: `package,dvipdfmx') %% %% Copyright (C) 1990-2019 The LaTeX3 Project @@ -33,6 +33,7 @@ \cs_new_protected:Npn \__driver_literal:n #1 { \__driver_literal:e { \exp_not:n {#1} } } \cs_generate_variant:Nn \__driver_literal:n { x } +\box_new:N \l__driver_internal_box \cs_new_protected:Npn \__driver_literal_pdf:n #1 { \__driver_literal:n { pdf:literal~ #1 } } \cs_generate_variant:Nn \__driver_literal_pdf:n { x } @@ -351,91 +352,98 @@ \__driver_literal:n { pdf:etrans } \__driver_scope_end: } -%% File: l3drivers-image.dtx -\cs_new_eq:NN \__driver_image_getbb_eps:n \image_read_bb:n -\cs_new_protected:Npn \__driver_image_getbb_jpg:n #1 +%% File: l3drivers-graphics.dtx +\AtBeginDocument + { \cs_new_eq:NN \driver_graphics_getbb_eps:n \graphics_read_bb:n } +\cs_new_protected:Npn \driver_graphics_getbb_jpg:n #1 { - \int_zero:N \l_image_page_int - \tl_clear:N \l_image_pagebox_tl - \image_extract_bb:n {#1} + \int_zero:N \l_graphics_page_int + \tl_clear:N \l_graphics_pagebox_tl + \graphics_extract_bb:n {#1} } -\cs_new_eq:NN \__driver_image_getbb_png:n \__driver_image_getbb_jpg:n -\cs_new_protected:Npn \__driver_image_getbb_pdf:n #1 +\cs_new_eq:NN \driver_graphics_getbb_png:n \driver_graphics_getbb_jpg:n +\cs_new_protected:Npn \driver_graphics_getbb_pdf:n #1 { - \tl_clear:N \l_image_decode_tl - \bool_set_false:N \l_image_interpolate_bool - \image_extract_bb:n {#1} + \tl_clear:N \l_graphics_decodearray_tl + \bool_set_false:N \l_graphics_interpolate_bool + \graphics_extract_bb:n {#1} } -\int_new:N \g__driver_image_int -\cs_new_protected:Npn \__driver_image_include_eps:n #1 +\int_new:N \g__driver_graphics_int +\cs_new_protected:Npn \driver_graphics_include_eps:n #1 { - \__driver_literal:n { PSfile = #1 } + \__driver_literal:x + { + PSfile = #1 \c_space_tl + llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl + lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl + urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl + ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim + } } -\cs_new_protected:Npn \__driver_image_include_jpg:n #1 - { \__driver_image_include_auxi:nn {#1} { image } } -\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n -\cs_new_protected:Npn \__driver_image_include_pdf:n #1 - { \__driver_image_include_auxi:nn {#1} { epdf } } -\cs_new_protected:Npn \__driver_image_include_auxi:nn #1#2 +\cs_new_protected:Npn \driver_graphics_include_jpg:n #1 + { \__driver_graphics_include_auxi:nn {#1} { image } } +\cs_new_eq:NN \driver_graphics_include_png:n \driver_graphics_include_jpg:n +\cs_new_protected:Npn \driver_graphics_include_pdf:n #1 + { \__driver_graphics_include_auxi:nn {#1} { epdf } } +\cs_new_protected:Npn \__driver_graphics_include_auxi:nn #1#2 { - \__driver_image_include_auxii:xnn + \__driver_graphics_include_auxii:xnn { - \tl_if_empty:NF \l_image_pagebox_tl - { : \l_image_pagebox_tl } - \int_compare:nNnT \l_image_page_int > 1 - { :P \int_use:N \l_image_page_int } - \tl_if_empty:NF \l_image_decode_tl - { :D \l_image_decodearray_tl } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_pagebox_tl + { : \l_graphics_pagebox_tl } + \int_compare:nNnT \l_graphics_page_int > 1 + { :P \int_use:N \l_graphics_page_int } + \tl_if_empty:NF \l_graphics_decodearray_tl + { :D \l_graphics_decodearray_tl } + \bool_if:NT \l_graphics_interpolate_bool { :I } } {#1} {#2} } -\cs_new_protected:Npn \__driver_image_include_auxii:nnn #1#2#3 +\cs_new_protected:Npn \__driver_graphics_include_auxii:nnn #1#2#3 { - \int_if_exist:cTF { c__driver_image_ #2#1 _int } + \int_if_exist:cTF { c__driver_graphics_ #2#1 _int } { \__driver_literal:x - { pdf:usexobj~@image \int_use:c { c__driver_image_ #2#1 _int } } + { pdf:usexobj~@image \int_use:c { c__driver_graphics_ #2#1 _int } } } - { \__driver_image_include_auxiii:nn {#2} {#1} {#3} } + { \__driver_graphics_include_auxiii:nnn {#2} {#1} {#3} } } -\cs_generate_variant:Nn \__driver_image_include_auxii:nnn { x } -\cs_new_protected:Npn \__driver_image_include_auxiii:nnn #1#2#3 +\cs_generate_variant:Nn \__driver_graphics_include_auxii:nnn { x } +\cs_new_protected:Npn \__driver_graphics_include_auxiii:nnn #1#2#3 { - \int_gincr:N \g__driver_image_int - \int_const:cn { c__driver_image_ #1#2 _int } { \g__driver_image_int } + \int_gincr:N \g__driver_graphics_int + \int_const:cn { c__driver_graphics_ #1#2 _int } { \g__driver_graphics_int } \__driver_literal:x { pdf:#3~ - @image \int_use:c { c__driver_image_ #1#2 _int } - \int_compare:nNnT \l_image_page_int > 1 - { page ~ \int_use:N \l_image_page_int \c_space_tl } - \tl_if_empty:NF \l_image_pagebox_tl + @image \int_use:c { c__driver_graphics_ #1#2 _int } ~ + \int_compare:nNnT \l_graphics_page_int > 1 + { page ~ \int_use:N \l_graphics_page_int \c_space_tl } + \tl_if_empty:NF \l_graphics_pagebox_tl { - pagebox ~ \l_image_pagebox_tl \c_space_tl + pagebox ~ \l_graphics_pagebox_tl \c_space_tl bbox ~ - \dim_to_decimal_in_bp:n \l_image_llx_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_lly_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_urx_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_ury_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_ury_dim \c_space_tl } (#1) \bool_lazy_or:nnT - { \l_image_interpolate_bool } - { ! \tl_if_empty_p:N \l_image_decodearray_tl } + { \l_graphics_interpolate_bool } + { ! \tl_if_empty_p:N \l_graphics_decodearray_tl } { << - \tl_if_empty:NF \l_image_decode_tl - { /Decode~[ \l_image_decodearray_tl ] } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_decodearray_tl + { /Decode~[ \l_graphics_decodearray_tl ] } + \bool_if:NT \l_graphics_interpolate_bool { /Interpolate~true> } >> } } } %% File: l3drivers-pdf.dtx -\box_new:N \l__driver_pdf_tmp_box \cs_new_protected:Npx \__driver_pdf:n #1 { \__driver_literal:n { pdf: #1 } } \cs_generate_variant:Nn \__driver_pdf:n { x } @@ -575,8 +583,8 @@ \cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2 { \group_begin: - \hbox_set:Nn \l__driver_pdf_tmp_box {#2} - \box_move_down:nn { \box_dp:N \l__driver_pdf_tmp_box } + \hbox_set:Nn \l__driver_internal_box {#2} + \box_move_down:nn { \box_dp:N \l__driver_internal_box } { \hbox:n { @@ -584,8 +592,8 @@ \__driver_pdf:n { obj ~ @driver_#1_lly ~ @ypos } } } - \box_use:N \l__driver_pdf_tmp_box - \box_move_up:nn { \box_ht:N \l__driver_pdf_tmp_box } + \box_use:N \l__driver_internal_box + \box_move_up:nn { \box_ht:N \l__driver_internal_box } { \hbox:n { diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def index ad9d6d9adca..23675e1c0a1 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvips.def @@ -9,7 +9,7 @@ %% l3drivers-color.dtx (with options: `package,dvips') %% l3drivers-box.dtx (with options: `package,dvips') %% l3drivers-draw.dtx (with options: `package,dvips') -%% l3drivers-image.dtx (with options: `package,dvips') +%% l3drivers-graphics.dtx (with options: `package,dvips') %% l3drivers-pdf.dtx (with options: `package,dvips') %% %% Copyright (C) 1990-2019 The LaTeX3 Project @@ -33,6 +33,7 @@ \cs_new_protected:Npn \__driver_literal:n #1 { \__driver_literal:e { \exp_not:n {#1} } } \cs_generate_variant:Nn \__driver_literal:n { x } +\box_new:N \l__driver_internal_box \cs_new_protected:Npn \__driver_literal_postscript:n #1 { \__driver_literal:n { ps:: #1 } } \cs_generate_variant:Nn \__driver_literal_postscript:n { x } @@ -411,12 +412,21 @@ \__driver_draw_literal:n { [begin] } \__driver_draw_literal:n { @beginspecial } } -%% File: l3drivers-image.dtx -\cs_new_eq:NN \__driver_image_getbb_eps:n \image_read_bb:n -\cs_new_protected:Npn \__driver_image_include_eps:n #1 - { \__driver_literal:n { PSfile = #1 } } +%% File: l3drivers-graphics.dtx +\AtBeginDocument + { \cs_new_eq:NN \driver_graphics_getbb_eps:n \graphics_read_bb:n } +\cs_new_protected:Npn \driver_graphics_include_eps:n #1 + { + \__driver_literal:x + { + PSfile = #1 \c_space_tl + llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl + lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl + urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl + ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim + } + } %% File: l3drivers-pdf.dtx -\box_new:N \l__driver_pdf_tmp_box \cs_new_protected:Npn \__driver_pdfmark:n #1 { \__driver_postscript:n { mark #1 ~ pdfmark } } \cs_generate_variant:Nn \__driver_pdfmark:n { x } @@ -1139,13 +1149,13 @@ \cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2 { \group_begin: - \hbox_set:Nn \l__driver_pdf_tmp_box {#2} + \hbox_set:Nn \l__driver_internal_box {#2} \box_move_down:nn - { \box_dp:N \l__driver_pdf_tmp_box } + { \box_dp:N \l__driver_internal_box } { \hbox:n { \__driver_postscript:n { driver.save.ll } } } - \box_use:N \l__driver_pdf_tmp_box + \box_use:N \l__driver_internal_box \box_move_up:nn - { \box_ht:N \l__driver_pdf_tmp_box } + { \box_ht:N \l__driver_internal_box } { \hbox:n { \__driver_postscript:n { driver.save.ur } } } \__driver_pdfmark:n { diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def index fc22d5d3a8d..fb15c593f01 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def @@ -9,7 +9,7 @@ %% l3drivers-color.dtx (with options: `package,dvisvgm') %% l3drivers-box.dtx (with options: `package,dvisvgm') %% l3drivers-draw.dtx (with options: `package,dvisvgm') -%% l3drivers-image.dtx (with options: `package,dvisvgm') +%% l3drivers-graphics.dtx (with options: `package,dvisvgm') %% l3drivers-pdf.dtx (with options: `package,dvisvgm') %% %% Copyright (C) 1990-2019 The LaTeX3 Project @@ -33,6 +33,7 @@ \cs_new_protected:Npn \__driver_literal:n #1 { \__driver_literal:e { \exp_not:n {#1} } } \cs_generate_variant:Nn \__driver_literal:n { x } +\box_new:N \l__driver_internal_box \cs_new_protected:Npn \__driver_literal_svg:n #1 { \__driver_literal:n { dvisvgm:raw~ #1 { ?nl } } } \cs_generate_variant:Nn \__driver_literal_svg:n { x } @@ -369,7 +370,7 @@ { \__driver_draw_scope:n { stroke-linejoin="round" } } \cs_new_protected:Npn \driver_draw_join_bevel: { \__driver_draw_scope:n { stroke-linejoin="bevel" } } -\cs_new_protected:Npn \driver_draw_color_stroke_cmyk:nnnn #1#2#3#4 +\cs_new_protected:Npn \driver_draw_color_fill_cmyk:nnnn #1#2#3#4 { \use:x { @@ -380,18 +381,18 @@ } } \cs_new_eq:NN \driver_draw_color_stroke_cmyk:nnnn \driver_color_cmyk:nnnn -\cs_new_protected:Npn \driver_draw_color_gray:n #1 +\cs_new_protected:Npn \driver_draw_color_fill_gray:n #1 { \use:x { \__driver_draw_color_gray_aux:n - { \fp_eval:n { 100 * (#3) } } + { \fp_eval:n { 100 * (#1) } } } } \cs_new_protected:Npn \__driver_draw_color_gray_aux:n #1 { \__driver_draw_color_fill:nnn {#1} {#1} {#1} } \cs_new_eq:NN \driver_draw_color_stroke_gray:n \driver_color_gray:n -\cs_new_protected:Npn \driver_draw_color_rgb:nnn #1#2#3 +\cs_new_protected:Npn \driver_draw_color_fill_rgb:nnn #1#2#3 { \use:x { @@ -450,24 +451,26 @@ \__driver_literal_svg:n { </g> } \__driver_scope_end: } -%% File: l3drivers-image.dtx -\cs_new_eq:NN \__driver_image_getbb_png:n \image_extract_bb:n -\cs_new_eq:NN \__driver_image_getbb_jpg:n \image_extract_bb:n -\cs_new_protected:Npn \__driver_image_include_png:n #1 +%% File: l3drivers-graphics.dtx +\AtBeginDocument + { + \cs_new_eq:NN \driver_graphics_getbb_png:n \graphics_extract_bb:n + \cs_new_eq:NN \driver_graphics_getbb_jpg:n \graphics_extract_bb:n + } +\cs_new_protected:Npn \driver_graphics_include_png:n #1 { \__driver_literal:x { dvisvgm:img~ - \dim_to_decimal:n { \l_image_ury_dim } ~ - \dim_to_decimal:n { \l_image_ury_dim } ~ - \__driver_image_include_bitmap_quote:w #1 " #1 " \q_stop + \dim_to_decimal:n { \l_graphics_ury_dim } ~ + \dim_to_decimal:n { \l_graphics_ury_dim } ~ + \__driver_graphics_include_bitmap_quote:w #1 " #1 " \q_stop } } -\cs_new_eq:NN \__driver_image_include_jpg:n \__driver_image_include_png:n -\cs_new:Npn \__driver_image_include_bitmap_quote:w #1 " #2 " #3 \q_stop +\cs_new_eq:NN \driver_graphics_include_jpg:n \driver_graphics_include_png:n +\cs_new:Npn \__driver_graphics_include_bitmap_quote:w #1 " #2 " #3 \q_stop { " #2 " } %% File: l3drivers-pdf.dtx -\box_new:N \l__driver_pdf_tmp_box \cs_new_protected:Npn \driver_pdf_catalog_gput:nn #1#2 { } \cs_new_protected:Npn \driver_pdf_info_gput:nn #1#2 { } \cs_new_protected:Npn \driver_pdf_object_new:nn #1#2 { } diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def index 1ebc92eb4bb..25c63471e8f 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def @@ -9,7 +9,7 @@ %% l3drivers-color.dtx (with options: `package,pdfmode') %% l3drivers-box.dtx (with options: `package,pdfmode') %% l3drivers-draw.dtx (with options: `package,pdfmode') -%% l3drivers-image.dtx (with options: `package,pdfmode') +%% l3drivers-graphics.dtx (with options: `package,pdfmode') %% l3drivers-pdf.dtx (with options: `package,pdfmode') %% %% Copyright (C) 1990-2019 The LaTeX3 Project @@ -33,6 +33,7 @@ \cs_new_protected:Npn \__driver_literal:n #1 { \__driver_literal:e { \exp_not:n {#1} } } \cs_generate_variant:Nn \__driver_literal:n { x } +\box_new:N \l__driver_internal_box \cs_new_protected:Npx \__driver_literal_pdf:n #1 { \cs_if_exist:NTF \tex_pdfextension:D @@ -352,77 +353,76 @@ \hbox_overlap_right:n { \box_use:N #1 } \__driver_scope_end: } -%% File: l3drivers-image.dtx -\tl_new:N \l__driver_image_attr_tl -\cs_new_protected:Npn \__driver_image_getbb_jpg:n #1 +%% File: l3drivers-graphics.dtx +\tl_new:N \l__driver_graphics_attr_tl +\cs_new_protected:Npn \driver_graphics_getbb_jpg:n #1 { - \int_zero:N \l_image_page_int - \tl_clear:N \l_image_pagebox_tl - \tl_set:Nx \l__driver_image_attr_tl + \int_zero:N \l_graphics_page_int + \tl_clear:N \l_graphics_pagebox_tl + \tl_set:Nx \l__driver_graphics_attr_tl { - \tl_if_empty:NF \l_image_decode_tl - { :D \l_image_decodearray_tl } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_decodearray_tl + { :D \l_graphics_decodearray_tl } + \bool_if:NT \l_graphics_interpolate_bool { :I } } - \tl_clear:N \l__driver_image_attr_tl - \__driver_image_getbb_auxi:n {#1} + \tl_clear:N \l__driver_graphics_attr_tl + \__driver_graphics_getbb_auxi:n {#1} } -\cs_new_eq:NN \__driver_image_getbb_png:n \__driver_image_getbb_jpg:n -\cs_new_protected:Npn \__driver_image_getbb_pdf:n #1 +\cs_new_eq:NN \driver_graphics_getbb_png:n \driver_graphics_getbb_jpg:n +\cs_new_protected:Npn \driver_graphics_getbb_pdf:n #1 { - \tl_clear:N \l_image_decode_tl - \bool_set_false:N \l_image_interpolate_bool - \tl_set:Nx \l__driver_image_attr_tl + \tl_clear:N \l_graphics_decodearray_tl + \bool_set_false:N \l_graphics_interpolate_bool + \tl_set:Nx \l__driver_graphics_attr_tl { - : \l_image_pagebox_tl - \int_compare:nNnT \l_image_page_int > 1 - { :P \int_use:N \l_image_page_int } + : \l_graphics_pagebox_tl + \int_compare:nNnT \l_graphics_page_int > 1 + { :P \int_use:N \l_graphics_page_int } } - \__driver_image_getbb_auxi:n {#1} + \__driver_graphics_getbb_auxi:n {#1} } -\cs_new_protected:Npn \__driver_image_getbb_auxi:n #1 +\cs_new_protected:Npn \__driver_graphics_getbb_auxi:n #1 { - \image_bb_restore:xF { #1 \l__driver_image_attr_tl } - { \__driver_image_getbb_auxii:n {#1} } + \graphics_bb_restore:xF { #1 \l__driver_graphics_attr_tl } + { \__driver_graphics_getbb_auxii:n {#1} } } -\cs_new_protected:Npn \__driver_image_getbb_auxii:n #1 +\cs_new_protected:Npn \__driver_graphics_getbb_auxii:n #1 { \tex_immediate:D \tex_pdfximage:D \bool_lazy_or:nnT - { \l_image_interpolate_bool } - { ! \tl_if_empty_p:N \l_image_decodearray_tl } + { \l_graphics_interpolate_bool } + { ! \tl_if_empty_p:N \l_graphics_decodearray_tl } { attr ~ { - \tl_if_empty:NF \l_image_decode_tl - { /Decode~[ \l_image_decodearray_tl ] } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_decodearray_tl + { /Decode~[ \l_graphics_decodearray_tl ] } + \bool_if:NT \l_graphics_interpolate_bool { /Interpolate~true } } } - \int_compare:nNnT \l_image_page_int > 0 - { page ~ \int_use:N \l_image_page_int } - \tl_if_empty:NF \l_image_pagebox_tl - { \l_image_pagebox_tl } + \int_compare:nNnT \l_graphics_page_int > 0 + { page ~ \int_use:N \l_graphics_page_int } + \tl_if_empty:NF \l_graphics_pagebox_tl + { \l_graphics_pagebox_tl } {#1} - \hbox_set:Nn \l__driver_tmp_box + \hbox_set:Nn \l__driver_internal_box { \tex_pdfrefximage:D \tex_pdflastximage:D } - \dim_set:Nn \l_image_urx_dim { \box_wd:N \l__driver_tmp_box } - \dim_set:Nn \l_image_ury_dim { \box_ht:N \l__driver_tmp_box } - \int_const:cn { c__driver_image_ #1 \l__driver_image_attr_tl _int } + \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l__driver_internal_box } + \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l__driver_internal_box } + \int_const:cn { c__driver_graphics_ #1 \l__driver_graphics_attr_tl _int } { \tex_the:D \tex_pdflastximage:D } - \image_bb_save:x { #1 \l__driver_image_attr_tl } + \graphics_bb_save:x { #1 \l__driver_graphics_attr_tl } } -\cs_new_protected:Npn \__driver_image_include_jpg:n #1 +\cs_new_protected:Npn \driver_graphics_include_jpg:n #1 { \tex_pdfrefximage:D - \int_use:c { c__driver_image_ #1 \l__driver_image_attr_tl _int } + \int_use:c { c__driver_graphics_ #1 \l__driver_graphics_attr_tl _int } } -\cs_new_eq:NN \__driver_image_include_pdf:n \__driver_image_include_jpg:n -\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n +\cs_new_eq:NN \driver_graphics_include_pdf:n \driver_graphics_include_jpg:n +\cs_new_eq:NN \driver_graphics_include_png:n \driver_graphics_include_jpg:n %% File: l3drivers-pdf.dtx -\box_new:N \l__driver_pdf_tmp_box \cs_new_protected:Npx \driver_pdf_annotation:nnnn #1#2#3#4 { \cs_if_exist:NTF \tex_pdfextension:D @@ -496,16 +496,16 @@ \cs_new_protected:Npx \driver_pdf_destination_rectangle:nn #1#2 { \group_begin: - \hbox_set:Nn \l__driver_pdf_tmp_box {#2} + \hbox_set:Nn \l__driver_internal_box {#2} \cs_if_exist:NTF \tex_pdfextension:D { \exp_not:N \tex_pdfextension:D dest ~ } { \exp_not:N \tex_pdfdest:D } name {#1} fitr ~ - width \exp_not:N \box_wd:N \l__driver_pdf_tmp_box - height \exp_not:N \box_ht:N \l__driver_pdf_tmp_box - depth \exp_not:N \box_dp:N \l__driver_pdf_tmp_box - \box_use:N \l__driver_pdf_tmp_box + width \exp_not:N \box_wd:N \l__driver_internal_box + height \exp_not:N \box_ht:N \l__driver_internal_box + depth \exp_not:N \box_dp:N \l__driver_internal_box + \box_use:N \l__driver_internal_box \group_end: } \cs_new_protected:Npx \driver_pdf_catalog_gput:nn #1#2 diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def index 7fc986ec327..111087f7509 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def @@ -9,7 +9,7 @@ %% l3drivers-color.dtx (with options: `package,xdvipdfmx') %% l3drivers-box.dtx (with options: `package,xdvipdfmx') %% l3drivers-draw.dtx (with options: `package,xdvipdfmx') -%% l3drivers-image.dtx (with options: `package,xdvipdfmx') +%% l3drivers-graphics.dtx (with options: `package,xdvipdfmx') %% l3drivers-pdf.dtx (with options: `package,xdvipdfmx') %% %% Copyright (C) 1990-2019 The LaTeX3 Project @@ -33,6 +33,7 @@ \cs_new_protected:Npn \__driver_literal:n #1 { \__driver_literal:e { \exp_not:n {#1} } } \cs_generate_variant:Nn \__driver_literal:n { x } +\box_new:N \l__driver_internal_box \cs_new_protected:Npn \__driver_literal_pdf:n #1 { \__driver_literal:n { pdf:literal~ #1 } } \cs_generate_variant:Nn \__driver_literal_pdf:n { x } @@ -351,134 +352,144 @@ \__driver_literal:n { pdf:etrans } \__driver_scope_end: } -%% File: l3drivers-image.dtx -\cs_new_eq:NN \__driver_image_getbb_eps:n \image_read_bb:n -\int_new:N \g__driver_image_int -\cs_new_protected:Npn \__driver_image_include_eps:n #1 +%% File: l3drivers-graphics.dtx +\AtBeginDocument + { \cs_new_eq:NN \driver_graphics_getbb_eps:n \graphics_read_bb:n } +\int_new:N \g__driver_graphics_int +\cs_new_protected:Npn \driver_graphics_include_eps:n #1 { - \__driver_literal:n { PSfile = #1 } + \__driver_literal:x + { + PSfile = #1 \c_space_tl + llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl + lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl + urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl + ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim + } } -\cs_new_protected:Npn \__driver_image_include_jpg:n #1 - { \__driver_image_include_auxi:nn {#1} { image } } -\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n -\cs_new_protected:Npn \__driver_image_include_auxi:nn #1#2 +\cs_new_protected:Npn \driver_graphics_include_jpg:n #1 + { \__driver_graphics_include_auxi:nn {#1} { image } } +\cs_new_eq:NN \driver_graphics_include_png:n \driver_graphics_include_jpg:n +\cs_new_protected:Npn \__driver_graphics_include_auxi:nn #1#2 { - \__driver_image_include_auxii:xnn + \__driver_graphics_include_auxii:xnn { - \tl_if_empty:NF \l_image_pagebox_tl - { : \l_image_pagebox_tl } - \int_compare:nNnT \l_image_page_int > 1 - { :P \int_use:N \l_image_page_int } - \tl_if_empty:NF \l_image_decode_tl - { :D \l_image_decodearray_tl } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_pagebox_tl + { : \l_graphics_pagebox_tl } + \int_compare:nNnT \l_graphics_page_int > 1 + { :P \int_use:N \l_graphics_page_int } + \tl_if_empty:NF \l_graphics_decodearray_tl + { :D \l_graphics_decodearray_tl } + \bool_if:NT \l_graphics_interpolate_bool { :I } } {#1} {#2} } -\cs_new_protected:Npn \__driver_image_include_auxii:nnn #1#2#3 +\cs_new_protected:Npn \__driver_graphics_include_auxii:nnn #1#2#3 { - \int_if_exist:cTF { c__driver_image_ #2#1 _int } + \int_if_exist:cTF { c__driver_graphics_ #2#1 _int } { \__driver_literal:x - { pdf:usexobj~@image \int_use:c { c__driver_image_ #2#1 _int } } + { pdf:usexobj~@image \int_use:c { c__driver_graphics_ #2#1 _int } } } - { \__driver_image_include_auxiii:nn {#2} {#1} {#3} } + { \__driver_graphics_include_auxiii:nnn {#2} {#1} {#3} } } -\cs_generate_variant:Nn \__driver_image_include_auxii:nnn { x } -\cs_new_protected:Npn \__driver_image_include_auxiii:nnn #1#2#3 +\cs_generate_variant:Nn \__driver_graphics_include_auxii:nnn { x } +\cs_new_protected:Npn \__driver_graphics_include_auxiii:nnn #1#2#3 { - \int_gincr:N \g__driver_image_int - \int_const:cn { c__driver_image_ #1#2 _int } { \g__driver_image_int } + \int_gincr:N \g__driver_graphics_int + \int_const:cn { c__driver_graphics_ #1#2 _int } { \g__driver_graphics_int } \__driver_literal:x { pdf:#3~ - @image \int_use:c { c__driver_image_ #1#2 _int } - \int_compare:nNnT \l_image_page_int > 1 - { page ~ \int_use:N \l_image_page_int \c_space_tl } - \tl_if_empty:NF \l_image_pagebox_tl + @image \int_use:c { c__driver_graphics_ #1#2 _int } ~ + \int_compare:nNnT \l_graphics_page_int > 1 + { page ~ \int_use:N \l_graphics_page_int \c_space_tl } + \tl_if_empty:NF \l_graphics_pagebox_tl { - pagebox ~ \l_image_pagebox_tl \c_space_tl + pagebox ~ \l_graphics_pagebox_tl \c_space_tl bbox ~ - \dim_to_decimal_in_bp:n \l_image_llx_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_lly_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_urx_dim \c_space_tl - \dim_to_decimal_in_bp:n \l_image_ury_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl + \dim_to_decimal_in_bp:n \l_graphics_ury_dim \c_space_tl } (#1) \bool_lazy_or:nnT - { \l_image_interpolate_bool } - { ! \tl_if_empty_p:N \l_image_decodearray_tl } + { \l_graphics_interpolate_bool } + { ! \tl_if_empty_p:N \l_graphics_decodearray_tl } { << - \tl_if_empty:NF \l_image_decode_tl - { /Decode~[ \l_image_decodearray_tl ] } - \bool_if:NT \l_image_interpolate_bool + \tl_if_empty:NF \l_graphics_decodearray_tl + { /Decode~[ \l_graphics_decodearray_tl ] } + \bool_if:NT \l_graphics_interpolate_bool { /Interpolate~true> } >> } } } -\cs_new_protected:Npn \__driver_image_getbb_jpg:n #1 +\cs_new_protected:Npn \driver_graphics_getbb_jpg:n #1 { - \int_zero:N \l_image_page_int - \tl_clear:N \l_image_pagebox_tl - \__driver_image_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D + \int_zero:N \l_graphics_page_int + \tl_clear:N \l_graphics_pagebox_tl + \__driver_graphics_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D } -\cs_new_eq:NN \__driver_image_getbb_png:n \__driver_image_getbb_jpg:n -\cs_new_protected:Npn \__driver_image_getbb_pdf:n #1 +\cs_new_eq:NN \driver_graphics_getbb_png:n \driver_graphics_getbb_jpg:n +\cs_new_protected:Npn \driver_graphics_getbb_pdf:n #1 { - \tl_clear:N \l_image_decode_tl - \bool_set_false:N \l_image_interpolate_bool - \__driver_image_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D + \tl_clear:N \l_graphics_decodearray_tl + \bool_set_false:N \l_graphics_interpolate_bool + \__driver_graphics_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D } -\cs_new_protected:Npn \__driver_image_getbb_auxi:nN #1#2 +\cs_new_protected:Npn \__driver_graphics_getbb_auxi:nN #1#2 { - \int_compare:nNnTF \l_image_page_int > 1 - { \__driver_image_getbb_auxii:VnN \l_image_page_int {#1} #2 } - { \__driver_image_getbb_auxiii:nNnn {#1} #2 } + \int_compare:nNnTF \l_graphics_page_int > 1 + { \__driver_graphics_getbb_auxii:VnN \l_graphics_page_int {#1} #2 } + { \__driver_graphics_getbb_auxiii:nNnn {#1} #2 { :P 1 } { page 1 } } } -\cs_new_protected:Npn \__driver_image_getbb_auxii:nnN #1#2#3 - { \__driver_image_getbb_aux:nNnn {#2} #3 { :P #1 } { page #1 } } -\cs_generate_variant:Nn \__driver_image_getbb_auxii:nnN { V } -\cs_new_protected:Npn \__driver_image_getbb_auxiii:nNnn #1#2#3#4 +\cs_new_protected:Npn \__driver_graphics_getbb_auxii:nnN #1#2#3 + { \__driver_graphics_getbb_auxiii:nNnn {#2} #3 { :P #1 } { page #1 } } +\cs_generate_variant:Nn \__driver_graphics_getbb_auxii:nnN { V } +\cs_new_protected:Npn \__driver_graphics_getbb_auxiii:nNnn #1#2#3#4 { - \tl_if_empty:NTF \l_image_pagebox_tl - { \__driver_image_getbb_auxiv:VnNnn \l_image_pagebox_tl } - { \__driver_image_getbb_auxv:nNnn } + \tl_if_empty:NTF \l_graphics_pagebox_tl + { \__driver_graphics_getbb_auxiv:VnNnn \l_graphics_pagebox_tl } + { \__driver_graphics_getbb_auxv:nNnn } {#1} #2 {#3} {#4} } -\cs_new_protected:Npn \__driver_image_getbb_auxiv:nnNnn #1#2#3#4#5 +\cs_new_protected:Npn \__driver_graphics_getbb_auxiv:nnNnn #1#2#3#4#5 { \use:x { - \__driver_image_getbb_auxv:nNnn {#2} #3 { : #1 #4 } - { #5 ~ \__driver_image_getbb_pagebox:w #1 } + \__driver_graphics_getbb_auxv:nNnn {#2} #3 { : #1 #4 } + { #5 ~ \__driver_graphics_getbb_pagebox:w #1 } } } -\cs_generate_variant:Nn \__driver_image_getbb_auxiv:nnNnn { V } -\cs_new_protected:Npn \__driver_image_getbb_auxv:nNnn #1#2#3#4 +\cs_generate_variant:Nn \__driver_graphics_getbb_auxiv:nnNnn { V } +\cs_new_protected:Npn \__driver_graphics_getbb_auxv:nNnn #1#2#3#4 { - \image_bb_restore:nF {#1#3} - { \__driver_image_getbb_auxvi:nNnn {#1} #2 {#3} {#4} } + \graphics_bb_restore:nF {#1#3} + { \__driver_graphics_getbb_auxvi:nNnn {#1} #2 {#3} {#4} } } -\cs_new_protected:Npn \__driver_image_getbb_auxvi:nNnn #1#2#3#4 +\cs_new_protected:Npn \__driver_graphics_getbb_auxvi:nNnn #1#2#3#4 { - \hbox_set:Nn \l__driver_tmp_box { #2 #1 ~ #4 } - \dim_set:Nn \l_image_utx_dim { \box_wd:N \l__driver_tmp_box } - \dim_set:Nn \l_image_ury_dim { \box_ht:N \l__driver_tmp_box } - \image_bb_save:n {#1#3} + \hbox_set:Nn \l__driver_internal_box { #2 #1 ~ #4 } + \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l__driver_internal_box } + \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l__driver_internal_box } + \graphics_bb_save:n {#1#3} } -\cs_new:Npn \__driver_image_getbb_pagebox:w #1 box {#1} -\cs_new_protected:Npn \__driver_image_include_pdf:n #1 +\cs_new:Npn \__driver_graphics_getbb_pagebox:w #1 box {#1} +\cs_new_protected:Npn \driver_graphics_include_pdf:n #1 { - \tex_XeTeXpdffile:D "#1" ~ - \int_compare:nNnT \l_image_page_int > 0 - { page~ \int_use:N \l_image_page_int } - \__driver_image_getbb_auxiv:VnNnn \l_image_pagebox_tl + \tex_XeTeXpdffile:D + \__driver_graphics_include_pdf_quote:w #1 "#1" \q_stop \c_space_tl + \int_compare:nNnT \l_graphics_page_int > 0 + { page ~ \int_use:N \l_graphics_page_int \c_space_tl } + \exp_after:wN \__driver_graphics_getbb_pagebox:w \l_graphics_pagebox_tl } +\cs_new:Npn \__driver_graphics_include_pdf_quote:w #1 " #2 " #3 \q_stop + { " #2 " } %% File: l3drivers-pdf.dtx -\box_new:N \l__driver_pdf_tmp_box \cs_new_protected:Npx \__driver_pdf:n #1 { \__driver_literal:n { pdf: #1 } } \cs_generate_variant:Nn \__driver_pdf:n { x } @@ -618,8 +629,8 @@ \cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2 { \group_begin: - \hbox_set:Nn \l__driver_pdf_tmp_box {#2} - \box_move_down:nn { \box_dp:N \l__driver_pdf_tmp_box } + \hbox_set:Nn \l__driver_internal_box {#2} + \box_move_down:nn { \box_dp:N \l__driver_internal_box } { \hbox:n { @@ -627,8 +638,8 @@ \__driver_pdf:n { obj ~ @driver_#1_lly ~ @ypos } } } - \box_use:N \l__driver_pdf_tmp_box - \box_move_up:nn { \box_ht:N \l__driver_pdf_tmp_box } + \box_use:N \l__driver_internal_box + \box_move_up:nn { \box_ht:N \l__driver_internal_box } { \hbox:n { |