- Refine Boxouts.

- General refactoring.
This commit is contained in:
2025-08-27 16:41:25 -05:00
parent 01a598b3aa
commit f9a6c6e7cc
8 changed files with 138 additions and 97 deletions

View File

@@ -9,34 +9,58 @@
\providelength{\boxoutpadding}[1em] \providelength{\boxoutpadding}[1em]
\providelength{\boxoutrule}[1pt] \providelength{\boxoutrule}[1pt]
\colorlet{boxoutbgcolor}{PrimePaleBlue} \colorlet{BoxoutBGColor}{PrimePaleBlue}
\colorlet{boxoutfgcolor}{PrimeBlue} \colorlet{BoxoutFGColor}{PrimeBlue}
\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118}
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}
\NewTblrEnviron{tblrBoxout} \NewTblrEnviron{tblrBoxout}
\SetTblrInner[tblrBoxout]{ \SetTblrInner[tblrBoxout]{
%colspec = {X[1,l,h]}, cells = {BoxoutBGColor},
cells = {boxoutbgcolor}, hborder{1} = {belowspace=\boxoutpadding},
hlines = {0pt}, hborder{Z} = {abovespace=\boxoutpadding},
hline{1,Z} = {\boxoutrule,boxoutfgcolor}, hlines = {0pt,BoxoutBGColor},
row{1} = {font={\bfseries\sbfamily}}, hline{1,Z} = {\boxoutrule,BoxoutFGColor},
%row{1} = {font={\bfseries\sbfamily}},
vborder{1} = {rightspace=\boxoutpadding}, vborder{1} = {rightspace=\boxoutpadding},
vborder{Z} = {leftspace=\boxoutpadding}, vborder{Z} = {leftspace=\boxoutpadding},
vlines = {0pt}, vlines = {0pt,BoxoutBGColor},
vline{1,Z} = {\boxoutrule,boxoutfgcolor}, vline{1,Z} = {\boxoutrule,BoxoutFGColor},
} }
\NewDocumentEnvironment{@boxout}{
m m +b
}{
\label{box:#2}%
\begin{tblrBoxout}{#1}%
#3%
\end{tblrBoxout}%
}{}
\NewDocumentEnvironment{Boxout}{ \NewDocumentEnvironment{Boxout}{
O{colspec={X[l,h]}} O{colspec={X[l,h]}}
>{\TrimSpaces}m >{\TrimSpaces}m
+m +m
o
+b +b
}{% }{%
\label{box:#2}% \ifthenelse{\equal{#4}{w}\OR\equal{#4}{W}}{%
\captionlistentry[figure]{#3}% \colorlet{BoxoutBGColor}{WarningBoxBGColor}%
\begin{tblrBoxout}{#1}% \colorlet{BoxoutFGColor}{WarningBoxFGColor}%
{\Centering{}#3}\\% }{}%
#4\\% \IfBlankTF{#3}{%
\end{tblrBoxout}% \begin{@boxout}{#1}{#2}{}%
\setlength{\parskip}{\medskipamount}%
#5\\%
\end{@boxout}%
}{%
\begin{@boxout}{#1}{#2}%
{\Centering\sbfamily\bfseries #3}\\%
\setlength{\parskip}{\medskipamount}%
#5\\%
\end{@boxout}%
}%
}{} }{}
\NewDocumentEnvironment{BigBoxout}{ \NewDocumentEnvironment{BigBoxout}{
@@ -46,12 +70,13 @@
O{X[l,h]} O{X[l,h]}
>{\TrimSpaces}m >{\TrimSpaces}m
+m +m
o
+b +b
}{ }{
\begin{figure}[#2]% \begin{figure}[#2]%
\begin{adjustwidth}{-#1 * \real{#3}}{-#1 / \real{#3}}% \begin{adjustwidth}{-#1}{-#1 * \real{#3}}%
\begin{Boxout}[#4]{#5}{#6}% \begin{Boxout}[#4]{#5}{#6}[#7]%
#7% #8%
\end{Boxout}% \end{Boxout}%
\end{adjustwidth}% \end{adjustwidth}%
\end{figure}% \end{figure}%
@@ -67,12 +92,13 @@
O{X[l,h]} O{X[l,h]}
>{\TrimSpaces}m >{\TrimSpaces}m
+m +m
o
+b +b
}{% }{%
\begin{wrapfigure}{#1}[#2]% \begin{wrapfigure}{#1}[#2]%
\begin{minipage}{#3}% \begin{minipage}{#3}%
\begin{Boxout}[#4]{#5}{#6}% \begin{Boxout}[#4]{#5}{#6}[#7]%
#7% #8%
\end{Boxout}% \end{Boxout}%
\end{minipage}% \end{minipage}%
\end{wrapfigure}% \end{wrapfigure}%

View File

@@ -18,23 +18,22 @@
\pagecolor[rgb]{0.2,0.2,0.2} \pagecolor[rgb]{0.2,0.2,0.2}
\color[rgb]{0.9,0.9,0.9} \color[rgb]{0.9,0.9,0.9}
\definecolor{PrimeBlue}{RGB}{149, 164, 237}
\definecolor{PrimePaleBlue}{RGB}{35, 39, 56}
\definecolor{pageColor}{rgb}{0.2,0.2,0.2} \definecolor{pageColor}{rgb}{0.2,0.2,0.2}
\definecolor{textColor}{rgb}{0.9,0.9,0.9} \definecolor{textColor}{rgb}{0.9,0.9,0.9}
\definecolor{paleGray}{rgb}{0.3,0.3,0.3} \definecolor{paleGray}{rgb}{0.3,0.3,0.3}
\definecolor{PrimeBlue}{RGB}{149, 164, 237}
\definecolor{PrimePaleBlue}{RGB}{35, 39, 56}
}{ }{
\definecolor{PrimeBlue}{RGB}{25,45,145}
\definecolor{PrimePaleBlue}{RGB}{233,236,251}
\colorlet{pageColor}{white} \colorlet{pageColor}{white}
\colorlet{textColor}{black} \colorlet{textColor}{black}
\colorlet{paleGray}{gray!10} \colorlet{paleGray}{gray!10}
\definecolor{PrimeBlue}{RGB}{25,45,145}
\definecolor{PrimePaleBlue}{RGB}{233,236,251}
} }
\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118} \colorlet{layoutColor}{PrimePaleBlue}
\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0}
\RequirePackage{PrimeTeX/packages/Layout} \RequirePackage{PrimeTeX/packages/Layout}
@@ -45,16 +44,3 @@
\setlength{\fboxsep}{1pt}% \setlength{\fboxsep}{1pt}%
\fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}% \fcolorbox{boxedcoloroutline}{#2}{\color{#3}\strut{}#1}}%
} }
\providelength{\warningboxwidth}[
\textwidth - \fboxsep * 2 - \fboxrule * 2 - 5.56pt % Magic number to make it fit.
]
\NewDocumentCommand{\warningbox}{O{\warningboxwidth} +m}{%
\fcolorbox{WarningBoxFGColor}{WarningBoxBGColor}{%
\begin{minipage}{#1}%
%\rule{\textwidth}{1pt}\zws% For debugging.
#2%
\end{minipage}%
}%
}

View File

@@ -2,20 +2,30 @@
\ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09] \ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09]
% Custom document properties. % Custom document properties.
\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}} \DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}}
\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}} \DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}}
\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}} \DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}}
\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}} \DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}}
\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}} \DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}}
% Macros to insert document properties. % Macros to insert document properties.
\NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}} \NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}}
\NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}} \NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}}
\NewDocumentCommand{\sDate}{}{\makeatletter{\@date}} \NewDocumentCommand{\sDate}{}{\makeatletter{\@date}}
\NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}} \NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}}
\NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}} \NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}}
\NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}} \NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}}
\NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}} \NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}}
\NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}} \NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}}
\NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}} \NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}}
%#endregion
\let\oldAuthor\author
\let\oldTitle\title
\renewcommand{\author}[1]{%
\oldAuthor{#1}%
\hypersetup{pdfauthor=#1}%
}
\renewcommand{\title}[1]{%
\oldTitle{#1}%
\hypersetup{pdftitle=#1}%
}

View File

@@ -54,8 +54,10 @@
\NewDocumentCommand{\slab}{m}{{\sbfamily{}#1}} \NewDocumentCommand{\slab}{m}{{\sbfamily{}#1}}
\NewDocumentCommand{\code}{m}{\mono{\small{}#1}} \NewDocumentCommand{\code}{m}{\mono{\small{}#1}}
\NewDocumentCommand{\objref}{m}{{\sans{\strong{#1}}}}
\RequirePackage{amssymb} \RequirePackage{amssymb}
\RequirePackage[os=win]{menukeys} \RequirePackage[os=win]{menukeys}
\renewmenumacro{\directory}[,]{hyphenatepaths}
\RenewDocumentCommand{\ctrlname}{}{$\wedge$}

View File

@@ -24,12 +24,25 @@
\end{figure}% \end{figure}%
} }
\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{% \NewDocumentCommand{\bigfig}{
\BigFloat[#1]{figure}{% % BigFloat overhang.
O{\bigfloatoverhang}
% Float positioning.
O{htpb}
% BigFloat offset ratio.
O{\bigfloatoffsetratio}
% Graphic file.
m
% Label.
>{\TrimSpaces}m
% Caption.
m
}{%
\BigFloat[#1][#2][#3]{figure}{%
\captionsetup{type=figure}% \captionsetup{type=figure}%
\includegraphics[keepaspectratio,width=\linewidth]{#2}% \includegraphics[keepaspectratio,width=\linewidth]{#4}%
\Centering\captionof{figure}{#4}%\par \Centering\captionof{figure}{#6}%\par
\label{fig:#3}% \label{fig:#5}%
}% }%
} }

View File

@@ -3,11 +3,9 @@
\RequirePackage{PrimeTeX/packages/Layout} \RequirePackage{PrimeTeX/packages/Layout}
\providelength{\insideheaderoffset}[ \providelength{\insideheaderoffset}[\bigfloatoverhang]
\bigfloatoverhang * \real{\bigfloatoffsetratio}
]
\providelength{\outsideheaderoffset}[ \providelength{\outsideheaderoffset}[
\bigfloatoverhang / \real{\bigfloatoffsetratio} \bigfloatoverhang * \real{\bigfloatoffsetratio}
] ]
% Header & Footer Options % Header & Footer Options

View File

@@ -3,11 +3,6 @@
% Suppress warning about \showhyphens being changed. % Suppress warning about \showhyphens being changed.
\let\CheckCommand\providecommand \let\CheckCommand\providecommand
% Suppress "Underfull \hbox" infos.
\hbadness=10000
% Suppress small overfull infos.
\hfuzz = 0.0pt
\vfuzz = 0.0pt
\NewDocumentCommand{\providelength}{m O{0pt}}{% \NewDocumentCommand{\providelength}{m O{0pt}}{%
\ifdeflength{#1}{% It is already defined! \ifdeflength{#1}{% It is already defined!
@@ -33,10 +28,21 @@
footskip = 0.5in, % 36pt, footskip = 0.5in, % 36pt,
]{geometry} ]{geometry}
\renewcommand{\Gm@vrule}{\color{layoutColor}\vrule width 0.2pt height\textheight depth\z@}
\renewcommand{\Gm@hrule}{\color{layoutColor}\hrule height 0.2pt depth\z@ width\textwidth}
\renewcommand{\Gm@hruled}{\color{layoutColor}\hrule height\z@ depth0.2pt width\textwidth}
% Suppress "Underfull \hbox" infos.
\hbadness=10000
\ifthenelse{\boolean{isDraft}}{ \ifthenelse{\boolean{isDraft}}{
% \geometry{showcrop}
\geometry{showframe} \geometry{showframe}
}{} \hfuzz = 2.0pt
}{
% Suppress small overfull infos.
\hfuzz = 6.0pt
\vfuzz = 0.0pt
}
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
% \geometry{} % \geometry{}
@@ -79,15 +85,13 @@
% Line-breaking dot % Line-breaking dot
\NewDocumentCommand{\bdot}{}{.\zws} \NewDocumentCommand{\bdot}{}{.\zws}
\newcommand{\bigfloatoffsetratio}{0.667} \newcommand{\bigfloatoffsetratio}{2}
% Maximum width adjustment to fit 2 16x9 screensots on one page. % Maximum width adjustment to fit 2 16x9 screensots on one page.
\providelength{\bigfloatoverhang}[0.81in] \providelength{\bigfloatoverhang}[0.54in]
\providecommand{\adjwidthtype}{} \providecommand{\adjwidthtype}{}
\makeatletter
\NewDocumentCommand{\BigFloat}{ \NewDocumentCommand{\BigFloat}{
% Overhang: the distance that the BigFloat extends into the margins. % Overhang: the distance that the BigFloat extends into the margins.
O{\bigfloatoverhang} O{\bigfloatoverhang}
@@ -96,35 +100,36 @@
% 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{\bigfloatoffsetratio} O{\bigfloatoffsetratio}
% Float type: figure or table.t % Float type: figure or table.
m m
% Content: what appears in the BigFloat. % Content: what appears in the BigFloat.
+m +m
}{% }{%
\ifthenelse{\boolean{isElectronic}}{% \ifthenelse{\boolean{isElectronic}}{%
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}% \@bigfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth}%
}{% }{%
\@bfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}% \@bigfloat{#1}{#2}{#3}{#4}{#5}{adjustwidth*}%
}% }%
} }
\NewDocumentCommand{\@bfloat}{ \NewDocumentCommand{\@bigfloat}{
% First 5 arguments are same as \BigFloat. % First 5 arguments are same as \BigFloat.
m m m m +m m m m m +m
% Argument 6 is the adjustwidth type [adjustwidth for one-sided document, % Argument 6 is the adjustwidth type:
% adjustwidth* for two-sided]. % adjustwidth for one-sided document; adjustwidth* for two-sided.
m m
}{ }{
\begin{#4}[#2]% figure/table \begin{#4}[#2]% figure/table
\begin{#6}{-#1 * \real{#3}}{-#1 / \real{#3}}% adjustwidth(*) \begin{#6}{-#1}{-#1 * \real{#3}}% adjustwidth(*)
\begin{minipage}{#1 * 2 + \textwidth}% \begin{minipage}{#1 * (#3 + 1) + \textwidth}%
\ifthenelse{\boolean{isDraft}}{% \ifthenelse{\boolean{isDraft}}{%
\rule{\textwidth}{1pt}\zws% {\color{layoutColor}\rule{\textwidth}{1pt}\zws}%
}{}% #5%
#5% %{\color{layoutColor}\rule{\textwidth}{1pt}}%
}{%
#5%
}%
\end{minipage}% \end{minipage}%
\end{#6}% \end{#6}%
\end{#4}% \end{#4}%
} }
\makeatother

View File

@@ -9,14 +9,15 @@
\ifthenelse{\boolean{isElectronic}}{ \ifthenelse{\boolean{isElectronic}}{
\hypersetup{ \hypersetup{
final, final,
colorlinks=true, colorlinks = true,
allcolors=PrimeBlue, allcolors = PrimeBlue,
pdfpagemode = UseOutlines,
} }
}{ }{
\hypersetup{ \hypersetup{
final, final,
colorlinks=true, colorlinks = true,
allcolors=textColor allcolors = textColor,
} }
} }