diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3fp.dtx | 83 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3int.dtx | 43 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3names.dtx | 5 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3prg.dtx | 6 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/expl3/l3skip.dtx | 96 |
5 files changed, 153 insertions, 80 deletions
diff --git a/Master/texmf-dist/source/latex/expl3/l3fp.dtx b/Master/texmf-dist/source/latex/expl3/l3fp.dtx index 8eb2530143c..7251d1af935 100644 --- a/Master/texmf-dist/source/latex/expl3/l3fp.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3fp.dtx @@ -35,7 +35,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3fp.dtx 2104 2010-12-18 09:29:34Z joseph $ +\GetIdInfo$Id: l3fp.dtx 2128 2011-01-10 22:44:33Z joseph $ {L3 Experimental floating-point operations} %\iffalse %<*driver> @@ -3058,10 +3058,11 @@ % \end{macrocode} %\end{macro} % -%\begin{macro}{\fp_sub:NNNNNNNNNN} +%\begin{macro}{\fp_sub:NNNNNNNNN} % Internal subtraction is needed only when the first number is bigger % than the second, so there is no need to worry about the sign. This is -% a good job as there are no arguments left. +% a good job as there are no arguments left. The flipping flag is +% used in the rare case where a sign change is possible. % \begin{macrocode} \cs_new_protected_nopar:Npn \fp_sub:NNNNNNNNN #1#2#3#4#5#6#7#8#9 { #7 \etex_numexpr:D #1 - #4 \scan_stop: @@ -3368,6 +3369,7 @@ % %\begin{macro}{\fp_trig_normalise:} %\begin{macro}[aux]{\fp_trig_normalise_aux:} +%\begin{macro}[aux]{\fp_trig_sub:NNN} % For normalisation, the code essentially switches to fixed-point % arithmetic. There is a shift of the exponent, then repeated % subtractions. The end result is a number in the range @@ -3393,22 +3395,14 @@ } \cs_new_protected_nopar:Npn \fp_trig_normalise_aux: { \tex_ifnum:D \l_fp_input_a_integer_int > \c_three - \fp_sub:NNNNNNNNN - \l_fp_input_a_integer_int \l_fp_input_a_decimal_int - \l_fp_input_a_extended_int + \fp_trig_sub:NNN \c_six \c_fp_two_pi_decimal_int \c_fp_two_pi_extended_int - \l_fp_input_a_integer_int \l_fp_input_a_decimal_int - \l_fp_input_a_extended_int \tex_expandafter:D \fp_trig_normalise_aux: \tex_else:D \tex_ifnum:D \l_fp_input_a_integer_int > \c_two \tex_ifnum:D \l_fp_input_a_decimal_int > \c_fp_pi_decimal_int - \fp_sub:NNNNNNNNN - \l_fp_input_a_integer_int \l_fp_input_a_decimal_int - \l_fp_input_a_extended_int - \c_six \c_fp_two_pi_decimal_int \c_fp_two_pi_extended_int - \l_fp_input_a_integer_int \l_fp_input_a_decimal_int - \l_fp_input_a_extended_int + \fp_trig_sub:NNN + \c_six \c_fp_two_pi_decimal_int \c_fp_two_pi_extended_int \tex_expandafter:D \tex_expandafter:D \tex_expandafter:D \tex_expandafter:D \tex_expandafter:D \tex_expandafter:D \tex_expandafter:D \fp_trig_normalise_aux: @@ -3417,6 +3411,49 @@ \tex_fi:D } % \end{macrocode} +% Here, there may be a sign change but there will never be any +% variation in the input. So a dedicated function can be used. +% \begin{macrocode} +\cs_new_protected_nopar:Npn \fp_trig_sub:NNN #1#2#3 { + \l_fp_input_a_integer_int + \etex_numexpr:D \l_fp_input_a_integer_int - #1 \scan_stop: + \l_fp_input_a_decimal_int + \etex_numexpr:D \l_fp_input_a_decimal_int - #2 \scan_stop: + \l_fp_input_a_extended_int + \etex_numexpr:D \l_fp_input_a_extended_int - #3 \scan_stop: + \tex_ifnum:D \l_fp_input_a_extended_int < \c_zero + \tex_advance:D \l_fp_input_a_decimal_int \c_minus_one + \tex_advance:D \l_fp_input_a_extended_int \c_one_thousand_million + \tex_fi:D + \tex_ifnum:D \l_fp_input_a_decimal_int < \c_zero + \tex_advance:D \l_fp_input_a_integer_int \c_minus_one + \tex_advance:D \l_fp_input_a_decimal_int \c_one_thousand_million + \tex_fi:D + \tex_ifnum:D \l_fp_input_a_integer_int < \c_zero + \l_fp_input_a_sign_int -\l_fp_input_a_sign_int + \tex_ifnum:D + \etex_numexpr:D + \l_fp_input_a_decimal_int + \l_fp_input_a_extended_int + = \c_zero + \l_fp_input_a_integer_int -\l_fp_input_a_integer_int + \tex_else:D + \l_fp_input_a_integer_int + \etex_numexpr:D + - \l_fp_input_a_integer_int - \c_one + \scan_stop: + \l_fp_input_a_decimal_int + \etex_numexpr:D + \c_one_thousand_million - \l_fp_input_a_decimal_int + \scan_stop: + \l_fp_input_a_extended_int + \etex_numexpr:D + \c_one_thousand_million - \l_fp_input_a_extended_int + \scan_stop: + \tex_fi:D + \tex_fi:D +} +% \end{macrocode} +%\end{macro} %\end{macro} %\end{macro} % @@ -3932,6 +3969,19 @@ } \cs_new_protected_nopar:Npn \fp_tan_aux_ii: { \fp_trig_normalise: + \tex_ifnum:D \l_fp_input_a_sign_int > \c_zero + \tex_ifnum:D \l_fp_trig_octant_int > \c_two + \l_fp_output_sign_int \c_minus_one + \tex_else:D + \l_fp_output_sign_int \c_one + \tex_fi:D + \tex_else:D + \tex_ifnum:D \l_fp_trig_octant_int > \c_two + \l_fp_output_sign_int \c_one + \tex_else:D + \l_fp_output_sign_int \c_minus_one + \tex_fi:D + \tex_fi:D \fp_cos_aux_ii: \tex_ifnum:D \l_fp_input_a_decimal_int = \c_zero \tex_ifnum:D \l_fp_input_a_integer_int = \c_zero @@ -3990,11 +4040,6 @@ \etex_numexpr:D \l_fp_input_a_exponent_int - \l_fp_input_b_exponent_int \scan_stop: - \tex_ifnum:D \l_fp_trig_octant_int < \c_three - \l_fp_output_sign_int \c_one - \tex_else:D - \l_fp_output_sign_int \c_minus_one - \tex_fi:D \fp_standardise:NNNN \l_fp_output_sign_int \l_fp_output_integer_int diff --git a/Master/texmf-dist/source/latex/expl3/l3int.dtx b/Master/texmf-dist/source/latex/expl3/l3int.dtx index b71bffea94b..93fa6d7e6d1 100644 --- a/Master/texmf-dist/source/latex/expl3/l3int.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3int.dtx @@ -1,5 +1,5 @@ % \iffalse -%% File: l3int.dtx Copyright (C) 1990-2010 LaTeX3 project +%% File: l3int.dtx Copyright (C) 1990-2011 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 @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3int.dtx 2077 2010-10-17 07:47:48Z will $ +\GetIdInfo$Id: l3int.dtx 2121 2011-01-07 08:46:09Z joseph $ {L3 Experimental Integer module} %\iffalse %<*driver> @@ -75,16 +75,16 @@ % %\subsection{Integer expressions} % -%\begin{function}{ \int_eval:n / (EXP) } +%\begin{function}{ +% \int_eval:n / (EXP) | +%} % \begin{syntax} % \cs{int_eval:n} \Arg{integer expression} % \end{syntax} % Evaluates the \meta{integer expression}, expanding any % integer and token list variables within the \meta{expression} % to their content (without requiring \cs{int_use:N}/\cs{tl_use:N}) -% and applying the standard mathematical rules. The result of the -% calculation is left in the input stream as a number. For example -% both +% and applying the standard mathematical rules. For example both % \begin{verbatim} % \int_eval:n { 5 + 4 * 3 - ( 3 + 4 * 5 ) } % \end{verbatim} @@ -99,15 +99,22 @@ % both evaluate to \( -6 \). The \Arg{integer expression} may % contain the operators \texttt{+}, \texttt{-}, \texttt{*} and % \texttt{/}, along with parenthesis \texttt{(} and \texttt{)}. +% After two expansions, \cs{int_eval:n} yields a +% \meta{integer donation} which is left in the input stream. This is +% \emph{not} an \meta{internal integer}, and therefore requires +% suitable termination if used in a \TeX-style integer assignment. %\end{function} % -%\begin{function}{ \int_abs:n / (EXP) } +%\begin{function}{ +% \int_abs:n / (EXP) | +%} % \begin{syntax} % \cs{int_abs:n} \Arg{integer expression} % \end{syntax} % Evaluates the \meta{integer expression} as described for % \cs{int_eval:n} and leaves the absolute value of the result in -% the input stream. +% the input stream as an \meta{integer denotation} after two +% expansions. %\end{function} % %\begin{function}{ \int_div_round:nn / (EXP) } @@ -117,17 +124,21 @@ % Evaluates the two \meta{integer expressions} as described earlier, % then calculates the result of dividing the first value by the % second, rounding any remainder. Note that division using "/" -% is identical to this function. +% is identical to this function. The result is left in the input +% stream as a \meta{integer denotation} after two expansions. %\end{function} % -%\begin{function}{ \int_div_truncate:nn / (EXP) } +%\begin{function}{ +% \int_div_truncate:nn / (EXP) | +%} % \begin{syntax} % \cs{int_div_truncate:nn} \Arg{intexpr1} \Arg{intexpr2} % \end{syntax} % Evaluates the two \meta{integer expressions} as described earlier, % then calculates the result of dividing the first value by the % second, truncating any remainder. Note that division using "/" -% rounds the result. +% rounds the result. The result is left in the input stream as a +% \meta{integer denotation} after two expansions. %\end{function} % %\begin{function}{ @@ -140,16 +151,20 @@ % \end{syntax} % Evaluates the \meta{integer expressions} as described for % \cs{int_eval:n} and leaves either the larger or smaller value -% in the input stream, depending on the function name. +% in the input stream as an \meta{integer denotation} after two +% expansions. %\end{function} % -%\begin{function}{ \int_mod:nn / (EXP) } +%\begin{function}{ +% \int_mod:nn / (EXP) | +%} % \begin{syntax} % \cs{int_mod:nn} \Arg{intexpr1} \Arg{intexpr2} % \end{syntax} % Evaluates the two \meta{integer expressions} as described earlier, % then calculates the integer remainder of dividing the first -% expression by the second. This is left in the input stream. +% expression by the second. This is left in the input stream as an +% \meta{integer denotation} after two expansions. %\end{function} % %\subsection{Integer variables} diff --git a/Master/texmf-dist/source/latex/expl3/l3names.dtx b/Master/texmf-dist/source/latex/expl3/l3names.dtx index 6a36bf148cc..729fd8e6434 100644 --- a/Master/texmf-dist/source/latex/expl3/l3names.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3names.dtx @@ -103,7 +103,7 @@ \RequirePackage{l3names} %</driver> %\fi -\GetIdInfo$Id: l3names.dtx 2064 2010-10-03 23:27:33Z will $ +\GetIdInfo$Id: l3names.dtx 2122 2011-01-08 09:14:28Z joseph $ {L3 Experimental Naming Scheme for TeX Primitives} %\iffalse %<package>\endgroup @@ -1242,7 +1242,7 @@ % as the packages in this distribution do like this: % \begin{verbatim} % \RequirePackage{l3names} -% \GetIdInfo$Id: l3names.dtx 2064 2010-10-03 23:27:33Z will $ +% \GetIdInfo$Id: l3names.dtx 2122 2011-01-08 09:14:28Z joseph $ % {L3 Experimental Box module} % \ProvidesExplPackage % {\filename}{\filedate}{\fileversion}{\filedescription} @@ -1387,6 +1387,7 @@ \tex_let:D\tex_hyphen:D \@@hyph \tex_let:D\luatex_catcodetable:D \luatexcatcodetable \tex_let:D\luatex_initcatcodetable:D \luatexinitcatcodetable +\tex_let:D\luatex_latelua:D \luatexlatelua \tex_let:D\luatex_savecatcodetable:D \luatexsavecatcodetable % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/expl3/l3prg.dtx b/Master/texmf-dist/source/latex/expl3/l3prg.dtx index e61fc3eeb8f..a48517c6f12 100644 --- a/Master/texmf-dist/source/latex/expl3/l3prg.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3prg.dtx @@ -1,5 +1,5 @@ % \iffalse -%% File: l3prg.dtx Copyright (C) 2005-2010 LaTeX3 project +%% File: l3prg.dtx Copyright (C) 2005-2011 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 @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3prg.dtx 2063 2010-10-03 08:26:49Z mittelba $ +\GetIdInfo$Id: l3prg.dtx 2121 2011-01-07 08:46:09Z joseph $ {L3 Experimental control structures} %\iffalse %<*driver> @@ -1655,7 +1655,7 @@ % Same as |\prg_case_dim:nnn| except it is for \meta{dim} registers. % \begin{macrocode} \cs_new:Npn \prg_case_dim:nnn #1 #2 { - \exp_args:No \prg_case_dim_aux:nnn {\dim_use:N \dim_eval:n{#1}} #2 + \exp_args:No \prg_case_dim_aux:nnn {\dim_eval:n{#1}} #2 \q_recursion_tail ? \q_recursion_stop } \cs_new:Npn \prg_case_dim_aux:nnn #1#2#3{ diff --git a/Master/texmf-dist/source/latex/expl3/l3skip.dtx b/Master/texmf-dist/source/latex/expl3/l3skip.dtx index c42de0485e7..75e1982a573 100644 --- a/Master/texmf-dist/source/latex/expl3/l3skip.dtx +++ b/Master/texmf-dist/source/latex/expl3/l3skip.dtx @@ -1,5 +1,5 @@ % \iffalse -%% File: l3skip.dtx Copyright (C) 2005-2010 Frank Mittelbach, LaTeX3 project +%% File: l3skip.dtx Copyright (C) 2005-2011 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 @@ -36,7 +36,7 @@ \RequirePackage{l3names} %</driver|package> %\fi -\GetIdInfo$Id: l3skip.dtx 2088 2010-11-23 20:27:27Z joseph $ +\GetIdInfo$Id: l3skip.dtx 2121 2011-01-07 08:46:09Z joseph $ {L3 Experimental skip registers} %\iffalse %<*driver> @@ -215,21 +215,21 @@ % % % -% \begin{function}{% -% \skip_eval:n / (EXP) | -% } -% \begin{syntax} -% "\skip_eval:n" \Arg{skip expr} -% \end{syntax} -% Evaluates the value of <skip expr> so that -% "\skip_eval:n {5pt plus 3fil + 3pt minus 1fil}" puts -% "8.0pt plus 3.0fil minus 1.0fil" back into the input stream. -% Expandable. -% \begin{texnote} -% This is the \eTeX{} primitive \tn{glueexpr} turned into a function -% taking an argument. -% \end{texnote} -% \end{function} +%\begin{function}{ +% \skip_eval:n / (EXP) | +%} +% \begin{syntax} +% \cs{skip_eval:n} \Arg{skip expression} +% \end{syntax} +% Evaluates the \meta{skip expression}, expanding any skips +% and token list variables within the \meta{expression} +% to their content (without requiring \cs{skip_use:N}/\cs{tl_use:N}) +% and applying the standard mathematical rules. The result of the +% calculation is left in the input stream as a \meta{glue denotation} +% after two expansions. This will be expressed in points (\texttt{pt}), +% and will require suitable termination if used in a \TeX-style +% assignment as it is \emph{not} an \meta{internal glue}. +%\end{function} % % % \subsection{Formatting a skip register value} @@ -429,20 +429,22 @@ % \end{function} % % -% \begin{function}{% -% \dim_eval:n | -% } -% \begin{syntax} -% "\dim_eval:n" \Arg{dim expr} -% \end{syntax} -% Evaluates the value of a dimension expression so that -% "\dim_eval:n {5pt+3pt}" puts "8pt" back into the input stream. -% Expandable. -% \begin{texnote} -% This is the \eTeX{} primitive \tn{dimexpr} turned into a function -% taking an argument. -% \end{texnote} -% \end{function} +%\begin{function}{ +% \dim_eval:n / (EXP) | +%} +% \begin{syntax} +% \cs{dim_eval:n} \Arg{dimension expression} +% \end{syntax} +% Evaluates the \meta{dimension expression}, expanding any +% dimensions and token list variables within the \meta{expression} +% to their content (without requiring \cs{dim_use:N}/\cs{tl_use:N}) +% and applying the standard mathematical rules. The result of the +% calculation is left in the input stream as a +% \meta{dimension denotation} after two expansions. This will be +% expressed in points (\texttt{pt}), and will require suitable +% termination if used in a \TeX-style assignment as it is \emph{not} +% an \meta{internal dimension}. +%\end{function} % % \begin{function}{% % \if_dim:w | @@ -450,7 +452,7 @@ % \begin{syntax} % "\if_dim:w" <dimen1> <rel> <dimen2> <true> "\else:" <false> "\fi:" % \end{syntax} -% Compare two dimensions. It is recommended to use "\dim_eval:n" to +% Compare two dimensions. It is recommended to use "\dim_eval:w" to % correctly evaluate and terminate these numbers. <rel> is one of % "<", "=" or ">" with catcode 12. % \begin{texnote} @@ -665,7 +667,7 @@ % uniform at the moment to get a better overview. % \begin{macrocode} \cs_new_protected_nopar:Npn \skip_set:Nn #1#2 { - #1\skip_eval:n{#2} + #1 \etex_glueexpr:D #2 \scan_stop: %<*check> \chk_local_or_pref_global:N #1 %</check> @@ -735,7 +737,7 @@ % We need to say |by| in case the first argment is a register % accessed by its number, e.g., |\skip23|. % \begin{macrocode} - \tex_advance:D#1 by \skip_eval:n{#2} + \tex_advance:D#1 by \etex_glueexpr:D #2 \scan_stop: %<*check> \chk_local_or_pref_global:N #1 %</check> @@ -745,7 +747,7 @@ % % \begin{macrocode} \cs_new_protected_nopar:Npn \skip_sub:Nn #1#2{ - \tex_advance:D#1-\skip_eval:n{#2} + \tex_advance:D #1 -\etex_glueexpr:D #2 \scan_stop: %<*check> \chk_local_or_pref_global:N #1 %</check> @@ -793,10 +795,14 @@ % \end{macrocode} % % \begin{macrocode} -\cs_new_nopar:Npn \skip_horizontal:n #1 { \skip_horizontal:N \skip_eval:n{#1} } +\cs_new_nopar:Npn \skip_horizontal:n #1 { + \skip_horizontal:N \etex_glueexpr:D #1 \scan_stop: +} \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_nopar:Npn \skip_vertical:n #1 { + \skip_vertical:N \etex_glueexpr:D #1 \scan_stop: +} % \end{macrocode} % \end{macro} % \end{macro} @@ -828,7 +834,9 @@ % \begin{macro}{\skip_eval:n} % Evaluating a calc expression. % \begin{macrocode} -\cs_new_protected_nopar:Npn \skip_eval:n #1 { \etex_glueexpr:D #1 \scan_stop: } +\cs_new_protected_nopar:Npn \skip_eval:n #1 { + \tex_the:D \etex_glueexpr:D #1 \scan_stop: +} % \end{macrocode} % \end{macro} % @@ -947,7 +955,9 @@ % We add |\dim_eval:n| in order to allow simple arithmetic % and a space just for those using |\dimen1| or alike. See OR! % \begin{macrocode} -\cs_new_protected_nopar:Npn \dim_set:Nn #1#2 { #1~ \dim_eval:n{#2} } +\cs_new_protected_nopar:Npn \dim_set:Nn #1#2 { + #1~ \etex_dimexpr:D #2 \scan_stop: +} \cs_generate_variant:Nn \dim_set:Nn {cn,Nc} % \end{macrocode} % @@ -1026,7 +1036,7 @@ % We need to say |by| in case the first argment is a register % accessed by its number, e.g., |\dimen23|. % \begin{macrocode} - \tex_advance:D#1 by \dim_eval:n{#2}\scan_stop: + \tex_advance:D#1 by \etex_dimexpr:D #2 \scan_stop: } \cs_generate_variant:Nn \dim_add:Nn {cn,Nc} % \end{macrocode} @@ -1117,7 +1127,9 @@ % \begin{macro}{\dim_eval:n} % Evaluating a calc expression. % \begin{macrocode} -\cs_new_protected_nopar:Npn \dim_eval:n #1 { \etex_dimexpr:D #1 \scan_stop: } +\cs_new_protected_nopar:Npn \dim_eval:n #1 { + \tex_the:D \etex_dimexpr:D #1 \scan_stop: +} % \end{macrocode} % \end{macro} % @@ -1136,7 +1148,7 @@ % \begin{macro}[TF]{\dim_compare:nNn} % \begin{macrocode} \prg_new_conditional:Nnn \dim_compare:nNn {p,TF,T,F} { - \if_dim:w \dim_eval:n {#1} #2 \dim_eval:n {#3} + \if_dim:w \etex_dimexpr:D #1 #2 \etex_dimexpr:D #3 \scan_stop: \prg_return_true: \else: \prg_return_false: \fi: } % \end{macrocode} |