- Improve wrap objects.

- Debug.
This commit is contained in:
2025-09-11 16:42:59 -05:00
parent d1fd2fef22
commit 0e68ac723d
6 changed files with 130 additions and 102 deletions

View File

@@ -23,16 +23,13 @@
vlines = {0pt,boxoutBG},
vline{1,Z} = {\boxoutrule,boxoutFG},
}
% \SetTblrOuter[tblrBoxout]{
% expand+ = \l_Boxout_body_tl,
% }
\tl_const:Nn \c_Boxout_innerspec_tl {colspec={X[l,h]}}
\bool_const:Nn \c_Boxout_warning_bool {\c_false_bool}
\tl_new:N \l_Boxout_title_tl
\keys_define:nn{Boxout}{
\keys_define:nn {Boxout} {
innerspec .tl_set_e:N= \l_Boxout_innerspec_tl,
innerspec .initial:e = {\c_Boxout_innerspec_tl},
innerspec .default:e = {\c_Boxout_innerspec_tl},
@@ -42,11 +39,6 @@
warning .default:e = {true},
}
% \NewExpandableDocumentCommand{\__Boxout_body:Nnn}{m +m +m}{
% %\message{boxout~body~start}
% }
\NewDocumentEnvironment{Boxout}{
% #1: Key-value options.
O{}
@@ -78,8 +70,7 @@
\group_end: }{}
\keys_define:nn{}{
BigBoxout .inherit:n = BigFloat,
BigBoxout .inherit:n = Boxout,
BigBoxout .inherit:n = {BigFloat, Boxout},
}
\NewDocumentEnvironment{BigBoxout}{
@@ -148,27 +139,15 @@
}
\group_end: }{}
\tl_const:Nn \c_WrapBoxout_position_tl {o}
\tl_const:Ne \c_WrapBoxout_offset_tl {\marparwidth}
\tl_const:Nn \c_WrapBoxout_width_tl {3in}
\dim_const:Nn \c_WrapBoxout_width_dim {3in}
\keys_define:nn{}{
WrapBoxout .inherit:n = Boxout,
WrapBoxout .inherit:n = {WrapFig, Boxout},
}
\keys_define:nn{WrapBoxout}{
position .choices:nn = {l,r,c,i,o}{
\tl_set:Nn \l_WrapBoxout_position_tl {\l_keys_choice_tl}
},
position .initial:e = {\c_WrapBoxout_position_tl},
position .default:e = {\c_WrapBoxout_position_tl},
offset .tl_set:N = \l_WrapBoxout_offset_tl,
offset .initial:e = {\c_WrapBoxout_offset_tl},
offset .default:e = {\c_WrapBoxout_offset_tl},
width .tl_set:N = \l_WrapBoxout_width_tl,
width .initial:e = {\c_WrapBoxout_width_tl},
width .default:e = {\c_WrapBoxout_width_tl},
width .dim_set:N = \l_WrapBoxout_width_dim,
width .initial:e = {\c_WrapBoxout_width_dim},
width .default:e = {\c_WrapBoxout_width_dim},
}
\NewDocumentEnvironment{WrapBoxout}{
@@ -181,19 +160,25 @@
% #4: Body.
+b
}{ \group_begin:
%\keys_set:nn{WrapBoxout}{position,offset,width}
\keys_set:nn{WrapBoxout}{#1}
\__WrapFig_process_options:
% \message{
% WrapBoxout:~
% placement:~\l_WrapFig_placement_str,~
% hoffset:~\dim_use:N \l_WrapFig_hoffset_dim,~
% warning:~\bool_to_str:N \l_Boxout_warning_bool}
\expanded{\noexpand\begin{wrapstuff}[
\l_WrapBoxout_position_tl,
hoffset = \l_WrapBoxout_offset_tl,
]}%{\l_WrapBoxout_position_tl}[\l_WrapBoxout_offset_tl]}
\expanded{\noexpand\begin{minipage}{\l_WrapBoxout_width_tl}}
\l_WrapFig_placement_str,
hoffset = {\dim_use:N \l_WrapFig_hoffset_dim},
\l_WrapFig_passed_keys_str,
]}
%\begin{minipage}{\l_WrapBoxout_width_dim}
\begin{Boxout}[
innerspec:e = \l_Boxout_innerspec_tl,
innerspec:e = {\l_Boxout_innerspec_tl,columns={\dim_use:N \l_WrapBoxout_width_dim}},
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
]{#2}[#3]
#4
\end{Boxout}
\end{minipage}
%\end{minipage}
\end{wrapstuff}
\group_end: }{}