summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3box.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3box.dtx169
1 files changed, 105 insertions, 64 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
index 74ed05fa0d5..4120bdc39b0 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3box.dtx
@@ -7,7 +7,7 @@
% license or (at your option) any later version. The latest version
% of this license is in the file
%
-% http://www.latex-project.org/lppl.txt
+% https://www.latex-project.org/lppl.txt
%
% This file is part of the "l3kernel bundle" (The Work in LPPL)
% and all files in that bundle must be distributed together.
@@ -21,7 +21,7 @@
% for those people who are interested.
%
%<*driver>
-\documentclass[full]{l3doc}
+\documentclass[full,kernel]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
@@ -41,7 +41,7 @@
% }^^A
% }
%
-% \date{Released 2017/11/14}
+% \date{Released 2017/12/05}
%
% \maketitle
%
@@ -901,10 +901,12 @@
% \testfile*
% Assigning the contents of a box to be another box.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \box_set_eq:NN #1#2
{ \tex_setbox:D #1 \tex_copy:D #2 }
-\cs_new_protected:Npn \box_gset_eq:NN
- { \tex_global:D \box_set_eq:NN }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \box_gset_eq:NN #1#2
+ { \tex_global:D \tex_setbox:D #1 \tex_copy:D #2 }
\cs_generate_variant:Nn \box_set_eq:NN { c , Nc , cc }
\cs_generate_variant:Nn \box_gset_eq:NN { c , Nc , cc }
% \end{macrocode}
@@ -926,10 +928,12 @@
% Assigning the contents of a box to be another box.
% This clears the second box globally (that's how \TeX{} does it).
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \box_set_eq_clear:NN #1#2
{ \tex_setbox:D #1 \tex_box:D #2 }
-\cs_new_protected:Npn \box_gset_eq_clear:NN
- { \tex_global:D \box_set_eq_clear:NN }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \box_gset_eq_clear:NN #1#2
+ { \tex_global:D \tex_setbox:D #1 \tex_box:D #2 }
\cs_generate_variant:Nn \box_set_eq_clear:NN { c , Nc , cc }
\cs_generate_variant:Nn \box_gset_eq_clear:NN { c , Nc , cc }
% \end{macrocode}
@@ -973,15 +977,12 @@
% When debugging, the dimension expression |#2| is surrounded by
% parentheses to catch early termination.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
\cs_new_protected:Npn \box_set_dp:Nn #1#2
- { \box_dp:N #1 \__dim_eval:w #2 \__dim_eval_end: }
-\__debug_patch_args:nNNpn { {#1} { (#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:w #2 \__dim_eval_end: }
-\__debug_patch_args:nNNpn { {#1} { (#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:w #2 \__dim_eval_end: }
+ { \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 }
@@ -1012,18 +1013,14 @@
% When debugging, the dimension expression |#1| is surrounded by
% parentheses to catch early termination.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
\cs_new_protected:Npn \box_move_left:nn #1#2
- { \tex_moveleft:D \__dim_eval:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#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:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#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:w #1 \__dim_eval_end: #2 }
-\__debug_patch_args:nNNpn { { (#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:w #1 \__dim_eval_end: #2 }
+ { \tex_lower:D \__dim_eval:n {#1} #2 }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1087,10 +1084,12 @@
% \testfile*
% Set a box to the previous box.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \box_set_to_last:N #1
{ \tex_setbox:D #1 \tex_lastbox:D }
-\cs_new_protected:Npn \box_gset_to_last:N
- { \tex_global:D \box_set_to_last:N }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \box_gset_to_last:N #1
+ { \tex_global:D \tex_setbox:D #1 \tex_lastbox:D }
\cs_generate_variant:Nn \box_set_to_last:N { c }
\cs_generate_variant:Nn \box_gset_to_last:N { c }
% \end{macrocode}
@@ -1142,7 +1141,7 @@
%
% \begin{macro}{\box_log:N, \box_log:c}
% \begin{macro}{\box_log:Nnn, \box_log:cnn}
-% \begin{macro}[aux]{\@@_log:nNnn}
+% \begin{macro}{\@@_log:nNnn}
% Getting \TeX{} to write to the log without interruption the run is done by
% altering the interaction mode. For that, the \eTeX{} extensions are needed.
% \begin{macrocode}
@@ -1163,7 +1162,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[aux]{\@@_show:NNnn, \@@_show:NNff}
+% \begin{macro}{\@@_show:NNnn, \@@_show:NNff}
% The internal auxiliary to actually do the output uses a group to deal
% with breadth and depth values. The \cs{use:n} here gives better output
% appearance. Setting \tn{tracingonline} and \tn{errorcontextlines} is
@@ -1205,9 +1204,12 @@
% \begin{macro}{\hbox_gset:Nn, \hbox_gset:cn}
% \testfile*
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \hbox_set:Nn #1#2
{ \tex_setbox:D #1 \tex_hbox:D { \group_begin: #2 \group_end: } }
-\cs_new_protected:Npn \hbox_gset:Nn { \tex_global:D \hbox_set:Nn }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \hbox_gset:Nn #1#2
+ { \tex_global:D \tex_setbox:D #1 \tex_hbox:D { \group_begin: #2 \group_end: } }
\cs_generate_variant:Nn \hbox_set:Nn { c }
\cs_generate_variant:Nn \hbox_gset:Nn { c }
% \end{macrocode}
@@ -1220,14 +1222,18 @@
% Storing material in a horizontal box with a specified width.
% Again, put the dimension expression in parentheses when debugging.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_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:w #2 \__dim_eval_end:
+ \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
+ { \group_begin: #3 \group_end: }
+ }
+\__debug_patch:nnNNpn { \__debug_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}
{ \group_begin: #3 \group_end: }
}
-\cs_new_protected:Npn \hbox_gset_to_wd:Nnn
- { \tex_global:D \hbox_set_to_wd:Nnn }
\cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c }
\cs_generate_variant:Nn \hbox_gset_to_wd:Nnn { c }
% \end{macrocode}
@@ -1241,14 +1247,20 @@
% Storing material in a horizontal box. This type is useful in
% environment definitions.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \hbox_set:Nw #1
{
\tex_setbox:D #1 \tex_hbox:D
\c_group_begin_token
\group_begin:
}
-\cs_new_protected:Npn \hbox_gset:Nw
- { \tex_global:D \hbox_set:Nw }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \hbox_gset:Nw #1
+ {
+ \tex_global:D \tex_setbox:D #1 \tex_hbox:D
+ \c_group_begin_token
+ \group_begin:
+ }
\cs_generate_variant:Nn \hbox_set:Nw { c }
\cs_generate_variant:Nn \hbox_gset:Nw { c }
\cs_new_protected:Npn \hbox_set_end:
@@ -1266,15 +1278,20 @@
% \begin{macro}{\hbox_gset_to_wd:Nnw, \hbox_gset_to_wd:cnw}
% Combining the above ideas.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_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:w #2 \__dim_eval_end:
+ \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:n {#2}
+ \c_group_begin_token
+ \group_begin:
+ }
+\__debug_patch:nnNNpn { \__debug_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}
\c_group_begin_token
\group_begin:
}
-\cs_new_protected:Npn \hbox_gset_to_wd:Nnw
- { \tex_global:D \hbox_set_to_wd:Nnw }
\cs_generate_variant:Nn \hbox_set_to_wd:Nnw { c }
\cs_generate_variant:Nn \hbox_gset_to_wd:Nnw { c }
% \end{macrocode}
@@ -1286,10 +1303,9 @@
% \testfile*
% Put a horizontal box directly into the input stream.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
\cs_new_protected:Npn \hbox_to_wd:nn #1#2
{
- \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end:
+ \tex_hbox:D to \__dim_eval:n {#1}
{ \group_begin: #2 \group_end: }
}
\cs_new_protected:Npn \hbox_to_zero:n #1
@@ -1347,10 +1363,9 @@
% \testfile*
% Put a vertical box directly into the input stream.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { { (#1) } {#2} }
\cs_new_protected:Npn \vbox_to_ht:nn #1#2
{
- \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end:
+ \tex_vbox:D to \__dim_eval:n {#1}
{ \group_begin: #2 \par \group_end: }
}
\cs_new_protected:Npn \vbox_to_zero:n #1
@@ -1367,12 +1382,18 @@
% \testfile*
% Storing material in a vertical box with a natural height.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \vbox_set:Nn #1#2
{
\tex_setbox:D #1 \tex_vbox:D
{ \group_begin: #2 \par \group_end: }
}
-\cs_new_protected:Npn \vbox_gset:Nn { \tex_global:D \vbox_set:Nn }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \vbox_gset:Nn #1#2
+ {
+ \tex_global:D \tex_setbox:D #1 \tex_vbox:D
+ { \group_begin: #2 \par \group_end: }
+ }
\cs_generate_variant:Nn \vbox_set:Nn { c }
\cs_generate_variant:Nn \vbox_gset:Nn { c }
% \end{macrocode}
@@ -1385,13 +1406,18 @@
% Storing material in a vertical box with a natural height and reference
% point at the baseline of the first object in the box.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \vbox_set_top:Nn #1#2
{
\tex_setbox:D #1 \tex_vtop:D
{ \group_begin: #2 \par \group_end: }
}
-\cs_new_protected:Npn \vbox_gset_top:Nn
- { \tex_global:D \vbox_set_top:Nn }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \vbox_gset_top:Nn #1#2
+ {
+ \tex_global:D \tex_setbox:D #1 \tex_vtop:D
+ { \group_begin: #2 \par \group_end: }
+ }
\cs_generate_variant:Nn \vbox_set_top:Nn { c }
\cs_generate_variant:Nn \vbox_gset_top:Nn { c }
% \end{macrocode}
@@ -1403,14 +1429,18 @@
% \testfile*
% Storing material in a vertical box with a specified height.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } {#3} }
+\__debug_patch:nnNNpn { \__debug_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:w #2 \__dim_eval_end:
+ \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
+ { \group_begin: #3 \par \group_end: }
+ }
+\__debug_patch:nnNNpn { \__debug_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}
{ \group_begin: #3 \par \group_end: }
}
-\cs_new_protected:Npn \vbox_gset_to_ht:Nnn
- { \tex_global:D \vbox_set_to_ht:Nnn }
\cs_generate_variant:Nn \vbox_set_to_ht:Nnn { c }
\cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c }
% \end{macrocode}
@@ -1424,14 +1454,20 @@
% Storing material in a vertical box. This type is useful in
% environment definitions.
% \begin{macrocode}
+\__debug_patch:nnNNpn { \__debug_chk_var_local:N #1 } { }
\cs_new_protected:Npn \vbox_set:Nw #1
{
\tex_setbox:D #1 \tex_vbox:D
\c_group_begin_token
\group_begin:
}
-\cs_new_protected:Npn \vbox_gset:Nw
- { \tex_global:D \vbox_set:Nw }
+\__debug_patch:nnNNpn { \__debug_chk_var_global:N #1 } { }
+\cs_new_protected:Npn \vbox_gset:Nw #1
+ {
+ \tex_global:D \tex_setbox:D #1 \tex_vbox:D
+ \c_group_begin_token
+ \group_begin:
+ }
\cs_generate_variant:Nn \vbox_set:Nw { c }
\cs_generate_variant:Nn \vbox_gset:Nw { c }
\cs_new_protected:Npn \vbox_set_end:
@@ -1450,15 +1486,20 @@
% \begin{macro}{\vbox_gset_to_ht:Nnw, \vbox_gset_to_ht:cnw}
% A combination of the above ideas.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} { (#2) } }
+\__debug_patch:nnNNpn { \__debug_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:w #2 \__dim_eval_end:
+ \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:n {#2}
+ \c_group_begin_token
+ \group_begin:
+ }
+\__debug_patch:nnNNpn { \__debug_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}
\c_group_begin_token
\group_begin:
}
-\cs_new_protected:Npn \vbox_gset_to_ht:Nnw
- { \tex_global:D \vbox_set_to_ht:Nnw }
\cs_generate_variant:Nn \vbox_set_to_ht:Nnw { c }
\cs_generate_variant:Nn \vbox_gset_to_ht:Nnw { c }
% \end{macrocode}
@@ -1482,9 +1523,9 @@
% \testfile*
% Splitting a vertical box in two.
% \begin{macrocode}
-\__debug_patch_args:nNNpn { {#1} {#2} { (#3) } }
+\__debug_patch:nnNNpn { \__debug_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:w #3 \__dim_eval_end: }
+ { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:n {#3} }
% \end{macrocode}
% \end{macro}
%
@@ -1543,9 +1584,9 @@
% \end{variable}
%
% \begin{macro}{\box_rotate:Nn}
-% \begin{macro}[aux]{\@@_rotate:N}
-% \begin{macro}[aux]{\@@_rotate_x:nnN, \@@_rotate_y:nnN}
-% \begin{macro}[aux]
+% \begin{macro}{\@@_rotate:N}
+% \begin{macro}{\@@_rotate_x:nnN, \@@_rotate_y:nnN}
+% \begin{macro}
% {
% \@@_rotate_quadrant_one:, \@@_rotate_quadrant_two:,
% \@@_rotate_quadrant_three:, \@@_rotate_quadrant_four:
@@ -1756,9 +1797,9 @@
%
% \begin{macro}
% {\box_resize_to_wd_and_ht_plus_dp:Nnn, \box_resize_to_wd_and_ht_plus_dp:cnn}
-% \begin{macro}[aux]{\@@_resize_set_corners:N}
-% \begin{macro}[aux]{\@@_resize:N}
-% \begin{macro}[aux]{\@@_resize:NNN}
+% \begin{macro}{\@@_resize_set_corners:N}
+% \begin{macro}{\@@_resize:N}
+% \begin{macro}{\@@_resize:NNN}
% Resizing a box starts by working out the various dimensions of the
% existing box.
% \begin{macrocode}
@@ -1899,7 +1940,7 @@
% \end{macro}
%
% \begin{macro}{\box_scale:Nnn, \box_scale:cnn}
-% \begin{macro}[aux]{\@@_scale_aux:N}
+% \begin{macro}{\@@_scale_aux:N}
% 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
@@ -1942,7 +1983,7 @@
% \box_autosize_to_wd_and_ht_plus_dp:cnn ,
% \box_autosize_to_wd_and_ht_plus_dp:Nnn
% }
-% \begin{macro}[aux]{\@@_autosize:Nnnn}
+% \begin{macro}{\@@_autosize:Nnnn}
% Although autosizing a box uses dimensions, it has more in common in
% implementation with scaling. As such, most of the real work here is
% done elsewhere.
@@ -1969,7 +2010,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[aux]{\@@_resize_common:N}
+% \begin{macro}{\@@_resize_common:N}
% The main resize function places its input into a box which start
% off with zero width, and includes the handles for engine rescaling.
% \begin{macrocode}