summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-06-17 22:32:09 +0000
committerKarl Berry <karl@freefriends.org>2014-06-17 22:32:09 +0000
commit3c2f50b92407533aabaef1823006032eedd6ef90 (patch)
treeeb67245dd952c951b95c485a5eb66f9539ac83df /Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
parent4aa0b8110f2fdb3044d8b26d54e12cbb49a9a3dc (diff)
l3
git-svn-id: svn://tug.org/texlive/trunk@34268 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3skip.dtx')
-rw-r--r--Master/texmf-dist/source/latex/l3kernel/l3skip.dtx44
1 files changed, 18 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
index abd4bac865d..f773f3e2867 100644
--- a/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
+++ b/Master/texmf-dist/source/latex/l3kernel/l3skip.dtx
@@ -38,7 +38,7 @@
\documentclass[full]{l3doc}
%</driver>
%<*driver|package>
-\GetIdInfo$Id: l3skip.dtx 4738 2014-05-05 08:00:05Z joseph $
+\GetIdInfo$Id: l3skip.dtx 4972 2014-05-31 16:42:18Z bruno $
{L3 Dimensions and skips}
%</driver|package>
%<*driver>
@@ -900,7 +900,7 @@
% \end{texnote}
% \end{function}
%
-% \begin{function}[added = 2011-11-11, EXP]
+% \begin{function}[added = 2011-11-11, updated=2014-05-31, EXP]
% {\__dim_strip_bp:n, \__dim_strip_pt:n}
% \begin{syntax}
% \cs{__dim_strip_bp:n} \Arg{dimension expression}
@@ -912,15 +912,11 @@
% and applying the standard mathematical rules. The magnitude of the
% result, expressed in big points (\texttt{bp}) or points (\texttt{pt}),
% will be left in the input stream with \emph{no units}. If the decimal
-% part of the magnitude is zero, this will be omitted.
-%
-% If the \Arg{dimension expression} contains additional units, these will
-% be ignored, so for example
+% part of the magnitude is zero, it will be omitted. For example,
% \begin{verbatim}
-% \__dim_strip_pt:n { 1 bp pt }
+% \__dim_strip_pt:n { 2.5 pt * 2 }
% \end{verbatim}
-% will leave |1.00374| in the input stream (\emph{i.e.}~the magnitude of
-% one \enquote{big point} when converted to points).
+% will leave~|5| in the input stream.
% \end{function}
%
% \end{documentation}
@@ -1349,38 +1345,34 @@
% integer fraction for $72/72.27$.
% \begin{macrocode}
\cs_new:Npn \@@_strip_bp:n #1
- {
- \__dim_strip_pt:n
- {
- \__dim_eval:w ( #1 ) * 800 / 803 \__dim_eval_end:
- }
- }
+ { \@@_strip_pt:n { ( #1 ) * 800 / 803 } }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}[EXP]{\@@_strip_pt:n}
% \begin{macro}[EXP, aux]{\@@_strip_pt:w}
-% A function which comes up often enough to deserve a place in the kernel.
-% The idea here is that the input is assumed to be in \texttt{pt}, but can
-% be given in other units, while the output is the value of the dimension
-% in \texttt{pt} but with no units given. This is used a lot by low-level
+% A function which comes up often enough to deserve a place in the
+% kernel. Evaluate the dimension expression~|#1| then remove the
+% trailing \texttt{pt}. The argument is put in parentheses as this
+% prevents the dimension expression from terminating early and leaving
+% extra tokens lying around. This is used a lot by low-level
% manipulations.
% \begin{macrocode}
\cs_new:Npn \@@_strip_pt:n #1
{
\exp_after:wN
- \@@_strip_pt:w \dim_use:N \@@_eval:w #1 \@@_eval_end: \q_stop
+ \@@_strip_pt:w \dim_use:N \@@_eval:w (#1) \@@_eval_end:
}
\use:x
{
\cs_new:Npn \exp_not:N \@@_strip_pt:w
- ##1 . ##2 \tl_to_str:n { pt } ##3 \exp_not:N \q_stop
+ ##1 . ##2 \tl_to_str:n { pt }
+ }
{
- ##1
- \exp_not:N \int_compare:nNnT {##2} > \c_zero
- { . ##2 }
+ \int_compare:nNnTF {#2} > \c_zero
+ { #1 . #2 }
+ { #1 }
}
- }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1562,7 +1554,7 @@
\prg_new_conditional:Npnn \skip_if_eq:nn #1#2 { p , T , F , TF }
{
\if_int_compare:w
- \pdftex_strcmp:D { \skip_eval:n { #1 } } { \skip_eval:n { #2 } }
+ \__str_if_eq_x:nn { \skip_eval:n { #1 } } { \skip_eval:n { #2 } }
= \c_zero
\prg_return_true:
\else: