From e0c5d6d38a1f285f20a66692e46d2e607d6ff1dd Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 14 May 2017 22:40:58 +0000
Subject: l3 (14may17)

git-svn-id: svn://tug.org/texlive/trunk@44351 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/l3kernel/expl3-code.tex   | 1191 ++++++++++----------
 1 file changed, 625 insertions(+), 566 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex')

diff --git a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
index f0604e11f7c..16769c81796 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
+++ b/Master/texmf-dist/tex/latex/l3kernel/expl3-code.tex
@@ -58,7 +58,7 @@
 %% and all files in that bundle must be distributed together.
 %% 
 %% File: expl3.dtx Copyright (C) 1990-2017 The LaTeX3 Project
-\def\ExplFileDate{2017/04/01}%
+\def\ExplFileDate{2017/05/13}%
 \begingroup
   \def\next{\endgroup}%
   \expandafter\ifx\csname PackageError\endcsname\relax
@@ -3064,7 +3064,8 @@
 \cs_new_protected:Npn \tl_map_inline:nn #1#2
   {
     \int_gincr:N \g__prg_map_int
-    \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+    \cs_gset_protected:cpn
+      { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
     \exp_args:Nc \__tl_map_function:Nn
       { __prg_map_ \int_use:N \g__prg_map_int :w }
       #1 \q_recursion_tail
@@ -4788,7 +4789,7 @@
 \cs_generate_variant:Nn \int_gincr:N { c }
 \cs_generate_variant:Nn \int_gdecr:N { c }
 \cs_new_protected:Npn \int_set:Nn #1#2
-  { #1 ~ \__int_eval:w #2\__int_eval_end: }
+  { #1 ~ \__int_eval:w #2 \__int_eval_end: }
 \cs_new_protected:Npn \int_gset:Nn { \tex_global:D \int_set:Nn }
 \cs_generate_variant:Nn \int_set:Nn  { c }
 \cs_generate_variant:Nn \int_gset:Nn { c }
@@ -5005,14 +5006,14 @@
   {
     \int_gincr:N \g__prg_map_int
     \exp_args:NNc \__int_step:NNnnnn
-      \cs_gset:Npn
+      \cs_gset_protected:Npn
       { __prg_map_ \int_use:N \g__prg_map_int :w }
   }
 \cs_new_protected:Npn \int_step_variable:nnnNn #1#2#3#4#5
   {
     \int_gincr:N \g__prg_map_int
     \exp_args:NNc \__int_step:NNnnnn
-      \cs_gset:Npx
+      \cs_gset_protected:Npx
       { __prg_map_ \int_use:N \g__prg_map_int :w }
       {#1}{#2}{#3}
       {
@@ -6307,7 +6308,8 @@
     \clist_if_empty:NF #1
       {
         \int_gincr:N \g__prg_map_int
-        \cs_gset:cpn { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
+        \cs_gset_protected:cpn
+          { __prg_map_ \int_use:N \g__prg_map_int :w } ##1 {#2}
         \exp_last_unbraced:Nco \__clist_map_function:Nw
           { __prg_map_ \int_use:N \g__prg_map_int :w }
           #1 , \q_recursion_tail ,
@@ -7474,7 +7476,7 @@
     \cs_gset_eq:cN
       { __prg_map_ \int_use:N \g__prg_map_int :wn } \__prop_pair:wn
     \int_gincr:N \g__prg_map_int
-    \cs_gset:Npn \__prop_pair:wn ##1 \s__prop ##2 {#2}
+    \cs_gset_protected:Npn \__prop_pair:wn ##1 \s__prop ##2 {#2}
     #1
     \__prg_break_point:Nn \prop_map_break:
       {
@@ -11329,10 +11331,13 @@
   {
     \cs_if_exist_use:cF { __fp_parse_word_#2:N }
       {
-        \__msg_kernel_expandable_error:nnn
-          { kernel } { unknown-fp-word } {#2}
-        \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w
-        \__fp_parse_infix:NN
+        \cs_if_exist_use:cF { __fp_parse_caseless_ \str_fold_case:n {#2} :N }
+          {
+            \__msg_kernel_expandable_error:nnn
+              { kernel } { unknown-fp-word } {#2}
+            \exp_after:wN \c_nan_fp \exp:w \exp_end_continue_f:w
+            \__fp_parse_infix:NN
+          }
       }
       #1
   }
@@ -11823,6 +11828,9 @@
 \__fp_tmp:w { deg } \c_one_degree_fp
 \__fp_tmp:w { true } \c_one_fp
 \__fp_tmp:w { false } \c_zero_fp
+\cs_new_eq:NN \__fp_parse_caseless_inf:N \__fp_parse_word_inf:N
+\cs_new_eq:NN \__fp_parse_caseless_infinity:N \__fp_parse_word_inf:N
+\cs_new_eq:NN \__fp_parse_caseless_nan:N \__fp_parse_word_nan:N
 \cs_set_protected:Npn \__fp_tmp:w #1 #2
   {
     \cs_new:cpn { __fp_parse_word_#1:N }
@@ -12512,13 +12520,29 @@
       }
   }
 \cs_generate_variant:Nn \__fp_step:NnnnnN { Nf }
-\cs_new_protected:Npn \fp_step_inline:nnnn #1#2#3#4
+\cs_new_protected:Npn \fp_step_inline:nnnn
+  {
+    \int_gincr:N \g__prg_map_int
+    \exp_args:NNc \__fp_step:NNnnnn
+      \cs_gset_protected:Npn
+      { __prg_map_ \int_use:N \g__prg_map_int :w }
+  }
+\cs_new_protected:Npn \fp_step_variable:nnnNn #1#2#3#4#5
   {
     \int_gincr:N \g__prg_map_int
-    \cs_gset_protected:cpn { __prg_map_ \int_use:N \g__prg_map_int :w }
-      ##1 {#4}
-    \fp_step_function:nnnc {#1} {#2} {#3}
+    \exp_args:NNc \__fp_step:NNnnnn
+      \cs_gset_protected:Npx
       { __prg_map_ \int_use:N \g__prg_map_int :w }
+      {#1} {#2} {#3}
+      {
+        \tl_set:Nn \exp_not:N #4 {##1}
+        \exp_not:n {#5}
+      }
+  }
+\cs_new_protected:Npn \__fp_step:NNnnnn #1#2#3#4#5#6
+  {
+    #1 #2 ##1 {#6}
+    \fp_step_function:nnnN {#3} {#4} {#5} #2
     \__prg_break_point:Nn \scan_stop: { \int_gdecr:N \g__prg_map_int }
   }
 \__msg_kernel_new:nnn { kernel } { fp-bad-step }
@@ -16320,29 +16344,45 @@
       }
   }
 \cs_generate_variant:Nn \__box_show:NNnn { NNff }
-\cs_new_protected:Npn \hbox:n #1 { \tex_hbox:D \scan_stop: {#1} }
+\cs_new_protected:Npn \hbox:n #1
+  { \tex_hbox:D \scan_stop: { \group_begin: #1 \group_end: } }
 \cs_new_protected:Npn \hbox_set:Nn #1#2
-  { \tex_setbox:D #1 \tex_hbox:D {#2} }
+  { \tex_setbox:D #1 \tex_hbox:D { \group_begin: #2 \group_end: } }
 \cs_new_protected:Npn \hbox_gset:Nn { \tex_global:D \hbox_set:Nn }
 \cs_generate_variant:Nn \hbox_set:Nn { c }
 \cs_generate_variant:Nn \hbox_gset:Nn { c }
 \cs_new_protected:Npn \hbox_set_to_wd:Nnn #1#2#3
-  { \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end: {#3} }
+  {
+    \tex_setbox:D #1 \tex_hbox:D to \__dim_eval:w #2 \__dim_eval_end:
+      { \group_begin: #3 \group_end: }
+  }
 \cs_new_protected:Npn \hbox_gset_to_wd:Nnn
   { \tex_global:D \hbox_set_to_wd:Nnn }
 \cs_generate_variant:Nn \hbox_set_to_wd:Nnn { c }
 \cs_generate_variant:Nn \hbox_gset_to_wd:Nnn { c }
 \cs_new_protected:Npn \hbox_set:Nw  #1
-  { \tex_setbox:D #1 \tex_hbox:D \c_group_begin_token }
+  {
+    \tex_setbox:D #1 \tex_hbox:D
+      \c_group_begin_token
+        \group_begin:
+  }
 \cs_new_protected:Npn \hbox_gset:Nw
   { \tex_global:D \hbox_set:Nw }
 \cs_generate_variant:Nn \hbox_set:Nw  { c }
 \cs_generate_variant:Nn \hbox_gset:Nw { c }
-\cs_new_eq:NN \hbox_set_end:  \c_group_end_token
-\cs_new_eq:NN \hbox_gset_end: \c_group_end_token
+\cs_new_protected:Npn \hbox_set_end:
+  {
+      \group_end:
+    \c_group_end_token
+  }
+\cs_new_eq:NN \hbox_gset_end: \hbox_set_end:
 \cs_new_protected:Npn \hbox_to_wd:nn #1#2
-   { \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end: {#2} }
-\cs_new_protected:Npn \hbox_to_zero:n #1 { \tex_hbox:D to \c_zero_dim {#1} }
+   {
+     \tex_hbox:D to \__dim_eval:w #1 \__dim_eval_end:
+       { \group_begin: #2 \group_end: }
+   }
+\cs_new_protected:Npn \hbox_to_zero:n #1
+  { \tex_hbox:D to \c_zero_dim { \group_begin: #1 \group_end: } }
 \cs_new_protected:Npn \hbox_overlap_left:n  #1
   { \hbox_to_zero:n { \tex_hss:D #1 } }
 \cs_new_protected:Npn \hbox_overlap_right:n #1
@@ -16351,19 +16391,33 @@
 \cs_new_eq:NN \hbox_unpack_clear:N \tex_unhbox:D
 \cs_generate_variant:Nn \hbox_unpack:N { c }
 \cs_generate_variant:Nn \hbox_unpack_clear:N { c }
-\cs_new_protected:Npn \vbox:n #1     { \tex_vbox:D { #1 \par } }
-\cs_new_protected:Npn \vbox_top:n #1 { \tex_vtop:D { #1 \par } }
+\cs_new_protected:Npn \vbox:n #1
+  { \tex_vbox:D { \group_begin: #1 \par \group_end: } }
+\cs_new_protected:Npn \vbox_top:n #1
+  { \tex_vtop:D { \group_begin: #1 \par \group_end: } }
 \cs_new_protected:Npn \vbox_to_ht:nn #1#2
-  { \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end: { #2 \par } }
+  {
+    \tex_vbox:D to \__dim_eval:w #1 \__dim_eval_end:
+      { \group_begin: #2 \par \group_end: }
+  }
 \cs_new_protected:Npn \vbox_to_zero:n #1
-  { \tex_vbox:D to \c_zero_dim { #1 \par } }
+  {
+    \tex_vbox:D to \c_zero_dim
+      { \group_begin: #1 \par \group_end: }
+  }
 \cs_new_protected:Npn \vbox_set:Nn #1#2
-  { \tex_setbox:D #1 \tex_vbox:D { #2 \par } }
+  {
+    \tex_setbox:D #1 \tex_vbox:D
+      { \group_begin: #2 \par \group_end: }
+  }
 \cs_new_protected:Npn \vbox_gset:Nn  { \tex_global:D \vbox_set:Nn }
 \cs_generate_variant:Nn \vbox_set:Nn  { c }
 \cs_generate_variant:Nn \vbox_gset:Nn { c }
 \cs_new_protected:Npn \vbox_set_top:Nn #1#2
-  { \tex_setbox:D #1 \tex_vtop:D { #2 \par } }
+  {
+    \tex_setbox:D #1 \tex_vtop:D
+      { \group_begin: #2 \par \group_end: }
+  }
 \cs_new_protected:Npn \vbox_gset_top:Nn
   { \tex_global:D \vbox_set_top:Nn }
 \cs_generate_variant:Nn \vbox_set_top:Nn { c }
@@ -16371,21 +16425,26 @@
 \cs_new_protected:Npn \vbox_set_to_ht:Nnn #1#2#3
   {
     \tex_setbox:D #1 \tex_vbox:D to \__dim_eval:w #2 \__dim_eval_end:
-      { #3 \par }
+      { \group_begin: #3 \par \group_end: }
   }
 \cs_new_protected:Npn \vbox_gset_to_ht:Nnn
   { \tex_global:D \vbox_set_to_ht:Nnn }
 \cs_generate_variant:Nn \vbox_set_to_ht:Nnn  { c }
 \cs_generate_variant:Nn \vbox_gset_to_ht:Nnn { c }
 \cs_new_protected:Npn \vbox_set:Nw #1
-  { \tex_setbox:D #1 \tex_vbox:D \c_group_begin_token }
+  {
+    \tex_setbox:D #1 \tex_vbox:D
+      \c_group_begin_token
+        \group_begin:
+  }
 \cs_new_protected:Npn \vbox_gset:Nw
   { \tex_global:D \vbox_set:Nw }
 \cs_generate_variant:Nn \vbox_set:Nw  { c }
 \cs_generate_variant:Nn \vbox_gset:Nw { c }
 \cs_new_protected:Npn \vbox_set_end:
   {
-    \par
+        \par
+      \group_end:
     \c_group_end_token
   }
 \cs_new_eq:NN \vbox_gset_end: \vbox_set_end:
@@ -16395,210 +16454,504 @@
 \cs_generate_variant:Nn \vbox_unpack_clear:N { c }
 \cs_new_protected:Npn \vbox_set_split_to_ht:NNn #1#2#3
   { \tex_setbox:D #1 \tex_vsplit:D #2 to \__dim_eval:w #3 \__dim_eval_end: }
-%% File: l3coffins.dtx Copyright(C) 2010-2017 The LaTeX3 Project
-\box_new:N \l__coffin_internal_box
-\dim_new:N \l__coffin_internal_dim
-\tl_new:N  \l__coffin_internal_tl
-\prop_new:N \c__coffin_corners_prop
-\prop_put:Nnn \c__coffin_corners_prop { tl } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { tr } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { bl } { { 0 pt } { 0 pt } }
-\prop_put:Nnn \c__coffin_corners_prop { br } { { 0 pt } { 0 pt } }
-\prop_new:N \c__coffin_poles_prop
-\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 0 pt } { 1000 pt } }
-\prop_put:Nno \c__coffin_poles_prop { l }  { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { hc } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { r }  { \l__coffin_internal_tl }
-\tl_set:Nn \l__coffin_internal_tl { { 0 pt } { 0 pt } { 1000 pt } { 0 pt } }
-\prop_put:Nno \c__coffin_poles_prop { b }  { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { vc } { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { t }  { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { B }  { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { H }  { \l__coffin_internal_tl }
-\prop_put:Nno \c__coffin_poles_prop { T }  { \l__coffin_internal_tl }
-\fp_new:N \l__coffin_slope_x_fp
-\fp_new:N \l__coffin_slope_y_fp
-\bool_new:N \l__coffin_error_bool
-\dim_new:N \l__coffin_offset_x_dim
-\dim_new:N \l__coffin_offset_y_dim
-\tl_new:N \l__coffin_pole_a_tl
-\tl_new:N \l__coffin_pole_b_tl
-\dim_new:N \l__coffin_x_dim
-\dim_new:N \l__coffin_y_dim
-\dim_new:N \l__coffin_x_prime_dim
-\dim_new:N \l__coffin_y_prime_dim
-\prg_new_conditional:Npnn \coffin_if_exist:N #1 { p , T , F , TF }
+\fp_new:N \l__box_angle_fp
+\fp_new:N \l__box_cos_fp
+\fp_new:N \l__box_sin_fp
+\dim_new:N \l__box_top_dim
+\dim_new:N \l__box_bottom_dim
+\dim_new:N \l__box_left_dim
+\dim_new:N \l__box_right_dim
+\dim_new:N \l__box_top_new_dim
+\dim_new:N \l__box_bottom_new_dim
+\dim_new:N \l__box_left_new_dim
+\dim_new:N \l__box_right_new_dim
+\box_new:N \l__box_internal_box
+\cs_new_protected:Npn \box_rotate:Nn #1#2
   {
-    \cs_if_exist:NTF #1
+    \hbox_set:Nn #1
       {
-        \cs_if_exist:cTF { l__coffin_poles_ \__int_value:w #1 _prop }
-          { \prg_return_true: }
-          { \prg_return_false: }
+        \fp_set:Nn \l__box_angle_fp {#2}
+        \fp_set:Nn \l__box_sin_fp { sind ( \l__box_angle_fp ) }
+        \fp_set:Nn \l__box_cos_fp { cosd ( \l__box_angle_fp ) }
+        \__box_rotate:N #1
       }
-      { \prg_return_false: }
   }
-\cs_generate_variant:Nn \coffin_if_exist_p:N { c }
-\cs_generate_variant:Nn \coffin_if_exist:NT  { c }
-\cs_generate_variant:Nn \coffin_if_exist:NF  { c }
-\cs_generate_variant:Nn \coffin_if_exist:NTF { c }
-\cs_new_protected:Npn \__coffin_if_exist:NT #1#2
+\cs_new_protected:Npn \__box_rotate:N #1
   {
-    \coffin_if_exist:NTF #1
-      { #2 }
+    \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
+    \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+    \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
+    \dim_zero:N \l__box_left_dim
+    \fp_compare:nNnTF \l__box_sin_fp > \c_zero_fp
       {
-        \__msg_kernel_error:nnx { kernel } { unknown-coffin }
-          { \token_to_str:N #1 }
+        \fp_compare:nNnTF \l__box_cos_fp > \c_zero_fp
+          { \__box_rotate_quadrant_one: }
+          { \__box_rotate_quadrant_two: }
       }
-  }
-\cs_new_protected:Npn \coffin_clear:N #1
-  {
-    \__coffin_if_exist:NT #1
       {
-        \box_clear:N #1
-        \__coffin_reset_structure:N #1
+        \fp_compare:nNnTF \l__box_cos_fp < \c_zero_fp
+          { \__box_rotate_quadrant_three: }
+          { \__box_rotate_quadrant_four: }
       }
-  }
-\cs_generate_variant:Nn \coffin_clear:N { c }
-\cs_new_protected:Npn \coffin_new:N #1
-  {
-    \box_new:N #1
-    \__chk_suspend_log:
-    \prop_clear_new:c { l__coffin_corners_ \__int_value:w #1 _prop }
-    \prop_clear_new:c { l__coffin_poles_   \__int_value:w #1 _prop }
-    \prop_gset_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
-      \c__coffin_corners_prop
-    \prop_gset_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
-      \c__coffin_poles_prop
-    \__chk_resume_log:
-  }
-\cs_generate_variant:Nn \coffin_new:N { c }
-\cs_new_protected:Npn \hcoffin_set:Nn #1#2
-  {
-    \__coffin_if_exist:NT #1
+    \hbox_set:Nn \l__box_internal_box { \box_use:N #1 }
+    \hbox_set:Nn \l__box_internal_box
       {
-        \hbox_set:Nn #1
+        \tex_kern:D -\l__box_left_new_dim
+        \hbox:n
           {
-            \color_group_begin:
-              \color_ensure_current:
-              #2
-            \color_group_end:
+            \__driver_box_use_rotate:Nn
+              \l__box_internal_box
+              \l__box_angle_fp
           }
-        \__coffin_reset_structure:N #1
-        \__coffin_update_poles:N #1
-        \__coffin_update_corners:N #1
       }
+    \box_set_ht:Nn \l__box_internal_box {  \l__box_top_new_dim }
+    \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
+    \box_set_wd:Nn \l__box_internal_box
+      { \l__box_right_new_dim - \l__box_left_new_dim }
+    \box_use:N \l__box_internal_box
   }
-\cs_generate_variant:Nn \hcoffin_set:Nn { c }
-\cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3
+\cs_new_protected:Npn \__box_rotate_x:nnN #1#2#3
   {
-    \__coffin_if_exist:NT #1
+    \dim_set:Nn #3
       {
-        \vbox_set:Nn #1
-          {
-            \dim_set:Nn \tex_hsize:D {#2}
-            \dim_set_eq:NN \linewidth   \tex_hsize:D
-            \dim_set_eq:NN \columnwidth \tex_hsize:D
-            \color_group_begin:
-              #3
-            \color_group_end:
-          }
-        \__coffin_reset_structure:N #1
-        \__coffin_update_poles:N #1
-        \__coffin_update_corners:N #1
-        \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
-        \__coffin_set_pole:Nnx #1 { T }
+        \fp_to_dim:n
           {
-            { 0 pt }
-            {
-              \dim_eval:n
-                { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
-            }
-            { 1000 pt }
-            { 0 pt }
+              \l__box_cos_fp * \dim_to_fp:n {#1}
+            - \l__box_sin_fp * \dim_to_fp:n {#2}
           }
-        \box_clear:N \l__coffin_internal_box
       }
   }
-\cs_generate_variant:Nn \vcoffin_set:Nnn { c }
-\cs_new_protected:Npn \hcoffin_set:Nw #1
+\cs_new_protected:Npn \__box_rotate_y:nnN #1#2#3
   {
-    \__coffin_if_exist:NT #1
+    \dim_set:Nn #3
       {
-        \hbox_set:Nw #1 \color_group_begin: \color_ensure_current:
-          \cs_set_protected:Npn \hcoffin_set_end:
-            {
-                \color_group_end:
-              \hbox_set_end:
-              \__coffin_reset_structure:N #1
-              \__coffin_update_poles:N #1
-              \__coffin_update_corners:N #1
-            }
+        \fp_to_dim:n
+          {
+              \l__box_sin_fp * \dim_to_fp:n {#1}
+            + \l__box_cos_fp * \dim_to_fp:n {#2}
+          }
       }
   }
-\cs_new_protected:Npn \hcoffin_set_end: { }
-\cs_generate_variant:Nn \hcoffin_set:Nw { c }
-\cs_new_protected:Npn \vcoffin_set:Nnw #1#2
+\cs_new_protected:Npn \__box_rotate_quadrant_one:
   {
-    \__coffin_if_exist:NT #1
-      {
-        \vbox_set:Nw #1
-          \dim_set:Nn \tex_hsize:D {#2}
-            \dim_set_eq:NN \linewidth   \tex_hsize:D
-            \dim_set_eq:NN \columnwidth \tex_hsize:D
-          \color_group_begin:
-          \cs_set_protected:Npn \vcoffin_set_end:
-            {
-                \color_group_end:
-              \vbox_set_end:
-              \__coffin_reset_structure:N #1
-              \__coffin_update_poles:N #1
-              \__coffin_update_corners:N #1
-              \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
-              \__coffin_set_pole:Nnx #1 { T }
-                {
-                  { 0 pt }
-                  {
-                    \dim_eval:n
-                      { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
-                  }
-                  { 1000 pt }
-                  { 0 pt }
-                }
-              \box_clear:N \l__coffin_internal_box
-            }
-      }
+    \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
+      \l__box_top_new_dim
+    \__box_rotate_y:nnN \l__box_left_dim  \l__box_bottom_dim
+      \l__box_bottom_new_dim
+    \__box_rotate_x:nnN \l__box_left_dim  \l__box_top_dim
+      \l__box_left_new_dim
+    \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
+      \l__box_right_new_dim
   }
-\cs_new_protected:Npn \vcoffin_set_end: { }
-\cs_generate_variant:Nn \vcoffin_set:Nnw { c }
-\cs_new_protected:Npn \coffin_set_eq:NN #1#2
+\cs_new_protected:Npn \__box_rotate_quadrant_two:
   {
-    \__coffin_if_exist:NT #1
-      {
-        \box_set_eq:NN #1 #2
-        \__coffin_set_eq_structure:NN #1 #2
-      }
+    \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
+      \l__box_top_new_dim
+    \__box_rotate_y:nnN \l__box_left_dim  \l__box_top_dim
+      \l__box_bottom_new_dim
+    \__box_rotate_x:nnN \l__box_right_dim  \l__box_top_dim
+      \l__box_left_new_dim
+    \__box_rotate_x:nnN \l__box_left_dim   \l__box_bottom_dim
+      \l__box_right_new_dim
   }
-\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc }
-\coffin_new:N \c_empty_coffin
-\hbox_set:Nn  \c_empty_coffin { }
-\coffin_new:N \l__coffin_aligned_coffin
-\coffin_new:N \l__coffin_aligned_internal_coffin
-\coffin_new:N \l_tmpa_coffin
-\coffin_new:N \l_tmpb_coffin
-\cs_new_eq:NN \coffin_dp:N \box_dp:N
-\cs_new_eq:NN \coffin_dp:c \box_dp:c
-\cs_new_eq:NN \coffin_ht:N \box_ht:N
-\cs_new_eq:NN \coffin_ht:c \box_ht:c
-\cs_new_eq:NN \coffin_wd:N \box_wd:N
-\cs_new_eq:NN \coffin_wd:c \box_wd:c
-\cs_new_protected:Npn \__coffin_get_pole:NnN #1#2#3
+\cs_new_protected:Npn \__box_rotate_quadrant_three:
   {
-    \prop_get:cnNF
-      { l__coffin_poles_ \__int_value:w #1 _prop } {#2} #3
+    \__box_rotate_y:nnN \l__box_left_dim  \l__box_bottom_dim
+      \l__box_top_new_dim
+    \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
+      \l__box_bottom_new_dim
+    \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
+      \l__box_left_new_dim
+    \__box_rotate_x:nnN \l__box_left_dim   \l__box_top_dim
+      \l__box_right_new_dim
+  }
+\cs_new_protected:Npn \__box_rotate_quadrant_four:
+  {
+    \__box_rotate_y:nnN \l__box_left_dim  \l__box_top_dim
+      \l__box_top_new_dim
+    \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
+      \l__box_bottom_new_dim
+    \__box_rotate_x:nnN \l__box_left_dim  \l__box_bottom_dim
+      \l__box_left_new_dim
+    \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
+      \l__box_right_new_dim
+  }
+\fp_new:N \l__box_scale_x_fp
+\fp_new:N \l__box_scale_y_fp
+\cs_new_protected:Npn \box_resize_to_wd_and_ht_plus_dp:Nnn #1#2#3
+  {
+    \hbox_set:Nn #1
+      {
+        \__box_resize_set_corners:N #1
+        \fp_set:Nn \l__box_scale_x_fp
+          { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
+        \fp_set:Nn \l__box_scale_y_fp
+          {
+              \dim_to_fp:n {#3}
+            / \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim }
+          }
+        \__box_resize:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_resize_to_wd_and_ht_plus_dp:Nnn { c }
+\cs_new_protected:Npn \__box_resize_set_corners:N #1
+  {
+    \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
+    \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+    \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
+    \dim_zero:N \l__box_left_dim
+  }
+\cs_new_protected:Npn \__box_resize:N #1
+  {
+    \__box_resize:NNN \l__box_right_new_dim
+      \l__box_scale_x_fp \l__box_right_dim
+    \__box_resize:NNN \l__box_bottom_new_dim
+      \l__box_scale_y_fp \l__box_bottom_dim
+    \__box_resize:NNN \l__box_top_new_dim
+      \l__box_scale_y_fp \l__box_top_dim
+    \__box_resize_common:N #1
+  }
+\cs_new_protected:Npn \__box_resize:NNN #1#2#3
+  {
+    \dim_set:Nn #1
+      { \fp_to_dim:n { \fp_abs:n { #2 } * \dim_to_fp:n { #3 } } }
+  }
+\cs_new_protected:Npn \box_resize_to_ht:Nn #1#2
+  {
+    \hbox_set:Nn #1
+      {
+        \__box_resize_set_corners:N #1
+        \fp_set:Nn \l__box_scale_y_fp
+          {
+              \dim_to_fp:n {#2}
+            / \dim_to_fp:n { \l__box_top_dim }
+          }
+        \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
+        \__box_resize:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_resize_to_ht:Nn { c }
+\cs_new_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2
+  {
+    \hbox_set:Nn #1
+      {
+        \__box_resize_set_corners:N #1
+        \fp_set:Nn \l__box_scale_y_fp
+          {
+              \dim_to_fp:n {#2}
+            / \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim }
+          }
+        \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
+        \__box_resize:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_resize_to_ht_plus_dp:Nn { c }
+\cs_new_protected:Npn \box_resize_to_wd:Nn #1#2
+  {
+    \hbox_set:Nn #1
+      {
+        \__box_resize_set_corners:N #1
+        \fp_set:Nn \l__box_scale_x_fp
+          { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
+        \fp_set_eq:NN \l__box_scale_y_fp \l__box_scale_x_fp
+        \__box_resize:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_resize_to_wd:Nn { c }
+\cs_new_protected:Npn \box_resize_to_wd_and_ht:Nnn #1#2#3
+  {
+    \hbox_set:Nn #1
+      {
+        \__box_resize_set_corners:N #1
+        \fp_set:Nn \l__box_scale_x_fp
+          { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
+        \fp_set:Nn \l__box_scale_y_fp
+          {
+              \dim_to_fp:n {#3}
+            / \dim_to_fp:n { \l__box_top_dim }
+          }
+        \__box_resize:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_resize_to_wd_and_ht:Nnn { c }
+\cs_new_protected:Npn \box_scale:Nnn #1#2#3
+  {
+    \hbox_set:Nn #1
+      {
+        \fp_set:Nn \l__box_scale_x_fp {#2}
+        \fp_set:Nn \l__box_scale_y_fp {#3}
+        \__box_scale_aux:N #1
+      }
+  }
+\cs_generate_variant:Nn \box_scale:Nnn { c }
+\cs_new_protected:Npn \__box_scale_aux:N #1
+  {
+    \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
+    \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
+    \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
+    \dim_zero:N \l__box_left_dim
+    \dim_set:Nn \l__box_top_new_dim
+      { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
+    \dim_set:Nn \l__box_bottom_new_dim
+      { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
+    \dim_set:Nn \l__box_right_new_dim
+      { \fp_abs:n { \l__box_scale_x_fp } \l__box_right_dim }
+    \__box_resize_common:N #1
+  }
+\cs_new_protected:Npn \box_autosize_to_wd_and_ht:Nnn #1#2#3
+  { \__box_autosize:Nnnn #1 {#2} {#3} { \box_ht:N #1 } }
+\cs_generate_variant:Nn \box_autosize_to_wd_and_ht:Nnn { c }
+\cs_new_protected:Npn \box_autosize_to_wd_and_ht_plus_dp:Nnn #1#2#3
+  { \__box_autosize:Nnnn #1 {#2} {#3} { \box_ht:N #1 + \box_dp:N #1 } }
+\cs_generate_variant:Nn \box_autosize_to_wd_and_ht_plus_dp:Nnn { c }
+\cs_new_protected:Npn \__box_autosize:Nnnn #1#2#3#4
+  {
+    \hbox_set:Nn #1
+      {
+        \fp_set:Nn \l__box_scale_x_fp { ( #2 ) / \box_wd:N #1 }
+        \fp_set:Nn \l__box_scale_y_fp { ( #3 ) / ( #4 ) }
+        \fp_compare:nNnTF \l__box_scale_x_fp > \l__box_scale_y_fp
+          { \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp }
+          { \fp_set_eq:NN \l__box_scale_y_fp \l__box_scale_x_fp }
+        \__box_scale_aux:N #1
+      }
+  }
+\cs_new_protected:Npn \__box_resize_common:N #1
+  {
+    \hbox_set:Nn \l__box_internal_box
+      {
+        \__driver_box_use_scale:Nnn
+          #1
+          \l__box_scale_x_fp
+          \l__box_scale_y_fp
+      }
+    \fp_compare:nNnTF \l__box_scale_y_fp > \c_zero_fp
+      {
+        \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
+        \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
+      }
+      {
+        \box_set_dp:Nn \l__box_internal_box { \l__box_top_new_dim }
+        \box_set_ht:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
+      }
+    \fp_compare:nNnTF \l__box_scale_x_fp < \c_zero_fp
+      {
+        \hbox_to_wd:nn { \l__box_right_new_dim }
+          {
+            \tex_kern:D \l__box_right_new_dim
+            \box_use:N \l__box_internal_box
+            \tex_hss:D
+          }
+      }
+      {
+        \box_set_wd:Nn \l__box_internal_box { \l__box_right_new_dim }
+        \hbox:n
+          {
+            \tex_kern:D \c_zero_dim
+            \box_use:N \l__box_internal_box
+            \tex_hss:D
+          }
+      }
+  }
+\cs_new_eq:NN \box_resize:Nnn \box_resize_to_wd_and_ht_plus_dp:Nnn
+\cs_new_eq:NN \box_resize:cnn \box_resize_to_wd_and_ht_plus_dp:cnn
+%% File: l3coffins.dtx Copyright(C) 2010-2017 The LaTeX3 Project
+\box_new:N \l__coffin_internal_box
+\dim_new:N \l__coffin_internal_dim
+\tl_new:N  \l__coffin_internal_tl
+\prop_new:N \c__coffin_corners_prop
+\prop_put:Nnn \c__coffin_corners_prop { tl } { { 0pt } { 0pt } }
+\prop_put:Nnn \c__coffin_corners_prop { tr } { { 0pt } { 0pt } }
+\prop_put:Nnn \c__coffin_corners_prop { bl } { { 0pt } { 0pt } }
+\prop_put:Nnn \c__coffin_corners_prop { br } { { 0pt } { 0pt } }
+\prop_new:N \c__coffin_poles_prop
+\tl_set:Nn \l__coffin_internal_tl { { 0pt } { 0pt } { 0pt } { 1000pt } }
+\prop_put:Nno \c__coffin_poles_prop { l }  { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { hc } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { r }  { \l__coffin_internal_tl }
+\tl_set:Nn \l__coffin_internal_tl { { 0pt } { 0pt } { 1000pt } { 0pt } }
+\prop_put:Nno \c__coffin_poles_prop { b }  { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { vc } { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { t }  { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { B }  { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { H }  { \l__coffin_internal_tl }
+\prop_put:Nno \c__coffin_poles_prop { T }  { \l__coffin_internal_tl }
+\fp_new:N \l__coffin_slope_x_fp
+\fp_new:N \l__coffin_slope_y_fp
+\bool_new:N \l__coffin_error_bool
+\dim_new:N \l__coffin_offset_x_dim
+\dim_new:N \l__coffin_offset_y_dim
+\tl_new:N \l__coffin_pole_a_tl
+\tl_new:N \l__coffin_pole_b_tl
+\dim_new:N \l__coffin_x_dim
+\dim_new:N \l__coffin_y_dim
+\dim_new:N \l__coffin_x_prime_dim
+\dim_new:N \l__coffin_y_prime_dim
+\prg_new_conditional:Npnn \coffin_if_exist:N #1 { p , T , F , TF }
+  {
+    \cs_if_exist:NTF #1
+      {
+        \cs_if_exist:cTF { l__coffin_poles_ \__int_value:w #1 _prop }
+          { \prg_return_true: }
+          { \prg_return_false: }
+      }
+      { \prg_return_false: }
+  }
+\cs_generate_variant:Nn \coffin_if_exist_p:N { c }
+\cs_generate_variant:Nn \coffin_if_exist:NT  { c }
+\cs_generate_variant:Nn \coffin_if_exist:NF  { c }
+\cs_generate_variant:Nn \coffin_if_exist:NTF { c }
+\cs_new_protected:Npn \__coffin_if_exist:NT #1#2
+  {
+    \coffin_if_exist:NTF #1
+      { #2 }
+      {
+        \__msg_kernel_error:nnx { kernel } { unknown-coffin }
+          { \token_to_str:N #1 }
+      }
+  }
+\cs_new_protected:Npn \coffin_clear:N #1
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \box_clear:N #1
+        \__coffin_reset_structure:N #1
+      }
+  }
+\cs_generate_variant:Nn \coffin_clear:N { c }
+\cs_new_protected:Npn \coffin_new:N #1
+  {
+    \box_new:N #1
+    \__chk_suspend_log:
+    \prop_clear_new:c { l__coffin_corners_ \__int_value:w #1 _prop }
+    \prop_clear_new:c { l__coffin_poles_   \__int_value:w #1 _prop }
+    \prop_gset_eq:cN { l__coffin_corners_ \__int_value:w #1 _prop }
+      \c__coffin_corners_prop
+    \prop_gset_eq:cN { l__coffin_poles_ \__int_value:w #1 _prop }
+      \c__coffin_poles_prop
+    \__chk_resume_log:
+  }
+\cs_generate_variant:Nn \coffin_new:N { c }
+\cs_new_protected:Npn \hcoffin_set:Nn #1#2
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \hbox_set:Nn #1
+          {
+            \color_ensure_current:
+            #2
+          }
+        \__coffin_reset_structure:N #1
+        \__coffin_update_poles:N #1
+        \__coffin_update_corners:N #1
+      }
+  }
+\cs_generate_variant:Nn \hcoffin_set:Nn { c }
+\cs_new_protected:Npn \vcoffin_set:Nnn #1#2#3
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \vbox_set:Nn #1
+          {
+            \dim_set:Nn \tex_hsize:D {#2}
+            \dim_set_eq:NN \linewidth   \tex_hsize:D
+            \dim_set_eq:NN \columnwidth \tex_hsize:D
+            #3
+          }
+        \__coffin_reset_structure:N #1
+        \__coffin_update_poles:N #1
+        \__coffin_update_corners:N #1
+        \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
+        \__coffin_set_pole:Nnx #1 { T }
+          {
+            { 0pt }
+            {
+              \dim_eval:n
+                { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
+            }
+            { 1000pt }
+            { 0pt }
+          }
+        \box_clear:N \l__coffin_internal_box
+      }
+  }
+\cs_generate_variant:Nn \vcoffin_set:Nnn { c }
+\cs_new_protected:Npn \hcoffin_set:Nw #1
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \hbox_set:Nw #1 \color_ensure_current:
+          \cs_set_protected:Npn \hcoffin_set_end:
+            {
+              \hbox_set_end:
+              \__coffin_reset_structure:N #1
+              \__coffin_update_poles:N #1
+              \__coffin_update_corners:N #1
+            }
+      }
+  }
+\cs_new_protected:Npn \hcoffin_set_end: { }
+\cs_generate_variant:Nn \hcoffin_set:Nw { c }
+\cs_new_protected:Npn \vcoffin_set:Nnw #1#2
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \vbox_set:Nw #1
+          \dim_set:Nn \tex_hsize:D {#2}
+            \dim_set_eq:NN \linewidth   \tex_hsize:D
+            \dim_set_eq:NN \columnwidth \tex_hsize:D
+          \cs_set_protected:Npn \vcoffin_set_end:
+            {
+              \vbox_set_end:
+              \__coffin_reset_structure:N #1
+              \__coffin_update_poles:N #1
+              \__coffin_update_corners:N #1
+              \vbox_set_top:Nn \l__coffin_internal_box { \vbox_unpack:N #1 }
+              \__coffin_set_pole:Nnx #1 { T }
+                {
+                  { 0pt }
+                  {
+                    \dim_eval:n
+                      { \box_ht:N #1 - \box_ht:N \l__coffin_internal_box }
+                  }
+                  { 1000pt }
+                  { 0pt }
+                }
+              \box_clear:N \l__coffin_internal_box
+            }
+      }
+  }
+\cs_new_protected:Npn \vcoffin_set_end: { }
+\cs_generate_variant:Nn \vcoffin_set:Nnw { c }
+\cs_new_protected:Npn \coffin_set_eq:NN #1#2
+  {
+    \__coffin_if_exist:NT #1
+      {
+        \box_set_eq:NN #1 #2
+        \__coffin_set_eq_structure:NN #1 #2
+      }
+  }
+\cs_generate_variant:Nn \coffin_set_eq:NN { c , Nc , cc }
+\coffin_new:N \c_empty_coffin
+\hbox_set:Nn  \c_empty_coffin { }
+\coffin_new:N \l__coffin_aligned_coffin
+\coffin_new:N \l__coffin_aligned_internal_coffin
+\coffin_new:N \l_tmpa_coffin
+\coffin_new:N \l_tmpb_coffin
+\cs_new_eq:NN \coffin_dp:N \box_dp:N
+\cs_new_eq:NN \coffin_dp:c \box_dp:c
+\cs_new_eq:NN \coffin_ht:N \box_ht:N
+\cs_new_eq:NN \coffin_ht:c \box_ht:c
+\cs_new_eq:NN \coffin_wd:N \box_wd:N
+\cs_new_eq:NN \coffin_wd:c \box_wd:c
+\cs_new_protected:Npn \__coffin_get_pole:NnN #1#2#3
+  {
+    \prop_get:cnNF
+      { l__coffin_poles_ \__int_value:w #1 _prop } {#2} #3
       {
         \__msg_kernel_error:nnxx { kernel } { unknown-coffin-pole }
           {#2} { \token_to_str:N #1 }
-        \tl_set:Nn #3 { { 0 pt } { 0 pt } { 0 pt } { 0 pt } }
+        \tl_set:Nn #3 { { 0pt } { 0pt } { 0pt } { 0pt } }
       }
   }
 \cs_new_protected:Npn \__coffin_reset_structure:N #1
@@ -16628,8 +16981,8 @@
       {
         \__coffin_set_pole:Nnx #1 {#2}
           {
-            { 0 pt } { \dim_eval:n {#3} }
-            { 1000 pt } { 0 pt }
+            { 0pt } { \dim_eval:n {#3} }
+            { 1000pt } { 0pt }
           }
       }
   }
@@ -16639,8 +16992,8 @@
       {
         \__coffin_set_pole:Nnx #1 {#2}
           {
-            { \dim_eval:n {#3} } { 0 pt }
-            { 0 pt } { 1000 pt }
+            { \dim_eval:n {#3} } { 0pt }
+            { 0pt } { 1000pt }
           }
       }
   }
@@ -16652,11 +17005,11 @@
 \cs_new_protected:Npn \__coffin_update_corners:N #1
   {
     \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tl }
-      { { 0 pt } { \dim_eval:n { \box_ht:N #1 } } }
+      { { 0pt } { \dim_eval:n { \box_ht:N #1 } } }
     \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { tr }
       { { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { \box_ht:N #1 } } }
     \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { bl }
-      { { 0 pt } { \dim_eval:n { - \box_dp:N #1 } } }
+      { { 0pt } { \dim_eval:n { -\box_dp:N #1 } } }
     \prop_put:cnx { l__coffin_corners_ \__int_value:w #1 _prop } { br }
       { { \dim_eval:n { \box_wd:N #1 } } { \dim_eval:n { -\box_dp:N #1 } } }
   }
@@ -16665,33 +17018,33 @@
     \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { hc }
       {
         { \dim_eval:n { 0.5 \box_wd:N #1 } }
-        { 0 pt } { 0 pt } { 1000 pt }
+        { 0pt } { 0pt } { 1000pt }
       }
     \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { r }
       {
         { \dim_eval:n { \box_wd:N #1 } }
-        { 0 pt } { 0 pt } { 1000 pt }
+        { 0pt } { 0pt } { 1000pt }
       }
     \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { vc }
       {
-        { 0 pt }
+        { 0pt }
         { \dim_eval:n { ( \box_ht:N #1 - \box_dp:N #1 ) / 2 } }
-        { 1000 pt }
-        { 0 pt }
+        { 1000pt }
+        { 0pt }
       }
     \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { t }
       {
-        { 0 pt }
+        { 0pt }
         { \dim_eval:n { \box_ht:N #1 } }
-        { 1000 pt }
-        { 0 pt }
+        { 1000pt }
+        { 0pt }
       }
     \prop_put:cnx { l__coffin_poles_ \__int_value:w #1 _prop } { b }
       {
-        { 0 pt }
-        { \dim_eval:n { - \box_dp:N #1 } }
-        { 1000 pt }
-        { 0 pt }
+        { 0pt }
+        { \dim_eval:n { -\box_dp:N #1 } }
+        { 1000pt }
+        { 0pt }
       }
   }
 \cs_new_protected:Npn \__coffin_calculate_intersection:Nnn #1#2#3
@@ -16816,21 +17169,21 @@
           { \tex_kern:D -\l__coffin_internal_dim }
       }
    \__coffin_reset_structure:N \l__coffin_aligned_coffin
-    \prop_clear:c
-      { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _ prop }
-    \__coffin_update_poles:N \l__coffin_aligned_coffin
+   \prop_clear:c
+     { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _ prop }
+   \__coffin_update_poles:N \l__coffin_aligned_coffin
     \dim_compare:nNnTF \l__coffin_offset_x_dim < \c_zero_dim
       {
-        \__coffin_offset_poles:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
-        \__coffin_offset_poles:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
-        \__coffin_offset_corners:Nnn #1 { -\l__coffin_offset_x_dim } { 0 pt }
-        \__coffin_offset_corners:Nnn #4 { 0 pt } { \l__coffin_offset_y_dim }
+        \__coffin_offset_poles:Nnn #1 { -\l__coffin_offset_x_dim } { 0pt }
+        \__coffin_offset_poles:Nnn #4 { 0pt } { \l__coffin_offset_y_dim }
+        \__coffin_offset_corners:Nnn #1 { -\l__coffin_offset_x_dim } { 0pt }
+        \__coffin_offset_corners:Nnn #4 { 0pt } { \l__coffin_offset_y_dim }
       }
       {
-        \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
+        \__coffin_offset_poles:Nnn #1 { 0pt } { 0pt }
         \__coffin_offset_poles:Nnn #4
           { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
-        \__coffin_offset_corners:Nnn #1 { 0 pt } { 0 pt }
+        \__coffin_offset_corners:Nnn #1 { 0pt } { 0pt }
         \__coffin_offset_corners:Nnn #4
           { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
       }
@@ -16850,7 +17203,7 @@
       { l__coffin_corners_ \__int_value:w \l__coffin_aligned_coffin _prop }
       { l__coffin_corners_ \__int_value:w #1 _prop }
     \__coffin_update_poles:N  \l__coffin_aligned_coffin
-    \__coffin_offset_poles:Nnn #1 { 0 pt } { 0 pt }
+    \__coffin_offset_poles:Nnn #1 { 0pt } { 0pt }
     \__coffin_offset_poles:Nnn #4
       { \l__coffin_offset_x_dim } { \l__coffin_offset_y_dim }
     \__coffin_update_vertical_poles:NNN #1 #4 \l__coffin_aligned_coffin
@@ -16935,11 +17288,11 @@
     \dim_compare:nNnTF {#2} < {#6}
       {
         \__coffin_set_pole:Nnx #9 { T }
-          { { 0 pt } {#6} { 1000 pt } { 0 pt } }
+          { { 0pt } {#6} { 1000pt } { 0pt } }
       }
       {
         \__coffin_set_pole:Nnx #9 { T }
-          { { 0 pt } {#2} { 1000 pt } { 0 pt } }
+          { { 0pt } {#2} { 1000pt } { 0pt } }
       }
   }
 \cs_new_protected:Npn \__coffin_update_B:nnnnnnnnN #1#2#3#4#5#6#7#8#9
@@ -16947,11 +17300,11 @@
     \dim_compare:nNnTF {#2} < {#6}
       {
         \__coffin_set_pole:Nnx #9 { B }
-          { { 0 pt } {#2}  { 1000 pt } { 0 pt } }
+          { { 0pt } {#2}  { 1000pt } { 0pt } }
       }
       {
         \__coffin_set_pole:Nnx #9 { B }
-          { { 0 pt } {#6} { 1000 pt } { 0 pt } }
+          { { 0pt } {#6} { 1000pt } { 0pt } }
       }
   }
 \cs_new_protected:Npn \coffin_typeset:Nnnnn #1#2#3#4#5
@@ -17003,7 +17356,7 @@
 \prop_put:Nnn \l__coffin_display_handles_prop { Br }
   { { b } { l } { 1 } { -1 } }
 \dim_new:N  \l__coffin_display_offset_dim
-\dim_set:Nn \l__coffin_display_offset_dim { 2 pt }
+\dim_set:Nn \l__coffin_display_offset_dim { 2pt }
 \dim_new:N \l__coffin_display_x_dim
 \dim_new:N \l__coffin_display_y_dim
 \prop_new:N \l__coffin_display_poles_prop
@@ -17014,10 +17367,10 @@
     \hcoffin_set:Nn \l__coffin_display_pole_coffin
       {
         \color {#4}
-        \rule { 1 pt } { 1 pt }
+        \rule { 1pt } { 1pt }
       }
     \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
-      \l__coffin_display_pole_coffin { hc } { vc } { 0 pt } { 0 pt }
+      \l__coffin_display_pole_coffin { hc } { vc } { 0pt } { 0pt }
     \hcoffin_set:Nn \l__coffin_display_coord_coffin
       {
         \color {#4}
@@ -17034,7 +17387,7 @@
           {
             \coffin_attach_mark:NnnNnnnn #1 {#2} {#3}
               \l__coffin_display_coord_coffin { l } { vc }
-                { 1 pt } { 0 pt }
+                { 1pt } { 0pt }
           }
           {
             \exp_last_unbraced:No \__coffin_mark_handle_aux:nnnnNnn
@@ -17059,7 +17412,7 @@
     \hcoffin_set:Nn \l__coffin_display_pole_coffin
       {
         \color {#2}
-        \rule { 1 pt } { 1 pt }
+        \rule { 1pt } { 1pt }
       }
     \prop_set_eq:Nc \l__coffin_display_poles_prop
       { l__coffin_poles_ \__int_value:w #1 _prop }
@@ -17090,7 +17443,7 @@
             \dim_set:Nn \l__coffin_display_y_dim { \l__coffin_y_dim }
             \__coffin_display_attach:Nnnnn
               \l__coffin_display_pole_coffin { hc } { vc }
-              { 0 pt } { 0 pt }
+              { 0pt } { 0pt }
             \hcoffin_set:Nn \l__coffin_display_coord_coffin
               {
                 \color {#6}
@@ -17107,7 +17460,7 @@
                   {
                     \__coffin_display_attach:Nnnnn
                       \l__coffin_display_coord_coffin { l } { vc }
-                      { 1 pt } { 0 pt }
+                      { 1pt } { 0pt }
                   }
                   {
                     \exp_last_unbraced:No
@@ -17202,28 +17555,14 @@
     Poles~of~coffin~#1 :
   }
 %% File: l3color.dtx Copyright(C) 2011,2012,2014,2016,2017 The LaTeX3 Project
-\cs_new_eq:NN \color_group_begin: \group_begin:
-\cs_new_protected:Npn \color_group_end:
-  {
-      \tex_par:D
-    \group_end:
-  }
-\cs_new_protected:Npn \color_ensure_current: { }
-\AtBeginDocument
-  {
-    \cs_if_exist:NTF \__driver_color_ensure_current:
-      {
-        \cs_set_protected:Npn \color_ensure_current:
-          { \__driver_color_ensure_current: }
-      }
-      {
-        \cs_if_exist:NT \set@color
-          {
-            \cs_set_protected:Npn \color_ensure_current:
-              { \set@color }
-          }
-      }
+\cs_new_eq:NN \color_group_begin: \group_begin:
+\cs_new_protected:Npn \color_group_end:
+  {
+      \par
+    \group_end:
   }
+\cs_new_protected:Npn \color_ensure_current:
+  { \__driver_color_ensure_current: }
 %% File: l3sys.dtx Copyright (C) 2015-2017 The LaTeX3 Project
 \str_const:Nx \c_sys_jobname_str { \tex_jobname:D }
 \int_const:Nn \c_sys_minute_int
@@ -17258,11 +17597,9 @@
   }
 \cs_if_exist:NT \ptex_kanjiskip:D
   {
-    \bool_if:nTF
-      {
-        \cs_if_exist_p:N \uptex_disablecjktoken:D &&
-        \int_compare_p:nNn { \ptex_jis:D "2121 } = { "3000 }
-      }
+    \bool_lazy_and:nnTF
+      { \cs_if_exist_p:N \uptex_disablecjktoken:D }
+      { \int_compare_p:nNn { \ptex_jis:D "2121 } = { "3000 } }
       {
         \cs_gset_eq:NN \sys_if_engine_uptex:T  \use:n
         \cs_gset_eq:NN \sys_if_engine_uptex:F  \use_none:n
@@ -17359,6 +17696,8 @@
     \__deprecation_error:Nnn \tl_to_lowercase:n { } { 2017-12-31 }
     \__deprecation_error:Nnn \tl_to_uppercase:n { } { 2017-12-31 }
     \__deprecation_error:Nnn \ior_get_str:NN { \ior_str_get:NN } { 2017-12-31 }
+    \__deprecation_error:Nnn \box_resize:Nnn { \box_resize_to_wd_and_ht_plus_dp:Nnn } { 2018-12-31 }
+    \__deprecation_error:Nnn \box_resize:cnn { \box_resize_to_wd_and_ht_plus_dp:cnn } { 2018-12-31 }
     \__deprecation_error:Nnn \c_minus_one { - 1 } { 2018-12-31 }
     \__deprecation_error:Nnn \sort_ordered: { \sort_return_same: } { 2018-12-31 }
     \__deprecation_error:Nnn \sort_reversed: { \sort_return_swapped: } { 2018-12-31 }
@@ -17366,297 +17705,6 @@
     \cs_set_eq:NN \deprecation_error: \scan_stop:
   }
 %% File: l3candidates.dtx Copyright (C) 2012-2017 The LaTeX3 Project
-\fp_new:N \l__box_angle_fp
-\fp_new:N \l__box_cos_fp
-\fp_new:N \l__box_sin_fp
-\dim_new:N \l__box_top_dim
-\dim_new:N \l__box_bottom_dim
-\dim_new:N \l__box_left_dim
-\dim_new:N \l__box_right_dim
-\dim_new:N \l__box_top_new_dim
-\dim_new:N \l__box_bottom_new_dim
-\dim_new:N \l__box_left_new_dim
-\dim_new:N \l__box_right_new_dim
-\box_new:N \l__box_internal_box
-\cs_new_protected:Npn \box_rotate:Nn #1#2
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \fp_set:Nn \l__box_angle_fp {#2}
-          \fp_set:Nn \l__box_sin_fp { sind ( \l__box_angle_fp ) }
-          \fp_set:Nn \l__box_cos_fp { cosd ( \l__box_angle_fp ) }
-          \__box_rotate:N #1
-        \group_end:
-    }
-  }
-\cs_new_protected:Npn \__box_rotate:N #1
-  {
-    \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
-    \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
-    \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
-    \dim_zero:N \l__box_left_dim
-    \fp_compare:nNnTF \l__box_sin_fp > \c_zero_fp
-      {
-        \fp_compare:nNnTF \l__box_cos_fp > \c_zero_fp
-          { \__box_rotate_quadrant_one: }
-          { \__box_rotate_quadrant_two: }
-      }
-      {
-        \fp_compare:nNnTF \l__box_cos_fp < \c_zero_fp
-          { \__box_rotate_quadrant_three: }
-          { \__box_rotate_quadrant_four: }
-      }
-    \hbox_set:Nn \l__box_internal_box { \box_use:N #1 }
-    \hbox_set:Nn \l__box_internal_box
-      {
-        \tex_kern:D -\l__box_left_new_dim
-        \hbox:n
-          {
-            \__driver_box_use_rotate:Nn
-              \l__box_internal_box
-              \l__box_angle_fp
-          }
-      }
-    \box_set_ht:Nn \l__box_internal_box {  \l__box_top_new_dim }
-    \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
-    \box_set_wd:Nn \l__box_internal_box
-      { \l__box_right_new_dim - \l__box_left_new_dim }
-    \box_use:N \l__box_internal_box
-  }
-\cs_new_protected:Npn \__box_rotate_x:nnN #1#2#3
-  {
-    \dim_set:Nn #3
-      {
-        \fp_to_dim:n
-          {
-              \l__box_cos_fp * \dim_to_fp:n {#1}
-            - \l__box_sin_fp * \dim_to_fp:n {#2}
-          }
-      }
-  }
-\cs_new_protected:Npn \__box_rotate_y:nnN #1#2#3
-  {
-    \dim_set:Nn #3
-      {
-        \fp_to_dim:n
-          {
-              \l__box_sin_fp * \dim_to_fp:n {#1}
-            + \l__box_cos_fp * \dim_to_fp:n {#2}
-          }
-      }
-  }
-\cs_new_protected:Npn \__box_rotate_quadrant_one:
-  {
-    \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
-      \l__box_top_new_dim
-    \__box_rotate_y:nnN \l__box_left_dim  \l__box_bottom_dim
-      \l__box_bottom_new_dim
-    \__box_rotate_x:nnN \l__box_left_dim  \l__box_top_dim
-      \l__box_left_new_dim
-    \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
-      \l__box_right_new_dim
-  }
-\cs_new_protected:Npn \__box_rotate_quadrant_two:
-  {
-    \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
-      \l__box_top_new_dim
-    \__box_rotate_y:nnN \l__box_left_dim  \l__box_top_dim
-      \l__box_bottom_new_dim
-    \__box_rotate_x:nnN \l__box_right_dim  \l__box_top_dim
-      \l__box_left_new_dim
-    \__box_rotate_x:nnN \l__box_left_dim   \l__box_bottom_dim
-      \l__box_right_new_dim
-  }
-\cs_new_protected:Npn \__box_rotate_quadrant_three:
-  {
-    \__box_rotate_y:nnN \l__box_left_dim  \l__box_bottom_dim
-      \l__box_top_new_dim
-    \__box_rotate_y:nnN \l__box_right_dim \l__box_top_dim
-      \l__box_bottom_new_dim
-    \__box_rotate_x:nnN \l__box_right_dim \l__box_bottom_dim
-      \l__box_left_new_dim
-    \__box_rotate_x:nnN \l__box_left_dim   \l__box_top_dim
-      \l__box_right_new_dim
-  }
-\cs_new_protected:Npn \__box_rotate_quadrant_four:
-  {
-    \__box_rotate_y:nnN \l__box_left_dim  \l__box_top_dim
-      \l__box_top_new_dim
-    \__box_rotate_y:nnN \l__box_right_dim \l__box_bottom_dim
-      \l__box_bottom_new_dim
-    \__box_rotate_x:nnN \l__box_left_dim  \l__box_bottom_dim
-      \l__box_left_new_dim
-    \__box_rotate_x:nnN \l__box_right_dim \l__box_top_dim
-      \l__box_right_new_dim
-  }
-\fp_new:N \l__box_scale_x_fp
-\fp_new:N \l__box_scale_y_fp
-\cs_new_protected:Npn \box_resize:Nnn #1#2#3
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \__box_resize_set_corners:N #1
-          \fp_set:Nn \l__box_scale_x_fp
-            { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
-          \fp_set:Nn \l__box_scale_y_fp
-            {
-                \dim_to_fp:n {#3}
-              / \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim }
-            }
-          \__box_resize:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_resize:Nnn { c }
-\cs_new_protected:Npn \__box_resize_set_corners:N #1
-  {
-    \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
-    \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
-    \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
-    \dim_zero:N \l__box_left_dim
-  }
-\cs_new_protected:Npn \__box_resize:N #1
-  {
-    \__box_resize:NNN \l__box_right_new_dim
-      \l__box_scale_x_fp \l__box_right_dim
-    \__box_resize:NNN \l__box_bottom_new_dim
-      \l__box_scale_y_fp \l__box_bottom_dim
-    \__box_resize:NNN \l__box_top_new_dim
-      \l__box_scale_y_fp \l__box_top_dim
-    \__box_resize_common:N #1
-  }
-\cs_new_protected:Npn \__box_resize:NNN #1#2#3
-  {
-    \dim_set:Nn #1
-      { \fp_to_dim:n { \fp_abs:n { #2 } * \dim_to_fp:n { #3 } } }
-  }
-\cs_new_protected:Npn \box_resize_to_ht:Nn #1#2
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \__box_resize_set_corners:N #1
-          \fp_set:Nn \l__box_scale_y_fp
-            {
-                \dim_to_fp:n {#2}
-              / \dim_to_fp:n { \l__box_top_dim }
-            }
-          \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
-          \__box_resize:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_resize_to_ht:Nn { c }
-\cs_new_protected:Npn \box_resize_to_ht_plus_dp:Nn #1#2
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \__box_resize_set_corners:N #1
-          \fp_set:Nn \l__box_scale_y_fp
-            {
-                \dim_to_fp:n {#2}
-              / \dim_to_fp:n { \l__box_top_dim - \l__box_bottom_dim }
-            }
-          \fp_set_eq:NN \l__box_scale_x_fp \l__box_scale_y_fp
-          \__box_resize:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_resize_to_ht_plus_dp:Nn { c }
-\cs_new_protected:Npn \box_resize_to_wd:Nn #1#2
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \__box_resize_set_corners:N #1
-          \fp_set:Nn \l__box_scale_x_fp
-            { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
-          \fp_set_eq:NN \l__box_scale_y_fp \l__box_scale_x_fp
-          \__box_resize:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_resize_to_wd:Nn { c }
-\cs_new_protected:Npn \box_resize_to_wd_and_ht:Nnn #1#2#3
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \__box_resize_set_corners:N #1
-          \fp_set:Nn \l__box_scale_x_fp
-            { \dim_to_fp:n {#2} / \dim_to_fp:n { \l__box_right_dim } }
-          \fp_set:Nn \l__box_scale_y_fp
-            {
-                \dim_to_fp:n {#3}
-              / \dim_to_fp:n { \l__box_top_dim }
-            }
-          \__box_resize:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_resize_to_wd_and_ht:Nnn { c }
-\cs_new_protected:Npn \box_scale:Nnn #1#2#3
-  {
-    \hbox_set:Nn #1
-      {
-        \group_begin:
-          \fp_set:Nn \l__box_scale_x_fp {#2}
-          \fp_set:Nn \l__box_scale_y_fp {#3}
-          \dim_set:Nn \l__box_top_dim    {  \box_ht:N #1 }
-          \dim_set:Nn \l__box_bottom_dim { -\box_dp:N #1 }
-          \dim_set:Nn \l__box_right_dim  {  \box_wd:N #1 }
-          \dim_zero:N \l__box_left_dim
-          \dim_set:Nn \l__box_top_new_dim
-            { \fp_abs:n { \l__box_scale_y_fp } \l__box_top_dim }
-          \dim_set:Nn \l__box_bottom_new_dim
-            { \fp_abs:n { \l__box_scale_y_fp } \l__box_bottom_dim }
-          \dim_set:Nn \l__box_right_new_dim
-              { \fp_abs:n { \l__box_scale_x_fp } \l__box_right_dim }
-           \__box_resize_common:N #1
-        \group_end:
-      }
-  }
-\cs_generate_variant:Nn \box_scale:Nnn { c }
-\cs_new_protected:Npn \__box_resize_common:N #1
-  {
-    \hbox_set:Nn \l__box_internal_box
-      {
-        \__driver_box_use_scale:Nnn
-          #1
-          \l__box_scale_x_fp
-          \l__box_scale_y_fp
-      }
-    \fp_compare:nNnTF \l__box_scale_y_fp > \c_zero_fp
-      {
-        \box_set_ht:Nn \l__box_internal_box { \l__box_top_new_dim }
-        \box_set_dp:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
-      }
-      {
-        \box_set_dp:Nn \l__box_internal_box { \l__box_top_new_dim }
-        \box_set_ht:Nn \l__box_internal_box { -\l__box_bottom_new_dim }
-      }
-    \fp_compare:nNnTF \l__box_scale_x_fp < \c_zero_fp
-      {
-        \hbox_to_wd:nn { \l__box_right_new_dim }
-          {
-            \tex_kern:D \l__box_right_new_dim
-            \box_use:N \l__box_internal_box
-            \tex_hss:D
-          }
-      }
-      {
-        \box_set_wd:Nn \l__box_internal_box { \l__box_right_new_dim }
-        \hbox:n
-          {
-            \tex_kern:D \c_zero_dim
-            \box_use:N \l__box_internal_box
-            \tex_hss:D
-          }
-      }
-  }
 \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 }
@@ -17925,7 +17973,7 @@
           \dim_to_fp:n {#3}
         / \dim_to_fp:n { \coffin_ht:N #1 + \coffin_dp:N #1 }
       }
-    \box_resize:Nnn #1 {#2} {#3}
+    \box_resize_to_wd_and_ht_plus_dp:Nnn #1 {#2} {#3}
     \__coffin_resize_common:Nnn #1 {#2} {#3}
   }
 \cs_generate_variant:Nn \coffin_resize:Nnn { c }
@@ -18037,7 +18085,7 @@
   }
 \cs_new_protected:Npn \__ior_map_inline:NNNn #1#2#3#4
   {
-    \cs_set:Npn #1 ##1 {#4}
+    \cs_gset_protected:Npn #1 ##1 {#4}
     \ior_if_eof:NF #3 { \__ior_map_inline_loop:NNN #1#2#3 }
     \__prg_break_point:Nn \ior_map_break:
       { \int_gdecr:N \g__prg_map_int }
@@ -18245,6 +18293,18 @@
         #2
       }
   }
+\cs_if_exist:NTF \pdftex_uniformdeviate:D
+  {
+    \prg_new_conditional:Npnn \sys_if_rand_exist: { p , T , F , TF }
+      { \prg_return_true: }
+  }
+  {
+    \prg_new_conditional:Npnn \sys_if_rand_exist: { p , T , F , TF }
+      { \prg_return_false: }
+  }
+\cs_new:Npn \sys_rand_seed: { \tex_the:D \pdftex_randomseed:D }
+\cs_new_protected:Npn \sys_gset_rand_seed:n #1
+  { \pdftex_setrandomseed:D \__int_eval:w #1 \__int_eval_end: }
 \prg_new_conditional:Npnn \tl_if_single_token:n #1 { p , T , F , TF }
   {
     \tl_if_head_is_N_type:nTF {#1}
@@ -18934,10 +18994,9 @@
   \__tl_tmp:w \c__unicode_I_ogonek_tl  { 012E }
 \group_end:
 \group_begin:
-  \bool_if:nT
-    {
-      \sys_if_engine_pdftex_p: || \sys_if_engine_uptex_p:
-    }
+  \bool_lazy_or:nnT
+    { \sys_if_engine_pdftex_p: }
+    { \sys_if_engine_uptex_p: }
     {
       \cs_set_protected:Npn \__tl_loop:nn #1#2
         {
-- 
cgit v1.2.3

