summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3skip.sty')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3skip.sty63
1 files changed, 42 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
index adbdbc68d8c..4e7c82c333a 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3skip.sty
@@ -47,7 +47,7 @@
%%
%% -----------------------------------------------------------------------
\RequirePackage{l3bootstrap}
-\GetIdInfo$Id: l3skip.dtx 4121 2012-08-17 01:36:30Z bruno $
+\GetIdInfo$Id: l3skip.dtx 4235 2012-09-26 09:48:18Z bruno $
{L3 Dimensions and skips}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
@@ -96,20 +96,6 @@
\cs_new_protected:Npn \dim_gset_eq:NN #1#2 { \tex_global:D #1 = #2 }
\cs_generate_variant:Nn \dim_gset_eq:NN { c }
\cs_generate_variant:Nn \dim_gset_eq:NN { Nc , cc }
-\cs_new_protected_nopar:Npn \dim_set_max:Nn
- { \__dim_set_max:NNNn < \dim_set:Nn }
-\cs_new_protected_nopar:Npn \dim_gset_max:Nn
- { \__dim_set_max:NNNn < \dim_gset:Nn }
-\cs_new_protected_nopar:Npn \dim_set_min:Nn
- { \__dim_set_max:NNNn > \dim_set:Nn }
-\cs_new_protected_nopar:Npn \dim_gset_min:Nn
- { \__dim_set_max:NNNn > \dim_gset:Nn }
-\cs_new_protected:Npn \__dim_set_max:NNNn #1#2#3#4
- { \dim_compare:nNnT {#3} #1 {#4} { #2 #3 {#4} } }
-\cs_generate_variant:Nn \dim_set_max:Nn { c }
-\cs_generate_variant:Nn \dim_gset_max:Nn { c }
-\cs_generate_variant:Nn \dim_set_min:Nn { c }
-\cs_generate_variant:Nn \dim_gset_min:Nn { c }
\cs_new_protected:Npn \dim_add:Nn #1#2
{ \tex_advance:D #1 by \__dim_eval:w #2 \__dim_eval_end: }
\cs_new_protected:Npn \dim_gadd:Nn { \tex_global:D \dim_add:Nn }
@@ -122,14 +108,35 @@
\cs_generate_variant:Nn \dim_gsub:Nn { c }
\cs_new:Npn \dim_abs:n #1
{
- \dim_use:N
- \__dim_eval:w
- \if_dim:w \__dim_eval:w #1 < \c_zero_dim
- -
- \fi:
- \__dim_eval:w #1 \__dim_eval_end:
+ \exp_after:wN \__dim_abs:N
+ \dim_use:N \__dim_eval:w #1 \__dim_eval_end:
+ }
+\cs_new:Npn \__dim_abs:N #1
+ { \if_meaning:w - #1 \else: \exp_after:wN #1 \fi: }
+\cs_set:Npn \dim_max:nn #1#2
+ {
+ \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
+ \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
+ \dim_use:N \__dim_eval:w #2 ;
+ >
+ \__dim_eval_end:
+ }
+\cs_set:Npn \dim_min:nn #1#2
+ {
+ \dim_use:N \__dim_eval:w \exp_after:wN \__dim_maxmin:wwN
+ \dim_use:N \__dim_eval:w #1 \exp_after:wN ;
+ \dim_use:N \__dim_eval:w #2 ;
+ <
\__dim_eval_end:
}
+\cs_new:Npn \__dim_maxmin:wwN #1 ; #2 ; #3
+ {
+ \if_dim:w #1 #3 #2 ~
+ #1
+ \else:
+ #2
+ \fi:
+ }
\cs_new:Npn \dim_ratio:nn #1#2
{ \__dim_ratio:n {#1} / \__dim_ratio:n {#2} }
\cs_new:Npn \__dim_ratio:n #1
@@ -441,6 +448,20 @@
\cs_new_eq:NN \prg_case_dim:nnn \dim_case:nnn
\cs_new_eq:NN \dim_eval:w \__dim_eval:w
\cs_new_eq:NN \dim_eval_end: \__dim_eval_end:
+\cs_new_protected_nopar:Npn \dim_set_max:Nn
+ { \__dim_set_max:NNNn < \dim_set:Nn }
+\cs_new_protected_nopar:Npn \dim_gset_max:Nn
+ { \__dim_set_max:NNNn < \dim_gset:Nn }
+\cs_new_protected_nopar:Npn \dim_set_min:Nn
+ { \__dim_set_max:NNNn > \dim_set:Nn }
+\cs_new_protected_nopar:Npn \dim_gset_min:Nn
+ { \__dim_set_max:NNNn > \dim_gset:Nn }
+\cs_new_protected:Npn \__dim_set_max:NNNn #1#2#3#4
+ { \dim_compare:nNnT {#3} #1 {#4} { #2 #3 {#4} } }
+\cs_generate_variant:Nn \dim_set_max:Nn { c }
+\cs_generate_variant:Nn \dim_gset_max:Nn { c }
+\cs_generate_variant:Nn \dim_set_min:Nn { c }
+\cs_generate_variant:Nn \dim_gset_min:Nn { c }
%%
%%
%% End of file `l3skip.sty'.