- Fix WrapBoxout.
- Migrate from wrapfig2 to wrapstuff. - Miscellaneous improvements.
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
O{}
|
||||
% #4: Body, passed to @boxout.
|
||||
+b
|
||||
}{%
|
||||
}{ \group_begin:
|
||||
\keys_set:nn{Boxout}{#1}
|
||||
\bool_if:nT \l_Boxout_warning_bool {
|
||||
\colorlet{boxoutBG}{warningBG}
|
||||
@@ -75,7 +75,7 @@
|
||||
#4\\
|
||||
\end{tblrBoxout}
|
||||
}
|
||||
}{}
|
||||
\group_end: }{}
|
||||
|
||||
\keys_define:nn{}{
|
||||
BigBoxout .inherit:n = BigFloat,
|
||||
@@ -91,41 +91,84 @@
|
||||
O{}
|
||||
% #4: Body, passed to Boxout.
|
||||
+b
|
||||
}{
|
||||
}{ \group_begin:
|
||||
\keys_set:nn{BigBoxout}{#1}
|
||||
\begin{BigFloat}[
|
||||
type = generic,
|
||||
overhang = \l_BigFloat_overhang_dim,
|
||||
placement:e = \l_Float_placement_clist,
|
||||
offset = \l_BigFloat_offset_fp,
|
||||
]%
|
||||
\begin{Boxout}[%
|
||||
]
|
||||
\begin{Boxout}[
|
||||
innerspec:e = \l_Boxout_innerspec_tl,
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
]{#2}[#3]
|
||||
#4
|
||||
\end{Boxout}
|
||||
\end{BigFloat}
|
||||
}{}
|
||||
\group_end: }{}
|
||||
|
||||
\str_const:Nn \c_WrapBoxout_position_str {o}
|
||||
\dim_const:Nn \c_WrapBoxout_offset_dim {\marparwidth}
|
||||
\dim_const:Nn \c_WrapBoxout_width_dim {3in}
|
||||
\str_const:Nn \c_MarginBoxout_position_str {auto}
|
||||
\dim_const:Nn \c_MarginBoxout_width_dim {\marginparwidth}
|
||||
|
||||
\keys_define:nn{}{
|
||||
MarginBoxout .inherit:n = Boxout,
|
||||
}
|
||||
|
||||
\keys_define:nn{MarginBoxout}{
|
||||
position .choices:nn = {auto,reverse,left,right,nearest}{
|
||||
\str_set:Ne \l_MarginBoxout_position_str {\l_keys_choice_tl}
|
||||
},
|
||||
position .initial:e = {\c_MarginBoxout_position_str},
|
||||
|
||||
width .dim_set:N = \l_MarginBoxout_width_dim,
|
||||
width .initial:e = {\c_MarginBoxout_width_dim},
|
||||
}
|
||||
|
||||
\NewDocumentEnvironment{MarginBoxout}{
|
||||
% #1: Key-value options.
|
||||
O{}
|
||||
% #2: Label.
|
||||
>{\TrimSpaces}m
|
||||
% #3: Caption
|
||||
O{}
|
||||
% #4: Body.
|
||||
+b
|
||||
}{ \group_begin:
|
||||
\keys_set:nn {MarginBoxout} {#1}
|
||||
\marginalia[
|
||||
width = \l_MarginBoxout_width_dim,
|
||||
]{
|
||||
\begin{Boxout}[
|
||||
innerspec:e = \l_Boxout_innerspec_tl,
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
]{#2}[#3]
|
||||
#4
|
||||
\end{Boxout}
|
||||
}
|
||||
\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}
|
||||
|
||||
\keys_define:nn{}{
|
||||
WrapBoxout .inherit:n = Boxout,
|
||||
}
|
||||
\keys_define:nn{WrapBoxout}{
|
||||
position .choices:nn = {L,l,R,r,I,i,O,o}{
|
||||
\str_set:Nn \l_WrapBoxout_position_str {\l_keys_choice_tl}
|
||||
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_str},
|
||||
position .initial:e = {\c_WrapBoxout_position_tl},
|
||||
position .default:e = {\c_WrapBoxout_position_tl},
|
||||
|
||||
offset .dim_set:N = \l_WrapBoxout_offset_dim,
|
||||
offset .initial:e = {\c_WrapBoxout_offset_dim},
|
||||
offset .tl_set:N = \l_WrapBoxout_offset_tl,
|
||||
offset .initial:e = {\c_WrapBoxout_offset_tl},
|
||||
offset .default:e = {\c_WrapBoxout_offset_tl},
|
||||
|
||||
width .dim_set:N = \l_WrapBoxout_width_dim,
|
||||
width .initial:e = {\c_WrapBoxout_width_dim},
|
||||
width .tl_set:N = \l_WrapBoxout_width_tl,
|
||||
width .initial:e = {\c_WrapBoxout_width_tl},
|
||||
width .default:e = {\c_WrapBoxout_width_tl},
|
||||
}
|
||||
|
||||
\NewDocumentEnvironment{WrapBoxout}{
|
||||
@@ -137,16 +180,20 @@
|
||||
O{}
|
||||
% #4: Body.
|
||||
+b
|
||||
}{%
|
||||
}{ \group_begin:
|
||||
%\keys_set:nn{WrapBoxout}{position,offset,width}
|
||||
\keys_set:nn{WrapBoxout}{#1}
|
||||
\begin{wrapfigure}{\l_WrapBoxout_position_str}[\l_WrapBoxout_offset_dim]%
|
||||
\begin{minipage}{\l_WrapBoxout_width_dim}%
|
||||
\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}}
|
||||
\begin{Boxout}[
|
||||
innerspec:e = \l_Boxout_innerspec_tl,
|
||||
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
|
||||
]{#2}[#3]%
|
||||
#4%
|
||||
\end{Boxout}%
|
||||
\end{minipage}%
|
||||
\end{wrapfigure}%
|
||||
}{}
|
||||
]{#2}[#3]
|
||||
#4
|
||||
\end{Boxout}
|
||||
\end{minipage}
|
||||
\end{wrapstuff}
|
||||
\group_end: }{}
|
||||
Reference in New Issue
Block a user