diff options
author | Karl Berry <karl@freefriends.org> | 2018-04-30 22:39:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-04-30 22:39:09 +0000 |
commit | a28e1bfccd6fe522fcd296426e4d89c7fb4f19b6 (patch) | |
tree | b72347e08575b56fcfed87c4d837b48dcfd1e02a /Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx | |
parent | b40c37a9e22b8235ff9c0bc256d00f7af94304c3 (diff) |
l3 (30apr18)
git-svn-id: svn://tug.org/texlive/trunk@47516 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx | 124 |
1 files changed, 80 insertions, 44 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 42b8793c0d5..97f964fe7f7 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018/03/05} +% \date{Released 2018-04-30} % % \maketitle % @@ -311,7 +311,7 @@ % which displays the result in the terminal. % \end{function} % -% \subsection{Constants and variables} +% \section{Constants and variables} % % \begin{variable}{\c_empty_coffin} % A permanently empty coffin. @@ -448,6 +448,16 @@ % placing material in them. This all relies on the following data % structures. % +% \begin{macro}[EXP]{\@@_to_value:N} +% Coffins are a two-part structure and we rely on the internal nature of +% box allocation to make everything work. As such, we need an interface +% to turn coffin identifiers into numbers. For the purposes here, the +% signature allowed is |N| despite the nature of the underlying primitive. +% \begin{macrocode} +\cs_new_eq:NN \@@_to_value:N \tex_number:D +% \end{macrocode} +% \end{macro} +% % \begin{macro}[EXP, pTF]{\coffin_if_exist:N, \coffin_if_exist:c} % Several of the higher-level coffin functions would give multiple % errors if the coffin does not exist. A cleaner way to handle this @@ -458,7 +468,7 @@ { \cs_if_exist:NTF #1 { - \cs_if_exist:cTF { l_@@_poles_ \__int_value:w #1 _prop } + \cs_if_exist:cTF { l_@@_poles_ \@@_to_value:N #1 _prop } { \prg_return_true: } { \prg_return_false: } } @@ -516,11 +526,11 @@ { \box_new:N #1 \debug_suspend: - \prop_clear_new:c { l_@@_corners_ \__int_value:w #1 _prop } - \prop_clear_new:c { l_@@_poles_ \__int_value:w #1 _prop } - \prop_gset_eq:cN { l_@@_corners_ \__int_value:w #1 _prop } + \prop_clear_new:c { l_@@_corners_ \@@_to_value:N #1 _prop } + \prop_clear_new:c { l_@@_poles_ \@@_to_value:N #1 _prop } + \prop_gset_eq:cN { l_@@_corners_ \@@_to_value:N #1 _prop } \c_@@_corners_prop - \prop_gset_eq:cN { l_@@_poles_ \__int_value:w #1 _prop } + \prop_gset_eq:cN { l_@@_poles_ \@@_to_value:N #1 _prop } \c_@@_poles_prop \debug_resume: } @@ -732,7 +742,7 @@ \cs_new_protected:Npn \@@_get_pole:NnN #1#2#3 { \prop_get:cnNF - { l_@@_poles_ \__int_value:w #1 _prop } {#2} #3 + { l_@@_poles_ \@@_to_value:N #1 _prop } {#2} #3 { \__kernel_msg_error:nnxx { kernel } { unknown-coffin-pole } {#2} { \token_to_str:N #1 } @@ -747,9 +757,9 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_reset_structure:N #1 { - \prop_set_eq:cN { l_@@_corners_ \__int_value:w #1 _prop } + \prop_set_eq:cN { l_@@_corners_ \@@_to_value:N #1 _prop } \c_@@_corners_prop - \prop_set_eq:cN { l_@@_poles_ \__int_value:w #1 _prop } + \prop_set_eq:cN { l_@@_poles_ \@@_to_value:N #1 _prop } \c_@@_poles_prop } % \end{macrocode} @@ -761,17 +771,17 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_set_eq_structure:NN #1#2 { - \prop_set_eq:cc { l_@@_corners_ \__int_value:w #1 _prop } - { l_@@_corners_ \__int_value:w #2 _prop } - \prop_set_eq:cc { l_@@_poles_ \__int_value:w #1 _prop } - { l_@@_poles_ \__int_value:w #2 _prop } + \prop_set_eq:cc { l_@@_corners_ \@@_to_value:N #1 _prop } + { l_@@_corners_ \@@_to_value:N #2 _prop } + \prop_set_eq:cc { l_@@_poles_ \@@_to_value:N #1 _prop } + { l_@@_poles_ \@@_to_value:N #2 _prop } } \cs_new_protected:Npn \@@_gset_eq_structure:NN #1#2 { - \prop_gset_eq:cc { l_@@_corners_ \__int_value:w #1 _prop } - { l_@@_corners_ \__int_value:w #2 _prop } - \prop_gset_eq:cc { l_@@_poles_ \__int_value:w #1 _prop } - { l_@@_poles_ \__int_value:w #2 _prop } + \prop_gset_eq:cc { l_@@_corners_ \@@_to_value:N #1 _prop } + { l_@@_corners_ \@@_to_value:N #2 _prop } + \prop_gset_eq:cc { l_@@_poles_ \@@_to_value:N #1 _prop } + { l_@@_poles_ \@@_to_value:N #2 _prop } } % \end{macrocode} % \end{macro} @@ -808,7 +818,10 @@ } } \cs_new_protected:Npn \@@_set_pole:Nnn #1#2#3 - { \prop_put:cnn { l_@@_poles_ \__int_value:w #1 _prop } {#2} {#3} } + { + \prop_put:cnn { l_@@_poles_ \@@_to_value:N #1 _prop } + {#2} {#3} + } \cs_generate_variant:Nn \coffin_set_horizontal_pole:Nnn { c } \cs_generate_variant:Nn \coffin_set_vertical_pole:Nnn { c } \cs_generate_variant:Nn \@@_set_pole:Nnn { Nnx } @@ -824,14 +837,24 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_update_corners:N #1 { - \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { tl } + \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } + { tl } { { 0pt } { \dim_eval:n { \box_ht:N #1 } } } - \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { tr } - { { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { \box_ht:N #1 } } } - \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { bl } + \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } + { tr } + { + { \dim_eval:n { \box_wd:N #1 } } + { \dim_eval:n { \box_ht:N #1 } } + } + \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } + { bl } { { 0pt } { \dim_eval:n { -\box_dp:N #1 } } } - \prop_put:cnx { l_@@_corners_ \__int_value:w #1 _prop } { br } - { { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { -\box_dp:N #1 } } } + \prop_put:cnx { l_@@_corners_ \@@_to_value:N #1 _prop } + { br } + { + { \dim_eval:n { \box_wd:N #1 } } + { \dim_eval:n { -\box_dp:N #1 } } + } } % \end{macrocode} % \end{macro} @@ -845,31 +868,31 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_update_poles:N #1 { - \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { hc } + \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { hc } { { \dim_eval:n { 0.5 \box_wd:N #1 } } { 0pt } { 0pt } { 1000pt } } - \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { r } + \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { r } { { \dim_eval:n { \box_wd:N #1 } } { 0pt } { 0pt } { 1000pt } } - \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { vc } + \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { vc } { { 0pt } { \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } } { 1000pt } { 0pt } } - \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { t } + \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { t } { { 0pt } { \dim_eval:n { \box_ht:N #1 } } { 1000pt } { 0pt } } - \prop_put:cnx { l_@@_poles_ \__int_value:w #1 _prop } { b } + \prop_put:cnx { l_@@_poles_ \@@_to_value:N #1 _prop } { b } { { 0pt } { \dim_eval:n { -\box_dp:N #1 } } @@ -1028,13 +1051,18 @@ \fp_to_dim:n { ( - \dim_to_fp:n {#1} * \l_@@_slope_x_fp - - ( \dim_to_fp:n {#5} * \l_@@_slope_y_fp ) + \dim_to_fp:n {#1} * + \l_@@_slope_x_fp + - ( \dim_to_fp:n {#5} * + \l_@@_slope_y_fp ) - \dim_to_fp:n {#2} + \dim_to_fp:n {#6} ) / - ( \l_@@_slope_x_fp - \l_@@_slope_y_fp ) + ( + \l_@@_slope_x_fp - + \l_@@_slope_y_fp + ) } } \@@_calculate_intersection_aux:nnnnnN @@ -1115,7 +1143,11 @@ % \begin{macrocode} \@@_reset_structure:N \l_@@_aligned_coffin \prop_clear:c - { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _ prop } + { + l_@@_corners_ + \@@_to_value:N \l_@@_aligned_coffin + _prop + } \@@_update_poles:N \l_@@_aligned_coffin % \end{macrocode} % The structures of the parent coffins are now transferred to the new @@ -1165,8 +1197,11 @@ \box_set_wd:Nn \l_@@_aligned_coffin { \box_wd:N #1 } \@@_reset_structure:N \l_@@_aligned_coffin \prop_set_eq:cc - { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _prop } - { l_@@_corners_ \__int_value:w #1 _prop } + { + l_@@_corners_ + \@@_to_value:N \l_@@_aligned_coffin _prop + } + { l_@@_corners_ \@@_to_value:N #1 _prop } \@@_update_poles:N \l_@@_aligned_coffin \@@_offset_poles:Nnn #1 { 0pt } { 0pt } \@@_offset_poles:Nnn #4 @@ -1235,7 +1270,7 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_offset_poles:Nnn #1#2#3 { - \prop_map_inline:cn { l_@@_poles_ \__int_value:w #1 _prop } + \prop_map_inline:cn { l_@@_poles_ \@@_to_value:N #1 _prop } { \@@_offset_pole:Nnnnnnn #1 {##1} ##2 {#2} {#3} } } \cs_new_protected:Npn \@@_offset_pole:Nnnnnnn #1#2#3#4#5#6#7#8 @@ -1264,13 +1299,16 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_offset_corners:Nnn #1#2#3 { - \prop_map_inline:cn { l_@@_corners_ \__int_value:w #1 _prop } + \prop_map_inline:cn { l_@@_corners_ \@@_to_value:N #1 _prop } { \@@_offset_corner:Nnnnn #1 {##1} ##2 {#2} {#3} } } \cs_new_protected:Npn \@@_offset_corner:Nnnnn #1#2#3#4#5#6 { \prop_put:cnx - { l_@@_corners_ \__int_value:w \l_@@_aligned_coffin _prop } + { + l_@@_corners_ + \@@_to_value:N \l_@@_aligned_coffin _prop + } { #1 - #2 } { { \dim_eval:n { #3 + #5 } } @@ -1538,7 +1576,7 @@ %</package> } \prop_set_eq:Nc \l_@@_display_poles_prop - { l_@@_poles_ \__int_value:w #1 _prop } + { l_@@_poles_ \@@_to_value:N #1 _prop } \@@_get_pole:NnN #1 { H } \l_@@_pole_a_tl \@@_get_pole:NnN #1 { T } \l_@@_pole_b_tl \tl_if_eq:NNT \l_@@_pole_a_tl \l_@@_pole_b_tl @@ -1682,7 +1720,7 @@ } { \prop_map_function:cN - { l_@@_poles_ \int_eval:n {#2} _prop } + { l_@@_poles_ \@@_to_value:N #2 _prop } \msg_show_item_unbraced:nn } { } @@ -1697,10 +1735,9 @@ \__kernel_msg_new:nnnn { kernel } { no-pole-intersection } { No~intersection~between~coffin~poles. } { - \c__msg_coding_error_text_tl LaTeX~was~asked~to~find~the~intersection~between~two~poles,~ but~they~do~not~have~a~unique~meeting~point:~ - the~value~(0~pt,~0~pt)~will~be~used. + the~value~(0pt,~0pt)~will~be~used. } \__kernel_msg_new:nnnn { kernel } { unknown-coffin } { Unknown~coffin~'#1'. } @@ -1708,7 +1745,6 @@ \__kernel_msg_new:nnnn { kernel } { unknown-coffin-pole } { Pole~'#1'~unknown~for~coffin~'#2'. } { - \c__msg_coding_error_text_tl LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~ but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong. } |