Refine layout.

This commit is contained in:
Silcantar
2025-08-26 22:09:40 -05:00
parent 1ce3cd364f
commit 01a598b3aa
5 changed files with 27 additions and 92 deletions

View File

@@ -42,14 +42,14 @@
\NewDocumentEnvironment{BigBoxout}{ \NewDocumentEnvironment{BigBoxout}{
O{\bigfloatoverhang} O{\bigfloatoverhang}
O{htpb} O{htpb}
O{\bigfloatoffset} O{\bigfloatoffsetratio}
O{X[l,h]} O{X[l,h]}
>{\TrimSpaces}m >{\TrimSpaces}m
+m +m
+b +b
}{ }{
\begin{figure}[#2]% \begin{figure}[#2]%
\begin{adjustwidth}{-#1 + #3}{-#1 - #3}% \begin{adjustwidth}{-#1 * \real{#3}}{-#1 / \real{#3}}%
\begin{Boxout}[#4]{#5}{#6}% \begin{Boxout}[#4]{#5}{#6}%
#7% #7%
\end{Boxout}% \end{Boxout}%
@@ -77,68 +77,3 @@
\end{minipage}% \end{minipage}%
\end{wrapfigure}% \end{wrapfigure}%
}{} }{}
% \NewDocumentCommand{\Boxout}{
% % width
% O{\textwidth}
% % label
% >{\TrimSpaces}m
% % heading
% +m
% % body
% +m
% }{%
% {% Temporarily set \fboxsep and \fboxrule.
% \setlength{\fboxrule}{\boxoutrule}%
% \setlength{\fboxsep}{\boxoutpadding}%
% \fcolorbox{boxoutfgcolor}{boxoutbgcolor}{%
% \begin{minipage}{#4 - \fboxrule * 2 - \fboxsep * 2}%
% %{\Centering%
% \captionlistentry[figure]{#3.}%
% \label{box:#1}%
% \setlength{\parskip}{\medskipamount}%
% {\Centering\slab{\strong{#2}}\par}%
% \justifying\small{}#3%
% %}%
% \end{minipage}%
% }%
% }%
% }
% \NewDocumentCommand{\BigBoxout}{%
% % overhang
% O{\bigfloatoverhang}
% % Float position.
% O{htpb}
% % offset
% O{\bigfloatoffset}
% % label
% m
% % heading
% +m
% % body
% +m
% }{%
% \BigFloat[#1][#2][#3]{figure}{%
% \Boxout{#4}{#5}{#6}%
% }%
% }
% \NewDocumentCommand{\WrapBoxout}{%
% % position [l,r,i,o]
% O{O}
% % offset
% O{\marparwidth}
% % width
% O{3in}
% % label
% m
% % heading
% +m
% % body
% +m
% }{%
% \begin{wrapfigure}{#1}[#2]%
% \Boxout[#3]{#4}{#5}{#6}%
% \end{wrapfigure}%
% }

View File

@@ -46,14 +46,14 @@
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}% \fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}%
} }
\providelength{\warningboxwidth}[\textwidth - \fboxsep * 2 - \fboxrule *2] \providelength{\warningboxwidth}[
\textwidth - \fboxsep * 2 - \fboxrule * 2 - 5.56pt % Magic number to make it fit.
]
\NewDocumentCommand{\warningbox}{O{\warningboxwidth} +m}{% \NewDocumentCommand{\warningbox}{O{\warningboxwidth} +m}{%
\noindent%
\fcolorbox{WarningBoxFGColor}{WarningBoxBGColor}{% \fcolorbox{WarningBoxFGColor}{WarningBoxBGColor}{%
\noindent%
\begin{minipage}{#1}% \begin{minipage}{#1}%
\raggedbottom% %\rule{\textwidth}{1pt}\zws% For debugging.
#2% #2%
\end{minipage}% \end{minipage}%
}% }%

View File

@@ -27,8 +27,8 @@
\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{% \NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{%
\BigFloat[#1]{figure}{% \BigFloat[#1]{figure}{%
\captionsetup{type=figure}% \captionsetup{type=figure}%
\includegraphics[keepaspectratio,width=\textwidth]{#2}% \includegraphics[keepaspectratio,width=\linewidth]{#2}%
\Centering\captionof{figure}{#4}\par% \Centering\captionof{figure}{#4}%\par
\label{fig:#3}% \label{fig:#3}%
}% }%
} }
@@ -37,7 +37,7 @@
% BigFloat overhang. % BigFloat overhang.
O{\bigfloatoverhang} O{\bigfloatoverhang}
% BigFloat offet. % BigFloat offet.
O{\bigfloatoffset} O{\bigfloatoffsetratio}
% First graphic filename. % First graphic filename.
m m
% First graphic label. % First graphic label.
@@ -76,10 +76,8 @@
}{% }{%
\BigFloat[#1]{table}{% \BigFloat[#1]{table}{%
\begin{tblr}{% \begin{tblr}{%
colspec = {% colspec = {*{2}{Q[c,m,wd=\twinfigwidth]}},%
*{2}{Q[c,m,wd=\twinfigwidth]}% hlines = {0pt},
},%
%hlines,% For debugging. Comment out when done.
%vlines,% For debugging. Comment out when done. %vlines,% For debugging. Comment out when done.
hborder{1,Z} = {% hborder{1,Z} = {%
abovespace = 0pt,% abovespace = 0pt,%

View File

@@ -1,6 +1,15 @@
\NeedsTeXFormat{LaTeX2e} \NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{PrimeTeX/packages/Header}[2025-08-16] \ProvidesPackage{PrimeTeX/packages/Header}[2025-08-16]
\RequirePackage{PrimeTeX/packages/Layout}
\providelength{\insideheaderoffset}[
\bigfloatoverhang * \real{\bigfloatoffsetratio}
]
\providelength{\outsideheaderoffset}[
\bigfloatoverhang / \real{\bigfloatoffsetratio}
]
% Header & Footer Options % Header & Footer Options
\RequirePackage{fancyhdr} \RequirePackage{fancyhdr}
\pagestyle{fancy} \pagestyle{fancy}
@@ -11,11 +20,6 @@
\renewcommand{\headrulewidth}{0pt} \renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}
\newlength{\insideheaderoffset}
\setlength{\insideheaderoffset}{0.5in}
\newlength{\outsideheaderoffset}
\setlength{\outsideheaderoffset}{1.0in}
\NewDocumentCommand{\chapappname}{}{Chapter \thechapter{}: } \NewDocumentCommand{\chapappname}{}{Chapter \thechapter{}: }
\NewDocumentCommand{\partlabel}{}{\partname{} \thepart{}: \parttitle} \NewDocumentCommand{\partlabel}{}{\partname{} \thepart{}: \parttitle}

View File

@@ -6,11 +6,11 @@
% Suppress "Underfull \hbox" infos. % Suppress "Underfull \hbox" infos.
\hbadness=10000 \hbadness=10000
% Suppress small overfull infos. % Suppress small overfull infos.
\hfuzz = 6.0pt \hfuzz = 0.0pt
\vfuzz = 0.0pt \vfuzz = 0.0pt
\NewDocumentCommand{\providelength}{m O{0pt}}{% \NewDocumentCommand{\providelength}{m O{0pt}}{%
\ifdeflength{#2}{% It is already defined! \ifdeflength{#1}{% It is already defined!
}{% Not defined, so define it! }{% Not defined, so define it!
\newlength{#1}% \newlength{#1}%
}% }%
@@ -79,12 +79,10 @@
% Line-breaking dot % Line-breaking dot
\NewDocumentCommand{\bdot}{}{.\zws} \NewDocumentCommand{\bdot}{}{.\zws}
\newlength{\bigfloatoffset} \newcommand{\bigfloatoffsetratio}{0.667}
\setlength{\bigfloatoffset}{0.25in}
% Maximum width adjustment to fit 2 16x9 screensots on one page. % Maximum width adjustment to fit 2 16x9 screensots on one page.
\newlength{\bigfloatoverhang} \providelength{\bigfloatoverhang}[0.81in]
\setlength{\bigfloatoverhang}{0.81in}
\providecommand{\adjwidthtype}{} \providecommand{\adjwidthtype}{}
@@ -97,7 +95,7 @@
O{htpb} O{htpb}
% Offset: the distance to offset the center of the BigFloat from the center % Offset: the distance to offset the center of the BigFloat from the center
% of the text block. % of the text block.
O{\bigfloatoffset} O{\bigfloatoffsetratio}
% Float type: figure or table.t % Float type: figure or table.t
m m
% Content: what appears in the BigFloat. % Content: what appears in the BigFloat.
@@ -118,7 +116,7 @@
m m
}{ }{
\begin{#4}[#2]% figure/table \begin{#4}[#2]% figure/table
\begin{#6}{-#1+#3}{-#1-#3}% adjustwidth(*) \begin{#6}{-#1 * \real{#3}}{-#1 / \real{#3}}% adjustwidth(*)
\begin{minipage}{#1 * 2 + \textwidth}% \begin{minipage}{#1 * 2 + \textwidth}%
\ifthenelse{\boolean{isDraft}}{% \ifthenelse{\boolean{isDraft}}{%
\rule{\textwidth}{1pt}\zws% \rule{\textwidth}{1pt}\zws%