Rewrite Float commands in Latex3 and move them to new Floats package.

This commit is contained in:
2025-09-03 16:49:37 -05:00
parent 3b6514b182
commit 5178581bbb
8 changed files with 381 additions and 260 deletions

View File

@@ -95,11 +95,6 @@
% N.B.: floatpagefraction MUST be less than topfraction !!
\renewcommand{\dblfloatpagefraction}{0.8} % require fuller float pages
% Line-breaking zero-width space
\NewDocumentCommand{\zws}{}{\hspace{0pt}}
% Line-breaking dot
\NewDocumentCommand{\bdot}{}{.\zws}
\NewDocumentEnvironment{SmartAdjustWidth}{O{\boolean{isElectronic}} m m +b}{%
\ifthenelse{#1}{%
\begin{adjustwidth}{#2}{#3}%
@@ -112,43 +107,6 @@
}%
}{}
\newcommand{\bigfloatoffsetratio}{2.0}
% Maximum width adjustment to fit 2 16x9 screensots on one page.
\ProvideLength{\bigfloatoverhang}[0.54in]
\newcommand{\bigfloatplacement}{htpb}
\floatstyle{plain}
\newfloat{generic}{htpb}{lgf}
\NewDocumentEnvironment{BigFloat}{
% #1: Float type
O{generic}
% #2: Overhang: the distance that the BigFloat extends into the margins.
O{\bigfloatoverhang}
% #3: Float position: where the float may appear on the page.
O{\bigfloatplacement}
% #4: Offset: the ratio between the overhangs on the inside and outside of
% BigFloat.
O{\bigfloatoffsetratio}
% #5: Body: what appears in the BigFloat.
+b
}{%
\begin{#1}[#3]% float environment
\begin{SmartAdjustWidth}{-#2}{-#2 * \real{#4}}% adjustwidth(*)
\begin{minipage}{\linewidth}%{#2 * (#4 + 1) + \textwidth}%
\ifthenelse{\boolean{isDraft}}{%
{\color{layout}\rule{\textwidth}{1pt}\zws}%
#5%
%{\color{layout}\rule{\textwidth}{1pt}}%
}{%
#5%
}%
\end{minipage}%
\end{SmartAdjustWidth}%
\end{#1}%
}{}
\AtBeginDocument{
\ifthenelse{\boolean{isElectronic}}{
\newgeometry{
@@ -181,11 +139,14 @@
}
\restoregeometry
\ExplSyntaxOn
\NewDocumentEnvironment{SmallMargin}{O{0.0in} O{-0.25in}}{
\clearpage
\loadgeometry{smallMargin}
\setlength{\insideheaderoffset}{#1}
\setlength{\outsideheaderoffset}{#2}
\setlength{\HeaderInsideOffset}{#1}
%\dim_set:Nn \g_header_insideoffset_dim {#1}
\setlength{\HeaderOutsideOffset}{#2}
%\dim_set:Nn \g_header_outsideoffset_dim {#2}
\pagestyle{fancy}
}{
\clearpage