diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3box.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3box.dtx | 73 |
1 files changed, 49 insertions, 24 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx index 0ae3b450f40..f7e6ad1f824 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx @@ -41,7 +41,7 @@ % }^^A % } % -% \date{Released 2018/03/05} +% \date{Released 2018-04-30} % % \maketitle % @@ -842,8 +842,27 @@ %<@@=box> % \end{macrocode} % -% The code in this module is very straight forward so I'm not going to -% comment it very extensively. +% \subsection{Support code} +% +% \begin{macro}{\@@_dim_eval:w} +% \begin{macro}{\@@_dim_eval:n} +% Evaluating a dimension expression expandably. The only +% difference with \cs{dim_eval:n} is the lack of \cs{dim_use:N}, to +% produce an internal dimension rather than expand it into characters. +% \begin{macrocode} +\cs_new_eq:NN \@@_dim_eval:w \etex_dimexpr:D +\__kernel_patch_args:nNNpn + { + { + \__kernel_chk_expr:nNnN {#1} + \@@_dim_eval:w { } \@@_dim_eval:n + } + } +\cs_new:Npn \@@_dim_eval:n #1 + { \@@_dim_eval:w #1 \scan_stop: } +% \end{macrocode} +% \end{macro} +% \end{macro} % % \subsection{Creating and initialising boxes} % @@ -856,7 +875,7 @@ %<*package> \cs_new_protected:Npn \box_new:N #1 { - \__chk_if_free_cs:N #1 + \__kernel_chk_if_free_cs:N #1 \cs:w newbox \cs_end: #1 } %</package> @@ -978,11 +997,11 @@ % parentheses to catch early termination. % \begin{macrocode} \cs_new_protected:Npn \box_set_dp:Nn #1#2 - { \box_dp:N #1 \__dim_eval:n {#2} } + { \box_dp:N #1 \@@_dim_eval:n {#2} } \cs_new_protected:Npn \box_set_ht:Nn #1#2 - { \box_ht:N #1 \__dim_eval:n {#2} } + { \box_ht:N #1 \@@_dim_eval:n {#2} } \cs_new_protected:Npn \box_set_wd:Nn #1#2 - { \box_wd:N #1 \__dim_eval:n {#2} } + { \box_wd:N #1 \@@_dim_eval:n {#2} } \cs_generate_variant:Nn \box_set_ht:Nn { c } \cs_generate_variant:Nn \box_set_dp:Nn { c } \cs_generate_variant:Nn \box_set_wd:Nn { c } @@ -1014,13 +1033,13 @@ % parentheses to catch early termination. % \begin{macrocode} \cs_new_protected:Npn \box_move_left:nn #1#2 - { \tex_moveleft:D \__dim_eval:n {#1} #2 } + { \tex_moveleft:D \@@_dim_eval:n {#1} #2 } \cs_new_protected:Npn \box_move_right:nn #1#2 - { \tex_moveright:D \__dim_eval:n {#1} #2 } + { \tex_moveright:D \@@_dim_eval:n {#1} #2 } \cs_new_protected:Npn \box_move_up:nn #1#2 - { \tex_raise:D \__dim_eval:n {#1} #2 } + { \tex_raise:D \@@_dim_eval:n {#1} #2 } \cs_new_protected:Npn \box_move_down:nn #1#2 - { \tex_lower:D \__dim_eval:n {#1} #2 } + { \tex_lower:D \@@_dim_eval:n {#1} #2 } % \end{macrocode} % \end{macro} % \end{macro} @@ -1200,7 +1219,10 @@ % \begin{macrocode} \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set:Nn #1#2 - { \tex_setbox:D #1 \tex_hbox:D { \color_group_begin: #2 \color_group_end: } } + { + \tex_setbox:D #1 \tex_hbox:D + { \color_group_begin: #2 \color_group_end: } + } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset:Nn #1#2 { @@ -1222,13 +1244,13 @@ \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3 { - \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} + \tex_setbox:D #1 \tex_hbox:D to \@@_dim_eval:n {#2} { \color_group_begin: #3 \color_group_end: } } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset_to_wd:Nnn #1#2#3 { - \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} + \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \@@_dim_eval:n {#2} { \color_group_begin: #3 \color_group_end: } } \cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c } @@ -1278,14 +1300,14 @@ \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \hbox_set_to_wd:Nnw #1#2 { - \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} + \tex_setbox:D #1 \tex_hbox:D to \@@_dim_eval:n {#2} \c_group_begin_token \color_group_begin: } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \hbox_gset_to_wd:Nnw #1#2 { - \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2} + \tex_global:D \tex_setbox:D #1 \tex_hbox:D to \@@_dim_eval:n {#2} \c_group_begin_token \color_group_begin: } @@ -1302,11 +1324,14 @@ % \begin{macrocode} \cs_new_protected:Npn \hbox_to_wd:nn #1#2 { - \tex_hbox:D to \__dim_eval:n {#1} + \tex_hbox:D to \@@_dim_eval:n {#1} { \color_group_begin: #2 \color_group_end: } } \cs_new_protected:Npn \hbox_to_zero:n #1 - { \tex_hbox:D to \c_zero_dim { \color_group_begin: #1 \color_group_end: } } + { + \tex_hbox:D to \c_zero_dim + { \color_group_begin: #1 \color_group_end: } + } % \end{macrocode} % \end{macro} % \end{macro} @@ -1362,7 +1387,7 @@ % \begin{macrocode} \cs_new_protected:Npn \vbox_to_ht:nn #1#2 { - \tex_vbox:D to \__dim_eval:n {#1} + \tex_vbox:D to \@@_dim_eval:n {#1} { \color_group_begin: #2 \color_group_end: } } \cs_new_protected:Npn \vbox_to_zero:n #1 @@ -1429,13 +1454,13 @@ \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3 { - \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} + \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} { \color_group_begin: #3 \color_group_end: } } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_to_ht:Nnn #1#2#3 { - \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} + \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} { \color_group_begin: #3 \color_group_end: } } \cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c } @@ -1485,14 +1510,14 @@ \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_to_ht:Nnw #1#2 { - \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} + \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} \c_group_begin_token \color_group_begin: } \__kernel_patch:nnNNpn { \__kernel_chk_var_global:N #1 } { } \cs_new_protected:Npn \vbox_gset_to_ht:Nnw #1#2 { - \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2} + \tex_global:D \tex_setbox:D #1 \tex_vbox:D to \@@_dim_eval:n {#2} \c_group_begin_token \color_group_begin: } @@ -1521,7 +1546,7 @@ % \begin{macrocode} \__kernel_patch:nnNNpn { \__kernel_chk_var_local:N #1 } { } \cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3 - { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:n {#3} } + { \tex_setbox:D #1 \tex_vsplit:D #2 to \@@_dim_eval:n {#3} } % \end{macrocode} % \end{macro} % |