Refactoring Boxouts.

This commit is contained in:
2025-08-26 17:00:31 -05:00
parent 7945ab0e6b
commit 1ce3cd364f
5 changed files with 207 additions and 99 deletions

View File

@@ -47,7 +47,6 @@
\RequirePackage{calc}
\RequirePackage[strict]{changepage}
%\newlength{\contentwidth}
\providelength{\marparwidth}[\marginparsep + \marginparwidth]
\providelength{\contentwidth}[\textwidth + \marparwidth]
@@ -89,25 +88,45 @@
\providecommand{\adjwidthtype}{}
\NewDocumentCommand{\bigfloat}{
O{\bigfloatoverhang} m m +m O{\bigfloatoffset}
\makeatletter
\NewDocumentCommand{\BigFloat}{
% Overhang: the distance that the BigFloat extends into the margins.
O{\bigfloatoverhang}
% Float position: where the float may appear on the page.
O{htpb}
% Offset: the distance to offset the center of the BigFloat from the center
% of the text block.
O{\bigfloatoffset}
% Float type: figure or table.t
m
% Content: what appears in the BigFloat.
+m
}{%
\ifthenelse{\boolean{isElectronic}}{%
\bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}%
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}%
}{%
\bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}%
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}%
}%
}
\NewDocumentCommand{\bfloat}{m m m +m m m}{
\begin{#2}[#3]%
\begin{#6}{-#1+#5}{-#1-#5}%
\NewDocumentCommand{\@bfloat}{
% First 5 arguments are same as \BigFloat.
m m m m +m
% Argument 6 is the adjustwidth type [adjustwidth for one-sided document,
% adjustwidth* for two-sided].
m
}{
\begin{#4}[#2]% figure/table
\begin{#6}{-#1+#3}{-#1-#3}% adjustwidth(*)
\begin{minipage}{#1 * 2 + \textwidth}%
\ifthenelse{\boolean{isDraft}}{%
\rule{\textwidth}{1pt}\zws%
}{}%
#4%
#5%
\end{minipage}%
\end{#6}%
\end{#2}%
}
\end{#4}%
}
\makeatother