[latex3-commits] [git/LaTeX3-latex3-latex3] master: Extend box trim operations to provide global versions (fe5baf8)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Jan 23 23:49:35 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/fe5baf8e5ef16ec74b938ce7240e4198a2c03b9e

>---------------------------------------------------------------

commit fe5baf8e5ef16ec74b938ce7240e4198a2c03b9e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Jan 23 22:49:35 2019 +0000

    Extend box trim operations to provide global versions


>---------------------------------------------------------------

fe5baf8e5ef16ec74b938ce7240e4198a2c03b9e
 l3kernel/l3candidates.dtx               |   63 +++++++++++++++++++++++--------
 l3kernel/testfiles/m3expl001.luatex.tlg |    8 ++++
 l3kernel/testfiles/m3expl001.ptex.tlg   |    8 ++++
 l3kernel/testfiles/m3expl001.tlg        |    8 ++++
 l3kernel/testfiles/m3expl001.uptex.tlg  |    8 ++++
 l3kernel/testfiles/m3expl001.xetex.tlg  |    8 ++++
 l3kernel/testfiles/m3expl003.luatex.tlg |    8 ++++
 l3kernel/testfiles/m3expl003.ptex.tlg   |    8 ++++
 l3kernel/testfiles/m3expl003.tlg        |    8 ++++
 l3kernel/testfiles/m3expl003.uptex.tlg  |    8 ++++
 l3kernel/testfiles/m3expl003.xetex.tlg  |    8 ++++
 11 files changed, 128 insertions(+), 15 deletions(-)

diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 4eb74c1..9e96863 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -143,14 +143,15 @@
 %
 % \subsection{Viewing part of a box}
 %
-% \begin{function}{\box_clip:N, \box_clip:c}
+% \begin{function}[updated = 2019-01-23]
+%   {\box_clip:N, \box_clip:c, \box_gclip:N, \box_gclip:c}
 %   \begin{syntax}
 %     \cs{box_clip:N} \meta{box}
 %   \end{syntax}
 %   Clips the \meta{box} in the output so that only material inside the
 %   bounding box is displayed in the output. The updated \meta{box} is an
 %   hbox, irrespective of the nature of the \meta{box} before the clipping is
-%   applied. The clipping applies within the current \TeX{} group level.
+%   applied.
 %
 %   \textbf{These functions require the \LaTeX3 native drivers: they do
 %   not work with the \LaTeXe{} \pkg{graphics} drivers!}
@@ -163,7 +164,11 @@
 %   \end{texnote}
 % \end{function}
 %
-% \begin{function}{\box_trim:Nnnnn, \box_trim:cnnnn}
+% \begin{function}[updated = 2019-01-23]
+%   {
+%     \box_trim:Nnnnn, \box_trim:cnnnn,
+%     \box_gtrim:Nnnnn, \box_gtrim:cnnnn
+%   }
 %   \begin{syntax}
 %     \cs{box_trim:Nnnnn} \meta{box} \Arg{left} \Arg{bottom} \Arg{right} \Arg{top}
 %   \end{syntax}
@@ -174,12 +179,16 @@
 %   unless \cs{box_clip:N} is subsequently applied.
 %   The updated \meta{box} is an
 %   hbox, irrespective of the nature of the \meta{box} before the trim
-%   operation is applied. The adjustment applies within the current \TeX{}
-%   group level. The behavior of the operation where the trims requested is
+%   operation is applied.
+%   The behavior of the operation where the trims requested is
 %   greater than the size of the box is undefined.
 % \end{function}
 %
-% \begin{function}{\box_viewport:Nnnnn, \box_viewport:cnnnn}
+% \begin{function}[updated = 2019-01-23]
+%   {
+%     \box_viewport:Nnnnn, \box_viewport:cnnnn,
+%     \box_gviewport:Nnnnn, \box_gviewport:cnnnn
+%   }
 %   \begin{syntax}
 %     \cs{box_viewport:Nnnnn} \meta{box} \Arg{llx} \Arg{lly} \Arg{urx} \Arg{ury}
 %   \end{syntax}
@@ -191,8 +200,7 @@
 %   subsequently applied.
 %   The updated \meta{box} is an
 %   hbox, irrespective of the nature of the \meta{box} before the viewport
-%   operation is applied. The adjustment applies within the current \TeX{}
-%   group level.
+%   operation is applied.
 % \end{function}
 %
 % \section{Additions to \pkg{l3coffins}}
@@ -1487,20 +1495,34 @@
 %
 % \subsubsection{Viewing part of a box}
 %
-% \begin{macro}{\box_clip:N, \box_clip:c}
+% \begin{macro}{\box_clip:N, \box_clip:c, \box_gclip:N, \box_gclip:c}
 %   A wrapper around the driver-dependent code.
 %    \begin{macrocode}
 \cs_new_protected:Npn \box_clip:N #1
   { \hbox_set:Nn #1 { \driver_box_use_clip:N #1 } }
 \cs_generate_variant:Nn \box_clip:N { c }
+\cs_new_protected:Npn \box_gclip:N #1
+  { \hbox_gset:Nn #1 { \driver_box_use_clip:N #1 } }
+\cs_generate_variant:Nn \box_gclip:N { c }
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\box_trim:Nnnnn, \box_trim:cnnnn}
+% \begin{macro}
+%   {
+%     \box_trim:Nnnnn, \box_trim:cnnnn,
+%     \box_gtrim:Nnnnn, \box_gtrim:cnnnn
+%   }
+% \begin{macro}{\@@_trim:NnnnnN}
 %   Trimming from the left- and right-hand edges of the box is easy: kern the
 %   appropriate parts off each side.
 %    \begin{macrocode}
 \cs_new_protected:Npn \box_trim:Nnnnn #1#2#3#4#5
+  { \@@_trim:NnnnnN #1 {#2} {#3} {#4} {#5} \box_set_eq:NN }
+\cs_generate_variant:Nn \box_trim:Nnnnn { c }
+\cs_new_protected:Npn \box_gtrim:Nnnnn #1#2#3#4#5
+  { \@@_trim:NnnnnN #1 {#2} {#3} {#4} {#5} \box_gset_eq:NN }
+\cs_generate_variant:Nn \box_gtrim:Nnnnn { c }
+\cs_new_protected:Npn \@@_trim:NnnnnN #1#2#3#4#5#6
   {
     \hbox_set:Nn \l_@@_internal_box
       {
@@ -1555,18 +1577,29 @@
           }
         \box_set_ht:Nn \l_@@_internal_box \c_zero_dim
       }
-    \box_set_eq:NN #1 \l_@@_internal_box
+    #6 #1 \l_@@_internal_box
   }
-\cs_generate_variant:Nn \box_trim:Nnnnn { c }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
-% \begin{macro}{\box_viewport:Nnnnn, \box_viewport:cnnnn}
+% \begin{macro}
+%   {
+%     \box_viewport:Nnnnn, \box_viewport:cnnnn,
+%     \box_gviewport:Nnnnn, \box_gviewport:cnnnn
+%   }
+% \begin{macro}{\@@_viewport:NnnnnN}
 %   The same general logic as for the trim operation, but with absolute
 %   dimensions. As a result, there are some things to watch out for in the
 %   vertical direction.
 %    \begin{macrocode}
 \cs_new_protected:Npn \box_viewport:Nnnnn #1#2#3#4#5
+  { \@@_viewport:NnnnnN #1 {#2} {#3} {#4} {#5} \box_set_eq:NN }
+\cs_generate_variant:Nn \box_viewport:Nnnnn { c }
+\cs_new_protected:Npn \box_gviewport:Nnnnn #1#2#3#4#5
+  { \@@_viewport:NnnnnN #1 {#2} {#3} {#4} {#5} \box_gset_eq:NN }
+\cs_generate_variant:Nn \box_gviewport:Nnnnn { c }
+\cs_new_protected:Npn \@@_viewport:NnnnnN #1#2#3#4#5#6
   {
     \hbox_set:Nn \l_@@_internal_box
       {
@@ -1610,11 +1643,11 @@
           }
         \box_set_ht:Nn \l_@@_internal_box \c_zero_dim
       }
-    \box_set_eq:NN #1 \l_@@_internal_box
+    #6 #1 \l_@@_internal_box
   }
-\cs_generate_variant:Nn \box_viewport:Nnnnn { c }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
 %
 % \subsection{Additions to \pkg{l3coffins}}
 %
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 309f201..c9a9d57 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5806,10 +5806,18 @@ Defining \c__char_mixed_case_ῷ_tl on line ..
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 55b06b0..3fe20b7 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5839,10 +5839,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 4def151..9af4664 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5839,10 +5839,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index c58aefc..9db0443 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5836,10 +5836,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 6b9e6cd..0820b95 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5817,10 +5817,18 @@ Defining \c__char_mixed_case_ῷ_tl on line ..
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 309f201..c9a9d57 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5806,10 +5806,18 @@ Defining \c__char_mixed_case_ῷ_tl on line ..
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 55b06b0..3fe20b7 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5839,10 +5839,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 4def151..9af4664 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5839,10 +5839,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index c58aefc..9db0443 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5836,10 +5836,18 @@ Defining \c__char_fold_case_Z_tl on line ...
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 6b9e6cd..0820b95 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5817,10 +5817,18 @@ Defining \c__char_mixed_case_ῷ_tl on line ..
 Defining \mode_leave_vertical: on line ...
 Defining \box_clip:N on line ...
 Defining \box_clip:c on line ...
+Defining \box_gclip:N on line ...
+Defining \box_gclip:c on line ...
 Defining \box_trim:Nnnnn on line ...
 Defining \box_trim:cnnnn on line ...
+Defining \box_gtrim:Nnnnn on line ...
+Defining \box_gtrim:cnnnn on line ...
+Defining \__box_trim:NnnnnN on line ...
 Defining \box_viewport:Nnnnn on line ...
 Defining \box_viewport:cnnnn on line ...
+Defining \box_gviewport:Nnnnn on line ...
+Defining \box_gviewport:cnnnn on line ...
+Defining \__box_viewport:NnnnnN on line ...
 Defining \l__coffin_sin_fp on line ...
 Defining \l__coffin_cos_fp on line ...
 Defining \l__coffin_bounding_prop on line ...





More information about the latex3-commits mailing list