diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx | 192 |
1 files changed, 88 insertions, 104 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx index 75d48a6becb..21aae4e614e 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3coffins.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: l3coffins.dtx Copyright(C) 2010,2011 The LaTeX3 Project +%% File: l3coffins.dtx Copyright(C) 2010-2012 The LaTeX3 Project %% %% It may be distributed and/or modified under the conditions of the %% LaTeX Project Public License (LPPL), either version 1.3c of this @@ -36,7 +36,7 @@ % %<*driver|package> \RequirePackage{l3names} -\GetIdInfo$Id: l3coffins.dtx 3086 2011-12-22 17:55:46Z bruno $ +\GetIdInfo$Id: l3coffins.dtx 3155 2012-01-08 22:53:03Z bruno $ {L3 Experimental coffin code layer} %</driver|package> %<*driver> @@ -336,7 +336,8 @@ % both printed in the \meta{colour} specified. % \end{function} % -% \begin{function}{\coffin_show_structure:N, \coffin_show_structure:c} +% \begin{function}[updated = 2012-01-01] +% {\coffin_show_structure:N, \coffin_show_structure:c} % \begin{syntax} % \cs{coffin_show_structure:N} \meta{coffin} % \end{syntax} @@ -373,16 +374,16 @@ % % \subsection{Coffins: data structures and general variables} % -% \begin{variable}{\l_coffin_tmp_box} -% \begin{variable}{\l_coffin_tmp_dim} -% \begin{variable}{\l_coffin_tmp_fp} -% \begin{variable}{\l_coffin_tmp_tl} +% \begin{variable}{\l_coffin_internal_box} +% \begin{variable}{\l_coffin_internal_dim} +% \begin{variable}{\l_coffin_internal_fp} +% \begin{variable}{\l_coffin_internal_tl} % Scratch variables. % \begin{macrocode} -\box_new:N \l_coffin_tmp_box -\dim_new:N \l_coffin_tmp_dim -\fp_new:N \l_coffin_tmp_fp -\tl_new:N \l_coffin_tmp_tl +\box_new:N \l_coffin_internal_box +\dim_new:N \l_coffin_internal_dim +\fp_new:N \l_coffin_internal_fp +\tl_new:N \l_coffin_internal_tl % \end{macrocode} % \end{variable} % \end{variable} @@ -407,17 +408,17 @@ % based values. % \begin{macrocode} \prop_new:N \c_coffin_poles_prop -\tl_set:Nn \l_coffin_tmp_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } } -\prop_put:Nno \c_coffin_poles_prop { l } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { hc } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { r } { \l_coffin_tmp_tl } -\tl_set:Nn \l_coffin_tmp_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } } -\prop_put:Nno \c_coffin_poles_prop { b } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { vc } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { t } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { B } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { H } { \l_coffin_tmp_tl } -\prop_put:Nno \c_coffin_poles_prop { T } { \l_coffin_tmp_tl } +\tl_set:Nn \l_coffin_internal_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } } +\prop_put:Nno \c_coffin_poles_prop { l } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { hc } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { r } { \l_coffin_internal_tl } +\tl_set:Nn \l_coffin_internal_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } } +\prop_put:Nno \c_coffin_poles_prop { b } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { vc } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { t } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { B } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { H } { \l_coffin_internal_tl } +\prop_put:Nno \c_coffin_poles_prop { T } { \l_coffin_internal_tl } % \end{macrocode} % \end{variable} % @@ -658,15 +659,15 @@ \coffin_reset_structure:N #1 \coffin_update_poles:N #1 \coffin_update_corners:N #1 - \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } + \vbox_set_top:Nn \l_coffin_internal_box { \vbox_unpack:N #1 } \coffin_set_pole:Nnx #1 { T } { { 0 pt } - { \dim_eval:n { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } } + { \dim_eval:n { \box_ht:N #1 - \box_ht:N \l_coffin_internal_box } } { 1000 pt } { 0 pt } } - \box_clear:N \l_coffin_tmp_box + \box_clear:N \l_coffin_internal_box } } \cs_generate_variant:Nn \vcoffin_set:Nnn { c } @@ -717,17 +718,17 @@ \coffin_reset_structure:N #1 \coffin_update_poles:N #1 \coffin_update_corners:N #1 - \vbox_set_top:Nn \l_coffin_tmp_box { \vbox_unpack:N #1 } + \vbox_set_top:Nn \l_coffin_internal_box { \vbox_unpack:N #1 } \coffin_set_pole:Nnx #1 { T } { { 0 pt } { - \dim_eval:n { \box_ht:N #1 - \box_ht:N \l_coffin_tmp_box } + \dim_eval:n { \box_ht:N #1 - \box_ht:N \l_coffin_internal_box } } { 1000 pt } { 0 pt } } - \box_clear:N \l_coffin_tmp_box + \box_clear:N \l_coffin_internal_box } } } @@ -1223,10 +1224,10 @@ \dim_compare:nNnT { \l_coffin_offset_x_dim } < \c_zero_dim { \tex_kern:D -\l_coffin_offset_x_dim } \hbox_unpack:N \l_coffin_aligned_coffin - \dim_set:Nn \l_coffin_tmp_dim + \dim_set:Nn \l_coffin_internal_dim { \l_coffin_offset_x_dim - \box_wd:N #1 + \box_wd:N #4 } - \dim_compare:nNnT \l_coffin_tmp_dim < \c_zero_dim - { \tex_kern:D -\l_coffin_tmp_dim } + \dim_compare:nNnT \l_coffin_internal_dim < \c_zero_dim + { \tex_kern:D -\l_coffin_internal_dim } } % \end{macrocode} % The coffin structure is reset, and the corners are cleared: only @@ -1362,10 +1363,10 @@ \dim_set:Nn \l_coffin_x_dim { #3 + #7 } \dim_set:Nn \l_coffin_y_dim { #4 + #8 } \tl_if_in:nnTF {#2} { - } - { \tl_set:Nn \l_coffin_tmp_tl { {#2} } } - { \tl_set:Nn \l_coffin_tmp_tl { { #1 - #2 } } } + { \tl_set:Nn \l_coffin_internal_tl { {#2} } } + { \tl_set:Nn \l_coffin_internal_tl { { #1 - #2 } } } \exp_last_unbraced:NNo \coffin_set_pole:Nnx \l_coffin_aligned_coffin - { \l_coffin_tmp_tl } + { \l_coffin_internal_tl } { { \dim_use:N \l_coffin_x_dim } { \dim_use:N \l_coffin_y_dim } {#5} {#6} @@ -1507,11 +1508,11 @@ % \begin{macrocode} \cs_new_protected:Npn \coffin_rotate:Nn #1#2 { - \fp_set:Nn \l_coffin_tmp_fp {#2} - \fp_div:Nn \l_coffin_tmp_fp { 180 } - \fp_mul:Nn \l_coffin_tmp_fp { \c_pi_fp } - \fp_sin:Nn \l_coffin_sin_fp { \l_coffin_tmp_fp } - \fp_cos:Nn \l_coffin_cos_fp { \l_coffin_tmp_fp } + \fp_set:Nn \l_coffin_internal_fp {#2} + \fp_div:Nn \l_coffin_internal_fp { 180 } + \fp_mul:Nn \l_coffin_internal_fp { \c_pi_fp } + \fp_sin:Nn \l_coffin_sin_fp { \l_coffin_internal_fp } + \fp_cos:Nn \l_coffin_cos_fp { \l_coffin_internal_fp } % \end{macrocode} % The corners and poles of the coffin can now be rotated around the % origin. This is best achieved using mapping functions. @@ -1585,11 +1586,11 @@ { { 0 pt } { \dim_use:N \box_ht:N #1 } } \prop_put:Nnx \l_coffin_bounding_prop { tr } { { \dim_use:N \box_wd:N #1 } { \dim_use:N \box_ht:N #1 } } - \dim_set:Nn \l_coffin_tmp_dim { - \box_dp:N #1 } + \dim_set:Nn \l_coffin_internal_dim { - \box_dp:N #1 } \prop_put:Nnx \l_coffin_bounding_prop { bl } - { { 0 pt } { \dim_use:N \l_coffin_tmp_dim } } + { { 0 pt } { \dim_use:N \l_coffin_internal_dim } } \prop_put:Nnx \l_coffin_bounding_prop { br } - { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l_coffin_tmp_dim } } + { { \dim_use:N \box_wd:N #1 } { \dim_use:N \l_coffin_internal_dim } } } % \end{macrocode} % \end{macro} @@ -1650,15 +1651,15 @@ \fp_set_from_dim:Nn \l_coffin_x_fp {#1} \fp_set_from_dim:Nn \l_coffin_y_fp {#2} \fp_set_eq:NN \l_coffin_x_prime_fp \l_coffin_x_fp - \fp_set_eq:NN \l_coffin_tmp_fp \l_coffin_y_fp + \fp_set_eq:NN \l_coffin_internal_fp \l_coffin_y_fp \fp_mul:Nn \l_coffin_x_prime_fp { \l_coffin_cos_fp } - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_sin_fp } - \fp_sub:Nn \l_coffin_x_prime_fp { \l_coffin_tmp_fp } + \fp_mul:Nn \l_coffin_internal_fp { \l_coffin_sin_fp } + \fp_sub:Nn \l_coffin_x_prime_fp { \l_coffin_internal_fp } \fp_set_eq:NN \l_coffin_y_prime_fp \l_coffin_y_fp - \fp_set_eq:NN \l_coffin_tmp_fp \l_coffin_x_fp + \fp_set_eq:NN \l_coffin_internal_fp \l_coffin_x_fp \fp_mul:Nn \l_coffin_y_prime_fp { \l_coffin_cos_fp } - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_sin_fp } - \fp_add:Nn \l_coffin_y_prime_fp { \l_coffin_tmp_fp } + \fp_mul:Nn \l_coffin_internal_fp { \l_coffin_sin_fp } + \fp_add:Nn \l_coffin_y_prime_fp { \l_coffin_internal_fp } \dim_set:Nn #3 { \fp_to_dim:N \l_coffin_x_prime_fp } \dim_set:Nn #4 { \fp_to_dim:N \l_coffin_y_prime_fp } } @@ -1772,11 +1773,11 @@ \coffin_set_user_dimensions:N #1 \box_resize:Nnn #1 {#2} {#3} \fp_set_from_dim:Nn \l_coffin_scale_x_fp {#2} - \fp_set_from_dim:Nn \l_coffin_tmp_fp { \Width } - \fp_div:Nn \l_coffin_scale_x_fp { \l_coffin_tmp_fp } + \fp_set_from_dim:Nn \l_coffin_internal_fp { \Width } + \fp_div:Nn \l_coffin_scale_x_fp { \l_coffin_internal_fp } \fp_set_from_dim:Nn \l_coffin_scale_y_fp {#3} - \fp_set_from_dim:Nn \l_coffin_tmp_fp { \TotalHeight } - \fp_div:Nn \l_coffin_scale_y_fp { \l_coffin_tmp_fp } + \fp_set_from_dim:Nn \l_coffin_internal_fp { \TotalHeight } + \fp_div:Nn \l_coffin_scale_y_fp { \l_coffin_internal_fp } \coffin_resize_common:Nnn #1 {#2} {#3} } \cs_generate_variant:Nn \coffin_resize:Nnn { c } @@ -1842,12 +1843,12 @@ % \begin{macrocode} \cs_new_protected:Npn \coffin_scale_vector:nnNN #1#2#3#4 { - \fp_set_from_dim:Nn \l_coffin_tmp_fp {#1} - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_scale_x_fp } - \dim_set:Nn #3 { \fp_to_dim:N \l_coffin_tmp_fp } - \fp_set_from_dim:Nn \l_coffin_tmp_fp {#2} - \fp_mul:Nn \l_coffin_tmp_fp { \l_coffin_scale_y_fp } - \dim_set:Nn #4 { \fp_to_dim:N \l_coffin_tmp_fp } + \fp_set_from_dim:Nn \l_coffin_internal_fp {#1} + \fp_mul:Nn \l_coffin_internal_fp { \l_coffin_scale_x_fp } + \dim_set:Nn #3 { \fp_to_dim:N \l_coffin_internal_fp } + \fp_set_from_dim:Nn \l_coffin_internal_fp {#2} + \fp_mul:Nn \l_coffin_internal_fp { \l_coffin_scale_y_fp } + \dim_set:Nn #4 { \fp_to_dim:N \l_coffin_internal_fp } } % \end{macrocode} % \end{macro} @@ -2003,14 +2004,6 @@ % \end{macrocode} % \end{variable} % -% \begin{variable}{\l_coffin_handles_tmp_prop} -% Used for displaying coffins, as the handles need to be stored in this -% case, at least temporarily. -% \begin{macrocode} -\prop_new:N \l_coffin_handles_tmp_prop -% \end{macrocode} -% \end{variable} -% % \begin{macro}{\coffin_mark_handle:Nnnn, \coffin_mark_handle:cnnn} % \begin{macro}[aux]{\coffin_mark_handle_aux:nnnnNnn} % Marking a single handle is relatively easy. The standard attachment @@ -2045,12 +2038,12 @@ ( \tl_to_str:n { #2 , #3 } ) } \prop_get:NnN \l_coffin_display_handles_prop - { #2 #3 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl + { #2 #3 } \l_coffin_internal_tl + \quark_if_no_value:NTF \l_coffin_internal_tl { \prop_get:NnN \l_coffin_display_handles_prop - { #3 #2 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl + { #3 #2 } \l_coffin_internal_tl + \quark_if_no_value:NTF \l_coffin_internal_tl { \coffin_attach_mark:NnnNnnnn #1 {#2} {#3} \l_coffin_display_coord_coffin { l } { vc } @@ -2058,12 +2051,12 @@ } { \exp_last_unbraced:No \coffin_mark_handle_aux:nnnnNnn - \l_coffin_tmp_tl #1 {#2} {#3} + \l_coffin_internal_tl #1 {#2} {#3} } } { \exp_last_unbraced:No \coffin_mark_handle_aux:nnnnNnn - \l_coffin_tmp_tl #1 {#2} {#3} + \l_coffin_internal_tl #1 {#2} {#3} } } \cs_new_protected:Npn \coffin_mark_handle_aux:nnnnNnn #1#2#3#4#5#6#7 @@ -2110,7 +2103,6 @@ \tl_if_eq:NNT \l_coffin_pole_a_tl \l_coffin_pole_b_tl { \prop_del:Nn \l_coffin_display_poles_prop { B } } \coffin_set_eq:NN \l_coffin_display_coffin #1 - \prop_clear:N \l_coffin_handles_tmp_prop \prop_map_inline:Nn \l_coffin_display_poles_prop { \prop_del:Nn \l_coffin_display_poles_prop {##1} @@ -2149,12 +2141,12 @@ ( \tl_to_str:n { #1 , ##1 } ) } \prop_get:NnN \l_coffin_display_handles_prop - { #1 ##1 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl + { #1 ##1 } \l_coffin_internal_tl + \quark_if_no_value:NTF \l_coffin_internal_tl { \prop_get:NnN \l_coffin_display_handles_prop - { ##1 #1 } \l_coffin_tmp_tl - \quark_if_no_value:NTF \l_coffin_tmp_tl + { ##1 #1 } \l_coffin_internal_tl + \quark_if_no_value:NTF \l_coffin_internal_tl { \coffin_display_attach:Nnnnn \l_coffin_display_coord_coffin { l } { vc } @@ -2163,12 +2155,12 @@ { \exp_last_unbraced:No \coffin_display_handles_aux:nnnn - \l_coffin_tmp_tl + \l_coffin_internal_tl } } { \exp_last_unbraced:No \coffin_display_handles_aux:nnnn - \l_coffin_tmp_tl + \l_coffin_internal_tl } } } @@ -2218,8 +2210,6 @@ % \end{macro} % % \begin{macro}{\coffin_show_structure:N, \coffin_show_structure:c} -% \begin{macro}[aux]{\coffin_show_aux:n} -% \begin{macro}[aux]{\coffin_show_aux:w} % For showing the various internal structures attached to a coffin in % a way that keeps things relatively readable. If there is no apparent % structure then the code complains. @@ -2228,40 +2218,21 @@ { \cs_if_exist:cTF { l_coffin_poles_ \int_value:w #1 _prop } { - \iow_term:x - { - \iow_newline: - Size~of~coffin~\token_to_str:N #1 : \iow_newline: - > ~ ht~=~\dim_use:N \box_ht:N #1 \iow_newline: - > ~ dp~=~\dim_use:N \box_dp:N #1 \iow_newline: - > ~ wd~=~\dim_use:N \box_wd:N #1 \iow_newline: - } - \iow_term:x { Poles~of~coffin~\token_to_str:N #1 : } - \tl_set:Nx \l_coffin_tmp_tl + \msg_aux_show:Nnx #1 { coffins } { \prop_map_function:cN { l_coffin_poles_ \int_value:w #1 _prop } - \coffin_show_aux:nn + \msg_aux_show_unbraced:nn } - \etex_showtokens:D \exp_after:wN \exp_after:wN \exp_after:wN - { \exp_after:wN \coffin_show_aux:w \l_coffin_tmp_tl } } { - \iow_term:x { ---~No~poles~found~--- } - \tl_show:n { Is~this~really~a~coffin? } + \msg_aux_use:nn { LaTeX / coffins } { no-pole } + \msg_aux_show:x { } } } -\cs_new:Npn \coffin_show_aux:nn #1#2 - { - \iow_newline: > \c_space_tl \c_space_tl - #1 \c_space_tl \c_space_tl => \c_space_tl \c_space_tl \exp_not:n {#2} - } -\cs_new:Npn \coffin_show_aux:w #1 > ~ { } \cs_generate_variant:Nn \coffin_show_structure:N { c } % \end{macrocode} % \end{macro} -% \end{macro} -% \end{macro} % % \subsection{Messages} % @@ -2284,6 +2255,19 @@ LaTeX~was~asked~to~find~a~typesetting~pole~for~a~coffin,~ but~either~the~coffin~does~not~exist~or~the~pole~name~is~wrong. } +\msg_kernel_new:nnn { coffins } { show } + { + Size~of~coffin~\token_to_str:N #1 : \\ + > ~ ht~=~\dim_use:N \box_ht:N #1 \\ + > ~ dp~=~\dim_use:N \box_dp:N #1 \\ + > ~ wd~=~\dim_use:N \box_wd:N #1 \\ + Poles~of~coffin~\token_to_str:N #1 : + } +\msg_kernel_new:nnn { coffins } { no-pole } + { + ---~No~poles~found~--- \\ + Is~this~really~a~coffin? + } % \end{macrocode} % % \begin{macrocode} |