- 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

@@ -10,7 +10,7 @@
hypcap=true,
]{caption}
\captionsetup{
justification = centering,
justification = Centering,
font = {
small,
color=PrimeBlue,
@@ -18,59 +18,62 @@
}
% Define a justification style that is ragged on the side toward the outside of
% the page. I. e.
% the page. I. e. RaggedRight on
\RequirePackage{changepage}
%\RequirePackage{ifthen}
\DeclareCaptionJustification{raggedoutside}{
\checkoddpage
\ifoddpage
\raggedright
\else
\raggedleft
\fi
\DeclareCaptionJustification{RaggedOutside}{%
\ifthenelse{\boolean{isElectronic}}{%
\RaggedRight%
}{%
\checkoddpage%
\ifoddpage%
\RaggedRight%
\else%
\RaggedLeft%
\fi%
}%
}
\RequirePackage{calc}
\RequirePackage{wrapfig2}
\newcommand{\iconsize}{0.25in}
\NewDocumentCommand{\iconsize}{}{0.25in}
\newcommand{\ig}[2][0.5in]{
\NewDocumentCommand{\ig}{O{0.5in} m}{
\includegraphics[keepaspectratio,width=#1]{#2}
}
\newcommand{\cfig}[4]{%
}
\newcommand{\centerfig}[4][]{
\NewDocumentCommand{\centerfig}{O{} m >{\TrimSpaces}m m}{
\begin{figure}[htpb]%
\centering%
\Centering%
\includegraphics[keepaspectratio,#1]{#2}%
\caption{#4}%
\label{fig:#3}%
\end{figure}%
}
\newcommand{\bigfig}[4][\bigfloatoverhang]{%
\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{%
\bigfloat[#1]{figure}{htpb}{%
\captionsetup{type=figure}%
\includegraphics[keepaspectratio,width=\textwidth]{#2}%
\centering\captionof{figure}{#4}\par%
\Centering\captionof{figure}{#4}\par%
\label{fig:#3}%
}%
}
\newcommand{\doublebigfig}[7][\bigfloatoverhang]{%
\NewDocumentCommand{\doublebigfig}{%
O{\bigfloatoverhang} m >{\TrimSpaces}m m m >{\TrimSpaces}m m%
}{%
\bigfloat[#1]{figure}{p}{%
\captionsetup{type=figure}%
\includegraphics[keepaspectratio,width=\textwidth]{#2}%
\centering\captionof{figure}{#4}\par%
\Centering\captionof{figure}{#4}\par%
\label{fig:#3}
\bigskip
\captionsetup{type=figure}%
\includegraphics[keepaspectratio,width=\textwidth]{#5}%
\centering\captionof{figure}{#7}\par%
\Centering\captionof{figure}{#7}\par%
\label{fig:#6}%
}%
}
@@ -82,7 +85,9 @@
\textwidth / 2 + \bigfloatoverhang - \twinfigspace
]{\twinfigwidth}
\newcommand{\twinfig}[7][\bigfloatoverhang]{%
\NewDocumentCommand{\twinfig}{%
O{\bigfloatoverhang} m >{\TrimSpaces}m m m >{\TrimSpaces}m m%
}{%
\bigfloat[#1]{figure}{htpb}{%
\begin{tblr}{%
colspec = {%
@@ -119,7 +124,9 @@
}%
}
\newcommand{\wrapfig}[6][0in]{%
\NewDocumentCommand{\wrapfig}{%
O{0in} m m m >{\TrimSpaces}m m%
}{%
% Syntax:
% \wrapfig[%
% horizontal_offset
@@ -142,7 +149,7 @@
keepaspectratio,%
#4%
]{#2}%
\centering\captionof{figure}{#6}%
\Centering\captionof{figure}{#6}%
\label{fig:#5}%
\end{wrapfigure}%
}