- Replace all \newcommands with \NewDocumentCommand.

- Add Ragged2e dependency for better alignment options.
- Refine marginalia, widow control.
This commit is contained in:
Silcantar
2025-08-18 22:00:52 -05:00
parent 89340afd62
commit 0c84476fc5
12 changed files with 115 additions and 110 deletions

View File

@@ -46,9 +46,9 @@
% all,
% ]{nowidow}
\RequirePackage{lua-widow-control}
\RequirePackage[balanced]{lua-widow-control}
\ifthenelse{\boolean{isDraft}}{
\lwcdraft{draft}
\lwcsetup{draft}
}{}
% Paragraph formatting.
@@ -71,9 +71,9 @@
\renewcommand{\dblfloatpagefraction}{0.8} % require fuller float pages
% Line-breaking zero-width space
\newcommand{\zws}{\hspace{0pt}}
\NewDocumentCommand{\zws}{}{\hspace{0pt}}
% Line-breaking dot
\newcommand{\bdot}{.\hspace{0pt}}
\NewDocumentCommand{\bdot}{}{.\hspace{0pt}}
\newlength{\bigfloatoffset}
\setlength{\bigfloatoffset}{0.25in}
@@ -82,7 +82,7 @@
\newlength{\bigfloatoverhang}
\setlength{\bigfloatoverhang}{0.81in}
\newcommand{\bigfloat}[4][\bigfloatoverhang]{%
\NewDocumentCommand{\bigfloat}{O{\bigfloatoverhang} m m +m}{%
\begin{#2}[#3]%
\ifthenelse{\boolean{isElectronic}}{
\begin{adjustwidth}{-#1+\bigfloatoffset}{-#1-\bigfloatoffset}%
@@ -100,31 +100,24 @@
\end{#2}%
}
% \newcommand{\bignotfloat}[2][\bigfloatoverhang]{%
% \begin{adjustwidth*}{-#1+\bigfloatoffset}{-#1-\bigfloatoffset}%
% \begin{minipage}{#1 * 2 + \textwidth}%
% #2%
% \end{minipage}%
% \end{adjustwidth*}%
% }
\providelength[0.5em]{\boxoutpadding}
\newlength{\boxoutpadding}
\setlength{\boxoutpadding}{0.5em}
\colorlet{boxoutbgcolor}{PrimePaleBlue}
\colorlet{boxoutfgcolor}{PrimeBlue}
\newcommand{\boxoutbgcolor}{PrimePaleBlue}
\newcommand{\boxoutfgcolor}{PrimeBlue}
\newcommand{\boxout}[5][0in]{%
\NewDocumentCommand{\boxout}{%
O{0in} m m >{\TrimSpaces}m +m%
}{%
\begin{wrapfigure}{#2}[#1]%
\fcolorbox{\boxoutfgcolor}{\boxoutbgcolor}{%
\fcolorbox{boxoutfgcolor}{boxoutbgcolor}{%
\begin{minipage}{#3}%
\vspace{\boxoutpadding}%
{\centering%
{\Centering%
\begin{minipage}{\boxoutpadding*-2 + \textwidth}%
\label{box:#4}%
\setlength{\parskip}{\medskipamount}%
{\centering\slab{\strong{#4}}\par}%
\small{}#5%
{\Centering\slab{\strong{#4}}\par}%
\justifying\small{}#5%
\end{minipage}%
\par}%
\vspace{\boxoutpadding}%
@@ -133,17 +126,19 @@
\end{wrapfigure}%
}
\newcommand{\bigboxout}[4][\bigfloatoverhang]{%
\NewDocumentCommand{\bigboxout}{%
O{\bigfloatoverhang} m >{\TrimSpaces}m +m%
}{%
\bigfloat[#1]{figure}{#2}{%
\fcolorbox{\boxoutfgcolor}{\boxoutbgcolor}{%
\fcolorbox{boxoutfgcolor}{boxoutbgcolor}{%
\begin{minipage}{\boxoutpadding*-2 + \textwidth}%
\vspace{\boxoutpadding}%
{\centering%
{\Centering%
\begin{minipage}{\boxoutpadding*-2 + \textwidth}%
\label{box:#3}%
\setlength{\parskip}{\medskipamount}%
{\centering\slab{\strong{#3}}\par}%
\small{}#4%
{\Centering\slab{\strong{#3}}\par}%
\justifying\small{}#4%
\end{minipage}%
\par}%
\vspace{\boxoutpadding}%