Try to use l3keys.

This commit is contained in:
2025-09-02 16:42:46 -05:00
parent d8286a0904
commit d8ee8bf058
8 changed files with 159 additions and 94 deletions

View File

@@ -4,9 +4,7 @@
% Suppress warning about \showhyphens being changed.
\let\CheckCommand\providecommand
\RequirePackage{ifthen}
\NewDocumentCommand{\providelength}{m O{0pt}}{%
\NewDocumentCommand{\ProvideLength}{m O{0pt}}{%
\ifdeflength{#1}{% It is already defined!
}{% Not defined, so define it!
\newlength{#1}%
@@ -60,8 +58,8 @@
\RequirePackage{calc}
\RequirePackage[strict]{changepage}
\providelength{\marparwidth}[\marginparsep + \marginparwidth]
\providelength{\contentwidth}[\textwidth + \marparwidth]
\ProvideLength{\marparwidth}[\marginparsep + \marginparwidth]
\ProvideLength{\contentwidth}[\textwidth + \marparwidth]
\RequirePackage[
debug,
@@ -114,10 +112,11 @@
}%
}{}
\newcommand{\bigfloatoffsetratio}{2}
\newcommand{\bigfloatoffsetratio}{2.0}
% Maximum width adjustment to fit 2 16x9 screensots on one page.
\providelength{\bigfloatoverhang}[0.54in]
\ProvideLength{\bigfloatoverhang}[0.54in]
\newcommand{\bigfloatplacement}{htpb}
\floatstyle{plain}
\newfloat{generic}{htpb}{lgf}
@@ -128,9 +127,9 @@
% #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{htpb}
% #4: Offset: the distance to offset the center of the BigFloat from the center
% of the text block.
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
@@ -148,4 +147,49 @@
\end{minipage}%
\end{SmartAdjustWidth}%
\end{#1}%
}{}
}{}
\AtBeginDocument{
\ifthenelse{\boolean{isElectronic}}{
\newgeometry{
inner = 0.75in,
top = 66pt, % 11/12in
marginratio = 2:3,
}
\savegeometry{smallMargin}
\newgeometry{
inner = 24pt, % 1/3in
top = 0.25in,
marginratio = 2:3,
}
\savegeometry{tinyMargin}
}{
\newgeometry{
twoside = true,
inner = 0.75in,
top = 66pt, % 11/12in
marginratio = 2:3,
}
\savegeometry{smallMargin}
\newgeometry{
twoside = true,
inner = 24pt, % 1/3in
top = 0.25in,
marginratio = 2:3,
}
\savegeometry{tinyMargin}
}
\restoregeometry
\NewDocumentEnvironment{SmallMargin}{O{0.0in} O{-0.25in}}{
\clearpage
\loadgeometry{smallMargin}
\setlength{\insideheaderoffset}{#1}
\setlength{\outsideheaderoffset}{#2}
\pagestyle{fancy}
}{
\clearpage
\pagestyle{fancy}
\restoregeometry
}
}