diff --git a/packages/Boxout.sty b/packages/Boxout.sty index bcbadbb..400c175 100644 --- a/packages/Boxout.sty +++ b/packages/Boxout.sty @@ -9,34 +9,58 @@ \providelength{\boxoutpadding}[1em] \providelength{\boxoutrule}[1pt] -\colorlet{boxoutbgcolor}{PrimePaleBlue} -\colorlet{boxoutfgcolor}{PrimeBlue} +\colorlet{BoxoutBGColor}{PrimePaleBlue} +\colorlet{BoxoutFGColor}{PrimeBlue} + +\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118} +\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0} \NewTblrEnviron{tblrBoxout} \SetTblrInner[tblrBoxout]{ - %colspec = {X[1,l,h]}, - cells = {boxoutbgcolor}, - hlines = {0pt}, - hline{1,Z} = {\boxoutrule,boxoutfgcolor}, - row{1} = {font={\bfseries\sbfamily}}, + cells = {BoxoutBGColor}, + hborder{1} = {belowspace=\boxoutpadding}, + hborder{Z} = {abovespace=\boxoutpadding}, + hlines = {0pt,BoxoutBGColor}, + hline{1,Z} = {\boxoutrule,BoxoutFGColor}, + %row{1} = {font={\bfseries\sbfamily}}, vborder{1} = {rightspace=\boxoutpadding}, vborder{Z} = {leftspace=\boxoutpadding}, - vlines = {0pt}, - vline{1,Z} = {\boxoutrule,boxoutfgcolor}, + vlines = {0pt,BoxoutBGColor}, + vline{1,Z} = {\boxoutrule,BoxoutFGColor}, } +\NewDocumentEnvironment{@boxout}{ + m m +b +}{ + \label{box:#2}% + \begin{tblrBoxout}{#1}% + #3% + \end{tblrBoxout}% +}{} + \NewDocumentEnvironment{Boxout}{ O{colspec={X[l,h]}} >{\TrimSpaces}m +m + o +b }{% - \label{box:#2}% - \captionlistentry[figure]{#3}% - \begin{tblrBoxout}{#1}% - {\Centering{}#3}\\% - #4\\% - \end{tblrBoxout}% + \ifthenelse{\equal{#4}{w}\OR\equal{#4}{W}}{% + \colorlet{BoxoutBGColor}{WarningBoxBGColor}% + \colorlet{BoxoutFGColor}{WarningBoxFGColor}% + }{}% + \IfBlankTF{#3}{% + \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}{ @@ -46,12 +70,13 @@ O{X[l,h]} >{\TrimSpaces}m +m + o +b }{ \begin{figure}[#2]% - \begin{adjustwidth}{-#1 * \real{#3}}{-#1 / \real{#3}}% - \begin{Boxout}[#4]{#5}{#6}% - #7% + \begin{adjustwidth}{-#1}{-#1 * \real{#3}}% + \begin{Boxout}[#4]{#5}{#6}[#7]% + #8% \end{Boxout}% \end{adjustwidth}% \end{figure}% @@ -67,12 +92,13 @@ O{X[l,h]} >{\TrimSpaces}m +m + o +b }{% \begin{wrapfigure}{#1}[#2]% \begin{minipage}{#3}% - \begin{Boxout}[#4]{#5}{#6}% - #7% + \begin{Boxout}[#4]{#5}{#6}[#7]% + #8% \end{Boxout}% \end{minipage}% \end{wrapfigure}% diff --git a/packages/Color.sty b/packages/Color.sty index 0b1492e..fdd9f46 100644 --- a/packages/Color.sty +++ b/packages/Color.sty @@ -18,23 +18,22 @@ \pagecolor[rgb]{0.2,0.2,0.2} \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{textColor}{rgb}{0.9,0.9,0.9} \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{textColor}{black} \colorlet{paleGray}{gray!10} - - \definecolor{PrimeBlue}{RGB}{25,45,145} - \definecolor{PrimePaleBlue}{RGB}{233,236,251} } -\definecolor{WarningBoxBGColor}{RGB}{255, 221, 118} -\definecolor{WarningBoxFGColor}{RGB}{255, 150, 0} +\colorlet{layoutColor}{PrimePaleBlue} \RequirePackage{PrimeTeX/packages/Layout} @@ -44,17 +43,4 @@ {\setlength{\fboxrule}{0.2pt}% Temporarily set \fboxrule and \fboxsep. \setlength{\fboxsep}{1pt}% \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}% - }% } \ No newline at end of file diff --git a/packages/DocProperties.sty b/packages/DocProperties.sty index 35676ce..736f9eb 100644 --- a/packages/DocProperties.sty +++ b/packages/DocProperties.sty @@ -2,20 +2,30 @@ \ProvidesPackage{PrimeTeX/packages/DocProperties}[2025-07-09] % Custom document properties. - \DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}} - \DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}} - \DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}} - \DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}} - \DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}} +\DeclareRobustCommand*{\customer}[1]{\gdef\@customer{#1}} +\DeclareRobustCommand*{\customerFull}[1]{\gdef\@customerFull{#1}} +\DeclareRobustCommand*{\projectNumber}[1]{\gdef\@projectNumber{#1}} +\DeclareRobustCommand*{\projectDesc}[1]{\gdef\@projectDesc{#1}} +\DeclareRobustCommand*{\version}[1]{\gdef\@version{#1}} % Macros to insert document properties. - \NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}} - \NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}} - \NewDocumentCommand{\sDate}{}{\makeatletter{\@date}} - \NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}} - \NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}} - \NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}} - \NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}} - \NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}} - \NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}} -%#endregion \ No newline at end of file +\NewDocumentCommand{\sTitle}{}{\makeatletter{\@title}} +\NewDocumentCommand{\sAuthor}{}{\makeatletter{\@author}} +\NewDocumentCommand{\sDate}{}{\makeatletter{\@date}} +\NewDocumentCommand{\sCustomer}{}{\makeatletter{\@customer}} +\NewDocumentCommand{\sCustomerFull}{}{\makeatletter{\@customerFull}} +\NewDocumentCommand{\sProjectNumber}{}{\makeatletter{\@projectNumber}} +\NewDocumentCommand{\sProjectDesc}{}{\makeatletter{\@projectDesc}} +\NewDocumentCommand{\sProjectTitle}{}{\makeatletter{Project \@projectNumber : \@projectDesc}} +\NewDocumentCommand{\sVersion}{}{\makeatletter{\@version}} + +\let\oldAuthor\author +\let\oldTitle\title +\renewcommand{\author}[1]{% + \oldAuthor{#1}% + \hypersetup{pdfauthor=#1}% +} +\renewcommand{\title}[1]{% + \oldTitle{#1}% + \hypersetup{pdftitle=#1}% +} \ No newline at end of file diff --git a/packages/Fonts.sty b/packages/Fonts.sty index 6dde8d9..3c59091 100644 --- a/packages/Fonts.sty +++ b/packages/Fonts.sty @@ -54,8 +54,10 @@ \NewDocumentCommand{\slab}{m}{{\sbfamily{}#1}} \NewDocumentCommand{\code}{m}{\mono{\small{}#1}} -\NewDocumentCommand{\objref}{m}{{\sans{\strong{#1}}}} - \RequirePackage{amssymb} -\RequirePackage[os=win]{menukeys} \ No newline at end of file +\RequirePackage[os=win]{menukeys} + +\renewmenumacro{\directory}[,]{hyphenatepaths} + +\RenewDocumentCommand{\ctrlname}{}{$\wedge$} \ No newline at end of file diff --git a/packages/Graphics.sty b/packages/Graphics.sty index f7514da..f42d48a 100644 --- a/packages/Graphics.sty +++ b/packages/Graphics.sty @@ -24,12 +24,25 @@ \end{figure}% } -\NewDocumentCommand{\bigfig}{O{\bigfloatoverhang} m >{\TrimSpaces}m m}{% - \BigFloat[#1]{figure}{% +\NewDocumentCommand{\bigfig}{ + % 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}% - \includegraphics[keepaspectratio,width=\linewidth]{#2}% - \Centering\captionof{figure}{#4}%\par - \label{fig:#3}% + \includegraphics[keepaspectratio,width=\linewidth]{#4}% + \Centering\captionof{figure}{#6}%\par + \label{fig:#5}% }% } diff --git a/packages/Header.sty b/packages/Header.sty index 0734cd3..516e9eb 100644 --- a/packages/Header.sty +++ b/packages/Header.sty @@ -3,11 +3,9 @@ \RequirePackage{PrimeTeX/packages/Layout} -\providelength{\insideheaderoffset}[ - \bigfloatoverhang * \real{\bigfloatoffsetratio} -] +\providelength{\insideheaderoffset}[\bigfloatoverhang] \providelength{\outsideheaderoffset}[ - \bigfloatoverhang / \real{\bigfloatoffsetratio} + \bigfloatoverhang * \real{\bigfloatoffsetratio} ] % Header & Footer Options diff --git a/packages/Layout.sty b/packages/Layout.sty index dae4121..f4b375a 100644 --- a/packages/Layout.sty +++ b/packages/Layout.sty @@ -3,11 +3,6 @@ % Suppress warning about \showhyphens being changed. \let\CheckCommand\providecommand -% Suppress "Underfull \hbox" infos. -\hbadness=10000 -% Suppress small overfull infos. -\hfuzz = 0.0pt -\vfuzz = 0.0pt \NewDocumentCommand{\providelength}{m O{0pt}}{% \ifdeflength{#1}{% It is already defined! @@ -33,10 +28,21 @@ footskip = 0.5in, % 36pt, ]{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}}{ -% \geometry{showcrop} \geometry{showframe} -}{} + \hfuzz = 2.0pt +}{ + % Suppress small overfull infos. + \hfuzz = 6.0pt + \vfuzz = 0.0pt +} \ifthenelse{\boolean{isElectronic}}{ % \geometry{} @@ -79,15 +85,13 @@ % Line-breaking dot \NewDocumentCommand{\bdot}{}{.\zws} -\newcommand{\bigfloatoffsetratio}{0.667} +\newcommand{\bigfloatoffsetratio}{2} % Maximum width adjustment to fit 2 16x9 screensots on one page. -\providelength{\bigfloatoverhang}[0.81in] +\providelength{\bigfloatoverhang}[0.54in] \providecommand{\adjwidthtype}{} -\makeatletter - \NewDocumentCommand{\BigFloat}{ % Overhang: the distance that the BigFloat extends into the margins. O{\bigfloatoverhang} @@ -96,35 +100,36 @@ % Offset: the distance to offset the center of the BigFloat from the center % of the text block. O{\bigfloatoffsetratio} - % Float type: figure or table.t + % Float type: figure or table. m % Content: what appears in the BigFloat. +m }{% \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. m m m m +m - % Argument 6 is the adjustwidth type [adjustwidth for one-sided document, - % adjustwidth* for two-sided]. + % Argument 6 is the adjustwidth type: + % adjustwidth for one-sided document; adjustwidth* for two-sided. m }{ \begin{#4}[#2]% figure/table - \begin{#6}{-#1 * \real{#3}}{-#1 / \real{#3}}% adjustwidth(*) - \begin{minipage}{#1 * 2 + \textwidth}% + \begin{#6}{-#1}{-#1 * \real{#3}}% adjustwidth(*) + \begin{minipage}{#1 * (#3 + 1) + \textwidth}% \ifthenelse{\boolean{isDraft}}{% - \rule{\textwidth}{1pt}\zws% - }{}% - #5% + {\color{layoutColor}\rule{\textwidth}{1pt}\zws}% + #5% + %{\color{layoutColor}\rule{\textwidth}{1pt}}% + }{% + #5% + }% \end{minipage}% \end{#6}% \end{#4}% -} - -\makeatother \ No newline at end of file +} \ No newline at end of file diff --git a/packages/Links.sty b/packages/Links.sty index e0f50b3..95404a0 100644 --- a/packages/Links.sty +++ b/packages/Links.sty @@ -9,14 +9,15 @@ \ifthenelse{\boolean{isElectronic}}{ \hypersetup{ final, - colorlinks=true, - allcolors=PrimeBlue, + colorlinks = true, + allcolors = PrimeBlue, + pdfpagemode = UseOutlines, } }{ \hypersetup{ final, - colorlinks=true, - allcolors=textColor + colorlinks = true, + allcolors = textColor, } }