From 215b9a864d5829070bdc66ba736986eb72e5143e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 9 Jun 2009 23:31:15 +0000 Subject: expl3 1407 (9jun09) git-svn-id: svn://tug.org/texlive/trunk@13686 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/expl3/l3box.sty | 212 +++++++++++++++------------- 1 file changed, 113 insertions(+), 99 deletions(-) (limited to 'Master/texmf-dist/tex/latex/expl3/l3box.sty') diff --git a/Master/texmf-dist/tex/latex/expl3/l3box.sty b/Master/texmf-dist/tex/latex/expl3/l3box.sty index be463eacf81..7f790646251 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3box.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3box.sty @@ -15,7 +15,7 @@ %% Do not distribute a modified version of this file. %% %% -%% File: l3box.dtx Copyright (C) 2005-2007 LaTeX3 project +%% File: l3box.dtx Copyright (C) 2005-2009 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 @@ -33,7 +33,7 @@ %% %% The development version of the bundle can be found at %% -%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/ +%% http://www.latex-project.org/svnroot/experimental/trunk/ %% %% for those people who are interested. %% @@ -48,111 +48,125 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3box.dtx 718 2007-12-16 22:59:58Z morten $ +\GetIdInfo$Id: l3box.dtx 1375 2009-06-01 12:28:52Z joseph $ {L3 Experimental Box module} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{l3prg,l3token}\par -\let_new:NN \box_new:N \newbox -\def_new:Npn \box_new:c {\exp_args:Nc \box_new:N} -\let_new:NN \if_hbox:N \tex_ifhbox:D -\let_new:NN \if_vbox:N \tex_ifvbox:D -\let_new:NN \if_box_empty:N \tex_ifvoid:D -\def_new:Npn \box_if_empty_p:N #1{ - \if_box_empty:N #1 \c_true \else: \c_false \fi:} -\def_new:Npn \box_if_empty_p:c {\exp_args:Nc \box_if_empty_p:N} -\def_test_function_new:npn {box_if_empty:N}#1{\if_box_empty:N #1} -\def_new:Npn \box_if_empty:cTF {\exp_args:Nc \box_if_empty:NTF} -\def_new:Npn \box_if_empty:cT {\exp_args:Nc \box_if_empty:NT} -\def_new:Npn \box_if_empty:cF {\exp_args:Nc \box_if_empty:NF} -\def_new:Npn \box_set_eq:NN #1#2 {\tex_setbox:D #1 \tex_box:D #2} -\def_new:Npn \box_set_eq:cN {\exp_args:Nc \box_set_eq:NN} -\def_new:Npn \box_set_eq:Nc {\exp_args:NNc \box_set_eq:NN} -\def_new:Npn \box_set_eq:cc {\exp_args:Ncc \box_set_eq:NN} -\def_new:Npn \box_gset_eq:NN {\pref_global:D\box_set_eq:NN} -\def_new:Npn \box_gset_eq:cN {\exp_args:Nc \box_gset_eq:NN} -\def_new:Npn \box_gset_eq:Nc {\exp_args:NNc \box_gset_eq:NN} -\def_new:Npn \box_gset_eq:cc {\exp_args:Ncc \box_gset_eq:NN} -\let_new:NN \R_last_box \tex_lastbox:D -\def_new:Npn \box_set_to_last:N #1{\tex_setbox:D#1\R_last_box} -\def_new:Npn \box_set_to_last:c {\exp_args:Nc \box_set_to_last:N} -\def_new:Npn \box_gset_to_last:N {\pref_global:D \box_set_to_last:N} -\def_new:Npn \box_gset_to_last:c {\exp_args:Nc \box_gset_to_last:N} -\def_long_new:Npn \box_move_left:nn #1#2{\tex_moveleft:D\dim_eval:n{#1}{#2}} -\def_long_new:Npn \box_move_right:nn #1#2{\tex_moveright:D\dim_eval:n{#1}{#2}} -\def_long_new:Npn \box_move_up:nn #1#2{\tex_raise:D\dim_eval:n{#1}{#2}} -\def_long_new:Npn \box_move_down:nn #1#2{\tex_lower:D\dim_eval:n{#1}{#2}} -\def_new:Npn \box_clear:N #1{\box_set_eq:NN #1 \c_empty_box } -\def_new:Npn \box_clear:c {\exp_args:Nc \box_clear:N } -\def_new:Npn \box_gclear:N {\pref_global:D\box_clear:N} -\def_new:Npn \box_gclear:c {\exp_args:Nc \box_gclear:c } -\let_new:NN \box_ht:N \tex_ht:D -\def_new:Npn \box_ht:c {\exp_args:Nc \box_ht:N} -\let_new:NN \box_dp:N \tex_dp:D -\def_new:Npn \box_dp:c {\exp_args:Nc \box_dp:N} -\let_new:NN \box_wd:N \tex_wd:D -\def_new:Npn \box_wd:c {\exp_args:Nc \box_wd:N} -\let_new:NN \box_use_clear:N \tex_box:D -\def_new:Npn \box_use_clear:c {\exp_args:Nc \box_use_clear:N} -\let_new:NN \box_use:N \tex_copy:D -\def_new:Npn \box_use:c {\exp_args:Nc \box_use:N} -\let:NN \box_show:N \tex_showbox:D -\def_new:Npn \box_show:c {\exp_args:Nc \box_show:N} -\let:NN \c_empty_box \voidb@x -\let_new:NN \l_tmpa_box \@tempboxa +\package_check_loaded_expl: +\cs_new:Npn \box_new:N #1 { + \chk_if_free_cs:N #1 + \newbox #1 +} +\cs_generate_variant:Nn \box_new:N {c} +\cs_new_eq:NN \if_hbox:N \tex_ifhbox:D +\cs_new_eq:NN \if_vbox:N \tex_ifvbox:D +\cs_new_eq:NN \if_box_empty:N \tex_ifvoid:D +\prg_new_conditional:Nnn \box_if_horizontal:N {p,TF,T,F} { + \tex_ifhbox:D #1 \prg_return_true: \else: \prg_return_false: \fi: +} +\prg_new_conditional:Nnn \box_if_vertical:N {p,TF,T,F} { + \tex_ifvbox:D #1 \prg_return_true: \else: \prg_return_false: \fi: +} +\cs_generate_variant:Nn \box_if_horizontal_p:N {c} +\cs_generate_variant:Nn \box_if_horizontal:NTF {c} +\cs_generate_variant:Nn \box_if_horizontal:NT {c} +\cs_generate_variant:Nn \box_if_horizontal:NF {c} +\cs_generate_variant:Nn \box_if_vertical_p:N {c} +\cs_generate_variant:Nn \box_if_vertical:NTF {c} +\cs_generate_variant:Nn \box_if_vertical:NT {c} +\cs_generate_variant:Nn \box_if_vertical:NF {c} +\prg_new_conditional:Nnn \box_if_empty:N {p,TF,T,F} { + \tex_ifvoid:D #1 \prg_return_true: \else: \prg_return_false: \fi: +} +\cs_generate_variant:Nn \box_if_empty_p:N {c} +\cs_generate_variant:Nn \box_if_empty:NTF {c} +\cs_generate_variant:Nn \box_if_empty:NT {c} +\cs_generate_variant:Nn \box_if_empty:NF {c} +\cs_new_nopar:Npn \box_set_eq:NN #1#2 {\tex_setbox:D #1 \tex_box:D #2} +\cs_generate_variant:Nn \box_set_eq:NN {cN,Nc,cc} +\cs_new_nopar:Npn \box_gset_eq:NN {\pref_global:D\box_set_eq:NN} +\cs_generate_variant:Nn \box_gset_eq:NN {cN,Nc,cc} +\cs_new_eq:NN \l_last_box \tex_lastbox:D +\cs_new_nopar:Npn \box_set_to_last:N #1{\tex_setbox:D#1\l_last_box} +\cs_generate_variant:Nn \box_set_to_last:N {c} +\cs_new_nopar:Npn \box_gset_to_last:N {\pref_global:D \box_set_to_last:N} +\cs_generate_variant:Nn \box_gset_to_last:N {c} +\cs_new:Npn \box_move_left:nn #1#2{\tex_moveleft:D\dim_eval:n{#1}{#2}} +\cs_new:Npn \box_move_right:nn #1#2{\tex_moveright:D\dim_eval:n{#1}{#2}} +\cs_new:Npn \box_move_up:nn #1#2{\tex_raise:D\dim_eval:n{#1}{#2}} +\cs_new:Npn \box_move_down:nn #1#2{\tex_lower:D\dim_eval:n{#1}{#2}} +\cs_new_nopar:Npn \box_clear:N #1{\box_set_eq:NN #1 \c_empty_box } +\cs_generate_variant:Nn \box_clear:N {c} +\cs_new_nopar:Npn \box_gclear:N {\pref_global:D\box_clear:N} +\cs_generate_variant:Nn \box_gclear:N {c} +\cs_new_eq:NN \box_ht:N \tex_ht:D +\cs_new_eq:NN \box_dp:N \tex_dp:D +\cs_new_eq:NN \box_wd:N \tex_wd:D +\cs_generate_variant:Nn \box_ht:N {c} +\cs_generate_variant:Nn \box_dp:N {c} +\cs_generate_variant:Nn \box_wd:N {c} +\cs_new_eq:NN \box_use_clear:N \tex_box:D +\cs_generate_variant:Nn \box_use_clear:N {c} +\cs_new_eq:NN \box_use:N \tex_copy:D +\cs_generate_variant:Nn \box_use:N {c} +\cs_set_eq:NN \box_show:N \tex_showbox:D +\cs_generate_variant:Nn \box_show:N {c} +\cs_set_eq:NN \c_empty_box \voidb@x +\cs_new_eq:NN \l_tmpa_box \@tempboxa \box_new:N \l_tmpb_box -\def_new:Npn \vbox:n {\tex_vbox:D \scan_stop:} -\def_long_new:Npn \vbox_set:Nn #1#2 {\tex_setbox:D #1 \tex_vbox:D {#2}} -\def_new:Npn \vbox_set:cn {\exp_args:Nc \vbox_set:Nn} -\def_new:Npn \vbox_gset:Nn {\pref_global:D \vbox_set:Nn} -\def_new:Npn \vbox_gset:cn {\exp_args:Nc \vbox_gset:Nn} -\def_long_new:Npn \vbox_set_to_ht:Nnn #1#2#3 { - \tex_setbox:D #1 \tex_vbox:D to #2 {#3}} -\def_new:Npn \vbox_set_to_ht:cnn{\exp_args:Nc \vbox_set_to_ht:Nnn } -\def_new:Npn \vbox_gset_to_ht:Nnn {\pref_global:D \vbox_set_to_ht:Nnn } -\def_new:Npn \vbox_gset_to_ht:cnn{\exp_args:Nc \vbox_gset_to_ht:Nnn } -\def_new:Npn \vbox_gset_to_ht:ccn {\exp_args:Ncc \vbox_gset_to_ht:Nnn} -\def_new:Npn \vbox_set_inline_begin:N #1 { +\cs_new_nopar:Npn \vbox:n {\tex_vbox:D \scan_stop:} +\cs_new:Npn \vbox_set:Nn #1#2 {\tex_setbox:D #1 \tex_vbox:D {#2}} +\cs_generate_variant:Nn \vbox_set:Nn {cn} +\cs_new_nopar:Npn \vbox_gset:Nn {\pref_global:D \vbox_set:Nn} +\cs_generate_variant:Nn \vbox_gset:Nn {cn} +\cs_new:Npn \vbox_set_to_ht:Nnn #1#2#3 { + \tex_setbox:D #1 \tex_vbox:D to #2 {#3} +} +\cs_generate_variant:Nn \vbox_set_to_ht:Nnn {cnn} +\cs_new_nopar:Npn \vbox_gset_to_ht:Nnn { \pref_global:D \vbox_set_to_ht:Nnn } +\cs_generate_variant:Nn \vbox_gset_to_ht:Nnn {cnn,ccn} +\cs_new_nopar:Npn \vbox_set_inline_begin:N #1 { \tex_setbox:D #1 \tex_vbox:D \c_group_begin_token } -\let_new:NN \vbox_set_inline_end: \c_group_end_token -\def_new:Npn \vbox_gset_inline_begin:N { +\cs_new_eq:NN \vbox_set_inline_end: \c_group_end_token +\cs_new_nopar:Npn \vbox_gset_inline_begin:N { \pref_global:D \vbox_set_inline_begin:N } -\let_new:NN \vbox_gset_inline_end: \c_group_end_token -\def_long_new:Npn \vbox_to_ht:nn #1#2{\tex_vbox:D to \dim_eval:n{#1}{#2}} -\def_long_new:Npn \vbox_to_zero:n #1 {\tex_vbox:D to \c_zero_dim {#1}} -\def_new:Npn \vbox_set_split_to_ht:NNn #1#2#3{ +\cs_new_eq:NN \vbox_gset_inline_end: \c_group_end_token +\cs_new:Npn \vbox_to_ht:nn #1#2{\tex_vbox:D to \dim_eval:n{#1}{#2}} +\cs_new:Npn \vbox_to_zero:n #1 {\tex_vbox:D to \c_zero_dim {#1}} +\cs_new_nopar:Npn \vbox_set_split_to_ht:NNn #1#2#3{ \tex_setbox:D #1 \tex_vsplit:D #2 to #3 } -\let_new:NN \vbox_unpack:N \tex_unvcopy:D -\def_new:Npn \vbox_unpack:c {\exp_args:Nc \vbox_unpack:N} -\let_new:NN \vbox_unpack_clear:N \tex_unvbox:D -\def_new:Npn \vbox_unpack_clear:c {\exp_args:Nc \vbox_unpack_clear:N} -\def_new:Npn \hbox:n {\tex_hbox:D \scan_stop:} -\def_long_new:Npn \hbox_set:Nn #1#2 {\tex_setbox:D #1 \tex_hbox:D {#2}} -\def_new:Npn \hbox_set:cn {\exp_args:Nc \hbox_set:Nn} -\def_new:Npn \hbox_gset:Nn {\pref_global:D \hbox_set:Nn} -\def_new:Npn \hbox_gset:cn {\exp_args:Nc \hbox_gset:Nn} -\def_long_new:Npn \hbox_set_to_wd:Nnn #1#2#3 { - \tex_setbox:D #1 \tex_hbox:D to \dim_eval:n{#2} {#3}} -\def_new:Npn \hbox_set_to_wd:cnn{\exp_args:Nc \hbox_set_to_wd:Nnn } -\def_new:Npn \hbox_gset_to_wd:Nnn {\pref_global:D \hbox_set_to_wd:Nnn } -\def_new:Npn \hbox_gset_to_wd:cnn{\exp_args:Nc \hbox_gset_to_wd:Nnn } -\def_new:Npn \hbox_set_inline_begin:N #1 { - \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token } -\def:Npn \hbox_set_inline_begin:c {\exp_args:Nc - \hbox_set_inline_begin:N} -\let_new:NN \hbox_set_inline_end: \c_group_end_token -\def_new:Npn \hbox_gset_inline_begin:N { - \pref_global:D \hbox_set_inline_begin:N } -\def:Npn \hbox_gset_inline_begin:c {\exp_args:Nc - \hbox_gset_inline_begin:N } -\let_new:NN \hbox_gset_inline_end: \c_group_end_token -\def_long_new:Npn \hbox_to_wd:nn #1#2 {\tex_hbox:D to #1 {#2}} -\def_long_new:Npn \hbox_to_zero:n #1 {\tex_hbox:D to \c_zero_skip {#1}} -\let_new:NN \hbox_unpack:N \tex_unhcopy:D -\def_new:Npn \hbox_unpack:c {\exp_args:Nc \hbox_unpack:N} -\let_new:NN \hbox_unpack_clear:N \tex_unhbox:D -\def_new:Npn \hbox_unpack_clear:c {\exp_args:Nc \hbox_unpack_clear:N} +\cs_new_eq:NN \vbox_unpack:N \tex_unvcopy:D +\cs_generate_variant:Nn \vbox_unpack:N {c} +\cs_new_eq:NN \vbox_unpack_clear:N \tex_unvbox:D +\cs_generate_variant:Nn \vbox_unpack_clear:N {c} +\cs_new_nopar:Npn \hbox:n {\tex_hbox:D \scan_stop:} +\cs_new:Npn \hbox_set:Nn #1#2 {\tex_setbox:D #1 \tex_hbox:D {#2}} +\cs_generate_variant:Nn \hbox_set:Nn {cn} +\cs_new_nopar:Npn \hbox_gset:Nn {\pref_global:D \hbox_set:Nn} +\cs_generate_variant:Nn \hbox_gset:Nn {cn} +\cs_new:Npn \hbox_set_to_wd:Nnn #1#2#3 { + \tex_setbox:D #1 \tex_hbox:D to \dim_eval:n{#2} {#3} +} +\cs_generate_variant:Nn \hbox_set_to_wd:Nnn {cnn} +\cs_new_nopar:Npn \hbox_gset_to_wd:Nnn {\pref_global:D \hbox_set_to_wd:Nnn } +\cs_generate_variant:Nn \hbox_gset_to_wd:Nnn {cnn} +\cs_new_nopar:Npn \hbox_set_inline_begin:N #1 { + \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token +} +\cs_generate_variant:Nn \hbox_set_inline_begin:N {c} +\cs_new_eq:NN \hbox_set_inline_end: \c_group_end_token +\cs_new_nopar:Npn \hbox_gset_inline_begin:N { + \pref_global:D \hbox_set_inline_begin:N +} +\cs_generate_variant:Nn \hbox_gset_inline_begin:N {c} +\cs_new_eq:NN \hbox_gset_inline_end: \c_group_end_token +\cs_new:Npn \hbox_to_wd:nn #1#2 {\tex_hbox:D to #1 {#2}} +\cs_new:Npn \hbox_to_zero:n #1 {\tex_hbox:D to \c_zero_skip {#1}} +\cs_new_eq:NN \hbox_unpack:N \tex_unhcopy:D +\cs_generate_variant:Nn \hbox_unpack:N {c} +\cs_new_eq:NN \hbox_unpack_clear:N \tex_unhbox:D +\cs_generate_variant:Nn \hbox_unpack_clear:N {c} %% %% %% End of file `l3box.sty'. -- cgit v1.2.3