diff options
author | Karl Berry <karl@freefriends.org> | 2009-06-09 23:31:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-06-09 23:31:15 +0000 |
commit | 215b9a864d5829070bdc66ba736986eb72e5143e (patch) | |
tree | fe0882c81fc4ec945cee4b512f72eaa21ea5f791 /Master/texmf-dist/tex/latex/expl3/l3skip.sty | |
parent | df90ec06321940c2f066b05e12f1b5ab099105da (diff) |
expl3 1407 (9jun09)
git-svn-id: svn://tug.org/texlive/trunk@13686 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/expl3/l3skip.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/expl3/l3skip.sty | 224 |
1 files changed, 108 insertions, 116 deletions
diff --git a/Master/texmf-dist/tex/latex/expl3/l3skip.sty b/Master/texmf-dist/tex/latex/expl3/l3skip.sty index 588bcb9f88b..53462fcaea7 100644 --- a/Master/texmf-dist/tex/latex/expl3/l3skip.sty +++ b/Master/texmf-dist/tex/latex/expl3/l3skip.sty @@ -15,7 +15,7 @@ %% Do not distribute a modified version of this file. %% %% -%% File: l3skip.dtx Copyright (C) 2005-2007 Frank Mittelbach, LaTeX3 project +%% File: l3skip.dtx Copyright (C) 2005-2008 Frank Mittelbach, 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,67 +48,78 @@ %% %% ----------------------------------------------------------------------- \RequirePackage{l3names} -\GetIdInfo$Id: l3skip.dtx 666 2007-09-27 15:53:26Z mittelba $ +\GetIdInfo$Id: l3skip.dtx 1362 2009-05-28 20:19:21Z joseph $ {L3 Experimental skip registers} \ProvidesExplPackage {\filename}{\filedate}{\fileversion}{\filedescription} -\RequirePackage{l3int} -\RequirePackage{l3prg} -\let:NN \skip_new:N \newskip -\def_new:Npn \skip_new:c {\exp_args:Nc \skip_new:N} -\def_new:Npn \skip_set:Nn #1#2{#1\skip_eval:n{#2} +\package_check_loaded_expl: +\cs_new_nopar:Npn \skip_new:N #1 { + \chk_if_free_cs:N #1 + \newskip #1 } -\def_new:Npn \skip_gset:Nn { +\cs_generate_variant:Nn \skip_new:N {c} +\cs_new_nopar:Npn \skip_set:Nn #1#2 { + #1\skip_eval:n{#2} +} +\cs_new_nopar:Npn \skip_gset:Nn { \pref_global:D - \skip_set:Nn } -\def_new:Npn \skip_set:cn {\exp_args:Nc \skip_set:Nn } -\def_new:Npn \skip_gset:cn {\exp_args:Nc \skip_gset:Nn } -\def_new:Npn \skip_zero:N #1{#1\c_zero_skip \scan_stop: + \skip_set:Nn +} +\cs_generate_variant:Nn \skip_set:Nn {cn} +\cs_generate_variant:Nn \skip_gset:Nn {cn} +\cs_new_nopar:Npn \skip_zero:N #1{ + #1\c_zero_skip \scan_stop: } -\def_new:Npn \skip_gzero:N { +\cs_new_nopar:Npn \skip_gzero:N { \pref_global:D - \skip_zero:N} -\def_new:Npn \skip_zero:c {\exp_args:Nc \skip_zero:N} -\def_new:Npn \skip_gzero:c {\exp_args:Nc \skip_gzero:N} -\def_new:Npn \skip_add:Nn #1#2{ - \tex_advance:D#1 by \skip_eval:n{#2} + \skip_zero:N } -\def_new:Npn\skip_add:cn{\exp_args:Nc\skip_add:Nn} -\def_new:Npn \skip_sub:Nn #1#2{ - \tex_advance:D#1-\skip_eval:n{#2} +\cs_generate_variant:Nn \skip_zero:N {c} +\cs_generate_variant:Nn \skip_gzero:N {c} +\cs_new_nopar:Npn \skip_add:Nn #1#2 { + \tex_advance:D#1 by \skip_eval:n{#2} } -\def_new:Npn \skip_gadd:Nn { +\cs_generate_variant:Nn \skip_add:Nn {cn} +\cs_new_nopar:Npn \skip_sub:Nn #1#2{ + \tex_advance:D#1-\skip_eval:n{#2} +} +\cs_new_nopar:Npn \skip_gadd:Nn { \pref_global:D - \skip_add:Nn } -\def_new:Npn \skip_gsub:Nn { + \skip_add:Nn +} +\cs_generate_variant:Nn \skip_gadd:Nn {cn} +\cs_new_nopar:Npn \skip_gsub:Nn { \pref_global:D - \skip_sub:Nn } -\let_new:NN \skip_horizontal:N \tex_hskip:D -\def_new:Npn \skip_horizontal:c {\exp_args:Nc\skip_horizontal:N} -\def_new:Npn \skip_horizontal:n #1{\skip_horizontal:N \skip_eval:n{#1}} -\let_new:NN \skip_vertical:N \tex_vskip:D -\def_new:Npn \skip_vertital:c {\exp_args:Nc\skip_vertical:N} -\def_new:Npn \skip_vertical:n #1{\skip_vertical:N \skip_eval:n{#1}} -\let_new:NN \skip_use:N \tex_the:D -\def_new:Npn \skip_use:c #1{\exp_args:Nc\skip_use:N} -\def_new:Npn \skip_eval:n #1 {\etex_glueexpr:D #1 \scan_stop:} -%%\chk_new_cs:N \l_tmpa_skip + \skip_sub:Nn +} +\cs_new_eq:NN \skip_horizontal:N \tex_hskip:D +\cs_generate_variant:Nn \skip_horizontal:N {c} +\cs_new_nopar:Npn \skip_horizontal:n #1 { \skip_horizontal:N \skip_eval:n{#1} } +\cs_new_eq:NN \skip_vertical:N \tex_vskip:D +\cs_generate_variant:Nn \skip_vertical:N {c} +\cs_new_nopar:Npn \skip_vertical:n #1 { \skip_vertical:N \skip_eval:n{#1} } +\cs_new_eq:NN \skip_use:N \tex_the:D +\cs_generate_variant:Nn \skip_use:N {c} +\cs_new_eq:NN \skip_show:N \tex_showthe:D +\cs_new_nopar:Npn \skip_show:c #1 { \skip_show:N \cs:w #1 \cs_end: } +\cs_new_nopar:Npn \skip_eval:n #1 { \etex_glueexpr:D #1 \scan_stop: } +%%\chk_if_free_cs:N \l_tmpa_skip %%\tex_skipdef:D\l_tmpa_skip 255 %currently taken up by \skip@ \skip_new:N \l_tmpa_skip \skip_new:N \l_tmpb_skip \skip_new:N \l_tmpc_skip \skip_new:N \g_tmpa_skip \skip_new:N \g_tmpb_skip -\let:NN \c_zero_skip \z@ -\let:NN \c_max_skip \maxdimen -\def_new:Npn \skip_infinite_glue:nTF #1{ - \predicate:nTF { - \int_compare_p:nNn {\etex_gluestretchorder:D #1 } > \c_zero || - \int_compare_p:nNn {\etex_glueshrinkorder:D #1 } > \c_zero - } +\cs_set_eq:NN \c_zero_skip \z@ +\cs_set_eq:NN \c_max_skip \maxdimen +\prg_new_conditional:Nnn \skip_if_infinite_glue:n {p,TF,T,F} { + \bool_if:nTF { + \intexpr_compare_p:nNn {\etex_gluestretchorder:D #1 } > \c_zero || + \intexpr_compare_p:nNn {\etex_glueshrinkorder:D #1 } > \c_zero + } {\prg_return_true:} {\prg_return_false:} } -\def_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4{ - \skip_infinite_glue:nTF {#1} +\cs_new_nopar:Npn \skip_split_finite_else_action:nnNN #1#2#3#4{ + \skip_if_infinite_glue:nTF {#1} { #3 = \c_zero_skip #4 = \c_zero_skip @@ -119,89 +130,70 @@ #4 = \etex_glueshrink:D #1 \scan_stop: } } -\let:NN \dim_new:N \newdimen -\def_new:Npn \dim_new:c {\exp_args:Nc \dim_new:N} -\def_new:Npn \dim_set:Nn #1#2{#1~ \dim_eval:n{#2}} -\def_new:Npn \dim_gset:Nn {\pref_global:D \dim_set:Nn } -\def_new:Npn \dim_set:cn {\exp_args:Nc \dim_set:Nn } -\def_new:Npn \dim_set:Nc {\exp_args:NNc \dim_set:Nn } -\def_new:Npn \dim_gset:cn {\exp_args:Nc \dim_gset:Nn } -\def_new:Npn \dim_gset:Nc {\exp_args:NNc \dim_gset:Nn } -\def_new:Npn \dim_gset:cc {\exp_args:Ncc \dim_gset:Nn } -\def_new:Npn \dim_zero:N #1{#1\c_zero_skip} -\def_new:Npn \dim_gzero:N {\pref_global:D \dim_zero:N} -\def_new:Npn \dim_zero:c {\exp_args:Nc \dim_zero:N} -\def_new:Npn \dim_gzero:c {\exp_args:Nc \dim_gzero:N} -\def_new:Npn \dim_add:Nn #1#2{ +\cs_new_nopar:Npn \dim_new:N #1 { + \chk_if_free_cs:N #1 + \newdimen #1 +} +\cs_generate_variant:Nn \dim_new:N {c} +\cs_new_nopar:Npn \dim_set:Nn #1#2 { #1~ \dim_eval:n{#2} } +\cs_generate_variant:Nn \dim_set:Nn {cn,Nc} +\cs_new_nopar:Npn \dim_gset:Nn { \pref_global:D \dim_set:Nn } +\cs_generate_variant:Nn \dim_gset:Nn {cn,Nc,cc} +\cs_new_nopar:Npn \dim_zero:N #1 { #1\c_zero_skip } +\cs_generate_variant:Nn \dim_zero:N {c} +\cs_new_nopar:Npn \dim_gzero:N { \pref_global:D \dim_zero:N } +\cs_generate_variant:Nn \dim_gzero:N {c} +\cs_new_nopar:Npn \dim_add:Nn #1#2{ \tex_advance:D#1 by \dim_eval:n{#2}\scan_stop: } -\def_new:Npn\dim_add:cn{\exp_args:Nc\dim_add:Nn} -\def_new:Npn\dim_add:Nc{\exp_args:NNc\dim_add:Nn} -\def_new:Npn \dim_gadd:Nn { \pref_global:D \dim_add:Nn } -\def_new:Npn\dim_gadd:cn{\exp_args:Nc\dim_gadd:Nn} -\def_new:Npn \dim_sub:Nn #1#2{\tex_advance:D#1-#2\scan_stop:} -\def_new:Npn\dim_sub:cn{\exp_args:Nc\dim_sub:Nn} -\def_new:Npn\dim_sub:Nc{\exp_args:NNc\dim_sub:Nn} -\def_new:Npn \dim_gsub:Nn {\pref_global:D \dim_sub:Nn } -\def_new:Npn\dim_gsub:cn{\exp_args:Nc\dim_gsub:Nn} -\let_new:NN \dim_use:N \tex_the:D -\def_new:Npn \dim_use:c {\exp_args:Nc\dim_use:N} +\cs_generate_variant:Nn \dim_add:Nn {cn,Nc} +\cs_new_nopar:Npn \dim_gadd:Nn { \pref_global:D \dim_add:Nn } +\cs_generate_variant:Nn \dim_gadd:Nn {cn} +\cs_new_nopar:Npn \dim_sub:Nn #1#2 { \tex_advance:D#1-#2\scan_stop: } +\cs_generate_variant:Nn \dim_sub:Nn {cn,Nc} +\cs_new_nopar:Npn \dim_gsub:Nn { \pref_global:D \dim_sub:Nn } +\cs_generate_variant:Nn \dim_gsub:Nn {cn} +\cs_new_eq:NN \dim_use:N \tex_the:D +\cs_generate_variant:Nn \dim_use:N {c} +\cs_new_eq:NN \dim_show:N \tex_showthe:D +\cs_new_nopar:Npn \dim_show:c #1 { \dim_show:N \cs:w #1 \cs_end: } \dim_new:N \l_tmpa_dim \dim_new:N \l_tmpb_dim \dim_new:N \l_tmpc_dim \dim_new:N \l_tmpd_dim \dim_new:N \g_tmpa_dim \dim_new:N \g_tmpb_dim -\let_new:NN \c_zero_dim \c_zero_skip -\let_new:NN \c_max_dim \c_max_skip -\def_new:Npn \dim_eval:n #1 {\etex_dimexpr:D #1 \scan_stop:} -\let_new:NN \if_dim:w \tex_ifdim:D -\def_new:Npn \dim_compare:nNnTF #1#2#3{ +\cs_new_eq:NN \c_zero_dim \c_zero_skip +\cs_new_eq:NN \c_max_dim \c_max_skip +\cs_new_nopar:Npn \dim_eval:n #1 { \etex_dimexpr:D #1 \scan_stop: } +\cs_new_eq:NN \if_dim:w \tex_ifdim:D +\prg_new_conditional:Nnn \dim_compare:nNn {p,TF,T,F} { \if_dim:w \dim_eval:n {#1} #2 \dim_eval:n {#3} - \exp_after:NN \use_arg_i:nn - \else: - \exp_after:NN \use_arg_ii:nn - \fi: + \prg_return_true: \else: \prg_return_false: \fi: } -\def_new:Npn \dim_compare:nNnT #1#2#3{ - \if_dim:w \dim_eval:n {#1} #2 \dim_eval:n {#3} - \exp_after:NN \use_arg_ii:nn - \fi: - \use_none:n +\cs_new_nopar:Npn \dim_while_do:nNnn #1#2#3#4{ + \dim_compare:nNnT {#1}#2{#3}{#4 \dim_while_do:nNnn {#1}#2{#3}{#4}} } -\def_new:Npn \dim_compare:nNnF #1#2#3{ - \if_dim:w \dim_eval:n {#1} #2 \dim_eval:n {#3} - \exp_after:NN \use_none:n - \else: - \exp_after:NN \use_arg_i:n - \fi: +\cs_new_nopar:Npn \dim_until_do:nNnn #1#2#3#4{ + \dim_compare:nNnF {#1}#2{#3}{#4 \dim_until_do:nNnn {#1}#2{#3}{#4}} } -\def_new:Npn \dim_compare_p:nNn #1#2#3{ - \if_dim:w \dim_eval:n {#1} #2 \dim_eval:n {#3} - \c_true - \else: - \c_false - \fi: -} -\def_new:Npn \dim_while:nNnT #1#2#3#4{ - \dim_compare:nNnT {#1}#2{#3}{#4 \dim_while:nNnT {#1}#2{#3}{#4}} -} -\def_new:Npn \dim_while:nNnF #1#2#3#4{ - \dim_compare:nNnF {#1}#2{#3}{#4 \dim_while:nNnF {#1}#2{#3}{#4}} -} -\def_new:Npn \dim_dowhile:nNnT #1#2#3#4{ - #4 \dim_compare:nNnT {#1}#2{#3}{\dim_dowhile:nNnT {#1}#2{#3}{#4}} -} -\def_new:Npn \dim_dowhile:nNnF #1#2#3#4{ - #4 \dim_compare:nNnF {#1}#2{#3}{\dim_dowhile:nNnF {#1}#2{#3}{#4}} -} -\let_new:NN \muskip_new:N \newmuskip % nicked from LaTeX -\def_new:Npn \muskip_set:Nn#1#2{#1\etex_muexpr:D#2\scan_stop:} -\def_new:Npn \muskip_gset:Nn{\pref_global:D\muskip_set:Nn} -\def_new:Npn \muskip_add:Nn#1#2{\tex_advance:D#1\etex_muexpr:D#2\scan_stop:} -\def_new:Npn \muskip_gadd:Nn{\pref_global:D\muskip_add:Nn} -\def_new:Npn \muskip_sub:Nn#1#2{\tex_advance:D#1-\etex_muexpr:D#2\scan_stop:} -\def_new:Npn \muskip_gsub:Nn{\pref_global:D\muskip_sub:Nn} +\cs_new_nopar:Npn \dim_do_while:nNnn #1#2#3#4{ + #4 \dim_compare:nNnT {#1}#2{#3}{\dim_do_while:nNnn {#1}#2{#3}{#4}} +} +\cs_new_nopar:Npn \dim_do_until:nNnn #1#2#3#4{ + #4 \dim_compare:nNnF {#1}#2{#3}{\dim_do_until:nNnn {#1}#2{#3}{#4}} +} +\cs_new_nopar:Npn \muskip_new:N #1 { + \chk_if_free_cs:N #1 + \newmuskip #1 +} +\cs_new_nopar:Npn \muskip_set:Nn#1#2{#1\etex_muexpr:D#2\scan_stop:} +\cs_new_nopar:Npn \muskip_gset:Nn{\pref_global:D\muskip_set:Nn} +\cs_new_nopar:Npn \muskip_add:Nn#1#2{\tex_advance:D#1\etex_muexpr:D#2\scan_stop:} +\cs_new_nopar:Npn \muskip_gadd:Nn{\pref_global:D\muskip_add:Nn} +\cs_new_nopar:Npn \muskip_sub:Nn#1#2{\tex_advance:D#1-\etex_muexpr:D#2\scan_stop:} +\cs_new_nopar:Npn \muskip_gsub:Nn{\pref_global:D\muskip_sub:Nn} +\cs_new_eq:NN \muskip_use:N \tex_the:D %% %% %% End of file `l3skip.sty'. |