diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx | 87 |
1 files changed, 33 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx index 8afac7cda1f..e5c2ab164f4 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3candidates.dtx @@ -35,7 +35,7 @@ %% % %<*driver|package> -\RequirePackage{l3names} +\RequirePackage{l3bootstrap} \GetIdInfo$Id: l3candidates.dtx 3633 2012-05-12 20:11:32Z joseph $ {L3 Experimental additions to l3kernel} %</driver|package> @@ -363,10 +363,7 @@ % \cs{coffin_resize:Nnn} \meta{coffin} \Arg{width} \Arg{total-height} % \end{syntax} % Resized the \meta{coffin} to \meta{width} and \meta{total-height}, -% both of which should be given as dimension expressions. These may -% include the terms \cs{TotalHeight}, \cs{Height}, \cs{Depth} and -% \cs{Width}, which will evaluate to the appropriate dimensions of -% the \meta{coffin}. +% both of which should be given as dimension expressions. % \end{function} % % \begin{function}{\coffin_rotate:Nn, \coffin_rotate:cn} @@ -398,6 +395,9 @@ % reading one or more lines (until an equal number of left and right % braces are found) from the \meta{stream}. The \meta{inline function} % should consist of code which will receive the \meta{line} as |#1|. +% Note that \TeX{} removes trailing space and tab characters +% (character codes 32 and 9) from every line upon input. \TeX{} also +% ignores any trailing new-line marker from the file it reads. % \end{function} % % \begin{function}[added = 2012-02-11]{\ior_str_map_inline:Nn} @@ -410,6 +410,9 @@ % exception of space characters which are given category code $10$ % (space). The \meta{inline function} should consist of code which % will receive the \meta{line} as |#1|. +% Note that \TeX{} removes trailing space and tab characters +% (character codes 32 and 9) from every line upon input. \TeX{} also +% ignores any trailing new-line marker from the file it reads. % \end{function} % % \begin{function}[added = 2012-06-29]{\ior_map_break:} @@ -1158,22 +1161,11 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_resize:Nnn #1#2#3 { - \dim_compare:nNnTF {#2} > \c_zero_dim - { \dim_set:Nn \l_@@_right_new_dim {#2} } - { \dim_set:Nn \l_@@_right_new_dim { \c_zero_dim - ( #2 ) } } - \dim_compare:nNnTF {#3} > \c_zero_dim - { - \dim_set:Nn \l_@@_top_new_dim - { \fp_use:N \l_@@_scale_y_fp \l_@@_top_dim } - \dim_set:Nn \l_@@_bottom_new_dim - { \fp_use:N \l_@@_scale_y_fp \l_@@_bottom_dim } - } - { - \dim_set:Nn \l_@@_top_new_dim - { - \fp_use:N \l_@@_scale_y_fp \l_@@_top_dim } - \dim_set:Nn \l_@@_bottom_new_dim - { - \fp_use:N \l_@@_scale_y_fp \l_@@_bottom_dim } - } + \dim_set:Nn \l_@@_right_new_dim { \dim_abs:n {#2} } + \dim_set:Nn \l_@@_bottom_new_dim + { \fp_abs:n { \l_@@_scale_y_fp } \l_@@_bottom_dim } + \dim_set:Nn \l_@@_top_new_dim + { \fp_abs:n { \l_@@_scale_y_fp } \l_@@_top_dim } \@@_resize_common:N #1 } % \end{macrocode} @@ -1230,13 +1222,12 @@ % \end{macro} % % \begin{macro}{\box_scale:Nnn, \box_scale:cnn} -% \begin{macro}[aux]{\@@_scale:Nnn} % When scaling a box, setting the scaling itself is easy enough. The % new dimensions are also relatively easy to find, allowing only for % the need to keep them positive in all cases. Once that is done then % after a check for the trivial scaling a hand-off can be made to the % common code. The dimension scaling operations are carried out using -% the \TeX{} mechanism as it avoids needing to use \texttt{fp} +% the \TeX{} mechanism as it avoids needing to use too many \texttt{fp} % operations. % \begin{macrocode} \cs_new_protected:Npn \box_scale:Nnn #1#2#3 @@ -1250,30 +1241,19 @@ \dim_set:Nn \l_@@_bottom_dim { -\box_dp:N #1 } \dim_set:Nn \l_@@_right_dim { \box_wd:N #1 } \dim_zero:N \l_@@_left_dim - \@@_scale:Nnn #1 {#2} {#3} + \dim_set:Nn \l_@@_top_new_dim + { \fp_abs:n { \l_@@_scale_y_fp } \l_@@_top_dim } + \dim_set:Nn \l_@@_bottom_new_dim + { \fp_abs:n { \l_@@_scale_y_fp } \l_@@_bottom_dim } + \dim_set:Nn \l_@@_right_new_dim + { \fp_abs:n { \l_@@_scale_x_fp } \l_@@_right_dim } + \@@_resize_common:N #1 \group_end: } } \cs_generate_variant:Nn \box_scale:Nnn { c } -\cs_new_protected:Npn \@@_scale:Nnn #1#2#3 - { - \fp_compare:nNnTF \l_@@_scale_y_fp > \c_zero_fp - { - \dim_set:Nn \l_@@_top_new_dim { #3 \l_@@_top_dim } - \dim_set:Nn \l_@@_bottom_new_dim { #3 \l_@@_bottom_dim } - } - { - \dim_set:Nn \l_@@_top_new_dim { -#3 \l_@@_bottom_dim } - \dim_set:Nn \l_@@_bottom_new_dim { -#3 \l_@@_top_dim } - } - \fp_compare:nNnTF \l_@@_scale_x_fp > \c_zero_fp - { \l_@@_right_new_dim #2 \l_@@_right_dim } - { \l_@@_right_new_dim -#2 \l_@@_right_dim } - \@@_resize_common:N #1 - } % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}[aux]{\@@_resize_common:N} % The main resize function places in input into a box which will start @@ -1970,12 +1950,13 @@ % \begin{macrocode} \cs_new_protected:Npn \coffin_resize:Nnn #1#2#3 { - \@@_set_user_dimensions:N #1 - \box_resize:Nnn #1 {#2} {#3} \fp_set:Nn \l_@@_scale_x_fp - { \dim_to_fp:n {#2} / \dim_to_fp:n \Width } + { \dim_to_fp:n {#2} / \dim_to_fp:n { \coffin_wd:N #1 } } \fp_set:Nn \l_@@_scale_y_fp - { \dim_to_fp:n {#3} / \dim_to_fp:n \TotalHeight } + { + \dim_to_fp:n {#3} / \dim_to_fp:n { \coffin_ht:N #1 + \coffin_dp:N #1 } + } + \box_resize:Nnn #1 {#2} {#3} \@@_resize_common:Nnn #1 {#2} {#3} } \cs_generate_variant:Nn \coffin_resize:Nnn { c } @@ -2003,7 +1984,6 @@ \prop_map_inline:cn { l_@@_poles_ \__int_value:w #1 _prop } { \@@_x_shift_pole:Nnnnnn #1 {##1} ##2 } } - \@@_end_user_dimensions: } % \end{macrocode} % \end{macro} @@ -2017,16 +1997,15 @@ % \begin{macrocode} \cs_new_protected:Npn \coffin_scale:Nnn #1#2#3 { - \box_scale:Nnn #1 {#2} {#3} - \@@_set_user_dimensions:N #1 \fp_set:Nn \l_@@_scale_x_fp {#2} \fp_set:Nn \l_@@_scale_y_fp {#3} - \fp_compare:nNnTF \l_@@_scale_y_fp > \c_zero_fp - { \l_@@_scaled_total_height_dim #3 \TotalHeight } - { \l_@@_scaled_total_height_dim -#3 \TotalHeight } - \fp_compare:nNnTF \l_@@_scale_x_fp > \c_zero_fp - { \l_@@_scaled_width_dim -#2 \Width } - { \l_@@_scaled_width_dim #2 \Width } + \box_scale:Nnn #1 { \l_@@_scale_x_fp } { \l_@@_scale_y_fp } + \dim_set:Nn \l_@@_internal_dim + { \coffin_ht:N #1 + \coffin_dp:N #1 } + \dim_set:Nn \l_@@_scaled_total_height_dim + { \fp_abs:n { \l_@@_scale_y_fp } \l_@@_internal_dim } + \dim_set:Nn \l_@@_scaled_width_dim + { -\fp_abs:n { \l_@@_scale_x_fp } \coffin_wd:N #1 } \@@_resize_common:Nnn #1 { \l_@@_scaled_width_dim } { \l_@@_scaled_total_height_dim } } |