- Debugging.

- Move all \RequirePackages to commonincludes.def.
This commit is contained in:
2025-09-12 16:15:29 -05:00
parent 0e68ac723d
commit 029916b8d6
19 changed files with 209 additions and 243 deletions

View File

@@ -3,11 +3,6 @@
Commands for typesetting boxouts.
}
\RequirePackage{PrimeTeX/packages/Layout}
\RequirePackage{PrimeTeX/packages/Color}
\RequirePackage{PrimeTeX/packages/Tables}
\RequirePackage{calc}
\ProvideLength{\boxoutpadding}[1em]
\ProvideLength{\boxoutrule}[1pt]
@@ -32,21 +27,22 @@
\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},
warning .bool_set:N = \l_Boxout_warning_bool,
warning .initial:e = {false},
warning .default:e = {true},
format .cs_set:Np = \__Boxout_format:,
format .initial:n = {\justifying},
}
\NewDocumentEnvironment{Boxout}{
% #1: Key-value options.
O{}
% #2: Label, passed to @boxout argument #1.
% #2: Label.
>{\TrimSpaces}m
% #3: Caption.
O{}
% #4: Body, passed to @boxout.
% #4: Body.
+b
}{ \group_begin:
\keys_set:nn{Boxout}{#1}
@@ -54,17 +50,20 @@
\colorlet{boxoutBG}{warningBG}
\colorlet{boxoutFG}{warningFG}
}
\color{text}
\label{box:#2}
\tl_if_empty:nTF {#3} {
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
\setlength{\parskip}{\medskipamount}
#4\\
\setlength{\parindent}{0pt}
\__Boxout_format:\ignorespaces#4\\
\end{tblrBoxout}
}{
\expanded{\noexpand\begin{tblrBoxout}{\l_Boxout_innerspec_tl}}
\SetCell{halign=c, font={\sbfamily\bfseries}}{#3}\\
\setlength{\parskip}{\medskipamount}
#4\\
\setlength{\parindent}{0pt}
\__Boxout_format:\ignorespaces#4\\
\end{tblrBoxout}
}
\group_end: }{}
@@ -140,16 +139,21 @@
\group_end: }{}
\dim_const:Nn \c_WrapBoxout_width_dim {3in}
\dim_const:Nn \c_WrapBoxout_justifywidth_dim {18em}
\keys_define:nn{}{
WrapBoxout .inherit:n = {WrapFig, Boxout},
}
\keys_define:nn{WrapBoxout}{
justifywidth.dim_set:N = \l_WrapBoxout_justifywidth_dim,
justifywidth.initial:e = {\c_WrapBoxout_justifywidth_dim},
width .dim_set:N = \l_WrapBoxout_width_dim,
width .initial:e = {\c_WrapBoxout_width_dim},
width .default:e = {\c_WrapBoxout_width_dim},
}
\cs_new:Npn \__WrapBoxout_format: {}
\NewDocumentEnvironment{WrapBoxout}{
% #1: Key-value options.
O{}
@@ -162,6 +166,11 @@
}{ \group_begin:
\keys_set:nn{WrapBoxout}{#1}
\__WrapFig_process_options:
\dim_compare:nNnTF {\l_WrapBoxout_width_dim} > {\l_WrapBoxout_justifywidth_dim} {
\cs_set:Npn \__WrapBoxout_format: {\justifying}
} {
\cs_set:Npn \__WrapBoxout_format: {\l_WrapFig_format_tl}
}
% \message{
% WrapBoxout:~
% placement:~\l_WrapFig_placement_str,~
@@ -176,6 +185,7 @@
\begin{Boxout}[
innerspec:e = {\l_Boxout_innerspec_tl,columns={\dim_use:N \l_WrapBoxout_width_dim}},
warning:e = \bool_to_str:N \l_Boxout_warning_bool,
format = {\__WrapBoxout_format:}
]{#2}[#3]
#4
\end{Boxout}