blob: 8e24a01271bcb919598b63ba87a522e1731791fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
%%
%% This is file `l3skip.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3skip.dtx (with options: `package,trace')
%%
%%
%% EXPERIMENTAL CODE
%%
%% Do not distribute this file without also distributing the
%% source files specified above.
%%
%% Do not distribute a modified version of this file.
%%
%%
%% File: l3skip.dtx Copyright (C) 2005-2006 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
%% 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
%%
%% This file is part of the ``expl3 bundle'' (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%% http://www.latex-project.org/cgi-bin/cvsweb.cgi/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%% Snapshots taken from the repository represent work in progress and may
%% not work or may contain conflicting material! We therefore ask
%% people _not_ to put them into distributions, archives, etc. without
%% prior consultation with the LaTeX Project Team.
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3names}
\GetIdInfo$Id: l3skip.dtx 573 2006-08-21 20:59:37Z morten $
{L3 Experimental skip registers}
\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}
}
\def_new: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:
}
\def_new: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}
}
\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}
}
\def_new:Npn \skip_gadd:Nn {
\pref_global:D
\skip_add:Nn }
\def_new: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
%%\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{
\prg_logic_test:nTF {
\prg_logic_or_p:nn
{ \int_compare_p:nNn {\etex_gluestretchorder:D #1 } > \c_zero }
{ \int_compare_p:nNn {\etex_glueshrinkorder:D #1 } > \c_zero }
}
}
\def_new:Npn \skip_split_finite_else_action:nnNN #1#2#3#4{
\skip_infinite_glue:nTF {#1}
{
#3 = \c_zero_skip
#4 = \c_zero_skip
#2
}
{
#3 = \etex_gluestretch:D #1 \scan_stop:
#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{
\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_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 }
\let_new:NN \dim_use:N \tex_the:D
\def_new:Npn \dim_use:c {\exp_args:Nc\dim_use:N}
\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{
\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:
}
\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
}
\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:
}
\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}
%%
%%
%% End of file `l3skip.sty'.
|