[latex3-commits] [git/LaTeX3-latex3-latex3] master: xbox: Use variants to deal with \fboxsep/rule (00bb9ec8e)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 24 14:52:08 CEST 2020


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

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

commit 00bb9ec8efc84bcb1070084b8371d3011e57024f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 24 13:49:58 2020 +0100

    xbox: Use variants to deal with \fboxsep/rule


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

00bb9ec8efc84bcb1070084b8371d3011e57024f
 l3trial/xbox/xbox.dtx | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/l3trial/xbox/xbox.dtx b/l3trial/xbox/xbox.dtx
index c511e0e06..97322edfc 100644
--- a/l3trial/xbox/xbox.dtx
+++ b/l3trial/xbox/xbox.dtx
@@ -298,7 +298,11 @@
 %   refer to the \enquote{natural} size of the typeset \meta{content}.
 % \end{function}
 %
-% \begin{function}{\xbox_frame_to_wd:nnnnn, \xbox_frame_to_wd_and_ht:nnnnnn}
+% \begin{function}
+%   {
+%     \xbox_frame_to_wd:nnnnn, \xbox_frame_to_wd:nnnVV,
+%     \xbox_frame_to_wd_and_ht:nnnnnn, \xbox_frame_to_wd_and_ht:nnnnVV
+%   }
 %   \begin{syntax}
 %     \cs{xbox_frame_to_wd:nnnnn} \Arg{width} \Arg{position} \Arg{content} \Arg{thickness} \Arg{border}
 %     \cs{xbox_frame_to_wd_and_ht:nnnnnn} \Arg{width} \Arg{height} \Arg{position} \Arg{content} \Arg{thickness} \Arg{border}
@@ -361,7 +365,7 @@
 %
 % \subsection{Possible additions to \pkg{l3box}}
 %
-% \begin{function}{\hbox_frame:nnn}
+% \begin{function}{\hbox_frame:nnn, \hbox_frame:nVV}
 %   \begin{syntax}
 %     \cs{hbox_frame:nnn} \Arg{content} \Arg{thickness} \Arg{border}
 %   \end{syntax}
@@ -698,8 +702,8 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}{\xbox_frame_to_wd:nnnnn}
-% \begin{macro}{\xbox_frame_to_wd_and_ht:nnnnnn}
+% \begin{macro}{\xbox_frame_to_wd:nnnnn, \xbox_frame_to_wd:nnnVV}
+% \begin{macro}{\xbox_frame_to_wd_and_ht:nnnnnn, \xbox_frame_to_wd_and_ht:nnnnVV}
 %   Wrappers to place a frame around material adjusted to the requested box
 %   dimensions.
 %    \begin{macrocode}
@@ -709,6 +713,7 @@
       { \xbox_to_wd:nnn { #1 - ( #4 + #5 ) * 2 } {#2} {#3} }
       {#4} {#5}
   }
+\cs_generate_variant:Nn \xbox_frame_to_wd:nnnnn { nnnVV }
 \cs_new_protected:Npn \xbox_frame_to_wd_and_ht:nnnnnn #1#2#3#4#5#6
   {
     \hbox_frame:nnn
@@ -720,6 +725,7 @@
       }
       {#5} {#6}
   }
+\cs_generate_variant:Nn \xbox_frame_to_wd_and_ht:nnnnnn { nnnnVV }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -767,7 +773,7 @@
 %    \end{macrocode}
 % \end{variable}
 %
-% \begin{macro}{\hbox_frame:nnn}
+% \begin{macro}{\hbox_frame:nnn, \hbox_frame:nVV}
 % \begin{macro}{\@@_frame:nnn, \@@_frame:ffn}
 %   Framing a box requires the depth is known, so there has to be an
 %   assignment step first to allow this measurement. The evaluation step is
@@ -776,6 +782,7 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \hbox_frame:nnn #1#2#3
   { \@@_frame:ffn { \dim_eval:n {#2} } { \dim_eval:n {#3} } {#1} }
+\cs_generate_variant:Nn \hbox_frame:nnn { nVV }
 \cs_new_protected:Npn \@@_frame:nnn #1#2#3
   {
     \group_begin:
@@ -983,7 +990,7 @@
 \RenewDocumentCommand \fbox { +m }
   {
     \mode_leave_vertical:
-    \hbox_frame:nnn {#1} { \fboxrule } { \fboxsep }
+    \hbox_frame:nVV {#1} \fboxrule \fboxsep
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1002,8 +1009,8 @@
     \IfNoValueTF {#2}
       {
         \IfNoValueTF {#1}
-          { \hbox_frame:nnn {#4} { \fboxrule } { \fboxsep } }
-          { \xbox_frame_to_wd:nnnnn {#1} {#3} {#4} { \fboxrule } { \fboxsep } }
+          { \hbox_frame:nnn {#4} \fboxrule \fboxsep }
+          { \xbox_frame_to_wd:nnnVV {#1} {#3} {#4} \fboxrule \fboxsep }
       }
       {
         \xbox_frame_to_wd_and_ht:nnnnnn #2 {#3} {#4}





More information about the latex3-commits mailing list.